aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/bn/bn.h
diff options
context:
space:
mode:
authorAndy Polyakov <appro@openssl.org>2008-10-15 10:48:52 +0000
committerAndy Polyakov <appro@openssl.org>2008-10-15 10:48:52 +0000
commit256b3e9c5fe94e96873cc54e7d7b0c630b68c191 (patch)
treef2aa65874d32b4fdb58c7777f376e3bcb1e5e272 /crypto/bn/bn.h
parent762a2e3cab62bb184104f3f8349a0cd609594dae (diff)
downloadopenssl-256b3e9c5fe94e96873cc54e7d7b0c630b68c191.tar.gz
Optimize bn_correct_top.
Diffstat (limited to 'crypto/bn/bn.h')
-rw-r--r--crypto/bn/bn.h8
1 files changed, 5 insertions, 3 deletions
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); \
}