diff options
| author | tb <> | 2021-09-10 14:37:14 +0000 |
|---|---|---|
| committer | tb <> | 2021-09-10 14:37:14 +0000 |
| commit | 9f055e2e8ea33c8d10d4c046e36c19dc8c70e444 (patch) | |
| tree | a97e8bfb8c0554075c235361fe02d0e185e2c389 /src/lib/libcrypto/man | |
| parent | 6dd11356e9657c7c8b0960c655d0ddec826964b5 (diff) | |
| download | openbsd-9f055e2e8ea33c8d10d4c046e36c19dc8c70e444.tar.gz openbsd-9f055e2e8ea33c8d10d4c046e36c19dc8c70e444.tar.bz2 openbsd-9f055e2e8ea33c8d10d4c046e36c19dc8c70e444.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/libcrypto/man')
| -rw-r--r-- | src/lib/libcrypto/man/BN_rand.3 | 26 |
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 . |
| 82 | If | 82 | If |
| 83 | .Fa top | 83 | .Fa top |
| 84 | is -1, the most significant bit of the random number can be zero. | 84 | is |
| 85 | .Dv BN_RAND_TOP_ANY , | ||
| 86 | the most significant bit of the random number can be zero. | ||
| 85 | If | 87 | If |
| 86 | .Fa top | 88 | .Fa top |
| 87 | is 0, it is set to 1, and if | 89 | is |
| 90 | .Dv BN_RAND_TOP_ONE , | ||
| 91 | the most significant bit is set to 1, and if | ||
| 88 | .Fa top | 92 | .Fa top |
| 89 | is 1, the two most significant bits of the number will be set to 1, so | 93 | is |
| 94 | .Dv BN_RAND_TOP_TWO , | ||
| 95 | the two most significant bits of the number will be set to 1, so | ||
| 90 | that the product of two such random numbers will always have | 96 | that the product of two such random numbers will always have |
| 91 | .Pf 2* Fa bits | 97 | .Pf 2* Fa bits |
| 92 | length. | 98 | length. |
| 93 | If | 99 | If |
| 94 | .Fa bottom | 100 | .Fa bottom |
| 95 | is true, the number will be odd. | 101 | is |
| 102 | .Dv BN_RAND_BOTTOM_ODD , | ||
| 103 | the number will be odd; | ||
| 104 | if it is | ||
| 105 | .Dv BN_RAND_BOTTOM_ANY , | ||
| 106 | it can be odd or even. | ||
| 96 | The value of | 107 | The value of |
| 97 | .Fa bits | 108 | .Fa bits |
| 98 | must be zero or greater. | 109 | must be zero or greater. |
| @@ -100,7 +111,8 @@ If | |||
| 100 | .Fa bits | 111 | .Fa bits |
| 101 | is +1 then | 112 | is +1 then |
| 102 | .Fa top | 113 | .Fa top |
| 103 | cannot also be 1. | 114 | cannot be |
| 115 | .Dv BN_RAND_TOP_TWO . | ||
| 104 | .Pp | 116 | .Pp |
| 105 | .Fn BN_rand_range | 117 | .Fn BN_rand_range |
| 106 | generates a cryptographically strong pseudo-random number | 118 | generates a cryptographically strong pseudo-random number |
