From 3396725b7bb54c005a72e261ca3a26b637316c1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20M=C3=B6ller?= <nisse@lysator.liu.se> Date: Fri, 4 Jul 2014 22:27:29 +0200 Subject: [PATCH] Renamed gmp_randstate_t variables to "rands". --- testsuite/ecc-mod-test.c | 10 +++++----- testsuite/ecc-modinv-test.c | 10 +++++----- testsuite/ecc-mul-a-test.c | 10 +++++----- testsuite/ecc-mul-g-test.c | 6 +++--- testsuite/ecc-redc-test.c | 10 +++++----- 5 files changed, 23 insertions(+), 23 deletions(-) diff --git a/testsuite/ecc-mod-test.c b/testsuite/ecc-mod-test.c index c6330cbe..5caee758 100644 --- a/testsuite/ecc-mod-test.c +++ b/testsuite/ecc-mod-test.c @@ -22,14 +22,14 @@ ref_mod (mp_limb_t *rp, const mp_limb_t *ap, const mp_limb_t *mp, mp_size_t mn) void test_main (void) { - gmp_randstate_t state; + gmp_randstate_t rands; mp_limb_t a[MAX_SIZE]; mp_limb_t m[MAX_SIZE]; mp_limb_t ref[MAX_SIZE]; unsigned i; mpz_t r; - gmp_randinit_default (state); + gmp_randinit_default (rands); mpz_init (r); @@ -40,9 +40,9 @@ test_main (void) for (j = 0; j < COUNT; j++) { if (j & 1) - mpz_rrandomb (r, state, 2*ecc->size * GMP_NUMB_BITS); + mpz_rrandomb (r, rands, 2*ecc->size * GMP_NUMB_BITS); else - mpz_urandomb (r, state, 2*ecc->size * GMP_NUMB_BITS); + mpz_urandomb (r, rands, 2*ecc->size * GMP_NUMB_BITS); mpz_limbs_copy (a, r, 2*ecc->size); @@ -119,6 +119,6 @@ test_main (void) } mpz_clear (r); - gmp_randclear (state); + gmp_randclear (rands); } #endif /* ! NETTLE_USE_MINI_GMP */ diff --git a/testsuite/ecc-modinv-test.c b/testsuite/ecc-modinv-test.c index 2cd5c7e3..31b5c27e 100644 --- a/testsuite/ecc-modinv-test.c +++ b/testsuite/ecc-modinv-test.c @@ -40,7 +40,7 @@ ref_modinv (mp_limb_t *rp, const mp_limb_t *ap, const mp_limb_t *mp, mp_size_t m void test_main (void) { - gmp_randstate_t state; + gmp_randstate_t rands; mp_limb_t a[MAX_ECC_SIZE]; mp_limb_t ai[MAX_ECC_SIZE]; mp_limb_t ref[MAX_ECC_SIZE]; @@ -48,7 +48,7 @@ test_main (void) unsigned i; mpz_t r; - gmp_randinit_default (state); + gmp_randinit_default (rands); mpz_init (r); for (i = 0; ecc_curves[i]; i++) @@ -58,9 +58,9 @@ test_main (void) for (j = 0; j < COUNT; j++) { if (j & 1) - mpz_rrandomb (r, state, ecc->size * GMP_NUMB_BITS); + mpz_rrandomb (r, rands, ecc->size * GMP_NUMB_BITS); else - mpz_urandomb (r, state, ecc->size * GMP_NUMB_BITS); + mpz_urandomb (r, rands, ecc->size * GMP_NUMB_BITS); mpz_limbs_copy (a, r, ecc->size); @@ -110,7 +110,7 @@ test_main (void) } } } - gmp_randclear (state); + gmp_randclear (rands); mpz_clear (r); } #endif /* ! NETTLE_USE_MINI_GMP */ diff --git a/testsuite/ecc-mul-a-test.c b/testsuite/ecc-mul-a-test.c index aa7b5c2b..eef09c72 100644 --- a/testsuite/ecc-mul-a-test.c +++ b/testsuite/ecc-mul-a-test.c @@ -11,11 +11,11 @@ test_main (void) void test_main (void) { - gmp_randstate_t state; + gmp_randstate_t rands; mpz_t r; unsigned i; - gmp_randinit_default (state); + gmp_randinit_default (rands); mpz_init (r); for (i = 0; ecc_curves[i]; i++) @@ -72,9 +72,9 @@ test_main (void) for (j = 0; j < 100; j++) { if (j & 1) - mpz_rrandomb (r, state, size * GMP_NUMB_BITS); + mpz_rrandomb (r, rands, size * GMP_NUMB_BITS); else - mpz_urandomb (r, state, size * GMP_NUMB_BITS); + mpz_urandomb (r, rands, size * GMP_NUMB_BITS); /* Reduce so that (almost surely) n < q */ mpz_limbs_copy (n, r, size); @@ -106,6 +106,6 @@ test_main (void) free (scratch); } mpz_clear (r); - gmp_randclear (state); + gmp_randclear (rands); } #endif /* ! NETTLE_USE_MINI_GMP */ diff --git a/testsuite/ecc-mul-g-test.c b/testsuite/ecc-mul-g-test.c index 64bfd2d0..9db5b9ef 100644 --- a/testsuite/ecc-mul-g-test.c +++ b/testsuite/ecc-mul-g-test.c @@ -11,11 +11,11 @@ test_main (void) void test_main (void) { - gmp_randstate_t state; + gmp_randstate_t rands; mpz_t r; unsigned i; - gmp_randinit_default (state); + gmp_randinit_default (rands); mpz_init (r); for (i = 0; ecc_curves[i]; i++) @@ -62,6 +62,6 @@ test_main (void) free (scratch); } mpz_clear (r); - gmp_randclear (state); + gmp_randclear (rands); } #endif /* ! NETTLE_USE_MINI_GMP */ diff --git a/testsuite/ecc-redc-test.c b/testsuite/ecc-redc-test.c index 4ee8b458..1b0fe51d 100644 --- a/testsuite/ecc-redc-test.c +++ b/testsuite/ecc-redc-test.c @@ -42,14 +42,14 @@ ref_redc (mp_limb_t *rp, const mp_limb_t *ap, const mp_limb_t *mp, mp_size_t mn) void test_main (void) { - gmp_randstate_t state; + gmp_randstate_t rands; mp_limb_t a[MAX_SIZE]; mp_limb_t m[MAX_SIZE]; mp_limb_t ref[MAX_SIZE]; unsigned i; mpz_t r; - gmp_randinit_default (state); + gmp_randinit_default (rands); mpz_init (r); @@ -63,9 +63,9 @@ test_main (void) for (j = 0; j < COUNT; j++) { if (j & 1) - mpz_rrandomb (r, state, 2*ecc->size * GMP_NUMB_BITS); + mpz_rrandomb (r, rands, 2*ecc->size * GMP_NUMB_BITS); else - mpz_urandomb (r, state, 2*ecc->size * GMP_NUMB_BITS); + mpz_urandomb (r, rands, 2*ecc->size * GMP_NUMB_BITS); mpz_limbs_copy (a, r, 2*ecc->size); @@ -104,6 +104,6 @@ test_main (void) } mpz_clear (r); - gmp_randclear (state); + gmp_randclear (rands); } #endif /* ! NETTLE_USE_MINI_GMP */ -- GitLab