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
- pMsgDigest
- Pointer to the message digestmsg.
- pRegPublic
- Pointer to the message sender's regular private keyregPubKey.
- pSignR
- Pointer to the integerrof the digital signature.
- pSignS
- Pointer to the integersof 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 isNULL.
- ippStsContextMatchErr
- Indicates an error condition if one of the specified contexts is not valid.
- ippStsMessageErr
- Indicates an error condition if the value ofmsgpointed bypMsgDigestfalls outside the range of [1,n-1] wherenis the order of the elliptic curve base pointG.
- ippStsRangeErr
- Indicates an error condition if the value ofpSignRorpSignSis less than 0.