# BLS Signatures implementation
[![Build and Test C++, Javascript, and Python](https://github.com/Chia-Network/bls-signatures/actions/workflows/build-test.yaml/badge.svg)](https://github.com/Chia-Network/bls-signatures/actions/workflows/build-test.yaml)
![PyPI](https://img.shields.io/pypi/v/blspy?logo=pypi)
![PyPI - Format](https://img.shields.io/pypi/format/blspy?logo=pypi)
![GitHub](https://img.shields.io/github/license/Chia-Network/bls-signatures?logo=Github)
[![Total alerts](https://img.shields.io/lgtm/alerts/g/Chia-Network/bls-signatures.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/Chia-Network/bls-signatures/alerts/)
[![Language grade: JavaScript](https://img.shields.io/lgtm/grade/javascript/g/Chia-Network/bls-signatures.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/Chia-Network/bls-signatures/context:javascript)
[![Language grade: Python](https://img.shields.io/lgtm/grade/python/g/Chia-Network/bls-signatures.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/Chia-Network/bls-signatures/context:python)
[![Language grade: C/C++](https://img.shields.io/lgtm/grade/cpp/g/Chia-Network/bls-signatures.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/Chia-Network/bls-signatures/context:cpp)
NOTE: THIS LIBRARY IS NOT YET FORMALLY REVIEWED FOR SECURITY
NOTE: THIS LIBRARY WAS SHIFTED TO THE IETF BLS SPECIFICATION ON 7/16/20
Implements BLS signatures with aggregation using [relic toolkit](https://github.com/relic-toolkit/relic)
for cryptographic primitives (pairings, EC, hashing) according to the
[IETF BLS RFC](https://datatracker.ietf.org/doc/draft-irtf-cfrg-bls-signature/)
with [these curve parameters](https://datatracker.ietf.org/doc/draft-irtf-cfrg-pairing-friendly-curves/)
for BLS12-381.
Features:
* Non-interactive signature aggregation following IETF specification
* Works on Windows, Mac, Linux, BSD
* Efficient verification using Proof of Posssesion (only one pairing per distinct message)
* Aggregate public keys and private keys
* [EIP-2333](https://eips.ethereum.org/EIPS/eip-2333) key derivation (including unhardened BIP-32-like keys)
* Key and signature serialization
* Batch verification
* [Python bindings](https://github.com/Chia-Network/bls-signatures/tree/main/python-bindings)
* [Pure python bls12-381 and signatures](https://github.com/Chia-Network/bls-signatures/tree/main/python-impl)
* [JavaScript bindings](https://github.com/Chia-Network/bls-signatures/tree/main/js-bindings)
## Before you start
This library uses minimum public key sizes (MPL). A G2Element is a signature (96 bytes), and a G1Element is a public key (48 bytes). A private key is a 32 byte integer. There are three schemes: Basic, Augmented, and ProofOfPossession. Augmented should be enough for most use cases, and ProofOfPossession can be used where verification must be fast.
## Import the library
```c++
#include "bls.hpp"
using namespace bls;
```
## Creating keys and signatures
```c++
// Example seed, used to generate private key. Always use
// a secure RNG with sufficient entropy to generate a seed (at least 32 bytes).
vector<uint8_t> seed = {0, 50, 6, 244, 24, 199, 1, 25, 52, 88, 192,
19, 18, 12, 89, 6, 220, 18, 102, 58, 209, 82,
12, 62, 89, 110, 182, 9, 44, 20, 254, 22};
PrivateKey sk = AugSchemeMPL().KeyGen(seed);
G1Element pk = sk.GetG1Element();
vector<uint8_t> message = {1, 2, 3, 4, 5}; // Message is passed in as a byte vector
G2Element signature = AugSchemeMPL().Sign(sk, message);
// Verify the signature
bool ok = AugSchemeMPL().Verify(pk, message, signature);
```
## Serializing keys and signatures to bytes
```c++
vector<uint8_t> skBytes = sk.Serialize();
vector<uint8_t> pkBytes = pk.Serialize();
vector<uint8_t> signatureBytes = signature.Serialize();
cout << Util::HexStr(skBytes) << endl; // 32 bytes printed in hex
cout << Util::HexStr(pkBytes) << endl; // 48 bytes printed in hex
cout << Util::HexStr(signatureBytes) << endl; // 96 bytes printed in hex
```
## Loading keys and signatures from bytes
```c++
// Takes vector of 32 bytes
PrivateKey skc = PrivateKey::FromByteVector(skBytes);
// Takes vector of 48 bytes
pk = G1Element::FromByteVector(pkBytes);
// Takes vector of 96 bytes
signature = G2Element::FromByteVector(signatureBytes);
```
## Create aggregate signatures
```c++
// Generate some more private keys
seed[0] = 1;
PrivateKey sk1 = AugSchemeMPL().KeyGen(seed);
seed[0] = 2;
PrivateKey sk2 = AugSchemeMPL().KeyGen(seed);
vector<uint8_t> message2 = {1, 2, 3, 4, 5, 6, 7};
// Generate first sig
G1Element pk1 = sk1.GetG1Element();
G2Element sig1 = AugSchemeMPL().Sign(sk1, message);
// Generate second sig
G1Element pk2 = sk2.GetG1Element();
G2Element sig2 = AugSchemeMPL().Sign(sk2, message2);
// Signatures can be non-interactively combined by anyone
G2Element aggSig = AugSchemeMPL().Aggregate({sig1, sig2});
ok = AugSchemeMPL().AggregateVerify({pk1, pk2}, {message, message2}, aggSig);
```
## Arbitrary trees of aggregates
```c++
seed[0] = 3;
PrivateKey sk3 = AugSchemeMPL().KeyGen(seed);
G1Element pk3 = sk3.GetG1Element();
vector<uint8_t> message3 = {100, 2, 254, 88, 90, 45, 23};
G2Element sig3 = AugSchemeMPL().Sign(sk3, message3);
G2Element aggSigFinal = AugSchemeMPL().Aggregate({aggSig, sig3});
ok = AugSchemeMPL().AggregateVerify({pk1, pk2, pk3}, {message, message2, message3}, aggSigFinal);
```
## Very fast verification with Proof of Possession scheme
```c++
// If the same message is signed, you can use Proof of Posession (PopScheme) for efficiency
// A proof of possession MUST be passed around with the PK to ensure security.
G2Element popSig1 = PopSchemeMPL().Sign(sk1, message);
G2Element popSig2 = PopSchemeMPL().Sign(sk2, message);
G2Element popSig3 = PopSchemeMPL().Sign(sk3, message);
G2Element pop1 = PopSchemeMPL().PopProve(sk1);
G2Element pop2 = PopSchemeMPL().PopProve(sk2);
G2Element pop3 = PopSchemeMPL().PopProve(sk3);
ok = PopSchemeMPL().PopVerify(pk1, pop1);
ok = PopSchemeMPL().PopVerify(pk2, pop2);
ok = PopSchemeMPL().PopVerify(pk3, pop3);
G2Element popSigAgg = PopSchemeMPL().Aggregate({popSig1, popSig2, popSig3});
ok = PopSchemeMPL().FastAggregateVerify({pk1, pk2, pk3}, message, popSigAgg);
// Aggregate public key, indistinguishable from a single public key
G1Element popAggPk = pk1 + pk2 + pk3;
ok = PopSchemeMPL().Verify(popAggPk, message, popSigAgg);
// Aggregate private keys
PrivateKey aggSk = PrivateKey::Aggregate({sk1, sk2, sk3});
ok = (PopSchemeMPL().Sign(aggSk, message) == popSigAgg);
```
## HD keys using [EIP-2333](https://github.com/ethereum/EIPs/pull/2333)
```c++
// You can derive 'child' keys from any key, to create arbitrary trees. 4 byte indeces are used.
// Hardened (more secure, but no parent pk -> child pk)
PrivateKey masterSk = AugSchemeMPL().KeyGen(seed);
PrivateKey child = AugSchemeMPL().DeriveChildSk(masterSk, 152);
PrivateKey grandChild = AugSchemeMPL().DeriveChildSk(child, 952)
// Unhardened (less secure, but can go from parent pk -> child pk), BIP32 style
G1Element masterPk = masterSk.GetG1Element();
PrivateKey childU = AugSchemeMPL().DeriveChildSkUnhardened(masterSk, 22);
PrivateKey grandchildU = AugSchemeMPL().DeriveChildSkUnhardened(childU, 0);
G1Element childUPk = AugSchemeMPL().DeriveChildPkUnhardened(masterPk, 22);
G1Element grandchildUPk = AugSchemeMPL().DeriveChildPkUnhardened(childUPk, 0);
ok = (grandchildUPk == grandchildU.GetG1Element();
```
## Build
Cmake 3.14+, a c++ compiler, and python3 (for bindings) are required for building.
```bash
mkdir build
cd build
cmake ../
cmake --build . -- -j 6
```
### Run tests
```bash
./build/src/runtest
```
### Run benchmarks
```bash
./build/src/runbench
```
On a 3.5 GHz i7 Mac, verification takes about 1.1ms per signature, and signing takes 1.3ms.
### Link the library to use it
```bash
g++ -Wl,-no_pie -std=c++11 -Ibls-signatures/depends/relic/include -Ibls-signatures/build/depends/relic/include -Ibls-signatures/src -L./bls-signatures/build/ -l bls yourapp.cpp
```
## Notes on dependencies
We use Libsodium and have GMP as an optional dependency: libsodium gives secure memory
allocation, and GMP speeds up the library by ~ 3x. MPIR is used on Windows via
GitHub Actions instead. To install them, either download them from github and
follow the instructions for each repo, or use a package manager like APT or
brew. You can follow the recipe used to build python wheels for multiple
platforms in `.github/workflows/`.
## Discussion
Discussion about this library and other Chia related development is in the #dev
channel of Chia's [public Keybase channels](https://keybase.io/team/chia_network.public).
## Code style
* Always use vector<uint8_t> for bytes
* Use size_t for size variables
* Uppercase method names
* Prefer static constructors
* Avoid using templates
* Objects allocate and free their own memory
* Use cpplint with default rules
* Use SecAlloc and SecFree when handling secrets
## ci Building
The primary build process for this repository is to use GitHub Actions to
build binary wheels for MacOS, Linux (x64 and aarch64), and Windows and publish
them with a source wheel on PyPi. MacOS ARM64 is supported but not automated
due to a lack of M1 CI runners. See `.github/workflows/build.yml`. CMake uses
[FetchContent](https://cmake.org/cmake/help/latest/module/FetchContent.html)
to download [pybind11](https://github.com/pybind/pybind11) for the Python
bindings and relic from a chia relic forked repository for Windows. Building
is then managed by [cibuildwheel](https://github.com/joerick/cibuildwheel).
Further installation is then available via `pip install blspy` e.g. The ci
builds include GMP and a statically linked libsodium.
## Contributing and workflow
Contributions are welcome and more details are available in chia-blockchain's
[CONTRIBUTING.md](https://github.com/Chia-Network/chia-blockchain/blob/main/CONTRIBUTING.md).
The main branch is usually the currently released latest version on PyPI.
Note that at times bls-signatures/blspy will be ahead of the release version
that chia-blockchain requires in it's main/release version in preparation
for a new chia-blockchain release. Please branch or fork main and then create
a pull request to the main branch. Linear merging is enforced on main and
merging requires a completed review. PRs will kick off a GitHub actions ci
build and analysis of bls-signatures at
[lgtm.com](https://lgtm.com/projects/g/Chia-Network/bls-signatures/?mode=list).
Please make sure your build is passing and that it does not increase alerts
at lgtm.
## Specification and test vectors
The [IETF bls draft](https://datatracker.ietf.org/doc/draft-irtf-cfrg-hash-to-curve/)
is followed. Test vectors can also be seen in the python and cpp test files.
## Libsodium license
The libsodium static library is licensed under the ISC license which requires
the following copyright notice.
>ISC License
>
>Copyright (c) 2013-2020
>Frank Denis \<j at pureftpd dot org\>
>
>Permission to use, copy, modify, and/or distribute this software for any
>purpose with or without fee is hereby granted, provided that the above
>copyright notice and this permission notice appear in all copies.
>
>THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
>WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
>MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
>ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
>WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
>ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
>OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
## GMP license
GMP is distributed under the
[GNU LGPL v3 license](https://www.gnu.org/licenses/lgpl-3.0.html)
## Relic license
Relic is used with the
[Apache 2.0 license](https://github.com/relic-toolkit/relic/blob/master/LICENSE.Apache-2.0)
Raw data
{
"_id": null,
"home_page": "https://github.com/pshenmic/bls-signatures",
"name": "pshenmic-blspy",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": "",
"keywords": "",
"author": "Mariano Sorgente",
"author_email": "mariano@chia.net",
"download_url": "https://files.pythonhosted.org/packages/48/cd/1fff9f585e664e1b5603fa6a2e60c1d68d18be17f63358c4aa1009de6777/pshenmic_blspy-1.3.1.dev2.tar.gz",
"platform": null,
"description": "# BLS Signatures implementation\n\n[![Build and Test C++, Javascript, and Python](https://github.com/Chia-Network/bls-signatures/actions/workflows/build-test.yaml/badge.svg)](https://github.com/Chia-Network/bls-signatures/actions/workflows/build-test.yaml)\n![PyPI](https://img.shields.io/pypi/v/blspy?logo=pypi)\n![PyPI - Format](https://img.shields.io/pypi/format/blspy?logo=pypi)\n![GitHub](https://img.shields.io/github/license/Chia-Network/bls-signatures?logo=Github)\n\n[![Total alerts](https://img.shields.io/lgtm/alerts/g/Chia-Network/bls-signatures.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/Chia-Network/bls-signatures/alerts/)\n[![Language grade: JavaScript](https://img.shields.io/lgtm/grade/javascript/g/Chia-Network/bls-signatures.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/Chia-Network/bls-signatures/context:javascript)\n[![Language grade: Python](https://img.shields.io/lgtm/grade/python/g/Chia-Network/bls-signatures.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/Chia-Network/bls-signatures/context:python)\n[![Language grade: C/C++](https://img.shields.io/lgtm/grade/cpp/g/Chia-Network/bls-signatures.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/Chia-Network/bls-signatures/context:cpp)\n\nNOTE: THIS LIBRARY IS NOT YET FORMALLY REVIEWED FOR SECURITY\n\nNOTE: THIS LIBRARY WAS SHIFTED TO THE IETF BLS SPECIFICATION ON 7/16/20\n\nImplements BLS signatures with aggregation using [relic toolkit](https://github.com/relic-toolkit/relic)\nfor cryptographic primitives (pairings, EC, hashing) according to the\n[IETF BLS RFC](https://datatracker.ietf.org/doc/draft-irtf-cfrg-bls-signature/)\nwith [these curve parameters](https://datatracker.ietf.org/doc/draft-irtf-cfrg-pairing-friendly-curves/)\nfor BLS12-381.\n\nFeatures:\n\n* Non-interactive signature aggregation following IETF specification\n* Works on Windows, Mac, Linux, BSD\n* Efficient verification using Proof of Posssesion (only one pairing per distinct message)\n* Aggregate public keys and private keys\n* [EIP-2333](https://eips.ethereum.org/EIPS/eip-2333) key derivation (including unhardened BIP-32-like keys)\n* Key and signature serialization\n* Batch verification\n* [Python bindings](https://github.com/Chia-Network/bls-signatures/tree/main/python-bindings)\n* [Pure python bls12-381 and signatures](https://github.com/Chia-Network/bls-signatures/tree/main/python-impl)\n* [JavaScript bindings](https://github.com/Chia-Network/bls-signatures/tree/main/js-bindings)\n\n## Before you start\n\nThis library uses minimum public key sizes (MPL). A G2Element is a signature (96 bytes), and a G1Element is a public key (48 bytes). A private key is a 32 byte integer. There are three schemes: Basic, Augmented, and ProofOfPossession. Augmented should be enough for most use cases, and ProofOfPossession can be used where verification must be fast.\n\n## Import the library\n\n```c++\n#include \"bls.hpp\"\nusing namespace bls;\n```\n\n## Creating keys and signatures\n\n```c++\n// Example seed, used to generate private key. Always use\n// a secure RNG with sufficient entropy to generate a seed (at least 32 bytes).\nvector<uint8_t> seed = {0, 50, 6, 244, 24, 199, 1, 25, 52, 88, 192,\n 19, 18, 12, 89, 6, 220, 18, 102, 58, 209, 82,\n 12, 62, 89, 110, 182, 9, 44, 20, 254, 22};\n\nPrivateKey sk = AugSchemeMPL().KeyGen(seed);\nG1Element pk = sk.GetG1Element();\n\nvector<uint8_t> message = {1, 2, 3, 4, 5}; // Message is passed in as a byte vector\nG2Element signature = AugSchemeMPL().Sign(sk, message);\n\n// Verify the signature\nbool ok = AugSchemeMPL().Verify(pk, message, signature);\n```\n\n## Serializing keys and signatures to bytes\n\n```c++\nvector<uint8_t> skBytes = sk.Serialize();\nvector<uint8_t> pkBytes = pk.Serialize();\nvector<uint8_t> signatureBytes = signature.Serialize();\n\ncout << Util::HexStr(skBytes) << endl; // 32 bytes printed in hex\ncout << Util::HexStr(pkBytes) << endl; // 48 bytes printed in hex\ncout << Util::HexStr(signatureBytes) << endl; // 96 bytes printed in hex\n```\n\n## Loading keys and signatures from bytes\n\n```c++\n// Takes vector of 32 bytes\nPrivateKey skc = PrivateKey::FromByteVector(skBytes);\n\n// Takes vector of 48 bytes\npk = G1Element::FromByteVector(pkBytes);\n\n// Takes vector of 96 bytes\nsignature = G2Element::FromByteVector(signatureBytes);\n```\n\n## Create aggregate signatures\n\n```c++\n// Generate some more private keys\nseed[0] = 1;\nPrivateKey sk1 = AugSchemeMPL().KeyGen(seed);\nseed[0] = 2;\nPrivateKey sk2 = AugSchemeMPL().KeyGen(seed);\nvector<uint8_t> message2 = {1, 2, 3, 4, 5, 6, 7};\n\n// Generate first sig\nG1Element pk1 = sk1.GetG1Element();\nG2Element sig1 = AugSchemeMPL().Sign(sk1, message);\n\n// Generate second sig\nG1Element pk2 = sk2.GetG1Element();\nG2Element sig2 = AugSchemeMPL().Sign(sk2, message2);\n\n// Signatures can be non-interactively combined by anyone\nG2Element aggSig = AugSchemeMPL().Aggregate({sig1, sig2});\n\nok = AugSchemeMPL().AggregateVerify({pk1, pk2}, {message, message2}, aggSig);\n```\n\n## Arbitrary trees of aggregates\n\n```c++\nseed[0] = 3;\nPrivateKey sk3 = AugSchemeMPL().KeyGen(seed);\nG1Element pk3 = sk3.GetG1Element();\nvector<uint8_t> message3 = {100, 2, 254, 88, 90, 45, 23};\nG2Element sig3 = AugSchemeMPL().Sign(sk3, message3);\n\n\nG2Element aggSigFinal = AugSchemeMPL().Aggregate({aggSig, sig3});\nok = AugSchemeMPL().AggregateVerify({pk1, pk2, pk3}, {message, message2, message3}, aggSigFinal);\n\n```\n\n## Very fast verification with Proof of Possession scheme\n\n```c++\n// If the same message is signed, you can use Proof of Posession (PopScheme) for efficiency\n// A proof of possession MUST be passed around with the PK to ensure security.\n\nG2Element popSig1 = PopSchemeMPL().Sign(sk1, message);\nG2Element popSig2 = PopSchemeMPL().Sign(sk2, message);\nG2Element popSig3 = PopSchemeMPL().Sign(sk3, message);\nG2Element pop1 = PopSchemeMPL().PopProve(sk1);\nG2Element pop2 = PopSchemeMPL().PopProve(sk2);\nG2Element pop3 = PopSchemeMPL().PopProve(sk3);\n\nok = PopSchemeMPL().PopVerify(pk1, pop1);\nok = PopSchemeMPL().PopVerify(pk2, pop2);\nok = PopSchemeMPL().PopVerify(pk3, pop3);\nG2Element popSigAgg = PopSchemeMPL().Aggregate({popSig1, popSig2, popSig3});\n\nok = PopSchemeMPL().FastAggregateVerify({pk1, pk2, pk3}, message, popSigAgg);\n\n// Aggregate public key, indistinguishable from a single public key\nG1Element popAggPk = pk1 + pk2 + pk3;\nok = PopSchemeMPL().Verify(popAggPk, message, popSigAgg);\n\n// Aggregate private keys\nPrivateKey aggSk = PrivateKey::Aggregate({sk1, sk2, sk3});\nok = (PopSchemeMPL().Sign(aggSk, message) == popSigAgg);\n```\n\n## HD keys using [EIP-2333](https://github.com/ethereum/EIPs/pull/2333)\n\n```c++\n// You can derive 'child' keys from any key, to create arbitrary trees. 4 byte indeces are used.\n// Hardened (more secure, but no parent pk -> child pk)\nPrivateKey masterSk = AugSchemeMPL().KeyGen(seed);\nPrivateKey child = AugSchemeMPL().DeriveChildSk(masterSk, 152);\nPrivateKey grandChild = AugSchemeMPL().DeriveChildSk(child, 952)\n\n// Unhardened (less secure, but can go from parent pk -> child pk), BIP32 style\nG1Element masterPk = masterSk.GetG1Element();\nPrivateKey childU = AugSchemeMPL().DeriveChildSkUnhardened(masterSk, 22);\nPrivateKey grandchildU = AugSchemeMPL().DeriveChildSkUnhardened(childU, 0);\n\nG1Element childUPk = AugSchemeMPL().DeriveChildPkUnhardened(masterPk, 22);\nG1Element grandchildUPk = AugSchemeMPL().DeriveChildPkUnhardened(childUPk, 0);\n\nok = (grandchildUPk == grandchildU.GetG1Element();\n```\n\n## Build\n\nCmake 3.14+, a c++ compiler, and python3 (for bindings) are required for building.\n\n```bash\nmkdir build\ncd build\ncmake ../\ncmake --build . -- -j 6\n```\n\n### Run tests\n\n```bash\n./build/src/runtest\n```\n\n### Run benchmarks\n\n```bash\n./build/src/runbench\n```\n\nOn a 3.5 GHz i7 Mac, verification takes about 1.1ms per signature, and signing takes 1.3ms.\n\n### Link the library to use it\n\n```bash\ng++ -Wl,-no_pie -std=c++11 -Ibls-signatures/depends/relic/include -Ibls-signatures/build/depends/relic/include -Ibls-signatures/src -L./bls-signatures/build/ -l bls yourapp.cpp\n```\n\n## Notes on dependencies\n\nWe use Libsodium and have GMP as an optional dependency: libsodium gives secure memory\nallocation, and GMP speeds up the library by ~ 3x. MPIR is used on Windows via\nGitHub Actions instead. To install them, either download them from github and\nfollow the instructions for each repo, or use a package manager like APT or\nbrew. You can follow the recipe used to build python wheels for multiple\nplatforms in `.github/workflows/`.\n\n## Discussion\n\nDiscussion about this library and other Chia related development is in the #dev\nchannel of Chia's [public Keybase channels](https://keybase.io/team/chia_network.public).\n\n## Code style\n\n* Always use vector<uint8_t> for bytes\n* Use size_t for size variables\n* Uppercase method names\n* Prefer static constructors\n* Avoid using templates\n* Objects allocate and free their own memory\n* Use cpplint with default rules\n* Use SecAlloc and SecFree when handling secrets\n\n## ci Building\n\nThe primary build process for this repository is to use GitHub Actions to\nbuild binary wheels for MacOS, Linux (x64 and aarch64), and Windows and publish\nthem with a source wheel on PyPi. MacOS ARM64 is supported but not automated\ndue to a lack of M1 CI runners. See `.github/workflows/build.yml`. CMake uses\n[FetchContent](https://cmake.org/cmake/help/latest/module/FetchContent.html)\nto download [pybind11](https://github.com/pybind/pybind11) for the Python\nbindings and relic from a chia relic forked repository for Windows. Building\nis then managed by [cibuildwheel](https://github.com/joerick/cibuildwheel).\nFurther installation is then available via `pip install blspy` e.g. The ci\nbuilds include GMP and a statically linked libsodium.\n\n## Contributing and workflow\n\nContributions are welcome and more details are available in chia-blockchain's\n[CONTRIBUTING.md](https://github.com/Chia-Network/chia-blockchain/blob/main/CONTRIBUTING.md).\n\nThe main branch is usually the currently released latest version on PyPI.\nNote that at times bls-signatures/blspy will be ahead of the release version\nthat chia-blockchain requires in it's main/release version in preparation\nfor a new chia-blockchain release. Please branch or fork main and then create\na pull request to the main branch. Linear merging is enforced on main and\nmerging requires a completed review. PRs will kick off a GitHub actions ci\nbuild and analysis of bls-signatures at\n[lgtm.com](https://lgtm.com/projects/g/Chia-Network/bls-signatures/?mode=list).\nPlease make sure your build is passing and that it does not increase alerts\nat lgtm.\n\n## Specification and test vectors\n\nThe [IETF bls draft](https://datatracker.ietf.org/doc/draft-irtf-cfrg-hash-to-curve/)\nis followed. Test vectors can also be seen in the python and cpp test files.\n\n## Libsodium license\n\nThe libsodium static library is licensed under the ISC license which requires\nthe following copyright notice.\n\n>ISC License\n>\n>Copyright (c) 2013-2020\n>Frank Denis \\<j at pureftpd dot org\\>\n>\n>Permission to use, copy, modify, and/or distribute this software for any\n>purpose with or without fee is hereby granted, provided that the above\n>copyright notice and this permission notice appear in all copies.\n>\n>THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\n>WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\n>MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\n>ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n>WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\n>ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\n>OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n\n## GMP license\n\nGMP is distributed under the\n[GNU LGPL v3 license](https://www.gnu.org/licenses/lgpl-3.0.html)\n\n## Relic license\n\nRelic is used with the\n[Apache 2.0 license](https://github.com/relic-toolkit/relic/blob/master/LICENSE.Apache-2.0)\n",
"bugtrack_url": null,
"license": "",
"summary": "BLS signatures in c++ (python bindings)",
"version": "1.3.1.dev2",
"project_urls": {
"Homepage": "https://github.com/pshenmic/bls-signatures"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "f26530c79b105a1d2a349b12601bd784dcbe2ff244ef70028db55357ecdc2860",
"md5": "f55a9e74fc691ffc39bfb5755f875b1f",
"sha256": "682b2b87956e2078e8bb31cf180f74901ceadd22fd1d6a44e39725ca138f705f"
},
"downloads": -1,
"filename": "pshenmic_blspy-1.3.1.dev2-cp312-cp312-macosx_14_0_universal2.whl",
"has_sig": false,
"md5_digest": "f55a9e74fc691ffc39bfb5755f875b1f",
"packagetype": "bdist_wheel",
"python_version": "cp312",
"requires_python": ">=3.7",
"size": 364301,
"upload_time": "2024-01-16T16:44:34",
"upload_time_iso_8601": "2024-01-16T16:44:34.351296Z",
"url": "https://files.pythonhosted.org/packages/f2/65/30c79b105a1d2a349b12601bd784dcbe2ff244ef70028db55357ecdc2860/pshenmic_blspy-1.3.1.dev2-cp312-cp312-macosx_14_0_universal2.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "48cd1fff9f585e664e1b5603fa6a2e60c1d68d18be17f63358c4aa1009de6777",
"md5": "2f074797a43e105a0dbc3565c24742c8",
"sha256": "f27482a9c14f926e3085252e52405f9239e342f68970f1e36ad1398353861a01"
},
"downloads": -1,
"filename": "pshenmic_blspy-1.3.1.dev2.tar.gz",
"has_sig": false,
"md5_digest": "2f074797a43e105a0dbc3565c24742c8",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 7175255,
"upload_time": "2024-01-16T16:44:38",
"upload_time_iso_8601": "2024-01-16T16:44:38.952485Z",
"url": "https://files.pythonhosted.org/packages/48/cd/1fff9f585e664e1b5603fa6a2e60c1d68d18be17f63358c4aa1009de6777/pshenmic_blspy-1.3.1.dev2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-01-16 16:44:38",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "pshenmic",
"github_project": "bls-signatures",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "pshenmic-blspy"
}