Chapter 2 Algorithm Info Types 65
AI_EC_DHKeyAgree
an A_EC_PARAMS structure:
Format of info returned by B_GetAlgorithmInfo:
B_GetAlgorithmInfo is not supported with this AI. If called, it will return an error.
Crypto-C procedures to use with algorithm object:
B_KeyAgreeInit, B_KeyAgreePhase1, and B_KeyAgreePhase2. You must pass an
initialized random algorithm to
B_KeyAgreePhase1.
Algorithm methods to include in application's algorithm chooser:
AM_ECFP_DH_KEY_AGREE for odd prime fields and AM_ECF2POLY_DH_KEY_AGREE for even
characteristic.
Output considerations:
The size of Phase 1 output is 1 + 2 · (size of field element) bytes; the size of Phase 2
output is (size of field element) bytes
typedef struct {
unsigned int version; /* implementation version */
unsigned int fieldType; /* indicates type of base field */
ITEM fieldInfo; /* The prime number if 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;