BLASter
BLASter is a proof of concept of an LLL-like lattice reduction algorithm that uses:
- parallelization,
- segmentation,
- Seysen's reduction instead of size reduction, and
- a linear algebra library.
Disclaimer
The goal of this software is to showcase speed ups that are possible in lattice reduction software. This software is a proof of concept!
In particular, we do not:
- guarantee the algorithm terminates, nor claim its output is correct on all lattices,
- support lattices with large entries,
- consider issues / PRs that improve efficiency or robustness,
- actively maintain this software.
We do:
- happily answer any questions to explain design choices phrased as: "Why is X done in Y way?". The answer may, in many cases, be: "because it is faster in practice".
- encourage the cryptographic community to build a new robust lattice reduction library incorporating the ideas in this proof of concept.
Requirements
- python3 (3.10 or later)
- Cython version 3.0 or later (installed automatically)
- Python modules:
cysignals numpy setuptools matplotlib(installed automatically) - Eigen3 headers (downloaded automatically during installation)
- OpenMP library (for parallel processing)
- Linux: Usually available by default with GCC
- macOS: Install with
brew install llvm libomp(recommended) or justbrew install libompfor system clang - Windows: Included with MSVC
Optional:
- Python module: virtualenv (for creating a local virtual environment to install python3 modules)
- fplll (for generating q-ary lattices with the
latticegencommand)
Installation
Modern PEP 517 Installation (Recommended)
BLASter now supports modern Python packaging with automatic dependency management:
# Install from source (automatically downloads Eigen3)
pip install -e .
# Or build wheel for distribution
python -m build
macOS Setup (Optional)
For optimal performance on macOS, you can use Homebrew LLVM instead of system clang:
# Install Homebrew LLVM and OpenMP
brew install llvm libomp
# Set environment variables for compilation
export CC=$(brew --prefix llvm)/bin/clang
export CXX=$(brew --prefix llvm)/bin/clang++
# Then install BLASter
pip install -e .
Legacy Building
- Optional: Run
make eigen3to install libeigen3 library in a subdirectory. - Optional: Run
make venvto create a local virtual environment and install the required python3 modules. - Run
maketo compile all the Cython files incore/.
Debugging
- Debug the C++/Cython code with the
libasanandlibubsansanitizers by runningmake cython-gdb. These sanitizers check for memory leaks, out of bounds accesses, and undefined behaviour. - When executing the
src/app.py, preload libasan like this:LD_PRELOAD=$(gcc -print-file-name=libasan.so) src/app.py -pvi INPUTFILE - If you want to run the program with the
gdbdebugger, read the Cython documentation, for more info.
Running
Note: you first need to build the software, see above.
Run the command by e.g. typing ./python3 src/app.py -pvi INPUTFILE.
Add -h for seeing all available command line arguments.
Example
Command: time latticegen q 128 64 20 p | src/app.py -pq.
Expected output:
Profile: [9.38 9.39 9.30 9.28 9.18 ... 4.27 4.33 4.31 4.29 4.35]
Root Hermite factor: 1.020447, ∥b_1∥ = 11906.636
real 0m0,754s
user 0m2,271s
sys 0m0,105s
To run deep-LLL with depth 4, run src/app.py -pq -i {lattice} -d4.
To run progressive BKZ-60 (with 4-deep-LLL) with 1 tours and block size increments of 2, run src/app.py -pq -i {lattice} -b60 -t1 -P2.
Metadata
Release files for blaster-python 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| blaster_python-0.1.1.tar.gz | 46.2 kB | Details |
Built distributions (wheels)
Total release size: 7.8 MB
Release files / blaster_python-0.1.1.tar.gz
| Download URL | blaster_python-0.1.1.tar.gz |
|---|---|
| Size | 46.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7dd0151549ef6e4e7c93a6eb9c29808cec7ce7cb7ec8ba1196f9ecab936ef213
|
|
BLAKE2b-256 checksum How to use checksums |
db54b12d97d393421f39e699d9f062a462492e5846e50ca2ff1b66f58557f99f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / blaster_python-0.1.1-cp313-cp313-win_amd64.whl
| Download URL | blaster_python-0.1.1-cp313-cp313-win_amd64.whl |
|---|---|
| Size | 156.4 kB |
| Tags | CPython 3.13 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
f0c3091f5c6e50a8962a98d5f6351ed8e02eb0274962c39f7c254b0dc5bcc174
|
|
BLAKE2b-256 checksum How to use checksums |
112ff5d36d670330a0e9476faaf489c91af8da169d32af1588eddb78dd3afbbf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / blaster_python-0.1.1-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
| Download URL | blaster_python-0.1.1-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 2.0 MB |
| Tags | CPython 3.13 Linux glibc 2.24+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
f96ddee501e9b1ccf3abca251eb4098f3190f5dc65cacef4eec7a7e0244eee55
|
|
BLAKE2b-256 checksum How to use checksums |
c2edabbeea9f3659938c7e442e04f87a9395c42f6606d9373371bc5be91a8fe7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / blaster_python-0.1.1-cp313-cp313-macosx_15_0_arm64.whl
| Download URL | blaster_python-0.1.1-cp313-cp313-macosx_15_0_arm64.whl |
|---|---|
| Size | 412.8 kB |
| Tags | CPython 3.13 macOS 15.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
1f332b611eb2cfaba5af00f2ce90c42632f790b689c26b02dd478e4afa495fe8
|
|
BLAKE2b-256 checksum How to use checksums |
138e0cf2648914b60a11edb32e9f0c4b923dd7ec67c57a6b70fbfa21488198d2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / blaster_python-0.1.1-cp312-cp312-win_amd64.whl
| Download URL | blaster_python-0.1.1-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 156.7 kB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
0b82eb2bf2f2f4d6320d8d3137fb6d5707e757413e50e5bb1d76701168c41fb5
|
|
BLAKE2b-256 checksum How to use checksums |
613e5ec92fa8b557bc43482d9538e6d4c5cbbdde552d19f9c482ab51aa2a3ae1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / blaster_python-0.1.1-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
| Download URL | blaster_python-0.1.1-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 2.0 MB |
| Tags | CPython 3.12 Linux glibc 2.24+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
ca27eb7fcdc645ad46f0f9cc5bc3216000c1c3f6357262aafd0b361c570db26e
|
|
BLAKE2b-256 checksum How to use checksums |
f96de9b68a2413e61cbe5af98cec9e92be968f1aae6c8d5ce0176f0a3ae30cac
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / blaster_python-0.1.1-cp312-cp312-macosx_15_0_arm64.whl
| Download URL | blaster_python-0.1.1-cp312-cp312-macosx_15_0_arm64.whl |
|---|---|
| Size | 413.7 kB |
| Tags | CPython 3.12 macOS 15.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
e1c6ef0cd1a1820759dc78773224ef8751b85d2e377ab13669b33cc3d3f88f87
|
|
BLAKE2b-256 checksum How to use checksums |
bdd596d6b545de7f8a34c2d3e887dc0ea178d5321df1e5cc902e40671fc3ead5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / blaster_python-0.1.1-cp311-cp311-win_amd64.whl
| Download URL | blaster_python-0.1.1-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 157.3 kB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
b03e202f4e5d51ba0d503e7efe428b6835d82335767aae3c44eff9b11f471ddf
|
|
BLAKE2b-256 checksum How to use checksums |
dc3fecc8848163a07cbfc09cc950439f2c407c88662396a15ce2c479051ee8c4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / blaster_python-0.1.1-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
| Download URL | blaster_python-0.1.1-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 2.0 MB |
| Tags | CPython 3.11 Linux glibc 2.24+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
a8ecd86a7b6eee18014d42e9c0ee942a08f55da47b60f04485b2efea9499773c
|
|
BLAKE2b-256 checksum How to use checksums |
8b7f40a6332521561cebca762b0898b5f7125201b3bfc3a8c6f6fbf3c67a3ed7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / blaster_python-0.1.1-cp311-cp311-macosx_15_0_arm64.whl
| Download URL | blaster_python-0.1.1-cp311-cp311-macosx_15_0_arm64.whl |
|---|---|
| Size | 413.5 kB |
| Tags | CPython 3.11 macOS 15.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
2651af65825a43e426f5bd549b409c4a7bde08aa01f4bd488ac4f9bdc1bee5fb
|
|
BLAKE2b-256 checksum How to use checksums |
49a80f1a86476e29ab1c872507f645936e140803e478ecb66cea6b72e7d0ad8f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|