cosmetics

This commit is contained in:
Karel Miko 2017-05-02 09:35:28 +02:00
parent da8501f55a
commit 961b6109d5

View File

@ -272,13 +272,11 @@ int sha3_shake_done(hash_state *md, unsigned char *out, unsigned long outlen)
md->sha3.s[SHA3_KECCAK_SPONGE_WORDS - md->sha3.capacity_words - 1] ^= CONST64(0x8000000000000000);
keccakf(md->sha3.s);
#ifndef ENDIAN_LITTLE
{
for(i = 0; i < SHA3_KECCAK_SPONGE_WORDS; i++) {
const ulong32 t1 = (ulong32)(md->sha3.s[i] & CONST64(0xFFFFFFFF));
const ulong32 t2 = (ulong32)(md->sha3.s[i] >> 32);
STORE32L(t1, md->sha3.sb + i * 8);
STORE32L(t2, md->sha3.sb + i * 8 + 4);
}
for(i = 0; i < SHA3_KECCAK_SPONGE_WORDS; i++) {
const ulong32 t1 = (ulong32)(md->sha3.s[i] & CONST64(0xFFFFFFFF));
const ulong32 t2 = (ulong32)(md->sha3.s[i] >> 32);
STORE32L(t1, md->sha3.sb + i * 8);
STORE32L(t2, md->sha3.sb + i * 8 + 4);
}
#endif
md->sha3.byte_index = 0;
@ -289,13 +287,11 @@ int sha3_shake_done(hash_state *md, unsigned char *out, unsigned long outlen)
if(md->sha3.byte_index >= (SHA3_KECCAK_SPONGE_WORDS - md->sha3.capacity_words) * 8) {
keccakf(md->sha3.s);
#ifndef ENDIAN_LITTLE
{
for(i = 0; i < SHA3_KECCAK_SPONGE_WORDS; i++) {
const ulong32 t1 = (ulong32)(md->sha3.s[i] & CONST64(0xFFFFFFFF));
const ulong32 t2 = (ulong32)(md->sha3.s[i] >> 32);
STORE32L(t1, md->sha3.sb + i * 8);
STORE32L(t2, md->sha3.sb + i * 8 + 4);
}
for(i = 0; i < SHA3_KECCAK_SPONGE_WORDS; i++) {
const ulong32 t1 = (ulong32)(md->sha3.s[i] & CONST64(0xFFFFFFFF));
const ulong32 t2 = (ulong32)(md->sha3.s[i] >> 32);
STORE32L(t1, md->sha3.sb + i * 8);
STORE32L(t2, md->sha3.sb + i * 8 + 4);
}
#endif
md->sha3.byte_index = 0;