Performing Elliptic Curve Operations

B_DIGEST_SPECIFIER digestInfo; digestInfo.digestInfoType = AI_SHA1; digestInfo.digestInfoParams = NULL_PTR;

if ((status = B_SetAlgorithmInfo (ecDSASign, AI_EC_DSAWithDigest, (POINTER)&digestInfo)) != 0)

break;

Step 2b (optional): Set Acceleration Table Info

ITEM aTableItem;

Go through the steps in the section “Generating Acceleration Tables” on page 273 to create an acceleration table, placing the table information in aTableItem:

if ((status = B_SetAlgorithmInfo (ecDSASign, AI_ECAcceleratorTable, (POINTER)&aTableItem)) != 0)

break;

Step 3: Init

Build an algorithm chooser with the appropriate AMs:

B_ALGORITHM_METHOD *EC_DSA_CHOOSER[] = { &AM_SHA,

&AM_ECFP_DSA_SIGN, &AM_ECF2POLY_DSA_SIGN, &AM_ECFP_DSA_VERIFY, &AM_ECF2POLY_DSA_VERIFY, (B_ALGORITHM_METHOD *)NULL_PTR

};

Now you can associate your private key and your algorithm chooser with the algorithm object:

C h a p t e r 7 P u b l i c - K e y O p e r a t i o n s

2 8 7

Page 309
Image 309
RSA Security 5.2.2 manual Build an algorithm chooser with the appropriate AMs, Item aTableItem