diff options
Diffstat (limited to 'src/block/cast/cast128.h')
-rw-r--r-- | src/block/cast/cast128.h | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/block/cast/cast128.h b/src/block/cast/cast128.h index 967e91938..edccf04b3 100644 --- a/src/block/cast/cast128.h +++ b/src/block/cast/cast128.h @@ -18,25 +18,26 @@ namespace Botan { class BOTAN_DLL CAST_128 : public BlockCipher { public: - void encrypt_n(const byte in[], byte out[], u32bit blocks) const; - void decrypt_n(const byte in[], byte out[], u32bit blocks) const; + void encrypt_n(const byte in[], byte out[], size_t blocks) const; + void decrypt_n(const byte in[], byte out[], size_t blocks) const; - void clear() { MK.clear(); RK.clear(); } + void clear() { zeroise(MK); zeroise(RK); } std::string name() const { return "CAST-128"; } BlockCipher* clone() const { return new CAST_128; } - CAST_128() : BlockCipher(8, 11, 16) {} + CAST_128() : BlockCipher(8, 11, 16), MK(16), RK(16) {} private: - void key_schedule(const byte[], u32bit); + void key_schedule(const byte[], size_t); - static void key_schedule(u32bit[16], u32bit[4]); + static void cast_ks(MemoryRegion<u32bit>& ks, + MemoryRegion<u32bit>& user_key); static const u32bit S5[256]; static const u32bit S6[256]; static const u32bit S7[256]; static const u32bit S8[256]; - SecureVector<u32bit, 16> MK, RK; + SecureVector<u32bit> MK, RK; }; extern const u32bit CAST_SBOX1[256]; |