12345678910111213141516171819202122232425262728293031323334353637 |
- #ifndef __PUBLICKEY_HPP
- #define __PUBLICKEY_HPP
- #include "Scalar.hpp"
- #include "Bipoint.hpp"
- #include "Quadripoint.hpp"
- #include "pairing.hpp"
- class PublicKey
- {
- public:
- void encrypt(CurveBipoint& G_element, const Scalar& cleartext) const;
- void encrypt(TwistBipoint& H_element, const Scalar& cleartext) const;
- void encrypt(CurveBipoint& G_element, TwistBipoint& H_element, const Scalar& cleartext) const;
- CurveBipoint homomorphic_addition(const CurveBipoint& a, const CurveBipoint& b) const;
- TwistBipoint homomorphic_addition(const TwistBipoint& a, const TwistBipoint& b) const;
- Quadripoint homomorphic_addition(const Quadripoint& a, const Quadripoint& b) const;
- Quadripoint homomorphic_multiplication(const CurveBipoint& a, const TwistBipoint& b) const;
-
- CurveBipoint get_bipoint_curvegen() const;
- TwistBipoint get_bipoint_twistgen() const;
- CurveBipoint get_bipoint_curve_subgroup_gen() const;
- TwistBipoint get_bipoint_twist_subgroup_gen() const;
-
- private:
- PublicKey();
- void set(const CurveBipoint& g, const TwistBipoint& h, const CurveBipoint& g1, const TwistBipoint& h1);
- friend class BGN;
- CurveBipoint bipoint_curvegen; // g
- TwistBipoint bipoint_twistgen; // h
- CurveBipoint bipoint_curve_subgroup_gen; // (g^(a1), g^(b1))
- TwistBipoint bipoint_twist_subgroup_gen; // (h^(a2), h^(b2))
- };
- #endif
|