0?P.isub(this.p):P.strip!==void 0?P.strip():P._strip(),P},I.prototype.split=function(S,M){S.iushrn(this.n,0,M)},I.prototype.imulK=function(S){return S.imul(this.k)},r(L,I),L.prototype.split=function(S,M){for(var P=Math.min(S.length,9),u=0;u>>22,b=y}b>>>=22,S.words[u-10]=b,b===0&&S.length>10?S.length-=10:S.length-=9},L.prototype.imulK=function(S){S.words[S.length]=0,S.words[S.length+1]=0,S.length+=2;for(var M=0,P=0;P>>=26,S.words[P]=b,M=u}return M!==0&&(S.words[S.length++]=M),S},t._prime=function(S){if(A[S])return A[S];var M;if(S==="k256")M=new L;else if(S==="p224")M=new j;else if(S==="p192")M=new N;else{if(S!=="p25519")throw new Error("Unknown prime "+S);M=new D}return A[S]=M,M},U.prototype._verify1=function(S){a(S.negative===0,"red works only with positives"),a(S.red,"red works only with red numbers")},U.prototype._verify2=function(S,M){a((S.negative|M.negative)==0,"red works only with positives"),a(S.red&&S.red===M.red,"red works only with red numbers")},U.prototype.imod=function(S){return this.prime?this.prime.ireduce(S)._forceRed(this):S.umod(this.m)._forceRed(this)},U.prototype.neg=function(S){return S.isZero()?S.clone():this.m.sub(S)._forceRed(this)},U.prototype.add=function(S,M){this._verify2(S,M);var P=S.add(M);return P.cmp(this.m)>=0&&P.isub(this.m),P._forceRed(this)},U.prototype.iadd=function(S,M){this._verify2(S,M);var P=S.iadd(M);return P.cmp(this.m)>=0&&P.isub(this.m),P},U.prototype.sub=function(S,M){this._verify2(S,M);var P=S.sub(M);return P.cmpn(0)<0&&P.iadd(this.m),P._forceRed(this)},U.prototype.isub=function(S,M){this._verify2(S,M);var P=S.isub(M);return P.cmpn(0)<0&&P.iadd(this.m),P},U.prototype.shl=function(S,M){return this._verify1(S),this.imod(S.ushln(M))},U.prototype.imul=function(S,M){return this._verify2(S,M),this.imod(S.imul(M))},U.prototype.mul=function(S,M){return this._verify2(S,M),this.imod(S.mul(M))},U.prototype.isqr=function(S){return this.imul(S,S.clone())},U.prototype.sqr=function(S){return this.mul(S,S)},U.prototype.sqrt=function(S){if(S.isZero())return S.clone();var M=this.m.andln(3);if(a(M%2==1),M===3){var P=this.m.add(new t(1)).iushrn(2);return this.pow(S,P)}for(var u=this.m.subn(1),b=0;!u.isZero()&&u.andln(1)===0;)b++,u.iushrn(1);a(!u.isZero());var y=new t(1).toRed(this),g=y.redNeg(),w=this.m.subn(1).iushrn(1),C=this.m.bitLength();for(C=new t(2*C*C).toRed(this);this.pow(C,w).cmp(g)!==0;)C.redIAdd(g);for(var R=this.pow(C,u),z=this.pow(S,u.addn(1).iushrn(1)),$=this.pow(S,u),q=b;$.cmp(y)!==0;){for(var O=$,H=0;O.cmp(y)!==0;H++)O=O.redSqr();a(H=0;u--){for(var C=M.words[u],R=w-1;R>=0;R--){var z=C>>R&1;b!==P[0]&&(b=this.sqr(b)),z!==0||y!==0?(y<<=1,y|=z,(++g===4||u===0&&R===0)&&(b=this.mul(b,P[y]),g=0,y=0)):g=0}w=26}return b},U.prototype.convertTo=function(S){var M=S.umod(this.m);return M===S?M.clone():M},U.prototype.convertFrom=function(S){var M=S.clone();return M.red=null,M},t.mont=function(S){return new B(S)},r(B,U),B.prototype.convertTo=function(S){return this.imod(S.ushln(this.shift))},B.prototype.convertFrom=function(S){var M=this.imod(S.mul(this.rinv));return M.red=null,M},B.prototype.imul=function(S,M){if(S.isZero()||M.isZero())return S.words[0]=0,S.length=1,S;var P=S.imul(M),u=P.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),b=P.isub(u).iushrn(this.shift),y=b;return b.cmp(this.m)>=0?y=b.isub(this.m):b.cmpn(0)<0&&(y=b.iadd(this.m)),y._forceRed(this)},B.prototype.mul=function(S,M){if(S.isZero()||M.isZero())return new t(0)._forceRed(this);var P=S.mul(M),u=P.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),b=P.isub(u).iushrn(this.shift),y=b;return b.cmp(this.m)>=0?y=b.isub(this.m):b.cmpn(0)<0&&(y=b.iadd(this.m)),y._forceRed(this)},B.prototype.invm=function(S){return this.imod(S._invmp(this.m).mul(this.r2))._forceRed(this)}})(k===void 0||k)},{buffer:188}],185:[function(s,k,_){"use strict";_.byteLength=function(n){var h=l(n),f=h[0],c=h[1];return 3*(f+c)/4-c},_.toByteArray=function(n){var h,f,c=l(n),m=c[0],d=c[1],v=new a(function(I,L,j){return 3*(L+j)/4-j}(0,m,d)),x=0,A=d>0?m-4:m;for(f=0;f>16&255,v[x++]=h>>8&255,v[x++]=255&h;return d===2&&(h=o[n.charCodeAt(f)]<<2|o[n.charCodeAt(f+1)]>>4,v[x++]=255&h),d===1&&(h=o[n.charCodeAt(f)]<<10|o[n.charCodeAt(f+1)]<<4|o[n.charCodeAt(f+2)]>>2,v[x++]=h>>8&255,v[x++]=255&h),v},_.fromByteArray=function(n){for(var h,f=n.length,c=f%3,m=[],d=0,v=f-c;dv?v:d+16383));return c===1?(h=n[f-1],m.push(p[h>>2]+p[h<<4&63]+"==")):c===2&&(h=(n[f-2]<<8)+n[f-1],m.push(p[h>>10]+p[h>>4&63]+p[h<<2&63]+"=")),m.join("")};for(var p=[],o=[],a=typeof Uint8Array<"u"?Uint8Array:Array,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,e=r.length;t0)throw new Error("Invalid string. Length must be a multiple of 4");var f=n.indexOf("=");return f===-1&&(f=h),[f,f===h?0:4-f%4]}function i(n,h,f){for(var c,m,d=[],v=h;v>18&63]+p[m>>12&63]+p[m>>6&63]+p[63&m]);return d.join("")}o[45]=62,o[95]=63},{}],186:[function(s,k,_){"use strict";(function(p,o){function a(u,b){if(!u)throw new Error(b||"Assertion failed")}function r(u,b){u.super_=b;var y=function(){};y.prototype=b.prototype,u.prototype=new y,u.prototype.constructor=u}function t(u,b,y){if(t.isBN(u))return u;this.negative=0,this.words=null,this.length=0,this.red=null,u!==null&&(b!=="le"&&b!=="be"||(y=b,b=10),this._init(u||0,b||10,y||"be"))}var e;typeof p=="object"?p.exports=t:(void 0).BN=t,t.BN=t,t.wordSize=26;try{e=typeof window<"u"&&window.Buffer!==void 0?window.Buffer:s("buffer").Buffer}catch{}function l(u,b){var y=u.charCodeAt(b);return y>=48&&y<=57?y-48:y>=65&&y<=70?y-55:y>=97&&y<=102?y-87:void a(!1,"Invalid character in "+u)}function i(u,b,y){var g=l(u,y);return y-1>=b&&(g|=l(u,y-1)<<4),g}function n(u,b,y,g){for(var w=0,C=0,R=Math.min(u.length,y),z=b;z=49?$-49+10:$>=17?$-17+10:$,a($>=0&&C0?u:b},t.min=function(u,b){return u.cmp(b)<0?u:b},t.prototype._init=function(u,b,y){if(typeof u=="number")return this._initNumber(u,b,y);if(typeof u=="object")return this._initArray(u,b,y);b==="hex"&&(b=16),a(b===(0|b)&&b>=2&&b<=36);var g=0;(u=u.toString().replace(/\s+/g,""))[0]==="-"&&(g++,this.negative=1),g=0;g-=3)C=u[g]|u[g-1]<<8|u[g-2]<<16,this.words[w]|=C<>>26-R&67108863,(R+=24)>=26&&(R-=26,w++);else if(y==="le")for(g=0,w=0;g>>26-R&67108863,(R+=24)>=26&&(R-=26,w++);return this._strip()},t.prototype._parseHex=function(u,b,y){this.length=Math.ceil((u.length-b)/6),this.words=new Array(this.length);for(var g=0;g=b;g-=2)w=i(u,b,g)<=18?(C-=18,R+=1,this.words[R]|=w>>>26):C+=8;else for(g=(u.length-b)%2==0?b+1:b;g=18?(C-=18,R+=1,this.words[R]|=w>>>26):C+=8;this._strip()},t.prototype._parseBase=function(u,b,y){this.words=[0],this.length=1;for(var g=0,w=1;w<=67108863;w*=b)g++;g--,w=w/b|0;for(var C=u.length-y,R=C%g,z=Math.min(C,C-R)+y,$=0,q=y;q1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},t.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{t.prototype[Symbol.for("nodejs.util.inspect.custom")]=f}catch{t.prototype.inspect=f}else t.prototype.inspect=f;function f(){return(this.red?""}var c=["","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"],m=[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],d=[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];t.prototype.toString=function(u,b){var y;if(b=0|b||1,(u=u||10)===16||u==="hex"){y="";for(var g=0,w=0,C=0;C>>24-g&16777215,(g+=2)>=26&&(g-=26,C--),y=w!==0||C!==this.length-1?c[6-z.length]+z+y:z+y}for(w!==0&&(y=w.toString(16)+y);y.length%b!=0;)y="0"+y;return this.negative!==0&&(y="-"+y),y}if(u===(0|u)&&u>=2&&u<=36){var $=m[u],q=d[u];y="";var O=this.clone();for(O.negative=0;!O.isZero();){var H=O.modrn(q).toString(u);y=(O=O.idivn(q)).isZero()?H+y:c[$-H.length]+H+y}for(this.isZero()&&(y="0"+y);y.length%b!=0;)y="0"+y;return this.negative!==0&&(y="-"+y),y}a(!1,"Base should be between 2 and 36")},t.prototype.toNumber=function(){var u=this.words[0];return this.length===2?u+=67108864*this.words[1]:this.length===3&&this.words[2]===1?u+=4503599627370496+67108864*this.words[1]:this.length>2&&a(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-u:u},t.prototype.toJSON=function(){return this.toString(16,2)},e&&(t.prototype.toBuffer=function(u,b){return this.toArrayLike(e,u,b)}),t.prototype.toArray=function(u,b){return this.toArrayLike(Array,u,b)};function v(u,b,y){y.negative=b.negative^u.negative;var g=u.length+b.length|0;y.length=g,g=g-1|0;var w=0|u.words[0],C=0|b.words[0],R=w*C,z=67108863&R,$=R/67108864|0;y.words[0]=z;for(var q=1;q>>26,H=67108863&$,T=Math.min(q,b.length-1),E=Math.max(0,q-u.length+1);E<=T;E++){var F=q-E|0;O+=(R=(w=0|u.words[F])*(C=0|b.words[E])+H)/67108864|0,H=67108863&R}y.words[q]=0|H,$=0|O}return $!==0?y.words[q]=0|$:y.length--,y._strip()}t.prototype.toArrayLike=function(u,b,y){this._strip();var g=this.byteLength(),w=y||Math.max(1,g);a(g<=w,"byte array longer than desired length"),a(w>0,"Requested array length <= 0");var C=function(R,z){return R.allocUnsafe?R.allocUnsafe(z):new R(z)}(u,w);return this["_toArrayLike"+(b==="le"?"LE":"BE")](C,g),C},t.prototype._toArrayLikeLE=function(u,b){for(var y=0,g=0,w=0,C=0;w>8&255),y>16&255),C===6?(y>24&255),g=0,C=0):(g=R>>>24,C+=2)}if(y=0&&(u[y--]=R>>8&255),y>=0&&(u[y--]=R>>16&255),C===6?(y>=0&&(u[y--]=R>>24&255),g=0,C=0):(g=R>>>24,C+=2)}if(y>=0)for(u[y--]=g;y>=0;)u[y--]=0},Math.clz32?t.prototype._countBits=function(u){return 32-Math.clz32(u)}:t.prototype._countBits=function(u){var b=u,y=0;return b>=4096&&(y+=13,b>>>=13),b>=64&&(y+=7,b>>>=7),b>=8&&(y+=4,b>>>=4),b>=2&&(y+=2,b>>>=2),y+b},t.prototype._zeroBits=function(u){if(u===0)return 26;var b=u,y=0;return!(8191&b)&&(y+=13,b>>>=13),!(127&b)&&(y+=7,b>>>=7),!(15&b)&&(y+=4,b>>>=4),!(3&b)&&(y+=2,b>>>=2),!(1&b)&&y++,y},t.prototype.bitLength=function(){var u=this.words[this.length-1],b=this._countBits(u);return 26*(this.length-1)+b},t.prototype.zeroBits=function(){if(this.isZero())return 0;for(var u=0,b=0;bu.length?this.clone().ior(u):u.clone().ior(this)},t.prototype.uor=function(u){return this.length>u.length?this.clone().iuor(u):u.clone().iuor(this)},t.prototype.iuand=function(u){var b;b=this.length>u.length?u:this;for(var y=0;yu.length?this.clone().iand(u):u.clone().iand(this)},t.prototype.uand=function(u){return this.length>u.length?this.clone().iuand(u):u.clone().iuand(this)},t.prototype.iuxor=function(u){var b,y;this.length>u.length?(b=this,y=u):(b=u,y=this);for(var g=0;gu.length?this.clone().ixor(u):u.clone().ixor(this)},t.prototype.uxor=function(u){return this.length>u.length?this.clone().iuxor(u):u.clone().iuxor(this)},t.prototype.inotn=function(u){a(typeof u=="number"&&u>=0);var b=0|Math.ceil(u/26),y=u%26;this._expand(b),y>0&&b--;for(var g=0;g0&&(this.words[g]=~this.words[g]&67108863>>26-y),this._strip()},t.prototype.notn=function(u){return this.clone().inotn(u)},t.prototype.setn=function(u,b){a(typeof u=="number"&&u>=0);var y=u/26|0,g=u%26;return this._expand(y+1),this.words[y]=b?this.words[y]|1<u.length?(y=this,g=u):(y=u,g=this);for(var w=0,C=0;C>>26;for(;w!==0&&C>>26;if(this.length=y.length,w!==0)this.words[this.length]=w,this.length++;else if(y!==this)for(;Cu.length?this.clone().iadd(u):u.clone().iadd(this)},t.prototype.isub=function(u){if(u.negative!==0){u.negative=0;var b=this.iadd(u);return u.negative=1,b._normSign()}if(this.negative!==0)return this.negative=0,this.iadd(u),this.negative=1,this._normSign();var y,g,w=this.cmp(u);if(w===0)return this.negative=0,this.length=1,this.words[0]=0,this;w>0?(y=this,g=u):(y=u,g=this);for(var C=0,R=0;R>26,this.words[R]=67108863&b;for(;C!==0&&R>26,this.words[R]=67108863&b;if(C===0&&R>>13,E=0|R[1],F=8191&E,V=E>>>13,K=0|R[2],X=8191&K,Z=K>>>13,rt=0|R[3],tt=8191&rt,W=rt>>>13,Q=0|R[4],G=8191&Q,et=Q>>>13,nt=0|R[5],it=8191&nt,ot=nt>>>13,ht=0|R[6],ft=8191&ht,pt=ht>>>13,Mt=0|R[7],yt=8191&Mt,wt=Mt>>>13,Vt=0|R[8],Tt=8191&Vt,_t=Vt>>>13,At=0|R[9],gt=8191&At,mt=At>>>13,qt=0|z[0],St=8191&qt,Rt=qt>>>13,ge=0|z[1],Ot=8191&ge,Pt=ge>>>13,oe=0|z[2],Ft=8191&oe,zt=oe>>>13,de=0|z[3],Dt=8191&de,Nt=de>>>13,ce=0|z[4],Lt=8191&ce,It=ce>>>13,ye=0|z[5],Ut=8191&ye,J=ye>>>13,at=0|z[6],lt=8191&at,dt=at>>>13,Kt=0|z[7],vt=8191&Kt,kt=Kt>>>13,Qt=0|z[8],jt=8191&Qt,xt=Qt>>>13,Jt=0|z[9],Wt=8191&Jt,Xt=Jt>>>13;y.negative=u.negative^b.negative,y.length=19;var ee=(q+(g=Math.imul(H,St))|0)+((8191&(w=(w=Math.imul(H,Rt))+Math.imul(T,St)|0))<<13)|0;q=((C=Math.imul(T,Rt))+(w>>>13)|0)+(ee>>>26)|0,ee&=67108863,g=Math.imul(F,St),w=(w=Math.imul(F,Rt))+Math.imul(V,St)|0,C=Math.imul(V,Rt);var ne=(q+(g=g+Math.imul(H,Ot)|0)|0)+((8191&(w=(w=w+Math.imul(H,Pt)|0)+Math.imul(T,Ot)|0))<<13)|0;q=((C=C+Math.imul(T,Pt)|0)+(w>>>13)|0)+(ne>>>26)|0,ne&=67108863,g=Math.imul(X,St),w=(w=Math.imul(X,Rt))+Math.imul(Z,St)|0,C=Math.imul(Z,Rt),g=g+Math.imul(F,Ot)|0,w=(w=w+Math.imul(F,Pt)|0)+Math.imul(V,Ot)|0,C=C+Math.imul(V,Pt)|0;var le=(q+(g=g+Math.imul(H,Ft)|0)|0)+((8191&(w=(w=w+Math.imul(H,zt)|0)+Math.imul(T,Ft)|0))<<13)|0;q=((C=C+Math.imul(T,zt)|0)+(w>>>13)|0)+(le>>>26)|0,le&=67108863,g=Math.imul(tt,St),w=(w=Math.imul(tt,Rt))+Math.imul(W,St)|0,C=Math.imul(W,Rt),g=g+Math.imul(X,Ot)|0,w=(w=w+Math.imul(X,Pt)|0)+Math.imul(Z,Ot)|0,C=C+Math.imul(Z,Pt)|0,g=g+Math.imul(F,Ft)|0,w=(w=w+Math.imul(F,zt)|0)+Math.imul(V,Ft)|0,C=C+Math.imul(V,zt)|0;var fe=(q+(g=g+Math.imul(H,Dt)|0)|0)+((8191&(w=(w=w+Math.imul(H,Nt)|0)+Math.imul(T,Dt)|0))<<13)|0;q=((C=C+Math.imul(T,Nt)|0)+(w>>>13)|0)+(fe>>>26)|0,fe&=67108863,g=Math.imul(G,St),w=(w=Math.imul(G,Rt))+Math.imul(et,St)|0,C=Math.imul(et,Rt),g=g+Math.imul(tt,Ot)|0,w=(w=w+Math.imul(tt,Pt)|0)+Math.imul(W,Ot)|0,C=C+Math.imul(W,Pt)|0,g=g+Math.imul(X,Ft)|0,w=(w=w+Math.imul(X,zt)|0)+Math.imul(Z,Ft)|0,C=C+Math.imul(Z,zt)|0,g=g+Math.imul(F,Dt)|0,w=(w=w+Math.imul(F,Nt)|0)+Math.imul(V,Dt)|0,C=C+Math.imul(V,Nt)|0;var ae=(q+(g=g+Math.imul(H,Lt)|0)|0)+((8191&(w=(w=w+Math.imul(H,It)|0)+Math.imul(T,Lt)|0))<<13)|0;q=((C=C+Math.imul(T,It)|0)+(w>>>13)|0)+(ae>>>26)|0,ae&=67108863,g=Math.imul(it,St),w=(w=Math.imul(it,Rt))+Math.imul(ot,St)|0,C=Math.imul(ot,Rt),g=g+Math.imul(G,Ot)|0,w=(w=w+Math.imul(G,Pt)|0)+Math.imul(et,Ot)|0,C=C+Math.imul(et,Pt)|0,g=g+Math.imul(tt,Ft)|0,w=(w=w+Math.imul(tt,zt)|0)+Math.imul(W,Ft)|0,C=C+Math.imul(W,zt)|0,g=g+Math.imul(X,Dt)|0,w=(w=w+Math.imul(X,Nt)|0)+Math.imul(Z,Dt)|0,C=C+Math.imul(Z,Nt)|0,g=g+Math.imul(F,Lt)|0,w=(w=w+Math.imul(F,It)|0)+Math.imul(V,Lt)|0,C=C+Math.imul(V,It)|0;var he=(q+(g=g+Math.imul(H,Ut)|0)|0)+((8191&(w=(w=w+Math.imul(H,J)|0)+Math.imul(T,Ut)|0))<<13)|0;q=((C=C+Math.imul(T,J)|0)+(w>>>13)|0)+(he>>>26)|0,he&=67108863,g=Math.imul(ft,St),w=(w=Math.imul(ft,Rt))+Math.imul(pt,St)|0,C=Math.imul(pt,Rt),g=g+Math.imul(it,Ot)|0,w=(w=w+Math.imul(it,Pt)|0)+Math.imul(ot,Ot)|0,C=C+Math.imul(ot,Pt)|0,g=g+Math.imul(G,Ft)|0,w=(w=w+Math.imul(G,zt)|0)+Math.imul(et,Ft)|0,C=C+Math.imul(et,zt)|0,g=g+Math.imul(tt,Dt)|0,w=(w=w+Math.imul(tt,Nt)|0)+Math.imul(W,Dt)|0,C=C+Math.imul(W,Nt)|0,g=g+Math.imul(X,Lt)|0,w=(w=w+Math.imul(X,It)|0)+Math.imul(Z,Lt)|0,C=C+Math.imul(Z,It)|0,g=g+Math.imul(F,Ut)|0,w=(w=w+Math.imul(F,J)|0)+Math.imul(V,Ut)|0,C=C+Math.imul(V,J)|0;var Y=(q+(g=g+Math.imul(H,lt)|0)|0)+((8191&(w=(w=w+Math.imul(H,dt)|0)+Math.imul(T,lt)|0))<<13)|0;q=((C=C+Math.imul(T,dt)|0)+(w>>>13)|0)+(Y>>>26)|0,Y&=67108863,g=Math.imul(yt,St),w=(w=Math.imul(yt,Rt))+Math.imul(wt,St)|0,C=Math.imul(wt,Rt),g=g+Math.imul(ft,Ot)|0,w=(w=w+Math.imul(ft,Pt)|0)+Math.imul(pt,Ot)|0,C=C+Math.imul(pt,Pt)|0,g=g+Math.imul(it,Ft)|0,w=(w=w+Math.imul(it,zt)|0)+Math.imul(ot,Ft)|0,C=C+Math.imul(ot,zt)|0,g=g+Math.imul(G,Dt)|0,w=(w=w+Math.imul(G,Nt)|0)+Math.imul(et,Dt)|0,C=C+Math.imul(et,Nt)|0,g=g+Math.imul(tt,Lt)|0,w=(w=w+Math.imul(tt,It)|0)+Math.imul(W,Lt)|0,C=C+Math.imul(W,It)|0,g=g+Math.imul(X,Ut)|0,w=(w=w+Math.imul(X,J)|0)+Math.imul(Z,Ut)|0,C=C+Math.imul(Z,J)|0,g=g+Math.imul(F,lt)|0,w=(w=w+Math.imul(F,dt)|0)+Math.imul(V,lt)|0,C=C+Math.imul(V,dt)|0;var st=(q+(g=g+Math.imul(H,vt)|0)|0)+((8191&(w=(w=w+Math.imul(H,kt)|0)+Math.imul(T,vt)|0))<<13)|0;q=((C=C+Math.imul(T,kt)|0)+(w>>>13)|0)+(st>>>26)|0,st&=67108863,g=Math.imul(Tt,St),w=(w=Math.imul(Tt,Rt))+Math.imul(_t,St)|0,C=Math.imul(_t,Rt),g=g+Math.imul(yt,Ot)|0,w=(w=w+Math.imul(yt,Pt)|0)+Math.imul(wt,Ot)|0,C=C+Math.imul(wt,Pt)|0,g=g+Math.imul(ft,Ft)|0,w=(w=w+Math.imul(ft,zt)|0)+Math.imul(pt,Ft)|0,C=C+Math.imul(pt,zt)|0,g=g+Math.imul(it,Dt)|0,w=(w=w+Math.imul(it,Nt)|0)+Math.imul(ot,Dt)|0,C=C+Math.imul(ot,Nt)|0,g=g+Math.imul(G,Lt)|0,w=(w=w+Math.imul(G,It)|0)+Math.imul(et,Lt)|0,C=C+Math.imul(et,It)|0,g=g+Math.imul(tt,Ut)|0,w=(w=w+Math.imul(tt,J)|0)+Math.imul(W,Ut)|0,C=C+Math.imul(W,J)|0,g=g+Math.imul(X,lt)|0,w=(w=w+Math.imul(X,dt)|0)+Math.imul(Z,lt)|0,C=C+Math.imul(Z,dt)|0,g=g+Math.imul(F,vt)|0,w=(w=w+Math.imul(F,kt)|0)+Math.imul(V,vt)|0,C=C+Math.imul(V,kt)|0;var ut=(q+(g=g+Math.imul(H,jt)|0)|0)+((8191&(w=(w=w+Math.imul(H,xt)|0)+Math.imul(T,jt)|0))<<13)|0;q=((C=C+Math.imul(T,xt)|0)+(w>>>13)|0)+(ut>>>26)|0,ut&=67108863,g=Math.imul(gt,St),w=(w=Math.imul(gt,Rt))+Math.imul(mt,St)|0,C=Math.imul(mt,Rt),g=g+Math.imul(Tt,Ot)|0,w=(w=w+Math.imul(Tt,Pt)|0)+Math.imul(_t,Ot)|0,C=C+Math.imul(_t,Pt)|0,g=g+Math.imul(yt,Ft)|0,w=(w=w+Math.imul(yt,zt)|0)+Math.imul(wt,Ft)|0,C=C+Math.imul(wt,zt)|0,g=g+Math.imul(ft,Dt)|0,w=(w=w+Math.imul(ft,Nt)|0)+Math.imul(pt,Dt)|0,C=C+Math.imul(pt,Nt)|0,g=g+Math.imul(it,Lt)|0,w=(w=w+Math.imul(it,It)|0)+Math.imul(ot,Lt)|0,C=C+Math.imul(ot,It)|0,g=g+Math.imul(G,Ut)|0,w=(w=w+Math.imul(G,J)|0)+Math.imul(et,Ut)|0,C=C+Math.imul(et,J)|0,g=g+Math.imul(tt,lt)|0,w=(w=w+Math.imul(tt,dt)|0)+Math.imul(W,lt)|0,C=C+Math.imul(W,dt)|0,g=g+Math.imul(X,vt)|0,w=(w=w+Math.imul(X,kt)|0)+Math.imul(Z,vt)|0,C=C+Math.imul(Z,kt)|0,g=g+Math.imul(F,jt)|0,w=(w=w+Math.imul(F,xt)|0)+Math.imul(V,jt)|0,C=C+Math.imul(V,xt)|0;var ct=(q+(g=g+Math.imul(H,Wt)|0)|0)+((8191&(w=(w=w+Math.imul(H,Xt)|0)+Math.imul(T,Wt)|0))<<13)|0;q=((C=C+Math.imul(T,Xt)|0)+(w>>>13)|0)+(ct>>>26)|0,ct&=67108863,g=Math.imul(gt,Ot),w=(w=Math.imul(gt,Pt))+Math.imul(mt,Ot)|0,C=Math.imul(mt,Pt),g=g+Math.imul(Tt,Ft)|0,w=(w=w+Math.imul(Tt,zt)|0)+Math.imul(_t,Ft)|0,C=C+Math.imul(_t,zt)|0,g=g+Math.imul(yt,Dt)|0,w=(w=w+Math.imul(yt,Nt)|0)+Math.imul(wt,Dt)|0,C=C+Math.imul(wt,Nt)|0,g=g+Math.imul(ft,Lt)|0,w=(w=w+Math.imul(ft,It)|0)+Math.imul(pt,Lt)|0,C=C+Math.imul(pt,It)|0,g=g+Math.imul(it,Ut)|0,w=(w=w+Math.imul(it,J)|0)+Math.imul(ot,Ut)|0,C=C+Math.imul(ot,J)|0,g=g+Math.imul(G,lt)|0,w=(w=w+Math.imul(G,dt)|0)+Math.imul(et,lt)|0,C=C+Math.imul(et,dt)|0,g=g+Math.imul(tt,vt)|0,w=(w=w+Math.imul(tt,kt)|0)+Math.imul(W,vt)|0,C=C+Math.imul(W,kt)|0,g=g+Math.imul(X,jt)|0,w=(w=w+Math.imul(X,xt)|0)+Math.imul(Z,jt)|0,C=C+Math.imul(Z,xt)|0;var bt=(q+(g=g+Math.imul(F,Wt)|0)|0)+((8191&(w=(w=w+Math.imul(F,Xt)|0)+Math.imul(V,Wt)|0))<<13)|0;q=((C=C+Math.imul(V,Xt)|0)+(w>>>13)|0)+(bt>>>26)|0,bt&=67108863,g=Math.imul(gt,Ft),w=(w=Math.imul(gt,zt))+Math.imul(mt,Ft)|0,C=Math.imul(mt,zt),g=g+Math.imul(Tt,Dt)|0,w=(w=w+Math.imul(Tt,Nt)|0)+Math.imul(_t,Dt)|0,C=C+Math.imul(_t,Nt)|0,g=g+Math.imul(yt,Lt)|0,w=(w=w+Math.imul(yt,It)|0)+Math.imul(wt,Lt)|0,C=C+Math.imul(wt,It)|0,g=g+Math.imul(ft,Ut)|0,w=(w=w+Math.imul(ft,J)|0)+Math.imul(pt,Ut)|0,C=C+Math.imul(pt,J)|0,g=g+Math.imul(it,lt)|0,w=(w=w+Math.imul(it,dt)|0)+Math.imul(ot,lt)|0,C=C+Math.imul(ot,dt)|0,g=g+Math.imul(G,vt)|0,w=(w=w+Math.imul(G,kt)|0)+Math.imul(et,vt)|0,C=C+Math.imul(et,kt)|0,g=g+Math.imul(tt,jt)|0,w=(w=w+Math.imul(tt,xt)|0)+Math.imul(W,jt)|0,C=C+Math.imul(W,xt)|0;var Ct=(q+(g=g+Math.imul(X,Wt)|0)|0)+((8191&(w=(w=w+Math.imul(X,Xt)|0)+Math.imul(Z,Wt)|0))<<13)|0;q=((C=C+Math.imul(Z,Xt)|0)+(w>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,g=Math.imul(gt,Dt),w=(w=Math.imul(gt,Nt))+Math.imul(mt,Dt)|0,C=Math.imul(mt,Nt),g=g+Math.imul(Tt,Lt)|0,w=(w=w+Math.imul(Tt,It)|0)+Math.imul(_t,Lt)|0,C=C+Math.imul(_t,It)|0,g=g+Math.imul(yt,Ut)|0,w=(w=w+Math.imul(yt,J)|0)+Math.imul(wt,Ut)|0,C=C+Math.imul(wt,J)|0,g=g+Math.imul(ft,lt)|0,w=(w=w+Math.imul(ft,dt)|0)+Math.imul(pt,lt)|0,C=C+Math.imul(pt,dt)|0,g=g+Math.imul(it,vt)|0,w=(w=w+Math.imul(it,kt)|0)+Math.imul(ot,vt)|0,C=C+Math.imul(ot,kt)|0,g=g+Math.imul(G,jt)|0,w=(w=w+Math.imul(G,xt)|0)+Math.imul(et,jt)|0,C=C+Math.imul(et,xt)|0;var Et=(q+(g=g+Math.imul(tt,Wt)|0)|0)+((8191&(w=(w=w+Math.imul(tt,Xt)|0)+Math.imul(W,Wt)|0))<<13)|0;q=((C=C+Math.imul(W,Xt)|0)+(w>>>13)|0)+(Et>>>26)|0,Et&=67108863,g=Math.imul(gt,Lt),w=(w=Math.imul(gt,It))+Math.imul(mt,Lt)|0,C=Math.imul(mt,It),g=g+Math.imul(Tt,Ut)|0,w=(w=w+Math.imul(Tt,J)|0)+Math.imul(_t,Ut)|0,C=C+Math.imul(_t,J)|0,g=g+Math.imul(yt,lt)|0,w=(w=w+Math.imul(yt,dt)|0)+Math.imul(wt,lt)|0,C=C+Math.imul(wt,dt)|0,g=g+Math.imul(ft,vt)|0,w=(w=w+Math.imul(ft,kt)|0)+Math.imul(pt,vt)|0,C=C+Math.imul(pt,kt)|0,g=g+Math.imul(it,jt)|0,w=(w=w+Math.imul(it,xt)|0)+Math.imul(ot,jt)|0,C=C+Math.imul(ot,xt)|0;var Zt=(q+(g=g+Math.imul(G,Wt)|0)|0)+((8191&(w=(w=w+Math.imul(G,Xt)|0)+Math.imul(et,Wt)|0))<<13)|0;q=((C=C+Math.imul(et,Xt)|0)+(w>>>13)|0)+(Zt>>>26)|0,Zt&=67108863,g=Math.imul(gt,Ut),w=(w=Math.imul(gt,J))+Math.imul(mt,Ut)|0,C=Math.imul(mt,J),g=g+Math.imul(Tt,lt)|0,w=(w=w+Math.imul(Tt,dt)|0)+Math.imul(_t,lt)|0,C=C+Math.imul(_t,dt)|0,g=g+Math.imul(yt,vt)|0,w=(w=w+Math.imul(yt,kt)|0)+Math.imul(wt,vt)|0,C=C+Math.imul(wt,kt)|0,g=g+Math.imul(ft,jt)|0,w=(w=w+Math.imul(ft,xt)|0)+Math.imul(pt,jt)|0,C=C+Math.imul(pt,xt)|0;var $t=(q+(g=g+Math.imul(it,Wt)|0)|0)+((8191&(w=(w=w+Math.imul(it,Xt)|0)+Math.imul(ot,Wt)|0))<<13)|0;q=((C=C+Math.imul(ot,Xt)|0)+(w>>>13)|0)+($t>>>26)|0,$t&=67108863,g=Math.imul(gt,lt),w=(w=Math.imul(gt,dt))+Math.imul(mt,lt)|0,C=Math.imul(mt,dt),g=g+Math.imul(Tt,vt)|0,w=(w=w+Math.imul(Tt,kt)|0)+Math.imul(_t,vt)|0,C=C+Math.imul(_t,kt)|0,g=g+Math.imul(yt,jt)|0,w=(w=w+Math.imul(yt,xt)|0)+Math.imul(wt,jt)|0,C=C+Math.imul(wt,xt)|0;var Bt=(q+(g=g+Math.imul(ft,Wt)|0)|0)+((8191&(w=(w=w+Math.imul(ft,Xt)|0)+Math.imul(pt,Wt)|0))<<13)|0;q=((C=C+Math.imul(pt,Xt)|0)+(w>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,g=Math.imul(gt,vt),w=(w=Math.imul(gt,kt))+Math.imul(mt,vt)|0,C=Math.imul(mt,kt),g=g+Math.imul(Tt,jt)|0,w=(w=w+Math.imul(Tt,xt)|0)+Math.imul(_t,jt)|0,C=C+Math.imul(_t,xt)|0;var Ht=(q+(g=g+Math.imul(yt,Wt)|0)|0)+((8191&(w=(w=w+Math.imul(yt,Xt)|0)+Math.imul(wt,Wt)|0))<<13)|0;q=((C=C+Math.imul(wt,Xt)|0)+(w>>>13)|0)+(Ht>>>26)|0,Ht&=67108863,g=Math.imul(gt,jt),w=(w=Math.imul(gt,xt))+Math.imul(mt,jt)|0,C=Math.imul(mt,xt);var ie=(q+(g=g+Math.imul(Tt,Wt)|0)|0)+((8191&(w=(w=w+Math.imul(Tt,Xt)|0)+Math.imul(_t,Wt)|0))<<13)|0;q=((C=C+Math.imul(_t,Xt)|0)+(w>>>13)|0)+(ie>>>26)|0,ie&=67108863;var se=(q+(g=Math.imul(gt,Wt))|0)+((8191&(w=(w=Math.imul(gt,Xt))+Math.imul(mt,Wt)|0))<<13)|0;return q=((C=Math.imul(mt,Xt))+(w>>>13)|0)+(se>>>26)|0,se&=67108863,$[0]=ee,$[1]=ne,$[2]=le,$[3]=fe,$[4]=ae,$[5]=he,$[6]=Y,$[7]=st,$[8]=ut,$[9]=ct,$[10]=bt,$[11]=Ct,$[12]=Et,$[13]=Zt,$[14]=$t,$[15]=Bt,$[16]=Ht,$[17]=ie,$[18]=se,q!==0&&($[19]=q,y.length++),y};function A(u,b,y){y.negative=b.negative^u.negative,y.length=u.length+b.length;for(var g=0,w=0,C=0;C>>26)|0)>>>26,R&=67108863}y.words[C]=z,g=R,R=w}return g!==0?y.words[C]=g:y.length--,y._strip()}function I(u,b,y){return A(u,b,y)}function L(u,b){this.x=u,this.y=b}Math.imul||(x=v),t.prototype.mulTo=function(u,b){var y=this.length+u.length;return this.length===10&&u.length===10?x(this,u,b):y<63?v(this,u,b):y<1024?A(this,u,b):I(this,u,b)},L.prototype.makeRBT=function(u){for(var b=new Array(u),y=t.prototype._countBits(u)-1,g=0;g>=1;return g},L.prototype.permute=function(u,b,y,g,w,C){for(var R=0;R>>=1)w++;return 1<>>=13,y[2*C+1]=8191&w,w>>>=13;for(C=2*b;C>=26,y+=w/67108864|0,y+=C>>>26,this.words[g]=67108863&C}return y!==0&&(this.words[g]=y,this.length++),b?this.ineg():this},t.prototype.muln=function(u){return this.clone().imuln(u)},t.prototype.sqr=function(){return this.mul(this)},t.prototype.isqr=function(){return this.imul(this.clone())},t.prototype.pow=function(u){var b=function(C){for(var R=new Array(C.bitLength()),z=0;z>>q&1}return R}(u);if(b.length===0)return new t(1);for(var y=this,g=0;g=0);var b,y=u%26,g=(u-y)/26,w=67108863>>>26-y<<26-y;if(y!==0){var C=0;for(b=0;b>>26-y}C&&(this.words[b]=C,this.length++)}if(g!==0){for(b=this.length-1;b>=0;b--)this.words[b+g]=this.words[b];for(b=0;b=0),g=b?(b-b%26)/26:0;var w=u%26,C=Math.min((u-w)/26,this.length),R=67108863^67108863>>>w<C)for(this.length-=C,$=0;$=0&&(q!==0||$>=g);$--){var O=0|this.words[$];this.words[$]=q<<26-w|O>>>w,q=O&R}return z&&q!==0&&(z.words[z.length++]=q),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},t.prototype.ishrn=function(u,b,y){return a(this.negative===0),this.iushrn(u,b,y)},t.prototype.shln=function(u){return this.clone().ishln(u)},t.prototype.ushln=function(u){return this.clone().iushln(u)},t.prototype.shrn=function(u){return this.clone().ishrn(u)},t.prototype.ushrn=function(u){return this.clone().iushrn(u)},t.prototype.testn=function(u){a(typeof u=="number"&&u>=0);var b=u%26,y=(u-b)/26,g=1<=0);var b=u%26,y=(u-b)/26;if(a(this.negative===0,"imaskn works only with positive numbers"),this.length<=y)return this;if(b!==0&&y++,this.length=Math.min(y,this.length),b!==0){var g=67108863^67108863>>>b<=67108864;b++)this.words[b]-=67108864,b===this.length-1?this.words[b+1]=1:this.words[b+1]++;return this.length=Math.max(this.length,b+1),this},t.prototype.isubn=function(u){if(a(typeof u=="number"),a(u<67108864),u<0)return this.iaddn(-u);if(this.negative!==0)return this.negative=0,this.iaddn(u),this.negative=1,this;if(this.words[0]-=u,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var b=0;b>26)-(z/67108864|0),this.words[g+y]=67108863&w}for(;g>26,this.words[g+y]=67108863&w;if(R===0)return this._strip();for(a(R===-1),R=0,g=0;g>26,this.words[g]=67108863&w;return this.negative=1,this._strip()},t.prototype._wordDiv=function(u,b){var y=(this.length,u.length),g=this.clone(),w=u,C=0|w.words[w.length-1];(y=26-this._countBits(C))!==0&&(w=w.ushln(y),g.iushln(y),C=0|w.words[w.length-1]);var R,z=g.length-w.length;if(b!=="mod"){(R=new t(null)).length=z+1,R.words=new Array(R.length);for(var $=0;$=0;O--){var H=67108864*(0|g.words[w.length+O])+(0|g.words[w.length+O-1]);for(H=Math.min(H/C|0,67108863),g._ishlnsubmul(w,H,O);g.negative!==0;)H--,g.negative=0,g._ishlnsubmul(w,1,O),g.isZero()||(g.negative^=1);R&&(R.words[O]=H)}return R&&R._strip(),g._strip(),b!=="div"&&y!==0&&g.iushrn(y),{div:R||null,mod:g}},t.prototype.divmod=function(u,b,y){return a(!u.isZero()),this.isZero()?{div:new t(0),mod:new t(0)}:this.negative!==0&&u.negative===0?(C=this.neg().divmod(u,b),b!=="mod"&&(g=C.div.neg()),b!=="div"&&(w=C.mod.neg(),y&&w.negative!==0&&w.iadd(u)),{div:g,mod:w}):this.negative===0&&u.negative!==0?(C=this.divmod(u.neg(),b),b!=="mod"&&(g=C.div.neg()),{div:g,mod:C.mod}):this.negative&u.negative?(C=this.neg().divmod(u.neg(),b),b!=="div"&&(w=C.mod.neg(),y&&w.negative!==0&&w.isub(u)),{div:C.div,mod:w}):u.length>this.length||this.cmp(u)<0?{div:new t(0),mod:this}:u.length===1?b==="div"?{div:this.divn(u.words[0]),mod:null}:b==="mod"?{div:null,mod:new t(this.modrn(u.words[0]))}:{div:this.divn(u.words[0]),mod:new t(this.modrn(u.words[0]))}:this._wordDiv(u,b);var g,w,C},t.prototype.div=function(u){return this.divmod(u,"div",!1).div},t.prototype.mod=function(u){return this.divmod(u,"mod",!1).mod},t.prototype.umod=function(u){return this.divmod(u,"mod",!0).mod},t.prototype.divRound=function(u){var b=this.divmod(u);if(b.mod.isZero())return b.div;var y=b.div.negative!==0?b.mod.isub(u):b.mod,g=u.ushrn(1),w=u.andln(1),C=y.cmp(g);return C<0||w===1&&C===0?b.div:b.div.negative!==0?b.div.isubn(1):b.div.iaddn(1)},t.prototype.modrn=function(u){var b=u<0;b&&(u=-u),a(u<=67108863);for(var y=(1<<26)%u,g=0,w=this.length-1;w>=0;w--)g=(y*g+(0|this.words[w]))%u;return b?-g:g},t.prototype.modn=function(u){return this.modrn(u)},t.prototype.idivn=function(u){var b=u<0;b&&(u=-u),a(u<=67108863);for(var y=0,g=this.length-1;g>=0;g--){var w=(0|this.words[g])+67108864*y;this.words[g]=w/u|0,y=w%u}return this._strip(),b?this.ineg():this},t.prototype.divn=function(u){return this.clone().idivn(u)},t.prototype.egcd=function(u){a(u.negative===0),a(!u.isZero());var b=this,y=u.clone();b=b.negative!==0?b.umod(u):b.clone();for(var g=new t(1),w=new t(0),C=new t(0),R=new t(1),z=0;b.isEven()&&y.isEven();)b.iushrn(1),y.iushrn(1),++z;for(var $=y.clone(),q=b.clone();!b.isZero();){for(var O=0,H=1;!(b.words[0]&H)&&O<26;++O,H<<=1);if(O>0)for(b.iushrn(O);O-- >0;)(g.isOdd()||w.isOdd())&&(g.iadd($),w.isub(q)),g.iushrn(1),w.iushrn(1);for(var T=0,E=1;!(y.words[0]&E)&&T<26;++T,E<<=1);if(T>0)for(y.iushrn(T);T-- >0;)(C.isOdd()||R.isOdd())&&(C.iadd($),R.isub(q)),C.iushrn(1),R.iushrn(1);b.cmp(y)>=0?(b.isub(y),g.isub(C),w.isub(R)):(y.isub(b),C.isub(g),R.isub(w))}return{a:C,b:R,gcd:y.iushln(z)}},t.prototype._invmp=function(u){a(u.negative===0),a(!u.isZero());var b=this,y=u.clone();b=b.negative!==0?b.umod(u):b.clone();for(var g,w=new t(1),C=new t(0),R=y.clone();b.cmpn(1)>0&&y.cmpn(1)>0;){for(var z=0,$=1;!(b.words[0]&$)&&z<26;++z,$<<=1);if(z>0)for(b.iushrn(z);z-- >0;)w.isOdd()&&w.iadd(R),w.iushrn(1);for(var q=0,O=1;!(y.words[0]&O)&&q<26;++q,O<<=1);if(q>0)for(y.iushrn(q);q-- >0;)C.isOdd()&&C.iadd(R),C.iushrn(1);b.cmp(y)>=0?(b.isub(y),w.isub(C)):(y.isub(b),C.isub(w))}return(g=b.cmpn(1)===0?w:C).cmpn(0)<0&&g.iadd(u),g},t.prototype.gcd=function(u){if(this.isZero())return u.abs();if(u.isZero())return this.abs();var b=this.clone(),y=u.clone();b.negative=0,y.negative=0;for(var g=0;b.isEven()&&y.isEven();g++)b.iushrn(1),y.iushrn(1);for(;;){for(;b.isEven();)b.iushrn(1);for(;y.isEven();)y.iushrn(1);var w=b.cmp(y);if(w<0){var C=b;b=y,y=C}else if(w===0||y.cmpn(1)===0)break;b.isub(y)}return y.iushln(g)},t.prototype.invm=function(u){return this.egcd(u).a.umod(u)},t.prototype.isEven=function(){return(1&this.words[0])==0},t.prototype.isOdd=function(){return(1&this.words[0])==1},t.prototype.andln=function(u){return this.words[0]&u},t.prototype.bincn=function(u){a(typeof u=="number");var b=u%26,y=(u-b)/26,g=1<>>26,R&=67108863,this.words[C]=R}return w!==0&&(this.words[C]=w,this.length++),this},t.prototype.isZero=function(){return this.length===1&&this.words[0]===0},t.prototype.cmpn=function(u){var b,y=u<0;if(this.negative!==0&&!y)return-1;if(this.negative===0&&y)return 1;if(this._strip(),this.length>1)b=1;else{y&&(u=-u),a(u<=67108863,"Number is too big");var g=0|this.words[0];b=g===u?0:gu.length)return 1;if(this.length=0;y--){var g=0|this.words[y],w=0|u.words[y];if(g!==w){gw&&(b=1);break}}return b},t.prototype.gtn=function(u){return this.cmpn(u)===1},t.prototype.gt=function(u){return this.cmp(u)===1},t.prototype.gten=function(u){return this.cmpn(u)>=0},t.prototype.gte=function(u){return this.cmp(u)>=0},t.prototype.ltn=function(u){return this.cmpn(u)===-1},t.prototype.lt=function(u){return this.cmp(u)===-1},t.prototype.lten=function(u){return this.cmpn(u)<=0},t.prototype.lte=function(u){return this.cmp(u)<=0},t.prototype.eqn=function(u){return this.cmpn(u)===0},t.prototype.eq=function(u){return this.cmp(u)===0},t.red=function(u){return new M(u)},t.prototype.toRed=function(u){return a(!this.red,"Already a number in reduction context"),a(this.negative===0,"red works only with positives"),u.convertTo(this)._forceRed(u)},t.prototype.fromRed=function(){return a(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},t.prototype._forceRed=function(u){return this.red=u,this},t.prototype.forceRed=function(u){return a(!this.red,"Already a number in reduction context"),this._forceRed(u)},t.prototype.redAdd=function(u){return a(this.red,"redAdd works only with red numbers"),this.red.add(this,u)},t.prototype.redIAdd=function(u){return a(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,u)},t.prototype.redSub=function(u){return a(this.red,"redSub works only with red numbers"),this.red.sub(this,u)},t.prototype.redISub=function(u){return a(this.red,"redISub works only with red numbers"),this.red.isub(this,u)},t.prototype.redShl=function(u){return a(this.red,"redShl works only with red numbers"),this.red.shl(this,u)},t.prototype.redMul=function(u){return a(this.red,"redMul works only with red numbers"),this.red._verify2(this,u),this.red.mul(this,u)},t.prototype.redIMul=function(u){return a(this.red,"redMul works only with red numbers"),this.red._verify2(this,u),this.red.imul(this,u)},t.prototype.redSqr=function(){return a(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},t.prototype.redISqr=function(){return a(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},t.prototype.redSqrt=function(){return a(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},t.prototype.redInvm=function(){return a(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},t.prototype.redNeg=function(){return a(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},t.prototype.redPow=function(u){return a(this.red&&!u.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,u)};var j={k256:null,p224:null,p192:null,p25519:null};function N(u,b){this.name=u,this.p=new t(b,16),this.n=this.p.bitLength(),this.k=new t(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function D(){N.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function U(){N.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function B(){N.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function S(){N.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(u){if(typeof u=="string"){var b=t._prime(u);this.m=b.p,this.prime=b}else a(u.gtn(1),"modulus must be greater than 1"),this.m=u,this.prime=null}function P(u){M.call(this,u),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new t(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)}N.prototype._tmp=function(){var u=new t(null);return u.words=new Array(Math.ceil(this.n/13)),u},N.prototype.ireduce=function(u){var b,y=u;do this.split(y,this.tmp),b=(y=(y=this.imulK(y)).iadd(this.tmp)).bitLength();while(b>this.n);var g=b0?y.isub(this.p):y.strip!==void 0?y.strip():y._strip(),y},N.prototype.split=function(u,b){u.iushrn(this.n,0,b)},N.prototype.imulK=function(u){return u.imul(this.k)},r(D,N),D.prototype.split=function(u,b){for(var y=Math.min(u.length,9),g=0;g>>22,w=C}w>>>=22,u.words[g-10]=w,w===0&&u.length>10?u.length-=10:u.length-=9},D.prototype.imulK=function(u){u.words[u.length]=0,u.words[u.length+1]=0,u.length+=2;for(var b=0,y=0;y>>=26,u.words[y]=w,b=g}return b!==0&&(u.words[u.length++]=b),u},t._prime=function(u){if(j[u])return j[u];var b;if(u==="k256")b=new D;else if(u==="p224")b=new U;else if(u==="p192")b=new B;else{if(u!=="p25519")throw new Error("Unknown prime "+u);b=new S}return j[u]=b,b},M.prototype._verify1=function(u){a(u.negative===0,"red works only with positives"),a(u.red,"red works only with red numbers")},M.prototype._verify2=function(u,b){a((u.negative|b.negative)==0,"red works only with positives"),a(u.red&&u.red===b.red,"red works only with red numbers")},M.prototype.imod=function(u){return this.prime?this.prime.ireduce(u)._forceRed(this):(h(u,u.umod(this.m)._forceRed(this)),u)},M.prototype.neg=function(u){return u.isZero()?u.clone():this.m.sub(u)._forceRed(this)},M.prototype.add=function(u,b){this._verify2(u,b);var y=u.add(b);return y.cmp(this.m)>=0&&y.isub(this.m),y._forceRed(this)},M.prototype.iadd=function(u,b){this._verify2(u,b);var y=u.iadd(b);return y.cmp(this.m)>=0&&y.isub(this.m),y},M.prototype.sub=function(u,b){this._verify2(u,b);var y=u.sub(b);return y.cmpn(0)<0&&y.iadd(this.m),y._forceRed(this)},M.prototype.isub=function(u,b){this._verify2(u,b);var y=u.isub(b);return y.cmpn(0)<0&&y.iadd(this.m),y},M.prototype.shl=function(u,b){return this._verify1(u),this.imod(u.ushln(b))},M.prototype.imul=function(u,b){return this._verify2(u,b),this.imod(u.imul(b))},M.prototype.mul=function(u,b){return this._verify2(u,b),this.imod(u.mul(b))},M.prototype.isqr=function(u){return this.imul(u,u.clone())},M.prototype.sqr=function(u){return this.mul(u,u)},M.prototype.sqrt=function(u){if(u.isZero())return u.clone();var b=this.m.andln(3);if(a(b%2==1),b===3){var y=this.m.add(new t(1)).iushrn(2);return this.pow(u,y)}for(var g=this.m.subn(1),w=0;!g.isZero()&&g.andln(1)===0;)w++,g.iushrn(1);a(!g.isZero());var C=new t(1).toRed(this),R=C.redNeg(),z=this.m.subn(1).iushrn(1),$=this.m.bitLength();for($=new t(2*$*$).toRed(this);this.pow($,z).cmp(R)!==0;)$.redIAdd(R);for(var q=this.pow($,g),O=this.pow(u,g.addn(1).iushrn(1)),H=this.pow(u,g),T=w;H.cmp(C)!==0;){for(var E=H,F=0;E.cmp(C)!==0;F++)E=E.redSqr();a(F=0;g--){for(var $=b.words[g],q=z-1;q>=0;q--){var O=$>>q&1;w!==y[0]&&(w=this.sqr(w)),O!==0||C!==0?(C<<=1,C|=O,(++R===4||g===0&&q===0)&&(w=this.mul(w,y[C]),R=0,C=0)):R=0}z=26}return w},M.prototype.convertTo=function(u){var b=u.umod(this.m);return b===u?b.clone():b},M.prototype.convertFrom=function(u){var b=u.clone();return b.red=null,b},t.mont=function(u){return new P(u)},r(P,M),P.prototype.convertTo=function(u){return this.imod(u.ushln(this.shift))},P.prototype.convertFrom=function(u){var b=this.imod(u.mul(this.rinv));return b.red=null,b},P.prototype.imul=function(u,b){if(u.isZero()||b.isZero())return u.words[0]=0,u.length=1,u;var y=u.imul(b),g=y.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),w=y.isub(g).iushrn(this.shift),C=w;return w.cmp(this.m)>=0?C=w.isub(this.m):w.cmpn(0)<0&&(C=w.iadd(this.m)),C._forceRed(this)},P.prototype.mul=function(u,b){if(u.isZero()||b.isZero())return new t(0)._forceRed(this);var y=u.mul(b),g=y.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),w=y.isub(g).iushrn(this.shift),C=w;return w.cmp(this.m)>=0?C=w.isub(this.m):w.cmpn(0)<0&&(C=w.iadd(this.m)),C._forceRed(this)},P.prototype.invm=function(u){return this.imod(u._invmp(this.m).mul(this.r2))._forceRed(this)}})(k===void 0||k)},{buffer:188}],187:[function(s,k,_){"use strict";var p;function o(r){this.rand=r}if(k.exports=function(r){return p||(p=new o(null)),p.generate(r)},k.exports.Rand=o,o.prototype.generate=function(r){return this._rand(r)},o.prototype._rand=function(r){if(this.rand.getBytes)return this.rand.getBytes(r);for(var t=new Uint8Array(r),e=0;e>>24]^I[D>>>16&255]^L[U>>>8&255]^j[255&B]^n[S++],d=A[D>>>24]^I[U>>>16&255]^L[B>>>8&255]^j[255&N]^n[S++],v=A[U>>>24]^I[B>>>16&255]^L[N>>>8&255]^j[255&D]^n[S++],x=A[B>>>24]^I[N>>>16&255]^L[D>>>8&255]^j[255&U]^n[S++],N=m,D=d,U=v,B=x;return m=(f[N>>>24]<<24|f[D>>>16&255]<<16|f[U>>>8&255]<<8|f[255&B])^n[S++],d=(f[D>>>24]<<24|f[U>>>16&255]<<16|f[B>>>8&255]<<8|f[255&N])^n[S++],v=(f[U>>>24]<<24|f[B>>>16&255]<<16|f[N>>>8&255]<<8|f[255&D])^n[S++],x=(f[B>>>24]<<24|f[N>>>16&255]<<16|f[D>>>8&255]<<8|f[255&U])^n[S++],[m>>>=0,d>>>=0,v>>>=0,x>>>=0]}var t=[0,1,2,4,8,16,32,64,128,27,54],e=function(){for(var i=new Array(256),n=0;n<256;n++)i[n]=n<128?n<<1:n<<1^283;for(var h=[],f=[],c=[[],[],[],[]],m=[[],[],[],[]],d=0,v=0,x=0;x<256;++x){var A=v^v<<1^v<<2^v<<3^v<<4;A=A>>>8^255&A^99,h[d]=A,f[A]=d;var I=i[d],L=i[I],j=i[L],N=257*i[A]^16843008*A;c[0][d]=N<<24|N>>>8,c[1][d]=N<<16|N>>>16,c[2][d]=N<<8|N>>>24,c[3][d]=N,N=16843009*j^65537*L^257*I^16843008*d,m[0][A]=N<<24|N>>>8,m[1][A]=N<<16|N>>>16,m[2][A]=N<<8|N>>>24,m[3][A]=N,d===0?d=v=1:(d=I^i[i[i[j^I]]],v^=i[i[v]])}return{SBOX:h,INV_SBOX:f,SUB_MIX:c,INV_SUB_MIX:m}}();function l(i){this._key=o(i),this._reset()}l.blockSize=16,l.keySize=32,l.prototype.blockSize=l.blockSize,l.prototype.keySize=l.keySize,l.prototype._reset=function(){for(var i=this._key,n=i.length,h=n+6,f=4*(h+1),c=[],m=0;m>>24,d=e.SBOX[d>>>24]<<24|e.SBOX[d>>>16&255]<<16|e.SBOX[d>>>8&255]<<8|e.SBOX[255&d],d^=t[m/n|0]<<24):n>6&&m%n==4&&(d=e.SBOX[d>>>24]<<24|e.SBOX[d>>>16&255]<<16|e.SBOX[d>>>8&255]<<8|e.SBOX[255&d]),c[m]=c[m-n]^d}for(var v=[],x=0;x>>24]]^e.INV_SUB_MIX[1][e.SBOX[I>>>16&255]]^e.INV_SUB_MIX[2][e.SBOX[I>>>8&255]]^e.INV_SUB_MIX[3][e.SBOX[255&I]]}this._nRounds=h,this._keySchedule=c,this._invKeySchedule=v},l.prototype.encryptBlockRaw=function(i){return r(i=o(i),this._keySchedule,e.SUB_MIX,e.SBOX,this._nRounds)},l.prototype.encryptBlock=function(i){var n=this.encryptBlockRaw(i),h=p.allocUnsafe(16);return h.writeUInt32BE(n[0],0),h.writeUInt32BE(n[1],4),h.writeUInt32BE(n[2],8),h.writeUInt32BE(n[3],12),h},l.prototype.decryptBlock=function(i){var n=(i=o(i))[1];i[1]=i[3],i[3]=n;var h=r(i,this._invKeySchedule,e.INV_SUB_MIX,e.INV_SBOX,this._nRounds),f=p.allocUnsafe(16);return f.writeUInt32BE(h[0],0),f.writeUInt32BE(h[3],4),f.writeUInt32BE(h[2],8),f.writeUInt32BE(h[1],12),f},l.prototype.scrub=function(){a(this._keySchedule),a(this._invKeySchedule),a(this._key)},k.exports.AES=l},{"safe-buffer":494}],190:[function(s,k,_){"use strict";var p=s("./aes"),o=s("safe-buffer").Buffer,a=s("cipher-base"),r=s("inherits"),t=s("./ghash"),e=s("buffer-xor"),l=s("./incr32");function i(n,h,f,c){a.call(this);var m=o.alloc(4,0);this._cipher=new p.AES(h);var d=this._cipher.encryptBlock(m);this._ghash=new t(d),f=function(v,x,A){if(x.length===12)return v._finID=o.concat([x,o.from([0,0,0,1])]),o.concat([x,o.from([0,0,0,2])]);var I=new t(A),L=x.length,j=L%16;I.update(x),j&&(j=16-j,I.update(o.alloc(j,0))),I.update(o.alloc(8,0));var N=8*L,D=o.alloc(8);D.writeUIntBE(N,0,8),I.update(D),v._finID=I.state;var U=o.from(v._finID);return l(U),U}(this,f,d),this._prev=o.from(f),this._cache=o.allocUnsafe(0),this._secCache=o.allocUnsafe(0),this._decrypt=c,this._alen=0,this._len=0,this._mode=n,this._authTag=null,this._called=!1}r(i,a),i.prototype._update=function(n){if(!this._called&&this._alen){var h=16-this._alen%16;h<16&&(h=o.alloc(h,0),this._ghash.update(h))}this._called=!0;var f=this._mode.encrypt(this,n);return this._decrypt?this._ghash.update(n):this._ghash.update(f),this._len+=n.length,f},i.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var n=e(this._ghash.final(8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt&&function(h,f){var c=0;h.length!==f.length&&c++;for(var m=Math.min(h.length,f.length),d=0;d16)throw new Error("unable to decrypt data");for(var d=-1;++d16)return c=this.cache.slice(0,16),this.cache=this.cache.slice(16),c}else if(this.cache.length>=16)return c=this.cache.slice(0,16),this.cache=this.cache.slice(16),c;return null},n.prototype.flush=function(){if(this.cache.length)return this.cache},_.createDecipher=function(f,c){var m=a[f.toLowerCase()];if(!m)throw new TypeError("invalid suite type");var d=l(c,!1,m.key,m.iv);return h(f,d.key,d.iv)},_.createDecipheriv=h},{"./aes":189,"./authCipher":190,"./modes":202,"./streamCipher":205,"cipher-base":221,evp_bytestokey:423,inherits:440,"safe-buffer":494}],193:[function(s,k,_){"use strict";var p=s("./modes"),o=s("./authCipher"),a=s("safe-buffer").Buffer,r=s("./streamCipher"),t=s("cipher-base"),e=s("./aes"),l=s("evp_bytestokey");function i(c,m,d){t.call(this),this._cache=new h,this._cipher=new e.AES(m),this._prev=a.from(d),this._mode=c,this._autopadding=!0}s("inherits")(i,t),i.prototype._update=function(c){var m,d;this._cache.add(c);for(var v=[];m=this._cache.get();)d=this._mode.encrypt(this,m),v.push(d);return a.concat(v)};var n=a.alloc(16,16);function h(){this.cache=a.allocUnsafe(0)}function f(c,m,d){var v=p[c.toLowerCase()];if(!v)throw new TypeError("invalid suite type");if(typeof m=="string"&&(m=a.from(m)),m.length!==v.key/8)throw new TypeError("invalid key length "+m.length);if(typeof d=="string"&&(d=a.from(d)),v.mode!=="GCM"&&d.length!==v.iv)throw new TypeError("invalid iv length "+d.length);return v.type==="stream"?new r(v.module,m,d):v.type==="auth"?new o(v.module,m,d):new i(v.module,m,d)}i.prototype._final=function(){var c=this._cache.flush();if(this._autopadding)return c=this._mode.encrypt(this,c),this._cipher.scrub(),c;if(!c.equals(n))throw this._cipher.scrub(),new Error("data not multiple of block length")},i.prototype.setAutoPadding=function(c){return this._autopadding=!!c,this},h.prototype.add=function(c){this.cache=a.concat([this.cache,c])},h.prototype.get=function(){if(this.cache.length>15){var c=this.cache.slice(0,16);return this.cache=this.cache.slice(16),c}return null},h.prototype.flush=function(){for(var c=16-this.cache.length,m=a.allocUnsafe(c),d=-1;++d>>0,0),e.writeUInt32BE(t[1]>>>0,4),e.writeUInt32BE(t[2]>>>0,8),e.writeUInt32BE(t[3]>>>0,12),e}function r(t){this.h=t,this.state=p.alloc(16,0),this.cache=p.allocUnsafe(0)}r.prototype.ghash=function(t){for(var e=-1;++e0;e--)i[e]=i[e]>>>1|(1&i[e-1])<<31;i[0]=i[0]>>>1,l&&(i[0]=i[0]^225<<24)}this.state=a(n)},r.prototype.update=function(t){var e;for(this.cache=p.concat([this.cache,t]);this.cache.length>=16;)e=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(e)},r.prototype.final=function(t,e){return this.cache.length&&this.ghash(p.concat([this.cache,o],16)),this.ghash(a([0,t,0,e])),this.state},k.exports=r},{"safe-buffer":494}],195:[function(s,k,_){"use strict";k.exports=function(p){for(var o,a=p.length;a--;){if((o=p.readUInt8(a))!==255){o++,p.writeUInt8(o,a);break}p.writeUInt8(0,a)}}},{}],196:[function(s,k,_){"use strict";var p=s("buffer-xor");_.encrypt=function(o,a){var r=p(a,o._prev);return o._prev=o._cipher.encryptBlock(r),o._prev},_.decrypt=function(o,a){var r=o._prev;o._prev=a;var t=o._cipher.decryptBlock(a);return p(t,r)}},{"buffer-xor":219}],197:[function(s,k,_){"use strict";var p=s("safe-buffer").Buffer,o=s("buffer-xor");function a(r,t,e){var l=t.length,i=o(t,r._cache);return r._cache=r._cache.slice(l),r._prev=p.concat([r._prev,e?t:i]),i}_.encrypt=function(r,t,e){for(var l,i=p.allocUnsafe(0);t.length;){if(r._cache.length===0&&(r._cache=r._cipher.encryptBlock(r._prev),r._prev=p.allocUnsafe(0)),!(r._cache.length<=t.length)){i=p.concat([i,a(r,t,e)]);break}l=r._cache.length,i=p.concat([i,a(r,t.slice(0,l),e)]),t=t.slice(l)}return i}},{"buffer-xor":219,"safe-buffer":494}],198:[function(s,k,_){"use strict";var p=s("safe-buffer").Buffer;function o(r,t,e){for(var l,i,n=-1,h=0;++n<8;)l=t&1<<7-n?128:0,h+=(128&(i=r._cipher.encryptBlock(r._prev)[0]^l))>>n%8,r._prev=a(r._prev,e?l:i);return h}function a(r,t){var e=r.length,l=-1,i=p.allocUnsafe(r.length);for(r=p.concat([r,p.from([t])]);++l>7;return i}_.encrypt=function(r,t,e){for(var l=t.length,i=p.allocUnsafe(l),n=-1;++n=0||!l.umod(e.prime1)||!l.umod(e.prime2));return l}function t(e,l){var i=function(L){var j=r(L);return{blinder:j.toRed(o.mont(L.modulus)).redPow(new o(L.publicExponent)).fromRed(),unblinder:j.invm(L.modulus)}}(l),n=l.modulus.byteLength(),h=new o(e).mul(i.blinder).umod(l.modulus),f=h.toRed(o.mont(l.prime1)),c=h.toRed(o.mont(l.prime2)),m=l.coefficient,d=l.prime1,v=l.prime2,x=f.redPow(l.exponent1).fromRed(),A=c.redPow(l.exponent2).fromRed(),I=x.isub(A).imul(m).umod(d).imul(v);return A.iadd(I).imul(i.unblinder).umod(l.modulus).toArrayLike(p,"be",n)}t.getr=r,k.exports=t}).call(this)}).call(this,s("buffer").Buffer)},{"bn.js":186,buffer:220,randombytes:475}],210:[function(s,k,_){"use strict";k.exports=s("./browser/algorithms.json")},{"./browser/algorithms.json":211}],211:[function(s,k,_){k.exports={sha224WithRSAEncryption:{sign:"rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},"RSA-SHA224":{sign:"ecdsa/rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},sha256WithRSAEncryption:{sign:"rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},"RSA-SHA256":{sign:"ecdsa/rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},sha384WithRSAEncryption:{sign:"rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},"RSA-SHA384":{sign:"ecdsa/rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},sha512WithRSAEncryption:{sign:"rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA512":{sign:"ecdsa/rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA1":{sign:"rsa",hash:"sha1",id:"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{sign:"ecdsa",hash:"sha1",id:""},sha256:{sign:"ecdsa",hash:"sha256",id:""},sha224:{sign:"ecdsa",hash:"sha224",id:""},sha384:{sign:"ecdsa",hash:"sha384",id:""},sha512:{sign:"ecdsa",hash:"sha512",id:""},"DSA-SHA":{sign:"dsa",hash:"sha1",id:""},"DSA-SHA1":{sign:"dsa",hash:"sha1",id:""},DSA:{sign:"dsa",hash:"sha1",id:""},"DSA-WITH-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-WITH-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-WITH-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-WITH-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-RIPEMD160":{sign:"dsa",hash:"rmd160",id:""},ripemd160WithRSA:{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},"RSA-RIPEMD160":{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},md5WithRSAEncryption:{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"},"RSA-MD5":{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"}}},{}],212:[function(s,k,_){k.exports={"1.3.132.0.10":"secp256k1","1.3.132.0.33":"p224","1.2.840.10045.3.1.1":"p192","1.2.840.10045.3.1.7":"p256","1.3.132.0.34":"p384","1.3.132.0.35":"p521"}},{}],213:[function(s,k,_){"use strict";var p=s("safe-buffer").Buffer,o=s("create-hash"),a=s("readable-stream"),r=s("inherits"),t=s("./sign"),e=s("./verify"),l=s("./algorithms.json");function i(c){a.Writable.call(this);var m=l[c];if(!m)throw new Error("Unknown message digest");this._hashType=m.hash,this._hash=o(m.hash),this._tag=m.id,this._signType=m.sign}function n(c){a.Writable.call(this);var m=l[c];if(!m)throw new Error("Unknown message digest");this._hash=o(m.hash),this._tag=m.id,this._signType=m.sign}function h(c){return new i(c)}function f(c){return new n(c)}Object.keys(l).forEach(function(c){l[c].id=p.from(l[c].id,"hex"),l[c.toLowerCase()]=l[c]}),r(i,a.Writable),i.prototype._write=function(c,m,d){this._hash.update(c),d()},i.prototype.update=function(c,m){return typeof c=="string"&&(c=p.from(c,m)),this._hash.update(c),this},i.prototype.sign=function(c,m){this.end();var d=this._hash.digest(),v=t(d,c,this._hashType,this._signType,this._tag);return m?v.toString(m):v},r(n,a.Writable),n.prototype._write=function(c,m,d){this._hash.update(c),d()},n.prototype.update=function(c,m){return typeof c=="string"&&(c=p.from(c,m)),this._hash.update(c),this},n.prototype.verify=function(c,m,d){typeof m=="string"&&(m=p.from(m,d)),this.end();var v=this._hash.digest();return e(m,v,c,this._signType,this._tag)},k.exports={Sign:h,Verify:f,createSign:h,createVerify:f}},{"./algorithms.json":211,"./sign":214,"./verify":215,"create-hash":386,inherits:440,"readable-stream":491,"safe-buffer":494}],214:[function(s,k,_){"use strict";var p=s("safe-buffer").Buffer,o=s("create-hmac"),a=s("browserify-rsa"),r=s("elliptic").ec,t=s("bn.js"),e=s("parse-asn1"),l=s("./curves.json");function i(c,m,d,v){if((c=p.from(c.toArray())).length0&&d.ishrn(v),d}function h(c,m,d){var v,x;do{for(v=p.alloc(0);8*v.length=i)throw new Error("invalid sig")}k.exports=function(l,i,n,h,f){var c=r(n);if(c.type==="ec"){if(h!=="ecdsa"&&h!=="ecdsa/rsa")throw new Error("wrong public key type");return function(L,j,N){var D=t[N.data.algorithm.curve.join(".")];if(!D)throw new Error("unknown curve "+N.data.algorithm.curve.join("."));var U=new a(D),B=N.data.subjectPrivateKey.data;return U.verify(j,L,B)}(l,i,c)}if(c.type==="dsa"){if(h!=="dsa")throw new Error("wrong public key type");return function(L,j,N){var D=N.data.p,U=N.data.q,B=N.data.g,S=N.data.pub_key,M=r.signature.decode(L,"der"),P=M.s,u=M.r;e(P,U),e(u,U);var b=o.mont(D),y=P.invm(U);return B.toRed(b).redPow(new o(j).mul(y).mod(U)).fromRed().mul(S.toRed(b).redPow(u.mul(y).mod(U)).fromRed()).mod(D).mod(U).cmp(u)===0}(l,i,c)}if(h!=="rsa"&&h!=="ecdsa/rsa")throw new Error("wrong public key type");i=p.concat([f,i]);for(var m=c.modulus.byteLength(),d=[1],v=0;i.length+d.length+2>5==6?2:c>>4==14?3:c>>3==30?4:c>>6==2?-1:-2}function t(c){var m=this.lastTotal-this.lastNeed,d=function(v,x,A){if((192&x[0])!=128)return v.lastNeed=0,"\uFFFD";if(v.lastNeed>1&&x.length>1){if((192&x[1])!=128)return v.lastNeed=1,"\uFFFD";if(v.lastNeed>2&&x.length>2&&(192&x[2])!=128)return v.lastNeed=2,"\uFFFD"}}(this,c);return d!==void 0?d:this.lastNeed<=c.length?(c.copy(this.lastChar,m,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(c.copy(this.lastChar,m,0,c.length),void(this.lastNeed-=c.length))}function e(c,m){if((c.length-m)%2==0){var d=c.toString("utf16le",m);if(d){var v=d.charCodeAt(d.length-1);if(v>=55296&&v<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=c[c.length-2],this.lastChar[1]=c[c.length-1],d.slice(0,-1)}return d}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=c[c.length-1],c.toString("utf16le",m,c.length-1)}function l(c){var m=c&&c.length?this.write(c):"";if(this.lastNeed){var d=this.lastTotal-this.lastNeed;return m+this.lastChar.toString("utf16le",0,d)}return m}function i(c,m){var d=(c.length-m)%3;return d===0?c.toString("base64",m):(this.lastNeed=3-d,this.lastTotal=3,d===1?this.lastChar[0]=c[c.length-1]:(this.lastChar[0]=c[c.length-2],this.lastChar[1]=c[c.length-1]),c.toString("base64",m,c.length-d))}function n(c){var m=c&&c.length?this.write(c):"";return this.lastNeed?m+this.lastChar.toString("base64",0,3-this.lastNeed):m}function h(c){return c.toString(this.encoding)}function f(c){return c&&c.length?this.write(c):""}_.StringDecoder=a,a.prototype.write=function(c){if(c.length===0)return"";var m,d;if(this.lastNeed){if((m=this.fillLast(c))===void 0)return"";d=this.lastNeed,this.lastNeed=0}else d=0;return d=0?(j>0&&(x.lastNeed=j-1),j):--L=0?(j>0&&(x.lastNeed=j-2),j):--L=0?(j>0&&(j===2?j=0:x.lastNeed=j-3),j):0}(this,c,m);if(!this.lastNeed)return c.toString("utf8",m);this.lastTotal=d;var v=c.length-(d-this.lastNeed);return c.copy(this.lastChar,0,v),c.toString("utf8",m,v)},a.prototype.fillLast=function(c){if(this.lastNeed<=c.length)return c.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);c.copy(this.lastChar,this.lastTotal-this.lastNeed,0,c.length),this.lastNeed-=c.length}},{"safe-buffer":217}],219:[function(s,k,_){(function(p){(function(){"use strict";k.exports=function(o,a){for(var r=Math.min(o.length,a.length),t=new p(r),e=0;e2147483647)throw new RangeError('The value "'+T+'" is invalid for option "size"');var E=new Uint8Array(T);return E.__proto__=t.prototype,E}function t(T,E,F){if(typeof T=="number"){if(typeof E=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return i(T)}return e(T,E,F)}function e(T,E,F){if(typeof T=="string")return function(X,Z){if(typeof Z=="string"&&Z!==""||(Z="utf8"),!t.isEncoding(Z))throw new TypeError("Unknown encoding: "+Z);var rt=0|f(X,Z),tt=r(rt),W=tt.write(X,Z);return W!==rt&&(tt=tt.slice(0,W)),tt}(T,E);if(ArrayBuffer.isView(T))return n(T);if(T==null)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof T);if(O(T,ArrayBuffer)||T&&O(T.buffer,ArrayBuffer))return function(X,Z,rt){if(Z<0||X.byteLength=2147483647)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|T}function f(T,E){if(t.isBuffer(T))return T.length;if(ArrayBuffer.isView(T)||O(T,ArrayBuffer))return T.byteLength;if(typeof T!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof T);var F=T.length,V=arguments.length>2&&arguments[2]===!0;if(!V&&F===0)return 0;for(var K=!1;;)switch(E){case"ascii":case"latin1":case"binary":return F;case"utf8":case"utf-8":return z(T).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*F;case"hex":return F>>>1;case"base64":return $(T).length;default:if(K)return V?-1:z(T).length;E=(""+E).toLowerCase(),K=!0}}function c(T,E,F){var V=!1;if((E===void 0||E<0)&&(E=0),E>this.length||((F===void 0||F>this.length)&&(F=this.length),F<=0)||(F>>>=0)<=(E>>>=0))return"";for(T||(T="utf8");;)switch(T){case"hex":return M(this,E,F);case"utf8":case"utf-8":return U(this,E,F);case"ascii":return B(this,E,F);case"latin1":case"binary":return S(this,E,F);case"base64":return D(this,E,F);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,E,F);default:if(V)throw new TypeError("Unknown encoding: "+T);T=(T+"").toLowerCase(),V=!0}}function m(T,E,F){var V=T[E];T[E]=T[F],T[F]=V}function d(T,E,F,V,K){if(T.length===0)return-1;if(typeof F=="string"?(V=F,F=0):F>2147483647?F=2147483647:F<-2147483648&&(F=-2147483648),H(F=+F)&&(F=K?0:T.length-1),F<0&&(F=T.length+F),F>=T.length){if(K)return-1;F=T.length-1}else if(F<0){if(!K)return-1;F=0}if(typeof E=="string"&&(E=t.from(E,V)),t.isBuffer(E))return E.length===0?-1:v(T,E,F,V,K);if(typeof E=="number")return E&=255,typeof Uint8Array.prototype.indexOf=="function"?K?Uint8Array.prototype.indexOf.call(T,E,F):Uint8Array.prototype.lastIndexOf.call(T,E,F):v(T,[E],F,V,K);throw new TypeError("val must be string, number or Buffer")}function v(T,E,F,V,K){var X,Z=1,rt=T.length,tt=E.length;if(V!==void 0&&((V=String(V).toLowerCase())==="ucs2"||V==="ucs-2"||V==="utf16le"||V==="utf-16le")){if(T.length<2||E.length<2)return-1;Z=2,rt/=2,tt/=2,F/=2}function W(nt,it){return Z===1?nt[it]:nt.readUInt16BE(it*Z)}if(K){var Q=-1;for(X=F;X