line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#include "EXTERN.h" |
2
|
|
|
|
|
|
|
#include "perl.h" |
3
|
|
|
|
|
|
|
#include "XSUB.h" |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
#include "ppport.h" |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
#include |
8
|
|
|
|
|
|
|
#include |
9
|
|
|
|
|
|
|
#include |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
#include "const-c.inc" |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
MODULE = Crypt::OpenSSL::EC PACKAGE = Crypt::OpenSSL::EC |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
PROTOTYPES: ENABLE |
16
|
|
|
|
|
|
|
INCLUDE: const-xs.inc |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
BOOT: |
19
|
2
|
|
|
|
|
|
ERR_load_crypto_strings(); |
20
|
2
|
|
|
|
|
|
ERR_load_EC_strings(); |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
const EC_METHOD * |
23
|
|
|
|
|
|
|
EC_GFp_simple_method() |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
const EC_METHOD * |
26
|
|
|
|
|
|
|
EC_GFp_mont_method() |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
const EC_METHOD * |
29
|
|
|
|
|
|
|
EC_GFp_nist_method() |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
#ifndef OPENSSL_NO_EC2M |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
const EC_METHOD * |
34
|
|
|
|
|
|
|
EC_GF2m_simple_method() |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
#endif |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
#ifndef OPENSSL_NO_BIO |
39
|
|
|
|
|
|
|
int |
40
|
|
|
|
|
|
|
ECParameters_print(BIO *bp, const EC_KEY *key) |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
int |
43
|
|
|
|
|
|
|
EC_KEY_print(BIO *bp, const EC_KEY *key, int off) |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
#endif |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
#ifndef OPENSSL_NO_FP_API |
48
|
|
|
|
|
|
|
int |
49
|
|
|
|
|
|
|
ECParameters_print_fp(FILE *fp, const EC_KEY *key) |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
int |
52
|
|
|
|
|
|
|
EC_KEY_print_fp(FILE *fp, const EC_KEY *key, int off) |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
#endif |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
unsigned long |
57
|
|
|
|
|
|
|
ERR_get_error() |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
char * |
60
|
|
|
|
|
|
|
ERR_error_string(error,buf=NULL) |
61
|
|
|
|
|
|
|
unsigned long error |
62
|
|
|
|
|
|
|
char * buf |
63
|
|
|
|
|
|
|
CODE: |
64
|
0
|
|
|
|
|
|
RETVAL = ERR_error_string(error,buf); |
65
|
|
|
|
|
|
|
OUTPUT: |
66
|
|
|
|
|
|
|
RETVAL |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
MODULE = Crypt::OpenSSL::EC PACKAGE = Crypt::OpenSSL::EC::EC_GROUP PREFIX=EC_GROUP_ |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
EC_GROUP * |
73
|
|
|
|
|
|
|
EC_GROUP_new(const EC_METHOD *meth) |
74
|
|
|
|
|
|
|
CODE: |
75
|
10
|
|
|
|
|
|
RETVAL = EC_GROUP_new(meth); |
76
|
|
|
|
|
|
|
OUTPUT: |
77
|
|
|
|
|
|
|
RETVAL |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
void |
80
|
|
|
|
|
|
|
EC_GROUP_DESTROY(EC_GROUP * group) |
81
|
|
|
|
|
|
|
CODE: |
82
|
12
|
|
|
|
|
|
EC_GROUP_free(group); |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
void |
85
|
|
|
|
|
|
|
EC_GROUP_free(EC_GROUP * group) |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
int |
88
|
|
|
|
|
|
|
EC_GROUP_copy(EC_GROUP *dst, const EC_GROUP *src) |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
EC_GROUP * |
91
|
|
|
|
|
|
|
EC_GROUP_dup(const EC_GROUP *src) |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
const EC_METHOD * |
94
|
|
|
|
|
|
|
EC_GROUP_method_of(const EC_GROUP *group) |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
int |
97
|
|
|
|
|
|
|
EC_METHOD_get_field_type(const EC_METHOD *meth) |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
int |
100
|
|
|
|
|
|
|
EC_GROUP_set_generator(EC_GROUP *group, const EC_POINT *generator, const BIGNUM *order, const BIGNUM *cofactor) |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
const EC_POINT * |
103
|
|
|
|
|
|
|
EC_GROUP_get0_generator(const EC_GROUP *group) |
104
|
|
|
|
|
|
|
CODE: |
105
|
0
|
|
|
|
|
|
RETVAL = EC_POINT_dup(EC_GROUP_get0_generator(group), group); |
106
|
|
|
|
|
|
|
OUTPUT: |
107
|
|
|
|
|
|
|
RETVAL |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
int |
110
|
|
|
|
|
|
|
EC_GROUP_get_order(const EC_GROUP *group, BIGNUM *order, BN_CTX *ctx) |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
int |
113
|
|
|
|
|
|
|
EC_GROUP_get_cofactor(const EC_GROUP *group, BIGNUM *cofactor, BN_CTX *ctx) |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
void |
116
|
|
|
|
|
|
|
EC_GROUP_set_curve_name(EC_GROUP *group, int nid) |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
int |
119
|
|
|
|
|
|
|
EC_GROUP_get_curve_name(const EC_GROUP *group) |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
void |
122
|
|
|
|
|
|
|
EC_GROUP_set_asn1_flag(EC_GROUP *group, int flag) |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
int |
125
|
|
|
|
|
|
|
EC_GROUP_get_asn1_flag(const EC_GROUP *group); |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
void |
128
|
|
|
|
|
|
|
EC_GROUP_set_point_conversion_form(EC_GROUP *group, point_conversion_form_t theform) |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
point_conversion_form_t |
131
|
|
|
|
|
|
|
EC_GROUP_get_point_conversion_form(const EC_GROUP *group) |
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
char * |
134
|
|
|
|
|
|
|
EC_GROUP_get0_seed(const EC_GROUP *group) |
135
|
|
|
|
|
|
|
CODE: |
136
|
0
|
|
|
|
|
|
RETVAL = (char*)EC_GROUP_get0_seed(group); /* signedness issues */ |
137
|
|
|
|
|
|
|
OUTPUT: |
138
|
|
|
|
|
|
|
RETVAL |
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
size_t |
141
|
|
|
|
|
|
|
EC_GROUP_get_seed_len(const EC_GROUP *group) |
142
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
size_t |
144
|
|
|
|
|
|
|
EC_GROUP_set_seed(EC_GROUP *group, const unsigned char *theseed, size_t length(theseed)) |
145
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
int |
147
|
|
|
|
|
|
|
EC_GROUP_set_curve_GFp(EC_GROUP *group, const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx) |
148
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
int |
150
|
|
|
|
|
|
|
EC_GROUP_get_curve_GFp(const EC_GROUP *group, BIGNUM *p, BIGNUM *a, BIGNUM *b, BN_CTX *ctx) |
151
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
#ifndef OPENSSL_NO_EC2M |
153
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
int |
155
|
|
|
|
|
|
|
EC_GROUP_set_curve_GF2m(EC_GROUP *group, const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx) |
156
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
int |
158
|
|
|
|
|
|
|
EC_GROUP_get_curve_GF2m(const EC_GROUP *group, BIGNUM *p, BIGNUM *a, BIGNUM *b, BN_CTX *ctx) |
159
|
|
|
|
|
|
|
|
160
|
|
|
|
|
|
|
#endif |
161
|
|
|
|
|
|
|
|
162
|
|
|
|
|
|
|
int |
163
|
|
|
|
|
|
|
EC_GROUP_get_degree(const EC_GROUP *group) |
164
|
|
|
|
|
|
|
|
165
|
|
|
|
|
|
|
int |
166
|
|
|
|
|
|
|
EC_GROUP_check(const EC_GROUP *group, BN_CTX *ctx) |
167
|
|
|
|
|
|
|
|
168
|
|
|
|
|
|
|
int |
169
|
|
|
|
|
|
|
EC_GROUP_check_discriminant(const EC_GROUP *group, BN_CTX *ctx) |
170
|
|
|
|
|
|
|
|
171
|
|
|
|
|
|
|
int |
172
|
|
|
|
|
|
|
EC_GROUP_cmp(const EC_GROUP *a, const EC_GROUP *b, BN_CTX *ctx) |
173
|
|
|
|
|
|
|
|
174
|
|
|
|
|
|
|
EC_GROUP * |
175
|
|
|
|
|
|
|
EC_GROUP_new_curve_GFp(const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx) |
176
|
|
|
|
|
|
|
|
177
|
|
|
|
|
|
|
#ifndef OPENSSL_NO_EC2M |
178
|
|
|
|
|
|
|
|
179
|
|
|
|
|
|
|
EC_GROUP * |
180
|
|
|
|
|
|
|
EC_GROUP_new_curve_GF2m(const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx) |
181
|
|
|
|
|
|
|
|
182
|
|
|
|
|
|
|
#endif |
183
|
|
|
|
|
|
|
|
184
|
|
|
|
|
|
|
EC_GROUP * |
185
|
|
|
|
|
|
|
EC_GROUP_new_by_curve_name(int nid) |
186
|
|
|
|
|
|
|
|
187
|
|
|
|
|
|
|
int |
188
|
|
|
|
|
|
|
EC_GROUP_precompute_mult(EC_GROUP *group, BN_CTX *ctx) |
189
|
|
|
|
|
|
|
|
190
|
|
|
|
|
|
|
int |
191
|
|
|
|
|
|
|
EC_GROUP_have_precompute_mult(const EC_GROUP *group) |
192
|
|
|
|
|
|
|
|
193
|
|
|
|
|
|
|
|
194
|
|
|
|
|
|
|
int |
195
|
|
|
|
|
|
|
EC_GROUP_get_basis_type(const EC_GROUP *group) |
196
|
|
|
|
|
|
|
|
197
|
|
|
|
|
|
|
#ifndef OPENSSL_NO_EC2M |
198
|
|
|
|
|
|
|
|
199
|
|
|
|
|
|
|
int |
200
|
|
|
|
|
|
|
EC_GROUP_get_trinomial_basis(const EC_GROUP *group, IN_OUT unsigned int k) |
201
|
|
|
|
|
|
|
CODE: |
202
|
0
|
|
|
|
|
|
RETVAL = EC_GROUP_get_trinomial_basis(group, &k); |
203
|
|
|
|
|
|
|
OUTPUT: |
204
|
|
|
|
|
|
|
k sv_setiv(ST(1), k); |
205
|
|
|
|
|
|
|
RETVAL |
206
|
|
|
|
|
|
|
|
207
|
|
|
|
|
|
|
int |
208
|
|
|
|
|
|
|
EC_GROUP_get_pentanomial_basis(const EC_GROUP *group, IN_OUT unsigned int k1, IN_OUT unsigned int k2, IN_OUT unsigned int k3) |
209
|
|
|
|
|
|
|
CODE: |
210
|
0
|
|
|
|
|
|
RETVAL = EC_GROUP_get_pentanomial_basis(group, &k1, &k2, &k3); |
211
|
|
|
|
|
|
|
OUTPUT: |
212
|
|
|
|
|
|
|
k1 sv_setiv(ST(1), k1); |
213
|
|
|
|
|
|
|
k2 sv_setiv(ST(2), k2); |
214
|
|
|
|
|
|
|
k3 sv_setiv(ST(3), k3); |
215
|
|
|
|
|
|
|
RETVAL |
216
|
|
|
|
|
|
|
|
217
|
|
|
|
|
|
|
#endif |
218
|
|
|
|
|
|
|
|
219
|
|
|
|
|
|
|
#EC_GROUP * |
220
|
|
|
|
|
|
|
#d2i_ECPKParameters(EC_GROUP **group, const unsigned char **in, long len) |
221
|
|
|
|
|
|
|
|
222
|
|
|
|
|
|
|
#int |
223
|
|
|
|
|
|
|
#i2d_ECPKParameters(const EC_GROUP *group, unsigned char **out) |
224
|
|
|
|
|
|
|
|
225
|
|
|
|
|
|
|
MODULE = Crypt::OpenSSL::EC PACKAGE = Crypt::OpenSSL::EC::EC_POINT PREFIX=EC_POINT_ |
226
|
|
|
|
|
|
|
|
227
|
|
|
|
|
|
|
EC_POINT * |
228
|
|
|
|
|
|
|
EC_POINT_new(const EC_GROUP *group) |
229
|
|
|
|
|
|
|
CODE: |
230
|
17
|
|
|
|
|
|
RETVAL = EC_POINT_new(group); |
231
|
|
|
|
|
|
|
OUTPUT: |
232
|
|
|
|
|
|
|
RETVAL |
233
|
|
|
|
|
|
|
|
234
|
|
|
|
|
|
|
void |
235
|
|
|
|
|
|
|
EC_POINT_DESTROY(EC_POINT *point) |
236
|
|
|
|
|
|
|
CODE: |
237
|
19
|
|
|
|
|
|
EC_POINT_free(point); |
238
|
|
|
|
|
|
|
|
239
|
|
|
|
|
|
|
void |
240
|
|
|
|
|
|
|
EC_POINT_free(EC_POINT *point) |
241
|
|
|
|
|
|
|
|
242
|
|
|
|
|
|
|
void |
243
|
|
|
|
|
|
|
EC_POINT_clear_free(EC_POINT *point) |
244
|
|
|
|
|
|
|
|
245
|
|
|
|
|
|
|
int |
246
|
|
|
|
|
|
|
EC_POINT_copy(EC_POINT *dst, const EC_POINT *src) |
247
|
|
|
|
|
|
|
|
248
|
|
|
|
|
|
|
EC_POINT * |
249
|
|
|
|
|
|
|
EC_POINT_dup(const EC_POINT *src, const EC_GROUP *group) |
250
|
|
|
|
|
|
|
|
251
|
|
|
|
|
|
|
const EC_METHOD * |
252
|
|
|
|
|
|
|
EC_POINT_method_of(const EC_POINT *point) |
253
|
|
|
|
|
|
|
|
254
|
|
|
|
|
|
|
int |
255
|
|
|
|
|
|
|
EC_POINT_set_to_infinity(const EC_GROUP *group, EC_POINT *point) |
256
|
|
|
|
|
|
|
|
257
|
|
|
|
|
|
|
int |
258
|
|
|
|
|
|
|
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) |
259
|
|
|
|
|
|
|
|
260
|
|
|
|
|
|
|
int |
261
|
|
|
|
|
|
|
EC_POINT_get_Jprojective_coordinates_GFp(const EC_GROUP *group, const EC_POINT *p, BIGNUM *x, BIGNUM *y, BIGNUM *z, BN_CTX *ctx) |
262
|
|
|
|
|
|
|
|
263
|
|
|
|
|
|
|
int |
264
|
|
|
|
|
|
|
EC_POINT_set_affine_coordinates_GFp(const EC_GROUP *group, EC_POINT *p, const BIGNUM *x, const BIGNUM *y, BN_CTX *ctx) |
265
|
|
|
|
|
|
|
|
266
|
|
|
|
|
|
|
int |
267
|
|
|
|
|
|
|
EC_POINT_get_affine_coordinates_GFp(const EC_GROUP *group, const EC_POINT *p, BIGNUM *x, BIGNUM *y, BN_CTX *ctx) |
268
|
|
|
|
|
|
|
|
269
|
|
|
|
|
|
|
int |
270
|
|
|
|
|
|
|
EC_POINT_set_compressed_coordinates_GFp(const EC_GROUP *group, EC_POINT *p, const BIGNUM *x, int y_bit, BN_CTX *ctx) |
271
|
|
|
|
|
|
|
|
272
|
|
|
|
|
|
|
#ifndef OPENSSL_NO_EC2M |
273
|
|
|
|
|
|
|
|
274
|
|
|
|
|
|
|
int |
275
|
|
|
|
|
|
|
EC_POINT_set_affine_coordinates_GF2m(const EC_GROUP *group, EC_POINT *p, const BIGNUM *x, const BIGNUM *y, BN_CTX *ctx) |
276
|
|
|
|
|
|
|
|
277
|
|
|
|
|
|
|
int |
278
|
|
|
|
|
|
|
EC_POINT_get_affine_coordinates_GF2m(const EC_GROUP *group, const EC_POINT *p, BIGNUM *x, BIGNUM *y, BN_CTX *ctx) |
279
|
|
|
|
|
|
|
|
280
|
|
|
|
|
|
|
int |
281
|
|
|
|
|
|
|
EC_POINT_set_compressed_coordinates_GF2m(const EC_GROUP *group, EC_POINT *p, const BIGNUM *x, int y_bit, BN_CTX *ctx) |
282
|
|
|
|
|
|
|
|
283
|
|
|
|
|
|
|
#endif |
284
|
|
|
|
|
|
|
|
285
|
|
|
|
|
|
|
SV * |
286
|
|
|
|
|
|
|
EC_POINT_point2oct(const EC_GROUP *group, const EC_POINT *p, point_conversion_form_t theform, BN_CTX *ctx) |
287
|
|
|
|
|
|
|
PREINIT: |
288
|
|
|
|
|
|
|
STRLEN len; |
289
|
|
|
|
|
|
|
char* buf; |
290
|
|
|
|
|
|
|
CODE: |
291
|
3
|
|
|
|
|
|
len = EC_POINT_point2oct(group, p, theform, NULL, 0, ctx); |
292
|
3
|
|
|
|
|
|
Newx(buf, len, char); |
293
|
3
|
|
|
|
|
|
len = EC_POINT_point2oct(group, p, theform, (unsigned char*)buf, len, ctx); |
294
|
3
|
|
|
|
|
|
RETVAL = newSVpv(buf, len); |
295
|
3
|
|
|
|
|
|
Safefree(buf); |
296
|
|
|
|
|
|
|
OUTPUT: |
297
|
|
|
|
|
|
|
RETVAL |
298
|
|
|
|
|
|
|
|
299
|
|
|
|
|
|
|
int |
300
|
|
|
|
|
|
|
EC_POINT_oct2point(const EC_GROUP *group, EC_POINT *p, const unsigned char *buf, BN_CTX *ctx) |
301
|
|
|
|
|
|
|
PREINIT: |
302
|
|
|
|
|
|
|
STRLEN len; |
303
|
|
|
|
|
|
|
CODE: |
304
|
4
|
50
|
|
|
|
|
SvPV(ST(2), len); |
305
|
4
|
|
|
|
|
|
RETVAL = EC_POINT_oct2point(group, p, buf, len, ctx); |
306
|
|
|
|
|
|
|
OUTPUT: |
307
|
|
|
|
|
|
|
RETVAL |
308
|
|
|
|
|
|
|
|
309
|
|
|
|
|
|
|
|
310
|
|
|
|
|
|
|
BIGNUM * |
311
|
|
|
|
|
|
|
EC_POINT_point2bn(const EC_GROUP *group, const EC_POINT *point, point_conversion_form_t theform, BIGNUM *bn, BN_CTX *ctx) |
312
|
|
|
|
|
|
|
|
313
|
|
|
|
|
|
|
EC_POINT * |
314
|
|
|
|
|
|
|
EC_POINT_bn2point(const EC_GROUP *group, const BIGNUM *bn, EC_POINT *point, BN_CTX *ctx) |
315
|
|
|
|
|
|
|
|
316
|
|
|
|
|
|
|
char * |
317
|
|
|
|
|
|
|
EC_POINT_point2hex(const EC_GROUP *group, const EC_POINT *point, point_conversion_form_t theform, BN_CTX *ctx) |
318
|
|
|
|
|
|
|
PREINIT: |
319
|
|
|
|
|
|
|
char* hex; |
320
|
|
|
|
|
|
|
CODE: |
321
|
0
|
|
|
|
|
|
hex = EC_POINT_point2hex(group, point, theform, ctx); |
322
|
0
|
|
|
|
|
|
sv_setpv(TARG, hex); |
323
|
0
|
|
|
|
|
|
Safefree(hex); |
324
|
0
|
|
|
|
|
|
ST(0) = TARG; |
325
|
|
|
|
|
|
|
|
326
|
|
|
|
|
|
|
|
327
|
|
|
|
|
|
|
EC_POINT * |
328
|
|
|
|
|
|
|
EC_POINT_hex2point(const EC_GROUP *group, const char *buf, EC_POINT *point, BN_CTX *ctx) |
329
|
|
|
|
|
|
|
|
330
|
|
|
|
|
|
|
int |
331
|
|
|
|
|
|
|
EC_POINT_add(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a, const EC_POINT *b, BN_CTX *ctx) |
332
|
|
|
|
|
|
|
|
333
|
|
|
|
|
|
|
int |
334
|
|
|
|
|
|
|
EC_POINT_dbl(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a, BN_CTX *ctx) |
335
|
|
|
|
|
|
|
|
336
|
|
|
|
|
|
|
int |
337
|
|
|
|
|
|
|
EC_POINT_invert(const EC_GROUP *group, EC_POINT *a, BN_CTX *ctx) |
338
|
|
|
|
|
|
|
|
339
|
|
|
|
|
|
|
int |
340
|
|
|
|
|
|
|
EC_POINT_is_at_infinity(const EC_GROUP *group, const EC_POINT *p) |
341
|
|
|
|
|
|
|
|
342
|
|
|
|
|
|
|
int |
343
|
|
|
|
|
|
|
EC_POINT_is_on_curve(const EC_GROUP *group, const EC_POINT *point, BN_CTX *ctx) |
344
|
|
|
|
|
|
|
|
345
|
|
|
|
|
|
|
int |
346
|
|
|
|
|
|
|
EC_POINT_cmp(const EC_GROUP *group, const EC_POINT *a, const EC_POINT *b, BN_CTX *ctx) |
347
|
|
|
|
|
|
|
|
348
|
|
|
|
|
|
|
int |
349
|
|
|
|
|
|
|
EC_POINT_make_affine(const EC_GROUP *group, EC_POINT *point, BN_CTX *ctx) |
350
|
|
|
|
|
|
|
|
351
|
|
|
|
|
|
|
#if 0 |
352
|
|
|
|
|
|
|
|
353
|
|
|
|
|
|
|
int |
354
|
|
|
|
|
|
|
EC_POINTs_make_affine(const EC_GROUP *group, size_t num, EC_POINT *p[], BN_CTX *ctx) |
355
|
|
|
|
|
|
|
|
356
|
|
|
|
|
|
|
int |
357
|
|
|
|
|
|
|
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) |
358
|
|
|
|
|
|
|
|
359
|
|
|
|
|
|
|
#endif |
360
|
|
|
|
|
|
|
|
361
|
|
|
|
|
|
|
int |
362
|
|
|
|
|
|
|
EC_POINT_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *n, const EC_POINT *q, const BIGNUM *m, BN_CTX *ctx) |
363
|
|
|
|
|
|
|
|
364
|
|
|
|
|
|
|
|
365
|
|
|
|
|
|
|
#ifndef OPENSSL_NO_BIO |
366
|
|
|
|
|
|
|
|
367
|
|
|
|
|
|
|
int |
368
|
|
|
|
|
|
|
ECPKParameters_print(BIO *bp, const EC_GROUP *x, int off) |
369
|
|
|
|
|
|
|
|
370
|
|
|
|
|
|
|
#endif |
371
|
|
|
|
|
|
|
#ifndef OPENSSL_NO_FP_API |
372
|
|
|
|
|
|
|
|
373
|
|
|
|
|
|
|
int |
374
|
|
|
|
|
|
|
ECPKParameters_print_fp(FILE *fp, const EC_GROUP *x, int off) |
375
|
|
|
|
|
|
|
|
376
|
|
|
|
|
|
|
#endif |
377
|
|
|
|
|
|
|
|
378
|
|
|
|
|
|
|
MODULE = Crypt::OpenSSL::EC PACKAGE = Crypt::OpenSSL::EC::EC_KEY PREFIX=EC_KEY_ |
379
|
|
|
|
|
|
|
|
380
|
|
|
|
|
|
|
# EC_KEY functions |
381
|
|
|
|
|
|
|
|
382
|
|
|
|
|
|
|
EC_KEY * |
383
|
|
|
|
|
|
|
EC_KEY_new() |
384
|
|
|
|
|
|
|
CODE: |
385
|
3
|
|
|
|
|
|
RETVAL = EC_KEY_new(); |
386
|
|
|
|
|
|
|
OUTPUT: |
387
|
|
|
|
|
|
|
RETVAL |
388
|
|
|
|
|
|
|
|
389
|
|
|
|
|
|
|
EC_KEY * |
390
|
|
|
|
|
|
|
EC_KEY_new_by_curve_name(int nid) |
391
|
|
|
|
|
|
|
CODE: |
392
|
0
|
|
|
|
|
|
RETVAL = EC_KEY_new_by_curve_name(nid); |
393
|
|
|
|
|
|
|
OUTPUT: |
394
|
|
|
|
|
|
|
RETVAL |
395
|
|
|
|
|
|
|
|
396
|
|
|
|
|
|
|
void |
397
|
|
|
|
|
|
|
EC_KEY_DESTROY(EC_KEY * key) |
398
|
|
|
|
|
|
|
CODE: |
399
|
3
|
|
|
|
|
|
EC_KEY_free(key); |
400
|
|
|
|
|
|
|
|
401
|
|
|
|
|
|
|
void |
402
|
|
|
|
|
|
|
EC_KEY_free(EC_KEY *key) |
403
|
|
|
|
|
|
|
|
404
|
|
|
|
|
|
|
EC_KEY * |
405
|
|
|
|
|
|
|
EC_KEY_copy(EC_KEY *dst, const EC_KEY *src) |
406
|
|
|
|
|
|
|
|
407
|
|
|
|
|
|
|
EC_KEY * |
408
|
|
|
|
|
|
|
EC_KEY_dup(const EC_KEY *src) |
409
|
|
|
|
|
|
|
|
410
|
|
|
|
|
|
|
int |
411
|
|
|
|
|
|
|
EC_KEY_up_ref(EC_KEY *key) |
412
|
|
|
|
|
|
|
|
413
|
|
|
|
|
|
|
const EC_GROUP * |
414
|
|
|
|
|
|
|
EC_KEY_get0_group(const EC_KEY *key) |
415
|
|
|
|
|
|
|
|
416
|
|
|
|
|
|
|
int |
417
|
|
|
|
|
|
|
EC_KEY_set_group(EC_KEY *key, const EC_GROUP *group) |
418
|
|
|
|
|
|
|
|
419
|
|
|
|
|
|
|
const BIGNUM * |
420
|
|
|
|
|
|
|
EC_KEY_get0_private_key(const EC_KEY *key) |
421
|
|
|
|
|
|
|
CODE: |
422
|
2
|
|
|
|
|
|
RETVAL = BN_dup(EC_KEY_get0_private_key(key)); |
423
|
|
|
|
|
|
|
OUTPUT: |
424
|
|
|
|
|
|
|
RETVAL |
425
|
|
|
|
|
|
|
|
426
|
|
|
|
|
|
|
int |
427
|
|
|
|
|
|
|
EC_KEY_set_private_key(EC_KEY *key, const BIGNUM *prv) |
428
|
|
|
|
|
|
|
|
429
|
|
|
|
|
|
|
const EC_POINT * |
430
|
|
|
|
|
|
|
EC_KEY_get0_public_key(const EC_KEY *key) |
431
|
|
|
|
|
|
|
CODE: |
432
|
2
|
|
|
|
|
|
RETVAL = EC_POINT_dup(EC_KEY_get0_public_key(key), EC_KEY_get0_group(key)); |
433
|
|
|
|
|
|
|
OUTPUT: |
434
|
|
|
|
|
|
|
RETVAL |
435
|
|
|
|
|
|
|
|
436
|
|
|
|
|
|
|
int |
437
|
|
|
|
|
|
|
EC_KEY_set_public_key(EC_KEY *key, const EC_POINT *pub) |
438
|
|
|
|
|
|
|
|
439
|
|
|
|
|
|
|
unsigned |
440
|
|
|
|
|
|
|
EC_KEY_get_enc_flags(const EC_KEY *key) |
441
|
|
|
|
|
|
|
|
442
|
|
|
|
|
|
|
void |
443
|
|
|
|
|
|
|
EC_KEY_set_enc_flags(EC_KEY *key, unsigned int flags) |
444
|
|
|
|
|
|
|
|
445
|
|
|
|
|
|
|
point_conversion_form_t |
446
|
|
|
|
|
|
|
EC_KEY_get_conv_form(const EC_KEY *key) |
447
|
|
|
|
|
|
|
|
448
|
|
|
|
|
|
|
void |
449
|
|
|
|
|
|
|
EC_KEY_set_conv_form(EC_KEY *key, point_conversion_form_t theform) |
450
|
|
|
|
|
|
|
|
451
|
|
|
|
|
|
|
#void * |
452
|
|
|
|
|
|
|
#EC_KEY_get_key_method_data(EC_KEY *key, void *(*dup_func)(void *), void (*free_func)(void *), void (*clear_free_func)(void *)) |
453
|
|
|
|
|
|
|
|
454
|
|
|
|
|
|
|
#void |
455
|
|
|
|
|
|
|
#EC_KEY_insert_key_method_data(EC_KEY *key, void *data, void *(*dup_func)(void *), void (*free_func)(void *), void (*clear_free_func)(void *)) |
456
|
|
|
|
|
|
|
|
457
|
|
|
|
|
|
|
void |
458
|
|
|
|
|
|
|
EC_KEY_set_asn1_flag(EC_KEY *key, int flag) |
459
|
|
|
|
|
|
|
|
460
|
|
|
|
|
|
|
int |
461
|
|
|
|
|
|
|
EC_KEY_precompute_mult(EC_KEY *key, BN_CTX *ctx) |
462
|
|
|
|
|
|
|
|
463
|
|
|
|
|
|
|
int |
464
|
|
|
|
|
|
|
EC_KEY_generate_key(EC_KEY *key) |
465
|
|
|
|
|
|
|
|
466
|
|
|
|
|
|
|
int |
467
|
|
|
|
|
|
|
EC_KEY_check_key(const EC_KEY *key) |
468
|
|
|
|
|
|
|
|
469
|
|
|
|
|
|
|
# de- and encoding functions for SEC1 ECPrivateKey */ |
470
|
|
|
|
|
|
|
|
471
|
|
|
|
|
|
|
#EC_KEY * |
472
|
|
|
|
|
|
|
#d2i_ECPrivateKey(EC_KEY **key, const unsigned char **in, long len) |
473
|
|
|
|
|
|
|
|
474
|
|
|
|
|
|
|
#int |
475
|
|
|
|
|
|
|
#i2d_ECPrivateKey(EC_KEY *key, unsigned char **out) |
476
|
|
|
|
|
|
|
|
477
|
|
|
|
|
|
|
|
478
|
|
|
|
|
|
|
# de- and encoding functions for EC parameters */ |
479
|
|
|
|
|
|
|
#EC_KEY * |
480
|
|
|
|
|
|
|
#d2i_ECParameters(EC_KEY **key, const unsigned char **in, long len) |
481
|
|
|
|
|
|
|
|
482
|
|
|
|
|
|
|
#int |
483
|
|
|
|
|
|
|
#i2d_ECParameters(EC_KEY *key, unsigned char **out) |
484
|
|
|
|
|
|
|
|
485
|
|
|
|
|
|
|
# de- and encoding functions for EC public key */ |
486
|
|
|
|
|
|
|
|
487
|
|
|
|
|
|
|
#EC_KEY * |
488
|
|
|
|
|
|
|
#o2i_ECPublicKey(EC_KEY **key, const unsigned char **in, long len) |
489
|
|
|
|
|
|
|
|
490
|
|
|
|
|
|
|
#int |
491
|
|
|
|
|
|
|
#i2o_ECPublicKey(EC_KEY *key, unsigned char **out) |
492
|
|
|
|
|
|
|
|