GmSSL icon indicating copy to clipboard operation
GmSSL copied to clipboard

o2i_SM2CiphertextValue 函数说明

Open bylively opened this issue 8 years ago • 3 comments

关老师您好 请问一下SM2CiphertextValue *o2i_SM2CiphertextValue(const EC_GROUP *group, const EVP_MD *md, SM2CiphertextValue **cv, const unsigned char **pin, long len);这个函数的len表示什么含义?我该如何传参。谢谢指导

bylively avatar Jun 27 '18 07:06 bylively

SM2加密算法的早期文本中的密文直接是几个部分的拼接,在正式的标准中改为采用ASN.1/DER编码。这组函数主要是在SM2CipherValue和老式编码之间做转换,这个函数是将编码的数据转为SM2CipherValue内部类型,pin是输入的编码字节,len是输入的长度,cv是返回值。

guanzhi avatar Jul 14 '18 13:07 guanzhi

这组函数是用来支持测试用的,应用应该调用i2d_SM2CipherValue和d2i_SM2CipherValue做编解码

guanzhi avatar Jul 14 '18 13:07 guanzhi

Marked as stale issue. Will be closed later if no activity for a while.

github-actions[bot] avatar Oct 04 '20 01:10 github-actions[bot]