diff options
Diffstat (limited to 'src/lib/libcrypto/ec/ec2_smpl.c')
-rw-r--r-- | src/lib/libcrypto/ec/ec2_smpl.c | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/src/lib/libcrypto/ec/ec2_smpl.c b/src/lib/libcrypto/ec/ec2_smpl.c index 84cba1b83b..1ad339cbd7 100644 --- a/src/lib/libcrypto/ec/ec2_smpl.c +++ b/src/lib/libcrypto/ec/ec2_smpl.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ec2_smpl.c,v 1.33 2023/03/08 05:45:31 jsing Exp $ */ | 1 | /* $OpenBSD: ec2_smpl.c,v 1.34 2023/03/27 10:25:02 tb Exp $ */ |
2 | /* ==================================================================== | 2 | /* ==================================================================== |
3 | * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. | 3 | * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. |
4 | * | 4 | * |
@@ -115,11 +115,11 @@ ec_GF2m_simple_group_copy(EC_GROUP *dest, const EC_GROUP *src) | |||
115 | { | 115 | { |
116 | int i; | 116 | int i; |
117 | 117 | ||
118 | if (!BN_copy(&dest->field, &src->field)) | 118 | if (!bn_copy(&dest->field, &src->field)) |
119 | return 0; | 119 | return 0; |
120 | if (!BN_copy(&dest->a, &src->a)) | 120 | if (!bn_copy(&dest->a, &src->a)) |
121 | return 0; | 121 | return 0; |
122 | if (!BN_copy(&dest->b, &src->b)) | 122 | if (!bn_copy(&dest->b, &src->b)) |
123 | return 0; | 123 | return 0; |
124 | dest->poly[0] = src->poly[0]; | 124 | dest->poly[0] = src->poly[0]; |
125 | dest->poly[1] = src->poly[1]; | 125 | dest->poly[1] = src->poly[1]; |
@@ -146,7 +146,7 @@ ec_GF2m_simple_group_set_curve(EC_GROUP *group, | |||
146 | int ret = 0, i; | 146 | int ret = 0, i; |
147 | 147 | ||
148 | /* group->field */ | 148 | /* group->field */ |
149 | if (!BN_copy(&group->field, p)) | 149 | if (!bn_copy(&group->field, p)) |
150 | goto err; | 150 | goto err; |
151 | i = BN_GF2m_poly2arr(&group->field, group->poly, 6) - 1; | 151 | i = BN_GF2m_poly2arr(&group->field, group->poly, 6) - 1; |
152 | if ((i != 5) && (i != 3)) { | 152 | if ((i != 5) && (i != 3)) { |
@@ -185,15 +185,15 @@ ec_GF2m_simple_group_get_curve(const EC_GROUP *group, | |||
185 | int ret = 0; | 185 | int ret = 0; |
186 | 186 | ||
187 | if (p != NULL) { | 187 | if (p != NULL) { |
188 | if (!BN_copy(p, &group->field)) | 188 | if (!bn_copy(p, &group->field)) |
189 | return 0; | 189 | return 0; |
190 | } | 190 | } |
191 | if (a != NULL) { | 191 | if (a != NULL) { |
192 | if (!BN_copy(a, &group->a)) | 192 | if (!bn_copy(a, &group->a)) |
193 | goto err; | 193 | goto err; |
194 | } | 194 | } |
195 | if (b != NULL) { | 195 | if (b != NULL) { |
196 | if (!BN_copy(b, &group->b)) | 196 | if (!bn_copy(b, &group->b)) |
197 | goto err; | 197 | goto err; |
198 | } | 198 | } |
199 | ret = 1; | 199 | ret = 1; |
@@ -274,11 +274,11 @@ ec_GF2m_simple_point_finish(EC_POINT *point) | |||
274 | static int | 274 | static int |
275 | ec_GF2m_simple_point_copy(EC_POINT *dest, const EC_POINT *src) | 275 | ec_GF2m_simple_point_copy(EC_POINT *dest, const EC_POINT *src) |
276 | { | 276 | { |
277 | if (!BN_copy(&dest->X, &src->X)) | 277 | if (!bn_copy(&dest->X, &src->X)) |
278 | return 0; | 278 | return 0; |
279 | if (!BN_copy(&dest->Y, &src->Y)) | 279 | if (!bn_copy(&dest->Y, &src->Y)) |
280 | return 0; | 280 | return 0; |
281 | if (!BN_copy(&dest->Z, &src->Z)) | 281 | if (!bn_copy(&dest->Z, &src->Z)) |
282 | return 0; | 282 | return 0; |
283 | dest->Z_is_one = src->Z_is_one; | 283 | dest->Z_is_one = src->Z_is_one; |
284 | 284 | ||
@@ -310,13 +310,13 @@ ec_GF2m_simple_point_set_affine_coordinates(const EC_GROUP *group, EC_POINT *poi | |||
310 | ECerror(ERR_R_PASSED_NULL_PARAMETER); | 310 | ECerror(ERR_R_PASSED_NULL_PARAMETER); |
311 | return 0; | 311 | return 0; |
312 | } | 312 | } |
313 | if (!BN_copy(&point->X, x)) | 313 | if (!bn_copy(&point->X, x)) |
314 | goto err; | 314 | goto err; |
315 | BN_set_negative(&point->X, 0); | 315 | BN_set_negative(&point->X, 0); |
316 | if (!BN_copy(&point->Y, y)) | 316 | if (!bn_copy(&point->Y, y)) |
317 | goto err; | 317 | goto err; |
318 | BN_set_negative(&point->Y, 0); | 318 | BN_set_negative(&point->Y, 0); |
319 | if (!BN_copy(&point->Z, BN_value_one())) | 319 | if (!bn_copy(&point->Z, BN_value_one())) |
320 | goto err; | 320 | goto err; |
321 | BN_set_negative(&point->Z, 0); | 321 | BN_set_negative(&point->Z, 0); |
322 | point->Z_is_one = 1; | 322 | point->Z_is_one = 1; |
@@ -345,12 +345,12 @@ ec_GF2m_simple_point_get_affine_coordinates(const EC_GROUP *group, | |||
345 | return 0; | 345 | return 0; |
346 | } | 346 | } |
347 | if (x != NULL) { | 347 | if (x != NULL) { |
348 | if (!BN_copy(x, &point->X)) | 348 | if (!bn_copy(x, &point->X)) |
349 | goto err; | 349 | goto err; |
350 | BN_set_negative(x, 0); | 350 | BN_set_negative(x, 0); |
351 | } | 351 | } |
352 | if (y != NULL) { | 352 | if (y != NULL) { |
353 | if (!BN_copy(y, &point->Y)) | 353 | if (!bn_copy(y, &point->Y)) |
354 | goto err; | 354 | goto err; |
355 | BN_set_negative(y, 0); | 355 | BN_set_negative(y, 0); |
356 | } | 356 | } |
@@ -406,18 +406,18 @@ ec_GF2m_simple_add(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a, | |||
406 | goto err; | 406 | goto err; |
407 | 407 | ||
408 | if (a->Z_is_one) { | 408 | if (a->Z_is_one) { |
409 | if (!BN_copy(x0, &a->X)) | 409 | if (!bn_copy(x0, &a->X)) |
410 | goto err; | 410 | goto err; |
411 | if (!BN_copy(y0, &a->Y)) | 411 | if (!bn_copy(y0, &a->Y)) |
412 | goto err; | 412 | goto err; |
413 | } else { | 413 | } else { |
414 | if (!EC_POINT_get_affine_coordinates(group, a, x0, y0, ctx)) | 414 | if (!EC_POINT_get_affine_coordinates(group, a, x0, y0, ctx)) |
415 | goto err; | 415 | goto err; |
416 | } | 416 | } |
417 | if (b->Z_is_one) { | 417 | if (b->Z_is_one) { |
418 | if (!BN_copy(x1, &b->X)) | 418 | if (!bn_copy(x1, &b->X)) |
419 | goto err; | 419 | goto err; |
420 | if (!BN_copy(y1, &b->Y)) | 420 | if (!bn_copy(y1, &b->Y)) |
421 | goto err; | 421 | goto err; |
422 | } else { | 422 | } else { |
423 | if (!EC_POINT_get_affine_coordinates(group, b, x1, y1, ctx)) | 423 | if (!EC_POINT_get_affine_coordinates(group, b, x1, y1, ctx)) |
@@ -647,9 +647,9 @@ ec_GF2m_simple_make_affine(const EC_GROUP *group, EC_POINT *point, BN_CTX *ctx) | |||
647 | 647 | ||
648 | if (!EC_POINT_get_affine_coordinates(group, point, x, y, ctx)) | 648 | if (!EC_POINT_get_affine_coordinates(group, point, x, y, ctx)) |
649 | goto err; | 649 | goto err; |
650 | if (!BN_copy(&point->X, x)) | 650 | if (!bn_copy(&point->X, x)) |
651 | goto err; | 651 | goto err; |
652 | if (!BN_copy(&point->Y, y)) | 652 | if (!bn_copy(&point->Y, y)) |
653 | goto err; | 653 | goto err; |
654 | if (!BN_one(&point->Z)) | 654 | if (!BN_one(&point->Z)) |
655 | goto err; | 655 | goto err; |