summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/ec/ec_lib.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/ec/ec_lib.c')
-rw-r--r--src/lib/libcrypto/ec/ec_lib.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/lib/libcrypto/ec/ec_lib.c b/src/lib/libcrypto/ec/ec_lib.c
index 2d14f9c9c5..38ddd7af9f 100644
--- a/src/lib/libcrypto/ec/ec_lib.c
+++ b/src/lib/libcrypto/ec/ec_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ec_lib.c,v 1.51 2023/03/08 06:47:30 jsing Exp $ */ 1/* $OpenBSD: ec_lib.c,v 1.52 2023/03/27 10:25:02 tb Exp $ */
2/* 2/*
3 * Originally written by Bodo Moeller for the OpenSSL project. 3 * Originally written by Bodo Moeller for the OpenSSL project.
4 */ 4 */
@@ -181,9 +181,9 @@ EC_GROUP_copy(EC_GROUP *dest, const EC_GROUP *src)
181 dest->generator = NULL; 181 dest->generator = NULL;
182 } 182 }
183 183
184 if (!BN_copy(&dest->order, &src->order)) 184 if (!bn_copy(&dest->order, &src->order))
185 return 0; 185 return 0;
186 if (!BN_copy(&dest->cofactor, &src->cofactor)) 186 if (!bn_copy(&dest->cofactor, &src->cofactor))
187 return 0; 187 return 0;
188 188
189 dest->curve_name = src->curve_name; 189 dest->curve_name = src->curve_name;
@@ -279,7 +279,7 @@ ec_guess_cofactor(EC_GROUP *group)
279 if (!BN_set_bit(q, BN_num_bits(&group->field) - 1)) 279 if (!BN_set_bit(q, BN_num_bits(&group->field) - 1))
280 goto err; 280 goto err;
281 } else { 281 } else {
282 if (!BN_copy(q, &group->field)) 282 if (!bn_copy(q, &group->field))
283 goto err; 283 goto err;
284 } 284 }
285 285
@@ -357,12 +357,12 @@ EC_GROUP_set_generator(EC_GROUP *group, const EC_POINT *generator,
357 if (!EC_POINT_copy(group->generator, generator)) 357 if (!EC_POINT_copy(group->generator, generator))
358 return 0; 358 return 0;
359 359
360 if (!BN_copy(&group->order, order)) 360 if (!bn_copy(&group->order, order))
361 return 0; 361 return 0;
362 362
363 /* Either take the provided positive cofactor, or try to compute it. */ 363 /* Either take the provided positive cofactor, or try to compute it. */
364 if (cofactor != NULL && !BN_is_zero(cofactor)) { 364 if (cofactor != NULL && !BN_is_zero(cofactor)) {
365 if (!BN_copy(&group->cofactor, cofactor)) 365 if (!bn_copy(&group->cofactor, cofactor))
366 return 0; 366 return 0;
367 } else if (!ec_guess_cofactor(group)) 367 } else if (!ec_guess_cofactor(group))
368 return 0; 368 return 0;
@@ -387,7 +387,7 @@ EC_GROUP_get0_generator(const EC_GROUP *group)
387int 387int
388EC_GROUP_get_order(const EC_GROUP *group, BIGNUM *order, BN_CTX *ctx) 388EC_GROUP_get_order(const EC_GROUP *group, BIGNUM *order, BN_CTX *ctx)
389{ 389{
390 if (!BN_copy(order, &group->order)) 390 if (!bn_copy(order, &group->order))
391 return 0; 391 return 0;
392 392
393 return !BN_is_zero(order); 393 return !BN_is_zero(order);
@@ -402,7 +402,7 @@ EC_GROUP_order_bits(const EC_GROUP *group)
402int 402int
403EC_GROUP_get_cofactor(const EC_GROUP *group, BIGNUM *cofactor, BN_CTX *ctx) 403EC_GROUP_get_cofactor(const EC_GROUP *group, BIGNUM *cofactor, BN_CTX *ctx)
404{ 404{
405 if (!BN_copy(cofactor, &group->cofactor)) 405 if (!bn_copy(cofactor, &group->cofactor))
406 return 0; 406 return 0;
407 407
408 return !BN_is_zero(&group->cofactor); 408 return !BN_is_zero(&group->cofactor);