Commit 83aa4c60 authored by Niels Möller's avatar Niels Möller

Enable ecc-mul-a-test, also with mini-gmp.

parent b4971114
......@@ -2,6 +2,7 @@
* testsuite/ecc-redc-test.c [NETTLE_USE_MINI_GMP]: Enable test.
(test_main): Replace gmp_fprintf calls.
* testsuite/ecc-mul-a-test.c: Likewise.
* testsuite/ecc-modinv-test.c [NETTLE_USE_MINI_GMP]: Enable test.
(ref_modinv): Use mpz_gcdext, instead of mpn_gcdext.
......
#include "testutils.h"
#if NETTLE_USE_MINI_GMP
void
test_main (void)
{
SKIP();
}
#else /* ! NETTLE_USE_MINI_GMP */
void
test_main (void)
{
......@@ -80,15 +72,23 @@ test_main (void)
if (mpn_cmp (p, q, 2*size))
{
gmp_fprintf (stderr,
fprintf (stderr,
"Different results from ecc->mul and ecc->mul_g.\n"
" bits = %u\n"
" n = %Nx\n",
ecc->p.bit_size, n, size);
gmp_fprintf (stderr, "p = %Nx,\n %Nx\n",
p, size, p + size, size);
gmp_fprintf (stderr, "q = %Nx,\n %Nx\n",
q, size, q + size, size);
" bits = %u\n",
ecc->p.bit_size);
fprintf (stderr, " n = ");
mpn_out_str (stderr, 16, n, size);
fprintf (stderr, "\np = ");
mpn_out_str (stderr, 16, p, size);
fprintf (stderr, ",\n ");
mpn_out_str (stderr, 16, p + size, size);
fprintf (stderr, "\nq = ");
mpn_out_str (stderr, 16, q, size);
fprintf (stderr, ",\n ");
mpn_out_str (stderr, 16, q + size, size);
fprintf (stderr, "\n");
abort ();
}
}
......@@ -100,4 +100,3 @@ test_main (void)
mpz_clear (r);
gmp_randclear (rands);
}
#endif /* ! NETTLE_USE_MINI_GMP */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment