How to use the bls-wasm.init function in bls-wasm

To help you get started, we’ve selected a few bls-wasm examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github dfinity-side-projects / dkg / test / index.js View on Github external
const tape = require('tape')
const bls = require('bls-wasm')
const threshold = 4
const dkg = require('../')

bls.init().then(() => {
  tape('dkg', t => {
    // create the ids
    const ids = [0, 1, 2, 3, 4, 5, 6].map(id => {
      const sk = new bls.SecretKey()
      sk.setHashOf(Buffer.from([id]))
      return sk
    })

    // this stores an array of verifcation vectors. One for each ID
    const vvecs = []
    // this stores an array of secertKey contrubutions. One for each ID
    const skContributions = []

    // setup
    ids.forEach(id => {
      const {verificationVector, secretKeyContribution} = dkg.generateContribution(bls, ids, threshold)

bls-wasm

BLS signature for Node.js by WebAssembly

BSD-3-Clause
Latest version published 8 months ago

Package Health Score

53 / 100
Full package analysis