blob: f283d8e71ec5eb96307c51f83fbf64aeb1deef83 [file] [log] [blame]
Matt Caswellaafbe1c2013-06-12 23:42:08 +01001=pod
2
3=head1 NAME
4
Rich Salzbb9ad092016-06-06 00:43:05 -04005EC_GFp_simple_method, EC_GFp_mont_method, EC_GFp_nist_method, EC_GFp_nistp224_method, EC_GFp_nistp256_method, EC_GFp_nistp521_method, EC_GF2m_simple_method, EC_METHOD_get_field_type - Functions for obtaining EC_METHOD objects
Matt Caswellaafbe1c2013-06-12 23:42:08 +01006
7=head1 SYNOPSIS
8
9 #include <openssl/ec.h>
10
11 const EC_METHOD *EC_GFp_simple_method(void);
12 const EC_METHOD *EC_GFp_mont_method(void);
13 const EC_METHOD *EC_GFp_nist_method(void);
14 const EC_METHOD *EC_GFp_nistp224_method(void);
15 const EC_METHOD *EC_GFp_nistp256_method(void);
16 const EC_METHOD *EC_GFp_nistp521_method(void);
17
18 const EC_METHOD *EC_GF2m_simple_method(void);
19
20 int EC_METHOD_get_field_type(const EC_METHOD *meth);
21
22=head1 DESCRIPTION
23
24The Elliptic Curve library provides a number of different implementations through a single common interface.
Rich Salz9b869742015-08-17 15:21:33 -040025When constructing a curve using EC_GROUP_new (see L<EC_GROUP_new(3)>) an
Matt Caswellaafbe1c2013-06-12 23:42:08 +010026implementation method must be provided. The functions described here all return a const pointer to an
27B<EC_METHOD> structure that can be passed to EC_GROUP_NEW. It is important that the correct implementation
28type for the form of curve selected is used.
29
30For F2^m curves there is only one implementation choice, i.e. EC_GF2_simple_method.
31
32For Fp curves the lowest common denominator implementation is the EC_GFp_simple_method implementation. All
33other implementations are based on this one. EC_GFp_mont_method builds on EC_GFp_simple_method but adds the
Rich Salz9b869742015-08-17 15:21:33 -040034use of montgomery multiplication (see L<BN_mod_mul_montgomery(3)>). EC_GFp_nist_method
Matt Caswellaafbe1c2013-06-12 23:42:08 +010035offers an implementation optimised for use with NIST recommended curves (NIST curves are available through
Rich Salz9b869742015-08-17 15:21:33 -040036EC_GROUP_new_by_curve_name as described in L<EC_GROUP_new(3)>).
Matt Caswellaafbe1c2013-06-12 23:42:08 +010037
38The functions EC_GFp_nistp224_method, EC_GFp_nistp256_method and EC_GFp_nistp521_method offer 64 bit
39optimised implementations for the NIST P224, P256 and P521 curves respectively. Note, however, that these
40implementations are not available on all platforms.
41
42EC_METHOD_get_field_type identifies what type of field the EC_METHOD structure supports, which will be either
43F2^m or Fp. If the field type is Fp then the value B<NID_X9_62_prime_field> is returned. If the field type is
44F2^m then the value B<NID_X9_62_characteristic_two_field> is returned. These values are defined in the
45obj_mac.h header file.
46
47=head1 RETURN VALUES
48
49All EC_GFp* functions and EC_GF2m_simple_method always return a const pointer to an EC_METHOD structure.
50
51EC_METHOD_get_field_type returns an integer that identifies the type of field the EC_METHOD structure supports.
52
53=head1 SEE ALSO
54
Rich Salz9e183d22017-03-11 08:56:44 -050055L<crypto(7)>, L<EC_GROUP_new(3)>, L<EC_GROUP_copy(3)>,
Rich Salz9b869742015-08-17 15:21:33 -040056L<EC_POINT_new(3)>, L<EC_POINT_add(3)>, L<EC_KEY_new(3)>,
57L<d2i_ECPKParameters(3)>,
58L<BN_mod_mul_montgomery(3)>
Matt Caswellaafbe1c2013-06-12 23:42:08 +010059
Rich Salze2f92612016-05-18 11:44:05 -040060=head1 COPYRIGHT
61
Rich Salz9e183d22017-03-11 08:56:44 -050062Copyright 2013-2017 The OpenSSL Project Authors. All Rights Reserved.
Rich Salze2f92612016-05-18 11:44:05 -040063
64Licensed under the OpenSSL license (the "License"). You may not use
65this file except in compliance with the License. You can obtain a copy
66in the file LICENSE in the source distribution or at
67L<https://www.openssl.org/source/license.html>.
68
69=cut