git ssb

0+

wanderer🌟 / bls-lib



Tree: 3d52efba82dc8e52ef966e62ee1ec48142553bce

Files: 3d52efba82dc8e52ef966e62ee1ec48142553bce / README.md

2023 bytesRaw

NPM Package
Build Status
Coverage Status

js-standard-style

Synopsis

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

Installation

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)
})

Examples

./examples/

API

./docs/

Dependants

Building

First install the dependancies emscripten and ninja

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

License

(C) 2017 DFINITY STIFTUNG

MPL-2.0

image

Built with git-ssb-web