Curvepoint.hpp 999 B

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