diff options
author | Jack Lloyd <[email protected]> | 2018-01-01 10:56:46 -0500 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2018-01-01 10:56:46 -0500 |
commit | 903d8042a987f3d56cb121498d183e7433f69b34 (patch) | |
tree | a81e9e803828c6e1b6fed309c78fa097c493f586 /src | |
parent | b36a6bd55e23c483fccef3991ad6c5c4940460a7 (diff) |
Add a cast to avoid Sonar warning
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/pubkey/ed25519/ge.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/lib/pubkey/ed25519/ge.cpp b/src/lib/pubkey/ed25519/ge.cpp index 4773602db..4c78223b2 100644 --- a/src/lib/pubkey/ed25519/ge.cpp +++ b/src/lib/pubkey/ed25519/ge.cpp @@ -2028,10 +2028,9 @@ inline void select(ge_precomp* t, const ge_precomp* base, int8_t b) { - uint8_t bnegative = negative(b); - uint8_t babs = b - (((-bnegative) & b) * 2); - - ge_precomp_0(t); + const uint8_t bnegative = negative(b); + const uint8_t babs = b - (((-static_cast<int>(bnegative)) & b) * 2); + const int32_t neg_mask = equal32(bnegative, 1); const int32_t mask1 = equal32(babs, 1); const int32_t mask2 = equal32(babs, 2); @@ -2075,8 +2074,6 @@ inline void select(ge_precomp* t, ((t->xy2d[i] ^ base[7].xy2d[i]) & mask8); } - const int32_t neg_mask = equal32(bnegative, 1); - fe minus_xy2d; fe_neg(minus_xy2d, t->xy2d); |