mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-15 08:30:02 +00:00
services/aes: use cfg(target_arch = riscv32) for vex AES
Signed-off-by: Jean-Pierre De Jesus DIAZ <me@jeandudey.tech>
This commit is contained in:
parent
834bc09867
commit
dc528c4bc3
1 changed files with 15 additions and 3 deletions
|
|
@ -26,16 +26,28 @@ pub type Block = GenericArray<u8, U16>;
|
|||
pub type Block8 = GenericArray<Block, U8>;
|
||||
|
||||
// vex patches
|
||||
#[cfg(target_arch = "riscv32")]
|
||||
mod vex;
|
||||
// Note that we can't use 'feature' flags (for precursor, renode, hosted) because the AES
|
||||
// library is patched into functions that are oblivious to these features.
|
||||
// so this library has to fall back on the legacy method of determining which build target
|
||||
// is being specified.
|
||||
#[cfg(any(target_os = "none", target_os = "xous"))]
|
||||
#[cfg(all(
|
||||
target_arch = "riscv32",
|
||||
any(target_os = "none", target_os = "xous"),
|
||||
))]
|
||||
pub use vex::{Aes128, Aes256};
|
||||
#[cfg(not(any(target_os = "none", target_os = "xous")))]
|
||||
#[cfg(all(
|
||||
not(target_arch = "riscv32"),
|
||||
not(target_os = "none"),
|
||||
not(target_os = "xous"),
|
||||
))]
|
||||
pub use soft::Aes128Soft as Aes128;
|
||||
#[cfg(not(any(target_os = "none", target_os = "xous")))]
|
||||
#[cfg(all(
|
||||
not(target_arch = "riscv32"),
|
||||
not(target_os = "none"),
|
||||
not(target_os = "xous"),
|
||||
))]
|
||||
pub use soft::Aes256Soft as Aes256;
|
||||
|
||||
/// Size of an AES block (128-bits; 16-bytes)
|
||||
|
|
|
|||
Loading…
Reference in a new issue