diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2017-05-04 04:08:15 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2017-05-04 04:08:15 +0300 |
commit | 188460a91bd37ca6f18fb89e448819b642953be7 (patch) | |
tree | 12fa7b29fa207240fe8ddf19d70f5a5333bf1233 /utils/encrypt_block.cpp | |
parent | refactoring (diff) | |
download | aes-tools-188460a91bd37ca6f18fb89e448819b642953be7.tar.gz aes-tools-188460a91bd37ca6f18fb89e448819b642953be7.zip |
code style & refactoring
Diffstat (limited to '')
-rw-r--r-- | utils/encrypt_block.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/utils/encrypt_block.cpp b/utils/encrypt_block.cpp index 340e18b..5c02d92 100644 --- a/utils/encrypt_block.cpp +++ b/utils/encrypt_block.cpp @@ -27,13 +27,13 @@ namespace if (aes::ModeRequiresInitVector<mode>::value) { - aes::from_string<algorithm>(iv, input.get_iv_string()); + aes::from_string<algorithm>(iv, input.iv); if (verbose) dump_iv<algorithm>(iv); } typename aes::Types<algorithm>::Key key; - aes::from_string<algorithm>(key, input.get_key_string()); + aes::from_string<algorithm>(key, input.key); if (verbose) dump_key<algorithm>(key); @@ -41,7 +41,7 @@ namespace if (verbose) dump_wrapper<algorithm, mode>(encrypt); - for (const auto& input_block_string : input.get_input_block_strings()) + for (const auto& input_block_string : input.blocks) { typename aes::Types<algorithm>::Block plaintext, ciphertext; aes::from_string<algorithm>(plaintext, input_block_string); @@ -142,20 +142,20 @@ namespace const Input& input) { aes::Box::Key key; - aes::Box::parse_key(key, algorithm, input.get_key_string()); + aes::Box::parse_key(key, algorithm, input.key); if (aes::mode_requires_init_vector(mode)) { aes::Box::Block iv; - aes::Box::parse_block(iv, algorithm, input.get_iv_string()); + aes::Box::parse_block(iv, algorithm, input.iv); aes::Box box{algorithm, key, mode, iv}; - encrypt_using_particular_box(box, input.get_input_block_strings()); + encrypt_using_particular_box(box, input.blocks); } else { aes::Box box{algorithm, key}; - encrypt_using_particular_box(box, input.get_input_block_strings()); + encrypt_using_particular_box(box, input.blocks); } } } |