Subject: [PATCH 0/3] support test GCM/CCM mode for SM4
Date: Thu, 12 Aug 2021 21:17:45 +0800 [thread overview]
Message-ID: <20210812131748.81620-1-tianjia.zhang@linux.alibaba.com> (raw)
The GCM/CCM mode of SM4 is defined in the RFC 8998 specification:
https://datatracker.ietf.org/doc/html/rfc8998
At the same time, a minor issue in tcrypt is fixed.
Tianjia Zhang (3):
crypto: tcrypt - Fix the wrong position of return value test statement
crypto: testmgr - Add GCM/CCM mode test of SM4 algorithm
crypto: tcrypt: add GCM/CCM mode test for SM4 algorithm
crypto/tcrypt.c | 58 ++++++++++++++++---
crypto/testmgr.c | 29 ++++++++++
crypto/testmgr.h | 148 +++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 228 insertions(+), 7 deletions(-)
Hi xiexiuqi, welcome to the openEuler Community.
I'm the Bot here serving you. You can find the instructions on how to interact with me at
https://gitee.com/openeuler/community/blob/master/en/sig-infrastructure/command.md.
If you have any questions, please contact the SIG: Kernel, and any of the maintainers: @Xie XiuQi, @YangYingliang, @成坚 (CHENG Jian).
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。
已提交补丁:
crypto: tcrypt - Fix the wrong position of return value test statement
commit id: 7b3d52683b3a47c0ba1dfd6b5994a3a795b06972
crypto: testmgr - Add GCM/CCM mode test of SM4 algorithm
commit id: 68039d605f7bb34ea6dbd4e099bf98599d52b0ac
crypto: tcrypt: add GCM/CCM mode test for SM4 algorithm
commit id: 357a753f5ec7ccdec196fa825d906c3acc4bd57c
测试结果(GCM):
testing speed of multibuffer gcm(sm4) (gcm_base(ctr-sm4-aesni-avx,ghash-clmulni)) encryption
[629954.534935] tcrypt: test 0 (128 bit key, 16 byte blocks): 2459664 operations in 2 seconds (39354624 bytes)
[629956.535207] tcrypt: test 1 (128 bit key, 64 byte blocks): 2217416 operations in 2 seconds (141914624 bytes)
[629958.534694] tcrypt: test 2 (128 bit key, 256 byte blocks): 1390904 operations in 2 seconds (356071424 bytes)
[629960.535031] tcrypt: test 3 (128 bit key, 512 byte blocks): 988240 operations in 2 seconds (505978880 bytes)
[629962.534937] tcrypt: test 4 (128 bit key, 1024 byte blocks): 631712 operations in 2 seconds (646873088 bytes)
[629964.534907] tcrypt: test 5 (128 bit key, 2048 byte blocks): 363912 operations in 2 seconds (745291776 bytes)
[629966.534590] tcrypt: test 6 (128 bit key, 4096 byte blocks): 195528 operations in 2 seconds (800882688 bytes)
[629968.534921] tcrypt: test 7 (128 bit key, 8192 byte blocks): 101408 operations in 2 seconds (830734336 bytes)
testing speed of multibuffer gcm(sm4) (gcm_base(ctr-sm4-aesni-avx,ghash-clmulni)) decryption
[629970.534909] tcrypt: test 0 (128 bit key, 16 byte blocks): 2437632 operations in 2 seconds (39002112 bytes)
[629972.534721] tcrypt: test 1 (128 bit key, 64 byte blocks): 2212952 operations in 2 seconds (141628928 bytes)
[629974.535180] tcrypt: test 2 (128 bit key, 256 byte blocks): 1392360 operations in 2 seconds (356444160 bytes)
[629976.534779] tcrypt: test 3 (128 bit key, 512 byte blocks): 1002880 operations in 2 seconds (513474560 bytes)
[629978.535126] tcrypt: test 4 (128 bit key, 1024 byte blocks): 629736 operations in 2 seconds (644849664 bytes)
[629980.534978] tcrypt: test 5 (128 bit key, 2048 byte blocks): 361024 operations in 2 seconds (739377152 bytes)
[629982.534972] tcrypt: test 6 (128 bit key, 4096 byte blocks): 195160 operations in 2 seconds (799375360 bytes)
[629984.534796] tcrypt: test 7 (128 bit key, 8192 byte blocks): 101208 operations in 2 seconds (829095936 bytes)
测试结果(CCM):
testing speed of multibuffer rfc4309(ccm(sm4)) (rfc4309(ccm_base(ctr-sm4-aesni-avx,cbcmac(sm4-generic)))) encryption
[629511.459587] tcrypt: test 0 (152 bit key, 16 byte blocks): 1703744 operations in 2 seconds (27259904 bytes)
[629513.459933] tcrypt: test 1 (152 bit key, 64 byte blocks): 1152064 operations in 2 seconds (73732096 bytes)
[629515.459428] tcrypt: test 2 (152 bit key, 256 byte blocks): 492096 operations in 2 seconds (125976576 bytes)
[629517.459902] tcrypt: test 3 (152 bit key, 512 byte blocks): 282360 operations in 2 seconds (144568320 bytes)
[629519.459711] tcrypt: test 4 (152 bit key, 1024 byte blocks): 151952 operations in 2 seconds (155598848 bytes)
[629521.459642] tcrypt: test 5 (152 bit key, 2048 byte blocks): 79656 operations in 2 seconds (163135488 bytes)
[629523.459908] tcrypt: test 6 (152 bit key, 4096 byte blocks): 40320 operations in 2 seconds (165150720 bytes)
[629525.459679] tcrypt: test 7 (152 bit key, 8192 byte blocks): 20616 operations in 2 seconds (168886272 bytes)
testing speed of multibuffer rfc4309(ccm(sm4)) (rfc4309(ccm_base(ctr-sm4-aesni-avx,cbcmac(sm4-generic)))) decryption
[629527.460146] tcrypt: test 0 (152 bit key, 16 byte blocks): 1686304 operations in 2 seconds (26980864 bytes)
[629529.459737] tcrypt: test 1 (152 bit key, 64 byte blocks): 1156880 operations in 2 seconds (74040320 bytes)
[629531.459624] tcrypt: test 2 (152 bit key, 256 byte blocks): 489728 operations in 2 seconds (125370368 bytes)
[629533.459920] tcrypt: test 3 (152 bit key, 512 byte blocks): 284224 operations in 2 seconds (145522688 bytes)
[629535.459753] tcrypt: test 4 (152 bit key, 1024 byte blocks): 153520 operations in 2 seconds (157204480 bytes)
[629537.459559] tcrypt: test 5 (152 bit key, 2048 byte blocks): 79008 operations in 2 seconds (161808384 bytes)
[629539.459371] tcrypt: test 6 (152 bit key, 4096 byte blocks): 40936 operations in 2 seconds (167673856 bytes)
[629541.460169] tcrypt: test 7 (152 bit key, 8192 byte blocks): 20496 operations in 2 seconds (167903232 bytes)
登录 后才可以发表评论