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/solinas32_2e369m25_16limbs | |
parent | 7ad53a35ed68777cd21226998a88494e1d97c63e (diff) |
new autogenerated files
Diffstat (limited to 'src/Specific/solinas32_2e369m25_16limbs')
15 files changed, 150 insertions, 0 deletions
diff --git a/src/Specific/solinas32_2e369m25_16limbs/CurveParameters.v b/src/Specific/solinas32_2e369m25_16limbs/CurveParameters.v new file mode 100644 index 000000000..bcbf236a9 --- /dev/null +++ b/src/Specific/solinas32_2e369m25_16limbs/CurveParameters.v @@ -0,0 +1,39 @@ +Require Import Crypto.Specific.Framework.RawCurveParameters. +Require Import Crypto.Util.LetIn. + +(*** +Modulus : 2^369 - 25 +Base: 23 + 1/16 +***) + +Definition curve : CurveParameters := + {| + sz := 16%nat; + base := 23 + 1/16; + bitwidth := 32; + s := 2^369; + c := [(1, 25)]; + carry_chains := Some [seq 0 (pred 16); [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/solinas32_2e369m25_16limbs/Synthesis.v b/src/Specific/solinas32_2e369m25_16limbs/Synthesis.v new file mode 100644 index 000000000..09ecef29b --- /dev/null +++ b/src/Specific/solinas32_2e369m25_16limbs/Synthesis.v @@ -0,0 +1,9 @@ +Require Import Crypto.Specific.Framework.SynthesisFramework. +Require Import Crypto.Specific.solinas32_2e369m25_16limbs.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/solinas32_2e369m25_16limbs/compiler.sh b/src/Specific/solinas32_2e369m25_16limbs/compiler.sh new file mode 100755 index 000000000..7f753bcab --- /dev/null +++ b/src/Specific/solinas32_2e369m25_16limbs/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,0x30,0x39}' -Dbitwidth='32' -Dlimb_weight_gaps_array='{24,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23}' -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,0xe7}' -Dmodulus_bytes_val='47' -Dmodulus_limbs='16' -Dq_mpz='(1_mpz<<369) - 25' "$@" diff --git a/src/Specific/solinas32_2e369m25_16limbs/compilerxx.sh b/src/Specific/solinas32_2e369m25_16limbs/compilerxx.sh new file mode 100755 index 000000000..95561b993 --- /dev/null +++ b/src/Specific/solinas32_2e369m25_16limbs/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,0x30,0x39}' -Dbitwidth='32' -Dlimb_weight_gaps_array='{24,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23}' -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,0xe7}' -Dmodulus_bytes_val='47' -Dmodulus_limbs='16' -Dq_mpz='(1_mpz<<369) - 25' "$@" diff --git a/src/Specific/solinas32_2e369m25_16limbs/feadd.v b/src/Specific/solinas32_2e369m25_16limbs/feadd.v new file mode 100644 index 000000000..74a390c1f --- /dev/null +++ b/src/Specific/solinas32_2e369m25_16limbs/feadd.v @@ -0,0 +1,14 @@ +Require Import Crypto.Arithmetic.PrimeFieldTheorems. +Require Import Crypto.Specific.solinas32_2e369m25_16limbs.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/solinas32_2e369m25_16limbs/feaddDisplay.v b/src/Specific/solinas32_2e369m25_16limbs/feaddDisplay.v new file mode 100644 index 000000000..a595eeb87 --- /dev/null +++ b/src/Specific/solinas32_2e369m25_16limbs/feaddDisplay.v @@ -0,0 +1,4 @@ +Require Import Crypto.Specific.solinas32_2e369m25_16limbs.feadd. +Require Import Crypto.Specific.Framework.IntegrationTestDisplayCommon. + +Check display add. diff --git a/src/Specific/solinas32_2e369m25_16limbs/femul.v b/src/Specific/solinas32_2e369m25_16limbs/femul.v new file mode 100644 index 000000000..da0b77870 --- /dev/null +++ b/src/Specific/solinas32_2e369m25_16limbs/femul.v @@ -0,0 +1,14 @@ +Require Import Crypto.Arithmetic.PrimeFieldTheorems. +Require Import Crypto.Specific.solinas32_2e369m25_16limbs.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/solinas32_2e369m25_16limbs/femulDisplay.v b/src/Specific/solinas32_2e369m25_16limbs/femulDisplay.v new file mode 100644 index 000000000..119fc316f --- /dev/null +++ b/src/Specific/solinas32_2e369m25_16limbs/femulDisplay.v @@ -0,0 +1,4 @@ +Require Import Crypto.Specific.solinas32_2e369m25_16limbs.femul. +Require Import Crypto.Specific.Framework.IntegrationTestDisplayCommon. + +Check display mul. diff --git a/src/Specific/solinas32_2e369m25_16limbs/fesquare.v b/src/Specific/solinas32_2e369m25_16limbs/fesquare.v new file mode 100644 index 000000000..c274f3c21 --- /dev/null +++ b/src/Specific/solinas32_2e369m25_16limbs/fesquare.v @@ -0,0 +1,14 @@ +Require Import Crypto.Arithmetic.PrimeFieldTheorems. +Require Import Crypto.Specific.solinas32_2e369m25_16limbs.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/solinas32_2e369m25_16limbs/fesquareDisplay.v b/src/Specific/solinas32_2e369m25_16limbs/fesquareDisplay.v new file mode 100644 index 000000000..f911c937b --- /dev/null +++ b/src/Specific/solinas32_2e369m25_16limbs/fesquareDisplay.v @@ -0,0 +1,4 @@ +Require Import Crypto.Specific.solinas32_2e369m25_16limbs.fesquare. +Require Import Crypto.Specific.Framework.IntegrationTestDisplayCommon. + +Check display square. diff --git a/src/Specific/solinas32_2e369m25_16limbs/fesub.v b/src/Specific/solinas32_2e369m25_16limbs/fesub.v new file mode 100644 index 000000000..1dc7d9d19 --- /dev/null +++ b/src/Specific/solinas32_2e369m25_16limbs/fesub.v @@ -0,0 +1,14 @@ +Require Import Crypto.Arithmetic.PrimeFieldTheorems. +Require Import Crypto.Specific.solinas32_2e369m25_16limbs.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/solinas32_2e369m25_16limbs/fesubDisplay.v b/src/Specific/solinas32_2e369m25_16limbs/fesubDisplay.v new file mode 100644 index 000000000..4c5bc0749 --- /dev/null +++ b/src/Specific/solinas32_2e369m25_16limbs/fesubDisplay.v @@ -0,0 +1,4 @@ +Require Import Crypto.Specific.solinas32_2e369m25_16limbs.fesub. +Require Import Crypto.Specific.Framework.IntegrationTestDisplayCommon. + +Check display sub. diff --git a/src/Specific/solinas32_2e369m25_16limbs/freeze.v b/src/Specific/solinas32_2e369m25_16limbs/freeze.v new file mode 100644 index 000000000..a572cf74d --- /dev/null +++ b/src/Specific/solinas32_2e369m25_16limbs/freeze.v @@ -0,0 +1,14 @@ +Require Import Crypto.Arithmetic.PrimeFieldTheorems. +Require Import Crypto.Specific.solinas32_2e369m25_16limbs.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/solinas32_2e369m25_16limbs/freezeDisplay.v b/src/Specific/solinas32_2e369m25_16limbs/freezeDisplay.v new file mode 100644 index 000000000..2e860427f --- /dev/null +++ b/src/Specific/solinas32_2e369m25_16limbs/freezeDisplay.v @@ -0,0 +1,4 @@ +Require Import Crypto.Specific.solinas32_2e369m25_16limbs.freeze. +Require Import Crypto.Specific.Framework.IntegrationTestDisplayCommon. + +Check display freeze. diff --git a/src/Specific/solinas32_2e369m25_16limbs/py_interpreter.sh b/src/Specific/solinas32_2e369m25_16limbs/py_interpreter.sh new file mode 100755 index 000000000..df5837055 --- /dev/null +++ b/src/Specific/solinas32_2e369m25_16limbs/py_interpreter.sh @@ -0,0 +1,4 @@ +#!/bin/sh +set -eu + +/usr/bin/env python3 "$@" -Dq='2**369 - 25' -Dmodulus_bytes='23 + 1/16' -Da24='121665' |