Update specs/phase1/custody-game.md

Co-authored-by: Hsiao-Wei Wang <hwwang156@gmail.com>
This commit is contained in:
dankrad
2020-06-12 11:16:19 +01:00
committed by GitHub
parent bcfaa1b635
commit 7c6280aa8e

View File

@@ -264,8 +264,12 @@ def compute_custody_bit(key: BLSSignature, data: ByteList[MAX_SHARD_BLOCK_SIZE])
secrets = get_custody_secrets(key)
custody_atoms = get_custody_atoms(data)
n = len(custody_atoms)
uhf = (sum(secrets[i % CUSTODY_SECRETS]**i * int.from_bytes(atom, "little") % CUSTODY_PRIME
for i, atom in enumerate(custody_atoms)) + secrets[n % CUSTODY_SECRETS]**n) % CUSTODY_PRIME
uhf = (
sum(
secrets[i % CUSTODY_SECRETS]**i * int.from_bytes(atom, "little") % CUSTODY_PRIME
for i, atom in enumerate(custody_atoms)
) + secrets[n % CUSTODY_SECRETS]**n
) % CUSTODY_PRIME
return legendre_bit(uhf + secrets[0], CUSTODY_PRIME)
```