skillfed

fpylll

A Python interface for https://github.com/fplll/fplll

fpylll v0.6.4 102.7K downloads/30d#12,856 on PyPI167
License unclear GNU General Public License, version 2 or later Active released

What it is and what it does

fpylll exposes the fplll lattice reduction library to Python, allowing developers to work with integer matrices and apply reduction algorithms central to computational number theory and cryptanalysis. It provides classes like IntegerMatrix for matrix construction, GSO for Gram-Schmidt orthogonalization, and LLL/BKZ for lattice basis reduction—the core operations needed to solve lattice problems such as finding short vectors or breaking certain cryptographic schemes.

The package is a thin Cython wrapper around C/C++ code, so it depends on external libraries (GMP, MPFR, fplll) being compiled and linked at install time. Pre-built wheels exist for common platforms, but installation can require manual compilation on less common architectures. Once installed, it integrates into the Sage computer algebra system and is available via PyPI and Conda-Forge.

Use it for:

  • Implementing lattice-based cryptanalysis or testing the security of lattice cryptographic schemes.
  • Computing shortest vectors in lattices or solving the shortest vector problem for research.
  • Reducing integer matrix bases for number-theoretic computations in academic or research settings.
  • Prototyping BKZ and LLL algorithms for lattice geometry or optimization research.
  • Integrating lattice reduction into larger computational workflows within Sage or standalone Python.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

fpylll is a Python wrapper for the fplll lattice reduction library, providing access to algorithms like LLL and BKZ for reducing integer matrices and computing Gram-Schmidt orthogonalization.

Yes, if you need lattice reduction algorithms and can satisfy the C/C++ build dependencies. The package is actively maintained, has no known vulnerabilities, and pre-built wheels reduce friction on common platforms. However, the GPL version 2 or later license requires verification against your project's licensing constraints, and the unclear license treatment in metadata warrants explicit confirmation before use in proprietary or restricted-license contexts.

Install

fpylll on PyPI

pip

pip install fpylll

uv

uv add fpylll

poetry

poetry add fpylll

Installing fpylll

Before you install

Medium install friction due to compiled C/C++ dependencies. Requires GMP or MPIR, MPFR, and the fplll library to be built and linked; pre-built wheels are available for common platforms, but manual compilation may be needed on unsupported architectures.

License in practice

Licensed under GNU General Public License, version 2 or later; license treatment is marked unclear in the metadata. Users should verify GPL compatibility with their project before integrating fpylll.

Quickstart

pip install fpylll

from fpylll import IntegerMatrix, GSO, LLL

A = IntegerMatrix(50, 50)
A.randomize("ntrulike", bits=50, q=127)
M = GSO.Mat(A)
M.update_gso()
L = LLL.Reduction(M)
L()

Requires GMP/MPIR, MPFR, and fplll C/C++ libraries to be installed and linked; LD_LIBRARY_PATH may need to be set at runtime to locate shared libraries.

Verify before relying

  • Whether pre-built wheels include all optional features (e.g., QD double-double/quad-double arithmetic support).
  • Exact Python version support range (requires_python is unspecified in metadata).
  • Performance characteristics and scalability limits for large matrices or high-dimensional lattices.
  • Whether multicore support mentioned in the description is fully functional and documented.

Package facts

License GNU General Public License, version 2 or later (unclear)
Python support not specified
Install friction medium — platform-specific wheel
Runtime dependencies none
Maintenance actively maintained — 442 days since the last release
Last repo commit
First released
Downloads 102,671/month — #12,856 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: fpylll-0.6.4-cp310-cp310-macosx_10_9_x86_64.whl; fpylll-0.6.4-cp310-cp310-macosx_11_0_arm64.whl; fpylll-0.6.4-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; fpylll-0.6.4-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl; fpylll-0.6.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; fpylll-0.6.4-cp310-cp310-musllinux_1_2_aarch64.whl; fpylll-0.6.4-cp310-cp310-musllinux_1_2_i686.whl; fpylll-0.6.4-cp310-cp310-musllinux_1_2_x86_64.whl; fpylll-0.6.4-cp311-cp311-macosx_10_9_x86_64.whl; fpylll-0.6.4-cp311-cp311-macosx_11_0_arm64.whl; fpylll-0.6.4-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; fpylll-0.6.4-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl; fpylll-0.6.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; fpylll-0.6.4-cp311-cp311-musllinux_1_2_aarch64.whl; fpylll-0.6.4-cp311-cp311-musllinux_1_2_i686.whl; fpylll-0.6.4-cp311-cp311-musllinux_1_2_x86_64.whl; fpylll-0.6.4-cp312-cp312-macosx_10_13_x86_64.whl; fpylll-0.6.4-cp312-cp312-macosx_11_0_arm64.whl; fpylll-0.6.4-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; fpylll-0.6.4-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl

Tags

lattice reduction pythonLLL algorithm implementationBKZ lattice basis reductioninteger matrix reductionfplll python wrappercryptographic lattice algorithmsGram-Schmidt orthogonalization
lattice-cryptographycomputational-number-theorycompiled-extension

More Mathematics packages