-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
77 changed files
with
3,746 additions
and
2,614 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
Require Import Garden.Garden. | ||
Require Import Circom.Circomlib.translation.circuits.sha256.xor3. | ||
|
||
Import Run. | ||
|
||
Lemma run_Xor3 (P : Z) (a b c out mid : list F.t) | ||
(H_length_a : List.length a = 3%nat) | ||
(H_length_b : List.length b = 3%nat) | ||
(H_length_c : List.length c = 3%nat) | ||
(H_bits_a : List.Forall (fun x => x = 0 \/ x = 1) a) | ||
(H_bits_b : List.Forall (fun x => x = 0 \/ x = 1) b) | ||
(H_bits_c : List.Forall (fun x => x = 0 \/ x = 1) c) : | ||
let signals := {| | ||
Xor3Signals.a := a; | ||
Xor3Signals.b := b; | ||
Xor3Signals.c := c; | ||
Xor3Signals.out := out; | ||
Xor3Signals.mid := mid; | ||
|} in | ||
{{ Xor3Signals.IsNamed.P, 97 , signals, Scopes.empty ⏩ | ||
Xor3 3 🔽 BlockUnit.Tt | ||
⏩ Scopes.empty, True, True }}. | ||
Proof. | ||
do 4 (destruct a as [|? a]; cbn in H_length_a; try discriminate). | ||
do 4 (destruct b as [|? b]; cbn in H_length_b; try discriminate). | ||
do 4 (destruct c as [|? c]; cbn in H_length_c; try discriminate). | ||
repeat match goal with | ||
| H : List.Forall _ _ |- _ => inversion_clear H | ||
end. | ||
repeat match goal with | ||
| H : _ \/ _ |- _ => destruct H | ||
end; | ||
subst. | ||
{ run_deterministic. | ||
{ eapply Run.PrimitiveGetVarAccessSignal; | ||
(* reflexivity. | ||
now constructor. | ||
cbn. | ||
repeat econstructor. *) | ||
[ | ||
reflexivity | now constructor | now repeat econstructor | | ||
]. | ||
eapply Run.PrimitiveDeclareSignal. | ||
cbn. | ||
{ eapply Run.PrimitiveGetVarAccess. | ||
repeat constructor. | ||
2: { | ||
repeat constructor. | ||
} | ||
reflexivity. | ||
Show. | ||
|
||
} | ||
{ | ||
cbn in H_length_a. | ||
discriminate. | ||
} | ||
2: { | ||
|
||
} | ||
run_deterministic. | ||
Qed. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.