Lines Matching refs:pctx
197 struct crypto_gcm_req_priv_ctx *pctx = crypto_gcm_reqctx(req); in crypto_gcm_init_common() local
201 memset(pctx->auth_tag, 0, sizeof(pctx->auth_tag)); in crypto_gcm_init_common()
202 memcpy(pctx->iv, req->iv, 12); in crypto_gcm_init_common()
203 memcpy(pctx->iv + 12, &counter, 4); in crypto_gcm_init_common()
205 sg_init_table(pctx->src, 3); in crypto_gcm_init_common()
206 sg_set_buf(pctx->src, pctx->auth_tag, sizeof(pctx->auth_tag)); in crypto_gcm_init_common()
207 sg = scatterwalk_ffwd(pctx->src + 1, req->src, req->assoclen); in crypto_gcm_init_common()
208 if (sg != pctx->src + 1) in crypto_gcm_init_common()
209 sg_chain(pctx->src, 2, sg); in crypto_gcm_init_common()
212 sg_init_table(pctx->dst, 3); in crypto_gcm_init_common()
213 sg_set_buf(pctx->dst, pctx->auth_tag, sizeof(pctx->auth_tag)); in crypto_gcm_init_common()
214 sg = scatterwalk_ffwd(pctx->dst + 1, req->dst, req->assoclen); in crypto_gcm_init_common()
215 if (sg != pctx->dst + 1) in crypto_gcm_init_common()
216 sg_chain(pctx->dst, 2, sg); in crypto_gcm_init_common()
225 struct crypto_gcm_req_priv_ctx *pctx = crypto_gcm_reqctx(req); in crypto_gcm_init_crypt() local
226 struct ablkcipher_request *ablk_req = &pctx->u.abreq; in crypto_gcm_init_crypt()
229 dst = req->src == req->dst ? pctx->src : pctx->dst; in crypto_gcm_init_crypt()
232 ablkcipher_request_set_crypt(ablk_req, pctx->src, dst, in crypto_gcm_init_crypt()
233 cryptlen + sizeof(pctx->auth_tag), in crypto_gcm_init_crypt()
234 pctx->iv); in crypto_gcm_init_crypt()
250 struct crypto_gcm_req_priv_ctx *pctx = crypto_gcm_reqctx(req); in gcm_hash_update() local
251 struct ahash_request *ahreq = &pctx->u.ahreq; in gcm_hash_update()
268 struct crypto_gcm_req_priv_ctx *pctx = crypto_gcm_reqctx(req); in gcm_hash_len() local
269 struct ahash_request *ahreq = &pctx->u.ahreq; in gcm_hash_len()
270 struct crypto_gcm_ghash_ctx *gctx = &pctx->ghash_ctx; in gcm_hash_len()
275 memcpy(pctx->iauth_tag, &lengths, 16); in gcm_hash_len()
276 sg_init_one(&pctx->sg, pctx->iauth_tag, 16); in gcm_hash_len()
278 ahash_request_set_crypt(ahreq, &pctx->sg, in gcm_hash_len()
279 pctx->iauth_tag, sizeof(lengths)); in gcm_hash_len()
286 struct crypto_gcm_req_priv_ctx *pctx = crypto_gcm_reqctx(req); in gcm_hash_len_continue() local
287 struct crypto_gcm_ghash_ctx *gctx = &pctx->ghash_ctx; in gcm_hash_len_continue()
331 struct crypto_gcm_req_priv_ctx *pctx = crypto_gcm_reqctx(req); in gcm_hash_crypt_continue() local
332 struct crypto_gcm_ghash_ctx *gctx = &pctx->ghash_ctx; in gcm_hash_crypt_continue()
361 struct crypto_gcm_req_priv_ctx *pctx = crypto_gcm_reqctx(req); in gcm_hash_assoc_remain_continue() local
362 struct crypto_gcm_ghash_ctx *gctx = &pctx->ghash_ctx; in gcm_hash_assoc_remain_continue()
443 struct crypto_gcm_req_priv_ctx *pctx = crypto_gcm_reqctx(req); in gcm_hash() local
444 struct ahash_request *ahreq = &pctx->u.ahreq; in gcm_hash()
456 struct crypto_gcm_req_priv_ctx *pctx = crypto_gcm_reqctx(req); in gcm_enc_copy_hash() local
458 u8 *auth_tag = pctx->auth_tag; in gcm_enc_copy_hash()
460 crypto_xor(auth_tag, pctx->iauth_tag, 16); in gcm_enc_copy_hash()
469 struct crypto_gcm_req_priv_ctx *pctx = crypto_gcm_reqctx(req); in gcm_encrypt_continue() local
470 struct crypto_gcm_ghash_ctx *gctx = &pctx->ghash_ctx; in gcm_encrypt_continue()
472 gctx->src = sg_next(req->src == req->dst ? pctx->src : pctx->dst); in gcm_encrypt_continue()
496 struct crypto_gcm_req_priv_ctx *pctx = crypto_gcm_reqctx(req); in crypto_gcm_encrypt() local
497 struct ablkcipher_request *abreq = &pctx->u.abreq; in crypto_gcm_encrypt()
510 struct crypto_gcm_req_priv_ctx *pctx = crypto_gcm_reqctx(req); in crypto_gcm_verify() local
512 u8 *auth_tag = pctx->auth_tag; in crypto_gcm_verify()
513 u8 *iauth_tag = pctx->iauth_tag; in crypto_gcm_verify()
535 struct crypto_gcm_req_priv_ctx *pctx = crypto_gcm_reqctx(req); in gcm_dec_hash_continue() local
536 struct ablkcipher_request *abreq = &pctx->u.abreq; in gcm_dec_hash_continue()
537 struct crypto_gcm_ghash_ctx *gctx = &pctx->ghash_ctx; in gcm_dec_hash_continue()
547 struct crypto_gcm_req_priv_ctx *pctx = crypto_gcm_reqctx(req); in crypto_gcm_decrypt() local
548 struct crypto_gcm_ghash_ctx *gctx = &pctx->ghash_ctx; in crypto_gcm_decrypt()
557 gctx->src = sg_next(pctx->src); in crypto_gcm_decrypt()