mbedtls_ecdsa_verify() function
This function verifies the ECDSA signature of a previously-hashed message. \see ecp.h
Arguments
grp
The ECP group to use. This must be initialized and have group parameters set, for example through mbedtls_ecp_group_load().
buf
The hashed content that was signed. This must be a readable buffer of length \p blen Bytes. It may be \c NULL if \p blen is zero.
blen
The length of \p buf in Bytes.
Q
The public key to use for verification. This must be initialized and setup.
r
The first integer of the signature. This must be initialized.
s
The second integer of the signature. This must be initialized.
Return value
\c 0 on success. #MBEDTLS_ERR_ECP_BAD_INPUT_DATA if the signature is invalid. An \c MBEDTLS_ERR_ECP_XXX or \c MBEDTLS_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.