mirror of
https://git.wownero.com/wownero/wownero.git
synced 2024-08-15 01:03:23 +00:00
hash: fix hash_permutation on big endian
This commit is contained in:
parent
4cbb476cd1
commit
db24a2e509
1 changed files with 7 additions and 0 deletions
|
@ -36,7 +36,14 @@
|
||||||
#include "keccak.h"
|
#include "keccak.h"
|
||||||
|
|
||||||
void hash_permutation(union hash_state *state) {
|
void hash_permutation(union hash_state *state) {
|
||||||
|
#if BYTE_ORDER == LITTLE_ENDIAN
|
||||||
keccakf((uint64_t*)state, 24);
|
keccakf((uint64_t*)state, 24);
|
||||||
|
#else
|
||||||
|
uint64_t le_state[25];
|
||||||
|
memcpy_swap64le(le_state, state, 25);
|
||||||
|
keccakf(le_state, 24);
|
||||||
|
memcpy_swap64le(state, le_state, 25);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void hash_process(union hash_state *state, const uint8_t *buf, size_t count) {
|
void hash_process(union hash_state *state, const uint8_t *buf, size_t count) {
|
||||||
|
|
Loading…
Reference in a new issue