예제 #1
0
파일: rebound.py 프로젝트: kste/aeshash
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))
예제 #2
0
파일: rebound.py 프로젝트: kste/aeshash
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