summaryrefslogtreecommitdiff
path: root/mpz/powm_sec.c
diff options
context:
space:
mode:
authorMarco Bodrato <bodrato@mail.dm.unipi.it>2015-11-09 22:30:52 +0100
committerMarco Bodrato <bodrato@mail.dm.unipi.it>2015-11-09 22:30:52 +0100
commit7acd63c08b3b969696681ee8125ea63e543998c8 (patch)
treefccdc23ceb50b4647ac4dd5848c9170972c3030d /mpz/powm_sec.c
parente97517c73c6a962a9d2cd519adcc639087cd1a75 (diff)
downloadgmp-7acd63c08b3b969696681ee8125ea63e543998c8.tar.gz
mpz: Lazy allocation.
Diffstat (limited to 'mpz/powm_sec.c')
-rw-r--r--mpz/powm_sec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mpz/powm_sec.c b/mpz/powm_sec.c
index 98644ca49..c693023ab 100644
--- a/mpz/powm_sec.c
+++ b/mpz/powm_sec.c
@@ -60,7 +60,7 @@ mpz_powm_sec (mpz_ptr r, mpz_srcptr b, mpz_srcptr e, mpz_srcptr m)
/* b^0 mod m, b is anything and m is non-zero.
Result is 1 mod m, i.e., 1 or 0 depending on if m = 1. */
SIZ(r) = n != 1 || mp[0] != 1;
- PTR(r)[0] = 1;
+ MPZ_NEWALLOC (r, 1)[0] = 1;
return;
}
DIVIDE_BY_ZERO;