Expand description
Read and Write commands.
These access the config, data, or OTP zones. They support 4-byte and
32-byte transfers. Writes to the data zone are subject to the per-slot
SlotConfig.WriteConfig rules captured in crates/hsm-crypto-service.
§Address encoding
The ATECC608B encodes the target of a Read or Write into the 16-bit
param2 of the command frame. The format depends on the zone.
-
Config zone. The zone is 128 bytes laid out as 4 blocks of 32 bytes. Each block is addressable as 8 “words” of 4 bytes.
bits 0..=2 : offset within block (word index, 0..=7). bits 3..=4 : block index (0..=3). bits 5..=15 : reserved (zero). -
OTP zone. Same layout as the config zone but only 2 blocks of 32 bytes (block index in 0..=1).
-
Data zone. One slot per row.
bits 0..=2 : offset within block (word index). bits 3..=7 : slot index (0..=15). bits 8..=15 : block index.
In 32-byte transfers the offset bits must be zero, the chip rejects the command otherwise.
§param1 encoding
param1 carries the zone identifier in its low two bits, an optional
encryption flag, and a single “this is a 32-byte transfer” flag.
bits 0..=1 : zone (0 = Config, 1 = OTP, 2 = Data).
bit 6 : 1 -> data field is encrypted with TempKey + MAC (Write only).
bit 7 : 1 -> 32-byte transfer, 0 -> 4-byte transfer.Reference: CryptoAuthLib lib/calib/calib_read.c and
lib/calib/calib_write.c, constants ATCA_ZONE_CONFIG, ATCA_ZONE_OTP,
ATCA_ZONE_DATA, ATCA_ZONE_READWRITE_32, ATCA_ZONE_ENCRYPTED.
Enums§
- Zone
- One of the three addressable zones of the ATECC608B.
Constants§
- BLOCK_
SIZE - Size of one block transferred in a 32-byte read or write.
- CONFIG_
ZONE_ 🔒BLOCK_ COUNT - Number of 32-byte blocks in the config zone (128 / 32 = 4).
- CONFIG_
ZONE_ 🔒SIZE - Size of the config zone in bytes.
- ENCRYPTED_
WRITE_ DATA_ SIZE - Total size of the data field for an encrypted 32-byte write: 32 bytes of ciphertext followed by 32 bytes of MAC.
- ENCRYPTED_
WRITE_ 🔒MAC_ SIZE - Size of the MAC appended to an encrypted 32-byte write.
- PARA
M1_ 🔒FLAG_ 32_ BYTES - Flag OR’d into
param1to switch from a 4-byte to a 32-byte transfer. - PARA
M1_ 🔒FLAG_ ENCRYPTED - Flag OR’d into
param1to indicate the data field is encrypted withTempKeyand is followed by a MAC. Only valid for 32-byte Writes. - WORD_
SIZE - Size of one word transferred in a 4-byte read or write.
Functions§
- config_
or_ otp_ address - Build the
param2address for a config or OTP zone access. - data_
address - Build the
param2address for a data zone access. - read_
param1 🔒 - Compose the
param1byte for a Read. - write_
param1 🔒 - Compose the
param1byte for a Write.