A digital signature verification method and device, electronic equipment and storage medium

By optimizing the elliptic curve digital signature verification method in the Jacobian projective coordinate system and utilizing the finite field operation characteristics to transform modular inverse operation into modular multiplication operation, the problems of slow signature verification speed and resource waste in the existing technology are solved, and efficient signature verification is achieved.

CN115801284BActive Publication Date: 2026-06-02WUHAN MARITIME COMMUNICATION RESEARCH INSTITUTE

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
WUHAN MARITIME COMMUNICATION RESEARCH INSTITUTE
Filing Date
2022-11-29
Publication Date
2026-06-02

AI Technical Summary

Technical Problem

Existing digital signature verification methods in elliptic curve cryptography involve a large number of division operations, resulting in low signature verification speed and low utilization of hardware and software resources due to the addition of extra dividers.

Method used

By calculating points on an elliptic curve in the Jacobian projective coordinate system and utilizing the finite field operation properties, the modular inverse operation is transformed into a modular multiplication operation, reducing the overhead of inversion operations and optimizing the digital signature verification process.

Benefits of technology

It significantly speeds up digital signature verification, avoids wasting additional hardware and software resources, and improves resource utilization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115801284B_ABST
    Figure CN115801284B_ABST
Patent Text Reader

Abstract

The application provides a digital signature verification method and device, electronic equipment and a storage medium, which comprises the following steps: calculating a point on an elliptic curve based on Jacobian projection coordinate system change to avoid one division operation, and further avoiding inverse operation by transformation under the premise of only adding one judgment step by using the characteristics of finite field operation. By optimizing the inverse algorithm on different prime fields, the modulus inverse operation required for the final coordinate system conversion in the digital signature verification calculation process is converted into modulus multiplication operation under the same condition by adding one judgment, and considering that the overhead of inverse operation is often much larger than that of modulus multiplication operation, the verification speed is greatly improved after the improvement.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of information security, and more specifically, relates to a digital signature verification method, apparatus, electronic device, and storage medium. Background Technology

[0002] Elliptic Curve Cryptography (ECC) is an asymmetric cryptosystem characterized by short key lengths and fast encryption / decryption speeds. The SM2 cryptographic standard, proposed by my country in 2010, is a public-key cryptosystem based on ECC. The ECC / SM2 elliptic curve algorithm includes ECC / SM2 encryption / decryption algorithms and ECC / SM2 signature / verification algorithms. In the ECC / SM2 signature and verification process, the multiplication of two large numbers is often involved. n Calculation of the modulus n Let be the order of the elliptic curve. Because n Since it is not a generalized Mersenne prime, fast reduction operations are not possible. (This is usually the case for...) n Modulo operations can only be performed directly using division. However, division operations, whether implemented in software (programs) or hardware (such as Field Programmable Gate Arrays (FPGAs) or Application Specific Integrated Circuits (ASICs), cause problems with... n Modulo operations are inefficient, which affects the speed of signature / verification; while adding an extra divider would lead to a waste of hardware and software resources due to its low utilization. Summary of the Invention

[0003] In view of the shortcomings of the prior art, the purpose of this invention is to provide a digital signature verification method, device, electronic device and storage medium, which aims to solve the problem that the existing numerical signature verification method of elliptic curve cryptography involves a large number of divisions, resulting in low signature verification speed. Although adding an extra divider can ensure the signature verification speed, it results in low utilization of hardware and software resources and waste of resources.

[0004] To achieve the above objectives, in a first aspect, the present invention provides a digital signature verification method, comprising the following steps:

[0005] Obtain the target message to be verified; the target message to be verified includes: the message to be verified, the public key, and the digital signature to be verified; the digital signature includes a first signature value and a second signature value; the digital signature is obtained based on the elliptic curve digital signature algorithm.

[0006] Verify whether both the first signature value and the second signature value are less than the elliptic curve order.n If the result is a non-zero natural number, then the digital signature verification fails.

[0007] If both the first signature value and the second signature value are less than the elliptic curve order n If the value is a non-zero natural number, then calculate the hash value of the message to be verified, sum the first signature value and the second signature value, and then align the sum to the order of the hash value. n If the modulo result is 0, the digital signature verification fails.

[0008] If the modulo result is not 0, then the point on the elliptic curve corresponding to the digital signature is calculated based on the public key in the Jacobian projective coordinate system, and the triplet coordinates of the point in the Jacobian projective coordinate system are obtained. ;

[0009] Subtract the first signature value from the hash value of the message to be verified, and then adjust the order of the subtraction result. n Modulo to obtain q ;

[0010] Will q Multiply Obtain the result of the first multiplication, and then divide the result of the first multiplication by the number of elements of the finite field used for the elliptic curve. p Calculate the modulus to obtain the first modulo value; then... right p The first modulo value is obtained by taking the modulo; if the first modulo value is equal to the second modulo value, the digital signature verification is successful.

[0011] If the first modulo value is not equal to the second modulo value, let i Incrementing from 1 to positive integers, q and i times n Add them together, and multiply the result by . Obtain the result of the second multiplication, and then apply the result of the second multiplication to... p Calculate the modulus to obtain the third modulo value; increment. i If you go to a certain i If the third modulo value is equal to the second modulo value, the digital signature verification passes; if i Increment to If the third modulo value still cannot be equal to the second modulo value, then the digital signature verification fails.

[0012] In an optional example, points on the elliptic curve are calculated based on the Jacobian projective coordinate system transformation to avoid the division operations required to find points on the elliptic curve in the affine coordinate system, and to increase... iUnder the premise of determining the magnitude of the modulus, the inverse operation caused by coordinate system transformation is further avoided by utilizing the characteristics of finite field operations.

[0013] In an optional example, let the first signature value be... The hash value of the message to be verified is ;but ;

[0014] when At that time, The discriminant is transformed into Since all non-zero elements in the prime field have multiplicative inverses, the discriminant is equivalent to... .

[0015] In an optional example, let the first signature value be... The hash value of the message to be verified is ;but ;

[0016] when When, the discriminant is transformed into ,common One, of which Since all non-zero elements in the prime field have multiplicative inverses, the discriminant is equivalent to... .

[0017] In an optional example, when the digital signature is obtained based on the SM2 elliptic curve digital signature algorithm, , i =1; At this point, only one step of determining the magnitude of the modulus needs to be added to avoid the inverse operation caused by coordinate system transformation.

[0018] In a second aspect, the present invention provides a digital signature verification device, comprising:

[0019] An acquisition unit is used to acquire a target message to be verified; the target message to be verified includes: a message to be verified, a public key, and a digital signature to be verified; the digital signature includes a first signature value and a second signature value; the digital signature is obtained based on an elliptic curve digital signature algorithm.

[0020] The first verification unit is used to verify whether both the first signature value and the second signature value are less than the elliptic curve order. n If the result is a non-zero natural number, then the digital signature verification fails.

[0021] The second verification unit is configured to verify if both the first signature value and the second signature value are less than the elliptic curve order. nIf the value is a non-zero natural number, then calculate the hash value of the message to be verified, sum the first signature value and the second signature value, and then align the sum to the order of the hash value. n If the modulo result is 0, the digital signature verification fails.

[0022] The coordinate transformation unit is used to calculate the point on the elliptic curve corresponding to the digital signature based on the public key in the Jacobian projective coordinate system if the obtained modulo result is not 0, thereby obtaining the triplet coordinates of the point in the Jacobian projective coordinate system. ;

[0023] The subtraction modulo unit is used to subtract the first signature value from the hash value of the message to be verified, and then adjust the order of the subtraction result. n Modulo to obtain q ;

[0024] The third verification unit is used to verify... q Multiply Obtain the result of the first multiplication, and then divide the result of the first multiplication by the number of elements of the finite field used for the elliptic curve. p Calculate the modulus to obtain the first modulo value; then... right p The first modulo value is obtained by taking the modulo; if the first modulo value is equal to the second modulo value, the digital signature verification is successful.

[0025] The fourth verification unit is used to, if the first modulo value is not equal to the second modulo value, let i Incrementing from 1 to positive integers, q and i times n Add them together, and multiply the result by . Obtain the result of the second multiplication, and then apply the result of the second multiplication to... p Calculate the modulus to obtain the third modulo value; increment. i If you go to a certain i If the third modulo value is equal to the second modulo value, the digital signature verification passes; if i Increment to If the third modulo value still cannot be equal to the second modulo value, then the digital signature verification fails.

[0026] In an optional example, the coordinate transformation unit calculates points on the elliptic curve based on the Jacobian projective coordinate system transformation to avoid the division operation required to find points on the elliptic curve in the affine coordinate system, and adds a fourth verification unit. i Under the premise of determining the magnitude of the modulus, the inverse operation caused by coordinate system transformation is further avoided by utilizing the characteristics of finite field operations.

[0027] In an optional example, when the digital signature is obtained based on the SM2 elliptic curve digital signature algorithm, , i =1; At this point, the fourth verification unit only needs to add one step to determine the magnitude of the modulus value, which avoids the inversion operation caused by the introduction of coordinate system transformation.

[0028] Thirdly, the present invention provides an electronic device comprising a processor and a memory, the memory storing at least one piece of program code, the program code being loaded and executed by the processor to implement the digital signature verification method as provided in the first aspect above.

[0029] Fourthly, the present invention provides a computer-readable storage medium storing at least one piece of program code, which is loaded and executed by a processor to implement the digital signature verification method as provided in the first aspect above.

[0030] In summary, the technical solutions conceived by this invention have the following beneficial effects compared with the prior art:

[0031] This invention provides a digital signature verification method, device, electronic device, and storage medium. By optimizing the inversion algorithm on different prime fields, the modular inversion operation required for the final coordinate system transformation in the digital signature verification calculation process is converted into a modular multiplication operation under the same conditions, while adding one more judgment. Considering that the overhead of the inversion operation is often much greater than that of the modular multiplication operation, the improved method significantly speeds up the signature verification process without introducing additional hardware and software overhead. Attached Figure Description

[0032] Figure 1 This is a flowchart of the digital signature verification method provided in an embodiment of the present invention;

[0033] Figure 2 This is a flowchart of the original SM2 signature verification method provided in the embodiments of the present invention;

[0034] Figure 3 This is a flowchart example of the improved SM2 signature verification method provided in the embodiments of the present invention;

[0035] Figure 4 This is an architecture diagram of a digital signature verification device provided in an embodiment of the present invention. Detailed Implementation

[0036] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The following description of at least one exemplary embodiment is merely illustrative and is in no way intended to limit the present invention or its application or use. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0037] It should be noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the scope of exemplary embodiments according to the invention. As used herein, the singular form is intended to include the plural form as well, unless the context clearly indicates otherwise. Furthermore, it should be understood that when the terms "comprising" and / or "including" are used in this specification, they indicate the presence of features, steps, operations, devices, components, and / or combinations thereof.

[0038] Unless otherwise specifically stated, the relative arrangement, numerical expressions, and values ​​of the components and steps described in these embodiments do not limit the scope of the invention. It should also be understood that, for ease of description, the dimensions of the various parts shown in the drawings are not drawn to actual scale. Techniques, methods, and devices known to those skilled in the art may not be discussed in detail, but where appropriate, such techniques, methods, and devices should be considered part of the specification. In all examples shown and discussed herein, any specific value should be interpreted as merely exemplary and not as a limitation. Therefore, other examples of exemplary embodiments may have different values. It should be noted that similar reference numerals and letters in the following figures denote similar items; therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.

[0039] In the description of this invention, "several" means one or more, "multiple" means two or more, "greater than," "less than," and "exceeding" are understood to exclude the stated number, while "above," "below," and "within" are understood to include the stated number. The use of "first" and "second" in the description is merely for distinguishing technical features and should not be construed as indicating or implying relative importance, or implicitly indicating the number of indicated technical features, or implicitly indicating the order of the indicated technical features.

[0040] In the description of this invention, the terms "one embodiment," "some embodiments," "illustrative embodiment," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of the invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.

[0041] Figure 1 This is a flowchart of the digital signature verification method provided in an embodiment of the present invention; as shown below. Figure 1 As shown, it includes the following steps:

[0042] S101, Obtain the target message to be verified; the target message to be verified includes: the message to be verified, the public key, and the digital signature to be verified; the digital signature includes a first signature value and a second signature value; the digital signature is obtained based on the elliptic curve digital signature algorithm.

[0043] S102, verify whether both the first signature value and the second signature value are less than the elliptic curve order. n If the result is a non-zero natural number, then the digital signature verification fails.

[0044] S103, if both the first signature value and the second signature value are less than the elliptic curve order n If the value is a non-zero natural number, then calculate the hash value of the message to be verified, sum the first signature value and the second signature value, and then align the sum to the order of the hash value. n If the modulo result is 0, the digital signature verification fails.

[0045] S104, if the obtained modulo result is not 0, then calculate the point on the elliptic curve corresponding to the digital signature based on the public key in the Jacobian projective coordinate system, and obtain the triplet coordinates of the point in the Jacobian projective coordinate system. Points on the elliptic curve have binary coordinates in the affine coordinate system. , and ;

[0046] S105, subtract the first signature value from the hash value of the message to be verified, and then adjust the order of the subtraction result. n Modulo to obtain q ;

[0047] S106, q Multiply Obtain the result of the first multiplication, and then divide the result of the first multiplication by the number of elements of the finite field used for the elliptic curve. pCalculate the modulus to obtain the first modulo value; then... right p The first modulo value is obtained by taking the modulo; if the first modulo value is equal to the second modulo value, the digital signature verification is successful.

[0048] S107, if the first modulus value is not equal to the second modulus value, let i Incrementing from 1 to positive integers, q and i times n Add them together, and multiply the result by . Obtain the result of the second multiplication, and then apply the result of the second multiplication to... p Calculate the modulus to obtain the third modulo value; increment. i If you go to a certain i If the third modulo value is equal to the second modulo value, the digital signature verification passes; if i Increment to If the third modulo value still cannot be equal to the second modulo value, then the digital signature verification fails.

[0049] In an optional example, points on the elliptic curve are calculated based on the Jacobian projective coordinate system transformation to avoid the division operations required to find points on the elliptic curve in the affine coordinate system, and to increase... i Under the premise of determining the magnitude of the modulus, the inverse operation caused by coordinate system transformation is further avoided by utilizing the characteristics of finite field operations.

[0050] This invention provides an acceleration scheme for digital signature and verification algorithms based on elliptic curves. By optimizing the inversion algorithm on different prime fields, the modular inversion operation required for the final coordinate system transformation in the digital signature verification calculation process is converted into a modular multiplication operation under the same conditions, while adding one more judgment. Considering that the overhead of the inversion operation is often much greater than that of the modular multiplication operation, the improved version significantly speeds up the signature verification process.

[0051] The following example uses the SM2 elliptic curve public-key cryptography algorithm for illustration:

[0052] Figure 2 This is a flowchart illustrating the original SM2 signature verification method provided in this embodiment of the invention; as shown in the figure, referring to the "SM2 Elliptic Curve Public Key Cryptography Algorithm" published by the State Cryptography Administration in 2010, the signature verification process of the national cryptographic SM2 is as follows:

[0053] Verification algorithm: Given parameters, public key ,information And its signature

[0054] ① Inspection Check if it is true; if not, the verification fails.

[0055] ② Inspection Check if it is true; if not, the verification fails.

[0056] ③ Place in For the signature based on the user The generated hash value;

[0057] ④ Calculation

[0058] ⑤ Calculation ,like If the signature verification fails, proceed to the next step.

[0059] ⑥ Calculate the points on the elliptic curve

[0060] ⑦ Calculation ,test Whether it is valid or not.

[0061] in, G is the base point of the elliptic curve. n Base point G The order, its order n It is a prime number. d A This is the private key. e′ The cryptographic hash function is applied to the message. M′ The output value, i.e., the message M′ The hash value. M′ This is the message to be verified. Before the verification process, a cryptographic hash function must be used to verify it. (Include Z A and verification message M′ Compress it. x A , y A Represents the coordinates of the elliptic curve.

[0062] Further, step ⑥ calculates the elliptic curve points. In affine coordinates, the operation of multiple points on an elliptic curve involves a division operation, which is generally time-consuming. To avoid this division operation and optimize the algorithm's time complexity, a Jacobian-weighted projective coordinate system is typically used for calculation. Let's assume the point calculated in step ⑥ in the Jacobian-weighted coordinate system is... , and affine coordinate system points The conversion relationship is and The transformation here introduces an inversion operation, and the focus of this invention is to circumvent this inversion operation.

[0063] It should be noted that, The complete expression of this formula is actually This cannot be interpreted as a simple division operation followed by modulo. It should be understood as seeking The multiplicative inverse.

[0064] Step 7 Judgment Whether something is true or false is mathematically equivalent to verification. To verify whether this holds true, substitute the formula for Jacobian coordinate transformation. Whether it is valid or not.

[0065] The main idea of ​​this invention is to avoid all division operations by adding only one decision step and combining the characteristics of finite field operations. The proof is given below:

[0066] make ;

[0067] Scenario 1: When hour:

[0068] Obtained through calculation ;

[0069] The discriminant is transformed into ;

[0070] Since all non-zero elements in the prime field have multiplicative inverses, the verification formula is equivalent to:

[0071] ;

[0072] Scenario 2: When hour:

[0073] On different curves and n Different mapping relationships can be generally represented as: and ;

[0074] have , ;

[0075] Therefore there is That is, any All are included here In each formula;

[0076] The discriminant is then transformed into: ,common One; due to the existence of inverse elements, further transformations are performed. .

[0077] In summary, the discriminant is transformed from... Change to and It is feasible.

[0078] In a specific implementation, see Figure 3 As shown, the SM2 example curve For example, prime numbers p and order n satisfy the condition (p = 0x8542D69E 4C044F18 E8B92435 BF6FF7DE 45728391 5C45517D722EDB8B 08F1DFC3, n = 0x8542D69E 4C044F18 E8B92435 BF6FF7DD 297720630485628D 5AE74EE7 C32E79B7).

[0079] Among them, steps ①②③④⑤ of the verification remain unchanged, and the elliptical points calculated in step ⑥ are modified. and conduct If the signatures are equal, the verification passes; otherwise, it is rejected. If they are equal, the verification passes; otherwise, the verification fails.

[0080] It should be noted that, However, the SM2 curve has Given its characteristics, we only need to determine... ,Right now and .

[0081] Figure 4 This is an architecture diagram of a digital signature verification device provided in an embodiment of the present invention, such as... Figure 4 As shown, it includes:

[0082] The acquisition unit 410 is used to acquire a target message to be verified; the target message to be verified includes: a message to be verified, a public key, and a digital signature to be verified; the digital signature includes a first signature value and a second signature value; the digital signature is obtained based on the elliptic curve digital signature algorithm.

[0083] The first verification unit 420 is used to verify whether both the first signature value and the second signature value are less than the elliptic curve order. n If the result is a non-zero natural number, then the digital signature verification fails.

[0084] The second verification unit 430 is configured to verify if both the first signature value and the second signature value are less than the elliptic curve order. nIf the value is a non-zero natural number, then calculate the hash value of the message to be verified, sum the first signature value and the second signature value, and then align the sum to the order of the hash value. n If the modulo result is 0, the digital signature verification fails.

[0085] The coordinate transformation unit 440 is used to calculate the point on the elliptic curve corresponding to the digital signature based on the public key in the Jacobian projective coordinate system if the obtained modulo result is not 0, thereby obtaining the triplet coordinates of the point in the Jacobian projective coordinate system. Points on the elliptic curve have binary coordinates in the affine coordinate system. , and ;

[0086] The subtraction modulo unit 450 is used to subtract the first signature value from the hash value of the message to be verified, and to adjust the order of the subtraction result. n Modulo to obtain q ;

[0087] The third verification unit 460 is used to verify... q Multiply Obtain the result of the first multiplication, and then divide the result of the first multiplication by the number of elements of the finite field used for the elliptic curve. p Calculate the modulus to obtain the first modulo value; then... right p The first modulo value is obtained by taking the modulo; if the first modulo value is equal to the second modulo value, the digital signature verification is successful.

[0088] The fourth verification unit 470 is used to, if the first modulo value is not equal to the second modulo value, let i Incrementing from 1 to positive integers, q and i times n Add them together, and multiply the result by . Obtain the result of the second multiplication, and then apply the result of the second multiplication to... p Calculate the modulus to obtain the third modulo value; increment. i If you go to a certain i If the third modulo value is equal to the second modulo value, the digital signature verification passes; if i Increment to If the third modulo value still cannot be equal to the second modulo value, then the digital signature verification fails.

[0089] It is understood that the detailed functional implementation of each of the above units can be found in the description of the aforementioned method embodiments, and will not be repeated here.

[0090] In addition, embodiments of the present invention provide an electronic device, which includes: a memory and a processor;

[0091] The memory is used to store computer programs;

[0092] The processor is configured to implement the methods described in the above embodiments when executing the computer program.

[0093] In addition, the present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the methods described in the above embodiments.

[0094] Based on the methods in the above embodiments, this embodiment of the invention provides a computer program product that, when run on a processor, causes the processor to execute the methods in the above embodiments.

[0095] Based on the methods described in the above embodiments, this invention also provides a chip, including one or more processors and interface circuitry. Optionally, the chip may further include a bus. Wherein:

[0096] The processor may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed through integrated logic circuits in the processor's hardware or through software instructions. The processor may be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods and steps disclosed in the embodiments of this application. The general-purpose processor may be a microprocessor or any conventional processor.

[0097] Interface circuits can be used to send or receive data, instructions, or information. Processors can use the data, instructions, or other information received by the interface circuits to process the data, instructions, or other information, and then send the processed information out through the interface circuits.

[0098] Optionally, the chip may also include memory, which may include read-only memory and random access memory, and provide operation instructions and data to the processor. A portion of the memory may also include non-volatile random access memory (NVRAM).

[0099] Optionally, the memory stores executable software modules or data structures, and the processor can execute corresponding operations by calling the operation instructions stored in the memory (which may be stored in the operating system).

[0100] Optionally, the interface circuitry can be used to output the processor's execution results.

[0101] It should be noted that the functions of the processor and interface circuits can be implemented through hardware design, software design, or a combination of both; no restrictions are imposed here.

[0102] It should be understood that each step of the above method embodiments can be completed by hardware logic circuits or software instructions in a processor.

[0103] It is understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application. In addition, in some possible implementations, each step in the above embodiments may be selectively executed according to the actual situation, and may be partially or fully executed, which is not limited here.

[0104] It is understood that the processor in the embodiments of this application may 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, transistor logic devices, hardware components, or any combination thereof. A general-purpose processor may be a microprocessor or any conventional processor.

[0105] The method steps in the embodiments of this application can be implemented in hardware or by a processor executing software instructions. The software instructions can consist of corresponding software modules, which can be stored in random access memory (RAM), flash memory, read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), registers, hard disks, portable hard disks, CD-ROMs, or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor, enabling the processor to read information from and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can reside in an ASIC.

[0106] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially as a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted through the computer-readable storage medium. The computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state disk (SSD)).

[0107] Those skilled in the art will readily understand that the above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A digital signature verification method, characterized in that, Includes the following steps: Retrieve the target message to be verified; The target message to be verified includes: the message to be verified, a public key, and a digital signature to be verified; the digital signature includes a first signature value and a second signature value; the digital signature is obtained based on the elliptic curve digital signature algorithm. Verify whether both the first signature value and the second signature value are less than the elliptic curve order. n If the result is a non-zero natural number, then the digital signature verification fails. If both the first signature value and the second signature value are less than the elliptic curve order n If the value is a non-zero natural number, then calculate the hash value of the message to be verified, sum the first signature value and the second signature value, and then align the sum to the order of the hash value. n If the modulo result is 0, the digital signature verification fails. If the modulo result is not 0, then the point on the elliptic curve corresponding to the digital signature is calculated based on the public key in the Jacobian projective coordinate system, and the triplet coordinates of the point in the Jacobian projective coordinate system are obtained. ; Subtract the first signature value from the hash value of the message to be verified, and then adjust the order of the subtraction result. n Modulo to obtain q ; Will q Multiply Obtain the result of the first multiplication, and then divide the result of the first multiplication by the number of elements of the finite field used for the elliptic curve. p Calculate the modulus to obtain the first modulo value; then... right p The first modulo value is obtained by taking the modulo; if the first modulo value is equal to the second modulo value, the digital signature verification is successful. If the first modulo value is not equal to the second modulo value, let i Incrementing from 1 to positive integers, q and i times n Add them together, and multiply the result by 1. Obtain the result of the second multiplication, and then apply the result of the second multiplication to... p Modulo operation yields the third modulo value; incrementing. i If you go to a certain i If the third modulo value is equal to the second modulo value, the digital signature verification passes; if i Increment to If the third modulo value still cannot be equal to the second modulo value, then the digital signature verification fails.

2. The method according to claim 1, characterized in that, This method calculates points on an elliptic curve based on the transformation of the Jacobian projective coordinate system, thus avoiding the division operations required to find points on an elliptic curve in the affine coordinate system, and also increases... i Under the premise of determining the magnitude of the modulus, the inverse operation caused by coordinate system transformation is further avoided by utilizing the characteristics of finite field operations.

3. The method according to claim 1 or 2, characterized in that, Let the first signature value be The hash value of the message to be verified is ;but ; when At that time, The discriminant is transformed into Since all non-zero elements in the prime field have multiplicative inverses, the discriminant is equivalent to... .

4. The method according to claim 1 or 2, characterized in that, Let the first signature value be The hash value of the message to be verified is ;but ; when When, the discriminant is transformed into ,common One, of which Since all non-zero elements in the prime field have multiplicative inverses, the discriminant is equivalent to... .

5. The method according to claim 1 or 2, characterized in that, When the digital signature is obtained based on the SM2 elliptic curve digital signature algorithm , i =1; At this point, only one step of determining the magnitude of the modulus needs to be added to avoid the inverse operation caused by coordinate system transformation.

6. A digital signature verification device, characterized in that, include: The acquisition unit is used to acquire the target message to be verified. The target message to be verified includes: the message to be verified, a public key, and a digital signature to be verified; the digital signature includes a first signature value and a second signature value; the digital signature is obtained based on the elliptic curve digital signature algorithm. The first verification unit is used to verify whether both the first signature value and the second signature value are less than the elliptic curve order. n If the result is a non-zero natural number, then the digital signature verification fails. The second verification unit is configured to verify if both the first signature value and the second signature value are less than the elliptic curve order. n If the value is a non-zero natural number, then calculate the hash value of the message to be verified, sum the first signature value and the second signature value, and then align the sum to the order of the hash value. n If the modulo result is 0, the digital signature verification fails. The coordinate transformation unit is used to calculate the point on the elliptic curve corresponding to the digital signature based on the public key in the Jacobian projective coordinate system if the obtained modulo result is not 0, thereby obtaining the triplet coordinates of the point in the Jacobian projective coordinate system. ; The subtraction modulo unit is used to subtract the first signature value from the hash value of the message to be verified, and then adjust the order of the subtraction result. n Modulo to obtain q ; The third verification unit is used to verify... q Multiply Obtain the result of the first multiplication, and then divide the result of the first multiplication by the number of elements of the finite field used for the elliptic curve. p Calculate the modulus to obtain the first modulo value; then... right p The first modulo value is obtained by taking the modulo; if the first modulo value is equal to the second modulo value, the digital signature verification is successful. The fourth verification unit is used to, if the first modulo value is not equal to the second modulo value, let i Incrementing from 1 to positive integers, q and i times n Add them together, and multiply the result by 1. Obtain the result of the second multiplication, and then apply the result of the second multiplication to... p Modulo operation yields the third modulo value; incrementing. i If you go to a certain i If the third modulo value is equal to the second modulo value, the digital signature verification passes; if i Increment to If the third modulo value still cannot be equal to the second modulo value, then the digital signature verification fails.

7. The apparatus according to claim 6, characterized in that, The coordinate transformation unit calculates points on the elliptic curve based on the Jacobian projective coordinate system transformation, thus avoiding the division operation required to find points on the elliptic curve in the affine coordinate system. Furthermore, the fourth verification unit adds... i Under the premise of determining the magnitude of the modulus, the inverse operation caused by coordinate system transformation is further avoided by utilizing the characteristics of finite field operations.

8. The apparatus according to claim 6 or 7, characterized in that, When the digital signature is obtained based on the SM2 elliptic curve digital signature algorithm , i =1; At this point, the fourth verification unit only needs to add one step to determine the magnitude of the modulus value, which can avoid the inversion operation caused by the coordinate system transformation.

9. An electronic device, characterized in that, The electronic device includes a processor and a memory, the memory storing at least one piece of program code, which is loaded and executed by the processor to implement the digital signature verification method as described in any one of claims 1-5.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores at least one piece of program code, which is loaded and executed by a processor to implement the digital signature verification method as described in any one of claims 1-5.