1BN_zero(3) OpenSSL BN_zero(3)
2
3
4
6 BN_zero, BN_one, BN_value_one, BN_set_word, BN_get_word - BIGNUM
7 assignment operations
8
10 #include <openssl/bn.h>
11
12 int 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 BN_ULONG BN_get_word(BIGNUM *a);
19
21 BN_ULONG is a macro that will be an unsigned integral type optimied for
22 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
33 BN_get_word() returns the value a, or all-bits-set if a cannot be
34 represented as a BN_ULONG.
35
36 BN_zero(), BN_one() and BN_set_word() return 1 on success, 0 otherwise.
37 BN_value_one() returns the constant.
38
40 If a BIGNUM is equal to the value of all-bits-set, it will collide with
41 the error condition returned by BN_get_word() which uses that as an
42 error value.
43
44 BN_ULONG should probably be a typedef.
45
47 bn(3), BN_bn2bin(3)
48
50 BN_zero(), BN_one() and BN_set_word() are available in all versions of
51 SSLeay and OpenSSL. BN_value_one() and BN_get_word() were added in
52 SSLeay 0.8.
53
54 BN_value_one() was changed to return a true const BIGNUM * in OpenSSL
55 0.9.7.
56
57
58
591.0.2o 2020-08-01 BN_zero(3)