diff options
Diffstat (limited to 'examples/aes256ctr.cpp')
-rw-r--r-- | examples/aes256ctr.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/examples/aes256ctr.cpp b/examples/aes256ctr.cpp index c27d177..1431992 100644 --- a/examples/aes256ctr.cpp +++ b/examples/aes256ctr.cpp @@ -32,11 +32,14 @@ int main() aesni_aes256_expand_key(&key, &encryption_keys); dump_encryption_keys(encryption_keys); - const auto ciphertext = aesni_aes256_encrypt_block_ctr(plaintext, &encryption_keys, iv, 0); + aesni::aes::Block next_iv; + const auto ciphertext = aesni_aes256_encrypt_block_ctr(plaintext, &encryption_keys, iv, &next_iv); dump_ciphertext(ciphertext); + dump_next_iv(next_iv); - const auto decrypted = aesni_aes256_decrypt_block_ctr(ciphertext, &encryption_keys, iv, 0); + const auto decrypted = aesni_aes256_decrypt_block_ctr(ciphertext, &encryption_keys, iv, &next_iv); dump_decrypted(decrypted); + dump_next_iv(next_iv); } catch (const std::exception& e) { |