server.hpp 717 B

1234567891011121314151617181920212223
  1. #ifndef __PRSONA_SERVER_HPP
  2. #define __PRSONA_SERVER_HPP
  3. class PrsonaServer {
  4. public:
  5. PrsonaServer();
  6. void add_new_client(PrsonaPublicKey longTermPublicKey);
  7. void epoch();
  8. void receive_vote(vector<CurveBipoint> vote, Proof pi, PrsonaPublicKey shortTermPublicKey);
  9. private:
  10. PrsonaPrivateKey longTermPrivateKey;
  11. BGNPrivateKey bgnPrivateKey;
  12. vector<TwistBipoint> previousVoteTally;
  13. vector<vector<CurveBipoint>> voteMatrix;
  14. void calculate_vote_tally();
  15. void rerandomize_vote_matrix();
  16. void distribute_new_scores();
  17. bool verify_vote_proof(CurveBipoint vote, Proof pi, PrsonaPublicKey shortTermPublicKey);
  18. };
  19. #endif