Lines Matching refs:pctx

165 		       struct crypto_ccm_req_priv_ctx *pctx)  in compute_mac()  argument
168 u8 *odata = pctx->odata; in compute_mac()
169 u8 *idata = pctx->idata; in compute_mac()
175 getlen = bs - pctx->ilen; in compute_mac()
177 memcpy(idata + pctx->ilen, data, getlen); in compute_mac()
182 pctx->ilen = 0; in compute_mac()
198 memcpy(idata + pctx->ilen, data, datalen); in compute_mac()
199 pctx->ilen += datalen; in compute_mac()
204 struct crypto_ccm_req_priv_ctx *pctx, in get_data_to_compute() argument
221 compute_mac(tfm, data_src, n, pctx); in get_data_to_compute()
228 crypto_yield(pctx->flags); in get_data_to_compute()
232 if (pctx->ilen) { in get_data_to_compute()
234 u8 *odata = pctx->odata; in get_data_to_compute()
235 u8 *idata = pctx->idata; in get_data_to_compute()
237 padlen = 16 - pctx->ilen; in get_data_to_compute()
238 memset(idata + pctx->ilen, 0, padlen); in get_data_to_compute()
241 pctx->ilen = 0; in get_data_to_compute()
250 struct crypto_ccm_req_priv_ctx *pctx = crypto_ccm_reqctx(req); in crypto_ccm_auth() local
253 u8 *odata = pctx->odata; in crypto_ccm_auth()
254 u8 *idata = pctx->idata; in crypto_ccm_auth()
267 pctx->ilen = format_adata(idata, assoclen); in crypto_ccm_auth()
268 get_data_to_compute(cipher, pctx, req->assoc, req->assoclen); in crypto_ccm_auth()
270 pctx->ilen = 0; in crypto_ccm_auth()
275 get_data_to_compute(cipher, pctx, plain, cryptlen); in crypto_ccm_auth()
285 struct crypto_ccm_req_priv_ctx *pctx = crypto_ccm_reqctx(req); in crypto_ccm_encrypt_done() local
286 u8 *odata = pctx->odata; in crypto_ccm_encrypt_done()
307 struct crypto_ccm_req_priv_ctx *pctx = crypto_ccm_reqctx(req); in crypto_ccm_encrypt() local
308 struct ablkcipher_request *abreq = &pctx->abreq; in crypto_ccm_encrypt()
311 u8 *odata = pctx->odata; in crypto_ccm_encrypt()
319 pctx->flags = aead_request_flags(req); in crypto_ccm_encrypt()
330 sg_init_table(pctx->src, 2); in crypto_ccm_encrypt()
331 sg_set_buf(pctx->src, odata, 16); in crypto_ccm_encrypt()
332 scatterwalk_sg_chain(pctx->src, 2, req->src); in crypto_ccm_encrypt()
334 dst = pctx->src; in crypto_ccm_encrypt()
336 sg_init_table(pctx->dst, 2); in crypto_ccm_encrypt()
337 sg_set_buf(pctx->dst, odata, 16); in crypto_ccm_encrypt()
338 scatterwalk_sg_chain(pctx->dst, 2, req->dst); in crypto_ccm_encrypt()
339 dst = pctx->dst; in crypto_ccm_encrypt()
343 ablkcipher_request_set_callback(abreq, pctx->flags, in crypto_ccm_encrypt()
345 ablkcipher_request_set_crypt(abreq, pctx->src, dst, cryptlen + 16, iv); in crypto_ccm_encrypt()
360 struct crypto_ccm_req_priv_ctx *pctx = crypto_ccm_reqctx(req); in crypto_ccm_decrypt_done() local
367 if (!err && crypto_memneq(pctx->auth_tag, pctx->odata, authsize)) in crypto_ccm_decrypt_done()
377 struct crypto_ccm_req_priv_ctx *pctx = crypto_ccm_reqctx(req); in crypto_ccm_decrypt() local
378 struct ablkcipher_request *abreq = &pctx->abreq; in crypto_ccm_decrypt()
382 u8 *authtag = pctx->auth_tag; in crypto_ccm_decrypt()
383 u8 *odata = pctx->odata; in crypto_ccm_decrypt()
395 pctx->flags = aead_request_flags(req); in crypto_ccm_decrypt()
401 sg_init_table(pctx->src, 2); in crypto_ccm_decrypt()
402 sg_set_buf(pctx->src, authtag, 16); in crypto_ccm_decrypt()
403 scatterwalk_sg_chain(pctx->src, 2, req->src); in crypto_ccm_decrypt()
405 dst = pctx->src; in crypto_ccm_decrypt()
407 sg_init_table(pctx->dst, 2); in crypto_ccm_decrypt()
408 sg_set_buf(pctx->dst, authtag, 16); in crypto_ccm_decrypt()
409 scatterwalk_sg_chain(pctx->dst, 2, req->dst); in crypto_ccm_decrypt()
410 dst = pctx->dst; in crypto_ccm_decrypt()
414 ablkcipher_request_set_callback(abreq, pctx->flags, in crypto_ccm_decrypt()
416 ablkcipher_request_set_crypt(abreq, pctx->src, dst, cryptlen + 16, iv); in crypto_ccm_decrypt()