#ifndef __BIPOINT_HPP #define __BIPOINT_HPP #include "PublicKey.hpp" #include "PrivateKey.hpp" #include "mydouble.h" extern "C" { #include "fpe.h" } #include "curvepoint_fp.h" extern "C" { #include "fp2e.h" } #include "twistpoint_fp2.h" /* It doesn't actually make sense to instantiate this generally; * we'll specify for each real type directly. * We still have to make something here, though, so it's empty. */ template class Bipoint {}; template <> class Bipoint { public: Bipoint(); Bipoint(curvepoint_fp_t p1, curvepoint_fp_t p2); void receive_encryption(const scalar_t& cleartext, const PublicKey& public_key); curvepoint_fp_t& operator[](int n); const curvepoint_fp_t& operator[](int n) const; Bipoint operator+(const Bipoint& b) const; Bipoint operator*(const scalar_t& mult) const; bool operator==(const Bipoint& b) const; Bipoint multBy2() const; private: curvepoint_fp_t point[2]; }; template <> class Bipoint { public: Bipoint(); Bipoint(twistpoint_fp2_t p1, twistpoint_fp2_t p2); receive_encryption(const scalar_t& cleartext, const PublicKey& public_key); twistpoint_fp2_t& operator[](int n); const twistpoint_fp2_t& operator[](int n) const; Bipoint operator+(const Bipoint& b) const; Bipoint operator*(const scalar_t& mult) const; bool operator==(const Bipoint& b) const; Bipoint multBy2() const; private: twistpoint_fp2_t point[2]; }; #endif