aboutsummaryrefslogtreecommitdiffstats
path: root/src/hash/sha2/sha2_64.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2009-11-03 16:47:11 +0000
committerlloyd <[email protected]>2009-11-03 16:47:11 +0000
commitfa8a8437b9ce3b5275133230708af0964427651a (patch)
tree1e2565f204d1c6b96f067bb980a98822eebf4465 /src/hash/sha2/sha2_64.cpp
parent6b617a55bd02bcc4fdb6f76af92e0cb65fd838a2 (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/sha2/sha2_64.cpp')
-rw-r--r--src/hash/sha2/sha2_64.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/hash/sha2/sha2_64.cpp b/src/hash/sha2/sha2_64.cpp
index e260d8338..3e7c0e228 100644
--- a/src/hash/sha2/sha2_64.cpp
+++ b/src/hash/sha2/sha2_64.cpp
@@ -55,9 +55,7 @@ void SHA_384_512_BASE::compress_n(const byte input[], u32bit blocks)
for(u32bit i = 0; i != blocks; ++i)
{
- for(u32bit j = 0; j != 16; ++j)
- W[j] = load_be<u64bit>(input, j);
- input += HASH_BLOCK_SIZE;
+ load_be(W.begin(), input, 16);
for(u32bit j = 16; j != 80; j += 8)
{
@@ -160,6 +158,8 @@ void SHA_384_512_BASE::compress_n(const byte input[], u32bit blocks)
F = (digest[5] += F);
G = (digest[6] += G);
H = (digest[7] += H);
+
+ input += HASH_BLOCK_SIZE;
}
}