Skip to content

Commit b16214c

Browse files
committed
v1.5 revise
1 parent dd23474 commit b16214c

File tree

28 files changed

+2387
-1958
lines changed

28 files changed

+2387
-1958
lines changed

.github/workflows/vcl.yml renamed to .github/workflows/default_test.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Rust
1+
name: Default-Test
22

33
on:
44
push:
@@ -14,6 +14,6 @@ jobs:
1414
- name: Nightly default
1515
run: rustup default nightly
1616
- name: Build
17-
run: cargo build --verbose
17+
run: cargo build --all --all-targets --verbose
1818
- name: Run tests
1919
run: cargo test --verbose

.rustfmt.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ format_strings = true
55
indent_style = "Block"
66
match_block_trailing_comma = true
77
max_width = 80
8-
merge_imports = true
8+
imports_granularity = "Crate"
99
normalize_comments = true
1010
normalize_doc_attributes = true
1111
overflow_delimited_expr = true

ffi/ffi_c/ffi_c_ktb/Cargo.toml

+1-3
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,9 @@ protobuf = "2.22.1"
1616
wedpr_ffi_common = "1.0.0"
1717
wedpr_ffi_macros = "1.0.0"
1818
wedpr_l_macros = "1.0.0"
19-
20-
21-
# This is required to generate C/C++ header files.
2219
wedpr_s_hierarchical_deterministic_key = "1.3.0"
2320
wedpr_s_protos = "1.3.0"
2421

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

ffi/ffi_c/ffi_c_scd/Cargo.toml

+1-2
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,9 @@ protobuf = "2.22.1"
1616
wedpr_ffi_common = "1.0.0"
1717
wedpr_ffi_macros = "1.0.0"
1818
wedpr_l_macros = "1.0.0"
19-
20-
# This is required to generate C/C++ header files.
2119
wedpr_s_protos = "1.3.0"
2220
wedpr_s_selective_certificate_disclosure = "1.3.0"
2321

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

ffi/ffi_c/ffi_c_vcl/Cargo.toml

+1-2
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,10 @@ protobuf = "2.22.1"
1616
wedpr_ffi_common = "1.0.0"
1717
wedpr_ffi_macros = "1.1.0"
1818
wedpr_l_macros = "1.0.0"
19-
20-
# This is required to generate C/C++ header files.
2119
wedpr_l_protos = "1.1.0"
2220
wedpr_s_protos = { path = "../../../protos" }
2321
wedpr_s_verifiable_confidential_ledger = { path = "../../../solution/verifiable_confidential_ledger" }
2422

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

ffi/ffi_java/ffi_java_ktb/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ wedpr_ffi_macros = "1.1.0"
1818
wedpr_s_hierarchical_deterministic_key = "1.3.0"
1919
wedpr_s_protos = "1.3.0"
2020

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

ffi/ffi_java/ffi_java_scd/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ wedpr_l_protos = "1.0.0"
1919
wedpr_s_protos = "1.3.0"
2020
wedpr_s_selective_certificate_disclosure = "1.3.0"
2121

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

ffi/ffi_java/ffi_java_vcl/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ wedpr_l_protos = "1.1.0"
2020
wedpr_s_protos = { path = "../../../protos" }
2121
wedpr_s_verifiable_confidential_ledger = { path = "../../../solution/verifiable_confidential_ledger" }
2222

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

protos/solution/acv/acv.proto

+27-29
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2020 WeDPR Lab Project Authors. Licensed under Apache-2.0.
1+
// Copyright 2021 WeDPR Lab Project Authors. Licensed under Apache-2.0.
22

33
syntax = "proto3";
44

@@ -11,34 +11,34 @@ message CandidateList {
1111
repeated string candidate = 1;
1212
}
1313

14-
// System parameters.
15-
message SystemParametersStorage {
14+
// Shared system parameters to initialize a poll.
15+
message PollParametersStorage {
1616
bytes poll_point = 1;
1717
CandidateList candidates = 2;
1818
}
1919

20-
// Counter's secret value.
20+
// Secret of a counter.
2121
message CounterSecret {
2222
bytes poll_secret_share = 1;
2323
}
2424

25-
// Voter's secret value.
25+
// Secret of a voter.
2626
message VoterSecret {
2727
bytes voter_secret = 1;
2828
}
2929

30-
// Request of voter's registration.
30+
// Request of registering a voter.
3131
message RegistrationRequest {
3232
RegistrationBlindingPoint weight_point = 1;
3333
}
3434

35-
// delete?
35+
// Blinding points for a voter registration.
3636
message RegistrationBlindingPoint {
3737
bytes blinding_poll_point = 1;
3838
bytes blinding_basepoint_g2 = 2;
3939
}
4040

41-
// Response of coordinator for voter's registration.
41+
// Response of voter registration.
4242
message RegistrationResponse {
4343
uint32 voter_weight = 1;
4444
Ballot ballot = 2;
@@ -51,30 +51,29 @@ message Ballot {
5151
bytes ciphertext2 = 2;
5252
}
5353

54-
55-
// Request of generating system parameter from a counter.
56-
message CounterSystemParametersShareRequest {
54+
// Request of aggregating a part of system parameters from a counter.
55+
message CounterParametersShareRequest {
5756
string counter_id = 1;
5857
bytes poll_point_share = 2;
5958
}
6059

61-
// Requests of generating system parameter from all counters.
62-
message CounterSystemParametersStorage {
63-
repeated CounterSystemParametersShareRequest counter_parameters_request = 1;
60+
// Shared system parameters to initialize a group of counters.
61+
message CounterParametersStorage {
62+
repeated CounterParametersShareRequest counter_parameters_share = 1;
6463
}
6564

66-
// Choice of ballot casting for each candidate.
65+
// Vote choice for a candidate.
6766
message VoteChoice {
6867
string candidate = 1;
6968
uint32 value = 2;
7069
}
7170

72-
// Choices for all candidate.
71+
// Choice list for all candidates.
7372
message VoteChoices {
7473
repeated VoteChoice choice = 1;
7574
}
7675

77-
// Ciphertext ballot for each candidate.
76+
// Ciphertext ballot for a candidate.
7877
message CandidateBallot {
7978
string candidate = 1;
8079
Ballot ballot = 2;
@@ -85,55 +84,54 @@ message BallotProof {
8584
bytes format_proof = 1;
8685
}
8786

88-
// Pair of candidate index and the ballot proof he received.
89-
message StringToCandidateBallotProofPair {
87+
// Pair of string (candidate id) and BallotProof.
88+
message StringToBallotProofPair {
9089
string key = 1;
9190
BallotProof value = 2;
9291
}
9392

94-
// Do not use Map, cause unordered in blockchain
95-
// Request of polling for all candidates.
93+
// Request of voting for all candidates.
9694
message VoteRequest {
9795
VoteStorage vote = 1;
98-
repeated StringToCandidateBallotProofPair ballot_proof = 2;
96+
repeated StringToBallotProofPair ballot_proof = 2;
9997
bytes range_proof = 3;
10098
bytes sum_balance_proof = 4;
10199
}
102100

103-
// Polling for each candidates.
101+
// Ciphertext ballot for all candidates.
104102
message VoteStorage {
105103
bytes signature = 1;
106104
Ballot blank_ballot = 2;
107105
Ballot rest_ballot = 3;
108106
repeated CandidateBallot voted_ballot = 4;
109107
}
110108

111-
// Decrypted ballot and ZKP data to verify the process of counting of each counter.
109+
// Partially decrypted ballot and associated ZKP data for a candidate.
112110
message CountingPart {
113111
string counter_id = 1;
114112
bytes blinding_c2 = 2;
115113
bytes equality_proof = 3;
116114
}
117115

118-
// Pair of candidate index and the decrypted ballot he received.
116+
// Pair of string (candidate id) and CountingPart.
119117
message StringToCountingPartPair {
120118
string key = 1;
121119
CountingPart value = 2;
122120
}
123121

124-
// Decrypted ballot and ZKP data to verify the process of counting of all counters.
122+
// Partially decrypted ballots and associated ZKP data for a poll.
125123
message DecryptedResultPartStorage {
126124
CountingPart blank_part = 1;
127125
repeated StringToCountingPartPair candidate_part = 2;
128126
}
129127

130-
// Final result of all candidates.
128+
// Fully decrypted result of a poll.
131129
message VoteResultStorage {
132130
repeated StringToInt64Pair result = 1;
133131
}
134132

135-
// Final result of each candidate.
133+
// Pair of string (candidate id) and number.
136134
message StringToInt64Pair {
137135
string key = 1;
138136
int64 value = 2;
139-
}
137+
}

0 commit comments

Comments
 (0)