1 .\" $OpenBSD: EC_GFp_simple_method.3,v 1.6 2016/12/11 14:22:43 schwarze Exp $
2 .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
4 .\" This file was written by Matt Caswell <matt@openssl.org>.
5 .\" Copyright (c) 2013 The OpenSSL Project. All rights reserved.
7 .\" Redistribution and use in source and binary forms, with or without
8 .\" modification, are permitted provided that the following conditions
11 .\" 1. Redistributions of source code must retain the above copyright
12 .\" notice, this list of conditions and the following disclaimer.
14 .\" 2. Redistributions in binary form must reproduce the above copyright
15 .\" notice, this list of conditions and the following disclaimer in
16 .\" the documentation and/or other materials provided with the
19 .\" 3. All advertising materials mentioning features or use of this
20 .\" software must display the following acknowledgment:
21 .\" "This product includes software developed by the OpenSSL Project
22 .\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
24 .\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
25 .\" endorse or promote products derived from this software without
26 .\" prior written permission. For written permission, please contact
27 .\" openssl-core@openssl.org.
29 .\" 5. Products derived from this software may not be called "OpenSSL"
30 .\" nor may "OpenSSL" appear in their names without prior written
31 .\" permission of the OpenSSL Project.
33 .\" 6. Redistributions of any form whatsoever must retain the following
35 .\" "This product includes software developed by the OpenSSL Project
36 .\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
38 .\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
39 .\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
40 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
41 .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
42 .\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
43 .\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
44 .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
45 .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
46 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
47 .\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
48 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
49 .\" OF THE POSSIBILITY OF SUCH DAMAGE.
51 .Dd $Mdocdate: December 11 2016 $
52 .Dt EC_GFP_SIMPLE_METHOD 3
55 .Nm EC_GFp_simple_method ,
56 .Nm EC_GFp_mont_method ,
57 .Nm EC_GFp_nist_method ,
58 .Nm EC_GFp_nistp224_method ,
59 .Nm EC_GFp_nistp256_method ,
60 .Nm EC_GFp_nistp521_method ,
61 .Nm EC_GF2m_simple_method ,
62 .Nm EC_METHOD_get_field_type
63 .Nd obtain EC_METHOD objects
67 .Fn EC_GFp_simple_method void
69 .Fn EC_GFp_mont_method void
71 .Fn EC_GFp_nist_method void
73 .Fn EC_GFp_nistp224_method void
75 .Fn EC_GFp_nistp256_method void
77 .Fn EC_GFp_nistp521_method void
79 .Fn EC_GF2m_simple_method void
81 .Fo EC_METHOD_get_field_type
82 .Fa "const EC_METHOD *meth"
85 The elliptic curve library provides a number of different
86 implementations through a single common interface.
87 Each implementation is optimised for different scenarios.
88 An implementation is represented by an
92 When constructing a curve using
94 an implementation method must be provided.
95 The functions described here all return a const pointer to an
97 structure that can be passed to
99 It is important that the correct implementation type for the form
100 of curve selected is used.
102 For F2^m curves there is only one implementation choice,
103 .Fn EC_GF2_simple_method .
105 For Fp curves the lowest common denominator implementation is the
106 .Fn EC_GFp_simple_method
108 All other implementations are based on this one.
109 .Fn EC_GFp_mont_method
110 adds the use of Montgomery multiplication (see
111 .Xr BN_mod_mul_montgomery 3 ) .
112 .Fn EC_GFp_nist_method
113 offers an implementation optimised for use with NIST recommended
115 NIST curves are available through
116 .Xr EC_GROUP_new_by_curve_name 3 .
119 .Fn EC_GFp_nistp224_method ,
120 .Fn EC_GFp_nistp256_method ,
122 .Fn EC_GFp_nistp521_method
123 offer 64-bit optimised implementations for the NIST P224, P256 and
124 P521 curves respectively.
125 Note, however, that these implementations are not available on all
128 .Fn EC_METHOD_get_field_type
129 identifies what type of field the
131 structure supports, which will be either F2^m or Fp.
132 If the field type is Fp, then the value
133 .Dv NID_X9_62_prime_field
135 If the field type is F2^m, then the value
136 .Dv NID_X9_62_characteristic_two_field
138 These values are defined in the
139 .In openssl/obj_mac.h
145 .Fn EC_GF2m_simple_method
146 always return a const pointer to an
150 .Fn EC_METHOD_get_field_type
151 returns an integer that identifies the type of field the
155 .Xr BN_mod_mul_montgomery 3 ,
156 .Xr d2i_ECPKParameters 3 ,
157 .Xr EC_GROUP_copy 3 ,