Gate the learned key-space claims

check_consistency.py asserts that a million random guesses leave the
learned key at 0.72, and that the learned key falls to known plaintext
the way the structured one does, since the solve is linear in the key and
indifferent to whether its unknowns are signs or reals.
This commit is contained in:
KiHoLee
2026-08-28 20:48:01 +09:00
parent cbdb068219
commit de380340a6
+10
View File
@@ -305,6 +305,16 @@ chk("learned 0.064 at 10 dB",
"%.5f" % [float(r["legit"]) for r in _sl "%.5f" % [float(r["legit"]) for r in _sl
if float(r["snr_db"]) == 10.0][0]) if float(r["snr_db"]) == 10.0][0])
_bl = {int(r["K"]): float(r["ser_mask"])
for r in rows("sec_brute_learned.csv")}
chk("learned key resists a million random guesses",
abs(_bl[1_000_000] - 0.72) < 5e-3, "%.4f" % _bl[1_000_000])
_kl = {(float(r["snr_db"]), int(r["n_frames"])): float(r["eve_ser"])
for r in rows("kpa_learned.csv")}
chk("learned key falls to known plaintext like the structured one",
_kl[(10.0, 4)] < 0.08 and _kl[(10.0, 1)] > 0.9,
"N=1 %.3f, N=4 %.4f" % (_kl[(10.0, 1)], _kl[(10.0, 4)]))
# --- trends, which the value assertions above cannot see --------------- # --- trends, which the value assertions above cannot see ---------------
_snr = rows("sec_snr.csv") _snr = rows("sec_snr.csv")
_lg = [float(r["legit"]) for r in _snr] _lg = [float(r["legit"]) for r in _snr]