ATSHA204A
Security Commands
Zone
OTP
Legal Block/Slot
(Inclusive)
Notes
Words above 10 (block 2, offset 0) read and write must be in Word (4-byte) mode.
Words below 04 (block 0, offset 4) and above 15 (block 2, offset 5) can never be
written.
0–1
When OTPmode is read-only, all offsets in both blocks are available to use with 4-byte
and 32-byte reads.
If OTPmode is consumption, then writes are also permitted to all offsets.
See Section One Time Programmable (OTP) Zone if OTPmode is Legacy.
8.5.5
CheckMac Command
The CheckMac command calculates a MAC response that had been generated on a
CryptoAuthentication device and compares the MAC response with some input value. It returns a
Boolean result to indicate the success or failure of the comparison.
Prior to running this command, the Nonce and/or GenDig commands may have been optionally run to
create and load a key or nonce value in TempKey. The mode parameter determines the source of the
“key” (the first 32-bytes of the SHA message) and “challenge/nonce” (the second-32 bytes of the SHA
message).
Mode<2> controls the requirement for a random nonce if TempKey is part of the computed value. If
Mode<2> = 1, then TempKey must be generated using Nonce(Fixed); if Mode<2> = 0, then TempKey
must be generated using Nonce(Random).
Setting Mode<2> to one may enable replay attacks in some situations.
If the comparison matches, then the target slot value may be copied into TempKey. If SlotID is even, then
the target slot is SlotD+1, or else the target slot is SlotID. For the copy to take place, the following
conditions must be true. If they are not all true, then the ATSHA204A returns the comparison result but
doesn't copy the key value.
1. The mode parameter to CheckMac must have a value of 0x01 or 0x05.
2. SlotConfig.ReadKey for the target key must be zero.
3. The bit in Config.CheckMacSource corresponding to the key slots must have a value that matches
Mode<2>.
Table 8-8. Input parameters
Name
Size Notes
Opcode CheckMac 1 0x28
Param1 Mode
Bits 7-6: Must be zero.
8-bytes of SHA message.
Bit 5: 0: zeros
1
1: OTP zone
Bit 4-3: Must be zero.
Bit 2: If TempKey is used, this bit must match the value of TempKey.SourceFlag.
Bit 1: Source of the first 32-bytes of the SHA message.
© 2018 Microchip Technology Inc.
DS40002025A-page 47