From df885b54ac1557d538a62b2846647d3068b46dcb Mon Sep 17 00:00:00 2001 From: Jack Lloyd Date: Tue, 4 Dec 2018 09:23:12 -0500 Subject: Fix some misc MSVC warnings --- src/lib/misc/tss/tss.cpp | 2 +- src/lib/modes/mode_pad/mode_pad.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/lib') 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(secret.size() + 1); secure_vector 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::is_zero(last_byte) | - CT::Mask::is_gt(last_byte, input_length); + CT::Mask::is_gt(last_byte, static_cast(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::is_gt(i, pad_pos); + const auto in_range = CT::Mask::is_gt(i, pad_pos); const auto incrementing = CT::Mask::is_equal(input[i-1], input[i]-1); - bad_input |= in_range & ~incrementing; + bad_input |= CT::Mask(in_range) & ~incrementing; --i; } -- cgit v1.2.3