How to use the bls-wasm.PublicKey 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 groupsVvec = dkg.addVerificationVectors(vvecs)

    // derive the public key for each id from there secert key share
    const groupsPks = []
    ids.forEach((id, i) => {
      const pk = new bls.PublicKey()
      pk.share(groupsVvec, id)
      groupsPks.push(pk)

      const sk = groupsSks[i]
      const pk2 = sk.getPublicKey()
      const equal = pk.isEqual(pk2)
      t.true(equal, 'public key derived from groups vvec should equal pk from secert share')
    })

    const groupsPk = new bls.PublicKey()
    groupsPk.recover(groupsPks.slice(0, threshold), ids.slice(0, threshold))
    const equal = groupsPk.isEqual(groupsVvec[0])
    t.true(equal, 'groups public key should equal pk derived from pk shares')
    t.end()
  })
})
github dfinity-side-projects / dkg / test / index.js View on Github external
ids.forEach((id, i) => {
      const pk = new bls.PublicKey()
      pk.share(groupsVvec, id)
      groupsPks.push(pk)

      const sk = groupsSks[i]
      const pk2 = sk.getPublicKey()
      const equal = pk.isEqual(pk2)
      t.true(equal, 'public key derived from groups vvec should equal pk from secert share')
    })

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