diff --git a/ChangeLog b/ChangeLog index 3b469555ff556abf02393680877c0987305ec537..ea613b72eb80dd8fa99db628d4b43e9362114314 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2014-09-17 Niels Möller <nisse@lysator.liu.se> + * testsuite/ecc-modinv-test.c (mpn_zero_p): Moved function, to... + * testsuite/testutils.c (mpn_zero_p): New location. Also make + non-static. + * testsuite/testutils.c (ecc_curves): Include curve25519 in list. (test_ecc_mul_a): Include reference points for curve25519 (with Edwards coordinates). Allow n == 1, and compare to the generator. diff --git a/testsuite/ecc-modinv-test.c b/testsuite/ecc-modinv-test.c index ee4267dc811a6bbdb1bb47843f1292a7a79cb10d..7324880a7a056a09bfea78954894340fe055b1e7 100644 --- a/testsuite/ecc-modinv-test.c +++ b/testsuite/ecc-modinv-test.c @@ -37,17 +37,6 @@ ref_modinv (mp_limb_t *rp, const mp_limb_t *ap, const mp_limb_t *mp, mp_size_t m #define MAX_ECC_SIZE (1 + 521 / GMP_NUMB_BITS) #define COUNT 500 -static int -mpn_zero_p (mp_srcptr ap, mp_size_t n) -{ - while (--n >= 0) - { - if (ap[n] != 0) - return 0; - } - return 1; -} - void test_main (void) { diff --git a/testsuite/testutils.c b/testsuite/testutils.c index 095af95a7948e984f7b93cddb71eab2c8d9f5be7..71d64f018feae3acc7c9111eaf2798a749336f69 100644 --- a/testsuite/testutils.c +++ b/testsuite/testutils.c @@ -686,6 +686,19 @@ mpz_combit (mpz_t x, unsigned long int bit) } #endif +#ifndef mpn_zero_p +int +mpn_zero_p (mp_srcptr ap, mp_size_t n) +{ + while (--n >= 0) + { + if (ap[n] != 0) + return 0; + } + return 1; +} +#endif + mp_limb_t * xalloc_limbs (mp_size_t n) { diff --git a/testsuite/testutils.h b/testsuite/testutils.h index b7a7d0396ae3027463b2625f34078a4ee4be50a9..7f2135b88b487e6668e1d6e8c090ee731ada53e7 100644 --- a/testsuite/testutils.h +++ b/testsuite/testutils.h @@ -157,6 +157,11 @@ test_armor(const struct nettle_armor *armor, const uint8_t *ascii); #if WITH_HOGWEED +#ifndef mpn_zero_p +int +mpn_zero_p (mp_srcptr ap, mp_size_t n); +#endif + mp_limb_t * xalloc_limbs (mp_size_t n);