From c0e98efb5b31b6ec1300e90d323cdc03d83d3721 Mon Sep 17 00:00:00 2001 From: Sander Wiebing <45387038+SanWieb@users.noreply.github.com> Date: Tue, 20 Feb 2024 18:29:47 +0100 Subject: [PATCH] [reasoner] Add max for secret w/o base adjusting --- reasoner/reasoner.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/reasoner/reasoner.py b/reasoner/reasoner.py index e4837d5..4f57499 100644 --- a/reasoner/reasoner.py +++ b/reasoner/reasoner.py @@ -27,6 +27,8 @@ (0xffff800000000000, 0xffffffff9fffffff) ] +MAX_SECRET_WO_ADJUSTING_BASE = ((1 << 30) * 256) # 256 GB + CACHE_SHIFT = 6 PAGE_SHIFT = 12 ADDRESS_BIT_LEN = 64 @@ -170,6 +172,11 @@ def is_max_secret_too_high(t : pd.Series, only_independent: bool = False): else: valid_secret_max = (2 ** t['transmitted_secret_size']) - 1 + # The secret will not fit in RAM without base adjusting if it + # exceeds MAX_SECRET_WO_ADJUSTING_BASE + if valid_secret_max > MAX_SECRET_WO_ADJUSTING_BASE: + return True + for r in MAPPED_REGIONS: if base_min <= base_max: