External Mailbox (MCI Mailbox) Commands Spec

Overview

This document outlines the external mailbox commands that enable SoC agents to interact with the MCU via MCI mailbox. These commands support common Caliptra management functions, including querying firmware information, retrieving debug and attestation logs, exporting attested CSRs, utilizing cryptographic services, secure debug unlock, and in-field fuse provisioning.

  • Device Identification and Capabilities

    • Retrieve firmware versions and device capabilities to ensure compatibility and proper configuration.
  • Debugging and Diagnostics

    • Retrieve debug logs to analyze device behavior, diagnose issues, and monitor runtime states.
    • Clear logs to reset diagnostic data and maintain storage efficiency.
  • Certificate Management

    • Export attested Certificate Signing Requests (CSRs) for device keys to facilitate secure provisioning.
  • Cryptographic Services

    • AES encryption and decryption
    • SHA hashing
    • Random number generation
    • Digital signing
    • Signature verification
    • Key exchange
  • Debug Unlock Mechanisms

    • Facilitate secure debugging in production environments
    • Ensure controlled access to debugging features
  • In-Field Fuse Provisioning

Mailbox Commands List

NameCommand CodeDescription
MC_FIRMWARE_VERSION0x4D46_5756 ("MFWV")Retrieves the version of the target firmware.
MC_DEVICE_CAPABILITIES0x4D43_4150 ("MCAP")Retrieve the device capabilities.
MC_EXPORT_ATTESTED_CSR0x4D45_4143 ("MEAC")Exports an attested CSR for a specified device key, wrapped in a CoseSign1 structure.
MC_GET_LOG0x4D47_4C47 ("MGLG")Retrieves the debug log
MC_CLEAR_LOG0x4D43_4C47 ("MCLG")Clears the debug log
MC_FIPS_SELF_TEST_START0x4D46_5354 ("MFST")Starts the FIPS self-test to exercise the crypto engine.
MC_FIPS_SELF_TEST_GET_RESULTS0x4D46_4752 ("MFGR")Retrieves the results of the FIPS self-test.
MC_FIPS_PERIODIC_ENABLE0x4D46_5045 ("MFPE")Enables or disables periodic FIPS self-test.
MC_FIPS_PERIODIC_STATUS0x4D46_5053 ("MFPS")Retrieves the status of periodic FIPS self-test.
MC_SHA_INIT0x4D43_5349 ("MCSI")Starts the computation of a SHA hash of data.
MC_SHA_UPDATE0x4D43_5355 ("MCSU")Continues a SHA computation started by MC_SHA_INIT or another MC_SHA_UPDATE.
MC_SHA_FINAL0x4D43_5346 ("MCSF")Finalizes the computation of a SHA and produces the hash of all the data.
MC_HMAC0x4D43_484D ("MCHM")Computes an HMAC according to RFC 2104.
MC_HMAC_KDF_COUNTER0x4D43_4B43 ("MCKC")Computes HMAC KDF in Counter Mode as specified in NIST SP800-108.
MC_HKDF_EXTRACT0x4D43_4B54 ("MCKT")Implements HKDF-Extract as specified in RFC 5869.
MC_HKDF_EXPAND0x4D43_4B50 ("MCKP")Implements HKDF-Expand as specified in RFC 5869.
MC_AES_ENCRYPT_INIT0x4D43_4349 ("MCCI")Starts an AES encryption operation.
MC_AES_ENCRYPT_UPDATE0x4D43_4355 ("MCCU")Continues an AES encryption operation started by MC_AES_ENCRYPT_INIT.
MC_AES_DECRYPT_INIT0x4D43_414A ("MCAJ")Starts an AES-256 decryption operation.
MC_AES_DECRYPT_UPDATE0x4D43_4155 ("MCAU")Continues an AES decryption operation started by MC_AES_DECRYPT_INIT.
MC_AES_GCM_ENCRYPT_INIT0x4D43_4749 ("MCGI")Starts an AES-256-GCM encryption operation.
MC_AES_GCM_ENCRYPT_UPDATE0x4D43_4755 ("MCGU")Continues an AES-GCM encryption operation started by MC_AES_GCM_ENCRYPT_INIT.
MC_AES_GCM_ENCRYPT_FINAL0x4D43_4746 ("MCGF")Finalizes the AES-GCM encryption operation and produces the final ciphertext and tag.
MC_AES_GCM_DECRYPT_INIT0x4D43_4449 ("MCDI")Starts an AES-256-GCM decryption operation.
MC_AES_GCM_DECRYPT_UPDATE0x4D43_4455 ("MCDU")Continues an AES-GCM decryption operation started by MC_AES_GCM_DECRYPT_INIT.
MC_AES_GCM_DECRYPT_FINAL0x4D43_4446 ("MCDF")Finalizes the AES-GCM decryption operation and verifies the tag.
MC_ECDH_GENERATE0x4D43_4547 ("MCEG")Computes the first half of an Elliptic Curve Diffie-Hellman exchange.
MC_ECDH_FINISH0x4D43_4546 ("MCEF")Computes the second half of an Elliptic Curve Diffie-Hellman exchange.
MC_ECDSA_CMK_PUBLIC_KEY0x4D43_4550 ("MCEP")Generates an ECDSA public key from a CMK.
MC_ECDSA_CMK_SIGN0x4D43_4553 ("MCES")Creates an ECDSA signature using a CMK.
MC_ECDSA_CMK_VERIFY0x4D43_4556 ("MCEV")Validates an ECDSA signature using a CMK.
MC_RANDOM_STIR0x4D43_5253 ("MCRS")Adds additional entropy to the internal deterministic random bit generator.
MC_RANDOM_GENERATE0x4D43_5247 ("MCRG")Generates random bytes from the internal RNG.
MC_IMPORT0x4D43_494D ("MCIM")Imports a specified key and returns a CMK for it.
MC_DELETE0x4D43_444C ("MCDL")Deletes the object stored with the given mailbox ID.
MC_ECDSA384_SIG_VERIFY0x4D45_4356 ("MECV")Verifies an ECDSA P-384 signature.
MC_LMS_SIG_VERIFY0x4D4C_4D56 ("MLMV")Verifies an LMS signature.
MC_ECDSA384_SIGN0x4D45_4353 ("MECS")Requests to sign a SHA-384 digest with the DPE leaf certificate.
MC_MLDSA_SIGN0x4D4C_4D53 ("MLMS")Requests to sign a SHA-384 digest with the DPE leaf certificate using MLDSA.
MC_PROD_DEBUG_UNLOCK_REQ0x4D50_5552 ("MPUR")Requests debug unlock in a production environment.
MC_PROD_DEBUG_UNLOCK_TOKEN0x4D50_5554 ("MPUT")Sends the debug unlock token.
MC_GET_AUTH_CMD_CHALLENGE0x4D41_4343 ("MACC")Requests a challenge for security-sensitive commands.
MC_FUSE_READ0x4946_5052 ("IFPR")See fuses spec for details
MC_FUSE_WRITE0x4946_5057 ("IFPW")See fuses spec for details
MC_FUSE_LOCK_PARTITION0x4946_504B ("IFPK")See fuses spec for details
MC_PROVISION_VENDOR_PK_HASH0x5056_504b ("PVPK")See fuses spec for details
MC_FE_PROG0x4D43_4650 ("MCFP")See fuses spec for details
MC_FUSE_REVOKE_VENDOR_PUB_KEY0x4D52_564B ("MRVK")See fuses spec for details
MC_FUSE_REVOKE_VENDOR_PK_HASH0x5256_4b48 ("RVKH")See fuses spec for details

Command Format

Common command payloads are defined in Caliptra Common Commands. This section lists the MCI mailbox command code for each common command and keeps mailbox-only command definitions in this document. MCI mailbox checksum, fips_status, and variable-length data_len fields are transport-specific response framing and are not part of the common command payload tables.

MC_FIRMWARE_VERSION

Retrieves the version of the target firmware.

Command Code: 0x4D46_5756 ("MFWV")

Payload semantics are defined by Firmware Version.

MCI mailbox response payload:

NameTypeDescription
chksumu32Response checksum.
fips_statusu32FIPS approved or an error.
data_lenu32Length in bytes of the valid version data.
versionu8[data_len]Firmware Version Number in ASCII format.

MC_DEVICE_CAPABILITIES

Retrieve the device capabilites.

Command Code: 0x4D43_4150 ("MCAP")

Payload semantics are defined by Device Capabilities.

MC_EXPORT_ATTESTED_CSR

Exports an attested Certificate Signing Request (CSR) for a specified device key.

Command Code: 0x4D45_4143 ("MEAC")

Payload semantics are defined by Export Attested CSR.

MC_GET_LOG

Retrieves the debug log for the MCU Runtime.

Command Code: 0x4D47_4C47 ("MGLG")

Payload semantics and debug log format are defined by Get Debug Log.

MCI mailbox request payload contains only the mailbox checksum header. The command always retrieves the MCU Runtime debug log.

MCI mailbox response payload:

NameTypeDescription
chksumu32Response checksum.
fips_statusu32FIPS approved or an error.
data_lenu32Length in bytes of more_data plus log_data.
more_datau321 if more log data remains, 0 otherwise.
log_datau8[data_len-4]Debug log contents.

MC_CLEAR_LOG

Clears the debug log in the MCU Runtime.

Command Code: 0x4D43_4C47 ("MCLG")

Payload semantics are defined by Clear Debug Log.

MC_FIPS_PERIODIC_ENABLE

Enables or disables periodic FIPS self-test. When enabled, the MCU runs FIPS self-tests in the background at a configurable interval (default: 60 seconds).

Command Code: 0x4D46_5045 ("MFPE")

Table: MC_FIPS_PERIODIC_ENABLE input arguments

NameTypeDescription
chksumu32Checksum over input data
enableu320 = disable, 1 = enable periodic test

Table: MC_FIPS_PERIODIC_ENABLE output arguments

NameTypeDescription
chksumu32
fips_statusu32FIPS approved or an error.

MC_FIPS_PERIODIC_STATUS

Retrieves the status of the periodic FIPS self-test, including whether it is enabled, the number of completed iterations, and the result of the last test.

Command Code: 0x4D46_5053 ("MFPS")

Table: MC_FIPS_PERIODIC_STATUS input arguments

NameTypeDescription
chksumu32Checksum over input data

Table: MC_FIPS_PERIODIC_STATUS output arguments

NameTypeDescription
chksumu32
fips_statusu32FIPS approved or an error.
enabledu320 = disabled, 1 = enabled
iterationsu32Number of completed periodic test iterations
last_resultu32Last test result: 0 = not run yet, 1 = pass, 2 = fail

MC_ECDSA384_SIG_VERIFY

Verifies an ECDSA P-384 signature. The hash to be verified is taken from the input.

Command Code: 0x4D45_4356 ("MECV")

Table: MC_ECDSA384_SIG_VERIFY input arguments

NameTypeDescription
chksumu32Checksum over other input arguments, computed by the caller. Little endian.
pub_key_xu8[48]X portion of the ECDSA verification key.
pub_key_yu8[48]Y portion of the ECDSA verification key.
signature_ru8[48]R portion of the signature to verify.
signature_su8[48]S portion of the signature to verify.
hashu8[48]SHA-384 digest to verify.

Table: MC_ECDSA384_SIG_VERIFY output arguments

NameTypeDescription
chksumu32Checksum over other output arguments, computed by responder. Little endian.
fips_statusu32Indicates if the command is FIPS approved or an error.

MC_LMS_SIG_VERIFY

Verifies an LMS signature. The hash to be verified is taken from the input.

Command Code: 0x4D4C_4D56 ("MLMV")

Table: MC_LMS_SIG_VERIFY input arguments

NameTypeDescription
chksumu32Checksum over other input arguments, computed by the caller. Little endian.
pub_key_tree_typeu8[4]LMS public key algorithm type. Must equal 12.
pub_key_ots_typeu8[4]LM-OTS algorithm type. Must equal 7.
pub_key_idu8[16]"I" Private key identifier
pub_key_digestu8[24]"T[1]" Public key hash value
signature_qu8[4]Leaf of the Merkle tree where the OTS public key appears
signature_otsu8[1252]LM-OTS signature
signature_tree_typeu8[4]LMS signature Algorithm type. Must equal 12.
signature_tree_pathu8[360]Path through the tree from the leaf associated with the LM-OTS signature to the root
hashu8[48]SHA384 digest to verify.

Table: MC_LMS_SIG_VERIFY output arguments

NameTypeDescription
chksumu32Checksum over other output arguments, computed by MCU. Little endian.
fips_statusu32Indicates if the command is FIPS approved or an error.

MC_ECDSA384_SIGN

Requests to sign SHA-384 digest with DPE leaf cert.

Command Code: 0x4D45_4353 ("MECS")

Table: MC_ECDSA384_SIGN input arguments

NameTypeDescription
chksumu32Checksum over other input arguments, computed by the caller. Little endian.
digestu8[48]SHA-384 digest to be signed.

Table: MC_ECDSA384_SIGN output arguments

NameTypeDescription
chksumu32Checksum over other output arguments, computed by MCU. Little endian.
fips_statusu32Indicates if the command is FIPS approved or an error.
derived_pubkey_xu8[48]The X BigNum of the ECDSA public key associated with the signing key.
derived_pubkey_yu8[48]The Y BigNum of the ECDSA public key associated with the signing key.
signature_ru8[48]The R BigNum of an ECDSA signature.
signature_su8[48]The S BigNum of an ECDSA signature.

MC_MLDSA_SIGN

Request to sign the SHA-384 digest with DPE leaf cert.

Command Code: 0x4D4C_4D53 ("MMLS")

Table: MC_MLDSA_SIGN input arguments

NameTypeDescription
chksumu32Checksum over other input arguments, computed by the caller. Little endian.
digestu8[48]SHA-384 digest to be signed.

Table: MC_MLDSA_SIGN output arguments

NameTypeDescription
chksumu32
fips_statusu32FIPS approved or an error
pub_key_tree_typeu8[4]LMS public key algorithm type.
pub_key_ots_typeu8[4]LM-OTS algorithm type.
pub_key_idu8[16]Private key identifier.
pub_key_digestu8[24]Public key hash value.
signature_qu8[4]Leaf of the Merkle tree for the OTS key.
signature_otsu8[1252]LM-OTS signature.
signature_tree_pathu8[360]Path through the Merkle tree to the root.

MC_PROD_DEBUG_UNLOCK_REQ

Requests debug unlock in production environment.

Command Code: 0x4D50_5552 ("MPUR")

Payload semantics are defined by Request Debug Unlock.

MC_PROD_DEBUG_UNLOCK_TOKEN

Sends the debug unlock token.

Command Code: 0x4D50_5554 ("MPUT")

Payload semantics are defined by Authorize Debug Unlock Token.

MC_FUSE_READ

Reads fuse values.

Command Code: 0x4946_5052 ("IFPR")

Table: MC_FUSE_READ input arguments

NameTypeDescription
chksumu32
partitionu32Partition number to read from
entryu32Entry to read

Table: MC_FUSE_READ output arguments

NameTypeDescription
chksumu32
fips_statusu32FIPS approved or an error
length (bits)u32Number of bits that are valid
datau8[...]Fuse data (length/8)

MC_FUSE_WRITE

Write fuse values.

Command Code: 0x4946_5057 ("IFPW")

Table: MC_FUSE_WRITE input arguments

NameTypeDescription
chksumu32
word_addru32Entry to write (word offset)
datau32Word to write
masku32Bit-Mask to only write specified bits

Table: MC_FUSE_WRITE output arguments

NameTypeDescription
chksumu32
fips_statusu32FIPS approved or an error

Caveats:

  • This command is idempotent, so that identical writes will have no effect.
  • Will fail if any of the existing data is 1 but is set to 0 in the input data.
  • Bits masked with mask will be ignored
  • Writes to buffered partitions will not take effect until the next reset.

MC_FUSE_LOCK_PARTITION

Lock a partition.

Command Code: 0x4946_504B ("IFPK")

Table: MC_FUSE_LOCK_PARTITION input arguments

NameTypeDescription
chksumu32
partitionu32Partition number to lock

Table: MC_FUSE_LOCK_PARTITION output arguments

NameTypeDescription
chksumu32
fips_statusu32FIPS approved or an error

Caveats:

  • This command is idempotent, so that locking a partition twice has no effect.
  • Locking a partition causes subsequent writes to it to fail.
  • Locking does not fully take effect until the next reset.

MC_PROVISION_VENDOR_PK_HASH

Provision a new vendor PK hash.

Command Code: 0x5056_504b ("PVPK")

Table: MC_PROVISION_VENDOR_PK_HASH input arguments

NameTypeDescription
chksumu32
slotu32The vendor PK hash slot to use
hash[u8; 48]New vendor PK hash

Table: MC_PROVISION_VENDOR_PK_HASH output arguments

NameTypeDescription
chksumu32
fips_statusu32FIPS approved or an error

Caveats:

  • Fails if the slot already contains data

MC_FUSE_REVOKE_VENDOR_PUB_KEY

Revoke one vendor firmware verification key within a vendor PK hash slot.

Command Code: 0x4D52_564B ("MRVK")

Table: MC_FUSE_REVOKE_VENDOR_PUB_KEY input arguments

NameTypeDescription
chksumu32
reservedu32Reserved; must be zero
vendor_pk_hash_slotu32Vendor PK hash slot containing the key to revoke
key_typeu320 = ECDSA P-384, 1 = LMS, 2 = MLDSA-87
key_indexu32Key index within the selected key type's revocation field

Table: MC_FUSE_REVOKE_VENDOR_PUB_KEY output arguments

NameTypeDescription
chksumu32
fips_statusu32FIPS approved or an error

Caveats:

  • This command must be authorized.
  • The selected PK hash slot must be provisioned and valid.
  • The command fails if it targets the key used to boot the currently running firmware.
  • The last key index for a key type cannot be revoked.

MC_FUSE_REVOKE_VENDOR_PK_HASH

Revoke a vendor PK hash. Marks a vendor PK hash as invalid, revoking all of the associated keys.

Command Code: 0x5256_4b48 ("RVKH")

Table: MC_FUSE_REVOKE_VENDOR_PK_HASH input arguments

NameTypeDescription
chksumu32
vendor_pk_hash_slotu32Vendor PK hash slot to revoke

Table: MC_FUSE_REVOKE_VENDOR_PK_HASH output arguments

NameTypeDescription
chksumu32
fips_statusu32FIPS approved or an error

Caveats:

  • This command must be authorized.
  • This command is idempotent, so that revoking a slot twice has no effect.
  • Trying to revoke an empty slot will result in an error
  • Trying to revoke the PK hash slot used to boot the currently running firmware will result in an error

Cryptographic Command Format

The MCI mailbox cryptographic commands are mapped to their corresponding Caliptra Mailbox Cryptographic commands. The mapping is detailed in the table below. For the specific format of each command, refer to the Mailbox Commands: Cryptographic Mailbox (2.0).

Table: mapping MCI Mailbox Crypto Commands to Caliptra Crypto Mailbox Commands

MCI Mailbox Crypto CommandsCaliptra Mailbox Crypto Commands
MC_FIPS_SELF_TEST_STARTSELF_TEST_START
MC_FIPS_SELF_TEST_GET_RESULTSSELF_TEST_GET_RESULTS
MC_SHA_INITCM_SHA_INIT
MC_SHA_UPDATECM_SHA_UPDATE
MC_SHA_FINALCM_SHA_FINAL
MC_HMACCM_HMAC
MC_HMAC_KDF_COUNTERCM_HMAC_KDF_COUNTER
MC_HKDF_EXTRACTCM_HKDF_EXTRACT
MC_HKDF_EXPANDCM_HKDF_EXPAND
MC_AES_ENCRYPT_INITCM_AES_ENCRYPT_INIT
MC_AES_ENCRYPT_UPDATECM_AES_ENCRYPT_UPDATE
MC_AES_DECRYPT_INITCM_AES_DECRYPT_INIT
MC_AES_DECRYPT_UPDATECM_AES_DECRYPT_UPDATE
MC_AES_GCM_ENCRYPT_INITCM_AES_GCM_ENCRYPT_INIT
MC_AES_GCM_ENCRYPT_UPDATECM_AES_GCM_ENCRYPT_UPDATE
MC_AES_GCM_ENCRYPT_FINALCM_AES_GCM_ENCRYPT_FINAL
MC_AES_GCM_DECRYPT_INITCM_AES_GCM_DECRYPT_INIT
MC_AES_GCM_DECRYPT_UPDATECM_AES_GCM_DECRYPT_UPDATE
MC_AES_GCM_DECRYPT_FINALCM_AES_GCM_DECRYPT_FINAL
MC_ECDH_GENERATECM_ECDH_GENERATE
MC_ECDH_FINISHCM_ECDH_FINISH
MC_ECDSA_CMK_PUBLIC_KEYCM_ECDSA_PUBLIC_KEY
MC_ECDSA_CMK_SIGNCM_ECDSA_SIGN
MC_ECDSA_CMK_VERIFYCM_ECDSA_VERIFY
MC_RANDOM_STIRCM_RANDOM_STIR
MC_RANDOM_GENERATECM_RANDOM_GENERATE
MC_IMPORTCM_IMPORT
MC_DELETECM_DELETE