diff options
author | lloyd <[email protected]> | 2008-09-29 20:30:20 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2008-09-29 20:30:20 +0000 |
commit | 5a2001846f4470d90dff2a72896e1f19630e4fc2 (patch) | |
tree | 6a56108106dbf752bd120edcb1b03d2d845bd13e /src/cipher/serpent_ia32 | |
parent | a3366dc421c4ef9f802009a667ddcb8a9cd2c8a6 (diff) |
Derive the x86 assembly implementations of MD4, MD5, and Serpent from
the normal Botan base classes. This required making data members of
MD4, MD5, and Serpent protected rather than private, which is not very
good style IMO. On the other hand it allows for removing a bit of duplicated
code, and also has the nice effect that a pointer to a Serpent_IA32 can be
used right as a Serpent object, which makes sense anyway since they implement
the same algorithm. The C++ files in the *_ia32 modules are now simply hooks
between the virtual function call runtime and the assembly code.
Diffstat (limited to 'src/cipher/serpent_ia32')
-rw-r--r-- | src/cipher/serpent_ia32/serp_ia32.h | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/cipher/serpent_ia32/serp_ia32.h b/src/cipher/serpent_ia32/serp_ia32.h index 26f870188..83079e9c2 100644 --- a/src/cipher/serpent_ia32/serp_ia32.h +++ b/src/cipher/serpent_ia32/serp_ia32.h @@ -6,26 +6,21 @@ #ifndef BOTAN_SERPENT_IA32_H__ #define BOTAN_SERPENT_IA32_H__ -#include <botan/base.h> +#include <botan/serpent.h> namespace Botan { /************************************************* * Serpent * *************************************************/ -class BOTAN_DLL Serpent_IA32 : public BlockCipher +class BOTAN_DLL Serpent_IA32 : public Serpent { public: - void clear() throw() { round_key.clear(); } - std::string name() const { return "Serpent"; } BlockCipher* clone() const { return new Serpent_IA32; } - Serpent_IA32() : BlockCipher(16, 16, 32, 8) {} private: void enc(const byte[], byte[]) const; void dec(const byte[], byte[]) const; void key(const byte[], u32bit); - - SecureBuffer<u32bit, 132> round_key; }; } |