A method, apparatus, storage medium and electronic device for digital signature

By pre-compiling and caching intermediate data for SM2 signatures, the efficiency problem of the SM2 algorithm in resource-constrained scenarios is solved, achieving efficient signing and improving security.

CN116996233BActive Publication Date: 2026-11-24BEIJING CERTIFICATE AUTHORITY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311102836.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-29
Publication Date
2026-11-24
Estimated Expiration
2043-08-29

AI Technical Summary

Technical Problem

The existing SM2 algorithm has low execution efficiency in resource-constrained scenarios, making it difficult to meet business needs.

Method used

By pre-calculating random numbers and shared secret values ​​to obtain intermediate data and storing it in a cache queue, the intermediate data can be directly read from the cache queue for processing when a user's signature request is received, thereby reducing the online time consumption of signature calculation.

Benefits of technology

It improves the execution efficiency of digital signatures, reduces online time consumption, and has the security to resist memory theft attacks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116996233B_ABST
    Figure CN116996233B_ABST
Patent Text Reader

Abstract

Some embodiments of the present application provide a method, device, storage medium and electronic device for digital signature, the method comprising: obtaining pre-stored intermediate data from a cache queue after receiving a user signature request, wherein the intermediate data is obtained by pre-computing a random number and a shared secret value, and the shared secret value is obtained by processing a signature private key using a one-way function; performing signature using the intermediate data to obtain a signature result corresponding to the user signature request. Some embodiments of the present application reduce the online signature computation amount by pre-offline computation, and improve the efficiency of digital signature.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of digital signature technology, and more specifically, to a method, apparatus, storage medium, and electronic device for digital signature. Background Technology

[0002] A digital signature (also known as a public-key digital signature) is a string of numbers that only the sender of the information can generate and that cannot be forged by others. This string of numbers also serves as valid proof of the authenticity of the information sent by the sender.

[0003] The SM2 algorithm, a Chinese national cryptographic algorithm, is a highly secure digital signature algorithm based on elliptic curve cryptography. Currently, however, because the existing SM2 algorithm requires a large number of cryptographic operations to achieve digital signatures, its execution efficiency is insufficient to meet business efficiency requirements in resource-constrained scenarios.

[0004] Therefore, how to provide a technical solution for an efficient digital signature method has become an urgent technical problem to be solved. Summary of the Invention

[0005] The purpose of some embodiments of this application is to provide a method, apparatus, storage medium, and electronic device for digital signatures. The technical solutions of the embodiments of this application can reduce the online time consumption of digital signatures and improve the algorithm execution efficiency by pre-calculating some data.

[0006] In a first aspect, some embodiments of this application provide a digital signature method, comprising: receiving a user signature request, retrieving pre-stored intermediate data from a cache queue, wherein the intermediate data is obtained by pre-calculating a random number and a shared secret value, and the shared secret value is obtained by processing a signature private key using a one-way function; and performing a signature using the intermediate data to obtain a signature result corresponding to the user signature request.

[0007] Some embodiments of this application store intermediate data, which is obtained by securely calculating random numbers and shared secret values ​​in advance, in a cache queue. Upon receiving a user's signature request, the intermediate data is read from the cache queue and processed to obtain the signature result. In processing digital signature requests, this application's embodiments utilize a caching mechanism to obtain intermediate data, eliminating the need for extensive computation, reducing online time consumption for signature calculation, and improving the efficiency of obtaining signature results.

[0008] In some embodiments, before receiving the user signature request, the method further includes: generating the random number, wherein the number of random numbers is at least one; confirming that the random number meets a set range, then performing a multi-point operation on the random number to obtain a multi-point operation result; performing data conversion on the random number, the multi-point operation result, and the shared secret value to obtain the intermediate data and cache it in the cache queue, wherein one random number corresponds to one set of intermediate data.

[0009] Some embodiments of this application perform multi-point operations on the generated random number, and then perform data conversion and processing on the random number, the result of the multi-point operation, and the shared secret value to obtain intermediate data, which can be directly read from the cache queue later, reducing the online time consumption of digital signatures.

[0010] In some embodiments, the step of performing data transformation on the random number, the result of the multi-point operation, and the shared secret value to obtain the intermediate data includes: assigning a first component of the intermediate data to the x-coordinate of the result of the multi-point operation; performing a formal transformation on the signature private key to obtain a transformation value, and transforming the x-coordinate of the result of the multi-point operation and the shared secret value to obtain a transformation function value; and performing operations on the transformation value, the transformation function value, the x-coordinate of the result of the multi-point operation, and the random number to obtain a second component of the intermediate data.

[0011] Some embodiments of this application determine the final intermediate data by assigning values ​​to the first component and calculating the second component of the intermediate data, thus providing data support for digital signatures.

[0012] In some embodiments, the step of performing calculations on the transformed value, the transformation function value, the x-coordinate of the multi-point operation result, and the random number to obtain the second component of the intermediate data includes: determining the intermediate data (u, v) using the following formula:

[0013]

[0014] Where u is the first component, v is the second component, x is the x-coordinate of the result of the multiple point operation, D is the transformation value, k is the random number, f(x,η) is the transformation function value, η is the shared secret value, and n is the standard number.

[0015] In some embodiments, the step of using the intermediate data to sign and obtain the signature result corresponding to the user signature request includes: obtaining a digest of the data to be signed in the user signature request; and using the intermediate data to sign the digest to obtain the signature result.

[0016] Some embodiments of this application use intermediate data to sign the digest of the data to be signed, thereby obtaining a signature result, reducing online time consumption and improving execution efficiency.

[0017] In some embodiments, signing the digest using the intermediate data to obtain the signature result includes: assigning the x-coordinate of the multi-point operation result to the first component in the intermediate data; performing a modulo operation on the sum of the x-coordinates of the digest and the multi-point operation result and the standard number to obtain the first part of the signature result; and performing an operation on the digest, the transformation value, the transformation function value, and the second component in the intermediate data to obtain the second part of the signature result.

[0018] Some embodiments of this application calculate the relationship between intermediate data and the digest to obtain the first and second parts of the signature result, thereby reducing the amount of online computation and improving the efficiency of online signature.

[0019] In some embodiments, the signature result (r, s) is obtained using the following formula:

[0020]

[0021] Where r is the first part, s is the second part, e is the summary, n is the standard number, and v is the second component in the intermediate data.

[0022] Secondly, some embodiments of this application provide a digital signature apparatus, comprising: an acquisition module configured to, upon receiving a user signature request, acquire pre-stored intermediate data from a cache queue, wherein the intermediate data is obtained by pre-calculating a random number and a shared secret value, and the shared secret value is obtained by processing a signature private key using a one-way function; and a signature module configured to perform a signature using the intermediate data and acquire a signature result corresponding to the user signature request.

[0023] Thirdly, some embodiments of this application provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, can implement the method described in any embodiment of the first aspect.

[0024] Fourthly, some embodiments of this application provide an electronic device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the program, can implement the method as described in any embodiment of the first aspect.

[0025] Fifthly, some embodiments of this application provide a computer program product, the computer program product including a computer program, wherein the computer program, when executed by a processor, can implement the method described in any embodiment of the first aspect. Attached Figure Description

[0026] To more clearly illustrate the technical solutions of some embodiments of this application, the accompanying drawings used in some embodiments of this application will be briefly described below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0027] Figure 1 A system diagram of a digital signature is provided for some embodiments of this application;

[0028] Figure 2 A flowchart of a digital signature method is provided for some embodiments of this application;

[0029] Figure 3 One of the structural diagrams of a digital signature provided for some embodiments of this application;

[0030] Figure 4 A second structural diagram of a digital signature provided for some embodiments of this application;

[0031] Figure 5 A block diagram of a digital signature apparatus is provided for some embodiments of this application;

[0032] Figure 6 A schematic diagram of an electronic device provided for some embodiments of this application. Detailed Implementation

[0033] The technical solutions of some embodiments of this application will now be described with reference to the accompanying drawings.

[0034] It should be noted that similar reference numerals and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. Furthermore, in the description of this application, terms such as "first," "second," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.

[0035] In related technologies, the SM2 digital signature algorithm is described by GB / T 32918.2. Most existing SM2 optimizations are based on mechanisms such as affine coordinate to projective coordinate transformation, Montgomery multiplication optimization, and caching. These optimizations reduce the number of simulated calculations or truncate large integers during computation, thereby improving algorithm efficiency. However, even after these optimizations, the SM2 algorithm still requires multiple point operations during signing, resulting in a relatively large computational load and long processing time.

[0036] As can be seen from the above-mentioned technologies, the computational load of digital signatures in the existing technology is relatively large, and the execution efficiency needs to be improved.

[0037] In view of this, some embodiments of this application provide a digital signature method that decomposes the digital signature process into two processes. One process involves pre-calculating and transforming a random number and a shared secret value to obtain intermediate data, which is then stored in a cache queue. The other process involves directly reading the intermediate data from the cache queue and processing it after receiving a user's signature request to obtain the signature result. Some embodiments of this application complete the multi-point calculation without needing to receive a digital signature operation request. After receiving the signature request, the intermediate result (i.e., intermediate data) is retrieved from the cache for subsequent calculations, reducing response time and online processing time, and improving algorithm execution efficiency. Moreover, the embodiments of this application, through the transformation and modification of the intermediate result, enable the SM2 signature process to resist memory theft attacks, preventing attackers from analyzing useful data, thus ensuring high security.

[0038] The following is in conjunction with the appendix Figure 1 The overall structure of the digital signature architecture provided by some embodiments of this application is illustrated by way of example.

[0039] like Figure 1 As shown in the diagram, some embodiments of this application provide an architecture diagram for a digital signature, which includes a producer 100, a cache queue 110, and a consumer 120. The producer 100 can pre-calculate intermediate results using generated random numbers and a shared secret value, and then store these intermediate results in the cache queue 110. Upon receiving a user's signature request, the consumer 120 can read the intermediate results from the cache queue 110, process them, and obtain the signature result.

[0040] In some embodiments of this application, producer 100 and consumer 120 can be the same cryptographic processing unit in a terminal device. When the cryptographic processing unit is idle, it can act as producer 100, outputting intermediate results obtained from computation to accumulate a certain number of cached data items (i.e., intermediate results). When the cryptographic processing unit receives a user signature request, it can act as consumer 120, processing the user signature request and outputting the signature result.

[0041] In other embodiments of this application, producer 100 and consumer 120 can each be multiple cryptographic processing units in a terminal device. Based on actual signature requirements, stronger or more cryptographic processing units can be assigned as producers 100, and weaker or fewer cryptographic processing units as consumers 120. For example, in one embodiment, N producer cryptographic processing units and M consumer cryptographic processing units can perform their respective calculations simultaneously, connected by a cache queue 110, to collaboratively complete the SM2 digital signature, thereby optimizing performance and reducing digital signature processing time.

[0042] The following is in conjunction with the appendix Figure 2 The present application provides an exemplary embodiment of the digital signature implementation process performed by a cryptographic processing unit.

[0043] Please see the appendix Figure 2 , Figure 2 A flowchart of a digital signature method is provided for some embodiments of this application. The digital signature method includes at least:

[0044] S210, after receiving the user's signature request, retrieve the pre-stored intermediate data from the cache queue, wherein the intermediate data is obtained by pre-calculating the random number and the shared secret value, and the shared secret value is obtained by processing the signature private key using a one-way function.

[0045] For example, in some embodiments of this application, after receiving a user signature request, the cryptographic processing unit, acting as consumer 120, can read pre-stored intermediate results from the cache queue 110. These intermediate results are obtained by producer 100 after processing random numbers and a shared secret value.

[0046] In some embodiments of this application, the digital signature method further includes, before performing S210:

[0047] S201, Generate the random number, wherein the number of the random number is at least one;

[0048] For example, in some embodiments of this application, the cryptographic processing unit, as producer 100, calls the algorithm or function of the random number generation function to generate a random number k, and checks it according to the range requirements of k in GB / T 32918 standard (as a specific example of setting a range).

[0049] S202, if the random number is confirmed to meet the set range, then perform a multi-point operation on the random number to obtain the multi-point operation result;

[0050] For example, in some embodiments of this application, after confirming that k meets the requirements, the point Q = [k]G = (x, y) is calculated. Here, G = (x, y) is two-dimensional standard data.

[0051] S203, perform data conversion on the random number, the result of the multi-point operation, and the shared secret value to obtain the intermediate data and cache it in the cache queue, wherein one random number corresponds to one set of intermediate data.

[0052] For example, in some embodiments of this application, the private key d for signing in producer 100 is used in a transformed form D = (1 + d) during subsequent processing. -1 By setting η = g(d), a shared secret value η is established. Here, g represents a hash function or a similar one-way hash function. This method ensures that d cannot be derived from η in reverse, thus improving computational security. Afterwards, data transformation is performed based on k and η to obtain intermediate results.

[0053] In some embodiments of this application, S203 may further include: assigning the first component of the intermediate data to the x-coordinate of the multi-point operation result; performing a formal conversion on the signature private key to obtain a conversion value, and transforming the x-coordinate of the multi-point operation result and the shared secret value to obtain a transformation function value; and performing calculations on the conversion value, the transformation function value, the x-coordinate of the multi-point operation result, and the random number to obtain the second component of the intermediate data.

[0054] For example, in some embodiments of this application, the first component u in the intermediate result is assigned the value x in two-dimensional standard data (as a specific example of the result of a multi-point operation). The transformed value D = (1 + d) -1 The transformation function value is f(x,η). Finally, combining D, f(x,η), k, and x, we obtain the second component v of the intermediate data. Here, f() represents a cryptographic hash function or a transformation function with a similar function, for example: f(x,η)=SM3(x|η).

[0055] Specifically, the intermediate data (u, v) is determined using the following formula:

[0056]

[0057] Where x is the x-coordinate of the result of the multi-point operation, D is the transformation value, k is a random number, f(x,η) is the transformation function value, η is the shared secret value, and n is the standard number.

[0058] Subsequently, a temporary storage segment is requested, including a general-purpose computer cache or other efficient storage unit within a cryptographic module, and (u, v) is sent into that storage unit in a queue.

[0059] S220, use the intermediate data to perform a signature and obtain the signature result corresponding to the user's signature request.

[0060] For example, in some embodiments of this application, an intermediate result (u, v) item is retrieved from the queue, and the queue pointer is changed to point to the next item. Then, (u, v) is processed to obtain the corresponding signature result.

[0061] In some embodiments of this application, S220 may include: obtaining a digest of the data to be signed in the user signature request; signing the digest using the intermediate data; and obtaining the signature result.

[0062] For example, in some embodiments of this application, the cryptographic processing unit receives a digest e of the data to be signed, the calculation process of e conforms to the preprocessing process of GB / T 32918, and then uses the first element (u, v) of the obtained queue to sign and obtain the signature result.

[0063] In some embodiments of this application, S220 may further include: assigning the x-coordinate of the multi-point operation result to the first component in the intermediate data; performing a modulo operation on the sum of the x-coordinates of the digest and the multi-point operation result and the standard number to obtain the first part of the signature result; and performing an operation on the digest, the conversion value, the transformation function value, and the second component in the intermediate data to obtain the second part of the signature result.

[0064] For example, in some embodiments of this application, let x = u, and then perform a modulo operation on e, x, and n to obtain the first part r of the signature result. Perform operations on e, D, f(x,η), and v to obtain the second part s of the signature result.

[0065] Specifically, the signature result (r, s) is obtained using the following formula:

[0066]

[0067] Where e is the abstract, n is the standard number, and v is the second component in the intermediate data.

[0068] The following is in conjunction with the appendix Figure 3 and Figure 4 The present application provides an exemplary description of the specific process of digital signatures provided by some embodiments.

[0069] Please see the appendix Figure 3 , Figure 3This document provides an implementation structure diagram of a digital signature for some embodiments of this application. It should be noted that the cryptographic processing unit within the terminal's cryptographic module, during idle time, acts as producer 100 to perform the calculation processes described in S201-S203, accumulating a certain number of cached data items stored in a cache (queue). The private key d for signing is stored in the cryptographic calculation unit in the form of D. For example, the producer 100 calculation process includes:

[0070] ① Generate k, calculate multiple points to obtain intermediate results (u, v).

[0071] ② Add (u, v) to the queue.

[0072] Subsequently, after receiving the signature request, the cryptographic processing unit, acting as consumer 120, performs the calculation processes S210 and S220 described above. For example, the calculation process of consumer 120 includes:

[0073] ③ Request that digest e be signed.

[0074] ④ Take the (u, v) at the head of the queue and calculate the signature result (r, s).

[0075] Please see the appendix Figure 4 , Figure 4 This is a structural diagram illustrating an implementation of a digital signature, provided for some other embodiments of this application. It should be noted that the cryptographic module of this terminal contains multiple cryptographic processing units. In practical applications, one or more cryptographic processing units can act as producers 100 to implement the calculation processes S201–S203 described above, producing more (u, v) cached data items; the remaining cryptographic processing units, upon receiving the user's signature request, implement the calculation processes S210 and S220 described above. Since the computational complexity of multiple points in S201–S203 is significantly greater than the large number computation in S210 and S220, it is advisable to allocate stronger or more cryptographic processing units as producers 100, and weaker or fewer cryptographic processing units as consumers 120.

[0076] For example, a GPU (graphics processing unit) can be considered a stronger cryptographic processing unit, performing calculations related to producer 100, while a CPU can be considered a weaker cryptographic processing unit, performing calculations related to consumer 120.

[0077] In one implementation, within the software cryptographic module, N GPU cores can be allocated to perform calculations related to producer 100, while the remaining M cores serve as weaker cryptographic processing units acting as consumers 120. Specifically, the values ​​of M and N can be adjusted based on actual test results; this embodiment does not impose specific limitations here. In another implementation, within certain cryptographic modules, N cryptographic coprocessor cores can be allocated to perform calculations related to producer 100, while the remaining M cores serve as weaker cryptographic processing units acting as consumers 120, wherein the values ​​of M and N are adjusted based on actual test results.

[0078] It is understandable that the calculation process for producer 100 and consumer 120 is the same as described above. Figure 3 The processes described in ① to ④ are similar; please refer to the method implementation examples provided above for details. Figure 3 The difference is that when one or more cryptographic processing units act as producers 100, their internal cryptographic calculation units store D, and the cryptographic calculation units of the other cryptographic processing units acting as consumers 120 also store D, so that they can be used in the calculation process.

[0079] As can be seen from the embodiments described above, this invention divides SM2 signature calculation into two parts. By calculating cached data during idle time or through the collaborative work of multiple processing units, when processing a single SM2 digital signature request, only large integer operations need to be performed, eliminating the need to generate random numbers or perform multi-point calculations. This significantly reduces the online time consumption of a single SM2 signature calculation. When used in signature server products to handle a large number of concurrent signature requests, it can also more effectively utilize the capabilities of the cryptographic processing units, significantly improving concurrent processing capabilities. The collaboration of multiple cryptographic processing units improves cryptographic processing efficiency and reduces the time consumption of cryptographic operations.

[0080] Furthermore, the computational method described in this invention possesses the characteristic of resisting cached data eavesdropping attacks. Since (u, v) in the cache queue contains the private key d and the secret value η in both the producer 100 and consumer 120 cryptographic processing units, the method of calculating cached data through elliptic curve multiplication and modular multiplication of two unknown large integers (i.e., D(k+x)+f(x,η)) can resist data eavesdropping. Attackers cannot calculate the private key from a single (u, v) and the corresponding signature result (r, s), nor can they jointly calculate the private key d and the random number k from multiple sets of cached data and signature results. Therefore, it can prevent memory leaks and memory eavesdropping without relying on external mechanisms, thus posing no threat to the digital signature process. Additionally, adding other variables or performing other data transformations when calculating (u, v) data achieves the goal of preventing cached data eavesdropping. The embodiments of this application are not limited to this.

[0081] Please refer to Figure 5 , Figure 5The diagram illustrates the composition of a digital signature apparatus according to some embodiments of this application. It should be understood that this digital signature apparatus corresponds to the method embodiments described above and is capable of performing the various steps involved in the method embodiments. The specific functions of this digital signature apparatus can be found in the description above; detailed descriptions are omitted here to avoid repetition.

[0082] Figure 5 The digital signature apparatus includes at least one software functional module that can be stored in a memory or embedded in the digital signature apparatus in the form of software or firmware. The digital signature apparatus includes: an acquisition module 510, configured to receive a user signature request and acquire pre-stored intermediate data from a cache queue, wherein the intermediate data is obtained by pre-calculating a random number and a shared secret value, and the shared secret value is obtained by processing the signature private key using a one-way function; and a signature module 520, configured to perform a signature using the intermediate data and acquire the signature result corresponding to the user signature request.

[0083] In some embodiments of this application, before the acquisition module 510, the digital signature apparatus may further include: a production module (not shown in the figure), configured to generate the random number, wherein the number of random numbers is at least one; confirming that the random number meets a set range, then performing a multi-point operation on the random number to obtain a multi-point operation result, and performing data conversion on the random number, the multi-point operation result and the shared secret value, obtaining the intermediate data and caching it in the cache queue, wherein one random number corresponds to a set of intermediate data.

[0084] In some embodiments of this application, the production module is configured to assign the first component of the intermediate data to the x-coordinate of the multi-point operation result; perform a formal conversion on the signature private key to obtain a conversion value, and transform the x-coordinate of the multi-point operation result and the shared secret value to obtain a transformation function value; and perform calculations on the conversion value, the transformation function value, the x-coordinate of the multi-point operation result, and the random number to obtain the second component of the intermediate data.

[0085] In some embodiments of this application, the production module is configured to determine the intermediate data (u, v) using the following formula:

[0086]

[0087] Where u is the first component, v is the second component, x is the x-coordinate of the result of the multiple point operation, D is the transformation value, k is the random number, f(x,η) is the transformation function value, η is the shared secret value, and n is the standard number.

[0088] In some embodiments of this application, the signature module 520 is configured to obtain a digest of the data to be signed in the user signature request; sign the digest using the intermediate data; and obtain the signature result.

[0089] In some embodiments of this application, the signature module 520 is configured to assign the x-coordinate of the multi-point operation result to the first component in the intermediate data; perform a modulo operation on the sum of the digest and the x-coordinate of the multi-point operation result with the standard number to obtain the first part of the signature result; and perform an operation on the digest, the conversion value, the transformation function value, and the second component in the intermediate data to obtain the second part of the signature result.

[0090] In some embodiments of this application, the signature module 520 is configured to obtain the signature result (r, s) using the following formula:

[0091]

[0092] Where r is the first part, s is the second part, e is the summary, n is the standard number, and v is the second component in the intermediate data.

[0093] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working process of the device described above can be referred to the corresponding process in the aforementioned method, and will not be elaborated further here.

[0094] Some embodiments of this application also provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, can perform the operation of any of the methods corresponding to the methods provided in the above embodiments.

[0095] Some embodiments of this application also provide a computer program product, which includes a computer program, wherein when the computer program is executed by a processor, it can implement the operation of any of the methods corresponding to the above embodiments provided in the above embodiments.

[0096] like Figure 6 As shown, some embodiments of this application provide an electronic device 600, which includes a memory 610, a processor 620, and a computer program stored in the memory 610 and executable on the processor 620. When the processor 620 reads the program from the memory 610 via a bus 630 and executes the program, it can implement the methods of any of the above embodiments.

[0097] Processor 620 can process digital signals and can include various computing architectures. For example, it can be a complex instruction set computer architecture, a reduced instruction set computer architecture, or an architecture that implements multiple instruction set combinations. In some examples, processor 620 can be a microprocessor.

[0098] The memory 610 can be used to store instructions executed by the processor 620 or data related to the execution of instructions. These instructions and / or data may include code for implementing some or all of the functions of one or more modules described in the embodiments of this application. The processor 620 of this disclosure embodiment can be used to execute the instructions in the memory 610 to implement the methods shown above. The memory 610 includes dynamic random access memory, static random access memory, flash memory, optical memory, or other memories well known to those skilled in the art.

[0099] The above description is merely an embodiment of this application and is not intended to limit the scope of protection of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application. It should be noted that similar reference numerals and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.

[0100] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

[0101] It should be noted that, in this document, relational terms such as "first" and "second" are used only 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 one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

Claims

1. A method for digital signature, characterized in that, include: After receiving a user's signature request, the system retrieves pre-stored intermediate data from the cache queue. The intermediate data is obtained by pre-calculating a random number and a shared secret value, and the shared secret value is obtained by processing the signature private key using a one-way function. The intermediate data is used to perform a signature, and the signature result corresponding to the user's signature request is obtained. Before receiving the user signature request, the method further includes: generating a random number, wherein the number of random numbers is at least one; confirming that the random number meets a set range, then performing a multi-point operation on the random number to obtain a multi-point operation result; performing data conversion on the random number, the multi-point operation result, and the shared secret value, obtaining the intermediate data and caching it in the cache queue, wherein one random number corresponds to one set of intermediate data; The intermediate data is obtained by performing data transformation on the random number, the result of the multi-point operation, and the shared secret value, including: assigning the first component of the intermediate data to the x-coordinate of the result of the multi-point operation; performing a formal transformation on the signature private key to obtain a transformation value, and transforming the x-coordinate of the result of the multi-point operation and the shared secret value to obtain a transformation function value; and performing calculations on the transformation value, the transformation function value, the x-coordinate of the result of the multi-point operation, and the random number to obtain the second component of the intermediate data. The conversion value D is obtained as follows: D = (1 + d) -1 d is the signature private key; The step of performing calculations on the transformed value, the transformation function value, the x-coordinate of the multi-point operation result, and the random number to obtain the second component of the intermediate data includes: The intermediate data is determined using the following formula ( u , v ): in, u For the first component, v This is the second component. x The x-coordinate of the result of the multiple point operation is... D The converted value, k The random number, The value of the transformation function. η For the shared secret value, n This is a standard number.

2. The method as described in claim 1, characterized in that, The step of using the intermediate data to perform a signature and obtaining the signature result corresponding to the user's signature request includes: Obtain the digest of the data to be signed in the user signature request; The digest is signed using the intermediate data to obtain the signature result.

3. The method as described in claim 2, characterized in that, The step of signing the digest using the intermediate data and obtaining the signature result includes: The x-coordinate of the result of the multiple point calculation is assigned to the first component of the intermediate data; The first part of the signature result is obtained by performing a modulo operation on the sum of the abscissas of the summary and the result of the multiple-point operation and the standard number; The second part of the signature result is obtained by performing operations on the digest, the transformation value, the transformation function value, and the second component in the intermediate data.

4. The method as described in claim 3, characterized in that, The signature result is obtained using the following formula ( r , s ): in, r This is the first part. s This is the second part. e For the summary, n For the standard number, v This is the second component in the intermediate data.

5. A digital signature device, characterized in that, include: The acquisition module is configured to receive a user's signature request and then retrieve pre-stored intermediate data from a cache queue. The intermediate data is obtained by pre-calculating a random number and a shared secret value, and the shared secret value is obtained by processing the signature private key using a one-way function. The signature module is configured to use the intermediate data to perform a signature and obtain the signature result corresponding to the user's signature request. The digital signature apparatus also includes a production module; the production module is configured to: Before receiving a user signature request, a random number is generated, wherein the number of random numbers is at least one; if the random number is confirmed to meet a set range, a multi-point operation is performed on the random number to obtain a multi-point operation result; data conversion is performed on the random number, the multi-point operation result and the shared secret value to obtain the intermediate data and cache it in the cache queue, wherein one random number corresponds to one set of intermediate data; The intermediate data is obtained by performing data transformation on the random number, the result of the multi-point operation, and the shared secret value, including: assigning the first component of the intermediate data to the x-coordinate of the result of the multi-point operation; performing a formal transformation on the signature private key to obtain a transformation value, and transforming the x-coordinate of the result of the multi-point operation and the shared secret value to obtain a transformation function value; and performing calculations on the transformation value, the transformation function value, the x-coordinate of the result of the multi-point operation, and the random number to obtain the second component of the intermediate data. The conversion value D is obtained as follows: D = (1 + d) -1 d is the signature private key; The step of performing calculations on the transformed value, the transformation function value, the x-coordinate of the multi-point operation result, and the random number to obtain the second component of the intermediate data includes: The intermediate data is determined using the following formula ( u , v ): in, u For the first component, v This is the second component. x The x-coordinate of the result of the multiple point operation is... D The converted value, k The random number, The value of the transformation function. η For the shared secret value, n This is a standard number.

6. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein the computer program, when executed by a processor, performs the method as described in any one of claims 1-4.

7. An electronic device, characterized in that, The method includes a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the computer program is executed by the processor to perform the method as described in any one of claims 1-4.

Citation Information

Patent Citations

  • Method for verifying safety of SM2 signature algorithm based on improved difference error attack

    CN104836808A

  • Operation end agent authorization method and device based on multi-party computing

    CN112769563A