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¶
pMsgDigest |
Pointer to the message digest msg. |
pRegPublic |
Pointer to the message sender’s regular private key |
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:
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:
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¶
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. |