-
Notifications
You must be signed in to change notification settings - Fork 1
/
keccak256.min.js
1 lines (1 loc) · 3.55 KB
/
keccak256.min.js
1
const t=[1,0,32898,0,32906,-2147483648,-2147450880,-2147483648,32907,0,-2147483647,0,-2147450751,-2147483648,32777,-2147483648,138,0,136,0,-2147450871,0,-2147483638,0,-2147450741,0,139,-2147483648,32905,-2147483648,32771,-2147483648,32770,-2147483648,128,-2147483648,32778,0,-2147483638,-2147483648,-2147450751,-2147483648,32896,-2147483648,-2147483647,0,-2147450872,-2147483648];function e(e){for(let r=0;r<48;r+=2){let n=e[0]^e[10]^e[20]^e[30]^e[40],o=e[1]^e[11]^e[21]^e[31]^e[41],f=e[2]^e[12]^e[22]^e[32]^e[42],l=e[3]^e[13]^e[23]^e[33]^e[43],i=e[4]^e[14]^e[24]^e[34]^e[44],a=e[5]^e[15]^e[25]^e[35]^e[45],c=e[6]^e[16]^e[26]^e[36]^e[46],u=e[7]^e[17]^e[27]^e[37]^e[47],h=e[8]^e[18]^e[28]^e[38]^e[48],s=e[9]^e[19]^e[29]^e[39]^e[49],y=h^(f<<1|l>>>31),p=s^(l<<1|f>>>31);e[0]^=y,e[1]^=p,e[10]^=y,e[11]^=p,e[20]^=y,e[21]^=p,e[30]^=y,e[31]^=p,e[40]^=y,e[41]^=p,y=n^(i<<1|a>>>31),p=o^(a<<1|i>>>31),e[2]^=y,e[3]^=p,e[12]^=y,e[13]^=p,e[22]^=y,e[23]^=p,e[32]^=y,e[33]^=p,e[42]^=y,e[43]^=p,y=f^(c<<1|u>>>31),p=l^(u<<1|c>>>31),e[4]^=y,e[5]^=p,e[14]^=y,e[15]^=p,e[24]^=y,e[25]^=p,e[34]^=y,e[35]^=p,e[44]^=y,e[45]^=p,y=i^(h<<1|s>>>31),p=a^(s<<1|h>>>31),e[6]^=y,e[7]^=p,e[16]^=y,e[17]^=p,e[26]^=y,e[27]^=p,e[36]^=y,e[37]^=p,e[46]^=y,e[47]^=p,y=c^(n<<1|o>>>31),p=u^(o<<1|n>>>31),e[8]^=y,e[9]^=p,e[18]^=y,e[19]^=p,e[28]^=y,e[29]^=p,e[38]^=y,e[39]^=p,e[48]^=y,e[49]^=p;let w=e[0],A=e[1],U=e[11]<<4|e[10]>>>28,d=e[10]<<4|e[11]>>>28,g=e[20]<<3|e[21]>>>29,x=e[21]<<3|e[20]>>>29,b=e[31]<<9|e[30]>>>23,k=e[30]<<9|e[31]>>>23,m=e[40]<<18|e[41]>>>14,E=e[41]<<18|e[40]>>>14,M=e[2]<<1|e[3]>>>31,T=e[3]<<1|e[2]>>>31,j=e[13]<<12|e[12]>>>20,q=e[12]<<12|e[13]>>>20,v=e[22]<<10|e[23]>>>22,z=e[23]<<10|e[22]>>>22,B=e[33]<<13|e[32]>>>19,C=e[32]<<13|e[33]>>>19,D=e[42]<<2|e[43]>>>30,F=e[43]<<2|e[42]>>>30,G=e[5]<<30|e[4]>>>2,H=e[4]<<30|e[5]>>>2,I=e[14]<<6|e[15]>>>26,J=e[15]<<6|e[14]>>>26,K=e[25]<<11|e[24]>>>21,L=e[24]<<11|e[25]>>>21,N=e[34]<<15|e[35]>>>17,O=e[35]<<15|e[34]>>>17,P=e[45]<<29|e[44]>>>3,Q=e[44]<<29|e[45]>>>3,R=e[6]<<28|e[7]>>>4,S=e[7]<<28|e[6]>>>4,V=e[17]<<23|e[16]>>>9,W=e[16]<<23|e[17]>>>9,X=e[26]<<25|e[27]>>>7,Y=e[27]<<25|e[26]>>>7,Z=e[36]<<21|e[37]>>>11,$=e[37]<<21|e[36]>>>11,_=e[47]<<24|e[46]>>>8,tt=e[46]<<24|e[47]>>>8,et=e[8]<<27|e[9]>>>5,rt=e[9]<<27|e[8]>>>5,nt=e[18]<<20|e[19]>>>12,ot=e[19]<<20|e[18]>>>12,ft=e[29]<<7|e[28]>>>25,lt=e[28]<<7|e[29]>>>25,it=e[38]<<8|e[39]>>>24,at=e[39]<<8|e[38]>>>24,ct=e[48]<<14|e[49]>>>18,ut=e[49]<<14|e[48]>>>18;e[0]=w^~j&K,e[1]=A^~q&L,e[10]=R^~nt&g,e[11]=S^~ot&x,e[20]=M^~I&X,e[21]=T^~J&Y,e[30]=et^~U&v,e[31]=rt^~d&z,e[40]=G^~V&ft,e[41]=H^~W<,e[2]=j^~K&Z,e[3]=q^~L&$,e[12]=nt^~g&B,e[13]=ot^~x&C,e[22]=I^~X&it,e[23]=J^~Y&at,e[32]=U^~v&N,e[33]=d^~z&O,e[42]=V^~ft&b,e[43]=W^~lt&k,e[4]=K^~Z&ct,e[5]=L^~$&ut,e[14]=g^~B&P,e[15]=x^~C&Q,e[24]=X^~it&m,e[25]=Y^~at&E,e[34]=v^~N&_,e[35]=z^~O&tt,e[44]=ft^~b&D,e[45]=lt^~k&F,e[6]=Z^~ct&w,e[7]=$^~ut&A,e[16]=B^~P&R,e[17]=C^~Q&S,e[26]=it^~m&M,e[27]=at^~E&T,e[36]=N^~_&et,e[37]=O^~tt&rt,e[46]=b^~D&G,e[47]=k^~F&H,e[8]=ct^~w&j,e[9]=ut^~A&q,e[18]=P^~R&nt,e[19]=Q^~S&ot,e[28]=m^~M&I,e[29]=E^~T&J,e[38]=_^~et&U,e[39]=tt^~rt&d,e[48]=D^~G&V,e[49]=F^~H&W,e[0]^=t[r],e[1]^=t[r+1]}}function r(t){if(!(t instanceof Uint8Array))throw new TypeError("expected Uint8Array");let r=[];for(let t=0;t<50;t++)r[t]=0;let n,o=0,f=t.length,l=f>>2;for(;;){n=0;let f=Math.min(34,l);for(;n<f;)r[n++]^=t[o++]|t[o++]<<8|t[o++]<<16|t[o++]<<24;if(f<34)break;e(r),l-=34}let i=1;for(;o<f;)i=i<<8|t[--f];return r[n]^=i,r[33]^=2147483648,e(r),function(t){let e=t.length,r=new Uint8Array(e<<2),n=0;for(let e of t)r[n++]=e,r[n++]=e>>8,r[n++]=e>>16,r[n++]=e>>24;return r}(r.slice(0,8))}export{r as default};