Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sw-emulator: Add dilithium peripheral #1623

Merged
merged 2 commits into from
Aug 27, 2024

Conversation

ArthurHeymans
Copy link
Contributor

This adds support for the dilithium peripheral in the sw-emulator based on preliminary support available.
Things currently unknown like how certain functionality works exactly and the MMIO offset are marked as TODO so that those can be updated once more details are available.

Cargo.toml Outdated Show resolved Hide resolved
@ArthurHeymans ArthurHeymans marked this pull request as ready for review August 1, 2024 17:04
@mhatrevi mhatrevi requested a review from swenson August 20, 2024 16:32
sw-emulator/lib/periph/src/helpers.rs Show resolved Hide resolved
sw-emulator/lib/periph/src/ml_dsa87.rs Show resolved Hide resolved
sw-emulator/lib/periph/src/ml_dsa87.rs Outdated Show resolved Hide resolved
sw-emulator/lib/periph/src/ml_dsa87.rs Outdated Show resolved Hide resolved
sw-emulator/lib/periph/src/ml_dsa87.rs Show resolved Hide resolved
sw-emulator/lib/periph/src/ml_dsa87.rs Show resolved Hide resolved
sw-emulator/lib/periph/src/ml_dsa87.rs Outdated Show resolved Hide resolved
sw-emulator/lib/periph/src/ml_dsa87.rs Show resolved Hide resolved
Copy link
Contributor

@swenson swenson left a comment

Choose a reason for hiding this comment

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

LGTM

Rust only implements Default for arrays up to 64 elements. The dilithium
keys and signature are larger so implement the default for U32ArrayBytes
explicitly.

Signed-off-by: Arthur Heymans <arthur.heymans@9elements.com>
This adds a peripheral capable of PQC using the fips204 ML_DSA_87
algorithm.

To implement this peripheral the crystals-dilithium crate
https://crates.io/crates/fips204

A few TODOs are left in the code:
- The exact keygen algoritm has not be disclosed
- Version and name field need to be updated to match the HW
- The MMIO base needs to be updated to match the HW

Signed-off-by: Arthur Heymans <arthur.heymans@9elements.com>
@mhatrevi mhatrevi enabled auto-merge (squash) August 27, 2024 16:00
@mhatrevi mhatrevi merged commit 79aeef2 into chipsalliance:main Aug 27, 2024
10 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.

5 participants