aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/aesxx/utils/encrypt_bmp.cpp
diff options
context:
space:
mode:
authorEgor Tensin <egor@tensin.name>2026-07-22 18:31:50 +0200
committerEgor Tensin <egor@tensin.name>2026-07-22 21:07:53 +0200
commit4720b5ac21163936fb47f524037a6f12ce6e6ce2 (patch)
tree7b1f3f7f0e4047134048bb9b9967498b6f8ead12 /aesxx/utils/encrypt_bmp.cpp
parentminor refactoring (diff)
downloadaes-tools-4720b5ac21163936fb47f524037a6f12ce6e6ce2.tar.gz
aes-tools-4720b5ac21163936fb47f524037a6f12ce6e6ce2.zip
rewrite: the beginning
This a giant fuck-you to myself while I have nothing (actually, tons of things) to do in a hospital. * The giant screens of preprocessor code are gone, they always sucked, fuck them. * Switched everything to the "boxes" interface as the only one remaining. * Restuctured things in aes/ so that the files they're in make at least a little bit of sense. * Removed a bunch of cruft and prematurely generic code. * This is half-baked at best: I just made sure that the tests pass. A lot of cleanup awaits.
Diffstat (limited to 'aesxx/utils/encrypt_bmp.cpp')
-rw-r--r--aesxx/utils/encrypt_bmp.cpp12
1 files changed, 2 insertions, 10 deletions
diff --git a/aesxx/utils/encrypt_bmp.cpp b/aesxx/utils/encrypt_bmp.cpp
index 19caee4..2fcde46 100644
--- a/aesxx/utils/encrypt_bmp.cpp
+++ b/aesxx/utils/encrypt_bmp.cpp
@@ -35,16 +35,8 @@ void encrypt_bmp(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};
- encrypt_bmp(box, settings.get_input_path(), settings.get_output_path());
- } else {
- aes::Box box{algorithm, key};
- encrypt_bmp(box, settings.get_input_path(), settings.get_output_path());
- }
+ aes::Box box{algorithm, key, mode, settings.get_iv()};
+ encrypt_bmp(box, settings.get_input_path(), settings.get_output_path());
}
} // namespace