Skip to content

Commit 8257439

Browse files
julyawangHaoXuan40404
authored andcommitted
fix comment
1 parent a739e30 commit 8257439

File tree

22 files changed

+234
-188
lines changed

22 files changed

+234
-188
lines changed

bounty/Cargo.toml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,18 @@ edition = "2018"
1010
colored = "1.8"
1111
curve25519-dalek = { version = "1", features = [ "serde" ] }
1212
protobuf = "2.22.1"
13-
sha3 = "0.8"
1413
rand = "0.3.17"
14+
sha3 = "0.8"
1515
wedpr_l_crypto_zkp_discrete_logarithm_proof = "1.0.0"
16-
wedpr_l_crypto_zkp_range_proof = { git = "https://github.com/WeBankBlockchain/WeDPR-Lab-Crypto", branch = "main" }
16+
wedpr_l_crypto_zkp_range_proof = { git = "https://github.com/WeBankBlockchain/WeDPR-Lab-Crypto", branch = "main" }
17+
wedpr_l_crypto_zkp_utils = "1.0.0"
1718
wedpr_l_macros = "1.0.0"
18-
wedpr_s_protos = "1.3.0"
1919
wedpr_l_protos = "1.0.0"
2020
wedpr_l_utils = "1.0.0"
21-
wedpr_l_crypto_zkp_utils = "1.0.0"
22-
wedpr_s_verifiable_confidential_ledger = { path = "../solution/verifiable_confidential_ledger"}
21+
wedpr_s_protos = "1.3.0"
2322
wedpr_s_selective_certificate_disclosure = "1.3.0"
2423

24+
wedpr_s_verifiable_confidential_ledger = { path = "../solution/verifiable_confidential_ledger" }
25+
2526
[dev-dependencies]
2627
wedpr_l_common_coder_base64 = "1.0.0"

ffi/ffi_c/ffi_c_ktb/Cargo.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,14 @@ crate-type = [ "cdylib", "staticlib" ]
1313
[dependencies]
1414
libc = "0.2.60"
1515
protobuf = "2.22.1"
16-
wedpr_s_hierarchical_deterministic_key = "1.3.0"
1716
wedpr_ffi_common = "1.0.0"
1817
wedpr_ffi_macros = "1.0.0"
19-
wedpr_s_protos = "1.3.0"
2018
wedpr_l_macros = "1.0.0"
2119

2220

2321
# This is required to generate C/C++ header files.
22+
wedpr_s_hierarchical_deterministic_key = "1.3.0"
23+
wedpr_s_protos = "1.3.0"
24+
2425
[build-dependencies]
25-
cbindgen = "0.9.0"
26+
cbindgen = "0.9.0"

ffi/ffi_c/ffi_c_scd/Cargo.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,13 @@ crate-type = [ "cdylib", "staticlib" ]
1313
[dependencies]
1414
libc = "0.2.60"
1515
protobuf = "2.22.1"
16-
wedpr_s_selective_certificate_disclosure = "1.3.0"
1716
wedpr_ffi_common = "1.0.0"
1817
wedpr_ffi_macros = "1.0.0"
19-
wedpr_s_protos = "1.3.0"
2018
wedpr_l_macros = "1.0.0"
2119

2220
# This is required to generate C/C++ header files.
21+
wedpr_s_protos = "1.3.0"
22+
wedpr_s_selective_certificate_disclosure = "1.3.0"
23+
2324
[build-dependencies]
2425
cbindgen = "0.9.0"

ffi/ffi_c/ffi_c_vcl/Cargo.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,14 @@ crate-type = [ "cdylib", "staticlib" ]
1313
[dependencies]
1414
libc = "0.2.60"
1515
protobuf = "2.22.1"
16-
wedpr_s_verifiable_confidential_ledger = { path = "../../../solution/verifiable_confidential_ledger"}
1716
wedpr_ffi_common = "1.0.0"
1817
wedpr_ffi_macros = "1.1.0"
19-
wedpr_s_protos = { path = "../../../protos"}
20-
wedpr_l_protos = "1.1.0"
2118
wedpr_l_macros = "1.0.0"
2219

2320
# This is required to generate C/C++ header files.
21+
wedpr_l_protos = "1.1.0"
22+
wedpr_s_protos = { path = "../../../protos" }
23+
wedpr_s_verifiable_confidential_ledger = { path = "../../../solution/verifiable_confidential_ledger" }
24+
2425
[build-dependencies]
2526
cbindgen = "0.9.0"

ffi/ffi_java/ffi_java_ktb/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ crate-type = [ "cdylib", "staticlib" ]
1313
[dependencies]
1414
jni = "0.13.0"
1515
protobuf = "2.22.1"
16-
wedpr_s_hierarchical_deterministic_key = "1.3.0"
1716
wedpr_ffi_common = "1.1.0"
1817
wedpr_ffi_macros = "1.1.0"
18+
wedpr_s_hierarchical_deterministic_key = "1.3.0"
1919
wedpr_s_protos = "1.3.0"
2020

2121
[build-dependencies]
2222
cbindgen = "0.9.0"
2323

2424
[target.'cfg(target_os = "android")'.dependencies]
25-
jni = { version = "0.13.1", default-features = false }
25+
jni = { version = "0.13.1", default-features = false }

ffi/ffi_java/ffi_java_scd/Cargo.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,13 @@ crate-type = [ "cdylib" ]
1212
[dependencies]
1313
jni = "0.13.0"
1414
protobuf = "2.22.1"
15-
wedpr_s_selective_certificate_disclosure = "1.3.0"
1615
wedpr_ffi_common = "1.0.0"
1716
wedpr_ffi_macros = "1.0.0"
18-
wedpr_s_protos = "1.3.0"
1917
wedpr_l_protos = "1.0.0"
2018

19+
wedpr_s_protos = "1.3.0"
20+
wedpr_s_selective_certificate_disclosure = "1.3.0"
21+
2122
[build-dependencies]
2223
cbindgen = "0.9.0"
2324

ffi/ffi_java/ffi_java_vcl/Cargo.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,12 @@ crate-type = [ "cdylib", "staticlib" ]
1313
[dependencies]
1414
jni = "0.13.0"
1515
protobuf = "2.22.1"
16-
wedpr_s_verifiable_confidential_ledger = { path = "../../../solution/verifiable_confidential_ledger"}
1716
wedpr_ffi_common = "1.1.0"
1817
wedpr_ffi_macros = "1.1.0"
19-
wedpr_s_protos = { path = "../../../protos"}
20-
wedpr_l_protos = "1.1.0"
18+
wedpr_l_protos = "1.1.0"
19+
20+
wedpr_s_protos = { path = "../../../protos" }
21+
wedpr_s_verifiable_confidential_ledger = { path = "../../../solution/verifiable_confidential_ledger" }
2122

2223
[build-dependencies]
2324
cbindgen = "0.9.0"

protos/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,3 @@ description = "Library of WeDPR protobuf definitions and their generated code."
1111
[dependencies]
1212
protobuf = "2.22.1"
1313
protoc-rust = "2.22.1"
14-

protos/solution/acv/acv.proto

Lines changed: 53 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -6,115 +6,133 @@ package com.webank.wedpr.acv.proto;
66
option java_package = "com.webank.wedpr.acv.proto";
77
option java_multiple_files = true;
88

9-
// Counter Secret value
10-
message CounterSecret {
11-
bytes poll_secret_share = 1;
9+
// Candidate list.
10+
message CandidateList {
11+
repeated string candidate = 1;
1212
}
1313

14-
message CounterSystemParametersShareRequest {
15-
string counter_id = 1;
16-
bytes poll_point_share = 2;
14+
// System parameters.
15+
message SystemParametersStorage {
16+
bytes poll_point = 1;
17+
CandidateList candidates = 2;
1718
}
1819

19-
message CounterSystemParametersStorage {
20-
repeated CounterSystemParametersShareRequest counter_parameters_request = 1;
20+
// Counter's secret value.
21+
message CounterSecret {
22+
bytes poll_secret_share = 1;
2123
}
2224

23-
// Voter Secret value
25+
// Voter's secret value.
2426
message VoterSecret {
2527
bytes voter_secret = 1;
2628
}
2729

30+
// Request of voter's registration.
2831
message RegistrationRequest {
2932
RegistrationBlindingPoint weight_point = 1;
3033
}
3134

35+
// delete?
3236
message RegistrationBlindingPoint {
3337
bytes blinding_poll_point = 1;
3438
bytes blinding_basepoint_g2 = 2;
3539
}
3640

41+
// Response of coordinator for voter's registration.
3742
message RegistrationResponse {
3843
uint32 voter_weight = 1;
3944
Ballot ballot = 2;
4045
bytes signature = 3;
4146
}
4247

48+
// Ciphertext ballot.
4349
message Ballot {
4450
bytes ciphertext1 = 1;
4551
bytes ciphertext2 = 2;
4652
}
4753

54+
55+
// Request of generating system parameter from a counter.
56+
message CounterSystemParametersShareRequest {
57+
string counter_id = 1;
58+
bytes poll_point_share = 2;
59+
}
60+
61+
// Requests of generating system parameter from all counters.
62+
message CounterSystemParametersStorage {
63+
repeated CounterSystemParametersShareRequest counter_parameters_request = 1;
64+
}
65+
66+
// Choice of ballot casting for each candidate.
4867
message VoteChoice {
4968
string candidate = 1;
5069
uint32 value = 2;
5170
}
5271

72+
// Choices for all candidate.
5373
message VoteChoices {
5474
repeated VoteChoice choice = 1;
5575
}
5676

77+
// Ciphertext ballot for each candidate.
5778
message CandidateBallot {
5879
string candidate = 1;
5980
Ballot ballot = 2;
6081
}
6182

62-
message VoteStorage {
63-
bytes signature = 1;
64-
Ballot blank_ballot = 2;
65-
Ballot rest_ballot = 3;
66-
repeated CandidateBallot voted_ballot = 4;
67-
}
68-
69-
// system parameters
70-
message CandidateList {
71-
repeated string candidate = 1;
72-
}
73-
74-
message SystemParametersStorage {
75-
bytes poll_point = 1;
76-
CandidateList candidates = 2;
77-
}
78-
79-
80-
// proofs
83+
// ZKP data to verify the format of ciphertext ballot.
8184
message BallotProof {
8285
bytes format_proof = 1;
8386
}
8487

88+
// Pair of candidate index and the ballot proof he received.
8589
message StringToCandidateBallotProofPair {
8690
string key = 1;
8791
BallotProof value = 2;
8892
}
8993

9094
// Do not use Map, cause unordered in blockchain
95+
// Request of polling for all candidates.
9196
message VoteRequest {
9297
VoteStorage vote = 1;
9398
repeated StringToCandidateBallotProofPair ballot_proof = 2;
9499
bytes range_proof = 3;
95100
bytes sum_balance_proof = 4;
96101
}
97102

98-
message DecryptedResultPartStorage {
99-
CountingPart blank_part = 1;
100-
repeated StringToCountingPartPair candidate_part = 2;
103+
// Polling for each candidates.
104+
message VoteStorage {
105+
bytes signature = 1;
106+
Ballot blank_ballot = 2;
107+
Ballot rest_ballot = 3;
108+
repeated CandidateBallot voted_ballot = 4;
109+
}
110+
111+
// Decrypted ballot and ZKP data to verify the process of counting of each counter.
112+
message CountingPart {
113+
string counter_id = 1;
114+
bytes blinding_c2 = 2;
115+
bytes equality_proof = 3;
101116
}
102117

118+
// Pair of candidate index and the decrypted ballot he received.
103119
message StringToCountingPartPair {
104120
string key = 1;
105121
CountingPart value = 2;
106122
}
107123

108-
message CountingPart {
109-
string counter_id = 1;
110-
bytes blinding_c2 = 2;
111-
bytes equality_proof = 3;
124+
// Decrypted ballot and ZKP data to verify the process of counting of all counters.
125+
message DecryptedResultPartStorage {
126+
CountingPart blank_part = 1;
127+
repeated StringToCountingPartPair candidate_part = 2;
112128
}
113129

130+
// Final result of all candidates.
114131
message VoteResultStorage {
115132
repeated StringToInt64Pair result = 1;
116133
}
117134

135+
// Final result of each candidate.
118136
message StringToInt64Pair {
119137
string key = 1;
120138
int64 value = 2;

protos/src/generated/acv.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// Copyright 2020 WeDPR Lab Project Authors. Licensed under Apache-2.0.
2+
13
// This file is generated by rust-protobuf 2.25.1. Do not edit
24
// @generated
35

protos/src/generated/scd.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// Copyright 2020 WeDPR Lab Project Authors. Licensed under Apache-2.0.
2+
13
// This file is generated by rust-protobuf 2.25.1. Do not edit
24
// @generated
35

protos/src/generated/vcl.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// Copyright 2020 WeDPR Lab Project Authors. Licensed under Apache-2.0.
2+
13
// This file is generated by rust-protobuf 2.25.1. Do not edit
24
// @generated
35

solution/anonymous_ciphertext_voting/Cargo.toml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ description = "Library of WeDPR protobuf definitions and their generated code."
99
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
1010

1111
[dependencies]
12-
wedpr_l_macros = "1.0.0"
13-
wedpr_l_utils = "1.1.0"
14-
wedpr_l_crypto_zkp_discrete_logarithm_proof = { git = "https://github.com/WeBankBlockchain/WeDPR-Lab-Crypto.git", branch = "release-1.2.0" }
15-
wedpr_s_protos = { path = "../../protos"}
16-
wedpr_l_protos = { git = "https://github.com/WeBankBlockchain/WeDPR-Lab-Crypto.git", branch = "release-1.2.0" }
1712
curve25519-dalek = { version = "1", features = [ "serde" ] }
18-
wedpr_l_crypto_zkp_utils = { git = "https://github.com/WeBankBlockchain/WeDPR-Lab-Crypto.git", branch = "release-1.2.0" }
19-
wedpr_l_crypto_signature_secp256k1 = { git = "https://github.com/WeBankBlockchain/WeDPR-Lab-Crypto.git", branch = "release-1.2.0" }
2013
lazy_static = "1.4.0"
2114
wedpr_l_crypto_hash_keccak256 = { git = "https://github.com/WeBankBlockchain/WeDPR-Lab-Crypto.git", branch = "release-1.2.0" }
15+
wedpr_l_crypto_signature_secp256k1 = { git = "https://github.com/WeBankBlockchain/WeDPR-Lab-Crypto.git", branch = "release-1.2.0" }
16+
wedpr_l_crypto_zkp_discrete_logarithm_proof = { git = "https://github.com/WeBankBlockchain/WeDPR-Lab-Crypto.git", branch = "release-1.2.0" }
2217
wedpr_l_crypto_zkp_range_proof = { git = "https://github.com/WeBankBlockchain/WeDPR-Lab-Crypto.git", branch = "release-1.2.0" }
18+
wedpr_l_crypto_zkp_utils = { git = "https://github.com/WeBankBlockchain/WeDPR-Lab-Crypto.git", branch = "release-1.2.0" }
19+
wedpr_l_macros = "1.0.0"
20+
wedpr_l_protos = { git = "https://github.com/WeBankBlockchain/WeDPR-Lab-Crypto.git", branch = "release-1.2.0" }
21+
wedpr_l_utils = "1.1.0"
22+
wedpr_s_protos = { path = "../../protos" }

0 commit comments

Comments
 (0)