33 lines
652 B
Rust
33 lines
652 B
Rust
mod encode_decode;
|
|
mod error;
|
|
mod helper;
|
|
mod myaes;
|
|
mod myrsa;
|
|
mod mytype;
|
|
mod myuuid;
|
|
|
|
pub use encode_decode::*;
|
|
pub use error::*;
|
|
pub use helper::*;
|
|
pub use myaes::{aes_decrypt, aes_encrypt};
|
|
pub use myrsa::{
|
|
gen_rsa_keys, load_private_key_file, load_public_key, load_public_key_file, rsa_decrypt,
|
|
rsa_encrypt,
|
|
};
|
|
pub use mytype::*;
|
|
pub use myuuid::*;
|
|
|
|
#[cfg(test)]
|
|
pub mod test_utils {
|
|
use rand::{thread_rng, Rng};
|
|
|
|
pub fn generate_info(n: i32) -> Vec<u8> {
|
|
let mut result = vec![];
|
|
for _ in 0..n {
|
|
let v: u8 = thread_rng().gen_range(0..255);
|
|
result.push(v);
|
|
}
|
|
result
|
|
}
|
|
}
|