60 #include <botan/build.h>
137 #define BOTAN_FFI_ERROR_INSUFFICIENT_BUFFER_SPACE (-10)
138 #define BOTAN_FFI_ERROR_EXCEPTION_THROWN (-20)
139 #define BOTAN_FFI_ERROR_BAD_FLAG (-30)
140 #define BOTAN_FFI_ERROR_NULL_POINTER (-31)
141 #define BOTAN_FFI_ERROR_NOT_IMPLEMENTED (-40)
148 BOTAN_DLL
int botan_same_mem(
const uint8_t* x,
const uint8_t* y,
size_t len);
150 #define BOTAN_FFI_HEX_LOWER_CASE 1
180 BOTAN_DLL
int botan_rng_init(botan_rng_t* rng,
const char* rng_type);
191 BOTAN_DLL
int botan_rng_get(botan_rng_t rng, uint8_t* out,
size_t out_len);
304 BOTAN_DLL
int botan_mac_set_key(botan_mac_t mac,
const uint8_t* key,
size_t key_len);
313 BOTAN_DLL
int botan_mac_update(botan_mac_t mac,
const uint8_t* buf,
size_t len);
345 #define BOTAN_CIPHER_INIT_FLAG_MASK_DIRECTION 1
346 #define BOTAN_CIPHER_INIT_FLAG_ENCRYPT 0
347 #define BOTAN_CIPHER_INIT_FLAG_DECRYPT 1
357 size_t* out_minimum_keylength,
358 size_t* out_maximum_keylength);
361 const uint8_t* key,
size_t key_len);
364 const uint8_t* ad,
size_t ad_len);
367 const uint8_t* nonce,
size_t nonce_len);
369 #define BOTAN_CIPHER_UPDATE_FLAG_FINAL (1U << 0)
375 size_t* output_written,
376 const uint8_t input_bytes[],
378 size_t* input_consumed);
395 uint8_t out[],
size_t out_len,
396 const char* passphrase,
397 const uint8_t salt[],
size_t salt_len,
414 uint8_t out[],
size_t out_len,
415 const char* passphrase,
416 const uint8_t salt[],
size_t salt_len,
417 size_t milliseconds_to_run,
418 size_t* out_iterations_used);
433 BOTAN_DLL
int botan_kdf(
const char* kdf_algo,
434 uint8_t out[],
size_t out_len,
435 const uint8_t secret[],
size_t secret_len,
436 const uint8_t salt[],
size_t salt_len,
437 const uint8_t label[],
size_t label_len);
453 const char* password,
467 const char* cipher_name);
484 const uint8_t key[],
size_t len);
513 BOTAN_DLL
int botan_mp_to_str(
const botan_mp_t mp, uint8_t base,
char* out,
size_t* out_len);
527 BOTAN_DLL
int botan_mp_from_bin(
const botan_mp_t mp,
const uint8_t vec[],
size_t vec_len);
548 BOTAN_DLL
int botan_mp_add(botan_mp_t result,
const botan_mp_t x,
const botan_mp_t y);
549 BOTAN_DLL
int botan_mp_sub(botan_mp_t result,
const botan_mp_t x,
const botan_mp_t y);
550 BOTAN_DLL
int botan_mp_mul(botan_mp_t result,
const botan_mp_t x,
const botan_mp_t y);
553 botan_mp_t remainder,
554 const botan_mp_t x,
const botan_mp_t y);
557 const botan_mp_t y,
const botan_mp_t mod);
564 BOTAN_DLL
int botan_mp_equal(
const botan_mp_t x,
const botan_mp_t y);
571 BOTAN_DLL
int botan_mp_cmp(
int* result,
const botan_mp_t x,
const botan_mp_t y);
579 BOTAN_DLL
int botan_mp_powmod(botan_mp_t out,
const botan_mp_t base,
const botan_mp_t exponent,
const botan_mp_t modulus);
581 BOTAN_DLL
int botan_mp_lshift(botan_mp_t out,
const botan_mp_t in,
size_t shift);
582 BOTAN_DLL
int botan_mp_rshift(botan_mp_t out,
const botan_mp_t in,
size_t shift);
584 BOTAN_DLL
int botan_mp_mod_inverse(botan_mp_t out,
const botan_mp_t in,
const botan_mp_t modulus);
589 const botan_mp_t lower_bound,
const botan_mp_t upper_bound);
591 BOTAN_DLL
int botan_mp_gcd(botan_mp_t out,
const botan_mp_t x,
const botan_mp_t y);
598 BOTAN_DLL
int botan_mp_is_prime(
const botan_mp_t n, botan_rng_t rng,
size_t test_prob);
635 const char* algo_name,
636 const char* algo_params,
639 #define BOTAN_CHECK_KEY_EXPENSIVE_TESTS 1
653 const uint8_t bits[],
size_t len,
654 const char* password);
658 #define BOTAN_PRIVKEY_EXPORT_FLAG_DER 0
659 #define BOTAN_PRIVKEY_EXPORT_FLAG_PEM 1
669 uint8_t out[],
size_t* out_len,
677 uint8_t out[],
size_t* out_len,
679 const
char* passphrase,
680 const
char* encryption_algo,
688 uint8_t out[],
size_t* out_len,
690 const
char* passphrase,
691 uint32_t pbkdf_msec_runtime,
692 size_t* pbkdf_iterations_out,
693 const
char* cipher_algo,
694 const
char* pbkdf_algo,
701 uint8_t out[],
size_t* out_len,
703 const
char* passphrase,
704 size_t pbkdf_iterations,
705 const
char* cipher_algo,
706 const
char* pbkdf_algo,
711 BOTAN_DLL
int botan_pubkey_load(botan_pubkey_t* key, const uint8_t bits[],
size_t len);
715 BOTAN_DLL
int botan_pubkey_export(botan_pubkey_t key, uint8_t out[],
size_t* out_len, uint32_t flags);
727 uint8_t out[],
size_t* out_len);
736 const
char* field_name);
740 const
char* field_name);
799 uint8_t out[],
size_t* out_len,
800 const uint8_t plaintext[],
size_t plaintext_len);
814 uint8_t out[],
size_t* out_len,
815 uint8_t ciphertext[],
size_t ciphertext_len);
824 const
char* hash_and_padding,
830 uint8_t sig[],
size_t* sig_len);
839 const
char* hash_and_padding,
858 uint8_t out[],
size_t* out_len);
861 uint8_t out[],
size_t* out_len,
862 const uint8_t other_key[],
size_t other_key_len,
863 const uint8_t salt[],
size_t salt_len);
874 const uint8_t pt[],
size_t pt_len,
875 const uint8_t ad[],
size_t ad_len,
876 uint8_t ct[],
size_t* ct_len);
880 const uint8_t ct[],
size_t ct_len,
881 const uint8_t ad[],
size_t ad_len,
882 uint8_t pt[],
size_t* pt_len);
887 BOTAN_DLL
int botan_x509_cert_load(botan_x509_cert_t* cert_obj, const uint8_t cert[],
size_t cert_len);
894 const
char* common_name,
895 const
char* org_name);
911 uint8_t out[],
size_t* out_len);
916 const
char* key,
size_t index,
917 uint8_t out[],
size_t* out_len);
920 const
char* key,
size_t index,
921 uint8_t out[],
size_t* out_len);
944 #if defined(BOTAN_HAS_TLS) && 0
946 typedef struct botan_tls_session_struct* botan_tls_session_t;
948 BOTAN_DLL
int botan_tls_session_decrypt(botan_tls_session_t* session,
949 const uint8_t key[],
size_t key_len,
950 const uint8_t blob[],
size_t blob_len);
952 BOTAN_DLL
int botan_tls_session_get_version(botan_tls_session_t session, uint16_t* tls_version);
953 BOTAN_DLL
int botan_tls_session_get_ciphersuite(botan_tls_session_t session, uint16_t* ciphersuite);
954 BOTAN_DLL
int botan_tls_session_encrypt(botan_tls_session_t session, botan_rng_t rng, uint8_t key[],
size_t* key_len);
956 BOTAN_DLL
int botan_tls_session_get_peer_certs(botan_tls_session_t session,
botan_x509_cert_t certs[],
size_t* cert_len);
960 typedef struct botan_tls_channel_struct* botan_tls_channel_t;
962 typedef void (*botan_tls_channel_output_fn)(
void* application_data,
const uint8_t* data,
size_t data_len);
964 typedef void (*botan_tls_channel_data_cb)(
void* application_data,
const uint8_t* data,
size_t data_len);
966 typedef void (*botan_tls_channel_alert_cb)(
void* application_data, uint16_t alert_code);
968 typedef void (*botan_tls_channel_session_established)(
void* application_data,
969 botan_tls_channel_t channel,
970 botan_tls_session_t session);
972 BOTAN_DLL
int botan_tls_channel_init_client(botan_tls_channel_t* channel,
973 botan_tls_channel_output_fn output_fn,
974 botan_tls_channel_data_cb data_cb,
975 botan_tls_channel_alert_cb alert_cb,
976 botan_tls_channel_session_established session_cb,
977 const char* server_name);
979 BOTAN_DLL
int botan_tls_channel_init_server(botan_tls_channel_t* channel,
980 botan_tls_channel_output_fn output_fn,
981 botan_tls_channel_data_cb data_cb,
982 botan_tls_channel_alert_cb alert_cb,
983 botan_tls_channel_session_established session_cb);
985 BOTAN_DLL
int botan_tls_channel_received_data(botan_tls_channel_t chan,
986 const uint8_t input[],
size_t len);
991 BOTAN_DLL
int botan_tls_channel_type(botan_tls_channel_t chan);
993 BOTAN_DLL
int botan_tls_channel_send(botan_tls_channel_t chan,
994 const uint8_t input[],
size_t len);
996 BOTAN_DLL
int botan_tls_channel_close(botan_tls_channel_t chan);
998 BOTAN_DLL
int botan_tls_channel_destroy(botan_tls_channel_t chan);
BOTAN_DLL int botan_bcrypt_is_valid(const char *pass, const char *hash)
BOTAN_DLL int botan_pubkey_rsa_get_e(botan_mp_t e, botan_pubkey_t rsa_key)
BOTAN_DLL int botan_hash_name(botan_hash_t hash, char *name, size_t name_len)
BOTAN_DLL int botan_mac_destroy(botan_mac_t mac)
BOTAN_DLL int botan_pk_op_encrypt_create(botan_pk_op_encrypt_t *op, botan_pubkey_t key, const char *padding, uint32_t flags)
BOTAN_DLL 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)
BOTAN_DLL int botan_pk_op_key_agreement_create(botan_pk_op_ka_t *op, botan_privkey_t key, const char *kdf, uint32_t flags)
BOTAN_DLL int botan_rng_init(botan_rng_t *rng, const char *rng_type)
BOTAN_DLL int botan_privkey_rsa_get_e(botan_mp_t e, botan_privkey_t rsa_key)
BOTAN_DLL int botan_mp_rshift(botan_mp_t out, const botan_mp_t in, size_t shift)
BOTAN_DLL int botan_x509_cert_get_time_starts(botan_x509_cert_t cert, char out[], size_t *out_len)
BOTAN_DLL int botan_pubkey_dsa_get_p(botan_mp_t p, botan_pubkey_t key)
BOTAN_DLL int botan_pk_op_sign_update(botan_pk_op_sign_t op, const uint8_t in[], size_t in_len)
BOTAN_DLL int botan_x509_cert_get_time_expires(botan_x509_cert_t cert, char out[], size_t *out_len)
BOTAN_DLL int botan_rng_get(botan_rng_t rng, uint8_t *out, size_t out_len)
BOTAN_DLL int botan_pubkey_dsa_get_g(botan_mp_t d, botan_pubkey_t key)
BOTAN_DLL uint32_t botan_ffi_api_version()
BOTAN_DLL 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)
BOTAN_DLL int botan_mp_to_bin(const botan_mp_t mp, uint8_t vec[])
BOTAN_DLL int botan_privkey_rsa_get_p(botan_mp_t p, botan_privkey_t rsa_key)
BOTAN_DLL int botan_pk_op_key_agreement_export_public(botan_privkey_t key, uint8_t out[], size_t *out_len)
BOTAN_DLL int botan_mp_flip_sign(botan_mp_t mp)
BOTAN_DLL int botan_hash_clear(botan_hash_t hash)
BOTAN_DLL 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)
BOTAN_DLL int botan_pubkey_algo_name(botan_pubkey_t key, char out[], size_t *out_len)
BOTAN_DLL int botan_pubkey_get_field(botan_mp_t output, botan_pubkey_t key, const char *field_name)
BOTAN_DLL int botan_mp_equal(const botan_mp_t x, const botan_mp_t y)
BOTAN_DLL int botan_same_mem(const uint8_t *x, const uint8_t *y, size_t len)
BOTAN_DLL int botan_pubkey_estimated_strength(botan_pubkey_t key, size_t *estimate)
BOTAN_DLL int botan_mp_add(botan_mp_t result, const botan_mp_t x, const botan_mp_t y)
BOTAN_DLL int botan_mp_num_bytes(const botan_mp_t n, size_t *bytes)
BOTAN_DLL 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)
BOTAN_DLL int botan_block_cipher_set_key(botan_block_cipher_t bc, const uint8_t key[], size_t len)
BOTAN_DLL int botan_mac_set_key(botan_mac_t mac, const uint8_t *key, size_t key_len)
struct botan_pk_op_encrypt_struct * botan_pk_op_encrypt_t
BOTAN_DLL int botan_x509_cert_path_verify(botan_x509_cert_t cert, const char *ca_dir)
BOTAN_DLL uint32_t botan_version_patch()
BOTAN_DLL int botan_pubkey_rsa_get_n(botan_mp_t n, botan_pubkey_t rsa_key)
BOTAN_DLL int botan_mp_clear(botan_mp_t mp)
BOTAN_DLL int botan_x509_cert_get_authority_key_id(botan_x509_cert_t cert, uint8_t out[], size_t *out_len)
BOTAN_DLL int botan_mp_from_bin(const botan_mp_t mp, const uint8_t vec[], size_t vec_len)
BOTAN_DLL int botan_mp_is_negative(const botan_mp_t mp)
BOTAN_DLL int botan_mp_get_bit(const botan_mp_t n, size_t bit)
BOTAN_DLL uint32_t botan_version_minor()
BOTAN_DLL int botan_mac_output_length(botan_mac_t mac, size_t *output_length)
BOTAN_DLL int botan_x509_cert_gen_selfsigned(botan_x509_cert_t *cert, botan_privkey_t key, botan_rng_t rng, const char *common_name, const char *org_name)
BOTAN_DLL int botan_hash_final(botan_hash_t hash, uint8_t out[])
struct botan_pk_op_sign_struct * botan_pk_op_sign_t
BOTAN_DLL 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)
BOTAN_DLL int botan_cipher_set_associated_data(botan_cipher_t cipher, const uint8_t *ad, size_t ad_len)
BOTAN_DLL int botan_x509_cert_load_file(botan_x509_cert_t *cert_obj, const char *filename)
BOTAN_DLL int botan_mac_final(botan_mac_t mac, uint8_t out[])
BOTAN_DLL int botan_pubkey_dsa_get_y(botan_mp_t y, botan_pubkey_t key)
BOTAN_DLL int botan_mp_set_from_str(botan_mp_t dest, const char *str)
BOTAN_DLL int botan_cipher_set_key(botan_cipher_t cipher, const uint8_t *key, size_t key_len)
BOTAN_DLL int botan_pk_op_decrypt_create(botan_pk_op_decrypt_t *op, botan_privkey_t key, const char *padding, uint32_t flags)
BOTAN_DLL int botan_mp_gcd(botan_mp_t out, const botan_mp_t x, const botan_mp_t y)
BOTAN_DLL 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)
BOTAN_DLL int botan_hash_init(botan_hash_t *hash, const char *hash_name, uint32_t flags)
BOTAN_DLL int botan_mp_is_even(const botan_mp_t mp)
BOTAN_DLL 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)
BOTAN_DLL int botan_privkey_get_field(botan_mp_t output, botan_privkey_t key, const char *field_name)
BOTAN_DLL int botan_mp_is_prime(const botan_mp_t n, botan_rng_t rng, size_t test_prob)
BOTAN_DLL int botan_x509_cert_destroy(botan_x509_cert_t cert)
struct botan_mac_struct * botan_mac_t
BOTAN_DLL int botan_mp_to_str(const botan_mp_t mp, uint8_t base, char *out, size_t *out_len)
BOTAN_DLL int botan_x509_cert_load(botan_x509_cert_t *cert_obj, const uint8_t cert[], size_t cert_len)
botan_x509_cert_key_constraints
BOTAN_DLL int botan_pubkey_fingerprint(botan_pubkey_t key, const char *hash, uint8_t out[], size_t *out_len)
BOTAN_DLL const char * botan_version_string()
BOTAN_DLL int botan_pk_op_sign_finish(botan_pk_op_sign_t op, botan_rng_t rng, uint8_t sig[], size_t *sig_len)
BOTAN_DLL int botan_block_cipher_decrypt_blocks(botan_block_cipher_t bc, const uint8_t in[], uint8_t out[], size_t blocks)
BOTAN_DLL int botan_pk_op_key_agreement_destroy(botan_pk_op_ka_t op)
BOTAN_DLL int botan_pk_op_verify_destroy(botan_pk_op_verify_t op)
BOTAN_DLL int botan_cipher_clear(botan_cipher_t hash)
BOTAN_DLL int botan_hash_output_length(botan_hash_t hash, size_t *output_length)
BOTAN_DLL 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)
BOTAN_DLL int botan_cipher_valid_nonce_length(botan_cipher_t cipher, size_t nl)
struct botan_pk_op_decrypt_struct * botan_pk_op_decrypt_t
struct botan_mp_struct * botan_mp_t
BOTAN_DLL int botan_pk_op_verify_finish(botan_pk_op_verify_t op, const uint8_t sig[], size_t sig_len)
BOTAN_DLL int botan_pk_op_verify_create(botan_pk_op_verify_t *op, botan_pubkey_t key, const char *hash_and_padding, uint32_t flags)
BOTAN_DLL int botan_rng_destroy(botan_rng_t rng)
struct botan_x509_cert_struct * botan_x509_cert_t
BOTAN_DLL int botan_privkey_create_rsa(botan_privkey_t *key, botan_rng_t rng, size_t n_bits)
BOTAN_DLL int botan_x509_cert_get_serial_number(botan_x509_cert_t cert, uint8_t out[], size_t *out_len)
BOTAN_DLL int botan_pubkey_export(botan_pubkey_t key, uint8_t out[], size_t *out_len, uint32_t flags)
BOTAN_DLL int botan_pubkey_check_key(botan_pubkey_t key, botan_rng_t rng, uint32_t flags)
BOTAN_DLL int botan_pk_op_sign_destroy(botan_pk_op_sign_t op)
BOTAN_DLL int botan_pk_op_decrypt(botan_pk_op_decrypt_t op, uint8_t out[], size_t *out_len, uint8_t ciphertext[], size_t ciphertext_len)
struct botan_hash_struct * botan_hash_t
BOTAN_DLL int botan_privkey_dsa_get_x(botan_mp_t n, botan_privkey_t key)
BOTAN_DLL int botan_mp_rand_range(botan_mp_t rand_out, botan_rng_t rng, const botan_mp_t lower_bound, const botan_mp_t upper_bound)
BOTAN_DLL int botan_mp_destroy(botan_mp_t mp)
BOTAN_DLL int botan_mp_powmod(botan_mp_t out, const botan_mp_t base, const botan_mp_t exponent, const botan_mp_t modulus)
BOTAN_DLL int botan_mp_mod_inverse(botan_mp_t out, const botan_mp_t in, const botan_mp_t modulus)
BOTAN_DLL int botan_mp_clear_bit(botan_mp_t n, size_t bit)
BOTAN_DLL 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)
BOTAN_DLL int botan_cipher_destroy(botan_cipher_t cipher)
BOTAN_DLL int botan_cipher_init(botan_cipher_t *cipher, const char *name, uint32_t flags)
BOTAN_DLL int botan_pk_op_sign_create(botan_pk_op_sign_t *op, botan_privkey_t key, const char *hash_and_padding, uint32_t flags)
BOTAN_DLL int botan_cipher_start(botan_cipher_t cipher, const uint8_t *nonce, size_t nonce_len)
BOTAN_DLL int botan_privkey_load_rsa(botan_privkey_t *key, botan_mp_t p, botan_mp_t q, botan_mp_t d)
struct botan_pk_op_verify_struct * botan_pk_op_verify_t
BOTAN_DLL int botan_privkey_rsa_get_n(botan_mp_t n, botan_privkey_t rsa_key)
BOTAN_DLL int botan_ffi_supports_api(uint32_t api_version)
BOTAN_DLL int botan_privkey_export_pubkey(botan_pubkey_t *out, botan_privkey_t in)
BOTAN_DLL int botan_privkey_create_ecdh(botan_privkey_t *key, botan_rng_t rng, const char *params)
struct botan_privkey_struct * botan_privkey_t
BOTAN_DLL int botan_cipher_get_default_nonce_length(botan_cipher_t cipher, size_t *nl)
BOTAN_DLL int botan_hash_update(botan_hash_t hash, const uint8_t *in, size_t in_len)
BOTAN_DLL int botan_mp_set_from_radix_str(botan_mp_t dest, const char *str, size_t radix)
BOTAN_DLL int botan_mp_set_from_int(botan_mp_t mp, int initial_value)
BOTAN_DLL int botan_mp_swap(botan_mp_t x, botan_mp_t y)
BOTAN_DLL int botan_mp_mul(botan_mp_t result, const botan_mp_t x, const botan_mp_t y)
BOTAN_DLL int botan_mp_cmp(int *result, const botan_mp_t x, const botan_mp_t y)
BOTAN_DLL uint32_t botan_version_datestamp()
BOTAN_DLL int botan_mp_rand_bits(botan_mp_t rand_out, botan_rng_t rng, size_t bits)
BOTAN_DLL int botan_x509_cert_get_fingerprint(botan_x509_cert_t cert, const char *hash, uint8_t out[], size_t *out_len)
BOTAN_DLL int botan_pk_op_decrypt_destroy(botan_pk_op_decrypt_t op)
BOTAN_DLL int botan_privkey_check_key(botan_privkey_t key, botan_rng_t rng, uint32_t flags)
BOTAN_DLL 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)
BOTAN_DLL int botan_block_cipher_init(botan_block_cipher_t *bc, const char *cipher_name)
BOTAN_DLL int botan_cipher_get_tag_length(botan_cipher_t cipher, size_t *tag_size)
BOTAN_DLL 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)
BOTAN_DLL int botan_x509_cert_get_public_key_bits(botan_x509_cert_t cert, uint8_t out[], size_t *out_len)
struct botan_block_cipher_struct * botan_block_cipher_t
BOTAN_DLL int botan_mp_num_bits(const botan_mp_t n, size_t *bits)
BOTAN_DLL 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)
BOTAN_DLL int botan_block_cipher_destroy(botan_block_cipher_t bc)
BOTAN_DLL int botan_pk_op_verify_update(botan_pk_op_verify_t op, const uint8_t in[], size_t in_len)
BOTAN_DLL int botan_mp_mod_mul(botan_mp_t result, const botan_mp_t x, const botan_mp_t y, const botan_mp_t mod)
BOTAN_DLL int botan_mp_to_hex(const botan_mp_t mp, char *out)
BOTAN_DLL int botan_mp_set_bit(botan_mp_t n, size_t bit)
BOTAN_DLL 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)
BOTAN_DLL int botan_mp_is_zero(const botan_mp_t mp)
BOTAN_DLL int botan_privkey_create_ecdsa(botan_privkey_t *key, botan_rng_t rng, const char *params)
BOTAN_DLL int botan_pubkey_load(botan_pubkey_t *key, const uint8_t bits[], size_t len)
BOTAN_DLL uint32_t botan_version_major()
BOTAN_DLL int botan_x509_cert_to_string(botan_x509_cert_t cert, char out[], size_t *out_len)
BOTAN_DLL int botan_x509_cert_get_public_key(botan_x509_cert_t cert, botan_pubkey_t *key)
#define BOTAN_DEPRECATED(msg)
BOTAN_DLL int botan_mp_is_odd(const botan_mp_t mp)
BOTAN_DLL int botan_mp_is_positive(const botan_mp_t mp)
BOTAN_DLL int botan_pubkey_load_rsa(botan_pubkey_t *key, botan_mp_t n, botan_mp_t e)
BOTAN_DLL int botan_privkey_export(botan_privkey_t key, uint8_t out[], size_t *out_len, uint32_t flags)
BOTAN_DLL int botan_pubkey_dsa_get_q(botan_mp_t q, botan_pubkey_t key)
BOTAN_DLL int botan_hex_encode(const uint8_t *x, size_t len, char *out, uint32_t flags)
struct botan_pk_op_ka_struct * botan_pk_op_ka_t
BOTAN_DLL int botan_pubkey_destroy(botan_pubkey_t key)
BOTAN_DLL 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)
BOTAN_DLL int botan_rng_reseed(botan_rng_t rng, size_t bits)
BOTAN_DLL int botan_privkey_create(botan_privkey_t *key, const char *algo_name, const char *algo_params, botan_rng_t rng)
BOTAN_DLL int botan_x509_cert_get_subject_key_id(botan_x509_cert_t cert, uint8_t out[], size_t *out_len)
BOTAN_DLL int botan_mac_update(botan_mac_t mac, const uint8_t *buf, size_t len)
BOTAN_DLL int botan_privkey_rsa_get_d(botan_mp_t d, botan_privkey_t rsa_key)
struct botan_pubkey_struct * botan_pubkey_t
BOTAN_DLL int botan_privkey_destroy(botan_privkey_t key)
BOTAN_DLL int botan_hash_destroy(botan_hash_t hash)
BOTAN_DLL int botan_mp_init(botan_mp_t *mp)
struct botan_cipher_struct * botan_cipher_t
BOTAN_DLL int botan_mac_init(botan_mac_t *mac, const char *mac_name, uint32_t flags)
BOTAN_DLL int botan_mp_set_from_mp(botan_mp_t dest, const botan_mp_t source)
BOTAN_DLL int botan_mp_sub(botan_mp_t result, const botan_mp_t x, const botan_mp_t y)
BOTAN_DLL int botan_privkey_create_mceliece(botan_privkey_t *key, botan_rng_t rng, size_t n, size_t t)
BOTAN_DLL int botan_mp_lshift(botan_mp_t out, const botan_mp_t in, size_t shift)
BOTAN_DLL int botan_mp_div(botan_mp_t quotient, botan_mp_t remainder, const botan_mp_t x, const botan_mp_t y)
BOTAN_DLL int botan_cipher_get_update_granularity(botan_cipher_t cipher, size_t *ug)
BOTAN_DLL int botan_cipher_query_keylen(botan_cipher_t, size_t *out_minimum_keylength, size_t *out_maximum_keylength)
struct botan_rng_struct * botan_rng_t
BOTAN_DLL int botan_mp_to_uint32(const botan_mp_t mp, uint32_t *val)
BOTAN_DLL int botan_privkey_load(botan_privkey_t *key, botan_rng_t rng, const uint8_t bits[], size_t len, const char *password)
BOTAN_DLL int botan_x509_cert_allowed_usage(botan_x509_cert_t cert, unsigned int key_usage)
BOTAN_DLL 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)
BOTAN_DLL int botan_block_cipher_clear(botan_block_cipher_t bc)
BOTAN_DLL int botan_privkey_rsa_get_q(botan_mp_t q, botan_privkey_t rsa_key)
BOTAN_DLL int botan_mac_clear(botan_mac_t mac)
BOTAN_DLL int botan_block_cipher_block_size(botan_block_cipher_t bc)
BOTAN_DLL int botan_block_cipher_encrypt_blocks(botan_block_cipher_t bc, const uint8_t in[], uint8_t out[], size_t blocks)
BOTAN_DLL int botan_pk_op_encrypt_destroy(botan_pk_op_encrypt_t op)
BOTAN_DLL 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)