diff options
Diffstat (limited to 'security/nss/lib/freebl/secrng.h')
-rw-r--r-- | security/nss/lib/freebl/secrng.h | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/security/nss/lib/freebl/secrng.h b/security/nss/lib/freebl/secrng.h index d3e97c927..036a3f71a 100644 --- a/security/nss/lib/freebl/secrng.h +++ b/security/nss/lib/freebl/secrng.h @@ -51,11 +51,14 @@ #include "blapi.h" +/* the number of bytes to read from the system random number generator */ +#define SYSTEM_RNG_SEED_COUNT 1024 + SEC_BEGIN_PROTOS /* -** The following 3 functions are provided by the security library -** but are differently implemented for the UNIX, Mac and Win +** The following functions are provided by the security library +** but are differently implemented for the UNIX, Win, and OS/2 ** versions */ @@ -80,6 +83,17 @@ extern void RNG_SystemInfoForRNG(void); */ extern void RNG_FileForRNG(const char *filename); +/* +** Get maxbytes bytes of random data from the system random number +** generator. +** Returns the number of bytes copied into buf -- maxbytes if success +** or zero if error. +** Errors: +** PR_NOT_IMPLEMENTED_ERROR There is no system RNG on the platform. +** SEC_ERROR_NEED_RANDOM The system RNG failed. +*/ +extern size_t RNG_SystemRNG(void *buf, size_t maxbytes); + SEC_END_PROTOS #endif /* _SECRNG_H_ */ |