lhsm

package
v0.0.0-...-a580c1e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 11, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const SM3_BLOCK_SIZE int = 64
View Source
const SM3_DIGEST_LENGTH int = 32
View Source
const SM3_HMAC_SIZE int = SM3_DIGEST_LENGTH

Variables

This section is empty.

Functions

func ConvertSMCipherModeToC

func ConvertSMCipherModeToC(mode SM2CipherMode) C.SM2CipherMode

func ConvertSMSignModeToC

func ConvertSMSignModeToC(mode SM2SignMode) C.SM2SignMode

func GenerateKeyPair

func GenerateKeyPair(ctx *SM2_ctx_t, outPriKey []byte, outPubKey []byte) int

*

*@brief生成公私钥对
*@param ctx 函数入参 - 上下文
*@param outPriKey 函数出参 - 私钥,私钥实际上为256bit的大整数,这里输出的为256bit二进制内容Hex后的ASCII编码的可见字符串,长度为64字节,为保证字符串的结束符0,
*outPubKey至少需分配65字节空间。
*@param outPubKey 函数出参 - 公钥,公钥格式为04 | X | Y,其中X和Y为256bit大整数,这里输出的为04 | X | Y的二进制内容Hex后的ASCII编码的可见字符串,
*长度为130字节,为保证字符串的结束符0,outPubKey至少需分配131字节空间。
*@return  0表示成功,其他值为错误码

func GeneratePrivateKey

func GeneratePrivateKey(ctx *SM2_ctx_t, out []byte) int

*

*@brief 生成私钥
*@param ctx  函数入参 - 上下文
*@param out  函数出参 - 私钥,私钥实际上为256bit的大整数,这里输出的为256bit二进制内容Hex后的ASCII编码的可见字符串,长度为64字节,为保证字符串的结束符0,out至少需分配65字节空间。
*@return  0表示成功,其他值为错误码

func GeneratePublicKey

func GeneratePublicKey(ctx *SM2_ctx_t, privateKey []byte, outPubKey []byte) int

*

*@brief根据私钥生成对应公钥,
*@param ctx 函数入参 - 上下文
*@param privateKey 函数入参 - 私钥,私钥实际上为256bit的大整数,这里输出的为256bit二进制内容Hex后的ASCII编码的可见字符串,长度为64字节
*@param outPubKey 函数出参 - 公钥,公钥格式为04 | X | Y,其中X和Y为256bit大整数,这里输出的为04 | X | Y的二进制内容Hex后的ASCII编码
*                 的可见字符串,长度为130字节,为保证字符串的结束符0,outPubKey至少需分配131字节空间。
*@return  0表示成功,其他值为错误码

func GenerateSM4Key

func GenerateSM4Key(outkey []byte)

*

*@brief 生成16字节128bit的SM4 Key,也可调用该接口生成SM4 CBC模式的初始化向量iv,iv长度和key长度一致
*@param outKey  函数出参 - 16字节密钥。

func SM2CtxSize

func SM2CtxSize() int

*

*@brief SM2上下文结构体的大小

func SM2Decrypt

func SM2Decrypt(ctx *SM2_ctx_t, in []byte, inlen int, strPriKey []byte, prikeyLen int, out []byte, outlen *int) int

*

*@briefSM2非对称加解密算法,解密
*@param ctx  函数入参 - 上下文
*@param in  函数入参 - 待解密密文
*@param inlen  函数入参 - 密文长度(字节单位)
*@param strPriKey  函数入参 - 私钥
*@param prikeyLen  函数入参 - 私钥长度
*@param out  函数出参 - 明文
*@param outlen  函数出参 - 明文长度
*@return  0表示成功,其他值为错误码

func SM2DecryptWithMode

func SM2DecryptWithMode(ctx *SM2_ctx_t, in []byte, inlen int, strPriKey []byte,
	prikeyLen int, out []byte, outlen *int, mode SM2CipherMode) int

*

*@brief SM2非对称加解密算法,解密的兼容接口
*@param ctx 函数入参 - 上下文
*@param in  函数入参 - 待解密密文
*@param inlen  函数入参 - 密文长度(字节单位)
*@param strPriKey  函数入参 - 私钥
*@param prikeyLen  函数入参 - 私钥长度
*@param out  函数出参 - 明文
*@param outlen  函数出参 - 明文长度
*@param mode  密文格式
*@return  0表示成功,其他值为错误码

func SM2Encrypt

func SM2Encrypt(ctx *SM2_ctx_t, in []byte, inlen int, strPubKey []byte, pubkeyLen int, out []byte, outlen *int) int

*

*@briefSM2非对称加解密算法,加密
*@param ctx 函数入参 - 上下文
*@param in  函数入参 - 待加密消息
*@param inlen  函数入参 - 消息长度(字节单位)
*@param strPubKey  函数入参 - 公钥
*@param pubkeyLen  函数入参 - 公钥长度
*@param out  函数出参 - 密文
*@param outlen  函数出参 - 密文长度
*@return  0表示成功,其他值为错误码

func SM2EncryptWithMode

func SM2EncryptWithMode(ctx *SM2_ctx_t, in []byte, inlen int, strPubKey []byte,
	pubkeyLen int, out []byte, outlen *int, mode SM2CipherMode) int

*

*@brief SM2非对称加解密算法,加密的兼容接口
*@param ctx 函数入参 - 上下文
*@param in 函数入参 - 待加密消息
*@param inlen 函数入参 - 消息长度(字节单位)
*@param strPubKey 函数入参 - 公钥
*@param pubkeyLen 函数入参 - 公钥长度
*@param out 函数出参 - 密文
*@param outlen 函数出参 - 密文长度
*@param mode 密文输出格式
*@return  0表示成功,其他值为错误码

func SM2FreeCtx

func SM2FreeCtx(ctx *SM2_ctx_t)

*

*@brief 使用完SM2算法后,必须调用free函数释放
*@param ctx  函数入参 - 上下文

func SM2InitCtx

func SM2InitCtx(ctx *SM2_ctx_t)

*

*@brief 使用SM2获取公私钥或加解密之前,必须调用SM2InitCtx或者SM2InitCtxWithPubKey函数
*@param ctx  函数出参 - 上下文

func SM2InitCtxWithPubKey

func SM2InitCtxWithPubKey(ctx *SM2_ctx_t, pubkey []byte)

*

  • @brief 使用SM2获取公私钥或加解密之前,必须调用SM2InitCtx或者SM2InitCtxWithPubKey函数.如果使用固定公钥加密,可调用SM2InitCtxWithPubKey,将获得较大性能提升
  • @param ctx 函数出参 - 上下文
  • @param pubkey 函数入参 - 公钥

func SM2Sign

func SM2Sign(ctx *SM2_ctx_t, msg []byte, msglen int, id []byte, idlen int, strPubKey []byte,
	pubkeyLen int, strPriKey []byte, prikeyLen int, sig []byte, siglen *int) int

*

*@briefSM2签名验签算法,签名
*@param ctx 函数入参 - 上下文
*@param msg 函数入参 - 待签名消息
*@param msglen 函数入参 - 待签名消息长度
*@param id 函数入参 - 用户ID(作用是加入到签名hash中,对于传入值无特殊要求)
*@param idlen 函数入参 - 用户ID长度
*@param strPubKey 函数入参 - 公钥(作用是加入到签名hash中)
*@param pubkeyLen 函数入参 - 公钥长度
*@param strPriKey 函数入参 - 私钥
*@param prikeyLen 函数入参 - 私钥长度
*@param sig 函数出参 - 签名结果
*@param siglen 函数出参 - 签名结果长度

func SM2SignWithMode

func SM2SignWithMode(ctx *SM2_ctx_t, msg []byte, msglen int, id []byte,
	idlen int, strPubKey []byte, pubkeyLen int, strPriKey []byte,
	prikeyLen int, sig []byte, siglen *int, signMode SM2SignMode) int

*

*@brief SM2签名验签算法,签名的兼容接口
*@param ctx 函数入参 - 上下文
*@param msg 函数入参 - 待签名消息
*@param msglen 函数入参 - 待签名消息长度
*@param id 函数入参 - 用户ID(作用是加入到签名hash中,对于传入值无特殊要求)
*@param idlen 函数入参 - 用户ID长度
*@param strPubKey 函数入参 - 公钥(作用是加入到签名hash中)
*@param pubkeyLen 函数入参 - 公钥长度
*@param strPriKey 函数入参 - 私钥
*@param prikeyLen 函数入参 - 私钥长度
*@param sig 函数出参 - 签名结果
*@param siglen 函数出参 - 签名结果长度
*@param mode 签名格式

func SM2Verify

func SM2Verify(ctx *SM2_ctx_t, msg []byte, msglen int, id []byte, idlen int, sig []byte,
	siglen int, strPubKey []byte, pubkeyLen int) int

*

*@briefSM2签名验签算法,验签
*@param ctx 函数入参 - 上下文
*@param msg 函数入参 - 待验签内容
*@param msglen 函数入参 - 待验签内容长度
*@param id 函数入参 - 用户ID
*@param idlen 函数入参 - 用户ID长度
*@param sig 函数入参 - 签名结果
*@param siglen 函数入参 - 签名结果长度
*@param strPubKey 函数入参 - 公钥
*@param pubkeyLen 函数入参 - 公钥长度
*@return 0表示成功,其他值为错误码

func SM2VerifyWithMode

func SM2VerifyWithMode(ctx *SM2_ctx_t, msg []byte, msglen int, id []byte, idlen int,
	sig []byte, siglen int, strPubKey []byte, pubkeyLen int, signMode SM2SignMode) int

*

*@brief SM2签名验签算法,验签的兼容接口
*@param ctx 函数入参 - 上下文
*@param msg 函数入参 - 待验签内容
*@param msglen 函数入参 - 待验签内容长度
*@param id 函数入参 - 用户ID
*@param idlen 函数入参 - 用户ID长度
*@param sig 函数入参 - 签名结果
*@param siglen 函数入参 - 签名结果长度
*@param strPubKey 函数入参 - 公钥
*@param pubkeyLen 函数入参 - 公钥长度
*@param mode 签名格式
*@return 0表示成功,其他值为错误码

func SM3

func SM3(data []byte, datalen int, digest []byte)

*

*@brief SM3 hash算法, 内部依次调用了init update和final三个接口

func SM3CtxSize

func SM3CtxSize() int

*

*@brief SM3上下文结构体的大小

func SM3Final

func SM3Final(ctx *SM3_ctx_t, digest []byte)

func SM3HmacFinal

func SM3HmacFinal(ctx *HmacSm3Ctx, mac []byte, macLen int) int

*

  • @brief 基于sm3算法计算HMAC值 最终计算HMAC值
  • @param ctx hmac上下文结构指针
  • @param mac 输出的HMAC字节码
  • @return 0 -- OK

func SM3HmacUpdate

func SM3HmacUpdate(ctx *HmacSm3Ctx, data []byte, dataLen int) int

*

  • @brief 基于sm3算法计算HMAC值 update数据
  • @param ctx hmac上下文结构指针
  • @param data 做HMAC计算的数据
  • @param data_len 数据长度
  • @return 0 -- OK

func SM3Init

func SM3Init(ctx *SM3_ctx_t)

func SM3Update

func SM3Update(ctx *SM3_ctx_t, data []byte, datalen int)

func SM3_HMAC

func SM3_HMAC(ctx *HmacSm3Ctx, data []byte, dataLen int, key []byte, keyLen int, mac []byte, macLen int) int

*

  • @brief 基于sm3算法计算HMAC值
  • @param data 做HMAC计算的数据
  • @param data_len 数据长度
  • @param key HMAC用的秘钥
  • @param key_len 秘钥长度
  • @param mac 输出的HMAC字节码
  • @return 0 -- OK

func SM4_CBC_Decrypt

func SM4_CBC_Decrypt(in []byte, inlen int, out []byte, outlen *int, key []byte, iv []byte)

func SM4_CBC_Decrypt_NoPadding

func SM4_CBC_Decrypt_NoPadding(in []byte, inlen int, out []byte, outlen *int, key []byte, iv []byte)

*

*@brief SM4 CBC模式对称解密,无填充。请保证密文为16字节整数倍,否则解密会失败,即出参outlen为0
*@param in  函数入参 - 密文
*@param inlen  函数入参 - 密文长度
*@param out  函数出参 - 明文
*@param outlen  函数出参 - 明文长度
*@param key  函数入参 - 秘钥(128bit)
*@param iv  函数入参 - 初始化向量

func SM4_CBC_Encrypt

func SM4_CBC_Encrypt(in []byte, inlen int, out []byte, outlen *int, key []byte, iv []byte)

*

*@brief SM4 CBC模式对称加解密。加密,使用PKCS#7填充标准
*@param in  函数入参 - 明文
*@param inlen  函数入参 - 明文长度
*@param out  函数出参 - 密文
*@param outlen  函数出参 - 密文长度
*@param key  函数入参 - 秘钥(128bit)
*@param iv  函数入参 - 初始化向量

func SM4_CBC_Encrypt_NoPadding

func SM4_CBC_Encrypt_NoPadding(in []byte, inlen int, out []byte, outlen *int, key []byte, iv []byte)

*

*@brief SM4 CBC模式对称加解密。加密,无填充。请保证明文为16字节整数倍,否则加密会失败,即出参outlen为0
*@param in 函数入参 - 明文
*@param inlen 函数入参 - 明文长度
*@param out 函数出参 - 密文
*@param outlen 函数出参 - 密文长度
*@param key 函数入参 - 秘钥(128bit)
*@param iv 函数入参 - 初始化向量

func SM4_ECB_Decrypt

func SM4_ECB_Decrypt(in []byte, inlen int, out []byte, outlen *int, key []byte)

*

*@brief SM4 ECB模式对称加解密。解密
*@param in  函数入参 - 密文
*@param inlen  函数入参 - 密文长度
*@param out  函数出参 - 明文
*@param outlen  函数出参 - 明文长度
*@param key  函数入参 - 秘钥(128bit)

func SM4_ECB_Decrypt_NoPadding

func SM4_ECB_Decrypt_NoPadding(in []byte, inlen int, out []byte, outlen *int, key []byte)

*

*@brief SM4 ECB模式对称解密,无填充。请保证密文为16字节整数倍,否则解密会失败,即出参outlen为0
*@param in  函数入参 - 密文
*@param inlen  函数入参 - 密文长度
*@param out  函数出参 - 明文
*@param outlen  函数出参 - 明文长度
*@param key  函数入参 - 秘钥(128bit)

func SM4_ECB_Encrypt

func SM4_ECB_Encrypt(in []byte, inlen int, out []byte, outlen *int, key []byte)

*

*@brief SM4 ECB模式对称加解密。加密
*@param in  函数入参 - 明文
*@param inlen  函数入参 - 明文长度
*@param out  函数出参 - 密文
*@param outlen  函数出参 - 密文长度
*@param key  函数入参 - 秘钥(128bit)

func SM4_ECB_Encrypt_NoPadding

func SM4_ECB_Encrypt_NoPadding(in []byte, inlen int, out []byte, outlen *int, key []byte)

*

*@brief SM4 ECB模式对称加密,无填充。请保证明文为16字节整数倍,否则加密会失败,即出参outlen为0
*@param in  函数入参 - 明文
*@param inlen  函数入参 - 明文长度
*@param out  函数出参 - 密文
*@param outlen  函数出参 - 密文长度
*@param key  函数入参 - 秘钥(128bit)

func SM4_GCM_Decrypt

func SM4_GCM_Decrypt(in []byte, inlen int, out []byte, outlen *int, tag []byte,
	taglen int, key []byte, iv []byte, aad []byte, aadlen int) int

*

*@brief SM4 GCM模式对称加解密。解密,使用PKCS7填充,实际上GCM模式可不填充。
*@param in  函数入参 - 密文
*@param inlen  函数入参 - 密文长度
*@param out  函数出参 - 明文
*@param outlen  函数出参 - 明文长度
*@param tag  函数入参 - GMAC值,即消息验证码
*@param taglen  函数入参 - GMAC长度,通常取16字节
*@param key  函数入参 - 秘钥(128bit)
*@param iv  函数入参 - 初始化向量
*@param aad  函数入参 - 附加验证消息
*@param aadlen  函数入参 - 附加验证消息长度
*@return 成功为0,GCM的解密失败主要是tag校验失败

func SM4_GCM_Decrypt_NIST_SP800_38D

func SM4_GCM_Decrypt_NIST_SP800_38D(in []byte, inlen int, out []byte, outlen *int,
	tag []byte, taglen int, key []byte, iv []byte, ivlen int, aad []byte, aadlen int) int

*

*@brief SM4 GCM模式对称加解密。解密,使用PKCS7填充,实际上GCM模式可不填充。
*@param in  函数入参 - 密文
*@param inlen  函数入参 - 密文长度
*@param out  函数出参 - 明文
*@param outlen  函数出参 - 明文长度
*@param tag  函数入参 - GMAC值,即消息验证码
*@param taglen  函数入参 - GMAC长度,通常取16字节
*@param key  函数入参 - 秘钥(128bit)
*@param iv  函数入参 - 初始化向量
*@param ivlen 按照NIST SP800-38D标准实现GCM部分算法,RFC5647标准iv推荐使用12字节,96bit
*@param aad  函数入参 - 附加验证消息
*@param aadlen  函数入参 - 附加验证消息长度
*@return 成功为0,GCM的解密失败主要是tag校验失败

func SM4_GCM_Decrypt_NoPadding

func SM4_GCM_Decrypt_NoPadding(in []byte, inlen int, out []byte, outlen *int, tag []byte,
	taglen int, key []byte, iv []byte, aad []byte, aadlen int)

*

*@brief SM4 GCM模式对称加解密。解密,无填充,密文长度无要求。
*@param in  函数入参 - 密文
*@param inlen  函数入参 - 密文长度
*@param out  函数出参 - 明文
*@param outlen  函数出参 - 明文长度(GCM NOPADDING模式密文长度与明文长度一致)
*@param tag  函数入参 - GMAC值,即消息验证码
*@param taglen  函数入参 - GMAC长度,通常取16字节
*@param key  函数入参 - 秘钥(128bit)
*@param iv  函数入参 - 初始化向量
*@param aad  函数入参 - 附加验证消息
*@param aadlen  函数入参 - 附加验证消息长度
*@return 返回解密是否失败,GCM的解密失败主要是tag校验失败

func SM4_GCM_Decrypt_NoPadding_NIST_SP800_38D

func SM4_GCM_Decrypt_NoPadding_NIST_SP800_38D(in []byte, inlen int, out []byte,
	outlen *int, tag []byte, taglen int, key []byte, iv []byte, ivlen int,
	aad []byte, aadlen int) int

*

*@brief SM4 GCM模式对称加解密。解密,无填充,密文长度无要求。
*@param in  函数入参 - 密文
*@param inlen  函数入参 - 密文长度
*@param out  函数出参 - 明文
*@param outlen  函数出参 - 明文长度(GCM NOPADDING模式密文长度与明文长度一致)
*@param tag  函数入参 - GMAC值,即消息验证码
*@param taglen  函数入参 - GMAC长度,通常取16字节
*@param key  函数入参 - 秘钥(128bit)
*@param iv  函数入参 - 初始化向量
*@param ivlen 按照NIST SP800-38D标准实现GCM部分算法,RFC5647标准iv推荐使用12字节,96bit
*@param aad  函数入参 - 附加验证消息
*@param aadlen  函数入参 - 附加验证消息长度
*@return 返回解密是否失败,GCM的解密失败主要是tag校验失败

func SM4_GCM_Encrypt

func SM4_GCM_Encrypt(in []byte, inlen int, out []byte, outlen *int, tag []byte, taglen *int,
	key []byte, iv []byte, aad []byte, aadlen int) int

*

*@brief SM4 GCM模式对称加解密。加密,使用PKCS7填充,实际上GCM模式可不填充,非短明文加密推荐使用SM4_GCM_Encrypt_NoPadding替代。

*@param in 函数入参 - 明文 *@param inlen 函数入参 - 明文长度 *@param out 函数出参 - 密文 *@param outlen 函数出参 - 密文长度 *@param tag 函数出参 - GMAC值,即消息验证码 *@param taglen 既作函数入参也作为函数出参 - GMAC长度,通常取16字节 *@param key 函数入参 - 秘钥(128bit) *@param iv 函数入参 - 初始化向量 *@param aad 函数入参 - 附加验证消息 *@param aadlen 函数入参 - 附加验证消息长度 *@return 成功为0,一般加密失败是由参数错误导致

func SM4_GCM_Encrypt_NIST_SP800_38D

func SM4_GCM_Encrypt_NIST_SP800_38D(in []byte, inlen int, out []byte, outlen *int,
	tag []byte, taglen *int, key []byte, iv []byte, ivlen int, aad []byte, aadlen int) int

*

*@brief SM4 GCM模式对称加解密。加密,使用PKCS7填充,实际上GCM模式可不填充,非短明文加密推荐使用SM4_GCM_Encrypt_NoPadding替代。

*@param in 函数入参 - 明文 *@param inlen 函数入参 - 明文长度 *@param out 函数出参 - 密文 *@param outlen 函数出参 - 密文长度 *@param tag 函数出参 - GMAC值,即消息验证码 *@param taglen 既作函数入参也作为函数出参 - GMAC长度,通常取16字节 *@param key 函数入参 - 秘钥(128bit) *@param iv 函数入参 - 初始化向量 *@param ivlen 按照NIST SP800-38D标准实现GCM部分算法,RFC5647标准iv推荐使用12字节,96bit *@param aad 函数入参 - 附加验证消息 *@param aadlen 函数入参 - 附加验证消息长度 *@return 成功为0,一般加密失败是由参数错误导致

func SM4_GCM_Encrypt_NoPadding

func SM4_GCM_Encrypt_NoPadding(in []byte, inlen int, out []byte, outlen *int,
	tag []byte, taglen *int, key []byte, iv []byte, aad []byte, aadlen int)

*

*@brief SM4 GCM模式对称加解密。加密,无填充,明文长度无要求。
*@param in  函数入参 - 明文
*@param inlen  函数入参 - 明文长度
*@param out  函数出参 - 密文
*@param outlen  函数出参 - 密文长度(GCM NOPADDING模式密文长度与明文长度一致)
*@param tag  函数出参 - GMAC值,即消息验证码
*@param taglen  既作函数入参也作为函数出参 - GMAC长度,通常取16字节
*@param key  函数入参 - 秘钥(128bit)
*@param iv  函数入参 - 初始化向量
*@param aad  函数入参 - 附加验证消息
*@param aadlen  函数入参 - 附加验证消息长度
*@return 成功为0,一般加密失败是由参数错误导致

func SM4_GCM_Encrypt_NoPadding_NIST_SP800_38D

func SM4_GCM_Encrypt_NoPadding_NIST_SP800_38D(in []byte, inlen int, out []byte,
	outlen *int, tag []byte, taglen *int, key []byte, iv []byte, ivlen int,
	aad []byte, aadlen int) int

*

*@brief SM4 GCM模式对称加解密。加密,无填充,明文长度无要求。
*@param in  函数入参 - 明文
*@param inlen  函数入参 - 明文长度
*@param out  函数出参 - 密文
*@param outlen  函数出参 - 密文长度(GCM NOPADDING模式密文长度与明文长度一致)
*@param tag  函数出参 - GMAC值,即消息验证码
*@param taglen  既作函数入参也作为函数出参 - GMAC长度,通常取16字节
*@param key  函数入参 - 秘钥(128bit)
*@param iv  函数入参 - 初始化向量
*@param ivlen 按照NIST SP800-38D标准实现GCM部分算法,RFC5647标准iv推荐使用12字节,96bit
*@param aad  函数入参 - 附加验证消息
*@param aadlen  函数入参 - 附加验证消息长度
*@return 成功为0,一般加密失败是由参数错误导致

func Version

func Version() string

*

*@brief 获取当前sdk版本

Types

type HmacSm3Ctx

type HmacSm3Ctx struct {
	Context *C.TstHmacSm3Ctx
}

SM3 HMAC上下文

func SM3HMACInit

func SM3HMACInit(key []byte, keyLen int) *HmacSm3Ctx

*

  • @brief 基于sm3算法计算HMAC值 ctx init
  • @param key HMAC用的秘钥
  • @param key_len 秘钥长度
  • @return 0 -- OK

type SM2CSRMode

type SM2CSRMode int

证书模式

const (
	SM2CSRMode_Single SM2CSRMode = iota
	SM2CSRMode_Double
)

type SM2CipherMode

type SM2CipherMode int

sm2加密模式

const (
	SM2CipherMode_C1C3C2_ASN1 SM2CipherMode = iota
	SM2CipherMode_C1C3C2
	SM2CipherMode_C1C2C3_ASN1
	SM2CipherMode_C1C2C3
)

type SM2SignMode

type SM2SignMode int

Sm2签名模式

const (
	SM2SignMode_RS_ASN1 SM2SignMode = iota
	SM2SignMode_RS
)

type SM2_ctx_t

type SM2_ctx_t struct {
	Context C.sm2_ctx_t
}

SM2上下文

type SM3_ctx_t

type SM3_ctx_t struct {
	Context C.sm3_ctx_t
}

SM3上下文

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL