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

Uploaded CPython 3.8

petrelic-0.1.2-cp37-cp37m-manylinux1_x86_64.whl (870.3 kB view details)

Uploaded CPython 3.7m

petrelic-0.1.2-cp36-cp36m-manylinux1_x86_64.whl (925.7 kB view details)

Uploaded CPython 3.6m

File details

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

File metadata

  • Download URL: petrelic-0.1.2-cp38-cp38-manylinux1_x86_64.whl
  • Upload date:
  • Size: 927.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.2-cp38-cp38-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 5ed4440a3be97de935e434ffdcbfb7db759cfa96fd024cabddf50e5e19395bc1
MD5 21369c86cd6c90ce0d37573de797c381
BLAKE2b-256 8b83699c5b264d72f8add3124d57409d8037f6e34ee892e445fe613813ac0482

See more details on using hashes here.

File details

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

File metadata

  • Download URL: petrelic-0.1.2-cp37-cp37m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 870.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.2-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 171a71313ec50f398ec749de36714200d75b600d092edf09558185dddc800513
MD5 2f79d1edac8c1248cc198efc474fc0c7
BLAKE2b-256 68737b01f6348a844a814ada1824ee428f102f33ca4bb839063bc8be819ffc49

See more details on using hashes here.

File details

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

File metadata

  • Download URL: petrelic-0.1.2-cp36-cp36m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 925.7 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.2-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 31c4654b19b9948db8b8e3377e06d549e39198a9b010c716c5c7a5edc0773b21
MD5 39bc0fb729955bfcb0b73df4afec0e12
BLAKE2b-256 cf5005d1358b8f1b7b4b1657525761a0a308d3c3aa23653c4b9a780d9f5d2541

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