Post-quantum digital signature key generation method based on avx2 acceleration and matrix multiplication optimization

Through the strategies of AVX2 acceleration and matrix multiplication optimization, the computational efficiency and signature speed of the HuFu algorithm are improved, solving the problems of insufficient computational speed and efficiency of existing algorithms in post-quantum digital signatures, and is suitable for the efficient implementation of post-quantum cryptography.

CN119561684BActive Publication Date: 2025-10-24NANJING UNIV OF AERONAUTICS & ASTRONAUTICS
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411700102.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-26
Publication Date
2025-10-24
Estimated Expiration
2044-11-26

AI Technical Summary

Technical Problem

The existing HuFu algorithm lacks computational speed and efficiency in post-quantum digital signatures, resulting in a slow signing process that is difficult to meet the needs of large-scale communication protocols.

Method used

Adopting a strategy based on AVX2 acceleration and matrix multiplication optimization, an efficient post-quantum digital signature key generation mechanism is designed by optimizing encoding, matrix operations, and memory access operations, including matrix decomposition and register optimization techniques to reduce memory access frequency.

Benefits of technology

It significantly improves the key generation and signing speed, reduces computing overhead and energy consumption, improves computing efficiency and parallelization, and is suitable for practical applications in complex network environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119561684B_ABST
    Figure CN119561684B_ABST
Patent Text Reader

Abstract

The application discloses a post-quantum digital signature key generation method based on AVX2 acceleration and matrix multiplication optimization, and comprises the following contents: on the basis of original coding, the parallelization optimization of signature compression and decompression process is realized by using the AVX2 instruction set, the efficiency of coding and decoding is significantly improved, and the method is particularly suitable for large-scale data processing scenes.A matrix multiplication optimization method for the algorithm is proposed, by only performing once matrix blocking, the recursive operation is avoided.Combined with the register optimization technology, the memory access is effectively reduced while the calculation accuracy is ensured, and the calculation efficiency in the signature generation process is significantly improved.The register optimization strategy is introduced in the matrix multiplication and addition operation, the calculation result is saved in the register as much as possible by reducing the memory access operation, so that the number of writing back to the memory is reduced, and the execution efficiency of the matrix operation is further improved, and the method has important significance for the efficient implementation of the post-quantum digital signature scheme.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the field of cryptography, and particularly relates to a post-quantum digital signature key generation method based on AVX2 acceleration and matrix multiplication optimization. BACKGROUND

[0002] With the rapid development of quantum computing technology, traditional encryption standards are facing severe challenges, which forces the cryptography community to re-examine existing secure communication protocols. This threat has prompted in-depth research on post-quantum cryptographic algorithms, aiming to ensure that data transmission remains secure and reliable in the quantum era. Therefore, post-quantum cryptography has become a global research hotspot, and numerous new encryption algorithms have emerged to cope with the cracking power brought by quantum computing.

[0003] In this context, the HuFu algorithm, as a new type of post-quantum digital signature scheme, relies on the computational difficulty of general lattice problems (such as SIS and LWE), uses the lattice trapdoor framework and compact tool technology, and provides a high-security and efficient signature mechanism. However, although the HuFu algorithm has advantages in security and basic efficiency, in actual application, especially in large-scale communication protocols, its operation speed and efficiency still have deficiencies, resulting in a slow overall signature process rate. SUMMARY

[0004] The purpose of the present application is to provide a post-quantum digital signature key generation method based on AVX2 acceleration and matrix multiplication optimization. By optimizing encoding, matrix operations, and memory access operations, an efficient post-quantum digital signature key generation batch processing mechanism is provided to solve the problems of large computational overhead and low efficiency of existing algorithms.

[0005] Technical solution: A post-quantum digital signature key generation method based on AVX2 acceleration and matrix multiplication optimization of the present application comprises the following steps:

[0006] Step 1, generating a post-quantum digital signature algorithm key based on the HuFu algorithm:

[0007] Input: None;

[0008] Calculating the seed Generate a 256-bit random seed from a uniformly distributed random number generator as input for subsequent steps;

[0009] Calculating the extended output Generate a pseudo-random output based on the seed using the extended output function XOF;

[0010] Generating a structure matrix S and an error matrix E: generating an n x m structure matrix S and an m x m error matrix E from two independent distributions, both of which are random matrices;

[0011] Calculating the matrix ∑p : Solve the (n+2m)x(n+2m) identity matrix, combine the error matrix and the structure matrix to obtain the required matrix ∑ p ;

[0012] Judgment condition: Repeat the steps until ∑ p Each element is greater than a set threshold

[0013] Construct the reference matrix B: Multiply the scalar by the identity matrix, subtract the linear combination, and perform the modulo operation to limit the matrix element value;

[0014] Perform matrix decomposition: decompose the large matrix into multiple small block matrices; Perform matrix decomposition: generate multiple small block matrices L 33 , L 32 , L 31 , L 22 , L 21 , L 11 ;

[0015] Output public and private key pairs: generate public key pk and private key sk; sk=(E,S,L 22 , L 32 , L 33 );

[0016] Step 2, generate post-quantum digital signature algorithm signature based on HuFu algorithm:

[0017] Input: message m, private key sk, acceptance boundary B;

[0018] Initialization and matrix generation

[0019] Calculate the sampling vector p: according to the private key sk, sample the generated vector p from the pre-defined probability distribution;

[0020] Calculate c: perform modulo Q operation on the product of matrix A and vector p to generate the final vector c;

[0021] Calculate random salt salt and hash value u: generate a 320-bit random salt value, and calculate the hash value u through the hash function;

[0022] Calculate the intermediate value v: v <- u-c mod Q; perform modulo Q operation to get the intermediate result;

[0023] Calculate the error e and the quotient v': calculate the error e and the quotient v';

[0024] Calculate the vector z i : generate the final result z through the sampling function SampleZdi ;

[0025] Perform matrix operations to get vectors x0, x1, x2: Perform linear transformation of matrix and vector; x0←Ez+p0, x1←Sz+p1, x2←z+p2;

[0026] Check the boundary: ensure that the vector norm is within the set range, otherwise restart the process; judgment criteria: ∥(x0+e, x1, x2)∥>B;

[0027] Compress the vector (x1, x2) to get str: compress the signature by the Compress_sig function and check the validity;

[0028] Output: generate and output the compressed signature s; s=(salt, str);

[0029] Step 3, verify the post-quantum digital signature algorithm signature based on HuFu algorithm:

[0030] Input: message m, signature (salt, str), public key pk and acceptable boundary B;

[0031] Restore matrix

[0032] Check the length of the signature: verify whether the length of the decompressed signature meets the predetermined value;

[0033] Signature decompression: restore the original signature (x1, x2) by the Decompress_sig function;

[0034] Calculate the signature vector: perform linear operation and modulus operation; x0′ is the final generated value;

[0035] Output: ∥(x0', x1, x2)∥≤B, according to the norm check result to decide to accept or reject the signature.

[0036] Further, step 1 specifically includes the following steps:

[0037] Step 1.1, input: none;

[0038] Step 1.2, calculate the seed: Generate a 256-bit random seed from a uniformly distributed random number generator U U({0,1} 256 ) represents generating a random 256-bit bit sequence, each bit is uniformly distributed between 0 and 1; this seed As the input of the next step;

[0039] Step 1.3, calculate the extended output generation: The formula represents the generation of a pseudo-random output using an extended output function XOF, given a seed XOF is a variable length hash function based on SHAKE256 that can generate outputs of arbitrary length on demand, here is the input seed to the XOF function, used to produce more pseudo-random data;

[0040] Step 1.4, Compute the repeated generation of the structure matrix S and the error matrix E: (S, E) <- χ n×m χ m×m Two matrices S and E are generated from two independent distributions χ; χ n×m represents an n x m matrix sampled from the distribution χ, χ m×m represents another m x m matrix generated from the same distribution χ; finally, the matrices S and E are two random matrices sampled from this distribution;

[0041] Step 1.5, Compute the repeated matrix ∑ p : Here I n+2m is an (n+2m) x (n+2m) identity matrix, I m represents the transpose of the identity matrix, E t represents the transpose of the error matrix E, S t represents the transpose of the structure matrix S; r 2 is a scalar multiplier, σ 2 is the variance;

[0042] Step 1.6, Check the condition Continue repeating the above steps until each element in ∑ p is greater than the threshold value

[0043] Step 1.7, Compute the matrix B: Multiply the scalar P by the identity matrix I to construct a scaled reference matrix; then, subtract the linear combination from this matrix, where is the public matrix, S is the structure matrix, and E is the error matrix; this result is then operated modulo Q to limit the matrix element values within a certain range; modulo Q means that each element of the result is operated modulo Q to limit the value within a certain fixed range Q;

[0044] Step 1.8, Perform matrix decomposition on the matrix Generate multiple small block matrices L 33 , L 32 , L 31 , L 22 , L 21L 11

[0045]

[0046] Step 1.9, output public-private key pair: public key p k , private key s k ; sk = (E, S, L 22 , L 32 , L 33 ).

[0047] Further, in step 1.5, the matrix ∑ p is calculated as follows: first, the initial matrix is multiplied by the scaling factor r 2 ; the variance σ

[0048] The variance σ 2 is a common variance term, representing the degree of dispersion or uncertainty of each variable; the variance σ 2 is multiplied by the identity matrix I n+2m , which assigns a fixed variance σ 2 to each element on the diagonal.

[0049] Further, step 2 specifically includes the following steps:

[0050] Step 2.1, input: message m, private key sk, acceptance boundary B;

[0051] Step 2.2, offline phase:

[0052] Initialization and matrix generation

[0053] Step 2.3, calculate the sampling vector p: p = (p0, p1, p2) <- SampleP(sk), generate vector p from the pre-defined SampleP probability distribution according to the private key sk, where p0 ∈ Z m , p1 ∈ Z n , p2 ∈ Z m ; p0 is an integer vector of length m, each element from the integer ring Z; p1 is an integer vector of length n, each element also from the integer ring Z; p2 is another integer vector of length m, with the same form as p0;

[0054] Step 2.4. Calculate c: c←Ap mod Q. c: This is the final vector or matrix generated, representing the result obtained through the specific calculation. A: This is a public matrix that participates in the operation to generate the result c. p is the previously generated vector p, composed of (p0, p1, p2), which participates in the operation of matrix A. Ap: This is the product of matrix A and vector p, representing the linear transformation between the matrix and the vector. modQ: This represents the modulo Q operation on each element of the result Ap, limiting the value to a fixed range Q.

[0055] Step 2.5, online stage:

[0056] Calculate random salt and hash value: salt←U({0,1} 320 ), generate a 320-bit random salt value; u←

[0057] H(m, salt), uses the message m and the salt value salt to calculate u through the hash function H;

[0058] Step 2.6. Calculate the intermediate value v: v←uc mod Q; perform the operation modulo Q on the result of uc;

[0059] Step 2.7. Calculate the error and quotient: e←(v mod p). After calculating the error e, find the quotient v': v'←(ve) / p.

[0060] Step 2.8. Calculate vector z i :z i ←q·SampleZ d (v i ' / q), from the distribution D q·Im+v',r2 Sampling to get z i ; Using the input value vi' / q as a parameter, through the sampling function SampleZ d From the distribution Z d Get a sample from ; then, multiply the sampling result by the scaling factor q to get the final z i ; Z d Usually refers to a discrete uniform distribution, defined on the set of integers, representing integers uniformly sampled in the range [-d / 2, d / 2];

[0061] Step 2.9. Calculate the vectors x0, x1, and x2: x0←Ez+p0, x1←Sz+p1, and x2←z+p2. Ez and Sz represent linear transformations between matrices and vectors.

[0062] Step 2.10. Check the bounds: If ∥(x0+e,x1,x2)∥>B, restart the process. e is an error term used to introduce randomness or noise into encryption or signature algorithms. x0 is the first component of the vector, x1 and x2 are the second and third components of the vector. B is a preset threshold, indicating the maximum allowable value of the norm.

[0063] Step 2.11. Compress vector x1, x2: str←Compress((x1, x2)); compress the signature (x1, x2) using the Compress_sig() function to obtain str; if str is an invalid value (⊥), restart the process;

[0064] Step 2.12, Output: Output the compressed signature s, s = (salt, str).

[0065] Furthermore, step 3 specifically includes the following steps:

[0066] Step 5.1. Input: message m, signature (salt, str), public key pk, and acceptance boundary B.

[0067] Step 5.2: Restore the matrix

[0068] Step 5.3, check the signature length: Check whether the length of the decompressed signature string str is equal to the predetermined length L; if not, it indicates that the signature is at risk of being tampered with or incorrect, and the signature is rejected;

[0069] Step 5.4, signature decompression: (x1,x2)←Decompress(str), x1∈Z n , x2∈Z m , decompress the signature (x1, x2) through the Decompress_sig() function; x1 is an integer vector of length n, each element of which comes from the integer ring Z; x2 is an integer vector of length m, each element of which also comes from the integer ring Z;

[0070] Step 5.5, calculate the signature vector: u←H(m,salt), x0′ is the final generated value, which represents the result obtained by performing a linear operation on u modulo Q; Representation matrix The product of matrix B and vector x1 is used in encryption or signing, which is a linear transformation. Bx2 represents the product of matrix B and vector x2, which is also part of the linear transformation. ModQ represents the modulo Q operation on the previous result.

[0071] Step 5.6, output: Accept or Reject; if ||(x0', x1, x2)|| ≤ B, ≤ B means Accept or > B means Reject.

[0072] The application also discloses a computer device comprising a memory, a processor and a computer program stored in the memory, wherein the processor executes the computer program to realize the steps of the method.

[0073] The application also discloses a computer readable storage medium, wherein a computer program / instruction is stored on the computer readable storage medium, and the computer program / instruction is executed by a processor to realize the steps of the method.

[0074] The application also discloses a computer program product, comprising a computer program / instruction, wherein the computer program / instruction is executed by a processor to realize the steps of the method.

[0075] Advantages: Compared with the prior art, the application has the following remarkable advantages:

[0076] Through design and optimization, the HuFu algorithm adopts optimized encoding and matrix operation strategies to improve overall operation efficiency. By introducing the AVX2 instruction set to accelerate the encoding process and combining a new matrix multiplication optimization method, the HuFu algorithm effectively reduces the computational overhead in the signature calculation process. This efficient signature mechanism not only significantly improves the speed of key generation and signature, but also further reduces the bottleneck of memory access operation through a register-based memory optimization strategy, thereby achieving higher parallelization and computational efficiency. This series of optimizations ensure that HuFu has reliability and security in post-quantum communication protocols, meeting the practical application requirements in complex network environments.

[0077] Secondly, a matrix multiplication optimization scheme for the original algorithm is proposed, which adopts one-time matrix blocking to avoid recursive operations. Combined with the register optimization technique, the memory access is reduced while the accuracy of calculation is ensured, greatly improving the efficiency of matrix operations in the signature generation process.

[0078] In addition, a register optimization strategy is introduced in the matrix multiplication and addition operations to save the calculation results in the register as much as possible and reduce the frequency of writing back to the memory. This strategy further optimizes the execution efficiency of matrix operations, especially suitable for efficient implementation of post-quantum digital signature schemes. Through these optimization measures, the HuFu algorithm shows great potential in processing large-scale data, not only speeding up the calculation, but also reducing the energy consumption of the system and improving the response speed, showing its important practical value in the field of post-quantum cryptography. BRIEF DESCRIPTION OF DRAWINGS

[0079] Figure 1To generate a post-quantum digital signature algorithm key graph based on the HuFu algorithm.

[0080] Figure 2 To generate a post-quantum digital signature algorithm signature based on the HuFu algorithm.

[0081] Figure 3 To verify the post-quantum digital signature algorithm signature based on the HuFu algorithm DETAILED DESCRIPTION

[0082] The technical solutions of the application will be further described below with reference to the drawings.

[0083] The application provides a post-quantum digital signature operation and matrix multiplication optimization mechanism based on AVX2 acceleration. Figure 1 As shown in the figure, the scheme involves the following:

[0084] I. The HuFu post-quantum digital signature algorithm key generation process is as follows:

[0085] (1) Input: None

[0086] (2) Calculate the seed: From a uniformly distributed random number generator U, generate a 256-bit random seed U({0,1} 256 ) represents generating a random 256-bit bit sequence, each bit is uniformly distributed between 0 and 1. This seed will be used as the input for the next step.

[0087] (3) Calculate the extended output generation: The formula represents using the extended output function (XOF) to generate a pseudo-random output through the given seed XOF is a variable-length hash function based on SHAKE256, which can generate an output of any length according to the demand, where is the input seed of the XOF function, used to generate more pseudo-random data.

[0088] (4) Calculate the repeated generation of structure matrix S and error matrix E: (S, E) <- χ n×m χ m×m Generate two matrices S and E from two independent distributions χ. Specifically, χ n×m represents an n x m matrix generated from the distribution χ, and χ m×m represents another m x m matrix generated from the same distribution χ. Finally, matrices S and E are two random matrices sampled according to this distribution.

[0089] (5) Calculate the repetition ∑ p : Here I n+2m is a (n+2m)x(n+2m) identity matrix, I m denotes the transpose of the identity matrix, remains unchanged, E t denotes the transpose of the error matrix E, S t denotes the transpose of the structure matrix S. r 2 is a scalar multiplier. This is the process of calculating the matrix ∑ p . First, multiply the matrix product 2 by the scaling factor r Then subtract this result from an initial matrix obtained by multiplying the variance σ 2 by the identity matrix I n+2m . The variance σ 2 is a common variance term, which can be understood as the degree of dispersion or uncertainty of each variable. It is multiplied by the identity matrix I n+2m , which means that each element on the diagonal is assigned a fixed variance σ 2 .

[0090] (6) Judgment condition Continue to repeat the above steps until each element in ∑ p is greater than a certain threshold r 2 .

[0091] (7) Calculate matrix B: Multiply the scalar P by the identity matrix I to construct a scaled reference matrix. Then, subtract the linear combination from this matrix, where is the public matrix, S is the structure matrix, and E is the error matrix. This result is then operated by the modulo Q operation to limit the matrix element value within a certain range. Modulo Q means that each element of the result is operated by modulo Q to limit the value within a certain fixed range Q. This formula is often used in encryption or signature schemes to generate a certain specific matrix result B.

[0092] (8) Perform matrix decomposition on matrix : generate multiple small block matrices L 33 , L 32 , L 31 , L 22 , L 21 , L 11 .

[0093] (9) Output public and private key pairs: public key p k , private key s k . sk = (E, S, L22 ,L 32 ,L 33 )。

[0094] II. The HuFu post-quantum digital signature algorithm signature generation process is as follows:

[0095] (1) Input: message m, private key sk, acceptance boundary B.

[0096] Offline stage:

[0097] (2) Initialization and matrix generation The same as the previous formula explanation.

[0098] (3) Calculate the sampling vector p: p = (p0, p1, p2) <- SampleP(sk), according to the private key sk, sample the generated vector p from the pre-defined SampleP probability distribution, where p0∈Z m , p1∈Z n , p2∈Z m . p0 is an integer vector of length m, each element comes from the integer ring Z; p1 is an integer vector of length n, each element also comes from the integer ring Z; p2 is another integer vector of length m, which is the same as p0.

[0099] (4) Calculate c: c <- Ap mod Q. c: this is the final generated vector or matrix, representing the result obtained by a certain calculation. A: this is a matrix, usually public, involved in the operation to generate the result c. p is the previously generated vector p, composed of (p0, p1, p2), involved in the operation of matrix A. Ap: this is the product of matrix A and vector p, representing the linear transformation of matrix and vector. mod Q: means that each element of the result Ap is operated by mod Q, limiting the value within a certain fixed range Q.

[0100] Online stage:

[0101] (5) Calculate random salt and hash value: salt <- U({0,1} 320 ), generate a 320-bit random salt value. u <- H(m, salt), use the message m and the salt value salt to calculate u by the hash function H.

[0102] (6) Calculate the intermediate value v: v <- u-c mod Q. The result of u-c is operated by mod Q.

[0103] (7) Calculate the error and quotient: e <- (v mod p), calculate the error e and then calculate the quotient v', v' <- (v-e) / p.

[0104] (8) Calculate the vector z i : zi ←q·SampleZ d (v i ' / q), from the distribution D q·Im+v',r2 Sampling to get z i Using the input value vi' / q as a parameter, the sampling function SampleZ d From the distribution Z d Then, multiply the sampling result by the scaling factor q to get the final z i . Z d Usually refers to a discrete uniform distribution defined on the set of integers. Specifically, it represents integers uniformly sampled in the range [-d / 2, d / 2].

[0105] (9) Calculate the vectors x0, x1, and x2: x0←Ez+p0, x1←Sz+p1, and x2←z+p2. Here, Ez and Sz represent the linear transformation between matrices and vectors.

[0106] (10) Check the bounds: ∥(x0+e,x1,x2)∥>B, then restart the process. e is an error term, often used to introduce randomness or noise in encryption or signature algorithms. x0 is the first component of the vector, and x1 and x2 are the second and third components of the vector. B: This is a preset threshold, indicating the maximum allowable value of the norm.

[0107] (11) Compress vector x1, x2: str←Compress((x1, x2)). Compress the signature (x1, x2) using the compress_sig() function to obtain str. If str is an invalid value (⊥), restart the process.

[0108] (12) Output: Output the compressed signature s, s = (salt, str).

[0109] 3. The signature verification process of the HuFu post-quantum digital signature algorithm:

[0110] (1) Input: message m, signature (salt, str), public key pk, and acceptance boundary B.

[0111] (2) Recovery matrix The explanation is the same as the previous formula.

[0112] (3) Check signature length: Check whether the length of the decompressed signature string str is equal to the predetermined length L. If not, it means that the signature may be tampered with or incorrect, and a rejection operation is performed.

[0113] (4) Signature decompression: (x1,x2)←Decompress(str), x1∈Z n, x2∈Z m The signature (x1, x2) is decompressed by the Decompress_sig() function. x1 is an integer vector of length n, with each element from the integer ring Z; x2 is an integer vector of length m, with each element also from the integer ring Z.

[0114] (5) Calculate the signature vector: u ← H(m, salt), x0' is the final generated value, representing the result obtained by performing linear operations on u, modulo Q. represents the product of matrix B and vector x2, which is also part of the linear transformation. mod Q represents the modulo Q operation on the previous result.

[0115] (6) Output: Accept or Reject. if ∥(x0', x1, x2)∥ ≤ B, ≤ B represents Accept or >B represents Reject.

[0116] Through design and optimization, the HuFu algorithm series has achieved significant performance improvement in key generation, online phase, offline phase, and verification phase. The data in Table 1 shows that the key generation period of HuFu_NIST1 has decreased from 1000 to 542, and the online phase has decreased from 3856 to 1774, with a total performance improvement of nearly 48%. The key generation period of HuFu_NIST3 has decreased from 6072 to 3588, and the online phase has decreased from 9905 to 6436, showing the effectiveness of optimization. Although the offline phase period of HuFu_NIST5 is still relatively long, it has decreased from 20516 to 11156 after optimization, and the verification phase has also improved, showing a certain performance improvement. Overall, these optimizations have significantly improved the running efficiency of the algorithm, making the HuFu algorithm series more suitable for use in application scenarios that require efficient processing.

[0117] Table 1

[0118]

[0119] Through design and optimization, the HuFu algorithm has achieved significant performance improvement on the original basis, especially in the key generation, signature generation, and verification process. First, by designing an acceleration method for encoding and using the AVX2 instruction set to realize the parallelization optimization of signature compression and decompression process, the speed of encoding and decoding is greatly improved, especially when processing large-scale data.

[0120] ​Secondly, an optimization scheme for matrix multiplication in the original algorithm is proposed, which adopts one-time matrix blocking to avoid recursive operations. Combined with register optimization techniques, the accuracy of the calculation is ensured while reducing memory access, significantly improving the efficiency of matrix operations in the signature generation process.

[0121] In addition, a register optimization strategy is introduced in matrix multiplication and addition operations to save the calculation results in registers as much as possible and reduce the frequency of writing back to memory. This strategy further optimizes the execution efficiency of matrix operations, especially suitable for efficient implementation of post-quantum digital signature schemes. Through these optimization measures, the HuFu algorithm shows great potential when dealing with large-scale data, not only accelerating the calculation, but also reducing the energy consumption of the system and improving the response speed, showing its important practical value in the field of post-quantum cryptography.

Claims

1. A post-quantum digital signature key generation method based on AVX2 acceleration and matrix multiplication optimization, characterized in that, Comprising the following steps: Step 1, generating post-quantum digital signature algorithm key based on HuFu algorithm: Input: None; Computing seeds Generate a 256-bit random seed from a uniformly distributed random number generator as input for subsequent steps; Computing an extended output Generating a pseudo-random output based on a seed using an extended output function XOF; Generating structure matrix S and error matrix E: generating n x m structure matrix S and m x m error matrix E from two independent distributions, both are random matrices; Calculating matrix ∑p: solving (n+2m) x (n+2m) unit matrix, combining error matrix and structure matrix to obtain the required matrix ∑p; Judgement condition: repeat the step until ∑p of each element is greater than a set threshold Constructing the benchmark matrix B: Multiply the scalar by the identity matrix, subtract the linear combination, and perform a modulo operation to limit the matrix element values; Perform matrix decomposition: decompose a large matrix into multiple small block matrices; Perform matrix decomposition: generate multiple small block matrices L 33 , L 32 , L 31 , L 22 , L 21 , L 11 ; Output a public-private key pair: generate a public key pk and a private key sk; sk = (E, S, L 22 , L 32 , L 33 ); Step 2, generating post-quantum digital signature algorithm signature based on HuFu algorithm: Input: message m, private key sk, acceptable boundary B; Initialization and matrix generation Calculating sampling vector p: generating vector p from pre-defined probability distribution according to private key sk; Calculating c: generating final vector c by performing Q modulus operation on the product of matrix A and vector p; Calculating random salt salt and hash value u: generating 320-bit random salt value and calculating hash value u by hash function; Calculating intermediate value v: v <- u-c mod Q; performing Q modulus operation to obtain intermediate result; Calculating error e and quotient v': calculating error e and quotient v'; Calculating vector zi: generating final result zi by sampling function SampleZd; Performing matrix operation to obtain vectors x0, x1, x2: performing linear transformation of matrix and vector; x0 <- Ez + p0, x1 <- Sz + p1, x2 <- z + p2; Checking boundary: ensuring that the vector norm is within the set range, otherwise restarting the process; judgment standard: ||(x0+e, x1, x2)||> B; Compressing vector (x1, x2) to obtain str: compressing signature by Compress_sig function and checking validity; Output: generating and outputting compressed signature s; s = (salt, str); Step 3, verifying post-quantum digital signature algorithm signature based on HuFu algorithm: Input: message m, signature (salt, str), public key pk and acceptable boundary B; recovery matrix Checking signature length: verifying whether the decompressed signature length meets the predetermined value; Signature decompression: restoring original signature (x1, x2) by Decompress_sig function; Compute signature vector: Perform linear operations and take modulo; x0' is the final generated value; Output: ||(x0', x1, x2)||≤B, according to the norm check result to decide to accept or reject the signature.

2. The post-quantum digital signature key generation method based on AVX2 acceleration and matrix multiplication optimization according to claim 1, characterized in that, Step 1 specifically comprises the following steps: Step 1.1, input: none; Step 1.2, Compute Seed: From a uniform distribution random number generator U, generate a random 256-bit seed U({0,1} 256 ) denotes generating a random 256-bit bit sequence, each bit is uniformly distributed between 0 and 1; This seed as input for the next step; Step 1.3, Compute extended output generation: The formula represents the generation of a pseudo-random output using the extended output function XOF, given a seed XOF is a variable-length hash function based on SHAKE256 that can generate an output of any length on demand, here is the input seed to the XOF function, used to produce more pseudo-random data; Step 1.

4. Compute the structured matrix S and the error matrix E: (S, E) <- χ n×m χ m×m Two matrices S and E are generated from two independent distributions χ; χ n×m denotes an n x m matrix sampled from the distribution χ; χ m×m denotes another m x m matrix sampled from the same distribution χ; finally, the matrices S and E are two random matrices sampled from this distribution; Step 1.

5. Compute the repetition matrix ∑ p : Here I n+2m is an (n+2m) x (n+2m) identity matrix, I m denotes the transpose of the identity matrix, remains unchanged, E t denotes the transpose of the error matrix E, S t denotes the transpose of the structure matrix S; r 2 is a scalar multiplier, σ 2 is the variance; Step 1.6, judging condition Continue repeating the above steps until ∑ p Each element in the middle is greater than the threshold Step 1.

7. Compute the matrix B: The scalar P is multiplied by the identity matrix I to construct a scaled identity matrix; then, a linear combination of the columns of the scaled identity matrix is subtracted from this matrix where is the public matrix, S is the structure matrix, and E is the error matrix; This result is then subjected to a modulo Q operation, which limits the matrix element values to a certain range; modulo Q means that the result of each element is subjected to a modulo Q operation, which limits the value to a certain fixed range Q; Step 1.8, on the matrix Perform matrix decomposition: generate a plurality of small block matrices L 33 , L 32 , L 31 , L 22 , L 21 , L 11 ; ← matrix decomposition Step 1.9, output public-private key pair: public key p k , private key s k ; sk = (E, S, L 22 , L 32 , L 33 ).

3. The post-quantum digital signature key generation method based on AVX2 acceleration and matrix multiplication optimization according to claim 2, characterized in that, In step 1.5, the matrix ∑ p The calculation process is as follows: first, by multiplying the scaling factor r 2 The matrix product Then subtract this result from a matrix obtained by multiplying the variance σ 2 The unit matrix I n+2m The initial matrix; the variance σ 2 is a common variance term, which is the degree of dispersion or uncertainty of each variable; the variance σ 2 is multiplied by the unit matrix I n+2m , each element on the diagonal is given a fixed variance σ 2 .

4. The post-quantum digital signature key generation method based on AVX2 acceleration and matrix multiplication optimization according to claim 1, characterized in that, Step 2 specifically comprises the following steps: Step 2.1, input: message m, private key sk, acceptable boundary B; Step 2.2, offline stage: Initialization and matrix generation Step 2.

3. Compute the sampling vector p: p = (p0, pi, p2) <- SampleP(sk), sample the generation vector p from a pre-defined SampleP probability distribution according to the private key sk, where p0∈Z m , pi∈Z n , p2∈Z m ; p0 is an integer vector of length m, each element comes from integer ring Z; p1 is an integer vector of length n, each element also comes from integer ring Z; p2 is another integer vector of length m, which is the same as p0; Step 2.4, calculating c: c <- Ap mod Q; c: this is the final generated vector or matrix, representing the result obtained by a specific calculation; A: this is a public matrix, participating in the operation to generate the result c; p is the previously generated vector p, consisting of (p0, p1, p2), participating in the operation of matrix A; Ap: this is the product of matrix A and vector p, representing the linear transformation of the matrix and the vector; mod Q: representing the modulo Q operation on each element of the result Ap, limiting the value within a certain fixed range Q; Step 2.5, online phase: Compute random salt and hash value: salt <- U({0, 1} 320 ), generate a 320-bit random salt value; u <- H(m, salt), compute u using the message m and the salt value salt by the hash function H. Step 2.6, calculate the intermediate value v: v <- u - c mod Q; the result of u - c is operated modulo Q; Step 2.7, calculate the error and quotient: e <- (v mod p), calculate the quotient v' after calculating the error e, v' <- (v - e) / p; Step 2.

8. Calculate vector z i :z i ←q·SampleZ d (v i ′ / q), from the distribution D q·Im+v′,r2 Sampling to get z i ; Using the input value vi' / q as a parameter, through the sampling function SampleZ d From the distribution Z d Get a sample from ; then, multiply the sampling result by the scaling factor q to get the final z i ; Z d Usually refers to a discrete uniform distribution, defined on the set of integers, representing integers uniformly sampled in the range [-d / 2, d / 2]; Step 2.9, calculate the vector x0, x1, x2: x0 <- Ez + p0, x1 <- Sz + p1, x2 <- z + p2; Ez and Sz both represent the linear transformation of the matrix and the vector; Step 2.10, check the boundary: ||(x0 + e, x1, x2)|| > B, then restart the process; e is an error term, used to introduce randomness or noise in the encryption or signature algorithm; x0 is the first component of the vector x1, x2 is the second and third component of the vector; B: this is a preset threshold, representing the maximum allowed value of the norm; Step 2.11, compress the vector x1, x2: str <- Compress((x1, x2)); compress the signature (x1, x2) by the Compress_sig() function to get str: if str is an invalid value (⊥), restart the process; Step 2.12, output: output the compressed signature s, s = (salt, str).

5. The post-quantum digital signature key generation method based on AVX2 acceleration and matrix multiplication optimization according to claim 1, characterized in that, Step 3 specifically includes the following steps: Step 5.1, input: message m, signature (salt, str), public key pk, acceptable boundary B; Step 5.2, restoring the matrix Step 5.3, check the length of the signature: check whether the length of the decompressed signature string str is equal to the predetermined length L; if not, it means that the signature may be tampered with or there is a risk of error, and the rejection operation is performed; Step 5.4, Signature Decompression: (x1, x2) <- Decompress_sig(str), x1 e Z n , x2 e Z m , where the signature (x1, x2) is decompressed by the Decompress_sig() function; x1 is a vector of integers of length n, each element from the integer ring Z; x2 is a vector of integers of length m, each element also from the integer ring Z; Step 5.5, calculate the signature vector: u←H(m, salt), x0′ is the final generated value, which represents the result obtained by performing a linear operation on u modulo Q; Representation matrix The product of matrix B and vector x1 is used in encryption or signing, which is a linear transformation. Bx2 represents the product of matrix B and vector x2, which is also part of the linear transformation. ModQ represents the modulo Q operation on the previous result. Step 5.6, output: Accept or Reject; if ||(x0', x1, x2)|| ≤ B, ≤ B means Accept or > B means Reject.

6. A computer apparatus comprising a memory, a processor, and a computer program stored on the memory, wherein the computer program, when executed by the processor, causes the processor to perform the method of any one of claims 1 to 5. The processor executes the computer program to implement the steps of the method of claim 1.

7. A computer readable storage medium having stored thereon computer programs / instructions, characterized in that, The computer program / instructions are executed by the processor to implement the steps of the method of claim 1.

8. A computer program product comprising computer programs / instructions, characterized in that, The computer program / instructions are executed by the processor to implement the steps of the method of claim 1. The computer program / instructions are executed by the processor to implement the steps of the method of claim 1.

Citation Information

Patent Citations

  • Digital signature method and system capable of improving efficiency, computer equipment and storage medium

    CN116232596A

  • Efficient, parallel and rapid implementation method for lattice-based signature

    CN118041542A