From dec5bfba9922c5e7a636a7304039c2e3de11d69a Mon Sep 17 00:00:00 2001 From: librelois <elois@ifee.fr> Date: Thu, 1 Nov 2018 22:35:58 +0100 Subject: [PATCH] [ref] rename duniter-crypto -> dup-crypto --- Cargo.lock | 121 +++++++++++++++------- blockchain/Cargo.toml | 2 +- blockchain/apply_valid_block.rs | 2 +- blockchain/check_and_apply_block.rs | 2 +- blockchain/dbex.rs | 2 +- blockchain/lib.rs | 4 +- blockchain/revert_block.rs | 2 +- blockchain/sync.rs | 4 +- blockchain/ts_parsers.rs | 4 +- conf/Cargo.toml | 2 +- conf/lib.rs | 4 +- core/Cargo.toml | 2 +- core/lib.rs | 2 +- crypto/Cargo.toml | 16 +-- crypto/README.md | 4 +- crypto/{ => src}/hashs/mod.rs | 2 +- crypto/{ => src}/keys/bin_signable.rs | 0 crypto/{ => src}/keys/ed25519.rs | 3 + crypto/{ => src}/keys/mod.rs | 4 +- crypto/{ => src}/lib.rs | 2 +- dal/Cargo.toml | 2 +- dal/block.rs | 2 +- dal/dal_requests.rs | 4 +- dal/identity.rs | 2 +- dal/lib.rs | 6 +- dal/parsers/certifications.rs | 2 +- dal/parsers/revoked.rs | 2 +- dal/sources.rs | 6 +- dal/writers/certification.rs | 2 +- dal/writers/dividend.rs | 2 +- dal/writers/identity.rs | 2 +- dal/writers/requests.rs | 2 +- documents/Cargo.toml | 2 +- documents/src/lib.rs | 6 +- documents/src/v10/block.rs | 4 +- documents/src/v10/certification.rs | 4 +- documents/src/v10/identity.rs | 2 +- documents/src/v10/membership.rs | 4 +- documents/src/v10/mod.rs | 4 +- documents/src/v10/revocation.rs | 4 +- message/Cargo.toml | 2 +- message/lib.rs | 6 +- module/Cargo.toml | 2 +- module/lib.rs | 4 +- network-documents/Cargo.toml | 2 +- network-documents/src/lib.rs | 6 +- network-documents/src/network_endpoint.rs | 6 +- network-documents/src/network_head.rs | 2 +- network-documents/src/network_head_v2.rs | 2 +- network-documents/src/network_head_v3.rs | 6 +- network-documents/src/network_peer.rs | 6 +- network/Cargo.toml | 3 +- network/lib.rs | 5 +- tui/Cargo.toml | 2 +- tui/lib.rs | 2 +- ws2p-messages/Cargo.toml | 2 +- ws2p-messages/lib.rs | 6 +- ws2p-messages/v2/connect.rs | 2 +- ws2p-messages/v2/mod.rs | 6 +- ws2p-messages/v2/ok.rs | 2 +- ws2p-messages/v2/payload_container.rs | 2 +- ws2p-messages/v2/req_responses.rs | 2 +- ws2p-messages/v2/secret_flags.rs | 2 +- ws2p-v1-legacy/Cargo.toml | 2 +- ws2p-v1-legacy/ack_message.rs | 4 +- ws2p-v1-legacy/connect_message.rs | 4 +- ws2p-v1-legacy/datas.rs | 2 +- ws2p-v1-legacy/lib.rs | 8 +- ws2p-v1-legacy/ok_message.rs | 6 +- ws2p-v1-legacy/parsers/blocks.rs | 4 +- ws2p-v1-legacy/parsers/excluded.rs | 4 +- ws2p-v1-legacy/parsers/identities.rs | 2 +- ws2p-v1-legacy/parsers/memberships.rs | 2 +- ws2p-v1-legacy/parsers/mod.rs | 2 +- ws2p-v1-legacy/parsers/transactions.rs | 4 +- ws2p-v1-legacy/ws2p_connection.rs | 2 +- ws2p-v1-legacy/ws2p_db.rs | 2 +- ws2p-v1-legacy/ws2p_requests.rs | 2 +- ws2p/Cargo.toml | 2 +- ws2p/lib.rs | 4 +- 80 files changed, 214 insertions(+), 170 deletions(-) rename crypto/{ => src}/hashs/mod.rs (98%) rename crypto/{ => src}/keys/bin_signable.rs (100%) rename crypto/{ => src}/keys/ed25519.rs (99%) rename crypto/{ => src}/keys/mod.rs (98%) rename crypto/{ => src}/lib.rs (94%) diff --git a/Cargo.lock b/Cargo.lock index 5946f25b..602e10bd 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 321ae132..218ff6b2 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 698ff041..30c255c6 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 8b5b7e35..68481efc 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 5e7736d9..368b8261 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 65280e54..a01dd2df 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 1492efb6..1f40771a 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 47b68cef..d6b21b61 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 26e32387..b962ba11 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 d11af79a..24a426c9 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 5461e8e8..3dc3970f 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 c811e362..fe81eec1 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 b79320c6..bca1a77c 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 1351c4fb..c27aedb0 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 90a53c3c..889c8c0e 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 d04070dc..da51bdce 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 b07e6e67..cae348d9 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 02eeab5d..46a7ff9d 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 c478012c..91f02991 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 9788292a..dd16c4e6 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 2dc072dd..d56c1d5b 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 9a3a8604..ae3fc49b 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 86dad5ac..07134c9a 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 0819c56f..d959250e 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 378c498b..97c5e18b 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 3ad39ccd..46d2801e 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 8d020059..aab5056f 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 110212f9..327db05e 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 4b2b97a2..f2828d8d 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 a491d006..ebd29fa0 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 40422fad..fe5f84da 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 66568245..8b887f77 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 cfb6ef31..5202225d 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 3ef2ad7e..f9b417d2 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 bcb9d801..419b18d1 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 83a840bf..03bef1be 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 ac1a9dcd..66154b79 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 cc2240d1..6c6653fa 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 607a6483..26137d66 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 625bfd37..c6ec17a1 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 b30c0fdc..2e0f2ade 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 89d17afb..97a06dd0 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 e78986c8..5f0f39ef 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 49ee5a6c..be4f4523 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 99f1e744..784fac49 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 2a240ba7..62c7feaf 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 9c5d1c02..5f6d2979 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 bae01eac..c7f2e524 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 611c9807..25251ff5 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 556dfe7a..bcd71b16 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 5aed7a42..42358ae4 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 ebbda957..36aa7ca1 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 326a033a..f069ff32 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 3c075344..e31369b3 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 0aad5330..fa0e7d6a 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 940da6ce..17746468 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 949ec0c1..19426fb0 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 002d7dd2..b0c4aabd 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 e4805249..8a83a405 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 eb545044..af62ee4d 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 c4010b2f..618234a1 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 ac4b3400..058a41ce 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 8e41ff44..0350c5e7 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 23ba4fd2..6214d4a2 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 30bb53da..e957250c 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 65952ca3..7e2ea17e 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 03afbabd..ad5732f0 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 e0c5c54a..18986df7 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 867e9707..099fcb0e 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 645f3bc5..b2287a16 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 1d288f6d..1955b1cf 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 496a1c4b..56740278 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 fec21d7a..19254240 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 5f4b7005..fe1307f5 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 a5ff269c..1b66ebb0 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 68386757..6166fc4a 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 72b98841..1568e38a 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 27a970e2..dbd5d5b9 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 bb35611d..c6c5aadb 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; -- GitLab