Botan 1.10.17
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
13namespace 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*/
21class 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
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
51 SecureVector<byte> buffer;
52 size_t position;
53 };
54
55}
56
57#endif
void cipher(const byte[], byte[], size_t)
Definition wid_wake.cpp:17
bool valid_iv_length(size_t iv_len) const
Definition wid_wake.h:27
std::string name() const
Definition wid_wake.h:36
Key_Length_Specification key_spec() const
Definition wid_wake.h:30
void set_iv(const byte[], size_t)
Definition wid_wake.cpp:124
StreamCipher * clone() const
Definition wid_wake.h:37