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/safer/safer_sk.cpp | 3 +-- src/block/safer/safer_sk.h | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'src/block/safer') diff --git a/src/block/safer/safer_sk.cpp b/src/block/safer/safer_sk.cpp index 941c4fed8..59a6cc276 100644 --- a/src/block/safer/safer_sk.cpp +++ b/src/block/safer/safer_sk.cpp @@ -131,8 +131,7 @@ BlockCipher* SAFER_SK::clone() const /* * SAFER-SK Constructor */ -SAFER_SK::SAFER_SK(size_t rounds) : - BlockCipher_Fixed_Block_Size(16) +SAFER_SK::SAFER_SK(size_t rounds) { if(rounds > 13 || rounds == 0) throw Invalid_Argument(name() + ": Invalid number of rounds"); diff --git a/src/block/safer/safer_sk.h b/src/block/safer/safer_sk.h index 2fde757bd..803afffa0 100644 --- a/src/block/safer/safer_sk.h +++ b/src/block/safer/safer_sk.h @@ -15,7 +15,7 @@ namespace Botan { /** * SAFER-SK */ -class BOTAN_DLL SAFER_SK : public BlockCipher_Fixed_Block_Size<8> +class BOTAN_DLL SAFER_SK : public Block_Cipher_Fixed_Params<8, 16> { public: void encrypt_n(const byte in[], byte out[], size_t blocks) const; -- cgit v1.2.3