Barrelfish
Enumerations | Functions
ec.h File Reference

Enumerations

Functions

const EC_METHOD * EC_GFp_simple_method (void)
 
const EC_METHOD * EC_GFp_mont_method (void)
 
const EC_METHOD * EC_GFp_nist_method (void)
 
const EC_METHOD * EC_GF2m_simple_method (void)
 
EC_GROUP * EC_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_GROUP * EC_GROUP_dup (const EC_GROUP *src)
 
const EC_METHOD * EC_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_POINT * EC_GROUP_get0_generator (const EC_GROUP *group)
 
int EC_GROUP_get_order (const EC_GROUP *group, BIGNUM *order, BN_CTX *ctx)
 
int EC_GROUP_get_cofactor (const EC_GROUP *group, BIGNUM *cofactor, BN_CTX *ctx)
 
void EC_GROUP_set_curve_name (EC_GROUP *group, int nid)
 
int EC_GROUP_get_curve_name (const EC_GROUP *group)
 
int EC_GROUP_set_curve_GFp (EC_GROUP *group, const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx)
 
int EC_GROUP_get_curve_GFp (const EC_GROUP *group, BIGNUM *p, BIGNUM *a, BIGNUM *b, BN_CTX *ctx)
 
int EC_GROUP_set_curve_GF2m (EC_GROUP *group, const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx)
 
int EC_GROUP_get_curve_GF2m (const EC_GROUP *group, BIGNUM *p, BIGNUM *a, BIGNUM *b, 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_GROUP * EC_GROUP_new_curve_GFp (const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx)
 
EC_GROUP * EC_GROUP_new_curve_GF2m (const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx)
 
EC_GROUP * EC_GROUP_new_by_curve_name (int nid)
 
EC_POINT * EC_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_POINT * EC_POINT_dup (const EC_POINT *src, const EC_GROUP *group)
 
const EC_METHOD * EC_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_GFp (const EC_GROUP *group, EC_POINT *p, const BIGNUM *x, const BIGNUM *y, BN_CTX *ctx)
 
int EC_POINT_get_affine_coordinates_GFp (const EC_GROUP *group, const EC_POINT *p, BIGNUM *x, BIGNUM *y, BN_CTX *ctx)
 
int EC_POINT_set_compressed_coordinates_GFp (const EC_GROUP *group, EC_POINT *p, const BIGNUM *x, int y_bit, BN_CTX *ctx)
 
int EC_POINT_set_affine_coordinates_GF2m (const EC_GROUP *group, EC_POINT *p, const BIGNUM *x, const BIGNUM *y, BN_CTX *ctx)
 
int EC_POINT_get_affine_coordinates_GF2m (const EC_GROUP *group, const EC_POINT *p, BIGNUM *x, BIGNUM *y, BN_CTX *ctx)
 
int EC_POINT_set_compressed_coordinates_GF2m (const EC_GROUP *group, EC_POINT *p, const BIGNUM *x, int y_bit, 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)
 
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_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)
 
EC_KEY * EC_KEY_new (void)
 
EC_KEY * EC_KEY_new_by_curve_name (int nid)
 
void EC_KEY_free (EC_KEY *key)
 
EC_KEY * EC_KEY_copy (EC_KEY *dst, const EC_KEY *src)
 
EC_KEY * EC_KEY_dup (const EC_KEY *src)
 
int EC_KEY_up_ref (EC_KEY *key)
 
const EC_GROUP * EC_KEY_get0_group (const EC_KEY *key)
 
int EC_KEY_set_group (EC_KEY *key, const EC_GROUP *group)
 
const BIGNUM * EC_KEY_get0_private_key (const EC_KEY *key)
 
int EC_KEY_set_private_key (EC_KEY *key, const BIGNUM *prv)
 
const EC_POINT * EC_KEY_get0_public_key (const EC_KEY *key)
 
int EC_KEY_set_public_key (EC_KEY *key, const EC_POINT *pub)
 
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)
 
EC_KEY * d2i_ECPrivateKey (EC_KEY **key, const unsigned char **in, long len)
 
int i2d_ECPrivateKey (EC_KEY *key, unsigned char **out)
 
EC_KEY * d2i_ECParameters (EC_KEY **key, const unsigned char **in, long len)
 
int i2d_ECParameters (EC_KEY *key, unsigned char **out)
 
EC_KEY * o2i_ECPublicKey (EC_KEY **key, const unsigned char **in, long len)
 
int i2o_ECPublicKey (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)
 

Detailed Description

Include file for the OpenSSL EC functions

Author
Originally written by Bodo Moeller for the OpenSSL project

Enumeration Type Documentation

enum 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 0x02

POINT_CONVERSION_HYBRID 

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

Function Documentation

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.
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.
const EC_METHOD* EC_GF2m_simple_method ( void  )

Returns the basic GF2m ec method

Returns
EC_METHOD object
const EC_METHOD* EC_GFp_mont_method ( void  )

Returns GFp methods using montgomery multiplication.

Returns
EC_METHOD object
const EC_METHOD* EC_GFp_nist_method ( void  )

Returns GFp methods using optimized methods for NIST recommended curves

Returns
EC_METHOD object
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
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
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
void EC_GROUP_clear_free ( EC_GROUP *  group)

Clears and frees a EC_GROUP object

Parameters
groupEC_GROUP object to be cleared and freed.
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 both groups are equal and 1 otherwise
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* 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.
void EC_GROUP_free ( EC_GROUP *  group)

Frees a EC_GROUP object

Parameters
groupEC_GROUP object to be freed.
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).
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
ctxBN_CTX object (optional)
Returns
1 on success and 0 if an error occured
int EC_GROUP_get_curve_GF2m ( const EC_GROUP *  group,
BIGNUM *  p,
BIGNUM *  a,
BIGNUM *  b,
BN_CTX *  ctx 
)

Gets the parameter of the ec over GF2m defined by y^2 + x*y = x^3 + a*x^2 + b

Parameters
groupEC_GROUP object
pBIGNUM for the polynomial defining the underlying field
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 occured
int EC_GROUP_get_curve_GFp ( const EC_GROUP *  group,
BIGNUM *  p,
BIGNUM *  a,
BIGNUM *  b,
BN_CTX *  ctx 
)

Gets the parameter of the ec over GFp defined by y^2 = x^3 + a*x + b

Parameters
groupEC_GROUP object
pBIGNUM for the prime number
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 occured
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.
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
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
ctxBN_CTX object (optional)
Returns
1 on success and 0 if an error occured
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
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* 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* 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* 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* 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
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 occured
int EC_GROUP_set_curve_GF2m ( EC_GROUP *  group,
const BIGNUM *  p,
const BIGNUM *  a,
const BIGNUM *  b,
BN_CTX *  ctx 
)

Sets the parameter of a ec over GF2m defined by y^2 + x*y = x^3 + a*x^2 + b

Parameters
groupEC_GROUP object
pBIGNUM with the polynomial defining the underlying field
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 occured
int EC_GROUP_set_curve_GFp ( EC_GROUP *  group,
const BIGNUM *  p,
const BIGNUM *  a,
const BIGNUM *  b,
BN_CTX *  ctx 
)

Sets the parameter of a ec over GFp defined by y^2 = x^3 + a*x + b

Parameters
groupEC_GROUP object
pBIGNUM with the prime number
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 occured
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
int EC_GROUP_set_generator ( EC_GROUP *  group,
const EC_POINT *  generator,
const BIGNUM *  order,
const BIGNUM *  cofactor 
)

Sets the generator and it's 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 occured
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* 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* 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.
void EC_KEY_free ( EC_KEY *  key)

Frees a EC_KEY object.

Parameters
keyEC_KEY object to be freed.
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.
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).
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).
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* EC_KEY_new ( void  )

Creates a new EC_KEY object.

Returns
EC_KEY object or NULL if an error occurred.
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.
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.
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
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
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.
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.
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.
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.
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.
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 occured
void EC_POINT_clear_free ( EC_POINT *  point)

Clears and frees a EC_POINT object

Parameters
pointEC_POINT object to be cleared and freed
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
0 if both points are equal and a value != 0 otherwise
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 occured
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 occured
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
void EC_POINT_free ( EC_POINT *  point)

Frees a EC_POINT object

Parameters
pointEC_POINT object to be freed
int EC_POINT_get_affine_coordinates_GF2m ( const EC_GROUP *  group,
const EC_POINT *  p,
BIGNUM *  x,
BIGNUM *  y,
BN_CTX *  ctx 
)

Gets the affine coordinates of a EC_POINT over GF2m

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 occured
int EC_POINT_get_affine_coordinates_GFp ( const EC_GROUP *  group,
const EC_POINT *  p,
BIGNUM *  x,
BIGNUM *  y,
BN_CTX *  ctx 
)

Gets the affine 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
ctxBN_CTX object (optional)
Returns
1 on success and 0 if an error occured
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 occured
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 occured
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
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 point if on the curve and 0 otherwise
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
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 occured
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
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 occured
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
int EC_POINT_set_affine_coordinates_GF2m ( const EC_GROUP *  group,
EC_POINT *  p,
const BIGNUM *  x,
const BIGNUM *  y,
BN_CTX *  ctx 
)

Sets the affine coordinates of a EC_POINT over GF2m

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 occured
int EC_POINT_set_affine_coordinates_GFp ( const EC_GROUP *  group,
EC_POINT *  p,
const BIGNUM *  x,
const BIGNUM *  y,
BN_CTX *  ctx 
)

Sets the affine 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
ctxBN_CTX object (optional)
Returns
1 on success and 0 if an error occured
int EC_POINT_set_compressed_coordinates_GF2m ( 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 over GF2m

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 occured
int EC_POINT_set_compressed_coordinates_GFp ( 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 over GFp

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 occured
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 occured
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 occured
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 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 futher 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 occured
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
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
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 paramters 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.
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.
int i2o_ECPublicKey ( 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
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.