Botan  2.11.0
Crypto and TLS for C++11
Macros | Typedefs | Enumerations | Functions | Variables
ffi.h File Reference
#include <botan/build.h>
#include <stdint.h>
#include <stddef.h>

Go to the source code of this file.

Macros

#define BOTAN_CHECK_KEY_EXPENSIVE_TESTS   1
 
#define BOTAN_CIPHER_INIT_FLAG_DECRYPT   1
 
#define BOTAN_CIPHER_INIT_FLAG_ENCRYPT   0
 
#define BOTAN_CIPHER_INIT_FLAG_MASK_DIRECTION   1
 
#define BOTAN_CIPHER_UPDATE_FLAG_FINAL   (1U << 0)
 
#define BOTAN_FFI_HEX_LOWER_CASE   1
 
#define BOTAN_FPE_FLAG_FE1_COMPAT_MODE   1
 
#define BOTAN_PRIVKEY_EXPORT_FLAG_DER   0
 
#define BOTAN_PRIVKEY_EXPORT_FLAG_PEM   1
 

Typedefs

typedef struct botan_block_cipher_struct * botan_block_cipher_t
 
typedef struct botan_cipher_struct * botan_cipher_t
 
typedef struct botan_fpe_struct * botan_fpe_t
 
typedef struct botan_hash_struct * botan_hash_t
 
typedef struct botan_hotp_struct * botan_hotp_t
 
typedef struct botan_mac_struct * botan_mac_t
 
typedef struct botan_mp_struct * botan_mp_t
 
typedef struct botan_pk_op_decrypt_struct * botan_pk_op_decrypt_t
 
typedef struct botan_pk_op_encrypt_struct * botan_pk_op_encrypt_t
 
typedef struct botan_pk_op_ka_struct * botan_pk_op_ka_t
 
typedef struct botan_pk_op_sign_struct * botan_pk_op_sign_t
 
typedef struct botan_pk_op_verify_struct * botan_pk_op_verify_t
 
typedef struct botan_privkey_struct * botan_privkey_t
 
typedef struct botan_pubkey_struct * botan_pubkey_t
 
typedef struct botan_rng_struct * botan_rng_t
 
typedef struct botan_totp_struct * botan_totp_t
 
typedef struct botan_x509_cert_struct * botan_x509_cert_t
 

Enumerations

enum  BOTAN_FFI_ERROR {
  BOTAN_FFI_SUCCESS = 0, BOTAN_FFI_INVALID_VERIFIER = 1, BOTAN_FFI_ERROR_INVALID_INPUT = -1, BOTAN_FFI_ERROR_BAD_MAC = -2,
  BOTAN_FFI_ERROR_INSUFFICIENT_BUFFER_SPACE = -10, BOTAN_FFI_ERROR_EXCEPTION_THROWN = -20, BOTAN_FFI_ERROR_OUT_OF_MEMORY = -21, BOTAN_FFI_ERROR_SYSTEM_ERROR = -22,
  BOTAN_FFI_ERROR_INTERNAL_ERROR = -23, BOTAN_FFI_ERROR_BAD_FLAG = -30, BOTAN_FFI_ERROR_NULL_POINTER = -31, BOTAN_FFI_ERROR_BAD_PARAMETER = -32,
  BOTAN_FFI_ERROR_KEY_NOT_SET = -33, BOTAN_FFI_ERROR_INVALID_KEY_LENGTH = -34, BOTAN_FFI_ERROR_INVALID_OBJECT_STATE = -35, BOTAN_FFI_ERROR_NOT_IMPLEMENTED = -40,
  BOTAN_FFI_ERROR_INVALID_OBJECT = -50, BOTAN_FFI_ERROR_TLS_ERROR = -75, BOTAN_FFI_ERROR_HTTP_ERROR = -76, BOTAN_FFI_ERROR_UNKNOWN_ERROR = -100
}
 
enum  botan_x509_cert_key_constraints {
  NO_CONSTRAINTS = 0, DIGITAL_SIGNATURE = 32768, NON_REPUDIATION = 16384, KEY_ENCIPHERMENT = 8192,
  DATA_ENCIPHERMENT = 4096, KEY_AGREEMENT = 2048, KEY_CERT_SIGN = 1024, CRL_SIGN = 512,
  ENCIPHER_ONLY = 256, DECIPHER_ONLY = 128
}
 

Functions

int botan_fpe_decrypt (botan_fpe_t fpe, botan_mp_t x, const uint8_t tweak[], size_t tweak_len)
 
int botan_fpe_destroy (botan_fpe_t fpe)
 
int botan_fpe_encrypt (botan_fpe_t fpe, botan_mp_t x, const uint8_t tweak[], size_t tweak_len)
 
int botan_fpe_fe1_init (botan_fpe_t *fpe, botan_mp_t n, const uint8_t key[], size_t key_len, size_t rounds, uint32_t flags)
 
int botan_hotp_check (botan_hotp_t hotp, uint64_t *next_hotp_counter, uint32_t hotp_code, uint64_t hotp_counter, size_t resync_range)
 
int botan_hotp_destroy (botan_hotp_t hotp)
 
int botan_hotp_generate (botan_hotp_t hotp, uint32_t *hotp_code, uint64_t hotp_counter)
 
int botan_hotp_init (botan_hotp_t *hotp, const uint8_t key[], size_t key_len, const char *hash_algo, size_t digits)
 
int botan_key_unwrap3394 (const uint8_t wrapped_key[], size_t wrapped_key_len, const uint8_t kek[], size_t kek_len, uint8_t key[], size_t *key_len)
 
int botan_key_wrap3394 (const uint8_t key[], size_t key_len, const uint8_t kek[], size_t kek_len, uint8_t wrapped_key[], size_t *wrapped_key_len)
 
int botan_pk_op_key_agreement (botan_pk_op_ka_t op, uint8_t out[], size_t *out_len, const uint8_t other_key[], size_t other_key_len, const uint8_t salt[], size_t salt_len)
 
int botan_pk_op_key_agreement_create (botan_pk_op_ka_t *op, botan_privkey_t key, const char *kdf, uint32_t flags)
 
int botan_pk_op_sign_create (botan_pk_op_sign_t *op, botan_privkey_t key, const char *hash_and_padding, uint32_t flags)
 
int botan_pk_op_sign_finish (botan_pk_op_sign_t op, botan_rng_t rng, uint8_t sig[], size_t *sig_len)
 
int botan_pk_op_verify_create (botan_pk_op_verify_t *op, botan_pubkey_t key, const char *hash_and_padding, uint32_t flags)
 
int botan_privkey_load_ecdh (botan_privkey_t *key, const botan_mp_t scalar, const char *curve_name)
 
int botan_privkey_load_ecdsa (botan_privkey_t *key, const botan_mp_t scalar, const char *curve_name)
 
int botan_privkey_load_sm2 (botan_privkey_t *key, const botan_mp_t scalar, const char *curve_name)
 
int botan_pubkey_load_ecdh (botan_pubkey_t *key, const botan_mp_t public_x, const botan_mp_t public_y, const char *curve_name)
 
int botan_pubkey_load_ecdsa (botan_pubkey_t *key, const botan_mp_t public_x, const botan_mp_t public_y, const char *curve_name)
 
int botan_pubkey_load_sm2 (botan_pubkey_t *key, const botan_mp_t public_x, const botan_mp_t public_y, const char *curve_name)
 
int botan_pubkey_sm2_compute_za (uint8_t out[], size_t *out_len, const char *ident, const char *hash_algo, const botan_pubkey_t key)
 
 BOTAN_PUBLIC_API (2, 8) const char *botan_error_description(int err)
 
 BOTAN_PUBLIC_API (2, 0) uint32_t botan_ffi_api_version(void)
 
 BOTAN_PUBLIC_API (2, 3) int botan_constant_time_compare(const uint8_t *x
 
 BOTAN_PUBLIC_API (2, 2) int botan_scrub_mem(void *mem
 
 BOTAN_PUBLIC_API (2, 1) int botan_block_cipher_init(botan_block_cipher_t *bc
 
 BOTAN_PUBLIC_API (2, 5) int botan_privkey_create_dsa(botan_privkey_t *key
 
int botan_totp_check (botan_totp_t totp, uint32_t totp_code, uint64_t timestamp, size_t acceptable_clock_drift)
 
int botan_totp_destroy (botan_totp_t totp)
 
int botan_totp_generate (botan_totp_t totp, uint32_t *totp_code, uint64_t timestamp)
 
int botan_totp_init (botan_totp_t *totp, const uint8_t key[], size_t key_len, const char *hash_algo, size_t digits, size_t time_step)
 
int botan_x509_cert_get_issuer_dn (botan_x509_cert_t cert, const char *key, size_t index, uint8_t out[], size_t *out_len)
 
int botan_x509_cert_get_subject_dn (botan_x509_cert_t cert, const char *key, size_t index, uint8_t out[], size_t *out_len)
 

Variables

const uint8_t * ad
 
const uint8_t size_t ad_len
 
botan_rng_t const char * aead
 
const char * algo_name
 
const char const char * algo_params
 
uint8_t base
 
size_t bit
 
size_t bits
 
size_t * block_size
 
const uint8_t uint8_t size_t blocks
 
const uint8_t * buf
 
size_t bytes
 
const uint8_t cert []
 
const uint8_t size_t cert_len
 
uint8_t size_t botan_rng_t const char uint32_t size_t const char * cipher_algo
 
const char * cipher_name
 
uint8_t size_t const uint8_t ciphertext []
 
uint8_t size_t const uint8_t size_t ciphertext_len
 
botan_rng_t const char const uint8_t size_t const uint8_t size_t uint8_t ct []
 
botan_rng_t const char const uint8_t size_t const uint8_t size_t uint8_t size_t * ct_len
 
size_t size_t * ctext_len
 
const botan_mp_t const botan_mp_t const char * curve_name
 
botan_mp_t botan_mp_t botan_mp_t e
 
uint8_t size_t botan_rng_t const char const char * encryption_algo
 
const uint8_t * entropy
 
const uint8_t size_t entropy_len
 
size_t * estimate
 
const botan_mp_t const botan_mp_t exponent
 
botan_pubkey_t const char * field_name
 
const char * filename
 
size_t char uint32_t flags
 
botan_mp_t botan_mp_t botan_mp_t g
 
const char * hash
 
const char * hash_name
 
const char * hostname
 
const uint8_t * in
 
size_t in_len
 
int initial_value
 
uint32_t uint8_t size_t size_t const uint8_t input_bytes []
 
uint32_t uint8_t size_t size_t const uint8_t size_t size_t * input_consumed
 
uint32_t uint8_t size_t size_t const uint8_t size_t input_size
 
botan_x509_cert_t const botan_x509_cert_tintermediates
 
botan_x509_cert_t const botan_x509_cert_t size_t intermediates_len
 
uint8_t size_t const char const uint8_t size_t size_t iterations
 
const uint8_t * key
 
const uint8_t size_t key_len
 
unsigned int key_usage
 
uint8_t size_t const uint8_t size_t const uint8_t size_t const uint8_t label []
 
uint8_t size_t const uint8_t size_t const uint8_t size_t const uint8_t size_t label_len
 
const uint8_t size_t len
 
botan_rng_t const botan_mp_t lower_bound
 
const char * mac_name
 
size_t size_t * max_keylen
 
uint8_t size_t const char const uint8_t size_t size_t milliseconds_to_run
 
size_t * min_keylen
 
const botan_mp_t const botan_mp_t const botan_mp_t mod
 
size_t size_t size_t * mod_keylen
 
const botan_mp_t const botan_mp_t const botan_mp_t modulus
 
int uint32_t msec
 
size_t const char const uint8_t size_t size_t N
 
botan_rng_t size_t n
 
botan_rng_t size_t n_bits
 
char * name
 
char size_t * name_len
 
size_t nl
 
const uint8_t * nonce
 
const uint8_t size_t nonce_len
 
size_t * olen
 
size_t char * out
 
uint8_t size_t const char const uint8_t size_t size_t size_t * out_iterations_used
 
size_t size_t size_t * out_keylength_modulo
 
size_t uint8_t size_t * out_len
 
size_t size_t * out_maximum_keylength
 
size_t * out_minimum_keylength
 
uint32_t uint8_t output []
 
size_t * output_length
 
uint32_t uint8_t size_t output_size
 
uint32_t uint8_t size_t size_t * output_written
 
size_t const char const uint8_t size_t size_t size_t size_t p
 
botan_pubkey_t const char * padding
 
botan_rng_t const char * param
 
int size_t param1
 
int size_t size_t param2
 
int size_t size_t size_t param3
 
botan_rng_t const char * params
 
uint8_t size_t const char * passphrase
 
int size_t size_t size_t uint8_t size_t const char size_t passphrase_len
 
size_t const char * password
 
botan_rng_t size_t pbits
 
uint8_t size_t botan_rng_t const char uint32_t size_t const char const char * pbkdf_algo
 
uint8_t size_t botan_rng_t const char size_t pbkdf_iterations
 
uint8_t size_t botan_rng_t const char uint32_t size_t * pbkdf_iterations_out
 
uint8_t size_t botan_rng_t const char uint32_t pbkdf_msec_runtime
 
uint8_t pkcs_id []
 
uint8_t size_t * pkcs_id_len
 
botan_rng_t uint8_t size_t const uint8_t plaintext []
 
botan_rng_t uint8_t size_t const uint8_t size_t plaintext_len
 
const uint8_t privkey [32]
 
botan_rng_t const char const uint8_t pt []
 
botan_rng_t const char const uint8_t size_t pt_len
 
size_t ptext_len
 
const uint8_t pubkey [32]
 
const botan_mp_t public_x
 
const botan_mp_t const botan_mp_t public_y
 
botan_mp_t botan_mp_t q
 
botan_rng_t size_t size_t qbits
 
size_t const char const uint8_t size_t size_t size_t r
 
const char size_t radix
 
botan_x509_cert_t const botan_x509_cert_t size_t const botan_x509_cert_t size_t const char size_t const char uint64_t reference_time
 
botan_mp_t remainder
 
botan_x509_cert_t const botan_x509_cert_t size_t const botan_x509_cert_t size_t const char size_t required_strength
 
botan_rng_t rng
 
const char * rng_type
 
botan_privkey_t rsa_key
 
uint8_t size_t const char const uint8_t salt []
 
uint8_t size_t const char const uint8_t size_t salt_len
 
const botan_mp_t scalar
 
uint8_t size_t const uint8_t secret []
 
uint8_t size_t const uint8_t size_t secret_len
 
const botan_mp_t size_t shift
 
const uint8_t sig []
 
const uint8_t size_t sig_len
 
const botan_hash_t source
 
botan_rng_t source_rng
 
const char * str
 
botan_rng_t size_t size_t t
 
size_t * tag_size
 
botan_rng_t size_t test_prob
 
uint64_t * time_since_epoch
 
botan_x509_cert_t const botan_x509_cert_t size_t const botan_x509_cert_ttrusted
 
botan_x509_cert_t const botan_x509_cert_t size_t const botan_x509_cert_t size_t trusted_len
 
botan_x509_cert_t const botan_x509_cert_t size_t const botan_x509_cert_t size_t const char * trusted_path
 
size_t * ug
 
botan_rng_t const botan_mp_t const botan_mp_t upper_bound
 
uint32_t * val
 
uint8_t vec []
 
const uint8_t size_t vec_len
 
size_t const char botan_rng_t size_t work_factor
 
const botan_mp_t x
 
const uint8_t * y
 

Macro Definition Documentation

◆ BOTAN_CHECK_KEY_EXPENSIVE_TESTS

#define BOTAN_CHECK_KEY_EXPENSIVE_TESTS   1

Definition at line 944 of file ffi.h.

◆ BOTAN_CIPHER_INIT_FLAG_DECRYPT

#define BOTAN_CIPHER_INIT_FLAG_DECRYPT   1

Definition at line 425 of file ffi.h.

◆ BOTAN_CIPHER_INIT_FLAG_ENCRYPT

#define BOTAN_CIPHER_INIT_FLAG_ENCRYPT   0

Definition at line 424 of file ffi.h.

◆ BOTAN_CIPHER_INIT_FLAG_MASK_DIRECTION

#define BOTAN_CIPHER_INIT_FLAG_MASK_DIRECTION   1

Definition at line 423 of file ffi.h.

◆ BOTAN_CIPHER_UPDATE_FLAG_FINAL

#define BOTAN_CIPHER_UPDATE_FLAG_FINAL   (1U << 0)

Definition at line 506 of file ffi.h.

◆ BOTAN_FFI_HEX_LOWER_CASE

#define BOTAN_FFI_HEX_LOWER_CASE   1

Definition at line 152 of file ffi.h.

◆ BOTAN_FPE_FLAG_FE1_COMPAT_MODE

#define BOTAN_FPE_FLAG_FE1_COMPAT_MODE   1

Definition at line 1680 of file ffi.h.

◆ BOTAN_PRIVKEY_EXPORT_FLAG_DER

#define BOTAN_PRIVKEY_EXPORT_FLAG_DER   0

Definition at line 1023 of file ffi.h.

◆ BOTAN_PRIVKEY_EXPORT_FLAG_PEM

#define BOTAN_PRIVKEY_EXPORT_FLAG_PEM   1

Definition at line 1024 of file ffi.h.

Typedef Documentation

◆ botan_block_cipher_t

typedef struct botan_block_cipher_struct* botan_block_cipher_t

Definition at line 655 of file ffi.h.

◆ botan_cipher_t

typedef struct botan_cipher_struct* botan_cipher_t

Definition at line 421 of file ffi.h.

◆ botan_fpe_t

typedef struct botan_fpe_struct* botan_fpe_t

Format Preserving Encryption

Definition at line 1678 of file ffi.h.

◆ botan_hash_t

typedef struct botan_hash_struct* botan_hash_t

Definition at line 255 of file ffi.h.

◆ botan_hotp_t

typedef struct botan_hotp_struct* botan_hotp_t

HOTP

Definition at line 1588 of file ffi.h.

◆ botan_mac_t

typedef struct botan_mac_struct* botan_mac_t

Definition at line 335 of file ffi.h.

◆ botan_mp_t

typedef struct botan_mp_struct* botan_mp_t

Definition at line 728 of file ffi.h.

◆ botan_pk_op_decrypt_t

typedef struct botan_pk_op_decrypt_struct* botan_pk_op_decrypt_t

Definition at line 1364 of file ffi.h.

◆ botan_pk_op_encrypt_t

typedef struct botan_pk_op_encrypt_struct* botan_pk_op_encrypt_t

Definition at line 1338 of file ffi.h.

◆ botan_pk_op_ka_t

typedef struct botan_pk_op_ka_struct* botan_pk_op_ka_t

Definition at line 1430 of file ffi.h.

◆ botan_pk_op_sign_t

typedef struct botan_pk_op_sign_struct* botan_pk_op_sign_t

Definition at line 1387 of file ffi.h.

◆ botan_pk_op_verify_t

typedef struct botan_pk_op_verify_struct* botan_pk_op_verify_t

Definition at line 1411 of file ffi.h.

◆ botan_privkey_t

typedef struct botan_privkey_struct* botan_privkey_t

Definition at line 929 of file ffi.h.

◆ botan_pubkey_t

typedef struct botan_pubkey_struct* botan_pubkey_t

Definition at line 1076 of file ffi.h.

◆ botan_rng_t

typedef struct botan_rng_struct* botan_rng_t

RNG type

Definition at line 188 of file ffi.h.

◆ botan_totp_t

typedef struct botan_totp_struct* botan_totp_t

TOTP

Definition at line 1629 of file ffi.h.

◆ botan_x509_cert_t

typedef struct botan_x509_cert_struct* botan_x509_cert_t

Definition at line 1481 of file ffi.h.

Enumeration Type Documentation

◆ BOTAN_FFI_ERROR

Error codes

If you add a new value here be sure to also add it in botan_error_description

Enumerator
BOTAN_FFI_SUCCESS 
BOTAN_FFI_INVALID_VERIFIER 
BOTAN_FFI_ERROR_INVALID_INPUT 
BOTAN_FFI_ERROR_BAD_MAC 
BOTAN_FFI_ERROR_INSUFFICIENT_BUFFER_SPACE 
BOTAN_FFI_ERROR_EXCEPTION_THROWN 
BOTAN_FFI_ERROR_OUT_OF_MEMORY 
BOTAN_FFI_ERROR_SYSTEM_ERROR 
BOTAN_FFI_ERROR_INTERNAL_ERROR 
BOTAN_FFI_ERROR_BAD_FLAG 
BOTAN_FFI_ERROR_NULL_POINTER 
BOTAN_FFI_ERROR_BAD_PARAMETER 
BOTAN_FFI_ERROR_KEY_NOT_SET 
BOTAN_FFI_ERROR_INVALID_KEY_LENGTH 
BOTAN_FFI_ERROR_INVALID_OBJECT_STATE 
BOTAN_FFI_ERROR_NOT_IMPLEMENTED 
BOTAN_FFI_ERROR_INVALID_OBJECT 
BOTAN_FFI_ERROR_TLS_ERROR 
BOTAN_FFI_ERROR_HTTP_ERROR 
BOTAN_FFI_ERROR_UNKNOWN_ERROR 

Definition at line 61 of file ffi.h.

61  {
64 
67 
69 
74 
81 
84 
87 
89 };

◆ botan_x509_cert_key_constraints

Enumerator
NO_CONSTRAINTS 
DIGITAL_SIGNATURE 
NON_REPUDIATION 
KEY_ENCIPHERMENT 
DATA_ENCIPHERMENT 
KEY_AGREEMENT 
KEY_CERT_SIGN 
CRL_SIGN 
ENCIPHER_ONLY 
DECIPHER_ONLY 

Definition at line 1524 of file ffi.h.

1524  {
1525  NO_CONSTRAINTS = 0,
1526  DIGITAL_SIGNATURE = 32768,
1527  NON_REPUDIATION = 16384,
1528  KEY_ENCIPHERMENT = 8192,
1529  DATA_ENCIPHERMENT = 4096,
1530  KEY_AGREEMENT = 2048,
1531  KEY_CERT_SIGN = 1024,
1532  CRL_SIGN = 512,
1533  ENCIPHER_ONLY = 256,
1534  DECIPHER_ONLY = 128
1535 };
Definition: ffi.h:1532

Function Documentation

◆ botan_fpe_decrypt()

int botan_fpe_decrypt ( botan_fpe_t  fpe,
botan_mp_t  x,
const uint8_t  tweak[],
size_t  tweak_len 
)

Definition at line 80 of file ffi_fpe.cpp.

81  {
82 #if defined(BOTAN_HAS_FPE_FE1)
83  return ffi_guard_thunk(__func__, [=]() {
84  Botan::BigInt r = safe_get(fpe).decrypt(safe_get(x), tweak, tweak_len);
85  safe_get(x) = r;
86  return BOTAN_FFI_SUCCESS;
87  });
88 
89 #else
91 #endif
92  }
int ffi_guard_thunk(const char *func_name, std::function< int()> thunk)
Definition: ffi.cpp:86
size_t const char const uint8_t size_t size_t size_t r
Definition: ffi.h:628
const botan_mp_t x
Definition: ffi.h:823
BigInt const BigInt const SymmetricKey const std::vector< uint8_t > & tweak
Definition: fpe_fe1.h:101
T & safe_get(botan_struct< T, M > *p)
Definition: ffi_util.h:61

References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_SUCCESS, Botan_FFI::ffi_guard_thunk(), r, Botan_FFI::safe_get(), Botan::FPE::tweak, and x.

◆ botan_fpe_destroy()

int botan_fpe_destroy ( botan_fpe_t  fpe)
Returns
0 if success, error if invalid object handle

Definition at line 58 of file ffi_fpe.cpp.

59  {
60 #if defined(BOTAN_HAS_FPE_FE1)
61  return BOTAN_FFI_CHECKED_DELETE(fpe);
62 #else
64 #endif
65  }
#define BOTAN_FFI_CHECKED_DELETE(o)
Definition: ffi_util.h:120

References BOTAN_FFI_CHECKED_DELETE, and BOTAN_FFI_ERROR_NOT_IMPLEMENTED.

◆ botan_fpe_encrypt()

int botan_fpe_encrypt ( botan_fpe_t  fpe,
botan_mp_t  x,
const uint8_t  tweak[],
size_t  tweak_len 
)

Definition at line 67 of file ffi_fpe.cpp.

68  {
69 #if defined(BOTAN_HAS_FPE_FE1)
70  return ffi_guard_thunk(__func__, [=]() {
71  Botan::BigInt r = safe_get(fpe).encrypt(safe_get(x), tweak, tweak_len);
72  safe_get(x) = r;
73  return BOTAN_FFI_SUCCESS;
74  });
75 #else
77 #endif
78  }
int ffi_guard_thunk(const char *func_name, std::function< int()> thunk)
Definition: ffi.cpp:86
size_t const char const uint8_t size_t size_t size_t r
Definition: ffi.h:628
const botan_mp_t x
Definition: ffi.h:823
BigInt const BigInt const SymmetricKey const std::vector< uint8_t > & tweak
Definition: fpe_fe1.h:101
T & safe_get(botan_struct< T, M > *p)
Definition: ffi_util.h:61

References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_SUCCESS, Botan_FFI::ffi_guard_thunk(), r, Botan_FFI::safe_get(), Botan::FPE::tweak, and x.

◆ botan_fpe_fe1_init()

int botan_fpe_fe1_init ( botan_fpe_t fpe,
botan_mp_t  n,
const uint8_t  key[],
size_t  key_len,
size_t  rounds,
uint32_t  flags 
)

Definition at line 26 of file ffi_fpe.cpp.

29  {
30 #if defined(BOTAN_HAS_FPE_FE1)
31 
32  return ffi_guard_thunk(__func__, [=]() {
33 
34  if(fpe == nullptr || key == nullptr)
36 
37  *fpe = nullptr;
38 
41 
42  const bool compat_mode = (flags & BOTAN_FPE_FLAG_FE1_COMPAT_MODE);
43 
44  std::unique_ptr<Botan::FPE_FE1> fpe_obj(
45  new Botan::FPE_FE1(safe_get(n), rounds, compat_mode));
46 
47  fpe_obj->set_key(key, key_len);
48 
49  *fpe = new botan_fpe_struct(fpe_obj.release());
50  return BOTAN_FFI_SUCCESS;
51  });
52 #else
53  *fpe = nullptr;
55 #endif
56  }
int ffi_guard_thunk(const char *func_name, std::function< int()> thunk)
Definition: ffi.cpp:86
botan_rng_t size_t n
Definition: ffi.h:955
#define BOTAN_FPE_FLAG_FE1_COMPAT_MODE
Definition: ffi.h:1680
const uint8_t * key
Definition: ffi.h:362
T & safe_get(botan_struct< T, M > *p)
Definition: ffi_util.h:61
size_t char uint32_t flags
Definition: ffi.h:162
const uint8_t size_t key_len
Definition: ffi.h:362

References BOTAN_FFI_ERROR_BAD_FLAG, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_FPE_FLAG_FE1_COMPAT_MODE, Botan_FFI::ffi_guard_thunk(), flags, key, key_len, n, and Botan_FFI::safe_get().

◆ botan_hotp_check()

int botan_hotp_check ( botan_hotp_t  hotp,
uint64_t *  next_hotp_counter,
uint32_t  hotp_code,
uint64_t  hotp_counter,
size_t  resync_range 
)

Verify a HOTP code

Definition at line 76 of file ffi_hotp.cpp.

81  {
82 #if defined(BOTAN_HAS_HOTP)
83  return BOTAN_FFI_DO(Botan::HOTP, hotp, h, {
84 
85  auto resp = h.verify_hotp(hotp_code, hotp_counter, resync_range);
86 
87  if(next_hotp_counter)
88  *next_hotp_counter = resp.second;
89 
90  return (resp.first == true) ? BOTAN_FFI_SUCCESS : BOTAN_FFI_INVALID_VERIFIER;
91  });
92 
93 #else
94  BOTAN_UNUSED(hotp, next_hotp_counter, hotp_code, hotp_counter, resync_range);
96 #endif
97  }
BigInt const BigInt const BigInt & h
Definition: rfc6979.h:47
#define BOTAN_UNUSED(...)
Definition: assert.h:142
#define BOTAN_FFI_DO(T, obj, param, block)
Definition: ffi_util.h:92

References BOTAN_FFI_DO, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_INVALID_VERIFIER, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, and Botan::h.

◆ botan_hotp_destroy()

int botan_hotp_destroy ( botan_hotp_t  hotp)

Destroy a HOTP instance

Returns
0 if success, error if invalid object handle

Definition at line 48 of file ffi_hotp.cpp.

49  {
50 #if defined(BOTAN_HAS_HOTP)
51  return BOTAN_FFI_CHECKED_DELETE(hotp);
52 #else
53  BOTAN_UNUSED(hotp);
55 #endif
56  }
#define BOTAN_FFI_CHECKED_DELETE(o)
Definition: ffi_util.h:120
#define BOTAN_UNUSED(...)
Definition: assert.h:142

References BOTAN_FFI_CHECKED_DELETE, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, and BOTAN_UNUSED.

◆ botan_hotp_generate()

int botan_hotp_generate ( botan_hotp_t  hotp,
uint32_t *  hotp_code,
uint64_t  hotp_counter 
)

Generate a HOTP code for the provided counter

Definition at line 58 of file ffi_hotp.cpp.

61  {
62 #if defined(BOTAN_HAS_HOTP)
63  if(hotp == nullptr || hotp_code == nullptr)
65 
66  return BOTAN_FFI_DO(Botan::HOTP, hotp, h, {
67  *hotp_code = h.generate_hotp(hotp_counter);
68  });
69 
70 #else
71  BOTAN_UNUSED(hotp, hotp_code, hotp_counter);
73 #endif
74  }
BigInt const BigInt const BigInt & h
Definition: rfc6979.h:47
#define BOTAN_UNUSED(...)
Definition: assert.h:142
#define BOTAN_FFI_DO(T, obj, param, block)
Definition: ffi_util.h:92

References BOTAN_FFI_DO, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, and Botan::h.

◆ botan_hotp_init()

int botan_hotp_init ( botan_hotp_t hotp,
const uint8_t  key[],
size_t  key_len,
const char *  hash_algo,
size_t  digits 
)

Initialize a HOTP instance

Definition at line 24 of file ffi_hotp.cpp.

28  {
29  if(hotp == nullptr || key == nullptr || hash_algo == nullptr)
31 
32  *hotp = nullptr;
33 
34 #if defined(BOTAN_HAS_HOTP)
35  return ffi_guard_thunk(__func__, [=]() -> int {
36 
37  *hotp = new botan_hotp_struct(
38  new Botan::HOTP(key, key_len, hash_algo, digits));
39 
40  return BOTAN_FFI_SUCCESS;
41  });
42 #else
43  BOTAN_UNUSED(hotp, key, key_len, hash_algo, digits);
45 #endif
46  }
int ffi_guard_thunk(const char *func_name, std::function< int()> thunk)
Definition: ffi.cpp:86
#define BOTAN_UNUSED(...)
Definition: assert.h:142
const uint8_t * key
Definition: ffi.h:362
AlgorithmIdentifier hash_algo
Definition: x509_obj.cpp:23
const uint8_t size_t key_len
Definition: ffi.h:362

References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), hash_algo, key, and key_len.

◆ botan_key_unwrap3394()

int botan_key_unwrap3394 ( const uint8_t  wrapped_key[],
size_t  wrapped_key_len,
const uint8_t  kek[],
size_t  kek_len,
uint8_t  key[],
size_t *  key_len 
)

Definition at line 34 of file ffi_keywrap.cpp.

37  {
38 #if defined(BOTAN_HAS_RFC3394_KEYWRAP)
39  return ffi_guard_thunk(__func__, [=]() -> int {
40  const Botan::SymmetricKey kek_sym(kek, kek_len);
41  const Botan::secure_vector<uint8_t> key_ct(wrapped_key, wrapped_key + wrapped_key_len);
42  const Botan::secure_vector<uint8_t> key_pt = Botan::rfc3394_keyunwrap(key_ct, kek_sym);
43  return write_vec_output(key, key_len, key_pt);
44  });
45 #else
47 #endif
48  }
int ffi_guard_thunk(const char *func_name, std::function< int()> thunk)
Definition: ffi.cpp:86
secure_vector< uint8_t > rfc3394_keyunwrap(const secure_vector< uint8_t > &key, const SymmetricKey &kek)
Definition: rfc3394.cpp:28
int write_vec_output(uint8_t out[], size_t *out_len, const std::vector< uint8_t, Alloc > &buf)
Definition: ffi_util.h:146
OctetString SymmetricKey
Definition: symkey.h:141
const uint8_t * key
Definition: ffi.h:362
std::vector< T, secure_allocator< T > > secure_vector
Definition: secmem.h:65
secure_vector< uint8_t > const SymmetricKey & kek
Definition: rfc3394.h:24
const uint8_t size_t key_len
Definition: ffi.h:362

References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, Botan_FFI::ffi_guard_thunk(), Botan::kek, key, key_len, Botan::rfc3394_keyunwrap(), and Botan_FFI::write_vec_output().

◆ botan_key_wrap3394()

int botan_key_wrap3394 ( const uint8_t  key[],
size_t  key_len,
const uint8_t  kek[],
size_t  kek_len,
uint8_t  wrapped_key[],
size_t *  wrapped_key_len 
)

Key wrapping as per RFC 3394

Definition at line 18 of file ffi_keywrap.cpp.

21  {
22 #if defined(BOTAN_HAS_RFC3394_KEYWRAP)
23  return ffi_guard_thunk(__func__, [=]() -> int {
24  const Botan::SymmetricKey kek_sym(kek, kek_len);
26  const Botan::secure_vector<uint8_t> key_ct = Botan::rfc3394_keywrap(key_pt, kek_sym);
27  return write_vec_output(wrapped_key, wrapped_key_len, key_ct);
28  });
29 #else
31 #endif
32  }
int ffi_guard_thunk(const char *func_name, std::function< int()> thunk)
Definition: ffi.cpp:86
secure_vector< uint8_t > rfc3394_keywrap(const secure_vector< uint8_t > &key, const SymmetricKey &kek)
Definition: rfc3394.cpp:14
int write_vec_output(uint8_t out[], size_t *out_len, const std::vector< uint8_t, Alloc > &buf)
Definition: ffi_util.h:146
OctetString SymmetricKey
Definition: symkey.h:141
const uint8_t * key
Definition: ffi.h:362
std::vector< T, secure_allocator< T > > secure_vector
Definition: secmem.h:65
secure_vector< uint8_t > const SymmetricKey & kek
Definition: rfc3394.h:24
const uint8_t size_t key_len
Definition: ffi.h:362

References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, Botan_FFI::ffi_guard_thunk(), Botan::kek, key, key_len, Botan::rfc3394_keywrap(), and Botan_FFI::write_vec_output().

◆ botan_pk_op_key_agreement()

int botan_pk_op_key_agreement ( botan_pk_op_ka_t  op,
uint8_t  out[],
size_t *  out_len,
const uint8_t  other_key[],
size_t  other_key_len,
const uint8_t  salt[],
size_t  salt_len 
)

Definition at line 241 of file ffi_pk_op.cpp.

245  {
246  return BOTAN_FFI_DO(Botan::PK_Key_Agreement, op, o, {
247  auto k = o.derive_key(*out_len, other_key, other_key_len, salt, salt_len).bits_of();
248  return write_vec_output(out, out_len, k);
249  });
250  }
int write_vec_output(uint8_t out[], size_t *out_len, const std::vector< uint8_t, Alloc > &buf)
Definition: ffi_util.h:146
size_t char * out
Definition: ffi.h:162
uint8_t size_t const char const uint8_t size_t salt_len
Definition: ffi.h:543
size_t uint8_t size_t * out_len
Definition: ffi.h:171
uint8_t size_t const char const uint8_t salt[]
Definition: ffi.h:543
#define BOTAN_FFI_DO(T, obj, param, block)
Definition: ffi_util.h:92

References BOTAN_FFI_DO, out, out_len, salt, salt_len, and Botan_FFI::write_vec_output().

◆ botan_pk_op_key_agreement_create()

int botan_pk_op_key_agreement_create ( botan_pk_op_ka_t op,
botan_privkey_t  key,
const char *  kdf,
uint32_t  flags 
)

Definition at line 198 of file ffi_pk_op.cpp.

202  {
203  if(op == nullptr)
205 
206  if(flags != 0)
208 
209  return ffi_guard_thunk(__func__, [=]() -> int {
210  *op = nullptr;
211  std::unique_ptr<Botan::PK_Key_Agreement> pk(new Botan::PK_Key_Agreement(safe_get(key_obj), Botan::system_rng(), kdf));
212  *op = new botan_pk_op_ka_struct(pk.release());
213  return BOTAN_FFI_SUCCESS;
214  });
215  }
int ffi_guard_thunk(const char *func_name, std::function< int()> thunk)
Definition: ffi.cpp:86
T & safe_get(botan_struct< T, M > *p)
Definition: ffi_util.h:61
size_t char uint32_t flags
Definition: ffi.h:162
RandomNumberGenerator & system_rng()
Definition: system_rng.cpp:279

References BOTAN_FFI_ERROR_BAD_FLAG, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, Botan_FFI::ffi_guard_thunk(), flags, Botan_FFI::safe_get(), and Botan::system_rng().

◆ botan_pk_op_sign_create()

int botan_pk_op_sign_create ( botan_pk_op_sign_t op,
botan_privkey_t  key,
const char *  hash_and_padding,
uint32_t  flags 
)

Definition at line 112 of file ffi_pk_op.cpp.

116  {
117  if(op == nullptr)
119 
120  if(flags != 0)
122 
123  return ffi_guard_thunk(__func__, [=]() -> int {
124  *op = nullptr;
125 
126  std::unique_ptr<Botan::PK_Signer> pk(new Botan::PK_Signer(safe_get(key_obj), Botan::system_rng(), hash));
127  *op = new botan_pk_op_sign_struct(pk.release());
128  return BOTAN_FFI_SUCCESS;
129  });
130  }
int ffi_guard_thunk(const char *func_name, std::function< int()> thunk)
Definition: ffi.cpp:86
const char * hash
Definition: ffi.h:924
T & safe_get(botan_struct< T, M > *p)
Definition: ffi_util.h:61
size_t char uint32_t flags
Definition: ffi.h:162
RandomNumberGenerator & system_rng()
Definition: system_rng.cpp:279

References BOTAN_FFI_ERROR_BAD_FLAG, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, Botan_FFI::ffi_guard_thunk(), flags, hash, Botan_FFI::safe_get(), and Botan::system_rng().

◆ botan_pk_op_sign_finish()

int botan_pk_op_sign_finish ( botan_pk_op_sign_t  op,
botan_rng_t  rng,
uint8_t  sig[],
size_t *  sig_len 
)

Definition at line 150 of file ffi_pk_op.cpp.

151  {
152  return BOTAN_FFI_DO(Botan::PK_Signer, op, o, {
153  return write_vec_output(out, out_len, o.signature(safe_get(rng_obj)));
154  });
155  }
int write_vec_output(uint8_t out[], size_t *out_len, const std::vector< uint8_t, Alloc > &buf)
Definition: ffi_util.h:146
size_t char * out
Definition: ffi.h:162
size_t uint8_t size_t * out_len
Definition: ffi.h:171
T & safe_get(botan_struct< T, M > *p)
Definition: ffi_util.h:61
#define BOTAN_FFI_DO(T, obj, param, block)
Definition: ffi_util.h:92

References BOTAN_FFI_DO, out, out_len, Botan_FFI::safe_get(), and Botan_FFI::write_vec_output().

◆ botan_pk_op_verify_create()

int botan_pk_op_verify_create ( botan_pk_op_verify_t op,
botan_pubkey_t  key,
const char *  hash_and_padding,
uint32_t  flags 
)

Definition at line 157 of file ffi_pk_op.cpp.

161  {
162  if(op == nullptr)
164 
165  if(flags != 0)
167 
168  return ffi_guard_thunk(__func__, [=]() -> int {
169  *op = nullptr;
170  std::unique_ptr<Botan::PK_Verifier> pk(new Botan::PK_Verifier(safe_get(key_obj), hash));
171  *op = new botan_pk_op_verify_struct(pk.release());
172  return BOTAN_FFI_SUCCESS;
173  });
174  }
int ffi_guard_thunk(const char *func_name, std::function< int()> thunk)
Definition: ffi.cpp:86
const char * hash
Definition: ffi.h:924
T & safe_get(botan_struct< T, M > *p)
Definition: ffi_util.h:61
size_t char uint32_t flags
Definition: ffi.h:162

References BOTAN_FFI_ERROR_BAD_FLAG, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, Botan_FFI::ffi_guard_thunk(), flags, hash, and Botan_FFI::safe_get().

◆ botan_privkey_load_ecdh()

int botan_privkey_load_ecdh ( botan_privkey_t key,
const botan_mp_t  scalar,
const char *  curve_name 
)

Definition at line 653 of file ffi_pkey_algs.cpp.

656  {
657 #if defined(BOTAN_HAS_ECDH)
658  return ffi_guard_thunk(__func__, [=]() -> int {
659  std::unique_ptr<Botan::ECDH_PrivateKey> p_key;
660  int rc = privkey_load_ec(p_key, safe_get(scalar), curve_name);
661  if(rc == BOTAN_FFI_SUCCESS)
662  *key = new botan_privkey_struct(p_key.release());
663  return rc;
664  });
665 #else
668 #endif
669  }
int ffi_guard_thunk(const char *func_name, std::function< int()> thunk)
Definition: ffi.cpp:86
const botan_mp_t scalar
Definition: ffi.h:1325
#define BOTAN_UNUSED(...)
Definition: assert.h:142
const uint8_t * key
Definition: ffi.h:362
T & safe_get(botan_struct< T, M > *p)
Definition: ffi_util.h:61
const botan_mp_t const botan_mp_t const char * curve_name
Definition: ffi.h:1319

References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, curve_name, Botan_FFI::ffi_guard_thunk(), key, Botan_FFI::safe_get(), and scalar.

◆ botan_privkey_load_ecdsa()

int botan_privkey_load_ecdsa ( botan_privkey_t key,
const botan_mp_t  scalar,
const char *  curve_name 
)

Definition at line 496 of file ffi_pkey_algs.cpp.

499  {
500 #if defined(BOTAN_HAS_ECDSA)
501  return ffi_guard_thunk(__func__, [=]() -> int {
502  std::unique_ptr<Botan::ECDSA_PrivateKey> p_key;
503  int rc = privkey_load_ec(p_key, safe_get(scalar), curve_name);
504  if(rc == BOTAN_FFI_SUCCESS)
505  *key = new botan_privkey_struct(p_key.release());
506  return rc;
507  });
508 #else
511 #endif
512  }
int ffi_guard_thunk(const char *func_name, std::function< int()> thunk)
Definition: ffi.cpp:86
const botan_mp_t scalar
Definition: ffi.h:1325
#define BOTAN_UNUSED(...)
Definition: assert.h:142
const uint8_t * key
Definition: ffi.h:362
T & safe_get(botan_struct< T, M > *p)
Definition: ffi_util.h:61
const botan_mp_t const botan_mp_t const char * curve_name
Definition: ffi.h:1319

References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, curve_name, Botan_FFI::ffi_guard_thunk(), key, Botan_FFI::safe_get(), and scalar.

◆ botan_privkey_load_sm2()

int botan_privkey_load_sm2 ( botan_privkey_t key,
const botan_mp_t  scalar,
const char *  curve_name 
)

Definition at line 730 of file ffi_pkey_algs.cpp.

733  {
734 #if defined(BOTAN_HAS_SM2)
735  return ffi_guard_thunk(__func__, [=]() -> int {
736  std::unique_ptr<Botan::SM2_PrivateKey> p_key;
737  int rc = privkey_load_ec(p_key, safe_get(scalar), curve_name);
738 
739  if(rc == BOTAN_FFI_SUCCESS)
740  *key = new botan_privkey_struct(p_key.release());
741  return rc;
742  });
743 #else
746 #endif
747  }
int ffi_guard_thunk(const char *func_name, std::function< int()> thunk)
Definition: ffi.cpp:86
const botan_mp_t scalar
Definition: ffi.h:1325
#define BOTAN_UNUSED(...)
Definition: assert.h:142
const uint8_t * key
Definition: ffi.h:362
T & safe_get(botan_struct< T, M > *p)
Definition: ffi_util.h:61
const botan_mp_t const botan_mp_t const char * curve_name
Definition: ffi.h:1319

References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, curve_name, Botan_FFI::ffi_guard_thunk(), key, Botan_FFI::safe_get(), and scalar.

Referenced by botan_privkey_load_sm2_enc().

◆ botan_pubkey_load_ecdh()

int botan_pubkey_load_ecdh ( botan_pubkey_t key,
const botan_mp_t  public_x,
const botan_mp_t  public_y,
const char *  curve_name 
)

Definition at line 633 of file ffi_pkey_algs.cpp.

637  {
638 #if defined(BOTAN_HAS_ECDH)
639  return ffi_guard_thunk(__func__, [=]() -> int {
640  std::unique_ptr<Botan::ECDH_PublicKey> p_key;
641  int rc = pubkey_load_ec(p_key, safe_get(public_x), safe_get(public_y), curve_name);
642 
643  if(rc == BOTAN_FFI_SUCCESS)
644  *key = new botan_pubkey_struct(p_key.release());
645  return rc;
646  });
647 #else
650 #endif
651  }
int ffi_guard_thunk(const char *func_name, std::function< int()> thunk)
Definition: ffi.cpp:86
const botan_mp_t const botan_mp_t public_y
Definition: ffi.h:1319
#define BOTAN_UNUSED(...)
Definition: assert.h:142
const uint8_t * key
Definition: ffi.h:362
T & safe_get(botan_struct< T, M > *p)
Definition: ffi_util.h:61
const botan_mp_t public_x
Definition: ffi.h:1319
const botan_mp_t const botan_mp_t const char * curve_name
Definition: ffi.h:1319

References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, curve_name, Botan_FFI::ffi_guard_thunk(), key, public_x, public_y, and Botan_FFI::safe_get().

◆ botan_pubkey_load_ecdsa()

int botan_pubkey_load_ecdsa ( botan_pubkey_t key,
const botan_mp_t  public_x,
const botan_mp_t  public_y,
const char *  curve_name 
)

Definition at line 475 of file ffi_pkey_algs.cpp.

479  {
480 #if defined(BOTAN_HAS_ECDSA)
481  return ffi_guard_thunk(__func__, [=]() -> int {
482  std::unique_ptr<Botan::ECDSA_PublicKey> p_key;
483 
484  int rc = pubkey_load_ec(p_key, safe_get(public_x), safe_get(public_y), curve_name);
485  if(rc == BOTAN_FFI_SUCCESS)
486  *key = new botan_pubkey_struct(p_key.release());
487 
488  return rc;
489  });
490 #else
493 #endif
494  }
int ffi_guard_thunk(const char *func_name, std::function< int()> thunk)
Definition: ffi.cpp:86
const botan_mp_t const botan_mp_t public_y
Definition: ffi.h:1319
#define BOTAN_UNUSED(...)
Definition: assert.h:142
const uint8_t * key
Definition: ffi.h:362
T & safe_get(botan_struct< T, M > *p)
Definition: ffi_util.h:61
const botan_mp_t public_x
Definition: ffi.h:1319
const botan_mp_t const botan_mp_t const char * curve_name
Definition: ffi.h:1319

References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, curve_name, Botan_FFI::ffi_guard_thunk(), key, public_x, public_y, and Botan_FFI::safe_get().

◆ botan_pubkey_load_sm2()

int botan_pubkey_load_sm2 ( botan_pubkey_t key,
const botan_mp_t  public_x,
const botan_mp_t  public_y,
const char *  curve_name 
)

Definition at line 709 of file ffi_pkey_algs.cpp.

713  {
714 #if defined(BOTAN_HAS_SM2)
715  return ffi_guard_thunk(__func__, [=]() -> int {
716  std::unique_ptr<Botan::SM2_PublicKey> p_key;
717  if(!pubkey_load_ec(p_key, safe_get(public_x), safe_get(public_y), curve_name))
718  {
719  *key = new botan_pubkey_struct(p_key.release());
720  return BOTAN_FFI_SUCCESS;
721  }
723  });
724 #else
727 #endif
728  }
int ffi_guard_thunk(const char *func_name, std::function< int()> thunk)
Definition: ffi.cpp:86
const botan_mp_t const botan_mp_t public_y
Definition: ffi.h:1319
#define BOTAN_UNUSED(...)
Definition: assert.h:142
const uint8_t * key
Definition: ffi.h:362
T & safe_get(botan_struct< T, M > *p)
Definition: ffi_util.h:61
const botan_mp_t public_x
Definition: ffi.h:1319
const botan_mp_t const botan_mp_t const char * curve_name
Definition: ffi.h:1319

References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_UNKNOWN_ERROR, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, curve_name, Botan_FFI::ffi_guard_thunk(), key, public_x, public_y, and Botan_FFI::safe_get().

Referenced by botan_pubkey_load_sm2_enc().

◆ botan_pubkey_sm2_compute_za()

int botan_pubkey_sm2_compute_za ( uint8_t  out[],
size_t *  out_len,
const char *  ident,
const char *  hash_algo,
const botan_pubkey_t  key 
)

Definition at line 673 of file ffi_pkey_algs.cpp.

678  {
679  if(out == nullptr || out_len == nullptr)
681  if(ident == nullptr || hash_algo == nullptr || key == nullptr)
683 
684 #if defined(BOTAN_HAS_SM2)
685  return ffi_guard_thunk(__func__, [=]() -> int {
686  const Botan::Public_Key& pub_key = safe_get(key);
687  const Botan::EC_PublicKey* ec_key = dynamic_cast<const Botan::EC_PublicKey*>(&pub_key);
688 
689  if(ec_key == nullptr)
691 
692  if(ec_key->algo_name() != "SM2")
694 
695  const std::string ident_str(ident);
696  std::unique_ptr<Botan::HashFunction> hash =
697  Botan::HashFunction::create_or_throw(hash_algo);
698 
699  const std::vector<uint8_t> za =
700  Botan::sm2_compute_za(*hash, ident_str, ec_key->domain(), ec_key->public_point());
701 
702  return write_vec_output(out, out_len, za);
703  });
704 #else
706 #endif
707  }
int ffi_guard_thunk(const char *func_name, std::function< int()> thunk)
Definition: ffi.cpp:86
const char * hash
Definition: ffi.h:924
int write_vec_output(uint8_t out[], size_t *out_len, const std::vector< uint8_t, Alloc > &buf)
Definition: ffi_util.h:146
size_t char * out
Definition: ffi.h:162
std::vector< uint8_t > sm2_compute_za(HashFunction &hash, const std::string &user_id, const EC_Group &domain, const PointGFp &pubkey)
Definition: sm2.cpp:51
size_t uint8_t size_t * out_len
Definition: ffi.h:171
const uint8_t * key
Definition: ffi.h:362
AlgorithmIdentifier hash_algo
Definition: x509_obj.cpp:23
T & safe_get(botan_struct< T, M > *p)
Definition: ffi_util.h:61

References BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, Botan_FFI::ffi_guard_thunk(), hash, hash_algo, key, out, out_len, Botan_FFI::safe_get(), Botan::sm2_compute_za(), and Botan_FFI::write_vec_output().

◆ BOTAN_PUBLIC_API() [1/6]

BOTAN_PUBLIC_API ( ,
 
) const
new

Convert an error code into a string. Returns "Unknown error" if the error code is not a known one.

Reseed a random number generator

Parameters
rngrng object
source_rngthe rng that will be read from
bitsnumber of bits to to reseed with
Returns
0 on success, a negative value on failure

Add some seed material to a random number generator

Parameters
rngrng object
entropythe data to add
entropy_lenlength of entropy buffer
Returns
0 on success, a negative value on failure

Get the name of this hash function

Parameters
hashthe object to read
nameoutput buffer
name_lenon input, the length of buffer, on success the number of bytes written

Get the name of this MAC

Parameters
macthe object to read
nameoutput buffer
name_lenon input, the length of buffer, on success the number of bytes written

Get the key length limits of this auth code

Parameters
macthe object to read
out_minimum_keylengthif non-NULL, will be set to minimum keylength of MAC
out_maximum_keylengthif non-NULL, will be set to maximum keylength of MAC
out_keylength_moduloif non-NULL will be set to byte multiple of valid keys

Return the name of the cipher object

Return the output length of this cipher, for a particular input length.

Get information about the supported key lengths.

Reset the message specific state for this cipher. Without resetting the keys, this resets the nonce, and any state associated with any message bits that have been processed so far.

It is conceptually equivalent to calling botan_cipher_clear followed by botan_cipher_set_key with the original key.

Derive a key using scrypt

Get the name of this block cipher

Parameters
cipherthe object to read
nameoutput buffer
name_lenon input, the length of buffer, on success the number of bytes written

Get the key length limits of this block cipher

Parameters
cipherthe object to read
out_minimum_keylengthif non-NULL, will be set to minimum keylength of cipher
out_maximum_keylengthif non-NULL, will be set to maximum keylength of cipher
out_keylength_moduloif non-NULL will be set to byte multiple of valid keys

Returns 0 if the validation was successful, 1 if validation failed, and negative on error. A status code with details is written to *validation_result

Intermediates or trusted lists can be null Trusted path can be null

Returns a pointer to a static character string explaining the status code, or else NULL if unknown.

◆ BOTAN_PUBLIC_API() [2/6]

BOTAN_PUBLIC_API ( ,
 
)

Return the version of the currently supported FFI API. This is expressed in the form YYYYMMDD of the release date of this version of the API.

Return 0 (ok) if the version given is one this library supports. botan_ffi_supports_api(botan_ffi_api_version()) will always return 0.

Return a free-form version string, e.g., 2.0.0

Return the major version of the library

Return the minor version of the library

Return the patch version of the library

Return the date this version was released as an integer, or 0 if an unreleased version

Deprecated equivalent to botan_constant_time_compare

Perform hex encoding

Parameters
xis some binary data
lenlength of x in bytes
outan array of at least x*2 bytes
flagsflags out be upper or lower case?
Returns
0 on success, 1 on failure

Initialize a random number generator object

Parameters
rngrng object
rng_typetype of the rng, possible values: "system": system RNG "user": userspace RNG "user-threadsafe": userspace RNG, with internal locking "rdrand": directly read RDRAND Set rng_type to null to let the library choose some default.

Get random bytes from a random number generator

Parameters
rngrng object
outoutput buffer of size out_len
out_lennumber of requested bytes
Returns
0 on success, negative on failure

Reseed a random number generator Uses the System_RNG as a seed generator.

Parameters
rngrng object
bitsnumber of bits to to reseed with
Returns
0 on success, a negative value on failure

Frees all resources of the random number generator object

Parameters
rngrng object
Returns
0 if success, error if invalid object handle

Initialize a hash function object

Parameters
hashhash object
hash_namename of the hash function, e.g., "SHA-384"
flagsshould be 0 in current API revision, all other uses are reserved and return BOTAN_FFI_ERROR_BAD_FLAG

Writes the output length of the hash function to *output_length

Parameters
hashhash object
output_lengthoutput buffer to hold the hash function output length
Returns
0 on success, a negative value on failure

Send more input to the hash function

Parameters
hashhash object
ininput buffer
in_lennumber of bytes to read from the input buffer
Returns
0 on success, a negative value on failure

Finalizes the hash computation and writes the output to out[0:botan_hash_output_length()] then reinitializes for computing another digest as if botan_hash_clear had been called.

Parameters
hashhash object
outoutput buffer
Returns
0 on success, a negative value on failure

Reinitializes the state of the hash computation. A hash can be computed (with update/final) immediately.

Parameters
hashhash object
Returns
0 on success, a negative value on failure

Frees all resources of the hash object

Parameters
hashhash object
Returns
0 if success, error if invalid object handle

Initialize a message authentication code object

Parameters
macmac object
mac_namename of the hash function, e.g., "HMAC(SHA-384)"
flagsshould be 0 in current API revision, all other uses are reserved and return a negative value (error code)
Returns
0 on success, a negative value on failure

Writes the output length of the message authentication code to *output_length

Parameters
macmac object
output_lengthoutput buffer to hold the MAC output length
Returns
0 on success, a negative value on failure

Sets the key on the MAC

Parameters
macmac object
keybuffer holding the key
key_lensize of the key buffer in bytes
Returns
0 on success, a negative value on failure

Send more input to the message authentication code

Parameters
macmac object
bufinput buffer
lennumber of bytes to read from the input buffer
Returns
0 on success, a negative value on failure

Finalizes the MAC computation and writes the output to out[0:botan_mac_output_length()] then reinitializes for computing another MAC as if botan_mac_clear had been called.

Parameters
macmac object
outoutput buffer
Returns
0 on success, a negative value on failure

Reinitializes the state of the MAC computation. A MAC can be computed (with update/final) immediately.

Parameters
macmac object
Returns
0 on success, a negative value on failure

Frees all resources of the MAC object

Parameters
macmac object
Returns
0 if success, error if invalid object handle

Initialize a cipher object

Return if the specified nonce length is valid for this cipher

Get the tag length of the cipher (0 for non-AEAD modes)

Get the default nonce length of this cipher

Return the update granularity of the cipher; botan_cipher_update must be called with blocks of this size, except for the final.

Get information about the key lengths. Prefer botan_cipher_get_keyspec

Set the key for this cipher object

Set the associated data. Will fail if cipher is not an AEAD

Begin processing a new message using the provided nonce

Encrypt some data

Reset the key, nonce, AD and all other state on this cipher object

Destroy the cipher object

Returns
0 if success, error if invalid object handle

Derive a key from a passphrase, running until msec time has elapsed.

Parameters
pbkdf_algoPBKDF algorithm, e.g., "PBKDF2(SHA-256)"
outbuffer to store the derived key, must be of out_len bytes
out_lenthe desired length of the key to produce
passphrasethe password to derive the key from
salta randomly chosen salt
salt_lenlength of salt in bytes
milliseconds_to_runif iterations is zero, then instead the PBKDF is run until milliseconds_to_run milliseconds has passed
out_iterations_usedset to the number iterations executed
Returns
0 on success, a negative value on failure

Derive a key

Parameters
kdf_algoKDF algorithm, e.g., "SP800-56C"
outbuffer holding the derived key, must be of length out_len
out_lenthe desired output length in bytes
secretthe secret input
secret_lensize of secret in bytes
salta diversifier
salt_lensize of salt in bytes
labelpurpose for the derived keying material
label_lensize of label in bytes
Returns
0 on success, a negative value on failure

Create a password hash using Bcrypt

Parameters
outbuffer holding the password hash, should be of length 64 bytes
out_lenthe desired output length in bytes
passwordthe password
rnga random number generator
work_factorhow much work to do to slow down guessing attacks
flagsshould be 0 in current API revision, all other uses are reserved and return BOTAN_FFI_ERROR_BAD_FLAG
Returns
0 on success, a negative value on failure

Output is formatted bcrypt $2a$...

Check a previously created password hash

Parameters
passthe password to check against
hashthe stored hash to check against
Returns
0 if if this password/hash combination is valid, 1 if the combination is not valid (but otherwise well formed), negative on error

Create a new private key

Parameters
keythe new object will be placed here
algo_namesomething like "RSA" or "ECDSA"
algo_paramsis specific to the algorithm. For RSA, specifies the modulus bit length. For ECC is the name of the curve.
rnga random number generator

Input currently assumed to be PKCS #8 structure; Set password to NULL to indicate no encryption expected Starting in 2.8.0, the rng parameter is unused and may be set to null

Returns
0 if success, error if invalid object handle

On input *out_len is number of bytes in out[] On output *out_len is number of bytes written (or required) If out is not big enough no output is written, *out_len is set and 1 is returned Returns 0 on success and sets If some other error occurs a negative integer is returned.

Set encryption_algo to NULL or "" to have the library choose a default (recommended)

Export a private key using the specified number of iterations.

Returns 0 if key is valid, negative if invalid key or some other error

Loads Diffie Hellman public key

Parameters
keyvariable populated with key material
pprime order of a Z_p group
ggroup generator
ypublic key
Precondition
key is NULL on input
Postcondition
function allocates memory and assigns to ‘key’
Returns
0 on success, a negative value on failure

Loads ElGamal public key

Parameters
keyvariable populated with key material
pprime order of a Z_p group
ggroup generator
ypublic key
Precondition
key is NULL on input
Postcondition
function allocates memory and assigns to ‘key’
Returns
0 on success, a negative value on failure

Loads ElGamal private key

Parameters
keyvariable populated with key material
pprime order of a Z_p group
ggroup generator
xprivate key
Precondition
key is NULL on input
Postcondition
function allocates memory and assigns to ‘key’
Returns
0 on success, a negative value on failure

◆ BOTAN_PUBLIC_API() [3/6]

BOTAN_PUBLIC_API ( ,
 
) const

Returns 0 if x[0..len] == y[0..len], or otherwise -1

Perform hex decoding

Parameters
hex_stra string of hex chars (whitespace is ignored)
in_lenthe length of hex_str
outthe output buffer should be at least strlen(hex_str)/2 bytes
out_lenthe size of out

Perform base64 encoding

Perform base64 decoding

◆ BOTAN_PUBLIC_API() [4/6]

BOTAN_PUBLIC_API ( ,
 
)

Clear out memory using a system specific approach to bypass elision by the compiler (currently using RtlSecureZeroMemory or tricks with volatile pointers).

Copy the state of a hash function object

Parameters
destdestination hash object
sourcesource hash object
Returns
0 on success, a negative value on failure

Writes the block size of the hash function to *block_size

Parameters
hashhash object
block_sizeoutput buffer to hold the hash function output length
Returns
0 on success, a negative value on failure

◆ BOTAN_PUBLIC_API() [5/6]

BOTAN_PUBLIC_API ( ,
 
)

Initialize a block cipher object

Destroy a block cipher object

Returns
0 if success, error if invalid object handle

Reinitializes the block cipher

Returns
0 on success, a negative value on failure

Set the key for a block cipher instance

Return the positive block size of this block cipher, or negative to indicate an error

Encrypt one or more blocks with the cipher

Decrypt one or more blocks with the cipher

Initialize an MPI

Destroy (deallocate) an MPI

Returns
0 if success, error if invalid object handle

Convert the MPI to a hex string. Writes botan_mp_num_bytes(mp)*2 + 1 bytes

Convert the MPI to a string. Currently base == 10 and base == 16 are supported.

Set the MPI to zero

Set the MPI value from an int

Set the MPI value from another MP object

Set the MPI value from a string

Set the MPI value from a string with arbitrary radix. For arbitrary being 10 or 16.

Return the number of significant bits in the MPI

Return the number of significant bytes in the MPI

This function should have been named mp_is_non_negative. Returns 1 iff mp is greater than or equal to zero. Use botan_mp_is_negative to detect negative numbers, botan_mp_is_zero to check for zero.

Return 1 iff mp is less than 0

Returns 0 if n is not prime Returns 1 if n is prime Returns negative number on error

Returns 0 if specified bit of n is not set Returns 1 if specified bit of n is set Returns negative number on error

Set the specified bit

Clear the specified bit

◆ BOTAN_PUBLIC_API() [6/6]

BOTAN_PUBLIC_API ( ,
 
)

Generates DSA key pair. Gives to a caller control over key length and order of a subgroup 'q'.

Parameters
keyhandler to the resulting key
rnginitialized PRNG
pbitslength of the key in bits. Must be between in range (1024, 3072) and multiple of 64. Bit size of the prime 'p'
qbitsorder of the subgroup. Must be in range (160, 256) and multiple of 8
Returns
BOTAN_FFI_SUCCESS Success, ‘key’ initialized with DSA key
BOTAN_FFI_ERROR_NULL_POINTER either ‘key’ or ‘rng’ is NULL
BOTAN_FFI_ERROR_BAD_PARAMETER unexpected value for either ‘pbits’ or ‘qbits’
BOTAN_FFI_ERROR_NOT_IMPLEMENTED functionality not implemented

Generates ElGamal key pair. Caller has a control over key length and order of a subgroup 'q'. Function is able to use two types of primes:

  • if pbits-1 == qbits then safe primes are used for key generation
  • otherwise generation uses group of prime order
Parameters
keyhandler to the resulting key
rnginitialized PRNG
pbitslength of the key in bits. Must be at least 1024
qbitsorder of the subgroup. Must be at least 160
Returns
BOTAN_FFI_SUCCESS Success, ‘key’ initialized with DSA key
BOTAN_FFI_ERROR_NULL_POINTER either ‘key’ or ‘rng’ is NULL
BOTAN_FFI_ERROR_BAD_PARAMETER unexpected value for either ‘pbits’ or ‘qbits’
BOTAN_FFI_ERROR_NOT_IMPLEMENTED functionality not implemented

Check if the certificate matches the specified hostname via alternative name or CN match. RFC 5280 wildcards also supported.

◆ botan_totp_check()

int botan_totp_check ( botan_totp_t  totp,
uint32_t  totp_code,
uint64_t  timestamp,
size_t  acceptable_clock_drift 
)

Verify a TOTP code

Parameters
totpthe TOTP object
totp_codethe presented OTP
timestampthe current local timestamp
acceptable_clock_driftspecifies the acceptable amount of clock drift (in terms of time steps) between the two hosts.

Definition at line 77 of file ffi_totp.cpp.

81  {
82 #if defined(BOTAN_HAS_TOTP)
83  return BOTAN_FFI_DO(Botan::TOTP, totp, t, {
84  const bool ok = t.verify_totp(totp_code, timestamp, acceptable_clock_drift);
86  });
87 
88 #else
89  BOTAN_UNUSED(totp, totp_code, timestamp, acceptable_clock_drift);
91 #endif
92  }
botan_rng_t size_t size_t t
Definition: ffi.h:955
#define BOTAN_UNUSED(...)
Definition: assert.h:142
#define BOTAN_FFI_DO(T, obj, param, block)
Definition: ffi_util.h:92

References BOTAN_FFI_DO, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_INVALID_VERIFIER, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, and t.

◆ botan_totp_destroy()

int botan_totp_destroy ( botan_totp_t  totp)

Destroy a TOTP instance

Returns
0 if success, error if invalid object handle

Definition at line 49 of file ffi_totp.cpp.

50  {
51 #if defined(BOTAN_HAS_TOTP)
52  return BOTAN_FFI_CHECKED_DELETE(totp);
53 #else
54  BOTAN_UNUSED(totp);
56 #endif
57  }
#define BOTAN_FFI_CHECKED_DELETE(o)
Definition: ffi_util.h:120
#define BOTAN_UNUSED(...)
Definition: assert.h:142

References BOTAN_FFI_CHECKED_DELETE, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, and BOTAN_UNUSED.

◆ botan_totp_generate()

int botan_totp_generate ( botan_totp_t  totp,
uint32_t *  totp_code,
uint64_t  timestamp 
)

Generate a TOTP code for the provided timestamp

Parameters
totpthe TOTP object
totp_codethe OTP code will be written here
timestampthe current local timestamp

Definition at line 59 of file ffi_totp.cpp.

62  {
63 #if defined(BOTAN_HAS_TOTP)
64  if(totp == nullptr || totp_code == nullptr)
66 
67  return BOTAN_FFI_DO(Botan::TOTP, totp, t, {
68  *totp_code = t.generate_totp(timestamp);
69  });
70 
71 #else
72  BOTAN_UNUSED(totp, totp_code, timestamp);
74 #endif
75  }
botan_rng_t size_t size_t t
Definition: ffi.h:955
#define BOTAN_UNUSED(...)
Definition: assert.h:142
#define BOTAN_FFI_DO(T, obj, param, block)
Definition: ffi_util.h:92

References BOTAN_FFI_DO, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, and t.

◆ botan_totp_init()

int botan_totp_init ( botan_totp_t totp,
const uint8_t  key[],
size_t  key_len,
const char *  hash_algo,
size_t  digits,
size_t  time_step 
)

Initialize a TOTP instance

Definition at line 24 of file ffi_totp.cpp.

29  {
30  if(totp == nullptr || key == nullptr || hash_algo == nullptr)
32 
33  *totp = nullptr;
34 
35 #if defined(BOTAN_HAS_TOTP)
36  return ffi_guard_thunk(__func__, [=]() -> int {
37 
38  *totp = new botan_totp_struct(
39  new Botan::TOTP(key, key_len, hash_algo, digits, time_step));
40 
41  return BOTAN_FFI_SUCCESS;
42  });
43 #else
44  BOTAN_UNUSED(totp, key, key_len, hash_algo, digits, time_step);
46 #endif
47  }
int ffi_guard_thunk(const char *func_name, std::function< int()> thunk)
Definition: ffi.cpp:86
#define BOTAN_UNUSED(...)
Definition: assert.h:142
const uint8_t * key
Definition: ffi.h:362
AlgorithmIdentifier hash_algo
Definition: x509_obj.cpp:23
const uint8_t size_t key_len
Definition: ffi.h:362

References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), hash_algo, key, and key_len.

◆ botan_x509_cert_get_issuer_dn()

int botan_x509_cert_get_issuer_dn ( botan_x509_cert_t  cert,
const char *  key,
size_t  index,
uint8_t  out[],
size_t *  out_len 
)

Definition at line 101 of file ffi_cert.cpp.

104  {
105 #if defined(BOTAN_HAS_X509_CERTIFICATES)
106  return BOTAN_FFI_DO(Botan::X509_Certificate, cert, c, { return write_str_output(out, out_len, c.issuer_info(key).at(index)); });
107 #else
108  BOTAN_UNUSED(cert, key, index, out, out_len);
110 #endif
111  }
const uint8_t cert[]
Definition: ffi.h:1483
int write_str_output(uint8_t out[], size_t *out_len, const std::string &str)
Definition: ffi_util.h:151
size_t char * out
Definition: ffi.h:162
size_t uint8_t size_t * out_len
Definition: ffi.h:171
#define BOTAN_UNUSED(...)
Definition: assert.h:142
const uint8_t * key
Definition: ffi.h:362
BigInt const BigInt const BigInt & c
Definition: numthry.h:25
#define BOTAN_FFI_DO(T, obj, param, block)
Definition: ffi_util.h:92

References BOTAN_FFI_DO, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_UNUSED, Botan::c, cert, key, out, out_len, and Botan_FFI::write_str_output().

◆ botan_x509_cert_get_subject_dn()

int botan_x509_cert_get_subject_dn ( botan_x509_cert_t  cert,
const char *  key,
size_t  index,
uint8_t  out[],
size_t *  out_len 
)

Definition at line 113 of file ffi_cert.cpp.

116  {
117 #if defined(BOTAN_HAS_X509_CERTIFICATES)
118  return BOTAN_FFI_DO(Botan::X509_Certificate, cert, c, { return write_str_output(out, out_len, c.subject_info(key).at(index)); });
119 #else
120  BOTAN_UNUSED(cert, key, index, out, out_len);
122 #endif
123  }
const uint8_t cert[]
Definition: ffi.h:1483
int write_str_output(uint8_t out[], size_t *out_len, const std::string &str)
Definition: ffi_util.h:151
size_t char * out
Definition: ffi.h:162
size_t uint8_t size_t * out_len
Definition: ffi.h:171
#define BOTAN_UNUSED(...)
Definition: assert.h:142
const uint8_t * key
Definition: ffi.h:362
BigInt const BigInt const BigInt & c
Definition: numthry.h:25
#define BOTAN_FFI_DO(T, obj, param, block)
Definition: ffi_util.h:92

References BOTAN_FFI_DO, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_UNUSED, Botan::c, cert, key, out, out_len, and Botan_FFI::write_str_output().

Variable Documentation

◆ ad

const char const uint8_t size_t const uint8_t ad

◆ ad_len

const char const uint8_t size_t const uint8_t size_t ad_len

◆ aead

const char * aead

◆ algo_name

const char* algo_name

Definition at line 940 of file ffi.h.

Referenced by botan_privkey_create(), and Botan::commoncrypto_opts_from_algo().

◆ algo_params

const char const char* algo_params

Definition at line 940 of file ffi.h.

Referenced by botan_privkey_create().

◆ base

const botan_mp_t base

◆ bit

size_t bit

◆ bits

const uint8_t bits

◆ block_size

size_t* block_size

Definition at line 288 of file ffi.h.

◆ blocks

const uint8_t uint8_t size_t blocks

◆ buf

const uint8_t* buf

Definition at line 371 of file ffi.h.

Referenced by Botan::aont_package(), Botan::aont_unpackage(), Botan::TLS::append_tls_length_value(), botan_hash_update(), botan_mac_update(), Botan::TLS::BOTAN_PUBLIC_API(), Botan::buffer_insert(), Botan::TLS::Certificate::Certificate(), Botan::TLS::Certificate_Req::Certificate_Req(), Botan::TLS::Certificate_Status::Certificate_Status(), Botan::TLS::Certificate_Verify::Certificate_Verify(), Botan::TLS::Client_Hello::Client_Hello(), Botan::TLS::Client_Hello::cookie_input_data(), Botan::Sodium::crypto_auth_hmacsha512256(), Botan::Stream_Compression::finish(), Botan::Stream_Decompression::finish(), Botan::TLS::Hello_Request::Hello_Request(), Botan::TLS::Hello_Verify_Request::Hello_Verify_Request(), Botan::HTTP::http_sync(), Botan::CT::Mask< T >::if_set_zero_out(), Botan::TLS::make_hello_random(), Botan::TLS::New_Session_Ticket::New_Session_Ticket(), Botan::pbes2_decrypt(), Botan::Getentropy::poll(), Botan::Intel_Rdrand::poll(), Botan::poly_double_n(), Botan::TLS::TLS_CBC_HMAC_AEAD_Mode::process(), Botan::Sodium::randombytes(), Botan::Sodium::randombytes_buf(), Botan::TLS::Stream_Handshake_IO::send(), Botan::TLS::Server_Name_Indicator::serialize(), Botan::TLS::Renegotiation_Extension::serialize(), Botan::TLS::Application_Layer_Protocol_Notification::serialize(), Botan::TLS::Supported_Groups::serialize(), Botan::TLS::Signature_Algorithms::serialize(), Botan::TLS::SRTP_Protection_Profiles::serialize(), Botan::TLS::Certificate_Status_Request::serialize(), Botan::TLS::Supported_Versions::serialize(), Botan::TLS::Extensions::serialize(), Botan::TLS::Server_Hello::Server_Hello(), Botan::TLS::Server_Hello_Done::Server_Hello_Done(), Botan::TLS::Server_Key_Exchange::Server_Key_Exchange(), Botan::Stream_Compression::update(), Botan::Stream_Decompression::update(), Botan::TLS::Server_Key_Exchange::verify(), Botan_FFI::write_output(), and Botan_FFI::write_vec_output().

◆ bytes

size_t * bytes

◆ cert

◆ cert_len

const uint8_t size_t cert_len

Definition at line 1483 of file ffi.h.

◆ cipher_algo

uint8_t size_t botan_rng_t const char size_t const char * cipher_algo

Definition at line 1055 of file ffi.h.

◆ cipher_name

const char* cipher_name

Definition at line 661 of file ffi.h.

Referenced by botan_cipher_init(), Botan::rfc3394_keyunwrap(), and Botan::rfc3394_keywrap().

◆ ciphertext

uint8_t size_t const uint8_t ciphertext[]

◆ ciphertext_len

uint8_t size_t const uint8_t size_t ciphertext_len

◆ ct

const char const uint8_t ct

Definition at line 1464 of file ffi.h.

Referenced by botan_mceies_decrypt(), and botan_mceies_encrypt().

◆ ct_len

const char const uint8_t size_t ct_len

Definition at line 1464 of file ffi.h.

Referenced by botan_mceies_decrypt().

◆ ctext_len

size_t ctext_len

◆ curve_name

const botan_mp_t const char * curve_name

◆ e

◆ encryption_algo

uint8_t size_t botan_rng_t const char const char* encryption_algo

Definition at line 1044 of file ffi.h.

◆ entropy

const uint8_t* entropy

Definition at line 242 of file ffi.h.

◆ entropy_len

const uint8_t size_t entropy_len

Definition at line 242 of file ffi.h.

◆ estimate

size_t* estimate

Definition at line 1091 of file ffi.h.

Referenced by botan_pubkey_estimated_strength().

◆ exponent

const botan_mp_t const botan_mp_t exponent

Definition at line 857 of file ffi.h.

Referenced by botan_mp_powmod().

◆ field_name

botan_privkey_t const char * field_name

Definition at line 1105 of file ffi.h.

Referenced by botan_privkey_get_field(), and botan_pubkey_get_field().

◆ filename

const char* filename

Definition at line 1484 of file ffi.h.

◆ flags

botan_privkey_t const char uint32_t flags

◆ g

◆ hash

const char * hash

◆ hash_name

const char* hash_name

Definition at line 264 of file ffi.h.

Referenced by botan_hash_init(), and botan_pkcs_hash_id().

◆ hostname

botan_x509_cert_t const botan_x509_cert_t size_t const botan_x509_cert_t size_t const char size_t const char * hostname

Definition at line 1543 of file ffi.h.

Referenced by botan_x509_cert_hostname_match(), and botan_x509_cert_verify().

◆ in

const uint8_t in

◆ in_len

const uint8_t size_t in_len

◆ initial_value

int initial_value

Definition at line 759 of file ffi.h.

Referenced by botan_mp_set_from_int().

◆ input_bytes

uint32_t uint8_t size_t size_t const uint8_t input_bytes[]

Definition at line 512 of file ffi.h.

Referenced by Botan::gcm_multiply_clmul(), and Botan::gcm_multiply_ssse3().

◆ input_consumed

uint32_t uint8_t size_t size_t const uint8_t size_t size_t* input_consumed

Definition at line 512 of file ffi.h.

Referenced by botan_cipher_update().

◆ input_size

uint32_t uint8_t size_t size_t const uint8_t size_t input_size

Definition at line 512 of file ffi.h.

Referenced by botan_cipher_update(), and Botan::TLS::TLS_CBC_HMAC_AEAD_Encryption::finish().

◆ intermediates

botan_x509_cert_t const botan_x509_cert_t* intermediates

Definition at line 1555 of file ffi.h.

Referenced by botan_x509_cert_verify().

◆ intermediates_len

botan_x509_cert_t const botan_x509_cert_t size_t intermediates_len

Definition at line 1555 of file ffi.h.

Referenced by botan_x509_cert_verify().

◆ iterations

uint8_t size_t const char const uint8_t size_t size_t iterations

Definition at line 543 of file ffi.h.

Referenced by botan_pbkdf().

◆ key

Definition at line 362 of file ffi.h.

Referenced by botan_block_cipher_set_key(), botan_cipher_set_key(), botan_fpe_fe1_init(), botan_hotp_init(), botan_key_unwrap3394(), botan_key_wrap3394(), botan_mac_set_key(), botan_mceies_decrypt(), botan_mceies_encrypt(), botan_pk_op_key_agreement_export_public(), botan_privkey_algo_name(), botan_privkey_check_key(), botan_privkey_create(), botan_privkey_create_dsa(), botan_privkey_create_elgamal(), botan_privkey_destroy(), botan_privkey_dsa_get_x(), botan_privkey_ed25519_get_privkey(), botan_privkey_export(), botan_privkey_export_encrypted(), botan_privkey_export_encrypted_pbkdf_iter(), botan_privkey_export_encrypted_pbkdf_msec(), botan_privkey_get_field(), 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_elgamal(), botan_privkey_load_rsa(), botan_privkey_load_rsa_pkcs1(), botan_privkey_load_sm2(), botan_privkey_load_sm2_enc(), botan_privkey_load_x25519(), botan_privkey_rsa_get_d(), botan_privkey_rsa_get_e(), botan_privkey_rsa_get_n(), botan_privkey_rsa_get_p(), botan_privkey_rsa_get_q(), botan_privkey_x25519_get_privkey(), botan_pubkey_algo_name(), botan_pubkey_check_key(), botan_pubkey_destroy(), botan_pubkey_dsa_get_g(), botan_pubkey_dsa_get_p(), botan_pubkey_dsa_get_q(), botan_pubkey_dsa_get_y(), botan_pubkey_ed25519_get_pubkey(), botan_pubkey_estimated_strength(), botan_pubkey_export(), botan_pubkey_fingerprint(), botan_pubkey_get_field(), botan_pubkey_load(), botan_pubkey_load_dh(), botan_pubkey_load_dsa(), botan_pubkey_load_ecdh(), botan_pubkey_load_ecdsa(), botan_pubkey_load_ed25519(), botan_pubkey_load_elgamal(), botan_pubkey_load_rsa(), botan_pubkey_load_sm2(), botan_pubkey_load_sm2_enc(), botan_pubkey_load_x25519(), botan_pubkey_rsa_get_e(), botan_pubkey_rsa_get_n(), botan_pubkey_sm2_compute_za(), botan_pubkey_x25519_get_pubkey(), botan_totp_init(), botan_x509_cert_get_issuer_dn(), botan_x509_cert_get_public_key(), and botan_x509_cert_get_subject_dn().

◆ key_len

const uint8_t size_t key_len

◆ key_usage

unsigned int key_usage

Definition at line 1537 of file ffi.h.

Referenced by botan_x509_cert_allowed_usage().

◆ label

uint8_t size_t const uint8_t size_t const uint8_t size_t const uint8_t label[]

◆ label_len

uint8_t size_t const uint8_t size_t const uint8_t size_t const uint8_t size_t label_len

Definition at line 647 of file ffi.h.

Referenced by botan_kdf().

◆ len

const uint8_t size_t len

◆ lower_bound

botan_rng_t const botan_mp_t lower_bound

Definition at line 866 of file ffi.h.

Referenced by Botan::clamp(), and Botan::RFC4880_encode_count().

◆ mac_name

const char* mac_name

Definition at line 345 of file ffi.h.

Referenced by botan_mac_init().

◆ max_keylen

size_t size_t* max_keylen

Definition at line 474 of file ffi.h.

◆ milliseconds_to_run

uint8_t size_t const char const uint8_t size_t size_t milliseconds_to_run

Definition at line 562 of file ffi.h.

◆ min_keylen

size_t* min_keylen

Definition at line 474 of file ffi.h.

◆ mod

const botan_mp_t const botan_mp_t const botan_mp_t mod

Definition at line 834 of file ffi.h.

◆ mod_keylen

size_t size_t size_t* mod_keylen

Definition at line 474 of file ffi.h.

◆ modulus

const botan_mp_t const botan_mp_t modulus

Definition at line 857 of file ffi.h.

Referenced by botan_mp_mod_inverse(), botan_mp_mod_mul(), and botan_mp_powmod().

◆ msec

int uint32_t msec

Definition at line 614 of file ffi.h.

Referenced by botan_pwdhash_timed().

◆ N

size_t const char const uint8_t size_t size_t N

Definition at line 628 of file ffi.h.

Referenced by botan_scrypt(), and Botan::scrypt().

◆ n

◆ n_bits

botan_rng_t size_t n_bits

◆ name

char * name

◆ name_len

char size_t * name_len

◆ nl

size_t * nl

◆ nonce

const uint8_t* nonce

Definition at line 504 of file ffi.h.

Referenced by Botan::TLS::Connection_Cipher_State::aead_nonce(), botan_cipher_start(), 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_detached(), 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::Sodium::crypto_box(), Botan::Sodium::crypto_box_afternm(), Botan::Sodium::crypto_box_curve25519xsalsa20poly1305(), Botan::Sodium::crypto_box_curve25519xsalsa20poly1305_afternm(), Botan::Sodium::crypto_box_curve25519xsalsa20poly1305_open(), Botan::Sodium::crypto_box_curve25519xsalsa20poly1305_open_afternm(), Botan::Sodium::crypto_box_detached(), Botan::Sodium::crypto_box_detached_afternm(), Botan::Sodium::crypto_box_easy(), Botan::Sodium::crypto_box_easy_afternm(), Botan::Sodium::crypto_box_open(), Botan::Sodium::crypto_box_open_afternm(), Botan::Sodium::crypto_box_open_detached(), Botan::Sodium::crypto_box_open_detached_afternm(), Botan::Sodium::crypto_box_open_easy(), Botan::Sodium::crypto_box_open_easy_afternm(), Botan::Sodium::crypto_secretbox(), Botan::Sodium::crypto_secretbox_detached(), Botan::Sodium::crypto_secretbox_easy(), Botan::Sodium::crypto_secretbox_open(), Botan::Sodium::crypto_secretbox_open_detached(), Botan::Sodium::crypto_secretbox_open_easy(), Botan::Sodium::crypto_secretbox_xsalsa20poly1305(), Botan::Sodium::crypto_secretbox_xsalsa20poly1305_open(), Botan::Sodium::crypto_stream(), Botan::Sodium::crypto_stream_chacha20(), Botan::Sodium::crypto_stream_chacha20_ietf(), Botan::Sodium::crypto_stream_chacha20_ietf_xor(), Botan::Sodium::crypto_stream_chacha20_ietf_xor_ic(), Botan::Sodium::crypto_stream_chacha20_xor(), Botan::Sodium::crypto_stream_chacha20_xor_ic(), Botan::Sodium::crypto_stream_salsa20(), Botan::Sodium::crypto_stream_salsa20_xor(), Botan::Sodium::crypto_stream_salsa20_xor_ic(), Botan::Sodium::crypto_stream_xchacha20(), Botan::Sodium::crypto_stream_xchacha20_xor(), Botan::Sodium::crypto_stream_xchacha20_xor_ic(), Botan::Sodium::crypto_stream_xor(), Botan::Sodium::crypto_stream_xsalsa20(), Botan::Sodium::crypto_stream_xsalsa20_xor(), Botan::Sodium::crypto_stream_xsalsa20_xor_ic(), Botan::ed25519_sign(), Botan::mceies_encrypt(), and Botan::TLS::write_record().

◆ nonce_len

const uint8_t size_t nonce_len

Definition at line 504 of file ffi.h.

Referenced by botan_cipher_start(), Botan::mceies_decrypt(), and Botan::mceies_encrypt().

◆ olen

size_t* olen

Definition at line 1400 of file ffi.h.

◆ out

char out

Definition at line 162 of file ffi.h.

Referenced by botan_base64_decode(), botan_base64_encode(), botan_bcrypt_generate(), botan_block_cipher_decrypt_blocks(), botan_block_cipher_encrypt_blocks(), botan_hash_block_size(), botan_hash_final(), botan_hash_output_length(), botan_hex_decode(), botan_hex_encode(), botan_kdf(), botan_mac_final(), botan_mac_output_length(), botan_mceies_decrypt(), botan_mceies_encrypt(), botan_mp_gcd(), botan_mp_lshift(), botan_mp_mod_inverse(), botan_mp_mod_mul(), botan_mp_powmod(), botan_mp_rshift(), botan_mp_to_hex(), botan_mp_to_str(), botan_pbkdf(), botan_pbkdf_timed(), botan_pk_op_decrypt(), botan_pk_op_encrypt(), botan_pk_op_key_agreement(), botan_pk_op_key_agreement_export_public(), botan_pk_op_sign_finish(), botan_privkey_algo_name(), botan_privkey_export(), botan_privkey_export_encrypted(), botan_privkey_export_encrypted_pbkdf_iter(), botan_privkey_export_encrypted_pbkdf_msec(), botan_privkey_rsa_get_privkey(), botan_pubkey_algo_name(), botan_pubkey_export(), botan_pubkey_fingerprint(), botan_pubkey_sm2_compute_za(), botan_pwdhash(), botan_pwdhash_timed(), botan_rng_get(), botan_scrypt(), botan_x509_cert_get_authority_key_id(), botan_x509_cert_get_fingerprint(), botan_x509_cert_get_issuer_dn(), botan_x509_cert_get_public_key_bits(), 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_to_string(), Botan_FFI::write_output(), Botan_FFI::write_str_output(), and Botan_FFI::write_vec_output().

◆ out_iterations_used

uint8_t size_t const char const uint8_t size_t size_t size_t* out_iterations_used

Definition at line 562 of file ffi.h.

◆ out_keylength_modulo

size_t size_t size_t * out_keylength_modulo

◆ out_len

char size_t * out_len

◆ out_maximum_keylength

size_t size_t * out_maximum_keylength

◆ out_minimum_keylength

size_t * out_minimum_keylength

◆ output

uint8_t output

◆ output_length

size_t * output_length

Definition at line 280 of file ffi.h.

Referenced by Botan::base_decode_to_vec(), and Botan::base_encode_to_string().

◆ output_size

uint32_t uint8_t size_t output_size

◆ output_written

uint32_t uint8_t size_t size_t* output_written

Definition at line 512 of file ffi.h.

Referenced by botan_cipher_update().

◆ p

◆ padding

botan_privkey_t const char * padding

◆ param

botan_rng_t const char* param

Definition at line 957 of file ffi.h.

Referenced by Botan::argon2_check_pwhash().

◆ param1

int uint32_t size_t * param1

Definition at line 586 of file ffi.h.

Referenced by botan_pwdhash(), and botan_pwdhash_timed().

◆ param2

int uint32_t size_t size_t * param2

Definition at line 586 of file ffi.h.

Referenced by botan_pwdhash(), and botan_pwdhash_timed().

◆ param3

int uint32_t size_t size_t size_t * param3

Definition at line 586 of file ffi.h.

Referenced by botan_pwdhash(), and botan_pwdhash_timed().

◆ params

botan_rng_t const char * params

Definition at line 951 of file ffi.h.

Referenced by botan_privkey_create_ecdh().

◆ passphrase

uint8_t size_t botan_rng_t const char * passphrase

Definition at line 543 of file ffi.h.

◆ passphrase_len

int uint32_t size_t size_t size_t uint8_t size_t const char size_t passphrase_len

Definition at line 586 of file ffi.h.

◆ password

botan_rng_t const uint8_t size_t const char * password

◆ pbits

botan_rng_t size_t pbits

Definition at line 979 of file ffi.h.

Referenced by botan_privkey_create_dsa(), and botan_privkey_create_elgamal().

◆ pbkdf_algo

uint8_t size_t botan_rng_t const char size_t const char const char * pbkdf_algo

Definition at line 1055 of file ffi.h.

◆ pbkdf_iterations

uint8_t size_t botan_rng_t const char size_t pbkdf_iterations

◆ pbkdf_iterations_out

uint8_t size_t botan_rng_t const char uint32_t size_t* pbkdf_iterations_out

Definition at line 1055 of file ffi.h.

◆ pbkdf_msec_runtime

uint8_t size_t botan_rng_t const char uint32_t pbkdf_msec_runtime

Definition at line 1055 of file ffi.h.

◆ pkcs_id

uint8_t pkcs_id[]

Definition at line 1454 of file ffi.h.

Referenced by botan_pkcs_hash_id().

◆ pkcs_id_len

uint8_t size_t* pkcs_id_len

Definition at line 1454 of file ffi.h.

Referenced by botan_pkcs_hash_id().

◆ plaintext

botan_rng_t uint8_t size_t const uint8_t plaintext[]

◆ plaintext_len

botan_rng_t uint8_t size_t const uint8_t size_t plaintext_len

Definition at line 1355 of file ffi.h.

Referenced by botan_pk_op_encrypt().

◆ privkey

const uint8_t privkey

◆ pt

const char const uint8_t size_t const uint8_t size_t uint8_t pt

Definition at line 1464 of file ffi.h.

Referenced by botan_mceies_decrypt(), and botan_mceies_encrypt().

◆ pt_len

const char const uint8_t size_t const uint8_t size_t uint8_t size_t * pt_len

Definition at line 1464 of file ffi.h.

Referenced by botan_mceies_encrypt().

◆ ptext_len

size_t size_t * ptext_len

◆ pubkey

uint8_t pubkey

◆ public_x

const botan_mp_t public_x

◆ public_y

const botan_mp_t const botan_mp_t public_y

◆ q

◆ qbits

botan_rng_t size_t size_t qbits

Definition at line 979 of file ffi.h.

Referenced by botan_privkey_create_dsa(), and botan_privkey_create_elgamal().

◆ r

size_t const char const uint8_t size_t size_t size_t r

◆ radix

const char size_t radix

Definition at line 775 of file ffi.h.

Referenced by botan_mp_set_from_radix_str().

◆ reference_time

botan_x509_cert_t const botan_x509_cert_t size_t const botan_x509_cert_t size_t const char size_t const char uint64_t reference_time

Definition at line 1555 of file ffi.h.

Referenced by botan_x509_cert_verify().

◆ remainder

botan_mp_t remainder

Definition at line 831 of file ffi.h.

Referenced by Botan::base_encode(), botan_mp_div(), and Botan::operator%().

◆ required_strength

botan_x509_cert_t const botan_x509_cert_t size_t const botan_x509_cert_t size_t const char size_t required_strength

Definition at line 1555 of file ffi.h.

Referenced by botan_x509_cert_verify().

◆ rng

◆ rng_type

const char* rng_type

Definition at line 200 of file ffi.h.

Referenced by botan_rng_init().

◆ rsa_key

botan_pubkey_t rsa_key

Definition at line 1125 of file ffi.h.

Referenced by botan_privkey_rsa_get_privkey().

◆ salt

uint8_t size_t const uint8_t size_t const uint8_t salt

◆ salt_len

uint8_t size_t const uint8_t size_t const uint8_t size_t salt_len

◆ scalar

const botan_mp_t scalar

◆ secret

uint8_t size_t const uint8_t secret[]

Definition at line 647 of file ffi.h.

Referenced by botan_kdf().

◆ secret_len

uint8_t size_t const uint8_t size_t secret_len

Definition at line 647 of file ffi.h.

Referenced by botan_kdf(), and Botan::hkdf_expand_label().

◆ shift

const botan_mp_t size_t shift

◆ sig

const uint8_t sig[]

◆ sig_len

const uint8_t size_t sig_len

◆ source

const botan_mp_t source

◆ source_rng

botan_rng_t source_rng

Definition at line 230 of file ffi.h.

Referenced by botan_rng_reseed_from_rng().

◆ str

const char * str

◆ t

botan_rng_t size_t size_t t

◆ tag_size

size_t* tag_size

◆ test_prob

botan_rng_t size_t test_prob

Definition at line 876 of file ffi.h.

Referenced by botan_mp_is_prime().

◆ time_since_epoch

uint64_t * time_since_epoch

Definition at line 1497 of file ffi.h.

Referenced by botan_x509_cert_not_after(), and botan_x509_cert_not_before().

◆ trusted

Definition at line 1555 of file ffi.h.

Referenced by botan_x509_cert_verify(), and Botan::PKIX::build_all_certificate_paths().

◆ trusted_len

botan_x509_cert_t const botan_x509_cert_t size_t const botan_x509_cert_t size_t trusted_len

Definition at line 1555 of file ffi.h.

Referenced by botan_x509_cert_verify().

◆ trusted_path

botan_x509_cert_t const botan_x509_cert_t size_t const botan_x509_cert_t size_t const char* trusted_path

Definition at line 1555 of file ffi.h.

Referenced by botan_x509_cert_verify().

◆ ug

size_t* ug

Definition at line 461 of file ffi.h.

Referenced by botan_cipher_get_update_granularity().

◆ upper_bound

botan_rng_t const botan_mp_t const botan_mp_t upper_bound

Definition at line 866 of file ffi.h.

Referenced by Botan::clamp(), and Botan::Sodium::randombytes_uniform().

◆ val

uint32_t* val

◆ vec

const uint8_t vec

◆ vec_len

const uint8_t size_t vec_len

Definition at line 795 of file ffi.h.

◆ work_factor

size_t const char botan_rng_t size_t work_factor

◆ x

◆ y