]> git.ipfire.org Git - thirdparty/nettle.git/commitdiff
Reduce allocation in sqrt tests
authorNiels Möller <nisse@lysator.liu.se>
Mon, 15 Nov 2021 18:38:11 +0000 (19:38 +0100)
committerNiels Möller <nisse@lysator.liu.se>
Mon, 15 Nov 2021 18:38:11 +0000 (19:38 +0100)
testsuite/ecc-sqrt-test.c

index 096cbafc4720a096caf91633e2748cce07cfcb14..7984ed810cb536cd937e69689ac3b88826cd6869 100644 (file)
@@ -84,7 +84,7 @@ test_sqrt (gmp_randstate_t rands, const struct ecc_modulo *m, int use_redc)
   mpz_roinit_n (p, m->m, m->size);
 
   up = xalloc_limbs (m->size);
-  rp = xalloc_limbs (2*m->size);
+  rp = xalloc_limbs (m->size);
   scratch = xalloc_limbs (m->sqrt_itch);
 
   /* Check behaviour for zero input */
@@ -192,7 +192,7 @@ test_sqrt_ratio (gmp_randstate_t rands, const struct ecc_modulo *m)
 
   up = xalloc_limbs (m->size);
   vp = xalloc_limbs (m->size);
-  rp = xalloc_limbs (2*m->size);
+  rp = xalloc_limbs (m->size);
   scratch = xalloc_limbs (m->sqrt_ratio_itch);
 
   /* Check behaviour for zero input */