Home
last modified time | relevance | path

Searched refs:sqe (Results 1 – 10 of 10) sorted by relevance

/optee_os/core/drivers/crypto/hisilicon/
H A Dsec_pbkdf2.c15 struct hisi_sec_sqe *sqe = bd; in sec_pbkdf2_parse_sqe() local
18 done = SEC_GET_FIELD(sqe->type2.done_flag, SEC_DONE_MASK, 0); in sec_pbkdf2_parse_sqe()
19 if (done != SEC_HW_TASK_DONE || sqe->type2.error_type) { in sec_pbkdf2_parse_sqe()
21 done, sqe->type2.error_type); in sec_pbkdf2_parse_sqe()
31 struct hisi_sec_sqe *sqe = bd; in sec_pbkdf2_fill_sqe() local
33 sqe->type_auth_cipher = BD_TYPE2; in sec_pbkdf2_fill_sqe()
34 sqe->type_auth_cipher |= SHIFT_U32(AUTH_MAC_CALCULATE, SEC_AUTH_OFFSET); in sec_pbkdf2_fill_sqe()
35 sqe->sds_sa_type = SHIFT_U32(SCENE_PBKDF2, SEC_SCENE_OFFSET); in sec_pbkdf2_fill_sqe()
37 sqe->type2.mac_key_alg = SHIFT_U32(pbkdf2_msg->derive_type, in sec_pbkdf2_fill_sqe()
40 sqe->type2.mac_key_alg |= 0x1; in sec_pbkdf2_fill_sqe()
[all …]
H A Dsec_hash.c14 struct hisi_sec_sqe *sqe) in sec_digest_set_hmac_key() argument
22 sqe->type2.mac_key_alg |= SHIFT_U64(DIV_ROUND_UP(ctx->key_len, in sec_digest_set_hmac_key()
25 sqe->type2.a_key_addr = ctx->key_dma; in sec_digest_set_hmac_key()
31 struct hisi_sec_sqe *sqe) in sec_digest_fill_long_bd2() argument
37 sqe->ai_apd_cs |= AI_GEN_INNER; in sec_digest_fill_long_bd2()
38 sqe->ai_apd_cs |= SHIFT_U32(AUTHPAD_NOPAD, SEC_APAD_OFFSET); in sec_digest_fill_long_bd2()
42 sqe->ai_apd_cs |= AI_GEN_IVIN_ADDR; in sec_digest_fill_long_bd2()
43 sqe->ai_apd_cs |= SHIFT_U32(AUTHPAD_NOPAD, SEC_APAD_OFFSET); in sec_digest_fill_long_bd2()
44 sqe->type2.a_ivin_addr = sqe->type2.mac_addr; in sec_digest_fill_long_bd2()
48 sqe->ai_apd_cs |= AI_GEN_IVIN_ADDR; in sec_digest_fill_long_bd2()
[all …]
H A Dsec_authenc.c23 struct hisi_sec_sqe *sqe = bd; in sec_aead_bd_fill() local
27 sqe->type_auth_cipher = BD_TYPE2 | SHIFT_U32(NO_AUTH, SEC_AUTH_OFFSET); in sec_aead_bd_fill()
30 sqe->sds_sa_type = de | scene; in sec_aead_bd_fill()
31 sqe->type2.cipher_src_offset = ae_ctx->aad.length; in sec_aead_bd_fill()
32 sqe->type2.icvw_kmode = SHIFT_U32(ae_ctx->c_key_len, SEC_CKEY_OFFSET) | in sec_aead_bd_fill()
35 sqe->type2.clen_ivhlen = ae_ctx->payload_len; in sec_aead_bd_fill()
36 sqe->type2.alen_ivllen = ae_ctx->aad.length; in sec_aead_bd_fill()
37 sqe->type2.c_alg = ae_ctx->algo; in sec_aead_bd_fill()
40 sqe->type_auth_cipher |= SHIFT_U32(CIPHER_ENCRYPT, in sec_aead_bd_fill()
42 sqe->sds_sa_type |= SEC_CIPHER_THEN_DIGEST; in sec_aead_bd_fill()
[all …]
H A Dsec_cipher.c345 struct hisi_sec_sqe *sqe = bd; in sec_cipher_bd_fill() local
350 sqe->type_auth_cipher = BD_TYPE2; in sec_cipher_bd_fill()
353 sqe->sds_sa_type = de | scene; in sec_cipher_bd_fill()
354 sqe->type2.clen_ivhlen = c_ctx->len; in sec_cipher_bd_fill()
356 sqe->type2.c_alg = c_ctx->alg; in sec_cipher_bd_fill()
357 sqe->type2.icvw_kmode = SHIFT_U32(c_ctx->mode, SEC_CMODE_OFFSET) | in sec_cipher_bd_fill()
365 sqe->type_auth_cipher |= cipher; in sec_cipher_bd_fill()
367 sqe->type2.data_dst_addr = c_ctx->out_dma; in sec_cipher_bd_fill()
368 sqe->type2.data_src_addr = c_ctx->in_dma; in sec_cipher_bd_fill()
369 sqe->type2.c_key_addr = c_ctx->key_dma; in sec_cipher_bd_fill()
[all …]
H A Dhpre_dh.c68 struct hpre_sqe *sqe = bd; in hpre_dh_fill_sqe() local
70 sqe->w0 = msg->alg_type | SHIFT_U32(0x1, HPRE_DONE_SHIFT); in hpre_dh_fill_sqe()
71 sqe->task_len1 = TASK_LENGTH(msg->key_bytes); in hpre_dh_fill_sqe()
72 sqe->key = msg->x_p_dma; in hpre_dh_fill_sqe()
73 sqe->in = msg->g_dma; in hpre_dh_fill_sqe()
74 sqe->out = msg->out_dma; in hpre_dh_fill_sqe()
82 struct hpre_sqe *sqe = bd; in hpre_dh_parse_sqe() local
86 err = HPRE_TASK_ETYPE(sqe->w0); in hpre_dh_parse_sqe()
87 done = HPRE_TASK_DONE(sqe->w0); in hpre_dh_parse_sqe()
H A Dhpre_montgomery.c313 struct hpre_sqe *sqe = bd; in hpre_montgomery_fill_sqe() local
315 sqe->w0 = msg->alg_type | SHIFT_U32(0x1, HPRE_DONE_SHIFT); in hpre_montgomery_fill_sqe()
316 sqe->task_len1 = TASK_LENGTH(msg->key_bytes); in hpre_montgomery_fill_sqe()
317 sqe->key = msg->key_dma; in hpre_montgomery_fill_sqe()
318 sqe->in = msg->in_dma; in hpre_montgomery_fill_sqe()
319 sqe->out = msg->out_dma; in hpre_montgomery_fill_sqe()
327 struct hpre_sqe *sqe = bd; in hpre_montgomery_parse_sqe() local
333 err = HPRE_TASK_ETYPE(sqe->w0); in hpre_montgomery_parse_sqe()
334 err1 = HPRE_TASK_ETYPE1(sqe->w0); in hpre_montgomery_parse_sqe()
335 done = HPRE_TASK_DONE(sqe->w0); in hpre_montgomery_parse_sqe()
H A Dhisi_qm.c356 free(qp->sqe); in qp_free()
367 qp->sqe = memalign(HISI_QM_ALIGN128, sq_size); in qp_alloc()
368 if (!qp->sqe) { in qp_alloc()
372 qp->sqe_dma = virt_to_phys(qp->sqe); in qp_alloc()
386 free(qp->sqe); in qp_alloc()
787 void *sqe = NULL; in hisi_qp_send() local
799 sqe = (void *)((vaddr_t)qp->sqe + qm->sqe_size * qp->sq_tail); in hisi_qp_send()
800 memset(sqe, 0, qm->sqe_size); in hisi_qp_send()
802 ret = qp->fill_sqe(sqe, msg); in hisi_qp_send()
831 void *sqe = NULL; in hisi_qp_recv() local
[all …]
H A Dhisi_qm.h141 void *sqe; member
146 enum hisi_drv_status (*fill_sqe)(void *sqe, void *msg);
147 enum hisi_drv_status (*parse_sqe)(void *sqe, void *msg);
H A Dhpre_ecc.c437 struct hpre_sqe *sqe = (struct hpre_sqe *)bd; in hpre_ecc_fill_sqe() local
439 sqe->w0 = msg->alg_type | SHIFT_U32(0x1, HPRE_DONE_SHIFT); in hpre_ecc_fill_sqe()
440 sqe->task_len1 = TASK_LENGTH(msg->key_bytes); in hpre_ecc_fill_sqe()
441 sqe->ext1 = msg->sm2_sp << HPRE_SQE_BD_RSV2_SHIFT; in hpre_ecc_fill_sqe()
445 sqe->sm2enc_klen = msg->sm2_mlen - 1; in hpre_ecc_fill_sqe()
449 sqe->ext1 |= SHIFT_U32(0x1, HPRE_SQE_SM2_KSEL_SHIFT); in hpre_ecc_fill_sqe()
451 sqe->key = msg->key_dma; in hpre_ecc_fill_sqe()
452 sqe->in = msg->in_dma; in hpre_ecc_fill_sqe()
455 sqe->out = msg->out_dma; in hpre_ecc_fill_sqe()
505 struct hpre_sqe *sqe) in hpre_ecc_verify_get_result() argument
[all …]
H A Dhpre_rsa.c25 struct hpre_sqe *sqe) in hpre_rsa_fill_addr_params() argument
32 sqe->key = msg->prikey_dma; in hpre_rsa_fill_addr_params()
33 sqe->in = msg->in_dma; in hpre_rsa_fill_addr_params()
34 sqe->out = msg->out_dma; in hpre_rsa_fill_addr_params()
37 sqe->key = msg->pubkey_dma; in hpre_rsa_fill_addr_params()
38 sqe->in = msg->in_dma; in hpre_rsa_fill_addr_params()
39 sqe->out = msg->out_dma; in hpre_rsa_fill_addr_params()
51 struct hpre_sqe *sqe = bd; in hpre_rsa_fill_sqe() local
53 sqe->w0 = msg->alg_type | SHIFT_U32(0x1, HPRE_DONE_SHIFT); in hpre_rsa_fill_sqe()
54 sqe->task_len1 = TASK_LENGTH(msg->key_bytes); in hpre_rsa_fill_sqe()
[all …]