Changes to Runtime Specification

Comparing version 2.1 to 2.0
+767 additions -147 deletions
@@ -1,10 +1,10 @@
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/8f13b41132ddd85c3c2fa2c8ce5a766758b20fd8/runtime/README.md" target="_blank">chipsalliance/caliptra-sw/runtime/README.md</a> @ <code>8f13b41</code>
2+📄 Source: <a href="https://github.com/chipsalliance/caliptra-sw/blob/6980f7d09b351299e61d7242ac7a8c3c4e8cb695/runtime/README.md" target="_blank">chipsalliance/caliptra-sw/runtime/README.md</a> @ <code>6980f7d</code>
33 </div>
44
5-# Caliptra Runtime Firmware v2.0.1
6-
7-*Spec version: 0.3*
5+# Caliptra Runtime Firmware v2.1
6+
7+*Spec version: 1.0*
88
99 This specification describes the Caliptra Runtime Firmware.
1010
@@ -23,11 +23,17 @@
2323 * Add support for passive mode (same as 1.x) and subsystem (or active) mode
2424 * [MCU Runtime loading](#boot-and-initialization) (subsystem mode)
2525 * [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.
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.
27+
28+v2.1:
29+
30+* [External mailbox commands](#external-mailbox-cmd)
31+* [Encrypted firmware support](#encrypted-firmware-support-21-subsystem-mode-only)
32+* [OCP LOCK v1.0 commands](#mailbox-commands-ocp-lock-v10)
33+* `ECDSA384_SIGNATURE_VERIFY` and `LMS_SIGNATURE_VERIFY` return a non-approved FIPS status because the caller supplies the digest.
34+
2735
2836 ## Spec Opens
29-
30-* Cryptographic Mailbox: ML-KEM support
3137
3238 ## Runtime Firmware environment
3339
@@ -39,7 +45,21 @@
3945
4046 * Initialize the [DICE Protection Environment (DPE)](#dice-protection-environment-dpe)
4147 * Initialize any SRAM structures used by Runtime Firmware
42-* Upload the firwmare to the Manufacturer Control Unit (2.0, susbystem mode only)
48+* Upload the firmware to the Manufacturer Control Unit (2.0, subsystem mode only)
49+
50+#### Encrypted Firmware Support (2.1, subsystem mode only)
51+
52+When ROM receives the `RI_DOWNLOAD_ENCRYPTED_FIRMWARE` command instead of `RI_DOWNLOAD_FIRMWARE`, it sets the boot mode to `EncryptedFirmware`. In this mode:
53+
54+1. Runtime downloads the encrypted MCU firmware to MCU SRAM via the recovery interface
55+2. Runtime does **not** activate the MCU firmware immediately
56+3. The MCU ROM can then:
57+ - Import an AES key using `CM_IMPORT`
58+ - Decrypt the firmware in-place using `CM_AES_GCM_DECRYPT_DMA`
59+ - Send `ACTIVATE_FIRMWARE` with the `INITIAL_ACTIVATE` flag set, so Runtime publishes `FW_EXEC_CTRL[MCU]` without performing the hitless-update reload/verify dance (the firmware was already integrity-checked end-to-end by `RI_DOWNLOAD_ENCRYPTED_FIRMWARE` and `CM_AES_GCM_DECRYPT_DMA`). See [`ACTIVATE_FIRMWARE`](#activate_firmware) for the gating rules.
60+ - Trigger a warm reset; MCI releases MCU once `FW_EXEC_CTRL[MCU]` is asserted, and MCU FwBoot jumps into the decrypted firmware.
61+
62+The `CM_AES_GCM_DECRYPT_DMA` command is intended to be used for the `EncryptedFirmware` boot mode and performs a SHA384 integrity check of the ciphertext before decryption, but can be used to decrypt other images as well in any boot mode.
4363
4464 For behavior during other types of reset, see [Runtime firmware updates](#runtime-firmware-updates).
4565
@@ -94,7 +114,7 @@
94114
95115 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.
96116
97-These mailbox commands provide SHA, HMAC, HKDF, AES, RNG, MLDSA, and ECDSA services.
117+These mailbox commands provide SHA, HMAC, HKDF, AES, RNG, MLDSA, ECDSA, and ML-KEM services.
98118
99119 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.
100120
@@ -126,8 +146,7 @@
126146
127147 | **Name** | **Bits** | **Description** |
128148 | ------------- | -------- | -------------------------------------- |
129-| version | 8 | CMK version. Currently always 1. |
130-| flags | 8 | Bit 0 = FIPS valid |
149+| version | 16 | CMK version. Currently always 1. |
131150 | length | 16 | how many bits of key material are used |
132151 | key usage | 8 | represents which kind of key this is |
133152 | id | 24 | ID number |
@@ -162,8 +181,10 @@
162181 | --------- | --------- |
163182 | 0 | Reserved |
164183 | 1 | HMAC |
165-| 2 | HKDF |
166-| 3 | AES |
184+| 2 | AES |
185+| 3 | ECDSA |
186+| 4 | MLDSA |
187+| 5 | ML-KEM |
167188
168189
169190 #### Replay Prevention and Deletion
@@ -187,7 +208,7 @@
187208
188209 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.
189210
190-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. `AUTHORIZE_AND_STASH` searches the vendor + owner collection first and then the owner-only collection; the provenance of the matching entry is reflected in its `auth_req_result` field.
211+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. `AUTHORIZE_AND_STASH` searches the vendor + owner collection first and then the owner-only collection; the provenance of the matching entry is reflected in its `auth_req_result` field.
191212
192213 ### Caliptra-Endorsed Aggregated Measured Boot
193214
@@ -303,6 +324,68 @@
303324 Mailbox user 0xFFFF_FFFF is reserved for Caliptra internal use. All mailbox
304325 commands from that user will fail.
305326
327+### Byte order of cryptographic fields
328+
329+Several mailbox commands include ECC P-384 and ML-DSA-87 public keys,
330+signatures, and SHA digest values stored as `[u32]` arrays.
331+The "big endian" / "little endian" labels in individual command tables describe
332+how the **standard byte representation** produced by cryptographic
333+tools maps to those `u32` words.
334+
335+Generally, any fields specified as **little-endian** byte representation will match the standard byte representation of the cryptographic protocols, since the RISC-V processor is a little-endian processor.
336+
337+#### ECC P-384 fields (big-endian words)
338+
339+Each 4-byte group from the standard representation is byte-reversed on the
340+wire.
341+
342+Example — suppose OpenSSL produces a 48-byte X coordinate starting with:
343+
344+```
345+OpenSSL raw bytes: AB CD EF 01 23 45 67 89 ...
346+ ~~~~~~~~~~~ ~~~~~~~~~~~
347+Mailbox bytes: 01 EF CD AB 89 67 45 23 ...
348+```
349+
350+In other words: split the tool output into 4-byte groups, then reverse each
351+group.
352+
353+#### ML-DSA-87 fields (little-endian words)
354+
355+No conversion is needed. Copy the raw bytes produced by an ML-DSA-87
356+implementation (e.g., OpenSSL 3.5+, the `fips204` crate, or the NIST reference
357+implementation) directly into the mailbox buffer.
358+
359+```
360+openssl pkey output: AB CD EF 01 23 45 67 89 ...
361+Mailbox bytes: AB CD EF 01 23 45 67 89 ... (identical)
362+```
363+
364+#### SHA digest fields (big-endian words)
365+
366+Hash digests stored as `u32[N]` arrays use the same big-endian word convention
367+as ECC fields. Each 4-byte group of the standard hash output is byte-reversed
368+on the wire.
369+
370+Example — suppose `openssl dgst -sha384` produces a digest starting with:
371+
372+```
373+openssl output: A1 B2 C3 D4 E5 F6 07 18 ...
374+ ~~~~~~~~~~~ ~~~~~~~~~~~
375+Mailbox u32[12]: D4 C3 B2 A1 18 07 F6 E5 ...
376+```
377+
378+#### u8 byte-array fields (no conversion needed)
379+
380+When ECC P-384 keys, signatures, or SHA digests are declared as `u8[48]` (rather
381+than `u32[12]`), they use standard big-endian byte order — the same format
382+produced by OpenSSL and other cryptographic tools. No byte-swapping is required.
383+
384+For example, the `ECDSA384_SIGNATURE_VERIFY` input fields (`pub_key_x`,
385+`pub_key_y`, `signature_r`, `signature_s`, `hash`) and the `QUOTE_PCRS_ECC384`
386+output fields (`digest`, `signature_r`, `signature_s`) can be used directly with
387+`openssl` or OpenSSL's `BN_bin2bn()` without any conversion.
388+
306389 ### FW\_LOAD
307390
308391 The `FIRMWARE_LOAD` command is handled by both ROM and Runtime Firmware.
@@ -367,7 +450,14 @@
367450 | -------- | -------- | ---------------
368451 | chksum | u32 | Checksum over other output arguments, computed by Caliptra. Little endian.
369452 | fips\_status | u32 | Indicates if the command is FIPS approved or an error.
370-| capabilities | u8[16] | Firmware capabilities
453+| capabilities | u8[16] | Firmware capabilities. See table below for details.
454+
455+*Table: Firmware Capabilities Flags*
456+
457+| **Name** | **Bit** | **Description**
458+| --------------- | ------- | ---------------
459+| `RT_BASE` | 64 | Base capabilities for Caliptra Runtime v2.1.
460+| `RT_OCP_LOCK` | 65 | Runtime firmware and hardware supports OCP LOCK.
371461
372462 ### GET\_IDEV\_ECC384\_CERT
373463
@@ -656,7 +746,7 @@
656746 | **Name** | **Type** | **Description**
657747 | -------- | -------- | ---------------
658748 | chksum | u32 | Checksum over other output arguments, computed by Caliptra. Little endian.
659-| fips\_status | u32 | Indicates if the command is FIPS approved or an error.
749+| fips\_status | u32 | `FIPS_NOT_APPROVED_USER_SUPPLIED_DIGEST`, because the caller supplies the digest.
660750
661751 ### LMS\_SIGNATURE\_VERIFY
662752
@@ -697,7 +787,7 @@
697787 | **Name** | **Type** | **Description**
698788 | -------- | -------- | ---------------
699789 | chksum | u32 | Checksum over other output arguments, computed by Caliptra. Little endian.
700-| fips\_status | u32 | Indicates if the command is FIPS approved or an error.
790+| fips\_status | u32 | `FIPS_NOT_APPROVED_USER_SUPPLIED_DIGEST`, because the caller supplies the digest.
701791
702792 ### MLDSA87_SIGNATURE_VERIFY
703793
@@ -740,7 +830,7 @@
740830 | **Name** | **Type** | **Description**
741831 | -------- | -------- | ---------------
742832 | chksum | u32 | Checksum over other input arguments, computed by the caller. Little endian.
743-| digest | u32[12] | Owner public key hash.
833+| digest | u32[12] | Owner public key hash. See [Byte order of cryptographic fields](#byte-order-of-cryptographic-fields).
744834
745835 *Table: `INSTALL_OWNER_PK_HASH` output arguments*
746836
@@ -811,13 +901,13 @@
811901 | chksum | u32 | Checksum over other output arguments, computed by Caliptra. Little endian.
812902 | fips\_status | u32 | Indicates if the command is FIPS approved or an error.
813903
814-### INVOKE\_DPE\_COMMAND
815-
816-Invokes a serialized DPE command.
904+### INVOKE\_DPE\_ECC384
905+
906+Invokes a serialized EC-P384 DPE profile command.
817907
818908 Command Code: `0x4450_4543` ("DPEC")
819909
820-*Table: `INVOKE_DPE_COMMAND` input arguments*
910+*Table: `INVOKE_DPE_ECC384` input arguments*
821911
822912 | **Name** | **Type** | **Description**
823913 | -------- | -------- | ---------------
@@ -825,7 +915,53 @@
825915 | data\_size | u32 | Length in bytes of the valid data in the data field.
826916 | data | u8[...] | DPE command structure as defined in the DPE iRoT profile.
827917
828-*Table: `INVOKE_DPE_COMMAND` output arguments*
918+*Table: `INVOKE_DPE_ECC384` output arguments*
919+
920+| **Name** | **Type** | **Description**
921+| -------- | -------- | ---------------
922+| chksum | u32 | Checksum over other output arguments, computed by Caliptra. Little endian.
923+| fips\_status | u32 | Indicates if the command is FIPS approved or an error.
924+| data\_size | u32 | Length in bytes of the valid data in the data field.
925+| data | u8[...] | DPE response structure as defined in the DPE iRoT profile.
926+
927+### INVOKE\_DPE\_MLDSA87
928+
929+Invokes a serialized ML-DSA-87 DPE profile command. In subsystem mode a response
930+can be DMA'ed to an external address. This is especially useful for large
931+commands like `CertifyKey` or `DeriveContext` when exporting a CDI. Both of
932+these responses contain a potentially large certificate/CSR. To use this
933+feature, set the `EXTERNAL_AXI_RESPONSE` in `flags` and set the corresponding
934+AXI address and size fields. The response over the mailbox will only contain a
935+mailbox header (`chksum` and `fips_status`). The full response including the
936+mailbox header will be found at the given address.
937+
938+**Important restrictions for `EXTERNAL_AXI_RESPONSE` flag use:**
939+- This command is only available in subsystem mode, as DMA is only available in subsystem.
940+- This command is only available for MCU.
941+
942+Command Code: `0x4450_4543` ("DPEC")
943+
944+*Table: `INVOKE_DPE_MLDSA87` input arguments*
945+
946+| **Name** | **Type** | **Description** |
947+| -------------- | -------- | --------------------------------------------------------------------------- |
948+| chksum | u32 | Checksum over other input arguments, computed by the caller. Little endian. |
949+| flags | u32 | Flags to give configurations of the command. |
950+| axi\_addr\_lo | u32 | Lower word of the destination physical address. |
951+| axi\_addr\_hi | u32 | Upper word of the destination physical address. |
952+| axi\_max\_size | u32 | Maximum DMA response size. |
953+| data\_size | u32 | Length in bytes of the valid data in the data field. |
954+| data | u8[...] | DPE command structure as defined in the DPE iRoT profile. |
955+
956+
957+*Table: `INVOKE_DPE_MLDSA87` input flags*
958+
959+| **Name** | **Value** |
960+| ----------------------- | --------- |
961+| EXTERNAL\_AXI\_RESPONSE | 1 << 31 |
962+
963+
964+*Table: `INVOKE_DPE_MLDSA87` output arguments*
829965
830966 | **Name** | **Type** | **Description**
831967 | -------- | -------- | ---------------
@@ -888,8 +1024,36 @@
8881024 | PCRs | PcrValue[32] | Values of all PCRs.
8891025 | nonce | u8[32] | Return the nonce used as input for convenience.
8901026 | reset\_ctrs | u32[32] | Reset counters for all PCRs.
891-| digest | u8[64] | Return the SHA2-512 digest over the PCR values and the nonce, in byte reversed order.
1027+| digest | u8[64] | SHA2-512 digest over the PCR values and the nonce, in DWORD-reversed order with per-word byte swap. See note below.
8921028 | 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.
1029+
1030+**Digest byte order:** The `digest` field has two transformations applied relative
1031+to the standard `openssl dgst -sha512` output: (1) the 16 u32 words are in
1032+reversed order, and (2) the bytes within each word are reversed. For example, if
1033+`openssl dgst -sha512` produces `A1 B2 C3 D4 E5 F6 07 18 ... P1 P2 P3 P4`,
1034+the mailbox response contains `P4 P3 P2 P1 ... 18 07 F6 E5 D4 C3 B2 A1`.
1035+
1036+To **independently recompute** this digest from PCR values and nonce, compute the
1037+SHA2-512 hash, then apply two steps:
1038+
1039+```
1040+openssl dgst -sha512 output (64 bytes, shown as 16 four-byte groups):
1041+ A1 B2 C3 D4 | E5 F6 07 18 | ... | M1 M2 M3 M4 | P1 P2 P3 P4
1042+
1043+Step 1 — reverse the bytes within each 4-byte group:
1044+ D4 C3 B2 A1 | 18 07 F6 E5 | ... | M4 M3 M2 M1 | P4 P3 P2 P1
1045+
1046+Step 2 — reverse the order of all 16 groups:
1047+ P4 P3 P2 P1 | M4 M3 M2 M1 | ... | 18 07 F6 E5 | D4 C3 B2 A1
1048+ ^^^^^^^^^^^^ ^^^^^^^^^^^^
1049+ (last group from Step 1 is now first) (first group is now last)
1050+
1051+Mailbox digest = result of Step 2
1052+```
1053+
1054+To **verify the signature** with an external tool such as OpenSSL, pass the `digest`
1055+bytes as-is as the pre-hashed message to ML-DSA-87 verification — no conversion
1056+is needed because the signature was computed over these exact bytes.
8931057
8941058 ### EXTEND\_PCR
8951059
@@ -1149,35 +1313,69 @@
11491313 | chksum | u32 | Checksum over other output arguments, computed by Caliptra. Little endian.
11501314 | fips\_status | u32 | Indicates if the command is FIPS approved or an error.
11511315
1152-### CERTIFY\_KEY\_EXTENDED
1153-
1154-Produces a DPE leaf certificate or CSR containing custom extensions provided by the SoC.
1316+### CERTIFY\_KEY\_EXTENDED\_ECC384
1317+
1318+Produces an ECC-P384 DPE leaf certificate or CSR containing custom extensions provided by the SoC.
11551319
11561320 Command Code: `0x434B_4558` ("CKEX")
11571321
1158-*Table: `CERTIFY_KEY_EXTENDED` input arguments*
1322+*Table: `CERTIFY_KEY_EXTENDED_ECC384` input arguments*
11591323
11601324 | **Name** | **Type** | **Description** |
11611325 | ----------------- | -------- | --------------------------------------------------------------------------- |
11621326 | chksum | u32 | Checksum over other input arguments, computed by the caller. Little endian. |
1327+| flags | u32 | Flags determining which custom extensions to include in the certificate. |
11631328 | certify\_key\_req | u8[72] | Certify Key Request. |
1164-| flags | u32 | Flags determining which custom extensions to include in the certificate. |
1165-
1166-
1167-*Table: `CERTIFY_KEY_EXTENDED` input flags*
1329+
1330+
1331+*Table: `CERTIFY_KEY_EXTENDED_ECC384` input flags*
11681332
11691333 | **Name** | **Offset** |
1170-| --------------- | ---------- |
1171-| DMTF_OTHER_NAME | 1 << 31 |
1172-
1173-
1174-*Table: `CERTIFY_KEY_EXTENDED` output arguments*
1175-
1176-| **Name** | **Type** | **Description** |
1177-| ------------------ | -------- | -------------------------------------------------------------------------- |
1334+| ----------------- | ---------- |
1335+| DMTF\_OTHER\_NAME | 1 << 31 |
1336+
1337+
1338+*Table: `CERTIFY_KEY_EXTENDED_ECC384` output arguments*
1339+
1340+| **Name** | **Type** | **Description** |
1341+| ------------------ | --------- | -------------------------------------------------------------------------- |
11781342 | chksum | u32 | Checksum over other output arguments, computed by Caliptra. Little endian. |
11791343 | fips\_status | u32 | Indicates if the command is FIPS approved or an error. |
1180-| certify\_key\_resp | u8[2176] | Certify Key Response. |
1344+| size | u32 | The size of the response in the certify\_key\_resp field. |
1345+| certify\_key\_resp | u8[25152] | Certify Key Response. |
1346+
1347+
1348+### CERTIFY\_KEY\_EXTENDED\_MLDSA87
1349+
1350+Produces an ML-DSA-87 DPE leaf certificate or CSR containing custom extensions provided by the SoC.
1351+
1352+Command Code: `0x434B_584D` ("CKXM")
1353+
1354+*Table: `CERTIFY_KEY_EXTENDED_MLDSA87` input arguments*
1355+
1356+| **Name** | **Type** | **Description** |
1357+| ----------------- | -------- | --------------------------------------------------------------------------- |
1358+| chksum | u32 | Checksum over other input arguments, computed by the caller. Little endian. |
1359+| flags | u32 | Flags determining which custom extensions to include in the certificate. |
1360+| certify\_key\_req | u8[72] | Certify Key Request. |
1361+
1362+
1363+*Table: `CERTIFY_KEY_EXTENDED_MLDSA87` input flags*
1364+
1365+| **Name** | **Offset** |
1366+| ----------------------- | ---------- |
1367+| DMTF\_OTHER\_NAME | 1 << 31 |
1368+| EXTERNAL\_AXI\_RESPONSE | 1 << 30 |
1369+
1370+
1371+*Table: `CERTIFY_KEY_EXTENDED_MLDSA87` output arguments*
1372+
1373+| **Name** | **Type** | **Description** |
1374+| ------------------ | --------- | -------------------------------------------------------------------------- |
1375+| chksum | u32 | Checksum over other output arguments, computed by Caliptra. Little endian. |
1376+| fips\_status | u32 | Indicates if the command is FIPS approved or an error. |
1377+| size | u32 | The size of the response in the certify\_key\_resp field. |
1378+| certify\_key\_resp | u8[25152] | Certify Key Response. |
11811379
11821380
11831381 ### CERTIFY\_KEY\_CHUNKS
@@ -1229,26 +1427,26 @@
12291427
12301428 *Table: `SET_AUTH_MANIFEST` input arguments*
12311429
1232-| **Name** | **Type** | **Description**
1233-| -------- | -------- | ---------------
1430+| **Name** | **Type** | **Description** |
1431+| -------- | -------- | --------------- |
12341432 | chksum | u32 | Checksum over other input arguments, computed by the caller. Little endian. |
12351433 | manifest size | u32 | The size of the full Authentication Manifest |
12361434 | preamble\_marker | u32 | Marker needs to be 0x4154_4D4E for the preamble to be valid |
12371435 | preamble\_size | u32 | Size of the preamble |
12381436 | preamble\_version | u32 | Version of the preamble |
12391437 | preamble\_flags | u32 | Manifest flags. See AUTH_MANIFEST_FLAGS below |
1240-| preamble\_vendor\_ecc384\_key | u32[24] | Vendor ECC384 key with X and Y coordinates in that order |
1241-| preamble\_vendor\_pqc\_key | u32[648] | Vendor MLDSA-87 or LMS-SHA192-H15 key |
1242-| preamble\_vendor\_ecc384\_sig | u32[24] | Vendor ECC384 signature |
1243-| preamble\_vendor\_PQC\_sig | u32[1157] | Vendor MLDSA-87 or LMOTS-SHA192-W4 signature |
1244-| preamble\_owner\_ecc384\_key | u32[24] | Owner ECC384 key with X and Y coordinates in that order |
1245-| preamble\_owner\_pqc\_key | u32[648] | Owner MLDSA-87 or LMS-SHA192-H15 key |
1246-| preamble\_owner\_ecc384\_sig | u32[24] | Owner ECC384 signature |
1247-| preamble\_owner\_PQC\_sig | u32[1157] | Owner MLDSA-87 or LMOTS-SHA192-W4 signature |
1248-| metadata\_vendor\_ecc384\_sig | u32[24] | Metadata Vendor ECC384 signature |
1249-| metadata\_vendor\_PQC\_sig | u32[1157] | Metadata Vendor MLDSA-87 or LMOTS-SHA192-W4 signature |
1250-| metadata\_owner\_ecc384\_sig | u32[24] | Metadata Owner ECC384 signature |
1251-| metadata\_owner\_PQC\_sig | u32[1157] | Metadata Owner MLDSA-87 or LMOTS-SHA192-W4 signature |
1438+| preamble\_vendor\_ecc384\_key | u32[24] | Vendor ECC384 key with X and Y coordinates in that order. See [Byte order of cryptographic fields](#byte-order-of-cryptographic-fields). |
1439+| preamble\_vendor\_pqc\_key | u32[648] | Vendor MLDSA-87 or LMS-SHA192-H15 key. See [Byte order of cryptographic fields](#byte-order-of-cryptographic-fields). |
1440+| preamble\_vendor\_ecc384\_sig | u32[24] | Vendor ECC384 signature. See [Byte order of cryptographic fields](#byte-order-of-cryptographic-fields). |
1441+| preamble\_vendor\_PQC\_sig | u32[1157] | Vendor MLDSA-87 or LMOTS-SHA192-W4 signature. See [Byte order of cryptographic fields](#byte-order-of-cryptographic-fields). |
1442+| preamble\_owner\_ecc384\_key | u32[24] | Owner ECC384 key with X and Y coordinates in that order. See [Byte order of cryptographic fields](#byte-order-of-cryptographic-fields). |
1443+| preamble\_owner\_pqc\_key | u32[648] | Owner MLDSA-87 or LMS-SHA192-H15 key. See [Byte order of cryptographic fields](#byte-order-of-cryptographic-fields). |
1444+| preamble\_owner\_ecc384\_sig | u32[24] | Owner ECC384 signature. See [Byte order of cryptographic fields](#byte-order-of-cryptographic-fields). |
1445+| preamble\_owner\_PQC\_sig | u32[1157] | Owner MLDSA-87 or LMOTS-SHA192-W4 signature. See [Byte order of cryptographic fields](#byte-order-of-cryptographic-fields). |
1446+| metadata\_vendor\_ecc384\_sig | u32[24] | Metadata Vendor ECC384 signature. See [Byte order of cryptographic fields](#byte-order-of-cryptographic-fields). |
1447+| metadata\_vendor\_PQC\_sig | u32[1157] | Metadata Vendor MLDSA-87 or LMOTS-SHA192-W4 signature. See [Byte order of cryptographic fields](#byte-order-of-cryptographic-fields). |
1448+| metadata\_owner\_ecc384\_sig | u32[24] | Metadata Owner ECC384 signature. See [Byte order of cryptographic fields](#byte-order-of-cryptographic-fields). |
1449+| metadata\_owner\_PQC\_sig | u32[1157] | Metadata Owner MLDSA-87 or LMOTS-SHA192-W4 signature. See [Byte order of cryptographic fields](#byte-order-of-cryptographic-fields). |
12521450 | metadata\_entry\_entry\_count | u32 | number of metadata entries |
12531451 | metadata\_entries | Metadata[80] | The max number of metadata entries is 80 but less can be used |
12541452
@@ -1266,17 +1464,17 @@
12661464 | **Name** | **Type** | **Description** |
12671465 | ------------------------ | --------- | ---------------- |
12681466 | Image Hash | u8[48] | SHA2-384 hash of a SOC image. |
1269-
1270-| 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)
1271-| 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)
1272-| 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)
1273-| 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)
1274-| 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)
1275-| 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)
1276-| 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)
1277-| 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)
1278-| 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)
1279-| 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)
1467+| Image_id | u32 | This corresponds to the `Image Identifier` field in the [SoC Manifest](https://github.com/chipsalliance/caliptra-sw/blob/main/auth-manifest/README.md) |
1468+| Component_id | u32 | This corresponds to the `Component Id` field in the [SoC Manifest](https://github.com/chipsalliance/caliptra-sw/blob/main/auth-manifest/README.md) |
1469+| flags | u32 | This corresponds to the `flags` field in the [SoC Manifest](https://github.com/chipsalliance/caliptra-sw/blob/main/auth-manifest/README.md) |
1470+| 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/auth-manifest/README.md) |
1471+| 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/auth-manifest/README.md) |
1472+| Staging Address High | u32 | This corresponds to the `Staging Address High` field in the [SoC Manifest](https://github.com/chipsalliance/caliptra-sw/blob/main/auth-manifest/README.md) |
1473+| Staging Address Low | u32 | This corresponds to the `Staging Address Low` field in the [SoC Manifest](https://github.com/chipsalliance/caliptra-sw/blob/main/auth-manifest/README.md) |
1474+| Classification | u32 | This corresponds to the `Classification` field in the [SoC Manifest](https://github.com/chipsalliance/caliptra-sw/blob/main/auth-manifest/README.md) |
1475+| Version Number | u32 | This corresponds to the `Version Number` field in the [SoC Manifest](https://github.com/chipsalliance/caliptra-sw/blob/main/auth-manifest/README.md) |
1476+| Version String | u8[32] | This corresponds to the `Version String` field in the [SoC Manifest](https://github.com/chipsalliance/caliptra-sw/blob/main/auth-manifest/README.md) |
1477+
12801478
12811479 ### VERIFY_AUTH_MANIFEST
12821480
@@ -1342,8 +1540,8 @@
13421540
13431541 *Table: `AUTHORIZE_AND_STASH` input arguments*
13441542
1345-| **Name** | **Type** | **Description**
1346-| ------------| -------- | ---------------
1543+| **Name** | **Type** | **Description** |
1544+| ------------ | -------- | --------------- |
13471545 | chksum | u32 | Checksum over other input arguments, computed by the caller. Little endian. |
13481546 | fw_id | u8[4] | Firmware id of the image, in little-endian format |
13491547 | 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. |
@@ -1379,8 +1577,8 @@
13791577 | **Name** | **Type** | **Description** |
13801578 | -------------- | -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
13811579 | chksum | u32 | Checksum over other input arguments, computed by the caller. Little endian. |
1382-
1383-| fw_id | u32 | Firmware id of the image, in little-endian format
1580+| fw_id | u32 | Firmware id of the image, in little-endian format |
1581+
13841582
13851583 *Table: `GET_IMAGE_INFO` output arguments*
13861584
@@ -1388,13 +1586,36 @@
13881586 | -------------- | -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
13891587 | chksum | u32 | Checksum over other output arguments, computed by Caliptra. Little endian. |
13901588 | fips_status | u32 | Indicates if the command is FIPS approved or an error. |
1391-| 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) |
1392-| 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) |
1393-| 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) |
1394-| 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) |
1395-| 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) |
1396-| 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) |
1589+| Component_id | u32 | This corresponds to the `Component Id` field in the [SoC Manifest](https://github.com/chipsalliance/caliptra-sw/blob/main/auth-manifest/README.md) |
1590+| flags | u32 | This corresponds to the `flags` field in the [SoC Manifest](https://github.com/chipsalliance/caliptra-sw/blob/main/auth-manifest/README.md) |
1591+| 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/auth-manifest/README.md) |
1592+| 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/auth-manifest/README.md) |
1593+| Staging Address High | u32 | This corresponds to the `Staging Address High` field in the [SoC Manifest](https://github.com/chipsalliance/caliptra-sw/blob/main/auth-manifest/README.md) |
1594+| Staging Address Low | u32 | This corresponds to the `Staging Address Low` field in the [SoC Manifest](https://github.com/chipsalliance/caliptra-sw/blob/main/auth-manifest/README.md) |
13971595 | digest | u8[48] | SHA-384 digest of the image. **Only present in FW 2.0.2+ and 2.1.1+.** |
1596+
1597+
1598+### GET\_MCU\_FW\_SIZE
1599+
1600+Returns the size and SHA-384 digest of the MCU firmware image that was downloaded during the recovery flow. This command is used by MCU ROM during encrypted boot so it can issue `CM_AES_GCM_DECRYPT_DMA` with the correct size and without recomputing the digest.
1601+
1602+Command Code: `0x474D_4653` ("GMFS")
1603+
1604+*Table: `GET_MCU_FW_SIZE` input arguments*
1605+
1606+| **Name** | **Type** | **Description** |
1607+| -------------- | -------------- | --------------------------------------------------------------------------- |
1608+| chksum | u32 | Checksum over other input arguments, computed by the caller. Little endian. |
1609+
1610+
1611+*Table: `GET_MCU_FW_SIZE` output arguments*
1612+
1613+| **Name** | **Type** | **Description** |
1614+| -------------- | -------------- | -------------------------------------------------------------------------- |
1615+| chksum | u32 | Checksum over other output arguments, computed by Caliptra. Little endian. |
1616+| fips_status | u32 | Indicates if the command is FIPS approved or an error. |
1617+| size | u32 | Size of the MCU firmware image in bytes. |
1618+| sha384 | u8[48] | SHA-384 digest of the encrypted MCU firmware image. |
13981619
13991620
14001621 ### ACTIVATE_FIRMWARE
@@ -1412,7 +1633,43 @@
14121633 | count | u32 | Number of image_ids to activate. Item count of image_ids array parameter |
14131634 | mcu_image_size | u32 | Size of MCU image, if included in the activation |
14141635 | image_ids | Array of u8[4] | Array of Image ids in little-endian format |
1415-
1636+| flags | u32 | Optional flags (see below). Caliptra runtime 2.1.1+ only. |
1637+
1638+
1639+*Flags*
1640+
1641+| **Bit** | **Name** | **Description** |
1642+| ------- | ----------------- | ------------------------------------------------------------------------------------------------------------------------ |
1643+| 0 | `INITIAL_ACTIVATE` | First-time MCU activation after the encrypted-boot flow. Caliptra runtime 2.1.1+ only. See below. |
1644+
1645+
1646+Unknown flag bits are rejected with `RUNTIME_MAILBOX_INVALID_PARAMS`.
1647+
1648+`INITIAL_ACTIVATE` is used exclusively by MCU ROM at the tail of the
1649+`EncryptedFirmware` boot flow. MCU ROM has already loaded firmware into MCU
1650+SRAM via `RI_DOWNLOAD_ENCRYPTED_FIRMWARE` and decrypted it in place via
1651+`CM_AES_GCM_DECRYPT_DMA`. When this flag is set, Caliptra Runtime:
1652+
1653+- Skips the hitless-update steps (set `RESET_REASON.FwHitlessUpd`, clear
1654+ `FW_EXEC_CTRL`, wait for MCU reset request and reset assertion, DMA-reload
1655+ from staging, re-`AuthorizeAndStash`).
1656+- Just publishes `FW_EXEC_CTRL[MCU]` (and any other requested bits) so that
1657+ MCI's `BOOT_RST_MCU` state releases MCU from reset on the next warm reset
1658+ that MCU ROM triggers.
1659+
1660+Caliptra Runtime only honors `INITIAL_ACTIVATE` when **all** of the following
1661+are true; otherwise the command fails with `IMAGE_VERIFIER_ACTIVATION_FAILED`:
1662+
1663+1. The MCU image bit is included in the activation request.
1664+2. The boot mode set by ROM is `EncryptedFirmware` (i.e., ROM received
1665+ `RI_DOWNLOAD_ENCRYPTED_FIRMWARE`).
1666+3. `FW_EXEC_CTRL[MCU]` is currently `0` — this is an initial activation,
1667+ not a hitless update masquerading as one.
1668+
1669+Together, these checks ensure that the MCU SRAM contents are
1670+integrity-protected end-to-end (ciphertext digest verified during recovery;
1671+GCM tag verified during `CM_AES_GCM_DECRYPT_DMA`) before Caliptra releases
1672+MCU to execute them.
14161673
14171674 *Table: `ACTIVATE_FIRMWARE` output arguments*
14181675
@@ -1421,6 +1678,28 @@
14211678 | chksum | u32 | Checksum over other output arguments, computed by Caliptra. Little endian. |
14221679 | fips_status | u32 | Indicates if the command is FIPS approved or an error. |
14231680
1681+
1682+## Mailbox commands: OCP LOCK v1.0
1683+
1684+These commands are defined in the OCP LOCK v1.0 [specification](https://github.com/chipsalliance/Caliptra/blob/main/doc/ocp_lock/releases/OCP_LOCK_Specification_v1.0_RC2.pdf).
1685+
1686+### ENUMERATE_HPKE_HANDLES
1687+### REPORT_HEK_METADATA
1688+### GET_ALGORITHMS
1689+### INITIALIZE_MEK_SECRET
1690+### ROTATE_HPKE_KEY
1691+### GENERATE_MEK
1692+### GENERATE_MPK
1693+### REWRAP_MPK
1694+### ENABLE_MPK
1695+### MIX_MPK
1696+### GET_HPKE_PUB_KEY
1697+### TEST_ACCESS_KEY
1698+### GET_STATUS
1699+### CLEAR_KEY_CACHE
1700+### UNLOAD_MEK
1701+### LOAD_MEK
1702+### DERIVE_MEK
14241703
14251704 ## Mailbox commands: Cryptographic Mailbox (2.0)
14261705
@@ -1524,6 +1803,99 @@
15241803 | fips_status | u32 | FIPS approved or an error |
15251804 | hash size | u32 ||
15261805 | hash | u8[hash size] ||
1806+
1807+
1808+### CM\_SHAKE256\_INIT
1809+
1810+This starts the computation of a SHAKE256 extendable-output hash, which may be larger than a single mailbox command allows.
1811+
1812+**Note:** Unlike the CM\_SHA commands, SHAKE256 cannot save and restore hardware state between calls. Instead, the SHA3 hardware state is kept live, and the context returned to the caller is an encrypted random session token. If any other SHA3 operation occurs between INIT and FINAL, the session is invalidated and UPDATE/FINAL will return an error.
1813+
1814+The sequence to use these are:
1815+* 1 `CM_SHAKE256_INIT` command
1816+* 0 or more `CM_SHAKE256_UPDATE` commands
1817+* 1 `CM_SHAKE256_FINAL` command
1818+
1819+For each command, the context from the previous command's output must be passed as an input.
1820+
1821+The `SHAKE256_CONTEXT_SIZE` is always exactly 44 bytes long (encrypted session token).
1822+
1823+The maximum supported input data size per command is 4096 bytes.
1824+
1825+Command Code: `0x434D_5849` ("CMXI")
1826+
1827+*Table: `CM_SHAKE256_INIT` input arguments*
1828+
1829+| **Name** | **Type** | **Description** |
1830+| --------- | ------------- | --------------- |
1831+| chksum | u32 ||
1832+| data size | u32 ||
1833+| data | u8[data size] | Data to hash |
1834+
1835+
1836+*Table: `CM_SHAKE256_INIT` output arguments*
1837+
1838+| **Name** | **Type** | **Description** |
1839+| ----------- | ------------------------- | -------------------------------------------------- |
1840+| chksum | u32 ||
1841+| fips_status | u32 | FIPS approved or an error |
1842+| context | u8[SHAKE256_CONTEXT_SIZE] | Passed to `CM_SHAKE256_UPDATE` / `CM_SHAKE256_FINAL` |
1843+
1844+
1845+### CM\_SHAKE256\_UPDATE
1846+
1847+This continues a SHAKE256 computation started by `CM_SHAKE256_INIT` or from another `CM_SHAKE256_UPDATE`.
1848+
1849+The context MUST be passed in from `CM_SHAKE256_INIT` or `CM_SHAKE256_UPDATE`.
1850+
1851+Command Code: `0x434D_5855` ("CMXU")
1852+
1853+*Table: `CM_SHAKE256_UPDATE` input arguments*
1854+
1855+| **Name** | **Type** | **Description** |
1856+| --------- | ------------------------- | ---------------------------------------------------- |
1857+| chksum | u32 ||
1858+| context | u8[SHAKE256_CONTEXT_SIZE] | From `CM_SHAKE256_INIT` / `CM_SHAKE256_UPDATE` |
1859+| data size | u32 ||
1860+| data | u8[data size] | Data to hash |
1861+
1862+
1863+*Table: `CM_SHAKE256_UPDATE` output arguments*
1864+
1865+| **Name** | **Type** | **Description** |
1866+| ----------- | ------------------------- | -------------------------------------------------- |
1867+| chksum | u32 ||
1868+| fips_status | u32 | FIPS approved or an error |
1869+| context | u8[SHAKE256_CONTEXT_SIZE] | Passed to `CM_SHAKE256_UPDATE` / `CM_SHAKE256_FINAL` |
1870+
1871+
1872+### CM\_SHAKE256\_FINAL
1873+
1874+This finalizes the SHAKE256 computation and produces the hash of all of the data.
1875+
1876+The context MUST be passed in from `CM_SHAKE256_INIT` or `CM_SHAKE256_UPDATE`.
1877+
1878+The output is always a 64-byte SHAKE256 digest.
1879+
1880+Command Code: `0x434D_5846` ("CMXF")
1881+
1882+*Table: `CM_SHAKE256_FINAL` input arguments*
1883+
1884+| **Name** | **Type** | **Description** |
1885+| ----------- | ------------------------- | ---------------------------------------------- |
1886+| chksum | u32 ||
1887+| context | u8[SHAKE256_CONTEXT_SIZE] | From `CM_SHAKE256_INIT` / `CM_SHAKE256_UPDATE` |
1888+| data size | u32 | May be 0 |
1889+| data | u8[data size] | Data to hash |
1890+
1891+
1892+*Table: `CM_SHAKE256_FINAL` output arguments*
1893+
1894+| **Name** | **Type** | **Description** |
1895+| ----------- | -------- | ------------------------- |
1896+| chksum | u32 ||
1897+| fips_status | u32 | FIPS approved or an error |
1898+| hash | u8[64] | SHAKE256 digest |
15271899
15281900
15291901 ### CM\_HMAC
@@ -1814,6 +2186,79 @@
18142186 | fips_status | u32 | FIPS approved or an error |
18152187
18162188
2189+### CM_MLKEM_KEY_GEN
2190+
2191+Generates an ML-KEM-1024 encapsulation key from the seed (seed\_d || seed\_z, 64 bytes) stored in a CMK with key usage `Mlkem`.
2192+
2193+The key generation algorithm is described in [FIPS 203](https://csrc.nist.gov/pubs/fips/203/final).
2194+
2195+Command Code: `0x434D_4C4B` ("CMLK")
2196+
2197+*Table: `CM_MLKEM_KEY_GEN` input arguments*
2198+| **Name** | **Type** | **Description** |
2199+| -------- | -------- | ---------------------------------------- |
2200+| chksum | u32 ||
2201+| CMK | CMK | ML-KEM seed (seed\_d &#124;&#124; seed\_z) |
2202+
2203+
2204+*Table: `CM_MLKEM_KEY_GEN` output arguments*
2205+| **Name** | **Type** | **Description** |
2206+| ----------- | -------- | ---------------------------------------- |
2207+| chksum | u32 ||
2208+| fips_status | u32 | FIPS approved or an error |
2209+| encaps_key | u8[1568] | ML-KEM-1024 encapsulation key |
2210+
2211+
2212+### CM_MLKEM_ENCAPSULATE
2213+
2214+Performs ML-KEM-1024 encapsulation against the provided encapsulation key, producing a ciphertext and a shared key wrapped as a CMK.
2215+
2216+The encapsulation algorithm is described in [FIPS 203](https://csrc.nist.gov/pubs/fips/203/final).
2217+
2218+Command Code: `0x434D_4C45` ("CMLE")
2219+
2220+*Table: `CM_MLKEM_ENCAPSULATE` input arguments*
2221+| **Name** | **Type** | **Description** |
2222+| ----------- | -------- | ---------------------------------------- |
2223+| chksum | u32 ||
2224+| key_usage | u32 | Key usage for the output CMK |
2225+| encaps_key | u8[1568] | ML-KEM-1024 encapsulation key |
2226+
2227+
2228+*Table: `CM_MLKEM_ENCAPSULATE` output arguments*
2229+| **Name** | **Type** | **Description** |
2230+| ----------- | -------- | ---------------------------------------- |
2231+| chksum | u32 ||
2232+| fips_status | u32 | FIPS approved or an error |
2233+| ciphertext | u8[1568] | ML-KEM-1024 ciphertext |
2234+| shared_key | CMK | CMK of the shared secret key |
2235+
2236+
2237+### CM_MLKEM_DECAPSULATE
2238+
2239+Performs ML-KEM-1024 decapsulation using the seed in the provided CMK and the given ciphertext, recovering the shared key wrapped as a CMK. This uses the hardware's combined keygen\_decapsulate operation to avoid materializing the full 3168-byte decapsulation key in memory.
2240+
2241+The decapsulation algorithm is described in [FIPS 203](https://csrc.nist.gov/pubs/fips/203/final).
2242+
2243+Command Code: `0x434D_4C44` ("CMLD")
2244+
2245+*Table: `CM_MLKEM_DECAPSULATE` input arguments*
2246+| **Name** | **Type** | **Description** |
2247+| ----------- | -------- | ---------------------------------------- |
2248+| chksum | u32 ||
2249+| key_usage | u32 | Key usage for the output CMK |
2250+| CMK | CMK | ML-KEM seed (seed\_d &#124;&#124; seed\_z) |
2251+| ciphertext | u8[1568] | ML-KEM-1024 ciphertext to decapsulate |
2252+
2253+
2254+*Table: `CM_MLKEM_DECAPSULATE` output arguments*
2255+| **Name** | **Type** | **Description** |
2256+| ----------- | -------- | ---------------------------------------- |
2257+| chksum | u32 ||
2258+| fips_status | u32 | FIPS approved or an error |
2259+| shared_key | CMK | CMK of the shared secret key |
2260+
2261+
18172262 ### CM_AES_ENCRYPT_INIT
18182263
18192264 Generic AES operation for unauthenticated AES operations.
@@ -1860,8 +2305,7 @@
18602305 | mode | u32 ||
18612306 | key | u8[32] ||
18622307 | iv | u8[16] ||
1863-| fips_status | u8 | 1 = FIPS valid |
1864-| reserved | u8[75] | Reserved for additional fields |
2308+| reserved | u8[76] | Reserved for additional fields |
18652309
18662310
18672311 The size of the (encrypted) context is always exactly 156 bytes,
@@ -2010,8 +2454,7 @@
20102454 | GHASH state | u8[16] ||
20112455 | current length | u32 | value mod 16 is buffer size |
20122456 | buffer | u8[16] ||
2013-| fips_status | u8 | 1 = FIPS valid |
2014-| reserved | u8[15] ||
2457+| reserved | u8[16] ||
20152458
20162459
20172460 The size of the (encrypted) context is always exactly 128 bytes,
@@ -2283,6 +2726,45 @@
22832726 | plaintext | u8[plaintext size] ||
22842727
22852728
2729+### CM_AES_GCM_DECRYPT_DMA
2730+
2731+Performs in-place AES-256-GCM decryption of data at an AXI address using DMA. This command is specifically designed for decrypting MCU firmware that was downloaded via the `RI_DOWNLOAD_ENCRYPTED_FIRMWARE` command.
2732+
2733+**Important restrictions:**
2734+- This command is only available in subsystem mode, as DMA is only available in subsystem.
2735+- This command is only available for MCU.
2736+- This command is only available when the boot mode is `EncryptedFirmware`, which is set by ROM when it receives the `RI_DOWNLOAD_ENCRYPTED_FIRMWARE` command.
2737+- The command performs a two-pass operation:
2738+ 1. First pass: Verifies the SHA384 hash of the encrypted data at the AXI address
2739+ 2. Second pass: Performs in-place AES-GCM decryption via DMA
2740+
2741+The CMK must be an AES key (key usage = 3) that was previously imported using `CM_IMPORT`.
2742+
2743+Command Code: `0x434D_4444` ("CMDD")
2744+
2745+*Table: `CM_AES_GCM_DECRYPT_DMA` input arguments*
2746+| **Name** | **Type** | **Description** |
2747+| --------------------- | --------- | ---------------------------------------------------- |
2748+| chksum | u32 | Checksum over other input arguments |
2749+| cmk | CMK | Encrypted CMK containing the AES-256 key |
2750+| iv | u32[3] | AES-GCM initialization vector (12 bytes) |
2751+| tag | u32[4] | AES-GCM authentication tag (16 bytes) |
2752+| encrypted_data_sha384 | u8[48] | SHA384 hash of the encrypted data for verification |
2753+| axi_addr_lo | u32 | Lower 32 bits of the AXI address |
2754+| axi_addr_hi | u32 | Upper 32 bits of the AXI address |
2755+| length | u32 | Length of data to decrypt in bytes |
2756+| aad_length | u32 | Length of AAD in bytes (0-4095) |
2757+| aad | u8[...] | Additional authenticated data |
2758+
2759+
2760+*Table: `CM_AES_GCM_DECRYPT_DMA` output arguments*
2761+| **Name** | **Type** | **Description** |
2762+| ------------ | -------- | ----------------------------------------------------- |
2763+| chksum | u32 | Checksum over other output arguments |
2764+| fips_status | u32 | FIPS approved or an error |
2765+| tag_verified | u32 | 1 if GCM tag verification succeeded, 0 if it failed |
2766+
2767+
22862768 ### CM_ECDH_GENERATE
22872769
22882770 This computes the first half of an Elliptic Curve Diffie-Hellman exchange to compute an ephemeral shared key pair with another party.
@@ -2401,9 +2883,9 @@
24012883 ### CM\_DERIVE\_STABLE\_KEY
24022884
24032885 Derives an HMAC key that has a stable value across resets from either
2404-IDevId or LDevId.
2405-
2406-The (interior) value of the returned CMK will be the stable across resets as it is derived indirectly from the IDevId or LDevId CDIs.
2886+IDevId, LDevId, or the Owner Root Key (derived from HEK seed).
2887+
2888+The (interior) value of the returned CMK will be the stable across resets as it is derived indirectly from the IDevId or LDevId CDIs, or from the HEK-seed-derived Owner Root Key.
24072889 The actual encrypted bytes of the CMK will *not* be the same, and
24082890 the encrypted CMK itself cannot be used across resets. So, the key
24092891 will always need to be re-derived after every *cold* reset.
@@ -2411,22 +2893,36 @@
24112893 If a key usage other than HMAC is desired, then the KDF or HKDF
24122894 mailbox functions can be used to derive a key from the returned CMK.
24132895
2414-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.
2896+`key_type = OwnerKey` is only available in subsystem mode when the Stable Owner
2897+Key strap is enabled (`SS_STRAP_GENERIC[3]` bit 0 set to 1) and OCP LOCK is not
2898+enabled. If these requirements are not met, the command fails with
2899+`CMB_STABLE_OWNER_KEY_NOT_AVAILABLE`.
2900+
2901+For `OwnerKey`, this command derives from the ROM-populated Stable Owner Root
2902+Key. It first runs AES-256-CMAC KDF with `info` as the input data to produce an
2903+intermediate key, then runs HMAC-SHA512 KDF with `b"Stable Owner Key" || info`
2904+as the domain-separation input to produce the returned 64-byte HMAC key
2905+material. Caliptra wraps that key material as an encrypted CMK before returning
2906+it to the caller.
2907+
2908+The command derivation is summarized below:
2909+
2910+![CM_DERIVE_STABLE_KEY Derivation](../images/caliptra-sw/runtime/../rom/dev/doc/svg/cm-derive-stable-key.svg)
24152911
24162912 Command Code: `0x434D_4453` ("CMDS")
24172913
24182914 *Table: `CM_DERIVE_STABLE_KEY` input arguments*
24192915
2420-| **Name** | **Type** | **Description**
2421-| -------- | -------- | ---------------
2916+| **Name** | **Type** | **Description** |
2917+| -------- | -------- | --------------- |
24222918 | chksum | u32 | Checksum over other input arguments, computed by the caller. Little endian. |
2423-| key_type | u32 | Source key to derive the stable key from. **0x0000_0001:** IDevId <br> **0x0000_0002:** LDevId |
2919+| key_type | u32 | Source key to derive the stable key from. **0x0000_0001:** IDevId <br> **0x0000_0002:** LDevId <br> **0x0000_0003:** OwnerKey (derived from HEK seed) |
24242920 | info | u8[32] | Data to use in the key derivation. |
24252921
24262922
24272923 *Table: `CM_DERIVE_STABLE_KEY` output arguments*
2428-| **Name** | **Type** | **Description**
2429-| -------- | -------- | ---------------
2924+| **Name** | **Type** | **Description** |
2925+| -------- | -------- | --------------- |
24302926 | chksum | u32 | Checksum over other output arguments, computed by Caliptra. Little endian. |
24312927 | cmk | CMK | CMK that stores the stable key material |
24322928
@@ -2436,9 +2932,6 @@
24362932 Imports the specified key and returns a CMK for it.
24372933
24382934 Usage information is required so that the key can be verified and used appropriately.
2439-
2440-Note that it is the caller's responsibility to ensure that the source
2441-key material meets FIPS requirements, such as zeroization.
24422935
24432936 Command Code: `0x434D_494D` ("CMIM")
24442937
@@ -2523,14 +3016,14 @@
25233016
25243017 *Table: `GET_IDEV_ECC384_CSR` input arguments*
25253018
2526-| **Name** | **Type** | **Description**
2527-| -------- | -------- | ---------------
3019+| **Name** | **Type** | **Description** |
3020+| -------- | -------- | --------------- |
25283021 | chksum | u32 | Checksum over other input arguments, computed by the caller. Little endian. |
25293022
25303023
25313024 *Table: `GET_IDEV_ECC384_CSR` output arguments*
2532-| **Name** | **Type** | **Description**
2533-| -------- | -------- | ---------------
3025+| **Name** | **Type** | **Description** |
3026+| -------- | -------- | --------------- |
25343027 | chksum | u32 | Checksum over other output arguments, computed by Caliptra. Little endian. |
25353028 | data\_size | u32 | Length in bytes of the valid data in the data field. |
25363029 | data | u8[...] | DER-encoded ECC384 IDevID certificate signing request. |
@@ -2542,14 +3035,14 @@
25423035
25433036 *Table: `GET_IDEV_MLDSA87_CSR` input arguments*
25443037
2545-| **Name** | **Type** | **Description**
2546-| -------- | -------- | ---------------
3038+| **Name** | **Type** | **Description** |
3039+| -------- | -------- | --------------- |
25473040 | chksum | u32 | Checksum over other input arguments, computed by the caller. Little endian. |
25483041
25493042
25503043 *Table: `GET_IDEV_MLDSA87_CSR` output arguments*
2551-| **Name** | **Type** | **Description**
2552-| -------- | -------- | ---------------
3044+| **Name** | **Type** | **Description** |
3045+| -------- | -------- | --------------- |
25533046 | chksum | u32 | Checksum over other output arguments, computed by Caliptra. Little endian. |
25543047 | data\_size | u32 | Length in bytes of the valid data in the data field. |
25553048 | data | u8[...] | DER-encoded MLDSA87 IDevID certificate signing request. |
@@ -2569,14 +3062,14 @@
25693062
25703063 *Table: `GET_FMC_ALIAS_ECC384_CSR` input arguments*
25713064
2572-| **Name** | **Type** | **Description**
2573-| -------- | -------- | ---------------
3065+| **Name** | **Type** | **Description** |
3066+| -------- | -------- | --------------- |
25743067 | chksum | u32 | Checksum over other input arguments, computed by the caller. Little endian. |
25753068
25763069
25773070 *Table: `GET_FMC_ALIAS_ECC384_CSR` output arguments*
2578-| **Name** | **Type** | **Description**
2579-| -------- | -------- | ---------------
3071+| **Name** | **Type** | **Description** |
3072+| -------- | -------- | --------------- |
25803073 | chksum | u32 | Checksum over other output arguments, computed by Caliptra. Little endian. |
25813074 | data\_size | u32 | Length in bytes of the valid data in the data field. |
25823075 | data | u8[...] | DER-encoded ECC384 FMC Alias certificate signing request. |
@@ -2588,14 +3081,14 @@
25883081
25893082 *Table: `GET_FMC_ALIAS_MLDSA87_CSR` input arguments*
25903083
2591-| **Name** | **Type** | **Description**
2592-| -------- | -------- | ---------------
3084+| **Name** | **Type** | **Description** |
3085+| -------- | -------- | --------------- |
25933086 | chksum | u32 | Checksum over other input arguments, computed by the caller. Little endian. |
25943087
25953088
25963089 *Table: `GET_FMC_ALIAS_MLDSA87_CSR` output arguments*
2597-| **Name** | **Type** | **Description**
2598-| -------- | -------- | ---------------
3090+| **Name** | **Type** | **Description** |
3091+| -------- | -------- | --------------- |
25993092 | chksum | u32 | Checksum over other output arguments, computed by Caliptra. Little endian. |
26003093 | data\_size | u32 | Length in bytes of the valid data in the data field. |
26013094 | data | u8[...] | DER-encoded MLDSA87 FMC Alias certificate signing request. |
@@ -2609,8 +3102,8 @@
26093102
26103103 *Table: `GET_ATTESTED_ECC384_CSR` input arguments*
26113104
2612-| **Name** | **Type** | **Description**
2613-| -------- | -------- | ---------------
3105+| **Name** | **Type** | **Description** |
3106+| -------- | -------- | --------------- |
26143107 | chksum | u32 | Checksum over other input arguments, computed by the caller. Little endian. |
26153108 | key_id | u32 | Key ID for which CSR is requested.<br> **0x0000_0001:** LDevId <br> **0x0000_0002:** FMC Alias <br> **0x0000_0003:** RT Alias |
26163109 | nonce | u8[32] | Nonce to be included in the CSR EAT. |
@@ -2618,8 +3111,8 @@
26183111
26193112 *Table: `GET_ATTESTED_ECC384_CSR` output arguments*
26203113
2621-| **Name** | **Type** | **Description**
2622-| -------- | -------- | ---------------
3114+| **Name** | **Type** | **Description** |
3115+| -------- | -------- | --------------- |
26233116 | chksum | u32 | Checksum over other output arguments, computed by Caliptra. Little endian. |
26243117 | data\_size | u32 | Length in bytes of the valid data in the data field. |
26253118 | data | u8[...] | DER-encoded ECC384 attested certificate signing request. |
@@ -2633,8 +3126,8 @@
26333126
26343127 *Table: `GET_ATTESTED_MLDSA87_CSR` input arguments*
26353128
2636-| **Name** | **Type** | **Description**
2637-| -------- | -------- | ---------------
3129+| **Name** | **Type** | **Description** |
3130+| -------- | -------- | --------------- |
26383131 | chksum | u32 | Checksum over other input arguments, computed by the caller. Little endian. |
26393132 | key_id | u32 | Key ID for which CSR is requested.<br> **0x0000_0001:** LDevId <br> **0x0000_0002:** FMC Alias <br> **0x0000_0003:** RT Alias |
26403133 | nonce | u8[32] | Nonce to be included in the CSR EAT. |
@@ -2642,8 +3135,8 @@
26423135
26433136 *Table: `GET_ATTESTED_MLDSA87_CSR` output arguments*
26443137
2645-| **Name** | **Type** | **Description**
2646-| -------- | -------- | ---------------
3138+| **Name** | **Type** | **Description** |
3139+| -------- | -------- | --------------- |
26473140 | chksum | u32 | Checksum over other output arguments, computed by Caliptra. Little endian. |
26483141 | data\_size | u32 | Length in bytes of the valid data in the data field. |
26493142 | data | u8[...] | DER-encoded MLDSA87 attested certificate signing request. |
@@ -2657,23 +3150,23 @@
26573150
26583151 *Table: `SIGN_WITH_EXPORTED_ECDSA` input arguments*
26593152
2660-| **Name** | **Type** | **Description**
2661-| -------- | -------- | ---------------
3153+| **Name** | **Type** | **Description** |
3154+| -------- | -------- | --------------- |
26623155 | chksum | u32 | Checksum over other input arguments, computed by the caller. Little endian. |
2663-| exported_cdi_handle | u8[32] | The Exported CDI handle returned by the DPE `DeriveContext` command. Little endian. |
2664-| tbs | u8[48] | The bytes to be signed. Little endian. |
3156+| exported_cdi_handle | u8[32] | The exported CDI handle returned by the DPE `DeriveContext` command. Opaque byte array; copy the bytes exactly as returned. |
3157+| tbs | u8[48] | The 48-byte SHA-384 digest to be signed. Raw byte array; no byte swapping is required. |
26653158
26663159
26673160 *Table: `SIGN_WITH_EXPORTED_ECDSA` output arguments*
2668-| **Name** | **Type** | **Description**
2669-| -------- | -------- | ---------------
3161+| **Name** | **Type** | **Description** |
3162+| -------- | -------- | --------------- |
26703163 | derived_pubkey_x | u8[48] | The X BigNum of the ECDSA public key associated with the signing key. |
26713164 | derived_pubkey_y | u8[48] | The Y BigNum of the ECDSA public key associated with the signing key. |
26723165 | signature_r | u8[48] | The R BigNum of an ECDSA signature. |
26733166 | signature_s | u8[48] | The S BigNum of an ECDSA signature. |
26743167
26753168
2676-The `exported_cdi` can be created by calling `DeriveContext` with the `export-cdi` and `create-certificate` flags.
3169+The `exported_cdi_handle` can be created by calling `DeriveContext` with the `export-cdi` and `create-certificate` flags.
26773170
26783171 ### REVOKE\_EXPORTED\_CDI\_HANDLE
26793172
@@ -2683,16 +3176,47 @@
26833176
26843177 *Table: `REVOKE_EXPORTED_CDI_HANDLE` input arguments*
26853178
2686-| **Name** | **Type** | **Description**
2687-| -------- | -------- | ---------------
3179+| **Name** | **Type** | **Description** |
3180+| -------- | -------- | --------------- |
26883181 | chksum | u32 | Checksum over other input arguments, computed by the caller. Little endian. |
2689-| exported_cdi_handle | u8[32] | The Exported CDI handle returned by the DPE `DeriveContext` command. Little endian. |
2690-
2691-
2692-The `exported_cdi` can be created by calling `DeriveContext` with the `export-cdi` and `create-certificate` flags.
3182+| exported_cdi_handle | u8[32] | The exported CDI handle returned by the DPE `DeriveContext` command. Opaque byte array; copy the bytes exactly as returned. |
3183+
3184+
3185+The `exported_cdi_handle` can be created by calling `DeriveContext` with the `export-cdi` and `create-certificate` flags.
26933186
26943187 The `exported_cdi_handle` is no longer usable after calling `REVOKE_EXPORTED_CDI_HANDLE` with it. After the `exported_cdi_handle`
2695-has been revoked, a new exported CDI can be created by calling `DeriveContext` with the `export-cdi` and `create-certificate` flags.
3188+has been revoked, a new exported CDI handle can be created by calling `DeriveContext` with the `export-cdi` and `create-certificate` flags.
3189+
3190+### EXTERNAL_MAILBOX_CMD
3191+
3192+Command Code: `0x4558_544D` ("EXTM")
3193+
3194+**Important restrictions:**
3195+- This command is only available in subsystem mode in 2.1+.
3196+- This command is only available for MCU.
3197+
3198+Executes a mailbox command located at an AXI address.
3199+This allows for executing mailbox commands that are larger than the mailbox allows.
3200+
3201+This is currently mostly useful for FIRMWARE_LOAD (as part of an update) or SET_AUTH_MANIFEST.
3202+
3203+The response is still written to the mailbox.
3204+
3205+The checksum is over the EXTM command, *not* the command that is loaded over AXI.
3206+That external command will still need its own checksum, if applicable.
3207+
3208+*Table: `EXTERNAL_MAILBOX_CMD` input arguments*
3209+
3210+| **Name** | **Type** | **Description** |
3211+| -------- | -------- | --------------- |
3212+| chksum | u32 | Checksum over other input arguments, computed by the caller. Little endian. |
3213+| command_id | u32 | Command ID for the mailbox command to be executed. Little endian. |
3214+| command_size | u32 | Size of the mailbox command to be executed. Little endian. |
3215+| axi_address_low | u32 | Lower 32 bits of the AXI address that contains the mailbox command. Little endian. |
3216+| axi_address_high | u32 | High 32 bits of the AXI address that contains the mailbox command. Little endian. |
3217+
3218+
3219+The response will be the response of the executed external command.
26963220
26973221 ### REALLOCATE\_DPE\_CONTEXT\_LIMITS
26983222
@@ -2702,24 +3226,119 @@
27023226
27033227 *Table: `REALLOCATE_DPE_CONTEXT_LIMITS` input arguments*
27043228
2705-| **Name** | **Type** | **Description**
2706-| -------- | -------- | ---------------
3229+| **Name** | **Type** | **Description** |
3230+| -------- | -------- | --------------- |
27073231 | chksum | u32 | Checksum over other input arguments, computed by the caller. Little endian. |
27083232 | pl0_context_limit | u32 | Number of contexts to allocate to PL0. PL1 will receive remaining contexts. |
27093233
27103234
27113235 *Table: `REALLOCATE_DPE_CONTEXT_LIMITS` output arguments*
2712-| **Name** | **Type** | **Description**
2713-| -------- | -------- | ---------------
3236+| **Name** | **Type** | **Description** |
3237+| -------- | -------- | --------------- |
27143238 | chksum | u32 | Checksum over other output arguments, computed by Caliptra. Little endian. |
27153239 | fips_status | u32 | Indicates if the command is FIPS approved or an error. |
27163240 | new_pl0_context_limit | u32 | Number of contexts assigned to PL0 after the reallocation |
27173241 | new_pl1_context_limit | u32 | Number of contexts assigned to PL1 after the reallocation |
27183242
27193243
2720-This allows the user to reallocate the 32 DPE contexts between PL0 and PL1. By default, each gets 16 contexts.
3244+This allows the user to reallocate the 64 DPE contexts between PL0 and PL1. By default, each gets 32 contexts.
27213245
27223246 **Note**: 2 PL0 contexts are used by Caliptra itself during initialization.
3247+
3248+### FE\_PROG
3249+
3250+Programs Field Entropy (FE) into one of 4 FE partitions in the OTP fuse controller. This command
3251+is typically used during device provisioning flows.
3252+
3253+**Note**: This command is only available when the device is in the **Production** lifecycle state.
3254+
3255+Command Code: `0x4645_5052` ("FEPR")
3256+
3257+*Table: `FE_PROG` input arguments*
3258+
3259+| **Name** | **Type** | **Description**
3260+| -------- | -------- | ---------------
3261+| chksum | u32 | Checksum over other input arguments, computed by the caller. Little endian.
3262+| partition | u32 | FE partition number (valid values: 0–3).
3263+
3264+`FE_PROG` returns no output arguments other than the mailbox response header.
3265+
3266+### PRODUCTION\_AUTH\_DEBUG\_UNLOCK\_REQ
3267+
3268+Initiates the production debug unlock flow by generating a cryptographic challenge. The caller
3269+must solve the challenge by signing it with the appropriate ECC and MLDSA keys and returning
3270+the result via the [`PRODUCTION_AUTH_DEBUG_UNLOCK_TOKEN`](#production_auth_debug_unlock_token)
3271+command.
3272+
3273+This command performs the same function as the ROM's `AUTH_DEBUG_UNLOCK_REQ` command
3274+(documented in the [ROM README](../rom/dev/README.md#debug-unlock)), but is available at
3275+runtime.
3276+
3277+**Note**: This command requires the device to be in the **Production** lifecycle state and the
3278+`PROD_DEBUG_UNLOCK_REQ` bit in the `SS_DBG_MANUF_SERVICE_REG_REQ` register to be set.
3279+
3280+Command Code: `0x5044_5552` ("PDUR")
3281+
3282+*Table: `PRODUCTION_AUTH_DEBUG_UNLOCK_REQ` input arguments*
3283+
3284+| **Name** | **Type** | **Description**
3285+| -------- | -------- | ---------------
3286+| chksum | u32 | Checksum over other input arguments, computed by the caller. Little endian.
3287+| length | u32 | Length of the payload in DWORDs.
3288+| unlock\_level | u8 | Debug unlock level (1–8).
3289+| reserved | u8[3] | Reserved.
3290+
3291+*Table: `PRODUCTION_AUTH_DEBUG_UNLOCK_REQ` output arguments*
3292+
3293+| **Name** | **Type** | **Description**
3294+| -------- | -------- | ---------------
3295+| chksum | u32 | Checksum over other output arguments, computed by Caliptra. Little endian.
3296+| fips\_status | u32 | Indicates if the command is FIPS approved or an error.
3297+| length | u32 | Length of the response payload in DWORDs.
3298+| unique\_device\_identifier | u8[32] | Device identifier of the Caliptra device. Byte array; pass through as-is to the token command.
3299+| challenge | u8[48] | Random challenge number generated by Caliptra. Byte array; pass through as-is to the token command.
3300+
3301+### PRODUCTION\_AUTH\_DEBUG\_UNLOCK\_TOKEN
3302+
3303+Completes the production debug unlock handshake by validating the caller's solution to the
3304+challenge generated by
3305+[`PRODUCTION_AUTH_DEBUG_UNLOCK_REQ`](#production_auth_debug_unlock_req). The caller must
3306+provide the device identifier and challenge from the previous request along with ECC-384 and
3307+ML-DSA-87 signatures proving possession of the authorized debug unlock key.
3308+
3309+Upon successful validation, Caliptra authorizes the debug unlock by setting the unlock level
3310+in the `SS_SOC_DBG_UNLOCK_LEVEL` register.
3311+
3312+This command performs the same function as the ROM's `AUTH_DEBUG_UNLOCK_TOKEN` command
3313+(documented in the [ROM README](../rom/dev/README.md#debug-unlock)), but is available at
3314+runtime.
3315+
3316+**Note**: This command requires a preceding successful `PRODUCTION_AUTH_DEBUG_UNLOCK_REQ` in
3317+the same boot session. The challenge is consumed on use and cannot be replayed.
3318+
3319+Command Code: `0x5044_5554` ("PDUT")
3320+
3321+*Table: `PRODUCTION_AUTH_DEBUG_UNLOCK_TOKEN` input arguments*
3322+
3323+| **Name** | **Type** | **Description**
3324+| -------- | -------- | ---------------
3325+| chksum | u32 | Checksum over other input arguments, computed by the caller. Little endian.
3326+| length | u32 | Length of the payload in DWORDs.
3327+| unique\_device\_identifier | u8[32] | Device identifier (must match value from challenge response). Byte array; copied verbatim from the challenge response.
3328+| unlock\_level | u8 | Debug unlock level (1–8, must match the original request).
3329+| reserved | u8[3] | Reserved.
3330+| challenge | u8[48] | Challenge (must match value from challenge response). Byte array; copied verbatim from the challenge response.
3331+| ecc\_public\_key | u8[96] | ECC P-384 public key (X &#124;&#124; Y, 48 bytes each). See [Byte order of cryptographic fields](#byte-order-of-cryptographic-fields).
3332+| mldsa\_public\_key | u8[2592] | ML-DSA-87 public key. See [Byte order of cryptographic fields](#byte-order-of-cryptographic-fields).
3333+| ecc\_signature | u8[96] | ECC P-384 signature over the SHA2-384 message digest. R (48 bytes) &#124; S (48 bytes). See [Byte order of cryptographic fields](#byte-order-of-cryptographic-fields).
3334+| mldsa\_signature | u8[4628] | ML-DSA-87 signature over the SHA2-512 message digest (4627 bytes + 1 reserved byte). See [Byte order of cryptographic fields](#byte-order-of-cryptographic-fields).
3335+
3336+The signed message for both ECC and ML-DSA signatures is the hash of the concatenation:
3337+`unique_device_identifier || unlock_level || reserved || challenge` (all as raw bytes).
3338+ECC uses SHA2-384; ML-DSA uses SHA2-512.
3339+
3340+`PRODUCTION_AUTH_DEBUG_UNLOCK_TOKEN` returns no output arguments other than the mailbox
3341+response header.
27233342
27243343 ## Checksum
27253344
@@ -2743,15 +3362,15 @@
27433362
27443363 ## FIPS status
27453364
2746-For every command, the firmware responds with a FIPS status of FIPS approved. There is
2747-currently no use case for any other responses or error values.
3365+For successful commands, the firmware responds with a FIPS status indicating whether the service is FIPS approved. A non-approved status is not a command error.
27483366
27493367 *Table: FIPS status codes*
27503368
27513369 | **Name** | **Value** | Description |
27523370 | --------------- | --------------------------- | --------------------------------------------------- |
27533371 | `FIPS_APPROVED` | `0x0000_0000` | Status of command is FIPS approved |
2754-| `RESERVED` | `0x0000_0001 - 0xFFFF_FFFF` | Other values reserved, will not be sent by Caliptra |
3372+| `FIPS_NOT_APPROVED_USER_SUPPLIED_DIGEST` | `0x5553_5244` | Command is not FIPS approved because the caller supplied the digest instead of the raw message |
3373+| `RESERVED` | `0x0000_0002 - 0xFFFF_FFFF` | Other values reserved, will not be sent by Caliptra |
27553374
27563375
27573376 ## Runtime Firmware updates
@@ -2830,14 +3449,14 @@
28303449 To prevent this, we establish active context limits for each PAUSER
28313450 privilege level:
28323451
2833-* PL0 - 16 active contexts
2834-* PL1 - 16 active contexts
3452+* PL0 - 32 active contexts
3453+* PL1 - 32 active contexts
28353454
28363455 If a DPE command were to activate a new context such that the total number of
28373456 active contexts in a privilege level is above its active context limit, the
28383457 InvokeDpe command should fail.
28393458
2840-At boot Caliptra Runtime FW consumes part of the PL0 active contexts (initially 16) to DeriveContext for:
3459+At boot Caliptra Runtime FW consumes part of the PL0 active contexts (initially 32) to DeriveContext for:
28413460 - RTFW Journey (RTFJ) Measurement (1)
28423461 - Caliptra Configured Initialization Values digest (CCIV) (1)
28433462 - ROM Stashed Measurements (max 8)
@@ -2845,20 +3464,20 @@
28453464 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
28463465 of active contexts in PL0's locality, and hence allow PL1 to DOS PL0.
28473466
2848-### DPE profile implementation
2849-
2850-The DPE iRoT profile leaves some choices up to implementers. This section
2851-describes specific requirements for the Caliptra DPE implementation.
3467+### Caliptra DPE Profile
3468+
3469+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.
28523470
28533471 | Name | Value | Description |
28543472 | -------------------------- | ------------------------------ | ------------------------------------------------------------------------------------------------------ |
2855-| Profile Variant | `DPE_PROFILE_IROT_P384_SHA384` | The profile variant that Caliptra implements. |
3473+| Profile Variant | `Caliptra DPE Profile` | Derived from `DPE_PROFILE_IROT_P384_SHA384`. |
28563474 | KDF | SP800-108 HMAC-CTR | KDF to use for CDI (tcg.derive.kdf-sha384) and asymmetric key (tcg.derive.kdf-sha384-p384) derivation. |
28573475 | Simulation Context Support | Yes | Whether Caliptra implements the optional Simulation Contexts feature. |
28583476 | Supports ExtendTci | Yes | Whether Caliptra implements the optional ExtendTci command. |
28593477 | Supports Auto Init | Yes | Whether Caliptra will automatically initialize the default DPE context. |
28603478 | Supports Rotate Context | Yes | Whether Caliptra supports the optional RotateContextHandle command. |
28613479 | CertifyKey Alias Key | Caliptra Runtime Alias Key | The key that will be used to sign certificates that are produced by the DPE CertifyKey command. |
3480+| `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. |
28623481
28633482
28643483 ### Supported DPE commands
@@ -2869,6 +3488,7 @@
28693488 * InitializeContext
28703489 * DeriveContext
28713490 * **Note**: The "export-cdi" flag is only available in the locality of the PL0 PAUSER.
3491+ * **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.
28723492 * CertifyKey
28733493 * Caliptra DPE supports two formats for CertifyKey: X.509 and PKCS#10 CSR.
28743494 X.509 is only available to PL0 PAUSERs.