Performing Elliptic Curve Operations

/* This procedure takes a pointer to an A_EC_PUBLIC_KEY structure containing

*space allocated by AllocAndCopyECPubKeyInfo and frees all data allocated

*with T_malloc. */

void FreeECPubKeyInfo(pubKey) A_EC_PUBLIC_KEY *pubKey;

{

T_free(pubKey->publicKey.data); FreeECParamInfo(&(pubKey->curveParams));

}/* end FreeECPubKeyInfo */

Generating Acceleration Tables

An acceleration table stores precomputed versions of certain values that are frequently used during some elliptic curve operations. Acceleration tables can speed up certain elliptic curve operations. However, this increase in speed comes at the cost of space, as these tables tend to be very large.

There are two types of acceleration tables in Crypto-C:

Generic acceleration table: stores values that are commonly used in many elliptic- curve operations, including key-pair generation, Elliptic Curve Diffie-Hellman key agreement, and ECDSA signing and verifying.

Public-key acceleration table: stores all the values stored by the generic acceleration table, as well as additional values commonly used only in ECDSA verification.

The examples in this section are in the file eparam.c.

Generating a Generic Acceleration Table

This acceleration table can be used to speed up key-pair generation, public-key encryption, Elliptic Curve Diffie-Hellman key agreement, and ECDSA signing and verifying. This table is most useful if these operations are performed repeatedly with the same elliptic curve. The function BuildAccelTable, used in the sample code and defined in the file ecparam.c, demonstrates the following steps in creating the acceleration table.

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 3

Page 295
Image 295
RSA Security 5.2.2 manual Generating Acceleration Tables, Generating a Generic Acceleration Table, End FreeECPubKeyInfo