summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/bn/bn_mont.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/lib/libcrypto/bn/bn_mont.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/libcrypto/bn/bn_mont.c b/src/lib/libcrypto/bn/bn_mont.c
index 6e3d3fa0c8..4f2d4548cc 100644
--- a/src/lib/libcrypto/bn/bn_mont.c
+++ b/src/lib/libcrypto/bn/bn_mont.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_mont.c,v 1.36 2023/02/01 06:23:13 jsing Exp $ */ 1/* $OpenBSD: bn_mont.c,v 1.37 2023/02/13 04:25:37 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -413,9 +413,9 @@ BN_mod_mul_montgomery(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
413 if (!bn_wexpand(r, num)) 413 if (!bn_wexpand(r, num))
414 return (0); 414 return (0);
415 if (bn_mul_mont(r->d, a->d, b->d, mont->N.d, mont->n0, num)) { 415 if (bn_mul_mont(r->d, a->d, b->d, mont->N.d, mont->n0, num)) {
416 r->neg = a->neg^b->neg;
417 r->top = num; 416 r->top = num;
418 bn_correct_top(r); 417 bn_correct_top(r);
418 BN_set_negative(r, a->neg ^ b->neg);
419 return (1); 419 return (1);
420 } 420 }
421 } 421 }
@@ -471,7 +471,7 @@ BN_from_montgomery_word(BIGNUM *ret, BIGNUM *r, BN_MONT_CTX *mont)
471 if (!bn_wexpand(r, max)) 471 if (!bn_wexpand(r, max))
472 return (0); 472 return (0);
473 473
474 r->neg ^= n->neg; 474 BN_set_negative(r, r->neg ^ n->neg);
475 np = n->d; 475 np = n->d;
476 rp = r->d; 476 rp = r->d;
477 477
@@ -497,7 +497,7 @@ BN_from_montgomery_word(BIGNUM *ret, BIGNUM *r, BN_MONT_CTX *mont)
497 if (!bn_wexpand(ret, nl)) 497 if (!bn_wexpand(ret, nl))
498 return (0); 498 return (0);
499 ret->top = nl; 499 ret->top = nl;
500 ret->neg = r->neg; 500 BN_set_negative(ret, r->neg);
501 501
502 rp = ret->d; 502 rp = ret->d;
503 ap = &(r->d[nl]); 503 ap = &(r->d[nl]);