Coverage Report

Created: 2025-12-10 06:24

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/openssl/crypto/ec/ec_local.h
Line
Count
Source
1
/*
2
 * Copyright 2001-2024 The OpenSSL Project Authors. All Rights Reserved.
3
 * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved
4
 *
5
 * Licensed under the Apache License 2.0 (the "License").  You may not use
6
 * this file except in compliance with the License.  You can obtain a copy
7
 * in the file LICENSE in the source distribution or at
8
 * https://www.openssl.org/source/license.html
9
 */
10
11
#include <stdlib.h>
12
13
#include <openssl/obj_mac.h>
14
#include <openssl/ec.h>
15
#include <openssl/bn.h>
16
#include "internal/refcount.h"
17
#include "crypto/ec.h"
18
19
#if defined(__SUNPRO_C)
20
#if __SUNPRO_C >= 0x520
21
#pragma error_messages(off, E_ARRAY_OF_INCOMPLETE_NONAME, E_ARRAY_OF_INCOMPLETE)
22
#endif
23
#endif
24
25
/* Use default functions for poin2oct, oct2point and compressed coordinates */
26
0
#define EC_FLAGS_DEFAULT_OCT 0x1
27
28
/* Use custom formats for EC_GROUP, EC_POINT and EC_KEY */
29
0
#define EC_FLAGS_CUSTOM_CURVE 0x2
30
31
/* Curve does not support signing operations */
32
0
#define EC_FLAGS_NO_SIGN 0x4
33
34
#ifdef OPENSSL_NO_DEPRECATED_3_0
35
typedef struct ec_method_st EC_METHOD;
36
#endif
37
38
/*
39
 * Structure details are not part of the exported interface, so all this may
40
 * change in future versions.
41
 */
42
43
struct ec_method_st {
44
    /* Various method flags */
45
    int flags;
46
    /* used by EC_METHOD_get_field_type: */
47
    int field_type; /* a NID */
48
    /*
49
     * used by EC_GROUP_new, EC_GROUP_free, EC_GROUP_clear_free,
50
     * EC_GROUP_copy:
51
     */
52
    int (*group_init)(EC_GROUP *);
53
    void (*group_finish)(EC_GROUP *);
54
    void (*group_clear_finish)(EC_GROUP *);
55
    int (*group_copy)(EC_GROUP *, const EC_GROUP *);
56
    /* used by EC_GROUP_set_curve, EC_GROUP_get_curve: */
57
    int (*group_set_curve)(EC_GROUP *, const BIGNUM *p, const BIGNUM *a,
58
        const BIGNUM *b, BN_CTX *);
59
    int (*group_get_curve)(const EC_GROUP *, BIGNUM *p, BIGNUM *a, BIGNUM *b,
60
        BN_CTX *);
61
    /* used by EC_GROUP_get_degree: */
62
    int (*group_get_degree)(const EC_GROUP *);
63
    int (*group_order_bits)(const EC_GROUP *);
64
    /* used by EC_GROUP_check: */
65
    int (*group_check_discriminant)(const EC_GROUP *, BN_CTX *);
66
    /*
67
     * used by EC_POINT_new, EC_POINT_free, EC_POINT_clear_free,
68
     * EC_POINT_copy:
69
     */
70
    int (*point_init)(EC_POINT *);
71
    void (*point_finish)(EC_POINT *);
72
    void (*point_clear_finish)(EC_POINT *);
73
    int (*point_copy)(EC_POINT *, const EC_POINT *);
74
    /*-
75
     * used by EC_POINT_set_to_infinity,
76
     * EC_POINT_set_Jprojective_coordinates_GFp,
77
     * EC_POINT_get_Jprojective_coordinates_GFp,
78
     * EC_POINT_set_affine_coordinates,
79
     * EC_POINT_get_affine_coordinates,
80
     * EC_POINT_set_compressed_coordinates:
81
     */
82
    int (*point_set_to_infinity)(const EC_GROUP *, EC_POINT *);
83
    int (*point_set_affine_coordinates)(const EC_GROUP *, EC_POINT *,
84
        const BIGNUM *x, const BIGNUM *y,
85
        BN_CTX *);
86
    int (*point_get_affine_coordinates)(const EC_GROUP *, const EC_POINT *,
87
        BIGNUM *x, BIGNUM *y, BN_CTX *);
88
    int (*point_set_compressed_coordinates)(const EC_GROUP *, EC_POINT *,
89
        const BIGNUM *x, int y_bit,
90
        BN_CTX *);
91
    /* used by EC_POINT_point2oct, EC_POINT_oct2point: */
92
    size_t (*point2oct)(const EC_GROUP *, const EC_POINT *,
93
        point_conversion_form_t form, unsigned char *buf,
94
        size_t len, BN_CTX *);
95
    int (*oct2point)(const EC_GROUP *, EC_POINT *, const unsigned char *buf,
96
        size_t len, BN_CTX *);
97
    /* used by EC_POINT_add, EC_POINT_dbl, ECP_POINT_invert: */
98
    int (*add)(const EC_GROUP *, EC_POINT *r, const EC_POINT *a,
99
        const EC_POINT *b, BN_CTX *);
100
    int (*dbl)(const EC_GROUP *, EC_POINT *r, const EC_POINT *a, BN_CTX *);
101
    int (*invert)(const EC_GROUP *, EC_POINT *, BN_CTX *);
102
    /*
103
     * used by EC_POINT_is_at_infinity, EC_POINT_is_on_curve, EC_POINT_cmp:
104
     */
105
    int (*is_at_infinity)(const EC_GROUP *, const EC_POINT *);
106
    int (*is_on_curve)(const EC_GROUP *, const EC_POINT *, BN_CTX *);
107
    int (*point_cmp)(const EC_GROUP *, const EC_POINT *a, const EC_POINT *b,
108
        BN_CTX *);
109
    /* used by EC_POINT_make_affine, EC_POINTs_make_affine: */
110
    int (*make_affine)(const EC_GROUP *, EC_POINT *, BN_CTX *);
111
    int (*points_make_affine)(const EC_GROUP *, size_t num, EC_POINT *[],
112
        BN_CTX *);
113
    /*
114
     * used by EC_POINTs_mul, EC_POINT_mul, EC_POINT_precompute_mult,
115
     * EC_POINT_have_precompute_mult (default implementations are used if the
116
     * 'mul' pointer is 0):
117
     */
118
    /*-
119
     * mul() calculates the value
120
     *
121
     *   r := generator * scalar
122
     *        + points[0] * scalars[0]
123
     *        + ...
124
     *        + points[num-1] * scalars[num-1].
125
     *
126
     * For a fixed point multiplication (scalar != NULL, num == 0)
127
     * or a variable point multiplication (scalar == NULL, num == 1),
128
     * mul() must use a constant time algorithm: in both cases callers
129
     * should provide an input scalar (either scalar or scalars[0])
130
     * in the range [0, ec_group_order); for robustness, implementers
131
     * should handle the case when the scalar has not been reduced, but
132
     * may treat it as an unusual input, without any constant-timeness
133
     * guarantee.
134
     */
135
    int (*mul)(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar,
136
        size_t num, const EC_POINT *points[], const BIGNUM *scalars[],
137
        BN_CTX *);
138
    int (*precompute_mult)(EC_GROUP *group, BN_CTX *);
139
    int (*have_precompute_mult)(const EC_GROUP *group);
140
    /* internal functions */
141
    /*
142
     * 'field_mul', 'field_sqr', and 'field_div' can be used by 'add' and
143
     * 'dbl' so that the same implementations of point operations can be used
144
     * with different optimized implementations of expensive field
145
     * operations:
146
     */
147
    int (*field_mul)(const EC_GROUP *, BIGNUM *r, const BIGNUM *a,
148
        const BIGNUM *b, BN_CTX *);
149
    int (*field_sqr)(const EC_GROUP *, BIGNUM *r, const BIGNUM *a, BN_CTX *);
150
    int (*field_div)(const EC_GROUP *, BIGNUM *r, const BIGNUM *a,
151
        const BIGNUM *b, BN_CTX *);
152
    /*-
153
     * 'field_inv' computes the multiplicative inverse of a in the field,
154
     * storing the result in r.
155
     *
156
     * If 'a' is zero (or equivalent), you'll get an EC_R_CANNOT_INVERT error.
157
     */
158
    int (*field_inv)(const EC_GROUP *, BIGNUM *r, const BIGNUM *a, BN_CTX *);
159
    /* e.g. to Montgomery */
160
    int (*field_encode)(const EC_GROUP *, BIGNUM *r, const BIGNUM *a,
161
        BN_CTX *);
162
    /* e.g. from Montgomery */
163
    int (*field_decode)(const EC_GROUP *, BIGNUM *r, const BIGNUM *a,
164
        BN_CTX *);
165
    int (*field_set_to_one)(const EC_GROUP *, BIGNUM *r, BN_CTX *);
166
    /* private key operations */
167
    size_t (*priv2oct)(const EC_KEY *eckey, unsigned char *buf, size_t len);
168
    int (*oct2priv)(EC_KEY *eckey, const unsigned char *buf, size_t len);
169
    int (*set_private)(EC_KEY *eckey, const BIGNUM *priv_key);
170
    int (*keygen)(EC_KEY *eckey);
171
    int (*keycheck)(const EC_KEY *eckey);
172
    int (*keygenpub)(EC_KEY *eckey);
173
    int (*keycopy)(EC_KEY *dst, const EC_KEY *src);
174
    void (*keyfinish)(EC_KEY *eckey);
175
    /* custom ECDH operation */
176
    int (*ecdh_compute_key)(unsigned char **pout, size_t *poutlen,
177
        const EC_POINT *pub_key, const EC_KEY *ecdh);
178
    /* custom ECDSA */
179
    int (*ecdsa_sign_setup)(EC_KEY *eckey, BN_CTX *ctx, BIGNUM **kinvp,
180
        BIGNUM **rp);
181
    ECDSA_SIG *(*ecdsa_sign_sig)(const unsigned char *dgst, int dgstlen,
182
        const BIGNUM *kinv, const BIGNUM *r,
183
        EC_KEY *eckey);
184
    int (*ecdsa_verify_sig)(const unsigned char *dgst, int dgstlen,
185
        const ECDSA_SIG *sig, EC_KEY *eckey);
186
    /* Inverse modulo order */
187
    int (*field_inverse_mod_ord)(const EC_GROUP *, BIGNUM *r,
188
        const BIGNUM *x, BN_CTX *);
189
    int (*blind_coordinates)(const EC_GROUP *group, EC_POINT *p, BN_CTX *ctx);
190
    int (*ladder_pre)(const EC_GROUP *group,
191
        EC_POINT *r, EC_POINT *s,
192
        EC_POINT *p, BN_CTX *ctx);
193
    int (*ladder_step)(const EC_GROUP *group,
194
        EC_POINT *r, EC_POINT *s,
195
        EC_POINT *p, BN_CTX *ctx);
196
    int (*ladder_post)(const EC_GROUP *group,
197
        EC_POINT *r, EC_POINT *s,
198
        EC_POINT *p, BN_CTX *ctx);
199
    int (*group_full_init)(EC_GROUP *group, const unsigned char *data);
200
};
201
202
/*
203
 * Types and functions to manipulate pre-computed values.
204
 */
205
typedef struct nistp224_pre_comp_st NISTP224_PRE_COMP;
206
typedef struct nistp256_pre_comp_st NISTP256_PRE_COMP;
207
typedef struct nistp384_pre_comp_st NISTP384_PRE_COMP;
208
typedef struct nistp521_pre_comp_st NISTP521_PRE_COMP;
209
typedef struct nistz256_pre_comp_st NISTZ256_PRE_COMP;
210
typedef struct ec_pre_comp_st EC_PRE_COMP;
211
212
struct ec_group_st {
213
    const EC_METHOD *meth;
214
    EC_POINT *generator; /* optional */
215
    BIGNUM *order, *cofactor;
216
    int curve_name; /* optional NID for named curve */
217
    int asn1_flag; /* flag to control the asn1 encoding */
218
    int decoded_from_explicit_params; /* set if decoded from explicit
219
                                       * curve parameters encoding */
220
    point_conversion_form_t asn1_form;
221
    unsigned char *seed; /* optional seed for parameters (appears in
222
                          * ASN1) */
223
    size_t seed_len;
224
    /*
225
     * The following members are handled by the method functions, even if
226
     * they appear generic
227
     */
228
    /*
229
     * Field specification. For curves over GF(p), this is the modulus; for
230
     * curves over GF(2^m), this is the irreducible polynomial defining the
231
     * field.
232
     */
233
    BIGNUM *field;
234
    /*
235
     * Field specification for curves over GF(2^m). The irreducible f(t) is
236
     * then of the form: t^poly[0] + t^poly[1] + ... + t^poly[k] where m =
237
     * poly[0] > poly[1] > ... > poly[k] = 0. The array is terminated with
238
     * poly[k+1]=-1. All elliptic curve irreducibles have at most 5 non-zero
239
     * terms.
240
     */
241
    int poly[6];
242
    /*
243
     * Curve coefficients. (Here the assumption is that BIGNUMs can be used
244
     * or abused for all kinds of fields, not just GF(p).) For characteristic
245
     * > 3, the curve is defined by a Weierstrass equation of the form y^2 =
246
     * x^3 + a*x + b. For characteristic 2, the curve is defined by an
247
     * equation of the form y^2 + x*y = x^3 + a*x^2 + b.
248
     */
249
    BIGNUM *a, *b;
250
    /* enable optimized point arithmetic for special case */
251
    int a_is_minus3;
252
    /* method-specific (e.g., Montgomery structure) */
253
    void *field_data1;
254
    /* method-specific */
255
    void *field_data2;
256
    /* method-specific */
257
    int (*field_mod_func)(BIGNUM *, const BIGNUM *, const BIGNUM *,
258
        BN_CTX *);
259
    /* data for ECDSA inverse */
260
    BN_MONT_CTX *mont_data;
261
262
    /*
263
     * Precomputed values for speed. The PCT_xxx names match the
264
     * pre_comp.xxx union names; see the SETPRECOMP and HAVEPRECOMP
265
     * macros, below.
266
     */
267
    enum {
268
        PCT_none,
269
        PCT_nistp224,
270
        PCT_nistp256,
271
        PCT_nistp384,
272
        PCT_nistp521,
273
        PCT_nistz256,
274
        PCT_ec
275
    } pre_comp_type;
276
    union {
277
        NISTP224_PRE_COMP *nistp224;
278
        NISTP256_PRE_COMP *nistp256;
279
        NISTP384_PRE_COMP *nistp384;
280
        NISTP521_PRE_COMP *nistp521;
281
        NISTZ256_PRE_COMP *nistz256;
282
        EC_PRE_COMP *ec;
283
    } pre_comp;
284
285
    OSSL_LIB_CTX *libctx;
286
    char *propq;
287
};
288
289
#define SETPRECOMP(g, type, pre) \
290
0
    g->pre_comp_type = PCT_##type, g->pre_comp.type = pre
291
#define HAVEPRECOMP(g, type) \
292
0
    g->pre_comp_type == PCT_##type && g->pre_comp.type != NULL
293
294
struct ec_key_st {
295
    const EC_KEY_METHOD *meth;
296
    int version;
297
    EC_GROUP *group;
298
    EC_POINT *pub_key;
299
    BIGNUM *priv_key;
300
    unsigned int enc_flag;
301
    point_conversion_form_t conv_form;
302
    CRYPTO_REF_COUNT references;
303
    int flags;
304
#ifndef FIPS_MODULE
305
    CRYPTO_EX_DATA ex_data;
306
#endif
307
    OSSL_LIB_CTX *libctx;
308
    char *propq;
309
310
    /* Provider data */
311
    size_t dirty_cnt; /* If any key material changes, increment this */
312
};
313
314
struct ec_point_st {
315
    const EC_METHOD *meth;
316
    /* NID for the curve if known */
317
    int curve_name;
318
    /*
319
     * All members except 'meth' are handled by the method functions, even if
320
     * they appear generic
321
     */
322
    BIGNUM *X;
323
    BIGNUM *Y;
324
    BIGNUM *Z; /* Jacobian projective coordinates: * (X, Y,
325
                * Z) represents (X/Z^2, Y/Z^3) if Z != 0 */
326
    int Z_is_one; /* enable optimized point arithmetic for
327
                   * special case */
328
};
329
330
static ossl_inline int ec_point_is_compat(const EC_POINT *point,
331
    const EC_GROUP *group)
332
0
{
333
0
    return group->meth == point->meth
334
0
        && (group->curve_name == 0
335
0
            || point->curve_name == 0
336
0
            || group->curve_name == point->curve_name);
337
0
}
Unexecuted instantiation: curve25519.c:ec_point_is_compat
Unexecuted instantiation: ec_ameth.c:ec_point_is_compat
Unexecuted instantiation: ec_asn1.c:ec_point_is_compat
Unexecuted instantiation: ec_backend.c:ec_point_is_compat
Unexecuted instantiation: ec_check.c:ec_point_is_compat
Unexecuted instantiation: ec_curve.c:ec_point_is_compat
Unexecuted instantiation: ec_cvt.c:ec_point_is_compat
Unexecuted instantiation: ec_key.c:ec_point_is_compat
Unexecuted instantiation: ec_kmeth.c:ec_point_is_compat
Unexecuted instantiation: ec_lib.c:ec_point_is_compat
Unexecuted instantiation: ec_mult.c:ec_point_is_compat
Unexecuted instantiation: ec_oct.c:ec_point_is_compat
Unexecuted instantiation: ec_pmeth.c:ec_point_is_compat
Unexecuted instantiation: ecdh_kdf.c:ec_point_is_compat
Unexecuted instantiation: ecdh_ossl.c:ec_point_is_compat
Unexecuted instantiation: ecdsa_ossl.c:ec_point_is_compat
Unexecuted instantiation: ecdsa_sign.c:ec_point_is_compat
Unexecuted instantiation: ecdsa_vrf.c:ec_point_is_compat
Unexecuted instantiation: ecp_mont.c:ec_point_is_compat
Unexecuted instantiation: ecp_nist.c:ec_point_is_compat
Unexecuted instantiation: ecp_oct.c:ec_point_is_compat
Unexecuted instantiation: ecp_smpl.c:ec_point_is_compat
Unexecuted instantiation: ecx_meth.c:ec_point_is_compat
Unexecuted instantiation: ec2_oct.c:ec_point_is_compat
Unexecuted instantiation: ec2_smpl.c:ec_point_is_compat
338
339
NISTP224_PRE_COMP *EC_nistp224_pre_comp_dup(NISTP224_PRE_COMP *);
340
NISTP256_PRE_COMP *EC_nistp256_pre_comp_dup(NISTP256_PRE_COMP *);
341
NISTP384_PRE_COMP *ossl_ec_nistp384_pre_comp_dup(NISTP384_PRE_COMP *);
342
NISTP521_PRE_COMP *EC_nistp521_pre_comp_dup(NISTP521_PRE_COMP *);
343
NISTZ256_PRE_COMP *EC_nistz256_pre_comp_dup(NISTZ256_PRE_COMP *);
344
NISTP256_PRE_COMP *EC_nistp256_pre_comp_dup(NISTP256_PRE_COMP *);
345
EC_PRE_COMP *EC_ec_pre_comp_dup(EC_PRE_COMP *);
346
347
void EC_pre_comp_free(EC_GROUP *group);
348
void EC_nistp224_pre_comp_free(NISTP224_PRE_COMP *);
349
void EC_nistp256_pre_comp_free(NISTP256_PRE_COMP *);
350
void ossl_ec_nistp384_pre_comp_free(NISTP384_PRE_COMP *);
351
void EC_nistp521_pre_comp_free(NISTP521_PRE_COMP *);
352
void EC_nistz256_pre_comp_free(NISTZ256_PRE_COMP *);
353
void EC_ec_pre_comp_free(EC_PRE_COMP *);
354
355
/*
356
 * method functions in ec_mult.c (ec_lib.c uses these as defaults if
357
 * group->method->mul is 0)
358
 */
359
int ossl_ec_wNAF_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar,
360
    size_t num, const EC_POINT *points[],
361
    const BIGNUM *scalars[], BN_CTX *);
362
int ossl_ec_wNAF_precompute_mult(EC_GROUP *group, BN_CTX *);
363
int ossl_ec_wNAF_have_precompute_mult(const EC_GROUP *group);
364
365
/* method functions in ecp_smpl.c */
366
int ossl_ec_GFp_simple_group_init(EC_GROUP *);
367
void ossl_ec_GFp_simple_group_finish(EC_GROUP *);
368
void ossl_ec_GFp_simple_group_clear_finish(EC_GROUP *);
369
int ossl_ec_GFp_simple_group_copy(EC_GROUP *, const EC_GROUP *);
370
int ossl_ec_GFp_simple_group_set_curve(EC_GROUP *, const BIGNUM *p,
371
    const BIGNUM *a, const BIGNUM *b,
372
    BN_CTX *);
373
int ossl_ec_GFp_simple_group_get_curve(const EC_GROUP *, BIGNUM *p, BIGNUM *a,
374
    BIGNUM *b, BN_CTX *);
375
int ossl_ec_GFp_simple_group_get_degree(const EC_GROUP *);
376
int ossl_ec_GFp_simple_group_check_discriminant(const EC_GROUP *, BN_CTX *);
377
int ossl_ec_GFp_simple_point_init(EC_POINT *);
378
void ossl_ec_GFp_simple_point_finish(EC_POINT *);
379
void ossl_ec_GFp_simple_point_clear_finish(EC_POINT *);
380
int ossl_ec_GFp_simple_point_copy(EC_POINT *, const EC_POINT *);
381
int ossl_ec_GFp_simple_point_set_to_infinity(const EC_GROUP *, EC_POINT *);
382
int ossl_ec_GFp_simple_set_Jprojective_coordinates_GFp(const EC_GROUP *,
383
    EC_POINT *,
384
    const BIGNUM *x,
385
    const BIGNUM *y,
386
    const BIGNUM *z,
387
    BN_CTX *);
388
int ossl_ec_GFp_simple_get_Jprojective_coordinates_GFp(const EC_GROUP *,
389
    const EC_POINT *,
390
    BIGNUM *x,
391
    BIGNUM *y, BIGNUM *z,
392
    BN_CTX *);
393
int ossl_ec_GFp_simple_point_set_affine_coordinates(const EC_GROUP *, EC_POINT *,
394
    const BIGNUM *x,
395
    const BIGNUM *y, BN_CTX *);
396
int ossl_ec_GFp_simple_point_get_affine_coordinates(const EC_GROUP *,
397
    const EC_POINT *, BIGNUM *x,
398
    BIGNUM *y, BN_CTX *);
399
int ossl_ec_GFp_simple_set_compressed_coordinates(const EC_GROUP *, EC_POINT *,
400
    const BIGNUM *x, int y_bit,
401
    BN_CTX *);
402
size_t ossl_ec_GFp_simple_point2oct(const EC_GROUP *, const EC_POINT *,
403
    point_conversion_form_t form,
404
    unsigned char *buf, size_t len, BN_CTX *);
405
int ossl_ec_GFp_simple_oct2point(const EC_GROUP *, EC_POINT *,
406
    const unsigned char *buf, size_t len, BN_CTX *);
407
int ossl_ec_GFp_simple_add(const EC_GROUP *, EC_POINT *r, const EC_POINT *a,
408
    const EC_POINT *b, BN_CTX *);
409
int ossl_ec_GFp_simple_dbl(const EC_GROUP *, EC_POINT *r, const EC_POINT *a,
410
    BN_CTX *);
411
int ossl_ec_GFp_simple_invert(const EC_GROUP *, EC_POINT *, BN_CTX *);
412
int ossl_ec_GFp_simple_is_at_infinity(const EC_GROUP *, const EC_POINT *);
413
int ossl_ec_GFp_simple_is_on_curve(const EC_GROUP *, const EC_POINT *, BN_CTX *);
414
int ossl_ec_GFp_simple_cmp(const EC_GROUP *, const EC_POINT *a,
415
    const EC_POINT *b, BN_CTX *);
416
int ossl_ec_GFp_simple_make_affine(const EC_GROUP *, EC_POINT *, BN_CTX *);
417
int ossl_ec_GFp_simple_points_make_affine(const EC_GROUP *, size_t num,
418
    EC_POINT *[], BN_CTX *);
419
int ossl_ec_GFp_simple_field_mul(const EC_GROUP *, BIGNUM *r, const BIGNUM *a,
420
    const BIGNUM *b, BN_CTX *);
421
int ossl_ec_GFp_simple_field_sqr(const EC_GROUP *, BIGNUM *r, const BIGNUM *a,
422
    BN_CTX *);
423
int ossl_ec_GFp_simple_field_inv(const EC_GROUP *, BIGNUM *r, const BIGNUM *a,
424
    BN_CTX *);
425
int ossl_ec_GFp_simple_blind_coordinates(const EC_GROUP *group, EC_POINT *p,
426
    BN_CTX *ctx);
427
int ossl_ec_GFp_simple_ladder_pre(const EC_GROUP *group,
428
    EC_POINT *r, EC_POINT *s,
429
    EC_POINT *p, BN_CTX *ctx);
430
int ossl_ec_GFp_simple_ladder_step(const EC_GROUP *group,
431
    EC_POINT *r, EC_POINT *s,
432
    EC_POINT *p, BN_CTX *ctx);
433
int ossl_ec_GFp_simple_ladder_post(const EC_GROUP *group,
434
    EC_POINT *r, EC_POINT *s,
435
    EC_POINT *p, BN_CTX *ctx);
436
437
/* method functions in ecp_mont.c */
438
int ossl_ec_GFp_mont_group_init(EC_GROUP *);
439
int ossl_ec_GFp_mont_group_set_curve(EC_GROUP *, const BIGNUM *p,
440
    const BIGNUM *a,
441
    const BIGNUM *b, BN_CTX *);
442
void ossl_ec_GFp_mont_group_finish(EC_GROUP *);
443
void ossl_ec_GFp_mont_group_clear_finish(EC_GROUP *);
444
int ossl_ec_GFp_mont_group_copy(EC_GROUP *, const EC_GROUP *);
445
int ossl_ec_GFp_mont_field_mul(const EC_GROUP *, BIGNUM *r, const BIGNUM *a,
446
    const BIGNUM *b, BN_CTX *);
447
int ossl_ec_GFp_mont_field_sqr(const EC_GROUP *, BIGNUM *r, const BIGNUM *a,
448
    BN_CTX *);
449
int ossl_ec_GFp_mont_field_inv(const EC_GROUP *, BIGNUM *r, const BIGNUM *a,
450
    BN_CTX *);
451
int ossl_ec_GFp_mont_field_encode(const EC_GROUP *, BIGNUM *r, const BIGNUM *a,
452
    BN_CTX *);
453
int ossl_ec_GFp_mont_field_decode(const EC_GROUP *, BIGNUM *r, const BIGNUM *a,
454
    BN_CTX *);
455
int ossl_ec_GFp_mont_field_set_to_one(const EC_GROUP *, BIGNUM *r, BN_CTX *);
456
457
/* method functions in ecp_nist.c */
458
int ossl_ec_GFp_nist_group_copy(EC_GROUP *dest, const EC_GROUP *src);
459
int ossl_ec_GFp_nist_group_set_curve(EC_GROUP *, const BIGNUM *p,
460
    const BIGNUM *a, const BIGNUM *b, BN_CTX *);
461
int ossl_ec_GFp_nist_field_mul(const EC_GROUP *, BIGNUM *r, const BIGNUM *a,
462
    const BIGNUM *b, BN_CTX *);
463
int ossl_ec_GFp_nist_field_sqr(const EC_GROUP *, BIGNUM *r, const BIGNUM *a,
464
    BN_CTX *);
465
466
/* method functions in ec2_smpl.c */
467
int ossl_ec_GF2m_simple_group_init(EC_GROUP *);
468
void ossl_ec_GF2m_simple_group_finish(EC_GROUP *);
469
void ossl_ec_GF2m_simple_group_clear_finish(EC_GROUP *);
470
int ossl_ec_GF2m_simple_group_copy(EC_GROUP *, const EC_GROUP *);
471
int ossl_ec_GF2m_simple_group_set_curve(EC_GROUP *, const BIGNUM *p,
472
    const BIGNUM *a, const BIGNUM *b,
473
    BN_CTX *);
474
int ossl_ec_GF2m_simple_group_get_curve(const EC_GROUP *, BIGNUM *p, BIGNUM *a,
475
    BIGNUM *b, BN_CTX *);
476
int ossl_ec_GF2m_simple_group_get_degree(const EC_GROUP *);
477
int ossl_ec_GF2m_simple_group_check_discriminant(const EC_GROUP *, BN_CTX *);
478
int ossl_ec_GF2m_simple_point_init(EC_POINT *);
479
void ossl_ec_GF2m_simple_point_finish(EC_POINT *);
480
void ossl_ec_GF2m_simple_point_clear_finish(EC_POINT *);
481
int ossl_ec_GF2m_simple_point_copy(EC_POINT *, const EC_POINT *);
482
int ossl_ec_GF2m_simple_point_set_to_infinity(const EC_GROUP *, EC_POINT *);
483
int ossl_ec_GF2m_simple_point_set_affine_coordinates(const EC_GROUP *,
484
    EC_POINT *,
485
    const BIGNUM *x,
486
    const BIGNUM *y, BN_CTX *);
487
int ossl_ec_GF2m_simple_point_get_affine_coordinates(const EC_GROUP *,
488
    const EC_POINT *, BIGNUM *x,
489
    BIGNUM *y, BN_CTX *);
490
int ossl_ec_GF2m_simple_set_compressed_coordinates(const EC_GROUP *, EC_POINT *,
491
    const BIGNUM *x, int y_bit,
492
    BN_CTX *);
493
size_t ossl_ec_GF2m_simple_point2oct(const EC_GROUP *, const EC_POINT *,
494
    point_conversion_form_t form,
495
    unsigned char *buf, size_t len, BN_CTX *);
496
int ossl_ec_GF2m_simple_oct2point(const EC_GROUP *, EC_POINT *,
497
    const unsigned char *buf, size_t len, BN_CTX *);
498
int ossl_ec_GF2m_simple_add(const EC_GROUP *, EC_POINT *r, const EC_POINT *a,
499
    const EC_POINT *b, BN_CTX *);
500
int ossl_ec_GF2m_simple_dbl(const EC_GROUP *, EC_POINT *r, const EC_POINT *a,
501
    BN_CTX *);
502
int ossl_ec_GF2m_simple_invert(const EC_GROUP *, EC_POINT *, BN_CTX *);
503
int ossl_ec_GF2m_simple_is_at_infinity(const EC_GROUP *, const EC_POINT *);
504
int ossl_ec_GF2m_simple_is_on_curve(const EC_GROUP *, const EC_POINT *, BN_CTX *);
505
int ossl_ec_GF2m_simple_cmp(const EC_GROUP *, const EC_POINT *a,
506
    const EC_POINT *b, BN_CTX *);
507
int ossl_ec_GF2m_simple_make_affine(const EC_GROUP *, EC_POINT *, BN_CTX *);
508
int ossl_ec_GF2m_simple_points_make_affine(const EC_GROUP *, size_t num,
509
    EC_POINT *[], BN_CTX *);
510
int ossl_ec_GF2m_simple_field_mul(const EC_GROUP *, BIGNUM *r, const BIGNUM *a,
511
    const BIGNUM *b, BN_CTX *);
512
int ossl_ec_GF2m_simple_field_sqr(const EC_GROUP *, BIGNUM *r, const BIGNUM *a,
513
    BN_CTX *);
514
int ossl_ec_GF2m_simple_field_div(const EC_GROUP *, BIGNUM *r, const BIGNUM *a,
515
    const BIGNUM *b, BN_CTX *);
516
517
#ifndef OPENSSL_NO_EC_NISTP_64_GCC_128
518
#ifdef B_ENDIAN
519
#error "Can not enable ec_nistp_64_gcc_128 on big-endian systems"
520
#endif
521
522
/* method functions in ecp_nistp224.c */
523
int ossl_ec_GFp_nistp224_group_init(EC_GROUP *group);
524
int ossl_ec_GFp_nistp224_group_set_curve(EC_GROUP *group, const BIGNUM *p,
525
    const BIGNUM *a, const BIGNUM *n,
526
    BN_CTX *);
527
int ossl_ec_GFp_nistp224_point_get_affine_coordinates(const EC_GROUP *group,
528
    const EC_POINT *point,
529
    BIGNUM *x, BIGNUM *y,
530
    BN_CTX *ctx);
531
int ossl_ec_GFp_nistp224_mul(const EC_GROUP *group, EC_POINT *r,
532
    const BIGNUM *scalar, size_t num,
533
    const EC_POINT *points[], const BIGNUM *scalars[],
534
    BN_CTX *);
535
int ossl_ec_GFp_nistp224_points_mul(const EC_GROUP *group, EC_POINT *r,
536
    const BIGNUM *scalar, size_t num,
537
    const EC_POINT *points[],
538
    const BIGNUM *scalars[], BN_CTX *ctx);
539
int ossl_ec_GFp_nistp224_precompute_mult(EC_GROUP *group, BN_CTX *ctx);
540
int ossl_ec_GFp_nistp224_have_precompute_mult(const EC_GROUP *group);
541
542
/* method functions in ecp_nistp256.c */
543
int ossl_ec_GFp_nistp256_group_init(EC_GROUP *group);
544
int ossl_ec_GFp_nistp256_group_set_curve(EC_GROUP *group, const BIGNUM *p,
545
    const BIGNUM *a, const BIGNUM *n,
546
    BN_CTX *);
547
int ossl_ec_GFp_nistp256_point_get_affine_coordinates(const EC_GROUP *group,
548
    const EC_POINT *point,
549
    BIGNUM *x, BIGNUM *y,
550
    BN_CTX *ctx);
551
int ossl_ec_GFp_nistp256_mul(const EC_GROUP *group, EC_POINT *r,
552
    const BIGNUM *scalar, size_t num,
553
    const EC_POINT *points[], const BIGNUM *scalars[],
554
    BN_CTX *);
555
int ossl_ec_GFp_nistp256_points_mul(const EC_GROUP *group, EC_POINT *r,
556
    const BIGNUM *scalar, size_t num,
557
    const EC_POINT *points[],
558
    const BIGNUM *scalars[], BN_CTX *ctx);
559
int ossl_ec_GFp_nistp256_precompute_mult(EC_GROUP *group, BN_CTX *ctx);
560
int ossl_ec_GFp_nistp256_have_precompute_mult(const EC_GROUP *group);
561
562
/* method functions in ecp_nistp384.c */
563
int ossl_ec_GFp_nistp384_group_init(EC_GROUP *group);
564
int ossl_ec_GFp_nistp384_group_set_curve(EC_GROUP *group, const BIGNUM *p,
565
    const BIGNUM *a, const BIGNUM *n,
566
    BN_CTX *);
567
int ossl_ec_GFp_nistp384_point_get_affine_coordinates(const EC_GROUP *group,
568
    const EC_POINT *point,
569
    BIGNUM *x, BIGNUM *y,
570
    BN_CTX *ctx);
571
int ossl_ec_GFp_nistp384_mul(const EC_GROUP *group, EC_POINT *r,
572
    const BIGNUM *scalar, size_t num,
573
    const EC_POINT *points[], const BIGNUM *scalars[],
574
    BN_CTX *);
575
int ossl_ec_GFp_nistp384_points_mul(const EC_GROUP *group, EC_POINT *r,
576
    const BIGNUM *scalar, size_t num,
577
    const EC_POINT *points[],
578
    const BIGNUM *scalars[], BN_CTX *ctx);
579
int ossl_ec_GFp_nistp384_precompute_mult(EC_GROUP *group, BN_CTX *ctx);
580
int ossl_ec_GFp_nistp384_have_precompute_mult(const EC_GROUP *group);
581
const EC_METHOD *ossl_ec_GFp_nistp384_method(void);
582
583
/* method functions in ecp_nistp521.c */
584
int ossl_ec_GFp_nistp521_group_init(EC_GROUP *group);
585
int ossl_ec_GFp_nistp521_group_set_curve(EC_GROUP *group, const BIGNUM *p,
586
    const BIGNUM *a, const BIGNUM *n,
587
    BN_CTX *);
588
int ossl_ec_GFp_nistp521_point_get_affine_coordinates(const EC_GROUP *group,
589
    const EC_POINT *point,
590
    BIGNUM *x, BIGNUM *y,
591
    BN_CTX *ctx);
592
int ossl_ec_GFp_nistp521_mul(const EC_GROUP *group, EC_POINT *r,
593
    const BIGNUM *scalar, size_t num,
594
    const EC_POINT *points[], const BIGNUM *scalars[],
595
    BN_CTX *);
596
int ossl_ec_GFp_nistp521_points_mul(const EC_GROUP *group, EC_POINT *r,
597
    const BIGNUM *scalar, size_t num,
598
    const EC_POINT *points[],
599
    const BIGNUM *scalars[], BN_CTX *ctx);
600
int ossl_ec_GFp_nistp521_precompute_mult(EC_GROUP *group, BN_CTX *ctx);
601
int ossl_ec_GFp_nistp521_have_precompute_mult(const EC_GROUP *group);
602
603
/* utility functions in ecp_nistputil.c */
604
void ossl_ec_GFp_nistp_points_make_affine_internal(size_t num, void *point_array,
605
    size_t felem_size,
606
    void *tmp_felems,
607
    void (*felem_one)(void *out),
608
    int (*felem_is_zero)(const void *in),
609
    void (*felem_assign)(void *out, const void *in),
610
    void (*felem_square)(void *out, const void *in),
611
    void (*felem_mul)(void *out,
612
        const void *in1,
613
        const void *in2),
614
    void (*felem_inv)(void *out, const void *in),
615
    void (*felem_contract)(void *out, const void *in));
616
void ossl_ec_GFp_nistp_recode_scalar_bits(unsigned char *sign,
617
    unsigned char *digit,
618
    unsigned char in);
619
#endif
620
int ossl_ec_group_simple_order_bits(const EC_GROUP *group);
621
622
/**
623
 *  Creates a new EC_GROUP object
624
 *  \param   libctx The associated library context or NULL for the default
625
 *                  library context
626
 *  \param   propq  Any property query string
627
 *  \param   meth   EC_METHOD to use
628
 *  \return  newly created EC_GROUP object or NULL in case of an error.
629
 */
630
EC_GROUP *ossl_ec_group_new_ex(OSSL_LIB_CTX *libctx, const char *propq,
631
    const EC_METHOD *meth);
632
633
#ifdef ECP_NISTZ256_ASM
634
/** Returns GFp methods using montgomery multiplication, with x86-64 optimized
635
 * P256. See http://eprint.iacr.org/2013/816.
636
 *  \return  EC_METHOD object
637
 */
638
const EC_METHOD *EC_GFp_nistz256_method(void);
639
#endif
640
#ifdef S390X_EC_ASM
641
const EC_METHOD *EC_GFp_s390x_nistp256_method(void);
642
const EC_METHOD *EC_GFp_s390x_nistp384_method(void);
643
const EC_METHOD *EC_GFp_s390x_nistp521_method(void);
644
#endif
645
646
size_t ossl_ec_key_simple_priv2oct(const EC_KEY *eckey,
647
    unsigned char *buf, size_t len);
648
int ossl_ec_key_simple_oct2priv(EC_KEY *eckey, const unsigned char *buf,
649
    size_t len);
650
int ossl_ec_key_simple_generate_key(EC_KEY *eckey);
651
int ossl_ec_key_simple_generate_public_key(EC_KEY *eckey);
652
int ossl_ec_key_simple_check_key(const EC_KEY *eckey);
653
654
#ifdef ECP_SM2P256_ASM
655
/* Returns optimized methods for SM2 */
656
const EC_METHOD *EC_GFp_sm2p256_method(void);
657
#endif
658
659
int ossl_ec_curve_nid_from_params(const EC_GROUP *group, BN_CTX *ctx);
660
661
/* EC_METHOD definitions */
662
663
struct ec_key_method_st {
664
    const char *name;
665
    int32_t flags;
666
    int (*init)(EC_KEY *key);
667
    void (*finish)(EC_KEY *key);
668
    int (*copy)(EC_KEY *dest, const EC_KEY *src);
669
    int (*set_group)(EC_KEY *key, const EC_GROUP *grp);
670
    int (*set_private)(EC_KEY *key, const BIGNUM *priv_key);
671
    int (*set_public)(EC_KEY *key, const EC_POINT *pub_key);
672
    int (*keygen)(EC_KEY *key);
673
    int (*compute_key)(unsigned char **pout, size_t *poutlen,
674
        const EC_POINT *pub_key, const EC_KEY *ecdh);
675
    int (*sign)(int type, const unsigned char *dgst, int dlen, unsigned char *sig, unsigned int *siglen, const BIGNUM *kinv,
676
        const BIGNUM *r, EC_KEY *eckey);
677
    int (*sign_setup)(EC_KEY *eckey, BN_CTX *ctx_in, BIGNUM **kinvp,
678
        BIGNUM **rp);
679
    ECDSA_SIG *(*sign_sig)(const unsigned char *dgst, int dgst_len,
680
        const BIGNUM *in_kinv, const BIGNUM *in_r,
681
        EC_KEY *eckey);
682
683
    int (*verify)(int type, const unsigned char *dgst, int dgst_len,
684
        const unsigned char *sigbuf, int sig_len, EC_KEY *eckey);
685
    int (*verify_sig)(const unsigned char *dgst, int dgst_len,
686
        const ECDSA_SIG *sig, EC_KEY *eckey);
687
};
688
689
0
#define EC_KEY_METHOD_DYNAMIC 1
690
691
EC_KEY *ossl_ec_key_new_method_int(OSSL_LIB_CTX *libctx, const char *propq);
692
693
int ossl_ec_key_gen(EC_KEY *eckey);
694
int ossl_ecdh_compute_key(unsigned char **pout, size_t *poutlen,
695
    const EC_POINT *pub_key, const EC_KEY *ecdh);
696
int ossl_ecdh_simple_compute_key(unsigned char **pout, size_t *poutlen,
697
    const EC_POINT *pub_key, const EC_KEY *ecdh);
698
699
struct ECDSA_SIG_st {
700
    BIGNUM *r;
701
    BIGNUM *s;
702
};
703
704
int ossl_ecdsa_sign_setup(EC_KEY *eckey, BN_CTX *ctx_in, BIGNUM **kinvp,
705
    BIGNUM **rp);
706
int ossl_ecdsa_sign(int type, const unsigned char *dgst, int dlen,
707
    unsigned char *sig, unsigned int *siglen,
708
    const BIGNUM *kinv, const BIGNUM *r, EC_KEY *eckey);
709
ECDSA_SIG *ossl_ecdsa_sign_sig(const unsigned char *dgst, int dgst_len,
710
    const BIGNUM *in_kinv, const BIGNUM *in_r,
711
    EC_KEY *eckey);
712
int ossl_ecdsa_verify(int type, const unsigned char *dgst, int dgst_len,
713
    const unsigned char *sigbuf, int sig_len, EC_KEY *eckey);
714
int ossl_ecdsa_verify_sig(const unsigned char *dgst, int dgst_len,
715
    const ECDSA_SIG *sig, EC_KEY *eckey);
716
int ossl_ecdsa_simple_sign_setup(EC_KEY *eckey, BN_CTX *ctx_in, BIGNUM **kinvp,
717
    BIGNUM **rp);
718
ECDSA_SIG *ossl_ecdsa_simple_sign_sig(const unsigned char *dgst, int dgst_len,
719
    const BIGNUM *in_kinv, const BIGNUM *in_r,
720
    EC_KEY *eckey);
721
int ossl_ecdsa_simple_verify_sig(const unsigned char *dgst, int dgst_len,
722
    const ECDSA_SIG *sig, EC_KEY *eckey);
723
724
/*-
725
 * This functions computes a single point multiplication over the EC group,
726
 * using, at a high level, a Montgomery ladder with conditional swaps, with
727
 * various timing attack defenses.
728
 *
729
 * It performs either a fixed point multiplication
730
 *          (scalar * generator)
731
 * when point is NULL, or a variable point multiplication
732
 *          (scalar * point)
733
 * when point is not NULL.
734
 *
735
 * `scalar` cannot be NULL and should be in the range [0,n) otherwise all
736
 * constant time bets are off (where n is the cardinality of the EC group).
737
 *
738
 * This function expects `group->order` and `group->cardinality` to be well
739
 * defined and non-zero: it fails with an error code otherwise.
740
 *
741
 * NB: This says nothing about the constant-timeness of the ladder step
742
 * implementation (i.e., the default implementation is based on EC_POINT_add and
743
 * EC_POINT_dbl, which of course are not constant time themselves) or the
744
 * underlying multiprecision arithmetic.
745
 *
746
 * The product is stored in `r`.
747
 *
748
 * This is an internal function: callers are in charge of ensuring that the
749
 * input parameters `group`, `r`, `scalar` and `ctx` are not NULL.
750
 *
751
 * Returns 1 on success, 0 otherwise.
752
 */
753
int ossl_ec_scalar_mul_ladder(const EC_GROUP *group, EC_POINT *r,
754
    const BIGNUM *scalar, const EC_POINT *point,
755
    BN_CTX *ctx);
756
757
int ossl_ec_point_blind_coordinates(const EC_GROUP *group, EC_POINT *p,
758
    BN_CTX *ctx);
759
760
static ossl_inline int ec_point_ladder_pre(const EC_GROUP *group,
761
    EC_POINT *r, EC_POINT *s,
762
    EC_POINT *p, BN_CTX *ctx)
763
0
{
764
0
    if (group->meth->ladder_pre != NULL)
765
0
        return group->meth->ladder_pre(group, r, s, p, ctx);
766
767
0
    if (!EC_POINT_copy(s, p)
768
0
        || !EC_POINT_dbl(group, r, s, ctx))
769
0
        return 0;
770
771
0
    return 1;
772
0
}
Unexecuted instantiation: curve25519.c:ec_point_ladder_pre
Unexecuted instantiation: ec_ameth.c:ec_point_ladder_pre
Unexecuted instantiation: ec_asn1.c:ec_point_ladder_pre
Unexecuted instantiation: ec_backend.c:ec_point_ladder_pre
Unexecuted instantiation: ec_check.c:ec_point_ladder_pre
Unexecuted instantiation: ec_curve.c:ec_point_ladder_pre
Unexecuted instantiation: ec_cvt.c:ec_point_ladder_pre
Unexecuted instantiation: ec_key.c:ec_point_ladder_pre
Unexecuted instantiation: ec_kmeth.c:ec_point_ladder_pre
Unexecuted instantiation: ec_lib.c:ec_point_ladder_pre
Unexecuted instantiation: ec_mult.c:ec_point_ladder_pre
Unexecuted instantiation: ec_oct.c:ec_point_ladder_pre
Unexecuted instantiation: ec_pmeth.c:ec_point_ladder_pre
Unexecuted instantiation: ecdh_kdf.c:ec_point_ladder_pre
Unexecuted instantiation: ecdh_ossl.c:ec_point_ladder_pre
Unexecuted instantiation: ecdsa_ossl.c:ec_point_ladder_pre
Unexecuted instantiation: ecdsa_sign.c:ec_point_ladder_pre
Unexecuted instantiation: ecdsa_vrf.c:ec_point_ladder_pre
Unexecuted instantiation: ecp_mont.c:ec_point_ladder_pre
Unexecuted instantiation: ecp_nist.c:ec_point_ladder_pre
Unexecuted instantiation: ecp_oct.c:ec_point_ladder_pre
Unexecuted instantiation: ecp_smpl.c:ec_point_ladder_pre
Unexecuted instantiation: ecx_meth.c:ec_point_ladder_pre
Unexecuted instantiation: ec2_oct.c:ec_point_ladder_pre
Unexecuted instantiation: ec2_smpl.c:ec_point_ladder_pre
773
774
static ossl_inline int ec_point_ladder_step(const EC_GROUP *group,
775
    EC_POINT *r, EC_POINT *s,
776
    EC_POINT *p, BN_CTX *ctx)
777
0
{
778
0
    if (group->meth->ladder_step != NULL)
779
0
        return group->meth->ladder_step(group, r, s, p, ctx);
780
781
0
    if (!EC_POINT_add(group, s, r, s, ctx)
782
0
        || !EC_POINT_dbl(group, r, r, ctx))
783
0
        return 0;
784
785
0
    return 1;
786
0
}
Unexecuted instantiation: curve25519.c:ec_point_ladder_step
Unexecuted instantiation: ec_ameth.c:ec_point_ladder_step
Unexecuted instantiation: ec_asn1.c:ec_point_ladder_step
Unexecuted instantiation: ec_backend.c:ec_point_ladder_step
Unexecuted instantiation: ec_check.c:ec_point_ladder_step
Unexecuted instantiation: ec_curve.c:ec_point_ladder_step
Unexecuted instantiation: ec_cvt.c:ec_point_ladder_step
Unexecuted instantiation: ec_key.c:ec_point_ladder_step
Unexecuted instantiation: ec_kmeth.c:ec_point_ladder_step
Unexecuted instantiation: ec_lib.c:ec_point_ladder_step
Unexecuted instantiation: ec_mult.c:ec_point_ladder_step
Unexecuted instantiation: ec_oct.c:ec_point_ladder_step
Unexecuted instantiation: ec_pmeth.c:ec_point_ladder_step
Unexecuted instantiation: ecdh_kdf.c:ec_point_ladder_step
Unexecuted instantiation: ecdh_ossl.c:ec_point_ladder_step
Unexecuted instantiation: ecdsa_ossl.c:ec_point_ladder_step
Unexecuted instantiation: ecdsa_sign.c:ec_point_ladder_step
Unexecuted instantiation: ecdsa_vrf.c:ec_point_ladder_step
Unexecuted instantiation: ecp_mont.c:ec_point_ladder_step
Unexecuted instantiation: ecp_nist.c:ec_point_ladder_step
Unexecuted instantiation: ecp_oct.c:ec_point_ladder_step
Unexecuted instantiation: ecp_smpl.c:ec_point_ladder_step
Unexecuted instantiation: ecx_meth.c:ec_point_ladder_step
Unexecuted instantiation: ec2_oct.c:ec_point_ladder_step
Unexecuted instantiation: ec2_smpl.c:ec_point_ladder_step
787
788
static ossl_inline int ec_point_ladder_post(const EC_GROUP *group,
789
    EC_POINT *r, EC_POINT *s,
790
    EC_POINT *p, BN_CTX *ctx)
791
0
{
792
0
    if (group->meth->ladder_post != NULL)
793
0
        return group->meth->ladder_post(group, r, s, p, ctx);
794
795
0
    return 1;
796
0
}
Unexecuted instantiation: curve25519.c:ec_point_ladder_post
Unexecuted instantiation: ec_ameth.c:ec_point_ladder_post
Unexecuted instantiation: ec_asn1.c:ec_point_ladder_post
Unexecuted instantiation: ec_backend.c:ec_point_ladder_post
Unexecuted instantiation: ec_check.c:ec_point_ladder_post
Unexecuted instantiation: ec_curve.c:ec_point_ladder_post
Unexecuted instantiation: ec_cvt.c:ec_point_ladder_post
Unexecuted instantiation: ec_key.c:ec_point_ladder_post
Unexecuted instantiation: ec_kmeth.c:ec_point_ladder_post
Unexecuted instantiation: ec_lib.c:ec_point_ladder_post
Unexecuted instantiation: ec_mult.c:ec_point_ladder_post
Unexecuted instantiation: ec_oct.c:ec_point_ladder_post
Unexecuted instantiation: ec_pmeth.c:ec_point_ladder_post
Unexecuted instantiation: ecdh_kdf.c:ec_point_ladder_post
Unexecuted instantiation: ecdh_ossl.c:ec_point_ladder_post
Unexecuted instantiation: ecdsa_ossl.c:ec_point_ladder_post
Unexecuted instantiation: ecdsa_sign.c:ec_point_ladder_post
Unexecuted instantiation: ecdsa_vrf.c:ec_point_ladder_post
Unexecuted instantiation: ecp_mont.c:ec_point_ladder_post
Unexecuted instantiation: ecp_nist.c:ec_point_ladder_post
Unexecuted instantiation: ecp_oct.c:ec_point_ladder_post
Unexecuted instantiation: ecp_smpl.c:ec_point_ladder_post
Unexecuted instantiation: ecx_meth.c:ec_point_ladder_post
Unexecuted instantiation: ec2_oct.c:ec_point_ladder_post
Unexecuted instantiation: ec2_smpl.c:ec_point_ladder_post