Skip to content

spring-epfl/petrelic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

author
Laurent Girod
Feb 15, 2022
d921e01 · Feb 15, 2022
Mar 12, 2020
Apr 16, 2020
Feb 14, 2022
May 25, 2020
Apr 6, 2020
Feb 14, 2022
Aug 12, 2019
Apr 7, 2020
Mar 13, 2020
Mar 13, 2020
Mar 17, 2020
Mar 17, 2020
Mar 17, 2020
Mar 17, 2020
Mar 17, 2020
Mar 17, 2020
May 4, 2020
Feb 15, 2022
Feb 15, 2022
Feb 14, 2022
Aug 12, 2019
Mar 17, 2020
Feb 14, 2022

petrelic

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.

Warning

Please don’t use this software for anything mission-critical. It is designed for rapid prototyping of cryptographic primitives using RELIC. We offer no guarantees that the petrelic bindings are secure. We echo RELIC own warning: "RELIC is at most alpha-quality software. Implementations may not be correct or secure and may include patented algorithms. ... Use at your own risk."

About

A python wrapper around RELIC pairings

Resources

License

MIT and 4 other licenses found

Licenses found

MIT
LICENSE
Unknown
LICENSE.GMP
GPL-2.0
LICENSE.GPLv2
LGPL-3.0
LICENSE.LGPLv3
Unknown
LICENSE.RELIC

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published