Ark Server API (ASE) - Wiki
Loading...
Searching...
No Matches
ec.h File Reference
#include <openssl/opensslconf.h>
#include <openssl/asn1.h>
#include <openssl/symhacks.h>
#include <openssl/bn.h>
#include <openssl/ecerr.h>
+ Include dependency graph for ec.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  EC_builtin_curve
 

Macros

#define OPENSSL_ECC_MAX_FIELD_BITS   661
 
#define OPENSSL_EC_EXPLICIT_CURVE   0x000
 
#define OPENSSL_EC_NAMED_CURVE   0x001
 
#define d2i_ECPKParameters_bio(bp, x)   ASN1_d2i_bio_of(EC_GROUP,NULL,d2i_ECPKParameters,bp,x)
 
#define i2d_ECPKParameters_bio(bp, x)   ASN1_i2d_bio_of_const(EC_GROUP,i2d_ECPKParameters,bp,x)
 
#define d2i_ECPKParameters_fp(fp, x)
 
#define i2d_ECPKParameters_fp(fp, x)
 
#define EC_PKEY_NO_PARAMETERS   0x001
 
#define EC_PKEY_NO_PUBKEY   0x002
 
#define EC_FLAG_NON_FIPS_ALLOW   0x1
 
#define EC_FLAG_FIPS_CHECKED   0x2
 
#define EC_FLAG_COFACTOR_ECDH   0x1000
 
#define EC_KEY_get_ex_new_index(l, p, newf, dupf, freef)    CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_EC_KEY, l, p, newf, dupf, freef)
 
#define ECParameters_dup(x)   ASN1_dup_of(EC_KEY,i2d_ECParameters,d2i_ECParameters,x)
 
#define EVP_PKEY_CTX_set_ec_paramgen_curve_nid(ctx, nid)
 
#define EVP_PKEY_CTX_set_ec_param_enc(ctx, flag)
 
#define EVP_PKEY_CTX_set_ecdh_cofactor_mode(ctx, flag)
 
#define EVP_PKEY_CTX_get_ecdh_cofactor_mode(ctx)
 
#define EVP_PKEY_CTX_set_ecdh_kdf_type(ctx, kdf)
 
#define EVP_PKEY_CTX_get_ecdh_kdf_type(ctx)
 
#define EVP_PKEY_CTX_set_ecdh_kdf_md(ctx, md)
 
#define EVP_PKEY_CTX_get_ecdh_kdf_md(ctx, pmd)
 
#define EVP_PKEY_CTX_set_ecdh_kdf_outlen(ctx, len)
 
#define EVP_PKEY_CTX_get_ecdh_kdf_outlen(ctx, plen)
 
#define EVP_PKEY_CTX_set0_ecdh_kdf_ukm(ctx, p, plen)
 
#define EVP_PKEY_CTX_get0_ecdh_kdf_ukm(ctx, p)
 
#define EVP_PKEY_CTX_set1_id(ctx, id, id_len)
 
#define EVP_PKEY_CTX_get1_id(ctx, id)
 
#define EVP_PKEY_CTX_get1_id_len(ctx, id_len)
 
#define EVP_PKEY_CTRL_EC_PARAMGEN_CURVE_NID   (EVP_PKEY_ALG_CTRL + 1)
 
#define EVP_PKEY_CTRL_EC_PARAM_ENC   (EVP_PKEY_ALG_CTRL + 2)
 
#define EVP_PKEY_CTRL_EC_ECDH_COFACTOR   (EVP_PKEY_ALG_CTRL + 3)
 
#define EVP_PKEY_CTRL_EC_KDF_TYPE   (EVP_PKEY_ALG_CTRL + 4)
 
#define EVP_PKEY_CTRL_EC_KDF_MD   (EVP_PKEY_ALG_CTRL + 5)
 
#define EVP_PKEY_CTRL_GET_EC_KDF_MD   (EVP_PKEY_ALG_CTRL + 6)
 
#define EVP_PKEY_CTRL_EC_KDF_OUTLEN   (EVP_PKEY_ALG_CTRL + 7)
 
#define EVP_PKEY_CTRL_GET_EC_KDF_OUTLEN   (EVP_PKEY_ALG_CTRL + 8)
 
#define EVP_PKEY_CTRL_EC_KDF_UKM   (EVP_PKEY_ALG_CTRL + 9)
 
#define EVP_PKEY_CTRL_GET_EC_KDF_UKM   (EVP_PKEY_ALG_CTRL + 10)
 
#define EVP_PKEY_CTRL_SET1_ID   (EVP_PKEY_ALG_CTRL + 11)
 
#define EVP_PKEY_CTRL_GET1_ID   (EVP_PKEY_ALG_CTRL + 12)
 
#define EVP_PKEY_CTRL_GET1_ID_LEN   (EVP_PKEY_ALG_CTRL + 13)
 
#define EVP_PKEY_ECDH_KDF_NONE   1
 
#define EVP_PKEY_ECDH_KDF_X9_63   2
 
#define EVP_PKEY_ECDH_KDF_X9_62   EVP_PKEY_ECDH_KDF_X9_63
 

Typedefs

typedef struct ec_method_st EC_METHOD
 
typedef struct ec_group_st EC_GROUP
 
typedef struct ec_point_st EC_POINT
 
typedef struct ecpk_parameters_st ECPKPARAMETERS
 
typedef struct ec_parameters_st ECPARAMETERS
 
typedef struct ECDSA_SIG_st ECDSA_SIG
 

Enumerations

enum  point_conversion_form_t { POINT_CONVERSION_COMPRESSED = 2 , POINT_CONVERSION_UNCOMPRESSED = 4 , POINT_CONVERSION_HYBRID = 6 }
 

Functions

const EC_METHODEC_GFp_simple_method (void)
 
const EC_METHODEC_GFp_mont_method (void)
 
const EC_METHODEC_GFp_nist_method (void)
 
const EC_METHODEC_GFp_nistp224_method (void)
 
const EC_METHODEC_GFp_nistp256_method (void)
 
const EC_METHODEC_GFp_nistp521_method (void)
 
const EC_METHODEC_GF2m_simple_method (void)
 
EC_GROUPEC_GROUP_new (const EC_METHOD *meth)
 
void EC_GROUP_free (EC_GROUP *group)
 
void EC_GROUP_clear_free (EC_GROUP *group)
 
int EC_GROUP_copy (EC_GROUP *dst, const EC_GROUP *src)
 
EC_GROUPEC_GROUP_dup (const EC_GROUP *src)
 
const EC_METHODEC_GROUP_method_of (const EC_GROUP *group)
 
int EC_METHOD_get_field_type (const EC_METHOD *meth)
 
int EC_GROUP_set_generator (EC_GROUP *group, const EC_POINT *generator, const BIGNUM *order, const BIGNUM *cofactor)
 
const EC_POINTEC_GROUP_get0_generator (const EC_GROUP *group)
 
BN_MONT_CTXEC_GROUP_get_mont_data (const EC_GROUP *group)
 
int EC_GROUP_get_order (const EC_GROUP *group, BIGNUM *order, BN_CTX *ctx)
 
const BIGNUMEC_GROUP_get0_order (const EC_GROUP *group)
 
int EC_GROUP_order_bits (const EC_GROUP *group)
 
int EC_GROUP_get_cofactor (const EC_GROUP *group, BIGNUM *cofactor, BN_CTX *ctx)
 
const BIGNUMEC_GROUP_get0_cofactor (const EC_GROUP *group)
 
void EC_GROUP_set_curve_name (EC_GROUP *group, int nid)
 
int EC_GROUP_get_curve_name (const EC_GROUP *group)
 
void EC_GROUP_set_asn1_flag (EC_GROUP *group, int flag)
 
int EC_GROUP_get_asn1_flag (const EC_GROUP *group)
 
void EC_GROUP_set_point_conversion_form (EC_GROUP *group, point_conversion_form_t form)
 
point_conversion_form_t EC_GROUP_get_point_conversion_form (const EC_GROUP *)
 
unsigned char * EC_GROUP_get0_seed (const EC_GROUP *x)
 
size_t EC_GROUP_get_seed_len (const EC_GROUP *)
 
size_t EC_GROUP_set_seed (EC_GROUP *, const unsigned char *, size_t len)
 
int EC_GROUP_set_curve (EC_GROUP *group, const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx)
 
int EC_GROUP_get_curve (const EC_GROUP *group, BIGNUM *p, BIGNUM *a, BIGNUM *b, BN_CTX *ctx)
 
 DEPRECATEDIN_1_2_0 (int EC_GROUP_set_curve_GFp(EC_GROUP *group, const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx)) DEPRECATEDIN_1_2_0(int EC_GROUP_get_curve_GFp(const EC_GROUP *group
 
BIGNUM BIGNUM BIGNUM BN_CTX *ctx BIGNUM BIGNUM BIGNUM BN_CTX *ctx int EC_GROUP_get_degree (const EC_GROUP *group)
 
int EC_GROUP_check (const EC_GROUP *group, BN_CTX *ctx)
 
int EC_GROUP_check_discriminant (const EC_GROUP *group, BN_CTX *ctx)
 
int EC_GROUP_cmp (const EC_GROUP *a, const EC_GROUP *b, BN_CTX *ctx)
 
EC_GROUPEC_GROUP_new_curve_GFp (const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx)
 
EC_GROUPEC_GROUP_new_curve_GF2m (const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx)
 
EC_GROUPEC_GROUP_new_by_curve_name (int nid)
 
EC_GROUPEC_GROUP_new_from_ecparameters (const ECPARAMETERS *params)
 
ECPARAMETERSEC_GROUP_get_ecparameters (const EC_GROUP *group, ECPARAMETERS *params)
 
EC_GROUPEC_GROUP_new_from_ecpkparameters (const ECPKPARAMETERS *params)
 
ECPKPARAMETERSEC_GROUP_get_ecpkparameters (const EC_GROUP *group, ECPKPARAMETERS *params)
 
size_t EC_get_builtin_curves (EC_builtin_curve *r, size_t nitems)
 
const char * EC_curve_nid2nist (int nid)
 
int EC_curve_nist2nid (const char *name)
 
EC_POINTEC_POINT_new (const EC_GROUP *group)
 
void EC_POINT_free (EC_POINT *point)
 
void EC_POINT_clear_free (EC_POINT *point)
 
int EC_POINT_copy (EC_POINT *dst, const EC_POINT *src)
 
EC_POINTEC_POINT_dup (const EC_POINT *src, const EC_GROUP *group)
 
const EC_METHODEC_POINT_method_of (const EC_POINT *point)
 
int EC_POINT_set_to_infinity (const EC_GROUP *group, EC_POINT *point)
 
int EC_POINT_set_Jprojective_coordinates_GFp (const EC_GROUP *group, EC_POINT *p, const BIGNUM *x, const BIGNUM *y, const BIGNUM *z, BN_CTX *ctx)
 
int EC_POINT_get_Jprojective_coordinates_GFp (const EC_GROUP *group, const EC_POINT *p, BIGNUM *x, BIGNUM *y, BIGNUM *z, BN_CTX *ctx)
 
int EC_POINT_set_affine_coordinates (const EC_GROUP *group, EC_POINT *p, const BIGNUM *x, const BIGNUM *y, BN_CTX *ctx)
 
int EC_POINT_get_affine_coordinates (const EC_GROUP *group, const EC_POINT *p, BIGNUM *x, BIGNUM *y, BN_CTX *ctx)
 
 DEPRECATEDIN_1_2_0 (int EC_POINT_set_affine_coordinates_GFp(const EC_GROUP *group, EC_POINT *p, const BIGNUM *x, const BIGNUM *y, BN_CTX *ctx)) DEPRECATEDIN_1_2_0(int EC_POINT_get_affine_coordinates_GFp(const EC_GROUP *group
 
const EC_POINT BIGNUM BIGNUM BN_CTX *ctx int EC_POINT_set_compressed_coordinates (const EC_GROUP *group, EC_POINT *p, const BIGNUM *x, int y_bit, BN_CTX *ctx)
 
 DEPRECATEDIN_1_2_0 (int EC_POINT_set_compressed_coordinates_GFp(const EC_GROUP *group, EC_POINT *p, const BIGNUM *x, int y_bit, BN_CTX *ctx)) DEPRECATEDIN_1_2_0(int EC_POINT_set_affine_coordinates_GF2m(const EC_GROUP *group
 
EC_POINT const BIGNUM const BIGNUM BN_CTX *ctx DEPRECATEDIN_1_2_0 (int EC_POINT_get_affine_coordinates_GF2m(const EC_GROUP *group, const EC_POINT *p, BIGNUM *x, BIGNUM *y, BN_CTX *ctx)) DEPRECATEDIN_1_2_0(int EC_POINT_set_compressed_coordinates_GF2m(const EC_GROUP *group
 
EC_POINT const BIGNUM const BIGNUM BN_CTX *ctx EC_POINT const BIGNUM int BN_CTX *ctx size_t EC_POINT_point2oct (const EC_GROUP *group, const EC_POINT *p, point_conversion_form_t form, unsigned char *buf, size_t len, BN_CTX *ctx)
 
int EC_POINT_oct2point (const EC_GROUP *group, EC_POINT *p, const unsigned char *buf, size_t len, BN_CTX *ctx)
 
size_t EC_POINT_point2buf (const EC_GROUP *group, const EC_POINT *point, point_conversion_form_t form, unsigned char **pbuf, BN_CTX *ctx)
 
BIGNUMEC_POINT_point2bn (const EC_GROUP *, const EC_POINT *, point_conversion_form_t form, BIGNUM *, BN_CTX *)
 
EC_POINTEC_POINT_bn2point (const EC_GROUP *, const BIGNUM *, EC_POINT *, BN_CTX *)
 
char * EC_POINT_point2hex (const EC_GROUP *, const EC_POINT *, point_conversion_form_t form, BN_CTX *)
 
EC_POINTEC_POINT_hex2point (const EC_GROUP *, const char *, EC_POINT *, BN_CTX *)
 
int EC_POINT_add (const EC_GROUP *group, EC_POINT *r, const EC_POINT *a, const EC_POINT *b, BN_CTX *ctx)
 
int EC_POINT_dbl (const EC_GROUP *group, EC_POINT *r, const EC_POINT *a, BN_CTX *ctx)
 
int EC_POINT_invert (const EC_GROUP *group, EC_POINT *a, BN_CTX *ctx)
 
int EC_POINT_is_at_infinity (const EC_GROUP *group, const EC_POINT *p)
 
int EC_POINT_is_on_curve (const EC_GROUP *group, const EC_POINT *point, BN_CTX *ctx)
 
int EC_POINT_cmp (const EC_GROUP *group, const EC_POINT *a, const EC_POINT *b, BN_CTX *ctx)
 
int EC_POINT_make_affine (const EC_GROUP *group, EC_POINT *point, BN_CTX *ctx)
 
int EC_POINTs_make_affine (const EC_GROUP *group, size_t num, EC_POINT *points[], BN_CTX *ctx)
 
int EC_POINTs_mul (const EC_GROUP *group, EC_POINT *r, const BIGNUM *n, size_t num, const EC_POINT *p[], const BIGNUM *m[], BN_CTX *ctx)
 
int EC_POINT_mul (const EC_GROUP *group, EC_POINT *r, const BIGNUM *n, const EC_POINT *q, const BIGNUM *m, BN_CTX *ctx)
 
int EC_GROUP_precompute_mult (EC_GROUP *group, BN_CTX *ctx)
 
int EC_GROUP_have_precompute_mult (const EC_GROUP *group)
 
int EC_GROUP_get_basis_type (const EC_GROUP *)
 
int EC_GROUP_get_trinomial_basis (const EC_GROUP *, unsigned int *k)
 
int EC_GROUP_get_pentanomial_basis (const EC_GROUP *, unsigned int *k1, unsigned int *k2, unsigned int *k3)
 
EC_GROUPd2i_ECPKParameters (EC_GROUP **, const unsigned char **in, long len)
 
int i2d_ECPKParameters (const EC_GROUP *, unsigned char **out)
 
int ECPKParameters_print (BIO *bp, const EC_GROUP *x, int off)
 
int ECPKParameters_print_fp (FILE *fp, const EC_GROUP *x, int off)
 
EC_KEYEC_KEY_new (void)
 
int EC_KEY_get_flags (const EC_KEY *key)
 
void EC_KEY_set_flags (EC_KEY *key, int flags)
 
void EC_KEY_clear_flags (EC_KEY *key, int flags)
 
int EC_KEY_decoded_from_explicit_params (const EC_KEY *key)
 
EC_KEYEC_KEY_new_by_curve_name (int nid)
 
void EC_KEY_free (EC_KEY *key)
 
EC_KEYEC_KEY_copy (EC_KEY *dst, const EC_KEY *src)
 
EC_KEYEC_KEY_dup (const EC_KEY *src)
 
int EC_KEY_up_ref (EC_KEY *key)
 
ENGINEEC_KEY_get0_engine (const EC_KEY *eckey)
 
const EC_GROUPEC_KEY_get0_group (const EC_KEY *key)
 
int EC_KEY_set_group (EC_KEY *key, const EC_GROUP *group)
 
const BIGNUMEC_KEY_get0_private_key (const EC_KEY *key)
 
int EC_KEY_set_private_key (EC_KEY *key, const BIGNUM *prv)
 
const EC_POINTEC_KEY_get0_public_key (const EC_KEY *key)
 
int EC_KEY_set_public_key (EC_KEY *key, const EC_POINT *pub)
 
unsigned EC_KEY_get_enc_flags (const EC_KEY *key)
 
void EC_KEY_set_enc_flags (EC_KEY *eckey, unsigned int flags)
 
point_conversion_form_t EC_KEY_get_conv_form (const EC_KEY *key)
 
void EC_KEY_set_conv_form (EC_KEY *eckey, point_conversion_form_t cform)
 
int EC_KEY_set_ex_data (EC_KEY *key, int idx, void *arg)
 
void * EC_KEY_get_ex_data (const EC_KEY *key, int idx)
 
void EC_KEY_set_asn1_flag (EC_KEY *eckey, int asn1_flag)
 
int EC_KEY_precompute_mult (EC_KEY *key, BN_CTX *ctx)
 
int EC_KEY_generate_key (EC_KEY *key)
 
int EC_KEY_check_key (const EC_KEY *key)
 
int EC_KEY_can_sign (const EC_KEY *eckey)
 
int EC_KEY_set_public_key_affine_coordinates (EC_KEY *key, BIGNUM *x, BIGNUM *y)
 
size_t EC_KEY_key2buf (const EC_KEY *key, point_conversion_form_t form, unsigned char **pbuf, BN_CTX *ctx)
 
int EC_KEY_oct2key (EC_KEY *key, const unsigned char *buf, size_t len, BN_CTX *ctx)
 
int EC_KEY_oct2priv (EC_KEY *key, const unsigned char *buf, size_t len)
 
size_t EC_KEY_priv2oct (const EC_KEY *key, unsigned char *buf, size_t len)
 
size_t EC_KEY_priv2buf (const EC_KEY *eckey, unsigned char **pbuf)
 
EC_KEYd2i_ECPrivateKey (EC_KEY **key, const unsigned char **in, long len)
 
int i2d_ECPrivateKey (EC_KEY *key, unsigned char **out)
 
EC_KEYd2i_ECParameters (EC_KEY **key, const unsigned char **in, long len)
 
int i2d_ECParameters (EC_KEY *key, unsigned char **out)
 
EC_KEYo2i_ECPublicKey (EC_KEY **key, const unsigned char **in, long len)
 
int i2o_ECPublicKey (const EC_KEY *key, unsigned char **out)
 
int ECParameters_print (BIO *bp, const EC_KEY *key)
 
int EC_KEY_print (BIO *bp, const EC_KEY *key, int off)
 
int ECParameters_print_fp (FILE *fp, const EC_KEY *key)
 
int EC_KEY_print_fp (FILE *fp, const EC_KEY *key, int off)
 
const EC_KEY_METHODEC_KEY_OpenSSL (void)
 
const EC_KEY_METHODEC_KEY_get_default_method (void)
 
void EC_KEY_set_default_method (const EC_KEY_METHOD *meth)
 
const EC_KEY_METHODEC_KEY_get_method (const EC_KEY *key)
 
int EC_KEY_set_method (EC_KEY *key, const EC_KEY_METHOD *meth)
 
EC_KEYEC_KEY_new_method (ENGINE *engine)
 
int ECDH_KDF_X9_62 (unsigned char *out, size_t outlen, const unsigned char *Z, size_t Zlen, const unsigned char *sinfo, size_t sinfolen, const EVP_MD *md)
 
int ECDH_compute_key (void *out, size_t outlen, const EC_POINT *pub_key, const EC_KEY *ecdh, void *(*KDF)(const void *in, size_t inlen, void *out, size_t *outlen))
 
ECDSA_SIGECDSA_SIG_new (void)
 
void ECDSA_SIG_free (ECDSA_SIG *sig)
 
int i2d_ECDSA_SIG (const ECDSA_SIG *sig, unsigned char **pp)
 
ECDSA_SIGd2i_ECDSA_SIG (ECDSA_SIG **sig, const unsigned char **pp, long len)
 
void ECDSA_SIG_get0 (const ECDSA_SIG *sig, const BIGNUM **pr, const BIGNUM **ps)
 
const BIGNUMECDSA_SIG_get0_r (const ECDSA_SIG *sig)
 
const BIGNUMECDSA_SIG_get0_s (const ECDSA_SIG *sig)
 
int ECDSA_SIG_set0 (ECDSA_SIG *sig, BIGNUM *r, BIGNUM *s)
 
ECDSA_SIGECDSA_do_sign (const unsigned char *dgst, int dgst_len, EC_KEY *eckey)
 
ECDSA_SIGECDSA_do_sign_ex (const unsigned char *dgst, int dgstlen, const BIGNUM *kinv, const BIGNUM *rp, EC_KEY *eckey)
 
int ECDSA_do_verify (const unsigned char *dgst, int dgst_len, const ECDSA_SIG *sig, EC_KEY *eckey)
 
int ECDSA_sign_setup (EC_KEY *eckey, BN_CTX *ctx, BIGNUM **kinv, BIGNUM **rp)
 
int ECDSA_sign (int type, const unsigned char *dgst, int dgstlen, unsigned char *sig, unsigned int *siglen, EC_KEY *eckey)
 
int ECDSA_sign_ex (int type, const unsigned char *dgst, int dgstlen, unsigned char *sig, unsigned int *siglen, const BIGNUM *kinv, const BIGNUM *rp, EC_KEY *eckey)
 
int ECDSA_verify (int type, const unsigned char *dgst, int dgstlen, const unsigned char *sig, int siglen, EC_KEY *eckey)
 
int ECDSA_size (const EC_KEY *eckey)
 
EC_KEY_METHODEC_KEY_METHOD_new (const EC_KEY_METHOD *meth)
 
void EC_KEY_METHOD_free (EC_KEY_METHOD *meth)
 
void EC_KEY_METHOD_set_init (EC_KEY_METHOD *meth, int(*init)(EC_KEY *key), void(*finish)(EC_KEY *key), int(*copy)(EC_KEY *dest, const EC_KEY *src), int(*set_group)(EC_KEY *key, const EC_GROUP *grp), int(*set_private)(EC_KEY *key, const BIGNUM *priv_key), int(*set_public)(EC_KEY *key, const EC_POINT *pub_key))
 
void EC_KEY_METHOD_set_keygen (EC_KEY_METHOD *meth, int(*keygen)(EC_KEY *key))
 
void EC_KEY_METHOD_set_compute_key (EC_KEY_METHOD *meth, int(*ckey)(unsigned char **psec, size_t *pseclen, const EC_POINT *pub_key, const EC_KEY *ecdh))
 
void EC_KEY_METHOD_set_sign (EC_KEY_METHOD *meth, int(*sign)(int type, const unsigned char *dgst, int dlen, unsigned char *sig, unsigned int *siglen, const BIGNUM *kinv, const BIGNUM *r, EC_KEY *eckey), int(*sign_setup)(EC_KEY *eckey, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp), ECDSA_SIG *(*sign_sig)(const unsigned char *dgst, int dgst_len, const BIGNUM *in_kinv, const BIGNUM *in_r, EC_KEY *eckey))
 
void EC_KEY_METHOD_set_verify (EC_KEY_METHOD *meth, int(*verify)(int type, const unsigned char *dgst, int dgst_len, const unsigned char *sigbuf, int sig_len, EC_KEY *eckey), int(*verify_sig)(const unsigned char *dgst, int dgst_len, const ECDSA_SIG *sig, EC_KEY *eckey))
 
void EC_KEY_METHOD_get_init (const EC_KEY_METHOD *meth, int(**pinit)(EC_KEY *key), void(**pfinish)(EC_KEY *key), int(**pcopy)(EC_KEY *dest, const EC_KEY *src), int(**pset_group)(EC_KEY *key, const EC_GROUP *grp), int(**pset_private)(EC_KEY *key, const BIGNUM *priv_key), int(**pset_public)(EC_KEY *key, const EC_POINT *pub_key))
 
void EC_KEY_METHOD_get_keygen (const EC_KEY_METHOD *meth, int(**pkeygen)(EC_KEY *key))
 
void EC_KEY_METHOD_get_compute_key (const EC_KEY_METHOD *meth, int(**pck)(unsigned char **psec, size_t *pseclen, const EC_POINT *pub_key, const EC_KEY *ecdh))
 
void EC_KEY_METHOD_get_sign (const EC_KEY_METHOD *meth, int(**psign)(int type, const unsigned char *dgst, int dlen, unsigned char *sig, unsigned int *siglen, const BIGNUM *kinv, const BIGNUM *r, EC_KEY *eckey), int(**psign_setup)(EC_KEY *eckey, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp), ECDSA_SIG *(**psign_sig)(const unsigned char *dgst, int dgst_len, const BIGNUM *in_kinv, const BIGNUM *in_r, EC_KEY *eckey))
 
void EC_KEY_METHOD_get_verify (const EC_KEY_METHOD *meth, int(**pverify)(int type, const unsigned char *dgst, int dgst_len, const unsigned char *sigbuf, int sig_len, EC_KEY *eckey), int(**pverify_sig)(const unsigned char *dgst, int dgst_len, const ECDSA_SIG *sig, EC_KEY *eckey))
 

Variables

BIGNUMp
 
BIGNUM BIGNUMa
 
BIGNUM BIGNUM BIGNUMb
 
const EC_POINT BIGNUMx
 
const EC_POINT BIGNUM BIGNUMy
 
EC_POINT const BIGNUM const BIGNUM BN_CTX *ctx EC_POINT const BIGNUM int y_bit
 

Macro Definition Documentation

◆ d2i_ECPKParameters_bio

#define d2i_ECPKParameters_bio ( bp,
x )   ASN1_d2i_bio_of(EC_GROUP,NULL,d2i_ECPKParameters,bp,x)

Definition at line 796 of file ec.h.

◆ d2i_ECPKParameters_fp

#define d2i_ECPKParameters_fp ( fp,
x )
Value:
(EC_GROUP *)ASN1_d2i_fp(NULL, \
(char *(*)())d2i_ECPKParameters,(fp),(unsigned char **)(x))
void * ASN1_d2i_fp(void *(*xnew)(void), d2i_of_void *d2i, FILE *in, void **x)
EC_GROUP * d2i_ECPKParameters(EC_GROUP **, const unsigned char **in, long len)
const EC_POINT BIGNUM * x
Definition ec.h:545
struct ec_group_st EC_GROUP
Definition ec.h:45

Definition at line 798 of file ec.h.

◆ EC_FLAG_COFACTOR_ECDH

#define EC_FLAG_COFACTOR_ECDH   0x1000

Definition at line 819 of file ec.h.

◆ EC_FLAG_FIPS_CHECKED

#define EC_FLAG_FIPS_CHECKED   0x2

Definition at line 818 of file ec.h.

◆ EC_FLAG_NON_FIPS_ALLOW

#define EC_FLAG_NON_FIPS_ALLOW   0x1

Definition at line 817 of file ec.h.

◆ EC_KEY_get_ex_new_index

#define EC_KEY_get_ex_new_index ( l,
p,
newf,
dupf,
freef )    CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_EC_KEY, l, p, newf, dupf, freef)

Definition at line 918 of file ec.h.

◆ EC_PKEY_NO_PARAMETERS

#define EC_PKEY_NO_PARAMETERS   0x001

Definition at line 813 of file ec.h.

◆ EC_PKEY_NO_PUBKEY

#define EC_PKEY_NO_PUBKEY   0x002

Definition at line 814 of file ec.h.

◆ ECParameters_dup

#define ECParameters_dup ( x)    ASN1_dup_of(EC_KEY,i2d_ECParameters,d2i_ECParameters,x)

Definition at line 1369 of file ec.h.

◆ EVP_PKEY_CTRL_EC_ECDH_COFACTOR

#define EVP_PKEY_CTRL_EC_ECDH_COFACTOR   (EVP_PKEY_ALG_CTRL + 3)

Definition at line 1455 of file ec.h.

◆ EVP_PKEY_CTRL_EC_KDF_MD

#define EVP_PKEY_CTRL_EC_KDF_MD   (EVP_PKEY_ALG_CTRL + 5)

Definition at line 1457 of file ec.h.

◆ EVP_PKEY_CTRL_EC_KDF_OUTLEN

#define EVP_PKEY_CTRL_EC_KDF_OUTLEN   (EVP_PKEY_ALG_CTRL + 7)

Definition at line 1459 of file ec.h.

◆ EVP_PKEY_CTRL_EC_KDF_TYPE

#define EVP_PKEY_CTRL_EC_KDF_TYPE   (EVP_PKEY_ALG_CTRL + 4)

Definition at line 1456 of file ec.h.

◆ EVP_PKEY_CTRL_EC_KDF_UKM

#define EVP_PKEY_CTRL_EC_KDF_UKM   (EVP_PKEY_ALG_CTRL + 9)

Definition at line 1461 of file ec.h.

◆ EVP_PKEY_CTRL_EC_PARAM_ENC

#define EVP_PKEY_CTRL_EC_PARAM_ENC   (EVP_PKEY_ALG_CTRL + 2)

Definition at line 1454 of file ec.h.

◆ EVP_PKEY_CTRL_EC_PARAMGEN_CURVE_NID

#define EVP_PKEY_CTRL_EC_PARAMGEN_CURVE_NID   (EVP_PKEY_ALG_CTRL + 1)

Definition at line 1453 of file ec.h.

◆ EVP_PKEY_CTRL_GET1_ID

#define EVP_PKEY_CTRL_GET1_ID   (EVP_PKEY_ALG_CTRL + 12)

Definition at line 1464 of file ec.h.

◆ EVP_PKEY_CTRL_GET1_ID_LEN

#define EVP_PKEY_CTRL_GET1_ID_LEN   (EVP_PKEY_ALG_CTRL + 13)

Definition at line 1465 of file ec.h.

◆ EVP_PKEY_CTRL_GET_EC_KDF_MD

#define EVP_PKEY_CTRL_GET_EC_KDF_MD   (EVP_PKEY_ALG_CTRL + 6)

Definition at line 1458 of file ec.h.

◆ EVP_PKEY_CTRL_GET_EC_KDF_OUTLEN

#define EVP_PKEY_CTRL_GET_EC_KDF_OUTLEN   (EVP_PKEY_ALG_CTRL + 8)

Definition at line 1460 of file ec.h.

◆ EVP_PKEY_CTRL_GET_EC_KDF_UKM

#define EVP_PKEY_CTRL_GET_EC_KDF_UKM   (EVP_PKEY_ALG_CTRL + 10)

Definition at line 1462 of file ec.h.

◆ EVP_PKEY_CTRL_SET1_ID

#define EVP_PKEY_CTRL_SET1_ID   (EVP_PKEY_ALG_CTRL + 11)

Definition at line 1463 of file ec.h.

◆ EVP_PKEY_CTX_get0_ecdh_kdf_ukm

#define EVP_PKEY_CTX_get0_ecdh_kdf_ukm ( ctx,
p )
Value:
int void BN_CTX * ctx
Definition bn.h:334
BIGNUM * p
Definition ec.h:274
#define EVP_PKEY_CTRL_GET_EC_KDF_UKM
Definition ec.h:1462
#define EVP_PKEY_EC
Definition evp.h:52
int EVP_PKEY_CTX_ctrl(EVP_PKEY_CTX *ctx, int keytype, int optype, int cmd, int p1, void *p2)
#define EVP_PKEY_OP_DERIVE
Definition evp.h:1263

Definition at line 1435 of file ec.h.

◆ EVP_PKEY_CTX_get1_id

#define EVP_PKEY_CTX_get1_id ( ctx,
id )
Value:
EVP_PKEY_CTRL_GET1_ID, 0, (void*)(id))
#define EVP_PKEY_CTRL_GET1_ID
Definition ec.h:1464

Definition at line 1445 of file ec.h.

◆ EVP_PKEY_CTX_get1_id_len

#define EVP_PKEY_CTX_get1_id_len ( ctx,
id_len )
Value:
EVP_PKEY_CTRL_GET1_ID_LEN, 0, (void*)(id_len))
#define EVP_PKEY_CTRL_GET1_ID_LEN
Definition ec.h:1465

Definition at line 1449 of file ec.h.

◆ EVP_PKEY_CTX_get_ecdh_cofactor_mode

#define EVP_PKEY_CTX_get_ecdh_cofactor_mode ( ctx)
Value:

Definition at line 1394 of file ec.h.

◆ EVP_PKEY_CTX_get_ecdh_kdf_md

#define EVP_PKEY_CTX_get_ecdh_kdf_md ( ctx,
pmd )
Value:
EVP_PKEY_CTRL_GET_EC_KDF_MD, 0, (void *)(pmd))
#define EVP_PKEY_CTRL_GET_EC_KDF_MD
Definition ec.h:1458

Definition at line 1414 of file ec.h.

◆ EVP_PKEY_CTX_get_ecdh_kdf_outlen

#define EVP_PKEY_CTX_get_ecdh_kdf_outlen ( ctx,
plen )
Value:
(void *)(plen))
#define EVP_PKEY_CTRL_GET_EC_KDF_OUTLEN
Definition ec.h:1460

Definition at line 1424 of file ec.h.

◆ EVP_PKEY_CTX_get_ecdh_kdf_type

#define EVP_PKEY_CTX_get_ecdh_kdf_type ( ctx)
Value:

Definition at line 1404 of file ec.h.

◆ EVP_PKEY_CTX_set0_ecdh_kdf_ukm

#define EVP_PKEY_CTX_set0_ecdh_kdf_ukm ( ctx,
p,
plen )
Value:
EVP_PKEY_CTRL_EC_KDF_UKM, plen, (void *)(p))
#define EVP_PKEY_CTRL_EC_KDF_UKM
Definition ec.h:1461

Definition at line 1430 of file ec.h.

◆ EVP_PKEY_CTX_set1_id

#define EVP_PKEY_CTX_set1_id ( ctx,
id,
id_len )
Value:
EVP_PKEY_CTRL_SET1_ID, (int)id_len, (void*)(id))
#define EVP_PKEY_CTRL_SET1_ID
Definition ec.h:1463

Definition at line 1441 of file ec.h.

◆ EVP_PKEY_CTX_set_ec_param_enc

#define EVP_PKEY_CTX_set_ec_param_enc ( ctx,
flag )
Value:
#define EVP_PKEY_CTRL_EC_PARAM_ENC
Definition ec.h:1454
#define EVP_PKEY_OP_KEYGEN
Definition evp.h:1255
#define EVP_PKEY_OP_PARAMGEN
Definition evp.h:1254

Definition at line 1384 of file ec.h.

◆ EVP_PKEY_CTX_set_ec_paramgen_curve_nid

#define EVP_PKEY_CTX_set_ec_paramgen_curve_nid ( ctx,
nid )
Value:

Definition at line 1379 of file ec.h.

◆ EVP_PKEY_CTX_set_ecdh_cofactor_mode

#define EVP_PKEY_CTX_set_ecdh_cofactor_mode ( ctx,
flag )
Value:

Definition at line 1389 of file ec.h.

◆ EVP_PKEY_CTX_set_ecdh_kdf_md

#define EVP_PKEY_CTX_set_ecdh_kdf_md ( ctx,
md )
Value:
EVP_PKEY_CTRL_EC_KDF_MD, 0, (void *)(md))
#define EVP_PKEY_CTRL_EC_KDF_MD
Definition ec.h:1457
const void int const EVP_MD * md
Definition hmac.h:34

Definition at line 1409 of file ec.h.

◆ EVP_PKEY_CTX_set_ecdh_kdf_outlen

#define EVP_PKEY_CTX_set_ecdh_kdf_outlen ( ctx,
len )
Value:
const unsigned char size_t len
Definition ct.h:348
#define EVP_PKEY_CTRL_EC_KDF_OUTLEN
Definition ec.h:1459

Definition at line 1419 of file ec.h.

◆ EVP_PKEY_CTX_set_ecdh_kdf_type

#define EVP_PKEY_CTX_set_ecdh_kdf_type ( ctx,
kdf )
Value:

Definition at line 1399 of file ec.h.

◆ EVP_PKEY_ECDH_KDF_NONE

#define EVP_PKEY_ECDH_KDF_NONE   1

Definition at line 1467 of file ec.h.

◆ EVP_PKEY_ECDH_KDF_X9_62

#define EVP_PKEY_ECDH_KDF_X9_62   EVP_PKEY_ECDH_KDF_X9_63

The old name for EVP_PKEY_ECDH_KDF_X9_63 The ECDH KDF specification has been mistakingly attributed to ANSI X9.62, it is actually specified in ANSI X9.63. This identifier is retained for backwards compatibility

Definition at line 1474 of file ec.h.

◆ EVP_PKEY_ECDH_KDF_X9_63

#define EVP_PKEY_ECDH_KDF_X9_63   2

Definition at line 1468 of file ec.h.

◆ i2d_ECPKParameters_bio

#define i2d_ECPKParameters_bio ( bp,
x )   ASN1_i2d_bio_of_const(EC_GROUP,i2d_ECPKParameters,bp,x)

Definition at line 797 of file ec.h.

◆ i2d_ECPKParameters_fp

#define i2d_ECPKParameters_fp ( fp,
x )
Value:
(unsigned char *)(x))
int ASN1_i2d_fp(i2d_of_void *i2d, FILE *out, void *x)
int i2d_ECPKParameters(const EC_GROUP *, unsigned char **out)

Definition at line 800 of file ec.h.

◆ OPENSSL_EC_EXPLICIT_CURVE

#define OPENSSL_EC_EXPLICIT_CURVE   0x000

Definition at line 790 of file ec.h.

◆ OPENSSL_EC_NAMED_CURVE

#define OPENSSL_EC_NAMED_CURVE   0x001

Definition at line 791 of file ec.h.

◆ OPENSSL_ECC_MAX_FIELD_BITS

#define OPENSSL_ECC_MAX_FIELD_BITS   661

Definition at line 28 of file ec.h.

Typedef Documentation

◆ EC_GROUP

typedef struct ec_group_st EC_GROUP

Definition at line 45 of file ec.h.

◆ EC_METHOD

typedef struct ec_method_st EC_METHOD

Definition at line 44 of file ec.h.

◆ EC_POINT

typedef struct ec_point_st EC_POINT

Definition at line 46 of file ec.h.

◆ ECDSA_SIG

typedef struct ECDSA_SIG_st ECDSA_SIG

Definition at line 1127 of file ec.h.

◆ ECPARAMETERS

typedef struct ec_parameters_st ECPARAMETERS

Definition at line 48 of file ec.h.

◆ ECPKPARAMETERS

typedef struct ecpk_parameters_st ECPKPARAMETERS

Definition at line 47 of file ec.h.

Enumeration Type Documentation

◆ point_conversion_form_t

Enum for the point conversion form as defined in X9.62 (ECDSA) for the encoding of a elliptic curve point (x,y)

Enumerator
POINT_CONVERSION_COMPRESSED 

the point is encoded as z||x, where the octet z specifies which solution of the quadratic equation y is

POINT_CONVERSION_UNCOMPRESSED 

the point is encoded as z||x||y, where z is the octet 0x04

POINT_CONVERSION_HYBRID 

the point is encoded as z||x||y, where the octet z specifies which solution of the quadratic equation y is

Definition at line 33 of file ec.h.

Function Documentation

◆ d2i_ECDSA_SIG()

ECDSA_SIG * d2i_ECDSA_SIG ( ECDSA_SIG ** sig,
const unsigned char ** pp,
long len )

Decodes a DER encoded ECDSA signature (note: this function changes *pp (*pp += len)).

Parameters
sigpointer to ECDSA_SIG pointer (may be NULL)
ppmemory buffer with the DER encoded signature
lenlength of the buffer
Returns
pointer to the decoded ECDSA_SIG structure (or NULL)

◆ d2i_ECParameters()

EC_KEY * d2i_ECParameters ( EC_KEY ** key,
const unsigned char ** in,
long len )

Decodes ec parameter from a memory buffer.

Parameters
keya pointer to a EC_KEY object which should be used (or NULL)
inpointer to memory with the DER encoded ec parameters
lenlength of the DER encoded ec parameters
Returns
a EC_KEY object with the decoded parameters or NULL if an error occurred.

◆ d2i_ECPKParameters()

EC_GROUP * d2i_ECPKParameters ( EC_GROUP ** ,
const unsigned char ** in,
long len )

◆ d2i_ECPrivateKey()

EC_KEY * d2i_ECPrivateKey ( EC_KEY ** key,
const unsigned char ** in,
long len )

Decodes a private key from a memory buffer.

Parameters
keya pointer to a EC_KEY object which should be used (or NULL)
inpointer to memory with the DER encoded private key
lenlength of the DER encoded private key
Returns
the decoded private key or NULL if an error occurred.

◆ DEPRECATEDIN_1_2_0() [1/4]

BIGNUM BIGNUM BIGNUM BN_CTX *ctx DEPRECATEDIN_1_2_0 ( int EC_GROUP_set_curve_GF2mEC_GROUP *group, const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx) const

Sets the parameters of an ec curve. Synonym for EC_GROUP_set_curve

Parameters
groupEC_GROUP object
pBIGNUM with the prime number (GFp) or the polynomial defining the underlying field (GF2m)
aBIGNUM with parameter a of the equation
bBIGNUM with parameter b of the equation
ctxBN_CTX object (optional)
Returns
1 on success and 0 if an error occurred Gets the parameters of an ec curve. Synonym for EC_GROUP_get_curve
Parameters
groupEC_GROUP object
pBIGNUM with the prime number (GFp) or the polynomial defining the underlying field (GF2m)
aBIGNUM for parameter a of the equation
bBIGNUM for parameter b of the equation
ctxBN_CTX object (optional)
Returns
1 on success and 0 if an error occurred

Sets the parameter of an ec curve. Synonym for EC_GROUP_set_curve

Parameters
groupEC_GROUP object
pBIGNUM with the prime number (GFp) or the polynomial defining the underlying field (GF2m)
aBIGNUM with parameter a of the equation
bBIGNUM with parameter b of the equation
ctxBN_CTX object (optional)
Returns
1 on success and 0 if an error occurred Gets the parameters of an ec curve. Synonym for EC_GROUP_get_curve
Parameters
groupEC_GROUP object
pBIGNUM with the prime number (GFp) or the polynomial defining the underlying field (GF2m)
aBIGNUM for parameter a of the equation
bBIGNUM for parameter b of the equation
ctxBN_CTX object (optional)
Returns
1 on success and 0 if an error occurred

◆ DEPRECATEDIN_1_2_0() [2/4]

EC_POINT const BIGNUM const BIGNUM BN_CTX *ctx DEPRECATEDIN_1_2_0 ( int EC_POINT_get_affine_coordinates_GF2mconst EC_GROUP *group, const EC_POINT *p, BIGNUM *x, BIGNUM *y, BN_CTX *ctx) const

Gets the affine coordinates of an EC_POINT. A synonym of EC_POINT_get_affine_coordinates

Parameters
groupunderlying EC_GROUP object
pEC_POINT object
xBIGNUM for the x-coordinate
yBIGNUM for the y-coordinate
ctxBN_CTX object (optional)
Returns
1 on success and 0 if an error occurred Sets the x9.62 compressed coordinates of a EC_POINT. A synonym of EC_POINT_set_compressed_coordinates
Parameters
groupunderlying EC_GROUP object
pEC_POINT object
xBIGNUM with x-coordinate
y_bitinteger with the y-Bit (either 0 or 1)
ctxBN_CTX object (optional)
Returns
1 on success and 0 if an error occurred

◆ DEPRECATEDIN_1_2_0() [3/4]

DEPRECATEDIN_1_2_0 ( int EC_POINT_set_affine_coordinates_GFpconst EC_GROUP *group, EC_POINT *p, const BIGNUM *x, const BIGNUM *y, BN_CTX *ctx) const

Sets the affine coordinates of an EC_POINT. A synonym of EC_POINT_set_affine_coordinates

Parameters
groupunderlying EC_GROUP object
pEC_POINT object
xBIGNUM with the x-coordinate
yBIGNUM with the y-coordinate
ctxBN_CTX object (optional)
Returns
1 on success and 0 if an error occurred Gets the affine coordinates of an EC_POINT. A synonym of EC_POINT_get_affine_coordinates
Parameters
groupunderlying EC_GROUP object
pEC_POINT object
xBIGNUM for the x-coordinate
yBIGNUM for the y-coordinate
ctxBN_CTX object (optional)
Returns
1 on success and 0 if an error occurred

◆ DEPRECATEDIN_1_2_0() [4/4]

DEPRECATEDIN_1_2_0 ( int EC_POINT_set_compressed_coordinates_GFpconst EC_GROUP *group, EC_POINT *p, const BIGNUM *x, int y_bit, BN_CTX *ctx) const

Sets the x9.62 compressed coordinates of a EC_POINT. A synonym of EC_POINT_set_compressed_coordinates

Parameters
groupunderlying EC_GROUP object
pEC_POINT object
xBIGNUM with x-coordinate
y_bitinteger with the y-Bit (either 0 or 1)
ctxBN_CTX object (optional)
Returns
1 on success and 0 if an error occurred Sets the affine coordinates of an EC_POINT. A synonym of EC_POINT_set_affine_coordinates
Parameters
groupunderlying EC_GROUP object
pEC_POINT object
xBIGNUM with the x-coordinate
yBIGNUM with the y-coordinate
ctxBN_CTX object (optional)
Returns
1 on success and 0 if an error occurred

◆ EC_curve_nid2nist()

const char * EC_curve_nid2nist ( int nid)

◆ EC_curve_nist2nid()

int EC_curve_nist2nid ( const char * name)

◆ EC_get_builtin_curves()

size_t EC_get_builtin_curves ( EC_builtin_curve * r,
size_t nitems )

◆ EC_GF2m_simple_method()

const EC_METHOD * EC_GF2m_simple_method ( void )

Returns the basic GF2m ec method

Returns
EC_METHOD object

◆ EC_GFp_mont_method()

const EC_METHOD * EC_GFp_mont_method ( void )

Returns GFp methods using montgomery multiplication.

Returns
EC_METHOD object

◆ EC_GFp_nist_method()

const EC_METHOD * EC_GFp_nist_method ( void )

Returns GFp methods using optimized methods for NIST recommended curves

Returns
EC_METHOD object

◆ EC_GFp_nistp224_method()

const EC_METHOD * EC_GFp_nistp224_method ( void )

Returns 64-bit optimized methods for nistp224

Returns
EC_METHOD object

◆ EC_GFp_nistp256_method()

const EC_METHOD * EC_GFp_nistp256_method ( void )

Returns 64-bit optimized methods for nistp256

Returns
EC_METHOD object

◆ EC_GFp_nistp521_method()

const EC_METHOD * EC_GFp_nistp521_method ( void )

Returns 64-bit optimized methods for nistp521

Returns
EC_METHOD object

◆ EC_GFp_simple_method()

const EC_METHOD * EC_GFp_simple_method ( void )

Returns the basic GFp ec methods which provides the basis for the optimized methods.

Returns
EC_METHOD object

◆ EC_GROUP_check()

int EC_GROUP_check ( const EC_GROUP * group,
BN_CTX * ctx )

Checks whether the parameter in the EC_GROUP define a valid ec group

Parameters
groupEC_GROUP object
ctxBN_CTX object (optional)
Returns
1 if group is a valid ec group and 0 otherwise

◆ EC_GROUP_check_discriminant()

int EC_GROUP_check_discriminant ( const EC_GROUP * group,
BN_CTX * ctx )

Checks whether the discriminant of the elliptic curve is zero or not

Parameters
groupEC_GROUP object
ctxBN_CTX object (optional)
Returns
1 if the discriminant is not zero and 0 otherwise

◆ EC_GROUP_clear_free()

void EC_GROUP_clear_free ( EC_GROUP * group)

Clears and frees a EC_GROUP object

Parameters
groupEC_GROUP object to be cleared and freed.

◆ EC_GROUP_cmp()

int EC_GROUP_cmp ( const EC_GROUP * a,
const EC_GROUP * b,
BN_CTX * ctx )

Compares two EC_GROUP objects

Parameters
afirst EC_GROUP object
bsecond EC_GROUP object
ctxBN_CTX object (optional)
Returns
0 if the groups are equal, 1 if not, or -1 on error

◆ EC_GROUP_copy()

int EC_GROUP_copy ( EC_GROUP * dst,
const EC_GROUP * src )

Copies EC_GROUP objects. Note: both EC_GROUPs must use the same EC_METHOD.

Parameters
dstdestination EC_GROUP object
srcsource EC_GROUP object
Returns
1 on success and 0 if an error occurred.

◆ EC_GROUP_dup()

EC_GROUP * EC_GROUP_dup ( const EC_GROUP * src)

Creates a new EC_GROUP object and copies the copies the content form src to the newly created EC_KEY object

Parameters
srcsource EC_GROUP object
Returns
newly created EC_GROUP object or NULL in case of an error.

◆ EC_GROUP_free()

void EC_GROUP_free ( EC_GROUP * group)

Frees a EC_GROUP object

Parameters
groupEC_GROUP object to be freed.

◆ EC_GROUP_get0_cofactor()

const BIGNUM * EC_GROUP_get0_cofactor ( const EC_GROUP * group)

Gets the cofactor of an EC_GROUP

Parameters
groupEC_GROUP object
Returns
the group cofactor

◆ EC_GROUP_get0_generator()

const EC_POINT * EC_GROUP_get0_generator ( const EC_GROUP * group)

Returns the generator of a EC_GROUP object.

Parameters
groupEC_GROUP object
Returns
the currently used generator (possibly NULL).

◆ EC_GROUP_get0_order()

const BIGNUM * EC_GROUP_get0_order ( const EC_GROUP * group)

Gets the order of an EC_GROUP

Parameters
groupEC_GROUP object
Returns
the group order

◆ EC_GROUP_get0_seed()

unsigned char * EC_GROUP_get0_seed ( const EC_GROUP * x)

◆ EC_GROUP_get_asn1_flag()

int EC_GROUP_get_asn1_flag ( const EC_GROUP * group)

◆ EC_GROUP_get_basis_type()

int EC_GROUP_get_basis_type ( const EC_GROUP * )

◆ EC_GROUP_get_cofactor()

int EC_GROUP_get_cofactor ( const EC_GROUP * group,
BIGNUM * cofactor,
BN_CTX * ctx )

Gets the cofactor of a EC_GROUP

Parameters
groupEC_GROUP object
cofactorBIGNUM to which the cofactor is copied
ctxunused
Returns
1 on success and 0 if an error occurred

◆ EC_GROUP_get_curve()

int EC_GROUP_get_curve ( const EC_GROUP * group,
BIGNUM * p,
BIGNUM * a,
BIGNUM * b,
BN_CTX * ctx )

Gets the parameters of the ec curve defined by y^2 = x^3 + a*x + b (for GFp) or y^2 + x*y = x^3 + a*x^2 + b (for GF2m)

Parameters
groupEC_GROUP object
pBIGNUM with the prime number (GFp) or the polynomial defining the underlying field (GF2m)
aBIGNUM for parameter a of the equation
bBIGNUM for parameter b of the equation
ctxBN_CTX object (optional)
Returns
1 on success and 0 if an error occurred

◆ EC_GROUP_get_curve_name()

int EC_GROUP_get_curve_name ( const EC_GROUP * group)

Returns the curve name of a EC_GROUP object

Parameters
groupEC_GROUP object
Returns
NID of the curve name OID or 0 if not set.

◆ EC_GROUP_get_degree()

BIGNUM BIGNUM BIGNUM BN_CTX *ctx BIGNUM BIGNUM BIGNUM BN_CTX *ctx int EC_GROUP_get_degree ( const EC_GROUP * group)

Returns the number of bits needed to represent a field element

Parameters
groupEC_GROUP object
Returns
number of bits needed to represent a field element

◆ EC_GROUP_get_ecparameters()

ECPARAMETERS * EC_GROUP_get_ecparameters ( const EC_GROUP * group,
ECPARAMETERS * params )

Creates an ECPARAMETERS object for the given EC_GROUP object.

Parameters
grouppointer to the EC_GROUP object
paramspointer to an existing ECPARAMETERS object or NULL
Returns
pointer to the new ECPARAMETERS object or NULL if an error occurred.

◆ EC_GROUP_get_ecpkparameters()

ECPKPARAMETERS * EC_GROUP_get_ecpkparameters ( const EC_GROUP * group,
ECPKPARAMETERS * params )

Creates an ECPKPARAMETERS object for the given EC_GROUP object.

Parameters
grouppointer to the EC_GROUP object
paramspointer to an existing ECPKPARAMETERS object or NULL
Returns
pointer to the new ECPKPARAMETERS object or NULL if an error occurred.

◆ EC_GROUP_get_mont_data()

BN_MONT_CTX * EC_GROUP_get_mont_data ( const EC_GROUP * group)

Returns the montgomery data for order(Generator)

Parameters
groupEC_GROUP object
Returns
the currently used montgomery data (possibly NULL).

◆ EC_GROUP_get_order()

int EC_GROUP_get_order ( const EC_GROUP * group,
BIGNUM * order,
BN_CTX * ctx )

Gets the order of a EC_GROUP

Parameters
groupEC_GROUP object
orderBIGNUM to which the order is copied
ctxunused
Returns
1 on success and 0 if an error occurred

◆ EC_GROUP_get_pentanomial_basis()

int EC_GROUP_get_pentanomial_basis ( const EC_GROUP * ,
unsigned int * k1,
unsigned int * k2,
unsigned int * k3 )

◆ EC_GROUP_get_point_conversion_form()

point_conversion_form_t EC_GROUP_get_point_conversion_form ( const EC_GROUP * )

◆ EC_GROUP_get_seed_len()

size_t EC_GROUP_get_seed_len ( const EC_GROUP * )

◆ EC_GROUP_get_trinomial_basis()

int EC_GROUP_get_trinomial_basis ( const EC_GROUP * ,
unsigned int * k )

◆ EC_GROUP_have_precompute_mult()

int EC_GROUP_have_precompute_mult ( const EC_GROUP * group)

Reports whether a precomputation has been done

Parameters
groupEC_GROUP object
Returns
1 if a pre-computation has been done and 0 otherwise

◆ EC_GROUP_method_of()

const EC_METHOD * EC_GROUP_method_of ( const EC_GROUP * group)

Returns the EC_METHOD of the EC_GROUP object.

Parameters
groupEC_GROUP object
Returns
EC_METHOD used in this EC_GROUP object.

◆ EC_GROUP_new()

EC_GROUP * EC_GROUP_new ( const EC_METHOD * meth)

Creates a new EC_GROUP object

Parameters
methEC_METHOD to use
Returns
newly created EC_GROUP object or NULL in case of an error.

◆ EC_GROUP_new_by_curve_name()

EC_GROUP * EC_GROUP_new_by_curve_name ( int nid)

Creates a EC_GROUP object with a curve specified by a NID

Parameters
nidNID of the OID of the curve name
Returns
newly created EC_GROUP object with specified curve or NULL if an error occurred

◆ EC_GROUP_new_curve_GF2m()

EC_GROUP * EC_GROUP_new_curve_GF2m ( const BIGNUM * p,
const BIGNUM * a,
const BIGNUM * b,
BN_CTX * ctx )

Creates a new EC_GROUP object with the specified parameters defined over GF2m (defined by the equation y^2 + x*y = x^3 + a*x^2 + b)

Parameters
pBIGNUM with the polynomial defining the underlying field
aBIGNUM with the parameter a of the equation
bBIGNUM with the parameter b of the equation
ctxBN_CTX object (optional)
Returns
newly created EC_GROUP object with the specified parameters

◆ EC_GROUP_new_curve_GFp()

EC_GROUP * EC_GROUP_new_curve_GFp ( const BIGNUM * p,
const BIGNUM * a,
const BIGNUM * b,
BN_CTX * ctx )

Creates a new EC_GROUP object with the specified parameters defined over GFp (defined by the equation y^2 = x^3 + a*x + b)

Parameters
pBIGNUM with the prime number
aBIGNUM with the parameter a of the equation
bBIGNUM with the parameter b of the equation
ctxBN_CTX object (optional)
Returns
newly created EC_GROUP object with the specified parameters

◆ EC_GROUP_new_from_ecparameters()

EC_GROUP * EC_GROUP_new_from_ecparameters ( const ECPARAMETERS * params)

Creates a new EC_GROUP object from an ECPARAMETERS object

Parameters
paramspointer to the ECPARAMETERS object
Returns
newly created EC_GROUP object with specified curve or NULL if an error occurred

◆ EC_GROUP_new_from_ecpkparameters()

EC_GROUP * EC_GROUP_new_from_ecpkparameters ( const ECPKPARAMETERS * params)

Creates a new EC_GROUP object from an ECPKPARAMETERS object

Parameters
paramspointer to an existing ECPKPARAMETERS object, or NULL
Returns
newly created EC_GROUP object with specified curve, or NULL if an error occurred

◆ EC_GROUP_order_bits()

int EC_GROUP_order_bits ( const EC_GROUP * group)

Gets the number of bits of the order of an EC_GROUP

Parameters
groupEC_GROUP object
Returns
number of bits of group order.

◆ EC_GROUP_precompute_mult()

int EC_GROUP_precompute_mult ( EC_GROUP * group,
BN_CTX * ctx )

Stores multiples of generator for faster point multiplication

Parameters
groupEC_GROUP object
ctxBN_CTX object (optional)
Returns
1 on success and 0 if an error occurred

◆ EC_GROUP_set_asn1_flag()

void EC_GROUP_set_asn1_flag ( EC_GROUP * group,
int flag )

◆ EC_GROUP_set_curve()

int EC_GROUP_set_curve ( EC_GROUP * group,
const BIGNUM * p,
const BIGNUM * a,
const BIGNUM * b,
BN_CTX * ctx )

Sets the parameters of a ec curve defined by y^2 = x^3 + a*x + b (for GFp) or y^2 + x*y = x^3 + a*x^2 + b (for GF2m)

Parameters
groupEC_GROUP object
pBIGNUM with the prime number (GFp) or the polynomial defining the underlying field (GF2m)
aBIGNUM with parameter a of the equation
bBIGNUM with parameter b of the equation
ctxBN_CTX object (optional)
Returns
1 on success and 0 if an error occurred

◆ EC_GROUP_set_curve_name()

void EC_GROUP_set_curve_name ( EC_GROUP * group,
int nid )

Sets the name of a EC_GROUP object

Parameters
groupEC_GROUP object
nidNID of the curve name OID

◆ EC_GROUP_set_generator()

int EC_GROUP_set_generator ( EC_GROUP * group,
const EC_POINT * generator,
const BIGNUM * order,
const BIGNUM * cofactor )

Sets the generator and its order/cofactor of a EC_GROUP object.

Parameters
groupEC_GROUP object
generatorEC_POINT object with the generator.
orderthe order of the group generated by the generator.
cofactorthe index of the sub-group generated by the generator in the group of all points on the elliptic curve.
Returns
1 on success and 0 if an error occurred

◆ EC_GROUP_set_point_conversion_form()

void EC_GROUP_set_point_conversion_form ( EC_GROUP * group,
point_conversion_form_t form )

◆ EC_GROUP_set_seed()

size_t EC_GROUP_set_seed ( EC_GROUP * ,
const unsigned char * ,
size_t len )

◆ EC_KEY_can_sign()

int EC_KEY_can_sign ( const EC_KEY * eckey)

Indicates if an EC_KEY can be used for signing.

Parameters
eckeythe EC_KEY object
Returns
1 if can can sign and 0 otherwise.

◆ EC_KEY_check_key()

int EC_KEY_check_key ( const EC_KEY * key)

Verifies that a private and/or public key is valid.

Parameters
keythe EC_KEY object
Returns
1 on success and 0 otherwise.

◆ EC_KEY_clear_flags()

void EC_KEY_clear_flags ( EC_KEY * key,
int flags )

◆ EC_KEY_copy()

EC_KEY * EC_KEY_copy ( EC_KEY * dst,
const EC_KEY * src )

Copies a EC_KEY object.

Parameters
dstdestination EC_KEY object
srcsrc EC_KEY object
Returns
dst or NULL if an error occurred.

◆ EC_KEY_decoded_from_explicit_params()

int EC_KEY_decoded_from_explicit_params ( const EC_KEY * key)

◆ EC_KEY_dup()

EC_KEY * EC_KEY_dup ( const EC_KEY * src)

Creates a new EC_KEY object and copies the content from src to it.

Parameters
srcthe source EC_KEY object
Returns
newly created EC_KEY object or NULL if an error occurred.

◆ EC_KEY_free()

void EC_KEY_free ( EC_KEY * key)

Frees a EC_KEY object.

Parameters
keyEC_KEY object to be freed.

◆ EC_KEY_generate_key()

int EC_KEY_generate_key ( EC_KEY * key)

Creates a new ec private (and optional a new public) key.

Parameters
keyEC_KEY object
Returns
1 on success and 0 if an error occurred.

◆ EC_KEY_get0_engine()

ENGINE * EC_KEY_get0_engine ( const EC_KEY * eckey)

Returns the ENGINE object of a EC_KEY object

Parameters
eckeyEC_KEY object
Returns
the ENGINE object (possibly NULL).

◆ EC_KEY_get0_group()

const EC_GROUP * EC_KEY_get0_group ( const EC_KEY * key)

Returns the EC_GROUP object of a EC_KEY object

Parameters
keyEC_KEY object
Returns
the EC_GROUP object (possibly NULL).

◆ EC_KEY_get0_private_key()

const BIGNUM * EC_KEY_get0_private_key ( const EC_KEY * key)

Returns the private key of a EC_KEY object.

Parameters
keyEC_KEY object
Returns
a BIGNUM with the private key (possibly NULL).

◆ EC_KEY_get0_public_key()

const EC_POINT * EC_KEY_get0_public_key ( const EC_KEY * key)

Returns the public key of a EC_KEY object.

Parameters
keythe EC_KEY object
Returns
a EC_POINT object with the public key (possibly NULL)

◆ EC_KEY_get_conv_form()

point_conversion_form_t EC_KEY_get_conv_form ( const EC_KEY * key)

◆ EC_KEY_get_default_method()

const EC_KEY_METHOD * EC_KEY_get_default_method ( void )

◆ EC_KEY_get_enc_flags()

unsigned EC_KEY_get_enc_flags ( const EC_KEY * key)

◆ EC_KEY_get_ex_data()

void * EC_KEY_get_ex_data ( const EC_KEY * key,
int idx )

◆ EC_KEY_get_flags()

int EC_KEY_get_flags ( const EC_KEY * key)

◆ EC_KEY_get_method()

const EC_KEY_METHOD * EC_KEY_get_method ( const EC_KEY * key)

◆ EC_KEY_key2buf()

size_t EC_KEY_key2buf ( const EC_KEY * key,
point_conversion_form_t form,
unsigned char ** pbuf,
BN_CTX * ctx )

Encodes an EC_KEY public key to an allocated octet string

Parameters
keykey to encode
formpoint conversion form
pbufreturns pointer to allocated buffer
ctxBN_CTX object (optional)
Returns
the length of the encoded octet string or 0 if an error occurred

◆ EC_KEY_METHOD_free()

void EC_KEY_METHOD_free ( EC_KEY_METHOD * meth)

◆ EC_KEY_METHOD_get_compute_key()

void EC_KEY_METHOD_get_compute_key ( const EC_KEY_METHOD * meth,
int(**)(unsigned char **psec, size_t *pseclen, const EC_POINT *pub_key, const EC_KEY *ecdh) pck )

◆ EC_KEY_METHOD_get_init()

void EC_KEY_METHOD_get_init ( const EC_KEY_METHOD * meth,
int(**)(EC_KEY *key) pinit,
void(**)(EC_KEY *key) pfinish,
int(**)(EC_KEY *dest, const EC_KEY *src) pcopy,
int(**)(EC_KEY *key, const EC_GROUP *grp) pset_group,
int(**)(EC_KEY *key, const BIGNUM *priv_key) pset_private,
int(**)(EC_KEY *key, const EC_POINT *pub_key) pset_public )

◆ EC_KEY_METHOD_get_keygen()

void EC_KEY_METHOD_get_keygen ( const EC_KEY_METHOD * meth,
int(**)(EC_KEY *key) pkeygen )

◆ EC_KEY_METHOD_get_sign()

void EC_KEY_METHOD_get_sign ( const EC_KEY_METHOD * meth,
int(**)(int type, const unsigned char *dgst, int dlen, unsigned char *sig, unsigned int *siglen, const BIGNUM *kinv, const BIGNUM *r, EC_KEY *eckey) psign,
int(**)(EC_KEY *eckey, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp) psign_setup,
ECDSA_SIG *(**)(const unsigned char *dgst, int dgst_len, const BIGNUM *in_kinv, const BIGNUM *in_r, EC_KEY *eckey) psign_sig )

◆ EC_KEY_METHOD_get_verify()

void EC_KEY_METHOD_get_verify ( const EC_KEY_METHOD * meth,
int(**)(int type, const unsigned char *dgst, int dgst_len, const unsigned char *sigbuf, int sig_len, EC_KEY *eckey) pverify,
int(**)(const unsigned char *dgst, int dgst_len, const ECDSA_SIG *sig, EC_KEY *eckey) pverify_sig )

◆ EC_KEY_METHOD_new()

EC_KEY_METHOD * EC_KEY_METHOD_new ( const EC_KEY_METHOD * meth)

◆ EC_KEY_METHOD_set_compute_key()

void EC_KEY_METHOD_set_compute_key ( EC_KEY_METHOD * meth,
int(*)(unsigned char **psec, size_t *pseclen, const EC_POINT *pub_key, const EC_KEY *ecdh) ckey )

◆ EC_KEY_METHOD_set_init()

void EC_KEY_METHOD_set_init ( EC_KEY_METHOD * meth,
int(*)(EC_KEY *key) init,
void(*)(EC_KEY *key) finish,
int(*)(EC_KEY *dest, const EC_KEY *src) copy,
int(*)(EC_KEY *key, const EC_GROUP *grp) set_group,
int(*)(EC_KEY *key, const BIGNUM *priv_key) set_private,
int(*)(EC_KEY *key, const EC_POINT *pub_key) set_public )

◆ EC_KEY_METHOD_set_keygen()

void EC_KEY_METHOD_set_keygen ( EC_KEY_METHOD * meth,
int(*)(EC_KEY *key) keygen )

◆ EC_KEY_METHOD_set_sign()

void EC_KEY_METHOD_set_sign ( EC_KEY_METHOD * meth,
int(*)(int type, const unsigned char *dgst, int dlen, unsigned char *sig, unsigned int *siglen, const BIGNUM *kinv, const BIGNUM *r, EC_KEY *eckey) sign,
int(*)(EC_KEY *eckey, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp) sign_setup,
ECDSA_SIG *(*)(const unsigned char *dgst, int dgst_len, const BIGNUM *in_kinv, const BIGNUM *in_r, EC_KEY *eckey) sign_sig )

◆ EC_KEY_METHOD_set_verify()

void EC_KEY_METHOD_set_verify ( EC_KEY_METHOD * meth,
int(*)(int type, const unsigned char *dgst, int dgst_len, const unsigned char *sigbuf, int sig_len, EC_KEY *eckey) verify,
int(*)(const unsigned char *dgst, int dgst_len, const ECDSA_SIG *sig, EC_KEY *eckey) verify_sig )

◆ EC_KEY_new()

EC_KEY * EC_KEY_new ( void )

Creates a new EC_KEY object.

Returns
EC_KEY object or NULL if an error occurred.

◆ EC_KEY_new_by_curve_name()

EC_KEY * EC_KEY_new_by_curve_name ( int nid)

Creates a new EC_KEY object using a named curve as underlying EC_GROUP object.

Parameters
nidNID of the named curve.
Returns
EC_KEY object or NULL if an error occurred.

◆ EC_KEY_new_method()

EC_KEY * EC_KEY_new_method ( ENGINE * engine)

◆ EC_KEY_oct2key()

int EC_KEY_oct2key ( EC_KEY * key,
const unsigned char * buf,
size_t len,
BN_CTX * ctx )

Decodes a EC_KEY public key from a octet string

Parameters
keykey to decode
bufmemory buffer with the encoded ec point
lenlength of the encoded ec point
ctxBN_CTX object (optional)
Returns
1 on success and 0 if an error occurred

◆ EC_KEY_oct2priv()

int EC_KEY_oct2priv ( EC_KEY * key,
const unsigned char * buf,
size_t len )

Decodes an EC_KEY private key from an octet string

Parameters
keykey to decode
bufmemory buffer with the encoded private key
lenlength of the encoded key
Returns
1 on success and 0 if an error occurred

◆ EC_KEY_OpenSSL()

const EC_KEY_METHOD * EC_KEY_OpenSSL ( void )

◆ EC_KEY_precompute_mult()

int EC_KEY_precompute_mult ( EC_KEY * key,
BN_CTX * ctx )

Creates a table of pre-computed multiples of the generator to accelerate further EC_KEY operations.

Parameters
keyEC_KEY object
ctxBN_CTX object (optional)
Returns
1 on success and 0 if an error occurred.

◆ EC_KEY_print()

int EC_KEY_print ( BIO * bp,
const EC_KEY * key,
int off )

Prints out the contents of a EC_KEY object

Parameters
bpBIO object to which the information is printed
keyEC_KEY object
offline offset
Returns
1 on success and 0 if an error occurred

◆ EC_KEY_print_fp()

int EC_KEY_print_fp ( FILE * fp,
const EC_KEY * key,
int off )

Prints out the contents of a EC_KEY object

Parameters
fpfile descriptor to which the information is printed
keyEC_KEY object
offline offset
Returns
1 on success and 0 if an error occurred

◆ EC_KEY_priv2buf()

size_t EC_KEY_priv2buf ( const EC_KEY * eckey,
unsigned char ** pbuf )

Encodes an EC_KEY private key to an allocated octet string

Parameters
eckeykey to encode
pbufreturns pointer to allocated buffer
Returns
the length of the encoded octet string or 0 if an error occurred

◆ EC_KEY_priv2oct()

size_t EC_KEY_priv2oct ( const EC_KEY * key,
unsigned char * buf,
size_t len )

Encodes a EC_KEY private key to an octet string

Parameters
keykey to encode
bufmemory buffer for the result. If NULL the function returns required buffer size.
lenlength of the memory buffer
Returns
the length of the encoded octet string or 0 if an error occurred

◆ EC_KEY_set_asn1_flag()

void EC_KEY_set_asn1_flag ( EC_KEY * eckey,
int asn1_flag )

◆ EC_KEY_set_conv_form()

void EC_KEY_set_conv_form ( EC_KEY * eckey,
point_conversion_form_t cform )

◆ EC_KEY_set_default_method()

void EC_KEY_set_default_method ( const EC_KEY_METHOD * meth)

◆ EC_KEY_set_enc_flags()

void EC_KEY_set_enc_flags ( EC_KEY * eckey,
unsigned int flags )

◆ EC_KEY_set_ex_data()

int EC_KEY_set_ex_data ( EC_KEY * key,
int idx,
void * arg )

◆ EC_KEY_set_flags()

void EC_KEY_set_flags ( EC_KEY * key,
int flags )

◆ EC_KEY_set_group()

int EC_KEY_set_group ( EC_KEY * key,
const EC_GROUP * group )

Sets the EC_GROUP of a EC_KEY object.

Parameters
keyEC_KEY object
groupEC_GROUP to use in the EC_KEY object (note: the EC_KEY object will use an own copy of the EC_GROUP).
Returns
1 on success and 0 if an error occurred.

◆ EC_KEY_set_method()

int EC_KEY_set_method ( EC_KEY * key,
const EC_KEY_METHOD * meth )

◆ EC_KEY_set_private_key()

int EC_KEY_set_private_key ( EC_KEY * key,
const BIGNUM * prv )

Sets the private key of a EC_KEY object.

Parameters
keyEC_KEY object
prvBIGNUM with the private key (note: the EC_KEY object will use an own copy of the BIGNUM).
Returns
1 on success and 0 if an error occurred.

◆ EC_KEY_set_public_key()

int EC_KEY_set_public_key ( EC_KEY * key,
const EC_POINT * pub )

Sets the public key of a EC_KEY object.

Parameters
keyEC_KEY object
pubEC_POINT object with the public key (note: the EC_KEY object will use an own copy of the EC_POINT object).
Returns
1 on success and 0 if an error occurred.

◆ EC_KEY_set_public_key_affine_coordinates()

int EC_KEY_set_public_key_affine_coordinates ( EC_KEY * key,
BIGNUM * x,
BIGNUM * y )

Sets a public key from affine coordinates performing necessary NIST PKV tests.

Parameters
keythe EC_KEY object
xpublic key x coordinate
ypublic key y coordinate
Returns
1 on success and 0 otherwise.

◆ EC_KEY_up_ref()

int EC_KEY_up_ref ( EC_KEY * key)

Increases the internal reference count of a EC_KEY object.

Parameters
keyEC_KEY object
Returns
1 on success and 0 if an error occurred.

◆ EC_METHOD_get_field_type()

int EC_METHOD_get_field_type ( const EC_METHOD * meth)

Returns the field type of the EC_METHOD.

Parameters
methEC_METHOD object
Returns
NID of the underlying field type OID.

◆ EC_POINT_add()

int EC_POINT_add ( const EC_GROUP * group,
EC_POINT * r,
const EC_POINT * a,
const EC_POINT * b,
BN_CTX * ctx )

Computes the sum of two EC_POINT

Parameters
groupunderlying EC_GROUP object
rEC_POINT object for the result (r = a + b)
aEC_POINT object with the first summand
bEC_POINT object with the second summand
ctxBN_CTX object (optional)
Returns
1 on success and 0 if an error occurred

◆ EC_POINT_bn2point()

EC_POINT * EC_POINT_bn2point ( const EC_GROUP * ,
const BIGNUM * ,
EC_POINT * ,
BN_CTX *  )

◆ EC_POINT_clear_free()

void EC_POINT_clear_free ( EC_POINT * point)

Clears and frees a EC_POINT object

Parameters
pointEC_POINT object to be cleared and freed

◆ EC_POINT_cmp()

int EC_POINT_cmp ( const EC_GROUP * group,
const EC_POINT * a,
const EC_POINT * b,
BN_CTX * ctx )

Compares two EC_POINTs

Parameters
groupunderlying EC_GROUP object
afirst EC_POINT object
bsecond EC_POINT object
ctxBN_CTX object (optional)
Returns
1 if the points are not equal, 0 if they are, or -1 on error

◆ EC_POINT_copy()

int EC_POINT_copy ( EC_POINT * dst,
const EC_POINT * src )

Copies EC_POINT object

Parameters
dstdestination EC_POINT object
srcsource EC_POINT object
Returns
1 on success and 0 if an error occurred

◆ EC_POINT_dbl()

int EC_POINT_dbl ( const EC_GROUP * group,
EC_POINT * r,
const EC_POINT * a,
BN_CTX * ctx )

Computes the double of a EC_POINT

Parameters
groupunderlying EC_GROUP object
rEC_POINT object for the result (r = 2 * a)
aEC_POINT object
ctxBN_CTX object (optional)
Returns
1 on success and 0 if an error occurred

◆ EC_POINT_dup()

EC_POINT * EC_POINT_dup ( const EC_POINT * src,
const EC_GROUP * group )

Creates a new EC_POINT object and copies the content of the supplied EC_POINT

Parameters
srcsource EC_POINT object
groupunderlying the EC_GROUP object
Returns
newly created EC_POINT object or NULL if an error occurred

◆ EC_POINT_free()

void EC_POINT_free ( EC_POINT * point)

Frees a EC_POINT object

Parameters
pointEC_POINT object to be freed

◆ EC_POINT_get_affine_coordinates()

int EC_POINT_get_affine_coordinates ( const EC_GROUP * group,
const EC_POINT * p,
BIGNUM * x,
BIGNUM * y,
BN_CTX * ctx )

Gets the affine coordinates of an EC_POINT.

Parameters
groupunderlying EC_GROUP object
pEC_POINT object
xBIGNUM for the x-coordinate
yBIGNUM for the y-coordinate
ctxBN_CTX object (optional)
Returns
1 on success and 0 if an error occurred

◆ EC_POINT_get_Jprojective_coordinates_GFp()

int EC_POINT_get_Jprojective_coordinates_GFp ( const EC_GROUP * group,
const EC_POINT * p,
BIGNUM * x,
BIGNUM * y,
BIGNUM * z,
BN_CTX * ctx )

Gets the jacobian projective coordinates of a EC_POINT over GFp

Parameters
groupunderlying EC_GROUP object
pEC_POINT object
xBIGNUM for the x-coordinate
yBIGNUM for the y-coordinate
zBIGNUM for the z-coordinate
ctxBN_CTX object (optional)
Returns
1 on success and 0 if an error occurred

◆ EC_POINT_hex2point()

EC_POINT * EC_POINT_hex2point ( const EC_GROUP * ,
const char * ,
EC_POINT * ,
BN_CTX *  )

◆ EC_POINT_invert()

int EC_POINT_invert ( const EC_GROUP * group,
EC_POINT * a,
BN_CTX * ctx )

Computes the inverse of a EC_POINT

Parameters
groupunderlying EC_GROUP object
aEC_POINT object to be inverted (it's used for the result as well)
ctxBN_CTX object (optional)
Returns
1 on success and 0 if an error occurred

◆ EC_POINT_is_at_infinity()

int EC_POINT_is_at_infinity ( const EC_GROUP * group,
const EC_POINT * p )

Checks whether the point is the neutral element of the group

Parameters
groupthe underlying EC_GROUP object
pEC_POINT object
Returns
1 if the point is the neutral element and 0 otherwise

◆ EC_POINT_is_on_curve()

int EC_POINT_is_on_curve ( const EC_GROUP * group,
const EC_POINT * point,
BN_CTX * ctx )

Checks whether the point is on the curve

Parameters
groupunderlying EC_GROUP object
pointEC_POINT object to check
ctxBN_CTX object (optional)
Returns
1 if the point is on the curve, 0 if not, or -1 on error

◆ EC_POINT_make_affine()

int EC_POINT_make_affine ( const EC_GROUP * group,
EC_POINT * point,
BN_CTX * ctx )

◆ EC_POINT_method_of()

const EC_METHOD * EC_POINT_method_of ( const EC_POINT * point)

Returns the EC_METHOD used in EC_POINT object

Parameters
pointEC_POINT object
Returns
the EC_METHOD used

◆ EC_POINT_mul()

int EC_POINT_mul ( const EC_GROUP * group,
EC_POINT * r,
const BIGNUM * n,
const EC_POINT * q,
const BIGNUM * m,
BN_CTX * ctx )

Computes r = generator * n + q * m

Parameters
groupunderlying EC_GROUP object
rEC_POINT object for the result
nBIGNUM with the multiplier for the group generator (optional)
qEC_POINT object with the first factor of the second summand
mBIGNUM with the second factor of the second summand
ctxBN_CTX object (optional)
Returns
1 on success and 0 if an error occurred

◆ EC_POINT_new()

EC_POINT * EC_POINT_new ( const EC_GROUP * group)

Creates a new EC_POINT object for the specified EC_GROUP

Parameters
groupEC_GROUP the underlying EC_GROUP object
Returns
newly created EC_POINT object or NULL if an error occurred

◆ EC_POINT_oct2point()

int EC_POINT_oct2point ( const EC_GROUP * group,
EC_POINT * p,
const unsigned char * buf,
size_t len,
BN_CTX * ctx )

Decodes a EC_POINT from a octet string

Parameters
groupunderlying EC_GROUP object
pEC_POINT object
bufmemory buffer with the encoded ec point
lenlength of the encoded ec point
ctxBN_CTX object (optional)
Returns
1 on success and 0 if an error occurred

◆ EC_POINT_point2bn()

BIGNUM * EC_POINT_point2bn ( const EC_GROUP * ,
const EC_POINT * ,
point_conversion_form_t form,
BIGNUM * ,
BN_CTX *  )

◆ EC_POINT_point2buf()

size_t EC_POINT_point2buf ( const EC_GROUP * group,
const EC_POINT * point,
point_conversion_form_t form,
unsigned char ** pbuf,
BN_CTX * ctx )

Encodes an EC_POINT object to an allocated octet string

Parameters
groupunderlying EC_GROUP object
pointEC_POINT object
formpoint conversion form
pbufreturns pointer to allocated buffer
ctxBN_CTX object (optional)
Returns
the length of the encoded octet string or 0 if an error occurred

◆ EC_POINT_point2hex()

char * EC_POINT_point2hex ( const EC_GROUP * ,
const EC_POINT * ,
point_conversion_form_t form,
BN_CTX *  )

◆ EC_POINT_point2oct()

EC_POINT const BIGNUM const BIGNUM BN_CTX *ctx EC_POINT const BIGNUM int BN_CTX *ctx size_t EC_POINT_point2oct ( const EC_GROUP * group,
const EC_POINT * p,
point_conversion_form_t form,
unsigned char * buf,
size_t len,
BN_CTX * ctx )

Encodes a EC_POINT object to a octet string

Parameters
groupunderlying EC_GROUP object
pEC_POINT object
formpoint conversion form
bufmemory buffer for the result. If NULL the function returns required buffer size.
lenlength of the memory buffer
ctxBN_CTX object (optional)
Returns
the length of the encoded octet string or 0 if an error occurred

◆ EC_POINT_set_affine_coordinates()

int EC_POINT_set_affine_coordinates ( const EC_GROUP * group,
EC_POINT * p,
const BIGNUM * x,
const BIGNUM * y,
BN_CTX * ctx )

Sets the affine coordinates of an EC_POINT

Parameters
groupunderlying EC_GROUP object
pEC_POINT object
xBIGNUM with the x-coordinate
yBIGNUM with the y-coordinate
ctxBN_CTX object (optional)
Returns
1 on success and 0 if an error occurred

◆ EC_POINT_set_compressed_coordinates()

const EC_POINT BIGNUM BIGNUM BN_CTX *ctx int EC_POINT_set_compressed_coordinates ( const EC_GROUP * group,
EC_POINT * p,
const BIGNUM * x,
int y_bit,
BN_CTX * ctx )

Sets the x9.62 compressed coordinates of a EC_POINT

Parameters
groupunderlying EC_GROUP object
pEC_POINT object
xBIGNUM with x-coordinate
y_bitinteger with the y-Bit (either 0 or 1)
ctxBN_CTX object (optional)
Returns
1 on success and 0 if an error occurred

◆ EC_POINT_set_Jprojective_coordinates_GFp()

int EC_POINT_set_Jprojective_coordinates_GFp ( const EC_GROUP * group,
EC_POINT * p,
const BIGNUM * x,
const BIGNUM * y,
const BIGNUM * z,
BN_CTX * ctx )

Sets the jacobian projective coordinates of a EC_POINT over GFp

Parameters
groupunderlying EC_GROUP object
pEC_POINT object
xBIGNUM with the x-coordinate
yBIGNUM with the y-coordinate
zBIGNUM with the z-coordinate
ctxBN_CTX object (optional)
Returns
1 on success and 0 if an error occurred

◆ EC_POINT_set_to_infinity()

int EC_POINT_set_to_infinity ( const EC_GROUP * group,
EC_POINT * point )

Sets a point to infinity (neutral element)

Parameters
groupunderlying EC_GROUP object
pointEC_POINT to set to infinity
Returns
1 on success and 0 if an error occurred

◆ EC_POINTs_make_affine()

int EC_POINTs_make_affine ( const EC_GROUP * group,
size_t num,
EC_POINT * points[],
BN_CTX * ctx )

◆ EC_POINTs_mul()

int EC_POINTs_mul ( const EC_GROUP * group,
EC_POINT * r,
const BIGNUM * n,
size_t num,
const EC_POINT * p[],
const BIGNUM * m[],
BN_CTX * ctx )

Computes r = generator * n + sum_{i=0}^{num-1} p[i] * m[i]

Parameters
groupunderlying EC_GROUP object
rEC_POINT object for the result
nBIGNUM with the multiplier for the group generator (optional)
numnumber further summands
parray of size num of EC_POINT objects
marray of size num of BIGNUM objects
ctxBN_CTX object (optional)
Returns
1 on success and 0 if an error occurred

◆ ECDH_compute_key()

int ECDH_compute_key ( void * out,
size_t outlen,
const EC_POINT * pub_key,
const EC_KEY * ecdh,
void *(*)(const void *in, size_t inlen, void *out, size_t *outlen) KDF )

◆ ECDH_KDF_X9_62()

int ECDH_KDF_X9_62 ( unsigned char * out,
size_t outlen,
const unsigned char * Z,
size_t Zlen,
const unsigned char * sinfo,
size_t sinfolen,
const EVP_MD * md )

The old name for ecdh_KDF_X9_63 The ECDH KDF specification has been mistakingly attributed to ANSI X9.62, it is actually specified in ANSI X9.63. This identifier is retained for backwards compatibility

◆ ECDSA_do_sign()

ECDSA_SIG * ECDSA_do_sign ( const unsigned char * dgst,
int dgst_len,
EC_KEY * eckey )

Computes the ECDSA signature of the given hash value using the supplied private key and returns the created signature.

Parameters
dgstpointer to the hash value
dgst_lenlength of the hash value
eckeyEC_KEY object containing a private EC key
Returns
pointer to a ECDSA_SIG structure or NULL if an error occurred

◆ ECDSA_do_sign_ex()

ECDSA_SIG * ECDSA_do_sign_ex ( const unsigned char * dgst,
int dgstlen,
const BIGNUM * kinv,
const BIGNUM * rp,
EC_KEY * eckey )

Computes ECDSA signature of a given hash value using the supplied private key (note: sig must point to ECDSA_size(eckey) bytes of memory).

Parameters
dgstpointer to the hash value to sign
dgstlenlength of the hash value
kinvBIGNUM with a pre-computed inverse k (optional)
rpBIGNUM with a pre-computed rp value (optional), see ECDSA_sign_setup
eckeyEC_KEY object containing a private EC key
Returns
pointer to a ECDSA_SIG structure or NULL if an error occurred

◆ ECDSA_do_verify()

int ECDSA_do_verify ( const unsigned char * dgst,
int dgst_len,
const ECDSA_SIG * sig,
EC_KEY * eckey )

Verifies that the supplied signature is a valid ECDSA signature of the supplied hash value using the supplied public key.

Parameters
dgstpointer to the hash value
dgst_lenlength of the hash value
sigECDSA_SIG structure
eckeyEC_KEY object containing a public EC key
Returns
1 if the signature is valid, 0 if the signature is invalid and -1 on error

◆ ECDSA_SIG_free()

void ECDSA_SIG_free ( ECDSA_SIG * sig)

frees a ECDSA_SIG structure

Parameters
sigpointer to the ECDSA_SIG structure

◆ ECDSA_SIG_get0()

void ECDSA_SIG_get0 ( const ECDSA_SIG * sig,
const BIGNUM ** pr,
const BIGNUM ** ps )

Accessor for r and s fields of ECDSA_SIG

Parameters
sigpointer to ECDSA_SIG structure
prpointer to BIGNUM pointer for r (may be NULL)
pspointer to BIGNUM pointer for s (may be NULL)

◆ ECDSA_SIG_get0_r()

const BIGNUM * ECDSA_SIG_get0_r ( const ECDSA_SIG * sig)

Accessor for r field of ECDSA_SIG

Parameters
sigpointer to ECDSA_SIG structure

◆ ECDSA_SIG_get0_s()

const BIGNUM * ECDSA_SIG_get0_s ( const ECDSA_SIG * sig)

Accessor for s field of ECDSA_SIG

Parameters
sigpointer to ECDSA_SIG structure

◆ ECDSA_SIG_new()

ECDSA_SIG * ECDSA_SIG_new ( void )

Allocates and initialize a ECDSA_SIG structure

Returns
pointer to a ECDSA_SIG structure or NULL if an error occurred

◆ ECDSA_SIG_set0()

int ECDSA_SIG_set0 ( ECDSA_SIG * sig,
BIGNUM * r,
BIGNUM * s )

Setter for r and s fields of ECDSA_SIG

Parameters
sigpointer to ECDSA_SIG structure
rpointer to BIGNUM for r (may be NULL)
spointer to BIGNUM for s (may be NULL)

◆ ECDSA_sign()

int ECDSA_sign ( int type,
const unsigned char * dgst,
int dgstlen,
unsigned char * sig,
unsigned int * siglen,
EC_KEY * eckey )

Computes ECDSA signature of a given hash value using the supplied private key (note: sig must point to ECDSA_size(eckey) bytes of memory).

Parameters
typethis parameter is ignored
dgstpointer to the hash value to sign
dgstlenlength of the hash value
sigmemory for the DER encoded created signature
siglenpointer to the length of the returned signature
eckeyEC_KEY object containing a private EC key
Returns
1 on success and 0 otherwise

◆ ECDSA_sign_ex()

int ECDSA_sign_ex ( int type,
const unsigned char * dgst,
int dgstlen,
unsigned char * sig,
unsigned int * siglen,
const BIGNUM * kinv,
const BIGNUM * rp,
EC_KEY * eckey )

Computes ECDSA signature of a given hash value using the supplied private key (note: sig must point to ECDSA_size(eckey) bytes of memory).

Parameters
typethis parameter is ignored
dgstpointer to the hash value to sign
dgstlenlength of the hash value
sigbuffer to hold the DER encoded signature
siglenpointer to the length of the returned signature
kinvBIGNUM with a pre-computed inverse k (optional)
rpBIGNUM with a pre-computed rp value (optional), see ECDSA_sign_setup
eckeyEC_KEY object containing a private EC key
Returns
1 on success and 0 otherwise

◆ ECDSA_sign_setup()

int ECDSA_sign_setup ( EC_KEY * eckey,
BN_CTX * ctx,
BIGNUM ** kinv,
BIGNUM ** rp )

Precompute parts of the signing operation

Parameters
eckeyEC_KEY object containing a private EC key
ctxBN_CTX object (optional)
kinvBIGNUM pointer for the inverse of k
rpBIGNUM pointer for x coordinate of k * generator
Returns
1 on success and 0 otherwise

◆ ECDSA_size()

int ECDSA_size ( const EC_KEY * eckey)

Returns the maximum length of the DER encoded signature

Parameters
eckeyEC_KEY object
Returns
numbers of bytes required for the DER encoded signature

◆ ECDSA_verify()

int ECDSA_verify ( int type,
const unsigned char * dgst,
int dgstlen,
const unsigned char * sig,
int siglen,
EC_KEY * eckey )

Verifies that the given signature is valid ECDSA signature of the supplied hash value using the specified public key.

Parameters
typethis parameter is ignored
dgstpointer to the hash value
dgstlenlength of the hash value
sigpointer to the DER encoded signature
siglenlength of the DER encoded signature
eckeyEC_KEY object containing a public EC key
Returns
1 if the signature is valid, 0 if the signature is invalid and -1 on error

◆ ECParameters_print()

int ECParameters_print ( BIO * bp,
const EC_KEY * key )

Prints out the ec parameters on human readable form.

Parameters
bpBIO object to which the information is printed
keyEC_KEY object
Returns
1 on success and 0 if an error occurred

◆ ECParameters_print_fp()

int ECParameters_print_fp ( FILE * fp,
const EC_KEY * key )

Prints out the ec parameters on human readable form.

Parameters
fpfile descriptor to which the information is printed
keyEC_KEY object
Returns
1 on success and 0 if an error occurred

◆ ECPKParameters_print()

int ECPKParameters_print ( BIO * bp,
const EC_GROUP * x,
int off )

◆ ECPKParameters_print_fp()

int ECPKParameters_print_fp ( FILE * fp,
const EC_GROUP * x,
int off )

◆ i2d_ECDSA_SIG()

int i2d_ECDSA_SIG ( const ECDSA_SIG * sig,
unsigned char ** pp )

DER encode content of ECDSA_SIG object (note: this function modifies *pp (*pp += length of the DER encoded signature)).

Parameters
sigpointer to the ECDSA_SIG object
pppointer to a unsigned char pointer for the output or NULL
Returns
the length of the DER encoded ECDSA_SIG object or a negative value on error

◆ i2d_ECParameters()

int i2d_ECParameters ( EC_KEY * key,
unsigned char ** out )

Encodes ec parameter and stores the result in a buffer.

Parameters
keythe EC_KEY object with ec parameters to encode
outthe buffer for the result (if NULL the function returns number of bytes needed).
Returns
1 on success and 0 if an error occurred.

◆ i2d_ECPKParameters()

int i2d_ECPKParameters ( const EC_GROUP * ,
unsigned char ** out )

◆ i2d_ECPrivateKey()

int i2d_ECPrivateKey ( EC_KEY * key,
unsigned char ** out )

Encodes a private key object and stores the result in a buffer.

Parameters
keythe EC_KEY object to encode
outthe buffer for the result (if NULL the function returns number of bytes needed).
Returns
1 on success and 0 if an error occurred.

◆ i2o_ECPublicKey()

int i2o_ECPublicKey ( const EC_KEY * key,
unsigned char ** out )

Encodes a ec public key in an octet string.

Parameters
keythe EC_KEY object with the public key
outthe buffer for the result (if NULL the function returns number of bytes needed).
Returns
1 on success and 0 if an error occurred

◆ o2i_ECPublicKey()

EC_KEY * o2i_ECPublicKey ( EC_KEY ** key,
const unsigned char ** in,
long len )

Decodes a ec public key from a octet string.

Parameters
keya pointer to a EC_KEY object which should be used
inmemory buffer with the encoded public key
lenlength of the encoded public key
Returns
EC_KEY object with decoded public key or NULL if an error occurred.

Variable Documentation

◆ a

Definition at line 275 of file ec.h.

◆ b

Definition at line 275 of file ec.h.

◆ p

Definition at line 274 of file ec.h.

◆ x

EC_POINT const BIGNUM const BIGNUM BN_CTX *ctx EC_POINT const BIGNUM * x

Definition at line 545 of file ec.h.

◆ y

EC_POINT const BIGNUM const BIGNUM * y

Definition at line 546 of file ec.h.

◆ y_bit

EC_POINT const BIGNUM const BIGNUM BN_CTX *ctx EC_POINT const BIGNUM int y_bit

Definition at line 618 of file ec.h.