From 5c2c336a215322c4d0c51c45ddfcce1be4d2f26e Mon Sep 17 00:00:00 2001 From: sha512sum Date: Sat, 14 Sep 2024 23:01:20 +0000 Subject: [PATCH] Use std::views::zip instead std::views::enumerate and index get in library/src/encryption.cpp --- library/src/encryption.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/library/src/encryption.cpp b/library/src/encryption.cpp index fd06cd0..12d86eb 100644 --- a/library/src/encryption.cpp +++ b/library/src/encryption.cpp @@ -136,9 +136,9 @@ inline auto GenerateAuthScramMessageImpl(std::string_view password, auto storedKey = HashImpl(clientKey, tag); auto authMessage = std::format("{},{},{}", initialMessage, firstServerMessage, clientFinalMessageBare); auto clientSignature = HmacImpl(ToCharStringView(storedKey), ToUnsignedCharStringView(authMessage), tag); - auto clientProof = std::views::iota(std::size_t{}, clientKey.size()) | // No std::views::enumerate in libc++ - std::views::transform([&](auto i) { - return clientKey[i] ^ clientSignature[i]; + auto clientProof = std::views::zip(clientKey, clientSignature) | // No std::views::enumerate in libc++ + std::views::transform([&](auto arg) { + return arg.first ^ arg.second; }) | std::ranges::to(); std::string serverKeyStr = "Server Key";