Lines Matching +full:inline +full:- +full:crypto +full:- +full:engine

1 // SPDX-License-Identifier: GPL-2.0
8 #include <crypto/engine.h>
9 #include <crypto/gcm.h>
10 #include <crypto/internal/aead.h>
11 #include <crypto/internal/skcipher.h>
12 #include <crypto/scatterwalk.h>
13 #include "jh7110-cryp.h"
52 static inline int starfive_aes_wait_busy(struct starfive_cryp_dev *cryp) in starfive_aes_wait_busy()
56 return readl_relaxed_poll_timeout(cryp->base + STARFIVE_AES_CSR, status, in starfive_aes_wait_busy()
60 static inline int starfive_aes_wait_keydone(struct starfive_cryp_dev *cryp) in starfive_aes_wait_keydone()
64 return readl_relaxed_poll_timeout(cryp->base + STARFIVE_AES_CSR, status, in starfive_aes_wait_keydone()
68 static inline int starfive_aes_wait_gcmdone(struct starfive_cryp_dev *cryp) in starfive_aes_wait_gcmdone()
72 return readl_relaxed_poll_timeout(cryp->base + STARFIVE_AES_CSR, status, in starfive_aes_wait_gcmdone()
76 static inline int is_gcm(struct starfive_cryp_dev *cryp) in is_gcm()
78 return (cryp->flags & FLG_MODE_MASK) == STARFIVE_AES_MODE_GCM; in is_gcm()
81 static inline int is_encrypt(struct starfive_cryp_dev *cryp) in is_encrypt()
83 return cryp->flags & FLG_ENCRYPT; in is_encrypt()
88 struct starfive_cryp_dev *cryp = ctx->cryp; in starfive_aes_aead_hw_start()
93 value = readl(ctx->cryp->base + STARFIVE_AES_CSR); in starfive_aes_aead_hw_start()
95 writel(value, cryp->base + STARFIVE_AES_CSR); in starfive_aes_aead_hw_start()
99 value = readl(ctx->cryp->base + STARFIVE_AES_CSR); in starfive_aes_aead_hw_start()
101 writel(value, cryp->base + STARFIVE_AES_CSR); in starfive_aes_aead_hw_start()
106 static inline void starfive_aes_set_ivlen(struct starfive_cryp_ctx *ctx) in starfive_aes_set_ivlen()
108 struct starfive_cryp_dev *cryp = ctx->cryp; in starfive_aes_set_ivlen()
111 writel(GCM_AES_IV_SIZE, cryp->base + STARFIVE_AES_IVLEN); in starfive_aes_set_ivlen()
113 writel(AES_BLOCK_SIZE, cryp->base + STARFIVE_AES_IVLEN); in starfive_aes_set_ivlen()
116 static inline void starfive_aes_set_alen(struct starfive_cryp_ctx *ctx) in starfive_aes_set_alen()
118 struct starfive_cryp_dev *cryp = ctx->cryp; in starfive_aes_set_alen()
120 writel(upper_32_bits(cryp->assoclen), cryp->base + STARFIVE_AES_ALEN0); in starfive_aes_set_alen()
121 writel(lower_32_bits(cryp->assoclen), cryp->base + STARFIVE_AES_ALEN1); in starfive_aes_set_alen()
124 static inline void starfive_aes_set_mlen(struct starfive_cryp_ctx *ctx) in starfive_aes_set_mlen()
126 struct starfive_cryp_dev *cryp = ctx->cryp; in starfive_aes_set_mlen()
128 writel(upper_32_bits(cryp->total_in), cryp->base + STARFIVE_AES_MLEN0); in starfive_aes_set_mlen()
129 writel(lower_32_bits(cryp->total_in), cryp->base + STARFIVE_AES_MLEN1); in starfive_aes_set_mlen()
132 static inline int starfive_aes_ccm_check_iv(const u8 *iv) in starfive_aes_ccm_check_iv()
136 return -EINVAL; in starfive_aes_ccm_check_iv()
143 struct starfive_cryp_dev *cryp = ctx->cryp; in starfive_aes_write_iv()
145 writel(iv[0], cryp->base + STARFIVE_AES_IV0); in starfive_aes_write_iv()
146 writel(iv[1], cryp->base + STARFIVE_AES_IV1); in starfive_aes_write_iv()
147 writel(iv[2], cryp->base + STARFIVE_AES_IV2); in starfive_aes_write_iv()
151 return -ETIMEDOUT; in starfive_aes_write_iv()
156 writel(iv[3], cryp->base + STARFIVE_AES_IV3); in starfive_aes_write_iv()
161 static inline void starfive_aes_get_iv(struct starfive_cryp_dev *cryp, u32 *iv) in starfive_aes_get_iv()
163 iv[0] = readl(cryp->base + STARFIVE_AES_IV0); in starfive_aes_get_iv()
164 iv[1] = readl(cryp->base + STARFIVE_AES_IV1); in starfive_aes_get_iv()
165 iv[2] = readl(cryp->base + STARFIVE_AES_IV2); in starfive_aes_get_iv()
166 iv[3] = readl(cryp->base + STARFIVE_AES_IV3); in starfive_aes_get_iv()
169 static inline void starfive_aes_write_nonce(struct starfive_cryp_ctx *ctx, u32 *nonce) in starfive_aes_write_nonce()
171 struct starfive_cryp_dev *cryp = ctx->cryp; in starfive_aes_write_nonce()
173 writel(nonce[0], cryp->base + STARFIVE_AES_NONCE0); in starfive_aes_write_nonce()
174 writel(nonce[1], cryp->base + STARFIVE_AES_NONCE1); in starfive_aes_write_nonce()
175 writel(nonce[2], cryp->base + STARFIVE_AES_NONCE2); in starfive_aes_write_nonce()
176 writel(nonce[3], cryp->base + STARFIVE_AES_NONCE3); in starfive_aes_write_nonce()
181 struct starfive_cryp_dev *cryp = ctx->cryp; in starfive_aes_write_key()
182 u32 *key = (u32 *)ctx->key; in starfive_aes_write_key()
184 if (ctx->keylen >= AES_KEYSIZE_128) { in starfive_aes_write_key()
185 writel(key[0], cryp->base + STARFIVE_AES_KEY0); in starfive_aes_write_key()
186 writel(key[1], cryp->base + STARFIVE_AES_KEY1); in starfive_aes_write_key()
187 writel(key[2], cryp->base + STARFIVE_AES_KEY2); in starfive_aes_write_key()
188 writel(key[3], cryp->base + STARFIVE_AES_KEY3); in starfive_aes_write_key()
191 if (ctx->keylen >= AES_KEYSIZE_192) { in starfive_aes_write_key()
192 writel(key[4], cryp->base + STARFIVE_AES_KEY4); in starfive_aes_write_key()
193 writel(key[5], cryp->base + STARFIVE_AES_KEY5); in starfive_aes_write_key()
196 if (ctx->keylen >= AES_KEYSIZE_256) { in starfive_aes_write_key()
197 writel(key[6], cryp->base + STARFIVE_AES_KEY6); in starfive_aes_write_key()
198 writel(key[7], cryp->base + STARFIVE_AES_KEY7); in starfive_aes_write_key()
202 return -ETIMEDOUT; in starfive_aes_write_key()
209 struct starfive_cryp_dev *cryp = ctx->cryp; in starfive_aes_ccm_init()
213 memcpy(iv, cryp->req.areq->iv, AES_BLOCK_SIZE); in starfive_aes_ccm_init()
214 memset(iv + AES_BLOCK_SIZE - 1 - iv[0], 0, iv[0] + 1); in starfive_aes_ccm_init()
219 b0[0] |= (8 * ((cryp->authsize - 2) / 2)); in starfive_aes_ccm_init()
221 if (cryp->assoclen) in starfive_aes_ccm_init()
224 textlen = cryp->total_in; in starfive_aes_ccm_init()
226 b0[AES_BLOCK_SIZE - 2] = textlen >> 8; in starfive_aes_ccm_init()
227 b0[AES_BLOCK_SIZE - 1] = textlen & 0xFF; in starfive_aes_ccm_init()
236 struct starfive_cryp_request_ctx *rctx = ctx->rctx; in starfive_aes_hw_init()
237 struct starfive_cryp_dev *cryp = ctx->cryp; in starfive_aes_hw_init()
241 rctx->csr.aes.v = 0; in starfive_aes_hw_init()
242 rctx->csr.aes.aesrst = 1; in starfive_aes_hw_init()
243 writel(rctx->csr.aes.v, cryp->base + STARFIVE_AES_CSR); in starfive_aes_hw_init()
246 hw_mode = cryp->flags & FLG_MODE_MASK; in starfive_aes_hw_init()
248 rctx->csr.aes.v = 0; in starfive_aes_hw_init()
250 switch (ctx->keylen) { in starfive_aes_hw_init()
252 rctx->csr.aes.keymode = STARFIVE_AES_KEYMODE_128; in starfive_aes_hw_init()
255 rctx->csr.aes.keymode = STARFIVE_AES_KEYMODE_192; in starfive_aes_hw_init()
258 rctx->csr.aes.keymode = STARFIVE_AES_KEYMODE_256; in starfive_aes_hw_init()
262 rctx->csr.aes.mode = hw_mode; in starfive_aes_hw_init()
263 rctx->csr.aes.cmode = !is_encrypt(cryp); in starfive_aes_hw_init()
264 rctx->csr.aes.ie = 1; in starfive_aes_hw_init()
268 rctx->csr.aes.stmode = STARFIVE_AES_MODE_XFB_128; in starfive_aes_hw_init()
270 rctx->csr.aes.stmode = STARFIVE_AES_MODE_XFB_1; in starfive_aes_hw_init()
272 if (cryp->side_chan) { in starfive_aes_hw_init()
273 rctx->csr.aes.delay_aes = 1; in starfive_aes_hw_init()
274 rctx->csr.aes.vaes_start = 1; in starfive_aes_hw_init()
277 writel(rctx->csr.aes.v, cryp->base + STARFIVE_AES_CSR); in starfive_aes_hw_init()
279 cryp->err = starfive_aes_write_key(ctx); in starfive_aes_hw_init()
280 if (cryp->err) in starfive_aes_hw_init()
281 return cryp->err; in starfive_aes_hw_init()
289 starfive_aes_write_iv(ctx, (void *)cryp->req.areq->iv); in starfive_aes_hw_init()
301 starfive_aes_write_iv(ctx, (void *)cryp->req.sreq->iv); in starfive_aes_hw_init()
307 return cryp->err; in starfive_aes_hw_init()
315 return dev_err_probe(cryp->dev, -ETIMEDOUT, in starfive_aes_read_authtag()
322 cryp->tag_out[i] = readl(cryp->base + start_addr); in starfive_aes_read_authtag()
325 cryp->tag_out[i] = readl(cryp->base + STARFIVE_AES_AESDIO0R); in starfive_aes_read_authtag()
328 scatterwalk_copychunks(cryp->tag_out, &cryp->out_walk, cryp->authsize, 1); in starfive_aes_read_authtag()
330 scatterwalk_copychunks(cryp->tag_in, &cryp->in_walk, cryp->authsize, 0); in starfive_aes_read_authtag()
332 if (crypto_memneq(cryp->tag_in, cryp->tag_out, cryp->authsize)) in starfive_aes_read_authtag()
333 return dev_err_probe(cryp->dev, -EBADMSG, "Failed tag verification\n"); in starfive_aes_read_authtag()
342 int err = cryp->err; in starfive_aes_finish_req()
344 if (!err && cryp->authsize) in starfive_aes_finish_req()
347 if (!err && ((cryp->flags & FLG_MODE_MASK) == STARFIVE_AES_MODE_CBC || in starfive_aes_finish_req()
348 (cryp->flags & FLG_MODE_MASK) == STARFIVE_AES_MODE_CTR)) in starfive_aes_finish_req()
349 starfive_aes_get_iv(cryp, (void *)cryp->req.sreq->iv); in starfive_aes_finish_req()
354 writel(csr.v, cryp->base + STARFIVE_AES_CSR); in starfive_aes_finish_req()
356 if (cryp->authsize) in starfive_aes_finish_req()
357 crypto_finalize_aead_request(cryp->engine, cryp->req.areq, err); in starfive_aes_finish_req()
359 crypto_finalize_skcipher_request(cryp->engine, cryp->req.sreq, in starfive_aes_finish_req()
371 block[i] = readl(cryp->base + STARFIVE_AES_AESDIO0R); in starfive_aes_done_task()
373 scatterwalk_copychunks(block, &cryp->out_walk, min_t(size_t, AES_BLOCK_SIZE, in starfive_aes_done_task()
374 cryp->total_out), 1); in starfive_aes_done_task()
376 cryp->total_out -= min_t(size_t, AES_BLOCK_SIZE, cryp->total_out); in starfive_aes_done_task()
378 if (!cryp->total_out) { in starfive_aes_done_task()
384 scatterwalk_copychunks(block, &cryp->in_walk, min_t(size_t, AES_BLOCK_SIZE, in starfive_aes_done_task()
385 cryp->total_in), 0); in starfive_aes_done_task()
386 cryp->total_in -= min_t(size_t, AES_BLOCK_SIZE, cryp->total_in); in starfive_aes_done_task()
389 writel(block[i], cryp->base + STARFIVE_AES_AESDIO0R); in starfive_aes_done_task()
391 stat = readl(cryp->base + STARFIVE_IE_MASK_OFFSET); in starfive_aes_done_task()
393 writel(stat, cryp->base + STARFIVE_IE_MASK_OFFSET); in starfive_aes_done_task()
398 struct starfive_cryp_dev *cryp = ctx->cryp; in starfive_aes_gcm_write_adata()
399 struct starfive_cryp_request_ctx *rctx = ctx->rctx; in starfive_aes_gcm_write_adata()
403 total_len = ALIGN(cryp->assoclen, AES_BLOCK_SIZE) / sizeof(unsigned int); in starfive_aes_gcm_write_adata()
404 buffer = (u32 *)rctx->adata; in starfive_aes_gcm_write_adata()
407 writel(*buffer, cryp->base + STARFIVE_AES_NONCE0); in starfive_aes_gcm_write_adata()
409 writel(*buffer, cryp->base + STARFIVE_AES_NONCE1); in starfive_aes_gcm_write_adata()
411 writel(*buffer, cryp->base + STARFIVE_AES_NONCE2); in starfive_aes_gcm_write_adata()
413 writel(*buffer, cryp->base + STARFIVE_AES_NONCE3); in starfive_aes_gcm_write_adata()
418 return dev_err_probe(cryp->dev, -ETIMEDOUT, in starfive_aes_gcm_write_adata()
426 struct starfive_cryp_dev *cryp = ctx->cryp; in starfive_aes_ccm_write_adata()
427 struct starfive_cryp_request_ctx *rctx = ctx->rctx; in starfive_aes_ccm_write_adata()
432 total_len = cryp->assoclen; in starfive_aes_ccm_write_adata()
434 ci = rctx->adata; in starfive_aes_ccm_write_adata()
435 writeb(*ci, cryp->base + STARFIVE_AES_AESDIO0R); in starfive_aes_ccm_write_adata()
437 writeb(*ci, cryp->base + STARFIVE_AES_AESDIO0R); in starfive_aes_ccm_write_adata()
439 total_len -= 2; in starfive_aes_ccm_write_adata()
443 writel(*buffer, cryp->base + STARFIVE_AES_AESDIO0R); in starfive_aes_ccm_write_adata()
445 total_len -= 12; in starfive_aes_ccm_write_adata()
449 writel(*buffer, cryp->base + STARFIVE_AES_AESDIO0R); in starfive_aes_ccm_write_adata()
451 total_len -= AES_BLOCK_SIZE; in starfive_aes_ccm_write_adata()
455 return dev_err_probe(cryp->dev, -ETIMEDOUT, in starfive_aes_ccm_write_adata()
469 return -EINVAL; in starfive_aes_prepare_req()
474 cryp = ctx->cryp; in starfive_aes_prepare_req()
478 cryp->req.sreq = req; in starfive_aes_prepare_req()
479 cryp->total_in = req->cryptlen; in starfive_aes_prepare_req()
480 cryp->total_out = req->cryptlen; in starfive_aes_prepare_req()
481 cryp->assoclen = 0; in starfive_aes_prepare_req()
482 cryp->authsize = 0; in starfive_aes_prepare_req()
484 cryp->req.areq = areq; in starfive_aes_prepare_req()
485 cryp->assoclen = areq->assoclen; in starfive_aes_prepare_req()
486 cryp->authsize = crypto_aead_authsize(crypto_aead_reqtfm(areq)); in starfive_aes_prepare_req()
488 cryp->total_in = areq->cryptlen; in starfive_aes_prepare_req()
489 cryp->total_out = areq->cryptlen; in starfive_aes_prepare_req()
491 cryp->total_in = areq->cryptlen - cryp->authsize; in starfive_aes_prepare_req()
492 cryp->total_out = cryp->total_in; in starfive_aes_prepare_req()
496 rctx->in_sg = req ? req->src : areq->src; in starfive_aes_prepare_req()
497 scatterwalk_start(&cryp->in_walk, rctx->in_sg); in starfive_aes_prepare_req()
499 rctx->out_sg = req ? req->dst : areq->dst; in starfive_aes_prepare_req()
500 scatterwalk_start(&cryp->out_walk, rctx->out_sg); in starfive_aes_prepare_req()
502 if (cryp->assoclen) { in starfive_aes_prepare_req()
503 rctx->adata = kzalloc(ALIGN(cryp->assoclen, AES_BLOCK_SIZE), GFP_KERNEL); in starfive_aes_prepare_req()
504 if (!rctx->adata) in starfive_aes_prepare_req()
505 return dev_err_probe(cryp->dev, -ENOMEM, in starfive_aes_prepare_req()
508 scatterwalk_copychunks(rctx->adata, &cryp->in_walk, cryp->assoclen, 0); in starfive_aes_prepare_req()
509 scatterwalk_copychunks(NULL, &cryp->out_walk, cryp->assoclen, 2); in starfive_aes_prepare_req()
512 ctx->rctx = rctx; in starfive_aes_prepare_req()
517 static int starfive_aes_do_one_req(struct crypto_engine *engine, void *areq) in starfive_aes_do_one_req() argument
523 struct starfive_cryp_dev *cryp = ctx->cryp; in starfive_aes_do_one_req()
537 scatterwalk_copychunks(block, &cryp->in_walk, min_t(size_t, AES_BLOCK_SIZE, in starfive_aes_do_one_req()
538 cryp->total_in), 0); in starfive_aes_do_one_req()
539 cryp->total_in -= min_t(size_t, AES_BLOCK_SIZE, cryp->total_in); in starfive_aes_do_one_req()
542 writel(block[i], cryp->base + STARFIVE_AES_AESDIO0R); in starfive_aes_do_one_req()
544 stat = readl(cryp->base + STARFIVE_IE_MASK_OFFSET); in starfive_aes_do_one_req()
546 writel(stat, cryp->base + STARFIVE_IE_MASK_OFFSET); in starfive_aes_do_one_req()
555 ctx->cryp = starfive_cryp_find_dev(ctx); in starfive_aes_init_tfm()
556 if (!ctx->cryp) in starfive_aes_init_tfm()
557 return -ENODEV; in starfive_aes_init_tfm()
565 static int starfive_aes_aead_do_one_req(struct crypto_engine *engine, void *areq) in starfive_aes_aead_do_one_req() argument
571 struct starfive_cryp_dev *cryp = ctx->cryp; in starfive_aes_aead_do_one_req()
572 struct starfive_cryp_request_ctx *rctx = ctx->rctx; in starfive_aes_aead_do_one_req()
582 if (!cryp->assoclen) in starfive_aes_aead_do_one_req()
585 if ((cryp->flags & FLG_MODE_MASK) == STARFIVE_AES_MODE_CCM) in starfive_aes_aead_do_one_req()
586 cryp->err = starfive_aes_ccm_write_adata(ctx); in starfive_aes_aead_do_one_req()
588 cryp->err = starfive_aes_gcm_write_adata(ctx); in starfive_aes_aead_do_one_req()
590 kfree(rctx->adata); in starfive_aes_aead_do_one_req()
592 if (cryp->err) in starfive_aes_aead_do_one_req()
593 return cryp->err; in starfive_aes_aead_do_one_req()
596 if (!cryp->total_in) in starfive_aes_aead_do_one_req()
603 scatterwalk_copychunks(block, &cryp->in_walk, min_t(size_t, AES_BLOCK_SIZE, in starfive_aes_aead_do_one_req()
604 cryp->total_in), 0); in starfive_aes_aead_do_one_req()
605 cryp->total_in -= min_t(size_t, AES_BLOCK_SIZE, cryp->total_in); in starfive_aes_aead_do_one_req()
608 writel(block[i], cryp->base + STARFIVE_AES_AESDIO0R); in starfive_aes_aead_do_one_req()
610 stat = readl(cryp->base + STARFIVE_IE_MASK_OFFSET); in starfive_aes_aead_do_one_req()
612 writel(stat, cryp->base + STARFIVE_IE_MASK_OFFSET); in starfive_aes_aead_do_one_req()
624 struct starfive_cryp_dev *cryp = ctx->cryp; in starfive_aes_aead_init_tfm()
626 struct crypto_alg *alg = aead->__crt_alg; in starfive_aes_aead_init_tfm()
628 ctx->cryp = starfive_cryp_find_dev(ctx); in starfive_aes_aead_init_tfm()
629 if (!ctx->cryp) in starfive_aes_aead_init_tfm()
630 return -ENODEV; in starfive_aes_aead_init_tfm()
632 if (alg->cra_flags & CRYPTO_ALG_NEED_FALLBACK) { in starfive_aes_aead_init_tfm()
633 ctx->aead_fbk = crypto_alloc_aead(alg->cra_name, 0, in starfive_aes_aead_init_tfm()
635 if (IS_ERR(ctx->aead_fbk)) in starfive_aes_aead_init_tfm()
636 return dev_err_probe(cryp->dev, PTR_ERR(ctx->aead_fbk), in starfive_aes_aead_init_tfm()
638 __func__, alg->cra_name); in starfive_aes_aead_init_tfm()
651 crypto_free_aead(ctx->aead_fbk); in starfive_aes_aead_exit_tfm()
658 struct starfive_cryp_dev *cryp = ctx->cryp; in starfive_aes_crypt()
659 unsigned int blocksize_align = crypto_skcipher_blocksize(tfm) - 1; in starfive_aes_crypt()
661 cryp->flags = flags; in starfive_aes_crypt()
663 if ((cryp->flags & FLG_MODE_MASK) == STARFIVE_AES_MODE_ECB || in starfive_aes_crypt()
664 (cryp->flags & FLG_MODE_MASK) == STARFIVE_AES_MODE_CBC) in starfive_aes_crypt()
665 if (req->cryptlen & blocksize_align) in starfive_aes_crypt()
666 return -EINVAL; in starfive_aes_crypt()
668 return crypto_transfer_skcipher_request_to_engine(cryp->engine, req); in starfive_aes_crypt()
674 struct starfive_cryp_dev *cryp = ctx->cryp; in starfive_aes_aead_crypt()
676 cryp->flags = flags; in starfive_aes_aead_crypt()
679 * HW engine could not perform CCM tag verification on in starfive_aes_aead_crypt()
680 * non-blocksize aligned text, use fallback algo instead in starfive_aes_aead_crypt()
682 if (ctx->aead_fbk && !is_encrypt(cryp)) { in starfive_aes_aead_crypt()
685 aead_request_set_tfm(subreq, ctx->aead_fbk); in starfive_aes_aead_crypt()
686 aead_request_set_callback(subreq, req->base.flags, in starfive_aes_aead_crypt()
687 req->base.complete, req->base.data); in starfive_aes_aead_crypt()
688 aead_request_set_crypt(subreq, req->src, in starfive_aes_aead_crypt()
689 req->dst, req->cryptlen, req->iv); in starfive_aes_aead_crypt()
690 aead_request_set_ad(subreq, req->assoclen); in starfive_aes_aead_crypt()
695 return crypto_transfer_aead_request_to_engine(cryp->engine, req); in starfive_aes_aead_crypt()
704 return -EINVAL; in starfive_aes_setkey()
709 return -EINVAL; in starfive_aes_setkey()
711 memcpy(ctx->key, key, keylen); in starfive_aes_setkey()
712 ctx->keylen = keylen; in starfive_aes_setkey()
723 return -EINVAL; in starfive_aes_aead_setkey()
728 return -EINVAL; in starfive_aes_aead_setkey()
730 memcpy(ctx->key, key, keylen); in starfive_aes_aead_setkey()
731 ctx->keylen = keylen; in starfive_aes_aead_setkey()
733 if (ctx->aead_fbk) in starfive_aes_aead_setkey()
734 return crypto_aead_setkey(ctx->aead_fbk, key, keylen); in starfive_aes_aead_setkey()
760 return -EINVAL; in starfive_aes_ccm_setauthsize()
763 return crypto_aead_setauthsize(ctx->aead_fbk, authsize); in starfive_aes_ccm_setauthsize()
830 ret = starfive_aes_ccm_check_iv(req->iv); in starfive_aes_ccm_encrypt()
841 ret = starfive_aes_ccm_check_iv(req->iv); in starfive_aes_ccm_decrypt()
858 .cra_driver_name = "starfive-ecb-aes",
879 .cra_driver_name = "starfive-cbc-aes",
900 .cra_driver_name = "starfive-ctr-aes",
921 .cra_driver_name = "starfive-cfb-aes",
942 .cra_driver_name = "starfive-ofb-aes",
968 .cra_driver_name = "starfive-gcm-aes",
990 .cra_driver_name = "starfive-ccm-aes",