#ifndef __PRSONA_SERVER_ENTITY_HPP #define __PRSONA_SERVER_ENTITY_HPP #include #include "client.hpp" #include "server.hpp" #include "proof.hpp" class PrsonaServerEntity { public: PrsonaServerEntity(size_t numServers); BGNPublicKey get_bgn_public_key() const; Curvepoint get_blinding_generator() const; Curvepoint get_fresh_generator(Proof& pi) const; void add_new_client(PrsonaClient& newUser); void receive_vote(const Proof& pi, const std::vector& votes, const Curvepoint& shortTermPublicKey); void epoch(); void transmit_score(PrsonaClient& currUser) const; private: std::vector servers; std::vector encryptedTallies; std::vector tallyProofs; EGCiphertext get_default_tally(Proof& pi, const Curvepoint& shortTermPublicKey) const; Proof generate_valid_default_tally_proof(const EGCiphertext& encryptedDefaultTally, const Scalar& lambda) const; Proof generate_epoch_round_one_proof(const Proof& pi1, const Proof& pi2) const; Proof generate_epoch_proof(const Proof& pi, const EGCiphertext& encryptedTally) const; EGCiphertext get_current_tally(Proof& pi, const Curvepoint& shortTermPublicKey) const; std::vector tally_scores(Proof& pi); size_t binary_search(const Curvepoint& index) const; }; #endif