feat: update bench.rs
This commit is contained in:
@@ -3,23 +3,6 @@ use benchmark_simple::{Bench, Options};
|
||||
use sm4_gcm::Sm4GcmStreamEncryptor;
|
||||
|
||||
fn main() {
|
||||
let key = [0u8; 16];
|
||||
let nonce = [0u8; 12];
|
||||
let mut e = Sm4GcmStreamEncryptor::new(key, &nonce);
|
||||
|
||||
println!("{}", hex::encode(&key));
|
||||
println!("{}", hex::encode(&nonce));
|
||||
|
||||
let a = e.update(b"hello world");
|
||||
let (b, t) = e.finalize();
|
||||
|
||||
let mut enc = a.clone();
|
||||
enc.extend_from_slice(&b);
|
||||
enc.extend_from_slice(&t);
|
||||
|
||||
println!("{}", hex::encode(&enc));
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
let bench = Bench::new();
|
||||
let mut m = vec![0xd0u8; 16384];
|
||||
|
||||
0
src/decryptor.rs
Normal file
0
src/decryptor.rs
Normal file
@@ -1,8 +1,11 @@
|
||||
pub use encryptor::Sm4GcmStreamEncryptor;
|
||||
|
||||
pub use crate::encryptor::sm4_gcm_aad_encrypt;
|
||||
pub use crate::encryptor::sm4_gcm_encrypt;
|
||||
|
||||
mod util;
|
||||
mod encryptor;
|
||||
|
||||
pub use encryptor::Sm4GcmStreamEncryptor;
|
||||
use crate::encryptor::sm4_gcm_aad_encrypt;
|
||||
mod decryptor;
|
||||
|
||||
// Test vectors are all from BC
|
||||
#[test]
|
||||
|
||||
Reference in New Issue
Block a user