From 6880d37a07ddd593dda0858bea0e4f668fd95654 Mon Sep 17 00:00:00 2001 From: gladman Date: Tue, 17 Jan 2012 17:49:00 +0000 Subject: [PATCH] set zero for output when bits = 0 --- mpn/generic/mulmod_2expp1.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/mpn/generic/mulmod_2expp1.c b/mpn/generic/mulmod_2expp1.c index b8ffc057..11be795e 100644 --- a/mpn/generic/mulmod_2expp1.c +++ b/mpn/generic/mulmod_2expp1.c @@ -46,9 +46,12 @@ int mpn_mulmod_2expp1(mp_ptr r, mp_srcptr i1, mp_srcptr i2, mp_size_t n, mp_size if (limbs <= FFT_MULMOD_2EXPP1_CUTOFF) #endif { - mp_limb_t c = 2 * i1[limbs] + i2[limbs]; - r[limbs] = mpn_mulmod_2expp1_basecase(r, i1, i2, c, bits, tt); - return r[limbs]; + mp_limb_t c = 2 * i1[limbs] + i2[limbs]; + if(bits) + r[limbs] = mpn_mulmod_2expp1_basecase(r, i1, i2, c, bits, tt); + else + r[limbs] = 0; + return r[limbs]; } #if !defined( OLD_FFT ) while ((((mp_limb_t)1)<