suppress USE_AVX, make it autodetectable on runtime

Signed-off-by: R4SAS <r4sas@i2pmail.org>
This commit is contained in:
R4SAS 2020-11-10 20:57:22 +03:00
parent 7e874eaa7c
commit 07ff165a8f
10 changed files with 17 additions and 41 deletions

View file

@ -631,6 +631,9 @@ namespace crypto
static const uint64_t ipads[] = { IPAD, IPAD, IPAD, IPAD };
static const uint64_t opads[] = { OPAD, OPAD, OPAD, OPAD };
#if defined(__x86_64__) || defined(__i386__)
#pragma GCC target("avx")
#endif
void HMACMD5Digest (uint8_t * msg, size_t len, const MACKey& key, uint8_t * digest)
// key is 32 bytes
// digest is 16 bytes
@ -638,7 +641,6 @@ namespace crypto
{
uint64_t buf[256];
uint64_t hash[12]; // 96 bytes
#ifdef __AVX__
if(i2p::cpu::avx)
{
__asm__
@ -661,7 +663,6 @@ namespace crypto
);
}
else
#endif
{
// ikeypad
buf[0] = key.GetLL ()[0] ^ IPAD;