summaryrefslogtreecommitdiffstats
path: root/crypto/bn/bn_mont.c
diff options
context:
space:
mode:
authorAndy Polyakov <appro@openssl.org>2005-10-06 09:12:39 +0000
committerAndy Polyakov <appro@openssl.org>2005-10-06 09:12:39 +0000
commitca04d7a20842b2de39264b6c1605c3443fc09d16 (patch)
tree855379855c1710b7d5026f14bbe92439af145705 /crypto/bn/bn_mont.c
parent40a3c1230543c39d03a06e7b00e726313f9dd262 (diff)
Leave the decision to call/implement bn_sqr_mont to assembler developer.
Diffstat (limited to 'crypto/bn/bn_mont.c')
-rw-r--r--crypto/bn/bn_mont.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/crypto/bn/bn_mont.c b/crypto/bn/bn_mont.c
index f70f8ab3ef..9ba69859c4 100644
--- a/crypto/bn/bn_mont.c
+++ b/crypto/bn/bn_mont.c
@@ -80,14 +80,13 @@ int BN_mod_mul_montgomery(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
if (num>1 && a->top==num && b->top==num)
{
if (bn_wexpand(r,num) == NULL) return 0;
- r->neg = a->neg^b->neg;
- r->top = num;
- if (a==b)
- bn_sqr_mont(r->d,a->d,mont->N.d,mont->n0,num);
- else
- bn_mul_mont(r->d,a->d,b->d,mont->N.d,mont->n0,num);
- bn_fix_top(r);
- return 1;
+ if (bn_mul_mont(r->d,a->d,b->d,mont->N.d,mont->n0,num))
+ {
+ r->neg = a->neg^b->neg;
+ r->top = num;
+ bn_fix_top(r);
+ return 1;
+ }
}
#endif