From fdf3f0e671e13b63c3d35c032aaf61d38b351283 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Tue, 11 Mar 2014 13:47:05 +0100 Subject: [PATCH] Avoid "unreachable code" warning --- library/bignum.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/library/bignum.c b/library/bignum.c index cb55586ff..a73bf7665 100644 --- a/library/bignum.c +++ b/library/bignum.c @@ -1441,14 +1441,13 @@ int mpi_mod_int( t_uint *r, const mpi *A, t_sint b ) static void mpi_montg_init( t_uint *mm, const mpi *N ) { t_uint x, m0 = N->p[0]; + unsigned int i; x = m0; x += ( ( m0 + 2 ) & 4 ) << 1; - x *= ( 2 - ( m0 * x ) ); - if( biL >= 16 ) x *= ( 2 - ( m0 * x ) ); - if( biL >= 32 ) x *= ( 2 - ( m0 * x ) ); - if( biL >= 64 ) x *= ( 2 - ( m0 * x ) ); + for( i = biL; i >= 8; i /= 2 ) + x *= ( 2 - ( m0 * x ) ); *mm = ~x + 1; }