SM2是国家密码管理局于12月17日发布的椭圆曲线公钥密码算法 ,SM2采用的就是ECC 256位的一种
1. 签名验签
SSWINAPI SGD_UINT32 DEVAPI SKF_ECCSignData(
SGD_HDL hContainer,
SGD_UINT8 *pbDigest,
SGD_UINT32 ulDigestLen,
ECCSIGNATUREBLOB *pSignature);
SSWINAPI SGD_UINT32 DEVAPI SKF_ECCVerify(
SGD_HDL hDev,
ECCPUBLICKEYBLOB *pECCPubKeyBlob,
SGD_UINT8 *pbData,
SGD_UINT32 ulDataLen,
ECCSIGNATUREBLOB *pSignature);
2. 秘钥交换
SSWINAPI SGD_UINT32 DEVAPI SKF_GenerateAgreementDataWithECC(
SGD_HDL hContainer,
SGD_UINT32 ulAlgId,
ECCPUBLICKEYBLOB *pTempECCPubKeyBlob,
SGD_UINT8 *pbID,
SGD_UINT32 ulIDLen,
SGD_HDL *phAgreementHandle);
SSWINAPI SGD_UINT32 DEVAPI SKF_GenerateAgreementDataAndKeyWithECC(
SGD_HDL hContainer,
SGD_UINT32 ulAlgId,
ECCPUBLICKEYBLOB *pSponsorECCPubKeyBlob,
ECCPUBLICKEYBLOB *pSponsorTempECCPubKeyBlob,
ECCPUBLICKEYBLOB *pTempECCPubKeyBlob,
SGD_UINT8 *pbID,
SGD_UINT32 ulIDLen,
SGD_UINT8 *pbSponsorID,
SGD_UINT32 ulSponsorIDLen,
SGD_HDL *phKeyHandle);
SSWINAPI SGD_UINT32 DEVAPI SKF_GenerateKeyWithECC(
SGD_HDL hAgreementHandle,
ECCPUBLICKEYBLOB *pECCPubKeyBlob,
ECCPUBLICKEYBLOB *pTempECCPubKeyBlob,
SGD_UINT8 *pbID,
SGD_UINT32 ulIDLen,
SGD_HDL *phKeyHandle);
3. 加密解密
SSWINAPI SGD_UINT32 DEVAPI SKF_ExtECCEncrypt(
SGD_HDL hDev,
ECCPUBLICKEYBLOB *pECCPubKeyBlob,
SGD_UINT8 *pbPlainText,
SGD_UINT32 ulPlainTextLen,
ECCCIPHERBLOB *pCipherText);
SSWINAPI SGD_UINT32 DEVAPI SKF_ECCDecrypt(
SGD_HDL hContainer,
ECCCIPHERBLOB *pCipherBlob,
SGD_UINT8 *pbPlainText,
SGD_UINT32 *pulPlainTextLen);
如果觉得《Sm2记录介绍》对你有帮助,请点赞、收藏,并留下你的观点哦!