diff options
Diffstat (limited to 'src/random.h')
-rw-r--r-- | src/random.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/random.h b/src/random.h index 664f030eba..0464bdce14 100644 --- a/src/random.h +++ b/src/random.h @@ -46,4 +46,21 @@ public: uint32_t Rw; }; +/* Number of random bytes returned by GetOSRand. + * When changing this constant make sure to change all call sites, and make + * sure that the underlying OS APIs for all platforms support the number. + * (many cap out at 256 bytes). + */ +static const ssize_t NUM_OS_RANDOM_BYTES = 32; + +/** Get 32 bytes of system entropy. Do not use this in application code: use + * GetStrongRandBytes instead. + */ +void GetOSRand(unsigned char *ent32); + +/** Check that OS randomness is available and returning the requested number + * of bytes. + */ +bool Random_SanityCheck(); + #endif // BITCOIN_RANDOM_H |