-
Notifications
You must be signed in to change notification settings - Fork 43
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
Dilithium driver #1624
base: main
Are you sure you want to change the base?
Dilithium driver #1624
Conversation
b2e9342
to
6ee62b6
Compare
6ee62b6
to
be74e36
Compare
be74e36
to
2a48721
Compare
Signed-off-by: Arthur Heymans <[email protected]>
2a48721
to
c20c928
Compare
This adds both a driver and some unit tests. Some TODOs are left in the driver as it is intended to hook this peripheral to the keyvault in the future. Signed-off-by: Arthur Heymans <[email protected]>
c20c928
to
a21c5ea
Compare
let secret_key = Array4x1224::read_from_reg(ml_dsa87.secret_key_out()); | ||
|
||
let public_key = Array4x648::read_from_reg(ml_dsa87.public_key()); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I ran into an issue when enabling on Adam's Bridge RTL where the the sign was not completing. The feedback I got from MSFT is that the zeroize should happen between each operation. For enabling I added a call to zeroize here before the PCT.
ml_dsa87.ctrl().write(|w| w.ctrl(|w| w.signing())); | ||
|
||
// Wait for hardware ready | ||
wait::until(|| ml_dsa87.status().read().ready()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you mean to wait for valid here, not ready.
ml_dsa87.ctrl().write(|w| w.ctrl(|w| w.verifying())); | ||
|
||
// Wait for hardware ready | ||
wait::until(|| ml_dsa87.status().read().ready()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you mean to wait for valid here, not ready.
wait::until(|| ml_dsa87.status().read().ready()); | ||
|
||
let result = Array4x16::read_from_reg(ml_dsa87.verification_result()); | ||
// TODO currently emulator returns 1 on each word for success. Update when behavior is fleshed out |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RDL says that it should match the first part of the signature: https://github.com/chipsalliance/adams-bridge/blob/main/src/mldsa_top/rtl/mldsa_reg.rdl#L168
I have not been able to get that with the RTL though.
This add preliminary driver support for the dilithium peripheral.
The code follows the ecc384 driver structure.