GFpECSignSM2¶
Computes a digital signature over a message digest using the SM2 scheme.
Syntax¶
IppStatus ippsGFpECSignSM2(const IppsBigNumState* pMsgDigest, const IppsBigNumState* pRegPrivate, const IppsBigNumState* pEphPrivate, IppsBigNumState* pSignR, IppsBigNumState* pSignS, IppsGFpECState* pEC, Ipp8u* pScratchBuffer);
Include Files¶
ippcp.h
Parameters¶
pMsgDigest |
Pointer to the message digest |
pRegPrivate |
Pointer to the regular private key of the signer. |
pEphPrivate |
Pointer to the ephemeral private key of the signer. |
pSignR |
Pointer to the integer |
pSignS |
Pointer to the integer |
pEC |
Pointer to the context of the elliptic curve. |
pScratchBuffer |
Pointer to the scratch buffer. |
Description¶
The function computes two big numbers r
and s
that form the
digital signature over a message digest msg
.
The digital signature is computed using the SM2 scheme [SM2].
The regular private key regPrivKey
and the ephemeral private key
ephPrivKey
can be generated by the functions
GFpECPrivateKey and
GFpECPublicKey with
only the requirement that the key regPrivKey
be different from the
key ephPrivKey
.
The elliptic curve domain parameters must be hitherto defined by the functions: GFpECInitStd, GFpECInit, GFpECSet, or GFpECSetSubgroup.
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 any of the contexts pointed to by pMsgDigest, pRegPrivate, pEphPrivate, pSignR, pSignS, or pEC does not match the operation. |
ippStsMessageErr |
Indicates an error condition if the value of |
ippStsRangeErr |
Indicates an error condition if any of the parameters pointed to by pSignR or pSignS has a memory size that is smaller than the order |
ippStsIvalidPrivateKey |
Indicates an error condition in the following cases:
|
ippStsNotSupportedModeErr |
Indicates an error condition if the finite field GFp under the elliptic curve is not prime. |
ippStsEphemeralKeyErr |
Indicates an error condition if values of the ephemeral keys |