mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-03 03:31:41 +03:00
docs: Update CN translation for hmac.rst
This commit is contained in:
@@ -71,7 +71,7 @@ Key purpose value: 8
|
||||
|
||||
In this case, the HMAC is given out to the software, e.g., to authenticate a message.
|
||||
|
||||
The API to calculate the HMAC is :cpp:func:`psa_mac_compute` with an opaque PSA key with the eFuse key block ID which contains the secret and has the efuse key purpose set to Upstream mode.
|
||||
The API to calculate the HMAC is :cpp:func:`psa_mac_compute`, which takes an opaque PSA key referencing an eFuse key block that contains the secret and has its purpose set to Upstream mode.
|
||||
|
||||
HMAC for Digital Signature
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
@@ -160,7 +160,7 @@ We use ``esp_efuse_write_key`` to set physical key block 4 in the eFuse for the
|
||||
// writing key failed, maybe written already
|
||||
}
|
||||
|
||||
Now we can use the saved key to calculate an HMAC for software usage using the PSA Crypto API.
|
||||
Now we can calculate an HMAC for software usage with the saved key through the PSA Crypto API.
|
||||
|
||||
.. code-block:: c
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@ HMAC 支持软件使用
|
||||
|
||||
在此情况下,HMAC 支持软件使用,如验证消息真实性等。
|
||||
|
||||
API :cpp:func:`psa_mac_compute` 用于计算 HMAC。输入参数包括消息、消息长度以及包含密钥的 eFuse 密钥块 ID,且该密钥块的 eFuse 密钥功能设置为上行模式。
|
||||
:cpp:func:`psa_mac_compute` 用于计算 HMAC,该函数接收一个不透明的 PSA 密钥,该密钥引用了包含密钥机密的 eFuse 密钥块,并且该密钥块的用途被设置为上行模式。
|
||||
|
||||
HMAC 用作数字签名 (DS) 的密钥
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
@@ -160,7 +160,7 @@ HMAC 的第三种应用场景是将其作为密钥,启用软禁用的 JTAG 接
|
||||
// 密钥写入失败,可能已写入过
|
||||
}
|
||||
|
||||
接下来可以使用已存储的密钥来计算 HMAC,供软件使用。
|
||||
接下来可以通过 PSA Crypto API,使用已存储的密钥来计算供软件使用的 HMAC。
|
||||
|
||||
.. code-block:: c
|
||||
|
||||
|
||||
Reference in New Issue
Block a user