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/fork256/fork256.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/fork256/fork256.cpp')
-rw-r--r-- | src/hash/fork256/fork256.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/hash/fork256/fork256.cpp b/src/hash/fork256/fork256.cpp index 6718f9f97..bd85dfd7c 100644 --- a/src/hash/fork256/fork256.cpp +++ b/src/hash/fork256/fork256.cpp @@ -66,9 +66,7 @@ void FORK_256::compress_n(const byte input[], u32bit blocks) G1 = G2 = G3 = G4 = digest[6]; H1 = H2 = H3 = H4 = digest[7]; - for(u32bit j = 0; j != 16; ++j) - M[j] = load_be<u32bit>(input, j); - input += HASH_BLOCK_SIZE; + load_be(M.begin(), input, M.size()); step(A1, B1, C1, D1, E1, F1, G1, H1, M[ 0], M[ 1], DELTA[ 0], DELTA[ 1]); step(A2, B2, C2, D2, E2, F2, G2, H2, M[14], M[15], DELTA[15], DELTA[14]); @@ -118,6 +116,8 @@ void FORK_256::compress_n(const byte input[], u32bit blocks) digest[5] += (F1 + F2) ^ (F3 + F4); digest[6] += (G1 + G2) ^ (G3 + G4); digest[7] += (H1 + H2) ^ (H3 + H4); + + input += HASH_BLOCK_SIZE; } } |