ATSHA204A
Security Commands
Note: If the source and target keys are the same, there is a risk of permanent loss of the key value if
power is interrupted during the Write operation. If the configuration bits permit it, then the key slot may be
recovered using an authenticated and encrypted write based upon the parent key.
Table 8-11. Input Parameters
Name
Size Notes
Opcode DeriveKey 1 0x1C
Param1 Random
Bits 7-3: Must be zero.
1
Bit 2:
The value of this bit must match the value in TempKey.SourceFlag or the
command returns an error.
Bits 1-0: Must be zero.
Param2 TargetKey 2 Key slot to be written.
Data Mac
0 or 32 Optional MAC used to validate operation.
Table 8-12. Output parameter
Name
Size Notes
Success
1 Upon successful completion, the ATSHA204A returns a value of zero.
The key written to the target slot is the result of a SHA-256 of the following message:
32 bytes
1 byte
1 byte
2 bytes
1 byte
2 bytes
25 bytes
32 bytes
Target or parent key (depending on SlotConfig Bit12)
Opcode
Param1
Param2
SN<8>
SN<0:1>
Zeros
TempKey.value
The data flow for this command is shown graphically in the figure below:
© 2018 Microchip Technology Inc.
DS40002025A-page 50