Skip to main content

Module opcodes

Module opcodes 

Source
Expand description

Numeric constants of the ATECC608B protocol.

Every byte value, command opcode, max execution time, polling parameter, and packet size lives here. The rest of the driver imports symbols by name and never uses magic numbers.

Source of truth: Microchip CryptoAuthLib (lib/calib/calib_command.h and lib/calib/calib_execution.c). Cross-references to the public summary datasheet (DS40002239A) are included in comments where they exist.

ConstantsΒ§

COMMAND_FRAME_OVERHEAD πŸ”’
Number of bytes a command frame contains besides its data payload.
EXEC_TIME_CHECKMAC_MS πŸ”’
Nominal execution time of CheckMac, in milliseconds.
EXEC_TIME_COUNTER_MS πŸ”’
Nominal execution time of Counter, in milliseconds.
EXEC_TIME_GENDIG_MS πŸ”’
Nominal execution time of GenDig, in milliseconds.
EXEC_TIME_GENKEY_MS πŸ”’
Nominal execution time of GenKey, in milliseconds.
EXEC_TIME_INFO_MS πŸ”’
Nominal execution time of Info, in milliseconds.
EXEC_TIME_LOCK_MS πŸ”’
Nominal execution time of Lock, in milliseconds.
EXEC_TIME_NONCE_MS πŸ”’
Nominal execution time of Nonce, in milliseconds.
EXEC_TIME_PRIVWRITE_MS πŸ”’
Nominal execution time of PrivWrite, in milliseconds.
EXEC_TIME_RANDOM_MS πŸ”’
Nominal execution time of Random, in milliseconds.
EXEC_TIME_READ_MS πŸ”’
Nominal execution time of Read, in milliseconds.
EXEC_TIME_SIGN_MS πŸ”’
Nominal execution time of Sign, in milliseconds.
EXEC_TIME_VERIFY_MS πŸ”’
Nominal execution time of Verify, in milliseconds.
EXEC_TIME_WRITE_MS πŸ”’
Nominal execution time of Write, in milliseconds.
I2C_ADDRESS πŸ”’
Factory default 7-bit I2C address of an ATECC608B-SSHDA. Programmable via the ChipMode.I2C_Address byte of the config zone, but never changed in this project.
MAX_COMMAND_DATA_LEN πŸ”’
Maximum size of the data field of a command, equal to MAX_PACKET_SIZE - 1 (word addr) - COMMAND_FRAME_OVERHEAD = 155.
MAX_PACKET_SIZE πŸ”’
Maximum size of a command packet sent to the chip, including the word address byte prepended at the I2C level.
MAX_RESPONSE_SIZE πŸ”’
Maximum size of a response read from the chip.
OP_CHECKMAC πŸ”’
CheckMac - verify a precomputed MAC against a stored secret.
OP_COUNTER πŸ”’
Counter - read or increment the monotonic counters.
OP_GENDIG πŸ”’
GenDig - derive a digest into TempKey for use with Write encrypted.
OP_GENKEY πŸ”’
GenKey - generate a P-256 key pair in a slot, or compute a public key.
OP_INFO πŸ”’
Info - retrieve revision / status / KeyValid.
OP_LOCK πŸ”’
Lock - irreversibly lock a zone or a slot.
OP_NONCE πŸ”’
Nonce - load TempKey or MsgDigBuf for subsequent commands.
OP_PRIVWRITE πŸ”’
PrivWrite- encrypted write of a P-256 private key into a slot.
OP_RANDOM πŸ”’
Random - produce 32 cryptographically random bytes.
OP_READ πŸ”’
Read - read 4 or 32 bytes from config / data / OTP.
OP_SIGN πŸ”’
Sign - produce an ECDSA P-256 signature.
OP_VERIFY πŸ”’
Verify - verify an ECDSA P-256 signature.
OP_WRITE πŸ”’
Write - write 4 or 32 bytes to config / data / OTP.
POLLING_MAX_MS πŸ”’
Upper bound on the total polling window before crate::AteccError::Timeout.
POLLING_PERIOD_MS πŸ”’
Time the driver waits between two consecutive response reads.
WAKE_DELAY_US
Time to wait after the wake pulse before the first I2C transaction.
WAKE_LOW_DURATION_US
Minimum duration SDA must be held low to wake the chip (datasheet tWLO).
WAKE_RESPONSE_OK πŸ”’
Bytes returned by the chip after a successful wake.
WAKE_RESPONSE_SELFTEST_FAIL πŸ”’
Bytes returned if the chip’s self-test failed at wake.
WORD_ADDRESS_COMMAND πŸ”’
Word address sent before every command packet.
WORD_ADDRESS_IDLE πŸ”’
Word address that puts the chip in idle (keeps TempKey, drops the watchdog).
WORD_ADDRESS_SLEEP πŸ”’
Word address that puts the chip into deep sleep (clears volatile state).