Abstract
Random integer lattices are fundamental to lattice-based cryptography and algorithmic number theory. A new random integer lattice model, free of any restrictions on the Hermite Normal Form (HNF), was introduced by in 2016. It was also observed that the probability of such a lattice being in a simple HNF form is approximately 44%. In this paper, the gap between general random integer lattices and those in a simple HNF is bridged by introducing the concept of the -simple random integer lattice, where the first k diagonal entries of the HNF are fixed to 1. We derive the asymptotic counting formula for such lattices and compute their density among all integer lattices. Furthermore, a generation algorithm for the -simple random integer lattice based on rejection sampling and inverse sampling methods are proposed, with the analysis showing that it achieves expected running time. This work provides a theoretical foundation and practical toolkit for constructing structured random lattices with controlled HNF forms.
Keywords: (n,k)-simple; HNF; random integer lattice; rejection sampling method
1. Introduction
The study of random integer lattices is significant in computational number theory and cryptography, particularly in the analysis of lattice-based cryptographic primitives such as NTRU [1], LWE [2], and their variants [3,4]. A challenge in this area lies in understanding the distribution of lattice bases and their associated Hermite Normal Form (HNF), which offers a unique normal form for integer lattices [5]. HNF has been studied to some extent in algorithmic number theory. Early work by Kannan and Bachem [6] established polynomial-time algorithms for HNF computation, while subsequent research by Micciancio and Warinschi [7] explored its applications in cryptography. The probabilistic properties of HNF have attracted considerable attention, with studies on the distribution of diagonal entries and their statistical behavior [8].
The problem of generating random lattices has been studied from multiple perspectives. Goldstein and Mayer [9] studied the distribution of lattice determinants and related arithmetic functions, laying the foundation for probabilistic models of lattices. Concerning HNF of integer matrices, Maze [10] explored their natural density distribution. Then the enumeration of integer lattices with a bounded determinant was systematically studied by Hu et al. [11] and later refined in [12] on the generation algorithm, providing the theoretical basis for random lattice models. Especially in [11], the analysis revealed that a significant proportion—approximately 44% of such random lattices—already exhibit a simple HNF structure, where the diagonal entries are all 1 but the last one. However, this observation raises a natural question: what is the precise probability that an HNF has its first k diagonal entries equal to 1, and how can such structured lattices be generated efficiently?
When cryptographic applications are considered, the generation of random lattices with specific properties has become increasingly important. The NTRU cryptosystem [1] relies on lattices with special algebraic structures, while LWE-based schemes [2] often require random lattices with controlled parameters. Later works on efficient lattice trapdoors [13], Ring-LWE toolkit [14], FHE based on LWE and NTRU [15], and lattice-based obfuscation [16] have further emphasized the need for efficient and flexible lattice generation methods. Meanwhile, to assess the security of lattice-based cryptosystems, algorithms like LLL [17] and BKZ [18,19] are commonly employed. Since both cryptographic constructions and the corresponding lattice reduction algorithms operate on integer lattices, which are discrete subgroups of , the question of how to properly define and randomly generate such lattices is of great importance. Once a method for generating random integer lattices is constructed, it can be employed to supply random inputs to lattice algorithms, thereby allowing their average performance characteristics to be evaluated.
In this paper, we formalize the notion of -simple HNF, defined as an HNF whose first k diagonal entries are 1. This definition fills the gap between the general random integer lattice model and the special case of simple HNF considered in [11]. We study the asymptotic enumeration of such lattices and derive closed-form expressions for their density among all integer lattices. Our results generalize the earlier findings and provide a unified framework for analyzing HNF-restricted random lattices. For example, the well-known NTRU lattice, derived from the public key polynomial in NTRU cryptosystem, has the basis matrix of the form where denotes the identity matrix, q is the modulus, and H is an circulant matrix generated by the degree-N polynomial with small integer coefficients. The security of NTRU cryptosystem lies in the hardness of finding the private key, which is some short vector in the lattice . To be more specific, we consider a concrete tiny instance of NTRU. Let and the modulus ; suppose that the circulant matrix H is given by
where H corresponds to the ideal generated by the polynomial (matching the first row (1,1,0,1) of the matrix) in the ring ; then the corresponding NTRU lattice basis matrix is an matrix constructed as
Since is already in upper triangular form with positive diagonal entries, and the upper triangular entries satisfy for , while the first diagonal entries are 1, this specific basis represents an exact -simple HNF and the corresponding integer lattice. This framework can be used to rigorously evaluate the average-case performance of lattice reduction algorithms on this structured family by generating uniformly random instances within the controlled -simple HNF space, rather than relying on completely unstructured random integer lattices.
The key advances of this work can be summarized in the following.
The concept of an -simple random integer lattice is introduced and its asymptotic counting formula is established.
The density of such lattices among all integer lattices is derived, expressed in terms of the Riemann zeta function.
An efficient generation algorithm combining rejection sampling and continuous inverse sampling is proposed, with a rigorous analysis of its time complexity.
This paper proceeds as follows. Section 2 recalls the basic notions of lattices and HNF. Section 3 gives the asymptotic counting formula for -simple random integer lattices. Section 4 computes the density of such lattices. Section 5 details a generation algorithm along with its complexity. Section 6 closes with concluding remarks.
2. Preliminaries
Lattice and HNF
Let with and , the lattice spanned by the basis B is
with the i-th row of B. The lattice has rank m. When , the lattice is called full-rank, and the lattice determinant is defined as . In the rest of this paper, all lattices are assumed to be full-rank.
A unimodular matrix satisfies if and only if the two bases B and span the same lattice. Cryptographic schemes usually consider integer lattices, meaning their basis matrices have entries in rather than . Hence, the space of all full-rank integer lattices is the quotient .
HNF is a special type of integer matrix used in number theory, whose definition is as follows.
Definition 1
(HNF). An integer matrix is called an HNF when it meets the following criteria:
Upper triangular: for all indices with ;
Positive diagonal: for each i;
Modular reduction: For any off-diagonal entry above the diagonal, it requires that for all .
Now we define a family of special form of HNF, called -simple HNF, which is described below.
Definition 2
(-simple HNF). An integer matrix H is called an -simple HNF if it meets the following criteria:
H is an HNF;
The first k diagonal entries of H, or are 1.
If a random HNF is chosen, most of its diagonal entries will be 1 [11]; therefore, it is necessary to consider the special form of HNF with several 1s on the diagonal.
3. The (n,k)-Simple Random Integer Lattice
It is a classical result that every full-rank integer lattice possesses a unique HNF as its basis [20], and by [11], the random integer lattice is defined by an HNF chosen uniformly from the set , where is large enough, and
Here we generalize this definition to the set of -simple form of the HNF, which is stated as
From [11], we already knew the asymptotic formula for , which is
| (1) |
now we intend to obtain the asymptotic formula for on . First, we need a lemma in [11] that counts the summation of certain power series, which is given below.
Lemma 1
(From [11], Lemma 1). For a given integer and sufficiently large , let be a non-decreasing sequence of non-negative integers satisfying . If the multiple sum is defined as
where is the Riemann zeta function, then the asymptotic expansion of is given as
Using Lemma 1, we can obtain the counting result on , which is shown in Theorem 1.
Theorem 1.
For integer and sufficiently large , the value of can be estimated asymptotically by
(2)
Proof.
By definition, any should satisfy that H is -simple and is bounded by M. Since the -simple property means that the first k diagonal entries of H are exactly 1, we know that is determined exclusively by , which is represented by the following formula as
By Lemma 1, we obtain
The proof is hereby completed. □
Now we give the definition of -simple random integer lattice as follows.
Definition 3
(-simple random integer lattice). For integer , and the determinant upper bound , if H is selected uniformly from , then is called an -simple random integer lattice.
Remark 1.
It should be pointed out that when , the -simple random integer lattice is exactly the random integer lattice defined in [11].
4. The Density of (n,k)-Simple Integer Lattice
After defining the -simple random integer lattice, the following theorem gives the density of the -simple integer lattice in all of the integer lattices.
Theorem 2.
For integer , and a large enough , when , let H be uniformly chosen from ; then the probability of H being -simple is for .
Proof.
Combing the results from Equations (1) and (2), we obtain the following
implying that when M tends to infinity, the probability of H being -simple is , which completes the proof. □
More clearly, the approximate numerical result on the density of -simple integer lattices from Theorem 2 is shown in Table 1, where n is set to for , and k is set to and .
Table 1.
The approximate density of -simple integer lattices among all integer lattices (rounded to five decimal places).
| n | |||||
|---|---|---|---|---|---|
| 8 | 0.99609 | 0.99216 | 0.96145 | 0.76258 | 0.43574 |
| 16 | 0.99998 | 0.99976 | 0.99798 | 0.96074 | 0.43576 |
| 32 | 1.00000 | 0.99999 | 0.99999 | 0.99798 | 0.43576 |
| 64 | 1.00000 | 1.00000 | 1.00000 | 0.99998 | 0.43576 |
| 128 | 1.00000 | 1.00000 | 1.00000 | 1.00000 | 0.43576 |
| 256 | 1.00000 | 1.00000 | 1.00000 | 1.00000 | 0.43576 |
Based on the data presented in Table 1, for a fixed lattice rank n, the density decreases monotonically as k increases, since imposing more diagonal entries equal to 1 introduces stricter structural constraints, thus reducing the number of admissible lattices. In more detail, when k is relatively small compared to n, the density rapidly approaches 1 as n increases. For instance, at , the density rises from approximately for to almost for . This indicates that a random integer lattice with high rank almost surely satisfies the condition that the first k diagonal entries of its HNF are equal to 1. Moreover, when , the density stabilizes at approximately and exhibits nearly no dependence on n. This limiting value coincides with the theoretical constant .
5. The Generation Algorithm of (n,k)-Simple Random Integer Lattice
Since in [12], the authors proposed an algorithm aimed at generating a random integer lattice, in this part, we generalize this algorithm to the -simple random integer lattice for .
5.1. Rejection Sampling and Inverse Sampling
To illustrate this algorithm clearly, we first need two fundamental techniques from probability theory: rejection sampling and continuous inverse sampling. When dealing with a distribution D that is defined on a set A, these methods can produce a random variable that adheres precisely to D. The following two theorems outline these two standard sampling methods respectively. For rigorous proofs and detailed theoretical foundations, we refer the reader to [21] and [22], respectively.
Theorem 3
(Rejection Sampling, from [21]). Suppose D is a distribution defined on a set A with its density function , is another distribution with proposal density function . Let C be a constant s.t. for all x. Then iteratively do the following: Sample and ; if , reject and repeatedly sample x and u; otherwise accept and output x. Finally, the output x then follows the target distribution D.
Theorem 4
(Inverse Sampling, from [22]). Let D be a distribution defined over a set A with a cumulative distribution function F. Sample and compute x satisfying . Then the random variable x follows the target distribution D.
5.2. Generating the (n,k)-Simple Random Integer Lattice
As discussed in Section 2 and Section 3, an integer lattice has a unique HNF. Since an -simple random integer lattice has the first k diagonal entries , its leading principal submatrix has already been determined to be . The remaining generation process consists of three stages. First, the diagonal entries are generated. Second, the final diagonal entry is generated. Third, all off-diagonal entries are chosen. The resulting matrix H is then output as the basis matrix for the -simple random integer lattice.
5.2.1. Generating the Diagonal Entries
In this part, to generate the diagonal entries , the distribution of these variables should be obtained. The joint distribution of is described below.
Theorem 5.
Given the lattice rank and the upper bound of the lattice determinant , if is an -simple random integer lattice with , then for , when , for , it can be obtained that
Proof.
Since the diagonal entries have been set to respectively, the only free variable to do summation is the last diagonal entry . From Lemma 1, we know that
which completes the proof. □
Moreover, the distribution of each value of is stated below.
Theorem 6.
Consider an integer lattice of rank with a prescribed upper bound on its determinant. If is an -simple random integer lattice with , then for , when , for each , it can be derived that
Proof.
Since only one diagonal entry has been determined, the summation is for the remaining variables. By Lemma 1, we have
The proof is concluded. □
Remark 2.
Combining the above two theorems, we know that for sufficiently large , the joint distribution of is exactly the product of the distribution of each variable, which implies that these values can be viewed as independent variables.
Since the distributions of have been computed, the rejection sampling method can be utilized to generate them sequentially.
From Theorem 6, consider the distribution of , if is defined as
| (3) |
then the distribution of is actually .
To generate random variates following the distribution , we employ the rejection sampling method. Since the target distribution has the density function as in Equation (3), we choose the proposal distribution over with density
It could be verified that sampling from can be achieved by the simple transformation , with . Indeed, for any , we have
Moreover, the maximum of is attained at , which implies the constant C can be set to . Thus the procedure of generating can be designed as follows.
Choose and compute ;
Set , compute and ;
Choose ; when , reject and repeat from step 1; otherwise, accept and set .
5.2.2. Generating the Last Diagonal Entry
The case of generating the last diagonal entry is different. Let d be the product of all diagonal entries except the last. Using the technique in [12], we can similarly obtain Theorem 7.
Theorem 7.
For rank and sufficiently large determinant upper bound , given an -random integer lattice with its HNF is and , we have
Sketch of the Proof.
The proof consists of two main parts: deriving the mathematical expectation of d using the HNF counting lemma, and then applying Markov’s inequality to establish the probability upper bound.
For the first part, the expected value of the product of the first diagonal elements is formulated as
where represents the number of -dimensional HNFs with determinant t, and is the total number of -simple HNFs with determinants upper bounded by M.
Expanding the numerator by using the HNF counting formula yields a multi-variable summation. This allows us to map both the numerator and the denominator directly to the asymptotic sums defined in Lemma 1 as
According to the asymptotic formulas provided in Lemma 1, we have
Dividing the above expressions yields
This completes the first part of the proof.
For the second part, since is a product of positive diagonal entries, it is strictly a non-negative random variable. Markov’s inequality can be applied here, which states that for any non-negative random variable X and a constant , it holds that
By setting the random variable d and assigning the threshold parameter , we obtain the following tail probability bound as
which completes the second part of the proof. □
Theorem 7 shows that is typically much smaller than M, which implies that is still sufficiently large. Since the value range for is large, we can use the inverse sampling method to obtain by providing a reasonable characterization of the distribution of . Consequently, for an -simple random integer lattice basis , the distribution of can be represented as
| (4) |
which is actually a truncated discrete power-law distribution. Thus the distribution of in an -simple random integer lattice is actually where . After computing its cumulative distribution function , we know that the following is a reasonable estimation of by considering the main terms as
Since the function can be easily inverted, we can design the process of generating as follows by the inverse sampling method.
Choose ;
Compute x s.t. , and set .
Since the first k diagonal entries of -simple HNF are 1, and the generation of the off-diagonal entries is easy, we can now propose the main generation algorithm for the -simple random integer lattice.
5.3. Detailed Algorithm Description
After the discussion in Section 5.2, the detailed generation algorithm of -simple random integer lattice is listed as Algorithm 1.
| Algorithm 1 Construction of an -simple random integer lattice |
| Require: lattice rank n, lattice determinant bound M, and |
| Ensure: An -simple random integer lattice with |
| Phase 1: Diagonal entries |
| for to do |
| repeat |
| Sample and set |
| Compute acceptance probability with |
| Draw |
| until |
| end for |
| Phase 2: Final diagonal |
| Sample |
| Phase 3: Off-diagonal entries |
| for to n do |
| for to do |
| end for |
| for to n do |
| end for |
| end for |
| Phase 4: Output |
| Construct , return |
5.4. Running Time Analysis of Algorithm 1
When analyzing the time complexity, notice that the time spent in Phase 2 and Phase 3 is obviously and , respectively. Thus, the remaining task is to assess the repetition times in the repeat loop of Phase 1. In fact, the following theorem states the result.
Theorem 8.
For lattice rank n and the parameter , in each repeat loop of Algorithm 1, the expected number of iterations is bounded by 2.
Proof.
Since within the repeat loop, the rejection sampling method is used, for , we obtain that
which completes the proof. □
By Theorem 8, since the expected number of iterations does not exceed 2, the expected total number of iterations within Phase 1 is bounded by , which is . Thus, we have the following assessment of the time complexity of this algorithm.
Theorem 9.
For lattice rank n and the parameter , Algorithm 1 runs in expected time on average.
6. Conclusions
In this work, the special -simple HNF is first discussed; then the corresponding -simple random integer lattice is defined and studied. Moreover, the probability result of the diagonal entries is utilized to construct the generation algorithm of -simple random integer lattices. Finally, it is estimated that the generation algorithm takes time on average. However, an open problem to study in the future is the investigation of the distribution and density of random integer lattices whose HNF diagonal entries are restricted to specific prime powers, or whose off-diagonal entries satisfy certain linear congruence constraints. Exploring these structured variations would provide deeper insights into the random models required for Module-LWE and Ring-LWE variants in lattice-based cryptography.
Informed Consent Statement
Not applicable.
Data Availability Statement
No new data were created.
Conflicts of Interest
The author declares no conflicts of interest.
Funding Statement
This research was funded by the national natural science foundation of China under grant number 61602143.
Footnotes
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.
References
- 1.Hoffstein J., Pipher J., Silverman J.H. Proceedings of the International Algorithmic Number Theory Symposium. Springer; Berlin/Heidelberg, Germany: 1998. NTRU: A ring-based public key cryptosystem; pp. 267–288. [Google Scholar]
- 2.Regev O. On lattices, learning with errors, random linear codes, and cryptography. J. ACM. 2009;56:1–40. doi: 10.1145/1568318.1568324. [DOI] [Google Scholar]
- 3.Peikert C. A decade of lattice cryptography. Found. Trends Theor. Comput. Sci. 2016;10:283–424. doi: 10.1561/0400000074. [DOI] [Google Scholar]
- 4.Lyubashevsky V., Peikert C., Regev O. Proceedings of the Annual International Conference on the Theory and Applications of Cryptographic Techniques. Springer; Berlin/Heidelberg, Germany: 2010. On ideal lattices and learning with errors over rings; pp. 1–23. [Google Scholar]
- 5.Joux A. Algorithmic Cryptanalysis. Chapman and Hall/CRC; Boca Raton, FL, USA: 2009. [Google Scholar]
- 6.Kannan R., Bachem A. Polynomial algorithms for computing the Smith and Hermite normal forms of an integer matrix. SIAM J. Comput. 1979;8:499–507. doi: 10.1137/0208040. [DOI] [Google Scholar]
- 7.Micciancio D., Warinschi B. A linear space algorithm for computing the Hermite normal form; Proceedings of the 2001 International Symposium on Symbolic and Algebraic Computation; London, ON, Canada. 18–21 July 2001; pp. 231–236. [Google Scholar]
- 8.Odlyzko A.M. Asymptotic enumeration methods. Handb. Comb. 1995;2:1229. [Google Scholar]
- 9.Goldstein D., Mayer A. On the equidistribution of Hecke points. Forum Math. 2003;15:165. doi: 10.1515/form.2003.009. [DOI] [Google Scholar]
- 10.Maze G. Natural density distribution of Hermite normal forms of integer matrices. J. Number Theory. 2011;131:2398–2408. doi: 10.1016/j.jnt.2011.06.010. [DOI] [Google Scholar]
- 11.Hu G., Pan Y., Liu R., Chen Y. On random nonsingular Hermite Normal Form. J. Number Theory. 2016;164:66–86. doi: 10.1016/j.jnt.2015.12.004. [DOI] [Google Scholar]
- 12.Hu G., You L., Li L., Hu L., Wang H. Random Integer Lattice Generation via the Hermite Normal Form. Entropy. 2021;23:1509. doi: 10.3390/e23111509. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 13.Micciancio D., Peikert C. Proceedings of the Annual International Conference on the Theory and Applications of Cryptographic Techniques. Springer; Berlin/Heidelberg, Germany: 2012. Trapdoors for lattices: Simpler, tighter, faster, smaller; pp. 700–718. [Google Scholar]
- 14.Lyubashevsky V., Peikert C., Regev O. Proceedings of the Annual International Conference on the Theory and Applications of Cryptographic Techniques. Springer; Berlin/Heidelberg, Germany: 2013. A toolkit for ring-LWE cryptography; pp. 35–54. [Google Scholar]
- 15.Bonte C., Iliashenko I., Park J., Pereira H.V., Smart N.P. Proceedings of the International Conference on the Theory and Application of Cryptology and Information Security. Springer; Berlin/Heidelberg, Germany: 2022. FINAL: Faster FHE instantiated with NTRU and LWE; pp. 188–215. [Google Scholar]
- 16.Cini V., Lai R.W., Woo I.K. Proceedings of the Annual International Cryptology Conference. Springer; Berlin/Heidelberg, Germany: 2025. Lattice-based obfuscation from NTRU and Equivocal LWE; pp. 39–72. [Google Scholar]
- 17.Lenstra A., Lenstra H., Jr., Lovász L. Factoring Polynomials with Rational Coefficients. Math. Ann. 1982;261:515–534. doi: 10.1007/BF01457454. [DOI] [Google Scholar]
- 18.Schnorr C.P., Euchner M. Lattice basis reduction: Improved practical algorithms and solving subset sum problems. Math. Program. 1994;66:181–199. doi: 10.1007/BF01581144. [DOI] [Google Scholar]
- 19.Chen Y., Nguyen P.Q. Proceedings of the International Conference on the Theory and Application of Cryptology and Information Security. Springer; Berlin/Heidelberg, Germany: 2011. BKZ 2.0: Better lattice security estimates; pp. 1–20. [Google Scholar]
- 20.Cohen H. A Course in Computational Algebraic Number Theory. Springer Science & Business Media; Berlin/Heidelberg, Germany: 2013. [Google Scholar]
- 21.Forsythe G.E. Von Neumann’s comparison method for random sampling from the normal and other distributions. Math. Comput. 1972;26:817–826. doi: 10.1090/s0025-5718-1972-0315863-9. [DOI] [Google Scholar]
- 22.Devroye L. Nonuniform random variate generation. Handb. Oper. Res. Manag. Sci. 2006;13:83–121. [Google Scholar]
Associated Data
This section collects any data citations, data availability statements, or supplementary materials included in this article.
Data Availability Statement
No new data were created.
