How to use tiny-secp256k1 - 10 common examples

To help you get started, we’ve selected a few tiny-secp256k1 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 bitcoinjs / bitcoinjs-lib / test / integration / stealth.js View on Github external
function stealthDualSend (e, R, Q) {
  const eQ = ecc.pointMultiply(Q, e) // shared secret
  const c = bitcoin.crypto.sha256(eQ)
  const Rc = ecc.pointAddScalar(R, c)
  const vG = bitcoin.ECPair.fromPublicKey(Rc)

  return vG
}
github bitcoinjs / bitcoinjs-lib / test / integration / stealth.js View on Github external
function stealthSend (e, Q) {
  const eQ = ecc.pointMultiply(Q, e, true) // shared secret
  const c = bitcoin.crypto.sha256(eQ)
  const Qc = ecc.pointAddScalar(Q, c)
  const vG = bitcoin.ECPair.fromPublicKey(Qc)

  return vG
}
github bitcoinjs / bitcoinjs-lib / test / integration / stealth.js View on Github external
function stealthDualScan (d, R, eG) {
  const eQ = ecc.pointMultiply(eG, d) // shared secret
  const c = bitcoin.crypto.sha256(eQ)
  const Rc = ecc.pointAddScalar(R, c)
  const vG = bitcoin.ECPair.fromPublicKey(Rc)

  return vG
}
github bitcoinjs / bitcoinjs-lib / test / integration / stealth.js View on Github external
function stealthDualReceive (d, r, eG) {
  const eQ = ecc.pointMultiply(eG, d) // shared secret
  const c = bitcoin.crypto.sha256(eQ)
  const rc = ecc.privateAdd(r, c)
  const v = bitcoin.ECPair.fromPrivateKey(rc)

  return v
}
github bitcoinjs / bitcoinjs-lib / test / integration / stealth.js View on Github external
function stealthReceive (d, eG) {
  const eQ = ecc.pointMultiply(eG, d) // shared secret
  const c = bitcoin.crypto.sha256(eQ)
  const dc = ecc.privateAdd(d, c)
  const v = bitcoin.ECPair.fromPrivateKey(dc)

  return v
}
github bitcoinjs / bitcoinjs-lib / test / integration / stealth.js View on Github external
function stealthDualReceive (d, r, eG) {
  const eQ = ecc.pointMultiply(eG, d) // shared secret
  const c = bitcoin.crypto.sha256(eQ)
  const rc = ecc.privateAdd(r, c)
  const v = bitcoin.ECPair.fromPrivateKey(rc)

  return v
}
github bitcoinjs / bitcoinjs-lib / test / integration / stealth.js View on Github external
function stealthDualSend (e, R, Q) {
  const eQ = ecc.pointMultiply(Q, e) // shared secret
  const c = bitcoin.crypto.sha256(eQ)
  const Rc = ecc.pointAddScalar(R, c)
  const vG = bitcoin.ECPair.fromPublicKey(Rc)

  return vG
}
github bitcoinjs / bitcoinjs-lib / test / integration / stealth.js View on Github external
function stealthSend (e, Q) {
  const eQ = ecc.pointMultiply(Q, e, true) // shared secret
  const c = bitcoin.crypto.sha256(eQ)
  const Qc = ecc.pointAddScalar(Q, c)
  const vG = bitcoin.ECPair.fromPublicKey(Qc)

  return vG
}
github bitcoinjs / bitcoinjs-lib / test / integration / stealth.js View on Github external
function stealthReceive (d, eG) {
  const eQ = ecc.pointMultiply(eG, d) // shared secret
  const c = bitcoin.crypto.sha256(eQ)
  const dc = ecc.privateAdd(d, c)
  const v = bitcoin.ECPair.fromPrivateKey(dc)

  return v
}
github bitcoinjs / bitcoinjs-lib / test / integration / stealth.js View on Github external
function stealthRecoverLeaked (v, e, Q) {
  const eQ = ecc.pointMultiply(Q, e) // shared secret
  const c = bitcoin.crypto.sha256(eQ)
  const vc = ecc.privateSub(v, c)
  const d = bitcoin.ECPair.fromPrivateKey(vc)

  return d
}