lib_um_crypto_rust/um_crypto/qmc/src/lib.rs

27 lines
499 B
Rust
Raw Normal View History

2024-09-04 00:12:20 +00:00
use thiserror::Error;
2024-09-05 22:37:55 +00:00
pub mod footer;
2024-09-04 00:12:20 +00:00
pub mod v1;
2024-09-04 18:13:03 +00:00
pub mod v2_map;
2024-09-04 00:12:20 +00:00
pub mod v2_rc4;
#[derive(Error, Debug)]
2024-09-04 18:13:03 +00:00
pub enum QmcCryptoError {
#[error("QMC V2/Map Cipher: Key is empty")]
QMCV2MapKeyEmpty,
}
2024-09-04 21:24:34 +00:00
#[cfg(test)]
mod test {
pub fn generate_key(len: usize) -> Vec<u8> {
(1..=len).map(|i| i as u8).collect()
}
#[cfg(test)]
pub fn generate_key_128() -> [u8; 128] {
generate_key(128)
.try_into()
.expect("failed to make test key")
}
}