View Javadoc
1   package civitas.bboard.server.electioncache;
2   
3   import java.math.BigInteger;
4   import java.util.List;
5   import java.util.Map;
6   import java.util.concurrent.ConcurrentHashMap;
7   
8   import org.springframework.data.annotation.Id;
9   
10  import civitas.common.ServerHost;
11  import civitas.common.election.ElectionDetails;
12  import civitas.common.election.ElectionStatus;
13  import civitas.common.tabteller.keysharecommitment.TabTellerKeyShareCommitment;
14  import civitas.crypto.ciphertext.ElGamalCiphertextish;
15  import lombok.AllArgsConstructor;
16  import lombok.Data;
17  import lombok.NoArgsConstructor;
18  import lombok.NonNull;
19  import lombok.RequiredArgsConstructor;
20  
21  record ElGamalKeyShareStored(
22  		@NonNull BigInteger pubKeyY,
23  		@NonNull BigInteger proofA,
24  		@NonNull BigInteger proofC,
25  		@NonNull BigInteger proofR,
26  		@NonNull BigInteger proofV) {}
27  
28  @Data
29  @NoArgsConstructor
30  @AllArgsConstructor
31  @RequiredArgsConstructor
32  public class ElectionCache {
33  	@Id
34  	@NonNull String boardID;
35  
36  	@NonNull Integer myIndex;
37  
38  	@NonNull ElectionStatus status;
39  
40  	@NonNull ElectionDetails electionDetails;
41  
42  	List<ServerHost> hosts;
43  	Long electionStartTime;
44  	Long electionStopTime;
45  	Long electionFinalizeTime;
46  	List<ElGamalCiphertextish> ciphertextList;
47  	// @ElementCollection
48  	// ElectionEvent[] electionEvents;
49  	Integer electoralRollEstimate;
50  	Map<Integer, ElGamalKeyShareStored> tabTellerKeyShares;
51  	Map<Integer, TabTellerKeyShareCommitment> tabTellerKeyShareCommitments;
52  	BigInteger tabTellerSharedKeyY;
53  	Map<Integer, TabTellerKeyShareCommitment> contentComs;
54  	final Map<String, String> voterBlocks = new ConcurrentHashMap<>();
55  }