From 0cb6bcfedef6ffa797801acd7cb945feb2d05d50 Mon Sep 17 00:00:00 2001 From: lloyd Date: Thu, 14 Oct 2010 18:04:35 +0000 Subject: In all cases where the block size of the cipher is fixed, the key parameters are as well. So make them template paramters. The sole exception was AES, because you could either initialize AES with a fixed key length, in which case it would only be that specific key length, or not, in which case it would support any valid AES key size. This is removed in this checkin; you have to specifically ask for AES-128, AES-192, or AES-256, depending on which one you want. This is probably actually a good thing, because every implementation other than the base one (SSSE3, AES-NI, OpenSSL) did not support "AES", only the versions with specific fixed key sizes. So forcing the user to ask for the one they want ensures they get the ones that are faster and/or safer. --- src/block/rc5/rc5.cpp | 2 +- src/block/rc5/rc5.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/block/rc5') diff --git a/src/block/rc5/rc5.cpp b/src/block/rc5/rc5.cpp index d9e74683c..cfcc4cb64 100644 --- a/src/block/rc5/rc5.cpp +++ b/src/block/rc5/rc5.cpp @@ -122,7 +122,7 @@ std::string RC5::name() const /* * RC5 Constructor */ -RC5::RC5(size_t rounds) : BlockCipher_Fixed_Block_Size(1, 32) +RC5::RC5(size_t rounds) { if(rounds < 8 || rounds > 32 || (rounds % 4 != 0)) throw Invalid_Argument("RC5: Invalid number of rounds " + diff --git a/src/block/rc5/rc5.h b/src/block/rc5/rc5.h index cb282af4e..c69705471 100644 --- a/src/block/rc5/rc5.h +++ b/src/block/rc5/rc5.h @@ -15,7 +15,7 @@ namespace Botan { /** * RC5 */ -class BOTAN_DLL RC5 : public BlockCipher_Fixed_Block_Size<8> +class BOTAN_DLL RC5 : public Block_Cipher_Fixed_Params<8, 1, 32> { public: void encrypt_n(const byte in[], byte out[], size_t blocks) const; -- cgit v1.2.3