Lines Matching refs:c_req

107 	if (req->c_req.encrypt)  in sec_alloc_queue_id()
117 if (req->c_req.encrypt) in sec_free_queue_id()
847 struct sec_cipher_req *c_req = &req->c_req; in GEN_SEC_SETKEY_FUNC() local
859 copy_size = c_req->c_len; in GEN_SEC_SETKEY_FUNC()
867 if (!c_req->encrypt && ctx->alg_type == SEC_AEAD) { in GEN_SEC_SETKEY_FUNC()
875 c_req->c_out_dma = req->in_dma; in GEN_SEC_SETKEY_FUNC()
884 struct sec_cipher_req *c_req = &req->c_req; in sec_cipher_pbuf_unmap() local
890 copy_size = c_req->c_len + aead_req->assoclen; in sec_cipher_pbuf_unmap()
892 copy_size = c_req->c_len; in sec_cipher_pbuf_unmap()
923 struct sec_cipher_req *c_req = &req->c_req; in sec_cipher_map() local
931 c_req->c_ivin = res->pbuf + SEC_PBUF_IV_OFFSET; in sec_cipher_map()
932 c_req->c_ivin_dma = res->pbuf_dma + SEC_PBUF_IV_OFFSET; in sec_cipher_map()
944 c_req->c_ivin = res->c_ivin; in sec_cipher_map()
945 c_req->c_ivin_dma = res->c_ivin_dma; in sec_cipher_map()
962 if (!c_req->encrypt && ctx->alg_type == SEC_AEAD) { in sec_cipher_map()
971 c_req->c_out = req->in; in sec_cipher_map()
972 c_req->c_out_dma = req->in_dma; in sec_cipher_map()
974 c_req->c_out = hisi_acc_sg_buf_map_to_hw_sgl(dev, dst, in sec_cipher_map()
977 &c_req->c_out_dma); in sec_cipher_map()
979 if (IS_ERR(c_req->c_out)) { in sec_cipher_map()
982 return PTR_ERR(c_req->c_out); in sec_cipher_map()
992 struct sec_cipher_req *c_req = &req->c_req; in sec_cipher_unmap() local
1001 hisi_acc_sg_buf_unmap(dev, dst, c_req->c_out); in sec_cipher_unmap()
1007 struct skcipher_request *sq = req->c_req.sk_req; in sec_skcipher_sgl_map()
1014 struct skcipher_request *sq = req->c_req.sk_req; in sec_skcipher_sgl_unmap()
1220 struct skcipher_request *sk_req = req->c_req.sk_req; in sec_skcipher_copy_iv()
1221 struct sec_cipher_req *c_req = &req->c_req; in sec_skcipher_copy_iv() local
1223 memcpy(c_req->c_ivin, sk_req->iv, ctx->c_ctx.ivsize); in sec_skcipher_copy_iv()
1229 struct sec_cipher_req *c_req = &req->c_req; in sec_skcipher_bd_fill() local
1238 sec_sqe->type2.c_ivin_addr = cpu_to_le64(c_req->c_ivin_dma); in sec_skcipher_bd_fill()
1240 sec_sqe->type2.data_dst_addr = cpu_to_le64(c_req->c_out_dma); in sec_skcipher_bd_fill()
1249 if (c_req->encrypt) in sec_skcipher_bd_fill()
1266 if (req->in_dma != c_req->c_out_dma) in sec_skcipher_bd_fill()
1271 sec_sqe->type2.clen_ivhlen |= cpu_to_le32(c_req->c_len); in sec_skcipher_bd_fill()
1281 struct sec_cipher_req *c_req = &req->c_req; in sec_skcipher_bd_fill_v3() local
1288 sec_sqe3->no_scene.c_ivin_addr = cpu_to_le64(c_req->c_ivin_dma); in sec_skcipher_bd_fill_v3()
1290 sec_sqe3->data_dst_addr = cpu_to_le64(c_req->c_out_dma); in sec_skcipher_bd_fill_v3()
1297 if (c_req->encrypt) in sec_skcipher_bd_fill_v3()
1312 if (req->in_dma != c_req->c_out_dma) in sec_skcipher_bd_fill_v3()
1318 sec_sqe3->c_len_ivin |= cpu_to_le32(c_req->c_len); in sec_skcipher_bd_fill_v3()
1338 struct skcipher_request *sk_req = req->c_req.sk_req; in sec_update_iv()
1345 if (req->c_req.encrypt) in sec_update_iv()
1392 struct skcipher_request *sk_req = req->c_req.sk_req; in sec_skcipher_callback()
1401 ctx->c_ctx.c_mode == SEC_CMODE_CTR) && req->c_req.encrypt) in sec_skcipher_callback()
1409 backlog_sk_req = backlog_req->c_req.sk_req; in sec_skcipher_callback()
1421 struct sec_cipher_req *c_req = &req->c_req; in set_aead_auth_iv() local
1429 cl = c_req->c_ivin[0] + 1; in set_aead_auth_iv()
1430 c_req->c_ivin[ctx->c_ctx.ivsize - cl] = 0x00; in set_aead_auth_iv()
1431 memset(&c_req->c_ivin[ctx->c_ctx.ivsize - cl], 0, cl); in set_aead_auth_iv()
1432 c_req->c_ivin[ctx->c_ctx.ivsize - IV_LAST_BYTE1] = IV_CTR_INIT; in set_aead_auth_iv()
1435 flage |= c_req->c_ivin[0] & IV_CL_MASK; in set_aead_auth_iv()
1443 memcpy(a_req->a_ivin, c_req->c_ivin, ctx->c_ctx.ivsize); in set_aead_auth_iv()
1451 if (!c_req->encrypt) in set_aead_auth_iv()
1466 struct sec_cipher_req *c_req = &req->c_req; in sec_aead_set_iv() local
1469 memcpy(c_req->c_ivin, aead_req->iv, ctx->c_ctx.ivsize); in sec_aead_set_iv()
1484 memcpy(a_req->a_ivin, c_req->c_ivin, SEC_AIV_SIZE); in sec_aead_set_iv()
1543 struct sec_cipher_req *c_req = &req->c_req; in sec_auth_bd_fill_ex() local
1565 sec_sqe->type2.alen_ivllen = cpu_to_le32(c_req->c_len + aq->assoclen); in sec_auth_bd_fill_ex()
1586 sec_auth_bd_fill_xcm(auth_ctx, req->c_req.encrypt, req, sec_sqe); in sec_aead_bd_fill()
1588 sec_auth_bd_fill_ex(auth_ctx, req->c_req.encrypt, req, sec_sqe); in sec_aead_bd_fill()
1597 struct sec_cipher_req *c_req = &req->c_req; in sec_auth_bd_fill_ex_v3() local
1620 sqe3->a_len_key = cpu_to_le32(c_req->c_len + aq->assoclen); in sec_auth_bd_fill_ex_v3()
1641 sec_auth_bd_fill_xcm_v3(auth_ctx, req->c_req.encrypt, in sec_aead_bd_fill_v3()
1644 sec_auth_bd_fill_ex_v3(auth_ctx, req->c_req.encrypt, in sec_aead_bd_fill_v3()
1655 struct sec_cipher_req *c_req = &req->c_req; in sec_aead_callback() local
1662 if (!err && c->c_ctx.c_mode == SEC_CMODE_CBC && c_req->encrypt) in sec_aead_callback()
1666 if (!err && c_req->encrypt) { in sec_aead_callback()
1722 struct sec_cipher_req *c_req = &req->c_req; in sec_process() local
1734 if (!req->c_req.encrypt && (ctx->c_ctx.c_mode == SEC_CMODE_CBC || in sec_process()
1749 if (ctx->c_ctx.c_mode == SEC_CMODE_CBC && !req->c_req.encrypt) { in sec_process()
1751 memcpy(req->c_req.sk_req->iv, c_req->c_ivin, in sec_process()
1754 memcpy(req->aead_req.aead_req->iv, c_req->c_ivin, in sec_process()
1964 u32 cryptlen = sreq->c_req.sk_req->cryptlen; in sec_skcipher_cryptlen_ckeck()
2000 struct skcipher_request *sk_req = sreq->c_req.sk_req; in sec_skcipher_param_check()
2009 sreq->c_req.c_len = sk_req->cryptlen; in sec_skcipher_param_check()
2076 req->c_req.sk_req = sk_req; in sec_skcipher_crypto()
2077 req->c_req.encrypt = encrypt; in sec_skcipher_crypto()
2229 if (sreq->c_req.encrypt) in sec_aead_spec_check()
2230 sreq->c_req.c_len = req->cryptlen; in sec_aead_spec_check()
2232 sreq->c_req.c_len = req->cryptlen - authsize; in sec_aead_spec_check()
2234 if (unlikely(sreq->c_req.c_len & (AES_BLOCK_SIZE - 1))) { in sec_aead_spec_check()
2257 if (unlikely(!req->cryptlen || (!sreq->c_req.encrypt && in sec_aead_param_check()
2317 req->c_req.encrypt = encrypt; in sec_aead_crypto()