diff --git a/node/AES.cpp b/node/AES.cpp index b46ec5427..ee9cd12ad 100644 --- a/node/AES.cpp +++ b/node/AES.cpp @@ -24,8 +24,6 @@ namespace ZeroTier { -namespace { - #ifdef ZT_NO_TYPE_PUNNING static ZT_ALWAYS_INLINE uint32_t readuint32_t(const void *in) { @@ -50,8 +48,6 @@ static ZT_ALWAYS_INLINE void writeuint32_t(void *out,const uint32_t v) #define writeuint32_t(o,v) (*((uint32_t *)(o)) = Utils::hton(v)) #endif -} // anonymous namespace - #if (defined(__amd64) || defined(__amd64__) || defined(__x86_64) || defined(__x86_64__) || defined(__AMD64) || defined(__AMD64__) || defined(_M_X64)) static bool _zt_aesni_supported() { @@ -69,7 +65,7 @@ static bool _zt_aesni_supported() return ((ecx & (1 << 25)) != 0); #endif } -const bool AES::HW_ACCEL = false; //_zt_aesni_supported(); +const bool AES::HW_ACCEL = _zt_aesni_supported(); #else const bool AES::HW_ACCEL = false; #endif @@ -351,8 +347,7 @@ void AES::_gmacSW(const uint8_t iv[12],const uint8_t *in,unsigned int len,uint8_ if (len) { uint64_t last[2] = { 0,0 }; - for(unsigned int i=0;i