UNPKG

@sisi/tweetnacl-blake2b

Version:

Forked of dvdbng/tweetnacl-blake2b-js. Using 'var' instead of 'const'

1 lines 30.9 kB
var nacl=function(r){function t(e){if(n[e])return n[e].exports;var o=n[e]={i:e,l:!1,exports:{}};return r[e].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=r,t.c=n,t.d=function(r,n,e){t.o(r,n)||Object.defineProperty(r,n,{configurable:!1,enumerable:!0,get:e})},t.n=function(r){var n=r&&r.__esModule?function(){return r.default}:function(){return r};return t.d(n,"a",n),n},t.o=function(r,t){return Object.prototype.hasOwnProperty.call(r,t)},t.p="",t(t.s=0)}([function(r,t,n){var e=n(1);!function(r){"use strict";function t(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 o(r,n,e,o){return t(r,n,e,o,16)}function i(r,n,e,o){return t(r,n,e,o,32)}function h(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,l=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,y=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,A=255&n[28]|(255&n[29])<<8|(255&n[30])<<16|(255&n[31])<<24,U=255&e[12]|(255&e[13])<<8|(255&e[14])<<16|(255&e[15])<<24,_=i,d=h,E=a,x=f,M=s,m=u,B=c,S=l,k=y,T=p,K=v,Y=w,L=b,z=g,P=A,R=U,C=0;C<20;C+=2)o=_+L|0,M^=o<<7|o>>>25,o=M+_|0,k^=o<<9|o>>>23,o=k+M|0,L^=o<<13|o>>>19,o=L+k|0,_^=o<<18|o>>>14,o=m+d|0,T^=o<<7|o>>>25,o=T+m|0,z^=o<<9|o>>>23,o=z+T|0,d^=o<<13|o>>>19,o=d+z|0,m^=o<<18|o>>>14,o=K+B|0,P^=o<<7|o>>>25,o=P+K|0,E^=o<<9|o>>>23,o=E+P|0,B^=o<<13|o>>>19,o=B+E|0,K^=o<<18|o>>>14,o=R+Y|0,x^=o<<7|o>>>25,o=x+R|0,S^=o<<9|o>>>23,o=S+x|0,Y^=o<<13|o>>>19,o=Y+S|0,R^=o<<18|o>>>14,o=_+x|0,d^=o<<7|o>>>25,o=d+_|0,E^=o<<9|o>>>23,o=E+d|0,x^=o<<13|o>>>19,o=x+E|0,_^=o<<18|o>>>14,o=m+M|0,B^=o<<7|o>>>25,o=B+m|0,S^=o<<9|o>>>23,o=S+B|0,M^=o<<13|o>>>19,o=M+S|0,m^=o<<18|o>>>14,o=K+T|0,Y^=o<<7|o>>>25,o=Y+K|0,k^=o<<9|o>>>23,o=k+Y|0,T^=o<<13|o>>>19,o=T+k|0,K^=o<<18|o>>>14,o=R+P|0,L^=o<<7|o>>>25,o=L+R|0,z^=o<<9|o>>>23,o=z+L|0,P^=o<<13|o>>>19,o=P+z|0,R^=o<<18|o>>>14;_=_+i|0,d=d+h|0,E=E+a|0,x=x+f|0,M=M+s|0,m=m+u|0,B=B+c|0,S=S+l|0,k=k+y|0,T=T+p|0,K=K+v|0,Y=Y+w|0,L=L+b|0,z=z+g|0,P=P+A|0,R=R+U|0,r[0]=_>>>0&255,r[1]=_>>>8&255,r[2]=_>>>16&255,r[3]=_>>>24&255,r[4]=d>>>0&255,r[5]=d>>>8&255,r[6]=d>>>16&255,r[7]=d>>>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]=T>>>0&255,r[37]=T>>>8&255,r[38]=T>>>16&255,r[39]=T>>>24&255,r[40]=K>>>0&255,r[41]=K>>>8&255,r[42]=K>>>16&255,r[43]=K>>>24&255,r[44]=Y>>>0&255,r[45]=Y>>>8&255,r[46]=Y>>>16&255,r[47]=Y>>>24&255,r[48]=L>>>0&255,r[49]=L>>>8&255,r[50]=L>>>16&255,r[51]=L>>>24&255,r[52]=z>>>0&255,r[53]=z>>>8&255,r[54]=z>>>16&255,r[55]=z>>>24&255,r[56]=P>>>0&255,r[57]=P>>>8&255,r[58]=P>>>16&255,r[59]=P>>>24&255,r[60]=R>>>0&255,r[61]=R>>>8&255,r[62]=R>>>16&255,r[63]=R>>>24&255}function a(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,l=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,y=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,A=255&n[28]|(255&n[29])<<8|(255&n[30])<<16|(255&n[31])<<24,U=255&e[12]|(255&e[13])<<8|(255&e[14])<<16|(255&e[15])<<24,_=i,d=h,E=a,x=f,M=s,m=u,B=c,S=l,k=y,T=p,K=v,Y=w,L=b,z=g,P=A,R=U,C=0;C<20;C+=2)o=_+L|0,M^=o<<7|o>>>25,o=M+_|0,k^=o<<9|o>>>23,o=k+M|0,L^=o<<13|o>>>19,o=L+k|0,_^=o<<18|o>>>14,o=m+d|0,T^=o<<7|o>>>25,o=T+m|0,z^=o<<9|o>>>23,o=z+T|0,d^=o<<13|o>>>19,o=d+z|0,m^=o<<18|o>>>14,o=K+B|0,P^=o<<7|o>>>25,o=P+K|0,E^=o<<9|o>>>23,o=E+P|0,B^=o<<13|o>>>19,o=B+E|0,K^=o<<18|o>>>14,o=R+Y|0,x^=o<<7|o>>>25,o=x+R|0,S^=o<<9|o>>>23,o=S+x|0,Y^=o<<13|o>>>19,o=Y+S|0,R^=o<<18|o>>>14,o=_+x|0,d^=o<<7|o>>>25,o=d+_|0,E^=o<<9|o>>>23,o=E+d|0,x^=o<<13|o>>>19,o=x+E|0,_^=o<<18|o>>>14,o=m+M|0,B^=o<<7|o>>>25,o=B+m|0,S^=o<<9|o>>>23,o=S+B|0,M^=o<<13|o>>>19,o=M+S|0,m^=o<<18|o>>>14,o=K+T|0,Y^=o<<7|o>>>25,o=Y+K|0,k^=o<<9|o>>>23,o=k+Y|0,T^=o<<13|o>>>19,o=T+k|0,K^=o<<18|o>>>14,o=R+P|0,L^=o<<7|o>>>25,o=L+R|0,z^=o<<9|o>>>23,o=z+L|0,P^=o<<13|o>>>19,o=P+z|0,R^=o<<18|o>>>14;r[0]=_>>>0&255,r[1]=_>>>8&255,r[2]=_>>>16&255,r[3]=_>>>24&255,r[4]=m>>>0&255,r[5]=m>>>8&255,r[6]=m>>>16&255,r[7]=m>>>24&255,r[8]=K>>>0&255,r[9]=K>>>8&255,r[10]=K>>>16&255,r[11]=K>>>24&255,r[12]=R>>>0&255,r[13]=R>>>8&255,r[14]=R>>>16&255,r[15]=R>>>24&255,r[16]=B>>>0&255,r[17]=B>>>8&255,r[18]=B>>>16&255,r[19]=B>>>24&255,r[20]=S>>>0&255,r[21]=S>>>8&255,r[22]=S>>>16&255,r[23]=S>>>24&255,r[24]=k>>>0&255,r[25]=k>>>8&255,r[26]=k>>>16&255,r[27]=k>>>24&255,r[28]=T>>>0&255,r[29]=T>>>8&255,r[30]=T>>>16&255,r[31]=T>>>24&255}function f(r,t,n,e){h(r,t,n,e)}function s(r,t,n,e){a(r,t,n,e)}function u(r,t,n,e,o,i,h){var a,s,u=new Uint8Array(16),c=new Uint8Array(64);for(s=0;s<16;s++)u[s]=0;for(s=0;s<8;s++)u[s]=i[s];for(;o>=64;){for(f(c,u,h,cr),s=0;s<64;s++)r[t+s]=n[e+s]^c[s];for(a=1,s=8;s<16;s++)a=a+(255&u[s])|0,u[s]=255&a,a>>>=8;o-=64,t+=64,e+=64}if(o>0)for(f(c,u,h,cr),s=0;s<o;s++)r[t+s]=n[e+s]^c[s];return 0}function c(r,t,n,e,o){var i,h,a=new Uint8Array(16),s=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(s,a,o,cr),h=0;h<64;h++)r[t+h]=s[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(s,a,o,cr),h=0;h<n;h++)r[t+h]=s[h];return 0}function l(r,t,n,e,o){var i=new Uint8Array(32);s(i,e,o,cr);for(var h=new Uint8Array(8),a=0;a<8;a++)h[a]=e[a+16];return c(r,t,n,h,i)}function y(r,t,n,e,o,i,h){var a=new Uint8Array(32);s(a,i,h,cr);for(var f=new Uint8Array(8),c=0;c<8;c++)f[c]=i[c+16];return u(r,t,n,e,o,f,a)}function p(r,t,n,e,o,i){var h=new lr(i);return h.update(n,e,o),h.finish(r,t),0}function v(r,t,n,e,i,h){var a=new Uint8Array(16);return p(a,0,n,e,i,h),o(r,t,a,0)}function w(r,t,n,e,o){var i;if(n<32)return-1;for(y(r,0,t,0,n,e,o),p(r,16,r,32,n-32,r),i=0;i<16;i++)r[i]=0;return 0}function b(r,t,n,e,o){var i,h=new Uint8Array(32);if(n<32)return-1;if(l(h,0,32,e,o),0!==v(t,16,t,32,n-32,h))return-1;for(y(r,0,t,0,n,e,o),i=0;i<32;i++)r[i]=0;return 0}function g(r,t){var n;for(n=0;n<16;n++)r[n]=0|t[n]}function A(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 U(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,t){var n,e,o,i=$(),h=$();for(n=0;n<16;n++)h[n]=t[n];for(A(h),A(h),A(h),e=0;e<2;e++){for(i[0]=h[0]-65517,n=1;n<15;n++)i[n]=h[n]-65535-(i[n-1]>>16&1),i[n-1]&=65535;i[15]=h[15]-32767-(i[14]>>16&1),o=i[15]>>16&1,i[14]&=65535,U(h,i,1-o)}for(n=0;n<16;n++)r[2*n]=255&h[n],r[2*n+1]=h[n]>>8}function d(r,t){var n=new Uint8Array(32),e=new Uint8Array(32);return _(n,r),_(e,t),i(n,0,e,0)}function E(r){var t=new Uint8Array(32);return _(t,r),1&t[0]}function x(r,t){var n;for(n=0;n<16;n++)r[n]=t[2*n]+(t[2*n+1]<<8);r[15]&=32767}function M(r,t,n){for(var e=0;e<16;e++)r[e]=t[e]+n[e]}function m(r,t,n){for(var e=0;e<16;e++)r[e]=t[e]-n[e]}function B(r,t,n){var e,o,i=0,h=0,a=0,f=0,s=0,u=0,c=0,l=0,y=0,p=0,v=0,w=0,b=0,g=0,A=0,U=0,_=0,d=0,E=0,x=0,M=0,m=0,B=0,S=0,k=0,T=0,K=0,Y=0,L=0,z=0,P=0,R=n[0],C=n[1],O=n[2],N=n[3],I=n[4],F=n[5],D=n[6],G=n[7],j=n[8],H=n[9],Z=n[10],V=n[11],X=n[12],q=n[13],J=n[14],Q=n[15];e=t[0],i+=e*R,h+=e*C,a+=e*O,f+=e*N,s+=e*I,u+=e*F,c+=e*D,l+=e*G,y+=e*j,p+=e*H,v+=e*Z,w+=e*V,b+=e*X,g+=e*q,A+=e*J,U+=e*Q,e=t[1],h+=e*R,a+=e*C,f+=e*O,s+=e*N,u+=e*I,c+=e*F,l+=e*D,y+=e*G,p+=e*j,v+=e*H,w+=e*Z,b+=e*V,g+=e*X,A+=e*q,U+=e*J,_+=e*Q,e=t[2],a+=e*R,f+=e*C,s+=e*O,u+=e*N,c+=e*I,l+=e*F,y+=e*D,p+=e*G,v+=e*j,w+=e*H,b+=e*Z,g+=e*V,A+=e*X,U+=e*q,_+=e*J,d+=e*Q,e=t[3],f+=e*R,s+=e*C,u+=e*O,c+=e*N,l+=e*I,y+=e*F,p+=e*D,v+=e*G,w+=e*j,b+=e*H,g+=e*Z,A+=e*V,U+=e*X,_+=e*q,d+=e*J,E+=e*Q,e=t[4],s+=e*R,u+=e*C,c+=e*O,l+=e*N,y+=e*I,p+=e*F,v+=e*D,w+=e*G,b+=e*j,g+=e*H,A+=e*Z,U+=e*V,_+=e*X,d+=e*q,E+=e*J,x+=e*Q,e=t[5],u+=e*R,c+=e*C,l+=e*O,y+=e*N,p+=e*I,v+=e*F,w+=e*D,b+=e*G,g+=e*j,A+=e*H,U+=e*Z,_+=e*V,d+=e*X,E+=e*q,x+=e*J,M+=e*Q,e=t[6],c+=e*R,l+=e*C,y+=e*O,p+=e*N,v+=e*I,w+=e*F,b+=e*D,g+=e*G,A+=e*j,U+=e*H,_+=e*Z,d+=e*V,E+=e*X,x+=e*q,M+=e*J,m+=e*Q,e=t[7],l+=e*R,y+=e*C,p+=e*O,v+=e*N,w+=e*I,b+=e*F,g+=e*D,A+=e*G,U+=e*j,_+=e*H,d+=e*Z,E+=e*V,x+=e*X,M+=e*q,m+=e*J,B+=e*Q,e=t[8],y+=e*R,p+=e*C,v+=e*O,w+=e*N,b+=e*I,g+=e*F,A+=e*D,U+=e*G,_+=e*j,d+=e*H,E+=e*Z,x+=e*V,M+=e*X,m+=e*q,B+=e*J,S+=e*Q,e=t[9],p+=e*R,v+=e*C,w+=e*O,b+=e*N,g+=e*I,A+=e*F,U+=e*D,_+=e*G,d+=e*j,E+=e*H,x+=e*Z,M+=e*V,m+=e*X,B+=e*q,S+=e*J,k+=e*Q,e=t[10],v+=e*R,w+=e*C,b+=e*O,g+=e*N,A+=e*I,U+=e*F,_+=e*D,d+=e*G,E+=e*j,x+=e*H,M+=e*Z,m+=e*V,B+=e*X,S+=e*q,k+=e*J,T+=e*Q,e=t[11],w+=e*R,b+=e*C,g+=e*O,A+=e*N,U+=e*I,_+=e*F,d+=e*D,E+=e*G,x+=e*j,M+=e*H,m+=e*Z,B+=e*V;S+=e*X,k+=e*q,T+=e*J,K+=e*Q,e=t[12],b+=e*R,g+=e*C,A+=e*O,U+=e*N,_+=e*I,d+=e*F,E+=e*D,x+=e*G,M+=e*j,m+=e*H,B+=e*Z,S+=e*V,k+=e*X,T+=e*q,K+=e*J,Y+=e*Q,e=t[13],g+=e*R,A+=e*C,U+=e*O,_+=e*N,d+=e*I,E+=e*F,x+=e*D,M+=e*G,m+=e*j,B+=e*H,S+=e*Z,k+=e*V,T+=e*X,K+=e*q,Y+=e*J,L+=e*Q,e=t[14],A+=e*R,U+=e*C,_+=e*O,d+=e*N,E+=e*I,x+=e*F,M+=e*D,m+=e*G,B+=e*j,S+=e*H,k+=e*Z,T+=e*V,K+=e*X,Y+=e*q,L+=e*J,z+=e*Q,e=t[15],U+=e*R,_+=e*C,d+=e*O,E+=e*N,x+=e*I,M+=e*F,m+=e*D,B+=e*G,S+=e*j,k+=e*H,T+=e*Z,K+=e*V,Y+=e*X,L+=e*q,z+=e*J,P+=e*Q,i+=38*_,h+=38*d,a+=38*E,f+=38*x,s+=38*M,u+=38*m,c+=38*B,l+=38*S,y+=38*k,p+=38*T,v+=38*K,w+=38*Y,b+=38*L,g+=38*z,A+=38*P,o=1,e=i+o+65535,o=Math.floor(e/65536),i=e-65536*o,e=h+o+65535,o=Math.floor(e/65536),h=e-65536*o,e=a+o+65535,o=Math.floor(e/65536),a=e-65536*o,e=f+o+65535,o=Math.floor(e/65536),f=e-65536*o,e=s+o+65535,o=Math.floor(e/65536),s=e-65536*o,e=u+o+65535,o=Math.floor(e/65536),u=e-65536*o,e=c+o+65535,o=Math.floor(e/65536),c=e-65536*o,e=l+o+65535,o=Math.floor(e/65536),l=e-65536*o,e=y+o+65535,o=Math.floor(e/65536),y=e-65536*o,e=p+o+65535,o=Math.floor(e/65536),p=e-65536*o,e=v+o+65535,o=Math.floor(e/65536),v=e-65536*o,e=w+o+65535,o=Math.floor(e/65536),w=e-65536*o,e=b+o+65535,o=Math.floor(e/65536),b=e-65536*o,e=g+o+65535,o=Math.floor(e/65536),g=e-65536*o,e=A+o+65535,o=Math.floor(e/65536),A=e-65536*o,e=U+o+65535,o=Math.floor(e/65536),U=e-65536*o,i+=o-1+37*(o-1),o=1,e=i+o+65535,o=Math.floor(e/65536),i=e-65536*o,e=h+o+65535,o=Math.floor(e/65536),h=e-65536*o,e=a+o+65535,o=Math.floor(e/65536),a=e-65536*o,e=f+o+65535,o=Math.floor(e/65536),f=e-65536*o,e=s+o+65535,o=Math.floor(e/65536),s=e-65536*o,e=u+o+65535,o=Math.floor(e/65536),u=e-65536*o,e=c+o+65535,o=Math.floor(e/65536),c=e-65536*o,e=l+o+65535,o=Math.floor(e/65536),l=e-65536*o,e=y+o+65535,o=Math.floor(e/65536),y=e-65536*o,e=p+o+65535,o=Math.floor(e/65536),p=e-65536*o,e=v+o+65535,o=Math.floor(e/65536),v=e-65536*o,e=w+o+65535,o=Math.floor(e/65536),w=e-65536*o,e=b+o+65535,o=Math.floor(e/65536),b=e-65536*o,e=g+o+65535,o=Math.floor(e/65536),g=e-65536*o,e=A+o+65535,o=Math.floor(e/65536),A=e-65536*o,e=U+o+65535,o=Math.floor(e/65536),U=e-65536*o,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]=l,r[8]=y,r[9]=p,r[10]=v,r[11]=w,r[12]=b;r[13]=g,r[14]=A,r[15]=U}function S(r,t){B(r,t,t)}function k(r,t){var n,e=$();for(n=0;n<16;n++)e[n]=t[n];for(n=253;n>=0;n--)S(e,e),2!==n&&4!==n&&B(e,e,t);for(n=0;n<16;n++)r[n]=e[n]}function T(r,t){var n,e=$();for(n=0;n<16;n++)e[n]=t[n];for(n=250;n>=0;n--)S(e,e),1!==n&&B(e,e,t);for(n=0;n<16;n++)r[n]=e[n]}function K(r,t,n){var e,o,i=new Uint8Array(32),h=new Float64Array(80),a=$(),f=$(),s=$(),u=$(),c=$(),l=$();for(o=0;o<31;o++)i[o]=t[o];for(i[31]=127&t[31]|64,i[0]&=248,x(h,n),o=0;o<16;o++)f[o]=h[o],u[o]=a[o]=s[o]=0;for(a[0]=u[0]=1,o=254;o>=0;--o)e=i[o>>>3]>>>(7&o)&1,U(a,f,e),U(s,u,e),M(c,a,s),m(a,a,s),M(s,f,u),m(f,f,u),S(u,c),S(l,a),B(a,s,a),B(s,f,c),M(c,a,s),m(a,a,s),S(f,a),m(s,u,l),B(a,s,ir),M(a,a,u),B(s,s,a),B(a,u,l),B(u,f,h),S(f,c),U(a,f,e),U(s,u,e);for(o=0;o<16;o++)h[o+16]=a[o],h[o+32]=s[o],h[o+48]=f[o],h[o+64]=u[o];var y=h.subarray(32),p=h.subarray(16);return k(y,y),B(p,p,y),_(r,p),0}function Y(r,t){return K(r,t,nr)}function L(r,t){return rr(t,32),Y(r,t)}function z(r,t,n){var e=new Uint8Array(32);return K(e,n,t),s(r,tr,e,cr)}function P(r,t,n,e,o,i){var h=new Uint8Array(32);return z(h,o,i),yr(r,t,n,e,h)}function R(r,t,n,e,o,i){var h=new Uint8Array(32);return z(h,o,i),pr(r,t,n,e,h)}function C(r,t,n){var o,i=new Uint8Array(n);for(o=0;o<n;++o)i[o]=t[o];var h=e.blake2b(i);for(o=0;o<_r;++o)r[o]=h[o];return 0}function O(r,t){var n=$(),e=$(),o=$(),i=$(),h=$(),a=$(),f=$(),s=$(),u=$();m(n,r[1],r[0]),m(u,t[1],t[0]),B(n,n,u),M(e,r[0],r[1]),M(u,t[0],t[1]),B(e,e,u),B(o,r[3],t[3]),B(o,o,ar),B(i,r[2],t[2]),M(i,i,i),m(h,e,n),m(a,i,o),M(f,i,o),M(s,e,n),B(r[0],h,a),B(r[1],s,f),B(r[2],f,a),B(r[3],h,s)}function N(r,t,n){var e;for(e=0;e<4;e++)U(r[e],t[e],n)}function I(r,t){var n=$(),e=$(),o=$();k(o,t[2]),B(n,t[0],o),B(e,t[1],o),_(r,e),r[31]^=E(n)<<7}function F(r,t,n){var e,o;for(g(r[0],er),g(r[1],or),g(r[2],or),g(r[3],er),o=255;o>=0;--o)e=n[o/8|0]>>(7&o)&1,N(r,t,e),O(t,r),O(r,r),N(r,t,e)}function D(r,t){var n=[$(),$(),$(),$()];g(n[0],fr),g(n[1],sr),g(n[2],or),B(n[3],fr,sr),F(r,n,t)}function G(r,t,n){var e,o=new Uint8Array(64),i=[$(),$(),$(),$()];for(n||rr(t,32),C(o,t,32),o[0]&=248,o[31]&=127,o[31]|=64,D(i,o),I(r,i),e=0;e<32;e++)t[e+32]=r[e];return 0}function j(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]*vr[o-(e-32)],n=t[o]+128>>8,t[o]-=256*n;t[o]+=n,t[e]=0}for(n=0,o=0;o<32;o++)t[o]+=n-(t[31]>>4)*vr[o],n=t[o]>>8,t[o]&=255;for(o=0;o<32;o++)t[o]-=n*vr[o];for(e=0;e<32;e++)t[e+1]+=t[e]>>8,r[e]=255&t[e]}function H(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;j(r,n)}function Z(r,t,n,e){var o,i,h=new Uint8Array(64),a=new Uint8Array(64),f=new Uint8Array(64),s=new Float64Array(64),u=[$(),$(),$(),$()];C(h,e,32),h[0]&=248,h[31]&=127,h[31]|=64;var c=n+64;for(o=0;o<n;o++)r[64+o]=t[o];for(o=0;o<32;o++)r[32+o]=h[32+o];for(C(f,r.subarray(32),n+32),H(f),D(u,f),I(r,u),o=32;o<64;o++)r[o]=e[o];for(C(a,r,n+64),H(a),o=0;o<64;o++)s[o]=0;for(o=0;o<32;o++)s[o]=f[o];for(o=0;o<32;o++)for(i=0;i<32;i++)s[o+i]+=a[o]*h[i];return j(r.subarray(32),s),c}function V(r,t){var n=$(),e=$(),o=$(),i=$(),h=$(),a=$(),f=$();return g(r[2],or),x(r[1],t),S(o,r[1]),B(i,o,hr),m(o,o,r[2]),M(i,r[2],i),S(h,i),S(a,h),B(f,a,h),B(n,f,o),B(n,n,i),T(n,n),B(n,n,o),B(n,n,i),B(n,n,i),B(r[0],n,i),S(e,r[0]),B(e,e,i),d(e,o)&&B(r[0],r[0],ur),S(e,r[0]),B(e,e,i),d(e,o)?-1:(E(r[0])===t[31]>>7&&m(r[0],er,r[0]),B(r[3],r[0],r[1]),0)}function X(r,t,n,e){var o,h=new Uint8Array(32),a=new Uint8Array(64),f=[$(),$(),$(),$()],s=[$(),$(),$(),$()];if(-1,n<64)return-1;if(V(s,e))return-1;for(o=0;o<n;o++)r[o]=t[o];for(o=0;o<32;o++)r[o+32]=e[o];if(C(a,r,n),H(a),F(f,s,a),D(s,t.subarray(32)),O(f,s),I(h,f),n-=64,i(t,0,h,0)){for(o=0;o<n;o++)r[o]=0;return-1}for(o=0;o<n;o++)r[o]=t[o+64];return n}function q(r,t){if(r.length!==wr)throw new Error("bad key size");if(t.length!==br)throw new Error("bad nonce size")}function J(r,t){if(r.length!==gr)throw new Error("bad public key size");if(t.length!==Ar)throw new Error("bad secret key size")}function Q(){for(var r=0;r<arguments.length;r++)if(!(arguments[r]instanceof Uint8Array))throw new TypeError("unexpected type, use Uint8Array")}function W(r){for(var t=0;t<r.length;t++)r[t]=0}var $=function(r){var t,n=new Float64Array(16);if(r)for(t=0;t<r.length;t++)n[t]=r[t];return n},rr=function(){throw new Error("no PRNG")},tr=new Uint8Array(16),nr=new Uint8Array(32);nr[0]=9;var er=$(),or=$([1]),ir=$([56129,1]),hr=$([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),ar=$([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),fr=$([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),sr=$([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),ur=$([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]),cr=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]),lr=function(r){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;var t,n,e,o,i,h,a,f;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};lr.prototype.blocks=function(r,t,n){for(var e,o,i,h,a,f,s,u,c,l,y,p,v,w,b,g,A,U,_,d=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],T=this.h[7],K=this.h[8],Y=this.h[9],L=this.r[0],z=this.r[1],P=this.r[2],R=this.r[3],C=this.r[4],O=this.r[5],N=this.r[6],I=this.r[7],F=this.r[8],D=this.r[9];n>=16;)e=255&r[t+0]|(255&r[t+1])<<8,E+=8191&e,o=255&r[t+2]|(255&r[t+3])<<8,x+=8191&(e>>>13|o<<3),i=255&r[t+4]|(255&r[t+5])<<8,M+=8191&(o>>>10|i<<6),h=255&r[t+6]|(255&r[t+7])<<8,m+=8191&(i>>>7|h<<9),a=255&r[t+8]|(255&r[t+9])<<8,B+=8191&(h>>>4|a<<12),S+=a>>>1&8191,f=255&r[t+10]|(255&r[t+11])<<8,k+=8191&(a>>>14|f<<2),s=255&r[t+12]|(255&r[t+13])<<8,T+=8191&(f>>>11|s<<5),u=255&r[t+14]|(255&r[t+15])<<8,K+=8191&(s>>>8|u<<8),Y+=u>>>5|d,c=0,l=c,l+=E*L,l+=x*(5*D),l+=M*(5*F),l+=m*(5*I),l+=B*(5*N),c=l>>>13,l&=8191,l+=S*(5*O),l+=k*(5*C),l+=T*(5*R),l+=K*(5*P),l+=Y*(5*z),c+=l>>>13,l&=8191,y=c,y+=E*z,y+=x*L,y+=M*(5*D),y+=m*(5*F),y+=B*(5*I),c=y>>>13,y&=8191,y+=S*(5*N),y+=k*(5*O),y+=T*(5*C),y+=K*(5*R),y+=Y*(5*P),c+=y>>>13,y&=8191,p=c,p+=E*P,p+=x*z,p+=M*L,p+=m*(5*D),p+=B*(5*F),c=p>>>13,p&=8191,p+=S*(5*I),p+=k*(5*N),p+=T*(5*O),p+=K*(5*C),p+=Y*(5*R),c+=p>>>13,p&=8191,v=c,v+=E*R,v+=x*P,v+=M*z,v+=m*L,v+=B*(5*D),c=v>>>13,v&=8191,v+=S*(5*F),v+=k*(5*I),v+=T*(5*N),v+=K*(5*O),v+=Y*(5*C),c+=v>>>13,v&=8191,w=c,w+=E*C,w+=x*R,w+=M*P,w+=m*z,w+=B*L,c=w>>>13,w&=8191,w+=S*(5*D),w+=k*(5*F),w+=T*(5*I),w+=K*(5*N),w+=Y*(5*O),c+=w>>>13,w&=8191,b=c,b+=E*O,b+=x*C,b+=M*R,b+=m*P,b+=B*z,c=b>>>13,b&=8191,b+=S*L,b+=k*(5*D),b+=T*(5*F),b+=K*(5*I),b+=Y*(5*N),c+=b>>>13,b&=8191,g=c,g+=E*N,g+=x*O,g+=M*C,g+=m*R,g+=B*P,c=g>>>13,g&=8191,g+=S*z,g+=k*L,g+=T*(5*D),g+=K*(5*F),g+=Y*(5*I),c+=g>>>13,g&=8191,A=c,A+=E*I,A+=x*N,A+=M*O,A+=m*C,A+=B*R,c=A>>>13,A&=8191,A+=S*P,A+=k*z,A+=T*L,A+=K*(5*D),A+=Y*(5*F),c+=A>>>13,A&=8191,U=c,U+=E*F,U+=x*I,U+=M*N,U+=m*O,U+=B*C,c=U>>>13,U&=8191,U+=S*R,U+=k*P,U+=T*z,U+=K*L,U+=Y*(5*D),c+=U>>>13,U&=8191,_=c,_+=E*D,_+=x*F,_+=M*I,_+=m*N,_+=B*O,c=_>>>13,_&=8191,_+=S*C,_+=k*R,_+=T*P,_+=K*z,_+=Y*L,c+=_>>>13,_&=8191,c=(c<<2)+c|0,c=c+l|0,l=8191&c,c>>>=13,y+=c,E=l,x=y,M=p,m=v,B=w,S=b,k=g,T=A,K=U,Y=_,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]=T,this.h[8]=K,this.h[9]=Y},lr.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},lr.prototype.update=function(r,t,n){var e,o;if(this.leftover){for(o=16-this.leftover,o>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 yr=w,pr=b,vr=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]),wr=32,br=24,gr=32,Ar=32,Ur=br,_r=64;r.lowlevel={crypto_core_hsalsa20:s,crypto_stream_xor:y,crypto_stream:l,crypto_stream_salsa20_xor:u,crypto_stream_salsa20:c,crypto_onetimeauth:p,crypto_onetimeauth_verify:v,crypto_verify_16:o,crypto_verify_32:i,crypto_secretbox:w,crypto_secretbox_open:b,crypto_scalarmult:K,crypto_scalarmult_base:Y,crypto_box_beforenm:z,crypto_box_afternm:yr,crypto_box:P,crypto_box_open:R,crypto_box_keypair:L,crypto_hash:C,crypto_sign:Z,crypto_sign_keypair:G,crypto_sign_open:X,crypto_secretbox_KEYBYTES:wr,crypto_secretbox_NONCEBYTES:br,crypto_secretbox_ZEROBYTES:32,crypto_secretbox_BOXZEROBYTES:16,crypto_scalarmult_BYTES:32,crypto_scalarmult_SCALARBYTES:32,crypto_box_PUBLICKEYBYTES:gr,crypto_box_SECRETKEYBYTES:Ar,crypto_box_BEFORENMBYTES:32,crypto_box_NONCEBYTES:Ur,crypto_box_ZEROBYTES:32,crypto_box_BOXZEROBYTES:16,crypto_sign_BYTES:64,crypto_sign_PUBLICKEYBYTES:32,crypto_sign_SECRETKEYBYTES:64,crypto_sign_SEEDBYTES:32,crypto_hash_BYTES:_r},r.randomBytes=function(r){var t=new Uint8Array(r);return rr(t,r),t},r.secretbox=function(r,t,n){Q(r,t,n),q(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 w(o,e,e.length,t,n),o.subarray(16)},r.secretbox.open=function(r,t,n){Q(r,t,n),q(n,t);for(var e=new Uint8Array(16+r.length),o=new Uint8Array(e.length),i=0;i<r.length;i++)e[i+16]=r[i];return e.length<32?null:0!==b(o,e,e.length,t,n)?null:o.subarray(32)},r.secretbox.keyLength=wr,r.secretbox.nonceLength=br,r.secretbox.overheadLength=16,r.scalarMult=function(r,t){if(Q(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 K(n,r,t),n},r.scalarMult.base=function(r){if(Q(r),32!==r.length)throw new Error("bad n size");var t=new Uint8Array(32);return Y(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){Q(r,t),J(r,t);var n=new Uint8Array(32);return z(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(gr),t=new Uint8Array(Ar);return L(r,t),{publicKey:r,secretKey:t}},r.box.keyPair.fromSecretKey=function(r){if(Q(r),r.length!==Ar)throw new Error("bad secret key size");var t=new Uint8Array(gr);return Y(t,r),{publicKey:t,secretKey:new Uint8Array(r)}},r.box.publicKeyLength=gr,r.box.secretKeyLength=Ar,r.box.sharedKeyLength=32,r.box.nonceLength=Ur,r.box.overheadLength=r.secretbox.overheadLength,r.sign=function(r,t){if(Q(r,t),64!==t.length)throw new Error("bad secret key size");var n=new Uint8Array(64+r.length);return Z(n,r,r.length,t),n},r.sign.open=function(r,t){if(Q(r,t),32!==t.length)throw new Error("bad public key size");var n=new Uint8Array(r.length),e=X(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(64),i=0;i<o.length;i++)o[i]=e[i];return o},r.sign.detached.verify=function(r,t,n){if(Q(r,t,n),64!==t.length)throw new Error("bad signature size");if(32!==n.length)throw new Error("bad public key size");var e,o=new Uint8Array(64+r.length),i=new Uint8Array(64+r.length);for(e=0;e<64;e++)o[e]=t[e];for(e=0;e<r.length;e++)o[e+64]=r[e];return X(i,o,o.length,n)>=0},r.sign.keyPair=function(){var r=new Uint8Array(32),t=new Uint8Array(64);return G(r,t),{publicKey:r,secretKey:t}},r.sign.keyPair.fromSecretKey=function(r){if(Q(r),64!==r.length)throw new Error("bad secret key size");for(var t=new Uint8Array(32),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(Q(r),32!==r.length)throw new Error("bad seed size");for(var t=new Uint8Array(32),n=new Uint8Array(64),e=0;e<32;e++)n[e]=r[e];return G(t,n,!0),{publicKey:t,secretKey:n}},r.sign.publicKeyLength=32,r.sign.secretKeyLength=64,r.sign.seedLength=32,r.sign.signatureLength=64,r.hash=function(r){Q(r);var t=new Uint8Array(_r);return C(t,r,r.length),t},r.hash.hashLength=_r,r.verify=function(r,n){return Q(r,n),0!==r.length&&0!==n.length&&(r.length===n.length&&0===t(r,0,n,0,r.length))},r.setPRNG=function(r){rr=r},function(){var t="undefined"!=typeof self?self.crypto||self.msCrypto:null;if(t&&t.getRandomValues){r.setPRNG(function(r,n){var e,o=new Uint8Array(n);for(e=0;e<n;e+=65536)t.getRandomValues(o.subarray(e,e+Math.min(n-e,65536)));for(e=0;e<n;e++)r[e]=o[e];W(o)})}else(t=n(3))&&t.randomBytes&&r.setPRNG(function(r,n){var e,o=t.randomBytes(n);for(e=0;e<n;e++)r[e]=o[e];W(o)})}()}(void 0!==r&&r.exports?r.exports:self.nacl=self.nacl||{})},function(r,t,n){function e(r,t,n){var e=r[t]+r[n],o=r[t+1]+r[n+1];e>=4294967296&&o++,r[t]=e,r[t+1]=o}function o(r,t,n,e){var o=r[t]+n;n<0&&(o+=4294967296);var i=r[t+1]+e;o>=4294967296&&i++,r[t]=o,r[t+1]=i}function i(r,t){return r[t]^r[t+1]<<8^r[t+2]<<16^r[t+3]<<24}function h(r,t,n,i,h,a){var f=g[h],s=g[h+1],u=g[a],c=g[a+1];e(b,r,t),o(b,r,f,s);var l=b[i]^b[r],y=b[i+1]^b[r+1];b[i]=y,b[i+1]=l,e(b,n,i),l=b[t]^b[n],y=b[t+1]^b[n+1],b[t]=l>>>24^y<<8,b[t+1]=y>>>24^l<<8,e(b,r,t),o(b,r,u,c),l=b[i]^b[r],y=b[i+1]^b[r+1],b[i]=l>>>16^y<<16,b[i+1]=y>>>16^l<<16,e(b,n,i),l=b[t]^b[n],y=b[t+1]^b[n+1],b[t]=y>>>31^l<<1,b[t+1]=l>>>31^y<<1}function a(r,t){var n=0;for(n=0;n<16;n++)b[n]=r.h[n],b[n+16]=p[n];for(b[24]=b[24]^r.t,b[25]=b[25]^r.t/4294967296,t&&(b[28]=~b[28],b[29]=~b[29]),n=0;n<32;n++)g[n]=i(r.b,4*n);for(n=0;n<12;n++)h(0,8,16,24,w[16*n+0],w[16*n+1]),h(2,10,18,26,w[16*n+2],w[16*n+3]),h(4,12,20,28,w[16*n+4],w[16*n+5]),h(6,14,22,30,w[16*n+6],w[16*n+7]),h(0,10,20,30,w[16*n+8],w[16*n+9]),h(2,12,22,24,w[16*n+10],w[16*n+11]),h(4,14,16,26,w[16*n+12],w[16*n+13]),h(6,8,18,28,w[16*n+14],w[16*n+15]);for(n=0;n<16;n++)r.h[n]=r.h[n]^b[n]^b[n+16]}function f(r,t){if(0===r||r>64)throw new Error("Illegal output length, expected 0 < length <= 64");if(t&&t.length>64)throw new Error("Illegal key, expected Uint8Array with 0 < length <= 64");for(var n={b:new Uint8Array(128),h:new Uint32Array(16),t:0,c:0,outlen:r},e=0;e<16;e++)n.h[e]=p[e];var o=t?t.length:0;return n.h[0]^=16842752^o<<8^r,t&&(s(n,t),n.c=128),n}function s(r,t){for(var n=0;n<t.length;n++)128===r.c&&(r.t+=r.c,a(r,!1),r.c=0),r.b[r.c++]=t[n]}function u(r){for(r.t+=r.c;r.c<128;)r.b[r.c++]=0;a(r,!0);for(var t=new Uint8Array(r.outlen),n=0;n<r.outlen;n++)t[n]=r.h[n>>2]>>8*(3&n);return t}function c(r,t,n){n=n||64,r=y.normalizeInput(r);var e=f(n,t);return s(e,r),u(e)}function l(r,t,n){var e=c(r,t,n);return y.toHex(e)}var y=n(2),p=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),v=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3],w=new Uint8Array(v.map(function(r){return 2*r})),b=new Uint32Array(32),g=new Uint32Array(32);r.exports={blake2b:c,blake2bHex:l,blake2bInit:f,blake2bUpdate:s,blake2bFinal:u}},function(r,t){function n(r){var t;if(r instanceof Uint8Array)t=r;else if(r instanceof Buffer)t=new Uint8Array(r);else{if("string"!=typeof r)throw new Error(a);t=new Uint8Array(Buffer.from(r,"utf8"))}return t}function e(r){return Array.prototype.map.call(r,function(r){return(r<16?"0":"")+r.toString(16)}).join("")}function o(r){return(4294967296+r).toString(16).substring(1)}function i(r,t,n){for(var e="\n"+r+" = ",i=0;i<t.length;i+=2){if(32===n)e+=o(t[i]).toUpperCase(),e+=" ",e+=o(t[i+1]).toUpperCase();else{if(64!==n)throw new Error("Invalid size "+n);e+=o(t[i+1]).toUpperCase(),e+=o(t[i]).toUpperCase()}i%6==4?e+="\n"+new Array(r.length+4).join(" "):i<t.length-2&&(e+=" ")}console.log(e)}function h(r,t,n){for(var e=(new Date).getTime(),o=new Uint8Array(t),i=0;i<t;i++)o[i]=i%256;var h=(new Date).getTime();for(console.log("Generated random input in "+(h-e)+"ms"),e=h,i=0;i<n;i++){var a=r(o),f=(new Date).getTime(),s=f-e;e=f,console.log("Hashed in "+s+"ms: "+a.substring(0,20)+"..."),console.log(Math.round(t/(1<<20)/(s/1e3)*100)/100+" MB PER SECOND")}}var a="Input must be an string, Buffer or Uint8Array";r.exports={normalizeInput:n,toHex:e,debugPrint:i,testSpeed:h}},function(r,t){}]);