aboutsummaryrefslogtreecommitdiff
path: root/src/Specific
diff options
context:
space:
mode:
authorGravatar Jason Gross <jgross@mit.edu>2017-06-19 17:59:31 -0400
committerGravatar Jason Gross <jgross@mit.edu>2017-06-19 17:59:31 -0400
commitb38a703308a2030393ca23631461628b8caf4195 (patch)
treee7e2a41336848c5845de981f3cd3314f3f42f8db /src/Specific
parentd4e374da36d87a502a61456abfe4b2eec25023b7 (diff)
No small in MP256 spec (wrong place), s/native/vm/
The native compiler was giving anomalies on travis.
Diffstat (limited to 'src/Specific')
-rw-r--r--src/Specific/MontgomeryP256.v11
-rw-r--r--src/Specific/MontgomeryP256_128.v11
2 files changed, 10 insertions, 12 deletions
diff --git a/src/Specific/MontgomeryP256.v b/src/Specific/MontgomeryP256.v
index ad37ed02b..bdbcd6fd7 100644
--- a/src/Specific/MontgomeryP256.v
+++ b/src/Specific/MontgomeryP256.v
@@ -16,7 +16,7 @@ Definition m : positive := 2^256-2^224+2^192+2^96-1.
Definition p256 :=
Eval vm_compute in
((Positional.encode (modulo:=modulo) (div:=div) (n:=sz) wt (Z.pos m))).
-Definition r' := Eval native_compute in Zpow_facts.Zpow_mod (Z.pos r) (Z.pos m - 2) (Z.pos m).
+Definition r' := Eval vm_compute in Zpow_facts.Zpow_mod (Z.pos r) (Z.pos m - 2) (Z.pos m).
Definition r'_correct := eq_refl : ((Z.pos r * r') mod (Z.pos m) = 1)%Z.
Definition m' : Z := Eval vm_compute in Option.invert_Some (Z.modinv_fueled 10 (-Z.pos m) (Z.pos r)).
Definition m'_correct := eq_refl : ((Z.pos m * m') mod (Z.pos r) = (-1) mod Z.pos r)%Z.
@@ -135,17 +135,16 @@ Definition montgomery_to_F (v : Z) : F m
Definition mulmod_256 : { f:Tuple.tuple Z sz -> Tuple.tuple Z sz -> Tuple.tuple Z sz
| forall (A : Tuple.tuple Z sz) (_ : Saturated.small (Z.pos r) A)
(B : Tuple.tuple Z sz) (_ : Saturated.small (Z.pos r) B),
- Saturated.small (Z.pos r) (f A B)
- /\ (let eval := Saturated.eval (Z.pos r) in
- montgomery_to_F (eval (f A B))
- = (montgomery_to_F (eval A) * montgomery_to_F (eval B))%F) }.
+ let eval := Saturated.eval (Z.pos r) in
+ montgomery_to_F (eval (f A B))
+ = (montgomery_to_F (eval A) * montgomery_to_F (eval B))%F }.
Proof.
exists (proj1_sig mulmod_256'').
abstract (
intros A Asm B Bsm;
pose proof (proj2_sig mulmod_256'' A B Asm Bsm) as H;
cbv zeta in *;
- split; try solve [ destruct_head'_and; assumption ];
+ (*split; try solve [ destruct_head'_and; assumption ];*)
rewrite ModularArithmeticTheorems.F.eq_of_Z_iff in H;
unfold montgomery_to_F;
destruct H as [H1 [H2 H3]];
diff --git a/src/Specific/MontgomeryP256_128.v b/src/Specific/MontgomeryP256_128.v
index 71df829e6..503c97572 100644
--- a/src/Specific/MontgomeryP256_128.v
+++ b/src/Specific/MontgomeryP256_128.v
@@ -16,7 +16,7 @@ Definition m : positive := 2^256-2^224+2^192+2^96-1.
Definition p256 :=
Eval vm_compute in
((Positional.encode (modulo:=modulo) (div:=div) (n:=sz) wt (Z.pos m))).
-Definition r' := Eval native_compute in Zpow_facts.Zpow_mod (Z.pos r) (Z.pos m - 2) (Z.pos m).
+Definition r' := Eval vm_compute in Zpow_facts.Zpow_mod (Z.pos r) (Z.pos m - 2) (Z.pos m).
Definition r'_correct := eq_refl : ((Z.pos r * r') mod (Z.pos m) = 1)%Z.
Definition m' : Z := Eval vm_compute in Option.invert_Some (Z.modinv_fueled 10 (-Z.pos m) (Z.pos r)).
Definition m'_correct := eq_refl : ((Z.pos m * m') mod (Z.pos r) = (-1) mod Z.pos r)%Z.
@@ -144,17 +144,16 @@ Definition montgomery_to_F (v : Z) : F m
Definition mulmod_256 : { f:Tuple.tuple Z sz -> Tuple.tuple Z sz -> Tuple.tuple Z sz
| forall (A : Tuple.tuple Z sz) (_ : Saturated.small (Z.pos r) A)
(B : Tuple.tuple Z sz) (_ : Saturated.small (Z.pos r) B),
- Saturated.small (Z.pos r) (f A B)
- /\ (let eval := Saturated.eval (Z.pos r) in
- montgomery_to_F (eval (f A B))
- = (montgomery_to_F (eval A) * montgomery_to_F (eval B))%F) }.
+ let eval := Saturated.eval (Z.pos r) in
+ montgomery_to_F (eval (f A B))
+ = (montgomery_to_F (eval A) * montgomery_to_F (eval B))%F }.
Proof.
exists (proj1_sig mulmod_256'').
abstract (
intros A Asm B Bsm;
pose proof (proj2_sig mulmod_256'' A B Asm Bsm) as H;
cbv zeta in *;
- split; try solve [ destruct_head'_and; assumption ];
+ (*split; try solve [ destruct_head'_and; assumption ];*)
rewrite ModularArithmeticTheorems.F.eq_of_Z_iff in H;
unfold montgomery_to_F;
destruct H as [H1 [H2 H3]];