From b51b96fb8e2e7b9cefac77dd8f6566e31a19a9a8 Mon Sep 17 00:00:00 2001 From: tb <> Date: Sat, 4 Dec 2021 16:02:44 +0000 Subject: Implement the BN_is_negative macro as a function ok inoguchi jsing --- src/lib/libcrypto/bn/bn.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/lib/libcrypto/bn/bn.h') diff --git a/src/lib/libcrypto/bn/bn.h b/src/lib/libcrypto/bn/bn.h index e9837cbbd6..4bfb81d32e 100644 --- a/src/lib/libcrypto/bn/bn.h +++ b/src/lib/libcrypto/bn/bn.h @@ -1,4 +1,4 @@ -/* $OpenBSD: bn.h,v 1.47 2021/12/04 15:59:52 tb Exp $ */ +/* $OpenBSD: bn.h,v 1.48 2021/12/04 16:02:44 tb Exp $ */ /* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -485,11 +485,16 @@ int BN_sqr(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx); * \param n 0 if the BIGNUM b should be positive and a value != 0 otherwise */ void BN_set_negative(BIGNUM *b, int n); + +#if defined(LIBRESSL_OPAQUE_BN) || defined(LIBRESSL_CRYPTO_INTERNAL) +int BN_is_negative(const BIGNUM *b); +#else /** BN_is_negative returns 1 if the BIGNUM is negative * \param a pointer to the BIGNUM object * \return 1 if a < 0 and 0 otherwise */ #define BN_is_negative(a) ((a)->neg != 0) +#endif #ifndef LIBRESSL_INTERNAL int BN_div(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m, const BIGNUM *d, -- cgit v1.2.3-55-g6feb