pybn254
Accelerated operations for BN254 using libff and libfqfft.
Supported operations:
- Multi-exponentiation in G1
- FFT
- Multiply polynomials
Install for pip
pip install pybn254
Build
Install python dependencies
Dependencies:
- py_ecc
Compile native dependencies
MacOS
- Install Homebrew
- Install dependencies -
brew install gmp boost cmake openssl libomp - Go into
libffand runmake all
This should create libff.dylib in the root folder.
Ubuntu
- Install dependencies -
sudo apt-get install build-essential git libboost-all-dev cmake libgmp3-dev libssl-dev pkg-config - Go into
libffand runmake all
This should create libff.so in the root folder.
Test
You can use the following script to test things out:
import pybn254
from py_ecc.optimized_bn128 import add, multiply, pairing
from py_ecc.fields import optimized_bn128_FQ as FQ
p = [(FQ(1), FQ(2), FQ(1))]
e = [5]
p1 = [1, 2, 3]
p2 = [4, 5, 6]
print(pybn254.multiexp(p,e))
# run fft, not an inverse, not on a coset
print(pybn254.fft(p1, False, False))
print(pybn254.multiply_polynomials(p1, p2))
Metadata
Release files for pybn254 1.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pybn254-1.0.5-cp36-cp36m-manylinux1_x86_64.whl | CPython 3.6 | CPython 3.6 pymalloc | Linux glibc 2.5+ x86-64 | Details |
| pybn254-1.0.5-cp36-cp36m-macosx_10_15_x86_64.whl | CPython 3.6 | CPython 3.6 pymalloc | macOS 10.15+ x86-64 | Details |
| pybn254-1.0.5-cp36-cp36m-macosx_10_14_x86_64.whl | CPython 3.6 | CPython 3.6 pymalloc | macOS 10.14+ x86-64 | Details |
Total release size: 6.8 MB
Release files / pybn254-1.0.5-cp36-cp36m-manylinux1_x86_64.whl
| Download URL | pybn254-1.0.5-cp36-cp36m-manylinux1_x86_64.whl |
|---|---|
| Size | 2.3 MB |
| Tags | CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.5+ x86-64 |
|
SHA-256 checksum How to use checksums |
a0cb4c30630264ae14df6531418d120d23b66c218b9cc5f0512462ce620adec7
|
|
BLAKE2b-256 checksum How to use checksums |
f1654285f8d170e82838452e025216a7b65ec572b7d8f65af2e4d3b177cdd430
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.6.0
|
Release files / pybn254-1.0.5-cp36-cp36m-macosx_10_15_x86_64.whl
| Download URL | pybn254-1.0.5-cp36-cp36m-macosx_10_15_x86_64.whl |
|---|---|
| Size | 2.3 MB |
| Tags | CPython 3.6 CPython 3.6 pymalloc macOS 10.15+ x86-64 |
|
SHA-256 checksum How to use checksums |
474f9edab085899112a69451384fb829092fc8ff744b9bb52d32ed7b92b201f8
|
|
BLAKE2b-256 checksum How to use checksums |
bcdd600c1ad68d245a56fdad4b585cd360a17f9734204b5b6b346e50ca5c35f7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.6.0
|
Release files / pybn254-1.0.5-cp36-cp36m-macosx_10_14_x86_64.whl
| Download URL | pybn254-1.0.5-cp36-cp36m-macosx_10_14_x86_64.whl |
|---|---|
| Size | 2.3 MB |
| Tags | CPython 3.6 CPython 3.6 pymalloc macOS 10.14+ x86-64 |
|
SHA-256 checksum How to use checksums |
c983fed4b93afd9684d39ebf760810add683b6cf31d74a4a959f650c1d19cb3a
|
|
BLAKE2b-256 checksum How to use checksums |
c10c043d187cd9069ae5e690df44329227b3663f5ef8478bbca2d1f88a2ae94a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.44.1 CPython/3.6.0
|
Security for pybn254 1.0.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.