correctly change target at compile time

Signed-off-by: R4SAS <r4sas@i2pmail.org>
This commit is contained in:
R4SAS 2020-11-10 21:15:50 +03:00
parent 07ff165a8f
commit 9e580de53c
2 changed files with 9 additions and 0 deletions

View file

@ -632,6 +632,7 @@ namespace crypto
static const uint64_t opads[] = { OPAD, OPAD, OPAD, OPAD };
#if defined(__x86_64__) || defined(__i386__)
#pragma GCC push_options
#pragma GCC target("avx")
#endif
void HMACMD5Digest (uint8_t * msg, size_t len, const MACKey& key, uint8_t * digest)
@ -694,6 +695,9 @@ namespace crypto
// calculate digest
MD5((uint8_t *)hash, 96, digest);
}
#if defined(__x86_64__) || defined(__i386__)
#pragma GCC pop_options
#endif
// AES
#ifdef __AES__

View file

@ -826,6 +826,7 @@ namespace data
}
#if defined(__x86_64__) || defined(__i386__)
#pragma GCC push_options
#pragma GCC target("avx")
#endif
XORMetric operator^(const IdentHash& key1, const IdentHash& key2)
@ -855,5 +856,9 @@ namespace data
return m;
}
#if defined(__x86_64__) || defined(__i386__)
#pragma GCC pop_options
#endif
}
}