summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/bn/bn_lib.c
diff options
context:
space:
mode:
authortb <>2021-12-04 16:02:44 +0000
committertb <>2021-12-04 16:02:44 +0000
commitb51b96fb8e2e7b9cefac77dd8f6566e31a19a9a8 (patch)
treee69efe0002805e09d6a9a57be55ef27e4d28eb49 /src/lib/libcrypto/bn/bn_lib.c
parent11b62384befd3820c2cb65f8efff914c802abb8f (diff)
downloadopenbsd-b51b96fb8e2e7b9cefac77dd8f6566e31a19a9a8.tar.gz
openbsd-b51b96fb8e2e7b9cefac77dd8f6566e31a19a9a8.tar.bz2
openbsd-b51b96fb8e2e7b9cefac77dd8f6566e31a19a9a8.zip
Implement the BN_is_negative macro as a function
ok inoguchi jsing
Diffstat (limited to 'src/lib/libcrypto/bn/bn_lib.c')
-rw-r--r--src/lib/libcrypto/bn/bn_lib.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/lib/libcrypto/bn/bn_lib.c b/src/lib/libcrypto/bn/bn_lib.c
index 77ee3b1fdc..2544722ea9 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.51 2021/12/04 15:59:52 tb Exp $ */ 1/* $OpenBSD: bn_lib.c,v 1.52 2021/12/04 16:02:44 tb 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 *
@@ -1099,6 +1099,12 @@ BN_is_odd(const BIGNUM *a)
1099 return a->top > 0 && (a->d[0] & 1); 1099 return a->top > 0 && (a->d[0] & 1);
1100} 1100}
1101 1101
1102int
1103BN_is_negative(const BIGNUM *a)
1104{
1105 return a->neg != 0;
1106}
1107
1102BN_GENCB * 1108BN_GENCB *
1103BN_GENCB_new(void) 1109BN_GENCB_new(void)
1104{ 1110{