|
@@ -0,0 +1,23 @@
|
|
|
+#ifndef __PRSONA_SERVER_HPP
|
|
|
+#define __PRSONA_SERVER_HPP
|
|
|
+
|
|
|
+class PrsonaServer {
|
|
|
+ public:
|
|
|
+ PrsonaServer();
|
|
|
+ void add_new_client(PrsonaPublicKey longTermPublicKey);
|
|
|
+ void epoch();
|
|
|
+ void receive_vote(vector<CurveBipoint> vote, Proof pi, PrsonaPublicKey shortTermPublicKey);
|
|
|
+
|
|
|
+ private:
|
|
|
+ PrsonaPrivateKey longTermPrivateKey;
|
|
|
+ BGNPrivateKey bgnPrivateKey;
|
|
|
+ vector<TwistBipoint> previousVoteTally;
|
|
|
+ vector<vector<CurveBipoint>> voteMatrix;
|
|
|
+
|
|
|
+ void calculate_vote_tally();
|
|
|
+ void rerandomize_vote_matrix();
|
|
|
+ void distribute_new_scores();
|
|
|
+ bool verify_vote_proof(CurveBipoint vote, Proof pi, PrsonaPublicKey shortTermPublicKey);
|
|
|
+};
|
|
|
+
|
|
|
+#endif
|