Curvepoint.hpp 1.2 KB

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