![](https://pdfstore-manualsonline.prod.a.ki/pdfasset/9/c4/9c4432ed-94b6-4f82-9d47-c9fb5f98b613/9c4432ed-94b6-4f82-9d47-c9fb5f98b613-bg11f.png)
Chapter 7 Public-Key Operations 265
Performing Elliptic Curve Operations
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:
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:
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.
Type of information this allows you to use:
the parameters generated by executing
AI_ECParamGen for either generating keys or
executing key agreements.
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;
A_EC_PARAMS *cryptocECParamInfo;
if ((status = B_GetAlgorithmInfo((POINTER *)&cryptocECParamInfo,
ecParamsObj, AI_ECParameters)) != 0)
break;