aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/utils
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2015-06-10 03:56:20 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2015-06-10 03:56:20 +0300
commit7468cbc7c4e69bbd2593c71c8a22953f41536963 (patch)
treebbc0b0ebb62ceb7385a418701897cb5577f035f9 /utils
parentutils: usage message update (diff)
downloadaes-tools-7468cbc7c4e69bbd2593c71c8a22953f41536963.tar.gz
aes-tools-7468cbc7c4e69bbd2593c71c8a22953f41536963.zip
refactoring
Diffstat (limited to 'utils')
-rw-r--r--utils/aes128ecb_decrypt_file.cpp4
-rw-r--r--utils/aes128ecb_encrypt_file.cpp16
2 files changed, 12 insertions, 8 deletions
diff --git a/utils/aes128ecb_decrypt_file.cpp b/utils/aes128ecb_decrypt_file.cpp
index 42432bb..a405882 100644
--- a/utils/aes128ecb_decrypt_file.cpp
+++ b/utils/aes128ecb_decrypt_file.cpp
@@ -66,12 +66,12 @@ int main(int argc, char** argv)
aes128_expand_key_schedule(key, &key_schedule);
aes128_invert_key_schedule(&key_schedule, &inverted_schedule);
- auto dest_size = aes128ecb_decrypt_file(
+ auto dest_size = aes128ecb_decrypt_buffer(
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_file(
+ dest_size = aes128ecb_decrypt_buffer(
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 aba8569..bcb5293 100644
--- a/utils/aes128ecb_encrypt_file.cpp
+++ b/utils/aes128ecb_encrypt_file.cpp
@@ -65,15 +65,19 @@ int main(int argc, char** argv)
aes128_expand_key_schedule(key, &key_schedule);
- const auto dest_size = aes128ecb_encrypt_file(
- src_buf.data(), static_cast<std::size_t>(src_size), NULL, &key_schedule);
+ const auto dest_size = aes128ecb_encrypt_buffer(
+ src_buf.data(),
+ static_cast<std::size_t>(src_size),
+ NULL,
+ &key_schedule);
std::vector<unsigned char> dest_buf(static_cast<std::vector<char>::size_type>(dest_size));
- aes128ecb_encrypt_file(src_buf.data(),
- static_cast<std::size_t>(src_size),
- dest_buf.data(),
- &key_schedule);
+ aes128ecb_encrypt_buffer(
+ src_buf.data(),
+ static_cast<std::size_t>(src_size),
+ dest_buf.data(),
+ &key_schedule);
std::ofstream dest_ofs;
dest_ofs.exceptions(std::ofstream::badbit | std::ofstream::failbit);