Lines Matching refs:rctx
80 struct ccp_aes_req_ctx *rctx = aead_request_ctx(req); in ccp_aes_gcm_crypt() local
105 memcpy(rctx->iv, req->iv, GCM_AES_IV_SIZE); in ccp_aes_gcm_crypt()
107 rctx->iv[i + GCM_AES_IV_SIZE] = 0; in ccp_aes_gcm_crypt()
108 rctx->iv[AES_BLOCK_SIZE - 1] = 1; in ccp_aes_gcm_crypt()
111 iv_sg = &rctx->iv_sg; in ccp_aes_gcm_crypt()
113 sg_init_one(iv_sg, rctx->iv, iv_len); in ccp_aes_gcm_crypt()
116 memset(&rctx->cmd, 0, sizeof(rctx->cmd)); in ccp_aes_gcm_crypt()
117 INIT_LIST_HEAD(&rctx->cmd.entry); in ccp_aes_gcm_crypt()
118 rctx->cmd.engine = CCP_ENGINE_AES; in ccp_aes_gcm_crypt()
119 rctx->cmd.u.aes.authsize = crypto_aead_authsize(tfm); in ccp_aes_gcm_crypt()
120 rctx->cmd.u.aes.type = ctx->u.aes.type; in ccp_aes_gcm_crypt()
121 rctx->cmd.u.aes.mode = ctx->u.aes.mode; in ccp_aes_gcm_crypt()
122 rctx->cmd.u.aes.action = encrypt; in ccp_aes_gcm_crypt()
123 rctx->cmd.u.aes.key = &ctx->u.aes.key_sg; in ccp_aes_gcm_crypt()
124 rctx->cmd.u.aes.key_len = ctx->u.aes.key_len; in ccp_aes_gcm_crypt()
125 rctx->cmd.u.aes.iv = iv_sg; in ccp_aes_gcm_crypt()
126 rctx->cmd.u.aes.iv_len = iv_len; in ccp_aes_gcm_crypt()
127 rctx->cmd.u.aes.src = req->src; in ccp_aes_gcm_crypt()
128 rctx->cmd.u.aes.src_len = req->cryptlen; in ccp_aes_gcm_crypt()
129 rctx->cmd.u.aes.aad_len = req->assoclen; in ccp_aes_gcm_crypt()
132 rctx->cmd.u.aes.dst = req->dst; in ccp_aes_gcm_crypt()
134 ret = ccp_crypto_enqueue_request(&req->base, &rctx->cmd); in ccp_aes_gcm_crypt()