Remove unnecessary temporary array from Equihash hash generation

This commit is contained in:
Jack Grigg 2016-08-21 06:05:48 +12:00
parent 6e629886e5
commit e273f05d10
1 changed files with 2 additions and 3 deletions

View File

@ -44,10 +44,9 @@ void GenerateHash(const eh_HashState& base_state, eh_index g,
{
eh_HashState state;
state = base_state;
unsigned char array[sizeof(eh_index)];
eh_index lei = htole32(g);
memcpy(array, &lei, sizeof(eh_index));
crypto_generichash_blake2b_update(&state, array, sizeof(eh_index));
crypto_generichash_blake2b_update(&state, (const unsigned char*) &lei,
sizeof(eh_index));
crypto_generichash_blake2b_final(&state, hash, hLen);
}