Product
Introducing Socket Optimize
We're excited to introduce Socket Optimize, a powerful CLI command to secure open source dependencies with tested, optimized package overrides.
bls-signatures
Advanced tools
JavaScript library that implements BLS signatures with aggregation as in Boneh, Drijvers, Neven 2018, using the relic toolkit for cryptographic primitives (pairings, EC, hashing).
This library is a JavaScript port of the Chia Network's BLS lib. We also have typings, so you can use it with TypeScript too!
npm i bls-signatures --save
const blsSignatures = require('bls-signatures')();
blsSignatures.then(() => {
// Instance is loaded and ready to be used
const { PrivateKey } = blsSignatures;
const privateKey = PrivateKey.fromSeed(Uint8Array.from([1,2,3]));
const sig = privateKey.sign(Uint8Array.from(Buffer.from("Hello world!")));
const isValidSignature = sig.verify();
if (isValidSignature) {
// Do stuff...
}
privateKey.delete();
sig.delete();
})
Please refer to the library's typings for detailed API information. Use cases can be found in the original lib's readme.
Important note on usage: Since this library is a WebAssembly port of the c++ library, JavaScript's automatic memory management isn't available. Please, delete all objects manually if they are not needed anymore by calling the delete method on them, as shown in the example above.
Building requires Node.js (with npm) and Emscripten to be installed. The build process is the same as for the c++ lib, with one additional step: pass the Emscripten toolchain file as an option to CMake. From the project root directory, run:
git submodule update --init --recursive
mkdir js_build
cd js_build
cmake ../ -DCMAKE_TOOLCHAIN_FILE={path_to_your_emscripten_installation}/emsdk/emscripten/{version}/cmake/Modules/Platform/Emscripten.cmake
cmake --build . --
Run the build after any changes to the library, including readme and tests, as the library will be deployed from the build directory, and the build system copies all the files from the source dir.
Tests are run in node.js and Firefox, therefore you need to install node.js and Firefox.
To run tests, build the library, then go to the js_bindings
folder in the build directory and run
npm test
FAQs
The most advanced BLS library for JavaScript
The npm package bls-signatures receives a total of 5,421 weekly downloads. As such, bls-signatures popularity was classified as popular.
We found that bls-signatures demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
We're excited to introduce Socket Optimize, a powerful CLI command to secure open source dependencies with tested, optimized package overrides.
Product
We're excited to announce that Socket now supports the Java programming language.
Security News
Socket detected a malicious Python package impersonating a popular browser cookie library to steal passwords, screenshots, webcam images, and Discord tokens.