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_2e384m2e128m2e96p2e32m1_19limbs | |
parent | 7ad53a35ed68777cd21226998a88494e1d97c63e (diff) |
new autogenerated files
Diffstat (limited to 'src/Specific/solinas32_2e384m2e128m2e96p2e32m1_19limbs')
15 files changed, 150 insertions, 0 deletions
diff --git a/src/Specific/solinas32_2e384m2e128m2e96p2e32m1_19limbs/CurveParameters.v b/src/Specific/solinas32_2e384m2e128m2e96p2e32m1_19limbs/CurveParameters.v new file mode 100644 index 000000000..a276b0327 --- /dev/null +++ b/src/Specific/solinas32_2e384m2e128m2e96p2e32m1_19limbs/CurveParameters.v @@ -0,0 +1,39 @@ +Require Import Crypto.Specific.Framework.RawCurveParameters. +Require Import Crypto.Util.LetIn. + +(*** +Modulus : 2^384 - 2^128 - 2^96 + 2^32 - 1 +Base: 20 + 4/19 +***) + +Definition curve : CurveParameters := + {| + sz := 19%nat; + base := 20 + 4/19; + bitwidth := 32; + s := 2^384; + c := [(1, 1); (2^32, -1); (2^96, 1); (2^128, 1)]; + carry_chains := Some [[5; 3; 0; 18]; [6; 4; 1; 0; 7; 5; 2; 8; 3; 9; 10; 11; 12; 13; 14; 15; 16; 17; 18]; [6; 4; 1; 0]]%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_2e384m2e128m2e96p2e32m1_19limbs/Synthesis.v b/src/Specific/solinas32_2e384m2e128m2e96p2e32m1_19limbs/Synthesis.v new file mode 100644 index 000000000..363ee5d11 --- /dev/null +++ b/src/Specific/solinas32_2e384m2e128m2e96p2e32m1_19limbs/Synthesis.v @@ -0,0 +1,9 @@ +Require Import Crypto.Specific.Framework.SynthesisFramework. +Require Import Crypto.Specific.solinas32_2e384m2e128m2e96p2e32m1_19limbs.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_2e384m2e128m2e96p2e32m1_19limbs/compiler.sh b/src/Specific/solinas32_2e384m2e128m2e96p2e32m1_19limbs/compiler.sh new file mode 100755 index 000000000..b3b6a51c2 --- /dev/null +++ b/src/Specific/solinas32_2e384m2e128m2e96p2e32m1_19limbs/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,0x30,0x39}' -Dbitwidth='32' -Dlimb_weight_gaps_array='{21,20,20,20,21,20,20,20,20,21,20,20,20,20,21,20,20,20,20}' -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,0xff,0xff,0xfe,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff}' -Dmodulus_bytes_val='48' -Dmodulus_limbs='19' -Dq_mpz='(1_mpz<<384) - (1_mpz<<128) - (1_mpz<<96) + (1_mpz<<32) - 1' "$@" diff --git a/src/Specific/solinas32_2e384m2e128m2e96p2e32m1_19limbs/compilerxx.sh b/src/Specific/solinas32_2e384m2e128m2e96p2e32m1_19limbs/compilerxx.sh new file mode 100755 index 000000000..5b5930cce --- /dev/null +++ b/src/Specific/solinas32_2e384m2e128m2e96p2e32m1_19limbs/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,0x30,0x39}' -Dbitwidth='32' -Dlimb_weight_gaps_array='{21,20,20,20,21,20,20,20,20,21,20,20,20,20,21,20,20,20,20}' -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,0xff,0xff,0xfe,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff}' -Dmodulus_bytes_val='48' -Dmodulus_limbs='19' -Dq_mpz='(1_mpz<<384) - (1_mpz<<128) - (1_mpz<<96) + (1_mpz<<32) - 1' "$@" diff --git a/src/Specific/solinas32_2e384m2e128m2e96p2e32m1_19limbs/feadd.v b/src/Specific/solinas32_2e384m2e128m2e96p2e32m1_19limbs/feadd.v new file mode 100644 index 000000000..1236f2714 --- /dev/null +++ b/src/Specific/solinas32_2e384m2e128m2e96p2e32m1_19limbs/feadd.v @@ -0,0 +1,14 @@ +Require Import Crypto.Arithmetic.PrimeFieldTheorems. +Require Import Crypto.Specific.solinas32_2e384m2e128m2e96p2e32m1_19limbs.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_2e384m2e128m2e96p2e32m1_19limbs/feaddDisplay.v b/src/Specific/solinas32_2e384m2e128m2e96p2e32m1_19limbs/feaddDisplay.v new file mode 100644 index 000000000..f67a02b84 --- /dev/null +++ b/src/Specific/solinas32_2e384m2e128m2e96p2e32m1_19limbs/feaddDisplay.v @@ -0,0 +1,4 @@ +Require Import Crypto.Specific.solinas32_2e384m2e128m2e96p2e32m1_19limbs.feadd. +Require Import Crypto.Specific.Framework.IntegrationTestDisplayCommon. + +Check display add. diff --git a/src/Specific/solinas32_2e384m2e128m2e96p2e32m1_19limbs/femul.v b/src/Specific/solinas32_2e384m2e128m2e96p2e32m1_19limbs/femul.v new file mode 100644 index 000000000..af62e15b1 --- /dev/null +++ b/src/Specific/solinas32_2e384m2e128m2e96p2e32m1_19limbs/femul.v @@ -0,0 +1,14 @@ +Require Import Crypto.Arithmetic.PrimeFieldTheorems. +Require Import Crypto.Specific.solinas32_2e384m2e128m2e96p2e32m1_19limbs.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_2e384m2e128m2e96p2e32m1_19limbs/femulDisplay.v b/src/Specific/solinas32_2e384m2e128m2e96p2e32m1_19limbs/femulDisplay.v new file mode 100644 index 000000000..1341e8381 --- /dev/null +++ b/src/Specific/solinas32_2e384m2e128m2e96p2e32m1_19limbs/femulDisplay.v @@ -0,0 +1,4 @@ +Require Import Crypto.Specific.solinas32_2e384m2e128m2e96p2e32m1_19limbs.femul. +Require Import Crypto.Specific.Framework.IntegrationTestDisplayCommon. + +Check display mul. diff --git a/src/Specific/solinas32_2e384m2e128m2e96p2e32m1_19limbs/fesquare.v b/src/Specific/solinas32_2e384m2e128m2e96p2e32m1_19limbs/fesquare.v new file mode 100644 index 000000000..6c7ca80a1 --- /dev/null +++ b/src/Specific/solinas32_2e384m2e128m2e96p2e32m1_19limbs/fesquare.v @@ -0,0 +1,14 @@ +Require Import Crypto.Arithmetic.PrimeFieldTheorems. +Require Import Crypto.Specific.solinas32_2e384m2e128m2e96p2e32m1_19limbs.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_2e384m2e128m2e96p2e32m1_19limbs/fesquareDisplay.v b/src/Specific/solinas32_2e384m2e128m2e96p2e32m1_19limbs/fesquareDisplay.v new file mode 100644 index 000000000..be1c183ec --- /dev/null +++ b/src/Specific/solinas32_2e384m2e128m2e96p2e32m1_19limbs/fesquareDisplay.v @@ -0,0 +1,4 @@ +Require Import Crypto.Specific.solinas32_2e384m2e128m2e96p2e32m1_19limbs.fesquare. +Require Import Crypto.Specific.Framework.IntegrationTestDisplayCommon. + +Check display square. diff --git a/src/Specific/solinas32_2e384m2e128m2e96p2e32m1_19limbs/fesub.v b/src/Specific/solinas32_2e384m2e128m2e96p2e32m1_19limbs/fesub.v new file mode 100644 index 000000000..b2ee140c6 --- /dev/null +++ b/src/Specific/solinas32_2e384m2e128m2e96p2e32m1_19limbs/fesub.v @@ -0,0 +1,14 @@ +Require Import Crypto.Arithmetic.PrimeFieldTheorems. +Require Import Crypto.Specific.solinas32_2e384m2e128m2e96p2e32m1_19limbs.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_2e384m2e128m2e96p2e32m1_19limbs/fesubDisplay.v b/src/Specific/solinas32_2e384m2e128m2e96p2e32m1_19limbs/fesubDisplay.v new file mode 100644 index 000000000..d67ae4880 --- /dev/null +++ b/src/Specific/solinas32_2e384m2e128m2e96p2e32m1_19limbs/fesubDisplay.v @@ -0,0 +1,4 @@ +Require Import Crypto.Specific.solinas32_2e384m2e128m2e96p2e32m1_19limbs.fesub. +Require Import Crypto.Specific.Framework.IntegrationTestDisplayCommon. + +Check display sub. diff --git a/src/Specific/solinas32_2e384m2e128m2e96p2e32m1_19limbs/freeze.v b/src/Specific/solinas32_2e384m2e128m2e96p2e32m1_19limbs/freeze.v new file mode 100644 index 000000000..70a8f4fcc --- /dev/null +++ b/src/Specific/solinas32_2e384m2e128m2e96p2e32m1_19limbs/freeze.v @@ -0,0 +1,14 @@ +Require Import Crypto.Arithmetic.PrimeFieldTheorems. +Require Import Crypto.Specific.solinas32_2e384m2e128m2e96p2e32m1_19limbs.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_2e384m2e128m2e96p2e32m1_19limbs/freezeDisplay.v b/src/Specific/solinas32_2e384m2e128m2e96p2e32m1_19limbs/freezeDisplay.v new file mode 100644 index 000000000..31d59dc57 --- /dev/null +++ b/src/Specific/solinas32_2e384m2e128m2e96p2e32m1_19limbs/freezeDisplay.v @@ -0,0 +1,4 @@ +Require Import Crypto.Specific.solinas32_2e384m2e128m2e96p2e32m1_19limbs.freeze. +Require Import Crypto.Specific.Framework.IntegrationTestDisplayCommon. + +Check display freeze. diff --git a/src/Specific/solinas32_2e384m2e128m2e96p2e32m1_19limbs/py_interpreter.sh b/src/Specific/solinas32_2e384m2e128m2e96p2e32m1_19limbs/py_interpreter.sh new file mode 100755 index 000000000..e98eb1b23 --- /dev/null +++ b/src/Specific/solinas32_2e384m2e128m2e96p2e32m1_19limbs/py_interpreter.sh @@ -0,0 +1,4 @@ +#!/bin/sh +set -eu + +/usr/bin/env python3 "$@" -Dq='2**384 - 2**128 - 2**96 + 2**32 - 1' -Dmodulus_bytes='20 + 4/19' -Da24='121665' |