提交 cea53815 编写于 作者: A Andy Polyakov

Get rid of redundant multiplications in bn_div_words.

上级 5f12fc00
...@@ -266,16 +266,16 @@ BN_ULONG bn_div_words(BN_ULONG h, BN_ULONG l, BN_ULONG d) ...@@ -266,16 +266,16 @@ BN_ULONG bn_div_words(BN_ULONG h, BN_ULONG l, BN_ULONG d)
for (;;) for (;;)
{ {
t=(h-q*dh); t=(h-(th=q*dh));
tl=BN_MASK2;
if ((t&BN_MASK2h) || if ((t&BN_MASK2h) ||
((dl*q) <= ( ((tl=dl*q) <= (
(t<<BN_BITS4)+ (t<<BN_BITS4)|
((l&BN_MASK2h)>>BN_BITS4)))) ((l&BN_MASK2h)>>BN_BITS4))))
break; break;
q--; q--;
} }
th=q*dh; if (tl==BN_MASK2) tl=q*dl;
tl=q*dl;
t=(tl>>BN_BITS4); t=(tl>>BN_BITS4);
tl=(tl<<BN_BITS4)&BN_MASK2h; tl=(tl<<BN_BITS4)&BN_MASK2h;
th+=t; th+=t;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册