MCPcopy Index your code
hub / github.com/jimmysong/programmingbitcoin / test_sign

Method test_sign

code-ch13/ecc.py:673–677  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

671class PrivateKeyTest(TestCase):
672
673 def test_sign(self):
674 pk = PrivateKey(randint(0, N))
675 z = randint(0, 2**256)
676 sig = pk.sign(z)
677 self.assertTrue(pk.point.verify(z, sig))
678
679 def test_wif(self):
680 pk = PrivateKey(2**256 - 2**199)

Callers

nothing calls this directly

Calls 3

signMethod · 0.95
PrivateKeyClass · 0.70
verifyMethod · 0.45

Tested by

no test coverage detected