diff --git a/wolfcrypt/src/port/atmel/atmel.c b/wolfcrypt/src/port/atmel/atmel.c index cfe0a93c7..65dd4dfa7 100644 --- a/wolfcrypt/src/port/atmel/atmel.c +++ b/wolfcrypt/src/port/atmel/atmel.c @@ -347,7 +347,11 @@ int atmel_ecc_create_pms(int slotId, const uint8_t* peerKey, uint8_t* pms) ATECC_GET_ENC_KEY(read_key, sizeof(read_key)); /* send the encrypted version of the ECDH command */ +#if defined(ATECC_USE_TRANSPORT_KEY) && ATECC_USE_TRANSPORT_KEY ret = atcab_ecdh_enc(slotId, peerKey, pms, read_key, slotIdEnc); +#else + ret = atcab_ecdh(slotId, peerKey, pms); +#endif ret = atmel_ecc_translate_err(ret); /* free the ECDHE slot */ diff --git a/wolfssl/wolfcrypt/port/atmel/atmel.h b/wolfssl/wolfcrypt/port/atmel/atmel.h index 70035130c..3d7b54d2d 100644 --- a/wolfssl/wolfcrypt/port/atmel/atmel.h +++ b/wolfssl/wolfcrypt/port/atmel/atmel.h @@ -60,6 +60,11 @@ #define ATECC_SLOT_ENC_PARENT (0x7) #endif +/* Use a I2C transport key */ +#ifndef ATECC_USE_TRANSPORT_KEY +#define ATECC_USE_TRANSPORT_KEY 1 +#endif + /* ATECC_KEY_SIZE required for ecc.h */ #include