Skip to content

Commit

Permalink
Merge pull request #46 from WeBankBlockchain/release-1.5.0
Browse files Browse the repository at this point in the history
Release 1.5.0
  • Loading branch information
HaoXuan40404 authored Sep 29, 2021
2 parents 3a0d414 + 92c1562 commit 6bdf3c1
Show file tree
Hide file tree
Showing 32 changed files with 6,822 additions and 76 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Rust
name: Default-Test

on:
push:
Expand All @@ -14,6 +14,6 @@ jobs:
- name: Nightly default
run: rustup default nightly
- name: Build
run: cargo build --verbose
run: cargo build --all --all-targets --verbose
- name: Run tests
run: cargo test --verbose
2 changes: 1 addition & 1 deletion .rustfmt.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ format_strings = true
indent_style = "Block"
match_block_trailing_comma = true
max_width = 80
merge_imports = true
imports_granularity = "Crate"
normalize_comments = true
normalize_doc_attributes = true
overflow_delimited_expr = true
Expand Down
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ members = [
"solution/key_tool_box/hierarchical_deterministic_key",
"solution/selective_certificate_disclosure",
"solution/verifiable_confidential_ledger",
"solution/anonymous_ciphertext_voting",
]
13 changes: 7 additions & 6 deletions bounty/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,18 @@ edition = "2018"
colored = "1.8"
curve25519-dalek = { version = "1", features = [ "serde" ] }
protobuf = "2.22.1"
sha3 = "0.8"
rand = "0.3.17"
sha3 = "0.8"
wedpr_l_crypto_zkp_discrete_logarithm_proof = "1.0.0"
wedpr_l_crypto_zkp_range_proof = { git = "https://github.com/WeBankBlockchain/WeDPR-Lab-Crypto", branch = "main" }
wedpr_l_crypto_zkp_range_proof = "1.2.0"
wedpr_l_crypto_zkp_utils = "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 = { path = "../solution/verifiable_confidential_ledger"}
wedpr_s_selective_certificate_disclosure = "1.3.0"
wedpr_s_protos = { path = "../protos" }
wedpr_s_selective_certificate_disclosure = { path = "../solution/selective_certificate_disclosure" }

wedpr_s_verifiable_confidential_ledger = { path = "../solution/verifiable_confidential_ledger" }

[dev-dependencies]
wedpr_l_common_coder_base64 = "1.0.0"
7 changes: 3 additions & 4 deletions ffi/ffi_c/ffi_c_ktb/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,12 @@ crate-type = [ "cdylib", "staticlib" ]
[dependencies]
libc = "0.2.60"
protobuf = "2.22.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"

wedpr_s_hierarchical_deterministic_key = { path = "../../../solution/key_tool_box/hierarchical_deterministic_key" }
wedpr_s_protos = { path = "../../../protos" }

# This is required to generate C/C++ header files.
[build-dependencies]
cbindgen = "0.9.0"
cbindgen = "0.9.0"
4 changes: 2 additions & 2 deletions ffi/ffi_c/ffi_c_scd/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ crate-type = [ "cdylib", "staticlib" ]
[dependencies]
libc = "0.2.60"
protobuf = "2.22.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"
wedpr_s_protos = { path = "../../../protos" }
wedpr_s_selective_certificate_disclosure = { path = "../../../solution/selective_certificate_disclosure" }

# This is required to generate C/C++ header files.
[build-dependencies]
Expand Down
6 changes: 3 additions & 3 deletions ffi/ffi_c/ffi_c_vcl/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ crate-type = [ "cdylib", "staticlib" ]
[dependencies]
libc = "0.2.60"
protobuf = "2.22.1"
wedpr_s_verifiable_confidential_ledger = { path = "../../../solution/verifiable_confidential_ledger"}
wedpr_ffi_common = "1.0.0"
wedpr_ffi_macros = "1.1.0"
wedpr_s_protos = { path = "../../../protos"}
wedpr_l_protos = "1.1.0"
wedpr_l_macros = "1.0.0"
wedpr_l_protos = "1.1.0"
wedpr_s_protos = { path = "../../../protos" }
wedpr_s_verifiable_confidential_ledger = { path = "../../../solution/verifiable_confidential_ledger" }

# This is required to generate C/C++ header files.
[build-dependencies]
Expand Down
7 changes: 4 additions & 3 deletions ffi/ffi_java/ffi_java_ktb/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@ crate-type = [ "cdylib", "staticlib" ]
[dependencies]
jni = "0.13.0"
protobuf = "2.22.1"
wedpr_s_hierarchical_deterministic_key = "1.3.0"
wedpr_ffi_common = "1.1.0"
wedpr_ffi_macros = "1.1.0"
wedpr_s_protos = "1.3.0"
wedpr_s_hierarchical_deterministic_key = { path = "../../../solution/key_tool_box/hierarchical_deterministic_key" }
wedpr_s_protos = { path = "../../../protos" }

# This is required to generate C/C++ header files.
[build-dependencies]
cbindgen = "0.9.0"

[target.'cfg(target_os = "android")'.dependencies]
jni = { version = "0.13.1", default-features = false }
jni = { version = "0.13.1", default-features = false }
6 changes: 4 additions & 2 deletions ffi/ffi_java/ffi_java_scd/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@ crate-type = [ "cdylib" ]
[dependencies]
jni = "0.13.0"
protobuf = "2.22.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"

wedpr_s_protos = { path = "../../../protos" }
wedpr_s_selective_certificate_disclosure = { path = "../../../solution/selective_certificate_disclosure" }

# This is required to generate C/C++ header files.
[build-dependencies]
cbindgen = "0.9.0"

Expand Down
8 changes: 5 additions & 3 deletions ffi/ffi_java/ffi_java_vcl/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@ crate-type = [ "cdylib", "staticlib" ]
[dependencies]
jni = "0.13.0"
protobuf = "2.22.1"
wedpr_s_verifiable_confidential_ledger = { path = "../../../solution/verifiable_confidential_ledger"}
wedpr_ffi_common = "1.1.0"
wedpr_ffi_macros = "1.1.0"
wedpr_s_protos = { path = "../../../protos"}
wedpr_l_protos = "1.1.0"
wedpr_l_protos = "1.1.0"

wedpr_s_protos = { path = "../../../protos" }
wedpr_s_verifiable_confidential_ledger = { path = "../../../solution/verifiable_confidential_ledger" }

# This is required to generate C/C++ header files.
[build-dependencies]
cbindgen = "0.9.0"

Expand Down
3 changes: 1 addition & 2 deletions protos/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "wedpr_s_protos"
version = "1.4.0"
version = "1.5.0"
authors = [ "WeDPR <[email protected]>" ]
edition = "2018"
license = "Apache-2.0"
Expand All @@ -11,4 +11,3 @@ description = "Library of WeDPR protobuf definitions and their generated code."
[dependencies]
protobuf = "2.22.1"
protoc-rust = "2.22.1"

137 changes: 137 additions & 0 deletions protos/solution/acv/acv.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
// Copyright 2021 WeDPR Lab Project Authors. Licensed under Apache-2.0.

syntax = "proto3";

package com.webank.wedpr.acv.proto;
option java_package = "com.webank.wedpr.acv.proto";
option java_multiple_files = true;

// Candidate list.
message CandidateList {
repeated string candidate = 1;
}

// Shared system parameters to initialize a poll.
message PollParametersStorage {
bytes poll_point = 1;
CandidateList candidates = 2;
}

// Secret of a counter.
message CounterSecret {
bytes poll_secret_share = 1;
}

// Secret of a voter.
message VoterSecret {
bytes voter_secret = 1;
}

// Request of registering a voter.
message RegistrationRequest {
RegistrationBlindingPoint weight_point = 1;
}

// Blinding points for a voter registration.
message RegistrationBlindingPoint {
bytes blinding_poll_point = 1;
bytes blinding_basepoint_g2 = 2;
}

// Response of voter registration.
message RegistrationResponse {
uint32 voter_weight = 1;
Ballot ballot = 2;
bytes signature = 3;
}

// Ciphertext ballot.
message Ballot {
bytes ciphertext1 = 1;
bytes ciphertext2 = 2;
}

// Request of aggregating a part of system parameters from a counter.
message CounterParametersShareRequest {
string counter_id = 1;
bytes poll_point_share = 2;
}

// Shared system parameters to initialize a group of counters.
message CounterParametersStorage {
repeated CounterParametersShareRequest counter_parameters_share = 1;
}

// Vote choice for a candidate.
message VoteChoice {
string candidate = 1;
uint32 value = 2;
}

// Choice list for all candidates.
message VoteChoices {
repeated VoteChoice choice = 1;
}

// Ciphertext ballot for a candidate.
message CandidateBallot {
string candidate = 1;
Ballot ballot = 2;
}

// ZKP data to verify the format of ciphertext ballot.
message BallotProof {
bytes format_proof = 1;
}

// Pair of string (candidate id) and BallotProof.
message StringToBallotProofPair {
string key = 1;
BallotProof value = 2;
}

// Request of voting for all candidates.
message VoteRequest {
VoteStorage vote = 1;
repeated StringToBallotProofPair ballot_proof = 2;
bytes range_proof = 3;
bytes sum_balance_proof = 4;
}

// Ciphertext ballot for all candidates.
message VoteStorage {
bytes signature = 1;
Ballot blank_ballot = 2;
Ballot rest_ballot = 3;
repeated CandidateBallot voted_ballot = 4;
}

// Partially decrypted ballot and associated ZKP data for a candidate.
message CountingPart {
string counter_id = 1;
bytes blinding_c2 = 2;
bytes equality_proof = 3;
}

// Pair of string (candidate id) and CountingPart.
message StringToCountingPartPair {
string key = 1;
CountingPart value = 2;
}

// Partially decrypted ballots and associated ZKP data for a poll.
message DecryptedResultPartStorage {
CountingPart blank_part = 1;
repeated StringToCountingPartPair candidate_part = 2;
}

// Fully decrypted result of a poll.
message VoteResultStorage {
repeated StringToInt64Pair result = 1;
}

// Pair of string (candidate id) and number.
message StringToInt64Pair {
string key = 1;
int64 value = 2;
}
Loading

0 comments on commit 6bdf3c1

Please sign in to comment.