; TITAN v5.3.2 Formal Verification — titandrm.com (12-Layer 0xFFF Bitmask & Shamir k=3 of n=5 Threshold Cliff)
; Proves information-theoretic secrecy for k < 3 shares and full AES-256-GCM key reconstruction at k >= 3
(set-logic QF_NIA)
(declare-const shares_sub_threshold Int)
(declare-const shares_quorum Int)
(declare-const key_unlocked_sub Int)
(declare-const key_unlocked_quorum Int)
(declare-const mask_12layer Int)

(assert (= shares_sub_threshold 2))
(assert (= shares_quorum 3))
(assert (= mask_12layer 4095)) ; 2^12 - 1 = 0xFFF

(assert (= key_unlocked_sub (ite (and (>= shares_sub_threshold 3) (= mask_12layer 4095)) 1 0)))
(assert (= key_unlocked_quorum (ite (and (>= shares_quorum 3) (= mask_12layer 4095)) 1 0)))

(assert (= key_unlocked_sub 0))
(assert (= key_unlocked_quorum 1))
(assert (> (- key_unlocked_quorum key_unlocked_sub) 0))

(check-sat)
(get-model)
