(use aes) (use crypto-tools) (let* ((encryptor (make-aes128-encryptor (hexstring->blob "00010203050607080A0B0C0D0F101112"))) (decryptor (make-aes128-decryptor (hexstring->blob "00010203050607080A0B0C0D0F101112"))) (encrypted (encryptor (hexstring->blob "506812A45F08C889B97F5980038B8359"))) (encrypted-string (blob->hexstring/uppercase encrypted)) (decrypted (decryptor encrypted)) (decrypted-string (blob->hexstring/uppercase decrypted))) (printf "Test vector 1a: ~A\n" encrypted-string) (printf "Test vector 1b: ~A\n" decrypted-string) (assert (string=? encrypted-string "D8F532538289EF7D06B506A4FD5BE9C9")) (assert (string=? decrypted-string "506812A45F08C889B97F5980038B8359"))) (let* ((encryptor (make-aes128-encryptor (hexstring->blob "E8E9EAEBEDEEEFF0F2F3F4F5F7F8F9FA"))) (decryptor (make-aes128-decryptor (hexstring->blob "E8E9EAEBEDEEEFF0F2F3F4F5F7F8F9FA"))) (encrypted (encryptor (hexstring->blob "014BAF2278A69D331D5180103643E99A"))) (encrypted-string (blob->hexstring/uppercase encrypted)) (decrypted (decryptor encrypted)) (decrypted-string (blob->hexstring/uppercase decrypted))) (printf "Test vector 2a: ~A\n" encrypted-string) (printf "Test vector 2b: ~A\n" decrypted-string) (assert (string=? encrypted-string "6743C3D1519AB4F2CD9A78AB09A511BD")) (assert (string=? decrypted-string "014BAF2278A69D331D5180103643E99A"))) (let* ((encryptor (make-aes192-encryptor (hexstring->blob "04050607090A0B0C0E0F10111314151618191A1B1D1E1F20"))) (decryptor (make-aes192-decryptor (hexstring->blob "04050607090A0B0C0E0F10111314151618191A1B1D1E1F20"))) (encrypted (encryptor (hexstring->blob "76777475F1F2F3F4F8F9E6E777707172"))) (encrypted-string (blob->hexstring/uppercase encrypted)) (decrypted (decryptor encrypted)) (decrypted-string (blob->hexstring/uppercase decrypted))) (printf "Test vector 3a: ~A\n" encrypted-string) (printf "Test vector 3b: ~A\n" decrypted-string) (assert (string=? encrypted-string "5D1EF20DCED6BCBC12131AC7C54788AA")) (assert (string=? decrypted-string "76777475F1F2F3F4F8F9E6E777707172"))) (let* ((encryptor (make-aes256-encryptor (hexstring->blob "08090A0B0D0E0F10121314151718191A1C1D1E1F21222324262728292B2C2D2E"))) (decryptor (make-aes256-decryptor (hexstring->blob "08090A0B0D0E0F10121314151718191A1C1D1E1F21222324262728292B2C2D2E"))) (encrypted (encryptor (hexstring->blob "069A007FC76A459F98BAF917FEDF9521"))) (encrypted-string (blob->hexstring/uppercase encrypted)) (decrypted (decryptor encrypted)) (decrypted-string (blob->hexstring/uppercase decrypted))) (printf "Test vector 4a: ~A\n" encrypted-string) (printf "Test vector 4b: ~A\n" decrypted-string) (assert (string=? encrypted-string "080E9517EB1677719ACF728086040AE3")) (assert (string=? decrypted-string "069A007FC76A459F98BAF917FEDF9521")))