Skip to content
Snippets Groups Projects
Commit 2bf5235b authored by Maamoun TK's avatar Maamoun TK Committed by Niels Möller
Browse files

Check for ENV_OVERRIDE in get_ppc_features()

parent d0e6f97b
No related branches found
No related tags found
No related merge requests found
......@@ -68,8 +68,29 @@ struct ppc_features
int have_crypto_ext;
};
#define MATCH(s, slen, literal, llen) \
((slen) == (llen) && memcmp ((s), (literal), llen) == 0)
static void
get_ppc_features (struct ppc_features *features)
{
const char *s;
features->have_crypto_ext = 0;
s = secure_getenv (ENV_OVERRIDE);
if (s)
for (;;)
{
const char *sep = strchr (s, ',');
size_t length = sep ? (size_t) (sep - s) : strlen(s);
if (MATCH (s, length, "crypto_ext", 10))
features->have_crypto_ext = 1;
if (!sep)
break;
s = sep + 1;
}
else
{
#if defined(_AIX) && defined(__power_8_andup)
features->have_crypto_ext = __power_8_andup() != 0 ? 1 : 0;
......@@ -89,6 +110,7 @@ get_ppc_features (struct ppc_features *features)
(hwcap2 & PPC_FEATURE2_VEC_CRYPTO) == PPC_FEATURE2_VEC_CRYPTO ? 1 : 0;
#endif
}
}
DECLARE_FAT_FUNC(_nettle_aes_encrypt, aes_crypt_internal_func)
DECLARE_FAT_FUNC_VAR(aes_encrypt, aes_crypt_internal_func, c)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment