Curvepoint.hpp 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #ifndef __CURVEPOINT_HPP
  2. #define __CURVEPOINT_HPP
  3. #include <ostream>
  4. #include <functional>
  5. #include "Scalar.hpp"
  6. #include "print_helpers.hpp"
  7. extern "C" {
  8. #include "curvepoint_fp.h"
  9. }
  10. class Curvepoint
  11. {
  12. public:
  13. Curvepoint();
  14. Curvepoint(const curvepoint_fp_t input);
  15. Curvepoint operator+(const Curvepoint& b) const;
  16. Curvepoint operator*(const Scalar& mult) const;
  17. bool operator==(const Curvepoint& b) const;
  18. bool operator<(const Curvepoint& b) const;
  19. bool operator>(const Curvepoint& b) const;
  20. bool operator<=(const Curvepoint& b) const;
  21. bool operator>=(const Curvepoint& b) const;
  22. bool operator!=(const Curvepoint& b) const;
  23. void make_affine();
  24. friend class CurvepointHash;
  25. friend std::ostream& operator<<(std::ostream& os, const Curvepoint& output);
  26. friend std::istream& operator>>(std::istream& is, Curvepoint& input);
  27. private:
  28. curvepoint_fp_t point;
  29. };
  30. class CurvepointHash
  31. {
  32. public:
  33. size_t operator()(const Curvepoint& x) const;
  34. };
  35. #endif