aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/block
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2017-08-31 07:13:58 -0400
committerJack Lloyd <[email protected]>2017-08-31 07:13:58 -0400
commitdf4287c3c763de14b262ed39d54b3de552adbefb (patch)
tree10b839bab8d2e36a806951bb2e5e5f0212f7a0f9 /src/lib/block
parent17ef09021892afc4c0e9fe7ba97423bf832e6dc5 (diff)
Fix various MSVC warnings
Based on VC2017 output
Diffstat (limited to 'src/lib/block')
-rw-r--r--src/lib/block/cast/cast128.cpp6
-rw-r--r--src/lib/block/idea/idea.cpp2
2 files changed, 6 insertions, 2 deletions
diff --git a/src/lib/block/cast/cast128.cpp b/src/lib/block/cast/cast128.cpp
index d955dfeef..26076e128 100644
--- a/src/lib/block/cast/cast128.cpp
+++ b/src/lib/block/cast/cast128.cpp
@@ -323,7 +323,11 @@ void CAST_128::cast_ks(secure_vector<uint32_t>& K,
class ByteReader
{
public:
- uint8_t operator()(size_t i) { return (m_X[i/4] >> (8*(3 - (i%4)))); }
+ uint8_t operator()(size_t i) const
+ {
+ return static_cast<uint8_t>(m_X[i/4] >> (8*(3 - (i%4))));
+ }
+
explicit ByteReader(const uint32_t* x) : m_X(x) {}
private:
const uint32_t* m_X;
diff --git a/src/lib/block/idea/idea.cpp b/src/lib/block/idea/idea.cpp
index 2be15be2e..4795a126a 100644
--- a/src/lib/block/idea/idea.cpp
+++ b/src/lib/block/idea/idea.cpp
@@ -26,7 +26,7 @@ inline uint16_t mul(uint16_t x, uint16_t y)
const uint32_t P_hi = P >> 16;
const uint32_t P_lo = P & 0xFFFF;
- const uint16_t r_1 = (P_lo - P_hi) + (P_lo < P_hi);
+ const uint16_t r_1 = static_cast<uint16_t>((P_lo - P_hi) + (P_lo < P_hi));
const uint16_t r_2 = 1 - x - y;
return CT::select(Z_mask, r_1, r_2);