diff options
Diffstat (limited to 'src/regress/lib/libcrypto')
| -rw-r--r-- | src/regress/lib/libcrypto/ec/ectest.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/src/regress/lib/libcrypto/ec/ectest.c b/src/regress/lib/libcrypto/ec/ectest.c index ff193f9e1f..f090d309b2 100644 --- a/src/regress/lib/libcrypto/ec/ectest.c +++ b/src/regress/lib/libcrypto/ec/ectest.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: ectest.c,v 1.9 2021/04/20 17:09:45 tb Exp $ */ | 1 | /* $OpenBSD: ectest.c,v 1.10 2021/04/20 17:19:39 tb Exp $ */ |
| 2 | /* crypto/ec/ectest.c */ | 2 | /* crypto/ec/ectest.c */ |
| 3 | /* | 3 | /* |
| 4 | * Originally written by Bodo Moeller for the OpenSSL project. | 4 | * Originally written by Bodo Moeller for the OpenSSL project. |
| @@ -251,7 +251,7 @@ prime_field_tests(void) | |||
| 251 | if (!EC_POINT_set_compressed_coordinates_GFp(group, Q, x, 1, ctx)) | 251 | if (!EC_POINT_set_compressed_coordinates_GFp(group, Q, x, 1, ctx)) |
| 252 | ABORT; | 252 | ABORT; |
| 253 | if (!EC_POINT_is_on_curve(group, Q, ctx)) { | 253 | if (!EC_POINT_is_on_curve(group, Q, ctx)) { |
| 254 | if (!EC_POINT_get_affine_coordinates_GFp(group, Q, x, y, ctx)) | 254 | if (!EC_POINT_get_affine_coordinates(group, Q, x, y, ctx)) |
| 255 | ABORT; | 255 | ABORT; |
| 256 | fprintf(stderr, "Point is not on curve: x = 0x"); | 256 | fprintf(stderr, "Point is not on curve: x = 0x"); |
| 257 | BN_print_fp(stderr, x); | 257 | BN_print_fp(stderr, x); |
| @@ -271,7 +271,7 @@ prime_field_tests(void) | |||
| 271 | if (EC_POINT_is_at_infinity(group, P)) | 271 | if (EC_POINT_is_at_infinity(group, P)) |
| 272 | fprintf(stdout, " point at infinity\n"); | 272 | fprintf(stdout, " point at infinity\n"); |
| 273 | else { | 273 | else { |
| 274 | if (!EC_POINT_get_affine_coordinates_GFp(group, P, x, y, ctx)) | 274 | if (!EC_POINT_get_affine_coordinates(group, P, x, y, ctx)) |
| 275 | ABORT; | 275 | ABORT; |
| 276 | 276 | ||
| 277 | fprintf(stdout, " x = 0x"); | 277 | fprintf(stdout, " x = 0x"); |
| @@ -370,7 +370,7 @@ prime_field_tests(void) | |||
| 370 | ABORT; | 370 | ABORT; |
| 371 | if (!BN_hex2bn(&y, "23a628553168947d59dcc912042351377ac5fb32")) | 371 | if (!BN_hex2bn(&y, "23a628553168947d59dcc912042351377ac5fb32")) |
| 372 | ABORT; | 372 | ABORT; |
| 373 | if (!EC_POINT_set_affine_coordinates_GFp(group, P, x, y, ctx)) | 373 | if (!EC_POINT_set_affine_coordinates(group, P, x, y, ctx)) |
| 374 | ABORT; | 374 | ABORT; |
| 375 | if (!EC_POINT_is_on_curve(group, P, ctx)) | 375 | if (!EC_POINT_is_on_curve(group, P, ctx)) |
| 376 | ABORT; | 376 | ABORT; |
| @@ -379,7 +379,7 @@ prime_field_tests(void) | |||
| 379 | if (!EC_GROUP_set_generator(group, P, z, BN_value_one())) | 379 | if (!EC_GROUP_set_generator(group, P, z, BN_value_one())) |
| 380 | ABORT; | 380 | ABORT; |
| 381 | 381 | ||
| 382 | if (!EC_POINT_get_affine_coordinates_GFp(group, P, x, y, ctx)) | 382 | if (!EC_POINT_get_affine_coordinates(group, P, x, y, ctx)) |
| 383 | ABORT; | 383 | ABORT; |
| 384 | fprintf(stdout, "\nSEC2 curve secp160r1 -- Generator:\n x = 0x"); | 384 | fprintf(stdout, "\nSEC2 curve secp160r1 -- Generator:\n x = 0x"); |
| 385 | BN_print_fp(stdout, x); | 385 | BN_print_fp(stdout, x); |
| @@ -429,7 +429,7 @@ prime_field_tests(void) | |||
| 429 | if (!EC_GROUP_set_generator(group, P, z, BN_value_one())) | 429 | if (!EC_GROUP_set_generator(group, P, z, BN_value_one())) |
| 430 | ABORT; | 430 | ABORT; |
| 431 | 431 | ||
| 432 | if (!EC_POINT_get_affine_coordinates_GFp(group, P, x, y, ctx)) | 432 | if (!EC_POINT_get_affine_coordinates(group, P, x, y, ctx)) |
| 433 | ABORT; | 433 | ABORT; |
| 434 | fprintf(stdout, "\nNIST curve P-192 -- Generator:\n x = 0x"); | 434 | fprintf(stdout, "\nNIST curve P-192 -- Generator:\n x = 0x"); |
| 435 | BN_print_fp(stdout, x); | 435 | BN_print_fp(stdout, x); |
| @@ -479,7 +479,7 @@ prime_field_tests(void) | |||
| 479 | if (!EC_GROUP_set_generator(group, P, z, BN_value_one())) | 479 | if (!EC_GROUP_set_generator(group, P, z, BN_value_one())) |
| 480 | ABORT; | 480 | ABORT; |
| 481 | 481 | ||
| 482 | if (!EC_POINT_get_affine_coordinates_GFp(group, P, x, y, ctx)) | 482 | if (!EC_POINT_get_affine_coordinates(group, P, x, y, ctx)) |
| 483 | ABORT; | 483 | ABORT; |
| 484 | fprintf(stdout, "\nNIST curve P-224 -- Generator:\n x = 0x"); | 484 | fprintf(stdout, "\nNIST curve P-224 -- Generator:\n x = 0x"); |
| 485 | BN_print_fp(stdout, x); | 485 | BN_print_fp(stdout, x); |
| @@ -529,7 +529,7 @@ prime_field_tests(void) | |||
| 529 | if (!EC_GROUP_set_generator(group, P, z, BN_value_one())) | 529 | if (!EC_GROUP_set_generator(group, P, z, BN_value_one())) |
| 530 | ABORT; | 530 | ABORT; |
| 531 | 531 | ||
| 532 | if (!EC_POINT_get_affine_coordinates_GFp(group, P, x, y, ctx)) | 532 | if (!EC_POINT_get_affine_coordinates(group, P, x, y, ctx)) |
| 533 | ABORT; | 533 | ABORT; |
| 534 | fprintf(stdout, "\nNIST curve P-256 -- Generator:\n x = 0x"); | 534 | fprintf(stdout, "\nNIST curve P-256 -- Generator:\n x = 0x"); |
| 535 | BN_print_fp(stdout, x); | 535 | BN_print_fp(stdout, x); |
| @@ -579,7 +579,7 @@ prime_field_tests(void) | |||
| 579 | if (!EC_GROUP_set_generator(group, P, z, BN_value_one())) | 579 | if (!EC_GROUP_set_generator(group, P, z, BN_value_one())) |
| 580 | ABORT; | 580 | ABORT; |
| 581 | 581 | ||
| 582 | if (!EC_POINT_get_affine_coordinates_GFp(group, P, x, y, ctx)) | 582 | if (!EC_POINT_get_affine_coordinates(group, P, x, y, ctx)) |
| 583 | ABORT; | 583 | ABORT; |
| 584 | fprintf(stdout, "\nNIST curve P-384 -- Generator:\n x = 0x"); | 584 | fprintf(stdout, "\nNIST curve P-384 -- Generator:\n x = 0x"); |
| 585 | BN_print_fp(stdout, x); | 585 | BN_print_fp(stdout, x); |
| @@ -634,7 +634,7 @@ prime_field_tests(void) | |||
| 634 | if (!EC_GROUP_set_generator(group, P, z, BN_value_one())) | 634 | if (!EC_GROUP_set_generator(group, P, z, BN_value_one())) |
| 635 | ABORT; | 635 | ABORT; |
| 636 | 636 | ||
| 637 | if (!EC_POINT_get_affine_coordinates_GFp(group, P, x, y, ctx)) | 637 | if (!EC_POINT_get_affine_coordinates(group, P, x, y, ctx)) |
| 638 | ABORT; | 638 | ABORT; |
| 639 | fprintf(stdout, "\nNIST curve P-521 -- Generator:\n x = 0x"); | 639 | fprintf(stdout, "\nNIST curve P-521 -- Generator:\n x = 0x"); |
| 640 | BN_print_fp(stdout, x); | 640 | BN_print_fp(stdout, x); |
| @@ -723,7 +723,7 @@ prime_field_tests(void) | |||
| 723 | if (!BN_hex2bn(&z, _order)) ABORT; \ | 723 | if (!BN_hex2bn(&z, _order)) ABORT; \ |
| 724 | if (!BN_hex2bn(&cof, _cof)) ABORT; \ | 724 | if (!BN_hex2bn(&cof, _cof)) ABORT; \ |
| 725 | if (!EC_GROUP_set_generator(group, P, z, cof)) ABORT; \ | 725 | if (!EC_GROUP_set_generator(group, P, z, cof)) ABORT; \ |
| 726 | if (!EC_POINT_get_affine_coordinates_GF2m(group, P, x, y, ctx)) ABORT; \ | 726 | if (!EC_POINT_get_affine_coordinates(group, P, x, y, ctx)) ABORT; \ |
| 727 | fprintf(stdout, "\n%s -- Generator:\n x = 0x", _name); \ | 727 | fprintf(stdout, "\n%s -- Generator:\n x = 0x", _name); \ |
| 728 | BN_print_fp(stdout, x); \ | 728 | BN_print_fp(stdout, x); \ |
| 729 | fprintf(stdout, "\n y = 0x"); \ | 729 | fprintf(stdout, "\n y = 0x"); \ |
| @@ -736,7 +736,7 @@ prime_field_tests(void) | |||
| 736 | #define CHAR2_CURVE_TEST_INTERNAL(_name, _p, _a, _b, _x, _y, _y_bit, _order, _cof, _degree, _variable) \ | 736 | #define CHAR2_CURVE_TEST_INTERNAL(_name, _p, _a, _b, _x, _y, _y_bit, _order, _cof, _degree, _variable) \ |
| 737 | if (!BN_hex2bn(&x, _x)) ABORT; \ | 737 | if (!BN_hex2bn(&x, _x)) ABORT; \ |
| 738 | if (!BN_hex2bn(&y, _y)) ABORT; \ | 738 | if (!BN_hex2bn(&y, _y)) ABORT; \ |
| 739 | if (!EC_POINT_set_affine_coordinates_GF2m(group, P, x, y, ctx)) ABORT; \ | 739 | if (!EC_POINT_set_affine_coordinates(group, P, x, y, ctx)) ABORT; \ |
| 740 | if (!EC_POINT_is_on_curve(group, P, ctx)) ABORT; \ | 740 | if (!EC_POINT_is_on_curve(group, P, ctx)) ABORT; \ |
| 741 | if (!BN_hex2bn(&z, _order)) ABORT; \ | 741 | if (!BN_hex2bn(&z, _order)) ABORT; \ |
| 742 | if (!BN_hex2bn(&cof, _cof)) ABORT; \ | 742 | if (!BN_hex2bn(&cof, _cof)) ABORT; \ |
| @@ -860,13 +860,13 @@ prime_field_tests(void) | |||
| 860 | #else | 860 | #else |
| 861 | if (!BN_hex2bn(&y, "8")) | 861 | if (!BN_hex2bn(&y, "8")) |
| 862 | ABORT; | 862 | ABORT; |
| 863 | if (!EC_POINT_set_affine_coordinates_GF2m(group, Q, x, y, ctx)) | 863 | if (!EC_POINT_set_affine_coordinates(group, Q, x, y, ctx)) |
| 864 | ABORT; | 864 | ABORT; |
| 865 | #endif | 865 | #endif |
| 866 | if (!EC_POINT_is_on_curve(group, Q, ctx)) { | 866 | if (!EC_POINT_is_on_curve(group, Q, ctx)) { |
| 867 | /* Change test based on whether binary point compression is enabled or not. */ | 867 | /* Change test based on whether binary point compression is enabled or not. */ |
| 868 | #ifdef OPENSSL_EC_BIN_PT_COMP | 868 | #ifdef OPENSSL_EC_BIN_PT_COMP |
| 869 | if (!EC_POINT_get_affine_coordinates_GF2m(group, Q, x, y, ctx)) | 869 | if (!EC_POINT_get_affine_coordinates(group, Q, x, y, ctx)) |
| 870 | ABORT; | 870 | ABORT; |
| 871 | #endif | 871 | #endif |
| 872 | fprintf(stderr, "Point is not on curve: x = 0x"); | 872 | fprintf(stderr, "Point is not on curve: x = 0x"); |
| @@ -887,7 +887,7 @@ prime_field_tests(void) | |||
| 887 | if (EC_POINT_is_at_infinity(group, P)) | 887 | if (EC_POINT_is_at_infinity(group, P)) |
| 888 | fprintf(stdout, " point at infinity\n"); | 888 | fprintf(stdout, " point at infinity\n"); |
| 889 | else { | 889 | else { |
| 890 | if (!EC_POINT_get_affine_coordinates_GF2m(group, P, x, y, ctx)) | 890 | if (!EC_POINT_get_affine_coordinates(group, P, x, y, ctx)) |
| 891 | ABORT; | 891 | ABORT; |
| 892 | 892 | ||
| 893 | fprintf(stdout, " x = 0x"); | 893 | fprintf(stdout, " x = 0x"); |
| @@ -1325,13 +1325,13 @@ nistp_single_test(const struct nistp_test_params *test) | |||
| 1325 | ABORT; | 1325 | ABORT; |
| 1326 | if (!BN_hex2bn(&y, test->Qy)) | 1326 | if (!BN_hex2bn(&y, test->Qy)) |
| 1327 | ABORT; | 1327 | ABORT; |
| 1328 | if (!EC_POINT_set_affine_coordinates_GFp(NISTP, Q_CHECK, x, y, ctx)) | 1328 | if (!EC_POINT_set_affine_coordinates(NISTP, Q_CHECK, x, y, ctx)) |
| 1329 | ABORT; | 1329 | ABORT; |
| 1330 | if (!BN_hex2bn(&x, test->Gx)) | 1330 | if (!BN_hex2bn(&x, test->Gx)) |
| 1331 | ABORT; | 1331 | ABORT; |
| 1332 | if (!BN_hex2bn(&y, test->Gy)) | 1332 | if (!BN_hex2bn(&y, test->Gy)) |
| 1333 | ABORT; | 1333 | ABORT; |
| 1334 | if (!EC_POINT_set_affine_coordinates_GFp(NISTP, G, x, y, ctx)) | 1334 | if (!EC_POINT_set_affine_coordinates(NISTP, G, x, y, ctx)) |
| 1335 | ABORT; | 1335 | ABORT; |
| 1336 | if (!BN_hex2bn(&order, test->order)) | 1336 | if (!BN_hex2bn(&order, test->order)) |
| 1337 | ABORT; | 1337 | ABORT; |
