RSA BSAFE Crypto-C

Cryptographic Components for C

Search

AI_DHKeyAgree

Performs Diffie-Hellman key agreement. Developers may have generated system parameters (for example, through AI_DHParamGen), or retrieve them from another source. These system parameters are passed to B_SetAlgorithmInfo(). 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.
note.gif
See AI_DHKeyAgreeBER for the same AI with BER-encoding.

info Format

B_SetAlgorithmInfo() A pointer to A_DH_KEY_AGREE_PARAMS.
Each ITEM supplies an integer in canonical format, where the ITEM data points to an unsigned Byte array - most significant Byte first - and the ITEM len gives its length. All leading zeros are stripped from each integer before it is copied to the algorithm object.
B_GetAlgorithmInfo() A pointer to A_DH_KEY_AGREE_PARAMS.
All leading zeros have been stripped from each integer in the structure.

AI_DHKeyAgree Information

Functions to use B_KeyAgreeInit(), B_KeyAgreePhase1(), B_KeyAgreePhase2(), B_SetAlgorithmState() and B_GetAlgorithmState(). Pass an initialized random algorithm to B_KeyAgreePhase1().
AMs to include AM_DH_KEY_AGREE.
Compatible representation AI_DHKeyAgreeBER.
Output considerations The size of the output of B_KeyAgreePhase1() (the public value) will be the same size as the prime. The size of the output of B_KeyAgreePhase2() (the agreed-upon secret) will also be the same size as the prime.


Copyright (c) 1999-2005 RSA Security Inc. All rights reserved. 068-001001-6210-001-000 - 6.2.1