Function esp_idf_svc::hal::sys::mbedtls_sha512

source ยท
pub unsafe extern "C" fn mbedtls_sha512(
    input: *const u8,
    ilen: usize,
    output: *mut u8,
    is384: i32,
) -> i32
Expand description

\brief This function calculates the SHA-512 or SHA-384 checksum of a buffer.

            The function allocates the context, performs the
            calculation, and frees the context.

            The SHA-512 result is calculated as
            output = SHA-512(input buffer).

\param input The buffer holding the input data. This must be a readable buffer of length \p ilen Bytes. \param ilen The length of the input data in Bytes. \param output The SHA-384 or SHA-512 checksum result. This must be a writable buffer of length \c 64 bytes for SHA-512, \c 48 bytes for SHA-384. \param is384 Determines which function to use. This must be either \c 0 for SHA-512, or \c 1 for SHA-384.

\note is384 must be defined accordingly with the supported symbols in the config file. If: - is384 is 0, but \c MBEDTLS_SHA384_C is not defined, or - is384 is 1, but \c MBEDTLS_SHA512_C is not defined then the function will return #MBEDTLS_ERR_SHA512_BAD_INPUT_DATA.

\return \c 0 on success. \return A negative error code on failure.