Botan: src/block/xtea/xtea.h Source File

Botan 1.10.17

xtea.h
Go to the documentation of this file.
1 /*
2 * XTEA
3 * (C) 1999-2007 Jack Lloyd
4 *
5 * Distributed under the terms of the Botan license
6 */
7
8 #ifndef BOTAN_XTEA_H__
9 #define BOTAN_XTEA_H__
10
11 #include <botan/block_cipher.h>
12
13 namespace Botan {
14
15 /**
16 * XTEA
17 */
18 class BOTAN_DLL XTEA : 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); }
25 std::string name() const { return "XTEA"; }
26 BlockCipher* clone() const { return new XTEA; }
27
28 XTEA() : EK(64) {}
29 protected:
30 /**
31 * @return const reference to the key schedule
32 */
33 const SecureVector<u32bit>& get_EK() const { return EK; }
34
35 private:
36 void key_schedule(const byte[], size_t);
37 SecureVector<u32bit> EK;
38 };
39
40 }
41
42 #endif
Botan::XTEA
Definition: xtea.h:18
Botan::byte
unsigned char byte
Definition: types.h:22
Botan::XTEA::get_EK
const SecureVector< u32bit > & get_EK() const
Definition: xtea.h:33
Botan::XTEA::XTEA
XTEA()
Definition: xtea.h:28
Botan
Definition: algo_base.h:14
Botan::XTEA::clear
void clear()
Definition: xtea.h:24
Botan::XTEA::name
std::string name() const
Definition: xtea.h:25
Botan::XTEA::clone
BlockCipher * clone() const
Definition: xtea.h:26
Botan::SecureVector< u32bit >
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