mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-18 08:52:45 +00:00
aes-tests into standard formatting
This commit is contained in:
parent
7f3d2e3ce3
commit
6f5be1e4bb
3 changed files with 7 additions and 7 deletions
|
|
@ -1,5 +1,4 @@
|
||||||
ignore = [
|
ignore = [
|
||||||
"services/aes-test",
|
|
||||||
"services/graphics-server",
|
"services/graphics-server",
|
||||||
"services/com",
|
"services/com",
|
||||||
"services/keyboard",
|
"services/keyboard",
|
||||||
|
|
|
||||||
|
|
@ -370,11 +370,11 @@ fn aes_dec_round_last(arg1: u32, arg2: u32, id: AesByte) -> u32 {
|
||||||
use core::convert::TryInto;
|
use core::convert::TryInto;
|
||||||
|
|
||||||
fn get_u32_be(input: &[u8], offset: usize) -> u32 {
|
fn get_u32_be(input: &[u8], offset: usize) -> u32 {
|
||||||
u32::from_be_bytes(input[offset..offset+4].try_into().unwrap())
|
u32::from_be_bytes(input[offset..offset + 4].try_into().unwrap())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn get_u32_le(input: &[u8], offset: usize) -> u32 {
|
fn get_u32_le(input: &[u8], offset: usize) -> u32 {
|
||||||
u32::from_le_bytes(input[offset..offset+4].try_into().unwrap())
|
u32::from_le_bytes(input[offset..offset + 4].try_into().unwrap())
|
||||||
}
|
}
|
||||||
|
|
||||||
// Const versions of these functions
|
// Const versions of these functions
|
||||||
|
|
|
||||||
|
|
@ -108,7 +108,6 @@ fn aes_test_main() -> ! {
|
||||||
&hex!("f69f2445df4f9b17ad2b417be66c3710"),
|
&hex!("f69f2445df4f9b17ad2b417be66c3710"),
|
||||||
&hex!("7b0c785e27e8ad3f8223207104725dd4"),
|
&hex!("7b0c785e27e8ad3f8223207104725dd4"),
|
||||||
),
|
),
|
||||||
|
|
||||||
// NIST ECB-AES192
|
// NIST ECB-AES192
|
||||||
AesTest::new_ecb(
|
AesTest::new_ecb(
|
||||||
&hex!("8e73b0f7da0e6452c810f32b809079e562f8ead2522c6b7b"),
|
&hex!("8e73b0f7da0e6452c810f32b809079e562f8ead2522c6b7b"),
|
||||||
|
|
@ -130,7 +129,6 @@ fn aes_test_main() -> ! {
|
||||||
&hex!("f69f2445df4f9b17ad2b417be66c3710"),
|
&hex!("f69f2445df4f9b17ad2b417be66c3710"),
|
||||||
&hex!("9a4b41ba738d6c72fb16691603c18e0e"),
|
&hex!("9a4b41ba738d6c72fb16691603c18e0e"),
|
||||||
),
|
),
|
||||||
|
|
||||||
// NIST ECB-AES256
|
// NIST ECB-AES256
|
||||||
AesTest::new_ecb(
|
AesTest::new_ecb(
|
||||||
&hex!("603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4"),
|
&hex!("603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4"),
|
||||||
|
|
@ -152,7 +150,6 @@ fn aes_test_main() -> ! {
|
||||||
&hex!("f69f2445df4f9b17ad2b417be66c3710"),
|
&hex!("f69f2445df4f9b17ad2b417be66c3710"),
|
||||||
&hex!("23304b7a39f9f3ff067d8d8f9e24ecc7"),
|
&hex!("23304b7a39f9f3ff067d8d8f9e24ecc7"),
|
||||||
),
|
),
|
||||||
|
|
||||||
// From the VexRiscv AES test
|
// From the VexRiscv AES test
|
||||||
AesTest::new_ecb(
|
AesTest::new_ecb(
|
||||||
&hex!("706919a040610517f7fff5272b640467c5067a4bba5778ad6cddcbf473031564"),
|
&hex!("706919a040610517f7fff5272b640467c5067a4bba5778ad6cddcbf473031564"),
|
||||||
|
|
@ -169,7 +166,11 @@ fn aes_test_main() -> ! {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
log::error!("{} tests were run and {} errors were encountered", tests.len(), failures);
|
log::error!(
|
||||||
|
"{} tests were run and {} errors were encountered",
|
||||||
|
tests.len(),
|
||||||
|
failures
|
||||||
|
);
|
||||||
|
|
||||||
#[cfg(feature = "low_level_tests")]
|
#[cfg(feature = "low_level_tests")]
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue