>>22,n=a}n>>>=22,0===(e.words[i-10]=n)&&10>>=26,e.words[r]=n,t=i}return 0!==t&&(e.words[e.length++]=t),e},g._prime=function(e){if(b[e])return b[e];var t;if("k256"===e)t=new v;else if("p224"===e)t=new _;else if("p192"===e)t=new w;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new k}return b[e]=t},x.prototype._verify1=function(e){m(0===e.negative,"red works only with positives"),m(e.red,"red works only with red numbers")},x.prototype._verify2=function(e,t){m(0==(e.negative|t.negative),"red works only with positives"),m(e.red&&e.red===t.red,"red works only with red numbers")},x.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(n(e,e.umod(this.m)._forceRed(this)),e)},x.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},x.prototype.add=function(e,t){this._verify2(e,t);t=e.add(t);return 0<=t.cmp(this.m)&&t.isub(this.m),t._forceRed(this)},x.prototype.iadd=function(e,t){this._verify2(e,t);t=e.iadd(t);return 0<=t.cmp(this.m)&&t.isub(this.m),t},x.prototype.sub=function(e,t){this._verify2(e,t);t=e.sub(t);return t.cmpn(0)<0&&t.iadd(this.m),t._forceRed(this)},x.prototype.isub=function(e,t){this._verify2(e,t);t=e.isub(t);return t.cmpn(0)<0&&t.iadd(this.m),t},x.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},x.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},x.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},x.prototype.isqr=function(e){return this.imul(e,e.clone())},x.prototype.sqr=function(e){return this.mul(e,e)},x.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(m(t%2==1),3===t){t=this.m.add(new g(1)).iushrn(2);return this.pow(e,t)}for(var r=this.m.subn(1),i=0;!r.isZero()&&0===r.andln(1);)i++,r.iushrn(1);m(!r.isZero());for(var n=new g(1).toRed(this),a=n.redNeg(),o=this.m.subn(1).iushrn(1),s=new g(2*(s=this.m.bitLength())*s).toRed(this);0!==this.pow(s,o).cmp(a);)s.redIAdd(a);for(var u=this.pow(s,r),c=this.pow(e,r.addn(1).iushrn(1)),f=this.pow(e,r),p=i;0!==f.cmp(n);){for(var l=f,h=0;0!==l.cmp(n);h++)l=l.redSqr();m(h>c&1;n!==r[0]&&(n=this.sqr(n)),0!=f||0!==a?(a<<=1,a|=f,(4===++o||0===i&&0===c)&&(n=this.mul(n,r[a]),a=o=0)):o=0}s=26}return n},x.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},x.prototype.convertFrom=function(e){e=e.clone();return e.red=null,e},g.mont=function(e){return new S(e)},r(S,x),S.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},S.prototype.convertFrom=function(e){e=this.imod(e.mul(this.rinv));return e.red=null,e},S.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;e=e.imul(t),t=e.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),e=e.isub(t).iushrn(this.shift),t=e;return 0<=e.cmp(this.m)?t=e.isub(this.m):e.cmpn(0)<0&&(t=e.iadd(this.m)),t._forceRed(this)},S.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new g(0)._forceRed(this);e=e.mul(t),t=e.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),e=e.isub(t).iushrn(this.shift),t=e;return 0<=e.cmp(this.m)?t=e.isub(this.m):e.cmpn(0)<0&&(t=e.iadd(this.m)),t._forceRed(this)},S.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===e||e,this)},{buffer:132}],155:[function(e,t,r){t.exports=e("./browser/algorithms.json")},{"./browser/algorithms.json":156}],156:[function(e,t,r){t.exports={sha224WithRSAEncryption:{sign:"rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},"RSA-SHA224":{sign:"ecdsa/rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},sha256WithRSAEncryption:{sign:"rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},"RSA-SHA256":{sign:"ecdsa/rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},sha384WithRSAEncryption:{sign:"rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},"RSA-SHA384":{sign:"ecdsa/rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},sha512WithRSAEncryption:{sign:"rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA512":{sign:"ecdsa/rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA1":{sign:"rsa",hash:"sha1",id:"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{sign:"ecdsa",hash:"sha1",id:""},sha256:{sign:"ecdsa",hash:"sha256",id:""},sha224:{sign:"ecdsa",hash:"sha224",id:""},sha384:{sign:"ecdsa",hash:"sha384",id:""},sha512:{sign:"ecdsa",hash:"sha512",id:""},"DSA-SHA":{sign:"dsa",hash:"sha1",id:""},"DSA-SHA1":{sign:"dsa",hash:"sha1",id:""},DSA:{sign:"dsa",hash:"sha1",id:""},"DSA-WITH-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-WITH-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-WITH-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-WITH-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-RIPEMD160":{sign:"dsa",hash:"rmd160",id:""},ripemd160WithRSA:{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},"RSA-RIPEMD160":{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},md5WithRSAEncryption:{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"},"RSA-MD5":{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"}}},{}],157:[function(e,t,r){t.exports={"1.3.132.0.10":"secp256k1","1.3.132.0.33":"p224","1.2.840.10045.3.1.1":"p192","1.2.840.10045.3.1.7":"p256","1.3.132.0.34":"p384","1.3.132.0.35":"p521"}},{}],158:[function(e,t,r){var i=e("safe-buffer").Buffer,n=e("create-hash"),a=e("readable-stream"),o=e("inherits"),s=e("./sign"),u=e("./verify"),c=e("./algorithms.json");function f(e){a.Writable.call(this);e=c[e];if(!e)throw new Error("Unknown message digest");this._hashType=e.hash,this._hash=n(e.hash),this._tag=e.id,this._signType=e.sign}function p(e){a.Writable.call(this);e=c[e];if(!e)throw new Error("Unknown message digest");this._hash=n(e.hash),this._tag=e.id,this._signType=e.sign}function l(e){return new f(e)}function h(e){return new p(e)}Object.keys(c).forEach(function(e){c[e].id=i.from(c[e].id,"hex"),c[e.toLowerCase()]=c[e]}),o(f,a.Writable),f.prototype._write=function(e,t,r){this._hash.update(e),r()},f.prototype.update=function(e,t){return"string"==typeof e&&(e=i.from(e,t)),this._hash.update(e),this},f.prototype.sign=function(e,t){this.end();var r=this._hash.digest(),e=s(r,e,this._hashType,this._signType,this._tag);return t?e.toString(t):e},o(p,a.Writable),p.prototype._write=function(e,t,r){this._hash.update(e),r()},p.prototype.update=function(e,t){return"string"==typeof e&&(e=i.from(e,t)),this._hash.update(e),this},p.prototype.verify=function(e,t,r){"string"==typeof t&&(t=i.from(t,r)),this.end();r=this._hash.digest();return u(t,r,e,this._signType,this._tag)},t.exports={Sign:l,Verify:h,createSign:l,createVerify:h}},{"./algorithms.json":156,"./sign":159,"./verify":160,"create-hash":194,inherits:162,"readable-stream":177,"safe-buffer":421}],159:[function(e,t,r){var l=e("safe-buffer").Buffer,a=e("create-hmac"),u=e("browserify-rsa"),c=e("elliptic").ec,h=e("bn.js"),f=e("parse-asn1"),p=e("./curves.json");function d(e,t,r,i){(e=l.from(e.toArray())).length=t)throw new Error("invalid sig")}t.exports=function(e,t,r,i,n){if("ec"===(r=h(r)).type){if("ecdsa"!==i&&"ecdsa/rsa"!==i)throw new Error("wrong public key type");return function(e,t,r){var i=d[r.data.algorithm.curve.join(".")];if(!i)throw new Error("unknown curve "+r.data.algorithm.curve.join("."));i=new l(i),r=r.data.subjectPrivateKey.data;return i.verify(t,e,r)}(e,t,r)}if("dsa"===r.type){if("dsa"!==i)throw new Error("wrong public key type");return function(e,t,r){var i=r.data.p,n=r.data.q,a=r.data.g,o=r.data.pub_key,s=h.signature.decode(e,"der"),r=s.s,e=s.r;m(r,n),m(e,n);s=p.mont(i),r=r.invm(n);return 0===a.toRed(s).redPow(new p(t).mul(r).mod(n)).fromRed().mul(o.toRed(s).redPow(e.mul(r).mod(n)).fromRed()).mod(i).mod(n).cmp(e)}(e,t,r)}if("rsa"!==i&&"ecdsa/rsa"!==i)throw new Error("wrong public key type");t=f.concat([n,t]);for(var a=r.modulus.byteLength(),o=[1],s=0;t.length+o.length+2a.length)&&(s=a.length),t=a.substring(s-o.length,s)===o?"The ".concat(e," ").concat(i," ").concat(u(t,"type")):(n=((n="number"!=typeof n?0:n)+(s=".").length>(o=e).length?void 0:-1!==o.indexOf(s,n))?"property":"argument",'The "'.concat(e,'" ').concat(n," ").concat(i," ").concat(u(t,"type"))),t+=". Received type ".concat(_typeof(r))},TypeError),n("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),n("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"}),n("ERR_STREAM_PREMATURE_CLOSE","Premature close"),n("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"}),n("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),n("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),n("ERR_STREAM_WRITE_AFTER_END","write after end"),n("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),n("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError),n("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.codes=i},{}],164:[function(f,p,e){(function(c){(function(){"use strict";var e=Object.keys||function(e){var t,r=[];for(t in e)r.push(t);return r};p.exports=o;var t=f("./_stream_readable"),r=f("./_stream_writable");f("inherits")(o,t);for(var i=e(r.prototype),n=0;nt.highWaterMark&&(t.highWaterMark=(x<=(r=e)?r=x:(r--,r|=r>>>1,r|=r>>>2,r|=r>>>4,r|=r>>>8,r|=r>>>16,r++),r)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0));var r}function j(e){var t=e._readableState;b("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(b("emitReadable",t.flowing),t.emittedReadable=!0,z.nextTick(E,e))}function E(e){var t=e._readableState;b("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,C(e)}function A(e,t){t.readingMore||(t.readingMore=!0,z.nextTick(P,e,t))}function P(e,t){for(;!t.reading&&!t.ended&&(t.length=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function B(e){var t=e._readableState;b("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,z.nextTick(F,t,e))}function F(e,t){b("endReadableNT",e.endEmitted,e.length),e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"),!e.autoDestroy||(!(e=t._writableState)||e.autoDestroy&&e.finished)&&t.destroy())}function M(e,t){for(var r=0,i=e.length;r=t.highWaterMark:0>>0),a=this.head,o=0;a;)t=a.data,r=n,i=o,s.prototype.copy.call(t,r,i),o+=a.data.length,a=a.next;return n}},{key:"consume",value:function(e,t){var r;return en.length?n.length:e;if(a===n.length?i+=n:i+=n.slice(0,e),0===(e-=a)){a===n.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t).data=n.slice(a);break}++r}return this.length-=r,i}},{key:"_getBuffer",value:function(e){var t=s.allocUnsafe(e),r=this.head,i=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var n=r.data,a=e>n.length?n.length:e;if(n.copy(t,t.length-e,0,a),0===(e-=a)){a===n.length?(++i,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r).data=n.slice(a);break}++i}return this.length-=i,t}},{key:c,value:function(e,t){return u(this,n({},t,{depth:0,customInspect:!1}))}}])&&o(e.prototype,r),i&&o(e,i),t}()},{buffer:186,util:132}],171:[function(e,t,r){(function(u){(function(){"use strict";function a(e,t){s(e,t),o(e)}function o(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function s(e,t){e.emit("error",t)}t.exports={destroy:function(e,t){var r=this,i=this._readableState&&this._readableState.destroyed,n=this._writableState&&this._writableState.destroyed;return i||n?t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,u.nextTick(s,this,e)):u.nextTick(s,this,e)):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!t&&e?r._writableState?r._writableState.errorEmitted?u.nextTick(o,r):(r._writableState.errorEmitted=!0,u.nextTick(a,r,e)):u.nextTick(a,r,e):t?(u.nextTick(o,r),t(e)):u.nextTick(o,r)})),this},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var r=e._readableState,i=e._writableState;r&&r.autoDestroy||i&&i.autoDestroy?e.destroy(t):e.emit("error",t)}}}).call(this)}).call(this,e("_process"))},{_process:354}],172:[function(e,t,r){"use strict";var b=e("../../../errors").codes.ERR_STREAM_PREMATURE_CLOSE;function y(){}t.exports=function e(t,r,i){if("function"==typeof r)return e(t,null,r);var n,a;n=i||y,a=!1,i=function(){if(!a){a=!0;for(var e=arguments.length,t=new Array(e),r=0;rd.UNZIP)throw new TypeError("Bad argument");this.mode=e,this.init_done=!1,this.write_in_progress=!1,this.pending_close=!1,this.windowBits=0,this.level=0,this.memLevel=0,this.strategy=0,this.dictionary=null}function p(e,t){for(var r=0;rb.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+e.chunkSize);if(e.windowBits&&(e.windowBitsb.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+e.windowBits);if(e.level&&(e.levelb.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+e.level);if(e.memLevel&&(e.memLevelb.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+e.memLevel);if(e.strategy&&e.strategy!=b.Z_FILTERED&&e.strategy!=b.Z_HUFFMAN_ONLY&&e.strategy!=b.Z_RLE&&e.strategy!=b.Z_FIXED&&e.strategy!=b.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+e.strategy);if(e.dictionary&&!g.isBuffer(e.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._binding=new o.Zlib(t);var r=this;this._hadError=!1,this._binding.onerror=function(e,t){r._binding=null,r._hadError=!0;e=new Error(e);e.errno=t,e.code=b.codes[t],r.emit("error",e)};var i=b.Z_DEFAULT_COMPRESSION;"number"==typeof e.level&&(i=e.level);t=b.Z_DEFAULT_STRATEGY;"number"==typeof e.strategy&&(t=e.strategy),this._binding.init(e.windowBits||b.Z_DEFAULT_WINDOWBITS,i,e.memLevel||b.Z_DEFAULT_MEMLEVEL,t,e.dictionary),this._buffer=new g(this._chunkSize),this._offset=0,this._closed=!1,this._level=i,this._strategy=t,this.once("end",this.close)}o.Z_MIN_WINDOWBITS=8,o.Z_MAX_WINDOWBITS=15,o.Z_DEFAULT_WINDOWBITS=15,o.Z_MIN_CHUNK=64,o.Z_MAX_CHUNK=1/0,o.Z_DEFAULT_CHUNK=16384,o.Z_MIN_MEMLEVEL=1,o.Z_MAX_MEMLEVEL=9,o.Z_DEFAULT_MEMLEVEL=8,o.Z_MIN_LEVEL=-1,o.Z_MAX_LEVEL=9,o.Z_DEFAULT_LEVEL=o.Z_DEFAULT_COMPRESSION,Object.keys(o).forEach(function(e){e.match(/^Z/)&&(b[e]=o[e])}),b.codes={Z_OK:o.Z_OK,Z_STREAM_END:o.Z_STREAM_END,Z_NEED_DICT:o.Z_NEED_DICT,Z_ERRNO:o.Z_ERRNO,Z_STREAM_ERROR:o.Z_STREAM_ERROR,Z_DATA_ERROR:o.Z_DATA_ERROR,Z_MEM_ERROR:o.Z_MEM_ERROR,Z_BUF_ERROR:o.Z_BUF_ERROR,Z_VERSION_ERROR:o.Z_VERSION_ERROR},Object.keys(b.codes).forEach(function(e){b.codes[b.codes[e]]=e}),b.Deflate=a,b.Inflate=s,b.Gzip=u,b.Gunzip=c,b.DeflateRaw=f,b.InflateRaw=p,b.Unzip=l,b.createDeflate=function(e){return new a(e)},b.createInflate=function(e){return new s(e)},b.createDeflateRaw=function(e){return new f(e)},b.createInflateRaw=function(e){return new p(e)},b.createGzip=function(e){return new u(e)},b.createGunzip=function(e){return new c(e)},b.createUnzip=function(e){return new l(e)},b.deflate=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new a(t),e,r)},b.deflateSync=function(e,t){return r(new a(t),e)},b.gzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new u(t),e,r)},b.gzipSync=function(e,t){return r(new u(t),e)},b.deflateRaw=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new f(t),e,r)},b.deflateRawSync=function(e,t){return r(new f(t),e)},b.unzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new l(t),e,r)},b.unzipSync=function(e,t){return r(new l(t),e)},b.inflate=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new s(t),e,r)},b.inflateSync=function(e,t){return r(new s(t),e)},b.gunzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new c(t),e,r)},b.gunzipSync=function(e,t){return r(new c(t),e)},b.inflateRaw=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new p(t),e,r)},b.inflateRawSync=function(e,t){return r(new p(t),e)},e.inherits(t,n),t.prototype.params=function(e,t,r){if(eb.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+e);if(t!=b.Z_FILTERED&&t!=b.Z_HUFFMAN_ONLY&&t!=b.Z_RLE&&t!=b.Z_FIXED&&t!=b.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+t);var i;this._level!==e||this._strategy!==t?(i=this).flush(o.Z_SYNC_FLUSH,function(){i._binding.params(e,t),i._hadError||(i._level=e,i._strategy=t,r&&r())}):h.nextTick(r)},t.prototype.reset=function(){return this._binding.reset()},t.prototype._flush=function(e){this._transform(new g(0),"",e)},t.prototype.flush=function(e,t){var r,i=this._writableState;"function"!=typeof e&&(void 0!==e||t)||(t=e,e=o.Z_FULL_FLUSH),i.ended?t&&h.nextTick(t):i.ending?t&&this.once("end",t):i.needDrain?(r=this).once("drain",function(){r.flush(t)}):(this._flushFlag=e,this.write(new g(0),"",t))},t.prototype.close=function(e){var t;e&&h.nextTick(e),this._closed||(this._closed=!0,this._binding.close(),t=this,h.nextTick(function(){t.emit("close")}))},t.prototype._transform=function(e,t,r){var i,n=this._writableState,a=(n.ending||n.ended)&&(!e||n.length===e.length);if(null===!e&&!g.isBuffer(e))return r(new Error("invalid input"));a?i=o.Z_FINISH:(i=this._flushFlag,e.length>=n.length&&(this._flushFlag=this._opts.flush||o.Z_NO_FLUSH));this._processChunk(e,i,r)},t.prototype._processChunk=function(n,a,o){var s=n&&n.length,u=this._chunkSize-this._offset,c=0,f=this,p="function"==typeof o;if(!p){var t,l=[],h=0;this.on("error",function(e){t=e});do{var e=this._binding.writeSync(a,n,c,s,this._buffer,this._offset,u)}while(!this._hadError&&d(e[0],e[1]));if(this._hadError)throw t;var r=g.concat(l,h);return this.close(),r}r=this._binding.write(a,n,c,s,this._buffer,this._offset,u);function d(e,t){if(!f._hadError){var r,i=u-t;if(m(0<=i,"have should not go down"),0=f._chunkSize)&&(u=f._chunkSize,f._offset=0,f._buffer=new g(f._chunkSize)),0===t){if(c+=s-e,s=e,!p)return!0;e=f._binding.write(a,n,c,s,f._buffer,f._offset,f._chunkSize);return e.callback=d,void(e.buffer=n)}if(!p)return!1;o()}}r.buffer=n,r.callback=d},e.inherits(a,t),e.inherits(s,t),e.inherits(u,t),e.inherits(c,t),e.inherits(f,t),e.inherits(p,t),e.inherits(l,t)}).call(this)}).call(this,d("_process"),d("buffer").Buffer)},{"./binding":178,_process:354,_stream_transform:401,assert:68,buffer:186,util:481}],180:[function(e,t,r){arguments[4][132][0].apply(r,arguments)},{dup:132}],181:[function(e,C,R){(function(O){(function(){!function(e){var t="object"==_typeof(R)&&R&&!R.nodeType&&R,r="object"==_typeof(C)&&C&&!C.nodeType&&C,i="object"==_typeof(O)&&O;i.global!==i&&i.window!==i&&i.self!==i||(e=i);var n,a,b=2147483647,y=36,v=1,_=26,o=38,s=700,w=72,k=128,x="-",u=/^xn--/,c=/[^\x20-\x7E]/,f=/[\x2E\u3002\uFF0E\uFF61]/g,p={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},l=y-v,S=Math.floor,j=String.fromCharCode;function E(e){throw new RangeError(p[e])}function h(e,t){for(var r=e.length,i=[];r--;)i[r]=t(e[r]);return i}function d(e,t){var r=e.split("@"),i="";return 1>>10&1023|55296),e=56320|1023&e),t+=j(e)}).join("")}function P(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function I(e,t,r){var i=0;for(e=r?S(e/s):e>>1,e+=S(e/t);l*_>>1S((b-f)/a))&&E("overflow"),f+=s*a,!(s<(s=o<=l?v:l+_<=o?_:o-l));o+=y)a>S(b/(s=y-s))&&E("overflow"),a*=s;l=I(f-n,t=u.length+1,0==n),S(f/t)>b-p&&E("overflow"),p+=S(f/t),f%=t,u.splice(f++,0,p)}return m(u)}function T(e){for(var t,r,i,n,a,o,s,u,c,f,p,l=[],h=(e=A(e)).length,d=k,m=w,g=t=0;gS((b-t)/(c=r+1))&&E("overflow"),t+=(n-d)*c,d=n,g=0;gb&&E("overflow"),u==d){for(a=t,o=y;!(a<(s=o<=m?v:m+_<=o?_:o-m));o+=y)p=a-s,f=y-s,l.push(j(P(s+p%f,0))),a=S(p/f);l.push(j(P(a,0))),m=I(t,c,r==i),t=0,++r}++t,++d}return l.join("")}if(n={version:"1.4.1",ucs2:{decode:A,encode:m},decode:g,encode:T,toASCII:function(e){return d(e,function(e){return c.test(e)?"xn--"+T(e):e})},toUnicode:function(e){return d(e,function(e){return u.test(e)?g(e.slice(4).toLowerCase()):e})}},"function"==typeof B&&"object"==_typeof(B.amd)&&B.amd)B("punycode",function(){return n});else if(t&&r)if(C.exports==t)r.exports=n;else for(a in n)n.hasOwnProperty(a)&&(t[a]=n[a]);else e.punycode=n}(this)}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],182:[function(e,t,r){var i=e("buffer").Buffer,n=i.isEncoding||function(e){switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};r=r.StringDecoder=function(e){switch(this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,""),function(e){if(e&&!n(e))throw new Error("Unknown encoding: "+e)}(e),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=o;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=s;break;default:return void(this.write=a)}this.charBuffer=new i(6),this.charReceived=0,this.charLength=0};function a(e){return e.toString(this.encoding)}function o(e){this.charReceived=e.length%2,this.charLength=this.charReceived?2:0}function s(e){this.charReceived=e.length%3,this.charLength=this.charReceived?3:0}r.prototype.write=function(e){for(var t="";this.charLength;){var r=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;if(e.copy(this.charBuffer,this.charReceived,0,r),this.charReceived+=r,this.charReceived>5==6){this.charLength=2;break}if(t<=2&&r>>4==14){this.charLength=3;break}if(t<=3&&r>>3==30){this.charLength=4;break}}this.charReceived=t},r.prototype.end=function(e){var t,r,i="";return e&&e.length&&(i=this.write(e)),this.charReceived&&(t=this.charReceived,r=this.charBuffer,e=this.encoding,i+=r.slice(0,t).toString(e)),i}},{buffer:186}],183:[function(e,t,r){e=e("base-x");t.exports=e("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},{"base-x":75}],184:[function(e,t,r){t.exports=function(e,t){if("function"==typeof e.compare)return e.compare(t);if(e===t)return 0;for(var r=e.length,i=t.length,n=0,a=Math.min(r,i);n=r())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r().toString(16)+" bytes");return 0|e}function h(e,t){if(p.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;var r=(e="string"!=typeof e?""+e:e).length;if(0===r)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return I(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return T(e).length;default:if(i)return I(e).length;t=(""+t).toLowerCase(),i=!0}}function t(e,t,r){var i,n,a,o=!1;if((t=void 0===t||t<0?0:t)>this.length)return"";if((r=void 0===r||r>this.length?this.length:r)<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e=e||"utf8";;)switch(e){case"hex":return function(e,t,r){var i=e.length;(!t||t<0)&&(t=0);(!r||r<0||i=e.length){if(n)return-1;r=e.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof t&&(t=p.from(t,i)),p.isBuffer(t))return 0===t.length?-1:g(e,t,r,i,n);if("number"==typeof t)return t&=255,p.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?(n?Uint8Array.prototype.indexOf:Uint8Array.prototype.lastIndexOf).call(e,t,r):g(e,[t],r,i,n);throw new TypeError("val must be string, number or Buffer")}function g(e,t,r,i,n){var a=1,o=e.length,s=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return-1;o/=a=2,s/=2,r/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(n)for(var c=-1,f=r;f>8,i=i%256,n.push(i),n.push(r);return n}(t,e.length-r),e,r,i)}function v(e,t,r){r=Math.min(e.length,r);for(var i=[],n=t;n>>10&1023|55296),f=56320|1023&f),i.push(f),n+=p}return function(e){var t=e.length;if(t<=_)return String.fromCharCode.apply(String,e);var r="",i=0;for(;it&&(e+=" ... ")),""},p.prototype.compare=function(e,t,r,i,n){if(!p.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),t<0||r>e.length||i<0||n>this.length)throw new RangeError("out of range index");if(n<=i&&r<=t)return 0;if(n<=i)return-1;if(r<=t)return 1;if(this===e)return 0;for(var a=(n>>>=0)-(i>>>=0),o=(r>>>=0)-(t>>>=0),s=Math.min(a,o),u=this.slice(i,n),c=e.slice(t,r),f=0;fthis.length)throw new RangeError("Attempt to write outside buffer bounds");i=i||"utf8";for(var a,o,s,u=!1;;)switch(i){case"hex":return function(e,t,r,i){r=Number(r)||0;var n=e.length-r;if((!i||n<(i=Number(i)))&&(i=n),(n=t.length)%2!=0)throw new TypeError("Invalid hex string");n/2e.length)throw new RangeError("Index out of range")}function x(e,t,r,i){t<0&&(t=65535+t+1);for(var n=0,a=Math.min(e.length-r,2);n>>8*(i?n:1-n)}function S(e,t,r,i){t<0&&(t=4294967295+t+1);for(var n=0,a=Math.min(e.length-r,4);n>>8*(i?n:3-n)&255}function j(e,t,r,i){if(r+i>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function E(e,t,r,i,n){return n||j(e,0,r,4),a.write(e,t,r,i,23,4),r+4}function A(e,t,r,i,n){return n||j(e,0,r,8),a.write(e,t,r,i,52,8),r+8}p.prototype.slice=function(e,t){var r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):r>>8):x(this,e,t,!0),t+2},p.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||k(this,e,t,2,65535,0),p.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):x(this,e,t,!1),t+2},p.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||k(this,e,t,4,4294967295,0),p.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):S(this,e,t,!0),t+4},p.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||k(this,e,t,4,4294967295,0),p.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):S(this,e,t,!1),t+4},p.prototype.writeIntLE=function(e,t,r,i){e=+e,t|=0,i||k(this,e,t,r,(i=Math.pow(2,8*r-1))-1,-i);var n=0,a=1,o=0;for(this[t]=255&e;++n>0)-o&255;return t+r},p.prototype.writeIntBE=function(e,t,r,i){e=+e,t|=0,i||k(this,e,t,r,(i=Math.pow(2,8*r-1))-1,-i);var n=r-1,a=1,o=0;for(this[t+n]=255&e;0<=--n&&(a*=256);)e<0&&0===o&&0!==this[t+n+1]&&(o=1),this[t+n]=(e/a>>0)-o&255;return t+r},p.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||k(this,e,t,1,127,-128),(e=!p.TYPED_ARRAY_SUPPORT?Math.floor(e):e)<0&&(e=255+e+1),this[t]=255&e,t+1},p.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||k(this,e,t,2,32767,-32768),p.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):x(this,e,t,!0),t+2},p.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||k(this,e,t,2,32767,-32768),p.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):x(this,e,t,!1),t+2},p.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||k(this,e,t,4,2147483647,-2147483648),p.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):S(this,e,t,!0),t+4},p.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||k(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),p.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):S(this,e,t,!1),t+4},p.prototype.writeFloatLE=function(e,t,r){return E(this,e,t,!0,r)},p.prototype.writeFloatBE=function(e,t,r){return E(this,e,t,!1,r)},p.prototype.writeDoubleLE=function(e,t,r){return A(this,e,t,!0,r)},p.prototype.writeDoubleBE=function(e,t,r){return A(this,e,t,!1,r)},p.prototype.copy=function(e,t,r,i){if(r=r||0,i||0===i||(i=this.length),t=(t=t>=e.length?e.length:t)||0,(i=0=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length);var n,a=(i=e.length-t>>=0,r=void 0===r?this.length:r>>>0,"number"==typeof(e=e||0))for(s=t;s>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function T(e){return s.toByteArray(function(e){var t;if((e=((t=e).trim?t.trim():t.replace(/^\s+|\s+$/g,"")).replace(P,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function O(e,t,r,i){for(var n=0;n=t.length||n>=e.length);++n)t[n+r]=e[n];return n}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},C("buffer").Buffer)},{"base64-js":76,buffer:186,ieee754:295,isarray:299}],187:[function(e,t,r){t.exports={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},{}],188:[function(e,t,r){function n(e){this.dict=e||{}}n.prototype.set=function(e,t,r){if("object"!==_typeof(e)){void 0===r&&(r=!0);var i=this.has(e);return!r&&i?this.dict[i]=this.dict[i]+","+t:this.dict[i||e]=t,i}for(var n in e)this.set(n,e[n],t)},n.prototype.has=function(e){for(var t=Object.keys(this.dict),e=e.toLowerCase(),r=0;rr?t=("rmd160"===e?new u:c(e)).update(t).digest():t.length>>1],r=f.r28shl(r,a),i=f.r28shl(i,a);f.pc2(r,i,e.keys,n)}},s.prototype._update=function(e,t,r,i){var n=this._desState,a=f.readUInt32BE(e,t),t=f.readUInt32BE(e,t+4);f.ip(a,t,n.tmp,0),a=n.tmp[0],t=n.tmp[1],"encrypt"===this.type?this._encrypt(n,a,t,n.tmp,0):this._decrypt(n,a,t,n.tmp,0),a=n.tmp[0],t=n.tmp[1],f.writeUInt32BE(r,a,i),f.writeUInt32BE(r,t,i+4)},s.prototype._pad=function(e,t){for(var r=e.length-t,i=t;i>>0,a=c}f.rip(o,a,i,n)},s.prototype._decrypt=function(e,t,r,i,n){for(var a=r,o=t,s=e.keys.length-2;0<=s;s-=2){var u=e.keys[s],c=e.keys[s+1];f.expand(a,e.tmp,0),u^=e.tmp[0],c^=e.tmp[1];u=f.substitute(u,c),c=a,a=(o^f.permute(u))>>>0,o=c}f.rip(a,o,i,n)}},{"./cipher":202,"./utils":205,inherits:296,"minimalistic-assert":324}],204:[function(e,t,r){"use strict";var n=e("minimalistic-assert"),i=e("inherits"),a=e("./cipher"),o=e("./des");function s(e,t){n.equal(t.length,24,"Invalid key length");var r=t.slice(0,8),i=t.slice(8,16),t=t.slice(16,24);this.ciphers="encrypt"===e?[o.create({type:"encrypt",key:r}),o.create({type:"decrypt",key:i}),o.create({type:"encrypt",key:t})]:[o.create({type:"decrypt",key:t}),o.create({type:"encrypt",key:i}),o.create({type:"decrypt",key:r})]}function u(e){a.call(this,e);e=new s(this.type,this.options.key);this._edeState=e}i(u,a),(t.exports=u).create=function(e){return new u(e)},u.prototype._update=function(e,t,r,i){var n=this._edeState;n.ciphers[0]._update(e,t,r,i),n.ciphers[1]._update(r,i,r,i),n.ciphers[2]._update(r,i,r,i)},u.prototype._pad=o.prototype._pad,u.prototype._unpad=o.prototype._unpad},{"./cipher":202,"./des":203,inherits:296,"minimalistic-assert":324}],205:[function(e,t,r){"use strict";r.readUInt32BE=function(e,t){return(e[0+t]<<24|e[1+t]<<16|e[2+t]<<8|e[3+t])>>>0},r.writeUInt32BE=function(e,t,r){e[0+r]=t>>>24,e[1+r]=t>>>16&255,e[2+r]=t>>>8&255,e[3+r]=255&t},r.ip=function(e,t,r,i){for(var n=0,a=0,o=6;0<=o;o-=2){for(var s=0;s<=24;s+=8)n<<=1,n|=t>>>s+o&1;for(s=0;s<=24;s+=8)n<<=1,n|=e>>>s+o&1}for(o=6;0<=o;o-=2){for(s=1;s<=25;s+=8)a<<=1,a|=t>>>s+o&1;for(s=1;s<=25;s+=8)a<<=1,a|=e>>>s+o&1}r[i+0]=n>>>0,r[i+1]=a>>>0},r.rip=function(e,t,r,i){for(var n=0,a=0,o=0;o<4;o++)for(var s=24;0<=s;s-=8)n<<=1,n|=t>>>s+o&1,n<<=1,n|=e>>>s+o&1;for(o=4;o<8;o++)for(s=24;0<=s;s-=8)a<<=1,a|=t>>>s+o&1,a<<=1,a|=e>>>s+o&1;r[i+0]=n>>>0,r[i+1]=a>>>0},r.pc1=function(e,t,r,i){for(var n=0,a=0,o=7;5<=o;o--){for(var s=0;s<=24;s+=8)n<<=1,n|=t>>s+o&1;for(s=0;s<=24;s+=8)n<<=1,n|=e>>s+o&1}for(s=0;s<=24;s+=8)n<<=1,n|=t>>s+o&1;for(o=1;o<=3;o++){for(s=0;s<=24;s+=8)a<<=1,a|=t>>s+o&1;for(s=0;s<=24;s+=8)a<<=1,a|=e>>s+o&1}for(s=0;s<=24;s+=8)a<<=1,a|=e>>s+o&1;r[i+0]=n>>>0,r[i+1]=a>>>0},r.r28shl=function(e,t){return e<>>28-t};var u=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];r.pc2=function(e,t,r,i){for(var n=0,a=0,o=u.length>>>1,s=0;s>>u[s]&1;for(s=o;s>>u[s]&1;r[i+0]=n>>>0,r[i+1]=a>>>0},r.expand=function(e,t,r){for(var i=0,n=0,i=(1&e)<<5|e>>>27,a=23;15<=a;a-=4)i<<=6,i|=e>>>a&63;for(a=11;3<=a;a-=4)n|=e>>>a&63,n<<=6;n|=(31&e)<<1|e>>>31,t[r+0]=i>>>0,t[r+1]=n>>>0};var n=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];r.substitute=function(e,t){for(var r=0,i=0;i<4;i++)r<<=4,r|=n[64*i+(e>>>18-6*i&63)];for(i=0;i<4;i++)r<<=4,r|=n[256+64*i+(t>>>18-6*i&63)];return r>>>0};var i=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];r.permute=function(e){for(var t=0,r=0;r>>i[r]&1;return t>>>0},r.padSplit=function(e,t,r){for(var i=e.toString(2);i.lengthe;)r.ishrn(1);if(r.isEven()&&r.iadd(u),r.testn(1)||r.iadd(c),t.cmp(c)){if(!t.cmp(f))for(;r.mod(p).cmp(l);)r.iadd(d)}else for(;r.mod(o).cmp(h);)r.iadd(d);if(g(i=r.shrn(1))&&g(r)&&b(i)&&b(r)&&s.test(i)&&s.test(r))return r}}},{"bn.js":129,"miller-rabin":320,randombytes:386}],209:[function(e,t,r){t.exports={modp1:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},modp2:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},modp5:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},modp14:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},modp15:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},modp16:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},modp17:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},modp18:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}}},{}],210:[function(e,t,r){var s=e("crypto"),u=e("jsbn").BigInteger,c=(e("./lib/ec.js").ECPointFp,e("safer-buffer").Buffer);function f(e,t){return e.length>=t?e:f("0"+e,t)}r.ECCurves=e("./lib/sec.js"),r.ECKey=function(e,t,r){var i=e(),n=i.getN(),a=Math.floor(n.bitLength()/8);if(t)if(r){e=i.getCurve();this.P=e.decodePointHex(t.toString("hex"))}else{if(t.length!=a)return!1;o=new u(t.toString("hex"),16)}else{var t=n.subtract(u.ONE),o=new u(s.randomBytes(n.bitLength())).mod(t).add(u.ONE);this.P=i.getG().multiply(o)}this.P&&(this.PublicKey=c.from(i.getCurve().encodeCompressedPointHex(this.P),"hex")),o&&(this.PrivateKey=c.from(f(o.toString(16),2*a),"hex"),this.deriveSharedSecret=function(e){if(!e||!e.P)return!1;e=e.P.multiply(o);return c.from(f(e.getX().toBigInteger().toString(16),2*a),"hex")})}},{"./lib/ec.js":211,"./lib/sec.js":212,crypto:198,jsbn:301,"safer-buffer":422}],211:[function(e,t,r){var p=e("jsbn").BigInteger,i=p.prototype.Barrett;function c(e,t){this.x=t,this.q=e}function u(e,t,r,i){this.curve=e,this.x=t,this.y=r,this.z=null==i?p.ONE:i,this.zinv=null}function n(e,t,r){this.q=e,this.a=this.fromBigInteger(t),this.b=this.fromBigInteger(r),this.infinity=new u(this,null,null),this.reducer=new i(this.q)}c.prototype.equals=function(e){return e==this||this.q.equals(e.q)&&this.x.equals(e.x)},c.prototype.toBigInteger=function(){return this.x},c.prototype.negate=function(){return new c(this.q,this.x.negate().mod(this.q))},c.prototype.add=function(e){return new c(this.q,this.x.add(e.toBigInteger()).mod(this.q))},c.prototype.subtract=function(e){return new c(this.q,this.x.subtract(e.toBigInteger()).mod(this.q))},c.prototype.multiply=function(e){return new c(this.q,this.x.multiply(e.toBigInteger()).mod(this.q))},c.prototype.square=function(){return new c(this.q,this.x.square().mod(this.q))},c.prototype.divide=function(e){return new c(this.q,this.x.multiply(e.toBigInteger().modInverse(this.q)).mod(this.q))},u.prototype.getX=function(){null==this.zinv&&(this.zinv=this.z.modInverse(this.curve.q));var e=this.x.toBigInteger().multiply(this.zinv);return this.curve.reduce(e),this.curve.fromBigInteger(e)},u.prototype.getY=function(){null==this.zinv&&(this.zinv=this.z.modInverse(this.curve.q));var e=this.y.toBigInteger().multiply(this.zinv);return this.curve.reduce(e),this.curve.fromBigInteger(e)},u.prototype.equals=function(e){return e==this||(this.isInfinity()?e.isInfinity():e.isInfinity()?this.isInfinity():!!e.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(e.z)).mod(this.curve.q).equals(p.ZERO)&&e.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(e.z)).mod(this.curve.q).equals(p.ZERO))},u.prototype.isInfinity=function(){return null==this.x&&null==this.y||this.z.equals(p.ZERO)&&!this.y.toBigInteger().equals(p.ZERO)},u.prototype.negate=function(){return new u(this.curve,this.x,this.y.negate(),this.z)},u.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(e.z)).mod(this.curve.q),r=e.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(e.z)).mod(this.curve.q);if(p.ZERO.equals(r))return p.ZERO.equals(t)?this.twice():this.curve.getInfinity();var i=new p("3"),n=this.x.toBigInteger(),a=this.y.toBigInteger(),o=(e.x.toBigInteger(),e.y.toBigInteger(),r.square()),s=o.multiply(r),n=n.multiply(o),r=(o=t.square().multiply(this.z)).subtract(n.shiftLeft(1)).multiply(e.z).subtract(s).multiply(r).mod(this.curve.q),t=n.multiply(i).multiply(t).subtract(a.multiply(s)).subtract(o.multiply(t)).multiply(e.z).add(t.multiply(s)).mod(this.curve.q),e=s.multiply(this.z).multiply(e.z).mod(this.curve.q);return new u(this.curve,this.curve.fromBigInteger(r),this.curve.fromBigInteger(t),e)},u.prototype.twice=function(){if(this.isInfinity())return this;if(0==this.y.toBigInteger().signum())return this.curve.getInfinity();var e=new p("3"),t=this.x.toBigInteger(),r=this.y.toBigInteger(),i=(a=r.multiply(this.z)).multiply(r).mod(this.curve.q),n=this.curve.a.toBigInteger(),r=t.square().multiply(e),n=(r=(r=!p.ZERO.equals(n)?r.add(this.z.square().multiply(n)):r).mod(this.curve.q)).square().subtract(t.shiftLeft(3).multiply(i)).shiftLeft(1).multiply(a).mod(this.curve.q),r=r.multiply(e).multiply(t).subtract(i.shiftLeft(1)).shiftLeft(2).multiply(i).subtract(r.square().multiply(r)).mod(this.curve.q),a=a.square().multiply(a).shiftLeft(3).mod(this.curve.q);return new u(this.curve,this.curve.fromBigInteger(n),this.curve.fromBigInteger(r),a)},u.prototype.multiply=function(e){if(this.isInfinity())return this;if(0==e.signum())return this.curve.getInfinity();for(var t=e,r=t.multiply(new p("3")),i=this.negate(),n=this,a=r.bitLength()-2;0r.bitLength()?e.bitLength()-1:r.bitLength()-1,n=this.curve.getInfinity(),a=this.add(t);0<=i;)n=n.twice(),e.testBit(i)?n=r.testBit(i)?n.add(a):n.add(this):r.testBit(i)&&(n=n.add(t)),--i;return n},n.prototype.getQ=function(){return this.q},n.prototype.getA=function(){return this.a},n.prototype.getB=function(){return this.b},n.prototype.equals=function(e){return e==this||this.q.equals(e.q)&&this.a.equals(e.a)&&this.b.equals(e.b)},n.prototype.getInfinity=function(){return this.infinity},n.prototype.fromBigInteger=function(e){return new c(this.q,e)},n.prototype.reduce=function(e){this.reducer.reduce(e)},n.prototype.encodePointHex=function(e){if(e.isInfinity())return"00";var t=e.getX().toBigInteger().toString(16),r=e.getY().toBigInteger().toString(16),i=this.getQ().toString(16).length;for(i%2!=0&&i++;t.lengtht+1;){var r=e.shiftRight(t),i=e.subtract(r.shiftLeft(t));e=(r=!this.getR().equals(p.ONE)?r.multiply(this.getR()):r).add(i)}for(;0<=e.compareTo(q);)e=e.subtract(q)}else e=e.mod(q);return e},c.prototype.sqrt=function(){if(!this.q.testBit(0))throw"unsupported";if(this.q.testBit(1)){var e=new c(this.q,this.x.modPow(this.q.shiftRight(2).add(p.ONE),this.q));return e.square().equals(this)?e:null}var t=this.q.subtract(p.ONE),r=t.shiftRight(1);if(!this.x.modPow(r,this.q).equals(p.ONE))return null;var i,n=t.shiftRight(2).shiftLeft(1).add(p.ONE),a=this.x,o=modDouble(modDouble(a));do{for(;i=new p(this.q.bitLength(),new SecureRandom),0<=i.compareTo(this.q)||!i.multiply(i).subtract(o).modPow(r,this.q).equals(t););var s=this.lucasSequence(i,a,n),u=s[0],s=s[1];if(this.modMult(s,s).equals(o))return s=(s=s.testBit(0)?s.add(q):s).shiftRight(1),new c(q,s)}while(u.equals(p.ONE)||u.equals(t));return null},c.prototype.lucasSequence=function(e,t,r){for(var i=r.bitLength(),n=r.getLowestSetBit(),a=p.ONE,o=p.TWO,s=e,u=p.ONE,c=p.ONE,f=i-1;n+1<=f;--f)u=this.modMult(u,c),r.testBit(f)?(c=this.modMult(u,t),a=this.modMult(a,s),o=this.modReduce(s.multiply(o).subtract(e.multiply(u))),s=this.modReduce(s.multiply(s).subtract(c.shiftLeft(1)))):(c=u,a=this.modReduce(a.multiply(o).subtract(u)),s=this.modReduce(s.multiply(o).subtract(e.multiply(u))),o=this.modReduce(o.multiply(o).subtract(u.shiftLeft(1))));u=this.modMult(u,c),c=this.modMult(u,t),a=this.modReduce(a.multiply(o).subtract(u)),o=this.modReduce(s.multiply(o).subtract(e.multiply(u))),u=this.modMult(u,c);for(f=1;f<=n;++f)a=this.modMult(a,o),o=this.modReduce(o.multiply(o).subtract(u.shiftLeft(1))),u=this.modMult(u,u);return[a,o]};r={ECCurveFp:n,ECPointFp:u,ECFieldElementFp:c};t.exports=r},{jsbn:301}],212:[function(e,t,r){var a=e("jsbn").BigInteger,o=e("./ec.js").ECCurveFp;function s(e,t,r,i){this.curve=e,this.g=t,this.n=r,this.h=i}function u(e){return new a(e,16)}function i(){var e=u("FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFF"),t=u("FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFC"),r=u("E87579C11079F43DD824993C2CEE5ED3"),i=u("FFFFFFFE0000000075A30D1B9038A115"),n=a.ONE,t=new o(e,t,r),r=t.decodePointHex("04161FF7528B899B2D0C28607CA52C5B86CF5AC8395BAFEB13C02DA292DDED7A83");return new s(t,r,i,n)}function n(){var e=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC73"),t=a.ZERO,r=u("7"),i=u("0100000000000000000001B8FA16DFAB9ACA16B6B3"),n=a.ONE,t=new o(e,t,r),r=t.decodePointHex("043B4C382CE37AA192A4019E763036F4F5DD4D7EBB938CF935318FDCED6BC28286531733C3F03C4FEE");return new s(t,r,i,n)}function c(){var e=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFF"),t=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFC"),r=u("1C97BEFC54BD7A8B65ACF89F81D4D4ADC565FA45"),i=u("0100000000000000000001F4C8F927AED3CA752257"),n=a.ONE,t=new o(e,t,r),r=t.decodePointHex("044A96B5688EF573284664698968C38BB913CBFC8223A628553168947D59DCC912042351377AC5FB32");return new s(t,r,i,n)}function f(){var e=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFEE37"),t=a.ZERO,r=u("3"),i=u("FFFFFFFFFFFFFFFFFFFFFFFE26F2FC170F69466A74DEFD8D"),n=a.ONE,t=new o(e,t,r),r=t.decodePointHex("04DB4FF10EC057E9AE26B07D0280B7F4341DA5D1B1EAE06C7D9B2F2F6D9C5628A7844163D015BE86344082AA88D95E2F9D");return new s(t,r,i,n)}function p(){var e=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF"),t=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFC"),r=u("64210519E59C80E70FA7E9AB72243049FEB8DEECC146B9B1"),i=u("FFFFFFFFFFFFFFFFFFFFFFFF99DEF836146BC9B1B4D22831"),n=a.ONE,t=new o(e,t,r),r=t.decodePointHex("04188DA80EB03090F67CBF20EB43A18800F4FF0AFD82FF101207192B95FFC8DA78631011ED6B24CDD573F977A11E794811");return new s(t,r,i,n)}function l(){var e=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001"),t=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFE"),r=u("B4050A850C04B3ABF54132565044B0B7D7BFD8BA270B39432355FFB4"),i=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFF16A2E0B8F03E13DD29455C5C2A3D"),n=a.ONE,t=new o(e,t,r),r=t.decodePointHex("04B70E0CBD6BB4BF7F321390B94A03C1D356C21122343280D6115C1D21BD376388B5F723FB4C22DFE6CD4375A05A07476444D5819985007E34");return new s(t,r,i,n)}function h(){var e=u("FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF"),t=u("FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC"),r=u("5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B"),i=u("FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551"),n=a.ONE,t=new o(e,t,r),r=t.decodePointHex("046B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C2964FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5");return new s(t,r,i,n)}s.prototype.getCurve=function(){return this.curve},s.prototype.getG=function(){return this.g},s.prototype.getN=function(){return this.n},s.prototype.getH=function(){return this.h},t.exports={secp128r1:i,secp160k1:n,secp160r1:c,secp192k1:f,secp192r1:p,secp224r1:l,secp256r1:h}},{"./ec.js":211,jsbn:301}],213:[function(e,t,r){"use strict";r.version=e("../package.json").version,r.utils=e("./elliptic/utils"),r.rand=e("brorand"),r.curve=e("./elliptic/curve"),r.curves=e("./elliptic/curves"),r.ec=e("./elliptic/ec"),r.eddsa=e("./elliptic/eddsa")},{"../package.json":228,"./elliptic/curve":216,"./elliptic/curves":219,"./elliptic/ec":220,"./elliptic/eddsa":223,"./elliptic/utils":227,brorand:131}],214:[function(e,t,r){"use strict";var i=e("bn.js"),n=e("../utils"),j=n.getNAF,E=n.getJSF,f=n.assert;function a(e,t){this.type=e,this.p=new i(t.p,16),this.red=t.prime?i.red(t.prime):i.mont(this.p),this.zero=new i(0).toRed(this.red),this.one=new i(1).toRed(this.red),this.two=new i(2).toRed(this.red),this.n=t.n&&new i(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;t=this.n&&this.p.div(this.n);!t||0>1]):o.mixedAdd(n[-u-1>>1].neg()):0>1]):o.add(n[-u-1>>1].neg())}return"affine"===e.type?o.toP():o},a.prototype._wnafMulAdd=function(e,t,r,i,n){for(var a=this._wnafT1,o=this._wnafT2,s=this._wnafT3,u=0,c=0;c>1]:S<0&&(x=o[g][-S-1>>1].neg()),v="affine"===x.type?v.mixedAdd(x):v.add(x))}}for(c=0;c=Math.ceil((e.bitLength()+1)/t.step)},o.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],i=this,n=0;n":""},c.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},c.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),r=(r=this.z.redSqr()).redIAdd(r),i=this.curve._mulA(e),n=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),a=i.redAdd(t),e=a.redSub(r),r=i.redSub(t),i=n.redMul(e),t=a.redMul(r),r=n.redMul(r),a=e.redMul(a);return this.curve.point(i,t,a,r)},c.prototype._projDbl=function(){var e,t,r,i,n,a,o=this.x.redAdd(this.y).redSqr(),s=this.x.redSqr(),u=this.y.redSqr();return a=this.curve.twisted?(e=(i=this.curve._mulA(s)).redAdd(u),this.zOne?(t=o.redSub(s).redSub(u).redMul(e.redSub(this.curve.two)),r=e.redMul(i.redSub(u)),e.redSqr().redSub(e).redSub(e)):(n=this.z.redSqr(),a=e.redSub(n).redISub(n),t=o.redSub(s).redISub(u).redMul(a),r=e.redMul(i.redSub(u)),e.redMul(a))):(i=s.redAdd(u),n=this.curve._mulC(this.z).redSqr(),a=i.redSub(n).redSub(n),t=this.curve._mulC(o.redISub(i)).redMul(a),r=this.curve._mulC(i).redMul(s.redISub(u)),i.redMul(a)),this.curve.point(t,r,a)},c.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},c.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),i=this.t.redMul(this.curve.dd).redMul(e.t),n=this.z.redMul(e.z.redAdd(e.z)),a=r.redSub(t),e=n.redSub(i),n=n.redAdd(i),i=r.redAdd(t),r=a.redMul(e),t=n.redMul(i),i=a.redMul(i),n=e.redMul(n);return this.curve.point(r,t,n,i)},c.prototype._projAdd=function(e){var t,r=this.z.redMul(e.z),i=r.redSqr(),n=this.x.redMul(e.x),a=this.y.redMul(e.y),o=this.curve.d.redMul(n).redMul(a),s=i.redSub(o),o=i.redAdd(o),e=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(n).redISub(a),e=r.redMul(s).redMul(e),o=this.curve.twisted?(t=r.redMul(o).redMul(a.redSub(this.curve._mulA(n))),s.redMul(o)):(t=r.redMul(o).redMul(a.redSub(n)),this.curve._mulC(s).redMul(o));return this.curve.point(e,t,o)},c.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},c.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},c.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},c.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},c.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},c.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},c.prototype.getX=function(){return this.normalize(),this.x.fromRed()},c.prototype.getY=function(){return this.normalize(),this.y.fromRed()},c.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},c.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var r=e.clone(),i=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),0<=r.cmp(this.curve.p))return!1;if(t.redIAdd(i),0===this.x.cmp(t))return!0}},c.prototype.toP=c.prototype.normalize,c.prototype.mixedAdd=c.prototype.add},{"../utils":227,"./base":214,"bn.js":129,inherits:296}],216:[function(e,t,r){"use strict";r.base=e("./base"),r.short=e("./short"),r.mont=e("./mont"),r.edwards=e("./edwards")},{"./base":214,"./edwards":215,"./mont":217,"./short":218}],217:[function(e,t,r){"use strict";var i=e("bn.js"),n=e("inherits"),a=e("./base"),o=e("../utils");function s(e){a.call(this,"mont",e),this.a=new i(e.a,16).toRed(this.red),this.b=new i(e.b,16).toRed(this.red),this.i4=new i(4).toRed(this.red).redInvm(),this.two=new i(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function u(e,t,r){a.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new i(t,16),this.z=new i(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}n(s,a),(t.exports=s).prototype.validate=function(e){var t=e.normalize().x,e=t.redSqr(),t=e.redMul(t).redAdd(e.redMul(this.a)).redAdd(t);return 0===t.redSqrt().redSqr().cmp(t)},n(u,a.BasePoint),s.prototype.decodePoint=function(e,t){return this.point(o.toArray(e,t),1)},s.prototype.point=function(e,t){return new u(this,e,t)},s.prototype.pointFromJSON=function(e){return u.fromJSON(this,e)},u.prototype.precompute=function(){},u.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},u.fromJSON=function(e,t){return new u(e,t[0],t[1]||e.one)},u.prototype.inspect=function(){return this.isInfinity()?"":""},u.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},u.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),r=e.redSub(t),e=e.redMul(t),r=r.redMul(t.redAdd(this.curve.a24.redMul(r)));return this.curve.point(e,r)},u.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),i=this.x.redSub(this.z),n=e.x.redAdd(e.z),r=e.x.redSub(e.z).redMul(r),n=n.redMul(i),i=t.z.redMul(r.redAdd(n).redSqr()),n=t.x.redMul(r.redISub(n).redSqr());return this.curve.point(i,n)},u.prototype.mul=function(e){for(var t=e.clone(),r=this,i=this.curve.point(null,null),n=[];0!==t.cmpn(0);t.iushrn(1))n.push(t.andln(1));for(var a=n.length-1;0<=a;a--)0===n[a]?(r=r.diffAdd(i,this),i=i.dbl()):(i=r.diffAdd(i,this),r=r.dbl());return i},u.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},u.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},u.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},{"../utils":227,"./base":214,"bn.js":129,inherits:296}],218:[function(e,t,r){"use strict";var i=e("../utils"),v=e("bn.js"),n=e("inherits"),a=e("./base"),o=i.assert;function s(e){a.call(this,"short",e),this.a=new v(e.a,16).toRed(this.red),this.b=new v(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function u(e,t,r,i){a.BasePoint.call(this,e,"affine"),null===t&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new v(t,16),this.y=new v(r,16),i&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function c(e,t,r,i){a.BasePoint.call(this,e,"jacobian"),null===t&&null===r&&null===i?(this.x=this.curve.one,this.y=this.curve.one,this.z=new v(0)):(this.x=new v(t,16),this.y=new v(r,16),this.z=new v(i,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}n(s,a),(t.exports=s).prototype._getEndomorphism=function(e){var t,r,i;if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3))return r=(e.beta?new v(e.beta,16):r=(i=this._getEndoRoots(this.p))[0].cmp(i[1])<0?i[0]:i[1]).toRed(this.red),e.lambda?t=new v(e.lambda,16):(i=this._getEndoRoots(this.n),0===this.g.mul(i[0]).x.cmp(this.g.x.redMul(r))?t=i[0]:(t=i[1],o(0===this.g.mul(t).x.cmp(this.g.x.redMul(r))))),{beta:r,lambda:t,basis:e.basis?e.basis.map(function(e){return{a:new v(e.a,16),b:new v(e.b,16)}}):this._getEndoBasis(t)}},s.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:v.mont(e),r=new v(2).toRed(t).redInvm(),e=r.redNeg(),r=new v(3).toRed(t).redNeg().redSqrt().redMul(r);return[e.redAdd(r).fromRed(),e.redSub(r).fromRed()]},s.prototype._getEndoBasis=function(e){for(var t,r,i,n,a,o,s,u=this.n.ushrn(Math.floor(this.n.bitLength()/2)),c=e,f=this.n.clone(),p=new v(1),l=new v(0),h=new v(0),d=new v(1),m=0;0!==c.cmpn(0);){var g=f.div(c),b=f.sub(g.mul(c)),y=h.sub(g.mul(p)),g=d.sub(g.mul(l));if(!i&&b.cmp(u)<0)t=s.neg(),r=p,i=b.neg(),n=y;else if(i&&2==++m)break;f=c,c=s=b,h=p,p=y,d=l,l=g}a=b.neg(),o=y;e=i.sqr().add(n.sqr());return 0<=a.sqr().add(o.sqr()).cmp(e)&&(a=t,o=r),i.negative&&(i=i.neg(),n=n.neg()),a.negative&&(a=a.neg(),o=o.neg()),[{a:i,b:n},{a:a,b:o}]},s.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],i=t[1],n=i.b.mul(e).divRound(this.n),a=r.b.neg().mul(e).divRound(this.n),o=n.mul(r.a),t=a.mul(i.a),r=n.mul(r.b),i=a.mul(i.b);return{k1:e.sub(o).sub(t),k2:r.add(i).neg()}},s.prototype.pointFromX=function(e,t){var r=(e=!(e=new v(e,16)).red?e.toRed(this.red):e).redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),i=r.redSqrt();if(0!==i.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");r=i.fromRed().isOdd();return(t&&!r||!t&&r)&&(i=i.redNeg()),this.point(e,i)},s.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,e=this.a.redMul(t),e=t.redSqr().redMul(t).redIAdd(e).redIAdd(this.b);return 0===r.redSqr().redISub(e).cmpn(0)},s.prototype._endoWnafMulAdd=function(e,t,r){for(var i=this._endoWnafT1,n=this._endoWnafT2,a=0;a":""},u.prototype.isInfinity=function(){return this.inf},u.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y),e=(t=0!==t.cmpn(0)?t.redMul(this.x.redSub(e.x).redInvm()):t).redSqr().redISub(this.x).redISub(e.x),t=t.redMul(this.x.redSub(e)).redISub(this.y);return this.curve.point(e,t)},u.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),e=e.redInvm(),t=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(e),e=t.redSqr().redISub(this.x.redAdd(this.x)),t=t.redMul(this.x.redSub(e)).redISub(this.y);return this.curve.point(e,t)},u.prototype.getX=function(){return this.x.fromRed()},u.prototype.getY=function(){return this.y.fromRed()},u.prototype.mul=function(e){return e=new v(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},u.prototype.mulAdd=function(e,t,r){t=[this,t],r=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(t,r):this.curve._wnafMulAdd(1,t,r,2)},u.prototype.jmulAdd=function(e,t,r){t=[this,t],r=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(t,r,!0):this.curve._wnafMulAdd(1,t,r,2,!0)},u.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},u.prototype.neg=function(e){if(this.inf)return this;var t,r=this.curve.point(this.x,this.y.redNeg());return e&&this.precomputed&&(t=this.precomputed,e=function(e){return e.neg()},r.precomputed={naf:t.naf&&{wnd:t.naf.wnd,points:t.naf.points.map(e)},doubles:t.doubles&&{step:t.doubles.step,points:t.doubles.points.map(e)}}),r},u.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},n(c,a.BasePoint),s.prototype.jpoint=function(e,t,r){return new c(this,e,t,r)},c.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),e=this.y.redMul(t).redMul(e);return this.curve.point(r,e)},c.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},c.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),i=this.x.redMul(t),n=e.x.redMul(r),a=this.y.redMul(t.redMul(e.z)),o=e.y.redMul(r.redMul(this.z)),t=i.redSub(n),r=a.redSub(o);if(0===t.cmpn(0))return 0!==r.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();n=t.redSqr(),o=n.redMul(t),i=i.redMul(n),n=r.redSqr().redIAdd(o).redISub(i).redISub(i),o=r.redMul(i.redISub(n)).redISub(a.redMul(o)),t=this.z.redMul(e.z).redMul(t);return this.curve.jpoint(n,o,t)},c.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,i=e.x.redMul(t),n=this.y,a=e.y.redMul(t).redMul(this.z),e=r.redSub(i),t=n.redSub(a);if(0===e.cmpn(0))return 0!==t.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();i=e.redSqr(),a=i.redMul(e),r=r.redMul(i),i=t.redSqr().redIAdd(a).redISub(r).redISub(r),a=t.redMul(r.redISub(i)).redISub(n.redMul(a)),e=this.z.redMul(e);return this.curve.jpoint(i,a,e)},c.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var t=this,r=0;r":""},c.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},{"../utils":227,"./base":214,"bn.js":129,inherits:296}],219:[function(e,t,r){"use strict";var i,n=r,r=e("hash.js"),a=e("./curve"),o=e("./utils").assert;function s(e){"short"===e.type?this.curve=new a.short(e):"edwards"===e.type?this.curve=new a.edwards(e):this.curve=new a.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,o(this.g.validate(),"Invalid curve"),o(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function u(t,r){Object.defineProperty(n,t,{configurable:!0,enumerable:!0,get:function(){var e=new s(r);return Object.defineProperty(n,t,{configurable:!0,enumerable:!0,value:e}),e}})}n.PresetCurve=s,u("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:r.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),u("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:r.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),u("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:r.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),u("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:r.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),u("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:r.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),u("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:r.sha256,gRed:!1,g:["9"]}),u("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:r.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{i=e("./precomputed/secp256k1")}catch(e){i=void 0}u("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:r.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",i]})},{"./curve":216,"./precomputed/secp256k1":226,"./utils":227,"hash.js":275}],220:[function(e,t,r){"use strict";var l=e("bn.js"),h=e("hmac-drbg"),i=e("../utils"),n=e("../curves"),a=e("brorand"),s=i.assert,o=e("./key"),d=e("./signature");function u(e){if(!(this instanceof u))return new u(e);"string"==typeof e&&(s(n.hasOwnProperty(e),"Unknown curve "+e),e=n[e]),e instanceof n.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}(t.exports=u).prototype.keyPair=function(e){return new o(this,e)},u.prototype.keyFromPrivate=function(e,t){return o.fromPrivate(this,e,t)},u.prototype.keyFromPublic=function(e,t){return o.fromPublic(this,e,t)},u.prototype.genKeyPair=function(e){e=e||{};for(var t=new h({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||a(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),i=this.n.sub(new l(2));;){var n=new l(t.generate(r));if(!(0>1;if(0<=o.cmp(this.curve.p.umod(this.curve.n))&&r)throw new Error("Unable to find sencond key candinate");o=r?this.curve.pointFromX(o.add(this.curve.n),e):this.curve.pointFromX(o,e);t=t.r.invm(n),a=n.sub(a).mul(t).umod(n),n=i.mul(t).umod(n);return this.g.mulAdd(a,o,n)},u.prototype.getKeyRecoveryParam=function(e,t,r,i){if(null!==(t=new d(t,i)).recoveryParam)return t.recoveryParam;for(var n,a=0;a<4;a++){try{n=this.recoverPubKey(e,t,a)}catch(e){continue}if(n.eq(r))return a}throw new Error("Unable to find valid recovery factor")}},{"../curves":219,"../utils":227,"./key":221,"./signature":222,"bn.js":129,brorand:131,"hmac-drbg":288}],221:[function(e,t,r){"use strict";var i=e("bn.js"),n=e("../utils").assert;function a(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}(t.exports=a).fromPublic=function(e,t,r){return t instanceof a?t:new a(e,{pub:t,pubEnc:r})},a.fromPrivate=function(e,t,r){return t instanceof a?t:new a(e,{priv:t,privEnc:r})},a.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},a.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},a.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},a.prototype._importPrivate=function(e,t){this.priv=new i(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},a.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?n(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||n(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},a.prototype.derive=function(e){return e.mul(this.priv).getX()},a.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},a.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},a.prototype.inspect=function(){return""}},{"../utils":227,"bn.js":129}],222:[function(e,t,r){"use strict";var n=e("bn.js"),a=e("../utils"),i=a.assert;function o(e,t){if(e instanceof o)return e;this._importDER(e,t)||(i(e.r&&e.s,"Signature without r or s"),this.r=new n(e.r,16),this.s=new n(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function s(){this.place=0}function u(e,t){var r=e[t.place++];if(!(128&r))return r;var i=15&r;if(0==i||4>>=0;return!(n<=127)&&(t.place=o,n)}function c(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}(t.exports=o).prototype._importDER=function(e,t){e=a.toArray(e,t);var r=new s;if(48!==e[r.place++])return!1;var i=u(e,r);if(!1===i)return!1;if(i+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;t=u(e,r);if(!1===t)return!1;i=e.slice(r.place,t+r.place);if(r.place+=t,2!==e[r.place++])return!1;t=u(e,r);if(!1===t)return!1;if(e.length!==t+r.place)return!1;r=e.slice(r.place,t+r.place);if(0===i[0]){if(!(128&i[1]))return!1;i=i.slice(1)}if(0===r[0]){if(!(128&r[1]))return!1;r=r.slice(1)}return this.r=new n(i),this.s=new n(r),!(this.recoveryParam=null)},o.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=c(t),r=c(r);!(r[0]||128&r[1]);)r=r.slice(1);var i=[2];f(i,t.length),(i=i.concat(t)).push(2),f(i,r.length);t=i.concat(r),i=[48];return f(i,t.length),i=i.concat(t),a.encode(i,e)}},{"../utils":227,"bn.js":129}],223:[function(e,t,r){"use strict";var i=e("hash.js"),n=e("../curves"),a=e("../utils"),o=a.assert,s=a.parseBytes,u=e("./key"),c=e("./signature");function f(e){if(o("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof f))return new f(e);e=n[e].curve;this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=i.sha512}(t.exports=f).prototype.sign=function(e,t){e=s(e);var r=this.keyFromSecret(t),i=this.hashInt(r.messagePrefix(),e),n=this.g.mul(i),t=this.encodePoint(n),r=this.hashInt(t,r.pubBytes(),e).mul(r.priv()),r=i.add(r).umod(this.curve.n);return this.makeSignature({R:n,S:r,Rencoded:t})},f.prototype.verify=function(e,t,r){e=s(e),t=this.makeSignature(t);var i=this.keyFromPublic(r),r=this.hashInt(t.Rencoded(),i.pubBytes(),e),e=this.g.mul(t.S());return t.R().add(i.pub().mul(r)).eq(e)},f.prototype.hashInt=function(){for(var e=this.hash(),t=0;t>1)-1>1)-u:u,a.isubn(s)):s=0,i[o]=s,a.iushrn(1)}return i},i.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var i=0,n=0;0r&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace()),this},i.prototype.once=function(e,t){if(!u(t))throw TypeError("listener must be a function");var r=!1;function i(){this.removeListener(e,i),r||(r=!0,t.apply(this,arguments))}return i.listener=t,this.on(e,i),this},i.prototype.removeListener=function(e,t){var r,i,n,a;if(!u(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(n=(r=this._events[e]).length,i=-1,r===t||u(r.listener)&&r.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(c(r)){for(a=n;0=this._blockSize;){for(var n=this._blockOffset;n=this._delta8){t=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-t,e.length),0===this.pending.length&&(this.pending=null),e=i.join32(e,0,e.length-t,this.endian);for(var r=0;r>>24&255,i[n++]=e>>>16&255,i[n++]=e>>>8&255,i[n++]=255&e}else for(i[n++]=255&e,i[n++]=e>>>8&255,i[n++]=e>>>16&255,i[n++]=e>>>24&255,i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=0,a=8;athis.blockSize&&(e=(new this.Hash).update(e).digest()),n(e.length<=this.blockSize);for(var t=e.length;t>>3},r.g1_256=function(e){return i(e,17)^i(e,19)^e>>>10}},{"../utils":286}],286:[function(e,t,r){"use strict";var u=e("minimalistic-assert"),e=e("inherits");function a(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function i(e){return 1===e.length?"0"+e:e}function o(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}r.inherits=e,r.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r,i,n=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),o=0;o>6|192,n[a++]=63&s|128):(i=o,55296!=(64512&(r=e).charCodeAt(i))||i<0||i+1>=r.length||56320!=(64512&r.charCodeAt(i+1))?n[a++]=s>>12|224:(s=65536+((1023&s)<<10)+(1023&e.charCodeAt(++o)),n[a++]=s>>18|240,n[a++]=s>>12&63|128),n[a++]=s>>6&63|128,n[a++]=63&s|128)}else for(o=0;o>>0}return n},r.split32=function(e,t){for(var r=new Array(4*e.length),i=0,n=0;i>>24,r[n+1]=a>>>16&255,r[n+2]=a>>>8&255,r[n+3]=255&a):(r[n+3]=a>>>24,r[n+2]=a>>>16&255,r[n+1]=a>>>8&255,r[n]=255&a)}return r},r.rotr32=function(e,t){return e>>>t|e<<32-t},r.rotl32=function(e,t){return e<>>32-t},r.sum32=function(e,t){return e+t>>>0},r.sum32_3=function(e,t,r){return e+t+r>>>0},r.sum32_4=function(e,t,r,i){return e+t+r+i>>>0},r.sum32_5=function(e,t,r,i,n){return e+t+r+i+n>>>0},r.sum64=function(e,t,r,i){var n=e[t],a=i+e[t+1]>>>0,n=(a>>0,e[t+1]=a},r.sum64_hi=function(e,t,r,i){return(t+i>>>0>>0},r.sum64_lo=function(e,t,r,i){return t+i>>>0},r.sum64_4_hi=function(e,t,r,i,n,a,o,s){var u=0,c=t;return u+=(c=c+i>>>0)>>0)>>0)>>0},r.sum64_4_lo=function(e,t,r,i,n,a,o,s){return t+i+a+s>>>0},r.sum64_5_hi=function(e,t,r,i,n,a,o,s,u,c){var f=0,p=t;return f+=(p=p+i>>>0)>>0)>>0)>>0)>>0},r.sum64_5_lo=function(e,t,r,i,n,a,o,s,u,c){return t+i+a+s+c>>>0},r.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},r.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},r.shr64_hi=function(e,t,r){return e>>>r},r.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},{inherits:287,"minimalistic-assert":324}],287:[function(e,t,r){arguments[4][162][0].apply(r,arguments)},{dup:162}],288:[function(e,t,r){"use strict";var i=e("hash.js"),a=e("minimalistic-crypto-utils"),n=e("minimalistic-assert");function o(e){if(!(this instanceof o))return new o(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=a.toArray(e.entropy,e.entropyEnc||"hex"),r=a.toArray(e.nonce,e.nonceEnc||"hex"),e=a.toArray(e.pers,e.persEnc||"hex");n(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,e)}(t.exports=o).prototype._init=function(e,t,r){r=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},o.prototype.generate=function(e,t,r,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(i=r,r=t,t=null),r&&(r=a.toArray(r,i||"hex"),this._update(r));for(var n=[];n.length1e3*t.clockSkew)throw new S("clock skew of "+d/1e3+"s was greater than "+t.clockSkew+"s")}if(t.headers.forEach(function(e){if(u.params.headers.indexOf(e.toLowerCase())<0)throw new A(e+" was not a signed header")}),t.algorithms&&-1===t.algorithms.indexOf(u.params.algorithm))throw new E(u.params.algorithm+" is not a supported algorithm");return u.algorithm=u.params.algorithm.toUpperCase(),u.keyId=u.params.keyId,u}}},{"./utils":292,"assert-plus":67,util:481}],291:[function(n,a,e){(function(k){(function(){var f=n("assert-plus"),p=n("crypto"),e=(n("http"),n("util")),l=n("sshpk"),h=n("jsprim"),t=n("./utils"),d=n("util").format,m=t.HASH_ALGOS,g=t.PK_ALGOS,b=t.InvalidAlgorithmError,r=t.HttpSignatureError,y=t.validateAlgorithm,v='Signature keyId="%s",algorithm="%s",headers="%s",signature="%s"';function _(e){r.call(this,e,_)}function w(e){r.call(this,e,w)}function i(e){f.object(e,"options");var t=[];if(void 0!==e.algorithm&&(f.string(e.algorithm,"options.algorithm"),t=y(e.algorithm)),this.rs_alg=t,void 0!==e.sign)f.func(e.sign,"options.sign"),this.rs_signFunc=e.sign;else if("hmac"===t[0]&&void 0!==e.key){if(f.string(e.keyId,"options.keyId"),this.rs_keyId=e.keyId,"string"!=typeof e.key&&!k.isBuffer(e.key))throw new TypeError("options.key for HMAC must be a string or Buffer");this.rs_signer=p.createHmac(t[1].toUpperCase(),e.key),this.rs_signer.sign=function(){var e=this.digest("base64");return{hashAlgorithm:t[1],toString:function(){return e}}}}else{if(void 0===e.key)throw new TypeError("options.sign (func) or options.key is required");var r=e.key;if("string"!=typeof r&&!k.isBuffer(r)||(r=l.parsePrivateKey(r)),f.ok(l.PrivateKey.isPrivateKey(r,[1,2]),"options.key must be a sshpk.PrivateKey"),this.rs_key=r,f.string(e.keyId,"options.keyId"),this.rs_keyId=e.keyId,!g[r.type])throw new b(r.type.toUpperCase()+" type keys are not supported");if(void 0!==t[0]&&r.type!==t[0])throw new b("options.key must be a "+t[0].toUpperCase()+" key, was given a "+r.type.toUpperCase()+" key instead");this.rs_signer=r.createSign(t[1])}this.rs_headers=[],this.rs_lines=[]}e.inherits(_,r),e.inherits(w,r),i.prototype.writeHeader=function(e,t){return f.string(e,"header"),e=e.toLowerCase(),f.string(t,"value"),this.rs_headers.push(e),this.rs_signFunc?this.rs_lines.push(e+": "+t):(e=e+": "+t,0>1,f=-7,p=r?n-1:0,l=r?-1:1,r=e[t+p];for(p+=l,a=r&(1<<-f)-1,r>>=-f,f+=s;0>=-f,f+=i;0>1,p=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,l=i?0:a-1,h=i?1:-1,a=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=c):(o=Math.floor(Math.log(t)/Math.LN2),t*(i=Math.pow(2,-o))<1&&(o--,i*=2),2<=(t+=1<=o+f?p/i:p*Math.pow(2,1-f))*i&&(o++,i/=2),c<=o+f?(s=0,o=c):1<=o+f?(s=(t*i-1)*Math.pow(2,n),o+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,n),o=0));8<=n;e[r+l]=255&s,l+=h,s/=256,n-=8);for(o=o<>15;0<=--a;){var u=32767&this[e],c=this[e++]>>15,f=s*u+c*o;n=((u=o*u+((32767&f)<<15)+r[i]+(1073741823&n))>>>30)+(f>>>15)+s*c+(n>>>30),r[i++]=1073741823&u}return n},30):e&&"Netscape"!=navigator.appName?(b.prototype.am=function(e,t,r,i,n,a){for(;0<=--a;){var o=t*this[e++]+r[i]+n;n=Math.floor(o/67108864),r[i++]=67108863&o}return n},26):(b.prototype.am=function(e,t,r,i,n,a){for(var o=16383&t,s=t>>14;0<=--a;){var u=16383&this[e],c=this[e++]>>14,f=s*u+c*o;n=((u=o*u+((16383&f)<<14)+r[i]+n)>>28)+(f>>14)+s*c,r[i++]=268435455&u}return n},28);b.prototype.DB=e,b.prototype.DM=(1<