GFpECESSetKey_SM2
GFpECESSetKey_SM2
Computes a shared secret.
Syntax
IppStatus ippsGFpECESSetKey_SM2(const IppsBigNumState*
pPrivate
, const IppsGFpECPoint*
pPublic
, IppsECES_StateSM2*
pState
, IppsGFpECState*
pEC
, Ipps8u*
pEcScratchBuffer
);
Include Files
ippcp.h
Parameters
- pEC
- Pointer to the elliptic curve context used in the ECES.
- pState
- Pointer to the buffer being initialized as the ECES context.
- pPrivate
- Pointer to the own private keys of the elliptic curve.
- pPublic
- Pointer to the patry public key of the elliptic curve.
- pEcScratchBuffer
- Pointer to the scratch buffer for the elliptic curve.
Description
The function computes a shared secret = [
Z
Private
]* Public
for future use.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 theIppsGFpECState,IppsECES_StateSM2,IppsBigNumState, orIppsGFpECPointcontext parameter does not match the operation.
- ippStsOutOfRangeErr
- Indicates an error conditions in the following cases:
- Any of the specified pointers does not belong to the finite field over that the elliptic curve is initialized.
- The scalar values does not belong to the finite field over that the elliptic curve is initialized.
- ippStsNotSupportedModeErr
- Indicates an error condition if theIppsGFpECStatecontext parameter defines an elliptic curve over an extension of the prime finite field.
- ippStsBadArgErr
- Indicates an error condition if theIppsGFpECStatecontext parameter has an element size that differs from the one used in the ippsGFpECESInit_SM2 function call.
- ippStsPointAtInfinity
- Indicates an error condition if theIppsGFpECPointcontext parameter defines a point at infinity.