2 lines
18 KiB
JavaScript
2 lines
18 KiB
JavaScript
|
|
(self.webpackChunkmontana_messenger=self.webpackChunkmontana_messenger||[]).push([[7604],{7692(e,r,t){"use strict";t.d(r,{Ay:()=>g,gj:()=>p});var n=new Uint8Array(256),i=new Uint8Array(256),a=new Uint32Array(256),o=new Uint32Array(256),s=new Uint32Array(256),u=new Uint32Array(256),h=new Uint32Array(256),c=new Uint32Array(256),f=new Uint32Array(256),l=new Uint32Array(256);function v(e,r){return e.charCodeAt(r)<<24^e.charCodeAt(r+1)<<16^e.charCodeAt(r+2)<<8^e.charCodeAt(r+3)}function w(e){if(e instanceof Uint32Array)return e;if("string"==typeof e){if(e.length%4!=0)for(var r=e.length%4;r<=4;r++)e+="\0x00";var t=new Uint32Array(e.length/4);for(r=0;r<e.length;r+=4)t[r/4]=v(e,r);return t}if(e instanceof Uint8Array){for(t=new Uint32Array(e.length/4),r=0;r<e.length;r+=4)t[r/4]=e[r]<<24^e[r+1]<<16^e[r+2]<<8^e[r+3];return t}throw new Error("Unable to create 32-bit words")}function y(e,r,t){void 0===t&&(t=e);for(var n=0;n<e.length;n++)t[n]=e[n]^r[n]}!function(){for(var e,r,t,v,w,y=new Uint8Array(256),d=new Uint8Array(256),p=0,g=0,m=0;m<256;m++)y[m]=m<<1^283*(m>>7),d[y[m]^m]=m;for(;!n[p];p^=e||1)t=(t=g^g<<1^g<<2^g<<3^g<<4)>>8^255&t^99,n[p]=t,i[t]=p,w=16843009*y[r=y[e=y[p]]]^65537*r^257*e^16843008*p,v=257*y[t]^16843008*t,a[p]=v=v<<24^v>>>8,o[p]=v=v<<24^v>>>8,s[p]=v=v<<24^v>>>8,u[p]=v=v<<24^v>>>8,h[t]=w=w<<24^w>>>8,c[t]=w=w<<24^w>>>8,f[t]=w=w<<24^w>>>8,l[t]=w=w<<24^w>>>8,g=d[g]||1}();var d=function(){function e(e){var r=w(e);if(4!==r.length&&6!==r.length&&8!==r.length)throw new Error("Invalid key size");this.encKey=new Uint32Array(4*r.length+28),this.decKey=new Uint32Array(4*r.length+28),this.encKey.set(r);for(var t,i=1,a=r.length;a<4*r.length+28;a++)t=this.encKey[a-1],(a%r.length===0||8===r.length&&a%r.length===4)&&(t=n[t>>>24]<<24^n[t>>16&255]<<16^n[t>>8&255]<<8^n[255&t],a%r.length===0&&(t=t<<8^t>>>24^i<<24,i=i<<1^283*(i>>7))),this.encKey[a]=this.encKey[a-r.length]^t;for(var o=0;a;o++,a--)t=this.encKey[3&o?a:a-4],this.decKey[o]=a<=4||o<4?t:h[n[t>>>24]]^c[n[t>>16&255]]^f[n[t>>8&255]]^l[n[255&t]]}return e.prototype.encrypt=function(e){for(var r,t,i,h=w(e),c=new Uint32Array(4),f=h[0]^this.encKey[0],l=h[1]^this.encKey[1],v=h[2]^this.encKey[2],y=h[3]^this.encKey[3],d=this.encKey.length/4-2,p=4,g=0;g<d;g++)r=a[f>>>24]^o[l>>16&255]^s[v>>8&255]^u[255&y]^this.encKey[p],t=a[l>>>24]^o[v>>16&255]^s[y>>8&255]^u[255&f]^this.encKey[p+1],i=a[v>>>24]^o[y>>16&255]^s[f>>8&255]^u[255&l]^this.encKey[p+2],y=a[y>>>24]^o[f>>16&255]^s[l>>8&255]^u[255&v]^this.encKey[p+3],f=r,l=t,v=i,p+=4;for(g=0;g<4;g++)c[g]=n[f>>>24]<<24^n[l>>16&255]<<16^n[v>>8&255]<<8^n[255&y]^this.encKey[p++],r=f,f=l,l=v,v=y,y=r;return c},e.prototype.decrypt=function(e){for(var r,t,n,a=w(e),o=new Uint32Array(4),s=a[0]^this.decKey[0],u=a[3]^this.decKey[1],v=a[2]^this.decKey[2],y=a[1]^this.decKey[3],d=this.decKey.length/4-2,p=4,g=0;g<d;g++)r=h[s>>>24]^c[u>>16&255]^f[v>>8&255]^l[255&y]^this.decKey[p],t=h[u>>>24]^c[v>>16&255]^f[y>>8&255]^l[255&s]^this.decKey[p+1],n=h[v>>>24]^c[y>>16&255]^f[s>>8&255]^l[255&u]^this.decKey[p+2],y=h[y>>>24]^c[s>>16&255]^f[u>>8&255]^l[255&v]^this.decKey[p+3],s=r,u=t,v=n,p+=4;for(g=0;g<4;g++)o[3&-g]=i[s>>>24]<<24^i[u>>16&255]<<16^i[v>>8&255]<<8^i[255&y]^this.decKey[p++],r=s,s=u,u=v,v=y,y=r;return o},e}(),p=function(){function e(e,r,t){void 0===t&&(t=16),this.key=w(e),this.iv=w(r),this.cipher=new d(e),this.blockSize=t/4}return e.prototype.encrypt=function(e,r){for(var t=w(e),n=r||new Uint32Array(t.length),i=this.iv.subarray(this.blockSize,this.iv.length),a=this.iv.subarray(0,this.blockSize),o=new Uint32Array(this.blockSize),s=0;s<t.length;s+=this.blockSize){var u=t.subarray(s,s+this.blockSize);y(u,a,o);var h=this.cipher.encrypt(o);y(h,i),i=u,a=h;for(var c=s,f=0;c<t.length&&f<4;c++,f++)n[c]=h[f]}return n},e.prototype.decrypt=function(e,r){for(var t=w(e),n=r||new Uint32Array(t.length),i=this.iv.subarray(this.blockSize,this.iv.length),a=this.iv.subarray(0,this.blockSize),o=new Uint32Array(this.blockSize),s=0;s<n.length;s+=this.blockSize){var u=t.subarray(s,s+this.blockSize);y(u,i,o);var h=this.cipher.decrypt(o);y(h,a),a=u,i=h;for(var c=s,f=0;c<n.length&&f<4;c++,f++)n[
|
||
|
|
//# sourceMappingURL=7604.d67d11e9e1fc5a6a5372.js.map
|