Esempio n. 1
0
def test_decrypt_aes_vector_set(aes_vector_set):
    for vector in AES_VECTOR_SETS[aes_vector_set]:
        assert cipher.decrypt(vector.key, vector.ciphertext,
                              bytes_to_long(vector.iv)) == vector.plaintext
Esempio n. 2
0
def test_decrypt_aes_vector_set(aes_vector_set):
    for vector in AES_VECTOR_SETS[aes_vector_set]:
        assert cipher.decrypt(vector.key,
                              vector.ciphertext,
                              bytes_to_long(vector.iv)) == vector.plaintext
Esempio n. 3
0
def test_aes_counter_length_based_on_key(key_length):
    key = b'\x00' * key_length
    plaintext = b'\x01' * key_length
    ciphertext = cipher.encrypt(key, plaintext)
    cipher.decrypt(key, ciphertext)
Esempio n. 4
0
def test_aes_counter_length_based_on_key(key_length):
    key = b'\x00' * key_length
    plaintext = b'\x01' * key_length
    ciphertext = cipher.encrypt(key, plaintext)
    cipher.decrypt(key, ciphertext)