Botan 1.10.17

rc2.h
Go to the documentation of this file.
1 /*
2 * RC2
3 * (C) 1999-2007 Jack Lloyd
4 *
5 * Distributed under the terms of the Botan license
6 */
7
8 #ifndef BOTAN_RC2_H__
9 #define BOTAN_RC2_H__
10
11 #include <botan/block_cipher.h>
12
13 namespace Botan {
14
15 /**
16 * RC2
17 */
18 class BOTAN_DLL RC2 : public Block_Cipher_Fixed_Params<8, 1, 32>
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 /**
25 * Return the code of the effective key bits
26 * @param bits key length
27 * @return EKB code
28 */
29 static byte EKB_code(size_t bits);
30
31 void clear() { zeroise(K); }
32 std::string name() const { return "RC2"; }
33 BlockCipher* clone() const { return new RC2; }
34
35 RC2() : K(64) {}
36 private:
37 void key_schedule(const byte[], size_t);
38
39 SecureVector<u16bit> K;
40 };
41
42 }
43
44 #endif
Botan::RC2::clone
BlockCipher * clone() const
Definition: rc2.h:33
Botan::RC2::RC2
RC2()
Definition: rc2.h:35
Botan::byte
unsigned char byte
Definition: types.h:22
Botan::RC2::clear
void clear()
Definition: rc2.h:31
Botan
Definition: algo_base.h:14
Botan::RC2
Definition: rc2.h:18
Botan::SecureVector< u16bit >
Botan::Block_Cipher_Fixed_Params
Definition: block_cipher.h:104
Botan::zeroise
void zeroise(MemoryRegion< T > &vec)
Definition: secmem.h:428
Botan::RC2::name
std::string name() const
Definition: rc2.h:32
Botan::BlockCipher
Definition: block_cipher.h:18