-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update remaining tests to test both PQC types. (#1918)
- Loading branch information
1 parent
2db0854
commit d050720
Showing
12 changed files
with
1,125 additions
and
865 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// Licensed under the Apache-2.0 license | ||
use caliptra_image_types::FwVerificationPqcKeyType; | ||
|
||
pub const PQC_KEY_TYPE: [FwVerificationPqcKeyType; 2] = [ | ||
FwVerificationPqcKeyType::LMS, | ||
FwVerificationPqcKeyType::MLDSA, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
// Licensed under the Apache-2.0 license | ||
|
||
mod helpers; | ||
|
||
mod test_hand_off; | ||
mod test_panic_missing; | ||
mod test_rtalias; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,43 @@ | ||
// Licensed under the Apache-2.0 license | ||
use crate::helpers; | ||
use caliptra_builder::{firmware, ImageOptions}; | ||
use caliptra_hw_model::{BootParams, HwModel, InitParams}; | ||
use caliptra_hw_model::{BootParams, Fuses, HwModel, InitParams}; | ||
|
||
#[test] | ||
fn test_hand_off() { | ||
let rom = caliptra_builder::rom_for_fw_integration_tests().unwrap(); | ||
|
||
let image = caliptra_builder::build_and_sign_image( | ||
&firmware::FMC_WITH_UART, | ||
&firmware::runtime_tests::BOOT, | ||
ImageOptions::default(), | ||
) | ||
.unwrap(); | ||
|
||
let mut hw = caliptra_hw_model::new( | ||
InitParams { | ||
rom: &rom, | ||
for pqc_key_type in helpers::PQC_KEY_TYPE.iter() { | ||
let fuses = Fuses { | ||
fuse_pqc_key_type: *pqc_key_type as u32, | ||
..Default::default() | ||
}, | ||
BootParams { | ||
fw_image: Some(&image.to_bytes().unwrap()), | ||
}; | ||
let image_options = ImageOptions { | ||
pqc_key_type: *pqc_key_type, | ||
..Default::default() | ||
}, | ||
) | ||
.unwrap(); | ||
}; | ||
|
||
let rom = caliptra_builder::rom_for_fw_integration_tests().unwrap(); | ||
|
||
let image = caliptra_builder::build_and_sign_image( | ||
&firmware::FMC_WITH_UART, | ||
&firmware::runtime_tests::BOOT, | ||
image_options, | ||
) | ||
.unwrap(); | ||
|
||
let mut hw = caliptra_hw_model::new( | ||
InitParams { | ||
rom: &rom, | ||
..Default::default() | ||
}, | ||
BootParams { | ||
fw_image: Some(&image.to_bytes().unwrap()), | ||
fuses, | ||
..Default::default() | ||
}, | ||
) | ||
.unwrap(); | ||
|
||
let mut output = vec![]; | ||
hw.copy_output_until_exit_success(&mut output).unwrap(); | ||
let mut output = vec![]; | ||
hw.copy_output_until_exit_success(&mut output).unwrap(); | ||
} | ||
} |
Oops, something went wrong.