Skip to main content

A Python binding for the RELIC cryptographic library

Project description

Build status Documentation Status Test coverage

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

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

petrelic-0.1.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.0 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

petrelic-0.1.5-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (962.2 kB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ ARM64

petrelic-0.1.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (968.7 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

petrelic-0.1.5-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (962.2 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ ARM64

petrelic-0.1.5-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.0 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

petrelic-0.1.5-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (962.3 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ ARM64

petrelic-0.1.5-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (956.3 kB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.17+ x86-64

petrelic-0.1.5-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (958.7 kB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.17+ ARM64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page