diff options
author | Jack Lloyd <[email protected]> | 2017-08-31 07:13:58 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2017-08-31 07:13:58 -0400 |
commit | df4287c3c763de14b262ed39d54b3de552adbefb (patch) | |
tree | 10b839bab8d2e36a806951bb2e5e5f0212f7a0f9 /src/lib/modes | |
parent | 17ef09021892afc4c0e9fe7ba97423bf832e6dc5 (diff) |
Fix various MSVC warnings
Based on VC2017 output
Diffstat (limited to 'src/lib/modes')
-rw-r--r-- | src/lib/modes/mode_pad/mode_pad.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/lib/modes/mode_pad/mode_pad.cpp b/src/lib/modes/mode_pad/mode_pad.cpp index afcce786d..f93b2dccc 100644 --- a/src/lib/modes/mode_pad/mode_pad.cpp +++ b/src/lib/modes/mode_pad/mode_pad.cpp @@ -57,13 +57,13 @@ size_t PKCS7_Padding::unpad(const uint8_t block[], size_t size) const size_t bad_input = 0; const uint8_t last_byte = block[size-1]; - bad_input |= CT::expand_mask(last_byte > size); + bad_input |= CT::expand_mask<size_t>(last_byte > size); size_t pad_pos = size - last_byte; size_t i = size - 2; while(i) { - bad_input |= ~CT::is_equal(block[i],last_byte) & CT::expand_mask(i >= pad_pos); + bad_input |= (~CT::is_equal(block[i],last_byte)) & CT::expand_mask<uint8_t>(i >= pad_pos); --i; } @@ -98,13 +98,13 @@ size_t ANSI_X923_Padding::unpad(const uint8_t block[], size_t size) const size_t bad_input = 0; const size_t last_byte = block[size-1]; - bad_input |= CT::expand_mask(last_byte > size); + bad_input |= CT::expand_mask<size_t>(last_byte > size); size_t pad_pos = size - last_byte; size_t i = size - 2; while(i) { - bad_input |= ~CT::is_zero(block[i]) & CT::expand_mask(i >= pad_pos); + bad_input |= (~CT::is_zero(block[i])) & CT::expand_mask<uint8_t>(i >= pad_pos); --i; } CT::conditional_copy_mem(bad_input,&pad_pos,&size,&pad_pos,1); @@ -177,13 +177,13 @@ size_t ESP_Padding::unpad(const uint8_t block[], size_t size) const const size_t last_byte = block[size-1]; size_t bad_input = 0; - bad_input |= CT::expand_mask(last_byte > size); + bad_input |= CT::expand_mask<size_t>(last_byte > size); size_t pad_pos = size - last_byte; size_t i = size - 1; while(i) { - bad_input |= ~CT::is_equal<size_t>(size_t(block[i-1]),size_t(block[i])-1) & CT::expand_mask(i > pad_pos); + bad_input |= ~CT::is_equal<uint8_t>(size_t(block[i-1]),size_t(block[i])-1) & CT::expand_mask<uint8_t>(i > pad_pos); --i; } CT::conditional_copy_mem(bad_input,&pad_pos,&size,&pad_pos,1); |