---
title: hmac_sha1_final
description: 用于完成hmac_sha1计算并生成160位消息摘要。
url: "https://www.hikunpeng.com/document/detail/zh/kunpengaccel/encryp-decryp/ug_kacc_crypto/kunpengaccel_kacccrypt_16_0013.html"
---

# hmac_sha1_final

用于完成hmac_sha1计算并生成160位消息摘要。

int hmac_sha1_final(sha1_hmac_ctx_t *ctx, uint8_t *digest);

#### 参数

| 参数名 | 描述 | 取值范围 | 输入/输出 |
| --- | --- | --- | --- |
| ctx | hmac\_sha1计算任务的上下文信息。 | 非空 | 输入 |
| digest | 用于保存hmac\_sha1的摘要。 | 非空 | 输出 |


#### 返回值

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