/* DRBG flags */
-/* PRNG is in test state */
-#define DRBG_FLAG_TEST 0x2
/* Functions shouldn't call err library */
#define DRBG_FLAG_NOERR 0x4
/* fatal error condition */
#define DRBG_STATUS_ERROR 3
-/* Maximum values for temp entropy and nonce */
-#define DRBG_MAX_ENTROPY 1024
-#define DRBG_MAX_NONCE 1024
-
/* A default maximum length: larger than any reasonable value used in pratice */
#define DRBG_MAX_LENGTH 0x7ffffff0
/* uninstantiate */
int (*uninstantiate)(DRBG_CTX *ctx);
- unsigned char entropy[DRBG_MAX_ENTROPY];
-
/* entropy gathering function */
- size_t (*get_entropy)(DRBG_CTX *ctx, unsigned char *out,
+ size_t (*get_entropy)(DRBG_CTX *ctx, unsigned char **pout,
int entropy, size_t min_len, size_t max_len);
-
- unsigned char nonce[DRBG_MAX_NONCE];
+ /* Indicates we have finished with entropy buffer */
+ void (*cleanup_entropy)(DRBG_CTX *ctx, unsigned char *out, size_t olen);
/* nonce gathering function */
- size_t (*get_nonce)(DRBG_CTX *ctx, unsigned char *out,
+ size_t (*get_nonce)(DRBG_CTX *ctx, unsigned char **pout,
int entropy, size_t min_len, size_t max_len);
+ /* Indicates we have finished with nonce buffer */
+ void (*cleanup_nonce)(DRBG_CTX *ctx, unsigned char *out, size_t olen);
/* Continuous random number test temporary area */
/* Last block */