Curvepoint.hpp 1021 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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(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. private:
  27. curvepoint_fp_t point;
  28. };
  29. class CurvepointHash
  30. {
  31. public:
  32. size_t operator()(const Curvepoint& x) const;
  33. };
  34. #endif