Botan 3.6.1
Crypto and TLS for C&
|
#include <botan/ffi.h>
#include <botan/pubkey.h>
#include <botan/system_rng.h>
#include <botan/internal/ffi_pkey.h>
#include <botan/internal/ffi_rng.h>
#include <botan/internal/ffi_util.h>
Go to the source code of this file.
Functions | |
BOTAN_FFI_DECLARE_STRUCT (botan_pk_op_decrypt_struct, Botan::PK_Decryptor, 0x912F3C37) | |
BOTAN_FFI_DECLARE_STRUCT (botan_pk_op_encrypt_struct, Botan::PK_Encryptor, 0x891F3FC3) | |
BOTAN_FFI_DECLARE_STRUCT (botan_pk_op_ka_struct, Botan::PK_Key_Agreement, 0x2939CAB1) | |
BOTAN_FFI_DECLARE_STRUCT (botan_pk_op_kem_decrypt_struct, Botan::PK_KEM_Decryptor, 0x1743D8E6) | |
BOTAN_FFI_DECLARE_STRUCT (botan_pk_op_kem_encrypt_struct, Botan::PK_KEM_Encryptor, 0x1D13A446) | |
BOTAN_FFI_DECLARE_STRUCT (botan_pk_op_sign_struct, Botan::PK_Signer, 0x1AF0C39F) | |
BOTAN_FFI_DECLARE_STRUCT (botan_pk_op_verify_struct, Botan::PK_Verifier, 0x2B91F936) | |
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_obj, 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_obj, 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_obj, 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_obj, const char *padding) |
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_out[], 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_obj, const char *padding) |
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_out[], size_t *shared_key_len, uint8_t encapsulated_key_out[], 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_obj, 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_obj, const char *hash, 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_obj, uint8_t out[], size_t *out_len) |
int | botan_pk_op_sign_output_length (botan_pk_op_sign_t op, size_t *sig_len) |
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_obj, const char *hash, 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) |
BOTAN_FFI_DECLARE_STRUCT | ( | botan_pk_op_decrypt_struct | , |
Botan::PK_Decryptor | , | ||
0x912F3C37 | ) |
BOTAN_FFI_DECLARE_STRUCT | ( | botan_pk_op_encrypt_struct | , |
Botan::PK_Encryptor | , | ||
0x891F3FC3 | ) |
BOTAN_FFI_DECLARE_STRUCT | ( | botan_pk_op_ka_struct | , |
Botan::PK_Key_Agreement | , | ||
0x2939CAB1 | ) |
BOTAN_FFI_DECLARE_STRUCT | ( | botan_pk_op_kem_decrypt_struct | , |
Botan::PK_KEM_Decryptor | , | ||
0x1743D8E6 | ) |
BOTAN_FFI_DECLARE_STRUCT | ( | botan_pk_op_kem_encrypt_struct | , |
Botan::PK_KEM_Encryptor | , | ||
0x1D13A446 | ) |
BOTAN_FFI_DECLARE_STRUCT | ( | botan_pk_op_sign_struct | , |
Botan::PK_Signer | , | ||
0x1AF0C39F | ) |
BOTAN_FFI_DECLARE_STRUCT | ( | botan_pk_op_verify_struct | , |
Botan::PK_Verifier | , | ||
0x2B91F936 | ) |
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_obj, | ||
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_obj, | ||
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_obj, | ||
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_obj, | ||
const char * | padding ) |
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_out[], | ||
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_obj, | ||
const char * | padding ) |
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_out[], | ||
size_t * | shared_key_len, | ||
uint8_t | encapsulated_key_out[], | ||
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_obj, | ||
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_obj, | ||
const char * | hash, | ||
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_obj, | ||
uint8_t | out[], | ||
size_t * | out_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 * | sig_len ) |
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_obj, | ||
const char * | hash, | ||
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.