Botan  2.8.0
Crypto and TLS for C++11
ofb.h
Go to the documentation of this file.
1 /*
2 * OFB Mode
3 * (C) 1999-2007 Jack Lloyd
4 *
5 * Botan is released under the Simplified BSD License (see license.txt)
6 */
7 
8 #ifndef BOTAN_OUTPUT_FEEDBACK_MODE_H_
9 #define BOTAN_OUTPUT_FEEDBACK_MODE_H_
10 
11 #include <botan/stream_cipher.h>
12 #include <botan/block_cipher.h>
13 
14 namespace Botan {
15 
16 /**
17 * Output Feedback Mode
18 */
20  {
21  public:
22  void cipher(const uint8_t in[], uint8_t out[], size_t length) override;
23 
24  void set_iv(const uint8_t iv[], size_t iv_len) override;
25 
26  size_t default_iv_length() const override;
27 
28  bool valid_iv_length(size_t iv_len) const override;
29 
30  Key_Length_Specification key_spec() const override;
31 
32  std::string name() const override;
33 
34  OFB* clone() const override;
35 
36  void clear() override;
37 
38  /**
39  * @param cipher the block cipher to use
40  */
41  explicit OFB(BlockCipher* cipher);
42 
43  void seek(uint64_t offset) override;
44  private:
45  void key_schedule(const uint8_t key[], size_t key_len) override;
46 
47  std::unique_ptr<BlockCipher> m_cipher;
48  secure_vector<uint8_t> m_buffer;
49  size_t m_buf_pos;
50  };
51 
52 }
53 
54 #endif
Definition: ofb.h:19
int(* final)(unsigned char *, CTX *)
#define BOTAN_PUBLIC_API(maj, min)
Definition: compiler.h:27
std::string name
Definition: alg_id.cpp:13
std::vector< T, secure_allocator< T > > secure_vector
Definition: secmem.h:88