69 #define BOTAN_FFI_EXPORT(maj, min) BOTAN_DLL
71 #if defined(__has_attribute)
72 #if __has_attribute(visibility)
73 #define BOTAN_FFI_EXPORT(maj, min) __attribute__((visibility("default")))
75 #elif defined(_MSC_VER) && !defined(BOTAN_IS_BEING_BUILT)
76 #define BOTAN_FFI_EXPORT(maj, min) __declspec(dllimport)
78 #define BOTAN_FFI_EXPORT(maj, min)
82#if !defined(BOTAN_NO_DEPRECATED_WARNINGS)
83 #if defined(__has_attribute)
84 #if __has_attribute(deprecated)
85 #define BOTAN_FFI_DEPRECATED(msg) __attribute__((deprecated(msg)))
87 #elif defined(_MSC_VER)
88 #define BOTAN_FFI_DEPRECATED(msg) __declspec(deprecated(msg))
92#if !defined(BOTAN_FFI_DEPRECATED)
93 #define BOTAN_FFI_DEPRECATED(msg)
225#define BOTAN_FFI_HEX_LOWER_CASE 1
285 const
char* rng_name,
287 int (*get_cb)(
void* context, uint8_t* out,
size_t out_len),
288 int (*add_entropy_cb)(
void* context, const uint8_t input[],
size_t length),
289 void (*destroy_cb)(
void* context));
510 size_t* out_minimum_keylength,
511 size_t* out_maximum_keylength,
512 size_t* out_keylength_modulo);
526#define BOTAN_CIPHER_INIT_FLAG_MASK_DIRECTION 1
527#define BOTAN_CIPHER_INIT_FLAG_ENCRYPT 0
528#define BOTAN_CIPHER_INIT_FLAG_DECRYPT 1
621#define BOTAN_CIPHER_UPDATE_FLAG_FINAL (1U << 0)
631 size_t* output_written,
632 const uint8_t input_bytes[],
634 size_t* input_consumed);
667 const
char* passphrase,
668 const uint8_t salt[],
700 const
char* passphrase,
701 const uint8_t salt[],
703 size_t milliseconds_to_run,
704 size_t* out_iterations_used);
727 const
char* passphrase,
728 size_t passphrase_len,
729 const uint8_t salt[],
755 const
char* passphrase,
756 size_t passphrase_len,
757 const uint8_t salt[],
769 const
char* passphrase,
770 const uint8_t salt[],
793 const uint8_t secret[],
795 const uint8_t salt[],
797 const uint8_t label[],
862 size_t* out_minimum_keylength,
863 size_t* out_maximum_keylength,
864 size_t* out_keylength_modulo);
1051 uint8_t* out,
size_t* out_len, const
char* password,
botan_rng_t rng,
size_t work_factor, uint32_t flags);
1079#define BOTAN_CHECK_KEY_EXPENSIVE_TESTS 1
1149#define BOTAN_PRIVKEY_EXPORT_FLAG_DER 0
1150#define BOTAN_PRIVKEY_EXPORT_FLAG_PEM 1
1177BOTAN_FFI_EXPORT(2, 0)
1178int botan_privkey_export_encrypted(botan_privkey_t key,
1182 const char* passphrase,
1183 const char* encryption_algo,
1187* Export a private key, running PBKDF for specified amount of time
1188* @param key the private key to export
1190* Note: starting in 3.0, the output iterations count is not provided
1192BOTAN_FFI_EXPORT(2, 0)
1193int botan_privkey_export_encrypted_pbkdf_msec(botan_privkey_t key,
1197 const char* passphrase,
1198 uint32_t pbkdf_msec_runtime,
1199 size_t* pbkdf_iterations_out,
1200 const char* cipher_algo,
1201 const char* pbkdf_algo,
1207BOTAN_FFI_EXPORT(2, 0)
1208int botan_privkey_export_encrypted_pbkdf_iter(botan_privkey_t key,
1212 const char* passphrase,
1213 size_t pbkdf_iterations,
1214 const char* cipher_algo,
1215 const char* pbkdf_algo,
1224BOTAN_FFI_EXPORT(3, 0)
1225int botan_privkey_view_encrypted_der(botan_privkey_t key,
1227 const char* passphrase,
1228 const char* cipher_algo,
1229 const char* pbkdf_algo,
1230 size_t pbkdf_iterations,
1232 botan_view_bin_fn view);
1239BOTAN_FFI_EXPORT(3, 0)
1240int botan_privkey_view_encrypted_der_timed(botan_privkey_t key,
1242 const char* passphrase,
1243 const char* cipher_algo,
1244 const char* pbkdf_algo,
1245 size_t pbkdf_runtime_msec,
1247 botan_view_bin_fn view);
1255BOTAN_FFI_EXPORT(3, 0)
1256int botan_privkey_view_encrypted_pem(botan_privkey_t key,
1258 const char* passphrase,
1259 const char* cipher_algo,
1260 const char* pbkdf_algo,
1261 size_t pbkdf_iterations,
1263 botan_view_str_fn view);
1270BOTAN_FFI_EXPORT(3, 0)
1271int botan_privkey_view_encrypted_pem_timed(botan_privkey_t key,
1273 const char* passphrase,
1274 const char* cipher_algo,
1275 const char* pbkdf_algo,
1276 size_t pbkdf_runtime_msec,
1278 botan_view_str_fn view);
1280typedef struct botan_pubkey_struct* botan_pubkey_t;
1282BOTAN_FFI_EXPORT(2, 0) int botan_pubkey_load(botan_pubkey_t* key, const uint8_t bits[], size_t len);
1284BOTAN_FFI_EXPORT(2, 0) int botan_privkey_export_pubkey(botan_pubkey_t* out, botan_privkey_t in);
1286BOTAN_FFI_EXPORT(2, 0) int botan_pubkey_export(botan_pubkey_t key, uint8_t out[], size_t* out_len, uint32_t flags);
1291BOTAN_FFI_EXPORT(3, 0) int botan_pubkey_view_der(botan_pubkey_t key, botan_view_ctx ctx, botan_view_bin_fn view);
1296BOTAN_FFI_EXPORT(3, 0) int botan_pubkey_view_pem(botan_pubkey_t key, botan_view_ctx ctx, botan_view_str_fn view);
1298BOTAN_FFI_EXPORT(2, 0) int botan_pubkey_algo_name(botan_pubkey_t key, char out[], size_t* out_len);
1303BOTAN_FFI_EXPORT(2, 0) int botan_pubkey_check_key(botan_pubkey_t key, botan_rng_t rng, uint32_t flags);
1305BOTAN_FFI_EXPORT(2, 0) int botan_pubkey_estimated_strength(botan_pubkey_t key, size_t* estimate);
1307BOTAN_FFI_EXPORT(2, 0)
1308int botan_pubkey_fingerprint(botan_pubkey_t key, const char* hash, uint8_t out[], size_t* out_len);
1313BOTAN_FFI_EXPORT(2, 0) int botan_pubkey_destroy(botan_pubkey_t key);
1316* Get arbitrary named fields from public or private keys
1318BOTAN_FFI_EXPORT(2, 0) int botan_pubkey_get_field(botan_mp_t output, botan_pubkey_t key, const char* field_name);
1320BOTAN_FFI_EXPORT(2, 0) int botan_privkey_get_field(botan_mp_t output, botan_privkey_t key, const char* field_name);
1323* Algorithm specific key operations: RSA
1325BOTAN_FFI_EXPORT(2, 0) int botan_privkey_load_rsa(botan_privkey_t* key, botan_mp_t p, botan_mp_t q, botan_mp_t e);
1327BOTAN_FFI_EXPORT(2, 8) int botan_privkey_load_rsa_pkcs1(botan_privkey_t* key, const uint8_t bits[], size_t len);
1330BOTAN_FFI_EXPORT(2, 0) int botan_privkey_rsa_get_p(botan_mp_t p, botan_privkey_t rsa_key);
1332BOTAN_FFI_EXPORT(2, 0) int botan_privkey_rsa_get_q(botan_mp_t q, botan_privkey_t rsa_key);
1334BOTAN_FFI_EXPORT(2, 0) int botan_privkey_rsa_get_d(botan_mp_t d, botan_privkey_t rsa_key);
1336BOTAN_FFI_EXPORT(2, 0) int botan_privkey_rsa_get_n(botan_mp_t n, botan_privkey_t rsa_key);
1338BOTAN_FFI_EXPORT(2, 0) int botan_privkey_rsa_get_e(botan_mp_t e, botan_privkey_t rsa_key);
1340BOTAN_FFI_EXPORT(2, 8)
1341int botan_privkey_rsa_get_privkey(botan_privkey_t rsa_key, uint8_t out[], size_t* out_len, uint32_t flags);
1343BOTAN_FFI_EXPORT(2, 0) int botan_pubkey_load_rsa(botan_pubkey_t* key, botan_mp_t n, botan_mp_t e);
1346BOTAN_FFI_EXPORT(2, 0) int botan_pubkey_rsa_get_e(botan_mp_t e, botan_pubkey_t rsa_key);
1348BOTAN_FFI_EXPORT(2, 0) int botan_pubkey_rsa_get_n(botan_mp_t n, botan_pubkey_t rsa_key);
1351* Algorithm specific key operations: DSA
1353BOTAN_FFI_EXPORT(2, 0)
1354int botan_privkey_load_dsa(botan_privkey_t* key, botan_mp_t p, botan_mp_t q, botan_mp_t g, botan_mp_t x);
1356BOTAN_FFI_EXPORT(2, 0)
1357int botan_pubkey_load_dsa(botan_pubkey_t* key, botan_mp_t p, botan_mp_t q, botan_mp_t g, botan_mp_t y);
1360BOTAN_FFI_EXPORT(2, 0) int botan_privkey_dsa_get_x(botan_mp_t n, botan_privkey_t key);
1363BOTAN_FFI_EXPORT(2, 0) int botan_pubkey_dsa_get_p(botan_mp_t p, botan_pubkey_t key);
1365BOTAN_FFI_EXPORT(2, 0) int botan_pubkey_dsa_get_q(botan_mp_t q, botan_pubkey_t key);
1367BOTAN_FFI_EXPORT(2, 0) int botan_pubkey_dsa_get_g(botan_mp_t d, botan_pubkey_t key);
1369BOTAN_FFI_EXPORT(2, 0) int botan_pubkey_dsa_get_y(botan_mp_t y, botan_pubkey_t key);
1372* Loads Diffie Hellman private key
1374* @param key variable populated with key material
1375* @param p prime order of a Z_p group
1376* @param g group generator
1377* @param x private key
1379* @pre key is NULL on input
1380* @post function allocates memory and assigns to `key'
1382* @return 0 on success, a negative value on failure
1384BOTAN_FFI_EXPORT(2, 0) int botan_privkey_load_dh(botan_privkey_t* key, botan_mp_t p, botan_mp_t g, botan_mp_t x);
1398BOTAN_FFI_EXPORT(2, 0) int botan_pubkey_load_dh(botan_pubkey_t* key, botan_mp_t p, botan_mp_t g, botan_mp_t y);
1401* Algorithm specific key operations: ElGamal
1416BOTAN_FFI_EXPORT(2, 0) int botan_pubkey_load_elgamal(botan_pubkey_t* key, botan_mp_t p, botan_mp_t g, botan_mp_t y);
1431BOTAN_FFI_EXPORT(2, 0) int botan_privkey_load_elgamal(botan_privkey_t* key, botan_mp_t p, botan_mp_t g, botan_mp_t x);
1434* Algorithm specific key operations: Ed25519
1437BOTAN_FFI_EXPORT(2, 2) int botan_privkey_load_ed25519(botan_privkey_t* key, const uint8_t privkey[32]);
1439BOTAN_FFI_EXPORT(2, 2) int botan_pubkey_load_ed25519(botan_pubkey_t* key, const uint8_t pubkey[32]);
1441BOTAN_FFI_EXPORT(2, 2) int botan_privkey_ed25519_get_privkey(botan_privkey_t key, uint8_t output[64]);
1443BOTAN_FFI_EXPORT(2, 2) int botan_pubkey_ed25519_get_pubkey(botan_pubkey_t key, uint8_t pubkey[32]);
1446* Algorithm specific key operations: Ed448
1449BOTAN_FFI_EXPORT(3, 4) int botan_privkey_load_ed448(botan_privkey_t* key, const uint8_t privkey[57]);
1451BOTAN_FFI_EXPORT(3, 4) int botan_pubkey_load_ed448(botan_pubkey_t* key, const uint8_t pubkey[57]);
1453BOTAN_FFI_EXPORT(3, 4) int botan_privkey_ed448_get_privkey(botan_privkey_t key, uint8_t output[57]);
1455BOTAN_FFI_EXPORT(3, 4) int botan_pubkey_ed448_get_pubkey(botan_pubkey_t key, uint8_t pubkey[57]);
1458* Algorithm specific key operations: X25519
1461BOTAN_FFI_EXPORT(2, 8) int botan_privkey_load_x25519(botan_privkey_t* key, const uint8_t privkey[32]);
1463BOTAN_FFI_EXPORT(2, 8) int botan_pubkey_load_x25519(botan_pubkey_t* key, const uint8_t pubkey[32]);
1465BOTAN_FFI_EXPORT(2, 8) int botan_privkey_x25519_get_privkey(botan_privkey_t key, uint8_t output[32]);
1467BOTAN_FFI_EXPORT(2, 8) int botan_pubkey_x25519_get_pubkey(botan_pubkey_t key, uint8_t pubkey[32]);
1470* Algorithm specific key operations: X448
1473BOTAN_FFI_EXPORT(3, 4) int botan_privkey_load_x448(botan_privkey_t* key, const uint8_t privkey[56]);
1475BOTAN_FFI_EXPORT(3, 4) int botan_pubkey_load_x448(botan_pubkey_t* key, const uint8_t pubkey[56]);
1477BOTAN_FFI_EXPORT(3, 4) int botan_privkey_x448_get_privkey(botan_privkey_t key, uint8_t output[56]);
1479BOTAN_FFI_EXPORT(3, 4) int botan_pubkey_x448_get_pubkey(botan_pubkey_t key, uint8_t pubkey[56]);
1482* Algorithm specific key operations: Kyber
1485BOTAN_FFI_EXPORT(3, 1) int botan_privkey_load_kyber(botan_privkey_t* key, const uint8_t privkey[], size_t key_len);
1487BOTAN_FFI_EXPORT(3, 1) int botan_pubkey_load_kyber(botan_pubkey_t* key, const uint8_t pubkey[], size_t key_len);
1489BOTAN_FFI_EXPORT(3, 1)
1490int botan_privkey_view_kyber_raw_key(botan_privkey_t key, botan_view_ctx ctx, botan_view_bin_fn view);
1492BOTAN_FFI_EXPORT(3, 1)
1493int botan_pubkey_view_kyber_raw_key(botan_pubkey_t key, botan_view_ctx ctx, botan_view_bin_fn view);
1496* Algorithm specific key operations: ECDSA and ECDH
1498BOTAN_FFI_EXPORT(3, 2)
1499int botan_pubkey_ecc_key_used_explicit_encoding(botan_pubkey_t key);
1501BOTAN_FFI_EXPORT(2, 2)
1502int botan_privkey_load_ecdsa(botan_privkey_t* key, botan_mp_t scalar, const char* curve_name);
1504BOTAN_FFI_EXPORT(2, 2)
1505int botan_pubkey_load_ecdsa(botan_pubkey_t* key, botan_mp_t public_x, botan_mp_t public_y, const char* curve_name);
1507BOTAN_FFI_EXPORT(2, 2)
1508int botan_pubkey_load_ecdh(botan_pubkey_t* key, botan_mp_t public_x, botan_mp_t public_y, const char* curve_name);
1510BOTAN_FFI_EXPORT(2, 2)
1511int botan_privkey_load_ecdh(botan_privkey_t* key, botan_mp_t scalar, const char* curve_name);
1513BOTAN_FFI_EXPORT(2, 2)
1514int botan_pubkey_load_sm2(botan_pubkey_t* key, botan_mp_t public_x, botan_mp_t public_y, const char* curve_name);
1516BOTAN_FFI_EXPORT(2, 2)
1517int botan_privkey_load_sm2(botan_privkey_t* key, botan_mp_t scalar, const char* curve_name);
1520BOTAN_FFI_EXPORT(2, 2)
1521int botan_pubkey_load_sm2_enc(botan_pubkey_t* key, botan_mp_t public_x, botan_mp_t public_y, const char* curve_name);
1524BOTAN_FFI_EXPORT(2, 2)
1525int botan_privkey_load_sm2_enc(botan_privkey_t* key, botan_mp_t scalar, const char* curve_name);
1527BOTAN_FFI_EXPORT(2, 3)
1528int botan_pubkey_sm2_compute_za(
1529 uint8_t out[], size_t* out_len, const char* ident, const char* hash_algo, botan_pubkey_t key);
1534BOTAN_FFI_EXPORT(3, 0)
1535int botan_pubkey_view_ec_public_point(botan_pubkey_t key, botan_view_ctx ctx, botan_view_bin_fn view);
1538* Public Key Encryption
1540typedef struct botan_pk_op_encrypt_struct* botan_pk_op_encrypt_t;
1542BOTAN_FFI_EXPORT(2, 0)
1543int botan_pk_op_encrypt_create(botan_pk_op_encrypt_t* op, botan_pubkey_t key, const char* padding, uint32_t flags);
1548BOTAN_FFI_EXPORT(2, 0) int botan_pk_op_encrypt_destroy(botan_pk_op_encrypt_t op);
1550BOTAN_FFI_EXPORT(2, 8)
1551int botan_pk_op_encrypt_output_length(botan_pk_op_encrypt_t op, size_t ptext_len, size_t* ctext_len);
1553BOTAN_FFI_EXPORT(2, 0)
1554int botan_pk_op_encrypt(botan_pk_op_encrypt_t op,
1558 const uint8_t plaintext[],
1559 size_t plaintext_len);
1562* Public Key Decryption
1564typedef struct botan_pk_op_decrypt_struct* botan_pk_op_decrypt_t;
1566BOTAN_FFI_EXPORT(2, 0)
1567int botan_pk_op_decrypt_create(botan_pk_op_decrypt_t* op, botan_privkey_t key, const char* padding, uint32_t flags);
1572BOTAN_FFI_EXPORT(2, 0) int botan_pk_op_decrypt_destroy(botan_pk_op_decrypt_t op);
1574BOTAN_FFI_EXPORT(2, 8)
1575int botan_pk_op_decrypt_output_length(botan_pk_op_decrypt_t op, size_t ctext_len, size_t* ptext_len);
1577BOTAN_FFI_EXPORT(2, 0)
1578int botan_pk_op_decrypt(
1579 botan_pk_op_decrypt_t op, uint8_t out[], size_t* out_len, const uint8_t ciphertext[], size_t ciphertext_len);
1582* Signature Generation
1585#define BOTAN_PUBKEY_DER_FORMAT_SIGNATURE 1
1587typedef struct botan_pk_op_sign_struct* botan_pk_op_sign_t;
1589BOTAN_FFI_EXPORT(2, 0)
1590int botan_pk_op_sign_create(botan_pk_op_sign_t* op, botan_privkey_t key, const char* hash_and_padding, uint32_t flags);
1595BOTAN_FFI_EXPORT(2, 0) int botan_pk_op_sign_destroy(botan_pk_op_sign_t op);
1597BOTAN_FFI_EXPORT(2, 8) int botan_pk_op_sign_output_length(botan_pk_op_sign_t op, size_t* olen);
1599BOTAN_FFI_EXPORT(2, 0) int botan_pk_op_sign_update(botan_pk_op_sign_t op, const uint8_t in[], size_t in_len);
1601BOTAN_FFI_EXPORT(2, 0)
1602int botan_pk_op_sign_finish(botan_pk_op_sign_t op, botan_rng_t rng, uint8_t sig[], size_t* sig_len);
1605* Signature Verification
1607typedef struct botan_pk_op_verify_struct* botan_pk_op_verify_t;
1609BOTAN_FFI_EXPORT(2, 0)
1610int botan_pk_op_verify_create(botan_pk_op_verify_t* op,
1612 const char* hash_and_padding,
1618BOTAN_FFI_EXPORT(2, 0) int botan_pk_op_verify_destroy(botan_pk_op_verify_t op);
1620BOTAN_FFI_EXPORT(2, 0) int botan_pk_op_verify_update(botan_pk_op_verify_t op, const uint8_t in[], size_t in_len);
1621BOTAN_FFI_EXPORT(2, 0) int botan_pk_op_verify_finish(botan_pk_op_verify_t op, const uint8_t sig[], size_t sig_len);
1626typedef struct botan_pk_op_ka_struct* botan_pk_op_ka_t;
1628BOTAN_FFI_EXPORT(2, 0)
1629int botan_pk_op_key_agreement_create(botan_pk_op_ka_t* op, botan_privkey_t key, const char* kdf, uint32_t flags);
1634BOTAN_FFI_EXPORT(2, 0) int botan_pk_op_key_agreement_destroy(botan_pk_op_ka_t op);
1636BOTAN_FFI_EXPORT(2, 0) int botan_pk_op_key_agreement_export_public(botan_privkey_t key, uint8_t out[], size_t* out_len);
1638BOTAN_FFI_EXPORT(3, 0)
1639int botan_pk_op_key_agreement_view_public(botan_privkey_t key, botan_view_ctx ctx, botan_view_bin_fn view);
1641BOTAN_FFI_EXPORT(2, 8) int botan_pk_op_key_agreement_size(botan_pk_op_ka_t op, size_t* out_len);
1643BOTAN_FFI_EXPORT(2, 0)
1644int botan_pk_op_key_agreement(botan_pk_op_ka_t op,
1647 const uint8_t other_key[],
1648 size_t other_key_len,
1649 const uint8_t salt[],
1655typedef struct botan_pk_op_kem_encrypt_struct* botan_pk_op_kem_encrypt_t;
1657BOTAN_FFI_EXPORT(3, 0)
1658int botan_pk_op_kem_encrypt_create(botan_pk_op_kem_encrypt_t* op, botan_pubkey_t key, const char* kdf);
1663BOTAN_FFI_EXPORT(3, 0) int botan_pk_op_kem_encrypt_destroy(botan_pk_op_kem_encrypt_t op);
1665BOTAN_FFI_EXPORT(3, 0)
1666int botan_pk_op_kem_encrypt_shared_key_length(botan_pk_op_kem_encrypt_t op,
1667 size_t desired_shared_key_length,
1668 size_t* output_shared_key_length);
1670BOTAN_FFI_EXPORT(3, 0)
1671int botan_pk_op_kem_encrypt_encapsulated_key_length(botan_pk_op_kem_encrypt_t op,
1672 size_t* output_encapsulated_key_length);
1674BOTAN_FFI_EXPORT(3, 0)
1675int botan_pk_op_kem_encrypt_create_shared_key(botan_pk_op_kem_encrypt_t op,
1677 const uint8_t salt[],
1679 size_t desired_shared_key_len,
1680 uint8_t shared_key[],
1681 size_t* shared_key_len,
1682 uint8_t encapsulated_key[],
1683 size_t* encapsulated_key_len);
1685typedef struct botan_pk_op_kem_decrypt_struct* botan_pk_op_kem_decrypt_t;
1687BOTAN_FFI_EXPORT(3, 0)
1688int botan_pk_op_kem_decrypt_create(botan_pk_op_kem_decrypt_t* op, botan_privkey_t key, const char* kdf);
1693BOTAN_FFI_EXPORT(3, 0) int botan_pk_op_kem_decrypt_destroy(botan_pk_op_kem_decrypt_t op);
1695BOTAN_FFI_EXPORT(3, 0)
1696int botan_pk_op_kem_decrypt_shared_key_length(botan_pk_op_kem_decrypt_t op,
1697 size_t desired_shared_key_length,
1698 size_t* output_shared_key_length);
1700BOTAN_FFI_EXPORT(3, 0)
1701int botan_pk_op_kem_decrypt_shared_key(botan_pk_op_kem_decrypt_t op,
1702 const uint8_t salt[],
1704 const uint8_t encapsulated_key[],
1705 size_t encapsulated_key_len,
1706 size_t desired_shared_key_len,
1707 uint8_t shared_key[],
1708 size_t* shared_key_len);
1714BOTAN_FFI_EXPORT(2, 0) int botan_pkcs_hash_id(const char* hash_name, uint8_t pkcs_id[], size_t* pkcs_id_len);
1717* Always returns BOTAN_FFI_ERROR_NOT_IMPLEMENTED
1719BOTAN_FFI_DEPRECATED("No longer implemented
")
1720BOTAN_FFI_EXPORT(2, 0)
1721int botan_mceies_encrypt(botan_pubkey_t mce_key,
1732* Always returns BOTAN_FFI_ERROR_NOT_IMPLEMENTED
1734BOTAN_FFI_DEPRECATED("No longer implemented
")
1735BOTAN_FFI_EXPORT(2, 0)
1736int botan_mceies_decrypt(botan_privkey_t mce_key,
1747**************************/
1749typedef struct botan_x509_cert_struct* botan_x509_cert_t;
1751BOTAN_FFI_EXPORT(2, 0) int botan_x509_cert_load(botan_x509_cert_t* cert_obj, const uint8_t cert[], size_t cert_len);
1752BOTAN_FFI_EXPORT(2, 0) int botan_x509_cert_load_file(botan_x509_cert_t* cert_obj, const char* filename);
1757BOTAN_FFI_EXPORT(2, 0) int botan_x509_cert_destroy(botan_x509_cert_t cert);
1759BOTAN_FFI_EXPORT(2, 8) int botan_x509_cert_dup(botan_x509_cert_t* new_cert, botan_x509_cert_t cert);
1761/* Prefer botan_x509_cert_not_before and botan_x509_cert_not_after */
1762BOTAN_FFI_EXPORT(2, 0) int botan_x509_cert_get_time_starts(botan_x509_cert_t cert, char out[], size_t* out_len);
1763BOTAN_FFI_EXPORT(2, 0) int botan_x509_cert_get_time_expires(botan_x509_cert_t cert, char out[], size_t* out_len);
1765BOTAN_FFI_EXPORT(2, 8) int botan_x509_cert_not_before(botan_x509_cert_t cert, uint64_t* time_since_epoch);
1766BOTAN_FFI_EXPORT(2, 8) int botan_x509_cert_not_after(botan_x509_cert_t cert, uint64_t* time_since_epoch);
1768BOTAN_FFI_EXPORT(2, 0)
1769int botan_x509_cert_get_fingerprint(botan_x509_cert_t cert, const char* hash, uint8_t out[], size_t* out_len);
1771BOTAN_FFI_EXPORT(2, 0) int botan_x509_cert_get_serial_number(botan_x509_cert_t cert, uint8_t out[], size_t* out_len);
1772BOTAN_FFI_EXPORT(2, 0) int botan_x509_cert_get_authority_key_id(botan_x509_cert_t cert, uint8_t out[], size_t* out_len);
1773BOTAN_FFI_EXPORT(2, 0) int botan_x509_cert_get_subject_key_id(botan_x509_cert_t cert, uint8_t out[], size_t* out_len);
1775BOTAN_FFI_EXPORT(2, 0) int botan_x509_cert_get_public_key_bits(botan_x509_cert_t cert, uint8_t out[], size_t* out_len);
1777BOTAN_FFI_EXPORT(3, 0)
1778int botan_x509_cert_view_public_key_bits(botan_x509_cert_t cert, botan_view_ctx ctx, botan_view_bin_fn view);
1780BOTAN_FFI_EXPORT(2, 0) int botan_x509_cert_get_public_key(botan_x509_cert_t cert, botan_pubkey_t* key);
1782BOTAN_FFI_EXPORT(2, 0)
1783int botan_x509_cert_get_issuer_dn(
1784 botan_x509_cert_t cert, const char* key, size_t index, uint8_t out[], size_t* out_len);
1786BOTAN_FFI_EXPORT(2, 0)
1787int botan_x509_cert_get_subject_dn(
1788 botan_x509_cert_t cert, const char* key, size_t index, uint8_t out[], size_t* out_len);
1790BOTAN_FFI_EXPORT(2, 0) int botan_x509_cert_to_string(botan_x509_cert_t cert, char out[], size_t* out_len);
1792BOTAN_FFI_EXPORT(3, 0)
1793int botan_x509_cert_view_as_string(botan_x509_cert_t cert, botan_view_ctx ctx, botan_view_str_fn view);
1795/* Must match values of Key_Constraints in key_constraints.h */
1796enum botan_x509_cert_key_constraints {
1798 DIGITAL_SIGNATURE = 32768,
1799 NON_REPUDIATION = 16384,
1800 KEY_ENCIPHERMENT = 8192,
1801 DATA_ENCIPHERMENT = 4096,
1802 KEY_AGREEMENT = 2048,
1803 KEY_CERT_SIGN = 1024,
1805 ENCIPHER_ONLY = 256,
1809BOTAN_FFI_EXPORT(2, 0) int botan_x509_cert_allowed_usage(botan_x509_cert_t cert, unsigned int key_usage);
1815BOTAN_FFI_EXPORT(2, 5) int botan_x509_cert_hostname_match(botan_x509_cert_t cert, const char* hostname);
1825BOTAN_FFI_EXPORT(2, 8)
1826int botan_x509_cert_verify(int* validation_result,
1827 botan_x509_cert_t cert,
1828 const botan_x509_cert_t* intermediates,
1829 size_t intermediates_len,
1830 const botan_x509_cert_t* trusted,
1832 const char* trusted_path,
1833 size_t required_strength,
1834 const char* hostname,
1835 uint64_t reference_time);
1841BOTAN_FFI_EXPORT(2, 8) const char* botan_x509_cert_validation_status(int code);
1845**************************/
1847typedef struct botan_x509_crl_struct* botan_x509_crl_t;
1849BOTAN_FFI_EXPORT(2, 13) int botan_x509_crl_load_file(botan_x509_crl_t* crl_obj, const char* crl_path);
1850BOTAN_FFI_EXPORT(2, 13)
1851int botan_x509_crl_load(botan_x509_crl_t* crl_obj, const uint8_t crl_bits[], size_t crl_bits_len);
1853BOTAN_FFI_EXPORT(2, 13) int botan_x509_crl_destroy(botan_x509_crl_t crl);
1859BOTAN_FFI_EXPORT(2, 13) int botan_x509_is_revoked(botan_x509_crl_t crl, botan_x509_cert_t cert);
1865BOTAN_FFI_EXPORT(2, 13)
1866int botan_x509_cert_verify_with_crl(int* validation_result,
1867 botan_x509_cert_t cert,
1868 const botan_x509_cert_t* intermediates,
1869 size_t intermediates_len,
1870 const botan_x509_cert_t* trusted,
1872 const botan_x509_crl_t* crls,
1874 const char* trusted_path,
1875 size_t required_strength,
1876 const char* hostname,
1877 uint64_t reference_time);
1883BOTAN_FFI_EXPORT(2, 2)
1884int botan_key_wrap3394(const uint8_t key[],
1886 const uint8_t kek[],
1888 uint8_t wrapped_key[],
1889 size_t* wrapped_key_len);
1892BOTAN_FFI_EXPORT(2, 2)
1893int botan_key_unwrap3394(const uint8_t wrapped_key[],
1894 size_t wrapped_key_len,
1895 const uint8_t kek[],
1900BOTAN_FFI_EXPORT(3, 0)
1901int botan_nist_kw_enc(const char* cipher_algo,
1903 const uint8_t key[],
1905 const uint8_t kek[],
1907 uint8_t wrapped_key[],
1908 size_t* wrapped_key_len);
1910BOTAN_FFI_EXPORT(3, 0)
1911int botan_nist_kw_dec(const char* cipher_algo,
1913 const uint8_t wrapped_key[],
1914 size_t wrapped_key_len,
1915 const uint8_t kek[],
1924typedef struct botan_hotp_struct* botan_hotp_t;
1929BOTAN_FFI_EXPORT(2, 8)
1930int botan_hotp_init(botan_hotp_t* hotp, const uint8_t key[], size_t key_len, const char* hash_algo, size_t digits);
1936BOTAN_FFI_EXPORT(2, 8)
1937int botan_hotp_destroy(botan_hotp_t hotp);
1942BOTAN_FFI_EXPORT(2, 8)
1943int botan_hotp_generate(botan_hotp_t hotp, uint32_t* hotp_code, uint64_t hotp_counter);
1948BOTAN_FFI_EXPORT(2, 8)
1949int botan_hotp_check(
1950 botan_hotp_t hotp, uint64_t* next_hotp_counter, uint32_t hotp_code, uint64_t hotp_counter, size_t resync_range);
1956typedef struct botan_totp_struct* botan_totp_t;
1961BOTAN_FFI_EXPORT(2, 8)
1963 botan_totp_t* totp, const uint8_t key[], size_t key_len, const char* hash_algo, size_t digits, size_t time_step);
1969BOTAN_FFI_EXPORT(2, 8)
1970int botan_totp_destroy(botan_totp_t totp);
1978BOTAN_FFI_EXPORT(2, 8)
1979int botan_totp_generate(botan_totp_t totp, uint32_t* totp_code, uint64_t timestamp);
1989BOTAN_FFI_EXPORT(2, 8)
1990int botan_totp_check(botan_totp_t totp, uint32_t totp_code, uint64_t timestamp, size_t acceptable_clock_drift);
1996typedef struct botan_fpe_struct* botan_fpe_t;
1998#define BOTAN_FPE_FLAG_FE1_COMPAT_MODE 1
2000BOTAN_FFI_EXPORT(2, 8)
2001int botan_fpe_fe1_init(
2002 botan_fpe_t* fpe, botan_mp_t n, const uint8_t key[], size_t key_len, size_t rounds, uint32_t flags);
2007BOTAN_FFI_EXPORT(2, 8)
2008int botan_fpe_destroy(botan_fpe_t fpe);
2010BOTAN_FFI_EXPORT(2, 8)
2011int botan_fpe_encrypt(botan_fpe_t fpe, botan_mp_t x, const uint8_t tweak[], size_t tweak_len);
2013BOTAN_FFI_EXPORT(2, 8)
2014int botan_fpe_decrypt(botan_fpe_t fpe, botan_mp_t x, const uint8_t tweak[], size_t tweak_len);
2019typedef struct botan_srp6_server_session_struct* botan_srp6_server_session_t;
2025BOTAN_FFI_EXPORT(3, 0)
2026int botan_srp6_server_session_init(botan_srp6_server_session_t* srp6);
2033BOTAN_FFI_EXPORT(3, 0)
2034int botan_srp6_server_session_destroy(botan_srp6_server_session_t srp6);
2048BOTAN_FFI_EXPORT(3, 0)
2049int botan_srp6_server_session_step1(botan_srp6_server_session_t srp6,
2050 const uint8_t verifier[],
2051 size_t verifier_len,
2052 const char* group_id,
2053 const char* hash_id,
2054 botan_rng_t rng_obj,
2067BOTAN_FFI_EXPORT(3, 0)
2068int botan_srp6_server_session_step2(
2069 botan_srp6_server_session_t srp6, const uint8_t A[], size_t A_len, uint8_t key[], size_t* key_len);
2083BOTAN_FFI_EXPORT(3, 0)
2084int botan_srp6_generate_verifier(const char* identifier,
2085 const char* password,
2086 const uint8_t salt[],
2088 const char* group_id,
2089 const char* hash_id,
2091 size_t* verifier_len);
2110BOTAN_FFI_EXPORT(3, 0)
2111int botan_srp6_client_agree(const char* username,
2112 const char* password,
2113 const char* group_id,
2114 const char* hash_id,
2115 const uint8_t salt[],
2119 botan_rng_t rng_obj,
2128BOTAN_FFI_EXPORT(3, 0)
2129int botan_srp6_group_size(const char* group_id, size_t* group_p_bytes);
2149BOTAN_FFI_EXPORT(3, 0)
2150int botan_zfec_encode(size_t K, size_t N, const uint8_t* input, size_t size, uint8_t** outputs);
2170BOTAN_FFI_EXPORT(3, 0)
2171int botan_zfec_decode(
2172 size_t K, size_t N, const size_t* indexes, uint8_t* const* inputs, size_t shareSize, uint8_t** outputs);
int botan_mp_lshift(botan_mp_t out, botan_mp_t in, size_t shift)
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_mp_is_prime(botan_mp_t n, botan_rng_t rng, size_t test_prob)
int botan_rng_reseed_from_rng(botan_rng_t rng, botan_rng_t source_rng, size_t bits)
int botan_mp_div(botan_mp_t quotient, botan_mp_t remainder, botan_mp_t x, botan_mp_t y)
uint32_t botan_version_minor(void)
int botan_mp_set_from_int(botan_mp_t mp, int initial_value)
int botan_mp_to_bin(botan_mp_t mp, uint8_t vec[])
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_privkey_check_key(botan_privkey_t key, botan_rng_t rng, uint32_t flags)
int botan_base64_encode(const uint8_t *x, size_t len, char *out, size_t *out_len)
int botan_privkey_create_elgamal(botan_privkey_t *key, botan_rng_t rng, size_t pbits, size_t qbits)
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_hash_update(botan_hash_t hash, const uint8_t *in, size_t in_len)
int botan_mp_rshift(botan_mp_t out, botan_mp_t in, size_t shift)
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_privkey_create_rsa(botan_privkey_t *key, botan_rng_t rng, size_t n_bits)
uint32_t botan_version_datestamp(void)
uint32_t botan_version_patch(void)
int botan_privkey_create_ecdsa(botan_privkey_t *key, botan_rng_t rng, const char *params)
int botan_mp_set_from_radix_str(botan_mp_t dest, const char *str, size_t radix)
int botan_rng_add_entropy(botan_rng_t rng, const uint8_t *entropy, size_t entropy_len)
int botan_cipher_start(botan_cipher_t cipher, const uint8_t *nonce, size_t nonce_len)
int botan_mp_add(botan_mp_t result, botan_mp_t x, botan_mp_t y)
int botan_mp_powmod(botan_mp_t out, botan_mp_t base, botan_mp_t exponent, botan_mp_t modulus)
uint32_t botan_version_major(void)
int botan_cipher_valid_nonce_length(botan_cipher_t cipher, size_t nl)
int botan_mac_init(botan_mac_t *mac, const char *mac_name, uint32_t flags)
int botan_mp_to_uint32(botan_mp_t mp, uint32_t *val)
int botan_privkey_create_dh(botan_privkey_t *key, botan_rng_t rng, const char *param)
int botan_hash_name(botan_hash_t hash, char *name, size_t *name_len)
int botan_cipher_get_tag_length(botan_cipher_t cipher, size_t *tag_size)
int botan_privkey_get_field(botan_mp_t output, botan_privkey_t key, const char *field_name)
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))
#define BOTAN_FFI_EXPORT(maj, min)
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_reseed(botan_rng_t rng, size_t bits)
int botan_mp_init(botan_mp_t *mp)
int botan_same_mem(const uint8_t *x, const uint8_t *y, size_t len)
int botan_privkey_load(botan_privkey_t *key, botan_rng_t rng, const uint8_t bits[], size_t len, const char *password)
struct botan_mac_struct * botan_mac_t
int botan_base64_decode(const char *base64_str, size_t in_len, uint8_t *out, size_t *out_len)
int botan_mac_destroy(botan_mac_t mac)
int botan_mp_is_odd(botan_mp_t mp)
int botan_cipher_requires_entire_message(botan_cipher_t cipher)
struct botan_privkey_struct * botan_privkey_t
int botan_cipher_output_length(botan_cipher_t cipher, size_t in_len, size_t *out_len)
int botan_cipher_reset(botan_cipher_t cipher)
int botan_cipher_init(botan_cipher_t *cipher, const char *name, uint32_t flags)
int botan_block_cipher_clear(botan_block_cipher_t bc)
int botan_privkey_export(botan_privkey_t key, uint8_t out[], size_t *out_len, uint32_t flags)
int botan_hash_destroy(botan_hash_t hash)
int botan_mac_set_nonce(botan_mac_t mac, const uint8_t *nonce, size_t nonce_len)
int botan_block_cipher_block_size(botan_block_cipher_t bc)
int botan_cipher_destroy(botan_cipher_t cipher)
#define BOTAN_FFI_DEPRECATED(msg)
int botan_mp_num_bytes(botan_mp_t n, size_t *bytes)
int botan_cipher_name(botan_cipher_t cipher, char *name, size_t *name_len)
int botan_cipher_set_associated_data(botan_cipher_t cipher, const uint8_t *ad, size_t ad_len)
int botan_cipher_get_keyspec(botan_cipher_t, size_t *min_keylen, size_t *max_keylen, size_t *mod_keylen)
int botan_privkey_destroy(botan_privkey_t key)
int botan_mp_from_bin(botan_mp_t mp, const uint8_t vec[], size_t vec_len)
int botan_block_cipher_decrypt_blocks(botan_block_cipher_t bc, const uint8_t in[], uint8_t out[], size_t blocks)
int botan_hash_clear(botan_hash_t hash)
int botan_mp_add_u32(botan_mp_t result, botan_mp_t x, uint32_t y)
int botan_mp_to_hex(botan_mp_t mp, char *out)
int botan_privkey_view_der(botan_privkey_t key, botan_view_ctx ctx, botan_view_bin_fn view)
int botan_mp_swap(botan_mp_t x, botan_mp_t y)
int botan_mp_destroy(botan_mp_t mp)
uint32_t botan_ffi_api_version(void)
int botan_mp_mod_mul(botan_mp_t result, botan_mp_t x, botan_mp_t y, botan_mp_t mod)
int botan_hash_output_length(botan_hash_t hash, size_t *output_length)
int botan_mp_rand_bits(botan_mp_t rand_out, botan_rng_t rng, size_t bits)
int botan_cipher_set_key(botan_cipher_t cipher, const uint8_t *key, size_t key_len)
int botan_mp_equal(botan_mp_t x, botan_mp_t y)
int botan_cipher_query_keylen(botan_cipher_t, size_t *out_minimum_keylength, size_t *out_maximum_keylength)
int botan_mp_set_from_str(botan_mp_t dest, const char *str)
int botan_mp_flip_sign(botan_mp_t mp)
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_cipher_get_ideal_update_granularity(botan_cipher_t cipher, size_t *ug)
int botan_mp_clear_bit(botan_mp_t n, size_t bit)
int botan_mp_is_zero(botan_mp_t mp)
int botan_mp_mod_inverse(botan_mp_t out, botan_mp_t in, botan_mp_t modulus)
int botan_mp_cmp(int *result, botan_mp_t x, botan_mp_t y)
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_mp_gcd(botan_mp_t out, botan_mp_t x, botan_mp_t y)
struct botan_block_cipher_struct * botan_block_cipher_t
int botan_system_rng_get(uint8_t *out, size_t out_len)
const char * botan_version_string(void)
int botan_hex_encode(const uint8_t *x, size_t len, char *out, uint32_t flags)
int botan_mp_clear(botan_mp_t mp)
int botan_cipher_is_authenticated(botan_cipher_t cipher)
int botan_mp_get_bit(botan_mp_t n, size_t bit)
int botan_privkey_load_sm2(botan_privkey_t *key, botan_mp_t scalar, const char *curve_name)
int botan_mac_final(botan_mac_t mac, uint8_t out[])
int botan_block_cipher_name(botan_block_cipher_t cipher, char *name, size_t *name_len)
int botan_rng_get(botan_rng_t rng, uint8_t *out, size_t out_len)
int(* botan_view_bin_fn)(botan_view_ctx view_ctx, const uint8_t *data, size_t len)
int botan_mp_sub_u32(botan_mp_t result, botan_mp_t x, uint32_t y)
int botan_scrub_mem(void *mem, size_t bytes)
int botan_mp_num_bits(botan_mp_t n, size_t *bits)
int botan_privkey_create(botan_privkey_t *key, const char *algo_name, const char *algo_params, botan_rng_t rng)
int botan_mac_update(botan_mac_t mac, const uint8_t *buf, size_t len)
int botan_privkey_create_mceliece(botan_privkey_t *key, botan_rng_t rng, size_t n, size_t t)
int botan_mp_mul(botan_mp_t result, botan_mp_t x, botan_mp_t y)
int botan_privkey_algo_name(botan_privkey_t key, char out[], size_t *out_len)
int botan_hash_block_size(botan_hash_t hash, size_t *block_size)
int botan_hash_copy_state(botan_hash_t *dest, botan_hash_t source)
int botan_pubkey_get_field(botan_mp_t output, botan_pubkey_t key, const char *field_name)
int botan_privkey_create_dsa(botan_privkey_t *key, botan_rng_t rng, size_t pbits, size_t qbits)
int botan_pubkey_load_sm2(botan_pubkey_t *key, botan_mp_t public_x, botan_mp_t public_y, const char *curve_name)
struct botan_mp_struct * botan_mp_t
struct botan_rng_struct * botan_rng_t
int botan_block_cipher_destroy(botan_block_cipher_t bc)
@ BOTAN_FFI_ERROR_NOT_IMPLEMENTED
@ BOTAN_FFI_ERROR_INVALID_KEY_LENGTH
@ BOTAN_FFI_ERROR_KEY_NOT_SET
@ BOTAN_FFI_ERROR_TLS_ERROR
@ BOTAN_FFI_ERROR_EXCEPTION_THROWN
@ BOTAN_FFI_ERROR_OUT_OF_MEMORY
@ BOTAN_FFI_ERROR_INTERNAL_ERROR
@ BOTAN_FFI_INVALID_VERIFIER
@ BOTAN_FFI_ERROR_INVALID_OBJECT
@ BOTAN_FFI_ERROR_UNKNOWN_ERROR
@ BOTAN_FFI_ERROR_HTTP_ERROR
@ BOTAN_FFI_ERROR_BAD_FLAG
@ BOTAN_FFI_ERROR_INVALID_INPUT
@ BOTAN_FFI_ERROR_STRING_CONVERSION_ERROR
@ BOTAN_FFI_ERROR_NULL_POINTER
@ BOTAN_FFI_ERROR_SYSTEM_ERROR
@ BOTAN_FFI_ERROR_ROUGHTIME_ERROR
@ BOTAN_FFI_ERROR_INVALID_OBJECT_STATE
@ BOTAN_FFI_ERROR_INSUFFICIENT_BUFFER_SPACE
@ BOTAN_FFI_ERROR_BAD_MAC
@ BOTAN_FFI_ERROR_BAD_PARAMETER
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_mac_name(botan_mac_t mac, char *name, size_t *name_len)
int botan_cipher_clear(botan_cipher_t hash)
int botan_mp_is_even(botan_mp_t mp)
int botan_rng_destroy(botan_rng_t rng)
int botan_ffi_supports_api(uint32_t api_version)
const char * botan_error_description(int err)
int botan_hash_final(botan_hash_t hash, uint8_t out[])
const char * botan_error_last_exception_message(void)
int botan_hash_init(botan_hash_t *hash, const char *hash_name, uint32_t flags)
int botan_mac_get_keyspec(botan_mac_t mac, size_t *out_minimum_keylength, size_t *out_maximum_keylength, size_t *out_keylength_modulo)
struct botan_cipher_struct * botan_cipher_t
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)
int botan_mac_output_length(botan_mac_t mac, size_t *output_length)
int(* botan_view_str_fn)(botan_view_ctx view_ctx, const char *str, size_t len)
int botan_constant_time_compare(const uint8_t *x, const uint8_t *y, size_t len)
int botan_mp_is_negative(botan_mp_t mp)
int botan_hex_decode(const char *hex_str, size_t in_len, uint8_t *out, size_t *out_len)
int botan_mac_set_key(botan_mac_t mac, const uint8_t *key, size_t key_len)
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_mp_sub(botan_mp_t result, botan_mp_t x, botan_mp_t y)
int botan_privkey_create_ecdh(botan_privkey_t *key, botan_rng_t rng, const char *params)
int botan_rng_init(botan_rng_t *rng, const char *rng_type)
int botan_block_cipher_encrypt_blocks(botan_block_cipher_t bc, const uint8_t in[], uint8_t out[], size_t blocks)
int botan_cipher_get_default_nonce_length(botan_cipher_t cipher, size_t *nl)
int botan_mp_is_positive(botan_mp_t mp)
int botan_privkey_view_pem(botan_privkey_t key, botan_view_ctx ctx, botan_view_str_fn view)
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_cipher_get_update_granularity(botan_cipher_t cipher, size_t *ug)
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_mac_clear(botan_mac_t mac)
int botan_mp_to_str(botan_mp_t mp, uint8_t base, char *out, size_t *out_len)
int botan_block_cipher_set_key(botan_block_cipher_t bc, const uint8_t key[], size_t len)
int botan_mp_set_bit(botan_mp_t n, size_t bit)
int botan_bcrypt_is_valid(const char *pass, const char *hash)
int botan_mp_set_from_mp(botan_mp_t dest, botan_mp_t source)
struct botan_hash_struct * botan_hash_t