aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Jason Gross <jgross@mit.edu>2017-04-01 22:58:27 -0400
committerGravatar Jason Gross <jgross@mit.edu>2017-04-01 22:58:27 -0400
commitd4f6f7373fc1f3a0ba1d1c17547f6d5b556bea5b (patch)
treeb13f8852f07c92b4bf157b8592c85b3bb81d1179
parentd26097a2854ab38d046ca5df22b1732f6eece0eb (diff)
Split off BoundedWord.v from IntegrationTest.v
-rw-r--r--_CoqProject1
-rw-r--r--src/Specific/IntegrationTest.v13
-rw-r--r--src/Util/BoundedWord.v13
3 files changed, 15 insertions, 12 deletions
diff --git a/_CoqProject b/_CoqProject
index 574e38405..ca1e55bed 100644
--- a/_CoqProject
+++ b/_CoqProject
@@ -482,6 +482,7 @@ src/Test/Curve25519SpecTestVectors.v
src/Util/AdditionChainExponentiation.v
src/Util/AutoRewrite.v
src/Util/Bool.v
+src/Util/BoundedWord.v
src/Util/CPSUtil.v
src/Util/CaseUtil.v
src/Util/Curry.v
diff --git a/src/Specific/IntegrationTest.v b/src/Specific/IntegrationTest.v
index 39f34a311..49fb55969 100644
--- a/src/Specific/IntegrationTest.v
+++ b/src/Specific/IntegrationTest.v
@@ -7,20 +7,9 @@ Require Import Crypto.NewBaseSystem.
Require Import Crypto.Util.FixedWordSizes.
Require Import Crypto.Specific.NewBaseSystemTest.
Require Import Crypto.ModularArithmetic.PrimeFieldTheorems.
-Require Import Crypto.Util.Tuple Crypto.Util.Notations Crypto.Util.ZRange.
+Require Import Crypto.Util.Tuple Crypto.Util.Notations Crypto.Util.ZRange Crypto.Util.BoundedWord.
Import ListNotations.
-Section Pre.
- Definition BoundedWord n (bitwidth : nat)
- (bounds : tuple zrange n) : Type :=
- { x : tuple (wordT bitwidth) n
- | is_bounded_by (Some (Z.of_nat bitwidth)) bounds
- (map wordToZ x)}.
-
- Definition BoundedWordToZ n w b (BW :BoundedWord n w b)
- : tuple Z n := map wordToZ (proj1_sig BW).
-End Pre.
-
Section BoundedField25p5.
Local Coercion Z.of_nat : nat >-> Z.
diff --git a/src/Util/BoundedWord.v b/src/Util/BoundedWord.v
new file mode 100644
index 000000000..cfd27a231
--- /dev/null
+++ b/src/Util/BoundedWord.v
@@ -0,0 +1,13 @@
+Require Import Coq.ZArith.ZArith.
+Require Import Crypto.Util.Tuple.
+Require Import Crypto.Util.ZRange.
+Require Import Crypto.Util.FixedWordSizes.
+
+Definition BoundedWord n (bitwidth : nat)
+ (bounds : tuple zrange n) : Type :=
+ { x : tuple (wordT bitwidth) n
+ | is_bounded_by (Some (Z.of_nat bitwidth)) bounds
+ (map wordToZ x)}.
+
+Definition BoundedWordToZ n w b (BW :BoundedWord n w b)
+ : tuple Z n := map wordToZ (proj1_sig BW).