summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjsing <>2023-02-13 04:03:38 +0000
committerjsing <>2023-02-13 04:03:38 +0000
commitb0f0ff7e648539633669f7fb4530b8d5fc901052 (patch)
treea31b13611da9f93c8e1486be852a5002bb0b7c2b /src
parent37cc9daecdcdd1dd987c210278a1f087f587f840 (diff)
downloadopenbsd-b0f0ff7e648539633669f7fb4530b8d5fc901052.tar.gz
openbsd-b0f0ff7e648539633669f7fb4530b8d5fc901052.tar.bz2
openbsd-b0f0ff7e648539633669f7fb4530b8d5fc901052.zip
Simplify BN_set_negative().
ok tb@
Diffstat (limited to 'src')
-rw-r--r--src/lib/libcrypto/bn/bn_lib.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/lib/libcrypto/bn/bn_lib.c b/src/lib/libcrypto/bn/bn_lib.c
index 5bfdacb2c6..e00909bb3b 100644
--- a/src/lib/libcrypto/bn/bn_lib.c
+++ b/src/lib/libcrypto/bn/bn_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_lib.c,v 1.72 2023/01/14 15:12:27 jsing Exp $ */ 1/* $OpenBSD: bn_lib.c,v 1.73 2023/02/13 04:03:38 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 *
@@ -728,12 +728,9 @@ BN_mask_bits(BIGNUM *a, int n)
728} 728}
729 729
730void 730void
731BN_set_negative(BIGNUM *a, int b) 731BN_set_negative(BIGNUM *bn, int neg)
732{ 732{
733 if (b && !BN_is_zero(a)) 733 bn->neg = (neg != 0) && !BN_is_zero(bn);
734 a->neg = 1;
735 else
736 a->neg = 0;
737} 734}
738 735
739int 736int