Class: ECDSA::Point
- Inherits:
-
Object
- Object
- ECDSA::Point
- Defined in:
- lib/schnorr/ec_point_ext.rb
Instance Method Summary collapse
-
#encode(only_x = false) ⇒ Object
Encode this point into a binary string.
-
#has_even_y? ⇒ Boolean
Check the y-coordinate of this point is an even.
Instance Method Details
#encode(only_x = false) ⇒ Object
Encode this point into a binary string.
13 14 15 16 17 18 19 |
# File 'lib/schnorr/ec_point_ext.rb', line 13 def encode(only_x = false) if only_x ECDSA::Format::FieldElementOctetString.encode(x, group.field) else ECDSA::Format::PointOctetString.encode(self, {compression: true}) end end |
#has_even_y? ⇒ Boolean
Check the y-coordinate of this point is an even.
7 8 9 |
# File 'lib/schnorr/ec_point_ext.rb', line 7 def has_even_y? y.even? end |