NAME
EC_GFp_simple_method
,
EC_GFp_mont_method
,
EC_METHOD_get_field_type
—
obtain EC_METHOD objects
SYNOPSIS
#include
<openssl/ec.h>
const EC_METHOD *
EC_GFp_simple_method
(void);
const EC_METHOD *
EC_GFp_mont_method
(void);
int
EC_METHOD_get_field_type
(const
EC_METHOD *meth);
DESCRIPTION
The elliptic curve library provides a number of different implementations through a single common interface. Each implementation is optimised for different scenarios. An implementation is represented by an EC_METHOD structure.
When constructing a curve using EC_GROUP_new(3), an implementation method must be provided. The functions described here all return a const pointer to an EC_METHOD structure that can be passed to EC_GROUP_new(3). It is important that the correct implementation type for the form of curve selected is used.
For Fp curves the lowest common
denominator implementation is the
EC_GFp_simple_method
()
implementation. All other implementations are based on this one.
EC_GFp_mont_method
()
adds the use of Montgomery multiplication (see
BN_mod_mul_montgomery(3)).
EC_METHOD_get_field_type
()
identifies what type of field the EC_METHOD structure
supports. If the field type is Fp, then the value
NID_X9_62_prime_field
is returned. If the field type
is F2^m, then the value
NID_X9_62_characteristic_two_field
is returned.
These values are defined in the
<openssl/objects.h>
header
file.
RETURN VALUES
All EC_GFp*
() functions always return a
const pointer to an EC_METHOD structure.
EC_METHOD_get_field_type
() returns an
integer that identifies the type of field the
EC_METHOD structure supports.
SEE ALSO
BN_mod_mul_montgomery(3), d2i_ECPKParameters(3), EC_GROUP_copy(3), EC_GROUP_new(3), EC_KEY_new(3), EC_POINT_add(3), EC_POINT_new(3)
HISTORY
EC_GFp_simple_method
() and
EC_GFp_mont_method
() first appeared in OpenSSL 0.9.7
and have been available since OpenBSD 3.2.
EC_METHOD_get_field_type
() first appeared
in OpenSSL 0.9.8 and has been available since OpenBSD
4.5.