From 97ecf175c8b62ea82a4ffe1c382abac8be1b0cc2 Mon Sep 17 00:00:00 2001 From: David Palm Date: Mon, 13 Aug 2018 13:56:23 +0200 Subject: [PATCH] Export U256 and U512 --- uint/Cargo.toml | 2 +- uint/README.md | 6 +++--- uint/src/lib.rs | 3 +++ uint/src/uint.rs | 3 +++ uint/tests/uint_tests.rs | 4 +--- 5 files changed, 11 insertions(+), 7 deletions(-) diff --git a/uint/Cargo.toml b/uint/Cargo.toml index b8c669f..8120e7c 100644 --- a/uint/Cargo.toml +++ b/uint/Cargo.toml @@ -12,9 +12,9 @@ byteorder = { version = "1", default-features = false } heapsize = { version = "0.4.2", optional = true } rustc-hex = { version = "2.0", default-features = false } quickcheck = { version = "0.6", optional = true } +crunchy = "0.1" [dev-dependencies] -crunchy = "0.1.5" quickcheck = "0.6" rustc-hex = "2.0" diff --git a/uint/README.md b/uint/README.md index 4a0388b..9ba5885 100644 --- a/uint/README.md +++ b/uint/README.md @@ -1,8 +1,8 @@ # Big unsigned integer types Implementation of a various large-but-fixed sized unsigned integer types. -The functions here are designed to be fast. There are optional `x86_64` -implementations for even more speed, hidden behind the `x64_arithmetic` -feature flag. +The functions here are designed to be fast. + +The crate exports two commonly used types: `U256` and `U512`. Other sizes can be constructed with `construct_uint!(NAME, SIZE_IN_WORDS)`, e.g. `construct_uint!(U128, 2);`. Run tests with `cargo test --features=std,impl_quickcheck_arbitrary`. \ No newline at end of file diff --git a/uint/src/lib.rs b/uint/src/lib.rs index b9b5b20..e53f3c8 100644 --- a/uint/src/lib.rs +++ b/uint/src/lib.rs @@ -32,5 +32,8 @@ pub extern crate quickcheck; #[cfg(all(not(feature = "std"), test))] extern crate alloc; +#[macro_use] +extern crate crunchy; + mod uint; pub use uint::*; diff --git a/uint/src/uint.rs b/uint/src/uint.rs index 2d1c640..a25c934 100644 --- a/uint/src/uint.rs +++ b/uint/src/uint.rs @@ -1367,3 +1367,6 @@ macro_rules! impl_quickcheck_arbitrary_for_uint { macro_rules! impl_quickcheck_arbitrary_for_uint { ($uint: ty, $n_bytes: tt) => {} } + +construct_uint!(U256, 4); +construct_uint!(U512, 8); \ No newline at end of file diff --git a/uint/tests/uint_tests.rs b/uint/tests/uint_tests.rs index d6d2d2d..ed233d1 100644 --- a/uint/tests/uint_tests.rs +++ b/uint/tests/uint_tests.rs @@ -10,11 +10,9 @@ extern crate quickcheck; use core::u64::MAX; use core::str::FromStr; -use uint::FromDecStrErr; +use uint::{U256, U512, FromDecStrErr}; construct_uint!(U128, 2); -construct_uint!(U256, 4); -construct_uint!(U512, 8); #[test] fn uint256_checked_ops() {