# Path: parser/parsesolveroutput.py
# def getCharBoolectorOutput(output, cipher, rounds):
# def getCharSTPOutput(output, cipher, rounds):
# 
# Path: config.py
# PATH_STP = "../stp/build/stp"
# 
# PATH_BOOLECTOR = "../boolector/build/bin/boolector"
# 
# PATH_CRYPTOMINISAT = "../cryptominisat/build/cryptominisat5"
# 
# MAX_WEIGHT = 1000
# 
# MAX_CHARACTERISTICS = 10000000


from parser import parsesolveroutput
from config import (PATH_STP, PATH_BOOLECTOR, PATH_CRYPTOMINISAT, MAX_WEIGHT,
                    MAX_CHARACTERISTICS)
from fractions import gcd
import subprocess
import random
import math
import os
import time
                if parameters["boolector"]:
                    result = solveBoolector(stp_file)
                else:
                    result = solveSTP(stp_file)

                # Check if a characteristic was found
                if foundSolution(result):
                    print("Alpha: {} Beta: {} Gamma: {} Weight: {}".format(
                        alpha, beta, gamma, weight))
                    break
                weight += 1
            constantMinWeights.append(weight)
    print(constantMinWeights)
    return constantMinWeights

def findMinWeightCharacteristic(cipher, parameters):
    """
    Find a characteristic of minimal weight for the cipher
    parameters = [rounds, wordsize, sweight, isIterative, fixedVariables]
    """

    print(("Starting search for characteristic with minimal weight\n"
           "{} - Rounds: {} Wordsize: {}".format(cipher.name,
                                                 parameters["rounds"],
                                                 parameters["wordsize"])))
    print("---")

    start_time = time.time()

    while not reachedTimelimit(start_time, parameters["timelimit"]) and \

# Path: parser/parsesolveroutput.py
# def getCharBoolectorOutput(output, cipher, rounds):
# def getCharSTPOutput(output, cipher, rounds):
# 
# Path: config.py
# PATH_STP = "../stp/build/stp"
# 
# PATH_BOOLECTOR = "../boolector/build/bin/boolector"
# 
# PATH_CRYPTOMINISAT = "../cryptominisat/build/cryptominisat5"
# 
# MAX_WEIGHT = 1000
# 
# MAX_CHARACTERISTICS = 10000000


# Path: cryptanalysis/search.py
from parser import parsesolveroutput
from config import (PATH_STP, PATH_BOOLECTOR, PATH_CRYPTOMINISAT, MAX_WEIGHT,
                    MAX_CHARACTERISTICS)
from fractions import gcd
import subprocess
import random
import math
import os
import time

                if parameters["boolector"]:
                    result = solveBoolector(stp_file)
                else:
                    result = solveSTP(stp_file)

                # Check if a characteristic was found
                if foundSolution(result):
                    print("Alpha: {} Beta: {} Gamma: {} Weight: {}".format(
                        alpha, beta, gamma, weight))
                    break
                weight += 1
            constantMinWeights.append(weight)
    print(constantMinWeights)
    return constantMinWeights

def findMinWeightCharacteristic(cipher, parameters):
    """
    Find a characteristic of minimal weight for the cipher
    parameters = [rounds, wordsize, sweight, isIterative, fixedVariables]
    """

    print(("Starting search for characteristic with minimal weight\n"
           "{} - Rounds: {} Wordsize: {}".format(cipher.name,
                                                 parameters["rounds"],
                                                 parameters["wordsize"])))
    print("---")

    start_time = time.time()

    while not reachedTimelimit(start_time, parameters["timelimit"]) and \

        parameters["sweight"] < MAX_WEIGHT: