aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib/block/aes/aes_vperm/aes_vperm.cpp2
-rw-r--r--src/lib/misc/roughtime/roughtime.cpp4
-rw-r--r--src/lib/tls/tls_extensions.cpp4
3 files changed, 6 insertions, 4 deletions
diff --git a/src/lib/block/aes/aes_vperm/aes_vperm.cpp b/src/lib/block/aes/aes_vperm/aes_vperm.cpp
index 7e7b36116..1703bd856 100644
--- a/src/lib/block/aes/aes_vperm/aes_vperm.cpp
+++ b/src/lib/block/aes/aes_vperm/aes_vperm.cpp
@@ -505,7 +505,7 @@ SIMD_4x32 aes_schedule_192_smear(SIMD_4x32 x, SIMD_4x32 y)
const SIMD_4x32 shuffle2000 =
SIMD_4x32(0x03020100, 0x03020100, 0x03020100, 0x0B0A0908);
- const SIMD_4x32 zero_top_half(0, 0, ~0, ~0);
+ const SIMD_4x32 zero_top_half(0, 0, 0xFFFFFFFF, 0xFFFFFFFF);
y &= zero_top_half;
return y ^ shuffle(x, shuffle3332) ^ shuffle(y, shuffle2000);
}
diff --git a/src/lib/misc/roughtime/roughtime.cpp b/src/lib/misc/roughtime/roughtime.cpp
index b8c53bdc8..435308cd0 100644
--- a/src/lib/misc/roughtime/roughtime.cpp
+++ b/src/lib/misc/roughtime/roughtime.cpp
@@ -66,7 +66,7 @@ std::map<std::string, std::vector<uint8_t>> unpack_roughtime_packet(T bytes)
std::map<std::string, std::vector<uint8_t>> tags;
for(uint32_t i=0; i<num_tags; ++i)
{
- const uint32_t end = ((i+1) == num_tags) ? bytes.size() : start_content + from_little_endian<uint32_t>(buf + 4 + i*4);
+ const size_t end = ((i+1) == num_tags) ? bytes.size() : start_content + from_little_endian<uint32_t>(buf + 4 + i*4);
if(end > bytes.size())
{ throw Roughtime::Roughtime_Error("Tag end index out of bounds"); }
if(end < start)
@@ -76,7 +76,7 @@ std::map<std::string, std::vector<uint8_t>> unpack_roughtime_packet(T bytes)
auto ret = tags.emplace(label, std::vector<uint8_t>(buf+start, buf+end));
if(!ret.second)
{ throw Roughtime::Roughtime_Error(std::string("Map has duplicated tag: ") + label); }
- start = end;
+ start = static_cast<uint32_t>(end);
}
return tags;
}
diff --git a/src/lib/tls/tls_extensions.cpp b/src/lib/tls/tls_extensions.cpp
index 49f996228..588fee561 100644
--- a/src/lib/tls/tls_extensions.cpp
+++ b/src/lib/tls/tls_extensions.cpp
@@ -365,7 +365,9 @@ Supported_Groups::Supported_Groups(TLS_Data_Reader& reader,
if(len % 2 == 1)
throw Decoding_Error("Supported groups list of strange size");
- for(size_t i = 0; i != len / 2; ++i)
+ const size_t elems = len / 2;
+
+ for(size_t i = 0; i != elems; ++i)
{
const uint16_t id = reader.get_uint16_t();
m_groups.push_back(static_cast<Group_Params>(id));