more readable for loops

This commit is contained in:
Karel Miko 2017-05-03 12:51:33 +02:00
parent a1615daa3c
commit f831e27702

View File

@ -263,7 +263,9 @@ 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);
/* store sha3.s[] as little-endian bytes into sha3.sb */
for(i = 0; i < SHA3_KECCAK_SPONGE_WORDS; i++) STORE64L(md->sha3.s[i], md->sha3.sb + i * 8);
for(i = 0; i < SHA3_KECCAK_SPONGE_WORDS; i++) {
STORE64L(md->sha3.s[i], md->sha3.sb + i * 8);
}
md->sha3.byte_index = 0;
md->sha3.xof_flag = 1;
}
@ -272,7 +274,9 @@ 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);
/* store sha3.s[] as little-endian bytes into sha3.sb */
for(i = 0; i < SHA3_KECCAK_SPONGE_WORDS; i++) STORE64L(md->sha3.s[i], md->sha3.sb + i * 8);
for(i = 0; i < SHA3_KECCAK_SPONGE_WORDS; i++) {
STORE64L(md->sha3.s[i], md->sha3.sb + i * 8);
}
md->sha3.byte_index = 0;
}
out[idx] = md->sha3.sb[md->sha3.byte_index++];