From c43daf8499528b1671e6cb5433b7f34b08a4757d Mon Sep 17 00:00:00 2001
From: Guillaume Didier <gdidier@frontend-buster>
Date: Wed, 29 Sep 2021 11:24:23 +0200
Subject: [PATCH] Fix bug in unsupported hashing that resulted in a ridiculous
 number of iteration

---
 cache_utils/src/calibrate_2t.rs       | 1 -
 cache_utils/src/complex_addressing.rs | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/cache_utils/src/calibrate_2t.rs b/cache_utils/src/calibrate_2t.rs
index 4d5d5d1..c3ee784 100644
--- a/cache_utils/src/calibrate_2t.rs
+++ b/cache_utils/src/calibrate_2t.rs
@@ -201,7 +201,6 @@ fn calibrate_fixed_freq_2_thread_impl<I: Iterator<Item = (usize, usize)>, T>(
         let mut calibrate_result_vec = Vec::new();
 
         let offsets = image_antecedent.values().copied();
-        eprintln!("Number of offsets: {}", offsets.len());
 
         /*
         let offsets: Box<dyn Iterator<Item = isize>> = match image_antecedent {
diff --git a/cache_utils/src/complex_addressing.rs b/cache_utils/src/complex_addressing.rs
index 919de0d..a37331b 100644
--- a/cache_utils/src/complex_addressing.rs
+++ b/cache_utils/src/complex_addressing.rs
@@ -288,7 +288,7 @@ pub enum CacheAttackSlicing {
 impl CacheAttackSlicing {
     pub fn from(cs: CacheSlicing, cache_line_length: usize) -> CacheAttackSlicing {
         match cs {
-            Unsupported => CacheAttackSlicing::Unsupported(!((1 << cache_line_length) - 1)),
+            Unsupported => CacheAttackSlicing::Unsupported(!dbg!(dbg!(cache_line_length) - 1)),
             ComplexAddressing(ca) => CacheAttackSlicing::ComplexAddressing(ca),
             SimpleAddressing(sa) => CacheAttackSlicing::SimpleAddressing(sa),
             NoSlice => CacheAttackSlicing::NoSlice,