]> git.ipfire.org Git - thirdparty/nettle.git/commitdiff
Enable ecc-redc-test, also with mini-gmp.
authorNiels Möller <nisse@lysator.liu.se>
Fri, 3 Oct 2014 14:42:19 +0000 (16:42 +0200)
committerNiels Möller <nisse@lysator.liu.se>
Fri, 3 Oct 2014 14:42:19 +0000 (16:42 +0200)
ChangeLog
testsuite/ecc-redc-test.c

index 8ef735499f6adf659e44eb8c5ef0040fbc6bd343..88046b7ba71e4dff753f0b81f207be9d33cde094 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,13 +1,16 @@
 2014-10-03  Niels Möller  <nisse@lysator.liu.se>
 
+       * testsuite/ecc-redc-test.c [NETTLE_USE_MINI_GMP]: Enable test. 
+       (test_main): Replace gmp_fprintf calls.
+
        * testsuite/ecc-modinv-test.c [NETTLE_USE_MINI_GMP]: Enable test.
        (ref_modinv): Use mpz_gcdext, instead of mpn_gcdext.
-       (test_modulo): Replace gmp_fprintf calls by plain fprintf and
-       mpn_out_str.
+       (test_modulo): Replace gmp_fprintf calls.
 
        * testsuite/ecc-mod-test.c [NETTLE_USE_MINI_GMP]: Enable test.
        (ref_mod): Use mpz_mod and mpz_limbs_copy, instead of mpn_tdiv_qr.
-       (test_modulo): Replace gmp_fprintf calls.
+       (test_modulo): Replace gmp_fprintf calls by plain fprintf and
+       mpn_out_str.
 
        * testsuite/testutils.c (mpn_out_str): New function, needed to
        replace uses of gmp_fprintf.
index aa46fb8ee98380f282c9fb419c9e7b7e86aea6cd..2d165f434b75a8b49f7fc61b905506e294e8ea55 100644 (file)
@@ -1,13 +1,5 @@
 #include "testutils.h"
 
-#if NETTLE_USE_MINI_GMP
-void
-test_main (void)
-{
-  SKIP();
-}
-#else /* ! NETTLE_USE_MINI_GMP */
-
 static void
 ref_redc (mp_limb_t *rp, const mp_limb_t *ap, const mp_limb_t *mp, mp_size_t mn)
 {
@@ -80,9 +72,13 @@ test_main (void)
                {
                  fprintf (stderr, "ecc->p.reduce failed: bit_size = %u\n",
                           ecc->p.bit_size);
-                 gmp_fprintf (stderr, "a   = %Nx\n", a, 2*ecc->p.size);
-                 gmp_fprintf (stderr, "m   = %Nx (bad)\n", m, ecc->p.size);
-                 gmp_fprintf (stderr, "ref = %Nx\n", ref, ecc->p.size);
+                 fprintf (stderr, "a   = ");
+                 mpn_out_str (stderr, 16, a, 2*ecc->p.size);
+                 fprintf (stderr, "\nm   = ");
+                 mpn_out_str (stderr, 16, m, ecc->p.size);
+                 fprintf (stderr, " (bad)\nref   = ");
+                 mpn_out_str (stderr, 16, ref, ecc->p.size);
+                 fprintf (stderr, "\n");
                  abort ();
                }
            }
@@ -101,9 +97,13 @@ test_main (void)
                {
                  fprintf (stderr, "ecc_p%c1_redc failed: bit_size = %u\n",
                           (ecc->p.m[0] == 1) ? 'm' : 'p', ecc->p.bit_size);
-                 gmp_fprintf (stderr, "a   = %Nx\n", a, 2*ecc->p.size);
-                 gmp_fprintf (stderr, "m   = %Nx (bad)\n", m, ecc->p.size);
-                 gmp_fprintf (stderr, "ref = %Nx\n", ref, ecc->p.size);
+                 fprintf (stderr, "a   = ");
+                 mpn_out_str (stderr, 16, a, 2*ecc->p.size);
+                 fprintf (stderr, "\nm   = ");
+                 mpn_out_str (stderr, 16, m, ecc->p.size);
+                 fprintf (stderr, " (bad)\nref = ");
+                 mpn_out_str (stderr, 16, ref, ecc->p.size);
+                 fprintf (stderr, "\n");
                  abort ();
                }
            }
@@ -113,4 +113,3 @@ test_main (void)
   mpz_clear (r);
   gmp_randclear (rands);
 }
-#endif /* ! NETTLE_USE_MINI_GMP */