|
1 | 1 | use aegis::aegis128l::Aegis128L; |
2 | | -use aegis::aegis256::Aegis256; |
3 | | - |
4 | | -#[cfg(not(feature = "pure-rust"))] |
5 | 2 | use aegis::aegis128x2::Aegis128X2; |
6 | | -#[cfg(not(feature = "pure-rust"))] |
7 | 3 | use aegis::aegis128x4::Aegis128X4; |
| 4 | +use aegis::aegis256::Aegis256; |
| 5 | + |
8 | 6 | #[cfg(not(feature = "pure-rust"))] |
9 | 7 | use aegis::aegis256x2::Aegis256X2; |
10 | 8 | #[cfg(not(feature = "pure-rust"))] |
@@ -81,15 +79,13 @@ fn test_aegis128l(m: &mut [u8]) { |
81 | 79 | state.encrypt_in_place(m, &[]); |
82 | 80 | } |
83 | 81 |
|
84 | | -#[cfg(not(feature = "pure-rust"))] |
85 | 82 | fn test_aegis128x2(m: &mut [u8]) { |
86 | 83 | let key = [0u8; 16]; |
87 | 84 | let nonce = [0u8; 16]; |
88 | 85 | let state = Aegis128X2::<16>::new(&nonce, &key); |
89 | 86 | state.encrypt_in_place(m, &[]); |
90 | 87 | } |
91 | 88 |
|
92 | | -#[cfg(not(feature = "pure-rust"))] |
93 | 89 | fn test_aegis128x4(m: &mut [u8]) { |
94 | 90 | let key = [0u8; 16]; |
95 | 91 | let nonce = [0u8; 16]; |
@@ -141,7 +137,10 @@ fn test_aegis128x4_mac(state: &Aegis128X4Mac<32>, m: &[u8]) { |
141 | 137 | state.finalize(); |
142 | 138 | } |
143 | 139 |
|
144 | | -#[cfg(not(any(target_arch = "wasm32", target_arch = "wasm64")))] |
| 140 | +#[cfg(all( |
| 141 | + not(feature = "pure-rust"), |
| 142 | + not(any(target_arch = "wasm32", target_arch = "wasm64")) |
| 143 | +))] |
145 | 144 | fn test_hmac_sha256(m: &[u8]) { |
146 | 145 | let md = boring::hash::MessageDigest::sha256(); |
147 | 146 | let mut h1 = boring::hash::hash(md, m).unwrap().to_vec(); |
@@ -221,20 +220,17 @@ fn main() { |
221 | 220 | println!("* Encryption:"); |
222 | 221 | println!(); |
223 | 222 |
|
224 | | - #[cfg(not(feature = "pure-rust"))] |
225 | | - { |
226 | | - let res = bench.run(options, || test_aegis128x4(&mut m)); |
227 | | - println!( |
228 | | - "aegis128x4 : {}", |
229 | | - res.throughput_bits(m.len() as _) |
230 | | - ); |
| 223 | + let res = bench.run(options, || test_aegis128x4(&mut m)); |
| 224 | + println!( |
| 225 | + "aegis128x4 : {}", |
| 226 | + res.throughput_bits(m.len() as _) |
| 227 | + ); |
231 | 228 |
|
232 | | - let res = bench.run(options, || test_aegis128x2(&mut m)); |
233 | | - println!( |
234 | | - "aegis128x2 : {}", |
235 | | - res.throughput_bits(m.len() as _) |
236 | | - ); |
237 | | - } |
| 229 | + let res = bench.run(options, || test_aegis128x2(&mut m)); |
| 230 | + println!( |
| 231 | + "aegis128x2 : {}", |
| 232 | + res.throughput_bits(m.len() as _) |
| 233 | + ); |
238 | 234 |
|
239 | 235 | let res = bench.run(options, || test_aegis128l(&mut m)); |
240 | 236 | println!( |
|
0 commit comments