File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11#![ allow( clippy:: unwrap_used) ]
22use criterion:: * ;
33use rand:: TryRngCore ;
4+ use std:: hint;
45
56pub fn bench ( c : & mut Criterion ) {
6- let mut rand_generator = black_box ( rand:: rngs:: OsRng { } ) ;
7+ let mut rand_generator = hint :: black_box ( rand:: rngs:: OsRng { } ) ;
78
8- let mut packet_length = black_box ( vec ! [ 0u8 ; 4 ] ) ;
9+ let mut packet_length = hint :: black_box ( vec ! [ 0u8 ; 4 ] ) ;
910
1011 for cipher_name in [ super :: CHACHA20_POLY1305 , super :: AES_256_GCM ] {
1112 let cipher = super :: CIPHERS . get ( & cipher_name) . unwrap ( ) ;
@@ -26,7 +27,7 @@ pub fn bench(c: &mut Criterion) {
2627 group. bench_function ( format ! ( "Block size: {size}" ) , |b| {
2728 b. iter_with_setup (
2829 || {
29- let mut in_out = black_box ( vec ! [ 0u8 ; size] ) ;
30+ let mut in_out = hint :: black_box ( vec ! [ 0u8 ; size] ) ;
3031 rand_generator. try_fill_bytes ( & mut in_out) . unwrap ( ) ;
3132 rand_generator. try_fill_bytes ( & mut packet_length) . unwrap ( ) ;
3233 in_out
You can’t perform that action at this time.
0 commit comments