How to use the tweetnacl.sign.detached function in tweetnacl

To help you get started, we’ve selected a few tweetnacl 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 rchain-community / rchain-dbr / o2r / gateway / server / keyPair.js View on Github external
	const signBytes = bytes => sign.detached(bytes, privateKey());
github fidm / x509 / src / pki.ts View on Github external
PrivateKey.addSigner(getOID('Ed25519'), function (this: PrivateKey, data: Buffer): Buffer {
  const key = this.keyRaw
  if (key.length !== 64) {
    throw new Error('Invalid signing key.')
  }
  return Buffer.from(ed25519.detached(data, key))
})
github rchain / rchain-api / signing.js View on Github external
  const signBytes = bytes => sign.detached(bytes, key.secretKey);
github ArcBlock / forge-js / packages / mcrypto / lib / signer / ed25519.js View on Github external
sign(message, sk, encoding = 'hex') {
    const skBytes = toUint8Array(sk);
    const messageBytes = toUint8Array(message);
    const signature = ed25519.detached(messageBytes, skBytes);
    return encode(signature, encoding);
  }