Encode the point into the compressed form.
(self)
| 111 | return x_str + y_str |
| 112 | |
| 113 | def _compressed_encode(self): |
| 114 | """Encode the point into the compressed form.""" |
| 115 | order = self.pubkey.order |
| 116 | x_str = number_to_string(self.pubkey.point.x(), order) |
| 117 | if self.pubkey.point.y() & 1: |
| 118 | return b"\x03" + x_str |
| 119 | return b"\x02" + x_str |
| 120 | |
| 121 | def to_string(self, encoding = 'uncompressed'): |
| 122 | if encoding == "compressed": |
no test coverage detected