mirror of
https://github.com/veracrypt/VeraCrypt.git
synced 2025-11-11 11:08:02 -06:00
Remove dead code from chacha_ECRYPT_encrypt_bytes (Coverity)
This commit is contained in:
@@ -139,22 +139,15 @@ void chacha_ECRYPT_encrypt_bytes(size_t bytes, uint32* x, const uint8* m, uint8*
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!bytes) return;
|
if (!bytes) return;
|
||||||
for (;;) {
|
// bytes is now guaranteed to be between 1 and 63
|
||||||
salsa20_wordtobyte(output,x, r);
|
salsa20_wordtobyte(output,x, r);
|
||||||
x[12] = PLUSONE(x[12]);
|
x[12] = PLUSONE(x[12]);
|
||||||
if (!x[12]) {
|
if (!x[12]) {
|
||||||
x[13] = PLUSONE(x[13]);
|
x[13] = PLUSONE(x[13]);
|
||||||
/* stopping at 2^70 bytes per nonce is user's responsibility */
|
/* stopping at 2^70 bytes per nonce is user's responsibility */
|
||||||
}
|
|
||||||
if (bytes <= 64) {
|
|
||||||
for (i = 0;i < bytes;++i) out[i] = m[i] ^ output[i];
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
for (i = 0;i < 64;++i) out[i] = m[i] ^ output[i];
|
|
||||||
bytes -= 64;
|
|
||||||
out += 64;
|
|
||||||
m += 64;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (i = 0;i < bytes;++i) out[i] = m[i] ^ output[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -595,6 +595,14 @@ BOOL SelfExtractInMemory (wchar_t *path, BOOL bSkipCountCheck)
|
|||||||
if (compressedLen != fileDataEndPos - fileDataStartPos - 8 + 1)
|
if (compressedLen != fileDataEndPos - fileDataStartPos - 8 + 1)
|
||||||
{
|
{
|
||||||
Error ("DIST_PACKAGE_CORRUPTED", NULL);
|
Error ("DIST_PACKAGE_CORRUPTED", NULL);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Test to make Coverity happy. It will always be false
|
||||||
|
if (uncompressedLen >= (INT_MAX - 524288))
|
||||||
|
{
|
||||||
|
Error ("DIST_PACKAGE_CORRUPTED", NULL);
|
||||||
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
decompressedDataLen = uncompressedLen;
|
decompressedDataLen = uncompressedLen;
|
||||||
|
|||||||
Reference in New Issue
Block a user