123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- #ifndef __PRSONA_SERVER_ENTITY_HPP
- #define __PRSONA_SERVER_ENTITY_HPP
- #include <vector>
- #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<CurveBipoint> 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<CurveBipoint>& votes,
- const Curvepoint& shortTermPublicKey);
- void transmit_updates(PrsonaClient& currUser) const;
- // EPOCH
- void epoch(Proof& pi);
- private:
- std::vector<PrsonaServer> servers;
- // SCORE TALLYING
- std::vector<EGCiphertext> tally_scores(
- std::vector<Proof>& tallyProofs, const Curvepoint& nextGenerator);
-
- // BINARY SEARCH
- size_t binary_search(const Curvepoint& index) const;
- };
- #endif
|