1BN_ZERO(3)                          OpenSSL                         BN_ZERO(3)
2
3
4

NAME

6       BN_zero, BN_one, BN_value_one, BN_set_word, BN_get_word - BIGNUM
7       assignment operations
8

SYNOPSIS

10        #include <openssl/bn.h>
11
12        void BN_zero(BIGNUM *a);
13        int BN_one(BIGNUM *a);
14
15        const BIGNUM *BN_value_one(void);
16
17        int BN_set_word(BIGNUM *a, BN_ULONG w);
18        unsigned BN_ULONG BN_get_word(BIGNUM *a);
19

DESCRIPTION

21       BN_ULONG is a macro that will be an unsigned integral type optimized
22       for the most efficient implementation on the local platform.
23
24       BN_zero(), BN_one() and BN_set_word() set a to the values 0, 1 and w
25       respectively.  BN_zero() and BN_one() are macros.
26
27       BN_value_one() returns a BIGNUM constant of value 1. This constant is
28       useful for use in comparisons and assignment.
29
30       BN_get_word() returns a, if it can be represented as a BN_ULONG.
31

RETURN VALUES

33       BN_get_word() returns the value a, or all-bits-set if a cannot be
34       represented as a single integer.
35
36       BN_one() and BN_set_word() return 1 on success, 0 otherwise.
37       BN_value_one() returns the constant.  BN_zero() never fails and returns
38       no value.
39

BUGS

41       If a BIGNUM is equal to the value of all-bits-set, it will collide with
42       the error condition returned by BN_get_word() which uses that as an
43       error value.
44
45       BN_ULONG should probably be a typedef.
46

SEE ALSO

48       BN_bn2bin(3)
49

HISTORY

51       In OpenSSL 0.9.8, BN_zero() was changed to not return a value; previous
52       versions returned an int.
53
55       Copyright 2000-2018 The OpenSSL Project Authors. All Rights Reserved.
56
57       Licensed under the OpenSSL license (the "License").  You may not use
58       this file except in compliance with the License.  You can obtain a copy
59       in the file LICENSE in the source distribution or at
60       <https://www.openssl.org/source/license.html>.
61
62
63
641.1.1k                            2021-03-26                        BN_ZERO(3)
Impressum