summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2015-10-10 18:14:24 +0000
committerbrian m. carlson <sandals@crustytoothpaste.net>2015-10-10 18:14:24 +0000
commitcdb03944e6d403398e96370c1ec12d516f19f893 (patch)
tree96877dad77306f47d09d2de57dcd2ed6b46187bf
parente0aff24a0c239ee3db266ce9206cbe87e8c1ed4a (diff)
keccak: simplify state copying.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
-rw-r--r--impl/hash/keccak/keccak.cc5
1 files changed, 2 insertions, 3 deletions
diff --git a/impl/hash/keccak/keccak.cc b/impl/hash/keccak/keccak.cc
index 8025616..ff45d9b 100644
--- a/impl/hash/keccak/keccak.cc
+++ b/impl/hash/keccak/keccak.cc
@@ -744,9 +744,8 @@ void drew::Keccak::Transform(uint64_t state[25], const uint8_t *block,
const uint64_t *b;
const size_t nwords = r / sizeof(uint64_t);
b = E::CopyIfNeeded(blk, block, r);
- for (size_t y = 0; y < DivideAndRoundUp(nwords, 5); y++)
- for (size_t x = 0; x < 5 && (x+(5*y)) < nwords; x++)
- state[x+5*y] ^= b[x + (5*y)];
+ for (size_t i = 0; i < nwords; i++)
+ state[i] ^= b[i];
keccak_f<0>(state);
}