1234567891011121314151617181920212223242526272829303132333435 |
- #ifndef __BGN_HPP
- #define __BGN_HPP
- #include "Scalar.hpp"
- #include "Bipoint.hpp"
- #include "Quadripoint.hpp"
- #include "PublicKey.hpp"
- #include "PrivateKey.hpp"
- class BGN
- {
- public:
- BGN();
- void encrypt(Bipoint<curvepoint_fp_t>& G_element, const Scalar& cleartext) const;
- void encrypt(Bipoint<twistpoint_fp2_t>& H_element, const Scalar& cleartext) const;
- void encrypt(Bipoint<curvepoint_fp_t>& G_element, Bipoint<twistpoint_fp2_t>& H_element, const Scalar& cleartext) const;
- Bipoint<curvepoint_fp_t> homomorphic_addition(const Bipoint<curvepoint_fp_t>& a, const Bipoint<curvepoint_fp_t>& b) const;
- Bipoint<twistpoint_fp2_t> homomorphic_addition(const Bipoint<twistpoint_fp2_t>& a, const Bipoint<twistpoint_fp2_t>& b) const;
- Quadripoint homomorphic_addition(const Quadripoint& a, const Quadripoint& b) const;
- Quadripoint homomorphic_multiplication(const Bipoint<curvepoint_fp_t>& a, const Bipoint<twistpoint_fp2_t>& b) const;
- Scalar decrypt(const Bipoint<curvepoint_fp_t>& ciphertext) const;
- Scalar decrypt(const Bipoint<twistpoint_fp2_t>& ciphertext) const;
- Scalar decrypt(const Quadripoint& ciphertext) const;
- PublicKey get_public_key() const;
- private:
- PublicKey public_key;
- PrivateKey private_key;
- };
- #endif /* __BGN_HPP */
|