1
0
mirror of https://github.com/openbsd/src.git synced 2025-01-10 06:47:55 -08:00

Some more EC2M cleanup

This commit is contained in:
tb 2023-04-26 09:31:12 +00:00
parent bc31cd49d0
commit c9d1fabebf
2 changed files with 4 additions and 48 deletions

View File

@ -1,4 +1,4 @@
/* $OpenBSD: ec_point_conversion.c,v 1.12 2023/04/18 08:05:18 tb Exp $ */
/* $OpenBSD: ec_point_conversion.c,v 1.13 2023/04/26 09:31:12 tb Exp $ */
/*
* Copyright (c) 2021 Theo Buehler <tb@openbsd.org>
* Copyright (c) 2021 Joel Sing <jsing@openbsd.org>
@ -118,23 +118,12 @@ test_random_points_on_curve(EC_builtin_curve *curve)
BIGNUM *order = NULL;
BIGNUM *random;
BIGNUM *x, *y;
const char *curve_name;
size_t i, j;
int failed = 0;
curve_name = OBJ_nid2sn(curve->nid);
if ((group = EC_GROUP_new_by_curve_name(curve->nid)) == NULL)
errx(1, "EC_GROUP_new_by_curve_name(%s)", curve_name);
#ifndef OPENSSL_NO_EC2M
if (EC_GROUP_get_basis_type(group)) {
EC_GROUP_free(group);
fprintf(stderr, "%s ... skipped\n", curve_name);
return 0;
}
#endif
fprintf(stderr, "%s\n", curve_name);
errx(1, "EC_GROUP_new_by_curve_name(%s)",
OBJ_nid2sn(curve->nid));
if ((order = BN_new()) == NULL)
errx(1, "BN_new order");

View File

@ -1,4 +1,4 @@
/* $OpenBSD: ecdhtest.c,v 1.13 2023/03/08 16:51:42 tb Exp $ */
/* $OpenBSD: ecdhtest.c,v 1.14 2023/04/26 09:31:12 tb Exp $ */
/* ====================================================================
* Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.
*
@ -407,39 +407,6 @@ main(int argc, char *argv[])
goto err;
if (!test_ecdh_curve(NID_secp521r1, "NIST Prime-Curve P-521", ctx, out))
goto err;
#ifndef OPENSSL_NO_EC2M
/* NIST BINARY CURVES TESTS */
if (!test_ecdh_curve(NID_sect163k1, "NIST Binary-Curve K-163",
ctx, out))
goto err;
if (!test_ecdh_curve(NID_sect163r2, "NIST Binary-Curve B-163",
ctx, out))
goto err;
if (!test_ecdh_curve(NID_sect233k1, "NIST Binary-Curve K-233",
ctx, out))
goto err;
if (!test_ecdh_curve(NID_sect233r1, "NIST Binary-Curve B-233",
ctx, out))
goto err;
if (!test_ecdh_curve(NID_sect283k1, "NIST Binary-Curve K-283",
ctx, out))
goto err;
if (!test_ecdh_curve(NID_sect283r1, "NIST Binary-Curve B-283",
ctx, out))
goto err;
if (!test_ecdh_curve(NID_sect409k1, "NIST Binary-Curve K-409",
ctx, out))
goto err;
if (!test_ecdh_curve(NID_sect409r1, "NIST Binary-Curve B-409",
ctx, out))
goto err;
if (!test_ecdh_curve(NID_sect571k1, "NIST Binary-Curve K-571",
ctx, out))
goto err;
if (!test_ecdh_curve(NID_sect571r1, "NIST Binary-Curve B-571",
ctx, out))
goto err;
#endif
if (!test_ecdh_kat(out, "Brainpool Prime-Curve brainpoolP256r1", 256))
goto err;
if (!test_ecdh_kat(out, "Brainpool Prime-Curve brainpoolP384r1", 384))