MCPcopy Index your code
hub / github.com/petertodd/python-bitcoinlib / get_raw_privkey

Method get_raw_privkey

bitcoin/core/key.py:309–315  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

307 return kdf(r)
308
309 def get_raw_privkey(self):
310 bn = _ssl.EC_KEY_get0_private_key(self.k)
311 bn = ctypes.c_void_p(bn)
312 size = (_ssl.BN_num_bits(bn) + 7) / 8
313 mb = ctypes.create_string_buffer(int(size))
314 _ssl.BN_bn2bin(bn, mb)
315 return mb.raw.rjust(32, b'\x00')
316
317 def _sign_with_libsecp256k1(self, hash):
318 raw_sig = ctypes.create_string_buffer(64)

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected