From 795d24349b9aca1d9732c7b7fcaa505f24fa4bc6 Mon Sep 17 00:00:00 2001 From: jadep Date: Fri, 10 Nov 2017 13:19:57 -0500 Subject: new autogenerated files --- .../CurveParameters.v | 39 ++++++++++++++++++++++ .../montgomery32_2e480m2e240m1_15limbs/Synthesis.v | 9 +++++ .../montgomery32_2e480m2e240m1_15limbs/compiler.sh | 4 +++ .../compilerxx.sh | 4 +++ .../montgomery32_2e480m2e240m1_15limbs/feadd.v | 14 ++++++++ .../feaddDisplay.v | 4 +++ .../montgomery32_2e480m2e240m1_15limbs/femul.v | 14 ++++++++ .../femulDisplay.v | 4 +++ .../montgomery32_2e480m2e240m1_15limbs/fenz.v | 16 +++++++++ .../fenzDisplay.v | 4 +++ .../montgomery32_2e480m2e240m1_15limbs/feopp.v | 14 ++++++++ .../feoppDisplay.v | 4 +++ .../montgomery32_2e480m2e240m1_15limbs/fesub.v | 14 ++++++++ .../fesubDisplay.v | 4 +++ .../py_interpreter.sh | 4 +++ 15 files changed, 152 insertions(+) create mode 100644 src/Specific/montgomery32_2e480m2e240m1_15limbs/CurveParameters.v create mode 100644 src/Specific/montgomery32_2e480m2e240m1_15limbs/Synthesis.v create mode 100755 src/Specific/montgomery32_2e480m2e240m1_15limbs/compiler.sh create mode 100755 src/Specific/montgomery32_2e480m2e240m1_15limbs/compilerxx.sh create mode 100644 src/Specific/montgomery32_2e480m2e240m1_15limbs/feadd.v create mode 100644 src/Specific/montgomery32_2e480m2e240m1_15limbs/feaddDisplay.v create mode 100644 src/Specific/montgomery32_2e480m2e240m1_15limbs/femul.v create mode 100644 src/Specific/montgomery32_2e480m2e240m1_15limbs/femulDisplay.v create mode 100644 src/Specific/montgomery32_2e480m2e240m1_15limbs/fenz.v create mode 100644 src/Specific/montgomery32_2e480m2e240m1_15limbs/fenzDisplay.v create mode 100644 src/Specific/montgomery32_2e480m2e240m1_15limbs/feopp.v create mode 100644 src/Specific/montgomery32_2e480m2e240m1_15limbs/feoppDisplay.v create mode 100644 src/Specific/montgomery32_2e480m2e240m1_15limbs/fesub.v create mode 100644 src/Specific/montgomery32_2e480m2e240m1_15limbs/fesubDisplay.v create mode 100755 src/Specific/montgomery32_2e480m2e240m1_15limbs/py_interpreter.sh (limited to 'src/Specific/montgomery32_2e480m2e240m1_15limbs') diff --git a/src/Specific/montgomery32_2e480m2e240m1_15limbs/CurveParameters.v b/src/Specific/montgomery32_2e480m2e240m1_15limbs/CurveParameters.v new file mode 100644 index 000000000..df2d34dd7 --- /dev/null +++ b/src/Specific/montgomery32_2e480m2e240m1_15limbs/CurveParameters.v @@ -0,0 +1,39 @@ +Require Import Crypto.Specific.Framework.RawCurveParameters. +Require Import Crypto.Util.LetIn. + +(*** +Modulus : 2^480 - 2^240 - 1 +Base: 32 +***) + +Definition curve : CurveParameters := + {| + sz := 15%nat; + base := 32; + bitwidth := 32; + s := 2^480; + c := [(1, 1); (2^240, 1)]; + carry_chains := None; + + a24 := None; + coef_div_modulus := None; + + goldilocks := None; + karatsuba := None; + montgomery := true; + freeze := Some false; + ladderstep := false; + + mul_code := None; + + square_code := None; + + upper_bound_of_exponent_loose := None; + upper_bound_of_exponent_tight := None; + allowable_bit_widths := None; + freeze_extra_allowable_bit_widths := None; + modinv_fuel := None + |}. + +Ltac extra_prove_mul_eq _ := idtac. +Ltac extra_prove_square_eq _ := idtac. diff --git a/src/Specific/montgomery32_2e480m2e240m1_15limbs/Synthesis.v b/src/Specific/montgomery32_2e480m2e240m1_15limbs/Synthesis.v new file mode 100644 index 000000000..6a6551985 --- /dev/null +++ b/src/Specific/montgomery32_2e480m2e240m1_15limbs/Synthesis.v @@ -0,0 +1,9 @@ +Require Import Crypto.Specific.Framework.SynthesisFramework. +Require Import Crypto.Specific.montgomery32_2e480m2e240m1_15limbs.CurveParameters. + +Module P <: PrePackage. + Definition package : Tag.Context. + Proof. make_Synthesis_package curve extra_prove_mul_eq extra_prove_square_eq. Defined. +End P. + +Module Export S := PackageSynthesis P. diff --git a/src/Specific/montgomery32_2e480m2e240m1_15limbs/compiler.sh b/src/Specific/montgomery32_2e480m2e240m1_15limbs/compiler.sh new file mode 100755 index 000000000..4b5a11d2d --- /dev/null +++ b/src/Specific/montgomery32_2e480m2e240m1_15limbs/compiler.sh @@ -0,0 +1,4 @@ +#!/bin/sh +set -eu + +clang -fbracket-depth=999999 -march=native -mtune=native -std=gnu11 -O3 -flto -fuse-ld=lld -fomit-frame-pointer -fwrapv -Wno-attributes -fno-strict-aliasing -Da24_hex='0x3039' -Da24_val='12345' -Da_minus_two_over_four_array='{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x39}' -Dbitwidth='32' -Dlimb_weight_gaps_array='{32,32,32,32,32,32,32,32,32,32,32,32,32,32,32}' -Dmodulus_array='{0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff}' -Dmodulus_bytes_val='60' -Dmodulus_limbs='15' -Dq_mpz='(1_mpz<<480) - (1_mpz<<240) - 1' "$@" diff --git a/src/Specific/montgomery32_2e480m2e240m1_15limbs/compilerxx.sh b/src/Specific/montgomery32_2e480m2e240m1_15limbs/compilerxx.sh new file mode 100755 index 000000000..8b9797f5a --- /dev/null +++ b/src/Specific/montgomery32_2e480m2e240m1_15limbs/compilerxx.sh @@ -0,0 +1,4 @@ +#!/bin/sh +set -eu + +clang++ -fbracket-depth=999999 -march=native -mtune=native -std=gnu++11 -O3 -flto -fuse-ld=lld -fomit-frame-pointer -fwrapv -Wno-attributes -fno-strict-aliasing -Da24_hex='0x3039' -Da24_val='12345' -Da_minus_two_over_four_array='{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x39}' -Dbitwidth='32' -Dlimb_weight_gaps_array='{32,32,32,32,32,32,32,32,32,32,32,32,32,32,32}' -Dmodulus_array='{0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff}' -Dmodulus_bytes_val='60' -Dmodulus_limbs='15' -Dq_mpz='(1_mpz<<480) - (1_mpz<<240) - 1' "$@" diff --git a/src/Specific/montgomery32_2e480m2e240m1_15limbs/feadd.v b/src/Specific/montgomery32_2e480m2e240m1_15limbs/feadd.v new file mode 100644 index 000000000..05b22310a --- /dev/null +++ b/src/Specific/montgomery32_2e480m2e240m1_15limbs/feadd.v @@ -0,0 +1,14 @@ +Require Import Crypto.Arithmetic.PrimeFieldTheorems. +Require Import Crypto.Specific.montgomery32_2e480m2e240m1_15limbs.Synthesis. + +(* TODO : change this to field once field isomorphism happens *) +Definition add : + { add : feBW_small -> feBW_small -> feBW_small + | forall a b, phiM_small (add a b) = F.add (phiM_small a) (phiM_small b) }. +Proof. + Set Ltac Profiling. + Time synthesize_add (). + Show Ltac Profile. +Time Defined. + +Print Assumptions add. diff --git a/src/Specific/montgomery32_2e480m2e240m1_15limbs/feaddDisplay.v b/src/Specific/montgomery32_2e480m2e240m1_15limbs/feaddDisplay.v new file mode 100644 index 000000000..8674277be --- /dev/null +++ b/src/Specific/montgomery32_2e480m2e240m1_15limbs/feaddDisplay.v @@ -0,0 +1,4 @@ +Require Import Crypto.Specific.montgomery32_2e480m2e240m1_15limbs.feadd. +Require Import Crypto.Specific.Framework.IntegrationTestDisplayCommon. + +Check display add. diff --git a/src/Specific/montgomery32_2e480m2e240m1_15limbs/femul.v b/src/Specific/montgomery32_2e480m2e240m1_15limbs/femul.v new file mode 100644 index 000000000..49cc90f7f --- /dev/null +++ b/src/Specific/montgomery32_2e480m2e240m1_15limbs/femul.v @@ -0,0 +1,14 @@ +Require Import Crypto.Arithmetic.PrimeFieldTheorems. +Require Import Crypto.Specific.montgomery32_2e480m2e240m1_15limbs.Synthesis. + +(* TODO : change this to field once field isomorphism happens *) +Definition mul : + { mul : feBW_small -> feBW_small -> feBW_small + | forall a b, phiM_small (mul a b) = F.mul (phiM_small a) (phiM_small b) }. +Proof. + Set Ltac Profiling. + Time synthesize_mul (). + Show Ltac Profile. +Time Defined. + +Print Assumptions mul. diff --git a/src/Specific/montgomery32_2e480m2e240m1_15limbs/femulDisplay.v b/src/Specific/montgomery32_2e480m2e240m1_15limbs/femulDisplay.v new file mode 100644 index 000000000..4651a41f2 --- /dev/null +++ b/src/Specific/montgomery32_2e480m2e240m1_15limbs/femulDisplay.v @@ -0,0 +1,4 @@ +Require Import Crypto.Specific.montgomery32_2e480m2e240m1_15limbs.femul. +Require Import Crypto.Specific.Framework.IntegrationTestDisplayCommon. + +Check display mul. diff --git a/src/Specific/montgomery32_2e480m2e240m1_15limbs/fenz.v b/src/Specific/montgomery32_2e480m2e240m1_15limbs/fenz.v new file mode 100644 index 000000000..17142f7f7 --- /dev/null +++ b/src/Specific/montgomery32_2e480m2e240m1_15limbs/fenz.v @@ -0,0 +1,16 @@ +Require Import Coq.ZArith.ZArith. +Require Import Crypto.Arithmetic.PrimeFieldTheorems. +Require Import Crypto.Specific.montgomery32_2e480m2e240m1_15limbs.Synthesis. +Local Open Scope Z_scope. + +(* TODO : change this to field once field isomorphism happens *) +Definition nonzero : + { nonzero : feBW_small -> BoundedWord.BoundedWord 1 adjusted_bitwidth bound1 + | forall a, (BoundedWord.BoundedWordToZ _ _ _ (nonzero a) =? 0) = (if Decidable.dec (phiM_small a = F.of_Z m 0) then true else false) }. +Proof. + Set Ltac Profiling. + Time synthesize_nonzero (). + Show Ltac Profile. +Time Defined. + +Print Assumptions nonzero. diff --git a/src/Specific/montgomery32_2e480m2e240m1_15limbs/fenzDisplay.v b/src/Specific/montgomery32_2e480m2e240m1_15limbs/fenzDisplay.v new file mode 100644 index 000000000..c7ab1be50 --- /dev/null +++ b/src/Specific/montgomery32_2e480m2e240m1_15limbs/fenzDisplay.v @@ -0,0 +1,4 @@ +Require Import Crypto.Specific.montgomery32_2e480m2e240m1_15limbs.fenz. +Require Import Crypto.Specific.Framework.IntegrationTestDisplayCommon. + +Check display nonzero. diff --git a/src/Specific/montgomery32_2e480m2e240m1_15limbs/feopp.v b/src/Specific/montgomery32_2e480m2e240m1_15limbs/feopp.v new file mode 100644 index 000000000..50799f314 --- /dev/null +++ b/src/Specific/montgomery32_2e480m2e240m1_15limbs/feopp.v @@ -0,0 +1,14 @@ +Require Import Crypto.Arithmetic.PrimeFieldTheorems. +Require Import Crypto.Specific.montgomery32_2e480m2e240m1_15limbs.Synthesis. + +(* TODO : change this to field once field isomorphism happens *) +Definition opp : + { opp : feBW_small -> feBW_small + | forall a, phiM_small (opp a) = F.opp (phiM_small a) }. +Proof. + Set Ltac Profiling. + Time synthesize_opp (). + Show Ltac Profile. +Time Defined. + +Print Assumptions opp. diff --git a/src/Specific/montgomery32_2e480m2e240m1_15limbs/feoppDisplay.v b/src/Specific/montgomery32_2e480m2e240m1_15limbs/feoppDisplay.v new file mode 100644 index 000000000..f87a885cc --- /dev/null +++ b/src/Specific/montgomery32_2e480m2e240m1_15limbs/feoppDisplay.v @@ -0,0 +1,4 @@ +Require Import Crypto.Specific.montgomery32_2e480m2e240m1_15limbs.feopp. +Require Import Crypto.Specific.Framework.IntegrationTestDisplayCommon. + +Check display opp. diff --git a/src/Specific/montgomery32_2e480m2e240m1_15limbs/fesub.v b/src/Specific/montgomery32_2e480m2e240m1_15limbs/fesub.v new file mode 100644 index 000000000..8a7d5d843 --- /dev/null +++ b/src/Specific/montgomery32_2e480m2e240m1_15limbs/fesub.v @@ -0,0 +1,14 @@ +Require Import Crypto.Arithmetic.PrimeFieldTheorems. +Require Import Crypto.Specific.montgomery32_2e480m2e240m1_15limbs.Synthesis. + +(* TODO : change this to field once field isomorphism happens *) +Definition sub : + { sub : feBW_small -> feBW_small -> feBW_small + | forall a b, phiM_small (sub a b) = F.sub (phiM_small a) (phiM_small b) }. +Proof. + Set Ltac Profiling. + Time synthesize_sub (). + Show Ltac Profile. +Time Defined. + +Print Assumptions sub. diff --git a/src/Specific/montgomery32_2e480m2e240m1_15limbs/fesubDisplay.v b/src/Specific/montgomery32_2e480m2e240m1_15limbs/fesubDisplay.v new file mode 100644 index 000000000..9e365c337 --- /dev/null +++ b/src/Specific/montgomery32_2e480m2e240m1_15limbs/fesubDisplay.v @@ -0,0 +1,4 @@ +Require Import Crypto.Specific.montgomery32_2e480m2e240m1_15limbs.fesub. +Require Import Crypto.Specific.Framework.IntegrationTestDisplayCommon. + +Check display sub. diff --git a/src/Specific/montgomery32_2e480m2e240m1_15limbs/py_interpreter.sh b/src/Specific/montgomery32_2e480m2e240m1_15limbs/py_interpreter.sh new file mode 100755 index 000000000..a30165598 --- /dev/null +++ b/src/Specific/montgomery32_2e480m2e240m1_15limbs/py_interpreter.sh @@ -0,0 +1,4 @@ +#!/bin/sh +set -eu + +/usr/bin/env python3 "$@" -Dq='2**480 - 2**240 - 1' -Dmodulus_bytes='32' -Da24='121665' -- cgit v1.2.3