I Built Neva, a Small Lattice Analysis Toolkit in Python
https://github.com/black-210/neva I started working on a small project called Neva because I wanted to experiment with lattice mathematics without starting with a huge framework. The original idea was pretty simple: Take a lattice, enter its basis vectors, and let the program show me what is happening mathematically. I used Python and NumPy for the first version. What Neva Does Neva currently…
In a small-scale Python project named Neva, the author aimed to explore lattice mathematics without relying on a large framework. The initial concept was straightforward: provide users with the ability to enter a lattice's basis vectors and visualize the mathematical processes at play. Utilizing Python and NumPy, the first iteration of Neva was developed.
Neva's functionality allows users to input a lattice and perform various linear algebra operations, including vector norms, dot products, determinant calculation, angles between vectors, projections, Gram-Schmidt related calculations, eigenvalues, eigenvectors, singular values, and an experimental LLL reduction implementation.
The motivation behind lattices stemmed from their relationship with modern cryptography and post-quantum cryptography. Lattice-based cryptography employs mathematical problems considered difficult for even quantum computers to solve. The author sought to grasp the underlying mathematics of these systems rather than merely using cryptographic libraries as black boxes. Neva serves as an experiment in this area.
One of the first algorithms the author experimented with was LLL. The core idea is to transform a lattice basis into a reduced basis consisting of shorter and more useful vectors. For instance, Neva can take a basis like [105 821] [12 95] and carry out reduction operations on it. However, the author's interest lies not only in the final matrix but also in understanding the intermediate mathematical properties of the lattice.
To keep the codebase manageable, the author chose to rely primarily on NumPy, a library for linear algebra functionality. This approach allows for easy inspection and experimentation, offering a deeper understanding of the program's workings. The main takeaway from building Neva was the connection of mathematical concepts, such as vectors, norms, dot products, projections, Gram-Schmidt process, lattice reduction, and their interrelations.
Looking ahead, the author plans to explore various aspects of lattice analysis, including improving the LLL implementation, BKZ experimentation, solving the Shortest Vector Problem (SVP), Closest Vector Problem (CVP), better lattice visualization, benchmarking reduction algorithms, and more tools for lattice analysis. Additionally, experiments related to post-quantum cryptography are also on the horizon.
While Neva is designed to remain an understandable and manageable project, the author aims to gradually enhance its utility in lattice analysis. The project is available on GitHub as a research and educational tool, not intended for production cryptographic libraries. The author remains committed to expanding Neva's capabilities in the realm of lattice mathematics and its applications.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.