diff options
author | NIIBE Yutaka <gniibe@fsij.org> | 2021-11-17 14:54:02 +0900 |
---|---|---|
committer | NIIBE Yutaka <gniibe@fsij.org> | 2021-11-17 14:54:02 +0900 |
commit | cf85258e6aff87f5b0614097b4ff2972ceb703fd (patch) | |
tree | 63e0f85f9b7d0af46dce062fa60983855fef0019 /random/jitterentropy-noise.c | |
parent | 964c9c5eee30cc45488b88ec4c0199a41861e4aa (diff) | |
download | libgcrypt-cf85258e6aff87f5b0614097b4ff2972ceb703fd.tar.gz |
jitterentropy: Fix for C90 compiler.
* random/jitterentropy-noise.c (jent_hash_time): Declare hash_loop_cnt
at the beginning of the function.
--
GnuPG-bug-id: 5523
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
Diffstat (limited to 'random/jitterentropy-noise.c')
-rw-r--r-- | random/jitterentropy-noise.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/random/jitterentropy-noise.c b/random/jitterentropy-noise.c index 0802650f..75443a8f 100644 --- a/random/jitterentropy-noise.c +++ b/random/jitterentropy-noise.c @@ -106,12 +106,13 @@ static void jent_hash_time(struct rand_data *ec, uint64_t time, HASH_CTX_ON_STACK(ctx); uint8_t itermediary[SHA3_256_SIZE_DIGEST]; uint64_t j = 0; + uint64_t hash_loop_cnt; #define MAX_HASH_LOOP 3 #define MIN_HASH_LOOP 0 /* Ensure that macros cannot overflow jent_loop_shuffle() */ BUILD_BUG_ON((MAX_HASH_LOOP + MIN_HASH_LOOP) > 63); - uint64_t hash_loop_cnt = + hash_loop_cnt = jent_loop_shuffle(ec, MAX_HASH_LOOP, MIN_HASH_LOOP); sha3_256_init(&ctx); @@ -189,10 +190,11 @@ static void jent_memaccess(struct rand_data *ec, uint64_t loop_cnt) uint8_t b[sizeof(uint32_t) * 4]; } prngState = { .u = {0x8e93eec0, 0xce65608a, 0xa8d46b46, 0xe83cef69} }; uint32_t addressMask = ec->memmask; + uint64_t acc_loop_cnt; /* Ensure that macros cannot overflow jent_loop_shuffle() */ BUILD_BUG_ON((MAX_ACC_LOOP_BIT + MIN_ACC_LOOP_BIT) > 63); - uint64_t acc_loop_cnt = + acc_loop_cnt = jent_loop_shuffle(ec, MAX_ACC_LOOP_BIT, MIN_ACC_LOOP_BIT); if (NULL == ec || NULL == ec->mem) |