summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/ec/ecp_nistp224.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/ec/ecp_nistp224.c')
-rw-r--r--src/lib/libcrypto/ec/ecp_nistp224.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/lib/libcrypto/ec/ecp_nistp224.c b/src/lib/libcrypto/ec/ecp_nistp224.c
index 9ef9dc3585..70944c463d 100644
--- a/src/lib/libcrypto/ec/ecp_nistp224.c
+++ b/src/lib/libcrypto/ec/ecp_nistp224.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ecp_nistp224.c,v 1.27 2021/09/08 17:29:21 tb Exp $ */ 1/* $OpenBSD: ecp_nistp224.c,v 1.28 2022/11/19 07:29:29 tb Exp $ */
2/* 2/*
3 * Written by Emilia Kasper (Google) for the OpenSSL project. 3 * Written by Emilia Kasper (Google) for the OpenSSL project.
4 */ 4 */
@@ -302,7 +302,7 @@ felem_to_bin28(u8 out[28], const felem in)
302 302
303/* To preserve endianness when using BN_bn2bin and BN_bin2bn */ 303/* To preserve endianness when using BN_bn2bin and BN_bin2bn */
304static void 304static void
305flip_endian(u8 * out, const u8 * in, unsigned len) 305flip_endian(u8 *out, const u8 *in, unsigned len)
306{ 306{
307 unsigned i; 307 unsigned i;
308 for (i = 0; i < len; ++i) 308 for (i = 0; i < len; ++i)
@@ -311,7 +311,7 @@ flip_endian(u8 * out, const u8 * in, unsigned len)
311 311
312/* From OpenSSL BIGNUM to internal representation */ 312/* From OpenSSL BIGNUM to internal representation */
313static int 313static int
314BN_to_felem(felem out, const BIGNUM * bn) 314BN_to_felem(felem out, const BIGNUM *bn)
315{ 315{
316 felem_bytearray b_in; 316 felem_bytearray b_in;
317 felem_bytearray b_out; 317 felem_bytearray b_out;
@@ -336,7 +336,7 @@ BN_to_felem(felem out, const BIGNUM * bn)
336 336
337/* From internal representation to OpenSSL BIGNUM */ 337/* From internal representation to OpenSSL BIGNUM */
338static BIGNUM * 338static BIGNUM *
339felem_to_BN(BIGNUM * out, const felem in) 339felem_to_BN(BIGNUM *out, const felem in)
340{ 340{
341 felem_bytearray b_in, b_out; 341 felem_bytearray b_in, b_out;
342 felem_to_bin28(b_in, in); 342 felem_to_bin28(b_in, in);
@@ -1249,7 +1249,7 @@ nistp224_pre_comp_clear_free(void *pre_)
1249 */ 1249 */
1250 1250
1251int 1251int
1252ec_GFp_nistp224_group_init(EC_GROUP * group) 1252ec_GFp_nistp224_group_init(EC_GROUP *group)
1253{ 1253{
1254 int ret; 1254 int ret;
1255 ret = ec_GFp_simple_group_init(group); 1255 ret = ec_GFp_simple_group_init(group);
@@ -1258,8 +1258,8 @@ ec_GFp_nistp224_group_init(EC_GROUP * group)
1258} 1258}
1259 1259
1260int 1260int
1261ec_GFp_nistp224_group_set_curve(EC_GROUP * group, const BIGNUM * p, 1261ec_GFp_nistp224_group_set_curve(EC_GROUP *group, const BIGNUM *p,
1262 const BIGNUM * a, const BIGNUM * b, BN_CTX * ctx) 1262 const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx)
1263{ 1263{
1264 int ret = 0; 1264 int ret = 0;
1265 BN_CTX *new_ctx = NULL; 1265 BN_CTX *new_ctx = NULL;
@@ -1292,8 +1292,8 @@ ec_GFp_nistp224_group_set_curve(EC_GROUP * group, const BIGNUM * p,
1292/* Takes the Jacobian coordinates (X, Y, Z) of a point and returns 1292/* Takes the Jacobian coordinates (X, Y, Z) of a point and returns
1293 * (X', Y') = (X/Z^2, Y/Z^3) */ 1293 * (X', Y') = (X/Z^2, Y/Z^3) */
1294int 1294int
1295ec_GFp_nistp224_point_get_affine_coordinates(const EC_GROUP * group, 1295ec_GFp_nistp224_point_get_affine_coordinates(const EC_GROUP *group,
1296 const EC_POINT * point, BIGNUM * x, BIGNUM * y, BN_CTX * ctx) 1296 const EC_POINT *point, BIGNUM *x, BIGNUM *y, BN_CTX *ctx)
1297{ 1297{
1298 felem z1, z2, x_in, y_in, x_out, y_out; 1298 felem z1, z2, x_in, y_in, x_out, y_out;
1299 widefelem tmp; 1299 widefelem tmp;
@@ -1355,9 +1355,9 @@ make_points_affine(size_t num, felem points[ /* num */ ][3], felem tmp_felems[ /
1355/* Computes scalar*generator + \sum scalars[i]*points[i], ignoring NULL values 1355/* Computes scalar*generator + \sum scalars[i]*points[i], ignoring NULL values
1356 * Result is stored in r (r can equal one of the inputs). */ 1356 * Result is stored in r (r can equal one of the inputs). */
1357int 1357int
1358ec_GFp_nistp224_points_mul(const EC_GROUP * group, EC_POINT * r, 1358ec_GFp_nistp224_points_mul(const EC_GROUP *group, EC_POINT *r,
1359 const BIGNUM * scalar, size_t num, const EC_POINT * points[], 1359 const BIGNUM *scalar, size_t num, const EC_POINT *points[],
1360 const BIGNUM * scalars[], BN_CTX * ctx) 1360 const BIGNUM *scalars[], BN_CTX *ctx)
1361{ 1361{
1362 int ret = 0; 1362 int ret = 0;
1363 int j; 1363 int j;
@@ -1550,7 +1550,7 @@ ec_GFp_nistp224_points_mul(const EC_GROUP * group, EC_POINT * r,
1550} 1550}
1551 1551
1552int 1552int
1553ec_GFp_nistp224_precompute_mult(EC_GROUP * group, BN_CTX * ctx) 1553ec_GFp_nistp224_precompute_mult(EC_GROUP *group, BN_CTX *ctx)
1554{ 1554{
1555 int ret = 0; 1555 int ret = 0;
1556 NISTP224_PRE_COMP *pre = NULL; 1556 NISTP224_PRE_COMP *pre = NULL;
@@ -1677,7 +1677,7 @@ ec_GFp_nistp224_precompute_mult(EC_GROUP * group, BN_CTX * ctx)
1677} 1677}
1678 1678
1679int 1679int
1680ec_GFp_nistp224_have_precompute_mult(const EC_GROUP * group) 1680ec_GFp_nistp224_have_precompute_mult(const EC_GROUP *group)
1681{ 1681{
1682 if (EC_EX_DATA_get_data(group->extra_data, nistp224_pre_comp_dup, 1682 if (EC_EX_DATA_get_data(group->extra_data, nistp224_pre_comp_dup,
1683 nistp224_pre_comp_free, nistp224_pre_comp_clear_free) 1683 nistp224_pre_comp_free, nistp224_pre_comp_clear_free)