A method to improve the signature verification performance of Edwards curve digital signature algorithm
By optimizing the signature verification process of the Edwards curve digital signature algorithm and merging the dot product operation into a single loop judgment, the slow signature verification speed of ED25519 was solved, and the signature verification speed was improved.
Patent Information
- Application Number
- CN202511172544.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-21
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2045-08-21
AI Technical Summary
The Edwards curve digital signature algorithm ED25519 has a slow signature verification speed, which makes it difficult to meet the requirements of secure information transmission in vehicle networks.
By optimizing the signature verification process, the two dot multiplication operations in the existing technology are merged into a single loop judgment, reducing the amount of signature verification computation. This includes optimizations to cascaded hash value calculation, modulo operation, dot addition, and dot multiplication operations.
It speeds up the verification process, reduces the amount of calculation, and improves verification efficiency.
Smart Images

Figure CN120675721B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of digital encryption technology, and in particular to a method, apparatus and device for improving the signature verification performance of an Edwards curve digital signature algorithm. Background Technology
[0002] In vehicular network communication, due to the high real-time requirements of users, manufacturers typically choose higher-performance block cipher algorithms rather than public-key cryptography algorithms in scenarios requiring encrypted communication. However, in specific situations requiring digital signatures, such as V2X certificate issuance, renewal, and destruction, public-key cryptography algorithms still possess irreplaceable advantages.
[0003] Edwards Curve Digital Signature Algorithm (EDDSA) is a public-key digital signature algorithm, widely recognized as the most likely algorithm to become the next generation of elliptic curve key systems. It provides two standardized parameter sets: ED25519 and ED448, with ED25519 being more widely used. However, like other public-key algorithms, ED25519 has a slow signature verification speed, making it difficult to meet the requirements of secure information transmission in vehicular networks, thus limiting its application scenarios. Summary of the Invention
[0004] To address the issue of slow signature verification speed in existing technologies using the ED25519 algorithm, this application provides a method, apparatus, and device for improving the signature verification performance of the Edwards curve digital signature algorithm.
[0005] To achieve the above objectives, the first technical solution adopted in this application is: a method for improving the verification performance of an Edwards curve digital signature algorithm, comprising: concatenating the first half of the signature value, the text, and the public key, and calculating a concatenated hash value using the concatenated data; taking the modulo of the concatenated hash value and the base point order to obtain a first modulo result; calculating the newly constructed coordinates of the newly constructed point on the Edwards curve using the public key coordinates corresponding to the public key on the Edwards curve and the base point coordinates of the Edwards curve; determining the relationship between the first modulo result and the second half of the signature value and a first preset value; and comparing the first modulo result with the signature value. When the latter half of the signature value is equal to the first preset value, the first intermediate result calculated using the preset initial intermediate result is used as the intermediate value. When either the first modulo result or the latter half of the signature value is not equal to the first preset value, it is further determined whether the values of the first modulo result and the latter half of the signature value at predetermined positions are the same as the second preset value, and a second judgment relationship is obtained. Based on the second judgment relationship, the intermediate value is calculated using the initial intermediate result, as well as using any one of the inverse coordinates of the public key coordinates, the base point coordinates, and the newly constructed coordinates. By comparing the intermediate value with the first half of the signature value, the verification result of the signature value is obtained.
[0006] Optionally, before processing the calculation of the newly constructed coordinates of the newly constructed point using the public key coordinates corresponding to the public key on the Edwards curve and the base point coordinates of the Edwards curve, the process includes: decompressing the public key and the first half of the signature value to obtain the decompressed public key and the first half of the decompressed signature value; calculating the newly constructed coordinates using the public key coordinates corresponding to the decompressed public key on the Edwards curve and the base point coordinates; and comparing the intermediate value with the first half of the decompressed signature value to obtain the verification result of the signature value.
[0007] Optionally, the first half of the signature value, the text, and the public key are concatenated, and the concatenated data is used to calculate the concatenated hash value. A first modulo result is obtained by modulo the concatenated hash value and the base point order. This includes: calculating the concatenated hash value of the first half of the signature value, the text, and the public key using the SHA-512 algorithm; and performing modulo processing on the base point order and the concatenated hash value in the ED25519 parameters of the Edwards curve digital signature algorithm to obtain the first modulo result corresponding to the concatenated hash value.
[0008] Optionally, using the public key coordinates corresponding to the public key on the Edwards curve and the base point coordinates of the Edwards curve, the newly constructed coordinates of the newly constructed point on the Edwards curve are calculated, including: calculating the coordinate values of the inverse coordinates using the coordinate values of the public key coordinates and the preset second modulo result; and obtaining the newly constructed coordinates by adding the coordinate values of the inverse coordinates to the base point coordinates.
[0009] Optionally, based on the second judgment relationship, an intermediate value is calculated using the initial intermediate result and any one of the inverse coordinates of the public key coordinates, the base point coordinates, and the newly constructed coordinates. This includes: under the condition that the values of the second half of the first modulo result and the signature value are the same in the predetermined number of positions as the second preset value, the intermediate value is obtained by adding the initial intermediate result to the newly constructed coordinates.
[0010] Optionally, based on the second judgment relationship, an intermediate value is calculated using the initial intermediate result and any one of the inverse coordinates of the public key coordinates, the base point coordinates, and the newly constructed coordinates. This includes: under the condition that the value of the first modulo result at a predetermined number of positions is the same as the second preset value, and the value of the second half of the signature value at a predetermined number of positions is different from the second preset value, the intermediate value is obtained by adding the initial intermediate result to the inverse coordinates of the public key coordinates.
[0011] Optionally, based on the second judgment relationship, an intermediate value is calculated using the initial intermediate result and any one of the inverse coordinates of the public key coordinates, the base point coordinates, and the newly constructed coordinates. This includes: under the condition that the value of the first modulo result at a predetermined number of positions is different from the second preset value, and the value of the second half of the signature value at a predetermined number of positions is the same as the second preset value, the intermediate value is obtained by adding the initial intermediate result to the base point coordinates.
[0012] Optionally, based on the second judgment relationship, an intermediate value is calculated using the initial intermediate result and any one of the inverse coordinates of the public key coordinates, the base point coordinates, and the newly constructed coordinates. This includes: under the condition that the values of the second half of the first modulo result and the signature value at predetermined positions are different from the second preset value, the initial intermediate result and the base point coordinates are doubled, and the second half of the first modulo result and the signature value are shifted to the right by predetermined positions to obtain the second intermediate result, the first modulo shift result, and the shift result of the second half of the signature value; whether the first modulo shift result and the shift result of the second half of the signature value are equal to the first preset value, and whether the values of the first modulo shift result and the shift result of the second half of the signature value at predetermined positions are the same as the second preset value, and the intermediate value is calculated based on the judgment result using the first modulo shift result.
[0013] The second technical solution adopted in this application is: a device for improving the verification performance of an Edwards curve digital signature algorithm, comprising: a module for concatenating the first half of the signature value, the text, and the public key, and calculating a concatenated hash value using the concatenated data; and a module for taking the first modulo result by modulo the concatenated hash value and the base point order; a module for calculating the newly constructed coordinates of the newly constructed point on the Edwards curve using the public key coordinates corresponding to the public key on the Edwards curve and the base point coordinates of the Edwards curve; and a module for determining the relationship between the first modulo result and the second half of the signature value and a first preset value, wherein both the first modulo result and the second half of the signature value are equal to... The module that uses the first intermediate result calculated using the preset initial intermediate result as the intermediate value when the first preset value is used; the module that further determines whether the value of the second half of the first modulo result and the second half of the signature value at a predetermined number of positions is the same as the second preset value when either the first modulo result or the second half of the signature value is not equal to the first preset value, and obtains the second judgment relationship; the module that calculates the intermediate value using the initial intermediate result and any one of the inverse coordinates of the public key coordinates, the base point coordinates, and the newly constructed coordinates according to the second judgment relationship; and the module that obtains the verification result of the signature value by comparing the intermediate value with the first half of the signature value.
[0014] The third technical solution adopted in this application is: a computer device, including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the method for improving the signature verification performance of the Edwards curve digital signature algorithm in Solution 1.
[0015] The beneficial effects that the technical solution of this application can achieve are: by optimizing the signature verification process of the Edwards curve digital signature algorithm, this application speeds up the signature verification process and reduces the amount of computation in the signature verification process. Attached Figure Description
[0016] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0017] Figure 1 This is a schematic diagram of a specific implementation of a method for improving the signature verification performance of an Edwards curve digital signature algorithm according to this application;
[0018] Figure 2 This is a schematic diagram of a specific implementation of a signature verification performance improvement device for an Edwards curve digital signature algorithm according to this application.
[0019] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0020] The preferred embodiments of this application will now be described in detail with reference to the accompanying drawings, so that the advantages and features of this application can be more easily understood by those skilled in the art, thereby providing a clearer and more definite definition of the scope of protection of this application.
[0021] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus that includes the element.
[0022] The technical solution of this application and how it solves the above-mentioned technical problems will be described in detail below with specific embodiments. The specific embodiments described below can be combined with each other to form new embodiments. The same or similar ideas or processes described in one embodiment may not be repeated in other embodiments.
[0023] Once the text, signature value, and public key required from the signer are received, the verification steps of the existing Edwards curve digital signature algorithm are as follows:
[0024] First, using the SHA-512 algorithm, the hash value of the first half of the signature value, the concatenated text, and the public key is calculated. Then, the result of the modulo operation between the base order L of the Edwards curve parameters and this hash value is used as the first modulo result for subsequent calculations. That is, the first modulo result is calculated using the following formula:
[0025] h = H(R||P||m) mod L, where R is the first half of the signature value, P is the public key, m is the text, || indicates concatenation, H is the SHA-512 cryptographic hash function, mod is the modulo operation, and L is the base order in the ED25519 Edwards curve parameters.
[0026] Then, decompress the public key and the first half of the signature value to obtain the decompressed public key and the first half of the decompressed signature value, which can be calculated using the following formula:
[0027] P1 = point_decompress(P);
[0028] R1 = point_decompress(R)
[0029] Where point_decompress is the point decompression operation, P1 is the decompressed public key, and R1 is the first half of the decompressed signature.
[0030] Next, the first intermediate value is calculated by adding and multiplying the first half of the decompressed signature, the first modulo result, and the decompressed public key, using the following formula:
[0031] res1 = point_add(R1,point_mul(h,P1)), where point_mul is the dot product operation and point_add is the dot addition operation.
[0032] Then, the second intermediate value is calculated using the latter half of the signature value and the base point of the Edwards curve parameters, which is calculated using the following formula: res2 = point_mul(s, G), where G is the base point in the Edwards curve parameters.
[0033] Finally, verify whether the first intermediate value res1 is equal to the second intermediate value res2. If they are equal, the signature verification is considered successful and the signature can be trusted; if they are not equal, the signature verification is considered unsuccessful and the signature cannot be trusted.
[0034] Based on the verification steps of the existing Edwards curve digital signature algorithm, it can be seen that the decompression processing of points in the existing technology is a linear operation, and the verification process takes less time in this part. However, the part that takes the most time in the entire verification process is the dot product operation, which reduces the overall processing speed of the verification.
[0035] The dot product operation in the prior art can be represented by the following pseudocode:
[0036] Input a, P
[0037] Q = (0,1,1,0)
[0038] While(a>0)
[0039] {
[0040] If (a & 1) Q = point_add(P, Q)
[0041] P = point_add(P,P)
[0042] a = a>>1
[0043] }
[0044] Output Q
[0045] The algorithm logic described in the pseudocode above is as follows: First, determine if the value of the input parameter *a* is equal to 0. If the value of *a* is equal to 0, output the current array *Q* as the output array. If the value of *a* is not equal to 0, further determine if the least significant bit of *a* is equal to 1. If the least significant bit of *a* is equal to 1, perform a dot-matrix addition on the initial array *Q* and the input array *P*, and update the initial array *Q* using the result to obtain the current array *Q*. Then, perform a doubling operation on the input array *P* to obtain the updated input array *P*. Simultaneously, shift the binary form of *a* one bit to the right to obtain the updated parameter *a*. Finally, use the updated parameter *a* to re-determine if it is equal to 0 and perform subsequent processing until output.
[0046] As can be seen from the above process, the dot product operation can be viewed as a process of repeatedly checking whether all bits of parameter a are 1. Since parameter a has a bit width of 256 bits, the two dot products in the signature verification process require repeatedly checking two different 256-bit data, which means a maximum of 512 iterations are needed, which will limit the performance of signature verification.
[0047] Therefore, this application proposes as follows: Figure 1 The method shown is to improve the signature verification performance of the Edwards curve digital signature algorithm, thereby reducing the number of judgment loops and improving signature verification efficiency.
[0048] Figure 1 This paper illustrates one implementation of a method for improving the signature verification performance of an Edwards curve digital signature algorithm according to this application. For example... Figure 1 The Edwards curve digital signature algorithm shown in the figure has the following steps to improve the signature verification performance: Step S101, concatenating the first half of the signature value, the text and the public key and using the concatenated data to calculate the concatenated hash value, and taking the first modulo result by taking the concatenated hash value and the base point order.
[0049] Step S102: Using the public key coordinates corresponding to the public key on the Edwards curve and the base point coordinates of the Edwards curve, calculate the new construction coordinates of the new construction point on the Edwards curve.
[0050] Step S103: Determine the relationship between the first modulus result and the second half of the signature value and the first preset value. When both the first modulus result and the second half of the signature value are equal to the first preset value, the first intermediate result calculated using the preset initial intermediate result will be used as the intermediate value.
[0051] Step S104: If neither the first modulo result nor the second half of the signature value is equal to the first preset value, further determine whether the value of the second half of the first modulo result and the signature value in a predetermined number of places is the same as the second preset value, and obtain the second judgment relationship.
[0052] Step S105: Based on the second judgment relationship, the intermediate value is calculated using the initial intermediate result and any one of the inverse coordinates of the public key coordinates, the base point coordinates, and the newly constructed coordinates.
[0053] Step S106: The verification result of the signature value is obtained by comparing the intermediate value with the first half of the signature value.
[0054] This specific implementation optimizes the signature verification process of the Edwards curve digital signature algorithm, thereby accelerating the signature verification speed and reducing the amount of computation in the signature verification process.
[0055] Specifically, this application calculates the newly constructed coordinates of the newly constructed point on the Edwards curve using the public key coordinates corresponding to the public key on the Edwards curve and the base point coordinates of the Edwards curve. Then, it determines the relationship between the first modulo result and the latter half of the signature value and a first preset value. When both the first modulo result and the latter half of the signature value are equal to the first preset value, the first intermediate result calculated using the preset initial intermediate result is used as the intermediate value. Subsequently, if either the first modulo result or the latter half of the signature value is not equal to the first preset value, it further determines whether the values of the first modulo result and the latter half of the signature value at predetermined positions are the same as a second preset value, obtaining a second judgment relationship. Then, based on the second judgment relationship, the intermediate value is calculated using the initial intermediate result and any one of the following: the inverse coordinates of the public key coordinates, the base point coordinates, or the newly constructed coordinates. This application merges the two dot product operations in the prior art's signature verification process into a single loop. Therefore, this application only needs to execute a loop of up to 256 bits instead of the maximum 512 bits in the prior art, thereby speeding up the signature verification process and reducing the computational load.
[0056] The verification steps in the existing technology are as follows:
[0057] temp1 = point_mul(h,P1)
[0058] res1 = point_add(R1, temp1)
[0059] res2 = point_mul(s, G)
[0060] It determines the reliability of a signature by comparing whether res1 and res2 are the same.
[0061] The above-mentioned verification process in the prior art can be simplified as: h*P + R1 == ? s*G
[0062] The present application simplifies the signature verification process through the above processing as temp2 (G - P) ==? R1, where temp2 has no practical significance. In other words, the present application combines the two loop judgments in the prior art into a single judgment through the above processing, thereby improving the signature verification efficiency of the system.
[0063] In one specific embodiment of this application, the method for improving the signature verification performance of the Edwards curve digital signature algorithm includes step S101, which involves concatenating the first half of the signature value, the text, and the public key, and using the concatenated data to calculate the concatenated hash value, and taking the first modulo result by modulo the concatenated hash value and the base point order.
[0064] In one embodiment of this application, the first half of the signature value, the text, and the public key are concatenated, and a concatenated hash value is calculated using the concatenated data. A first modulo result is obtained by modulo the concatenated hash value and the base point order. This includes: calculating the concatenated hash value of the first half of the signature value, the text, and the public key using the SHA-512 algorithm; and performing modulo processing on the base point order and the concatenated hash value in the ED25519 parameters of the Edwards curve digital signature algorithm to obtain the first modulo result corresponding to the concatenated hash value. The calculation process is the same as in the prior art and will not be described in detail here.
[0065] In one specific embodiment of this application, the method for improving the signature verification performance of the Edwards curve digital signature algorithm includes step S102, which uses the public key coordinates corresponding to the public key on the Edwards curve and the base point coordinates of the Edwards curve to calculate the new construction coordinates of the new construction point on the Edwards curve.
[0066] In a specific example of this application, before calculating the newly constructed coordinates of the newly constructed point using the public key coordinates corresponding to the public key on the Edwards curve and the base point coordinates of the Edwards curve, the process includes: decompressing the public key and the first half of the signature value to obtain a decompressed public key and the first half of the decompressed signature value; calculating the newly constructed coordinates using the public key coordinates corresponding to the decompressed public key on the Edwards curve and the base point coordinates; and comparing the intermediate value with the first half of the decompressed signature value to obtain the verification result of the signature value. The decompression process of this application is the same as the decompression process of the prior art, and will not be described again here.
[0067] In one specific embodiment of this application, the newly constructed coordinates of the newly constructed point on the Edwards curve are calculated using the public key coordinates corresponding to the public key on the Edwards curve and the base point coordinates of the Edwards curve. This includes: calculating the coordinate values of the inverse coordinates using the coordinate values of the public key coordinates and a preset second modulo result; and obtaining the newly constructed coordinates by adding the coordinate values of the inverse coordinates to the base point coordinates.
[0068] Specifically, P2.x = P1.x
[0069] P2.y = N - P1.y
[0070] new_point = point_add(G, P2)
[0071] In the above formula, N is the modulus N in the Edwards curve parameters, i.e., the second modulus result, P2 is the inverse coordinate of P1, new_point is the sum of the base point G and P2, and P1 is the public key coordinate on the Edwards curve corresponding to the public key.
[0072] In one specific embodiment of this application, the method for improving the signature verification performance of the Edwards curve digital signature algorithm includes the following steps: Step S103, determining the relationship between the first modulo result and the latter half of the signature value and a first preset value; when both the first modulo result and the latter half of the signature value are equal to the first preset value, using the first intermediate result calculated using the preset initial intermediate result as the intermediate value; Step S104, when the first modulo result and the latter half of the signature value are not both equal to the first preset value, further determining whether the value of the latter half of the first modulo result and the signature value at a predetermined number of bits is the same as a second preset value, and obtaining a second judgment relationship, wherein the latter half of the first modulo result and the signature value are binary data; Step S105, according to the second judgment relationship, using the initial intermediate result, and using any one of the inverse coordinates of the public key coordinates, the base point coordinates, and the newly constructed coordinates, calculating the intermediate value.
[0073] In one specific embodiment of this application, based on the second judgment relationship, an intermediate value is calculated using the initial intermediate result and any one of the inverse coordinates of the public key coordinates, the base point coordinates, and the newly constructed coordinates. This includes: under the condition that the values of the second half of the first modulo result and the signature value are the same as the second preset value in a predetermined number of positions, the intermediate value is obtained by adding the initial intermediate result to the newly constructed coordinates.
[0074] In one specific embodiment of this application, based on the second judgment relationship, an intermediate value is calculated using an initial intermediate result and any one of the inverse coordinates of the public key coordinates, the base point coordinates, and the newly constructed coordinates. This includes: under the condition that the value of the first modulo result at a predetermined number of positions is the same as the second preset value, and the value of the latter half of the signature value at a predetermined number of positions is different from the second preset value, the intermediate value is obtained by adding the initial intermediate result to the inverse coordinates of the public key coordinates.
[0075] In one specific embodiment of this application, based on the second judgment relationship, an intermediate value is calculated using the initial intermediate result and any one of the inverse coordinates of the public key coordinates, the base point coordinates, and the newly constructed coordinates. This includes: under the condition that the value of the first modulo result at a predetermined number of positions is different from the second preset value, and the value of the second half of the signature value at a predetermined number of positions is the same as the second preset value, the intermediate value is obtained by adding the initial intermediate result to the base point coordinates.
[0076] In one specific embodiment of this application, based on the second judgment relationship, an intermediate value is calculated using an initial intermediate result and any one of the inverse coordinates of the public key coordinates, the base point coordinates, and the newly constructed coordinates. This includes: under the condition that the values of the second half of the first modulo result and the signature value at predetermined positions are different from the second preset value, performing a doubling operation on the initial intermediate result and the base point coordinates, and shifting the second half of the first modulo result and the signature value to the right by predetermined positions to obtain the second intermediate result and the first modulo shift result and the shift result of the second half of the signature value; re-judging whether the first modulo shift result and the shift result of the second half of the signature value are equal to the first preset value, and re-judging whether the values of the first modulo shift result and the shift result of the second half of the signature value at predetermined positions are the same as the second preset value, and calculating the intermediate value using the first modulo shift result based on the judgment results.
[0077] Specifically, the corresponding pseudocode is:
[0078] Input h,s,P2,G,new_point
[0079] res = (0,1,1,0)
[0080] While(h>0 or s>0)
[0081] {
[0082] if(h&1 and s&1) res = point_add(new_point,res)
[0083] else if(h&1)res = point_add(P2,res)
[0084] else if(s&1)res = point_add(G,res)
[0085] new_point = point_add(new_point,new_point)
[0086] P2 = point_add(P2,P2)
[0087] G = point_add(G,G)
[0088] h = h>>1
[0089] s = s>>1
[0090] }
[0091] Output res
[0092] The signature value is verified through the following steps:
[0093] First, obtain the first modulo result h of the user input, the second half of the signature value s, the value of the inverse coordinate P2 corresponding to the public key coordinates, the base point G, the coordinates of the newly constructed coordinates new_point, the initial value and the intermediate value, and set the initial intermediate value to (0,1,1,0).
[0094] Then, it checks if the values of h and s are both equal to 0. If both are equal to 0, the current value of res is output as the intermediate value of this application. If either of them is not equal to 0, it checks if the least significant bit of h and the least significant bit of s are both equal to 1. If both are equal to 1, a dot-matrix addition operation is performed on the intermediate value res and new_point, and the value corresponding to res is updated using the calculation result. If not, it further checks if the least significant bit of h is equal to 1. If so, a dot-matrix addition operation is performed on res and P2, and the value corresponding to res is updated using the calculation result. If not, it further checks if the least significant bit of s is equal to 1. If so, a dot-matrix addition operation is performed on res and G, and the value corresponding to res is updated using the calculation result. A dot-matrix multiplication operation is performed on P2 and G, and the bits corresponding to h and s are shifted right by 1 bit, and then the above judgment and calculation process is repeated.
[0095] In one specific embodiment of this application, the method for improving the signature verification performance of the Edwards curve digital signature algorithm includes step S106, which obtains the verification result of the signature value by comparing the intermediate value with the first half of the signature value.
[0096] Specifically, the middle value is compared with the first half of the signature value. If the middle value is equal to the first half of the signature value, the signature verification is successful and the uploaded signature is considered trustworthy. If the middle value is not equal to the first half of the signature value, the signature verification fails and the uploaded signature is considered untrustworthy.
[0097] Compared with the traditional verification process, the above-described verification process integrates the two multiplication operations and one addition operation into the same loop, reducing the maximum number of loop judgments from 512 to 256, thus greatly reducing the verification time.
[0098] Figure 2This paper illustrates a specific implementation of a signature verification performance improvement device for an Edwards curve digital signature algorithm according to this application.
[0099] exist Figure 2 In the specific implementation shown, the signature verification performance improvement device of the Edwards curve digital signature algorithm mainly includes: 201, a module for concatenating the first half of the signature value, the text, and the public key, calculating the concatenated hash value using the concatenated data, and obtaining a first modulo result by taking the modulo of the concatenated hash value and the base point order; 202, a module for calculating the newly constructed coordinates of the newly constructed point on the Edwards curve using the public key coordinates corresponding to the public key on the Edwards curve and the base point coordinates of the Edwards curve; 203, a module for judging the relationship between the first modulo result and the second half of the signature value and a first preset value, wherein both the first modulo result and the second half of the signature value are equal to the first preset value. The module 204 is used to set the value by using the first intermediate result calculated using the preset initial intermediate result as the intermediate value; the module 205 is used to further determine whether the value of the second half of the first modulo result and the second half of the signature value at a predetermined number of positions is the same as the second preset value when either the first modulo result or the second half of the signature value is not equal to the first preset value, and to obtain the second judgment relationship; the module 206 is used to calculate the intermediate value according to the second judgment relationship, using the initial intermediate result, and using any one of the inverse coordinates of the public key coordinates, the base point coordinates, and the newly constructed coordinates; the module 207 is used to obtain the verification result of the signature value by comparing the intermediate value with the first half of the signature value.
[0100] The signature verification performance improvement device for the Edwards curve digital signature algorithm provided in this application can be used to execute the signature verification performance improvement method for the Edwards curve digital signature algorithm described in any of the above embodiments. Its implementation principle and technical effect are similar, and will not be repeated here.
[0101] In one specific embodiment of this application, the functional modules in the Edwards curve digital signature algorithm verification performance improvement device of this application can be directly in hardware, in software modules executed by a processor, or in a combination of both.
[0102] Software modules may reside in RAM memory, flash memory, ROM memory, EPROM memory, EEPROM memory, registers, hard disks, removable disks, CD-ROMs, or any other form of storage medium known in this art. An exemplary storage medium is coupled to the processor, enabling the processor to read information from and write information to the storage medium.
[0103] The processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic, discrete hardware components, or any combination thereof. A general-purpose processor can be a microprocessor, but alternatively, it can be any conventional processor, controller, microcontroller, or state machine. The processor can also be implemented as a combination of computing devices, such as a combination of a DSP and a microprocessor, multiple microprocessors, one or more microprocessors incorporating a DSP core, or any other such configuration. Alternatively, the storage medium can be integrated with the processor. The processor and storage medium can reside in an ASIC. The ASIC can reside in the user terminal. Alternatively, the processor and storage medium can reside as discrete components in the user terminal.
[0104] In one specific embodiment of this application, a computer device includes a memory, a processor, and a computer program stored in the memory. The processor executes the computer program to implement the method for improving the signature verification performance of the Edwards curve digital signature algorithm described in the above embodiments.
[0105] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0106] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0107] The above description is merely an embodiment of this application and does not limit the patent scope of this application. Any equivalent structural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.
Claims
1. A method for improving the signature verification performance of an Edwards curve digital signature algorithm, characterized in that, include: The first half of the signature value, the text, and the public key are concatenated, and the concatenated data is used to calculate the concatenated hash value. The first modulo result is obtained by taking the concatenated hash value and the base point order. Using the public key coordinates corresponding to the public key on the Edwards curve, and the base point coordinates of the Edwards curve, the new construction coordinates of the new construction point on the Edwards curve are calculated; Determine the relationship between the first modulus result and the second half of the signature value and the first preset value. When both the first modulus result and the second half of the signature value are equal to the first preset value, use the first intermediate result calculated using the preset initial intermediate result as the intermediate value. If either the first modulo result or the latter half of the signature value is not equal to the first preset value, it is further determined whether the value of the latter half of the first modulo result and the signature value at a predetermined number of positions is the same as the second preset value, and a second judgment relationship is obtained. Based on the second judgment relationship, the intermediate value is calculated using the initial intermediate result and any one of the inverse coordinates of the public key coordinates, the base point coordinates, and the newly constructed coordinates; The verification result of the signature value is obtained by comparing the intermediate value with the first half of the signature value; The step of calculating the intermediate value based on the second judgment relationship, using the initial intermediate result, and using any one of the inverse coordinates of the public key coordinates, the base point coordinates, and the newly constructed coordinates, includes: Under the condition that the values of the second half of the first modulus result and the signature value are the same as the second preset value in a predetermined number of places, the intermediate value is obtained by adding the initial intermediate result to the newly constructed coordinates. Under the condition that the value of the first modulo result in a predetermined number of positions is the same as the second preset value, and the value of the second half of the signature value in a predetermined number of positions is different from the second preset value, the intermediate value is obtained by adding the initial intermediate result to the inverse coordinate of the public key coordinates. Under the condition that the value of the first modulus result in a predetermined number of places is different from the second preset value, and the value of the second half of the signature value in a predetermined number of places is the same as the second preset value, the intermediate value is obtained by adding the initial intermediate result to the base point coordinates. Under the condition that the values of the second half of the first modulus result and the signature value at predetermined positions are different from the second preset value, the initial intermediate result and the base point coordinates are doubled, and the second half of the first modulus result and the signature value are shifted to the right by predetermined positions to obtain the second intermediate result, the first modulus shift result, and the shift result of the second half of the signature value; it is then re-determined whether the first modulus shift result and the shift result of the second half of the signature value are equal to the first preset value, and it is also re-determined whether the values of the first modulus shift result and the shift result of the second half of the signature value at predetermined positions are the same as the second preset value, and the intermediate value is calculated based on the determination result using the first modulus shift result.
2. The method for improving the signature verification performance of the Edwards curve digital signature algorithm according to claim 1, characterized in that, Before performing the process of calculating the new construction coordinates of the newly constructed point on the Edwards curve using the public key coordinates corresponding to the public key on the Edwards curve and the base point coordinates of the Edwards curve, the following steps are included: Decompress the public key to obtain the decompressed public key; The newly constructed coordinates are calculated using the public key coordinates corresponding to the decompressed public key on the Edwards curve, and the base point coordinates.
3. The method for improving the signature verification performance of the Edwards curve digital signature algorithm according to claim 1, characterized in that, The process of concatenating the first half of the signature value, the text, and the public key, calculating the concatenated hash value using the concatenated data, and obtaining the first modulo result by taking the modulo of the concatenated hash value and the base point order includes: The SHA-512 algorithm is used to calculate the concatenated hash value of the first half of the signature value, the text, and the concatenated data of the public key. The base point order in the ED25519 parameter of the Edwards curve digital signature algorithm and the concatenated hash value are moduloed to obtain the first modulo result corresponding to the concatenated hash value.
4. The method for improving the signature verification performance of the Edwards curve digital signature algorithm according to claim 1, characterized in that, The step of calculating the new construction coordinates of the newly constructed point on the Edwards curve using the public key coordinates corresponding to the public key on the Edwards curve and the base point coordinates of the Edwards curve includes: The coordinates of the inverse coordinates are calculated using the coordinates of the public key coordinates and the preset second modulo result. The newly constructed coordinates are obtained by adding the coordinate values of the inverse coordinates to the coordinates of the base point.
5. A device for improving the verification performance of an Edwards curve digital signature algorithm, characterized in that, include: A module for concatenating the first half of the signature value, the text, and the public key, and using the concatenated data to calculate the concatenated hash value, and for taking the first modulo result by taking the concatenated hash value and the base point order; A module for calculating the new construction coordinates of the newly constructed point on the Edwards curve using the public key coordinates corresponding to the public key on the Edwards curve and the base point coordinates of the Edwards curve; This module is used to determine the relationship between the first modulus result and the second half of the signature value and the first preset value. When both the first modulus result and the second half of the signature value are equal to the first preset value, the first intermediate result calculated using the preset initial intermediate result is used as the intermediate value. A module for determining whether the values of the second half of the first modulus result and the second half of the signature value are the same as a second preset value in a predetermined number of positions when either the first modulus result or the second half of the signature value is not equal to the first preset value, and obtaining a second determination relationship. A module for calculating an intermediate value based on the second judgment relationship, using the initial intermediate result, and using any one of the inverse coordinates of the public key coordinates, the base point coordinates, and the newly constructed coordinates; A module for obtaining a verification result of a signature value by comparing the intermediate value with the first half of the signature value, wherein, under the condition that the values of the first modulo result and the second half of the signature value are the same in a predetermined number of places as the second preset value, the intermediate value is obtained by performing point addition processing on the initial intermediate result and the newly constructed coordinates; The step of calculating the intermediate value based on the second judgment relationship, using the initial intermediate result, and using any one of the inverse coordinates of the public key coordinates, the base point coordinates, and the newly constructed coordinates, includes: Under the condition that the values of the second half of the first modulus result and the signature value are the same as the second preset value in a predetermined number of places, the intermediate value is obtained by adding the initial intermediate result to the newly constructed coordinates. Under the condition that the value of the first modulo result in a predetermined number of positions is the same as the second preset value, and the value of the second half of the signature value in a predetermined number of positions is different from the second preset value, the intermediate value is obtained by adding the initial intermediate result to the inverse coordinate of the public key coordinates. Under the condition that the value of the first modulus result in a predetermined number of places is different from the second preset value, and the value of the second half of the signature value in a predetermined number of places is the same as the second preset value, the intermediate value is obtained by adding the initial intermediate result to the base point coordinates. Under the condition that the values of the second half of the first modulus result and the signature value at predetermined positions are different from the second preset value, the initial intermediate result and the base point coordinates are doubled, and the second half of the first modulus result and the signature value are shifted to the right by predetermined positions to obtain the second intermediate result, the first modulus shift result, and the shift result of the second half of the signature value; it is then re-determined whether the first modulus shift result and the shift result of the second half of the signature value are equal to the first preset value, and it is also re-determined whether the values of the first modulus shift result and the shift result of the second half of the signature value at predetermined positions are the same as the second preset value, and the intermediate value is calculated based on the determination result using the first modulus shift result.
6. A computer device comprising a memory, a processor, and a computer program stored in the memory, characterized in that, The processor executes the computer program to implement the method for improving the signature verification performance of the Edwards curve digital signature algorithm as described in any one of claims 1-4.
Citation Information
Patent Citations
EdDSA signature implementation method and device for resource-constrained chip
CN113032845A
Digital signature method and device, equipment and storage medium
CN116055029A