RSA Security 5.2.2 Projection Television User Manual


 
Chapter 7 Public-Key Operations 269
Performing Elliptic Curve Operations
Step 2: Set
The Reference Manual indicates that the appropriate AI to use for generating an elliptic
curve key pair is
AI_ECKeyGen. You must set the algorithm object with the parameter
information for the elliptic curve that you are using to generate the key. You do this
by providing
B_SetAlgorithmInfo with a pointer to a B_EC_PARAMS structure.
Place the elliptic curve parameters in the
A_EC_PARAMS structure
ecParamInfo
. You can
do this either by setting
ecParamInfo
with the appropriate values, or by following the
steps outlined in Retrieving Elliptic Curve Parameters on page 264 to retrieve the
parameters from an algorithm object and place them into an
A_EC_PARAMS structure.
The AI that describes data in this format is
AI_ECParameters:
You can also optionally use the acceleration table to speed up key generation. See
Generating Acceleration Tables on page 273 for more information. Assume that you
have the acceleration table corresponding to your elliptic curve in the
ITEM structure
accelTableItem
. The appropriate AI to use with B_SetAlgorithmInfo in this case is
AI_ECAcceleratorTable. Pass in a pointer to the ITEM structure holding the
acceleration table as the third argument to
B_SetAlgorithmInfo. Now set your key-
generation algorithm object with the acceleration table information:
if ((status = B_CreateKeyObject (&publicKey)) != 0)
break;
if ((status = B_CreateKeyObject (&privateKey)) != 0)
break;
typedef struct {
B_INFO_TYPE parameterInfoType;
POINTER parameterInfoValue;
} B_EC_PARAMS;
B_EC_PARAMS paramInfo;
paramInfo.parameterInfoType = AI_ECParameters;
paramInfo.parameterInfoValue = (POINTER)&ecParamInfo;
if ((status = B_SetAlgorithmInfo (ecKeyGen, AI_ECKeyGen,
(POINTER)&paramInfo)) != 0)
break;