git ssb

0+

wanderer🌟 / bls-lib



Tree:
πŸ“„.gitmodules
πŸ“„.travis.yml
πŸ“„LICENSE
πŸ“„README.md
πŸ“benchmark
πŸ“„bls
πŸ“build
πŸ“„cybozulib
πŸ“docs
πŸ“„exportedFuncs.json
πŸ“„index.js
πŸ“„mcl
πŸ“„package-lock.json
πŸ“„package.json
πŸ“„pre.js
πŸ“tests
README.md

SYNOPSIS

NPM Package
Build Status

js-standard-style

This libary provides primitives for creating and verifying BLS threshold signatures. All the hard work is done by herumi/bls. This wraps the bls C++ code which is compiled to Webassembly for easier use.

INSTALL

npm install bls-lib

USAGE


const bls = require('bls-lib')
bls.onModuleInit(() => {
  bls.init()

  const sec = bls.secretKey()
  const pub = bls.publicKey()
  const sig = bls.signature()

  bls.secretKeySetByCSPRNG(sec)
  const msg = 'hello world'
  bls.sign(sig, sec, msg)

  bls.getPublicKey(pub, sec)

  const v = bls.verify(sig, pub, msg)
  // v === true

  bls.free(sec)
  bls.free(sig)
  bls.free(pub)
})

API

./docs/

BUILDING

First install the dependancies emscripten and ninja

 git clone --recursive https://github.com/wanderer/bls-lib.git 
 cd bls-lib/build
 ninja

LICENSE

MPL-2.0)

Built with git-ssb-web