diff --git a/src/main/native/c/drbg.c b/src/main/native/c/drbg.c index fdd3434..8d21813 100644 --- a/src/main/native/c/drbg.c +++ b/src/main/native/c/drbg.c @@ -15,6 +15,7 @@ * */ #include +#include #include #include @@ -147,7 +148,7 @@ int generate_seed(DRBG* generator, byte output[], int n_bytes) { if (parent != NULL) { return next_rand(parent, output, n_bytes); } else { - return getentropy(output, n_bytes); + return arc4random_buf(output, n_bytes); } } @@ -158,7 +159,7 @@ void reseed(DRBG* generator) { void reseed_with_params(DRBG *generator, DRBGParams *params) { byte seed[128]; // TODO: what should the default seed size be? size_t length = 128; - getentropy(seed, length); + arc4random_buf(seed, length); EVP_RAND_reseed(generator->context, params->prediction_resistance, seed, length, params->additional_data, params->additional_data_length); }