From 17a616bec6aab0fedaae73e1dfe35e2555d1e7b3 Mon Sep 17 00:00:00 2001 From: Matt Borland Date: Mon, 4 Nov 2024 18:07:56 -0500 Subject: [PATCH] Fix memcpy --- include/boost/crypt/hash/hmac.hpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/include/boost/crypt/hash/hmac.hpp b/include/boost/crypt/hash/hmac.hpp index a2edf8a..9982cf3 100644 --- a/include/boost/crypt/hash/hmac.hpp +++ b/include/boost/crypt/hash/hmac.hpp @@ -199,10 +199,9 @@ constexpr auto hmac::init(ForwardIter key, boost::crypt::size_t size BOOST_CRYPT_ASSERT(res.size() <= k0.size()); - auto key_iter {res.begin()}; - for (auto& byte : k0) + for (boost::crypt::size_t i {}; i < res.size(); ++i) { - byte = *key_iter++; + k0[i] = res[i]; } }