diff options
Diffstat (limited to 'src/Specific/NISTP256/AMD128')
19 files changed, 0 insertions, 238 deletions
diff --git a/src/Specific/NISTP256/AMD128/CurveParameters.v b/src/Specific/NISTP256/AMD128/CurveParameters.v deleted file mode 100644 index f994c8a6d..000000000 --- a/src/Specific/NISTP256/AMD128/CurveParameters.v +++ /dev/null @@ -1,39 +0,0 @@ -Require Import Crypto.Specific.Framework.RawCurveParameters. -Require Import Crypto.Util.LetIn. - -(*** -Modulus : 2^256-2^224+2^192+2^96-1 -Base: 128 -***) - -Definition curve : CurveParameters := - {| - sz := 2%nat; - base := 128; - bitwidth := 128; - s := 2^256; - c := [(1, 1); (2^96, -1); (2^192, -1); (2^224, 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/NISTP256/AMD128/Synthesis.v b/src/Specific/NISTP256/AMD128/Synthesis.v deleted file mode 100644 index 4dffed20b..000000000 --- a/src/Specific/NISTP256/AMD128/Synthesis.v +++ /dev/null @@ -1,9 +0,0 @@ -Require Import Crypto.Specific.Framework.SynthesisFramework. -Require Import Crypto.Specific.NISTP256.AMD128.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/NISTP256/AMD128/compiler.sh b/src/Specific/NISTP256/AMD128/compiler.sh deleted file mode 100644 index 73e1a78e0..000000000 --- a/src/Specific/NISTP256/AMD128/compiler.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -set -eu - -gcc -fno-peephole2 `#GCC BUG 81300` -march=native -mbmi2 -mtune=native -std=gnu11 -O3 -flto -fomit-frame-pointer -fwrapv -Wno-attributes -Wno-incompatible-pointer-types -fno-strict-aliasing "$@" diff --git a/src/Specific/NISTP256/AMD128/feadd.v b/src/Specific/NISTP256/AMD128/feadd.v deleted file mode 100644 index 5ee329e4e..000000000 --- a/src/Specific/NISTP256/AMD128/feadd.v +++ /dev/null @@ -1,14 +0,0 @@ -Require Import Crypto.Arithmetic.PrimeFieldTheorems. -Require Import Crypto.Specific.NISTP256.AMD128.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/NISTP256/AMD128/feaddDisplay.log b/src/Specific/NISTP256/AMD128/feaddDisplay.log deleted file mode 100644 index 89d8839bf..000000000 --- a/src/Specific/NISTP256/AMD128/feaddDisplay.log +++ /dev/null @@ -1,14 +0,0 @@ -λ x x0 : word128 * word128, -Interp-η -(λ var : Syntax.base_type → Type, - λ '(x4, x5, (x6, x7))%core, - uint128_t x9, uint8_t x10 = addcarryx_u128(0x0, x5, x7); - uint128_t x12, uint8_t x13 = addcarryx_u128(x10, x4, x6); - uint128_t x15, uint8_t x16 = subborrow_u128(0x0, x9, 0xffffffffffffffffffffffffL); - uint128_t x18, uint8_t x19 = subborrow_u128(x16, x12, 0xffffffff000000010000000000000000L); - uint128_t _, uint8_t x22 = subborrow_u128(x19, x13, 0x0); - uint128_t x23 = cmovznz128(x22, x18, x12); - uint128_t x24 = cmovznz128(x22, x15, x9); - return (x23, x24)) -(x, x0)%core - : word128 * word128 → word128 * word128 → ReturnType (uint128_t * uint128_t) diff --git a/src/Specific/NISTP256/AMD128/feaddDisplay.v b/src/Specific/NISTP256/AMD128/feaddDisplay.v deleted file mode 100644 index cde97baed..000000000 --- a/src/Specific/NISTP256/AMD128/feaddDisplay.v +++ /dev/null @@ -1,4 +0,0 @@ -Require Import Crypto.Specific.NISTP256.AMD128.feadd. -Require Import Crypto.Specific.Framework.IntegrationTestDisplayCommon. - -Check display add. diff --git a/src/Specific/NISTP256/AMD128/femul.v b/src/Specific/NISTP256/AMD128/femul.v deleted file mode 100644 index 7c2ecbec1..000000000 --- a/src/Specific/NISTP256/AMD128/femul.v +++ /dev/null @@ -1,14 +0,0 @@ -Require Import Crypto.Arithmetic.PrimeFieldTheorems. -Require Import Crypto.Specific.NISTP256.AMD128.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/NISTP256/AMD128/femulDisplay.log b/src/Specific/NISTP256/AMD128/femulDisplay.log deleted file mode 100644 index 96bc3e200..000000000 --- a/src/Specific/NISTP256/AMD128/femulDisplay.log +++ /dev/null @@ -1,40 +0,0 @@ -λ x x0 : word128 * word128, -Interp-η -(λ var : Syntax.base_type → Type, - λ '(x4, x5, (x6, x7))%core, - uint128_t x9, uint128_t x10 = mulx_u128(x5, x7); - uint128_t x12, uint128_t x13 = mulx_u128(x5, x6); - uint128_t x15, uint8_t x16 = addcarryx_u128(0x0, x10, x12); - uint128_t x18, uint8_t _ = addcarryx_u128(0x0, x16, x13); - uint128_t x21, uint128_t _ = mulx_u128(x9, 0x1000000000000000000000001L); - uint128_t x24, uint128_t x25 = mulx_u128(x21, 0xffffffffffffffffffffffffL); - uint128_t x27, uint128_t x28 = mulx_u128(x21, 0xffffffff000000010000000000000000L); - uint128_t x30, uint8_t x31 = addcarryx_u128(0x0, x25, x27); - uint128_t x33, uint8_t _ = addcarryx_u128(0x0, x31, x28); - uint128_t _, uint8_t x37 = addcarryx_u128(0x0, x9, x24); - uint128_t x39, uint8_t x40 = addcarryx_u128(x37, x15, x30); - uint128_t x42, uint8_t x43 = addcarryx_u128(x40, x18, x33); - uint128_t x45, uint128_t x46 = mulx_u128(x4, x7); - uint128_t x48, uint128_t x49 = mulx_u128(x4, x6); - uint128_t x51, uint8_t x52 = addcarryx_u128(0x0, x46, x48); - uint128_t x54, uint8_t _ = addcarryx_u128(0x0, x52, x49); - uint128_t x57, uint8_t x58 = addcarryx_u128(0x0, x39, x45); - uint128_t x60, uint8_t x61 = addcarryx_u128(x58, x42, x51); - uint128_t x63, uint8_t x64 = addcarryx_u128(x61, x43, x54); - uint128_t x66, uint128_t _ = mulx_u128(x57, 0x1000000000000000000000001L); - uint128_t x69, uint128_t x70 = mulx_u128(x66, 0xffffffffffffffffffffffffL); - uint128_t x72, uint128_t x73 = mulx_u128(x66, 0xffffffff000000010000000000000000L); - uint128_t x75, uint8_t x76 = addcarryx_u128(0x0, x70, x72); - uint128_t x78, uint8_t _ = addcarryx_u128(0x0, x76, x73); - uint128_t _, uint8_t x82 = addcarryx_u128(0x0, x57, x69); - uint128_t x84, uint8_t x85 = addcarryx_u128(x82, x60, x75); - uint128_t x87, uint8_t x88 = addcarryx_u128(x85, x63, x78); - uint8_t x89 = (x88 + x64); - uint128_t x91, uint8_t x92 = subborrow_u128(0x0, x84, 0xffffffffffffffffffffffffL); - uint128_t x94, uint8_t x95 = subborrow_u128(x92, x87, 0xffffffff000000010000000000000000L); - uint128_t _, uint8_t x98 = subborrow_u128(x95, x89, 0x0); - uint128_t x99 = cmovznz128(x98, x94, x87); - uint128_t x100 = cmovznz128(x98, x91, x84); - return (x99, x100)) -(x, x0)%core - : word128 * word128 → word128 * word128 → ReturnType (uint128_t * uint128_t) diff --git a/src/Specific/NISTP256/AMD128/femulDisplay.v b/src/Specific/NISTP256/AMD128/femulDisplay.v deleted file mode 100644 index 86a058019..000000000 --- a/src/Specific/NISTP256/AMD128/femulDisplay.v +++ /dev/null @@ -1,4 +0,0 @@ -Require Import Crypto.Specific.NISTP256.AMD128.femul. -Require Import Crypto.Specific.Framework.IntegrationTestDisplayCommon. - -Check display mul. diff --git a/src/Specific/NISTP256/AMD128/fenz.v b/src/Specific/NISTP256/AMD128/fenz.v deleted file mode 100644 index c1a91fa38..000000000 --- a/src/Specific/NISTP256/AMD128/fenz.v +++ /dev/null @@ -1,16 +0,0 @@ -Require Import Coq.ZArith.ZArith. -Require Import Crypto.Arithmetic.PrimeFieldTheorems. -Require Import Crypto.Specific.NISTP256.AMD128.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/NISTP256/AMD128/fenzDisplay.log b/src/Specific/NISTP256/AMD128/fenzDisplay.log deleted file mode 100644 index 53c690df8..000000000 --- a/src/Specific/NISTP256/AMD128/fenzDisplay.log +++ /dev/null @@ -1,8 +0,0 @@ -λ x : word128 * word128, -Interp-η -(λ var : Syntax.base_type → Type, - λ '(x1, x2)%core, - uint128_t x3 = (x2 | x1); - return x3) -x - : word128 * word128 → ReturnType uint128_t diff --git a/src/Specific/NISTP256/AMD128/fenzDisplay.v b/src/Specific/NISTP256/AMD128/fenzDisplay.v deleted file mode 100644 index 18ff51330..000000000 --- a/src/Specific/NISTP256/AMD128/fenzDisplay.v +++ /dev/null @@ -1,4 +0,0 @@ -Require Import Crypto.Specific.NISTP256.AMD128.fenz. -Require Import Crypto.Specific.Framework.IntegrationTestDisplayCommon. - -Check display nonzero. diff --git a/src/Specific/NISTP256/AMD128/feopp.v b/src/Specific/NISTP256/AMD128/feopp.v deleted file mode 100644 index 682541e8c..000000000 --- a/src/Specific/NISTP256/AMD128/feopp.v +++ /dev/null @@ -1,14 +0,0 @@ -Require Import Crypto.Arithmetic.PrimeFieldTheorems. -Require Import Crypto.Specific.NISTP256.AMD128.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/NISTP256/AMD128/feoppDisplay.log b/src/Specific/NISTP256/AMD128/feoppDisplay.log deleted file mode 100644 index f3b1f606f..000000000 --- a/src/Specific/NISTP256/AMD128/feoppDisplay.log +++ /dev/null @@ -1,14 +0,0 @@ -λ x : word128 * word128, -Interp-η -(λ var : Syntax.base_type → Type, - λ '(x1, x2)%core, - uint128_t x4, uint8_t x5 = subborrow_u128(0x0, 0x0, x2); - uint128_t x7, uint8_t x8 = subborrow_u128(x5, 0x0, x1); - uint128_t x9 = cmovznz128(x8, 0x0, 0xffffffffffffffffffffffffffffffffL); - uint128_t x10 = (x9 & 0xffffffffffffffffffffffffL); - uint128_t x12, uint8_t x13 = addcarryx_u128(0x0, x4, x10); - uint128_t x14 = (x9 & 0xffffffff000000010000000000000000L); - uint128_t x16, uint8_t _ = addcarryx_u128(x13, x7, x14); - (Return x16, Return x12)) -x - : word128 * word128 → ReturnType (uint128_t * uint128_t) diff --git a/src/Specific/NISTP256/AMD128/feoppDisplay.v b/src/Specific/NISTP256/AMD128/feoppDisplay.v deleted file mode 100644 index 8c84f30d2..000000000 --- a/src/Specific/NISTP256/AMD128/feoppDisplay.v +++ /dev/null @@ -1,4 +0,0 @@ -Require Import Crypto.Specific.NISTP256.AMD128.feopp. -Require Import Crypto.Specific.Framework.IntegrationTestDisplayCommon. - -Check display opp. diff --git a/src/Specific/NISTP256/AMD128/fesub.v b/src/Specific/NISTP256/AMD128/fesub.v deleted file mode 100644 index f8a59ec86..000000000 --- a/src/Specific/NISTP256/AMD128/fesub.v +++ /dev/null @@ -1,14 +0,0 @@ -Require Import Crypto.Arithmetic.PrimeFieldTheorems. -Require Import Crypto.Specific.NISTP256.AMD128.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/NISTP256/AMD128/fesubDisplay.log b/src/Specific/NISTP256/AMD128/fesubDisplay.log deleted file mode 100644 index 5136e376d..000000000 --- a/src/Specific/NISTP256/AMD128/fesubDisplay.log +++ /dev/null @@ -1,14 +0,0 @@ -λ x x0 : word128 * word128, -Interp-η -(λ var : Syntax.base_type → Type, - λ '(x4, x5, (x6, x7))%core, - uint128_t x9, uint8_t x10 = subborrow_u128(0x0, x5, x7); - uint128_t x12, uint8_t x13 = subborrow_u128(x10, x4, x6); - uint128_t x14 = cmovznz128(x13, 0x0, 0xffffffffffffffffffffffffffffffffL); - uint128_t x15 = (x14 & 0xffffffffffffffffffffffffL); - uint128_t x17, uint8_t x18 = addcarryx_u128(0x0, x9, x15); - uint128_t x19 = (x14 & 0xffffffff000000010000000000000000L); - uint128_t x21, uint8_t _ = addcarryx_u128(x18, x12, x19); - (Return x21, Return x17)) -(x, x0)%core - : word128 * word128 → word128 * word128 → ReturnType (uint128_t * uint128_t) diff --git a/src/Specific/NISTP256/AMD128/fesubDisplay.v b/src/Specific/NISTP256/AMD128/fesubDisplay.v deleted file mode 100644 index 4e46b2272..000000000 --- a/src/Specific/NISTP256/AMD128/fesubDisplay.v +++ /dev/null @@ -1,4 +0,0 @@ -Require Import Crypto.Specific.NISTP256.AMD128.fesub. -Require Import Crypto.Specific.Framework.IntegrationTestDisplayCommon. - -Check display sub. diff --git a/src/Specific/NISTP256/AMD128/py_interpreter.sh b/src/Specific/NISTP256/AMD128/py_interpreter.sh deleted file mode 100755 index 9b7e3baaa..000000000 --- a/src/Specific/NISTP256/AMD128/py_interpreter.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -set -eu - -/usr/bin/env python3 "$@" -Dq='2**256-2**224+2**192+2**96-1' -Dmodulus_bytes='128' -Da24='121665' |