9#ifndef BOTAN_TLS_CBC_HMAC_AEAD_H_
10#define BOTAN_TLS_CBC_HMAC_AEAD_H_
12#include <botan/aead.h>
31 std::string
name()
const final;
43 size_t tag_size() const final {
return m_tag_size; }
54 bool has_keying_material() const final;
77 size_t iv_size()
const {
return m_iv_size; }
95 std::vector<uint8_t> assoc_data_with_len(uint16_t len);
98 void start_msg(
const uint8_t nonce[],
size_t nonce_len)
final;
99 size_t process_msg(uint8_t buf[],
size_t sz)
final;
101 void key_schedule(std::span<const uint8_t> key)
final;
103 std::unique_ptr<Cipher_Mode> m_cbc;
104 std::unique_ptr<MessageAuthenticationCode> m_mac;
106 const std::string m_cipher_name;
107 const std::string m_mac_name;
108 size_t m_cipher_keylen;
113 bool m_use_encrypt_then_mac;
117 std::vector<uint8_t> m_ad;
129 std::unique_ptr<MessageAuthenticationCode>
mac,
154 std::unique_ptr<MessageAuthenticationCode>
mac,
167 void cbc_decrypt_record(uint8_t record_contents[],
size_t record_len);
169 void perform_additional_compressions(
size_t plen,
size_t padlen);
TLS_CBC_HMAC_AEAD_Decryption(std::unique_ptr< BlockCipher > cipher, std::unique_ptr< MessageAuthenticationCode > mac, size_t cipher_keylen, size_t mac_keylen, const Protocol_Version &version, bool use_encrypt_then_mac)
size_t minimum_final_size() const override
size_t output_length(size_t input_length) const override
void set_associated_data_n(size_t idx, std::span< const uint8_t > ad) override
size_t minimum_final_size() const override
size_t output_length(size_t input_length) const override
TLS_CBC_HMAC_AEAD_Encryption(std::unique_ptr< BlockCipher > cipher, std::unique_ptr< MessageAuthenticationCode > mac, size_t cipher_keylen, size_t mac_keylen, const Protocol_Version &version, bool use_encrypt_then_mac)
size_t update_granularity() const final
void set_associated_data_n(size_t idx, std::span< const uint8_t > ad) override
size_t block_size() const
secure_vector< uint8_t > & cbc_state()
size_t mac_keylen() const
Key_Length_Specification key_spec() const final
size_t default_nonce_length() const final
size_t ideal_granularity() const final
bool requires_entire_message() const final
bool use_encrypt_then_mac() const
bool is_datagram_protocol() const
std::vector< uint8_t > & assoc_data()
secure_vector< uint8_t > & msg()
size_t cipher_keylen() const
TLS_CBC_HMAC_AEAD_Mode(const TLS_CBC_HMAC_AEAD_Mode &other)=delete
MessageAuthenticationCode & mac() const
Cipher_Mode & cbc() const
size_t tag_size() const final
bool valid_nonce_length(size_t nl) const final
uint16_t check_tls_cbc_padding(const uint8_t record[], size_t record_len)
std::vector< T, secure_allocator< T > > secure_vector