early-access version 2698
This commit is contained in:
37
externals/libressl/crypto/ec/ecp_mont.c
vendored
37
externals/libressl/crypto/ec/ecp_mont.c
vendored
@@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: ecp_mont.c,v 1.17 2018/11/05 20:18:21 tb Exp $ */
|
||||
/* $OpenBSD: ecp_mont.c,v 1.20 2021/09/08 17:29:21 tb Exp $ */
|
||||
/*
|
||||
* Originally written by Bodo Moeller for the OpenSSL project.
|
||||
*/
|
||||
@@ -79,21 +79,22 @@ EC_GFp_mont_method(void)
|
||||
.group_set_curve = ec_GFp_mont_group_set_curve,
|
||||
.group_get_curve = ec_GFp_simple_group_get_curve,
|
||||
.group_get_degree = ec_GFp_simple_group_get_degree,
|
||||
.group_order_bits = ec_group_simple_order_bits,
|
||||
.group_check_discriminant =
|
||||
ec_GFp_simple_group_check_discriminant,
|
||||
ec_GFp_simple_group_check_discriminant,
|
||||
.point_init = ec_GFp_simple_point_init,
|
||||
.point_finish = ec_GFp_simple_point_finish,
|
||||
.point_clear_finish = ec_GFp_simple_point_clear_finish,
|
||||
.point_copy = ec_GFp_simple_point_copy,
|
||||
.point_set_to_infinity = ec_GFp_simple_point_set_to_infinity,
|
||||
.point_set_Jprojective_coordinates_GFp =
|
||||
ec_GFp_simple_set_Jprojective_coordinates_GFp,
|
||||
.point_get_Jprojective_coordinates_GFp =
|
||||
ec_GFp_simple_get_Jprojective_coordinates_GFp,
|
||||
.point_set_Jprojective_coordinates =
|
||||
ec_GFp_simple_set_Jprojective_coordinates,
|
||||
.point_get_Jprojective_coordinates =
|
||||
ec_GFp_simple_get_Jprojective_coordinates,
|
||||
.point_set_affine_coordinates =
|
||||
ec_GFp_simple_point_set_affine_coordinates,
|
||||
ec_GFp_simple_point_set_affine_coordinates,
|
||||
.point_get_affine_coordinates =
|
||||
ec_GFp_simple_point_get_affine_coordinates,
|
||||
ec_GFp_simple_point_get_affine_coordinates,
|
||||
.add = ec_GFp_simple_add,
|
||||
.dbl = ec_GFp_simple_dbl,
|
||||
.invert = ec_GFp_simple_invert,
|
||||
@@ -117,7 +118,7 @@ EC_GFp_mont_method(void)
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
int
|
||||
ec_GFp_mont_group_init(EC_GROUP * group)
|
||||
{
|
||||
int ok;
|
||||
@@ -129,7 +130,7 @@ ec_GFp_mont_group_init(EC_GROUP * group)
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
void
|
||||
ec_GFp_mont_group_finish(EC_GROUP * group)
|
||||
{
|
||||
BN_MONT_CTX_free(group->field_data1);
|
||||
@@ -140,7 +141,7 @@ ec_GFp_mont_group_finish(EC_GROUP * group)
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
void
|
||||
ec_GFp_mont_group_clear_finish(EC_GROUP * group)
|
||||
{
|
||||
BN_MONT_CTX_free(group->field_data1);
|
||||
@@ -151,7 +152,7 @@ ec_GFp_mont_group_clear_finish(EC_GROUP * group)
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
int
|
||||
ec_GFp_mont_group_copy(EC_GROUP * dest, const EC_GROUP * src)
|
||||
{
|
||||
BN_MONT_CTX_free(dest->field_data1);
|
||||
@@ -185,7 +186,7 @@ ec_GFp_mont_group_copy(EC_GROUP * dest, const EC_GROUP * src)
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
int
|
||||
ec_GFp_mont_group_set_curve(EC_GROUP *group, const BIGNUM *p, const BIGNUM *a,
|
||||
const BIGNUM *b, BN_CTX *ctx)
|
||||
{
|
||||
@@ -237,7 +238,7 @@ ec_GFp_mont_group_set_curve(EC_GROUP *group, const BIGNUM *p, const BIGNUM *a,
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
int
|
||||
ec_GFp_mont_field_mul(const EC_GROUP *group, BIGNUM *r, const BIGNUM *a,
|
||||
const BIGNUM *b, BN_CTX *ctx)
|
||||
{
|
||||
@@ -249,7 +250,7 @@ ec_GFp_mont_field_mul(const EC_GROUP *group, BIGNUM *r, const BIGNUM *a,
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
int
|
||||
ec_GFp_mont_field_sqr(const EC_GROUP *group, BIGNUM *r, const BIGNUM *a,
|
||||
BN_CTX *ctx)
|
||||
{
|
||||
@@ -261,7 +262,7 @@ ec_GFp_mont_field_sqr(const EC_GROUP *group, BIGNUM *r, const BIGNUM *a,
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
int
|
||||
ec_GFp_mont_field_encode(const EC_GROUP *group, BIGNUM *r, const BIGNUM *a,
|
||||
BN_CTX *ctx)
|
||||
{
|
||||
@@ -273,7 +274,7 @@ ec_GFp_mont_field_encode(const EC_GROUP *group, BIGNUM *r, const BIGNUM *a,
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
int
|
||||
ec_GFp_mont_field_decode(const EC_GROUP *group, BIGNUM *r, const BIGNUM *a,
|
||||
BN_CTX *ctx)
|
||||
{
|
||||
@@ -285,7 +286,7 @@ ec_GFp_mont_field_decode(const EC_GROUP *group, BIGNUM *r, const BIGNUM *a,
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
int
|
||||
ec_GFp_mont_field_set_to_one(const EC_GROUP *group, BIGNUM *r, BN_CTX *ctx)
|
||||
{
|
||||
if (group->field_data2 == NULL) {
|
||||
|
Reference in New Issue
Block a user