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;
|
||||
}
|
||||
|
||||
err = wc_AesXtsEncryptStart(ctx->aesXts, walk.iv, walk.ivsize);
|
||||
err = wc_AesXtsEncryptInit(ctx->aesXts, walk.iv, walk.ivsize);
|
||||
|
||||
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);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
@ -1053,10 +1053,10 @@ static int km_AesXtsDecrypt(struct skcipher_request *req)
|
|||
tail = 0;
|
||||
}
|
||||
|
||||
err = wc_AesXtsDecryptStart(ctx->aesXts, walk.iv, walk.ivsize);
|
||||
err = wc_AesXtsDecryptInit(ctx->aesXts, walk.iv, walk.ivsize);
|
||||
|
||||
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);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
|
|
@ -12751,13 +12751,12 @@ static int AesXtsEncryptUpdate_sw(XtsAes* xaes, byte* out, const byte* in,
|
|||
word32 blocks = (sz / AES_BLOCK_SIZE);
|
||||
Aes *aes = &xaes->aes;
|
||||
|
||||
#if 0 && defined(HAVE_AES_ECB)
|
||||
#ifdef HAVE_AES_ECB
|
||||
/* 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);
|
||||
if ((ret = _AesXtsHelper(aes, out, in, sz, AES_ENCRYPTION)) != 0)
|
||||
return ret;
|
||||
XMEMCPY(i, out + sz - AES_BLOCK_SIZE, AES_BLOCK_SIZE);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -12765,8 +12764,8 @@ static int AesXtsEncryptUpdate_sw(XtsAes* xaes, byte* out, const byte* in,
|
|||
word32 j;
|
||||
byte carry = 0;
|
||||
|
||||
#if 0 && defined(HAVE_AES_ECB)
|
||||
if ((in == out) || ((sz & (AES_BLOCK_SIZE - 1)) != 0))
|
||||
#ifdef HAVE_AES_ECB
|
||||
if (in == out)
|
||||
#endif
|
||||
{ /* check for if inline */
|
||||
byte buf[AES_BLOCK_SIZE];
|
||||
|
@ -13199,19 +13198,18 @@ static int AesXtsDecryptUpdate_sw(XtsAes* xaes, byte* out, const byte* in,
|
|||
blocks--;
|
||||
}
|
||||
|
||||
#if 0 && defined(HAVE_AES_ECB)
|
||||
#ifdef HAVE_AES_ECB
|
||||
/* 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);
|
||||
if ((ret = _AesXtsHelper(aes, out, in, sz, AES_DECRYPTION)) != 0)
|
||||
return ret;
|
||||
XMEMCPY(i, out + sz - AES_BLOCK_SIZE, AES_BLOCK_SIZE);
|
||||
}
|
||||
#endif
|
||||
|
||||
while (blocks > 0) {
|
||||
#if 0 && defined(HAVE_AES_ECB)
|
||||
if ((in == out) || ((sz & (AES_BLOCK_SIZE - 1)) != 0))
|
||||
#ifdef HAVE_AES_ECB
|
||||
if (in == out)
|
||||
#endif
|
||||
{ /* check for if inline */
|
||||
byte buf[AES_BLOCK_SIZE];
|
||||
|
|
Loading…
Reference in New Issue