From 475eb51406c5bf9620199a8af2afddf37e7f5eb0 Mon Sep 17 00:00:00 2001 From: Andres Erbsen Date: Tue, 21 Jun 2016 15:46:28 -0400 Subject: use Local Obligation Tactic (8.5-compat) --- src/Spec/CompleteEdwardsCurve.v | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/Spec') 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 -- cgit v1.2.3