#!python -i
from symcollab.moe import *
from symcollab.Unification.p_unif import p_unif
from symcollab.Unification.p_syntactic import p_syntactic
from symcollab.Unification.xor_rooted_unif import XOR_rooted_security

##
### Welcome Message
##
print("Welcome to the MOO Tool")
print("We've exposed the moo_check function for you to use\n")

print("Arguments:")
print("moo_name: String refering to the mode of operation to use.")
print("unif_algo: The unification algorithm to use")
print("schedule: (str) 'every' or 'end'")
print("length_bound: (int) the bound on the length of interactions between advesary and oracle")
print("[optional] knows_iv: (bool) whether or not the advesary knows the initialization vector\n")

print("Ex: moo_check(moo_name = 'cipher_block_chaining', schedule_name = 'every', unif_algo = p_syntactic, length_bound = 10, knows_iv = True)\n")

print("For help, type help(argument_name) where argument_name is a string")
print("Ex: help('unif_algo')")

##
### Help Function
##
def help(argument):
    if argument == "moo_name":
        print("Note that no quotes are needed for chaining functions.")
        print("Available Chaining Functions:")
        print("  cipher_block_chaining : Cipher Block Chaining")
        print("  propogating_cbc  : Propogating Cipher Block Chaining")
        print("  hash_cbc : Hash Cipher Block Chaining")
        print("  cipher_Feedback : Cipher Feedback")
        print("  output_feedback : Output Feedback")
        print("Currently planned but not implemented chaining functions:")
        print("  counter_mode : Counter Mode")
        print("  accumulated_block_cipher : Accumulated Block Cipher")
        print("  double_hash_cbc : Double Hash Cipher Block Chaining")
    elif argument == "schedule_name":
        print("Available schedules:")
        print("  'every' the oracle will send a frame everytime the adversary sends a message")
        print("  'end' the oracle will only send a frame when the advesary marks the end of an interaction")
    elif argument == 'unif_algo':
        print("Available unification algorithms:")
        print("  'p_syntactic' for P Syntactic Unification")
        print("  'p_unif' for P (f-rooted) XOR Unification")
        print("  'XOR_rooted_security for P (xor-rooted) XOR Unification")
        print("Currently planned but not implemeneted unification algorithms:")
        print("  'p_ac' for P-AC Unification")
    elif argument == "length_bound":
        print("An integer argument bounding the length of interactions between the adversary and the oracle")
    elif argument == "knows_iv":
        print("A boolean (True/False) indicating whether or not the advesary knows the initialization vector")
    else:
        print("Argument '%s' is not an argument of moo_check" % argument)
        print("Arguments of moo_check: moo_name, schedule_name, unif_algo, length_bound, knows_iv")
