1234567891011121314151617181920212223242526272829303132333435363738394041 |
- #ifndef __PRSONA_CLIENT_HPP
- #define __PRSONA_CLIENT_HPP
- #include <unordered_map>
- #include "Curvepoint.hpp"
- #include "Scalar.hpp"
- #include "BGN.hpp"
- class PrsonaClient {
- public:
- PrsonaClient(const BGNPublicKey& serverPublicKey, const Curvepoint& elGamalBlindGenerator);
- Curvepoint get_long_term_public_key() const;
- Curvepoint get_short_term_public_key() const;
- void receive_score(const Proof& pi, const EGCiphertext& score, const Scalar& newSeed);
- void make_votes(vector<CurveBipoint>& encryptedVotes, vector<Proof>& validVoteProofs, const vector<Scalar>& vote) const;
-
- Proof generate_reputation_proof() const;
- bool verify_reputation_proof(const Proof& pi, const Curvepoint& shortTermPublicKey) const;
- private:
- static const Curvepoint elGamalGenerator;
- const Curvepoint elGamalBlindGenerator;
- const BGNPublicKey serverPublicKey;
-
- Curvepoint currentFreshGenerator;
- EGCiphertext currentEncryptedScore;
- Scalar longTermPrivateKey;
- Scalar currentScore;
- Proof generate_vote_proof(const Scalar& vote) const;
- bool verify_score_proof(const Proof& pi) const;
- std::unordered_map<Curvepoint, Scalar, CurvepointHash> decryption_memoizer;
- Scalar max_checked;
- };
- #endif
|