disable ltc_rng by default

This commit is contained in:
Steffen Jaeckel
2017-03-22 11:24:21 +01:00
parent fcae7e2c49
commit cd08a8cec3
6 changed files with 18 additions and 0 deletions
+3
View File
@@ -304,6 +304,9 @@
/* rng_make_prng() */
#define LTC_RNG_MAKE_PRNG
/* enable the ltc_rng hook to integrate e.g. embedded hardware RNG's easily */
/* #define LTC_PRNG_ENABLE_LTC_RNG */
#endif /* LTC_NO_PRNGS */
#ifdef LTC_YARROW
+2
View File
@@ -193,8 +193,10 @@ unsigned long rng_get_bytes(unsigned char *out,
int rng_make_prng(int bits, int wprng, prng_state *prng, void (*callback)(void));
#ifdef LTC_PRNG_ENABLE_LTC_RNG
extern unsigned long (*ltc_rng)(unsigned char *out, unsigned long outlen,
void (*callback)(void));
#endif
/* $Source$ */
+3
View File
@@ -371,6 +371,9 @@ const char *crypt_build_settings =
#if defined(LTC_RNG_MAKE_PRNG)
" LTC_RNG_MAKE_PRNG "
#endif
#if defined(LTC_PRNG_ENABLE_LTC_RNG)
" LTC_PRNG_ENABLE_LTC_RNG "
#endif
#if defined(LTC_HASH_HELPERS)
" LTC_HASH_HELPERS "
#endif
@@ -10,4 +10,6 @@
*/
#include "tomcrypt.h"
#ifdef LTC_PRNG_ENABLE_LTC_RNG
unsigned long (*ltc_rng)(unsigned char *out, unsigned long outlen, void (*callback)(void));
#endif
+2
View File
@@ -135,12 +135,14 @@ unsigned long rng_get_bytes(unsigned char *out, unsigned long outlen,
LTC_ARGCHK(out != NULL);
#ifdef LTC_PRNG_ENABLE_LTC_RNG
if (ltc_rng) {
x = ltc_rng(out, outlen, callback);
if (x != 0) {
return x;
}
}
#endif
#if defined(_WIN32) || defined(_WIN32_WCE)
x = rng_win32(out, outlen, callback); if (x != 0) { return x; }