-
Notifications
You must be signed in to change notification settings - Fork 46
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
Add debug unlock procedures in rom #1851
base: main-2.x
Are you sure you want to change the base?
Conversation
9c26ad0
to
048ef3d
Compare
967489e
to
e863077
Compare
I left writing the unit test for production for some later time. I understood the emulator for the Dma engine wrong (it does not operate on the root bus) and it needs to have a completely separate 64bit bus for AXI. |
} | ||
|
||
/// Trait for SHA-2 digest operations | ||
pub trait Sha2DigestOpTrait<'a, V: Sha2Variant>: Sized { |
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'm not 100% sure why we need this trait. Why not implement this method directly on the generic struct, and not have to boomerang back and forth through the OpTrait
and the Op
?
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.
update and finalize are very similar. Using a trait with generics reduced the amount of code a bit.
rom/dev/src/flow/debug_unlock.rs
Outdated
} | ||
} | ||
|
||
fn handle_manufactoring(env: &mut RomEnv) -> CaliptraResult<()> { |
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.
typo: handle_manufacturing
rom/dev/src/flow/debug_unlock.rs
Outdated
digest_op.finalize(&mut request_digest)?; | ||
|
||
// Verify that digest of keys match | ||
if cfi_launder(request_digest) != fuse_digest { |
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.
It may not be strictly necessary to use constant-time equality for this digest, but I'd like to anyway.
e863077
to
3bac4c4
Compare
Please add PR description always |
3bac4c4
to
cfe728d
Compare
Done |
cfe728d
to
2499a4f
Compare
Signed-off-by: Arthur Heymans <[email protected]>
Reading the production debug fuses needs this. Signed-off-by: Arthur Heymans <[email protected]>
Signed-off-by: Arthur Heymans <[email protected]>
This adds both the manufactoring and production debug unlock codepaths. There are a few details that need to be resolved in TODOs that are unclear from the documentation. Signed-off-by: Arthur Heymans <[email protected]>
Signed-off-by: Arthur Heymans <[email protected]>
2499a4f
to
e9cd4c2
Compare
This implements the debug unlock flow for both manufactoring and production flows, according to "https://github.com/chipsalliance/caliptra-sw/blob/main-2.x/rom/dev/README.md"
This requires Sha512 ops so those are also added alongside Sha384.
TODO Production tests depend on DMA Axi rework #1878