Lines Matching refs:rctx
151 static int nitrox_set_creq(struct nitrox_aead_rctx *rctx) in nitrox_set_creq() argument
153 struct se_crypto_request *creq = &rctx->nkreq.creq; in nitrox_set_creq()
157 creq->flags = rctx->flags; in nitrox_set_creq()
158 creq->gfp = (rctx->flags & CRYPTO_TFM_REQ_MAY_SLEEP) ? GFP_KERNEL : in nitrox_set_creq()
163 creq->ctrl.s.arg = rctx->ctrl_arg; in nitrox_set_creq()
165 creq->gph.param0 = cpu_to_be16(rctx->cryptlen); in nitrox_set_creq()
166 creq->gph.param1 = cpu_to_be16(rctx->cryptlen + rctx->assoclen); in nitrox_set_creq()
167 creq->gph.param2 = cpu_to_be16(rctx->ivsize + rctx->assoclen); in nitrox_set_creq()
169 param3.auth_offset = rctx->ivsize; in nitrox_set_creq()
172 creq->ctx_handle = rctx->ctx_handle; in nitrox_set_creq()
175 ret = alloc_src_sglist(&rctx->nkreq, rctx->src, rctx->iv, rctx->ivsize, in nitrox_set_creq()
176 rctx->srclen); in nitrox_set_creq()
180 ret = alloc_dst_sglist(&rctx->nkreq, rctx->dst, rctx->ivsize, in nitrox_set_creq()
181 rctx->dstlen); in nitrox_set_creq()
183 free_src_sglist(&rctx->nkreq); in nitrox_set_creq()
193 struct nitrox_aead_rctx *rctx = aead_request_ctx(areq); in nitrox_aead_callback() local
195 free_src_sglist(&rctx->nkreq); in nitrox_aead_callback()
196 free_dst_sglist(&rctx->nkreq); in nitrox_aead_callback()
217 struct nitrox_aead_rctx *rctx = aead_request_ctx(areq); in nitrox_aes_gcm_enc() local
218 struct se_crypto_request *creq = &rctx->nkreq.creq; in nitrox_aes_gcm_enc()
227 rctx->cryptlen = areq->cryptlen; in nitrox_aes_gcm_enc()
228 rctx->assoclen = areq->assoclen; in nitrox_aes_gcm_enc()
229 rctx->srclen = areq->assoclen + areq->cryptlen; in nitrox_aes_gcm_enc()
230 rctx->dstlen = rctx->srclen + aead->authsize; in nitrox_aes_gcm_enc()
231 rctx->iv = &areq->iv[GCM_AES_SALT_SIZE]; in nitrox_aes_gcm_enc()
232 rctx->ivsize = GCM_AES_IV_SIZE - GCM_AES_SALT_SIZE; in nitrox_aes_gcm_enc()
233 rctx->flags = areq->base.flags; in nitrox_aes_gcm_enc()
234 rctx->ctx_handle = nctx->u.ctx_handle; in nitrox_aes_gcm_enc()
235 rctx->src = areq->src; in nitrox_aes_gcm_enc()
236 rctx->dst = areq->dst; in nitrox_aes_gcm_enc()
237 rctx->ctrl_arg = ENCRYPT; in nitrox_aes_gcm_enc()
238 ret = nitrox_set_creq(rctx); in nitrox_aes_gcm_enc()
251 struct nitrox_aead_rctx *rctx = aead_request_ctx(areq); in nitrox_aes_gcm_dec() local
252 struct se_crypto_request *creq = &rctx->nkreq.creq; in nitrox_aes_gcm_dec()
261 rctx->cryptlen = areq->cryptlen - aead->authsize; in nitrox_aes_gcm_dec()
262 rctx->assoclen = areq->assoclen; in nitrox_aes_gcm_dec()
263 rctx->srclen = areq->cryptlen + areq->assoclen; in nitrox_aes_gcm_dec()
264 rctx->dstlen = rctx->srclen - aead->authsize; in nitrox_aes_gcm_dec()
265 rctx->iv = &areq->iv[GCM_AES_SALT_SIZE]; in nitrox_aes_gcm_dec()
266 rctx->ivsize = GCM_AES_IV_SIZE - GCM_AES_SALT_SIZE; in nitrox_aes_gcm_dec()
267 rctx->flags = areq->base.flags; in nitrox_aes_gcm_dec()
268 rctx->ctx_handle = nctx->u.ctx_handle; in nitrox_aes_gcm_dec()
269 rctx->src = areq->src; in nitrox_aes_gcm_dec()
270 rctx->dst = areq->dst; in nitrox_aes_gcm_dec()
271 rctx->ctrl_arg = DECRYPT; in nitrox_aes_gcm_dec()
272 ret = nitrox_set_creq(rctx); in nitrox_aes_gcm_dec()
395 struct nitrox_rfc4106_rctx *rctx = aead_request_ctx_dma(areq); in nitrox_rfc4106_set_aead_rctx_sglist() local
396 struct nitrox_aead_rctx *aead_rctx = &rctx->base; in nitrox_rfc4106_set_aead_rctx_sglist()
403 scatterwalk_map_and_copy(rctx->assoc, areq->src, 0, assoclen, 0); in nitrox_rfc4106_set_aead_rctx_sglist()
404 sg_init_table(rctx->src, 3); in nitrox_rfc4106_set_aead_rctx_sglist()
405 sg_set_buf(rctx->src, rctx->assoc, assoclen); in nitrox_rfc4106_set_aead_rctx_sglist()
406 sg = scatterwalk_ffwd(rctx->src + 1, areq->src, areq->assoclen); in nitrox_rfc4106_set_aead_rctx_sglist()
407 if (sg != rctx->src + 1) in nitrox_rfc4106_set_aead_rctx_sglist()
408 sg_chain(rctx->src, 2, sg); in nitrox_rfc4106_set_aead_rctx_sglist()
411 sg_init_table(rctx->dst, 3); in nitrox_rfc4106_set_aead_rctx_sglist()
412 sg_set_buf(rctx->dst, rctx->assoc, assoclen); in nitrox_rfc4106_set_aead_rctx_sglist()
413 sg = scatterwalk_ffwd(rctx->dst + 1, areq->dst, areq->assoclen); in nitrox_rfc4106_set_aead_rctx_sglist()
414 if (sg != rctx->dst + 1) in nitrox_rfc4106_set_aead_rctx_sglist()
415 sg_chain(rctx->dst, 2, sg); in nitrox_rfc4106_set_aead_rctx_sglist()
418 aead_rctx->src = rctx->src; in nitrox_rfc4106_set_aead_rctx_sglist()
419 aead_rctx->dst = (areq->src == areq->dst) ? rctx->src : rctx->dst; in nitrox_rfc4106_set_aead_rctx_sglist()
427 struct nitrox_rfc4106_rctx *rctx = aead_request_ctx_dma(areq); in nitrox_rfc4106_callback() local
428 struct nitrox_kcrypt_request *nkreq = &rctx->base.nkreq; in nitrox_rfc4106_callback()
444 struct nitrox_rfc4106_rctx *rctx = aead_request_ctx_dma(areq); in nitrox_rfc4106_enc() local
445 struct nitrox_aead_rctx *aead_rctx = &rctx->base; in nitrox_rfc4106_enc()
476 struct nitrox_rfc4106_rctx *rctx = aead_request_ctx(areq); in nitrox_rfc4106_dec() local
477 struct nitrox_aead_rctx *aead_rctx = &rctx->base; in nitrox_rfc4106_dec()