GFpECEncryptSM2_Ext¶
The function encrypts the input text based on the SM2 protocol.
Syntax¶
IppStatus ippsGFpECEncryptSM2_Ext, (Ipp8u* pOut, int maxOutLen, int* pOutSize, const Ipp8u* pInp, int inpLen, const IppsGFpECPoint* pPublicKey, IppsGFpECPoint* pEhpPublicKey, IppsBigNumState* pEphPrvKey, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)
Include Files¶
ippcp.h
Parameters¶
pOut |
Pointer output cipher text. |
maxOutLen |
Available cipher-size container. |
pOutSize |
Size of the cipher text filled in the container
|
pInp |
Pointer message encrypt. |
inpLen |
Message size encrypt. |
pPublicKey |
Pointer to the self-public key of the elliptic curve. |
pEhpPublicKey |
Ephemeral pointer to the self-public key of the elliptic curve. |
pEphPrvKey |
Ephemeral Pointer to the private keys of the elliptic curve. |
pEC |
Pointer to the elliptic curve context. |
pScratchBuffer |
Pointer to the scratch buffer for the elliptic curve. |
Description¶
The function comes with the encrypted text according to the SM2 Encrypt protocol. This implementation is based on the [GM/T 0003.4-2012 SM2] standard.
Note
The ephemeral public(C1) and private(k) keys (steps A1-A2) have to be generated by the user’s application.
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 are NULL. |
ippStsContextMatchErr |
Indicates an error condition if the |
ippStsNotSupportedModeErr |
Indicates an error condition if the |
ippStsOutOfRangeErr |
Indicates an error condition if the invalid input argument range - inpLen < 0 or maxOutLen is not enough for the encryption. |
ippStsInvalidPrivateKey |
Indicates an error condition if the secret key is not within (0, order). |
ippStsInvalidPoint |
Indicates an error condition if the point of the elliptic curve does not belong to the elliptic curve. |