Hardware acceleration method of elliptic curve addition group and related device

By merging and splitting tasks and processing elliptic curve addition group operations in parallel, it solves the problem of insufficient bit width of existing hardware modules and improves computing efficiency and resource utilization.

CN118819640AActive Publication Date: 2024-10-22ZHONGHAO XINYING (HANGZHOU) TECHNOLOGY CO LTD

Patent Information

Application Number
CN202411267730.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-11
Publication Date
2024-10-22
Estimated Expiration
2044-09-11

AI Technical Summary

Technical Problem

The existing elliptic curve addition group hardware module has insufficient bit width and cannot meet the processing needs of modern encryption algorithms, resulting in excessive computing resources and affecting computing efficiency.

Method used

The PADD and PDBL tasks are merged into target acceleration tasks and split into multiple subtasks. Through parallel processing by multiple hardware processing units in the computing core module, the elliptic curve addition group operation is optimized.

Benefits of technology

It improves the utilization of hardware resources, improves the efficiency and processing power of elliptic curve addition group operations, has flexibility and scalability, and solves the problem of insufficient bit width.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118819640A_ABST
    Figure CN118819640A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a hardware acceleration method of an elliptic curve addition group and a related device, and belongs to the field of hardware acceleration. The method comprises the steps of combining a PADD task to be processed and a PDBL task to be processed into a target acceleration task; splitting the target acceleration task into a plurality of sub-tasks; the plurality of subtasks are respectively used for executing hardware acceleration of different types of task objects in the target acceleration task; processing a plurality of subtasks through a calculation core module in the hardware acceleration system so as to realize hardware acceleration of various elliptic curve addition group operations; the computing core module comprises a plurality of hardware processing units which can be scheduled in parallel, and each hardware processing unit is used for executing operation acceleration of a corresponding task type. Based on hardware acceleration of the calculation core module, task optimization of the elliptic curve addition group is realized, the utilization rate of hardware resources is improved, the efficiency and the processing capability of elliptic curve addition group operation are improved, and the method has the flexibility and the expandability of a hardware acceleration system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of hardware acceleration, and in particular to a hardware acceleration method for an elliptic curve addition group and a related device. Background Art

[0002] The elliptic curve addition group is a mathematical structure used to describe the addition operation of points on an elliptic curve. This structure has important applications in modern cryptography, especially in the fields of public key encryption and digital signatures. The mathematical basis and structure of the elliptic curve addition group give it advantages in security, efficiency and resource utilization, and it is an important encryption technology in modern cryptography.

[0003] In the related art, the hardware modules of the elliptic curve addition group are mainly targeted at 32-bit or 64-bit prime number fields. These bit widths are difficult to meet the current growing data encryption needs. For example, the elliptic curves used in modern encryption algorithms (such as BLS12-381, BLS12-377) need to process bit widths that far exceed the processing capabilities of these existing technologies, limiting the practical application of such hardware modules in processing high-security encryption tasks. It is understandable that the security provided by smaller bit widths (such as 32 bits or 64 bits) is not enough to cope with modern computing power and attack techniques. The encryption strength is generally proportional to the bit width. The larger the bit width, the greater the amount of computation required to crack it. Modern encryption standards generally use larger bit widths, such as 256 bits, 384 bits or higher, to ensure higher security.

[0004] However, in the related art, large bit-width elliptic curves involve more complex mathematical operations, such as addition, multiplication, and modulo of large integers. Simply expanding the bit-width processing power will consume a lot of computing resources, resulting in many devices being unable to efficiently run these algorithms. This is because directly expanding the bit-width means more storage and computing resources, and the hardware resources of many devices are insufficient, so larger memory and cache are needed to store this data, which increases the burden on the storage system and computing resources.

[0005] Therefore, a technical solution is urgently needed to solve at least one of the above technical problems. Summary of the invention

[0006] The main purpose of the embodiments of the present invention is to provide a hardware acceleration method and related devices for an elliptic curve additive group, aiming to solve the problem in the related technology that the bit width is difficult to meet the current growing data processing needs, the storage system and computing resources are overloaded, and the efficiency of elliptic curve additive group operations is affected.

[0007] In a first aspect, an embodiment of the present invention provides a hardware acceleration method, which is applied to a hardware acceleration system. The method includes: Merge pending PADD tasks and PDBL tasks into target acceleration tasks; Splitting the target acceleration task into a plurality of subtasks; the plurality of subtasks are respectively used to perform hardware acceleration of different types of task objects in the target acceleration task; The computing core module in the hardware acceleration system processes multiple subtasks to achieve hardware acceleration of various elliptic curve addition group operations; the computing core module includes multiple hardware processing units that can be scheduled in parallel, and each hardware processing unit is used to perform computing acceleration of the corresponding task type.

[0008] In a second aspect, an embodiment of the present invention provides a hardware acceleration device, which is applied to a hardware acceleration system, and the device includes: A merging module, used to merge pending PADD tasks and PDBL tasks into a target acceleration task; A splitting module, used for splitting the target acceleration task into a plurality of subtasks; the plurality of subtasks are used for respectively performing hardware acceleration on different types of task objects in the target acceleration task; The acceleration module is used to process multiple subtasks through the computing core module in the hardware acceleration system to achieve hardware acceleration of various elliptic curve addition group operations; the computing core module includes multiple hardware processing units that can be scheduled in parallel, and each hardware processing unit is used to perform computing acceleration of the corresponding task type.

[0009] In a third aspect, an embodiment of the present invention further provides a terminal device, comprising a processor, a memory, a computer program stored in the memory and executable by the processor, and a data bus for realizing connection and communication between the processor and the memory, wherein when the computer program is executed by the processor, the steps of any one of the hardware acceleration methods provided in the specification of the present invention are implemented.

[0010] In a fourth aspect, an embodiment of the present invention further provides a storage medium for computer-readable storage, characterized in that the storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps of any hardware acceleration method provided in the specification of the present invention.

[0011] In a fifth aspect, an embodiment of the present application provides a chip, which includes a processor coupled to a transceiver, and is used to execute the hardware acceleration method for the elliptic curve addition group provided in the first aspect of the embodiment of the present application. In a possible design, the chip can also be a dedicated hardware structure for implementing the hardware acceleration method for the elliptic curve addition group provided in the first aspect above, for example, the processing involving the neural network model can be implemented by a dedicated neural network processor or a graphics processor.

[0012] In a sixth aspect, an embodiment of the present application provides a chip system, which includes a processor for implementing the functions involved in the first aspect above, for example, generating or processing information involved in the hardware acceleration method of the elliptic curve addition group provided in the first aspect above.

[0013] In a possible design, the chip system also includes a memory, which is connected to the processor through a circuit structure. The memory is used to store program instructions and data required by the terminal. The chip system can be composed of chips, or it can include chips and other discrete devices. Further optionally, the chip also includes a communication interface, and the processor is connected to the communication interface. The communication interface is used to receive data and / or information to be processed, the processor obtains the data and / or information from the communication interface, processes the data and / or information, and outputs the processing results through the communication interface. The communication interface can be an input and output interface.

[0014] The embodiment of the present invention provides a hardware acceleration method and related device for elliptic curve addition group, which merges the PADD task and PDBL task to be processed into a target acceleration task; splits the target acceleration task into multiple subtasks; the multiple subtasks are respectively used to perform hardware acceleration of different types of task objects in the target acceleration task; the multiple subtasks are processed by the computing core module in the hardware acceleration system to achieve hardware acceleration of multiple elliptic curve addition group operations; the computing core module includes multiple hardware processing units that can be scheduled in parallel, and each hardware processing unit is used to perform operation acceleration of the corresponding task type. This solution can rely on the hardware acceleration of the computing core module to achieve task optimization of the elliptic curve addition group, improve the utilization rate of hardware resources, enhance the efficiency and processing power of the elliptic curve addition group operation, and have the flexibility and scalability of the hardware acceleration system. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0016] Figure 1 A schematic diagram of a flow chart of a hardware acceleration method for an elliptic curve addition group provided in an embodiment of the present invention; Figure 2 A schematic diagram of the principle of a hardware acceleration method for an elliptic curve addition group provided by an embodiment of the present invention; Figure 3 A schematic diagram of the structure of a core computing module provided for implementing this embodiment; Figure 4 A schematic diagram of the principle of a core computing module provided for implementing this embodiment; Figure 5 A schematic diagram of the module structure of a hardware acceleration device for an elliptic curve addition group provided by an embodiment of the present invention; Figure 6 A schematic block diagram of the structure of a terminal device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0017] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0018] The flowcharts shown in the accompanying drawings are only examples and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may also be decomposed, combined or partially merged, so the actual execution order may change according to actual conditions.

[0019] It should be understood that the terms used in this specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the specification of the present invention and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.

[0020] The elliptic curve additive group is a mathematical structure used to describe the addition operation of points on an elliptic curve. This structure has important applications in modern cryptography, especially in the fields of public key encryption and digital signatures. Since the addition operation on an elliptic curve is relatively simple, but its inverse operation (i.e. doubling of points) is computationally complex, it is possible to design computationally difficult discrete logarithm problems, which are very important in encryption protocols. For example, elliptic curve cryptography (ECC) implements encryption and signature algorithms based on the mathematical properties of this additive group. The mathematical foundation and structure of the elliptic curve additive group give it advantages in security, efficiency, and resource utilization, and it is an important encryption technology in modern cryptography.

[0021] In the prior art, the hardware modules of the elliptic curve addition group are mainly targeted at 32-bit or 64-bit prime number fields. These bit widths are difficult to meet the current growing demand for data encryption. For example, the bit widths that need to be processed by the elliptic curves used in modern encryption algorithms (such as BLS12-381, BLS12-377) far exceed the processing capabilities of these prior arts, limiting the practical application of such hardware modules in processing high-security encryption tasks. In addition, the security provided by smaller bit widths (such as 32 or 64 bits) is not sufficient to cope with modern computing power and attack techniques. The encryption strength is usually proportional to the bit width. The larger the bit width, the greater the amount of computation required to crack it. Modern encryption standards usually use larger bit widths, such as 256 bits, 384 bits or higher, to ensure higher security.

[0022] However, in the prior art, large-bit-width elliptic curves involve more complex mathematical operations, such as addition, multiplication, and modulo of large integers. Simply expanding the bit-width processing power will consume a large amount of computing resources, resulting in many devices being unable to efficiently run these algorithms. This is because directly expanding the bit-width means more storage and computing resources, and the hardware resources of many devices are insufficient, so larger memory and cache are needed to store this data, which increases the burden on the storage system and computing resources.

[0023] Therefore, a technical solution is urgently needed to solve at least one of the above technical problems.

[0024] In view of the above technical problems, an embodiment of the present invention provides a hardware acceleration method and related device for an elliptic curve addition group. The hardware acceleration method can be applied to an electronic component or device, and the device can be a terminal device, such as a tablet computer, a laptop computer, a desktop computer, a personal digital assistant, a wearable device, and other electronic devices. The electronic component can be a chip or an electronic circuit unit mounted in the terminal device. The terminal device can be a server or a server cluster.

[0025] Some embodiments of the present invention are described in detail below in conjunction with the accompanying drawings. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.

[0026] Please refer to Figure 1 , Figure 1 A flowchart of a hardware acceleration method provided by an embodiment of the present invention.

[0027] like Figure 1 As shown, the hardware acceleration method includes steps S101 to S103.

[0028] Step S101: merging the PADD task and the PDBL task to be processed into a target acceleration task.

[0029] Step S102: split the target acceleration task into multiple subtasks.

[0030] In the embodiment of the present application, the multiple subtasks are respectively used to perform hardware acceleration of different types of task objects in the target acceleration task.

[0031] Step S103: Process multiple subtasks through the computing core module in the hardware acceleration system to achieve hardware acceleration of multiple elliptic curve addition group operations.

[0032] In the embodiment of the present application, elliptic curve addition (PADD) and elliptic curve doubling (PDBL) are two basic operations included in the elliptic curve addition group. The following will introduce these two tasks in detail. Elliptic curve addition refers to the addition operation of two points on the elliptic curve, and the result is a new point on the curve. Elliptic curve doubling refers to the addition of a point on the elliptic curve to itself. The doubling operation is usually used as a special case of the addition operation.

[0033] In the embodiment of the present application, the efficiency of elliptic curve addition group operations is improved through hardware acceleration. Elliptic curve addition (PADD) task and elliptic curve doubling (PDBL) task are two basic operations in the elliptic curve addition group. These tasks need to be repeatedly performed in operations such as encryption, decryption, and key exchange. Since PADD and PDBL are essentially point operations, they can be processed uniformly.

[0034] In step S101, multiple PADD tasks (point addition) and PDBL tasks (point doubling) to be processed are first combined into a unified target acceleration task. By merging, the decentralized operation management overhead can be reduced and preparation can be made for subsequent parallel computing. Task scheduling is optimized, tasks of similar types are merged into a whole, task processing speed is accelerated, and resource consumption of context switching is reduced. It can be seen that in step S101, by merging PADD tasks and PDBL tasks, task scheduling is optimized and processing efficiency is improved.

[0035] In an embodiment of the present application, the acceleration of elliptic curve operations depends on the parallel processing of tasks. Exemplarily, the target acceleration tasks include different types of calculations, such as point addition, point doubling, and modular operations. In step S102, the merged target acceleration tasks are split into multiple small subtasks. These subtasks can be split based on different computational properties, for example, subtasks for processing point addition; subtasks for processing point doubling; mathematical subtasks related to modular operations, inverse element calculations, etc. In step S102, by splitting complex computational tasks into multiple independent subtasks, they can be processed in parallel to improve computational efficiency. In addition, this decomposition strategy can more flexibly adapt to the characteristics of the hardware acceleration unit, maximizing resource utilization. In step S102, the merged target task is split into multiple subtasks so that it can be processed in parallel in the hardware acceleration system, further improving the overall computing power.

[0036] In the embodiment of the present application, the hardware acceleration system includes multiple processing cores, which can process tasks in parallel to achieve efficient calculations. In step S103, the computing core module of the hardware acceleration system is responsible for parallel processing of multiple subtasks. The computing core module may include multiple hardware processing units, such as: a computing unit dedicated to elliptic curve operations; a unit dedicated to modular operations; a general processing unit for other necessary calculations. Each hardware processing unit performs a corresponding subtask according to the type of task it is good at. For example, one unit may be responsible for point addition on an elliptic curve, while another unit focuses on doubling operations. By scheduling these hardware units in parallel, multiple subtasks can be processed simultaneously, significantly improving the calculation speed. By making full use of the parallel computing capabilities in the hardware acceleration system, a large number of complex elliptic curve addition group operations can be completed in a short time, improving the performance of the encryption system. In addition, through reasonable task scheduling and allocation, hardware resources can be fully utilized, resource waste can be reduced, and the energy consumption of the system can be reduced. In step S103, multiple subtasks are efficiently executed through the parallel processing core of the hardware acceleration system, hardware resources are fully utilized, computing delays are reduced, and encryption operation performance is improved.

[0037] In the above steps S101 to S103, first, by merging the PADD (elliptic curve addition) task and the PDBL (elliptic curve doubling) task into a target acceleration task, and then splitting it into multiple subtasks for parallel processing, the overall computing efficiency of the elliptic curve addition group operation can be significantly improved. Each subtask can be executed simultaneously in different hardware processing units, thereby shortening the overall computing time. Furthermore, multiple hardware processing units in the computing core module can be scheduled in parallel to meet the processing requirements of different types of tasks. In this way, hardware resources can be more fully utilized and the phenomenon of idle or overloaded processing units due to different task types can be avoided. Finally, the task is split into multiple subtasks and assigned to different processing units, so that the hardware acceleration system has higher flexibility and scalability. In the future, if more types of elliptic curve operations need to be supported, this can be achieved by adding processing units or adjusting the task allocation strategy. Since the computing core module of the hardware acceleration system can process multiple subtasks in parallel, this parallel processing method can significantly reduce computing delays, especially when processing large-scale encryption tasks, faster response times can be obtained. Through hardware acceleration, not only can the processing speed be increased, but also the overall processing capability of the system can be improved when facing complex cryptographic operations, so that it can cope with high-load and high-density computing needs. In summary, the combination of these steps helps to achieve efficient hardware acceleration in elliptic curve addition groups, which is especially suitable for application scenarios that require a lot of computing, such as blockchain, digital signatures, encrypted communications, etc.

[0038] In the embodiment of the present application, the target type matches the type of task pipeline in the computing core module. Specifically, each task pipeline in the computing core module is optimized for a specific type of operation, such as modular multiplication, modular addition, modular subtraction, etc. These pipelines are usually designed according to the characteristics of specific mathematical operations and contain dedicated hardware resources (such as multipliers, adders, etc.) that optimize such operations. When the target type matches the pipeline type, it can ensure that the task runs on the most suitable hardware resources, thereby maximizing the use of hardware resources. For example, the modular multiplication task is assigned to the modular multiplication pipeline, and the hardware structure of this pipeline can perform the modular multiplication operation in the most efficient way, which avoids unnecessary resource waste or inefficiency. Each type of task has its own specific computing mode and resource requirements. Assigning tasks to matching task pipelines can enable the hardware accelerator to achieve the best computing efficiency when executing these tasks. For example, modular multiplication operations are usually more complex than modular addition and modular subtraction, so the modular multiplication task pipeline will be specially designed to be able to handle high-complexity operations. By accurately matching tasks to the corresponding pipeline types, we can ensure that tasks are completed in the shortest possible time, thereby improving the overall computing efficiency of the system. In hardware acceleration systems, if different task types are assigned to inappropriate pipelines for processing, additional computing delays may occur. For example, if a modular multiplication task is assigned to a modular addition pipeline, the pipeline may need to perform additional processing steps (such as data format conversion, additional operations, etc.) to complete the task, resulting in unnecessary delays. By ensuring that the target task type matches the pipeline type, these additional processing steps can be avoided, thereby reducing the overall computing delay.

[0039] In practical applications, in hardware acceleration systems, new task types or hardware modules can be added as needed, as long as their task pipeline types match the new tasks. This modular design allows the system to flexibly respond to different computing needs and is easier to expand in the future. For example, if a new type of task needs to be processed, only the corresponding task pipeline module needs to be added without making major changes to the entire system architecture.

[0040] In this way, matching the target type with the type of task pipeline in the computing core module can optimize hardware resource utilization, improve computing efficiency, reduce computing latency, and enhance system flexibility and scalability. In addition, it can also reduce power consumption and heat generation. This matching design has significant advantages for high-performance computing tasks, especially encryption algorithms (such as ECC) involving complex mathematical operations.

[0041] In the embodiment of the present application, further optionally, the computing core module includes at least a modular multiplication task pipeline for processing modular multiplication operation objects, and the modular multiplication task pipeline includes at least a scheduling module and a modular multiplication computing module. Specifically, the modular multiplication computing module is used to process at least two sets of input data in the same clock unit.

[0042] It is understandable that in the computing core module, the modular multiplication task pipeline is a hardware pipeline specially designed for processing modular multiplication operations. In order to further improve computing efficiency, the modular multiplication computing module can process multiple sets of input data in the same clock unit. By processing two sets of input data in the same clock cycle, the modular multiplication computing module effectively cuts the task processing time in half. Without this parallel processing capability, two clock cycles are required to complete these two tasks. Through parallel processing, not only the computing speed is improved, but also the utilization of the hardware is improved. By implementing the ability to process multiple sets of data in the same clock unit in the modular multiplication computing module, the hardware acceleration system can significantly improve the computing efficiency without increasing the clock frequency. This design enables complex encryption operations to be completed more quickly, thereby improving the performance of the entire system.

[0043] Exemplarily, the modular multiplication task pipeline is a dedicated hardware structure in the hardware accelerator for efficiently performing modular multiplication operations. Modular multiplication operations, i.e., modular multiplication operations, can be applied to cryptographic algorithms (such as RSA, ECC) and other operations involving large integers. The modular multiplication task pipeline can greatly improve the speed and efficiency of modular multiplication operations through pipeline technology and hardware optimization design.

[0044] The specific principle is that pipeline technology is a method of achieving efficient computing by decomposing a computing process into multiple stages, each stage being processed in parallel in different hardware units. Each stage completes a part of the computing process, and all stages work simultaneously, thereby achieving parallel processing of tasks and improving the overall computing throughput. In an embodiment of the present application, in the modular multiplication task pipeline, the modular multiplication operation is decomposed into multiple steps, and each step is processed by a dedicated hardware unit. When the first data starts to operate, subsequent data can enter the initial stage of the pipeline, thereby achieving the effect of parallel processing. In hardware implementation, these steps can be further subdivided into smaller operations, such as partial product generation, partial accumulation addition, carry processing, modulus reduction, etc. The modular multiplication task pipeline includes the following modules: Input module: receives operands that need to be subjected to modular multiplication operations.

[0045] Multiplier: Performs large integer multiplication operations, which is the core part of modular multiplication.

[0046] Modulus processor: performs modulus operations and ensures that the multiplication result is within the given modulus range.

[0047] Scheduling module: responsible for allocating input data to the appropriate pipeline stages and coordinating the work of each stage.

[0048] Register file: used to store intermediate results and ensure that data is correctly passed between various pipeline stages.

[0049] In the embodiment of the present application, the key advantage of the modular multiplication task pipeline lies in its parallel processing capability. By decomposing the modular multiplication operation into multiple stages, each stage can process different operands in the same clock cycle. This parallel processing capability greatly improves the throughput of the pipeline. The depth of the pipeline determines how many stages of operations can be processed simultaneously. Deeper pipelines can handle more complex modular multiplication operations, but may increase latency and hardware complexity. The modular multiplication task pipeline will use a variety of optimization techniques to further improve performance. In this application, a grouping technique is used to decompose a large integer into multiple smaller parts, which are calculated separately and then combined to improve hardware utilization and calculation speed. In addition, a parallel design is used, and multiple pipeline modules work simultaneously to process different modular multiplication tasks and improve throughput. In addition, in the embodiment of the present application, unnecessary pipeline stages are turned off under certain conditions to save power consumption.

[0050] In fact, modular multiplication task pipelines are widely used in encryption algorithms, such as modular multiplication operations in the RSA algorithm, point multiplication operations in the ECC algorithm, etc. These algorithms require a large number of modular multiplication operations, and the efficient processing of the pipeline enables these algorithms to be completed in a reasonable time, thus meeting the needs of practical applications.

[0051] In this way, the modular multiplication task pipeline greatly improves the efficiency of modular multiplication operations by decomposing complex modular multiplication operations into multiple stages that can be processed in parallel and optimizing the design of dedicated hardware modules. It plays an important role in high-performance computing and cryptography applications. Through the use of pipeline technology, the system's computing speed and hardware utilization are significantly improved.

[0052] As an optional embodiment, the computing core module includes at least two task pipelines, and each task pipeline includes at least one scheduling module.

[0053] Specifically, further, each scheduling module includes at least one counter, and the counter is used to indicate the position of the current clock cycle in the current clock unit. Each scheduling module also includes a register, and the register is used to store the operation result or intermediate processing result of any module in the modular multiplication calculation module, the modular addition calculation module, and the modular subtraction calculation module. Each scheduling module also includes a selector, and the selector is used to select the corresponding register storage data to participate in the operation processing task currently executed by any module in the modular multiplication calculation module, the modular addition calculation module, and the modular subtraction calculation module according to the clock cycle position indicated by the counter, or select the corresponding register storage data to output to the corresponding data output port.

[0054] Further optionally, the computing core module also includes at least a modular subtraction task pipeline for processing modular addition operation objects and / or modular subtraction operation objects, and the modular subtraction task pipeline includes at least a scheduling module, a modular addition calculation module and a modular subtraction calculation module.

[0055] In the computing core module, the modular addition and modular subtraction task pipeline is a dedicated hardware pipeline for processing modular addition and modular subtraction operations. The modular addition and modular subtraction task pipeline can process multiple modular addition and modular subtraction operations in parallel in the same clock cycle, thereby greatly improving the computing speed. If these tasks are executed sequentially in different pipelines, more clock cycles will be required. Through parallel processing, complex computing tasks can be completed in a shorter time. The modular addition and modular subtraction task pipeline processes multiple modular addition and modular subtraction operations in parallel in the same clock cycle through the collaborative work of the scheduling module, the modular addition computing module, and the modular subtraction computing module, greatly improving the computing efficiency. In fact, this structure is particularly suitable for high-performance computing applications such as elliptic curve cryptography, encryption and decryption operations, and blockchain technology.

[0056] Exemplarily, multiple input data can be processed in parallel by a computing core module, and the structure of the computing core module is as follows: Figure 3 For example, Figure 3 In the example, input data 1 and input data 2 can be configured in parallel in the computing core module, and each input data is assigned to the corresponding task pipeline for processing to obtain output data 1.

[0057] exist Figure 3 In the computing core module, at least a modular multiplication task pipeline and a modular subtraction task pipeline are included. The modular multiplication task pipeline includes at least a scheduling module and a modular multiplication calculation module. The modular subtraction task pipeline includes at least a scheduling module, a modular addition calculation module and a modular subtraction calculation module. Both of the above task pipelines are configured and scheduled by the control module.

[0058] In order to efficiently utilize the computing resources of the core computing module, the system time-division multiplexes the computing resources of the core computing module and introduces the concept of clock units.

[0059] As an optional embodiment, the processing duration of the target acceleration task is determined by the length of a clock unit and / or the number of computing core modules that can be scheduled by the hardware acceleration system.

[0060] It is understandable that in a hardware acceleration system, the processing time of the target acceleration task can be affected by multiple factors, among which the clock unit length and the number of computing core modules are key factors. The clock unit length refers to the cycle length or clock frequency of the clock signal in the system, which determines how many operation cycles the hardware can perform per second. The shorter the cycle of the clock unit (the higher the frequency), the more operations can be performed in each clock cycle, thereby speeding up the processing speed. Conversely, a longer clock cycle will result in a decrease in the number of operations per second and a longer processing time. A higher clock frequency can increase the processing speed of the computing core, but it will also increase power consumption and heat. Optimizing the clock frequency is one of the keys to improving system performance.

[0061] For example, in a hardware acceleration system, the adjustment of the clock frequency directly affects the execution speed of the computing task. For example, when processing complex modular addition, modular subtraction or modular multiplication operations, the system needs to run at a higher clock frequency to reduce the total processing time of the task.

[0062] The number of computing core modules refers to the number of computing units or cores available in the hardware acceleration system. Each core module can independently perform computing tasks, process different data or perform the same operation in parallel. Further optionally, increasing the number of computing core modules can process more computing tasks in parallel, thereby shortening the overall processing time. For example, for modular addition tasks, the tasks can be divided into multiple cores for simultaneous execution, thereby improving the overall computing speed. Further optionally, tasks are divided into multiple cores for load balancing, so that the amount of tasks processed by each core is reduced, thereby improving processing efficiency and speed. For example, in a hardware acceleration system, by increasing the number of computing core modules, the processing capacity can be significantly improved. For example, if there are multiple cores in the system that can perform modular addition, modular subtraction or modular multiplication operations at the same time, large-scale computing tasks can be assigned to these cores for parallel processing, significantly reducing the total processing time of the task.

[0063] In a hardware acceleration system, the clock unit length and the number of computing core modules directly determine the processing time of the target acceleration task. The clock frequency affects the number of operations per second, while the number of computing cores affects the parallel processing capability. By optimizing these factors, the overall performance of the system can be improved and the processing time of computing tasks can be shortened.

[0064] As an optional embodiment, the length of the clock unit is at least greater than the total number of clock cycles of the hardware processing unit processing a single type of target task object. Exemplarily, any clock unit contains at least 14 clock cycles.

[0065] In this optional embodiment, the concept of clock units and how to use clock units to optimize modular multiplication and modular addition / subtraction operations are introduced in detail through the execution process of a specific algorithm.

[0066] In this embodiment, the system needs to perform complex elliptic curve operations. The specific algorithm requires 14 modular multiplications and up to 14 modular addition or subtraction operations. A clock unit is a basic computing unit consisting of 14 consecutive clock cycles. Each cycle in each clock unit corresponds to a specific modular multiplication operation step. The clock unit length consists of 14 clock cycles, ensuring that all steps of a modular multiplication module can be executed within one clock unit. Clock Unit Start Time At the start time of each clock unit (time T1), the system receives a set of new data and starts calculating the first stage of modular multiplication.

[0067] Taking modular multiplication as an example, modular multiplication can be divided into multiple stages of processing, each stage is performed in a different part of the clock unit: Phase 1: Calculate four modular multiplications at times T1 to T4 of the first clock unit.

[0068] The second stage: Calculate the four modular multiplications of the second stage at times T5 to T8 of the K+1th clock unit.

[0069] The third and subsequent stages: and so on, until all the calculation steps of 14 modular multiplications are completed.

[0070] By dividing the computing resources of the modular multiplication module into 14 parts in time, each clock unit can perform a part of the modular multiplication operation, and complete the entire modular multiplication task through multiple clock unit iterations.

[0071] In order to further optimize the operation efficiency, the system introduces the strategies of time division multiplexing and K value adjustment. The computing resources of the modular multiplication module are divided into 14 parts in time. By using these computing resources in time-sharing in each clock unit, the system can process multiple modular multiplication tasks with the same hardware resources. K is a positive integer, indicating that different stages of the modular multiplication operation are executed in different clock units. By adjusting the K value, the system can flexibly change the total number of cycles required for modular multiplication, thereby adapting to different operation frequency requirements.

[0072] See also Figure 4As shown, assuming that a modular multiplication requires 14K clock cycles from input to output, the specific execution process can be implemented as follows: the system receives new data at time T1 (starting from the first clock unit), and in clock unit 1, the first stage of modular multiplication operation begins (4 modular multiplications of the first stage are completed at times T1 to T4). In clock unit 2, the second stage of modular multiplication operation begins at time T5 (the K+1th clock unit) (4 modular multiplications of the second stage are completed at times T5 to T8). In clock unit 3, the third stage of modular multiplication operation begins at time T9 (4 modular multiplications of the third stage are completed at times T9 to T11). In clock unit 4, the fourth stage of modular multiplication operation begins at time T12 (4 modular multiplications of the fourth stage are completed at times T12 to T14). In a similar manner, the remaining modular multiplication steps are completed in subsequent clock units until the 14th modular multiplication operation is completed.

[0073] In this way, the system can process multiple modular multiplication tasks simultaneously on the same computing module, and improve computing efficiency through reasonable clock unit division and time division multiplexing.

[0074] In actual applications, by adjusting the K value, the system can control the total number of cycles required for modular multiplication operations. This allows the system to adjust the calculation frequency in different computing scenarios to optimize performance and resource utilization. High-frequency operations can be, a smaller K value corresponds to a smaller total number of cycles, suitable for scenarios where modular multiplication operations need to be completed quickly. Low-frequency operations can be, a larger K value corresponds to a larger total number of cycles, suitable for scenarios where computing time requirements are not tight but power consumption needs to be saved.

[0075] By time-division multiplexing the computing resources of the core computing module and introducing the concept of clock units, the system can efficiently process complex elliptic curve operations. By adjusting the K value, the system can flexibly change the number of cycles required for modular multiplication to adapt to different operation frequencies and performance requirements. This method effectively optimizes the resource utilization of the hardware acceleration system and reduces processing time.

[0076] Further optionally, before merging the PADD tasks and PDBL tasks to be processed into the target acceleration tasks in S101, an initial task may be obtained; the initial task at least includes the calculation task of the elliptic curve addition group. Then, the task type of the initial task is identified to extract the PADD tasks and PDBL tasks to be processed.

[0077] For example, by obtaining the initial tasks and identifying the task types, the system can extract and optimize the PADD and PDBL tasks in the elliptic curve addition group. Combining these tasks into a target acceleration task can improve the computing efficiency of the hardware accelerator and achieve faster elliptic curve operations. This method can be applied in scenarios such as ECC that require a large number of calculations to effectively shorten the processing time of operations such as encryption, decryption, and signing.

[0078] As an optional embodiment, in S101, the PADD task and the PDBL task to be processed are merged into a target acceleration task, see Figure 2 As shown, it can be implemented as: S201, identifying a target task object to be processed from PADD tasks and PDBL tasks to be processed; S202, generating configuration information of the target task object to obtain the target acceleration task.

[0079] In an embodiment of the present application, the target task object is one of a modular addition operation object, a modular subtraction operation object, and a modular multiplication operation object. In the elliptic curve addition group, modular addition, modular subtraction, and modular multiplication operations are key operations, each with specific characteristics and applications. In an elliptic curve, modular addition refers to the addition of two points on a curve. The addition operation is the basis of elliptic curve cryptography, involving adding two points to obtain a new point. Modular addition is a closed operation of the elliptic curve group, that is, the sum of the two points is still within the curve group. It is a basic operation in the elliptic curve group and a building block for other complex operations. For example, it is used for operations such as calculating public keys and signature verification. In elliptic curve cryptography (ECC), modular addition is the core of calculating key values ​​and performing encryption / decryption operations.

[0080] In elliptic curves, modular subtraction can be seen as the inverse operation of addition, that is, finding the negative point of a point and performing addition. Modular subtraction in elliptic curves is equivalent to the combined operation of point addition, which is completed by using addition and negative point calculation. For example, it is used to calculate the distance between points, inverse elements, and other operations. In the signature algorithm, modular subtraction is used to process the operational relationship between private keys and public keys.

[0081] In elliptic curves, modular multiplication refers to scalar multiplication of points on an elliptic curve, that is, multiplying a point on the curve by an integer (scalar). Modular multiplication is scalar multiplication on elliptic curves, implemented by repeated addition (point addition). Scalar multiplication is the most important operation in elliptic curve cryptography and has high computational complexity (for example, optimized by fast addition algorithms). The result of modular multiplication is a point on the elliptic curve.

[0082] In the embodiment of the present application, the configuration information is used to indicate the target type to which the hardware processing unit of the target task object belongs. Specifically, the configuration information plays an important role in the hardware accelerator, indicating how the hardware handles a specific computing task to ensure efficient execution of the task. The configuration information can be used to optimize the use of hardware resources, adjust hardware operations according to the specific requirements of the task, and improve overall computing performance.

[0083] For example, in an accelerator for computing tasks, configuration information is key information used to instruct the hardware processing unit on how to process a specific task. For hardware accelerators involving operations such as modular addition, modular subtraction, and modular multiplication, the configuration information contains detailed descriptions of the task objects to ensure that the hardware can correctly and efficiently perform the corresponding operations.

[0084] Exemplarily, the configuration information is used to indicate how the hardware processing unit processes the parameters or instructions of a specific computing task, including the task type, data format and size, operation mode, hardware resource allocation, and control signals. The task type specifies whether the task object is a modular addition, modular subtraction, or modular multiplication operation. The data format and size define the format and size of the input data, such as the data bit width and integer length. The operation mode indicates how to perform the operation, such as whether partial result accumulation or carry processing is required. Hardware resource allocation indicates which hardware units are responsible for the execution of specific tasks, such as adders and modulus processors. Control signals are used to manage the operation flow of the hardware, including start signals, completion signals, etc., to ensure the correct and efficient execution of tasks.

[0085] For example, the merged target acceleration tasks can be calculated using the same hardware resources, such as Figure 3 The computing core module shown. The computing core module can process the input data of two or more tasks in parallel, or can process the input data of one task alone, which is not limited in the embodiments of the present application.

[0086] Further optionally, in S101, before merging the PADD tasks and PDBL tasks to be processed into the target acceleration tasks, an initial task may be obtained; the initial task at least includes the calculation task of the elliptic curve addition group. Then, the task type of the initial task is identified to extract the PADD tasks and PDBL tasks to be processed.

[0087] For example, by obtaining the initial tasks and identifying the task types, the system can extract and optimize the PADD and PDBL tasks in the elliptic curve addition group. Combining these tasks into a target acceleration task can improve the computing efficiency of the hardware accelerator and achieve faster elliptic curve operations. This method can be applied in scenarios such as ECC that require a large number of calculations to effectively shorten the processing time of operations such as encryption, decryption, and signing.

[0088] Further, it is assumed that the computing core module includes at least two task pipelines, and each task pipeline includes at least a scheduling module and at least one hardware processing unit. Based on the above assumption, in S102, the target acceleration task is split into multiple subtasks, see Figure 2 As shown, it can be implemented as: S203: Based on the configuration information, respectively configure the target task objects to the corresponding task pipelines in the computing core module.

[0089] As an optional embodiment, it is assumed that the operation durations of different types of subtasks are different. Based on the above assumption, in S203, before respectively configuring the target task objects to the corresponding task pipelines in the computing core module based on the configuration information, the operation processing durations corresponding to the target task objects can also be identified; the target task objects are respectively encapsulated into task units corresponding to different duration intervals according to the operation processing durations; and each task unit is transmitted to the scheduling module in the computing core module for allocation.

[0090] In this embodiment, it is assumed that the computing core module of the hardware acceleration system includes at least two task pipelines, each of which includes a scheduling module and at least one hardware processing unit. In order to optimize the execution efficiency of the task, the target acceleration task is split into multiple subtasks, and the subtasks are allocated and scheduled according to the computing processing time of the task. This process is introduced below through a specific example.

[0091] In an optional example, assume that the computing core module includes two task pipelines, each of which has a scheduling module and multiple hardware processing units. Assume that the target task object is composed of multiple subtasks of different types, and the operation duration of these subtasks is different. The configuration information is used to describe the operation characteristics of each subtask, including the operation processing duration. Before task scheduling, the system first needs to identify the operation processing duration corresponding to each target task object (subtask). For example, subtask A is a modular addition operation, and the required processing duration is 5 clock cycles. Subtask B is a modular subtraction operation, and the required processing duration is 7 clock cycles. Subtask C is a modular multiplication operation, and the required processing duration is 14 clock cycles. Then, according to the identified operation processing duration, the system encapsulates these subtasks into corresponding task units. These task units are classified according to different duration intervals for subsequent scheduling. For example, the short-duration task unit is assumed to be encapsulated subtask A (5 cycles) and subtask B (7 cycles). The long-duration task unit is assumed to be encapsulated subtask C (14 cycles).

[0092] Based on the above assumptions, in step S203, the system transfers the packaged task units to the scheduling module in the computing core module for allocation. The scheduling module dynamically allocates the task units to the appropriate task pipelines according to the duration of the task units and the load of the current pipeline. For example, in pipeline 1, task units with shorter durations are processed, so subtasks A and B are allocated first. In pipeline 2, task units with longer durations are processed, so subtask C is allocated.

[0093] Assume that the system needs to process a complex elliptic curve operation task, splitting a large task into multiple subtasks, such as modular addition, modular subtraction, modular multiplication, etc. Identify the operation processing time required for each subtask and classify them into short-duration and long-duration task units. According to the duration interval, encapsulate subtasks A and B into short-duration task units, and encapsulate subtask C into long-duration task units. Assign the short-duration task units to pipeline 1 for processing, and the scheduling module of pipeline 1 processes subtasks A and B in sequence. Assign the long-duration task units to pipeline 2 for processing, and pipeline 2 focuses on processing subtask C.

[0094] The advantage of this method is that by identifying the processing time of tasks and allocating them, the system can more evenly utilize the processing capabilities of different task pipelines. Different task pipelines can process different types of task units at the same time, reducing the waiting time between tasks, thereby improving the overall processing efficiency. The scheduling module can adjust the task allocation according to the real-time situation, adapt to different load conditions, and optimize resource utilization. By identifying the computing processing time of subtasks and encapsulating and scheduling task units according to the time, the hardware acceleration system can significantly optimize the task processing flow. This method ensures that the task pipelines in the computing core module can fully utilize their computing capabilities, reduce the total processing time of tasks, and improve the overall performance of the system.

[0095] Further, in S103, the computing core module in the hardware acceleration system processes multiple subtasks to achieve hardware acceleration of multiple elliptic curve addition group operations, see Figure 2 As shown, it can be implemented as: S204, inputting the multiple subtasks into corresponding task pipelines respectively; S205, using multiple task pipelines to process corresponding subtasks in parallel to obtain calculation results corresponding to the multiple subtasks, so as to achieve time division multiplexing of the multiple subtasks on the computing core module.

[0096] In this embodiment, step S103 processes multiple subtasks through the computing core module in the hardware acceleration system, thereby realizing hardware acceleration of multiple elliptic curve addition group operations. To this end, subtasks are input into different task pipelines, and multiple task pipelines are used to process subtasks in parallel, and the computing efficiency is improved through the time division multiplexing mechanism. Specifically, the computing core module includes multiple task pipelines, each of which can independently process different subtasks. The target task includes multiple subtasks, which involve elliptic curve addition group operations, such as point addition (PADD) and point doubling (PDBL). The system distributes multiple subtasks to different task pipelines in the computing core module for processing.

[0097] For example, assume that the target task contains the following subtasks: Subtask 1: Calculate the point P + Q (PADD task) Subtask 2: Calculate point 2P (PDBL task) Subtask 3: Calculate the point P + R (PADD task) Subtask 4: Calculate point 3P (PDBL task) The system assigns these subtasks to different task pipelines to maximize the use of computing resources. For example, in task pipeline 1, subtasks 1 and 3 (PADD tasks) are processed. In task pipeline 2, subtasks 2 and 4 (PDBL tasks) are processed. In this step, the system processes subtasks in parallel through multiple task pipelines, achieving efficient time division multiplexing.

[0098] Task pipeline 1: Processing subtask 1 and subtask 3 simultaneously. In pipeline 1, the two PADD tasks are executed in parallel, using multiple hardware processing units in the pipeline to achieve efficient computing.

[0099] Task pipeline 2: Processing subtask 2 and subtask 4 simultaneously. In pipeline 2, the two PDBL tasks are executed in parallel, using the doubling module in the pipeline to achieve fast calculation.

[0100] From the above examples, we can see that in the pipeline mechanism, each task pipeline performs different subtask operations in different clock cycles. For example, pipeline 1 processes the first part of subtask 1 in the first clock cycle, and processes the first part of subtask 3 in the next clock cycle, and so on. This time-division multiplexing mechanism allows multiple subtasks to be processed in the same pipeline, thereby improving computing efficiency. Through the parallel processing of multiple task pipelines, the system can obtain the calculation results of multiple subtasks in a shorter time. For example, pipeline 1 outputs the results of subtask 1 and subtask 3, and pipeline 2 outputs the results of subtask 2 and subtask 4.

[0101] This multi-task pipeline parallel processing and time-division multiplexing method brings significant optimization effects. Through parallel processing and time-division multiplexing, multiple subtasks can be executed simultaneously, significantly shortening the total computing time. Multiple task pipelines can make full use of the hardware resources in the computing core module and avoid idle resources. The system can dynamically adjust the allocation and scheduling of subtasks according to the nature of the task and the current load to achieve optimal performance. By inputting multiple subtasks into different task pipelines respectively and adopting parallel processing and time-division multiplexing mechanisms, the hardware acceleration system can efficiently process a variety of elliptic curve addition group operations. This method not only improves computing efficiency, but also optimizes the utilization of system resources. It is an effective way to achieve hardware acceleration in complex computing tasks.

[0102] As an optional embodiment, in S205, multiple task pipelines are used to process corresponding subtasks in parallel to obtain operation results corresponding to the multiple subtasks, which can be implemented as follows: For each task pipeline, the processing order of each target task object in the corresponding subtask in each clock unit is configured through the scheduling module in the task pipeline; each clock unit includes at least multiple clock cycles; based on the processing order, an enable signal corresponding to each target task object in each subtask is generated; the enable signal is used to indicate the clock cycle for processing each target task object in each subtask; based on the enable signal, each hardware processing unit in the task pipeline is controlled to process the corresponding target task object in the corresponding clock cycle; wherein the type of the target task object matches the task type corresponding to the hardware processing unit.

[0103] In this optional embodiment, multiple task pipelines process corresponding subtasks in parallel, and efficient task processing is achieved by configuring the scheduling module in the task pipeline, generating an enable signal, and controlling the hardware processing unit. The following is a detailed introduction to this process, and an example is used to help understand it.

[0104] Assume that each task pipeline includes a scheduling module and multiple hardware processing units. Each hardware processing unit is good at processing a specific type of task. Assume that the target task is divided into multiple subtasks, and each subtask contains several target task objects. Assume that each target task object needs to be processed by the corresponding hardware processing unit within a specific clock cycle.

[0105] For each task pipeline, the scheduling module in the task pipeline configures the processing order of each target task object in each subtask in each clock unit. The clock unit here contains multiple clock cycles. The scheduling module assigns a processing order to each target task object according to the type of the target task object and the required computing resources. For example, in a clock unit, task A is executed in the first clock cycle and task B is executed in the second clock cycle. Based on the configured processing order, the scheduling module generates enable signals. These enable signals are used to indicate the clock cycles for processing each target task object in each subtask. The enable signal can be regarded as a control instruction, which tells the hardware processing unit which target task object to process when (specific clock cycle). For example, the enable signal S1 may indicate that the target task object C is processed in the third clock cycle. Based on the generated enable signal, the scheduling module controls each hardware processing unit in the task pipeline to process the corresponding target task object in the corresponding clock cycle. The task type of the hardware processing unit must match the type of the target task object. The enable signal activates the corresponding hardware processing unit to process the corresponding target task object in the specified clock cycle. For example, the multiplier hardware unit will process the target task object of the multiplication operation in the 4th clock cycle upon receiving the enable signal S2.

[0106] For example, suppose the system needs to process an elliptic curve addition group operation task, which is divided into the following subtasks: Subtask 1: includes target task object A (addition operation) and target task object B (multiplication operation).

[0107] Subtask 2: includes target task object C (addition operation) and target task object D (multiplication operation).

[0108] The clock unit 1 of task pipeline 1 processes target task object A (addition operation) in the first clock cycle and targets task object B (multiplication operation) in the second clock cycle. The clock unit 1 of task pipeline 2 processes target task object C (addition operation) in the first clock cycle and targets task object D (multiplication operation) in the second clock cycle.

[0109] The enable signal S1 is used to indicate that in the first clock cycle, the adder of task pipeline 1 processes the target task object A. The enable signal S2 is used to indicate that in the second clock cycle, the multiplier of task pipeline 1 processes the target task object B. The enable signal S3 is used to indicate that in the first clock cycle, the adder of task pipeline 2 processes the target task object C. The enable signal S4 is used to indicate that in the second clock cycle, the multiplier of task pipeline 2 processes the target task object D.

[0110] The adder of task pipeline 1 processes target task object A according to enable signal S1 in the first clock cycle. The multiplier of task pipeline 1 processes target task object B according to enable signal S2 in the second clock cycle. The adder of task pipeline 2 processes target task object C according to enable signal S3 in the first clock cycle. The multiplier of task pipeline 2 processes target task object D according to enable signal S4 in the second clock cycle.

[0111] By configuring the scheduling module in the task pipeline, generating an enable signal, and controlling the hardware processing unit, this embodiment realizes the efficient operation of multiple task pipelines processing subtasks in parallel. By accurately controlling the processing timing of each target task object, the system can maximize the utilization of hardware resources, reduce processing delays, and improve computing efficiency.

[0112] For example, as shown in Table 1 below, the input parameters are the parameter a of the curve YY = XXX + aX + b and its prime field Prime, Point1 (X1, Y1, ZZ1, ZZZ1), Point2 (X2, Y2, ZZ2, ZZZ2). Based on this, the output parameter is Point3 (X3, Y3, ZZ3, ZZZ3).

[0113] Table 1 Elliptic curve addition group algorithm

[0114] Based on the above elliptic curve addition group operation, assume ,Right now The assumption of BLS curve can be applied to paired elliptic curve addition group operations, which has higher computational efficiency. For example, BN curve is suitable for implementing identity-based encryption and pairing applications, and is widely used in blockchain technology and preventing attacks. BLS curve Not all BLS curves meet , generally speaking, The BLS curve is mostly used to implement complex cryptographic applications such as zero-knowledge proofs and pairing-based cryptographic protocols. The MNT curve is widely used in cryptographic applications involving pairing.

[0115] Based on the above assumptions, first, step one calculates U1, U2, S1 and S2, and then generates a selection signal by comparing the difference P and R between U2 and U1, and S2 and S1. If P and R are both zero, the PDBL operation is executed, otherwise the PADD operation is executed. In order to optimize the utilization of hardware resources, the multiplication operation that takes a long time is separated from the addition and subtraction operations that take a short time, and they are encapsulated into modular multiplication pipeline modules and modular addition and subtraction pipeline modules respectively, and the corresponding values ​​are input into these two modules according to the selection signal through the scheduling module. In the merged algorithm, the processes of the two operations are consistent, that is, a selection signal can be used to determine whether PADD or PDBL is currently executed, and this selection signal can be obtained in step one. Therefore, the same set of hardware can be used to perform all addition group operations.

[0116] Based on the operation flow shown in Table 1, multiplication by 2, multiplication by 3, division by 2 and subtraction operations are all short-time operations, while the remaining multiplication operations are long-time operations and consume a lot of resources. The long-time modular multiplication operations can be separated from the short-time modular multiplication operations and encapsulated into modular multiplication pipeline modules and modular addition and subtraction pipeline modules respectively, and the scheduling module is responsible for inputting corresponding values ​​to the two modules according to the selection signal.

[0117] In this way, the entire addition group operation can be completed using the same set of hardware, which improves computing efficiency and reduces resource consumption.

[0118] The embodiment of the present invention provides a hardware acceleration method for elliptic curve addition group. First, the PADD task and PDBL task to be processed are merged into a target acceleration task; then, the target acceleration task is split into multiple subtasks; the multiple subtasks are respectively used to perform hardware acceleration of different types of task objects in the target acceleration task; finally, the multiple subtasks are processed by the computing core module in the hardware acceleration system to realize hardware acceleration of multiple elliptic curve addition group operations; the computing core module includes multiple hardware processing units that can be scheduled in parallel, and each hardware processing unit is used to perform the operation acceleration of the corresponding task type. The method can rely on the hardware acceleration of the computing core module to realize the task optimization of the elliptic curve addition group, and can effectively solve the problem in the related technology that the bit width is difficult to meet the current growing data processing needs, the storage system and computing resources are overloaded, and the efficiency of the elliptic curve addition group operation is affected. Further improve the utilization rate of hardware resources, improve the efficiency and processing capacity of the elliptic curve addition group operation, and have the flexibility and scalability of the hardware acceleration system.

[0119] See also Figure 5 , Figure 5An embodiment of the present application provides a hardware acceleration device 200 for an elliptic curve addition group. The hardware acceleration device 200 is applied to a hardware acceleration system. The hardware acceleration device 200 includes the following modules: A merging module, used to merge pending PADD tasks and PDBL tasks into a target acceleration task; A splitting module, used for splitting the target acceleration task into a plurality of subtasks; the plurality of subtasks are used for respectively performing hardware acceleration on different types of task objects in the target acceleration task; The acceleration module is used to process multiple subtasks through the computing core module in the hardware acceleration system to achieve hardware acceleration of various elliptic curve addition group operations; the computing core module includes multiple hardware processing units that can be scheduled in parallel, and each hardware processing unit is used to perform computing acceleration of the corresponding task type.

[0120] In some implementations, when the merging module merges the PADD task and the PDBL task to be processed into the target acceleration task, it is specifically used to: Identify a target task object to be processed from the PADD tasks and PDBL tasks to be processed; the target task object is one of a modular addition operation object, a modular subtraction operation object, and a modular multiplication operation object; Generate configuration information of the target task object to obtain the target acceleration task; the configuration information is used to indicate the target type to which the hardware processing unit of the target task object belongs.

[0121] In some implementations, the computing core module includes at least two task pipelines, each task pipeline includes at least a scheduling module and at least one hardware processing unit; the splitting module, when splitting the target acceleration task into a plurality of subtasks, is specifically used to: Based on the configuration information, the target task objects are respectively configured to the corresponding task pipelines in the computing core module; The acceleration module, when processing multiple subtasks through the computing core module in the hardware acceleration system to realize hardware acceleration of multiple elliptic curve addition group operations, is specifically used for: Input multiple subtasks into the corresponding task pipelines respectively; Multiple task pipelines are used to process corresponding subtasks in parallel to obtain operation results corresponding to the multiple subtasks, so as to realize time division multiplexing of the computing core module by the multiple subtasks.

[0122] In some implementations, the target type matches the type of the task pipeline in the computing core module.

[0123] In some embodiments, the computing core module includes at least a modular multiplication task pipeline for processing modular multiplication operation objects, and the modular multiplication task pipeline includes at least a scheduling module and a modular multiplication computing module; the modular multiplication computing module is used to process at least two sets of input data in the same clock unit; The computing core module also includes at least a modular subtraction task pipeline for processing modular addition operation objects and / or modular subtraction operation objects, and the modular subtraction task pipeline includes at least a scheduling module, a modular addition computing module and a modular subtraction computing module.

[0124] In some implementations, different types of subtasks have different computation times; the splitting module, based on the configuration information, before respectively configuring the target task objects to the corresponding task pipelines in the computing core module, is further configured to: Identify the computing processing time corresponding to each of the target task objects; Encapsulating the target task object into task units corresponding to different duration intervals according to the operation processing duration; Each task unit is transmitted to the scheduling module in the computing core module for allocation.

[0125] In some implementations, the acceleration module uses multiple task pipelines to process corresponding subtasks in parallel to obtain operation results corresponding to the multiple subtasks, specifically for: For each task pipeline, the processing order of each target task object in the corresponding subtask in each clock unit is configured through the scheduling module in the task pipeline; each clock unit includes at least a plurality of clock cycles; Based on the processing sequence, generating an enable signal corresponding to each target task object in each subtask; the enable signal is used to indicate a clock cycle for processing each target task object in each subtask; Based on the enable signal, each hardware processing unit in the task pipeline is controlled to process the corresponding target task object within the corresponding clock cycle; wherein the type of the target task object matches the task type corresponding to the hardware processing unit.

[0126] In some implementations, the processing duration of the target acceleration task is determined by a clock unit length and / or the number of computing core modules that can be scheduled by the hardware acceleration system.

[0127] In some implementations, the clock unit length is at least greater than the total number of clock cycles of the hardware processing unit processing a single type of target task object.

[0128] In some implementations, any clock unit includes at least 14 clock cycles.

[0129] In some embodiments, the computing core module includes at least two task pipelines, each of which includes at least one scheduling module; Each scheduling module includes at least one counter, and the counter is used to indicate the position of the current clock cycle in the current clock unit; Each scheduling module also includes a register, which is used to store the operation result or intermediate processing result of any module among the modular multiplication calculation module, the modular addition calculation module and the modular subtraction calculation module; Each scheduling module also includes a selector, which is used to select the corresponding register storage data to participate in the calculation and processing tasks currently executed by any module in the modular multiplication calculation module, the modular addition calculation module and the modular subtraction calculation module according to the clock cycle position indicated by the counter, or select the corresponding register storage data to output to the corresponding data output port.

[0130] In some implementations, the merging module is further used to obtain an initial task before merging the PADD task and the PDBL task to be processed into the target acceleration task; the initial task at least includes an elliptic curve addition group calculation task; The initial tasks are identified by task type to extract PADD tasks and PDBL tasks to be processed.

[0131] In some implementations, the hardware acceleration device 200 may be applied to a terminal device, or to a chip, or other microelectronic components.

[0132] It should be noted that those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the hardware acceleration device 200 described above can refer to the corresponding process in the aforementioned hardware acceleration method embodiment, and will not be repeated here.

[0133] See also Figure 6 , Figure 6 A schematic block diagram of the structure of a terminal device provided in an embodiment of the present invention.

[0134] like Figure 6 As shown, the terminal device 300 includes a processor 301 and a memory 302 , and the processor 301 and the memory 302 are connected via a bus 303 , such as an I2C (Inter-integrated Circuit) bus.

[0135] Specifically, the processor 301 is used to provide computing and control capabilities to support the operation of the entire terminal device. The processor 301 can be a central processing unit (CPU), and the processor 301 can also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc.

[0136] Specifically, the memory 302 may be a Flash chip, a read-only memory (ROM) disk, an optical disk, a USB flash drive, or a mobile hard disk.

[0137] Those skilled in the art will understand that Figure 6 The structure shown in the figure is only a block diagram of a partial structure related to the embodiment of the present invention, and does not constitute a limitation on the terminal device to which the embodiment of the present invention is applied. The specific server may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0138] The processor is used to run a computer program stored in a memory, and implement any one of the hardware acceleration methods provided by the embodiments of the present invention when executing the computer program.

[0139] In one embodiment, the processor is used to run a computer program stored in a memory, and implements the following steps when executing the computer program: merging the PADD task and the PDBL task to be processed into a target acceleration task; splitting the target acceleration task into multiple subtasks; the multiple subtasks are respectively used to perform hardware acceleration of different types of task objects in the target acceleration task; processing multiple subtasks through the computing core module in the hardware acceleration system to achieve hardware acceleration of multiple elliptic curve addition group operations; the computing core module includes multiple hardware processing units that can be scheduled in parallel, and each hardware processing unit is used to perform operation acceleration of the corresponding task type. It should be noted that technicians in the relevant field can clearly understand that for the convenience and simplicity of description, the specific working process of the terminal device described above can refer to the corresponding process in the aforementioned hardware acceleration method embodiment, and will not be repeated here.

[0140] An embodiment of the present invention further provides a storage medium for computer-readable storage, wherein the storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps of any hardware acceleration method provided in the description of the embodiment of the present invention.

[0141] The storage medium may be an internal storage unit of the terminal device described in the foregoing embodiment, such as a hard disk or memory of the terminal device. The storage medium may also be an external storage device of the terminal device, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (SecureDigital, SD) card, a flash card (Flash Card), etc., equipped on the terminal device.

[0142] It will be appreciated by those skilled in the art that all or some of the steps, systems, and functional modules / units in the methods disclosed above may be implemented as software, firmware, hardware, and appropriate combinations thereof. In a hardware embodiment, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or transient medium). As is known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, it is well known to those skilled in the art that communication media typically contain computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.

[0143] It should be understood that the term "and / or" used in the present specification and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, including these combinations. It should be noted that, in this article, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "including a..." does not exclude the presence of other identical elements in the process, method, article or system including the element.

[0144] The serial numbers of the embodiments of the present invention are only for description and do not represent the advantages and disadvantages of the embodiments. The above description is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.

Claims

1. A hardware acceleration method for elliptic curve addition group, characterized in that: The method is applied to a hardware acceleration system, and the method comprises: Combine the pending elliptic curve addition PADD task and the elliptic curve doubling PDBL task into a target acceleration task; Splitting the target acceleration task into a plurality of subtasks; the plurality of subtasks are respectively used to perform hardware acceleration of different types of task objects in the target acceleration task; The computing core module in the hardware acceleration system processes multiple subtasks to achieve hardware acceleration of various elliptic curve addition group operations; the computing core module includes multiple hardware processing units that can be scheduled in parallel, and each hardware processing unit is used to perform computing acceleration of the corresponding task type.

2. The method according to claim 1, characterized in that The step of merging the pending PADD task and the PDBL task into a target acceleration task includes: Identify a target task object to be processed from the PADD tasks and PDBL tasks to be processed; the target task object is one of a modular addition operation object, a modular subtraction operation object, and a modular multiplication operation object; Generate configuration information of the target task object to obtain the target acceleration task; the configuration information is used to indicate the target type to which the hardware processing unit of the target task object belongs.

3. The method according to claim 2, characterized in that The computing core module includes at least two task pipelines, each task pipeline includes at least a scheduling module and at least one hardware processing unit; the target acceleration task is split into multiple subtasks, including: Based on the configuration information, the target task objects are respectively configured to the corresponding task pipelines in the computing core module; The computing core module in the hardware acceleration system processes multiple subtasks to achieve hardware acceleration of various elliptic curve addition group operations, including: Input multiple subtasks into the corresponding task pipelines respectively; Multiple task pipelines are used to process corresponding subtasks in parallel to obtain operation results corresponding to the multiple subtasks, so as to realize time division multiplexing of the computing core module by the multiple subtasks.

4. The method according to claim 3, characterized in that The target type matches the type of the task pipeline in the computing core module.

5. The method according to claim 4, characterized in that The computing core module at least includes a modular multiplication task pipeline for processing modular multiplication operation objects, and the modular multiplication task pipeline at least includes a scheduling module and a modular multiplication computing module; the modular multiplication computing module is used to process at least two sets of input data in the same clock unit; The computing core module also includes at least a modular subtraction task pipeline for processing modular addition operation objects and / or modular subtraction operation objects, and the modular subtraction task pipeline includes at least a scheduling module, a modular addition computing module and a modular subtraction computing module.

6. The method according to claim 3, characterized in that Different types of subtasks have different computation times; Before respectively configuring the target task objects to the corresponding task pipelines in the computing core module based on the configuration information, the method further includes: Identify the computing processing time corresponding to each of the target task objects; Encapsulating the target task object into task units corresponding to different duration intervals according to the operation processing duration; Each task unit is transmitted to the scheduling module in the computing core module for allocation.

7. The method according to claim 2, characterized in that: The method of using multiple task pipelines to process corresponding subtasks in parallel to obtain operation results corresponding to the multiple subtasks includes: For each task pipeline, the processing order of each target task object in the corresponding subtask in each clock unit is configured through the scheduling module in the task pipeline; each clock unit includes at least a plurality of clock cycles; Based on the processing sequence, generating an enable signal corresponding to each target task object in each subtask; the enable signal is used to indicate a clock cycle for processing each target task object in each subtask; Based on the enable signal, each hardware processing unit in the task pipeline is controlled to process the corresponding target task object within the corresponding clock cycle; wherein the type of the target task object matches the task type corresponding to the hardware processing unit.

8. The method according to any one of claims 1 to 7, characterized in that: The processing duration of the target acceleration task is determined by the length of a clock unit and / or the number of computing core modules that can be scheduled by the hardware acceleration system.

9. The method according to any one of claims 1 to 7, characterized in that: The clock unit length is at least greater than the total number of clock cycles of the hardware processing unit processing a single type of target task object.

10. The method according to claim 9, characterized in that Any clock unit contains at least 14 clock cycles.

11. The method according to any one of claims 1 to 7, characterized in that: At least two task pipelines in the computing core module, each task pipeline including at least one scheduling module; Each scheduling module includes at least one counter, and the counter is used to indicate the position of the current clock cycle in the current clock unit; Each scheduling module also includes a register, which is used to store the operation result or intermediate processing result of any module among the modular multiplication calculation module, the modular addition calculation module and the modular subtraction calculation module; Each scheduling module also includes a selector, which is used to select the corresponding register storage data to participate in the calculation and processing tasks currently executed by any module in the modular multiplication calculation module, the modular addition calculation module and the modular subtraction calculation module according to the clock cycle position indicated by the counter, or select the corresponding register storage data to output to the corresponding data output port.

12. The method according to any one of claims 1 to 7, characterized in that: Before merging the pending PADD task and the PDBL task into the target acceleration task, the method further includes: Acquire an initial task; the initial task at least includes a calculation task of an elliptic curve addition group; The initial tasks are identified by task type to extract PADD tasks and PDBL tasks to be processed.

13. A hardware acceleration device for elliptic curve addition group, characterized in that: The device is applied to a hardware acceleration system, and comprises: A merging module, used to merge pending PADD tasks and PDBL tasks into a target acceleration task; A splitting module, used for splitting the target acceleration task into a plurality of subtasks; the plurality of subtasks are used for respectively performing hardware acceleration on different types of task objects in the target acceleration task; The acceleration module is used to process multiple subtasks through the computing core module in the hardware acceleration system to achieve hardware acceleration of various elliptic curve addition group operations; the computing core module includes multiple hardware processing units that can be scheduled in parallel, and each hardware processing unit is used to perform computing acceleration of the corresponding task type.

14. A computing device, characterized in that The terminal device includes a processor and a memory; The memory is used to store computer programs; The processor is configured to execute the computer program and implement the hardware acceleration method for the elliptic curve addition group according to any one of claims 1 to 12 when executing the computer program.

15. A computer storage medium for computer storage, characterized in that: The computer storage medium stores at least one program, and at least one processor is used to execute the at least one program to implement the steps of the hardware acceleration method for the elliptic curve addition group according to any one of claims 1 to 12.

16. A chip system, characterized in that: The chip system includes: A communication interface for inputting and / or outputting information; A processor, configured to execute a computer executable program so that a device equipped with the chip system executes the hardware acceleration method for the elliptic curve addition group as described in any one of claims 1 to 12.

17. A computer program product comprising computer instructions, characterized in that When the computer instructions are executed by a processor, the hardware acceleration method of the elliptic curve addition group according to any one of claims 1 to 12 is implemented.

Citation Information

Patent Citations

  • High-speed multiple-point operation method for elliptic curve passwords

    CN110232289A

  • High-speed point addition operation method and device for elliptic curve password

    CN110460443A

  • Hardware implementation method and system for elliptic curve digital signature and signature verification

    CN113783702A

  • Task execution method and device, storage medium and electronic device

    CN113849302A

  • Zero-knowledge proof hardware accelerator, generation method, electronic equipment and storage medium

    CN115033293A

Cited By

  • Model optimization method and related device

    CN119166159A

  • Accelerator-oriented multi-task processing method and related device

    CN120011093A