Ejemplo n.º 1
0
def computeInverseLinearStepList():
    """
    Compute the list of all possible values for 
    (x 0 0 0 0 0 0 0) * Linverse = (y0 y1 y2 y3 y4 y5 y6 y7)
    """    
    global InverseLinearStepList
    gost = GOST()
    for value in range(1, 256):
        gost.setValue(0, 0, value)
        InverseLinearStepList.append(gost.Linverse().getRow(0))
Ejemplo n.º 2
0
def propagateDifferencesThroughSin(state):
    """
    Returns a state containing a possible input difference after applying
    the inverse S-Box for the given output difference.
    """
    result = GOST()
    for x in range(8):
        for y in range(8):
            result.setValue(x, y, sample(getValidDiffsForInputDiff(state.getValue(x, y)), 1)[0])
    return result