Permalink
Browse files

Check that PRNG has been initialised from hydro_random_buf

Fixes #36
  • Loading branch information...
daurnimator committed Feb 2, 2019
1 parent 471b749 commit 69a49a523e01769aa0be95cd3304c1da441bdc5c
Showing with 1 addition and 0 deletions.
  1. +1 −0 impl/random.h
@@ -324,6 +324,7 @@ hydro_random_buf(void *out, size_t out_len)
size_t i;
size_t leftover;

hydro_random_check_initialized();
for (i = 0; i < out_len / gimli_RATE; i++) {
gimli_core_u8(hydro_random_context.state, 0);
memcpy(p + i * gimli_RATE, hydro_random_context.state, gimli_RATE);

0 comments on commit 69a49a5

Please sign in to comment.