mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-22 04:38:55 +02:00
crypto: add NUMS_H const
This commit is contained in:
@@ -15,6 +15,8 @@ Exports:
|
||||
* G: the secp256k1 generator point
|
||||
"""
|
||||
|
||||
import unittest
|
||||
from hashlib import sha256
|
||||
|
||||
class FE:
|
||||
"""Objects of this class represent elements of the field GF(2**256 - 2**32 - 977).
|
||||
@@ -344,3 +346,9 @@ class FastGEMul:
|
||||
|
||||
# Precomputed table with multiples of G for fast multiplication
|
||||
FAST_G = FastGEMul(G)
|
||||
|
||||
class TestFrameworkSecp256k1(unittest.TestCase):
|
||||
def test_H(self):
|
||||
H = sha256(G.to_bytes_uncompressed()).digest()
|
||||
assert GE.lift_x(FE.from_bytes(H)) is not None
|
||||
self.assertEqual(H.hex(), "50929b74c1a04954b78b4b6035e97a5e078a5a0f28ec96d547bfee9ace803ac0")
|
||||
|
||||
Reference in New Issue
Block a user