diff options
author | tb <> | 2021-04-20 17:09:45 +0000 |
---|---|---|
committer | tb <> | 2021-04-20 17:09:45 +0000 |
commit | 5cbc8cb8b60527fc1355dcef226365ccf4b64b8a (patch) | |
tree | e9d7d73987d870be1f7a03277eac4f6f780eb2a1 /src | |
parent | 0f9edd86ce5517238a8c770fe1e0acffc1ff6fd1 (diff) | |
download | openbsd-5cbc8cb8b60527fc1355dcef226365ccf4b64b8a.tar.gz openbsd-5cbc8cb8b60527fc1355dcef226365ccf4b64b8a.tar.bz2 openbsd-5cbc8cb8b60527fc1355dcef226365ccf4b64b8a.zip |
Adjust ectest.c for EC_GROUP_{g,s}et_curve change
Diffstat (limited to 'src')
-rw-r--r-- | src/regress/lib/libcrypto/ec/Makefile | 4 | ||||
-rw-r--r-- | src/regress/lib/libcrypto/ec/ectest.c | 26 |
2 files changed, 15 insertions, 15 deletions
diff --git a/src/regress/lib/libcrypto/ec/Makefile b/src/regress/lib/libcrypto/ec/Makefile index c3e7975415..76b552fa23 100644 --- a/src/regress/lib/libcrypto/ec/Makefile +++ b/src/regress/lib/libcrypto/ec/Makefile | |||
@@ -1,7 +1,7 @@ | |||
1 | # $OpenBSD: Makefile,v 1.3 2014/07/08 15:53:52 jsing Exp $ | 1 | # $OpenBSD: Makefile,v 1.4 2021/04/20 17:09:45 tb Exp $ |
2 | 2 | ||
3 | PROG= ectest | 3 | PROG= ectest |
4 | LDADD= -lcrypto | 4 | LDADD= ${CRYPTO_INT} |
5 | DPADD= ${LIBCRYPTO} | 5 | DPADD= ${LIBCRYPTO} |
6 | WARNINGS= Yes | 6 | WARNINGS= Yes |
7 | CFLAGS+= -DLIBRESSL_INTERNAL -Werror | 7 | CFLAGS+= -DLIBRESSL_INTERNAL -Werror |
diff --git a/src/regress/lib/libcrypto/ec/ectest.c b/src/regress/lib/libcrypto/ec/ectest.c index 401c013a6c..ff193f9e1f 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.8 2018/07/15 18:22:57 tb Exp $ */ | 1 | /* $OpenBSD: ectest.c,v 1.9 2021/04/20 17:09:45 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. |
@@ -195,7 +195,7 @@ prime_field_tests(void) | |||
195 | if (!group) | 195 | if (!group) |
196 | ABORT; | 196 | ABORT; |
197 | 197 | ||
198 | if (!EC_GROUP_set_curve_GFp(group, p, a, b, ctx)) | 198 | if (!EC_GROUP_set_curve(group, p, a, b, ctx)) |
199 | ABORT; | 199 | ABORT; |
200 | 200 | ||
201 | { | 201 | { |
@@ -209,7 +209,7 @@ prime_field_tests(void) | |||
209 | group = tmp; | 209 | group = tmp; |
210 | } | 210 | } |
211 | 211 | ||
212 | if (!EC_GROUP_get_curve_GFp(group, p, a, b, ctx)) | 212 | if (!EC_GROUP_get_curve(group, p, a, b, ctx)) |
213 | ABORT; | 213 | ABORT; |
214 | 214 | ||
215 | fprintf(stdout, "Curve defined by Weierstrass equation\n y^2 = x^3 + a*x + b (mod 0x"); | 215 | fprintf(stdout, "Curve defined by Weierstrass equation\n y^2 = x^3 + a*x + b (mod 0x"); |
@@ -363,7 +363,7 @@ prime_field_tests(void) | |||
363 | ABORT; | 363 | ABORT; |
364 | if (!BN_hex2bn(&b, "1C97BEFC54BD7A8B65ACF89F81D4D4ADC565FA45")) | 364 | if (!BN_hex2bn(&b, "1C97BEFC54BD7A8B65ACF89F81D4D4ADC565FA45")) |
365 | ABORT; | 365 | ABORT; |
366 | if (!EC_GROUP_set_curve_GFp(group, p, a, b, ctx)) | 366 | if (!EC_GROUP_set_curve(group, p, a, b, ctx)) |
367 | ABORT; | 367 | ABORT; |
368 | 368 | ||
369 | if (!BN_hex2bn(&x, "4A96B5688EF573284664698968C38BB913CBFC82")) | 369 | if (!BN_hex2bn(&x, "4A96B5688EF573284664698968C38BB913CBFC82")) |
@@ -415,7 +415,7 @@ prime_field_tests(void) | |||
415 | ABORT; | 415 | ABORT; |
416 | if (!BN_hex2bn(&b, "64210519E59C80E70FA7E9AB72243049FEB8DEECC146B9B1")) | 416 | if (!BN_hex2bn(&b, "64210519E59C80E70FA7E9AB72243049FEB8DEECC146B9B1")) |
417 | ABORT; | 417 | ABORT; |
418 | if (!EC_GROUP_set_curve_GFp(group, p, a, b, ctx)) | 418 | if (!EC_GROUP_set_curve(group, p, a, b, ctx)) |
419 | ABORT; | 419 | ABORT; |
420 | 420 | ||
421 | if (!BN_hex2bn(&x, "188DA80EB03090F67CBF20EB43A18800F4FF0AFD82FF1012")) | 421 | if (!BN_hex2bn(&x, "188DA80EB03090F67CBF20EB43A18800F4FF0AFD82FF1012")) |
@@ -465,7 +465,7 @@ prime_field_tests(void) | |||
465 | ABORT; | 465 | ABORT; |
466 | if (!BN_hex2bn(&b, "B4050A850C04B3ABF54132565044B0B7D7BFD8BA270B39432355FFB4")) | 466 | if (!BN_hex2bn(&b, "B4050A850C04B3ABF54132565044B0B7D7BFD8BA270B39432355FFB4")) |
467 | ABORT; | 467 | ABORT; |
468 | if (!EC_GROUP_set_curve_GFp(group, p, a, b, ctx)) | 468 | if (!EC_GROUP_set_curve(group, p, a, b, ctx)) |
469 | ABORT; | 469 | ABORT; |
470 | 470 | ||
471 | if (!BN_hex2bn(&x, "B70E0CBD6BB4BF7F321390B94A03C1D356C21122343280D6115C1D21")) | 471 | if (!BN_hex2bn(&x, "B70E0CBD6BB4BF7F321390B94A03C1D356C21122343280D6115C1D21")) |
@@ -515,7 +515,7 @@ prime_field_tests(void) | |||
515 | ABORT; | 515 | ABORT; |
516 | if (!BN_hex2bn(&b, "5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B")) | 516 | if (!BN_hex2bn(&b, "5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B")) |
517 | ABORT; | 517 | ABORT; |
518 | if (!EC_GROUP_set_curve_GFp(group, p, a, b, ctx)) | 518 | if (!EC_GROUP_set_curve(group, p, a, b, ctx)) |
519 | ABORT; | 519 | ABORT; |
520 | 520 | ||
521 | if (!BN_hex2bn(&x, "6B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C296")) | 521 | if (!BN_hex2bn(&x, "6B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C296")) |
@@ -565,7 +565,7 @@ prime_field_tests(void) | |||
565 | "FFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFC")) ABORT; | 565 | "FFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFC")) ABORT; |
566 | if (!BN_hex2bn(&b, "B3312FA7E23EE7E4988E056BE3F82D19181D9C6EFE8141" | 566 | if (!BN_hex2bn(&b, "B3312FA7E23EE7E4988E056BE3F82D19181D9C6EFE8141" |
567 | "120314088F5013875AC656398D8A2ED19D2A85C8EDD3EC2AEF")) ABORT; | 567 | "120314088F5013875AC656398D8A2ED19D2A85C8EDD3EC2AEF")) ABORT; |
568 | if (!EC_GROUP_set_curve_GFp(group, p, a, b, ctx)) | 568 | if (!EC_GROUP_set_curve(group, p, a, b, ctx)) |
569 | ABORT; | 569 | ABORT; |
570 | 570 | ||
571 | if (!BN_hex2bn(&x, "AA87CA22BE8B05378EB1C71EF320AD746E1D3B628BA79B" | 571 | if (!BN_hex2bn(&x, "AA87CA22BE8B05378EB1C71EF320AD746E1D3B628BA79B" |
@@ -618,7 +618,7 @@ prime_field_tests(void) | |||
618 | if (!BN_hex2bn(&b, "051953EB9618E1C9A1F929A21A0B68540EEA2DA725B99B" | 618 | if (!BN_hex2bn(&b, "051953EB9618E1C9A1F929A21A0B68540EEA2DA725B99B" |
619 | "315F3B8B489918EF109E156193951EC7E937B1652C0BD3BB1BF073573" | 619 | "315F3B8B489918EF109E156193951EC7E937B1652C0BD3BB1BF073573" |
620 | "DF883D2C34F1EF451FD46B503F00")) ABORT; | 620 | "DF883D2C34F1EF451FD46B503F00")) ABORT; |
621 | if (!EC_GROUP_set_curve_GFp(group, p, a, b, ctx)) | 621 | if (!EC_GROUP_set_curve(group, p, a, b, ctx)) |
622 | ABORT; | 622 | ABORT; |
623 | 623 | ||
624 | if (!BN_hex2bn(&x, "C6858E06B70404E9CD9E3ECB662395B4429C648139053F" | 624 | if (!BN_hex2bn(&x, "C6858E06B70404E9CD9E3ECB662395B4429C648139053F" |
@@ -752,7 +752,7 @@ prime_field_tests(void) | |||
752 | if (!BN_hex2bn(&p, _p)) ABORT; \ | 752 | if (!BN_hex2bn(&p, _p)) ABORT; \ |
753 | if (!BN_hex2bn(&a, _a)) ABORT; \ | 753 | if (!BN_hex2bn(&a, _a)) ABORT; \ |
754 | if (!BN_hex2bn(&b, _b)) ABORT; \ | 754 | if (!BN_hex2bn(&b, _b)) ABORT; \ |
755 | if (!EC_GROUP_set_curve_GF2m(group, p, a, b, ctx)) ABORT; \ | 755 | if (!EC_GROUP_set_curve(group, p, a, b, ctx)) ABORT; \ |
756 | CHAR2_CURVE_TEST_INTERNAL(_name, _p, _a, _b, _x, _y, _y_bit, _order, _cof, _degree, _variable) \ | 756 | CHAR2_CURVE_TEST_INTERNAL(_name, _p, _a, _b, _x, _y, _y_bit, _order, _cof, _degree, _variable) \ |
757 | fprintf(stdout, "verify degree ..."); \ | 757 | fprintf(stdout, "verify degree ..."); \ |
758 | if (EC_GROUP_get_degree(group) != _degree) ABORT; \ | 758 | if (EC_GROUP_get_degree(group) != _degree) ABORT; \ |
@@ -799,7 +799,7 @@ prime_field_tests(void) | |||
799 | * so that the library gets to choose the EC_METHOD */ | 799 | * so that the library gets to choose the EC_METHOD */ |
800 | if (!group) | 800 | if (!group) |
801 | ABORT; | 801 | ABORT; |
802 | if (!EC_GROUP_set_curve_GF2m(group, p, a, b, ctx)) | 802 | if (!EC_GROUP_set_curve(group, p, a, b, ctx)) |
803 | ABORT; | 803 | ABORT; |
804 | 804 | ||
805 | { | 805 | { |
@@ -813,7 +813,7 @@ prime_field_tests(void) | |||
813 | group = tmp; | 813 | group = tmp; |
814 | } | 814 | } |
815 | 815 | ||
816 | if (!EC_GROUP_get_curve_GF2m(group, p, a, b, ctx)) | 816 | if (!EC_GROUP_get_curve(group, p, a, b, ctx)) |
817 | ABORT; | 817 | ABORT; |
818 | 818 | ||
819 | fprintf(stdout, "Curve defined by Weierstrass equation\n y^2 + x*y = x^3 + a*x^2 + b (mod 0x"); | 819 | fprintf(stdout, "Curve defined by Weierstrass equation\n y^2 + x*y = x^3 + a*x^2 + b (mod 0x"); |
@@ -1315,7 +1315,7 @@ nistp_single_test(const struct nistp_test_params *test) | |||
1315 | ABORT; | 1315 | ABORT; |
1316 | if (!BN_hex2bn(&b, test->b)) | 1316 | if (!BN_hex2bn(&b, test->b)) |
1317 | ABORT; | 1317 | ABORT; |
1318 | if (!EC_GROUP_set_curve_GFp(NISTP, p, a, b, ctx)) | 1318 | if (!EC_GROUP_set_curve(NISTP, p, a, b, ctx)) |
1319 | ABORT; | 1319 | ABORT; |
1320 | G = EC_POINT_new(NISTP); | 1320 | G = EC_POINT_new(NISTP); |
1321 | P = EC_POINT_new(NISTP); | 1321 | P = EC_POINT_new(NISTP); |