mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-15 08:30:02 +00:00
aes-test: more pruning of C-isms
Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
parent
e6816ce982
commit
27c4444d7c
1 changed files with 9 additions and 15 deletions
|
|
@ -367,7 +367,7 @@ fn aes_dec_round_last(arg1: u32, arg2: u32, id: AesByte) -> u32 {
|
|||
}
|
||||
}
|
||||
|
||||
// use core::convert::TryInto;
|
||||
use core::convert::TryInto;
|
||||
|
||||
fn get_u32(input: &[u8], offset: usize) -> u32 {
|
||||
// let tmp = [
|
||||
|
|
@ -376,23 +376,17 @@ fn get_u32(input: &[u8], offset: usize) -> u32 {
|
|||
// input[offset + 2],
|
||||
// input[offset + 3],
|
||||
// ];
|
||||
let tmp = [
|
||||
input[offset + 3],
|
||||
input[offset + 2],
|
||||
input[offset + 1],
|
||||
input[offset + 0],
|
||||
];
|
||||
u32::from_le_bytes(tmp)
|
||||
// let tmp = [
|
||||
// input[offset + 3],
|
||||
// input[offset + 2],
|
||||
// input[offset + 1],
|
||||
// input[offset + 0],
|
||||
// ];
|
||||
u32::from_be_bytes(input[offset..offset+4].try_into().unwrap())
|
||||
}
|
||||
|
||||
fn get_u32_swapped(input: &[u8], offset: usize) -> u32 {
|
||||
let tmp = [
|
||||
input[offset + 0],
|
||||
input[offset + 1],
|
||||
input[offset + 2],
|
||||
input[offset + 3],
|
||||
];
|
||||
u32::from_le_bytes(tmp)
|
||||
u32::from_le_bytes(input[offset..offset+4].try_into().unwrap())
|
||||
}
|
||||
|
||||
fn set_u32(output: &mut [u8], offset: usize, value: u32) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue