From 7c6280aa8ef716262fc93a6fd4ba4bfb47a45636 Mon Sep 17 00:00:00 2001 From: dankrad Date: Fri, 12 Jun 2020 11:16:19 +0100 Subject: [PATCH] Update specs/phase1/custody-game.md Co-authored-by: Hsiao-Wei Wang --- specs/phase1/custody-game.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/specs/phase1/custody-game.md b/specs/phase1/custody-game.md index d05476af3..3875f28e5 100644 --- a/specs/phase1/custody-game.md +++ b/specs/phase1/custody-game.md @@ -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) ```