mirror of
https://github.com/jedisct1/libsodium.git
synced 2026-08-25 08:37:13 +09:00
Add annotations for Coverity FPs
This commit is contained in:
+8
-4
@@ -46,10 +46,14 @@ static void barrett_reduce(sc25519 *r, const crypto_uint32 x[64])
|
||||
q2[33] += carry;
|
||||
|
||||
for(i=0;i<33;i++)r1[i] = x[i];
|
||||
for(i=0;i<32;i++)
|
||||
for(j=0;j<33;j++)
|
||||
if(i+j < 33) r2[i+j] += m[i]*q3[j];
|
||||
|
||||
for(i=0;i<32;i++) {
|
||||
for(j=0;j<33;j++) {
|
||||
if(i+j < 33) {
|
||||
/* coverity[overrun-local] */
|
||||
r2[i+j] += m[i]*q3[j];
|
||||
}
|
||||
}
|
||||
}
|
||||
for(i=0;i<32;i++)
|
||||
{
|
||||
carry = r2[i] >> 8;
|
||||
|
||||
@@ -279,6 +279,7 @@ randombytes_salsa20_random_buf(void * const buf, const size_t size)
|
||||
randombytes_salsa20_random_stir_if_needed();
|
||||
COMPILER_ASSERT(sizeof stream.nonce == crypto_stream_salsa20_NONCEBYTES);
|
||||
#ifdef ULONG_LONG_MAX
|
||||
/* coverity[result_independent_of_operands] */
|
||||
assert(size <= ULONG_LONG_MAX);
|
||||
#endif
|
||||
ret = crypto_stream_salsa20((unsigned char *) buf, (unsigned long long) size,
|
||||
|
||||
@@ -202,6 +202,7 @@ randombytes_sysrandom_buf(void * const buf, const size_t size)
|
||||
{
|
||||
randombytes_sysrandom_stir_if_needed();
|
||||
#ifdef ULONG_LONG_MAX
|
||||
/* coverity[result_independent_of_operands] */
|
||||
assert(size <= ULONG_LONG_MAX);
|
||||
#endif
|
||||
#ifndef _WIN32
|
||||
|
||||
Reference in New Issue
Block a user