1BN_new(3) OpenSSL BN_new(3)
2
3
4
6 BN_new, BN_init, BN_clear, BN_free, BN_clear_free - allocate and free
7 BIGNUMs
8
10 #include <openssl/bn.h>
11
12 BIGNUM *BN_new(void);
13
14 void BN_init(BIGNUM *);
15
16 void BN_clear(BIGNUM *a);
17
18 void BN_free(BIGNUM *a);
19
20 void BN_clear_free(BIGNUM *a);
21
23 BN_new() allocates and initializes a BIGNUM structure. BN_init()
24 initializes an existing uninitialized BIGNUM.
25
26 BN_clear() is used to destroy sensitive data such as keys when they are
27 no longer needed. It erases the memory used by a and sets it to the
28 value 0.
29
30 BN_free() frees the components of the BIGNUM, and if it was created by
31 BN_new(), also the structure itself. BN_clear_free() additionally
32 overwrites the data before the memory is returned to the system.
33
35 BN_new() returns a pointer to the BIGNUM. If the allocation fails, it
36 returns NULL and sets an error code that can be obtained by
37 ERR_get_error(3).
38
39 BN_init(), BN_clear(), BN_free() and BN_clear_free() have no return
40 values.
41
43 bn(3), ERR_get_error(3)
44
46 BN_new(), BN_clear(), BN_free() and BN_clear_free() are available in
47 all versions on SSLeay and OpenSSL. BN_init() was added in SSLeay
48 0.9.1b.
49
50
51
521.0.2k 2017-01-26 BN_new(3)