SM2_MAX_PLAINTEXT_SIZE 定义是255 ,你这个文件偏大了点,试试小点 /Users/andy/CLionProjects/learnc/GmSSL/src/sm2_lib.c:499:sm2_do_encrypt(): if ( !(SM2_MIN_PLAINTEXT_SIZE <= inlen && inlen <= SM2_MAX_PLAINTEXT_SIZE)) { error_print(); return -1; } Author tx991020 commented ...
functiondoEncrypt(msg,publicKey,cipherMode=1,asn1=false){ msg=typeofmsg==='string'?_.hexToArray(_.utf8ToHex(msg)):Array.prototype.slice.call(msg) publicKey=_.getGlobalCurve().decodePointHex(publicKey)// 先将公钥转成点 Expand DownExpand Up@@ -50,8 +50,12 @@ function doEncrypt(msg...