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>
18class MessageAuthenticationCode;
30 void set_associated_data_n(
size_t n, std::span<const uint8_t> ad)
override final;
32 size_t maximum_associated_data_inputs()
const override final;
34 std::string
name()
const override final;
36 size_t update_granularity()
const override final;
38 size_t ideal_granularity()
const override final;
42 bool valid_nonce_length(
size_t)
const override final;
44 bool requires_entire_message()
const override final;
46 void clear()
override final;
48 void reset()
override final;
52 bool has_keying_material() const override
final;
59 size_t block_size()
const {
return m_bs; }
70 void start_msg(
const uint8_t nonce[],
size_t nonce_len)
override final;
71 size_t process_msg(uint8_t buf[],
size_t size)
override final;
73 void key_schedule(std::span<const uint8_t> key)
override final;
75 const std::string m_name;
78 std::unique_ptr<StreamCipher> m_ctr;
79 std::unique_ptr<MessageAuthenticationCode> m_mac;
81 std::vector<secure_vector<uint8_t>> m_ad_macs;
94 size_t output_length(
size_t input_length)
const override {
return input_length + tag_size(); }
113 BOTAN_ASSERT(input_length >= tag_size(),
"Sufficient input");
114 return input_length - tag_size();
#define BOTAN_ASSERT(expr, assertion_made)
SIV_Decryption(std::unique_ptr< BlockCipher > cipher)
size_t minimum_final_size() const override
size_t output_length(size_t input_length) const override
SIV_Encryption(std::unique_ptr< BlockCipher > cipher)
size_t minimum_final_size() const override
size_t output_length(size_t input_length) const override
secure_vector< uint8_t > & msg_buf()
size_t tag_size() const override final
int(* final)(unsigned char *, CTX *)
std::vector< T, secure_allocator< T > > secure_vector