9 #ifndef BOTAN_AEAD_SIV_H__
10 #define BOTAN_AEAD_SIV_H__
12 #include <botan/aead.h>
13 #include <botan/block_cipher.h>
14 #include <botan/stream_cipher.h>
15 #include <botan/mac.h>
25 size_t process(uint8_t buf[],
size_t size)
override;
33 void set_associated_data_n(
size_t n,
const uint8_t ad[],
size_t ad_len);
37 set_associated_data_n(0, ad, ad_len);
40 std::string name()
const override;
42 size_t update_granularity()
const override;
46 bool valid_nonce_length(
size_t)
const override;
48 void clear()
override;
50 void reset()
override;
52 size_t tag_size()
const override {
return 16; }
65 void start_msg(
const uint8_t nonce[],
size_t nonce_len)
override;
67 void key_schedule(
const uint8_t key[],
size_t length)
override;
70 std::unique_ptr<StreamCipher> m_ctr;
71 std::unique_ptr<MessageAuthenticationCode> m_cmac;
73 std::vector<secure_vector<uint8_t>> m_ad_macs;
90 {
return input_length + tag_size(); }
110 BOTAN_ASSERT(input_length >= tag_size(),
"Sufficient input");
111 return input_length - tag_size();
secure_vector< uint8_t > & msg_buf()
size_t output_length(size_t input_length) const override
SIV_Encryption(BlockCipher *cipher)
#define BOTAN_ASSERT(expr, assertion_made)
std::vector< T, secure_allocator< T >> secure_vector
size_t minimum_final_size() const override
SIV_Decryption(BlockCipher *cipher)
void set_associated_data(const uint8_t ad[], size_t ad_len) override
size_t tag_size() const override
size_t output_length(size_t input_length) const override
size_t minimum_final_size() const override