aboutsummaryrefslogtreecommitdiffstats
path: root/include/serpent.h
diff options
context:
space:
mode:
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