From a513d160c5232f62e99d70b964156d11b9db369c Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Wed, 19 May 2021 16:24:21 -0400 Subject: [PATCH] Build fixes, warning removal. --- core/AES_aesni.cpp | 8 ++++---- core/Address.hpp | 4 ++-- core/C25519.cpp | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/core/AES_aesni.cpp b/core/AES_aesni.cpp index 97f80e259..efb0cd0b2 100644 --- a/core/AES_aesni.cpp +++ b/core/AES_aesni.cpp @@ -30,7 +30,7 @@ namespace { const __m128i s_sseSwapBytes = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); #ifdef __GNUC__ -__attribute__((__target__("sse,sse2,pclmul"))) +__attribute__((__target__("sse,sse2,ssse3,aes,pclmul"))) #endif __m128i p_gmacPCLMUL128(const __m128i h, __m128i y) noexcept @@ -245,7 +245,7 @@ p_init256_2_aesni(__m128i a, __m128i b) noexcept } // anonymous namespace #ifdef __GNUC__ -__attribute__((__target__("sse,sse2,pclmul,aes"))) +__attribute__((__target__("sse,sse2,ssse3,pclmul,aes"))) #endif void AES::GMAC::p_aesNIUpdate(const uint8_t *in, unsigned int len) noexcept { @@ -333,7 +333,7 @@ void AES::GMAC::p_aesNIUpdate(const uint8_t *in, unsigned int len) noexcept } #ifdef __GNUC__ -__attribute__((__target__("sse,sse2,pclmul,aes"))) +__attribute__((__target__("sse,sse2,ssse3,pclmul,aes"))) #endif void AES::GMAC::p_aesNIFinish(uint8_t tag[16]) noexcept { @@ -607,7 +607,7 @@ void AES::CTR::p_aesNICrypt(const uint8_t *in, uint8_t *out, unsigned int len) n } #ifdef __GNUC__ -__attribute__((__target__("sse,sse2,aes,pclmul"))) +__attribute__((__target__("sse,sse2,ssse3,aes,pclmul"))) #endif void AES::p_init_aesni(const uint8_t *key) noexcept { diff --git a/core/Address.hpp b/core/Address.hpp index ded3c23e3..db4d6ff7e 100644 --- a/core/Address.hpp +++ b/core/Address.hpp @@ -87,8 +87,8 @@ class Address : public TriviallyCopyable { */ ZT_INLINE char *toString(char s[ZT_ADDRESS_STRING_SIZE_MAX]) const noexcept { - for (unsigned int i = 0; i < 10;) { - s[i++] = Utils::HEXCHARS[(uintptr_t)(_a >> (36U - (i * 4U))) & 0xfU]; + for (unsigned int i = 0; i < 10; ++i) { + s[i] = Utils::HEXCHARS[(uintptr_t)(_a >> (36U - (i * 4U))) & 0xfU]; } return s; } diff --git a/core/C25519.cpp b/core/C25519.cpp index 09ac05a79..e2c2b7864 100644 --- a/core/C25519.cpp +++ b/core/C25519.cpp @@ -3038,7 +3038,7 @@ ZT_INLINE void get_hram( playground[i] = sm[i]; for (int i = 32; i < 64; ++i) playground[i] = pk[i - 32]; - for (int i = 64; i < smlen; ++i) + for (unsigned long long i = 64; i < smlen; ++i) playground[i] = sm[i]; ZeroTier::SHA512(hram, playground, (unsigned int)smlen); }