#ifndef __BIPOINT_HPP #define __BIPOINT_HPP #include "Scalar.hpp" #include "curvepoint_fp.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); curvepoint_fp_t& operator[](int n); const curvepoint_fp_t& operator[](int n) const; Bipoint operator+(const Bipoint& b) const; Bipoint operator*(const Scalar& mult) const; bool operator==(const Bipoint& b) const; bool operator!=(const Bipoint& b) const; // "double" is a type, so you can't just name the function that I don't think, but that's all this is Bipoint mult_by_2() const; void make_affine(); private: curvepoint_fp_t point[2]; }; template <> class Bipoint { public: Bipoint(); Bipoint(twistpoint_fp2_t p1, twistpoint_fp2_t p2); twistpoint_fp2_t& operator[](int n); const twistpoint_fp2_t& operator[](int n) const; Bipoint operator+(const Bipoint& b) const; Bipoint operator*(const Scalar& mult) const; bool operator==(const Bipoint& b) const; bool operator!=(const Bipoint& b) const; // "double" is a type, so you can't just name the function that I don't think, but that's all this is Bipoint mult_by_2() const; void make_affine(); private: twistpoint_fp2_t point[2]; }; #endif