summaryrefslogtreecommitdiff
path: root/mpz
diff options
context:
space:
mode:
authorMarco Bodrato <bodrato@mail.dm.unipi.it>2016-12-28 18:33:53 +0100
committerMarco Bodrato <bodrato@mail.dm.unipi.it>2016-12-28 18:33:53 +0100
commit448a2dcc7c37af92056008f036c9a275762a6838 (patch)
treea663e8791a6e402a4ffce1cfd18e0dcd63746b21 /mpz
parent4eb313830acae0a7b7c4be0d15aabe43c6b2356a (diff)
downloadgmp-448a2dcc7c37af92056008f036c9a275762a6838.tar.gz
mpz/powm_sec.c: Use TMP_ALLOC_LIMBS_x macros
Diffstat (limited to 'mpz')
-rw-r--r--mpz/powm_sec.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/mpz/powm_sec.c b/mpz/powm_sec.c
index 19915b1b6..a2581a8a4 100644
--- a/mpz/powm_sec.c
+++ b/mpz/powm_sec.c
@@ -75,9 +75,8 @@ mpz_powm_sec (mpz_ptr r, mpz_srcptr b, mpz_srcptr e, mpz_srcptr m)
}
TMP_MARK;
- tp = TMP_ALLOC_LIMBS (n + mpn_sec_powm_itch (bn, en * GMP_NUMB_BITS, n));
-
- rp = tp; tp += n;
+ TMP_ALLOC_LIMBS_2 (rp, n,
+ tp, mpn_sec_powm_itch (bn, en * GMP_NUMB_BITS, n));
bp = PTR(b);
ep = PTR(e);
@@ -95,7 +94,7 @@ mpz_powm_sec (mpz_ptr r, mpz_srcptr b, mpz_srcptr e, mpz_srcptr m)
MPN_NORMALIZE (rp, rn);
}
- MPZ_REALLOC (r, rn);
+ MPZ_NEWALLOC (r, rn);
SIZ(r) = rn;
MPN_COPY (PTR(r), rp, rn);