2025-02-23 automated rustfmt nightly
This commit is contained in:
parent
d1171381bc
commit
0596867048
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue