Merge rust-bitcoin/rust-bitcoin#4105: Automated nightly rustfmt (2025-02-23)
0596867048
2025-02-23 automated rustfmt nightly (Fmt Bot)
Pull request description:
Automated nightly `rustfmt` changes by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action
ACKs for top commit:
apoelstra:
ACK 0596867048be131f3af26f5f8be4b36f1fe186b0; successfully ran local tests
Tree-SHA512: 84a3b7c79939c1bcd0c3e30b117e0f681923a8c0825ee8852845abc0ec0677f3a6033c6133eba7742b9bb4e67d635614be5cd2d983d07c5866396142a8d8c3bc
This commit is contained in:
commit
5a0d5d7b79
|
@ -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