diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2015-06-11 01:24:48 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2015-06-11 01:24:48 +0300 |
commit | 89da534f3cbac2619abdeb125c628b37aa5d3416 (patch) | |
tree | c993835fa1c95b1d22a4e9072b20aa54bb639194 | |
parent | refactoring (diff) | |
download | aes-tools-89da534f3cbac2619abdeb125c628b37aa5d3416.tar.gz aes-tools-89da534f3cbac2619abdeb125c628b37aa5d3416.zip |
code style
-rw-r--r-- | utils/aes128ecb_decrypt_file.cpp | 6 | ||||
-rw-r--r-- | utils/aes128ecb_encrypt_file.cpp | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/utils/aes128ecb_decrypt_file.cpp b/utils/aes128ecb_decrypt_file.cpp index 6be3f94..33e0515 100644 --- a/utils/aes128ecb_decrypt_file.cpp +++ b/utils/aes128ecb_decrypt_file.cpp @@ -57,7 +57,7 @@ int main(int argc, char** argv) src_ifs.exceptions(std::ifstream::badbit | std::ifstream::failbit); src_ifs.open(src_path, std::ifstream::binary); - std::vector<unsigned char> src_buf; + std::vector<char> src_buf; src_buf.reserve(static_cast<std::vector<char>::size_type>(src_size)); src_buf.assign(std::istreambuf_iterator<char>(src_ifs), std::istreambuf_iterator<char>()); @@ -68,7 +68,7 @@ int main(int argc, char** argv) 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)); + std::vector<char> dest_buf(static_cast<std::vector<char>::size_type>(dest_size)); dest_size = aesni_decrypt_buffer_ecb128( src_buf.data(), static_cast<std::size_t>(src_size), dest_buf.data(), &inverted_schedule); @@ -76,7 +76,7 @@ int main(int argc, char** argv) std::ofstream dest_ofs; dest_ofs.exceptions(std::ofstream::badbit | std::ofstream::failbit); dest_ofs.open(dest_path, std::ofstream::binary); - dest_ofs.write(reinterpret_cast<const char*>(dest_buf.data()), dest_size); + dest_ofs.write(dest_buf.data(), dest_size); } catch (const std::exception& e) { diff --git a/utils/aes128ecb_encrypt_file.cpp b/utils/aes128ecb_encrypt_file.cpp index 34a7dae..07c3e91 100644 --- a/utils/aes128ecb_encrypt_file.cpp +++ b/utils/aes128ecb_encrypt_file.cpp @@ -57,7 +57,7 @@ int main(int argc, char** argv) src_ifs.exceptions(std::ifstream::badbit | std::ifstream::failbit); src_ifs.open(src_path, std::ifstream::binary); - std::vector<unsigned char> src_buf; + std::vector<char> src_buf; src_buf.reserve(static_cast<std::vector<char>::size_type>(src_size)); src_buf.assign(std::istreambuf_iterator<char>(src_ifs), std::istreambuf_iterator<char>()); @@ -70,7 +70,7 @@ int main(int argc, char** argv) NULL, &key_schedule); - std::vector<unsigned char> dest_buf(static_cast<std::vector<char>::size_type>(dest_size)); + std::vector<char> dest_buf(static_cast<std::vector<char>::size_type>(dest_size)); aesni_encrypt_buffer_ecb128( src_buf.data(), @@ -81,7 +81,7 @@ int main(int argc, char** argv) std::ofstream dest_ofs; dest_ofs.exceptions(std::ofstream::badbit | std::ofstream::failbit); dest_ofs.open(dest_path, std::ofstream::binary); - dest_ofs.write(reinterpret_cast<const char*>(dest_buf.data()), dest_buf.size()); + dest_ofs.write(dest_buf.data(), dest_buf.size()); } catch (const std::exception& e) { |