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