1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- #ifndef __BIPOINT_HPP
- #define __BIPOINT_HPP
- #include <functional>
- #include "Scalar.hpp"
- extern "C" {
- #include "curvepoint_fp.h"
- #include "twistpoint_fp2.h"
- }
- class CurveBipoint
- {
- public:
- CurveBipoint();
- CurveBipoint(curvepoint_fp_t p1, curvepoint_fp_t p2);
- curvepoint_fp_t& operator[](int n);
- const curvepoint_fp_t& operator[](int n) const;
- CurveBipoint operator+(const CurveBipoint& b) const;
- CurveBipoint operator*(const Scalar& mult) const;
- bool operator==(const CurveBipoint& b) const;
- bool operator!=(const CurveBipoint& 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
- CurveBipoint mult_by_2() const;
- void make_affine();
- friend class CurveBipointHash;
-
- private:
- curvepoint_fp_t point[2];
- };
- class CurveBipointHash
- {
- public:
- size_t operator()(const CurveBipoint& x) const;
- };
- class TwistBipoint
- {
- public:
- TwistBipoint();
- TwistBipoint(twistpoint_fp2_t p1, twistpoint_fp2_t p2);
- twistpoint_fp2_t& operator[](int n);
- const twistpoint_fp2_t& operator[](int n) const;
- TwistBipoint operator+(const TwistBipoint& b) const;
- TwistBipoint operator*(const Scalar& mult) const;
- bool operator==(const TwistBipoint& b) const;
- bool operator!=(const TwistBipoint& 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
- TwistBipoint mult_by_2() const;
- void make_affine();
- friend class TwistBipointHash;
-
- private:
- twistpoint_fp2_t point[2];
- };
- class TwistBipointHash
- {
- public:
- size_t operator()(const TwistBipoint& x) const;
- };
- #endif
|