From: Andy Polyakov Date: Wed, 15 Oct 2008 10:48:52 +0000 (+0000) Subject: Optimize bn_correct_top. X-Git-Tag: OpenSSL_0_9_8k^2~227 X-Git-Url: https://git.openssl.org/?p=openssl.git;a=commitdiff_plain;h=256b3e9c5fe94e96873cc54e7d7b0c630b68c191 Optimize bn_correct_top. --- diff --git a/crypto/bn/bn.h b/crypto/bn/bn.h index 4749c52341..dc0debb85a 100644 --- a/crypto/bn/bn.h +++ b/crypto/bn/bn.h @@ -752,10 +752,12 @@ int RAND_pseudo_bytes(unsigned char *buf,int num); #define bn_correct_top(a) \ { \ BN_ULONG *ftl; \ - if ((a)->top > 0) \ + int top = (a)->top; \ + if (top > 0) \ { \ - for (ftl= &((a)->d[(a)->top-1]); (a)->top > 0; (a)->top--) \ - if (*(ftl--)) break; \ + for (ftl= &((a)->d[top-1]); top > 0; top--) \ + if (*(ftl--)) break; \ + (a)->top = top; \ } \ bn_pollute(a); \ }