aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2017-10-03 00:37:43 -0400
committerJack Lloyd <[email protected]>2017-10-03 00:37:43 -0400
commit180540de74c58a72492692f58b63f32647e80bd8 (patch)
tree9009e260b21d1e3b0b739f58ca831b7395136327
parente4eaf414973f65c4e36a34a7b19f1cc20fe93f8a (diff)
Remove redundant parens
Sonar
-rw-r--r--src/lib/block/camellia/camellia.cpp2
-rw-r--r--src/lib/codec/base64/base64.cpp4
-rw-r--r--src/lib/math/bigint/big_ops3.cpp2
-rw-r--r--src/lib/math/mp/mp_core.cpp2
-rw-r--r--src/lib/math/numbertheory/powm_fw.cpp2
-rw-r--r--src/lib/math/numbertheory/powm_mnt.cpp2
-rw-r--r--src/lib/tls/tls_cbc/tls_cbc.cpp2
7 files changed, 8 insertions, 8 deletions
diff --git a/src/lib/block/camellia/camellia.cpp b/src/lib/block/camellia/camellia.cpp
index c4a186738..c737a0928 100644
--- a/src/lib/block/camellia/camellia.cpp
+++ b/src/lib/block/camellia/camellia.cpp
@@ -723,7 +723,7 @@ void decrypt(const uint8_t in[], uint8_t out[], size_t blocks,
uint64_t left_rot_hi(uint64_t h, uint64_t l, size_t shift)
{
- return (h << shift) | ((l >> (64-shift)));
+ return (h << shift) | (l >> (64-shift));
}
uint64_t left_rot_lo(uint64_t h, uint64_t l, size_t shift)
diff --git a/src/lib/codec/base64/base64.cpp b/src/lib/codec/base64/base64.cpp
index 88bbcff3a..7f52fb5af 100644
--- a/src/lib/codec/base64/base64.cpp
+++ b/src/lib/codec/base64/base64.cpp
@@ -24,10 +24,10 @@ static const uint8_t BIN_TO_BASE64[64] = {
void do_base64_encode(char out[4], const uint8_t in[3])
{
- out[0] = BIN_TO_BASE64[((in[0] & 0xFC) >> 2)];
+ out[0] = BIN_TO_BASE64[(in[0] & 0xFC) >> 2];
out[1] = BIN_TO_BASE64[((in[0] & 0x03) << 4) | (in[1] >> 4)];
out[2] = BIN_TO_BASE64[((in[1] & 0x0F) << 2) | (in[2] >> 6)];
- out[3] = BIN_TO_BASE64[((in[2] & 0x3F) )];
+ out[3] = BIN_TO_BASE64[in[2] & 0x3F];
}
}
diff --git a/src/lib/math/bigint/big_ops3.cpp b/src/lib/math/bigint/big_ops3.cpp
index a864fa96c..48d84c8b4 100644
--- a/src/lib/math/bigint/big_ops3.cpp
+++ b/src/lib/math/bigint/big_ops3.cpp
@@ -23,7 +23,7 @@ BigInt operator+(const BigInt& x, const BigInt& y)
BigInt z(x.sign(), std::max(x_sw, y_sw) + 1);
- if((x.sign() == y.sign()))
+ if(x.sign() == y.sign())
bigint_add3(z.mutable_data(), x.data(), x_sw, y.data(), y_sw);
else
{
diff --git a/src/lib/math/mp/mp_core.cpp b/src/lib/math/mp/mp_core.cpp
index 40e45bc12..4ed61ac38 100644
--- a/src/lib/math/mp/mp_core.cpp
+++ b/src/lib/math/mp/mp_core.cpp
@@ -147,7 +147,7 @@ void bigint_add2(word x[], size_t x_size, const word y[], size_t y_size)
void bigint_add3(word z[], const word x[], size_t x_size,
const word y[], size_t y_size)
{
- z[(x_size > y_size ? x_size : y_size)] +=
+ z[x_size > y_size ? x_size : y_size] +=
bigint_add3_nc(z, x, x_size, y, y_size);
}
diff --git a/src/lib/math/numbertheory/powm_fw.cpp b/src/lib/math/numbertheory/powm_fw.cpp
index c4af8b012..85a0364b5 100644
--- a/src/lib/math/numbertheory/powm_fw.cpp
+++ b/src/lib/math/numbertheory/powm_fw.cpp
@@ -25,7 +25,7 @@ void Fixed_Window_Exponentiator::set_base(const BigInt& base)
{
m_window_bits = Power_Mod::window_bits(m_exp.bits(), base.bits(), m_hints);
- m_g.resize((1U << m_window_bits));
+ m_g.resize(1U << m_window_bits);
m_g[0] = 1;
m_g[1] = base;
diff --git a/src/lib/math/numbertheory/powm_mnt.cpp b/src/lib/math/numbertheory/powm_mnt.cpp
index cd385e7ec..d3b5805e4 100644
--- a/src/lib/math/numbertheory/powm_mnt.cpp
+++ b/src/lib/math/numbertheory/powm_mnt.cpp
@@ -28,7 +28,7 @@ void Montgomery_Exponentiator::set_base(const BigInt& base)
{
m_window_bits = Power_Mod::window_bits(m_exp.bits(), base.bits(), m_hints);
- m_g.resize((1U << m_window_bits));
+ m_g.resize(1U << m_window_bits);
BigInt z(BigInt::Positive, 2 * (m_mod_words + 1));
secure_vector<word> workspace(z.size());
diff --git a/src/lib/tls/tls_cbc/tls_cbc.cpp b/src/lib/tls/tls_cbc/tls_cbc.cpp
index 545e3fbf4..a0b238498 100644
--- a/src/lib/tls/tls_cbc/tls_cbc.cpp
+++ b/src/lib/tls/tls_cbc/tls_cbc.cpp
@@ -235,7 +235,7 @@ uint16_t check_tls_cbc_padding(const uint8_t record[], size_t record_len)
*/
const uint16_t to_check = std::min<uint16_t>(256, record_len);
- const uint8_t pad_byte = record[(record_len-1)];
+ const uint8_t pad_byte = record[record_len-1];
const uint16_t pad_bytes = 1 + pad_byte;
uint16_t pad_invalid = CT::is_less<uint16_t>(rec16, pad_bytes);