Skip to content

Commit

Permalink
uadk/digest: modify spelling errors
Browse files Browse the repository at this point in the history
Modify spelling errors related to digest stream mode.

Signed-off-by: Zhiqi Song <[email protected]>
  • Loading branch information
Zhiqi Song authored and Liulongfang committed Mar 19, 2024
1 parent 1839b89 commit f7d1cbe
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 16 deletions.
8 changes: 4 additions & 4 deletions drv/hisi_sec.c
Original file line number Diff line number Diff line change
Expand Up @@ -1553,7 +1553,7 @@ static int fill_digest_long_hash(handle_t h_qp, struct wd_digest_msg *msg,
if (ret)
return ret;

if (block_type == HASH_FRIST_BLOCK) {
if (block_type == HASH_FIRST_BLOCK) {
/* Long hash first */
sqe->ai_apd_cs = AI_GEN_INNER;
sqe->ai_apd_cs |= AUTHPAD_NOPAD << AUTHPAD_OFFSET;
Expand Down Expand Up @@ -1635,7 +1635,7 @@ static int digest_bd2_type_check(struct wd_digest_msg *msg)
enum hash_block_type type = get_hash_block_type(msg);

/* Long hash first and middle bd */
if (type == HASH_FRIST_BLOCK || type == HASH_MIDDLE_BLOCK) {
if (type == HASH_FIRST_BLOCK || type == HASH_MIDDLE_BLOCK) {
WD_ERR("hardware v2 not supports 0 size in long hash!\n");
return -WD_EINVAL;
}
Expand All @@ -1653,7 +1653,7 @@ static int digest_bd3_type_check(struct wd_digest_msg *msg)
{
enum hash_block_type type = get_hash_block_type(msg);
/* Long hash first and middle bd */
if (type == HASH_FRIST_BLOCK || type == HASH_MIDDLE_BLOCK) {
if (type == HASH_FIRST_BLOCK || type == HASH_MIDDLE_BLOCK) {
WD_ERR("invalid: hardware v3 not supports 0 size in long hash!\n");
return -WD_EINVAL;
}
Expand Down Expand Up @@ -1906,7 +1906,7 @@ static int fill_digest_long_hash3(handle_t h_qp, struct wd_digest_msg *msg,
if (ret)
return ret;

if (block_type == HASH_FRIST_BLOCK) {
if (block_type == HASH_FIRST_BLOCK) {
/* Long hash first */
sqe->auth_mac_key |= AI_GEN_INNER << SEC_AI_GEN_OFFSET_V3;
sqe->stream_scene.stream_auth_pad = AUTHPAD_NOPAD;
Expand Down
4 changes: 2 additions & 2 deletions drv/isa_ce_sm3.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ static int do_sm3_ce(struct wd_digest_msg *msg, __u8 *out_digest)
sm3_ce_update(&sctx, data, data_len, sm3_ce_block_compress);
sm3_ce_final(&sctx, out_digest, sm3_ce_block_compress);
break;
case HASH_FRIST_BLOCK:
case HASH_FIRST_BLOCK:
sm3_ce_init(&sctx);
sm3_ce_update(&sctx, data, data_len, sm3_ce_block_compress);
trans_output_result(out_digest, sctx.word_reg);
Expand Down Expand Up @@ -305,7 +305,7 @@ static int do_hmac_sm3_ce(struct wd_digest_msg *msg, __u8 *out_hmac)
sm3_ce_hmac_update(&hctx, data, data_len);
sm3_ce_hmac_final(&hctx, out_hmac);
break;
case HASH_FRIST_BLOCK:
case HASH_FIRST_BLOCK:
sm3_ce_hmac_init(&hctx, key, key_len);
sm3_ce_hmac_update(&hctx, data, data_len);
trans_output_result(out_hmac, hctx.sctx.word_reg);
Expand Down
6 changes: 3 additions & 3 deletions include/drv/wd_digest_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ extern "C" {
#endif

enum hash_block_type {
HASH_FRIST_BLOCK,
HASH_FIRST_BLOCK,
HASH_MIDDLE_BLOCK,
HASH_END_BLOCK,
HASH_SINGLE_BLOCK,
Expand Down Expand Up @@ -65,13 +65,13 @@ static inline enum hash_block_type get_hash_block_type(struct wd_digest_msg *msg
{
/*
* [has_next , iv_bytes]
* [ 1 , 0 ] = long hash(frist bd)
* [ 1 , 0 ] = long hash(first bd)
* [ 1 , 1 ] = long hash(middle bd)
* [ 0 , 1 ] = long hash(end bd)
* [ 0 , 0 ] = block hash(single bd)
*/
if (msg->has_next && !msg->iv_bytes)
return HASH_FRIST_BLOCK;
return HASH_FIRST_BLOCK;
else if (msg->has_next && msg->iv_bytes)
return HASH_MIDDLE_BLOCK;
else if (!msg->has_next && msg->iv_bytes)
Expand Down
5 changes: 2 additions & 3 deletions v1/test/hisi_sec_test/test_hisi_sec.c
Original file line number Diff line number Diff line change
Expand Up @@ -1462,7 +1462,7 @@ static int sec_cipher_async_test(int thread_num, __u64 lcore_mask,
SEC_TST_PRT("%s(): create pool fail!\n", __func__);
return -ENOMEM;
}
/* frist create the async poll thread! */
/* first create the async poll thread! */
test_thrds_data[0].pool = pool;
test_thrds_data[0].q = &q;
test_thrds_data[0].thread_num = 1;
Expand Down Expand Up @@ -2069,7 +2069,7 @@ static int sec_aead_async_test(int thd_num, __u64 lcore_mask,
SEC_TST_PRT("%s(): create pool fail!\n", __func__);
return -ENOMEM;
}
/* frist create the async poll thread! */
/* first create the async poll thread! */
test_thrds_data[0].pool = pool;
test_thrds_data[0].q = &q;
test_thrds_data[0].thread_num = 1;
Expand All @@ -2082,7 +2082,6 @@ static int sec_aead_async_test(int thd_num, __u64 lcore_mask,
return ret;
}

//Ïß³ÌÊý Óë°óºË
if (_get_one_bits(lcore_mask) == 0 &&
_get_one_bits(hcore_mask) == 0)
cnt = thd_num;
Expand Down
5 changes: 2 additions & 3 deletions v1/test/hisi_sec_test_sgl/test_hisi_sec_sgl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1733,7 +1733,7 @@ static int sec_cipher_async_test(int thread_num, __u64 lcore_mask,
SEC_TST_PRT("%s(): create pool fail!\n", __func__);
return -ENOMEM;
}
/* frist create the async poll thread! */
/* first create the async poll thread! */
test_thrds_data[0].pool = pool;
test_thrds_data[0].q = &q;
test_thrds_data[0].thread_num = 1;
Expand Down Expand Up @@ -2640,7 +2640,7 @@ static int sec_aead_async_test(int thd_num, __u64 lcore_mask,
return -ENOMEM;
}

/* frist create the async poll thread! */
/* first create the async poll thread! */
test_thrds_data[0].pool = pool;
test_thrds_data[0].q = &q;
test_thrds_data[0].thread_num = 1;
Expand All @@ -2654,7 +2654,6 @@ static int sec_aead_async_test(int thd_num, __u64 lcore_mask,
return ret;
}

//Ïß³ÌÊý Óë°óºË
if (_get_one_bits(lcore_mask) == 0 &&
_get_one_bits(hcore_mask) == 0)
cnt = thd_num;
Expand Down
2 changes: 1 addition & 1 deletion wd_digest.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ struct wd_digest_stream_data {
/* Total data length for stream mode */
__u64 long_data_len;
/*
* Notify the stream message state, zero is frist message,
* Notify the stream message state, zero is first message,
* non-zero is middle or final message.
*/
int msg_state;
Expand Down

0 comments on commit f7d1cbe

Please sign in to comment.