Font Size: a A A

Implementation And Optimization Of National Secret Algorithm For "Songshan" Supercomputer Node Structure

Posted on:2023-05-04Degree:MasterType:Thesis
Country:ChinaCandidate:Y J LiuFull Text:PDF
GTID:2568306623468344Subject:Engineering
Abstract/Summary:
In recent years,the growing problem of data breaches has attracted widespread attention.The national secret algorithm is a series of encryption algorithms independently developed by my country.Among them,the SM2 elliptic curve cryptographic algorithm and the SM3 hash cryptographic algorithm are suitable for data encryption and digital signature verification respectively."Songshan" supercomputer,as a new generation of E-class architecture supercomputing system independently developed by my country,adopts the heterogeneous computing architecture of the current international mainstream CPU and acceleration devices,and has powerful computing capabilities.The SM2 algorithm is based on the mathematical foundation of elliptic curve discrete logarithm,and the SM3 algorithm is based on Hash calculation,and its solution process is in line with computationally intensive problems.Therefore,it has good research value to solve this kind of problem on the "Songshan" supercomputer.In this thesis,the SM2 and SM3 algorithms are selected to be transplanted and implemented in parallel on a single node of the "Songshan" supercomputer,which verifies the feasibility of heterogeneous parallelism of the above algorithms on domestic equipment,and also makes a useful attempt to expand the application field of CPU+DCU.The main work of this thesis is as follows:(1)By performing hot spot analysis on the programs of the SM2 and SM3 algorithms,the Montgomery modular multiplication algorithm in the SM2 algorithm,the improved w-NAF scalar multiplication algorithm and the iterative part of the message expansion and compression at the core of the SM3 algorithm are selected to encrypt and decrypt the above algorithms.The process has been ported and rewritten for parallelization,and its performance has been optimized respectively.(2)Select Open MP multi-thread parallel technology,use the #pragma omp parallel guidance statement to enable multi-thread parallel for the code in the loop part of the SM2 and SM3 algorithms,and give full play to the computing performance of the domestic computing platform.In order to solve the problem of unbalanced load,the schedule clause is used to evenly distribute computing tasks to multiple threads,so as to avoid the problem of idle waiting of some threads caused by different thread execution speeds in the multi-threaded parallel process.In order to solve the problem of data competition in the process of thread running,a method of thread variable privatization is proposed.The private clause is used to set the variable in the thread as a private variable,and a thread private copy is created for the variable,which avoid read and write conflicts of thread variables.Without affecting the accuracy of the algorithm,the operating efficiency of the SM2 and SM3 algorithms has been significantly improved.(3)Through the HIP programming model,the heterogeneous parallelism of CPU+DCU of SM2 and SM3 algorithms on the "Songshan" supercomputing platform is further optimized.Among them,the host side is responsible for the pre-calculation of public key and private key and Hash value,and the device side is responsible for completing the calculation of points on the elliptic curve,scalar multiplication calculation and the calculation part of the encryption and decryption process in parallel,effectively utilizing the powerful computing power of DCU,which shortens the timeconsuming part of the algorithm calculation and improves the operation efficiency of encryption and decryption.The The test results show that the multi-thread parallel efficiency of SM2 is improved by 1-4 times,and the operation efficiency of the SM2 encryption and decryption algorithm running on the "Songshan" supercomputing single node is improved by 4-6 times compared with the serial algorithm algorithm on the ordinary computer.The operating efficiency of the SM3 algorithm is increased by 2 times...
Keywords/Search Tags:National commercial cryptographic algorithm, "Songshan" supercomputer, Heterogeneous parallelism, DCU, OpenMP, SM2, SM3
Related items