aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/aesxx/utils/decrypt_file.cpp
diff options
context:
space:
mode:
authorEgor Tensin <egor@tensin.name>2026-06-22 19:24:27 +0200
committerEgor Tensin <egor@tensin.name>2026-06-22 19:29:28 +0200
commitfe12cdce3fa13d490852e7f389015a1958a6f2c6 (patch)
tree0802935a5fd6f494cc57d66c8a7282185267c12d /aesxx/utils/decrypt_file.cpp
parentaesxx/utils: more refactoring (diff)
downloadaes-tools-fe12cdce3fa13d490852e7f389015a1958a6f2c6.tar.gz
aes-tools-fe12cdce3fa13d490852e7f389015a1958a6f2c6.zip
aesxx/utils: some more basic refactoring
Diffstat (limited to 'aesxx/utils/decrypt_file.cpp')
-rw-r--r--aesxx/utils/decrypt_file.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/aesxx/utils/decrypt_file.cpp b/aesxx/utils/decrypt_file.cpp
index 42fe3e9..39084fd 100644
--- a/aesxx/utils/decrypt_file.cpp
+++ b/aesxx/utils/decrypt_file.cpp
@@ -29,21 +29,21 @@ void decrypt_file(
}
void decrypt_file(const FileSettings& settings) {
- const auto& algorithm = settings.algorithm;
- const auto& mode = settings.mode;
+ const auto algorithm = settings.get_algorithm();
+ const auto mode = settings.get_mode();
aes::Box::Key key;
- aes::Box::parse_key(key, algorithm, settings.key);
+ aes::Box::parse_key(key, algorithm, settings.get_key());
if (aes::mode_requires_init_vector(mode)) {
aes::Box::Block iv;
- aes::Box::parse_block(iv, algorithm, settings.iv);
+ aes::Box::parse_block(iv, algorithm, settings.get_iv());
aes::Box box{algorithm, key, mode, iv};
- decrypt_file(box, settings.input_path, settings.output_path);
+ decrypt_file(box, settings.get_input_path(), settings.get_output_path());
} else {
aes::Box box{algorithm, key};
- decrypt_file(box, settings.input_path, settings.output_path);
+ decrypt_file(box, settings.get_input_path(), settings.get_output_path());
}
}
@@ -60,7 +60,7 @@ int main(int argc, char** argv) {
return 1;
}
- if (settings.exit_with_usage) {
+ if (settings.exit_with_usage()) {
settings.usage();
return 0;
}