1BN_CMP(3ossl)                       OpenSSL                      BN_CMP(3ossl)
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 Apache License 2.0 (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
493.0.9                             2023-07-27                     BN_CMP(3ossl)
Impressum