aboutsummaryrefslogtreecommitdiff
path: root/src/Spec
diff options
context:
space:
mode:
authorGravatar Andres Erbsen <andreser@mit.edu>2016-10-10 14:58:34 -0400
committerGravatar Andres Erbsen <andreser@mit.edu>2016-10-10 14:58:36 -0400
commit7c28d4f8f6566a01dcf1cdbb5610f68a9bf23661 (patch)
tree32055482ddfd4e8ac969e6fa05ae6c96c6db2c44 /src/Spec
parenta75c0c7dd83e2b1b92784b4d5d7a222f6fe9bc52 (diff)
Ed25519: add basepoint and prove most EdDSA preconditions
Diffstat (limited to 'src/Spec')
-rw-r--r--src/Spec/Ed25519.v11
1 files changed, 9 insertions, 2 deletions
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