diff options
| author | Egor Tensin <egor@tensin.name> | 2026-06-13 15:42:15 +0200 |
|---|---|---|
| committer | Egor Tensin <egor@tensin.name> | 2026-06-13 15:42:15 +0200 |
| commit | 80452ac0abc6494000a9bbad8d7dccfd72ea85f2 (patch) | |
| tree | 2d46252837083d1d2cfe0aa25d63aa23dfe80714 /aesxx/utils/encrypt_block.cpp | |
| parent | workflows/ci: add clang-format job (diff) | |
| download | aes-tools-80452ac0abc6494000a9bbad8d7dccfd72ea85f2.tar.gz aes-tools-80452ac0abc6494000a9bbad8d7dccfd72ea85f2.zip | |
aesxx: upgrade to std::string_view, std::format & <filesystem>
Diffstat (limited to 'aesxx/utils/encrypt_block.cpp')
| -rw-r--r-- | aesxx/utils/encrypt_block.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/aesxx/utils/encrypt_block.cpp b/aesxx/utils/encrypt_block.cpp index b6bdca9..e132256 100644 --- a/aesxx/utils/encrypt_block.cpp +++ b/aesxx/utils/encrypt_block.cpp @@ -12,6 +12,7 @@ #include <boost/program_options.hpp> #include <exception> +#include <format> #include <iostream> #include <stdexcept> #include <string> @@ -48,7 +49,7 @@ void encrypt_with_mode(const Input& input, bool verbose = false) { dump_ciphertext<algorithm>(ciphertext); dump_next_iv<algorithm, mode>(encrypt); } else { - std::cout << aes::to_string<algorithm>(ciphertext) << '\n'; + std::cout << std::format("{}\n", aes::to_string<algorithm>(ciphertext)); } } } @@ -113,7 +114,7 @@ void encrypt_using_particular_box(aes::Box& box, aes::Box::Block ciphertext; box.encrypt_block(plaintext, ciphertext); - std::cout << box.format_block(ciphertext) << '\n'; + std::cout << std::format("{}\n", box.format_block(ciphertext)); } } @@ -162,7 +163,7 @@ int main(int argc, char** argv) { std::cerr << e; return 1; } catch (const std::exception& e) { - std::cerr << e.what() << "\n"; + std::cerr << std::format("{}\n", e.what()); return 1; } return 0; |
