diff options
author | lloyd <[email protected]> | 2009-11-03 16:47:11 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2009-11-03 16:47:11 +0000 |
commit | fa8a8437b9ce3b5275133230708af0964427651a (patch) | |
tree | 1e2565f204d1c6b96f067bb980a98822eebf4465 /src/hash/whirlpool/whrlpool.cpp | |
parent | 6b617a55bd02bcc4fdb6f76af92e0cb65fd838a2 (diff) |
Conver the rest of the hash functions to use the array-based load instructions.
I'm not totally happy with this - in particular in all cases the size is a
compile time constant - it would be nice to make use of this via tempalate
metaprogramming. Also for matching endian loads, a straight memcpy would
do the work, which would probably be even faster.
Diffstat (limited to 'src/hash/whirlpool/whrlpool.cpp')
-rw-r--r-- | src/hash/whirlpool/whrlpool.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/hash/whirlpool/whrlpool.cpp b/src/hash/whirlpool/whrlpool.cpp index b7a02a9b6..06755fe77 100644 --- a/src/hash/whirlpool/whrlpool.cpp +++ b/src/hash/whirlpool/whrlpool.cpp @@ -25,9 +25,7 @@ void Whirlpool::compress_n(const byte in[], u32bit blocks) for(u32bit i = 0; i != blocks; ++i) { - for(u32bit j = 0; j != 8; ++j) - M[j] = load_be<u64bit>(in, j); - in += HASH_BLOCK_SIZE; + load_be(M.begin(), in, M.size()); u64bit K0, K1, K2, K3, K4, K5, K6, K7; K0 = digest[0]; K1 = digest[1]; K2 = digest[2]; K3 = digest[3]; @@ -121,6 +119,8 @@ void Whirlpool::compress_n(const byte in[], u32bit blocks) digest[5] ^= B5 ^ M[5]; digest[6] ^= B6 ^ M[6]; digest[7] ^= B7 ^ M[7]; + + in += HASH_BLOCK_SIZE; } } |