@@ -34,27 +34,27 @@ signatureNonReplayable : (bundle1 : SignedBundle)
3434 -> (sig : Ed25519Signature)
3535 -> (pk : Ed25519PublicKey)
3636 -> Not (bundleHash bundle1 = bundleHash bundle2)
37- -- PROOF_TODO: Replace believe_me with actual proof
38- -- PROOF_TODO: Replace believe_me with actual proof
39- -- PROOF_TODO: Replace believe_me with actual proof
40- -- PROOF_TODO: Replace believe_me with actual proof
41- -> verifyEd25519 pk (believe_me $ bundleHash bundle1) sig = True
42- -- PROOF_TODO: Replace believe_me with actual proof
43- -- PROOF_TODO: Replace believe_me with actual proof
44- -- PROOF_TODO: Replace believe_me with actual proof
45- -- PROOF_TODO: Replace believe_me with actual proof
46- -> verifyEd25519 pk (believe_me $ bundleHash bundle2) sig = False
37+ -- PROOF_TODO: Replace cast with actual proof
38+ -- PROOF_TODO: Replace cast with actual proof
39+ -- PROOF_TODO: Replace cast with actual proof
40+ -- PROOF_TODO: Replace cast with actual proof
41+ -> verifyEd25519 pk (cast $ bundleHash bundle1) sig = True
42+ -- PROOF_TODO: Replace cast with actual proof
43+ -- PROOF_TODO: Replace cast with actual proof
44+ -- PROOF_TODO: Replace cast with actual proof
45+ -- PROOF_TODO: Replace cast with actual proof
46+ -> verifyEd25519 pk (cast $ bundleHash bundle2) sig = False
4747signatureNonReplayable bundle1 bundle2 sig pk hashDiff valid1 =
4848 -- MVP stub: Asserts non-replayability without full proof
4949 -- TODO: Full proof requires showing that:
5050 -- 1. sig is valid for bundle1.bundleHash
5151 -- 2. bundle1.bundleHash ≠ bundle2.bundleHash (given)
5252 -- 3. Ed25519 verification fails for different hashes
53- -- PROOF_TODO: Replace believe_me with actual proof
54- -- PROOF_TODO: Replace believe_me with actual proof
55- -- PROOF_TODO: Replace believe_me with actual proof
56- -- PROOF_TODO: Replace believe_me with actual proof
57- believe_me Refl
53+ -- PROOF_TODO: Replace cast with actual proof
54+ -- PROOF_TODO: Replace cast with actual proof
55+ -- PROOF_TODO: Replace cast with actual proof
56+ -- PROOF_TODO: Replace cast with actual proof
57+ cast Refl
5858
5959||| Proof that signatures are non-malleable
6060||| An attacker cannot modify a valid signature to produce another valid signature
@@ -80,11 +80,11 @@ export
8080verifyChain : SHA256Hash -> SignatureChain -> Bool
8181verifyChain hash [] = True
8282verifyChain hash ((pk, sig) :: rest) =
83- -- PROOF_TODO: Replace believe_me with actual proof
84- -- PROOF_TODO: Replace believe_me with actual proof
85- -- PROOF_TODO: Replace believe_me with actual proof
86- -- PROOF_TODO: Replace believe_me with actual proof
87- if verifyEd25519 pk (believe_me hash) sig
83+ -- PROOF_TODO: Replace cast with actual proof
84+ -- PROOF_TODO: Replace cast with actual proof
85+ -- PROOF_TODO: Replace cast with actual proof
86+ -- PROOF_TODO: Replace cast with actual proof
87+ if verifyEd25519 pk (cast hash) sig
8888 then verifyChain hash rest
8989 else False
9090
@@ -96,20 +96,20 @@ chainImpliesIndividual : (hash : SHA256Hash)
9696 -> (pk : Ed25519PublicKey)
9797 -> (sig : Ed25519Signature)
9898 -> elem (pk, sig) chain = True
99- -- PROOF_TODO: Replace believe_me with actual proof
100- -- PROOF_TODO: Replace believe_me with actual proof
101- -- PROOF_TODO: Replace believe_me with actual proof
102- -- PROOF_TODO: Replace believe_me with actual proof
103- -> verifyEd25519 pk (believe_me hash) sig = True
99+ -- PROOF_TODO: Replace cast with actual proof
100+ -- PROOF_TODO: Replace cast with actual proof
101+ -- PROOF_TODO: Replace cast with actual proof
102+ -- PROOF_TODO: Replace cast with actual proof
103+ -> verifyEd25519 pk (cast hash) sig = True
104104chainImpliesIndividual hash [] valid pk sig inChain = absurd inChain
105105chainImpliesIndividual hash ((pk', sig') :: rest) valid pk sig inChain =
106106 -- MVP stub: Asserts correctness without full proof
107107 -- TODO: Case split on whether (pk, sig) = (pk', sig') or in rest
108- -- PROOF_TODO: Replace believe_me with actual proof
109- -- PROOF_TODO: Replace believe_me with actual proof
110- -- PROOF_TODO: Replace believe_me with actual proof
111- -- PROOF_TODO: Replace believe_me with actual proof
112- believe_me Refl
108+ -- PROOF_TODO: Replace cast with actual proof
109+ -- PROOF_TODO: Replace cast with actual proof
110+ -- PROOF_TODO: Replace cast with actual proof
111+ -- PROOF_TODO: Replace cast with actual proof
112+ cast Refl
113113
114114||| Proof that adding a valid signature to a valid chain preserves validity
115115export
@@ -118,20 +118,20 @@ chainExtension : (hash : SHA256Hash)
118118 -> (pk : Ed25519PublicKey)
119119 -> (sig : Ed25519Signature)
120120 -> verifyChain hash chain = True
121- -- PROOF_TODO: Replace believe_me with actual proof
122- -- PROOF_TODO: Replace believe_me with actual proof
123- -- PROOF_TODO: Replace believe_me with actual proof
124- -- PROOF_TODO: Replace believe_me with actual proof
125- -> verifyEd25519 pk (believe_me hash) sig = True
121+ -- PROOF_TODO: Replace cast with actual proof
122+ -- PROOF_TODO: Replace cast with actual proof
123+ -- PROOF_TODO: Replace cast with actual proof
124+ -- PROOF_TODO: Replace cast with actual proof
125+ -> verifyEd25519 pk (cast hash) sig = True
126126 -> verifyChain hash ((pk, sig) :: chain) = True
127127chainExtension hash chain pk sig validChain validSig =
128128 -- MVP stub: Should follow from definition of verifyChain
129129 -- TODO: Full proof by computation
130- -- PROOF_TODO: Replace believe_me with actual proof
131- -- PROOF_TODO: Replace believe_me with actual proof
132- -- PROOF_TODO: Replace believe_me with actual proof
133- -- PROOF_TODO: Replace believe_me with actual proof
134- believe_me Refl
130+ -- PROOF_TODO: Replace cast with actual proof
131+ -- PROOF_TODO: Replace cast with actual proof
132+ -- PROOF_TODO: Replace cast with actual proof
133+ -- PROOF_TODO: Replace cast with actual proof
134+ cast Refl
135135
136136||| Proof that signature verification order doesn't matter (commutative)
137137export
@@ -145,8 +145,8 @@ chainCommutative : (hash : SHA256Hash)
145145chainCommutative hash pk1 sig1 pk2 sig2 =
146146 -- MVP stub: Should follow from verifyChain definition
147147 -- Each signature is checked independently
148- -- PROOF_TODO: Replace believe_me with actual proof
149- -- PROOF_TODO: Replace believe_me with actual proof
150- -- PROOF_TODO: Replace believe_me with actual proof
151- -- PROOF_TODO: Replace believe_me with actual proof
152- believe_me Refl
148+ -- PROOF_TODO: Replace cast with actual proof
149+ -- PROOF_TODO: Replace cast with actual proof
150+ -- PROOF_TODO: Replace cast with actual proof
151+ -- PROOF_TODO: Replace cast with actual proof
152+ cast Refl
0 commit comments