intel / intel-ipsec-mb

Intel(R) Multi-Buffer Crypto for IPSec
BSD 3-Clause "New" or "Revised" License
289 stars 87 forks source link

redundant assignment of bytes_left #49

Closed ColinIanKing closed 4 years ago

ColinIanKing commented 4 years ago

Static analysis with Coverity has detected an assignment that is not used In lib/include/snow3g_common.h in function snow3g_8_buffer_ks_32_8():

3280 if (bytes_left >= small_block_size) { 3281 const uint32_t blocks = bytes_left / small_block_size; 3282 3283 length_sub(lengthInBytes, num_lanes, blocks * small_block_size);

CID 98731 (#1 of 1): Unused value (UNUSED_VALUE) assigned_value: Assigning value from bytes_left - blocks * 8UL to bytes_left here, but that stored value is not used.

3284 bytes_left -= blocks * small_block_size; 3285

Same issue also in lines:

3151 if (bytes_left >= small_block_size) { 3152 const uint32_t blocks = bytes_left / small_block_size; 3153 3154 length_sub(tLenInBytes, num_lanes, blocks * small_block_size);

CID 98724 (#1 of 1): Unused value (UNUSED_VALUE) assigned_value: Assigning value from bytes_left - blocks * 8UL to bytes_left here, but that stored value is not used.

3155 bytes_left -= blocks * small_block_size; 3156

Perhaps this can be removed?

pablodelara commented 4 years ago

Sure, thanks for reporting this. Will fix this shortly.