feat: v0.2.0-alpha-1

This commit is contained in:
2023-08-31 00:22:46 +08:00
parent adb0383133
commit 0ad4e5ce28
2 changed files with 2 additions and 8 deletions

View File

@@ -1,6 +1,6 @@
[package]
name = "aes-gcm-stream"
version = "0.1.2"
version = "0.2.0"
edition = "2021"
authors = ["Hatter Jiang"]
repository = "https://git.hatter.ink/hatter/aes-gcm-stream"
@@ -16,9 +16,7 @@ aes = { version = "0.8.3", features = ["zeroize"] }
ghash = "0.5.0"
zeroize = { version = "1.6.0", features = ["zeroize_derive"] }
hex = "0.4.3"
[dev-dependencies]
#hex = "0.4.3"
hex = "0.4.3"
aes-gcm = { version = "0.10.2", features = ["zeroize"] }
benchmark-simple = "0.1.8"

View File

@@ -42,7 +42,6 @@ impl $module {
message_len: 0,
};
let (ghash_key, normalized_nonce) = s.normalize_nonce(nonce);
println!("<<< KEY: {}", hex::encode(ghash_key.to_be_bytes()));
s.ghash_key = ghash_key;
s.init_nonce = normalized_nonce;
s.encryption_nonce = normalized_nonce;
@@ -127,9 +126,7 @@ impl $module {
let mut bs = self.init_nonce.to_be_bytes().clone();
let block = Block::<$aesn>::from_mut_slice(&mut bs);
self.crypto.encrypt_block(block);
println!("<<< final enc block: {}", hex::encode(&block.as_slice()));
let tag_trunk = self.ghash_val.to_be_bytes();
println!("<<< final block: {}", hex::encode(&tag_trunk));
let y = u8to128(&tag_trunk) ^ u8to128(&block.as_slice());
y.to_be_bytes().to_vec()
}
@@ -141,7 +138,6 @@ impl $module {
let blocks_count = integrality_buffer_slice_len / 16;
for i in 0..blocks_count {
let buf = &integrality_buffer_slice[i * 16..(i + 1) * 16];
println!("<<< block: {}", hex::encode(buf));
self.ghash_val = gmul_128(self.ghash_val ^ u8to128(buf), self.ghash_key)
}
self.integrality_buffer = integrality_buffer_slice[blocks_count * 16..].to_vec();