Esempio n. 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))
Esempio n. 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)
Esempio n. 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))
Esempio n. 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)
Esempio n. 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)
Esempio n. 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))
Esempio n. 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)
Esempio n. 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)])            
Esempio n. 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)])
Esempio n. 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)
Esempio n. 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))
Esempio n. 12
0
def test_round_function2():
    from crypto.analysis.visualization import test_4x64_function
    test_4x64_function(round_function2, (1, 0, 0, 0, 1))
Esempio n. 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)
Esempio n. 14
0
def test_round_function2():
    from crypto.analysis.visualization import test_4x64_function
    test_4x64_function(round_function2, (1, 0, 0, 0, 1))