From: Niels Möller Date: Mon, 15 Nov 2021 18:48:26 +0000 (+0100) Subject: Randomize more tests X-Git-Tag: nettle_3.8_release_20220602~63 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=64ce8c77c713b267a7ad16da3ac075e099238a41;p=thirdparty%2Fnettle.git Randomize more tests --- diff --git a/ChangeLog b/ChangeLog index cbfb5fc2..1d00edf1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,11 +1,17 @@ 2021-11-15 Niels Möller + * testsuite/eddsa-compress-test.c (test_main): Use test_randomize. + * testsuite/ecc-redc-test.c (test_main): Likewise. + * testsuite/ecc-mul-g-test.c (test_main): Likewise. + * testsuite/ecc-mul-a-test.c (test_main): Likewise. + * testsuite/ecc-modinv-test.c (test_modulo): Trim allocation for result area. - * testsuite/ecc-sqrt-test.c (test_sqrt, test_sqrt_ratio): Likewise. - - * testsuite/ecc-sqrt-test.c (test_sqrt_ratio): Fix sqrt_ratio test - for v = 0, failure is expected. + (test_main): Use test_randomize. + * testsuite/ecc-sqrt-test.c (test_sqrt): Trim allocation. + (test_sqrt_ratio): Trim allocation. Fix sqrt_ratio test for v = 0, + failure is expected. + (test_main): Use test_randomize. 2021-11-13 Niels Möller diff --git a/testsuite/ecc-modinv-test.c b/testsuite/ecc-modinv-test.c index 4abfdc7d..aecfb43b 100644 --- a/testsuite/ecc-modinv-test.c +++ b/testsuite/ecc-modinv-test.c @@ -140,6 +140,7 @@ test_main (void) unsigned i; gmp_randinit_default (rands); + test_randomize(rands); for (i = 0; ecc_curves[i]; i++) { diff --git a/testsuite/ecc-mul-a-test.c b/testsuite/ecc-mul-a-test.c index a865d487..9d19762f 100644 --- a/testsuite/ecc-mul-a-test.c +++ b/testsuite/ecc-mul-a-test.c @@ -8,6 +8,7 @@ test_main (void) unsigned i; gmp_randinit_default (rands); + test_randomize (rands); mpz_init (r); for (i = 0; ecc_curves[i]; i++) diff --git a/testsuite/ecc-mul-g-test.c b/testsuite/ecc-mul-g-test.c index 461901af..e2396ad0 100644 --- a/testsuite/ecc-mul-g-test.c +++ b/testsuite/ecc-mul-g-test.c @@ -8,6 +8,8 @@ test_main (void) unsigned i; gmp_randinit_default (rands); + test_randomize(rands); + mpz_init (r); for (i = 0; ecc_curves[i]; i++) diff --git a/testsuite/ecc-redc-test.c b/testsuite/ecc-redc-test.c index 3e029792..476a6db1 100644 --- a/testsuite/ecc-redc-test.c +++ b/testsuite/ecc-redc-test.c @@ -51,6 +51,7 @@ test_main (void) mpz_t r; gmp_randinit_default (rands); + test_randomize(rands); mpz_init (r); diff --git a/testsuite/ecc-sqrt-test.c b/testsuite/ecc-sqrt-test.c index 377e1870..3bb915c8 100644 --- a/testsuite/ecc-sqrt-test.c +++ b/testsuite/ecc-sqrt-test.c @@ -292,6 +292,8 @@ test_main (void) unsigned i; gmp_randinit_default (rands); + test_randomize(rands); + for (i = 0; ecc_curves[i]; i++) { if (ecc_curves[i]->p.sqrt) diff --git a/testsuite/eddsa-compress-test.c b/testsuite/eddsa-compress-test.c index 640421c5..e17a869c 100644 --- a/testsuite/eddsa-compress-test.c +++ b/testsuite/eddsa-compress-test.c @@ -42,6 +42,7 @@ void test_main (void) unsigned i; gmp_randinit_default (rands); + test_randomize(rands); for (i = 0; ecc_curves[i]; i++) {