diff options
author | Andy Polyakov <appro@openssl.org> | 2008-10-15 10:48:52 +0000 |
---|---|---|
committer | Andy Polyakov <appro@openssl.org> | 2008-10-15 10:48:52 +0000 |
commit | 256b3e9c5fe94e96873cc54e7d7b0c630b68c191 (patch) | |
tree | f2aa65874d32b4fdb58c7777f376e3bcb1e5e272 /crypto/bn/bn.h | |
parent | 762a2e3cab62bb184104f3f8349a0cd609594dae (diff) | |
download | openssl-256b3e9c5fe94e96873cc54e7d7b0c630b68c191.tar.gz |
Optimize bn_correct_top.
Diffstat (limited to 'crypto/bn/bn.h')
-rw-r--r-- | crypto/bn/bn.h | 8 |
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); \ } |