formating

This commit is contained in:
Christoph J. Scherr 2023-04-27 16:08:15 +02:00
parent afc7f1b76c
commit ab47c1d3f9
Signed by: PlexSheep
GPG Key ID: 25B4ACF7D88186CC
1 changed files with 2 additions and 2 deletions

View File

@ -225,7 +225,7 @@ def test_extension_attack():
""" """
Test the attack against a known last state Test the attack against a known last state
""" """
key = bytearray(0x13377331.to_bytes(16)) key = bytearray(0x133773310000.to_bytes(16))
message = bytearray("1234".encode()) message = bytearray("1234".encode())
ext_message = bytearray("EXT".encode()) ext_message = bytearray("EXT".encode())
# we need to bruteforce this, skip for the test # we need to bruteforce this, skip for the test
@ -235,7 +235,7 @@ def test_extension_attack():
message.extend(ext_message) message.extend(ext_message)
validated_mic = keyed_hash(message, key) validated_mic = keyed_hash(message, key)
assert validated_mic == forged_mic, "forged mic\n%sis not valid\n%s" % ( forged_mic.hex(), validated_mic.hex() ) assert validated_mic == forged_mic, "forged mic\n%sis not valid\n%s" % ( forged_mic.hex(), validated_mic.hex() )
print("Manual extension attack with known last internal state works\n(%s == %s)" % (forged_mic.hex(), validated_mic.hex())) print("Manual extension attack with known last internal state works (%s == %s)" % (forged_mic.hex(), validated_mic.hex()))