diff options
author | lloyd <[email protected]> | 2010-09-13 20:53:31 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2010-09-13 20:53:31 +0000 |
commit | 4fe8a34f1869805d9115f39cad53d1fd7f7eb6c4 (patch) | |
tree | 2ff6c30d1a7d5f2244b6f1b459a5ea10b6d43fe0 /src/hash/tiger | |
parent | 36bfef27271eadffefbc6891a9d7fa7eed7b1e10 (diff) |
Remove more uses of vector to pointer implicit conversions
Diffstat (limited to 'src/hash/tiger')
-rw-r--r-- | src/hash/tiger/tiger.cpp | 29 | ||||
-rw-r--r-- | src/hash/tiger/tiger.h | 4 |
2 files changed, 24 insertions, 9 deletions
diff --git a/src/hash/tiger/tiger.cpp b/src/hash/tiger/tiger.cpp index dd41841c9..d931324e0 100644 --- a/src/hash/tiger/tiger.cpp +++ b/src/hash/tiger/tiger.cpp @@ -17,14 +17,25 @@ namespace { /* * Tiger Mixing Function */ -inline void mix(u64bit X[8]) +inline void mix(MemoryRegion<u64bit>& X) { - X[0] -= X[7] ^ 0xA5A5A5A5A5A5A5A5; X[1] ^= X[0]; - X[2] += X[1]; X[3] -= X[2] ^ ((~X[1]) << 19); X[4] ^= X[3]; - X[5] += X[4]; X[6] -= X[5] ^ ((~X[4]) >> 23); X[7] ^= X[6]; - X[0] += X[7]; X[1] -= X[0] ^ ((~X[7]) << 19); X[2] ^= X[1]; - X[3] += X[2]; X[4] -= X[3] ^ ((~X[2]) >> 23); X[5] ^= X[4]; - X[6] += X[5]; X[7] -= X[6] ^ 0x0123456789ABCDEF; + X[0] -= X[7] ^ 0xA5A5A5A5A5A5A5A5; + X[1] ^= X[0]; + X[2] += X[1]; + X[3] -= X[2] ^ ((~X[1]) << 19); + X[4] ^= X[3]; + X[5] += X[4]; + X[6] -= X[5] ^ ((~X[4]) >> 23); + X[7] ^= X[6]; + + X[0] += X[7]; + X[1] -= X[0] ^ ((~X[7]) << 19); + X[2] ^= X[1]; + X[3] += X[2]; + X[4] -= X[3] ^ ((~X[2]) >> 23); + X[5] ^= X[4]; + X[6] += X[5]; + X[7] -= X[6] ^ 0x0123456789ABCDEF; } } @@ -71,7 +82,9 @@ void Tiger::copy_out(byte output[]) /* * Tiger Pass */ -void Tiger::pass(u64bit& A, u64bit& B, u64bit& C, u64bit X[8], byte mul) +void Tiger::pass(u64bit& A, u64bit& B, u64bit& C, + const MemoryRegion<u64bit>& X, + byte mul) { C ^= X[0]; A -= SBOX1[get_byte(7, C)] ^ SBOX2[get_byte(5, C)] ^ diff --git a/src/hash/tiger/tiger.h b/src/hash/tiger/tiger.h index 380f6eb24..94665b902 100644 --- a/src/hash/tiger/tiger.h +++ b/src/hash/tiger/tiger.h @@ -35,7 +35,9 @@ class BOTAN_DLL Tiger : public MDx_HashFunction void compress_n(const byte[], u32bit block); void copy_out(byte[]); - static void pass(u64bit&, u64bit&, u64bit&, u64bit[8], byte); + static void pass(u64bit& A, u64bit& B, u64bit& C, + const MemoryRegion<u64bit>& M, + byte mul); static const u64bit SBOX1[256]; static const u64bit SBOX2[256]; |