(self)
| 258 | return self.valid |
| 259 | |
| 260 | def get_bytes(self): |
| 261 | assert(self.valid) |
| 262 | p = SECP256K1.affine(self.p) |
| 263 | if p is None: |
| 264 | return None |
| 265 | if self.compressed: |
| 266 | return bytes([0x02 + (p[1] & 1)]) + p[0].to_bytes(32, 'big') |
| 267 | else: |
| 268 | return bytes([0x04]) + p[0].to_bytes(32, 'big') + p[1].to_bytes(32, 'big') |
| 269 | |
| 270 | def verify_ecdsa(self, sig, msg, low_s=True): |
| 271 | """Verify a strictly DER-encoded ECDSA signature against this pubkey. |