Skip to content

Commit 4f1f7b3

Browse files
committed
linuxkm/lkcapi_glue.c: update names of wc_AesXts{En,De}cryptInit().
wolfcrypt/src/aes.c: activate _AesXtsHelper() in AesXts{En,De}cryptUpdate_sw().
1 parent 643f472 commit 4f1f7b3

2 files changed

Lines changed: 12 additions & 14 deletions

File tree

linuxkm/lkcapi_glue.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -930,10 +930,10 @@ static int km_AesXtsEncrypt(struct skcipher_request *req)
930930
tail = 0;
931931
}
932932

933-
err = wc_AesXtsEncryptStart(ctx->aesXts, walk.iv, walk.ivsize);
933+
err = wc_AesXtsEncryptInit(ctx->aesXts, walk.iv, walk.ivsize);
934934

935935
if (unlikely(err)) {
936-
pr_err("%s: wc_AesXtsEncryptStart failed: %d\n",
936+
pr_err("%s: wc_AesXtsEncryptInit failed: %d\n",
937937
crypto_tfm_alg_driver_name(crypto_skcipher_tfm(tfm)), err);
938938
return -EINVAL;
939939
}
@@ -1053,10 +1053,10 @@ static int km_AesXtsDecrypt(struct skcipher_request *req)
10531053
tail = 0;
10541054
}
10551055

1056-
err = wc_AesXtsDecryptStart(ctx->aesXts, walk.iv, walk.ivsize);
1056+
err = wc_AesXtsDecryptInit(ctx->aesXts, walk.iv, walk.ivsize);
10571057

10581058
if (unlikely(err)) {
1059-
pr_err("%s: wc_AesXtsDecryptStart failed: %d\n",
1059+
pr_err("%s: wc_AesXtsDecryptInit failed: %d\n",
10601060
crypto_tfm_alg_driver_name(crypto_skcipher_tfm(tfm)), err);
10611061
return -EINVAL;
10621062
}

wolfcrypt/src/aes.c

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12751,22 +12751,21 @@ static int AesXtsEncryptUpdate_sw(XtsAes* xaes, byte* out, const byte* in,
1275112751
word32 blocks = (sz / AES_BLOCK_SIZE);
1275212752
Aes *aes = &xaes->aes;
1275312753

12754-
#if 0 && defined(HAVE_AES_ECB)
12754+
#ifdef HAVE_AES_ECB
1275512755
/* encrypt all of buffer at once when possible */
12756-
if ((in != out) && ((sz & (AES_BLOCK_SIZE - 1)) == 0)) { /* can not handle inline */
12756+
if (in != out) { /* can not handle inline */
1275712757
XMEMCPY(out, i, AES_BLOCK_SIZE);
1275812758
if ((ret = _AesXtsHelper(aes, out, in, sz, AES_ENCRYPTION)) != 0)
1275912759
return ret;
12760-
XMEMCPY(i, out + sz - AES_BLOCK_SIZE, AES_BLOCK_SIZE);
1276112760
}
1276212761
#endif
1276312762

1276412763
while (blocks > 0) {
1276512764
word32 j;
1276612765
byte carry = 0;
1276712766

12768-
#if 0 && defined(HAVE_AES_ECB)
12769-
if ((in == out) || ((sz & (AES_BLOCK_SIZE - 1)) != 0))
12767+
#ifdef HAVE_AES_ECB
12768+
if (in == out)
1277012769
#endif
1277112770
{ /* check for if inline */
1277212771
byte buf[AES_BLOCK_SIZE];
@@ -13199,19 +13198,18 @@ static int AesXtsDecryptUpdate_sw(XtsAes* xaes, byte* out, const byte* in,
1319913198
blocks--;
1320013199
}
1320113200

13202-
#if 0 && defined(HAVE_AES_ECB)
13201+
#ifdef HAVE_AES_ECB
1320313202
/* decrypt all of buffer at once when possible */
13204-
if ((in != out) && ((sz & (AES_BLOCK_SIZE - 1)) == 0)) { /* can not handle inline */
13203+
if (in != out) { /* can not handle inline */
1320513204
XMEMCPY(out, i, AES_BLOCK_SIZE);
1320613205
if ((ret = _AesXtsHelper(aes, out, in, sz, AES_DECRYPTION)) != 0)
1320713206
return ret;
13208-
XMEMCPY(i, out + sz - AES_BLOCK_SIZE, AES_BLOCK_SIZE);
1320913207
}
1321013208
#endif
1321113209

1321213210
while (blocks > 0) {
13213-
#if 0 && defined(HAVE_AES_ECB)
13214-
if ((in == out) || ((sz & (AES_BLOCK_SIZE - 1)) != 0))
13211+
#ifdef HAVE_AES_ECB
13212+
if (in == out)
1321513213
#endif
1321613214
{ /* check for if inline */
1321713215
byte buf[AES_BLOCK_SIZE];

0 commit comments

Comments
 (0)