summaryrefslogtreecommitdiff
path: root/mpi/mpi-bit.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2007-03-23 19:55:14 +0000
committerWerner Koch <wk@gnupg.org>2007-03-23 19:55:14 +0000
commit5c8ee46baeed3d72945729e5792213cc6850782d (patch)
treee1965e98d6789c5fee6740038d83d41c539dd6ae /mpi/mpi-bit.c
parenta2070cf05cffd66ee71a7d1af5084865d43a77cb (diff)
downloadlibgcrypt-5c8ee46baeed3d72945729e5792213cc6850782d.tar.gz
Did some performance experiments and added code for Barrett reduction.
Diffstat (limited to 'mpi/mpi-bit.c')
-rw-r--r--mpi/mpi-bit.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/mpi/mpi-bit.c b/mpi/mpi-bit.c
index fe4895dc..b60e2bfb 100644
--- a/mpi/mpi-bit.c
+++ b/mpi/mpi-bit.c
@@ -279,7 +279,7 @@ gcry_mpi_rshift ( gcry_mpi_t x, gcry_mpi_t a, unsigned int n )
void
_gcry_mpi_lshift_limbs( gcry_mpi_t a, unsigned int count )
{
- mpi_ptr_t ap = a->d;
+ mpi_ptr_t ap;
int n = a->nlimbs;
int i;
@@ -288,6 +288,7 @@ _gcry_mpi_lshift_limbs( gcry_mpi_t a, unsigned int count )
RESIZE_IF_NEEDED( a, n+count );
+ ap = a->d;
for( i = n-1; i >= 0; i-- )
ap[i+count] = ap[i];
for(i=0; i < count; i++ )