RSA BSAFE Cert-C Micro Edition

The power of PKI for the smallest of devices

Key Agreement Functions

This section outlines the functions that enable phased key agreement operations. Diffie-Hellman is an algorithm implemented using key agreement operations.

Functions

int R_CR_key_exchange_init (R_CR *crypto, R_PKEY *params)
 Initializes a cryptographic operation for phased key exchange and agreement. More...

int R_CR_key_exchange_phase_1 (R_CR *crypto, unsigned char *out, unsigned int *olen)
 Performs phase 1 of a key exchange protocol. More...

int R_CR_key_exchange_phase_2 (R_CR *crypto, unsigned char *data, unsigned int dlen, unsigned char *out, unsigned int *olen)
 Performs phase 2 of a key exchange protocol. More...


Function Documentation

int R_CR_key_exchange_init R_CR   crypto,
R_PKEY   key
;
 

Initializes a cryptographic operation for phased key exchange and agreement.

Parameters:
crypto [In] A pointer to the cryptographic object.
Must be allocated the correct type via R_CR_new().
key [In] The key to use.
Must be the correct type for the key agreement algorithm selected.
Returns:
R_ERROR_NONE indicates success.
See Error Identifiers for valid values.
See also:
R_CR_key_exchange_phase_1() and R_CR_key_exchange_phase_2().

int R_CR_key_exchange_phase_1 R_CR   crypto,
unsigned char *    out,
unsigned int *    out_len
;
 

Performs phase 1 of a key exchange protocol.

Parameters:
crypto [In] A pointer to the cryptographic object.
Must be allocated the correct type and initialized by calls to R_CR_new() and R_CR_key_exchange_init() respectively.
out [Out] A pointer to the buffer receiving the private key.
Must be of sufficient length to contain the key agreement data.
out_len [In, Out] The length of the data, in out.
Returns:
R_ERROR_NONE indicates success.
See Error Identifiers for valid values.
See also:
R_CR_key_exchange_init() and R_CR_key_exchange_phase_2().

int R_CR_key_exchange_phase_2 R_CR   crypto,
unsigned char *    data,
unsigned int    data_len,
unsigned char *    out,
unsigned int *    out_len
;
 

Performs phase 2 of a key exchange protocol. This is the result in a shared secret operation.

Parameters:
crypto [In] A pointer to the cryptographic object.
Must be allocated the correct type and initialized by calls to R_CR_new() and R_CR_key_exchange_init() respectively.
data [In] A pointer to the data from phase 1.
data_len [In] The length of the data from phase 1.
out [Out] A pointer to the buffer receiving the shared secret.
Must be of sufficient length to contain the final block of data.
out_len [In, Out] The length of the data, in out.
Returns:
R_ERROR_NONE indicates success.
See Error Identifiers for valid values.
See also:
R_CR_key_exchange_init() and R_CR_key_exchange_phase_1().


Copyright (c) 1999-2002 RSA Security Inc. All rights reserved. 061-001005-150-001-000-3768 - 1.5