.. _eccpverifysm2: ECCPVerifySM2 ============= Verifies authenticity of a digital signature over a message digest using the SM2 scheme. Syntax ------ IppStatus ippsECCPVerifySM2(const IppsBigNumState\* pMsgDigest, const IppsECCPPointState\* pRegPublic, const IppsBigNumState\* pSignR, const IppsBigNumState\* pSignS, IppECResult\* pResult, IppsECCPState\* pECC); Include Files ------------- ``ippcp.h`` Parameters ---------- .. list-table:: :header-rows: 0 * - pMsgDigest - Pointer to the message digest *msg*. * - pRegPublic - Pointer to the message sender's regular private key ``regPubKey``. * - pSignR - Pointer to the integer *r* of the digital signature. * - pSignS - Pointer to the integer *s* of the digital signature. * - pResult - Pointer to the digital signature verification result. * - pECC - Pointer to the context of the elliptic cryptosystem. Description ----------- The function verifies authenticity of the digital signature, represented as integer big numbers *r* and *s*, over a message digest *msg*. The digital signature over the message digest *msg* must be computed using the SM2 scheme [`SM2 `__] by to the `ECCPSignSM2 `__ function. The scheme requires the following cryptosystem key set up by the message sender: .. list-table:: :header-rows: 0 * - \ *regPubKey*\ - Message sender's regular private key. You can generate and set up the key in a call to the `ECCPGenKeyPair `__ function. The result of the digital signature verification can take one of these values: .. list-table:: :header-rows: 0 * - ippECValid - The digital signature is valid. * - ippECInvalidSignature - The digital signature is not valid. Before calling ECCPVerifySM2, set up the domain parameters of the elliptic curve in the \*pECC context by calling one of the functions: `ECCPSet `__ or `ECCPSetStdSM2 `__. Return Values ------------- .. list-table:: :header-rows: 0 * - ippStsNoErr - Indicates no error. Any other value indicates an error or warning. * - ippStsNullPtrErr - Indicates an error condition if any of the specified pointers is NULL. * - ippStsContextMatchErr - Indicates an error condition if one of the specified contexts is not valid. * - ippStsMessageErr - Indicates an error condition if the value of *msg* pointed by pMsgDigest falls outside the range of [1, *n*-1] where *n* is the order of the elliptic curve base point *G*. * - ippStsRangeErr - Indicates an error condition if the value of pSignR or pSignS is less than 0.