mirror of
https://github.com/cuberite/polarssl.git
synced 2025-09-28 16:03:36 -04:00
Use consistent guards for padlock code
The padlock feature is enabled if ``` defined(MBEDTLS_PADLOCK_C) && defined(MBEDTLS_HAVE_X86) ``` with the second macro coming from `padlock.h`. The availability of the macro `MBEDTLS_PADLOCK_ALIGN16` is coincidentally equivalent to `MBEDTLS_HAVE_X86` but this is not meaningful. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
parent
844f65dc65
commit
0f454e4642
@ -47,8 +47,7 @@
|
|||||||
|
|
||||||
#if !defined(MBEDTLS_AES_ALT)
|
#if !defined(MBEDTLS_AES_ALT)
|
||||||
|
|
||||||
#if defined(MBEDTLS_PADLOCK_C) && \
|
#if defined(MBEDTLS_PADLOCK_C) && defined(MBEDTLS_HAVE_X86)
|
||||||
(defined(MBEDTLS_HAVE_X86) || defined(MBEDTLS_PADLOCK_ALIGN16))
|
|
||||||
static int aes_padlock_ace = -1;
|
static int aes_padlock_ace = -1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -530,7 +529,7 @@ int mbedtls_aes_setkey_enc(mbedtls_aes_context *ctx, const unsigned char *key,
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
ctx->rk_offset = 0;
|
ctx->rk_offset = 0;
|
||||||
#if defined(MBEDTLS_PADLOCK_C) && defined(MBEDTLS_PADLOCK_ALIGN16)
|
#if defined(MBEDTLS_PADLOCK_C) && defined(MBEDTLS_HAVE_X86)
|
||||||
if (aes_padlock_ace == -1) {
|
if (aes_padlock_ace == -1) {
|
||||||
aes_padlock_ace = mbedtls_padlock_has_support(MBEDTLS_PADLOCK_ACE);
|
aes_padlock_ace = mbedtls_padlock_has_support(MBEDTLS_PADLOCK_ACE);
|
||||||
}
|
}
|
||||||
@ -642,7 +641,7 @@ int mbedtls_aes_setkey_dec(mbedtls_aes_context *ctx, const unsigned char *key,
|
|||||||
mbedtls_aes_init(&cty);
|
mbedtls_aes_init(&cty);
|
||||||
|
|
||||||
ctx->rk_offset = 0;
|
ctx->rk_offset = 0;
|
||||||
#if defined(MBEDTLS_PADLOCK_C) && defined(MBEDTLS_PADLOCK_ALIGN16)
|
#if defined(MBEDTLS_PADLOCK_C) && defined(MBEDTLS_HAVE_X86)
|
||||||
if (aes_padlock_ace == -1) {
|
if (aes_padlock_ace == -1) {
|
||||||
aes_padlock_ace = mbedtls_padlock_has_support(MBEDTLS_PADLOCK_ACE);
|
aes_padlock_ace = mbedtls_padlock_has_support(MBEDTLS_PADLOCK_ACE);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user