aboutsummaryrefslogtreecommitdiff
path: root/src/Arithmetic/MontgomeryReduction
Commit message (Collapse)AuthorAge
* Fix a typo that ends up not matteringGravatar Jason Gross2017-07-06
|
* fix [small_div] argumentsGravatar Andres Erbsen2017-07-02
|
* Prove saturated carrying-addition-chain correctGravatar jadep2017-06-30
|
* Reorganization of saturated arithmeticGravatar jadep2017-06-29
|
* Adapt to new arguments of saturated thingsGravatar Jason Gross2017-06-29
|
* proved eval_mod and eval_div (last remaining eval_ admits in Saturated)Gravatar jadep2017-06-27
|
* Fix a broken proofGravatar Jason Gross2017-06-26
|
* Add nonzero synthesisGravatar Jason Gross2017-06-26
|
* indentationGravatar Jason Gross2017-06-25
|
* Fixes #219Gravatar jadep2017-06-25
|
* Clean up some montgomery wbw instantiation, make displayGravatar Jason Gross2017-06-24
|
* Fill in axioms for sub_then_maybe_add; this required fiddling with updated ↵Gravatar jadep2017-06-24
| | | | arguments since more context variables were used in the definitions than in the placeholder axioms
* Add (partially admitted) integration tests for add, sub, oppGravatar Jason Gross2017-06-22
|
* P256: Partial work on add, sub, oppGravatar Jason Gross2017-06-22
| | | | Partial work towards #218
* Account for future changes of #219Gravatar Jason Gross2017-06-22
| | | | | Note that this makes the axiom we added false. It has a very long and descriptive name to account for this fact.
* Prove In_to_list_left_tl, In_left_hd, to_list_left_appendGravatar Jason Gross2017-06-21
|
* Prove some admitted lemmas about uweightGravatar Jason Gross2017-06-21
| | | | Not sure if locally adding hypotheses is the best way to do it.
* Make use of new conditional_subtractGravatar Jason Gross2017-06-20
|
* Make use of new small_addGravatar Jason Gross2017-06-20
|
* Fix build errorGravatar Jason Gross2017-06-19
|
* mulmod: sig type in terms of equivalence modulo pGravatar Jason Gross2017-06-18
|
* Make use of new small_scmulGravatar Jason Gross2017-06-18
|
* Update wbw to work with new apiGravatar Jason Gross2017-06-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | @jadephilipoom the remaining context to prove is in src/Arithmetic/MontgomeryReduction/WordByWord/Definition.v and src/Arithmetic/MontgomeryReduction/WordByWord/Proofs.v: ```coq Local Notation conditional_subtract_cps := (@drop_high_cps R_numlimbs). (*Axiom conditional_subtract_cps : T (S R_numlimbs) -> forall {cpsT}, (T R_numlimbs -> cpsT) -> cpsT *)(* computes [arg - N] if [R <= arg], and drops high bit *) Axiom conditional_subtract : T (S R_numlimbs) -> T R_numlimbs (* computes [arg - N] if [R <= arg], and drops high bit *). Local Lemma small_add : forall n a b, small a -> small b -> small (@add n a b). Proof. intros; apply Saturated.small_add; auto; try lia. cbv [uweight]. rewrite ?Znat.Nat2Z.inj_succ, ?Z.pow_succ_r by lia. try nia. Admitted. Local Lemma small_add' : forall n a b, small a -> small b -> small (@add' n a b). Proof. intros; apply Saturated.small_add; auto; try lia. cbv [uweight]. rewrite !Znat.Nat2Z.inj_succ, !Z.pow_succ_r by lia. try nia. Admitted. Axiom conditional_subtract_cps_id : forall v cpsT f, @conditional_subtract_cps v cpsT f = f (@conditional_subtract _ v). Axiom small_scmul : forall (n : nat) (a : Z) (v : T n), small v -> 0 <= a < Z.pos r -> 0 <= eval v < R -> small (scmul a v). Axiom eval_conditional_subtract : forall v : T (S R_numlimbs), small v -> 0 <= eval v < eval N + Z.pos R -> eval (conditional_subtract v) = eval v + (if Z.pos R <=? eval v then - eval N else 0). Axiom small_conditional_subtract : forall v : T (S R_numlimbs), small v -> 0 <= eval v < eval N + Z.pos R -> small (conditional_subtract v). ```
* Drop the 0-carry bit before bounds analysisGravatar Jason Gross2017-06-17
|
* Make use of non-uniform tuple-based addGravatar Jason Gross2017-06-17
| | | | Maybe it'll result in better output code with fewer zeros?
* fix WWMM partial evaluationGravatar Andres Erbsen2017-06-16
|
* Switch to using tuples for word-by-word montgomeryGravatar Jason Gross2017-06-16
| | | | | | | The new parameterized definitions and proofs are in WordByWord/Abstract/Dependent/*; the old ones are untouched (and unused) in WordByWord/Abstract/*. I replaced definitions I didn't know how to write in the Saturated API with the use of an axiom.
* CPSify montgomery wbw reductionGravatar Jason Gross2017-06-15
| | | | | | I didn't want to bother redoing all of the proofs that I'd already done, so instead I prove the cps'ified version equal to the non-cps version, and transfer over the proofs that way.
* Update WBW montgomery commentsGravatar Jason Gross2017-06-13
| | | | As per https://github.com/mit-plv/fiat-crypto/commit/b4b711cba32a21806c6c0aae53be40c04af60cb3#commitcomment-22521097
* Fill in mul_split to wbw montgomeryGravatar Jason Gross2017-06-13
|
* WBW-montgomery: Fill in most context variablesGravatar Jason Gross2017-06-13
|
* Drop unused [bn] notationGravatar Jason Gross2017-06-12
|
* Drop some small hyps in light of small_add changeGravatar Jason Gross2017-06-12
| | | | | As per https://github.com/mit-plv/fiat-crypto/issues/157#issuecomment-307776611
* Remove eval_small_bounded_numlimbsGravatar Jason Gross2017-06-12
| | | | | As per https://github.com/mit-plv/fiat-crypto/issues/157#issuecomment-307772410
* Finish admits in WordByWord/Proofs.vGravatar Jason Gross2017-06-10
| | | | | Some of the proofs are a bit monsterous. It'd be nice to go back and automate them more sometime.
* Minor changes to a proof in progressGravatar Jason Gross2017-06-10
|
* Remove useless small_from_bound; drop R_bigGravatar Jason Gross2017-06-10
|
* Add proofs about numlimbsGravatar Jason Gross2017-06-10
|
* Add constraint on scmul scalarGravatar Jason Gross2017-06-10
|
* Update context to not need eval_nonnegGravatar Jason Gross2017-06-10
| | | | | Also add [small], as per https://github.com/mit-plv/fiat-crypto/issues/157#issuecomment-307568416
* Add redc_boundGravatar Jason Gross2017-06-10
|
* Remove temporary fileGravatar Jason Gross2017-06-10
| | | | It's been migrated to Definitions.v and Proofs.v in the same directory
* More work in progress on montgomery proofsGravatar Jason Gross2017-06-10
|
* More work on redc correctness proofsGravatar Jason Gross2017-06-10
|
* Add initial proofs for word-by-wordGravatar Jason Gross2017-06-10
|
* Switch from t to T to match #157Gravatar Jason Gross2017-06-10
|
* Update redc algorithmGravatar Jason Gross2017-06-10
| | | | | | | Transcribe https://github.com/mit-plv/fiat-crypto/issues/157#issuecomment-301334813 Not sure if it's right, but now I'll try proofs.
* Update word-by-word montgomery with ctx varsGravatar Jason Gross2017-06-10
| | | | | As per https://github.com/mit-plv/fiat-crypto/issues/157#issuecomment-307212425
* Finish proving loop invariant for wbw redcGravatar Jason Gross2017-06-09
|
* Make it clear that the combined definition/proof file is a work in progressGravatar Jason Gross2017-06-09
|