From 848b52e3a6c7006f98d18fedd6a3db3d1379270b Mon Sep 17 00:00:00 2001 From: Benjamin Loison Date: Sat, 3 Jun 2023 16:32:53 +0200 Subject: [PATCH] Revert #8: Debugging --- prover.py | 12 ------------ verifier.py | 4 ---- 2 files changed, 16 deletions(-) diff --git a/prover.py b/prover.py index c77306c..21ac83d 100755 --- a/prover.py +++ b/prover.py @@ -82,19 +82,14 @@ with open(input('indexesRequest: ')) as f: verificationMerkleTreeLevels = [{} for _ in range(common.LEVELS)] -print(len(indexesRequest)) for indexRequest in indexesRequest: otherIndex = common.otherIndex(indexRequest) - print(indexRequest, otherIndex) for index in [indexRequest, otherIndex]: verificationMerkleTreeLevels[0][index] = merkleTreeLevels[0][index] -print(len(verificationMerkleTreeLevels[0]), verificationMerkleTreeLevels[0]) - # Should rename `entries`, as they aren't *entries* for higher levels. entries = [] for verificationMerkleTreeLevelsIndex, verificationMerkleTreeLevel in enumerate(verificationMerkleTreeLevels[:-1]): - #print('len', len(verificationMerkleTreeLevel)) for index in verificationMerkleTreeLevel: otherIndex = common.otherIndex(index) leftIndex, rightIndex = sorted([index, otherIndex]) @@ -105,16 +100,9 @@ for verificationMerkleTreeLevelsIndex, verificationMerkleTreeLevel in enumerate( if verificationMerkleTreeLevelsIndex == 0: leftNonce = sum(STORED_NONCES[:leftIndex + 1]) rightNonce = leftNonce + STORED_NONCES[rightIndex] - print(leftNonce, rightNonce) entries += [leftNonce, rightNonce] else: - print('once', otherHash) entries += [otherHash] - elif verificationMerkleTreeLevelsIndex == 0: - leftNonce = sum(STORED_NONCES[:leftIndex + 1]) - rightNonce = leftNonce + STORED_NONCES[rightIndex] - print('nope', leftNonce, rightNonce) - entriesFilePath = 'entries.txt' diff --git a/verifier.py b/verifier.py index ab98754..e392792 100755 --- a/verifier.py +++ b/verifier.py @@ -54,16 +54,12 @@ with open(input('entries: ')) as f: merkleTreeLevels = [{} for _ in range(common.LEVELS)] -print(entries[:len(indexesRequest) * 2]) -print(len(indexesRequest)) # 18 for index in indexesRequest: otherIndex = common.otherIndex(index) leftIndex, rightIndex = sorted([index, otherIndex]) for i, nonce in zip([leftIndex, rightIndex], [entries.pop(0) for _ in range(2)]): - print(protocolInitializationPhaseId, str(nonce)) hashed = common.hash(protocolInitializationPhaseId + str(nonce)) if not common.doesHashMatchDifficulty(hashed): - print(hashed) print("The received difficulty doesn't match the claimed one!") exit(1) merkleTreeLevels[0][i] = common.hash(protocolInitializationPhaseId + protocolExecutionPhaseId + str(nonce))