feat: v0.2.0 performance improved, from 36MB/s to 477MB/s

This commit is contained in:
2023-09-02 00:10:17 +08:00
parent aab2c97eaa
commit d46fa7b03f
4 changed files with 74 additions and 199 deletions

View File

@@ -22,8 +22,6 @@ mod util;
mod encryptor;
mod decryptor;
mod encryptor2;
#[test]
fn test128() {
use aes_gcm::{aead::{Aead, Nonce, Payload}, Aes128Gcm, KeyInit};
@@ -251,7 +249,7 @@ fn test256_stream() {
// encrypt
let mut ciphertext = vec![];
let mut encryptor = Aes256GcmStreamEncryptor::new(key.clone(), &nonce);
for i in 0..1024 {
for i in 0..1025 {
plaintext.extend_from_slice(&[(i % 128) as u8]);
ciphertext.extend_from_slice(&encryptor.update(&[(i % 128) as u8]));
}