From 76923761ea90641cde3bd44dfa98e199bf839acc Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Sat, 30 May 2015 05:27:56 +0300 Subject: test: actually chain when in cbc mode --- test/aes128cbc_decrypt_block.c | 1 + test/aes128cbc_encrypt_block.c | 2 +- test/aes192cbc_decrypt_block.c | 1 + test/aes192cbc_encrypt_block.c | 2 +- test/aes256cbc_decrypt_block.c | 1 + test/aes256cbc_encrypt_block.c | 2 +- 6 files changed, 6 insertions(+), 3 deletions(-) (limited to 'test') diff --git a/test/aes128cbc_decrypt_block.c b/test/aes128cbc_decrypt_block.c index 3bd5d74..82a1b61 100644 --- a/test/aes128cbc_decrypt_block.c +++ b/test/aes128cbc_decrypt_block.c @@ -48,6 +48,7 @@ int main(int argc, char** argv) continue; } plain = aes128cbc_decrypt(cipher, &inverted_schedule, &iv); + iv = cipher; print_aes_block128(&plain); } diff --git a/test/aes128cbc_encrypt_block.c b/test/aes128cbc_encrypt_block.c index e35a1bf..38faf1a 100644 --- a/test/aes128cbc_encrypt_block.c +++ b/test/aes128cbc_encrypt_block.c @@ -46,7 +46,7 @@ int main(int argc, char** argv) fprintf(stderr, "Invalid 128-bit AES block '%s'\n", argv[i]); continue; } - cipher = aes128cbc_encrypt(plain, &key_schedule, &iv); + iv = cipher = aes128cbc_encrypt(plain, &key_schedule, &iv); print_aes_block128(&cipher); } diff --git a/test/aes192cbc_decrypt_block.c b/test/aes192cbc_decrypt_block.c index 3d912ba..79eb692 100644 --- a/test/aes192cbc_decrypt_block.c +++ b/test/aes192cbc_decrypt_block.c @@ -49,6 +49,7 @@ int main(int argc, char** argv) continue; } plain = aes192cbc_decrypt(cipher, &inverted_schedule, &iv); + iv = cipher; print_aes_block128(&plain); } diff --git a/test/aes192cbc_encrypt_block.c b/test/aes192cbc_encrypt_block.c index 21765f5..45f469b 100644 --- a/test/aes192cbc_encrypt_block.c +++ b/test/aes192cbc_encrypt_block.c @@ -47,7 +47,7 @@ int main(int argc, char** argv) fprintf(stderr, "Invalid 128-bit AES block '%s'\n", argv[i]); continue; } - cipher = aes192cbc_encrypt(plain, &key_schedule, &iv); + iv = cipher = aes192cbc_encrypt(plain, &key_schedule, &iv); print_aes_block128(&cipher); } diff --git a/test/aes256cbc_decrypt_block.c b/test/aes256cbc_decrypt_block.c index bb082d5..43b8091 100644 --- a/test/aes256cbc_decrypt_block.c +++ b/test/aes256cbc_decrypt_block.c @@ -49,6 +49,7 @@ int main(int argc, char** argv) continue; } plain = aes256cbc_decrypt(cipher, &inverted_schedule, &iv); + iv = cipher; print_aes_block128(&plain); } diff --git a/test/aes256cbc_encrypt_block.c b/test/aes256cbc_encrypt_block.c index 1436020..2877d31 100644 --- a/test/aes256cbc_encrypt_block.c +++ b/test/aes256cbc_encrypt_block.c @@ -47,7 +47,7 @@ int main(int argc, char** argv) fprintf(stderr, "Invalid 128-bit AES block '%s'\n", argv[i]); continue; } - cipher = aes256cbc_encrypt(plain, &key_schedule, &iv); + iv = cipher = aes256cbc_encrypt(plain, &key_schedule, &iv); print_aes_block128(&cipher); } -- cgit v1.2.3