From c3ec63df42e84ff37c4b4e34cbfb264e69318b66 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 1422d5026..504f51bd4 100644 --- a/library/bignum.c +++ b/library/bignum.c @@ -1480,7 +1480,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] */ @@ -1503,9 +1503,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; }