diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2015-06-11 01:15:14 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2015-06-11 01:15:14 +0300 |
commit | 7c14e13c717c25818780ff4cc459d82a2ec0473a (patch) | |
tree | b03d3b5149c43334052c1a4e423df9025544bdd5 /utils | |
parent | fix register usage in the asm implementation (diff) | |
download | aes-tools-7c14e13c717c25818780ff4cc459d82a2ec0473a.tar.gz aes-tools-7c14e13c717c25818780ff4cc459d82a2ec0473a.zip |
refactoring
Diffstat (limited to '')
-rw-r--r-- | utils/aes128ecb_decrypt_file.cpp | 14 | ||||
-rw-r--r-- | utils/aes128ecb_encrypt_file.cpp | 12 |
2 files changed, 13 insertions, 13 deletions
diff --git a/utils/aes128ecb_decrypt_file.cpp b/utils/aes128ecb_decrypt_file.cpp index 60b1546..6be3f94 100644 --- a/utils/aes128ecb_decrypt_file.cpp +++ b/utils/aes128ecb_decrypt_file.cpp @@ -34,13 +34,13 @@ namespace int main(int argc, char** argv) { - AesBlock128 key; - Aes128KeySchedule key_schedule, inverted_schedule; + AesNI_Block128 key; + AesNI_KeySchedule128 key_schedule, inverted_schedule; if (argc != 4) exit_with_usage(); - if (parse_aes_block128(&key, argv[1]) != 0) + if (aesni_parse_block128(&key, argv[1]) != 0) { std::cerr << "Invalid 128-bit AES block '" << argv[1] << "'\n"; exit_with_usage(); @@ -62,15 +62,15 @@ int main(int argc, char** argv) src_buf.assign(std::istreambuf_iterator<char>(src_ifs), std::istreambuf_iterator<char>()); - aes128_expand_key_schedule(key, &key_schedule); - aes128_invert_key_schedule(&key_schedule, &inverted_schedule); + aesni_expand_key_schedule128(key, &key_schedule); + aesni_invert_key_schedule128(&key_schedule, &inverted_schedule); - auto dest_size = aes128ecb_decrypt_buffer( + auto dest_size = aesni_decrypt_buffer_ecb128( src_buf.data(), static_cast<std::size_t>(src_size), NULL, &inverted_schedule); std::vector<unsigned char> dest_buf(static_cast<std::vector<char>::size_type>(dest_size)); - dest_size = aes128ecb_decrypt_buffer( + dest_size = aesni_decrypt_buffer_ecb128( src_buf.data(), static_cast<std::size_t>(src_size), dest_buf.data(), &inverted_schedule); std::ofstream dest_ofs; diff --git a/utils/aes128ecb_encrypt_file.cpp b/utils/aes128ecb_encrypt_file.cpp index 2e24f04..34a7dae 100644 --- a/utils/aes128ecb_encrypt_file.cpp +++ b/utils/aes128ecb_encrypt_file.cpp @@ -34,13 +34,13 @@ namespace int main(int argc, char** argv) { - AesBlock128 key; - Aes128KeySchedule key_schedule; + AesNI_Block128 key; + AesNI_KeySchedule128 key_schedule; if (argc != 4) exit_with_usage(); - if (parse_aes_block128(&key, argv[1]) != 0) + if (aesni_parse_block128(&key, argv[1]) != 0) { std::cerr << "Invalid 128-bit AES block '" << argv[1] << "'\n"; exit_with_usage(); @@ -62,9 +62,9 @@ int main(int argc, char** argv) src_buf.assign(std::istreambuf_iterator<char>(src_ifs), std::istreambuf_iterator<char>()); - aes128_expand_key_schedule(key, &key_schedule); + aesni_expand_key_schedule128(key, &key_schedule); - const auto dest_size = aes128ecb_encrypt_buffer( + const auto dest_size = aesni_encrypt_buffer_ecb128( src_buf.data(), static_cast<std::size_t>(src_size), NULL, @@ -72,7 +72,7 @@ int main(int argc, char** argv) std::vector<unsigned char> dest_buf(static_cast<std::vector<char>::size_type>(dest_size)); - aes128ecb_encrypt_buffer( + aesni_encrypt_buffer_ecb128( src_buf.data(), static_cast<std::size_t>(src_size), dest_buf.data(), |