diff options
author | tb <> | 2023-04-17 20:41:02 +0000 |
---|---|---|
committer | tb <> | 2023-04-17 20:41:02 +0000 |
commit | 316e7ffc01ae11055fe34fde666de0555cb17d73 (patch) | |
tree | 2d4bc1a41e1a091f0b213dcc127344031ee0119d /src/regress/lib/libcrypto/ec/ectest.c | |
parent | f110ea563f7014bfd951c93fad397d497252ad4a (diff) | |
download | openbsd-316e7ffc01ae11055fe34fde666de0555cb17d73.tar.gz openbsd-316e7ffc01ae11055fe34fde666de0555cb17d73.tar.bz2 openbsd-316e7ffc01ae11055fe34fde666de0555cb17d73.zip |
Switch all ec tests to using dynamic linking
This only requires very minor changes and simplifies testing quite a bit.
Some of the changes can be undone after the next bump.
Diffstat (limited to 'src/regress/lib/libcrypto/ec/ectest.c')
-rw-r--r-- | src/regress/lib/libcrypto/ec/ectest.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/regress/lib/libcrypto/ec/ectest.c b/src/regress/lib/libcrypto/ec/ectest.c index 2b9c6a99f3..d2253609cd 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.13 2023/04/13 05:25:30 tb Exp $ */ | 1 | /* $OpenBSD: ectest.c,v 1.14 2023/04/17 20:41:02 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. |
@@ -96,6 +96,9 @@ | |||
96 | #define TIMING_RAND_PT 1 | 96 | #define TIMING_RAND_PT 1 |
97 | #define TIMING_SIMUL 2 | 97 | #define TIMING_SIMUL 2 |
98 | 98 | ||
99 | int EC_POINT_get_Jprojective_coordinates_GFp(const EC_GROUP *group, | ||
100 | const EC_POINT *point, BIGNUM *x, BIGNUM *y, BIGNUM *z, BN_CTX *ctx); | ||
101 | |||
99 | /* test multiplication with group order, long and negative scalars */ | 102 | /* test multiplication with group order, long and negative scalars */ |
100 | static void | 103 | static void |
101 | group_order_tests(EC_GROUP *group) | 104 | group_order_tests(EC_GROUP *group) |
@@ -132,7 +135,8 @@ group_order_tests(EC_GROUP *group) | |||
132 | ABORT; | 135 | ABORT; |
133 | fprintf(stdout, " ok\n"); | 136 | fprintf(stdout, " ok\n"); |
134 | fprintf(stdout, "long/negative scalar tests ... "); | 137 | fprintf(stdout, "long/negative scalar tests ... "); |
135 | if (!BN_one(n1)) | 138 | /* XXX - switch back to BN_one() after next bump. */ |
139 | if (!BN_set_word(n1, 1)) | ||
136 | ABORT; | 140 | ABORT; |
137 | /* n1 = 1 - order */ | 141 | /* n1 = 1 - order */ |
138 | if (!BN_sub(n1, n1, order)) | 142 | if (!BN_sub(n1, n1, order)) |
@@ -342,7 +346,7 @@ prime_field_tests(void) | |||
342 | fprintf(stdout, "\nGenerator as octet string, hybrid form:\n "); | 346 | fprintf(stdout, "\nGenerator as octet string, hybrid form:\n "); |
343 | for (i = 0; i < len; i++) fprintf(stdout, "%02X", buf[i]); | 347 | for (i = 0; i < len; i++) fprintf(stdout, "%02X", buf[i]); |
344 | 348 | ||
345 | if (!EC_POINT_get_Jprojective_coordinates(group, R, x, y, z, ctx)) | 349 | if (!EC_POINT_get_Jprojective_coordinates_GFp(group, R, x, y, z, ctx)) |
346 | ABORT; | 350 | ABORT; |
347 | fprintf(stdout, "\nA representation of the inverse of that generator in\nJacobian projective coordinates:\n X = 0x"); | 351 | fprintf(stdout, "\nA representation of the inverse of that generator in\nJacobian projective coordinates:\n X = 0x"); |
348 | BN_print_fp(stdout, x); | 352 | BN_print_fp(stdout, x); |