summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortb <>2025-01-06 10:42:28 +0000
committertb <>2025-01-06 10:42:28 +0000
commit16003196b4fa5e9ec4e589655b8e56c75069df4d (patch)
treeaa0e86884446e7945278a3d2fd0aa1ff24c4517c
parent0f511ee5ebcdc25092aedb4f0498b81ee7126fb5 (diff)
downloadopenbsd-16003196b4fa5e9ec4e589655b8e56c75069df4d.tar.gz
openbsd-16003196b4fa5e9ec4e589655b8e56c75069df4d.tar.bz2
openbsd-16003196b4fa5e9ec4e589655b8e56c75069df4d.zip
Print the inverse in affine coordinates
This way we can get rid of the stupidity that is publicly exposed Jprojective coordinates soon.
-rw-r--r--src/regress/lib/libcrypto/ec/ectest.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/regress/lib/libcrypto/ec/ectest.c b/src/regress/lib/libcrypto/ec/ectest.c
index b653ab7876..973202700d 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.24 2024/10/18 19:55:34 tb Exp $ */ 1/* $OpenBSD: ectest.c,v 1.25 2025/01/06 10:42:28 tb 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 */
@@ -92,9 +92,6 @@
92#define TIMING_RAND_PT 1 92#define TIMING_RAND_PT 1
93#define TIMING_SIMUL 2 93#define TIMING_SIMUL 2
94 94
95int EC_POINT_get_Jprojective_coordinates_GFp(const EC_GROUP *group,
96 const EC_POINT *point, BIGNUM *x, BIGNUM *y, BIGNUM *z, BN_CTX *ctx);
97
98/* test multiplication with group order, long and negative scalars */ 95/* test multiplication with group order, long and negative scalars */
99static void 96static void
100group_order_tests(EC_GROUP *group) 97group_order_tests(EC_GROUP *group)
@@ -325,14 +322,12 @@ prime_field_tests(void)
325 fprintf(stdout, "\nGenerator as octet string, hybrid form:\n "); 322 fprintf(stdout, "\nGenerator as octet string, hybrid form:\n ");
326 for (i = 0; i < len; i++) fprintf(stdout, "%02X", buf[i]); 323 for (i = 0; i < len; i++) fprintf(stdout, "%02X", buf[i]);
327 324
328 if (!EC_POINT_get_Jprojective_coordinates_GFp(group, R, x, y, z, ctx)) 325 if (!EC_POINT_get_affine_coordinates(group, R, x, y, ctx))
329 ABORT; 326 ABORT;
330 fprintf(stdout, "\nA representation of the inverse of that generator in\nJacobian projective coordinates:\n X = 0x"); 327 fprintf(stdout, "\nAn inverse of that generator:\n X = 0x");
331 BN_print_fp(stdout, x); 328 BN_print_fp(stdout, x);
332 fprintf(stdout, ", Y = 0x"); 329 fprintf(stdout, ", Y = 0x");
333 BN_print_fp(stdout, y); 330 BN_print_fp(stdout, y);
334 fprintf(stdout, ", Z = 0x");
335 BN_print_fp(stdout, z);
336 fprintf(stdout, "\n"); 331 fprintf(stdout, "\n");
337 332
338 if (!EC_POINT_invert(group, P, ctx)) 333 if (!EC_POINT_invert(group, P, ctx))