aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/examples/aes128ctr.cpp
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2015-06-19 01:29:53 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2015-06-19 01:29:53 +0300
commita483e9bd8a7efe3fbad0f0c8ec70d9f5041d86b2 (patch)
tree2b067b04a87a26f68b9a92f40b891c4ff9ddbdda /examples/aes128ctr.cpp
parentadd more block arithmetic functions (diff)
downloadaes-tools-a483e9bd8a7efe3fbad0f0c8ec70d9f5041d86b2.tar.gz
aes-tools-a483e9bd8a7efe3fbad0f0c8ec70d9f5041d86b2.zip
respect the generic interface in CTR functions
Diffstat (limited to 'examples/aes128ctr.cpp')
-rw-r--r--examples/aes128ctr.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/examples/aes128ctr.cpp b/examples/aes128ctr.cpp
index 671a5f3..ebd8793 100644
--- a/examples/aes128ctr.cpp
+++ b/examples/aes128ctr.cpp
@@ -32,11 +32,14 @@ int main()
aesni_aes128_expand_key(&key, &encryption_keys);
dump_encryption_keys(encryption_keys);
- const auto ciphertext = aesni_aes128_encrypt_block_ctr(plaintext, &encryption_keys, iv, 0);
+ aesni::aes::Block next_iv;
+ const auto ciphertext = aesni_aes128_encrypt_block_ctr(plaintext, &encryption_keys, iv, &next_iv);
dump_ciphertext(ciphertext);
+ dump_next_iv(next_iv);
- const auto decrypted = aesni_aes128_decrypt_block_ctr(ciphertext, &encryption_keys, iv, 0);
+ const auto decrypted = aesni_aes128_decrypt_block_ctr(ciphertext, &encryption_keys, iv, &next_iv);
dump_decrypted(decrypted);
+ dump_next_iv(next_iv);
return 0;
}