summaryrefslogtreecommitdiffstats
path: root/crypto/ec
diff options
context:
space:
mode:
authorShane Lontis <shane.lontis@oracle.com>2021-02-18 20:27:26 +1000
committerShane Lontis <shane.lontis@oracle.com>2021-02-26 10:53:01 +1000
commit32ab57cbb4877ce7e6b4eb3f9b3cfbb0ff7cd10b (patch)
tree91e75951efa936b26e3a636b9a0daf90d60182b0 /crypto/ec
parent5af02212a5331cc30389246bb94f97fbcdebc23a (diff)
Fix external symbols related to ec & sm2 keys
Partial fix for #12964 This adds ossl_ names for the following symbols: ec_*, ecx_*, ecdh_*, ecdsa_*, sm2_* Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14231)
Diffstat (limited to 'crypto/ec')
-rw-r--r--crypto/ec/ec2_oct.c21
-rw-r--r--crypto/ec/ec2_smpl.c180
-rw-r--r--crypto/ec/ec_ameth.c8
-rw-r--r--crypto/ec/ec_asn1.c2
-rw-r--r--crypto/ec/ec_backend.c52
-rw-r--r--crypto/ec/ec_check.c2
-rw-r--r--crypto/ec/ec_curve.c12
-rw-r--r--crypto/ec/ec_cvt.c4
-rw-r--r--crypto/ec/ec_key.c46
-rw-r--r--crypto/ec/ec_kmeth.c6
-rw-r--r--crypto/ec/ec_lib.c45
-rw-r--r--crypto/ec/ec_local.h498
-rw-r--r--crypto/ec/ec_mult.c29
-rw-r--r--crypto/ec/ec_oct.c19
-rw-r--r--crypto/ec/ec_pmeth.c8
-rw-r--r--crypto/ec/ecdh_kdf.c13
-rw-r--r--crypto/ec/ecdh_ossl.c4
-rw-r--r--crypto/ec/ecdsa_ossl.c18
-rw-r--r--crypto/ec/ecp_mont.c133
-rw-r--r--crypto/ec/ecp_nist.c99
-rw-r--r--crypto/ec/ecp_nistp224.c160
-rw-r--r--crypto/ec/ecp_nistp256.c158
-rw-r--r--crypto/ec/ecp_nistp521.c164
-rw-r--r--crypto/ec/ecp_nistputil.c7
-rw-r--r--crypto/ec/ecp_nistz256.c76
-rw-r--r--crypto/ec/ecp_oct.c19
-rw-r--r--crypto/ec/ecp_s390x_nistp.c80
-rw-r--r--crypto/ec/ecp_smpl.c215
-rw-r--r--crypto/ec/ecx_backend.c8
-rw-r--r--crypto/ec/ecx_key.c12
-rw-r--r--crypto/ec/ecx_meth.c58
31 files changed, 1091 insertions, 1065 deletions
diff --git a/crypto/ec/ec2_oct.c b/crypto/ec/ec2_oct.c
index 5cfe28325c..7d894c4bef 100644
--- a/crypto/ec/ec2_oct.c
+++ b/crypto/ec/ec2_oct.c
@@ -36,10 +36,10 @@
* the same method, but claim no priority date earlier than July 29, 1994
* (and additionally fail to cite the EUROCRYPT '92 publication as prior art).
*/
-int ec_GF2m_simple_set_compressed_coordinates(const EC_GROUP *group,
- EC_POINT *point,
- const BIGNUM *x_, int y_bit,
- BN_CTX *ctx)
+int ossl_ec_GF2m_simple_set_compressed_coordinates(const EC_GROUP *group,
+ EC_POINT *point,
+ const BIGNUM *x_, int y_bit,
+ BN_CTX *ctx)
{
BIGNUM *tmp, *x, *y, *z;
int ret = 0, z0;
@@ -122,9 +122,10 @@ int ec_GF2m_simple_set_compressed_coordinates(const EC_GROUP *group,
* length will be returned. If the length len of buf is smaller than required
* an error will be returned.
*/
-size_t ec_GF2m_simple_point2oct(const EC_GROUP *group, const EC_POINT *point,
- point_conversion_form_t form,
- unsigned char *buf, size_t len, BN_CTX *ctx)
+size_t ossl_ec_GF2m_simple_point2oct(const EC_GROUP *group,
+ const EC_POINT *point,
+ point_conversion_form_t form,
+ unsigned char *buf, size_t len, BN_CTX *ctx)
{
size_t ret;
int used_ctx = 0;
@@ -252,9 +253,9 @@ size_t ec_GF2m_simple_point2oct(const EC_GROUP *group, const EC_POINT *point,
* Converts an octet string representation to an EC_POINT. Note that the
* simple implementation only uses affine coordinates.
*/
-int ec_GF2m_simple_oct2point(const EC_GROUP *group, EC_POINT *point,
- const unsigned char *buf, size_t len,
- BN_CTX *ctx)
+int ossl_ec_GF2m_simple_oct2point(const EC_GROUP *group, EC_POINT *point,
+ const unsigned char *buf, size_t len,
+ BN_CTX *ctx)
{
point_conversion_form_t form;
int y_bit, m;
diff --git a/crypto/ec/ec2_smpl.c b/crypto/ec/ec2_smpl.c
index abac2a5cae..f58ce3367f 100644
--- a/crypto/ec/ec2_smpl.c
+++ b/crypto/ec/ec2_smpl.c
@@ -25,7 +25,7 @@
* Initialize a GF(2^m)-based EC_GROUP structure. Note that all other members
* are handled by EC_GROUP_new.
*/
-int ec_GF2m_simple_group_init(EC_GROUP *group)
+int ossl_ec_GF2m_simple_group_init(EC_GROUP *group)
{
group->field = BN_new();
group->a = BN_new();
@@ -44,7 +44,7 @@ int ec_GF2m_simple_group_init(EC_GROUP *group)
* Free a GF(2^m)-based EC_GROUP structure. Note that all other members are
* handled by EC_GROUP_free.
*/
-void ec_GF2m_simple_group_finish(EC_GROUP *group)
+void ossl_ec_GF2m_simple_group_finish(EC_GROUP *group)
{
BN_free(group->field);
BN_free(group->a);
@@ -55,7 +55,7 @@ void ec_GF2m_simple_group_finish(EC_GROUP *group)
* Clear and free a GF(2^m)-based EC_GROUP structure. Note that all other
* members are handled by EC_GROUP_clear_free.
*/
-void ec_GF2m_simple_group_clear_finish(EC_GROUP *group)
+void ossl_ec_GF2m_simple_group_clear_finish(EC_GROUP *group)
{
BN_clear_free(group->field);
BN_clear_free(group->a);
@@ -72,7 +72,7 @@ void ec_GF2m_simple_group_clear_finish(EC_GROUP *group)
* Copy a GF(2^m)-based EC_GROUP structure. Note that all other members are
* handled by EC_GROUP_copy.
*/
-int ec_GF2m_simple_group_copy(EC_GROUP *dest, const EC_GROUP *src)
+int ossl_ec_GF2m_simple_group_copy(EC_GROUP *dest, const EC_GROUP *src)
{
if (!BN_copy(dest->field, src->field))
return 0;
@@ -98,9 +98,9 @@ int ec_GF2m_simple_group_copy(EC_GROUP *dest, const EC_GROUP *src)
}
/* Set the curve parameters of an EC_GROUP structure. */
-int ec_GF2m_simple_group_set_curve(EC_GROUP *group,
- const BIGNUM *p, const BIGNUM *a,
- const BIGNUM *b, BN_CTX *ctx)
+int ossl_ec_GF2m_simple_group_set_curve(EC_GROUP *group,
+ const BIGNUM *p, const BIGNUM *a,
+ const BIGNUM *b, BN_CTX *ctx)
{
int ret = 0, i;
@@ -138,8 +138,8 @@ int ec_GF2m_simple_group_set_curve(EC_GROUP *group,
* Get the curve parameters of an EC_GROUP structure. If p, a, or b are NULL
* then there values will not be set but the method will return with success.
*/
-int ec_GF2m_simple_group_get_curve(const EC_GROUP *group, BIGNUM *p,
- BIGNUM *a, BIGNUM *b, BN_CTX *ctx)
+int ossl_ec_GF2m_simple_group_get_curve(const EC_GROUP *group, BIGNUM *p,
+ BIGNUM *a, BIGNUM *b, BN_CTX *ctx)
{
int ret = 0;
@@ -168,7 +168,7 @@ int ec_GF2m_simple_group_get_curve(const EC_GROUP *group, BIGNUM *p,
* Gets the degree of the field. For a curve over GF(2^m) this is the value
* m.
*/
-int ec_GF2m_simple_group_get_degree(const EC_GROUP *group)
+int ossl_ec_GF2m_simple_group_get_degree(const EC_GROUP *group)
{
return BN_num_bits(group->field) - 1;
}
@@ -177,8 +177,8 @@ int ec_GF2m_simple_group_get_degree(const EC_GROUP *group)
* Checks the discriminant of the curve. y^2 + x*y = x^3 + a*x^2 + b is an
* elliptic curve <=> b != 0 (mod p)
*/
-int ec_GF2m_simple_group_check_discriminant(const EC_GROUP *group,
- BN_CTX *ctx)
+int ossl_ec_GF2m_simple_group_check_discriminant(const EC_GROUP *group,
+ BN_CTX *ctx)
{
int ret = 0;
BIGNUM *b;
@@ -219,7 +219,7 @@ int ec_GF2m_simple_group_check_discriminant(const EC_GROUP *group,
}
/* Initializes an EC_POINT. */
-int ec_GF2m_simple_point_init(EC_POINT *point)
+int ossl_ec_GF2m_simple_point_init(EC_POINT *point)
{
point->X = BN_new();
point->Y = BN_new();
@@ -235,7 +235,7 @@ int ec_GF2m_simple_point_init(EC_POINT *point)
}
/* Frees an EC_POINT. */
-void ec_GF2m_simple_point_finish(EC_POINT *point)
+void ossl_ec_GF2m_simple_point_finish(EC_POINT *point)
{
BN_free(point->X);
BN_free(point->Y);
@@ -243,7 +243,7 @@ void ec_GF2m_simple_point_finish(EC_POINT *point)
}
/* Clears and frees an EC_POINT. */
-void ec_GF2m_simple_point_clear_finish(EC_POINT *point)
+void ossl_ec_GF2m_simple_point_clear_finish(EC_POINT *point)
{
BN_clear_free(point->X);
BN_clear_free(point->Y);
@@ -255,7 +255,7 @@ void ec_GF2m_simple_point_clear_finish(EC_POINT *point)
* Copy the contents of one EC_POINT into another. Assumes dest is
* initialized.
*/
-int ec_GF2m_simple_point_copy(EC_POINT *dest, const EC_POINT *src)
+int ossl_ec_GF2m_simple_point_copy(EC_POINT *dest, const EC_POINT *src)
{
if (!BN_copy(dest->X, src->X))
return 0;
@@ -273,8 +273,8 @@ int ec_GF2m_simple_point_copy(EC_POINT *dest, const EC_POINT *src)
* Set an EC_POINT to the point at infinity. A point at infinity is
* represented by having Z=0.
*/
-int ec_GF2m_simple_point_set_to_infinity(const EC_GROUP *group,
- EC_POINT *point)
+int ossl_ec_GF2m_simple_point_set_to_infinity(const EC_GROUP *group,
+ EC_POINT *point)
{
point->Z_is_one = 0;
BN_zero(point->Z);
@@ -285,10 +285,11 @@ int ec_GF2m_simple_point_set_to_infinity(const EC_GROUP *group,
* Set the coordinates of an EC_POINT using affine coordinates. Note that
* the simple implementation only uses affine coordinates.
*/
-int ec_GF2m_simple_point_set_affine_coordinates(const EC_GROUP *group,
- EC_POINT *point,
- const BIGNUM *x,
- const BIGNUM *y, BN_CTX *ctx)
+int ossl_ec_GF2m_simple_point_set_affine_coordinates(const EC_GROUP *group,
+ EC_POINT *point,
+ const BIGNUM *x,
+ const BIGNUM *y,
+ BN_CTX *ctx)
{
int ret = 0;
if (x == NULL || y == NULL) {
@@ -316,10 +317,10 @@ int ec_GF2m_simple_point_set_affine_coordinates(const EC_GROUP *group,
* Gets the affine coordinates of an EC_POINT. Note that the simple
* implementation only uses affine coordinates.
*/
-int ec_GF2m_simple_point_get_affine_coordinates(const EC_GROUP *group,
- const EC_POINT *point,
- BIGNUM *x, BIGNUM *y,
- BN_CTX *ctx)
+int ossl_ec_GF2m_simple_point_get_affine_coordinates(const EC_GROUP *group,
+ const EC_POINT *point,
+ BIGNUM *x, BIGNUM *y,
+ BN_CTX *ctx)
{
int ret = 0;
@@ -352,8 +353,8 @@ int ec_GF2m_simple_point_get_affine_coordinates(const EC_GROUP *group,
* Computes a + b and stores the result in r. r could be a or b, a could be
* b. Uses algorithm A.10.2 of IEEE P1363.
*/
-int ec_GF2m_simple_add(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a,
- const EC_POINT *b, BN_CTX *ctx)
+int ossl_ec_GF2m_simple_add(const EC_GROUP *group, EC_POINT *r,
+ const EC_POINT *a, const EC_POINT *b, BN_CTX *ctx)
{
BIGNUM *x0, *y0, *x1, *y1, *x2, *y2, *s, *t;
int ret = 0;
@@ -473,13 +474,14 @@ int ec_GF2m_simple_add(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a,
* Computes 2 * a and stores the result in r. r could be a. Uses algorithm
* A.10.2 of IEEE P1363.
*/
-int ec_GF2m_simple_dbl(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a,
- BN_CTX *ctx)
+int ossl_ec_GF2m_simple_dbl(const EC_GROUP *group, EC_POINT *r,
+ const EC_POINT *a, BN_CTX *ctx)
{
- return ec_GF2m_simple_add(group, r, a, a, ctx);
+ return ossl_ec_GF2m_simple_add(group, r, a, a, ctx);
}
-int ec_GF2m_simple_invert(const EC_GROUP *group, EC_POINT *point, BN_CTX *ctx)
+int ossl_ec_GF2m_simple_invert(const EC_GROUP *group, EC_POINT *point,
+ BN_CTX *ctx)
{
if (EC_POINT_is_at_infinity(group, point) || BN_is_zero(point->Y))
/* point is its own inverse */
@@ -492,8 +494,8 @@ int ec_GF2m_simple_invert(const EC_GROUP *group, EC_POINT *point, BN_CTX *ctx)
}
/* Indicates whether the given point is the point at infinity. */
-int ec_GF2m_simple_is_at_infinity(const EC_GROUP *group,
- const EC_POINT *point)
+int ossl_ec_GF2m_simple_is_at_infinity(const EC_GROUP *group,
+ const EC_POINT *point)
{
return BN_is_zero(point->Z);
}
@@ -503,8 +505,8 @@ int ec_GF2m_simple_is_at_infinity(const EC_GROUP *group,
* in the EC_GROUP. A point is valid if it satisfies the Weierstrass equation:
* y^2 + x*y = x^3 + a*x^2 + b.
*/
-int ec_GF2m_simple_is_on_curve(const EC_GROUP *group, const EC_POINT *point,
- BN_CTX *ctx)
+int ossl_ec_GF2m_simple_is_on_curve(const EC_GROUP *group, const EC_POINT *point,
+ BN_CTX *ctx)
{
int ret = -1;
BIGNUM *lh, *y2;
@@ -576,8 +578,8 @@ int ec_GF2m_simple_is_on_curve(const EC_GROUP *group, const EC_POINT *point,
* 0 equal (in affine coordinates)
* 1 not equal
*/
-int ec_GF2m_simple_cmp(const EC_GROUP *group, const EC_POINT *a,
- const EC_POINT *b, BN_CTX *ctx)
+int ossl_ec_GF2m_simple_cmp(const EC_GROUP *group, const EC_POINT *a,
+ const EC_POINT *b, BN_CTX *ctx)
{
BIGNUM *aX, *aY, *bX, *bY;
int ret = -1;
@@ -627,8 +629,8 @@ int ec_GF2m_simple_cmp(const EC_GROUP *group, const EC_POINT *a,
}
/* Forces the given EC_POINT to internally use affine coordinates. */
-int ec_GF2m_simple_make_affine(const EC_GROUP *group, EC_POINT *point,
- BN_CTX *ctx)
+int ossl_ec_GF2m_simple_make_affine(const EC_GROUP *group, EC_POINT *point,
+ BN_CTX *ctx)
{
BIGNUM *x, *y;
int ret = 0;
@@ -676,8 +678,8 @@ int ec_GF2m_simple_make_affine(const EC_GROUP *group, EC_POINT *point,
/*
* Forces each of the EC_POINTs in the given array to use affine coordinates.
*/
-int ec_GF2m_simple_points_make_affine(const EC_GROUP *group, size_t num,
- EC_POINT *points[], BN_CTX *ctx)
+int ossl_ec_GF2m_simple_points_make_affine(const EC_GROUP *group, size_t num,
+ EC_POINT *points[], BN_CTX *ctx)
{
size_t i;
@@ -690,22 +692,22 @@ int ec_GF2m_simple_points_make_affine(const EC_GROUP *group, size_t num,
}
/* Wrapper to simple binary polynomial field multiplication implementation. */
-int ec_GF2m_simple_field_mul(const EC_GROUP *group, BIGNUM *r,
- const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx)
+int ossl_ec_GF2m_simple_field_mul(const EC_GROUP *group, BIGNUM *r,
+ const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx)
{
return BN_GF2m_mod_mul_arr(r, a, b, group->poly, ctx);
}
/* Wrapper to simple binary polynomial field squaring implementation. */
-int ec_GF2m_simple_field_sqr(const EC_GROUP *group, BIGNUM *r,
- const BIGNUM *a, BN_CTX *ctx)
+int ossl_ec_GF2m_simple_field_sqr(const EC_GROUP *group, BIGNUM *r,
+ const BIGNUM *a, BN_CTX *ctx)
{
return BN_GF2m_mod_sqr_arr(r, a, group->poly, ctx);
}
/* Wrapper to simple binary polynomial field division implementation. */
-int ec_GF2m_simple_field_div(const EC_GROUP *group, BIGNUM *r,
- const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx)
+int ossl_ec_GF2m_simple_field_div(const EC_GROUP *group, BIGNUM *r,
+ const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx)
{
return BN_GF2m_mod_div(r, a, b, group->field, ctx);
}
@@ -887,15 +889,15 @@ int ec_GF2m_simple_points_mul(const EC_GROUP *group, EC_POINT *r,
* order or cofactor set to 0.
*/
if (num > 1 || BN_is_zero(group->order) || BN_is_zero(group->cofactor))
- return ec_wNAF_mul(group, r, scalar, num, points, scalars, ctx);
+ return ossl_ec_wNAF_mul(group, r, scalar, num, points, scalars, ctx);
if (scalar != NULL && num == 0)
/* Fixed point multiplication */
- return ec_scalar_mul_ladder(group, r, scalar, NULL, ctx);
+ return ossl_ec_scalar_mul_ladder(group, r, scalar, NULL, ctx);
if (scalar == NULL && num == 1)
/* Variable point multiplication */
- return ec_scalar_mul_ladder(group, r, scalars[0], points[0], ctx);
+ return ossl_ec_scalar_mul_ladder(group, r, scalars[0], points[0], ctx);
/*-
* Double point multiplication:
@@ -907,8 +909,8 @@ int ec_GF2m_simple_points_mul(const EC_GROUP *group, EC_POINT *r,
return 0;
}
- if (!ec_scalar_mul_ladder(group, t, scalar, NULL, ctx)
- || !ec_scalar_mul_ladder(group, r, scalars[0], points[0], ctx)
+ if (!ossl_ec_scalar_mul_ladder(group, t, scalar, NULL, ctx)
+ || !ossl_ec_scalar_mul_ladder(group, r, scalars[0], points[0], ctx)
|| !EC_POINT_add(group, r, t, r, ctx))
goto err;
@@ -939,55 +941,55 @@ const EC_METHOD *EC_GF2m_simple_method(void)
static const EC_METHOD ret = {
EC_FLAGS_DEFAULT_OCT,
NID_X9_62_characteristic_two_field,
- ec_GF2m_simple_group_init,
- ec_GF2m_simple_group_finish,
- ec_GF2m_simple_group_clear_finish,
- ec_GF2m_simple_group_copy,
- ec_GF2m_simple_group_set_curve,
- ec_GF2m_simple_group_get_curve,
- ec_GF2m_simple_group_get_degree,
- ec_group_simple_order_bits,
- ec_GF2m_simple_group_check_discriminant,
- ec_GF2m_simple_point_init,
- ec_GF2m_simple_point_finish,
- ec_GF2m_simple_point_clear_finish,
- ec_GF2m_simple_point_copy,
- ec_GF2m_simple_point_set_to_infinity,
- ec_GF2m_simple_point_set_affine_coordinates,
- ec_GF2m_simple_point_get_affine_coordinates,
+ ossl_ec_GF2m_simple_group_init,
+ ossl_ec_GF2m_simple_group_finish,
+ ossl_ec_GF2m_simple_group_clear_finish,
+ ossl_ec_GF2m_simple_group_copy,
+ ossl_ec_GF2m_simple_group_set_curve,
+ ossl_ec_GF2m_simple_group_get_curve,
+ ossl_ec_GF2m_simple_group_get_degree,
+ ossl_ec_group_simple_order_bits,
+ ossl_ec_GF2m_simple_group_check_discriminant,
+ ossl_ec_GF2m_simple_point_init,
+ ossl_ec_GF2m_simple_point_finish,
+ ossl_ec_GF2m_simple_point_clear_finish,
+ ossl_ec_GF2m_simple_point_copy,
+ ossl_ec_GF2m_simple_point_set_to_infinity,
+ ossl_ec_GF2m_simple_point_set_affine_coordinates,
+ ossl_ec_GF2m_simple_point_get_affine_coordinates,
0, /* point_set_compressed_coordinates */
0, /* point2oct */
0, /* oct2point */
- ec_GF2m_simple_add,
- ec_GF2m_simple_dbl,
- ec_GF2m_simple_invert,
- ec_GF2m_simple_is_at_infinity,
- ec_GF2m_simple_is_on_curve,
- ec_GF2m_simple_cmp,
- ec_GF2m_simple_make_affine,
- ec_GF2m_simple_points_make_affine,
+ ossl_ec_GF2m_simple_add,
+ ossl_ec_GF2m_simple_dbl,
+ ossl_ec_GF2m_simple_invert,
+ ossl_ec_GF2m_simple_is_at_infinity,
+ ossl_ec_GF2m_simple_is_on_curve,
+ ossl_ec_GF2m_simple_cmp,
+ ossl_ec_GF2m_simple_make_affine,
+ ossl_ec_GF2m_simple_points_make_affine,
ec_GF2m_simple_points_mul,
0, /* precompute_mult */
0, /* have_precompute_mult */
- ec_GF2m_simple_field_mul,
- ec_GF2m_simple_field_sqr,
- ec_GF2m_simple_field_div,
+ ossl_ec_GF2m_simple_field_mul,
+ ossl_ec_GF2m_simple_field_sqr,
+ ossl_ec_GF2m_simple_field_div,
ec_GF2m_simple_field_inv,
0, /* field_encode */
0, /* field_decode */
0, /* field_set_to_one */
- ec_key_simple_priv2oct,
- ec_key_simple_oct2priv,
+ ossl_ec_key_simple_priv2oct,
+ ossl_ec_key_simple_oct2priv,
0, /* set private */
- ec_key_simple_generate_key,
- ec_key_simple_check_key,
- ec_key_simple_generate_public_key,
+ ossl_ec_key_simple_generate_key,
+ ossl_ec_key_simple_check_key,
+ ossl_ec_key_simple_generate_public_key,
0, /* keycopy */
0, /* keyfinish */
- ecdh_simple_compute_key,
- ecdsa_simple_sign_setup,
- ecdsa_simple_sign_sig,
- ecdsa_simple_verify_sig,
+ ossl_ecdh_simple_compute_key,
+ ossl_ecdsa_simple_sign_setup,
+ ossl_ecdsa_simple_sign_sig,
+ ossl_ecdsa_simple_verify_sig,
0, /* field_inverse_mod_ord */
0, /* blind_coordinates */
ec_GF2m_simple_ladder_pre,
diff --git a/crypto/ec/ec_ameth.c b/crypto/ec/ec_ameth.c
index fe1e1c9a8f..89241b97c1 100644
--- a/crypto/ec/ec_ameth.c
+++ b/crypto/ec/ec_ameth.c
@@ -584,7 +584,7 @@ int ec_pkey_export_to(const EVP_PKEY *from, void *to_keydata,
BN_CTX_start(bnctx);
/* export the domain parameters */
- if (!ec_group_todata(ecg, tmpl, NULL, libctx, propq, bnctx, &gen_buf))
+ if (!ossl_ec_group_todata(ecg, tmpl, NULL, libctx, propq, bnctx, &gen_buf))
goto err;
selection |= OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS;
@@ -695,9 +695,9 @@ static int ec_pkey_import_from(const OSSL_PARAM params[], void *vpctx)
return 0;
}
- if (!ec_group_fromdata(ec, params)
- || !ec_key_otherparams_fromdata(ec, params)
- || !ec_key_fromdata(ec, params, 1)
+ if (!ossl_ec_group_fromdata(ec, params)
+ || !ossl_ec_key_otherparams_fromdata(ec, params)
+ || !ossl_ec_key_fromdata(ec, params, 1)
|| !EVP_PKEY_assign_EC_KEY(pkey, ec)) {
EC_KEY_free(ec);
return 0;
diff --git a/crypto/ec/ec_asn1.c b/crypto/ec/ec_asn1.c
index cd38ab6b04..b66e4a8b57 100644
--- a/crypto/ec/ec_asn1.c
+++ b/crypto/ec/ec_asn1.c
@@ -768,7 +768,7 @@ EC_GROUP *EC_GROUP_new_from_ecparameters(const ECPARAMETERS *params)
ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
goto err;
}
- if ((curve_name = ec_curve_nid_from_params(dup, ctx)) != NID_undef) {
+ if ((curve_name = ossl_ec_curve_nid_from_params(dup, ctx)) != NID_undef) {
/*
* The input explicit parameters successfully matched one of the
* built-in curves: often for built-in curves we have specialized
diff --git a/crypto/ec/ec_backend.c b/crypto/ec/ec_backend.c
index 60c5687602..c4a5a81fda 100644
--- a/crypto/ec/ec_backend.c
+++ b/crypto/ec/ec_backend.c
@@ -41,7 +41,7 @@ static const OSSL_ITEM format_nameid_map[] = {
{ (int)POINT_CONVERSION_HYBRID, OSSL_PKEY_EC_POINT_CONVERSION_FORMAT_HYBRID },
};
-int ec_encoding_name2id(const char *name)
+int ossl_ec_encoding_name2id(const char *name)
{
size_t i, sz;
@@ -67,7 +67,7 @@ static char *ec_param_encoding_id2name(int id)
return NULL;
}
-char *ec_check_group_type_id2name(int id)
+char *ossl_ec_check_group_type_id2name(int id)
{
size_t i, sz;
@@ -93,7 +93,7 @@ static int ec_check_group_type_name2id(const char *name)
return -1;
}
-int ec_set_check_group_type_from_name(EC_KEY *ec, const char *name)
+int ossl_ec_set_check_group_type_from_name(EC_KEY *ec, const char *name)
{
int flags = ec_check_group_type_name2id(name);
@@ -119,11 +119,11 @@ static int ec_set_check_group_type_from_param(EC_KEY *ec, const OSSL_PARAM *p)
break;
}
if (status)
- return ec_set_check_group_type_from_name(ec, name);
+ return ossl_ec_set_check_group_type_from_name(ec, name);
return 0;
}
-int ec_pt_format_name2id(const char *name)
+int ossl_ec_pt_format_name2id(const char *name)
{
size_t i, sz;
@@ -138,7 +138,7 @@ int ec_pt_format_name2id(const char *name)
return -1;
}
-char *ec_pt_format_id2name(int id)
+char *ossl_ec_pt_format_id2name(int id)
{
size_t i, sz;
@@ -149,10 +149,10 @@ char *ec_pt_format_id2name(int id)
return NULL;
}
-int ec_group_todata(const EC_GROUP *group, OSSL_PARAM_BLD *tmpl,
- OSSL_PARAM params[], OSSL_LIB_CTX *libctx,
- const char *propq,
- BN_CTX *bnctx, unsigned char **genbuf)
+int ossl_ec_group_todata(const EC_GROUP *group, OSSL_PARAM_BLD *tmpl,
+ OSSL_PARAM params[], OSSL_LIB_CTX *libctx,
+ const char *propq,
+ BN_CTX *bnctx, unsigned char **genbuf)
{
int ret = 0, curve_nid, encoding_flag;
const char *field_type, *encoding_name, *pt_form_name;
@@ -169,7 +169,7 @@ int ec_group_todata(const EC_GROUP *group, OSSL_PARAM_BLD *tmpl,
}
genform = EC_GROUP_get_point_conversion_form(group);
- pt_form_name = ec_pt_format_id2name(genform);
+ pt_form_name = ossl_ec_pt_format_id2name(genform);
if (pt_form_name == NULL
|| !ossl_param_build_set_utf8_string(
tmpl, params,
@@ -271,7 +271,7 @@ int ec_group_todata(const EC_GROUP *group, OSSL_PARAM_BLD *tmpl,
#endif
} else {
/* named curve */
- const char *curve_name = ec_curve_nid2name(curve_nid);
+ const char *curve_name = ossl_ec_curve_nid2name(curve_nid);
if (curve_name == NULL
|| !ossl_param_build_set_utf8_string(tmpl, params,
@@ -291,7 +291,7 @@ err:
* for legacy backends (EVP_PKEY_ASN1_METHOD and EVP_PKEY_METHOD) and provider
* implementations alike.
*/
-int ec_set_ecdh_cofactor_mode(EC_KEY *ec, int mode)
+int ossl_ec_set_ecdh_cofactor_mode(EC_KEY *ec, int mode)
{
const EC_GROUP *ecg = EC_KEY_get0_group(ec);
const BIGNUM *cofactor;
@@ -321,14 +321,14 @@ int ec_set_ecdh_cofactor_mode(EC_KEY *ec, int mode)
}
/*
- * Callers of ec_key_fromdata MUST make sure that ec_key_params_fromdata has
+ * Callers of ossl_ec_key_fromdata MUST make sure that ec_key_params_fromdata has
* been called before!
*
* This function only gets the bare keypair, domain parameters and other
* parameters are treated separately, and domain parameters are required to
* define a keypair.
*/
-int ec_key_fromdata(EC_KEY *ec, const OSSL_PARAM params[], int include_private)
+int ossl_ec_key_fromdata(EC_KEY *ec, const OSSL_PARAM params[], int include_private)
{
const OSSL_PARAM *param_priv_key = NULL, *param_pub_key = NULL;
BN_CTX *ctx = NULL;
@@ -349,7 +349,7 @@ int ec_key_fromdata(EC_KEY *ec, const OSSL_PARAM params[], int include_private)
param_priv_key =
OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_PRIV_KEY);
- ctx = BN_CTX_new_ex(ec_key_get_libctx(ec));
+ ctx = BN_CTX_new_ex(ossl_ec_key_get_libctx(ec));
if (ctx == NULL)
goto err;
@@ -431,7 +431,7 @@ int ec_key_fromdata(EC_KEY *ec, const OSSL_PARAM params[], int include_private)
return ok;
}
-int ec_group_fromdata(EC_KEY *ec, const OSSL_PARAM params[])
+int ossl_ec_group_fromdata(EC_KEY *ec, const OSSL_PARAM params[])
{
int ok = 0;
EC_GROUP *group = NULL;
@@ -439,8 +439,8 @@ int ec_group_fromdata(EC_KEY *ec, const OSSL_PARAM params[])
if (ec == NULL)
return 0;
- group = EC_GROUP_new_from_params(params, ec_key_get_libctx(ec),
- ec_key_get0_propq(ec));
+ group = EC_GROUP_new_from_params(params, ossl_ec_key_get_libctx(ec),
+ ossl_ec_key_get0_propq(ec));
if (!EC_KEY_set_group(ec, group))
goto err;
@@ -457,7 +457,7 @@ static int ec_key_point_format_fromdata(EC_KEY *ec, const OSSL_PARAM params[])
p = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_EC_POINT_CONVERSION_FORMAT);
if (p != NULL) {
- if (!ec_pt_format_param2id(p, &format)) {
+ if (!ossl_ec_pt_format_param2id(p, &format)) {
ECerr(0, EC_R_INVALID_FORM);
return 0;
}
@@ -488,7 +488,7 @@ static int ec_set_include_public(EC_KEY *ec, int include)
return 1;
}
-int ec_key_otherparams_fromdata(EC_KEY *ec, const OSSL_PARAM params[])
+int ossl_ec_key_otherparams_fromdata(EC_KEY *ec, const OSSL_PARAM params[])
{
const OSSL_PARAM *p;
@@ -500,7 +500,7 @@ int ec_key_otherparams_fromdata(EC_KEY *ec, const OSSL_PARAM params[])
int mode;
if (!OSSL_PARAM_get_int(p, &mode)
- || !ec_set_ecdh_cofactor_mode(ec, mode))
+ || !ossl_ec_set_ecdh_cofactor_mode(ec, mode))
return 0;
}
@@ -519,7 +519,7 @@ int ec_key_otherparams_fromdata(EC_KEY *ec, const OSSL_PARAM params[])
return 1;
}
-int ec_encoding_param2id(const OSSL_PARAM *p, int *id)
+int ossl_ec_encoding_param2id(const OSSL_PARAM *p, int *id)
{
const char *name = NULL;
int status = 0;
@@ -535,7 +535,7 @@ int ec_encoding_param2id(const OSSL_PARAM *p, int *id)
break;
}
if (status) {
- int i = ec_encoding_name2id(name);
+ int i = ossl_ec_encoding_name2id(name);
if (i >= 0) {
*id = i;
@@ -545,7 +545,7 @@ int ec_encoding_param2id(const OSSL_PARAM *p, int *id)
return 0;
}
-int ec_pt_format_param2id(const OSSL_PARAM *p, int *id)