aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/examples/aes192cfb_example.c
diff options
context:
space:
mode:
Diffstat (limited to 'examples/aes192cfb_example.c')
-rw-r--r--examples/aes192cfb_example.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/examples/aes192cfb_example.c b/examples/aes192cfb_example.c
index fe6340b..d3ac8bc 100644
--- a/examples/aes192cfb_example.c
+++ b/examples/aes192cfb_example.c
@@ -12,7 +12,7 @@
int main()
{
- __declspec(align(16)) AesBlock128 plain, cypher, decrypted, iv;
+ __declspec(align(16)) AesBlock128 plain, cypher, decrypted, iv, next_iv;
__declspec(align(16)) AesBlock192 key;
__declspec(align(16)) Aes192KeySchedule key_schedule;
@@ -38,15 +38,23 @@ int main()
for (int i = 0; i < 13; ++i)
printf("\t[%d]: %s\n", i, format_aes_block128(&key_schedule.keys[i]).str);
- cypher = aes192cfb_encrypt(plain, &key_schedule, iv);
+ cypher = aes192cfb_encrypt(plain, &key_schedule, iv, &next_iv);
printf("\n");
printf("Cypher: %s\n", format_aes_block128(&cypher).str);
print_aes_block128_fips_matrix_style(&cypher);
- decrypted = aes192cfb_decrypt(cypher, &key_schedule, iv);
+ printf("\n");
+ printf("Next initialization vector: %s\n", format_aes_block128(&next_iv).str);
+ print_aes_block128_fips_matrix_style(&next_iv);
+
+ decrypted = aes192cfb_decrypt(cypher, &key_schedule, iv, &next_iv);
printf("\n");
printf("Decrypted: %s\n", format_aes_block128(&decrypted).str);
print_aes_block128_fips_matrix_style(&decrypted);
+ printf("\n");
+ printf("Next initialization vector: %s\n", format_aes_block128(&next_iv).str);
+ print_aes_block128_fips_matrix_style(&next_iv);
+
return 0;
}