This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] SA2UL SHA-AM243X:MCU-PLUS-SDK 使用情况和示例

Guru**** 2382480 points
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1335246/mcu-plus-sdk-am243x-sa2ul-sha-api-usage-and-examples

器件型号:MCU-PLUS-SDK

您好!

我正在查看用于 SHA 散列的 SA2UL API 的文档以及 SDK 中的示例、我不确定使用方法是否正确。 在此处的文档中:

AM243x MCU+ SDK:SA2UL (TI.com)

给出给 SA2UL_contextProcess 的输出缓冲区是生成的哈希算法的大小(例如512位或64字节)。 但是、在 SDK 中提供的示例中(例如 examples\security\crypto\sa2ul_sha\crypto_sha.c)、输出缓冲区与输入缓冲区大小相同、生成的哈希可在 gSa2ulCtxObj.computedHash 中找到。 预期行为是什么?

即使在计算 SHA 哈希值时未使用缓冲区、是否真的有必要包含与输入大小相同的缓冲区? 目前,这是我能够使它工作的唯一方式,但它是浪费在计算一个大缓冲区的散列,因为我必须为它分配两倍的空间。

谢谢!