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
Hashes for petrelic-0.1.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8d30c6474955dd816403495a463383fe81c3d99669bde8c84e472dc877a8c69f |
|
MD5 | b8d771a85aebf6bf497956273a75f4e6 |
|
BLAKE2b-256 | bceb1ae3757fa670f53e0db459c46bc8af2d79c9a909afaf680e197a2e86c2d8 |
Hashes for petrelic-0.1.5-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8a76f8d50a58ed571e03581f4a7641e704047991808ed42a28634ff673299626 |
|
MD5 | 111f7ab8978fe7c4ae0085f0aef0cb6c |
|
BLAKE2b-256 | 88025c75ed083a62577b031f9a9f7c9c3e9bf7a18814c566987e58572011926e |
Hashes for petrelic-0.1.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a3fcf2bdccf0b118ed5d77949ffe74eb012bd3d0f393c8583facafa783217232 |
|
MD5 | 01d55e6c7e684836bd58f957db19355c |
|
BLAKE2b-256 | a9000b48ce5d73fdd8403f2433e34f1d84cd5fd6ab4da98ebf849286b25e5978 |
Hashes for petrelic-0.1.5-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ec210a7ec878a1b0dcc6cdfe6bfb20e2f24200c1206a7c66a429929e4f34270e |
|
MD5 | 98a70a79080490f411fd928fbdb405fd |
|
BLAKE2b-256 | 651cf4b73c46af54f33b0637278459de3091157842766a6ead6b3ec0362086b9 |
Hashes for petrelic-0.1.5-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e2f695c95e08c52145b940f1252dcc179238ebc0e21fdb9827b42073b4ecb7eb |
|
MD5 | 1e0b8a95e261a9c591968a54be5bf25f |
|
BLAKE2b-256 | 1e70a991cf0e96320197b6ab14a88d4e8c9e3967fec47bd5faab58c86914ddf2 |
Hashes for petrelic-0.1.5-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c2dde63507d982ca2d90d513dca06b0cef4fdcb5170227ae3463ed37b1180ccd |
|
MD5 | e6a723d4bb5cec93cff7cc4383627011 |
|
BLAKE2b-256 | 9d47e96601b30c867a9439fd3d612c1d1b371944cca44224af8eb8bae3b816aa |
Hashes for petrelic-0.1.5-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 428b10a8cac21ae5971c8025838b6d54d2df4007183b1d291fbdb816b6caff3c |
|
MD5 | 87b4998223df7f56f6307a0559984e40 |
|
BLAKE2b-256 | 1b9a7aa0b3c59edb9e646f5e1b32a071ea5ae886fa060ab2f0fd97008da492ef |
Hashes for petrelic-0.1.5-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bd43acba2677770c8aed24ffbd5babbec62f71de88d5e6a5b7f5b6a0ee7375f2 |
|
MD5 | ad4d326db006fa05f942aedc49787854 |
|
BLAKE2b-256 | 48c8112adf663ff4f2ebd770e2665d3d5e105617b9f9c1a72ca52e133fe40930 |