diff options
author | jadep <jade.philipoom@gmail.com> | 2016-07-15 15:12:51 -0400 |
---|---|---|
committer | jadep <jade.philipoom@gmail.com> | 2016-07-15 15:12:51 -0400 |
commit | d0168dec22e1359e9ae7c0eb6399782f7d03fe9e (patch) | |
tree | a768a99f34a0da7befa4b6e0e54b256039e25824 | |
parent | c2df47be85f640255dfdee86144932084dad059b (diff) | |
parent | 671dc4c7881517bee661a33cbbbe44dee7273e1a (diff) |
Merge branch 'master' of github.com:mit-plv/fiat-crypto
-rw-r--r-- | _CoqProject | 2 | ||||
-rw-r--r-- | src/Experiments/SpecificCurve25519.v | 13 | ||||
-rw-r--r-- | src/Util/Tuple.v | 18 |
3 files changed, 33 insertions, 0 deletions
diff --git a/_CoqProject b/_CoqProject index 2ff168ac8..da6abf12b 100644 --- a/_CoqProject +++ b/_CoqProject @@ -33,6 +33,7 @@ src/Experiments/DerivationsOptionRectLetInEncoding.v src/Experiments/EdDSARefinement.v src/Experiments/GenericFieldPow.v src/Experiments/SpecEd25519.v +src/Experiments/SpecificCurve25519.v src/ModularArithmetic/ExtendedBaseVector.v src/ModularArithmetic/ModularArithmeticTheorems.v src/ModularArithmetic/ModularBaseSystem.v @@ -57,6 +58,7 @@ src/Specific/GF1305.v src/Specific/GF25519.v src/Tactics/VerdiTactics.v src/Tactics/Algebra_syntax/Nsatz.v +src/Util/AdditionChainExponentiation.v src/Util/CaseUtil.v src/Util/Decidable.v src/Util/IterAssocOp.v diff --git a/src/Experiments/SpecificCurve25519.v b/src/Experiments/SpecificCurve25519.v new file mode 100644 index 000000000..e1b86d229 --- /dev/null +++ b/src/Experiments/SpecificCurve25519.v @@ -0,0 +1,13 @@ +Require Import Crypto.Util.Notations Coq.ZArith.BinInt. +Require Import Crypto.Specific.GF25519. +Require Import Crypto.CompleteEdwardsCurve.ExtendedCoordinates. +Local Infix "<<" := Z.shiftr. +Local Infix "&" := Z.land. + +Section Curve25519. + Context {twice_d : fe25519}. + + Definition ge25519_add := + Eval cbv beta delta [Extended.add_coordinates fe25519 add mul sub ModularBaseSystemOpt.Let_In] in + @Extended.add_coordinates fe25519 add sub mul twice_d. +End Curve25519.
\ No newline at end of file diff --git a/src/Util/Tuple.v b/src/Util/Tuple.v index 13f8bd386..05d47b7f8 100644 --- a/src/Util/Tuple.v +++ b/src/Util/Tuple.v @@ -177,3 +177,21 @@ Proof. induction xs; destruct n; intros; try solve [simpl in *; congruence]. apply from_list_default'_eq. Qed. + +Fixpoint function R T n : Type := + match n with + | O => R + | S n' => T -> function R T n' + end. + +Fixpoint apply' {R T} (n:nat) : (T -> function R T n) -> tuple' T n -> R := + match n with + | 0 => id + | S n' => fun f x => apply' n' (f (snd x)) (fst x) + end. + +Definition apply {R T} (n:nat) : function R T n -> tuple T n -> R := + match n with + | O => fun r _ => r + | S n' => fun f x => apply' n' f x + end.
\ No newline at end of file |