diff options
| author | jmc <> | 2022-12-26 07:18:53 +0000 |
|---|---|---|
| committer | jmc <> | 2022-12-26 07:18:53 +0000 |
| commit | 2eb7e5ff6bb69760f9dd4a43e7e3520ebb930120 (patch) | |
| tree | 26f3d93398833b7449b8a97e9fe4af9904382dbf /src/lib/libcrypto/ec | |
| parent | df59a12113ba6ec4c6faecd033d46176453f697e (diff) | |
| download | openbsd-2eb7e5ff6bb69760f9dd4a43e7e3520ebb930120.tar.gz openbsd-2eb7e5ff6bb69760f9dd4a43e7e3520ebb930120.tar.bz2 openbsd-2eb7e5ff6bb69760f9dd4a43e7e3520ebb930120.zip | |
spelling fixes; from paul tagliamonte
i removed the arithmetics -> arithmetic changes, as i felt they
were not clearly correct
ok tb
Diffstat (limited to 'src/lib/libcrypto/ec')
| -rw-r--r-- | src/lib/libcrypto/ec/asm/ecp_nistz256-armv4.pl | 6 | ||||
| -rw-r--r-- | src/lib/libcrypto/ec/asm/ecp_nistz256-sparcv9.pl | 6 | ||||
| -rw-r--r-- | src/lib/libcrypto/ec/ec.h | 58 | ||||
| -rw-r--r-- | src/lib/libcrypto/ec/ecp_nistp224.c | 4 | ||||
| -rw-r--r-- | src/lib/libcrypto/ec/ecp_nistp256.c | 4 | ||||
| -rw-r--r-- | src/lib/libcrypto/ec/ecp_nistp521.c | 6 |
6 files changed, 42 insertions, 42 deletions
diff --git a/src/lib/libcrypto/ec/asm/ecp_nistz256-armv4.pl b/src/lib/libcrypto/ec/asm/ecp_nistz256-armv4.pl index f3205d673a..9e6c65905f 100644 --- a/src/lib/libcrypto/ec/asm/ecp_nistz256-armv4.pl +++ b/src/lib/libcrypto/ec/asm/ecp_nistz256-armv4.pl | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | #! /usr/bin/env perl | 1 | #! /usr/bin/env perl |
| 2 | # $OpenBSD: ecp_nistz256-armv4.pl,v 1.1 2016/11/04 17:33:19 miod Exp $ | 2 | # $OpenBSD: ecp_nistz256-armv4.pl,v 1.2 2022/12/26 07:18:51 jmc Exp $ |
| 3 | # | 3 | # |
| 4 | # Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved. | 4 | # Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved. |
| 5 | # | 5 | # |
| @@ -179,7 +179,7 @@ __ecp_nistz256_add: | |||
| 179 | @ if a+b >= modulus, subtract modulus. | 179 | @ if a+b >= modulus, subtract modulus. |
| 180 | @ | 180 | @ |
| 181 | @ But since comparison implies subtraction, we subtract | 181 | @ But since comparison implies subtraction, we subtract |
| 182 | @ modulus and then add it back if subraction borrowed. | 182 | @ modulus and then add it back if subtraction borrowed. |
| 183 | 183 | ||
| 184 | subs $a0,$a0,#-1 | 184 | subs $a0,$a0,#-1 |
| 185 | sbcs $a1,$a1,#-1 | 185 | sbcs $a1,$a1,#-1 |
| @@ -1090,7 +1090,7 @@ __ecp_nistz256_add_self: | |||
| 1090 | @ if a+b >= modulus, subtract modulus. | 1090 | @ if a+b >= modulus, subtract modulus. |
| 1091 | @ | 1091 | @ |
| 1092 | @ But since comparison implies subtraction, we subtract | 1092 | @ But since comparison implies subtraction, we subtract |
| 1093 | @ modulus and then add it back if subraction borrowed. | 1093 | @ modulus and then add it back if subtraction borrowed. |
| 1094 | 1094 | ||
| 1095 | subs $a0,$a0,#-1 | 1095 | subs $a0,$a0,#-1 |
| 1096 | sbcs $a1,$a1,#-1 | 1096 | sbcs $a1,$a1,#-1 |
diff --git a/src/lib/libcrypto/ec/asm/ecp_nistz256-sparcv9.pl b/src/lib/libcrypto/ec/asm/ecp_nistz256-sparcv9.pl index 044eb457b6..49460fefdc 100644 --- a/src/lib/libcrypto/ec/asm/ecp_nistz256-sparcv9.pl +++ b/src/lib/libcrypto/ec/asm/ecp_nistz256-sparcv9.pl | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | #! /usr/bin/env perl | 1 | #! /usr/bin/env perl |
| 2 | # $OpenBSD: ecp_nistz256-sparcv9.pl,v 1.1 2016/11/04 17:33:20 miod Exp $ | 2 | # $OpenBSD: ecp_nistz256-sparcv9.pl,v 1.2 2022/12/26 07:18:51 jmc Exp $ |
| 3 | # | 3 | # |
| 4 | # Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved. | 4 | # Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved. |
| 5 | # | 5 | # |
| @@ -350,7 +350,7 @@ __ecp_nistz256_add: | |||
| 350 | ! if a+b >= modulus, subtract modulus. | 350 | ! if a+b >= modulus, subtract modulus. |
| 351 | ! | 351 | ! |
| 352 | ! But since comparison implies subtraction, we subtract | 352 | ! But since comparison implies subtraction, we subtract |
| 353 | ! modulus and then add it back if subraction borrowed. | 353 | ! modulus and then add it back if subtraction borrowed. |
| 354 | 354 | ||
| 355 | subcc @acc[0],-1,@acc[0] | 355 | subcc @acc[0],-1,@acc[0] |
| 356 | subccc @acc[1],-1,@acc[1] | 356 | subccc @acc[1],-1,@acc[1] |
| @@ -1805,7 +1805,7 @@ $code.=<<___; | |||
| 1805 | srlx $acc0,32,$t1 | 1805 | srlx $acc0,32,$t1 |
| 1806 | addxccc $acc3,$t2,$acc2 ! +=acc[0]*0xFFFFFFFF00000001 | 1806 | addxccc $acc3,$t2,$acc2 ! +=acc[0]*0xFFFFFFFF00000001 |
| 1807 | sub $acc0,$t0,$t2 ! acc0*0xFFFFFFFF00000001, low part | 1807 | sub $acc0,$t0,$t2 ! acc0*0xFFFFFFFF00000001, low part |
| 1808 | addxc %g0,$t3,$acc3 ! cant't overflow | 1808 | addxc %g0,$t3,$acc3 ! can't overflow |
| 1809 | ___ | 1809 | ___ |
| 1810 | } | 1810 | } |
| 1811 | $code.=<<___; | 1811 | $code.=<<___; |
diff --git a/src/lib/libcrypto/ec/ec.h b/src/lib/libcrypto/ec/ec.h index 9a7c5de8a5..8cafc5522f 100644 --- a/src/lib/libcrypto/ec/ec.h +++ b/src/lib/libcrypto/ec/ec.h | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: ec.h,v 1.29 2022/11/10 16:37:51 jsing Exp $ */ | 1 | /* $OpenBSD: ec.h,v 1.30 2022/12/26 07:18:51 jmc 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 | */ |
| @@ -232,7 +232,7 @@ int EC_METHOD_get_field_type(const EC_METHOD *meth); | |||
| 232 | * \param order the order of the group generated by the generator. | 232 | * \param order the order of the group generated by the generator. |
| 233 | * \param cofactor the index of the sub-group generated by the generator | 233 | * \param cofactor the index of the sub-group generated by the generator |
| 234 | * in the group of all points on the elliptic curve. | 234 | * in the group of all points on the elliptic curve. |
| 235 | * \return 1 on success and 0 if an error occured | 235 | * \return 1 on success and 0 if an error occurred |
| 236 | */ | 236 | */ |
| 237 | int EC_GROUP_set_generator(EC_GROUP *group, const EC_POINT *generator, const BIGNUM *order, const BIGNUM *cofactor); | 237 | int EC_GROUP_set_generator(EC_GROUP *group, const EC_POINT *generator, const BIGNUM *order, const BIGNUM *cofactor); |
| 238 | 238 | ||
| @@ -246,7 +246,7 @@ const EC_POINT *EC_GROUP_get0_generator(const EC_GROUP *group); | |||
| 246 | * \param group EC_GROUP object | 246 | * \param group EC_GROUP object |
| 247 | * \param order BIGNUM to which the order is copied | 247 | * \param order BIGNUM to which the order is copied |
| 248 | * \param ctx BN_CTX object (optional) | 248 | * \param ctx BN_CTX object (optional) |
| 249 | * \return 1 on success and 0 if an error occured | 249 | * \return 1 on success and 0 if an error occurred |
| 250 | */ | 250 | */ |
| 251 | int EC_GROUP_get_order(const EC_GROUP *group, BIGNUM *order, BN_CTX *ctx); | 251 | int EC_GROUP_get_order(const EC_GROUP *group, BIGNUM *order, BN_CTX *ctx); |
| 252 | 252 | ||
| @@ -256,7 +256,7 @@ int EC_GROUP_order_bits(const EC_GROUP *group); | |||
| 256 | * \param group EC_GROUP object | 256 | * \param group EC_GROUP object |
| 257 | * \param cofactor BIGNUM to which the cofactor is copied | 257 | * \param cofactor BIGNUM to which the cofactor is copied |
| 258 | * \param ctx BN_CTX object (optional) | 258 | * \param ctx BN_CTX object (optional) |
| 259 | * \return 1 on success and 0 if an error occured | 259 | * \return 1 on success and 0 if an error occurred |
| 260 | */ | 260 | */ |
| 261 | int EC_GROUP_get_cofactor(const EC_GROUP *group, BIGNUM *cofactor, BN_CTX *ctx); | 261 | int EC_GROUP_get_cofactor(const EC_GROUP *group, BIGNUM *cofactor, BN_CTX *ctx); |
| 262 | 262 | ||
| @@ -293,7 +293,7 @@ int EC_GROUP_get_curve(const EC_GROUP *group, BIGNUM *p, BIGNUM *a, BIGNUM *b, | |||
| 293 | * \param a BIGNUM with parameter a of the equation | 293 | * \param a BIGNUM with parameter a of the equation |
| 294 | * \param b BIGNUM with parameter b of the equation | 294 | * \param b BIGNUM with parameter b of the equation |
| 295 | * \param ctx BN_CTX object (optional) | 295 | * \param ctx BN_CTX object (optional) |
| 296 | * \return 1 on success and 0 if an error occured | 296 | * \return 1 on success and 0 if an error occurred |
| 297 | */ | 297 | */ |
| 298 | int EC_GROUP_set_curve_GFp(EC_GROUP *group, const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx); | 298 | int EC_GROUP_set_curve_GFp(EC_GROUP *group, const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx); |
| 299 | 299 | ||
| @@ -303,7 +303,7 @@ int EC_GROUP_set_curve_GFp(EC_GROUP *group, const BIGNUM *p, const BIGNUM *a, co | |||
| 303 | * \param a BIGNUM for parameter a of the equation | 303 | * \param a BIGNUM for parameter a of the equation |
| 304 | * \param b BIGNUM for parameter b of the equation | 304 | * \param b BIGNUM for parameter b of the equation |
| 305 | * \param ctx BN_CTX object (optional) | 305 | * \param ctx BN_CTX object (optional) |
| 306 | * \return 1 on success and 0 if an error occured | 306 | * \return 1 on success and 0 if an error occurred |
| 307 | */ | 307 | */ |
| 308 | int EC_GROUP_get_curve_GFp(const EC_GROUP *group, BIGNUM *p, BIGNUM *a, BIGNUM *b, BN_CTX *ctx); | 308 | int EC_GROUP_get_curve_GFp(const EC_GROUP *group, BIGNUM *p, BIGNUM *a, BIGNUM *b, BN_CTX *ctx); |
| 309 | 309 | ||
| @@ -314,7 +314,7 @@ int EC_GROUP_get_curve_GFp(const EC_GROUP *group, BIGNUM *p, BIGNUM *a, BIGNUM * | |||
| 314 | * \param a BIGNUM with parameter a of the equation | 314 | * \param a BIGNUM with parameter a of the equation |
| 315 | * \param b BIGNUM with parameter b of the equation | 315 | * \param b BIGNUM with parameter b of the equation |
| 316 | * \param ctx BN_CTX object (optional) | 316 | * \param ctx BN_CTX object (optional) |
| 317 | * \return 1 on success and 0 if an error occured | 317 | * \return 1 on success and 0 if an error occurred |
| 318 | */ | 318 | */ |
| 319 | int EC_GROUP_set_curve_GF2m(EC_GROUP *group, const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx); | 319 | int EC_GROUP_set_curve_GF2m(EC_GROUP *group, const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx); |
| 320 | 320 | ||
| @@ -324,7 +324,7 @@ int EC_GROUP_set_curve_GF2m(EC_GROUP *group, const BIGNUM *p, const BIGNUM *a, c | |||
| 324 | * \param a BIGNUM for parameter a of the equation | 324 | * \param a BIGNUM for parameter a of the equation |
| 325 | * \param b BIGNUM for parameter b of the equation | 325 | * \param b BIGNUM for parameter b of the equation |
| 326 | * \param ctx BN_CTX object (optional) | 326 | * \param ctx BN_CTX object (optional) |
| 327 | * \return 1 on success and 0 if an error occured | 327 | * \return 1 on success and 0 if an error occurred |
| 328 | */ | 328 | */ |
| 329 | int EC_GROUP_get_curve_GF2m(const EC_GROUP *group, BIGNUM *p, BIGNUM *a, BIGNUM *b, BN_CTX *ctx); | 329 | int EC_GROUP_get_curve_GF2m(const EC_GROUP *group, BIGNUM *p, BIGNUM *a, BIGNUM *b, BN_CTX *ctx); |
| 330 | #endif | 330 | #endif |
| @@ -430,7 +430,7 @@ void EC_POINT_clear_free(EC_POINT *point); | |||
| 430 | /** Copies EC_POINT object | 430 | /** Copies EC_POINT object |
| 431 | * \param dst destination EC_POINT object | 431 | * \param dst destination EC_POINT object |
| 432 | * \param src source EC_POINT object | 432 | * \param src source EC_POINT object |
| 433 | * \return 1 on success and 0 if an error occured | 433 | * \return 1 on success and 0 if an error occurred |
| 434 | */ | 434 | */ |
| 435 | int EC_POINT_copy(EC_POINT *dst, const EC_POINT *src); | 435 | int EC_POINT_copy(EC_POINT *dst, const EC_POINT *src); |
| 436 | 436 | ||
| @@ -451,7 +451,7 @@ const EC_METHOD *EC_POINT_method_of(const EC_POINT *point); | |||
| 451 | /** Sets a point to infinity (neutral element) | 451 | /** Sets a point to infinity (neutral element) |
| 452 | * \param group underlying EC_GROUP object | 452 | * \param group underlying EC_GROUP object |
| 453 | * \param point EC_POINT to set to infinity | 453 | * \param point EC_POINT to set to infinity |
| 454 | * \return 1 on success and 0 if an error occured | 454 | * \return 1 on success and 0 if an error occurred |
| 455 | */ | 455 | */ |
| 456 | int EC_POINT_set_to_infinity(const EC_GROUP *group, EC_POINT *point); | 456 | int EC_POINT_set_to_infinity(const EC_GROUP *group, EC_POINT *point); |
| 457 | 457 | ||
| @@ -478,7 +478,7 @@ int EC_POINT_get_Jprojective_coordinates(const EC_GROUP *group, | |||
| 478 | * \param y BIGNUM with the y-coordinate | 478 | * \param y BIGNUM with the y-coordinate |
| 479 | * \param z BIGNUM with the z-coordinate | 479 | * \param z BIGNUM with the z-coordinate |
| 480 | * \param ctx BN_CTX object (optional) | 480 | * \param ctx BN_CTX object (optional) |
| 481 | * \return 1 on success and 0 if an error occured | 481 | * \return 1 on success and 0 if an error occurred |
| 482 | */ | 482 | */ |
| 483 | int EC_POINT_set_Jprojective_coordinates_GFp(const EC_GROUP *group, EC_POINT *p, | 483 | int EC_POINT_set_Jprojective_coordinates_GFp(const EC_GROUP *group, EC_POINT *p, |
| 484 | const BIGNUM *x, const BIGNUM *y, const BIGNUM *z, BN_CTX *ctx); | 484 | const BIGNUM *x, const BIGNUM *y, const BIGNUM *z, BN_CTX *ctx); |
| @@ -490,7 +490,7 @@ int EC_POINT_set_Jprojective_coordinates_GFp(const EC_GROUP *group, EC_POINT *p, | |||
| 490 | * \param y BIGNUM for the y-coordinate | 490 | * \param y BIGNUM for the y-coordinate |
| 491 | * \param z BIGNUM for the z-coordinate | 491 | * \param z BIGNUM for the z-coordinate |
| 492 | * \param ctx BN_CTX object (optional) | 492 | * \param ctx BN_CTX object (optional) |
| 493 | * \return 1 on success and 0 if an error occured | 493 | * \return 1 on success and 0 if an error occurred |
| 494 | */ | 494 | */ |
| 495 | int EC_POINT_get_Jprojective_coordinates_GFp(const EC_GROUP *group, | 495 | int EC_POINT_get_Jprojective_coordinates_GFp(const EC_GROUP *group, |
| 496 | const EC_POINT *p, BIGNUM *x, BIGNUM *y, BIGNUM *z, BN_CTX *ctx); | 496 | const EC_POINT *p, BIGNUM *x, BIGNUM *y, BIGNUM *z, BN_CTX *ctx); |
| @@ -501,7 +501,7 @@ int EC_POINT_get_Jprojective_coordinates_GFp(const EC_GROUP *group, | |||
| 501 | * \param x BIGNUM with the x-coordinate | 501 | * \param x BIGNUM with the x-coordinate |
| 502 | * \param y BIGNUM with the y-coordinate | 502 | * \param y BIGNUM with the y-coordinate |
| 503 | * \param ctx BN_CTX object (optional) | 503 | * \param ctx BN_CTX object (optional) |
| 504 | * \return 1 on success and 0 if an error occured | 504 | * \return 1 on success and 0 if an error occurred |
| 505 | */ | 505 | */ |
| 506 | int EC_POINT_set_affine_coordinates_GFp(const EC_GROUP *group, EC_POINT *p, | 506 | int EC_POINT_set_affine_coordinates_GFp(const EC_GROUP *group, EC_POINT *p, |
| 507 | const BIGNUM *x, const BIGNUM *y, BN_CTX *ctx); | 507 | const BIGNUM *x, const BIGNUM *y, BN_CTX *ctx); |
| @@ -512,7 +512,7 @@ int EC_POINT_set_affine_coordinates_GFp(const EC_GROUP *group, EC_POINT *p, | |||
| 512 | * \param x BIGNUM for the x-coordinate | 512 | * \param x BIGNUM for the x-coordinate |
| 513 | * \param y BIGNUM for the y-coordinate | 513 | * \param y BIGNUM for the y-coordinate |
| 514 | * \param ctx BN_CTX object (optional) | 514 | * \param ctx BN_CTX object (optional) |
| 515 | * \return 1 on success and 0 if an error occured | 515 | * \return 1 on success and 0 if an error occurred |
| 516 | */ | 516 | */ |
| 517 | int EC_POINT_get_affine_coordinates_GFp(const EC_GROUP *group, | 517 | int EC_POINT_get_affine_coordinates_GFp(const EC_GROUP *group, |
| 518 | const EC_POINT *p, BIGNUM *x, BIGNUM *y, BN_CTX *ctx); | 518 | const EC_POINT *p, BIGNUM *x, BIGNUM *y, BN_CTX *ctx); |
| @@ -523,7 +523,7 @@ int EC_POINT_get_affine_coordinates_GFp(const EC_GROUP *group, | |||
| 523 | * \param x BIGNUM with x-coordinate | 523 | * \param x BIGNUM with x-coordinate |
| 524 | * \param y_bit integer with the y-Bit (either 0 or 1) | 524 | * \param y_bit integer with the y-Bit (either 0 or 1) |
| 525 | * \param ctx BN_CTX object (optional) | 525 | * \param ctx BN_CTX object (optional) |
| 526 | * \return 1 on success and 0 if an error occured | 526 | * \return 1 on success and 0 if an error occurred |
| 527 | */ | 527 | */ |
| 528 | int EC_POINT_set_compressed_coordinates_GFp(const EC_GROUP *group, EC_POINT *p, | 528 | int EC_POINT_set_compressed_coordinates_GFp(const EC_GROUP *group, EC_POINT *p, |
| 529 | const BIGNUM *x, int y_bit, BN_CTX *ctx); | 529 | const BIGNUM *x, int y_bit, BN_CTX *ctx); |
| @@ -535,7 +535,7 @@ int EC_POINT_set_compressed_coordinates_GFp(const EC_GROUP *group, EC_POINT *p, | |||
| 535 | * \param x BIGNUM with the x-coordinate | 535 | * \param x BIGNUM with the x-coordinate |
| 536 | * \param y BIGNUM with the y-coordinate | 536 | * \param y BIGNUM with the y-coordinate |
| 537 | * \param ctx BN_CTX object (optional) | 537 | * \param ctx BN_CTX object (optional) |
| 538 | * \return 1 on success and 0 if an error occured | 538 | * \return 1 on success and 0 if an error occurred |
| 539 | */ | 539 | */ |
| 540 | int EC_POINT_set_affine_coordinates_GF2m(const EC_GROUP *group, EC_POINT *p, | 540 | int EC_POINT_set_affine_coordinates_GF2m(const EC_GROUP *group, EC_POINT *p, |
| 541 | const BIGNUM *x, const BIGNUM *y, BN_CTX *ctx); | 541 | const BIGNUM *x, const BIGNUM *y, BN_CTX *ctx); |
| @@ -546,7 +546,7 @@ int EC_POINT_set_affine_coordinates_GF2m(const EC_GROUP *group, EC_POINT *p, | |||
| 546 | * \param x BIGNUM for the x-coordinate | 546 | * \param x BIGNUM for the x-coordinate |
| 547 | * \param y BIGNUM for the y-coordinate | 547 | * \param y BIGNUM for the y-coordinate |
| 548 | * \param ctx BN_CTX object (optional) | 548 | * \param ctx BN_CTX object (optional) |
| 549 | * \return 1 on success and 0 if an error occured | 549 | * \return 1 on success and 0 if an error occurred |
| 550 | */ | 550 | */ |
| 551 | int EC_POINT_get_affine_coordinates_GF2m(const EC_GROUP *group, | 551 | int EC_POINT_get_affine_coordinates_GF2m(const EC_GROUP *group, |
| 552 | const EC_POINT *p, BIGNUM *x, BIGNUM *y, BN_CTX *ctx); | 552 | const EC_POINT *p, BIGNUM *x, BIGNUM *y, BN_CTX *ctx); |
| @@ -557,7 +557,7 @@ int EC_POINT_get_affine_coordinates_GF2m(const EC_GROUP *group, | |||
| 557 | * \param x BIGNUM with x-coordinate | 557 | * \param x BIGNUM with x-coordinate |
| 558 | * \param y_bit integer with the y-Bit (either 0 or 1) | 558 | * \param y_bit integer with the y-Bit (either 0 or 1) |
| 559 | * \param ctx BN_CTX object (optional) | 559 | * \param ctx BN_CTX object (optional) |
| 560 | * \return 1 on success and 0 if an error occured | 560 | * \return 1 on success and 0 if an error occurred |
| 561 | */ | 561 | */ |
| 562 | int EC_POINT_set_compressed_coordinates_GF2m(const EC_GROUP *group, EC_POINT *p, | 562 | int EC_POINT_set_compressed_coordinates_GF2m(const EC_GROUP *group, EC_POINT *p, |
| 563 | const BIGNUM *x, int y_bit, BN_CTX *ctx); | 563 | const BIGNUM *x, int y_bit, BN_CTX *ctx); |
| @@ -584,7 +584,7 @@ size_t EC_POINT_point2oct(const EC_GROUP *group, const EC_POINT *p, | |||
| 584 | * \param buf memory buffer with the encoded ec point | 584 | * \param buf memory buffer with the encoded ec point |
| 585 | * \param len length of the encoded ec point | 585 | * \param len length of the encoded ec point |
| 586 | * \param ctx BN_CTX object (optional) | 586 | * \param ctx BN_CTX object (optional) |
| 587 | * \return 1 on success and 0 if an error occured | 587 | * \return 1 on success and 0 if an error occurred |
| 588 | */ | 588 | */ |
| 589 | int EC_POINT_oct2point(const EC_GROUP *group, EC_POINT *p, | 589 | int EC_POINT_oct2point(const EC_GROUP *group, EC_POINT *p, |
| 590 | const unsigned char *buf, size_t len, BN_CTX *ctx); | 590 | const unsigned char *buf, size_t len, BN_CTX *ctx); |
| @@ -610,7 +610,7 @@ EC_POINT *EC_POINT_hex2point(const EC_GROUP *, const char *, | |||
| 610 | * \param a EC_POINT object with the first summand | 610 | * \param a EC_POINT object with the first summand |
| 611 | * \param b EC_POINT object with the second summand | 611 | * \param b EC_POINT object with the second summand |
| 612 | * \param ctx BN_CTX object (optional) | 612 | * \param ctx BN_CTX object (optional) |
| 613 | * \return 1 on success and 0 if an error occured | 613 | * \return 1 on success and 0 if an error occurred |
| 614 | */ | 614 | */ |
| 615 | int EC_POINT_add(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a, const EC_POINT *b, BN_CTX *ctx); | 615 | int EC_POINT_add(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a, const EC_POINT *b, BN_CTX *ctx); |
| 616 | 616 | ||
| @@ -619,7 +619,7 @@ int EC_POINT_add(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a, const EC | |||
| 619 | * \param r EC_POINT object for the result (r = 2 * a) | 619 | * \param r EC_POINT object for the result (r = 2 * a) |
| 620 | * \param a EC_POINT object | 620 | * \param a EC_POINT object |
| 621 | * \param ctx BN_CTX object (optional) | 621 | * \param ctx BN_CTX object (optional) |
| 622 | * \return 1 on success and 0 if an error occured | 622 | * \return 1 on success and 0 if an error occurred |
| 623 | */ | 623 | */ |
| 624 | int EC_POINT_dbl(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a, BN_CTX *ctx); | 624 | int EC_POINT_dbl(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a, BN_CTX *ctx); |
| 625 | 625 | ||
| @@ -627,7 +627,7 @@ int EC_POINT_dbl(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a, BN_CTX * | |||
| 627 | * \param group underlying EC_GROUP object | 627 | * \param group underlying EC_GROUP object |
| 628 | * \param a EC_POINT object to be inverted (it's used for the result as well) | 628 | * \param a EC_POINT object to be inverted (it's used for the result as well) |
| 629 | * \param ctx BN_CTX object (optional) | 629 | * \param ctx BN_CTX object (optional) |
| 630 | * \return 1 on success and 0 if an error occured | 630 | * \return 1 on success and 0 if an error occurred |
| 631 | */ | 631 | */ |
| 632 | int EC_POINT_invert(const EC_GROUP *group, EC_POINT *a, BN_CTX *ctx); | 632 | int EC_POINT_invert(const EC_GROUP *group, EC_POINT *a, BN_CTX *ctx); |
| 633 | 633 | ||
| @@ -662,11 +662,11 @@ int EC_POINTs_make_affine(const EC_GROUP *group, size_t num, EC_POINT *points[], | |||
| 662 | * \param group underlying EC_GROUP object | 662 | * \param group underlying EC_GROUP object |
| 663 | * \param r EC_POINT object for the result | 663 | * \param r EC_POINT object for the result |
| 664 | * \param n BIGNUM with the multiplier for the group generator (optional) | 664 | * \param n BIGNUM with the multiplier for the group generator (optional) |
| 665 | * \param num number futher summands | 665 | * \param num number further summands |
| 666 | * \param p array of size num of EC_POINT objects | 666 | * \param p array of size num of EC_POINT objects |
| 667 | * \param m array of size num of BIGNUM objects | 667 | * \param m array of size num of BIGNUM objects |
| 668 | * \param ctx BN_CTX object (optional) | 668 | * \param ctx BN_CTX object (optional) |
| 669 | * \return 1 on success and 0 if an error occured | 669 | * \return 1 on success and 0 if an error occurred |
| 670 | */ | 670 | */ |
| 671 | int EC_POINTs_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *n, size_t num, const EC_POINT *p[], const BIGNUM *m[], BN_CTX *ctx); | 671 | int EC_POINTs_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *n, size_t num, const EC_POINT *p[], const BIGNUM *m[], BN_CTX *ctx); |
| 672 | 672 | ||
| @@ -677,14 +677,14 @@ int EC_POINTs_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *n, size_t nu | |||
| 677 | * \param q EC_POINT object with the first factor of the second summand | 677 | * \param q EC_POINT object with the first factor of the second summand |
| 678 | * \param m BIGNUM with the second factor of the second summand | 678 | * \param m BIGNUM with the second factor of the second summand |
| 679 | * \param ctx BN_CTX object (optional) | 679 | * \param ctx BN_CTX object (optional) |
| 680 | * \return 1 on success and 0 if an error occured | 680 | * \return 1 on success and 0 if an error occurred |
| 681 | */ | 681 | */ |
| 682 | int EC_POINT_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *n, const EC_POINT *q, const BIGNUM *m, BN_CTX *ctx); | 682 | int EC_POINT_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *n, const EC_POINT *q, const BIGNUM *m, BN_CTX *ctx); |
| 683 | 683 | ||
| 684 | /** Stores multiples of generator for faster point multiplication | 684 | /** Stores multiples of generator for faster point multiplication |
| 685 | * \param group EC_GROUP object | 685 | * \param group EC_GROUP object |
| 686 | * \param ctx BN_CTX object (optional) | 686 | * \param ctx BN_CTX object (optional) |
| 687 | * \return 1 on success and 0 if an error occured | 687 | * \return 1 on success and 0 if an error occurred |
| 688 | */ | 688 | */ |
| 689 | int EC_GROUP_precompute_mult(EC_GROUP *group, BN_CTX *ctx); | 689 | int EC_GROUP_precompute_mult(EC_GROUP *group, BN_CTX *ctx); |
| 690 | 690 | ||
| @@ -869,8 +869,8 @@ int EC_KEY_generate_key(EC_KEY *key); | |||
| 869 | */ | 869 | */ |
| 870 | int EC_KEY_check_key(const EC_KEY *key); | 870 | int EC_KEY_check_key(const EC_KEY *key); |
| 871 | 871 | ||
| 872 | /** Sets a public key from affine coordindates performing | 872 | /** Sets a public key from affine coordinates performing |
| 873 | * neccessary NIST PKV tests. | 873 | * necessary NIST PKV tests. |
| 874 | * \param key the EC_KEY object | 874 | * \param key the EC_KEY object |
| 875 | * \param x public key x coordinate | 875 | * \param x public key x coordinate |
| 876 | * \param y public key y coordinate | 876 | * \param y public key y coordinate |
| @@ -914,7 +914,7 @@ int i2d_ECPrivateKey(EC_KEY *key, unsigned char **out); | |||
| 914 | EC_KEY *d2i_ECParameters(EC_KEY **key, const unsigned char **in, long len); | 914 | EC_KEY *d2i_ECParameters(EC_KEY **key, const unsigned char **in, long len); |
| 915 | 915 | ||
| 916 | /** Encodes ec parameter and stores the result in a buffer. | 916 | /** Encodes ec parameter and stores the result in a buffer. |
| 917 | * \param key the EC_KEY object with ec paramters to encode | 917 | * \param key the EC_KEY object with ec parameters to encode |
| 918 | * \param out the buffer for the result (if NULL the function returns number | 918 | * \param out the buffer for the result (if NULL the function returns number |
| 919 | * of bytes needed). | 919 | * of bytes needed). |
| 920 | * \return 1 on success and 0 if an error occurred. | 920 | * \return 1 on success and 0 if an error occurred. |
diff --git a/src/lib/libcrypto/ec/ecp_nistp224.c b/src/lib/libcrypto/ec/ecp_nistp224.c index 59781b75c3..caa4c3facf 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.29 2022/11/26 16:08:52 tb Exp $ */ | 1 | /* $OpenBSD: ecp_nistp224.c,v 1.30 2022/12/26 07:18:51 jmc 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 | */ |
| @@ -72,7 +72,7 @@ typedef uint128_t widelimb; | |||
| 72 | typedef limb felem[4]; | 72 | typedef limb felem[4]; |
| 73 | typedef widelimb widefelem[7]; | 73 | typedef widelimb widefelem[7]; |
| 74 | 74 | ||
| 75 | /* Field element represented as a byte arrary. | 75 | /* Field element represented as a byte array. |
| 76 | * 28*8 = 224 bits is also the group order size for the elliptic curve, | 76 | * 28*8 = 224 bits is also the group order size for the elliptic curve, |
| 77 | * and we also use this type for scalars for point multiplication. | 77 | * and we also use this type for scalars for point multiplication. |
| 78 | */ | 78 | */ |
diff --git a/src/lib/libcrypto/ec/ecp_nistp256.c b/src/lib/libcrypto/ec/ecp_nistp256.c index 275015b98d..e218b0c68c 100644 --- a/src/lib/libcrypto/ec/ecp_nistp256.c +++ b/src/lib/libcrypto/ec/ecp_nistp256.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: ecp_nistp256.c,v 1.28 2022/11/26 16:08:52 tb Exp $ */ | 1 | /* $OpenBSD: ecp_nistp256.c,v 1.29 2022/12/26 07:18:51 jmc Exp $ */ |
| 2 | /* | 2 | /* |
| 3 | * Written by Adam Langley (Google) for the OpenSSL project | 3 | * Written by Adam Langley (Google) for the OpenSSL project |
| 4 | */ | 4 | */ |
| @@ -1223,7 +1223,7 @@ copy_small_conditional(felem out, const smallfelem in, limb mask) | |||
| 1223 | } | 1223 | } |
| 1224 | } | 1224 | } |
| 1225 | 1225 | ||
| 1226 | /* point_add calcuates (x1, y1, z1) + (x2, y2, z2) | 1226 | /* point_add calculates (x1, y1, z1) + (x2, y2, z2) |
| 1227 | * | 1227 | * |
| 1228 | * The method is taken from: | 1228 | * The method is taken from: |
| 1229 | * http://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#addition-add-2007-bl, | 1229 | * http://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#addition-add-2007-bl, |
diff --git a/src/lib/libcrypto/ec/ecp_nistp521.c b/src/lib/libcrypto/ec/ecp_nistp521.c index 20b5885ab7..caeea14911 100644 --- a/src/lib/libcrypto/ec/ecp_nistp521.c +++ b/src/lib/libcrypto/ec/ecp_nistp521.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: ecp_nistp521.c,v 1.29 2022/11/26 16:08:52 tb Exp $ */ | 1 | /* $OpenBSD: ecp_nistp521.c,v 1.30 2022/12/26 07:18:51 jmc Exp $ */ |
| 2 | /* | 2 | /* |
| 3 | * Written by Adam Langley (Google) for the OpenSSL project | 3 | * Written by Adam Langley (Google) for the OpenSSL project |
| 4 | */ | 4 | */ |
| @@ -1034,7 +1034,7 @@ felem_contract(felem out, const felem in) | |||
| 1034 | * elliptic curve group itself. Points on the curve are represented in Jacobian | 1034 | * elliptic curve group itself. Points on the curve are represented in Jacobian |
| 1035 | * coordinates */ | 1035 | * coordinates */ |
| 1036 | 1036 | ||
| 1037 | /* point_double calcuates 2*(x_in, y_in, z_in) | 1037 | /* point_double calculates 2*(x_in, y_in, z_in) |
| 1038 | * | 1038 | * |
| 1039 | * The method is taken from: | 1039 | * The method is taken from: |
| 1040 | * http://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2001-b | 1040 | * http://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2001-b |
| @@ -1143,7 +1143,7 @@ copy_conditional(felem out, const felem in, limb mask) | |||
| 1143 | } | 1143 | } |
| 1144 | } | 1144 | } |
| 1145 | 1145 | ||
| 1146 | /* point_add calcuates (x1, y1, z1) + (x2, y2, z2) | 1146 | /* point_add calculates (x1, y1, z1) + (x2, y2, z2) |
| 1147 | * | 1147 | * |
| 1148 | * The method is taken from | 1148 | * The method is taken from |
| 1149 | * http://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#addition-add-2007-bl, | 1149 | * http://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#addition-add-2007-bl, |
