-/* $OpenBSD: ectest.c,v 1.9 2021/04/20 17:09:45 tb Exp $ */
+/* $OpenBSD: ectest.c,v 1.10 2021/04/20 17:19:39 tb Exp $ */
/* crypto/ec/ectest.c */
/*
* Originally written by Bodo Moeller for the OpenSSL project.
if (!EC_POINT_set_compressed_coordinates_GFp(group, Q, x, 1, ctx))
ABORT;
if (!EC_POINT_is_on_curve(group, Q, ctx)) {
- if (!EC_POINT_get_affine_coordinates_GFp(group, Q, x, y, ctx))
+ if (!EC_POINT_get_affine_coordinates(group, Q, x, y, ctx))
ABORT;
fprintf(stderr, "Point is not on curve: x = 0x");
BN_print_fp(stderr, x);
if (EC_POINT_is_at_infinity(group, P))
fprintf(stdout, " point at infinity\n");
else {
- if (!EC_POINT_get_affine_coordinates_GFp(group, P, x, y, ctx))
+ if (!EC_POINT_get_affine_coordinates(group, P, x, y, ctx))
ABORT;
fprintf(stdout, " x = 0x");
ABORT;
if (!BN_hex2bn(&y, "23a628553168947d59dcc912042351377ac5fb32"))
ABORT;
- if (!EC_POINT_set_affine_coordinates_GFp(group, P, x, y, ctx))
+ if (!EC_POINT_set_affine_coordinates(group, P, x, y, ctx))
ABORT;
if (!EC_POINT_is_on_curve(group, P, ctx))
ABORT;
if (!EC_GROUP_set_generator(group, P, z, BN_value_one()))
ABORT;
- if (!EC_POINT_get_affine_coordinates_GFp(group, P, x, y, ctx))
+ if (!EC_POINT_get_affine_coordinates(group, P, x, y, ctx))
ABORT;
fprintf(stdout, "\nSEC2 curve secp160r1 -- Generator:\n x = 0x");
BN_print_fp(stdout, x);
if (!EC_GROUP_set_generator(group, P, z, BN_value_one()))
ABORT;
- if (!EC_POINT_get_affine_coordinates_GFp(group, P, x, y, ctx))
+ if (!EC_POINT_get_affine_coordinates(group, P, x, y, ctx))
ABORT;
fprintf(stdout, "\nNIST curve P-192 -- Generator:\n x = 0x");
BN_print_fp(stdout, x);
if (!EC_GROUP_set_generator(group, P, z, BN_value_one()))
ABORT;
- if (!EC_POINT_get_affine_coordinates_GFp(group, P, x, y, ctx))
+ if (!EC_POINT_get_affine_coordinates(group, P, x, y, ctx))
ABORT;
fprintf(stdout, "\nNIST curve P-224 -- Generator:\n x = 0x");
BN_print_fp(stdout, x);
if (!EC_GROUP_set_generator(group, P, z, BN_value_one()))
ABORT;
- if (!EC_POINT_get_affine_coordinates_GFp(group, P, x, y, ctx))
+ if (!EC_POINT_get_affine_coordinates(group, P, x, y, ctx))
ABORT;
fprintf(stdout, "\nNIST curve P-256 -- Generator:\n x = 0x");
BN_print_fp(stdout, x);
if (!EC_GROUP_set_generator(group, P, z, BN_value_one()))
ABORT;
- if (!EC_POINT_get_affine_coordinates_GFp(group, P, x, y, ctx))
+ if (!EC_POINT_get_affine_coordinates(group, P, x, y, ctx))
ABORT;
fprintf(stdout, "\nNIST curve P-384 -- Generator:\n x = 0x");
BN_print_fp(stdout, x);
if (!EC_GROUP_set_generator(group, P, z, BN_value_one()))
ABORT;
- if (!EC_POINT_get_affine_coordinates_GFp(group, P, x, y, ctx))
+ if (!EC_POINT_get_affine_coordinates(group, P, x, y, ctx))
ABORT;
fprintf(stdout, "\nNIST curve P-521 -- Generator:\n x = 0x");
BN_print_fp(stdout, x);
if (!BN_hex2bn(&z, _order)) ABORT; \
if (!BN_hex2bn(&cof, _cof)) ABORT; \
if (!EC_GROUP_set_generator(group, P, z, cof)) ABORT; \
- if (!EC_POINT_get_affine_coordinates_GF2m(group, P, x, y, ctx)) ABORT; \
+ if (!EC_POINT_get_affine_coordinates(group, P, x, y, ctx)) ABORT; \
fprintf(stdout, "\n%s -- Generator:\n x = 0x", _name); \
BN_print_fp(stdout, x); \
fprintf(stdout, "\n y = 0x"); \
#define CHAR2_CURVE_TEST_INTERNAL(_name, _p, _a, _b, _x, _y, _y_bit, _order, _cof, _degree, _variable) \
if (!BN_hex2bn(&x, _x)) ABORT; \
if (!BN_hex2bn(&y, _y)) ABORT; \
- if (!EC_POINT_set_affine_coordinates_GF2m(group, P, x, y, ctx)) ABORT; \
+ if (!EC_POINT_set_affine_coordinates(group, P, x, y, ctx)) ABORT; \
if (!EC_POINT_is_on_curve(group, P, ctx)) ABORT; \
if (!BN_hex2bn(&z, _order)) ABORT; \
if (!BN_hex2bn(&cof, _cof)) ABORT; \
#else
if (!BN_hex2bn(&y, "8"))
ABORT;
- if (!EC_POINT_set_affine_coordinates_GF2m(group, Q, x, y, ctx))
+ if (!EC_POINT_set_affine_coordinates(group, Q, x, y, ctx))
ABORT;
#endif
if (!EC_POINT_is_on_curve(group, Q, ctx)) {
/* Change test based on whether binary point compression is enabled or not. */
#ifdef OPENSSL_EC_BIN_PT_COMP
- if (!EC_POINT_get_affine_coordinates_GF2m(group, Q, x, y, ctx))
+ if (!EC_POINT_get_affine_coordinates(group, Q, x, y, ctx))
ABORT;
#endif
fprintf(stderr, "Point is not on curve: x = 0x");
if (EC_POINT_is_at_infinity(group, P))
fprintf(stdout, " point at infinity\n");
else {
- if (!EC_POINT_get_affine_coordinates_GF2m(group, P, x, y, ctx))
+ if (!EC_POINT_get_affine_coordinates(group, P, x, y, ctx))
ABORT;
fprintf(stdout, " x = 0x");
ABORT;
if (!BN_hex2bn(&y, test->Qy))
ABORT;
- if (!EC_POINT_set_affine_coordinates_GFp(NISTP, Q_CHECK, x, y, ctx))
+ if (!EC_POINT_set_affine_coordinates(NISTP, Q_CHECK, x, y, ctx))
ABORT;
if (!BN_hex2bn(&x, test->Gx))
ABORT;
if (!BN_hex2bn(&y, test->Gy))
ABORT;
- if (!EC_POINT_set_affine_coordinates_GFp(NISTP, G, x, y, ctx))
+ if (!EC_POINT_set_affine_coordinates(NISTP, G, x, y, ctx))
ABORT;
if (!BN_hex2bn(&order, test->order))
ABORT;