1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
.Dd $Mdocdate: November 6 2016 $
.Dt BN 3
.Os
.Sh NAME
.Nm bn
.Nd multiprecision integer arithmetics
.Sh SYNOPSIS
.In openssl/bn.h
.Sh DESCRIPTION
This library performs arithmetic operations on integers of arbitrary size.
It was written for use in public key cryptography, such as RSA and
Diffie-Hellman.
.Pp
It uses dynamic memory allocation for storing its data structures.
That means that there is no limit on the size of the numbers manipulated
by these functions, but return values must always be checked in case a
memory allocation error has occurred.
.Pp
The basic object in this library is a
.Vt BIGNUM .
It is used to hold a single large integer.
This type should be considered opaque and fields should not be modified
or accessed directly.
.Pp
The creation of
.Vt BIGNUM
objects is described in
.Xr BN_new 3 ;
.Xr BN_add 3
describes most of the arithmetic operations.
Comparison is described in
.Xr BN_cmp 3 ;
.Xr BN_zero 3
describes certain assignments,
.Xr BN_rand 3
the generation of random numbers,
.Xr BN_generate_prime 3
deals with prime numbers and
.Xr BN_set_bit 3
with bit operations.
The conversion of
.Vt BIGNUM Ns s
to external formats is described in
.Xr BN_bn2bin 3 .
.Sh SEE ALSO
.Xr BN_add 3 ,
.Xr BN_add_word 3 ,
.Xr BN_BLINDING_new 3 ,
.Xr BN_bn2bin 3 ,
.Xr BN_cmp 3 ,
.Xr BN_copy 3 ,
.Xr BN_CTX_new 3 ,
.Xr BN_CTX_start 3 ,
.Xr bn_dump 3 ,
.Xr BN_generate_prime 3 ,
.Xr BN_mod_inverse 3 ,
.Xr BN_mod_mul_montgomery 3 ,
.Xr BN_mod_mul_reciprocal 3 ,
.Xr BN_new 3 ,
.Xr BN_num_bytes 3 ,
.Xr BN_rand 3 ,
.Xr BN_set_bit 3 ,
.Xr BN_set_negative 3 ,
.Xr BN_swap 3 ,
.Xr BN_zero 3 ,
.Xr dh 3 ,
.Xr ERR 3 ,
.Xr rsa 3
|