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

Add new feature hw-2.x #1959

Merged
merged 1 commit into from
Feb 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion sw-emulator/lib/periph/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ caliptra-emu-derive.workspace = true
caliptra-emu-types.workspace = true
caliptra-hw-model-types.workspace = true
caliptra-registers.workspace = true
fips204.workspace = true
fips204 = { workspace = true, optional = true }
lazy_static.workspace = true
rand.workspace = true
sha3.workspace = true
Expand All @@ -29,3 +29,4 @@ zerocopy.workspace = true

[features]
"hw-1.0" = []
"hw-2.x" = ["dep:fips204"]
1 change: 1 addition & 0 deletions sw-emulator/lib/periph/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ mod hmac_sha384;
mod iccm;
mod key_vault;
mod mailbox;
#[cfg(feature = "hw-2.x")]
mod ml_dsa87;
mod root_bus;
mod sha512_acc;
Expand Down
5 changes: 4 additions & 1 deletion sw-emulator/lib/periph/src/root_bus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ Abstract:

--*/

#[cfg(feature = "hw-2.x")]
use crate::ml_dsa87::MlDsa87;
use crate::MailboxRequester;
use crate::{
helpers::words_from_bytes_be,
iccm::Iccm,
ml_dsa87::MlDsa87,
soc_reg::{DebugManufService, SocRegistersExternal},
AsymEcc384, Csrng, Doe, EmuCtrl, HashSha256, HashSha512, HmacSha384, KeyVault, MailboxExternal,
MailboxInternal, MailboxRam, Sha512Accelerator, SocRegistersInternal, Uart,
Expand Down Expand Up @@ -268,6 +269,7 @@ pub struct CaliptraRootBus {
#[peripheral(offset = 0x1002_8000, mask = 0x0000_7fff)]
pub sha256: HashSha256,

#[cfg(feature = "hw-2.x")]
#[peripheral(offset = 0x1003_0000, mask = 0x0000_7fff)] // TODO update when known
pub ml_dsa87: MlDsa87,

Expand Down Expand Up @@ -332,6 +334,7 @@ impl CaliptraRootBus {
key_vault: key_vault.clone(),
sha512,
sha256: HashSha256::new(clock),
#[cfg(feature = "hw-2.x")]
ml_dsa87: MlDsa87::new(clock),
iccm,
dccm: Ram::new(vec![0; Self::DCCM_SIZE]),
Expand Down
Loading