(function(e){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=e()}else if(typeof define==="function"&&define.amd){define([],e)}else{var t;if(typeof window!=="undefined"){t=window}else if(typeof global!=="undefined"){t=global}else if(typeof self!=="undefined"){t=self}else{t=this}t.PeerId=e()}})(function(){var define,module,exports;return function e(t,r,i){function n(f,s){if(!r[f]){if(!t[f]){var o=typeof require=="function"&&require;if(!s&&o)return o(f,!0);if(a)return a(f,!0);var c=new Error("Cannot find module '"+f+"'");throw c.code="MODULE_NOT_FOUND",c}var h=r[f]={exports:{}};t[f][0].call(h.exports,function(e){var r=t[f][1][e];return n(r?r:e)},h,h.exports,e,t,r,i)}return r[f].exports}var a=typeof require=="function"&&require;for(var f=0;f>6];var n=(r&32)===0;if((r&31)===31){var a=r;r=0;while((a&128)===128){a=e.readUInt8(t);if(e.isError(a))return a;r<<=7;r|=a&127}}else{r&=31}var f=s.tag[r];return{cls:i,primitive:n,tag:r,tagStr:f}}function d(e,t,r){var i=e.readUInt8(r);if(e.isError(i))return i;if(!t&&i===128)return null;if((i&128)===0){return i}var n=i&127;if(n>=4)return e.error("length octect is too long");i=0;for(var a=0;a=256;o>>=8)s++;var f=new n(1+1+s);f[0]=a;f[1]=128|s;for(var o=1+s,c=i.length;c>0;o--,c>>=8)f[o]=c&255;return this._createEncoderBuffer([f,i])};h.prototype._encodeStr=function b(e,t){if(t==="octstr")return this._createEncoderBuffer(e);else if(t==="bitstr")return this._createEncoderBuffer([e.unused|0,e.data]);else if(t==="ia5str"||t==="utf8str")return this._createEncoderBuffer(e);return this.reporter.error("Encoding of string type: "+t+" unsupported")};h.prototype._encodeObjid=function v(e,t,r){if(typeof e==="string"){if(!t)return this.reporter.error("string objid given, but no values map found");if(!t.hasOwnProperty(e))return this.reporter.error("objid not found in values map");e=t[e].split(/[\s\.]+/g);for(var i=0;i=40)return this.reporter.error("Second objid identifier OOB");e.splice(0,2,e[0]*40+e[1])}var a=0;for(var i=0;i=128;f>>=7)a++}var s=new n(a);var o=s.length-1;for(var i=e.length-1;i>=0;i--){var f=e[i];s[o--]=f&127;while((f>>=7)>0)s[o--]=128|f&127}return this._createEncoderBuffer(s)};function d(e){if(e<10)return"0"+e;else return e}h.prototype._encodeTime=function y(e,t){var r;var i=new Date(e);if(t==="gentime"){r=[d(i.getFullYear()),d(i.getUTCMonth()+1),d(i.getUTCDate()),d(i.getUTCHours()),d(i.getUTCMinutes()),d(i.getUTCSeconds()),"Z"].join("")}else if(t==="utctime"){r=[d(i.getFullYear()%100),d(i.getUTCMonth()+1),d(i.getUTCDate()),d(i.getUTCHours()),d(i.getUTCMinutes()),d(i.getUTCSeconds()),"Z"].join("")}else{this.reporter.error("Encoding "+t+" time is not supported yet")}return this._encodeStr(r,"octstr")};h.prototype._encodeNull=function g(){return this._createEncoderBuffer("")};h.prototype._encodeInt=function m(e,t){if(typeof e==="string"){if(!t)return this.reporter.error("String int or enum given, but no values map");if(!t.hasOwnProperty(e)){return this.reporter.error("Values map doesn't contain: "+JSON.stringify(e))}e=t[e]}if(typeof e!=="number"&&!n.isBuffer(e)){var r=e.toArray();if(!e.sign&&r[0]&128){r.unshift(0)}e=new n(r)}if(n.isBuffer(e)){var i=e.length;if(e.length===0)i++;var a=new n(i);e.copy(a);if(e.length===0)a[0]=0;return this._createEncoderBuffer(a)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);var i=1;for(var f=e;f>=256;f>>=8)i++;var a=new Array(i);for(var f=a.length-1;f>=0;f--){a[f]=e&255;e>>=8}if(a[0]&128){a.unshift(0)}return this._createEncoderBuffer(new n(a))};h.prototype._encodeBool=function w(e){return this._createEncoderBuffer(e?255:0)};h.prototype._use=function _(e,t){if(typeof e==="function")e=e(t);return e._getEncoder("der").tree};h.prototype._skipDefault=function S(e,t,r){var i=this._baseState;var n;if(i["default"]===null)return false;var a=e.join();if(i.defaultBuffer===undefined)i.defaultBuffer=this._encodeValue(i["default"],t,r).join();if(a.length!==i.defaultBuffer.length)return false;for(n=0;n=31)return i.error("Multi-octet tag encoding unsupported");if(!t)n|=32;n|=o.tagClassByName[r||"universal"]<<6;return n}},{"../../asn1":1,buffer:46,inherits:92}],13:[function(e,t,r){var i=r;i.der=e("./der");i.pem=e("./pem")},{"./der":12,"./pem":14}],14:[function(e,t,r){var i=e("inherits");var n=e("buffer").Buffer;var a=e("../../asn1");var f=e("./der");function s(e){f.call(this,e);this.enc="pem"}i(s,f);t.exports=s;s.prototype.encode=function o(e,t){var r=f.prototype.encode.call(this,e);var i=r.toString("base64");var n=["-----BEGIN "+t.label+"-----"];for(var a=0;a>8;f[a]&=255}while(o){f.push(o&255);o>>=8}}for(n=0;e[n]===i&&n0){throw new Error("Invalid string. Length must be a multiple of 4")}var o=e.length;f="="===e.charAt(o-2)?2:"="===e.charAt(o-1)?1:0;s=new t(e.length*3/4-f);n=f>0?e.length-4:e.length;var c=0;function d(e){s[c++]=e}for(r=0,i=0;r>16);d((a&65280)>>8);d(a&255)}if(f===2){a=h(e.charAt(r))<<2|h(e.charAt(r+1))>>4;d(a&255)}else if(f===1){a=h(e.charAt(r))<<10|h(e.charAt(r+1))<<4|h(e.charAt(r+2))>>2;d(a>>8&255);d(a&255)}return s}function u(e){var t,r=e.length%3,n="",a,f;function s(e){return i.charAt(e)}function o(e){return s(e>>18&63)+s(e>>12&63)+s(e>>6&63)+s(e&63)}for(t=0,f=e.length-r;t>2);n+=s(a<<4&63);n+="==";break;case 2:a=(e[e.length-2]<<8)+e[e.length-1];n+=s(a>>10);n+=s(a>>4&63);n+=s(a<<2&63);n+="=";break}return n}e.toByteArray=d;e.fromByteArray=u})(typeof r==="undefined"?this.base64js={}:r)},{}],17:[function(e,t,r){(function(e,t){"use strict";function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype;e.prototype=new r;e.prototype.constructor=e}function n(e,t,r){if(e!==null&&typeof e==="object"&&Array.isArray(e.words)){return e}this.negative=0;this.words=null;this.length=0;this.red=null;if(t==="le"||t==="be"){r=t;t=10}if(e!==null)this._init(e||0,t||10,r||"be")}if(typeof e==="object")e.exports=n;else t.BN=n;n.BN=n;n.wordSize=26;n.max=function _(e,t){if(e.cmp(t)>0)return e;else return t};n.min=function S(e,t){if(e.cmp(t)<0)return e;else return t};n.prototype._init=function E(e,t,i){if(typeof e==="number"){return this._initNumber(e,t,i)}else if(typeof e==="object"){return this._initArray(e,t,i)}if(t==="hex")t=16;r(t===(t|0)&&t>=2&&t<=36);e=e.toString().replace(/\s+/g,"");var n=0;if(e[0]==="-")n++;if(t===16)this._parseHex(e,n);else this._parseBase(e,t,n);if(e[0]==="-")this.negative=1;this.strip();if(i!=="le")return;this._initArray(this.toArray(),t,i)};n.prototype._initNumber=function B(e,t,i){if(e<0){this.negative=1;e=-e}if(e<67108864){this.words=[e&67108863];this.length=1}else if(e<4503599627370496){this.words=[e&67108863,e/67108864&67108863];this.length=2}else{r(e<9007199254740992);this.words=[e&67108863,e/67108864&67108863,1];this.length=3}if(i!=="le")return;this._initArray(this.toArray(),t,i)};n.prototype._initArray=function A(e,t,i){r(typeof e.length==="number");if(e.length<=0){this.words=[0];this.length=1;return this}this.length=Math.ceil(e.length/3);this.words=new Array(this.length);for(var n=0;n=0;n-=3){var s=e[n]|e[n-1]<<8|e[n-2]<<16;this.words[f]|=s<>>26-a&67108863;a+=24;if(a>=26){a-=26;f++}}}else if(i==="le"){for(var n=0,f=0;n>>26-a&67108863;a+=24;if(a>=26){a-=26;f++}}}return this.strip()};function a(e,t,r){var i=0;var n=Math.min(e.length,r);for(var a=t;a=49&&f<=54)i|=f-49+10;else if(f>=17&&f<=22)i|=f-17+10;else i|=f&15}return i}n.prototype._parseHex=function I(e,t){this.length=Math.ceil((e.length-t)/6);this.words=new Array(this.length);for(var r=0;r=t;r-=6){var f=a(e,r,r+6);this.words[n]|=f<>>26-i&4194303;i+=24;if(i>=26){i-=26;n++}}if(r+6!==t){var f=a(e,t,r+6);this.words[n]|=f<>>26-i&4194303}this.strip()};function f(e,t,r,i){var n=0;var a=Math.min(e.length,r);for(var f=t;f=49)n+=s-49+10;else if(s>=17)n+=s-17+10;else n+=s}return n}n.prototype._parseBase=function k(e,t,r){this.words=[0];this.length=1;for(var i=0,n=1;n<=67108863;n*=t)i++;i--;n=n/t|0;var a=e.length-r;var s=a%i;var o=Math.min(a,a-s)+r;var c=0;for(var h=r;h1&&this.words[this.length-1]===0)this.length--;return this._normSign()};n.prototype._normSign=function C(){if(this.length===1&&this.words[0]===0)this.negative=0;return this};n.prototype.inspect=function M(){return(this.red?""};var s=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"];var o=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5];var c=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];n.prototype.toString=function P(e,t){e=e||10;var t=t|0||1;if(e===16||e==="hex"){var i="";var n=0;var a=0;for(var f=0;f>>24-n&16777215;if(a!==0||f!==this.length-1)i=s[6-d.length]+d+i;else i=d+i;n+=2;if(n>=26){n-=26;f--}}if(a!==0)i=a.toString(16)+i;while(i.length%t!==0)i="0"+i;if(this.negative!==0)i="-"+i;return i}else if(e===(e|0)&&e>=2&&e<=36){var u=o[e];var l=c[e];var i="";var p=this.clone();p.negative=0;while(p.cmpn(0)!==0){var b=p.modn(l).toString(e);p=p.idivn(l);if(p.cmpn(0)!==0)i=s[u-b.length]+b+i;else i=b+i}if(this.cmpn(0)===0)i="0"+i;while(i.length%t!==0)i="0"+i;if(this.negative!==0)i="-"+i;return i}else{ r(false,"Base should be between 2 and 36")}};n.prototype.toJSON=function D(){return this.toString(16)};n.prototype.toArray=function L(e,t){this.strip();var i=e==="le";var n=new Array(this.byteLength());n[0]=0;var a=this.clone();if(!i){for(var f=0;a.cmpn(0)!==0;f++){var s=a.andln(255);a.iushrn(8);n[n.length-f-1]=s}}else{for(var f=0;a.cmpn(0)!==0;f++){var s=a.andln(255);a.iushrn(8);n[f]=s}}if(t){r(n.length<=t,"byte array longer than desired length");while(n.length=4096){r+=13;t>>>=13}if(t>=64){r+=7;t>>>=7}if(t>=8){r+=4;t>>>=4}if(t>=2){r+=2;t>>>=2}return r+t}}n.prototype._zeroBits=function N(e){if(e===0)return 26;var t=e;var r=0;if((t&8191)===0){r+=13;t>>>=13}if((t&127)===0){r+=7;t>>>=7}if((t&15)===0){r+=4;t>>>=4}if((t&3)===0){r+=2;t>>>=2}if((t&1)===0)r++;return r};n.prototype.bitLength=function O(){var e=0;var t=this.words[this.length-1];var e=this._countBits(t);return(this.length-1)*26+e};function h(e){var t=new Array(e.bitLength());for(var r=0;r>>n}return t}n.prototype.zeroBits=function U(){if(this.cmpn(0)===0)return 0;var e=0;for(var t=0;te.length)return this.clone().ior(e);else return e.clone().ior(this)};n.prototype.uor=function X(e){if(this.length>e.length)return this.clone().iuor(e);else return e.clone().iuor(this)};n.prototype.iuand=function W(e){var t;if(this.length>e.length)t=e;else t=this;for(var r=0;re.length)return this.clone().iand(e);else return e.clone().iand(this)};n.prototype.uand=function Z(e){if(this.length>e.length)return this.clone().iuand(e);else return e.clone().iuand(this)};n.prototype.iuxor=function Q(e){var t;var r;if(this.length>e.length){t=this;r=e}else{t=e;r=this}for(var i=0;ie.length)return this.clone().ixor(e);else return e.clone().ixor(this)};n.prototype.uxor=function te(e){if(this.length>e.length)return this.clone().iuxor(e);else return e.clone().iuxor(this)};n.prototype.setn=function re(e,t){r(typeof e==="number"&&e>=0);var i=e/26|0;var n=e%26;while(this.length<=i)this.words[this.length++]=0;if(t)this.words[i]=this.words[i]|1<e.length){r=this;i=e}else{r=e;i=this}var n=0;for(var a=0;a>>26}for(;n!==0&&a>>26}this.length=r.length;if(n!==0){this.words[this.length]=n;this.length++}else if(r!==this){for(;ae.length)return this.clone().iadd(e);else return e.clone().iadd(this)};n.prototype.isub=function ae(e){if(e.negative!==0){e.negative=0;var t=this.iadd(e);e.negative=1;return t._normSign()}else if(this.negative!==0){this.negative=0;this.iadd(e);this.negative=1;return this._normSign()}var r=this.cmp(e);if(r===0){this.negative=0;this.length=1;this.words[0]=0;return this}var i;var n;if(r>0){i=this;n=e}else{i=e;n=this}var a=0;for(var f=0;f>26;this.words[f]=t&67108863}for(;a!==0&&f>26;this.words[f]=t&67108863}if(a===0&&f>>26;var d=o&67108863;var u=Math.min(c,t.length-1);for(var l=Math.max(0,c-e.length+1);l<=u;l++){var p=c-l|0;var n=e.words[p]|0;var a=t.words[l]|0;var f=n*a;var s=f&67108863;h=h+(f/67108864|0)|0;s=s+d|0;d=s&67108863;h=h+(s>>>26)|0}r.words[c]=d|0;o=h|0}if(o!==0){r.words[c]=o|0}else{r.length--}return r.strip()}function u(e,t,r){r.negative=t.negative^e.negative;r.length=e.length+t.length;var i=0;var n=0;for(var a=0;a>>26)|0;n+=f>>>26;f&=67108863}r.words[a]=s;i=f;f=n}if(i!==0){r.words[a]=i}else{r.length--}return r.strip()}n.prototype.mulTo=function se(e,t){var r;if(this.length+e.length<63)r=d(this,e,t);else r=u(this,e,t);return r};n.prototype.mul=function oe(e){var t=new n(null);t.words=new Array(this.length+e.length);return this.mulTo(e,t)};n.prototype.imul=function ce(e){if(this.cmpn(0)===0||e.cmpn(0)===0){this.words[0]=0;this.length=1;return this}var t=this.length;var r=e.length;this.negative=e.negative^this.negative;this.length=this.length+e.length;this.words[this.length-1]=0;for(var i=this.length-2;i>=0;i--){var n=0;var a=0;var f=Math.min(i,r-1);for(var s=Math.max(0,i-t+1);s<=f;s++){var o=i-s;var c=this.words[o]|0;var h=e.words[s]|0;var d=c*h;var u=d&67108863;n+=d/67108864|0;u+=a;a=u&67108863;n+=u>>>26}this.words[i]=a;this.words[i+1]+=n;n=0}var n=0;for(var o=1;o>>26}return this.strip()};n.prototype.imuln=function he(e){r(typeof e==="number");var t=0;for(var i=0;i>=26;t+=n/67108864|0;t+=a>>>26;this.words[i]=a&67108863}if(t!==0){this.words[i]=t;this.length++}return this};n.prototype.muln=function de(e){return this.clone().imuln(e)};n.prototype.sqr=function ue(){return this.mul(this)};n.prototype.isqr=function le(){return this.mul(this)};n.prototype.pow=function pe(e){var t=h(e);if(t.length===0)return new n(1);var r=this;for(var i=0;i=0);var t=e%26;var i=(e-t)/26;var n=67108863>>>26-t<<26-t;if(t!==0){var a=0;for(var f=0;f>>26-t}if(a){this.words[f]=a;this.length++}}if(i!==0){for(var f=this.length-1;f>=0;f--)this.words[f+i]=this.words[f];for(var f=0;f=0);var n;if(t)n=(t-t%26)/26;else n=0;var a=e%26;var f=Math.min((e-a)/26,this.length);var s=67108863^67108863>>>a<f){this.length-=f;for(var c=0;c=0&&(h!==0||c>=n);c--){var d=this.words[c]|0;this.words[c]=h<<26-a|d>>>a;h=d&s}if(o&&h!==0)o.words[o.length++]=h;if(this.length===0){this.words[0]=0;this.length=1}this.strip();return this};n.prototype.ishrn=function ge(e,t,i){r(this.negative===0);return this.iushrn(e,t,i)};n.prototype.shln=function me(e){return this.clone().ishln(e)};n.prototype.ushln=function we(e){return this.clone().iushln(e)};n.prototype.shrn=function _e(e){return this.clone().ishrn(e)};n.prototype.ushrn=function Se(e){return this.clone().iushrn(e)};n.prototype.testn=function Ee(e){r(typeof e==="number"&&e>=0);var t=e%26;var i=(e-t)/26;var n=1<=0);var t=e%26;var i=(e-t)/26;r(this.negative===0,"imaskn works only with positive numbers");if(t!==0)i++;this.length=Math.min(i,this.length);if(t!==0){var n=67108863^67108863>>>t<=67108864;t++){this.words[t]-=67108864;if(t===this.length-1)this.words[t+1]=1;else this.words[t+1]++}this.length=Math.max(this.length,t+1);return this};n.prototype.isubn=function xe(e){r(typeof e==="number");if(e<0)return this.iaddn(-e);if(this.negative!==0){this.negative=0;this.iaddn(e);this.negative=1;return this}this.words[0]-=e;for(var t=0;t>26)-(c/67108864|0);this.words[a+i]=o&67108863}for(;a>26;this.words[a+i]=o&67108863}if(s===0)return this.strip();r(s===-1);s=0;for(var a=0;a>26;this.words[a]=o&67108863}this.negative=1;return this.strip()};n.prototype._wordDiv=function De(e,t){var r=this.length-e.length;var i=this.clone();var a=e;var f=a.words[a.length-1]|0;var s=this._countBits(f);r=26-s;if(r!==0){a=a.ushln(r);i.iushln(r);f=a.words[a.length-1]|0}var o=i.length-a.length;var c;if(t!=="mod"){c=new n(null);c.length=o+1;c.words=new Array(c.length);for(var h=0;h=0;u--){var l=(i.words[a.length+u]|0)*67108864+(i.words[a.length+u-1]|0);l=Math.min(l/f|0,67108863);i._ishlnsubmul(a,l,u);while(i.negative!==0){l--;i.negative=0;i._ishlnsubmul(a,1,u);if(i.cmpn(0)!==0)i.negative^=1}if(c)c.words[u]=l}if(c)c.strip();i.strip();if(t!=="div"&&r!==0)i.iushrn(r);return{div:c?c:null,mod:i}};n.prototype.divmod=function Le(e,t,i){r(e.cmpn(0)!==0);if(this.negative!==0&&e.negative===0){var a=this.neg().divmod(e,t);var f;var s;if(t!=="mod")f=a.div.neg();if(t!=="div"){s=a.mod.neg();if(i&&s.neg)s=s.add(e)}return{div:f,mod:s}}else if(this.negative===0&&e.negative!==0){var a=this.divmod(e.neg(),t);var f;if(t!=="mod")f=a.div.neg();return{div:f,mod:a.mod}}else if((this.negative&e.negative)!==0){var a=this.neg().divmod(e.neg(),t);var s;if(t!=="div"){s=a.mod.neg();if(i&&s.neg)s=s.isub(e)}return{div:a.div,mod:s}}if(e.length>this.length||this.cmp(e)<0)return{div:new n(0),mod:this};if(e.length===1){if(t==="div")return{div:this.divn(e.words[0]),mod:null};else if(t==="mod")return{div:null,mod:new n(this.modn(e.words[0]))};return{div:this.divn(e.words[0]),mod:new n(this.modn(e.words[0]))}}return this._wordDiv(e,t)};n.prototype.div=function je(e){return this.divmod(e,"div",false).div};n.prototype.mod=function qe(e){return this.divmod(e,"mod",false).mod};n.prototype.umod=function Ne(e){return this.divmod(e,"mod",true).mod};n.prototype.divRound=function Oe(e){var t=this.divmod(e);if(t.mod.cmpn(0)===0)return t.div;var r=t.div.negative!==0?t.mod.isub(e):t.mod;var i=e.ushrn(1);var n=e.andln(1);var a=r.cmp(i);if(a<0||n===1&&a===0)return t.div;return t.div.negative!==0?t.div.isubn(1):t.div.iaddn(1)};n.prototype.modn=function Ue(e){r(e<=67108863);var t=(1<<26)%e;var i=0;for(var n=this.length-1;n>=0;n--)i=(t*i+(this.words[n]|0))%e;return i};n.prototype.idivn=function ze(e){r(e<=67108863);var t=0;for(var i=this.length-1;i>=0;i--){var n=(this.words[i]|0)+t*67108864;this.words[i]=n/e|0;t=n%e}return this.strip()};n.prototype.divn=function Ke(e){return this.clone().idivn(e)};n.prototype.egcd=function Fe(e){r(e.negative===0);r(e.cmpn(0)!==0);var t=this;var i=e.clone();if(t.negative!==0)t=t.umod(e);else t=t.clone();var a=new n(1);var f=new n(0);var s=new n(0);var o=new n(1);var c=0;while(t.isEven()&&i.isEven()){t.iushrn(1);i.iushrn(1);++c}var h=i.clone();var d=t.clone();while(t.cmpn(0)!==0){while(t.isEven()){t.iushrn(1);if(a.isEven()&&f.isEven()){a.iushrn(1);f.iushrn(1)}else{a.iadd(h).iushrn(1);f.isub(d).iushrn(1)}}while(i.isEven()){i.iushrn(1);if(s.isEven()&&o.isEven()){s.iushrn(1);o.iushrn(1)}else{s.iadd(h).iushrn(1);o.isub(d).iushrn(1)}}if(t.cmp(i)>=0){t.isub(i);a.isub(s);f.isub(o)}else{i.isub(t);s.isub(a);o.isub(f)}}return{a:s,b:o,gcd:i.iushln(c)}};n.prototype._invmp=function Ve(e){r(e.negative===0);r(e.cmpn(0)!==0);var t=this;var i=e.clone();if(t.negative!==0)t=t.umod(e);else t=t.clone();var a=new n(1);var f=new n(0);var s=i.clone();while(t.cmpn(1)>0&&i.cmpn(1)>0){while(t.isEven()){t.iushrn(1);if(a.isEven())a.iushrn(1);else a.iadd(s).iushrn(1)}while(i.isEven()){i.iushrn(1);if(f.isEven())f.iushrn(1);else f.iadd(s).iushrn(1)}if(t.cmp(i)>=0){t.isub(i);a.isub(f)}else{i.isub(t);f.isub(a)}}var o;if(t.cmpn(1)===0)o=a;else o=f;if(o.cmpn(0)<0)o.iadd(e);return o};n.prototype.gcd=function He(e){if(this.cmpn(0)===0)return e.clone();if(e.cmpn(0)===0)return this.clone();var t=this.clone();var r=e.clone();t.negative=0;r.negative=0;for(var i=0;t.isEven()&&r.isEven();i++){t.iushrn(1);r.iushrn(1)}do{while(t.isEven())t.iushrn(1);while(r.isEven())r.iushrn(1);var n=t.cmp(r);if(n<0){var a=t;t=r;r=a}else if(n===0||r.cmpn(1)===0){break}t.isub(r)}while(true);return r.iushln(i)};n.prototype.invm=function Ye(e){return this.egcd(e).a.umod(e)};n.prototype.isEven=function Xe(){return(this.words[0]&1)===0};n.prototype.isOdd=function We(){return(this.words[0]&1)===1};n.prototype.andln=function Ge(e){return this.words[0]&e};n.prototype.bincn=function Je(e){r(typeof e==="number");var t=e%26;var i=(e-t)/26;var n=1<>>26;s&=67108863;this.words[a]=s}if(f!==0){this.words[a]=f;this.length++}return this};n.prototype.cmpn=function Ze(e){var t=e<0;if(t)e=-e;if(this.negative!==0&&!t)return-1;else if(this.negative===0&&t)return 1;e&=67108863;this.strip();var r;if(this.length>1){r=1}else{var i=this.words[0]|0;r=i===e?0:ie.length)return 1;else if(this.length=0;r--){var i=this.words[r]|0;var n=e.words[r]|0;if(i===n)continue;if(in)t=1;break}return t};n.red=function et(e){return new m(e)};n.prototype.toRed=function tt(e){r(!this.red,"Already a number in reduction context");r(this.negative===0,"red works only with positives");return e.convertTo(this)._forceRed(e)};n.prototype.fromRed=function rt(){r(this.red,"fromRed works only with numbers in reduction context");return this.red.convertFrom(this)};n.prototype._forceRed=function it(e){this.red=e;return this};n.prototype.forceRed=function nt(e){r(!this.red,"Already a number in reduction context");return this._forceRed(e)};n.prototype.redAdd=function at(e){r(this.red,"redAdd works only with red numbers");return this.red.add(this,e)};n.prototype.redIAdd=function ft(e){r(this.red,"redIAdd works only with red numbers");return this.red.iadd(this,e)};n.prototype.redSub=function st(e){r(this.red,"redSub works only with red numbers");return this.red.sub(this,e)};n.prototype.redISub=function ot(e){r(this.red,"redISub works only with red numbers");return this.red.isub(this,e)};n.prototype.redShl=function ct(e){r(this.red,"redShl works only with red numbers");return this.red.ushl(this,e)};n.prototype.redMul=function ht(e){r(this.red,"redMul works only with red numbers");this.red._verify2(this,e);return this.red.mul(this,e)};n.prototype.redIMul=function dt(e){r(this.red,"redMul works only with red numbers");this.red._verify2(this,e);return this.red.imul(this,e)};n.prototype.redSqr=function ut(){r(this.red,"redSqr works only with red numbers");this.red._verify1(this);return this.red.sqr(this)};n.prototype.redISqr=function lt(){r(this.red,"redISqr works only with red numbers");this.red._verify1(this);return this.red.isqr(this)};n.prototype.redSqrt=function pt(){r(this.red,"redSqrt works only with red numbers");this.red._verify1(this);return this.red.sqrt(this)};n.prototype.redInvm=function bt(){r(this.red,"redInvm works only with red numbers");this.red._verify1(this);return this.red.invm(this)};n.prototype.redNeg=function vt(){r(this.red,"redNeg works only with red numbers");this.red._verify1(this);return this.red.neg(this)};n.prototype.redPow=function yt(e){r(this.red&&!e.red,"redPow(normalNum)");this.red._verify1(this);return this.red.pow(this,e)};var l={k256:null,p224:null,p192:null,p25519:null};function p(e,t){this.name=e;this.p=new n(t,16);this.n=this.p.bitLength();this.k=new n(1).iushln(this.n).isub(this.p);this.tmp=this._tmp()}p.prototype._tmp=function gt(){var e=new n(null);e.words=new Array(Math.ceil(this.n/13));return e};p.prototype.ireduce=function mt(e){var t=e;var r;do{this.split(t,this.tmp);t=this.imulK(t);t=t.iadd(this.tmp);r=t.bitLength()}while(r>this.n);var i=r0){t.isub(this.p)}else{t.strip()}return t};p.prototype.split=function wt(e,t){e.iushrn(this.n,0,t)};p.prototype.imulK=function _t(e){return e.imul(this.k)};function b(){p.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(b,p);b.prototype.split=function St(e,t){var r=4194303;var i=Math.min(e.length,9);for(var n=0;n>>22;a=f}e.words[n-10]=a>>>22;e.length-=9};b.prototype.imulK=function Et(e){e.words[e.length]=0;e.words[e.length+1]=0;e.length+=2;var t;var r=0;for(var i=0;i>>=26;e.words[r]=n;t=i}if(t!==0)e.words[e.length++]=t;return e};n._prime=function At(e){if(l[e])return l[e];var At;if(e==="k256")At=new b;else if(e==="p224")At=new v;else if(e==="p192")At=new y;else if(e==="p25519")At=new g;else throw new Error("Unknown prime "+e);l[e]=At;return At};function m(e){if(typeof e==="string"){var t=n._prime(e);this.m=t.p;this.prime=t}else{this.m=e;this.prime=null}}m.prototype._verify1=function It(e){r(e.negative===0,"red works only with positives");r(e.red,"red works only with red numbers")};m.prototype._verify2=function kt(e,t){r((e.negative|t.negative)===0,"red works only with positives");r(e.red&&e.red===t.red,"red works only with red numbers")};m.prototype.imod=function xt(e){if(this.prime)return this.prime.ireduce(e)._forceRed(this);return e.umod(this.m)._forceRed(this)};m.prototype.neg=function Rt(e){var t=e.clone();t.negative^=1;return t.iadd(this.m)._forceRed(this)};m.prototype.add=function Tt(e,t){this._verify2(e,t);var r=e.add(t);if(r.cmp(this.m)>=0)r.isub(this.m);return r._forceRed(this)};m.prototype.iadd=function Ct(e,t){this._verify2(e,t);var r=e.iadd(t);if(r.cmp(this.m)>=0)r.isub(this.m);return r};m.prototype.sub=function Mt(e,t){this._verify2(e,t);var r=e.sub(t);if(r.cmpn(0)<0)r.iadd(this.m);return r._forceRed(this)};m.prototype.isub=function Pt(e,t){this._verify2(e,t);var r=e.isub(t);if(r.cmpn(0)<0)r.iadd(this.m);return r};m.prototype.shl=function Dt(e,t){this._verify1(e);return this.imod(e.ushln(t))};m.prototype.imul=function Lt(e,t){this._verify2(e,t);return this.imod(e.imul(t))};m.prototype.mul=function jt(e,t){this._verify2(e,t);return this.imod(e.mul(t))};m.prototype.isqr=function qt(e){return this.imul(e,e)};m.prototype.sqr=function Nt(e){return this.mul(e,e)};m.prototype.sqrt=function Ot(e){if(e.cmpn(0)===0)return e.clone();var t=this.m.andln(3);r(t%2===1);if(t===3){var i=this.m.add(new n(1)).iushrn(2);var a=this.pow(e,i);return a}var f=this.m.subn(1);var s=0;while(f.cmpn(0)!==0&&f.andln(1)===0){s++;f.iushrn(1)}r(f.cmpn(0)!==0);var o=new n(1).toRed(this);var c=o.redNeg();var h=this.m.subn(1).iushrn(1);var d=this.m.bitLength();d=new n(2*d*d).toRed(this);while(this.pow(d,h).cmp(c)!==0)d.redIAdd(c);var u=this.pow(d,f);var a=this.pow(e,f.addn(1).iushrn(1));var l=this.pow(e,f);var p=s;while(l.cmp(o)!==0){var b=l;for(var v=0;b.cmp(o)!==0;v++)b=b.redSqr();r(v=0;a--){var h=t.words[a];for(var d=c-1;d>=0;d--){var u=h>>d&1;if(f!==i[0])f=this.sqr(f);if(u===0&&s===0){o=0;continue}s<<=1;s|=u;o++;if(o!==r&&(a!==0||d!==0))continue;f=this.mul(f,i[s]);o=0;s=0}c=26}return f};m.prototype.convertTo=function Kt(e){var t=e.umod(this.m);if(t===e)return t.clone();else return t};m.prototype.convertFrom=function Ft(e){var t=e.clone();t.red=null;return t};n.mont=function Vt(e){return new w(e)};function w(e){m.call(this,e);this.shift=this.m.bitLength();if(this.shift%26!==0)this.shift+=26-this.shift%26;this.r=new n(1).iushln(this.shift);this.r2=this.imod(this.r.sqr());this.rinv=this.r._invmp(this.m);this.minv=this.rinv.mul(this.r).isubn(1).div(this.m);this.minv=this.minv.umod(this.r);this.minv=this.r.sub(this.minv)}i(w,m);w.prototype.convertTo=function Ht(e){return this.imod(e.ushln(this.shift))};w.prototype.convertFrom=function Yt(e){var t=this.imod(e.mul(this.rinv));t.red=null;return t};w.prototype.imul=function Xt(e,t){if(e.cmpn(0)===0||t.cmpn(0)===0){e.words[0]=0;e.length=1;return e}var r=e.imul(t);var i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);var n=r.isub(i).iushrn(this.shift);var a=n;if(n.cmp(this.m)>=0)a=n.isub(this.m);else if(n.cmpn(0)<0)a=n.iadd(this.m);return a._forceRed(this)};w.prototype.mul=function Wt(e,t){if(e.cmpn(0)===0||t.cmpn(0)===0)return new n(0)._forceRed(this);var r=e.mul(t);var i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);var a=r.isub(i).iushrn(this.shift);var f=a;if(a.cmp(this.m)>=0)f=a.isub(this.m);else if(a.cmpn(0)<0)f=a.iadd(this.m);return f._forceRed(this)};w.prototype.invm=function Gt(e){var t=this.imod(e._invmp(this.m).mul(this.r2));return t._forceRed(this)}})(typeof t==="undefined"||t,this)},{}],18:[function(e,t,r){var i;t.exports=function s(e){if(!i)i=new n(null);return i.generate(e)};function n(e){this.rand=e}t.exports.Rand=n;n.prototype.generate=function o(e){return this._rand(e)};if(typeof window==="object"){if(window.crypto&&window.crypto.getRandomValues){n.prototype._rand=function c(e){var t=new Uint8Array(e);window.crypto.getRandomValues(t);return t}}else if(window.msCrypto&&window.msCrypto.getRandomValues){n.prototype._rand=function h(e){var t=new Uint8Array(e);window.msCrypto.getRandomValues(t);return t}}else{n.prototype._rand=function(){throw new Error("Not implemented yet")}}}else{try{var a=e("cry"+"pto");n.prototype._rand=function d(e){return a.randomBytes(e)}}catch(f){n.prototype._rand=function u(e){var t=new Uint8Array(e);for(var r=0;rt||e<0?(i=Math.abs(e)%t,e<0?t-i:i):e;return r}function n(e){for(var t=0;t>>8^r&255^99;this.SBOX[n]=r;this.INV_SBOX[r]=n;a=e[n];f=e[a];s=e[f];i=e[r]*257^r*16843008;this.SUB_MIX[0][n]=i<<24|i>>>8;this.SUB_MIX[1][n]=i<<16|i>>>16;this.SUB_MIX[2][n]=i<<8|i>>>24;this.SUB_MIX[3][n]=i;i=s*16843009^f*65537^a*257^n*16843008;this.INV_SUB_MIX[0][r]=i<<24|i>>>8;this.INV_SUB_MIX[1][r]=i<<16|i>>>16;this.INV_SUB_MIX[2][r]=i<<8|i>>>24;this.INV_SUB_MIX[3][r]=i;if(n===0){n=o=1}else{n=a^e[e[e[s^a]]];o^=e[e[o]]}}return true};var f=new a;o.blockSize=4*4;o.prototype.blockSize=o.blockSize;o.keySize=256/8;o.prototype.keySize=o.keySize;function s(e){var t=e.length/4;var r=new Array(t);var i=-1;while(++i>>24,a=f.SBOX[a>>>24]<<24|f.SBOX[a>>>16&255]<<16|f.SBOX[a>>>8&255]<<8|f.SBOX[a&255],a^=f.RCON[i/t|0]<<24):t>6&&i%t===4?a=f.SBOX[a>>>24]<<24|f.SBOX[a>>>16&255]<<16|f.SBOX[a>>>8&255]<<8|f.SBOX[a&255]:void 0,this._keySchedule[i-t]^a)}this._invKeySchedule=[];for(e=0;e>>24]]^f.INV_SUB_MIX[1][f.SBOX[a>>>16&255]]^f.INV_SUB_MIX[2][f.SBOX[a>>>8&255]]^f.INV_SUB_MIX[3][f.SBOX[a&255]]}return true};o.prototype.encryptBlock=function(t){t=s(new e(t));var r=this._doCryptBlock(t,this._keySchedule,f.SUB_MIX,f.SBOX);var i=new e(16);i.writeUInt32BE(r[0],0);i.writeUInt32BE(r[1],4);i.writeUInt32BE(r[2],8);i.writeUInt32BE(r[3],12);return i};o.prototype.decryptBlock=function(t){t=s(new e(t));var r=[t[3],t[1]];t[1]=r[0];t[3]=r[1];var i=this._doCryptBlock(t,this._invKeySchedule,f.INV_SUB_MIX,f.INV_SBOX);var n=new e(16);n.writeUInt32BE(i[0],0);n.writeUInt32BE(i[3],4);n.writeUInt32BE(i[2],8);n.writeUInt32BE(i[1],12);return n};o.prototype.scrub=function(){n(this._keySchedule);n(this._invKeySchedule);n(this._key)};o.prototype._doCryptBlock=function(e,t,r,n){var a,f,s,o,c,h,d,u,l;f=e[0]^t[0];s=e[1]^t[1];o=e[2]^t[2];c=e[3]^t[3];a=4;for(var p=1;p>>24]^r[1][s>>>16&255]^r[2][o>>>8&255]^r[3][c&255]^t[a++];d=r[0][s>>>24]^r[1][o>>>16&255]^r[2][c>>>8&255]^r[3][f&255]^t[a++];u=r[0][o>>>24]^r[1][c>>>16&255]^r[2][f>>>8&255]^r[3][s&255]^t[a++];l=r[0][c>>>24]^r[1][f>>>16&255]^r[2][s>>>8&255]^r[3][o&255]^t[a++];f=h;s=d;o=u;c=l}h=(n[f>>>24]<<24|n[s>>>16&255]<<16|n[o>>>8&255]<<8|n[c&255])^t[a++];d=(n[s>>>24]<<24|n[o>>>16&255]<<16|n[c>>>8&255]<<8|n[f&255])^t[a++];u=(n[o>>>24]<<24|n[c>>>16&255]<<16|n[f>>>8&255]<<8|n[s&255])^t[a++];l=(n[c>>>24]<<24|n[f>>>16&255]<<16|n[s>>>8&255]<<8|n[o&255])^t[a++];return[i(h),i(d),i(u),i(l)]};r.AES=o}).call(this,e("buffer").Buffer)},{buffer:46}],21:[function(e,t,r){(function(r){var i=e("./aes");var n=e("cipher-base");var a=e("inherits");var f=e("./ghash");var s=e("buffer-xor");a(o,n);t.exports=o;function o(e,t,a,s){if(!(this instanceof o)){return new o(e,t,a)}n.call(this);this._finID=r.concat([a,new r([0,0,0,1])]);a=r.concat([a,new r([0,0,0,2])]);this._cipher=new i.AES(t);this._prev=new r(a.length);this._cache=new r("");this._secCache=new r("");this._decrypt=s;this._alen=0;this._len=0;a.copy(this._prev);this._mode=e;var c=new r(4);c.fill(0);this._ghash=new f(this._cipher.encryptBlock(c));this._authTag=null;this._called=false}o.prototype._update=function(e){if(!this._called&&this._alen){var t=16-this._alen%16;if(t<16){t=new r(t);t.fill(0);this._ghash.update(t)}}this._called=true;var i=this._mode.encrypt(this,e);if(this._decrypt){this._ghash.update(e)}else{this._ghash.update(i)}this._len+=e.length;return i};o.prototype._final=function(){if(this._decrypt&&!this._authTag){throw new Error("Unsupported state or unable to authenticate data")}var e=s(this._ghash.final(this._alen*8,this._len*8),this._cipher.encryptBlock(this._finID));if(this._decrypt){if(c(e,this._authTag)){throw new Error("Unsupported state or unable to authenticate data")}}else{this._authTag=e}this._cipher.scrub()};o.prototype.getAuthTag=function h(){if(!this._decrypt&&r.isBuffer(this._authTag)){return this._authTag}else{throw new Error("Attempting to get auth tag in unsupported state")}};o.prototype.setAuthTag=function d(e){if(this._decrypt){this._authTag=e}else{throw new Error("Attempting to set auth tag in unsupported state")}};o.prototype.setAAD=function u(e){if(!this._called){this._ghash.update(e);this._alen+=e.length}else{throw new Error("Attempting to set AAD in unsupported state")}};function c(e,t){var r=0;if(e.length!==t.length){r++}var i=Math.min(e.length,t.length);var n=-1;while(++n16){t=this.cache.slice(0,16);this.cache=this.cache.slice(16);return t}}else{if(this.cache.length>=16){t=this.cache.slice(0,16);this.cache=this.cache.slice(16);return t}}return null};d.prototype.flush=function(){if(this.cache.length){return this.cache}};function u(e){var t=e[15];var r=-1;while(++r15){var e=this.cache.slice(0,16);this.cache=this.cache.slice(16);return e}return null};d.prototype.flush=function(){var e=16-this.cache.length;var r=new t(e);var i=-1;while(++i0;r--){e[r]=e[r]>>>1|(e[r-1]&1)<<31}e[0]=e[0]>>>1;if(f){e[0]=e[0]^225<<24}}this.state=a(t)};i.prototype.update=function(t){this.cache=e.concat([this.cache,t]);var r;while(this.cache.length>=16){r=this.cache.slice(0,16);this.cache=this.cache.slice(16);this.ghash(r)}};i.prototype.final=function(t,i){if(this.cache.length){this.ghash(e.concat([this.cache,r],16))}this.ghash(a([0,t,0,i]));return this.state};function n(e){return[e.readUInt32BE(0),e.readUInt32BE(4),e.readUInt32BE(8),e.readUInt32BE(12)]}function a(t){t=t.map(s);var r=new e(16);r.writeUInt32BE(t[0],0);r.writeUInt32BE(t[1],4);r.writeUInt32BE(t[2],8);r.writeUInt32BE(t[3],12);return r}var f=Math.pow(2,32);function s(e){var t,r;t=e>f||e<0?(r=Math.abs(e)%f,e<0?f-r:r):e;return t}function o(e,t){return[e[0]^t[0],e[1]^t[1],e[2]^t[2],e[3]^t[3]]}}).call(this,e("buffer").Buffer)},{buffer:46}],26:[function(e,t,r){r["aes-128-ecb"]={cipher:"AES",key:128,iv:0,mode:"ECB",type:"block"};r["aes-192-ecb"]={cipher:"AES",key:192,iv:0,mode:"ECB",type:"block"};r["aes-256-ecb"]={cipher:"AES",key:256,iv:0,mode:"ECB",type:"block"};r["aes-128-cbc"]={cipher:"AES",key:128,iv:16,mode:"CBC",type:"block"};r["aes-192-cbc"]={cipher:"AES",key:192,iv:16,mode:"CBC",type:"block"};r["aes-256-cbc"]={cipher:"AES",key:256,iv:16,mode:"CBC",type:"block"};r["aes128"]=r["aes-128-cbc"];r["aes192"]=r["aes-192-cbc"];r["aes256"]=r["aes-256-cbc"];r["aes-128-cfb"]={cipher:"AES",key:128,iv:16,mode:"CFB",type:"stream"};r["aes-192-cfb"]={cipher:"AES",key:192,iv:16,mode:"CFB",type:"stream"};r["aes-256-cfb"]={cipher:"AES",key:256,iv:16,mode:"CFB",type:"stream"};r["aes-128-cfb8"]={cipher:"AES",key:128,iv:16,mode:"CFB8",type:"stream"};r["aes-192-cfb8"]={cipher:"AES",key:192,iv:16,mode:"CFB8",type:"stream"};r["aes-256-cfb8"]={cipher:"AES",key:256,iv:16,mode:"CFB8",type:"stream"};r["aes-128-cfb1"]={cipher:"AES",key:128,iv:16,mode:"CFB1",type:"stream"};r["aes-192-cfb1"]={cipher:"AES",key:192,iv:16,mode:"CFB1",type:"stream"};r["aes-256-cfb1"]={cipher:"AES",key:256,iv:16,mode:"CFB1",type:"stream"};r["aes-128-ofb"]={cipher:"AES",key:128,iv:16,mode:"OFB",type:"stream"};r["aes-192-ofb"]={cipher:"AES",key:192,iv:16,mode:"OFB",type:"stream"};r["aes-256-ofb"]={cipher:"AES",key:256,iv:16,mode:"OFB",type:"stream"};r["aes-128-ctr"]={cipher:"AES",key:128,iv:16,mode:"CTR",type:"stream"};r["aes-192-ctr"]={cipher:"AES",key:192,iv:16,mode:"CTR",type:"stream"};r["aes-256-ctr"]={cipher:"AES",key:256,iv:16,mode:"CTR",type:"stream"};r["aes-128-gcm"]={cipher:"AES",key:128,iv:12,mode:"GCM",type:"auth"};r["aes-192-gcm"]={cipher:"AES",key:192,iv:12,mode:"GCM",type:"auth"};r["aes-256-gcm"]={cipher:"AES",key:256,iv:12,mode:"GCM",type:"auth"}},{}],27:[function(e,t,r){var i=e("buffer-xor");r.encrypt=function(e,t){var r=i(t,e._prev);e._prev=e._cipher.encryptBlock(r);return e._prev};r.decrypt=function(e,t){var r=e._prev;e._prev=t;var n=e._cipher.decryptBlock(t);return i(n,r)}},{"buffer-xor":45}],28:[function(e,t,r){(function(t){var i=e("buffer-xor");r.encrypt=function(e,r,i){var a=new t("");var f;while(r.length){if(e._cache.length===0){e._cache=e._cipher.encryptBlock(e._prev);e._prev=new t("")}if(e._cache.length<=r.length){f=e._cache.length;a=t.concat([a,n(e,r.slice(0,f),i)]);r=r.slice(f)}else{a=t.concat([a,n(e,r,i)]);break}}return a};function n(e,r,n){var a=r.length;var f=i(r,e._cache);e._cache=e._cache.slice(a);e._prev=t.concat([e._prev,n?r:f]);return f}}).call(this,e("buffer").Buffer)},{buffer:46,"buffer-xor":45}],29:[function(e,t,r){(function(e){function t(e,t,r){var n;var a=-1;var f=8;var s=0;var o,c;while(++a>a%8;e._prev=i(e._prev,r?o:c)}return s}r.encrypt=function(r,i,n){var a=i.length;var f=new e(a);var s=-1;while(++s>7}return a}}).call(this,e("buffer").Buffer)},{buffer:46}],30:[function(e,t,r){(function(e){function t(t,r,i){var n=t._cipher.encryptBlock(t._prev);var a=n[0]^r;t._prev=e.concat([t._prev.slice(1),new e([i?r:a])]);return a}r.encrypt=function(r,i,n){var a=i.length;var f=new e(a);var s=-1;while(++s=0||!r.umod(e.prime1)||!r.umod(e.prime2)){r=new i(n(t))}return r}}).call(this,e("buffer").Buffer)},{"bn.js":17,buffer:46,randombytes:115}],39:[function(e,t,r){(function(e){"use strict";r["RSA-SHA224"]=r.sha224WithRSAEncryption={sign:"rsa",hash:"sha224",id:new e("302d300d06096086480165030402040500041c","hex")};r["RSA-SHA256"]=r.sha256WithRSAEncryption={sign:"rsa",hash:"sha256",id:new e("3031300d060960864801650304020105000420","hex")};r["RSA-SHA384"]=r.sha384WithRSAEncryption={sign:"rsa",hash:"sha384",id:new e("3041300d060960864801650304020205000430","hex")};r["RSA-SHA512"]=r.sha512WithRSAEncryption={sign:"rsa",hash:"sha512",id:new e("3051300d060960864801650304020305000440","hex")};r["RSA-SHA1"]={sign:"rsa",hash:"sha1",id:new e("3021300906052b0e03021a05000414","hex")};r["ecdsa-with-SHA1"]={sign:"ecdsa",hash:"sha1",id:new e("","hex")};r.DSA=r["DSA-SHA1"]=r["DSA-SHA"]={sign:"dsa",hash:"sha1",id:new e("","hex")};r["DSA-SHA224"]=r["DSA-WITH-SHA224"]={sign:"dsa",hash:"sha224",id:new e("","hex")};r["DSA-SHA256"]=r["DSA-WITH-SHA256"]={sign:"dsa",hash:"sha256",id:new e("","hex")};r["DSA-SHA384"]=r["DSA-WITH-SHA384"]={sign:"dsa",hash:"sha384",id:new e("","hex")};r["DSA-SHA512"]=r["DSA-WITH-SHA512"]={sign:"dsa",hash:"sha512",id:new e("","hex")};r["DSA-RIPEMD160"]={sign:"dsa",hash:"rmd160",id:new e("","hex")};r["RSA-RIPEMD160"]=r.ripemd160WithRSA={sign:"rsa",hash:"rmd160",id:new e("3021300906052b2403020105000414","hex")};r["RSA-MD5"]=r.md5WithRSAEncryption={sign:"rsa",hash:"md5",id:new e("3020300c06082a864886f70d020505000410","hex")}}).call(this,e("buffer").Buffer)},{buffer:46}],40:[function(e,t,r){(function(r){var i=e("./algos");var n=e("create-hash");var a=e("inherits");var f=e("./sign");var s=e("stream");var o=e("./verify");var c={};Object.keys(i).forEach(function(e){c[e]=c[e.toLowerCase()]=i[e]});function h(e){s.Writable.call(this);var t=c[e];if(!t){throw new Error("Unknown message digest")}this._hashType=t.hash;this._hash=n(t.hash);this._tag=t.id;this._signType=t.sign}a(h,s.Writable);h.prototype._write=function p(e,t,r){this._hash.update(e);r()};h.prototype.update=function b(e,t){if(typeof e==="string"){e=new r(e,t)}this._hash.update(e);return this};h.prototype.sign=function v(e,t){this.end();var i=this._hash.digest();var n=f(r.concat([this._tag,i]),e,this._hashType,this._signType);return t?n.toString(t):n};function d(e){s.Writable.call(this);var t=c[e];if(!t){throw new Error("Unknown message digest")}this._hash=n(t.hash);this._tag=t.id;this._signType=t.sign}a(d,s.Writable);d.prototype._write=function y(e,t,r){this._hash.update(e);r()};d.prototype.update=function g(e,t){if(typeof e==="string"){e=new r(e,t)}this._hash.update(e);return this};d.prototype.verify=function m(e,t,i){if(typeof t==="string"){t=new r(t,i)}this.end();var n=this._hash.digest();return o(t,r.concat([this._tag,n]),e,this._signType)};function u(e){return new h(e)}function l(e){return new d(e)}t.exports={Sign:u,Verify:l,createSign:u,createVerify:l}}).call(this,e("buffer").Buffer)},{"./algos":39,"./sign":42,"./verify":43,buffer:46,"create-hash":50,inherits:92,stream:135}],41:[function(e,t,r){"use strict";r["1.3.132.0.10"]="secp256k1";r["1.3.132.0.33"]="p224";r["1.2.840.10045.3.1.1"]="p192";r["1.2.840.10045.3.1.7"]="p256";r["1.3.132.0.34"]="p384";r["1.3.132.0.35"]="p521"},{}],42:[function(e,t,r){(function(r){var i=e("create-hmac");var n=e("browserify-rsa");var a=e("./curves");var f=e("elliptic");var s=e("parse-asn1");var o=e("bn.js");var c=f.ec;function h(e,t,r,i){var a=s(t);if(a.curve){if(i!=="ecdsa")throw new Error("wrong private key type");return d(e,a)}else if(a.type==="dsa"){if(i!=="dsa"){throw new Error("wrong private key type")}return u(e,a,r)}else{if(i!=="rsa")throw new Error("wrong private key type")}var f=a.modulus.byteLength();var o=[0,1];while(e.length+o.length+10){r.ishrn(i)}return r}function v(e,t){e=b(e,t);e=e.mod(t);var i=new r(e.toArray());if(i.length=t){throw new Error("invalid sig")}}t.exports=o}).call(this,e("buffer").Buffer)},{"./curves":41,"bn.js":17,buffer:46,elliptic:65,"parse-asn1":105}],44:[function(e,t,r){var i=e("base-x");var n="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";var a=i(n);t.exports={encode:a.encode,decode:a.decode}},{"base-x":15}],45:[function(e,t,r){(function(e){t.exports=function r(t,i){var n=Math.min(t.length,i.length);var a=new e(n);for(var f=0;f1)return new c(e,arguments[1]);return new c(e)}this.length=0;this.parent=undefined;if(typeof e==="number"){return h(this,e)}if(typeof e==="string"){return d(this,e,arguments.length>1?arguments[1]:"utf8")}return u(this,e)}function h(e,t){e=m(e,t<0?0:w(t)|0);if(!c.TYPED_ARRAY_SUPPORT){for(var r=0;r>>1;if(r)e.parent=f;return e}function w(e){if(e>=o()){throw new RangeError("Attempt to allocate Buffer larger than maximum "+"size: 0x"+o().toString(16)+" bytes")}return e|0}function _(e,t){if(!(this instanceof _))return new _(e,t);var r=new c(e,t);delete r.parent;return r}c.isBuffer=function te(e){return!!(e!=null&&e._isBuffer)};c.compare=function re(e,t){if(!c.isBuffer(e)||!c.isBuffer(t)){throw new TypeError("Arguments must be Buffers")}if(e===t)return 0;var r=e.length;var i=t.length;var n=0;var a=Math.min(r,i);while(n>>1;case"base64":return $(e).length;default:if(i)return J(e).length;t=(""+t).toLowerCase();i=true}}}c.byteLength=S;c.prototype.length=undefined;c.prototype.parent=undefined;function E(e,t,r){var i=false;t=t|0;r=r===undefined||r===Infinity?this.length:r|0;if(!e)e="utf8";if(t<0)t=0;if(r>this.length)r=this.length;if(r<=t)return"";while(true){switch(e){case"hex":return j(this,t,r);case"utf8":case"utf-8":return C(this,t,r);case"ascii":return D(this,t,r);case"binary":return L(this,t,r);case"base64":return T(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return q(this,t,r);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase();i=true}}}c.prototype.toString=function ae(){var e=this.length|0;if(e===0)return"";if(arguments.length===0)return C(this,0,e);return E.apply(this,arguments)};c.prototype.equals=function fe(e){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(this===e)return true;return c.compare(this,e)===0};c.prototype.inspect=function se(){var e="";var t=r.INSPECT_MAX_BYTES;if(this.length>0){e=this.toString("hex",0,t).match(/.{2}/g).join(" ");if(this.length>t)e+=" ... "}return""};c.prototype.compare=function oe(e){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(this===e)return 0;return c.compare(this,e)};c.prototype.indexOf=function ce(e,t){if(t>2147483647)t=2147483647;else if(t<-2147483648)t=-2147483648;t>>=0;if(this.length===0)return-1;if(t>=this.length)return-1;if(t<0)t=Math.max(this.length+t,0);if(typeof e==="string"){if(e.length===0)return-1;return String.prototype.indexOf.call(this,e,t)}if(c.isBuffer(e)){return r(this,e,t)}if(typeof e==="number"){if(c.TYPED_ARRAY_SUPPORT&&Uint8Array.prototype.indexOf==="function"){return Uint8Array.prototype.indexOf.call(this,e,t)}return r(this,[e],t)}function r(e,t,r){var i=-1;for(var n=0;r+nn){i=n}}var a=t.length;if(a%2!==0)throw new Error("Invalid hex string");if(i>a/2){i=a/2}for(var f=0;fa)r=a;if(e.length>0&&(r<0||t<0)||t>this.length){throw new RangeError("attempt to write outside buffer bounds")}if(!i)i="utf8";var f=false;for(;;){switch(i){case"hex":return B(this,e,t,r);case"utf8":case"utf-8":return A(this,e,t,r);case"ascii":return I(this,e,t,r);case"binary":return k(this,e,t,r);case"base64":return x(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,e,t,r);default:if(f)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase();f=true}}};c.prototype.toJSON=function le(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function T(e,t,r){if(t===0&&r===e.length){return i.fromByteArray(e)}else{return i.fromByteArray(e.slice(t,r))}}function C(e,t,r){r=Math.min(e.length,r);var i=[];var n=t;while(n239?4:a>223?3:a>191?2:1;if(n+s<=r){var o,c,h,d;switch(s){case 1:if(a<128){f=a}break;case 2:o=e[n+1];if((o&192)===128){d=(a&31)<<6|o&63;if(d>127){f=d}}break;case 3:o=e[n+1];c=e[n+2];if((o&192)===128&&(c&192)===128){d=(a&15)<<12|(o&63)<<6|c&63;if(d>2047&&(d<55296||d>57343)){f=d}}break;case 4:o=e[n+1];c=e[n+2];h=e[n+3];if((o&192)===128&&(c&192)===128&&(h&192)===128){d=(a&15)<<18|(o&63)<<12|(c&63)<<6|h&63;if(d>65535&&d<1114112){f=d}}}}if(f===null){f=65533;s=1}else if(f>65535){f-=65536;i.push(f>>>10&1023|55296);f=56320|f&1023}i.push(f);n+=s}return P(i)}var M=4096;function P(e){var t=e.length;if(t<=M){return String.fromCharCode.apply(String,e)}var r="";var i=0;while(ii)r=i;var n="";for(var a=t;ar){e=r}if(t<0){t+=r;if(t<0)t=0}else if(t>r){t=r}if(tr)throw new RangeError("Trying to access beyond buffer length")}c.prototype.readUIntLE=function be(e,t,r){e=e|0;t=t|0;if(!r)N(e,t,this.length);var i=this[e];var n=1;var a=0;while(++a0&&(n*=256)){i+=this[e+--t]*n}return i};c.prototype.readUInt8=function ye(e,t){if(!t)N(e,1,this.length);return this[e]};c.prototype.readUInt16LE=function ge(e,t){if(!t)N(e,2,this.length);return this[e]|this[e+1]<<8};c.prototype.readUInt16BE=function me(e,t){if(!t)N(e,2,this.length);return this[e]<<8|this[e+1]};c.prototype.readUInt32LE=function we(e,t){if(!t)N(e,4,this.length);return(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};c.prototype.readUInt32BE=function _e(e,t){if(!t)N(e,4,this.length);return this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3]); };c.prototype.readIntLE=function Se(e,t,r){e=e|0;t=t|0;if(!r)N(e,t,this.length);var i=this[e];var n=1;var a=0;while(++a=n)i-=Math.pow(2,8*t);return i};c.prototype.readIntBE=function Ee(e,t,r){e=e|0;t=t|0;if(!r)N(e,t,this.length);var i=t;var n=1;var a=this[e+--i];while(i>0&&(n*=256)){a+=this[e+--i]*n}n*=128;if(a>=n)a-=Math.pow(2,8*t);return a};c.prototype.readInt8=function Be(e,t){if(!t)N(e,1,this.length);if(!(this[e]&128))return this[e];return(255-this[e]+1)*-1};c.prototype.readInt16LE=function Ae(e,t){if(!t)N(e,2,this.length);var r=this[e]|this[e+1]<<8;return r&32768?r|4294901760:r};c.prototype.readInt16BE=function Ie(e,t){if(!t)N(e,2,this.length);var r=this[e+1]|this[e]<<8;return r&32768?r|4294901760:r};c.prototype.readInt32LE=function ke(e,t){if(!t)N(e,4,this.length);return this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};c.prototype.readInt32BE=function xe(e,t){if(!t)N(e,4,this.length);return this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};c.prototype.readFloatLE=function Re(e,t){if(!t)N(e,4,this.length);return n.read(this,e,true,23,4)};c.prototype.readFloatBE=function Te(e,t){if(!t)N(e,4,this.length);return n.read(this,e,false,23,4)};c.prototype.readDoubleLE=function Ce(e,t){if(!t)N(e,8,this.length);return n.read(this,e,true,52,8)};c.prototype.readDoubleBE=function Me(e,t){if(!t)N(e,8,this.length);return n.read(this,e,false,52,8)};function O(e,t,r,i,n,a){if(!c.isBuffer(e))throw new TypeError("buffer must be a Buffer instance");if(t>n||te.length)throw new RangeError("index out of range")}c.prototype.writeUIntLE=function Pe(e,t,r,i){e=+e;t=t|0;r=r|0;if(!i)O(this,e,t,r,Math.pow(2,8*r),0);var n=1;var a=0;this[t]=e&255;while(++a=0&&(a*=256)){this[t+n]=e/a&255}return t+r};c.prototype.writeUInt8=function Le(e,t,r){e=+e;t=t|0;if(!r)O(this,e,t,1,255,0);if(!c.TYPED_ARRAY_SUPPORT)e=Math.floor(e);this[t]=e&255;return t+1};function U(e,t,r,i){if(t<0)t=65535+t+1;for(var n=0,a=Math.min(e.length-r,2);n>>(i?n:1-n)*8}}c.prototype.writeUInt16LE=function je(e,t,r){e=+e;t=t|0;if(!r)O(this,e,t,2,65535,0);if(c.TYPED_ARRAY_SUPPORT){this[t]=e&255;this[t+1]=e>>>8}else{U(this,e,t,true)}return t+2};c.prototype.writeUInt16BE=function qe(e,t,r){e=+e;t=t|0;if(!r)O(this,e,t,2,65535,0);if(c.TYPED_ARRAY_SUPPORT){this[t]=e>>>8;this[t+1]=e&255}else{U(this,e,t,false)}return t+2};function z(e,t,r,i){if(t<0)t=4294967295+t+1;for(var n=0,a=Math.min(e.length-r,4);n>>(i?n:3-n)*8&255}}c.prototype.writeUInt32LE=function Ne(e,t,r){e=+e;t=t|0;if(!r)O(this,e,t,4,4294967295,0);if(c.TYPED_ARRAY_SUPPORT){this[t+3]=e>>>24;this[t+2]=e>>>16;this[t+1]=e>>>8;this[t]=e&255}else{z(this,e,t,true)}return t+4};c.prototype.writeUInt32BE=function Oe(e,t,r){e=+e;t=t|0;if(!r)O(this,e,t,4,4294967295,0);if(c.TYPED_ARRAY_SUPPORT){this[t]=e>>>24;this[t+1]=e>>>16;this[t+2]=e>>>8;this[t+3]=e&255}else{z(this,e,t,false)}return t+4};c.prototype.writeIntLE=function Ue(e,t,r,i){e=+e;t=t|0;if(!i){var n=Math.pow(2,8*r-1);O(this,e,t,r,n-1,-n)}var a=0;var f=1;var s=e<0?1:0;this[t]=e&255;while(++a>0)-s&255}return t+r};c.prototype.writeIntBE=function ze(e,t,r,i){e=+e;t=t|0;if(!i){var n=Math.pow(2,8*r-1);O(this,e,t,r,n-1,-n)}var a=r-1;var f=1;var s=e<0?1:0;this[t+a]=e&255;while(--a>=0&&(f*=256)){this[t+a]=(e/f>>0)-s&255}return t+r};c.prototype.writeInt8=function Ke(e,t,r){e=+e;t=t|0;if(!r)O(this,e,t,1,127,-128);if(!c.TYPED_ARRAY_SUPPORT)e=Math.floor(e);if(e<0)e=255+e+1;this[t]=e&255;return t+1};c.prototype.writeInt16LE=function Fe(e,t,r){e=+e;t=t|0;if(!r)O(this,e,t,2,32767,-32768);if(c.TYPED_ARRAY_SUPPORT){this[t]=e&255;this[t+1]=e>>>8}else{U(this,e,t,true)}return t+2};c.prototype.writeInt16BE=function Ve(e,t,r){e=+e;t=t|0;if(!r)O(this,e,t,2,32767,-32768);if(c.TYPED_ARRAY_SUPPORT){this[t]=e>>>8;this[t+1]=e&255}else{U(this,e,t,false)}return t+2};c.prototype.writeInt32LE=function He(e,t,r){e=+e;t=t|0;if(!r)O(this,e,t,4,2147483647,-2147483648);if(c.TYPED_ARRAY_SUPPORT){this[t]=e&255;this[t+1]=e>>>8;this[t+2]=e>>>16;this[t+3]=e>>>24}else{z(this,e,t,true)}return t+4};c.prototype.writeInt32BE=function Ye(e,t,r){e=+e;t=t|0;if(!r)O(this,e,t,4,2147483647,-2147483648);if(e<0)e=4294967295+e+1;if(c.TYPED_ARRAY_SUPPORT){this[t]=e>>>24;this[t+1]=e>>>16;this[t+2]=e>>>8;this[t+3]=e&255}else{z(this,e,t,false)}return t+4};function K(e,t,r,i,n,a){if(t>n||te.length)throw new RangeError("index out of range");if(r<0)throw new RangeError("index out of range")}function F(e,t,r,i,a){if(!a){K(e,t,r,4,3.4028234663852886e38,-3.4028234663852886e38)}n.write(e,t,r,i,23,4);return r+4}c.prototype.writeFloatLE=function Xe(e,t,r){return F(this,e,t,true,r)};c.prototype.writeFloatBE=function We(e,t,r){return F(this,e,t,false,r)};function V(e,t,r,i,a){if(!a){K(e,t,r,8,1.7976931348623157e308,-1.7976931348623157e308)}n.write(e,t,r,i,52,8);return r+8}c.prototype.writeDoubleLE=function Ge(e,t,r){return V(this,e,t,true,r)};c.prototype.writeDoubleBE=function Je(e,t,r){return V(this,e,t,false,r)};c.prototype.copy=function Ze(e,t,r,i){if(!r)r=0;if(!i&&i!==0)i=this.length;if(t>=e.length)t=e.length;if(!t)t=0;if(i>0&&i=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");if(i>this.length)i=this.length;if(e.length-t=0;a--){e[a+t]=this[a+r]}}else if(n<1e3||!c.TYPED_ARRAY_SUPPORT){for(a=0;a=this.length)throw new RangeError("start out of bounds");if(r<0||r>this.length)throw new RangeError("end out of bounds");var i;if(typeof e==="number"){for(i=t;i55295&&r<57344){if(!n){if(r>56319){if((t-=3)>-1)a.push(239,191,189);continue}else if(f+1===i){if((t-=3)>-1)a.push(239,191,189);continue}n=r;continue}if(r<56320){if((t-=3)>-1)a.push(239,191,189);n=r;continue}r=n-55296<<10|r-56320|65536}else if(n){if((t-=3)>-1)a.push(239,191,189)}n=null;if(r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else{throw new Error("Invalid code point")}}return a}function Z(e){var t=[];for(var r=0;r>8;n=r%256;a.push(n);a.push(i)}return a}function $(e){return i.toByteArray(X(e))}function ee(e,t,r,i){for(var n=0;n=t.length||n>=e.length)break;t[n+r]=e[n]}return n}}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"base64-js":16,ieee754:90,"is-array":94}],47:[function(e,t,r){(function(r){var i=e("stream").Transform;var n=e("inherits");var a=e("string_decoder").StringDecoder;t.exports=f;n(f,i);function f(e){i.call(this);this.hashMode=typeof e==="string";if(this.hashMode){this[e]=this._finalOrDigest}else{this.final=this._finalOrDigest}this._decoder=null;this._encoding=null}f.prototype.update=function(e,t,i){if(typeof e==="string"){e=new r(e,t)}var n=this._update(e);if(this.hashMode){return this}if(i){n=this._toString(n,i)}return n};f.prototype.setAutoPadding=function(){};f.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")};f.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")};f.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")};f.prototype._transform=function(e,t,r){var i;try{if(this.hashMode){this._update(e)}else{this.push(this._update(e))}}catch(n){i=n}finally{r(i)}};f.prototype._flush=function(e){var t;try{this.push(this._final())}catch(r){t=r}finally{e(t)}};f.prototype._finalOrDigest=function(e){var t=this._final()||new r("");if(e){t=this._toString(t,e,true)}return t};f.prototype._toString=function(e,t,r){if(!this._decoder){this._decoder=new a(t);this._encoding=t}if(this._encoding!==t){throw new Error("can't switch encodings")}var i=this._decoder.write(e);if(r){i+=this._decoder.end()}return i}}).call(this,e("buffer").Buffer)},{buffer:46,inherits:92,stream:135,string_decoder:136}],48:[function(e,t,r){(function(e){function t(e){return Array.isArray(e)}r.isArray=t;function i(e){return typeof e==="boolean"}r.isBoolean=i;function n(e){return e===null}r.isNull=n;function a(e){return e==null}r.isNullOrUndefined=a;function f(e){return typeof e==="number"}r.isNumber=f;function s(e){return typeof e==="string"}r.isString=s;function o(e){return typeof e==="symbol"}r.isSymbol=o;function c(e){return e===void 0}r.isUndefined=c;function h(e){return d(e)&&y(e)==="[object RegExp]"}r.isRegExp=h;function d(e){return typeof e==="object"&&e!==null}r.isObject=d;function u(e){return d(e)&&y(e)==="[object Date]"}r.isDate=u;function l(e){return d(e)&&(y(e)==="[object Error]"||e instanceof Error)}r.isError=l;function p(e){return typeof e==="function"}r.isFunction=p;function b(e){return e===null||typeof e==="boolean"||typeof e==="number"||typeof e==="string"||typeof e==="symbol"||typeof e==="undefined"}r.isPrimitive=b;function v(t){return e.isBuffer(t)}r.isBuffer=v;function y(e){return Object.prototype.toString.call(e)}}).call(this,{isBuffer:e("../../is-buffer/index.js")})},{"../../is-buffer/index.js":95}],49:[function(e,t,r){(function(r){var i=e("elliptic");var n=e("bn.js");t.exports=function o(e){return new f(e)};var a={secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}};a.p224=a.secp224r1;a.p256=a.secp256r1=a.prime256v1;a.p192=a.secp192r1=a.prime192v1;a.p384=a.secp384r1;a.p521=a.secp521r1;function f(e){this.curveType=a[e];if(!this.curveType){this.curveType={name:e}}this.curve=new i.ec(this.curveType.name);this.keys=void 0}f.prototype.generateKeys=function(e,t){this.keys=this.curve.genKeyPair();return this.getPublicKey(e,t)};f.prototype.computeSecret=function(e,t,i){t=t||"utf8";if(!r.isBuffer(e)){e=new r(e,t)}var n=this.curve.keyFromPublic(e).getPublic();var a=n.mul(this.keys.getPrivate()).getX();return s(a,i,this.curveType.byteLength)};f.prototype.getPublicKey=function(e,t){var r=this.keys.getPublic(t==="compressed",true);if(t==="hybrid"){if(r[r.length-1]%2){r[0]=7}else{r[0]=6}}return s(r,e)};f.prototype.getPrivateKey=function(e){return s(this.keys.getPrivate(),e)};f.prototype.setPublicKey=function(e,t){t=t||"utf8";if(!r.isBuffer(e)){e=new r(e,t)}this.keys._importPublic(e);return this};f.prototype.setPrivateKey=function(e,t){t=t||"utf8";if(!r.isBuffer(e)){e=new r(e,t)}var i=new n(e);i=i.toString(16);this.keys._importPrivate(i);return this};function s(e,t,i){if(!Array.isArray(e)){e=e.toArray()}var n=new r(e);if(i&&n.length>5]|=128<>>9<<4)+14]=t;var r=1732584193;var i=-271733879;var n=-1732584194;var a=271733878;for(var d=0;d>16)+(t>>16)+(r>>16);return i<<16|r&65535}function d(e,t){return e<>>32-t}t.exports=function u(e){return i.hash(e,n,16)}},{"./helpers":51}],53:[function(e,t,r){(function(r){"use strict";var i=e("create-hash/browser");var n=e("inherits");var a=e("stream").Transform;var f=new r(128);f.fill(0);function s(e,t){a.call(this);e=e.toLowerCase();if(typeof t==="string"){t=new r(t)}var n=e==="sha512"||e==="sha384"?128:64;this._alg=e;this._key=t;if(t.length>n){t=i(e).update(t).digest()}else if(t.length0;i--){t+=this._buffer(e,t);r+=this._flushBuffer(n,r)}t+=this._buffer(e,t);return n};n.prototype.final=function d(e){var t;if(e)t=this.update(e);var r;if(this.type==="encrypt")r=this._finalEncrypt();else r=this._finalDecrypt();if(t)return t.concat(r);else return r};n.prototype._pad=function u(e,t){if(t===0)return false;while(t>>1];r=f.r28shl(r,s);n=f.r28shl(n,s);f.pc2(r,n,e.keys,a)}};c.prototype._update=function l(e,t,r,i){var n=this._desState;var a=f.readUInt32BE(e,t);var s=f.readUInt32BE(e,t+4);f.ip(a,s,n.tmp,0);a=n.tmp[0];s=n.tmp[1];if(this.type==="encrypt")this._encrypt(n,a,s,n.tmp,0);else this._decrypt(n,a,s,n.tmp,0);a=n.tmp[0];s=n.tmp[1];f.writeUInt32BE(r,a,i);f.writeUInt32BE(r,s,i+4)};c.prototype._pad=function p(e,t){var r=e.length-t;for(var i=t;i>>0;a=l}f.rip(s,a,i,n)};c.prototype._decrypt=function y(e,t,r,i,n){var a=r;var s=t;for(var o=e.keys.length-2;o>=0;o-=2){var c=e.keys[o];var h=e.keys[o+1];f.expand(a,e.tmp,0);c^=e.tmp[0];h^=e.tmp[1];var d=f.substitute(c,h);var u=f.permute(d);var l=a;a=(s^u)>>>0;s=l}f.rip(a,s,i,n)}},{"../des":55,inherits:92,"minimalistic-assert":99}],59:[function(e,t,r){"use strict";var i=e("minimalistic-assert");var n=e("inherits");var a=e("../des");var f=a.Cipher;var s=a.DES;function o(e,t){i.equal(t.length,24,"Invalid key length");var r=t.slice(0,8);var n=t.slice(8,16);var a=t.slice(16,24);if(e==="encrypt"){this.ciphers=[s.create({type:"encrypt",key:r}),s.create({type:"decrypt",key:n}),s.create({type:"encrypt",key:a})]}else{this.ciphers=[s.create({type:"decrypt",key:a}),s.create({type:"encrypt",key:n}),s.create({type:"decrypt",key:r})]}}function c(e){f.call(this,e);var t=new o(this.type,this.options.key);this._edeState=t}n(c,f);t.exports=c;c.create=function h(e){return new c(e)};c.prototype._update=function d(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)};c.prototype._pad=s.prototype._pad;c.prototype._unpad=s.prototype._unpad},{"../des":55,inherits:92,"minimalistic-assert":99}],60:[function(e,t,r){"use strict";r.readUInt32BE=function f(e,t){var r=e[0+t]<<24|e[1+t]<<16|e[2+t]<<8|e[3+t];return r>>>0};r.writeUInt32BE=function s(e,t,r){e[0+r]=t>>>24;e[1+r]=t>>>16&255;e[2+r]=t>>>8&255;e[3+r]=t&255};r.ip=function o(e,t,r,i){var n=0;var a=0;for(var f=6;f>=0;f-=2){for(var s=0;s<=24;s+=8){n<<=1;n|=t>>>s+f&1}for(var s=0;s<=24;s+=8){n<<=1;n|=e>>>s+f&1}}for(var f=6;f>=0;f-=2){for(var s=1;s<=25;s+=8){a<<=1;a|=t>>>s+f&1}for(var s=1;s<=25;s+=8){a<<=1;a|=e>>>s+f&1}}r[i+0]=n>>>0;r[i+1]=a>>>0};r.rip=function c(e,t,r,i){var n=0;var a=0;for(var f=0;f<4;f++){for(var s=24;s>=0;s-=8){n<<=1;n|=t>>>s+f&1;n<<=1;n|=e>>>s+f&1}}for(var f=4;f<8;f++){for(var s=24;s>=0;s-=8){a<<=1;a|=t>>>s+f&1;a<<=1;a|=e>>>s+f&1}}r[i+0]=n>>>0;r[i+1]=a>>>0};r.pc1=function h(e,t,r,i){var n=0;var a=0;for(var f=7;f>=5;f--){for(var s=0;s<=24;s+=8){n<<=1;n|=t>>s+f&1}for(var s=0;s<=24;s+=8){n<<=1;n|=e>>s+f&1}}for(var s=0;s<=24;s+=8){n<<=1;n|=t>>s+f&1}for(var f=1;f<=3;f++){for(var s=0;s<=24;s+=8){a<<=1;a|=t>>s+f&1}for(var s=0;s<=24;s+=8){a<<=1;a|=e>>s+f&1}}for(var s=0;s<=24;s+=8){a<<=1;a|=e>>s+f&1}r[i+0]=n>>>0;r[i+1]=a>>>0};r.r28shl=function d(e,t){return e<>>28-t};var i=[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 u(e,t,r,n){var a=0;var f=0;var s=i.length>>>1;for(var o=0;o>>i[o]&1}for(var o=s;o>>i[o]&1}r[n+0]=a>>>0;r[n+1]=f>>>0};r.expand=function l(e,t,r){var i=0;var n=0;i=(e&1)<<5|e>>>27;for(var a=23;a>=15;a-=4){i<<=6;i|=e>>>a&63}for(var a=11;a>=3;a-=4){n|=e>>>a&63;n<<=6}n|=(e&31)<<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 p(e,t){var r=0;for(var i=0;i<4;i++){var a=e>>>18-i*6&63;var f=n[i*64+a];r<<=4;r|=f}for(var i=0;i<4;i++){var a=t>>>18-i*6&63;var f=n[4*64+i*64+a];r<<=4;r|=f}return r>>>0};var a=[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 b(e){var t=0;for(var r=0;r>>a[r]&1}return t>>>0};r.padSplit=function v(e,t,r){var i=e.toString(2);while(i.lengthe){r.ishrn(1)}if(r.isEven()){r.iadd(o)}if(!r.testn(1)){r.iadd(c)}if(!t.cmp(c)){while(r.mod(a).cmp(v)){r.iadd(y)}}else if(!t.cmp(h)){while(r.mod(l).cmp(p)){r.iadd(y)}}f=r.shrn(1);if(_(f)&&_(r)&&S(f)&&S(r)&&s.test(f)&&s.test(r)){return r}}}},{"bn.js":17,"miller-rabin":98,randombytes:115}],64:[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"}}},{}],65:[function(e,t,r){"use strict";var i=r;i.version=e("../package.json").version;i.utils=e("./elliptic/utils");i.rand=e("brorand");i.hmacDRBG=e("./elliptic/hmac-drbg");i.curve=e("./elliptic/curve");i.curves=e("./elliptic/curves");i.ec=e("./elliptic/ec");i.eddsa=e("./elliptic/eddsa")},{"../package.json":81,"./elliptic/curve":68,"./elliptic/curves":71,"./elliptic/ec":72,"./elliptic/eddsa":75,"./elliptic/hmac-drbg":78,"./elliptic/utils":80,brorand:18}],66:[function(e,t,r){"use strict";var i=e("bn.js");var n=e("../../elliptic");var a=n.utils;var f=a.getNAF;var s=a.getJSF;var o=a.assert;function c(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)}t.exports=c;c.prototype.point=function d(){throw new Error("Not implemented")};c.prototype.validate=function u(){throw new Error("Not implemented")};c.prototype._fixedNafMul=function l(e,t){o(e.precomputed);var r=e._getDoubles();var i=f(t,1);var n=(1<=s;t--)c=(c<<1)+i[t];a.push(c)}var h=this.jpoint(null,null,null);var d=this.jpoint(null,null,null);for(var u=n;u>0;u--){for(var s=0;s=0;c--){for(var t=0;c>=0&&a[c]===0;c--)t++;if(c>=0)t++;s=s.dblp(t);if(c<0)break;var h=a[c];o(h!==0);if(e.type==="affine"){if(h>0)s=s.mixedAdd(n[h-1>>1]);else s=s.mixedAdd(n[-h-1>>1].neg())}else{if(h>0)s=s.add(n[h-1>>1]);else s=s.add(n[-h-1>>1].neg())}}return e.type==="affine"?s.toP():s};c.prototype._wnafMulAdd=function b(e,t,r,i){var n=this._wnafT1;var a=this._wnafT2;var o=this._wnafT3;var c=0;for(var h=0;h=1;h-=2){var l=h-1;var p=h;if(n[l]!==1||n[p]!==1){o[l]=f(r[l],n[l]);o[p]=f(r[p],n[p]);c=Math.max(o[l].length,c);c=Math.max(o[p].length,c);continue}var b=[t[l],null,null,t[p]];if(t[l].y.cmp(t[p].y)===0){b[1]=t[l].add(t[p]);b[2]=t[l].toJ().mixedAdd(t[p].neg())}else if(t[l].y.cmp(t[p].y.redNeg())===0){b[1]=t[l].toJ().mixedAdd(t[p]);b[2]=t[l].add(t[p].neg())}else{b[1]=t[l].toJ().mixedAdd(t[p]);b[2]=t[l].toJ().mixedAdd(t[p].neg())}var v=[-3,-1,-5,-7,0,7,5,1,3];var y=s(r[l],r[p]);c=Math.max(y[0].length,c);o[l]=new Array(c);o[p]=new Array(c);for(var g=0;g=0;h--){var E=0;while(h>=0){var B=true;for(var g=0;g=0)E++;_=_.dblp(E);if(h<0)break;for(var g=0;g0)d=a[g][A-1>>1];else if(A<0)d=a[g][-A-1>>1].neg();if(d.type==="affine")_=_.mixedAdd(d);else _=_.add(d)}}for(var h=0;h=Math.ceil((e.bitLength()+1)/t.step)};h.prototype._getDoubles=function B(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;var r=[this];var i=this;for(var n=0;n";return""};h.prototype.isInfinity=function _(){return this.x.cmpn(0)===0&&this.y.cmp(this.z)===0};h.prototype._extDbl=function S(){var e=this.x.redSqr();var t=this.y.redSqr();var r=this.z.redSqr();r=r.redIAdd(r);var i=this.curve._mulA(e);var n=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t);var a=i.redAdd(t);var f=a.redSub(r);var s=i.redSub(t);var o=n.redMul(f);var c=a.redMul(s);var h=n.redMul(s);var d=f.redMul(a);return this.curve.point(o,c,d,h)};h.prototype._projDbl=function E(){var e=this.x.redAdd(this.y).redSqr();var t=this.x.redSqr();var r=this.y.redSqr();var i;var n;var a;if(this.curve.twisted){var f=this.curve._mulA(t);var s=f.redAdd(r);if(this.zOne){i=e.redSub(t).redSub(r).redMul(s.redSub(this.curve.two));n=s.redMul(f.redSub(r));a=s.redSqr().redSub(s).redSub(s)}else{var o=this.z.redSqr();var c=s.redSub(o).redISub(o);i=e.redSub(t).redISub(r).redMul(c);n=s.redMul(f.redSub(r));a=s.redMul(c)}}else{var f=t.redAdd(r);var o=this.curve._mulC(this.c.redMul(this.z)).redSqr();var c=f.redSub(o).redSub(o);i=this.curve._mulC(e.redISub(f)).redMul(c);n=this.curve._mulC(f).redMul(t.redISub(r));a=f.redMul(c)}return this.curve.point(i,n,a)};h.prototype.dbl=function B(){if(this.isInfinity())return this;if(this.curve.extended)return this._extDbl();else return this._projDbl()};h.prototype._extAdd=function A(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x));var r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x));var i=this.t.redMul(this.curve.dd).redMul(e.t);var n=this.z.redMul(e.z.redAdd(e.z));var a=r.redSub(t);var f=n.redSub(i);var s=n.redAdd(i);var o=r.redAdd(t);var c=a.redMul(f);var h=s.redMul(o);var d=a.redMul(o);var u=f.redMul(s);return this.curve.point(c,h,u,d)};h.prototype._projAdd=function I(e){var t=this.z.redMul(e.z);var r=t.redSqr();var i=this.x.redMul(e.x);var n=this.y.redMul(e.y);var a=this.curve.d.redMul(i).redMul(n);var f=r.redSub(a);var s=r.redAdd(a);var o=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(i).redISub(n);var c=t.redMul(f).redMul(o);var h;var d;if(this.curve.twisted){h=t.redMul(s).redMul(n.redSub(this.curve._mulA(i)));d=f.redMul(s)}else{h=t.redMul(s).redMul(n.redSub(i));d=this.curve._mulC(f).redMul(s)}return this.curve.point(c,h,d)};h.prototype.add=function k(e){if(this.isInfinity())return e;if(e.isInfinity())return this;if(this.curve.extended)return this._extAdd(e);else return this._projAdd(e)};h.prototype.mul=function x(e){if(this._hasDoubles(e))return this.curve._fixedNafMul(this,e);else return this.curve._wnafMul(this,e)};h.prototype.mulAdd=function R(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2)};h.prototype.normalize=function T(){if(this.zOne)return this;var e=this.z.redInvm();this.x=this.x.redMul(e);this.y=this.y.redMul(e);if(this.t)this.t=this.t.redMul(e);this.z=this.curve.one;this.zOne=true;return this};h.prototype.neg=function C(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())};h.prototype.getX=function M(){this.normalize();return this.x.fromRed()};h.prototype.getY=function P(){this.normalize();return this.y.fromRed()};h.prototype.eq=function D(e){return this===e||this.getX().cmp(e.getX())===0&&this.getY().cmp(e.getY())===0};h.prototype.toP=h.prototype.normalize;h.prototype.mixedAdd=h.prototype.add},{"../../elliptic":65,"../curve":68,"bn.js":17,inherits:92}],68:[function(e,t,r){"use strict";var i=r;i.base=e("./base");i.short=e("./short");i.mont=e("./mont");i.edwards=e("./edwards")},{"./base":66,"./edwards":67,"./mont":69,"./short":70}],69:[function(e,t,r){"use strict";var i=e("../curve");var n=e("bn.js");var a=e("inherits");var f=i.base;var s=e("../../elliptic");var o=s.utils;function c(e){f.call(this,"mont",e);this.a=new n(e.a,16).toRed(this.red);this.b=new n(e.b,16).toRed(this.red);this.i4=new n(4).toRed(this.red).redInvm();this.two=new n(2).toRed(this.red);this.a24=this.i4.redMul(this.a.redAdd(this.two))}a(c,f);t.exports=c;c.prototype.validate=function d(e){var t=e.normalize().x;var r=t.redSqr();var i=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t);var n=i.redSqrt();return n.redSqr().cmp(i)===0};function h(e,t,r){f.BasePoint.call(this,e,"projective");if(t===null&&r===null){this.x=this.curve.one;this.z=this.curve.zero}else{this.x=new n(t,16);this.z=new n(r,16);if(!this.x.red)this.x=this.x.toRed(this.curve.red);if(!this.z.red)this.z=this.z.toRed(this.curve.red)}}a(h,f.BasePoint);c.prototype.decodePoint=function u(e,t){return this.point(o.toArray(e,t),1)};c.prototype.point=function l(e,t){return new h(this,e,t)};c.prototype.pointFromJSON=function p(e){return h.fromJSON(this,e)};h.prototype.precompute=function b(){};h.prototype._encode=function v(){return this.getX().toArray("be",this.curve.p.byteLength())};h.fromJSON=function y(e,t){return new h(e,t[0],t[1]||e.one)};h.prototype.inspect=function g(){if(this.isInfinity())return"";return""};h.prototype.isInfinity=function m(){return this.z.cmpn(0)===0};h.prototype.dbl=function w(){var e=this.x.redAdd(this.z);var t=e.redSqr();var r=this.x.redSub(this.z);var i=r.redSqr();var n=t.redSub(i);var a=t.redMul(i);var f=n.redMul(i.redAdd(this.curve.a24.redMul(n)));return this.curve.point(a,f)};h.prototype.add=function _(){throw new Error("Not supported on Montgomery curve")};h.prototype.diffAdd=function S(e,t){var r=this.x.redAdd(this.z);var i=this.x.redSub(this.z);var n=e.x.redAdd(e.z);var a=e.x.redSub(e.z);var f=a.redMul(r);var s=n.redMul(i);var o=t.z.redMul(f.redAdd(s).redSqr());var c=t.x.redMul(f.redISub(s).redSqr());return this.curve.point(o,c)};h.prototype.mul=function E(e){var t=e.clone();var r=this;var i=this.curve.point(null,null);var n=this;for(var a=[];t.cmpn(0)!==0;t.iushrn(1))a.push(t.andln(1));for(var f=a.length-1;f>=0;f--){if(a[f]===0){r=r.diffAdd(i,n);i=i.dbl()}else{i=r.diffAdd(i,n);r=r.dbl()}}return i};h.prototype.mulAdd=function B(){throw new Error("Not supported on Montgomery curve")};h.prototype.eq=function A(e){return this.getX().cmp(e.getX())===0};h.prototype.normalize=function I(){this.x=this.x.redMul(this.z.redInvm());this.z=this.curve.one;return this};h.prototype.getX=function k(){this.normalize();return this.x.fromRed()}},{"../../elliptic":65,"../curve":68,"bn.js":17,inherits:92}],70:[function(e,t,r){"use strict";var i=e("../curve");var n=e("../../elliptic");var a=e("bn.js");var f=e("inherits");var s=i.base;var o=n.utils.assert;function c(e){s.call(this,"short",e);this.a=new a(e.a,16).toRed(this.red);this.b=new a(e.b,16).toRed(this.red);this.tinv=this.two.redInvm();this.zeroA=this.a.fromRed().cmpn(0)===0;this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0;this.endo=this._getEndomorphism(e);this._endoWnafT1=new Array(4);this._endoWnafT2=new Array(4)}f(c,s);t.exports=c;c.prototype._getEndomorphism=function u(e){if(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)return;var t;var r;if(e.beta){t=new a(e.beta,16).toRed(this.red)}else{var i=this._getEndoRoots(this.p);t=i[0].cmp(i[1])<0?i[0]:i[1];t=t.toRed(this.red)}if(e.lambda){r=new a(e.lambda,16)}else{var n=this._getEndoRoots(this.n);if(this.g.mul(n[0]).x.cmp(this.g.x.redMul(t))===0){r=n[0]}else{r=n[1];o(this.g.mul(r).x.cmp(this.g.x.redMul(t))===0)}}var f;if(e.basis){f=e.basis.map(function(e){return{a:new a(e.a,16),b:new a(e.b,16)}})}else{f=this._getEndoBasis(r)}return{beta:t,lambda:r,basis:f}};c.prototype._getEndoRoots=function l(e){var t=e===this.p?this.red:a.mont(e);var r=new a(2).toRed(t).redInvm();var i=r.redNeg();var n=new a(3).toRed(t).redNeg().redSqrt().redMul(r);var f=i.redAdd(n).fromRed();var s=i.redSub(n).fromRed();return[f,s]};c.prototype._getEndoBasis=function p(e){var t=this.n.ushrn(Math.floor(this.n.bitLength()/2));var r=e;var i=this.n.clone();var n=new a(1);var f=new a(0);var s=new a(0);var o=new a(1);var c;var h;var d;var u;var l;var p;var b;var v=0;var y;var g;while(r.cmpn(0)!==0){var m=i.div(r);y=i.sub(m.mul(r));g=s.sub(m.mul(n));var w=o.sub(m.mul(f));if(!d&&y.cmp(t)<0){c=b.neg();h=n;d=y.neg();u=g}else if(d&&++v===2){break}b=y;i=r;r=y;s=n;n=g;o=f;f=w}l=y.neg();p=g;var _=d.sqr().add(u.sqr());var S=l.sqr().add(p.sqr());if(S.cmp(_)>=0){l=c;p=h}if(d.negative){d=d.neg();u=u.neg()}if(l.negative){l=l.neg();p=p.neg()}return[{a:d,b:u},{a:l,b:p}]};c.prototype._endoSplit=function b(e){var t=this.endo.basis;var r=t[0];var i=t[1];var n=i.b.mul(e).divRound(this.n);var a=r.b.neg().mul(e).divRound(this.n);var f=n.mul(r.a);var s=a.mul(i.a);var o=n.mul(r.b);var c=a.mul(i.b);var h=e.sub(f).sub(s);var d=o.add(c).neg();return{k1:h,k2:d}};c.prototype.pointFromX=function v(e,t){e=new a(e,16);if(!e.red)e=e.toRed(this.red);var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b);var i=r.redSqrt();var n=i.fromRed().isOdd();if(t&&!n||!t&&n)i=i.redNeg();return this.point(e,i)};c.prototype.validate=function y(e){if(e.inf)return true;var t=e.x;var r=e.y;var i=this.a.redMul(t);var n=t.redSqr().redMul(t).redIAdd(i).redIAdd(this.b);return r.redSqr().redISub(n).cmpn(0)===0};c.prototype._endoWnafMulAdd=function g(e,t){var r=this._endoWnafT1;var i=this._endoWnafT2;for(var n=0;n";return""};h.prototype.isInfinity=function A(){return this.inf};h.prototype.add=function I(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(this.x.cmp(e.x)===0)return this.curve.point(null,null);var t=this.y.redSub(e.y);if(t.cmpn(0)!==0)t=t.redMul(this.x.redSub(e.x).redInvm());var r=t.redSqr().redISub(this.x).redISub(e.x);var i=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,i)};h.prototype.dbl=function k(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(e.cmpn(0)===0)return this.curve.point(null,null);var t=this.curve.a;var r=this.x.redSqr();var i=e.redInvm();var n=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(i);var a=n.redSqr().redISub(this.x.redAdd(this.x));var f=n.redMul(this.x.redSub(a)).redISub(this.y);return this.curve.point(a,f)};h.prototype.getX=function x(){return this.x.fromRed()};h.prototype.getY=function R(){return this.y.fromRed()};h.prototype.mul=function T(e){e=new a(e,16);if(this._hasDoubles(e))return this.curve._fixedNafMul(this,e);else if(this.curve.endo)return this.curve._endoWnafMulAdd([this],[e]);else return this.curve._wnafMul(this,e)};h.prototype.mulAdd=function C(e,t,r){var i=[this,t];var n=[e,r];if(this.curve.endo)return this.curve._endoWnafMulAdd(i,n);else return this.curve._wnafMulAdd(1,i,n,2)};h.prototype.eq=function M(e){return this===e||this.inf===e.inf&&(this.inf||this.x.cmp(e.x)===0&&this.y.cmp(e.y)===0)};h.prototype.neg=function P(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed;var i=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(i)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(i)}}}return t};h.prototype.toJ=function D(){if(this.inf)return this.curve.jpoint(null,null,null);var e=this.curve.jpoint(this.x,this.y,this.curve.one);return e};function d(e,t,r,i){s.BasePoint.call(this,e,"jacobian");if(t===null&&r===null&&i===null){this.x=this.curve.one;this.y=this.curve.one;this.z=new a(0)}else{this.x=new a(t,16);this.y=new a(r,16);this.z=new a(i,16)}if(!this.x.red)this.x=this.x.toRed(this.curve.red);if(!this.y.red)this.y=this.y.toRed(this.curve.red);if(!this.z.red)this.z=this.z.toRed(this.curve.red);this.zOne=this.z===this.curve.one}f(d,s.BasePoint);c.prototype.jpoint=function L(e,t,r){return new d(this,e,t,r)};d.prototype.toP=function j(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm();var t=e.redSqr();var r=this.x.redMul(t);var i=this.y.redMul(t).redMul(e);return this.curve.point(r,i)};d.prototype.neg=function q(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};d.prototype.add=function N(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr();var r=this.z.redSqr();var i=this.x.redMul(t);var n=e.x.redMul(r);var a=this.y.redMul(t.redMul(e.z));var f=e.y.redMul(r.redMul(this.z));var s=i.redSub(n);var o=a.redSub(f);if(s.cmpn(0)===0){if(o.cmpn(0)!==0)return this.curve.jpoint(null,null,null);else return this.dbl()}var c=s.redSqr();var h=c.redMul(s);var d=i.redMul(c);var u=o.redSqr().redIAdd(h).redISub(d).redISub(d);var l=o.redMul(d.redISub(u)).redISub(a.redMul(h));var p=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(u,l,p)};d.prototype.mixedAdd=function O(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr();var r=this.x;var i=e.x.redMul(t);var n=this.y;var a=e.y.redMul(t).redMul(this.z);var f=r.redSub(i);var s=n.redSub(a);if(f.cmpn(0)===0){if(s.cmpn(0)!==0)return this.curve.jpoint(null,null,null);else return this.dbl()}var o=f.redSqr();var c=o.redMul(f);var h=r.redMul(o);var d=s.redSqr().redIAdd(c).redISub(h).redISub(h); var u=s.redMul(h.redISub(d)).redISub(n.redMul(c));var l=this.z.redMul(f);return this.curve.jpoint(d,u,l)};d.prototype.dblp=function U(e){if(e===0)return this;if(this.isInfinity())return this;if(!e)return this.dbl();if(this.curve.zeroA||this.curve.threeA){var t=this;for(var r=0;r";return""};d.prototype.isInfinity=function G(){return this.z.cmpn(0)===0}},{"../../elliptic":65,"../curve":68,"bn.js":17,inherits:92}],71:[function(e,t,r){"use strict";var i=r;var n=e("hash.js");var a=e("../elliptic");var f=a.utils.assert;function s(e){if(e.type==="short")this.curve=new a.curve.short(e);else if(e.type==="edwards")this.curve=new a.curve.edwards(e);else this.curve=new a.curve.mont(e);this.g=this.curve.g;this.n=this.curve.n;this.hash=e.hash;f(this.g.validate(),"Invalid curve");f(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}i.PresetCurve=s;function o(e,t){Object.defineProperty(i,e,{configurable:true,enumerable:true,get:function(){var r=new s(t);Object.defineProperty(i,e,{configurable:true,enumerable:true,value:r});return r}})}o("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:n.sha256,gRed:false,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]});o("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:n.sha256,gRed:false,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]});o("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:n.sha256,gRed:false,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]});o("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:n.sha384,gRed:false,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"]});o("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:n.sha512,gRed:false,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"]});o("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"0",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:n.sha256,gRed:false,g:["9"]});o("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:n.sha256,gRed:false,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var c;try{c=e("./precomputed/secp256k1")}catch(h){c=undefined}o("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:n.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:false,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",c]})},{"../elliptic":65,"./precomputed/secp256k1":79,"hash.js":84}],72:[function(e,t,r){"use strict";var i=e("bn.js");var n=e("../../elliptic");var a=n.utils;var f=a.assert;var s=e("./key");var o=e("./signature");function c(e){if(!(this instanceof c))return new c(e);if(typeof e==="string"){f(n.curves.hasOwnProperty(e),"Unknown curve "+e);e=n.curves[e]}if(e instanceof n.curves.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=c;c.prototype.keyPair=function h(e){return new s(this,e)};c.prototype.keyFromPrivate=function d(e,t){return s.fromPrivate(this,e,t)};c.prototype.keyFromPublic=function u(e,t){return s.fromPublic(this,e,t)};c.prototype.genKeyPair=function l(e){if(!e)e={};var t=new n.hmacDRBG({hash:this.hash,pers:e.pers,entropy:e.entropy||n.rand(this.hash.hmacStrength),nonce:this.n.toArray()});var r=this.n.byteLength();var a=this.n.sub(new i(2));do{var f=new i(t.generate(r));if(f.cmp(a)>0)continue;f.iaddn(1);return this.keyFromPrivate(f)}while(true)};c.prototype._truncateToN=function p(e,t){var r=e.byteLength()*8-this.n.bitLength();if(r>0)e=e.ushrn(r);if(!t&&e.cmp(this.n)>=0)return e.sub(this.n);else return e};c.prototype.sign=function b(e,t,r,a){if(typeof r==="object"){a=r;r=null}if(!a)a={};t=this.keyFromPrivate(t,r);e=this._truncateToN(new i(e,16));var f=this.n.byteLength();var s=t.getPrivate().toArray();for(var c=s.length;c=0)continue;var p=this.g.mul(l);if(p.isInfinity())continue;var b=p.getX();var v=b.umod(this.n);if(v.cmpn(0)===0)continue;var y=l.invm(this.n).mul(v.mul(t.getPrivate()).iadd(e));y=y.umod(this.n);if(y.cmpn(0)===0)continue;var g=(p.getY().isOdd()?1:0)|(b.cmp(v)!==0?2:0);if(a.canonical&&y.cmp(this.nh)>0){y=this.n.sub(y);g^=1}return new o({r:v,s:y,recoveryParam:g})}while(true)};c.prototype.verify=function v(e,t,r,n){e=this._truncateToN(new i(e,16));r=this.keyFromPublic(r,n);t=new o(t,"hex");var a=t.r;var f=t.s;if(a.cmpn(1)<0||a.cmp(this.n)>=0)return false;if(f.cmpn(1)<0||f.cmp(this.n)>=0)return false;var s=f.invm(this.n);var c=s.mul(e).umod(this.n);var h=s.mul(a).umod(this.n);var d=this.g.mulAdd(c,r.getPublic(),h);if(d.isInfinity())return false;return d.getX().umod(this.n).cmp(a)===0};c.prototype.recoverPubKey=function(e,t,r,n){f((3&r)===r,"The recovery param is more than two bits");t=new o(t,n);var a=this.n;var s=new i(e);var c=t.r;var h=t.s;var d=r&1;var u=r>>1;if(c.cmp(this.curve.p.umod(this.curve.n))>=0&&u)throw new Error("Unable to find sencond key candinate");if(u)c=this.curve.pointFromX(c.add(this.curve.n),d);else c=this.curve.pointFromX(c,d);var l=a.sub(s);var p=t.r.invm(a);return c.mul(h).add(this.g.mul(l)).mul(p)};c.prototype.getKeyRecoveryParam=function(e,t,r,i){t=new o(t,i);if(t.recoveryParam!==null)return t.recoveryParam;for(var n=0;n<4;n++){var a=this.recoverPubKey(e,t,n);if(a.eq(r))return n}throw new Error("Unable to find valid recovery factor")}},{"../../elliptic":65,"./key":73,"./signature":74,"bn.js":17}],73:[function(e,t,r){"use strict";var i=e("bn.js");function n(e,t){this.ec=e;this.priv=null;this.pub=null;if(t.priv)this._importPrivate(t.priv,t.privEnc);if(t.pub)this._importPublic(t.pub,t.pubEnc)}t.exports=n;n.fromPublic=function a(e,t,r){if(t instanceof n)return t;return new n(e,{pub:t,pubEnc:r})};n.fromPrivate=function f(e,t,r){if(t instanceof n)return t;return new n(e,{priv:t,privEnc:r})};n.prototype.validate=function s(){var e=this.getPublic();if(e.isInfinity())return{result:false,reason:"Invalid public key"};if(!e.validate())return{result:false,reason:"Public key is not a point"};if(!e.mul(this.ec.curve.n).isInfinity())return{result:false,reason:"Public key * N != O"};return{result:true,reason:null}};n.prototype.getPublic=function o(e,t){if(typeof e==="string"){t=e;e=null}if(!this.pub)this.pub=this.ec.g.mul(this.priv);if(!t)return this.pub;return this.pub.encode(t,e)};n.prototype.getPrivate=function c(e){if(e==="hex")return this.priv.toString(16,2);else return this.priv};n.prototype._importPrivate=function h(e,t){this.priv=new i(e,t||16);this.priv=this.priv.umod(this.ec.curve.n)};n.prototype._importPublic=function d(e,t){if(e.x||e.y){this.pub=this.ec.curve.point(e.x,e.y);return}this.pub=this.ec.curve.decodePoint(e,t)};n.prototype.derive=function u(e){return e.mul(this.priv).getX()};n.prototype.sign=function l(e,t,r){return this.ec.sign(e,this,t,r)};n.prototype.verify=function p(e,t){return this.ec.verify(e,t,this)};n.prototype.inspect=function b(){return""}},{"bn.js":17}],74:[function(e,t,r){"use strict";var i=e("bn.js");var n=e("../../elliptic");var a=n.utils;var f=a.assert;function s(e,t){if(e instanceof s)return e;if(this._importDER(e,t))return;f(e.r&&e.s,"Signature without r or s");this.r=new i(e.r,16);this.s=new i(e.s,16);if(e.recoveryParam!==null)this.recoveryParam=e.recoveryParam;else this.recoveryParam=null}t.exports=s;function o(){this.place=0}function c(e,t){var r=e[t.place++];if(!(r&128)){return r}var i=r&15;var n=0;for(var a=0,f=t.place;a>>3);e.push(r|128);while(--r){e.push(t>>>(r<<3)&255)}e.push(t)}s.prototype.toDER=function l(e){var t=this.r.toArray();var r=this.s.toArray();if(t[0]&128)t=[0].concat(t);if(r[0]&128)r=[0].concat(r);t=h(t);r=h(r);while(!r[0]&&!(r[1]&128)){r=r.slice(1)}var i=[2];d(i,t.length);i=i.concat(t);i.push(2);d(i,r.length);var n=i.concat(r);var f=[48];d(f,n.length);f=f.concat(n);return a.encode(f,e)}},{"../../elliptic":65,"bn.js":17}],75:[function(e,t,r){"use strict";var i=e("hash.js");var n=e("../../elliptic");var a=n.utils;var f=a.assert;var s=a.parseBytes;var o=e("./key");var c=e("./signature");function h(e){f(e==="ed25519","only tested with ed25519 so far");if(!(this instanceof h))return new h(e);var e=n.curves[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=h;h.prototype.sign=function d(e,t){e=s(e);var r=this.keyFromSecret(t);var i=this.hashInt(r.messagePrefix(),e);var n=this.g.mul(i);var a=this.encodePoint(n);var f=this.hashInt(a,r.pubBytes(),e).mul(r.priv());var o=i.add(f).umod(this.curve.n);return this.makeSignature({R:n,S:o,Rencoded:a})};h.prototype.verify=function u(e,t,r){e=s(e);t=this.makeSignature(t);var i=this.keyFromPublic(r);var n=this.hashInt(t.Rencoded(),i.pubBytes(),e);var a=this.g.mul(t.S());var f=t.R().add(i.pub().mul(n));return f.eq(a)};h.prototype.hashInt=function l(){var e=this.hash();for(var t=0;t=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits");this._init(t,r,i)}t.exports=s;s.prototype._init=function o(e,t,r){var i=e.concat(t).concat(r);this.K=new Array(this.outLen/8);this.V=new Array(this.outLen/8);for(var n=0;n=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits");this._update(e.concat(r||[]));this.reseed=1};s.prototype.generate=function u(e,t,r,i){if(this.reseed>this.reseedInterval)throw new Error("Reseed is required");if(typeof t!=="string"){i=r;r=t;t=null}if(r){r=a.toArray(r,i);this._update(r)}var n=[];while(n.length>8;var f=n&255;if(a)r.push(a,f);else r.push(f)}}else if(t==="hex"){e=e.replace(/[^a-z0-9]+/gi,"");if(e.length%2!==0)e="0"+e;for(var i=0;i=0){var a;if(n.isOdd()){var f=n.andln(i-1);if(f>(i>>1)-1)a=(i>>1)-f;else a=f;n.isubn(a)}else{a=0}r.push(a);var s=n.cmpn(0)!==0&&n.andln(i-1)===0?t+1:1;for(var o=1;o0||t.cmpn(-n)>0){var a=e.andln(3)+i&3;var f=t.andln(3)+n&3;if(a===3)a=-1;if(f===3)f=-1;var s;if((a&1)===0){s=0}else{var o=e.andln(7)+i&7;if((o===3||o===5)&&f===2)s=-a;else s=a}r[0].push(s);var c;if((f&1)===0){c=0}else{var o=t.andln(7)+n&7;if((o===3||o===5)&&a===2)c=-f;else c=f}r[1].push(c);if(2*i===s+1)i=1-i;if(2*n===c+1)n=1-n;e.iushrn(1);t.iushrn(1)}return r}i.getJSF=c;function h(e,t){var r=t.name;var i="_"+r;e.prototype[r]=function n(){return this[i]!==undefined?this[i]:this[i]=t.call(this)}}i.cachedProperty=h;function d(e){return typeof e==="string"?i.toArray(e,"hex"):e}i.parseBytes=d;function u(e){return new n(e,"hex","le")}i.intFromLE=u},{"bn.js":17}],81:[function(e,t,r){t.exports={_args:[["elliptic@^6.0.0","/Users/david/Documents/code/ipfs/libp2p/node/peer-id/node_modules/browserify-sign"]],_from:"elliptic@>=6.0.0 <7.0.0",_id:"elliptic@6.0.1",_inCache:true,_installable:true,_location:"/elliptic",_nodeVersion:"5.0.0",_npmUser:{email:"fedor@indutny.com",name:"indutny"},_npmVersion:"3.3.6",_phantomChildren:{},_requested:{name:"elliptic",raw:"elliptic@^6.0.0",rawSpec:"^6.0.0",scope:null,spec:">=6.0.0 <7.0.0",type:"range"},_requiredBy:["/browserify-sign","/create-ecdh"],_resolved:"https://registry.npmjs.org/elliptic/-/elliptic-6.0.1.tgz",_shasum:"91d573ecb2a3c274b8c07e0d1f35ff19f07e6978",_shrinkwrap:null,_spec:"elliptic@^6.0.0",_where:"/Users/david/Documents/code/ipfs/libp2p/node/peer-id/node_modules/browserify-sign",author:{email:"fedor@indutny.com",name:"Fedor Indutny"},bugs:{url:"https://github.com/indutny/elliptic/issues"},dependencies:{"bn.js":"^4.0.0",brorand:"^1.0.1","hash.js":"^1.0.0",inherits:"^2.0.1"},description:"EC cryptography",devDependencies:{browserify:"^3.44.2",coveralls:"^2.11.3",istanbul:"^0.3.17",jscs:"^1.11.3",jshint:"^2.6.0",mocha:"^2.1.0","uglify-js":"^2.4.13"},directories:{},dist:{shasum:"91d573ecb2a3c274b8c07e0d1f35ff19f07e6978",tarball:"http://registry.npmjs.org/elliptic/-/elliptic-6.0.1.tgz"},gitHead:"a9eb628eec9a2f562e67947c5417e9b2435d0a2d",homepage:"https://github.com/indutny/elliptic",keywords:["Cryptography","EC","Elliptic","curve"],license:"MIT",main:"lib/elliptic.js",maintainers:[{name:"indutny",email:"fedor@indutny.com"}],name:"elliptic",optionalDependencies:{},repository:{type:"git",url:"git+ssh://git@github.com/indutny/elliptic.git"},scripts:{coveralls:"cat ./coverage/lcov.info | coveralls",test:"make lint && istanbul test _mocha --reporter=spec test/*-test.js"},version:"6.0.1"}},{}],82:[function(e,t,r){function i(){this._events=this._events||{};this._maxListeners=this._maxListeners||undefined}t.exports=i;i.EventEmitter=i;i.prototype._events=undefined;i.prototype._maxListeners=undefined;i.defaultMaxListeners=10;i.prototype.setMaxListeners=function(e){if(!a(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");this._maxListeners=e;return this};i.prototype.emit=function(e){var t,r,i,a,o,c;if(!this._events)this._events={};if(e==="error"){if(!this._events.error||f(this._events.error)&&!this._events.error.length){t=arguments[1];if(t instanceof Error){throw t}throw TypeError('Uncaught, unspecified "error" event.')}}r=this._events[e];if(s(r))return false;if(n(r)){switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:i=arguments.length;a=new Array(i-1);for(o=1;o0&&this._events[e].length>r){this._events[e].warned=true;console.error("(node) warning: possible EventEmitter memory "+"leak detected. %d listeners added. "+"Use emitter.setMaxListeners() to increase limit.",this._events[e].length);if(typeof console.trace==="function"){console.trace()}}}return this};i.prototype.on=i.prototype.addListener;i.prototype.once=function(e,t){if(!n(t))throw TypeError("listener must be a function");var r=false;function i(){this.removeListener(e,i);if(!r){r=true;t.apply(this,arguments)}}i.listener=t;this.on(e,i);return this};i.prototype.removeListener=function(e,t){var r,i,a,s;if(!n(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;r=this._events[e];a=r.length;i=-1;if(r===t||n(r.listener)&&r.listener===t){delete this._events[e];if(this._events.removeListener)this.emit("removeListener",e,t)}else if(f(r)){for(s=a;s-->0;){if(r[s]===t||r[s].listener&&r[s].listener===t){i=s;break}}if(i<0)return this;if(r.length===1){r.length=0;delete this._events[e]}else{r.splice(i,1)}if(this._events.removeListener)this.emit("removeListener",e,t)}return this};i.prototype.removeAllListeners=function(e){var t,r;if(!this._events)return this;if(!this._events.removeListener){if(arguments.length===0)this._events={};else if(this._events[e])delete this._events[e];return this}if(arguments.length===0){for(t in this._events){if(t==="removeListener")continue;this.removeAllListeners(t)}this.removeAllListeners("removeListener");this._events={};return this}r=this._events[e];if(n(r)){this.removeListener(e,r)}else{while(r.length)this.removeListener(e,r[r.length-1])}delete this._events[e];return this};i.prototype.listeners=function(e){var t;if(!this._events||!this._events[e])t=[];else if(n(this._events[e]))t=[this._events[e]];else t=this._events[e].slice();return t};i.listenerCount=function(e,t){var r;if(!e._events||!e._events[t])r=0;else if(n(e._events[t]))r=1;else r=e._events[t].length;return r};function n(e){return typeof e==="function"}function a(e){return typeof e==="number"}function f(e){return typeof e==="object"&&e!==null}function s(e){return e===void 0}},{}],83:[function(e,t,r){(function(r){var i=e("create-hash/md5");t.exports=n;function n(e,t,n,a){if(!r.isBuffer(e)){e=new r(e,"binary")}if(t&&!r.isBuffer(t)){t=new r(t,"binary")}n=n/8;a=a||0;var f=0;var s=0;var o=new r(n);var c=new r(a);var h=0;var d;var u;var l=[];while(true){if(h++>0){l.push(d)}l.push(e);if(t){l.push(t)}d=i(r.concat(l));l=[];u=0;if(n>0){while(true){if(n===0){break}if(u===d.length){break}o[f++]=d[u];n--;u++}}if(a>0&&u!==d.length){while(true){if(a===0){break}if(u===d.length){break}c[s++]=d[u];a--;u++}}if(n===0&&a===0){break}}for(u=0;u=this._delta8){e=this.pending;var r=e.length%this._delta8;this.pending=e.slice(e.length-r,e.length);if(this.pending.length===0)this.pending=null;e=n.join32(e,0,e.length-r,this.endian);for(var i=0;i>>24&255;i[n++]=e>>>16&255;i[n++]=e>>>8&255;i[n++]=e&255}else{i[n++]=e&255;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;for(var a=8;athis.blockSize)e=(new this.Hash).update(e).digest();f(e.length<=this.blockSize);for(var t=e.length;t>>3}function q(e){return f(e,17)^f(e,19)^e>>>10}function N(e,t,r,i){if(e===0)return C(t,r,i);if(e===1||e===3)return P(t,r,i);if(e===2)return M(t,r,i)}function O(e,t,r,i,n,a){var f=e&r^~e&n;if(f<0)f+=4294967296;return f}function U(e,t,r,i,n,a){var f=t&i^~t&a;if(f<0)f+=4294967296;return f}function z(e,t,r,i,n,a){var f=e&r^e&n^r&n;if(f<0)f+=4294967296;return f}function K(e,t,r,i,n,a){var f=t&i^t&a^i&a;if(f<0)f+=4294967296;return f}function F(e,t){var r=d(e,t,28);var i=d(t,e,2);var n=d(t,e,7);var a=r^i^n;if(a<0)a+=4294967296;return a}function V(e,t){var r=u(e,t,28);var i=u(t,e,2);var n=u(t,e,7);var a=r^i^n;if(a<0)a+=4294967296;return a}function H(e,t){var r=d(e,t,14);var i=d(e,t,18);var n=d(t,e,9);var a=r^i^n;if(a<0)a+=4294967296;return a}function Y(e,t){var r=u(e,t,14);var i=u(e,t,18);var n=u(t,e,9);var a=r^i^n;if(a<0)a+=4294967296;return a}function X(e,t){var r=d(e,t,1);var i=d(e,t,8);var n=l(e,t,7);var a=r^i^n;if(a<0)a+=4294967296;return a}function W(e,t){var r=u(e,t,1);var i=u(e,t,8);var n=p(e,t,7);var a=r^i^n;if(a<0)a+=4294967296;return a}function G(e,t){var r=d(e,t,19);var i=d(t,e,29);var n=l(e,t,6);var a=r^i^n;if(a<0)a+=4294967296;return a}function J(e,t){var r=u(e,t,19);var i=u(t,e,29);var n=p(e,t,6);var a=r^i^n;if(a<0)a+=4294967296;return a}},{"../hash":84}],89:[function(e,t,r){var i=r;var n=e("inherits");function a(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if(typeof e==="string"){if(!t){for(var i=0;i>8;var f=n&255;if(a)r.push(a,f);else r.push(f)}}else if(t==="hex"){e=e.replace(/[^a-z0-9]+/gi,"");if(e.length%2!==0)e="0"+e;for(var i=0;i>>24|e>>>8&65280|e<<8&16711680|(e&255)<<24;return t>>>0}i.htonl=s;function o(e,t){var r="";for(var i=0;i>>0}return a}i.join32=d;function u(e,t){var r=new Array(e.length*4);for(var i=0,n=0;i>>24;r[n+1]=a>>>16&255;r[n+2]=a>>>8&255;r[n+3]=a&255}else{r[n+3]=a>>>24;r[n+2]=a>>>16&255;r[n+1]=a>>>8&255;r[n]=a&255}}return r}i.split32=u;function l(e,t){return e>>>t|e<<32-t}i.rotr32=l;function p(e,t){return e<>>32-t}i.rotl32=p;function b(e,t){return e+t>>>0}i.sum32=b;function v(e,t,r){return e+t+r>>>0}i.sum32_3=v;function y(e,t,r,i){return e+t+r+i>>>0}i.sum32_4=y;function g(e,t,r,i,n){return e+t+r+i+n>>>0}i.sum32_5=g;function m(e,t){if(!e)throw new Error(t||"Assertion failed")}i.assert=m;i.inherits=n;function w(e,t,r,i){var n=e[t];var a=e[t+1];var f=i+a>>>0;var s=(f>>0;e[t+1]=f}r.sum64=w;function _(e,t,r,i){var n=t+i>>>0;var a=(n>>0}r.sum64_hi=_;function S(e,t,r,i){var n=t+i;return n>>>0}r.sum64_lo=S;function E(e,t,r,i,n,a,f,s){var o=0;var c=t;c=c+i>>>0;o+=c>>0;o+=c>>0;o+=c>>0}r.sum64_4_hi=E;function B(e,t,r,i,n,a,f,s){var o=t+i+a+s;return o>>>0}r.sum64_4_lo=B;function A(e,t,r,i,n,a,f,s,o,c){var h=0;var d=t;d=d+i>>>0;h+=d>>0;h+=d>>0;h+=d>>0;h+=d>>0}r.sum64_5_hi=A;function I(e,t,r,i,n,a,f,s,o,c){var h=t+i+a+s+c;return h>>>0}r.sum64_5_lo=I;function k(e,t,r){var i=t<<32-r|e>>>r;return i>>>0}r.rotr64_hi=k;function x(e,t,r){var i=e<<32-r|t>>>r;return i>>>0}r.rotr64_lo=x;function R(e,t,r){return e>>>r}r.shr64_hi=R;function T(e,t,r){var i=e<<32-r|t>>>r;return i>>>0}r.shr64_lo=T},{inherits:92}],90:[function(e,t,r){r.read=function(e,t,r,i,n){var a,f;var s=n*8-i-1;var o=(1<>1;var h=-7;var d=r?n-1:0;var u=r?-1:1;var l=e[t+d];d+=u;a=l&(1<<-h)-1;l>>=-h;h+=s;for(;h>0;a=a*256+e[t+d],d+=u,h-=8){}f=a&(1<<-h)-1;a>>=-h;h+=i;for(;h>0;f=f*256+e[t+d],d+=u,h-=8){}if(a===0){a=1-c}else if(a===o){return f?NaN:(l?-1:1)*Infinity}else{f=f+Math.pow(2,i);a=a-c}return(l?-1:1)*f*Math.pow(2,a-i)};r.write=function(e,t,r,i,n,a){var f,s,o;var c=a*8-n-1;var h=(1<>1;var u=n===23?Math.pow(2,-24)-Math.pow(2,-77):0;var l=i?0:a-1;var p=i?1:-1;var b=t<0||t===0&&1/t<0?1:0;t=Math.abs(t);if(isNaN(t)||t===Infinity){s=isNaN(t)?1:0;f=h}else{f=Math.floor(Math.log(t)/Math.LN2);if(t*(o=Math.pow(2,-f))<1){f--;o*=2}if(f+d>=1){t+=u/o}else{t+=u*Math.pow(2,1-d)}if(t*o>=2){f++;o/=2}if(f+d>=h){s=0;f=h}else if(f+d>=1){s=(t*o-1)*Math.pow(2,n);f=f+d}else{s=t*Math.pow(2,d-1)*Math.pow(2,n);f=0}}for(;n>=8;e[r+l]=s&255,l+=p,s/=256,n-=8){}f=f<0;e[r+l]=f&255,l+=p,f/=256,c-=8){}e[r+l-p]|=b*128}},{}],91:[function(e,t,r){var i=[].indexOf;t.exports=function(e,t){if(i)return e.indexOf(t);for(var r=0;r0){if(t&1){r+=e}t>>>=1;if(t>0){e+=e}}return r};var c=r.sha1=r.md.sha1={};var h=null;var d=false;var u=function(){h=String.fromCharCode(128);h+=r.util.fillString(String.fromCharCode(0),64);d=true};var l=function(e,t,r){var i,n,a,f,s,o,c,h;var d=r.length();while(d>=64){n=e.h0;a=e.h1;f=e.h2;s=e.h3;o=e.h4;for(h=0;h<16;++h){i=r.getInt32();t[h]=i;c=s^a&(f^s);i=(n<<5|n>>>27)+c+o+1518500249+i;o=s;s=f;f=a<<30|a>>>2;a=n;n=i}for(;h<20;++h){i=t[h-3]^t[h-8]^t[h-14]^t[h-16];i=i<<1|i>>>31;t[h]=i;c=s^a&(f^s);i=(n<<5|n>>>27)+c+o+1518500249+i;o=s;s=f;f=a<<30|a>>>2;a=n;n=i}for(;h<32;++h){i=t[h-3]^t[h-8]^t[h-14]^t[h-16];i=i<<1|i>>>31;t[h]=i;c=a^f^s;i=(n<<5|n>>>27)+c+o+1859775393+i;o=s;s=f;f=a<<30|a>>>2;a=n;n=i}for(;h<40;++h){i=t[h-6]^t[h-16]^t[h-28]^t[h-32];i=i<<2|i>>>30;t[h]=i;c=a^f^s;i=(n<<5|n>>>27)+c+o+1859775393+i;o=s;s=f;f=a<<30|a>>>2;a=n;n=i}for(;h<60;++h){i=t[h-6]^t[h-16]^t[h-28]^t[h-32];i=i<<2|i>>>30;t[h]=i;c=a&f|s&(a^f);i=(n<<5|n>>>27)+c+o+2400959708+i;o=s;s=f;f=a<<30|a>>>2;a=n;n=i}for(;h<80;++h){i=t[h-6]^t[h-16]^t[h-28]^t[h-32];i=i<<2|i>>>30;t[h]=i;c=a^f^s;i=(n<<5|n>>>27)+c+o+3395469782+i;o=s;s=f;f=a<<30|a>>>2;a=n;n=i}e.h0+=n;e.h1+=a;e.h2+=f;e.h3+=s;e.h4+=o;d-=64}};c.create=function(){if(!d){u()}var e=null;var t=r.util.createBuffer();var i=new Array(80);var n={algorithm:"sha1",blockLength:64,digestLength:20,messageLength:0};n.start=function(){n.messageLength=0;t=r.util.createBuffer();e={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878,h4:3285377520}};n.start();n.update=function(a,f){if(f==="utf8"){a=r.util.encodeUtf8(a)}n.messageLength+=a.length;t.putBytes(a);l(e,i,t);if(t.read>2048||t.length()===0){t.compact()}};n.digest=function(){var a=n.messageLength;var f=r.util.createBuffer();f.putBytes(t.bytes());f.putBytes(h.substr(0,64-(a+8)%64));f.putInt32(a>>>29&255);f.putInt32(a<<3&4294967295);var s={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4};l(s,i,f);var o=r.util.createBuffer();o.putInt32(s.h0);o.putInt32(s.h1);o.putInt32(s.h2);o.putInt32(s.h3);o.putInt32(s.h4);return o};return n};s.ByteBuffer=function(e){this.data=e||"";this.read=0};s.ByteBuffer.prototype.length=function(){return this.data.length-this.read};s.ByteBuffer.prototype.isEmpty=function(){return this.data.length-this.read===0};s.ByteBuffer.prototype.putByte=function(e){this.data+=String.fromCharCode(e)};s.ByteBuffer.prototype.fillWithByte=function(e,t){e=String.fromCharCode(e);var r=this.data;while(t>0){if(t&1){r+=e}t>>>=1;if(t>0){e+=e}}this.data=r};s.ByteBuffer.prototype.putBytes=function(e){this.data+=e};s.ByteBuffer.prototype.putString=function(e){this.data+=s.encodeUtf8(e)};s.ByteBuffer.prototype.putInt16=function(e){this.data+=String.fromCharCode(e>>8&255)+String.fromCharCode(e&255)};s.ByteBuffer.prototype.putInt24=function(e){this.data+=String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(e&255)};s.ByteBuffer.prototype.putInt32=function(e){this.data+=String.fromCharCode(e>>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(e&255)};s.ByteBuffer.prototype.putInt16Le=function(e){this.data+=String.fromCharCode(e&255)+String.fromCharCode(e>>8&255)};s.ByteBuffer.prototype.putInt24Le=function(e){this.data+=String.fromCharCode(e&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255)};s.ByteBuffer.prototype.putInt32Le=function(e){this.data+=String.fromCharCode(e&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>24&255)};s.ByteBuffer.prototype.putInt=function(e,t){do{t-=8;this.data+=String.fromCharCode(e>>t&255)}while(t>0)};s.ByteBuffer.prototype.putBuffer=function(e){this.data+=e.getBytes()};s.ByteBuffer.prototype.getByte=function(){return this.data.charCodeAt(this.read++)};s.ByteBuffer.prototype.getInt16=function(){var e=this.data.charCodeAt(this.read)<<8^this.data.charCodeAt(this.read+1);this.read+=2;return e};s.ByteBuffer.prototype.getInt24=function(){var e=this.data.charCodeAt(this.read)<<16^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2);this.read+=3;return e};s.ByteBuffer.prototype.getInt32=function(){var e=this.data.charCodeAt(this.read)<<24^this.data.charCodeAt(this.read+1)<<16^this.data.charCodeAt(this.read+2)<<8^this.data.charCodeAt(this.read+3);this.read+=4;return e};s.ByteBuffer.prototype.getInt16Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8;this.read+=2;return e};s.ByteBuffer.prototype.getInt24Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16;this.read+=3;return e};s.ByteBuffer.prototype.getInt32Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16^this.data.charCodeAt(this.read+3)<<24;this.read+=4;return e};s.ByteBuffer.prototype.getInt=function(e){var t=0;do{t=(t<0);return t};s.ByteBuffer.prototype.getBytes=function(e){var t;if(e){e=Math.min(this.length(),e);t=this.data.slice(this.read,this.read+e);this.read+=e}else if(e===0){t=""}else{t=this.read===0?this.data:this.data.slice(this.read);this.clear()}return t};s.ByteBuffer.prototype.bytes=function(e){return typeof e==="undefined"?this.data.slice(this.read):this.data.slice(this.read,this.read+e)};s.ByteBuffer.prototype.at=function(e){return this.data.charCodeAt(this.read+e)};s.ByteBuffer.prototype.setAt=function(e,t){this.data=this.data.substr(0,this.read+e)+String.fromCharCode(t)+this.data.substr(this.read+e+1)};s.ByteBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)};s.ByteBuffer.prototype.copy=function(){var e=s.createBuffer(this.data);e.read=this.read;return e};s.ByteBuffer.prototype.compact=function(){if(this.read>0){this.data=this.data.slice(this.read);this.read=0}};s.ByteBuffer.prototype.clear=function(){this.data="";this.read=0};s.ByteBuffer.prototype.truncate=function(e){var t=Math.max(0,this.length()-e);this.data=this.data.substr(this.read,t);this.read=0};s.ByteBuffer.prototype.toHex=function(){var e="";for(var t=this.read;t=e){return i(null,c.getBytes(e))}if(t.generated>=1048576){var u=+new Date;if(t.time===null||u-t.time>100){t.key=null}}if(t.key===null){return f(h)}var l=n(t.key,t.seed);t.generated+=l.length;c.putBytes(l);t.key=s(n(t.key,a(t.seed)));t.seed=o(n(t.key,t.seed));r.util.setImmediate(h)}};t.generateSync=function(e){var i=t.plugin.cipher;var n=t.plugin.increment;var a=t.plugin.formatKey;var f=t.plugin.formatSeed;var o=r.util.createBuffer();while(o.length()=1048576){var c=+new Date;if(t.time===null||c-t.time>100){t.key=null}}if(t.key===null){s()}var h=i(t.key,t.seed);t.generated+=h.length;o.putBytes(h);t.key=a(i(t.key,n(t.seed)));t.seed=f(i(t.key,t.seed))}return o.getBytes(e)};function f(e){if(t.pools[0].messageLength>=32){o();return e()}var r=32-t.pools[0].messageLength<<5;t.seedFile(r,function(r,i){if(r){return e(r)}t.collect(i);o();e()})}function s(){if(t.pools[0].messageLength>=32){return o()}var e=32-t.pools[0].messageLength<<5;t.collect(t.seedFileSync(e));o()}function o(){var e=r.md.sha1.create();e.update(t.pools[0].digest().getBytes());t.pools[0].start();var i=1;for(var n=1;n<32;++n){i=i===31?2147483648:i<<2;if(i%t.reseeds===0){e.update(t.pools[n].digest().getBytes());t.pools[n].start()}}var a=e.digest().getBytes();e.start();e.update(a);var f=e.digest().getBytes();t.key=t.plugin.formatKey(a);t.seed=t.plugin.formatSeed(f);++t.reseeds;t.generated=0;t.time=+new Date}function c(e){var t=r.util.createBuffer();if(typeof window!=="undefined"&&window.crypto&&window.crypto.getRandomValues){var i=new Uint32Array(e/4);try{window.crypto.getRandomValues(i);for(var n=0;n>16);s+=(f&32767)<<16;s+=f>>15;s=(s&2147483647)+(s>>31);c=s&4294967295;for(var n=0;n<3;++n){o=c>>>(n<<3);o^=Math.floor(Math.random()*255);t.putByte(String.fromCharCode(o&255))}}}return t.getBytes()}if(b){t.seedFile=function(e,t){b.randomBytes(e,function(e,r){if(e){return t(e)}t(null,r.toString())})};t.seedFileSync=function(e){return b.randomBytes(e).toString()}}else{t.seedFile=function(e,t){try{t(null,c(e))}catch(r){t(r)}};t.seedFileSync=c}t.collect=function(e){var r=e.length;for(var i=0;i>n&255)}t.collect(i)};t.registerWorker=function(e){if(e===self){t.seedFile=function(e,t){function r(e){var i=e.data;if(i.forge&&i.forge.prng){self.removeEventListener("message",r);t(i.forge.prng.err,i.forge.prng.bytes)}}self.addEventListener("message",r);self.postMessage({forge:{prng:{needed:e}}})}}else{function r(r){var i=r.data;if(i.forge&&i.forge.prng){t.seedFile(i.forge.prng.needed,function(t,r){e.postMessage({forge:{prng:{err:t,bytes:r}}})})}}e.addEventListener("message",r)}};return t};var v=false;var y=4;var g;var m;var w;var _;var S;var E=function(){v=true;w=[0,1,2,4,8,16,32,64,128,27,54];var e=new Array(256);for(var t=0;t<128;++t){e[t]=t<<1;e[t+128]=t+128<<1^283}g=new Array(256);m=new Array(256);_=new Array(4);S=new Array(4);for(var t=0;t<4;++t){_[t]=new Array(256);S[t]=new Array(256)}var r=0,i=0,n,a,f,s,o,c,h;for(var t=0;t<256;++t){s=i^i<<1^i<<2^i<<3^i<<4;s=s>>8^s&255^99;g[r]=s;m[s]=r;o=e[s];n=e[r];a=e[n];f=e[a];c=o<<24^s<<16^s<<8^(s^o);h=(n^a^f)<<24^(r^f)<<16^(r^a^f)<<8^(r^n^f);for(var d=0;d<4;++d){_[d][r]=c;S[d][s]=h;c=c<<24|c>>>8;h=h<<24|h>>>8}if(r===0){r=i=1}else{r=n^e[e[e[n^f]]];i^=e[e[i]]}}};var B=function(e,t){var r=e.slice(0);var i,n=1;var a=r.length;var f=a+6+1;var s=y*f;for(var o=a;o>>16&255]<<24^g[i>>>8&255]<<16^g[i&255]<<8^g[i>>>24]^w[n]<<24;n++}else if(a>6&&o%a==4){i=g[i>>>24]<<24^g[i>>>16&255]<<16^g[i>>>8&255]<<8^g[i&255]}r[o]=r[o-a]^i}if(t){var c;var h=S[0];var d=S[1];var u=S[2];var l=S[3];var p=r.slice(0);var s=r.length;for(var o=0,b=s-y;o>>24]]^d[g[c>>>16&255]]^u[g[c>>>8&255]]^l[g[c&255]]}}}r=p}return r};r.aes._expandKey=function(e,t){if(!v){E()}return B(e,t)};var A=function(e,t,r,i){var n=e.length/4-1;var a,f,s,o,c;if(i){a=S[0];f=S[1];s=S[2];o=S[3];c=m}else{a=_[0];f=_[1];s=_[2];o=_[3];c=g}var h,d,u,l,p,b,v;h=t[0]^e[0];d=t[i?3:1]^e[1];u=t[2]^e[2];l=t[i?1:3]^e[3];var y=3;for(var w=1;w>>24]^f[d>>>16&255]^s[u>>>8&255]^o[l&255]^e[++y];b=a[d>>>24]^f[u>>>16&255]^s[l>>>8&255]^o[h&255]^e[++y];v=a[u>>>24]^f[l>>>16&255]^s[h>>>8&255]^o[d&255]^e[++y];l=a[l>>>24]^f[h>>>16&255]^s[d>>>8&255]^o[u&255]^e[++y];h=p;d=b;u=v}r[0]=c[h>>>24]<<24^c[d>>>16&255]<<16^c[u>>>8&255]<<8^c[l&255]^e[++y];r[i?3:1]=c[d>>>24]<<24^c[u>>>16&255]<<16^c[l>>>8&255]<<8^c[h&255]^e[++y];r[2]=c[u>>>24]<<24^c[l>>>16&255]<<16^c[h>>>8&255]<<8^c[d&255]^e[++y];r[i?1:3]=c[l>>>24]<<24^c[h>>>16&255]<<16^c[d>>>8&255]<<8^c[u&255]^e[++y]};r.aes._updateBlock=A;var I={};var k=new Array(4);var x=r.util.createBuffer();I.formatKey=function(e){var t=r.util.createBuffer(e);e=new Array(4);e[0]=t.getInt32();e[1]=t.getInt32();e[2]=t.getInt32();e[3]=t.getInt32();return r.aes._expandKey(e,false)};I.formatSeed=function(e){var t=r.util.createBuffer(e);e=new Array(4);e[0]=t.getInt32();e[1]=t.getInt32();e[2]=t.getInt32();e[3]=t.getInt32();return e};I.cipher=function(e,t){r.aes._updateBlock(e,t,k,false);x.putInt32(k[0]);x.putInt32(k[1]);x.putInt32(k[2]);x.putInt32(k[3]);return x.getBytes()};I.increment=function(e){++e[3];return e};I.md=r.md.sha1;var R=r.prng.create(I);if(typeof window=="undefined"||!window.crypto||!window.crypto.getRandomValues){if(typeof window==="undefined"||window.document===undefined){}R.collectInt(+new Date,32);if(typeof navigator!=="undefined"){var T="";for(var C in navigator){try{if(typeof navigator[C]=="string"){T+=navigator[C]}}catch(M){}}R.collect(T);T=null}}r.random=R;r.random.getBytes=function(e,t){return r.random.generate(e,t)};r.pki.rsa.createKeyPairGenerationState=function(e,t){if(typeof e==="string"){e=parseInt(e,10)}e=e||1024;var i={nextBytes:function(e){var t=r.random.getBytes(e.length);for(var i=0;i>1,pBits:e-(e>>1),pqState:0,num:null,keys:null};n.e.fromInt(n.eInt);return n};var P;var D=0xdeadbeefcafe;var L=(D&16777215)==15715070;function j(e,t,r){this.data=[];if(e!=null)if("number"==typeof e)this.fromNumber(e,t,r);else if(t==null&&"string"!=typeof e)this.fromString(e,256);else this.fromString(e,t)}function q(){return new j(null)}function N(e,t,r,i,n,a){while(--a>=0){var f=t*this.data[e++]+r.data[i]+n;n=Math.floor(f/67108864);r.data[i++]=f&67108863}return n}function O(e,t,r,i,n,a){var f=t&32767,s=t>>15;while(--a>=0){var o=this.data[e]&32767;var c=this.data[e++]>>15;var h=s*o+c*f;o=f*o+((h&32767)<<15)+r.data[i]+(n&1073741823);n=(o>>>30)+(h>>>15)+s*c+(n>>>30);r.data[i++]=o&1073741823}return n}function U(e,t,r,i,n,a){var f=t&16383,s=t>>14;while(--a>=0){var o=this.data[e]&16383;var c=this.data[e++]>>14;var h=s*o+c*f;o=f*o+((h&16383)<<14)+r.data[i]+n;n=(o>>28)+(h>>14)+s*c;r.data[i++]=o&268435455}return n}if(typeof navigator==="undefined"){j.prototype.am=U;P=28}else if(L&&navigator.appName=="Microsoft Internet Explorer"){j.prototype.am=O;P=30}else if(L&&navigator.appName!="Netscape"){j.prototype.am=N;P=26}else{j.prototype.am=U;P=28}j.prototype.DB=P;j.prototype.DM=(1<=0;--t)e.data[t]=this.data[t];e.t=this.t;e.s=this.s}function G(e){this.t=1;this.s=e<0?-1:0;if(e>0)this.data[0]=e;else if(e<-1)this.data[0]=e+DV;else this.t=0}function J(e){var t=q();t.fromInt(e);return t}function Z(e,t){var r;if(t==16)r=4;else if(t==8)r=3;else if(t==256)r=8;else if(t==2)r=1;else if(t==32)r=5;else if(t==4)r=2;else{this.fromRadix(e,t);return}this.t=0;this.s=0;var i=e.length,n=false,a=0;while(--i>=0){var f=r==8?e[i]&255:X(e,i);if(f<0){if(e.charAt(i)=="-")n=true;continue}n=false;if(a==0)this.data[this.t++]=f;else if(a+r>this.DB){this.data[this.t-1]|=(f&(1<>this.DB-a}else this.data[this.t-1]|=f<=this.DB)a-=this.DB}if(r==8&&(e[0]&128)!=0){this.s=-1;if(a>0)this.data[this.t-1]|=(1<0&&this.data[this.t-1]==e)--this.t}function $(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(e==16)t=4;else if(e==8)t=3;else if(e==2)t=1;else if(e==32)t=5;else if(e==4)t=2;else return this.toRadix(e);var r=(1<0){if(s>s)>0){n=true;a=Y(i)}while(f>=0){if(s>(s+=this.DB-t)}else{i=this.data[f]>>(s-=t)&r;if(s<=0){s+=this.DB;--f}}if(i>0)n=true;if(n)a+=Y(i)}}return n?a:"0"}function ee(){var e=q();j.ZERO.subTo(this,e);return e}function te(){return this.s<0?this.negate():this}function re(e){var t=this.s-e.s;if(t!=0)return t;var r=this.t;t=r-e.t;if(t!=0)return this.s<0?-t:t;while(--r>=0)if((t=this.data[r]-e.data[r])!=0)return t;return 0}function ie(e){var t=1,r;if((r=e>>>16)!=0){e=r;t+=16}if((r=e>>8)!=0){e=r;t+=8}if((r=e>>4)!=0){e=r;t+=4}if((r=e>>2)!=0){e=r;t+=2}if((r=e>>1)!=0){e=r;t+=1}return t}function ne(){if(this.t<=0)return 0;return this.DB*(this.t-1)+ie(this.data[this.t-1]^this.s&this.DM)}function ae(e,t){var r;for(r=this.t-1;r>=0;--r)t.data[r+e]=this.data[r];for(r=e-1;r>=0;--r)t.data[r]=0;t.t=this.t+e;t.s=this.s}function fe(e,t){for(var r=e;r=0;--s){t.data[s+a+1]=this.data[s]>>i|f;f=(this.data[s]&n)<=0;--s)t.data[s]=0;t.data[a]=f;t.t=this.t+a+1;t.s=this.s;t.clamp()}function oe(e,t){t.s=this.s;var r=Math.floor(e/this.DB);if(r>=this.t){t.t=0;return}var i=e%this.DB;var n=this.DB-i;var a=(1<>i;for(var f=r+1;f>i}if(i>0)t.data[this.t-r-1]|=(this.s&a)<>=this.DB}if(e.t>=this.DB}i+=this.s}else{i+=this.s;while(r>=this.DB}i-=e.s}t.s=i<0?-1:0;if(i<-1)t.data[r++]=this.DV+i;else if(i>0)t.data[r++]=i;t.t=r;t.clamp()}function he(e,t){var r=this.abs(),i=e.abs();var n=r.t;t.t=n+i.t;while(--n>=0)t.data[n]=0;for(n=0;n=0)e.data[r]=0;for(r=0;r=t.DV){e.data[r+t.t]-=t.DV;e.data[r+t.t+1]=1}}if(e.t>0)e.data[e.t-1]+=t.am(r,t.data[r],e,2*r,0,1);e.s=0;e.clamp()}function ue(e,t,r){var i=e.abs();if(i.t<=0)return;var n=this.abs();if(n.t0){i.lShiftTo(o,a);n.lShiftTo(o,r)}else{i.copyTo(a);n.copyTo(r)}var c=a.t;var h=a.data[c-1];if(h==0)return;var d=h*(1<1?a.data[c-2]>>this.F2:0);var u=this.FV/d,l=(1<=0){r.data[r.t++]=1;r.subTo(y,r)}j.ONE.dlShiftTo(c,y);y.subTo(a,a);while(a.t=0){var g=r.data[--b]==h?this.DM:Math.floor(r.data[b]*u+(r.data[b-1]+p)*l);if((r.data[b]+=a.am(0,g,r,v,0,c))0)r.rShiftTo(o,r);if(f<0)j.ZERO.subTo(r,r)}function le(e){var t=q();this.abs().divRemTo(e,null,t);if(this.s<0&&t.compareTo(j.ZERO)>0)e.subTo(t,t);return t}function pe(e){this.m=e}function be(e){if(e.s<0||e.compareTo(this.m)>=0)return e.mod(this.m);else return e}function ve(e){return e}function ye(e){e.divRemTo(this.m,null,e)}function ge(e,t,r){e.multiplyTo(t,r);this.reduce(r)}function me(e,t){e.squareTo(t);this.reduce(t)}pe.prototype.convert=be;pe.prototype.revert=ve;pe.prototype.reduce=ye;pe.prototype.mulTo=ge;pe.prototype.sqrTo=me;function we(){if(this.t<1)return 0;var e=this.data[0];if((e&1)==0)return 0;var t=e&3;t=t*(2-(e&15)*t)&15;t=t*(2-(e&255)*t)&255;t=t*(2-((e&65535)*t&65535))&65535;t=t*(2-e*t%this.DV)%this.DV;return t>0?this.DV-t:-t}function _e(e){this.m=e;this.mp=e.invDigit();this.mpl=this.mp&32767;this.mph=this.mp>>15;this.um=(1<0)this.m.subTo(t,t);return t}function Ee(e){var t=q();e.copyTo(t);this.reduce(t);return t}function Be(e){while(e.t<=this.mt2)e.data[e.t++]=0;for(var t=0;t>15)*this.mpl&this.um)<<15)&e.DM;r=t+this.m.t;e.data[r]+=this.m.am(0,i,e,t,0,this.m.t);while(e.data[r]>=e.DV){e.data[r]-=e.DV;e.data[++r]++}}e.clamp();e.drShiftTo(this.m.t,e);if(e.compareTo(this.m)>=0)e.subTo(this.m,e)}function Ae(e,t){e.squareTo(t);this.reduce(t)}function Ie(e,t,r){e.multiplyTo(t,r);this.reduce(r)}_e.prototype.convert=Se;_e.prototype.revert=Ee;_e.prototype.reduce=Be;_e.prototype.mulTo=Ie;_e.prototype.sqrTo=Ae;function ke(){return(this.t>0?this.data[0]&1:this.s)==0}function xe(e,t){if(e>4294967295||e<1)return j.ONE;var r=q(),i=q(),n=t.convert(this),a=ie(e)-1;n.copyTo(r);while(--a>=0){t.sqrTo(r,i);if((e&1<0)t.mulTo(i,n,r);else{var f=r;r=i;i=f}}return t.revert(r)}function Re(e,t){var r;if(e<256||t.isEven())r=new pe(t);else r=new _e(t);return this.exp(e,r)}j.prototype.copyTo=W;j.prototype.fromInt=G;j.prototype.fromString=Z;j.prototype.clamp=Q;j.prototype.dlShiftTo=ae;j.prototype.drShiftTo=fe;j.prototype.lShiftTo=se;j.prototype.rShiftTo=oe;j.prototype.subTo=ce;j.prototype.multiplyTo=he;j.prototype.squareTo=de;j.prototype.divRemTo=ue;j.prototype.invDigit=we;j.prototype.isEven=ke;j.prototype.exp=xe;j.prototype.toString=$;j.prototype.negate=ee;j.prototype.abs=te;j.prototype.compareTo=re;j.prototype.bitLength=ne;j.prototype.mod=le;j.prototype.modPowInt=Re;j.ZERO=J(0);j.ONE=J(1);function Te(){var e=q();this.copyTo(e);return e}function Ce(){if(this.s<0){if(this.t==1)return this.data[0]-this.DV;else if(this.t==0)return-1}else if(this.t==1)return this.data[0];else if(this.t==0)return 0;return(this.data[1]&(1<<32-this.DB)-1)<>24}function Pe(){return this.t==0?this.s:this.data[0]<<16>>16}function De(e){return Math.floor(Math.LN2*this.DB/Math.log(e))}function Le(){if(this.s<0)return-1;else if(this.t<=0||this.t==1&&this.data[0]<=0)return 0;else return 1}function je(e){if(e==null)e=10;if(this.signum()==0||e<2||e>36)return"0";var t=this.chunkSize(e);var r=Math.pow(e,t);var i=J(r),n=q(),a=q(),f="";this.divRemTo(i,n,a);while(n.signum()>0){f=(r+a.intValue()).toString(e).substr(1)+f;n.divRemTo(i,n,a)}return a.intValue().toString(e)+f}function qe(e,t){this.fromInt(0);if(t==null)t=10;var r=this.chunkSize(t);var i=Math.pow(t,r),n=false,a=0,f=0;for(var s=0;s=r){this.dMultiply(i);this.dAddOffset(f,0);a=0;f=0}}if(a>0){this.dMultiply(Math.pow(t,a));this.dAddOffset(f,0)}if(n)j.ZERO.subTo(this,this)}function Ne(e,t,r){if("number"==typeof t){if(e<2)this.fromInt(1);else{this.fromNumber(e,r);if(!this.testBit(e-1))this.bitwiseTo(j.ONE.shiftLeft(e-1),Ye,this);if(this.isEven())this.dAddOffset(1,0);while(!this.isProbablePrime(t)){this.dAddOffset(2,0);if(this.bitLength()>e)this.subTo(j.ONE.shiftLeft(e-1),this)}}}else{var i=new Array,n=e&7;i.length=(e>>3)+1;t.nextBytes(i);if(n>0)i[0]&=(1<0){if(r>r)!=(this.s&this.DM)>>r)t[n++]=i|this.s<=0){if(r<8){i=(this.data[e]&(1<>(r+=this.DB-8)}else{i=this.data[e]>>(r-=8)&255;if(r<=0){r+=this.DB;--e}}if((i&128)!=0)i|=-256;if(n==0&&(this.s&128)!=(i&128))++n;if(n>0||i!=this.s)t[n++]=i}}return t}function Ue(e){return this.compareTo(e)==0}function ze(e){return this.compareTo(e)<0?this:e}function Ke(e){return this.compareTo(e)>0?this:e}function Fe(e,t,r){var i,n,a=Math.min(e.t,this.t);for(i=0;i>=16;t+=16}if((e&255)==0){e>>=8;t+=8}if((e&15)==0){e>>=4;t+=4}if((e&3)==0){e>>=2;t+=2}if((e&1)==0)++t;return t}function rt(){for(var e=0;e=this.t)return this.s!=0;return(this.data[t]&1<>=this.DB}if(e.t>=this.DB}i+=this.s}else{i+=this.s;while(r>=this.DB}i+=e.s}t.s=i<0?-1:0;if(i>0)t.data[r++]=i;else if(i<-1)t.data[r++]=this.DV+i;t.t=r;t.clamp()}function dt(e){var t=q();this.addTo(e,t);return t}function ut(e){var t=q();this.subTo(e,t);return t}function lt(e){var t=q();this.multiplyTo(e,t);return t}function pt(e){var t=q();this.divRemTo(e,t,null);return t}function bt(e){var t=q();this.divRemTo(e,null,t);return t}function vt(e){var t=q(),r=q();this.divRemTo(e,t,r);return new Array(t,r)}function yt(e){this.data[this.t]=this.am(0,e-1,this,0,0,this.t);++this.t;this.clamp()}function gt(e,t){if(e==0)return;while(this.t<=t)this.data[this.t++]=0;this.data[t]+=e;while(this.data[t]>=this.DV){this.data[t]-=this.DV;if(++t>=this.t)this.data[this.t++]=0;++this.data[t]}}function mt(){}function wt(e){return e}function _t(e,t,r){e.multiplyTo(t,r)}function St(e,t){e.squareTo(t)}mt.prototype.convert=wt;mt.prototype.revert=wt;mt.prototype.mulTo=_t;mt.prototype.sqrTo=St;function Et(e){return this.exp(e,new mt)}function Bt(e,t,r){var i=Math.min(this.t+e.t,t);r.s=0;r.t=i;while(i>0)r.data[--i]=0;var n;for(n=r.t-this.t;i=0)r.data[i]=0;for(i=Math.max(t-this.t,0);i2*this.m.t)return e.mod(this.m);else if(e.compareTo(this.m)<0)return e;else{var t=q();e.copyTo(t);this.reduce(t);return t}}function xt(e){return e}function Rt(e){e.drShiftTo(this.m.t-1,this.r2);if(e.t>this.m.t+1){e.t=this.m.t+1;e.clamp()}this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3);this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);while(e.compareTo(this.r2)<0)e.dAddOffset(1,this.m.t+1);e.subTo(this.r2,e);while(e.compareTo(this.m)>=0)e.subTo(this.m,e)}function Tt(e,t){e.squareTo(t);this.reduce(t)}function Ct(e,t,r){e.multiplyTo(t,r);this.reduce(r)}It.prototype.convert=kt;It.prototype.revert=xt;It.prototype.reduce=Rt;It.prototype.mulTo=Ct;It.prototype.sqrTo=Tt;function Mt(e,t){var r=e.bitLength(),i,n=J(1),a;if(r<=0)return n;else if(r<18)i=1;else if(r<48)i=3;else if(r<144)i=4;else if(r<768)i=5;else i=6;if(r<8)a=new pe(t);else if(t.isEven())a=new It(t);else a=new _e(t);var f=new Array,s=3,o=i-1,c=(1<1){var h=q();a.sqrTo(f[1],h);while(s<=c){f[s]=q();a.mulTo(h,f[s-2],f[s]);s+=2}}var d=e.t-1,u,l=true,p=q(),b;r=ie(e.data[d])-1;while(d>=0){if(r>=o)u=e.data[d]>>r-o&c;else{u=(e.data[d]&(1<0)u|=e.data[d-1]>>this.DB+r-o}s=i;while((u&1)==0){u>>=1;--s}if((r-=s)<0){r+=this.DB;--d}if(l){f[u].copyTo(n);l=false}else{while(s>1){a.sqrTo(n,p);a.sqrTo(p,n);s-=2}if(s>0)a.sqrTo(n,p);else{b=n;n=p;p=b}a.mulTo(p,f[u],n)}while(d>=0&&(e.data[d]&1<0){t.rShiftTo(a,t);r.rShiftTo(a,r)}while(t.signum()>0){if((n=t.getLowestSetBit())>0)t.rShiftTo(n,t);if((n=r.getLowestSetBit())>0)r.rShiftTo(n,r);if(t.compareTo(r)>=0){t.subTo(r,t);t.rShiftTo(1,t)}else{r.subTo(t,r);r.rShiftTo(1,r)}}if(a>0)r.lShiftTo(a,r);return r}function Dt(e){if(e<=0)return 0;var t=this.DV%e,r=this.s<0?e-1:0;if(this.t>0)if(t==0)r=this.data[0]%e;else for(var i=this.t-1;i>=0;--i)r=(t*r+this.data[i])%e;return r}function Lt(e){var t=e.isEven();if(this.isEven()&&t||e.signum()==0)return j.ZERO;var r=e.clone(),i=this.clone();var n=J(1),a=J(0),f=J(0),s=J(1);while(r.signum()!=0){while(r.isEven()){r.rShiftTo(1,r);if(t){if(!n.isEven()||!a.isEven()){n.addTo(this,n);a.subTo(e,a)}n.rShiftTo(1,n)}else if(!a.isEven())a.subTo(e,a);a.rShiftTo(1,a)}while(i.isEven()){i.rShiftTo(1,i);if(t){if(!f.isEven()||!s.isEven()){f.addTo(this,f);s.subTo(e,s)}f.rShiftTo(1,f)}else if(!s.isEven())s.subTo(e,s);s.rShiftTo(1,s)}if(r.compareTo(i)>=0){r.subTo(i,r);if(t)n.subTo(f,n);a.subTo(s,a)}else{i.subTo(r,i);if(t)f.subTo(n,f);s.subTo(a,s)}}if(i.compareTo(j.ONE)!=0)return j.ZERO;if(s.compareTo(e)>=0)return s.subtract(e);if(s.signum()<0)s.addTo(e,s);else return s;if(s.signum()<0)return s.add(e);else return s}var jt=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509];var qt=(1<<26)/jt[jt.length-1];function Nt(e){var t,r=this.abs();if(r.t==1&&r.data[0]<=jt[jt.length-1]){for(t=0;t>1;if(e>jt.length)e=jt.length;var n=q();for(var a=0;a0){c.putByte(0);--h}c.putBytes(r.util.hexToBytes(o));if(n!==false){var d=c.getByte();var u=c.getByte();if(d!==0||i&&u!==0&&u!==1||!i&&u!=2||i&&u===0&&typeof n==="undefined"){throw{message:"Encryption block is invalid."}}var l=0;if(u===0){l=a-3-n;for(var p=0;p1){if(c.getByte()!==255){--c.read;break}++l}}else if(u===2){l=0;while(c.length()>1){if(c.getByte()===0){--c.read;break}++l}}var b=c.getByte();if(b!==0||l!==a-3-c.length()){throw{message:"Encryption block is invalid."}}}return c.getBytes()};a.rsa.encrypt=function(e,t,i){var n=i;var a=r.util.createBuffer();var f=Math.ceil(t.n.bitLength()/8);if(i!==false&&i!==true){if(e.length>f-11){throw{message:"Message is too long to encrypt.",length:e.length,max:f-11}}a.putByte(0);a.putByte(i);var s=f-3-e.length;var o;if(i===0||i===1){n=false;o=i===0?0:255;for(var c=0;c0){l.putByte(0);--p}l.putBytes(r.util.hexToBytes(u));return l.getBytes()};a.rsa.setPrivateKey=function(e,t,r,i,n,f,s,o){var c={n:e,e:t,d:r,p:i,q:n,dP:f,dQ:s,qInv:o};c.decrypt=function(e){return a.rsa.decrypt(e,c,false)};c.sign=function(e,t){var r=false;if(t===undefined){t={encode:emsaPkcs1v15encode};r=1}var i=t.encode(e,c.n.bitLength());return a.rsa.encrypt(i,c,r)};return c};var zt=function(e){var t=e.getByte();if(t==128){return undefined}var r;var i=t&128;if(!i){r=t}else{r=e.getInt((t&127)<<3)}return r};var Kt=r.asn1=r.asn1||{};Kt.Type={NONE:0,BOOLEAN:1,INTEGER:2,BITSTRING:3,OCTETSTRING:4,NULL:5,OID:6,ODESC:7,EXTERNAL:8,REAL:9,ENUMERATED:10,EMBEDDED:11,UTF8:12,ROID:13,SEQUENCE:16,SET:17,PRINTABLESTRING:19,IA5STRING:22,UTCTIME:23,GENERALIZEDTIME:24,BMPSTRING:30};Kt.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192};Kt.create=function(e,t,r,i){if(i.constructor==Array){var n=[];for(var a=0;a1){var c=e.read;var h=e.getByte();if(h===0){t=e.getByte();var d=t&192;if(d===Kt.Class.UNIVERSAL||d===Kt.Class.CONTEXT_SPECIFIC){try{var u=zt(e);o=u===a-(e.read-c);if(o){++c;--a}}catch(l){}}}e.read=c}if(o){f=[];if(a===undefined){for(;;){if(e.bytes(2)===String.fromCharCode(0,0)){ e.getBytes(2);break}f.push(Kt.fromDer(e))}}else{var p=e.length();while(a>0){f.push(Kt.fromDer(e));a-=p-e.length();p=e.length()}}}else{if(a===undefined){throw{message:"Non-constructed ASN.1 object of indefinite length."}}if(n===Kt.Type.BMPSTRING){f="";for(var b=0;b>>8}while(f>0);t.putByte(s.length|128);for(var a=s.length-1;a>=0;--a){t.putByte(s.charCodeAt(a))}}t.putBuffer(n);return t};a.rsa.setPublicKey=function(e,t){var r={n:e,e:t};r.encrypt=function(e){return a.rsa.encrypt(e,r,2)};r.verify=function(e,t,i){var n=i===undefined?undefined:false;var f=a.rsa.decrypt(t,r,true,n);if(i===undefined){var s=Kt.fromDer(f);return e===s.value[1].value}else{return i.verify(e,f,r.n.bitLength())}};return r};var Ft=[6,4,2,4,2,4,6,2];a.rsa.stepKeyPairGenerationState=function(e,t){var i=new j(null);i.fromInt(30);var n=0;var a=function(e,t){return e|t};var f=+new Date;var s;var o=0;while(e.keys===null&&(t<=0||oc){e.pqState=0}else if(e.num.isProbablePrime(1)){++e.pqState}else{e.num.dAddOffset(Ft[n++%8],0)}}else if(e.pqState===2){e.pqState=e.num.subtract(j.ONE).gcd(e.e).compareTo(j.ONE)===0?3:0}else if(e.pqState===3){e.pqState=0;if(e.num.isProbablePrime(10)){if(e.p===null){e.p=e.num}else{e.q=e.num}if(e.p!==null&&e.q!==null){++e.state}}e.num=null}}else if(e.state===1){if(e.p.compareTo(e.q)<0){e.num=e.p;e.p=e.q;e.q=e.num}++e.state}else if(e.state===2){e.p1=e.p.subtract(j.ONE);e.q1=e.q.subtract(j.ONE);e.phi=e.p1.multiply(e.q1);++e.state}else if(e.state===3){if(e.phi.gcd(e.e).compareTo(j.ONE)===0){++e.state}else{e.p=null;e.q=null;e.state=0}}else if(e.state===4){e.n=e.p.multiply(e.q);if(e.n.bitLength()===e.bits){++e.state}else{e.q=null;e.state=0}}else if(e.state===5){var d=e.e.modInverse(e.phi);e.keys={privateKey:r.pki.rsa.setPrivateKey(e.n,e.e,d,e.p,e.q,d.mod(e.p1),d.mod(e.q1),e.q.modInverse(e.p)),publicKey:r.pki.rsa.setPublicKey(e.n,e.e)}}s=+new Date;o+=s-f;f=s}return e.keys!==null};function Vt(e,t,i){if(typeof t==="function"){i=t;t={}}if(false||typeof Worker==="undefined"){function n(){if(r.pki.rsa.stepKeyPairGenerationState(e,10)){return i(null,e.keys)}r.util.setImmediate(n)}return n()}var a=t.workers||2;var f=t.workLoad||100;var s=f*30/8;var o=t.workerScript||"forge/prime.worker.js";var c=new j(null);c.fromInt(30);var h=function(e,t){return e|t};d();function d(){u(e.pBits,function(t,r){if(t){return i(t)}e.p=r;u(e.qBits,l)})}function u(t,r){var i=[];for(var n=0;nt){u=l()}var c=u.toString(16);n.target.postMessage({e:e.eInt,hex:c,workLoad:f});u.dAddOffset(s,0)}}function l(t,n){e.q=n;if(e.p.compareTo(e.q)<0){var a=e.p;e.p=e.q;e.q=a}e.p1=e.p.subtract(j.ONE);e.q1=e.q.subtract(j.ONE);e.phi=e.p1.multiply(e.q1);if(e.phi.gcd(e.e).compareTo(j.ONE)!==0){e.p=e.q=null;d();return}e.n=e.p.multiply(e.q);if(e.n.bitLength()!==e.bits){e.q=null;u(e.qBits,l);return}var f=e.e.modInverse(e.phi);e.keys={privateKey:r.pki.rsa.setPrivateKey(e.n,e.e,f,e.p,e.q,f.mod(e.p1),f.mod(e.q1),e.q.modInverse(e.p)),publicKey:r.pki.rsa.setPublicKey(e.n,e.e)};i(null,e.keys)}}a.rsa.generateKeyPair=function(e,t,r,i){if(arguments.length===1){if(typeof e==="object"){r=e;e=undefined}else if(typeof e==="function"){i=e;e=undefined}}else if(arguments.length===2){if(typeof e==="number"){if(typeof t==="function"){i=t}else{r=t}}else{r=e;i=t;e=undefined}t=undefined}else if(arguments.length===3){if(typeof t==="number"){if(typeof r==="function"){i=r;r=undefined}}else{i=r;r=t;t=undefined}}r=r||{};if(e===undefined){e=r.bits||1024}if(t===undefined){t=r.e||65537}var n=a.rsa.createKeyPairGenerationState(e,t);if(!i){a.rsa.stepKeyPairGenerationState(n,0);return n.keys}Vt(n,r,i)};var Ht=function(e){var t=e.toString(16);if(t[0]>="8"){t="00"+t}return r.util.hexToBytes(t)};a.publicKeyToRSAPublicKey=function(e){return Kt.create(Kt.Class.UNIVERSAL,Kt.Type.SEQUENCE,true,[Kt.create(Kt.Class.UNIVERSAL,Kt.Type.INTEGER,false,Ht(e.n)),Kt.create(Kt.Class.UNIVERSAL,Kt.Type.INTEGER,false,Ht(e.e))])};var Yt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";s.encode64=function(e,t){var r="";var i="";var n,a,f;var s=0;while(s>2);r+=Yt.charAt((n&3)<<4|a>>4);if(isNaN(a)){r+="=="}else{r+=Yt.charAt((a&15)<<2|f>>6);r+=isNaN(f)?"=":Yt.charAt(f&63)}if(t&&r.length>t){i+=r.substr(0,t)+"\r\n";r=r.substr(t)}}i+=r;return i};a.publicKeyToRSAPublicKeyPem=function(e,t){var i=Kt.toDer(a.publicKeyToRSAPublicKey(e));i=r.util.encode64(i.getBytes(),t||64);return"-----BEGIN RSA PUBLIC KEY-----\r\n"+i+"\r\n-----END RSA PUBLIC KEY-----"};a.privateKeyToAsn1=a.privateKeyToRSAPrivateKey=function(e){return Kt.create(Kt.Class.UNIVERSAL,Kt.Type.SEQUENCE,true,[Kt.create(Kt.Class.UNIVERSAL,Kt.Type.INTEGER,false,String.fromCharCode(0)),Kt.create(Kt.Class.UNIVERSAL,Kt.Type.INTEGER,false,Ht(e.n)),Kt.create(Kt.Class.UNIVERSAL,Kt.Type.INTEGER,false,Ht(e.e)),Kt.create(Kt.Class.UNIVERSAL,Kt.Type.INTEGER,false,Ht(e.d)),Kt.create(Kt.Class.UNIVERSAL,Kt.Type.INTEGER,false,Ht(e.p)),Kt.create(Kt.Class.UNIVERSAL,Kt.Type.INTEGER,false,Ht(e.q)),Kt.create(Kt.Class.UNIVERSAL,Kt.Type.INTEGER,false,Ht(e.dP)),Kt.create(Kt.Class.UNIVERSAL,Kt.Type.INTEGER,false,Ht(e.dQ)),Kt.create(Kt.Class.UNIVERSAL,Kt.Type.INTEGER,false,Ht(e.qInv))])};a.privateKeyToPem=function(e,t){var i=Kt.toDer(a.privateKeyToAsn1(e));i=r.util.encode64(i.getBytes(),t||64);return"-----BEGIN RSA PRIVATE KEY-----\r\n"+i+"\r\n-----END RSA PRIVATE KEY-----"}}).call(this,e("_process"))},{_process:108}],98:[function(e,t,r){var i=e("bn.js");var n=e("brorand");function a(e){this.rand=e||new n.Rand}t.exports=a;a.create=function f(e){return new a(e)};a.prototype._rand=function s(e){var t=e.bitLength();var r=this.rand.generate(Math.ceil(t/8));r[0]|=3;var n=t&7;if(n!==0)r[r.length-1]>>=7-n;return new i(r)};a.prototype.test=function o(e,t,r){var n=e.bitLength();var a=i.mont(e);var f=new i(1).toRed(a);if(!t)t=Math.max(1,n/48|0);var s=e.subn(1);var o=s.subn(1);for(var c=0;!s.testn(c);c++){}var h=e.shrn(c);var d=s.toRed(a);var u=true;for(;t>0;t--){var l=this._rand(o);if(r)r(l);var p=l.toRed(a).redPow(h);if(p.cmp(f)===0||p.cmp(d)===0)continue;for(var b=1;b0;t--){var d=this._rand(s);var u=e.gcd(d);if(u.cmpn(1)!==0)return u;var l=d.toRed(n).redPow(c);if(l.cmp(a)===0||l.cmp(h)===0)continue;for(var p=1;p1){return n.encode.apply(this,arguments)}throw new Error("multihash must be called with the encode or decode parameters.")};n.names={sha1:17,"sha2-256":18,"sha2-512":19,sha3:20,blake2b:64,blake2s:65};n.codes=i(n.names);n.defaultLengths={17:20,18:32,19:64,20:64,64:64,65:32};n.encode=function a(e,t,i){if(!e||!t){throw new Error("multihash encode requires at least two args: hashfn, digest")}t=n.coerceCode(t);if(!r.isBuffer(e)){throw new Error("digest should be a Buffer")}if(!i){i=e.length}if(i&&e.length!==i){throw new Error("digest length should be equal to specified length.")}if(i>127){throw new Error("multihash does not yet support digest lengths greater than 127 bytes.")}return r.concat([new r([t,i]),e])};n.decode=function f(e){var t=n.validate(e);if(t){throw t}var r={};r.code=e[0];r.name=n.codes[r.code];r.length=e[1];r.digest=e.slice(2);return r};n.validate=function s(e){if(!r.isBuffer(e)){return new Error("multihash must be a Buffer")}if(e.length<3){return new Error("multihash too short. must be > 3 bytes.")}if(e.length>129){return new Error("multihash too long. must be < 129 bytes.")}if(!n.isAppCode(e[0])&&!n.codes[e[0]]){return new Error("multihash unknown function code: 0x"+e[0].toString(16))}if(e.slice(2).length!==e[1]){return new Error("multihash length inconsistent: 0x"+e.toString("hex"))}return false};n.coerceCode=function o(e){var t=e;if(typeof e==="string"){if(!n.names[e]){throw new Error("Unrecognized hash function named: "+e)}t=n.names[e]}if(typeof t!=="number"){throw new Error("Hash function code should be a number. Got: "+t)}if(!n.codes[t]&&!n.isAppCode(t)){throw new Error("Unrecognized function code: "+t)}return t};n.isAppCode=function c(e){return e>0&&e<16}}).call(this,e("buffer").Buffer)},{buffer:46,"invert-hash":93}],101:[function(e,t,r){(function(r){var i=e("multihashes");var n=e("webcrypto");var a=t.exports=f;a.Buffer=r;function f(e,t,r){return i.encode(a.digest(e,t,r),t,r)}a.multihash=i;a.digest=function(e,t,r){var i=a.createHash(t).update(e).digest();if(r){i=i.slice(0,r)}return i};a.createHash=function(e,t){e=i.coerceCode(e);if(!a.functions[e]){throw new Error("multihash function "+e+" not yet supported")}return a.functions[e]()};a.functions={17:s,18:o,19:c};function s(){return n.createHash("sha1")}function o(){return n.createHash("sha256")}function c(){return n.createHash("sha512")}}).call(this,e("buffer").Buffer)},{buffer:46,multihashes:100,webcrypto:139}],102:[function(e,t,r){t.exports={"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}},{}],103:[function(e,t,r){var i=e("asn1.js");var n=i.define("RSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())});r.RSAPrivateKey=n;var a=i.define("RSAPublicKey",function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())});r.RSAPublicKey=a;var f=i.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(s),this.key("subjectPublicKey").bitstr())});r.PublicKey=f;var s=i.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())});var o=i.define("PrivateKeyInfo",function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(s),this.key("subjectPrivateKey").octstr())});r.PrivateKey=o;var c=i.define("EncryptedPrivateKeyInfo",function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())});r.EncryptedPrivateKey=c;var h=i.define("DSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())});r.DSAPrivateKey=h;r.DSAparam=i.define("DSAparam",function(){this.int()});var d=i.define("ECPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(u),this.key("publicKey").optional().explicit(1).bitstr())});r.ECPrivateKey=d;var u=i.define("ECParameters",function(){this.choice({namedCurve:this.objid()})});r.signature=i.define("signature",function(){this.seq().obj(this.key("r").int(),this.key("s").int())})},{"asn1.js":1}],104:[function(e,t,r){(function(r){var i=/Proc-Type: 4,ENCRYPTED\r?\nDEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)\r?\n\r?\n([0-9A-z\n\r\+\/\=]+)\r?\n/m;var n=/^-----BEGIN (.*) KEY-----\r?\n/m;var a=/^-----BEGIN (.*) KEY-----\r?\n([0-9A-z\n\r\+\/\=]+)\r?\n-----END \1 KEY-----$/m;var f=e("evp_bytestokey");var s=e("browserify-aes");t.exports=function(e,t){var o=e.toString();var c=o.match(i);var h;if(!c){var d=o.match(a);h=new r(d[2].replace(/\r?\n/g,""),"base64")}else{var u="aes"+c[1];var l=new r(c[2],"hex");var p=new r(c[3].replace(/\r?\n/g,""),"base64");var b=f(t,l.slice(0,8),parseInt(c[1],10)).key;var v=[];var y=s.createDecipheriv(u,b,l);v.push(y.update(p));v.push(y.final());h=r.concat(v)}var g=o.match(n)[1]+" KEY";return{tag:g,data:h}}}).call(this,e("buffer").Buffer)},{"browserify-aes":22,buffer:46,evp_bytestokey:83}],105:[function(e,t,r){(function(r){var i=e("./asn1");var n=e("./aesid.json");var a=e("./fixProc");var f=e("browserify-aes");var s=e("pbkdf2");t.exports=o;function o(e){var t;if(typeof e==="object"&&!r.isBuffer(e)){t=e.passphrase;e=e.key}if(typeof e==="string"){e=new r(e)}var n=a(e,t);var f=n.tag;var s=n.data;var o,h;switch(f){case"PUBLIC KEY":h=i.PublicKey.decode(s,"der");o=h.algorithm.algorithm.join(".");switch(o){case"1.2.840.113549.1.1.1":return i.RSAPublicKey.decode(h.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":h.subjectPrivateKey=h.subjectPublicKey;return{type:"ec",data:h};case"1.2.840.10040.4.1":h.algorithm.params.pub_key=i.DSAparam.decode(h.subjectPublicKey.data,"der");return{type:"dsa",data:h.algorithm.params};default:throw new Error("unknown key id "+o)}throw new Error("unknown key type "+f);case"ENCRYPTED PRIVATE KEY":s=i.EncryptedPrivateKey.decode(s,"der");s=c(s,t);case"PRIVATE KEY":h=i.PrivateKey.decode(s,"der");o=h.algorithm.algorithm.join(".");switch(o){case"1.2.840.113549.1.1.1":return i.RSAPrivateKey.decode(h.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:h.algorithm.curve,privateKey:i.ECPrivateKey.decode(h.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":h.algorithm.params.priv_key=i.DSAparam.decode(h.subjectPrivateKey,"der");return{type:"dsa",params:h.algorithm.params};default:throw new Error("unknown key id "+o)}throw new Error("unknown key type "+f);case"RSA PUBLIC KEY":return i.RSAPublicKey.decode(s,"der");case"RSA PRIVATE KEY":return i.RSAPrivateKey.decode(s,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:i.DSAPrivateKey.decode(s,"der")};case"EC PRIVATE KEY":s=i.ECPrivateKey.decode(s,"der");return{curve:s.parameters.value,privateKey:s.privateKey};default:throw new Error("unknown key type "+f)}}o.signature=i.signature;function c(e,t){var i=e.algorithm.decrypt.kde.kdeparams.salt;var a=parseInt(e.algorithm.decrypt.kde.kdeparams.iters.toString(),10);var o=n[e.algorithm.decrypt.cipher.algo.join(".")];var c=e.algorithm.decrypt.cipher.iv;var h=e.subjectPrivateKey;var d=parseInt(o.split("-")[1],10)/8;var u=s.pbkdf2Sync(t,i,a,d);var l=f.createDecipheriv(o,u,c);var p=[];p.push(l.update(h));p.push(l.final());return r.concat(p)}}).call(this,e("buffer").Buffer)},{"./aesid.json":102,"./asn1":103,"./fixProc":104,"browserify-aes":22,buffer:46,pbkdf2:106}],106:[function(e,t,r){(function(t){var i=e("create-hmac");var n=Math.pow(2,30)-1;r.pbkdf2=a;function a(e,t,r,i,n,a){if(typeof n==="function"){a=n;n=undefined}if(typeof a!=="function"){throw new Error("No callback provided to pbkdf2")}var s=f(e,t,r,i,n);setTimeout(function(){a(undefined,s)})}r.pbkdf2Sync=f;function f(e,r,a,f,s){if(typeof a!=="number"){throw new TypeError("Iterations not a number")}if(a<0){throw new TypeError("Bad iterations")}if(typeof f!=="number"){throw new TypeError("Key length not a number")}if(f<0||f>n){throw new TypeError("Bad key length")}s=s||"sha1";if(!t.isBuffer(e))e=new t(e,"binary");if(!t.isBuffer(r))r=new t(r,"binary");var o;var c=1;var h=new t(f);var d=new t(r.length+4);r.copy(d,0,0,r.length);var u;var l;for(var p=1;p<=c;p++){d.writeUInt32BE(p,r.length);var b=i(s,e).update(d).digest();if(!o){o=b.length;l=new t(o);c=Math.ceil(f/o);u=f-(c-1)*o}b.copy(l,0,0,o);for(var v=1;v1){for(var r=1;ru||new f(t).cmp(o.modulus)>=0){throw new Error("decryption error")}var l;if(n){l=c(new f(t),o)}else{l=s(t,o)}var p=new r(u-l.length);p.fill(0);l=r.concat([p,l],u);if(a===4){return h(o,l)}else if(a===1){return d(o,l,n)}else if(a===3){return l}else{throw new Error("unknown padding")}};function h(e,t){var i=e.modulus;var f=e.modulus.byteLength();var s=t.length;var c=o("sha1").update(new r("")).digest();var h=c.length;var d=2*h;if(t[0]!==0){throw new Error("decryption error")}var l=t.slice(1,h+1);var p=t.slice(h+1);var b=a(l,n(p,h));var v=a(p,n(b,f-h-1));if(u(c,v.slice(0,h))){throw new Error("decryption error")}var y=h;while(v[y]===0){y++}if(v[y++]!==1){throw new Error("decryption error")}return v.slice(y)}function d(e,t,r){var i=t.slice(0,2);var n=2;var a=0;while(t[n++]!==0){if(n>=t.length){a++;break}}var f=t.slice(2,n-1);var s=t.slice(n-1,n);if(i.toString("hex")!=="0002"&&!r||i.toString("hex")!=="0001"&&r){a++}if(f.length<8){a++}if(a){throw new Error("decryption error")}return t.slice(n)}function u(e,t){e=new r(e);t=new r(t);var i=0;var n=e.length;if(e.length!==t.length){i++;n=Math.min(e.length,t.length)}var a=-1;while(++a=0){throw new Error("data too long for modulus")}}else{throw new Error("unknown padding")}if(r){return h(f,a)}else{return c(f,a)}};function u(e,t){var i=e.modulus.byteLength();var c=t.length;var h=a("sha1").update(new r("")).digest();var d=h.length;var u=2*d;if(c>i-u-2){throw new Error("message too long")}var l=new r(i-c-u-2);l.fill(0);var p=i-d-1;var b=n(d);var v=s(r.concat([h,l,new r([1]),t],p),f(b,p));var y=s(b,f(v,d));return new o(r.concat([new r([0]),y,v],i))}function l(e,t,i){var n=t.length;var a=e.modulus.byteLength();if(n>a-11){throw new Error("message too long")}var f;if(i){f=new r(a-n-3);f.fill(255)}else{f=p(a-n-3)}return new o(r.concat([new r([0,i?1:2]),f,new r([0]),t],a))}function p(e,t){var i=new r(e);var a=0;var f=n(e*2);var s=0;var o;while(a0){if(t.ended&&!n){var f=new Error("stream.push() after EOF");e.emit("error",f)}else if(t.endEmitted&&n){var f=new Error("stream.unshift() after end event");e.emit("error",f)}else{if(t.decoder&&!n&&!i)r=t.decoder.write(r);if(!n)t.reading=false;if(t.flowing&&t.length===0&&!t.sync){e.emit("data",r);e.read(0)}else{t.length+=t.objectMode?1:r.length;if(n)t.buffer.unshift(r);else t.buffer.push(r);if(t.needReadable)S(e)}B(e,t)}}else if(!n){t.reading=false}return v(t)}function v(e){return!e.ended&&(e.needReadable||e.length=y){e=y}else{e--;e|=e>>>1;e|=e>>>2;e|=e>>>4;e|=e>>>8;e|=e>>>16;e++}return e}function m(e,t){if(t.length===0&&t.ended)return 0;if(t.objectMode)return e===0?0:1;if(e===null||isNaN(e)){if(t.flowing&&t.buffer.length)return t.buffer[0].length;else return t.length}if(e<=0)return 0;if(e>t.highWaterMark)t.highWaterMark=g(e);if(e>t.length){if(!t.ended){t.needReadable=true;return 0}else{return t.length}}return e}p.prototype.read=function(e){d("read",e);var t=this._readableState;var r=e;if(typeof e!=="number"||e>0)t.emittedReadable=false;if(e===0&&t.needReadable&&(t.length>=t.highWaterMark||t.ended)){d("read: emitReadable",t.length,t.ended);if(t.length===0&&t.ended)M(this);else S(this);return null}e=m(e,t);if(e===0&&t.ended){if(t.length===0)M(this);return null}var i=t.needReadable;d("need readable",i);if(t.length===0||t.length-e0)n=C(e,t);else n=null;if(n===null){t.needReadable=true;e=0}t.length-=e;if(t.length===0&&!t.ended)t.needReadable=true;if(r!==e&&t.ended&&t.length===0)M(this);if(n!==null)this.emit("data",n);return n};function w(e,t){var r=null;if(!a.isBuffer(t)&&typeof t!=="string"&&t!==null&&t!==undefined&&!e.objectMode){r=new TypeError("Invalid non-string/buffer chunk")}return r}function _(e,t){if(t.ended)return;if(t.decoder){var r=t.decoder.end();if(r&&r.length){t.buffer.push(r);t.length+=t.objectMode?1:r.length}}t.ended=true;S(e)}function S(e){var t=e._readableState;t.needReadable=false;if(!t.emittedReadable){d("emitReadable",t.flowing);t.emittedReadable=true;if(t.sync)i(E,e);else E(e)}}function E(e){d("emit readable");e.emit("readable");T(e)}function B(e,t){if(!t.readingMore){t.readingMore=true;i(A,e,t)}}function A(e,t){var r=t.length;while(!t.reading&&!t.flowing&&!t.ended&&t.length=i){if(n)s=r.join("");else if(r.length===1)s=r[0];else s=a.concat(r,i);r.length=0}else{if(e0)throw new Error("endReadable called on non-empty stream");if(!t.endEmitted){t.ended=true;i(P,t,e)}}function P(e,t){if(!e.endEmitted&&e.length===0){e.endEmitted=true;t.readable=false;t.emit("end")}}function D(e,t){for(var r=0,i=e.length;r-1))throw new TypeError("Unknown encoding: "+e);this._writableState.defaultEncoding=e};function p(e,t,r){if(!e.objectMode&&e.decodeStrings!==false&&typeof t==="string"){t=new n(t,r)}return t}function b(e,t,r,i,a){r=p(t,r,i);if(n.isBuffer(r))i="buffer";var f=t.objectMode?1:r.length;t.length+=f;var s=t.length>>5]|=e[r]<<24-i%32}return t}function c(e){var t=[];for(var r=0;r>>5]>>>24-r%32&255)}return t}function h(e,t,o){for(var c=0;c<16;c++){var h=o+c;var y=t[h];t[h]=(y<<8|y>>>24)&16711935|(y<<24|y>>>8)&4278255360}var g,m,w,_,S;var E,B,A,I,k;E=g=e[0];B=m=e[1];A=w=e[2];I=_=e[3];k=S=e[4];var x;for(c=0;c<80;c+=1){x=g+t[o+r[c]]|0;if(c<16){x+=d(m,w,_)+f[0]}else if(c<32){x+=u(m,w,_)+f[1]}else if(c<48){x+=l(m,w,_)+f[2]}else if(c<64){x+=p(m,w,_)+f[3]}else{x+=b(m,w,_)+f[4]}x=x|0;x=v(x,n[c]);x=x+S|0;g=S;S=_;_=v(w,10);w=m;m=x;x=E+t[o+i[c]]|0;if(c<16){x+=b(B,A,I)+s[0]}else if(c<32){x+=p(B,A,I)+s[1]}else if(c<48){x+=l(B,A,I)+s[2]}else if(c<64){x+=u(B,A,I)+s[3]}else{x+=d(B,A,I)+s[4]}x=x|0;x=v(x,a[c]);x=x+k|0;E=k;k=I;I=v(A,10);A=B;B=x}x=e[1]+w+I|0;e[1]=e[2]+_+k|0;e[2]=e[3]+S+E|0;e[3]=e[4]+g+B|0;e[4]=e[0]+m+A|0;e[0]=x}function d(e,t,r){return e^t^r}function u(e,t,r){return e&t|~e&r}function l(e,t,r){return(e|~t)^r}function p(e,t,r){return e&r|t&~r}function b(e,t,r){return e^(t|~r)}function v(e,t){return e<>>32-t}function y(t){var r=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof t==="string"){t=new e(t,"utf8")}var i=o(t);var n=t.length*8;var a=t.length*8;i[n>>>5]|=128<<24-n%32;i[(n+64>>>9<<4)+14]=(a<<8|a>>>24)&16711935|(a<<24|a>>>8)&4278255360;for(var f=0;f>>24)&16711935|(s<<24|s>>>8)&4278255360}var d=c(r);return new e(d)}t.exports=y}).call(this,e("buffer").Buffer)},{buffer:46}],127:[function(e,t,r){(function(e){function r(t,r){this._block=new e(t);this._finalSize=r;this._blockSize=t;this._len=0;this._s=0}r.prototype.update=function(t,r){if(typeof t==="string"){r=r||"utf8";t=new e(t,r)}var i=this._len+=t.length;var n=this._s||0;var a=0;var f=this._block;while(n=this._finalSize*8){this._update(this._block);this._block.fill(0)}this._block.writeInt32BE(t,this._blockSize-4);var r=this._update(this._block)||this._hash();return e?r.toString(e):r};r.prototype._update=function(){throw new Error("_update must be implemented by subclass")};t.exports=r}).call(this,e("buffer").Buffer)},{buffer:46}],128:[function(e,t,r){var r=t.exports=function i(e){e=e.toLowerCase();var t=r[e];if(!t)throw new Error(e+" is not supported (we accept pull requests)");return new t};r.sha=e("./sha");r.sha1=e("./sha1");r.sha224=e("./sha224");r.sha256=e("./sha256");r.sha384=e("./sha384");r.sha512=e("./sha512")},{"./sha":129,"./sha1":130,"./sha224":131,"./sha256":132,"./sha384":133,"./sha512":134}],129:[function(e,t,r){(function(r){var i=e("inherits");var n=e("./hash");var a=new Array(80);function f(){this.init();this._w=a;n.call(this,64,56)}i(f,n);f.prototype.init=function(){this._a=1732584193|0;this._b=4023233417|0;this._c=2562383102|0;this._d=271733878|0;this._e=3285377520|0;return this};function s(e,t){return e<>>32-t}f.prototype._update=function(e){var t=this._w;var r=this._a;var i=this._b;var n=this._c;var a=this._d;var f=this._e;var o=0;var c;function h(){return t[o-3]^t[o-8]^t[o-14]^t[o-16]}function d(e,h){t[o]=e;var d=s(r,5)+h+f+e+c;f=a;a=n;n=s(i,30);i=r;r=d;o++}c=1518500249;while(o<16)d(e.readInt32BE(o*4),i&n|~i&a);while(o<20)d(h(),i&n|~i&a);c=1859775393;while(o<40)d(h(),i^n^a);c=-1894007588;while(o<60)d(h(),i&n|i&a|n&a);c=-899497514;while(o<80)d(h(),i^n^a);this._a=r+this._a|0;this._b=i+this._b|0;this._c=n+this._c|0;this._d=a+this._d|0;this._e=f+this._e|0};f.prototype._hash=function(){var e=new r(20);e.writeInt32BE(this._a|0,0);e.writeInt32BE(this._b|0,4);e.writeInt32BE(this._c|0,8);e.writeInt32BE(this._d|0,12);e.writeInt32BE(this._e|0,16);return e};t.exports=f}).call(this,e("buffer").Buffer)},{"./hash":127,buffer:46,inherits:92}],130:[function(e,t,r){(function(r){var i=e("inherits");var n=e("./hash");var a=new Array(80);function f(){this.init();this._w=a;n.call(this,64,56)}i(f,n);f.prototype.init=function(){this._a=1732584193|0;this._b=4023233417|0;this._c=2562383102|0;this._d=271733878|0;this._e=3285377520|0;return this};function s(e,t){return e<>>32-t}f.prototype._update=function(e){var t=this._w;var r=this._a;var i=this._b;var n=this._c;var a=this._d;var f=this._e;var o=0;var c;function h(){return s(t[o-3]^t[o-8]^t[o-14]^t[o-16],1)}function d(e,h){t[o]=e;var d=s(r,5)+h+f+e+c;f=a;a=n;n=s(i,30);i=r;r=d;o++}c=1518500249;while(o<16)d(e.readInt32BE(o*4),i&n|~i&a);while(o<20)d(h(),i&n|~i&a);c=1859775393;while(o<40)d(h(),i^n^a);c=-1894007588;while(o<60)d(h(),i&n|i&a|n&a);c=-899497514;while(o<80)d(h(),i^n^a);this._a=r+this._a|0;this._b=i+this._b|0;this._c=n+this._c|0;this._d=a+this._d|0;this._e=f+this._e|0};f.prototype._hash=function(){var e=new r(20);e.writeInt32BE(this._a|0,0);e.writeInt32BE(this._b|0,4);e.writeInt32BE(this._c|0,8);e.writeInt32BE(this._d|0,12);e.writeInt32BE(this._e|0,16);return e};t.exports=f}).call(this,e("buffer").Buffer)},{"./hash":127,buffer:46,inherits:92}],131:[function(e,t,r){(function(r){var i=e("inherits");var n=e("./sha256");var a=e("./hash");var f=new Array(64);function s(){this.init();this._w=f;a.call(this,64,56)}i(s,n);s.prototype.init=function(){this._a=3238371032|0;this._b=914150663|0;this._c=812702999|0;this._d=4144912697|0;this._e=4290775857|0;this._f=1750603025|0;this._g=1694076839|0;this._h=3204075428|0;return this};s.prototype._hash=function(){var e=new r(28);e.writeInt32BE(this._a,0);e.writeInt32BE(this._b,4);e.writeInt32BE(this._c,8);e.writeInt32BE(this._d,12);e.writeInt32BE(this._e,16);e.writeInt32BE(this._f,20);e.writeInt32BE(this._g,24);return e};t.exports=s}).call(this,e("buffer").Buffer)},{"./hash":127,"./sha256":132,buffer:46,inherits:92}],132:[function(e,t,r){(function(r){var i=e("inherits");var n=e("./hash");var a=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];var f=new Array(64);function s(){this.init();this._w=f;n.call(this,64,56)}i(s,n);s.prototype.init=function(){this._a=1779033703|0;this._b=3144134277|0;this._c=1013904242|0;this._d=2773480762|0;this._e=1359893119|0;this._f=2600822924|0;this._g=528734635|0;this._h=1541459225|0;return this};function o(e,t,r){return r^e&(t^r)}function c(e,t,r){return e&t|r&(e|t)}function h(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function d(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function u(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}function l(e){return(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10}s.prototype._update=function(e){var t=this._w;var r=this._a|0;var i=this._b|0;var n=this._c|0;var f=this._d|0;var s=this._e|0;var p=this._f|0;var b=this._g|0;var v=this._h|0;var y=0;function g(){return l(t[y-2])+t[y-7]+u(t[y-15])+t[y-16]}function m(e){t[y]=e;var u=v+d(s)+o(s,p,b)+a[y]+e;var l=h(r)+c(r,i,n);v=b;b=p;p=s;s=f+u;f=n;n=i;i=r;r=u+l;y++}while(y<16)m(e.readInt32BE(y*4));while(y<64)m(g());this._a=r+this._a|0;this._b=i+this._b|0;this._c=n+this._c|0;this._d=f+this._d|0;this._e=s+this._e|0;this._f=p+this._f|0;this._g=b+this._g|0;this._h=v+this._h|0};s.prototype._hash=function(){var e=new r(32);e.writeInt32BE(this._a,0);e.writeInt32BE(this._b,4);e.writeInt32BE(this._c,8);e.writeInt32BE(this._d,12);e.writeInt32BE(this._e,16);e.writeInt32BE(this._f,20);e.writeInt32BE(this._g,24);e.writeInt32BE(this._h,28);return e};t.exports=s}).call(this,e("buffer").Buffer)},{"./hash":127,buffer:46,inherits:92}],133:[function(e,t,r){(function(r){var i=e("inherits");var n=e("./sha512");var a=e("./hash");var f=new Array(160);function s(){this.init();this._w=f;a.call(this,128,112)}i(s,n);s.prototype.init=function(){this._a=3418070365|0;this._b=1654270250|0;this._c=2438529370|0;this._d=355462360|0;this._e=1731405415|0;this._f=2394180231|0;this._g=3675008525|0;this._h=1203062813|0;this._al=3238371032|0;this._bl=914150663|0;this._cl=812702999|0;this._dl=4144912697|0;this._el=4290775857|0;this._fl=1750603025|0;this._gl=1694076839|0;this._hl=3204075428|0;return this};s.prototype._hash=function(){var e=new r(48);function t(t,r,i){e.writeInt32BE(t,i);e.writeInt32BE(r,i+4)}t(this._a,this._al,0);t(this._b,this._bl,8);t(this._c,this._cl,16);t(this._d,this._dl,24);t(this._e,this._el,32);t(this._f,this._fl,40);return e};t.exports=s}).call(this,e("buffer").Buffer)},{"./hash":127,"./sha512":134,buffer:46,inherits:92}],134:[function(e,t,r){(function(r){var i=e("inherits");var n=e("./hash");var a=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];var f=new Array(160);function s(){this.init();this._w=f;n.call(this,128,112)}i(s,n);s.prototype.init=function(){this._a=1779033703|0;this._b=3144134277|0;this._c=1013904242|0;this._d=2773480762|0;this._e=1359893119|0;this._f=2600822924|0;this._g=528734635|0;this._h=1541459225|0;this._al=4089235720|0;this._bl=2227873595|0;this._cl=4271175723|0;this._dl=1595750129|0;this._el=2917565137|0;this._fl=725511199|0;this._gl=4215389547|0;this._hl=327033209|0;return this};function o(e,t,r){return r^e&(t^r)}function c(e,t,r){return e&t|r&(e|t)}function h(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function d(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function u(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function l(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function p(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function b(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}s.prototype._update=function(e){var t=this._w;var r=this._a|0;var i=this._b|0;var n=this._c|0;var f=this._d|0;var s=this._e|0;var v=this._f|0;var y=this._g|0;var g=this._h|0;var m=this._al|0;var w=this._bl|0;var _=this._cl|0;var S=this._dl|0;var E=this._el|0;var B=this._fl|0;var A=this._gl|0;var I=this._hl|0;var k=0;var x=0;var R,T;function C(){var e=t[x-15*2];var r=t[x-15*2+1];var i=u(e,r);var n=l(r,e);e=t[x-2*2];r=t[x-2*2+1];var a=p(e,r);var f=b(r,e);var s=t[x-7*2];var o=t[x-7*2+1];var c=t[x-16*2];var h=t[x-16*2+1];T=n+o;R=i+s+(T>>>0>>0?1:0);T=T+f;R=R+a+(T>>>0>>0?1:0);T=T+h;R=R+c+(T>>>0>>0?1:0)}function M(){t[x]=R;t[x+1]=T;var e=c(r,i,n);var u=c(m,w,_);var l=h(r,m);var p=h(m,r);var b=d(s,E);var C=d(E,s);var M=a[x];var P=a[x+1];var D=o(s,v,y);var L=o(E,B,A);var j=I+C;var q=g+b+(j>>>0>>0?1:0);j=j+L;q=q+D+(j>>>0>>0?1:0);j=j+P;q=q+M+(j>>>0

>>0?1:0);j=j+T;q=q+R+(j>>>0>>0?1:0);var N=p+u;var O=l+e+(N>>>0

>>0?1:0);g=y;I=A;y=v;A=B;v=s;B=E;E=S+j|0;s=f+q+(E>>>0>>0?1:0)|0;f=n;S=_;n=i;_=w;i=r;w=m;m=j+N|0;r=q+O+(m>>>0>>0?1:0)|0;k++;x+=2}while(k<16){R=e.readInt32BE(x*4);T=e.readInt32BE(x*4+4);M()}while(k<80){C();M()}this._al=this._al+m|0;this._bl=this._bl+w|0;this._cl=this._cl+_|0;this._dl=this._dl+S|0;this._el=this._el+E|0;this._fl=this._fl+B|0;this._gl=this._gl+A|0;this._hl=this._hl+I|0;this._a=this._a+r+(this._al>>>0>>0?1:0)|0;this._b=this._b+i+(this._bl>>>0>>0?1:0)|0;this._c=this._c+n+(this._cl>>>0<_>>>0?1:0)|0;this._d=this._d+f+(this._dl>>>0>>0?1:0)|0;this._e=this._e+s+(this._el>>>0>>0?1:0)|0;this._f=this._f+v+(this._fl>>>0>>0?1:0)|0;this._g=this._g+y+(this._gl>>>0>>0?1:0)|0;this._h=this._h+g+(this._hl>>>0>>0?1:0)|0};s.prototype._hash=function(){var e=new r(64);function t(t,r,i){e.writeInt32BE(t,i);e.writeInt32BE(r,i+4)}t(this._a,this._al,0);t(this._b,this._bl,8);t(this._c,this._cl,16);t(this._d,this._dl,24);t(this._e,this._el,32);t(this._f,this._fl,40);t(this._g,this._gl,48);t(this._h,this._hl,56);return e};t.exports=s}).call(this,e("buffer").Buffer)},{"./hash":127,buffer:46,inherits:92}],135:[function(e,t,r){t.exports=a;var i=e("events").EventEmitter;var n=e("inherits");n(a,i);a.Readable=e("readable-stream/readable.js");a.Writable=e("readable-stream/writable.js");a.Duplex=e("readable-stream/duplex.js");a.Transform=e("readable-stream/transform.js");a.PassThrough=e("readable-stream/passthrough.js");a.Stream=a;function a(){i.call(this)}a.prototype.pipe=function(e,t){var r=this;function n(t){if(e.writable){if(false===e.write(t)&&r.pause){r.pause()}}}r.on("data",n);function a(){if(r.readable&&r.resume){r.resume()}}e.on("drain",a);if(!e._isStdio&&(!t||t.end!==false)){r.on("end",s);r.on("close",o)}var f=false;function s(){if(f)return;f=true;e.end()}function o(){if(f)return;f=true;if(typeof e.destroy==="function")e.destroy()}function c(e){h();if(i.listenerCount(this,"error")===0){throw e}}r.on("error",c);e.on("error",c);function h(){r.removeListener("data",n);e.removeListener("drain",a);r.removeListener("end",s);r.removeListener("close",o);r.removeListener("error",c);e.removeListener("error",c);r.removeListener("end",h);r.removeListener("close",h);e.removeListener("close",h)}r.on("end",h);r.on("close",h);e.on("close",h);e.emit("pipe",r);return e}},{events:82,inherits:92,"readable-stream/duplex.js":116,"readable-stream/passthrough.js":122,"readable-stream/readable.js":123,"readable-stream/transform.js":124,"readable-stream/writable.js":125}],136:[function(e,t,r){var i=e("buffer").Buffer;var 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 true;default:return false}};function a(e){if(e&&!n(e)){throw new Error("Unknown encoding: "+e)}}var f=r.StringDecoder=function(e){this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,"");a(e);switch(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=c;break;default:this.write=s;return}this.charBuffer=new i(6);this.charReceived=0;this.charLength=0};f.prototype.write=function(e){var t="";while(this.charLength){var r=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;e.copy(this.charBuffer,this.charReceived,0,r);this.charReceived+=r;if(this.charReceived=55296&&i<=56319){this.charLength+=this.surrogateSize;t="";continue}this.charReceived=this.charLength=0;if(e.length===0){return t}break}this.detectIncompleteChar(e);var n=e.length;if(this.charLength){e.copy(this.charBuffer,0,e.length-this.charReceived,n);n-=this.charReceived}t+=e.toString(this.encoding,0,n);var n=t.length-1;var i=t.charCodeAt(n);if(i>=55296&&i<=56319){var a=this.surrogateSize;this.charLength+=a;this.charReceived+=a;this.charBuffer.copy(this.charBuffer,a,0,a);e.copy(this.charBuffer,0,0,a);return t.substring(0,n)}return t};f.prototype.detectIncompleteChar=function(e){var t=e.length>=3?3:e.length;for(;t>0;t--){var r=e[e.length-t];if(t==1&&r>>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};f.prototype.end=function(e){var t="";if(e&&e.length)t=this.write(e);if(this.charReceived){var r=this.charReceived;var i=this.charBuffer;var n=this.encoding;t+=i.slice(0,r).toString(n)}return t};function s(e){return e.toString(this.encoding)}function o(e){this.charReceived=e.length%2;this.charLength=this.charReceived?2:0}function c(e){this.charReceived=e.length%3;this.charLength=this.charReceived?3:0}},{buffer:46}],137:[function(e,t,r){(function(e){t.exports=r;function r(e,t){if(i("noDeprecation")){return e}var r=false;function n(){if(!r){if(i("throwDeprecation")){throw new Error(t)}else if(i("traceDeprecation")){console.trace(t)}else{console.warn(t)}r=true}return e.apply(this,arguments)}return n}function i(t){try{if(!e.localStorage)return false}catch(r){return false}var i=e.localStorage[t];if(null==i)return false;return String(i).toLowerCase()==="true"}}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],138:[function(require,module,exports){var indexOf=require("indexof");var Object_keys=function(e){if(Object.keys)return Object.keys(e);else{var t=[];for(var r in e)t.push(r);return t}};var forEach=function(e,t){if(e.forEach)return e.forEach(t);else for(var r=0;r