From f5f63850f9a5521e45de3cc45be61309a2e71ab2 Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Sat, 15 Apr 2023 16:45:02 -0400 Subject: Use std namespace for memset, memcpy, memcmp (#1204) --- default.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'default.cpp') diff --git a/default.cpp b/default.cpp index 4ec5d427..f7a48d78 100644 --- a/default.cpp +++ b/default.cpp @@ -48,7 +48,7 @@ static void Mash(const byte *in, size_t inLen, byte *out, size_t outLen, int ite while (iterations-- > 1) { - memcpy(buf, outBuf, bufSize); + std::memcpy(buf, outBuf, bufSize); for (i=0; i> 8); @@ -59,7 +59,7 @@ static void Mash(const byte *in, size_t inLen, byte *out, size_t outLen, int ite } } - memcpy(out, outBuf, outLen); + std::memcpy(out, outBuf, outLen); } template @@ -68,15 +68,15 @@ static void GenerateKeyIV(const byte *passphrase, size_t passphraseLength, const // UBsan. User supplied params, may be NULL SecByteBlock temp(passphraseLength+saltLength); if (passphrase != NULLPTR) - memcpy(temp, passphrase, passphraseLength); + std::memcpy(temp, passphrase, passphraseLength); if (salt != NULLPTR) - memcpy(temp+passphraseLength, salt, saltLength); + std::memcpy(temp+passphraseLength, salt, saltLength); // OK. Derived params, cannot be NULL SecByteBlock keyIV(EnumToInt(Info::KEYLENGTH)+EnumToInt(+Info::BLOCKSIZE)); Mash(temp, passphraseLength + saltLength, keyIV, EnumToInt(Info::KEYLENGTH)+EnumToInt(+Info::BLOCKSIZE), iterations); - memcpy(key, keyIV, Info::KEYLENGTH); - memcpy(IV, keyIV+Info::KEYLENGTH, Info::BLOCKSIZE); + std::memcpy(key, keyIV, Info::KEYLENGTH); + std::memcpy(IV, keyIV+Info::KEYLENGTH, Info::BLOCKSIZE); } // ******************************************************** -- cgit v1.2.1