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

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

parent b4971114
2014-10-03 Niels Möller <nisse@lysator.liu.se> 2014-10-03 Niels Möller <nisse@lysator.liu.se>
* testsuite/ecc-redc-test.c [NETTLE_USE_MINI_GMP]: Enable test. * testsuite/ecc-redc-test.c [NETTLE_USE_MINI_GMP]: Enable test.
(test_main): Replace gmp_fprintf calls. (test_main): Replace gmp_fprintf calls.
* testsuite/ecc-mul-a-test.c: Likewise.
* testsuite/ecc-modinv-test.c [NETTLE_USE_MINI_GMP]: Enable test. * testsuite/ecc-modinv-test.c [NETTLE_USE_MINI_GMP]: Enable test.
(ref_modinv): Use mpz_gcdext, instead of mpn_gcdext. (ref_modinv): Use mpz_gcdext, instead of mpn_gcdext.
......
#include "testutils.h" #include "testutils.h"
#if NETTLE_USE_MINI_GMP
void
test_main (void)
{
SKIP();
}
#else /* ! NETTLE_USE_MINI_GMP */
void void
test_main (void) test_main (void)
{ {
...@@ -80,15 +72,23 @@ test_main (void) ...@@ -80,15 +72,23 @@ test_main (void)
if (mpn_cmp (p, q, 2*size)) if (mpn_cmp (p, q, 2*size))
{ {
gmp_fprintf (stderr, fprintf (stderr,
"Different results from ecc->mul and ecc->mul_g.\n" "Different results from ecc->mul and ecc->mul_g.\n"
" bits = %u\n" " bits = %u\n",
" n = %Nx\n", ecc->p.bit_size);
ecc->p.bit_size, n, size); fprintf (stderr, " n = ");
gmp_fprintf (stderr, "p = %Nx,\n %Nx\n", mpn_out_str (stderr, 16, n, size);
p, size, p + size, size);
gmp_fprintf (stderr, "q = %Nx,\n %Nx\n", fprintf (stderr, "\np = ");
q, size, q + size, size); 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 (); abort ();
} }
} }
...@@ -100,4 +100,3 @@ test_main (void) ...@@ -100,4 +100,3 @@ test_main (void)
mpz_clear (r); mpz_clear (r);
gmp_randclear (rands); 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