Skip to content

Commit c8325aa

Browse files
andrea-caforioandreaskurth
authored andcommitted
[kat/rsa] Use correct Wycheproof test case id
Remove the counter that does not match the actual id of the current test which made it hard to locate individual tests and use the provided test case id instead. Signed-off-by: Andrea Caforio <[email protected]>
1 parent c0bcca9 commit c8325aa

File tree

1 file changed

+2
-3
lines changed
  • sw/host/tests/crypto/rsa_kat/src

1 file changed

+2
-3
lines changed

sw/host/tests/crypto/rsa_kat/src/main.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ struct Opts {
3838

3939
#[derive(Debug, Deserialize)]
4040
struct RsaTestCase {
41+
test_case_id: u32,
4142
algorithm: String,
4243
operation: String,
4344
padding: String,
@@ -233,15 +234,13 @@ fn test_rsa(opts: &Opts, transport: &TransportWrapper) -> Result<()> {
233234
let spi_console_device = SpiConsoleDevice::new(&*spi, None)?;
234235
let _ = UartConsole::wait_for(&spi_console_device, r"Running [^\r\n]*", opts.timeout)?;
235236

236-
let mut test_counter = 0u32;
237237
let test_vector_files = &opts.rsa_json;
238238
for file in test_vector_files {
239239
let raw_json = fs::read_to_string(file)?;
240240
let rsa_tests: Vec<RsaTestCase> = serde_json::from_str(&raw_json)?;
241241

242242
for rsa_test in &rsa_tests {
243-
test_counter += 1;
244-
log::info!("Test counter: {}", test_counter);
243+
log::info!("Test counter: {}", rsa_test.test_case_id);
245244
run_rsa_testcase(rsa_test, opts, &spi_console_device)?;
246245
}
247246
}

0 commit comments

Comments
 (0)