MCPcopy Create free account
hub / github.com/ElementsProject/elements / get_bytes

Method get_bytes

test/functional/test_framework/key.py:260–268  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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.

Callers 1

run_testMethod · 0.95

Calls 1

affineMethod · 0.80

Tested by

no test coverage detected