RSA Security 5 Projection Television User Manual


 
Chapter 2 Algorithm Info Types 45
AI_DHKeyAgree
AI_DHKeyAgree
Purpose:
This AI allows you to perform Diffie-Hellman key agreement. You may have
generated system parameters (for example, through
AI_DHParamGen), or you may
have retrieved them from another source. These system parameters are passed to
B_SetAlgorithmInfo. The function B_KeyAgreePhase1 creates the public value that is
sent to the other party, and
B_KeyAgreePhase2 processes the value from the other
party to produce the shared secret value. See
AI_DHKeyAgreeBER for the same
algorithm type with BER encoding.
Type of information this allows you to use:
Diffie-Hellman system parameters, where the prime and base integers, and the
exponent size, are specified for performing Diffie-Hellman key agreement as defined
in PKCS #3.
Format of info supplied to B_SetAlgorithmInfo:
pointer to an A_DH_KEY_AGREE_PARAMS structure:
Each
ITEM supplies an integer in canonical format, where the ITEM’s
data
points to an
unsigned byte array -- most significant byte first -- and the
ITEM’s
len
gives its length.
All leading zeros are stripped from each integer before it is copied to the algorithm
object.
Format of info returned by B_GetAlgorithmInfo:
pointer to an A_DH_KEY_AGREE_PARAMS structure (see above). All leading zeros have
been stripped from each integer in the structure.
typedef struct {
ITEM prime; /* prime modulus */
ITEM base; /* base generator */
unsigned int exponentBits; /* size of random exponent in bits */
} A_DH_KEY_AGREE_PARAMS;