summaryrefslogtreecommitdiff
path: root/default.cpp
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2023-04-15 16:45:02 -0400
committerGitHub <noreply@github.com>2023-04-15 16:45:02 -0400
commitf5f63850f9a5521e45de3cc45be61309a2e71ab2 (patch)
treed9ec904ebd511ae673e89790a407f0cdcf0b9bbc /default.cpp
parent358d0cfecd593d55160df38e133b9450aaf1cd59 (diff)
downloadcryptopp-git-f5f63850f9a5521e45de3cc45be61309a2e71ab2.tar.gz
Use std namespace for memset, memcpy, memcmp (#1204)
Diffstat (limited to 'default.cpp')
-rw-r--r--default.cpp12
1 files changed, 6 insertions, 6 deletions
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<bufSize; i+=H::DIGESTSIZE)
{
b[0] = (byte) (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 <class BC, class H, class Info>
@@ -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<H>(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);
}
// ********************************************************