9 #ifndef BOTAN_MODE_CBC_H__
10 #define BOTAN_MODE_CBC_H__
12 #include <botan/cipher_mode.h>
13 #include <botan/block_cipher.h>
14 #include <botan/mode_pad.h>
24 std::string name()
const override;
26 size_t update_granularity()
const override;
30 size_t default_nonce_length()
const override;
32 bool valid_nonce_length(
size_t n)
const override;
34 void clear()
override;
36 void reset()
override;
54 void start_msg(
const uint8_t nonce[],
size_t nonce_len)
override;
56 void key_schedule(
const uint8_t key[],
size_t length)
override;
58 std::unique_ptr<BlockCipher> m_cipher;
59 std::unique_ptr<BlockCipherModePaddingMethod> m_padding;
76 size_t process(uint8_t buf[],
size_t size)
override;
80 size_t output_length(
size_t input_length)
const override;
82 size_t minimum_final_size()
const override;
96 size_t output_length(
size_t input_length)
const override;
100 size_t minimum_final_size()
const override;
102 bool valid_nonce_length(
size_t n)
const override;
116 CBC_Mode(cipher, padding), m_tempbuf(update_granularity()) {}
118 size_t process(uint8_t buf[],
size_t size)
override;
122 size_t output_length(
size_t input_length)
const override;
124 size_t minimum_final_size()
const override;
126 void reset()
override;
145 size_t minimum_final_size()
const override;
147 bool valid_nonce_length(
size_t n)
const override;
secure_vector< uint8_t > & state()
const BlockCipherModePaddingMethod & padding() const
CBC_Encryption(BlockCipher *cipher, BlockCipherModePaddingMethod *padding)
std::vector< T, secure_allocator< T >> secure_vector
#define BOTAN_ASSERT_NONNULL(ptr)
CBC_Decryption(BlockCipher *cipher, BlockCipherModePaddingMethod *padding)
CTS_Encryption(BlockCipher *cipher)
CTS_Decryption(BlockCipher *cipher)
const BlockCipher & cipher() const