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_is_odd - BIGNUM
7       comparison and test functions
8

SYNOPSIS

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

DESCRIPTION

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

RETURN VALUES

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

SEE ALSO

37       bn(3)
38

HISTORY

40       BN_cmp(), BN_ucmp(), BN_is_zero(), BN_is_one() and BN_is_word() are
41       available in all versions of SSLeay and OpenSSL.  BN_is_odd() was added
42       in SSLeay 0.8.
43
44
45
461.0.2o                            2020-08-01                         BN_cmp(3)
Impressum