Changes to Runtime Specification

Comparing version 2.0 to 1.3
+2103 additions -675 deletions
@@ -1,10 +1,33 @@
11 <div style="font-size: 0.85em; color: #656d76; margin-bottom: 1em; padding: 0.5em; background: #f6f8fa; border-radius: 4px;">
2-📄 Source: <a href="https://github.com/chipsalliance/caliptra-sw/blob/c3924fc178c527502536846733ef8c653cfd6e54/runtime/README.md" target="_blank">chipsalliance/caliptra-sw/runtime/README.md</a> @ <code>c3924fc</code>
2+📄 Source: <a href="https://github.com/chipsalliance/caliptra-sw/blob/4a9c80c4d577ebf6a7d105796b13437aae08013f/runtime/README.md" target="_blank">chipsalliance/caliptra-sw/runtime/README.md</a> @ <code>4a9c80c</code>
33 </div>
44
5-# Caliptra Runtime Firmware v1.2
5+# Caliptra Runtime Firmware v2.0.1
6+
7+*Spec version: 0.3*
68
79 This specification describes the Caliptra Runtime Firmware.
10+
11+## Changelog
12+
13+v1.1:
14+
15+* [LMS Signature Verification](#lms_signature_verify-new-in-11)
16+
17+v1.2:
18+
19+* [Manifest-Based Image Authorization](#manifest-based-image-authorization-new-in-12)
20+
21+v2.0:
22+
23+* Add support for passive mode (same as 1.x) and subsystem (or active) mode
24+* [MCU Runtime loading](#boot-and-initialization) (subsystem mode)
25+* [Cryptographic mailbox commands](#cryptographic-mailbox-commands-new-in-20)
26+* `ECDSA384_SIGNATURE_VERIFY` and `LMS_SIGNATURE_VERIFY` require the hash to be included in the message, as the SHA accelerator registers are no longer accessible outside Caliptra. These commands return a non-approved FIPS status because the caller supplies the digest.
27+
28+## Spec Opens
29+
30+* Cryptographic Mailbox: ML-KEM support
831
932 ## Runtime Firmware environment
1033
@@ -16,11 +39,11 @@
1639
1740 * Initialize the [DICE Protection Environment (DPE)](#dice-protection-environment-dpe)
1841 * Initialize any SRAM structures used by Runtime Firmware
42+* Upload the firmware to the Manufacturer Control Unit (2.0, subsystem mode only)
1943
2044 For behavior during other types of reset, see [Runtime firmware updates](#runtime-firmware-updates).
2145
22-If Runtime Firmware detects that Caliptra was reset during the execution of an operation, Runtime Firmware calls `DISABLE_ATTESTATION` because the internal state of Caliptra may
23-be corrupted.
46+If Runtime Firmware detects that Caliptra was reset during the execution of an operation, Runtime Firmware calls `DISABLE_ATTESTATION` because the internal state of Caliptra may be corrupted.
2447
2548 ### Main loop
2649
@@ -36,6 +59,14 @@
3659
3760 Callers must wait until Caliptra is no longer busy to call a mailbox command.
3861
62+### Command watchdog
63+
64+On debug-locked devices, Runtime starts WDT1 before processing each mailbox
65+command with a timeout of `max(20_000_000, CPTRA_WDT_CFG)` cycles. The complete
66+64-bit configuration is honored; smaller values retain the 20-million-cycle
67+minimum. Runtime stops the watchdog after command processing and while idle.
68+Debug-unlocked devices keep the watchdog disabled. ROM watchdog policy is unchanged.
69+
3970 ### Fault handling
4071
4172 A mailbox command can fail to complete in the following ways:
@@ -62,7 +93,102 @@
6293 possible; however, it will have its own copies of all of these drivers linked into
6394 the Runtime Firmware binary.
6495
65-## Manifest-Based Image Authorization (new in 1.2)
96+## Cryptographic Mailbox Commands (new in 2.0)
97+
98+Cryptographic mailbox (CM) commands are a flexible set of mailbox commands that provide access to Caliptra's cryptographic cabilities.
99+This is meant for offloaded key storage and use, supporting protocols like SPDM and OCP LOCK.
100+
101+These commands are not meant to be high-performance as they are accessed via mailbox commands.
102+
103+CM itself does not provide any storage for the keys: when generated, they are returned to the caller in encrypted form, and must be passed back to be used.
104+
105+These mailbox commands provide SHA, HMAC, HKDF, AES, RNG, MLDSA, and ECDSA services.
106+
107+Note that while MLDSA and ECDSA keys can be imported, generated, and used in the cryptographic mailbox commands (i.e., `CM_*` commands) through CMKs, these keys are *NOT* tied DICE or DPE, so their use may be restricted for certain purposes.
108+
109+MLDSA and ECDSA keys managed by DPE use the separate `ECDSA384_SIGNATURE_VERIFY`, `LMS_SIGNATURE_VERIFY`, and `MLDSA87_SIGNATURE_VERIFY` mailbox commands, which do not use the cryptographic mailbox system and are not managed by CMKs.
110+
111+
112+### References
113+
114+* [SPDM 1.3.1 (DSP0274)](https://www.dmtf.org/sites/default/files/standards/documents/DSP0274_1.3.1.pdf), dated 2024-07-01.
115+* [OCP Attestation v1.1](https://docs.google.com/document/d/1wA0hbJdtCpcQ1NvsVsYr2IeCkwQbgC7e/edit)
116+* [RFC 5869 (HKDF)](https://www.rfc-editor.org/rfc/rfc5869.html)
117+* [RFC 8446](https://datatracker.ietf.org/doc/html/rfc8446) Section 7.4.2 & IEEE 1363 (TLS ECDH secret derivation)
118+
119+### Contexts
120+
121+Several of the methods, such as SHA and AES, support contexts so that multiple users can have in-flight requests at the same time.
122+
123+The contexts contain the internal structures necessary to resume operations to support data that may exceed the size of a single mailbox command.
124+
125+These contexts are intended to be opaque to the user, and SHALL be encrypted and authenticated if they contain sensitive internal data.
126+
127+Runtime decrypts AES, AES-GCM, and ECDH contexts into temporary plaintext buffers guarded by `Zeroizing`. These guards wipe the buffers when the decryption helper returns, including on authentication failure.
128+
129+This cleanup does not change mailbox formats or command results. It covers only the temporary decryption buffers, not returned working contexts or other copies, and requires normal scope exit; it does not guarantee cleanup on an abort or reset.
130+
131+### Keys
132+
133+Cryptographic Mailbox Key (CMKs) are used to store keys. Certain commands generate and return a new CMK. Most commands that use CMKs will also return a new CMK, as it is necessary to track CMKs so that they are not used beyond any relevant limits for their key type.
134+
135+They are returned from commands that generate keys and must be passed back to Caliptra to be used. These keys are encrypted and opaque to the mailbox caller.
136+
137+Internally, the unecrypted CMKs have the following structure:
138+
139+| **Name** | **Bits** | **Description** |
140+| ------------- | -------- | -------------------------------------- |
141+| version | 8 | CMK version. Currently always 1. |
142+| flags | 8 | Bit 0 = FIPS valid |
143+| length | 16 | how many bits of key material are used |
144+| key usage | 8 | represents which kind of key this is |
145+| id | 24 | ID number |
146+| usage counter | 64 | how many times this key has been used |
147+||| This MAY only be tracked for AES keys |
148+| key material | 512 | bits used for the key material |
149+
150+
151+The encrypted CMKs have the structure:
152+
153+| **Name** | **Bits** | **Description** |
154+| --------------- | -------- | ------------------------------ |
155+| domain | 32 | reserved |
156+| domain metadata | 128 | reserved |
157+| iv | 96 ||
158+| ciphertext | 640 | encrypted CMK data (see above) |
159+| GCM tag | 128 ||
160+
161+
162+The total size of the CMK is therefore 128 bytes.
163+
164+Only the encrypted CMKs will appear in mailbox messages.
165+
166+The key used to encrypt the CMKs is randomized on reset, which means that CMKs cannot be used between resets.
167+The IV is a randomized 1-up counter that is incremented for every key created.
168+
169+#### Key Usage
170+
171+The internal CMK structure and several commands use a key usage tag to specify how a key can be used:
172+
173+| **Value** | **Usage** |
174+| --------- | --------- |
175+| 0 | Reserved |
176+| 1 | HMAC |
177+| 2 | HKDF |
178+| 3 | AES |
179+
180+
181+#### Replay Prevention and Deletion
182+
183+To prevent replay attacks, Caliptra will have a small table that maps a CMK's internal ID to its last known usage counters.
184+Whenever a CMK is used, this table is checked and updated.
185+
186+This is necessary for AES-256-GCM in particular to ensure that keys are only used a certain number of times, as per [NIST SP 800-38D, Section 8.3](https://doi.org/10.6028/NIST.SP.800-38D).
187+Only AES-256-GCM keys need to be tracked in this table, but other keys MAY be tracked as well.
188+
189+This requires 96 bits of storage per AES-256-GCM key. These can stored as a sorted list in the DCCM.
190+
191+## Manifest-Based Image Authorization
66192
67193 Caliptra's goal is to enable integrators to meet standard security requirements for creating cryptographic identity and securely reporting measurements through DICE and DPE Certificate chains and Caliptra-owned private-public key pairs. In addition, Caliptra 1.0 provides an `ECDSA384_SIGNATURE_VERIFY` command to enable an SoC RoT to verify its own FW signatures so that it can develop an SoC secure boot using Caliptra cryptography. Caliptra 1.1 expanded the verify command to a PQC-safe `LMS_SIGNATURE_VERIFY` command. In each of these cases, it is left up to the vendor to ensure that they build a secure environment for introducing and verifying FW integrity and authenticity and then executing mutable FW.
68194
@@ -73,7 +199,7 @@
73199
74200 Each of these abilities are tied to Caliptra Vendor and Owner FW signing keys and should be independent of any SoC RoT FW signing keys.
75201
76-Manifest-based image authorization is implemented via two mailbox commands: [`SET_AUTH_MANIFEST`](#set-auth-manifest) and [`AUTHORIZE_AND_STASH`](#authorize-and-stash). For image format of the manifest, please refer [this file](https://github.com/chipsalliance/caliptra-sw/blob/c3924fc178c527502536846733ef8c653cfd6e54/auth-manifest/README.md).
202+Manifest-based image authorization is implemented via three mailbox commands: [`SET_AUTH_MANIFEST`](#set-auth-manifest), [`SET_OWNER_AUTH_MANIFEST`](#set-owner-auth-manifest), and [`AUTHORIZE_AND_STASH`](#authorize-and-stash). A firmware ID identifies one platform firmware image and must be unique across the active vendor + owner and owner-only Image Metadata Collections. Both set commands reject a manifest containing an ID in the other active collection. Mailbox commands that look up a firmware ID select exactly one collection through bits `[2:1]` of their `flags` argument.
77203
78204 ### Caliptra-Endorsed Aggregated Measured Boot
79205
@@ -85,7 +211,7 @@
85211
86212 The Caliptra-Endorsed Local Verifier could be required by the owner only or both the vendor and the owner.
87213
88-The main difference between Caliptra-Endorsed Aggregated Measured Boot and Caliptra-Endorsed Local Verifier is whether the SoC RoT is relying on the Measurement Manifest for SoC Secure Boot services as opposed to using it as an additional verification.
214+The main difference between Caliptra-Endorsed Aggregated Measured Boot and Caliptra-Endorsed Local Verifier is if the SoC RoT is relying on the Measurement Manifest for SoC Secure Boot services as opposed as using it as an additional verification.
89215
90216 ### SoC RoT Enforcement of Measurement Manifest
91217
@@ -97,28 +223,30 @@
97223
98224 ### Unique Measurement Manifest Signing Keys
99225
100-In order to reduce usage of the Caliptra FW Signing keys, the measurement manifest will be signed by new key pairs: one for the owner and optionally one for the vendor. These new key pairs are endorsed once by the Caliptra FW signing keys, the signature being in the Measurement Manifest, thus allowing the measurement manifest keys to be used independently of the Caliptra FW signing keys.
226+In order to reduce usage of the Caliptra FW Signing keys, the measurement manifest will be signed by new key pairs: one for the owner and possibly one for the vendor. These new key pairs are endorsed once using a single signature within the Measurement Manifest, thus allowing the measurement manifest keys to be used independently of the Caliptra FW signing keys.
101227
102228 ### Caliptra Measurement Manifest Vendor Public Key Authenticity
103229
104230 The Measurement Manifest MUST have an endorsement by the Caliptra Vendor Public Key. In order to fulfill this requirement, the Vendor has 2 options:
105231
106-* Vendor signing of `Image Metadata Collection` required: The Vendor creates a new Measurement keypair which will sign the measurement manifest and endorses this new public key with the Caliptra FW Vendor Private Key. The signature covers both the new public key as well as the flags field which indicates that the new Measurement Key Pair will be enforced.
107-* Vendor signing of `Image Metadata Collection` **not** required: Vendor leaves the Vendor public key as all zeros, and clears the flag which enforces vendor signing and then endorses these fields with a signature in the Measurement Manifest. In this case, the Vendor releases ownership of enforcing any specific FW in execution.
232+* Vendor signing required: The Vendor creates a new Measurement keypair which will sign the measurement manifest and endorses the new public key with the Caliptra FW Vendor Private Key. The signature covers both the new public key as well as the flags field which indicates that the new Measurement Key Pair will be enforced.
233+* Vendor signing **not** required: Vendor leaves the Vendor public key as all zeros, and clears the flag which enforces vendor signing and then endorses these fields with a signature in the Measurement Manifest. In this case, the Vendor releases ownership of enforcing any specific FW in execution.
108234
109235 ### Caliptra Measurement Manifest Owner Public Key Authenticity
110236
111237 Caliptra will always verify the endorsement of the Measurement Manifest Owner Public key and require that it signed the measurement manifest.
112238
113-This feature is accomplished by having the SoC send a manifest to Caliptra Runtime through the `SET_AUTH_MANIFEST` mailbox command. The manifest will include a set of hashes for the different SoC images. Later, the SOC will ask for authorization for its images from the Caliptra Runtime through the `AUTHORIZE_AND_STASH` new mailbox command. Caliptra Runtime will authorize the image based on whether its hash was contained in the manifest.
239+This feature is accomplished by having the SoC send a manifest to Caliptra Runtime through the `SET_AUTH_MANIFEST` mailbox command. The manifest will include a set of hashes for the different SoC images. Later, the SOC will ask for authorization for its images from the Caliptra Runtime through the `AUTHORIZE_AND_STASH` new mailbox commands. Caliptra Runtime will authorize the image based on whether its hash was contained in the manifest.
114240
115241 #### Preamble
116242
117-The manifest begins with the Preamble section, which contains new manifest ECC and LMS public keys of the vendor and the owner. These public keys correspond to the private keys that sign the Image Metadata Collection (IMC) section. These signatures are included in the Preamble. The Caliptra firmware's private keys endorse the manifest's public keys and these endorsements (i.e., signatures) are part of the Preamble as well.
243+The manifest begins with the Preamble section, which contains new manifest ECC and either MLDSA or LMS public keys of the vendor and the owner. These public keys correspond to the private keys that sign the Image Metadata Collection (IMC) section. These signatures are included in the Preamble. The Caliptra firmware's private keys endorse the manifest's public keys and these endorsements (i.e., signatures) are part of the Preamble as well.
118244
119245 #### Image Metadata Collection (IMC)
120246
121247 The IMC is a collection of Image Metadata entries (IME). Each IME has a hash that matches one of the multiple SoC images. The manifest vendor and owner private keys sign the IMC. The Preamble holds the IMC signatures. The manifest IMC vendor signatures are optional and are validated only if the Flags field Bit 0 is set to 1. Up to 127 image hashes will be supported.
248+
249+An authorization manifest may set the vendor-signed `DEBUG_IMAGE` flag to identify a vendor-authorized debug manifest. `DEBUG_IMAGE` requires `VENDOR_SIGNATURE_REQUIRED`, subsystem mode, asserted `SS_DEBUG_INTENT`, and clear `SS_STRAP_GENERIC[3][31]` (`DISABLE_VENDOR_DEBUG_IMAGES`). Runtime evaluates this policy only after authenticating the firmware-vendor-signed preamble fields. Existing owner endorsement and IMC signature verification remain required.
122250
123251 #### Caliptra Measurement Manifest Keys Endorsement Verification Steps
124252
@@ -133,6 +261,10 @@
133261 * If the owner endorsement is invalid, the `SET_AUTH_MANIFEST` command will be rejected.
134262 * Otherwise, the owner public key will be trusted and Caliptra will use it to verify the overall measurement manifest.
135263
264+#### Measurement Manifest Version Number
265+
266+A Measurement Manifest VN is used to ensure that some enforcement is possible if a progression of measurements is required. 32 bits of the existing unused `IDEVID_MANUF_IDENTIFIER` fuse (128 bits) can be repurposed for this. This can be accomplished by updating Caliptra's main specification to redefine the fuse definition and its usage from "Programming time" to "Field Programmable".
267+
136268 ### Image Authorization Sequence
137269
138270 The diagram below illustrates how this feature is part of the Caliptra boot flow, and the order of operations needed to use the feature.
@@ -143,7 +275,7 @@
143275 FMC->>Runtime: Launch RT
144276 Runtime->>SOC: RDY_FOR_RT
145277 Note over Runtime,SOC: Manifest Load
146- SOC->>Runtime: SET_AUTH_MANIFEST
278+ SOC->>Runtime: SET_MANIFEST
147279 Runtime-->>SOC: Success/Failure
148280 Note over Runtime,SOC: Image Authorization
149281 loop n times
@@ -161,14 +293,19 @@
161293
162294 *Table: Mailbox command result codes*
163295
164-| **Name** | **Value** | Description
165-| ------- | ----- | -----------
166-| `SUCCESS` | `0x0000_0000` | Mailbox command succeeded
167-| `BAD_VENDOR_SIG` | `0x5653_4947` ("VSIG") | Vendor signature check failed
168-| `BAD_OWNER_SIG` | `0x4F53_4947` ("OSIG") | Owner signature check failed
169-| `BAD_SIG` | `0x4253_4947` ("BSIG") | Generic signature check failure (for crypto offload)
170-| `BAD_IMAGE` | `0x4249_4D47` ("BIMG") | Malformed input image
171-| `BAD_CHKSUM` | `0x4243_484B` ("BCHK") | Checksum check failed on input arguments
296+| **Name** | **Value** | Description |
297+| ---------------- | ---------------------- | ---------------------------------------------------- |
298+| `SUCCESS` | `0x0000_0000` | Mailbox command succeeded |
299+| `BAD_VENDOR_SIG` | `0x5653_4947` ("VSIG") | Vendor signature check failed |
300+| `BAD_OWNER_SIG` | `0x4F53_4947` ("OSIG") | Owner signature check failed |
301+| `BAD_SIG` | `0x4253_4947` ("BSIG") | Generic signature check failure (for crypto offload) |
302+| `BAD_IMAGE` | `0x4249_4D47` ("BIMG") | Malformed input image |
303+| `BAD_CHKSUM` | `0x4243_484B` ("BCHK") | Checksum check failed on input arguments |
304+| `CME_BAD_CMK` | `0x434D_424B` ("CMBK") | Invalid CMK |
305+| `CME_CMK_OFLW` | `0x434D_424F` ("CMBO") | CMK has been used too many times |
306+| `CME_BAD_CTXT` | `0x434D_4243` ("CMBC") | Bad context |
307+| `CME_FULL` | `0x434D_4546` ("CMEF") | Too many Cryptographic Mailbox usage counters in use |
308+
172309
173310 Relevant registers:
174311
@@ -177,116 +314,60 @@
177314 * CPTRA\_FW\_ERROR\_NON\_FATAL: Status code of mailbox command. Any result
178315 other than `SUCCESS` signifies a mailbox command failure.
179316
180-### Mailbox command privilege levels
181-
182-Mailbox commands maintain the PL information of their caller and can allow or
183-disallow clients from invoking a call based on their PL level. Callers are
184-classified as PL0 or PL1 by comparing the mailbox PAUSER against the `pl0_pauser`
185-field of the signed firmware image header; see [PAUSER privilege levels](#pauser-privilege-levels).
186-
187-A command marked `PL0` is rejected outright for PL1 callers. A command marked
188-`PL0 or PL1` is available to every caller. `INVOKE_DPE_COMMAND` and
189-`INVOKE_DPE_MLDSA87` are available to both levels, but restrict a subset of the
190-DPE commands they carry to PL0.
191-
192-If the PL0 PAUSER flag is not set in the firmware image header, no caller is
193-PL0, so every PL0 command is unavailable for that firmware image. Independently
194-of privilege level, commands from the reserved PAUSER are rejected outright.
195-
196-Privilege level is not the only caller-dependent restriction. Commands that
197-operate on DPE contexts are also scoped by locality, and PAUSER maps 1:1 to
198-locality, so a caller can generally only reach the contexts it created. The
199-`PL0-only functionality` column below calls out where that matters.
200-
201-*Table: Mailbox command privilege levels*
202-
203-| **Command** | **Privilege Level** | **PL0-only functionality**
204-| ----------- | ------------------- | --------------------------
205-| `CALIPTRA_FW_LOAD` | PL0 or PL1 |
206-| `CAPABILITIES` | PL0 or PL1 |
207-| `GET_IDEV_CERT` | PL0 or PL1 |
208-
209-| `POPULATE_IDEV_CERT` | PL0 | Entire command
210-| `GET_IDEV_INFO` | PL0 or PL1 |
211-| `GET_LDEV_CERT` | PL0 or PL1 |
212-| `GET_FMC_ALIAS_CERT` | PL0 or PL1 |
213-| `GET_RT_ALIAS_CERT` | PL0 or PL1 |
214-| `ECDSA384_SIGNATURE_VERIFY` | PL0 or PL1 |
215-| `LMS_SIGNATURE_VERIFY` | PL0 or PL1 |
216-| `MLDSA87_SIGNATURE_VERIFY` | PL0 or PL1 |
217-
218-| `STASH_MEASUREMENT` | PL0 | Entire command
219-| `DISABLE_ATTESTATION` | PL0 | Entire command
220-| `INVOKE_DPE_COMMAND` | PL0 or PL1 | `CertifyKey` with `format=X509`; `DeriveContext` with the `export-cdi` flag; `DeriveContext` with `change-locality` targeting the PL0 PAUSER
221-| `QUOTE_PCRS` | PL0 or PL1 |
222-| `EXTEND_PCR` | PL0 or PL1 |
223-| `GET_PCR_LOG` | PL0 or PL1 |
224-| `INCREMENT_PCR_RESET_COUNTER` | PL0 or PL1 |
225-
226-| `DPE_TAG_TCI` | PL0 or PL1 | Tags only contexts in the caller's own locality, so PL1 cannot tag a PL0 context (and vice versa)
227-| `DPE_GET_TAGGED_TCI` | PL0 or PL1 | Looks up by tag only; either level can read any tagged TCI
228-| `FW_INFO` | PL0 or PL1 |
229-| `VERSION` | PL0 or PL1 |
230-| `SELF_TEST_START` | PL0 or PL1 |
231-| `SELF_TEST_GET_RESULTS` | PL0 or PL1 |
232-| `SHUTDOWN` | PL0 or PL1 |
233-| `ADD_SUBJECT_ALT_NAME` | PL0 or PL1 |
234-
235-| `CERTIFY_KEY_EXTENDED` | PL0 | Entire command
236-| `SET_AUTH_MANIFEST` | PL0 | Entire command
237-| `AUTHORIZE_AND_STASH` | PL0 or PL1 | Stashing the measurement. A PL1 caller must set the `SKIP_STASH` flag; otherwise an authorized image fails when the measurement is stashed into DPE
238-| `GET_IDEVID_CSR` | PL0 or PL1 |
239-| `GET_FMC_ALIAS_CSR` | PL0 or PL1 |
240-
241-| `SIGN_WITH_EXPORTED_ECDSA` | PL0 | Entire command
242-| `REVOKE_EXPORTED_CDI_HANDLE` | PL0 | Entire command
243-| `REALLOCATE_DPE_CONTEXT_LIMITS` | PL0 | Entire command
244-| `SET_PQ_SEED` | PL0 | Entire command
245-| `GET_PQ_CSR` | PL0 or PL1 |
246-| `GET_PQ_INFO` | PL0 or PL1 |
247-| `GET_ATTESTED_PQ_CSR` | PL0 or PL1 |
248-
249-| `POPULATE_PQ_CERT` | PL0 | Entire command
250-| `GET_PQ_CERT` | PL0 or PL1 |
251-
252-| `INVOKE_DPE_MLDSA87` | PL0 or PL1 | Same DPE command restrictions as `INVOKE_DPE_COMMAND`
253-| `CERTIFY_KEY_EXTENDED_MLDSA87` | PL0 | Entire command
254-| `SIGN_WITH_EXPORTED_MLDSA` | PL0 | Entire command
255-
256-### CALIPTRA\_FW\_LOAD
257-
258-The `CALIPTRA_FW_LOAD` command is handled by both ROM and Runtime Firmware.
317+Mailbox user 0xFFFF_FFFF is reserved for Caliptra internal use. All mailbox
318+commands from that user will fail.
319+
320+### FW\_LOAD
321+
322+The `FIRMWARE_LOAD` command is handled by both ROM and Runtime Firmware.
259323
260324 #### ROM behavior
261325
262-On cold boot, ROM exposes the `CALIPTRA_FW_LOAD` mailbox command to accept
326+On cold boot, ROM exposes the `FIRMWARE_LOAD` mailbox command to accept
263327 the firmware image that ROM will boot. This image includes Manifest, FMC, and Runtime
264328 firmware.
265329
266330 #### Runtime Firmware behavior
267331
268-Caliptra Runtime Firmware also exposes the `CALIPTRA_FW_LOAD` mailbox command for loading
332+Caliptra Runtime Firmware also exposes the `FIRMWARE_LOAD` mailbox command for loading
269333 impactless updates. For more information, see [Runtime Firmware updates](#runtime-firmware-updates).
270334
271335 Command Code: `0x4657_4C44` ("FWLD")
272336
273-Privilege Level: PL0 or PL1
274-
275-*Table: `CALIPTRA_FW_LOAD` input arguments*
337+*Table: `FIRMWARE_LOAD` input arguments*
276338
277339 | **Name** | **Type** | **Description**
278340 | -------- | -------- | ---------------
279341 | data | u8[...] | Firmware image to load.
280342
281-`CALIPTRA_FW_LOAD` returns no output arguments.
343+`FIRMWARE_LOAD` returns no output arguments.
344+
345+### FIRMWARE\_VERIFY
346+
347+The `FIRMWARE_VERIFY` command is used to verify a Caliptra Firmware Bundle.
348+
349+Command Code: `0x4657_5652` ("FWVR")
350+
351+*Table: `FIRMWARE_VERIFY` input arguments*
352+
353+| **Name** | **Type** | **Description**
354+| -------- | -------- | ---------------
355+| data | u8[...] | Firmware image bundle to verify.
356+
357+*Table: `FIRMWARE_VERIFY` output arguments*
358+
359+| **Name** | **Type** | **Description** |
360+| -------------- | -------------- | -------------------------------------------------------------------------- |
361+| chksum | u32 | Checksum over other output arguments, computed by Caliptra. Little endian. |
362+| fips_status | u32 | Indicates if the command is FIPS approved or an error. |
363+| verify_result | u32 | VERIFY_SUCCESS (0xDEADC0DE), VERIFY_FAILED (0x21523F21) |
364+
282365
283366 ### CAPABILITIES
284367
285368 Exposes a command to retrieve firmware capabilities
286369
287370 Command Code: `0x4341_5053` ("CAPS")
288-
289-Privilege Level: PL0 or PL1
290371
291372 *Table: `CAPABILITIES` input arguments*
292373
@@ -302,15 +383,13 @@
302383 | fips\_status | u32 | Indicates if the command is FIPS approved or an error.
303384 | capabilities | u8[16] | Firmware capabilities
304385
305-### GET\_IDEV\_CERT
306-
307-Exposes a command to reconstruct the IDEVID CERT.
386+### GET\_IDEV\_ECC384\_CERT
387+
388+Exposes a command to reconstruct the ECC384 IDEV CERT.
308389
309390 Command Code: `0x4944_4543` ("IDEC")
310391
311-Privilege Level: PL0 or PL1
312-
313-*Table: `GET_IDEV_CERT` input arguments*
392+*Table: `GET_IDEV_ECC384_CERT` input arguments*
314393
315394 | **Name** | **Type** | **Description**
316395 | -------- | -------- | ---------------
@@ -320,55 +399,98 @@
320399 | tbs\_size | u32 | Size of the TBS.
321400 | tbs | u8[916] | TBS, with a maximum size of 916. Only bytes up to tbs_size are used.
322401
323-*Table: `GET_IDEV_CERT` output arguments*
402+*Table: `GET_IDEV_ECC384_CERT` output arguments*
324403
325404 | **Name** | **Type** | **Description**
326405 | -------- | -------- | ---------------
327406 | chksum | u32 | Checksum over other output arguments, computed by Caliptra. Little endian.
328407 | fips\_status | u32 | Indicates if the command is FIPS approved or an error.
329-| cert\_size | u32 | Length in bytes of the cert field in use for the IDevId certificate.
330-| cert | u8[1024] | DER-encoded IDevID CERT.
331-
332-### POPULATE\_IDEV\_CERT
408+| cert\_size | u32 | Length in bytes of the cert field in use for the IDev ECC384 certificate.
409+| cert | u8[1024] | DER-encoded IDev ECC384 CERT.
410+
411+### GET\_IDEV\_MLDSA87\_CERT
412+
413+Exposes a command to reconstruct the MLDSA87 IDEV CERT.
414+
415+Command Code: `0x4944_4D43` ("IDMC")
416+
417+*Table: `GET_IDEV_MLDSA87_CERT` input arguments*
418+
419+| **Name** | **Type** | **Description**
420+| -------- | -------- | ---------------
421+| chksum | u32 | Checksum over other input arguments, computed by the caller. Little endian.
422+| tbs\_size | u32 | Size of the TBS.
423+| signature | u8[4628] | MLDSA87 signature bytes.
424+| tbs | u8[2820] | TBS, with a maximum size of 2820. Only bytes up to tbs_size are used.
425+
426+*Table: `GET_IDEV_MLDSA87_CERT` output arguments*
427+
428+| **Name** | **Type** | **Description**
429+| -------- | -------- | ---------------
430+| chksum | u32 | Checksum over other output arguments, computed by Caliptra. Little endian.
431+| fips\_status | u32 | Indicates if the command is FIPS approved or an error.
432+| cert\_size | u32 | Length in bytes of the cert field in use for the IDev MLDSA87 certificate.
433+| cert | u8[...] | DER-encoded IDev MLDSA87 CERT.
434+
435+### POPULATE\_IDEV\_ECC384\_CERT
333436
334437 Exposes a command that allows the SoC to provide a DER-encoded
335-IDevId certificate on every boot. The IDevId certificate is added
438+ECC384 IDev certificate on every boot. The ECC384 IDev certificate is added
336439 to the start of the certificate chain.
337440
338441 Command Code: `0x4944_4550` ("IDEP")
339442
340-Privilege Level: PL0
341-
342-*Table: `POPULATE_IDEV_CERT` input arguments*
443+*Table: `POPULATE_IDEV_ECC384_CERT` input arguments*
343444
344445 | **Name** | **Type** | **Description**
345446 | -------- | -------- | ---------------
346447 | chksum | u32 | Checksum over other input arguments, computed by the caller. Little endian.
347-| cert\_size | u32 | Size of the DER-encoded IDevId certificate.
348-| cert | u8[1024] | DER-encoded IDevID CERT.
349-
350-*Table: `POPULATE_IDEV_CERT` output arguments*
448+| cert\_size | u32 | Size of the DER-encoded ECC384 IDevId certificate.
449+| cert | u8[1024] | DER-encoded ECC384 IDev CERT.
450+
451+*Table: `POPULATE_IDEV_ECC384_CERT` output arguments*
351452
352453 | **Name** | **Type** | **Description**
353454 | -------- | -------- | ---------------
354455 | chksum | u32 | Checksum over other output arguments, computed by Caliptra. Little endian.
355456 | fips\_status | u32 | Indicates if the command is FIPS approved or an error.
356457
357-### GET\_IDEV\_INFO
358-
359-Exposes a command to get an IDEVID public key.
458+### POPULATE\_IDEV\_MLDSA87\_CERT
459+
460+Exposes a command that allows the SoC to provide a DER-encoded
461+MLDSA87 IDev certificate on every boot. The MLDSA87 IDev certificate is added
462+to the start of the certificate chain.
463+
464+Command Code: `0x4944_4D50` ("IDMP")
465+
466+*Table: `POPULATE_IDEV_MLDSA87_CERT` input arguments*
467+
468+| **Name** | **Type** | **Description**
469+| -------- | -------- | ---------------
470+| chksum | u32 | Checksum over other input arguments, computed by the caller. Little endian.
471+| cert\_size | u32 | Size of the DER-encoded MLDSA87 IDev certificate.
472+| cert | u8[8192] | DER-encoded MLDSA87 IDev CERT.
473+
474+*Table: `POPULATE_IDEV_MLDSA87_CERT` output arguments*
475+
476+| **Name** | **Type** | **Description**
477+| -------- | -------- | ---------------
478+| chksum | u32 | Checksum over other output arguments, computed by Caliptra. Little endian.
479+| fips\_status | u32 | Indicates if the command is FIPS approved or an error.
480+
481+### GET\_IDEV\_ECC384\_INFO
482+
483+Exposes a command to get the IDEVID ECC384 public key.
360484
361485 Command Code: `0x4944_4549` ("IDEI")
362486
363-Privilege Level: PL0 or PL1
364-
365-*Table: `GET_IDEV_INFO` input arguments*
487+*Table: `GET_IDEV_ECC384_INFO` input arguments*
366488
367489 | **Name** | **Type** | **Description**
368490 | -------- | -------- | ---------------
369491 | chksum | u32 | Checksum over other input arguments, computed by the caller. Little endian.
370492
371-*Table: `GET_IDEV_INFO` output arguments*
493+*Table: `GET_IDEV_ECC384_INFO` output arguments*
372494
373495 | **Name** | **Type** | **Description**
374496 | -------- | -------- | ---------------
@@ -377,86 +499,160 @@
377499 | idev\_pub\_x | u8[48] | X portion of ECDSA IDevId key.
378500 | idev\_pub\_y | u8[48] | Y portion of ECDSA IDevId key.
379501
380-### GET\_LDEV\_CERT
381-
382-Exposes a command to get an LDevID certificate signed by IDevID.
383-
384-Command Code: `0x4C44_4556` ("LDEV")
385-
386-Privilege Level: PL0 or PL1
387-
388-*Table: `GET_LDEV_CERT` input arguments*
502+### GET\_IDEV\_MLDSA87\_INFO
503+
504+Exposes a command to get the IDEVID MLDSA87 public key.
505+
506+Command Code: `0x4944_4D49` ("IDMI")
507+
508+*Table: `GET_IDEV_MLDSA87_INFO` input arguments*
389509
390510 | **Name** | **Type** | **Description**
391511 | -------- | -------- | ---------------
392512 | chksum | u32 | Checksum over other input arguments, computed by the caller. Little endian.
393513
394-*Table: `GET_LDEV_CERT` output arguments*
514+*Table: `GET_IDEV_MLDSA87_INFO` output arguments*
515+
516+| **Name** | **Type** | **Description**
517+| -------- | -------- | ---------------
518+| chksum | u32 | Checksum over other output arguments, computed by Caliptra. Little endian.
519+| fips\_status | u32 | Indicates if the command is FIPS approved or an error.
520+| idev\_pub\_key | u8[2592] | MLDSA IDevId public key.
521+
522+### GET\_LDEV\_ECC384\_CERT
523+
524+Exposes a command to get an LDevID ECC384 certificate signed by ECC384 IDevID private key.
525+
526+Command Code: `0x4C44_4556` ("LDEV")
527+
528+*Table: `GET_LDEV_ECC384_CERT` input arguments*
529+
530+| **Name** | **Type** | **Description**
531+| -------- | -------- | ---------------
532+| chksum | u32 | Checksum over other input arguments, computed by the caller. Little endian.
533+
534+*Table: `GET_LDEV_ECC384_CERT` output arguments*
395535
396536 | **Name** | **Type** | **Description**
397537 | -------- | -------- | ---------------
398538 | chksum | u32 | Checksum over other output arguments, computed by Caliptra. Little endian.
399539 | fips\_status | u32 | Indicates if the command is FIPS approved or an error.
400540 | data\_size | u32 | Length in bytes of the valid data in the data field.
401-| data | u8[...] | DER-encoded LDevID certificate.
402-
403-### GET\_FMC\_ALIAS\_CERT
404-
405-Exposes a command to get an FMC alias certificate signed by LDevID.
406-
407-Command Code: `0x4345_5246` ("CERF")
408-
409-Privilege Level: PL0 or PL1
410-
411-*Table: `GET_FMC_ALIAS_CERT` input arguments*
541+| data | u8[...] | DER-encoded ECC384 LDevID certificate.
542+
543+### GET\_LDEV\_MLDSA87\_CERT
544+
545+Exposes a command to get an LDevID MLDSA87 certificate signed by MLDSA87 IDevID private key.
546+
547+Command Code: `0x4C44_4D43` ("LDMC")
548+
549+*Table: `GET_LDEV_MLDSA87_CERT` input arguments*
412550
413551 | **Name** | **Type** | **Description**
414552 | -------- | -------- | ---------------
415553 | chksum | u32 | Checksum over other input arguments, computed by the caller. Little endian.
416554
417-*Table: `GET_FMC_ALIAS_CERT` output arguments*
555+*Table: `GET_LDEV_MLDSA87_CERT` output arguments*
418556
419557 | **Name** | **Type** | **Description**
420558 | -------- | -------- | ---------------
421559 | chksum | u32 | Checksum over other output arguments, computed by Caliptra. Little endian.
422560 | fips\_status | u32 | Indicates if the command is FIPS approved or an error.
423561 | data\_size | u32 | Length in bytes of the valid data in the data field.
424-| data | u8[...] | DER-encoded FMC alias certificate.
425-
426-### GET\_RT\_ALIAS\_CERT
427-
428-Exposes a command to get a Runtime alias certificate signed by the FMC alias.
429-
430-Command Code: `0x4345_5252` ("CERR")
431-
432-Privilege Level: PL0 or PL1
433-
434-*Table: `GET_RT_ALIAS_CERT` input arguments*
562+| data | u8[...] | DER-encoded MLDSA87 LDevID certificate.
563+
564+### GET\_FMC\_ALIAS\_ECC384\_CERT
565+
566+Exposes a command to get a FMC alias ECC384 certificate signed by the ECC384 LDevID private key.
567+
568+Command Code: `0x4345_5246` ("CERF")
569+
570+*Table: `GET_FMC_ALIAS_ECC384_CERT` input arguments*
435571
436572 | **Name** | **Type** | **Description**
437573 | -------- | -------- | ---------------
438574 | chksum | u32 | Checksum over other input arguments, computed by the caller. Little endian.
439575
440-*Table: `GET_RT_ALIAS_CERT` output arguments*
576+*Table: `GET_FMC_ALIAS_ECC384_CERT` output arguments*
441577
442578 | **Name** | **Type** | **Description**
443579 | -------- | -------- | ---------------
444580 | chksum | u32 | Checksum over other output arguments, computed by Caliptra. Little endian.
445581 | fips\_status | u32 | Indicates if the command is FIPS approved or an error.
446582 | data\_size | u32 | Length in bytes of the valid data in the data field.
447-| data | u8[...] | DER-encoded Runtime alias certificate.
583+| data | u8[...] | DER-encoded FMC alias ECC384 certificate.
584+
585+### GET\_FMC\_ALIAS\_MLDSA87\_CERT
586+
587+Exposes a command to get a FMC alias MLDSA87 certificate signed by the MLDSA87 LDevID private key.
588+
589+Command Code: `0x434D_4346` ("CMCF")
590+
591+*Table: `GET_FMC_ALIAS_MLDSA87_CERT` input arguments*
592+
593+| **Name** | **Type** | **Description**
594+| -------- | -------- | ---------------
595+| chksum | u32 | Checksum over other input arguments, computed by the caller. Little endian.
596+
597+*Table: `GET_FMC_ALIAS_MLDSA87_CERT` output arguments*
598+
599+| **Name** | **Type** | **Description**
600+| -------- | -------- | ---------------
601+| chksum | u32 | Checksum over other output arguments, computed by Caliptra. Little endian.
602+| fips\_status | u32 | Indicates if the command is FIPS approved or an error.
603+| data\_size | u32 | Length in bytes of the valid data in the data field.
604+| data | u8[...] | DER-encoded FMC alias MLDSA87 certificate.
605+
606+### GET\_RT\_ALIAS\_ECC384\_CERT
607+
608+Exposes a command to get a Runtime alias ECC384 certificate signed by the ECC384 FMC alias private key.
609+
610+Command Code: `0x4345_5252` ("CERR")
611+
612+*Table: `GET_RT_ALIAS_ECC384_CERT` input arguments*
613+
614+| **Name** | **Type** | **Description**
615+| -------- | -------- | ---------------
616+| chksum | u32 | Checksum over other input arguments, computed by the caller. Little endian.
617+
618+*Table: `GET_RT_ALIAS_ECC384_CERT` output arguments*
619+
620+| **Name** | **Type** | **Description**
621+| -------- | -------- | ---------------
622+| chksum | u32 | Checksum over other output arguments, computed by Caliptra. Little endian.
623+| fips\_status | u32 | Indicates if the command is FIPS approved or an error.
624+| data\_size | u32 | Length in bytes of the valid data in the data field.
625+| data | u8[...] | DER-encoded Runtime alias ECC384 certificate.
626+
627+### GET\_RT\_ALIAS\_MLDSA87\_CERT
628+
629+Exposes a command to get a Runtime alias MLDSA87 certificate signed by the MLDSA87 FMC alias private key.
630+
631+Command Code: `0x434D_4352` ("CMCR")
632+
633+*Table: `GET_RT_ALIAS_MLDSA87_CERT` input arguments*
634+
635+| **Name** | **Type** | **Description**
636+| -------- | -------- | ---------------
637+| chksum | u32 | Checksum over other input arguments, computed by the caller. Little endian.
638+
639+*Table: `GET_RT_ALIAS_MLDSA87_CERT` output arguments*
640+
641+| **Name** | **Type** | **Description**
642+| -------- | -------- | ---------------
643+| chksum | u32 | Checksum over other output arguments, computed by Caliptra. Little endian.
644+| fips\_status | u32 | Indicates if the command is FIPS approved or an error.
645+| data\_size | u32 | Length in bytes of the valid data in the data field.
646+| data | u8[...] | DER-encoded Runtime alias MLDSA87 certificate.
448647
449648 ### ECDSA384\_SIGNATURE\_VERIFY
450649
451-Verifies an ECDSA P-384 signature. The hash to be verified is taken from
452-Caliptra's SHA384 accelerator peripheral.
650+Verifies an ECDSA P-384 signature. The hash to be verified is taken from the input (new in 2.0).
453651
454652 In the event of an invalid signature, the mailbox command will report CMD_FAILURE
455653 and the cause will be logged as a non-fatal error.
456654
457-Command Code: `0x5349_4756` ("SIGV")
458-
459-Privilege Level: PL0 or PL1
655+Command Code: `0x4543_5632` ("ECV2")
460656
461657 *Table: `ECDSA384_SIGNATURE_VERIFY` input arguments*
462658
@@ -467,6 +663,7 @@
467663 | pub\_key\_y | u8[48] | Y portion of ECDSA verification key.
468664 | signature\_r | u8[48] | R portion of signature to verify.
469665 | signature\_s | u8[48] | S portion of signature to verify.
666+| hash | u8[48] | SHA384 digest to verify.
470667
471668 *Table: `ECDSA384_SIGNATURE_VERIFY` output arguments*
472669
@@ -477,8 +674,7 @@
477674
478675 ### LMS\_SIGNATURE\_VERIFY
479676
480-Verifies an LMS signature. The hash to be verified is taken from
481-Caliptra's SHA384 accelerator peripheral.
677+Verifies an LMS signature. The hash to be verified is taken from the input (new in 2.0).
482678
483679 In the event of an invalid signature, the mailbox command will report CMD_FAILURE
484680 and the cause will be logged as a non-fatal error.
@@ -493,9 +689,7 @@
493689 | w | 4 | Width (in bits) of the Winternitz coefficient
494690 | h | 15 | Height of the tree
495691
496-Command Code: `0x4C4D_5356` ("LMSV")
497-
498-Privilege Level: PL0 or PL1
692+Command Code: `0x4C4D_5632` ("LMV2")
499693
500694 *Table: `LMS_SIGNATURE_VERIFY` input arguments*
501695
@@ -510,6 +704,7 @@
510704 | signature\_ots | u8[1252] | LM-OTS signature
511705 | signature\_tree\_type | u8[4] | LMS signature Algorithm type. Must equal 12.
512706 | signature\_tree\_path | u8[360] | Path through the tree from the leaf associated with the LM-OTS signature to the root
707+| hash | u8[48] | SHA384 digest to verify.
513708
514709 *Table: `LMS_SIGNATURE_VERIFY` output arguments*
515710
@@ -518,40 +713,57 @@
518713 | chksum | u32 | Checksum over other output arguments, computed by Caliptra. Little endian.
519714 | fips\_status | u32 | Indicates if the command is FIPS approved or an error.
520715
521-### MLDSA87\_SIGNATURE\_VERIFY
522-
523-Verifies an ML-DSA-87 (FIPS 204) signature. As with the ECDSA and LMS
524-verify commands, the message digest to be verified is taken from
525-Caliptra's SHA384 accelerator peripheral. Callers must stream the
526-message through the SHA accelerator before issuing this command;
527-carrying the raw message in-band would put hashing outside the FIPS
528-module boundary and is therefore disallowed.
529-
530-ML-DSA-87 is stateless and does not have the per-key signature budget that
531-LMS does, which is the primary motivation for adding this command alongside
532-the existing `LMS_SIGNATURE_VERIFY`.
533-
534-In the event of an invalid signature, the mailbox command will report
535-`CMD_FAILURE` and the cause will be logged as a non-fatal error.
536-
537-Command Code: `0x4D44_5356` ("MDSV")
538-
539-Privilege Level: PL0 or PL1
716+### MLDSA87_SIGNATURE_VERIFY
717+
718+Verifies the signature against the message and MLDSA-87 public key.
719+
720+The public key and signature formats are described in [FIPS 204](https://csrc.nist.gov/pubs/fips/204/final).
721+
722+The command will only return a success if the signature is valid.
723+
724+Command Code: `0x4D4C_5632` ("MLV2")
540725
541726 *Table: `MLDSA87_SIGNATURE_VERIFY` input arguments*
542-
543-| **Name** | **Type** | **Description**
544-| -------- | --------- | ---------------
545-| chksum | u32 | Checksum over other input arguments, computed by the caller. Little endian.
546-| pub\_key | u8[2592] | Encoded ML-DSA-87 public key (FIPS 204).
547-| signature | u8[4627] | Encoded ML-DSA-87 signature (FIPS 204).
727+| **Name** | **Type** | **Description** |
728+| --------- | ------------ | ------------------ |
729+| chksum | u32 ||
730+| pub_key | u8[2592] | Public key |
731+| signature | u8[4627] | Signature to check |
732+| padding | u8[1] ||
733+| data len | u32 | Length of message |
734+| data | u8[data len] | Message to check |
735+
736+
548737
549738 *Table: `MLDSA87_SIGNATURE_VERIFY` output arguments*
550-
551-| **Name** | **Type** | **Description**
552-| -------- | -------- | ---------------
553-| chksum | u32 | Checksum over other output arguments, computed by Caliptra. Little endian.
554-| fips\_status | u32 | Indicates if the command is FIPS approved or an error.
739+| **Name** | **Type** | **Description** |
740+| ----------- | -------- | -------------------------- |
741+| chksum | u32 ||
742+| fips_status | u32 | FIPS approved or an error |
743+
744+
745+
746+### INSTALL\_OWNER\_PK\_HASH
747+
748+Exposes a command to save the owner public key hash in persistent data.
749+
750+Command Code: `0x4F57_4E50` ("OWNP")
751+
752+*Table: `INSTALL_OWNER_PK_HASH` input arguments*
753+
754+| **Name** | **Type** | **Description**
755+| -------- | -------- | ---------------
756+| chksum | u32 | Checksum over other input arguments, computed by the caller. Little endian.
757+| digest | u32[12] | Owner public key hash.
758+
759+*Table: `INSTALL_OWNER_PK_HASH` output arguments*
760+
761+| **Name** | **Type** | **Description**
762+| -------- | -------- | ---------------
763+| chksum | u32 | Checksum over other output arguments, computed by Caliptra. Little endian.
764+| fips\_status | u32 | Indicates if the command is FIPS approved or an error.
765+| dpe\_result | u32 | Result code, 0 on success.
766+
555767
556768 ### STASH\_MEASUREMENT
557769
@@ -561,10 +773,9 @@
561773 * Call the DPE DeriveContext command with the DefaultContext in the locality of
562774 the PL0 PAUSER.
563775 * Extend the measurement into PCR31 (`PCR_ID_STASH_MEASUREMENT`).
776+* **Note**: This command can only be called in the locality of the PL0 PAUSER.
564777
565778 Command Code: `0x4D45_4153` ("MEAS")
566-
567-Privilege Level: PL0
568779
569780 *Table: `STASH_MEASUREMENT` input arguments*
570781
@@ -601,8 +812,6 @@
601812
602813 Command Code: `0x4453_424C` ("DSBL")
603814
604-Privilege Level: PL0
605-
606815 *Table: `DISABLE_ATTESTATION` input arguments*
607816
608817 | **Name** | **Type** | **Description**
@@ -620,9 +829,11 @@
620829
621830 Invokes a serialized DPE command.
622831
832+Named TCI identifiers (`RTMR`, `CCIV`, `SOMV`, `SOMO`, and `MCFW`) appear as
833+those four ASCII bytes in attestation output. Their numeric representation uses
834+DPE's little-endian encoding, correcting the reversed names in earlier 2.0 firmware.
835+
623836 Command Code: `0x4450_4543` ("DPEC")
624-
625-Privilege Level: PL0 or PL1; a subset of DPE commands requires PL0 (see [Mailbox command privilege levels](#mailbox-command-privilege-levels))
626837
627838 *Table: `INVOKE_DPE_COMMAND` input arguments*
628839
@@ -641,16 +852,14 @@
641852 | data\_size | u32 | Length in bytes of the valid data in the data field.
642853 | data | u8[...] | DPE response structure as defined in the DPE iRoT profile.
643854
644-### QUOTE\_PCRS
645-
646-Generates a signed quote over all Caliptra hardware PCRs that are using the Caliptra PCR quoting key.
855+### QUOTE\_PCRS\_ECC384
856+
857+Generates a signed quote over all Caliptra hardware PCRs using the Caliptra PCR ECC384 quoting key.
647858 All PCR values are hashed together with the nonce to produce the quote.
648859
649860 Command Code: `0x5043_5251` ("PCRQ")
650861
651-Privilege Level: PL0 or PL1
652-
653-*Table: `QUOTE_PCRS` input arguments*
862+*Table: `QUOTE_PCRS_ECC384` input arguments*
654863
655864 | **Name** | **Type** | **Description**
656865 | -------- | -------- | ---------------
@@ -659,18 +868,46 @@
659868
660869 PcrValue is defined as u8[48]
661870
662-*Table: `QUOTE_PCRS` output arguments*
663-
664-| **Name** | **Type** | **Description**
665-| -------- | -------- | ---------------
666-| chksum | u32 | Checksum over other output arguments, computed by Caliptra. Little endian.
667-| fips\_status | u32 | Indicates if the command is FIPS approved or an error.
668-| PCRs | PcrValue[32] | Values of all PCRs.
669-| nonce | u8[32] | Return the nonce used as input for convenience.
670-| digest | u8[48] | Return the digest over the PCR values and the nonce.
671-| reset\_ctrs | u32[32] | Reset counters for all PCRs.
672-| signature\_r | u8[48] | R portion of the signature over the PCR quote.
673-| signature\_s | u8[48] | S portion of the signature over the PCR quote.
871+*Table: `QUOTE_PCRS_ECC384` output arguments*
872+
873+| **Name** | **Type** | **Description**
874+| -------- | -------- | ---------------
875+| chksum | u32 | Checksum over other output arguments, computed by Caliptra. Little endian.
876+| fips\_status | u32 | Indicates if the command is FIPS approved or an error.
877+| PCRs | PcrValue[32] | Values of all PCRs.
878+| nonce | u8[32] | Return the nonce used as input for convenience.
879+| reset\_ctrs | u32[32] | Reset counters for all PCRs.
880+| digest | u8[48] | Return the lower 48 bytes of SHA2-512 digest over the PCR values and the nonce.
881+| signature\_r | u8[48] | ECC P-384 R portion of the signature over the `ecc_digest`. </br> The FMC Alias ECC P-384 private key stored in Key Vault slot 7 is utilized for the signing operation.
882+| signature\_s | u8[48] | ECC P-384 S portion of the signature over the `ecc_digest`.
883+
884+### QUOTE\_PCRS\_MLDSA87
885+
886+Generates a signed quote over all Caliptra hardware PCRs that are using the Caliptra PCR Mldsa87 quoting key.
887+All PCR values are hashed together with the nonce to produce the quote.
888+
889+Command Code: `0x5043_524D` ("PCRM")
890+
891+*Table: `QUOTE_PCRS_MLDSA87` input arguments*
892+
893+| **Name** | **Type** | **Description**
894+| -------- | -------- | ---------------
895+| chksum | u32 | Checksum over other input arguments, computed by the caller. Little endian.
896+| nonce | u8[32] | Caller-supplied nonce to be included in signed data.
897+
898+PcrValue is defined as u8[48]
899+
900+*Table: `QUOTE_PCRS_MLDSA87` output arguments*
901+
902+| **Name** | **Type** | **Description**
903+| -------- | -------- | ---------------
904+| chksum | u32 | Checksum over other output arguments, computed by Caliptra. Little endian.
905+| fips\_status | u32 | Indicates if the command is FIPS approved or an error.
906+| PCRs | PcrValue[32] | Values of all PCRs.
907+| nonce | u8[32] | Return the nonce used as input for convenience.
908+| reset\_ctrs | u32[32] | Reset counters for all PCRs.
909+| digest | u8[64] | Return the SHA2-512 digest over the PCR values and the nonce, in byte reversed order.
910+| signature | u8[4628] | MLDSA-87 signature over the `digest` (4627 bytes + 1 Reserved byte). </br> The FMC Alias MLDSA seed stored in Key Vault slot 8 is utilized to generate the private key, which is subsequently used for the signing operation.
674911
675912 ### EXTEND\_PCR
676913
@@ -679,8 +916,6 @@
679916 is available to PL0 for MCU-managed SoC firmware measurements.
680917
681918 Command Code: `0x5043_5245` ("PCRE")
682-
683-Privilege Level: PL0 or PL1
684919
685920 *Table: `EXTEND_PCR` input arguments*
686921
@@ -697,10 +932,6 @@
697932 | chksum | u32 | Checksum over other output arguments, computed by Caliptra. Little endian.
698933 | fips\_status | u32 | Indicates if the command is FIPS approved or an error.
699934
700-PCRs 0-3 (the FMC/RT current and journey PCRs) and PCR31 (the stash-measurement
701-PCR) are reserved for Caliptra's own use and cannot be extended through this
702-command by any caller; requests targeting them fail with `RUNTIME_PCR_RESERVED`.
703-
704935 Note that extensions made into Caliptra's PCRs are _not_ appended to Caliptra's internal PCR log.
705936
706937 ### GET\_PCR\_LOG
@@ -708,8 +939,6 @@
708939 Gets Caliptra's internal PCR log.
709940
710941 Command Code: `0x504C_4F47` ("PLOG")
711-
712-Privilege Level: PL0 or PL1
713942
714943 *Table: `GET_PCR_LOG` input arguments*
715944
@@ -738,8 +967,6 @@
738967
739968 Command Code: `0x5043_5252` ("PCRR")
740969
741-Privilege Level: PL0 or PL1
742-
743970 *Table: `INCREMENT_PCR_RESET_COUNTER` input arguments*
744971
745972 | **Name** | **Type** | **Description**
@@ -759,8 +986,6 @@
759986 Associates a unique tag with a DPE context.
760987
761988 Command Code: `0x5451_4754` ("TAGT")
762-
763-Privilege Level: PL0 or PL1; tags only contexts in the caller's own locality
764989
765990 *Table: `DPE_TAG_TCI` input arguments*
766991
@@ -781,9 +1006,11 @@
7811006
7821007 Retrieves the TCI measurements corresponding to the tagged DPE context.
7831008
1009+NOTE: Additional fields and info may be appended to the response in subsequent FW
1010+versions. Appending changes the response length and therefore its checksum, so
1011+the caller and firmware are expected to be updated in lockstep.
1012+
7841013 Command Code: `0x4754_4744` ("GTGD")
785-
786-Privilege Level: PL0 or PL1; not locality-scoped, either level can read any tagged TCI
7871014
7881015 *Table: `DPE_GET_TAGGED_TCI` input arguments*
7891016
@@ -800,6 +1027,7 @@
8001027 | fips\_status | u32 | Indicates if the command is FIPS approved or an error.
8011028 | tci\_cumulative | u8[48] | Hash of all of the input data provided to the context.
8021029 | tci\_current | u8[48] | Most recent measurement made into the context.
1030+| svn | u32 | Security Version Number of the tagged DPE context.
8031031
8041032 ### FW\_INFO
8051033
@@ -809,40 +1037,62 @@
8091037
8101038 Command Code: `0x494E_464F` ("INFO")
8111039
812-Privilege Level: PL0 or PL1
813-
8141040 *Table: `FW_INFO` input arguments*
8151041
816-| **Name** | **Type** | **Description**
817-| -------- | -------- | ---------------
818-| chksum | u32 | Checksum over other input arguments, computed by the caller. Little endian.
1042+| **Name** | **Type** | **Description** |
1043+| -------- | -------- | --------------------------------------------------------------------------- |
1044+| chksum | u32 | Checksum over other input arguments, computed by the caller. Little endian. |
1045+
8191046
8201047 *Table: `FW_INFO` output arguments*
8211048
822-| **Name** | **Type** | **Description**
823-| -------- | -------- | ---------------
824-| chksum | u32 | Checksum over other input arguments, computed by the caller. Little endian.
825-| fips\_status | u32 | Indicates if the command is FIPS approved or an error.
826-| pl0_pauser | u32 | PAUSER with PL0 privileges (from image header).
827-| runtime_svn | u32 | Runtime SVN.
828-| min_runtime_svn | u32 | Min Runtime SVN.
829-| fmc_manifest_svn | u32 | FMC SVN.
830-| attestation_disabled | u32 | State of attestation disable.
831-| rom_revision | u8[20] | Revision (Git commit ID) of ROM build.
832-| fmc_revision | u8[20] | Revision (Git commit ID) of FMC build.
833-| runtime_revision | u8[20] | Revision (Git commit ID) of runtime build.
834-| rom_sha256_digest | u32[8] | Digest of ROM binary.
835-| fmc_sha384_digest | u32[12] | Digest of FMC binary.
836-| runtime_sha384_digest | u32[12] | Digest of runtime binary.
837-| owner_pub_key_hash | u32[12] | Hash of the owner public keys provided in the image bundle manifest.
1049+| **Name** | **Type** | **Description** |
1050+| --------------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
1051+| chksum | u32 | Checksum over other input arguments, computed by the caller. Little endian. |
1052+| fips\_status | u32 | Indicates if the command is FIPS approved or an error. |
1053+| pl0_pauser | u32 | PAUSER with PL0 privileges (from image header). |
1054+| firmware_svn | u32 | Firmware SVN. |
1055+| min_firmware_svn | u32 | Min Firmware SVN. |
1056+| cold_boot_fw_svn | u32 | Cold-boot Firmware SVN. |
1057+| attestation_disabled | u32 | State of attestation disable. |
1058+| rom_revision | u8[20] | Revision (Git commit ID) of ROM build. |
1059+| fmc_revision | u8[20] | Revision (Git commit ID) of FMC build. |
1060+| runtime_revision | u8[20] | Revision (Git commit ID) of runtime build. |
1061+| rom_sha256_digest | u32[8] | Digest of ROM binary. See [Byte order of cryptographic fields](#byte-order-of-cryptographic-fields). |
1062+| fmc_sha384_digest | u32[12] | Digest of FMC binary. See [Byte order of cryptographic fields](#byte-order-of-cryptographic-fields). |
1063+| runtime_sha384_digest | u32[12] | Digest of runtime binary. See [Byte order of cryptographic fields](#byte-order-of-cryptographic-fields). |
1064+| owner_pub_key_hash | u32[12] | Hash of the owner public keys provided in the image bundle manifest. See [Byte order of cryptographic fields](#byte-order-of-cryptographic-fields). |
1065+| authman_sha384_digest | u32[12] | Hash of the authorization manifest provided by SET_AUTH_MANIFEST. See [Byte order of cryptographic fields](#byte-order-of-cryptographic-fields). |
1066+| most_recent_fw_error | u32 | Most recent FW non-fatal error (shows current non-fatal error if non-zero) |
1067+| vendor_pub_key_hash | u32[12] | Hash of the vendor public key used to verify firmware. **Only present in FW 2.0.2+ and 2.1.1+.** |
1068+| image_manifest_pqc_type | u32 | PQC key type from image manifest. **Only present in FW 2.0.2+ and 2.1.1+.** |
1069+| vendor_ecc384_pub_key_index | u32 | Index of the vendor ECC public key used for verification. **Only present in FW 2.0.2+ and 2.1.1+.** |
1070+| vendor_pqc_pub_key_index | u32 | Index of the vendor PQC public key used for verification. **Only present in FW 2.0.2+ and 2.1.1+.** |
1071+| soc_manifest_current_svn | u32 | SVN of the authorization manifest accepted by `SET_AUTH_MANIFEST`, or zero if none has been accepted. |
1072+| soc_manifest_min_svn | u32 | Minimum SoC manifest SVN encoded in `FUSE_SOC_MANIFEST_SVN` and enforced by `SET_AUTH_MANIFEST` when anti-rollback checks are enabled. |
1073+| owner_auth_manifest_current_svn | u32 | SVN of the owner authorization manifest accepted by `SET_OWNER_AUTH_MANIFEST`, or zero if none has been accepted. |
1074+| owner_auth_manifest_min_svn | u32 | Minimum owner authorization manifest SVN encoded in `SS_STRAP_GENERIC[3][15:8]` and enforced by `SET_OWNER_AUTH_MANIFEST` when anti-rollback checks are enabled. |
1075+| debug_policy | u32 | Active vendor-authorized debug policy. Bit 0 (`DEBUG_FIRMWARE_ACTIVE`) indicates that the active firmware bundle is marked as debug. Bit 1 (`DEBUG_AUTH_MANIFEST_ACTIVE`) indicates that the installed SoC authorization manifest is marked as debug. Bits 31:2 are zero. |
1076+| fe_status | u32 | Live OTP provisioning status of all four FE partitions in subsystem mode. Partition `i` occupies bits `[2*i+1:2*i]`: `0` = unprovisioned, `1` = provisioned, `2` = reserved on Caliptra 2.0, `3` = error/indeterminate. Outside subsystem mode, all partitions report error/indeterminate. Bits 31:8 are zero. |
1077+
1078+
1079+The response is 400 bytes in both subsystem and standalone modes. The `fe_status`
1080+field is always present; standalone mode returns `0x000000ff` because FE status is
1081+unavailable. Callers must use the updated response layout and validate the checksum
1082+over the full response.
1083+
1084+FE status is read for each request, not cached at boot. Caliptra 2.0 has no
1085+zeroization markers: a zero digest reports unprovisioned and a nonzero digest
1086+reports provisioned. Locked DAI access, DMA/DAI errors, and timeouts report error
1087+for the affected partition while leaving the other firmware information
1088+available. This metadata does not establish whether FE contributed to an existing
1089+certificate.
8381090
8391091 ### VERSION
8401092
8411093 FIPS command to get version info for the module
8421094
8431095 Command Code: `0x4650_5652` ("FPVR")
844-
845-Privilege Level: PL0 or PL1
8461096
8471097 Table: `VERSION` input arguments
8481098
@@ -860,13 +1110,55 @@
8601110 | fips_rev | u32[3] | [31:0] HW rev ID, [47:32] ROM version, [63:48] FMC version, [95:64] FW version
8611111 | name | u8[12] | 12 character module name "Caliptra RTM"
8621112
1113+### Autonomous command-count self-tests
1114+
1115+Runtime can run its existing FIPS self-test suite after a configured number of
1116+completed mailbox commands. This is workload-based, not time-based: idle time
1117+without additional commands does not advance the count.
1118+
1119+The configuration uses the second core generic-input word,
1120+`CPTRA_GENERIC_INPUT_WIRES[1]`, not MCU generic inputs or subsystem straps.
1121+Bit positions below are relative to that word:
1122+
1123+| Bits | Meaning |
1124+| ---- | ------- |
1125+| 0 | Enable. Zero preserves manual-only behavior. |
1126+| 16:1 | Nonzero base command count, from 1 to 65535. |
1127+| 18:17 | Multiplier: 0 = x1, 1 = x16, 2 = x256, 3 = x4096. |
1128+| 31:19 | Reserved; tie to zero when enabled. |
1129+
1130+
1131+The threshold is `base count * multiplier`, from 1 to 268431360 commands.
1132+The platform must allocate and configure these input bits before Runtime starts.
1133+For example, `0x000207d1` selects `1000 * 16 = 16000` commands.
1134+
1135+Runtime snapshots the configuration once per startup, including cold, warm and
1136+firmware-update resets. Later input changes do not disable or reconfigure the
1137+schedule. An enabled policy with a zero count, reserved bits set, or a build
1138+without `fips_self_test` support fails startup with
1139+`RUNTIME_INVALID_SELF_TEST_CONFIG`. Disabled configurations ignore other fields.
1140+
1141+Every completed Runtime command counts once, including failed commands and
1142+manual self-test commands. ROM commands and self-test execution do not count.
1143+The active handler and its response complete before the scheduler checks the
1144+threshold. Pending commands and unread responses retain mailbox ownership and
1145+defer the test; the suite starts only after Runtime acquires the mailbox lock.
1146+Continued mailbox activity can therefore postpone a due test indefinitely.
1147+
1148+The suite reuses the 2.0 KAT, ROM-integrity and firmware-verification paths and
1149+the configured command-watchdog policy. It resets the count only on success;
1150+a failure follows the existing fatal-error path. Shutdown remains terminal.
1151+
1152+Manual `SELF_TEST_START` and `SELF_TEST_GET_RESULTS` keep their existing
1153+semantics. Successful manual tests also reset the autonomous count. Autonomous
1154+tests neither create nor consume manual results, so unread manual results do
1155+not block future autonomous suites.
1156+
8631157 ### SELF\_TEST\_START
8641158
8651159 FIPS command to start the self tests
8661160
8671161 Command Code: `0x4650_4C54`
868-
869-Privilege Level: PL0 or PL1
8701162
8711163 Table: `SELF_TEST_START` input arguments
8721164
@@ -887,8 +1179,6 @@
8871179
8881180 Command Code: `0x4650_4C67`
8891181
890-Privilege Level: PL0 or PL1
891-
8921182 Table: `SELF_TEST_GET_RESULTS` input arguments
8931183
8941184 | **Name** | **Type** | **Description**
@@ -908,8 +1198,6 @@
9081198
9091199 Command Code: `0x4650_5344` ("FPSD")
9101200
911-Privilege Level: PL0 or PL1
912-
9131201 Table: `SHUTDOWN` input arguments
9141202
9151203 | **Name** | **Type** | **Description**
@@ -925,15 +1213,13 @@
9251213
9261214 ### ADD\_SUBJECT\_ALT\_NAME
9271215
928-Provides a subject alternative name otherName. Whenever CERTIFY_KEY_EXTENDED is called with the
929-DMTF_OTHER_NAME flag after ADD_SUBJECT_ALT_NAME is called, the resulting DPE CSR or leaf certificate
930-will contain a subject alternative name extension containing the provided otherName, which must be a
931-DMTF device info. All such certificates produced by CERTIFY_KEY_EXTENDED will continue to have the
1216+Provides a subject alternative name otherName. Whenever CERTIFY_KEY_EXTENDED is called with the
1217+DMTF_OTHER_NAME flag after ADD_SUBJECT_ALT_NAME is called, the resulting DPE CSR or leaf certificate
1218+will contain a subject alternative name extension containing the provided otherName, which must be a
1219+DMTF device info. All such certificates produced by CERTIFY_KEY_EXTENDED will continue to have the
9321220 DMTF otherName subject alternative name extension until reset.
9331221
9341222 Command Code: `0x414C_544E` ("ALTN")
935-
936-Privilege Level: PL0 or PL1
9371223
9381224 *Table: `ADD_SUBJECT_ALT_NAME` input arguments*
9391225
@@ -956,190 +1242,1576 @@
9561242
9571243 Command Code: `0x434B_4558` ("CKEX")
9581244
959-Privilege Level: PL0
960-
9611245 *Table: `CERTIFY_KEY_EXTENDED` input arguments*
9621246
963-| **Name** | **Type** | **Description**
964-| -------- | -------- | ---------------
965-| chksum | u32 | Checksum over other input arguments, computed by the caller. Little endian.
966-| certify\_key\_req | u8[72] | Certify Key Request.
967-| flags | u32 | Flags determining which custom extensions to include in the certificate.
1247+| **Name** | **Type** | **Description** |
1248+| ----------------- | -------- | --------------------------------------------------------------------------- |
1249+| chksum | u32 | Checksum over other input arguments, computed by the caller. Little endian. |
1250+| certify\_key\_req | u8[72] | Certify Key Request. |
1251+| flags | u32 | Flags determining which custom extensions to include in the certificate. |
1252+
9681253
9691254 *Table: `CERTIFY_KEY_EXTENDED` input flags*
9701255
971-| **Name** | **Offset**
972-| -------- | ----------
973-| DMTF_OTHER_NAME | 1 << 31
1256+| **Name** | **Offset** |
1257+| --------------- | ---------- |
1258+| DMTF_OTHER_NAME | 1 << 31 |
1259+
9741260
9751261 *Table: `CERTIFY_KEY_EXTENDED` output arguments*
1262+
1263+| **Name** | **Type** | **Description** |
1264+| ------------------ | -------- | -------------------------------------------------------------------------- |
1265+| chksum | u32 | Checksum over other output arguments, computed by Caliptra. Little endian. |
1266+| fips\_status | u32 | Indicates if the command is FIPS approved or an error. |
1267+| certify\_key\_resp | u8[2176] | Certify Key Response. |
1268+
1269+
1270+### CERTIFY\_KEY\_CHUNKS
1271+
1272+Invokes a DPE `CertifyKey` command (ECC-P384 or ML-DSA-87) and returns the response in chunks. This is useful when the DPE response (which contains a certificate or CSR) is larger than the mailbox size or larger than the caller can easily consume.
1273+
1274+The handler re-executes the full DPE `CertifyKey` operation on every call and then returns the requested `[offset, offset+max_size)` window of the freshly generated response. Each call rotates the context handle, if needed. The new handle is returned in the per-chunk response header and must be used for the next call.
1275+
1276+Command Code: `0x434B_4348` ("CKCH")
1277+
1278+*Table: `CERTIFY_KEY_CHUNKS` input arguments*
1279+
1280+| **Name** | **Type** | **Description** |
1281+| ----------------- | -------- | ------------------------------------------------------------------------------------- |
1282+| chksum | u32 | Checksum over other input arguments, computed by the caller. Little endian. |
1283+| flags | u32 | Flags. |
1284+| reserved | u32 | Reserved. |
1285+| max\_size | u32 | The maximum length of the chunk the caller wants to receive. If 0, defaults to 15360. |
1286+| offset | u32 | Offset into the full CertifyKey response to read from. |
1287+| certify\_key\_req | u8[72] | The serialized DPE `CertifyKey` command. |
1288+
1289+
1290+*Table: `CERTIFY_KEY_CHUNKS` input flags*
1291+
1292+| **Name** | **Offset** |
1293+| --------- | ---------- |
1294+| USE_MLDSA | 1 << 31 |
1295+
1296+
1297+When `USE_MLDSA` is set, the command operates on the ML-DSA-87 DPE profile; otherwise, it operates on the ECC-P384 profile.
1298+
1299+*Table: `CERTIFY_KEY_CHUNKS` output arguments*
1300+
1301+| **Name** | **Type** | **Description** |
1302+| ------------------ | --------- | -------------------------------------------------------------------------- |
1303+| chksum | u32 | Checksum over other output arguments, computed by Caliptra. Little endian. |
1304+| fips\_status | u32 | Indicates if the command is FIPS approved or an error. |
1305+| context\_handle | u8[16] | The new DPE context handle returned by the `CertifyKey` command. |
1306+| chunk\_len | u32 | The length of the chunk returned in `certify_key_resp`. |
1307+| remaining | u32 | The number of bytes remaining in the full response after this chunk. |
1308+| certify\_key\_resp | u8[15360] | The chunk of the DPE `CertifyKey` response. |
1309+
1310+
1311+### SET_AUTH_MANIFEST
1312+
1313+The SoC uses this command and `SET_IMAGE_METADTA` to program an image manifest for Manifest-Based Image Authorization to Caliptra. In response to these commands, the Caliptra Runtime will verify the manifest by authenticating the public keys and in turn using them to authenticate the IMC. On successful verification, the Runtime will store the IMEs into DCCM for future use. Every active `fw_id` must be unique within this manifest and must not appear in the installed owner-only manifest. A collision rejects the command without replacing either active collection.
1314+
1315+The original SoC manifest may include an optional device UEID IME with the
1316+reserved `fw_id` `0x0000_0FFF`, immediately below the vendor-defined SoC image
1317+ID range beginning at `0x0000_1000`. Its 48-byte digest contains the 17-byte
1318+device UEID followed by 31 zero bytes.
1319+After authenticating the IMC, Runtime compares the complete value with the UEID
1320+assembled from the IDevID certificate-attribute fuses. A mismatch, including
1321+nonzero padding, rejects the command with
1322+`RUNTIME_AUTH_MANIFEST_UEID_MISMATCH` without replacing the active manifest.
1323+The UEID entry is excluded from normal image lookup, authorization, and
1324+activation. This interpretation does not apply to the owner-only manifest
1325+loaded by `SET_OWNER_AUTH_MANIFEST`.
1326+
1327+Command Code: `0x4154_4D4E` ("ATMN")
1328+
1329+*Table: `SET_AUTH_MANIFEST` input arguments*
9761330
9771331 | **Name** | **Type** | **Description**
9781332 | -------- | -------- | ---------------
979-| chksum | u32 | Checksum over other output arguments, computed by Caliptra. Little endian.
980-| fips\_status | u32 | Indicates if the command is FIPS approved or an error.
981-| certify\_key\_resp | u8[2176] | Certify Key Response.
982-
983-### SET\_AUTH\_MANIFEST
984-
985-Command Code: `0x4154_4D4E` ("ATMN")
986-
987-Privilege Level: PL0
988-
989-*Table: `SET_AUTH_MANIFEST` input arguments*
990-
991-| **Name** | **Type** | **Description** |
992-| ------------------------------ | ------------------ | --------------- |
9931333 | chksum | u32 | Checksum over other input arguments, computed by the caller. Little endian. |
9941334 | manifest size | u32 | The size of the full Authentication Manifest |
995-| manifest\_marker | u32 | Marker needs to be 0x4154_4D4E for the preamble to be valid |
1335+| preamble\_marker | u32 | Marker needs to be 0x4154_4D4E for the preamble to be valid |
9961336 | preamble\_size | u32 | Size of the preamble |
997-| manifest\_version | u32 | Version of the preamble |
998-| manifest\_flags | u32 | Manifest flags. See `AUTH_MANIFEST_FLAGS` below. |
999-| manifest\_vendor\_ecc384\_key | u32[24] | Manifest Vendor ECC P-384 public key used to verify the IMC Signature. <br> **X-Coordinate:** Public Key X-Coordinate (48 bytes) <br> **Y-Coordinate:** Public Key Y-Coordinate (48 bytes) |
1000-| manifest\_vendor\_lms\_key | u32[12] | Manifest Vendor LMS public key used to verify the IMC Signature. <br> **tree_type:** LMS Algorithm Type (4 bytes) <br> **otstype:** LMS Ots Algorithm Type (4 bytes) <br> **id:** (16 bytes) <br> **digest:** (24 bytes) <br> Note: If LMS validation is not required, this should field should be zeroed out. |
1001-| manifest\_vendor\_ecc384\_sig | u32[24] | Manifest Vendor ECDSA P-384 signature of the Version, Flags, Vendor ECC and LMS public keys, hashed using SHA2-384. <br> **R-Coordinate:** Random Point (48 bytes) <br> **S-Coordinate:** Proof (48 bytes) |
1002-| manifest\_vendor\_LMS\_sig | u32[405] | Vendor LMS signature of the Version, Flags, Vendor ECC and LMS public keys, hashed using SHA2-384. <br> **q:** Leaf of the Merkle tree where the OTS public key appears (4 bytes) <br> **ots:** Lmots Signature (1252 bytes) <br> **tree_type:** Lms Algorithm Type (4 bytes) <br> **tree_path:** Path through the tree from the leaf associated with the LM-OTS signature to the root. (360 bytes) <br> Note: If LMS validation is not required, this should field should be zeroed out. |
1003-| manifest\_owner\_ecc384\_key | u32[24] | Manifest Owner ECC P-384 public key used to verify the IMC Signature. <br> **X-Coordinate:** Public Key X-Coordinate (48 bytes) <br> **Y-Coordinate:** Public Key Y-Coordinate (48 bytes) |
1004-| manifest\_owner\_lms\_key | u32[12] | Manifest Owner LMS public key used to verify the IMC Signature. <br> **tree_type:** LMS Algorithm Type (4 bytes) <br> **otstype:** LMS Ots Algorithm Type (4 bytes) <br> **id:** (16 bytes) <br> **digest:** (24 bytes) <br> Note: If LMS validation is not required, this should field should be zeroed out. |
1005-| manifest\_owner\_ecc384\_sig | u32[24] | Owner ECDSA P-384 signature of the Owner ECC and LMS public keys, hashed using SHA2-384. <br> **R-Coordinate:** Random Point (48 bytes) <br> **S-Coordinate:** Proof (48 bytes) |
1006-| manifest\_owner\_LMS\_sig | u32[405] | Owner LMS signature of the Version, Flags, Owner ECC and LMS public keys, hashed using SHA2-384. <br> **q:** Leaf of the Merkle tree where the OTS public key appears (4 bytes) <br> **ots:** Lmots Signature (1252 bytes) <br> **tree_type:** Lms Algorithm Type (4 bytes) <br> **tree_path:** Path through the tree from the leaf associated with the LM-OTS signature to the root. (360 bytes) <br> Note: If LMS validation is not required, this should field should be zeroed out. |
1007-| metadata\_vendor\_ecc384\_sig | u32[24] | Metadata Vendor ECC384 signature over the image metadata collection using the manifest vendor ecc384 key. |
1008-| metadata\_vendor\_LMS\_sig | u32[405] | Metadata Vendor LMOTS-SHA192-W4 signature over the image metadata collection using the manifest vendor LMS key. |
1009-| metadata\_owner\_ecc384\_sig | u32[24] | Metadata Owner ECC384 signature over the image metadata collection using the manifest owner ecc384 key. |
1010-| metadata\_owner\_LMS\_sig | u32[405] | Metadata Owner LMOTS-SHA192-W4 signature over the image metadata collection manifest owner LMS key. |
1337+| preamble\_version | u32 | Version of the preamble |
1338+| preamble\_flags | u32 | Manifest flags. See AUTH_MANIFEST_FLAGS below |
1339+| preamble\_vendor\_ecc384\_key | u32[24] | Vendor ECC384 key with X and Y coordinates in that order |
1340+| preamble\_vendor\_pqc\_key | u32[648] | Vendor MLDSA-87 or LMS-SHA192-H15 key |
1341+| preamble\_vendor\_ecc384\_sig | u32[24] | Vendor ECC384 signature |
1342+| preamble\_vendor\_PQC\_sig | u32[1157] | Vendor MLDSA-87 or LMOTS-SHA192-W4 signature |
1343+| preamble\_owner\_ecc384\_key | u32[24] | Owner ECC384 key with X and Y coordinates in that order |
1344+| preamble\_owner\_pqc\_key | u32[648] | Owner MLDSA-87 or LMS-SHA192-H15 key |
1345+| preamble\_owner\_ecc384\_sig | u32[24] | Owner ECC384 signature |
1346+| preamble\_owner\_PQC\_sig | u32[1157] | Owner MLDSA-87 or LMOTS-SHA192-W4 signature |
1347+| metadata\_vendor\_ecc384\_sig | u32[24] | Metadata Vendor ECC384 signature |
1348+| metadata\_vendor\_PQC\_sig | u32[1157] | Metadata Vendor MLDSA-87 or LMOTS-SHA192-W4 signature |
1349+| metadata\_owner\_ecc384\_sig | u32[24] | Metadata Owner ECC384 signature |
1350+| metadata\_owner\_PQC\_sig | u32[1157] | Metadata Owner MLDSA-87 or LMOTS-SHA192-W4 signature |
10111351 | metadata\_entry\_entry\_count | u32 | number of metadata entries |
1012-| metadata\_entries | MetaData[127] | The max number of metadata entries is 127 but less can be used |
1352+| metadata\_entries | Metadata[80] | The max number of metadata entries is 80 but less can be used |
10131353
10141354
10151355
10161356 *Table: `AUTH_MANIFEST_FLAGS` input flags*
1017-
10181357 | **Name** | **Value** |
1019-| --------------------------- | ----------- |
1358+| ------------------------- | --------- |
10201359 | VENDOR_SIGNATURE_REQUIRED | 1 << 0 |
1021-
1360+| DEBUG_IMAGE | 1 << 1 |
1361+
1362+
1363+`DEBUG_IMAGE` is valid only when `VENDOR_SIGNATURE_REQUIRED` is also set. Runtime rejects an invalid combination with `RUNTIME_AUTH_MANIFEST_INVALID_FLAGS`. Runtime rejects a debug manifest unless it is running in subsystem mode with `SS_DEBUG_INTENT` asserted and `SS_STRAP_GENERIC[3][31]` clear, returning `RUNTIME_AUTH_MANIFEST_DEBUG_IMAGE_NOT_ALLOWED`. Existing vendor and owner authentication remain required.
1364+
1365+After a successful `SET_AUTH_MANIFEST`, Runtime sets `FW_INFO.debug_policy[1]` for a debug manifest and clears it for a normal manifest. Failed installations and `VERIFY_AUTH_MANIFEST` do not change the active bit. The bit survives warm and update resets, is cleared on cold reset, and is not modified by `SET_OWNER_AUTH_MANIFEST`.
10221366
10231367 *Table: `AUTH_MANIFEST_METADATA_ENTRY` digest entries*
10241368
1025-| **Name** | **Type** | **Description** |
1026-| --------------- | ---------- | ---------------------------------- |
1027-| fw\_id | u32 | Id of the image |
1028-| flags | u32 | See `METADATA_ENTRY_FLAGS` below |
1029-| digest | u32[48] | Digest of the image |
1030-
1031-
1032-
1033-*Table: `METADATA_ENTRY_FLAGS` input flags*
1034-
1035-| **Name** | **Size (Bits)** | **Description** |
1036-| --------------------- | ----------------- | ----------------- |
1037-| image\_source | 2 | 1: InRequest |
1038-| ignore\_auth\_check | 1 | If set, the image digest is not compared for the firmware id |
1039-
1040-
1041-*Table: `SET_AUTH_MANIFEST` output arguments*
1042-
1043-| **Name** | **Type** | **Description** |
1044-| -------- | -------- | --------------- |
1045-| chksum | u32 | Checksum over other output arguments, computed by Caliptra. Little endian. |
1046-| fips\_status | u32 | Indicates if the command is FIPS approved or an error. |
1047-
1048-
1369+
1370+| **Name** | **Type** | **Description** |
1371+| ------------------------ | --------- | ---------------- |
1372+| Image Hash | u8[48] | SHA2-384 hash of a SOC image. |
1373+
1374+| Image_id | u32 | This corresponds to the `Image Identifier` field in the [SoC Manifest](https://github.com/chipsalliance/caliptra-sw/blob/main-2.x/auth-manifest/README.md)
1375+| Component_id | u32 | This corresponds to the `Component Id` field in the [SoC Manifest](https://github.com/chipsalliance/caliptra-sw/blob/main-2.x/auth-manifest/README.md)
1376+| flags | u32 | This corresponds to the `flags` field in the [SoC Manifest](https://github.com/chipsalliance/caliptra-sw/blob/main-2.x/auth-manifest/README.md)
1377+| Image Load Address High | u32 | This corresponds to the `Image Load Address High` field in the [SoC Manifest](https://github.com/chipsalliance/caliptra-sw/blob/main-2.x/auth-manifest/README.md)
1378+| Image Load Address Low | u32 | This corresponds to the `Image Load Address Low` field in the [SoC Manifest](https://github.com/chipsalliance/caliptra-sw/blob/main-2.x/auth-manifest/README.md)
1379+| Staging Address High | u32 | This corresponds to the `Staging Address High` field in the [SoC Manifest](https://github.com/chipsalliance/caliptra-sw/blob/main-2.x/auth-manifest/README.md)
1380+| Staging Address Low | u32 | This corresponds to the `Staging Address Low` field in the [SoC Manifest](https://github.com/chipsalliance/caliptra-sw/blob/main-2.x/auth-manifest/README.md)
1381+| Classification | u32 | This corresponds to the `Classification` field in the [SoC Manifest](https://github.com/chipsalliance/caliptra-sw/blob/main-2.x/auth-manifest/README.md)
1382+| Version Number | u32 | This corresponds to the `Version Number` field in the [SoC Manifest](https://github.com/chipsalliance/caliptra-sw/blob/main-2.x/auth-manifest/README.md)
1383+| Version String | u8[32] | This corresponds to the `Version String` field in the [SoC Manifest](https://github.com/chipsalliance/caliptra-sw/blob/main-2.x/auth-manifest/README.md)
1384+
1385+### VERIFY_AUTH_MANIFEST
1386+
1387+This command verifies the integrity and authenticity of the provided image manifest, including the `DEBUG_IMAGE` policy described above and the optional device UEID. Unlike `SET_AUTH_MANIFEST`, it performs validation only and does not persist the manifest in DCCM or modify `FW_INFO.debug_policy`. It also rejects a `fw_id` collision with the currently installed owner-only manifest.
1388+
1389+Command Code: `0x4154_564D` ("ATVM")
1390+
1391+The input arguments are the same as the `SET_AUTH_MANIFEST` command.
1392+
1393+
1394+### SET_OWNER_AUTH_MANIFEST
1395+
1396+The SoC uses this command to program an Owner Authorization Manifest, an owner-only authorization document stored independently from the manifest loaded by `SET_AUTH_MANIFEST`. The runtime parses the manifest, verifies its policy fields and Image Metadata Collection (IMC) signatures, and stores the IMC into a dedicated DCCM region. The vendor + owner collection populated by `SET_AUTH_MANIFEST` is never modified by this command.
1397+
1398+Command Code: `0x4F41_4D4E` ("OAMN")
1399+
1400+Verification chain:
1401+
1402+1. The manifest's `owner_pub_keys` are signed by the firmware-image owner key (latched from FMC at boot via `manifest1.preamble.owner_pub_keys`). This signature also covers the policy fields `version`, `svn`, `flags`, and `owner_pub_keys`.
1403+2. The manifest's IMC is signed by the manifest's own `owner_pub_keys`, which were just verified to chain to the firmware-image owner key.
1404+3. The manifest's `svn` is checked against the floor encoded in `SS_STRAP_GENERIC[3][15:8]` (subsystem mode only). The check is skipped when the lifecycle is `Unprovisioned` or anti-rollback is disabled.
1405+
1406+#### Owner Authorization Manifest Minimum SVN
1407+
1408+`SS_STRAP_GENERIC[3][15:8]` carries a binary value in the range `0..255`; it does not carry a fuse bitmap. Before Caliptra starts, MCU firmware is responsible for deriving the owner-manifest minimum SVN from the platform's monotonic storage and programming the resulting integer into this strap. The strap is then locked by `CPTRA_FUSE_WR_DONE`.
1409+
1410+This software interface does not define a new Caliptra fuse field. If a platform uses the same thermometer encoding as the existing SVN fuses, a 256-bit-aligned platform field can use bits 0 through 254 to encode SVN values 1 through 255, with all zeros encoding SVN 0 and bit 255 reserved. The authoritative physical fuse allocation belongs to the SoC/platform fuse-controller specification.
1411+
1412+The maximum IMC capacity is 32 entries. Every active `fw_id` must be unique within this manifest and must not appear in the installed vendor + owner manifest. A collision rejects the command without replacing either active collection. Each successful call replaces the existing owner-only collection.
1413+
1414+*Table: `SET_OWNER_AUTH_MANIFEST` input arguments*
1415+
1416+| **Name** | **Type** | **Description** |
1417+| ------------------------------------- | ------------ | --------------- |
1418+| chksum | u32 | Checksum over other input arguments, computed by the caller. Little endian. |
1419+| manifest size | u32 | The size of the full Owner Authorization Manifest. |
1420+| preamble\_marker | u32 | Marker needs to be `0x4D4F_574F` ("OWOM" little-endian) for the preamble to be valid. |
1421+| preamble\_size | u32 | Size of the Owner Authorization Manifest Preamble. |
1422+| preamble\_version | u32 | Version of the preamble. |
1423+| preamble\_svn | u32 | Security version, range `[0, 255]`. Checked against `SS_STRAP_GENERIC[3][15:8]`. |
1424+| preamble\_flags | u32 | Reserved. Must be zero. |
1425+| preamble\_owner\_ecc384\_key | u32[24] | Owner ECC384 public key carried in the manifest. |
1426+| preamble\_owner\_pqc\_key | u32[648] | Owner MLDSA-87 or LMS-SHA192-H15 public key carried in the manifest. |
1427+| preamble\_owner\_pub\_keys\_ecc\_sig | u32[24] | ECC384 signature by the firmware-image owner key over `version..=owner_pub_keys`. |
1428+| preamble\_owner\_pub\_keys\_pqc\_sig | u32[1157] | PQC signature by the firmware-image owner key over `version..=owner_pub_keys`. |
1429+| preamble\_owner\_imc\_ecc\_sig | u32[24] | ECC384 signature by the manifest's own owner key over the IMC. |
1430+| preamble\_owner\_imc\_pqc\_sig | u32[1157] | PQC signature by the manifest's own owner key over the IMC. |
1431+| metadata\_entry\_count | u32 | Number of metadata entries. Must be `1..=32`. |
1432+| metadata\_entries | Metadata[32] | Image Metadata Entries. Per-entry layout is identical to `SET_AUTH_MANIFEST` (see `AUTH_MANIFEST_METADATA_ENTRY` above). |
1433+
1434+
1435+The response is a `MailboxRespHeader` (no payload).
1436+
1437+
1438+### VERIFY_OWNER_AUTH_MANIFEST
1439+
1440+This command verifies the integrity, authenticity, policy fields, SVN, and firmware-ID collisions of an Owner Authorization Manifest. Unlike `SET_OWNER_AUTH_MANIFEST`, it does not replace the active owner-only metadata collection or update the owner manifest digest or current SVN.
1441+
1442+Command Code: `0x4F41_564D` ("OAVM")
1443+
1444+The input arguments and response are the same as the `SET_OWNER_AUTH_MANIFEST` command.
10491445
10501446 ### AUTHORIZE_AND_STASH
10511447
1448+The SoC uses this command to request authorization of its various SoC images. This command has the option to receive the image hash directly from SoC or from an external source (e.g., SHA Acc).
1449+
1450+The SoC uses this command repeatedly to ask for authorization to run its different images. The Runtime will verify that the image hash is contained in the IMC and will allow or reject the image based on that check. The command also enables stashing of the image hash by default with an option to skip stashing if needed. The SVN field is intended for anti-rollback protection.
1451+
1452+
10521453 Command Code: `0x4154_5348` ("ATSH")
10531454
1054-Privilege Level: PL0 or PL1; stashing the measurement requires PL0, so a PL1 caller must set the `SKIP_STASH` flag
1055-
10561455 *Table: `AUTHORIZE_AND_STASH` input arguments*
10571456
1058-| **Name** | **Type** | **Description** |
1059-| ------------ | -------- | --------------- |
1457+| **Name** | **Type** | **Description**
1458+| ------------| -------- | ---------------
10601459 | chksum | u32 | Checksum over other input arguments, computed by the caller. Little endian. |
10611460 | fw_id | u8[4] | Firmware id of the image, in little-endian format |
1062-| measurement | u8[48] | Digest of the image requested for authorization |
1461+| measurement | u8[48] | Digest of the image requested for authorization. The `source` field needs to be set to '1` for InRequest, otherwise<br />this field is ignored. |
10631462 | context | u8[48] | Context field for `svn`; e.g., a hash of the public key that authenticated the SVN. |
1064-| svn | u32 | SVN |
1463+| svn | u32 | The version of the image |
10651464 | flags | u32 | See AUTHORIZE_AND_STASH_FLAGS below |
1066-| source | u32 | Enumeration values: { InRequest(1) } |
1465+| source | u32 | This field identifies the source of the digest to be used to compare with the SoC's<br />SHA digest in the SoC Manifest<br /><br />Values<br />1 - InRequest - Use the hash in the 'measurement' field of this command<br /><br />2 - LoadAddress - The image located in the `ImageLoadAddress` will be streamed to the SHA Accelerator to <br /> retrieve the digest that will be used for authorization.<br />3 - ImageStagingAddress - The image located in the `StagingAddress` will be streamed to the SHA Accelerator to<br /> retrieve the digest that will be used for authorization |
1466+| image_size | u32 | The size of the image to hash. Only valid if source is `ImageLoadAddress` or `StagingAddress` |
10671467
10681468
10691469 *Table: `AUTHORIZE_AND_STASH_FLAGS` input flags*
1070-
1071-| **Name** | **Value** |
1072-| ------------ | ------------ |
1073-| SKIP\_STASH | 1 << 0 |
1470+| **Bits** | **Name** | **Description** |
1471+| -------- | ------------------ | --------------- |
1472+| 0 | SKIP\_STASH | Skip stashing the authorized measurement. |
1473+| [2:1] | MANIFEST\_SOURCE | `00`: vendor + owner manifest; `01`: owner-only manifest. `10` and `11` are invalid. |
10741474
10751475
10761476 *Table: `AUTHORIZE_AND_STASH` output arguments*
1077-| **Name** | **Type** | **Description**
1078-| ----------------| -------- | ---------------
1477+| **Name** | **Type** | **Description** |
1478+| --------------- | -------- | -------------------------------------------------------------------------- |
10791479 | chksum | u32 | Checksum over other output arguments, computed by Caliptra. Little endian. |
10801480 | fips_status | u32 | Indicates if the command is FIPS approved or an error. |
1081-| auth_req_result | u32 | AUTHORIZE_IMAGE (0xDEADC0DE), IMAGE_NOT_AUTHORIZED (0x21523F21) or IMAGE_HASH_MISMATCH (0x8BFB95CB) |
1082-
1083-
1084-### GET\_IDEVID\_CSR
1085-
1086-Command Code: `0x4944_4352` ("IDCR")
1087-
1088-Privilege Level: PL0 or PL1
1089-
1090-*Table: `GET_IDEVID_CSR` input arguments*
1481+| auth_req_result | u32 | IMAGE_AUTHORIZED_VENDOR_OWNER (0xDEADC0DE, alias of legacy `AUTHORIZE_IMAGE`/`IMAGE_AUTHORIZED`), IMAGE_AUTHORIZED_OWNER_ONLY (0xC0DEDEAD), IMAGE_NOT_AUTHORIZED (0x21523F21) or IMAGE_HASH_MISMATCH (0x8BFB95CB). The success value identifies the selected collection that produced the match. |
1482+
1483+
1484+### GET_IMAGE_INFO
1485+
1486+The MCU uses this command to retrieve the active Image Metadata Entry for a
1487+firmware ID from the collection selected by bits `[2:1]` of `flags`. Requests
1488+must include the `flags` field.
1489+
1490+Command Code: `0x494D_4530` ("IME0")
1491+
1492+*Table: `GET_IMAGE_INFO` input arguments*
1493+
1494+| **Name** | **Type** | **Description** |
1495+| -------------- | -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1496+| chksum | u32 | Checksum over other input arguments, computed by the caller. Little endian. |
1497+| fw_id | u32 | Firmware id of the image, in little-endian format |
1498+| flags | u32 | Bits `[2:1]` select the Image Metadata Collection: `00` selects the vendor + owner manifest; `01` selects the owner-only manifest. `10` and `11` are invalid. All other bits are reserved and must be zero. |
1499+
1500+
1501+*Table: `GET_IMAGE_INFO` output arguments*
1502+
1503+| **Name** | **Type** | **Description** |
1504+| -------------- | -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1505+| chksum | u32 | Checksum over other output arguments, computed by Caliptra. Little endian. |
1506+| fips_status | u32 | Indicates if the command is FIPS approved or an error. |
1507+| Component_id | u32 | This corresponds to the `Component Id` field in the [SoC Manifest](https://github.com/chipsalliance/caliptra-sw/blob/caliptra-2.0/auth-manifest/README.md) |
1508+| flags | u32 | This corresponds to the `flags` field in the [SoC Manifest](https://github.com/chipsalliance/caliptra-sw/blob/caliptra-2.0/auth-manifest/README.md) |
1509+| Image Load Address High | u32 | This corresponds to the `Image Load Address High` field in the [SoC Manifest](https://github.com/chipsalliance/caliptra-sw/blob/caliptra-2.0/auth-manifest/README.md) |
1510+| Image Load Address Low | u32 | This corresponds to the `Image Load Address Low` field in the [SoC Manifest](https://github.com/chipsalliance/caliptra-sw/blob/caliptra-2.0/auth-manifest/README.md) |
1511+| Staging Address High | u32 | This corresponds to the `Staging Address High` field in the [SoC Manifest](https://github.com/chipsalliance/caliptra-sw/blob/caliptra-2.0/auth-manifest/README.md) |
1512+| Staging Address Low | u32 | This corresponds to the `Staging Address Low` field in the [SoC Manifest](https://github.com/chipsalliance/caliptra-sw/blob/caliptra-2.0/auth-manifest/README.md) |
1513+| digest | u8[48] | SHA-384 digest of the image. **Only present in FW 2.0.2+ and 2.1.1+.** |
1514+
1515+
1516+### ACTIVATE_FIRMWARE
1517+
1518+The MCU uses this command to 'activate' the image that has been previously downloaded through PLDM - T5.
1519+For the full behavior of this command, refer to the [Subsystem Support for Hitless Updates](https://github.com/chipsalliance/Caliptra/blob/main/doc/Caliptra.md#subsystem-support-for-hitless-updates) specification.
1520+
1521+For MCU firmware, the selected signed metadata must name the actual installation
1522+address, `MCI_BASE + MCU_SRAM_OFFSET`, in `image_load_address`. Runtime checks
1523+the complete 64-bit load and staging ranges and the MCU SRAM capacity reported
1524+by `HW_CONFIG1` before changing reset or execution state. An inconsistent
1525+destination, wrapping source, or oversized image returns
1526+`IMAGE_VERIFIER_ACTIVATION_FAILED` without installing the image.
1527+
1528+Command Code: `0x4143_5446` ("ACTF")
1529+
1530+*Table: `ACTIVATE_FIRMWARE` input arguments*
1531+
1532+| **Name** | **Type** | **Description** |
1533+| -------------- | -------------- | --------------------------------------------------------------------------- |
1534+| chksum | u32 | Checksum over other input arguments, computed by the caller. Little endian. |
1535+| count | u32 | Number of image_ids to activate. Item count of image_ids array parameter |
1536+| mcu_image_size | u32 | Size of MCU image, if included in the activation |
1537+| image_ids | Array of u8[4] | Array of Image ids in little-endian format |
1538+| flags | u32 | Optional. Bits `[2:1]` select the manifest as in `GET_IMAGE_INFO`. All other bits, including bit 0 (`INITIAL_ACTIVATE` on newer runtimes), are reserved and must be zero on Caliptra 2.0. |
1539+
1540+
1541+Legacy 524-byte requests omit `flags` and select the vendor + owner collection.
1542+Unknown flag bits or reserved manifest selectors are rejected with
1543+`RUNTIME_MAILBOX_INVALID_PARAMS`.
1544+
1545+*Table: `ACTIVATE_FIRMWARE` output arguments*
1546+
1547+| **Name** | **Type** | **Description** |
1548+| -------------- | -------------- | -------------------------------------------------------------------------- |
1549+| chksum | u32 | Checksum over other output arguments, computed by Caliptra. Little endian. |
1550+| fips_status | u32 | Indicates if the command is FIPS approved or an error. |
1551+
1552+
1553+## Mailbox commands: Cryptographic Mailbox (2.0)
1554+
1555+These commands are used by the [Cryptograhic Mailbox](#cryptographic-mailbox-commands-new-in-20) system.
1556+
1557+### CM_SHA_INIT
1558+
1559+This starts the computation of a SHA hash of data, which may be larger than a single mailbox command allows. It also supports additional algorithms.
1560+
1561+**Note:** ROM provides a simpler one-shot `CM_SHA` command for hashing data in a single operation. However, that command is ROM-only and is not available in runtime. For runtime, use these streaming commands (CM_SHA_INIT, CM_SHA_UPDATE, CM_SHA_FINAL) which support contexts and incremental hashing of large data.
1562+
1563+The sequence to use these are:
1564+* 1 `CM_SHA_INIT` command
1565+* 0 or more `CM_SHA_UPDATE` commands
1566+* 1 `CM_SHA_FINAL` command
1567+
1568+For each command, the context from the previous command's output must be passed as an input.
1569+
1570+The `SHA_CONTEXT_SIZE` is always exactly 200 bytes long.
1571+
1572+The maximum supported data size for the SHA commands is 4096 bytes.
1573+
1574+Command Code: `0x434D_5349` ("CMSI")
1575+
1576+*Table: `CM_SHA_INIT` input arguments*
1577+
1578+| **Name** | **Type** | **Description** |
1579+| -------------- | ------------- | ------------------ |
1580+| chksum | u32 ||
1581+| hash algorithm | u32 | Enum. |
1582+||| Value 0 = reserved |
1583+||| Value 1 = SHA2-384 |
1584+||| Value 2 = SHA2-512 |
1585+| data size | u32 ||
1586+| data | u8[data size] | Data to hash |
1587+
1588+
1589+*Table: `CM_SHA_INIT` output arguments*
1590+| **Name** | **Type** | **Description** |
1591+| ------------ | -------------------- | ------------------------------------------ |
1592+| chksum | u32 ||
1593+| fips_status | u32 | FIPS approved or an error |
1594+| context | u8[SHA_CONTEXT_SIZE] | Passed to `CM_SHA_UPDATE` / `CM_SHA_FINAL` |
1595+
1596+
1597+*Table: `CM_SHA_INIT` / `CM_SHA_UPDATE` / `CM_SHA_FINAL` internal context*
1598+| **Name** | **Type** | **Description** |
1599+| ----------------- | -------- | --------------- |
1600+| input buffer | u8[128] ||
1601+| intermediate hash | u8[64] ||
1602+| length | u32 ||
1603+| hash algorithm | u32 ||
1604+
1605+
1606+### CM_SHA_UPDATE
1607+
1608+This continues a SHA computation started by `CM_SHA_INIT` or from another `CM_SHA_UPDATE`.
1609+
1610+The context MUST be passed in from `CM_SHA_INIT` or `CM_SHA_UPDATE`.
1611+
1612+Command Code: `0x434D_5355` ("CMSU")
1613+
1614+*Table: `CM_SHA_UPDATE` input arguments*
1615+| **Name** | **Type** | **Description** |
1616+| ------------ | -------------------- | ------------------------------------ |
1617+| chksum | u32 ||
1618+| context | u8[SHA_CONTEXT_SIZE] | From `CM_SHA_INIT` / `CM_SHA_UPDATE` |
1619+| data size | u32 ||
1620+| data | u8[data size] | Data to hash |
1621+
1622+
1623+*Table: `CM_SHA_UPDATE` output arguments*
1624+| **Name** | **Type** | **Description** |
1625+| ------------ | -------------------- | ------------------------------------------ |
1626+| chksum | u32 ||
1627+| fips_status | u32 | FIPS approved or an error |
1628+| context | u8[SHA_CONTEXT_SIZE] | Passed to `CM_SHA_UPDATE` / `CM_SHA_FINAL` |
1629+
1630+
1631+### CM_SHA_FINAL
1632+
1633+This finalizes the computation of a SHA and produces the hash of all of the data.
1634+
1635+The context MUST be passed in from `CM_SHA_INIT` or `CMA_SHA_UPDATE`.
1636+
1637+Command Code: `0x434D_5346` ("CMSF")
1638+
1639+*Table: `CM_SHA_FINAL` input arguments*
1640+| **Name** | **Type** | **Description** |
1641+| ------------ | -------------------- | ------------------------------------ |
1642+| chksum | u32 ||
1643+| context | u8[SHA_CONTEXT_SIZE] | From `CM_SHA_INIT` / `CM_SHA_UPDATE` |
1644+| data size | u32 | May be 0 |
1645+| data | u8[data size] | Data to hash |
1646+
1647+
1648+*Table: `CM_SHA_FINAL` output arguments*
1649+| **Name** | **Type** | **Description** |
1650+| ----------- | ------------- | ------------------------- |
1651+| chksum | u32 ||
1652+| fips_status | u32 | FIPS approved or an error |
1653+| hash size | u32 ||
1654+| hash | u8[hash size] ||
1655+
1656+
1657+### CM\_HMAC
1658+
1659+Computes an HMAC according to [RFC 2104](https://datatracker.ietf.org/doc/html/rfc2104) with select SHA algorithm support. The data must fit into a single mailbox command.
1660+
1661+The CMK must have been created for HMAC / HKDF usage.
1662+
1663+Command Code: `0x434D_484D` ("CMHM")
1664+
1665+*Table: `CM_HMAC` input arguments*
1666+| **Name** | **Type** | **Description** |
1667+| -------------- | ------------- | ----------------- |
1668+| chksum | u32 ||
1669+| CMK | CMK | CMK to use as key |
1670+| hash algorithm | u32 | Enum. |
1671+||| 0 = reserved |
1672+||| 1 = SHA2-384 |
1673+||| 2 = SHA2-512 |
1674+| data size | u32 ||
1675+| data | u8[data size] | Data to MAC |
1676+
1677+
1678+
1679+*Table: `CM_HMAC` output arguments*
1680+| **Name** | **Type** | **Description** |
1681+| ----------- | ------------ | ------------------------- |
1682+| chksum | u32 ||
1683+| fips_status | u32 | FIPS approved or an error |
1684+| mac size | u32 ||
1685+| mac | u8[mac size] ||
1686+
1687+
1688+### CM_HMAC_KDF_COUNTER
1689+
1690+Implements HMAC KDF in Counter Moder as specified in as specified in [RFC 5869](https://www.rfc-editor.org/rfc/rfc5869.html) and [NIST SP800-108](https://csrc.nist.gov/pubs/sp/800/108/r1/upd1/final) Section 4.1 (KDF in Counter Mode, Section 4.1).
1691+
1692+The CMK must have been created for HMAC usage.
1693+
1694+The output length will be automatically chosen to match the key usage.
1695+
1696+Command Code: `0x434D_4B43` ("CMKC")
1697+
1698+*Table: `CM_HMAC_KDF_COUNTER` input arguments*
1699+| **Name** | **Type** | **Description** |
1700+| -------------- | -------------- | ------------------------- |
1701+| chksum | u32 ||
1702+| KIN CMK | CMK | Input key |
1703+| hash algorithm | u32 | Enum. |
1704+||| Value 0 = reserved |
1705+||| Value 1 = SHA2-384 |
1706+||| Value 2 = SHA2-512 |
1707+| key usage | u32 | usage tag of output key |
1708+| key size | u32 | size (in bytes) for the output key; MUST be valid for the key usage |
1709+| label size | u32 ||
1710+| label | u8[label size] ||
1711+
1712+
1713+*Table: `CM_HMAC_KDF_COUNTER` output arguments*
1714+| **Name** | **Type** | **Description** |
1715+| ----------- | -------- | --------------------------------------- |
1716+| chksum | u32 ||
1717+| fips_status | u32 | FIPS approved or an error |
1718+| KOUT CMK | CMK | CMK that stores the output key material |
1719+
1720+
1721+### CM_HKDF_EXTRACT
1722+
1723+Implements HKDF-Extract as specified in [RFC 5869](https://www.rfc-editor.org/rfc/rfc5869.html).
1724+
1725+The CMKs for IKM and salt must have been created for HMAC usage. The output will be tagged for HMAC usage.
1726+
1727+Use CM_IMPORT to import non-secret (plaintext) salt or IKMs to use
1728+with HKDF-Extract after right-padding to 48 or 64 bytes with zeros.
1729+
1730+Command Code: `0x434D_4B54` ("CMKT")
1731+
1732+*Table: `CM_HKDF_EXTRACT` input arguments*
1733+| **Name** | **Type** | **Description** |
1734+| -------------- | -------- | ------------------------- |
1735+| chksum | u32 ||
1736+| hash algorithm | u32 | Enum. |
1737+||| Value 0 = reserved |
1738+||| Value 1 = SHA2-384 |
1739+||| Value 2 = SHA2-512 |
1740+| salt CMK | CMK | Salt CMK. |
1741+| IKM CMK | CMK | Input key material CMK |
1742+
1743+
1744+*Table: `CM_HKDF_EXTRACT` output arguments*
1745+| **Name** | **Type** | **Description** |
1746+| ----------- | -------- | --------------------------------------- |
1747+| chksum | u32 ||
1748+| fips_status | u32 | FIPS approved or an error |
1749+| PRK CMK | u8[32] | CMK that stores the output (PRK) to use |
1750+||| with HKDF-Expand |
1751+
1752+
1753+### CM_HKDF_EXPAND
1754+
1755+Implements HKDF-Expand as specified in [RFC 5869](https://www.rfc-editor.org/rfc/rfc5869.html).
1756+
1757+The CMK must have been created for HMAC usage.
1758+
1759+The output length will be automatically chosen to match the key usage.
1760+
1761+Command Code: `0x434D_4B50` ("CMKP")
1762+
1763+*Table: `CM_HKDF_EXPAND` input arguments*
1764+| **Name** | **Type** | **Description** |
1765+| -------------- | ------------- | ------------------------------- |
1766+| chksum | u32 ||
1767+| PRK CMK | CMK ||
1768+| hash algorithm | u32 | Enum. |
1769+||| Value 0 = reserved |
1770+||| Value 1 = SHA2-384 |
1771+||| Value 2 = SHA2-512 |
1772+| key usage | u32 | usage tag of output key |
1773+| key size | u32 | size (in bytes) for the OKM; |
1774+||| MUST be valid for the key usage |
1775+| info size | u32 ||
1776+| info | u8[info size] ||
1777+
1778+
1779+*Table: `CM_HKDF_EXPAND` output arguments*
1780+Command Code: `0x434D_4B43` ("CMKC")
1781+
1782+| **Name** | **Type** | **Description** |
1783+| ----------- | -------- | --------------------------------------- |
1784+| chksum | u32 ||
1785+| fips_status | u32 | FIPS approved or an error |
1786+| OKM CMK | CMK | CMK that stores the output key material |
1787+
1788+
1789+
1790+### CM_MLDSA_PUBLIC_KEY
1791+
1792+Returns the public key associated with the MLDSA-87 key (seed) in a CMK.
1793+
1794+The public key format is described in [FIPS 204](https://csrc.nist.gov/pubs/fips/204/final).
1795+
1796+Command Code: `0x434D_4D50` ("CMMP")
1797+
1798+*Table: `CM_MLDSA_PUBLIC_KEY` input arguments*
1799+| **Name** | **Type** | **Description** |
1800+| -------- | -------- | ----------------- |
1801+| chksum | u32 ||
1802+| CMK | CMK | Private key seed |
1803+
1804+
1805+*Table: `CM_MLDSA_PUBLIC_KEY` output arguments*
1806+| **Name** | **Type** | **Description** |
1807+| ----------- | -------- | -------------------------- |
1808+| chksum | u32 ||
1809+| fips_status | u32 | FIPS approved or an error |
1810+| Public key | u8[2592] | Public key |
1811+
1812+
1813+### CM_MLDSA_SIGN
1814+
1815+Signs the message with the MLDSA-87 key.
1816+
1817+The signature format is described in [FIPS 204](https://csrc.nist.gov/pubs/fips/204/final).
1818+
1819+Command Code: `0x434D_4D53` ("CMMS")
1820+
1821+*Table: `CM_MLDSA_SIGN` input arguments*
1822+| **Name** | **Type** | **Description** |
1823+| -------- | ------------ | ----------------- |
1824+| chksum | u32 ||
1825+| CMK | CMK | Private key seed |
1826+| data len | u32 | Length of message |
1827+| data | u8[data len] | Message to sign |
1828+
1829+
1830+*Table: `CM_MLDSA_SIGN` output arguments*
1831+| **Name** | **Type** | **Description** |
1832+| ----------- | -------- | -------------------------- |
1833+| chksum | u32 ||
1834+| fips_status | u32 | FIPS approved or an error |
1835+| signature | u8[4627] | Signature |
1836+| padding | u8[1] ||
1837+
1838+
1839+### CM_MLDSA_VERIFY
1840+
1841+Verifies the signature against the message and MLDSA-87 key.
1842+
1843+The signature format is described in [FIPS 204](https://csrc.nist.gov/pubs/fips/204/final).
1844+
1845+The command will only return a success if the signature is valid.
1846+
1847+Command Code: `0x434D_4D56` ("CMMV")
1848+
1849+*Table: `CM_MLDSA_VERIFY` input arguments*
1850+| **Name** | **Type** | **Description** |
1851+| --------- | ------------ | ------------------ |
1852+| chksum | u32 ||
1853+| CMK | CMK | Private key seed |
1854+| signature | u8[4627] | Signature to check |
1855+| padding | u8[1] ||
1856+| data len | u32 | Length of message |
1857+| data | u8[data len] | Message to check |
1858+
1859+
1860+*Table: `CM_MLDSA_VERIFY` output arguments*
1861+| **Name** | **Type** | **Description** |
1862+| ----------- | -------- | -------------------------- |
1863+| chksum | u32 ||
1864+| fips_status | u32 | FIPS approved or an error |
1865+
1866+
1867+### CM_ECDSA_PUBLIC_KEY
1868+
1869+Returns the public key associated with the ECDSA-384 key seed in a CMK.
1870+
1871+The public key consists of its `x` and `y` values described in [FIPS 186-5](https://csrc.nist.gov/pubs/fips/186-5/final) encoded in big-endian byte order.
1872+
1873+Command Code: `0x434D_4550` ("CMEP")
1874+
1875+*Table: `CM_ECDSA_PUBLIC_KEY` input arguments*
1876+| **Name** | **Type** | **Description** |
1877+| -------- | -------- | ----------------- |
1878+| chksum | u32 ||
1879+| CMK | CMK | Private key seed |
1880+
1881+
1882+*Table: `CM_ECDSA_PUBLIC_KEY` output arguments*
1883+| **Name** | **Type** | **Description** |
1884+| ----------- | -------- | -------------------------- |
1885+| chksum | u32 ||
1886+| fips_status | u32 | FIPS approved or an error |
1887+| pubkey_x | u8[48] | The X BigNum of the ECDSA public key generated from the seed |
1888+| pubkey_y | u8[48] | The Y BigNum of the ECDSA public key generated from the seed |
1889+
1890+
1891+### CM_ECDSA_SIGN
1892+
1893+Signs the SHA384 hash of the message with the ECDSA-384 key.
1894+
1895+The signature consists of its `r` and `s` values described in [FIPS 186-5](https://csrc.nist.gov/pubs/fips/186-5/final) encoded in big-endian byte order.
1896+
1897+Command Code: `0x434D_5D53` ("CMES")
1898+
1899+*Table: `CM_ECDSA_SIGN` input arguments*
1900+| **Name** | **Type** | **Description** |
1901+| -------- | ------------ | ----------------- |
1902+| chksum | u32 ||
1903+| CMK | CMK | Private key seed |
1904+| data len | u32 | Length of message |
1905+| data | u8[data len] | Message to sign |
1906+
1907+
1908+*Table: `CM_ECDSA_SIGN` output arguments*
1909+| **Name** | **Type** | **Description** |
1910+| ------------ | -------- | ------------------------------------ |
1911+| chksum | u32 ||
1912+| fips_status | u32 | FIPS approved or an error |
1913+| signature_r | u8[48] | The R BigNum of the ECDSA signature |
1914+| signature_s | u8[48] | The S BigNum of the ECDSA signature |
1915+
1916+
1917+### CM_ECDSA_VERIFY
1918+
1919+Verifies the signature against the SHA384 hash of the message and ECDSA-384 key.
1920+
1921+The signature consists of its `r` and `s` values described in [FIPS 186-5](https://csrc.nist.gov/pubs/fips/186-5/final) encoded in big-endian byte order.
1922+
1923+The command will only return a success if the signature is valid.
1924+
1925+Command Code: `0x434D_4556` ("CMEV")
1926+
1927+*Table: `CM_ECDSA_VERIFY` input arguments*
1928+| **Name** | **Type** | **Description** |
1929+| ------------ | ------------ | ----------------------------------- |
1930+| chksum | u32 ||
1931+| CMK | CMK | Private key seed |
1932+| signature_r | u8[48] | The R BigNum of an ECDSA signature |
1933+| signature_s | u8[48] | The S BigNum of an ECDSA signature |
1934+| data len | u32 | Length of message |
1935+| data | u8[data len] | Message to check |
1936+
1937+
1938+*Table: `CM_ECDSA_VERIFY` output arguments*
1939+| **Name** | **Type** | **Description** |
1940+| ----------- | -------- | -------------------------- |
1941+| chksum | u32 ||
1942+| fips_status | u32 | FIPS approved or an error |
1943+
1944+
1945+### CM_AES_ENCRYPT_INIT
1946+
1947+Generic AES operation for unauthenticated AES operations.
1948+AES GCM operations use separate commands elsewhere.
1949+
1950+AES-256-CBC only supports using a random 128-bit IV.
1951+
1952+For CBC, the size must be a multiple of 16 bytes.
1953+CTR mode supports input of any size up to the maximum cryptographic mailbox size.
1954+
1955+The CMK must have been created for AES usage.
1956+
1957+Command Code: `0x434D_4349` ("CMCI")
1958+
1959+*Table: `CM_AES_ENCRYPT_INIT` input arguments*
1960+| **Name** | **Type** | **Description** |
1961+| -------------- | ------------------ | ------------------------------------- |
1962+| chksum | u32 ||
1963+| CMK | CMK | CMK of the key to use to encrypt |
1964+| mode/flags | u32 | Requested mode and flags. |
1965+||| 0 = Reserved |
1966+||| 1 = CBC |
1967+||| 2 = CTR |
1968+| plaintext size | u32 | MUST be non-zero |
1969+| plaintext | u8[plaintext size] | Data to encrypt |
1970+
1971+
1972+*Table: `CM_AES_ENCRYPT_INIT` output arguments*
1973+| **Name** | **Type** | **Description** |
1974+| --------------- | ------------------- | -------------------------------- |
1975+| chksum | u32 ||
1976+| fips_status | u32 | FIPS approved or an error |
1977+| context | AES_CONTEXT ||
1978+| iv | u8[16] ||
1979+| ciphertext size | u32 ||
1980+| ciphertext | u8[ciphertext size] | Output encrypted data |
1981+
1982+
1983+The encrypted and authenticated context's internal structure will be:
1984+
1985+*Table: internal context for CM_AES_* operations*
1986+| **Name** | **Type** | **Description** |
1987+| -------------- | -------- | ------------------------------ |
1988+| mode | u32 ||
1989+| key | u8[32] ||
1990+| iv | u8[16] ||
1991+| fips_status | u8 | 1 = FIPS valid |
1992+| reserved | u8[75] | Reserved for additional fields |
1993+
1994+
1995+The size of the (encrypted) context is always exactly 156 bytes,
1996+and we will use the type `AES_CONTEXT` to represent `u8[156]`.
1997+
1998+### CM_AES_ENCRYPT_UPDATE
1999+
2000+This continues (or finishes) an AES computation started by `CM_AES_ENCRYPT_INIT` or from another `CM_AES_ENCRYPT_UPDATE`.
2001+
2002+There is no `CM_AES_ENCRYPT_FINISH` since unauthenticated AES modes do not output a final tag.
2003+
2004+The context MUST be passed in from `CM_AES_ENCRYPT_INIT` or `CM_AES_ENCRYPT_UPDATE`.
2005+
2006+For CBC, the size must be a multiple of 16 bytes.
2007+CTR mode supports input of any size up to the maximum cryptographic mailbox size.
2008+
2009+Command Code: `0x434D_4355` ("CMCU")
2010+
2011+*Table: `CM_AES_ENCRYPT_UPDATE` input arguments*
2012+| **Name** | **Type** | **Description** |
2013+| -------------- | ------------------ | ---------------- |
2014+| chksum | u32 ||
2015+| context | AES_CONTEXT ||
2016+| plaintext size | u32 | MUST be non-zero |
2017+| plaintext | u8[plaintext size] | Data to encrypt |
2018+
2019+
2020+*Table: `CM_AES_ENCRYPT_UPDATE` output arguments*
2021+| **Name** | **Type** | **Description** |
2022+| -------------- | ------------------- | ------------------------- |
2023+| chksum | u32 ||
2024+| fips_status | u32 | FIPS approved or an error |
2025+| context | AES_CONTEXT ||
2026+| cipertext size | u32 ||
2027+| ciphertext | u8[ciphertext size] ||
2028+
2029+
2030+### CM_AES_DECRYPT_INIT
2031+
2032+Starts an AES-256 unauthenaticed decryption computation.
2033+
2034+The CMK must have been created for AES usage.
2035+
2036+For CBC, the size must be a multiple of 16 bytes.
2037+CTR mode supports input of any size up to the maximum cryptographic mailbox size.
2038+
2039+The IV must match what was passed and returned from the initial encryption operation.
2040+
2041+Command Code: `0x434D_414A` ("CMAJ")
2042+
2043+*Table: `CM_AES_DECRYPT_INIT` input arguments*
2044+| **Name** | **Type** | **Description** |
2045+| --------------- | ------------------- | ------------------------- |
2046+| chksum | u32 ||
2047+| CMK | CMK | CMK to use for decryption |
2048+| mode/flags | u32 | Requested mode and flags. |
2049+||| 0 = Reserved |
2050+||| 1 = CBC |
2051+||| 2 = CTR |
2052+| iv | u8[16] ||
2053+| ciphertext size | u32 | MUST be non-zero |
2054+| ciphertext | u8[ciphertext size] | Data to decrypt |
2055+
2056+
2057+*Table: `CM_AES_DECRYPT_INIT` output arguments*
2058+| **Name** | **Type** | **Description** |
2059+| -------------- | ------------------ | ------------------------- |
2060+| chksum | u32 ||
2061+| fips_status | u32 | FIPS approved or an error |
2062+| context | AES_CONTEXT ||
2063+| plaintext size | u32 ||
2064+| plaintext | u8[plaintext size] | Decrypted data |
2065+
2066+
2067+The encrypted and authenticated context's internal structure will be the same as for encryption.
2068+
2069+### CM_AES_DECRYPT_UPDATE
2070+
2071+This continues an AES computation started by `CM_AES_DECRYPT_INIT` or from another `CM_AES_DECRYPT_UPDATE`.
2072+
2073+There is no `CM_AES_DECRYPT_FINISH` since unauthenticated modes do not output a final tag.
2074+
2075+The context MUST be passed in from `CM_AES_DECRYPT_INIT` or `CM_AES_DECRYPT_UPDATE`.
2076+
2077+For CBC, the size must be a multiple of 16 bytes.
2078+CTR mode supports input of any size up to the maximum cryptographic mailbox size.
2079+
2080+Command Code: `0x434D_4155` ("CMAU")
2081+
2082+*Table: `CM_AES_DECRYPT_UPDATE` input arguments*
2083+| **Name** | **Type** | **Description** |
2084+| --------------- | ------------------- | ---------------- |
2085+| chksum | u32 ||
2086+| context | AES_CONTEXT ||
2087+| ciphertext size | u32 | MUST be non-zero |
2088+| ciphertext | u8[ciphertext size] | Data to decrypt |
2089+
2090+
2091+*Table: `CM_AES_DECRYPT_UPDATE` output arguments*
2092+| **Name** | **Type** | **Description** |
2093+| -------------- | ------------------ | ------------------------- |
2094+| chksum | u32 ||
2095+| fips_status | u32 | FIPS approved or an error |
2096+| context | AES_CONTEXT ||
2097+| plaintext size | u32 ||
2098+| plaintext | u8[plaintext size] | Decrypted data |
2099+
2100+
2101+### CM_AES_GCM_ENCRYPT_INIT
2102+
2103+Currently only supports AES-256-GCM with a random 96-bit IV.
2104+
2105+Additional authenticated data (AAD) can only be passed during the `INIT` command, so is limited to the maximum cryptographic mailbox data size (4096 bytes).
2106+
2107+The CMK must have been created for AES usage, except if the SPDM mode flag has been used, in which case the CMK must have been created for HMAC usage.
2108+
2109+Command Code: `0x434D_4749` ("CMGI")
2110+
2111+*Table: `CM_AES_GCM_ENCRYPT_INIT` input arguments*
2112+| **Name** | **Type** | **Description** |
2113+| -------------- | ------------------ | -------------------------------- |
2114+| chksum | u32 ||
2115+| reserved | u32 ||
2116+| CMK | CMK | CMK of the key to use to encrypt |
2117+| aad size | u32 ||
2118+| aad | u8[aad size] | Additional authenticated data |
2119+
2120+
2121+*Table: `CM_AES_GCM_ENCRYPT_INIT` output arguments*
2122+| **Name** | **Type** | **Description** |
2123+| -------------- | ------------------- | -------------------------------- |
2124+| chksum | u32 ||
2125+| fips_status | u32 | FIPS approved or an error |
2126+| context | AES_GCM_CONTEXT ||
2127+| iv | u8[12] ||
2128+
2129+
2130+The encrypted and authenticated context's internal structure will be:
2131+
2132+*Table: internal context for CM_AES_GCM_ENCRYPT_* operations*
2133+| **Name** | **Type** | **Description** |
2134+| -------------- | -------- | --------------------------- |
2135+| key | u8[32] ||
2136+| iv | u8[12] ||
2137+| aad length | u32 ||
2138+| GHASH state | u8[16] ||
2139+| current length | u32 | value mod 16 is buffer size |
2140+| buffer | u8[16] ||
2141+| fips_status | u8 | 1 = FIPS valid |
2142+| reserved | u8[15] ||
2143+
2144+
2145+The size of the (encrypted) context is always exactly 128 bytes,
2146+and we will use the type `AES_GCM_CONTEXT` to represent `u8[128]` below.
2147+
2148+
2149+### CM_AES_GCM_SPDM_ENCRYPT_INIT
2150+
2151+Derives the AES key and IV following the [SPDM 1.4](https://www.dmtf.org/dsp/dsp0274) and [Secured Messages using SPDM 1.1](https://www.dmtf.org/dsp/dsp0277) specifications.
2152+
2153+Currently only supports AES-256-GCM.
2154+
2155+Additional authenticated data (AAD) can only be passed during the `INIT` command, so is limited to the maximum cryptographic mailbox data size (4096 bytes).
2156+
2157+The CMK must have been created for **HMAC** usage.
2158+
2159+The CMK passed in should be the SPDM major secret CMK created for HMAC usage. The key and IV used for encryption shall follow the [SPDM 1.4](https://www.dmtf.org/dsp/dsp0274) section 12.7 derivation with `key_length` equal to 32 bytes and `iv_length` equal to 12 bytes.
2160+
2161+```
2162+EncryptionKey = HKDF-Expand(major-secret, bin_str5, key_length);
2163+IV = HKDF-Expand(major-secret, bin_str6, iv_length);
2164+bin_str5 = BinConcat(key_length, Version, "key", null);
2165+bin_str6 = BinConcat(iv_length, Version, "iv", null);
2166+```
2167+
2168+The provided 64-bit message counter will be XOR'd with the IV to produce the message IV. The Secure SPDM standard requires the counter endianness flag to be little, but big endian is also supported to aid in compatibility with some implementations.
2169+
2170+Note that it is **critical** that the same CMK and counter never be used more than once when encrypting or decrypting in SPDM mode as doing so could compromise the plaintext of the messages.
2171+
2172+For the update and final operations, there are not any SPDM-specific commands; `CM_AES_GCM_ENCRYPT_UPDATE` and `CM_AES_GCM_ENCRYPT_FINAL` should be used.
2173+
2174+Command Code: `0x434D_5345` ("CMSE")
2175+
2176+*Table: `CM_AES_GCM_SPDM_ENCRYPT_INIT` input arguments*
2177+| **Name** | **Type** | **Description** |
2178+| ------------------ | ------------------ | --------------------------------- |
2179+| chksum | u32 ||
2180+| spdm version | u8 | The value should be equal to the |
2181+||| byte representation of the SPDM |
2182+||| version, e.g., 0x13 = SPDM 1.3 |
2183+| counter endianness | u8 | XOR the counter with the IV using |
2184+||| the given endianness. |
2185+||| 0 = Little endian (standard) |
2186+||| 1 = Big endian |
2187+| reserved | u8[2] | Reserved |
2188+| counter | u8[8] | 8-byte counter in little-endian |
2189+||| format that is XOR'd into the IV |
2190+| CMK | CMK | CMK of the key to use to encrypt |
2191+| aad size | u32 ||
2192+| aad | u8[aad size] | Additional authenticated data |
2193+
2194+
2195+*Table: `CM_AES_GCM_SPDM_ENCRYPT_INIT` output arguments*
2196+| **Name** | **Type** | **Description** |
2197+| -------------- | ------------------- | -------------------------------- |
2198+| chksum | u32 ||
2199+| fips_status | u32 | FIPS approved or an error |
2200+| context | AES_GCM_CONTEXT ||
2201+
2202+
2203+Unlike in the standard AES GCM encrypt init command, the IV is *not* returned.
2204+
2205+The encrypted and authenticated context's internal structure will be the same as for described in [CM_AES_GCM_ENCRYPT_INIT](#CM_AES_GCM_ENCRYPT_INIT).
2206+
2207+### CM_AES_GCM_ENCRYPT_UPDATE
2208+
2209+This continues an AES computation started by `CM_AES_GCM_ENCRYPT_INIT` or from another `CM_AES_GCM_ENCRYPT_UPDATE`.
2210+
2211+The context MUST be passed in from `CM_AES_GCM_ENCRYPT_INIT` or `CM_AES_GCM_ENCRYPT_UPDATE`.
2212+
2213+Command Code: `0x434D_4755` ("CMGU")
2214+
2215+*Table: `CM_AES_GCM_ENCRYPT_UPDATE` input arguments*
2216+| **Name** | **Type** | **Description** |
2217+| -------------- | ------------------ | ---------------- |
2218+| chksum | u32 ||
2219+| context | AES_GCM_CONTEXT ||
2220+| plaintext size | u32 | MUST be non-zero |
2221+| plaintext | u8[plaintext size] | Data to encrypt |
2222+
2223+
2224+*Table: `CM_AES_GCM_ENCRYPT_UPDATE` output arguments*
2225+| **Name** | **Type** | **Description** |
2226+| -------------- | ------------------- | ------------------------------- |
2227+| chksum | u32 ||
2228+| fips_status | u32 | FIPS approved or an error |
2229+| context | AES_GCM_CONTEXT ||
2230+| cipertext size | u32 | could be greater than plaintext by 16 bytes |
2231+| ciphertext | u8[ciphertext size] ||
2232+
2233+
2234+### CM_AES_GCM_ENCRYPT_FINAL
2235+
2236+This finalizes the computation of the AES GCM encryption and produces the final ciphertext and tag.
2237+
2238+The context MUST be passed in from `CM_AES_GCM_ENCRYPT_INIT` or `CM_AES_GCM_ENCRYPT_UPDATE`.
2239+
2240+Command Code: `0x434D_4746` ("CMGF")
2241+
2242+*Table: `CM_AES_GCM_ENCRYPT_FINAL` input arguments*
2243+| **Name** | **Type** | **Description** |
2244+| -------------- | ------------------ | --------------- |
2245+| chksum | u32 ||
2246+| context | AES_GCM_CONTEXT ||
2247+| plaintext size | u32 | MAY be 0 |
2248+| plaintext | u8[plaintext size] | Data to encrypt |
2249+
2250+
2251+*Table: `CM_AES_GCM_ENCRYPT_FINAL` output arguments*
2252+| **Name** | **Type** | **Description** |
2253+| -------------- | ------------------- | -------------------------------- |
2254+| chksum | u32 ||
2255+| fips_status | u32 | FIPS approved or an error |
2256+| tag | u8[16] ||
2257+| cipertext size | u32 | could be greater than plaintext by 16 bytes |
2258+| ciphertext | u8[ciphertext size] ||
2259+
2260+
2261+The tag returned will always be 16 bytes. Shorter tags can be constructed by truncating.
2262+
2263+### CM_AES_GCM_DECRYPT_INIT
2264+
2265+Starts an AES-256-GCM decryption computation.
2266+
2267+Currently only supports AES-256-GCM with a 96-bit IV.
2268+
2269+Additional authenticated data (AAD) can only be passed during the `INIT` command, so is limited to the maximum cryptographic mailbox data size (4096 bytes).
2270+
2271+The AAD and IV must match what was passed and returned from the encryption operation.
2272+
2273+The CMK must have been created for **AES** usage.
2274+
2275+Command Code: `0x434D_4449` ("CMDI")
2276+
2277+*Table: `CM_AES_GCM_DECRYPT_INIT` input arguments*
2278+| **Name** | **Type** | **Description** |
2279+| --------------- | ------------ | -------------------------------- |
2280+| chksum | u32 ||
2281+| reserved | u32 | Reserved |
2282+| CMK | CMK | CMK to use for decryption |
2283+| iv | u8[12] ||
2284+| aad size | u32 ||
2285+| aad | u8[aad size] | Additional authenticated data |
2286+
2287+
2288+*Table: `CM_AES_GCM_DECRYPT_INIT` output arguments*
2289+| **Name** | **Type** | **Description** |
2290+| -------------- | ------------------ | ------------------------- |
2291+| chksum | u32 ||
2292+| fips_status | u32 | FIPS approved or an error |
2293+| context | AES_GCM_CONTEXT ||
2294+
2295+
2296+The encrypted and authenticated context's internal structure will be the same as for encryption.
2297+
2298+### CM_AES_SPDM_GCM_DECRYPT_INIT
2299+
2300+Starts an AES-256-GCM decryption computation in SPDM mode.
2301+
2302+Currently only supports AES-256-GCM with a 96-bit IV.
2303+
2304+Additional authenticated data (AAD) can only be passed during the `INIT` command, so is limited to the maximum cryptographic mailbox data size (4096 bytes).
2305+
2306+The AAD must match what was passed and returned from the encryption operation.
2307+
2308+The CMK must have been created for **HMAC** usage.
2309+
2310+The CMK passed in should be the SPDM major secret CMK created for HMAC usage. The key and IV used for encryption shall follow the [SPDM 1.4](https://www.dmtf.org/dsp/dsp0274) section 12.7 derivation with `key_length` 256 and `iv_length` 96.
2311+
2312+```
2313+EncryptionKey = HKDF-Expand(major-secret, bin_str5, key_length);
2314+IV = HKDF-Expand(major-secret, bin_str6, iv_length);
2315+bin_str5 = BinConcat(key_length, Version, "key", null);
2316+bin_str6 = BinConcat(iv_length, Version, "iv", null);
2317+```
2318+
2319+The provided 64-bit message counter will be XOR'd with the IV to produce the message IV. The Secure SPDM standard requires the counter endianness flag to be little, but big endian is also supported to aid in compatibility with some implementations.
2320+
2321+Note that it is **critical** that the same CMK and counter never be used more than once when encrypting or decrypting in SPDM mode as doing so could compromise the plaintext of the messages.
2322+
2323+Command Code: `0x434D_5344` ("CMSD")
2324+
2325+*Table: `CM_AES_GCM_SPDM_DECRYPT_INIT` input arguments*
2326+| **Name** | **Type** | **Description** |
2327+| ------------------ | ------------------ | --------------------------------- |
2328+| chksum | u32 ||
2329+| spdm version | u8 | The value should be equal to the |
2330+||| byte representation of the SPDM |
2331+||| version, e.g., 0x13 = SPDM 1.3 |
2332+| counter endianness | u8 | XOR the counter with the IV using |
2333+||| the given endianness. |
2334+||| 0 = Little endian (standard) |
2335+||| 1 = Big endian |
2336+| reserved | u8[2] | Reserved |
2337+| counter | u8[8] | 8-byte counter in little-endian |
2338+||| format that is XOR'd into the IV |
2339+| CMK | CMK | CMK to use for decryption |
2340+| aad size | u32 ||
2341+| aad | u8[aad size] | Additional authenticated data |
2342+
2343+
2344+*Table: `CM_AES_GCM_SPDM_DECRYPT_INIT` output arguments*
2345+| **Name** | **Type** | **Description** |
2346+| -------------- | ------------------ | ------------------------- |
2347+| chksum | u32 ||
2348+| fips_status | u32 | FIPS approved or an error |
2349+| context | AES_GCM_CONTEXT ||
2350+
2351+
2352+The encrypted and authenticated context's internal structure will be the same as for encryption.
2353+
2354+### CM_AES_GCM_DECRYPT_UPDATE
2355+
2356+This continues an AES computation started by `CM_AES_GCM_DECRYPT_INIT` or from another `CM_AES_GCM_DECRYPT_UPDATE`.
2357+
2358+The context MUST be passed in from `CM_AES_GCM_DECRYPT_INIT` or `CM_AES_GCM_DECRYPT_UPDATE`.
2359+
2360+Command Code: `0x434D_4455` ("CMDU")
2361+
2362+*Table: `CM_AES_GCM_DECRYPT_UPDATE` input arguments*
2363+| **Name** | **Type** | **Description** |
2364+| --------------- | ------------------- | ---------------- |
2365+| chksum | u32 ||
2366+| context | AES_GCM_CONTEXT ||
2367+| ciphertext size | u32 | MUST be non-zero |
2368+| ciphertext | u8[ciphertext size] | Data to decrypt |
2369+
2370+
2371+*Table: `CM_AES_GCM_DECRYPT_UPDATE` output arguments*
2372+| **Name** | **Type** | **Description** |
2373+| -------------- | ------------------ | ------------------------- |
2374+| chksum | u32 ||
2375+| fips_status | u32 | FIPS approved or an error |
2376+| context | AES_GCM_CONTEXT ||
2377+| plaintext size | u32 | MAY be 0 |
2378+| plaintext | u8[plaintext size] ||
2379+
2380+
2381+### CM_AES_GCM_DECRYPT_FINAL
2382+
2383+This finalizes the computation of the AES GCM decryption and produces the final ciphertext.
2384+
2385+The context MUST be passed in from `CM_AES_GCM_DECRYPT_INIT` or `CM_AES_GCM_DECRYPT_UPDATE`.
2386+
2387+Tags between 0 and 16 bytes are supported but must be passed (on the right) with zeroes to 16 bytes.
2388+
2389+The caller MUST verify that the tag verified field is set to 1 before using the result.
2390+
2391+Command Code: `0x434D_4446` ("CMDF")
2392+
2393+*Table: `CM_AES_GCM_DECRYPT_FINAL` input arguments*
2394+| **Name** | **Type** | **Description** |
2395+| --------------- | ------------------- | --------------------------------- |
2396+| chksum | u32 ||
2397+| context | AES_GCM_CONTEXT ||
2398+| tag size | u32 | Can be 8, 9, ..., 16 |
2399+| tag | u8[16] | Right-padded with zeroes |
2400+| ciphertext size | u32 | MAY be 0 |
2401+| ciphertext | u8[ciphertext size] | Data to decrypt |
2402+
2403+
2404+*Table: `CM_AES_GCM_DECRYPT_FINAL` output arguments*
2405+| **Name** | **Type** | **Description** |
2406+| -------------- | ------------------ | ------------------------------------ |
2407+| chksum | u32 ||
2408+| fips_status | u32 | FIPS approved or an error |
2409+| tag verified | u32 | 1 if tags matched, 0 if they did not |
2410+| plaintext size | u32 | MAY be 0 |
2411+| plaintext | u8[plaintext size] ||
2412+
2413+
2414+### CM_ECDH_GENERATE
2415+
2416+This computes the first half of an Elliptic Curve Diffie-Hellman exchange to compute an ephemeral shared key pair with another party.
2417+
2418+Currently only supports the NIST P-384 curve.
2419+
2420+The returned context must be passed to the `CM_ECDH_FINISH` command. The context contains the (encrypted) secret coefficient.
2421+
2422+The returned exchange data format is the concatenation of the x- and y-coordinates of the public point encoded as big-endian integers, padded to 48 bytes each.
2423+
2424+Command Code: `0x434D_4547` ("CMEG")
2425+
2426+*Table: `CM_ECDH_GENERATE` input arguments*
2427+| **Name** | **Type** | **Description** |
2428+| ----------- | -------- | -------------------- |
2429+| chksum | u32 ||
2430+
2431+
2432+*Table: `CM_ECDH_GENERATE` output arguments*
2433+| **Name** | **Type** | **Description** |
2434+| ------------- | -------- | ------------------------------------- |
2435+| chksum | u32 ||
2436+| fips_status | u32 | FIPS approved or an error |
2437+| context | u8[76] | Used as the input to `CM_ECDH_FINISH` |
2438+| exchange data | u8[96] | i.e., the public point |
2439+
2440+
2441+*Table: `CM_ECDH_GENERATE` / `CM_ECDH_FINISH` internal context*
2442+| **Name** | **Type** | **Description** |
2443+| ------------------ | -------- | --------------- |
2444+| Secret coefficient | u8[48] ||
2445+
2446+
2447+The encrypted context size (76 bytes) is the size of the internal context (48 bytes) plus as 12-byte IV and a 16-byte authentication tag.
2448+
2449+### CM_ECDH_FINISH
2450+
2451+This computes the second half of an Elliptic Curve Diffie-Hellman exchange.
2452+
2453+Currently only supports the NIST P-384 curve.
2454+
2455+The context must be passed from the `CM_ECDH_GENERATE` command.
2456+
2457+The incoming exchange data MUST be the concatenation of the x- and y- coordinates of the other side's public point, encoded as big-endian integers, padded to 48 bytes each.
2458+
2459+The produced shared secret is 384 bits.
2460+
2461+Command Code: `0x434D_4546` ("CMEF")
2462+
2463+*Table: `CM_ECDH_FINISH` input arguments*
2464+| **Name** | **Type** | **Description** |
2465+| ---------------------- | -------- | -------------------------------------------------------- |
2466+| chksum |||
2467+| context | u8[76] | This MUST come from the output of the `CM_ECDH_GENERATE` |
2468+| key usage | u32 | usage tag of the kind of key that will be output |
2469+| incoming exchange data | u8[96] | the other side's public point |
2470+
2471+
2472+The context used as an input is the same as the output context from `CM_ECDH_GENERATE` above.
2473+
2474+*Table: `CM_ECDH_FINISH` output arguments*
2475+| **Name** | **Type** | **Description** |
2476+| ----------- | -------- | ------------------------------- |
2477+| chksum | u32 ||
2478+| fips_status | u32 | FIPS approved or an error |
2479+| output CMK | CMK | Output CMK of the shared secret |
2480+
2481+
2482+
2483+### CM_RANDOM_STIR
2484+
2485+This allows additional entropy to be added to the underlying deterministic random bit generator, if the hardware is using a CSRNG DRBG.
2486+
2487+Command Code: `0x434D_5253` ("CMRS")
2488+
2489+*Table: `CM_RANDOM_STIR` input arguments*
2490+
2491+| **Name** | **Type** | **Description** |
2492+| ---------- | -------------- | --------------- |
2493+| chksum | u32 ||
2494+| input size | u32 ||
2495+| input | u8[input size] ||
2496+
2497+
2498+*Table: `CM_RANDOM_STIR` output arguments*
2499+| **Name** | **Type** | **Description** |
2500+| ----------- | -------- | ------------------------- |
2501+| chksum | u32 ||
2502+| fips_status | u32 | FIPS approved or an error |
2503+
2504+
2505+### CM_RANDOM_GENERATE
2506+
2507+This generates random bytes that are returned from the internal RNG.
2508+
2509+Command Code: `0x434D_5247` ("CMRG")
2510+
2511+*Table: `CM_RANDOM_GENERATE` input arguments*
2512+
2513+| **Name** | **Type** | **Description** |
2514+| ------------------- | -------- | --------------- |
2515+| chksum | u32 ||
2516+| data size to return | u32 ||
2517+
2518+
2519+
2520+*Table: `CM_RANDOM_GENERATE` output arguments*
2521+| **Name** | **Type** | **Description** |
2522+| ----------- | --------------- | ------------------------- |
2523+| chksum | u32 ||
2524+| fips_status | u32 | FIPS approved or an error |
2525+| output size | u32 | size of output |
2526+| output | u8[output size] ||
2527+
2528+
2529+### CM\_DERIVE\_STABLE\_KEY
2530+
2531+Derives an HMAC key that has a stable value across resets from either
2532+IDevId or LDevId.
2533+
2534+The (interior) value of the returned CMK will be the stable across resets as it is derived indirectly from the IDevId or LDevId CDIs.
2535+The actual encrypted bytes of the CMK will *not* be the same, and
2536+the encrypted CMK itself cannot be used across resets. So, the key
2537+will always need to be re-derived after every *cold* reset.
2538+
2539+If a key usage other than HMAC is desired, then the KDF or HKDF
2540+mailbox functions can be used to derive a key from the returned CMK.
2541+
2542+Note that in Caliptra 2.0 in subsystem mode, derived stable keys, their derivatives, and commands using them will be marked with a FIPS status of invalid since the UDS and FE cannot be completely zeroized.
2543+
2544+The command derivation is summarized below:
2545+
2546+![CM_DERIVE_STABLE_KEY Derivation](../images/caliptra-sw/runtime/../rom/dev/doc/svg/cm-derive-stable-key.svg)
2547+
2548+Command Code: `0x434D_4453` ("CMDS")
2549+
2550+*Table: `CM_DERIVE_STABLE_KEY` input arguments*
10912551
10922552 | **Name** | **Type** | **Description**
10932553 | -------- | -------- | ---------------
10942554 | chksum | u32 | Checksum over other input arguments, computed by the caller. Little endian. |
1095-
1096-
1097-*Table: `GET_IDEVID_CSR` output arguments*
2555+| key_type | u32 | Source key to derive the stable key from. **0x0000_0001:** IDevId <br> **0x0000_0002:** LDevId |
2556+| info | u8[32] | Data to use in the key derivation. |
2557+
2558+
2559+*Table: `CM_DERIVE_STABLE_KEY` output arguments*
2560+| **Name** | **Type** | **Description**
2561+| -------- | -------- | ---------------
2562+| chksum | u32 | Checksum over other output arguments, computed by Caliptra. Little endian. |
2563+| cmk | CMK | CMK that stores the stable key material |
2564+
2565+
2566+### CM_IMPORT
2567+
2568+Imports the specified key and returns a CMK for it.
2569+
2570+Usage information is required so that the key can be verified and used appropriately.
2571+
2572+Note that it is the caller's responsibility to ensure that the source
2573+key material meets FIPS requirements, such as zeroization.
2574+
2575+Command Code: `0x434D_494D` ("CMIM")
2576+
2577+*Table: `CM_IMPORT` input arguments*
2578+
2579+| **Name** | **Type** | **Description** |
2580+| ---------- | -------------- | --------------------------------------- |
2581+| chksum | u32 ||
2582+| key usage | u32 | Tag to specify how the data can be used |
2583+| input size | u32 | This MUST agree with the key usage |
2584+| input | u8[input size] ||
2585+
2586+
2587+*Table: `CM_IMPORT` output arguments*
2588+| **Name** | **Type** | **Description** |
2589+| ----------- | -------- | --------------------------- |
2590+| chksum | u32 ||
2591+| fips_status | u32 | FIPS approved or an error |
2592+| CMK | CMK | CMK containing imported key |
2593+
2594+
2595+### CM_KEY_GEN
2596+
2597+Generates a key using internal TRNG and returns an encrypted CMK for it.
2598+
2599+Usage and size information are required so that the key can be verified and used appropriately.
2600+
2601+Command Code: `0x434D_4B47` ("CMKG")
2602+
2603+*Table: `CM_KEY_GEN` input arguments*
2604+
2605+| **Name** | **Type** | **Description** |
2606+| ---------- | -------- | --------------------------------------- |
2607+| chksum | u32 ||
2608+| key usage | u32 | Tag to specify how the data can be used |
2609+| key size | u32 | Size in bytes (must agree with usage) |
2610+
2611+
2612+*Table: `CM_KEY_GEN` output arguments*
2613+
2614+| **Name** | **Type** | **Description** |
2615+| ----------- | -------- | ---------------------------- |
2616+| chksum | u32 ||
2617+| fips_status | u32 | FIPS approved or an error |
2618+| CMK | CMK | CMK containing generated key |
2619+
2620+
2621+### CM_DELETE
2622+
2623+Deletes the object stored with the given mailbox ID.
2624+
2625+Command Code: `0x434D_444C` ("CMDL")
2626+
2627+*Table: `CM_DELETE` input arguments*
2628+
2629+| **Name** | **Type** | **Description** |
2630+| -------- | -------- | --------------- |
2631+| chksum | u32 ||
2632+| CMK | CMK | CMK to delete |
2633+
2634+
2635+*Table: `CM_DELETE` output arguments*
2636+| **Name** | **Type** | **Description** |
2637+| ----------- | -------- | ------------------------- |
2638+| chksum | u32 ||
2639+| fips_status | u32 | FIPS approved or an error |
2640+
2641+
2642+### CM_CLEAR
2643+
2644+The entire contents of the CMK storage is wiped. All known keys will be invalidated.
2645+
2646+Command Code: `0x434D_434C` ("CMCL")
2647+
2648+`CM_CLEAR` takes no input arguments.
2649+
2650+*Table: `CM_CLEAR` output arguments*
2651+| **Name** | **Type** | **Description** |
2652+| ----------- | -------- | ------------------------- |
2653+| chksum | u32 ||
2654+| fips_status | u32 | FIPS approved or an error |
2655+
2656+
2657+### CM_STATUS
2658+
2659+Queries the status cryptographic mailbox system.
2660+
2661+The usage storage records the number of entries used and total for for usage tracking.
2662+Usage tracking is only currently implemented for AES, so this is is effectively the number of AES keys used and total potential available AES keys.
2663+
2664+Command Code: `0x434D_5354` ("CMST")
2665+
2666+`CM_STATUS` takes no input arguments.
2667+
2668+*Table: `CM_STATUS` output arguments*
2669+| **Name** | **Type** | **Description** |
2670+| ------------------- | -------- | ------------------------------------ |
2671+| chksum | u32 ||
2672+| fips_status | u32 | FIPS approved or an error |
2673+| used usage storage | u32 | CMK usage storage (in entries) |
2674+| total usage storage | u32 | Total CMK usage storage (in entries) |
2675+
2676+
2677+
2678+### GET\_IDEV\_ECC384\_CSR
2679+
2680+Command Code: `0x4944_4352` ("IDCR")
2681+
2682+*Table: `GET_IDEV_ECC384_CSR` input arguments*
2683+
2684+| **Name** | **Type** | **Description**
2685+| -------- | -------- | ---------------
2686+| chksum | u32 | Checksum over other input arguments, computed by the caller. Little endian. |
2687+
2688+
2689+*Table: `GET_IDEV_ECC384_CSR` output arguments*
10982690 | **Name** | **Type** | **Description**
10992691 | -------- | -------- | ---------------
11002692 | chksum | u32 | Checksum over other output arguments, computed by Caliptra. Little endian. |
11012693 | data\_size | u32 | Length in bytes of the valid data in the data field. |
1102-| data | u8[...] | DER-encoded IDevID certificate signing request. |
1103-
1104-
1105-The `mfg_flag_gen_idev_id_csr` manufacturing flag **MUST** have been set to generate a CSR.
1106-
1107-When called from ROM, if the CSR was not previously provisioned this command will return `FW_PROC_MAILBOX_UNPROVISIONED_CSR(0x0102000A)`.
1108-
1109-When called from runtime, if the CSR was not previously provisioned this command will return `RUNTIME_GET_IDEV_ID_UNPROVISIONED(0x000E0051)`. If the ROM did not support CSR generation, this command will return `RUNTIME_GET_IDEV_ID_UNSUPPORTED_ROM(0x000E0052)`.
1110-
1111-
1112-
1113-When the `mfg_flag_gen_idev_id_csr` flag has been set, the SoC **MUST** wait for the `flow_status_set_idevid_csr_ready` bit to be set by Caliptra. Once set, the SoC **MUST** clear the `mfg_flag_gen_idev_id_csr` flag for Caliptra to progress.
1114-
1115-### GET\_FMC\_ALIAS\_CSR
1116-
1117-Command Code: `0x464D_4352` ("FMCR")
1118-
1119-Privilege Level: PL0 or PL1
1120-
1121-*Table: `GET_FMC_ALIAS_CSR` input arguments*
2694+| data | u8[...] | DER-encoded ECC384 IDevID certificate signing request. |
2695+
2696+
2697+### GET\_IDEV\_MLDSA87\_CSR
2698+
2699+Command Code: `0x4944_4d52` ("IDMR")
2700+
2701+*Table: `GET_IDEV_MLDSA87_CSR` input arguments*
11222702
11232703 | **Name** | **Type** | **Description**
11242704 | -------- | -------- | ---------------
11252705 | chksum | u32 | Checksum over other input arguments, computed by the caller. Little endian. |
11262706
11272707
1128-*Table: `GET_FMC_ALIAS_CSR` output arguments*
2708+*Table: `GET_IDEV_MLDSA87_CSR` output arguments*
11292709 | **Name** | **Type** | **Description**
11302710 | -------- | -------- | ---------------
11312711 | chksum | u32 | Checksum over other output arguments, computed by Caliptra. Little endian. |
11322712 | data\_size | u32 | Length in bytes of the valid data in the data field. |
1133-| data | u8[...] | DER-encoded FMC ALIAS certificate signing request. |
1134-
1135-
1136-The FMC Alias CSR is generated unconditionally on every cold boot.
2713+| data | u8[...] | DER-encoded MLDSA87 IDevID certificate signing request. |
2714+
2715+
2716+The `mfg_flag_gen_idev_id_csr` manufacturing flag **MUST** have been set to generate a CSR.
2717+
2718+When called from ROM, if the CSR was not previously provisioned this command will return `FW_PROC_MAILBOX_UNPROVISIONED_CSR(0x0102000A)`.
2719+
2720+When called from runtime, if the CSR was not previously provisioned this command will return `RUNTIME_GET_IDEV_ID_UNPROVISIONED(0x000E0051)`. If the ROM did not support CSR generation, this command will return `RUNTIME_GET_IDEV_ID_UNSUPPORTED_ROM(0x000E0052)`.
2721+
2722+When the `mfg_flag_gen_idev_id_csr` flag has been set, the SoC **MUST** wait for the `flow_status_set_idevid_csr_ready` bit to be set by Caliptra. Once set, the SoC **MUST** clear the `mfg_flag_gen_idev_id_csr` flag for Caliptra to progress.
2723+
2724+### GET\_FMC\_ALIAS\_ECC384\_CSR
2725+
2726+Command Code: `0x464D_4352` ("FMCR")
2727+
2728+*Table: `GET_FMC_ALIAS_ECC384_CSR` input arguments*
2729+
2730+| **Name** | **Type** | **Description**
2731+| -------- | -------- | ---------------
2732+| chksum | u32 | Checksum over other input arguments, computed by the caller. Little endian. |
2733+
2734+
2735+*Table: `GET_FMC_ALIAS_ECC384_CSR` output arguments*
2736+| **Name** | **Type** | **Description**
2737+| -------- | -------- | ---------------
2738+| chksum | u32 | Checksum over other output arguments, computed by Caliptra. Little endian. |
2739+| data\_size | u32 | Length in bytes of the valid data in the data field. |
2740+| data | u8[...] | DER-encoded ECC384 FMC Alias certificate signing request. |
2741+
2742+
2743+### GET\_FMC\_ALIAS\_MLDSA87\_CSR
2744+
2745+Command Code: `0x464d_4452` ("FMDR")
2746+
2747+*Table: `GET_FMC_ALIAS_MLDSA87_CSR` input arguments*
2748+
2749+| **Name** | **Type** | **Description**
2750+| -------- | -------- | ---------------
2751+| chksum | u32 | Checksum over other input arguments, computed by the caller. Little endian. |
2752+
2753+
2754+*Table: `GET_FMC_ALIAS_MLDSA87_CSR` output arguments*
2755+| **Name** | **Type** | **Description**
2756+| -------- | -------- | ---------------
2757+| chksum | u32 | Checksum over other output arguments, computed by Caliptra. Little endian. |
2758+| data\_size | u32 | Length in bytes of the valid data in the data field. |
2759+| data | u8[...] | DER-encoded MLDSA87 FMC Alias certificate signing request. |
2760+
2761+
2762+### GET\_ATTESTED\_ECC384\_CSR
2763+
2764+Generates an attested ECC384 certificate signing request (CSR) in Entity Attestation Token (EAT) format as per the [OCP Device Identity Provisioning](https://opencomputeproject.github.io/Security/device-identity-provisioning/HEAD/) specification, signed by the `RT Alias` key for the requested Device Identity Key, or returns the keypair inventory discovery token when `key_id` is 0.
2765+
2766+Command Code: `0x4145_4352` ("AECR")
2767+
2768+*Table: `GET_ATTESTED_ECC384_CSR` input arguments*
2769+
2770+| **Name** | **Type** | **Description**
2771+| -------- | -------- | ---------------
2772+| chksum | u32 | Checksum over other input arguments, computed by the caller. Little endian. |
2773+| key_id | u32 | Key ID for which CSR is requested.<br> **0x0000_0000:** Keypair inventory discovery <br> **0x0000_0001:** LDevId <br> **0x0000_0002:** FMC Alias <br> **0x0000_0003:** RT Alias |
2774+| nonce | u8[32] | Nonce to be included in the CSR EAT. |
2775+
2776+
2777+*Table: `GET_ATTESTED_ECC384_CSR` output arguments*
2778+
2779+| **Name** | **Type** | **Description**
2780+| -------- | -------- | ---------------
2781+| chksum | u32 | Checksum over other output arguments, computed by Caliptra. Little endian. |
2782+| data\_size | u32 | Length in bytes of the valid data in the data field. |
2783+| data | u8[...] | COSE Sign1 signed EAT token containing attested CSR (or keypair inventory when key_id = 0). |
2784+
2785+
2786+### GET\_ATTESTED\_MLDSA87\_CSR
2787+
2788+Generates an attested MLDSA87 certificate signing request (CSR) in Entity Attestation Token (EAT) format as per the [OCP Device Identity Provisioning](https://opencomputeproject.github.io/Security/device-identity-provisioning/HEAD/) specification, signed by the `RT Alias` key for the requested Device Identity Key, or returns the keypair inventory discovery token when `key_id` is 0.
2789+
2790+Command Code: `0x414D_4352` ("AMCR")
2791+
2792+*Table: `GET_ATTESTED_MLDSA87_CSR` input arguments*
2793+
2794+| **Name** | **Type** | **Description**
2795+| -------- | -------- | ---------------
2796+| chksum | u32 | Checksum over other input arguments, computed by the caller. Little endian. |
2797+| key_id | u32 | Key ID for which CSR is requested.<br> **0x0000_0000:** Keypair inventory discovery <br> **0x0000_0001:** LDevId <br> **0x0000_0002:** FMC Alias <br> **0x0000_0003:** RT Alias |
2798+| nonce | u8[32] | Nonce to be included in the CSR EAT. |
2799+
2800+
2801+*Table: `GET_ATTESTED_MLDSA87_CSR` output arguments*
2802+
2803+| **Name** | **Type** | **Description**
2804+| -------- | -------- | ---------------
2805+| chksum | u32 | Checksum over other output arguments, computed by Caliptra. Little endian. |
2806+| data\_size | u32 | Length in bytes of the valid data in the data field. |
2807+| data | u8[...] | COSE Sign1 signed EAT token containing attested CSR (or keypair inventory when key_id = 0). |
2808+
11372809
11382810 ### SIGN\_WITH\_EXPORTED\_ECDSA
11392811
11402812 Command Code: `0x5357_4545` ("SWEE")
11412813
1142-Privilege Level: PL0
2814+**Note**: This command is only available in the locality of the PL0 PAUSER.
11432815
11442816 *Table: `SIGN_WITH_EXPORTED_ECDSA` input arguments*
11452817
@@ -1159,13 +2831,13 @@
11592831 | signature_s | u8[48] | The S BigNum of an ECDSA signature. |
11602832
11612833
1162-The `exported_cdi_handle` can be created by calling `DeriveContext` with the `export-cdi` and `create-certificate` flags.
2834+The `exported_cdi` can be created by calling `DeriveContext` with the `export-cdi` and `create-certificate` flags.
11632835
11642836 ### REVOKE\_EXPORTED\_CDI\_HANDLE
11652837
11662838 Command Code: `5256_4348` ("RVCH")
11672839
1168-Privilege Level: PL0
2840+**Note**: This command is only available in the locality of the PL0 PAUSER.
11692841
11702842 *Table: `REVOKE_EXPORTED_CDI_HANDLE` input arguments*
11712843
@@ -1175,16 +2847,16 @@
11752847 | exported_cdi_handle | u8[32] | The Exported CDI handle returned by the DPE `DeriveContext` command. Little endian. |
11762848
11772849
1178-The `exported_cdi_handle` can be created by calling `DeriveContext` with the `export-cdi` and `create-certificate` flags.
2850+The `exported_cdi` can be created by calling `DeriveContext` with the `export-cdi` and `create-certificate` flags.
11792851
11802852 The `exported_cdi_handle` is no longer usable after calling `REVOKE_EXPORTED_CDI_HANDLE` with it. After the `exported_cdi_handle`
1181-has been revoked, a new exported CDI handle can be created by calling `DeriveContext` with the `export-cdi` and `create-certificate` flags.
2853+has been revoked, a new exported CDI can be created by calling `DeriveContext` with the `export-cdi` and `create-certificate` flags.
11822854
11832855 ### REALLOCATE\_DPE\_CONTEXT\_LIMITS
11842856
11852857 Command Code: '5243_5458` ("RCTX")
11862858
1187-Privilege Level: PL0
2859+**Note**: This command is only available in the locality of the PL0 PAUSER.
11882860
11892861 *Table: `REALLOCATE_DPE_CONTEXT_LIMITS` input arguments*
11902862
@@ -1207,253 +2879,9 @@
12072879
12082880 **Note**: 2 PL0 contexts are used by Caliptra itself during initialization.
12092881
1210-## PQC (ML-DSA-87) commands
1211-
1212-The following commands implement the `PQ.DevID` post-quantum identity retrofit described in [Software-based PQC features](https://github.com/chipsalliance/Caliptra/blob/main/doc/caliptra_1x/Caliptra.md#software-based-pqc-features-caliptra-13). All ML-DSA-87 cryptography is implemented in software; there is no hardware PQC accelerator on Caliptra 1.x silicon.
1213-The availability of these commands is advertised to the SoC via the `RT_MLDSA_ATTESTATION` bit in the [`CAPABILITIES`](#capabilities) output.
1214-
1215-### SET\_PQ\_SEED
1216-
1217-Delivers `PQ.DevID.Seed` from the SoC to Caliptra. Caliptra derives `PQ.DevID.CDI` from the seed via an HMAC-based KDF, derives the ML-DSA-87 `PQ.DevID` keypair, and caches the public key digest in persistent data.
1218-
1219-Command Code: `0x5051_5344` ("PQSD")
1220-
1221-Privilege Level: PL0
1222-
1223-*Table: `SET_PQ_SEED` input arguments*
1224-
1225-| **Name** | **Type** | **Description**
1226-| -------- | --------- | ---------------
1227-| chksum | u32 | Checksum over other input arguments, computed by the caller. Little endian.
1228-| seed | u8[48] | `PQ.DevID.Seed`. Per-device unique symmetric seed, provided by the SoC.
1229-
1230-*Table: `SET_PQ_SEED` output arguments*
1231-
1232-| **Name** | **Type** | **Description**
1233-| -------- | -------- | ---------------
1234-| chksum | u32 | Checksum over other output arguments, computed by Caliptra. Little endian.
1235-| fips\_status | u32 | Indicates if the command is FIPS approved or an error.
1236-
1237-Deriving `PQ.DevID.CDI` and the ML-DSA-87 key material can exceed the default mailbox command watchdog budget; Runtime Firmware extends the watchdog for this command.
1238-The production `PQ.DevID.Seed` must never be delivered while Caliptra is `DebugUnlocked`.
1239-Integrators may still call `SET_PQ_SEED` with a non-production seed while `DebugUnlocked` for local bring-up and debug.
1240-
1241-### GET\_PQ\_CSR
1242-
1243-Returns a CSR for the `PQ.DevID` ML-DSA-87 public key, for collection during manufacturing/provisioning, mirroring [`GET_IDEVID_CSR`](#get_idevid_csr).
1244-
1245-Command Code: `0x5051_4353` ("PQCS")
1246-
1247-Privilege Level: PL0 or PL1
1248-
1249-*Table: `GET_PQ_CSR` input arguments*
1250-
1251-| **Name** | **Type** | **Description**
1252-| -------- | -------- | ---------------
1253-| chksum | u32 | Checksum over other input arguments, computed by the caller. Little endian.
1254-
1255-*Table: `GET_PQ_CSR` output arguments*
1256-
1257-| **Name** | **Type** | **Description**
1258-| -------- | --------- | ---------------
1259-| chksum | u32 | Checksum over other output arguments, computed by Caliptra. Little endian.
1260-| fips\_status | u32 | Indicates if the command is FIPS approved or an error.
1261-| data\_size | u32 | Length in bytes of the valid data in the data field, with a maximum of 12800.
1262-| data | u8[12800] | DER-encoded ML-DSA-87 `PQ.DevID` certificate signing request.
1263-
1264-### GET\_ATTESTED\_PQ\_CSR
1265-
1266-Returns the `PQ.DevID` ML-DSA-87 CSR as an attested CSR Entity Attestation Token (EAT), per the [OCP Device Identity Provisioning](https://opencomputeproject.github.io/Security/device-identity-provisioning/HEAD/) specification. When `key_id` is 0, it returns the keypair inventory discovery token instead. The token is a CWT-tagged (61) COSE\_Sign1 signed with the `RT Alias` ECC P-384 key (`alg` ESP384, -51). The protected header `kid` is the `RT Alias` certificate subject key identifier. The request and response format matches `GET_ATTESTED_ECC384_CSR` on Caliptra 2.x.
1267-
1268-The CSR embedded in the token is byte-identical to the [`GET_PQ_CSR`](#get_pq_csr) output.
1269-
1270-The EAT claims are:
1271-
1272-| **Claim key** | **Name** | **Value**
1273-| ------------- | ------------------------ | ---------
1274-| 10 | nonce | `nonce` from the request.
1275-| -70001 | attested CSR | DER-encoded `PQ.DevID` CSR (`key_id` 1 only).
1276-| -70002 | key attributes | `{ 111(OCP KDA OID 1.3.6.1.4.1.42623.1.2): 0 }` (`key_id` 1 only). The derivation-component bitfield is 0: `PQ.DevID` is derived solely from the SoC-provisioned `PQ.DevID.Seed`, so none of the OCP-defined components (UDS, field entropy, fuses, FMC, runtime firmware) apply.
1277-| -70003 | keypair inventory | `[[1, <key attributes>]]` (`key_id` 0 only).
1278-
1279-Command Code: `0x4150_5143` ("APQC")
1280-
1281-Privilege Level: PL0 or PL1
1282-
1283-*Table: `GET_ATTESTED_PQ_CSR` input arguments*
1284-
1285-| **Name** | **Type** | **Description**
1286-| -------- | -------- | ---------------
1287-| chksum | u32 | Checksum over other input arguments, computed by the caller. Little endian.
1288-| key\_id | u32 | **0x0000\_0000:** Keypair inventory discovery <br> **0x0000\_0001:** `PQ.DevID`
1289-| nonce | u8[32] | Nonce to include in the EAT.
1290-
1291-*Table: `GET_ATTESTED_PQ_CSR` output arguments*
1292-
1293-| **Name** | **Type** | **Description**
1294-| -------- | --------- | ---------------
1295-| chksum | u32 | Checksum over other output arguments, computed by Caliptra. Little endian.
1296-| fips\_status | u32 | Indicates if the command is FIPS approved or an error.
1297-| data\_size | u32 | Length in bytes of the valid data in the data field, with a maximum of 12800.
1298-| data | u8[12800] | CWT-tagged COSE\_Sign1 EAT.
1299-
1300-`key_id` 1 requires `SET_PQ_SEED` to have been performed; otherwise the command fails with `RUNTIME_PQC_NOT_INITIALIZED`. Re-deriving the `PQ.DevID` key and signing the CSR can exceed the default mailbox command watchdog budget, so Runtime Firmware extends the watchdog for this request. Any other `key_id` fails with `RUNTIME_MAILBOX_INVALID_PARAMS`.
1301-
1302-### GET\_PQ\_INFO
1303-
1304-Returns the raw ML-DSA-87 `PQ.DevID` public key.
1305-
1306-Command Code: `0x5051_494E` ("PQIN")
1307-
1308-Privilege Level: PL0 or PL1
1309-
1310-*Table: `GET_PQ_INFO` input arguments*
1311-
1312-| **Name** | **Type** | **Description**
1313-| -------- | -------- | ---------------
1314-| chksum | u32 | Checksum over other input arguments, computed by the caller. Little endian.
1315-
1316-*Table: `GET_PQ_INFO` output arguments*
1317-
1318-| **Name** | **Type** | **Description**
1319-| -------- | --------- | ---------------
1320-| chksum | u32 | Checksum over other output arguments, computed by Caliptra. Little endian.
1321-| fips\_status | u32 | Indicates if the command is FIPS approved or an error.
1322-| pq\_pub\_key | u8[2592] | Encoded ML-DSA-87 `PQ.DevID` public key (FIPS 204).
1323-
1324-### POPULATE\_PQ\_CERT
1325-
1326-Allows the SoC to provide a DER-encoded `PQ.DevID` certificate on every boot, once it has been issued by the vendor/owner PQC provisioning CA. Mirrors [`POPULATE_IDEV_CERT`](#populate_idev_cert).
1327-
1328-Command Code: `0x5050_5143` ("PPQC")
1329-
1330-Privilege Level: PL0
1331-
1332-*Table: `POPULATE_PQ_CERT` input arguments*
1333-
1334-| **Name** | **Type** | **Description**
1335-| -------- | -------- | ---------------
1336-| chksum | u32 | Checksum over other input arguments, computed by the caller. Little endian.
1337-| cert\_size | u32 | Size of the DER-encoded `PQ.DevID` certificate, with a maximum of 8192.
1338-| cert | u8[8192] | DER-encoded `PQ.DevID` certificate.
1339-
1340-*Table: `POPULATE_PQ_CERT` output arguments*
1341-
1342-| **Name** | **Type** | **Description**
1343-| -------- | -------- | ---------------
1344-| chksum | u32 | Checksum over other output arguments, computed by Caliptra. Little endian.
1345-| fips\_status | u32 | Indicates if the command is FIPS approved or an error.
1346-
1347-### GET\_PQ\_CERT
1348-
1349-Given a caller-supplied TBS and ML-DSA-87 signature over that TBS, DER-assembles and returns the resulting `PQ.DevID` certificate. Stateless: it does not read the certificate buffer populated by `POPULATE_PQ_CERT`. Mirrors [`GET_IDEV_CERT`](#get_idev_cert).
1350-
1351-Command Code: `0x4750_5143` ("GPQC")
1352-
1353-Privilege Level: PL0 or PL1
1354-
1355-*Table: `GET_PQ_CERT` input arguments*
1356-
1357-| **Name** | **Type** | **Description**
1358-| -------- | -------- | ---------------
1359-| chksum | u32 | Checksum over other input arguments, computed by the caller. Little endian.
1360-| tbs\_size | u32 | Size of the TBS, with a maximum of 3543.
1361-| signature | u8[4627] | ML-DSA-87 signature (FIPS 204) over the TBS, supplied by the caller. Not verified or computed by Caliptra; used as-is to assemble the certificate's `signatureValue`.
1362-| tbs | u8[3543] | TBS. Only bytes up to tbs_size are used.
1363-
1364-*Table: `GET_PQ_CERT` output arguments*
1365-
1366-| **Name** | **Type** | **Description**
1367-| -------- | -------- | ---------------
1368-| chksum | u32 | Checksum over other output arguments, computed by Caliptra. Little endian.
1369-| fips\_status | u32 | Indicates if the command is FIPS approved or an error.
1370-| cert\_size | u32 | Length in bytes of the valid data in the cert field, with a maximum of 8192.
1371-| cert | u8[8192] | DER-encoded `PQ.DevID` certificate.
1372-
1373-### INVOKE\_DPE\_MLDSA87
1374-
1375-Invokes a DPE command using the ML-DSA-87 crypto backend, mirroring [`INVOKE_DPE_COMMAND`](#invoke_dpe_command) but rooted in the ML-DSA-87 DPE profile.
1376-
1377-Command Code: `0x4D4C_4450` ("MLDP")
1378-
1379-Privilege Level: PL0 or PL1; a subset of DPE commands requires PL0 (see [Mailbox command privilege levels](#mailbox-command-privilege-levels))
1380-
1381-*Table: `INVOKE_DPE_MLDSA87` input arguments*
1382-
1383-| **Name** | **Type** | **Description**
1384-| -------- | -------- | ---------------
1385-| chksum | u32 | Checksum over other input arguments, computed by the caller. Little endian.
1386-| data\_size | u32 | Length in bytes of the valid data in the data field.
1387-| data | u8[512] | Encoded DPE command. Only bytes up to data_size are used.
1388-
1389-*Table: `INVOKE_DPE_MLDSA87` output arguments*
1390-
1391-| **Name** | **Type** | **Description**
1392-| -------- | ----------- | ---------------
1393-| chksum | u32 | Checksum over other output arguments, computed by Caliptra. Little endian.
1394-| fips\_status | u32 | Indicates if the command is FIPS approved or an error.
1395-| data\_size | u32 | Length in bytes of the valid data in the data field.
1396-| data | u8[25168] | Encoded DPE response. Only bytes up to data_size are used.
1397-
1398-### CERTIFY\_KEY\_EXTENDED\_MLDSA87
1399-
1400-The ML-DSA-87 counterpart to [`CERTIFY_KEY_EXTENDED`](#certify_key_extended): produces a DPE leaf certificate or CSR, signed with ML-DSA-87, containing custom extensions provided by the SoC.
1401-
1402-Command Code: `0x434B_454D` ("CKEM")
1403-
1404-Privilege Level: PL0
1405-
1406-*Table: `CERTIFY_KEY_EXTENDED_MLDSA87` input arguments*
1407-
1408-| **Name** | **Type** | **Description**
1409-| -------- | -------- | ---------------
1410-| chksum | u32 | Checksum over other input arguments, computed by the caller. Little endian.
1411-| flags | u32 | Flags determining which custom extensions to include in the certificate. See [`CERTIFY_KEY_EXTENDED` input flags](#certify_key_extended).
1412-| certify\_key\_req | u8[72] | Certify Key Request.
1413-
1414-*Table: `CERTIFY_KEY_EXTENDED_MLDSA87` output arguments*
1415-
1416-| **Name** | **Type** | **Description**
1417-| -------- | -------- | ---------------
1418-| chksum | u32 | Checksum over other output arguments, computed by Caliptra. Little endian.
1419-| fips\_status | u32 | Indicates if the command is FIPS approved or an error.
1420-| size | u32 | Length in bytes of the valid data in the certify_key_resp field.
1421-| certify\_key\_resp | u8[25152] | Certify Key Response.
1422-
1423-This command can take tens of millions of CPU cycles due to the software ML-DSA-87 implementation; see [Performance considerations](https://github.com/chipsalliance/Caliptra/blob/main/doc/caliptra_1x/Caliptra.md#performance-considerations).
1424-
1425-### SIGN\_WITH\_EXPORTED\_MLDSA
1426-
1427-The ML-DSA-87 counterpart to [`SIGN_WITH_EXPORTED_ECDSA`](#sign_with_exported_ecdsa): signs with an ML-DSA-87 key pair derived from a previously exported DPE CDI handle.
1428-
1429-Command Code: `0x5357_4D4C` ("SWML")
1430-
1431-Privilege Level: PL0
1432-
1433-*Table: `SIGN_WITH_EXPORTED_MLDSA` input arguments*
1434-
1435-| **Name** | **Type** | **Description**
1436-| -------- | -------- | ---------------
1437-| chksum | u32 | Checksum over other input arguments, computed by the caller. Little endian.
1438-| exported\_cdi\_handle | u8[32] | The Exported CDI handle returned by the DPE `DeriveContext` command.
1439-| sign\_mode | u32 | `0` (`SIGN_MODE_DATA`): `message[..message_size]` is the raw message to sign, and Caliptra computes `mu` internally. `1` (`SIGN_MODE_EXTERNAL_MU`): `message[..MU_SIZE]` is a caller-supplied external `mu`; `message_size` must equal `MU_SIZE`.
1440-| message\_size | u32 | Length in bytes of the valid data in the message field.
1441-| message | u8[1024] | Raw message (`SIGN_MODE_DATA`) or external `mu` (`SIGN_MODE_EXTERNAL_MU`). Only bytes up to message_size are used.
1442-
1443-*Table: `SIGN_WITH_EXPORTED_MLDSA` output arguments*
1444-
1445-| **Name** | **Type** | **Description**
1446-| -------- | --------- | ---------------
1447-| chksum | u32 | Checksum over other output arguments, computed by Caliptra. Little endian.
1448-| fips\_status | u32 | Indicates if the command is FIPS approved or an error.
1449-| derived\_pubkey | u8[2592] | The ML-DSA-87 public key associated with the signing key.
1450-| signature | u8[4627] | The ML-DSA-87 signature.
1451-
1452-The `exported_cdi_handle` can be created by calling `DeriveContext` with the `export-cdi` and `create-certificate` flags, as with `SIGN_WITH_EXPORTED_ECDSA`.
1453-
14542882 ## Checksum
14552883
1456-For every command except for FW_LOAD, the request and response feature a checksum. This
2884+For every command except for FIRMWARE_LOAD, the request and response feature a checksum. This
14572885 mitigates glitches between clients and Caliptra.
14582886
14592887 The checksum is a little-endian 32-bit value, defined as:
@@ -1478,10 +2906,11 @@
14782906
14792907 *Table: FIPS status codes*
14802908
1481-| **Name** | **Value** | Description
1482-| ------- | ----- | -----------
1483-| `FIPS_APPROVED` | `0x0000_0000` | Status of command is FIPS approved
1484-| `RESERVED` | `0x0000_0001 - 0xFFFF_FFFF` | Other values reserved, will not be sent by Caliptra
2909+| **Name** | **Value** | Description |
2910+| --------------- | --------------------------- | --------------------------------------------------- |
2911+| `FIPS_APPROVED` | `0x0000_0000` | Status of command is FIPS approved |
2912+| `RESERVED` | `0x0000_0001 - 0xFFFF_FFFF` | Other values reserved, will not be sent by Caliptra |
2913+
14852914
14862915 ## Runtime Firmware updates
14872916
@@ -1490,7 +2919,7 @@
14902919
14912920 ### Applying updates
14922921
1493-A Runtime Firmware update is triggered by the `CALIPTRA_FW_LOAD` command. Upon
2922+A Runtime Firmware update is triggered by the `FIRMWARE_LOAD` command. Upon
14942923 receiving this command, Runtime Firmware does the following:
14952924
14962925 1. Locks the mailbox to writes
@@ -1538,16 +2967,15 @@
15382967 * PL0 - High privilege. Only 1 PAUSER in the SoC may be at PL0. The PL0 PAUSER
15392968 is denoted in the signed Caliptra firmware image. The PL0 PAUSER may call any
15402969 supported DPE commands. Only PL0 can use the CertifyKey command. Success of the
1541- CertifyKey command signifies to the caller that it is at PL0. A number of
1542- mailbox commands are also restricted to PL0; see
1543- [Mailbox command privilege levels](#mailbox-command-privilege-levels).
2970+ CertifyKey command signifies to the caller that it is at PL0. Only PL0 can use
2971+ the POPULATE\_IDEV\_ECC384\_CERT and POPULATE\_IDEV\_MLDSA87\_CERT mailbox commands.
15442972 * PL1 - Restricted privilege. All other PAUSERs in the SoC are PL1. Caliptra
15452973 SHALL fail any calls to the DPE CertifyKey with format=X509 by PL1 callers.
15462974 PL1 callers should use the CSR format instead.
15472975
15482976 PAUSER and Locality map 1:1. Consequently, only the single DPE Client associated
1549-with PL0 level, is authorized to invoke CertifyKey DPE command with format=x509.
1550-All other DPE Clients have instead restricted privileges associated to PL1 (as
2977+with PL0 level, is authorized to invoke CertifyKey DPE command with format=x509.
2978+All other DPE Clients have instead restricted privileges associated to PL1 (as
15512979 described above).
15522980
15532981 #### PAUSER privilege level active context limits
@@ -1575,20 +3003,20 @@
15753003 Further, it is not allowed for PL1 to call DeriveContext with the intent to change locality to PL0's locality; this would increase the number
15763004 of active contexts in PL0's locality, and hence allow PL1 to DOS PL0.
15773005
1578-### Caliptra DPE Profile
1579-
1580-Caliptra defines the **Caliptra DPE Profile**, which inherits from the [OCP DPE iRoT Profile](https://github.com/opencomputeproject/Security/tree/main/specifications/dpe-irot-profile) (`DPE_PROFILE_IROT_P384_SHA384`) with some modifications. This section describes the profile attributes and specific requirements for the Caliptra DPE implementation.
3006+### DPE profile implementation
3007+
3008+The DPE iRoT profile leaves some choices up to implementers. This section
3009+describes specific requirements for the Caliptra DPE implementation.
15813010
15823011 | Name | Value | Description |
15833012 | -------------------------- | ------------------------------ | ------------------------------------------------------------------------------------------------------ |
1584-| Profile Variant | `Caliptra DPE Profile` | Derived from `DPE_PROFILE_IROT_P384_SHA384`. |
3013+| Profile Variant | `DPE_PROFILE_IROT_P384_SHA384` | The profile variant that Caliptra implements. |
15853014 | KDF | SP800-108 HMAC-CTR | KDF to use for CDI (tcg.derive.kdf-sha384) and asymmetric key (tcg.derive.kdf-sha384-p384) derivation. |
15863015 | Simulation Context Support | Yes | Whether Caliptra implements the optional Simulation Contexts feature. |
15873016 | Supports ExtendTci | Yes | Whether Caliptra implements the optional ExtendTci command. |
15883017 | Supports Auto Init | Yes | Whether Caliptra will automatically initialize the default DPE context. |
15893018 | Supports Rotate Context | Yes | Whether Caliptra supports the optional RotateContextHandle command. |
15903019 | CertifyKey Alias Key | Caliptra Runtime Alias Key | The key that will be used to sign certificates that are produced by the DPE CertifyKey command. |
1591-| `export-cdi-format` | KeyVault Slot Handle | Overrides the iRoT profile default (which returns the actual CDI) to return a 32-byte handle to a KeyVault slot instead. |
15923020
15933021
15943022 ### Supported DPE commands
@@ -1598,8 +3026,7 @@
15983026 * GetProfile
15993027 * InitializeContext
16003028 * DeriveContext
1601- * **Note**: The value returned when `export-cdi` is requested is a 32-byte handle to a KeyVault slot containing the CDI, not the actual CDI. This overrides the default iRoT profile behavior.
1602- * **Note**: The "export-cdi" flag is only available in the locality of the PL0 PAUSER.
3029+ * **Note**: The "export-cdi" flag is only available in the locality of the PL0 PAUSER.
16033030 * CertifyKey
16043031 * Caliptra DPE supports two formats for CertifyKey: X.509 and PKCS#10 CSR.
16053032 X.509 is only available to PL0 PAUSERs.
@@ -1678,12 +3105,13 @@
16783105
16793106 ### Internal representation of TCI nodes
16803107
1681-| **Byte offset** | **Bits** | **Name** | **Description**
1682-| ----- | ---- | ---------------- | -----------------------------------------------------
1683-| 0x00 | 383:0 | `TCI_CURRENT` | Current TCI measurement value
1684-| 0x30 | 383:0 | `TCI_CUMULATIVE` | TCI measurement value
1685-| 0x60 | 31:0 | `TYPE` | `TYPE` parameter to the DeriveContext call that created this node
1686-| 0x64 | 31:0 | `LOCALITY` | `TARGET_LOCALITY` parameter to the DeriveContext call that created this node (PAUSER)
3108+| **Byte offset** | **Bits** | **Name** | **Description** |
3109+| --------------- | -------- | ---------------- | ------------------------------------------------------------------------------------- |
3110+| 0x00 | 383:0 | `TCI_CURRENT` | Current TCI measurement value |
3111+| 0x30 | 383:0 | `TCI_CUMULATIVE` | TCI measurement value |
3112+| 0x60 | 31:0 | `TYPE` | `TYPE` parameter to the DeriveContext call that created this node |
3113+| 0x64 | 31:0 | `LOCALITY` | `TARGET_LOCALITY` parameter to the DeriveContext call that created this node (PAUSER) |
3114+
16873115
16883116 ### Certificate generation
16893117
@@ -1691,7 +3119,7 @@
16913119
16923120 The DPE `GET_CERTIFICATE_CHAIN` command shall return the following certificates:
16933121
1694-* IDevID (optionally added by the SoC via POPULATE\_IDEV\_CERT)
3122+* IDevID (optionally added by the SoC via POPULATE\_IDEV\_ECC384\_CERT)
16953123 * LDevID
16963124 * FMC Alias
16973125 * Runtime Alias