3
* (C) 1999-2008 Jack Lloyd
5
* Botan is released under the Simplified BSD License (see license.txt)
11
#include <botan/stream_cipher.h>
12
#include <botan/types.h>
19
class BOTAN_PUBLIC_API(2,0) RC4 final : public StreamCipher
22
void cipher(const uint8_t in[], uint8_t out[], size_t length) override;
24
void set_iv(const uint8_t iv[], size_t iv_len) override;
26
void clear() override;
27
std::string name() const override;
29
StreamCipher* clone() const override { return new RC4(m_SKIP); }
31
Key_Length_Specification key_spec() const override
33
return Key_Length_Specification(1, 256);
37
* @param skip skip this many initial bytes in the keystream
39
explicit RC4(size_t skip = 0);
43
void seek(uint64_t offset) override;
45
void key_schedule(const uint8_t[], size_t) override;
51
secure_vector<uint8_t> m_state;
52
secure_vector<uint8_t> m_buffer;
53
size_t m_position = 0;