From 0d7702c3ee952ddb2f4d922c52d014cf4bd193d1 Mon Sep 17 00:00:00 2001
From: Paul Bakker
Date: Tue, 29 Oct 2013 16:18:35 +0100
Subject: [PATCH] Minor change that makes life easier for static analyzers /
compilers
---
library/bignum.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/library/bignum.c b/library/bignum.c
index e2da5a82d..2a97a5902 100644
--- a/library/bignum.c
+++ b/library/bignum.c
@@ -1493,7 +1493,7 @@ int mpi_exp_mod( mpi *X, const mpi *A, const mpi *E, const mpi *N, mpi *_RR )
for( i = 0; i < wsize - 1; i++ )
mpi_montmul( &W[j], &W[j], N, mm, &T );
-
+
/*
* W[i] = W[i - 1] * W[1]
*/
@@ -1516,9 +1516,11 @@ int mpi_exp_mod( mpi *X, const mpi *A, const mpi *E, const mpi *N, mpi *_RR )
{
if( bufsize == 0 )
{
- if( nblimbs-- == 0 )
+ if( nblimbs == 0 )
break;
+ nblimbs--;
+
bufsize = sizeof( t_uint ) << 3;
}