1234567891011121314151617181920212223242526272829303132333435 |
- #ifndef __PRIVATEKEY_HPP
- #define __PRIVATEKEY_HPP
- #include <unordered_map>
- #include "Scalar.hpp"
- #include "Bipoint.hpp"
- #include "Quadripoint.hpp"
- #include "PublicKey.hpp"
- #include "pairing.hpp"
- class PrivateKey
- {
- public:
- Scalar decrypt(const CurveBipoint& ciphertext) const;
- Scalar decrypt(const TwistBipoint& ciphertext) const;
- Scalar decrypt(const Quadripoint & ciphertext) const;
-
- private:
- PrivateKey();
- friend class BGN;
- void set(const PublicKey& pub_key, const Scalar& a1, const Scalar& b1, const Scalar& c1, const Scalar& d1, const Scalar& a2, const Scalar& b2, const Scalar& c2, const Scalar& d2);
- CurveBipoint pi_1(const CurveBipoint& input) const;
- TwistBipoint pi_2(const TwistBipoint& input) const;
- Quadripoint pi_T(const Quadripoint & input) const;
- Scalar a1, b1, c1, d1, a2, b2, c2, d2;
- CurveBipoint pi_1_curvegen;
- TwistBipoint pi_2_twistgen;
- Quadripoint pi_T_pairgen;
- };
- #endif
|