BGN.hpp 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. #ifndef __BGN_HPP
  2. #define __BGN_HPP
  3. #include "Bipoint.hpp"
  4. #include "Quadripoint.hpp"
  5. #include "Scalar.hpp"
  6. #include "PublicKey.hpp"
  7. #include "PrivateKey.hpp"
  8. class BGN
  9. {
  10. public:
  11. BGN();
  12. void encrypt(CurveBipoint& G_element, const Scalar& cleartext) const;
  13. void encrypt(TwistBipoint& H_element, const Scalar& cleartext) const;
  14. void encrypt(CurveBipoint& G_element, TwistBipoint& H_element, const Scalar& cleartext) const;
  15. CurveBipoint homomorphic_addition(const CurveBipoint& a, const CurveBipoint& b) const;
  16. TwistBipoint homomorphic_addition(const TwistBipoint& a, const TwistBipoint& b) const;
  17. Quadripoint homomorphic_addition(const Quadripoint& a, const Quadripoint& b) const;
  18. Quadripoint homomorphic_multiplication(const CurveBipoint& a, const TwistBipoint& b) const;
  19. Scalar decrypt(const CurveBipoint& ciphertext) const;
  20. Scalar decrypt(const TwistBipoint& ciphertext) const;
  21. Scalar decrypt(const Quadripoint & ciphertext) const;
  22. const PublicKey& get_public_key() const;
  23. const PrivateKey& get_private_key() const;
  24. private:
  25. PublicKey public_key;
  26. PrivateKey private_key;
  27. };
  28. #endif /* __BGN_HPP */