9 #ifndef BOTAN_AEAD_CCM_H__
10 #define BOTAN_AEAD_CCM_H__
12 #include <botan/aead.h>
13 #include <botan/block_cipher.h>
14 #include <botan/stream_cipher.h>
15 #include <botan/mac.h>
26 size_t process(uint8_t buf[],
size_t sz)
override;
28 void set_associated_data(
const uint8_t ad[],
size_t ad_len)
override;
30 std::string name()
const override;
32 size_t update_granularity()
const override;
36 bool valid_nonce_length(
size_t)
const override;
38 size_t default_nonce_length()
const override;
40 void clear()
override;
42 void reset()
override;
44 size_t tag_size()
const override {
return m_tag_size; }
49 size_t L()
const {
return m_L; }
53 void encode_length(
size_t len, uint8_t out[]);
64 void start_msg(
const uint8_t nonce[],
size_t nonce_len)
override;
66 void key_schedule(
const uint8_t key[],
size_t length)
override;
68 const size_t m_tag_size;
71 std::unique_ptr<BlockCipher> m_cipher;
94 {
return input_length + tag_size(); }
119 BOTAN_ASSERT(input_length >= tag_size(),
"Sufficient input");
120 return input_length - tag_size();
size_t output_length(size_t input_length) const override
CCM_Decryption(BlockCipher *cipher, size_t tag_size=16, size_t L=3)
#define BOTAN_ASSERT(expr, assertion_made)
std::vector< T, secure_allocator< T >> secure_vector
const BlockCipher & cipher() const
size_t minimum_final_size() const override
size_t output_length(size_t input_length) const override
size_t minimum_final_size() const override
const secure_vector< uint8_t > & ad_buf() const
CCM_Encryption(BlockCipher *cipher, size_t tag_size=16, size_t L=3)
secure_vector< uint8_t > & msg_buf()
size_t tag_size() const override