Lines Matching refs:c_req
120 if (req->c_req.encrypt) in sec_alloc_queue_id()
130 if (req->c_req.encrypt) in sec_free_queue_id()
897 struct sec_cipher_req *c_req = &req->c_req; in GEN_SEC_SETKEY_FUNC() local
909 copy_size = c_req->c_len; in GEN_SEC_SETKEY_FUNC()
917 if (!c_req->encrypt && ctx->alg_type == SEC_AEAD) { in GEN_SEC_SETKEY_FUNC()
925 c_req->c_out_dma = req->in_dma; in GEN_SEC_SETKEY_FUNC()
934 struct sec_cipher_req *c_req = &req->c_req; in sec_cipher_pbuf_unmap() local
940 copy_size = c_req->c_len + aead_req->assoclen; in sec_cipher_pbuf_unmap()
942 copy_size = c_req->c_len; in sec_cipher_pbuf_unmap()
973 struct sec_cipher_req *c_req = &req->c_req; in sec_cipher_map() local
981 c_req->c_ivin = res->pbuf + SEC_PBUF_IV_OFFSET; in sec_cipher_map()
982 c_req->c_ivin_dma = res->pbuf_dma + SEC_PBUF_IV_OFFSET; in sec_cipher_map()
994 c_req->c_ivin = res->c_ivin; in sec_cipher_map()
995 c_req->c_ivin_dma = res->c_ivin_dma; in sec_cipher_map()
1012 if (!c_req->encrypt && ctx->alg_type == SEC_AEAD) { in sec_cipher_map()
1021 c_req->c_out = req->in; in sec_cipher_map()
1022 c_req->c_out_dma = req->in_dma; in sec_cipher_map()
1024 c_req->c_out = hisi_acc_sg_buf_map_to_hw_sgl(dev, dst, in sec_cipher_map()
1027 &c_req->c_out_dma); in sec_cipher_map()
1029 if (IS_ERR(c_req->c_out)) { in sec_cipher_map()
1032 return PTR_ERR(c_req->c_out); in sec_cipher_map()
1042 struct sec_cipher_req *c_req = &req->c_req; in sec_cipher_unmap() local
1051 hisi_acc_sg_buf_unmap(dev, dst, c_req->c_out); in sec_cipher_unmap()
1057 struct skcipher_request *sq = req->c_req.sk_req; in sec_skcipher_sgl_map()
1064 struct skcipher_request *sq = req->c_req.sk_req; in sec_skcipher_sgl_unmap()
1270 struct skcipher_request *sk_req = req->c_req.sk_req; in sec_skcipher_copy_iv()
1271 struct sec_cipher_req *c_req = &req->c_req; in sec_skcipher_copy_iv() local
1273 memcpy(c_req->c_ivin, sk_req->iv, ctx->c_ctx.ivsize); in sec_skcipher_copy_iv()
1279 struct sec_cipher_req *c_req = &req->c_req; in sec_skcipher_bd_fill() local
1288 sec_sqe->type2.c_ivin_addr = cpu_to_le64(c_req->c_ivin_dma); in sec_skcipher_bd_fill()
1290 sec_sqe->type2.data_dst_addr = cpu_to_le64(c_req->c_out_dma); in sec_skcipher_bd_fill()
1299 if (c_req->encrypt) in sec_skcipher_bd_fill()
1316 if (req->in_dma != c_req->c_out_dma) in sec_skcipher_bd_fill()
1321 sec_sqe->type2.clen_ivhlen |= cpu_to_le32(c_req->c_len); in sec_skcipher_bd_fill()
1331 struct sec_cipher_req *c_req = &req->c_req; in sec_skcipher_bd_fill_v3() local
1338 sec_sqe3->no_scene.c_ivin_addr = cpu_to_le64(c_req->c_ivin_dma); in sec_skcipher_bd_fill_v3()
1340 sec_sqe3->data_dst_addr = cpu_to_le64(c_req->c_out_dma); in sec_skcipher_bd_fill_v3()
1347 if (c_req->encrypt) in sec_skcipher_bd_fill_v3()
1366 if (req->in_dma != c_req->c_out_dma) in sec_skcipher_bd_fill_v3()
1372 sec_sqe3->c_len_ivin |= cpu_to_le32(c_req->c_len); in sec_skcipher_bd_fill_v3()
1392 struct skcipher_request *sk_req = req->c_req.sk_req; in sec_update_iv()
1399 if (req->c_req.encrypt) in sec_update_iv()
1446 struct skcipher_request *sk_req = req->c_req.sk_req; in sec_skcipher_callback()
1455 ctx->c_ctx.c_mode == SEC_CMODE_CTR) && req->c_req.encrypt) in sec_skcipher_callback()
1463 backlog_sk_req = backlog_req->c_req.sk_req; in sec_skcipher_callback()
1474 struct sec_cipher_req *c_req = &req->c_req; in set_aead_auth_iv() local
1482 cl = c_req->c_ivin[0] + 1; in set_aead_auth_iv()
1483 c_req->c_ivin[ctx->c_ctx.ivsize - cl] = 0x00; in set_aead_auth_iv()
1484 memset(&c_req->c_ivin[ctx->c_ctx.ivsize - cl], 0, cl); in set_aead_auth_iv()
1485 c_req->c_ivin[ctx->c_ctx.ivsize - IV_LAST_BYTE1] = IV_CTR_INIT; in set_aead_auth_iv()
1488 flage |= c_req->c_ivin[0] & IV_CL_MASK; in set_aead_auth_iv()
1496 memcpy(a_req->a_ivin, c_req->c_ivin, ctx->c_ctx.ivsize); in set_aead_auth_iv()
1504 if (!c_req->encrypt) in set_aead_auth_iv()
1519 struct sec_cipher_req *c_req = &req->c_req; in sec_aead_set_iv() local
1522 memcpy(c_req->c_ivin, aead_req->iv, ctx->c_ctx.ivsize); in sec_aead_set_iv()
1537 memcpy(a_req->a_ivin, c_req->c_ivin, SEC_AIV_SIZE); in sec_aead_set_iv()
1596 struct sec_cipher_req *c_req = &req->c_req; in sec_auth_bd_fill_ex() local
1618 sec_sqe->type2.alen_ivllen = cpu_to_le32(c_req->c_len + aq->assoclen); in sec_auth_bd_fill_ex()
1639 sec_auth_bd_fill_xcm(auth_ctx, req->c_req.encrypt, req, sec_sqe); in sec_aead_bd_fill()
1641 sec_auth_bd_fill_ex(auth_ctx, req->c_req.encrypt, req, sec_sqe); in sec_aead_bd_fill()
1650 struct sec_cipher_req *c_req = &req->c_req; in sec_auth_bd_fill_ex_v3() local
1673 sqe3->a_len_key = cpu_to_le32(c_req->c_len + aq->assoclen); in sec_auth_bd_fill_ex_v3()
1694 sec_auth_bd_fill_xcm_v3(auth_ctx, req->c_req.encrypt, in sec_aead_bd_fill_v3()
1697 sec_auth_bd_fill_ex_v3(auth_ctx, req->c_req.encrypt, in sec_aead_bd_fill_v3()
1708 struct sec_cipher_req *c_req = &req->c_req; in sec_aead_callback() local
1715 if (!err && c->c_ctx.c_mode == SEC_CMODE_CBC && c_req->encrypt) in sec_aead_callback()
1719 if (!err && c_req->encrypt) { in sec_aead_callback()
1773 struct sec_cipher_req *c_req = &req->c_req; in sec_process() local
1785 if (!req->c_req.encrypt && (ctx->c_ctx.c_mode == SEC_CMODE_CBC || in sec_process()
1800 if (ctx->c_ctx.c_mode == SEC_CMODE_CBC && !req->c_req.encrypt) { in sec_process()
1802 memcpy(req->c_req.sk_req->iv, c_req->c_ivin, in sec_process()
1805 memcpy(req->aead_req.aead_req->iv, c_req->c_ivin, in sec_process()
2014 u32 cryptlen = sreq->c_req.sk_req->cryptlen; in sec_skcipher_cryptlen_check()
2050 struct skcipher_request *sk_req = sreq->c_req.sk_req; in sec_skcipher_param_check()
2059 sreq->c_req.c_len = sk_req->cryptlen; in sec_skcipher_param_check()
2125 req->c_req.sk_req = sk_req; in sec_skcipher_crypto()
2126 req->c_req.encrypt = encrypt; in sec_skcipher_crypto()
2294 if (sreq->c_req.encrypt) in sec_aead_spec_check()
2295 sreq->c_req.c_len = req->cryptlen; in sec_aead_spec_check()
2297 sreq->c_req.c_len = req->cryptlen - authsize; in sec_aead_spec_check()
2299 if (unlikely(sreq->c_req.c_len & (AES_BLOCK_SIZE - 1))) { in sec_aead_spec_check()
2322 if (unlikely(!req->cryptlen || (!sreq->c_req.encrypt && in sec_aead_param_check()
2391 req->c_req.encrypt = encrypt; in sec_aead_crypto()