mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-16 08:38:26 +00:00
add chaffing implementation to AES
This commit is contained in:
parent
712ee68df5
commit
da44e98257
3 changed files with 1353 additions and 4 deletions
|
|
@ -9,15 +9,22 @@ description = "AES library for Xous"
|
|||
[dependencies]
|
||||
cipher = "0.4.2"
|
||||
zeroize = { version = "1.6.0", optional = true, default-features = false }
|
||||
rand_chacha = { version = "0.3.1", optional = true, default-features = false }
|
||||
hex = { version = "0.4.3", optional = true, default-features = false, features = [
|
||||
"alloc",
|
||||
] }
|
||||
utralib = { version = "0.1.26", optional = true, default-features = false }
|
||||
bao1x-hal = { path = "../../libs/bao1x-hal", default-features = false, optional = true }
|
||||
|
||||
[lints.rust.unexpected_cfgs]
|
||||
level = "warn"
|
||||
check-cfg = ["cfg(aes_compact)", "cfg(aes_force_soft)"]
|
||||
|
||||
[features]
|
||||
hazmat = [] # Expose cryptographically hazardous APIs
|
||||
hazmat = [] # Expose cryptographically hazardous APIs
|
||||
bao1x = []
|
||||
vexii-test = []
|
||||
precursor = []
|
||||
renode = []
|
||||
chaffing = ["rand_chacha", "hex", "utralib/bao1x", "bao1x-hal/loader-baosec"]
|
||||
default = []
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#![no_std]
|
||||
#![cfg_attr(target_os = "none", no_std)]
|
||||
|
||||
/*
|
||||
Soft AES implementations vendored in from https://github.com/RustCrypto/block-ciphers.git
|
||||
|
|
@ -54,13 +54,16 @@ pub use soft::Aes256Soft as Aes256;
|
|||
))]
|
||||
pub use vex::{Aes128, Aes256};
|
||||
|
||||
#[cfg(any(feature = "vexii-test", feature = "bao1x"))]
|
||||
#[cfg(all(any(feature = "vexii-test", feature = "bao1x"), not(feature = "chaffing")))]
|
||||
mod zkn;
|
||||
#[cfg(all(any(feature = "vexii-test", feature = "bao1x"), feature = "chaffing"))]
|
||||
mod zkn_chaff;
|
||||
#[cfg(any(feature = "vexii-test", feature = "bao1x"))]
|
||||
// pub use soft::Aes128Soft as Aes128;
|
||||
pub use zkn::Aes128;
|
||||
#[cfg(any(feature = "vexii-test", feature = "bao1x"))]
|
||||
pub use zkn::Aes256;
|
||||
#[cfg(all(any(feature = "vexii-test", feature = "bao1x"), feature = "chaffing"))]
|
||||
use zkn_chaff as zkn;
|
||||
|
||||
/// Size of an AES block (128-bits; 16-bytes)
|
||||
pub const BLOCK_SIZE: usize = 16;
|
||||
|
|
|
|||
1339
services/aes/src/zkn_chaff.rs
Normal file
1339
services/aes/src/zkn_chaff.rs
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue