2025-02-23 automated rustfmt nightly

This commit is contained in:
Fmt Bot 2025-02-23 01:21:34 +00:00 committed by github-actions[bot]
parent d1171381bc
commit 0596867048
1 changed files with 27 additions and 30 deletions

View File

@ -4,42 +4,39 @@ use crate::{ChaCha20, Key, Nonce};
#[bench]
pub fn chacha20_10(bh: &mut Bencher) {
let key =
Key::new([0u8; 32]);
let nonce = Nonce::new([0u8; 12]);
let count = 1;
let mut chacha = ChaCha20::new(key, nonce, count);
let mut bytes = [0u8; 10];
bh.iter(|| {
chacha.apply_keystream(&mut bytes[..]);
});
bh.bytes = bytes.len() as u64;
let key = Key::new([0u8; 32]);
let nonce = Nonce::new([0u8; 12]);
let count = 1;
let mut chacha = ChaCha20::new(key, nonce, count);
let mut bytes = [0u8; 10];
bh.iter(|| {
chacha.apply_keystream(&mut bytes[..]);
});
bh.bytes = bytes.len() as u64;
}
#[bench]
pub fn chacha20_1k(bh: &mut Bencher) {
let key =
Key::new([0u8; 32]);
let nonce = Nonce::new([0u8; 12]);
let count = 1;
let mut chacha = ChaCha20::new(key, nonce, count);
let mut bytes = [0u8; 1024];
bh.iter(|| {
chacha.apply_keystream(&mut bytes[..]);
});
bh.bytes = bytes.len() as u64;
let key = Key::new([0u8; 32]);
let nonce = Nonce::new([0u8; 12]);
let count = 1;
let mut chacha = ChaCha20::new(key, nonce, count);
let mut bytes = [0u8; 1024];
bh.iter(|| {
chacha.apply_keystream(&mut bytes[..]);
});
bh.bytes = bytes.len() as u64;
}
#[bench]
pub fn chacha20_64k(bh: &mut Bencher) {
let key =
Key::new([0u8; 32]);
let nonce = Nonce::new([0u8; 12]);
let count = 1;
let mut chacha = ChaCha20::new(key, nonce, count);
let mut bytes = [0u8; 65536];
bh.iter(|| {
chacha.apply_keystream(&mut bytes[..]);
});
bh.bytes = bytes.len() as u64;
let key = Key::new([0u8; 32]);
let nonce = Nonce::new([0u8; 12]);
let count = 1;
let mut chacha = ChaCha20::new(key, nonce, count);
let mut bytes = [0u8; 65536];
bh.iter(|| {
chacha.apply_keystream(&mut bytes[..]);
});
bh.bytes = bytes.len() as u64;
}