aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/serpent.h1
-rw-r--r--src/serpent.cpp11
2 files changed, 5 insertions, 7 deletions
diff --git a/include/serpent.h b/include/serpent.h
index c1722464e..85e0345d0 100644
--- a/include/serpent.h
+++ b/include/serpent.h
@@ -25,7 +25,6 @@ class Serpent : public BlockCipher
void dec(const byte[], byte[]) const;
void key(const byte[], u32bit);
- void key_xor(u32bit, u32bit&, u32bit&, u32bit&, u32bit&) const;
SecureBuffer<u32bit, 132> round_key;
};
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 *