From d43b4069085e9e089f319fb910a91433fd78770e Mon Sep 17 00:00:00 2001 From: HaoXuan40404 <444649358@qq.com> Date: Tue, 2 Feb 2021 15:35:46 +0800 Subject: [PATCH] updater version to 1.3.0 --- bounty/Cargo.toml | 20 +++++++++---------- ffi/ffi_c/ffi_c_ktb/Cargo.toml | 10 +++++----- ffi/ffi_c/ffi_c_scd/Cargo.toml | 10 +++++----- ffi/ffi_c/ffi_c_vcl/Cargo.toml | 12 +++++------ ffi/ffi_java/ffi_java_ktb/Cargo.toml | 8 ++++---- ffi/ffi_java/ffi_java_ktb/README.md | 8 ++++++++ ffi/ffi_java/ffi_java_scd/Cargo.toml | 10 +++++----- ffi/ffi_java/ffi_java_vcl/Cargo.toml | 10 +++++----- .../hierarchical_deterministic_key/Cargo.toml | 13 ++++++------ .../hierarchical_deterministic_key/src/hdk.rs | 17 ++++++++++++---- .../Cargo.toml | 8 ++++---- .../verifiable_confidential_ledger/Cargo.toml | 16 +++++++-------- 12 files changed, 80 insertions(+), 62 deletions(-) diff --git a/bounty/Cargo.toml b/bounty/Cargo.toml index 7fdec3d..34d0191 100644 --- a/bounty/Cargo.toml +++ b/bounty/Cargo.toml @@ -12,15 +12,15 @@ curve25519-dalek = { version = "1", features = [ "serde" ] } protobuf = "2.20.0" sha3 = "0.8" rand = "0.3.17" -wedpr_l_crypto_zkp_discrete_logarithm_proof = "0.0.1" -wedpr_l_crypto_zkp_range_proof = "0.0.1" -wedpr_l_macros = "0.0.1" -wedpr_s_protos = { path = "../protos", version = "1.3.0"} -wedpr_l_protos = "0.0.1" -wedpr_l_utils = "0.0.1" -wedpr_l_crypto_zkp_utils = "0.0.1" -wedpr_s_verifiable_confidential_ledger = { path = "../solution/verifiable_confidential_ledger" } -wedpr_s_selective_certificate_disclosure = { path = "../solution/selective_certificate_disclosure" } +wedpr_l_crypto_zkp_discrete_logarithm_proof = "1.0.0" +wedpr_l_crypto_zkp_range_proof = "1.0.0" +wedpr_l_macros = "1.0.0" +wedpr_s_protos = "1.3.0" +wedpr_l_protos = "1.0.0" +wedpr_l_utils = "1.0.0" +wedpr_l_crypto_zkp_utils = "1.0.0" +wedpr_s_verifiable_confidential_ledger = "1.3.0" +wedpr_s_selective_certificate_disclosure = "1.3.0" [dev-dependencies] -wedpr_l_common_coder_base64 = "0.0.1" +wedpr_l_common_coder_base64 = "1.0.0" diff --git a/ffi/ffi_c/ffi_c_ktb/Cargo.toml b/ffi/ffi_c/ffi_c_ktb/Cargo.toml index 95c4ab6..6eb21cf 100644 --- a/ffi/ffi_c/ffi_c_ktb/Cargo.toml +++ b/ffi/ffi_c/ffi_c_ktb/Cargo.toml @@ -13,11 +13,11 @@ crate-type = [ "cdylib", "staticlib" ] [dependencies] libc = "0.2.60" protobuf = "2.20.0" -wedpr_s_hierarchical_deterministic_key = { path = "../../../solution/key_tool_box/hierarchical_deterministic_key" } -wedpr_ffi_common = "0.0.1" -wedpr_ffi_macros = "0.0.1" -wedpr_s_protos = { path = "../../../protos/" } -wedpr_l_macros = "0.0.1" +wedpr_s_hierarchical_deterministic_key = "1.3.0" +wedpr_ffi_common = "1.0.0" +wedpr_ffi_macros = "1.0.0" +wedpr_s_protos = "1.3.0" +wedpr_l_macros = "1.0.0" # This is required to generate C/C++ header files. diff --git a/ffi/ffi_c/ffi_c_scd/Cargo.toml b/ffi/ffi_c/ffi_c_scd/Cargo.toml index 18364c1..c906e5b 100644 --- a/ffi/ffi_c/ffi_c_scd/Cargo.toml +++ b/ffi/ffi_c/ffi_c_scd/Cargo.toml @@ -13,11 +13,11 @@ crate-type = [ "cdylib", "staticlib" ] [dependencies] libc = "0.2.60" protobuf = "2.20.0" -wedpr_s_selective_certificate_disclosure = { path = "../../../solution/selective_certificate_disclosure" } -wedpr_ffi_common = "0.0.1" -wedpr_ffi_macros = "0.0.1" -wedpr_s_protos = { path = "../../../protos/" } -wedpr_l_macros = "0.0.1" +wedpr_s_selective_certificate_disclosure = "1.3.0" +wedpr_ffi_common = "1.0.0" +wedpr_ffi_macros = "1.0.0" +wedpr_s_protos = "1.3.0" +wedpr_l_macros = "1.0.0" # This is required to generate C/C++ header files. [build-dependencies] diff --git a/ffi/ffi_c/ffi_c_vcl/Cargo.toml b/ffi/ffi_c/ffi_c_vcl/Cargo.toml index 7339f1e..3c0eb12 100644 --- a/ffi/ffi_c/ffi_c_vcl/Cargo.toml +++ b/ffi/ffi_c/ffi_c_vcl/Cargo.toml @@ -13,12 +13,12 @@ crate-type = [ "cdylib", "staticlib" ] [dependencies] libc = "0.2.60" protobuf = "2.20.0" -wedpr_s_verifiable_confidential_ledger = { path = "../../../solution/verifiable_confidential_ledger" } -wedpr_ffi_common = "0.0.1" -wedpr_ffi_macros = "0.0.1" -wedpr_s_protos = { path = "../../../protos/" } -wedpr_l_protos = "0.0.1" -wedpr_l_macros = "0.0.1" +wedpr_s_verifiable_confidential_ledger = "1.3.0" +wedpr_ffi_common = "1.0.0" +wedpr_ffi_macros = "1.0.0" +wedpr_s_protos = "1.3.0" +wedpr_l_protos = "1.0.0" +wedpr_l_macros = "1.0.0" # This is required to generate C/C++ header files. [build-dependencies] diff --git a/ffi/ffi_java/ffi_java_ktb/Cargo.toml b/ffi/ffi_java/ffi_java_ktb/Cargo.toml index d5ca92f..71eaa96 100644 --- a/ffi/ffi_java/ffi_java_ktb/Cargo.toml +++ b/ffi/ffi_java/ffi_java_ktb/Cargo.toml @@ -13,10 +13,10 @@ crate-type = [ "cdylib", "staticlib" ] [dependencies] jni = "0.13.0" protobuf = "2.20.0" -wedpr_s_hierarchical_deterministic_key = { path = "../../../solution/key_tool_box/hierarchical_deterministic_key" } -wedpr_ffi_common = "0.0.1" -wedpr_ffi_macros = "0.0.1" -wedpr_s_protos = { path = "../../../protos/" } +wedpr_s_hierarchical_deterministic_key = "1.3.0" +wedpr_ffi_common = "1.0.0" +wedpr_ffi_macros = "1.0.0" +wedpr_s_protos = "1.3.0" [build-dependencies] cbindgen = "0.9.0" diff --git a/ffi/ffi_java/ffi_java_ktb/README.md b/ffi/ffi_java/ffi_java_ktb/README.md index 50dcd6f..5435e69 100644 --- a/ffi/ffi_java/ffi_java_ktb/README.md +++ b/ffi/ffi_java/ffi_java_ktb/README.md @@ -13,4 +13,12 @@ public class HdkResult extends WedprResult { public String extendedPrivateKey; public String extendedPublicKey; } +``` + +```java +public class NativeInterface { + public static native HdkResult createMnemonicEn(String word_count); + public static native HdkResult createMasterKeyEn(String password, String mnemonic); + public static native HdkResult deriveExtendedKey(String master_key, int purpose_type, int asset_type, int account, int change, int address_index); +} ``` \ No newline at end of file diff --git a/ffi/ffi_java/ffi_java_scd/Cargo.toml b/ffi/ffi_java/ffi_java_scd/Cargo.toml index 66775a4..f3a3c93 100644 --- a/ffi/ffi_java/ffi_java_scd/Cargo.toml +++ b/ffi/ffi_java/ffi_java_scd/Cargo.toml @@ -12,11 +12,11 @@ crate-type = [ "cdylib" ] [dependencies] jni = "0.13.0" protobuf = "2.20.0" -wedpr_s_selective_certificate_disclosure = { path = "../../../solution/selective_certificate_disclosure" } -wedpr_ffi_common = "0.0.1" -wedpr_ffi_macros = "0.0.1" -wedpr_s_protos = { path = "../../../protos/" } -wedpr_l_protos = "0.0.1" +wedpr_s_selective_certificate_disclosure = "1.3.0" +wedpr_ffi_common = "1.0.0" +wedpr_ffi_macros = "1.0.0" +wedpr_s_protos = "1.3.0" +wedpr_l_protos = "1.0.0" [build-dependencies] cbindgen = "0.9.0" diff --git a/ffi/ffi_java/ffi_java_vcl/Cargo.toml b/ffi/ffi_java/ffi_java_vcl/Cargo.toml index e4738b3..ae39b58 100644 --- a/ffi/ffi_java/ffi_java_vcl/Cargo.toml +++ b/ffi/ffi_java/ffi_java_vcl/Cargo.toml @@ -13,11 +13,11 @@ crate-type = [ "cdylib", "staticlib" ] [dependencies] jni = "0.13.0" protobuf = "2.20.0" -wedpr_s_verifiable_confidential_ledger = { path = "../../../solution/verifiable_confidential_ledger" } -wedpr_ffi_common = "0.0.1" -wedpr_ffi_macros = "0.0.1" -wedpr_s_protos = { path = "../../../protos/" } -wedpr_l_protos = "0.0.1" +wedpr_s_verifiable_confidential_ledger = "1.3.0" +wedpr_ffi_common = "1.0.0" +wedpr_ffi_macros = "1.0.0" +wedpr_s_protos = "1.3.0" +wedpr_l_protos = "1.0.0" [build-dependencies] cbindgen = "0.9.0" diff --git a/solution/key_tool_box/hierarchical_deterministic_key/Cargo.toml b/solution/key_tool_box/hierarchical_deterministic_key/Cargo.toml index 26cc680..94a7539 100644 --- a/solution/key_tool_box/hierarchical_deterministic_key/Cargo.toml +++ b/solution/key_tool_box/hierarchical_deterministic_key/Cargo.toml @@ -13,11 +13,12 @@ hex = "0.3" rand = "0.7" wagyu_lib = { package = "wagyu-bitcoin", version = "0.6.3" } wagyu-model = "0.6.3" -wedpr_l_macros = "0.0.1" -wedpr_s_protos = { path = "../../../protos", version = "1.3.0"} -wedpr_l_utils = "0.0.1" +wedpr_l_macros = "1.0.0" +wedpr_s_protos = "1.3.0" +wedpr_l_utils = "1.0.0" [dev-dependencies] -wedpr_l_crypto_ecies_secp256k1 = "0.0.1" -wedpr_l_crypto_signature_secp256k1 = "0.0.1" -wedpr_l_crypto_hash_keccak256 = "0.0.1" +wedpr_l_crypto_ecies_secp256k1 = "1.0.0" +wedpr_l_crypto_signature_secp256k1 = "1.0.0" +wedpr_l_crypto_hash_keccak256 = "1.0.0" +wedpr_l_common_coder_base64 = "1.0.0" diff --git a/solution/key_tool_box/hierarchical_deterministic_key/src/hdk.rs b/solution/key_tool_box/hierarchical_deterministic_key/src/hdk.rs index 3836b12..87c8e00 100644 --- a/solution/key_tool_box/hierarchical_deterministic_key/src/hdk.rs +++ b/solution/key_tool_box/hierarchical_deterministic_key/src/hdk.rs @@ -182,22 +182,31 @@ mod tests { use wedpr_l_crypto_ecies_secp256k1::WedprSecp256k1Ecies; use wedpr_l_crypto_hash_keccak256::WedprKeccak256; use wedpr_l_crypto_signature_secp256k1::WedprSecp256k1Recover; - use wedpr_l_utils::traits::{Ecies, Hash, Signature}; + use wedpr_l_utils::traits::{Ecies, Hash, Signature, Coder}; + use wedpr_l_common_coder_base64::WedprBase64; #[test] fn test_hdk_usage() { // Create a master key. - let mnemonic = create_mnemonic_en(24).unwrap(); - let password = "DO NOT USE REAL PASSWORD HERE"; + // let mnemonic = create_mnemonic_en(24).unwrap(); + let mnemonic = "engage wagon riot toe odor metal palm donor trumpet slight exercise taste burst sense smile curtain cheese sketch unable token suggest lab rain dolphin"; + // let password = "DO NOT USE REAL PASSWORD HERE"; + let password = "wi_wallet"; + let master_key = create_master_key_en(password, &mnemonic).unwrap(); + let coder = WedprBase64::default(); + println!("master_key = {:?}", coder.encode(&master_key)); // Derive an extended key. - let key_derivation_path = create_key_derivation_path(44, 1, 1, 1, 0); + let key_derivation_path = create_key_derivation_path(44, 513866, 1, 0, 1000); let extended_key = derive_extended_key(&master_key, &key_derivation_path).unwrap(); let private_key = extended_key.get_extended_private_key(); let public_key = extended_key.get_extended_public_key(); + println!("private_key = {:?}", hex::encode(private_key)); + println!("public_key = {:?}", hex::encode(public_key)); + // Test the derived key pair for signature functions. let message = "WeDPR TEST"; let hash = WedprKeccak256::default(); diff --git a/solution/selective_certificate_disclosure/Cargo.toml b/solution/selective_certificate_disclosure/Cargo.toml index ff2ceba..39fd75d 100644 --- a/solution/selective_certificate_disclosure/Cargo.toml +++ b/solution/selective_certificate_disclosure/Cargo.toml @@ -14,10 +14,10 @@ wedpr-indy-crypto = "0.4.5" protobuf = "2.20.0" serde = "1.0.102" serde_json = "1.0.41" -wedpr_l_macros = "0.0.1" -wedpr_s_protos = { path = "../../protos", version = "1.3.0"} -wedpr_l_utils = "0.0.1" -#wedpr_l_common_coder_base64 = {version = "0.0.1", optional = true} +wedpr_l_macros = "1.0.0" +wedpr_s_protos = "1.3.0" +wedpr_l_utils = "1.0.0" +#wedpr_l_common_coder_base64 = {version = "1.0.0", optional = true} [dev-dependencies] criterion = "0.2" diff --git a/solution/verifiable_confidential_ledger/Cargo.toml b/solution/verifiable_confidential_ledger/Cargo.toml index 7ced479..764ecaf 100644 --- a/solution/verifiable_confidential_ledger/Cargo.toml +++ b/solution/verifiable_confidential_ledger/Cargo.toml @@ -11,20 +11,20 @@ description = "Library of verifiable confidential ledger (VCL) solution." [dependencies] colored = "1.8" curve25519-dalek = { version = "1", features = [ "serde" ] } -wedpr_l_macros = "0.0.1" -wedpr_s_protos = { path = "../../protos", version = "1.3.0"} -wedpr_l_protos = "0.0.1" -wedpr_l_utils = "0.0.1" -wedpr_l_crypto_zkp_discrete_logarithm_proof = "0.0.1" -wedpr_l_crypto_zkp_range_proof = "0.0.1" -wedpr_l_crypto_zkp_utils = "0.0.1" +wedpr_l_macros = "1.0.0" +wedpr_s_protos = "1.3.0" +wedpr_l_protos = "1.0.0" +wedpr_l_utils = "1.0.0" +wedpr_l_crypto_zkp_discrete_logarithm_proof = "1.0.0" +wedpr_l_crypto_zkp_range_proof = "1.0.0" +wedpr_l_crypto_zkp_utils = "1.0.0" protobuf = "2.20.0" #protoc-rust = "2.20.0" [dev-dependencies] criterion = "0.2" -wedpr_l_common_coder_base64 = "0.0.1" +wedpr_l_common_coder_base64 = "1.0.0" [[bench]] name = "vcl"