diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2017-07-27 23:45:04 +0200 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2017-07-27 23:45:04 +0200 |
commit | bb078fd01e6568982044e0f846029b9670f7f6df (patch) | |
tree | 3d262bd23749c977a18542096515b0c9144dd5d2 /utils | |
parent | test: support running scripts from other dirs (diff) | |
download | aes-tools-bb078fd01e6568982044e0f846029b9670f7f6df.tar.gz aes-tools-bb078fd01e6568982044e0f846029b9670f7f6df.zip |
code style
Diffstat (limited to 'utils')
-rw-r--r-- | utils/block_dumper.hpp | 16 | ||||
-rw-r--r-- | utils/decrypt_block.cpp | 2 | ||||
-rw-r--r-- | utils/decrypt_file.cpp | 3 | ||||
-rw-r--r-- | utils/encrypt_block.cpp | 2 | ||||
-rw-r--r-- | utils/encrypt_file.cpp | 3 |
5 files changed, 17 insertions, 9 deletions
diff --git a/utils/block_dumper.hpp b/utils/block_dumper.hpp index 00f75f1..a07d855 100644 --- a/utils/block_dumper.hpp +++ b/utils/block_dumper.hpp @@ -46,7 +46,9 @@ void dump_iv(const typename aes::Types<algorithm>::Block& iv) } template <aes::Algorithm algorithm> -void dump_round_keys(const char* header, const typename aes::Types<algorithm>::RoundKeys& round_keys) +void dump_round_keys( + const char* header, + const typename aes::Types<algorithm>::RoundKeys& round_keys) { std::cout << header << ":\n"; for (std::size_t i = 0; i < aes::get_number_of_rounds<algorithm>(); ++i) @@ -78,22 +80,26 @@ void dump_wrapper(const aes::DecryptWrapper<algorithm, mode>& wrapper) dump_decryption_keys<algorithm>(wrapper.decryption_keys); } -template <aes::Algorithm algorithm, aes::Mode mode, typename std::enable_if<aes::ModeRequiresInitVector<mode>::value>::type* = nullptr> +template <aes::Algorithm algorithm, aes::Mode mode, + typename std::enable_if<aes::ModeRequiresInitVector<mode>::value>::type* = nullptr> void dump_next_iv(const aes::EncryptWrapper<algorithm, mode>& wrapper) { dump_block<algorithm>("Next initialization vector", wrapper.iv); } -template <aes::Algorithm algorithm, aes::Mode mode, typename std::enable_if<!aes::ModeRequiresInitVector<mode>::value>::type* = nullptr> +template <aes::Algorithm algorithm, aes::Mode mode, + typename std::enable_if<!aes::ModeRequiresInitVector<mode>::value>::type* = nullptr> void dump_next_iv(const aes::EncryptWrapper<algorithm, mode>&) { } -template <aes::Algorithm algorithm, aes::Mode mode, typename std::enable_if<aes::ModeRequiresInitVector<mode>::value>::type* = nullptr> +template <aes::Algorithm algorithm, aes::Mode mode, + typename std::enable_if<aes::ModeRequiresInitVector<mode>::value>::type* = nullptr> void dump_next_iv(const aes::DecryptWrapper<algorithm, mode>& wrapper) { dump_block<algorithm>("Next initialization vector", wrapper.iv); } -template <aes::Algorithm algorithm, aes::Mode mode, typename std::enable_if<!aes::ModeRequiresInitVector<mode>::value>::type* = nullptr> +template <aes::Algorithm algorithm, aes::Mode mode, + typename std::enable_if<!aes::ModeRequiresInitVector<mode>::value>::type* = nullptr> void dump_next_iv(const aes::DecryptWrapper<algorithm, mode>&) { } diff --git a/utils/decrypt_block.cpp b/utils/decrypt_block.cpp index 1337d55..02a3033 100644 --- a/utils/decrypt_block.cpp +++ b/utils/decrypt_block.cpp @@ -37,7 +37,7 @@ namespace if (verbose) dump_key<algorithm>(key); - aes::DecryptWrapper<algorithm, mode> decrypt(key, iv); + aes::DecryptWrapper<algorithm, mode> decrypt{key, iv}; if (verbose) dump_wrapper<algorithm, mode>(decrypt); diff --git a/utils/decrypt_file.cpp b/utils/decrypt_file.cpp index beaabff..6da3d17 100644 --- a/utils/decrypt_file.cpp +++ b/utils/decrypt_file.cpp @@ -24,7 +24,8 @@ namespace { const auto ciphertext_buf = file::read_file(ciphertext_path); const auto plaintext_buf = box.decrypt_buffer( - ciphertext_buf.data(), ciphertext_buf.size()); + ciphertext_buf.data(), + ciphertext_buf.size()); file::write_file(plaintext_path, plaintext_buf); } diff --git a/utils/encrypt_block.cpp b/utils/encrypt_block.cpp index b8cb55e..0b87364 100644 --- a/utils/encrypt_block.cpp +++ b/utils/encrypt_block.cpp @@ -37,7 +37,7 @@ namespace if (verbose) dump_key<algorithm>(key); - aes::EncryptWrapper<algorithm, mode> encrypt(key, iv); + aes::EncryptWrapper<algorithm, mode> encrypt{key, iv}; if (verbose) dump_wrapper<algorithm, mode>(encrypt); diff --git a/utils/encrypt_file.cpp b/utils/encrypt_file.cpp index c5fa41f..570bc60 100644 --- a/utils/encrypt_file.cpp +++ b/utils/encrypt_file.cpp @@ -24,7 +24,8 @@ namespace { const auto plaintext_buf = file::read_file(plaintext_path); const auto ciphertext_buf = box.encrypt_buffer( - plaintext_buf.data(), plaintext_buf.size()); + plaintext_buf.data(), + plaintext_buf.size()); file::write_file(ciphertext_path, ciphertext_buf); } |