aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/aesxx/utils/decrypt_file.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'aesxx/utils/decrypt_file.cpp')
-rw-r--r--aesxx/utils/decrypt_file.cpp12
1 files changed, 2 insertions, 10 deletions
diff --git a/aesxx/utils/decrypt_file.cpp b/aesxx/utils/decrypt_file.cpp
index 6c915b5..9eb764f 100644
--- a/aesxx/utils/decrypt_file.cpp
+++ b/aesxx/utils/decrypt_file.cpp
@@ -35,16 +35,8 @@ void decrypt_file(const FileSettings& settings) {
aes::Box::Key key;
aes::Box::parse_key(key, algorithm, settings.get_key());
- if (settings.has_iv()) {
- aes::Box::Block iv;
- aes::Box::parse_block(iv, settings.get_iv());
-
- aes::Box box{algorithm, key, mode, iv};
- decrypt_file(box, settings.get_input_path(), settings.get_output_path());
- } else {
- aes::Box box{algorithm, key};
- decrypt_file(box, settings.get_input_path(), settings.get_output_path());
- }
+ aes::Box box{algorithm, key, mode, settings.get_iv()};
+ decrypt_file(box, settings.get_input_path(), settings.get_output_path());
}
} // namespace