aboutsummaryrefslogtreecommitdiffstats
path: root/include/serpent.h
diff options
context:
space:
mode:
authorlloyd <[email protected]>2006-05-18 18:33:19 +0000
committerlloyd <[email protected]>2006-05-18 18:33:19 +0000
commita2c99d3270eb73ef2db5704fc54356c6b75096f8 (patch)
treead3d6c4fcc8dd0f403f8105598943616246fe172 /include/serpent.h
Initial checkin1.5.6
Diffstat (limited to 'include/serpent.h')
-rw-r--r--include/serpent.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/include/serpent.h b/include/serpent.h
new file mode 100644
index 000000000..c1722464e
--- /dev/null
+++ b/include/serpent.h
@@ -0,0 +1,34 @@
+/*************************************************
+* Serpent Header File *
+* (C) 1999-2006 The Botan Project *
+*************************************************/
+
+#ifndef BOTAN_SERPENT_H__
+#define BOTAN_SERPENT_H__
+
+#include <botan/base.h>
+
+namespace Botan {
+
+/*************************************************
+* Serpent *
+*************************************************/
+class Serpent : public BlockCipher
+ {
+ public:
+ void clear() throw() { round_key.clear(); }
+ std::string name() const { return "Serpent"; }
+ BlockCipher* clone() const { return new Serpent; }
+ Serpent() : BlockCipher(16, 16, 32, 8) {}
+ private:
+ void enc(const byte[], byte[]) const;
+ 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;
+ };
+
+}
+
+#endif