diff options
author | Jung-uk Kim <jkim@FreeBSD.org> | 2015-10-30 20:51:33 +0000 |
---|---|---|
committer | Jung-uk Kim <jkim@FreeBSD.org> | 2015-10-30 20:51:33 +0000 |
commit | 7bded2db17780f5b59bc532689d8a9541f06901e (patch) | |
tree | e8d8b5ada49f5cdbf70d1e455c13f2625fdcdd45 /secure/lib/libcrypto/man/DSA_generate_parameters.3 | |
parent | 50657fd342bcf1886e5b6d2c74605bbdd6b91bed (diff) | |
parent | e9fcefce9bb70f20c272a996443928c5f6ab8cd8 (diff) | |
download | src-test2-7bded2db17780f5b59bc532689d8a9541f06901e.tar.gz src-test2-7bded2db17780f5b59bc532689d8a9541f06901e.zip |
Notes
Diffstat (limited to 'secure/lib/libcrypto/man/DSA_generate_parameters.3')
-rw-r--r-- | secure/lib/libcrypto/man/DSA_generate_parameters.3 | 58 |
1 files changed, 38 insertions, 20 deletions
diff --git a/secure/lib/libcrypto/man/DSA_generate_parameters.3 b/secure/lib/libcrypto/man/DSA_generate_parameters.3 index 6ffe9500904e..f41c6b885247 100644 --- a/secure/lib/libcrypto/man/DSA_generate_parameters.3 +++ b/secure/lib/libcrypto/man/DSA_generate_parameters.3 @@ -133,26 +133,34 @@ .\" ======================================================================== .\" .IX Title "DSA_generate_parameters 3" -.TH DSA_generate_parameters 3 "2015-07-09" "1.0.1p" "OpenSSL" +.TH DSA_generate_parameters 3 "2015-07-09" "1.0.2d" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" -DSA_generate_parameters \- generate DSA parameters +DSA_generate_parameters_ex, DSA_generate_parameters \- generate DSA parameters .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& #include <openssl/dsa.h> \& +\& int DSA_generate_parameters_ex(DSA *dsa, int bits, +\& const unsigned char *seed,int seed_len, +\& int *counter_ret, unsigned long *h_ret, BN_GENCB *cb); +.Ve +.PP +Deprecated: +.PP +.Vb 3 \& DSA *DSA_generate_parameters(int bits, unsigned char *seed, \& int seed_len, int *counter_ret, unsigned long *h_ret, \& void (*callback)(int, int, void *), void *cb_arg); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" -\&\fIDSA_generate_parameters()\fR generates primes p and q and a generator g -for use in the \s-1DSA.\s0 +\&\fIDSA_generate_parameters_ex()\fR generates primes p and q and a generator g +for use in the \s-1DSA\s0 and stores the result in \fBdsa\fR. .PP \&\fBbits\fR is the length of the prime to be generated; the \s-1DSS\s0 allows a maximum of 1024 bits. @@ -162,52 +170,62 @@ generated at random. Otherwise, the seed is used to generate them. If the given seed does not yield a prime q, a new random seed is chosen and placed at \fBseed\fR. .PP -\&\fIDSA_generate_parameters()\fR places the iteration count in +\&\fIDSA_generate_parameters_ex()\fR places the iteration count in *\fBcounter_ret\fR and a counter used for finding a generator in *\fBh_ret\fR, unless these are \fB\s-1NULL\s0\fR. .PP A callback function may be used to provide feedback about the progress -of the key generation. If \fBcallback\fR is not \fB\s-1NULL\s0\fR, it will be -called as follows: +of the key generation. If \fBcb\fR is not \fB\s-1NULL\s0\fR, it will be +called as shown below. For information on the \s-1BN_GENCB\s0 structure and the +BN_GENCB_call function discussed below, refer to +\&\fIBN_generate_prime\fR\|(3). .IP "\(bu" 4 -When a candidate for q is generated, \fBcallback(0, m++, cb_arg)\fR is called +When a candidate for q is generated, \fBBN_GENCB_call(cb, 0, m++)\fR is called (m is 0 for the first candidate). .IP "\(bu" 4 When a candidate for q has passed a test by trial division, -\&\fBcallback(1, \-1, cb_arg)\fR is called. +\&\fBBN_GENCB_call(cb, 1, \-1)\fR is called. While a candidate for q is tested by Miller-Rabin primality tests, -\&\fBcallback(1, i, cb_arg)\fR is called in the outer loop +\&\fBBN_GENCB_call(cb, 1, i)\fR is called in the outer loop (once for each witness that confirms that the candidate may be prime); i is the loop counter (starting at 0). .IP "\(bu" 4 -When a prime q has been found, \fBcallback(2, 0, cb_arg)\fR and -\&\fBcallback(3, 0, cb_arg)\fR are called. +When a prime q has been found, \fBBN_GENCB_call(cb, 2, 0)\fR and +\&\fBBN_GENCB_call(cb, 3, 0)\fR are called. .IP "\(bu" 4 Before a candidate for p (other than the first) is generated and tested, -\&\fBcallback(0, counter, cb_arg)\fR is called. +\&\fBBN_GENCB_call(cb, 0, counter)\fR is called. .IP "\(bu" 4 When a candidate for p has passed the test by trial division, -\&\fBcallback(1, \-1, cb_arg)\fR is called. +\&\fBBN_GENCB_call(cb, 1, \-1)\fR is called. While it is tested by the Miller-Rabin primality test, -\&\fBcallback(1, i, cb_arg)\fR is called in the outer loop +\&\fBBN_GENCB_call(cb, 1, i)\fR is called in the outer loop (once for each witness that confirms that the candidate may be prime). i is the loop counter (starting at 0). .IP "\(bu" 4 -When p has been found, \fBcallback(2, 1, cb_arg)\fR is called. +When p has been found, \fBBN_GENCB_call(cb, 2, 1)\fR is called. .IP "\(bu" 4 -When the generator has been found, \fBcallback(3, 1, cb_arg)\fR is called. +When the generator has been found, \fBBN_GENCB_call(cb, 3, 1)\fR is called. +.PP +\&\fIDSA_generate_parameters()\fR (deprecated) works in much the same way as for DSA_generate_parameters_ex, except that no \fBdsa\fR parameter is passed and +instead a newly allocated \fB\s-1DSA\s0\fR structure is returned. Additionally \*(L"old +style\*(R" callbacks are used instead of the newer \s-1BN_GENCB\s0 based approach. +Refer to \fIBN_generate_prime\fR\|(3) for further information. .SH "RETURN VALUE" .IX Header "RETURN VALUE" +\&\fIDSA_generate_parameters_ex()\fR returns a 1 on success, or 0 otherwise. +.PP \&\fIDSA_generate_parameters()\fR returns a pointer to the \s-1DSA\s0 structure, or -\&\fB\s-1NULL\s0\fR if the parameter generation fails. The error codes can be -obtained by \fIERR_get_error\fR\|(3). +\&\fB\s-1NULL\s0\fR if the parameter generation fails. +.PP +The error codes can be obtained by \fIERR_get_error\fR\|(3). .SH "BUGS" .IX Header "BUGS" Seed lengths > 20 are not supported. .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fIdsa\fR\|(3), \fIERR_get_error\fR\|(3), \fIrand\fR\|(3), -\&\fIDSA_free\fR\|(3) +\&\fIDSA_free\fR\|(3), \fIBN_generate_prime\fR\|(3) .SH "HISTORY" .IX Header "HISTORY" \&\fIDSA_generate_parameters()\fR appeared in SSLeay 0.8. The \fBcb_arg\fR |