!function(r,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(r="undefined"!=typeof globalThis?globalThis:r||self).ristretto255=t()}(this,(function(){"use strict";function r(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var t,n=(t=Object.freeze({__proto__:null,default:{}}))&&t.default||t,e=function(r,t){return r(t={exports:{}},t.exports),t.exports}((function(t){!function(t){var e=function(r){var t,n=new Float64Array(16);if(r)for(t=0;t>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,f=0;for(i=0;i>>8)-1}function v(r,t,n,e){return w(r,t,n,e,16)}function b(r,t,n,e){return w(r,t,n,e,32)}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,f=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,s=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,h=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,c=255&e[4]|(255&e[5])<<8|(255&e[6])<<16|(255&e[7])<<24,u=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,g=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,p=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,v=255&n[20]|(255&n[21])<<8|(255&n[22])<<16|(255&n[23])<<24,b=255&n[24]|(255&n[25])<<8|(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z+d|0,r[0]=M>>>0&255,r[1]=M>>>8&255,r[2]=M>>>16&255,r[3]=M>>>24&255,r[4]=_>>>0&255,r[5]=_>>>8&255,r[6]=_>>>16&255,r[7]=_>>>24&255,r[8]=U>>>0&255,r[9]=U>>>8&255,r[10]=U>>>16&255,r[11]=U>>>24&255,r[12]=E>>>0&255,r[13]=E>>>8&255,r[14]=E>>>16&255,r[15]=E>>>24&255,r[16]=m>>>0&255,r[17]=m>>>8&255,r[18]=m>>>16&255,r[19]=m>>>24&255,r[20]=x>>>0&255,r[21]=x>>>8&255,r[22]=x>>>16&255,r[23]=x>>>24&255,r[24]=S>>>0&255,r[25]=S>>>8&255,r[26]=S>>>16&255,r[27]=S>>>24&255,r[28]=B>>>0&255,r[29]=B>>>8&255,r[30]=B>>>16&255,r[31]=B>>>24&255,r[32]=k>>>0&255,r[33]=k>>>8&255,r[34]=k>>>16&255,r[35]=k>>>24&255,r[36]=L>>>0&255,r[37]=L>>>8&255,r[38]=L>>>16&255,r[39]=L>>>24&255,r[40]=K>>>0&255,r[41]=K>>>8&255,r[42]=K>>>16&255,r[43]=K>>>24&255,r[44]=T>>>0&255,r[45]=T>>>8&255,r[46]=T>>>16&255,r[47]=T>>>24&255,r[48]=Y>>>0&255,r[49]=Y>>>8&255,r[50]=Y>>>16&255,r[51]=Y>>>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]=Z>>>0&255,r[61]=Z>>>8&255,r[62]=Z>>>16&255,r[63]=Z>>>24&255}(r,t,n,e)}function d(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,f=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,s=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,h=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,c=255&e[4]|(255&e[5])<<8|(255&e[6])<<16|(255&e[7])<<24,u=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,g=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,p=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,v=255&n[20]|(255&n[21])<<8|(255&n[22])<<16|(255&n[23])<<24,b=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,d=255&e[12]|(255&e[13])<<8|(255&e[14])<<16|(255&e[15])<<24,M=0;M<20;M+=2)i^=(o=(v^=(o=(y^=(o=(h^=(o=i+v|0)<<7|o>>>25)+i|0)<<9|o>>>23)+h|0)<<13|o>>>19)+y|0)<<18|o>>>14,c^=(o=(f^=(o=(b^=(o=(g^=(o=c+f|0)<<7|o>>>25)+c|0)<<9|o>>>23)+g|0)<<13|o>>>19)+b|0)<<18|o>>>14,p^=(o=(u^=(o=(a^=(o=(A^=(o=p+u|0)<<7|o>>>25)+p|0)<<9|o>>>23)+A|0)<<13|o>>>19)+a|0)<<18|o>>>14,d^=(o=(w^=(o=(l^=(o=(s^=(o=d+w|0)<<7|o>>>25)+d|0)<<9|o>>>23)+s|0)<<13|o>>>19)+l|0)<<18|o>>>14,i^=(o=(s^=(o=(a^=(o=(f^=(o=i+s|0)<<7|o>>>25)+i|0)<<9|o>>>23)+f|0)<<13|o>>>19)+a|0)<<18|o>>>14,c^=(o=(h^=(o=(l^=(o=(u^=(o=c+h|0)<<7|o>>>25)+c|0)<<9|o>>>23)+u|0)<<13|o>>>19)+l|0)<<18|o>>>14,p^=(o=(g^=(o=(y^=(o=(w^=(o=p+g|0)<<7|o>>>25)+p|0)<<9|o>>>23)+w|0)<<13|o>>>19)+y|0)<<18|o>>>14,d^=(o=(A^=(o=(b^=(o=(v^=(o=d+A|0)<<7|o>>>25)+d|0)<<9|o>>>23)+v|0)<<13|o>>>19)+b|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]=c>>>0&255,r[5]=c>>>8&255,r[6]=c>>>16&255,r[7]=c>>>24&255,r[8]=p>>>0&255,r[9]=p>>>8&255,r[10]=p>>>16&255,r[11]=p>>>24&255,r[12]=d>>>0&255,r[13]=d>>>8&255,r[14]=d>>>16&255,r[15]=d>>>24&255,r[16]=u>>>0&255,r[17]=u>>>8&255,r[18]=u>>>16&255,r[19]=u>>>24&255,r[20]=l>>>0&255,r[21]=l>>>8&255,r[22]=l>>>16&255,r[23]=l>>>24&255,r[24]=y>>>0&255,r[25]=y>>>8&255,r[26]=y>>>16&255,r[27]=y>>>24&255,r[28]=g>>>0&255,r[29]=g>>>8&255,r[30]=g>>>16&255,r[31]=g>>>24&255}(r,t,n,e)}var M=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function _(r,t,n,e,o,i,f){var a,s,h=new Uint8Array(16),c=new Uint8Array(64);for(s=0;s<16;s++)h[s]=0;for(s=0;s<8;s++)h[s]=i[s];for(;o>=64;){for(A(c,h,f,M),s=0;s<64;s++)r[t+s]=n[e+s]^c[s];for(a=1,s=8;s<16;s++)a=a+(255&h[s])|0,h[s]=255&a,a>>>=8;o-=64,t+=64,e+=64}if(o>0)for(A(c,h,f,M),s=0;s=64;){for(A(s,a,o,M),f=0;f<64;f++)r[t+f]=s[f];for(i=1,f=8;f<16;f++)i=i+(255&a[f])|0,a[f]=255&i,i>>>=8;n-=64,t+=64}if(n>0)for(A(s,a,o,M),f=0;f>>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,f=255&r[10]|(255&r[11])<<8,this.r[6]=8191&(i>>>14|f<<2),a=255&r[12]|(255&r[13])<<8,this.r[7]=8065&(f>>>11|a<<5),s=255&r[14]|(255&r[15])<<8,this.r[8]=8191&(a>>>8|s<<8),this.r[9]=s>>>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 S(r,t,n,e,o,i){var f=new x(i);return f.update(n,e,o),f.finish(r,t),0}function B(r,t,n,e,o,i){var f=new Uint8Array(16);return S(f,0,n,e,o,i),v(r,t,f,0)}function k(r,t,n,e,o){var i;if(n<32)return-1;for(m(r,0,t,0,n,e,o),S(r,16,r,32,n-32,r),i=0;i<16;i++)r[i]=0;return 0}function L(r,t,n,e,o){var i,f=new Uint8Array(32);if(n<32)return-1;if(E(f,0,32,e,o),0!==B(t,16,t,32,n-32,f))return-1;for(m(r,0,t,0,n,e,o),i=0;i<32;i++)r[i]=0;return 0}function K(r,t){var n;for(n=0;n<16;n++)r[n]=0|t[n]}function T(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 Y(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 n,o,i,f=e(),a=e();for(n=0;n<16;n++)a[n]=t[n];for(T(a),T(a),T(a),o=0;o<2;o++){for(f[0]=a[0]-65517,n=1;n<15;n++)f[n]=a[n]-65535-(f[n-1]>>16&1),f[n-1]&=65535;f[15]=a[15]-32767-(f[14]>>16&1),i=f[15]>>16&1,f[14]&=65535,Y(a,f,1-i)}for(n=0;n<16;n++)r[2*n]=255&a[n],r[2*n+1]=a[n]>>8}function z(r,t){var n=new Uint8Array(32),e=new Uint8Array(32);return R(n,r),R(e,t),b(n,0,e,0)}function Z(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 O(r,t,n){for(var e=0;e<16;e++)r[e]=t[e]+n[e]}function F(r,t,n){for(var e=0;e<16;e++)r[e]=t[e]-n[e]}function I(r,t,n){var e,o,i=0,f=0,a=0,s=0,h=0,c=0,u=0,l=0,y=0,g=0,p=0,w=0,v=0,b=0,A=0,d=0,M=0,_=0,U=0,E=0,m=0,x=0,S=0,B=0,k=0,L=0,K=0,T=0,Y=0,R=0,z=0,Z=n[0],P=n[1],O=n[2],F=n[3],I=n[4],N=n[5],C=n[6],q=n[7],D=n[8],j=n[9],G=n[10],V=n[11],H=n[12],X=n[13],J=n[14],Q=n[15];i+=(e=t[0])*Z,f+=e*P,a+=e*O,s+=e*F,h+=e*I,c+=e*N,u+=e*C,l+=e*q,y+=e*D,g+=e*j,p+=e*G,w+=e*V,v+=e*H,b+=e*X,A+=e*J,d+=e*Q,f+=(e=t[1])*Z,a+=e*P,s+=e*O,h+=e*F,c+=e*I,u+=e*N,l+=e*C,y+=e*q,g+=e*D,p+=e*j,w+=e*G,v+=e*V,b+=e*H,A+=e*X,d+=e*J,M+=e*Q,a+=(e=t[2])*Z,s+=e*P,h+=e*O,c+=e*F,u+=e*I,l+=e*N,y+=e*C,g+=e*q,p+=e*D,w+=e*j,v+=e*G,b+=e*V,A+=e*H,d+=e*X,M+=e*J,_+=e*Q,s+=(e=t[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=e*j,x+=e*G,S+=e*V,B+=e*H,k+=e*X,L+=e*J,K+=e*Q,v+=(e=t[12])*Z,b+=e*P,A+=e*O,d+=e*F,M+=e*I,_+=e*N,U+=e*C,E+=e*q,m+=e*D,x+=e*j,S+=e*G,B+=e*V,k+=e*H,L+=e*X,K+=e*J,T+=e*Q,b+=(e=t[13])*Z,A+=e*P,d+=e*O,M+=e*F,_+=e*I,U+=e*N,E+=e*C,m+=e*q,x+=e*D,S+=e*j,B+=e*G,k+=e*V,L+=e*H,K+=e*X,T+=e*J,Y+=e*Q,A+=(e=t[14])*Z,d+=e*P,M+=e*O,_+=e*F,U+=e*I,E+=e*N,m+=e*C,x+=e*q,S+=e*D,B+=e*j,k+=e*G,L+=e*V,K+=e*H,T+=e*X,Y+=e*J,R+=e*Q,d+=(e=t[15])*Z,f+=38*(_+=e*O),a+=38*(U+=e*F),s+=38*(E+=e*I),h+=38*(m+=e*N),c+=38*(x+=e*C),u+=38*(S+=e*q),l+=38*(B+=e*D),y+=38*(k+=e*j),g+=38*(L+=e*G),p+=38*(K+=e*V),w+=38*(T+=e*H),v+=38*(Y+=e*X),b+=38*(R+=e*J),A+=38*(z+=e*Q),i=(e=(i+=38*(M+=e*P))+(o=1)+65535)-65536*(o=Math.floor(e/65536)),f=(e=f+o+65535)-65536*(o=Math.floor(e/65536)),a=(e=a+o+65535)-65536*(o=Math.floor(e/65536)),s=(e=s+o+65535)-65536*(o=Math.floor(e/65536)),h=(e=h+o+65535)-65536*(o=Math.floor(e/65536)),c=(e=c+o+65535)-65536*(o=Math.floor(e/65536)),u=(e=u+o+65535)-65536*(o=Math.floor(e/65536)),l=(e=l+o+65535)-65536*(o=Math.floor(e/65536)),y=(e=y+o+65535)-65536*(o=Math.floor(e/65536)),g=(e=g+o+65535)-65536*(o=Math.floor(e/65536)),p=(e=p+o+65535)-65536*(o=Math.floor(e/65536)),w=(e=w+o+65535)-65536*(o=Math.floor(e/65536)),v=(e=v+o+65535)-65536*(o=Math.floor(e/65536)),b=(e=b+o+65535)-65536*(o=Math.floor(e/65536)),A=(e=A+o+65535)-65536*(o=Math.floor(e/65536)),d=(e=d+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)),f=(e=f+o+65535)-65536*(o=Math.floor(e/65536)),a=(e=a+o+65535)-65536*(o=Math.floor(e/65536)),s=(e=s+o+65535)-65536*(o=Math.floor(e/65536)),h=(e=h+o+65535)-65536*(o=Math.floor(e/65536)),c=(e=c+o+65535)-65536*(o=Math.floor(e/65536)),u=(e=u+o+65535)-65536*(o=Math.floor(e/65536)),l=(e=l+o+65535)-65536*(o=Math.floor(e/65536)),y=(e=y+o+65535)-65536*(o=Math.floor(e/65536)),g=(e=g+o+65535)-65536*(o=Math.floor(e/65536)),p=(e=p+o+65535)-65536*(o=Math.floor(e/65536)),w=(e=w+o+65535)-65536*(o=Math.floor(e/65536)),v=(e=v+o+65535)-65536*(o=Math.floor(e/65536)),b=(e=b+o+65535)-65536*(o=Math.floor(e/65536)),A=(e=A+o+65535)-65536*(o=Math.floor(e/65536)),d=(e=d+o+65535)-65536*(o=Math.floor(e/65536)),i+=o-1+37*(o-1),r[0]=i,r[1]=f,r[2]=a,r[3]=s,r[4]=h,r[5]=c,r[6]=u,r[7]=l,r[8]=y,r[9]=g,r[10]=p,r[11]=w,r[12]=v,r[13]=b,r[14]=A,r[15]=d}function N(r,t){I(r,t,t)}function C(r,t){var n,o=e();for(n=0;n<16;n++)o[n]=t[n];for(n=253;n>=0;n--)N(o,o),2!==n&&4!==n&&I(o,o,t);for(n=0;n<16;n++)r[n]=o[n]}function q(r,t){var n,o=e();for(n=0;n<16;n++)o[n]=t[n];for(n=250;n>=0;n--)N(o,o),1!==n&&I(o,o,t);for(n=0;n<16;n++)r[n]=o[n]}function D(r,t,n){var o,i,f=new Uint8Array(32),a=new Float64Array(80),s=e(),c=e(),u=e(),l=e(),y=e(),g=e();for(i=0;i<31;i++)f[i]=t[i];for(f[31]=127&t[31]|64,f[0]&=248,P(a,n),i=0;i<16;i++)c[i]=a[i],l[i]=s[i]=u[i]=0;for(s[0]=l[0]=1,i=254;i>=0;--i)Y(s,c,o=f[i>>>3]>>>(7&i)&1),Y(u,l,o),O(y,s,u),F(s,s,u),O(u,c,l),F(c,c,l),N(l,y),N(g,s),I(s,u,s),I(u,c,y),O(y,s,u),F(s,s,u),N(c,s),F(u,l,g),I(s,u,h),O(s,s,l),I(u,u,s),I(s,l,g),I(l,c,a),N(c,y),Y(s,c,o),Y(u,l,o);for(i=0;i<16;i++)a[i+16]=s[i],a[i+32]=u[i],a[i+48]=c[i],a[i+64]=l[i];var p=a.subarray(32),w=a.subarray(16);return C(p,p),I(w,w,p),R(r,w),0}function j(r,t){return D(r,t,f)}function G(r,t){return o(t,32),j(r,t)}function V(r,t,n){var e=new Uint8Array(32);return D(e,n,t),d(r,i,e,M)}x.prototype.blocks=function(r,t,n){for(var e,o,i,f,a,s,h,c,u,l,y,g,p,w,v,b,A,d,M,_=this.fin?0:2048,U=this.h[0],E=this.h[1],m=this.h[2],x=this.h[3],S=this.h[4],B=this.h[5],k=this.h[6],L=this.h[7],K=this.h[8],T=this.h[9],Y=this.r[0],R=this.r[1],z=this.r[2],Z=this.r[3],P=this.r[4],O=this.r[5],F=this.r[6],I=this.r[7],N=this.r[8],C=this.r[9];n>=16;)l=u=0,l+=(U+=8191&(e=255&r[t+0]|(255&r[t+1])<<8))*Y,l+=(E+=8191&(e>>>13|(o=255&r[t+2]|(255&r[t+3])<<8)<<3))*(5*C),l+=(m+=8191&(o>>>10|(i=255&r[t+4]|(255&r[t+5])<<8)<<6))*(5*N),l+=(x+=8191&(i>>>7|(f=255&r[t+6]|(255&r[t+7])<<8)<<9))*(5*I),u=(l+=(S+=8191&(f>>>4|(a=255&r[t+8]|(255&r[t+9])<<8)<<12))*(5*F))>>>13,l&=8191,l+=(B+=a>>>1&8191)*(5*O),l+=(k+=8191&(a>>>14|(s=255&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+=L*R,d+=K*Y,M=u+=(d+=T*(5*C))>>>13,M+=U*C,M+=E*N,M+=m*I,M+=x*F,u=(M+=S*O)>>>13,M&=8191,M+=B*P,M+=k*Z,M+=L*z,M+=K*R,U=l=8191&(u=(u=((u+=(M+=T*Y)>>>13)<<2)+u|0)+(l&=8191)|0),E=y+=u>>>=13,m=g&=8191,x=p&=8191,S=w&=8191,B=v&=8191,k=b&=8191,L=A&=8191,K=d&=8191,T=M&=8191,t+=16,n-=16;this.h[0]=U,this.h[1]=E,this.h[2]=m,this.h[3]=x,this.h[4]=S,this.h[5]=B,this.h[6]=k,this.h[7]=L,this.h[8]=K,this.h[9]=T},x.prototype.finish=function(r,t){var n,e,o,i,f=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,f[0]=this.h[0]+5,n=f[0]>>>13,f[0]&=8191,i=1;i<10;i++)f[i]=this.h[i]+n,n=f[i]>>>13,f[i]&=8191;for(f[9]-=8192,e=(1^n)-1,i=0;i<10;i++)f[i]&=e;for(e=~e,i=0;i<10;i++)this.h[i]=this.h[i]&e|f[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},x.prototype.update=function(r,t,n){var e,o;if(this.leftover){for((o=16-this.leftover)>n&&(o=n),e=0;e=16&&(o=n-n%16,this.blocks(r,t,o),t+=o,n-=o),n){for(e=0;e=128;){for(_=0;_<16;_++)U=8*_+H,L[_]=n[U+0]<<24|n[U+1]<<16|n[U+2]<<8|n[U+3],K[_]=n[U+4]<<24|n[U+5]<<16|n[U+6]<<8|n[U+7];for(_=0;_<80;_++)if(o=T,i=Y,f=R,a=z,s=Z,h=P,c=O,F,l=I,y=N,g=C,p=q,w=D,v=j,b=G,V,x=65535&(m=V),S=m>>>16,B=65535&(E=F),k=E>>>16,x+=65535&(m=(D>>>14|Z<<18)^(D>>>18|Z<<14)^(Z>>>9|D<<23)),S+=m>>>16,B+=65535&(E=(Z>>>14|D<<18)^(Z>>>18|D<<14)^(D>>>9|Z<<23)),k+=E>>>16,x+=65535&(m=D&j^~D&G),S+=m>>>16,B+=65535&(E=Z&P^~Z&O),k+=E>>>16,E=J[2*_],x+=65535&(m=J[2*_+1]),S+=m>>>16,B+=65535&E,k+=E>>>16,E=L[_%16],S+=(m=K[_%16])>>>16,B+=65535&E,k+=E>>>16,B+=(S+=(x+=65535&m)>>>16)>>>16,x=65535&(m=M=65535&x|S<<16),S=m>>>16,B=65535&(E=d=65535&B|(k+=B>>>16)<<16),k=E>>>16,x+=65535&(m=(I>>>28|T<<4)^(T>>>2|I<<30)^(T>>>7|I<<25)),S+=m>>>16,B+=65535&(E=(T>>>28|I<<4)^(I>>>2|T<<30)^(I>>>7|T<<25)),k+=E>>>16,S+=(m=I&N^I&C^N&C)>>>16,B+=65535&(E=T&Y^T&R^Y&R),k+=E>>>16,u=65535&(B+=(S+=(x+=65535&m)>>>16)>>>16)|(k+=B>>>16)<<16,A=65535&x|S<<16,x=65535&(m=p),S=m>>>16,B=65535&(E=a),k=E>>>16,S+=(m=M)>>>16,B+=65535&(E=d),k+=E>>>16,Y=o,R=i,z=f,Z=a=65535&(B+=(S+=(x+=65535&m)>>>16)>>>16)|(k+=B>>>16)<<16,P=s,O=h,F=c,T=u,N=l,C=y,q=g,D=p=65535&x|S<<16,j=w,G=v,V=b,I=A,_%16==15)for(U=0;U<16;U++)E=L[U],x=65535&(m=K[U]),S=m>>>16,B=65535&E,k=E>>>16,E=L[(U+9)%16],x+=65535&(m=K[(U+9)%16]),S+=m>>>16,B+=65535&E,k+=E>>>16,d=L[(U+1)%16],x+=65535&(m=((M=K[(U+1)%16])>>>1|d<<31)^(M>>>8|d<<24)^(M>>>7|d<<25)),S+=m>>>16,B+=65535&(E=(d>>>1|M<<31)^(d>>>8|M<<24)^d>>>7),k+=E>>>16,d=L[(U+14)%16],S+=(m=((M=K[(U+14)%16])>>>19|d<<13)^(d>>>29|M<<3)^(M>>>6|d<<26))>>>16,B+=65535&(E=(d>>>19|M<<13)^(M>>>29|d<<3)^d>>>6),k+=E>>>16,k+=(B+=(S+=(x+=65535&m)>>>16)>>>16)>>>16,L[U]=65535&B|k<<16,K[U]=65535&x|S<<16;x=65535&(m=I),S=m>>>16,B=65535&(E=T),k=E>>>16,E=r[0],S+=(m=t[0])>>>16,B+=65535&E,k+=E>>>16,k+=(B+=(S+=(x+=65535&m)>>>16)>>>16)>>>16,r[0]=T=65535&B|k<<16,t[0]=I=65535&x|S<<16,x=65535&(m=N),S=m>>>16,B=65535&(E=Y),k=E>>>16,E=r[1],S+=(m=t[1])>>>16,B+=65535&E,k+=E>>>16,k+=(B+=(S+=(x+=65535&m)>>>16)>>>16)>>>16,r[1]=Y=65535&B|k<<16,t[1]=N=65535&x|S<<16,x=65535&(m=C),S=m>>>16,B=65535&(E=R),k=E>>>16,E=r[2],S+=(m=t[2])>>>16,B+=65535&E,k+=E>>>16,k+=(B+=(S+=(x+=65535&m)>>>16)>>>16)>>>16,r[2]=R=65535&B|k<<16,t[2]=C=65535&x|S<<16,x=65535&(m=q),S=m>>>16,B=65535&(E=z),k=E>>>16,E=r[3],S+=(m=t[3])>>>16,B+=65535&E,k+=E>>>16,k+=(B+=(S+=(x+=65535&m)>>>16)>>>16)>>>16,r[3]=z=65535&B|k<<16,t[3]=q=65535&x|S<<16,x=65535&(m=D),S=m>>>16,B=65535&(E=Z),k=E>>>16,E=r[4],S+=(m=t[4])>>>16,B+=65535&E,k+=E>>>16,k+=(B+=(S+=(x+=65535&m)>>>16)>>>16)>>>16,r[4]=Z=65535&B|k<<16,t[4]=D=65535&x|S<<16,x=65535&(m=j),S=m>>>16,B=65535&(E=P),k=E>>>16,E=r[5],S+=(m=t[5])>>>16,B+=65535&E,k+=E>>>16,k+=(B+=(S+=(x+=65535&m)>>>16)>>>16)>>>16,r[5]=P=65535&B|k<<16,t[5]=j=65535&x|S<<16,x=65535&(m=G),S=m>>>16,B=65535&(E=O),k=E>>>16,E=r[6],S+=(m=t[6])>>>16,B+=65535&E,k+=E>>>16,k+=(B+=(S+=(x+=65535&m)>>>16)>>>16)>>>16,r[6]=O=65535&B|k<<16,t[6]=G=65535&x|S<<16,x=65535&(m=V),S=m>>>16,B=65535&(E=F),k=E>>>16,E=r[7],S+=(m=t[7])>>>16,B+=65535&E,k+=E>>>16,k+=(B+=(S+=(x+=65535&m)>>>16)>>>16)>>>16,r[7]=F=65535&B|k<<16,t[7]=V=65535&x|S<<16,H+=128,e-=128}return e}function W(r,t,n){var e,o=new Int32Array(8),i=new Int32Array(8),f=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=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 n=[e(),e(),e(),e()];K(n[0],l),K(n[1],y),K(n[2],s),I(n[3],l,y),nr(r,n,t)}function or(r,t,n){var i,f=new Uint8Array(64),a=[e(),e(),e(),e()];for(n||o(t,32),W(f,t,32),f[0]&=248,f[31]&=127,f[31]|=64,er(a,f),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 fr(r,t){var n,e,o,i;for(e=63;e>=32;--e){for(n=0,o=e-32,i=e-12;o>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;fr(r,n)}function sr(r,t,n,o){var i,f,a=new Uint8Array(64),s=new Uint8Array(64),h=new Uint8Array(64),c=new Float64Array(64),u=[e(),e(),e(),e()];W(a,o,32),a[0]&=248,a[31]&=127,a[31]|=64;var l=n+64;for(i=0;i>7&&F(r[0],a,r[0]),I(r[3],r[0],r[1]),0)}(l,o))return-1;for(i=0;i=0},t.sign.keyPair=function(){var r=new Uint8Array(lr),t=new Uint8Array(yr);return or(r,t),{publicKey:r,secretKey:t}},t.sign.keyPair.fromSecretKey=function(r){if(pr(r),r.length!==yr)throw new Error("bad secret key size");for(var t=new Uint8Array(lr),n=0;n0;n--)t|=255^r[n];return t=(0|t)-1>>8,1-(1&(t&236-(0|r[0])>>8|r[0])|(255&r[31])>>7)}(t))return-1;i.unpack25519(o,t),i.S(a,o),i.set25519(s,f),i.Z(s,s,a),i.S(c,s),i.set25519(h,f),i.A(h,h,a),i.S(u,h),i.M(l,i.D,c),A(l,l),i.Z(l,l,u),i.M(y,l,u),i.set25519(e,f);const g=_(n,e,y);return i.M(r[0],n,h),i.M(r[1],n,r[0]),i.M(r[1],r[1],l),i.M(r[0],r[0],o),i.A(r[0],r[0],r[0]),M(r[0],r[0]),i.M(r[1],s,r[1]),i.set25519(r[2],f),i.M(r[3],r[0],r[1]),-(1-g|b(r[3])|w(r[1]))}function m(r,t){const n=i.gf(),e=i.gf(),o=i.gf(),a=i.gf(),s=i.gf(),h=i.gf(),c=i.gf(),y=i.gf(),w=i.gf(),b=i.gf(),d=i.gf(),U=i.gf(),E=i.gf(),m=i.gf();i.set25519(o,f),i.S(a,t),i.M(a,u,a),i.A(w,a,o),i.M(w,w,g),i.set25519(n,f),A(n,n),i.A(s,a,i.D),i.M(b,a,i.D),i.Z(b,n,b),i.M(b,b,s);const x=1-_(h,w,b);i.M(c,h,t),M(c,c),A(c,c),v(h,c,x),v(n,a,x),i.Z(e,a,o),i.M(e,e,n),i.M(e,e,p),i.Z(e,e,b),i.A(d,h,h),i.M(d,d,b),i.M(U,e,l),i.S(y,h),i.Z(E,o,y),i.A(m,o,y),i.M(r[0],d,m),i.M(r[1],E,U),i.M(r[2],U,m),i.M(r[3],d,E)}function x(r){const t=i.gf(),n=i.gf(),e=a(),o=a();return i.unpack25519(t,r.slice(0,32)),i.unpack25519(n,r.slice(32,64)),m(e,t),m(o,n),i.add(e,o),e}function S(r,t){const n=a(),e=a();if(-1===E(n,r))throw new Error("Invalid argument");if(-1===E(e,t))throw new Error("Invalid argument");return[n,e]}function B(r,t){const n=i.gf();A(n,t[3]);const e=i.gf();A(e,t[0]);const o=[e,t[1],t[2],n];i.add(r,o)}function k(){return x(e.randomBytes(64))}function L(r){const t=new Float64Array(64);for(let n=0;n<32;n++)t[n]=-r[n];const n=new Uint8Array(32);return i.modL(n,t),n}function K(r,t){const n=new Float64Array(64);for(let e=0;e<32;e++)n[e]=r[e]+t[e];const e=new Uint8Array(32);return i.modL(e,n),e}return o.scalarMultBase=function(r){const t=a();return i.scalarbase(t,r),U(t)},o.scalarMult=function(r,t){const n=a(),e=a();if(0!==E(n,t))throw new Error("Invalid argument");return i.scalarmult(e,n,r),U(e)},o.isValid=function(r){return-1!==E(a(),r)},o.add=function(r,t){const[n,e]=S(r,t);return i.add(n,e),U(n)},o.sub=function(r,t){const[n,e]=S(r,t);return B(n,e),U(n)},o.fromHash=function(r){return U(x(r))},o.getRandom=function(){return U(k())},o.basePoint=s,o.scalar={},o.scalar.getRandom=function(){let r=new Uint8Array(32),t=0;do{r=e.randomBytes(32),r[31]&=31;let n=32,o=1;do{n--,t|=r[n]-i.L[n]>>8&o,o&=(r[n]^i.L[n])-1>>8}while(0!==n)}while(0===t);return r},o.scalar.invert=function(r){const t=new Uint8Array(32);return function(r,t){for(let n=0;n<32;n++)r[n]=t[n];for(let e=251;e>=0;e--)c(r,n=r,n),0!=(h[e>>3]>>(7&e)&1)&&c(r,r,t);var n}(t,r),t},o.scalar.negate=L,o.scalar.add=K,o.scalar.sub=function(r,t){return K(r,L(t))},o.scalar.mul=function(r,t){const n=new Uint8Array(32);return c(n,r,t),n},o.unsafe={},o.unsafe.point={},o.unsafe.point.toBytes=U,o.unsafe.point.fromBytes=E,o.unsafe.point.fromHash=x,o.unsafe.point.sub=B,o.unsafe.point.add=i.add,o.unsafe.point.scalarMultBase=i.scalarbase,o.unsafe.point.scalarMult=i.scalarmult,o.unsafe.point.getRandom=k,o.unsafe.point.alloc=a,o.unsafe.constants={},o.unsafe.constants.LSub2=h,o.unsafe.constants.sqrtm1=u,o.unsafe.constants.sqrtadm1=l,o.unsafe.constants.invsqrtamd=y,o.unsafe.constants.onemsqd=g,o.unsafe.constants.sqdmone=p,o}));