Changes to Runtime Specification

Comparing version 2.1 to 2.0
+961 additions -221 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/4a9c80c4d577ebf6a7d105796b13437aae08013f/runtime/README.md" target="_blank">chipsalliance/caliptra-sw/runtime/README.md</a> @ <code>4a9c80c</code>
2+📄 Source: <a href="https://github.com/chipsalliance/caliptra-sw/blob/5d35f7d928afb4d190dd4619219ecd6487987f3d/runtime/README.md" target="_blank">chipsalliance/caliptra-sw/runtime/README.md</a> @ <code>5d35f7d</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
@@ -40,6 +46,20 @@
4046 * Initialize the [DICE Protection Environment (DPE)](#dice-protection-environment-dpe)
4147 * Initialize any SRAM structures used by Runtime Firmware
4248 * 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
@@ -62,10 +82,16 @@
6282 ### Command watchdog
6383
6484 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.
85+command with a timeout of `max(20_000_000, CPTRA_WDT_CFG)` cycles. Runtime reads
86+the full 64-bit configuration value; zero or a value below 20 million cycles
87+retains the existing 20-million-cycle minimum. Larger values extend the timeout.
88+
89+The timeout covers the entire command, including DMA image hashing and any
90+measurement stashing. Platforms using single-DWORD DMA hashing must configure
91+enough time for their supported image sizes and worst-case AXI latency, plus the
92+remaining command processing. Runtime stops the watchdog after command
93+processing and while idle. The watchdog is not started on debug-unlocked devices.
94+This Runtime minimum does not change ROM's watchdog configuration policy.
6995
7096 ### Fault handling
7197
@@ -102,7 +128,7 @@
102128
103129 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.
104130
105-These mailbox commands provide SHA, HMAC, HKDF, AES, RNG, MLDSA, and ECDSA services.
131+These mailbox commands provide SHA, HMAC, HKDF, AES, RNG, MLDSA, ECDSA, and ML-KEM services.
106132
107133 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.
108134
@@ -124,7 +150,7 @@
124150
125151 These contexts are intended to be opaque to the user, and SHALL be encrypted and authenticated if they contain sensitive internal data.
126152
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.
153+Runtime decrypts AES, AES-GCM, ECDH, and SHAKE256 contexts into temporary plaintext buffers guarded by `Zeroizing`. These guards wipe the buffers when the decryption helper returns, including on authentication failure. The SHAKE256 plaintext is an operation token rather than key material.
128154
129155 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.
130156
@@ -138,8 +164,7 @@
138164
139165 | **Name** | **Bits** | **Description** |
140166 | ------------- | -------- | -------------------------------------- |
141-| version | 8 | CMK version. Currently always 1. |
142-| flags | 8 | Bit 0 = FIPS valid |
167+| version | 16 | CMK version. Currently always 1. |
143168 | length | 16 | how many bits of key material are used |
144169 | key usage | 8 | represents which kind of key this is |
145170 | id | 24 | ID number |
@@ -174,8 +199,10 @@
174199 | --------- | --------- |
175200 | 0 | Reserved |
176201 | 1 | HMAC |
177-| 2 | HKDF |
178-| 3 | AES |
202+| 2 | AES |
203+| 3 | ECDSA |
204+| 4 | MLDSA |
205+| 5 | ML-KEM |
179206
180207
181208 #### Replay Prevention and Deletion
@@ -199,7 +226,7 @@
199226
200227 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.
201228
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.
229+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.
203230
204231 ### Caliptra-Endorsed Aggregated Measured Boot
205232
@@ -317,7 +344,69 @@
317344 Mailbox user 0xFFFF_FFFF is reserved for Caliptra internal use. All mailbox
318345 commands from that user will fail.
319346
320-### FW\_LOAD
347+### Byte order of cryptographic fields
348+
349+Several mailbox commands include ECC P-384 and ML-DSA-87 public keys,
350+signatures, and SHA digest values stored as `[u32]` arrays.
351+The "big endian" / "little endian" labels in individual command tables describe
352+how the **standard byte representation** produced by cryptographic
353+tools maps to those `u32` words.
354+
355+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.
356+
357+#### ECC P-384 fields (big-endian words)
358+
359+Each 4-byte group from the standard representation is byte-reversed on the
360+wire.
361+
362+Example — suppose OpenSSL produces a 48-byte X coordinate starting with:
363+
364+```
365+OpenSSL raw bytes: AB CD EF 01 23 45 67 89 ...
366+ ~~~~~~~~~~~ ~~~~~~~~~~~
367+Mailbox bytes: 01 EF CD AB 89 67 45 23 ...
368+```
369+
370+In other words: split the tool output into 4-byte groups, then reverse each
371+group.
372+
373+#### ML-DSA-87 fields (little-endian words)
374+
375+No conversion is needed. Copy the raw bytes produced by an ML-DSA-87
376+implementation (e.g., OpenSSL 3.5+, the `fips204` crate, or the NIST reference
377+implementation) directly into the mailbox buffer.
378+
379+```
380+openssl pkey output: AB CD EF 01 23 45 67 89 ...
381+Mailbox bytes: AB CD EF 01 23 45 67 89 ... (identical)
382+```
383+
384+#### SHA digest fields (big-endian words)
385+
386+Hash digests stored as `u32[N]` arrays use the same big-endian word convention
387+as ECC fields. Each 4-byte group of the standard hash output is byte-reversed
388+on the wire.
389+
390+Example — suppose `openssl dgst -sha384` produces a digest starting with:
391+
392+```
393+openssl output: A1 B2 C3 D4 E5 F6 07 18 ...
394+ ~~~~~~~~~~~ ~~~~~~~~~~~
395+Mailbox u32[12]: D4 C3 B2 A1 18 07 F6 E5 ...
396+```
397+
398+#### u8 byte-array fields (no conversion needed)
399+
400+When ECC P-384 keys, signatures, or SHA digests are declared as `u8[48]` (rather
401+than `u32[12]`), they use standard big-endian byte order — the same format
402+produced by OpenSSL and other cryptographic tools. No byte-swapping is required.
403+
404+For example, the `ECDSA384_SIGNATURE_VERIFY` input fields (`pub_key_x`,
405+`pub_key_y`, `signature_r`, `signature_s`, `hash`) and the `QUOTE_PCRS_ECC384`
406+output fields (`digest`, `signature_r`, `signature_s`) can be used directly with
407+`openssl` or OpenSSL's `BN_bin2bn()` without any conversion.
408+
409+### FIRMWARE\_LOAD
321410
322411 The `FIRMWARE_LOAD` command is handled by both ROM and Runtime Firmware.
323412
@@ -381,7 +470,14 @@
381470 | -------- | -------- | ---------------
382471 | chksum | u32 | Checksum over other output arguments, computed by Caliptra. Little endian.
383472 | fips\_status | u32 | Indicates if the command is FIPS approved or an error.
384-| capabilities | u8[16] | Firmware capabilities
473+| capabilities | u8[16] | Firmware capabilities. See table below for details.
474+
475+*Table: Firmware Capabilities Flags*
476+
477+| **Name** | **Bit** | **Description**
478+| --------------- | ------- | ---------------
479+| `RT_BASE` | 64 | Base capabilities for Caliptra Runtime v2.1.
480+| `RT_OCP_LOCK` | 65 | Runtime firmware and hardware supports OCP LOCK.
385481
386482 ### GET\_IDEV\_ECC384\_CERT
387483
@@ -670,7 +766,7 @@
670766 | **Name** | **Type** | **Description**
671767 | -------- | -------- | ---------------
672768 | chksum | u32 | Checksum over other output arguments, computed by Caliptra. Little endian.
673-| fips\_status | u32 | Indicates if the command is FIPS approved or an error.
769+| fips\_status | u32 | `FIPS_NOT_APPROVED_USER_SUPPLIED_DIGEST`, because the caller supplies the digest.
674770
675771 ### LMS\_SIGNATURE\_VERIFY
676772
@@ -711,7 +807,7 @@
711807 | **Name** | **Type** | **Description**
712808 | -------- | -------- | ---------------
713809 | chksum | u32 | Checksum over other output arguments, computed by Caliptra. Little endian.
714-| fips\_status | u32 | Indicates if the command is FIPS approved or an error.
810+| fips\_status | u32 | `FIPS_NOT_APPROVED_USER_SUPPLIED_DIGEST`, because the caller supplies the digest.
715811
716812 ### MLDSA87_SIGNATURE_VERIFY
717813
@@ -754,7 +850,7 @@
754850 | **Name** | **Type** | **Description**
755851 | -------- | -------- | ---------------
756852 | chksum | u32 | Checksum over other input arguments, computed by the caller. Little endian.
757-| digest | u32[12] | Owner public key hash.
853+| digest | u32[12] | Owner public key hash. See [Byte order of cryptographic fields](#byte-order-of-cryptographic-fields).
758854
759855 *Table: `INSTALL_OWNER_PK_HASH` output arguments*
760856
@@ -825,17 +921,13 @@
825921 | chksum | u32 | Checksum over other output arguments, computed by Caliptra. Little endian.
826922 | fips\_status | u32 | Indicates if the command is FIPS approved or an error.
827923
828-### INVOKE\_DPE\_COMMAND
829-
830-Invokes a serialized DPE command.
831-
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.
924+### INVOKE\_DPE\_ECC384
925+
926+Invokes a serialized EC-P384 DPE profile command.
835927
836928 Command Code: `0x4450_4543` ("DPEC")
837929
838-*Table: `INVOKE_DPE_COMMAND` input arguments*
930+*Table: `INVOKE_DPE_ECC384` input arguments*
839931
840932 | **Name** | **Type** | **Description**
841933 | -------- | -------- | ---------------
@@ -843,7 +935,53 @@
843935 | data\_size | u32 | Length in bytes of the valid data in the data field.
844936 | data | u8[...] | DPE command structure as defined in the DPE iRoT profile.
845937
846-*Table: `INVOKE_DPE_COMMAND` output arguments*
938+*Table: `INVOKE_DPE_ECC384` output arguments*
939+
940+| **Name** | **Type** | **Description**
941+| -------- | -------- | ---------------
942+| chksum | u32 | Checksum over other output arguments, computed by Caliptra. Little endian.
943+| fips\_status | u32 | Indicates if the command is FIPS approved or an error.
944+| data\_size | u32 | Length in bytes of the valid data in the data field.
945+| data | u8[...] | DPE response structure as defined in the DPE iRoT profile.
946+
947+### INVOKE\_DPE\_MLDSA87
948+
949+Invokes a serialized ML-DSA-87 DPE profile command. In subsystem mode a response
950+can be DMA'ed to an external address. This is especially useful for large
951+commands like `CertifyKey` or `DeriveContext` when exporting a CDI. Both of
952+these responses contain a potentially large certificate/CSR. To use this
953+feature, set the `EXTERNAL_AXI_RESPONSE` in `flags` and set the corresponding
954+AXI address and size fields. The response over the mailbox will only contain a
955+mailbox header (`chksum` and `fips_status`). The full response including the
956+mailbox header will be found at the given address.
957+
958+**Important restrictions for `EXTERNAL_AXI_RESPONSE` flag use:**
959+- This command is only available in subsystem mode, as DMA is only available in subsystem.
960+- This command is only available for MCU.
961+
962+Command Code: `0x4450_454D` ("DPEM")
963+
964+*Table: `INVOKE_DPE_MLDSA87` input arguments*
965+
966+| **Name** | **Type** | **Description** |
967+| -------------- | -------- | --------------------------------------------------------------------------- |
968+| chksum | u32 | Checksum over other input arguments, computed by the caller. Little endian. |
969+| flags | u32 | Flags to give configurations of the command. |
970+| axi\_addr\_lo | u32 | Lower word of the destination physical address. |
971+| axi\_addr\_hi | u32 | Upper word of the destination physical address. |
972+| axi\_max\_size | u32 | Maximum DMA response size. |
973+| data\_size | u32 | Length in bytes of the valid data in the data field. |
974+| data | u8[...] | DPE command structure as defined in the DPE iRoT profile. |
975+
976+
977+*Table: `INVOKE_DPE_MLDSA87` input flags*
978+
979+| **Name** | **Value** |
980+| ----------------------- | --------- |
981+| EXTERNAL\_AXI\_RESPONSE | 1 << 31 |
982+
983+
984+*Table: `INVOKE_DPE_MLDSA87` output arguments*
847985
848986 | **Name** | **Type** | **Description**
849987 | -------- | -------- | ---------------
@@ -906,8 +1044,36 @@
9061044 | PCRs | PcrValue[32] | Values of all PCRs.
9071045 | nonce | u8[32] | Return the nonce used as input for convenience.
9081046 | 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.
1047+| 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.
9101048 | 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.
1049+
1050+**Digest byte order:** The `digest` field has two transformations applied relative
1051+to the standard `openssl dgst -sha512` output: (1) the 16 u32 words are in
1052+reversed order, and (2) the bytes within each word are reversed. For example, if
1053+`openssl dgst -sha512` produces `A1 B2 C3 D4 E5 F6 07 18 ... P1 P2 P3 P4`,
1054+the mailbox response contains `P4 P3 P2 P1 ... 18 07 F6 E5 D4 C3 B2 A1`.
1055+
1056+To **independently recompute** this digest from PCR values and nonce, compute the
1057+SHA2-512 hash, then apply two steps:
1058+
1059+```
1060+openssl dgst -sha512 output (64 bytes, shown as 16 four-byte groups):
1061+ A1 B2 C3 D4 | E5 F6 07 18 | ... | M1 M2 M3 M4 | P1 P2 P3 P4
1062+
1063+Step 1 — reverse the bytes within each 4-byte group:
1064+ D4 C3 B2 A1 | 18 07 F6 E5 | ... | M4 M3 M2 M1 | P4 P3 P2 P1
1065+
1066+Step 2 — reverse the order of all 16 groups:
1067+ P4 P3 P2 P1 | M4 M3 M2 M1 | ... | 18 07 F6 E5 | D4 C3 B2 A1
1068+ ^^^^^^^^^^^^ ^^^^^^^^^^^^
1069+ (last group from Step 1 is now first) (first group is now last)
1070+
1071+Mailbox digest = result of Step 2
1072+```
1073+
1074+To **verify the signature** with an external tool such as OpenSSL, pass the `digest`
1075+bytes as-is as the pre-hashed message to ML-DSA-87 verification — no conversion
1076+is needed because the signature was computed over these exact bytes.
9111077
9121078 ### EXTEND\_PCR
9131079
@@ -1073,7 +1239,7 @@
10731239 | 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. |
10741240 | 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. |
10751241 | 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. |
1242+| fe_status | u32 | Live OTP provisioning/zeroization status of all four FE partitions in subsystem mode. Partition `i` occupies bits `[2*i+1:2*i]`: `0` = unprovisioned, `1` = provisioned, `2` = zeroized, `3` = error/indeterminate. Outside subsystem mode, all partitions report error/indeterminate. Bits 31:8 are zero. |
10771243
10781244
10791245 The response is 400 bytes in both subsystem and standalone modes. The `fe_status`
@@ -1081,12 +1247,14 @@
10811247 unavailable. Callers must use the updated response layout and validate the checksum
10821248 over the full response.
10831249
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.
1250+FE status is read for each request, not cached at boot. A zeroization marker with
1251+at least 58 set bits reports zeroized, regardless of the digest. A nonzero marker
1252+with fewer than 58 set bits reports error. With a zero marker, a zero digest reports
1253+unprovisioned and a nonzero digest reports provisioned. Locked DAI access, DMA/DAI
1254+errors, hidden digests (on hardware with secret-digest readback masking), and
1255+timeouts report error for the affected partition while leaving the
1256+other firmware information available. This metadata does not establish whether
1257+FE contributed to an existing certificate.
10901258
10911259 ### VERSION
10921260
@@ -1112,47 +1280,67 @@
11121280
11131281 ### Autonomous command-count self-tests
11141282
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:
1283+RT can automatically run the existing FIPS self-test sequence after a configured
1284+number of completed RT mailbox commands. This is workload-based, not time-based:
1285+no additional commands means no additional tests.
1286+
1287+The proposed late-binding allocation uses core `generic_input_wires[63:32]`,
1288+exposed as `CPTRA_GENERIC_INPUT_WIRES[1]` (not the MCU's generic input wires or
1289+`SS_STRAP_GENERIC`). Bit positions below are relative to that 32-bit word:
11221290
11231291 | Bits | Meaning |
11241292 | ---- | ------- |
1125-| 0 | Enable. Zero preserves manual-only behavior. |
1293+| 0 | Enable autonomous self-tests. Zero preserves existing, manual-only behavior. |
11261294 | 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.
1295+| 18:17 | Multiplier encoding: 0 = x1, 1 = x16, 2 = x256, 3 = x4096. |
1296+| 31:19 | Reserved; tie to zero. |
1297+
1298+
1299+The threshold is `base count * multiplier` (1 to 268431360 commands).
11331300 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
1301+The input-wire binding requires corresponding integration-spec allocation.
1302+
1303+RT snapshots the configuration once during each RT startup, including cold,
1304+warm, and firmware-update resets. Subsequent input changes are ignored until the
1305+next RT startup. There is no runtime disable or reconfiguration command.
1306+An enabled configuration with a zero count, nonzero reserved bits, or a build
11381307 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.
1308+`RUNTIME_INVALID_SELF_TEST_CONFIG`; disabled configurations ignore the other fields.
1309+
1310+Each completed RT mailbox command counts once, including rejected or failed
1311+commands and manual self-test commands. ROM commands and internal self-test
1312+execution do not count. RT finishes the active command and posts its response
1313+before checking whether a self-test is due. This includes command-scoped long
1314+SHA/DMA operations; a self-test never preempts their command handler.
1315+
1316+The test remains due while the mailbox has a pending command or an unread
1317+response. RT services pending commands first and starts the test only after
1318+acquiring mailbox ownership, preventing new requests from racing with execution.
1319+Autonomous tests also wait while a `CM_SHAKE256` streaming session retains live
1320+SHA3 hardware state between commands. The due counter is preserved through
1321+INIT/UPDATE and idle gaps; RT can sleep normally without holding the mailbox.
1322+After FINAL ends the session and its response is released, RT can run the
1323+pending suite without another trigger command.
1324+
1325+Continued mailbox activity or an abandoned streaming session can postpone the
1326+test indefinitely. A session remains active until finalized, invalidated by
1327+another SHA3 operation, or reset. There is no timeout or forced session abort:
1328+the configured count is a trigger threshold, not an upper bound on commands
1329+between tests.
1330+
1331+The suite uses the existing SHA accelerator locking behavior, runs with watchdog
1332+protection, and resets the command counter only after a successful test.
1333+A self-test failure follows the existing fatal-error path. Shutdown and reset
1334+retain their normal behavior.
1335+
1336+Manual `SELF_TEST_START` / `SELF_TEST_GET_RESULTS` remain supported. A successful
1337+manual test also resets the autonomous counter. Autonomous execution neither
1338+creates nor consumes a manual result, so unread manual results cannot block
1339+future autonomous tests. No external start command or result polling is needed.
1340+
1341+Explicit manual self-tests do not defer for a live `CM_SHAKE256` session: as
1342+before, they use the SHA3 engine and invalidate the session. Callers must restart
1343+such a session if UPDATE or FINAL reports `RUNTIME_CM_SHAKE256_CONTEXT_MISMATCH`.
11561344
11571345 ### SELF\_TEST\_START
11581346
@@ -1236,35 +1424,69 @@
12361424 | chksum | u32 | Checksum over other output arguments, computed by Caliptra. Little endian.
12371425 | fips\_status | u32 | Indicates if the command is FIPS approved or an error.
12381426
1239-### CERTIFY\_KEY\_EXTENDED
1240-
1241-Produces a DPE leaf certificate or CSR containing custom extensions provided by the SoC.
1427+### CERTIFY\_KEY\_EXTENDED\_ECC384
1428+
1429+Produces an ECC-P384 DPE leaf certificate or CSR containing custom extensions provided by the SoC.
12421430
12431431 Command Code: `0x434B_4558` ("CKEX")
12441432
1245-*Table: `CERTIFY_KEY_EXTENDED` input arguments*
1433+*Table: `CERTIFY_KEY_EXTENDED_ECC384` input arguments*
12461434
12471435 | **Name** | **Type** | **Description** |
12481436 | ----------------- | -------- | --------------------------------------------------------------------------- |
12491437 | chksum | u32 | Checksum over other input arguments, computed by the caller. Little endian. |
1438+| flags | u32 | Flags determining which custom extensions to include in the certificate. |
12501439 | certify\_key\_req | u8[72] | Certify Key Request. |
1251-| flags | u32 | Flags determining which custom extensions to include in the certificate. |
1252-
1253-
1254-*Table: `CERTIFY_KEY_EXTENDED` input flags*
1440+
1441+
1442+*Table: `CERTIFY_KEY_EXTENDED_ECC384` input flags*
12551443
12561444 | **Name** | **Offset** |
1257-| --------------- | ---------- |
1258-| DMTF_OTHER_NAME | 1 << 31 |
1259-
1260-
1261-*Table: `CERTIFY_KEY_EXTENDED` output arguments*
1262-
1263-| **Name** | **Type** | **Description** |
1264-| ------------------ | -------- | -------------------------------------------------------------------------- |
1445+| ----------------- | ---------- |
1446+| DMTF\_OTHER\_NAME | 1 << 31 |
1447+
1448+
1449+*Table: `CERTIFY_KEY_EXTENDED_ECC384` output arguments*
1450+
1451+| **Name** | **Type** | **Description** |
1452+| ------------------ | --------- | -------------------------------------------------------------------------- |
12651453 | chksum | u32 | Checksum over other output arguments, computed by Caliptra. Little endian. |
12661454 | fips\_status | u32 | Indicates if the command is FIPS approved or an error. |
1267-| certify\_key\_resp | u8[2176] | Certify Key Response. |
1455+| size | u32 | The size of the response in the certify\_key\_resp field. |
1456+| certify\_key\_resp | u8[25152] | Certify Key Response. |
1457+
1458+
1459+### CERTIFY\_KEY\_EXTENDED\_MLDSA87
1460+
1461+Produces an ML-DSA-87 DPE leaf certificate or CSR containing custom extensions provided by the SoC.
1462+
1463+Command Code: `0x434B_584D` ("CKXM")
1464+
1465+*Table: `CERTIFY_KEY_EXTENDED_MLDSA87` input arguments*
1466+
1467+| **Name** | **Type** | **Description** |
1468+| ----------------- | -------- | --------------------------------------------------------------------------- |
1469+| chksum | u32 | Checksum over other input arguments, computed by the caller. Little endian. |
1470+| flags | u32 | Flags determining which custom extensions to include in the certificate. |
1471+| certify\_key\_req | u8[72] | Certify Key Request. |
1472+
1473+
1474+*Table: `CERTIFY_KEY_EXTENDED_MLDSA87` input flags*
1475+
1476+| **Name** | **Offset** |
1477+| ----------------------- | ---------- |
1478+| DMTF\_OTHER\_NAME | 1 << 31 |
1479+| EXTERNAL\_AXI\_RESPONSE | 1 << 30 |
1480+
1481+
1482+*Table: `CERTIFY_KEY_EXTENDED_MLDSA87` output arguments*
1483+
1484+| **Name** | **Type** | **Description** |
1485+| ------------------ | --------- | -------------------------------------------------------------------------- |
1486+| chksum | u32 | Checksum over other output arguments, computed by Caliptra. Little endian. |
1487+| fips\_status | u32 | Indicates if the command is FIPS approved or an error. |
1488+| size | u32 | The size of the response in the certify\_key\_resp field. |
1489+| certify\_key\_resp | u8[25152] | Certify Key Response. |
12681490
12691491
12701492 ### CERTIFY\_KEY\_CHUNKS
@@ -1328,26 +1550,26 @@
13281550
13291551 *Table: `SET_AUTH_MANIFEST` input arguments*
13301552
1331-| **Name** | **Type** | **Description**
1332-| -------- | -------- | ---------------
1553+| **Name** | **Type** | **Description** |
1554+| -------- | -------- | --------------- |
13331555 | chksum | u32 | Checksum over other input arguments, computed by the caller. Little endian. |
13341556 | manifest size | u32 | The size of the full Authentication Manifest |
13351557 | preamble\_marker | u32 | Marker needs to be 0x4154_4D4E for the preamble to be valid |
13361558 | preamble\_size | u32 | Size of the preamble |
13371559 | preamble\_version | u32 | Version of the preamble |
13381560 | 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 |
1561+| 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). |
1562+| 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). |
1563+| preamble\_vendor\_ecc384\_sig | u32[24] | Vendor ECC384 signature. See [Byte order of cryptographic fields](#byte-order-of-cryptographic-fields). |
1564+| 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). |
1565+| 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). |
1566+| 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). |
1567+| preamble\_owner\_ecc384\_sig | u32[24] | Owner ECC384 signature. See [Byte order of cryptographic fields](#byte-order-of-cryptographic-fields). |
1568+| 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). |
1569+| metadata\_vendor\_ecc384\_sig | u32[24] | Metadata Vendor ECC384 signature. See [Byte order of cryptographic fields](#byte-order-of-cryptographic-fields). |
1570+| 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). |
1571+| metadata\_owner\_ecc384\_sig | u32[24] | Metadata Owner ECC384 signature. See [Byte order of cryptographic fields](#byte-order-of-cryptographic-fields). |
1572+| 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). |
13511573 | metadata\_entry\_entry\_count | u32 | number of metadata entries |
13521574 | metadata\_entries | Metadata[80] | The max number of metadata entries is 80 but less can be used |
13531575
@@ -1370,17 +1592,17 @@
13701592 | **Name** | **Type** | **Description** |
13711593 | ------------------------ | --------- | ---------------- |
13721594 | 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)
1595+| 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) |
1596+| 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) |
1597+| flags | u32 | This corresponds to the `flags` field in the [SoC Manifest](https://github.com/chipsalliance/caliptra-sw/blob/main/auth-manifest/README.md). Bit 3 requests single-DWORD DMA reads when Runtime hashes the image from its load or staging address. If clear, Runtime uses burst DMA reads. |
1598+| 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) |
1599+| 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) |
1600+| 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) |
1601+| 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) |
1602+| Classification | u32 | This corresponds to the `Classification` field in the [SoC Manifest](https://github.com/chipsalliance/caliptra-sw/blob/main/auth-manifest/README.md) |
1603+| 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) |
1604+| 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) |
1605+
13841606
13851607 ### VERIFY_AUTH_MANIFEST
13861608
@@ -1401,11 +1623,11 @@
14011623
14021624 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`.
14031625 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.
1626+3. The manifest's `svn` is checked against the floor encoded in `SS_STRAP_GENERIC[3][15:8]`. The check is skipped when the lifecycle is `Unprovisioned` or anti-rollback is disabled.
14051627
14061628 #### Owner Authorization Manifest Minimum SVN
14071629
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`.
1630+`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, platform 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`.
14091631
14101632 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.
14111633
@@ -1434,7 +1656,6 @@
14341656
14351657 The response is a `MailboxRespHeader` (no payload).
14361658
1437-
14381659 ### VERIFY_OWNER_AUTH_MANIFEST
14391660
14401661 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.
@@ -1443,6 +1664,7 @@
14431664
14441665 The input arguments and response are the same as the `SET_OWNER_AUTH_MANIFEST` command.
14451666
1667+
14461668 ### AUTHORIZE_AND_STASH
14471669
14481670 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).
@@ -1454,14 +1676,14 @@
14541676
14551677 *Table: `AUTHORIZE_AND_STASH` input arguments*
14561678
1457-| **Name** | **Type** | **Description**
1458-| ------------| -------- | ---------------
1679+| **Name** | **Type** | **Description** |
1680+| ------------ | -------- | --------------- |
14591681 | chksum | u32 | Checksum over other input arguments, computed by the caller. Little endian. |
14601682 | fw_id | u8[4] | Firmware id of the image, in little-endian format |
14611683 | 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. |
14621684 | context | u8[48] | Context field for `svn`; e.g., a hash of the public key that authenticated the SVN. |
14631685 | svn | u32 | The version of the image |
1464-| flags | u32 | See AUTHORIZE_AND_STASH_FLAGS below |
1686+| flags | u32 | See `AUTHORIZE_AND_STASH_FLAGS` below. |
14651687 | 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 |
14661688 | image_size | u32 | The size of the image to hash. Only valid if source is `ImageLoadAddress` or `StagingAddress` |
14671689
@@ -1484,8 +1706,7 @@
14841706 ### GET_IMAGE_INFO
14851707
14861708 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.
1709+firmware ID from the collection selected by bits `[2:1]` of `flags`.
14891710
14901711 Command Code: `0x494D_4530` ("IME0")
14911712
@@ -1504,26 +1725,42 @@
15041725 | -------------- | -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
15051726 | chksum | u32 | Checksum over other output arguments, computed by Caliptra. Little endian. |
15061727 | 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) |
1728+| 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) |
1729+| flags | u32 | This corresponds to the `flags` field in the [SoC Manifest](https://github.com/chipsalliance/caliptra-sw/blob/main/auth-manifest/README.md) |
1730+| 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) |
1731+| 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) |
1732+| 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) |
1733+| 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) |
15131734 | digest | u8[48] | SHA-384 digest of the image. **Only present in FW 2.0.2+ and 2.1.1+.** |
1735+
1736+
1737+### GET\_MCU\_FW\_SIZE
1738+
1739+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.
1740+
1741+Command Code: `0x474D_4653` ("GMFS")
1742+
1743+*Table: `GET_MCU_FW_SIZE` input arguments*
1744+
1745+| **Name** | **Type** | **Description** |
1746+| -------------- | -------------- | --------------------------------------------------------------------------- |
1747+| chksum | u32 | Checksum over other input arguments, computed by the caller. Little endian. |
1748+
1749+
1750+*Table: `GET_MCU_FW_SIZE` output arguments*
1751+
1752+| **Name** | **Type** | **Description** |
1753+| -------------- | -------------- | -------------------------------------------------------------------------- |
1754+| chksum | u32 | Checksum over other output arguments, computed by Caliptra. Little endian. |
1755+| fips_status | u32 | Indicates if the command is FIPS approved or an error. |
1756+| size | u32 | Size of the MCU firmware image in bytes. |
1757+| sha384 | u8[48] | SHA-384 digest of the encrypted MCU firmware image. |
15141758
15151759
15161760 ### ACTIVATE_FIRMWARE
15171761
15181762 The MCU uses this command to 'activate' the image that has been previously downloaded through PLDM - T5.
15191763 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.
15271764
15281765 Command Code: `0x4143_5446` ("ACTF")
15291766
@@ -1533,14 +1770,69 @@
15331770 | -------------- | -------------- | --------------------------------------------------------------------------- |
15341771 | chksum | u32 | Checksum over other input arguments, computed by the caller. Little endian. |
15351772 | 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 |
1773+| mcu_image_size | u32 | Size of MCU image in bytes, if included in the activation. Must not exceed MCU SRAM capacity for hitless updates. |
15371774 | 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`.
1775+| flags | u32 | Optional flags (see below). Caliptra runtime 2.1.1+ only. |
1776+
1777+
1778+*Flags*
1779+
1780+| **Bits** | **Name** | **Description** |
1781+| -------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------ |
1782+| 0 | `INITIAL_ACTIVATE` | First-time MCU activation after the encrypted-boot flow. Caliptra runtime 2.1.1+ only. See below. |
1783+| [2:1] | `MANIFEST_SOURCE` | `00`: vendor + owner manifest; `01`: owner-only manifest. `10` and `11` are invalid. |
1784+
1785+
1786+Unknown flag bits are rejected with `RUNTIME_MAILBOX_INVALID_PARAMS`.
1787+
1788+For MCU hitless updates (`INITIAL_ACTIVATE` clear), the MCU entry in the
1789+selected authorization manifest must set `image_load_address` to the full
1790+64-bit MCU SRAM address, `MCI_BASE + 0x00c00000`. The entire source and
1791+destination byte ranges must fit in the 64-bit AXI address space without
1792+wrapping. `mcu_image_size` must not exceed the MCU SRAM capacity reported by
1793+MCI `HW_CONFIG1.MCU_SRAM_SIZE` (in KB, multiplied by 1024 to obtain bytes).
1794+An image exactly equal to that capacity is permitted.
1795+
1796+Runtime rejects a load-address mismatch, address-range overflow, or oversized
1797+image with `IMAGE_VERIFIER_ACTIVATION_FAILED` before changing the MCU reset
1798+reason, execution-control bits, SRAM contents, or MCU firmware DPE measurement.
1799+These requirements apply to both vendor + owner and owner-only manifests.
1800+The address-range checks prevent arithmetic overflow; they do not establish
1801+that the staging memory is mapped or accessible.
1802+
1803+Runtime copies `mcu_image_size` bytes from `image_staging_address` to that
1804+MCU SRAM destination, then authorizes the image at `image_load_address`.
1805+Requiring these destination addresses to match binds the post-copy digest
1806+check to the installed firmware. After successful authorization, Runtime
1807+updates the MCU firmware DPE measurement and enables execution. SoC-only
1808+activation does not impose these MCU address and size requirements.
1809+
1810+`INITIAL_ACTIVATE` is used exclusively by MCU ROM at the tail of the
1811+`EncryptedFirmware` boot flow. MCU ROM has already loaded firmware into MCU
1812+SRAM via `RI_DOWNLOAD_ENCRYPTED_FIRMWARE` and decrypted it in place via
1813+`CM_AES_GCM_DECRYPT_DMA`. When this flag is set, Caliptra Runtime:
1814+
1815+- Skips the hitless-update steps (set `RESET_REASON.FwHitlessUpd`, clear
1816+ `FW_EXEC_CTRL`, wait for MCU reset request and reset assertion, DMA-reload
1817+ from staging, re-`AuthorizeAndStash`), including the hitless load-address
1818+ and range/size requirements above.
1819+- Just publishes `FW_EXEC_CTRL[MCU]` (and any other requested bits) so that
1820+ MCI's `BOOT_RST_MCU` state releases MCU from reset on the next warm reset
1821+ that MCU ROM triggers.
1822+
1823+Caliptra Runtime only honors `INITIAL_ACTIVATE` when **all** of the following
1824+are true; otherwise the command fails with `IMAGE_VERIFIER_ACTIVATION_FAILED`:
1825+
1826+1. The MCU image bit is included in the activation request.
1827+2. The boot mode set by ROM is `EncryptedFirmware` (i.e., ROM received
1828+ `RI_DOWNLOAD_ENCRYPTED_FIRMWARE`).
1829+3. `FW_EXEC_CTRL[MCU]` is currently `0` — this is an initial activation,
1830+ not a hitless update masquerading as one.
1831+
1832+Together, these checks ensure that the MCU SRAM contents are
1833+integrity-protected end-to-end (ciphertext digest verified during recovery;
1834+GCM tag verified during `CM_AES_GCM_DECRYPT_DMA`) before Caliptra releases
1835+MCU to execute them.
15441836
15451837 *Table: `ACTIVATE_FIRMWARE` output arguments*
15461838
@@ -1549,6 +1841,28 @@
15491841 | chksum | u32 | Checksum over other output arguments, computed by Caliptra. Little endian. |
15501842 | fips_status | u32 | Indicates if the command is FIPS approved or an error. |
15511843
1844+
1845+## Mailbox commands: OCP LOCK v1.0
1846+
1847+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).
1848+
1849+### ENUMERATE_HPKE_HANDLES
1850+### REPORT_HEK_METADATA
1851+### GET_ALGORITHMS
1852+### INITIALIZE_MEK_SECRET
1853+### ROTATE_HPKE_KEY
1854+### GENERATE_MEK
1855+### GENERATE_MPK
1856+### REWRAP_MPK
1857+### ENABLE_MPK
1858+### MIX_MPK
1859+### GET_HPKE_PUB_KEY
1860+### TEST_ACCESS_KEY
1861+### GET_STATUS
1862+### CLEAR_KEY_CACHE
1863+### UNLOAD_MEK
1864+### LOAD_MEK
1865+### DERIVE_MEK
15521866
15531867 ## Mailbox commands: Cryptographic Mailbox (2.0)
15541868
@@ -1652,6 +1966,102 @@
16521966 | fips_status | u32 | FIPS approved or an error |
16531967 | hash size | u32 ||
16541968 | hash | u8[hash size] ||
1969+
1970+
1971+### CM\_SHAKE256\_INIT
1972+
1973+This starts the computation of a SHAKE256 extendable-output hash, which may be larger than a single mailbox command allows.
1974+
1975+**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.
1976+
1977+Autonomous command-count self-tests defer until the streaming session ends.
1978+Explicit manual self-tests and other SHA3 operations can still invalidate it.
1979+
1980+The sequence to use these are:
1981+* 1 `CM_SHAKE256_INIT` command
1982+* 0 or more `CM_SHAKE256_UPDATE` commands
1983+* 1 `CM_SHAKE256_FINAL` command
1984+
1985+For each command, the context from the previous command's output must be passed as an input.
1986+
1987+The `SHAKE256_CONTEXT_SIZE` is always exactly 44 bytes long (encrypted session token).
1988+
1989+The maximum supported input data size per command is 4096 bytes.
1990+
1991+Command Code: `0x434D_5849` ("CMXI")
1992+
1993+*Table: `CM_SHAKE256_INIT` input arguments*
1994+
1995+| **Name** | **Type** | **Description** |
1996+| --------- | ------------- | --------------- |
1997+| chksum | u32 ||
1998+| data size | u32 ||
1999+| data | u8[data size] | Data to hash |
2000+
2001+
2002+*Table: `CM_SHAKE256_INIT` output arguments*
2003+
2004+| **Name** | **Type** | **Description** |
2005+| ----------- | ------------------------- | -------------------------------------------------- |
2006+| chksum | u32 ||
2007+| fips_status | u32 | FIPS approved or an error |
2008+| context | u8[SHAKE256_CONTEXT_SIZE] | Passed to `CM_SHAKE256_UPDATE` / `CM_SHAKE256_FINAL` |
2009+
2010+
2011+### CM\_SHAKE256\_UPDATE
2012+
2013+This continues a SHAKE256 computation started by `CM_SHAKE256_INIT` or from another `CM_SHAKE256_UPDATE`.
2014+
2015+The context MUST be passed in from `CM_SHAKE256_INIT` or `CM_SHAKE256_UPDATE`.
2016+
2017+Command Code: `0x434D_5855` ("CMXU")
2018+
2019+*Table: `CM_SHAKE256_UPDATE` input arguments*
2020+
2021+| **Name** | **Type** | **Description** |
2022+| --------- | ------------------------- | ---------------------------------------------------- |
2023+| chksum | u32 ||
2024+| context | u8[SHAKE256_CONTEXT_SIZE] | From `CM_SHAKE256_INIT` / `CM_SHAKE256_UPDATE` |
2025+| data size | u32 ||
2026+| data | u8[data size] | Data to hash |
2027+
2028+
2029+*Table: `CM_SHAKE256_UPDATE` output arguments*
2030+
2031+| **Name** | **Type** | **Description** |
2032+| ----------- | ------------------------- | -------------------------------------------------- |
2033+| chksum | u32 ||
2034+| fips_status | u32 | FIPS approved or an error |
2035+| context | u8[SHAKE256_CONTEXT_SIZE] | Passed to `CM_SHAKE256_UPDATE` / `CM_SHAKE256_FINAL` |
2036+
2037+
2038+### CM\_SHAKE256\_FINAL
2039+
2040+This finalizes the SHAKE256 computation and produces the hash of all of the data.
2041+
2042+The context MUST be passed in from `CM_SHAKE256_INIT` or `CM_SHAKE256_UPDATE`.
2043+
2044+The output is always a 64-byte SHAKE256 digest.
2045+
2046+Command Code: `0x434D_5846` ("CMXF")
2047+
2048+*Table: `CM_SHAKE256_FINAL` input arguments*
2049+
2050+| **Name** | **Type** | **Description** |
2051+| ----------- | ------------------------- | ---------------------------------------------- |
2052+| chksum | u32 ||
2053+| context | u8[SHAKE256_CONTEXT_SIZE] | From `CM_SHAKE256_INIT` / `CM_SHAKE256_UPDATE` |
2054+| data size | u32 | May be 0 |
2055+| data | u8[data size] | Data to hash |
2056+
2057+
2058+*Table: `CM_SHAKE256_FINAL` output arguments*
2059+
2060+| **Name** | **Type** | **Description** |
2061+| ----------- | -------- | ------------------------- |
2062+| chksum | u32 ||
2063+| fips_status | u32 | FIPS approved or an error |
2064+| hash | u8[64] | SHAKE256 digest |
16552065
16562066
16572067 ### CM\_HMAC
@@ -1894,7 +2304,7 @@
18942304
18952305 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.
18962306
1897-Command Code: `0x434D_5D53` ("CMES")
2307+Command Code: `0x434D_4553` ("CMES")
18982308
18992309 *Table: `CM_ECDSA_SIGN` input arguments*
19002310 | **Name** | **Type** | **Description** |
@@ -1942,6 +2352,79 @@
19422352 | fips_status | u32 | FIPS approved or an error |
19432353
19442354
2355+### CM_MLKEM_KEY_GEN
2356+
2357+Generates an ML-KEM-1024 encapsulation key from the seed (seed\_d || seed\_z, 64 bytes) stored in a CMK with key usage `Mlkem`.
2358+
2359+The key generation algorithm is described in [FIPS 203](https://csrc.nist.gov/pubs/fips/203/final).
2360+
2361+Command Code: `0x434D_4C4B` ("CMLK")
2362+
2363+*Table: `CM_MLKEM_KEY_GEN` input arguments*
2364+| **Name** | **Type** | **Description** |
2365+| -------- | -------- | ---------------------------------------- |
2366+| chksum | u32 ||
2367+| CMK | CMK | ML-KEM seed (seed\_d &#124;&#124; seed\_z) |
2368+
2369+
2370+*Table: `CM_MLKEM_KEY_GEN` output arguments*
2371+| **Name** | **Type** | **Description** |
2372+| ----------- | -------- | ---------------------------------------- |
2373+| chksum | u32 ||
2374+| fips_status | u32 | FIPS approved or an error |
2375+| encaps_key | u8[1568] | ML-KEM-1024 encapsulation key |
2376+
2377+
2378+### CM_MLKEM_ENCAPSULATE
2379+
2380+Performs ML-KEM-1024 encapsulation against the provided encapsulation key, producing a ciphertext and a shared key wrapped as a CMK.
2381+
2382+The encapsulation algorithm is described in [FIPS 203](https://csrc.nist.gov/pubs/fips/203/final).
2383+
2384+Command Code: `0x434D_4C45` ("CMLE")
2385+
2386+*Table: `CM_MLKEM_ENCAPSULATE` input arguments*
2387+| **Name** | **Type** | **Description** |
2388+| ----------- | -------- | ---------------------------------------- |
2389+| chksum | u32 ||
2390+| key_usage | u32 | Key usage for the output CMK |
2391+| encaps_key | u8[1568] | ML-KEM-1024 encapsulation key |
2392+
2393+
2394+*Table: `CM_MLKEM_ENCAPSULATE` output arguments*
2395+| **Name** | **Type** | **Description** |
2396+| ----------- | -------- | ---------------------------------------- |
2397+| chksum | u32 ||
2398+| fips_status | u32 | FIPS approved or an error |
2399+| ciphertext | u8[1568] | ML-KEM-1024 ciphertext |
2400+| shared_key | CMK | CMK of the shared secret key |
2401+
2402+
2403+### CM_MLKEM_DECAPSULATE
2404+
2405+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.
2406+
2407+The decapsulation algorithm is described in [FIPS 203](https://csrc.nist.gov/pubs/fips/203/final).
2408+
2409+Command Code: `0x434D_4C44` ("CMLD")
2410+
2411+*Table: `CM_MLKEM_DECAPSULATE` input arguments*
2412+| **Name** | **Type** | **Description** |
2413+| ----------- | -------- | ---------------------------------------- |
2414+| chksum | u32 ||
2415+| key_usage | u32 | Key usage for the output CMK |
2416+| CMK | CMK | ML-KEM seed (seed\_d &#124;&#124; seed\_z) |
2417+| ciphertext | u8[1568] | ML-KEM-1024 ciphertext to decapsulate |
2418+
2419+
2420+*Table: `CM_MLKEM_DECAPSULATE` output arguments*
2421+| **Name** | **Type** | **Description** |
2422+| ----------- | -------- | ---------------------------------------- |
2423+| chksum | u32 ||
2424+| fips_status | u32 | FIPS approved or an error |
2425+| shared_key | CMK | CMK of the shared secret key |
2426+
2427+
19452428 ### CM_AES_ENCRYPT_INIT
19462429
19472430 Generic AES operation for unauthenticated AES operations.
@@ -1954,7 +2437,7 @@
19542437
19552438 The CMK must have been created for AES usage.
19562439
1957-Command Code: `0x434D_4349` ("CMCI")
2440+Command Code: `0x434D_4149` ("CMAI")
19582441
19592442 *Table: `CM_AES_ENCRYPT_INIT` input arguments*
19602443 | **Name** | **Type** | **Description** |
@@ -1988,8 +2471,7 @@
19882471 | mode | u32 ||
19892472 | key | u8[32] ||
19902473 | iv | u8[16] ||
1991-| fips_status | u8 | 1 = FIPS valid |
1992-| reserved | u8[75] | Reserved for additional fields |
2474+| reserved | u8[76] | Reserved for additional fields |
19932475
19942476
19952477 The size of the (encrypted) context is always exactly 156 bytes,
@@ -2006,7 +2488,7 @@
20062488 For CBC, the size must be a multiple of 16 bytes.
20072489 CTR mode supports input of any size up to the maximum cryptographic mailbox size.
20082490
2009-Command Code: `0x434D_4355` ("CMCU")
2491+Command Code: `0x434D_4155` ("CMAU")
20102492
20112493 *Table: `CM_AES_ENCRYPT_UPDATE` input arguments*
20122494 | **Name** | **Type** | **Description** |
@@ -2077,7 +2559,7 @@
20772559 For CBC, the size must be a multiple of 16 bytes.
20782560 CTR mode supports input of any size up to the maximum cryptographic mailbox size.
20792561
2080-Command Code: `0x434D_4155` ("CMAU")
2562+Command Code: `0x434D_4156` ("CMAV")
20812563
20822564 *Table: `CM_AES_DECRYPT_UPDATE` input arguments*
20832565 | **Name** | **Type** | **Description** |
@@ -2138,8 +2620,7 @@
21382620 | GHASH state | u8[16] ||
21392621 | current length | u32 | value mod 16 is buffer size |
21402622 | buffer | u8[16] ||
2141-| fips_status | u8 | 1 = FIPS valid |
2142-| reserved | u8[15] ||
2623+| reserved | u8[16] ||
21432624
21442625
21452626 The size of the (encrypted) context is always exactly 128 bytes,
@@ -2295,7 +2776,7 @@
22952776
22962777 The encrypted and authenticated context's internal structure will be the same as for encryption.
22972778
2298-### CM_AES_SPDM_GCM_DECRYPT_INIT
2779+### CM_AES_GCM_SPDM_DECRYPT_INIT
22992780
23002781 Starts an AES-256-GCM decryption computation in SPDM mode.
23012782
@@ -2411,6 +2892,45 @@
24112892 | plaintext | u8[plaintext size] ||
24122893
24132894
2895+### CM_AES_GCM_DECRYPT_DMA
2896+
2897+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.
2898+
2899+**Important restrictions:**
2900+- This command is only available in subsystem mode, as DMA is only available in subsystem.
2901+- This command is only available for MCU.
2902+- 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.
2903+- The command performs a two-pass operation:
2904+ 1. First pass: Verifies the SHA384 hash of the encrypted data at the AXI address
2905+ 2. Second pass: Performs in-place AES-GCM decryption via DMA
2906+
2907+The CMK must be an AES key (key usage = 3) that was previously imported using `CM_IMPORT`.
2908+
2909+Command Code: `0x434D_4444` ("CMDD")
2910+
2911+*Table: `CM_AES_GCM_DECRYPT_DMA` input arguments*
2912+| **Name** | **Type** | **Description** |
2913+| --------------------- | --------- | ---------------------------------------------------- |
2914+| chksum | u32 | Checksum over other input arguments |
2915+| cmk | CMK | Encrypted CMK containing the AES-256 key |
2916+| iv | u32[3] | AES-GCM initialization vector (12 bytes) |
2917+| tag | u32[4] | AES-GCM authentication tag (16 bytes) |
2918+| encrypted_data_sha384 | u8[48] | SHA384 hash of the encrypted data for verification |
2919+| axi_addr_lo | u32 | Lower 32 bits of the AXI address |
2920+| axi_addr_hi | u32 | Upper 32 bits of the AXI address |
2921+| length | u32 | Length of data to decrypt in bytes |
2922+| aad_length | u32 | Length of AAD in bytes (0-4095) |
2923+| aad | u8[...] | Additional authenticated data |
2924+
2925+
2926+*Table: `CM_AES_GCM_DECRYPT_DMA` output arguments*
2927+| **Name** | **Type** | **Description** |
2928+| ------------ | -------- | ----------------------------------------------------- |
2929+| chksum | u32 | Checksum over other output arguments |
2930+| fips_status | u32 | FIPS approved or an error |
2931+| tag_verified | u32 | 1 if GCM tag verification succeeded, 0 if it failed |
2932+
2933+
24142934 ### CM_ECDH_GENERATE
24152935
24162936 This computes the first half of an Elliptic Curve Diffie-Hellman exchange to compute an ephemeral shared key pair with another party.
@@ -2529,9 +3049,9 @@
25293049 ### CM\_DERIVE\_STABLE\_KEY
25303050
25313051 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.
3052+IDevId, LDevId, or the Owner Root Key (derived from HEK seed).
3053+
3054+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.
25353055 The actual encrypted bytes of the CMK will *not* be the same, and
25363056 the encrypted CMK itself cannot be used across resets. So, the key
25373057 will always need to be re-derived after every *cold* reset.
@@ -2539,26 +3059,39 @@
25393059 If a key usage other than HMAC is desired, then the KDF or HKDF
25403060 mailbox functions can be used to derive a key from the returned CMK.
25413061
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.
3062+`key_type = OwnerKey` is only available in subsystem mode when the Stable Owner
3063+Key strap is enabled (`SS_STRAP_GENERIC[3]` bit 0 set to 1) and OCP LOCK is not
3064+enabled. If these requirements are not met, the command fails with
3065+`CMB_STABLE_OWNER_KEY_NOT_AVAILABLE`.
3066+
3067+In Runtime, this command is restricted to the PL0 PAUSER authenticated by the
3068+firmware manifest for all key types.
3069+
3070+For `OwnerKey`, this command derives from the ROM-populated Stable Owner Root
3071+Key. It first runs AES-256-CMAC KDF with `info` as the input data to produce an
3072+intermediate key, then runs HMAC-SHA512 KDF with `b"Stable Owner Key" || info`
3073+as the domain-separation input to produce the returned 64-byte HMAC key
3074+material. Caliptra wraps that key material as an encrypted CMK before returning
3075+it to the caller.
25433076
25443077 The command derivation is summarized below:
25453078
25463079 ![CM_DERIVE_STABLE_KEY Derivation](../images/caliptra-sw/runtime/../rom/dev/doc/svg/cm-derive-stable-key.svg)
25473080
2548-Command Code: `0x434D_4453` ("CMDS")
3081+Command Code: `0x494D_4453` ("IMDS")
25493082
25503083 *Table: `CM_DERIVE_STABLE_KEY` input arguments*
25513084
2552-| **Name** | **Type** | **Description**
2553-| -------- | -------- | ---------------
3085+| **Name** | **Type** | **Description** |
3086+| -------- | -------- | --------------- |
25543087 | chksum | u32 | Checksum over other input arguments, computed by the caller. Little endian. |
2555-| key_type | u32 | Source key to derive the stable key from. **0x0000_0001:** IDevId <br> **0x0000_0002:** LDevId |
3088+| 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) |
25563089 | info | u8[32] | Data to use in the key derivation. |
25573090
25583091
25593092 *Table: `CM_DERIVE_STABLE_KEY` output arguments*
2560-| **Name** | **Type** | **Description**
2561-| -------- | -------- | ---------------
3093+| **Name** | **Type** | **Description** |
3094+| -------- | -------- | --------------- |
25623095 | chksum | u32 | Checksum over other output arguments, computed by Caliptra. Little endian. |
25633096 | cmk | CMK | CMK that stores the stable key material |
25643097
@@ -2568,9 +3101,6 @@
25683101 Imports the specified key and returns a CMK for it.
25693102
25703103 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.
25743104
25753105 Command Code: `0x434D_494D` ("CMIM")
25763106
@@ -2681,14 +3211,14 @@
26813211
26823212 *Table: `GET_IDEV_ECC384_CSR` input arguments*
26833213
2684-| **Name** | **Type** | **Description**
2685-| -------- | -------- | ---------------
3214+| **Name** | **Type** | **Description** |
3215+| -------- | -------- | --------------- |
26863216 | chksum | u32 | Checksum over other input arguments, computed by the caller. Little endian. |
26873217
26883218
26893219 *Table: `GET_IDEV_ECC384_CSR` output arguments*
2690-| **Name** | **Type** | **Description**
2691-| -------- | -------- | ---------------
3220+| **Name** | **Type** | **Description** |
3221+| -------- | -------- | --------------- |
26923222 | chksum | u32 | Checksum over other output arguments, computed by Caliptra. Little endian. |
26933223 | data\_size | u32 | Length in bytes of the valid data in the data field. |
26943224 | data | u8[...] | DER-encoded ECC384 IDevID certificate signing request. |
@@ -2700,14 +3230,14 @@
27003230
27013231 *Table: `GET_IDEV_MLDSA87_CSR` input arguments*
27023232
2703-| **Name** | **Type** | **Description**
2704-| -------- | -------- | ---------------
3233+| **Name** | **Type** | **Description** |
3234+| -------- | -------- | --------------- |
27053235 | chksum | u32 | Checksum over other input arguments, computed by the caller. Little endian. |
27063236
27073237
27083238 *Table: `GET_IDEV_MLDSA87_CSR` output arguments*
2709-| **Name** | **Type** | **Description**
2710-| -------- | -------- | ---------------
3239+| **Name** | **Type** | **Description** |
3240+| -------- | -------- | --------------- |
27113241 | chksum | u32 | Checksum over other output arguments, computed by Caliptra. Little endian. |
27123242 | data\_size | u32 | Length in bytes of the valid data in the data field. |
27133243 | data | u8[...] | DER-encoded MLDSA87 IDevID certificate signing request. |
@@ -2727,14 +3257,14 @@
27273257
27283258 *Table: `GET_FMC_ALIAS_ECC384_CSR` input arguments*
27293259
2730-| **Name** | **Type** | **Description**
2731-| -------- | -------- | ---------------
3260+| **Name** | **Type** | **Description** |
3261+| -------- | -------- | --------------- |
27323262 | chksum | u32 | Checksum over other input arguments, computed by the caller. Little endian. |
27333263
27343264
27353265 *Table: `GET_FMC_ALIAS_ECC384_CSR` output arguments*
2736-| **Name** | **Type** | **Description**
2737-| -------- | -------- | ---------------
3266+| **Name** | **Type** | **Description** |
3267+| -------- | -------- | --------------- |
27383268 | chksum | u32 | Checksum over other output arguments, computed by Caliptra. Little endian. |
27393269 | data\_size | u32 | Length in bytes of the valid data in the data field. |
27403270 | data | u8[...] | DER-encoded ECC384 FMC Alias certificate signing request. |
@@ -2746,14 +3276,14 @@
27463276
27473277 *Table: `GET_FMC_ALIAS_MLDSA87_CSR` input arguments*
27483278
2749-| **Name** | **Type** | **Description**
2750-| -------- | -------- | ---------------
3279+| **Name** | **Type** | **Description** |
3280+| -------- | -------- | --------------- |
27513281 | chksum | u32 | Checksum over other input arguments, computed by the caller. Little endian. |
27523282
27533283
27543284 *Table: `GET_FMC_ALIAS_MLDSA87_CSR` output arguments*
2755-| **Name** | **Type** | **Description**
2756-| -------- | -------- | ---------------
3285+| **Name** | **Type** | **Description** |
3286+| -------- | -------- | --------------- |
27573287 | chksum | u32 | Checksum over other output arguments, computed by Caliptra. Little endian. |
27583288 | data\_size | u32 | Length in bytes of the valid data in the data field. |
27593289 | data | u8[...] | DER-encoded MLDSA87 FMC Alias certificate signing request. |
@@ -2767,8 +3297,8 @@
27673297
27683298 *Table: `GET_ATTESTED_ECC384_CSR` input arguments*
27693299
2770-| **Name** | **Type** | **Description**
2771-| -------- | -------- | ---------------
3300+| **Name** | **Type** | **Description** |
3301+| -------- | -------- | --------------- |
27723302 | chksum | u32 | Checksum over other input arguments, computed by the caller. Little endian. |
27733303 | 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 |
27743304 | nonce | u8[32] | Nonce to be included in the CSR EAT. |
@@ -2776,8 +3306,8 @@
27763306
27773307 *Table: `GET_ATTESTED_ECC384_CSR` output arguments*
27783308
2779-| **Name** | **Type** | **Description**
2780-| -------- | -------- | ---------------
3309+| **Name** | **Type** | **Description** |
3310+| -------- | -------- | --------------- |
27813311 | chksum | u32 | Checksum over other output arguments, computed by Caliptra. Little endian. |
27823312 | data\_size | u32 | Length in bytes of the valid data in the data field. |
27833313 | data | u8[...] | COSE Sign1 signed EAT token containing attested CSR (or keypair inventory when key_id = 0). |
@@ -2791,8 +3321,8 @@
27913321
27923322 *Table: `GET_ATTESTED_MLDSA87_CSR` input arguments*
27933323
2794-| **Name** | **Type** | **Description**
2795-| -------- | -------- | ---------------
3324+| **Name** | **Type** | **Description** |
3325+| -------- | -------- | --------------- |
27963326 | chksum | u32 | Checksum over other input arguments, computed by the caller. Little endian. |
27973327 | 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 |
27983328 | nonce | u8[32] | Nonce to be included in the CSR EAT. |
@@ -2800,8 +3330,8 @@
28003330
28013331 *Table: `GET_ATTESTED_MLDSA87_CSR` output arguments*
28023332
2803-| **Name** | **Type** | **Description**
2804-| -------- | -------- | ---------------
3333+| **Name** | **Type** | **Description** |
3334+| -------- | -------- | --------------- |
28053335 | chksum | u32 | Checksum over other output arguments, computed by Caliptra. Little endian. |
28063336 | data\_size | u32 | Length in bytes of the valid data in the data field. |
28073337 | data | u8[...] | COSE Sign1 signed EAT token containing attested CSR (or keypair inventory when key_id = 0). |
@@ -2815,23 +3345,57 @@
28153345
28163346 *Table: `SIGN_WITH_EXPORTED_ECDSA` input arguments*
28173347
2818-| **Name** | **Type** | **Description**
2819-| -------- | -------- | ---------------
3348+| **Name** | **Type** | **Description** |
3349+| -------- | -------- | --------------- |
28203350 | chksum | u32 | Checksum over other input arguments, computed by the caller. Little endian. |
2821-| exported_cdi_handle | u8[32] | The Exported CDI handle returned by the DPE `DeriveContext` command. Little endian. |
2822-| tbs | u8[48] | The bytes to be signed. Little endian. |
3351+| exported_cdi_handle | u8[32] | The exported CDI handle returned by the DPE `DeriveContext` command. Opaque byte array; copy the bytes exactly as returned. |
3352+| tbs | u8[48] | The 48-byte SHA-384 digest to be signed. Raw byte array; no byte swapping is required. |
28233353
28243354
28253355 *Table: `SIGN_WITH_EXPORTED_ECDSA` output arguments*
2826-| **Name** | **Type** | **Description**
2827-| -------- | -------- | ---------------
3356+| **Name** | **Type** | **Description** |
3357+| -------- | -------- | --------------- |
28283358 | derived_pubkey_x | u8[48] | The X BigNum of the ECDSA public key associated with the signing key. |
28293359 | derived_pubkey_y | u8[48] | The Y BigNum of the ECDSA public key associated with the signing key. |
28303360 | signature_r | u8[48] | The R BigNum of an ECDSA signature. |
28313361 | signature_s | u8[48] | The S BigNum of an ECDSA signature. |
28323362
28333363
2834-The `exported_cdi` can be created by calling `DeriveContext` with the `export-cdi` and `create-certificate` flags.
3364+The `exported_cdi_handle` can be created by calling `DeriveContext` with the `export-cdi` and `create-certificate` flags.
3365+
3366+### SIGN\_WITH\_EXPORTED\_MLDSA
3367+
3368+Command Code: `0x5357_4D4C` ("SWML")
3369+
3370+**Note**: This command is only available in the locality of the PL0 PAUSER.
3371+
3372+*Table: `SIGN_WITH_EXPORTED_MLDSA` input arguments*
3373+
3374+| **Name** | **Type** | **Description** |
3375+| -------- | -------- | --------------- |
3376+| chksum | u32 | Checksum over other input arguments, computed by the caller. Little endian. |
3377+| exported_cdi_handle | u8[32] | The exported CDI handle returned by the DPE `DeriveContext` command. Opaque byte array; copy the bytes exactly as returned. |
3378+| sign_type | u32 | Signing mode selector. `0` = `Mu` (64-byte pre-hash input), `1` = `Raw` (arbitrary byte array input). |
3379+| tbs_size | u32 | Length of the message to be signed. For `Mu`, this must be exactly 64 bytes. For `Raw`, this may be up to 1024 bytes. |
3380+| tbs | u8[1024] | The message bytes to be signed. For `Mu`, this field contains a 64-byte message digest. For `Raw`, it contains the raw input bytes to sign. |
3381+
3382+
3383+*Table: `SIGN_WITH_EXPORTED_MLDSA` output arguments*
3384+
3385+| **Name** | **Type** | **Description** |
3386+| -------- | -------- | --------------- |
3387+| derived_pubkey | u8[2592] | The ML-DSA public key derived from the exported CDI handle and the DPE environment. |
3388+| signature | u8[4627] | The ML-DSA signature produced by the derived key. |
3389+
3390+
3391+The `exported_cdi_handle` can be created by calling `DeriveContext` with the `export-cdi` and `create-certificate` flags.
3392+
3393+This command derives an ML-DSA key pair from the provided exported CDI handle and signs either:
3394+
3395+- a 64-byte `Mu` message digest, or
3396+- a `Raw` message payload of up to 1024 bytes.
3397+
3398+The command performs the signing under PL0-only access control and returns the derived public key together with the signature.
28353399
28363400 ### REVOKE\_EXPORTED\_CDI\_HANDLE
28373401
@@ -2841,16 +3405,47 @@
28413405
28423406 *Table: `REVOKE_EXPORTED_CDI_HANDLE` input arguments*
28433407
2844-| **Name** | **Type** | **Description**
2845-| -------- | -------- | ---------------
3408+| **Name** | **Type** | **Description** |
3409+| -------- | -------- | --------------- |
28463410 | chksum | u32 | Checksum over other input arguments, computed by the caller. Little endian. |
2847-| exported_cdi_handle | u8[32] | The Exported CDI handle returned by the DPE `DeriveContext` command. Little endian. |
2848-
2849-
2850-The `exported_cdi` can be created by calling `DeriveContext` with the `export-cdi` and `create-certificate` flags.
3411+| exported_cdi_handle | u8[32] | The exported CDI handle returned by the DPE `DeriveContext` command. Opaque byte array; copy the bytes exactly as returned. |
3412+
3413+
3414+The `exported_cdi_handle` can be created by calling `DeriveContext` with the `export-cdi` and `create-certificate` flags.
28513415
28523416 The `exported_cdi_handle` is no longer usable after calling `REVOKE_EXPORTED_CDI_HANDLE` with it. After the `exported_cdi_handle`
2853-has been revoked, a new exported CDI can be created by calling `DeriveContext` with the `export-cdi` and `create-certificate` flags.
3417+has been revoked, a new exported CDI handle can be created by calling `DeriveContext` with the `export-cdi` and `create-certificate` flags.
3418+
3419+### EXTERNAL_MAILBOX_CMD
3420+
3421+Command Code: `0x4558_544D` ("EXTM")
3422+
3423+**Important restrictions:**
3424+- This command is only available in subsystem mode in 2.1+.
3425+- This command is only available for MCU.
3426+
3427+Executes a mailbox command located at an AXI address.
3428+This allows for executing mailbox commands that are larger than the mailbox allows.
3429+
3430+This is currently mostly useful for FIRMWARE_LOAD (as part of an update) or SET_AUTH_MANIFEST.
3431+
3432+The response is still written to the mailbox.
3433+
3434+The checksum is over the EXTM command, *not* the command that is loaded over AXI.
3435+That external command will still need its own checksum, if applicable.
3436+
3437+*Table: `EXTERNAL_MAILBOX_CMD` input arguments*
3438+
3439+| **Name** | **Type** | **Description** |
3440+| -------- | -------- | --------------- |
3441+| chksum | u32 | Checksum over other input arguments, computed by the caller. Little endian. |
3442+| command_id | u32 | Command ID for the mailbox command to be executed. Little endian. |
3443+| command_size | u32 | Size of the mailbox command to be executed. Little endian. |
3444+| axi_address_low | u32 | Lower 32 bits of the AXI address that contains the mailbox command. Little endian. |
3445+| axi_address_high | u32 | High 32 bits of the AXI address that contains the mailbox command. Little endian. |
3446+
3447+
3448+The response will be the response of the executed external command.
28543449
28553450 ### REALLOCATE\_DPE\_CONTEXT\_LIMITS
28563451
@@ -2860,24 +3455,168 @@
28603455
28613456 *Table: `REALLOCATE_DPE_CONTEXT_LIMITS` input arguments*
28623457
2863-| **Name** | **Type** | **Description**
2864-| -------- | -------- | ---------------
3458+| **Name** | **Type** | **Description** |
3459+| -------- | -------- | --------------- |
28653460 | chksum | u32 | Checksum over other input arguments, computed by the caller. Little endian. |
28663461 | pl0_context_limit | u32 | Number of contexts to allocate to PL0. PL1 will receive remaining contexts. |
28673462
28683463
28693464 *Table: `REALLOCATE_DPE_CONTEXT_LIMITS` output arguments*
2870-| **Name** | **Type** | **Description**
2871-| -------- | -------- | ---------------
3465+| **Name** | **Type** | **Description** |
3466+| -------- | -------- | --------------- |
28723467 | chksum | u32 | Checksum over other output arguments, computed by Caliptra. Little endian. |
28733468 | fips_status | u32 | Indicates if the command is FIPS approved or an error. |
28743469 | new_pl0_context_limit | u32 | Number of contexts assigned to PL0 after the reallocation |
28753470 | new_pl1_context_limit | u32 | Number of contexts assigned to PL1 after the reallocation |
28763471
28773472
2878-This allows the user to reallocate the 32 DPE contexts between PL0 and PL1. By default, each gets 16 contexts.
3473+This allows the user to reallocate the 64 DPE contexts between PL0 and PL1. By default, each gets 32 contexts.
28793474
28803475 **Note**: 2 PL0 contexts are used by Caliptra itself during initialization.
3476+
3477+### FE\_PROG
3478+
3479+Programs Field Entropy (FE) into one of 4 FE partitions in the OTP fuse controller. This command
3480+is typically used during device provisioning flows.
3481+
3482+**Note**: This command is only available when the device is in the **Production** lifecycle state.
3483+
3484+Command Code: `0x4645_5052` ("FEPR")
3485+
3486+*Table: `FE_PROG` input arguments*
3487+
3488+| **Name** | **Type** | **Description**
3489+| -------- | -------- | ---------------
3490+| chksum | u32 | Checksum over other input arguments, computed by the caller. Little endian.
3491+| partition | u32 | FE partition number (valid values: 0–3).
3492+
3493+`FE_PROG` returns no output arguments other than the mailbox response header.
3494+
3495+### ZEROIZE\_UDS\_FE
3496+
3497+Permanently zeroizes the selected UDS and Field Entropy (FE) OTP partitions, including
3498+their seeds, digests, and zeroization markers. Runtime uses the same OTP programming
3499+flow and read-back verification as ROM.
3500+
3501+This command is restricted to **PL0** and **subsystem mode**, where Caliptra can
3502+access the OTP fuse controller through DMA. The caller must authorize the destructive
3503+operation before submitting it; this command does not implement the MCU's external
3504+challenge/signature authorization protocol.
3505+
3506+Command Code: `0x5A45_5546` ("ZEUF")
3507+
3508+*Table: `ZEROIZE_UDS_FE` input arguments*
3509+
3510+| **Name** | **Type** | **Description**
3511+| -------- | -------- | ---------------
3512+| chksum | u32 | Checksum over other input arguments, computed by the caller. Little endian.
3513+| flags | u32 | Partition-selection bitmask: bit 0 selects UDS; bits 1 through 4 select FE0 through FE3.
3514+
3515+At least one partition must be selected. Reserved flag bits must be zero. Invalid
3516+lengths or flags are rejected before OTP changes or shutdown. Requests from PL1 or
3517+outside subsystem mode are also rejected without changing OTP or shutting down.
3518+
3519+*Table: `ZEROIZE_UDS_FE` output arguments*
3520+
3521+| **Name** | **Type** | **Description**
3522+| ----------- | -------- | ---------------
3523+| chksum | u32 | Checksum over other output arguments, computed by Caliptra. Little endian.
3524+| fips_status | u32 | Standard mailbox response status.
3525+| dpe_result | u32 | `0` if every selected partition passed zeroization read-back verification; `1` if zeroization failed.
3526+
3527+The response is the existing 12-byte `ZeroizeUdsFeResp` used by ROM. Callers must
3528+read and check `dpe_result`; successful mailbox transport or an 8-byte response
3529+header alone is not proof of zeroization. A failure may follow partial, irreversible
3530+zeroization, and unattempted or unselected partitions are not reported as zeroized.
3531+The specific OTP error is reported in `CPTRA_FW_ERROR_NON_FATAL`.
3532+
3533+After any valid zeroization attempt, Runtime clears its cryptographic engines,
3534+key vault, and persistent state using the existing shutdown cleanup path. It returns
3535+the result and enters the terminal `RUNTIME_SHUTDOWN` state even if OTP zeroization
3536+failed. A cleanup failure causes mailbox command failure and still enters terminal
3537+shutdown. Caliptra cannot service further Runtime requests without reset.
3538+
3539+This command does not transition the lifecycle controller to RMA or update the
3540+MCU's field-entropy state markers. The MCU remains responsible for those operations,
3541+and must not request RMA unless zeroization has succeeded and the required OTP state
3542+has been verified.
3543+
3544+### PRODUCTION\_AUTH\_DEBUG\_UNLOCK\_REQ
3545+
3546+Initiates the production debug unlock flow by generating a cryptographic challenge. The caller
3547+must solve the challenge by signing it with the appropriate ECC and MLDSA keys and returning
3548+the result via the [`PRODUCTION_AUTH_DEBUG_UNLOCK_TOKEN`](#production_auth_debug_unlock_token)
3549+command.
3550+
3551+This command performs the same function as the ROM's `AUTH_DEBUG_UNLOCK_REQ` command
3552+(documented in the [ROM README](../rom/dev/README.md#debug-unlock)), but is available at
3553+runtime.
3554+
3555+**Note**: This command requires the device to be in the **Production** lifecycle state and the
3556+`PROD_DEBUG_UNLOCK_REQ` bit in the `SS_DBG_MANUF_SERVICE_REG_REQ` register to be set.
3557+
3558+Command Code: `0x5044_5552` ("PDUR")
3559+
3560+*Table: `PRODUCTION_AUTH_DEBUG_UNLOCK_REQ` input arguments*
3561+
3562+| **Name** | **Type** | **Description**
3563+| -------- | -------- | ---------------
3564+| chksum | u32 | Checksum over other input arguments, computed by the caller. Little endian.
3565+| length | u32 | Length of the payload in DWORDs.
3566+| unlock\_level | u8 | Debug unlock level (1–8).
3567+| reserved | u8[3] | Reserved.
3568+
3569+*Table: `PRODUCTION_AUTH_DEBUG_UNLOCK_REQ` output arguments*
3570+
3571+| **Name** | **Type** | **Description**
3572+| -------- | -------- | ---------------
3573+| chksum | u32 | Checksum over other output arguments, computed by Caliptra. Little endian.
3574+| fips\_status | u32 | Indicates if the command is FIPS approved or an error.
3575+| length | u32 | Length of the response payload in DWORDs.
3576+| unique\_device\_identifier | u8[32] | Device identifier of the Caliptra device. Byte array; pass through as-is to the token command.
3577+| challenge | u8[48] | Random challenge number generated by Caliptra. Byte array; pass through as-is to the token command.
3578+
3579+### PRODUCTION\_AUTH\_DEBUG\_UNLOCK\_TOKEN
3580+
3581+Completes the production debug unlock handshake by validating the caller's solution to the
3582+challenge generated by
3583+[`PRODUCTION_AUTH_DEBUG_UNLOCK_REQ`](#production_auth_debug_unlock_req). The caller must
3584+provide the device identifier and challenge from the previous request along with ECC-384 and
3585+ML-DSA-87 signatures proving possession of the authorized debug unlock key.
3586+
3587+Upon successful validation, Caliptra authorizes the debug unlock by setting the unlock level
3588+in the `SS_SOC_DBG_UNLOCK_LEVEL` register.
3589+
3590+This command performs the same function as the ROM's `AUTH_DEBUG_UNLOCK_TOKEN` command
3591+(documented in the [ROM README](../rom/dev/README.md#debug-unlock)), but is available at
3592+runtime.
3593+
3594+**Note**: This command requires a preceding successful `PRODUCTION_AUTH_DEBUG_UNLOCK_REQ` in
3595+the same boot session. The challenge is consumed on use and cannot be replayed.
3596+
3597+Command Code: `0x5044_5554` ("PDUT")
3598+
3599+*Table: `PRODUCTION_AUTH_DEBUG_UNLOCK_TOKEN` input arguments*
3600+
3601+| **Name** | **Type** | **Description**
3602+| -------- | -------- | ---------------
3603+| chksum | u32 | Checksum over other input arguments, computed by the caller. Little endian.
3604+| length | u32 | Length of the payload in DWORDs.
3605+| unique\_device\_identifier | u8[32] | Device identifier (must match value from challenge response). Byte array; copied verbatim from the challenge response.
3606+| unlock\_level | u8 | Debug unlock level (1–8, must match the original request).
3607+| reserved | u8[3] | Reserved.
3608+| challenge | u8[48] | Challenge (must match value from challenge response). Byte array; copied verbatim from the challenge response.
3609+| 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).
3610+| mldsa\_public\_key | u8[2592] | ML-DSA-87 public key. See [Byte order of cryptographic fields](#byte-order-of-cryptographic-fields).
3611+| 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).
3612+| 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).
3613+
3614+The signed message for both ECC and ML-DSA signatures is the hash of the concatenation:
3615+`unique_device_identifier || unlock_level || reserved || challenge` (all as raw bytes).
3616+ECC uses SHA2-384; ML-DSA uses SHA2-512.
3617+
3618+`PRODUCTION_AUTH_DEBUG_UNLOCK_TOKEN` returns no output arguments other than the mailbox
3619+response header.
28813620
28823621 ## Checksum
28833622
@@ -2901,15 +3640,15 @@
29013640
29023641 ## FIPS status
29033642
2904-For every command, the firmware responds with a FIPS status of FIPS approved. There is
2905-currently no use case for any other responses or error values.
3643+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.
29063644
29073645 *Table: FIPS status codes*
29083646
29093647 | **Name** | **Value** | Description |
29103648 | --------------- | --------------------------- | --------------------------------------------------- |
29113649 | `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 |
3650+| `FIPS_NOT_APPROVED_USER_SUPPLIED_DIGEST` | `0x5553_5244` | Command is not FIPS approved because the caller supplied the digest instead of the raw message |
3651+| `RESERVED` | `0x0000_0002 - 0xFFFF_FFFF` | Other values reserved, will not be sent by Caliptra |
29133652
29143653
29153654 ## Runtime Firmware updates
@@ -2988,14 +3727,14 @@
29883727 To prevent this, we establish active context limits for each PAUSER
29893728 privilege level:
29903729
2991-* PL0 - 16 active contexts
2992-* PL1 - 16 active contexts
3730+* PL0 - 32 active contexts
3731+* PL1 - 32 active contexts
29933732
29943733 If a DPE command were to activate a new context such that the total number of
29953734 active contexts in a privilege level is above its active context limit, the
29963735 InvokeDpe command should fail.
29973736
2998-At boot Caliptra Runtime FW consumes part of the PL0 active contexts (initially 16) to DeriveContext for:
3737+At boot Caliptra Runtime FW consumes part of the PL0 active contexts (initially 32) to DeriveContext for:
29993738 - RTFW Journey (RTFJ) Measurement (1)
30003739 - Caliptra Configured Initialization Values digest (CCIV) (1)
30013740 - ROM Stashed Measurements (max 8)
@@ -3003,20 +3742,20 @@
30033742 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
30043743 of active contexts in PL0's locality, and hence allow PL1 to DOS PL0.
30053744
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.
3745+### Caliptra DPE Profile
3746+
3747+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.
30103748
30113749 | Name | Value | Description |
30123750 | -------------------------- | ------------------------------ | ------------------------------------------------------------------------------------------------------ |
3013-| Profile Variant | `DPE_PROFILE_IROT_P384_SHA384` | The profile variant that Caliptra implements. |
3751+| Profile Variant | `Caliptra DPE Profile` | Derived from `DPE_PROFILE_IROT_P384_SHA384`. |
30143752 | KDF | SP800-108 HMAC-CTR | KDF to use for CDI (tcg.derive.kdf-sha384) and asymmetric key (tcg.derive.kdf-sha384-p384) derivation. |
30153753 | Simulation Context Support | Yes | Whether Caliptra implements the optional Simulation Contexts feature. |
30163754 | Supports ExtendTci | Yes | Whether Caliptra implements the optional ExtendTci command. |
30173755 | Supports Auto Init | Yes | Whether Caliptra will automatically initialize the default DPE context. |
30183756 | Supports Rotate Context | Yes | Whether Caliptra supports the optional RotateContextHandle command. |
30193757 | CertifyKey Alias Key | Caliptra Runtime Alias Key | The key that will be used to sign certificates that are produced by the DPE CertifyKey command. |
3758+| `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. |
30203759
30213760
30223761 ### Supported DPE commands
@@ -3027,6 +3766,7 @@
30273766 * InitializeContext
30283767 * DeriveContext
30293768 * **Note**: The "export-cdi" flag is only available in the locality of the PL0 PAUSER.
3769+ * **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.
30303770 * CertifyKey
30313771 * Caliptra DPE supports two formats for CertifyKey: X.509 and PKCS#10 CSR.
30323772 X.509 is only available to PL0 PAUSERs.