AI_ECBuildPubKeyAccelTable chooser:

Performing Elliptic Curve Operations

Step 3: Init

To initialize the proper algorithms, you must supply an algorithm chooser with the appropriate algorithm methods. See the Reference Manual Chapter 2 entry for

for a list of the appropriate AMs to include in the

B_ALGORITHM_METHOD *ecAccelChooser[] = { &AM_ECFP_BLD_PUB_KEY_ACC_TAB, &AM_ECF2POLY_BLD_PUB_KEY_ACC_TAB, (B_ALGORITHM_METHOD *)NULL_PTR

};

if ((status = B_BuildTableInit(buildTable, ecAccelChooser, (A_SURRENDER_CTX *)NULL_PTR)) != 0)

break;

Step 4: Update

There is no Update step for building acceleration tables.

Step 5: Final

Step 5a: Allocate memory

You must allocate sufficient memory to hold the acceleration table. Use

B_BuildTableGetBufSize to obtain the maximum size of the public key acceleration table. Then allocate enough space to hold the table:

ITEM pubKeyAccelTableItem; unsigned int maxTableLen;

if ((status = B_BuildTableGetBufSize(buildTable, &maxTableLen)) != 0) break;

pubKeyAccelTableItem.data = T_malloc(maxTableLen);

if ((status = (pubKeyAccelTableItem.data == NULL_PTR)) != 0) break;

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 7 9

Page 301
Image 301
RSA Security 5.2.2 manual Item pubKeyAccelTableItem unsigned int maxTableLen