Multi-scalar multiplication optimization method and device, computer equipment and medium
By maintaining the read and write status of the target bucket and three-coordinate operation, the elliptic curve point adder is optimized, and the problem of buffer resource waste in multiscalar multiplication operation is solved, achieving efficient resource utilization and improved computing efficiency.
Patent Information
- Application Number
- CN202510384789.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-28
- Publication Date
- 2025-08-12
- Estimated Expiration
- 2045-03-28
AI Technical Summary
In the existing multiscalar multiplication operation, the buffer resource consumption is large and cannot be effectively optimized, resulting in waste of resources.
By maintaining the target bucket read and write state accessed by elliptic curve points, the buffer is activated only when the target bucket read and write state is the same, and the three-coordinate operation formula is used to optimize the elliptic curve point adder to reduce buffer storage operations and coordinate storage space.
Reduces buffer depth and resource consumption, and improves the efficiency of multiscalar multiplication operations.
Smart Images

Figure CN120469718A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of cryptographic technology, and in particular to an optimization method, apparatus, computer equipment, and medium for multi-scalar multiplication operations. Background Art
[0002] Multi-Scalar Multiplication (MSM) is a key operation in the zero-knowledge proof computation process. MSM involves multiplication of multiple scalars and elliptic curve points, and is a core step in implementing multiple computations in the zero-knowledge proof protocol. Current post-processing schemes for multi-scalar multiplication require a maximum buffer depth equal to the number of point adder delays. Furthermore, data passes through the buffer before entering the bucket module, which inevitably leads to unnecessary storage operations and significant buffer resource consumption. Therefore, optimizing the multi-scalar multiplication process and reducing resource consumption has become a pressing issue. Summary of the Invention
[0003] The present application provides a multi-scalar multiplication optimization method, apparatus, computer equipment and medium to optimize the multi-scalar multiplication process and reduce resource consumption.
[0004] In a first aspect, the present application provides a multi-scalar multiplication optimization method, the optimization method being applied to a multi-scalar multiplication system, the multi-scalar multiplication system comprising a first-in-first-out queue, an arbiter, a bucket status register table, a bucket module, a buffer, a multiplexer, and an elliptic curve point adder, wherein the bucket module comprises at least one bucket, the optimization method comprising:
[0005] The arbiter receives the scalar and elliptic curve point transmitted by the first-in-first-out queue and the elliptic curve point adder respectively, and determines whether the target buckets accessed by the two elliptic curve points are the same;
[0006] When the target buckets accessed by the two elliptic curve points are different, analyzing the scalar based on the bucket status register table to determine the number of times the two elliptic curve points access the target bucket, and updating the read and write status of the two target buckets based on the number of accesses;
[0007] When the bucket module receives the scalar and the elliptic curve point, it controls the scalar and the elliptic curve point to access the target bucket according to the read / write status and the access count, and when the read / write status of the two target buckets are the same, activates the buffer, and stores the addition request generated according to the two sets of scalars and the elliptic curve point based on the buffer;
[0008] determining a pending request from among the received addition requests based on the multiplexer, and transmitting the target request to the elliptic curve point adder;
[0009] Processing the pending request based on the elliptic curve point adder according to a preset three-coordinate operation formula to obtain a new scalar and elliptic curve point, and transmitting the new scalar and elliptic curve point to the arbitrator to perform the next round of cyclic processing with the scalars and elliptic curve points in the first-in-first-out queue;
[0010] When the first-in-first-out queue is empty, the loop processing is terminated, and bucket aggregation and group aggregation processing are performed based on the bucket status register table to obtain a calculation result.
[0011] In a second aspect, the present application further provides an optimization device for multi-scalar multiplication operations, the device comprising:
[0012] a target bucket determination module, configured to receive the FIFO queue and the scalar and elliptic curve point transmitted by the elliptic curve point adder based on the arbitrator, and determine whether the target buckets accessed by the two elliptic curve points are the same;
[0013] a read / write status update module, configured to analyze the scalar based on the bucket status register table when the target buckets accessed by the two elliptic curve points are different, determine the number of times the two elliptic curve points access the target bucket, and update the read / write status of the two target buckets based on the number of accesses;
[0014] an addition request generation module, configured to, when the bucket module receives a scalar and an elliptic curve point, control the scalar and the elliptic curve point to access a target bucket according to the read / write status and the access count, and activate the buffer when the read / write status of the two target buckets are the same, and store the addition request generated according to the two sets of scalars and elliptic curve points in the buffer;
[0015] a pending request determination module, configured to determine a pending request from among the received addition requests based on the multiplexer, and transmit the target request to the elliptic curve point adder;
[0016] an addition request processing module, configured to process the pending request based on the elliptic curve point adder according to a preset three-coordinate operation formula to obtain a new scalar and elliptic curve point, and transmit the new scalar and elliptic curve point to the arbitrator for a next round of cyclic processing with the scalars and elliptic curve points in the first-in-first-out queue;
[0017] The operation result obtaining module is used to end the loop processing when the first-in-first-out queue is empty, and perform bucket aggregation and group aggregation processing based on the bucket status register table to obtain the operation result.
[0018] In a third aspect, the present application also provides a computer device, comprising a memory and a processor; the memory is used to store a computer program; the processor is used to execute the computer program and implement the optimization method for multi-scalar multiplication operations as described above when executing the computer program.
[0019] In a fourth aspect, the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor implements the optimization method for multi-scalar multiplication operations as described above.
[0020] The present application discloses an optimization method, apparatus, computer equipment and medium for multi-scalar multiplication operation, wherein the arbiter receives the scalar and elliptic curve point transmitted by the first-in-first-out queue and the elliptic curve point adder respectively, and determines whether the target buckets accessed by the two elliptic curve points are the same; when the target buckets accessed by the two elliptic curve points are different, the scalar is analyzed based on the bucket status register table to determine the number of times the two elliptic curve points access the target bucket, and the read and write status of the two target buckets are updated respectively based on the number of accesses; when the bucket module receives the scalar and the elliptic curve point, the scalar and the elliptic curve point are controlled to access the target bucket according to the read and write status and the number of accesses, and ... When the read and write states of the two elliptic curve points are the same, the buffer is activated, and the addition request generated based on the two groups of scalars and elliptic curve points is stored in the buffer; based on the multiplexer, a pending request is determined from the received addition request, and the target request is transmitted to the elliptic curve point adder; based on the elliptic curve point adder, the pending request is processed according to the preset three-coordinate operation formula to obtain a new scalar and elliptic curve point, and the new scalar and elliptic curve point are transmitted to the arbitrator for the next round of loop processing with the scalars and elliptic curve points in the first-in-first-out queue; when the first-in-first-out queue is empty, the loop processing is ended, and bucket aggregation and group aggregation processing are performed based on the bucket status register table to obtain the operation result. This application maintains the read and write states of the target buckets accessed by the two elliptic curve points, and according to the activation and idle states of the control buffer, the buffer is activated only when the read and write states of the two target buckets are the same. The elliptic curve point adder adopts a solution based on the three-coordinate operation formula to optimize the multi-scalar multiplication operation, reduce the storage operation and coordinate storage space of the buffer, and thus reduce the buffer depth and resource consumption. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to 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 any creative work.
[0022] Figure 1 1 is a schematic diagram of a framework of a multi-scalar multiplication operation system provided in an embodiment of the present application;
[0023] Figure 2 is a schematic flow chart of a method for optimizing multi-scalar multiplication operations provided by the first embodiment of the present application;
[0024] Figure 3 is a schematic flow chart of a method for optimizing multi-scalar multiplication operations provided by the second embodiment of the present application;
[0025] Figure 4 Schematic diagram of the calculation process of the Pippenger algorithm provided in the embodiment of the present application;
[0026] Figure 5 A schematic block diagram of an optimization device for multi-scalar multiplication operations provided in an embodiment of the present application;
[0027] Figure 6 A schematic block diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0028] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0029] The flowcharts shown in the accompanying drawings are for illustrative purposes only and do not necessarily include all contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may be decomposed, combined, or partially merged, so the actual execution order may vary depending on the actual situation.
[0030] It should be understood that the terms used in this specification are only for the purpose of describing specific embodiments and are not intended to limit the present application. As used in this specification and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms unless the context clearly indicates otherwise.
[0031] It should be further understood that the term “and / or” used in this specification and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0032] Embodiments of the present application provide a method, apparatus, computer device, and medium for optimizing multi-scalar multiplication operations. The method can be applied to a multi-scalar multiplication operation system or server. By maintaining the read / write status of the target buckets accessed by two elliptic curve points and controlling the activation and idle status of the buffer, the buffer is activated only when the read / write status of the two target buckets is the same. Furthermore, a scheme based on a three-coordinate operation formula is employed in the elliptic curve point adder, thereby optimizing multi-scalar multiplication operations, reducing buffer storage operations and coordinate storage space, and thereby reducing buffer depth and resource consumption. The server can be a standalone server or a server cluster.
[0033] The following describes some embodiments of the present application in detail with reference to the accompanying drawings. In the absence of conflict, the following embodiments and features therein may be combined with each other.
[0034] See also Figure 1 , Figure 1 This is a schematic diagram of a framework of a multi-scalar multiplication operation system provided in an embodiment of the present application, wherein the multi-scalar multiplication operation system is used to perform an optimized method for performing multi-scalar multiplication operations.
[0035] like Figure 1 As shown, the multi-scalar multiplication operation system includes a first-in-first-out queue, an arbiter, a bucket status register table, a bucket module, a buffer, a multiplexer, and a three-coordinate elliptic curve point adder.
[0036] In one embodiment, a first-in-first-out queue is used to store input scalars and points into a queue space. The queue space not only stores the scalar and coordinates of a point, but also expands the scalar to the nearest multiple of 8 to its bit width. After writing a point, the write operation stops, and the scalar and point data are read out according to the bit width of "scalar / / 8 + 1". When only the last data is left in the queue, the read and write operations are performed simultaneously to maximize the queue's ability to process point data. Among them, "scalar / / 8 + 1" means that the scalar's bit width is divided by 8 and rounded down to obtain the size in bytes, and then 1 is added to ensure that the read bit width can cover the entire scalar data.
[0037] The arbiter processes points and scalars from the FIFO queue and the elliptic curve point adder. It determines whether two points access different buckets. If so, it skips accessing the bucket status register and directly outputs the two points to the multiplexer for the highest-priority addition operation. If not, they are both sent to the bucket status register for further processing.
[0038] The bucket status register receives and analyzes a scalar input to determine the number of times the corresponding location in the target bucket has been accessed. It also outputs the access status of the target bucket and updates the status. The status is 0 or 1, which determines whether the bucket module is read or write enabled.
[0039] The bucket module consists of multiple buckets—multidimensional arrays composed of random access memory (RAM) blocks—that store the points currently stored in the corresponding scalars. It receives a newly arrived point and the read / write status of the target bucket when the point accesses it. It then determines whether to write the new point into the target bucket or output it along with existing points in the target bucket to a multiplexer for further processing. Furthermore, the bucket maintains three pointers and three status registers. Changes in the status registers determine pointer changes, enabling the reading and writing of specific internal RAM data, completing the three-stage operation of the MSM.
[0040] The buffer is a dual-read, zero-read trigger buffer, a space used to store pending addition requests. Each addition request consists of two points and a corresponding scalar. The dual-read, zero-read trigger buffer is activated only when both points accessed by the bucket module are read-enabled, or when neither is read-enabled (including the case where both are not enabled). All other read-write states, such as a single read and single write, leave the buffer idle, and no operations are performed.
[0041] The multiplexer is a three-choose-one module that is used to filter addition operations from three different sources to ensure that only one addition operation can be input into the elliptic curve point adder for calculation at the same time.
[0042] The elliptic curve adder uses a three-coordinate scheme, with the input being the coordinates of two points and the output being the calculated new coordinates. A single elliptic curve adder can perform atomic operations including point addition and multiplication. When the two input points are identical, a multiplication operation is performed; when they are different, the addition of two elliptic curve points is performed. The submodules within this adder include large-number modular multiplication, large-number modular addition, and large-number modular subtraction. The large-number modular multiplication submodule utilizes the Karatsuba module, while the large-number modular addition and large-number modular subtraction modules utilize a single module with configurable addition and subtraction functions.
[0043] See also Figure 2 , Figure 2This is a schematic flow chart of an optimization method for multi-scalar multiplication operations provided in an embodiment of the present application.
[0044] like Figure 2 As shown, the optimization method for multi-scalar multiplication operation specifically includes steps S101 to S105.
[0045] S101, receiving the FIFO queue and the scalar and elliptic curve point transmitted by the elliptic curve point adder based on the arbiter, and determining whether the target buckets accessed by the two elliptic curve points are the same;
[0046] In one embodiment, the first-in-first-out queue reads out the scalar and the elliptic curve point according to a preset reading rule, and transmits the scalar and the elliptic curve point to the arbitrator.
[0047] The scalar and elliptic curve point transmitted by the elliptic curve point adder to the arbitrator are the new scalar and elliptic curve point obtained in the previous cycle. The current round of processing is performed based on the new scalar and elliptic curve point obtained in the previous cycle and the scalar and elliptic curve point in the first-in-first-out queue.
[0048] When the arbiter receives the points and scalars from the FIFO queue and the elliptic curve point adder, it determines the target bucket that the elliptic curve point needs to access based on the scalar and determines whether the target buckets accessed by the two points are the same.
[0049] Specifically, the scalar is converted to binary form for bit operations and block processing. According to the preset window size (for example, 4 bits, 8 bits, etc.), the binary representation of the scalar is divided into multiple blocks. The value of each block will determine the bucket to which the point belongs, such as the value 18 corresponds to bucket 18. For two scalars, the corresponding bucket number is calculated based on the value or size range of the binary block. The bucket numbers of the two scalars are compared. If the bucket numbers are the same, the target buckets are considered to be the same. If the bucket numbers are different, the target buckets are considered to be different.
[0050] Furthermore, before the arbiter receives the scalar and elliptic curve point transmitted by the first-in-first-out queue and the elliptic curve point adder respectively and determines whether the target buckets accessed by the two elliptic curve points are the same, it also includes: receiving the scalar and elliptic curve point input by the user based on the first-in-first-out queue, and performing a bit width alignment operation on the scalar; and reading the scalar and elliptic curve point to the arbiter according to a preset reading rule.
[0051] In one embodiment, a first-in-first-out queue stores input scalars and points in a queue space. This queue space not only stores the scalar and coordinates of a point but also expands the scalar to the nearest multiple of 8 that is closest to its bit width. After writing a point, the write operation stops, and the scalar and point data are read out according to a pre-defined read rule. When only the last data point remains in the queue, the read and write operations are performed simultaneously, maximizing the queue's ability to process point data.
[0052] The reading rule is to read scalar and point data according to the bit width of "scalar / / 8 + 1". "Scalar / / 8 + 1" means dividing the scalar bit width by 8, rounding down, and adding 1. For example, if the scalar bit width is 16 bits, then 16 / / 8 = 2, and the read bit width is 2 + 1 = 3 bytes. If the scalar bit width is 24 bits, then 24 / / 8 = 3, and the read bit width is 3 + 1 = 4 bytes.
[0053] Specifically, a scalar is an integer, and an elliptic curve point is represented by three coordinates, such as (X, Y, Z). To improve data processing efficiency and compatibility, the FIFO queue module expands the scalar's bit width to the nearest multiple of 8. For example, if the scalar's bit width is 10 bits, it will be expanded to 16 bits. This ensures efficient data processing during storage and transmission.
[0054] In one embodiment, the read scalars and points are transmitted to an arbitrator for subsequent processing.
[0055] S102: When the target buckets accessed by the two elliptic curve points are different, analyzing the scalar based on the bucket status register table to determine the number of times the two elliptic curve points access the target bucket, and updating the read and write status of the two target buckets based on the number of times;
[0056] In one embodiment, when the target buckets accessed by two elliptic curve points are different, the two scalars and the elliptic curve points are sent to the bucket status register table.
[0057] When the bucket status register receives a scalar input, it analyzes the scalar to determine the number of times the two elliptic curve points accessed the target bucket. For example, if scalar 1 and elliptic curve point 1 access the first target bucket, and scalar 2 and elliptic curve point 2 access the second target bucket, and the window value 18 appears once in scalar 1's window list, it indicates that the first target bucket 18 was accessed once; if the window value 18 appears twice in scalar 2's window list, it indicates that the second target bucket 18 was accessed twice.
[0058] The read and write states are divided into 1 (read enable) and 0 (write enable). These two states determine the read and write enable of the bucket module.
[0059] Furthermore, after the arbiter receives the FIFO queue and the scalars and elliptic curve points transmitted by the elliptic curve point adder respectively, and determines whether the target buckets accessed by the two elliptic curve points are the same, it also includes: when the target buckets accessed by the two elliptic curve points are the same, generating an addition request based on the arbiter and two groups of scalars and elliptic curve points, and distributing the addition request to the multiplexer.
[0060] In one embodiment, when the target buckets accessed by two elliptic curve points are the same, the step of accessing the bucket status register table is skipped, and the arbiter generates an addition request based on the two sets of scalars and elliptic curve points, and distributes the addition request to the multiplexer.
[0061] S103. When the bucket module receives the scalar and the elliptic curve point, control the scalar and the elliptic curve point to access the target bucket according to the read / write status and the access count, and when the read / write status of the two target buckets are the same, activate the buffer, and store, in the buffer, addition requests generated according to the two sets of scalars and elliptic curve points;
[0062] In one embodiment, the bucket module includes multiple buckets for storing corresponding points currently stored in corresponding scalars. Upon receiving a newly arrived point, the module determines, based on the read / write status, whether to write the new point into the bucket or output it together with the existing points in the bucket to a multiplexer for subsequent processing. For example, when the read / write status of the target bucket is 0, the currently accessed elliptic curve point is written into the target bucket. At this time, the status of the target bucket is updated to 1. When the next elliptic curve point accesses the target bucket, the elliptic curve point in the bucket is read out together with the currently accessed elliptic curve point based on the status 1.
[0063] In one embodiment, when the read and write states are the same, a buffer is activated to store addition requests generated according to two sets of scalars and elliptic curve points. Specifically, the buffer will be activated only when the read and write states are both read enabled, or neither is read enabled (including the case of no enablement), and the rest of the states (such as the case of single read and single write) will cause the buffer to be idle and no operation will be performed. For example, assuming that elliptic curve point 1 accesses the first target bucket and elliptic curve point 2 accesses the second target bucket, the read and write states of the first target bucket may be 0 and 1, and the read and write states of the second target bucket may also be 0 and 1. Therefore, the states of the first target bucket and the second target bucket may have four situations, namely 00, 01, 10 and 11, where 00 and 11 indicate that the read and write states of the two target buckets are the same, and 01 and 10 indicate that the read and write states of the two target buckets are different.
[0064] Furthermore, when the bucket status register table receives a scalar and an elliptic curve point, the number of times the two elliptic curve points access the target bucket is determined based on the scalar, and the read and write status of the two target buckets are updated respectively based on the number of accesses. It also includes: when the read and write status of the target buckets are different, an addition request is generated based on the bucket module and two groups of scalars and elliptic curve points, and the addition request is transmitted to the multiplexer.
[0065] In one embodiment, when the read and write states are different (e.g., a single read and single write scenario), the buffer is left idle and no operations are performed. The bucket module directly generates an addition request based on two sets of scalars and elliptic curve points, and transmits the addition request to the multiplexer.
[0066] S104, determining a pending request from the received addition requests based on the multiplexer, and transmitting the target request to the elliptic curve point adder;
[0067] In one embodiment, the multiplexer is a three-select module used to filter addition requests from the arbiter, bucket module, and buffer to ensure that only one addition request can be input into the elliptic curve point adder for calculation at the same time.
[0068] It is understandable that the multiplexer will only receive one addition request at a time. If the addition request is detected to be valid, the addition request will be determined as a request to be processed.
[0069] S105: Processing the pending request according to a preset three-coordinate calculation formula based on the elliptic curve point adder to obtain a new scalar and elliptic curve point, and transmitting the new scalar and elliptic curve point to the arbitrator for the next round of cyclic processing together with the scalars and elliptic curve points in the first-in-first-out queue;
[0070] In one embodiment, an elliptic curve adder calculates and outputs the new coordinates and the corresponding scalar based on the coordinates of two input points. A single elliptic curve adder can perform atomic operations including point addition and multiplication. When the two input points are identical, a multiplication operation is performed; when they are different, the addition of two elliptic curve points is performed.
[0071] In one embodiment, the obtained new scalar and elliptic curve point are transmitted to the arbitrator, and the scalar and elliptic curve point transmitted to the arbitrator by the first-in-first-out queue are processed in the next round of loop.
[0072] S106 . When the FIFO queue is empty, end the loop processing, and perform bucket aggregation and group aggregation processing based on the bucket status register table to obtain a calculation result.
[0073] In one embodiment, when the FIFO queue is empty, all scalar points have been processed, the loop ends, the status register in the bucket module changes, and the bucket aggregation phase and the group aggregation phase are entered.
[0074] Specifically, bucket aggregation involves traversing all non-empty buckets in index order or in parallel, reading all points in the current bucket, and summing all points in each bucket to obtain the accumulated result. Group aggregation involves weighted combination of the accumulated results of each bucket according to the bucket weight to obtain the final multi-scalar multiplication result.
[0075] The above embodiment maintains the read and write status of the target buckets accessed by the two elliptic curve points, and activates the buffer only when the read and write status of the two target buckets are the same according to the activation and idle status of the control buffer. The elliptic curve point adder adopts a solution based on the three-coordinate operation formula to optimize multi-scalar multiplication operations, reduce the storage operations and coordinate storage space of the buffer, and thus reduce the buffer depth and resource consumption.
[0076] See also Figure 3 , Figure 3 This is a schematic flow chart of an optimization method for multi-scalar multiplication operations provided in an embodiment of the present application.
[0077] like Figure 3 As shown, the optimization method for multi-scalar multiplication operation specifically includes steps S201 to S202.
[0078] S201: Analyze the pending request based on the elliptic curve point adder, and obtain the coordinates of two elliptic curve points respectively, wherein the coordinates are expressed in three coordinates;
[0079] S202 : Based on the large number analog multiplication module, the large number analog addition module, and the large number analog subtraction module in the elliptic curve point adder, perform point operations on the three-coordinate operation formula and the two point coordinates to obtain a new elliptic curve point.
[0080] Furthermore, the three-coordinate calculation formula is
[0081] X3=(X1Y2+X2Y1)(Y1Y2-3Z1Z2)-3(Y1Z2+Y2Z1)(X1Z2+X2Z1)
[0082] Y3=(Y1Y2+3Z1Z2)(Y1Y2-3Z1Z2)-9X1X2(X1Z2+X2Z2)
[0083] Z3=(Y1Z2+Y2Z1)(Y1Y2+3Z1Z2)+3X1X2(X1Y2+X2Y1)
[0084] (X1, Y1, Z1) are the coordinates of the first elliptic curve point, (X2, Y2, Z2) are the coordinates of the second elliptic curve point, and (X3, Y3, Z3) are the coordinates of the new elliptic curve point.
[0085] In one embodiment, the multi-scalar multiplication needs to complete the following tasks:
[0086]
[0087] Among them, K and P are both vectors with a vector length of 2 N ,i represents the point product of the i-th vector. Depending on the selected elliptic curve, each K of the K vector i They are all large scalars with more than 200 digits. P vector is a two-dimensional vector with P x and P y , both have a bit width of over 300 bits. Q is the final calculated result, also a point vector, the same as P. Elliptic curve addition is not constant addition in general situations, but point addition based on elliptic curve cryptography. Point addition means that when two points on an elliptic curve intersect, the intersection of their extended lines and the elliptic curve is the point of addition. The general formula for an elliptic curve is:
[0088] y 2 =x 3 +ax+b
[0089] Among them, a and b are both constants in a finite field. For example, when a=0 and b=1, the elliptic curve is BLS12-377. When a=0 and b=4, the elliptic curve is BLS12-381. The algorithm used in this patent takes BLS12-377 as an example, and the elliptic curve point addition adopts a three-coordinate scheme. In the affine coordinate system of the elliptic curve, point addition and point multiplication operations require the application of division operations, but for computer hardware, division is a very inefficient and time-consuming operation. In the three-coordinate scheme, division operations can be replaced by multiplication and addition operations, and the number of multiplication and addition operations is reduced, thereby improving computational efficiency. The specific formula is as follows:
[0090] X3=(X1Y2+X2Y1)(Y1Y2-3Z1Z2)-3(Y1Z2+Y2Z1)(X1Z2+X2Z1)
[0091] Y3=(Y1Y2+3Z1Z2)(Y1Y2-3Z1Z2)-9X1X2(X1Z2+X2Z2)
[0092] Z3=(Y1Z2+Y2Z1)(Y1Y2+3Z1Z2)+3X1X2(X1Y2+X2Y1)
[0093] In one embodiment, to improve the computational efficiency of the MSM, the Pippenger algorithm is used. The Pippenger algorithm significantly reduces the computational complexity of the MSM by reducing the number of scalar multiplications and optimizing the computation order, thereby accelerating the entire computation process.
[0094] Generally, all K i and P i Multiply them separately and then add them. The computational complexity of this algorithm is n 2 , but according to the Pippenger algorithm, the computational complexity can be reduced to nlog2n. Specifically, Figure 4 As shown, by taking the large number K i Split into small G j , each G j There is b position ( Figure 4 b = 4), b*j / i mod b <b。
[0095] Therefore, each G j There are 2b possibilities, and each scalar that is split must satisfy G j ≤2b, the total number of buckets is 2b*j, and the size of a unit bucket is the coordinate bit width*3. When each point accesses a bucket, it enters the corresponding bucket based on the scalar value of each bucket. This splits a point into j points. After all points have entered the bucket, the points in each bucket are already calculated. Simply multiply the bucket back to the weight at the time of initial splitting and then add them together. This eliminates the need for large scalar multiplication operations, converting them into a large number of point addition operations, reducing design complexity.
[0096] In every G j There are 2b points in the loop, and the method of storing intermediate states in a loop can be used to reduce one cycle, such as calculating B 15 +B 14 When B 15 +B 14 +B 13 and 2B 15 +B 14 , then in the next stage you can use B 15 +B 14 +B 13 It is an intermediate state, driving the next two additions at the same time. Finally, only one cycle is needed to calculate the double-cycle addition.
[0097] During the aggregation phase, each G j You need to double your own points b*j times, and then all G j Add them together to get the final result.
[0098] Specifically, the coordinates of two elliptic curve points are obtained from the pending request. The coordinates are expressed as three coordinates. These coordinates are substituted into the three-coordinate arithmetic formula to obtain the formula to be calculated. The formula is then calculated using the large-number modular multiplication module, the large-number modular addition module, and the large-number modular subtraction module to obtain the new coordinates. The scalar corresponding to the new elliptic curve point is the sum of the window values after decomposition of the two original scalars.
[0099] In order to reduce repeated operations and improve computational efficiency, the current elliptic curve point addition operation often adopts a four-coordinate scheme, that is, the coordinates of an elliptic curve point are represented by four coordinate values. For example, in the extended Jacobian coordinates, the coordinates of an elliptic curve point can be represented as (X, Y, Z, T), where T = aZ 4 (a is the elliptic curve parameter), (X, Y, Z) is consistent with the traditional Jacobian coordinates and is used to represent the position of the point, and T is used to cache the intermediate values related to the curve parameters a and Z to avoid repeated calculations. However, the four-coordinate solution results in a very high bit width for single read and write, which in turn causes high power consumption and resource occupation. Therefore, the embodiment of the present application adopts a three-coordinate solution and different mathematical formulas to calculate point addition, which not only avoids repeated calculations, but also reduces the register space required for unit operations and the input and output bit width of the point adder module, achieving quantifiable effects such as a 25% reduction in register space and a 30% reduction in bit width.
[0100] Furthermore, the large number analog multiplication module, large number analog addition module and large number analog subtraction module in the elliptic curve point adder perform point operations on the three-coordinate operation formula and the two point coordinates to obtain a new elliptic curve point, including: generating an operation task based on the three-coordinate operation formula and the point coordinates; splitting the operation task based on the operation attributes to obtain at least one operation subtask; and performing parallel calculations on the operation subtasks based on the large number analog multiplication module, the large number analog addition module and the large number analog subtraction module to obtain the new elliptic curve point.
[0101] In one embodiment, specific operation tasks are generated according to the three-coordinate operation formula and the point coordinates, and each operation task includes operations such as scalar multiplication and point addition.
[0102] The computational tasks are classified and split according to the operation attributes (such as multiplication, point addition, point doubling, etc.) and the characteristics of the data (such as the coordinates of the points, the size of the scalar, etc.).
[0103] Splitting strategies can include splitting by scalar size: splitting a larger scalar multiplication task into multiple smaller scalar multiplication tasks. For example, calculating a×P can be split into multiple point additions and point doubling operations; splitting by point grouping: grouping multiple point scalar multiplication tasks, and the points within each group can be processed in parallel; splitting by operation type: processing scalar multiplication and point addition separately to optimize different types of operations.
[0104] In one embodiment, the large-number analog multiplication module is responsible for performing large-number analog multiplication operations, which are typically used for point doubling operations in scalar multiplication. The large-number analog addition module and the large-number analog subtraction module are responsible for performing large-number analog addition and subtraction operations. The large-number analog multiplication submodule utilizes a Karatsuba module, while the large-number analog addition and large-number analog subtraction modules utilize a single module with configurable addition and subtraction functions.
[0105] In one embodiment, the large number modular multiplication module is implemented using the Barrett algorithm. The Barrett algorithm is an algorithm for efficiently calculating large number modular multiplication (i.e., calculating a*b mod n). It improves the efficiency of modular operations by pre-calculating and reducing division operations, and is particularly suitable for large number operations. By pre-calculating a constant μ, the division operation in the modular operation is converted into multiplication and bit shift operations, thereby improving computational efficiency. The specific steps are as follows:
[0106] 1. Select
[0107] 2. Calculate t←(a﹒m)>>k
[0108] 3. Calculate a←at﹒q
[0109] 4.if a≥q
[0110] 5.a←aq
[0111] 6.return a
[0112] Among them, the symbol Indicates rounding up, the symbol Indicates rounding down.
[0113] In one embodiment, a submodule (the Karatsuba module) of the large-number modular multiplication module employs the Karatsuba algorithm, a highly efficient algorithm for large-number multiplication. This algorithm reduces the number of multiplication operations by employing a divide-and-conquer approach, thereby improving computational efficiency. Specifically, a 384-bit constant multiplication is converted into three half-bit-width constant multiplications, iterating until the sub-unit is 48 bits. The multiplications at different locations are then processed in parallel and finally merged into the final result.
[0114] For example, when calculating a large number X*Y, X*Y can be converted to AB*CD, where AB and CD are the two parts of X and Y with equal digits. According to the general principle, AB*CD = AC+(AD+BC)+BD. If the intermediate value (AD+BC) is converted to (A+B)*(C+D)-AC-BD, the already calculated values AC and BD can be used as intermediate states, avoiding repeated calculations. Compared to the general solution of two multiplications and one addition, the Karatsuba algorithm only needs to perform a single multiplication with half the bit width of X and Y to calculate the intermediate result.
[0115] In one embodiment, by assigning computational subtasks to different modules for parallel computation, computational efficiency can be significantly improved. For example, multiple subtasks can be executed simultaneously on different large-scale analog-to-analog multiplication modules, large-scale analog-to-analog addition modules, and large-scale analog-to-analog subtraction modules.
[0116] In the above embodiment, the use of a three-coordinate solution reduces the register resources occupied when storing coordinate information, significantly reducing the required register space. Using a three-coordinate solution reduces register space by approximately 24%, thus reducing resource consumption. Secondly, by integrating large number arithmetic modules (including large number analog multiplication modules, large number analog addition modules, and large number analog subtraction modules) into the elliptic curve point adder, coarse-grained, fully pipelined point computation can be achieved, allowing multiple computation steps to be executed in parallel, accelerating the overall computation process and significantly improving computational efficiency.
[0117] See also Figure 5 , Figure 5 The embodiment of the present application provides a schematic block diagram of an optimization device for multi-scalar multiplication operations, which is used to perform the aforementioned optimization method for multi-scalar multiplication operations. The optimization device for multi-scalar multiplication operations can be configured on a server.
[0118] like Figure 5 As shown, the multi-scalar multiplication optimization device 300 includes:
[0119] a target bucket determination module 301 for receiving, based on the arbitrator, the scalar and elliptic curve point transmitted by the FIFO queue and the elliptic curve point adder, and determining whether the target buckets accessed by the two elliptic curve points are the same;
[0120] a read / write status update module 302 for analyzing the scalar based on the bucket status register table to determine the number of times the two elliptic curve points access the target bucket when the target buckets accessed by the two elliptic curve points are different, and updating the read / write status of the two target buckets based on the number of times;
[0121] an addition request generation module 303 for controlling the scalar and elliptic curve point to access a target bucket according to the read / write status and the access count when the bucket module receives the scalar and elliptic curve point, and activating the buffer when the read / write status of the two target buckets are the same, and storing the addition request generated according to the two sets of scalars and elliptic curve points in the buffer;
[0122] a pending request determination module 304 for determining a pending request from the received addition requests based on the multiplexer, and transmitting the target request to the elliptic curve point adder;
[0123] an addition request processing module 305 for processing the pending request based on the elliptic curve point adder according to a preset three-coordinate operation formula to obtain a new scalar and elliptic curve point, and transmitting the new scalar and elliptic curve point to the arbitrator for a next round of cyclic processing with the scalars and elliptic curve points in the first-in-first-out queue;
[0124] The operation result obtaining module 306 is used to end the loop processing when the first-in-first-out queue is empty, and perform bucket aggregation and group aggregation processing based on the bucket status register table to obtain the operation result.
[0125] Furthermore, the addition request processing module 305 includes:
[0126] a point coordinate acquisition unit, configured to analyze the pending request based on the elliptic curve point adder, and respectively acquire point coordinates of two elliptic curve points, wherein the point coordinates are represented by three coordinates;
[0127] The point operation unit is used to perform point operation on the three-coordinate operation formula and the two point coordinates based on the large number analog multiplication module, large number analog addition module and large number analog subtraction module in the elliptic curve point adder to obtain a new elliptic curve point.
[0128] Furthermore, the point operation unit includes:
[0129] A calculation task generating subunit, configured to generate a calculation task based on the three-coordinate calculation formula and the point coordinates;
[0130] A computing task splitting subunit, configured to split the computing task based on computing attributes to obtain at least one computing subtask;
[0131] The parallel computing subunit is used to perform parallel computing on the operation subtask based on the large number analog multiplication module, the large number analog addition module and the large number analog subtraction module to obtain the new elliptic curve point.
[0132] Furthermore, the three-coordinate calculation formula is
[0133] X3=(X1Y2+X2Y1)(Y1Y2-3Z1Z2)-3(Y1Z2+Y2Z1)(X1Z2+X2Z1)
[0134] Y3=(Y1Y2+3Z1Z2)(Y1Y2-3Z1Z2)-9X1X2(X1Z2+X2Z2)
[0135] Z3=(Y1Z2+Y2Z1)(Y1Y2+3Z1Z2)+3X1X2(X1Y2+X2Y1)
[0136] (X1, Y1, Z1) are the coordinates of the first elliptic curve point, (X2, Y2, Z2) are the coordinates of the second elliptic curve point, and (X3, Y3, Z3) are the coordinates of the new elliptic curve point.
[0137] Furthermore, the optimization device 300 for multi-scalar multiplication operations also includes an addition request generation module, which is used to generate an addition request based on the arbitrator and two groups of scalars and elliptic curve points when the target buckets accessed by the two elliptic curve points are the same, and distribute the addition request to the multiplexer.
[0138] Furthermore, the optimization device 300 for multi-scalar multiplication operations also includes an addition request generation module, which is used to generate an addition request based on the bucket module and two groups of scalars and elliptic curve points when the read and write states of the target bucket are different, and transmit the addition request to the multiplexer.
[0139] Furthermore, the multi-scalar multiplication optimization device 300 further includes a data storage and reading module, which includes:
[0140] a data receiving unit, configured to receive a scalar and an elliptic curve point input by a user based on the first-in-first-out queue, and perform a bit width alignment operation on the scalar;
[0141] The data reading unit is used to read the scalar and the elliptic curve point to the arbitrator according to a preset reading rule.
[0142] It should be noted that those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices and modules can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0143] The above-mentioned device can be realized in the form of a computer program. The computer program can be used in Figure 6 Runs on the computer equipment shown.
[0144] See also Figure 6 , Figure 6 1 is a schematic block diagram of a computer device provided in an embodiment of the present application. The computer device may be a server.
[0145] See Figure 6 The computer device includes a processor, a memory, and a network interface connected through a system bus, wherein the memory may include a non-volatile storage medium and an internal memory.
[0146] The non-volatile storage medium can store an operating system and a computer program. The computer program includes program instructions, and when the program instructions are executed, the processor can execute any optimized method for multi-scalar multiplication operations.
[0147] The processor is used to provide computing and control capabilities and support the operation of the entire computer equipment.
[0148] The internal memory provides an environment for the operation of a computer program in a non-volatile storage medium. When the computer program is executed by a processor, the processor can execute any optimized method for multi-scalar multiplication operations.
[0149] The network interface is used for network communication, such as sending assigned tasks, etc. Those skilled in the art will understand that Figure 6 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0150] It should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc.
[0151] In one embodiment, the processor is configured to execute a computer program stored in the memory to implement the following steps:
[0152] The arbiter receives the scalar and elliptic curve point transmitted by the first-in-first-out queue and the elliptic curve point adder respectively, and determines whether the target buckets accessed by the two elliptic curve points are the same;
[0153] When the target buckets accessed by the two elliptic curve points are different, analyzing the scalar based on the bucket status register table to determine the number of times the two elliptic curve points access the target bucket, and updating the read and write status of the two target buckets based on the number of accesses;
[0154] When the bucket module receives the scalar and the elliptic curve point, it controls the scalar and the elliptic curve point to access the target bucket according to the read / write status and the access count, and when the read / write status of the two target buckets are the same, activates the buffer, and stores the addition request generated according to the two sets of scalars and the elliptic curve point based on the buffer;
[0155] determining a pending request from among the received addition requests based on the multiplexer, and transmitting the target request to the elliptic curve point adder;
[0156] Processing the pending request based on the elliptic curve point adder according to a preset three-coordinate operation formula to obtain a new scalar and elliptic curve point, and transmitting the new scalar and elliptic curve point to the arbitrator to perform the next round of cyclic processing with the scalars and elliptic curve points in the first-in-first-out queue;
[0157] When the first-in-first-out queue is empty, the loop processing is terminated, and bucket aggregation and group aggregation processing are performed based on the bucket status register table to obtain a calculation result.
[0158] In one embodiment, when the processor processes the pending request based on the elliptic curve point adder according to a preset three-coordinate operation formula to obtain a new elliptic curve point, the processor is configured to implement:
[0159] Analyzing the pending request based on the elliptic curve point adder, and obtaining point coordinates of two elliptic curve points respectively, wherein the point coordinates are represented by three coordinates;
[0160] Based on the large number analog multiplication module, the large number analog addition module and the large number analog subtraction module in the elliptic curve point adder, point operations are performed on the three-coordinate operation formula and the two point coordinates to obtain a new elliptic curve point.
[0161] In one embodiment, when the processor performs point operations on the three-coordinate operation formula and the two point coordinates based on the large number analog multiplication module, the large number analog addition module, and the large number analog subtraction module in the elliptic curve point adder to obtain a new elliptic curve point, it is configured to implement:
[0162] Generate a calculation task based on the three-coordinate calculation formula and the point coordinates;
[0163] Splitting the computing task based on computing attributes to obtain at least one computing subtask;
[0164] The operation subtasks are calculated in parallel based on the large number analog multiplication module, the large number analog addition module and the large number analog subtraction module to obtain the new elliptic curve point.
[0165] In one embodiment, the three-coordinate calculation formula is:
[0166] X3=(X1Y2+X2Y1)(Y1Y2-3Z1Z2)-3(Y1Z2+Y2Z1)(X1Z2+X2Z1)
[0167] Y3=(Y1Y2+3Z1Z2)(Y1Y2-3Z1Z2)-9X1X2(X1Z2+X2Z2)
[0168] Z3=(Y1Z2+Y2Z1)(Y1Y2+3Z1Z2)+3X1X2(X1Y2+X2Y1)
[0169] (X1, Y1, Z1) are the coordinates of the first elliptic curve point, (X2, Y2, Z2) are the coordinates of the second elliptic curve point, and (X3, Y3, Z3) are the coordinates of the new elliptic curve point.
[0170] In one embodiment, after the processor implements receiving, by the arbiter, the scalar and the elliptic curve point transmitted by the first-in-first-out queue and the elliptic curve point adder, respectively, and determining whether the target buckets accessed by the two elliptic curve points are the same, the processor is further configured to implement:
[0171] When the target buckets accessed by the two elliptic curve points are the same, an addition request is generated based on the arbiter and two groups of scalars and elliptic curve points, and the addition request is distributed to the multiplexer.
[0172] In one embodiment, after the processor receives a scalar and an elliptic curve point in the bucket status register table, determines the number of accesses of the two elliptic curve points to the target bucket according to the scalar, and updates the read and write status of the two target buckets based on the number of accesses, the processor is further configured to implement:
[0173] When the read and write states of the target bucket are different, an addition request is generated based on the bucket module and two groups of scalars and elliptic curve points, and the addition request is transmitted to the multiplexer.
[0174] In one embodiment, before implementing the arbiter receiving the scalar and elliptic curve point transmitted by the first-in-first-out queue and the elliptic curve point adder, and determining whether the target buckets accessed by the two elliptic curve points are the same, the processor is further configured to implement:
[0175] receiving a scalar and an elliptic curve point input by a user based on the first-in-first-out queue, and performing a bit width alignment operation on the scalar;
[0176] According to the preset reading rules, the scalar and the elliptic curve point are read to the arbitrator.
[0177] An embodiment of the present application also provides a computer-readable storage medium, which stores a computer program, and the computer program includes program instructions. The processor executes the program instructions to implement any one of the multi-scalar multiplication optimization methods provided in the embodiments of the present application.
[0178] The computer-readable storage medium may be an internal storage unit of the computer device described in the aforementioned embodiment, such as a hard disk or memory of the computer device. The computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a SmartMedia Card (SMC), a Secure Digital (SD) card, a flash memory card, etc., equipped on the computer device.
[0179] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in the present application, and such modifications or substitutions should be included in the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.
Claims
1. A method for optimizing multi-scalar multiplication operations, characterized in that: The optimization method is applied to a multi-scalar multiplication operation system, which includes a first-in-first-out queue, an arbiter, a bucket status register table, a bucket module, a buffer, a multiplexer, and an elliptic curve point adder, wherein the bucket module includes at least one bucket. The optimization method includes: The arbiter receives the scalar and elliptic curve point transmitted by the first-in-first-out queue and the elliptic curve point adder respectively, and determines whether the target buckets accessed by the two elliptic curve points are the same; When the target buckets accessed by the two elliptic curve points are different, analyzing the scalar based on the bucket status register table to determine the number of times the two elliptic curve points access the target bucket, and updating the read and write status of the two target buckets based on the number of accesses; When the bucket module receives the scalar and the elliptic curve point, it controls the scalar and the elliptic curve point to access the target bucket according to the read / write status and the access count, and when the read / write status of the two target buckets are the same, activates the buffer, and stores the addition request generated according to the two sets of scalars and the elliptic curve point based on the buffer; determining a pending request from among the received addition requests based on the multiplexer, and transmitting the target request to the elliptic curve point adder; Processing the pending request based on the elliptic curve point adder according to a preset three-coordinate operation formula to obtain a new scalar and elliptic curve point, and transmitting the new scalar and elliptic curve point to the arbitrator to perform the next round of cyclic processing with the scalars and elliptic curve points in the first-in-first-out queue; When the first-in-first-out queue is empty, the loop processing is terminated, and bucket aggregation and group aggregation processing are performed based on the bucket status register table to obtain a calculation result.
2. The optimization method for multi-scalar multiplication according to claim 1, characterized in that: The elliptic curve point adder processes the pending request according to a preset three-coordinate operation formula to obtain a new elliptic curve point, including: Analyzing the pending request based on the elliptic curve point adder, and obtaining point coordinates of two elliptic curve points respectively, wherein the point coordinates are represented by three coordinates; Based on the large number analog multiplication module, the large number analog addition module and the large number analog subtraction module in the elliptic curve point adder, point operations are performed on the three-coordinate operation formula and the two point coordinates to obtain a new elliptic curve point.
3. The optimization method for multi-scalar multiplication according to claim 2, characterized in that: The method of performing point operations on the three-coordinate operation formula and the two point coordinates based on the large number analog multiplication module, the large number analog addition module, and the large number analog subtraction module in the elliptic curve point adder to obtain a new elliptic curve point includes: Generate a calculation task based on the three-coordinate calculation formula and the point coordinates; Splitting the computing task based on computing attributes to obtain at least one computing subtask; The operation subtasks are calculated in parallel based on the large number analog multiplication module, the large number analog addition module and the large number analog subtraction module to obtain the new elliptic curve point.
4. The optimization method for multi-scalar multiplication according to claim 2, characterized in that: The three-coordinate calculation formula is: X3=(X1Y2+X2Y1)(Y1Y2-3Z1Z2)-3(Y1Z2+Y2Z1)(X1Z2+X2Z1) Y3=(Y1Y2+3Z1Z2)(Y1Y2-3Z1Z2)-9X1X2(X1Z2+X2Z2) Z3=(Y1Z2+Y2Z1)(Y1Y2+3Z1Z2)+3X1X2(X1Y2+X2Y1) (X1, Y1, Z1) are the coordinates of the first elliptic curve point, (X2, Y2, Z2) are the coordinates of the second elliptic curve point, and (X3, Y3, Z3) are the coordinates of the new elliptic curve point.
5. The optimization method for multi-scalar multiplication according to claim 1, characterized in that: After the arbiter receives the scalar and elliptic curve point transmitted by the first-in-first-out queue and the elliptic curve point adder respectively and determines whether the target buckets accessed by the two elliptic curve points are the same, the method further includes: When the target buckets accessed by the two elliptic curve points are the same, an addition request is generated based on the arbiter and two groups of scalars and elliptic curve points, and the addition request is distributed to the multiplexer.
6. The method for optimizing multi-scalar multiplication operations according to claim 5, wherein: When the bucket status register table receives a scalar and an elliptic curve point, after determining the number of accesses of the two elliptic curve points to the target bucket according to the scalar, and updating the read and write status of the two target buckets based on the number of accesses, the method further includes: When the read and write states of the target bucket are different, an addition request is generated based on the bucket module and two groups of scalars and elliptic curve points, and the addition request is transmitted to the multiplexer.
7. The method for optimizing multi-scalar multiplication operations according to any one of claims 1 to 6, characterized in that: Before the arbiter receives the FIFO queue and the scalar and elliptic curve point transmitted by the elliptic curve point adder respectively and determines whether the target buckets accessed by the two elliptic curve points are the same, the method further includes: receiving a scalar and an elliptic curve point input by a user based on the first-in-first-out queue, and performing a bit width alignment operation on the scalar; According to the preset reading rules, the scalar and the elliptic curve point are read to the arbitrator.
8. An optimization device for multi-scalar multiplication operations, characterized in that: include: a target bucket determination module, configured to receive the FIFO queue and the scalar and elliptic curve point transmitted by the elliptic curve point adder based on the arbitrator, and determine whether the target buckets accessed by the two elliptic curve points are the same; a read / write status update module, configured to analyze the scalar based on the bucket status register table when the target buckets accessed by the two elliptic curve points are different, determine the number of times the two elliptic curve points access the target bucket, and update the read / write status of the two target buckets based on the number of accesses; an addition request generation module, configured to, when the bucket module receives a scalar and an elliptic curve point, control the scalar and the elliptic curve point to access a target bucket according to the read / write status and the access count, and activate the buffer when the read / write status of the two target buckets are the same, and store the addition request generated according to the two sets of scalars and elliptic curve points in the buffer; a pending request determination module, configured to determine a pending request from among the received addition requests based on the multiplexer, and transmit the target request to the elliptic curve point adder; an addition request processing module, configured to process the pending request based on the elliptic curve point adder according to a preset three-coordinate operation formula to obtain a new scalar and elliptic curve point, and transmit the new scalar and elliptic curve point to the arbitrator for a next round of cyclic processing with the scalars and elliptic curve points in the first-in-first-out queue; The operation result obtaining module is used to end the loop processing when the first-in-first-out queue is empty, and perform bucket aggregation and group aggregation processing based on the bucket status register table to obtain the operation result.
9. A computer device, characterized in that: The computer device includes a memory and a processor; The memory is used to store computer programs; The processor is configured to execute the computer program and implement the optimization method for multi-scalar multiplication operations according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, which, when executed by a processor, enables the processor to implement the optimization method for multi-scalar multiplication operations according to any one of claims 1 to 7.
Citation Information
Patent Citations
Elliptic curve multi-scalar point multiplication calculation optimization method and optimization device
CN113504895A
Elliptic curve point and hardware acceleration method and device
CN115344525A
Multi-scalar multiplier and acceleration method
CN116954559A
Multi-scalar multiplication method and device, equipment and storage medium
CN119045894A
Multi-scalar multiplication acceleration method based on point cache mechanism and hardware accelerator thereof
CN119225688A