diff options
author | lloyd <[email protected]> | 2010-01-04 21:14:47 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2010-01-04 21:14:47 +0000 |
commit | 9de3098b70e5b7d9fe30cb04056bb0067f87e31a (patch) | |
tree | 26af8fa5d4f110c5659dd633c9fedbedf59a2f6c | |
parent | bf8854f8482c7fcbe20df4d96d4e6d04cf01540c (diff) |
Move Tiger::mix to anon namespace
-rw-r--r-- | src/hash/tiger/tiger.cpp | 30 | ||||
-rw-r--r-- | src/hash/tiger/tiger.h | 1 |
2 files changed, 17 insertions, 14 deletions
diff --git a/src/hash/tiger/tiger.cpp b/src/hash/tiger/tiger.cpp index 4f4d4dc83..3013ab38e 100644 --- a/src/hash/tiger/tiger.cpp +++ b/src/hash/tiger/tiger.cpp @@ -12,6 +12,23 @@ namespace Botan { +namespace { + +/* +* Tiger Mixing Function +*/ +inline void mix(u64bit X[8]) + { + 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; + } + +} + /* * Tiger Compression Function */ @@ -114,19 +131,6 @@ void Tiger::pass(u64bit& A, u64bit& B, u64bit& C, u64bit X[8], byte mul) } /* -* Tiger Mixing Function -*/ -void Tiger::mix(u64bit X[8]) - { - 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; - } - -/* * Clear memory of sensitive data */ void Tiger::clear() diff --git a/src/hash/tiger/tiger.h b/src/hash/tiger/tiger.h index 86ddcd270..20dcf99ff 100644 --- a/src/hash/tiger/tiger.h +++ b/src/hash/tiger/tiger.h @@ -27,7 +27,6 @@ class BOTAN_DLL Tiger : public MDx_HashFunction void copy_out(byte[]); static void pass(u64bit&, u64bit&, u64bit&, u64bit[8], byte); - static void mix(u64bit[8]); static const u64bit SBOX1[256]; static const u64bit SBOX2[256]; |