aboutsummaryrefslogtreecommitdiffstats
path: root/src/block/gost_28147
diff options
context:
space:
mode:
authorlloyd <[email protected]>2010-10-14 18:04:35 +0000
committerlloyd <[email protected]>2010-10-14 18:04:35 +0000
commit0cb6bcfedef6ffa797801acd7cb945feb2d05d50 (patch)
treea89de84b769036989fd59364dfb2d4fa000c697f /src/block/gost_28147
parenta142500346e9bef5c4b0905103eac9a494d6822e (diff)
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.
Diffstat (limited to 'src/block/gost_28147')
-rw-r--r--src/block/gost_28147/gost_28147.cpp2
-rw-r--r--src/block/gost_28147/gost_28147.h4
2 files changed, 3 insertions, 3 deletions
diff --git a/src/block/gost_28147/gost_28147.cpp b/src/block/gost_28147/gost_28147.cpp
index 9adc0d568..07f3359cd 100644
--- a/src/block/gost_28147/gost_28147.cpp
+++ b/src/block/gost_28147/gost_28147.cpp
@@ -52,7 +52,7 @@ GOST_28147_89_Params::GOST_28147_89_Params(const std::string& n) : name(n)
* GOST Constructor
*/
GOST_28147_89::GOST_28147_89(const GOST_28147_89_Params& param) :
- BlockCipher_Fixed_Block_Size(32), SBOX(1024), EK(8)
+ SBOX(1024), EK(8)
{
// Convert the parallel 4x4 sboxes into larger word-based sboxes
for(size_t i = 0; i != 4; ++i)
diff --git a/src/block/gost_28147/gost_28147.h b/src/block/gost_28147/gost_28147.h
index adf542bbe..75ba74c44 100644
--- a/src/block/gost_28147/gost_28147.h
+++ b/src/block/gost_28147/gost_28147.h
@@ -49,7 +49,7 @@ class BOTAN_DLL GOST_28147_89_Params
/**
* GOST 28147-89
*/
-class BOTAN_DLL GOST_28147_89 : public BlockCipher_Fixed_Block_Size<8>
+class BOTAN_DLL GOST_28147_89 : public Block_Cipher_Fixed_Params<8, 32>
{
public:
void encrypt_n(const byte in[], byte out[], size_t blocks) const;
@@ -66,7 +66,7 @@ class BOTAN_DLL GOST_28147_89 : public BlockCipher_Fixed_Block_Size<8>
GOST_28147_89(const GOST_28147_89_Params& params);
private:
GOST_28147_89(const SecureVector<u32bit>& other_SBOX) :
- BlockCipher_Fixed_Block_Size(32), SBOX(other_SBOX), EK(8) {}
+ SBOX(other_SBOX), EK(8) {}
void key_schedule(const byte[], size_t);