diff options
author | tb <> | 2023-12-29 19:15:15 +0000 |
---|---|---|
committer | tb <> | 2023-12-29 19:15:15 +0000 |
commit | b7a55ea56653f59eec6d2b26e637b59c9e16d39b (patch) | |
tree | 42157c9cf92e960355c3c07337de948a2efdda9b /src/lib/libcrypto/man/DSA_generate_parameters.3 | |
parent | 0e709b48615f57257e51f9c142d8c8e19008c351 (diff) | |
download | openbsd-b7a55ea56653f59eec6d2b26e637b59c9e16d39b.tar.gz openbsd-b7a55ea56653f59eec6d2b26e637b59c9e16d39b.tar.bz2 openbsd-b7a55ea56653f59eec6d2b26e637b59c9e16d39b.zip |
Move DSA_generate_parameters.3 to DSA_generate_parameters_ex.3
Diffstat (limited to 'src/lib/libcrypto/man/DSA_generate_parameters.3')
-rw-r--r-- | src/lib/libcrypto/man/DSA_generate_parameters.3 | 174 |
1 files changed, 0 insertions, 174 deletions
diff --git a/src/lib/libcrypto/man/DSA_generate_parameters.3 b/src/lib/libcrypto/man/DSA_generate_parameters.3 deleted file mode 100644 index bba6f9a566..0000000000 --- a/src/lib/libcrypto/man/DSA_generate_parameters.3 +++ /dev/null | |||
@@ -1,174 +0,0 @@ | |||
1 | .\" $OpenBSD: DSA_generate_parameters.3,v 1.14 2023/12/29 19:12:47 tb Exp $ | ||
2 | .\" OpenSSL 9b86974e Aug 7 22:14:47 2015 -0400 | ||
3 | .\" | ||
4 | .\" This file was written by Ulf Moeller <ulf@openssl.org>, | ||
5 | .\" Bodo Moeller <bodo@openssl.org>, and Matt Caswell <matt@openssl.org>. | ||
6 | .\" Copyright (c) 2000, 2013 The OpenSSL Project. All rights reserved. | ||
7 | .\" | ||
8 | .\" Redistribution and use in source and binary forms, with or without | ||
9 | .\" modification, are permitted provided that the following conditions | ||
10 | .\" are met: | ||
11 | .\" | ||
12 | .\" 1. Redistributions of source code must retain the above copyright | ||
13 | .\" notice, this list of conditions and the following disclaimer. | ||
14 | .\" | ||
15 | .\" 2. Redistributions in binary form must reproduce the above copyright | ||
16 | .\" notice, this list of conditions and the following disclaimer in | ||
17 | .\" the documentation and/or other materials provided with the | ||
18 | .\" distribution. | ||
19 | .\" | ||
20 | .\" 3. All advertising materials mentioning features or use of this | ||
21 | .\" software must display the following acknowledgment: | ||
22 | .\" "This product includes software developed by the OpenSSL Project | ||
23 | .\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)" | ||
24 | .\" | ||
25 | .\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
26 | .\" endorse or promote products derived from this software without | ||
27 | .\" prior written permission. For written permission, please contact | ||
28 | .\" openssl-core@openssl.org. | ||
29 | .\" | ||
30 | .\" 5. Products derived from this software may not be called "OpenSSL" | ||
31 | .\" nor may "OpenSSL" appear in their names without prior written | ||
32 | .\" permission of the OpenSSL Project. | ||
33 | .\" | ||
34 | .\" 6. Redistributions of any form whatsoever must retain the following | ||
35 | .\" acknowledgment: | ||
36 | .\" "This product includes software developed by the OpenSSL Project | ||
37 | .\" for use in the OpenSSL Toolkit (http://www.openssl.org/)" | ||
38 | .\" | ||
39 | .\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
40 | .\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
41 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
42 | .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
43 | .\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
44 | .\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
45 | .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
46 | .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
47 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
48 | .\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
49 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
50 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. | ||
51 | .\" | ||
52 | .Dd $Mdocdate: December 29 2023 $ | ||
53 | .Dt DSA_GENERATE_PARAMETERS_EX 3 | ||
54 | .Os | ||
55 | .Sh NAME | ||
56 | .\" .Nm DSA_generate_parameters is intentionally undocumented | ||
57 | .\" because it will be removed in the next major bump | ||
58 | .Nm DSA_generate_parameters_ex | ||
59 | .Nd generate DSA parameters | ||
60 | .Sh SYNOPSIS | ||
61 | .In openssl/dsa.h | ||
62 | .Ft int | ||
63 | .Fo DSA_generate_parameters_ex | ||
64 | .Fa "DSA *dsa" | ||
65 | .Fa "int bits" | ||
66 | .Fa "const unsigned char *seed" | ||
67 | .Fa "int seed_len" | ||
68 | .Fa "int *counter_ret" | ||
69 | .Fa "unsigned long *h_ret" | ||
70 | .Fa "BN_GENCB *cb" | ||
71 | .Fc | ||
72 | .Sh DESCRIPTION | ||
73 | .Fn DSA_generate_parameters_ex | ||
74 | generates primes p and q and a generator g for use in the DSA and stores | ||
75 | the result in | ||
76 | .Fa dsa . | ||
77 | .Pp | ||
78 | .Fa bits | ||
79 | is the length of the prime to be generated; the DSS allows a maximum of | ||
80 | 1024 bits. | ||
81 | .Pp | ||
82 | If | ||
83 | .Fa seed | ||
84 | is | ||
85 | .Dv NULL | ||
86 | or | ||
87 | .Fa seed_len | ||
88 | < 20, the primes will be generated at random. | ||
89 | Otherwise, the seed is used to generate them. | ||
90 | If the given seed does not yield a prime q, a new random seed is chosen | ||
91 | and placed at | ||
92 | .Fa seed . | ||
93 | .Pp | ||
94 | .Fn DSA_generate_parameters_ex | ||
95 | places the iteration count in | ||
96 | .Pf * Fa counter_ret | ||
97 | and a counter used for finding a generator in | ||
98 | .Pf * Fa h_ret , | ||
99 | unless these are | ||
100 | .Dv NULL . | ||
101 | .Pp | ||
102 | A callback function may be used to provide feedback about the progress | ||
103 | of the key generation. | ||
104 | If | ||
105 | .Fa cb | ||
106 | is not | ||
107 | .Dv NULL , | ||
108 | it will be called as shown below. | ||
109 | For information on the | ||
110 | .Vt BN_GENCB | ||
111 | structure, refer to | ||
112 | .Xr BN_GENCB_call 3 . | ||
113 | .Bl -bullet | ||
114 | .It | ||
115 | When a candidate for q is generated, | ||
116 | .Fn BN_GENCB_call cb 0 m++ | ||
117 | is called | ||
118 | .Pf ( Fa m | ||
119 | is 0 for the first candidate). | ||
120 | .It | ||
121 | When a candidate for q has passed a test by trial division, | ||
122 | .Fn BN_GENCB_call cb 1 -1 | ||
123 | is called. | ||
124 | While a candidate for q is tested by Miller-Rabin primality tests, | ||
125 | .Fn BN_GENCB_call cb 1 i | ||
126 | is called in the outer loop (once for each witness that confirms that | ||
127 | the candidate may be prime); | ||
128 | .Fa i | ||
129 | is the loop counter (starting at 0). | ||
130 | .It | ||
131 | When a prime q has been found, | ||
132 | .Fn BN_GENCB_call cb 2 0 | ||
133 | and | ||
134 | .Fn BN_GENCB_call cb 3 0 | ||
135 | are called. | ||
136 | .It | ||
137 | Before a candidate for p (other than the first) is generated and tested, | ||
138 | .Fn BN_GENCB_call cb 0 counter | ||
139 | is called. | ||
140 | .It | ||
141 | When a candidate for p has passed the test by trial division, | ||
142 | .Fn BN_GENCB_call cb 1 -1 | ||
143 | is called. | ||
144 | While it is tested by the Miller-Rabin primality test, | ||
145 | .Fn BN_GENCB_call cb 1 i | ||
146 | is called in the outer loop (once for each witness that confirms that | ||
147 | the candidate may be prime). | ||
148 | .Fa i | ||
149 | is the loop counter (starting at 0). | ||
150 | .It | ||
151 | When p has been found, | ||
152 | .Fn BN_GENCB_call cb 2 1 | ||
153 | is called. | ||
154 | .It | ||
155 | When the generator has been found, | ||
156 | .Fn BN_GENCB_call cb 3 1 | ||
157 | is called. | ||
158 | .El | ||
159 | .Sh RETURN VALUES | ||
160 | .Fn DSA_generate_parameters_ex | ||
161 | returns a 1 on success, or 0 otherwise. | ||
162 | .Pp | ||
163 | The error codes can be obtained by | ||
164 | .Xr ERR_get_error 3 . | ||
165 | .Sh SEE ALSO | ||
166 | .Xr BN_generate_prime 3 , | ||
167 | .Xr DSA_get0_pqg 3 , | ||
168 | .Xr DSA_new 3 | ||
169 | .Sh HISTORY | ||
170 | .Fn DSA_generate_parameters_ex | ||
171 | first appeared in OpenSSL 0.9.8 and has been available since | ||
172 | .Ox 4.5 . | ||
173 | .Sh BUGS | ||
174 | Seed lengths > 20 are not supported. | ||