RSA Security 5.2.2 manual There is no in generating DSA parameters

Models: 5.2.2

1 376
Download 376 pages 13.91 Kb
Page 262
Image 262

Performing DSA Operations

of info supplied to B_SetAlgorithmInfo is a pointer to the following:

typedef struct

{

 

unsigned int

primeBits;

/* size of prime in bits */

}B_DSA_PARAM_GEN_PARAMS;

Crypto-C will generate the prime, but you must decide how big that prime will be. The number of prime bits can be anywhere from 512 to 2048. Larger numbers provide greater security, but are also much slower. As with the RSA algorithm, RSA Security recommends using 768 bits. To save time, because this is for illustrative purposes only, this example will use 512. The subprime is always 160 bits long:

B_DSA_PARAM_GEN_PARAMS dsaParams;

dsaParams.primeBits = 512;

if ((status = B_SetAlgorithmInfo (dsaParamGenerator, AI_DSAParamGen, (POINTER)&dsaParams)) != 0)

break;

Step 3: Init

Initialize the generation process with B_GenerateInit. Build an algorithm chooser. Because this function is quick, it is reasonable to pass NULL_PTR as the surrender context. Generating the parameters in Step 5 is time-consuming, though, so you will use a surrender context there:

B_ALGORITHM_METHOD *DSA_PARAM_GEN_CHOOSER[] = { &AM_SHA_RANDOM,

&AM_DSA_PARAM_GEN,

(B_ALGORITHM_METHOD *)NULL_PTR

};

if ((status = B_GenerateInit (dsaParamGenerator, DSA_PARAM_GEN_CHOOSER, (A_SURRENDER_CTX *)NULL_PTR)) != 0)

break;

Step 4: Update

There is no Step 4 in generating DSA parameters.

2 4 0

R S A B S A F E C r y p t o - C D e v e l o p e r ’s G u i d e

Page 262
Image 262
RSA Security 5.2.2 manual There is no in generating DSA parameters, Bdsaparamgenparams dsaParams DsaParams.primeBits =