clean exit
This commit is contained in:
+36
-26
@@ -190,35 +190,45 @@ def run_exhaustive_xor_cli():
|
|||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
print("=" * 50)
|
while True:
|
||||||
print(" Tea3 Model ")
|
print("=" * 50)
|
||||||
print("=" * 50)
|
print(" Tea3 Model ")
|
||||||
|
print("=" * 50)
|
||||||
|
|
||||||
print("\nChoose a mode:")
|
print("\nChoose a mode:")
|
||||||
print(" 1) Classic inspection")
|
print(" 1) Classic inspection")
|
||||||
print(" 2) Advanced inspection with forced 0 or 1 bits")
|
print(" 2) Advanced inspection with forced 0 or 1 bits")
|
||||||
print(" 3) Exhaustive variable-change search")
|
print(" 3) Exhaustive variable-change search")
|
||||||
print(" 4) S box analysis")
|
print(" 4) S box analysis")
|
||||||
print(" 5) variable XOR")
|
print(" 5) Variable XOR")
|
||||||
print(" 6) F31, F32 analysis")
|
print(" 6) F31, F32 analysis")
|
||||||
print(" 7) Exhaustive XOR search")
|
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:
|
if mode == 0:
|
||||||
run_classic_cli()
|
print("\nGoodbye")
|
||||||
elif mode == 2:
|
break
|
||||||
run_advanced_cli()
|
elif mode == 1:
|
||||||
elif mode == 3:
|
run_classic_cli()
|
||||||
run_exhaustive_cli()
|
elif mode == 2:
|
||||||
elif mode == 4:
|
run_advanced_cli()
|
||||||
run_sbox()
|
elif mode == 3:
|
||||||
elif mode == 5:
|
run_exhaustive_cli()
|
||||||
run_variable_xor_cli()
|
elif mode == 4:
|
||||||
elif mode == 6:
|
run_sbox()
|
||||||
run_f31f32()
|
elif mode == 5:
|
||||||
elif mode == 7:
|
run_variable_xor_cli()
|
||||||
run_exhaustive_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()
|
main()
|
||||||
|
|||||||
Reference in New Issue
Block a user