A Python binding for the RELIC cryptographic library
Project description
petrelic is a Python wrapper around RELIC. It provides a simple python interface to the BLS-381 pairing and RELIC’s big number class. Our goals is to make it easy to prototype new cryptographic applications in Python using RELIC as the backend. In the future we aim to support a few other pairing curves as well.
petrelic provides native, multiplicative and additive interfaces to RELIC. You can use the one that you find most comfortable. petrelic overloads Python’s binary operators to make computation with pairings easy. For example, here is how you would compute and verify a BLS signature using the multiplicative interface:
>>> from petrelic.multiplicative.pairing import G1, G2, GT
>>> sk = G1.order().random()
>>> pk = G2.generator() ** sk
>>> # Create the signature
>>> m = b"Some message"
>>> signature = G1.hash_to_point(m) ** sk
>>> # Verify the signature
>>> signature.pair(G2.generator()) == G1.hash_to_point(m).pair(pk)
True
You can find more information in the documentation.
You can install petrelic on Linux using:
$ pip install petrelic
For full details see the installation documentation.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
File details
Details for the file petrelic-0.1.4-cp39-cp39-manylinux1_x86_64.whl
.
File metadata
- Download URL: petrelic-0.1.4-cp39-cp39-manylinux1_x86_64.whl
- Upload date:
- Size: 1.0 MB
- Tags: CPython 3.9
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e614662b10fff0976a1d3d3c621c526e773c412e104e2bab4cdcc29acbacad9b |
|
MD5 | 5285c7cc64589f4cb777afe682571194 |
|
BLAKE2b-256 | c80c6c9e821a88f3225d1bd7c56fcbdcb7a0f72be5dd6c7d59e94e3621e9c5dc |
File details
Details for the file petrelic-0.1.4-cp38-cp38-manylinux1_x86_64.whl
.
File metadata
- Download URL: petrelic-0.1.4-cp38-cp38-manylinux1_x86_64.whl
- Upload date:
- Size: 1.0 MB
- Tags: CPython 3.8
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 41e3d3a3e5c9d86533343870eaf4c7cf0f3d20164079f712dd8b13c6de2340f1 |
|
MD5 | 4504c573a092e3be318e2a74c5f4cb5c |
|
BLAKE2b-256 | 095de1d22af2854b3734e60d549738a3dccec7dd74b899c378c5ce1c0d3ec9ed |
File details
Details for the file petrelic-0.1.4-cp37-cp37m-manylinux1_x86_64.whl
.
File metadata
- Download URL: petrelic-0.1.4-cp37-cp37m-manylinux1_x86_64.whl
- Upload date:
- Size: 959.1 kB
- Tags: CPython 3.7m
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 89381c015e9c7c0bab3e64a2a46cca7fa6b1dc948edb08efccf0c8250b5d2f7f |
|
MD5 | b4d379475d28409be0b6c445a891ad7d |
|
BLAKE2b-256 | 011c58d39ad7a536c18d9122ea9797f8017da382af5aee5831889a66e466b55a |
File details
Details for the file petrelic-0.1.4-cp36-cp36m-manylinux1_x86_64.whl
.
File metadata
- Download URL: petrelic-0.1.4-cp36-cp36m-manylinux1_x86_64.whl
- Upload date:
- Size: 1.0 MB
- Tags: CPython 3.6m
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 63eb7f6409707d18f490eca3590c0edda96bd27f148c8b77ab1edc265e3d436d |
|
MD5 | 4aeec1b1be0644e286e4038a49000f05 |
|
BLAKE2b-256 | 6d91f4e268cdbf1cd469cf0afafee4b12a31ba1ae6e9f8f636ddc641015d19ba |