lib/crypto/keyring.js
function verify(rawMsg, rawSig, rawPub) {
  const msg = nacl.util.decodeUTF8(rawMsg);
  const sig = nacl.util.decodeBase64(rawSig);
  const pub = base58.decode(rawPub);
  const m = new Uint8Array(crypto_sign_BYTES + msg.length);
  const sm = new Uint8Array(crypto_sign_BYTES + msg.length);
  let i;
  for (i = 0; i < crypto_sign_BYTES; i++) sm[i] = sig[i];
  for (i = 0; i < msg.length; i++) sm[i+crypto_sign_BYTES] = msg[i];

  // Call to verification lib...
  return naclBinding.verify(m, sm, pub);
}
function verify(rawMsg, rawSig, rawPub) {
  const msg = nacl.util.decodeUTF8(rawMsg);
  const sig = nacl.util.decodeBase64(rawSig);
  const pub = base58.decode(rawPub);
  const m = new Uint8Array(crypto_sign_BYTES + msg.length);
  const sm = new Uint8Array(crypto_sign_BYTES + msg.length);
  let i;
  for (i = 0; i < crypto_sign_BYTES; i++) sm[i] = sig[i];
  for (i = 0; i < msg.length; i++) sm[i+crypto_sign_BYTES] = msg[i];

  // Call to verification lib...
  return naclBinding.verify(m, sm, pub);
}
function verify ( rawMsg , rawSig , rawPub ) { const msg = nacl . util . decodeUTF8 ( rawMsg ) ; const sig = nacl . util . decodeBase64 ( rawSig ) ; const pub = base58 . decode ( rawPub ) ; const m = new Uint8Array ( crypto_sign_BYTES + msg . length ) ; const sm = new Uint8Array ( crypto_sign_BYTES + msg . length ) ; let i ; for ( i = 0 ; i < crypto_sign_BYTES ; i ++ ) sm [ i ] = sig [ i ] ; for ( i = 0 ; i < msg . length ; i ++ ) sm [ i + crypto_sign_BYTES ] = msg [ i ] ; // Call to verification lib... return naclBinding . verify ( m , sm , pub ) ; }
Verify a signature against data & public key.
Return true of false as callback argument.
Verify a signature against data & public key . Return true of false as callback argument .