计算机科学 ›› 2025, Vol. 52 ›› Issue (6): 390-396.doi: 10.11896/jsjkx.240300141

• 信息安全 • 上一篇    下一篇

国密算法SM9的性能优化方法

谢振杰1,2, 刘奕明3, 蔡瑞杰1, 罗友强1,4   

  1. 1 信息工程大学网络空间安全教育部重点实验室 郑州 450001
    2 中国人民解放军78156部队 重庆 400039
    3 中国人民解放军92330部队 山东 青岛 266000
    4 中国人民解放军32158部队 新疆 喀什 844000
  • 收稿日期:2024-03-20 修回日期:2024-08-06 出版日期:2025-06-15 发布日期:2025-06-11
  • 通讯作者: 蔡瑞杰(wsxcrj@163.com)
  • 作者简介:(jsonxie@126.com)
  • 基金资助:
    科技委基础加强项目(2019-JCJQ-ZD-113)

Performance Optimization Method for Domestic Cryptographic Algorithm SM9

XIE Zhenjie1,2, LIU Yiming3, CAI Ruijie1, LUO Youqiang1,4   

  1. 1 Key Laboratory of Cyberspace Security,Ministry of Education,Information Engineering University,Zhengzhou 450001,China
    2 Troop 78156 of PLA,Chongqing 400039,China
    3 Troop 92330 of PLA,Qingdao,Shandong 266000,China
    4 Troop 32158 of PLA,Kashi,Xinjiang 844000,China
  • Received:2024-03-20 Revised:2024-08-06 Online:2025-06-15 Published:2025-06-11
  • About author:XIE Zhenjie,born in 1995,Ph.D candidate.His main research interests include cloud security and cryptography applications.
    CAI Ruijie,born in 1990,Ph.D candidate,lecturer.His main research in-terests include network security,binary code analysis and vulnerability disco-very.
  • Supported by:
    Foundation Strengthening Key Project of Science & Technology Commission(2019-JCJQ-ZD-113).

摘要: 针对国密算法SM9的计算性能优化问题,提出椭圆曲线固定点标量乘预计算、采用预计算的Miller算法、最终模幂困难部分构造、分圆子群上的模幂运算、基于Comb固定基的模幂运算等性能优化方法,有效提升了SM9算法中椭圆曲线标量乘、双线性对、12次扩域上的模幂等耗时步骤的计算性能。通过Python编程实现SM9数字签名的生成与验证、密钥交换、密钥封装与解封装、加密与解密7项算法。测试表明,综合运用上述优化方法后,各项SM9算法的性能提升幅度为32%~352%。

关键词: 国密算法, SM9, 性能优化, 椭圆曲线, 双线性对, Python

Abstract: To address the challenge of computational performance optimization in the domestic cryptographic algorithm SM9,a suite of performance enhancement techniques has been developed and applied.These methods include fixed-point scalar multiplication precomputation on elliptic curves,an improved Miller algorithm with precomputation,an optimized construction for the hard part of final exponentiation,modular exponentiation within the cyclotomic subgroup,and modular exponentiation employing a Comb-based fixed-base strategy.Through these tailored approaches,significant enhancements have been achieved in the computation of the SM9 algorithm,especially in the time-consuming steps,such as scalar multiplication on elliptic curves,bilinear pairing,and modular exponentiationin the 12th extension field.The seven fundamental SM9 algorithms,encompassing digital signature generation and verification,key exchange,key encapsulation and decapsulation,as well as encryption and decryption,have been effectively implemented in Python.Comprehensive testing reveals that the integration of these optimization techniques yields performance improvements ranging from 32% to 352% for the SM9 algorithms,marking a substantial advance in their computational efficiency.

Key words: Domestic cryptographic algorithm, SM9, Performance optimization, Elliptic curve, Bilinear pairing, Python

中图分类号: 

  • TP309
[1]SM9标识密码算法 第1部分:总则:GB/T 38635.1—2020[S].北京:全国信息安全标准化技术委员会,2020-04-28.
[2]SM9标识密码算法 第2部分:算法:GB/T 38635.2—2020[S].北京:全国信息安全标准化技术委员会,2020-04-28.
[3]HU X Y,HE D B,PENG C,et al.A fast implementation of R-ate pairing in SM9 algorithm[J].Journal of Cryptologic Reseatch,2022,9(5):936-948.
[4]GAN Z W,LIAOF Y.Rapid calculation of R-ate bilinear pairing in China state cryptography standard SM9[J].Computer Engineering,2019,45(6):171-174.
[5]WANG M D,HE W G,LI J,et al.Optimal design of R-ate pair in SM9 algorithm[J].Communications Technology,2020,53(9):2241-2244.
[6]WANG J T,FAN R,HUANG Z.Fast implementation of high power operation in SM9[J].Computer Engineering,2023,49(9):118-124,136.
[7]SCOTT M,BENGER N,CHARLEMAGNE M,et al.On the final exponentiation for calculating pairings on ordinary elliptic curves [C]//Proceedings of the 3rd International Conference on Pairing-Based Cryptography.2009:78-88.
[8]FU Z.Efficient implementation of Rate bilinear pairing algo-rithm[D].Tianjin:Tianjin University,2017.
[9]SUN M W.Research on key technologies of SM9 identification cipher algorithm[D].Harbin:Harbin University of Science and Technology,2022.
[10]LI J F.Research on SM9 algorithm and FPGA implementation[D].Xi'an:Xidian University,2021.
[11]WANG B.Research on fast calculations of scalar multiplication and bilinear pairings on elliptic curves[D].Hefei:University of Science and Technology of China,2021.
[12]YANG G Q.Study on fast implementation algorithms and key techniques for elliptic curve and pairing-based crytography[D].Jinan:Shandong University,2021.
[13]DUQUESNE S,GHAMMAM L.Memory-saving computationof the pairing final exponentiation on BN curves[J].Groups Complexity Cryptology,2016,8(1):75-90.
[14]AZARDERAKHSH R,FISHBEIN D,GREWAL G,et al.Fast software implementations of bilinear pairings[J].IEEE Transactions on Dependable and Secure Computing,2015,14(6):605-619.
[15]ZHEN P,HU X,YUY,et al.Research on the optimization computation of SM9 bilinear pairings [C]//Proceedings of the 2nd ACM International Conference on Communication and Information Systems.2017:256-261.
[16]CHENG X S,ZHANG Y Z,WANG Y W.Simplification andhardware parallel design of Frobenius mapping algorithm based on SM9 [C]//Proceedings of the 3rd IEEE International Conference on Circuits,Systems and Devices.2019:78-82.
[17]WU Y,BAI G Q,WUX J.A karatsuba algorithm based accelerator for pairing computation [C]//Proc of the 15th IEEE International Conference on Electron Devices and Solid-State Circuits.2019:1-3.
[18]KARABINAK.Squaring in cyclotomic subgroups[J].Mathe-matics of Computation,2013,82(281):555-579.
[19]XIE Y,WANG B,ZHANG L,et al.A high-performance processor for optimal ate pairing computation over Barreto-Naehrig curves[J].IET Circuits,Devices & Systems,2022,16(5):427-436.
[20]WANG S,FANG L G,HAN L B,et al.Fast implementation of SM9 digital signature and verification algorithms[J].Communications Technology,2019,52(10):2524-2527.
[21]XIE Z J,FU W,LUO F.Performance optimization method of Python toolkit for domestic cryptographic algorithm[J].Journal of Information Securyity Research,2023,9(10):1001-1007.
[22]Guanzhi.支持国密SM2/SM3/SM4/SM9/SSL的密码工具箱[EB/OL].(2023-10-16) [2023-10-18].https://github.com/guanzhi/GmSSL.
[23]PU L,LIN C,WU W,et al.A public-key encryption with keyword search schemefrom SM9[J].Journal of Cyber Security,2023,8(1):108-118.
[24]LAI J C,HUANG X Y,HED B,et al.An efficient hierarchical identity-based encryption based on SM9[J].SCIIENTIA SINICA Informmations,2023,53(5):918-930.
[25]LIU K,NING J T,WU W,et al.Multi-ciphertext batch auditable decryption outsourcing SM9-HIBE key encapsulation mechanism[J].Journal on Communications,2023,44(12):158-170.
[26]LI C,LIANG J K,DINGY J,et al.Hierarchical identity-based broadcast inner product functional encryption based on SM9[J].SCIIENTIA SINICA Informmations,2024,54(6):1400-1418.
[27]CUI Y,HUANG X Y,LAIJ C,et al.Anonymous broadcast encryption based on SM9[J].Journal of Cyber Security,2023,8(6):15-27.
[28]AN H Y,HE D B,BAO Z J,et al.Ring signature based on the SM9 digital signature and its application in blockchain privacy protection[J].Journal of Computer Research and Development,2023,60(11):2545-2554.
[29]LIU X H,HUANG X Y,CHENG Z H,et al.Fault-tolerant identity-based encryption from SM9[J].Science China(Information Sciences),2024,67(2):104-117.
Viewed
Full text


Abstract

Cited

  Shared   
  Discussed   
No Suggested Reading articles found!