From: jsing Date: Mon, 13 Feb 2023 04:03:38 +0000 (+0000) Subject: Simplify BN_set_negative(). X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=1c33081b158d6d8e6d1fd755233b65a604d88a96;p=openbsd Simplify BN_set_negative(). ok tb@ --- diff --git a/lib/libcrypto/bn/bn_lib.c b/lib/libcrypto/bn/bn_lib.c index 5bfdacb2c63..e00909bb3ba 100644 --- a/lib/libcrypto/bn/bn_lib.c +++ b/lib/libcrypto/bn/bn_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bn_lib.c,v 1.72 2023/01/14 15:12:27 jsing Exp $ */ +/* $OpenBSD: bn_lib.c,v 1.73 2023/02/13 04:03:38 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -728,12 +728,9 @@ BN_mask_bits(BIGNUM *a, int n) } void -BN_set_negative(BIGNUM *a, int b) +BN_set_negative(BIGNUM *bn, int neg) { - if (b && !BN_is_zero(a)) - a->neg = 1; - else - a->neg = 0; + bn->neg = (neg != 0) && !BN_is_zero(bn); } int