5.2.3.1 Sign - Internal Message

The Sign command in the Internal Message mode is used to sign a message that was internally generated. The command calculates the internal message digest and then signs the digest using the ECDSA sign algorithm with the private ECC key specified in KeyID. Internally generated messages must always reside in TempKey. The value in TempKey must be generated using either the GenDig or the GenKey command. If TempKey is not valid an error will occur. Typical uses include:
  • Signing an internally generated random key. This is typically generated by the GenKey command.
  • The output of a GenKey or GenDig commands, provided the output is located in TempKey.

For the ATECC608A-TNGTLS device, only Slot 1 is capable of signing internally generated messages.

Table 5-48. Input Parameters - Sign Internal Message

Opcode
(1 Byte)

Mode
(1 Byte)

KeyId
(2 Bytes)

Description
0x410x00 or 0x200x00 0[Slot]Serial number is not included in the message digest calculation
0x40 or 0x600x00 0[Slot]Serial number is included in the message digest calculation
Table 5-49. Output Response - Sign Internal Message
NameSizeDescription
Response1 byteError code if the command fails
64 bytesThe signature composed of R and S values

Internal Message Generation

The internal message is generated based on a 55 Byte Field as shown below.

Byte CountSerial Number Not IncludedSerial Number Included

32 bytes
1 byte
1 byte
2 bytes
2 bytes
2 bytes
1 byte
2 bytes
1 byte
4 bytes
2 bytes
2 bytes
1 byte
1 byte
1 byte

TempKey(1)
Opcode
Mode
KeyID
SlotConfig (of TempKeyFlags.KeyID)
KeyConfig (of TempKeyFlags.KeyID)
TempKeyFlags(2)
Zeros
SN[8] = 0x01
Zeros
SN[0:1] = 0x01 0x23
Zeros
SlotLocked:TempKeyFlags.KeyID
0x00
0x00

TempKey(1)
Opcode
Mode
KeyID
SlotConfig (of TempKeyFlags.KeyID)
KeyConfig (of TempKeyFlags.KeyID)
TempKeyFlags(2)
Zeros
SN[8] = 0x01
SN[4:7]
SN[0:1] = 0x01 0x23
SN[2:3]
SlotLocked:TempKeyFlags.KeyID
0x00
0x00

Note:
  1. TempKey must be generated by GenKey or GenDig commands prior to this calculation.
  2. TempKeyFlags Consists of: (b[7]: NoMacFlag, b[6]: GenKeyData, b[5]: GenDigData, b[4]: SourceFlag,b[3:0] TempKeyFlags)