diff options
Diffstat (limited to 'crypto_desc.c')
-rw-r--r-- | crypto_desc.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/crypto_desc.c b/crypto_desc.c index 0f946fc..50b63dc 100644 --- a/crypto_desc.c +++ b/crypto_desc.c @@ -3,11 +3,18 @@ #include "crypto_desc.h" #include "ltc_prng.h" #include "ecc.h" +#include "dbrandom.h" #if DROPBEAR_LTC_PRNG int dropbear_ltc_prng = -1; #endif +/* Wrapper for libtommath */ +static mp_err dropbear_rand_source(void* out, size_t size) { + genrandom((unsigned char*)out, (unsigned int)size); + return MP_OKAY; +} + /* Register the compiled in ciphers. * This should be run before using any of the ciphers/hashes */ @@ -67,6 +74,8 @@ void crypto_init() { } #endif + mp_rand_source(dropbear_rand_source); + #if DROPBEAR_ECC ltc_mp = ltm_desc; dropbear_ecc_fill_dp(); |