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

Function TaggedHash

test/functional/test_framework/key.py:18–22  ·  view source on GitHub ↗
(tag, data)

Source from the content-addressed store, hash-verified

16from .util import modinv
17
18def TaggedHash(tag, data):
19 ss = hashlib.sha256(tag.encode('utf-8')).digest()
20 ss += ss
21 ss += data
22 return hashlib.sha256(ss).digest()
23
24def jacobi_symbol(n, k):
25 """Compute the Jacobi symbol of n modulo k

Callers 7

TaprootSignatureMsgFunction · 0.70
TaprootSignatureHashFunction · 0.70
taproot_tree_helperFunction · 0.70
taproot_constructFunction · 0.70
verify_schnorrFunction · 0.70
sign_schnorrFunction · 0.70
default_sighashFunction · 0.50

Calls 2

digestMethod · 0.80
encodeMethod · 0.45

Tested by

no test coverage detected