Performing Elliptic Curve Operations
290 RSA BSAFE Crypto-C Developers Guide
Step 2b (Optional): Set Public Key Acceleration Table Info
You can use either the public key acceleration table or the generic acceleration table to
accelerate ECDSA verification. Verification using the public key acceleration table is
faster than verification using only the generic acceleration table.
Go through the steps in the section Generating Acceleration Tables to create a
generic acceleration table, placing the table information in
aTableItem
:
Step 3: Init
Associate a key with the algorithm object and provide a chooser that contains the
necessary algorithm methods:
Step 4: Update
Pass in the original message. It will be internally digested to make a new signature
that can be compared with the signature received by B_VerifyFinal:
Step 5: Final
Pass in the signature that was received with the message. B_VerifyFinal returns 0 if
the signature verifies, or an error if it is an invalid signature:
ITEM pubKeyAccelTableItem;
if ((status = B_SetAlgorithmInfo (ecDSAVerify, AI_ECAcceleratorTable,
(POINTER)&pubKeyAccelTableItem)) != 0)
break;
if ((status = B_VerifyInit (ecDSAVerify, publicKey, EC_DSA_CHOOSER,
(A_SURRENDER_CTX *)NULL_PTR)) != 0)
break;
if ((status = B_VerifyUpdate (ecDSAVerify, dataToSign, dataToSignLen,
(A_SURRENDER_CTX *)NULL_PTR)) != 0)
break;