aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Andres Erbsen <andreser@mit.edu>2016-06-21 15:46:28 -0400
committerGravatar Andres Erbsen <andreser@mit.edu>2016-06-21 15:46:28 -0400
commit475eb51406c5bf9620199a8af2afddf37e7f5eb0 (patch)
treea7c13bc42d4226f05dd1420b0679dc8382dacd08 /src
parent0ae5f6871b29d20f48b5df6dab663b5a44162d01 (diff)
use Local Obligation Tactic (8.5-compat)
Diffstat (limited to 'src')
-rw-r--r--src/CompleteEdwardsCurve/CompleteEdwardsCurveTheorems.v2
-rw-r--r--src/Spec/CompleteEdwardsCurve.v10
2 files changed, 6 insertions, 6 deletions
diff --git a/src/CompleteEdwardsCurve/CompleteEdwardsCurveTheorems.v b/src/CompleteEdwardsCurve/CompleteEdwardsCurveTheorems.v
index 99029a671..b843cd54c 100644
--- a/src/CompleteEdwardsCurve/CompleteEdwardsCurveTheorems.v
+++ b/src/CompleteEdwardsCurve/CompleteEdwardsCurveTheorems.v
@@ -105,9 +105,9 @@ Module E.
Local Hint Resolve @edwardsAddCompletePlus.
Local Hint Resolve @edwardsAddCompleteMinus.
+ Local Obligation Tactic := intros; destruct_points; simpl; field_algebra.
Program Definition opp (P:point) : point :=
exist _ (let '(x, y) := coordinates P in (Fopp x, y) ) _.
- Solve All Obligations using intros; destruct_points; simpl; field_algebra.
Ltac bash :=
repeat match goal with
diff --git a/src/Spec/CompleteEdwardsCurve.v b/src/Spec/CompleteEdwardsCurve.v
index 88388ee0a..06c3f8fdb 100644
--- a/src/Spec/CompleteEdwardsCurve.v
+++ b/src/Spec/CompleteEdwardsCurve.v
@@ -28,6 +28,11 @@ Module E.
Definition point := { P | let '(x,y) := P in a*x^2 + y^2 = 1 + d*x^2*y^2 }.
Definition coordinates (P:point) : (F*F) := proj1_sig P.
+ (** The following points are indeed on the curve -- see [CompleteEdwardsCurve.Pre] for proof *)
+ Local Obligation Tactic := intros; apply Pre.zeroOnCurve
+ || apply (Pre.unifiedAdd'_onCurve (char_gt_2:=char_gt_2) (d_nonsquare:=nonsquare_d)
+ (a_nonzero:=nonzero_a) (a_square:=square_a) _ _ (proj2_sig _) (proj2_sig _)).
+
Program Definition zero : point := (0, 1).
Program Definition add (P1 P2:point) : point := exist _ (
@@ -35,11 +40,6 @@ Module E.
let (x2, y2) := coordinates P2 in
(((x1*y2 + y1*x2)/(1 + d*x1*x2*y1*y2)) , ((y1*y2 - a*x1*x2)/(1 - d*x1*x2*y1*y2)))) _.
- (** The described points are indeed on the curve -- see [CompleteEdwardsCurve.Pre] for proof *)
- Solve All Obligations using intros; exact Pre.zeroOnCurve
- || exact (Pre.unifiedAdd'_onCurve (char_gt_2:=char_gt_2) (d_nonsquare:=nonsquare_d)
- (a_nonzero:=nonzero_a) (a_square:=square_a) _ _ (proj2_sig _) (proj2_sig _)).
-
Fixpoint mul (n:nat) (P : point) : point :=
match n with
| O => zero