summaryrefslogtreecommitdiff
path: root/src/lib/libssl
diff options
context:
space:
mode:
authorschwarze <>2015-02-23 17:43:24 +0000
committerschwarze <>2015-02-23 17:43:24 +0000
commit9cb1a51933a1847042ee88e16d560485f682bcad (patch)
tree5a76fb973ee649bdb33c7731bc1ca457abfcec1e /src/lib/libssl
parent2820d04ee847cb7bede0b25e49194c3ade7ebdbf (diff)
downloadopenbsd-9cb1a51933a1847042ee88e16d560485f682bcad.tar.gz
openbsd-9cb1a51933a1847042ee88e16d560485f682bcad.tar.bz2
openbsd-9cb1a51933a1847042ee88e16d560485f682bcad.zip
fourth batch of perlpod(1) to mdoc(7) conversion
Diffstat (limited to 'src/lib/libssl')
-rw-r--r--src/lib/libssl/src/doc/crypto/BN_BLINDING_new.pod115
-rw-r--r--src/lib/libssl/src/doc/crypto/BN_CTX_new.pod57
-rw-r--r--src/lib/libssl/src/doc/crypto/BN_CTX_start.pod52
-rw-r--r--src/lib/libssl/src/doc/crypto/BN_add.pod127
-rw-r--r--src/lib/libssl/src/doc/crypto/BN_add_word.pod61
-rw-r--r--src/lib/libssl/src/doc/crypto/BN_bn2bin.pod95
-rw-r--r--src/lib/libssl/src/doc/crypto/BN_cmp.pod49
-rw-r--r--src/lib/libssl/src/doc/crypto/BN_copy.pod34
-rw-r--r--src/lib/libssl/src/doc/crypto/BN_generate_prime.pod149
-rw-r--r--src/lib/libssl/src/doc/crypto/BN_mod_inverse.pod36
-rw-r--r--src/lib/libssl/src/doc/crypto/BN_mod_mul_montgomery.pod101
-rw-r--r--src/lib/libssl/src/doc/crypto/BN_mod_mul_reciprocal.pod81
-rw-r--r--src/lib/libssl/src/doc/crypto/BN_new.pod53
-rw-r--r--src/lib/libssl/src/doc/crypto/BN_num_bytes.pod57
-rw-r--r--src/lib/libssl/src/doc/crypto/BN_rand.pod56
-rw-r--r--src/lib/libssl/src/doc/crypto/BN_set_bit.pod66
-rw-r--r--src/lib/libssl/src/doc/crypto/BN_swap.pod25
-rw-r--r--src/lib/libssl/src/doc/crypto/BN_zero.pod59
18 files changed, 0 insertions, 1273 deletions
diff --git a/src/lib/libssl/src/doc/crypto/BN_BLINDING_new.pod b/src/lib/libssl/src/doc/crypto/BN_BLINDING_new.pod
deleted file mode 100644
index 1c586ac54e..0000000000
--- a/src/lib/libssl/src/doc/crypto/BN_BLINDING_new.pod
+++ /dev/null
@@ -1,115 +0,0 @@
1=pod
2
3=head1 NAME
4
5BN_BLINDING_new, BN_BLINDING_free, BN_BLINDING_update, BN_BLINDING_convert,
6BN_BLINDING_invert, BN_BLINDING_convert_ex, BN_BLINDING_invert_ex,
7BN_BLINDING_get_thread_id, BN_BLINDING_set_thread_id, BN_BLINDING_thread_id,
8BN_BLINDING_get_flags, BN_BLINDING_set_flags,
9BN_BLINDING_create_param - blinding related BIGNUM functions.
10
11=head1 SYNOPSIS
12
13 #include <openssl/bn.h>
14
15 BN_BLINDING *BN_BLINDING_new(const BIGNUM *A, const BIGNUM *Ai,
16 BIGNUM *mod);
17 void BN_BLINDING_free(BN_BLINDING *b);
18 int BN_BLINDING_update(BN_BLINDING *b,BN_CTX *ctx);
19 int BN_BLINDING_convert(BIGNUM *n, BN_BLINDING *b, BN_CTX *ctx);
20 int BN_BLINDING_invert(BIGNUM *n, BN_BLINDING *b, BN_CTX *ctx);
21 int BN_BLINDING_convert_ex(BIGNUM *n, BIGNUM *r, BN_BLINDING *b,
22 BN_CTX *ctx);
23 int BN_BLINDING_invert_ex(BIGNUM *n, const BIGNUM *r, BN_BLINDING *b,
24 BN_CTX *ctx);
25 #ifndef OPENSSL_NO_DEPRECATED
26 unsigned long BN_BLINDING_get_thread_id(const BN_BLINDING *);
27 void BN_BLINDING_set_thread_id(BN_BLINDING *, unsigned long);
28 #endif
29 CRYPTO_THREADID *BN_BLINDING_thread_id(BN_BLINDING *);
30 unsigned long BN_BLINDING_get_flags(const BN_BLINDING *);
31 void BN_BLINDING_set_flags(BN_BLINDING *, unsigned long);
32 BN_BLINDING *BN_BLINDING_create_param(BN_BLINDING *b,
33 const BIGNUM *e, BIGNUM *m, BN_CTX *ctx,
34 int (*bn_mod_exp)(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
35 const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx),
36 BN_MONT_CTX *m_ctx);
37
38=head1 DESCRIPTION
39
40BN_BLINDING_new() allocates a new B<BN_BLINDING> structure and copies
41the B<A> and B<Ai> values into the newly created B<BN_BLINDING> object.
42
43BN_BLINDING_free() frees the B<BN_BLINDING> structure.
44
45BN_BLINDING_update() updates the B<BN_BLINDING> parameters by squaring
46the B<A> and B<Ai> or, after specific number of uses and if the
47necessary parameters are set, by re-creating the blinding parameters.
48
49BN_BLINDING_convert_ex() multiplies B<n> with the blinding factor B<A>.
50If B<r> is not NULL a copy the inverse blinding factor B<Ai> will be
51returned in B<r> (this is useful if a B<RSA> object is shared among
52several threads). BN_BLINDING_invert_ex() multiplies B<n> with the
53inverse blinding factor B<Ai>. If B<r> is not NULL it will be used as
54the inverse blinding.
55
56BN_BLINDING_convert() and BN_BLINDING_invert() are wrapper
57functions for BN_BLINDING_convert_ex() and BN_BLINDING_invert_ex()
58with B<r> set to NULL.
59
60BN_BLINDING_thread_id() provides access to the B<CRYPTO_THREADID>
61object within the B<BN_BLINDING> structure. This is to help users
62provide proper locking if needed for multi-threaded use. The "thread
63id" object of a newly allocated B<BN_BLINDING> structure is
64initialised to the thread id in which BN_BLINDING_new() was called.
65
66BN_BLINDING_get_flags() returns the BN_BLINDING flags. Currently
67there are two supported flags: B<BN_BLINDING_NO_UPDATE> and
68B<BN_BLINDING_NO_RECREATE>. B<BN_BLINDING_NO_UPDATE> inhibits the
69automatic update of the B<BN_BLINDING> parameters after each use
70and B<BN_BLINDING_NO_RECREATE> inhibits the automatic re-creation
71of the B<BN_BLINDING> parameters after a fixed number of uses (currently
7232). In newly allocated B<BN_BLINDING> objects no flags are set.
73BN_BLINDING_set_flags() sets the B<BN_BLINDING> parameters flags.
74
75BN_BLINDING_create_param() creates new B<BN_BLINDING> parameters
76using the exponent B<e> and the modulus B<m>. B<bn_mod_exp> and
77B<m_ctx> can be used to pass special functions for exponentiation
78(normally BN_mod_exp_mont() and B<BN_MONT_CTX>).
79
80=head1 RETURN VALUES
81
82BN_BLINDING_new() returns the newly allocated B<BN_BLINDING> structure
83or NULL in case of an error.
84
85BN_BLINDING_update(), BN_BLINDING_convert(), BN_BLINDING_invert(),
86BN_BLINDING_convert_ex() and BN_BLINDING_invert_ex() return 1 on
87success and 0 if an error occured.
88
89BN_BLINDING_thread_id() returns a pointer to the thread id object
90within a B<BN_BLINDING> object.
91
92BN_BLINDING_get_flags() returns the currently set B<BN_BLINDING> flags
93(a B<unsigned long> value).
94
95BN_BLINDING_create_param() returns the newly created B<BN_BLINDING>
96parameters or NULL on error.
97
98=head1 SEE ALSO
99
100L<bn(3)|bn(3)>
101
102=head1 HISTORY
103
104BN_BLINDING_thread_id was first introduced in OpenSSL 1.0.0, and it
105deprecates BN_BLINDING_set_thread_id and BN_BLINDING_get_thread_id.
106
107BN_BLINDING_convert_ex, BN_BLINDIND_invert_ex, BN_BLINDING_get_thread_id,
108BN_BLINDING_set_thread_id, BN_BLINDING_set_flags, BN_BLINDING_get_flags
109and BN_BLINDING_create_param were first introduced in OpenSSL 0.9.8
110
111=head1 AUTHOR
112
113Nils Larsch for the OpenSSL project (http://www.openssl.org).
114
115=cut
diff --git a/src/lib/libssl/src/doc/crypto/BN_CTX_new.pod b/src/lib/libssl/src/doc/crypto/BN_CTX_new.pod
deleted file mode 100644
index bbedbb1778..0000000000
--- a/src/lib/libssl/src/doc/crypto/BN_CTX_new.pod
+++ /dev/null
@@ -1,57 +0,0 @@
1=pod
2
3=head1 NAME
4
5BN_CTX_new, BN_CTX_init, BN_CTX_free - allocate and free BN_CTX structures
6
7=head1 SYNOPSIS
8
9 #include <openssl/bn.h>
10
11 BN_CTX *BN_CTX_new(void);
12
13 void BN_CTX_free(BN_CTX *c);
14
15Deprecated:
16
17 void BN_CTX_init(BN_CTX *c);
18
19
20=head1 DESCRIPTION
21
22A B<BN_CTX> is a structure that holds B<BIGNUM> temporary variables used by
23library functions. Since dynamic memory allocation to create B<BIGNUM>s
24is rather expensive when used in conjunction with repeated subroutine
25calls, the B<BN_CTX> structure is used.
26
27BN_CTX_new() allocates and initializes a B<BN_CTX>
28structure.
29
30BN_CTX_free() frees the components of the B<BN_CTX>, and if it was
31created by BN_CTX_new(), also the structure itself.
32If L<BN_CTX_start(3)|BN_CTX_start(3)> has been used on the B<BN_CTX>,
33L<BN_CTX_end(3)|BN_CTX_end(3)> must be called before the B<BN_CTX>
34may be freed by BN_CTX_free().
35
36BN_CTX_init() (deprecated) initializes an existing uninitialized B<BN_CTX>.
37This should not be used for new programs. Use BN_CTX_new() instead.
38
39=head1 RETURN VALUES
40
41BN_CTX_new() returns a pointer to the B<BN_CTX>. If the allocation fails,
42it returns B<NULL> and sets an error code that can be obtained by
43L<ERR_get_error(3)|ERR_get_error(3)>.
44
45BN_CTX_init() and BN_CTX_free() have no return values.
46
47=head1 SEE ALSO
48
49L<bn(3)|bn(3)>, L<ERR_get_error(3)|ERR_get_error(3)>, L<BN_add(3)|BN_add(3)>,
50L<BN_CTX_start(3)|BN_CTX_start(3)>
51
52=head1 HISTORY
53
54BN_CTX_new() and BN_CTX_free() are available in all versions on SSLeay
55and OpenSSL. BN_CTX_init() was added in SSLeay 0.9.1b.
56
57=cut
diff --git a/src/lib/libssl/src/doc/crypto/BN_CTX_start.pod b/src/lib/libssl/src/doc/crypto/BN_CTX_start.pod
deleted file mode 100644
index dfcefe1a88..0000000000
--- a/src/lib/libssl/src/doc/crypto/BN_CTX_start.pod
+++ /dev/null
@@ -1,52 +0,0 @@
1=pod
2
3=head1 NAME
4
5BN_CTX_start, BN_CTX_get, BN_CTX_end - use temporary BIGNUM variables
6
7=head1 SYNOPSIS
8
9 #include <openssl/bn.h>
10
11 void BN_CTX_start(BN_CTX *ctx);
12
13 BIGNUM *BN_CTX_get(BN_CTX *ctx);
14
15 void BN_CTX_end(BN_CTX *ctx);
16
17=head1 DESCRIPTION
18
19These functions are used to obtain temporary B<BIGNUM> variables from
20a B<BN_CTX> (which can been created by using L<BN_CTX_new(3)|BN_CTX_new(3)>)
21in order to save the overhead of repeatedly creating and
22freeing B<BIGNUM>s in functions that are called from inside a loop.
23
24A function must call BN_CTX_start() first. Then, BN_CTX_get() may be
25called repeatedly to obtain temporary B<BIGNUM>s. All BN_CTX_get()
26calls must be made before calling any other functions that use the
27B<ctx> as an argument.
28
29Finally, BN_CTX_end() must be called before returning from the function.
30When BN_CTX_end() is called, the B<BIGNUM> pointers obtained from
31BN_CTX_get() become invalid.
32
33=head1 RETURN VALUES
34
35BN_CTX_start() and BN_CTX_end() return no values.
36
37BN_CTX_get() returns a pointer to the B<BIGNUM>, or B<NULL> on error.
38Once BN_CTX_get() has failed, the subsequent calls will return B<NULL>
39as well, so it is sufficient to check the return value of the last
40BN_CTX_get() call. In case of an error, an error code is set, which
41can be obtained by L<ERR_get_error(3)|ERR_get_error(3)>.
42
43
44=head1 SEE ALSO
45
46L<BN_CTX_new(3)|BN_CTX_new(3)>
47
48=head1 HISTORY
49
50BN_CTX_start(), BN_CTX_get() and BN_CTX_end() were added in OpenSSL 0.9.5.
51
52=cut
diff --git a/src/lib/libssl/src/doc/crypto/BN_add.pod b/src/lib/libssl/src/doc/crypto/BN_add.pod
deleted file mode 100644
index 15b28d8334..0000000000
--- a/src/lib/libssl/src/doc/crypto/BN_add.pod
+++ /dev/null
@@ -1,127 +0,0 @@
1=pod
2
3=head1 NAME
4
5BN_add, BN_sub, BN_mul, BN_sqr, BN_div, BN_mod, BN_nnmod, BN_mod_add,
6BN_mod_sub, BN_mod_mul, BN_mod_sqr, BN_exp, BN_mod_exp, BN_gcd -
7arithmetic operations on BIGNUMs
8
9=head1 SYNOPSIS
10
11 #include <openssl/bn.h>
12
13 int BN_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b);
14
15 int BN_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b);
16
17 int BN_mul(BIGNUM *r, BIGNUM *a, BIGNUM *b, BN_CTX *ctx);
18
19 int BN_sqr(BIGNUM *r, BIGNUM *a, BN_CTX *ctx);
20
21 int BN_div(BIGNUM *dv, BIGNUM *rem, const BIGNUM *a, const BIGNUM *d,
22 BN_CTX *ctx);
23
24 int BN_mod(BIGNUM *rem, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx);
25
26 int BN_nnmod(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx);
27
28 int BN_mod_add(BIGNUM *r, BIGNUM *a, BIGNUM *b, const BIGNUM *m,
29 BN_CTX *ctx);
30
31 int BN_mod_sub(BIGNUM *r, BIGNUM *a, BIGNUM *b, const BIGNUM *m,
32 BN_CTX *ctx);
33
34 int BN_mod_mul(BIGNUM *r, BIGNUM *a, BIGNUM *b, const BIGNUM *m,
35 BN_CTX *ctx);
36
37 int BN_mod_sqr(BIGNUM *r, BIGNUM *a, const BIGNUM *m, BN_CTX *ctx);
38
39 int BN_exp(BIGNUM *r, BIGNUM *a, BIGNUM *p, BN_CTX *ctx);
40
41 int BN_mod_exp(BIGNUM *r, BIGNUM *a, const BIGNUM *p,
42 const BIGNUM *m, BN_CTX *ctx);
43
44 int BN_gcd(BIGNUM *r, BIGNUM *a, BIGNUM *b, BN_CTX *ctx);
45
46=head1 DESCRIPTION
47
48BN_add() adds I<a> and I<b> and places the result in I<r> (C<r=a+b>).
49I<r> may be the same B<BIGNUM> as I<a> or I<b>.
50
51BN_sub() subtracts I<b> from I<a> and places the result in I<r> (C<r=a-b>).
52
53BN_mul() multiplies I<a> and I<b> and places the result in I<r> (C<r=a*b>).
54I<r> may be the same B<BIGNUM> as I<a> or I<b>.
55For multiplication by powers of 2, use L<BN_lshift(3)|BN_lshift(3)>.
56
57BN_sqr() takes the square of I<a> and places the result in I<r>
58(C<r=a^2>). I<r> and I<a> may be the same B<BIGNUM>.
59This function is faster than BN_mul(r,a,a).
60
61BN_div() divides I<a> by I<d> and places the result in I<dv> and the
62remainder in I<rem> (C<dv=a/d, rem=a%d>). Either of I<dv> and I<rem> may
63be B<NULL>, in which case the respective value is not returned.
64The result is rounded towards zero; thus if I<a> is negative, the
65remainder will be zero or negative.
66For division by powers of 2, use BN_rshift(3).
67
68BN_mod() corresponds to BN_div() with I<dv> set to B<NULL>.
69
70BN_nnmod() reduces I<a> modulo I<m> and places the non-negative
71remainder in I<r>.
72
73BN_mod_add() adds I<a> to I<b> modulo I<m> and places the non-negative
74result in I<r>.
75
76BN_mod_sub() subtracts I<b> from I<a> modulo I<m> and places the
77non-negative result in I<r>.
78
79BN_mod_mul() multiplies I<a> by I<b> and finds the non-negative
80remainder respective to modulus I<m> (C<r=(a*b) mod m>). I<r> may be
81the same B<BIGNUM> as I<a> or I<b>. For more efficient algorithms for
82repeated computations using the same modulus, see
83L<BN_mod_mul_montgomery(3)|BN_mod_mul_montgomery(3)> and
84L<BN_mod_mul_reciprocal(3)|BN_mod_mul_reciprocal(3)>.
85
86BN_mod_sqr() takes the square of I<a> modulo B<m> and places the
87result in I<r>.
88
89BN_exp() raises I<a> to the I<p>-th power and places the result in I<r>
90(C<r=a^p>). This function is faster than repeated applications of
91BN_mul().
92
93BN_mod_exp() computes I<a> to the I<p>-th power modulo I<m> (C<r=a^p %
94m>). This function uses less time and space than BN_exp().
95
96BN_gcd() computes the greatest common divisor of I<a> and I<b> and
97places the result in I<r>. I<r> may be the same B<BIGNUM> as I<a> or
98I<b>.
99
100For all functions, I<ctx> is a previously allocated B<BN_CTX> used for
101temporary variables; see L<BN_CTX_new(3)|BN_CTX_new(3)>.
102
103Unless noted otherwise, the result B<BIGNUM> must be different from
104the arguments.
105
106=head1 RETURN VALUES
107
108For all functions, 1 is returned for success, 0 on error. The return
109value should always be checked (e.g., C<if (!BN_add(r,a,b)) goto err;>).
110The error codes can be obtained by L<ERR_get_error(3)|ERR_get_error(3)>.
111
112=head1 SEE ALSO
113
114L<bn(3)|bn(3)>, L<ERR_get_error(3)|ERR_get_error(3)>,
115L<BN_CTX_new(3)|BN_CTX_new(3)>, L<BN_add_word(3)|BN_add_word(3)>,
116L<BN_set_bit(3)|BN_set_bit(3)>
117
118=head1 HISTORY
119
120BN_add(), BN_sub(), BN_sqr(), BN_div(), BN_mod(), BN_mod_mul(),
121BN_mod_exp() and BN_gcd() are available in all versions of SSLeay and
122OpenSSL. The I<ctx> argument to BN_mul() was added in SSLeay
1230.9.1b. BN_exp() appeared in SSLeay 0.9.0.
124BN_nnmod(), BN_mod_add(), BN_mod_sub(), and BN_mod_sqr() were added in
125OpenSSL 0.9.7.
126
127=cut
diff --git a/src/lib/libssl/src/doc/crypto/BN_add_word.pod b/src/lib/libssl/src/doc/crypto/BN_add_word.pod
deleted file mode 100644
index ba1026417d..0000000000
--- a/src/lib/libssl/src/doc/crypto/BN_add_word.pod
+++ /dev/null
@@ -1,61 +0,0 @@
1=pod
2
3=head1 NAME
4
5BN_add_word, BN_sub_word, BN_mul_word, BN_div_word, BN_mod_word - arithmetic
6functions on BIGNUMs with integers
7
8=head1 SYNOPSIS
9
10 #include <openssl/bn.h>
11
12 int BN_add_word(BIGNUM *a, BN_ULONG w);
13
14 int BN_sub_word(BIGNUM *a, BN_ULONG w);
15
16 int BN_mul_word(BIGNUM *a, BN_ULONG w);
17
18 BN_ULONG BN_div_word(BIGNUM *a, BN_ULONG w);
19
20 BN_ULONG BN_mod_word(const BIGNUM *a, BN_ULONG w);
21
22=head1 DESCRIPTION
23
24These functions perform arithmetic operations on BIGNUMs with unsigned
25integers. They are much more efficient than the normal BIGNUM
26arithmetic operations.
27
28BN_add_word() adds B<w> to B<a> (C<a+=w>).
29
30BN_sub_word() subtracts B<w> from B<a> (C<a-=w>).
31
32BN_mul_word() multiplies B<a> and B<w> (C<a*=w>).
33
34BN_div_word() divides B<a> by B<w> (C<a/=w>) and returns the remainder.
35
36BN_mod_word() returns the remainder of B<a> divided by B<w> (C<a%w>).
37
38For BN_div_word() and BN_mod_word(), B<w> must not be 0.
39
40=head1 RETURN VALUES
41
42BN_add_word(), BN_sub_word() and BN_mul_word() return 1 for success, 0 on
43error. The error codes can be obtained by L<ERR_get_error(3)|ERR_get_error(3)>.
44
45BN_mod_word() and BN_div_word() return B<a>%B<w> on success and
46B<(BN_ULONG)-1> if an error occurred.
47
48=head1 SEE ALSO
49
50L<bn(3)|bn(3)>, L<ERR_get_error(3)|ERR_get_error(3)>, L<BN_add(3)|BN_add(3)>
51
52=head1 HISTORY
53
54BN_add_word() and BN_mod_word() are available in all versions of
55SSLeay and OpenSSL. BN_div_word() was added in SSLeay 0.8, and
56BN_sub_word() and BN_mul_word() in SSLeay 0.9.0.
57
58Before 0.9.8a the return value for BN_div_word() and BN_mod_word()
59in case of an error was 0.
60
61=cut
diff --git a/src/lib/libssl/src/doc/crypto/BN_bn2bin.pod b/src/lib/libssl/src/doc/crypto/BN_bn2bin.pod
deleted file mode 100644
index 03b439c7b9..0000000000
--- a/src/lib/libssl/src/doc/crypto/BN_bn2bin.pod
+++ /dev/null
@@ -1,95 +0,0 @@
1=pod
2
3=head1 NAME
4
5BN_bn2bin, BN_bin2bn, BN_bn2hex, BN_bn2dec, BN_hex2bn, BN_dec2bn,
6BN_print, BN_print_fp, BN_bn2mpi, BN_mpi2bn - format conversions
7
8=head1 SYNOPSIS
9
10 #include <openssl/bn.h>
11
12 int BN_bn2bin(const BIGNUM *a, unsigned char *to);
13 BIGNUM *BN_bin2bn(const unsigned char *s, int len, BIGNUM *ret);
14
15 char *BN_bn2hex(const BIGNUM *a);
16 char *BN_bn2dec(const BIGNUM *a);
17 int BN_hex2bn(BIGNUM **a, const char *str);
18 int BN_dec2bn(BIGNUM **a, const char *str);
19
20 int BN_print(BIO *fp, const BIGNUM *a);
21 int BN_print_fp(FILE *fp, const BIGNUM *a);
22
23 int BN_bn2mpi(const BIGNUM *a, unsigned char *to);
24 BIGNUM *BN_mpi2bn(unsigned char *s, int len, BIGNUM *ret);
25
26=head1 DESCRIPTION
27
28BN_bn2bin() converts the absolute value of B<a> into big-endian form
29and stores it at B<to>. B<to> must point to BN_num_bytes(B<a>) bytes of
30memory.
31
32BN_bin2bn() converts the positive integer in big-endian form of length
33B<len> at B<s> into a B<BIGNUM> and places it in B<ret>. If B<ret> is
34NULL, a new B<BIGNUM> is created.
35
36BN_bn2hex() and BN_bn2dec() return printable strings containing the
37hexadecimal and decimal encoding of B<a> respectively. For negative
38numbers, the string is prefaced with a leading '-'. The string must be
39freed later using free().
40
41BN_hex2bn() converts the string B<str> containing a hexadecimal number
42to a B<BIGNUM> and stores it in **B<bn>. If *B<bn> is NULL, a new
43B<BIGNUM> is created. If B<bn> is NULL, it only computes the number's
44length in hexadecimal digits. If the string starts with '-', the
45number is negative. BN_dec2bn() is the same using the decimal system.
46
47BN_print() and BN_print_fp() write the hexadecimal encoding of B<a>,
48with a leading '-' for negative numbers, to the B<BIO> or B<FILE>
49B<fp>.
50
51BN_bn2mpi() and BN_mpi2bn() convert B<BIGNUM>s from and to a format
52that consists of the number's length in bytes represented as a 4-byte
53big-endian number, and the number itself in big-endian format, where
54the most significant bit signals a negative number (the representation
55of numbers with the MSB set is prefixed with null byte).
56
57BN_bn2mpi() stores the representation of B<a> at B<to>, where B<to>
58must be large enough to hold the result. The size can be determined by
59calling BN_bn2mpi(B<a>, NULL).
60
61BN_mpi2bn() converts the B<len> bytes long representation at B<s> to
62a B<BIGNUM> and stores it at B<ret>, or in a newly allocated B<BIGNUM>
63if B<ret> is NULL.
64
65=head1 RETURN VALUES
66
67BN_bn2bin() returns the length of the big-endian number placed at B<to>.
68BN_bin2bn() returns the B<BIGNUM>, NULL on error.
69
70BN_bn2hex() and BN_bn2dec() return a null-terminated string, or NULL
71on error. BN_hex2bn() and BN_dec2bn() return the number's length in
72hexadecimal or decimal digits, and 0 on error.
73
74BN_print_fp() and BN_print() return 1 on success, 0 on write errors.
75
76BN_bn2mpi() returns the length of the representation. BN_mpi2bn()
77returns the B<BIGNUM>, and NULL on error.
78
79The error codes can be obtained by L<ERR_get_error(3)|ERR_get_error(3)>.
80
81=head1 SEE ALSO
82
83L<bn(3)|bn(3)>, L<ERR_get_error(3)|ERR_get_error(3)>, L<BN_zero(3)|BN_zero(3)>,
84L<ASN1_INTEGER_to_BN(3)|ASN1_INTEGER_to_BN(3)>,
85L<BN_num_bytes(3)|BN_num_bytes(3)>
86
87=head1 HISTORY
88
89BN_bn2bin(), BN_bin2bn(), BN_print_fp() and BN_print() are available
90in all versions of SSLeay and OpenSSL.
91
92BN_bn2hex(), BN_bn2dec(), BN_hex2bn(), BN_dec2bn(), BN_bn2mpi() and
93BN_mpi2bn() were added in SSLeay 0.9.0.
94
95=cut
diff --git a/src/lib/libssl/src/doc/crypto/BN_cmp.pod b/src/lib/libssl/src/doc/crypto/BN_cmp.pod
deleted file mode 100644
index 29df69631e..0000000000
--- a/src/lib/libssl/src/doc/crypto/BN_cmp.pod
+++ /dev/null
@@ -1,49 +0,0 @@
1=pod
2
3=head1 NAME
4
5BN_cmp, BN_ucmp, BN_is_zero, BN_is_one, BN_is_word, BN_is_odd - BIGNUM
6comparison and test functions
7
8=head1 SYNOPSIS
9
10 #include <openssl/bn.h>
11
12 int BN_cmp(BIGNUM *a, BIGNUM *b);
13 int BN_ucmp(BIGNUM *a, BIGNUM *b);
14
15 int BN_is_zero(BIGNUM *a);
16 int BN_is_one(BIGNUM *a);
17 int BN_is_word(BIGNUM *a, BN_ULONG w);
18 int BN_is_odd(BIGNUM *a);
19
20=head1 DESCRIPTION
21
22BN_cmp() compares the numbers B<a> and B<b>. BN_ucmp() compares their
23absolute values.
24
25BN_is_zero(), BN_is_one() and BN_is_word() test if B<a> equals 0, 1,
26or B<w> respectively. BN_is_odd() tests if a is odd.
27
28BN_is_zero(), BN_is_one(), BN_is_word() and BN_is_odd() are macros.
29
30=head1 RETURN VALUES
31
32BN_cmp() returns -1 if B<a> E<lt> B<b>, 0 if B<a> == B<b> and 1 if
33B<a> E<gt> B<b>. BN_ucmp() is the same using the absolute values
34of B<a> and B<b>.
35
36BN_is_zero(), BN_is_one() BN_is_word() and BN_is_odd() return 1 if
37the condition is true, 0 otherwise.
38
39=head1 SEE ALSO
40
41L<bn(3)|bn(3)>
42
43=head1 HISTORY
44
45BN_cmp(), BN_ucmp(), BN_is_zero(), BN_is_one() and BN_is_word() are
46available in all versions of SSLeay and OpenSSL.
47BN_is_odd() was added in SSLeay 0.8.
48
49=cut
diff --git a/src/lib/libssl/src/doc/crypto/BN_copy.pod b/src/lib/libssl/src/doc/crypto/BN_copy.pod
deleted file mode 100644
index 388dd7df26..0000000000
--- a/src/lib/libssl/src/doc/crypto/BN_copy.pod
+++ /dev/null
@@ -1,34 +0,0 @@
1=pod
2
3=head1 NAME
4
5BN_copy, BN_dup - copy BIGNUMs
6
7=head1 SYNOPSIS
8
9 #include <openssl/bn.h>
10
11 BIGNUM *BN_copy(BIGNUM *to, const BIGNUM *from);
12
13 BIGNUM *BN_dup(const BIGNUM *from);
14
15=head1 DESCRIPTION
16
17BN_copy() copies B<from> to B<to>. BN_dup() creates a new B<BIGNUM>
18containing the value B<from>.
19
20=head1 RETURN VALUES
21
22BN_copy() returns B<to> on success, NULL on error. BN_dup() returns
23the new B<BIGNUM>, and NULL on error. The error codes can be obtained
24by L<ERR_get_error(3)|ERR_get_error(3)>.
25
26=head1 SEE ALSO
27
28L<bn(3)|bn(3)>, L<ERR_get_error(3)|ERR_get_error(3)>
29
30=head1 HISTORY
31
32BN_copy() and BN_dup() are available in all versions of SSLeay and OpenSSL.
33
34=cut
diff --git a/src/lib/libssl/src/doc/crypto/BN_generate_prime.pod b/src/lib/libssl/src/doc/crypto/BN_generate_prime.pod
deleted file mode 100644
index 0a95633d54..0000000000
--- a/src/lib/libssl/src/doc/crypto/BN_generate_prime.pod
+++ /dev/null
@@ -1,149 +0,0 @@
1=pod
2
3=head1 NAME
4
5BN_generate_prime, BN_is_prime_ex, BN_is_prime_fasttest_ex, BN_GENCB_call,
6BN_GENCB_set_old, BN_GENCB_set, BN_generate_prime, BN_is_prime,
7BN_is_prime_fasttest - generate primes and test for primality
8
9=head1 SYNOPSIS
10
11 #include <openssl/bn.h>
12
13 int BN_generate_prime_ex(BIGNUM *ret,int bits,int safe, const BIGNUM *add,
14 const BIGNUM *rem, BN_GENCB *cb);
15
16 int BN_is_prime_ex(const BIGNUM *p,int nchecks, BN_CTX *ctx, BN_GENCB *cb);
17
18 int BN_is_prime_fasttest_ex(const BIGNUM *p,int nchecks, BN_CTX *ctx,
19 int do_trial_division, BN_GENCB *cb);
20
21 int BN_GENCB_call(BN_GENCB *cb, int a, int b);
22
23 #define BN_GENCB_set_old(gencb, callback, cb_arg) ...
24
25 #define BN_GENCB_set(gencb, callback, cb_arg) ...
26
27
28Deprecated:
29
30BIGNUM *BN_generate_prime(BIGNUM *ret, int num, int safe, BIGNUM *add,
31 BIGNUM *rem, void (*callback)(int, int, void *), void *cb_arg);
32
33 int BN_is_prime(const BIGNUM *a, int checks, void (*callback)(int, int,
34 void *), BN_CTX *ctx, void *cb_arg);
35
36 int BN_is_prime_fasttest(const BIGNUM *a, int checks,
37 void (*callback)(int, int, void *), BN_CTX *ctx, void *cb_arg,
38 int do_trial_division);
39
40=head1 DESCRIPTION
41
42BN_generate_prime_ex() generates a pseudo-random prime number of
43bit length B<bits>.
44If B<ret> is not B<NULL>, it will be used to store the number.
45
46If B<cb> is not B<NULL>, it is used as follows:
47
48=over 4
49
50=item *
51
52B<BN_GENCB_call(cb, 0, i)> is called after generating the i-th
53potential prime number.
54
55=item *
56
57While the number is being tested for primality,
58B<BN_GENCB_call(cb, 1, j)> is called as described below.
59
60=item *
61
62When a prime has been found, B<BN_GENCB_call(cb, 2, i)> is called.
63
64=back
65
66The prime may have to fulfill additional requirements for use in
67Diffie-Hellman key exchange:
68
69If B<add> is not B<NULL>, the prime will fulfill the condition p % B<add>
70== B<rem> (p % B<add> == 1 if B<rem> == B<NULL>) in order to suit a given
71generator.
72
73If B<safe> is true, it will be a safe prime (i.e. a prime p so
74that (p-1)/2 is also prime).
75
76The prime number generation has a negligible error probability.
77
78BN_is_prime_ex() and BN_is_prime_fasttest_ex() test if the number B<p> is
79prime. The following tests are performed until one of them shows that
80B<p> is composite; if B<p> passes all these tests, it is considered
81prime.
82
83BN_is_prime_fasttest_ex(), when called with B<do_trial_division == 1>,
84first attempts trial division by a number of small primes;
85if no divisors are found by this test and B<cb> is not B<NULL>,
86B<BN_GENCB_call(cb, 1, -1)> is called.
87If B<do_trial_division == 0>, this test is skipped.
88
89Both BN_is_prime_ex() and BN_is_prime_fasttest_ex() perform a Miller-Rabin
90probabilistic primality test with B<nchecks> iterations. If
91B<nchecks == BN_prime_checks>, a number of iterations is used that
92yields a false positive rate of at most 2^-80 for random input.
93
94If B<cb> is not B<NULL>, B<BN_GENCB_call(cb, 1, j)> is called
95after the j-th iteration (j = 0, 1, ...). B<ctx> is a
96pre-allocated B<BN_CTX> (to save the overhead of allocating and
97freeing the structure in a loop), or B<NULL>.
98
99BN_GENCB_call calls the callback function held in the B<BN_GENCB> structure
100and passes the ints B<a> and B<b> as arguments. There are two types of
101B<BN_GENCB> structure that are supported: "new" style and "old" style. New
102programs should prefer the "new" style, whilst the "old" style is provided
103for backwards compatibility purposes.
104
105For "new" style callbacks a BN_GENCB structure should be initialised with a
106call to BN_GENCB_set, where B<gencb> is a B<BN_GENCB *>, B<callback> is of
107type B<int (*callback)(int, int, BN_GENCB *)> and B<cb_arg> is a B<void *>.
108"Old" style callbacks are the same except they are initialised with a call
109to BN_GENCB_set_old and B<callback> is of type
110B<void (*callback)(int, int, void *)>.
111
112A callback is invoked through a call to B<BN_GENCB_call>. This will check
113the type of the callback and will invoke B<callback(a, b, gencb)> for new
114style callbacks or B<callback(a, b, cb_arg)> for old style.
115
116BN_generate_prime (deprecated) works in the same way as
117BN_generate_prime_ex but expects an old style callback function
118directly in the B<callback> parameter, and an argument to pass to it in
119the B<cb_arg>. Similarly BN_is_prime and BN_is_prime_fasttest are
120deprecated and can be compared to BN_is_prime_ex and
121BN_is_prime_fasttest_ex respectively.
122
123=head1 RETURN VALUES
124
125BN_generate_prime_ex() returns 1 on success or 0 on error.
126
127BN_is_prime_ex(), BN_is_prime_fasttest_ex(), BN_is_prime() and
128BN_is_prime_fasttest() return 0 if the number is composite, 1 if it is
129prime with an error probability of less than 0.25^B<nchecks>, and
130-1 on error.
131
132BN_generate_prime() returns the prime number on success, B<NULL> otherwise.
133
134Callback functions should return 1 on success or 0 on error.
135
136The error codes can be obtained by L<ERR_get_error(3)|ERR_get_error(3)>.
137
138=head1 SEE ALSO
139
140L<bn(3)|bn(3)>, L<ERR_get_error(3)|ERR_get_error(3)>, L<rand(3)|rand(3)>
141
142=head1 HISTORY
143
144The B<cb_arg> arguments to BN_generate_prime() and to BN_is_prime()
145were added in SSLeay 0.9.0. The B<ret> argument to BN_generate_prime()
146was added in SSLeay 0.9.1.
147BN_is_prime_fasttest() was added in OpenSSL 0.9.5.
148
149=cut
diff --git a/src/lib/libssl/src/doc/crypto/BN_mod_inverse.pod b/src/lib/libssl/src/doc/crypto/BN_mod_inverse.pod
deleted file mode 100644
index aefb1d27dd..0000000000
--- a/src/lib/libssl/src/doc/crypto/BN_mod_inverse.pod
+++ /dev/null
@@ -1,36 +0,0 @@
1=pod
2
3=head1 NAME
4
5BN_mod_inverse - compute inverse modulo n
6
7=head1 SYNOPSIS
8
9 #include <openssl/bn.h>
10
11 BIGNUM *BN_mod_inverse(BIGNUM *r, BIGNUM *a, const BIGNUM *n,
12 BN_CTX *ctx);
13
14=head1 DESCRIPTION
15
16BN_mod_inverse() computes the inverse of B<a> modulo B<n>
17places the result in B<r> (C<(a*r)%n==1>). If B<r> is NULL,
18a new B<BIGNUM> is created.
19
20B<ctx> is a previously allocated B<BN_CTX> used for temporary
21variables. B<r> may be the same B<BIGNUM> as B<a> or B<n>.
22
23=head1 RETURN VALUES
24
25BN_mod_inverse() returns the B<BIGNUM> containing the inverse, and NULL on
26error. The error codes can be obtained by L<ERR_get_error(3)|ERR_get_error(3)>.
27
28=head1 SEE ALSO
29
30L<bn(3)|bn(3)>, L<ERR_get_error(3)|ERR_get_error(3)>, L<BN_add(3)|BN_add(3)>
31
32=head1 HISTORY
33
34BN_mod_inverse() is available in all versions of SSLeay and OpenSSL.
35
36=cut
diff --git a/src/lib/libssl/src/doc/crypto/BN_mod_mul_montgomery.pod b/src/lib/libssl/src/doc/crypto/BN_mod_mul_montgomery.pod
deleted file mode 100644
index 6b16351b92..0000000000
--- a/src/lib/libssl/src/doc/crypto/BN_mod_mul_montgomery.pod
+++ /dev/null
@@ -1,101 +0,0 @@
1=pod
2
3=head1 NAME
4
5BN_mod_mul_montgomery, BN_MONT_CTX_new, BN_MONT_CTX_init,
6BN_MONT_CTX_free, BN_MONT_CTX_set, BN_MONT_CTX_copy,
7BN_from_montgomery, BN_to_montgomery - Montgomery multiplication
8
9=head1 SYNOPSIS
10
11 #include <openssl/bn.h>
12
13 BN_MONT_CTX *BN_MONT_CTX_new(void);
14 void BN_MONT_CTX_init(BN_MONT_CTX *ctx);
15 void BN_MONT_CTX_free(BN_MONT_CTX *mont);
16
17 int BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *m, BN_CTX *ctx);
18 BN_MONT_CTX *BN_MONT_CTX_copy(BN_MONT_CTX *to, BN_MONT_CTX *from);
19
20 int BN_mod_mul_montgomery(BIGNUM *r, BIGNUM *a, BIGNUM *b,
21 BN_MONT_CTX *mont, BN_CTX *ctx);
22
23 int BN_from_montgomery(BIGNUM *r, BIGNUM *a, BN_MONT_CTX *mont,
24 BN_CTX *ctx);
25
26 int BN_to_montgomery(BIGNUM *r, BIGNUM *a, BN_MONT_CTX *mont,
27 BN_CTX *ctx);
28
29=head1 DESCRIPTION
30
31These functions implement Montgomery multiplication. They are used
32automatically when L<BN_mod_exp(3)|BN_mod_exp(3)> is called with suitable input,
33but they may be useful when several operations are to be performed
34using the same modulus.
35
36BN_MONT_CTX_new() allocates and initializes a B<BN_MONT_CTX> structure.
37BN_MONT_CTX_init() initializes an existing uninitialized B<BN_MONT_CTX>.
38
39BN_MONT_CTX_set() sets up the I<mont> structure from the modulus I<m>
40by precomputing its inverse and a value R.
41
42BN_MONT_CTX_copy() copies the B<BN_MONT_CTX> I<from> to I<to>.
43
44BN_MONT_CTX_free() frees the components of the B<BN_MONT_CTX>, and, if
45it was created by BN_MONT_CTX_new(), also the structure itself.
46
47BN_mod_mul_montgomery() computes Mont(I<a>,I<b>):=I<a>*I<b>*R^-1 and places
48the result in I<r>.
49
50BN_from_montgomery() performs the Montgomery reduction I<r> = I<a>*R^-1.
51
52BN_to_montgomery() computes Mont(I<a>,R^2), i.e. I<a>*R.
53Note that I<a> must be non-negative and smaller than the modulus.
54
55For all functions, I<ctx> is a previously allocated B<BN_CTX> used for
56temporary variables.
57
58The B<BN_MONT_CTX> structure is defined as follows:
59
60 typedef struct bn_mont_ctx_st
61 {
62 int ri; /* number of bits in R */
63 BIGNUM RR; /* R^2 (used to convert to Montgomery form) */
64 BIGNUM N; /* The modulus */
65 BIGNUM Ni; /* R*(1/R mod N) - N*Ni = 1
66 * (Ni is only stored for bignum algorithm) */
67 BN_ULONG n0; /* least significant word of Ni */
68 int flags;
69 } BN_MONT_CTX;
70
71BN_to_montgomery() is a macro.
72
73=head1 RETURN VALUES
74
75BN_MONT_CTX_new() returns the newly allocated B<BN_MONT_CTX>, and NULL
76on error.
77
78BN_MONT_CTX_init() and BN_MONT_CTX_free() have no return values.
79
80For the other functions, 1 is returned for success, 0 on error.
81The error codes can be obtained by L<ERR_get_error(3)|ERR_get_error(3)>.
82
83=head1 WARNING
84
85The inputs must be reduced modulo B<m>, otherwise the result will be
86outside the expected range.
87
88=head1 SEE ALSO
89
90L<bn(3)|bn(3)>, L<ERR_get_error(3)|ERR_get_error(3)>, L<BN_add(3)|BN_add(3)>,
91L<BN_CTX_new(3)|BN_CTX_new(3)>
92
93=head1 HISTORY
94
95BN_MONT_CTX_new(), BN_MONT_CTX_free(), BN_MONT_CTX_set(),
96BN_mod_mul_montgomery(), BN_from_montgomery() and BN_to_montgomery()
97are available in all versions of SSLeay and OpenSSL.
98
99BN_MONT_CTX_init() and BN_MONT_CTX_copy() were added in SSLeay 0.9.1b.
100
101=cut
diff --git a/src/lib/libssl/src/doc/crypto/BN_mod_mul_reciprocal.pod b/src/lib/libssl/src/doc/crypto/BN_mod_mul_reciprocal.pod
deleted file mode 100644
index 74a216ddc2..0000000000
--- a/src/lib/libssl/src/doc/crypto/BN_mod_mul_reciprocal.pod
+++ /dev/null
@@ -1,81 +0,0 @@
1=pod
2
3=head1 NAME
4
5BN_mod_mul_reciprocal, BN_div_recp, BN_RECP_CTX_new, BN_RECP_CTX_init,
6BN_RECP_CTX_free, BN_RECP_CTX_set - modular multiplication using
7reciprocal
8
9=head1 SYNOPSIS
10
11 #include <openssl/bn.h>
12
13 BN_RECP_CTX *BN_RECP_CTX_new(void);
14 void BN_RECP_CTX_init(BN_RECP_CTX *recp);
15 void BN_RECP_CTX_free(BN_RECP_CTX *recp);
16
17 int BN_RECP_CTX_set(BN_RECP_CTX *recp, const BIGNUM *m, BN_CTX *ctx);
18
19 int BN_div_recp(BIGNUM *dv, BIGNUM *rem, BIGNUM *a, BN_RECP_CTX *recp,
20 BN_CTX *ctx);
21
22 int BN_mod_mul_reciprocal(BIGNUM *r, BIGNUM *a, BIGNUM *b,
23 BN_RECP_CTX *recp, BN_CTX *ctx);
24
25=head1 DESCRIPTION
26
27BN_mod_mul_reciprocal() can be used to perform an efficient
28L<BN_mod_mul(3)|BN_mod_mul(3)> operation when the operation will be performed
29repeatedly with the same modulus. It computes B<r>=(B<a>*B<b>)%B<m>
30using B<recp>=1/B<m>, which is set as described below. B<ctx> is a
31previously allocated B<BN_CTX> used for temporary variables.
32
33BN_RECP_CTX_new() allocates and initializes a B<BN_RECP> structure.
34BN_RECP_CTX_init() initializes an existing uninitialized B<BN_RECP>.
35
36BN_RECP_CTX_free() frees the components of the B<BN_RECP>, and, if it
37was created by BN_RECP_CTX_new(), also the structure itself.
38
39BN_RECP_CTX_set() stores B<m> in B<recp> and sets it up for computing
401/B<m> and shifting it left by BN_num_bits(B<m>)+1 to make it an
41integer. The result and the number of bits it was shifted left will
42later be stored in B<recp>.
43
44BN_div_recp() divides B<a> by B<m> using B<recp>. It places the quotient
45in B<dv> and the remainder in B<rem>.
46
47The B<BN_RECP_CTX> structure is defined as follows:
48
49 typedef struct bn_recp_ctx_st
50 {
51 BIGNUM N; /* the divisor */
52 BIGNUM Nr; /* the reciprocal */
53 int num_bits;
54 int shift;
55 int flags;
56 } BN_RECP_CTX;
57
58It cannot be shared between threads.
59
60=head1 RETURN VALUES
61
62BN_RECP_CTX_new() returns the newly allocated B<BN_RECP_CTX>, and NULL
63on error.
64
65BN_RECP_CTX_init() and BN_RECP_CTX_free() have no return values.
66
67For the other functions, 1 is returned for success, 0 on error.
68The error codes can be obtained by L<ERR_get_error(3)|ERR_get_error(3)>.
69
70=head1 SEE ALSO
71
72L<bn(3)|bn(3)>, L<ERR_get_error(3)|ERR_get_error(3)>, L<BN_add(3)|BN_add(3)>,
73L<BN_CTX_new(3)|BN_CTX_new(3)>
74
75=head1 HISTORY
76
77B<BN_RECP_CTX> was added in SSLeay 0.9.0. Before that, the function
78BN_reciprocal() was used instead, and the BN_mod_mul_reciprocal()
79arguments were different.
80
81=cut
diff --git a/src/lib/libssl/src/doc/crypto/BN_new.pod b/src/lib/libssl/src/doc/crypto/BN_new.pod
deleted file mode 100644
index ab7a105e3a..0000000000
--- a/src/lib/libssl/src/doc/crypto/BN_new.pod
+++ /dev/null
@@ -1,53 +0,0 @@
1=pod
2
3=head1 NAME
4
5BN_new, BN_init, BN_clear, BN_free, BN_clear_free - allocate and free BIGNUMs
6
7=head1 SYNOPSIS
8
9 #include <openssl/bn.h>
10
11 BIGNUM *BN_new(void);
12
13 void BN_init(BIGNUM *);
14
15 void BN_clear(BIGNUM *a);
16
17 void BN_free(BIGNUM *a);
18
19 void BN_clear_free(BIGNUM *a);
20
21=head1 DESCRIPTION
22
23BN_new() allocates and initializes a B<BIGNUM> structure. BN_init()
24initializes an existing uninitialized B<BIGNUM>.
25
26BN_clear() is used to destroy sensitive data such as keys when they
27are no longer needed. It erases the memory used by B<a> and sets it
28to the value 0.
29
30BN_free() frees the components of the B<BIGNUM>, and if it was created
31by BN_new(), also the structure itself. BN_clear_free() additionally
32overwrites the data before the memory is returned to the system.
33
34=head1 RETURN VALUES
35
36BN_new() returns a pointer to the B<BIGNUM>. If the allocation fails,
37it returns B<NULL> and sets an error code that can be obtained
38by L<ERR_get_error(3)|ERR_get_error(3)>.
39
40BN_init(), BN_clear(), BN_free() and BN_clear_free() have no return
41values.
42
43=head1 SEE ALSO
44
45L<bn(3)|bn(3)>, L<ERR_get_error(3)|ERR_get_error(3)>
46
47=head1 HISTORY
48
49BN_new(), BN_clear(), BN_free() and BN_clear_free() are available in
50all versions on SSLeay and OpenSSL. BN_init() was added in SSLeay
510.9.1b.
52
53=cut
diff --git a/src/lib/libssl/src/doc/crypto/BN_num_bytes.pod b/src/lib/libssl/src/doc/crypto/BN_num_bytes.pod
deleted file mode 100644
index a6a2e3f819..0000000000
--- a/src/lib/libssl/src/doc/crypto/BN_num_bytes.pod
+++ /dev/null
@@ -1,57 +0,0 @@
1=pod
2
3=head1 NAME
4
5BN_num_bits, BN_num_bytes, BN_num_bits_word - get BIGNUM size
6
7=head1 SYNOPSIS
8
9 #include <openssl/bn.h>
10
11 int BN_num_bytes(const BIGNUM *a);
12
13 int BN_num_bits(const BIGNUM *a);
14
15 int BN_num_bits_word(BN_ULONG w);
16
17=head1 DESCRIPTION
18
19BN_num_bytes() returns the size of a B<BIGNUM> in bytes.
20
21BN_num_bits_word() returns the number of significant bits in a word.
22If we take 0x00000432 as an example, it returns 11, not 16, not 32.
23Basically, except for a zero, it returns I<floor(log2(w))+1>.
24
25BN_num_bits() returns the number of significant bits in a B<BIGNUM>,
26following the same principle as BN_num_bits_word().
27
28BN_num_bytes() is a macro.
29
30=head1 RETURN VALUES
31
32The size.
33
34=head1 NOTES
35
36Some have tried using BN_num_bits() on individual numbers in RSA keys,
37DH keys and DSA keys, and found that they don't always come up with
38the number of bits they expected (something like 512, 1024, 2048,
39...). This is because generating a number with some specific number
40of bits doesn't always set the highest bits, thereby making the number
41of I<significant> bits a little lower. If you want to know the "key
42size" of such a key, either use functions like RSA_size(), DH_size()
43and DSA_size(), or use BN_num_bytes() and multiply with 8 (although
44there's no real guarantee that will match the "key size", just a lot
45more probability).
46
47=head1 SEE ALSO
48
49L<bn(3)|bn(3)>, L<DH_size(3)|DH_size(3)>, L<DSA_size(3)|DSA_size(3)>,
50L<RSA_size(3)|RSA_size(3)>
51
52=head1 HISTORY
53
54BN_num_bytes(), BN_num_bits() and BN_num_bits_word() are available in
55all versions of SSLeay and OpenSSL.
56
57=cut
diff --git a/src/lib/libssl/src/doc/crypto/BN_rand.pod b/src/lib/libssl/src/doc/crypto/BN_rand.pod
deleted file mode 100644
index 856f310077..0000000000
--- a/src/lib/libssl/src/doc/crypto/BN_rand.pod
+++ /dev/null
@@ -1,56 +0,0 @@
1=pod
2
3=head1 NAME
4
5BN_rand, BN_pseudo_rand, BN_rand_range, BN_pseudo_rand_range - generate pseudo-random number
6
7=head1 SYNOPSIS
8
9 #include <openssl/bn.h>
10
11 int BN_rand(BIGNUM *rnd, int bits, int top, int bottom);
12
13 int BN_pseudo_rand(BIGNUM *rnd, int bits, int top, int bottom);
14
15 int BN_rand_range(BIGNUM *rnd, BIGNUM *range);
16
17 int BN_pseudo_rand_range(BIGNUM *rnd, BIGNUM *range);
18
19=head1 DESCRIPTION
20
21BN_rand() generates a cryptographically strong pseudo-random number of
22B<bits> bits in length and stores it in B<rnd>. If B<top> is -1, the
23most significant bit of the random number can be zero. If B<top> is 0,
24it is set to 1, and if B<top> is 1, the two most significant bits of
25the number will be set to 1, so that the product of two such random
26numbers will always have 2*B<bits> length. If B<bottom> is true, the
27number will be odd.
28
29BN_pseudo_rand() does the same, but pseudo-random numbers generated by
30this function are not necessarily unpredictable. They can be used for
31non-cryptographic purposes and for certain purposes in cryptographic
32protocols, but usually not for key generation etc.
33
34BN_rand_range() generates a cryptographically strong pseudo-random
35number B<rnd> in the range 0 E<lt>= B<rnd> E<lt> B<range>.
36BN_pseudo_rand_range() does the same, but is based on BN_pseudo_rand(),
37and hence numbers generated by it are not necessarily unpredictable.
38
39=head1 RETURN VALUES
40
41The functions return 1 on success, 0 on error.
42The error codes can be obtained by L<ERR_get_error(3)|ERR_get_error(3)>.
43
44=head1 SEE ALSO
45
46L<bn(3)|bn(3)>, L<ERR_get_error(3)|ERR_get_error(3)>, L<rand(3)|rand(3)>,
47L<RAND_add(3)|RAND_add(3)>, L<RAND_bytes(3)|RAND_bytes(3)>
48
49=head1 HISTORY
50
51BN_rand() is available in all versions of SSLeay and OpenSSL.
52BN_pseudo_rand() was added in OpenSSL 0.9.5. The B<top> == -1 case
53and the function BN_rand_range() were added in OpenSSL 0.9.6a.
54BN_pseudo_rand_range() was added in OpenSSL 0.9.6c.
55
56=cut
diff --git a/src/lib/libssl/src/doc/crypto/BN_set_bit.pod b/src/lib/libssl/src/doc/crypto/BN_set_bit.pod
deleted file mode 100644
index b7c47b9b01..0000000000
--- a/src/lib/libssl/src/doc/crypto/BN_set_bit.pod
+++ /dev/null
@@ -1,66 +0,0 @@
1=pod
2
3=head1 NAME
4
5BN_set_bit, BN_clear_bit, BN_is_bit_set, BN_mask_bits, BN_lshift,
6BN_lshift1, BN_rshift, BN_rshift1 - bit operations on BIGNUMs
7
8=head1 SYNOPSIS
9
10 #include <openssl/bn.h>
11
12 int BN_set_bit(BIGNUM *a, int n);
13 int BN_clear_bit(BIGNUM *a, int n);
14
15 int BN_is_bit_set(const BIGNUM *a, int n);
16
17 int BN_mask_bits(BIGNUM *a, int n);
18
19 int BN_lshift(BIGNUM *r, const BIGNUM *a, int n);
20 int BN_lshift1(BIGNUM *r, BIGNUM *a);
21
22 int BN_rshift(BIGNUM *r, BIGNUM *a, int n);
23 int BN_rshift1(BIGNUM *r, BIGNUM *a);
24
25=head1 DESCRIPTION
26
27BN_set_bit() sets bit B<n> in B<a> to 1 (C<a|=(1E<lt>E<lt>n)>). The
28number is expanded if necessary.
29
30BN_clear_bit() sets bit B<n> in B<a> to 0 (C<a&=~(1E<lt>E<lt>n)>). An
31error occurs if B<a> is shorter than B<n> bits.
32
33BN_is_bit_set() tests if bit B<n> in B<a> is set.
34
35BN_mask_bits() truncates B<a> to an B<n> bit number
36(C<a&=~((~0)E<gt>E<gt>n)>). An error occurs if B<a> already is
37shorter than B<n> bits.
38
39BN_lshift() shifts B<a> left by B<n> bits and places the result in
40B<r> (C<r=a*2^n>). BN_lshift1() shifts B<a> left by one and places
41the result in B<r> (C<r=2*a>).
42
43BN_rshift() shifts B<a> right by B<n> bits and places the result in
44B<r> (C<r=a/2^n>). BN_rshift1() shifts B<a> right by one and places
45the result in B<r> (C<r=a/2>).
46
47For the shift functions, B<r> and B<a> may be the same variable.
48
49=head1 RETURN VALUES
50
51BN_is_bit_set() returns 1 if the bit is set, 0 otherwise.
52
53All other functions return 1 for success, 0 on error. The error codes
54can be obtained by L<ERR_get_error(3)|ERR_get_error(3)>.
55
56=head1 SEE ALSO
57
58L<bn(3)|bn(3)>, L<BN_num_bytes(3)|BN_num_bytes(3)>, L<BN_add(3)|BN_add(3)>
59
60=head1 HISTORY
61
62BN_set_bit(), BN_clear_bit(), BN_is_bit_set(), BN_mask_bits(),
63BN_lshift(), BN_lshift1(), BN_rshift(), and BN_rshift1() are available
64in all versions of SSLeay and OpenSSL.
65
66=cut
diff --git a/src/lib/libssl/src/doc/crypto/BN_swap.pod b/src/lib/libssl/src/doc/crypto/BN_swap.pod
deleted file mode 100644
index 14097ca357..0000000000
--- a/src/lib/libssl/src/doc/crypto/BN_swap.pod
+++ /dev/null
@@ -1,25 +0,0 @@
1=pod
2
3=head1 NAME
4
5BN_swap - exchange BIGNUMs
6
7=head1 SYNOPSIS
8
9 #include <openssl/bn.h>
10
11 void BN_swap(BIGNUM *a, BIGNUM *b);
12
13=head1 DESCRIPTION
14
15BN_swap() exchanges the values of I<a> and I<b>.
16
17=head1 SEE ALSO
18
19L<bn(3)|bn(3)>
20
21=head1 HISTORY
22
23BN_swap was added in OpenSSL 0.9.7.
24
25=cut
diff --git a/src/lib/libssl/src/doc/crypto/BN_zero.pod b/src/lib/libssl/src/doc/crypto/BN_zero.pod
deleted file mode 100644
index b555ec3988..0000000000
--- a/src/lib/libssl/src/doc/crypto/BN_zero.pod
+++ /dev/null
@@ -1,59 +0,0 @@
1=pod
2
3=head1 NAME
4
5BN_zero, BN_one, BN_value_one, BN_set_word, BN_get_word - BIGNUM assignment
6operations
7
8=head1 SYNOPSIS
9
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, unsigned long w);
18 unsigned long BN_get_word(BIGNUM *a);
19
20=head1 DESCRIPTION
21
22BN_zero(), BN_one() and BN_set_word() set B<a> to the values 0, 1 and
23B<w> respectively. BN_zero() and BN_one() are macros.
24
25BN_value_one() returns a B<BIGNUM> constant of value 1. This constant
26is useful for use in comparisons and assignment.
27
28BN_get_word() returns B<a>, if it can be represented as an unsigned
29long.
30
31=head1 RETURN VALUES
32
33BN_get_word() returns the value B<a>, and 0xffffffffL if B<a> cannot
34be represented as an unsigned long.
35
36BN_zero(), BN_one() and BN_set_word() return 1 on success, 0 otherwise.
37BN_value_one() returns the constant.
38
39=head1 BUGS
40
41Someone might change the constant.
42
43If a B<BIGNUM> is equal to 0xffffffffL it can be represented as an
44unsigned long but this value is also returned on error.
45
46=head1 SEE ALSO
47
48L<bn(3)|bn(3)>, L<BN_bn2bin(3)|BN_bn2bin(3)>
49
50=head1 HISTORY
51
52BN_zero(), BN_one() and BN_set_word() are available in all versions of
53SSLeay and OpenSSL. BN_value_one() and BN_get_word() were added in
54SSLeay 0.8.
55
56BN_value_one() was changed to return a true const BIGNUM * in OpenSSL
570.9.7.
58
59=cut