9 #ifndef BOTAN_AEAD_EAX_H__
10 #define BOTAN_AEAD_EAX_H__
12 #include <botan/aead.h>
13 #include <botan/block_cipher.h>
14 #include <botan/stream_cipher.h>
15 #include <botan/mac.h>
25 void set_associated_data(
const uint8_t ad[],
size_t ad_len)
override;
27 std::string name()
const override;
29 size_t update_granularity()
const override;
36 size_t tag_size()
const override {
return m_tag_size; }
38 void clear()
override;
40 void reset()
override;
49 size_t block_size()
const {
return m_cipher->block_size(); }
54 std::unique_ptr<StreamCipher>
m_ctr;
55 std::unique_ptr<MessageAuthenticationCode>
m_cmac;
61 void start_msg(
const uint8_t nonce[],
size_t nonce_len)
override;
63 void key_schedule(
const uint8_t key[],
size_t length)
override;
80 {
return input_length + tag_size(); }
84 size_t process(uint8_t buf[],
size_t size)
override;
104 BOTAN_ASSERT(input_length >= tag_size(),
"Sufficient input");
105 return input_length - tag_size();
110 size_t process(uint8_t buf[],
size_t size)
override;
EAX_Decryption(BlockCipher *cipher, size_t tag_size=0)
size_t output_length(size_t input_length) const override
secure_vector< uint8_t > m_ad_mac
secure_vector< uint8_t > m_nonce_mac
EAX_Encryption(BlockCipher *cipher, size_t tag_size=0)
#define BOTAN_ASSERT(expr, assertion_made)
std::vector< T, secure_allocator< T >> secure_vector
size_t output_length(size_t input_length) const override
bool valid_nonce_length(size_t) const override
size_t block_size() const
std::unique_ptr< BlockCipher > m_cipher
size_t minimum_final_size() const override
size_t tag_size() const override
std::unique_ptr< MessageAuthenticationCode > m_cmac
std::unique_ptr< StreamCipher > m_ctr
size_t minimum_final_size() const override