Hybrid signature generation method and related device

Through technical means such as hash functions and pseudo-random number generation functions, a hybrid signature of shorter length is generated, which solves the network bandwidth problem caused by the excessive length of traditional signatures and improves system performance and resource utilization.

CN119652536APending Publication Date: 2025-03-18太保科技有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411837859.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-12
Publication Date
2025-03-18

AI Technical Summary

Technical Problem

The length of traditional hybrid signatures is long, resulting in the need of a large amount of network bandwidth for signature verification during busy services, affecting system performance and resource utilization.

Method used

The message digest is generated by a hash function, the second and third values ​​are determined based on the preset value, the elliptic curve parameter and the private key, and the fourth value is determined by the pseudo-random number generation function and the Falcon private key, forming a set of mixed signatures.

Benefits of technology

The generated hybrid signature length is shorter, which can effectively save network bandwidth, significantly improve system performance and optimize resource utilization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119652536A_ABST
    Figure CN119652536A_ABST
Patent Text Reader

Abstract

The invention discloses a hybrid signature generation method and a related device, and relates to the technical field of information security. Comprising the following steps: performing hash processing on a target message through a hash function to generate a message digest; determining a second numerical value and a third numerical value based on a preset first numerical value, a base point of the elliptic curve, an order of the elliptic curve, the SM2 private key and the message digest; determining a fourth numerical value through a pseudo-random number generation function, the second numerical value, a Falcon private key and a target message; and taking a set formed by the second value, the third value and the fourth value as a mixed signature. The mixed signature generated in the application comprises three parts, namely the second numerical value, the third numerical value and the fourth numerical value, and compared with a mixed signature generated by a traditional scheme, the length of the mixed signature in the application is shorter; when the mixed signature is used for large-scale signature verification, the network bandwidth can be effectively saved, the system performance is remarkably improved, and the resource utilization is optimized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of information security technology, and in particular to a hybrid signature generation method and related devices. Background Art

[0002] In order to improve the security of information, the combination of two signature results is used as a hybrid signature in traditional schemes. For example, the SM2 signature result (r, S sm2 ) and Falcon signature result (r Q ,s Q ) as a quantum-resistant hybrid signature (r, S sm2 ), (r Q ,s Q ). During use, only when both signature results pass the verification, the overall verification signature is considered to pass.

[0003] The hybrid signature generated by the traditional solution is relatively long. During busy business periods such as Double Eleven, a very large network bandwidth is required to perform hundreds of millions of signature verification operations in a short period of time. If the length of the hybrid signature can be shortened, it will effectively save network bandwidth, thereby significantly improving system performance and optimizing resource utilization. Summary of the invention

[0004] Based on the above problems, the present application provides a method for generating a hybrid signature. The hybrid signature generated by this method is shorter in length and can effectively save network bandwidth during large-scale signature verification, thereby significantly improving system performance and optimizing resource utilization.

[0005] The embodiments of the present application disclose the following technical solutions:

[0006] The first aspect of the present application discloses a method for generating a hybrid signature, comprising:

[0007] The target message is hashed by a hash function to generate a message digest;

[0008] Determine a second value and a third value based on a preset first value, a base point of an elliptic curve, an order of the elliptic curve, an SM2 private key, and the message digest; the first value is an integer greater than 1 and less than the order of the elliptic curve;

[0009] Determine a fourth value by using a pseudo-random number generation function, the second value, a Falcon private key, and the target message;

[0010] A set consisting of the second value, the third value and the fourth value is used as a mixed signature.

[0011] In an optional implementation, determining the second value and the third value based on a preset first value, a base point of an elliptic curve, an order of the elliptic curve, an SM2 private key, and the message digest includes:

[0012] Determining a first intermediate value based on the first value and a base point of the elliptic curve;

[0013] If the first intermediate value is not zero, determining a second intermediate value based on the first intermediate value, the SM2 private key, the first value, the message digest, and the order of the elliptic curve;

[0014] If the second intermediate value is not zero, the first intermediate value is determined as the second value, and the third value is determined based on the second intermediate value, the message digest, and the order of the elliptic curve.

[0015] In an optional implementation, the method further includes:

[0016] If the first intermediate value is zero or the second intermediate value is zero, returning to the step of determining the preset first value and reselecting a new first value;

[0017] The determining of the second value and the third value based on the first value, the base point of the elliptic curve, the order of the elliptic curve, the SM2 private key and the message digest is specifically:

[0018] The second value and the third value are determined based on the reselected first value, the base point of the elliptic curve, the order of the elliptic curve, the SM2 private key and the message digest.

[0019] In an optional implementation, determining the fourth value by using a pseudo-random number generation function, the second value, a Falcon private key, and the target message includes:

[0020] Processing the second value by using a pseudo-random number generation function to generate a third intermediate value;

[0021] A fourth value is generated based on the Falcon private key, the target message, and the third intermediate value.

[0022] In an optional implementation, after obtaining the mixed signature, the method further includes:

[0023] If the second value and the third value are both greater than 1 and less than the order of the elliptic curve, obtaining the message digest;

[0024] Determine a fifth value based on the message digest, the second value, the third value, the SM2 public key, and the base point of the elliptic curve;

[0025] Determining whether the fifth value is equal to the second value;

[0026] If the fifth value is equal to the second value, determining whether the hybrid signature is valid based on the pseudo-random number generation function, the second value, the fourth value, the target message, and the Falcon public key;

[0027] If the fifth value is not equal to the second value, it is determined that the hybrid signature is invalid.

[0028] In an optional implementation, the method further includes:

[0029] If the second value and the third value do not simultaneously satisfy the condition that they are greater than 1 and less than the order of the elliptic curve, it is determined that the hybrid signature is invalid.

[0030] In an optional implementation, determining whether the hybrid signature is valid based on the pseudo-random number generation function, the second value, the fourth value, the target message, and the Falcon public key includes:

[0031] Processing the second value by the pseudo-random number generation function to obtain a third intermediate value;

[0032] Based on the fourth value, the third intermediate value, the target message and the Falcon public key, it is determined whether the hybrid signature is valid.

[0033] The second aspect of the present application provides a hybrid signature generation device, including:

[0034] A message digest generation module is used to perform hash processing on the target message through a hash function to generate a message digest;

[0035] A first result calculation module, used to determine a second value and a third value based on a preset first value, a base point of an elliptic curve, an order of the elliptic curve, an SM2 private key and the message digest; the first value is an integer greater than 1 and less than the order of the elliptic curve;

[0036] A second result calculation module, used to determine a fourth value by using a pseudo-random number generation function, the second value, a Falcon private key and the target message;

[0037] The hybrid signature generation module is used to use the set consisting of the second value, the third value and the fourth value as a hybrid signature.

[0038] A third aspect of the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method introduced in any implementation manner of the first aspect.

[0039] A fourth aspect of the present application provides an electronic device, including:

[0040] a memory having a computer program stored thereon;

[0041] A processor is used to execute the computer program in the memory to implement the steps of the method introduced in any implementation manner of the first aspect.

[0042] Compared with the prior art, this application has the following beneficial effects:

[0043] The present application discloses a method for generating a hybrid signature, including: performing hash processing on a target message through a hash function to generate a message digest; determining a second value and a third value based on a preset first value, a base point of an elliptic curve, an order of an elliptic curve, an SM2 private key, and a message digest; determining a fourth value through a pseudo-random number generation function, a second value, a Falcon private key, and a target message; and using a set consisting of the second value, the third value, and the fourth value as a hybrid signature. The hybrid signature generated in the present application includes three parts, namely, the second value, the third value, and the fourth value. Compared with the hybrid signature generated by the traditional scheme, the length of the hybrid signature in the present application is shorter. Using the hybrid signature in the present application for large-scale signature verification can effectively save network bandwidth, significantly improve system performance, and optimize resource utilization. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0045] Figure 1 A flowchart of a method for generating a hybrid signature provided in an embodiment of the present application;

[0046] Figure 2 A flowchart for generating a second value and a third value provided in an embodiment of the present application;

[0047] Figure 3 A flowchart of a method for verifying a hybrid signature provided in an embodiment of the present application;

[0048] Figure 4A schematic diagram of the structure of a hybrid signature generation device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0049] The rapid development of quantum computing has brought major security risks to the field of information security technology. For example, quantum computers that can run Shor's algorithm will pose a comprehensive threat to signature algorithms such as RSA and SM2. Taking the SM2 signature algorithm as an example, once a practical quantum computer has the ability to crack the SM2 signature, it may cause large-scale chaos and turmoil in the market.

[0050] To prevent the above problems, simple quantum-resistant hybrid signatures are usually used to enhance security. For example, for message M, assuming that the public-private key pair of SM2 is (PK sm2 , S.K. sm2 ), public-private key pair (PK Q , S.K. Q ). The current method of generating a hybrid signature is to first use SK sm2 Sign the message M and generate the signature result (r, S sm2 );Then use SK Q Sign the message M and generate the signature result of the quantum-resistant signature algorithm (r Q ,s Q ); finally, {(r, S sm2 ), (r Q ,s Q )} as the signature result of the mixed signature. In the process of verifying the signature, PK sm2 The signature result of SM2 algorithm (r, S sm2 ) to verify the signature; then use PK Q The signature result of the anti-quantum signature algorithm (r Q ,s Q ) to perform signature verification. Only when both signature results pass, the overall signature verification is considered to pass.

[0051] The hybrid signature generated by the traditional solution is relatively long. During busy business periods such as Double Eleven, a very large network bandwidth is required to perform hundreds of millions of signature verification operations in a short period of time. If the length of the hybrid signature can be shortened, it will effectively save network bandwidth, thereby significantly improving system performance and optimizing resource utilization.

[0052] The present application discloses a method for generating a hybrid signature, including: performing hash processing on a target message through a hash function to generate a message digest; determining a second value and a third value based on a preset first value, a base point of an elliptic curve, an order of an elliptic curve, an SM2 private key, and a message digest; determining a fourth value through a pseudo-random number generation function, a second value, a Falcon private key, and a target message; and using a set consisting of the second value, the third value, and the fourth value as a hybrid signature. The hybrid signature generated in the present application includes three parts, namely, the second value, the third value, and the fourth value. Compared with the hybrid signature generated by the traditional scheme, the length of the hybrid signature in the present application is shorter. Using the hybrid signature in the present application for large-scale signature verification can effectively save network bandwidth, significantly improve system performance, and optimize resource utilization.

[0053] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0054] Figure 1 A flow chart of a method for generating a hybrid signature provided in an embodiment of the present application. Figure 1 As shown, the method for generating a hybrid signature disclosed in the present application includes:

[0055] S101, performing hash processing on the target message through a hash function to generate a message digest.

[0056] A hash function is a function that maps input data of any size (such as strings, numbers, etc.) to an output of a fixed size (usually an integer).

[0057] In the present application, after determining the target message (denoted as M), the target message can be hashed using a hash function to generate a message digest; that is, e=H(M); wherein H() represents the hash function, and e represents the message digest.

[0058] S102, determining a second value and a third value based on a preset first value, a base point of an elliptic curve, an order of the elliptic curve, an SM2 private key and the message digest.

[0059] For ease of understanding, in this application, the first value is denoted as k, the order of the elliptic curve is denoted as n, the base point of the elliptic curve is denoted as G, and the SM2 private key is denoted as SK sm2 , the second value is denoted as r and the third value is denoted as S sm2 .

[0060] The first numerical value in the present application is an integer greater than 1 and less than the order of the elliptic curve, that is, 1<k<n.

[0061] Figure 2 A flowchart for generating a second value and a third value is provided in an embodiment of the present application.

[0062] Combination Figure 2 As shown, the process of generating the second value and the third value in the present application is specifically as follows:

[0063] S201, determining a preset first value.

[0064] As described in the above embodiment, the present application randomly selects a number greater than 1 and less than n as the preset first value, where n is the order of the elliptic curve.

[0065] S202: Determine a first intermediate value based on the first value and a base point of the elliptic curve.

[0066] Specifically, the first value k is multiplied by the base point G of the elliptic curve to obtain R, that is, R=k×G; the coordinate of R is marked as the first intermediate value. In this application, the first intermediate value is denoted as r 中 .

[0067] S203: Determine whether the first intermediate value is zero.

[0068] If the first intermediate value is zero, the process returns to S201 ; if the first intermediate value is not zero, the process proceeds to S204 .

[0069] S204: Determine a second intermediate value based on the first intermediate value, the SM2 private key, the first value, the message digest, and the order of the elliptic curve.

[0070] Substitute the first intermediate value, the SM2 private key, the first value, the message digest and the order of the elliptic curve into formula (1) to obtain the second intermediate value. Formula (1) is expressed as:

[0071] t 中 = r 中 ×SK sm2 + k^(-1)×(e mod n) Formula (1)

[0072] r in formula (1) 中 is the first intermediate value, SK sm2 is the SM2 private key, k is the first value, e is the message digest, n is the order of the elliptic curve, t 中is the second intermediate value. In formula (1), "mod" is the abbreviation of Modulo Operation; Modulo Operation is used to calculate the remainder after dividing two integers.

[0073] S205: Determine whether the second intermediate value is zero.

[0074] If the second intermediate value t 中 is zero, then return to S201; if the second intermediate value t 中 If it is not zero, the process proceeds to S206.

[0075] S206: Determine the first intermediate value as the second value, and determine the third value based on the second intermediate value, the message digest, and the order of the elliptic curve.

[0076] At the second intermediate value t 中 When it is not zero, the first intermediate value r 中 As the second value r; and substitute the second intermediate value, the message digest and the order of the elliptic curve into formula (2) to generate the third value. Formula (2) is expressed as:

[0077] S sm2 = t 中 ^(-1)*×(e mod n) Formula (2)

[0078] Among them, S in formula (2) sm2 is the third value, t 中 is the second intermediate value, e is the message digest, and n is the order of the elliptic curve.

[0079] It can be understood that when the first intermediate value r 中 or the second intermediate value t 中 When it is zero, the process returns to S201, selects a new first value, and uses the newly selected first value as the preset first value, and determines the second value and the third value according to the method shown in S201-S206.

[0080] S103, determining a fourth value by using a pseudo-random number generation function, the second value, a Falcon private key and the target message.

[0081] First, the second value is processed by a pseudo-random number generation function to generate a third intermediate value r Q ; That is r Q =Hp(r); wherein Hp() is a pseudo-random generation function and r is a second value.

[0082] Then, a fourth value is generated based on the Falcon private key, the target message and the third intermediate value.

[0083] That is, use the Falcon private key (referred to as SK in this application) Q ), target message M and third intermediate value r Q , perform quantum-resistant FOCLCON signature calculation to generate a fourth value (denoted as s in this application) Q ).

[0084] It should be noted that due to the use of Falcon private key, target message M and the third intermediate value r Q , performing quantum-resistant FOCLCON signature calculation is well known to those skilled in the art and will not be elaborated in this application.

[0085] S104: Use a set consisting of the second value, the third value, and the fourth value as a mixed signature.

[0086] The second value in this application is r, and the third value is S sm2 and the fourth value is s Q ; In this application, (r, S sm2 ,s Q ) as a mixed signature.

[0087] The traditional solution is to convert {(r, S sm2 ), (r Q ,s Q )} as a mixed signature; in this application, (r, S sm2 ,s Q ) as a hybrid signature. Compared with the hybrid signature generated by the traditional scheme, the hybrid signature generated by the method in this application reduces r Q The length of the hybrid signature in the present application is shorter. Taking the FALCON-512 algorithm as an example, the total length of the hybrid signature generated in the traditional solution is 666+64=730 bytes, and the length of the hybrid signature generated by the present invention is 690 bytes, and the signature length is reduced by 5.4%. If the FALCON-512 algorithm is replaced by the FALCON-1024 algorithm, the signature length of the present invention is reduced by 2.98%.

[0088] Compared with the hybrid signature generation method of the traditional scheme, that is, the simple combination of two signatures, the hybrid signature generation method disclosed in the present application reduces one step of random number generation process and adds one step of pseudo-random number generation process. Since the time overhead of the pseudo-random number generation process is very small compared with other steps in the signature, that is, the generation time of the pseudo-random number is less than the generation time of the random number, the method disclosed in the present application is more efficient than the hybrid signature generation method in the traditional scheme.

[0089] Furthermore, the present application also discloses a method for verifying the hybrid signature generated in the present application. Figure 3 A flow chart of a method for verifying a hybrid signature provided in an embodiment of the present application. Figure 3 As shown, the method for verifying the hybrid signature in this application includes:

[0090] S301, obtaining a hybrid signature generated using the method in this application.

[0091] That is, obtain (r, S sm2 ,s Q ), where r is the second value, S sm2 is the third value, s Q is the fourth value.

[0092] S302: Determine whether the second value and the third value are both greater than 1 and less than the order of the elliptic curve.

[0093] That is, judge r and S sm2 Are they both greater than 1 and less than n?

[0094] If r and S sm2 are both greater than 1 and less than n, then proceed to S303; if r and S sm2 If any number in is outside the range of 1 to n, the process proceeds to S306.

[0095] S303: Determine a fifth value based on the message digest, the second value, the third value, the SM2 public key and the base point of the elliptic curve.

[0096] First, the message digest, the third value and the base point of the elliptic curve are substituted into formula (3) to obtain the value of the first intermediate parameter. The expression of formula (3) is:

[0097] v = e ×((S sm2 ^-1 )mod n) Formula (3)

[0098] In formula (3), v is the value of the first intermediate parameter, e is the message digest, S sm2 is the third value and n is the order of the elliptic curve.

[0099] Then, the value of the first intermediate parameter, the second value and the order of the elliptic curve are substituted into formula (4) to obtain the value of the second intermediate parameter. The expression of formula (4) is:

[0100] z = r × (v mod n) Formula (4)

[0101] In formula (4), z is the value of the second intermediate parameter, v is the value of the first intermediate parameter, and n is the order of the elliptic curve.

[0102] Finally, the value of the second intermediate parameter, the SM2 public key, the value of the first intermediate parameter and the base point of the elliptic curve are substituted into formula (5) to obtain the fifth value. The expression of formula (5) is:

[0103] W1 = z × PK sm2 + v ×G Formula (5)

[0104] In formula (5), W1 is the fifth value, z is the value of the second intermediate parameter, PK sm2 is the SM2 public key, v is the value of the first intermediate parameter, and G is the base point of the elliptic curve.

[0105] S304: Determine whether the fifth value is equal to the second value.

[0106] If the fifth value W1 is equal to the second value r, the process proceeds to S305 ; if the fifth value W1 is not equal to the second value r, the process proceeds to S306 .

[0107] S305: Determine whether the hybrid signature is valid based on the pseudo-random number generation function, the second value, the fourth value, the target message and the Falcon public key.

[0108] First, the second value is processed by a pseudo-random number generation function to generate a third intermediate value r Q . That is r Q =Hp(r); wherein Hp() is a pseudo-random generation function and r is a second value.

[0109] Then, based on the fourth value, the third intermediate value, the target message and the Falcon public key, it is determined whether the hybrid signature is valid.

[0110] Call the signature verification process of the Falcon (Fast-Fourier Lattice-Based Compact Signature over NTRU) algorithm and enter the third intermediate value r Q and the fourth value s Q , Public key PK of quantum-resistant signature algorithm Q , target message M, algorithm parameter β, obtain the signature verification result, whether it passed the verification (valid) or failed the verification (invalid).

[0111] S306: Determine that the hybrid signature is invalid.

[0112] It can be understood that since the hybrid signature generated by the method in this application is shorter, using the hybrid signature in this application for large-scale signature verification can effectively save network bandwidth, significantly improve system performance and optimize resource utilization.

[0113] Based on the hybrid signature generation method provided in the aforementioned embodiment, the present application also discloses a hybrid signature generation device. Figure 4 A schematic diagram of the structure of a hybrid signature generation device provided in an embodiment of the present application. Figure 4 As shown, the present application discloses a hybrid signature generation device 400, comprising:

[0114] The message digest generation module 401 is used to perform hash processing on the target message through a hash function to generate a message digest;

[0115] A first result calculation module 402 is used to determine a second value and a third value based on a preset first value, a base point of an elliptic curve, an order of the elliptic curve, an SM2 private key and the message digest; the first value is an integer greater than 1 and less than the order of the elliptic curve;

[0116] A second result calculation module 403 is used to determine a fourth value by using a pseudo-random number generation function, the second value, a Falcon private key and the target message;

[0117] The mixed signature generating module 404 is configured to use a set consisting of the second value, the third value and the fourth value as a mixed signature.

[0118] In an optional implementation, the first result calculation module 402 includes:

[0119] A first intermediate value determining unit, configured to determine a first intermediate value based on the first value and a base point of the elliptic curve;

[0120] a second intermediate value determining unit, configured to determine a second intermediate value based on the first intermediate value, the SM2 private key, the first value, the message digest, and the order of the elliptic curve if the first intermediate value is not zero;

[0121] The third value determining unit is configured to determine the first intermediate value as the second value if the second intermediate value is not zero, and determine the third value based on the second intermediate value, the message digest and the order of the elliptic curve.

[0122] In an optional implementation, the hybrid signature generation device 400 further includes:

[0123] A value updating module, for returning to the step of determining the preset first value and reselecting a new first value if the first intermediate value is zero or the second intermediate value is zero; and determining the second value and the third value based on the reselected first value, the base point of the elliptic curve, the order of the elliptic curve, the SM2 private key and the message digest.

[0124] In an optional implementation, the second result calculation module 403 includes:

[0125] A third intermediate value determining unit, configured to process the second value by using a pseudo-random number generating function to generate a third intermediate value;

[0126] A fourth value generating unit is used to generate a fourth value based on the Falcon private key, the target message and the third intermediate value.

[0127] In an optional implementation, the hybrid signature generation device 400 further includes:

[0128] A first judgment module, configured to obtain the message digest if the second value and the third value are both greater than 1 and less than the order of the elliptic curve;

[0129] a fifth value determination module, configured to determine a fifth value based on the message digest, the second value, the third value, the SM2 public key, and a base point of the elliptic curve;

[0130] A second judging module, used for judging whether the fifth value is equal to the second value;

[0131] a first result determination module, configured to determine whether the hybrid signature is valid based on the pseudo-random number generation function, the second value, the fourth value, the target message, and the Falcon public key if the fifth value is equal to the second value;

[0132] The second result determination module is configured to determine that the hybrid signature is invalid if the fifth value is not equal to the second value.

[0133] In an optional implementation, the hybrid signature generation device 400 further includes:

[0134] The third result determination module is used to determine that the hybrid signature is invalid if the second value and the third value do not simultaneously satisfy the condition that the second value is greater than 1 and less than the order of the elliptic curve.

[0135] In an optional implementation, the first result determination module includes:

[0136] A third intermediate value obtaining unit, configured to process the second value by using the pseudo-random number generating function to obtain a third intermediate value;

[0137] The first result determination unit is used to determine whether the hybrid signature is valid based on the fourth value, the third intermediate value, the target message and the Falcon public key.

[0138] Based on the hybrid signature generation method and device provided in the aforementioned embodiments, the present application also provides a computer-readable storage medium, on which a computer program is stored, which, when executed by a processor, implements some or all of the steps in the hybrid signature generation method mentioned above.

[0139] Based on the hybrid signature generation method and device provided in the above embodiments, the present application further provides an electronic device, including:

[0140] a memory having a computer program stored thereon;

[0141] The processor is used to execute the computer program in the memory to implement part or all of the steps in the method for generating a hybrid signature provided in the above embodiment.

[0142] It should be noted that each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. The device embodiment described above is merely schematic, in which the unit described as a separate component may or may not be physically separated, and the component prompted as a unit may or may not be a physical unit, that is, it may be located in one place, or it may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative work.

[0143] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A method for generating a hybrid signature, characterized in that: The method comprises: The target message is hashed by a hash function to generate a message digest; Determine a second value and a third value based on a preset first value, a base point of an elliptic curve, an order of the elliptic curve, an SM2 private key, and the message digest; the first value is an integer greater than 1 and less than the order of the elliptic curve; Determine a fourth value by using a pseudo-random number generation function, the second value, a Falcon private key, and the target message; A set consisting of the second value, the third value and the fourth value is used as a mixed signature.

2. The method according to claim 1, characterized in that The determining the second value and the third value based on the preset first value, the base point of the elliptic curve, the order of the elliptic curve, the SM2 private key and the message digest includes: Determining a first intermediate value based on the first value and a base point of the elliptic curve; If the first intermediate value is not zero, determining a second intermediate value based on the first intermediate value, the SM2 private key, the first value, the message digest, and the order of the elliptic curve; If the second intermediate value is not zero, the first intermediate value is determined as the second value, and the third value is determined based on the second intermediate value, the message digest, and the order of the elliptic curve.

3. The method according to claim 2, characterized in that The method further comprises: If the first intermediate value is zero or the second intermediate value is zero, returning to the step of determining the preset first value and reselecting a new first value; The determining of the second value and the third value based on the first value, the base point of the elliptic curve, the order of the elliptic curve, the SM2 private key and the message digest is specifically: The second value and the third value are determined based on the reselected first value, the base point of the elliptic curve, the order of the elliptic curve, the SM2 private key and the message digest.

4. The method according to claim 1, characterized in that The step of determining a fourth value by using a pseudo-random number generation function, the second value, a Falcon private key, and the target message includes: Processing the second value by using a pseudo-random number generation function to generate a third intermediate value; A fourth value is generated based on the Falcon private key, the target message, and the third intermediate value.

5. The method according to any one of claims 1 to 4, characterized in that After obtaining the mixed signature, the method further includes: If the second value and the third value are both greater than 1 and less than the order of the elliptic curve, obtaining the message digest; Determine a fifth value based on the message digest, the second value, the third value, the SM2 public key, and the base point of the elliptic curve; Determining whether the fifth value is equal to the second value; If the fifth value is equal to the second value, determining whether the hybrid signature is valid based on the pseudo-random number generation function, the second value, the fourth value, the target message, and the Falcon public key; If the fifth value is not equal to the second value, it is determined that the hybrid signature is invalid.

6. The method according to claim 5, characterized in that The method further comprises: If the second value and the third value do not simultaneously satisfy the condition that they are greater than 1 and less than the order of the elliptic curve, it is determined that the hybrid signature is invalid.

7. The method according to claim 5, characterized in that The determining whether the hybrid signature is valid based on the pseudo-random number generation function, the second value, the fourth value, the target message, and the Falcon public key includes: Processing the second value by the pseudo-random number generation function to obtain a third intermediate value; Based on the fourth value, the third intermediate value, the target message and the Falcon public key, it is determined whether the hybrid signature is valid.

8. A hybrid signature generation device, characterized in that: The device comprises: A message digest generation module is used to perform hash processing on the target message through a hash function to generate a message digest; A first result calculation module, used to determine a second value and a third value based on a preset first value, a base point of an elliptic curve, an order of the elliptic curve, an SM2 private key and the message digest; the first value is an integer greater than 1 and less than the order of the elliptic curve; A second result calculation module, used to determine a fourth value by using a pseudo-random number generation function, the second value, a Falcon private key and the target message; The hybrid signature generation module is used to use the set consisting of the second value, the third value and the fourth value as a hybrid signature.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method described in any one of claims 1 to 7 are implemented.

10. An electronic device, characterized in that: include: a memory having a computer program stored thereon; A processor, configured to execute the computer program in the memory to implement the steps of the method according to any one of claims 1 to 7.