Remove unnecessary temporary array from Equihash hash generation
This commit is contained in:
@@ -44,10 +44,9 @@ void GenerateHash(const eh_HashState& base_state, eh_index g,
|
|||||||
{
|
{
|
||||||
eh_HashState state;
|
eh_HashState state;
|
||||||
state = base_state;
|
state = base_state;
|
||||||
unsigned char array[sizeof(eh_index)];
|
|
||||||
eh_index lei = htole32(g);
|
eh_index lei = htole32(g);
|
||||||
memcpy(array, &lei, sizeof(eh_index));
|
crypto_generichash_blake2b_update(&state, (const unsigned char*) &lei,
|
||||||
crypto_generichash_blake2b_update(&state, array, sizeof(eh_index));
|
sizeof(eh_index));
|
||||||
crypto_generichash_blake2b_final(&state, hash, hLen);
|
crypto_generichash_blake2b_final(&state, hash, hLen);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user