A Zynq-based XMSS algorithm software and hardware collaborative accelerated computing system

By designing a software and hardware collaborative acceleration computing system for the XMSS algorithm on the Zynq platform, using the architecture of FPGA and ARM and the AXI bus, the accelerated computing of the XMSS algorithm is realized, solving the problem of insufficient computing power and providing embedded devices with post-quantum capabilities Fast, secure and efficient implementation of passwords.

CN114329639BActive Publication Date: 2024-09-06ZHEJIANG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111614172.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-27
Publication Date
2024-09-06
Estimated Expiration
2041-12-27

AI Technical Summary

Technical Problem

The XMSS algorithm has high computational complexity in the key pair generation, signature and verification processes, resulting in large resource requirements and difficulty in running efficiently on embedded systems. There is a lack of corresponding software and hardware collaborative development cases and open source code.

Method used

Design a Zynq-based XMSS algorithm software and hardware collaborative acceleration computing system, including a hardware acceleration module, a software and hardware interaction interface module and a software-side control module. It uses the architecture of FPGA and ARM to realize data interaction through the AXI bus and DMA. The hardware acceleration module includes HASH, THASH_F and THASH_H modules are used to accelerate different calculation processes.

Benefits of technology

It achieves low resource consumption and fast encryption algorithm calculation on the Zynq-7000 platform, solves the problem of insufficient computing power of embedded devices in the Internet of Things era, and provides new ideas for the fast, safe and efficient implementation of post-quantum cryptography.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114329639B
    Figure CN114329639B
Patent Text Reader

Abstract

This invention discloses a hardware-software co-accelerated computing system for the XMSS algorithm based on Zynq. The system includes a hardware acceleration module, a hardware-software interaction interface module, and a software control module. The hardware acceleration module includes a selection module and three hardware acceleration operator modules. The hardware-software interaction interface module includes a hardware interface AXI-Stream module and a DMA data transfer tool configuration. The software control module includes the construction of input data frames for the three operators and the design of data transmission and reception logic. Based on the Zynq-7000 platform, this invention utilizes the unique FPGA+ARM (CPU) architecture of the Zynq SOC and the high-speed AXI bus built into Zynq to perform data interaction between the software and hardware operators, achieving the XMSS algorithm with lower resource consumption and faster speed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of hardware design for cryptography, and in particular to a Zynq-based XMSS algorithm software-hardware collaborative accelerated computing system. Background Art

[0002] In recent years, XMSS and SPHINCS hash signature schemes have received much attention due to their advantages in signature length and running speed. XMSS is considered one of the most trusted post-quantum signature schemes due to its minimal security assumptions and well-known security. Currently, the InternEngineering Task Force is working on the standardization of XMSS signatures, which means that this algorithm will be used on a large scale in the foreseeable future. However, since the Merkle tree, L-tree and WOTS chain operations are used in the key pair generation, signing and verification process of the XMSS algorithm signature scheme, it is more computationally complex than general cryptographic algorithms. Therefore, how to use limited computing resources to achieve fast calculation of the XMSS algorithm has become a hot topic for more and more researchers.

[0003] XMSS has relatively high resource requirements. They need to perform thousands of HASH calculations to generate keys, signatures, and verifications, and require sufficient memory to store relatively large signatures. Therefore, it is a difficult task to efficiently run such post-quantum secure signature schemes on resource-constrained embedded systems. At present, there are almost no corresponding software and hardware collaborative development cases and open source code references in China, and there is also little content on this aspect abroad. Summary of the invention

[0004] Aiming at the problem that general embedded devices have insufficient computing power to process XMSS algorithms, the present invention proposes a Zynq-based XMSS algorithm software and hardware collaborative accelerated computing system.

[0005] The object of the present invention is achieved through the following technical solutions: a Zynq-based XMSS algorithm software and hardware collaborative accelerated computing system, the system comprising a hardware acceleration module, a software and hardware interactive interface module and a software end control module;

[0006] The hardware acceleration module includes a selection module and three hardware acceleration operator modules, the three hardware operator modules include a HASH module, a THASH_F module and a THASH_H module, the selection module is connected to the three hardware acceleration operator modules, selects the input data frame, and outputs it to the corresponding hardware acceleration operator module; specifically: the XMSS algorithm selects the HASH module for accelerated calculation through the selection module in the process of generating key pairs, signing and verifying signatures, the XMSS algorithm selects the THASH_F module for accelerated calculation in each round of WOTS+chain operation cycle calculation, and the XMSS algorithm selects the THASH_H module for accelerated calculation each time a child node generates a parent node upward in a Merkle tree structure and an L-tree structure;

[0007] The software-hardware interaction interface module is used for data interaction between the software-side control module and the hardware acceleration module, and includes an AXI-Stream interface and a DMA; the AXI-Stream interface is encapsulated on the hardware acceleration module, so that the hardware acceleration module communicates with the DMA, and the input data frame constructed by the software-side control module is transferred to the hardware acceleration module through the AXI-Stream interface, and the data after accelerated calculation by the hardware acceleration module is transferred back to the software-side control module through the AXI-Stream interface;

[0008] The software-side control module includes the logic design of sending and receiving data and the construction of input data frames; the software side calls the encapsulated functions in the Xilinx SDK to complete sending data to the hardware acceleration module and receiving data from the hardware acceleration module; the input data frame construction is the construction of the input data frame sent to the hardware acceleration module by the software-side control module, and for different calculation processes of the XMSS algorithm, the frame header and structure that can be recognized by the corresponding hardware acceleration operator module are designed.

[0009] Furthermore, the hardware acceleration module distinguishes input data frames through a selection module, so that the data frames flow to the corresponding hardware acceleration operator module for processing.

[0010] Furthermore, the HASH module includes a state machine, which consists of a start state, a cyclic calculation state and an end state, wherein the cyclic calculation state is a main state, and after the data frame is decomposed, it is iteratively calculated in the calculation state to obtain the calculation result of this round of HASH operator.

[0011] Furthermore, the THASH_F module uses a selector plus counter structure to distinguish the input data frame into seed, addr and data, sets the last 32 bits of addr to 0 and 1 to obtain addr_0 and addr_1, and performs PRF operations on seed, addr_0 and addr_1 respectively. Data is first XORed with the results of seed and addr_1 PRF operations, and then concatenated with the results of seed and addr_0 PRF operations. The concatenated data is subjected to HASH operation to obtain the final calculation result.

[0012] Furthermore, the THASH_H module uses a selector plus counter structure to distinguish the input data frame into seed, addr, data_right, and data_left, sets the last 32 bits of addr to 0, 1, and 2 to obtain addr_0, addr_1, and addr_2, performs PRF operations on seed, addr_1, and addr_2, respectively, performs XOR operations on data_left, the results of the PRF operations on seed and addr_1, and the results of the PRF operations on data_right and seed and addr_2. The above two XOR results are then spliced ​​with the results of the PRF operations on seed and addr_0, and the spliced ​​data are subjected to HASH operations to obtain the final calculation result.

[0013] Furthermore, the DMA is an IP instantiated in the FPGA in Zynq, and the configuration can be completed by configuring parameters in Vivado and connecting in BlockDesign.

[0014] Furthermore, the software-side control module writes the constructed input data frame into the DDR, and the software-hardware interaction interface module controls the DMA through the XAxiDma_SimpleTransfer function, and the DMA moves the constructed input data frame from the specified address in the DDR to the hardware acceleration module; after the hardware acceleration module receives the input data frame, it starts to process the input data frame; at this time, the software-side control module waits for data processing, and after the hardware acceleration module completes the processing, the software-hardware interaction interface module controls the DMA through the XAxiDma_SimpleTransfer function to move the output data processed by the hardware acceleration module back to the DDR, and the software-side control module reads the data at the specified address in the DDR.

[0015] The beneficial effects of the present invention are as follows: based on the Zynq-7000 platform, a computing system is designed that accelerates the implementation of the XMSS algorithm with the collaboration of software and hardware. The method utilizes the special FPGA+ARM (CPU) architecture of the Zynq SOC, utilizes the built-in high-speed AXI bus of Zynq, and uses DMA as a tool for transporting data to perform data interaction between software and hardware, thereby implementing the encryption algorithm with lower resource consumption and faster speed. Subsequent researchers can also take advantage of the integration of development environments from Vivado, SDK to HLS to more conveniently optimize and deploy related algorithms. The invention can solve the problem of insufficient computing power when future embedded devices need to encrypt massive data in the era of the Internet of Things, and provides a new idea for the rapid, secure and efficient implementation of post-quantum cryptography. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 It is the overall structural diagram of the present invention;

[0017] Figure 2 It is a schematic diagram of the overall hardware architecture of the present invention;

[0018] Figure 3 It is a schematic diagram of the structure of the selection module of the present invention;

[0019] Figure 4 It is a schematic diagram of the HASH module structure of the present invention;

[0020] Figure 5 It is a schematic diagram of the structure of the THASH_F module of the present invention;

[0021] Figure 6 It is a schematic diagram of the structure of the THASH_H module of the present invention;

[0022] Figure 7 It is a schematic diagram of the input data structure of the THASH_F module of the present invention;

[0023] Figure 8 It is a schematic diagram of the input data structure of the THASH_H module of the present invention; DETAILED DESCRIPTION

[0024] The present invention will be further described below in conjunction with the accompanying drawings.

[0025] like Figure 1As shown, the present invention provides a kind of XMSS algorithm software and hardware collaborative accelerated computing based on Zynq, and the whole system architecture mainly includes a hardware acceleration module, a software and hardware interactive interface module, a software-side control module and DDR, etc. The hardware acceleration module is connected to the software and hardware interactive interface module through the AXI-Stream interface. The DMA in the software and hardware interactive interface module is an IP instantiated in the FPGA after parameter configuration. The configuration can be completed by configuring the parameters through Vivado and connecting in Block Design. The software-side control module is connected to the DMA through the AXI interface to control the DMA to move data. CACHE is used as a high-speed cache between the software-side control module and the DDR.

[0026] The software-side control module includes the logic design of sending and receiving data and the construction of input data frames; the software side calls the encapsulated functions in the Xilinx SDK to complete sending data to the hardware acceleration module and receiving data from the hardware acceleration module; the input data frame construction is the construction of the input data frame sent to the hardware acceleration module by the software-side control module, and for different calculation processes of the XMSS algorithm, the frame header and structure that can be recognized by the corresponding hardware acceleration operator module are designed.

[0027] like Figure 2 As shown, the overall hardware acceleration module contains three hardware acceleration operator modules: HASH module, THASH_F module and THASH_H module. The hardware acceleration module distinguishes the input data frames by selecting modules, so that the data frames flow to the corresponding hardware acceleration operator modules for processing. Specifically, the XMSS algorithm selects the HASH module for accelerated calculation through the selection module in the process of generating key pairs, signing and verifying signatures. The XMSS algorithm selects the THASH_F module for accelerated calculation in each round of WOTS+chain operation cycle calculation. The XMSS algorithm selects the THASH_H module for accelerated calculation every time a child node generates a parent node upward in the Merkle tree structure and the L-tree structure.

[0028] The HASH module, THASH-F module, THASH-H module and selection module are all implemented in hardware on the FPGA. The AXI-Stream interface module in the hardware-software interaction interface module is encapsulated in the outer layer of the overall hardware acceleration module, so that the hardware acceleration module can communicate with the DMA, transfer the input data frame constructed by the software-side control module to the hardware acceleration module through the AXI-Stream interface, and transfer the data after the hardware acceleration module accelerates the calculation back to the software-side control module through the AXI-Stream interface.

[0029] like Figure 3As shown, the selection module includes two registers and a selection circuit. Register DONE is used to indicate whether the current selection is completed, and register TYPE is used to indicate the type of data frame selected. The selector MUX selects the current data frame according to the value of TYPE, and outputs it to the corresponding hardware acceleration operator module. In order to pass the data frame to the corresponding hardware acceleration operator module, the software-side control module will add a 256-bit data frame to the front end of the input data frame when sending the data frame to the hardware acceleration module. The hardware acceleration module determines whether the current data frame is a data frame of the judgment type based on the value of register DONE. When the judgment is completed, DONE is set to 1 in the next clock cycle, and the TYPE register is set to the value of the corresponding data frame. The input data data entering the module is divided into data_hash, data_thash_f and data_thash_h.

[0030] like Figure 4 As shown in the figure, the main component of the HASH module is a state machine, which consists of three states (start state, loop calculation state and end state). The loop calculation state is the main state. After the data frame is decomposed, it is iterated in the calculation state for 64 rounds to get the calculation result of this round of the HASH module. The input data is block, the output data is digest, and the output signal digest_valid indicates whether the current output data is digest valid.

[0031] like Figure 5 As shown, the THASH_F module uses a selector plus counter structure to distinguish between seed, addr, and data. The software will send data frames in a predefined order, and the hardware will send data frames to the corresponding processing module at the next level in the corresponding order. Set the last 32 bits of addr to 0 and 1 to get addr_0 and addr_1, and perform PRF operations on seed, addr_0, and addr_1 respectively. Data is first XORed with the results of seed and addr_1 PRF operations, and then concatenated with the results of seed and addr_0 PRF operations. The concatenated data is HASH-operated to obtain the final calculation result. The input data is in, and the output data is out.

[0032] like Figure 6As shown, the THASH_H module is similar to the THASH_F module. It uses a selector plus a counter to distinguish the input data frame. The input data frame will be divided into addr, data_right, data_left and seed. The last 32 bits of addr are set to 0, 1 and 2 to get addr_0, addr_1 and addr_2. Seed is subjected to PRF operation with addr_0, addr_1 and addr_2 respectively. Data_left is XORed with the result of seed and addr_1 PRF operation, and data_right is XORed with the result of seed and addr_2 PRF operation. The above two XOR results are then spliced ​​with the result of seed and addr_0 PRF operation. The spliced ​​data is subjected to HASH operation to obtain the final calculation result. The input data is in and the output data is out.

[0033] like Figure 7 As shown in the figure, the data sent by the THASH_F module software to the hardware each time is two 512-bit frames. After receiving the data, the hardware module will split each frame of data into two 256-bit frames to achieve collaborative data processing between software and hardware. The specific input data construction process is: splice addr, seed, and data together in order, and then shift the spliced ​​data backward by 256 bits. Add a 256-bit data frame at the front end of the data, and the value of its first byte is 2, indicating that the current operator is THASH_F. At this time, the judgment frame will form the first 512-bit data frame with addr, and the seed will form the second 512-bit data frame with data.

[0034] like Figure 8 As shown in the figure, the input data structure of THASH_H is: addr and seed form a 512-bit data frame, data1 and data2 form a 512-bit data frame, and a 512-bit judgment frame is added at the front of the data. Therefore, after the input data of the THASH_H module is constructed, there are three 512-bit data, which will be sent to the hardware module in sequence. The specific input data construction process is: addr, seed, data1 and data2 are spliced ​​together in order, and then the spliced ​​data is shifted backward by 512 bits. A 512-bit data frame is added at the front of the data, and the value of its first byte is 3, indicating that the current operator is THASH_H. At this time, the judgment frame is the first 512-bit data, seed will form the second 512-bit data frame with addr, and data1 will form the third 512-bit data frame with data2.

[0035] The working process of the present invention is as follows: the essence of each software and hardware collaborative data processing is that the software end prepares the data to be processed and sends it to the hardware module, the hardware module uses the designed acceleration operator to perform calculations, and then sends the processed data to the software module. The specific working process is: first, the constructed data will temporarily exist in the Cache, and the software end will refresh the constructed data from the Cache to the DDR through the Xil_DCacheFlushRange function. After the data enters the DDR, the DMA is controlled by the XAxiDma_SimpleTransfer function, and the DMA can move the data from the specified address in the DDR to the hardware module. After the hardware module receives the data, it will start to process the input data. At this time, the software end will wait for the data to be processed through the function, and after the hardware module has processed it, it will control the DMA to move it to the DDR through the XAxiDma_SimpleTransfer function. In this process, the Cache of the target address is invalidated by the Xil_DCacheInvaliateRange function to ensure that the data will directly enter the DDR instead of the Cache. Finally, the software end reads the data that has been processed by the hardware module in the DDR.

[0036] The above embodiments are used to illustrate the present invention rather than to limit the present invention. Any modification and change made to the present invention within the spirit of the present invention and the protection scope of the claims shall fall within the protection scope of the present invention.

Claims

1. A Zynq-based XMSS algorithm software and hardware collaborative accelerated computing system, Features: The system includes a hardware acceleration module, a hardware and software interaction interface module, and a software end control module; The hardware acceleration module includes a selection module and three hardware acceleration operator modules, the three hardware operator modules include a HASH module, a THASH_F module and a THASH_H module, the selection module is connected to the three hardware acceleration operator modules, selects the input data frame, and outputs it to the corresponding hardware acceleration operator module; specifically: the XMSS algorithm selects the HASH module for accelerated calculation through the selection module in the process of generating key pairs, signing and verifying signatures, the XMSS algorithm selects the THASH_F module for accelerated calculation in each round of WOTS+chain operation cycle calculation, and the XMSS algorithm selects the THASH_H module for accelerated calculation each time a child node generates a parent node upward in a Merkle tree structure and an L-tree structure; The software-hardware interaction interface module is used for data interaction between the software-side control module and the hardware acceleration module, and includes an AXI-Stream interface and a DMA; the AXI-Stream interface is encapsulated on the hardware acceleration module, so that the hardware acceleration module communicates with the DMA, and the input data frame constructed by the software-side control module is transferred to the hardware acceleration module through the AXI-Stream interface, and the data after accelerated calculation by the hardware acceleration module is transferred back to the software-side control module through the AXI-Stream interface; The software-side control module includes the logic design of sending and receiving data and the construction of input data frames; the software side calls the encapsulated functions in the Xilinx SDK to complete sending data to the hardware acceleration module and receiving data from the hardware acceleration module; the input data frame construction is the construction of the input data frame sent to the hardware acceleration module by the software-side control module, and for different calculation processes of the XMSS algorithm, the frame header and structure that can be recognized by the corresponding hardware acceleration operator module are designed.

2. According to claim 1, a Zynq-based XMSS algorithm software and hardware collaborative accelerated computing system, Features: The hardware acceleration module distinguishes input data frames by selecting a module, so that the data frames flow to the corresponding hardware acceleration operator module for processing.

3. The Zynq-based XMSS algorithm software and hardware collaborative accelerated computing system according to claim 1, Features: The HASH module includes a state machine, which consists of a start state, a cyclic calculation state and an end state, wherein the cyclic calculation state is a main state, and after the data frame is decomposed, it is iteratively calculated in the calculation state to obtain the calculation result of this round of HASH operator.

4. The Zynq-based XMSS algorithm software and hardware collaborative accelerated computing system according to claim 1, Features: The THASH_F module uses a selector plus counter structure to distinguish the input data frame into seed, addr and data, sets the last 32 bits of addr to 0 and 1 to obtain addr_0 and addr_1, and performs PRF operations on seed, addr_0 and addr_1 respectively. Data is first XORed with the result of seed and addr_1 PRF operation, and then spliced ​​with the result of seed and addr_0 PRF operation. The spliced ​​data is subjected to HASH operation to obtain the final calculation result.

5. The Zynq-based XMSS algorithm software and hardware collaborative accelerated computing system according to claim 1, Features: The THASH_H module uses a selector plus counter structure to distinguish the input data frame into seed, addr, data_right, and data_left, and sets the last 32 bits of addr to 0, 1, and 2 to obtain addr_0, addr_1, and addr_2. Seed is subjected to PRF operation with addr_0, addr_1, and addr_2, respectively. Data_left is XORed with the result of PRF operation of seed and addr_1, and data_right is XORed with the result of PRF operation of seed and addr_2. The above two XOR results are then spliced ​​with the result of PRF operation of seed and addr_0, and the spliced ​​data is subjected to HASH operation to obtain the final calculation result.

6. The Zynq-based XMSS algorithm software and hardware collaborative accelerated computing system according to claim 1, Features: The DMA is an IP instantiated in the FPGA in Zynq. The configuration can be completed by configuring the parameters in Vivado and connecting in Block Design.

7. The Zynq-based XMSS algorithm software and hardware collaborative accelerated computing system according to claim 1, Features: The software-side control module writes the constructed input data frame into the DDR, and the software-hardware interaction interface module controls the DMA through the XAxiDma_SimpleTransfer function, and the DMA moves the constructed input data frame from the specified address in the DDR to the hardware acceleration module; after the hardware acceleration module receives the input data frame, it starts to process the input data frame; at this time, the software-side control module waits for data processing, and after the hardware acceleration module completes the processing, the software-hardware interaction interface module controls the DMA through the XAxiDma_SimpleTransfer function to move the output data processed by the hardware acceleration module back to the DDR, and the software-side control module reads the data at the specified address in the DDR.