How to use the mcl-wasm.mul function in mcl-wasm

To help you get started, we’ve selected a few mcl-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 ChainSafe / lodestar / old / index.js View on Github external
    .reduce((acc, val) => mcl.mul(acc, val))
	return ePH.isEqual(mcl.pairing(g1(), signatureG2))
github ChainSafe / lodestar / old / index.js View on Github external
function genPublic (secretKey) {
  const s = mclSecretKey(secretKey)
  const q = g1()
  const key = toBuffer(mcl.mul(q, s));
  key[0] |= 0xa0;
  return key
}
github ChainSafe / lodestar / old / index.js View on Github external
function sign (secretKey, messageHash, domain) {
  const s = mclSecretKey(secretKey)
  const hash = hashToG2(messageHash, domain)
  return toBuffer(mcl.mul(hash, s))
}

mcl-wasm

mcl ; A portable and fast pairing-based cryptography library for Node.js by WebAssembly

BSD-3-Clause
Latest version published 2 months ago

Package Health Score

77 / 100
Full package analysis