From f4b071306ee1d51500de9b167acb7c701616ab92 Mon Sep 17 00:00:00 2001 From: jadep Date: Mon, 10 Oct 2016 15:30:20 -0400 Subject: Filled in point/scalar encoding definitions. --- src/Spec/Ed25519.v | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/Spec') diff --git a/src/Spec/Ed25519.v b/src/Spec/Ed25519.v index d7bf50481..a8e95cf9d 100644 --- a/src/Spec/Ed25519.v +++ b/src/Spec/Ed25519.v @@ -61,8 +61,12 @@ Section Ed25519. (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) *) + Definition Fencode {b : nat} {m} : F m -> Word.word b := + fun x : F m => (Word.NToWord _ (BinIntDef.Z.to_N (F.to_Z x))). + Definition sign (x : F q) : bool := BinIntDef.Z.testbit (F.to_Z x) 0. + Definition Eenc : E -> Word.word b := fun P => + let '(x,y) := E.coordinates P in Word.WS (sign x) (Fencode y). + Definition Senc : Fl -> Word.word b := Fencode. (* 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. -- cgit v1.2.3