Skip to main content

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

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

Built Distributions

petrelic-0.1.1-cp38-cp38-manylinux1_x86_64.whl (791.7 kB view details)

Uploaded CPython 3.8

petrelic-0.1.1-cp37-cp37m-manylinux1_x86_64.whl (734.6 kB view details)

Uploaded CPython 3.7m

petrelic-0.1.1-cp36-cp36m-manylinux1_x86_64.whl (790.1 kB view details)

Uploaded CPython 3.6m

File details

Details for the file petrelic-0.1.1-cp38-cp38-manylinux1_x86_64.whl.

File metadata

  • Download URL: petrelic-0.1.1-cp38-cp38-manylinux1_x86_64.whl
  • Upload date:
  • Size: 791.7 kB
  • 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.28.1 CPython/3.7.3

File hashes

Hashes for petrelic-0.1.1-cp38-cp38-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 dca7d53f623c00e1bf88aa1871a8ace14b4a7da0a1c23cc4d08bd35997fd731e
MD5 03b1bc76d7040eb38d849412b9210e20
BLAKE2b-256 8d59f0e6fe1899efd607b0134ea8bd5613bc490930ae2e0a63678efd641c909d

See more details on using hashes here.

File details

Details for the file petrelic-0.1.1-cp37-cp37m-manylinux1_x86_64.whl.

File metadata

  • Download URL: petrelic-0.1.1-cp37-cp37m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 734.6 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.28.1 CPython/3.7.3

File hashes

Hashes for petrelic-0.1.1-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 a18001189fd4ae8d3c4e84869ef69cfb2472e3f918ae1c339ac39b88bd7a1f40
MD5 9d189a24926ffefa1b4b95d17fc0ba08
BLAKE2b-256 11d9369045f01cc9941e95fa5398e222f19c50091597ec38202f2dd1b125ecec

See more details on using hashes here.

File details

Details for the file petrelic-0.1.1-cp36-cp36m-manylinux1_x86_64.whl.

File metadata

  • Download URL: petrelic-0.1.1-cp36-cp36m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 790.1 kB
  • 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.28.1 CPython/3.7.3

File hashes

Hashes for petrelic-0.1.1-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 eff993edd4bd6efd56ce3e8ed3b287632a87e0d20105056a74541904e619d35a
MD5 7626ff7bc79a4da6783d614a71d62f02
BLAKE2b-256 46ace0059cc835fa966082f785c1a220b3af7eac1fb853c5912483ac10b34f9e

See more details on using hashes here.

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