text: shadow$provide.module$node_modules$browserify_sign$browser$verify=function(global,require,module,exports){function checkValue(b,q){if(0>=b.cmpn(0))throw Error("invalid sig");if(b.cmp(q)>=q)throw Error("invalid sig");}var Buffer=require("module$node_modules$safe_buffer$index").Buffer,BN=require("module$node_modules$browserify_sign$node_modules$bn_js$lib$bn"),EC=require("module$node_modules$elliptic$lib$elliptic").ec,parseKeys=require("module$node_modules$parse_asn1$index"),curves=require("module$node_modules$browserify_sign$browser$curves_json");
  module.exports=function(sig,hash,key,signType,tag){key=parseKeys(key);if("ec"===key.type){if("ecdsa"!==signType&&"ecdsa/rsa"!==signType)throw Error("wrong public key type");signType=curves[key.data.algorithm.curve.join(".")];if(!signType)throw Error("unknown curve "+key.data.algorithm.curve.join("."));return(new EC(signType)).verify(hash,sig,key.data.subjectPrivateKey.data)}if("dsa"===key.type){if("dsa"!==signType)throw Error("wrong public key type");signType=key.data.p;tag=key.data.q;var g=key.data.g;
  key=key.data.pub_key;var unpacked=parseKeys.signature.decode(sig,"der");sig=unpacked.s;unpacked=unpacked.r;checkValue(sig,tag);checkValue(unpacked,tag);var montp=BN.mont(signType);sig=sig.invm(tag);return 0===g.toRed(montp).redPow((new BN(hash)).mul(sig).mod(tag)).fromRed().mul(key.toRed(montp).redPow(unpacked.mul(sig).mod(tag)).fromRed()).mod(signType).mod(tag).cmp(unpacked)}if("rsa"!==signType&&"ecdsa/rsa"!==signType)throw Error("wrong public key type");hash=Buffer.concat([tag,hash]);tag=key.modulus.byteLength();
  signType=[1];for(g=0;hash.length+signType.length+2<tag;)signType.push(255),g++;signType.push(0);for(unpacked=-1;++unpacked<hash.length;)signType.push(hash[unpacked]);signType=Buffer.from(signType);hash=BN.mont(key.modulus);sig=(new BN(sig)).toRed(hash);sig=sig.redPow(new BN(key.publicExponent));sig=Buffer.from(sig.fromRed().toArray());key=8>g?1:0;tag=Math.min(sig.length,signType.length);sig.length!==signType.length&&(key=1);for(unpacked=-1;++unpacked<tag;)key|=sig[unpacked]^signType[unpacked];return 0===
  key}}
  //# sourceMappingURL=module$node_modules$browserify_sign$browser$verify.js.map
  