mbedtls_ecdsa_read_signature() function
This function reads and verifies an ECDSA signature. \see ecp.h
Arguments
ctx
The ECDSA context to use. This must be initialized and have a group and public key bound to it.
hash
The message hash that was signed. This must be a readable buffer of length \p size Bytes.
hlen
The size of the hash \p hash.
sig
The signature to read and verify. This must be a readable buffer of length \p slen Bytes.
slen
The size of \p sig in Bytes.
Return value
\c 0 on success. #MBEDTLS_ERR_ECP_BAD_INPUT_DATA if signature is invalid. #MBEDTLS_ERR_ECP_SIG_LEN_MISMATCH if there is a valid signature in \p sig, but its length is less than \p siglen. An \c MBEDTLS_ERR_ECP_XXX or \c MBEDTLS_ERR_MPI_XXX error code on failure for any other reason.
Notes
If the bitlength of the message hash is larger than the bitlength of the group order, then the hash is truncated as defined in Standards for Efficient Cryptography Group (SECG): SEC1 Elliptic Curve Cryptography, section 4.1.4, step 3.