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.

MCU-PLUS-SDK-AM243X: SA2UL SHA API Usage and Examples

Part Number: MCU-PLUS-SDK-AM243X

Hello,

I am looking at the documentation for the usage of the SA2UL APIs for SHA hashing, as well as the examples in the SDK, and I am not sure of the correct usage. In the documentation here:

AM243x MCU+ SDK: SA2UL (ti.com)

The output buffer given to SA2UL_contextProcess is the size of the resulting hash (e.g. 512 bits or 64 bytes). However in the examples provided in the SDK (e.g. examples\security\crypto\sa2ul_sha\crypto_sha.c), the output buffer is the same size as the input buffer, and the resulting hash is found in gSa2ulCtxObj.computedHash. Which is the intended behavior?

Is it really necessary to include a buffer of the same size as the input even if it's not used when computing the SHA hash? Currently this is the only way I am able to get it to work, but it is wasteful when computing the hash of a large buffer as I have to allocate twice the space for it.

Thank you