Summary
The documentation of mbedtls_sha3_finish() states that for SHA3-224/256/384/512,
the parameter olen must equal 28/32/48/64 respectively, otherwise the function
should return an error.
However, the current implementation only returns an error if olen is smaller
than the digest size. If olen is larger, it silently adjusts olen to the
digest size and continues, instead of returning an error.
This behavior is inconsistent with the header file description. Either the
documentation should be updated to reflect the actual behavior, or the
implementation should be fixed to match the documented contract.
System information
Mbed TLS version (3.6.5):
Summary
The documentation of mbedtls_sha3_finish() states that for SHA3-224/256/384/512,
the parameter
olenmust equal 28/32/48/64 respectively, otherwise the functionshould return an error.
However, the current implementation only returns an error if
olenis smallerthan the digest size. If
olenis larger, it silently adjustsolento thedigest size and continues, instead of returning an error.
This behavior is inconsistent with the header file description. Either the
documentation should be updated to reflect the actual behavior, or the
implementation should be fixed to match the documented contract.
System information
Mbed TLS version (3.6.5):