Elliptic curve point multiplication operation method, signature method and device, medium and equipment
By employing an elliptic curve dot product method with segmented traversal and pseudo-double point operations, the vulnerability of elliptic curve signature algorithms to side-channel attacks is addressed, achieving higher security and lower performance loss.
Patent Information
- Application Number
- CN202210284538.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-22
- Publication Date
- 2026-11-24
- Estimated Expiration
- 2042-03-22
AI Technical Summary
Existing elliptic curve signature algorithms are vulnerable to side-channel energy attacks during dot product operations, leading to private key leakage and insufficient security.
A segmented traversal method is used to perform dot multiplication, combined with pseudo-double dot operations and dot addition operations, to prevent attackers from determining the bit values of data segments through side-channel characteristics and inserting pseudo-double dot operations to disrupt side-channel characteristics.
It effectively resists grid attacks, reduces the risk of private key leakage, and at the same time minimizes performance loss while improving security and efficiency.
Smart Images

Figure CN116827547B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of cryptographic algorithm technology, specifically to an elliptic curve dot product operation method, signature method, apparatus, medium, and device. Background Technology
[0002] Elliptic curve signature algorithm is a public-key cryptographic algorithm based on the discrete logarithm problem on elliptic curves. It is widely used due to its short key length and high algorithm security.
[0003] The key step in elliptic curve signature algorithms is the dot product operation. In performance-critical implementations, the dot product algorithm is typically implemented using a fast algorithm, such as the comb algorithm. The principle of the comb algorithm is: before performing the dot product operation on a point on the elliptic curve, pre-calculate and store the pre-calculated point corresponding to the window length in bits. Subsequently, during the dot product calculation, each time a dot product scalar of the window length is processed, doubling and addition operations can be performed. Compared to the original method that processes only one bit of the dot product scalar at a time, the comb algorithm significantly speeds up the dot product operation.
[0004] However, when using the elliptic curve signature algorithm to sign information, if the dot product operation is performed using the comb algorithm described above, attackers can use side-channel energy attacks to crack the private key of the elliptic curve signature algorithm, leading to information leakage. Summary of the Invention
[0005] The problem this invention aims to solve is: how to improve the security of using elliptic curve signature algorithms.
[0006] To address the above problems, embodiments of the present invention provide a method for calculating the dot product of elliptic curves, the method comprising:
[0007] Receive first data and segment the first data to obtain each data segment of the first data, wherein the length of each data segment is the ratio of the length of the first data to the length of the window.
[0008] Starting from the most significant bit of each data segment, each bit of each data segment is traversed sequentially, and a doubling operation and a dot addition operation are performed in each traversal. The doubling operation is performed on the result of the previous dot addition operation, and the dot addition operation is performed on the result of the current doubling operation and the result of the current dot multiplication operation of the preset point on the elliptic curve.
[0009] The result of the dot addition operation corresponding to the least significant bit of each data segment is used as the final dot multiplication result of the preset point and output.
[0010] Specifically, when the current traversal is the preset traversal of each data segment, a pseudo-double point operation is performed on the result of the previous point addition operation before the doubling operation is performed on the result of the previous point addition operation.
[0011] This invention also provides an elliptic curve signature method, the method comprising:
[0012] Acquire key data, relevant parameter values on the elliptic curve, and data for preset points;
[0013] Generate the first data, and use any of the above-mentioned elliptic curve dot product calculation methods to obtain the final dot product result of the preset point;
[0014] Based on the final dot product result of the preset points, the data to be signed is signed to obtain the signature result corresponding to the data to be signed.
[0015] This invention also provides a device for calculating the dot product of elliptic curves, the device comprising:
[0016] The segmentation unit is adapted to receive first data and segment the first data to obtain various data segments of the first data, wherein the length of each data segment is the ratio of the length of the first data to the window length.
[0017] The operation unit is adapted to traverse each bit of each data segment sequentially, starting from the most significant bit of each data segment, and to perform a doubling operation and a dot addition operation in each traversal process; the doubling operation is to perform a doubling operation on the result of the previous dot addition operation, and the dot addition operation is to perform a dot addition operation on the result of the current doubling operation and the result of the current dot multiplication operation on a preset point on the elliptic curve.
[0018] The output unit is adapted to take the result of the dot addition operation corresponding to the least significant bit of each data segment as the final dot multiplication result of the preset point and output it.
[0019] Specifically, when the current traversal is the preset traversal of each data segment, a pseudo-double point operation is performed on the result of the previous point addition operation before the doubling operation is performed on the result of the previous point addition operation.
[0020] This invention also provides an elliptic curve signature device, the device comprising:
[0021] The acquisition unit is suitable for acquiring key data, relevant parameter values on the elliptic curve, and data of preset points.
[0022] The dot product operation unit is adapted to generate the first data and, using any of the above-mentioned elliptic curve dot product operation methods, obtain the final dot product result of the preset point.
[0023] The signature generation unit is adapted to sign the data to be signed based on the final dot product operation result of the preset point, and obtain the signature result corresponding to the data to be signed.
[0024] This invention also provides an electronic device, which includes the above-described elliptic curve signature device.
[0025] This invention also provides a computer-readable storage medium having a computer program stored thereon, the computer program being executed by a processor to implement the steps of any of the methods described above.
[0026] This invention also provides an electronic device, including a memory and a processor, wherein the memory stores a computer program that can run on the processor, and the processor executes the steps of any of the methods described above when running the computer program.
[0027] Compared with the prior art, the technical solution of the embodiments of the present invention has the following advantages:
[0028] Applying the scheme of this invention, after the current traversal is the preset traversal of each data segment, in addition to performing the doubling operation and the doubling operation in sequence, a pseudo doubling operation is also performed on the result of the previous doubling operation before performing the doubling operation on the result of the previous doubling operation. Even if the side-channel feature of not performing the doubling operation when the result of the doubling operation of the preset point on the elliptic curve is zero is exploited by the attacker, due to the existence of the pseudo doubling operation, the position information of a certain bit value of a certain data segment obtained by the attacker in the first data is incorrect, so it is impossible to successfully perform a lattice attack to obtain the value of the private key in the elliptic curve signature algorithm. Attached Figure Description
[0029] Figure 1 This is a flowchart of an elliptic curve dot product operation method according to an embodiment of the present invention;
[0030] Figure 2 This is a flowchart of an elliptic curve signature method according to an embodiment of the present invention;
[0031] Figure 3 This is a schematic diagram of the structure of an elliptic curve dot product calculation device according to an embodiment of the present invention;
[0032] Figure 4 This is a schematic diagram of the structure of an elliptic curve signature device according to an embodiment of the present invention. Detailed Implementation
[0033] Using the comb algorithm to solve the finite field F on the elliptic curve P Taking the dot product operation on point P as an example, assuming the first data to be multiplied on point P is k, the binary representation of the first data k is: (k l-1Let ,……,k1,k0), where l represents the total length of the first data k. The window length is w, where w is an integer greater than or equal to 1. Let That is, rounding up the value of l / w. The specific process of performing a dot product operation on point P is as follows:
[0034] Step 1: Divide the first data k into segments, and let the first data k = K. w-1 ||...||K 1 ||K 0 For any data segment K of the first data k j The binary length of each data segment is t, j∈[0, w-1]. The dot product of the first data k and the data segment consisting of the same bit is pre-calculated. For example, let... Indicates data segment K j If the i-th bit is given by the first data k, then the dot product of the i-th bit of each data segment of the first data k with the first data k can be expressed as: By analogy, we can obtain the w-fold multiplication results of the data consisting of the same bit in each data segment of the first data k and the first data k.
[0035] Step 2: Initialize Q to 0. From i = t-1 to i = 0, for any value of i, sequentially perform doubling and doubling operations on the dot addition result obtained in the previous traversal. Finally, output the dot addition result at i = 0 as the final result of the dot multiplication operation on point P. For example, performing a doubling operation on the dot addition result obtained in the previous traversal involves taking twice the value of the previous dot addition result, and then performing a dot addition operation on the result of the dot multiplication of the same bit of each data segment of the current first data k with the first data k. The result of the doubling and addition operations in this round will be the number of operations to be performed in the next round.
[0036] In step 2 above, when When Q = 2Q, the algorithm will not perform a dot addition operation, meaning it will not execute. This operation. At this point, the attacker can determine the current situation by observing the side-channel characteristics of the dot addition and doubling operations during the dot multiplication process. Is it 0? Because The expected value is 1 / 2 w Therefore, if an attacker only knows a portion of the scalars in a single dot product process, they cannot threaten the entire dot product.
[0037] However, attackers can call the signature function multiple times and filter out signatures with 0 at specific positions in the dot product based on side-channel characteristics. By combining this with lattice attack methods, they can obtain the private key in the elliptic curve signature algorithm.
[0038] Taking the encryption of message m using the elliptic curve signature algorithm as an example, after selecting the first data k, a dot product operation is first performed on point P on the curve to obtain the result Q, where the value of k is in the range of 1≤k≤n-1, and n is an integer. Assuming the coordinates of Q are (x1, y1), based on the x-coordinate x1 of Q, we can obtain r = x1modn. Based on the first data k, the hash result e of message m, and the private key d, the value of s is calculated, s = k -1 (e+dr)modn, then send message m and signature {r, s} to the receiver.
[0039] The elliptic curve signature formula s=k -1 Transforming (e+dr)modn, we get sk-rd=emodn, where s, r, and e are known numbers, and k and d are unknowns. The private key d is fixed for each signature. An attacker can obtain partial information about k from each signature through a side-channel attack. By signing multiple times, the attacker can construct an Extended Hidden Number Problem (EHNP) concerning k and d. Solving the EHNP problem using relevant algorithms will yield the value of the private key d.
[0040] To resist the aforementioned lattice attacks, it is necessary to prevent attackers from obtaining information about k during the elliptic curve signature process. A commonly used method is to use a pseudo-dot addition operation during the dot product process. The pseudo-dot addition operation is performed during the dot product process when... Even when the value is 0, a dot increment operation is performed; that is, regardless of... Whether the result is 0 or not, a dot-matrix addition operation is performed. However, the result of this dot-matrix addition operation is only stored in the pseudo-operation result buffer and is not involved in subsequent normal calculations.
[0041] Because regardless Whether it equals 0 or not, a dot addition operation is performed. Therefore, attackers cannot determine the value of part of k through the side-channel characteristics of the dot product (such as power consumption, electromagnetic, optical, thermal, etc.), and thus cannot carry out the next step of the lattice attack.
[0042] Let D represent the time required for one dot multiplication, and A represent the time required for one dot addition. The inventors discovered that when the scalar length of the dot product is l and the window length of the comb algorithm is w, the time required to calculate one dot product using the above comb algorithm is... When using a scheme that adds a pseudo-addition operation during the dot product process, the time to calculate one dot product is... The performance loss at this point is: For example, when w=2 and D and A are considered to be approximately equal, using a scheme that adds a pseudo-dot addition operation during the dot product process results in a performance loss of approximately 14.3% compared to the original combing algorithm.
[0043] To address this problem, this invention provides an elliptic curve dot product operation method. Applying the above scheme, before performing a doubling operation on the result of the previous dot product operation, a pseudo-doubling dot operation is performed on the result of the previous dot product operation. This prevents attackers from exploiting the side-channel characteristic that prevents dot product operations when the result of the dot product operation at a preset point on the elliptic curve is zero. Due to the existence of the pseudo-doubling dot operation, the attacker obtains an incorrect position information for a certain bit value in a certain data segment within the first data, thus preventing a successful lattice attack to obtain the private key value in the elliptic curve signature algorithm.
[0044] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
[0045] Reference Figure 1 This invention provides a method for calculating the dot product of elliptic curves, which may include the following steps:
[0046] Step 11: Receive the first data and segment the first data to obtain each data segment of the first data, wherein the length of each data segment is the ratio of the length of the first data to the window length.
[0047] In practice, the first data k can be randomly generated. Assume that after segmenting the first data k, we get k = K. w-1 ||...||K 1 ||K0. For any data segment K of the first data k. j The binary length of each element is t, j∈[0, w-1]. t is the ratio of the length l of the first data k to the window length w, i.e.
[0048] It should be noted that in specific implementation, when necessary, "0"s can be added to the high bits to make the length of each data segment of the first data k t.
[0049] Step 12: Starting from the most significant bit of each data segment, traverse each bit of each data segment sequentially, and perform doubling and dot addition operations in each traversal.
[0050] Specifically, the doubling operation is performed on the result of the previous doubling operation, and the doubling operation is performed on the result of the current doubling operation and the result of the current dot product operation on a preset point on the elliptic curve. When the current traversal is the preset traversal of each data segment, a pseudo-doubling operation is performed on the result of the previous doubling operation before performing the doubling operation on the result of the previous doubling operation.
[0051] Assume that each data segment of the first data k has a length of t, meaning each data segment includes bits 0 to t-1, where bit 0 is the least significant bit and bit t-1 is the most significant bit. Starting from the most significant bit of each data segment, we iterate through each bit of each data segment sequentially. Specifically, we iterate through bit t-1 of each data segment the first time, bit t-2 the second time, and so on, until we iterate through bit 0 the last time. Each bit traversed in each iteration forms a point on the elliptic curve, which is used for subsequent dot-multiplication with a preset point P.
[0052] For example, the first data k is divided into four data segments, namely K 0 K 1 K 2 and K 3 When t = 4, each data segment K includes bits 0 through 3. The first traversal yields the 3rd bit of each data segment, i.e. The second traversal yields the second bit of each data segment, i.e. The third traversal yields the first bit of each data segment, i.e. The fourth traversal yields the 0th bit of each data segment, i.e.
[0053] In each iteration, a doubling operation and a doubling operation are performed sequentially. In one embodiment of the invention, the doubling operation may be a doubling operation based on the result of the previous doubling operation.
[0054] Specifically, the initial value of the dot product result Q of a preset point P on the elliptic curve can be set to Q. t =0.
[0055] During the first traversal, for Q... t Perform a doubling operation, then apply the value to Q. t The result of performing the doubling operation is then used to perform the dot addition operation, yielding the result Q of the first dot addition operation. t-1 Among them, the pair Q t Performing a doubling operation can specifically involve calculating Q. t Twice that of Q. t The result of the doubling operation is followed by a dot addition operation, which calculates the dot product between the most significant bit of each data segment and a preset dot, and then multiplies the result by 2Q. t The point addition operation between them will result in the same outcome.
[0056] During the second traversal, the result Q of the first point addition operation is applied. t-1 Perform a doubling operation, then apply the value to Q. t-1 Performing a doubling operation on the result of a doubling operation, followed by a dot addition operation, yields the result Q of the second dot addition operation. t-2 Among them, the pair Qt-1 Performing a doubling operation can specifically involve calculating Q. t-1 Twice that of Q. t-1 The result of the doubling operation is followed by a dot addition operation, which calculates the dot product between the second-highest bit of each data segment and the preset point, and then multiplies it by 2Q. t-1 The point addition operation between them will result in the same outcome.
[0057] ...
[0058] During the final traversal, a doubling operation is performed on the result Q1 of the previous dot-mapping operation, and then a dot-mapping operation is performed on the result of the doubling operation on Q1, resulting in the final dot-mapping result Q0. The final dot-mapping result Q0 is the dot-mapping result corresponding to the least significant bit of each data segment. Specifically, performing a doubling operation on Q1 can be calculating twice Q1. Performing a dot-mapping operation on the result of the doubling operation on Q1 involves calculating the dot product between the least significant bit of each data segment and a preset point, and then adding the result to 2Q1.
[0059] The current dot product operation result of the preset point is the dot product operation result of each bit of each data segment in the current traversal with the preset point. For example, when the current traversal is to traverse the i-th bit of each data segment, the current dot product operation of the preset point, that is, the dot product operation between the i-th bit of each data segment and the preset point P, is performed.
[0060] In practice, the result of the dot product operation between the points formed by the same bit in each data segment and the preset point can be pre-calculated. During the final dot product operation of the preset point P, the pre-calculated result is directly used. Simply perform the calculation.
[0061] In embodiments of the present invention, after each traversal of each data segment, in addition to sequentially performing the doubling operation and the dot addition operation, at least one pseudo-doubling operation can be inserted. The number and timing of the pseudo-doubling operation insertion can be set according to actual needs and are not limited here. It is understood that as long as a pseudo-doubling operation is inserted, it falls within the protection scope of the present invention.
[0062] A pseudo-double point operation is a doubling operation based on the result of the previous doubling operation, but it is unrelated to subsequent doubling and doubling operations. The pseudo-double point operation and subsequent doubling operations belong to the same doubling operation.
[0063] When the current traversal is the preset traversal of each data segment, a pseudo-double point operation is performed on the result of the previous point addition operation before the doubling operation is performed on the result of the previous point addition operation.
[0064] In one embodiment of the present invention, the preset number can be a first random number y. That is, when the current traversal is the y-th traversal of each data segment, before performing a doubling operation on the result of the previous dot addition operation, a pseudo-doubling operation is performed on the result of the previous dot addition operation. At this time, during the entire process of performing dot multiplication on the preset point, only one pseudo-doubling operation is inserted. The first random number y is less than or equal to the length t of the data segment.
[0065] In another embodiment of the present invention, the preset number of iterations may include a second random number x and a third random number u. That is, when the current iteration is the x-th iteration and the u-th iteration of each data segment, a pseudo-multiplication operation is inserted, where x < u, and both x and u are less than or equal to the length t of the data segment. In this case, only two pseudo-multiplication operations are inserted during the entire process of performing a dot product operation on the preset point.
[0066] In other embodiments, the preset number may also include three or more random numbers, that is, during the entire process of performing a dot multiplication operation on the preset point, three or more pseudo-multiplication point operations are inserted.
[0067] Understandably, the more times pseudo-multiple point insertions are performed, the better the attack prevention effect, but the greater the performance penalty. Those skilled in the art can set the number of pseudo-multiple point insertions according to actual needs.
[0068] In practice, there are several ways to set the timing for inserting pseudo-multiple points. For example, pseudo-multiple points can be inserted during the first few traversals of the data segment, or during the later traversals of the data segment.
[0069] In a preferred embodiment of the present invention, the length of the data segment is t, the value range of the second random number x is [0, 3], and the value range of the third random number u is [t-5, t-2]. That is, a pseudo-double point operation is inserted during the first four traversals, and another pseudo-double point operation is inserted during the last four traversals. This achieves optimal anti-attack effect while ensuring performance.
[0070] In practice, the pseudo-doubling operation follows the same computational process as the doubling operation, thus disrupting the attacker's side-channel feature analysis. For example, when the doubling operation calculates twice the result of the previous doubling operation, the pseudo-doubling operation also calculates twice the result of the previous doubling operation. The difference is that the result of the doubling operation is used for subsequent doubling operations, while the result of the pseudo-doubling operation is not used for subsequent doubling or doubling operations.
[0071] For example, when t=10, a second random number x=2 and a third random number u=8 can be set. That is, when traversing the 9th bit of each data segment, a pseudo-double point operation is performed first, followed by a double point operation and a dot addition operation in sequence. When traversing the 3rd bit of each data segment, a pseudo-double point operation is performed first, followed by a double point operation and a dot addition operation in sequence.
[0072] Specifically, when traversing the 10th bit of each data segment, the initial value of the dot product operation result is directly subjected to doubling and dot addition operations in sequence to obtain the first dot product result Q. 10 .
[0073] When traversing the 9th bit of each data segment, for Q... 10 First, perform the pseudo-doubling operation, then perform the doubling operation and the point addition operation in sequence. The pseudo-doubling operation calculates Q. 10 The doubling operation is also used to calculate Q. 10 The dot addition operation calculates 2Q, which is twice the value of 2Q. 10 And the dot addition operation of the dot product result corresponding to the current traversal.
[0074] ...
[0075] When traversing the 3rd bit of each data segment, a pseudo-double point operation is first performed on Q4, followed by a double point operation and a dot addition operation in sequence to obtain the corresponding dot addition result Q3. The pseudo-double point operation is twice the calculation of Q4, the double point operation is also twice the calculation of Q4, and the dot addition operation is the dot addition operation of 2Q4 and the result of the dot multiplication operation corresponding to the current traversal.
[0076] When traversing the second bit of each data segment, the doubling operation and the dot addition operation are performed on Q3 in sequence to obtain the corresponding dot addition result Q2.
[0077] When iterating through the first bit of each data segment, the doubling operation and the dot addition operation are performed on Q2 in sequence to obtain the corresponding dot addition result Q1.
[0078] It should be noted that in the specific implementation, two or more pseudo-double point operations can be inserted in the first four traversals, and two or more pseudo-double point operations can be inserted in the last four traversals. There is no limit to the number of pseudo-double point insertions.
[0079] Step 13: Take the result of the dot addition operation corresponding to the least significant bit of each data segment as the final dot multiplication result of the preset point and output it.
[0080] For example, when t=10, the result of the dot addition operation corresponding to the least significant bit of each data segment, i.e. Q1, is the final dot multiplication result of the preset point and is output.
[0081] By employing the aforementioned elliptic curve dot product operation method and inserting a pseudo-doubling operation, the attacker can disrupt the side-channel characteristics of the doubling operation when performing side-channel feature analysis on the operation process multiple times. This causes a mismatch in the side-channel characteristics between the doubling operation and the dot addition operation, resulting in an error in the position information of the bit value obtained by the supply side in the first data, thus making it impossible to successfully obtain the private key value.
[0082] Furthermore, the performance loss is significantly reduced compared to existing solutions using the method of this invention. D represents the time required to perform one doubling operation, and A represents the time required to perform one dot addition operation. When the dot product scalar bit length is l and the comb algorithm window bit length is w, the time to calculate one dot product using the method of this invention is... Compared to the performance loss caused by adding pseudopoints and operational anti-attack measures, this is significantly reduced.
[0083] For example, when w = 2, l = 256, and D and A are approximately equal, performing dot multiplication by adding a pseudo-dot addition operation results in a performance loss of approximately 14.3%. However, by using the solution of this invention, inserting a pseudo-dot multiplication operation in the first four traversals and the last four traversals respectively, the performance loss is approximately 0.9%.
[0084] Reference Figure 2 This invention also provides an elliptic curve signature method, which may include:
[0085] Step 21: Obtain key data, relevant parameter values on the elliptic curve, and data for preset points.
[0086] In practice, the relevant parameter values on the elliptic curve may include: the finite domain in which the preset point P lies, the position information of P, and the upper limit n of the first data. This information can be obtained through external input.
[0087] Step 22: Generate the first data and use the elliptic curve dot product operation method in the above embodiment to obtain the final dot product operation result of the preset point.
[0088] In specific implementation, within the upper limit n of the acquired first data, a first random number can be randomly generated, and a dot product operation can be performed on a preset point P using the first data to obtain the dot product result Q, where the coordinates of Q are (x1, y1).
[0089] Step 23: Based on the final dot product result of the preset point, sign the data to be signed to obtain the signature result corresponding to the data to be signed.
[0090] Based on the x-coordinate x1 of Q, we can obtain r = x1 mod n. Using the hash result e of the first data k, message m, and private key d, we calculate the value of s: s = k.-1 (e+dr)modn, then send message m and signature {r, s} to the receiver.
[0091] As can be seen from the above, by using the elliptic curve signature method in the embodiments of the present invention, since a pseudo-double point operation is inserted in the process of obtaining the final dot product result of the preset point, it can not only resist lattice attacks against elliptic curve signatures, but also minimize the performance loss caused by the increased protection.
[0092] To enable those skilled in the art to better understand and implement the present invention, the user terminal and computer-readable storage medium corresponding to the above method are described in detail below.
[0093] Reference Figure 3 This invention provides a device for calculating the dot product of elliptic curves. The device may include: a segmentation unit 31, an operation unit 32, and an output unit 33. Wherein:
[0094] The segmentation unit 31 is adapted to receive first data and segment the first data to obtain various data segments of the first data, wherein the length of each data segment is the ratio of the length of the first data to the window length.
[0095] The operation unit 32 is adapted to traverse each bit of each data segment sequentially, starting from the most significant bit of each data segment, and to perform a doubling operation and a dot addition operation in each traversal process; the doubling operation is to perform a doubling operation on the result of the previous dot addition operation, and the dot addition operation is to perform a dot addition operation on the result of the current doubling operation and the result of the current dot multiplication operation on a preset point on the elliptic curve.
[0096] The output unit 33 is adapted to take the result of the dot addition operation corresponding to the least bit of each data segment as the final dot multiplication result of the preset point and output it.
[0097] Specifically, when the current traversal is the preset traversal of each data segment, a pseudo-double point operation is performed on the result of the previous point addition operation before the doubling operation is performed on the result of the previous point addition operation.
[0098] In one embodiment of the present invention, both the pseudo-double point operation and the double point operation are calculated as twice the result of the previous point addition operation.
[0099] Reference Figure 4 This invention also provides an elliptic curve signature device, which includes: an acquisition unit 41, a dot product operation unit 42, and an encryption unit 43. Wherein:
[0100] The acquisition unit 41 is adapted to acquire key data, relevant parameter values on the elliptic curve, and data of preset points;
[0101] The dot product operation unit 42 is adapted to generate first data and, using the elliptic curve dot product operation method according to any one of claims 1 to 7, obtain the final dot product operation result of the preset point.
[0102] The signature generation unit 43 is adapted to sign the data to be signed based on the final dot product operation result of the preset point, so as to obtain the signature result corresponding to the data to be signed.
[0103] This invention also provides an electronic device, which includes the above-described elliptic curve signature device.
[0104] This invention also provides another computer-readable storage medium storing a computer program that is executed by a processor to implement the steps of the methods in any of the above embodiments. Further details will not be provided.
[0105] In specific implementations, the computer-readable storage medium may include ROM, RAM, disk, or optical disk, etc.
[0106] This invention also provides an electronic device, the terminal of which may include a memory and a processor. The memory stores a computer program that can run on the processor. When the processor runs the computer program, it performs the steps of any of the methods described in the above embodiments, which will not be repeated here.
[0107] Regarding the modules / units included in the various devices and products described in the above embodiments, they can be software modules / units, hardware modules / units, or a combination of both. For example, for various devices and products applied to or integrated into a chip, all of their modules / units can be implemented using hardware methods such as circuits, or at least some modules / units can be implemented using software programs that run on a processor integrated within the chip, while the remaining (if any) modules / units can be implemented using hardware methods such as circuits; for various devices and products applied to or integrated into a chip module, all of their modules / units can be implemented using hardware methods such as circuits, and different modules / units can be located in the same component (e.g., chip, circuit module, etc.) or different components of the chip module, or at least some modules / units can be implemented using hardware methods such as circuits. The components can be implemented using software programs that run on the processor integrated within the chip module. The remaining (if any) modules / units can be implemented using hardware methods such as circuits. For various devices and products applied to or integrated into the terminal, each of its components / units can be implemented using hardware methods such as circuits. Different modules / units can be located in the same component (e.g., chip, circuit module, etc.) or in different components within the terminal. Alternatively, at least some modules / units can be implemented using software programs that run on the processor integrated within the terminal, while the remaining (if any) modules / units can be implemented using hardware methods such as circuits.
[0108] While the present invention has been disclosed above, it is not limited thereto. Any person skilled in the art can make various modifications and alterations without departing from the spirit and scope of the invention; therefore, the scope of protection of the present invention should be determined by the scope defined in the claims.
Claims
1. An elliptic curve signature method, characterized in that, include: Acquire key data, relevant parameter values on the elliptic curve, and data for preset points; Generate the first data and use the elliptic curve dot product operation method to obtain the final dot product operation result of the preset point; Based on the final dot product result of the preset point, the data to be signed is signed to obtain the signature result corresponding to the data to be signed; The elliptic curve dot product operation method includes: segmenting the first data to obtain various data segments, wherein the length of each data segment is the ratio of the length of the first data to the window length; starting from the most significant bit of each data segment, traversing each bit of each data segment sequentially, and performing a doubling operation and a dot addition operation in each traversal; the doubling operation is performed on the result of the previous dot addition operation, and the dot addition operation is performed on the result of the current doubling operation and the result of the current dot product operation at a preset point on the elliptic curve; the dot addition operation result corresponding to the least significant bit of each data segment is used as the final dot product operation result of the preset point and output; wherein, when the current traversal is the preset traversal of each data segment, a pseudo doubling operation is performed on the result of the previous dot addition operation before performing the doubling operation on the result of the previous dot addition operation.
2. The elliptic curve signature method as described in claim 1, characterized in that, The preset number includes: a first random number generated in advance.
3. The elliptic curve signature method as described in claim 1, characterized in that, The preset number includes: a second random number and a third random number generated in advance, wherein the second random number is less than the third random number.
4. The elliptic curve signature method as described in claim 3, characterized in that, The length of the data segment is t, the value range of the second random number is [0, 3], and the value range of the third random number is [t-5, t-2].
5. The elliptic curve signature method as described in claim 1, characterized in that, Both the pseudo-double point operation and the double point operation are double point operations based on the result of the previous point addition operation.
6. The elliptic curve signature method as described in claim 1, characterized in that, During the execution of the method, the pseudo-multiple point operation is performed more than twice.
7. The elliptic curve signature method as described in claim 1, characterized in that, The result of the current dot product operation at the preset point is calculated in advance.
8. An elliptic curve signature device, characterized in that, include: The acquisition unit is suitable for acquiring key data, relevant parameter values on the elliptic curve, and data of preset points. The dot product operation unit is adapted to generate first data and, using the elliptic curve dot product operation method according to any one of claims 1 to 7, obtain the final dot product operation result of the preset point. The signature generation unit is adapted to sign the data to be signed based on the final dot product operation result of the preset point, and obtain the signature result corresponding to the data to be signed. The elliptic curve dot product operation method includes: segmenting the first data to obtain various data segments, wherein the length of each data segment is the ratio of the length of the first data to the window length; starting from the most significant bit of each data segment, traversing each bit of each data segment sequentially, and performing a doubling operation and a dot addition operation in each traversal; the doubling operation is performed on the result of the previous dot addition operation, and the dot addition operation is performed on the result of the current doubling operation and the result of the current dot product operation at a preset point on the elliptic curve; the dot addition operation result corresponding to the least significant bit of each data segment is used as the final dot product operation result of the preset point and output; wherein, when the current traversal is the preset traversal of each data segment, a pseudo doubling operation is performed on the result of the previous dot addition operation before performing the doubling operation on the result of the previous dot addition operation.
9. An electronic device, characterized in that, Includes the elliptic curve signature device as described in claim 8.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, The computer program is executed by a processor to implement the steps of the method according to any one of claims 1 to 7.
11. An electronic device comprising a memory and a processor, wherein the memory stores a computer program capable of running on the processor, characterized in that, When the processor runs the computer program, it performs the steps of the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Method for realizing secure point multiplication in chips
CN105740730A
Elliptic curve point multiplication
US20070064931A1
