Hash unification: address PR feedback

This commit is contained in:
Johanna Amann 2020-05-13 14:07:59 +00:00
parent 7f137b7d50
commit ce8b121e12
8 changed files with 33 additions and 29 deletions

View file

@ -1031,7 +1031,7 @@ static bool read_random_seeds(const char* read_file, uint32_t* seed,
}
// Read seeds for hmac-md5/siphash/highwayhash.
for ( int i = 0; i < KeyedHash::SEED_INIT_SIZE; ++i )
for ( auto &v : buf )
{
int tmp;
if ( fscanf(f, "%u", &tmp) != 1 )
@ -1040,7 +1040,7 @@ static bool read_random_seeds(const char* read_file, uint32_t* seed,
return false;
}
buf[i] = tmp;
v = tmp;
}
fclose(f);
@ -1061,8 +1061,8 @@ static bool write_random_seeds(const char* write_file, uint32_t seed,
fprintf(f, "%u\n", seed);
for ( int i = 0; i < KeyedHash::SEED_INIT_SIZE; ++i )
fprintf(f, "%u\n", buf[i]);
for ( const auto &v: buf )
fprintf(f, "%u\n", v);
fclose(f);
return true;