Skip to main content

SIGN_MODE_EXTERNAL_FROM_MSGDIGBUF

Constant SIGN_MODE_EXTERNAL_FROM_MSGDIGBUF 

Source
const SIGN_MODE_EXTERNAL_FROM_MSGDIGBUF: u8 = 0xA0;
Expand description

param1 mode bits for Sign(external) on the ATECC608.

Combines two sub-flags:

  • bit 7 (0x80) — SIGN_MODE_EXTERNAL: the message-to-sign is a 32-byte digest supplied by the host, not an internal chip state.
  • bit 5 (0x20) — SIGN_MODE_SOURCE_MSGDIGBUF: take the digest from the Message Digest Buffer (the 608’s dedicated 32-byte register), as opposed to TempKey.

The 608’s Sign(external) strictly requires the MsgDigBuf source. Sending 0x80 alone (no source bit) on a 608 makes the chip include extra context bytes — serial number, OTP, etc. — in what it actually signs, so the resulting signature does NOT verify against the raw digest off-chip. Reference: lib/calib/calib_sign.c::calib_sign in CryptoAuthLib, which selects this mode for ATECC608. The legacy 0x80-only encoding still works on the older ATECC108A / ATECC508A.

Callers must load the digest via AteccChannel::nonce_passthrough with target crate::command::nonce::NonceTarget::MsgDigBuf immediately before this command.