From 7c28d4f8f6566a01dcf1cdbb5610f68a9bf23661 Mon Sep 17 00:00:00 2001 From: Andres Erbsen Date: Mon, 10 Oct 2016 14:58:34 -0400 Subject: Ed25519: add basepoint and prove most EdDSA preconditions --- src/Spec/Ed25519.v | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/Spec') diff --git a/src/Spec/Ed25519.v b/src/Spec/Ed25519.v index 51b1b0831..d7bf50481 100644 --- a/src/Spec/Ed25519.v +++ b/src/Spec/Ed25519.v @@ -55,11 +55,18 @@ Section Ed25519. (F:=Fq) (Feq:=Logic.eq) (Fone:=F.one) (Fadd:=F.add) (Fmul:=F.mul) (a:=a) (d:=d). - Axiom B : E. (* TODO(andreser) *) + Local Obligation Tactic := Decidable.vm_decide. (* to prove that B is on curve *) + + Program Definition B : E := + (F.of_Z q 15112221349535400772501151409588531511454012693041857206046113283949847762202, + F.of_Z q 4 / F.of_Z q 5). Axiom Eenc : E -> Word.word b. (* TODO(jadep) *) Axiom Senc : Fl -> Word.word b. (* TODO(jadep) *) + (* TODO(andreser): prove this after we have fast scalar multplication *) + Axiom B_order_l : CompleteEdwardsCurveTheorems.E.eq (BinInt.Z.to_nat l * B)%E E.zero. + Require Import Crypto.Util.Decidable. Definition ed25519 : EdDSA (E:=E) (Eadd:=E.add) (Ezero:=E.zero) (EscalarMult:=E.mul) (B:=B) @@ -67,5 +74,5 @@ Section Ed25519. (Eeq:=Crypto.CompleteEdwardsCurve.CompleteEdwardsCurveTheorems.E.eq) (* TODO: move defn *) (l:=l) (b:=b) (n:=n) (c:=c) (Eenc:=Eenc) (Senc:=Senc) (H:=H). - Admitted. + Proof. split; try exact _; try exact B_order_l; vm_decide. Qed. End Ed25519. \ No newline at end of file -- cgit v1.2.3