Curvepoint.hpp 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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 Curvepoint& b) const;
  17. Curvepoint operator*(const Scalar& mult) 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. bool operator!=(const Curvepoint& b) const;
  24. void make_affine();
  25. friend class CurvepointHash;
  26. friend std::ostream& operator<<(std::ostream& os, const Curvepoint& output);
  27. friend std::istream& operator>>(std::istream& is, Curvepoint& input);
  28. private:
  29. curvepoint_fp_t point;
  30. };
  31. class CurvepointHash
  32. {
  33. public:
  34. size_t operator()(const Curvepoint& x) const;
  35. };
  36. #endif