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

Internal Header. More...

#include <botan/exceptn.h>
#include <botan/ffi.h>
#include <botan/mem_ops.h>
#include <cstdint>
#include <functional>
#include <memory>
#include <stdexcept>

Go to the source code of this file.

Classes

struct  Botan_FFI::botan_struct< T, MAGIC >
 
struct  Botan_FFI::botan_view_bounce_struct
 
class  Botan_FFI::FFI_Error
 

Namespaces

namespace  Botan_FFI
 

Macros

#define BOTAN_FFI_CHECKED_DELETE(o)   ffi_delete_object(o, __func__)
 
#define BOTAN_FFI_DECLARE_DUMMY_STRUCT(NAME, MAGIC)    struct NAME final : public Botan_FFI::botan_struct<int, MAGIC> {}
 
#define BOTAN_FFI_DECLARE_STRUCT(NAME, TYPE, MAGIC)
 
#define BOTAN_FFI_VISIT(obj, lambda)   botan_ffi_visit(obj, lambda, __func__)
 

Functions

template<typename T , uint32_t M, typename F >
int Botan_FFI::botan_ffi_visit (botan_struct< T, M > *o, F func, const char *func_name)
 
int Botan_FFI::botan_view_bin_bounce_fn (botan_view_ctx vctx, const uint8_t *buf, size_t len)
 
int Botan_FFI::botan_view_str_bounce_fn (botan_view_ctx vctx, const char *str, size_t len)
 
template<typename Fn , typename... Args>
int Botan_FFI::copy_view_bin (uint8_t out[], size_t *out_len, Fn fn, Args... args)
 
template<typename Fn , typename... Args>
int Botan_FFI::copy_view_str (uint8_t out[], size_t *out_len, Fn fn, Args... args)
 
template<typename T , uint32_t M>
int Botan_FFI::ffi_delete_object (botan_struct< T, M > *obj, const char *func_name)
 
int Botan_FFI::ffi_error_exception_thrown (const char *func_name, const char *exn, int rc)
 
int Botan_FFI::ffi_guard_thunk (const char *func_name, const std::function< int()> &thunk)
 
template<typename Alloc >
int Botan_FFI::invoke_view_callback (botan_view_bin_fn view, botan_view_ctx ctx, const std::vector< uint8_t, Alloc > &buf)
 
int Botan_FFI::invoke_view_callback (botan_view_str_fn view, botan_view_ctx ctx, std::string_view str)
 
template<typename T , uint32_t M>
TBotan_FFI::safe_get (botan_struct< T, M > *p)
 
int Botan_FFI::write_output (uint8_t out[], size_t *out_len, const uint8_t buf[], size_t buf_len)
 
int Botan_FFI::write_str_output (char out[], size_t *out_len, const std::vector< uint8_t > &str_vec)
 
int Botan_FFI::write_str_output (char out[], size_t *out_len, std::string_view str)
 
int Botan_FFI::write_str_output (uint8_t out[], size_t *out_len, std::string_view str)
 
template<typename Alloc >
int Botan_FFI::write_vec_output (uint8_t out[], size_t *out_len, const std::vector< uint8_t, Alloc > &buf)
 

Detailed Description

Internal Header.

Definition in file ffi_util.h.

Macro Definition Documentation

◆ BOTAN_FFI_CHECKED_DELETE

#define BOTAN_FFI_CHECKED_DELETE ( o)    ffi_delete_object(o, __func__)

◆ BOTAN_FFI_DECLARE_DUMMY_STRUCT

#define BOTAN_FFI_DECLARE_DUMMY_STRUCT ( NAME,
MAGIC )    struct NAME final : public Botan_FFI::botan_struct<int, MAGIC> {}

Definition at line 56 of file ffi_util.h.

56#define BOTAN_FFI_DECLARE_DUMMY_STRUCT(NAME, MAGIC) \
57 struct NAME final : public Botan_FFI::botan_struct<int, MAGIC> {}

◆ BOTAN_FFI_DECLARE_STRUCT

#define BOTAN_FFI_DECLARE_STRUCT ( NAME,
TYPE,
MAGIC )
Value:
struct NAME final : public Botan_FFI::botan_struct<TYPE, MAGIC> { \
explicit NAME(std::unique_ptr<TYPE> x) : botan_struct(std::move(x)) {} \
}
int(* final)(unsigned char *, CTX *)

Definition at line 51 of file ffi_util.h.

51#define BOTAN_FFI_DECLARE_STRUCT(NAME, TYPE, MAGIC) \
52 struct NAME final : public Botan_FFI::botan_struct<TYPE, MAGIC> { \
53 explicit NAME(std::unique_ptr<TYPE> x) : botan_struct(std::move(x)) {} \
54 }

◆ BOTAN_FFI_VISIT

#define BOTAN_FFI_VISIT ( obj,
lambda )   botan_ffi_visit(obj, lambda, __func__)

Definition at line 124 of file ffi_util.h.

Referenced by botan_block_cipher_block_size(), botan_block_cipher_clear(), botan_block_cipher_decrypt_blocks(), botan_block_cipher_encrypt_blocks(), botan_block_cipher_get_keyspec(), botan_block_cipher_name(), botan_block_cipher_set_key(), botan_cipher_clear(), botan_cipher_get_default_nonce_length(), botan_cipher_get_ideal_update_granularity(), botan_cipher_get_keyspec(), botan_cipher_get_tag_length(), botan_cipher_get_update_granularity(), botan_cipher_is_authenticated(), botan_cipher_name(), botan_cipher_output_length(), botan_cipher_query_keylen(), botan_cipher_requires_entire_message(), botan_cipher_reset(), botan_cipher_set_associated_data(), botan_cipher_set_key(), botan_cipher_valid_nonce_length(), botan_hash_block_size(), botan_hash_clear(), botan_hash_copy_state(), botan_hash_final(), botan_hash_name(), botan_hash_output_length(), botan_hash_update(), botan_hotp_check(), botan_hotp_generate(), botan_mac_clear(), botan_mac_final(), botan_mac_get_keyspec(), botan_mac_name(), botan_mac_output_length(), botan_mac_set_key(), botan_mac_set_nonce(), botan_mac_update(), botan_mp_add(), botan_mp_add_u32(), botan_mp_clear(), botan_mp_clear_bit(), botan_mp_cmp(), botan_mp_div(), botan_mp_equal(), botan_mp_flip_sign(), botan_mp_from_bin(), botan_mp_gcd(), botan_mp_get_bit(), botan_mp_is_even(), botan_mp_is_negative(), botan_mp_is_odd(), botan_mp_is_positive(), botan_mp_is_prime(), botan_mp_is_zero(), botan_mp_lshift(), botan_mp_mod_inverse(), botan_mp_mod_mul(), botan_mp_mul(), botan_mp_num_bits(), botan_mp_num_bytes(), botan_mp_powmod(), botan_mp_rand_bits(), botan_mp_rand_range(), botan_mp_rshift(), botan_mp_set_bit(), botan_mp_set_from_int(), botan_mp_set_from_mp(), botan_mp_set_from_radix_str(), botan_mp_set_from_str(), botan_mp_sub(), botan_mp_sub_u32(), botan_mp_swap(), botan_mp_to_bin(), botan_mp_to_hex(), botan_mp_to_str(), botan_mp_to_uint32(), botan_pk_op_decrypt(), botan_pk_op_decrypt_output_length(), botan_pk_op_encrypt(), botan_pk_op_encrypt_output_length(), botan_pk_op_kem_decrypt_shared_key(), botan_pk_op_kem_decrypt_shared_key_length(), botan_pk_op_kem_encrypt_create_shared_key(), botan_pk_op_kem_encrypt_encapsulated_key_length(), botan_pk_op_kem_encrypt_shared_key_length(), botan_pk_op_key_agreement(), botan_pk_op_key_agreement_size(), botan_pk_op_key_agreement_view_public(), botan_pk_op_sign_finish(), botan_pk_op_sign_output_length(), botan_pk_op_sign_update(), botan_pk_op_verify_finish(), botan_pk_op_verify_update(), botan_privkey_algo_name(), botan_privkey_check_key(), botan_privkey_ed25519_get_privkey(), botan_privkey_ed448_get_privkey(), botan_privkey_get_field(), botan_privkey_rsa_get_privkey(), botan_privkey_view_der(), botan_privkey_view_encrypted_der(), botan_privkey_view_encrypted_der_timed(), botan_privkey_view_encrypted_pem(), botan_privkey_view_encrypted_pem_timed(), botan_privkey_view_kyber_raw_key(), botan_privkey_view_pem(), botan_privkey_x25519_get_privkey(), botan_privkey_x448_get_privkey(), botan_pubkey_algo_name(), botan_pubkey_check_key(), botan_pubkey_ed25519_get_pubkey(), botan_pubkey_ed448_get_pubkey(), botan_pubkey_estimated_strength(), botan_pubkey_fingerprint(), botan_pubkey_get_field(), botan_pubkey_view_der(), botan_pubkey_view_ec_public_point(), botan_pubkey_view_kyber_raw_key(), botan_pubkey_view_pem(), botan_pubkey_x25519_get_pubkey(), botan_pubkey_x448_get_pubkey(), botan_rng_add_entropy(), botan_rng_get(), botan_rng_reseed(), botan_rng_reseed_from_rng(), botan_srp6_server_session_step1(), botan_srp6_server_session_step2(), botan_totp_check(), botan_totp_generate(), botan_x509_cert_allowed_usage(), botan_x509_cert_get_authority_key_id(), botan_x509_cert_get_fingerprint(), botan_x509_cert_get_issuer_dn(), 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_not_after(), botan_x509_cert_not_before(), botan_x509_cert_view_as_string(), botan_x509_cert_view_public_key_bits(), and botan_x509_is_revoked().