Botan 3.6.1
Crypto and TLS for C&
|
Public Header. More...
#include <stddef.h>
#include <stdint.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_API_VERSION 20240408 |
#define | BOTAN_FFI_DEPRECATED(msg) |
#define | BOTAN_FFI_EXPORT(maj, min) |
#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 |
#define | BOTAN_PRIVKEY_EXPORT_FLAG_RAW 2 |
#define | BOTAN_PUBKEY_DER_FORMAT_SIGNATURE 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_kem_decrypt_struct * | botan_pk_op_kem_decrypt_t |
typedef struct botan_pk_op_kem_encrypt_struct * | botan_pk_op_kem_encrypt_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_srp6_server_session_struct * | botan_srp6_server_session_t |
typedef struct botan_totp_struct * | botan_totp_t |
typedef struct botan_tpm2_ctx_struct * | botan_tpm2_ctx_t |
typedef struct botan_tpm2_session_struct * | botan_tpm2_session_t |
typedef int(* | botan_view_bin_fn) (botan_view_ctx view_ctx, const uint8_t *data, size_t len) |
typedef void * | botan_view_ctx |
typedef int(* | botan_view_str_fn) (botan_view_ctx view_ctx, const char *str, size_t len) |
typedef struct botan_x509_cert_struct * | botan_x509_cert_t |
typedef struct botan_x509_crl_struct * | botan_x509_crl_t |
Functions | |
int | botan_base64_decode (const char *base64_str, size_t in_len, uint8_t *out, size_t *out_len) |
int | botan_base64_encode (const uint8_t *x, size_t len, char *out, size_t *out_len) |
int | botan_bcrypt_generate (uint8_t *out, size_t *out_len, const char *password, botan_rng_t rng, size_t work_factor, uint32_t flags) |
int | botan_bcrypt_is_valid (const char *pass, const char *hash) |
int | botan_block_cipher_block_size (botan_block_cipher_t bc) |
int | botan_block_cipher_clear (botan_block_cipher_t bc) |
int | botan_block_cipher_decrypt_blocks (botan_block_cipher_t bc, const uint8_t in[], uint8_t out[], size_t blocks) |
int | botan_block_cipher_destroy (botan_block_cipher_t bc) |
int | botan_block_cipher_encrypt_blocks (botan_block_cipher_t bc, const uint8_t in[], uint8_t out[], size_t blocks) |
int | botan_block_cipher_get_keyspec (botan_block_cipher_t cipher, size_t *out_minimum_keylength, size_t *out_maximum_keylength, size_t *out_keylength_modulo) |
int | botan_block_cipher_init (botan_block_cipher_t *bc, const char *cipher_name) |
int | botan_block_cipher_name (botan_block_cipher_t cipher, char *name, size_t *name_len) |
int | botan_block_cipher_set_key (botan_block_cipher_t bc, const uint8_t key[], size_t len) |
int | botan_cipher_clear (botan_cipher_t hash) |
int | botan_cipher_destroy (botan_cipher_t cipher) |
int | botan_cipher_get_default_nonce_length (botan_cipher_t cipher, size_t *nl) |
int | botan_cipher_get_ideal_update_granularity (botan_cipher_t cipher, size_t *ug) |
int | botan_cipher_get_keyspec (botan_cipher_t, size_t *min_keylen, size_t *max_keylen, size_t *mod_keylen) |
int | botan_cipher_get_tag_length (botan_cipher_t cipher, size_t *tag_size) |
int | botan_cipher_get_update_granularity (botan_cipher_t cipher, size_t *ug) |
int | botan_cipher_init (botan_cipher_t *cipher, const char *name, uint32_t flags) |
int | botan_cipher_is_authenticated (botan_cipher_t cipher) |
int | botan_cipher_name (botan_cipher_t cipher, char *name, size_t *name_len) |
int | botan_cipher_output_length (botan_cipher_t cipher, size_t in_len, size_t *out_len) |
int | botan_cipher_query_keylen (botan_cipher_t, size_t *out_minimum_keylength, size_t *out_maximum_keylength) |
int | botan_cipher_requires_entire_message (botan_cipher_t cipher) |
int | botan_cipher_reset (botan_cipher_t cipher) |
int | botan_cipher_set_associated_data (botan_cipher_t cipher, const uint8_t *ad, size_t ad_len) |
int | botan_cipher_set_key (botan_cipher_t cipher, const uint8_t *key, size_t key_len) |
int | botan_cipher_start (botan_cipher_t cipher, const uint8_t *nonce, size_t nonce_len) |
int | botan_cipher_update (botan_cipher_t cipher, uint32_t flags, uint8_t output[], size_t output_size, size_t *output_written, const uint8_t input_bytes[], size_t input_size, size_t *input_consumed) |
Encrypt/Decrypt some data and/or finalize the encryption/decryption. | |
int | botan_cipher_valid_nonce_length (botan_cipher_t cipher, size_t nl) |
int | botan_constant_time_compare (const uint8_t *x, const uint8_t *y, size_t len) |
const char * | botan_error_description (int err) |
const char * | botan_error_last_exception_message (void) |
uint32_t | botan_ffi_api_version (void) |
int | botan_ffi_supports_api (uint32_t api_version) |
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_hash_block_size (botan_hash_t hash, size_t *block_size) |
int | botan_hash_clear (botan_hash_t hash) |
int | botan_hash_copy_state (botan_hash_t *dest, botan_hash_t source) |
int | botan_hash_destroy (botan_hash_t hash) |
int | botan_hash_final (botan_hash_t hash, uint8_t out[]) |
int | botan_hash_init (botan_hash_t *hash, const char *hash_name, uint32_t flags) |
int | botan_hash_name (botan_hash_t hash, char *name, size_t *name_len) |
int | botan_hash_output_length (botan_hash_t hash, size_t *output_length) |
int | botan_hash_update (botan_hash_t hash, const uint8_t *in, size_t in_len) |
int | botan_hex_decode (const char *hex_str, size_t in_len, uint8_t *out, size_t *out_len) |
int | botan_hex_encode (const uint8_t *x, size_t len, char *out, 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_kdf (const char *kdf_algo, uint8_t out[], size_t out_len, const uint8_t secret[], size_t secret_len, const uint8_t salt[], size_t salt_len, const uint8_t label[], size_t label_len) |
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_mac_clear (botan_mac_t mac) |
int | botan_mac_destroy (botan_mac_t mac) |
int | botan_mac_final (botan_mac_t mac, uint8_t out[]) |
int | botan_mac_get_keyspec (botan_mac_t mac, size_t *out_minimum_keylength, size_t *out_maximum_keylength, size_t *out_keylength_modulo) |
int | botan_mac_init (botan_mac_t *mac, const char *mac_name, uint32_t flags) |
int | botan_mac_name (botan_mac_t mac, char *name, size_t *name_len) |
int | botan_mac_output_length (botan_mac_t mac, size_t *output_length) |
int | botan_mac_set_key (botan_mac_t mac, const uint8_t *key, size_t key_len) |
int | botan_mac_set_nonce (botan_mac_t mac, const uint8_t *nonce, size_t nonce_len) |
int | botan_mac_update (botan_mac_t mac, const uint8_t *buf, size_t len) |
int | botan_mceies_decrypt (botan_privkey_t mce_key, const char *aead, const uint8_t ct[], size_t ct_len, const uint8_t ad[], size_t ad_len, uint8_t pt[], size_t *pt_len) |
int | botan_mceies_encrypt (botan_pubkey_t mce_key, botan_rng_t rng, const char *aead, const uint8_t pt[], size_t pt_len, const uint8_t ad[], size_t ad_len, uint8_t ct[], size_t *ct_len) |
int | botan_mp_add (botan_mp_t result, botan_mp_t x, botan_mp_t y) |
int | botan_mp_add_u32 (botan_mp_t result, botan_mp_t x, uint32_t y) |
int | botan_mp_clear (botan_mp_t mp) |
int | botan_mp_clear_bit (botan_mp_t n, size_t bit) |
int | botan_mp_cmp (int *result, botan_mp_t x, botan_mp_t y) |
int | botan_mp_destroy (botan_mp_t mp) |
int | botan_mp_div (botan_mp_t quotient, botan_mp_t remainder, botan_mp_t x, botan_mp_t y) |
int | botan_mp_equal (botan_mp_t x, botan_mp_t y) |
int | botan_mp_flip_sign (botan_mp_t mp) |
int | botan_mp_from_bin (botan_mp_t mp, const uint8_t vec[], size_t vec_len) |
int | botan_mp_gcd (botan_mp_t out, botan_mp_t x, botan_mp_t y) |
int | botan_mp_get_bit (botan_mp_t n, size_t bit) |
int | botan_mp_init (botan_mp_t *mp) |
int | botan_mp_is_even (botan_mp_t mp) |
int | botan_mp_is_negative (botan_mp_t mp) |
int | botan_mp_is_odd (botan_mp_t mp) |
int | botan_mp_is_positive (botan_mp_t mp) |
int | botan_mp_is_prime (botan_mp_t n, botan_rng_t rng, size_t test_prob) |
int | botan_mp_is_zero (botan_mp_t mp) |
int | botan_mp_lshift (botan_mp_t out, botan_mp_t in, size_t shift) |
int | botan_mp_mod_inverse (botan_mp_t out, botan_mp_t in, botan_mp_t modulus) |
int | botan_mp_mod_mul (botan_mp_t result, botan_mp_t x, botan_mp_t y, botan_mp_t mod) |
int | botan_mp_mul (botan_mp_t result, botan_mp_t x, botan_mp_t y) |
int | botan_mp_num_bits (botan_mp_t n, size_t *bits) |
int | botan_mp_num_bytes (botan_mp_t n, size_t *bytes) |
int | botan_mp_powmod (botan_mp_t out, botan_mp_t base, botan_mp_t exponent, botan_mp_t modulus) |
int | botan_mp_rand_bits (botan_mp_t rand_out, botan_rng_t rng, size_t bits) |
int | botan_mp_rand_range (botan_mp_t rand_out, botan_rng_t rng, botan_mp_t lower_bound, botan_mp_t upper_bound) |
int | botan_mp_rshift (botan_mp_t out, botan_mp_t in, size_t shift) |
int | botan_mp_set_bit (botan_mp_t n, size_t bit) |
int | botan_mp_set_from_int (botan_mp_t mp, int initial_value) |
int | botan_mp_set_from_mp (botan_mp_t dest, botan_mp_t source) |
int | botan_mp_set_from_radix_str (botan_mp_t dest, const char *str, size_t radix) |
int | botan_mp_set_from_str (botan_mp_t dest, const char *str) |
int | botan_mp_sub (botan_mp_t result, botan_mp_t x, botan_mp_t y) |
int | botan_mp_sub_u32 (botan_mp_t result, botan_mp_t x, uint32_t y) |
int | botan_mp_swap (botan_mp_t x, botan_mp_t y) |
int | botan_mp_to_bin (botan_mp_t mp, uint8_t vec[]) |
int | botan_mp_to_hex (botan_mp_t mp, char *out) |
int | botan_mp_to_str (botan_mp_t mp, uint8_t base, char *out, size_t *out_len) |
int | botan_mp_to_uint32 (botan_mp_t mp, uint32_t *val) |
int | botan_nist_kw_dec (const char *cipher_algo, int padded, 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_nist_kw_enc (const char *cipher_algo, int padded, 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_pbkdf (const char *pbkdf_algo, uint8_t out[], size_t out_len, const char *passphrase, const uint8_t salt[], size_t salt_len, size_t iterations) |
int | botan_pbkdf_timed (const char *pbkdf_algo, uint8_t out[], size_t out_len, const char *passphrase, const uint8_t salt[], size_t salt_len, size_t milliseconds_to_run, size_t *out_iterations_used) |
int | botan_pk_op_decrypt (botan_pk_op_decrypt_t op, uint8_t out[], size_t *out_len, const uint8_t ciphertext[], size_t ciphertext_len) |
int | botan_pk_op_decrypt_create (botan_pk_op_decrypt_t *op, botan_privkey_t key, const char *padding, uint32_t flags) |
int | botan_pk_op_decrypt_destroy (botan_pk_op_decrypt_t op) |
int | botan_pk_op_decrypt_output_length (botan_pk_op_decrypt_t op, size_t ctext_len, size_t *ptext_len) |
int | botan_pk_op_encrypt (botan_pk_op_encrypt_t op, botan_rng_t rng, uint8_t out[], size_t *out_len, const uint8_t plaintext[], size_t plaintext_len) |
int | botan_pk_op_encrypt_create (botan_pk_op_encrypt_t *op, botan_pubkey_t key, const char *padding, uint32_t flags) |
int | botan_pk_op_encrypt_destroy (botan_pk_op_encrypt_t op) |
int | botan_pk_op_encrypt_output_length (botan_pk_op_encrypt_t op, size_t ptext_len, size_t *ctext_len) |
int | botan_pk_op_kem_decrypt_create (botan_pk_op_kem_decrypt_t *op, botan_privkey_t key, const char *kdf) |
int | botan_pk_op_kem_decrypt_destroy (botan_pk_op_kem_decrypt_t op) |
int | botan_pk_op_kem_decrypt_shared_key (botan_pk_op_kem_decrypt_t op, const uint8_t salt[], size_t salt_len, const uint8_t encapsulated_key[], size_t encapsulated_key_len, size_t desired_shared_key_len, uint8_t shared_key[], size_t *shared_key_len) |
int | botan_pk_op_kem_decrypt_shared_key_length (botan_pk_op_kem_decrypt_t op, size_t desired_shared_key_length, size_t *output_shared_key_length) |
int | botan_pk_op_kem_encrypt_create (botan_pk_op_kem_encrypt_t *op, botan_pubkey_t key, const char *kdf) |
int | botan_pk_op_kem_encrypt_create_shared_key (botan_pk_op_kem_encrypt_t op, botan_rng_t rng, const uint8_t salt[], size_t salt_len, size_t desired_shared_key_len, uint8_t shared_key[], size_t *shared_key_len, uint8_t encapsulated_key[], size_t *encapsulated_key_len) |
int | botan_pk_op_kem_encrypt_destroy (botan_pk_op_kem_encrypt_t op) |
int | botan_pk_op_kem_encrypt_encapsulated_key_length (botan_pk_op_kem_encrypt_t op, size_t *output_encapsulated_key_length) |
int | botan_pk_op_kem_encrypt_shared_key_length (botan_pk_op_kem_encrypt_t op, size_t desired_shared_key_length, size_t *output_shared_key_length) |
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_key_agreement_destroy (botan_pk_op_ka_t op) |
int | botan_pk_op_key_agreement_export_public (botan_privkey_t key, uint8_t out[], size_t *out_len) |
int | botan_pk_op_key_agreement_size (botan_pk_op_ka_t op, size_t *out_len) |
int | botan_pk_op_key_agreement_view_public (botan_privkey_t key, botan_view_ctx ctx, botan_view_bin_fn view) |
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_destroy (botan_pk_op_sign_t op) |
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_sign_output_length (botan_pk_op_sign_t op, size_t *olen) |
int | botan_pk_op_sign_update (botan_pk_op_sign_t op, const uint8_t in[], size_t in_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_pk_op_verify_destroy (botan_pk_op_verify_t op) |
int | botan_pk_op_verify_finish (botan_pk_op_verify_t op, const uint8_t sig[], size_t sig_len) |
int | botan_pk_op_verify_update (botan_pk_op_verify_t op, const uint8_t in[], size_t in_len) |
int | botan_pkcs_hash_id (const char *hash_name, uint8_t pkcs_id[], size_t *pkcs_id_len) |
int | botan_privkey_algo_name (botan_privkey_t key, char out[], size_t *out_len) |
int | botan_privkey_check_key (botan_privkey_t key, botan_rng_t rng, uint32_t flags) |
int | botan_privkey_create (botan_privkey_t *key, const char *algo_name, const char *algo_params, botan_rng_t rng) |
int | botan_privkey_create_dh (botan_privkey_t *key, botan_rng_t rng, const char *param) |
int | botan_privkey_create_dsa (botan_privkey_t *key, botan_rng_t rng, size_t pbits, size_t qbits) |
int | botan_privkey_create_ecdh (botan_privkey_t *key, botan_rng_t rng, const char *params) |
int | botan_privkey_create_ecdsa (botan_privkey_t *key, botan_rng_t rng, const char *params) |
int | botan_privkey_create_elgamal (botan_privkey_t *key, botan_rng_t rng, size_t pbits, size_t qbits) |
int | botan_privkey_create_mceliece (botan_privkey_t *key, botan_rng_t rng, size_t n, size_t t) |
int | botan_privkey_create_rsa (botan_privkey_t *key, botan_rng_t rng, size_t n_bits) |
int | botan_privkey_destroy (botan_privkey_t key) |
int | botan_privkey_dsa_get_x (botan_mp_t n, botan_privkey_t key) |
int | botan_privkey_ed25519_get_privkey (botan_privkey_t key, uint8_t output[64]) |
int | botan_privkey_ed448_get_privkey (botan_privkey_t key, uint8_t output[57]) |
int | botan_privkey_export (botan_privkey_t key, uint8_t out[], size_t *out_len, uint32_t flags) |
int | botan_privkey_export_encrypted (botan_privkey_t key, uint8_t out[], size_t *out_len, botan_rng_t rng, const char *passphrase, const char *encryption_algo, uint32_t flags) |
int | botan_privkey_export_encrypted_pbkdf_iter (botan_privkey_t key, uint8_t out[], size_t *out_len, botan_rng_t rng, const char *passphrase, size_t pbkdf_iterations, const char *cipher_algo, const char *pbkdf_algo, uint32_t flags) |
int | botan_privkey_export_encrypted_pbkdf_msec (botan_privkey_t key, uint8_t out[], size_t *out_len, botan_rng_t rng, const char *passphrase, uint32_t pbkdf_msec_runtime, size_t *pbkdf_iterations_out, const char *cipher_algo, const char *pbkdf_algo, uint32_t flags) |
int | botan_privkey_export_pubkey (botan_pubkey_t *out, botan_privkey_t in) |
int | botan_privkey_get_field (botan_mp_t output, botan_privkey_t key, const char *field_name) |
int | botan_privkey_load (botan_privkey_t *key, botan_rng_t rng, const uint8_t bits[], size_t len, const char *password) |
int | botan_privkey_load_dh (botan_privkey_t *key, botan_mp_t p, botan_mp_t g, botan_mp_t x) |
int | botan_privkey_load_dsa (botan_privkey_t *key, botan_mp_t p, botan_mp_t q, botan_mp_t g, botan_mp_t x) |
int | botan_privkey_load_ecdh (botan_privkey_t *key, botan_mp_t scalar, const char *curve_name) |
int | botan_privkey_load_ecdsa (botan_privkey_t *key, botan_mp_t scalar, const char *curve_name) |
int | botan_privkey_load_ed25519 (botan_privkey_t *key, const uint8_t privkey[32]) |
int | botan_privkey_load_ed448 (botan_privkey_t *key, const uint8_t privkey[57]) |
int | botan_privkey_load_elgamal (botan_privkey_t *key, botan_mp_t p, botan_mp_t g, botan_mp_t x) |
int | botan_privkey_load_frodokem (botan_privkey_t *key, const uint8_t privkey[], size_t key_len, const char *frodo_mode) |
int | botan_privkey_load_kyber (botan_privkey_t *key, const uint8_t privkey[], size_t key_len) |
int | botan_privkey_load_ml_dsa (botan_privkey_t *key, const uint8_t privkey[], size_t key_len, const char *mldsa_mode) |
int | botan_privkey_load_ml_kem (botan_privkey_t *key, const uint8_t privkey[], size_t key_len, const char *mlkem_mode) |
int | botan_privkey_load_rsa (botan_privkey_t *key, botan_mp_t p, botan_mp_t q, botan_mp_t e) |
int | botan_privkey_load_rsa_pkcs1 (botan_privkey_t *key, const uint8_t bits[], size_t len) |
int | botan_privkey_load_slh_dsa (botan_privkey_t *key, const uint8_t privkey[], size_t key_len, const char *slhdsa_mode) |
int | botan_privkey_load_sm2 (botan_privkey_t *key, botan_mp_t scalar, const char *curve_name) |
int | botan_privkey_load_sm2_enc (botan_privkey_t *key, botan_mp_t scalar, const char *curve_name) |
int | botan_privkey_load_x25519 (botan_privkey_t *key, const uint8_t privkey[32]) |
int | botan_privkey_load_x448 (botan_privkey_t *key, const uint8_t privkey[56]) |
int | botan_privkey_rsa_get_d (botan_mp_t d, botan_privkey_t rsa_key) |
int | botan_privkey_rsa_get_e (botan_mp_t e, botan_privkey_t rsa_key) |
int | botan_privkey_rsa_get_n (botan_mp_t n, botan_privkey_t rsa_key) |
int | botan_privkey_rsa_get_p (botan_mp_t p, botan_privkey_t rsa_key) |
int | botan_privkey_rsa_get_privkey (botan_privkey_t rsa_key, uint8_t out[], size_t *out_len, uint32_t flags) |
int | botan_privkey_rsa_get_q (botan_mp_t q, botan_privkey_t rsa_key) |
int | botan_privkey_view_der (botan_privkey_t key, botan_view_ctx ctx, botan_view_bin_fn view) |
int | botan_privkey_view_encrypted_der (botan_privkey_t key, botan_rng_t rng, const char *passphrase, const char *cipher_algo, const char *pbkdf_algo, size_t pbkdf_iterations, botan_view_ctx ctx, botan_view_bin_fn view) |
int | botan_privkey_view_encrypted_der_timed (botan_privkey_t key, botan_rng_t rng, const char *passphrase, const char *cipher_algo, const char *pbkdf_algo, size_t pbkdf_runtime_msec, botan_view_ctx ctx, botan_view_bin_fn view) |
int | botan_privkey_view_encrypted_pem (botan_privkey_t key, botan_rng_t rng, const char *passphrase, const char *cipher_algo, const char *pbkdf_algo, size_t pbkdf_iterations, botan_view_ctx ctx, botan_view_str_fn view) |
int | botan_privkey_view_encrypted_pem_timed (botan_privkey_t key, botan_rng_t rng, const char *passphrase, const char *cipher_algo, const char *pbkdf_algo, size_t pbkdf_runtime_msec, botan_view_ctx ctx, botan_view_str_fn view) |
int | botan_privkey_view_kyber_raw_key (botan_privkey_t key, botan_view_ctx ctx, botan_view_bin_fn view) |
int | botan_privkey_view_pem (botan_privkey_t key, botan_view_ctx ctx, botan_view_str_fn view) |
int | botan_privkey_view_raw (botan_privkey_t key, botan_view_ctx ctx, botan_view_bin_fn view) |
int | botan_privkey_x25519_get_privkey (botan_privkey_t key, uint8_t output[32]) |
int | botan_privkey_x448_get_privkey (botan_privkey_t key, uint8_t output[56]) |
int | botan_pubkey_algo_name (botan_pubkey_t key, char out[], size_t *out_len) |
int | botan_pubkey_check_key (botan_pubkey_t key, botan_rng_t rng, uint32_t flags) |
int | botan_pubkey_destroy (botan_pubkey_t key) |
int | botan_pubkey_dsa_get_g (botan_mp_t d, botan_pubkey_t key) |
int | botan_pubkey_dsa_get_p (botan_mp_t p, botan_pubkey_t key) |
int | botan_pubkey_dsa_get_q (botan_mp_t q, botan_pubkey_t key) |
int | botan_pubkey_dsa_get_y (botan_mp_t y, botan_pubkey_t key) |
int | botan_pubkey_ecc_key_used_explicit_encoding (botan_pubkey_t key) |
int | botan_pubkey_ed25519_get_pubkey (botan_pubkey_t key, uint8_t pubkey[32]) |
int | botan_pubkey_ed448_get_pubkey (botan_pubkey_t key, uint8_t pubkey[57]) |
int | botan_pubkey_estimated_strength (botan_pubkey_t key, size_t *estimate) |
int | botan_pubkey_export (botan_pubkey_t key, uint8_t out[], size_t *out_len, uint32_t flags) |
int | botan_pubkey_fingerprint (botan_pubkey_t key, const char *hash, uint8_t out[], size_t *out_len) |
int | botan_pubkey_get_field (botan_mp_t output, botan_pubkey_t key, const char *field_name) |
int | botan_pubkey_load (botan_pubkey_t *key, const uint8_t bits[], size_t len) |
int | botan_pubkey_load_dh (botan_pubkey_t *key, botan_mp_t p, botan_mp_t g, botan_mp_t y) |
int | botan_pubkey_load_dsa (botan_pubkey_t *key, botan_mp_t p, botan_mp_t q, botan_mp_t g, botan_mp_t y) |
int | botan_pubkey_load_ecdh (botan_pubkey_t *key, botan_mp_t public_x, botan_mp_t public_y, const char *curve_name) |
int | botan_pubkey_load_ecdsa (botan_pubkey_t *key, botan_mp_t public_x, botan_mp_t public_y, const char *curve_name) |
int | botan_pubkey_load_ed25519 (botan_pubkey_t *key, const uint8_t pubkey[32]) |
int | botan_pubkey_load_ed448 (botan_pubkey_t *key, const uint8_t pubkey[57]) |
int | botan_pubkey_load_elgamal (botan_pubkey_t *key, botan_mp_t p, botan_mp_t g, botan_mp_t y) |
int | botan_pubkey_load_frodokem (botan_pubkey_t *key, const uint8_t pubkey[], size_t key_len, const char *frodo_mode) |
int | botan_pubkey_load_kyber (botan_pubkey_t *key, const uint8_t pubkey[], size_t key_len) |
int | botan_pubkey_load_ml_dsa (botan_pubkey_t *key, const uint8_t pubkey[], size_t key_len, const char *mldsa_mode) |
int | botan_pubkey_load_ml_kem (botan_pubkey_t *key, const uint8_t pubkey[], size_t key_len, const char *mlkem_mode) |
int | botan_pubkey_load_rsa (botan_pubkey_t *key, botan_mp_t n, botan_mp_t e) |
int | botan_pubkey_load_slh_dsa (botan_pubkey_t *key, const uint8_t pubkey[], size_t key_len, const char *slhdsa_mode) |
int | botan_pubkey_load_sm2 (botan_pubkey_t *key, botan_mp_t public_x, botan_mp_t public_y, const char *curve_name) |
int | botan_pubkey_load_sm2_enc (botan_pubkey_t *key, botan_mp_t public_x, botan_mp_t public_y, const char *curve_name) |
int | botan_pubkey_load_x25519 (botan_pubkey_t *key, const uint8_t pubkey[32]) |
int | botan_pubkey_load_x448 (botan_pubkey_t *key, const uint8_t pubkey[56]) |
int | botan_pubkey_rsa_get_e (botan_mp_t e, botan_pubkey_t rsa_key) |
int | botan_pubkey_rsa_get_n (botan_mp_t n, botan_pubkey_t rsa_key) |
int | botan_pubkey_sm2_compute_za (uint8_t out[], size_t *out_len, const char *ident, const char *hash_algo, botan_pubkey_t key) |
int | botan_pubkey_view_der (botan_pubkey_t key, botan_view_ctx ctx, botan_view_bin_fn view) |
int | botan_pubkey_view_ec_public_point (botan_pubkey_t key, botan_view_ctx ctx, botan_view_bin_fn view) |
int | botan_pubkey_view_kyber_raw_key (botan_pubkey_t key, botan_view_ctx ctx, botan_view_bin_fn view) |
int | botan_pubkey_view_pem (botan_pubkey_t key, botan_view_ctx ctx, botan_view_str_fn view) |
int | botan_pubkey_view_raw (botan_pubkey_t key, botan_view_ctx ctx, botan_view_bin_fn view) |
int | botan_pubkey_x25519_get_pubkey (botan_pubkey_t key, uint8_t pubkey[32]) |
int | botan_pubkey_x448_get_pubkey (botan_pubkey_t key, uint8_t pubkey[56]) |
int | botan_pwdhash (const char *algo, size_t param1, size_t param2, size_t param3, uint8_t out[], size_t out_len, const char *passphrase, size_t passphrase_len, const uint8_t salt[], size_t salt_len) |
int | botan_pwdhash_timed (const char *algo, uint32_t msec, size_t *param1, size_t *param2, size_t *param3, uint8_t out[], size_t out_len, const char *passphrase, size_t passphrase_len, const uint8_t salt[], size_t salt_len) |
int | botan_rng_add_entropy (botan_rng_t rng, const uint8_t *entropy, size_t entropy_len) |
int | botan_rng_destroy (botan_rng_t rng) |
int | botan_rng_get (botan_rng_t rng, uint8_t *out, size_t out_len) |
int | botan_rng_init (botan_rng_t *rng, const char *rng_type) |
int | botan_rng_init_custom (botan_rng_t *rng_out, const char *rng_name, void *context, int(*get_cb)(void *context, uint8_t *out, size_t out_len), int(*add_entropy_cb)(void *context, const uint8_t input[], size_t length), void(*destroy_cb)(void *context)) |
int | botan_rng_reseed (botan_rng_t rng, size_t bits) |
int | botan_rng_reseed_from_rng (botan_rng_t rng, botan_rng_t source_rng, size_t bits) |
int | botan_same_mem (const uint8_t *x, const uint8_t *y, size_t len) |
int | botan_scrub_mem (void *mem, size_t bytes) |
int | botan_scrypt (uint8_t out[], size_t out_len, const char *passphrase, const uint8_t salt[], size_t salt_len, size_t N, size_t r, size_t p) |
int | botan_srp6_client_agree (const char *username, const char *password, const char *group_id, const char *hash_id, const uint8_t salt[], size_t salt_len, const uint8_t B[], size_t B_len, botan_rng_t rng_obj, uint8_t A[], size_t *A_len, uint8_t K[], size_t *K_len) |
int | botan_srp6_generate_verifier (const char *identifier, const char *password, const uint8_t salt[], size_t salt_len, const char *group_id, const char *hash_id, uint8_t verifier[], size_t *verifier_len) |
int | botan_srp6_group_size (const char *group_id, size_t *group_p_bytes) |
int | botan_srp6_server_session_destroy (botan_srp6_server_session_t srp6) |
int | botan_srp6_server_session_init (botan_srp6_server_session_t *srp6) |
int | botan_srp6_server_session_step1 (botan_srp6_server_session_t srp6, const uint8_t verifier[], size_t verifier_len, const char *group_id, const char *hash_id, botan_rng_t rng_obj, uint8_t B_pub[], size_t *B_pub_len) |
int | botan_srp6_server_session_step2 (botan_srp6_server_session_t srp6, const uint8_t A[], size_t A_len, uint8_t key[], size_t *key_len) |
int | botan_system_rng_get (uint8_t *out, size_t out_len) |
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_tpm2_ctx_destroy (botan_tpm2_ctx_t ctx) |
int | botan_tpm2_ctx_enable_crypto_backend (botan_tpm2_ctx_t ctx, botan_rng_t rng) |
int | botan_tpm2_ctx_init (botan_tpm2_ctx_t *ctx_out, const char *tcti_nameconf) |
int | botan_tpm2_ctx_init_ex (botan_tpm2_ctx_t *ctx_out, const char *tcti_name, const char *tcti_conf) |
int | botan_tpm2_rng_init (botan_rng_t *rng_out, botan_tpm2_ctx_t ctx, botan_tpm2_session_t s1, botan_tpm2_session_t s2, botan_tpm2_session_t s3) |
int | botan_tpm2_session_destroy (botan_tpm2_session_t session) |
int | botan_tpm2_supports_crypto_backend () |
int | botan_tpm2_unauthenticated_session_init (botan_tpm2_session_t *session_out, botan_tpm2_ctx_t ctx) |
uint32_t | botan_version_datestamp (void) |
uint32_t | botan_version_major (void) |
uint32_t | botan_version_minor (void) |
uint32_t | botan_version_patch (void) |
const char * | botan_version_string (void) |
int | botan_x509_cert_allowed_usage (botan_x509_cert_t cert, unsigned int key_usage) |
int | botan_x509_cert_destroy (botan_x509_cert_t cert) |
int | botan_x509_cert_dup (botan_x509_cert_t *new_cert, botan_x509_cert_t cert) |
int | botan_x509_cert_get_authority_key_id (botan_x509_cert_t cert, uint8_t out[], size_t *out_len) |
int | botan_x509_cert_get_fingerprint (botan_x509_cert_t cert, const char *hash, uint8_t out[], size_t *out_len) |
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_public_key (botan_x509_cert_t cert, botan_pubkey_t *key) |
int | botan_x509_cert_get_public_key_bits (botan_x509_cert_t cert, uint8_t out[], size_t *out_len) |
int | botan_x509_cert_get_serial_number (botan_x509_cert_t cert, 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) |
int | botan_x509_cert_get_subject_key_id (botan_x509_cert_t cert, uint8_t out[], size_t *out_len) |
int | botan_x509_cert_get_time_expires (botan_x509_cert_t cert, char out[], size_t *out_len) |
int | botan_x509_cert_get_time_starts (botan_x509_cert_t cert, char out[], size_t *out_len) |
int | botan_x509_cert_hostname_match (botan_x509_cert_t cert, const char *hostname) |
int | botan_x509_cert_load (botan_x509_cert_t *cert_obj, const uint8_t cert[], size_t cert_len) |
int | botan_x509_cert_load_file (botan_x509_cert_t *cert_obj, const char *filename) |
int | botan_x509_cert_not_after (botan_x509_cert_t cert, uint64_t *time_since_epoch) |
int | botan_x509_cert_not_before (botan_x509_cert_t cert, uint64_t *time_since_epoch) |
int | botan_x509_cert_to_string (botan_x509_cert_t cert, char out[], size_t *out_len) |
const char * | botan_x509_cert_validation_status (int code) |
int | botan_x509_cert_verify (int *validation_result, botan_x509_cert_t cert, const botan_x509_cert_t *intermediates, size_t intermediates_len, const botan_x509_cert_t *trusted, size_t trusted_len, const char *trusted_path, size_t required_strength, const char *hostname, uint64_t reference_time) |
int | botan_x509_cert_verify_with_crl (int *validation_result, botan_x509_cert_t cert, const botan_x509_cert_t *intermediates, size_t intermediates_len, const botan_x509_cert_t *trusted, size_t trusted_len, const botan_x509_crl_t *crls, size_t crls_len, const char *trusted_path, size_t required_strength, const char *hostname, uint64_t reference_time) |
int | botan_x509_cert_view_as_string (botan_x509_cert_t cert, botan_view_ctx ctx, botan_view_str_fn view) |
int | botan_x509_cert_view_public_key_bits (botan_x509_cert_t cert, botan_view_ctx ctx, botan_view_bin_fn view) |
int | botan_x509_crl_destroy (botan_x509_crl_t crl) |
int | botan_x509_crl_load (botan_x509_crl_t *crl_obj, const uint8_t crl_bits[], size_t crl_bits_len) |
int | botan_x509_crl_load_file (botan_x509_crl_t *crl_obj, const char *crl_path) |
int | botan_x509_is_revoked (botan_x509_crl_t crl, botan_x509_cert_t cert) |
int | botan_zfec_decode (size_t K, size_t N, const size_t *indexes, uint8_t *const *inputs, size_t shareSize, uint8_t **outputs) |
int | botan_zfec_encode (size_t K, size_t N, const uint8_t *input, size_t size, uint8_t **outputs) |
Public Header.
Definition in file ffi.h.
#define BOTAN_CHECK_KEY_EXPENSIVE_TESTS 1 |
Definition at line 1110 of file ffi.h.
Referenced by botan_privkey_check_key(), and botan_pubkey_check_key().
#define BOTAN_CIPHER_INIT_FLAG_ENCRYPT 0 |
Definition at line 539 of file ffi.h.
Referenced by botan_cipher_init().
#define BOTAN_CIPHER_INIT_FLAG_MASK_DIRECTION 1 |
Definition at line 538 of file ffi.h.
Referenced by botan_cipher_init().
#define BOTAN_CIPHER_UPDATE_FLAG_FINAL (1U << 0) |
Definition at line 633 of file ffi.h.
Referenced by botan_cipher_update().
#define BOTAN_FFI_API_VERSION 20240408 |
The compile time API version. This matches the value of botan_ffi_api_version. This can be used for compile-time checking if a particular feature is available.
Note this same value is also reflected in BOTAN_HAS_FFI in build.h, however that declaration is not visible here since this header is intentionally free-standing, depending only on a few C standard library headers.
#define BOTAN_FFI_EXPORT | ( | maj, | |
min ) |
#define BOTAN_FFI_HEX_LOWER_CASE 1 |
Definition at line 237 of file ffi.h.
Referenced by botan_hex_encode().
#define BOTAN_FPE_FLAG_FE1_COMPAT_MODE 1 |
Definition at line 2082 of file ffi.h.
Referenced by botan_fpe_fe1_init().
#define BOTAN_PRIVKEY_EXPORT_FLAG_DER 0 |
Definition at line 1180 of file ffi.h.
Referenced by botan_privkey_export(), botan_privkey_export_encrypted_pbkdf_iter(), botan_privkey_export_encrypted_pbkdf_msec(), botan_privkey_rsa_get_privkey(), and botan_pubkey_export().
#define BOTAN_PRIVKEY_EXPORT_FLAG_PEM 1 |
Definition at line 1181 of file ffi.h.
Referenced by botan_privkey_export(), botan_privkey_export_encrypted_pbkdf_iter(), botan_privkey_export_encrypted_pbkdf_msec(), botan_privkey_rsa_get_privkey(), and botan_pubkey_export().
#define BOTAN_PRIVKEY_EXPORT_FLAG_RAW 2 |
Definition at line 1182 of file ffi.h.
Referenced by botan_privkey_export(), and botan_pubkey_export().
#define BOTAN_PUBKEY_DER_FORMAT_SIGNATURE 1 |
Definition at line 1669 of file ffi.h.
Referenced by botan_pk_op_encrypt_create(), botan_pk_op_sign_create(), and botan_pk_op_verify_create().
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_kem_decrypt_struct* botan_pk_op_kem_decrypt_t |
typedef struct botan_pk_op_kem_encrypt_struct* botan_pk_op_kem_encrypt_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_srp6_server_session_struct* botan_srp6_server_session_t |
typedef struct botan_totp_struct* botan_totp_t |
typedef struct botan_tpm2_ctx_struct* botan_tpm2_ctx_t |
typedef struct botan_tpm2_session_struct* botan_tpm2_session_t |
typedef int(* botan_view_bin_fn) (botan_view_ctx view_ctx, const uint8_t *data, size_t len) |
typedef void* botan_view_ctx |
typedef int(* botan_view_str_fn) (botan_view_ctx view_ctx, const char *str, size_t len) |
typedef struct botan_x509_cert_struct* botan_x509_cert_t |
typedef struct botan_x509_crl_struct* botan_x509_crl_t |
enum BOTAN_FFI_ERROR |
Error codes
If you add a new value here be sure to also add it in botan_error_description
Definition at line 113 of file ffi.h.
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 1880 of file ffi.h.
int botan_base64_decode | ( | const char * | base64_str, |
size_t | in_len, | ||
uint8_t * | out, | ||
size_t * | out_len ) |
Perform base64 decoding
Definition at line 335 of file ffi.cpp.
References Botan::base64_decode(), Botan::base64_decode_max_output(), BOTAN_FFI_ERROR_INSUFFICIENT_BUFFER_SPACE, BOTAN_FFI_SUCCESS, and Botan_FFI::ffi_guard_thunk().
int botan_base64_encode | ( | const uint8_t * | x, |
size_t | len, | ||
char * | out, | ||
size_t * | out_len ) |
Perform base64 encoding
Definition at line 328 of file ffi.cpp.
References Botan::base64_encode(), Botan_FFI::ffi_guard_thunk(), and Botan_FFI::write_str_output().
int botan_bcrypt_generate | ( | uint8_t * | out, |
size_t * | out_len, | ||
const char * | password, | ||
botan_rng_t | rng, | ||
size_t | work_factor, | ||
uint32_t | flags ) |
Create a password hash using Bcrypt
out | buffer holding the password hash, should be of length 64 bytes |
out_len | the desired output length in bytes |
password | the password |
rng | a random number generator |
work_factor | how much work to do to slow down guessing attacks |
flags | should be 0 in current API revision, all other uses are reserved and return BOTAN_FFI_ERROR_BAD_FLAG |
Output is formatted bcrypt $2a$...
Definition at line 157 of file ffi_kdf.cpp.
References BOTAN_FFI_ERROR_BAD_FLAG, BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_INSUFFICIENT_BUFFER_SPACE, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), Botan::generate_bcrypt(), Botan_FFI::safe_get(), and Botan_FFI::write_str_output().
int botan_bcrypt_is_valid | ( | const char * | pass, |
const char * | hash ) |
Check a previously created password hash
pass | the password to check against |
hash | the stored hash to check against |
Definition at line 188 of file ffi_kdf.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_INVALID_VERIFIER, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, Botan::check_bcrypt(), and Botan_FFI::ffi_guard_thunk().
int botan_block_cipher_block_size | ( | botan_block_cipher_t | bc | ) |
Return the positive block size of this block cipher, or negative to indicate an error
Definition at line 61 of file ffi_block.cpp.
References BOTAN_FFI_VISIT.
int botan_block_cipher_clear | ( | botan_block_cipher_t | bc | ) |
Reinitializes the block cipher
Definition at line 43 of file ffi_block.cpp.
References BOTAN_FFI_VISIT.
int botan_block_cipher_decrypt_blocks | ( | botan_block_cipher_t | bc, |
const uint8_t | in[], | ||
uint8_t | out[], | ||
size_t | blocks ) |
Decrypt one or more blocks with the cipher
Definition at line 72 of file ffi_block.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, and BOTAN_FFI_VISIT.
int botan_block_cipher_destroy | ( | botan_block_cipher_t | bc | ) |
Destroy a block cipher object
Destroy a block cipher object
Definition at line 39 of file ffi_block.cpp.
References BOTAN_FFI_CHECKED_DELETE.
int botan_block_cipher_encrypt_blocks | ( | botan_block_cipher_t | bc, |
const uint8_t | in[], | ||
uint8_t | out[], | ||
size_t | blocks ) |
Encrypt one or more blocks with the cipher
Definition at line 65 of file ffi_block.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, and BOTAN_FFI_VISIT.
int botan_block_cipher_get_keyspec | ( | botan_block_cipher_t | cipher, |
size_t * | out_minimum_keylength, | ||
size_t * | out_maximum_keylength, | ||
size_t * | out_keylength_modulo ) |
Get the key length limits of this block cipher
cipher | the object to read |
out_minimum_keylength | if non-NULL, will be set to minimum keylength of cipher |
out_maximum_keylength | if non-NULL, will be set to maximum keylength of cipher |
out_keylength_modulo | if non-NULL will be set to byte multiple of valid keys |
Definition at line 87 of file ffi_block.cpp.
References BOTAN_FFI_VISIT.
int botan_block_cipher_init | ( | botan_block_cipher_t * | bc, |
const char * | cipher_name ) |
Initialize a block cipher object
Definition at line 18 of file ffi_block.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, Botan::BlockCipher::create(), and Botan_FFI::ffi_guard_thunk().
int botan_block_cipher_name | ( | botan_block_cipher_t | cipher, |
char * | name, | ||
size_t * | name_len ) |
Get the name of this block cipher
cipher | the object to read |
name | output buffer |
name_len | on input, the length of buffer, on success the number of bytes written |
Definition at line 79 of file ffi_block.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_VISIT, name, and Botan_FFI::write_str_output().
int botan_block_cipher_set_key | ( | botan_block_cipher_t | bc, |
const uint8_t | key[], | ||
size_t | len ) |
Set the key for a block cipher instance
Definition at line 50 of file ffi_block.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, and BOTAN_FFI_VISIT.
int botan_cipher_clear | ( | botan_cipher_t | hash | ) |
Reset the key, nonce, AD and all other state on this cipher object
Definition at line 118 of file ffi_cipher.cpp.
References BOTAN_FFI_VISIT.
int botan_cipher_destroy | ( | botan_cipher_t | cipher | ) |
Destroy the cipher object
Definition at line 114 of file ffi_cipher.cpp.
References BOTAN_FFI_CHECKED_DELETE.
int botan_cipher_get_default_nonce_length | ( | botan_cipher_t | cipher, |
size_t * | nl ) |
Get the default nonce length of this cipher
Definition at line 299 of file ffi_cipher.cpp.
References BOTAN_FFI_VISIT.
int botan_cipher_get_ideal_update_granularity | ( | botan_cipher_t | cipher, |
size_t * | ug ) |
Return the ideal update granularity of the cipher. This is some multiple of the update granularity, reflecting possibilities for optimization.
Definition at line 307 of file ffi_cipher.cpp.
References BOTAN_FFI_VISIT.
int botan_cipher_get_keyspec | ( | botan_cipher_t | cipher, |
size_t * | min_keylen, | ||
size_t * | max_keylen, | ||
size_t * | mod_keylen ) |
Get information about the supported key lengths.
Definition at line 141 of file ffi_cipher.cpp.
References BOTAN_FFI_VISIT.
int botan_cipher_get_tag_length | ( | botan_cipher_t | cipher, |
size_t * | tag_size ) |
Get the tag length of the cipher (0 for non-AEAD modes)
Definition at line 311 of file ffi_cipher.cpp.
References BOTAN_FFI_VISIT.
int botan_cipher_get_update_granularity | ( | botan_cipher_t | cipher, |
size_t * | ug ) |
Return the update granularity of the cipher; botan_cipher_update must be called with blocks of this size, except for the final.
Definition at line 303 of file ffi_cipher.cpp.
References BOTAN_FFI_VISIT.
int botan_cipher_init | ( | botan_cipher_t * | cipher, |
const char * | name, | ||
uint32_t | flags ) |
Initialize a cipher object
Definition at line 96 of file ffi_cipher.cpp.
References BOTAN_CIPHER_INIT_FLAG_ENCRYPT, BOTAN_CIPHER_INIT_FLAG_MASK_DIRECTION, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_SUCCESS, Botan::Cipher_Mode::create(), Botan::Decryption, Botan::Encryption, and Botan_FFI::ffi_guard_thunk().
int botan_cipher_is_authenticated | ( | botan_cipher_t | cipher | ) |
Returns 1 iff the cipher provides authentication as well as confidentiality.
Definition at line 315 of file ffi_cipher.cpp.
References BOTAN_FFI_VISIT.
int botan_cipher_name | ( | botan_cipher_t | cipher, |
char * | name, | ||
size_t * | name_len ) |
Return the name of the cipher object
Definition at line 323 of file ffi_cipher.cpp.
References BOTAN_FFI_VISIT, name, and Botan_FFI::write_str_output().
int botan_cipher_output_length | ( | botan_cipher_t | cipher, |
size_t | in_len, | ||
size_t * | out_len ) |
Return the output length of this cipher, for a particular input length.
Definition at line 126 of file ffi_cipher.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, and BOTAN_FFI_VISIT.
int botan_cipher_query_keylen | ( | botan_cipher_t | cipher, |
size_t * | out_minimum_keylength, | ||
size_t * | out_maximum_keylength ) |
Get information about the key lengths. Prefer botan_cipher_get_keyspec
Definition at line 134 of file ffi_cipher.cpp.
References BOTAN_FFI_VISIT.
int botan_cipher_requires_entire_message | ( | botan_cipher_t | cipher | ) |
Returns 1 iff the cipher requires the entire message before any encryption or decryption can be performed. No output data will be produced in botan_cipher_update() until the final flag is set.
Definition at line 319 of file ffi_cipher.cpp.
References BOTAN_FFI_VISIT.
int botan_cipher_reset | ( | botan_cipher_t | cipher | ) |
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.
Definition at line 122 of file ffi_cipher.cpp.
References BOTAN_FFI_VISIT.
int botan_cipher_set_associated_data | ( | botan_cipher_t | cipher, |
const uint8_t * | ad, | ||
size_t | ad_len ) |
Set the associated data. Will fail if cipher is not an AEAD
Definition at line 285 of file ffi_cipher.cpp.
References BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_SUCCESS, and BOTAN_FFI_VISIT.
int botan_cipher_set_key | ( | botan_cipher_t | cipher, |
const uint8_t * | key, | ||
size_t | key_len ) |
Set the key for this cipher object
Definition at line 155 of file ffi_cipher.cpp.
References BOTAN_FFI_VISIT.
int botan_cipher_start | ( | botan_cipher_t | cipher, |
const uint8_t * | nonce, | ||
size_t | nonce_len ) |
Begin processing a new message using the provided nonce
Definition at line 159 of file ffi_cipher.cpp.
References BOTAN_FFI_SUCCESS, Botan_FFI::ffi_guard_thunk(), Botan_FFI::safe_get(), and Botan::Cipher_Mode::start().
int botan_cipher_update | ( | botan_cipher_t | cipher, |
uint32_t | flags, | ||
uint8_t | output[], | ||
size_t | output_size, | ||
size_t * | output_written, | ||
const uint8_t | input_bytes[], | ||
size_t | input_size, | ||
size_t * | input_consumed ) |
Encrypt/Decrypt some data and/or finalize the encryption/decryption.
This encrypts as many bytes from input_bytes
into output_bytes
as possible. Unless BOTAN_CIPHER_UPDATE_FLAG_FINAL
is set, this function will consume bytes in multiples of botan_cipher_get_update_granularity(). input_consumed
and output_written
will be set accordingly and it is the caller's responsibility to adapt their buffers accordingly before calling this function again. Note that, unless BOTAN_CIPHER_UPDATE_FLAG_FINAL
is set, the cipher will at most generate input_size
output bytes.
Eventually, the caller must set the BOTAN_CIPHER_UPDATE_FLAG_FINAL
flag to indicate that no more input will be provided. This will cause the cipher to consume all given input bytes and produce the final output; or return a BOTAN_FFI_ERROR_INSUFFICIENT_BUFFER_SPACE
error if the given output buffer was too small. In the latter case, output_written
will be set to the required buffer size. Calling again with BOTAN_CIPHER_UPDATE_FLAG_FINAL
, a big enough buffer and no further input will then produce the final output.
Note that some ciphers require the entire message to be provided before any output is produced.
Definition at line 167 of file ffi_cipher.cpp.
References BOTAN_ASSERT_NOMSG, BOTAN_CIPHER_UPDATE_FLAG_FINAL, BOTAN_DEBUG_ASSERT, BOTAN_FFI_ERROR_BAD_MAC, BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_INSUFFICIENT_BUFFER_SPACE, BOTAN_FFI_ERROR_INVALID_OBJECT_STATE, BOTAN_FFI_SUCCESS, Botan_FFI::ffi_guard_thunk(), Botan::Cipher_Mode::finish(), Botan::Cipher_Mode::process(), Botan::Cipher_Mode::requires_entire_message(), and Botan_FFI::safe_get().
int botan_cipher_valid_nonce_length | ( | botan_cipher_t | cipher, |
size_t | nl ) |
Return if the specified nonce length is valid for this cipher
Definition at line 295 of file ffi_cipher.cpp.
References BOTAN_FFI_VISIT.
int botan_constant_time_compare | ( | const uint8_t * | x, |
const uint8_t * | y, | ||
size_t | len ) |
Returns 0 if x[0..len] == y[0..len], or otherwise -1
Definition at line 298 of file ffi.cpp.
References Botan::CT::is_equal().
Referenced by botan_same_mem().
const char * botan_error_description | ( | int | err | ) |
Convert an error code into a string. Returns "Unknown error" if the error code is not a known one.
Definition at line 146 of file ffi.cpp.
References BOTAN_FFI_ERROR_BAD_FLAG, BOTAN_FFI_ERROR_BAD_MAC, BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_EXCEPTION_THROWN, BOTAN_FFI_ERROR_HTTP_ERROR, BOTAN_FFI_ERROR_INSUFFICIENT_BUFFER_SPACE, BOTAN_FFI_ERROR_INTERNAL_ERROR, BOTAN_FFI_ERROR_INVALID_INPUT, BOTAN_FFI_ERROR_INVALID_KEY_LENGTH, BOTAN_FFI_ERROR_INVALID_OBJECT, BOTAN_FFI_ERROR_INVALID_OBJECT_STATE, BOTAN_FFI_ERROR_KEY_NOT_SET, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_ERROR_OUT_OF_MEMORY, BOTAN_FFI_ERROR_STRING_CONVERSION_ERROR, BOTAN_FFI_ERROR_SYSTEM_ERROR, BOTAN_FFI_ERROR_TLS_ERROR, BOTAN_FFI_ERROR_UNKNOWN_ERROR, BOTAN_FFI_INVALID_VERIFIER, and BOTAN_FFI_SUCCESS.
const char * botan_error_last_exception_message | ( | void | ) |
Return the message of the last exception caught in this thread.
This pointer can/will be reallocated or overwritten the next time this thread calls any other Botan FFI function and must be copied to persistent storage first.
Definition at line 142 of file ffi.cpp.
References Botan_FFI::g_last_exception_what.
uint32_t botan_ffi_api_version | ( | void | ) |
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.
Definition at line 219 of file ffi.cpp.
References BOTAN_HAS_FFI.
int botan_ffi_supports_api | ( | uint32_t | api_version | ) |
Return 0 (ok) if the version given is one this library supports. botan_ffi_supports_api(botan_ffi_api_version()) will always return 0.
Definition at line 223 of file ffi.cpp.
References BOTAN_FFI_SUCCESS.
int botan_fpe_decrypt | ( | botan_fpe_t | fpe, |
botan_mp_t | x, | ||
const uint8_t | tweak[], | ||
size_t | tweak_len ) |
Definition at line 78 of file ffi_fpe.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), and Botan_FFI::safe_get().
int botan_fpe_destroy | ( | botan_fpe_t | fpe | ) |
Definition at line 56 of file ffi_fpe.cpp.
References BOTAN_FFI_CHECKED_DELETE, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, and BOTAN_UNUSED.
int botan_fpe_encrypt | ( | botan_fpe_t | fpe, |
botan_mp_t | x, | ||
const uint8_t | tweak[], | ||
size_t | tweak_len ) |
Definition at line 65 of file ffi_fpe.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), and Botan_FFI::safe_get().
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 27 of file ffi_fpe.cpp.
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_UNUSED, Botan_FFI::ffi_guard_thunk(), and Botan_FFI::safe_get().
int botan_hash_block_size | ( | botan_hash_t | hash, |
size_t * | block_size ) |
Writes the block size of the hash function to *block_size
hash | hash object |
block_size | output buffer to hold the hash function output length |
Definition at line 48 of file ffi_hash.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, and BOTAN_FFI_VISIT.
int botan_hash_clear | ( | botan_hash_t | hash | ) |
Reinitializes the state of the hash computation. A hash can be computed (with update/final) immediately.
hash | hash object |
Definition at line 55 of file ffi_hash.cpp.
References BOTAN_FFI_VISIT.
int botan_hash_copy_state | ( | botan_hash_t * | dest, |
botan_hash_t | source ) |
Copy the state of a hash function object
dest | destination hash object |
source | source hash object |
Definition at line 78 of file ffi_hash.cpp.
References BOTAN_FFI_VISIT.
int botan_hash_destroy | ( | botan_hash_t | hash | ) |
Frees all resources of the hash object
hash | hash object |
Definition at line 37 of file ffi_hash.cpp.
References BOTAN_FFI_CHECKED_DELETE.
int botan_hash_final | ( | botan_hash_t | hash, |
uint8_t | out[] ) |
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.
hash | hash object |
out | output buffer |
Definition at line 71 of file ffi_hash.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, and BOTAN_FFI_VISIT.
int botan_hash_init | ( | botan_hash_t * | hash, |
const char * | hash_name, | ||
uint32_t | flags ) |
Initialize a hash function object
hash | hash object |
hash_name | name of the hash function, e.g., "SHA-384" |
flags | should be 0 in current API revision, all other uses are reserved and return BOTAN_FFI_ERROR_BAD_FLAG |
Definition at line 18 of file ffi_hash.cpp.
References BOTAN_FFI_ERROR_BAD_FLAG, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, Botan::HashFunction::create(), and Botan_FFI::ffi_guard_thunk().
int botan_hash_name | ( | botan_hash_t | hash, |
char * | name, | ||
size_t * | name_len ) |
Get the name of this hash function
hash | the object to read |
name | output buffer |
name_len | on input, the length of buffer, on success the number of bytes written |
Definition at line 82 of file ffi_hash.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_VISIT, name, and Botan_FFI::write_str_output().
int botan_hash_output_length | ( | botan_hash_t | hash, |
size_t * | output_length ) |
Writes the output length of the hash function to *output_length
hash | hash object |
output_length | output buffer to hold the hash function output length |
Definition at line 41 of file ffi_hash.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, and BOTAN_FFI_VISIT.
int botan_hash_update | ( | botan_hash_t | hash, |
const uint8_t * | in, | ||
size_t | in_len ) |
Send more input to the hash function
hash | hash object |
in | input buffer |
in_len | number of bytes to read from the input buffer |
Definition at line 59 of file ffi_hash.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, and BOTAN_FFI_VISIT.
int botan_hex_decode | ( | const char * | hex_str, |
size_t | in_len, | ||
uint8_t * | out, | ||
size_t * | out_len ) |
Perform hex decoding
hex_str | a string of hex chars (whitespace is ignored) |
in_len | the length of hex_str |
out | the output buffer should be at least strlen(hex_str)/2 bytes |
out_len | the size of the output buffer on input, set to the number of bytes written |
Definition at line 321 of file ffi.cpp.
References Botan_FFI::ffi_guard_thunk(), Botan::hex_decode(), and Botan_FFI::write_vec_output().
int botan_hex_encode | ( | const uint8_t * | x, |
size_t | len, | ||
char * | out, | ||
uint32_t | flags ) |
Perform hex encoding
x | is some binary data |
len | length of x in bytes |
out | an array of at least x*2 bytes |
flags | flags out be upper or lower case? |
Definition at line 313 of file ffi.cpp.
References BOTAN_FFI_HEX_LOWER_CASE, BOTAN_FFI_SUCCESS, Botan_FFI::ffi_guard_thunk(), and Botan::hex_encode().
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 68 of file ffi_hotp.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_INVALID_VERIFIER, BOTAN_FFI_SUCCESS, BOTAN_FFI_VISIT, and BOTAN_UNUSED.
int botan_hotp_destroy | ( | botan_hotp_t | hotp | ) |
Destroy a HOTP instance
Definition at line 45 of file ffi_hotp.cpp.
References BOTAN_FFI_CHECKED_DELETE, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, and BOTAN_UNUSED.
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 54 of file ffi_hotp.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_VISIT, and BOTAN_UNUSED.
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 25 of file ffi_hotp.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, and Botan_FFI::ffi_guard_thunk().
int botan_kdf | ( | const char * | kdf_algo, |
uint8_t | out[], | ||
size_t | out_len, | ||
const uint8_t | secret[], | ||
size_t | secret_len, | ||
const uint8_t | salt[], | ||
size_t | salt_len, | ||
const uint8_t | label[], | ||
size_t | label_len ) |
Derive a key
kdf_algo | KDF algorithm, e.g., "SP800-56C" |
out | buffer holding the derived key, must be of length out_len |
out_len | the desired output length in bytes |
secret | the secret input |
secret_len | size of secret in bytes |
salt | a diversifier |
salt_len | size of salt in bytes |
label | purpose for the derived keying material |
label_len | size of label in bytes |
Definition at line 130 of file ffi_kdf.cpp.
References BOTAN_FFI_SUCCESS, Botan::KDF::create_or_throw(), and Botan_FFI::ffi_guard_thunk().
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 97 of file ffi_keywrap.cpp.
References botan_nist_kw_dec().
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 86 of file ffi_keywrap.cpp.
References botan_nist_kw_enc().
int botan_mac_clear | ( | botan_mac_t | mac | ) |
Reinitializes the state of the MAC computation. A MAC can be computed (with update/final) immediately.
mac | mac object |
Definition at line 51 of file ffi_mac.cpp.
References BOTAN_FFI_VISIT.
int botan_mac_destroy | ( | botan_mac_t | mac | ) |
Frees all resources of the MAC object
mac | mac object |
Definition at line 35 of file ffi_mac.cpp.
References BOTAN_FFI_CHECKED_DELETE.
int botan_mac_final | ( | botan_mac_t | mac, |
uint8_t | out[] ) |
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.
mac | mac object |
out | output buffer |
Definition at line 59 of file ffi_mac.cpp.
References BOTAN_FFI_VISIT.
int botan_mac_get_keyspec | ( | botan_mac_t | mac, |
size_t * | out_minimum_keylength, | ||
size_t * | out_maximum_keylength, | ||
size_t * | out_keylength_modulo ) |
Get the key length limits of this auth code
mac | the object to read |
out_minimum_keylength | if non-NULL, will be set to minimum keylength of MAC |
out_maximum_keylength | if non-NULL, will be set to maximum keylength of MAC |
out_keylength_modulo | if non-NULL will be set to byte multiple of valid keys |
Definition at line 67 of file ffi_mac.cpp.
References BOTAN_FFI_VISIT.
int botan_mac_init | ( | botan_mac_t * | mac, |
const char * | mac_name, | ||
uint32_t | flags ) |
Initialize a message authentication code object
mac | mac object |
mac_name | name of the hash function, e.g., "HMAC(SHA-384)" |
flags | should be 0 in current API revision, all other uses are reserved and return a negative value (error code) |
Definition at line 18 of file ffi_mac.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, Botan::MessageAuthenticationCode::create(), and Botan_FFI::ffi_guard_thunk().
int botan_mac_name | ( | botan_mac_t | mac, |
char * | name, | ||
size_t * | name_len ) |
Get the name of this MAC
mac | the object to read |
name | output buffer |
name_len | on input, the length of buffer, on success the number of bytes written |
Definition at line 63 of file ffi_mac.cpp.
References BOTAN_FFI_VISIT, name, and Botan_FFI::write_str_output().
int botan_mac_output_length | ( | botan_mac_t | mac, |
size_t * | output_length ) |
Writes the output length of the message authentication code to *output_length
mac | mac object |
output_length | output buffer to hold the MAC output length |
Definition at line 47 of file ffi_mac.cpp.
References BOTAN_FFI_VISIT.
int botan_mac_set_key | ( | botan_mac_t | mac, |
const uint8_t * | key, | ||
size_t | key_len ) |
Sets the key on the MAC
mac | mac object |
key | buffer holding the key |
key_len | size of the key buffer in bytes |
Definition at line 39 of file ffi_mac.cpp.
References BOTAN_FFI_VISIT.
int botan_mac_set_nonce | ( | botan_mac_t | mac, |
const uint8_t * | nonce, | ||
size_t | nonce_len ) |
Sets the nonce on the MAC
mac | mac object |
nonce | buffer holding the key |
nonce_len | size of the key buffer in bytes |
Definition at line 43 of file ffi_mac.cpp.
References BOTAN_FFI_VISIT.
int botan_mac_update | ( | botan_mac_t | mac, |
const uint8_t * | buf, | ||
size_t | len ) |
Send more input to the message authentication code
mac | mac object |
buf | input buffer |
len | number of bytes to read from the input buffer |
Definition at line 55 of file ffi_mac.cpp.
References BOTAN_FFI_VISIT.
int botan_mceies_decrypt | ( | botan_privkey_t | mce_key, |
const char * | aead, | ||
const uint8_t | ct[], | ||
size_t | ct_len, | ||
const uint8_t | ad[], | ||
size_t | ad_len, | ||
uint8_t | pt[], | ||
size_t * | pt_len ) |
Definition at line 1267 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, and BOTAN_UNUSED.
int botan_mceies_encrypt | ( | botan_pubkey_t | mce_key, |
botan_rng_t | rng, | ||
const char * | aead, | ||
const uint8_t | pt[], | ||
size_t | pt_len, | ||
const uint8_t | ad[], | ||
size_t | ad_len, | ||
uint8_t | ct[], | ||
size_t * | ct_len ) |
Definition at line 1279 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, and BOTAN_UNUSED.
int botan_mp_add | ( | botan_mp_t | result, |
botan_mp_t | x, | ||
botan_mp_t | y ) |
Definition at line 116 of file ffi_mp.cpp.
References BOTAN_FFI_VISIT, and Botan_FFI::safe_get().
int botan_mp_add_u32 | ( | botan_mp_t | result, |
botan_mp_t | x, | ||
uint32_t | y ) |
Definition at line 134 of file ffi_mp.cpp.
References BOTAN_FFI_VISIT, and Botan_FFI::safe_get().
int botan_mp_clear | ( | botan_mp_t | mp | ) |
int botan_mp_clear_bit | ( | botan_mp_t | n, |
size_t | bit ) |
int botan_mp_cmp | ( | int * | result, |
botan_mp_t | x, | ||
botan_mp_t | y ) |
Definition at line 185 of file ffi_mp.cpp.
References BOTAN_FFI_VISIT, and Botan_FFI::safe_get().
int botan_mp_destroy | ( | botan_mp_t | mp | ) |
Destroy (deallocate) an MPI
Definition at line 112 of file ffi_mp.cpp.
References BOTAN_FFI_CHECKED_DELETE.
int botan_mp_div | ( | botan_mp_t | quotient, |
botan_mp_t | remainder, | ||
botan_mp_t | x, | ||
botan_mp_t | y ) |
Definition at line 161 of file ffi_mp.cpp.
References BOTAN_FFI_VISIT, Botan_FFI::safe_get(), and Botan::vartime_divide().
int botan_mp_equal | ( | botan_mp_t | x, |
botan_mp_t | y ) |
Definition at line 169 of file ffi_mp.cpp.
References BOTAN_FFI_VISIT, and Botan_FFI::safe_get().
int botan_mp_flip_sign | ( | botan_mp_t | mp | ) |
Definition at line 75 of file ffi_mp.cpp.
References BOTAN_FFI_VISIT.
int botan_mp_from_bin | ( | botan_mp_t | mp, |
const uint8_t | vec[], | ||
size_t | vec_len ) |
Definition at line 79 of file ffi_mp.cpp.
References BOTAN_FFI_VISIT.
int botan_mp_gcd | ( | botan_mp_t | out, |
botan_mp_t | x, | ||
botan_mp_t | y ) |
Definition at line 227 of file ffi_mp.cpp.
References BOTAN_FFI_VISIT, Botan::gcd(), and Botan_FFI::safe_get().
int botan_mp_get_bit | ( | botan_mp_t | n, |
size_t | bit ) |
Returns 0 if specified bit of n is not set Returns 1 if specified bit of n is set Returns negative number on error
Definition at line 235 of file ffi_mp.cpp.
References BOTAN_FFI_VISIT.
int botan_mp_init | ( | botan_mp_t * | mp | ) |
Initialize an MPI
Definition at line 21 of file ffi_mp.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, and Botan_FFI::ffi_guard_thunk().
int botan_mp_is_even | ( | botan_mp_t | mp | ) |
Definition at line 181 of file ffi_mp.cpp.
References BOTAN_FFI_VISIT.
int botan_mp_is_negative | ( | botan_mp_t | mp | ) |
Return 1 iff mp is less than 0
Definition at line 67 of file ffi_mp.cpp.
References BOTAN_FFI_VISIT.
int botan_mp_is_odd | ( | botan_mp_t | mp | ) |
Definition at line 177 of file ffi_mp.cpp.
References BOTAN_FFI_VISIT.
int botan_mp_is_positive | ( | botan_mp_t | mp | ) |
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.
Definition at line 71 of file ffi_mp.cpp.
References BOTAN_FFI_VISIT.
int botan_mp_is_prime | ( | botan_mp_t | n, |
botan_rng_t | rng, | ||
size_t | test_prob ) |
Returns 0 if n is not prime Returns 1 if n is prime Returns negative number on error
Definition at line 231 of file ffi_mp.cpp.
References BOTAN_FFI_VISIT, Botan::is_prime(), and Botan_FFI::safe_get().
int botan_mp_is_zero | ( | botan_mp_t | mp | ) |
Definition at line 173 of file ffi_mp.cpp.
References BOTAN_FFI_VISIT.
int botan_mp_lshift | ( | botan_mp_t | out, |
botan_mp_t | in, | ||
size_t | shift ) |
Definition at line 199 of file ffi_mp.cpp.
References BOTAN_FFI_VISIT, and Botan_FFI::safe_get().
int botan_mp_mod_inverse | ( | botan_mp_t | out, |
botan_mp_t | in, | ||
botan_mp_t | modulus ) |
Definition at line 207 of file ffi_mp.cpp.
References BOTAN_FFI_VISIT, Botan::inverse_mod(), and Botan_FFI::safe_get().
int botan_mp_mod_mul | ( | botan_mp_t | result, |
botan_mp_t | x, | ||
botan_mp_t | y, | ||
botan_mp_t | mod ) |
Definition at line 211 of file ffi_mp.cpp.
References BOTAN_FFI_VISIT, Botan::Modular_Reducer::multiply(), and Botan_FFI::safe_get().
int botan_mp_mul | ( | botan_mp_t | result, |
botan_mp_t | x, | ||
botan_mp_t | y ) |
Definition at line 152 of file ffi_mp.cpp.
References BOTAN_FFI_VISIT, and Botan_FFI::safe_get().
int botan_mp_num_bits | ( | botan_mp_t | n, |
size_t * | bits ) |
Return the number of significant bits in the MPI
Definition at line 247 of file ffi_mp.cpp.
References BOTAN_FFI_VISIT.
int botan_mp_num_bytes | ( | botan_mp_t | n, |
size_t * | bytes ) |
Return the number of significant bytes in the MPI
Definition at line 251 of file ffi_mp.cpp.
References BOTAN_FFI_VISIT.
int botan_mp_powmod | ( | botan_mp_t | out, |
botan_mp_t | base, | ||
botan_mp_t | exponent, | ||
botan_mp_t | modulus ) |
Definition at line 194 of file ffi_mp.cpp.
References BOTAN_FFI_VISIT, Botan::power_mod(), and Botan_FFI::safe_get().
int botan_mp_rand_bits | ( | botan_mp_t | rand_out, |
botan_rng_t | rng, | ||
size_t | bits ) |
Definition at line 218 of file ffi_mp.cpp.
References BOTAN_FFI_VISIT, and Botan_FFI::safe_get().
int botan_mp_rand_range | ( | botan_mp_t | rand_out, |
botan_rng_t | rng, | ||
botan_mp_t | lower_bound, | ||
botan_mp_t | upper_bound ) |
Definition at line 222 of file ffi_mp.cpp.
References BOTAN_FFI_VISIT, Botan::BigInt::random_integer(), and Botan_FFI::safe_get().
int botan_mp_rshift | ( | botan_mp_t | out, |
botan_mp_t | in, | ||
size_t | shift ) |
Definition at line 203 of file ffi_mp.cpp.
References BOTAN_FFI_VISIT, and Botan_FFI::safe_get().
int botan_mp_set_bit | ( | botan_mp_t | n, |
size_t | bit ) |
int botan_mp_set_from_int | ( | botan_mp_t | mp, |
int | initial_value ) |
Set the MPI value from an int
Definition at line 37 of file ffi_mp.cpp.
References BOTAN_FFI_VISIT, and Botan::BigInt::from_s32().
int botan_mp_set_from_mp | ( | botan_mp_t | dest, |
botan_mp_t | source ) |
Set the MPI value from another MP object
Definition at line 63 of file ffi_mp.cpp.
References BOTAN_FFI_VISIT, and Botan_FFI::safe_get().
int botan_mp_set_from_radix_str | ( | botan_mp_t | dest, |
const char * | str, | ||
size_t | radix ) |
Set the MPI value from a string with arbitrary radix. For arbitrary being 10 or 16.
Definition at line 45 of file ffi_mp.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_SUCCESS, BOTAN_FFI_VISIT, Botan::cast_char_ptr_to_uint8(), Botan::BigInt::Decimal, and Botan::BigInt::Hexadecimal.
int botan_mp_set_from_str | ( | botan_mp_t | dest, |
const char * | str ) |
Set the MPI value from a string
Definition at line 41 of file ffi_mp.cpp.
References BOTAN_FFI_VISIT.
int botan_mp_sub | ( | botan_mp_t | result, |
botan_mp_t | x, | ||
botan_mp_t | y ) |
Definition at line 125 of file ffi_mp.cpp.
References BOTAN_FFI_VISIT, and Botan_FFI::safe_get().
int botan_mp_sub_u32 | ( | botan_mp_t | result, |
botan_mp_t | x, | ||
uint32_t | y ) |
Definition at line 143 of file ffi_mp.cpp.
References BOTAN_FFI_VISIT, and Botan_FFI::safe_get().
int botan_mp_swap | ( | botan_mp_t | x, |
botan_mp_t | y ) |
Definition at line 189 of file ffi_mp.cpp.
References BOTAN_FFI_VISIT, and Botan_FFI::safe_get().
int botan_mp_to_bin | ( | botan_mp_t | mp, |
uint8_t | vec[] ) |
Definition at line 101 of file ffi_mp.cpp.
References BOTAN_FFI_VISIT.
int botan_mp_to_hex | ( | botan_mp_t | mp, |
char * | out ) |
Convert the MPI to a hex string. Writes botan_mp_num_bytes(mp)*2 + 1 bytes
Definition at line 83 of file ffi_mp.cpp.
References BOTAN_FFI_VISIT.
int botan_mp_to_str | ( | botan_mp_t | mp, |
uint8_t | base, | ||
char * | out, | ||
size_t * | out_len ) |
Convert the MPI to a string. Currently base == 10 and base == 16 are supported.
Definition at line 90 of file ffi_mp.cpp.
References BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_VISIT, and Botan_FFI::write_str_output().
int botan_mp_to_uint32 | ( | botan_mp_t | mp, |
uint32_t * | val ) |
Definition at line 105 of file ffi_mp.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, and BOTAN_FFI_VISIT.
int botan_nist_kw_dec | ( | const char * | cipher_algo, |
int | padded, | ||
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 53 of file ffi_keywrap.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_UNUSED, Botan::BlockCipher::create_or_throw(), Botan_FFI::ffi_guard_thunk(), Botan::nist_key_unwrap(), Botan::nist_key_unwrap_padded(), and Botan_FFI::write_vec_output().
Referenced by botan_key_unwrap3394().
int botan_nist_kw_enc | ( | const char * | cipher_algo, |
int | padded, | ||
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 ) |
Definition at line 21 of file ffi_keywrap.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_UNUSED, Botan::BlockCipher::create_or_throw(), Botan_FFI::ffi_guard_thunk(), Botan::nist_key_wrap(), Botan::nist_key_wrap_padded(), and Botan_FFI::write_vec_output().
Referenced by botan_key_wrap3394().
int botan_pbkdf | ( | const char * | pbkdf_algo, |
uint8_t | out[], | ||
size_t | out_len, | ||
const char * | passphrase, | ||
const uint8_t | salt[], | ||
size_t | salt_len, | ||
size_t | iterations ) |
Definition at line 22 of file ffi_kdf.cpp.
References botan_pwdhash().
int botan_pbkdf_timed | ( | const char * | pbkdf_algo, |
uint8_t | out[], | ||
size_t | out_len, | ||
const char * | passphrase, | ||
const uint8_t | salt[], | ||
size_t | salt_len, | ||
size_t | milliseconds_to_run, | ||
size_t * | out_iterations_used ) |
Derive a key from a passphrase, running until msec time has elapsed.
pbkdf_algo | PBKDF algorithm, e.g., "PBKDF2(SHA-256)" |
out | buffer to store the derived key, must be of out_len bytes |
out_len | the desired length of the key to produce |
passphrase | the password to derive the key from |
salt | a randomly chosen salt |
salt_len | length of salt in bytes |
milliseconds_to_run | if iterations is zero, then instead the PBKDF is run until milliseconds_to_run milliseconds has passed |
out_iterations_used | set to the number iterations executed |
Deprecated: use
botan_pwdhash_timed(pbkdf_algo, static_cast<uint32_t>(ms_to_run), iterations_used, nullptr, nullptr, out, out_len, password, 0, salt, salt_len);
Definition at line 32 of file ffi_kdf.cpp.
References botan_pwdhash_timed().
int botan_pk_op_decrypt | ( | botan_pk_op_decrypt_t | op, |
uint8_t | out[], | ||
size_t * | out_len, | ||
const uint8_t | ciphertext[], | ||
size_t | ciphertext_len ) |
Definition at line 103 of file ffi_pk_op.cpp.
References BOTAN_FFI_VISIT, and Botan_FFI::write_vec_output().
int botan_pk_op_decrypt_create | ( | botan_pk_op_decrypt_t * | op, |
botan_privkey_t | key, | ||
const char * | padding, | ||
uint32_t | flags ) |
Definition at line 71 of file ffi_pk_op.cpp.
References BOTAN_FFI_ERROR_BAD_FLAG, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, Botan_FFI::ffi_guard_thunk(), Botan_FFI::safe_get(), and Botan::system_rng().
int botan_pk_op_decrypt_destroy | ( | botan_pk_op_decrypt_t | op | ) |
Definition at line 92 of file ffi_pk_op.cpp.
References BOTAN_FFI_CHECKED_DELETE.
int botan_pk_op_decrypt_output_length | ( | botan_pk_op_decrypt_t | op, |
size_t | ctext_len, | ||
size_t * | ptext_len ) |
Definition at line 96 of file ffi_pk_op.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, and BOTAN_FFI_VISIT.
int botan_pk_op_encrypt | ( | botan_pk_op_encrypt_t | op, |
botan_rng_t | rng, | ||
uint8_t | out[], | ||
size_t * | out_len, | ||
const uint8_t | plaintext[], | ||
size_t | plaintext_len ) |
Definition at line 57 of file ffi_pk_op.cpp.
References BOTAN_FFI_VISIT, Botan_FFI::safe_get(), and Botan_FFI::write_vec_output().
int botan_pk_op_encrypt_create | ( | botan_pk_op_encrypt_t * | op, |
botan_pubkey_t | key, | ||
const char * | padding, | ||
uint32_t | flags ) |
Definition at line 28 of file ffi_pk_op.cpp.
References BOTAN_FFI_ERROR_BAD_FLAG, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_PUBKEY_DER_FORMAT_SIGNATURE, Botan_FFI::ffi_guard_thunk(), Botan_FFI::safe_get(), and Botan::system_rng().
int botan_pk_op_encrypt_destroy | ( | botan_pk_op_encrypt_t | op | ) |
Definition at line 46 of file ffi_pk_op.cpp.
References BOTAN_FFI_CHECKED_DELETE.
int botan_pk_op_encrypt_output_length | ( | botan_pk_op_encrypt_t | op, |
size_t | ptext_len, | ||
size_t * | ctext_len ) |
Definition at line 50 of file ffi_pk_op.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, and BOTAN_FFI_VISIT.
int botan_pk_op_kem_decrypt_create | ( | botan_pk_op_kem_decrypt_t * | op, |
botan_privkey_t | key, | ||
const char * | kdf ) |
Definition at line 309 of file ffi_pk_op.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, Botan_FFI::ffi_guard_thunk(), Botan_FFI::safe_get(), and Botan::system_rng().
int botan_pk_op_kem_decrypt_destroy | ( | botan_pk_op_kem_decrypt_t | op | ) |
Definition at line 350 of file ffi_pk_op.cpp.
References BOTAN_FFI_CHECKED_DELETE.
int botan_pk_op_kem_decrypt_shared_key | ( | botan_pk_op_kem_decrypt_t | op, |
const uint8_t | salt[], | ||
size_t | salt_len, | ||
const uint8_t | encapsulated_key[], | ||
size_t | encapsulated_key_len, | ||
size_t | desired_shared_key_len, | ||
uint8_t | shared_key[], | ||
size_t * | shared_key_len ) |
Definition at line 334 of file ffi_pk_op.cpp.
References BOTAN_FFI_VISIT, and Botan_FFI::write_vec_output().
int botan_pk_op_kem_decrypt_shared_key_length | ( | botan_pk_op_kem_decrypt_t | op, |
size_t | desired_shared_key_length, | ||
size_t * | output_shared_key_length ) |
Definition at line 321 of file ffi_pk_op.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, and BOTAN_FFI_VISIT.
int botan_pk_op_kem_encrypt_create | ( | botan_pk_op_kem_encrypt_t * | op, |
botan_pubkey_t | key, | ||
const char * | kdf ) |
Definition at line 247 of file ffi_pk_op.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, Botan_FFI::ffi_guard_thunk(), and Botan_FFI::safe_get().
int botan_pk_op_kem_encrypt_create_shared_key | ( | botan_pk_op_kem_encrypt_t | op, |
botan_rng_t | rng, | ||
const uint8_t | salt[], | ||
size_t | salt_len, | ||
size_t | desired_shared_key_len, | ||
uint8_t | shared_key[], | ||
size_t * | shared_key_len, | ||
uint8_t | encapsulated_key[], | ||
size_t * | encapsulated_key_len ) |
Definition at line 288 of file ffi_pk_op.cpp.
References BOTAN_FFI_VISIT, Botan_FFI::safe_get(), and Botan_FFI::write_vec_output().
int botan_pk_op_kem_encrypt_destroy | ( | botan_pk_op_kem_encrypt_t | op | ) |
Definition at line 259 of file ffi_pk_op.cpp.
References BOTAN_FFI_CHECKED_DELETE.
int botan_pk_op_kem_encrypt_encapsulated_key_length | ( | botan_pk_op_kem_encrypt_t | op, |
size_t * | output_encapsulated_key_length ) |
Definition at line 276 of file ffi_pk_op.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, and BOTAN_FFI_VISIT.
int botan_pk_op_kem_encrypt_shared_key_length | ( | botan_pk_op_kem_encrypt_t | op, |
size_t | desired_shared_key_length, | ||
size_t * | output_shared_key_length ) |
Definition at line 263 of file ffi_pk_op.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, and BOTAN_FFI_VISIT.
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 234 of file ffi_pk_op.cpp.
References BOTAN_FFI_VISIT, and Botan_FFI::write_vec_output().
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 191 of file ffi_pk_op.cpp.
References BOTAN_FFI_ERROR_BAD_FLAG, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, Botan_FFI::ffi_guard_thunk(), Botan_FFI::safe_get(), and Botan::system_rng().
int botan_pk_op_key_agreement_destroy | ( | botan_pk_op_ka_t | op | ) |
Definition at line 208 of file ffi_pk_op.cpp.
References BOTAN_FFI_CHECKED_DELETE.
int botan_pk_op_key_agreement_export_public | ( | botan_privkey_t | key, |
uint8_t | out[], | ||
size_t * | out_len ) |
Definition at line 212 of file ffi_pk_op.cpp.
References botan_pk_op_key_agreement_view_public(), and Botan_FFI::copy_view_bin().
int botan_pk_op_key_agreement_size | ( | botan_pk_op_ka_t | op, |
size_t * | out_len ) |
Definition at line 225 of file ffi_pk_op.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, and BOTAN_FFI_VISIT.
int botan_pk_op_key_agreement_view_public | ( | botan_privkey_t | key, |
botan_view_ctx | ctx, | ||
botan_view_bin_fn | view ) |
Definition at line 216 of file ffi_pk_op.cpp.
References BOTAN_FFI_ERROR_INVALID_INPUT, BOTAN_FFI_VISIT, and Botan_FFI::invoke_view_callback().
Referenced by botan_pk_op_key_agreement_export_public().
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.
References BOTAN_FFI_ERROR_BAD_FLAG, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_PUBKEY_DER_FORMAT_SIGNATURE, Botan::DerSequence, Botan_FFI::ffi_guard_thunk(), Botan_FFI::safe_get(), Botan::Standard, and Botan::system_rng().
int botan_pk_op_sign_destroy | ( | botan_pk_op_sign_t | op | ) |
Definition at line 133 of file ffi_pk_op.cpp.
References BOTAN_FFI_CHECKED_DELETE.
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 149 of file ffi_pk_op.cpp.
References BOTAN_FFI_VISIT, Botan_FFI::safe_get(), and Botan_FFI::write_vec_output().
int botan_pk_op_sign_output_length | ( | botan_pk_op_sign_t | op, |
size_t * | olen ) |
Definition at line 137 of file ffi_pk_op.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, and BOTAN_FFI_VISIT.
int botan_pk_op_sign_update | ( | botan_pk_op_sign_t | op, |
const uint8_t | in[], | ||
size_t | in_len ) |
Definition at line 145 of file ffi_pk_op.cpp.
References BOTAN_FFI_VISIT.
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 153 of file ffi_pk_op.cpp.
References BOTAN_FFI_ERROR_BAD_FLAG, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_PUBKEY_DER_FORMAT_SIGNATURE, Botan::DerSequence, Botan_FFI::ffi_guard_thunk(), Botan_FFI::safe_get(), and Botan::Standard.
int botan_pk_op_verify_destroy | ( | botan_pk_op_verify_t | op | ) |
Definition at line 172 of file ffi_pk_op.cpp.
References BOTAN_FFI_CHECKED_DELETE.
int botan_pk_op_verify_finish | ( | botan_pk_op_verify_t | op, |
const uint8_t | sig[], | ||
size_t | sig_len ) |
Definition at line 180 of file ffi_pk_op.cpp.
References BOTAN_FFI_INVALID_VERIFIER, BOTAN_FFI_SUCCESS, and BOTAN_FFI_VISIT.
int botan_pk_op_verify_update | ( | botan_pk_op_verify_t | op, |
const uint8_t | in[], | ||
size_t | in_len ) |
Definition at line 176 of file ffi_pk_op.cpp.
References BOTAN_FFI_VISIT.
int botan_pkcs_hash_id | ( | const char * | hash_name, |
uint8_t | pkcs_id[], | ||
size_t * | pkcs_id_len ) |
Signature Scheme Utility Functions
Definition at line 356 of file ffi_pkey.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), Botan::pkcs_hash_id(), and Botan_FFI::write_output().
int botan_privkey_algo_name | ( | botan_privkey_t | key, |
char | out[], | ||
size_t * | out_len ) |
Definition at line 111 of file ffi_pkey.cpp.
References BOTAN_FFI_VISIT, and Botan_FFI::write_str_output().
int botan_privkey_check_key | ( | botan_privkey_t | key, |
botan_rng_t | rng, | ||
uint32_t | flags ) |
Definition at line 127 of file ffi_pkey.cpp.
References BOTAN_CHECK_KEY_EXPENSIVE_TESTS, BOTAN_FFI_ERROR_INVALID_INPUT, BOTAN_FFI_VISIT, and Botan_FFI::safe_get().
int botan_privkey_create | ( | botan_privkey_t * | key, |
const char * | algo_name, | ||
const char * | algo_params, | ||
botan_rng_t | rng ) |
Create a new private key
key | the new object will be placed here |
algo_name | something like "RSA" or "ECDSA" |
algo_params | is specific to the algorithm. For RSA, specifies the modulus bit length. For ECC is the name of the curve. |
rng | a random number generator |
Definition at line 27 of file ffi_pkey.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, Botan::create_private_key(), Botan_FFI::ffi_guard_thunk(), and Botan_FFI::safe_get().
Referenced by botan_privkey_create_dh(), botan_privkey_create_ecdh(), botan_privkey_create_ecdsa(), botan_privkey_create_mceliece(), and botan_privkey_create_rsa().
int botan_privkey_create_dh | ( | botan_privkey_t * | key, |
botan_rng_t | rng, | ||
const char * | param ) |
Definition at line 501 of file ffi_pkey_algs.cpp.
References botan_privkey_create().
int botan_privkey_create_dsa | ( | botan_privkey_t * | key, |
botan_rng_t | rng, | ||
size_t | pbits, | ||
size_t | qbits ) |
Generates DSA key pair. Gives to a caller control over key length and order of a subgroup 'q'.
key | handler to the resulting key |
rng | initialized PRNG |
pbits | length of the key in bits. Must be between in range (1024, 3072) and multiple of 64. Bit size of the prime 'p' |
qbits | order of the subgroup. Must be in range (160, 256) and multiple of 8 |
Definition at line 304 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), Botan::DL_Group::Prime_Subgroup, and Botan_FFI::safe_get().
int botan_privkey_create_ecdh | ( | botan_privkey_t * | key, |
botan_rng_t | rng, | ||
const char * | params ) |
Definition at line 537 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, and botan_privkey_create().
int botan_privkey_create_ecdsa | ( | botan_privkey_t * | key, |
botan_rng_t | rng, | ||
const char * | params ) |
Definition at line 380 of file ffi_pkey_algs.cpp.
References botan_privkey_create().
int botan_privkey_create_elgamal | ( | botan_privkey_t * | key, |
botan_rng_t | rng, | ||
size_t | pbits, | ||
size_t | qbits ) |
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:
key | handler to the resulting key |
rng | initialized PRNG |
pbits | length of the key in bits. Must be at least 1024 |
qbits | order of the subgroup. Must be at least 160 |
Definition at line 442 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), Botan::DL_Group::Prime_Subgroup, Botan_FFI::safe_get(), and Botan::DL_Group::Strong.
int botan_privkey_create_mceliece | ( | botan_privkey_t * | key, |
botan_rng_t | rng, | ||
size_t | n, | ||
size_t | t ) |
Definition at line 1262 of file ffi_pkey_algs.cpp.
References botan_privkey_create().
int botan_privkey_create_rsa | ( | botan_privkey_t * | key, |
botan_rng_t | rng, | ||
size_t | n_bits ) |
Definition at line 199 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_BAD_PARAMETER, and botan_privkey_create().
int botan_privkey_destroy | ( | botan_privkey_t | key | ) |
Definition at line 79 of file ffi_pkey.cpp.
References BOTAN_FFI_CHECKED_DELETE.
int botan_privkey_dsa_get_x | ( | botan_mp_t | n, |
botan_privkey_t | key ) |
Definition at line 360 of file ffi_pkey_algs.cpp.
References botan_privkey_get_field().
int botan_privkey_ed25519_get_privkey | ( | botan_privkey_t | key, |
uint8_t | output[64] ) |
Definition at line 706 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_INSUFFICIENT_BUFFER_SPACE, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_SUCCESS, BOTAN_FFI_VISIT, BOTAN_UNUSED, and Botan::copy_mem().
int botan_privkey_ed448_get_privkey | ( | botan_privkey_t | key, |
uint8_t | output[57] ) |
Definition at line 774 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_SUCCESS, BOTAN_FFI_VISIT, BOTAN_UNUSED, and Botan::copy_mem().
int botan_privkey_export | ( | botan_privkey_t | key, |
uint8_t | out[], | ||
size_t * | out_len, | ||
uint32_t | flags ) |
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.
Definition at line 161 of file ffi_pkey.cpp.
References BOTAN_FFI_ERROR_BAD_FLAG, BOTAN_PRIVKEY_EXPORT_FLAG_DER, BOTAN_PRIVKEY_EXPORT_FLAG_PEM, BOTAN_PRIVKEY_EXPORT_FLAG_RAW, botan_privkey_view_der(), botan_privkey_view_pem(), botan_privkey_view_raw(), Botan_FFI::copy_view_bin(), and Botan_FFI::copy_view_str().
int botan_privkey_export_encrypted | ( | botan_privkey_t | key, |
uint8_t | out[], | ||
size_t * | out_len, | ||
botan_rng_t | rng, | ||
const char * | passphrase, | ||
const char * | encryption_algo, | ||
uint32_t | flags ) |
Set encryption_algo to NULL or "" to have the library choose a default (recommended)
Definition at line 188 of file ffi_pkey.cpp.
References botan_privkey_export_encrypted_pbkdf_iter().
int botan_privkey_export_encrypted_pbkdf_iter | ( | botan_privkey_t | key, |
uint8_t | out[], | ||
size_t * | out_len, | ||
botan_rng_t | rng, | ||
const char * | passphrase, | ||
size_t | pbkdf_iterations, | ||
const char * | cipher_algo, | ||
const char * | pbkdf_algo, | ||
uint32_t | flags ) |
Export a private key using the specified number of iterations.
Definition at line 275 of file ffi_pkey.cpp.
References BOTAN_FFI_ERROR_BAD_FLAG, BOTAN_PRIVKEY_EXPORT_FLAG_DER, BOTAN_PRIVKEY_EXPORT_FLAG_PEM, botan_privkey_view_encrypted_der(), botan_privkey_view_encrypted_pem(), Botan_FFI::copy_view_bin(), and Botan_FFI::copy_view_str().
Referenced by botan_privkey_export_encrypted().
int botan_privkey_export_encrypted_pbkdf_msec | ( | botan_privkey_t | key, |
uint8_t | out[], | ||
size_t * | out_len, | ||
botan_rng_t | rng, | ||
const char * | passphrase, | ||
uint32_t | pbkdf_msec_runtime, | ||
size_t * | pbkdf_iterations_out, | ||
const char * | cipher_algo, | ||
const char * | pbkdf_algo, | ||
uint32_t | flags ) |
Definition at line 198 of file ffi_pkey.cpp.
References BOTAN_FFI_ERROR_BAD_FLAG, BOTAN_PRIVKEY_EXPORT_FLAG_DER, BOTAN_PRIVKEY_EXPORT_FLAG_PEM, botan_privkey_view_encrypted_der_timed(), botan_privkey_view_encrypted_pem_timed(), Botan_FFI::copy_view_bin(), and Botan_FFI::copy_view_str().
int botan_privkey_export_pubkey | ( | botan_pubkey_t * | out, |
botan_privkey_t | in ) |
Definition at line 103 of file ffi_pkey.cpp.
References BOTAN_FFI_SUCCESS, Botan_FFI::ffi_guard_thunk(), and Botan_FFI::safe_get().
int botan_privkey_get_field | ( | botan_mp_t | output, |
botan_privkey_t | key, | ||
const char * | field_name ) |
Definition at line 187 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_VISIT, and Botan_FFI::safe_get().
Referenced by botan_privkey_dsa_get_x(), botan_privkey_rsa_get_d(), botan_privkey_rsa_get_e(), botan_privkey_rsa_get_n(), botan_privkey_rsa_get_p(), and botan_privkey_rsa_get_q().
int botan_privkey_load | ( | botan_privkey_t * | key, |
botan_rng_t | rng, | ||
const uint8_t | bits[], | ||
size_t | len, | ||
const char * | password ) |
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
Definition at line 54 of file ffi_pkey.cpp.
References BOTAN_FFI_ERROR_UNKNOWN_ERROR, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), and Botan::PKCS8::load_key().
int botan_privkey_load_dh | ( | botan_privkey_t * | key, |
botan_mp_t | p, | ||
botan_mp_t | g, | ||
botan_mp_t | x ) |
Definition at line 505 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), and Botan_FFI::safe_get().
int botan_privkey_load_dsa | ( | botan_privkey_t * | key, |
botan_mp_t | p, | ||
botan_mp_t | q, | ||
botan_mp_t | g, | ||
botan_mp_t | x ) |
Definition at line 328 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), and Botan_FFI::safe_get().
int botan_privkey_load_ecdh | ( | botan_privkey_t * | key, |
botan_mp_t | scalar, | ||
const char * | curve_name ) |
Definition at line 575 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), and Botan_FFI::safe_get().
int botan_privkey_load_ecdsa | ( | botan_privkey_t * | key, |
botan_mp_t | scalar, | ||
const char * | curve_name ) |
Definition at line 425 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), and Botan_FFI::safe_get().
int botan_privkey_load_ed25519 | ( | botan_privkey_t * | key, |
const uint8_t | privkey[32] ) |
Definition at line 676 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, and Botan_FFI::ffi_guard_thunk().
int botan_privkey_load_ed448 | ( | botan_privkey_t * | key, |
const uint8_t | privkey[57] ) |
Definition at line 746 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, and Botan_FFI::ffi_guard_thunk().
int botan_privkey_load_elgamal | ( | botan_privkey_t * | key, |
botan_mp_t | p, | ||
botan_mp_t | g, | ||
botan_mp_t | x ) |
Loads ElGamal private key
key | variable populated with key material |
p | prime order of a Z_p group |
g | group generator |
x | private key |
Definition at line 484 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), and Botan_FFI::safe_get().
int botan_privkey_load_frodokem | ( | botan_privkey_t * | key, |
const uint8_t | privkey[], | ||
size_t | key_len, | ||
const char * | frodo_mode ) |
Algorithm specific key operation: FrodoKEM
Definition at line 1206 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, and Botan_FFI::ffi_guard_thunk().
int botan_privkey_load_kyber | ( | botan_privkey_t * | key, |
const uint8_t | privkey[], | ||
size_t | key_len ) |
Definition at line 946 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), Botan::KyberMode::Kyber1024_R3, Botan::KyberMode::Kyber512_R3, and Botan::KyberMode::Kyber768_R3.
int botan_privkey_load_ml_dsa | ( | botan_privkey_t * | key, |
const uint8_t | privkey[], | ||
size_t | key_len, | ||
const char * | mldsa_mode ) |
Definition at line 1102 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, and Botan_FFI::ffi_guard_thunk().
int botan_privkey_load_ml_kem | ( | botan_privkey_t * | key, |
const uint8_t | privkey[], | ||
size_t | key_len, | ||
const char * | mlkem_mode ) |
Definition at line 1050 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, and Botan_FFI::ffi_guard_thunk().
int botan_privkey_load_rsa | ( | botan_privkey_t * | key, |
botan_mp_t | p, | ||
botan_mp_t | q, | ||
botan_mp_t | e ) |
Definition at line 209 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), and Botan_FFI::safe_get().
int botan_privkey_load_rsa_pkcs1 | ( | botan_privkey_t * | key, |
const uint8_t | bits[], | ||
size_t | len ) |
Definition at line 224 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), and Botan::AlgorithmIdentifier::USE_NULL_PARAM.
int botan_privkey_load_slh_dsa | ( | botan_privkey_t * | key, |
const uint8_t | privkey[], | ||
size_t | key_len, | ||
const char * | slhdsa_mode ) |
Definition at line 1154 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, and Botan_FFI::ffi_guard_thunk().
int botan_privkey_load_sm2 | ( | botan_privkey_t * | key, |
botan_mp_t | scalar, | ||
const char * | curve_name ) |
Definition at line 646 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), and Botan_FFI::safe_get().
Referenced by botan_privkey_load_sm2_enc().
int botan_privkey_load_sm2_enc | ( | botan_privkey_t * | key, |
botan_mp_t | scalar, | ||
const char * | curve_name ) |
Definition at line 670 of file ffi_pkey_algs.cpp.
References botan_privkey_load_sm2().
int botan_privkey_load_x25519 | ( | botan_privkey_t * | key, |
const uint8_t | privkey[32] ) |
Definition at line 810 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, and Botan_FFI::ffi_guard_thunk().
int botan_privkey_load_x448 | ( | botan_privkey_t * | key, |
const uint8_t | privkey[56] ) |
Definition at line 880 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, and Botan_FFI::ffi_guard_thunk().
int botan_privkey_rsa_get_d | ( | botan_mp_t | d, |
botan_privkey_t | rsa_key ) |
Definition at line 271 of file ffi_pkey_algs.cpp.
References botan_privkey_get_field().
int botan_privkey_rsa_get_e | ( | botan_mp_t | e, |
botan_privkey_t | rsa_key ) |
Definition at line 267 of file ffi_pkey_algs.cpp.
References botan_privkey_get_field().
int botan_privkey_rsa_get_n | ( | botan_mp_t | n, |
botan_privkey_t | rsa_key ) |
Definition at line 263 of file ffi_pkey_algs.cpp.
References botan_privkey_get_field().
int botan_privkey_rsa_get_p | ( | botan_mp_t | p, |
botan_privkey_t | rsa_key ) |
Definition at line 255 of file ffi_pkey_algs.cpp.
References botan_privkey_get_field().
int botan_privkey_rsa_get_privkey | ( | botan_privkey_t | rsa_key, |
uint8_t | out[], | ||
size_t * | out_len, | ||
uint32_t | flags ) |
Definition at line 283 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_BAD_FLAG, BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_VISIT, BOTAN_PRIVKEY_EXPORT_FLAG_DER, BOTAN_PRIVKEY_EXPORT_FLAG_PEM, BOTAN_UNUSED, Botan::PEM_Code::encode(), Botan_FFI::write_str_output(), and Botan_FFI::write_vec_output().
int botan_privkey_rsa_get_q | ( | botan_mp_t | q, |
botan_privkey_t | rsa_key ) |
Definition at line 259 of file ffi_pkey_algs.cpp.
References botan_privkey_get_field().
int botan_privkey_view_der | ( | botan_privkey_t | key, |
botan_view_ctx | ctx, | ||
botan_view_bin_fn | view ) |
View the private key's DER encoding
Definition at line 173 of file ffi_pkey.cpp.
References Botan::PKCS8::BER_encode(), BOTAN_FFI_VISIT, and Botan_FFI::invoke_view_callback().
Referenced by botan_privkey_export().
int botan_privkey_view_encrypted_der | ( | botan_privkey_t | key, |
botan_rng_t | rng, | ||
const char * | passphrase, | ||
const char * | cipher_algo, | ||
const char * | pbkdf_algo, | ||
size_t | pbkdf_iterations, | ||
botan_view_ctx | ctx, | ||
botan_view_bin_fn | view ) |
View the encryption of a private key (binary DER encoding)
Set cipher_algo, pbkdf_algo to NULL to use defaults Set pbkdf_iterations to 0 to use defaults
Definition at line 295 of file ffi_pkey.cpp.
References Botan::PKCS8::BER_encode_encrypted_pbkdf_iter(), BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_VISIT, Botan_FFI::invoke_view_callback(), and Botan_FFI::safe_get().
Referenced by botan_privkey_export_encrypted_pbkdf_iter().
int botan_privkey_view_encrypted_der_timed | ( | botan_privkey_t | key, |
botan_rng_t | rng, | ||
const char * | passphrase, | ||
const char * | cipher_algo, | ||
const char * | pbkdf_algo, | ||
size_t | pbkdf_runtime_msec, | ||
botan_view_ctx | ctx, | ||
botan_view_bin_fn | view ) |
View the encryption of a private key (binary DER encoding)
Set cipher_algo, pbkdf_algo to NULL to use defaults
Definition at line 223 of file ffi_pkey.cpp.
References Botan::PKCS8::BER_encode_encrypted_pbkdf_msec(), BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_VISIT, Botan_FFI::invoke_view_callback(), and Botan_FFI::safe_get().
Referenced by botan_privkey_export_encrypted_pbkdf_msec().
int botan_privkey_view_encrypted_pem | ( | botan_privkey_t | key, |
botan_rng_t | rng, | ||
const char * | passphrase, | ||
const char * | cipher_algo, | ||
const char * | pbkdf_algo, | ||
size_t | pbkdf_iterations, | ||
botan_view_ctx | ctx, | ||
botan_view_str_fn | view ) |
View the encryption of a private key (PEM encoding)
Set cipher_algo, pbkdf_algo to NULL to use defaults Set pbkdf_iterations to 0 to use defaults
Definition at line 320 of file ffi_pkey.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_VISIT, Botan_FFI::invoke_view_callback(), Botan::PKCS8::PEM_encode_encrypted_pbkdf_iter(), and Botan_FFI::safe_get().
Referenced by botan_privkey_export_encrypted_pbkdf_iter().
int botan_privkey_view_encrypted_pem_timed | ( | botan_privkey_t | key, |
botan_rng_t | rng, | ||
const char * | passphrase, | ||
const char * | cipher_algo, | ||
const char * | pbkdf_algo, | ||
size_t | pbkdf_runtime_msec, | ||
botan_view_ctx | ctx, | ||
botan_view_str_fn | view ) |
View the encryption of a private key (PEM encoding)
Set cipher_algo, pbkdf_algo to NULL to use defaults
Definition at line 249 of file ffi_pkey.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_VISIT, Botan_FFI::invoke_view_callback(), Botan::PKCS8::PEM_encode_encrypted_pbkdf_msec(), and Botan_FFI::safe_get().
Referenced by botan_privkey_export_encrypted_pbkdf_msec().
int botan_privkey_view_kyber_raw_key | ( | botan_privkey_t | key, |
botan_view_ctx | ctx, | ||
botan_view_bin_fn | view ) |
Definition at line 1016 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_VISIT, BOTAN_UNUSED, and Botan_FFI::invoke_view_callback().
int botan_privkey_view_pem | ( | botan_privkey_t | key, |
botan_view_ctx | ctx, | ||
botan_view_str_fn | view ) |
View the private key's PEM encoding
Definition at line 178 of file ffi_pkey.cpp.
References BOTAN_FFI_VISIT, Botan_FFI::invoke_view_callback(), and Botan::PKCS8::PEM_encode().
Referenced by botan_privkey_export().
int botan_privkey_view_raw | ( | botan_privkey_t | key, |
botan_view_ctx | ctx, | ||
botan_view_bin_fn | view ) |
View the private key's raw encoding
Definition at line 183 of file ffi_pkey.cpp.
References BOTAN_FFI_VISIT, and Botan_FFI::invoke_view_callback().
Referenced by botan_privkey_export().
int botan_privkey_x25519_get_privkey | ( | botan_privkey_t | key, |
uint8_t | output[32] ) |
Definition at line 840 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_INSUFFICIENT_BUFFER_SPACE, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_SUCCESS, BOTAN_FFI_VISIT, BOTAN_UNUSED, and Botan::copy_mem().
int botan_privkey_x448_get_privkey | ( | botan_privkey_t | key, |
uint8_t | output[56] ) |
Definition at line 908 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_SUCCESS, BOTAN_FFI_VISIT, BOTAN_UNUSED, and Botan::copy_mem().
int botan_pubkey_algo_name | ( | botan_pubkey_t | key, |
char | out[], | ||
size_t * | out_len ) |
Definition at line 115 of file ffi_pkey.cpp.
References BOTAN_FFI_VISIT, and Botan_FFI::write_str_output().
int botan_pubkey_check_key | ( | botan_pubkey_t | key, |
botan_rng_t | rng, | ||
uint32_t | flags ) |
Returns 0 if key is valid, negative if invalid key or some other error
Definition at line 119 of file ffi_pkey.cpp.
References BOTAN_CHECK_KEY_EXPENSIVE_TESTS, BOTAN_FFI_ERROR_INVALID_INPUT, BOTAN_FFI_VISIT, and Botan_FFI::safe_get().
int botan_pubkey_destroy | ( | botan_pubkey_t | key | ) |
Definition at line 99 of file ffi_pkey.cpp.
References BOTAN_FFI_CHECKED_DELETE.
int botan_pubkey_dsa_get_g | ( | botan_mp_t | d, |
botan_pubkey_t | key ) |
Definition at line 372 of file ffi_pkey_algs.cpp.
References botan_pubkey_get_field().
int botan_pubkey_dsa_get_p | ( | botan_mp_t | p, |
botan_pubkey_t | key ) |
Definition at line 364 of file ffi_pkey_algs.cpp.
References botan_pubkey_get_field().
int botan_pubkey_dsa_get_q | ( | botan_mp_t | q, |
botan_pubkey_t | key ) |
Definition at line 368 of file ffi_pkey_algs.cpp.
References botan_pubkey_get_field().
int botan_pubkey_dsa_get_y | ( | botan_mp_t | y, |
botan_pubkey_t | key ) |
Definition at line 376 of file ffi_pkey_algs.cpp.
References botan_pubkey_get_field().
int botan_pubkey_ecc_key_used_explicit_encoding | ( | botan_pubkey_t | key | ) |
Definition at line 386 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_UNUSED, Botan::EC_PublicKey::domain(), Botan_FFI::ffi_guard_thunk(), Botan_FFI::safe_get(), and Botan::EC_Group::used_explicit_encoding().
int botan_pubkey_ed25519_get_pubkey | ( | botan_pubkey_t | key, |
uint8_t | pubkey[32] ) |
Definition at line 725 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_INSUFFICIENT_BUFFER_SPACE, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_SUCCESS, BOTAN_FFI_VISIT, BOTAN_UNUSED, and Botan::copy_mem().
int botan_pubkey_ed448_get_pubkey | ( | botan_pubkey_t | key, |
uint8_t | pubkey[57] ) |
Definition at line 791 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_SUCCESS, BOTAN_FFI_VISIT, BOTAN_UNUSED, and Botan::copy_mem().
int botan_pubkey_estimated_strength | ( | botan_pubkey_t | key, |
size_t * | estimate ) |
int botan_pubkey_export | ( | botan_pubkey_t | key, |
uint8_t | out[], | ||
size_t * | out_len, | ||
uint32_t | flags ) |
Definition at line 134 of file ffi_pkey.cpp.
References BOTAN_FFI_ERROR_BAD_FLAG, BOTAN_PRIVKEY_EXPORT_FLAG_DER, BOTAN_PRIVKEY_EXPORT_FLAG_PEM, BOTAN_PRIVKEY_EXPORT_FLAG_RAW, botan_pubkey_view_der(), botan_pubkey_view_pem(), botan_pubkey_view_raw(), Botan_FFI::copy_view_bin(), and Botan_FFI::copy_view_str().
int botan_pubkey_fingerprint | ( | botan_pubkey_t | key, |
const char * | hash, | ||
uint8_t | out[], | ||
size_t * | out_len ) |
Definition at line 349 of file ffi_pkey.cpp.
References BOTAN_FFI_VISIT, Botan::HashFunction::create_or_throw(), and Botan_FFI::write_vec_output().
int botan_pubkey_get_field | ( | botan_mp_t | output, |
botan_pubkey_t | key, | ||
const char * | field_name ) |
Definition at line 177 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_VISIT, and Botan_FFI::safe_get().
Referenced by botan_pubkey_dsa_get_g(), botan_pubkey_dsa_get_p(), botan_pubkey_dsa_get_q(), botan_pubkey_dsa_get_y(), botan_pubkey_rsa_get_e(), and botan_pubkey_rsa_get_n().
int botan_pubkey_load | ( | botan_pubkey_t * | key, |
const uint8_t | bits[], | ||
size_t | len ) |
Definition at line 83 of file ffi_pkey.cpp.
References BOTAN_FFI_ERROR_UNKNOWN_ERROR, BOTAN_FFI_SUCCESS, Botan_FFI::ffi_guard_thunk(), and Botan::X509::load_key().
int botan_pubkey_load_dh | ( | botan_pubkey_t * | key, |
botan_mp_t | p, | ||
botan_mp_t | g, | ||
botan_mp_t | y ) |
Loads Diffie Hellman public key
key | variable populated with key material |
p | prime order of a Z_p group |
g | group generator |
y | public key |
Definition at line 520 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), and Botan_FFI::safe_get().
int botan_pubkey_load_dsa | ( | botan_pubkey_t * | key, |
botan_mp_t | p, | ||
botan_mp_t | q, | ||
botan_mp_t | g, | ||
botan_mp_t | y ) |
Definition at line 344 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), and Botan_FFI::safe_get().
int botan_pubkey_load_ecdh | ( | botan_pubkey_t * | key, |
botan_mp_t | public_x, | ||
botan_mp_t | public_y, | ||
const char * | curve_name ) |
Definition at line 555 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), and Botan_FFI::safe_get().
int botan_pubkey_load_ecdsa | ( | botan_pubkey_t * | key, |
botan_mp_t | public_x, | ||
botan_mp_t | public_y, | ||
const char * | curve_name ) |
Definition at line 404 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), and Botan_FFI::safe_get().
int botan_pubkey_load_ed25519 | ( | botan_pubkey_t * | key, |
const uint8_t | pubkey[32] ) |
Definition at line 691 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, and Botan_FFI::ffi_guard_thunk().
int botan_pubkey_load_ed448 | ( | botan_pubkey_t * | key, |
const uint8_t | pubkey[57] ) |
Definition at line 760 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, and Botan_FFI::ffi_guard_thunk().
int botan_pubkey_load_elgamal | ( | botan_pubkey_t * | key, |
botan_mp_t | p, | ||
botan_mp_t | g, | ||
botan_mp_t | y ) |
Loads ElGamal public key
key | variable populated with key material |
p | prime order of a Z_p group |
g | group generator |
y | public key |
Definition at line 469 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), and Botan_FFI::safe_get().
int botan_pubkey_load_frodokem | ( | botan_pubkey_t * | key, |
const uint8_t | pubkey[], | ||
size_t | key_len, | ||
const char * | frodo_mode ) |
Definition at line 1226 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, and Botan_FFI::ffi_guard_thunk().
int botan_pubkey_load_kyber | ( | botan_pubkey_t * | key, |
const uint8_t | pubkey[], | ||
size_t | key_len ) |
Definition at line 981 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), Botan::KyberMode::Kyber1024_R3, Botan::KyberMode::Kyber512_R3, and Botan::KyberMode::Kyber768_R3.
int botan_pubkey_load_ml_dsa | ( | botan_pubkey_t * | key, |
const uint8_t | pubkey[], | ||
size_t | key_len, | ||
const char * | mldsa_mode ) |
Definition at line 1126 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, and Botan_FFI::ffi_guard_thunk().
int botan_pubkey_load_ml_kem | ( | botan_pubkey_t * | key, |
const uint8_t | pubkey[], | ||
size_t | key_len, | ||
const char * | mlkem_mode ) |
Definition at line 1074 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, and Botan_FFI::ffi_guard_thunk().
int botan_pubkey_load_rsa | ( | botan_pubkey_t * | key, |
botan_mp_t | n, | ||
botan_mp_t | e ) |
Definition at line 241 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), and Botan_FFI::safe_get().
int botan_pubkey_load_slh_dsa | ( | botan_pubkey_t * | key, |
const uint8_t | pubkey[], | ||
size_t | key_len, | ||
const char * | slhdsa_mode ) |
Definition at line 1178 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, and Botan_FFI::ffi_guard_thunk().
int botan_pubkey_load_sm2 | ( | botan_pubkey_t * | key, |
botan_mp_t | public_x, | ||
botan_mp_t | public_y, | ||
const char * | curve_name ) |
Definition at line 627 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_UNKNOWN_ERROR, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), and Botan_FFI::safe_get().
Referenced by botan_pubkey_load_sm2_enc().
int botan_pubkey_load_sm2_enc | ( | botan_pubkey_t * | key, |
botan_mp_t | public_x, | ||
botan_mp_t | public_y, | ||
const char * | curve_name ) |
Definition at line 663 of file ffi_pkey_algs.cpp.
References botan_pubkey_load_sm2().
int botan_pubkey_load_x25519 | ( | botan_pubkey_t * | key, |
const uint8_t | pubkey[32] ) |
Definition at line 825 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, and Botan_FFI::ffi_guard_thunk().
int botan_pubkey_load_x448 | ( | botan_pubkey_t * | key, |
const uint8_t | pubkey[56] ) |
Definition at line 894 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, and Botan_FFI::ffi_guard_thunk().
int botan_pubkey_rsa_get_e | ( | botan_mp_t | e, |
botan_pubkey_t | rsa_key ) |
Definition at line 275 of file ffi_pkey_algs.cpp.
References botan_pubkey_get_field().
int botan_pubkey_rsa_get_n | ( | botan_mp_t | n, |
botan_pubkey_t | rsa_key ) |
Definition at line 279 of file ffi_pkey_algs.cpp.
References botan_pubkey_get_field().
int botan_pubkey_sm2_compute_za | ( | uint8_t | out[], |
size_t * | out_len, | ||
const char * | ident, | ||
const char * | hash_algo, | ||
botan_pubkey_t | key ) |
Definition at line 593 of file ffi_pkey_algs.cpp.
References Botan::Asymmetric_Key::algo_name(), BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, Botan::HashFunction::create_or_throw(), Botan::EC_PublicKey::domain(), Botan_FFI::ffi_guard_thunk(), Botan::EC_PublicKey::public_point(), Botan_FFI::safe_get(), Botan::sm2_compute_za(), and Botan_FFI::write_vec_output().
int botan_pubkey_view_der | ( | botan_pubkey_t | key, |
botan_view_ctx | ctx, | ||
botan_view_bin_fn | view ) |
View the public key's DER encoding
Definition at line 146 of file ffi_pkey.cpp.
References Botan::X509::BER_encode(), BOTAN_FFI_VISIT, and Botan_FFI::invoke_view_callback().
Referenced by botan_pubkey_export().
int botan_pubkey_view_ec_public_point | ( | botan_pubkey_t | key, |
botan_view_ctx | ctx, | ||
botan_view_bin_fn | view ) |
View the uncompressed public point associated with the key
Definition at line 1246 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_VISIT, BOTAN_UNUSED, Botan_FFI::invoke_view_callback(), and Botan::Uncompressed.
int botan_pubkey_view_kyber_raw_key | ( | botan_pubkey_t | key, |
botan_view_ctx | ctx, | ||
botan_view_bin_fn | view ) |
Definition at line 1031 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_VISIT, BOTAN_UNUSED, and Botan_FFI::invoke_view_callback().
int botan_pubkey_view_pem | ( | botan_pubkey_t | key, |
botan_view_ctx | ctx, | ||
botan_view_str_fn | view ) |
View the public key's PEM encoding
Definition at line 151 of file ffi_pkey.cpp.
References BOTAN_FFI_VISIT, Botan_FFI::invoke_view_callback(), and Botan::X509::PEM_encode().
Referenced by botan_pubkey_export().
int botan_pubkey_view_raw | ( | botan_pubkey_t | key, |
botan_view_ctx | ctx, | ||
botan_view_bin_fn | view ) |
View the public key's raw encoding
Definition at line 156 of file ffi_pkey.cpp.
References BOTAN_FFI_VISIT, and Botan_FFI::invoke_view_callback().
Referenced by botan_pubkey_export().
int botan_pubkey_x25519_get_pubkey | ( | botan_pubkey_t | key, |
uint8_t | pubkey[32] ) |
Definition at line 859 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_INSUFFICIENT_BUFFER_SPACE, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_SUCCESS, BOTAN_FFI_VISIT, BOTAN_UNUSED, and Botan::copy_mem().
int botan_pubkey_x448_get_pubkey | ( | botan_pubkey_t | key, |
uint8_t | pubkey[56] ) |
Definition at line 925 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_SUCCESS, BOTAN_FFI_VISIT, BOTAN_UNUSED, and Botan::copy_mem().
int botan_pwdhash | ( | const char * | algo, |
size_t | param1, | ||
size_t | param2, | ||
size_t | param3, | ||
uint8_t | out[], | ||
size_t | out_len, | ||
const char * | passphrase, | ||
size_t | passphrase_len, | ||
const uint8_t | salt[], | ||
size_t | salt_len ) |
Definition at line 53 of file ffi_kdf.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, Botan::PasswordHashFamily::create(), and Botan_FFI::ffi_guard_thunk().
Referenced by botan_pbkdf(), and botan_scrypt().
int botan_pwdhash_timed | ( | const char * | algo, |
uint32_t | msec, | ||
size_t * | param1, | ||
size_t * | param2, | ||
size_t * | param3, | ||
uint8_t | out[], | ||
size_t | out_len, | ||
const char * | passphrase, | ||
size_t | passphrase_len, | ||
const uint8_t | salt[], | ||
size_t | salt_len ) |
Definition at line 86 of file ffi_kdf.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, Botan::PasswordHashFamily::create(), and Botan_FFI::ffi_guard_thunk().
Referenced by botan_pbkdf_timed().
int botan_rng_add_entropy | ( | botan_rng_t | rng, |
const uint8_t * | entropy, | ||
size_t | entropy_len ) |
Add some seed material to a random number generator
rng | rng object |
entropy | the data to add |
entropy_len | length of entropy buffer |
Definition at line 171 of file ffi_rng.cpp.
References BOTAN_FFI_VISIT.
int botan_rng_destroy | ( | botan_rng_t | rng | ) |
Frees all resources of the random number generator object
rng | rng object |
Definition at line 152 of file ffi_rng.cpp.
References BOTAN_FFI_CHECKED_DELETE.
int botan_rng_get | ( | botan_rng_t | rng, |
uint8_t * | out, | ||
size_t | out_len ) |
Get random bytes from a random number generator
rng | rng object |
out | output buffer of size out_len |
out_len | number of requested bytes |
Definition at line 156 of file ffi_rng.cpp.
References BOTAN_FFI_VISIT.
int botan_rng_init | ( | botan_rng_t * | rng, |
const char * | rng_type ) |
Initialize a random number generator object
rng | rng object |
rng_type | type 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. |
Definition at line 30 of file ffi_rng.cpp.
References Botan::Processor_RNG::available(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, and Botan_FFI::ffi_guard_thunk().
int botan_rng_init_custom | ( | botan_rng_t * | rng_out, |
const char * | rng_name, | ||
void * | context, | ||
int(* | get_cb )(void *context, uint8_t *out, size_t out_len), | ||
int(* | add_entropy_cb )(void *context, const uint8_t input[], size_t length), | ||
void(* | destroy_cb )(void *context) ) |
Initialize a custom random number generator from a set of callback functions
rng_out | rng object to create |
rng_name | name of the rng |
context | An application-specific context passed to the callback functions |
get_cb | Callback for getting random bytes from the rng, return 0 for success |
add_entropy_cb | Callback for adding entropy to the rng, return 0 for success, may be NULL |
destroy_cb | Callback called when rng is destroyed, may be NULL |
Definition at line 67 of file ffi_rng.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, Botan_FFI::ffi_guard_thunk(), and name.
int botan_rng_reseed | ( | botan_rng_t | rng, |
size_t | bits ) |
Reseed a random number generator Uses the System_RNG as a seed generator.
rng | rng object |
bits | number of bits to reseed with |
Definition at line 167 of file ffi_rng.cpp.
References BOTAN_FFI_VISIT, and Botan::system_rng().
int botan_rng_reseed_from_rng | ( | botan_rng_t | rng, |
botan_rng_t | source_rng, | ||
size_t | bits ) |
Reseed a random number generator
rng | rng object |
source_rng | the rng that will be read from |
bits | number of bits to reseed with |
Definition at line 175 of file ffi_rng.cpp.
References BOTAN_FFI_VISIT, and Botan_FFI::safe_get().
int botan_same_mem | ( | const uint8_t * | x, |
const uint8_t * | y, | ||
size_t | len ) |
Deprecated equivalent to botan_constant_time_compare
Definition at line 304 of file ffi.cpp.
References botan_constant_time_compare().
int botan_scrub_mem | ( | void * | mem, |
size_t | bytes ) |
Clear out memory using a system specific approach to bypass elision by the compiler (currently using RtlSecureZeroMemory or tricks with volatile pointers).
Definition at line 308 of file ffi.cpp.
References BOTAN_FFI_SUCCESS, and Botan::secure_scrub_memory().
int botan_scrypt | ( | uint8_t | out[], |
size_t | out_len, | ||
const char * | passphrase, | ||
const uint8_t | salt[], | ||
size_t | salt_len, | ||
size_t | N, | ||
size_t | r, | ||
size_t | p ) |
Derive a key using scrypt Deprecated; use botan_pwdhash("Scrypt", N, r, p, out, out_len, password, 0, salt, salt_len);
Definition at line 146 of file ffi_kdf.cpp.
References botan_pwdhash().
int botan_srp6_client_agree | ( | const char * | username, |
const char * | password, | ||
const char * | group_id, | ||
const char * | hash_id, | ||
const uint8_t | salt[], | ||
size_t | salt_len, | ||
const uint8_t | B[], | ||
size_t | B_len, | ||
botan_rng_t | rng_obj, | ||
uint8_t | A[], | ||
size_t * | A_len, | ||
uint8_t | K[], | ||
size_t * | K_len ) |
SRP6a Client side
username | the username we are attempting login for |
password | the password we are attempting to use |
group_id | specifies the shared SRP group |
hash_id | specifies a secure hash function |
salt | is the salt value sent by the server |
salt_len | the length of salt |
B | is the server's public value |
B_len | is the server's public value length |
rng_obj | is a random number generator object |
A | out buffer to store the SRP-6 A value |
A_len | SRP-6 A verifier value length |
K | out buffer to store the symmetric value |
K_len | symmetric key length |
Definition at line 143 of file ffi_srp6.cpp.
References BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), Botan::BigInt::from_bytes(), Botan_FFI::safe_get(), Botan::srp6_client_agree(), and Botan_FFI::write_vec_output().
int botan_srp6_generate_verifier | ( | const char * | identifier, |
const char * | password, | ||
const uint8_t | salt[], | ||
size_t | salt_len, | ||
const char * | group_id, | ||
const char * | hash_id, | ||
uint8_t | verifier[], | ||
size_t * | verifier_len ) |
Generate a new SRP-6 verifier
identifier | a username or other client identifier |
password | the secret used to authenticate user |
salt | a randomly chosen value, at least 128 bits long |
salt_len | the length of salt |
group_id | specifies the shared SRP group |
hash_id | specifies a secure hash function |
verifier | out buffer to store the SRP-6 verifier value |
verifier_len | SRP-6 verifier value length |
Definition at line 115 of file ffi_srp6.cpp.
References BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), Botan::srp6_generate_verifier(), and Botan_FFI::write_vec_output().
int botan_srp6_group_size | ( | const char * | group_id, |
size_t * | group_p_bytes ) |
Return the size, in bytes, of the prime associated with group_id
Definition at line 47 of file ffi_srp6.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), and Botan::DL_Group::p_bytes().
int botan_srp6_server_session_destroy | ( | botan_srp6_server_session_t | srp6 | ) |
Frees all resources of the SRP-6 server session object
srp6 | SRP-6 server session object |
Definition at line 43 of file ffi_srp6.cpp.
References BOTAN_FFI_CHECKED_DELETE.
int botan_srp6_server_session_init | ( | botan_srp6_server_session_t * | srp6 | ) |
Initialize an SRP-6 server session object
srp6 | SRP-6 server session object |
Definition at line 31 of file ffi_srp6.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, and Botan_FFI::ffi_guard_thunk().
int botan_srp6_server_session_step1 | ( | botan_srp6_server_session_t | srp6, |
const uint8_t | verifier[], | ||
size_t | verifier_len, | ||
const char * | group_id, | ||
const char * | hash_id, | ||
botan_rng_t | rng_obj, | ||
uint8_t | B_pub[], | ||
size_t * | B_pub_len ) |
SRP-6 Server side step 1
srp6 | SRP-6 server session object |
verifier | the verification value saved from client registration |
verifier_len | SRP-6 verifier value length |
group_id | the SRP group id |
hash_id | the SRP hash in use |
rng_obj | a random number generator object |
B_pub | out buffer to store the SRP-6 B value |
B_pub_len | SRP-6 B value length |
int botan_srp6_server_session_step2 | ( | botan_srp6_server_session_t | srp6, |
const uint8_t | A[], | ||
size_t | A_len, | ||
uint8_t | key[], | ||
size_t * | key_len ) |
SRP-6 Server side step 2
srp6 | SRP-6 server session object |
A | the client's value |
A_len | the client's value length |
key | out buffer to store the symmetric key value |
key_len | symmetric key length |
Definition at line 94 of file ffi_srp6.cpp.
References BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_VISIT, BOTAN_UNUSED, Botan::BigInt::from_bytes(), and Botan_FFI::write_vec_output().
int botan_system_rng_get | ( | uint8_t * | out, |
size_t | out_len ) |
Get random bytes from system random number generator
out | output buffer of size out_len |
out_len | number of requested bytes |
Definition at line 160 of file ffi_rng.cpp.
References BOTAN_FFI_SUCCESS, Botan_FFI::ffi_guard_thunk(), Botan::RandomNumberGenerator::randomize(), and Botan::system_rng().
int botan_totp_check | ( | botan_totp_t | totp, |
uint32_t | totp_code, | ||
uint64_t | timestamp, | ||
size_t | acceptable_clock_drift ) |
Verify a TOTP code
totp | the TOTP object |
totp_code | the presented OTP |
timestamp | the current local timestamp |
acceptable_clock_drift | specifies the acceptable amount of clock drift (in terms of time steps) between the two hosts. |
Definition at line 69 of file ffi_totp.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_INVALID_VERIFIER, BOTAN_FFI_SUCCESS, BOTAN_FFI_VISIT, and BOTAN_UNUSED.
int botan_totp_destroy | ( | botan_totp_t | totp | ) |
Destroy a TOTP instance
Definition at line 46 of file ffi_totp.cpp.
References BOTAN_FFI_CHECKED_DELETE, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, and BOTAN_UNUSED.
int botan_totp_generate | ( | botan_totp_t | totp, |
uint32_t * | totp_code, | ||
uint64_t | timestamp ) |
Generate a TOTP code for the provided timestamp
totp | the TOTP object |
totp_code | the OTP code will be written here |
timestamp | the current local timestamp |
Definition at line 55 of file ffi_totp.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_VISIT, and BOTAN_UNUSED.
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 25 of file ffi_totp.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, and Botan_FFI::ffi_guard_thunk().
int botan_tpm2_ctx_destroy | ( | botan_tpm2_ctx_t | ctx | ) |
Frees all resouces of a TPM2 context
ctx | TPM2 context |
Definition at line 149 of file ffi_tpm2.cpp.
References BOTAN_FFI_CHECKED_DELETE, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, and BOTAN_UNUSED.
int botan_tpm2_ctx_enable_crypto_backend | ( | botan_tpm2_ctx_t | ctx, |
botan_rng_t | rng ) |
Enable Botan's TSS2 crypto backend that replaces the cryptographic functions required for the communication with the TPM with implementations provided by Botan instead of using TSS' defaults OpenSSL or mbedTLS. Note that the provided rng
should not be dependent on the TPM and the caller must ensure that it remains usable for the lifetime of the ctx
.
ctx | TPM2 context |
rng | random number generator to be used by the crypto backend |
Definition at line 126 of file ffi_tpm2.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_SUCCESS, BOTAN_FFI_VISIT, BOTAN_UNUSED, and Botan_FFI::safe_get().
int botan_tpm2_ctx_init | ( | botan_tpm2_ctx_t * | ctx_out, |
const char * | tcti_nameconf ) |
Initialize a TPM2 context
ctx_out | output TPM2 context |
tcti_nameconf | TCTI config (may be nullptr) |
Definition at line 66 of file ffi_tpm2.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, Botan::TPM2::Context::create(), and Botan_FFI::ffi_guard_thunk().
int botan_tpm2_ctx_init_ex | ( | botan_tpm2_ctx_t * | ctx_out, |
const char * | tcti_name, | ||
const char * | tcti_conf ) |
Initialize a TPM2 context
ctx_out | output TPM2 context |
tcti_name | TCTI name (may be nullptr) |
tcti_conf | TCTI config (may be nullptr) |
Definition at line 92 of file ffi_tpm2.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, Botan::TPM2::Context::create(), and Botan_FFI::ffi_guard_thunk().
int botan_tpm2_rng_init | ( | botan_rng_t * | rng_out, |
botan_tpm2_ctx_t | ctx, | ||
botan_tpm2_session_t | s1, | ||
botan_tpm2_session_t | s2, | ||
botan_tpm2_session_t | s3 ) |
Initialize a random number generator object via TPM2
rng_out | rng object to create |
ctx | TPM2 context |
s1 | the first session to use (optional, may be nullptr) |
s2 | the second session to use (optional, may be nullptr) |
s3 | the third session to use (optional, may be nullptr) |
Definition at line 158 of file ffi_tpm2.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_FFI_VISIT, and BOTAN_UNUSED.
int botan_tpm2_session_destroy | ( | botan_tpm2_session_t | session | ) |
Create an unauthenticated session for use with TPM2
session | the session object to destroy |
Definition at line 197 of file ffi_tpm2.cpp.
References BOTAN_FFI_CHECKED_DELETE, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, and BOTAN_UNUSED.
int botan_tpm2_supports_crypto_backend | ( | ) |
Checks if Botan's TSS2 crypto backend can be used in this build
Definition at line 58 of file ffi_tpm2.cpp.
References Botan::TPM2::Context::supports_botan_crypto_backend().
int botan_tpm2_unauthenticated_session_init | ( | botan_tpm2_session_t * | session_out, |
botan_tpm2_ctx_t | ctx ) |
Create an unauthenticated session for use with TPM2
session_out | the session object to create |
ctx | TPM2 context |
Definition at line 179 of file ffi_tpm2.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_FFI_VISIT, BOTAN_UNUSED, and Botan::TPM2::Session::unauthenticated_session().
uint32_t botan_version_datestamp | ( | void | ) |
Return the date this version was released as an integer, or 0 if an unreleased version
Definition at line 294 of file ffi.cpp.
References Botan::version_datestamp().
uint32_t botan_version_major | ( | void | ) |
Return the major version of the library
Definition at line 282 of file ffi.cpp.
References Botan::version_major().
uint32_t botan_version_minor | ( | void | ) |
Return the minor version of the library
Definition at line 286 of file ffi.cpp.
References Botan::version_minor().
uint32_t botan_version_patch | ( | void | ) |
Return the patch version of the library
Definition at line 290 of file ffi.cpp.
References Botan::version_patch().
const char * botan_version_string | ( | void | ) |
Return a free-form version string, e.g., 2.0.0
Definition at line 278 of file ffi.cpp.
References Botan::version_cstr().
int botan_x509_cert_allowed_usage | ( | botan_x509_cert_t | cert, |
unsigned int | key_usage ) |
Definition at line 139 of file ffi_cert.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_SUCCESS, BOTAN_FFI_VISIT, and BOTAN_UNUSED.
int botan_x509_cert_destroy | ( | botan_x509_cert_t | cert | ) |
Definition at line 153 of file ffi_cert.cpp.
References BOTAN_FFI_CHECKED_DELETE, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, and BOTAN_UNUSED.
int botan_x509_cert_dup | ( | botan_x509_cert_t * | new_cert, |
botan_x509_cert_t | cert ) |
Definition at line 48 of file ffi_cert.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), and Botan_FFI::safe_get().
int botan_x509_cert_get_authority_key_id | ( | botan_x509_cert_t | cert, |
uint8_t | out[], | ||
size_t * | out_len ) |
Definition at line 218 of file ffi_cert.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_VISIT, BOTAN_UNUSED, and Botan_FFI::write_vec_output().
int botan_x509_cert_get_fingerprint | ( | botan_x509_cert_t | cert, |
const char * | hash, | ||
uint8_t | out[], | ||
size_t * | out_len ) |
Definition at line 209 of file ffi_cert.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_VISIT, BOTAN_UNUSED, and Botan_FFI::write_str_output().
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 104 of file ffi_cert.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_VISIT, BOTAN_UNUSED, and Botan_FFI::write_str_output().
int botan_x509_cert_get_public_key | ( | botan_x509_cert_t | cert, |
botan_pubkey_t * | key ) |
Definition at line 85 of file ffi_cert.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), and Botan_FFI::safe_get().
int botan_x509_cert_get_public_key_bits | ( | botan_x509_cert_t | cert, |
uint8_t | out[], | ||
size_t * | out_len ) |
Definition at line 236 of file ffi_cert.cpp.
References botan_x509_cert_view_public_key_bits(), and Botan_FFI::copy_view_bin().
int botan_x509_cert_get_serial_number | ( | botan_x509_cert_t | cert, |
uint8_t | out[], | ||
size_t * | out_len ) |
Definition at line 200 of file ffi_cert.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_VISIT, BOTAN_UNUSED, and Botan_FFI::write_vec_output().
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 115 of file ffi_cert.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_VISIT, BOTAN_UNUSED, and Botan_FFI::write_str_output().
int botan_x509_cert_get_subject_key_id | ( | botan_x509_cert_t | cert, |
uint8_t | out[], | ||
size_t * | out_len ) |
Definition at line 227 of file ffi_cert.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_VISIT, BOTAN_UNUSED, and Botan_FFI::write_vec_output().
int botan_x509_cert_get_time_expires | ( | botan_x509_cert_t | cert, |
char | out[], | ||
size_t * | out_len ) |
Definition at line 172 of file ffi_cert.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_VISIT, BOTAN_UNUSED, and Botan_FFI::write_str_output().
int botan_x509_cert_get_time_starts | ( | botan_x509_cert_t | cert, |
char | out[], | ||
size_t * | out_len ) |
Definition at line 162 of file ffi_cert.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_VISIT, BOTAN_UNUSED, and Botan_FFI::write_str_output().
int botan_x509_cert_hostname_match | ( | botan_x509_cert_t | cert, |
const char * | hostname ) |
Check if the certificate matches the specified hostname via alternative name or CN match. RFC 5280 wildcards also supported.
Definition at line 250 of file ffi_cert.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_VISIT, and BOTAN_UNUSED.
int botan_x509_cert_load | ( | botan_x509_cert_t * | cert_obj, |
const uint8_t | cert[], | ||
size_t | cert_len ) |
Definition at line 67 of file ffi_cert.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, and Botan_FFI::ffi_guard_thunk().
int botan_x509_cert_load_file | ( | botan_x509_cert_t * | cert_obj, |
const char * | filename ) |
Definition at line 30 of file ffi_cert.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, and Botan_FFI::ffi_guard_thunk().
int botan_x509_cert_not_after | ( | botan_x509_cert_t | cert, |
uint64_t * | time_since_epoch ) |
Definition at line 191 of file ffi_cert.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_VISIT, and BOTAN_UNUSED.
int botan_x509_cert_not_before | ( | botan_x509_cert_t | cert, |
uint64_t * | time_since_epoch ) |
Definition at line 182 of file ffi_cert.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_VISIT, and BOTAN_UNUSED.
int botan_x509_cert_to_string | ( | botan_x509_cert_t | cert, |
char | out[], | ||
size_t * | out_len ) |
Definition at line 126 of file ffi_cert.cpp.
References botan_x509_cert_view_as_string(), and Botan_FFI::copy_view_str().
const char * botan_x509_cert_validation_status | ( | int | code | ) |
Returns a pointer to a static character string explaining the status code, or else NULL if unknown.
Definition at line 330 of file ffi_cert.cpp.
References Botan::to_string().
int botan_x509_cert_verify | ( | int * | validation_result, |
botan_x509_cert_t | cert, | ||
const botan_x509_cert_t * | intermediates, | ||
size_t | intermediates_len, | ||
const botan_x509_cert_t * | trusted, | ||
size_t | trusted_len, | ||
const char * | trusted_path, | ||
size_t | required_strength, | ||
const char * | hostname, | ||
uint64_t | reference_time ) |
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
Definition at line 263 of file ffi_cert.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), Botan_FFI::safe_get(), Botan::UNSPECIFIED, and Botan::x509_path_validate().
int botan_x509_cert_verify_with_crl | ( | int * | validation_result, |
botan_x509_cert_t | cert, | ||
const botan_x509_cert_t * | intermediates, | ||
size_t | intermediates_len, | ||
const botan_x509_cert_t * | trusted, | ||
size_t | trusted_len, | ||
const botan_x509_crl_t * | crls, | ||
size_t | crls_len, | ||
const char * | trusted_path, | ||
size_t | required_strength, | ||
const char * | hostname, | ||
uint64_t | reference_time ) |
Different flavor of botan_x509_cert_verify
, supports revocation lists. CRLs are passed as an array, same as intermediates and trusted CAs
Definition at line 404 of file ffi_cert.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), Botan_FFI::safe_get(), Botan::UNSPECIFIED, and Botan::x509_path_validate().
int botan_x509_cert_view_as_string | ( | botan_x509_cert_t | cert, |
botan_view_ctx | ctx, | ||
botan_view_str_fn | view ) |
Definition at line 130 of file ffi_cert.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_VISIT, BOTAN_UNUSED, and Botan_FFI::invoke_view_callback().
Referenced by botan_x509_cert_to_string().
int botan_x509_cert_view_public_key_bits | ( | botan_x509_cert_t | cert, |
botan_view_ctx | ctx, | ||
botan_view_bin_fn | view ) |
Definition at line 240 of file ffi_cert.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_VISIT, BOTAN_UNUSED, and Botan_FFI::invoke_view_callback().
Referenced by botan_x509_cert_get_public_key_bits().
int botan_x509_crl_destroy | ( | botan_x509_crl_t | crl | ) |
Definition at line 385 of file ffi_cert.cpp.
References BOTAN_FFI_CHECKED_DELETE, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, and BOTAN_UNUSED.
int botan_x509_crl_load | ( | botan_x509_crl_t * | crl_obj, |
const uint8_t | crl_bits[], | ||
size_t | crl_bits_len ) |
Definition at line 367 of file ffi_cert.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, and Botan_FFI::ffi_guard_thunk().
int botan_x509_crl_load_file | ( | botan_x509_crl_t * | crl_obj, |
const char * | crl_path ) |
Definition at line 349 of file ffi_cert.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, and Botan_FFI::ffi_guard_thunk().
int botan_x509_is_revoked | ( | botan_x509_crl_t | crl, |
botan_x509_cert_t | cert ) |
Given a CRL and a certificate, check if the certificate is revoked on that particular CRL
Definition at line 394 of file ffi_cert.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_VISIT, BOTAN_UNUSED, and Botan_FFI::safe_get().
int botan_zfec_decode | ( | size_t | K, |
size_t | N, | ||
const size_t * | indexes, | ||
uint8_t *const * | inputs, | ||
size_t | shareSize, | ||
uint8_t ** | outputs ) |
Decode some previously encoded shares using certain ZFEC parameters.
K | the number of shares needed for recovery |
N | the total number of shares |
indexes | The index into the encoder's outputs for the corresponding element of the inputs array. Must be of length K. |
inputs | K previously encoded shares to decode |
shareSize | the length in bytes of each input |
outputs | An out parameter pointing to a fully allocated array of size [K][shareSize]. For all k in range, a decoded block will written to the memory starting at outputs[k][0]. |
Definition at line 31 of file ffi_zfec.cpp.
References blockSize, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, Botan::ZFEC::decode_shares(), and Botan_FFI::ffi_guard_thunk().
int botan_zfec_encode | ( | size_t | K, |
size_t | N, | ||
const uint8_t * | input, | ||
size_t | size, | ||
uint8_t ** | outputs ) |
ZFEC Encode some bytes with certain ZFEC parameters.
K | the number of shares needed for recovery |
N | the number of shares generated |
input | the data to FEC |
size | the length in bytes of input, which must be a multiple of K |
outputs | An out parameter pointing to a fully allocated array of size [N][size / K]. For all n in range, an encoded block will be written to the memory starting at outputs[n][0]. |
Definition at line 17 of file ffi_zfec.cpp.
References blockSize, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, Botan::ZFEC::encode(), and Botan_FFI::ffi_guard_thunk().