feat: v0.1.0

This commit is contained in:
2023-09-04 00:10:23 +08:00
parent 147f29a9dd
commit e7c311eacb
8 changed files with 230 additions and 17 deletions

View File

@@ -1,6 +1,6 @@
use benchmark_simple::{Bench, Options};
use sm4_gcm::Sm4GcmStreamEncryptor;
use sm4_gcm::{Sm4GcmStreamEncryptor, Sm4Key};
fn main() {
let bench = Bench::new();
@@ -21,9 +21,9 @@ fn main() {
fn test_sm4_encrypt(m: &mut [u8]) {
let key = [0u8; 16];
let key = Sm4Key([0u8; 16]);
let nonce = [0u8; 12];
let mut encryptor = Sm4GcmStreamEncryptor::new(key, &nonce);
let mut encryptor = Sm4GcmStreamEncryptor::new(&key, &nonce);
encryptor.update(m);
encryptor.finalize();