Fix #11: Attack by using a nonce multiple times

This commit is contained in:
Benjamin Loison 2023-06-08 14:11:07 +02:00
parent 08b4de8b61
commit 8c98a259ad
Signed by: Benjamin_Loison
SSH Key Fingerprint: SHA256:BtnEgYTlHdOg1u+RmYcDE0mnfz1rhv5dSbQ2gyxW8B8

View File

@ -55,6 +55,15 @@ while True:
with open(input('entries: ')) as f:
entries = ast.literal_eval(f.read())
nonces = set()
for entry in entries:
if type(entry) == str:
break
if entry in nonces:
print('A given nonce was used several times!')
exit(1)
nonces.add(entry)
merkleTreeLevels = [{} for _ in range(common.LEVELS)]
for index in indexesRequest: