Crypt::Nettle::Yarrow(3) Perl interface to the Yarrow256 random number generator from libnettle

SYNOPSIS


use Crypt::Nettle::Yarrow;
my $devrandom = IO::File->new('/dev/random', 'r');
my $seed;
$devrandom->read($seed, Crypt::Nettle::Yarrow::SEED_FILE_SIZE);
my $rng = Crypt::Nettle::Yarrow->new();
$rng->seed($devrandom->read();
my $data = $rng->random(32);

ABSTRACT

Crypt::Nettle::Yarrow provides an object interface to the Yarrow256 random number generator from the nettle C library.

BASIC OPERATIONS

new()

Create a new Yarrow256 PRNG.

seed($data)

Set up an initial seed of the generator from unguessable $data.

random($length)

Return a scalar with $length random octets.

is_seeded()

Returns 1 if the generator is seeded.

VARIABLES

SEED_FILE_SIZE

The size of the seed file for Yarrow256.

DANGEROUS OPERATIONS

fast_reseed()

slow_reseed()

Cause a fast or slow reseed to take place immediately, regardless of the current entropy estimates of the two pools. Use with care.

BUGS AND FEEDBACK

Updating the pool is not yet implemented.

It would be nice to have a convenience function for seeding from /dev/random if the file is available.

Crypt::Nettle::Yarrow has no other known bugs, mostly because no one has found them yet. Please write mail to the maintainer ([email protected]) with your contributions, comments, suggestions, bug reports or complaints.

AUTHORS AND CONTRIBUTORS

Daniel Kahn Gillmor <[email protected]>

COPYRIGHT AND LICENSE

Copyright AX Daniel Kahn Gillmor

Crypt::Nettle::Yarrow is free software, you may redistribute it and/or modify it under the GPL version 2 or later (your choice). Please see the COPYING file for the full text of the GPL.

DISCLAIMER

This software is provided by the copyright holders and contributors ``as is'' and any express or implied warranties, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose are disclaimed. In no event shall the contributors be liable for any direct, indirect, incidental, special, exemplary, or consequential damages (including, but not limited to, procurement of substitute goods or services; loss of use, data, or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage.