Post-quantum digital signature key generation method based on AVX2 acceleration and matrix multiplication optimization
By adopting AVX2 acceleration and matrix multiplication optimization technology in the post-quantum digital signature algorithm, the problem of insufficient computing speed and efficiency of existing algorithms in large-scale communication protocols is solved, and a more efficient key generation and signature process is achieved.
Patent Information
- Application Number
- CN202411700102.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-26
- Publication Date
- 2025-03-04
- Estimated Expiration
- 2044-11-26
AI Technical Summary
The existing post-quantum digital signature algorithms are insufficient in computing speed and efficiency in large-scale communication protocols, resulting in a slower signature process rate.
Using AVX2 acceleration and matrix multiplication optimization methods, an efficient post-quantum digital signature key generation batch processing mechanism is designed through optimized encoding, matrix calculation and memory access operations.
It significantly improves the speed of key generation and signature, reduces the bottlenecks of computing overhead and memory access operations, and achieves higher parallelization and computing efficiency.
Smart Images

Figure CN119561684A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of cryptography, and in particular relates to a post-quantum digital signature key generation method based on AVX2 acceleration and matrix multiplication optimization. Background Art
[0002] With the rapid development of quantum computing technology, traditional encryption standards are facing severe challenges, which has forced the cryptography community to re-examine existing secure communication protocols. This threat has spawned 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 hot topic in global research, and many new encryption algorithms have emerged to cope with the cracking capabilities 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), and uses the lattice trapdoor framework and compact gadget technology to provide a highly secure and efficient signature mechanism. However, despite the advantages of the HuFu algorithm in terms of security and basic efficiency, in practical applications, especially in large-scale communication protocols, its computing speed and efficiency are still insufficient, resulting in a slow overall signature process. Summary of the invention
[0004] Purpose of the invention: The purpose of the present invention 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 high 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 invention comprises the following steps:
[0006] Step 1: Generate the post-quantum digital signature algorithm key based on the HuFu algorithm:
[0007] Input: None;
[0008] Calculate the seed Generate a 256-bit random seed from a uniformly distributed random number generator as input for subsequent steps;
[0009] Calculate extended output Generate pseudo-random output based on the seed using the extended output function XOF;
[0010] Generate structure matrix S and error matrix E: Generate n×m structure matrix S and m×m error matrix E from two independent distributions, both of which are random matrices;
[0011] Calculate the matrix ∑p :Solve the (n+2m)×(n+2m) unit matrix, combine the error matrix and the structure matrix to calculate and obtain the required matrix ∑ p ;
[0012] Judgment condition: Repeat the steps until ∑ p Each element is greater than the set threshold
[0013] Construct the benchmark matrix Β: Multiply the scalar by the identity matrix, subtract the linear combination, and perform a modular operation to constrain the matrix element values;
[0014] Perform matrix decomposition: decompose a large matrix into multiple small matrices; Perform matrix decomposition: generate multiple small matrices L 33 ,L 32 ,L 31 ,L 22 ,L 21 ,L 11 ;
[0015] Output public-private key pair: generate public key pk and private key sk; sk=(E,S,L 22 ,L 32 ,L 33 );
[0016] Step 2: Generate a post-quantum digital signature algorithm signature based on the 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 and generate the vector p from the predefined probability distribution;
[0020] Calculate c: Perform a modulo Q operation to generate the final vector c by multiplying the matrix A by the vector p;
[0021] Calculate random 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←uc mod Q; perform the modulo Q operation to obtain the intermediate result;
[0023] Calculate the error e and the quotient v': Calculate the error e and find the quotient v';
[0024] Calculate the vector z i :Generate the final result z through the sampling function SampleZdi ;
[0025] Perform matrix operations to obtain vector x 0 ,x 1 ,x 2 : Perform linear transformation of matrices and vectors; x 0 ←Ez+p 0 , x 1 ←Sz+p 1 , x 2 ←z+p 2 ;
[0026] Check boundary: Make sure the vector norm is within the set range, otherwise restart the process; judgment criteria: ∥(x 0 +e,x 1 ,x 2 )∥>B;
[0027] Compress the vector (x1, x2) to get str: compress the signature through 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 the HuFu algorithm:
[0030] Input: message m, signature (salt, str), public key pk and acceptable boundary B;
[0031] Recovery Matrix
[0032] Check signature length: verify whether the length of the decompressed signature meets the preset value;
[0033] Signature decompression: restore the original signature (x1, x2) through the Decompress_sig function;
[0034] Calculate the signature vector: perform linear operations and perform modular operations; x 0 ′ is the final generated value;
[0035] Output: ∥(x 0 ',x 1 ,x 2 )∥≤B, and decide whether to accept or reject the signature based on the norm check result.
[0036] Furthermore, 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 ) means generating a random 256-bit sequence, each bit is evenly distributed between 0 and 1; this seed As input for the next steps;
[0039] Step 1.3: Calculate the extended output generation: The formula represents the use of the extended output function XOF, with a given seed Generate a pseudo-random output; XOF is a variable-length hash function based on SHAKE256, which can generate output of any length according to requirements. It is the input seed of the XOF function, used to generate more pseudo-random data;
[0040] Step 1.4: Calculate the repeated generation structure matrix S and error matrix E: (S, E) ← χ n×m × m×m , generate two matrices S and E from two independent distributions χ; n×m represents an n×m matrix sampled from distribution χ, χ m×m represents another m×m matrix generated from the same distribution χ; finally, matrices S and E are two random matrices sampled from this distribution;
[0041] Step 1.5: Calculate the repetition matrix ∑ p : Here I n+2m is a (n+2m)×(n+2m) identity matrix, I m represents the transpose of the identity matrix, remains unchanged, 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: Determine the conditions Continue to repeat the above steps until ∑ p Every element in is greater than the threshold
[0043] Step 1.7, calculate the matrix Β: Multiply the scalar P by the identity matrix I to construct a scaled reference matrix; then, subtract the linear combination from this matrix in is the public matrix, S is the structure matrix, and E is the error matrix. This result is then subjected to the modulo Q operation to limit the matrix element values to a certain range. Modulo Q represents the result Perform a modulo Q operation on each element of to limit the value to a fixed range Q;
[0044] Step 1.8: Matrix Perform matrix decomposition: generate multiple small matrices L 33 ,L 32 ,L 31 ,L 22 ,L 21 ,L 11
[0045]
[0046] Step 1.9, output the public-private key pair: public key p k ,Private Keys k ; sk=(E,S,L 22 ,L 32 ,L 33 ).
[0047] Furthermore, in step 1.5, the matrix ∑ p The calculation process is as follows: First, by multiplying the scaling factor r 2 After The initial matrix obtained; variance σ 2 is a common variance term, which is the degree of dispersion or uncertainty of each variable; variance σ 2 With the identity matrix I n+2m Multiplication means that each element on the diagonal is assigned a fixed variance σ 2 .
[0049] Furthermore, 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 = (p 0 ,p 1 ,p 2 )←SampleP(sk), according to the private key sk, sample and generate vector p from the predefined SampleP probability distribution, where p 0∈Z m , p 1 ∈Z n , p 2 ∈Z m ;p 0 is an integer vector of length m, each element of which comes from the integer ring Z; p 1 is an integer vector of length n, each element of which is also from the integer ring Z; p 2 is another integer vector of length m, similar to p 0 The form is the same;
[0054] Step 2.4, calculate c: c←Ap mod Q; c: This is the final generated vector or matrix, representing the result obtained through a 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, given by (p 0 ,p 1 ,p 2 ) and participate in the operation of matrix A; Ap: This is the product of matrix A and vector p, which represents the linear transformation of matrix and vector; modQ: It means to perform modulo Q operation on each element of result Ap, and limit 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 modp), 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 this 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 vector x 0 ,x 1 ,x 2 :x 0 ←Ez+p 0 , x 1 ←Sz+p 1 , x 2 ←z+p 2 ; Ez and Sz both represent the linear transformation between matrices and vectors;
[0062] Step 2.10, check the boundary: ∥(x 0 +e,x 1 ,x 2 )∥>B, then restart the process; e is an error term, which is used to introduce randomness or noise in encryption or signature algorithms; x 0 This is the first component of the vector x 1 ,x 2 are the second and third components of the vector; B: This is a preset threshold, indicating the maximum allowed value of the norm;
[0063] Step 2.11: Compress vector x 1 ,x 2 :str←Compress((x1,x2)); compress the signature (x1,x2) through the Compress_sig() function to get 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, acceptable 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 means that the signature is at risk of being tampered with or wrong, and the rejection operation is performed;
[0069] Step 5.4, signature decompression: (x1, x2) ← Decompress (str), x 1∈Z n , x 2 ∈Z m , decompress the signature (x1, x2) through the Decompress_sig() function; x 1 is an integer vector of length n, each element of which comes from the ring of integers Z; x 2 is an integer vector of length m, each element of which is also from the integer ring Z;
[0070] Step 5.5, calculate the signature vector: u←H(m,salt), x 0 ′ is the final generated value, which represents the result obtained by performing linear operation on u modulo Q; Representation Matrix and vector x 1 The product of is used in encryption or signing process, which is a linear transformation; Bx 2 Represents the matrix B and vector x 2 The product of is also part of the linear transformation; modQ means performing a modulo Q operation on the previous result;
[0071] Step 5.6, output: Accept or Reject; if∥(x 0 ′,x 1 ,x 2 )∥≤B, ≤B means Accept or >B means Reject.
[0072] The present invention 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 implement the steps of the method of the present invention.
[0073] The present invention also discloses a computer-readable storage medium on which a computer program / instruction is stored. When the computer program / instruction is executed by a processor, the steps of the method of the present invention are implemented.
[0074] The present invention also discloses a computer program product, comprising a computer program / instruction, which implements the steps of the method of the present invention when executed by a processor.
[0075] Beneficial effects: Compared with the prior art, the present invention has the following significant advantages:
[0076] Through design and optimization, the HuFu algorithm adopts optimized encoding and matrix operation strategies to improve overall computing efficiency. By introducing the AVX2 instruction set to accelerate the encoding process, and combining it with 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 signing, but also further reduces the bottleneck of memory access operations through register-based memory optimization strategies, thereby achieving higher parallelization and computing efficiency. This series of optimizations ensures that HuFu has reliability and security in the communication protocol of the post-quantum era, and meets the actual application needs in complex network environments.
[0077] Secondly, a matrix multiplication optimization scheme for the original algorithm is proposed, which adopts one-time matrix partitioning to avoid recursive operations. Combined with register optimization technology, it reduces memory access while ensuring the accuracy of calculation, greatly improving the efficiency of matrix operations in the signature generation process.
[0078] In addition, a register optimization strategy is introduced in matrix multiplication and addition operations to store 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 and is particularly suitable for the efficient implementation of post-quantum digital signature schemes. Through these optimization measures, the HuFu algorithm has shown great potential in processing large-scale data, which not only speeds up calculations, but also reduces the energy consumption of the system and improves the response speed, showing its important practical value in the field of post-quantum cryptography. BRIEF DESCRIPTION OF THE DRAWINGS
[0079] Figure 1 Generate a post-quantum digital signature algorithm key graph based on the HuFu algorithm.
[0080] Figure 2 Generate a post-quantum digital signature algorithm signature based on the HuFu algorithm.
[0081] Figure 3 Verify the signature of the post-quantum digital signature algorithm based on the HuFu algorithm DETAILED DESCRIPTION
[0082] The technical solution of the present invention is further described below in conjunction with the accompanying drawings.
[0083] The present invention provides a post-quantum digital signature operation and matrix multiplication optimization mechanism based on AVX2 acceleration. Figure 1 As shown, the program involves the following:
[0084] 1. The key generation process of the HuFu post-quantum digital signature algorithm is as follows:
[0085] (1) Input: None
[0086] (2) Calculate the seed: Generate a 256-bit random seed from a uniformly distributed random number generator U U({0,1} 256 ) means generating a random 256-bit sequence, each of which is evenly distributed between 0 and 1. This seed It will be used as input for the next steps.
[0087] (3) Compute extended output generation: The formula represents the use of the extended output function (XOF), with a given seed Generates a pseudo-random output. XOF is a variable-length hash function based on SHAKE256, which can generate outputs of any length as required. It is the input seed of the XOF function, used to generate more pseudo-random data.
[0088] (4) Calculate the repeated generation structure matrix S and error matrix E: (S, E)←χ n×m × m×m , generates two matrices S and E from two independent distributions χ. Specifically, χ n×m represents an n×m matrix sampled from distribution χ, χ m×m represents another m×m matrix generated from the same distribution χ. Finally, matrices S and E are two random matrices sampled from this distribution.
[0089] (5) Calculate the repetition ∑ p : Here I n+2m is a (n+2m)×(n+2m) identity matrix, I m represents the transpose of the identity matrix, remains unchanged, E t represents the transpose of the error matrix E, S t Represents the transpose of the structure matrix S. 2 is a scalar multiplier. This is to find the matrix ∑ p First, by multiplying the scaling factor r 2 The matrix product after This result is then subtracted from the one given by the variance σ 2 Multiply by the identity matrix I n+2m The initial matrix obtained. Variance σ 2 is a common variance term, which can be understood as the degree of dispersion or uncertainty of each variable. It is related to the unit matrix I n+2m This means that each element on the diagonal is assigned a fixed variance σ 2 .
[0090] (6) Judgment conditions Continue to repeat the above steps until ∑ p Every element in is greater than a threshold r 2 .
[0091] (7) Calculate the matrix Β: Multiply the scalar P by the identity matrix I to construct a scaled reference matrix. Then, subtract the linear combination from this matrix in is the public matrix, S is the structure matrix, and E is the error matrix. This result is then subjected to the modulo Q operation to limit the matrix element values to a certain range. Modulo Q represents the result Each element of is modulo Q, limiting the value to a fixed range Q. This formula often appears in encryption or signature schemes to generate a specific matrix result Β.
[0092] (8) For the matrix Perform matrix decomposition: generate multiple small matrices L 33 ,L 32 ,L 31 ,L 22 ,L 21 ,L 11 .
[0093] (9) Output the public-private key pair: public key p k ,Private Keys k . sk=(E,S,L 22 ,L 32 ,L 33 ).
[0094] 2. The signature generation process of the HuFu post-quantum digital signature algorithm is as follows:
[0095] (1) Input: message m, private key sk, acceptance boundary B.
[0096] Offline stage:
[0097] (2) Initialization and matrix generation The explanation is the same as the previous formula.
[0098] (3) Calculate the sampling vector p: p = (p 0 ,p 1 ,p 2 )←SampleP(sk), according to the private key sk, sample and generate vector p from the predefined SampleP probability distribution, where p 0 ∈Z m , p 1 ∈Zn , p 2 ∈Z m . p 0 is an integer vector of length m, each element of which comes from the integer ring Z; p 1 is an integer vector of length n, each element of which is also from the integer ring Z; p 2 is another integer vector of length m, similar to p 0 Same format.
[0099] (4) Calculate c: c←Ap modQ. c: This is the final vector or matrix generated, representing the result obtained through a specific calculation. A: This is a matrix, usually public, that participates in the operation to generate the result c. p is the previously generated vector p, given by (p 0 ,p 1 ,p 2 ) and participate in the operation of matrix A. Ap: This is the product of matrix A and vector p, which represents the linear transformation of matrix and vector. modQ: It means to perform modulo Q operation on each element of result Ap, and limit the value to a fixed range Q.
[0100] Online stage:
[0101] (5) Calculate the 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 salt value salt to calculate u through the hash function H.
[0102] (6) Calculate the intermediate value v: v←uc mod Q. The result of uc is subjected to the modulo Q operation.
[0103] (7) Calculate the error and quotient: e←(v mod p). After calculating the error e, find the quotient v', v'←(ve) / p.
[0104] (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, 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 sampled uniformly in the range [-d / 2, d / 2].
[0105] (9) Calculate vector x 0 ,x 1 ,x 2 :x 0 ←Ez+p 0 , x 1 ←Sz+p 1 , x 2 ←z+p 2 Here, Ez and Sz both represent the linear transformation between matrices and vectors.
[0106] (10) Check the boundary: ∥(x 0 +e,x 1 ,x 2 )∥>B, then restart the process. e is an error term, which is usually used to introduce randomness or noise in encryption or signature algorithms. 0 This is the first component of the vector x 1 ,x 2 are the second and third components of the vector. B: This is a preset threshold value indicating the maximum allowed value of the norm.
[0107] (11) Compress vector x 1 ,x 2 :str←Compress((x1,x2)). Compress the signature (x1,x2) to get str through the Compress_sig() function. If str is an invalid value (⊥), restart the process.
[0108] (12) Output: Output the compressed signature s, s = (salt, str).
[0109] 3. The HuFu post-quantum digital signature algorithm signature verification process:
[0110] (1) Input: message m, signature (salt, str), public key pk, acceptable boundary B.
[0111] (2) Recovery Matrix The explanation is the same as the previous formula.
[0112] (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 means that the signature may be tampered with or wrong, and the rejection operation is performed.
[0113] (4) Signature decompression: (x1, x2) ← Decompress(str), x 1 ∈Z n , x 2 ∈Z m, decompress the signature (x1, x2) through the Decompress_sig() function. 1 is an integer vector of length n, each element of which comes from the ring of integers Z; x 2 is an integer vector of length m, each element of which is also from the ring of integers Z.
[0114] (5) Calculate the signature vector: u←H(m,salt), x 0 ′ is the final generated value, which represents the result obtained by performing a linear operation on u modulo Q. Representation Matrix and vector x 1 The product of is usually used in encryption or signing process and is a linear transformation. 2 Represents the matrix B and vector x 2 The product of is also part of the linear transformation. modQ means to perform a modulo Q operation on the previous result.
[0115] (6) Output: Accept or Reject. if∥(x 0 ′,x 1 ,x 2 )∥≤B, ≤B means acceptance (Accept) or >B means rejection (Reject).
[0116] After design and optimization, significant performance improvements have been achieved in the key generation, online phase, offline phase, and verification phase of the HuFu algorithm series. The data in Table 1 show that the key generation cycle of HuFu_NIST1 has been reduced from 1000 to 542, and the online phase has been reduced from 3856 to 1774, with an overall performance improvement of nearly 48%. The key generation cycle of HuFu_NIST3 has been reduced from 6072 to 3588, and the online phase has been reduced from 9905 to 6436, showing the effectiveness of the optimization. Although the offline phase cycle of HuFu_NIST5 is still relatively long, it has been reduced from 20516 to 11156 after optimization, and the verification phase has also been improved, showing a certain performance improvement. Overall, these optimizations have significantly improved the operating 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 improvements on the original basis, especially in the key generation, signature generation and verification processes. First, by designing an acceleration method for encoding and using the AVX2 instruction set to achieve parallel optimization of the signature compression and decompression process, the speed of encoding and decoding has been greatly improved, especially when processing large-scale data.
[0120] Secondly, a matrix multiplication optimization scheme for the original algorithm is proposed, which adopts one-time matrix partitioning to avoid recursive operations. Combined with register optimization technology, it reduces memory access while ensuring the accuracy of calculation, greatly 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 store 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 and is particularly suitable for the efficient implementation of post-quantum digital signature schemes. Through these optimization measures, the HuFu algorithm has shown great potential in processing large-scale data, which not only speeds up calculations, but also reduces the energy consumption of the system and improves 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: The steps include: Step 1: Generate the post-quantum digital signature algorithm key based on the HuFu algorithm: Input: None; Calculate the seed Generate a 256-bit random seed from a uniformly distributed random number generator as input for subsequent steps; Calculate extended output Generate pseudo-random output based on the seed using the extended output function XOF; Generate structure matrix S and error matrix E: Generate n×m structure matrix S and m×m error matrix E from two independent distributions, both of which are random matrices; Calculate the matrix ∑p: solve the (n+2m)×(n+2m) unit matrix, and calculate it in combination with the error matrix and the structure matrix to obtain the required matrix ∑p; Judgment condition: Repeat the steps until each element of ∑p is greater than the set threshold Construct the benchmark matrix B: Multiply the scalar by the identity matrix, subtract the linear combination, and perform a modular operation to constrain the matrix element values; Perform matrix decomposition: decompose a large matrix into multiple small matrices; Perform matrix decomposition: generate multiple small matrices L 33 , L 32 , L 31 , L 22 , L 21 , L 11 ; Output public-private key pair: generate public key pk and private key sk; sk=(E,S,L 22 , L 32 , L 33 ); Step 2: Generate a post-quantum digital signature algorithm signature based on the HuFu algorithm: Input: message m, private key sk, acceptance boundary B; Initialization and matrix generation Calculate the sampling vector p: According to the private key sk, sample and generate the vector p from the predefined probability distribution; Calculate c: Perform a modulo Q operation to generate the final vector c by multiplying the matrix A by the vector p; Calculate random salt and hash value u: Generate a 320-bit random salt value and calculate the hash value u through the hash function; Calculate the intermediate value v: v←uc mod Q; perform the modulo Q operation to obtain the intermediate result; Calculate the error e and the quotient v′: Calculate the error e and find the quotient v′; Calculate the vector zi: Generate the final result zi through the sampling function SampleZd; Perform matrix operations to obtain vectors x0, x1, x2: perform linear transformations between matrices and vectors; x0←Ez+p0, x1←Sz+p1, x2←z+p2; Check the boundary: make sure the vector norm is within the set range, otherwise restart the process; judgment standard: ||(x0+e, x1, x2)||>B; Compress the vector (x1, x2) to get str: compress the signature through the Compress_sig function and check the validity; Output: Generate and output the compressed signature s; s = (salt, str); Step 3: Verify the post-quantum digital signature algorithm signature based on the HuFu algorithm: Input: message m, signature (salt, str), public key pk and acceptance boundary B; Recovery Matrix Check signature length: verify whether the length of the decompressed signature meets the preset value; Signature decompression: restore the original signature (x1, x2) through the Decompress_sig function; Calculate the signature vector: perform linear operations and perform modular operations; x0′ is the final generated value; Output: ||(x0′, x1, x2)||≤B. Accept or reject the signature based on the norm check result.
2. According to claim 1, a post-quantum digital signature key generation method based on AVX2 acceleration and matrix multiplication optimization is characterized in that: Step 1 specifically includes the following steps: Step 1.1, Input: None; Step 1.2, calculate the seed: Generate a 256-bit random seed from a uniformly distributed random number generator U U({0,1} 256 ) means generating a random 256-bit sequence, each bit is evenly distributed between 0 and 1; This seed As input for the next steps; Step 1.3: Calculate the extended output generation: The formula represents the use of the extended output function XOF, with a given seed Generate a pseudo-random output; XOF is a variable-length hash function based on SHAKE256, which can generate output of any length according to requirements. It is the input seed of the XOF function, used to generate more pseudo-random data; Step 1.4: Calculate the repeated generation structure matrix S and error matrix E: (S, E)←χ n×m × m×m , generate two matrices S and E from two independent distributions χ; n×m represents an n×m matrix sampled from distribution χ, χ m×m represents another m×m matrix generated from the same distribution χ; finally, matrices S and E are two random matrices sampled from this distribution; Step 1.5: Calculate the repetition matrix ∑ p : Here I n+2m is a (n+2m)×(n+2m) identity matrix, I m represents the transpose of the identity matrix, remains unchanged, 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; Step 1.6: Determine the conditions Continue to repeat the above steps until ∑ p Every element in is greater than the threshold Step 1.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 in is the public matrix, S is the structure matrix, and E is the error matrix; This result is then restricted to a certain range by the modulo Q operation; modulo Q means the result Perform a modulo Q operation on each element of to limit the value to a fixed range Q; Step 1.8: Matrix Perform matrix decomposition: generate multiple small matrices L 33 , L 32 , L 31 , L 22 , L 21 , L 11 ; ←Matrix Decomposition Step 1.9, output the public-private key pair: public key p k , private key s k ; sk=(E,S,L 22 , L 32 , L 33 ).
3. According to claim 2, a post-quantum digital signature key generation method based on AVX2 acceleration and matrix multiplication optimization is 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 after This result is then subtracted from the one given by the variance σ 2 Multiply by the identity matrix I n+2m The initial matrix obtained; variance σ 2 is a common variance term, which is the degree of dispersion or uncertainty of each variable; variance σ 2 With the identity matrix I n+2m Multiplication means that each element on the diagonal is assigned a fixed variance σ 2 .
4. According to claim 1, a post-quantum digital signature key generation method based on AVX2 acceleration and matrix multiplication optimization is characterized in that: Step 2 specifically includes the following steps: Step 2.1, input: message m, private key sk, acceptance boundary B; Step 2.2, offline phase: Initialization and matrix generation Step 2.3, calculate the sampling vector p: p = (p0, p1, p2) ← SampleP (sk), according to the private key sk, sample the vector p from the predefined SampleP probability distribution, where p0∈Z m , p1∈Z n , p2∈Z m ; p0 is an integer vector of length m, each element of which comes from the integer ring Z; p1 is an integer vector of length n, each element of which also comes from the integer ring Z; p2 is another integer vector of length m, with the same form as p0; Step 2.4, calculate c: c←Ap mod Q; c: This is the final vector or matrix generated, representing the result obtained through a 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), participating 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; modQ: represents the modulo Q operation on each element of the result Ap, limiting the value to a fixed range Q; Step 2.5, online stage: 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 salt value salt to calculate u through the hash function H; Step 2.6, calculate the intermediate value v: v←uc mod Q; perform the operation modulo Q on the result of uc; Step 2.7, calculate the error and quotient: e←(v mod p), after calculating the error e, find the quotient v′, v′←(ve) / 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 this 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 between matrices and vectors; 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 encryption or signature algorithms; x0 is the first component of the vector x1, and x2 is the second and third components of the vector; B: This is a preset threshold, indicating the maximum allowed value of the norm; Step 2.
11. Compress vector x1, x2: str←Compress((x1, x2)); compress the signature (x1, x2) through 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. According to claim 1, a post-quantum digital signature key generation method based on AVX2 acceleration and matrix multiplication optimization is 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: Restore the matrix 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 means that the signature is at risk of being tampered with or wrong, and the rejection operation is performed; 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 comes from the integer ring Z; x2 is an integer vector of length m, each element also comes 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 linear operation on u modulo Q; Representation Matrix The product of matrix B and vector x1 is used in encryption or signing process, 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 device comprising a memory, a processor and a computer program stored in the memory, characterized in that: The processor executes the computer program to implement the steps of the method of claim 1.
7. A computer-readable storage medium having a computer program / instruction stored thereon, characterized in that: When the computer program / instructions are executed by a processor, the steps of the method according to claim 1 are implemented.
8. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the steps of the method according to claim 1 are implemented.
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
Dot-based cryptographic digital signature scheme with masking
CN118648265A
Efficient storage architecture based on anti-quantum encryption algorithm
CN118798376A
Public key / signature cryptosystem with enhanced digital signature certification
US5005200A