Lines Matching refs:tfm_ctx

80 	struct zynqmp_aead_tfm_ctx *tfm_ctx = crypto_aead_ctx(aead);  in zynqmp_aes_aead_cipher()  local
82 struct device *dev = tfm_ctx->dev; in zynqmp_aes_aead_cipher()
92 if (tfm_ctx->keysrc == ZYNQMP_AES_KUP_KEY) in zynqmp_aes_aead_cipher()
116 hwreq->keysrc = tfm_ctx->keysrc; in zynqmp_aes_aead_cipher()
126 tfm_ctx->key, ZYNQMP_AES_KEY_SIZE); in zynqmp_aes_aead_cipher()
177 static int zynqmp_fallback_check(struct zynqmp_aead_tfm_ctx *tfm_ctx, in zynqmp_fallback_check() argument
183 if (tfm_ctx->authsize != ZYNQMP_AES_AUTH_SIZE) in zynqmp_fallback_check()
186 if (tfm_ctx->keysrc == ZYNQMP_AES_KUP_KEY && in zynqmp_fallback_check()
187 tfm_ctx->keylen != ZYNQMP_AES_KEY_SIZE) { in zynqmp_fallback_check()
210 struct zynqmp_aead_tfm_ctx *tfm_ctx = crypto_aead_ctx(aead); in zynqmp_handle_aes_req() local
216 need_fallback = zynqmp_fallback_check(tfm_ctx, areq); in zynqmp_handle_aes_req()
219 aead_request_set_tfm(subreq, tfm_ctx->fbk_cipher); in zynqmp_handle_aes_req()
245 struct zynqmp_aead_tfm_ctx *tfm_ctx = in zynqmp_aes_aead_setkey() local
254 tfm_ctx->keysrc = (enum zynqmp_aead_keysrc)keysrc; in zynqmp_aes_aead_setkey()
256 tfm_ctx->keylen = keylen; in zynqmp_aes_aead_setkey()
259 tfm_ctx->keylen = keylen; in zynqmp_aes_aead_setkey()
261 tfm_ctx->keysrc = ZYNQMP_AES_KUP_KEY; in zynqmp_aes_aead_setkey()
262 memcpy(tfm_ctx->key, key, keylen); in zynqmp_aes_aead_setkey()
266 tfm_ctx->fbk_cipher->base.crt_flags &= ~CRYPTO_TFM_REQ_MASK; in zynqmp_aes_aead_setkey()
267 tfm_ctx->fbk_cipher->base.crt_flags |= (aead->base.crt_flags & in zynqmp_aes_aead_setkey()
270 return crypto_aead_setkey(tfm_ctx->fbk_cipher, key, keylen); in zynqmp_aes_aead_setkey()
277 struct zynqmp_aead_tfm_ctx *tfm_ctx = in zynqmp_aes_aead_setauthsize() local
280 tfm_ctx->authsize = authsize; in zynqmp_aes_aead_setauthsize()
281 return crypto_aead_setauthsize(tfm_ctx->fbk_cipher, authsize); in zynqmp_aes_aead_setauthsize()
313 struct zynqmp_aead_tfm_ctx *tfm_ctx = in zynqmp_aes_aead_init() local
319 tfm_ctx->dev = drv_ctx->dev; in zynqmp_aes_aead_init()
321 tfm_ctx->fbk_cipher = crypto_alloc_aead(drv_ctx->alg.aead.base.base.cra_name, in zynqmp_aes_aead_init()
325 if (IS_ERR(tfm_ctx->fbk_cipher)) { in zynqmp_aes_aead_init()
328 return PTR_ERR(tfm_ctx->fbk_cipher); in zynqmp_aes_aead_init()
334 crypto_aead_reqsize(tfm_ctx->fbk_cipher))); in zynqmp_aes_aead_init()
341 struct zynqmp_aead_tfm_ctx *tfm_ctx = in zynqmp_aes_aead_exit() local
344 if (tfm_ctx->fbk_cipher) { in zynqmp_aes_aead_exit()
345 crypto_free_aead(tfm_ctx->fbk_cipher); in zynqmp_aes_aead_exit()
346 tfm_ctx->fbk_cipher = NULL; in zynqmp_aes_aead_exit()
348 memzero_explicit(tfm_ctx, sizeof(struct zynqmp_aead_tfm_ctx)); in zynqmp_aes_aead_exit()