Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

编译已通过,但没有发现sm2 与 sm4的命令 #6

Closed
qiangbei opened this issue Nov 2, 2015 · 6 comments
Closed

编译已通过,但没有发现sm2 与 sm4的命令 #6

qiangbei opened this issue Nov 2, 2015 · 6 comments

Comments

@qiangbei
Copy link

qiangbei commented Nov 2, 2015

您好,编译通过了。但是并没有发现sm2 与 sm4的命令,请问有稍微详细的使用说明吗?十分感谢!

GmSSL> ?
openssl:Error: '?' is an invalid command.

Standard commands
asn1parse ca ciphers cms
crl crl2pkcs7 dgst dh
dhparam dsa dsaparam ec
ecparam enc engine errstr
gendh gendsa genpkey genrsa
nseq ocsp passwd pkcs12
pkcs7 pkcs8 pkey pkeyparam
pkeyutl prime rand req
rsa rsautl s_client s_server
s_time sess_id smime speed
spkac srp ts verify
version x509

Message Digest commands (see the `dgst' command for more details)
md4 md5 mdc2 rmd160
sha sha1 sm3

Cipher commands (see the `enc' command for more details)
aes-128-cbc aes-128-ecb aes-192-cbc aes-192-ecb
aes-256-cbc aes-256-ecb base64 bf
bf-cbc bf-cfb bf-ecb bf-ofb
camellia-128-cbc camellia-128-ecb camellia-192-cbc camellia-192-ecb
camellia-256-cbc camellia-256-ecb cast cast-cbc
cast5-cbc cast5-cfb cast5-ecb cast5-ofb
des des-cbc des-cfb des-ecb
des-ede des-ede-cbc des-ede-cfb des-ede-ofb
des-ede3 des-ede3-cbc des-ede3-cfb des-ede3-ofb
des-ofb des3 desx idea
idea-cbc idea-cfb idea-ecb idea-ofb
rc2 rc2-40-cbc rc2-64-cbc rc2-cbc
rc2-cfb rc2-ecb rc2-ofb rc4
rc4-40 seed seed-cbc seed-cfb
seed-ecb seed-ofb sms4 sms4-cbc
sms4-cfb sms4-ecb sms4-ofb zuc

@qiangbei
Copy link
Author

qiangbei commented Nov 2, 2015

现在支持sm2 的加解密吗?能稍微说明下使用吗?

@theSwan
Copy link

theSwan commented Nov 2, 2015

test文件夹下有相关的测试程序sm2test可以参考

在 2015年11月2日,下午9:40,qiangbei notifications@github.com 写道:

现在支持sm2 的加解密吗?能稍微说明下使用吗?


Reply to this email directly or view it on GitHub #6 (comment).

@qiangbei
Copy link
Author

qiangbei commented Nov 4, 2015

通过以下语句
gcc -I/usr/local/ssl/include sm2test.c -L/usr/local/ssl/lib -lcrypto -lssl -ldl -o sm_test
可以通过编译。
代码注释略少,既然开源,能否提供少许注释?
SM2_encrypt 与 SM2_do_encrypt ,没太看明白,以及变量mactag[] 不知是什么缩写。
谢谢!
感谢各位开源贡献者!

@guanzhi
Copy link
Owner

guanzhi commented Nov 6, 2015

感谢支持!
关于注释少的问题:

  1. GmSSL的文档主要会通过项目Wiki逐渐提供,待API稳定之后会通过Doxygen的方式在头文件中标注。GmSSL API的命名方式、传递参数的方式和返回值都与OpenSSL现有规范保持一致,如SM2签名的API功能可参考ECDSA同名函数。
  2. 算法流程请参考SM2/SM3/SM4的标准文本。
  3. mactag即MAC-Tag,MAC = Message Authentication Code

@guanzhi
Copy link
Owner

guanzhi commented Nov 6, 2015

关于SM2、SM4命令:GmSSL命令行的pkey、genpkey、pkeyutl、dgst、enc等命令将sm2、sm3、sms4等算法名称作为参数,因此不会有独立的sm2、sm3、sms4命令出现。目前sm3、sms4可以通过dgst和enc命令调用,pkey系列命令在后面的更新中会支持SM2。

@guanzhi guanzhi closed this as completed Nov 6, 2015
@qiangbei
Copy link
Author

非常感谢!借助您开源的GMSSL已经实现了SM2所需的加解密功能。谢谢!

guanzhi pushed a commit that referenced this issue Sep 6, 2019
japinli added a commit to japinli/GmSSL that referenced this issue May 9, 2022
guanzhi added a commit that referenced this issue May 10, 2022
Fix a segfault for test case #6 (cms)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants