Implement MerkleCRH
This commit is contained in:
parent
929b36ccfd
commit
3e2b2ab8f8
|
@ -0,0 +1,9 @@
|
|||
#!/usr/bin/env python3
|
||||
from sapling_pedersen import pedersen_hash
|
||||
from sapling_utils import i2lebsp
|
||||
|
||||
MERKLE_DEPTH = 32
|
||||
|
||||
def merkle_crh(layer, left, right):
|
||||
l = i2lebsp(6, MERKLE_DEPTH - 1 - layer)
|
||||
return pedersen_hash(b'Zcash_PH', l + left + right)
|
Loading…
Reference in New Issue