CN-121485939-B - Polynomial matrix acquisition method and device, electronic equipment and storage medium
Abstract
The embodiment of the application provides a polynomial matrix acquisition method, a polynomial matrix acquisition device, electronic equipment and a storage medium, and relates to the technical field of information security. The method comprises the steps of obtaining input seeds for generating a polynomial matrix, wherein the polynomial matrix is used in the process of executing a target task based on a post-quantum cryptography algorithm, and executing sampling operation on a plurality of polynomial coefficients of the polynomial matrix through an extensible output function and pre-calculation information based on the input seeds to obtain the polynomial matrix, wherein the pre-calculation information comprises a plurality of intermediate checkpoints, and each intermediate checkpoint is used for representing one internal state of the extensible output function in the process of executing the sampling operation. The scheme has the advantages of short time consumption, high effect, small calculation cost and low cost.
Inventors
- ZHANG QINGYONG
- Pu Yamei
- MIAO JIAJIA
Assignees
- 北京信安世纪科技股份有限公司
- 北京普世时代科技有限公司
Dates
- Publication Date
- 20260508
- Application Date
- 20260108
Claims (9)
- 1. A polynomial matrix acquisition method, comprising: acquiring an input seed for generating a polynomial matrix, wherein the polynomial matrix is used in the process of executing a target task based on a post quantum cryptography algorithm; Performing a sampling operation on a plurality of polynomial coefficients of a polynomial matrix by means of an extensible output function and pre-computation information based on said input seed to obtain said polynomial matrix, wherein said pre-computation information is a data table pre-computed by a trusted party and distributed to a user, said pre-computation information comprising a plurality of intermediate checkpoints, each intermediate checkpoint being used to represent an internal state of said extensible output function during the execution of said sampling operation, said internal state comprising all information required to continue generating all subsequent random bytes; the performing a sampling operation on a plurality of polynomial coefficients of a polynomial matrix by a scalable output function and pre-computation information, comprising: Determining a plurality of target threads, wherein each target thread corresponds to an intermediate check point; based on the scalable output function, sampling operations are performed on a plurality of polynomial coefficients of a polynomial matrix in parallel by the plurality of target threads.
- 2. The method of claim 1, wherein after the obtaining the input seeds for generating the polynomial matrix, the method further comprises: Pre-calculation information is obtained.
- 3. The method of claim 2, wherein the obtaining pre-computed information comprises: determining a plurality of intermediate checkpoints that satisfy checkpoint screening conditions; and storing the plurality of intermediate checkpoints to form pre-calculation information.
- 4. A method according to claim 3, wherein said determining a plurality of intermediate checkpoints that meet checkpointing screening conditions comprises: Determining the number of polynomial coefficients of the target polynomial; And if the sampled target polynomial coefficient is determined to meet the multiple relation with a target threshold value, determining that the target polynomial coefficient corresponds to an intermediate check point, wherein the target threshold value is determined based on the number of the polynomial coefficients and the number of the target threads, and the target polynomial coefficient is one of the polynomial coefficients.
- 5. The method of any of claims 1-4, wherein the post quantum cryptography algorithm is a pattern-based digital signature algorithm or a key encapsulation algorithm.
- 6. A polynomial matrix acquisition apparatus is provided, characterized by comprising the following steps: The acquisition module is used for acquiring an input seed for generating a polynomial matrix, wherein the polynomial matrix is used in the process of executing a target task based on a post quantum cryptography algorithm; The sampling module is used for performing a sampling operation on a plurality of polynomial coefficients of a polynomial matrix through an extensible output function and pre-calculation information based on the input seeds to obtain the polynomial matrix, wherein the pre-calculation information is a data table which is pre-calculated by a trusted party and distributed to a user, the pre-calculation information comprises a plurality of intermediate checkpoints, each intermediate checkpoint is used for representing one internal state of the extensible output function during the process of performing the sampling operation, the internal state comprises all information required for continuously generating all subsequent random bytes, the sampling operation is performed on the plurality of polynomial coefficients of the polynomial matrix through the extensible output function and the pre-calculation information, and comprises the steps of determining a plurality of target threads, wherein each target thread corresponds to one intermediate checkpoint, and performing the sampling operation on the plurality of polynomial coefficients of the polynomial matrix through the plurality of target threads in parallel based on the extensible output function.
- 7. An electronic device comprising a memory, a processor, and a communication interface, wherein the memory has executable code stored thereon that, when executed by the processor, causes the processor to perform the polynomial matrix acquisition method of any of claims 1-5.
- 8. A non-transitory machine-readable storage medium having stored thereon executable code, which when executed by a processor of an electronic device, causes the processor to perform the polynomial matrix acquisition method of any of claims 1-5.
- 9. A computer program product comprising a computer program which, when executed by a processor of an electronic device, causes the processor to perform the polynomial matrix acquisition method of any one of claims 1 to 5.
Description
Polynomial matrix acquisition method and device, electronic equipment and storage medium Technical Field The present application relates to the field of information security technologies, and in particular, to a method and an apparatus for obtaining a polynomial matrix, an electronic device, and a storage medium. Background With the development of quantum computing, traditional public key cryptographic algorithms (such as elliptic curve cryptography algorithms) face security threat, model-based post-quantum cryptographic algorithms are generated, and core operations of the post-quantum cryptographic algorithms involve real-time generation of polynomial matrixes from one seed through an extensible output function when performing tasks such as signing, signature verification, key encapsulation and decapsulation, so that the process is long in time consumption, low in efficiency, high in calculation cost and high in cost. Disclosure of Invention The application provides a polynomial matrix acquisition method, a polynomial matrix acquisition device, electronic equipment and a storage medium, which are short in time consumption, high in effect, low in calculation cost and low in cost. In a first aspect, an embodiment of the present application provides a method for obtaining a polynomial matrix, where the method includes: acquiring an input seed for generating a polynomial matrix, wherein the polynomial matrix is used in the process of executing a target task based on a post quantum cryptography algorithm; based on the input seed, performing a sampling operation on a plurality of polynomial coefficients of a polynomial matrix by an scalable output function and pre-computation information to obtain the polynomial matrix, wherein the pre-computation information comprises a plurality of intermediate checkpoints, each intermediate checkpoint being used to represent an internal state of the scalable output function during execution of the sampling operation. Optionally, the performing a sampling operation on a plurality of polynomial coefficients of a polynomial matrix by means of a scalable output function and pre-calculation information includes: Determining a plurality of target threads, wherein each target thread corresponds to an intermediate check point; based on the scalable output function, sampling operations are performed on a plurality of polynomial coefficients of a polynomial matrix in parallel by the plurality of target threads. Optionally, after the obtaining the input seeds for generating the polynomial matrix, the method further includes: Pre-calculation information is obtained. Optionally, the acquiring pre-calculation information includes: determining a plurality of intermediate checkpoints that satisfy checkpoint screening conditions; A plurality of intermediate checkpoints are stored to form pre-computed information. Optionally, the determining a plurality of intermediate checkpoints that meet checkpointing screening conditions includes: Determining the number of polynomial coefficients of the target polynomial; And if the sampled target polynomial coefficient is determined to meet the multiple relation with a target threshold value, determining that the target polynomial coefficient corresponds to an intermediate check point, wherein the target threshold value is determined based on the number of the polynomial coefficients and the number of the target threads, and the target polynomial coefficient is one of the polynomial coefficients. Optionally, the post quantum cryptography algorithm is a model-based digital signature algorithm or a key encapsulation algorithm. In a second aspect, an embodiment of the present application provides a polynomial matrix acquiring apparatus, including: The acquisition module is used for acquiring an input seed for generating a polynomial matrix, wherein the polynomial matrix is used in the process of executing a target task based on a post quantum cryptography algorithm; And the sampling module is used for performing a sampling operation on a plurality of polynomial coefficients of a polynomial matrix through an extensible output function and pre-calculation information based on the input seeds to obtain the polynomial matrix, wherein the pre-calculation information comprises a plurality of intermediate checkpoints, and each intermediate checkpoint is used for representing one internal state of the extensible output function in the process of performing the sampling operation. In a third aspect, an embodiment of the present application further provides an electronic device, where the electronic device includes a memory, a processor, and a communication interface, and the memory stores executable code, where the executable code, when executed by the processor, causes the processor to perform the method described in the first aspect. In a fourth aspect, embodiments of the present application also provide a non-transitory machine-readable storage medium having store