1
/* LibTomCrypt, modular cryptographic library -- Tom St Denis
3
* LibTomCrypt is a library that provides various cryptographic
4
* algorithms in a highly modular and flexible manner.
6
* The library is free for all purposes without any express
9
* Tom St Denis, tomstdenis@iahu.ca, http://libtomcrypt.org
12
/* A secure PRNG using the RNG functions. Basically this is a
13
* wrapper that allows you to use a secure RNG as a PRNG
14
* in the various other functions.
20
const struct _prng_descriptor sprng_desc =
33
int sprng_start(prng_state *prng)
38
int sprng_add_entropy(const unsigned char *buf, unsigned long len, prng_state *prng)
43
int sprng_ready(prng_state *prng)
48
unsigned long sprng_read(unsigned char *buf, unsigned long len, prng_state *prng)
51
return rng_get_bytes(buf, len, NULL);
54
int sprng_done(prng_state *prng)
59
int sprng_export(unsigned char *out, unsigned long *outlen, prng_state *prng)
61
_ARGCHK(outlen != NULL);
67
int sprng_import(const unsigned char *in, unsigned long inlen, prng_state *prng)