Botan 3.4.0
Crypto and TLS for C&
Namespaces | Macros | Functions
assert.h File Reference

Public Header. More...

#include <botan/compiler.h>

Go to the source code of this file.

Namespaces

namespace  Botan
 

Macros

#define BOTAN_ARG_CHECK(expr, msg)
 
#define BOTAN_ASSERT(expr, assertion_made)
 
#define BOTAN_ASSERT_EQUAL(expr1, expr2, assertion_made)
 
#define BOTAN_ASSERT_IMPLICATION(expr1, expr2, msg)
 
#define BOTAN_ASSERT_NOMSG(expr)
 
#define BOTAN_ASSERT_NONNULL(ptr)
 
#define BOTAN_ASSERT_UNREACHABLE()   Botan::assert_unreachable(__FILE__, __LINE__)
 
#define BOTAN_DEBUG_ASSERT(expr)
 
#define BOTAN_STATE_CHECK(expr)
 
#define BOTAN_UNUSED   Botan::ignore_params
 

Functions

void Botan::assert_unreachable (const char *file, int line)
 
void Botan::assertion_failure (const char *expr_str, const char *assertion_made, const char *func, const char *file, int line)
 
template<typename T >
constexpr void Botan::ignore_param (T &&)
 
template<typename... T>
constexpr void Botan::ignore_params (T &&... args)
 
void Botan::throw_invalid_argument (const char *message, const char *func, const char *file)
 
void Botan::throw_invalid_state (const char *expr, const char *func, const char *file)
 

Detailed Description

Public Header.

Definition in file assert.h.

Macro Definition Documentation

◆ BOTAN_ARG_CHECK

#define BOTAN_ARG_CHECK ( expr,
msg )
Value:
do { \
if(!(expr)) \
Botan::throw_invalid_argument(msg, __func__, __FILE__); \
} while(0)

Definition at line 29 of file assert.h.

29#define BOTAN_ARG_CHECK(expr, msg) \
30 do { \
31 if(!(expr)) \
32 Botan::throw_invalid_argument(msg, __func__, __FILE__); \
33 } while(0)

Referenced by Botan::EC_Point::add(), Botan::Argon2::Argon2(), Botan::ranges::assert_equal_byte_lengths(), Botan::Bcrypt_PBKDF::Bcrypt_PBKDF(), Botan::bigint_monty_redc(), Botan::bigint_monty_redc_generic(), Botan::Scalar448::bytes_are_reduced(), Botan::TLS::Certificate_Type_Base::Certificate_Type_Base(), Botan::ChaCha::ChaCha(), Botan::StreamCipher::cipher(), Botan::TLS::Client::Client(), Botan::Dilithium_PrivateKey::create_signature_op(), Botan::SphincsPlus_PrivateKey::create_signature_op(), Botan::Dilithium_PublicKey::create_verification_op(), Botan::CTR_BE::CTR_BE(), Botan::decode_point(), Botan::decode_scalar(), Botan::PK_KEM_Decryptor::decrypt(), Botan::TLS::Cipher_State::decrypt_record_fragment(), Botan::Bcrypt_PBKDF::derive_key(), Botan::Dilithium_PrivateKey::Dilithium_PrivateKey(), Botan::Dilithium_PublicKey::Dilithium_PublicKey(), Botan::DSA_PrivateKey::DSA_PrivateKey(), Botan::DSA_PrivateKey::DSA_PrivateKey(), Botan::DSA_PrivateKey::DSA_PrivateKey(), Botan::DSA_PublicKey::DSA_PublicKey(), Botan::DSA_PublicKey::DSA_PublicKey(), Botan::ASN1_Time::encode_into(), Botan::PK_KEM_Encryptor::encrypt(), Botan::Buffered_Computation::final(), Botan::GHASH::final(), Botan::generate_passhash9(), Botan::Scalar448::get_bit(), Botan::hkdf_expand_label(), Botan::HMAC::HMAC(), Botan::HOTP::HOTP(), Botan::TLS::Hybrid_KEM_PrivateKey::Hybrid_KEM_PrivateKey(), Botan::TLS::Hybrid_KEM_PublicKey::Hybrid_KEM_PublicKey(), Botan::Keccak_Permutation::Keccak_Permutation(), Botan::PK_Ops::KEM_Decryption_with_KDF::kem_decrypt(), Botan::PK_Ops::KEM_Encryption_with_KDF::kem_encrypt(), Botan::TLS::KEX_to_KEM_Adapter_PrivateKey::KEX_to_KEM_Adapter_PrivateKey(), Botan::TLS::KEX_to_KEM_Adapter_PublicKey::KEX_to_KEM_Adapter_PublicKey(), Botan::KMAC::KMAC(), Botan::detail::load_any(), Botan::TLS::Hybrid_KEM_PublicKey::load_for_group(), Botan::BigInt::mod_add(), Botan::BigInt::mod_mul(), Botan::OCB_Mode::OCB_Mode(), Botan::OID::OID(), Botan::OID::OID(), Botan::operator*(), Botan::CCM_Decryption::output_length(), Botan::ChaCha20Poly1305_Decryption::output_length(), Botan::EAX_Decryption::output_length(), Botan::GCM_Decryption::output_length(), Botan::TLS::Text_Policy::record_size_limit(), Botan::rfc3394_keyunwrap(), Botan::rfc3394_keywrap(), Botan::round_up(), Botan::Blowfish::salted_set_key(), Botan::Scalar448::Scalar448(), Botan::TLS::Session::Session(), Botan::TLS::Session::Session(), Botan::TLS::Session::Session(), Botan::CCM_Mode::set_associated_data_n(), Botan::ChaCha20Poly1305_Mode::set_associated_data_n(), Botan::EAX_Mode::set_associated_data_n(), Botan::TLS::TLS_CBC_HMAC_AEAD_Mode::set_associated_data_n(), Botan::GCM_Mode::set_associated_data_n(), Botan::OCB_Mode::set_associated_data_n(), Botan::TLS::Record_Layer::set_record_size_limits(), Botan::Threefish_512::set_tweak(), Botan::sqrt_modulo_prime(), Botan::srp6_client_agree(), Botan::GHASH::start(), Botan::SRP6_Server_Session::step1(), Botan::TOTP::TOTP(), Botan::Dilithium::PolynomialVector::unpack_eta(), Botan::Dilithium::PolynomialVector::unpack_t0(), Botan::Dilithium::PolynomialVector::unpack_t1(), Botan::X448_PrivateKey::X448_PrivateKey(), Botan::X448_PublicKey::X448_PublicKey(), Botan::XMSS_PrivateKey::XMSS_PrivateKey(), Botan::XMSS_PublicKey::XMSS_PublicKey(), Botan::xor_buf(), Botan::xor_buf(), and Botan::xor_buf().

◆ BOTAN_ASSERT

#define BOTAN_ASSERT ( expr,
assertion_made )
Value:
do { \
if(!(expr)) \
Botan::assertion_failure(#expr, assertion_made, __func__, __FILE__, __LINE__); \
} while(0)

Make an assertion

Definition at line 50 of file assert.h.

50#define BOTAN_ASSERT(expr, assertion_made) \
51 do { \
52 if(!(expr)) \
53 Botan::assertion_failure(#expr, assertion_made, __func__, __FILE__, __LINE__); \
54 } while(0)

Referenced by Botan::Output_Buffers::add(), Botan::Dilithium::PolynomialVector::add_polyvec(), Botan::ranges::assert_exact_byte_length(), Botan::TLS::TLS_CBC_HMAC_AEAD_Mode::assoc_data_with_len(), Botan::bigint_add2_nc(), Botan::bigint_cnd_add(), Botan::bigint_cnd_sub(), Botan::bigint_sqr(), Botan::bigint_sub2(), Botan::bigint_sub2_rev(), Botan::bigint_sub3(), Botan::Cascade_Cipher::Cascade_Cipher(), Botan::TLS::Channel_Impl_12::change_cipher_spec_reader(), Botan::TLS::Channel_Impl_12::change_cipher_spec_writer(), Botan::TLS::Client_Key_Exchange::Client_Key_Exchange(), Botan::PK_Decryptor::decrypt_or_random(), Botan::EC_PrivateKey::EC_PrivateKey(), Botan::EC_PrivateKey::EC_PrivateKey(), Botan::polyn_gf2m::eea_with_coefficients(), Botan::OID::encode_into(), Botan::TLS::Session_Manager::establish(), Botan::TLS::Session_Manager_Stateless::establish(), Botan::Dilithium::PolynomialVector::fill_polyvecs_power2round(), Botan::TLS::Session_Manager_Hybrid::find_some(), Botan::Stream_Compression::finish(), Botan::FrodoKEMConstants::FrodoKEMConstants(), Botan::TLS::Channel_Impl_12::from_peer(), Botan::TLS::Channel_Impl_13::from_peer(), Botan::Dilithium::PolynomialMatrix::generate_matrix(), Botan::XMSS_Address::get_chain_address(), Botan::XMSS_Address::get_hash_address(), Botan::XMSS_Address::get_ltree_address(), Botan::XMSS_Address::get_ots_address(), Botan::XMSS_Address::get_tree_height(), Botan::XMSS_Address::get_tree_index(), Botan::GOST_3410_PublicKey::GOST_3410_PublicKey(), Botan::SP800_108_Counter::kdf(), Botan::SP800_108_Feedback::kdf(), Botan::SP800_108_Pipeline::kdf(), Botan::Kyber_PrivateKey::Kyber_PrivateKey(), Botan::EC_Point_Base_Point_Precompute::mul(), Botan::FrodoMatrix::mul_add_as_plus_e(), Botan::FrodoMatrix::mul_add_sa_plus_e(), Botan::FrodoMatrix::mul_add_sb_plus_e(), Botan::TLS::Datagram_Sequence_Numbers::next_write_sequence(), Botan::GHASH::nonce_hash(), Botan::OCB_Decryption::output_length(), Botan::SIV_Decryption::output_length(), Botan::TLS::Record_Layer::prepare_records(), Botan::XMSS_Common_Ops::randomize_tree_hash(), Botan::TLS::Record_Size_Limit::Record_Size_Limit(), Botan::redc_p192(), Botan::redc_p224(), Botan::redc_p256(), Botan::redc_p384(), Botan::Stateful_RNG::reseed_check(), Botan::TLS::Session_Manager_Hybrid::retrieve_one(), Botan::TLS::Server_Key_Exchange::Server_Key_Exchange(), Botan::XMSS_Address::set_chain_address(), Botan::XMSS_Address::set_hash_address(), Botan::XMSS_Address::set_key_mask_mode(), Botan::XMSS_Address::set_layer_addr(), Botan::XMSS_Address::set_ltree_address(), Botan::XMSS_Address::set_ots_address(), Botan::XMSS_Address::set_tree_addr(), Botan::XMSS_Address::set_tree_height(), Botan::XMSS_Address::set_tree_index(), Botan::sign_message(), Botan::Dilithium::PolynomialVector::unpack_sig(), Botan::Stream_Compression::update(), Botan::Cipher_Mode::update(), Botan::TLS::write_record(), Botan::XMSS_Address::XMSS_Address(), Botan::XMSS_Hash::XMSS_Hash(), and Botan::XMSS_WOTS_Parameters::XMSS_WOTS_Parameters().

◆ BOTAN_ASSERT_EQUAL

#define BOTAN_ASSERT_EQUAL ( expr1,
expr2,
assertion_made )
Value:
do { \
if((expr1) != (expr2)) \
Botan::assertion_failure(#expr1 " == " #expr2, assertion_made, __func__, __FILE__, __LINE__); \
} while(0)

Assert that value1 == value2

Definition at line 68 of file assert.h.

68#define BOTAN_ASSERT_EQUAL(expr1, expr2, assertion_made) \
69 do { \
70 if((expr1) != (expr2)) \
71 Botan::assertion_failure(#expr1 " == " #expr2, assertion_made, __func__, __FILE__, __LINE__); \
72 } while(0)

Referenced by Botan::base_encode_to_string(), Botan::PK_Ops::KEM_Decryption_with_KDF::kem_decrypt(), Botan::PK_Ops::KEM_Encryption_with_KDF::kem_encrypt(), Botan::ASN1::maybe_BER(), Botan::PBKDF::pbkdf_iterations(), and Botan::redc_p521().

◆ BOTAN_ASSERT_IMPLICATION

#define BOTAN_ASSERT_IMPLICATION ( expr1,
expr2,
msg )
Value:
do { \
if((expr1) && !(expr2)) \
Botan::assertion_failure(#expr1 " implies " #expr2, msg, __func__, __FILE__, __LINE__); \
} while(0)

Assert that expr1 (if true) implies expr2 is also true

Definition at line 77 of file assert.h.

77#define BOTAN_ASSERT_IMPLICATION(expr1, expr2, msg) \
78 do { \
79 if((expr1) && !(expr2)) \
80 Botan::assertion_failure(#expr1 " implies " #expr2, msg, __func__, __FILE__, __LINE__); \
81 } while(0)

Referenced by Botan::copy_mem(), Botan::TLS::Session_Manager_Hybrid::establish(), and Botan::TLS::Channel_Impl_12::from_peer().

◆ BOTAN_ASSERT_NOMSG

#define BOTAN_ASSERT_NOMSG ( expr)
Value:
do { \
if(!(expr)) \
Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
} while(0)

Make an assertion

Definition at line 59 of file assert.h.

59#define BOTAN_ASSERT_NOMSG(expr) \
60 do { \
61 if(!(expr)) \
62 Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
63 } while(0)

Referenced by Botan::FrodoMatrix::add(), Botan::EC_Point::add_affine(), Botan::TLS::Cipher_State::advance_with_client_finished(), Botan::TLS::Cipher_State::advance_with_client_hello(), Botan::TLS::Cipher_State::advance_with_server_finished(), Botan::TLS::Cipher_State::advance_with_server_hello(), Botan::TLS::Connection_Cipher_State::aead_nonce(), Botan::TLS::Connection_Cipher_State::aead_nonce(), Botan::AlignmentBuffer< T, BLOCK_SIZE, FINAL_BLOCK_STRATEGY >::aligned_data_to_process(), Botan::Memory_Pool::allocate(), Botan::AlignmentBuffer< T, BLOCK_SIZE, FINAL_BLOCK_STRATEGY >::append(), Botan::TLS::Server_Hello_13::basic_validation(), Botan::buffer_insert(), Botan::buffer_insert(), Botan::TLS::PSK::calculate_binders(), Botan::TLS::Certificate_13::Certificate_13(), Botan::TLS::Certificate_13::Certificate_13(), Botan::TLS::Certificate_Verify_13::Certificate_Verify_13(), Botan::PKIX::check_chain(), Botan::X448_PrivateKey::check_key(), Botan::TLS::Client_Impl_12::Client_Impl_12(), Botan::TLS::Client_Key_Exchange::Client_Key_Exchange(), Botan::MD4::compress_n(), Botan::compute_root(), Botan::TLS::Connection_Cipher_State::Connection_Cipher_State(), Botan::FrodoMatrix::constant_time_compare(), Botan::AlignmentBuffer< T, BLOCK_SIZE, FINAL_BLOCK_STRATEGY >::consume(), Botan::detail::copy_out_any_word_aligned_portion(), Botan::TLS::Server_Hello_13::create(), Botan::create_aes_row_generator(), Botan::X509::create_self_signed_cert(), Botan::create_shake_row_generator(), Botan::cSHAKE_XOF::cSHAKE_XOF(), Botan::BigInt::ct_shift_left(), Botan::BigInt::decode(), Botan::ZFEC::decode_shares(), Botan::Dilithium::Polynomial::decompose(), Botan::FrodoMatrix::deserialize(), Botan::Dilithium_PrivateKey::Dilithium_PrivateKey(), Botan::DilithiumModeConstants::DilithiumModeConstants(), Botan::AlignmentBuffer< T, BLOCK_SIZE, FINAL_BLOCK_STRATEGY >::directly_modify_first(), Botan::AlignmentBuffer< T, BLOCK_SIZE, FINAL_BLOCK_STRATEGY >::directly_modify_last(), Botan::TLS::New_Session_Ticket_13::early_data_byte_limit(), Botan::TLS::PSK::empty(), Botan::FrodoMatrix::encode(), Botan::ASN1_String::encode_into(), Botan::CCM_Mode::encode_length(), Botan::TLS::Session::encrypt(), Botan::TLS::Cipher_State::export_key(), Botan::Dilithium::Polynomial::fill_poly_uniform_eta(), Botan::TLS::Session_Manager::find(), Botan::TLS::Cipher_State::finished_mac(), Botan::fors_public_key_from_signature(), Botan::fors_sign_and_pkgen(), Botan::FrodoKEM_PrivateKey::FrodoKEM_PrivateKey(), Botan::FrodoKEM_PublicKey::FrodoKEM_PublicKey(), Botan::PSS_Params::from_emsa_name(), Botan::EC_PublicKey::get_int_field(), Botan::Sphincs_Hash_Functions::H_msg(), Botan::ht_sign(), Botan::ht_verify(), Botan::Kyber_PublicKey::initialize_from_encoding(), Botan::inverse_mod(), Botan::TLS::Cipher_State::is_compatible_with(), Botan::KDF2::kdf(), Botan::X942_PRF::kdf(), Botan::keccak_absorb_padded_strings_encoding(), Botan::keccak_int_left_encode(), Botan::keccak_int_right_encode(), Botan::PK_Ops::KEM_Encryption_with_KDF::kem_encrypt(), Botan::BLAKE2b::key_schedule(), Botan::Kyber_PrivateKey::Kyber_PrivateKey(), Botan::Kyber_PrivateKey::Kyber_PrivateKey(), Botan::TLS::Hybrid_KEM_PublicKey::load_for_group(), Botan::Montgomery_Int::Montgomery_Int(), Botan::Montgomery_Int::Montgomery_Int(), Botan::Montgomery_Int::Montgomery_Int(), Botan::AlignmentBuffer< T, BLOCK_SIZE, FINAL_BLOCK_STRATEGY >::next_aligned_block_to_process(), Botan::TLS::Handshake_Layer::next_message(), Botan::Dilithium::PolynomialVector::operator+=(), Botan::Dilithium::PolynomialVector::operator-=(), Botan::operator<(), Botan::FrodoMatrix::pack(), Botan::FrodoMatrix::packed_size(), Botan::EME_PKCS1v15::pad(), Botan::passes_miller_rabin_test(), Botan::pbkdf2(), Botan::Dilithium::PolynomialVector::polyvec_pointwise_acc_montgomery(), Botan::Dilithium::PolynomialVector::polyvecl_uniform_gamma1(), Botan::Dilithium::Polynomial::polyw1_pack(), Botan::TLS::Record_Layer::prepare_records(), Botan::Ed448_PrivateKey::private_key_bits(), Botan::TLS::Cipher_State::psk(), Botan::TLS::Cipher_State::psk_binder_mac(), Botan::TLS::Transcript_Hash_State::recreate_after_hello_retry_request(), Botan::redc_p192(), Botan::redc_p224(), Botan::redc_p256(), Botan::redc_p384(), Botan::TLS::Channel_Impl::request_downgrade_for_resumption(), Botan::TLS::Channel_Impl_12::reset_active_association_state(), Botan::TLS::Client_Hello_13::retry(), Botan::Sqlite3_Database::rows_changed_by_last_statement(), Botan::Salsa20::salsa_core(), Botan::FrodoMatrix::sample(), Botan::CTR_BE::seek(), Botan::TLS::Certificate_Type_Base::selected_certificate_type(), Botan::TLS::Server_Hello_13::selected_version(), Botan::Filter::send(), Botan::TLS::Record_Header::sequence(), Botan::TLS::Certificate_Verify::serialize(), Botan::TLS::Certificate_Type_Base::serialize(), Botan::TLS::Supported_Versions::serialize(), Botan::TLS::PSK_Key_Exchange_Modes::serialize(), Botan::TLS::Server_Hello_13::Server_Hello_13(), Botan::TLS::Server_Hello_13::Server_Hello_13(), Botan::TLS::Server_Hello_13::Server_Hello_13(), Botan::SHAKE_XOF::SHAKE_XOF(), Botan::TLS::Certificate_Request_13::signature_schemes(), Botan::Sphincs_Hash_Functions_Sha2::Sphincs_Hash_Functions_Sha2(), Botan::SphincsPlus_PrivateKey::SphincsPlus_PrivateKey(), Botan::sqrt_modulo_prime(), Botan::srp6_client_agree(), Botan::TLS::Session_Manager_In_Memory::store(), Botan::FrodoMatrix::sub(), Botan::TLS::Extensions::take(), Botan::TLS::Callbacks::tls_ephemeral_key_agreement(), Botan::TLS::Callbacks::tls_generate_ephemeral_key(), Botan::BigInt::to_dec_string(), Botan::treehash(), Botan::TLS::Record_Header::type(), Botan::FrodoMatrix::unpack(), Botan::TLS::Cipher_State::update_read_keys(), Botan::TLS::Cipher_State::update_write_keys(), Botan::TLS::Certificate_Type_Base::validate_selection(), Botan::vartime_divide(), Botan::TLS::Certificate_Verify_13::verify(), Botan::TLS::Cipher_State::verify_peer_finished_mac(), Botan::TLS::Record_Header::version(), Botan::wots_sign_and_pkgen(), Botan::xmss_sign_and_pkgen(), and Botan::Dilithium_AES_Symmetric_Primitives::XOF().

◆ BOTAN_ASSERT_NONNULL

#define BOTAN_ASSERT_NONNULL ( ptr)
Value:
do { \
if((ptr) == nullptr) \
Botan::assertion_failure(#ptr " is not null", "", __func__, __FILE__, __LINE__); \
} while(0)

Assert that a pointer is not null

Definition at line 86 of file assert.h.

86#define BOTAN_ASSERT_NONNULL(ptr) \
87 do { \
88 if((ptr) == nullptr) \
89 Botan::assertion_failure(#ptr " is not null", "", __func__, __FILE__, __LINE__); \
90 } while(0)

Referenced by Botan::TLS::Connection_Cipher_State::aead(), Botan::TLS::Certificate_13::Certificate_Entry::Certificate_Entry(), Botan::TLS::Certificate_Verify_12::Certificate_Verify_12(), Botan::TLS::Channel_Impl_12::Channel_Impl_12(), Botan::TLS::Channel_Impl_13::Channel_Impl_13(), Botan::TLS::Client_Hello::Client_Hello(), Botan::TLS::Client_Impl_12::Client_Impl_12(), Botan::TLS::Cipher_State::decrypt_output_length(), Botan::TLS::Cipher_State::decrypt_record_fragment(), Botan::DLIES_Decryptor::DLIES_Decryptor(), Botan::DLIES_Encryptor::DLIES_Encryptor(), Botan::TLS::Cipher_State::encrypt_output_length(), Botan::TLS::Cipher_State::encrypt_record_fragment(), Botan::TLS::Certificate_Status_Request::get_ocsp_response(), Botan::TLS::Cipher_State::hash_algorithm(), Botan::TLS::Client_Hello_13::highest_supported_version(), Botan::HMAC_DRBG::HMAC_DRBG(), Botan::HMAC_DRBG::HMAC_DRBG(), Botan::HMAC_DRBG::HMAC_DRBG(), Botan::HMAC_DRBG::HMAC_DRBG(), Botan::KMAC::KMAC(), Botan::TLS::TLS_CBC_HMAC_AEAD_Mode::mac(), Botan::TLS::Cipher_State::minimum_decryption_input_length(), Botan::CBC_Mode::padding(), Botan::TLS::Certificate_13::Certificate_Entry::public_key(), Botan::TLS::Certificate_Status_Request::serialize(), Botan::TLS::Server_Hello_13::Server_Hello_13(), Botan::TLS::Server_Impl_12::Server_Impl_12(), Botan::TLS::Server_Key_Exchange::server_kex_key(), Botan::TLS::Session_Manager::Session_Manager(), Botan::TLS::Session_Manager_Hybrid::Session_Manager_Hybrid(), Botan::TLS::Session_Manager_Stateless::Session_Manager_Stateless(), Botan::TLS::PSK::take_selected_psk_info(), Botan::Truncated_Hash::Truncated_Hash(), and Botan::TLS::Channel_Impl_13::update_traffic_keys().

◆ BOTAN_ASSERT_UNREACHABLE

#define BOTAN_ASSERT_UNREACHABLE ( )    Botan::assert_unreachable(__FILE__, __LINE__)

◆ BOTAN_DEBUG_ASSERT

#define BOTAN_DEBUG_ASSERT ( expr)

◆ BOTAN_STATE_CHECK

#define BOTAN_STATE_CHECK ( expr)
Value:
do { \
if(!(expr)) \
Botan::throw_invalid_state(#expr, __func__, __FILE__); \
} while(0)

Definition at line 41 of file assert.h.

41#define BOTAN_STATE_CHECK(expr) \
42 do { \
43 if(!(expr)) \
44 Botan::throw_invalid_state(#expr, __func__, __FILE__); \
45 } while(0)

Referenced by Botan::TLS::Cipher_State::advance_with_server_hello(), Botan::TLS::Certificate_13::cert_chain(), Botan::TLS::Certificate_13::Certificate_Entry::certificate(), Botan::TLS::Client_Key_Exchange::Client_Key_Exchange(), Botan::TLS::Client_Hello::cookie_input_data(), Botan::TLS::Server_Hello_13::create(), Botan::TLS::Transcript_Hash_State::current(), Botan::TLS::ExternalPSK::extract_master_secret(), Botan::TLS::Session::extract_master_secret(), Botan::TLS::PSK::filter(), Botan::FrodoKEM_PrivateKey::FrodoKEM_PrivateKey(), Botan::TLS::Channel_Impl_13::from_peer(), Botan::TLS::Certificate_Status_Request::get_ocsp_response(), Botan::TLS::Hello_Retry_Request::Hello_Retry_Request(), Botan::TLS::Channel_Impl_13::key_material_export(), Botan::TLS::Certificate_13::leaf(), Botan::BufferStuffer::next(), Botan::BufferStuffer::next(), Botan::TLS::Cipher_State::next_ticket_nonce(), Botan::TLS::Channel_Impl::preserve_client_hello(), Botan::TLS::Channel_Impl::preserve_peer_transcript(), Botan::TLS::Transcript_Hash_State::previous(), Botan::TLS::Certificate_13::public_key(), Botan::TLS::Transcript_Hash_State::recreate_after_hello_retry_request(), Botan::TLS::Channel_Impl::request_downgrade(), Botan::TLS::Channel_Impl::request_downgrade_for_resumption(), Botan::TLS::Client_Hello_13::retry(), Botan::TLS::PSK::select_offered_psk(), Botan::TLS::Channel_Impl_13::AggregatedMessages::send(), Botan::TLS::Server_Impl_13::send_new_session_tickets(), Botan::TLS::PSK::serialize(), Botan::TLS::Transcript_Hash_State::set_algorithm(), Botan::TLS::Channel_Impl::set_io_buffer_size(), Botan::TLS::Application_Layer_Protocol_Notification::single_protocol(), Botan::TLS::Internal::Handshake_State_13_Base::store(), Botan::BufferSlicer::take(), Botan::BufferSlicer::take(), Botan::TLS::PSK::take_selected_psk_info(), Botan::TLS::PSK::take_session_to_resume_or_psk(), Botan::TLS::Transcript_Hash_State::truncated(), Botan::TLS::Client_Hello_12::update_hello_cookie(), Botan::TLS::Channel_Impl_13::update_traffic_keys(), and Botan::TLS::PSK::validate_binder().

◆ BOTAN_UNUSED

#define BOTAN_UNUSED   Botan::ignore_params

Definition at line 118 of file assert.h.

Referenced by Botan::OS::allocate_locked_pages(), Botan::PKCS8::BER_encode(), Botan::PKCS8::BER_encode_encrypted_pbkdf_iter(), Botan::PKCS8::BER_encode_encrypted_pbkdf_msec(), Botan::bigint_mod_sub(), Botan::bigint_mod_sub_n(), Botan::CPUID::bit_from_string(), botan_bcrypt_generate(), botan_bcrypt_is_valid(), botan_fpe_decrypt(), botan_fpe_destroy(), botan_fpe_encrypt(), botan_fpe_fe1_init(), botan_hotp_check(), botan_hotp_destroy(), botan_hotp_generate(), botan_hotp_init(), botan_mceies_decrypt(), botan_mceies_encrypt(), botan_nist_kw_dec(), botan_nist_kw_enc(), botan_pkcs_hash_id(), botan_privkey_create_dsa(), botan_privkey_create_elgamal(), botan_privkey_ed25519_get_privkey(), botan_privkey_ed448_get_privkey(), botan_privkey_load(), botan_privkey_load_dh(), botan_privkey_load_dsa(), botan_privkey_load_ecdh(), botan_privkey_load_ecdsa(), botan_privkey_load_ed25519(), botan_privkey_load_ed448(), botan_privkey_load_elgamal(), botan_privkey_load_kyber(), botan_privkey_load_rsa(), botan_privkey_load_rsa_pkcs1(), botan_privkey_load_sm2(), botan_privkey_load_x25519(), botan_privkey_load_x448(), botan_privkey_rsa_get_privkey(), botan_privkey_view_kyber_raw_key(), botan_privkey_x25519_get_privkey(), botan_privkey_x448_get_privkey(), botan_pubkey_ecc_key_used_explicit_encoding(), botan_pubkey_ed25519_get_pubkey(), botan_pubkey_ed448_get_pubkey(), botan_pubkey_load_dh(), botan_pubkey_load_dsa(), botan_pubkey_load_ecdh(), botan_pubkey_load_ecdsa(), botan_pubkey_load_ed25519(), botan_pubkey_load_ed448(), botan_pubkey_load_elgamal(), botan_pubkey_load_kyber(), botan_pubkey_load_rsa(), botan_pubkey_load_sm2(), botan_pubkey_load_x25519(), botan_pubkey_load_x448(), botan_pubkey_view_ec_public_point(), botan_pubkey_view_kyber_raw_key(), botan_pubkey_x25519_get_pubkey(), botan_pubkey_x448_get_pubkey(), botan_srp6_client_agree(), botan_srp6_generate_verifier(), botan_srp6_group_size(), botan_srp6_server_session_init(), botan_srp6_server_session_step1(), botan_srp6_server_session_step2(), botan_totp_check(), botan_totp_destroy(), botan_totp_generate(), botan_totp_init(), botan_x509_cert_allowed_usage(), botan_x509_cert_destroy(), botan_x509_cert_dup(), botan_x509_cert_get_authority_key_id(), botan_x509_cert_get_fingerprint(), botan_x509_cert_get_issuer_dn(), botan_x509_cert_get_public_key(), botan_x509_cert_get_serial_number(), botan_x509_cert_get_subject_dn(), botan_x509_cert_get_subject_key_id(), botan_x509_cert_get_time_expires(), botan_x509_cert_get_time_starts(), botan_x509_cert_hostname_match(), botan_x509_cert_load(), botan_x509_cert_not_after(), botan_x509_cert_not_before(), botan_x509_cert_verify(), botan_x509_cert_verify_with_crl(), botan_x509_cert_view_as_string(), botan_x509_cert_view_public_key_bits(), botan_x509_crl_destroy(), botan_x509_crl_load(), botan_x509_is_revoked(), botan_zfec_decode(), botan_zfec_encode(), Botan::TLS::Connection_Cipher_State::Connection_Cipher_State(), Botan::AEAD_Mode::create(), Botan::Compression_Algorithm::create(), Botan::Decompression_Algorithm::create(), Botan::BlockCipher::create(), Botan::KDF::create(), Botan::MessageAuthenticationCode::create(), Botan::PBKDF::create(), Botan::PasswordHashFamily::create(), Botan::StreamCipher::create(), Botan::Entropy_Source::create(), Botan::create_ec_private_key(), Botan::FrodoKEM_PrivateKey::create_kem_decryption_op(), Botan::Kyber_PrivateKey::create_kem_decryption_op(), Botan::create_private_key(), Botan::Dilithium_PrivateKey::create_signature_op(), Botan::SphincsPlus_PrivateKey::create_signature_op(), Botan::Sodium::crypto_aead_chacha20poly1305_decrypt(), Botan::Sodium::crypto_aead_chacha20poly1305_decrypt_detached(), Botan::Sodium::crypto_aead_chacha20poly1305_encrypt(), Botan::Sodium::crypto_aead_chacha20poly1305_encrypt_detached(), Botan::Sodium::crypto_aead_chacha20poly1305_ietf_decrypt(), Botan::Sodium::crypto_aead_chacha20poly1305_ietf_decrypt_detached(), Botan::Sodium::crypto_aead_chacha20poly1305_ietf_encrypt(), Botan::Sodium::crypto_aead_chacha20poly1305_ietf_encrypt_detached(), Botan::Sodium::crypto_aead_xchacha20poly1305_ietf_decrypt(), Botan::Sodium::crypto_aead_xchacha20poly1305_ietf_decrypt_detached(), Botan::Sodium::crypto_aead_xchacha20poly1305_ietf_encrypt(), Botan::Sodium::crypto_aead_xchacha20poly1305_ietf_encrypt_detached(), Botan::PasswordHash::derive_key(), Botan::TLS::Session_Manager::establish(), Botan::Certificate_Store_MacOS::find_cert_by_raw_subject_dn_sha256(), Botan::Certificate_Store_Windows::find_cert_by_raw_subject_dn_sha256(), Botan::Flatfile_Certificate_Store::find_crl_for(), Botan::Certificate_Store_MacOS::find_crl_for(), Botan::Certificate_Store_Windows::find_crl_for(), Botan::TLS::Session_Manager_In_Memory::find_some(), Botan::OS::get_auxval(), Botan::get_files_recursive(), Botan::OS::get_memory_locking_limit(), Botan::EC_Group::hash_to_curve(), Botan::SP800_56A_Hash::kdf(), Botan::BigInt::mod_add(), Botan::TLS::Ciphersuite::nonce_bytes_from_record(), Botan::OS::open_socket(), Botan::OS::open_socket_udp(), Botan::OS::page_allow_access(), Botan::OS::page_named(), Botan::OS::page_prohibit_access(), Botan::PK_KEM_Encryptor::PK_KEM_Encryptor(), Botan::CT::poison(), Botan::probe_provider_private_key(), Botan::redc_p192(), Botan::redc_p224(), Botan::redc_p256(), Botan::redc_p384(), Botan::OS::run_cpu_instruction_probe(), Botan::TLS::Server_Key_Exchange::Server_Key_Exchange(), Botan::MessageAuthenticationCode::start_msg(), Botan::OS::system_page_size(), Botan::TLS::Callbacks::tls_log_debug(), Botan::TLS::Callbacks::tls_log_debug_bin(), Botan::TLS::Callbacks::tls_log_error(), Botan::TLS::Callbacks::tls_provide_cert_status(), Botan::TLS::Callbacks::tls_session_established(), Botan::TLS::Callbacks::tls_verify_raw_public_key(), Botan::CPUID::to_string(), Botan::Scrypt_Family::tune(), Botan::CT::unpoison(), Botan::CT::unpoison(), Botan::TLS::Certificate_Verify_13::verify(), Botan::TLS::Server_Key_Exchange::verify(), and Botan::TLS::Certificate_Verify_12::verify().