diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2015-06-17 21:09:42 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2015-06-17 21:09:42 +0300 |
commit | 8430473494fcdbf39e02fcff80d51124df728e97 (patch) | |
tree | ba2a30c419e2d2e9fdd05ff697d98e24f1ef1876 /utils | |
parent | factoring out AES-specific stuff (diff) | |
download | aes-tools-8430473494fcdbf39e02fcff80d51124df728e97.tar.gz aes-tools-8430473494fcdbf39e02fcff80d51124df728e97.zip |
refactoring
Diffstat (limited to '')
-rw-r--r-- | utils/aes128ecb_decrypt_file.cpp | 10 | ||||
-rw-r--r-- | utils/aes128ecb_encrypt_file.cpp | 8 |
2 files changed, 9 insertions, 9 deletions
diff --git a/utils/aes128ecb_decrypt_file.cpp b/utils/aes128ecb_decrypt_file.cpp index b2abe8f..0f88144 100644 --- a/utils/aes128ecb_decrypt_file.cpp +++ b/utils/aes128ecb_decrypt_file.cpp @@ -37,7 +37,7 @@ namespace int main(int argc, char** argv) { AesNI_Block128 key; - AesNI_Aes128_RoundKeys key_schedule, inverted_schedule; + AesNI_Aes128_RoundKeys encryption_keys, decryption_keys; if (argc != 4) exit_with_usage(); @@ -60,8 +60,8 @@ int main(int argc, char** argv) src_buf.assign(std::istreambuf_iterator<char>(src_ifs), std::istreambuf_iterator<char>()); - aesni_aes128_expand_key(key, &key_schedule); - aesni_aes128_derive_decryption_keys(&key_schedule, &inverted_schedule); + aesni_aes128_expand_key(key, &encryption_keys); + aesni_aes128_derive_decryption_keys(&encryption_keys, &decryption_keys); std::size_t dest_size; @@ -70,7 +70,7 @@ int main(int argc, char** argv) src_size, NULL, &dest_size, - &inverted_schedule, + &decryption_keys, aesni::ErrorDetailsThrowsInDestructor()); std::vector<char> dest_buf; @@ -81,7 +81,7 @@ int main(int argc, char** argv) src_size, dest_buf.data(), &dest_size, - &inverted_schedule, + &decryption_keys, aesni::ErrorDetailsThrowsInDestructor()); std::ofstream dest_ofs; diff --git a/utils/aes128ecb_encrypt_file.cpp b/utils/aes128ecb_encrypt_file.cpp index 05863c2..c7fef82 100644 --- a/utils/aes128ecb_encrypt_file.cpp +++ b/utils/aes128ecb_encrypt_file.cpp @@ -37,7 +37,7 @@ namespace int main(int argc, char** argv) { AesNI_Block128 key; - AesNI_Aes128_RoundKeys key_schedule; + AesNI_Aes128_RoundKeys encryption_keys; if (argc != 4) exit_with_usage(); @@ -60,7 +60,7 @@ int main(int argc, char** argv) src_buf.assign(std::istreambuf_iterator<char>(src_ifs), std::istreambuf_iterator<char>()); - aesni_aes128_expand_key(key, &key_schedule); + aesni_aes128_expand_key(key, &encryption_keys); std::size_t dest_size; @@ -69,7 +69,7 @@ int main(int argc, char** argv) src_size, NULL, &dest_size, - &key_schedule, + &encryption_keys, aesni::ErrorDetailsThrowsInDestructor()); std::vector<char> dest_buf; @@ -80,7 +80,7 @@ int main(int argc, char** argv) src_size, dest_buf.data(), &dest_size, - &key_schedule, + &encryption_keys, aesni::ErrorDetailsThrowsInDestructor()); std::ofstream dest_ofs; |