Botan 3.9.0
Crypto and TLS for C&
|
#include <botan/ffi.h>
#include <botan/internal/ffi_ec.h>
#include <botan/internal/ffi_mp.h>
#include <botan/internal/ffi_oid.h>
#include <botan/internal/ffi_util.h>
#include <functional>
Go to the source code of this file.
int botan_ec_group_destroy | ( | botan_ec_group_t | ec_group | ) |
Definition at line 20 of file ffi_ec.cpp.
References BOTAN_FFI_CHECKED_DELETE.
int botan_ec_group_equal | ( | botan_ec_group_t | curve1, |
botan_ec_group_t | curve2 ) |
Definition at line 185 of file ffi_ec.cpp.
References BOTAN_FFI_VISIT, and Botan_FFI::safe_get().
int botan_ec_group_from_ber | ( | botan_ec_group_t * | ec_group, |
const uint8_t * | ber, | ||
size_t | ber_len ) |
Decode a BER encoded ECC domain parameter set
ec_group | the new object will be placed here |
ber | encoding |
ber_len | size of the encoding in bytes |
Definition at line 71 of file ffi_ec.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, Botan_FFI::ffi_guard_thunk(), and Botan_FFI::ffi_new_object().
int botan_ec_group_from_name | ( | botan_ec_group_t * | ec_group, |
const char * | name ) |
Initialize an EC Group from a common group name (eg "secp256r1")
ec_group | the new object will be placed here |
name | a known group name |
Definition at line 110 of file ffi_ec.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, Botan_FFI::ffi_guard_thunk(), Botan_FFI::ffi_new_object(), and Botan::EC_Group::from_name().
int botan_ec_group_from_oid | ( | botan_ec_group_t * | ec_group, |
botan_asn1_oid_t | oid ) |
Initialize an EC Group from a group named by an object identifier
ec_group | the new object will be placed here |
oid | a known OID |
Definition at line 97 of file ffi_ec.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, Botan_FFI::ffi_guard_thunk(), Botan_FFI::ffi_new_object(), Botan::EC_Group::from_OID(), and Botan_FFI::safe_get().
int botan_ec_group_from_params | ( | botan_ec_group_t * | ec_group, |
botan_asn1_oid_t | oid, | ||
botan_mp_t | p, | ||
botan_mp_t | a, | ||
botan_mp_t | b, | ||
botan_mp_t | base_x, | ||
botan_mp_t | base_y, | ||
botan_mp_t | order ) |
Create a new EC Group from parameters
ec_group | the new object will be placed here |
p | the elliptic curve prime (at most 521 bits) |
a | the elliptic curve a param |
b | the elliptic curve b param |
base_x | the x coordinate of the group generator |
base_y | the y coordinate of the group generator |
order | the order of the group |
Definition at line 50 of file ffi_ec.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, Botan_FFI::ffi_guard_thunk(), Botan_FFI::ffi_new_object(), and Botan_FFI::safe_get().
int botan_ec_group_from_pem | ( | botan_ec_group_t * | ec_group, |
const char * | pem ) |
Initialize an EC Group from the PEM/ASN.1 encoding
ec_group | the new object will be placed here |
pem | encoding |
Definition at line 84 of file ffi_ec.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, Botan_FFI::ffi_guard_thunk(), Botan_FFI::ffi_new_object(), and Botan::EC_Group::from_PEM().
int botan_ec_group_get_a | ( | botan_mp_t * | a, |
botan_ec_group_t | ec_group ) |
Get the a parameter of the elliptic curve equation
Definition at line 162 of file ffi_ec.cpp.
int botan_ec_group_get_b | ( | botan_mp_t * | b, |
botan_ec_group_t | ec_group ) |
Get the b parameter of the elliptic curve equation
Definition at line 166 of file ffi_ec.cpp.
int botan_ec_group_get_curve_oid | ( | botan_asn1_oid_t * | oid, |
botan_ec_group_t | ec_group ) |
Get the curve OID of an EC Group
Definition at line 134 of file ffi_ec.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_VISIT, and Botan_FFI::ffi_new_object().
int botan_ec_group_get_g_x | ( | botan_mp_t * | g_x, |
botan_ec_group_t | ec_group ) |
Get the x coordinate of the base point
Definition at line 170 of file ffi_ec.cpp.
int botan_ec_group_get_g_y | ( | botan_mp_t * | g_y, |
botan_ec_group_t | ec_group ) |
Get the y coordinate of the base point
Definition at line 175 of file ffi_ec.cpp.
int botan_ec_group_get_order | ( | botan_mp_t * | order, |
botan_ec_group_t | ec_group ) |
Get the order of the base point
Definition at line 180 of file ffi_ec.cpp.
int botan_ec_group_get_p | ( | botan_mp_t * | p, |
botan_ec_group_t | ec_group ) |
Get the prime modulus of the field
Definition at line 158 of file ffi_ec.cpp.
int botan_ec_group_supports_application_specific_group | ( | int * | out | ) |
Checks if in this build configuration it is possible to register an application specific elliptic curve and sets
out | to 1 if so, 0 otherwise |
Definition at line 24 of file ffi_ec.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, and Botan::EC_Group::supports_application_specific_group().
int botan_ec_group_supports_named_group | ( | const char * | name, |
int * | out ) |
Checks if in this build configuration botan_ec_group_from_name(group_ptr, name) will succeed and sets
out | to 1 if so, 0 otherwise. |
Definition at line 36 of file ffi_ec.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, Botan_FFI::ffi_guard_thunk(), and Botan::EC_Group::supports_named_group().
int botan_ec_group_view_der | ( | botan_ec_group_t | ec_group, |
botan_view_ctx | ctx, | ||
botan_view_bin_fn | view ) |
View an EC Group in DER encoding
Definition at line 123 of file ffi_ec.cpp.
References BOTAN_FFI_VISIT, and Botan_FFI::invoke_view_callback().
int botan_ec_group_view_pem | ( | botan_ec_group_t | ec_group, |
botan_view_ctx | ctx, | ||
botan_view_str_fn | view ) |
View an EC Group in PEM encoding
Definition at line 128 of file ffi_ec.cpp.
References BOTAN_FFI_VISIT, Botan_FFI::invoke_view_callback(), and Botan::NamedCurve.