From 80452ac0abc6494000a9bbad8d7dccfd72ea85f2 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Sat, 13 Jun 2026 15:42:15 +0200 Subject: aesxx: upgrade to std::string_view, std::format & --- aesxx/utils/encrypt_block.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'aesxx/utils/encrypt_block.cpp') 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 #include +#include #include #include #include @@ -48,7 +49,7 @@ void encrypt_with_mode(const Input& input, bool verbose = false) { dump_ciphertext(ciphertext); dump_next_iv(encrypt); } else { - std::cout << aes::to_string(ciphertext) << '\n'; + std::cout << std::format("{}\n", aes::to_string(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; -- cgit v1.3