clean exit

This commit is contained in:
2026-07-02 09:23:06 +02:00
parent acc46eb06a
commit 173426c0d1
+36 -26
View File
@@ -190,35 +190,45 @@ def run_exhaustive_xor_cli():
def main():
print("=" * 50)
print(" Tea3 Model ")
print("=" * 50)
while True:
print("=" * 50)
print(" Tea3 Model ")
print("=" * 50)
print("\nChoose a mode:")
print(" 1) Classic inspection")
print(" 2) Advanced inspection with forced 0 or 1 bits")
print(" 3) Exhaustive variable-change search")
print(" 4) S box analysis")
print(" 5) variable XOR")
print(" 6) F31, F32 analysis")
print(" 7) Exhaustive XOR search")
print("\nChoose a mode:")
print(" 1) Classic inspection")
print(" 2) Advanced inspection with forced 0 or 1 bits")
print(" 3) Exhaustive variable-change search")
print(" 4) S box analysis")
print(" 5) Variable XOR")
print(" 6) F31, F32 analysis")
print(" 7) Exhaustive XOR search")
print(" 0) Exit")
mode = prompt_choice("Your choice (1, 2, 3, 4, 5, 6 or 7): ", {1, 2, 3, 4, 5, 6, 7})
mode = prompt_choice(
"Your choice (0-7): ",
{0, 1, 2, 3, 4, 5, 6, 7}
)
if mode == 1:
run_classic_cli()
elif mode == 2:
run_advanced_cli()
elif mode == 3:
run_exhaustive_cli()
elif mode == 4:
run_sbox()
elif mode == 5:
run_variable_xor_cli()
elif mode == 6:
run_f31f32()
elif mode == 7:
run_exhaustive_xor_cli()
if mode == 0:
print("\nGoodbye")
break
elif mode == 1:
run_classic_cli()
elif mode == 2:
run_advanced_cli()
elif mode == 3:
run_exhaustive_cli()
elif mode == 4:
run_sbox()
elif mode == 5:
run_variable_xor_cli()
elif mode == 6:
run_f31f32()
elif mode == 7:
run_exhaustive_xor_cli()
input("\nPress Enter to return to the main menu...")
print()
main()