diff options
author | jadep <jade.philipoom@gmail.com> | 2017-11-10 13:19:57 -0500 |
---|---|---|
committer | jadep <jade.philipoom@gmail.com> | 2017-11-12 15:01:59 -0500 |
commit | 795d24349b9aca1d9732c7b7fcaa505f24fa4bc6 (patch) | |
tree | f517d6c4e83f42e72a303e06567f779c0250fc2e /src/Specific/solinas64_2e401m31_7limbs | |
parent | 7ad53a35ed68777cd21226998a88494e1d97c63e (diff) |
new autogenerated files
Diffstat (limited to 'src/Specific/solinas64_2e401m31_7limbs')
15 files changed, 150 insertions, 0 deletions
diff --git a/src/Specific/solinas64_2e401m31_7limbs/CurveParameters.v b/src/Specific/solinas64_2e401m31_7limbs/CurveParameters.v new file mode 100644 index 000000000..149e49d4b --- /dev/null +++ b/src/Specific/solinas64_2e401m31_7limbs/CurveParameters.v @@ -0,0 +1,39 @@ +Require Import Crypto.Specific.Framework.RawCurveParameters. +Require Import Crypto.Util.LetIn. + +(*** +Modulus : 2^401 - 31 +Base: 57 + 2/7 +***) + +Definition curve : CurveParameters := + {| + sz := 7%nat; + base := 57 + 2/7; + bitwidth := 64; + s := 2^401; + c := [(1, 31)]; + carry_chains := Some [seq 0 (pred 7); [0; 1]]%nat; + + a24 := None; + coef_div_modulus := Some 2%nat; + + goldilocks := None; + karatsuba := None; + montgomery := false; + freeze := Some true; + 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/solinas64_2e401m31_7limbs/Synthesis.v b/src/Specific/solinas64_2e401m31_7limbs/Synthesis.v new file mode 100644 index 000000000..c09e91014 --- /dev/null +++ b/src/Specific/solinas64_2e401m31_7limbs/Synthesis.v @@ -0,0 +1,9 @@ +Require Import Crypto.Specific.Framework.SynthesisFramework. +Require Import Crypto.Specific.solinas64_2e401m31_7limbs.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/solinas64_2e401m31_7limbs/compiler.sh b/src/Specific/solinas64_2e401m31_7limbs/compiler.sh new file mode 100755 index 000000000..3e673ede7 --- /dev/null +++ b/src/Specific/solinas64_2e401m31_7limbs/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,0x30,0x39}' -Dbitwidth='64' -Dlimb_weight_gaps_array='{58,57,57,58,57,57,57}' -Dmodulus_array='{0x01,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,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe1}' -Dmodulus_bytes_val='51' -Dmodulus_limbs='7' -Dq_mpz='(1_mpz<<401) - 31' "$@" diff --git a/src/Specific/solinas64_2e401m31_7limbs/compilerxx.sh b/src/Specific/solinas64_2e401m31_7limbs/compilerxx.sh new file mode 100755 index 000000000..0d1830d11 --- /dev/null +++ b/src/Specific/solinas64_2e401m31_7limbs/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,0x30,0x39}' -Dbitwidth='64' -Dlimb_weight_gaps_array='{58,57,57,58,57,57,57}' -Dmodulus_array='{0x01,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,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe1}' -Dmodulus_bytes_val='51' -Dmodulus_limbs='7' -Dq_mpz='(1_mpz<<401) - 31' "$@" diff --git a/src/Specific/solinas64_2e401m31_7limbs/feadd.v b/src/Specific/solinas64_2e401m31_7limbs/feadd.v new file mode 100644 index 000000000..5bcf6e157 --- /dev/null +++ b/src/Specific/solinas64_2e401m31_7limbs/feadd.v @@ -0,0 +1,14 @@ +Require Import Crypto.Arithmetic.PrimeFieldTheorems. +Require Import Crypto.Specific.solinas64_2e401m31_7limbs.Synthesis. + +(* TODO : change this to field once field isomorphism happens *) +Definition add : + { add : feBW_tight -> feBW_tight -> feBW_loose + | forall a b, phiBW_loose (add a b) = F.add (phiBW_tight a) (phiBW_tight b) }. +Proof. + Set Ltac Profiling. + Time synthesize_add (). + Show Ltac Profile. +Time Defined. + +Print Assumptions add. diff --git a/src/Specific/solinas64_2e401m31_7limbs/feaddDisplay.v b/src/Specific/solinas64_2e401m31_7limbs/feaddDisplay.v new file mode 100644 index 000000000..2af4fb540 --- /dev/null +++ b/src/Specific/solinas64_2e401m31_7limbs/feaddDisplay.v @@ -0,0 +1,4 @@ +Require Import Crypto.Specific.solinas64_2e401m31_7limbs.feadd. +Require Import Crypto.Specific.Framework.IntegrationTestDisplayCommon. + +Check display add. diff --git a/src/Specific/solinas64_2e401m31_7limbs/femul.v b/src/Specific/solinas64_2e401m31_7limbs/femul.v new file mode 100644 index 000000000..22b329808 --- /dev/null +++ b/src/Specific/solinas64_2e401m31_7limbs/femul.v @@ -0,0 +1,14 @@ +Require Import Crypto.Arithmetic.PrimeFieldTheorems. +Require Import Crypto.Specific.solinas64_2e401m31_7limbs.Synthesis. + +(* TODO : change this to field once field isomorphism happens *) +Definition mul : + { mul : feBW_loose -> feBW_loose -> feBW_tight + | forall a b, phiBW_tight (mul a b) = F.mul (phiBW_loose a) (phiBW_loose b) }. +Proof. + Set Ltac Profiling. + Time synthesize_mul (). + Show Ltac Profile. +Time Defined. + +Print Assumptions mul. diff --git a/src/Specific/solinas64_2e401m31_7limbs/femulDisplay.v b/src/Specific/solinas64_2e401m31_7limbs/femulDisplay.v new file mode 100644 index 000000000..bc7dfb5f8 --- /dev/null +++ b/src/Specific/solinas64_2e401m31_7limbs/femulDisplay.v @@ -0,0 +1,4 @@ +Require Import Crypto.Specific.solinas64_2e401m31_7limbs.femul. +Require Import Crypto.Specific.Framework.IntegrationTestDisplayCommon. + +Check display mul. diff --git a/src/Specific/solinas64_2e401m31_7limbs/fesquare.v b/src/Specific/solinas64_2e401m31_7limbs/fesquare.v new file mode 100644 index 000000000..4a1687d32 --- /dev/null +++ b/src/Specific/solinas64_2e401m31_7limbs/fesquare.v @@ -0,0 +1,14 @@ +Require Import Crypto.Arithmetic.PrimeFieldTheorems. +Require Import Crypto.Specific.solinas64_2e401m31_7limbs.Synthesis. + +(* TODO : change this to field once field isomorphism happens *) +Definition square : + { square : feBW_loose -> feBW_tight + | forall a, phiBW_tight (square a) = F.mul (phiBW_loose a) (phiBW_loose a) }. +Proof. + Set Ltac Profiling. + Time synthesize_square (). + Show Ltac Profile. +Time Defined. + +Print Assumptions square. diff --git a/src/Specific/solinas64_2e401m31_7limbs/fesquareDisplay.v b/src/Specific/solinas64_2e401m31_7limbs/fesquareDisplay.v new file mode 100644 index 000000000..7e0ce4d0b --- /dev/null +++ b/src/Specific/solinas64_2e401m31_7limbs/fesquareDisplay.v @@ -0,0 +1,4 @@ +Require Import Crypto.Specific.solinas64_2e401m31_7limbs.fesquare. +Require Import Crypto.Specific.Framework.IntegrationTestDisplayCommon. + +Check display square. diff --git a/src/Specific/solinas64_2e401m31_7limbs/fesub.v b/src/Specific/solinas64_2e401m31_7limbs/fesub.v new file mode 100644 index 000000000..47bac02b7 --- /dev/null +++ b/src/Specific/solinas64_2e401m31_7limbs/fesub.v @@ -0,0 +1,14 @@ +Require Import Crypto.Arithmetic.PrimeFieldTheorems. +Require Import Crypto.Specific.solinas64_2e401m31_7limbs.Synthesis. + +(* TODO : change this to field once field isomorphism happens *) +Definition sub : + { sub : feBW_tight -> feBW_tight -> feBW_loose + | forall a b, phiBW_loose (sub a b) = F.sub (phiBW_tight a) (phiBW_tight b) }. +Proof. + Set Ltac Profiling. + Time synthesize_sub (). + Show Ltac Profile. +Time Defined. + +Print Assumptions sub. diff --git a/src/Specific/solinas64_2e401m31_7limbs/fesubDisplay.v b/src/Specific/solinas64_2e401m31_7limbs/fesubDisplay.v new file mode 100644 index 000000000..56bb75537 --- /dev/null +++ b/src/Specific/solinas64_2e401m31_7limbs/fesubDisplay.v @@ -0,0 +1,4 @@ +Require Import Crypto.Specific.solinas64_2e401m31_7limbs.fesub. +Require Import Crypto.Specific.Framework.IntegrationTestDisplayCommon. + +Check display sub. diff --git a/src/Specific/solinas64_2e401m31_7limbs/freeze.v b/src/Specific/solinas64_2e401m31_7limbs/freeze.v new file mode 100644 index 000000000..579d50c72 --- /dev/null +++ b/src/Specific/solinas64_2e401m31_7limbs/freeze.v @@ -0,0 +1,14 @@ +Require Import Crypto.Arithmetic.PrimeFieldTheorems. +Require Import Crypto.Specific.solinas64_2e401m31_7limbs.Synthesis. + +(* TODO : change this to field once field isomorphism happens *) +Definition freeze : + { freeze : feBW_tight -> feBW_limbwidths + | forall a, phiBW_limbwidths (freeze a) = phiBW_tight a }. +Proof. + Set Ltac Profiling. + Time synthesize_freeze (). + Show Ltac Profile. +Time Defined. + +Print Assumptions freeze. diff --git a/src/Specific/solinas64_2e401m31_7limbs/freezeDisplay.v b/src/Specific/solinas64_2e401m31_7limbs/freezeDisplay.v new file mode 100644 index 000000000..a1135ded2 --- /dev/null +++ b/src/Specific/solinas64_2e401m31_7limbs/freezeDisplay.v @@ -0,0 +1,4 @@ +Require Import Crypto.Specific.solinas64_2e401m31_7limbs.freeze. +Require Import Crypto.Specific.Framework.IntegrationTestDisplayCommon. + +Check display freeze. diff --git a/src/Specific/solinas64_2e401m31_7limbs/py_interpreter.sh b/src/Specific/solinas64_2e401m31_7limbs/py_interpreter.sh new file mode 100755 index 000000000..c7b8cb3cc --- /dev/null +++ b/src/Specific/solinas64_2e401m31_7limbs/py_interpreter.sh @@ -0,0 +1,4 @@ +#!/bin/sh +set -eu + +/usr/bin/env python3 "$@" -Dq='2**401 - 31' -Dmodulus_bytes='57 + 2/7' -Da24='121665' |