CryptoAuthLib
Microchip CryptoAuthentication Library
atca_basic_ecdh.c File Reference

CryptoAuthLib Basic API methods for ECDH command. More...

#include "atca_basic.h"
#include "atca_execution.h"
#include "host/atca_host.h"

Functions

ATCA_STATUS atcab_ecdh_base (uint8_t mode, uint16_t key_id, const uint8_t *public_key, uint8_t *pms, uint8_t *out_nonce)
 Base function for generating premaster secret key using ECDH. More...
 
ATCA_STATUS atcab_ecdh (uint16_t key_id, const uint8_t *public_key, uint8_t *pms)
 ECDH command with a private key in a slot and the premaster secret is returned in the clear. More...
 
ATCA_STATUS atcab_ecdh_enc (uint16_t key_id, const uint8_t *public_key, uint8_t *pms, const uint8_t *read_key, uint16_t read_key_id)
 ECDH command with a private key in a slot and the premaster secret is read from the next slot. More...
 
ATCA_STATUS atcab_ecdh_ioenc (uint16_t key_id, const uint8_t *public_key, uint8_t *pms, const uint8_t *io_key)
 ECDH command with a private key in a slot and the premaster secret is returned encrypted using the IO protection key. More...
 
ATCA_STATUS atcab_ecdh_tempkey (const uint8_t *public_key, uint8_t *pms)
 ECDH command with a private key in TempKey and the premaster secret is returned in the clear. More...
 
ATCA_STATUS atcab_ecdh_tempkey_ioenc (const uint8_t *public_key, uint8_t *pms, const uint8_t *io_key)
 ECDH command with a private key in TempKey and the premaster secret is returned encrypted using the IO protection key. More...
 

Detailed Description

CryptoAuthLib Basic API methods for ECDH command.

The ECDH command implements the Elliptic Curve Diffie-Hellman algorithm to combine an internal private key with an external public key to calculate a shared secret.

Note
List of devices that support this command - ATECC508A, ATECC608A. There are differences in the modes that they support. Refer to device datasheets for full details.