Lines Matching refs:pctx
179 struct crypto_ccm_req_priv_ctx *pctx = crypto_ccm_reqctx(req); in crypto_ccm_auth() local
182 struct ahash_request *ahreq = &pctx->ahreq; in crypto_ccm_auth()
185 u8 *odata = pctx->odata; in crypto_ccm_auth()
186 u8 *idata = pctx->idata; in crypto_ccm_auth()
208 ahash_request_set_callback(ahreq, pctx->flags, NULL, NULL); in crypto_ccm_auth()
229 ahash_request_set_crypt(ahreq, plain, pctx->odata, cryptlen); in crypto_ccm_auth()
239 struct crypto_ccm_req_priv_ctx *pctx = crypto_ccm_reqctx(req); in crypto_ccm_encrypt_done() local
240 u8 *odata = pctx->odata; in crypto_ccm_encrypt_done()
260 struct crypto_ccm_req_priv_ctx *pctx = crypto_ccm_reqctx(req); in crypto_ccm_init_crypt() local
269 pctx->flags = aead_request_flags(req); in crypto_ccm_init_crypt()
276 sg_init_table(pctx->src, 3); in crypto_ccm_init_crypt()
277 sg_set_buf(pctx->src, tag, 16); in crypto_ccm_init_crypt()
278 sg = scatterwalk_ffwd(pctx->src + 1, req->src, req->assoclen); in crypto_ccm_init_crypt()
279 if (sg != pctx->src + 1) in crypto_ccm_init_crypt()
280 sg_chain(pctx->src, 2, sg); in crypto_ccm_init_crypt()
283 sg_init_table(pctx->dst, 3); in crypto_ccm_init_crypt()
284 sg_set_buf(pctx->dst, tag, 16); in crypto_ccm_init_crypt()
285 sg = scatterwalk_ffwd(pctx->dst + 1, req->dst, req->assoclen); in crypto_ccm_init_crypt()
286 if (sg != pctx->dst + 1) in crypto_ccm_init_crypt()
287 sg_chain(pctx->dst, 2, sg); in crypto_ccm_init_crypt()
297 struct crypto_ccm_req_priv_ctx *pctx = crypto_ccm_reqctx(req); in crypto_ccm_encrypt() local
298 struct skcipher_request *skreq = &pctx->skreq; in crypto_ccm_encrypt()
301 u8 *odata = pctx->odata; in crypto_ccm_encrypt()
309 err = crypto_ccm_auth(req, sg_next(pctx->src), cryptlen); in crypto_ccm_encrypt()
313 dst = pctx->src; in crypto_ccm_encrypt()
315 dst = pctx->dst; in crypto_ccm_encrypt()
318 skcipher_request_set_callback(skreq, pctx->flags, in crypto_ccm_encrypt()
320 skcipher_request_set_crypt(skreq, pctx->src, dst, cryptlen + 16, iv); in crypto_ccm_encrypt()
335 struct crypto_ccm_req_priv_ctx *pctx = crypto_ccm_reqctx(req); in crypto_ccm_decrypt_done() local
341 pctx->flags = 0; in crypto_ccm_decrypt_done()
343 dst = sg_next(req->src == req->dst ? pctx->src : pctx->dst); in crypto_ccm_decrypt_done()
347 if (!err && crypto_memneq(pctx->auth_tag, pctx->odata, authsize)) in crypto_ccm_decrypt_done()
357 struct crypto_ccm_req_priv_ctx *pctx = crypto_ccm_reqctx(req); in crypto_ccm_decrypt() local
358 struct skcipher_request *skreq = &pctx->skreq; in crypto_ccm_decrypt()
362 u8 *authtag = pctx->auth_tag; in crypto_ccm_decrypt()
363 u8 *odata = pctx->odata; in crypto_ccm_decrypt()
364 u8 *iv = pctx->idata; in crypto_ccm_decrypt()
373 scatterwalk_map_and_copy(authtag, sg_next(pctx->src), cryptlen, in crypto_ccm_decrypt()
376 dst = pctx->src; in crypto_ccm_decrypt()
378 dst = pctx->dst; in crypto_ccm_decrypt()
383 skcipher_request_set_callback(skreq, pctx->flags, in crypto_ccm_decrypt()
385 skcipher_request_set_crypt(skreq, pctx->src, dst, cryptlen + 16, iv); in crypto_ccm_decrypt()