diff options
Diffstat (limited to 'utils/decrypt_bmp.cpp')
-rw-r--r-- | utils/decrypt_bmp.cpp | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/utils/decrypt_bmp.cpp b/utils/decrypt_bmp.cpp index 17a64dd..a68b1d3 100644 --- a/utils/decrypt_bmp.cpp +++ b/utils/decrypt_bmp.cpp @@ -33,27 +33,24 @@ namespace void decrypt_bmp(const Settings& settings) { - const auto algorithm = settings.get_algorithm(); - const auto mode = settings.get_mode(); - - const auto& ciphertext_path = settings.get_input_path(); - const auto& plaintext_path = settings.get_output_path(); + const auto& algorithm = settings.algorithm; + const auto& mode = settings.mode; aes::Box::Key key; - aes::Box::parse_key(key, algorithm, settings.get_key_string()); + aes::Box::parse_key(key, algorithm, settings.key); - if (aes::mode_requires_initialization_vector(mode)) + if (aes::mode_requires_init_vector(mode)) { aes::Box::Block iv; - aes::Box::parse_block(iv, algorithm, settings.get_iv_string()); - aes::Box box{algorithm, key, mode, iv}; + aes::Box::parse_block(iv, algorithm, settings.iv); - decrypt_bmp(box, ciphertext_path, plaintext_path); + aes::Box box{algorithm, key, mode, iv}; + decrypt_bmp(box, settings.input_path, settings.output_path); } else { aes::Box box{algorithm, key}; - decrypt_bmp(box, ciphertext_path, plaintext_path); + decrypt_bmp(box, settings.input_path, settings.output_path); } } } @@ -65,8 +62,7 @@ int main(int argc, char** argv) CommandLineParser cmd_parser(argv[0]); try { - Settings settings; - cmd_parser.parse(settings, argc, argv); + const auto settings = cmd_parser.parse(argc, argv); if (cmd_parser.exit_with_usage()) { |