---
title: hmac_sha1_update
description: "处理输入数据块，更新hmac_sha1上下文状态。"
url: https://www.hikunpeng.com/document/detail/zh/kunpengaccel/encryp-decryp/ug_kacc_crypto/kunpengaccel_kacccrypt_16_0010.html
sourcePath: /source/zh/kunpengaccel/encryp-decryp/ug_kacc_crypto/kunpengaccel_kacccrypt_16_0010.html
indexId: 1211b748628d9676d79ca9e1f200df5474e366369a61b780651c2a380e46b3a288
---
# hmac_sha1_update

处理输入数据块，更新hmac_sha1上下文状态。

int hmac_sha1_update(sha1_hmac_ctx_t *ctx, uint8_t *data, uint64_t len);

#### 参数

| 参数名 | 描述 | 取值范围 | 输入/输出 |
| --- | --- | --- | --- |
| ctx | hmac\_sha1上下文结构体。 | 非空 | 输入/输出 |
| data | 用于计算任务的数据。 | 非空 | 输入 |
| len | 数据data的大小。 | >0 | 输入 |


#### 返回值

- 成功：返回值为0。
- 失败：返回值为-1。
