+

CN119475380A - A programmable AES encryption module hardware accelerator, instruction set and operation method - Google Patents

A programmable AES encryption module hardware accelerator, instruction set and operation method Download PDF

Info

Publication number
CN119475380A
CN119475380A CN202411537198.7A CN202411537198A CN119475380A CN 119475380 A CN119475380 A CN 119475380A CN 202411537198 A CN202411537198 A CN 202411537198A CN 119475380 A CN119475380 A CN 119475380A
Authority
CN
China
Prior art keywords
register
instruction
data
aes
programmable
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202411537198.7A
Other languages
Chinese (zh)
Inventor
程垚
王固强
李乐薇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Vango Technologies Inc
Original Assignee
Hangzhou Vango Technologies Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Vango Technologies Inc filed Critical Hangzhou Vango Technologies Inc
Priority to CN202411537198.7A priority Critical patent/CN119475380A/en
Publication of CN119475380A publication Critical patent/CN119475380A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Storage Device Security (AREA)
  • Advance Control (AREA)

Abstract

本发明提出了一种可编程AES加密模块硬件加速器、指令集及运行方法,其中所述加速器与总线连接,与其进行数据交互,并对所述数据进行AES加密和解密,所述加速器包括:与所述总线连接的主设备和从设备,其中,所述主设备用于数据搬运指令的收发;所述从设备,与所述总线上的其他模块进行通信,并接收所述主设备的数据搬运指令和数据;所述从设备通过指令栈与译码器连接,将其指令传输给所述译码器;所述译码器对从所述从设备传输来的指令进行解码,并将解码后的指令发送给与其连接的计算模块或搬运模块进行对应的运算或数据传输;所述指令集用于控制所述加速器;所述运行方法采用所述加速器实现。

The present invention proposes a programmable AES encryption module hardware accelerator, an instruction set and an operation method, wherein the accelerator is connected to a bus, exchanges data with the bus, and performs AES encryption and decryption on the data, and the accelerator comprises: a master device and a slave device connected to the bus, wherein the master device is used for sending and receiving data handling instructions; the slave device communicates with other modules on the bus and receives data handling instructions and data from the master device; the slave device is connected to a decoder through an instruction stack and transmits its instructions to the decoder; the decoder decodes the instructions transmitted from the slave device and sends the decoded instructions to a computing module or a handling module connected thereto for corresponding operations or data transmission; the instruction set is used to control the accelerator; and the operation method is implemented by using the accelerator.

Description

Programmable AES encryption module hardware accelerator, instruction set and operation method
Technical Field
The invention relates to a hardware accelerator, an instruction set and an operation method, in particular to a hardware accelerator, an instruction set and an operation method of a programmable AES encryption module.
Background
This section provides merely background information related to the present disclosure and is not necessarily prior art.
In the prior art, the AES (advanced encryption standard) algorithm uses hardware to realize an excessively large area, but a method using pure software can cause a CPU to be occupied for a long time, so that the existing AES mostly uses a technology of combining software and hardware to solve the above problems, and the AES hardware accelerator and the CPU cooperate with each other generally using an interrupt method, that is, the AES hardware accelerator notifies the CPU to perform the next operation after completing the operation.
However, in the prior art, the above solution requires frequent interruption to the CPU, resulting in inefficient CPU operation.
It should be noted that the information disclosed in the above background section is only for enhancing understanding of the background of the present disclosure and thus may include information that does not constitute prior art known to those of ordinary skill in the art.
Disclosure of Invention
The invention aims to solve the technical problem of providing a programmable AES encryption module hardware accelerator, an instruction set and an operation method aiming at the defects of the prior art.
In order to solve the technical problems, the invention discloses a programmable AES encryption module hardware accelerator, an instruction set and an operation method;
The accelerator is connected with a bus, performs data interaction with the bus, and performs AES encryption and decryption on the data, and comprises:
the master device is used for receiving and transmitting data carrying instructions; the slave device communicates with other modules on the bus and receives data handling instructions and data of the master device.
Further, the accelerator also comprises an instruction stack and a decoder,
The slave device is connected with the decoder through an instruction stack and transmits instructions to the decoder.
Further, the accelerator also comprises a calculating module and a carrying module,
The decoder decodes the instruction transmitted from the slave device and sends the decoded instruction to a computing module or a carrying module connected with the decoder;
the computing module is used for selecting different computing submodules to carry out corresponding operation according to the instruction;
And the carrying module is used for transmitting the data in the calculation module and the register according to the data carrying instruction sent by the main equipment.
Further, the accelerator also comprises a register,
The register is used for storing data in the accelerator.
Further, the register includes:
Special purpose registers, and general purpose registers, wherein,
The special register is used for storing specific encrypted and decrypted data;
the general register is used for storing conventional data, including intermediate calculation results and auxiliary data;
The special registers include a field operation result register GF, a verification information result register TAG, an initialization vector register IV, a KEY register H, an encryption KEY register KEY, a plaintext data register PTEXT, and a ciphertext data register CTEXT.
Further, the register further includes:
And the state register is connected with the slave equipment and is used for storing the current state of the accelerator.
Further, the computing submodule includes:
the inversion operation submodule INV is used for executing the inversion steps in the encryption and decryption processes of the AES, and has four modes of byte level inversion, word level inversion, double word level inversion and full inversion respectively;
The AES CORE submodule AES_CORE is used for executing CORE operation steps of AES encryption and decryption, and comprises byte substitution, row shift, column confusion and round key addition;
Galois field operation sub-module G2F is used for multiplying operation on the finite field, and the calculation result is put into field operation result register GF;
An exclusive-or operator module XOR for performing exclusive-or operations;
An addition operation sub-module ADD for performing an addition operation;
The special DMA submodule DMA is only used for carrying data in the SRAM into a special register and a general register;
The handling submodule MOV is used for mutual handling of data in the special register and the general register.
Further, the bus, the master device and the slave device are an AHB bus, an AHB master device and an AHB slave device.
The invention also provides a programmable AES hardware accelerator instruction set for controlling a calculation module in the accelerator to perform related calculation, wherein the instruction set comprises:
The XOR instruction performs an exclusive OR operation, wherein the input and the output are special registers or general registers, the input is 2 registers, and the output is 1 register;
an AES_CORE instruction, which performs AES encryption or decryption operation, and confirms that the initialization vector register IV, the encryption KEY register KEY and the plaintext data register PTEXT are configured before executing the instruction, and the output value is stored in the ciphertext data register CTEXT;
G2F instruction, carrying out Galois encryption operation, confirming that the domain operation result register GF and the encryption KEY register KEY are configured before executing the instruction, and storing the output value in the domain operation result register GF;
an INV instruction which performs reverse operation and is provided with four modes, namely byte level inversion, word level inversion, double word level inversion and full inversion;
An ADD instruction performs addition operation, uses a 32-bit adder to complete 128bits addition operation, inputs and outputs the ADD instruction into a special register or a general register, and inputs the ADD instruction further comprise a selected bit constant value, the ADD instruction is input into 2 registers, and the ADD instruction is output into 1 register;
a DMA instruction for carrying external data and completing bidirectional data carrying operation from the SRAM to the general register;
MOV instructions, carrying out data transfer between registers, transferring data into registers, inputting the data into a constant, a general purpose register or a special purpose register, and outputting the data into the general purpose register or the special purpose register.
The invention also provides a programmable AES hardware accelerator operation method, which is realized by adopting the accelerator, and comprises the following steps:
Step 1, judging whether the AES encryption or decryption operation of the current round is finished, if not, executing step 2, otherwise, ending the running of the current round;
step 2, writing the received new instruction into an instruction stack;
Step 3, the lowest instruction in the instruction stack is popped off;
step 4, decoding the popped instruction, and distributing the decoded instruction to a computing module or a carrying module for processing;
And 5, waiting for the processing in the step 4 to be completed, checking whether the instruction stack is empty, ending the operation if the instruction stack is empty, and otherwise, returning to the step 1.
The beneficial effects are that:
1. the invention improves the AES encryption speed and obviously accelerates the data processing compared with a pure software scheme.
2. The invention reduces the hardware cost and realizes the balance of speed and cost by combining hardware acceleration and software control.
3. The invention reduces the load of CPU and uses DMA to carry high-efficiency instruction.
4. The invention improves the flexibility of the system and supports two instruction input modes of CPU and DMA.
5. The invention optimizes the energy utilization rate and reduces the system power consumption through accurate configuration and high-efficiency data interaction.
Drawings
The foregoing and/or other advantages of the invention will become more apparent from the following detailed description of the invention when taken in conjunction with the accompanying drawings and detailed description.
Fig. 1 is a schematic diagram of the general working principle of a programmable AES module.
Fig. 2 is a schematic diagram of the overall architecture of the AES hardware accelerator proposed by the present invention.
Fig. 3 is a schematic diagram of the overall operation flow of the AES hardware accelerator proposed by the present invention.
Fig. 4 is a schematic flow chart of CBC encryption by using the AES hardware accelerator proposed by the present invention.
Fig. 5 is a schematic flow chart of GCM encryption by using the AES hardware accelerator proposed by the present invention.
Detailed Description
The invention has the design concept that an AES hardware accelerator performs instruction pre-filling on AES through a CPU, and when the instruction is about to run to be completed, the CPU is triggered to continue filling the instruction, so that the whole AES operation is not interrupted to the CPU so as to ensure the working efficiency of the CPU greatly as long as the instruction length is reasonable.
The invention realizes AES encryption of large-scale data by cooperating with the CPU. The accelerator combines the high speed of hardware acceleration and the low cost of software encryption, supports two instruction input modes of CPU and DMA, and improves the system efficiency and flexibility. The AES module is in data interaction with other system components through the AHB bus, reduces the CPU burden through automatic interrupt and DMA, optimizes the encryption processing process, and is suitable for high-efficiency and safe data processing scenes.
And DMA is adopted to carry instructions, so that the burden of a CPU is reduced, and the CPU can be focused on other control tasks, thereby optimizing the system performance and energy efficiency. The method supports two instruction input modes of CPU and DMA, provides flexibility and adaptability, and meets the requirements of different application scenes.
The invention completes the AES encryption process of large-scale data through linkage with the CPU. The hardware encryption method has the advantages of high encryption speed of the pure hardware AES hardware accelerator and low hardware cost of software encryption, and simultaneously has the advantages of taking the speed and the area into consideration, and liberating the CPU to complete some other control work, so that the whole system can be completed more efficiently.
The specific technical scheme of the invention is as follows:
The location and operation principle of the programmable AES module in the overall system is shown in fig. 1. In the whole system, an AES module, DMA, CPU, FLASH modules, SRAM modules and the like interact data through an AHB (ADVANCED HIGH-performance Bus) Bus to form a complete communication framework.
When the AES module starts to work, the CPU firstly configures registers of the AES, and the working flow of the AES is started.
After configuration is completed, the system writes the processing instructions to the AES instruction stack. This operation may be done by a CPU or DMA, while instructions are typically stored in SRAM or FLASH of the system.
If a CPU is used to write instructions, the AES module issues an interrupt signal to the CPU when only the last instruction remains in the instruction stack. After receiving the interrupt signal, the CPU quickly writes a new instruction into the instruction stack to ensure that the stack is kept in a full-load state. The interrupt mechanism ensures the timely transmission and processing of the instruction and avoids the influence of the instruction stack on the operation efficiency of the AES module due to the empty state.
Another way is to use general-purpose DMA as the medium for instruction transmission. The general DMA is first preconfigured and then the general DMA is started. When the instruction stack of AES is not full, AES issues a request signal (req request) to the general DMA. After receiving the request signal, the general DMA carries instructions from FLASH or SRAM and writes the instructions into the instruction stack of AES. While the AES is processing an existing instruction, the generic DMA continues to load a new instruction into the AES' instruction stack. In this process, the AES module processes the loaded instruction and the received new instruction in parallel until the AES has completed all the work in the stack and the DMA has also completed all the instruction handling work, all the operations at this stage not counting really finished.
Such a programmable AES encryption module has a number of significant advantages. Firstly, the DMA is used for transmitting the instruction, so that the work load of a CPU is greatly reduced, and the overall operation efficiency of the system is improved. DMA can carry instructions fast and efficiently, and avoid instruction loading becoming a system bottleneck. And secondly, an automatic interrupt mechanism ensures that the instruction can be updated in time when the CPU is used for writing the instruction, and ensures that an AES instruction stack is always in a full-load state, thereby improving the response speed of the system. In addition, the design supports two instruction input modes of a CPU and a DMA, provides great flexibility, can be flexibly switched under different application scenes, and has stronger adaptability. By configuring the register, the working state of the AES module can be effectively managed, resources can be used as required, the energy utilization rate is improved, and the system power consumption is reduced. Finally, the AES module performs data interaction with other system components (such as CPU, DMA, FLASH, SRAM) through the AHB bus, so as to form an efficient cooperative mechanism, and ensure high performance of the system in encryption or decryption tasks. In general, the design not only improves the working efficiency of the AES encryption module, but also enhances the flexibility and adaptability of the system, and is suitable for various scenes needing efficient and safe data processing.
Fig. 2 depicts the internal architecture of an Advanced Encryption Standard (AES) encryption and decryption hardware design proposed by the present invention. The architecture in the illustration includes several main parts, each with its own unique functions and roles to ensure efficient operation of the entire AES system.
First is the AHB SLV (AHB Slave), which is a Slave (Slave) that communicates with other modules on the advanced high-performance bus (AHB). The AHB SLV receives instructions and data from an AHB master (AHB MST) and transmits the instructions to a decoder through an instruction stack. In addition, the AHB SLV may also directly transfer data to a computing module or other data path that needs to be processed.
The status register is another key component for storing the current status of the AES encryptor. The status register can record the progress of the current operation and whether the system is operating normally. This is critical to fault recovery and system stability.
The decoder is the next most important component responsible for decoding the instructions received from the AHB SLV and distributing them to the corresponding modules. The presence of the decoder allows the AES system to flexibly handle various operation requests from the master device, such as encryption, decryption, data handling, etc.
The computing module comprises a plurality of sub-modules, each sub-module realizing a specific computing function:
An inverse operation module for performing an inverse transformation step in the AES algorithm. The inversion of data input and output is realized by using an inverse operation module INV, and the data inversion modes are four modes, namely bit byte level inversion, word level inversion, double word level inversion and full inversion.
AES CORE block, performing the CORE operation steps of AES encryption and decryption, including byte substitution, row shifting, column confusion, and round key addition. When encrypting and decrypting, the data of IV, KEY, PTEXT and the like need to be configured in advance.
G2f—galois field operation module for multiplication over a finite field, which is part of the AES algorithm. The calculation result is put in the dedicated register GF.
XOR-XOR operation module for performing an exclusive-or operation, which is an indispensable step in the AES algorithm.
The ADD-ADD module, although primarily arithmetic in the AES algorithm, may be extended for other purposes as well.
DMA-the dedicated DMA module is only used to handle data in SRAM, mainly to handle SRAM data into dedicated and general purpose registers.
MOV: private and general register data are handled with respect to each other.
The handling module is responsible for data transfer between the different computing modules and registers. It ensures that data can flow smoothly and efficiently between different calculation steps. This is a critical part of ensuring efficient operation of the system.
The dedicated registers and the general purpose registers together constitute the memory architecture of the AES system. The special purpose registers store specific encrypted and decrypted data, including Initialization Vector (IV), encryption KEY (KEY), plaintext data (PTEXT), ciphertext data (CTEXT), and the like. General purpose registers are used to store conventional data, such as reg_a (128 bits), reg_b (128 bits), and reg_c (128 bits), which are used to store temporary calculation results or other auxiliary data.
The main equipment is used for receiving and transmitting data of the carrying instruction. The transmission and reception of data can be actively controlled through the built-in main equipment in the AES system, so that the AES system has higher operation flexibility. In addition, the master device is focused on data transmission, the slave device is focused on instruction transceiving of AES, and the transmission is simpler and more efficient through a mode of separating the instruction and the data. The benefits of this design are mainly manifested in the following aspects:
1. And in the modular design, each computing module and each special module are mutually independent and are respectively responsible for different tasks, so that the design is easy to test and maintain. If a certain module fails, only the module needs to be debugged and repaired without affecting the whole system.
2. And the use of the handling module and the DMA module greatly improves the data transmission speed and reduces the processing time. This is particularly important for application scenarios where large amounts of data encryption and decryption are required.
3. And flexible instruction processing, namely, tasks can be flexibly distributed according to different instructions through the decoder, so that the system can efficiently process different types of operation requests. This flexibility enables the system to accommodate varying application requirements.
4. Parallel processing capability, that is, a plurality of operation modules can simultaneously perform operations of different steps, thereby improving the overall processing speed. Parallel processing capability is particularly important, especially in situations where large amounts of data need to be processed quickly.
In addition, although the aes_core and G2F operations can be performed using the basic operations such as exclusive or and addition, if the method is used, the number of instructions increases dramatically and the encryption time increases significantly, so that the aes_core and G2F operations are fully hardware-implemented and are a compromise between area and speed.
As shown in fig. 3, an operation method is designed for the programmable AES hardware accelerator of the foregoing design. The method starts with a flow that first checks if the current AES operation has been completed. If not, the system writes a new instruction into the instruction stack and pops the next instruction in the instruction stack. And then, decoding the popped instruction and distributing the popped instruction to corresponding hardware resources for processing. After waiting for the current operation to complete, it is checked again whether the instruction stack is empty. If the instruction stack is not empty, the steps are continuously and circularly executed until all the instructions are executed. The process ensures that the AES encryption module can continuously and efficiently load, decode and execute the instructions, and simultaneously ensures the order and the integrity of the instruction execution.
The invention also provides a set of instruction sets, which are applied to the programmable AES hardware accelerator designed as described above, as shown in Table 1:
table 1 programmable AES hardware accelerator instruction set table
Examples:
Since AES today has multiple derived forms, such as ECB, CBC, CTR, CCM, ECM and GMAC modes, each with its own fixed operation, it is necessary to write instructions separately for one particular mode.
As shown in fig. 4, CBC encryption using the AES hardware accelerator described above is exemplified as follows:
1. configuring external general DMA handling data into registers such as PTET, IV and KEY;
2. XOR PTEXT and IV using an XOR instruction and store the value in PTEXT. 3. Get final data using the AES_CORE instruction put in CTEXT;
4. data is carried into the SRAM for storage by using a DMA command CTEXT;
5. carrying CTEXT data into the IV using the MOV instruction;
6. repeating the steps of 2-5 until all the steps are finished;
As shown in fig. 5, GCM encryption using the AES hardware accelerator described above is exemplified as follows:
1. configuring external general DMA handling data into registers such as PTET, IV and KEY;
2. obtaining final data by using AES_CORE operation, and putting the final data into CTEXT;
3. using the MOV instruction to carry CTEXT data into the H special register;
4. the MOV instruction is used to move the value of the data register reg_a into the GF special register; 5, using G2F instruction to make Galois operation, storing the result into GF special register;
6. The data REG_A and the data 1 are added by using an ADD instruction to finally put the result in REG_A, 7. Repeating the steps 4-6 to finish HEADER PHASE;
8. move 2 into reg_a using MOV instruction;
9. Placing the IV and reg_a addition into the IV using the ADD instruction;
10. performing AES operation by using an AES_CORE instruction;
11. Using a DMA instruction to carry plaintext into PTEXT;
12. data CTEXT and PTEXT are exclusive-ored using an XOR command with CTEXT;13. Use DMA instructions to transfer plaintext CTEXT into SRAM;
14. xoring GF and CTEXT with an XOR instruction into a GF register;
15. Starting an operation using a G2F instruction;
16. placing the IV and 1 addition result into the IV using the ADD instruction;
17. Repeating the 10-16 instruction until the Payload Phase-related operation is completed;
18. Xoring GF and CTEXT with an XOR instruction into a GF register;
19. Starting an operation using a G2F instruction;
20. using a DMA instruction to transfer the original IV into an IV special register;
21. Performing AES operation by using an AES_CORE instruction;
22. The XOR result of GF and CTEXT is put into a TAG register by using an XOR instruction;
23. Directly carrying out TAG to the SRAM by using a DMA instruction to complete FINAL PHASE operations;
In a specific implementation, the present application provides a computer storage medium and a corresponding data processing unit, where the computer storage medium is capable of storing a computer program, where the computer program when executed by the data processing unit may perform part or all of the steps of the application, and the content of a programmable AES encryption module hardware accelerator, an instruction set, and an operation method provided by the present application. The storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), a random-access memory (random access memory, RAM), or the like.
It will be apparent to those skilled in the art that the technical solutions in the embodiments of the present invention may be implemented by means of a computer program and its corresponding general hardware platform. Based on such understanding, the technical solutions in the embodiments of the present invention may be embodied essentially or in the form of a computer program, i.e. a software product, which may be stored in a storage medium, and include several instructions to cause a device (which may be a personal computer, a server, a single-chip microcomputer, an MCU or a network device, etc.) including a data processing unit to perform the methods described in the embodiments or some parts of the embodiments of the present invention.
The invention provides a hardware accelerator, an instruction set and an operating method of a programmable AES encryption module, and a method for realizing the technical scheme, wherein the method and the way are a plurality of preferred embodiments of the invention, and it should be pointed out that a plurality of improvements and modifications can be made by those skilled in the art without departing from the principle of the invention, and the improvements and the modifications are also considered as the protection scope of the invention. The components not explicitly described in this embodiment can be implemented by using the prior art.

Claims (10)

1.一种可编程AES加密模块硬件加速器,其特征在于,所述加速器与总线连接,与所述总线进行数据交互,并对所述数据进行AES加密和解密,所述加速器包括:1. A programmable AES encryption module hardware accelerator, characterized in that the accelerator is connected to a bus, exchanges data with the bus, and performs AES encryption and decryption on the data, and the accelerator comprises: 与所述总线连接的主设备和从设备,其中,所述主设备用于数据搬运指令的收发;所述从设备,与所述总线上的其他模块进行通信,并接收所述主设备的数据搬运指令和数据。A master device and a slave device connected to the bus, wherein the master device is used to send and receive data transfer instructions; the slave device communicates with other modules on the bus and receives the data transfer instructions and data from the master device. 2.根据权利要求1所述的一种可编程AES加密模块硬件加速器,其特征在于,所述加速器还包括:指令栈和译码器,2. A programmable AES encryption module hardware accelerator according to claim 1, characterized in that the accelerator further comprises: an instruction stack and a decoder, 所述从设备通过指令栈与译码器连接,将其指令传输给所述译码器。The slave device is connected to the decoder via an instruction stack and transmits its instructions to the decoder. 3.根据权利要求2所述的一种可编程AES加密模块硬件加速器,其特征在于,所述加速器还包括:计算模块和搬运模块,3. A programmable AES encryption module hardware accelerator according to claim 2, characterized in that the accelerator further comprises: a computing module and a transport module, 所述译码器对从所述从设备传输来的指令进行解码,并将解码后的指令发送给与其连接的计算模块或搬运模块;The decoder decodes the instruction transmitted from the slave device and sends the decoded instruction to the computing module or the transport module connected thereto; 所述计算模块,用于根据指令选择不同的计算子模块进行对应的运算;The computing module is used to select different computing submodules to perform corresponding operations according to the instructions; 所述搬运模块,用于根据所述主设备发出的数据搬运指令,对计算模块和寄存器中的数据进行传输。The transport module is used to transfer data in the calculation module and the register according to the data transport instruction issued by the main device. 4.根据权利要求3所述的一种可编程AES加密模块硬件加速器,其特征在于,所述加速器还包括:寄存器,4. A programmable AES encryption module hardware accelerator according to claim 3, characterized in that the accelerator further comprises: a register, 所述寄存器,用于存储所述加速器中的数据。The register is used to store data in the accelerator. 5.根据权利要求4所述的一种可编程AES加密模块硬件加速器,其特征在于,所述寄存器,包括:5. A programmable AES encryption module hardware accelerator according to claim 4, characterized in that the register comprises: 专用寄存器和通用寄存器,其中,Special registers and general registers, among which, 所述专用寄存器,用于存放特定的加密和解密数据;The dedicated register is used to store specific encryption and decryption data; 所述通用寄存器,用于存储常规数据,包括中间计算结果和辅助数据;The general register is used to store conventional data, including intermediate calculation results and auxiliary data; 其中,所述专用寄存器,包括,域运算结果寄存器GF、验证信息结果寄存器TAG、初始化向量寄存器IV、密钥寄存器H、加密密钥寄存器KEY、明文数据寄存器PTEXT、密文数据寄存器CTEXT。The dedicated registers include a domain operation result register GF, a verification information result register TAG, an initialization vector register IV, a key register H, an encryption key register KEY, a plaintext data register PTEXT, and a ciphertext data register CTEXT. 6.根据权利要求5所述的一种可编程AES加密模块硬件加速器,其特征在于,所述寄存器,还包括:6. A programmable AES encryption module hardware accelerator according to claim 5, characterized in that the register further comprises: 与所述从设备连接的状态寄存器,用于存储所述加速器的当前状态。A status register connected to the slave device is used to store the current status of the accelerator. 7.根据权利要求6所述的一种可编程AES加密模块硬件加速器,其特征在于,所述计算子模块,包括:7. A programmable AES encryption module hardware accelerator according to claim 6, characterized in that the computing submodule comprises: 逆运算子模块INV,用于执行AES加密和解密过程中的逆变换步骤;逆运算子模块INV进行反相的方式有四种模式,分别为byte级反相,word级反相,doubleword级反相以及全反相;The inverse operation submodule INV is used to perform the inverse transformation step in the AES encryption and decryption process; the inverse operation submodule INV has four modes of inversion, namely byte-level inversion, word-level inversion, doubleword-level inversion and full inversion; AES核心子模块AES_CORE,用于执行AES加密和解密的核心运算步骤,包括,字节替代、行移位、列混淆和轮密钥加;AES core submodule AES_CORE is used to perform the core operation steps of AES encryption and decryption, including byte substitution, row shift, column confusion and round key addition; Galois域运算子模块G2F,用于在有限域上的乘法运算,计算结果放入在域运算结果寄存器GF中;The Galois field operator G2F is used for multiplication operations on finite fields, and the calculation results are placed in the field operation result register GF; 异或运算子模块XOR,用于执行异或运算;XOR operation submodule XOR, used to perform XOR operation; 加法运算子模块ADD,用于进行加法运算;The addition operation submodule ADD is used to perform addition operation; 专用DMA子模块DMA,只用于将SRAM中的数据搬运到专用寄存器和通用寄存器中;The dedicated DMA submodule DMA is only used to move data in SRAM to dedicated registers and general registers; 搬运子模块MOV,用于专用寄存器和通用寄存器中数据的相互搬运。The transfer submodule MOV is used to transfer data between special registers and general registers. 8.根据权利要求7所述的一种可编程AES加密模块硬件加速器,其特征在于,所述总线、主设备和从设备为AHB总线、AHB主设备和AHB从设备。8. A programmable AES encryption module hardware accelerator according to claim 7, characterized in that the bus, master device and slave device are an AHB bus, an AHB master device and an AHB slave device. 9.一种可编程AES加密模块硬件加速器指令集,其特征在于,用于控制权利要求1至8中任一所述的加速器中的计算模块进行相关计算,所述指令集包括:9. A programmable AES encryption module hardware accelerator instruction set, characterized in that it is used to control the computing module in the accelerator described in any one of claims 1 to 8 to perform related calculations, and the instruction set includes: XOR指令,进行异或操作,输入和输出为专用寄存器或者通用寄存器,输入为2个寄存器,输出为1个寄存器;XOR instruction, performs exclusive OR operation, the input and output are special registers or general registers, the input is 2 registers, and the output is 1 register; AES_CORE指令,进行AES加密或解密操作,执行该指令前确认初始化向量寄存器IV、加密密钥寄存器KEY和明文数据寄存器PTEXT完成配置,输出值存储在密文数据寄存器CTEXT中;运行前指定为加密或解密模式;AES_CORE instruction, performs AES encryption or decryption operation. Before executing this instruction, confirm that the initialization vector register IV, encryption key register KEY and plaintext data register PTEXT are configured, and the output value is stored in the ciphertext data register CTEXT; specify encryption or decryption mode before running; G2F指令,进行Galois加密操作,执行该指令前确认域运算结果寄存器GF和加密密钥寄存器KEY完成配置,输出值存储在域运算结果寄存器GF中;G2F instruction, performs Galois encryption operation. Before executing this instruction, confirm that the domain operation result register GF and the encryption key register KEY have been configured. The output value is stored in the domain operation result register GF. INV指令,进行反向操作,设有四种模式,分别为byte字节级反相、word字级反相、double word双字级反相和全反相;The INV instruction performs reverse operation and has four modes: byte-level inversion, word-level inversion, double word-level inversion, and full inversion. ADD指令,进行加法操作,使用32位加法器完成128bits加法运算,输入和输出为专用寄存器或者通用寄存器,输入中还包括选择位常数值,输入为2个寄存器,输出为1个寄存器;ADD instruction performs addition operation, using a 32-bit adder to complete 128-bit addition operation. The input and output are special registers or general registers. The input also includes a selection bit constant value. The input is 2 registers and the output is 1 register. DMA指令,进行外部数据搬运,完成从SRAM到所述通用寄存器的双向数据搬运操作;DMA instruction, to carry out external data transfer, to complete the bidirectional data transfer operation from SRAM to the general register; MOV指令,进行寄存器间数据搬运,将数据搬运到寄存器中,输入为常数、通用寄存器或专用寄存器,输出为通用寄存器或专用寄存器。The MOV instruction moves data between registers. The data is moved to a register. The input is a constant, a general register, or a special register. The output is a general register or a special register. 10.一种可编程AES加密模块硬件加速器运行方法,其特征在于,采用权利要求1至8中任一所述加速器实现,所述方法包括:10. A method for operating a programmable AES encryption module hardware accelerator, characterized in that it is implemented by using any one of the accelerators in claims 1 to 8, and the method comprises: 步骤1,判断当前轮次AES加密或解密操作是否已经完成,若未完成,则执行步骤2,否则结束当前轮次运行;Step 1: Determine whether the current round of AES encryption or decryption operation has been completed. If not, execute step 2; otherwise, terminate the current round of operation. 步骤2,将接收到的新指令写入指令栈中;Step 2, write the received new instruction into the instruction stack; 步骤3,使指令栈中的最下一条指令出栈;Step 3, pop the last instruction in the instruction stack; 步骤4,对出栈的指令进行译码,并分配给计算模块或搬运模进行处理;Step 4, decode the popped instruction and assign it to the computing module or the transport module for processing; 步骤5,等待步骤4中所述处理完成,检查指令栈是否为空,若为空,则结束运行,否则返回执行步骤1。Step 5, wait for the processing described in step 4 to be completed, check whether the instruction stack is empty, if it is empty, end the operation, otherwise return to execute step 1.
CN202411537198.7A 2024-10-31 2024-10-31 A programmable AES encryption module hardware accelerator, instruction set and operation method Pending CN119475380A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202411537198.7A CN119475380A (en) 2024-10-31 2024-10-31 A programmable AES encryption module hardware accelerator, instruction set and operation method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202411537198.7A CN119475380A (en) 2024-10-31 2024-10-31 A programmable AES encryption module hardware accelerator, instruction set and operation method

Publications (1)

Publication Number Publication Date
CN119475380A true CN119475380A (en) 2025-02-18

Family

ID=94572500

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202411537198.7A Pending CN119475380A (en) 2024-10-31 2024-10-31 A programmable AES encryption module hardware accelerator, instruction set and operation method

Country Status (1)

Country Link
CN (1) CN119475380A (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1898896A (en) * 2001-12-18 2007-01-17 阿纳洛格装置公司 Programmable data encryption engine for advanced encryption standard algorithm
CN202257543U (en) * 2011-05-26 2012-05-30 山东大学 Instruction optimization processor aiming at advanced encryption standard (AES) symmetry encrypting program
CN107133018A (en) * 2011-12-22 2017-09-05 英特尔公司 Perform the instruction of GROESTL hash
CN108134665A (en) * 2017-12-20 2018-06-08 东南大学 A kind of 8 bit A ES circuits applied towards IoT
CN112713993A (en) * 2020-12-24 2021-04-27 天津国芯科技有限公司 Encryption algorithm module accelerator and high-speed data encryption method
CN115549911A (en) * 2022-11-28 2022-12-30 苏州浪潮智能科技有限公司 An encryption and decryption architecture, method, processor and server

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1898896A (en) * 2001-12-18 2007-01-17 阿纳洛格装置公司 Programmable data encryption engine for advanced encryption standard algorithm
CN202257543U (en) * 2011-05-26 2012-05-30 山东大学 Instruction optimization processor aiming at advanced encryption standard (AES) symmetry encrypting program
CN107133018A (en) * 2011-12-22 2017-09-05 英特尔公司 Perform the instruction of GROESTL hash
CN108134665A (en) * 2017-12-20 2018-06-08 东南大学 A kind of 8 bit A ES circuits applied towards IoT
CN112713993A (en) * 2020-12-24 2021-04-27 天津国芯科技有限公司 Encryption algorithm module accelerator and high-speed data encryption method
CN115549911A (en) * 2022-11-28 2022-12-30 苏州浪潮智能科技有限公司 An encryption and decryption architecture, method, processor and server

Similar Documents

Publication Publication Date Title
US11405179B2 (en) Multimode cryptographic processor
JP3789454B2 (en) Stream processor with cryptographic coprocessor
US20220198027A1 (en) Storage encryption using converged cryptographic engine
US12316735B2 (en) Technologies for memory and I/O efficient operations on homomorphically encrypted data
CN104126174B (en) Instructions to perform GROESTL hashing
CN110688157A (en) Computing device and computing method
US6920562B1 (en) Tightly coupled software protocol decode with hardware data encryption
CN101201811B (en) Encryption-decryption coprocessor for SOC
US20050259823A1 (en) Security system with an intelligent dma controller
WO2024114264A1 (en) Encryption and decryption architecture, method, processor, and server
US11516013B2 (en) Accelerator for encrypting or decrypting confidential data with additional authentication data
KR20220078155A (en) Crypto processor and method for operating the same, and electronic device including the same
CN102521535A (en) Information safety coprocessor for performing relevant operation by using specific instruction set
CN119885247B (en) Data query method, system, device, medium and program product
EP4016358A1 (en) Storage encryption using converged cryptographic engine
WO2024033168A1 (en) Hardware-based galois multiplication
CN118798376A (en) Efficient storage architecture based on quantum-resistant encryption algorithm
CN112256633A (en) An instruction-driven commercial cryptographic special-purpose processor system
US20060059221A1 (en) Multiply instructions for modular exponentiation
CN106933510A (en) A kind of storage control
CN119475380A (en) A programmable AES encryption module hardware accelerator, instruction set and operation method
WO2012078378A2 (en) Enhancing performance by instruction interleaving and/or concurrent processing of multiple buffers
CN110034918B (en) SM4 acceleration method and device
JP5353828B2 (en) Processor and processor system
CN118363925A (en) Encryption and decryption circuit, method and SOC system supporting multi-algorithm and multi-grouping mode

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载