Manual Pages for UNIX Darwin command on man DSA_generate_parameters
MyWebUniversity

Manual Pages for UNIX Darwin command on man DSA_generate_parameters

DSAgenerateparameters(3) OpenSSL DSAgenerateparameters(3)

NAME

DSAgenerateparameters - generate DSA parameters

SYNOPSIS

#include

DSA *DSAgenerateparameters(int bits, unsigned char *seed, int seedlen, int *counterret, unsigned long *hret, void (*callback)(int, int, void *), void *cbarg);

DESCRIPTION

DSAgenerateparameters() generates primes p and q and a generator g for use in the DSA. bbiittss is the length of the prime to be generated; the DSS allows a maximum of 1024 bits. If sseeeedd is NNUULLLL or sseeeeddlleenn < 20, the primes will be 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 sseeeedd. DSAgenerateparameters() places the iteration count in *ccoouunntteerrrreett and a counter used for finding a generator in *hhrreett, unless these are NNUULLLL. A callback function may be used to provide feedback about the progress of the key generation. If ccaallllbbaacckk is not NNUULLLL, it will be called as follows: +o When a candidate for q is generated, ccaallllbbaacckk((00,, mm++++,, ccbbaarrgg)) is called (m is 0 for the first candidate). +o When a candidate for q has passed a test by trial division,

ccaallllbbaacckk((11,, -11,, ccbbaarrgg)) is called. While a candidate for q is

tested by Miller-Rabin primality tests, ccaallllbbaacckk((11,, ii,, ccbbaarrgg)) 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). +o When a prime q has been found, ccaallllbbaacckk((22,, 00,, ccbbaarrgg)) and ccaallllbbaacckk((33,, 00,, ccbbaarrgg)) are called. +o Before a candidate for p (other than the first) is generated and tested, ccaallllbbaacckk((00,, ccoouunntteerr,, ccbbaarrgg)) is called. +o When a candidate for p has passed the test by trial division,

ccaallllbbaacckk((11,, -11,, ccbbaarrgg)) is called. While it is tested by the

Miller-Rabin primality test, ccaallllbbaacckk((11,, ii,, ccbbaarrgg)) 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). +o When p has been found, ccaallllbbaacckk((22,, 11,, ccbbaarrgg)) is called. +o When the generator has been found, ccaallllbbaacckk((33,, 11,, ccbbaarrgg)) is called. RREETTUURRNN VVAALLUUEE DSAgenerateparameters() returns a pointer to the DSA structure, or NNUULLLL if the parameter generation fails. The error codes can be obtained by ERRgeterror(3).

BUGS

Seed lengths > 20 are not supported.

SEE ALSO

dsa(3), ERRgeterror(3), rand(3), DSAfree(3) HISTORY DSAgenerateparameters() appeared in SSLeay 0.8. The ccbbaarrgg argument was added in SSLeay 0.9.0. In versions up to OpenSSL 0.9.4,

ccaallllbbaacckk((11,, ......)) was called in the inner loop of the Miller-Rabin test

whenever it reached the squaring step (the parameters to ccaallllbbaacckk did not reveal how many witnesses had been tested); since OpenSSL 0.9.5, ccaallllbbaacckk((11,, ......)) is called as in BNisprime(3), i.e. once for each witness.

0.9.7l 2002-09-25 DSAgenerateparameters(3)




Contact us      |      About us      |      Term of use      |       Copyright © 2000-2019 MyWebUniversity.com ™