test: add more qmc_v1 test

This commit is contained in:
鲁树人
2024-09-04 22:24:34 +01:00
parent 2c53e4d950
commit 0f1233b45a
2 changed files with 41 additions and 0 deletions

View File

@@ -9,3 +9,17 @@ pub enum QmcCryptoError {
#[error("QMC V2/Map Cipher: Key is empty")]
QMCV2MapKeyEmpty,
}
#[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")
}
}