Mercurial > dropbear
diff random.c @ 755:b07eb3dc23ec ecc
refactor kexdh code a bit, start working on ecdh etc
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Tue, 26 Mar 2013 01:35:22 +0800 |
parents | 84157e435c52 |
children | 76fba0856749 |
line wrap: on
line diff
--- a/random.c Sun Mar 24 00:02:20 2013 +0800 +++ b/random.c Tue Mar 26 01:35:22 2013 +0800 @@ -36,6 +36,8 @@ static unsigned char hashpool[SHA1_HASH_SIZE] = {0}; static int donerandinit = 0; +int dropbear_ltc_prng = -1; + #define INIT_SEED_SIZE 32 /* 256 bits */ /* The basic setup is we read some data from /dev/(u)random or prngd and hash it @@ -231,6 +233,13 @@ sha1_done(&hs, hashpool); +#ifdef DROPBEAR_LTC_PRNG + if (dropbear_ltc_prng == -1) { + dropbear_ltc_prng = register_prng(&dropbear_prng_desc); + dropbear_assert(dropbear_ltc_prng != -1); + } +#endif + counter = 0; donerandinit = 1;