|
1 | 1 | use core::hash::{Hash, Hasher}; |
2 | | -use std::collections::{HashMap}; |
| 2 | +use std::collections::HashMap; |
3 | 3 |
|
4 | 4 | fn assert_sufficiently_different(a: u64, b: u64, tolerance: i32) { |
5 | 5 | let (same_byte_count, same_nibble_count) = count_same_bytes_and_nibbles(a, b); |
@@ -64,8 +64,7 @@ fn gen_combinations(options: &[u32; 11], depth: u32, so_far: Vec<u32>, combinati |
64 | 64 |
|
65 | 65 | fn test_no_full_collisions<T: Hasher>(gen_hash: impl Fn() -> T) { |
66 | 66 | let options: [u32; 11] = [ |
67 | | - 0x00000000, 0x10000000, 0x20000000, 0x40000000, 0x80000000, 0xF0000000, |
68 | | - 1, 2, 4, 8, 15 |
| 67 | + 0x00000000, 0x10000000, 0x20000000, 0x40000000, 0x80000000, 0xF0000000, 1, 2, 4, 8, 15, |
69 | 68 | ]; |
70 | 69 | let mut combinations = Vec::new(); |
71 | 70 | gen_combinations(&options, 7, Vec::new(), &mut combinations); |
@@ -342,9 +341,12 @@ fn test_sparse<T: Hasher>(hasher: impl Fn() -> T) { |
342 | 341 | let mut buf = [0u8; 256]; |
343 | 342 | let mut hashes = HashMap::new(); |
344 | 343 | for idx_1 in 0..256 { |
345 | | - for idx_2 in idx_1+1..256 { |
| 344 | + for idx_2 in idx_1 + 1..256 { |
346 | 345 | for value_1 in [1, 2, 4, 8, 16, 32, 64, 128] { |
347 | | - for value_2 in [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 15, 16, 17, 18, 20, 24, 31, 32, 33, 48, 64, 96, 127, 128, 129, 192, 254, 255] { |
| 346 | + for value_2 in [ |
| 347 | + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 15, 16, 17, 18, 20, 24, 31, 32, 33, 48, 64, 96, 127, 128, 129, |
| 348 | + 192, 254, 255, |
| 349 | + ] { |
348 | 350 | buf[idx_1] = value_1; |
349 | 351 | buf[idx_2] = value_2; |
350 | 352 | let hash_value = hash_with(&buf, &mut hasher()); |
@@ -437,12 +439,8 @@ mod fallback_tests { |
437 | 439 | ///Basic sanity tests of the cypto properties of aHash. |
438 | 440 | #[cfg(any( |
439 | 441 | all(any(target_arch = "x86", target_arch = "x86_64"), target_feature = "aes", not(miri)), |
440 | | - all( |
441 | | - any(target_arch = "arm", target_arch = "aarch64"), |
442 | | - any(target_feature = "aes", target_feature = "crypto"), |
443 | | - not(miri), |
444 | | - feature = "stdsimd" |
445 | | - ) |
| 442 | + all(target_arch = "aarch64", target_feature = "aes", not(miri)), |
| 443 | + all(feature = "nightly-arm-aes", target_arch = "arm", target_feature = "aes", not(miri)), |
446 | 444 | ))] |
447 | 445 | #[cfg(test)] |
448 | 446 | mod aes_tests { |
|
0 commit comments