From e363eccc59856be40db5a6f991cba3e10865efa9 Mon Sep 17 00:00:00 2001 From: ENGO150 Date: Fri, 10 Jan 2025 17:55:45 +0100 Subject: [PATCH] defined seeded-rand fns --- src/core/lib/utils/crypto.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/core/lib/utils/crypto.c b/src/core/lib/utils/crypto.c index a7ddaac..643fc50 100644 --- a/src/core/lib/utils/crypto.c +++ b/src/core/lib/utils/crypto.c @@ -18,6 +18,7 @@ along with this program. If not, see . #include +#include #include #include #include @@ -50,4 +51,14 @@ unsigned long long why2_sum_segment(char *input) //THE OUTPUT IS GOING TO GROW A ssize_t why2_random(void *dest, size_t size) { return getrandom(dest, size, GRND_NONBLOCK); +} + +void why2_seed_random(unsigned int seed) +{ + srand(seed); +} + +int why2_seeded_random() +{ + return rand(); } \ No newline at end of file