aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2018-12-04 09:23:12 -0500
committerJack Lloyd <[email protected]>2018-12-04 09:23:12 -0500
commitdf885b54ac1557d538a62b2846647d3068b46dcb (patch)
treeb247074543e26c48604891c556d8226ec01415d8 /src/lib
parent22159fd4b31323492fd2e49ca0bf19f2260e0fc5 (diff)
Fix some misc MSVC warnings
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/misc/tss/tss.cpp2
-rw-r--r--src/lib/modes/mode_pad/mode_pad.cpp6
2 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/misc/tss/tss.cpp b/src/lib/misc/tss/tss.cpp
index 464999fc5..dd3a294f8 100644
--- a/src/lib/misc/tss/tss.cpp
+++ b/src/lib/misc/tss/tss.cpp
@@ -174,7 +174,7 @@ RTSS_Share::split(uint8_t M, uint8_t N,
throw Encoding_Error("RTSS_Share::split secret too large for TSS format");
// +1 byte for the share ID
- const uint16_t share_len = secret.size() + 1;
+ const uint16_t share_len = static_cast<uint16_t>(secret.size() + 1);
secure_vector<uint8_t> share_header(RTSS_HEADER_SIZE);
copy_mem(&share_header[0], identifier.data(), identifier.size());
diff --git a/src/lib/modes/mode_pad/mode_pad.cpp b/src/lib/modes/mode_pad/mode_pad.cpp
index be3ecf7dc..19a2f15f8 100644
--- a/src/lib/modes/mode_pad/mode_pad.cpp
+++ b/src/lib/modes/mode_pad/mode_pad.cpp
@@ -202,16 +202,16 @@ size_t ESP_Padding::unpad(const uint8_t input[], size_t input_length) const
const size_t last_byte = input[input_length-1];
auto bad_input = CT::Mask<uint8_t>::is_zero(last_byte) |
- CT::Mask<uint8_t>::is_gt(last_byte, input_length);
+ CT::Mask<uint8_t>::is_gt(last_byte, static_cast<uint8_t>(input_length));
const size_t pad_pos = input_length - last_byte;
size_t i = input_length - 1;
while(i)
{
- const auto in_range = CT::Mask<uint8_t>::is_gt(i, pad_pos);
+ const auto in_range = CT::Mask<size_t>::is_gt(i, pad_pos);
const auto incrementing = CT::Mask<uint8_t>::is_equal(input[i-1], input[i]-1);
- bad_input |= in_range & ~incrementing;
+ bad_input |= CT::Mask<uint8_t>(in_range) & ~incrementing;
--i;
}