forked from dchest/tweetnacl-js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnacl-fast.esm.min.js
1 lines (1 loc) · 32.2 KB
/
nacl-fast.esm.min.js
1
function r(r){if(r.__esModule)return r;var t=r.default;if("function"==typeof t){var n=function r(){if(this instanceof r){var n=[null];return n.push.apply(n,arguments),new(Function.bind.apply(t,n))}return t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(r).forEach((function(t){var e=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(n,t,e.get?e:{enumerable:!0,get:function(){return r[t]}})})),n}function t(r){throw new Error('Could not dynamically require "'+r+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var n,e={},o={get exports(){return e},set exports(r){e=r}},i=r(Object.freeze({__proto__:null,default:{}}));(function(r){var n=function(r){var t,n=new Float64Array(16);if(r)for(t=0;t<r.length;t++)n[t]=r[t];return n},e=function(){throw new Error("no PRNG")},o=new Uint8Array(16),h=new Uint8Array(32);h[0]=9;var a=n(),f=n([1]),s=n([56129,1]),u=n([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),c=n([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),y=n([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),l=n([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),p=n([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function v(r,t,n,e){r[t]=n>>24&255,r[t+1]=n>>16&255,r[t+2]=n>>8&255,r[t+3]=255&n,r[t+4]=e>>24&255,r[t+5]=e>>16&255,r[t+6]=e>>8&255,r[t+7]=255&e}function w(r,t,n,e,o){var i,h=0;for(i=0;i<o;i++)h|=r[t+i]^n[e+i];return(1&h-1>>>8)-1}function b(r,t,n,e){return w(r,t,n,e,16)}function g(r,t,n,e){return w(r,t,n,e,32)}function _(r,t,n,e){!function(r,t,n,e){for(var o,i=255&e[0]|(255&e[1])<<8|(255&e[2])<<16|(255&e[3])<<24,h=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,a=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,f=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,s=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,u=255&e[4]|(255&e[5])<<8|(255&e[6])<<16|(255&e[7])<<24,c=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,y=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,l=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,p=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,v=255&e[8]|(255&e[9])<<8|(255&e[10])<<16|(255&e[11])<<24,w=255&n[16]|(255&n[17])<<8|(255&n[18])<<16|(255&n[19])<<24,b=255&n[20]|(255&n[21])<<8|(255&n[22])<<16|(255&n[23])<<24,g=255&n[24]|(255&n[25])<<8|(255&n[26])<<16|(255&n[27])<<24,_=255&n[28]|(255&n[29])<<8|(255&n[30])<<16|(255&n[31])<<24,A=255&e[12]|(255&e[13])<<8|(255&e[14])<<16|(255&e[15])<<24,d=i,U=h,E=a,x=f,M=s,m=u,B=c,S=y,k=l,K=p,Y=v,L=w,T=b,R=g,z=_,O=A,P=0;P<20;P+=2)d^=(o=(T^=(o=(k^=(o=(M^=(o=d+T|0)<<7|o>>>25)+d|0)<<9|o>>>23)+M|0)<<13|o>>>19)+k|0)<<18|o>>>14,m^=(o=(U^=(o=(R^=(o=(K^=(o=m+U|0)<<7|o>>>25)+m|0)<<9|o>>>23)+K|0)<<13|o>>>19)+R|0)<<18|o>>>14,Y^=(o=(B^=(o=(E^=(o=(z^=(o=Y+B|0)<<7|o>>>25)+Y|0)<<9|o>>>23)+z|0)<<13|o>>>19)+E|0)<<18|o>>>14,O^=(o=(L^=(o=(S^=(o=(x^=(o=O+L|0)<<7|o>>>25)+O|0)<<9|o>>>23)+x|0)<<13|o>>>19)+S|0)<<18|o>>>14,d^=(o=(x^=(o=(E^=(o=(U^=(o=d+x|0)<<7|o>>>25)+d|0)<<9|o>>>23)+U|0)<<13|o>>>19)+E|0)<<18|o>>>14,m^=(o=(M^=(o=(S^=(o=(B^=(o=m+M|0)<<7|o>>>25)+m|0)<<9|o>>>23)+B|0)<<13|o>>>19)+S|0)<<18|o>>>14,Y^=(o=(K^=(o=(k^=(o=(L^=(o=Y+K|0)<<7|o>>>25)+Y|0)<<9|o>>>23)+L|0)<<13|o>>>19)+k|0)<<18|o>>>14,O^=(o=(z^=(o=(R^=(o=(T^=(o=O+z|0)<<7|o>>>25)+O|0)<<9|o>>>23)+T|0)<<13|o>>>19)+R|0)<<18|o>>>14;d=d+i|0,U=U+h|0,E=E+a|0,x=x+f|0,M=M+s|0,m=m+u|0,B=B+c|0,S=S+y|0,k=k+l|0,K=K+p|0,Y=Y+v|0,L=L+w|0,T=T+b|0,R=R+g|0,z=z+_|0,O=O+A|0,r[0]=d>>>0&255,r[1]=d>>>8&255,r[2]=d>>>16&255,r[3]=d>>>24&255,r[4]=U>>>0&255,r[5]=U>>>8&255,r[6]=U>>>16&255,r[7]=U>>>24&255,r[8]=E>>>0&255,r[9]=E>>>8&255,r[10]=E>>>16&255,r[11]=E>>>24&255,r[12]=x>>>0&255,r[13]=x>>>8&255,r[14]=x>>>16&255,r[15]=x>>>24&255,r[16]=M>>>0&255,r[17]=M>>>8&255,r[18]=M>>>16&255,r[19]=M>>>24&255,r[20]=m>>>0&255,r[21]=m>>>8&255,r[22]=m>>>16&255,r[23]=m>>>24&255,r[24]=B>>>0&255,r[25]=B>>>8&255,r[26]=B>>>16&255,r[27]=B>>>24&255,r[28]=S>>>0&255,r[29]=S>>>8&255,r[30]=S>>>16&255,r[31]=S>>>24&255,r[32]=k>>>0&255,r[33]=k>>>8&255,r[34]=k>>>16&255,r[35]=k>>>24&255,r[36]=K>>>0&255,r[37]=K>>>8&255,r[38]=K>>>16&255,r[39]=K>>>24&255,r[40]=Y>>>0&255,r[41]=Y>>>8&255,r[42]=Y>>>16&255,r[43]=Y>>>24&255,r[44]=L>>>0&255,r[45]=L>>>8&255,r[46]=L>>>16&255,r[47]=L>>>24&255,r[48]=T>>>0&255,r[49]=T>>>8&255,r[50]=T>>>16&255,r[51]=T>>>24&255,r[52]=R>>>0&255,r[53]=R>>>8&255,r[54]=R>>>16&255,r[55]=R>>>24&255,r[56]=z>>>0&255,r[57]=z>>>8&255,r[58]=z>>>16&255,r[59]=z>>>24&255,r[60]=O>>>0&255,r[61]=O>>>8&255,r[62]=O>>>16&255,r[63]=O>>>24&255}(r,t,n,e)}function A(r,t,n,e){!function(r,t,n,e){for(var o,i=255&e[0]|(255&e[1])<<8|(255&e[2])<<16|(255&e[3])<<24,h=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,a=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,f=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,s=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,u=255&e[4]|(255&e[5])<<8|(255&e[6])<<16|(255&e[7])<<24,c=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,y=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,l=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,p=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,v=255&e[8]|(255&e[9])<<8|(255&e[10])<<16|(255&e[11])<<24,w=255&n[16]|(255&n[17])<<8|(255&n[18])<<16|(255&n[19])<<24,b=255&n[20]|(255&n[21])<<8|(255&n[22])<<16|(255&n[23])<<24,g=255&n[24]|(255&n[25])<<8|(255&n[26])<<16|(255&n[27])<<24,_=255&n[28]|(255&n[29])<<8|(255&n[30])<<16|(255&n[31])<<24,A=255&e[12]|(255&e[13])<<8|(255&e[14])<<16|(255&e[15])<<24,d=0;d<20;d+=2)i^=(o=(b^=(o=(l^=(o=(s^=(o=i+b|0)<<7|o>>>25)+i|0)<<9|o>>>23)+s|0)<<13|o>>>19)+l|0)<<18|o>>>14,u^=(o=(h^=(o=(g^=(o=(p^=(o=u+h|0)<<7|o>>>25)+u|0)<<9|o>>>23)+p|0)<<13|o>>>19)+g|0)<<18|o>>>14,v^=(o=(c^=(o=(a^=(o=(_^=(o=v+c|0)<<7|o>>>25)+v|0)<<9|o>>>23)+_|0)<<13|o>>>19)+a|0)<<18|o>>>14,A^=(o=(w^=(o=(y^=(o=(f^=(o=A+w|0)<<7|o>>>25)+A|0)<<9|o>>>23)+f|0)<<13|o>>>19)+y|0)<<18|o>>>14,i^=(o=(f^=(o=(a^=(o=(h^=(o=i+f|0)<<7|o>>>25)+i|0)<<9|o>>>23)+h|0)<<13|o>>>19)+a|0)<<18|o>>>14,u^=(o=(s^=(o=(y^=(o=(c^=(o=u+s|0)<<7|o>>>25)+u|0)<<9|o>>>23)+c|0)<<13|o>>>19)+y|0)<<18|o>>>14,v^=(o=(p^=(o=(l^=(o=(w^=(o=v+p|0)<<7|o>>>25)+v|0)<<9|o>>>23)+w|0)<<13|o>>>19)+l|0)<<18|o>>>14,A^=(o=(_^=(o=(g^=(o=(b^=(o=A+_|0)<<7|o>>>25)+A|0)<<9|o>>>23)+b|0)<<13|o>>>19)+g|0)<<18|o>>>14;r[0]=i>>>0&255,r[1]=i>>>8&255,r[2]=i>>>16&255,r[3]=i>>>24&255,r[4]=u>>>0&255,r[5]=u>>>8&255,r[6]=u>>>16&255,r[7]=u>>>24&255,r[8]=v>>>0&255,r[9]=v>>>8&255,r[10]=v>>>16&255,r[11]=v>>>24&255,r[12]=A>>>0&255,r[13]=A>>>8&255,r[14]=A>>>16&255,r[15]=A>>>24&255,r[16]=c>>>0&255,r[17]=c>>>8&255,r[18]=c>>>16&255,r[19]=c>>>24&255,r[20]=y>>>0&255,r[21]=y>>>8&255,r[22]=y>>>16&255,r[23]=y>>>24&255,r[24]=l>>>0&255,r[25]=l>>>8&255,r[26]=l>>>16&255,r[27]=l>>>24&255,r[28]=p>>>0&255,r[29]=p>>>8&255,r[30]=p>>>16&255,r[31]=p>>>24&255}(r,t,n,e)}var d=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function U(r,t,n,e,o,i,h){var a,f,s=new Uint8Array(16),u=new Uint8Array(64);for(f=0;f<16;f++)s[f]=0;for(f=0;f<8;f++)s[f]=i[f];for(;o>=64;){for(_(u,s,h,d),f=0;f<64;f++)r[t+f]=n[e+f]^u[f];for(a=1,f=8;f<16;f++)a=a+(255&s[f])|0,s[f]=255&a,a>>>=8;o-=64,t+=64,e+=64}if(o>0)for(_(u,s,h,d),f=0;f<o;f++)r[t+f]=n[e+f]^u[f];return 0}function E(r,t,n,e,o){var i,h,a=new Uint8Array(16),f=new Uint8Array(64);for(h=0;h<16;h++)a[h]=0;for(h=0;h<8;h++)a[h]=e[h];for(;n>=64;){for(_(f,a,o,d),h=0;h<64;h++)r[t+h]=f[h];for(i=1,h=8;h<16;h++)i=i+(255&a[h])|0,a[h]=255&i,i>>>=8;n-=64,t+=64}if(n>0)for(_(f,a,o,d),h=0;h<n;h++)r[t+h]=f[h];return 0}function x(r,t,n,e,o){var i=new Uint8Array(32);A(i,e,o,d);for(var h=new Uint8Array(8),a=0;a<8;a++)h[a]=e[a+16];return E(r,t,n,h,i)}function M(r,t,n,e,o,i,h){var a=new Uint8Array(32);A(a,i,h,d);for(var f=new Uint8Array(8),s=0;s<8;s++)f[s]=i[s+16];return U(r,t,n,e,o,f,a)}var m=function(r){var t,n,e,o,i,h,a,f;this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.leftover=0,this.fin=0,t=255&r[0]|(255&r[1])<<8,this.r[0]=8191&t,n=255&r[2]|(255&r[3])<<8,this.r[1]=8191&(t>>>13|n<<3),e=255&r[4]|(255&r[5])<<8,this.r[2]=7939&(n>>>10|e<<6),o=255&r[6]|(255&r[7])<<8,this.r[3]=8191&(e>>>7|o<<9),i=255&r[8]|(255&r[9])<<8,this.r[4]=255&(o>>>4|i<<12),this.r[5]=i>>>1&8190,h=255&r[10]|(255&r[11])<<8,this.r[6]=8191&(i>>>14|h<<2),a=255&r[12]|(255&r[13])<<8,this.r[7]=8065&(h>>>11|a<<5),f=255&r[14]|(255&r[15])<<8,this.r[8]=8191&(a>>>8|f<<8),this.r[9]=f>>>5&127,this.pad[0]=255&r[16]|(255&r[17])<<8,this.pad[1]=255&r[18]|(255&r[19])<<8,this.pad[2]=255&r[20]|(255&r[21])<<8,this.pad[3]=255&r[22]|(255&r[23])<<8,this.pad[4]=255&r[24]|(255&r[25])<<8,this.pad[5]=255&r[26]|(255&r[27])<<8,this.pad[6]=255&r[28]|(255&r[29])<<8,this.pad[7]=255&r[30]|(255&r[31])<<8};function B(r,t,n,e,o,i){var h=new m(i);return h.update(n,e,o),h.finish(r,t),0}function S(r,t,n,e,o,i){var h=new Uint8Array(16);return B(h,0,n,e,o,i),b(r,t,h,0)}function k(r,t,n,e,o){var i;if(n<32)return-1;for(M(r,0,t,0,n,e,o),B(r,16,r,32,n-32,r),i=0;i<16;i++)r[i]=0;return 0}function K(r,t,n,e,o){var i,h=new Uint8Array(32);if(n<32)return-1;if(x(h,0,32,e,o),0!==S(t,16,t,32,n-32,h))return-1;for(M(r,0,t,0,n,e,o),i=0;i<32;i++)r[i]=0;return 0}function Y(r,t){var n;for(n=0;n<16;n++)r[n]=0|t[n]}function L(r){var t,n,e=1;for(t=0;t<16;t++)n=r[t]+e+65535,e=Math.floor(n/65536),r[t]=n-65536*e;r[0]+=e-1+37*(e-1)}function T(r,t,n){for(var e,o=~(n-1),i=0;i<16;i++)e=o&(r[i]^t[i]),r[i]^=e,t[i]^=e}function R(r,t){var e,o,i,h=n(),a=n();for(e=0;e<16;e++)a[e]=t[e];for(L(a),L(a),L(a),o=0;o<2;o++){for(h[0]=a[0]-65517,e=1;e<15;e++)h[e]=a[e]-65535-(h[e-1]>>16&1),h[e-1]&=65535;h[15]=a[15]-32767-(h[14]>>16&1),i=h[15]>>16&1,h[14]&=65535,T(a,h,1-i)}for(e=0;e<16;e++)r[2*e]=255&a[e],r[2*e+1]=a[e]>>8}function z(r,t){var n=new Uint8Array(32),e=new Uint8Array(32);return R(n,r),R(e,t),g(n,0,e,0)}function O(r){var t=new Uint8Array(32);return R(t,r),1&t[0]}function P(r,t){var n;for(n=0;n<16;n++)r[n]=t[2*n]+(t[2*n+1]<<8);r[15]&=32767}function C(r,t,n){for(var e=0;e<16;e++)r[e]=t[e]+n[e]}function N(r,t,n){for(var e=0;e<16;e++)r[e]=t[e]-n[e]}function F(r,t,n){var e,o,i=0,h=0,a=0,f=0,s=0,u=0,c=0,y=0,l=0,p=0,v=0,w=0,b=0,g=0,_=0,A=0,d=0,U=0,E=0,x=0,M=0,m=0,B=0,S=0,k=0,K=0,Y=0,L=0,T=0,R=0,z=0,O=n[0],P=n[1],C=n[2],N=n[3],F=n[4],j=n[5],I=n[6],Z=n[7],q=n[8],D=n[9],G=n[10],V=n[11],X=n[12],H=n[13],J=n[14],Q=n[15];i+=(e=t[0])*O,h+=e*P,a+=e*C,f+=e*N,s+=e*F,u+=e*j,c+=e*I,y+=e*Z,l+=e*q,p+=e*D,v+=e*G,w+=e*V,b+=e*X,g+=e*H,_+=e*J,A+=e*Q,h+=(e=t[1])*O,a+=e*P,f+=e*C,s+=e*N,u+=e*F,c+=e*j,y+=e*I,l+=e*Z,p+=e*q,v+=e*D,w+=e*G,b+=e*V,g+=e*X,_+=e*H,A+=e*J,d+=e*Q,a+=(e=t[2])*O,f+=e*P,s+=e*C,u+=e*N,c+=e*F,y+=e*j,l+=e*I,p+=e*Z,v+=e*q,w+=e*D,b+=e*G,g+=e*V,_+=e*X,A+=e*H,d+=e*J,U+=e*Q,f+=(e=t[3])*O,s+=e*P,u+=e*C,c+=e*N,y+=e*F,l+=e*j,p+=e*I,v+=e*Z,w+=e*q,b+=e*D,g+=e*G,_+=e*V,A+=e*X,d+=e*H,U+=e*J,E+=e*Q,s+=(e=t[4])*O,u+=e*P,c+=e*C,y+=e*N,l+=e*F,p+=e*j,v+=e*I,w+=e*Z,b+=e*q,g+=e*D,_+=e*G,A+=e*V,d+=e*X,U+=e*H,E+=e*J,x+=e*Q,u+=(e=t[5])*O,c+=e*P,y+=e*C,l+=e*N,p+=e*F,v+=e*j,w+=e*I,b+=e*Z,g+=e*q,_+=e*D,A+=e*G,d+=e*V,U+=e*X,E+=e*H,x+=e*J,M+=e*Q,c+=(e=t[6])*O,y+=e*P,l+=e*C,p+=e*N,v+=e*F,w+=e*j,b+=e*I,g+=e*Z,_+=e*q,A+=e*D,d+=e*G,U+=e*V,E+=e*X,x+=e*H,M+=e*J,m+=e*Q,y+=(e=t[7])*O,l+=e*P,p+=e*C,v+=e*N,w+=e*F,b+=e*j,g+=e*I,_+=e*Z,A+=e*q,d+=e*D,U+=e*G,E+=e*V,x+=e*X,M+=e*H,m+=e*J,B+=e*Q,l+=(e=t[8])*O,p+=e*P,v+=e*C,w+=e*N,b+=e*F,g+=e*j,_+=e*I,A+=e*Z,d+=e*q,U+=e*D,E+=e*G,x+=e*V,M+=e*X,m+=e*H,B+=e*J,S+=e*Q,p+=(e=t[9])*O,v+=e*P,w+=e*C,b+=e*N,g+=e*F,_+=e*j,A+=e*I,d+=e*Z,U+=e*q,E+=e*D,x+=e*G,M+=e*V,m+=e*X,B+=e*H,S+=e*J,k+=e*Q,v+=(e=t[10])*O,w+=e*P,b+=e*C,g+=e*N,_+=e*F,A+=e*j,d+=e*I,U+=e*Z,E+=e*q,x+=e*D,M+=e*G,m+=e*V,B+=e*X,S+=e*H,k+=e*J,K+=e*Q,w+=(e=t[11])*O,b+=e*P,g+=e*C,_+=e*N,A+=e*F,d+=e*j,U+=e*I,E+=e*Z,x+=e*q,M+=e*D,m+=e*G,B+=e*V,S+=e*X,k+=e*H,K+=e*J,Y+=e*Q,b+=(e=t[12])*O,g+=e*P,_+=e*C,A+=e*N,d+=e*F,U+=e*j,E+=e*I,x+=e*Z,M+=e*q,m+=e*D,B+=e*G,S+=e*V,k+=e*X,K+=e*H,Y+=e*J,L+=e*Q,g+=(e=t[13])*O,_+=e*P,A+=e*C,d+=e*N,U+=e*F,E+=e*j,x+=e*I,M+=e*Z,m+=e*q,B+=e*D,S+=e*G,k+=e*V,K+=e*X,Y+=e*H,L+=e*J,T+=e*Q,_+=(e=t[14])*O,A+=e*P,d+=e*C,U+=e*N,E+=e*F,x+=e*j,M+=e*I,m+=e*Z,B+=e*q,S+=e*D,k+=e*G,K+=e*V,Y+=e*X,L+=e*H,T+=e*J,R+=e*Q,A+=(e=t[15])*O,h+=38*(U+=e*C),a+=38*(E+=e*N),f+=38*(x+=e*F),s+=38*(M+=e*j),u+=38*(m+=e*I),c+=38*(B+=e*Z),y+=38*(S+=e*q),l+=38*(k+=e*D),p+=38*(K+=e*G),v+=38*(Y+=e*V),w+=38*(L+=e*X),b+=38*(T+=e*H),g+=38*(R+=e*J),_+=38*(z+=e*Q),i=(e=(i+=38*(d+=e*P))+(o=1)+65535)-65536*(o=Math.floor(e/65536)),h=(e=h+o+65535)-65536*(o=Math.floor(e/65536)),a=(e=a+o+65535)-65536*(o=Math.floor(e/65536)),f=(e=f+o+65535)-65536*(o=Math.floor(e/65536)),s=(e=s+o+65535)-65536*(o=Math.floor(e/65536)),u=(e=u+o+65535)-65536*(o=Math.floor(e/65536)),c=(e=c+o+65535)-65536*(o=Math.floor(e/65536)),y=(e=y+o+65535)-65536*(o=Math.floor(e/65536)),l=(e=l+o+65535)-65536*(o=Math.floor(e/65536)),p=(e=p+o+65535)-65536*(o=Math.floor(e/65536)),v=(e=v+o+65535)-65536*(o=Math.floor(e/65536)),w=(e=w+o+65535)-65536*(o=Math.floor(e/65536)),b=(e=b+o+65535)-65536*(o=Math.floor(e/65536)),g=(e=g+o+65535)-65536*(o=Math.floor(e/65536)),_=(e=_+o+65535)-65536*(o=Math.floor(e/65536)),A=(e=A+o+65535)-65536*(o=Math.floor(e/65536)),i=(e=(i+=o-1+37*(o-1))+(o=1)+65535)-65536*(o=Math.floor(e/65536)),h=(e=h+o+65535)-65536*(o=Math.floor(e/65536)),a=(e=a+o+65535)-65536*(o=Math.floor(e/65536)),f=(e=f+o+65535)-65536*(o=Math.floor(e/65536)),s=(e=s+o+65535)-65536*(o=Math.floor(e/65536)),u=(e=u+o+65535)-65536*(o=Math.floor(e/65536)),c=(e=c+o+65535)-65536*(o=Math.floor(e/65536)),y=(e=y+o+65535)-65536*(o=Math.floor(e/65536)),l=(e=l+o+65535)-65536*(o=Math.floor(e/65536)),p=(e=p+o+65535)-65536*(o=Math.floor(e/65536)),v=(e=v+o+65535)-65536*(o=Math.floor(e/65536)),w=(e=w+o+65535)-65536*(o=Math.floor(e/65536)),b=(e=b+o+65535)-65536*(o=Math.floor(e/65536)),g=(e=g+o+65535)-65536*(o=Math.floor(e/65536)),_=(e=_+o+65535)-65536*(o=Math.floor(e/65536)),A=(e=A+o+65535)-65536*(o=Math.floor(e/65536)),i+=o-1+37*(o-1),r[0]=i,r[1]=h,r[2]=a,r[3]=f,r[4]=s,r[5]=u,r[6]=c,r[7]=y,r[8]=l,r[9]=p,r[10]=v,r[11]=w,r[12]=b,r[13]=g,r[14]=_,r[15]=A}function j(r,t){F(r,t,t)}function I(r,t){var e,o=n();for(e=0;e<16;e++)o[e]=t[e];for(e=253;e>=0;e--)j(o,o),2!==e&&4!==e&&F(o,o,t);for(e=0;e<16;e++)r[e]=o[e]}function Z(r,t){var e,o=n();for(e=0;e<16;e++)o[e]=t[e];for(e=250;e>=0;e--)j(o,o),1!==e&&F(o,o,t);for(e=0;e<16;e++)r[e]=o[e]}function q(r,t,e){var o,i,h=new Uint8Array(32),a=new Float64Array(80),f=n(),u=n(),c=n(),y=n(),l=n(),p=n();for(i=0;i<31;i++)h[i]=t[i];for(h[31]=127&t[31]|64,h[0]&=248,P(a,e),i=0;i<16;i++)u[i]=a[i],y[i]=f[i]=c[i]=0;for(f[0]=y[0]=1,i=254;i>=0;--i)T(f,u,o=h[i>>>3]>>>(7&i)&1),T(c,y,o),C(l,f,c),N(f,f,c),C(c,u,y),N(u,u,y),j(y,l),j(p,f),F(f,c,f),F(c,u,l),C(l,f,c),N(f,f,c),j(u,f),N(c,y,p),F(f,c,s),C(f,f,y),F(c,c,f),F(f,y,p),F(y,u,a),j(u,l),T(f,u,o),T(c,y,o);for(i=0;i<16;i++)a[i+16]=f[i],a[i+32]=c[i],a[i+48]=u[i],a[i+64]=y[i];var v=a.subarray(32),w=a.subarray(16);return I(v,v),F(w,w,v),R(r,w),0}function D(r,t){return q(r,t,h)}function G(r,t){return e(t,32),D(r,t)}function V(r,t,n){var e=new Uint8Array(32);return q(e,n,t),A(r,o,e,d)}m.prototype.blocks=function(r,t,n){for(var e,o,i,h,a,f,s,u,c,y,l,p,v,w,b,g,_,A,d,U=this.fin?0:2048,E=this.h[0],x=this.h[1],M=this.h[2],m=this.h[3],B=this.h[4],S=this.h[5],k=this.h[6],K=this.h[7],Y=this.h[8],L=this.h[9],T=this.r[0],R=this.r[1],z=this.r[2],O=this.r[3],P=this.r[4],C=this.r[5],N=this.r[6],F=this.r[7],j=this.r[8],I=this.r[9];n>=16;)y=c=0,y+=(E+=8191&(e=255&r[t+0]|(255&r[t+1])<<8))*T,y+=(x+=8191&(e>>>13|(o=255&r[t+2]|(255&r[t+3])<<8)<<3))*(5*I),y+=(M+=8191&(o>>>10|(i=255&r[t+4]|(255&r[t+5])<<8)<<6))*(5*j),y+=(m+=8191&(i>>>7|(h=255&r[t+6]|(255&r[t+7])<<8)<<9))*(5*F),c=(y+=(B+=8191&(h>>>4|(a=255&r[t+8]|(255&r[t+9])<<8)<<12))*(5*N))>>>13,y&=8191,y+=(S+=a>>>1&8191)*(5*C),y+=(k+=8191&(a>>>14|(f=255&r[t+10]|(255&r[t+11])<<8)<<2))*(5*P),y+=(K+=8191&(f>>>11|(s=255&r[t+12]|(255&r[t+13])<<8)<<5))*(5*O),y+=(Y+=8191&(s>>>8|(u=255&r[t+14]|(255&r[t+15])<<8)<<8))*(5*z),l=c+=(y+=(L+=u>>>5|U)*(5*R))>>>13,l+=E*R,l+=x*T,l+=M*(5*I),l+=m*(5*j),c=(l+=B*(5*F))>>>13,l&=8191,l+=S*(5*N),l+=k*(5*C),l+=K*(5*P),l+=Y*(5*O),c+=(l+=L*(5*z))>>>13,l&=8191,p=c,p+=E*z,p+=x*R,p+=M*T,p+=m*(5*I),c=(p+=B*(5*j))>>>13,p&=8191,p+=S*(5*F),p+=k*(5*N),p+=K*(5*C),p+=Y*(5*P),v=c+=(p+=L*(5*O))>>>13,v+=E*O,v+=x*z,v+=M*R,v+=m*T,c=(v+=B*(5*I))>>>13,v&=8191,v+=S*(5*j),v+=k*(5*F),v+=K*(5*N),v+=Y*(5*C),w=c+=(v+=L*(5*P))>>>13,w+=E*P,w+=x*O,w+=M*z,w+=m*R,c=(w+=B*T)>>>13,w&=8191,w+=S*(5*I),w+=k*(5*j),w+=K*(5*F),w+=Y*(5*N),b=c+=(w+=L*(5*C))>>>13,b+=E*C,b+=x*P,b+=M*O,b+=m*z,c=(b+=B*R)>>>13,b&=8191,b+=S*T,b+=k*(5*I),b+=K*(5*j),b+=Y*(5*F),g=c+=(b+=L*(5*N))>>>13,g+=E*N,g+=x*C,g+=M*P,g+=m*O,c=(g+=B*z)>>>13,g&=8191,g+=S*R,g+=k*T,g+=K*(5*I),g+=Y*(5*j),_=c+=(g+=L*(5*F))>>>13,_+=E*F,_+=x*N,_+=M*C,_+=m*P,c=(_+=B*O)>>>13,_&=8191,_+=S*z,_+=k*R,_+=K*T,_+=Y*(5*I),A=c+=(_+=L*(5*j))>>>13,A+=E*j,A+=x*F,A+=M*N,A+=m*C,c=(A+=B*P)>>>13,A&=8191,A+=S*O,A+=k*z,A+=K*R,A+=Y*T,d=c+=(A+=L*(5*I))>>>13,d+=E*I,d+=x*j,d+=M*F,d+=m*N,c=(d+=B*C)>>>13,d&=8191,d+=S*P,d+=k*O,d+=K*z,d+=Y*R,E=y=8191&(c=(c=((c+=(d+=L*T)>>>13)<<2)+c|0)+(y&=8191)|0),x=l+=c>>>=13,M=p&=8191,m=v&=8191,B=w&=8191,S=b&=8191,k=g&=8191,K=_&=8191,Y=A&=8191,L=d&=8191,t+=16,n-=16;this.h[0]=E,this.h[1]=x,this.h[2]=M,this.h[3]=m,this.h[4]=B,this.h[5]=S,this.h[6]=k,this.h[7]=K,this.h[8]=Y,this.h[9]=L},m.prototype.finish=function(r,t){var n,e,o,i,h=new Uint16Array(10);if(this.leftover){for(i=this.leftover,this.buffer[i++]=1;i<16;i++)this.buffer[i]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(n=this.h[1]>>>13,this.h[1]&=8191,i=2;i<10;i++)this.h[i]+=n,n=this.h[i]>>>13,this.h[i]&=8191;for(this.h[0]+=5*n,n=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=n,n=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=n,h[0]=this.h[0]+5,n=h[0]>>>13,h[0]&=8191,i=1;i<10;i++)h[i]=this.h[i]+n,n=h[i]>>>13,h[i]&=8191;for(h[9]-=8192,e=(1^n)-1,i=0;i<10;i++)h[i]&=e;for(e=~e,i=0;i<10;i++)this.h[i]=this.h[i]&e|h[i];for(this.h[0]=65535&(this.h[0]|this.h[1]<<13),this.h[1]=65535&(this.h[1]>>>3|this.h[2]<<10),this.h[2]=65535&(this.h[2]>>>6|this.h[3]<<7),this.h[3]=65535&(this.h[3]>>>9|this.h[4]<<4),this.h[4]=65535&(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14),this.h[5]=65535&(this.h[6]>>>2|this.h[7]<<11),this.h[6]=65535&(this.h[7]>>>5|this.h[8]<<8),this.h[7]=65535&(this.h[8]>>>8|this.h[9]<<5),o=this.h[0]+this.pad[0],this.h[0]=65535&o,i=1;i<8;i++)o=(this.h[i]+this.pad[i]|0)+(o>>>16)|0,this.h[i]=65535&o;r[t+0]=this.h[0]>>>0&255,r[t+1]=this.h[0]>>>8&255,r[t+2]=this.h[1]>>>0&255,r[t+3]=this.h[1]>>>8&255,r[t+4]=this.h[2]>>>0&255,r[t+5]=this.h[2]>>>8&255,r[t+6]=this.h[3]>>>0&255,r[t+7]=this.h[3]>>>8&255,r[t+8]=this.h[4]>>>0&255,r[t+9]=this.h[4]>>>8&255,r[t+10]=this.h[5]>>>0&255,r[t+11]=this.h[5]>>>8&255,r[t+12]=this.h[6]>>>0&255,r[t+13]=this.h[6]>>>8&255,r[t+14]=this.h[7]>>>0&255,r[t+15]=this.h[7]>>>8&255},m.prototype.update=function(r,t,n){var e,o;if(this.leftover){for((o=16-this.leftover)>n&&(o=n),e=0;e<o;e++)this.buffer[this.leftover+e]=r[t+e];if(n-=o,t+=o,this.leftover+=o,this.leftover<16)return;this.blocks(this.buffer,0,16),this.leftover=0}if(n>=16&&(o=n-n%16,this.blocks(r,t,o),t+=o,n-=o),n){for(e=0;e<n;e++)this.buffer[this.leftover+e]=r[t+e];this.leftover+=n}};var X=k,H=K,J=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function Q(r,t,n,e){for(var o,i,h,a,f,s,u,c,y,l,p,v,w,b,g,_,A,d,U,E,x,M,m,B,S,k,K=new Int32Array(16),Y=new Int32Array(16),L=r[0],T=r[1],R=r[2],z=r[3],O=r[4],P=r[5],C=r[6],N=r[7],F=t[0],j=t[1],I=t[2],Z=t[3],q=t[4],D=t[5],G=t[6],V=t[7],X=0;e>=128;){for(U=0;U<16;U++)E=8*U+X,K[U]=n[E+0]<<24|n[E+1]<<16|n[E+2]<<8|n[E+3],Y[U]=n[E+4]<<24|n[E+5]<<16|n[E+6]<<8|n[E+7];for(U=0;U<80;U++)if(o=L,i=T,h=R,a=z,f=O,s=P,u=C,y=F,l=j,p=I,v=Z,w=q,b=D,g=G,m=65535&(M=V),B=M>>>16,S=65535&(x=N),k=x>>>16,m+=65535&(M=(q>>>14|O<<18)^(q>>>18|O<<14)^(O>>>9|q<<23)),B+=M>>>16,S+=65535&(x=(O>>>14|q<<18)^(O>>>18|q<<14)^(q>>>9|O<<23)),k+=x>>>16,m+=65535&(M=q&D^~q&G),B+=M>>>16,S+=65535&(x=O&P^~O&C),k+=x>>>16,x=J[2*U],m+=65535&(M=J[2*U+1]),B+=M>>>16,S+=65535&x,k+=x>>>16,x=K[U%16],B+=(M=Y[U%16])>>>16,S+=65535&x,k+=x>>>16,S+=(B+=(m+=65535&M)>>>16)>>>16,m=65535&(M=d=65535&m|B<<16),B=M>>>16,S=65535&(x=A=65535&S|(k+=S>>>16)<<16),k=x>>>16,m+=65535&(M=(F>>>28|L<<4)^(L>>>2|F<<30)^(L>>>7|F<<25)),B+=M>>>16,S+=65535&(x=(L>>>28|F<<4)^(F>>>2|L<<30)^(F>>>7|L<<25)),k+=x>>>16,B+=(M=F&j^F&I^j&I)>>>16,S+=65535&(x=L&T^L&R^T&R),k+=x>>>16,c=65535&(S+=(B+=(m+=65535&M)>>>16)>>>16)|(k+=S>>>16)<<16,_=65535&m|B<<16,m=65535&(M=v),B=M>>>16,S=65535&(x=a),k=x>>>16,B+=(M=d)>>>16,S+=65535&(x=A),k+=x>>>16,T=o,R=i,z=h,O=a=65535&(S+=(B+=(m+=65535&M)>>>16)>>>16)|(k+=S>>>16)<<16,P=f,C=s,N=u,L=c,j=y,I=l,Z=p,q=v=65535&m|B<<16,D=w,G=b,V=g,F=_,U%16==15)for(E=0;E<16;E++)x=K[E],m=65535&(M=Y[E]),B=M>>>16,S=65535&x,k=x>>>16,x=K[(E+9)%16],m+=65535&(M=Y[(E+9)%16]),B+=M>>>16,S+=65535&x,k+=x>>>16,A=K[(E+1)%16],m+=65535&(M=((d=Y[(E+1)%16])>>>1|A<<31)^(d>>>8|A<<24)^(d>>>7|A<<25)),B+=M>>>16,S+=65535&(x=(A>>>1|d<<31)^(A>>>8|d<<24)^A>>>7),k+=x>>>16,A=K[(E+14)%16],B+=(M=((d=Y[(E+14)%16])>>>19|A<<13)^(A>>>29|d<<3)^(d>>>6|A<<26))>>>16,S+=65535&(x=(A>>>19|d<<13)^(d>>>29|A<<3)^A>>>6),k+=x>>>16,k+=(S+=(B+=(m+=65535&M)>>>16)>>>16)>>>16,K[E]=65535&S|k<<16,Y[E]=65535&m|B<<16;m=65535&(M=F),B=M>>>16,S=65535&(x=L),k=x>>>16,x=r[0],B+=(M=t[0])>>>16,S+=65535&x,k+=x>>>16,k+=(S+=(B+=(m+=65535&M)>>>16)>>>16)>>>16,r[0]=L=65535&S|k<<16,t[0]=F=65535&m|B<<16,m=65535&(M=j),B=M>>>16,S=65535&(x=T),k=x>>>16,x=r[1],B+=(M=t[1])>>>16,S+=65535&x,k+=x>>>16,k+=(S+=(B+=(m+=65535&M)>>>16)>>>16)>>>16,r[1]=T=65535&S|k<<16,t[1]=j=65535&m|B<<16,m=65535&(M=I),B=M>>>16,S=65535&(x=R),k=x>>>16,x=r[2],B+=(M=t[2])>>>16,S+=65535&x,k+=x>>>16,k+=(S+=(B+=(m+=65535&M)>>>16)>>>16)>>>16,r[2]=R=65535&S|k<<16,t[2]=I=65535&m|B<<16,m=65535&(M=Z),B=M>>>16,S=65535&(x=z),k=x>>>16,x=r[3],B+=(M=t[3])>>>16,S+=65535&x,k+=x>>>16,k+=(S+=(B+=(m+=65535&M)>>>16)>>>16)>>>16,r[3]=z=65535&S|k<<16,t[3]=Z=65535&m|B<<16,m=65535&(M=q),B=M>>>16,S=65535&(x=O),k=x>>>16,x=r[4],B+=(M=t[4])>>>16,S+=65535&x,k+=x>>>16,k+=(S+=(B+=(m+=65535&M)>>>16)>>>16)>>>16,r[4]=O=65535&S|k<<16,t[4]=q=65535&m|B<<16,m=65535&(M=D),B=M>>>16,S=65535&(x=P),k=x>>>16,x=r[5],B+=(M=t[5])>>>16,S+=65535&x,k+=x>>>16,k+=(S+=(B+=(m+=65535&M)>>>16)>>>16)>>>16,r[5]=P=65535&S|k<<16,t[5]=D=65535&m|B<<16,m=65535&(M=G),B=M>>>16,S=65535&(x=C),k=x>>>16,x=r[6],B+=(M=t[6])>>>16,S+=65535&x,k+=x>>>16,k+=(S+=(B+=(m+=65535&M)>>>16)>>>16)>>>16,r[6]=C=65535&S|k<<16,t[6]=G=65535&m|B<<16,m=65535&(M=V),B=M>>>16,S=65535&(x=N),k=x>>>16,x=r[7],B+=(M=t[7])>>>16,S+=65535&x,k+=x>>>16,k+=(S+=(B+=(m+=65535&M)>>>16)>>>16)>>>16,r[7]=N=65535&S|k<<16,t[7]=V=65535&m|B<<16,X+=128,e-=128}return e}function W(r,t,n){var e,o=new Int32Array(8),i=new Int32Array(8),h=new Uint8Array(256),a=n;for(o[0]=1779033703,o[1]=3144134277,o[2]=1013904242,o[3]=2773480762,o[4]=1359893119,o[5]=2600822924,o[6]=528734635,o[7]=1541459225,i[0]=4089235720,i[1]=2227873595,i[2]=4271175723,i[3]=1595750129,i[4]=2917565137,i[5]=725511199,i[6]=4215389547,i[7]=327033209,Q(o,i,t,n),n%=128,e=0;e<n;e++)h[e]=t[a-n+e];for(h[n]=128,h[(n=256-128*(n<112?1:0))-9]=0,v(h,n-8,a/536870912|0,a<<3),Q(o,i,h,n),e=0;e<8;e++)v(r,8*e,o[e],i[e]);return 0}function $(r,t){var e=n(),o=n(),i=n(),h=n(),a=n(),f=n(),s=n(),u=n(),y=n();N(e,r[1],r[0]),N(y,t[1],t[0]),F(e,e,y),C(o,r[0],r[1]),C(y,t[0],t[1]),F(o,o,y),F(i,r[3],t[3]),F(i,i,c),F(h,r[2],t[2]),C(h,h,h),N(a,o,e),N(f,h,i),C(s,h,i),C(u,o,e),F(r[0],a,f),F(r[1],u,s),F(r[2],s,f),F(r[3],a,u)}function rr(r,t,n){var e;for(e=0;e<4;e++)T(r[e],t[e],n)}function tr(r,t){var e=n(),o=n(),i=n();I(i,t[2]),F(e,t[0],i),F(o,t[1],i),R(r,o),r[31]^=O(e)<<7}function nr(r,t,n){var e,o;for(Y(r[0],a),Y(r[1],f),Y(r[2],f),Y(r[3],a),o=255;o>=0;--o)rr(r,t,e=n[o/8|0]>>(7&o)&1),$(t,r),$(r,r),rr(r,t,e)}function er(r,t){var e=[n(),n(),n(),n()];Y(e[0],y),Y(e[1],l),Y(e[2],f),F(e[3],y,l),nr(r,e,t)}function or(r,t,o){var i,h=new Uint8Array(64),a=[n(),n(),n(),n()];for(o||e(t,32),W(h,t,32),h[0]&=248,h[31]&=127,h[31]|=64,er(a,h),tr(r,a),i=0;i<32;i++)t[i+32]=r[i];return 0}var ir=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function hr(r,t){var n,e,o,i;for(e=63;e>=32;--e){for(n=0,o=e-32,i=e-12;o<i;++o)t[o]+=n-16*t[e]*ir[o-(e-32)],n=Math.floor((t[o]+128)/256),t[o]-=256*n;t[o]+=n,t[e]=0}for(n=0,o=0;o<32;o++)t[o]+=n-(t[31]>>4)*ir[o],n=t[o]>>8,t[o]&=255;for(o=0;o<32;o++)t[o]-=n*ir[o];for(e=0;e<32;e++)t[e+1]+=t[e]>>8,r[e]=255&t[e]}function ar(r){var t,n=new Float64Array(64);for(t=0;t<64;t++)n[t]=r[t];for(t=0;t<64;t++)r[t]=0;hr(r,n)}function fr(r,t,e,o){var i,h,a=new Uint8Array(64),f=new Uint8Array(64),s=new Uint8Array(64),u=new Float64Array(64),c=[n(),n(),n(),n()];W(a,o,32),a[0]&=248,a[31]&=127,a[31]|=64;var y=e+64;for(i=0;i<e;i++)r[64+i]=t[i];for(i=0;i<32;i++)r[32+i]=a[32+i];for(W(s,r.subarray(32),e+32),ar(s),er(c,s),tr(r,c),i=32;i<64;i++)r[i]=o[i];for(W(f,r,e+64),ar(f),i=0;i<64;i++)u[i]=0;for(i=0;i<32;i++)u[i]=s[i];for(i=0;i<32;i++)for(h=0;h<32;h++)u[i+h]+=f[i]*a[h];return hr(r.subarray(32),u),y}function sr(r,t,e,o){var i,h=new Uint8Array(32),s=new Uint8Array(64),c=[n(),n(),n(),n()],y=[n(),n(),n(),n()];if(e<64)return-1;if(function(r,t){var e=n(),o=n(),i=n(),h=n(),s=n(),c=n(),y=n();return Y(r[2],f),P(r[1],t),j(i,r[1]),F(h,i,u),N(i,i,r[2]),C(h,r[2],h),j(s,h),j(c,s),F(y,c,s),F(e,y,i),F(e,e,h),Z(e,e),F(e,e,i),F(e,e,h),F(e,e,h),F(r[0],e,h),j(o,r[0]),F(o,o,h),z(o,i)&&F(r[0],r[0],p),j(o,r[0]),F(o,o,h),z(o,i)?-1:(O(r[0])===t[31]>>7&&N(r[0],a,r[0]),F(r[3],r[0],r[1]),0)}(y,o))return-1;for(i=0;i<e;i++)r[i]=t[i];for(i=0;i<32;i++)r[i+32]=o[i];if(W(s,r,e),ar(s),nr(c,y,s),er(y,t.subarray(32)),$(c,y),tr(h,c),e-=64,g(t,0,h,0)){for(i=0;i<e;i++)r[i]=0;return-1}for(i=0;i<e;i++)r[i]=t[i+64];return e}var ur,cr=32,yr=24,lr=16,pr=32,vr=32,wr=yr,br=64,gr=32,_r=64;function Ar(r,t){if(r.length!==cr)throw new Error("bad key size");if(t.length!==yr)throw new Error("bad nonce size")}function dr(){for(var r=0;r<arguments.length;r++)if(!(arguments[r]instanceof Uint8Array))throw new TypeError("unexpected type, use Uint8Array")}function Ur(r){for(var t=0;t<r.length;t++)r[t]=0}r.lowlevel={crypto_core_hsalsa20:A,crypto_stream_xor:M,crypto_stream:x,crypto_stream_salsa20_xor:U,crypto_stream_salsa20:E,crypto_onetimeauth:B,crypto_onetimeauth_verify:S,crypto_verify_16:b,crypto_verify_32:g,crypto_secretbox:k,crypto_secretbox_open:K,crypto_scalarmult:q,crypto_scalarmult_base:D,crypto_box_beforenm:V,crypto_box_afternm:X,crypto_box:function(r,t,n,e,o,i){var h=new Uint8Array(32);return V(h,o,i),X(r,t,n,e,h)},crypto_box_open:function(r,t,n,e,o,i){var h=new Uint8Array(32);return V(h,o,i),H(r,t,n,e,h)},crypto_box_keypair:G,crypto_hash:W,crypto_sign:fr,crypto_sign_keypair:or,crypto_sign_open:sr,crypto_secretbox_KEYBYTES:cr,crypto_secretbox_NONCEBYTES:yr,crypto_secretbox_ZEROBYTES:32,crypto_secretbox_BOXZEROBYTES:lr,crypto_scalarmult_BYTES:32,crypto_scalarmult_SCALARBYTES:32,crypto_box_PUBLICKEYBYTES:pr,crypto_box_SECRETKEYBYTES:vr,crypto_box_BEFORENMBYTES:32,crypto_box_NONCEBYTES:wr,crypto_box_ZEROBYTES:32,crypto_box_BOXZEROBYTES:16,crypto_sign_BYTES:br,crypto_sign_PUBLICKEYBYTES:gr,crypto_sign_SECRETKEYBYTES:_r,crypto_sign_SEEDBYTES:32,crypto_hash_BYTES:64,gf:n,D:u,L:ir,pack25519:R,unpack25519:P,M:F,A:C,S:j,Z:N,pow2523:Z,add:$,set25519:Y,modL:hr,scalarmult:nr,scalarbase:er},r.randomBytes=function(r){var t=new Uint8Array(r);return e(t,r),t},r.secretbox=function(r,t,n){dr(r,t,n),Ar(n,t);for(var e=new Uint8Array(32+r.length),o=new Uint8Array(e.length),i=0;i<r.length;i++)e[i+32]=r[i];return k(o,e,e.length,t,n),o.subarray(lr)},r.secretbox.open=function(r,t,n){dr(r,t,n),Ar(n,t);for(var e=new Uint8Array(lr+r.length),o=new Uint8Array(e.length),i=0;i<r.length;i++)e[i+lr]=r[i];return e.length<32||0!==K(o,e,e.length,t,n)?null:o.subarray(32)},r.secretbox.keyLength=cr,r.secretbox.nonceLength=yr,r.secretbox.overheadLength=lr,r.scalarMult=function(r,t){if(dr(r,t),32!==r.length)throw new Error("bad n size");if(32!==t.length)throw new Error("bad p size");var n=new Uint8Array(32);return q(n,r,t),n},r.scalarMult.base=function(r){if(dr(r),32!==r.length)throw new Error("bad n size");var t=new Uint8Array(32);return D(t,r),t},r.scalarMult.scalarLength=32,r.scalarMult.groupElementLength=32,r.box=function(t,n,e,o){var i=r.box.before(e,o);return r.secretbox(t,n,i)},r.box.before=function(r,t){dr(r,t),function(r,t){if(r.length!==pr)throw new Error("bad public key size");if(t.length!==vr)throw new Error("bad secret key size")}(r,t);var n=new Uint8Array(32);return V(n,r,t),n},r.box.after=r.secretbox,r.box.open=function(t,n,e,o){var i=r.box.before(e,o);return r.secretbox.open(t,n,i)},r.box.open.after=r.secretbox.open,r.box.keyPair=function(){var r=new Uint8Array(pr),t=new Uint8Array(vr);return G(r,t),{publicKey:r,secretKey:t}},r.box.keyPair.fromSecretKey=function(r){if(dr(r),r.length!==vr)throw new Error("bad secret key size");var t=new Uint8Array(pr);return D(t,r),{publicKey:t,secretKey:new Uint8Array(r)}},r.box.publicKeyLength=pr,r.box.secretKeyLength=vr,r.box.sharedKeyLength=32,r.box.nonceLength=wr,r.box.overheadLength=r.secretbox.overheadLength,r.sign=function(r,t){if(dr(r,t),t.length!==_r)throw new Error("bad secret key size");var n=new Uint8Array(br+r.length);return fr(n,r,r.length,t),n},r.sign.open=function(r,t){if(dr(r,t),t.length!==gr)throw new Error("bad public key size");var n=new Uint8Array(r.length),e=sr(n,r,r.length,t);if(e<0)return null;for(var o=new Uint8Array(e),i=0;i<o.length;i++)o[i]=n[i];return o},r.sign.detached=function(t,n){for(var e=r.sign(t,n),o=new Uint8Array(br),i=0;i<o.length;i++)o[i]=e[i];return o},r.sign.detached.verify=function(r,t,n){if(dr(r,t,n),t.length!==br)throw new Error("bad signature size");if(n.length!==gr)throw new Error("bad public key size");var e,o=new Uint8Array(br+r.length),i=new Uint8Array(br+r.length);for(e=0;e<br;e++)o[e]=t[e];for(e=0;e<r.length;e++)o[e+br]=r[e];return sr(i,o,o.length,n)>=0},r.sign.keyPair=function(){var r=new Uint8Array(gr),t=new Uint8Array(_r);return or(r,t),{publicKey:r,secretKey:t}},r.sign.keyPair.fromSecretKey=function(r){if(dr(r),r.length!==_r)throw new Error("bad secret key size");for(var t=new Uint8Array(gr),n=0;n<t.length;n++)t[n]=r[32+n];return{publicKey:t,secretKey:new Uint8Array(r)}},r.sign.keyPair.fromSeed=function(r){if(dr(r),32!==r.length)throw new Error("bad seed size");for(var t=new Uint8Array(gr),n=new Uint8Array(_r),e=0;e<32;e++)n[e]=r[e];return or(t,n,!0),{publicKey:t,secretKey:n}},r.sign.publicKeyLength=gr,r.sign.secretKeyLength=_r,r.sign.seedLength=32,r.sign.signatureLength=br,r.hash=function(r){dr(r);var t=new Uint8Array(64);return W(t,r,r.length),t},r.hash.hashLength=64,r.verify=function(r,t){return dr(r,t),0!==r.length&&0!==t.length&&r.length===t.length&&0===w(r,0,t,0,r.length)},r.setPRNG=function(r){e=r},(ur="undefined"!=typeof self?self.crypto||self.msCrypto:null)&&ur.getRandomValues?r.setPRNG((function(r,t){var n,e=new Uint8Array(t);for(n=0;n<t;n+=65536)ur.getRandomValues(e.subarray(n,n+Math.min(t-n,65536)));for(n=0;n<t;n++)r[n]=e[n];Ur(e)})):void 0!==t&&(ur=i)&&ur.randomBytes&&r.setPRNG((function(r,t){var n,e=ur.randomBytes(t);for(n=0;n<t;n++)r[n]=e[n];Ur(e)}))})((n=o).exports?n.exports:self.nacl=self.nacl||{});var h=e;export{h as default};