aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/utils/encrypt_block.cpp
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2017-05-04 03:03:47 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2017-05-04 03:03:47 +0300
commit8fae13fe2c6bd341cbd0081d2e7140509b23c692 (patch)
tree8e6617215e8182eda8b0d3df769f785797eadfeb /utils/encrypt_block.cpp
parentdisable DbgHelp.h warnings (diff)
downloadaes-tools-8fae13fe2c6bd341cbd0081d2e7140509b23c692.tar.gz
aes-tools-8fae13fe2c6bd341cbd0081d2e7140509b23c692.zip
refactoring
Diffstat (limited to '')
-rw-r--r--utils/encrypt_block.cpp21
1 files changed, 10 insertions, 11 deletions
diff --git a/utils/encrypt_block.cpp b/utils/encrypt_block.cpp
index 714dab7..340e18b 100644
--- a/utils/encrypt_block.cpp
+++ b/utils/encrypt_block.cpp
@@ -25,7 +25,7 @@ namespace
{
typename aes::Types<algorithm>::Block iv;
- if (aes::ModeRequiresInitializationVector<mode>::value)
+ if (aes::ModeRequiresInitVector<mode>::value)
{
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
{
std::vector<Input> inputs;
- Settings settings;
- 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)
{
encrypt_using_boxes(
- settings.get_algorithm(),
- settings.get_mode(),
+ settings.algorithm,
+ settings.mode,
input);
}
else
{
encrypt_using_cxx_api(
- settings.get_algorithm(),
- settings.get_mode(),
+ settings.algorithm,
+ settings.mode,
input,
- settings.verbose());
+ settings.verbose);
}
}
}