OOP API wrapper for AES
Test AES encryption and decryption of a single block with 128, 192 and 256 bits key length. test vectors from http://www.inconteam.com/software-development/41-encryption/55-aes-test-vectors
1 2 static string[] test_keys = [ 3 x"2b7e151628aed2a6abf7158809cf4f3c", 4 x"8e73b0f7da0e6452c810f32b809079e562f8ead2522c6b7b", 5 x"603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4", 6 x"603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4" 7 ]; 8 9 static string[] test_plaintexts = [ 10 x"6bc1bee22e409f96e93d7e117393172a", 11 x"6bc1bee22e409f96e93d7e117393172a", 12 x"6bc1bee22e409f96e93d7e117393172a", 13 x"ae2d8a571e03ac9c9eb76fac45af8e51" 14 ]; 15 16 static string[] test_ciphertexts = [ 17 x"3ad77bb40d7a3660a89ecaf32466ef97", 18 x"bd334f1d6e45f25ff712a214571fa5cc", 19 x"f3eed1bdb5d2a03c064b5a7e3db181f8", 20 x"591ccb10d410ed26dc5ba74a31362870" 21 22 ]; 23 24 AESEngine t = new AESEngine(); 25 26 blockCipherTest(t, test_keys, test_plaintexts, test_ciphertexts);