Botan 1.10.17

idea.h
Go to the documentation of this file.
1 /*
2 * IDEA
3 * (C) 1999-2007 Jack Lloyd
4 *
5 * Distributed under the terms of the Botan license
6 */
7
8 #ifndef BOTAN_IDEA_H__
9 #define BOTAN_IDEA_H__
10
11 #include <botan/block_cipher.h>
12
13 namespace Botan {
14
15 /**
16 * IDEA
17 */
18 class BOTAN_DLL IDEA : public Block_Cipher_Fixed_Params<8, 16>
19 {
20 public:
21 void encrypt_n(const byte in[], byte out[], size_t blocks) const;
22 void decrypt_n(const byte in[], byte out[], size_t blocks) const;
23
24 void clear() { zeroise(EK); zeroise(DK); }
25 std::string name() const { return "IDEA"; }
26 BlockCipher* clone() const { return new IDEA; }
27
28 IDEA() : EK(52), DK(52) {}
29 protected:
30 /**
31 * @return const reference to encryption subkeys
32 */
33 const SecureVector<u16bit>& get_EK() const { return EK; }
34
35 /**
36 * @return const reference to decryption subkeys
37 */
38 const SecureVector<u16bit>& get_DK() const { return DK; }
39
40 private:
41 void key_schedule(const byte[], size_t);
42 SecureVector<u16bit> EK, DK;
43 };
44
45 }
46
47 #endif
Botan::IDEA::clone
BlockCipher * clone() const
Definition: idea.h:26
Botan::IDEA
Definition: idea.h:18
Botan::IDEA::clear
void clear()
Definition: idea.h:24
Botan::IDEA::get_EK
const SecureVector< u16bit > & get_EK() const
Definition: idea.h:33
Botan::byte
unsigned char byte
Definition: types.h:22
Botan::IDEA::get_DK
const SecureVector< u16bit > & get_DK() const
Definition: idea.h:38
Botan::IDEA::IDEA
IDEA()
Definition: idea.h:28
Botan
Definition: algo_base.h:14
Botan::SecureVector< u16bit >
Botan::IDEA::name
std::string name() const
Definition: idea.h:25
Botan::Block_Cipher_Fixed_Params
Definition: block_cipher.h:104
Botan::zeroise
void zeroise(MemoryRegion< T > &vec)
Definition: secmem.h:428
Botan::BlockCipher
Definition: block_cipher.h:18