Performing Elliptic Curve Operations

Type of information this allows you to use:

the parameters generated by executing AI_ECParamGen for either generating keys or executing key agreements.

The Reference Manual Chapter 2 entry for AI_ECParameters also states that the format of the information returned by B_GetAlgorithmInfo is a pointer to an A_EC_PARAMS structure:

typedef struct

{

 

unsigned int

version;

/* implementation version */

unsigned int

fieldType;

/* indicates type of base field */

ITEM

fieldInfo;

/* It is the prime number */

 

 

/* in case that fieldType = FT_FP; */

 

/* the basis polynomial if fieldType = FT_F2_POLYNOMIAL; */

 

/* and the degree of the field if fieldType = FT_F2_ONB */

ITEM

coeffA;

/* elliptic curve coefficient */

ITEM

coeffB;

/* elliptic curve coefficient */

ITEM

base;

/* elliptic curve group generator */

ITEM

order;

/* order of subgroup’s generating element */

ITEM

cofactor;

/* the cofactor of the subgroup */

unsigned int

pointRepresentation; /* not used. */

 

 

/* set to CI_NO_COMPRESS as a default */

unsigned int fieldElementBits;

/* field element size in bits */

} A_EC_PARAMS;

 

 

 

 

 

Assume that the elliptic curve parameters are placed in the algorithm object ecParamsObj (see “Generating Elliptic Curve Parameters” on page 260). Make the appropriate call to B_GetAlgorithmInfo:

A_EC_PARAMS *cryptocECParamInfo;

if ((status = B_GetAlgorithmInfo((POINTER *)&cryptocECParamInfo, ecParamsObj, AI_ECParameters)) != 0)

break;

Note that cryptocECParamInfo is a pointer to the information, not the information itself. The memory that cryptocECParamInfo points to belongs to Crypto-C; another call to Crypto-C may alter or destroy it. Therefore, once you get the pointer to the information, you must copy it to your own buffer.

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 6 5

Page 287
Image 287
RSA Security 5.2.2 manual Indicates type of base field, It is the prime number, Case that fieldType = Ftfp