Skip to content

Add changes to generate and endorse certificate with ML-DSA 87 public key as well - #31055

Merged
cfrantz merged 3 commits into
lowRISC:earlgrey_1.0.0from
xorptr:perso_ft_provisioning_add_uds_mldsa_87_certgen_and_endorse
Sep 9, 2026
Merged

Add changes to generate and endorse certificate with ML-DSA 87 public key as well#31055
cfrantz merged 3 commits into
lowRISC:earlgrey_1.0.0from
xorptr:perso_ft_provisioning_add_uds_mldsa_87_certgen_and_endorse

Conversation

@xorptr

@xorptr xorptr commented Aug 19, 2026

Copy link
Copy Markdown

This PR adds support for endorsing DICE UDS TBS certificate with ML-DSA 87 public key

  • Commit 1 changes the expected name of certificate with ML-DSA 44 public key from PQ_UDS to PQ_UDS_44
  • Commit 2 adds logic in perso firmware to generate and send DICE UDS certificate with ML-DSA 87 public key to the host (named PQ_UDS_87). Appropriate configurations are changed so that the host tool expects and endorses this certificate. NOTE that the endorsed PQ_UDS_87 certificate is currently not sent back to the device.
  • Commit 3 changes the Key ID derivation mechanism to use different derivation constants to generate seeds for ML-DSA 44 and ML-DSA 87 keys (proposed by @sasdf to deal with an issue). This makes the Subject Key ID for certificates with ML-DSA 44 and ML-DSA 87 keys different

Changes on top of PR #31054

Comment thread sw/device/silicon_creator/lib/cert/dice_mldsa.c Outdated
@xorptr
xorptr force-pushed the perso_ft_provisioning_add_uds_mldsa_87_certgen_and_endorse branch from daa685b to 2b82dad Compare August 19, 2026 01:24
@xorptr
xorptr marked this pull request as ready for review August 20, 2026 07:07
@xorptr
xorptr requested review from a team and cfrantz as code owners August 20, 2026 07:08
@xorptr
xorptr requested review from alees24 and removed request for a team August 20, 2026 07:08
@xorptr
xorptr force-pushed the perso_ft_provisioning_add_uds_mldsa_87_certgen_and_endorse branch 2 times, most recently from b2a20ac to af95f5c Compare August 23, 2026 08:01
Comment thread sw/device/silicon_creator/lib/cert/dice_keys.c
@xorptr
xorptr force-pushed the perso_ft_provisioning_add_uds_mldsa_87_certgen_and_endorse branch from af95f5c to 59b0951 Compare September 1, 2026 19:53
@xorptr
xorptr requested a review from rswarbrick as a code owner September 1, 2026 19:53
@xorptr
xorptr force-pushed the perso_ft_provisioning_add_uds_mldsa_87_certgen_and_endorse branch 2 times, most recently from efea75d to cfaca12 Compare September 3, 2026 04:38

@sasdf sasdf left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@xorptr
xorptr force-pushed the perso_ft_provisioning_add_uds_mldsa_87_certgen_and_endorse branch from cfaca12 to c2d91e4 Compare September 4, 2026 09:04
@sasdf sasdf added the CI:Rerun Rerun failed CI jobs label Sep 7, 2026
@github-actions github-actions Bot removed the CI:Rerun Rerun failed CI jobs label Sep 7, 2026
This commit changes the name of UDS certificate generated during
provisioning with ML-DSA 44 public key to `PQ_UDS_44` so that it matches
with certificate name that would be used for the certificate generated
with ML-DSA 87 public key (`PQ_UDS_87`)

Tested by running
`//sw/host/provisioning/orchestrator/tests:e2e_multistage_emulation_dice_mldsa_cw340_test`
target locally with bazel argument
`--//sw/host/provisioning/cert_lib:enable_mldsa_signing_for_test`. Logs
show certificate with name `PQ_UDS_44` generated and endorsed

Signed-off-by: Lovepreet Singh <lpsingh@google.com>
…public key

This commit adds support to generate a TBS certificate with ML-DSA 87
public key in perso firmware and endorse it in the host tool. NOTE: This
certificate is NOT send back to the device. The host tool just endorses
the TBS certificate and validates the endorsed certificate with DICE
ML-DSA 87 CA certificate.

I also changed the `static_assert` conditions to reflect new constraints
after adding support for this certificate

Tested by running
`//sw/host/provisioning/orchestrator/tests:e2e_multistage_emulation_dice_mldsa_cw340_test`
target locally with bazel argument
`--//sw/host/provisioning/cert_lib:enable_mldsa_signing_for_test`. Test
logs show that device generates and sends both certificate (`PQ_UDS_44`
and `PQ_UDS_87`) to the host. The host tool endorses them both, but
sends only `PQ_UDS_44` back to the device

Signed-off-by: Lovepreet Singh <lpsingh@google.com>
…DSA 87 seed generation

Currently the perso firmware code generates certificates with same
Subject Key ID for certificates with ML-DSA 44 and ML-DSA 87 public key.
As per [Open DICE
specifications](https://github.com/google/open-dice/blob/a483025423d720898cc2f7e2ac57b7dd0c65f93b/docs/specification.md#deriving-identifiers),
these IDs must be different since the public keys are different.

Currently ML-DSA DICE library generates theseed independent of the
ML-DSA parameters set, and uses this seed to generate the key IDs. So
the key IDs are the same for ML-DSA 44 and ML-DSA 87 public keys
generated by the firmware.

This commit changes the logic to use different derivation constants when
generating the seed for ML-DSA 44 and ML-DSA 87 keys. The new derivation
constants for ML-DSA 87 are generated by reading data from `/dev/random`
on my workstation

Tested by running
`//sw/host/provisioning/orchestrator/tests:e2e_emulation_dice_mldsa_cw340_test`
target locally with bazel argument
`--//sw/host/provisioning/cert_lib:enable_mldsa_signing_for_test`.
Endorsed certificates in the logs show
`X509v3 Subject Key Identifier: 6E:02:32:65:4F:71:1E:04:A1:06:17:B3:1F:6A:61:93:84:92:60:3E`
for certificate with ML-DSA 44 public key, and
`X509v3 Subject Key Identifier: AD:DA:DA:07:0A:70:0A:98:CD:0C:E7:B9:B6:3C:DC:48:7E:DF:B4:CE`
for certificate with ML-DSA 87 public key

Signed-off-by: Lovepreet Singh <lpsingh@google.com>
@xorptr
xorptr force-pushed the perso_ft_provisioning_add_uds_mldsa_87_certgen_and_endorse branch from c2d91e4 to 96dc66a Compare September 9, 2026 05:48
@cfrantz
cfrantz merged commit 7525704 into lowRISC:earlgrey_1.0.0 Sep 9, 2026
35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants