#ifndef __PRSONA_SERVER_ENTITY_HPP #define __PRSONA_SERVER_ENTITY_HPP #include #include "client.hpp" #include "server.hpp" #include "proof.hpp" class PrsonaServerEntity { public: // CONSTRUCTORS PrsonaServerEntity(size_t numServers); // BASIC PUBLIC SYSTEM INFO GETTERS BGNPublicKey get_bgn_public_key() const; Curvepoint get_blinding_generator() const; Curvepoint get_fresh_generator() const; // ENCRYPTED DATA GETTERS std::vector get_current_votes_by( Proof& pi, const Curvepoint& shortTermPublicKey) const; EGCiphertext get_current_tally( Proof& pi, const Curvepoint& shortTermPublicKey) const; // CLIENT INTERACTIONS void add_new_client(PrsonaClient& newUser); void receive_vote( const Proof& pi, const std::vector& votes, const Curvepoint& shortTermPublicKey); void transmit_updates(PrsonaClient& currUser) const; // EPOCH void epoch(Proof& pi); private: std::vector servers; // SCORE TALLYING std::vector tally_scores( std::vector& tallyProofs, const Curvepoint& nextGenerator); // BINARY SEARCH size_t binary_search(const Curvepoint& index) const; }; #endif