mirror of
https://git.wownero.com/wownero/wownero.git
synced 2024-08-15 01:03:23 +00:00
crypto: only check MONERO_USE_SOFTWARE_AES once
This commit is contained in:
parent
74aef213fe
commit
c7e6b77395
1 changed files with 15 additions and 5 deletions
|
@ -189,12 +189,22 @@ STATIC INLINE void xor_blocks(uint8_t *a, const uint8_t *b)
|
||||||
|
|
||||||
STATIC INLINE int force_software_aes(void)
|
STATIC INLINE int force_software_aes(void)
|
||||||
{
|
{
|
||||||
|
static int use = -1;
|
||||||
|
|
||||||
|
if (use != -1)
|
||||||
|
return use;
|
||||||
|
|
||||||
const char *env = getenv("MONERO_USE_SOFTWARE_AES");
|
const char *env = getenv("MONERO_USE_SOFTWARE_AES");
|
||||||
if (!env)
|
if (!env) {
|
||||||
return 0;
|
use = 0;
|
||||||
if (!strcmp(env, "0") || !strcmp(env, "no"))
|
}
|
||||||
return 0;
|
else if (!strcmp(env, "0") || !strcmp(env, "no")) {
|
||||||
return 1;
|
use = 0;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
use = 1;
|
||||||
|
}
|
||||||
|
return use;
|
||||||
}
|
}
|
||||||
|
|
||||||
STATIC INLINE int check_aes_hw(void)
|
STATIC INLINE int check_aes_hw(void)
|
||||||
|
|
Loading…
Reference in a new issue