Cleared unused variable warnings

This commit is contained in:
Jeffrey Walton 2017-08-01 20:42:55 -04:00
parent 05bf4fd54b
commit 6ab1a729ef
No known key found for this signature in database
GPG Key ID: B36AB348921B1838
3 changed files with 54 additions and 50 deletions

1
mdc.h
View File

@ -37,6 +37,7 @@ class MDC : public MDC_Info<H>
public:
void UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs &params)
{
CRYPTOPP_UNUSED(params);
this->AssertValidKeyLength(length);
memcpy_s(m_key, m_key.size(), userKey, this->KEYLENGTH);
m_hash.CorrectEndianess(Key(), Key(), this->KEYLENGTH);

View File

@ -25,8 +25,8 @@ NAMESPACE_BEGIN(CryptoPP)
RandomPool::RandomPool()
: m_pCipher(new AES::Encryption), m_keySet(false)
{
memset(m_key, 0, m_key.SizeInBytes());
memset(m_seed, 0, m_seed.SizeInBytes());
::memset(m_key, 0, m_key.SizeInBytes());
::memset(m_seed, 0, m_seed.SizeInBytes());
}
void RandomPool::IncorporateEntropy(const byte *input, size_t length)
@ -57,8 +57,8 @@ void RandomPool::GenerateIntoBufferedTransformation(BufferedTransformation &targ
// UBsan finding: signed integer overflow: 1876017710 + 1446085457 cannot be represented in type 'long int'
// *(time_t *)(m_seed.data()+8) += t;
word64 tt1 = 0, tt2 = (word64)t;
memcpy(&tt1, m_seed.data()+8, 8);
memcpy(m_seed.data()+8, &(tt2 += tt1), 8);
::memcpy(&tt1, m_seed.data()+8, 8);
::memcpy(m_seed.data()+8, &(tt2 += tt1), 8);
// Wipe the intermediates
*((volatile TimerWord*)&tw) = 0;
@ -82,8 +82,8 @@ OldRandomPool::OldRandomPool(unsigned int poolSize)
: pool(poolSize), key(OldRandomPoolCipher::DEFAULT_KEYLENGTH), addPos(0), getPos(poolSize)
{
CRYPTOPP_ASSERT(poolSize > key.size());
memset(pool, 0, poolSize);
memset(key, 0, key.size());
::memset(pool, 0, poolSize);
::memset(key, 0, key.size());
}
void OldRandomPool::Stir()
@ -94,7 +94,7 @@ void OldRandomPool::Stir()
{
cipher.SetKeyWithIV(key, key.size(), pool.end()-cipher.IVSize());
cipher.ProcessString(pool, pool.size());
memcpy(key, pool, key.size());
::memcpy(key, pool, key.size());
}
addPos = 0;
@ -103,8 +103,9 @@ void OldRandomPool::Stir()
size_t OldRandomPool::Put2(const byte *inString, size_t length, int messageEnd, bool blocking)
{
size_t t;
CRYPTOPP_UNUSED(messageEnd); CRYPTOPP_UNUSED(blocking);
size_t t;
while (length > (t = pool.size() - addPos))
{
xorbuf(pool+addPos, inString, t);

View File

@ -87,13 +87,15 @@ public:
size_t TransferTo2(BufferedTransformation &target, lword &transferBytes, const std::string &channel=DEFAULT_CHANNEL, bool blocking=true);
size_t CopyRangeTo2(BufferedTransformation &target, lword &begin, lword end=LWORD_MAX, const std::string &channel=DEFAULT_CHANNEL, bool blocking=true) const
{
CRYPTOPP_UNUSED(target); CRYPTOPP_UNUSED(begin); CRYPTOPP_UNUSED(end);
CRYPTOPP_UNUSED(channel); CRYPTOPP_UNUSED(blocking);
throw NotImplemented("OldRandomPool: CopyRangeTo2() is not supported by this store");
}
byte GenerateByte();
void GenerateBlock(byte *output, size_t size);
void IsolatedInitialize(const NameValuePairs &parameters) {}
void IsolatedInitialize(const NameValuePairs &parameters) {CRYPTOPP_UNUSED(parameters);}
protected:
void Stir();