summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authortb <>2021-09-10 14:37:14 +0000
committertb <>2021-09-10 14:37:14 +0000
commited3e0c370232178a46c8baadd04013068c697d0a (patch)
treea97e8bfb8c0554075c235361fe02d0e185e2c389 /src/lib
parent897e76b2430b02d128ab608ee51530189889ff96 (diff)
downloadopenbsd-ed3e0c370232178a46c8baadd04013068c697d0a.tar.gz
openbsd-ed3e0c370232178a46c8baadd04013068c697d0a.tar.bz2
openbsd-ed3e0c370232178a46c8baadd04013068c697d0a.zip
Use BN_RAND_* instead of mysterious values in the documentation of
BN_rand_range() From OpenSSL 1.1.1l ok beck jsing
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libcrypto/man/BN_rand.326
1 files changed, 19 insertions, 7 deletions
diff --git a/src/lib/libcrypto/man/BN_rand.3 b/src/lib/libcrypto/man/BN_rand.3
index 467971206b..c508738fd4 100644
--- a/src/lib/libcrypto/man/BN_rand.3
+++ b/src/lib/libcrypto/man/BN_rand.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: BN_rand.3,v 1.16 2019/06/10 14:58:48 schwarze Exp $ 1.\" $OpenBSD: BN_rand.3,v 1.17 2021/09/10 14:37:14 tb Exp $
2.\" full merge up to: OpenSSL 05ea606a May 20 20:52:46 2016 -0400 2.\" full merge up to: OpenSSL 05ea606a May 20 20:52:46 2016 -0400
3.\" selective merge up to: OpenSSL df75c2bf Dec 9 01:02:36 2018 +0100 3.\" selective merge up to: OpenSSL df75c2bf Dec 9 01:02:36 2018 +0100
4.\" 4.\"
@@ -50,7 +50,7 @@
50.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 50.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
51.\" OF THE POSSIBILITY OF SUCH DAMAGE. 51.\" OF THE POSSIBILITY OF SUCH DAMAGE.
52.\" 52.\"
53.Dd $Mdocdate: June 10 2019 $ 53.Dd $Mdocdate: September 10 2021 $
54.Dt BN_RAND 3 54.Dt BN_RAND 3
55.Os 55.Os
56.Sh NAME 56.Sh NAME
@@ -81,18 +81,29 @@ in length and stores it in
81.Fa rnd . 81.Fa rnd .
82If 82If
83.Fa top 83.Fa top
84is -1, the most significant bit of the random number can be zero. 84is
85.Dv BN_RAND_TOP_ANY ,
86the most significant bit of the random number can be zero.
85If 87If
86.Fa top 88.Fa top
87is 0, it is set to 1, and if 89is
90.Dv BN_RAND_TOP_ONE ,
91the most significant bit is set to 1, and if
88.Fa top 92.Fa top
89is 1, the two most significant bits of the number will be set to 1, so 93is
94.Dv BN_RAND_TOP_TWO ,
95the two most significant bits of the number will be set to 1, so
90that the product of two such random numbers will always have 96that the product of two such random numbers will always have
91.Pf 2* Fa bits 97.Pf 2* Fa bits
92length. 98length.
93If 99If
94.Fa bottom 100.Fa bottom
95is true, the number will be odd. 101is
102.Dv BN_RAND_BOTTOM_ODD ,
103the number will be odd;
104if it is
105.Dv BN_RAND_BOTTOM_ANY ,
106it can be odd or even.
96The value of 107The value of
97.Fa bits 108.Fa bits
98must be zero or greater. 109must be zero or greater.
@@ -100,7 +111,8 @@ If
100.Fa bits 111.Fa bits
101is +1 then 112is +1 then
102.Fa top 113.Fa top
103cannot also be 1. 114cannot be
115.Dv BN_RAND_TOP_TWO .
104.Pp 116.Pp
105.Fn BN_rand_range 117.Fn BN_rand_range
106generates a cryptographically strong pseudo-random number 118generates a cryptographically strong pseudo-random number