diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2017-05-04 03:03:47 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2017-05-04 03:03:47 +0300 |
commit | 8fae13fe2c6bd341cbd0081d2e7140509b23c692 (patch) | |
tree | 8e6617215e8182eda8b0d3df769f785797eadfeb /utils/decrypt_block.cpp | |
parent | disable DbgHelp.h warnings (diff) | |
download | aes-tools-8fae13fe2c6bd341cbd0081d2e7140509b23c692.tar.gz aes-tools-8fae13fe2c6bd341cbd0081d2e7140509b23c692.zip |
refactoring
Diffstat (limited to '')
-rw-r--r-- | utils/decrypt_block.cpp | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/utils/decrypt_block.cpp b/utils/decrypt_block.cpp index 9e53d2b..4744d49 100644 --- a/utils/decrypt_block.cpp +++ b/utils/decrypt_block.cpp @@ -25,7 +25,7 @@ namespace { typename aes::Types<algorithm>::Block iv; - if (aes::ModeRequiresInitializationVector<mode>()) + if (aes::ModeRequiresInitVector<mode>()) { aes::from_string<algorithm>(iv, input.get_iv_string()); if (verbose) @@ -144,7 +144,7 @@ namespace aes::Box::Key key; aes::Box::parse_key(key, algorithm, input.get_key_string()); - if (aes::mode_requires_initialization_vector(mode)) + if (aes::mode_requires_init_vector(mode)) { aes::Box::Block iv; aes::Box::parse_block(iv, algorithm, input.get_iv_string()); @@ -164,12 +164,11 @@ int main(int argc, char** argv) { try { - CommandLineParser cmd_parser(argv[0]); + CommandLineParser cmd_parser{argv[0]}; try { - Settings settings; std::vector<Input> inputs; - cmd_parser.parse(settings, argc, argv, inputs); + const auto settings = cmd_parser.parse(argc, argv, inputs); if (cmd_parser.exit_with_usage()) { @@ -179,20 +178,20 @@ int main(int argc, char** argv) for (const auto& input : inputs) { - if (settings.use_boxes()) + if (settings.use_boxes) { decrypt_using_boxes( - settings.get_algorithm(), - settings.get_mode(), + settings.algorithm, + settings.mode, input); } else { decrypt_using_cxx_api( - settings.get_algorithm(), - settings.get_mode(), + settings.algorithm, + settings.mode, input, - settings.verbose()); + settings.verbose); } } } |