# BRCM_VERSION=3
[bcm963xx.git] / userapps / opensource / sshd / libtomcrypt / sprng.c
1 /* A secure PRNG using the RNG functions.  Basically this is a
2  * wrapper that allows you to use a secure RNG as a PRNG
3  * in the various other functions.
4  */
5 #include "mycrypt.h"
6
7 #ifdef SPRNG
8
9 const struct _prng_descriptor sprng_desc =
10 {
11     "sprng",
12     &sprng_start,
13     &sprng_add_entropy,
14     &sprng_ready,
15     &sprng_read
16 };
17
18 int sprng_start(prng_state *prng)
19 {
20    return CRYPT_OK;  
21 }
22
23 int sprng_add_entropy(const unsigned char *buf, unsigned long len, prng_state *prng)
24 {
25    return CRYPT_OK;
26 }
27
28 int sprng_ready(prng_state *prng)
29 {
30    return CRYPT_OK;
31 }
32
33 unsigned long sprng_read(unsigned char *buf, unsigned long len, prng_state *prng)
34 {
35    _ARGCHK(buf != NULL);
36    return rng_get_bytes(buf, len, NULL);
37 }
38
39 #endif
40
41
42