Botan 2.1.0 Crypto and TLS for C++11

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

Namespaces | Macros | Functions
assert.h File Reference
`#include <botan/build.h>`

Go to the source code of this file.

## Namespaces
| Botan

## Macros
#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_UNUSED(v) static_cast<void>(v)

## Functions
void | Botan::assertion_failure (const char *expr_str, const char *assertion_made, const char *func, const char *file, int line)

## Macro Definition Documentation

#define BOTAN_ASSERT | ( |  | expr,
|  |  | assertion_made
| ) |  |

Value:
do { \
if(!(expr)) \
Botan::assertion_failure(#expr, \
assertion_made, \
BOTAN_CURRENT_FUNCTION, \
__FILE__, \
__LINE__); \
} while(0)
Botan::assertion_failure
void assertion_failure(const char *expr_str, const char *assertion_made, const char *func, const char *file, int line)
Definition: assert.cpp:13
BOTAN_CURRENT_FUNCTION
#define BOTAN_CURRENT_FUNCTION
Definition: compiler.h:105

Make an assertion

Definition at line 27 of file assert.h.

Referenced by Botan::Output_Buffers::add(), Botan::mlock_allocator::allocate(), Botan::TLS::TLS_CBC_HMAC_AEAD_Mode::assoc_data_with_len(), Botan::bigint_add2_nc(), Botan::bigint_monty_redc(), Botan::bigint_sqr(), Botan::bigint_sub2(), Botan::bigint_sub2_rev(), Botan::bigint_sub3(), botan_cipher_update(), Botan::TLS::Channel::change_cipher_spec_reader(), Botan::TLS::Channel::change_cipher_spec_writer(), Botan::TLS::Client_Hello::Client_Hello(), Botan::TLS::Client_Key_Exchange::Client_Key_Exchange(), Botan::TLS::Connection_Cipher_State::Connection_Cipher_State(), Botan::ct_inverse_mod_odd_modulus(), Botan::mlock_allocator::deallocate(), Botan::Threefish_512::decrypt_n(), Botan::PK_Decryptor::decrypt_or_random(), Botan::EC_PrivateKey::EC_PrivateKey(), Botan::polyn_gf2m::eea_with_coefficients(), Botan::OID::encode_into(), Botan::CCM_Mode::encode_length(), Botan::Threefish_512::encrypt_n(), Botan::XTS_Encryption::finish(), Botan::CBC_Encryption::finish(), Botan::SIV_Encryption::finish(), Botan::XTS_Decryption::finish(), Botan::CCM_Encryption::finish(), Botan::OCB_Encryption::finish(), Botan::ChaCha20Poly1305_Decryption::finish(), Botan::CTS_Encryption::finish(), Botan::SIV_Decryption::finish(), Botan::EAX_Decryption::finish(), Botan::CCM_Decryption::finish(), Botan::OCB_Decryption::finish(), Botan::CBC_Decryption::finish(), Botan::TLS::TLS_CBC_HMAC_AEAD_Encryption::finish(), Botan::Stream_Compression::finish(), Botan::CTS_Decryption::finish(), Botan::XMSS_WOTS_PrivateKey::generate_public_key(), 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::CPUID::initialize(), Botan::XMSS_WOTS_Verification_Operation::is_valid_signature(), Botan::mceies_encrypt(), Botan::TLS::Datagram_Sequence_Numbers::next_write_sequence(), Botan::GHASH::nonce_hash(), Botan::operator*(), Botan::ChaCha20Poly1305_Decryption::output_length(), Botan::GCM_Decryption::output_length(), Botan::EAX_Decryption::output_length(), Botan::OCB_Decryption::output_length(), Botan::SIV_Decryption::output_length(), Botan::CCM_Decryption::output_length(), Botan::XTS_Encryption::process(), Botan::CBC_Encryption::process(), Botan::XTS_Decryption::process(), Botan::OCB_Encryption::process(), Botan::OCB_Decryption::process(), Botan::CBC_Decryption::process(), Botan::XMSS_Common_Ops::randomize_tree_hash(), Botan::TLS::Channel::received_data(), Botan::Stateful_RNG::reseed_check(), Botan::round_up(), Botan::TLS::Server_Key_Exchange::Server_Key_Exchange(), Botan::CCM_Mode::set_associated_data(), Botan::OCB_Mode::set_associated_data(), 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::TLS::Compat_Callbacks::tls_alert(), Botan::TLS::Compat_Callbacks::tls_emit_data(), Botan::TLS::Compat_Callbacks::tls_record_received(), Botan::TLS::Compat_Callbacks::tls_session_established(), Botan::XMSS_PrivateKey::tree_hash(), Botan::XMSS_WOTS_Verification_Operation::update(), Botan::XMSS_WOTS_Signature_Operation::update(), Botan::Cipher_Mode::update(), Botan::GHASH::update(), Botan::Stream_Compression::update(), Botan::TLS::write_record(), Botan::XMSS_Address::XMSS_Address(), Botan::XMSS_Hash::XMSS_Hash(), Botan::XMSS_PrivateKey::XMSS_PrivateKey(), Botan::XMSS_Signature::XMSS_Signature(), and Botan::XMSS_WOTS_Parameters::XMSS_WOTS_Parameters().

#define BOTAN_ASSERT_EQUAL | ( |  | expr1,
|  |  | expr2,
|  |  | assertion_made
| ) |  |

Value:
do { \
if((expr1) != (expr2)) \
Botan::assertion_failure(#expr1 " == " #expr2, \
assertion_made, \
BOTAN_CURRENT_FUNCTION, \
__FILE__, \
__LINE__); \
} while(0)
Botan::assertion_failure
void assertion_failure(const char *expr_str, const char *assertion_made, const char *func, const char *file, int line)
Definition: assert.cpp:13
BOTAN_CURRENT_FUNCTION
#define BOTAN_CURRENT_FUNCTION
Definition: compiler.h:105

Assert that value1 == value2

Definition at line 53 of file assert.h.

Referenced by Botan::aont_package(), Botan::aont_unpackage(), Botan::base64_encode(), Botan::TLS::Connection_Cipher_State::Connection_Cipher_State(), Botan::CryptoBox::decrypt(), Botan::CryptoBox::encrypt(), Botan::ASN1::maybe_BER(), Botan::monty_inverse(), Botan::PBKDF::pbkdf_iterations(), and Botan::redc_p521().

#define BOTAN_ASSERT_IMPLICATION | ( |  | expr1,
|  |  | expr2,
|  |  | msg
| ) |  |

Value:
do { \
if((expr1) && !(expr2)) \
Botan::assertion_failure(#expr1 " implies " #expr2, \
msg, \
BOTAN_CURRENT_FUNCTION, \
__FILE__, \
__LINE__); \
} while(0)
Botan::assertion_failure
void assertion_failure(const char *expr_str, const char *assertion_made, const char *func, const char *file, int line)
Definition: assert.cpp:13
BOTAN_CURRENT_FUNCTION
#define BOTAN_CURRENT_FUNCTION
Definition: compiler.h:105

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

Definition at line 66 of file assert.h.

Referenced by Botan::TLS::Blocking_Client::read().

#define BOTAN_ASSERT_NOMSG | ( |  | expr | ) |

Value:
do { \
if(!(expr)) \
Botan::assertion_failure(#expr, \
"", \
BOTAN_CURRENT_FUNCTION, \
__FILE__, \
__LINE__); \
} while(0)
Botan::assertion_failure
void assertion_failure(const char *expr_str, const char *assertion_made, const char *func, const char *file, int line)
Definition: assert.cpp:13
BOTAN_CURRENT_FUNCTION
#define BOTAN_CURRENT_FUNCTION
Definition: compiler.h:105

Make an assertion

Definition at line 40 of file assert.h.

#define BOTAN_ASSERT_NONNULL | ( |  | ptr | ) |

Value:
do { \
if((ptr) == nullptr) \
Botan::assertion_failure(#ptr " is not null", \
"", \
BOTAN_CURRENT_FUNCTION, \
__FILE__, \
__LINE__); \
} while(0)
Botan::assertion_failure
void assertion_failure(const char *expr_str, const char *assertion_made, const char *func, const char *file, int line)
Definition: assert.cpp:13
BOTAN_CURRENT_FUNCTION
#define BOTAN_CURRENT_FUNCTION
Definition: compiler.h:105

Assert that a pointer is not null

Definition at line 79 of file assert.h.

Referenced by botan_pk_op_decrypt_create(), botan_pk_op_encrypt_create(), botan_pk_op_key_agreement_create(), botan_pk_op_sign_create(), botan_pk_op_verify_create(), Botan::TLS::Certificate_Verify::Certificate_Verify(), Botan::PKIX::check_crl(), Botan::TLS::TLS_CBC_HMAC_AEAD_Mode::cipher(), Botan::DLIES_Decryptor::DLIES_Decryptor(), Botan::DLIES_Encryptor::DLIES_Encryptor(), Botan::HMAC_DRBG::HMAC_DRBG(), Botan::TLS::TLS_CBC_HMAC_AEAD_Mode::mac(), Botan::CBC_Mode::padding(), and Botan::TLS::Server_Key_Exchange::server_kex_key().

#define BOTAN_UNUSED | ( |  | v | ) | static_cast<void>(v)

Mark variable as unused

Definition at line 92 of file assert.h.

Referenced by Botan::OS::allocate_locked_pages(), botan_privkey_load_dsa(), botan_pubkey_load_dsa(), Botan::BlockCipher::create(), Botan::PBKDF::create(), Botan::StreamCipher::create(), Botan::MessageAuthenticationCode::create(), Botan::KDF::create(), Botan::get_files_recursive(), Botan::make_compressor(), Botan::make_decompressor(), Botan::CT::poison(), Botan::MessageAuthenticationCode::start_msg(), Botan::TLS::Callbacks::tls_log_debug(), Botan::TLS::Callbacks::tls_log_debug_bin(), Botan::TLS::Callbacks::tls_log_error(), and Botan::CT::unpoison().