Botan 1.10.17

seed.h
Go to the documentation of this file.
1 /*
2 * SEED
3 * (C) 1999-2007 Jack Lloyd
4 *
5 * Distributed under the terms of the Botan license
6 */
7
8 #ifndef BOTAN_SEED_H__
9 #define BOTAN_SEED_H__
10
11 #include <botan/block_cipher.h>
12
13 namespace Botan {
14
15 /**
16 * SEED, a Korean block cipher
17 */
18 class BOTAN_DLL SEED : public Block_Cipher_Fixed_Params<16, 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(K); }
25 std::string name() const { return "SEED"; }
26 BlockCipher* clone() const { return new SEED; }
27
28 SEED() : K(32) {}
29 private:
30 void key_schedule(const byte[], size_t);
31
32 class G_FUNC
33 {
34 public:
35 u32bit operator()(u32bit) const;
36 private:
37 static const u32bit S0[256], S1[256], S2[256], S3[256];
38 };
39
40 SecureVector<u32bit> K;
41 };
42
43 }
44
45 #endif
Botan::SEED::clear
void clear()
Definition: seed.h:24
Botan::SEED
Definition: seed.h:18
Botan::SEED::SEED
SEED()
Definition: seed.h:28
Botan::byte
unsigned char byte
Definition: types.h:22
Botan
Definition: algo_base.h:14
Botan::Block_Cipher_Fixed_Params
Definition: block_cipher.h:104
Botan::SEED::name
std::string name() const
Definition: seed.h:25
Botan::zeroise
void zeroise(MemoryRegion< T > &vec)
Definition: secmem.h:428
Botan::SEED::clone
BlockCipher * clone() const
Definition: seed.h:26
Botan::u32bit
unsigned int u32bit
Definition: types.h:32
Botan::BlockCipher
Definition: block_cipher.h:18