aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/examples/aes128cbc.cpp
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2015-06-17 23:25:52 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2015-06-17 23:25:52 +0300
commit44d58e0a10c7dfdb33899fa98c0eea790e0b90ce (patch)
tree646541b156ffdd88bbaa4f1fa860aed465dfce60 /examples/aes128cbc.cpp
parentrefactoring (diff)
downloadaes-tools-44d58e0a10c7dfdb33899fa98c0eea790e0b90ce.tar.gz
aes-tools-44d58e0a10c7dfdb33899fa98c0eea790e0b90ce.zip
factoring out AES-specific stuff
Diffstat (limited to 'examples/aes128cbc.cpp')
-rw-r--r--examples/aes128cbc.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/examples/aes128cbc.cpp b/examples/aes128cbc.cpp
index 5bb8c67..b6253e6 100644
--- a/examples/aes128cbc.cpp
+++ b/examples/aes128cbc.cpp
@@ -19,29 +19,29 @@ int main()
{
try
{
- aesni::Block128 plaintext;
+ aesni::aes::Block plaintext;
make_default_plaintext(plaintext);
- aesni::Block128 key;
+ aesni::aes::Key128 key;
make_default_key(key);
- aesni::Block128 iv;
+ aesni::aes::Block iv;
make_default_iv(iv);
- aesni::KeySchedule128 encryption_schedule;
- aesni_aes128_expand_key(key, &encryption_schedule);
+ aesni::aes::RoundKeys128 encryption_schedule;
+ aesni_aes128_expand_key(&key, &encryption_schedule);
dump_encryption_schedule(encryption_schedule);
- aesni::Block128 next_iv;
+ aesni::aes::Block next_iv;
const auto ciphertext = aesni_aes128_encrypt_block_cbc(plaintext, &encryption_schedule, iv, &next_iv);
dump_ciphertext(ciphertext);
dump_next_iv(next_iv);
- aesni::KeySchedule128 decryption_schedule;
+ aesni::aes::RoundKeys128 decryption_schedule;
aesni_aes128_derive_decryption_keys(&encryption_schedule, &decryption_schedule);
dump_decryption_schedule(decryption_schedule);
- aesni::Block128 decrypted = aesni_aes128_decrypt_block_cbc(ciphertext, &decryption_schedule, iv, &next_iv);
+ aesni::aes::Block decrypted = aesni_aes128_decrypt_block_cbc(ciphertext, &decryption_schedule, iv, &next_iv);
dump_decrypted(decrypted);
dump_next_iv(next_iv);