aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorlloyd <[email protected]>2006-08-15 13:37:45 +0000
committerlloyd <[email protected]>2006-08-15 13:37:45 +0000
commit2a8abcdd38eb4311cf6b2b1a9899b5ba16fa6bcf (patch)
tree41e2aaa98d300c3c00ef0875164e7a8247b4e29e /src
parenta2674f5bcdb02d0ab51f086b4b56aa7b8838bbce (diff)
Replace Serpent's key_xor function with a macro, so the header can be
shared between the C++ and assembly versions.
Diffstat (limited to 'src')
-rw-r--r--src/serpent.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/serpent.cpp b/src/serpent.cpp
index db68aac53..fd3211898 100644
--- a/src/serpent.cpp
+++ b/src/serpent.cpp
@@ -231,12 +231,11 @@ inline void i_transform(u32bit& B0, u32bit& B1, u32bit& B2, u32bit& B3)
/*************************************************
* XOR a key block with a data block *
*************************************************/
-inline void Serpent::key_xor(u32bit round, u32bit& B0, u32bit& B1,
- u32bit& B2, u32bit& B3) const
- {
- B0 ^= round_key[4*round ]; B1 ^= round_key[4*round+1];
- B2 ^= round_key[4*round+2]; B3 ^= round_key[4*round+3];
- }
+#define key_xor(round, B0, B1, B2, B3) \
+ B0 ^= round_key[4*round ]; \
+ B1 ^= round_key[4*round+1]; \
+ B2 ^= round_key[4*round+2]; \
+ B3 ^= round_key[4*round+3];
/*************************************************
* Serpent Encryption *