Permalink
Browse files

Merge pull request #37 from daurnimator/check-prng-init

Check that PRNG has been initialised from hydro_random_buf
  • Loading branch information...
jedisct1 committed Feb 2, 2019
2 parents 471b749 + 69a49a5 commit 1514e4dd99772914bac8c91619b32d7c999cd806
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 1514e4d

Please sign in to comment.