1+ // Copyright 2020 WeDPR Lab Project Authors. Licensed under Apache-2.0.
2+
3+ syntax = "proto3" ;
4+
5+ package com.webank.wedpr.abv.proto ;
6+ option java_package = "com.webank.wedpr.abv.proto" ;
7+ option java_multiple_files = true ;
8+
9+ // Counter Secret value
10+ message CounterSecret {
11+ bytes poll_secret_share = 1 ;
12+ }
13+
14+ message CounterSystemParametersShareRequest {
15+ string counter_id = 1 ;
16+ bytes poll_point_share = 2 ;
17+ }
18+
19+ message CounterSystemParametersStorage {
20+ repeated CounterSystemParametersShareRequest counter_parameters_request = 1 ;
21+ }
22+
23+ // Voter Secret value
24+ message VoterSecret {
25+ bytes vote_secret = 1 ;
26+ }
27+
28+ message RegistrationRequest {
29+ RegistrationBlindingPoint weight_point = 1 ;
30+ }
31+
32+ message RegistrationBlindingPoint {
33+ bytes blinding_poll_point = 1 ;
34+ bytes blinding_basepoint_g2 = 2 ;
35+ }
36+
37+ message RegistrationResponse {
38+ uint32 voter_weight = 1 ;
39+ Ballot ballot = 2 ;
40+ bytes signature = 3 ;
41+ Ballot zero_ballot = 4 ;
42+ }
43+
44+ message Ballot {
45+ bytes ciphertext1 = 1 ;
46+ bytes ciphertext2 = 2 ;
47+ }
48+
49+ message VoteChoice {
50+ string candidate = 1 ;
51+ uint32 value = 2 ;
52+ }
53+
54+ message VoteChoices {
55+ repeated VoteChoice choice = 1 ;
56+ }
57+
58+ message CandidateBallot {
59+ string candidate = 1 ;
60+ Ballot ballot = 2 ;
61+ }
62+
63+ message VoteStorage {
64+ bytes signature = 1 ;
65+ Ballot blank_ballot = 2 ;
66+ Ballot rest_ballot = 3 ;
67+ repeated CandidateBallot voted_ballot = 4 ;
68+ }
69+
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+ message BallotProof {
80+ bytes format_proof = 1 ;
81+ bytes either_equality_proof = 2 ;
82+ }
83+
84+ message CandidateBallotProofPair {
85+ string candidate = 1 ;
86+ BallotProof value = 2 ;
87+ }
88+
89+ // Do not use Map, cause unordered in blockchain
90+ message VoteRequest {
91+ VoteStorage vote = 1 ;
92+ repeated CandidateBallotProofPair ballot_proof = 2 ;
93+ bytes range_proof = 3 ;
94+ bytes sum_balance_proof = 4 ;
95+ }
96+
97+ message DecryptedResultPartStorage {
98+ CountingPart blank_part = 1 ;
99+ repeated StringToCountingPartPair candidate_part = 2 ;
100+ }
101+
102+ message StringToCountingPartPair {
103+ string key = 1 ;
104+ CountingPart value = 2 ;
105+ }
106+
107+ message CountingPart {
108+ string counter_id = 1 ;
109+ bytes c2_r = 2 ;
110+ bytes equality_proof = 3 ;
111+ }
112+
113+ message VoteResultStorage {
114+ repeated StringToInt64Pair result = 1 ;
115+ }
116+
117+ message StringToInt64Pair {
118+ string key = 1 ;
119+ int64 value = 2 ;
120+ }
0 commit comments