From 42a8ea0002c784b2f70b373598c59fdf230e64f5 Mon Sep 17 00:00:00 2001 From: Robert Habermeier Date: Tue, 13 Sep 2016 15:26:31 +0200 Subject: [PATCH] prepare bigint for crates.io --- Cargo.lock | 28 ++++++++++++++-------------- ethcrypto/Cargo.toml | 2 +- ethcrypto/src/lib.rs | 2 +- ethkey/Cargo.toml | 2 +- ethkey/src/lib.rs | 2 +- util/Cargo.toml | 2 +- util/bigint/Cargo.toml | 5 +++-- util/bigint/src/lib.rs | 2 ++ util/bigint/src/uint.rs | 7 ++++--- util/rlp/Cargo.toml | 2 +- util/rlp/src/lib.rs | 2 +- util/src/lib.rs | 2 +- 12 files changed, 31 insertions(+), 27 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 13fbcf9ef..d6af0694a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -84,16 +84,6 @@ name = "base64" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "bigint" -version = "0.1.0" -dependencies = [ - "heapsize 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc_version 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "bit-set" version = "0.4.0" @@ -304,6 +294,16 @@ dependencies = [ "time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "ethcore-bigint" +version = "0.1.0" +dependencies = [ + "heapsize 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc_version 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "ethcore-dapps" version = "1.4.0" @@ -516,11 +516,11 @@ version = "1.4.0" dependencies = [ "ansi_term 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", "arrayvec 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", - "bigint 0.1.0", "clippy 0.0.85 (registry+https://github.com/rust-lang/crates.io-index)", "elastic-array 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "env_logger 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "eth-secp256k1 0.5.4 (git+https://github.com/ethcore/rust-secp256k1)", + "ethcore-bigint 0.1.0", "ethcore-devtools 1.4.0", "heapsize 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "itertools 0.4.13 (registry+https://github.com/rust-lang/crates.io-index)", @@ -547,8 +547,8 @@ dependencies = [ name = "ethcrypto" version = "0.1.0" dependencies = [ - "bigint 0.1.0", "eth-secp256k1 0.5.4 (git+https://github.com/ethcore/rust-secp256k1)", + "ethcore-bigint 0.1.0", "ethkey 0.2.0", "rust-crypto 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", "tiny-keccak 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", @@ -569,9 +569,9 @@ dependencies = [ name = "ethkey" version = "0.2.0" dependencies = [ - "bigint 0.1.0", "docopt 0.6.80 (registry+https://github.com/rust-lang/crates.io-index)", "eth-secp256k1 0.5.4 (git+https://github.com/ethcore/rust-secp256k1)", + "ethcore-bigint 0.1.0", "lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1344,8 +1344,8 @@ dependencies = [ name = "rlp" version = "0.1.0" dependencies = [ - "bigint 0.1.0", "elastic-array 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ethcore-bigint 0.1.0", "lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", ] diff --git a/ethcrypto/Cargo.toml b/ethcrypto/Cargo.toml index 85298266d..5c638b555 100644 --- a/ethcrypto/Cargo.toml +++ b/ethcrypto/Cargo.toml @@ -8,5 +8,5 @@ rust-crypto = "0.2.36" tiny-keccak = "1.0" eth-secp256k1 = { git = "https://github.com/ethcore/rust-secp256k1" } ethkey = { path = "../ethkey" } -bigint = { path = "../util/bigint" } +ethcore-bigint = { path = "../util/bigint" } diff --git a/ethcrypto/src/lib.rs b/ethcrypto/src/lib.rs index 9263e32c9..680718d12 100644 --- a/ethcrypto/src/lib.rs +++ b/ethcrypto/src/lib.rs @@ -16,7 +16,7 @@ //! Crypto utils used ethstore and network. -extern crate bigint; +extern crate ethcore_bigint as bigint; extern crate tiny_keccak; extern crate crypto as rcrypto; extern crate secp256k1; diff --git a/ethkey/Cargo.toml b/ethkey/Cargo.toml index 6253d5a39..8e95d8519 100644 --- a/ethkey/Cargo.toml +++ b/ethkey/Cargo.toml @@ -10,7 +10,7 @@ tiny-keccak = "1.0" eth-secp256k1 = { git = "https://github.com/ethcore/rust-secp256k1" } rustc-serialize = "0.3" docopt = { version = "0.6", optional = true } -bigint = { path = "../util/bigint" } +ethcore-bigint = { path = "../util/bigint" } [features] default = [] diff --git a/ethkey/src/lib.rs b/ethkey/src/lib.rs index 0bce090a5..1f345b2ff 100644 --- a/ethkey/src/lib.rs +++ b/ethkey/src/lib.rs @@ -20,7 +20,7 @@ extern crate lazy_static; extern crate tiny_keccak; extern crate secp256k1; extern crate rustc_serialize; -extern crate bigint; +extern crate ethcore_bigint as bigint; mod brain; mod error; diff --git a/util/Cargo.toml b/util/Cargo.toml index 106251a3f..45c5e6f8e 100644 --- a/util/Cargo.toml +++ b/util/Cargo.toml @@ -28,7 +28,7 @@ ethcore-devtools = { path = "../devtools" } libc = "0.2.7" vergen = "0.1" target_info = "0.1" -bigint = { path = "bigint" } +ethcore-bigint = { path = "bigint" } parking_lot = "0.2.6" using_queue = { path = "using_queue" } table = { path = "table" } diff --git a/util/bigint/Cargo.toml b/util/bigint/Cargo.toml index 68778e18c..ee25ce846 100644 --- a/util/bigint/Cargo.toml +++ b/util/bigint/Cargo.toml @@ -1,8 +1,9 @@ [package] -description = "Rust-assembler implementation of big integers arithmetic" +description = "Large fixed-size integers and hash function outputs" homepage = "http://ethcore.io" +repository = "https://github.com/ethcore/parity" license = "GPL-3.0" -name = "bigint" +name = "ethcore-bigint" version = "0.1.0" authors = ["Ethcore "] build = "build.rs" diff --git a/util/bigint/src/lib.rs b/util/bigint/src/lib.rs index 746cc8139..307aed3ce 100644 --- a/util/bigint/src/lib.rs +++ b/util/bigint/src/lib.rs @@ -14,6 +14,8 @@ // You should have received a copy of the GNU General Public License // along with Parity. If not, see . +//! Efficient large, fixed-size big integers and hashes. + #![cfg_attr(asm_available, feature(asm))] extern crate rand; diff --git a/util/bigint/src/uint.rs b/util/bigint/src/uint.rs index c5dd033cb..dab00537e 100644 --- a/util/bigint/src/uint.rs +++ b/util/bigint/src/uint.rs @@ -30,11 +30,12 @@ // If not, see . // -//! Big unsigned integer types +//! Big unsigned integer types. //! //! Implementation of a various large-but-fixed sized unsigned integer types. -//! The functions here are designed to be fast. -//! +//! 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. use std::{mem, fmt}; use std::str::{FromStr}; diff --git a/util/rlp/Cargo.toml b/util/rlp/Cargo.toml index eba3a2842..c24e4cc59 100644 --- a/util/rlp/Cargo.toml +++ b/util/rlp/Cargo.toml @@ -7,6 +7,6 @@ authors = ["Ethcore "] [dependencies] elastic-array = "0.5" -bigint = { path = "../bigint" } +ethcore-bigint = { path = "../bigint" } lazy_static = "0.2" rustc-serialize = "0.3" \ No newline at end of file diff --git a/util/rlp/src/lib.rs b/util/rlp/src/lib.rs index 2cc8c3bd8..da5e816b5 100644 --- a/util/rlp/src/lib.rs +++ b/util/rlp/src/lib.rs @@ -65,7 +65,7 @@ pub use self::rlpin::{Rlp, RlpIterator}; pub use self::rlpstream::RlpStream; pub use self::rlpcompression::RlpType; -extern crate bigint; +extern crate ethcore_bigint as bigint; extern crate elastic_array; extern crate rustc_serialize; diff --git a/util/src/lib.rs b/util/src/lib.rs index 57ea9c152..17c2f5151 100644 --- a/util/src/lib.rs +++ b/util/src/lib.rs @@ -99,7 +99,7 @@ extern crate time; extern crate ethcore_devtools as devtools; extern crate libc; extern crate target_info; -extern crate bigint; +extern crate ethcore_bigint as bigint; extern crate parking_lot; extern crate ansi_term; extern crate tiny_keccak;