Large-code-distance iterative linear code searching method and device

By generating sample search space and randomly searching for iteratively generate the matrix, the problem of unfriendly and delay caused by the large scale of the existing optimal linear code generation matrix is ​​solved, and the high code distance and low implementation cost of iterative linear code are achieved.

CN120050024APending Publication Date: 2025-05-27NO 30 INST OF CHINA ELECTRONIC TECH GRP CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510107574.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-23
Publication Date
2025-05-27

AI Technical Summary

Technical Problem

The generation matrix of the existing optimal linear code is huge, resulting in unfriendly engineering implementation, high implementation costs and large delays.

Method used

By generating sample search space with dimensions not less than k, randomly searching and iteratively generate matrix M, calculating the code distance d of its corresponding linear code, and realizing the iterative linear code generation based on a smaller scale iterative generation matrix.

Benefits of technology

The code distance of iterative linear code is equivalent to that of the optimal linear code, and it also has the advantage of low cost and low delay in single-round implementation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120050024A_ABST
    Figure CN120050024A_ABST
Patent Text Reader

Abstract

The invention discloses a search method and device for a large-code-distance iterative linear code, and belongs to the technical field of cryptographic devices, and the method comprises the steps: inputting search parameters n and k of the linear code into a computer device, n represents the code length, k represents the dimension of the linear code, and the values are positive integers and meet ngt; k; generating a sample search space S of which the dimension is not less than k by using the computer device; randomly searching and iteratively generating a matrix M in the sample search space S, and calculating a code distance d of a linear code corresponding to the matrix M; and outputting an iterative generation matrix M and a code distance d of the linear code [n, k] by using a computer output unit. According to the method, the iterative linear code can be generated based on the small-scale iterative generation matrix, the code distance of the iterative linear code is equivalent to that of the optimal linear code, and the method has the advantages of being low in implementation cost and low in single-round implementation delay.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of cryptographic devices, and more specifically, to a search method and device for a large minimum distance iterative linear code. Background Art

[0002] In the field of cryptographic devices, linear codes, as a class of codes with excellent properties and easy to implement, have important applications in the fields of digital communication, combinatorial mathematics, cryptography, etc. In practical applications, people usually hope that the minimum distance of the linear code is as large as possible, so the optimal linear code becomes the first choice. The so-called optimal linear code refers to a linear code with the minimum distance d reaching the known maximum under the given code length n and dimension k. At present, its construction method is relatively mature. However, although the minimum distance of the optimal linear code reaches the known optimum, its generator matrix G is a matrix with k rows and n columns. When n is large, the generator matrix G is a large-scale non-sparse matrix, which is particularly unfriendly to implementers in engineering implementation, is extremely error-prone, has a large implementation area, resulting in the technical problems of high implementation cost and large delay in cryptographic devices. Summary of the Invention

[0003] The purpose of the present invention is to overcome the deficiencies of the prior art and provide a search method and device for a large minimum distance iterative linear code, which can realize generating an iterative linear code based on an iterative generator matrix with a smaller scale, whose minimum distance is equivalent to that of the optimal linear code, and has the advantages of low implementation cost and low single-round implementation delay.

[0004] The purpose of the present invention is achieved through the following solutions:

[0005] A search method for a large minimum distance iterative linear code includes the following steps:

[0006] S1. Input the search parameters of the linear code: n and k into the computer device, where n represents the code length, k represents the dimension of the linear code, and their values are all positive integers and satisfy n>k;

[0007] S2. Use the computer device to generate a sample search space S with a dimension not less than k;

[0008] S3. Randomly search for an iterative generator matrix M in the sample search space S and calculate the minimum distance d of the corresponding linear code;

[0009] S4. Use the computer output unit to output the iterative generator matrix M and the minimum distance d of the linear code [n,k].

[0010] Further, in step S2, the use of the computer device to generate a sample search space S with a dimension not less than k specifically includes the following sub-steps:

[0011] S2.1. Arbitrarily select a known optimal linear code C 0= [n 0 , k, d 0 , the code distance d 0 is the maximum code distance in the known linear code [n 0 , k];

[0012] S2.2. Use a computer device to calculate the generator matrix G 0 of the optimal linear code C 0 ;

[0013] S2.3. Delete the column vectors with Hamming weight 0 and 1 in the matrix G 0 . The remaining column vectors form the sample search space S, i.e., S = {v|v ∈ G 0 , hw(v)>1}, where v ∈ G 0 represents any column vector v in the matrix G 0 , and hw(v) represents the Hamming weight of the vector v, i.e., the number of non-zero elements;

[0014] S2.4. Use a computer device to calculate the size |S| of the sample search space S;

[0015] S2.5. If |S| ≥ k, then S is the generated sample search space with a dimension not less than k; otherwise, return to step S2.1.

[0016] Furthermore, in step S3, the randomly searching and iteratively generating the matrix M in the sample search space S and calculating the code distance d of its corresponding linear code specifically include the following sub-steps:

[0017] S3.1. Set the search times threshold N and calculate the iteration times where is the ceiling symbol;

[0018] S3.2. Initialize the code distance d = 0, the search times sn = 0, and the number of non-zero elements of the matrix sum = k 2 ;

[0019] S3.3. Randomly select k different column vectors v 0 , v 1 ,..., v k-1 in the sample search space S to form the matrix M 1 = [v 0 , v 1 ,..., v k-1 ;

[0020] S3.4. The search times sn = sn + 1;

[0021] S3.5. If M 1 is an invertible matrix, calculate the matrix Otherwise, return to step S3.3;

[0022] S3.6. Retain the first n column vectors in G 1 Delete the remaining column vectors to obtain a new k×n matrix G 1 ;

[0023] S3.7. Calculate the code distance d of the linear code corresponding to the generator matrix G 1 ; 1 ;

[0024] S3.8. Calculate the number sum of non-zero elements in matrix M 1 ; 1 ;

[0025] S3.9. If d 1 >d, then let M = M 1 , d = d 1 , sum = sum 1 ; If d 1 =d and sum 1 <sum, also let M = M 1 , d = d 1 , sum = sum 1 ; Otherwise, directly execute step S3.10;

[0026] S3.10. If the search times sn ≥ N or where “!” represents the factorial operation, the search ends; otherwise, return to step S3.3.

[0027] Furthermore, in step S2.1, the value of the code length n 0 should be a positive integer and satisfy n ≤ n 0 ≤ 2n.

[0028] Furthermore, in S3.1, the value of the threshold N should be a positive integer and satisfy

[0029] A search device for a large code distance iterative linear code includes a processor and a memory. A computer program is stored in the memory. When the computer program is loaded by the processor, the method described in any one of the above is executed.

[0030] The beneficial effects of the present invention include:

[0031] The present invention provides a method and apparatus for searching large minimum distance iterative linear codes, which can generate iterative linear codes based on a relatively small iterative generator matrix, and the minimum distance of the generated iterative linear codes is large, even reaching the optimal value. Compared with the prior art, the iterative generator matrix of the method of the present invention has a small scale, low implementation cost, and the generation of linear codes can be realized based on rounds, with low latency and high efficiency in single-round implementation. The cryptographic apparatus using the present invention has the advantages of low implementation cost and small latency. Description of the Drawings

[0032] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0033] Figure 1 It is the overall flowchart for searching large minimum distance iterative linear codes in the embodiments of the present invention;

[0034] Figure 2 It is the generation process of the sample search space in the embodiments of the present invention;

[0035] Figure 3 It is the random search process of the iterative generator matrix in the embodiments of the present invention. Detailed Embodiments

[0036] All features disclosed in all embodiments in this specification, or all steps in any disclosed method or process, except for mutually exclusive features and / or steps, can be combined and / or extended and / or replaced in any manner.

[0037] In view of the technical problems in the background, the inventors of the present application proposed a solution after creative thinking. In the concept of the present invention, the concept of iterative linear block codes is first proposed. For any linear code [n, k], if there exists a k-order matrix M such that the generator matrix of the linear code [n, k] where denotes the ceiling function, [[ ]] n denotes the matrix composed of the first n column vectors in the matrix, then the linear code [n, k] is called an iterative linear code, and the matrix M is called the iterative generator matrix of this linear code. Obviously, compared with the generator matrix G, the iterative generator matrix M has a smaller scale, is more friendly for engineering implementation, and has a lower implementation cost. However, the key problem is how to ensure that the minimum distance of the iterative linear code is as large as possible. Currently, no relevant research results have been seen in the prior art.

[0038] To solve the technical problems of the large scale of the generating matrix of the known optimal linear code, unfriendly engineering implementation, and high implementation cost, the present invention provides a search method and device for large minimum distance iterative linear codes, which can generate iterative linear codes based on an iterative generating matrix with a smaller scale, having a minimum distance equivalent to that of the optimal linear code, and having the advantages of low implementation cost and low single-round implementation delay. The specific implementation process includes the following steps:

[0039] As Figure 1 shown, a search method for large minimum distance iterative linear codes is provided, specifically including the following steps:

[0040] Step S1: Input the search parameters of the linear code: n and k into the computer device, where n represents the code length, k represents the dimension of the linear code, and their values are all positive integers and satisfy n > k.

[0041] Step S2: Use the computer device to generate a sample search space S with a dimension not less than k.

[0042] Step S3: Use the computer device to randomly search for an iterative generating matrix M in the sample search space S and calculate the minimum distance d of the corresponding linear code.

[0043] Step S4: Use the computer output unit to output the iterative generating matrix M and the minimum distance d of the linear code [n, k].

[0044] Among them, the generation process of the sample search space S in step S2 is as Figure 2 shown, specifically including the following sub-steps:

[0045] Step S2.1: Arbitrarily select a known optimal linear code C 0 =[n 0 , k, d 0 , where the value of the code length n 0 should be a positive integer and satisfy n ≤ n 0 ≤ 2n, and the minimum distance d 0 is the maximum minimum distance in the known linear code [n 0 , k].

[0046] Step S2.2: Calculate the generating matrix G 0 of the optimal linear code C 0 .

[0047] Step S2.3: Delete the column vectors with Hamming weight 0 and 1 in the matrix G 0 . The remaining column vectors form the sample search space S, that is, S = {v|v ∈ G 0 , hw(v)>1}, where v ∈ G 0 means the matrix G 0For any column vector v, hw(v) represents the Hamming weight of vector v, that is, the number of non-zero elements.

[0048] Step S2.4: Calculate the size |S| of the sample search space S.

[0049] Step S2.5: If |S| ≥ k, then S is the generated sample search space with a dimension not less than k; otherwise, return to Step S2.1.

[0050] The random search process for iteratively generating matrix M in Step S3 is as Figure 3 shown, and specifically includes the following steps:

[0051] Step S3.1: Set the search times threshold N, and calculate the number of iterations where is the ceiling symbol, and the value of N should be a positive integer and satisfy

[0052] Step S3.2: Initialize the code distance d = 0, the search times sn = 0, and the number of non-zero elements of the matrix sum = k 2 .

[0053] Step S3.3: Randomly select k different column vectors v 0 , v 1 ,..., v k-1 in the sample search space S to form matrix M 1 = [v 0 , v 1 ,..., v k-1 .

[0054] Step S3.4: The search times sn = sn + 1.

[0055] Step S3.5: If M 1 is an invertible matrix, calculate matrix Otherwise, return to Step S3.3.

[0056] Step S3.6: Retain the first n column vectors in G 1 , and delete the remaining column vectors to obtain a new k × n matrix G 1 .

[0057] Step S3.7: Calculate the code distance d 1 of the linear code corresponding to the generator matrix G 1 .

[0058] Step S3.8: Calculate the number of non-zero elements sum 1 in matrix M 1 .

[0059] Step S3.9: If d 1 > d, then let M = M 1 , d = d 1 , sum = sum 1 ; If d 1 = d and sum 1 < sum, also let M = M 1 , d = d 1 , sum = sum 1 ; Otherwise, directly execute Step S3.10.

[0060] Step S3.10: If the number of search times sn ≥ N or where "!" represents the factorial operation, the search ends; otherwise, return to Step S3.3.

[0061] In other embodiments of the present invention, a search device for large minimum distance iterative linear codes is further provided. The device includes a processor and a memory. A computer program is stored in the memory, and when the computer program is loaded by the processor, the above method is executed.

[0062] Examples are as follows:

[0063] Taking n = 24 and k = 6 as an example, using the search device provided by the present invention, running the program in the device, searching for the large minimum distance iterative linear code [24,6] in the binary field, and giving its iterative generator matrix M and minimum distance d, specifically including the following process steps:

[0064] Step S1: Input the search parameters of the linear code in the computer device: n = 24 and k = 6, where n represents the code length and k represents the dimension of the linear code.

[0065] Step S2: Use the computer device to generate a sample search space S with a dimension not less than 6. The specific sub-steps are as follows:

[0066] Step S2.1: Let n b = 24, and arbitrarily select an optimal linear code C 0 = [24,6,10] from all known linear codes [24,6], and its minimum distance is d 0 = 10.

[0067] Step S2.2: Calculate the generator matrix of the optimal linear code C 0 :

[0068]

[0069] Step S2.3: Delete the column vectors with Hamming weight 0 and 1 in the matrix G 0 , and the remaining column vectors form the sample search space:

[0070]

[0071] Step S2.4: Calculate the size of the sample search space S, |S| = 17.

[0072] Step S2.5: Since |S| ≥ 6, S is the generated sample search space with a dimension of not less than 6.

[0073] Step S3: Randomly search and iteratively generate matrix M in the sample search space S, and calculate the minimum distance d of its corresponding linear code. The specific sub-steps are as follows:

[0074] Step S3.1: Set the search times threshold N = 4, and calculate the iteration times num = 4.

[0075] Step S3.2: Initialize the minimum distance d = 0, the search times sn = 0, and the number of non-zero elements in the matrix sum = 36.

[0076] The 1st search:

[0077] Step S3.3: Select column vectors in S to form matrix

[0079] Step S3.4: The search times sn = 1.

[0080] Step S3.5: Matrix M 1 is irreversible, return to Step S3.3 to start the 2nd search.

[0081] The 2nd search:

[0082] Step S3.3: Select column vectors in S to form matrix

[0084] Step S3.4: The search times sn = 2.

[0085] Step S3.5: Matrix M 1 is reversible, calculate matrix

[0086]

[0087] Step S3.6: Keep the first 24 column vectors in G 1 , and delete the remaining column vectors, matrix G 1 remains unchanged.

[0088] Step S3.7: Calculate the minimum distance d of the linear code corresponding to the generator matrix G 1 d 1 = 7.

[0089] Step S3.8: Calculate matrix M 1 The number of 1s in it, sum 1 = 20

[0090] Step S3.9: Since d 1 > d, let d = 7, sum = 20

[0091] Step S3.10: Since the current search times sn is less than the threshold 4 and also less than Return to Step S3.3 and start the 3rd search

[0092] The 3rd search:

[0093] Step S3.3: Select column vectors in S to form matrix

[0095] Step S3.4: Search times sn = 3

[0096] Step S3.5: Matrix M 1 is invertible, calculate matrix

[0097]

[0098] Step S3.6: Retain the first 24 column vectors in G 1 Delete the remaining column vectors, and matrix G 1 remains unchanged

[0099] Step S3.7: Calculate the code distance d 1 of the linear code corresponding to the generating matrix G 1 = 10

[0100] Step S3.8: Calculate matrix M 1 The number of 1s in it, sum 1 = 22

[0101] Step S3.9: Since d 1 > d, let d = 10, sum = 22

[0102] Step S3.10: Since the current search times sn is less than the threshold 4 and also less than Return to Step S3.3 and start the 4th search

[0103] The 4th search:

[0104] Step S3.3: Select column vectors in S to form matrix

[0106] Step S3.4, the number of search times sn = 4.

[0107] Step S3.5, matrix M 1 is invertible, calculate the matrix

[0108]

[0109] Step S3.6, retain the first 24 column vectors in G 1 , delete the remaining column vectors, and matrix G 1 remains unchanged.

[0110] Step S3.7, calculate the code distance d 1 corresponding to the linear code generated by the generator matrix G 1 = 10.

[0111] Step S3.8, calculate the number of 1s sum 1 in matrix M 1 = 18.

[0112] Step S3.9, since d 1 = d and sum 1 < sum, let d = 10, sum = 18.

[0113] Step S3.10, since the number of search times sn reaches the threshold 4 at this time, the search ends.

[0114] Step S4, output the iterative generator matrix M of the linear code [24,6] and the code distance d.

[0115] Therefore, after the above 4 searches, a 6-order matrix can be obtained. The iterative linear code [24,6] can be generated by M, and its corresponding generator matrix is:

[0116]

[0117] Its code distance reaches 10. Compared with the known optimal linear code [24,6], their code distances are both 10, reaching the optimal; in terms of implementation, the scale of the generator matrix of the known optimal linear code is 6 rows and 24 columns, and the maximum Hamming weight in the column vectors is 5, while the scale of matrix M is small, only 6 rows and 6 columns, and the maximum Hamming weight in the column vectors is 3. Therefore, generating the linear code [24,6] by matrix M has the advantages of lower implementation cost, lower single-round implementation delay, and higher efficiency.

[0118] As can be seen from the above, the iterative generation matrix of the solution of the present invention is small in scale and low in implementation cost. The generation of linear codes can be realized based on rounds, and the single-round implementation has low latency and high efficiency. The cryptographic device using the present invention has the advantages of low implementation cost and small latency.

[0119] The units involved in the embodiments of the present invention can be implemented in software or in hardware, and the described units can also be provided in a processor. Among them, the names of these units do not constitute a limitation to the units themselves in some cases.

[0120] According to one aspect of the embodiments of the present invention, there is provided a computer program product or a computer program, which includes computer instructions stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the methods provided in the above various optional implementation manners.

[0121] As another aspect, the embodiments of the present invention further provide a computer-readable medium, which may be included in the electronic device described in the above embodiments; or may exist alone without being assembled into the electronic device. The above computer-readable medium carries one or more programs, and when the one or more programs are executed by an electronic device, the electronic device implements the methods described in the above embodiments.

Claims

1. A method for searching for large code distance iterative linear codes, characterized in that: It includes the following steps: S1. Input the search parameters of the linear code: n and k into the computer device, where n represents the code length, k represents the dimension of the linear code, and their values are all positive integers and satisfy n > k; S2. Use the computer device to generate a sample search space S with a dimension not less than k; S3. Randomly search and iteratively generate a matrix M in the sample search space S, and calculate the code distance d of the corresponding linear code; S4. Use the computer output unit to output the iterative generation matrix M and the code distance d of the linear code [n, k].

2. The method for searching for large code distance iterative linear codes according to claim 1, characterized in that: In step S2, the use of the computer device to generate a sample search space S with a dimension not less than k specifically includes the following sub-steps: S2.

1. Arbitrarily select a known optimal linear code C0 = [n0, k, d0], where the code distance d0 is the maximum code distance in the known linear code [n0, k]; S2.

2. Use the computer device to calculate the generation matrix G0 of the optimal linear code C0; S2.

3. Delete the column vectors with Hamming weight 0 and 1 in the matrix G0, and the remaining column vectors form the sample search space S, that is, S = {v|v ∈ G0, hw(v) > 1}, where v ∈ G0 represents any column vector v in the matrix G0, and hw(v) represents the Hamming weight of the vector v, that is, the number of non-zero elements; S2.

4. Use the computer device to calculate the size S of the sample search space S; S2.

5. If S ≥ k, then S is the generated sample search space with a dimension not less than k; otherwise, return to step S2.

1.

3. The method for searching for large code distance iterative linear codes according to claim 1, characterized in that: In step S3, the random search and iterative generation of the matrix M in the sample search space S and the calculation of the code distance d of the corresponding linear code specifically include the following sub-steps: S3.

1. Set the search threshold N and calculate the number of iterations in is the ceiling symbol; S3.2, initialize the code distance d = 0, search times sn = 0, the number of non-zero elements in the matrix sum = k 2 ; S3.3, randomly select k different column vectors v0,v1,...,v in the sample search space S k-1 , forming the matrix M1 = [v0,v1,...,v k-1 ]; S3.

4. The search times sn = sn + 1; S3.

5. If M1 is a reversible matrix, calculate the matrix Otherwise, return to step S3.3; S3.

6. Keep the first n column vectors in G1, delete the remaining column vectors, and obtain a new k × n matrix G1; S3.

7. Calculate the code distance d1 of the linear code corresponding to the generation matrix G1; S3.

8. Calculate the number sum1 of non-zero elements in the matrix M1; S3.

9. If d1 > d, then let M = M1, d = d1, sum = sum1; if d1 = d and sum1 < sum, also let M = M1, d = d1, sum = sum1; otherwise, directly execute step S3.10; S3.10, if the number of searches sn ≥ N or in "!" indicates factorial operation and the search ends; otherwise, return to step S3.

3.

4. The method for searching for large code distance iterative linear codes according to claim 3, characterized in that: In step S2.1, the value of the code length n0 is a positive integer and satisfies n ≤ n0 ≤ 2n.

5. The method for searching for large code distance iterative linear codes according to claim 3, characterized in that: In S3.1, the threshold N is a positive integer and satisfies 6. A search device for large code distance iterative linear codes, characterized in that: It includes a processor and a memory, and a computer program is stored in the memory. When the computer program is loaded and executed by the processor, the method described in any one of claims 1 to 5 is performed.