5.2.1.2 ECDH - TempKey Source

The ECDH command may use the value in TempKey as its starting value for an ECDH command. The ECC private key value in TempKey must be generated by the GenKey command. Once the TempKey has been used by the ECDH command, the TempKey.Valid flag is reset. If the output is back to the TempKey location, then this flag will be set again.

Table 5-40. Input Parameters ECDH TempKey

Opcode
(1 Byte)

Mode
(1 Byte)

KeyId
(2 Bytes)

DataDescription

Data 1
(32 Bytes)

Data 2
(32 Bytes)

0x430x0D0x00 00X component of public keyY component of public key
  • Results sent to the output buffer
  • Output is in the clear(1)
0x0F0x00 00X component of public keyY component of public key
  • Results sent to the output buffer
  • Output is encrypted
0x090x00 00X component of public keyY component of public key
  • Results stored in TempKey
  • Output is available for other operations but is not directly accessible.
0x050x00 0[Slot]X component of public keyY component of public key
  • Results stored in specified slot
Note:
  1. When the ChipOptions.ECDHPROT value is 1, then the output of the ECDH command will be encrypted in this mode. For the ATECC608B-TNGLoRaWAN the ECDHPROT field is set to 0 and encryption will be dependent upon the mode of the ECDH command.
Table 5-41. Output Response ECDH TempKey
NameModeSizeDescription
Response0x0D or 0x0F 1 byteError code if command fails
Response0x0D32 bytesShared Master Secret as clear text

Response
OutNonce

0x0F

32 bytes
32 bytes

Shared Master Secret as encrypted text
nonce used for encryption

Response0x05 or 0x091 byte0x00 if successful, otherwise an error code is returned