mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-03 12:44:45 +02:00
wolfcrypt/src/aes.c: fix for -Wrestrict in wc_AesCbcDecrypt() when WOLFSSL_AESNI.
This commit is contained in:
@@ -859,11 +859,11 @@ block cipher mechanism that uses n-bit binary string parameter key with 128-bits
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#elif defined(WOLFSSL_KCAPI_AES)
|
#elif defined(WOLFSSL_KCAPI_AES)
|
||||||
/* Only CBC and GCM that are in wolfcrypt/src/port/kcapi/kcapi_aes.c */
|
/* Only CBC and GCM are in wolfcrypt/src/port/kcapi/kcapi_aes.c */
|
||||||
#if defined(WOLFSSL_AES_COUNTER) || defined(HAVE_AESCCM) || \
|
#if defined(WOLFSSL_AES_COUNTER) || defined(HAVE_AESCCM) || \
|
||||||
defined(WOLFSSL_CMAC) || defined(WOLFSSL_AES_OFB) || \
|
defined(WOLFSSL_CMAC) || defined(WOLFSSL_AES_OFB) || \
|
||||||
defined(WOLFSSL_AES_CFB) || defined(HAVE_AES_ECB) || \
|
defined(WOLFSSL_AES_CFB) || defined(HAVE_AES_ECB) || \
|
||||||
defined(WOLFSSL_AES_DIRECT) || \
|
defined(WOLFSSL_AES_DIRECT) || defined(WOLFSSL_AES_XTS) || \
|
||||||
(defined(HAVE_AES_CBC) && defined(WOLFSSL_NO_KCAPI_AES_CBC))
|
(defined(HAVE_AES_CBC) && defined(WOLFSSL_NO_KCAPI_AES_CBC))
|
||||||
|
|
||||||
#define NEED_AES_TABLES
|
#define NEED_AES_TABLES
|
||||||
@@ -5460,8 +5460,12 @@ int wc_AesCbcEncrypt(Aes* aes, byte* out, const byte* in, word32 sz)
|
|||||||
#else
|
#else
|
||||||
while (blocks--) {
|
while (blocks--) {
|
||||||
int ret;
|
int ret;
|
||||||
|
#ifdef WOLFSSL_AESNI
|
||||||
|
ret = wc_AesDecrypt(aes, in, out);
|
||||||
|
#else
|
||||||
XMEMCPY(aes->tmp, in, AES_BLOCK_SIZE);
|
XMEMCPY(aes->tmp, in, AES_BLOCK_SIZE);
|
||||||
ret = wc_AesDecrypt(aes, (byte*)aes->tmp, out);
|
ret = wc_AesDecrypt(aes, (byte*)aes->tmp, out);
|
||||||
|
#endif
|
||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
return ret;
|
return ret;
|
||||||
xorbuf(out, (byte*)aes->reg, AES_BLOCK_SIZE);
|
xorbuf(out, (byte*)aes->reg, AES_BLOCK_SIZE);
|
||||||
|
Reference in New Issue
Block a user