Skip to content

Commit 3ebbc03

Browse files
ardbiesheuvelherbertx
authored andcommitted
crypto: arm/aes-neonbs - use typed init/exit routines for XTS
Use the typed skcipher init/exit routines instead of the generic cra_init/_exit routines when instantiating/releasing the XTS skciphers. Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
1 parent be6d699 commit 3ebbc03

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

‎arch/arm/crypto/aes-neonbs-glue.c‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -314,9 +314,9 @@ static int aesbs_xts_setkey(struct crypto_skcipher *tfm, const u8 *in_key,
314314
return aesbs_setkey(tfm, in_key, key_len);
315315
}
316316

317-
static int xts_init(struct crypto_tfm *tfm)
317+
static int xts_init(struct crypto_skcipher *tfm)
318318
{
319-
struct aesbs_xts_ctx *ctx = crypto_tfm_ctx(tfm);
319+
struct aesbs_xts_ctx *ctx = crypto_skcipher_ctx(tfm);
320320

321321
ctx->cts_tfm = crypto_alloc_cipher("aes", 0, 0);
322322
if (IS_ERR(ctx->cts_tfm))
@@ -329,9 +329,9 @@ static int xts_init(struct crypto_tfm *tfm)
329329
return PTR_ERR_OR_ZERO(ctx->tweak_tfm);
330330
}
331331

332-
static void xts_exit(struct crypto_tfm *tfm)
332+
static void xts_exit(struct crypto_skcipher *tfm)
333333
{
334-
struct aesbs_xts_ctx *ctx = crypto_tfm_ctx(tfm);
334+
struct aesbs_xts_ctx *ctx = crypto_skcipher_ctx(tfm);
335335

336336
crypto_free_cipher(ctx->tweak_tfm);
337337
crypto_free_cipher(ctx->cts_tfm);
@@ -493,8 +493,6 @@ static struct skcipher_alg aes_algs[] = { {
493493
.base.cra_ctxsize = sizeof(struct aesbs_xts_ctx),
494494
.base.cra_module = THIS_MODULE,
495495
.base.cra_flags = CRYPTO_ALG_INTERNAL,
496-
.base.cra_init = xts_init,
497-
.base.cra_exit = xts_exit,
498496

499497
.min_keysize = 2 * AES_MIN_KEY_SIZE,
500498
.max_keysize = 2 * AES_MAX_KEY_SIZE,
@@ -503,6 +501,8 @@ static struct skcipher_alg aes_algs[] = { {
503501
.setkey = aesbs_xts_setkey,
504502
.encrypt = xts_encrypt,
505503
.decrypt = xts_decrypt,
504+
.init = xts_init,
505+
.exit = xts_exit,
506506
} };
507507

508508
static struct simd_skcipher_alg *aes_simd_algs[ARRAY_SIZE(aes_algs)];

0 commit comments

Comments
 (0)