mirror of https://github.com/wolfSSL/wolfssl.git
linuxkm/lkcapi_glue.c: update names of wc_AesXts{En,De}cryptInit().
wolfcrypt/src/aes.c: activate _AesXtsHelper() in AesXts{En,De}cryptUpdate_sw().pull/7522/head
parent
643f472cfb
commit
4f1f7b3a4d
|
@ -930,10 +930,10 @@ static int km_AesXtsEncrypt(struct skcipher_request *req)
|
||||||
tail = 0;
|
tail = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
err = wc_AesXtsEncryptStart(ctx->aesXts, walk.iv, walk.ivsize);
|
err = wc_AesXtsEncryptInit(ctx->aesXts, walk.iv, walk.ivsize);
|
||||||
|
|
||||||
if (unlikely(err)) {
|
if (unlikely(err)) {
|
||||||
pr_err("%s: wc_AesXtsEncryptStart failed: %d\n",
|
pr_err("%s: wc_AesXtsEncryptInit failed: %d\n",
|
||||||
crypto_tfm_alg_driver_name(crypto_skcipher_tfm(tfm)), err);
|
crypto_tfm_alg_driver_name(crypto_skcipher_tfm(tfm)), err);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
@ -1053,10 +1053,10 @@ static int km_AesXtsDecrypt(struct skcipher_request *req)
|
||||||
tail = 0;
|
tail = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
err = wc_AesXtsDecryptStart(ctx->aesXts, walk.iv, walk.ivsize);
|
err = wc_AesXtsDecryptInit(ctx->aesXts, walk.iv, walk.ivsize);
|
||||||
|
|
||||||
if (unlikely(err)) {
|
if (unlikely(err)) {
|
||||||
pr_err("%s: wc_AesXtsDecryptStart failed: %d\n",
|
pr_err("%s: wc_AesXtsDecryptInit failed: %d\n",
|
||||||
crypto_tfm_alg_driver_name(crypto_skcipher_tfm(tfm)), err);
|
crypto_tfm_alg_driver_name(crypto_skcipher_tfm(tfm)), err);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
|
@ -12751,13 +12751,12 @@ static int AesXtsEncryptUpdate_sw(XtsAes* xaes, byte* out, const byte* in,
|
||||||
word32 blocks = (sz / AES_BLOCK_SIZE);
|
word32 blocks = (sz / AES_BLOCK_SIZE);
|
||||||
Aes *aes = &xaes->aes;
|
Aes *aes = &xaes->aes;
|
||||||
|
|
||||||
#if 0 && defined(HAVE_AES_ECB)
|
#ifdef HAVE_AES_ECB
|
||||||
/* encrypt all of buffer at once when possible */
|
/* encrypt all of buffer at once when possible */
|
||||||
if ((in != out) && ((sz & (AES_BLOCK_SIZE - 1)) == 0)) { /* can not handle inline */
|
if (in != out) { /* can not handle inline */
|
||||||
XMEMCPY(out, i, AES_BLOCK_SIZE);
|
XMEMCPY(out, i, AES_BLOCK_SIZE);
|
||||||
if ((ret = _AesXtsHelper(aes, out, in, sz, AES_ENCRYPTION)) != 0)
|
if ((ret = _AesXtsHelper(aes, out, in, sz, AES_ENCRYPTION)) != 0)
|
||||||
return ret;
|
return ret;
|
||||||
XMEMCPY(i, out + sz - AES_BLOCK_SIZE, AES_BLOCK_SIZE);
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -12765,8 +12764,8 @@ static int AesXtsEncryptUpdate_sw(XtsAes* xaes, byte* out, const byte* in,
|
||||||
word32 j;
|
word32 j;
|
||||||
byte carry = 0;
|
byte carry = 0;
|
||||||
|
|
||||||
#if 0 && defined(HAVE_AES_ECB)
|
#ifdef HAVE_AES_ECB
|
||||||
if ((in == out) || ((sz & (AES_BLOCK_SIZE - 1)) != 0))
|
if (in == out)
|
||||||
#endif
|
#endif
|
||||||
{ /* check for if inline */
|
{ /* check for if inline */
|
||||||
byte buf[AES_BLOCK_SIZE];
|
byte buf[AES_BLOCK_SIZE];
|
||||||
|
@ -13199,19 +13198,18 @@ static int AesXtsDecryptUpdate_sw(XtsAes* xaes, byte* out, const byte* in,
|
||||||
blocks--;
|
blocks--;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0 && defined(HAVE_AES_ECB)
|
#ifdef HAVE_AES_ECB
|
||||||
/* decrypt all of buffer at once when possible */
|
/* decrypt all of buffer at once when possible */
|
||||||
if ((in != out) && ((sz & (AES_BLOCK_SIZE - 1)) == 0)) { /* can not handle inline */
|
if (in != out) { /* can not handle inline */
|
||||||
XMEMCPY(out, i, AES_BLOCK_SIZE);
|
XMEMCPY(out, i, AES_BLOCK_SIZE);
|
||||||
if ((ret = _AesXtsHelper(aes, out, in, sz, AES_DECRYPTION)) != 0)
|
if ((ret = _AesXtsHelper(aes, out, in, sz, AES_DECRYPTION)) != 0)
|
||||||
return ret;
|
return ret;
|
||||||
XMEMCPY(i, out + sz - AES_BLOCK_SIZE, AES_BLOCK_SIZE);
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
while (blocks > 0) {
|
while (blocks > 0) {
|
||||||
#if 0 && defined(HAVE_AES_ECB)
|
#ifdef HAVE_AES_ECB
|
||||||
if ((in == out) || ((sz & (AES_BLOCK_SIZE - 1)) != 0))
|
if (in == out)
|
||||||
#endif
|
#endif
|
||||||
{ /* check for if inline */
|
{ /* check for if inline */
|
||||||
byte buf[AES_BLOCK_SIZE];
|
byte buf[AES_BLOCK_SIZE];
|
||||||
|
|
Loading…
Reference in New Issue