RSA Security 5.2.2 Projection Television User Manual


 
Performing Elliptic Curve Operations
264 RSA BSAFE Crypto-C Developers Guide
Step 5: Generate
This function may take a while, so you should use a surrender function. See The
Surrender Context on page 118.
B_GenerateParameters places the newly-generated
elliptic curve parameters in
ecParamsObj
:
Step 6: Destroy
Destroy all algorithm objects that are no longer necessary. However, do not destroy
ecParamsObj
until you have retrieved and stored the parameters. See Retrieving
Elliptic Curve Parameters on page 264 for more information. Destroy
ecParamsObj
when it is no longer needed:
Retrieving Elliptic Curve Parameters
Once you have your elliptic curve parameters in an algorithm object, you need to be
able to retrieve those parameters in an accessible form. Once you have retrieved your
parameters, you can store the information or print it out. You also need to retrieve the
elliptic curve parameters from the algorithm object when you generate acceleration
tables.
This section outlines two application-specific procedures,
AllocAndCopyECParamInfo
and
FreeECParamInfo
, that are used to retrieve and store information. These
procedures are referred to in subsequent sections.
To retrieve information from an algorithm object, call
B_GetAlgorithmInfo with an
appropriate AI. The only AI listed in the Reference Manual that allows you to set or
retrieve the parameters is
AI_ECParameters:
generalSurrenderContext.Surrender = GeneralSurrenderFunction;
generalSurrenderContext.handle = (POINTER)&generalFlag;
generalSurrenderContext.reserved = NULL_PTR;
generalFlag = 0;
if ((status = B_GenerateParameters(paramGenObj, ecParamsObj,
randomAlgorithm,
&generalSurrenderContext)) != 0)
break;
B_DestroyAlgorithmObject (&paramGenObj);
B_DestroyAlgorithmObject (&randomAlgorithm);