FLINT3.7.0-dev

fmpz_mat_randntrulike, fmpz_mat_randntrulike2

Synopsis#include <flint/fmpz_mat.h>
void fmpz_mat_randntrulike(fmpz_mat_t mat, flint_rand_t state, flint_bitcnt_t bits, ulong q)source
void fmpz_mat_randntrulike2(fmpz_mat_t mat, flint_rand_t state, flint_bitcnt_t bits, ulong q)source

Sets the square matrix mat of even dimension 2d to a random NTRU-like matrix \begin{pmatrix} I & H \\ 0 & qI \end{pmatrix}, respectively \begin{pmatrix} qI & 0 \\ H & I \end{pmatrix}, where the d \times d block H is circulant, H_{ij} = h_{(i + j) \bmod d}, for a random vector h of signed integers of bits bits. Throws if the matrix is not square of even dimension.

Cite this page

The FLINT team, “fmpz_mat_randntrulike, fmpz_mat_randntrulike2 (fmpz_mat.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/fmpz_mat/fmpz_mat_randntrulike.html (generated 2026-10-20).