Botan: src/stream/wid_wake/wid_wake.h Source File

Botan 1.10.12

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- File List
- File Members

wid_wake.h
Go to the documentation of this file.
1 /*
2 * WiderWake
3 * (C) 1999-2008 Jack Lloyd
4 *
5 * Distributed under the terms of the Botan license
6 */
7
8 #ifndef BOTAN_WIDER_WAKE_H__
9 #define BOTAN_WIDER_WAKE_H__
10
11 #include <botan/stream_cipher.h>
12
13 namespace Botan {
14
15 /**
16 * WiderWake4+1-BE
17 *
18 * Note: quite old and possibly not safe; use XSalsa20 or a block
19 * cipher in counter mode.
20 */
21 class BOTAN_DLL WiderWake_41_BE : public StreamCipher
22 {
23 public:
24 void cipher(const byte[], byte[], size_t);
25 void set_iv(const byte[], size_t);
26
27 bool valid_iv_length(size_t iv_len) const
28 { return (iv_len == 8); }
29
30 Key_Length_Specification key_spec() const
31 {
32 return Key_Length_Specification(16);
33 }
34
35 void clear();
36 std::string name() const { return "WiderWake4+1-BE"; }
37 StreamCipher* clone() const { return new WiderWake_41_BE; }
38
39 WiderWake_41_BE() : T(256), state(5), t_key(4),
40 buffer(DEFAULT_BUFFERSIZE), position(0)
41 {}
42
43 private:
44 void key_schedule(const byte[], size_t);
45
46 void generate(size_t);
47
48 SecureVector<u32bit> T;
49 SecureVector<u32bit> state;
50 SecureVector<u32bit> t_key;
51 SecureVector<byte> buffer;
52 size_t position;
53 };
54
55 }
56
57 #endif
Botan::WiderWake_41_BE
Definition: wid_wake.h:21
Botan::Key_Length_Specification
Definition: key_spec.h:18
Botan::WiderWake_41_BE::key_spec
Key_Length_Specification key_spec() const
Definition: wid_wake.h:30
Botan::byte
unsigned char byte
Definition: types.h:22
Botan::StreamCipher
Definition: stream_cipher.h:18
Botan::WiderWake_41_BE::WiderWake_41_BE
WiderWake_41_BE()
Definition: wid_wake.h:39
Botan
Definition: algo_base.h:14
Botan::WiderWake_41_BE::clone
StreamCipher * clone() const
Definition: wid_wake.h:37
Botan::SecureVector< u32bit >
Botan::WiderWake_41_BE::name
std::string name() const
Definition: wid_wake.h:36
Botan::WiderWake_41_BE::valid_iv_length
bool valid_iv_length(size_t iv_len) const
Definition: wid_wake.h:27