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.0-cp38-cp38-manylinux1_x86_64.whl (776.4 kB view details)

Uploaded CPython 3.8

petrelic-0.1.0-cp37-cp37m-manylinux1_x86_64.whl (719.3 kB view details)

Uploaded CPython 3.7m

petrelic-0.1.0-cp36-cp36m-manylinux1_x86_64.whl (774.8 kB view details)

Uploaded CPython 3.6m

File details

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

File metadata

  • Download URL: petrelic-0.1.0-cp38-cp38-manylinux1_x86_64.whl
  • Upload date:
  • Size: 776.4 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.0-cp38-cp38-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 98f29a8714b1b358cce2e9af52f35070312f24911ed5944d04d1e420a97f8fad
MD5 4069b42e46d326d6c46f4fc6556cb835
BLAKE2b-256 cb166f03aeebd178edec854271d9dced959bb24adce068307f4221a2aff6282d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: petrelic-0.1.0-cp37-cp37m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 719.3 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.0-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 699999c92c7b2959f8219f24e958b05b85fa660d65416de12bd9b2af4f75e487
MD5 39d70dbfef92d9e996cfeab7bc08632e
BLAKE2b-256 3caf67df0b827c29772a75eec7d9d625dc71695834a4a86446e3865b432ddc60

See more details on using hashes here.

File details

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

File metadata

  • Download URL: petrelic-0.1.0-cp36-cp36m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 774.8 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.0-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 a22c76cee552fde971da4fff523b7de8a61310a1e21d27e975ac4caf20ea0a5b
MD5 69260256d095acbe0ad792b047ec549d
BLAKE2b-256 9bf1da03cbfbe2a797968ec39741c63733cf26bacb1b6721f67071f34203a474

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