Use std::views::zip instead std::views::enumerate and index get in library/src/encryption.cpp
This commit is contained in:
parent
4060a42634
commit
5c2c336a21
1 changed files with 3 additions and 3 deletions
|
@ -136,9 +136,9 @@ inline auto GenerateAuthScramMessageImpl(std::string_view password,
|
||||||
auto storedKey = HashImpl(clientKey, tag);
|
auto storedKey = HashImpl(clientKey, tag);
|
||||||
auto authMessage = std::format("{},{},{}", initialMessage, firstServerMessage, clientFinalMessageBare);
|
auto authMessage = std::format("{},{},{}", initialMessage, firstServerMessage, clientFinalMessageBare);
|
||||||
auto clientSignature = HmacImpl(ToCharStringView(storedKey), ToUnsignedCharStringView(authMessage), tag);
|
auto clientSignature = HmacImpl(ToCharStringView(storedKey), ToUnsignedCharStringView(authMessage), tag);
|
||||||
auto clientProof = std::views::iota(std::size_t{}, clientKey.size()) | // No std::views::enumerate in libc++
|
auto clientProof = std::views::zip(clientKey, clientSignature) | // No std::views::enumerate in libc++
|
||||||
std::views::transform([&](auto i) {
|
std::views::transform([&](auto arg) {
|
||||||
return clientKey[i] ^ clientSignature[i];
|
return arg.first ^ arg.second;
|
||||||
}) |
|
}) |
|
||||||
std::ranges::to<std::string>();
|
std::ranges::to<std::string>();
|
||||||
std::string serverKeyStr = "Server Key";
|
std::string serverKeyStr = "Server Key";
|
||||||
|
|
Loading…
Reference in a new issue