Expand description
Nonce command.
Loads bytes into the chip’s TempKey or MsgDigBuf register. The ATECC608B
supports several modes, of which two are useful from the host side:
-
Random (mode 0): the host sends 20 bytes of input (
NumIn), the chip mixes them with its TRNG output, hashes the result, and stores the hash inTempKey. The chip returns the 32-byte TRNG value (NumOut) that was mixed in, so the host can reconstructTempKeyif needed (this is whatCheckMacandGenDigdepend on). -
Passthrough (mode 3): the host sends 32 bytes that are stored verbatim in
TempKeyor inMsgDigBuf. No mixing, no RNG. The chip responds with a single status byte. This is the mode used to load a message digest intoTempKeybefore callingSign.
Mode 1 (“no RNG re-generation”) and the ATECC608-specific Mode 2 variants are intentionally omitted: nothing in the project’s workflow needs them. They can be added later as additional methods rather than expanded as parameters on the existing ones, to keep each entry point unambiguous.
Reference: CryptoAuthLib lib/calib/calib_nonce.c, constants
NONCE_MODE_SEED_UPDATE (0x00), NONCE_MODE_PASSTHROUGH (0x03),
NONCE_MODE_TARGET_TEMPKEY (0x00), NONCE_MODE_TARGET_MSGDIGBUF (0x40),
NONCE_NUMIN_SIZE (20), NONCE_NUMIN_SIZE_PASSTHROUGH (32).
Enums§
- Nonce
Target - Destination register for a passthrough Nonce.
Constants§
- NONCE_
MODE_ 🔒PASSTHROUGH param1low bits for mode 3 (passthrough).- NONCE_
MODE_ 🔒RANDOM param1low bits for mode 0 (random nonce, seed update).- NONCE_
NUMIN_ SIZE - Size of the
NumInblock in a random Nonce command. - NONCE_
NUMOUT_ SIZE - Size of the
NumOutblock returned by a random Nonce command. - NONCE_
PASSTHROUGH_ SIZE - Size of the data field in a passthrough Nonce command.
- NONCE_
TARGET_ 🔒MSGDIGBUF param1bit 6 set selectsMsgDigBufas the passthrough target.- NONCE_
TARGET_ 🔒TEMPKEY param1bit 6 cleared selectsTempKeyas the passthrough target.