1BN_CMP(3)                           OpenSSL                          BN_CMP(3)
2
3
4

NAME

6       BN_cmp, BN_ucmp, BN_is_zero, BN_is_one, BN_is_word, BN_abs_is_word,
7       BN_is_odd - BIGNUM comparison and test functions
8

SYNOPSIS

10        #include <openssl/bn.h>
11
12        int BN_cmp(const BIGNUM *a, const BIGNUM *b);
13        int BN_ucmp(const BIGNUM *a, const BIGNUM *b);
14
15        int BN_is_zero(const BIGNUM *a);
16        int BN_is_one(const BIGNUM *a);
17        int BN_is_word(const BIGNUM *a, const BN_ULONG w);
18        int BN_abs_is_word(const BIGNUM *a, const BN_ULONG w);
19        int BN_is_odd(const BIGNUM *a);
20

DESCRIPTION

22       BN_cmp() compares the numbers a and b. BN_ucmp() compares their
23       absolute values.
24
25       BN_is_zero(), BN_is_one(), BN_is_word() and BN_abs_is_word() test if a
26       equals 0, 1, w, or |w| respectively.  BN_is_odd() tests if a is odd.
27

RETURN VALUES

29       BN_cmp() returns -1 if a < b, 0 if a == b and 1 if a > b. BN_ucmp() is
30       the same using the absolute values of a and b.
31
32       BN_is_zero(), BN_is_one() BN_is_word(), BN_abs_is_word() and
33       BN_is_odd() return 1 if the condition is true, 0 otherwise.
34

HISTORY

36       Prior to OpenSSL 1.1.0, BN_is_zero(), BN_is_one(), BN_is_word(),
37       BN_abs_is_word() and BN_is_odd() were macros.
38
40       Copyright 2000-2021 The OpenSSL Project Authors. All Rights Reserved.
41
42       Licensed under the OpenSSL license (the "License").  You may not use
43       this file except in compliance with the License.  You can obtain a copy
44       in the file LICENSE in the source distribution or at
45       <https://www.openssl.org/source/license.html>.
46
47
48
491.1.1q                            2023-02-06                         BN_CMP(3)
Impressum