aboutsummaryrefslogtreecommitdiffstats
path: root/src/block/twofish
diff options
context:
space:
mode:
Diffstat (limited to 'src/block/twofish')
-rw-r--r--src/block/twofish/twofish.cpp8
-rw-r--r--src/block/twofish/twofish.h6
2 files changed, 8 insertions, 6 deletions
diff --git a/src/block/twofish/twofish.cpp b/src/block/twofish/twofish.cpp
index a573c2ec8..41bc7ca1c 100644
--- a/src/block/twofish/twofish.cpp
+++ b/src/block/twofish/twofish.cpp
@@ -57,8 +57,8 @@ void Twofish::encrypt_n(const byte in[], byte out[], size_t blocks) const
store_le(out, C, D, A, B);
- in += block_size();
- out += block_size();
+ in += BLOCK_SIZE;
+ out += BLOCK_SIZE;
}
}
@@ -108,8 +108,8 @@ void Twofish::decrypt_n(const byte in[], byte out[], size_t blocks) const
store_le(out, C, D, A, B);
- in += block_size();
- out += block_size();
+ in += BLOCK_SIZE;
+ out += BLOCK_SIZE;
}
}
diff --git a/src/block/twofish/twofish.h b/src/block/twofish/twofish.h
index 38263af98..a212bd285 100644
--- a/src/block/twofish/twofish.h
+++ b/src/block/twofish/twofish.h
@@ -15,7 +15,7 @@ namespace Botan {
/**
* Twofish, an AES finalist
*/
-class BOTAN_DLL Twofish : public BlockCipher
+class BOTAN_DLL Twofish : public BlockCipher_Fixed_Block_Size<16>
{
public:
void encrypt_n(const byte in[], byte out[], size_t blocks) const;
@@ -25,7 +25,9 @@ class BOTAN_DLL Twofish : public BlockCipher
std::string name() const { return "Twofish"; }
BlockCipher* clone() const { return new Twofish; }
- Twofish() : BlockCipher(16, 16, 32, 8), SB(1024), RK(40) {}
+ Twofish() : BlockCipher_Fixed_Block_Size(16, 32, 8),
+ SB(1024), RK(40) {}
+
private:
void key_schedule(const byte[], size_t);