diff --git a/src/main/native/c/drbg.c b/src/main/native/c/drbg.c index 8d21813..7f360e2 100644 --- a/src/main/native/c/drbg.c +++ b/src/main/native/c/drbg.c @@ -15,8 +15,8 @@ * */ #include -#include #include +#include #include DRBGParams NO_PARAMS = { DEFAULT_STRENGTH, 0, 0, NULL, 0, NULL, 0 }; @@ -148,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 arc4random_buf(output, n_bytes); + return getrandom(output, n_bytes, 0); } } @@ -159,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; - arc4random_buf(seed, length); + getrandom(seed, length, 0); EVP_RAND_reseed(generator->context, params->prediction_resistance, seed, length, params->additional_data, params->additional_data_length); }