diff --git a/Cargo.lock b/Cargo.lock index 5946f25b43c02c20da42ce4c81211a2f21eda342..602e10bd1005f1fcea5157d461adef31c0a2e439 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -60,16 +60,24 @@ name = "base64" version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "safemem 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "base64" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "bincode" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.78 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -99,7 +107,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "byteorder" -version = "1.2.3" +version = "1.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -107,7 +115,7 @@ name = "bytes" version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -145,6 +153,14 @@ dependencies = [ "vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "cloudabi" +version = "0.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "crossbeam-deque" version = "0.2.0" @@ -209,12 +225,12 @@ version = "0.1.0-a0.1" dependencies = [ "dirs 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "duniter-conf 0.1.0-a0.1", - "duniter-crypto 0.2.0-a0.1", "duniter-dal 0.1.0-a0.1", "duniter-documents 0.9.0-b1", "duniter-message 0.1.0-a0.1", "duniter-module 0.1.0-a0.1", "duniter-network 0.1.0-a0.1", + "dup-crypto 0.3.0-b1", "durs-network-documents 0.1.0-a0.1", "durs-wot 0.8.0-a0.9", "log 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -232,9 +248,9 @@ name = "duniter-conf" version = "0.1.0-a0.1" dependencies = [ "dirs 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "duniter-crypto 0.2.0-a0.1", "duniter-documents 0.9.0-b1", "duniter-module 0.1.0-a0.1", + "dup-crypto 0.3.0-b1", "rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.78 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.66 (registry+https://github.com/rust-lang/crates.io-index)", @@ -248,10 +264,10 @@ dependencies = [ "dirs 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "duniter-blockchain 0.1.0-a0.1", "duniter-conf 0.1.0-a0.1", - "duniter-crypto 0.2.0-a0.1", "duniter-message 0.1.0-a0.1", "duniter-module 0.1.0-a0.1", "duniter-network 0.1.0-a0.1", + "dup-crypto 0.3.0-b1", "log 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "log-panics 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.78 (registry+https://github.com/rust-lang/crates.io-index)", @@ -262,27 +278,14 @@ dependencies = [ "threadpool 1.7.1 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "duniter-crypto" -version = "0.2.0-a0.1" -dependencies = [ - "base58 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "base64 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)", - "bincode 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "rust-crypto 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.78 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.66 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "duniter-dal" version = "0.1.0-a0.1" dependencies = [ - "duniter-crypto 0.2.0-a0.1", "duniter-documents 0.9.0-b1", "duniter-module 0.1.0-a0.1", "duniter-network 0.1.0-a0.1", + "dup-crypto 0.3.0-b1", "durs-wot 0.8.0-a0.9", "log 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "rust-crypto 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", @@ -298,8 +301,8 @@ version = "0.9.0-b1" dependencies = [ "base58 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "base64 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)", - "byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "duniter-crypto 0.2.0-a0.1", + "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", + "dup-crypto 0.3.0-b1", "pest 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "pest_derive 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "rust-crypto 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", @@ -311,11 +314,11 @@ dependencies = [ name = "duniter-message" version = "0.1.0-a0.1" dependencies = [ - "duniter-crypto 0.2.0-a0.1", "duniter-dal 0.1.0-a0.1", "duniter-documents 0.9.0-b1", "duniter-module 0.1.0-a0.1", "duniter-network 0.1.0-a0.1", + "dup-crypto 0.3.0-b1", "serde 1.0.78 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.66 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.21 (registry+https://github.com/rust-lang/crates.io-index)", @@ -325,8 +328,8 @@ dependencies = [ name = "duniter-module" version = "0.1.0-a0.1" dependencies = [ - "duniter-crypto 0.2.0-a0.1", "duniter-documents 0.9.0-b1", + "dup-crypto 0.3.0-b1", "serde 1.0.78 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.66 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.21 (registry+https://github.com/rust-lang/crates.io-index)", @@ -337,11 +340,10 @@ dependencies = [ name = "duniter-network" version = "0.1.0-a0.1" dependencies = [ - "duniter-crypto 0.2.0-a0.1", "duniter-documents 0.9.0-b1", "duniter-module 0.1.0-a0.1", + "dup-crypto 0.3.0-b1", "durs-network-documents 0.1.0-a0.1", - "pretty_assertions 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.78 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.66 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.21 (registry+https://github.com/rust-lang/crates.io-index)", @@ -352,12 +354,12 @@ name = "duniter-tui" version = "0.1.0-a0.1" dependencies = [ "duniter-conf 0.1.0-a0.1", - "duniter-crypto 0.2.0-a0.1", "duniter-dal 0.1.0-a0.1", "duniter-documents 0.9.0-b1", "duniter-message 0.1.0-a0.1", "duniter-module 0.1.0-a0.1", "duniter-network 0.1.0-a0.1", + "dup-crypto 0.3.0-b1", "durs-network-documents 0.1.0-a0.1", "log 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.78 (registry+https://github.com/rust-lang/crates.io-index)", @@ -367,6 +369,19 @@ dependencies = [ "termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "dup-crypto" +version = "0.3.0-b1" +dependencies = [ + "base58 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "base64 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", + "bincode 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", + "rust-crypto 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.78 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.66 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "durs" version = "0.1.0-a0.1" @@ -384,8 +399,8 @@ version = "0.1.0-a0.1" dependencies = [ "base58 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "bincode 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "duniter-crypto 0.2.0-a0.1", "duniter-documents 0.9.0-b1", + "dup-crypto 0.3.0-b1", "pest 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "pest_derive 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "pretty_assertions 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -399,7 +414,7 @@ name = "durs-wot" version = "0.8.0-a0.9" dependencies = [ "bincode 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "rayon 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.78 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.66 (registry+https://github.com/rust-lang/crates.io-index)", @@ -410,10 +425,10 @@ name = "durs-ws2p" version = "0.1.0-a0.1" dependencies = [ "duniter-conf 0.1.0-a0.1", - "duniter-crypto 0.2.0-a0.1", "duniter-message 0.1.0-a0.1", "duniter-module 0.1.0-a0.1", "duniter-network 0.1.0-a0.1", + "dup-crypto 0.3.0-b1", "durs-network-documents 0.1.0-a0.1", "durs-ws2p-messages 0.1.0-a0.1", "log 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -427,9 +442,9 @@ name = "durs-ws2p-messages" version = "0.1.0-a0.1" dependencies = [ "bincode 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "duniter-crypto 0.2.0-a0.1", + "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "duniter-documents 0.9.0-b1", + "dup-crypto 0.3.0-b1", "durs-network-documents 0.1.0-a0.1", "log 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "pretty_assertions 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -443,14 +458,14 @@ dependencies = [ name = "durs-ws2p-v1-legacy" version = "0.1.0-a0.1" dependencies = [ - "byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "duniter-conf 0.1.0-a0.1", - "duniter-crypto 0.2.0-a0.1", "duniter-dal 0.1.0-a0.1", "duniter-documents 0.9.0-b1", "duniter-message 0.1.0-a0.1", "duniter-module 0.1.0-a0.1", "duniter-network 0.1.0-a0.1", + "dup-crypto 0.3.0-b1", "durs-network-documents 0.1.0-a0.1", "durs-wot 0.8.0-a0.9", "log 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -827,6 +842,31 @@ dependencies = [ "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "rand" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_core" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_core" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "rayon" version = "1.0.1" @@ -1058,7 +1098,7 @@ name = "term" version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1190,7 +1230,7 @@ name = "ws" version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "bytes 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "httparse 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1221,18 +1261,20 @@ dependencies = [ "checksum backtrace 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "dbdd17cd962b570302f5297aea8648d5923e22e555c2ed2d8b2e34eca646bf6d" "checksum backtrace-sys 0.1.23 (registry+https://github.com/rust-lang/crates.io-index)" = "bff67d0c06556c0b8e6b5f090f0eac52d950d9dfd1d35ba04e4ca3543eaf6a7e" "checksum base58 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5024ee8015f02155eee35c711107ddd9a9bf3cb689cf2a9089c97e79b6e1ae83" +"checksum base64 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "621fc7ecb8008f86d7fb9b95356cd692ce9514b80a86d85b397f32a22da7b9e2" "checksum base64 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)" = "85415d2594767338a74a30c1d370b2f3262ec1b4ed2d7bba5b3faf4de40467d9" "checksum bincode 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9f2fb9e29e72fd6bc12071533d5dc7664cb01480c59406f656d7ac25c7bd8ff7" "checksum bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4efd02e230a02e18f92fc2735f44597385ed02ad8f831e7c1c1156ee5e1ab3a5" "checksum bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "d0c54bb8f454c567f21197eefcdbf5679d0bd99f2ddbe52e84c77061952e6789" "checksum block-buffer 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a076c298b9ecdb530ed9d967e74a6027d6a7478924520acddcddc24c1c8ab3ab" "checksum byte-tools 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "560c32574a12a89ecd91f5e742165893f86e3ab98d21f8ea548658eb9eef5f40" -"checksum byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "74c0b906e9446b0a2e4f760cdb3fa4b2c48cdc6db8766a845c54b6ff063fd2e9" +"checksum byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "94f88df23a25417badc922ab0f5716cc1330e87f71ddd9203b3a3ccd9cedf75d" "checksum bytes 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "7dd32989a66957d3f0cba6588f15d4281a733f4e9ffc43fcd2385f57d3bf99ff" "checksum cc 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)" = "49ec142f5768efb5b7622aebc3fdbdbb8950a4b9ba996393cb76ef7466e8747d" "checksum cfg-if 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "405216fd8fe65f718daa7102ea808a946b6ce40c742998fbfd3463645552de18" "checksum chrono 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a81892f0d5a53f46fc05ef0b917305a81c13f1f13bb59ac91ff595817f0764b1" "checksum clap 2.31.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f0f16b89cbb9ee36d87483dc939fe9f1e13c05898d56d7b230a0d4dff033a536" +"checksum cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" "checksum crossbeam-deque 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f739f8c5363aca78cfb059edf753d8f0d36908c348f3d8d1503f03d8b75d9cf3" "checksum crossbeam-epoch 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "927121f5407de9956180ff5e936fe3cf4324279280001cd56b669d28ee7e9150" "checksum crossbeam-utils 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "2760899e32a1d58d5abb31129f8fae5de75220bc2176e77ff7c627ae45c918d9" @@ -1286,6 +1328,9 @@ dependencies = [ "checksum quote 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "e44651a0dc4cdd99f71c83b561e221f714912d11af1a4dff0631f923d53af035" "checksum rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)" = "15a732abf9d20f0ad8eeb6f909bf6868722d9a06e1e50802b6a70351f40b4eb1" "checksum rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "eba5f8cb59cc50ed56be8880a5c7b496bfd9bd26394e176bc67884094145c2c5" +"checksum rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e464cd887e869cddcae8792a4ee31d23c7edd516700695608f5b98c67ee0131c" +"checksum rand_core 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1961a422c4d189dfb50ffa9320bf1f2a9bd54ecb92792fb9477f99a1045f3372" +"checksum rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0905b6b7079ec73b314d4c748701f6931eb79fd97c668caa3f1899b22b32c6db" "checksum rayon 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "80e811e76f1dbf68abf87a759083d34600017fc4e10b6bd5ad84a700f9dba4b1" "checksum rayon-core 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9d24ad214285a7729b174ed6d3bcfcb80177807f959d95fafd5bfc5c4f201ac8" "checksum redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)" = "c214e91d3ecf43e9a4e41e578973adeb14b474f2bee858742d127af75a0112b1" diff --git a/blockchain/Cargo.toml b/blockchain/Cargo.toml index 321ae1329d2c4bee032ebba0b37473687a8773f7..218ff6b2665bc19edc73a2ff9c98bcb8c136f601 100644 --- a/blockchain/Cargo.toml +++ b/blockchain/Cargo.toml @@ -11,7 +11,7 @@ path = "lib.rs" [dependencies] dirs = "1.0.2" duniter-conf = { path = "../conf" } -duniter-crypto = { path = "../crypto" } +dup-crypto = { path = "../crypto" } duniter-dal = { path = "../dal" } duniter-documents = { path = "../documents" } durs-network-documents = { path = "../network-documents" } diff --git a/blockchain/apply_valid_block.rs b/blockchain/apply_valid_block.rs index 698ff0417a4ad647860439eca91948eac8989c8e..30c255c6235dcb8e9c8cb04bdaf3d986be7d1bc6 100644 --- a/blockchain/apply_valid_block.rs +++ b/blockchain/apply_valid_block.rs @@ -13,7 +13,6 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see <https://www.gnu.org/licenses/>. -use duniter_crypto::keys::*; use duniter_dal::block::DALBlock; use duniter_dal::sources::SourceAmount; use duniter_dal::writers::requests::*; @@ -22,6 +21,7 @@ use duniter_documents::v10::transaction::{TxAmount, TxBase}; use duniter_documents::v10::BlockDocument; use duniter_documents::BlockId; use duniter_documents::Document; +use dup_crypto::keys::*; use durs_wot::data::{NewLinkResult, RemLinkResult}; use durs_wot::{NodeId, WebOfTrust}; use std::collections::{HashMap, HashSet}; diff --git a/blockchain/check_and_apply_block.rs b/blockchain/check_and_apply_block.rs index 8b5b7e35702f597ff6d1b38bca0431ed0bac1ce2..68481efcde30fea8003db7714f51a86eb74267a1 100644 --- a/blockchain/check_and_apply_block.rs +++ b/blockchain/check_and_apply_block.rs @@ -16,12 +16,12 @@ use std::collections::HashMap; use apply_valid_block::*; -use duniter_crypto::keys::*; use duniter_dal::block::DALBlock; use duniter_dal::*; use duniter_documents::Document; use duniter_documents::{BlockHash, BlockId, Blockstamp, PreviousBlockstamp}; use duniter_network::NetworkBlock; +use dup_crypto::keys::*; use *; #[derive(Debug, Copy, Clone)] diff --git a/blockchain/dbex.rs b/blockchain/dbex.rs index 5e7736d92789903ff3c402bf059a1bccbe068ed9..368b8261166a7034489ed473e7c5dbf9168763a6 100644 --- a/blockchain/dbex.rs +++ b/blockchain/dbex.rs @@ -13,10 +13,10 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see <https://www.gnu.org/licenses/>. -use duniter_crypto::keys::*; use duniter_dal::identity::DALIdentity; use duniter_documents::v10::transaction::*; use duniter_module::DuniterConf; +use dup_crypto::keys::*; use durs_wot::data::rusty::RustyWebOfTrust; use durs_wot::operations::distance::{DistanceCalculator, WotDistance, WotDistanceParameters}; use std::time::*; diff --git a/blockchain/lib.rs b/blockchain/lib.rs index 65280e547255c3228bb250c3c5a987b0d7852eb1..a01dd2df2418c20b6195031e3b977a55e07e3148 100644 --- a/blockchain/lib.rs +++ b/blockchain/lib.rs @@ -34,12 +34,12 @@ extern crate log; extern crate dirs; extern crate duniter_conf; -extern crate duniter_crypto; extern crate duniter_dal; extern crate duniter_documents; extern crate duniter_message; extern crate duniter_module; extern crate duniter_network; +extern crate dup_crypto; extern crate durs_network_documents; extern crate durs_wot; extern crate serde; @@ -62,7 +62,6 @@ use std::time::{Duration, SystemTime, UNIX_EPOCH}; use apply_valid_block::*; use check_and_apply_block::*; pub use dbex::{DBExQuery, DBExTxQuery, DBExWotQuery}; -use duniter_crypto::keys::*; use duniter_dal::block::DALBlock; use duniter_dal::currency_params::CurrencyParameters; use duniter_dal::dal_event::DALEvent; @@ -78,6 +77,7 @@ use duniter_module::*; use duniter_network::{ BlockchainDocument, NetworkBlock, NetworkEvent, NetworkResponse, OldNetworkRequest, }; +use dup_crypto::keys::*; use durs_network_documents::NodeFullId; use durs_wot::data::rusty::RustyWebOfTrust; use durs_wot::operations::distance::RustyDistanceCalculator; diff --git a/blockchain/revert_block.rs b/blockchain/revert_block.rs index 1492efb6ca0f1507e24a1071618775eb5e30bd1d..1f40771a1fdf6ff994904aee5dd738c6870312c8 100644 --- a/blockchain/revert_block.rs +++ b/blockchain/revert_block.rs @@ -13,7 +13,6 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see <https://www.gnu.org/licenses/>. -use duniter_crypto::keys::*; use duniter_dal::block::DALBlock; use duniter_dal::sources::SourceAmount; use duniter_dal::writers::requests::*; @@ -22,6 +21,7 @@ use duniter_dal::{BinDB, ForkId, TxV10Datas}; use duniter_documents::v10::block::TxDocOrTxHash; use duniter_documents::v10::transaction::{TxAmount, TxBase}; use duniter_documents::Document; +use dup_crypto::keys::*; use durs_wot::data::{NewLinkResult, RemLinkResult}; use durs_wot::{NodeId, WebOfTrust}; use std::collections::HashMap; diff --git a/blockchain/sync.rs b/blockchain/sync.rs index 47b68cefc8cc0f58fdfce65188192385717b1108..d6b21b613ff928f9ccfa135af1b6c96d00f93a3b 100644 --- a/blockchain/sync.rs +++ b/blockchain/sync.rs @@ -20,13 +20,13 @@ extern crate threadpool; use self::pbr::ProgressBar; use self::threadpool::ThreadPool; -use duniter_crypto::hashs::Hash; -use duniter_crypto::keys::*; use duniter_dal::currency_params::CurrencyParameters; use duniter_dal::writers::requests::*; use duniter_dal::ForkId; use duniter_documents::{BlockHash, BlockId}; use duniter_network::NetworkBlock; +use dup_crypto::hashs::Hash; +use dup_crypto::keys::*; use durs_wot::NodeId; use std::collections::{HashMap, VecDeque}; use std::fs; diff --git a/blockchain/ts_parsers.rs b/blockchain/ts_parsers.rs index 26e32387f0561bcab5ae62c4824235ae824747a8..b962ba11f2ec2e2d5e0050221649f300f41d1a44 100644 --- a/blockchain/ts_parsers.rs +++ b/blockchain/ts_parsers.rs @@ -16,8 +16,6 @@ extern crate serde_json; extern crate sqlite; -use duniter_crypto::hashs::Hash; -use duniter_crypto::keys::*; use duniter_documents::v10::block::{BlockV10Parameters, TxDocOrTxHash}; use duniter_documents::v10::identity::*; use duniter_documents::v10::membership::*; @@ -27,6 +25,8 @@ use duniter_documents::CurrencyName; use duniter_documents::DocumentBuilder; use duniter_documents::{BlockHash, BlockId, Blockstamp}; use duniter_network::{NetworkBlock, NetworkBlockV10}; +use dup_crypto::hashs::Hash; +use dup_crypto::keys::*; use std::str::FromStr; use sync::BlockHeader; diff --git a/conf/Cargo.toml b/conf/Cargo.toml index d11af79ae5461f8474faa574ae3a87b67b470841..24a426c9bba8b0afcc282a0da20c665b3f33ed72 100644 --- a/conf/Cargo.toml +++ b/conf/Cargo.toml @@ -14,7 +14,7 @@ serde = "1.0.*" serde_derive = "1.0.*" serde_json = "1.0.*" dirs = "1.0.2" -duniter-crypto = { path = "../crypto" } +dup-crypto = { path = "../crypto" } duniter-documents = { path = "../documents" } duniter-module = { path = "../module" } diff --git a/conf/lib.rs b/conf/lib.rs index 5461e8e88f1cc3b6e4cb401347bc3ccd1a41a306..3dc3970fe7099052fb8aa3f8e3f427b8e2c7d567 100644 --- a/conf/lib.rs +++ b/conf/lib.rs @@ -35,14 +35,14 @@ extern crate serde_derive; extern crate serde_json; extern crate dirs; -extern crate duniter_crypto; extern crate duniter_documents; extern crate duniter_module; +extern crate dup_crypto; extern crate rand; extern crate serde; -use duniter_crypto::keys::*; use duniter_documents::CurrencyName; use duniter_module::{DuniterConf, ModuleName, RequiredKeys, RequiredKeysContent}; +use dup_crypto::keys::*; use rand::Rng; use serde::ser::{Serialize, SerializeStruct, Serializer}; use std::collections::HashSet; diff --git a/core/Cargo.toml b/core/Cargo.toml index c811e362203ed761a5d50a51ac18a535304285ab..fe81eec107eab6d1e93c58fece27862c20642a4b 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -12,7 +12,7 @@ path = "lib.rs" dirs = "1.0.2" duniter-blockchain = { path = "../blockchain" } duniter-conf = { path = "../conf" } -duniter-crypto = { path = "../crypto" } +dup-crypto = { path = "../crypto" } duniter-message = { path = "../message" } duniter-module = { path = "../module" } duniter-network = { path = "../network" } diff --git a/core/lib.rs b/core/lib.rs index b79320c6b42c5d95be3e3838a9e4c5a4a052a418..bca1a77c35b1b383dbb3e1491d6d2f2926b69fa4 100644 --- a/core/lib.rs +++ b/core/lib.rs @@ -36,10 +36,10 @@ extern crate structopt; extern crate dirs; extern crate duniter_blockchain; extern crate duniter_conf; -extern crate duniter_crypto; extern crate duniter_message; extern crate duniter_module; extern crate duniter_network; +extern crate dup_crypto; extern crate log_panics; extern crate serde_json; extern crate simplelog; diff --git a/crypto/Cargo.toml b/crypto/Cargo.toml index 1351c4fb2bcdbb74e7f62e2c4176489b0e9bb555..c27aedb01dbb00943f7cdf925ea0052043fdb08c 100644 --- a/crypto/Cargo.toml +++ b/crypto/Cargo.toml @@ -1,21 +1,21 @@ [package] -name = "duniter-crypto" -version = "0.2.0-a0.1" -authors = ["nanocryk <nanocryk@duniter.org>"] -description = "Manage cryptographic building blocks for the Duniter project." +name = "dup-crypto" +version = "0.3.0-b1" +authors = ["nanocryk <nanocryk@duniter.org>", "elois <elois@duniter.org>"] +description = "Manage cryptographic operations for the DUP (DUniter Protocol)." repository = "https://git.duniter.org/nodes/rust/duniter-rs" readme = "README.md" keywords = ["duniter", "keys", "cryptography"] license = "AGPL-3.0" [lib] -path = "lib.rs" +path = "src/lib.rs" [dependencies] base58 = "0.1.*" -base64 = "0.9.*" -bincode = "1.0.1" -rand = "0.4.*" +base64 = "0.10.*" +bincode = "1.0.*" +rand = "0.5.*" rust-crypto = "0.2.*" serde = "1.0.*" serde_derive = "1.0.*" diff --git a/crypto/README.md b/crypto/README.md index 90a53c3c5cea2461dbeed9f0a29c279ae985aea4..889c8c0e0f2456756fc5f6e9b0f0f32fff040130 100644 --- a/crypto/README.md +++ b/crypto/README.md @@ -1,7 +1,7 @@ # crypto -`duniter-crypto` is a crate managing cryptographic building blocks for the Duniter project. +`dup-crypto` is a crate managing cryptographic operations for the DUP (DUniter Protocol). ## How to use it -You can add `duniter-crypto` as a `cargo` dependency in your Rust project. +You can add `dup-crypto` as a `cargo` dependency in your Rust project. diff --git a/crypto/hashs/mod.rs b/crypto/src/hashs/mod.rs similarity index 98% rename from crypto/hashs/mod.rs rename to crypto/src/hashs/mod.rs index d04070dc0bbb33afd4649da4ab4a4c7a3fc50112..da51bdcea51e87d1ec59c3224e0c55a10c0bc813 100644 --- a/crypto/hashs/mod.rs +++ b/crypto/src/hashs/mod.rs @@ -13,7 +13,7 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see <https://www.gnu.org/licenses/>. -//! Provide wrappers for cryptographic building blocks used by Duniter. +//! Provide wrappers for cryptographic hashs use crypto::digest::Digest; use crypto::sha2::Sha256; diff --git a/crypto/keys/bin_signable.rs b/crypto/src/keys/bin_signable.rs similarity index 100% rename from crypto/keys/bin_signable.rs rename to crypto/src/keys/bin_signable.rs diff --git a/crypto/keys/ed25519.rs b/crypto/src/keys/ed25519.rs similarity index 99% rename from crypto/keys/ed25519.rs rename to crypto/src/keys/ed25519.rs index b07e6e6721b677099c2208082e2146b0601d102f..cae348d9d3fa0e51c11db8ff85f7ded4c4b3329f 100644 --- a/crypto/keys/ed25519.rs +++ b/crypto/src/keys/ed25519.rs @@ -118,6 +118,9 @@ impl super::Signature for Signature { Err(DecodeError::InvalidLength) => { Err(BaseConvertionError::InvalidBaseConverterLength()) } + Err(DecodeError::InvalidLastSymbol(pos, byte)) => { + Err(BaseConvertionError::InvalidCharacter(byte as char, pos)) + } } } diff --git a/crypto/keys/mod.rs b/crypto/src/keys/mod.rs similarity index 98% rename from crypto/keys/mod.rs rename to crypto/src/keys/mod.rs index 02eeab5d0e28a917e9a282b061b43824350b34df..46a7ff9dbc5b07ee4ff35413e11fc611b78a8c18 100644 --- a/crypto/keys/mod.rs +++ b/crypto/src/keys/mod.rs @@ -21,8 +21,8 @@ //! # Usage //! //! ``` -//! use duniter_crypto::keys::{Signature, PublicKey, PrivateKey, KeyPair}; -//! use duniter_crypto::keys::ed25519::KeyPairFromSaltedPasswordGenerator; +//! use dup_crypto::keys::{Signature, PublicKey, PrivateKey, KeyPair}; +//! use dup_crypto::keys::ed25519::KeyPairFromSaltedPasswordGenerator; //! //! let generator = KeyPairFromSaltedPasswordGenerator::with_default_parameters(); //! diff --git a/crypto/lib.rs b/crypto/src/lib.rs similarity index 94% rename from crypto/lib.rs rename to crypto/src/lib.rs index c478012c6ae72a63dad28079f775c0bccaf3a2f7..91f02991e123f52cfcb3f577c6666d172641eeca 100644 --- a/crypto/lib.rs +++ b/crypto/src/lib.rs @@ -13,7 +13,7 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see <https://www.gnu.org/licenses/>. -//! Provide wrappers for cryptographic building blocks used by Duniter. +//! Manage cryptographic operations for the DUP (DUniter Protocol). #![cfg_attr(feature = "strict", deny(warnings))] #![deny( diff --git a/dal/Cargo.toml b/dal/Cargo.toml index 9788292a7f38e5e37759e2b9cfc11f120e3fbb7d..dd16c4e68660cdc2f131ee8101145657bc4a0912 100644 --- a/dal/Cargo.toml +++ b/dal/Cargo.toml @@ -9,7 +9,7 @@ license = "AGPL-3.0" path = "lib.rs" [dependencies] -duniter-crypto = { path = "../crypto" } +dup-crypto = { path = "../crypto" } duniter-documents = { path = "../documents" } duniter-module = { path = "../module" } duniter-network = { path = "../network" } diff --git a/dal/block.rs b/dal/block.rs index 2dc072dd9194460311d26988127d36c6cb55f13c..d56c1d5bb72e3129f05a78bdaf62dbad020b6ac7 100644 --- a/dal/block.rs +++ b/dal/block.rs @@ -14,10 +14,10 @@ // along with this program. If not, see <https://www.gnu.org/licenses/>. use super::constants::MAX_FORKS; -use duniter_crypto::keys::*; use duniter_documents::v10::BlockDocument; use duniter_documents::Document; use duniter_documents::{BlockHash, BlockId, Blockstamp, PreviousBlockstamp}; +use dup_crypto::keys::*; use durs_wot::NodeId; use std::collections::HashMap; use *; diff --git a/dal/dal_requests.rs b/dal/dal_requests.rs index 9a3a8604595602ffaea196588eb40540a28dcec7..ae3fc49bd99d3b3e5698f896e0dca41d5004e227 100644 --- a/dal/dal_requests.rs +++ b/dal/dal_requests.rs @@ -17,14 +17,14 @@ extern crate duniter_module; extern crate serde; use self::duniter_module::ModuleReqId; -use duniter_crypto::hashs::Hash; -use duniter_crypto::keys::*; use duniter_documents::v10::block::BlockDocument; use duniter_documents::v10::certification::CertificationDocument; use duniter_documents::v10::identity::IdentityDocument; use duniter_documents::v10::membership::MembershipDocument; use duniter_documents::v10::revocation::RevocationDocument; use duniter_documents::Blockstamp; +use dup_crypto::hashs::Hash; +use dup_crypto::keys::*; use std::collections::HashMap; #[derive(Debug, Copy, Clone)] diff --git a/dal/identity.rs b/dal/identity.rs index 86dad5ac355d5754bde64b7fd585a5e7dffc788a..07134c9a51ca7c6324d2b7ac1ce7c04e8f9111c0 100644 --- a/dal/identity.rs +++ b/dal/identity.rs @@ -14,9 +14,9 @@ // along with this program. If not, see <https://www.gnu.org/licenses/>. use currency_params::CurrencyParameters; -use duniter_crypto::keys::*; use duniter_documents::v10::identity::IdentityDocument; use duniter_documents::{BlockId, Blockstamp}; +use dup_crypto::keys::*; use durs_wot::NodeId; use std::collections::HashMap; use {BinDB, DALError, IdentitiesV10Datas, MsExpirV10Datas}; diff --git a/dal/lib.rs b/dal/lib.rs index 0819c56fe44a4043dcda766833d2112db26264fb..d959250e3844028fa34aa0b83b98676add67b7cd 100644 --- a/dal/lib.rs +++ b/dal/lib.rs @@ -36,8 +36,8 @@ extern crate serde_json; #[macro_use] extern crate serde_derive; -extern crate duniter_crypto; extern crate duniter_documents; +extern crate dup_crypto; extern crate durs_wot; extern crate rustbreak; extern crate serde; @@ -78,12 +78,12 @@ pub mod tools; /// Contains all write databases functions pub mod writers; -use duniter_crypto::hashs::Hash; -use duniter_crypto::keys::*; use duniter_documents::v10::block::BlockV10Parameters; use duniter_documents::v10::transaction::*; use duniter_documents::CurrencyName; use duniter_documents::{BlockHash, BlockId, Blockstamp, PreviousBlockstamp}; +use dup_crypto::hashs::Hash; +use dup_crypto::keys::*; use durs_wot::{NodeId, WebOfTrust}; use rustbreak::backend::{FileBackend, MemoryBackend}; use rustbreak::error::{RustbreakError, RustbreakErrorKind}; diff --git a/dal/parsers/certifications.rs b/dal/parsers/certifications.rs index 378c498bd0245050032edfb7a13f992c63fb92dd..97c5e18b0d1a21eeb9b3a0aa4ecc45f4295852be 100644 --- a/dal/parsers/certifications.rs +++ b/dal/parsers/certifications.rs @@ -13,10 +13,10 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see <https://www.gnu.org/licenses/>. -use duniter_crypto::keys::*; use duniter_documents::v10::certification::{CertificationDocument, CompactCertificationDocument}; use duniter_documents::v10::TextDocumentFormat; use duniter_documents::BlockId; +use dup_crypto::keys::*; use serde_json; /// Parse array of certification json documents into vector of `CompactCertificationDocument` diff --git a/dal/parsers/revoked.rs b/dal/parsers/revoked.rs index 3ad39ccd1126d4d13bca30e27f3e973f6f897774..46d2801e47edc11e6fd4e805cede395afd1a08e7 100644 --- a/dal/parsers/revoked.rs +++ b/dal/parsers/revoked.rs @@ -13,9 +13,9 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see <https://www.gnu.org/licenses/>. -use duniter_crypto::keys::*; use duniter_documents::v10::revocation::{CompactRevocationDocument, RevocationDocument}; use duniter_documents::v10::TextDocumentFormat; +use dup_crypto::keys::*; use serde_json; /// Parse array of revocations json documents into vector of `CompactRevocationDocument` diff --git a/dal/sources.rs b/dal/sources.rs index 8d020059eb31a2927e15478f5c98c339640bd94d..aab5056f7d2c89517839fe63aee01cda285e0487 100644 --- a/dal/sources.rs +++ b/dal/sources.rs @@ -13,13 +13,13 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see <https://www.gnu.org/licenses/>. -extern crate duniter_crypto; extern crate duniter_documents; +extern crate dup_crypto; -use duniter_crypto::hashs::Hash; -use duniter_crypto::keys::PubKey; use duniter_documents::v10::transaction::*; use duniter_documents::BlockId; +use dup_crypto::hashs::Hash; +use dup_crypto::keys::PubKey; use std::cmp::Ordering; use std::ops::{Add, Sub}; diff --git a/dal/writers/certification.rs b/dal/writers/certification.rs index 110212f9defd297d04e54058bb2d5d972aece1a2..327db05e698a267a947bdafa3aa0c704573716f4 100644 --- a/dal/writers/certification.rs +++ b/dal/writers/certification.rs @@ -14,9 +14,9 @@ // along with this program. If not, see <https://www.gnu.org/licenses/>. use currency_params::CurrencyParameters; -use duniter_crypto::keys::*; use duniter_documents::v10::certification::CompactCertificationDocument; use duniter_documents::BlockId; +use dup_crypto::keys::*; use durs_wot::NodeId; use {BinDB, CertsExpirV10Datas, DALError, IdentitiesV10Datas}; diff --git a/dal/writers/dividend.rs b/dal/writers/dividend.rs index 4b2b97a283e93a2556dd025be4b112d3b42ebfa8..f2828d8d4fc222ab9e059d43a5fee37f87d0c8e4 100644 --- a/dal/writers/dividend.rs +++ b/dal/writers/dividend.rs @@ -13,9 +13,9 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see <https://www.gnu.org/licenses/>. -use duniter_crypto::keys::PubKey; use duniter_documents::v10::transaction::*; use duniter_documents::BlockId; +use dup_crypto::keys::PubKey; use sources::SourceAmount; use std::collections::{HashMap, HashSet}; use *; diff --git a/dal/writers/identity.rs b/dal/writers/identity.rs index a491d0060d6446ca315993e16b522f93e2d85508..ebd29fa03764eaa23768d082ed0e5c73f1873908 100644 --- a/dal/writers/identity.rs +++ b/dal/writers/identity.rs @@ -14,10 +14,10 @@ // along with this program. If not, see <https://www.gnu.org/licenses/>. use currency_params::CurrencyParameters; -use duniter_crypto::keys::PubKey; use duniter_documents::v10::identity::IdentityDocument; use duniter_documents::Document; use duniter_documents::{BlockId, Blockstamp}; +use dup_crypto::keys::PubKey; use durs_wot::NodeId; use identity::{DALIdentity, DALIdentityState}; use {BinDB, DALError, IdentitiesV10Datas, MsExpirV10Datas}; diff --git a/dal/writers/requests.rs b/dal/writers/requests.rs index 40422fad8659bc0e1a8403bac869f0e1b12895f4..fe5f84dadf137bbab67f4574cd2b88482979a025 100644 --- a/dal/writers/requests.rs +++ b/dal/writers/requests.rs @@ -15,10 +15,10 @@ use block::DALBlock; use currency_params::CurrencyParameters; -use duniter_crypto::keys::PubKey; use duniter_documents::v10::certification::CompactCertificationDocument; use duniter_documents::v10::identity::IdentityDocument; use duniter_documents::Blockstamp; +use dup_crypto::keys::PubKey; use durs_wot::NodeId; use identity::DALIdentity; use sources::SourceAmount; diff --git a/documents/Cargo.toml b/documents/Cargo.toml index 665682454880e6a8e44731b2451d88b681e3729a..8b887f77d5e098b0b485df066480aeee63315120 100644 --- a/documents/Cargo.toml +++ b/documents/Cargo.toml @@ -15,7 +15,7 @@ path = "src/lib.rs" base58 = "0.1.*" base64 = "0.9.*" byteorder = "1.2.3" -duniter-crypto = { path = "../crypto" } +dup-crypto = { path = "../crypto" } pest = "2.0" pest_derive = "2.0" rust-crypto = "0.2.*" diff --git a/documents/src/lib.rs b/documents/src/lib.rs index cfb6ef31013cec2c07067d6eca4b457a97f41e8c..5202225d080cd4ae825ed655e872d1b0d0a396dc 100644 --- a/documents/src/lib.rs +++ b/documents/src/lib.rs @@ -30,7 +30,7 @@ extern crate base58; extern crate base64; extern crate byteorder; extern crate crypto; -extern crate duniter_crypto; +extern crate dup_crypto; extern crate pest; #[macro_use] extern crate pest_derive; @@ -44,8 +44,8 @@ pub mod v10; use byteorder::{BigEndian, ReadBytesExt, WriteBytesExt}; use currencies_codes::*; -use duniter_crypto::hashs::Hash; -use duniter_crypto::keys::*; +use dup_crypto::hashs::Hash; +use dup_crypto::keys::*; use pest::iterators::Pair; use pest::Parser; use std::cmp::Ordering; diff --git a/documents/src/v10/block.rs b/documents/src/v10/block.rs index 3ef2ad7e75ed420907bca5dad20414ed6877abf7..f9b417d23e89b585ba02eddcf208dc0ec0f59052 100644 --- a/documents/src/v10/block.rs +++ b/documents/src/v10/block.rs @@ -17,8 +17,8 @@ use crypto::digest::Digest; use crypto::sha2::Sha256; -use duniter_crypto::hashs::Hash; -use duniter_crypto::keys::*; +use dup_crypto::hashs::Hash; +use dup_crypto::keys::*; use std::ops::Deref; use blockstamp::Blockstamp; diff --git a/documents/src/v10/certification.rs b/documents/src/v10/certification.rs index bcb9d80164afb08ae995f6790f1f8735c2f20ac5..419b18d18924e81969126b7109fcb98ce2bd05f4 100644 --- a/documents/src/v10/certification.rs +++ b/documents/src/v10/certification.rs @@ -15,7 +15,7 @@ //! Wrappers around Certification documents. -use duniter_crypto::keys::*; +use dup_crypto::keys::*; use pest::Parser; use blockstamp::Blockstamp; @@ -293,7 +293,7 @@ impl TextDocumentParser for CertificationDocumentParser { #[cfg(test)] mod tests { use super::*; - use duniter_crypto::keys::{PrivateKey, PublicKey, Signature}; + use dup_crypto::keys::{PrivateKey, PublicKey, Signature}; use VerificationResult; #[test] diff --git a/documents/src/v10/identity.rs b/documents/src/v10/identity.rs index 83a840bffb354e0edbcd3beeabed5777aca45056..03bef1bee587266a954d24395a169940aee0dc00 100644 --- a/documents/src/v10/identity.rs +++ b/documents/src/v10/identity.rs @@ -264,7 +264,7 @@ impl TextDocumentParser for IdentityDocumentParser { #[cfg(test)] mod tests { use super::*; - use duniter_crypto::keys::{PrivateKey, PublicKey, Signature}; + use dup_crypto::keys::{PrivateKey, PublicKey, Signature}; use {Document, VerificationResult}; #[test] diff --git a/documents/src/v10/membership.rs b/documents/src/v10/membership.rs index ac1a9dcd0b8e8b15b0a46adb2bbfcc18d847523c..66154b79ce81e6964df455c451e73a0dbca76858 100644 --- a/documents/src/v10/membership.rs +++ b/documents/src/v10/membership.rs @@ -15,7 +15,7 @@ //! Wrappers around Membership documents. -use duniter_crypto::keys::*; +use dup_crypto::keys::*; use pest::Parser; use blockstamp::Blockstamp; @@ -320,7 +320,7 @@ impl TextDocumentParser for MembershipDocumentParser { #[cfg(test)] mod tests { use super::*; - use duniter_crypto::keys::{PrivateKey, PublicKey, Signature}; + use dup_crypto::keys::{PrivateKey, PublicKey, Signature}; use VerificationResult; #[test] diff --git a/documents/src/v10/mod.rs b/documents/src/v10/mod.rs index cc2240d15798d1847dc3bc58c27ac05044fef305..6c6653fa7457ccc4829fdbe79ebe9adabb06928d 100644 --- a/documents/src/v10/mod.rs +++ b/documents/src/v10/mod.rs @@ -23,7 +23,7 @@ pub mod revocation; pub mod transaction; use crypto::digest::Digest; -use duniter_crypto::keys::PrivateKey; +use dup_crypto::keys::PrivateKey; use pest::Parser; pub use v10::block::BlockDocument; @@ -274,7 +274,7 @@ mod tests { use super::revocation::RevocationDocumentParser; use super::transaction::TransactionDocumentParser; use super::*; - use duniter_crypto::keys::*; + use dup_crypto::keys::*; // simple text document for signature testing #[derive(Debug, Clone)] diff --git a/documents/src/v10/revocation.rs b/documents/src/v10/revocation.rs index 607a648372bc29cf056e548212edb85cea3745ae..26137d661ec1fa8114861e926e386c3b7e153d82 100644 --- a/documents/src/v10/revocation.rs +++ b/documents/src/v10/revocation.rs @@ -15,7 +15,7 @@ //! Wrappers around Revocation documents. -use duniter_crypto::keys::*; +use dup_crypto::keys::*; use pest::Parser; use blockstamp::Blockstamp; @@ -259,7 +259,7 @@ impl TextDocumentParser for RevocationDocumentParser { #[cfg(test)] mod tests { use super::*; - use duniter_crypto::keys::{PrivateKey, PublicKey, Signature}; + use dup_crypto::keys::{PrivateKey, PublicKey, Signature}; use VerificationResult; #[test] diff --git a/message/Cargo.toml b/message/Cargo.toml index 625bfd375466d13c790d041c990494a73c33e0b4..c6ec17a1bec33c514a1806ed3486c34924e9b00e 100644 --- a/message/Cargo.toml +++ b/message/Cargo.toml @@ -9,7 +9,7 @@ license = "AGPL-3.0" path = "lib.rs" [dependencies] -duniter-crypto = { path = "../crypto" } +dup-crypto = { path = "../crypto" } duniter-dal = { path = "../dal" } duniter-documents = { path = "../documents" } duniter-module = { path = "../module" } diff --git a/message/lib.rs b/message/lib.rs index b30c0fdc2ee24cf3efb116fb3d8a335592d9034f..2e0f2ade4212c08965a140c57d6f6a8173bdfe1a 100644 --- a/message/lib.rs +++ b/message/lib.rs @@ -29,22 +29,22 @@ unused_qualifications )] -extern crate duniter_crypto; extern crate duniter_dal; extern crate duniter_documents; extern crate duniter_module; extern crate duniter_network; +extern crate dup_crypto; extern crate serde; extern crate serde_json; -use duniter_crypto::hashs::Hash; -use duniter_crypto::keys::Sig; use duniter_dal::dal_event::DALEvent; use duniter_dal::dal_requests::{DALRequest, DALResponse}; use duniter_documents::BlockId; use duniter_documents::DUBPDocument; use duniter_module::*; use duniter_network::{NetworkEvent, NetworkResponse, OldNetworkRequest}; +use dup_crypto::hashs::Hash; +use dup_crypto::keys::Sig; #[derive(Debug, Clone)] /// Message exchanged between Durs modules diff --git a/module/Cargo.toml b/module/Cargo.toml index 89d17afb5c1a09de22449253c27b7d618e9d6f6b..97a06dd068e5afcb41f5b081be086f7d35efc519 100644 --- a/module/Cargo.toml +++ b/module/Cargo.toml @@ -9,7 +9,7 @@ license = "AGPL-3.0" path = "lib.rs" [dependencies] -duniter-crypto = { path = "../crypto" } +dup-crypto = { path = "../crypto" } duniter-documents = { path = "../documents" } serde = "1.0.*" serde_derive = "1.0.*" diff --git a/module/lib.rs b/module/lib.rs index e78986c8f9c7d5f8066db3278a25d94b08fed34f..5f0f39ef3047dbff6e6499f6d67bbc6b3dae4dbf 100644 --- a/module/lib.rs +++ b/module/lib.rs @@ -32,14 +32,14 @@ #[macro_use] extern crate serde_derive; -extern crate duniter_crypto; extern crate duniter_documents; +extern crate dup_crypto; extern crate serde; extern crate serde_json; extern crate structopt; -use duniter_crypto::keys::{KeyPair, KeyPairEnum}; use duniter_documents::CurrencyName; +use dup_crypto::keys::{KeyPair, KeyPairEnum}; use serde::de::DeserializeOwned; use serde::ser::{Serialize, Serializer}; use std::collections::HashSet; diff --git a/network-documents/Cargo.toml b/network-documents/Cargo.toml index 49ee5a6c2b693b6195327f7f781299c2ccd3c57a..be4f452368f614bfe47734ded628fd8ac2476cd3 100644 --- a/network-documents/Cargo.toml +++ b/network-documents/Cargo.toml @@ -10,7 +10,7 @@ path = "src/lib.rs" [dependencies] base58 = "0.1.*" -duniter-crypto = { path = "../crypto" } +dup-crypto = { path = "../crypto" } duniter-documents = { path = "../documents" } pest = "2.0" pest_derive = "2.0" diff --git a/network-documents/src/lib.rs b/network-documents/src/lib.rs index 99f1e744fb509fb23ad9f2e9672d56458cc05976..784fac492a0db57fe60cb27519136493d97a5065 100644 --- a/network-documents/src/lib.rs +++ b/network-documents/src/lib.rs @@ -27,8 +27,8 @@ )] extern crate base58; -extern crate duniter_crypto; extern crate duniter_documents; +extern crate dup_crypto; extern crate pest; #[macro_use] extern crate pest_derive; @@ -46,8 +46,8 @@ pub mod network_head_v2; pub mod network_head_v3; pub mod network_peer; -use duniter_crypto::hashs::*; -use duniter_crypto::keys::*; +use dup_crypto::hashs::*; +use dup_crypto::keys::*; use std::fmt::{Display, Error, Formatter}; #[derive(Parser)] diff --git a/network-documents/src/network_endpoint.rs b/network-documents/src/network_endpoint.rs index 2a240ba7cd572e99b3b2afe8f8af4c750b082ab2..62c7feaf40fda5337efe76e60dcb9cd930a9eeb7 100644 --- a/network-documents/src/network_endpoint.rs +++ b/network-documents/src/network_endpoint.rs @@ -15,12 +15,12 @@ //! Module defining the format of network endpoints and how to handle them. -extern crate duniter_crypto; extern crate duniter_documents; +extern crate dup_crypto; extern crate serde; -use duniter_crypto::hashs::Hash; -use duniter_crypto::keys::PubKey; +use dup_crypto::hashs::Hash; +use dup_crypto::keys::PubKey; use pest::Parser; use std::net::{AddrParseError, Ipv4Addr, Ipv6Addr}; use std::num::ParseIntError; diff --git a/network-documents/src/network_head.rs b/network-documents/src/network_head.rs index 9c5d1c023e11170eebcfc2619e7e77719e044d82..5f6d2979299109836ba086004bad7243efd54622 100644 --- a/network-documents/src/network_head.rs +++ b/network-documents/src/network_head.rs @@ -15,8 +15,8 @@ //! Module defining the format of network heads and how to handle them. -use duniter_crypto::keys::*; use duniter_documents::blockstamp::*; +use dup_crypto::keys::*; use network_head_v2::*; use network_head_v3::*; use serde_json; diff --git a/network-documents/src/network_head_v2.rs b/network-documents/src/network_head_v2.rs index bae01eac58023fb905afe5727e23b0e09d1178df..c7f2e524f2c2e0615ccfe501b72626950b628b0c 100644 --- a/network-documents/src/network_head_v2.rs +++ b/network-documents/src/network_head_v2.rs @@ -15,8 +15,8 @@ //! Module defining the format of network heads v2 and how to handle them. -use duniter_crypto::keys::*; use duniter_documents::blockstamp::*; +use dup_crypto::keys::*; use std::cmp::Ordering; use std::num::ParseIntError; use std::ops::Deref; diff --git a/network-documents/src/network_head_v3.rs b/network-documents/src/network_head_v3.rs index 611c9807c808a1253c4bb9428595b97c4d61f2ec..25251ff5334093f41bcf449b13db563c6f62c27e 100644 --- a/network-documents/src/network_head_v3.rs +++ b/network-documents/src/network_head_v3.rs @@ -16,9 +16,9 @@ //! Module defining the format of network heads v3 and how to handle them. use base58::ToBase58; -use duniter_crypto::keys::bin_signable::BinSignable; -use duniter_crypto::keys::*; use duniter_documents::blockstamp::Blockstamp; +use dup_crypto::keys::bin_signable::BinSignable; +use dup_crypto::keys::*; use serde_json; use std::cmp::Ordering; use NodeId; @@ -149,7 +149,7 @@ pub struct JsonHeadV3<'a> { #[cfg(test)] mod tests { use super::*; - use duniter_crypto::keys::bin_signable::BinSignable; + use dup_crypto::keys::bin_signable::BinSignable; use tests::bincode::deserialize; use tests::keypair1; diff --git a/network-documents/src/network_peer.rs b/network-documents/src/network_peer.rs index 556dfe7a2b976fc063854f1caa4012948024daaf..bcd71b161328212b0b05d31fd7d567d8a9393ce0 100644 --- a/network-documents/src/network_peer.rs +++ b/network-documents/src/network_peer.rs @@ -15,14 +15,14 @@ //! Module defining the format of network peer cards and how to handle them. -extern crate duniter_crypto; extern crate duniter_documents; +extern crate dup_crypto; extern crate serde; use base58::ToBase58; -use duniter_crypto::keys::bin_signable::BinSignable; -use duniter_crypto::keys::*; use duniter_documents::{blockstamp::Blockstamp, CurrencyName}; +use dup_crypto::keys::bin_signable::BinSignable; +use dup_crypto::keys::*; use network_endpoint::*; use *; diff --git a/network/Cargo.toml b/network/Cargo.toml index 5aed7a4258467ec832a29405f32a616de67e54f4..42358ae4db29fd3519ee47ab07b4f9d9b3cf8277 100644 --- a/network/Cargo.toml +++ b/network/Cargo.toml @@ -9,7 +9,7 @@ license = "AGPL-3.0" path = "lib.rs" [dependencies] -duniter-crypto = { path = "../crypto" } +dup-crypto = { path = "../crypto" } duniter-documents = { path = "../documents" } duniter-module = { path = "../module" } durs-network-documents = { path = "../network-documents" } @@ -18,7 +18,6 @@ serde_derive = "1.0.*" serde_json = "1.0.*" [dev-dependencies] -pretty_assertions = "0.5.1" [features] # Treat warnings as a build error. diff --git a/network/lib.rs b/network/lib.rs index ebbda957271ea4c5c6a561f29c36cf067d2d4590..36aa7ca1a4b3580e532681eb837f8a9b12a4b358 100644 --- a/network/lib.rs +++ b/network/lib.rs @@ -28,13 +28,10 @@ unused_qualifications )] -extern crate duniter_crypto; extern crate duniter_documents; extern crate duniter_module; +extern crate dup_crypto; extern crate durs_network_documents; -#[cfg(test)] -#[macro_use] -extern crate pretty_assertions; extern crate serde; extern crate serde_json; diff --git a/tui/Cargo.toml b/tui/Cargo.toml index 326a033a93c2d597888c1c66337ccb98f9e7be40..f069ff32b2689e5a9c95e7e35e6bdde1b4ab93c8 100644 --- a/tui/Cargo.toml +++ b/tui/Cargo.toml @@ -10,7 +10,7 @@ path = "lib.rs" [dependencies] duniter-conf = { path = "../conf" } -duniter-crypto = { path = "../crypto" } +dup-crypto = { path = "../crypto" } duniter-dal = { path = "../dal" } duniter-documents = { path = "../documents" } duniter-message = { path = "../message" } diff --git a/tui/lib.rs b/tui/lib.rs index 3c07534453db042d72032e025ac2f16bbd4eaa70..e31369b328cd71f564e393933af6d60b9f05f184 100644 --- a/tui/lib.rs +++ b/tui/lib.rs @@ -37,12 +37,12 @@ extern crate serde_derive; extern crate structopt; extern crate duniter_conf; -extern crate duniter_crypto; extern crate duniter_dal; extern crate duniter_documents; extern crate duniter_message; extern crate duniter_module; extern crate duniter_network; +extern crate dup_crypto; extern crate durs_network_documents; extern crate serde; extern crate serde_json; diff --git a/ws2p-messages/Cargo.toml b/ws2p-messages/Cargo.toml index 0aad533057253d78cb215d56b081d2b3cf634b23..fa0e7d6a3b23e82603a94eecd5ca620991670047 100644 --- a/ws2p-messages/Cargo.toml +++ b/ws2p-messages/Cargo.toml @@ -11,7 +11,7 @@ path = "lib.rs" [dependencies] bincode = "1.0.*" byteorder = "1.2.3" -duniter-crypto = { path = "../crypto" } +dup-crypto = { path = "../crypto" } duniter-documents = { path = "../documents" } durs-network-documents = { path = "../network-documents" } log = "0.4.*" diff --git a/ws2p-messages/lib.rs b/ws2p-messages/lib.rs index 940da6ced6b20e86115465bacf5aec2821f07302..17746468d0b2013b80f42006ccc8056c724b42f3 100644 --- a/ws2p-messages/lib.rs +++ b/ws2p-messages/lib.rs @@ -36,8 +36,8 @@ extern crate serde_derive; extern crate bincode; extern crate byteorder; -extern crate duniter_crypto; extern crate duniter_documents; +extern crate dup_crypto; extern crate durs_network_documents; /// WS2Pv2 Messages @@ -56,10 +56,10 @@ pub enum WS2PMessage { mod tests { use bincode; use bincode::{deserialize, serialize}; - use duniter_crypto::keys::bin_signable::BinSignable; - use duniter_crypto::keys::*; use duniter_documents::v10::certification::*; use duniter_documents::{Blockstamp, CurrencyName}; + use dup_crypto::keys::bin_signable::BinSignable; + use dup_crypto::keys::*; use durs_network_documents::network_endpoint::*; use durs_network_documents::network_peer::*; use durs_network_documents::*; diff --git a/ws2p-messages/v2/connect.rs b/ws2p-messages/v2/connect.rs index 949ec0c1bce29f1f16baa795e98b4548ae5a8403..19426fb017ef69d4c25975b4be488f1428026d03 100644 --- a/ws2p-messages/v2/connect.rs +++ b/ws2p-messages/v2/connect.rs @@ -15,8 +15,8 @@ //use byteorder::{BigEndian, ReadBytesExt, WriteBytesExt}; use super::api_features::WS2PFeatures; -use duniter_crypto::hashs::Hash; use duniter_documents::Blockstamp; +use dup_crypto::hashs::Hash; use durs_network_documents::network_peer::PeerCardV11; /// WS2P v2 connect message min size diff --git a/ws2p-messages/v2/mod.rs b/ws2p-messages/v2/mod.rs index 002d7dd2a3c7479bc686cf06c638f830a677afc3..b0c4aabd9d1a1c1372f4a77aadcd952d96996006 100644 --- a/ws2p-messages/v2/mod.rs +++ b/ws2p-messages/v2/mod.rs @@ -28,10 +28,10 @@ pub mod requests; /// WS2P v2 SECRET_FLAGS Message pub mod secret_flags; -use duniter_crypto::hashs::Hash; -use duniter_crypto::keys::bin_signable::BinSignable; -use duniter_crypto::keys::*; use duniter_documents::CurrencyName; +use dup_crypto::hashs::Hash; +use dup_crypto::keys::bin_signable::BinSignable; +use dup_crypto::keys::*; use durs_network_documents::NodeId; use v2::payload_container::*; diff --git a/ws2p-messages/v2/ok.rs b/ws2p-messages/v2/ok.rs index e480524975988f82afe27642ea6e986f7a02a1e9..8a83a40556b3ddfcb8c7e2cc27882960d1574394 100644 --- a/ws2p-messages/v2/ok.rs +++ b/ws2p-messages/v2/ok.rs @@ -13,8 +13,8 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see <https://www.gnu.org/licenses/>. -use duniter_crypto::hashs::Hash; use duniter_documents::Blockstamp; +use dup_crypto::hashs::Hash; use std::num::NonZeroU16; #[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] diff --git a/ws2p-messages/v2/payload_container.rs b/ws2p-messages/v2/payload_container.rs index eb545044edaef843515fd89172e8eade720c20b7..af62ee4d93eb5a9158bbbffe6d03e80d8ca11cf9 100644 --- a/ws2p-messages/v2/payload_container.rs +++ b/ws2p-messages/v2/payload_container.rs @@ -18,13 +18,13 @@ use super::ok::WS2Pv2OkMsg; use super::req_responses::WS2Pv2ReqRes; use super::requests::WS2Pv2Request; use super::secret_flags::WS2Pv2SecretFlagsMsg; -use duniter_crypto::hashs::Hash; use duniter_documents::v10::block::BlockDocument; use duniter_documents::v10::certification::CertificationDocument; use duniter_documents::v10::identity::IdentityDocument; use duniter_documents::v10::membership::MembershipDocument; use duniter_documents::v10::revocation::RevocationDocument; use duniter_documents::v10::transaction::TransactionDocument; +use dup_crypto::hashs::Hash; use durs_network_documents::network_head_v2::NetworkHeadV2; use durs_network_documents::network_head_v3::NetworkHeadV3Container; use durs_network_documents::network_peer::PeerCardV11; diff --git a/ws2p-messages/v2/req_responses.rs b/ws2p-messages/v2/req_responses.rs index c4010b2f80a3a66aa61ff2c7dab9095e8f0a1279..618234a12691f9fd3da6576ef8fbb115cd9831b3 100644 --- a/ws2p-messages/v2/req_responses.rs +++ b/ws2p-messages/v2/req_responses.rs @@ -13,12 +13,12 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see <https://www.gnu.org/licenses/>. -use duniter_crypto::hashs::Hash; use duniter_documents::v10::block::BlockDocument; use duniter_documents::v10::certification::CompactCertificationDocument; use duniter_documents::v10::identity::CompactIdentityDocument; use duniter_documents::v10::membership::CompactPoolMembershipDoc; use duniter_documents::Blockstamp; +use dup_crypto::hashs::Hash; use std::str; /// WS2Pv2 request response diff --git a/ws2p-messages/v2/secret_flags.rs b/ws2p-messages/v2/secret_flags.rs index ac4b3400d2744c4f96030ec71ce2ba09cc4975ed..058a41ce1de559c8ac7d725cda7465cd65051cbe 100644 --- a/ws2p-messages/v2/secret_flags.rs +++ b/ws2p-messages/v2/secret_flags.rs @@ -13,7 +13,7 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see <https://www.gnu.org/licenses/>. -use duniter_crypto::keys::*; +use dup_crypto::keys::*; #[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] /// WS2Pv2SecretFlags diff --git a/ws2p-v1-legacy/Cargo.toml b/ws2p-v1-legacy/Cargo.toml index 8e41ff446c2798fab0b30bdc45c472a464d3f3e6..0350c5e73c4327cabd96d92c743535f2e86e18ac 100644 --- a/ws2p-v1-legacy/Cargo.toml +++ b/ws2p-v1-legacy/Cargo.toml @@ -11,7 +11,7 @@ path = "lib.rs" [dependencies] byteorder = "1.2.3" duniter-conf = { path = "../conf" } -duniter-crypto = { path = "../crypto" } +dup-crypto = { path = "../crypto" } duniter-dal = { path = "../dal" } duniter-documents = { path = "../documents" } durs-network-documents = { path = "../network-documents" } diff --git a/ws2p-v1-legacy/ack_message.rs b/ws2p-v1-legacy/ack_message.rs index 23ba4fd2ad023a2b24deb4179c53bfb68ad40e06..6214d4a20e5ce2534260958a0f2e8d1d7a1d9c17 100644 --- a/ws2p-v1-legacy/ack_message.rs +++ b/ws2p-v1-legacy/ack_message.rs @@ -1,10 +1,10 @@ -extern crate duniter_crypto; +extern crate dup_crypto; extern crate serde; extern crate serde_json; use self::serde::ser::{Serialize, SerializeStruct, Serializer}; use super::WS2PMessage; -use duniter_crypto::keys::*; +use dup_crypto::keys::*; #[derive(Debug, Clone)] pub struct WS2PAckMessageV1 { diff --git a/ws2p-v1-legacy/connect_message.rs b/ws2p-v1-legacy/connect_message.rs index 30bb53daf3bcbe3f1e4be1d2cbd9aa8407931f21..e957250c8206462e59a9523de392144a598bf812 100644 --- a/ws2p-v1-legacy/connect_message.rs +++ b/ws2p-v1-legacy/connect_message.rs @@ -1,10 +1,10 @@ -extern crate duniter_crypto; +extern crate dup_crypto; extern crate serde; extern crate serde_json; use self::serde::ser::{Serialize, SerializeStruct, Serializer}; use super::WS2PMessage; -use duniter_crypto::keys::*; +use dup_crypto::keys::*; #[derive(Debug, Clone)] pub struct WS2PConnectMessageV1 { diff --git a/ws2p-v1-legacy/datas.rs b/ws2p-v1-legacy/datas.rs index 65952ca35e0b1987f2da7a5013cd13ff352ca3d4..7e2ea17e9b06af9fbc89ec53f53b9564dfcfdf76 100644 --- a/ws2p-v1-legacy/datas.rs +++ b/ws2p-v1-legacy/datas.rs @@ -14,11 +14,11 @@ // along with this program. If not, see <https://www.gnu.org/licenses/>. use constants::*; -use duniter_crypto::keys::*; use duniter_dal::dal_requests::DALRequest; use duniter_documents::Blockstamp; use duniter_message::*; use duniter_network::*; +use dup_crypto::keys::*; use durs_network_documents::network_endpoint::*; use durs_network_documents::network_head::*; use durs_network_documents::*; diff --git a/ws2p-v1-legacy/lib.rs b/ws2p-v1-legacy/lib.rs index 03afbabd1ecb92f9b11573f1850fd349c7fc0092..ad5732f0972755715680100791a71ddbe7fa9088 100644 --- a/ws2p-v1-legacy/lib.rs +++ b/ws2p-v1-legacy/lib.rs @@ -38,12 +38,12 @@ extern crate structopt; extern crate byteorder; extern crate duniter_conf; -extern crate duniter_crypto; extern crate duniter_dal; extern crate duniter_documents; extern crate duniter_message; extern crate duniter_module; extern crate duniter_network; +extern crate dup_crypto; extern crate durs_network_documents; extern crate rand; extern crate sqlite; @@ -66,13 +66,13 @@ use connect_message::WS2PConnectMessageV1; use constants::*; use datas::*; use duniter_conf::DuRsConf; -use duniter_crypto::keys::*; use duniter_dal::dal_event::DALEvent; use duniter_dal::dal_requests::{DALReqBlockchain, DALRequest, DALResBlockchain, DALResponse}; use duniter_documents::Blockstamp; use duniter_message::*; use duniter_module::*; use duniter_network::*; +use dup_crypto::keys::*; use durs_network_documents::network_endpoint::*; use durs_network_documents::network_head::*; use durs_network_documents::*; @@ -919,19 +919,19 @@ impl DuniterModule<DuRsConf, DursMsg> for WS2PModule { #[cfg(test)] mod tests { extern crate duniter_conf; - extern crate duniter_crypto; extern crate duniter_dal; extern crate duniter_documents; extern crate duniter_message; extern crate duniter_module; extern crate duniter_network; + extern crate dup_crypto; use super::parsers::blocks::parse_json_block; use super::*; - use duniter_crypto::keys::PublicKey; use duniter_documents::v10::BlockDocument; use duniter_module::DuniterModule; use duniter_network::NetworkBlock; + use dup_crypto::keys::PublicKey; use std::fs; use std::path::PathBuf; use std::time::{SystemTime, UNIX_EPOCH}; diff --git a/ws2p-v1-legacy/ok_message.rs b/ws2p-v1-legacy/ok_message.rs index e0c5c54ac30b5c1899044420d589714acfa086b1..18986df776dfda94f39f4fca7043fbe7a28c2ecd 100644 --- a/ws2p-v1-legacy/ok_message.rs +++ b/ws2p-v1-legacy/ok_message.rs @@ -1,10 +1,10 @@ -extern crate duniter_crypto; +extern crate dup_crypto; extern crate serde; extern crate serde_json; use self::serde::ser::{Serialize, SerializeStruct, Serializer}; use super::WS2PMessage; -use duniter_crypto::keys::*; +use dup_crypto::keys::*; #[derive(Debug, Clone)] pub struct WS2POkMessageV1 { @@ -28,7 +28,7 @@ impl WS2PMessage for WS2POkMessageV1 { .expect("fail to create default pubkey !"), ); let signature: Option<Sig> = Some(Sig::Ed25519( - duniter_crypto::keys::Signature::from_base64(&signature) + dup_crypto::keys::Signature::from_base64(&signature) .expect("fail to parse signature of OK message !"), )); Some(WS2POkMessageV1 { diff --git a/ws2p-v1-legacy/parsers/blocks.rs b/ws2p-v1-legacy/parsers/blocks.rs index 867e97070e8c0e28493d3154cb75af74596abc7b..099fcb0e9309d2ef2449c13d6ebf5dba5ea4a39f 100644 --- a/ws2p-v1-legacy/parsers/blocks.rs +++ b/ws2p-v1-legacy/parsers/blocks.rs @@ -3,14 +3,14 @@ extern crate serde_json; use super::excluded::parse_exclusions_from_json_value; use super::identities::parse_compact_identity; use super::transactions::parse_transaction; -use duniter_crypto::hashs::Hash; -use duniter_crypto::keys::*; use duniter_documents::v10::block::{BlockV10Parameters, TxDocOrTxHash}; use duniter_documents::v10::membership::*; use duniter_documents::v10::BlockDocument; use duniter_documents::CurrencyName; use duniter_documents::{BlockHash, BlockId}; use duniter_network::{NetworkBlock, NetworkBlockV10}; +use dup_crypto::hashs::Hash; +use dup_crypto::keys::*; use std::str::FromStr; fn parse_previous_hash(block_number: BlockId, source: &serde_json::Value) -> Option<Hash> { diff --git a/ws2p-v1-legacy/parsers/excluded.rs b/ws2p-v1-legacy/parsers/excluded.rs index 645f3bc58321110ce66e05e0f08162f6c16d33c2..b2287a1652c30473db61e8664160dc18f344f0e0 100644 --- a/ws2p-v1-legacy/parsers/excluded.rs +++ b/ws2p-v1-legacy/parsers/excluded.rs @@ -1,8 +1,8 @@ extern crate serde; extern crate serde_json; -use duniter_crypto::keys::ed25519; -use duniter_crypto::keys::*; +use dup_crypto::keys::ed25519; +use dup_crypto::keys::*; pub fn parse_exclusions(json_datas: &str) -> Option<Vec<PubKey>> { let raw_exclusions: serde_json::Value = serde_json::from_str(json_datas).unwrap(); diff --git a/ws2p-v1-legacy/parsers/identities.rs b/ws2p-v1-legacy/parsers/identities.rs index 1d288f6db6b03f9c4dd983ff74d2a4320ed6a7b7..1955b1cf514d362ffdebbd9c0c560b3e21485888 100644 --- a/ws2p-v1-legacy/parsers/identities.rs +++ b/ws2p-v1-legacy/parsers/identities.rs @@ -1,9 +1,9 @@ extern crate serde_json; -use duniter_crypto::keys::*; use duniter_documents::v10::identity::*; use duniter_documents::Blockstamp; use duniter_documents::DocumentBuilder; +use dup_crypto::keys::*; #[derive(Debug, Copy, Clone, PartialEq, Eq)] pub enum IdentityParseError { diff --git a/ws2p-v1-legacy/parsers/memberships.rs b/ws2p-v1-legacy/parsers/memberships.rs index 496a1c4b84ba4cb11960c7d34c9c7f1ee055dd2c..56740278c3a65dd373e602cbee894e6637ced957 100644 --- a/ws2p-v1-legacy/parsers/memberships.rs +++ b/ws2p-v1-legacy/parsers/memberships.rs @@ -1,9 +1,9 @@ extern crate serde_json; -use duniter_crypto::keys::*; use duniter_documents::v10::membership::*; use duniter_documents::Blockstamp; use duniter_documents::DocumentBuilder; +use dup_crypto::keys::*; #[derive(Debug, Copy, Clone, PartialEq, Eq)] pub enum MembershipParseError { diff --git a/ws2p-v1-legacy/parsers/mod.rs b/ws2p-v1-legacy/parsers/mod.rs index fec21d7a728fb1c7714ee5e0c477603fbf996c8d..1925424025923010fb7277f1800574067f14ae90 100644 --- a/ws2p-v1-legacy/parsers/mod.rs +++ b/ws2p-v1-legacy/parsers/mod.rs @@ -22,10 +22,10 @@ pub mod transactions; #[cfg(test)] mod tests { use super::transactions::*; - use duniter_crypto::keys::*; use duniter_documents::v10::transaction::*; use duniter_documents::Blockstamp; use duniter_documents::DocumentBuilder; + use dup_crypto::keys::*; use std::str::FromStr; #[test] diff --git a/ws2p-v1-legacy/parsers/transactions.rs b/ws2p-v1-legacy/parsers/transactions.rs index 5f4b700520caf045f784ebd3e8a49a1e64a1b685..fe1307f5c7453c21e988245d1192379a83f1753b 100644 --- a/ws2p-v1-legacy/parsers/transactions.rs +++ b/ws2p-v1-legacy/parsers/transactions.rs @@ -1,14 +1,14 @@ extern crate serde; extern crate serde_json; -use duniter_crypto::hashs::Hash; -use duniter_crypto::keys::*; use duniter_documents::v10::transaction::{ TransactionDocument, TransactionDocumentBuilder, TransactionInput, TransactionInputUnlocks, TransactionOutput, }; use duniter_documents::Blockstamp; use duniter_documents::DocumentBuilder; +use dup_crypto::hashs::Hash; +use dup_crypto::keys::*; use std::str::FromStr; pub fn parse_transaction( diff --git a/ws2p-v1-legacy/ws2p_connection.rs b/ws2p-v1-legacy/ws2p_connection.rs index a5ff269c408f16614e810c62022c9f69170fadc6..1b66ebb0459bbbaf47d5dc44fdc7c900f310a4c0 100644 --- a/ws2p-v1-legacy/ws2p_connection.rs +++ b/ws2p-v1-legacy/ws2p_connection.rs @@ -1,7 +1,7 @@ use constants::*; -use duniter_crypto::keys::*; use duniter_module::ModuleReqId; use duniter_network::BlockchainDocument; +use dup_crypto::keys::*; use durs_network_documents::network_endpoint::{EndpointEnum, NetworkEndpointApi}; use durs_network_documents::NodeId; use parsers::blocks::parse_json_block; diff --git a/ws2p-v1-legacy/ws2p_db.rs b/ws2p-v1-legacy/ws2p_db.rs index 68386757f74bf70abc81dd87ecf222cc37c8213c..6166fc4abca713608b406aa3bf8928b3e7d13f55 100644 --- a/ws2p-v1-legacy/ws2p_db.rs +++ b/ws2p-v1-legacy/ws2p_db.rs @@ -1,4 +1,4 @@ -use duniter_crypto::keys::*; +use dup_crypto::keys::*; use durs_network_documents::network_endpoint::{EndpointEnum, NetworkEndpointApi}; use sqlite::*; diff --git a/ws2p-v1-legacy/ws2p_requests.rs b/ws2p-v1-legacy/ws2p_requests.rs index 72b988418355e759653d73b74a7e0a95a3a51d67..1568e38a43120138c641b7c912e1c8cccea48f79 100644 --- a/ws2p-v1-legacy/ws2p_requests.rs +++ b/ws2p-v1-legacy/ws2p_requests.rs @@ -1,5 +1,5 @@ -extern crate duniter_crypto; extern crate duniter_network; +extern crate dup_crypto; extern crate serde; extern crate serde_json; diff --git a/ws2p/Cargo.toml b/ws2p/Cargo.toml index 27a970e291ace8032096003a4a17ef593cf047ac..dbd5d5b9ec1b1e5bd01bdbfa9f514c88a96b61ac 100644 --- a/ws2p/Cargo.toml +++ b/ws2p/Cargo.toml @@ -10,7 +10,7 @@ path = "lib.rs" [dependencies] duniter-conf = { path = "../conf" } -duniter-crypto = { path = "../crypto" } +dup-crypto = { path = "../crypto" } durs-network-documents = { path = "../network-documents" } durs-ws2p-messages = { path = "../ws2p-messages" } duniter-message= { path = "../message" } diff --git a/ws2p/lib.rs b/ws2p/lib.rs index bb35611d41bdf96ccd3eafa6f94397f5005dc398..c6c5aadbf08da3b670a8089c015ccadf795ceeaf 100644 --- a/ws2p/lib.rs +++ b/ws2p/lib.rs @@ -35,10 +35,10 @@ extern crate serde_derive; extern crate structopt; extern crate duniter_conf; -extern crate duniter_crypto; extern crate duniter_message; extern crate duniter_module; extern crate duniter_network; +extern crate dup_crypto; extern crate durs_network_documents; extern crate durs_ws2p_messages; @@ -46,10 +46,10 @@ mod constants; use constants::*; use duniter_conf::DuRsConf; -use duniter_crypto::keys::*; use duniter_message::DursMsg; use duniter_module::*; use duniter_network::*; +use dup_crypto::keys::*; use durs_network_documents::network_endpoint::*; use std::sync::mpsc;