Skip to content

Commit 1f607ee

Browse files
authored
Merge pull request #5860 from tmael/entropy_memuse
Increase RNG_SECURITY_STRENGTH for FIPS
2 parents 099135b + 1e08861 commit 1f607ee

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

wolfcrypt/src/random.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,12 @@ int wc_RNG_GenerateByte(WC_RNG* rng, byte* b)
258258
* minimum bits of entropy per bit of NDRNG output. */
259259
#if defined(HAVE_ENTROPY_MEMUSE)
260260
/* Full strength, conditioned entropy is requested of MemUse Entropy. */
261-
#define ENTROPY_SCALE_FACTOR (1)
261+
#if defined(HAVE_FIPS) && defined(HAVE_FIPS_VERSION) && \
262+
(HAVE_FIPS_VERSION >= 2)
263+
#define ENTROPY_SCALE_FACTOR (4)
264+
#else
265+
#define ENTROPY_SCALE_FACTOR (1)
266+
#endif
262267
#elif defined(HAVE_AMD_RDSEED)
263268
/* This will yield a SEED_SZ of 16kb. Since nonceSz will be 0,
264269
* we'll add an additional 8kb on top. */

0 commit comments

Comments
 (0)