Beispiel #1
0
def visualize_speck():
    left = 0
    right = 1
    key = 2
    modulus = 0xFFFFFFFFFFFFFFFF
    from crypto.analysis.visualization import test_4x64_function, print_state_4x64_256
    test_4x64_function(speck_round, (left, right, key, modulus), print_function=lambda data: print_state_4x64_256(data))
Beispiel #2
0
def visualize_round_function():
    data = [0, 0, 0, 1]    
    
    CONSTANTS = iter(range(1, 128))
    def test_function(a, b, c, d):
        return round_function(a, b, c, d, next(CONSTANTS))                
    from crypto.analysis.visualization import test_4x64_function
    test_4x64_function(test_function, data)
Beispiel #3
0
def visualize_speck():
    left = 0
    right = 1
    key = 2
    modulus = 0xFFFFFFFFFFFFFFFF
    from crypto.analysis.visualization import test_4x64_function, print_state_4x64_256
    test_4x64_function(speck_round, (left, right, key, modulus),
                       print_function=lambda data: print_state_4x64_256(data))
Beispiel #4
0
def visualize_bit_shuffle():
    data = [0, 0, 15, 1]
    key = [0, 0, 0, 3]

    def test_function(a, b, c, d):
        return bit_shuffle(a, b, c, d, key)

    from crypto.analysis.visualization import test_4x64_function
    test_4x64_function(test_function, data)
Beispiel #5
0
def visualize_bit_shuffle():
    data = [0, 0, 15, 1]
    key = [0, 0, 0, 3]
    
    def test_function(a, b, c, d):
        return bit_shuffle(a, b, c, d, key)
                
    from crypto.analysis.visualization import test_4x64_function
    test_4x64_function(test_function, data)
Beispiel #6
0
def test_choice_diffusion():
    from crypto.analysis.visualization import test_4x64_function
    test_4x64_function(choice_diffusion, (1, 2, 4, 8, 1, 2, 4, 8))
Beispiel #7
0
def visualize_permutation():
    from crypto.analysis.visualization import test_4x64_function, print_state_4x64_256_as_4x64
    test_4x64_function(permutation, (0, 0, 0, 1), print_state_4x64_256_as_4x64)
Beispiel #8
0
def test_shift_rows():
    from crypto.analysis.visualization import test_4x64_function
    test_4x64_function(shift_rows, [1 | (1 << 16) | (1 << 32) | (1 << 48) for count in range(4)])            
Beispiel #9
0
def test_test_mixer():
    from crypto.analysis.visualization import test_4x64_function, print_state_4x64_256_as_4x64
    test_4x64_function(_test_mixer, (0, 0, 0, 1 << 1), print_state_4x64_256_as_4x64)# [1 | (1 << 16) | (1 << 32) | (1 << 48) for count in range(4)])
Beispiel #10
0
def test_shuffle_mix():
    inputs = [1 | (1 << 16) | (1 << 32) | (1 << 48), 0, 0, 0]      
    inputs[0] = 1
    test_4x64_function(shuffle_mix, inputs)
Beispiel #11
0
def test_choice_diffusion():
    from crypto.analysis.visualization import test_4x64_function
    test_4x64_function(choice_diffusion, (1, 2, 4, 8, 1, 2, 4, 8))
Beispiel #12
0
def test_round_function2():
    from crypto.analysis.visualization import test_4x64_function
    test_4x64_function(round_function2, (1, 0, 0, 0, 1))
Beispiel #13
0
def test_shuffle_mix():
    inputs = [1 | (1 << 16) | (1 << 32) | (1 << 48), 0, 0, 0]
    inputs[0] = 1
    test_4x64_function(shuffle_mix, inputs)
Beispiel #14
0
def test_round_function2():
    from crypto.analysis.visualization import test_4x64_function
    test_4x64_function(round_function2, (1, 0, 0, 0, 1))