Rabbit.js
19.1 KB
!function(n,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else if("object"==typeof exports)exports.JsCrypto=t();else{var r=t();for(var i in n.JsCrypto=n.JsCrypto||{},r)n.JsCrypto[i]=r[i]}}(this,(function(){return function(){"use strict";var n={6367:function(n,t,r){r.d(t,{Hmac:function(){return e}});var i=r(4768),e=function(){function n(n,t){this.i=n,"string"==typeof t&&(t=i.d.parse(t));var r=n.blockSize,e=4*r;t.nSigBytes>e&&(t=n.finalize(t)),t.clamp();for(var o=this.u=t.clone(),u=this.h=t.clone(),f=o.words,c=u.words,s=0;s<r;s++)f[s]^=1549556828,c[s]^=909522486;u.nSigBytes=e,o.nSigBytes=e,this.reset()}return n.prototype.reset=function(){this.i.reset(),this.i.update(this.h)},n.prototype.update=function(n){return this.i.update(n),this},n.prototype.finalize=function(n){var t=this.i.finalize(n);return this.i.reset(),this.i.finalize(this.u.clone().concat(t))},n}()},5561:function(n,t,r){r.d(t,{SHA256:function(){return v}});var i,e=r(1868),o=r(3354),u=(i=function(n,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])})(n,t)},function(n,t){function r(){this.constructor=n}i(n,t),n.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),f=[],c=[];function s(n){for(var t=Math.sqrt(n),r=2;r<=t;r++)if(!(n%r))return!1;return!0}function a(n){return 4294967296*(n-(0|n))|0}!function(){for(var n=2,t=0;t<64;)s(n)&&(t<8&&(f[t]=a(Math.pow(n,.5))),c[t]=a(Math.pow(n,1/3)),t++),n++}();var h=[],v=function(n){function t(t){var r=n.call(this,t)||this;return r.v=new o.e(f.slice(0)),r.l=t,t&&void 0!==t.hash&&(r.v=t.hash.clone()),r}return u(t,n),t.prototype.j=function(){this.v=new o.e(f.slice(0))},t.prototype.O=function(n,t){for(var r=this.v.words,i=r[0],e=r[1],o=r[2],u=r[3],f=r[4],s=r[5],a=r[6],v=r[7],w=0;w<64;w++){if(w<16)h[w]=0|n[t+w];else{var d=h[w-15],l=(d<<25|d>>>7)^(d<<14|d>>>18)^d>>>3,b=h[w-2],y=(b<<15|b>>>17)^(b<<13|b>>>19)^b>>>10;h[w]=l+h[w-7]+y+h[w-16]}var p=i&e^i&o^e&o,m=(i<<30|i>>>2)^(i<<19|i>>>13)^(i<<10|i>>>22),j=v+((f<<26|f>>>6)^(f<<21|f>>>11)^(f<<7|f>>>25))+(f&s^~f&a)+c[w]+h[w];v=a,a=s,s=f,f=u+j|0,u=o,o=e,e=i,i=j+(m+p)|0}r[0]=r[0]+i|0,r[1]=r[1]+e|0,r[2]=r[2]+o|0,r[3]=r[3]+u|0,r[4]=r[4]+f|0,r[5]=r[5]+s|0,r[6]=r[6]+a|0,r[7]=r[7]+v|0},t.prototype.A=function(){var n=this.I.words,t=8*this.k,r=8*this.I.nSigBytes;return n[r>>>5]|=128<<24-r%32,n[14+(r+64>>>9<<4)]=Math.floor(t/4294967296),n[15+(r+64>>>9<<4)]=t,this.I.nSigBytes=4*n.length,this.N(),this.v},t.prototype.clone=function(){return new t({hash:this.v,blockSize:this.U,data:this.I,nBytes:this.k})},t.hash=function(n,r){return new t(r).finalize(n)},t}(e.P)},3354:function(n,t,r){r.d(t,{e:function(){return o}});var i=r(5720),e=r(9054),o=function(){function n(t,r){if(Array.isArray(t)||!t)return this.F=Array.isArray(t)?t:[],void(this.H="number"==typeof r?r:4*this.F.length);if(t instanceof n)return this.F=t.words.slice(),void(this.H=t.nSigBytes);var i;try{t instanceof ArrayBuffer?i=new Uint8Array(t):(t instanceof Uint8Array||t instanceof Int8Array||t instanceof Uint8ClampedArray||t instanceof Int16Array||t instanceof Uint16Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Float32Array||t instanceof Float64Array)&&(i=new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}catch(n){throw new Error("Invalid argument")}if(!i)throw new Error("Invalid argument");for(var e=i.byteLength,o=[],u=0;u<e;u++)o[u>>>2]|=i[u]<<24-u%4*8;this.F=o,this.H=e}return Object.defineProperty(n.prototype,"nSigBytes",{get:function(){return this.H},set:function(n){this.H=n},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"words",{get:function(){return this.F},enumerable:!1,configurable:!0}),n.prototype.toString=function(n){return n?n.stringify(this):i.p.stringify(this)},n.prototype.toUint8Array=function(){for(var n=this.F,t=this.H,r=new Uint8Array(t),i=0;i<t;i++)r[i]=n[i>>>2]>>>24-i%4*8&255;return r},n.prototype.concat=function(n){var t=n.words.slice(),r=n.nSigBytes;if(this.clamp(),this.H%4)for(var i=0;i<r;i++){var e=t[i>>>2]>>>24-i%4*8&255;this.F[this.H+i>>>2]|=e<<24-(this.H+i)%4*8}else for(i=0;i<r;i+=4)this.F[this.H+i>>>2]=t[i>>>2];return this.H+=r,this},n.prototype.clamp=function(){var n=this.H;this.F[n>>>2]&=4294967295<<32-n%4*8,this.F.length=Math.ceil(n/4)},n.prototype.clone=function(){return new n(this.F.slice(),this.H)},n.random=function(t){for(var r=[],i=0;i<t;i+=4)r.push((0,e.M)());return new n(r,t)},n}()},7211:function(n,t,r){r.d(t,{C:function(){return o}});var i=r(3354),e=r(4768),o=function(){function n(n){this.T=0,this.U=0,this.l=n,this.I=n&&void 0!==n.data?n.data.clone():new i.e,this.k=n&&"number"==typeof n.nBytes?n.nBytes:0}return Object.defineProperty(n.prototype,"blockSize",{get:function(){return this.U},enumerable:!1,configurable:!0}),n.prototype.reset=function(n,t){this.I=void 0!==n?n.clone():new i.e,this.k="number"==typeof t?t:0},n.prototype.B=function(n){var t="string"==typeof n?e.d.parse(n):n;this.I.concat(t),this.k+=t.nSigBytes},n.prototype.N=function(n){var t,r=this.I.words,e=this.I.nSigBytes,o=this.U,u=e/(4*this.U),f=(u=n?Math.ceil(u):Math.max((0|u)-this.T,0))*o,c=Math.min(4*f,e);if(f){for(var s=0;s<f;s+=o)this.O(r,s);t=r.splice(0,f),this.I.nSigBytes-=c}return new i.e(t,c)},n.prototype.O=function(n,t){throw new Error("Not implemented")},n}()},1868:function(n,t,r){r.d(t,{P:function(){return u}});var i,e=r(7211),o=(i=function(n,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])})(n,t)},function(n,t){function r(){this.constructor=n}i(n,t),n.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),u=function(n){function t(t){var r=n.call(this,t)||this;return r.U=16,r.l=t,t&&"number"==typeof t.blockSize&&(r.U=t.blockSize),r.reset(t?t.data:void 0,t?t.nBytes:void 0),r}return o(t,n),Object.defineProperty(t.prototype,"blockSize",{get:function(){return this.U},enumerable:!1,configurable:!0}),t.prototype.reset=function(t,r){n.prototype.reset.call(this,t,r),this.j()},t.prototype.update=function(n){return this.B(n),this.N(),this},t.prototype.finalize=function(n){return n&&this.B(n),this.A()},t.prototype.j=function(){throw new Error("Not implemented")},t.prototype.A=function(){throw new Error("Not implemented")},t}(e.C)},9456:function(n,t,r){r.d(t,{t:function(){return f}});var i,e=r(7211),o=(i=function(n,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])})(n,t)},function(n,t){function r(){this.constructor=n}i(n,t),n.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),u=function(){return(u=Object.assign||function(n){for(var t,r=1,i=arguments.length;r<i;r++)for(var e in t=arguments[r])Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e]);return n}).apply(this,arguments)},f=function(n){function t(t){var r=n.call(this,t)||this;return r.R=1,r.l=t,r.J=t.key,r.K=void 0!==t.iv?t.iv:r.K,r.R=void 0!==t.transformMode?t.transformMode:r.R,r}return o(t,n),Object.defineProperty(t.prototype,"iv",{get:function(){return this.K},enumerable:!1,configurable:!0}),t.prototype.reset=function(t,r){n.prototype.reset.call(this,t,r),this.j()},t.prototype.process=function(n){return this.B(n),this.N()},t.prototype.finalize=function(n){return n&&this.B(n),this.A()},t.prototype.j=function(){throw new Error("Not implemented")},t.prototype.O=function(n,t){throw new Error("Not implemented")},t.prototype.A=function(){throw new Error("Not implemented")},t.createEncryptor=function(n,r){return new t(u(u({},r=void 0===r?{}:r),{key:n,transformMode:t.ENC_TRANSFORM_MODE}))},t.createDecryptor=function(n,r){return new t(u(u({},r=void 0===r?{}:r),{key:n,transformMode:t.DEC_TRANSFORM_MODE}))},t.ENC_TRANSFORM_MODE=1,t.DEC_TRANSFORM_MODE=2,t.keySize=4,t.ivSize=4,t}(e.C)},2505:function(n,t,r){r.d(t,{Q:function(){return e}});var i=r(1232),e=function(){function n(n){this.formatter=i.w,n&&(this.cipherText=n.cipherText,this.key=n.key,this.iv=n.iv,this.salt=n.salt,this.Algorithm=n.Algorithm,this.mode=n.mode,this.padding=n.padding,this.blockSize=n.blockSize,this.formatter=n.formatter||i.w)}return n.prototype.toString=function(n){return(n||this.formatter).stringify(this)},n}()},5693:function(n,t,r){r.d(t,{E:function(){return c}});var i=r(9109),e=r(2214),o=r(2505),u=r(1232),f=function(){return(f=Object.assign||function(n){for(var t,r=1,i=arguments.length;r<i;r++)for(var e in t=arguments[r])Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e]);return n}).apply(this,arguments)},c={encrypt:function(n,t,r,u){var c=u?f({},u):{},s=u&&u.KDF?u.KDF:e.s,a={};u&&u.kdfHasher&&(a.kdfHasher=u.kdfHasher),u&&u.kdfIterations&&(a.kdfIterations=u.kdfIterations),u&&u.kdfModule&&(a.kdfModule=u.kdfModule);var h=s.execute(r,n.keySize,n.ivSize,c.kdfSalt,a);c.iv=h.iv;var v=i.D.encrypt(n,t,h.key,c);return new o.Q(f(f({},v),{key:h.key,iv:h.iv,salt:h.salt}))},decrypt:function(n,t,r,o){var c=o?f({},o):{},s=c.KDF?c.KDF:e.s,a=c.formatter?c.formatter:u.w,h=(0,i.W)(t,a),v={};o&&o.kdfHasher&&(v.kdfHasher=o.kdfHasher),o&&o.kdfIterations&&(v.kdfIterations=o.kdfIterations),o&&o.kdfModule&&(v.kdfModule=o.kdfModule);var w=s.execute(r,n.keySize,n.ivSize,h.salt,v);return c.iv=w.iv,i.D.decrypt(n,h,w.key,c)}}},9109:function(n,t,r){r.d(t,{W:function(){return o},D:function(){return u}});var i=r(1232),e=r(2505);function o(n,t){return"string"==typeof n?t.parse(n):n}var u={encrypt:function(n,t,r,o){var u=n.createEncryptor(r,o),f=u.finalize(t);return new e.Q({cipherText:f,key:r,iv:u.iv,Algorithm:n,mode:u.mode,padding:u.padding,blockSize:u.blockSize,formatter:(null==o?void 0:o.formatter)||i.w})},decrypt:function(n,t,r,e){var u=n.createDecryptor(r,e),f=o(t,(null==e?void 0:e.formatter)||i.w);return u.finalize(f.cipherText||"")}}},30:function(n,t,r){r.d(t,{q:function(){return u}});var i,e=r(9456),o=(i=function(n,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])})(n,t)},function(n,t){function r(){this.constructor=n}i(n,t),n.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),u=function(n){function t(t){var r=n.call(this,t)||this;return r.U=1,r}return o(t,n),t.prototype.A=function(){return this.N(!0)},t}(e.t)},1232:function(n,t,r){r.d(t,{w:function(){return u}});var i=r(2505),e=r(3354),o=r(1773),u={stringify:function(n){var t=n.cipherText,r=n.salt;return t?r?new e.e([1398893684,1701076831]).concat(r).concat(t).toString(o.D):t.toString(o.D):""},parse:function(n){var t,r=o.D.parse(n),u=r.words;return 1398893684===u[0]&&1701076831===u[1]&&(t=new e.e(u.slice(2,4)),u.splice(0,4),r.nSigBytes-=16),new i.Q({cipherText:r,salt:t})}}},2214:function(n,t,r){r.d(t,{s:function(){return f}});var i=r(3354),e=r(2505),o=r(7008),u=function(){return(u=Object.assign||function(n){for(var t,r=1,i=arguments.length;r<i;r++)for(var e in t=arguments[r])Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e]);return n}).apply(this,arguments)},f={execute:function(n,t,r,f,c){f||(f=i.e.random(8));var s=c&&c.kdfModule||o.E,a=c?{Hasher:c.kdfHasher,iterations:c.kdfIterations}:{},h=s.getKey(n,f,u(u({},a),{keySize:t+r})),v=new i.e(h.words.slice(t),4*r);return h.nSigBytes=4*t,new e.Q({key:h,iv:v,salt:f})}}},7008:function(n,t,r){r.d(t,{E:function(){return s}});var i,e=r(5561),o=r(6367),u=r(3354),f=r(9541),c=(i=function(n,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])})(n,t)},function(n,t){function r(){this.constructor=n}i(n,t),n.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),s=function(n){function t(t){var r=n.call(this,t)||this;return r.L=4,r.V=e.SHA256,r.X=1e4,t&&(r.L=void 0!==t.keySize?t.keySize:r.L,r.V=void 0!==t.Hasher?t.Hasher:r.V,r.X=void 0!==t.iterations?t.iterations:r.X),r}return c(t,n),t.prototype.compute=function(n,t){for(var r=new o.Hmac(new this.V,n),i=new u.e,e=new u.e([1]),f=i.words,c=e.words,s=this.L,a=this.X;f.length<s;){var h=r.update(t).finalize(e);r.reset();for(var v=h.words,w=v.length,d=h,l=1;l<a;l++){d=r.finalize(d),r.reset();for(var b=d.words,y=0;y<w;y++)v[y]^=b[y]}i.concat(h),c[0]++}return i.nSigBytes=4*s,i},t.getKey=function(n,r,i){return new t(i).compute(n,r)},t}(f._)},9541:function(n,t,r){r.d(t,{_:function(){return i}});var i=function(){function n(n){this.l=n}return n.prototype.compute=function(n,t){throw new Error("Not implemented")},n.getKey=function(n,t,r){throw new Error("Not implemented")},n}()},1756:function(n,t,r){r.d(t,{w:function(){return u}});var i,e="undefined"!=typeof navigator&&navigator.userAgent?navigator.userAgent.toLowerCase():"",o=(i=parseInt((/msie (\d+)/.exec(e)||[])[1],10),isNaN(i)?(i=parseInt((/trident\/.*; rv:(\d+)/.exec(e)||[])[1],10),!isNaN(i)&&i):i);function u(n,t){return!1!==o&&(!t||("<"===n?o<t:"<="===n?o<=t:">"===n?o>t:">="===n?o>=t:o===t))}},1773:function(n,t,r){r.d(t,{D:function(){return f}});for(var i=r(3354),e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",o=[],u=0;u<e.length;u++)o[e.charCodeAt(u)]=u;var f={stringify:function(n){var t=n.words,r=n.nSigBytes;n.clamp();for(var i=[],o=0;o<r;o+=3)for(var u=(t[o>>>2]>>>24-o%4*8&255)<<16|(t[o+1>>>2]>>>24-(o+1)%4*8&255)<<8|t[o+2>>>2]>>>24-(o+2)%4*8&255,f=0;f<4&&o+.75*f<r;f++)i.push(e.charAt(u>>>6*(3-f)&63));var c=e.charAt(64);if(c)for(;i.length%4;)i.push(c);return i.join("")},parse:function(n){var t=n.length,r=e.charAt(64);if(r){var u=n.indexOf(r);-1!==u&&(t=u)}for(var f=[],c=0,s=0;s<t;s++)if(s%4){var a=o[n.charCodeAt(s-1)]<<s%4*2|o[n.charCodeAt(s)]>>>6-s%4*2;f[c>>>2]|=a<<24-c%4*8,c++}return new i.e(f,c)}}},5720:function(n,t,r){r.d(t,{p:function(){return e}});var i=r(3354),e={stringify:function(n){for(var t=n.nSigBytes,r=n.words,i=[],e=0;e<t;e++){var o=r[e>>>2]>>>24-e%4*8&255;i.push((o>>>4).toString(16)),i.push((15&o).toString(16))}return i.join("")},parse:function(n){var t=n.length;if(t%2!=0)throw new Error("Hex string count must be even");if(!/^[a-fA-F0-9]+$/.test(n))throw new Error("Invalid Hex string: "+n);for(var r=[],e=0;e<t;e+=2)r[e>>>3]|=parseInt(n.substr(e,2),16)<<24-e%8*4;return new i.e(r,t/2)}}},8702:function(n,t,r){r.d(t,{m:function(){return e}});var i=r(3354),e={stringify:function(n){for(var t=n.nSigBytes,r=n.words,i=[],e=0;e<t;e++){var o=r[e>>>2]>>>24-e%4*8&255;i.push(String.fromCharCode(o))}return i.join("")},parse:function(n){for(var t=n.length,r=[],e=0;e<t;e++)r[e>>>2]|=(255&n.charCodeAt(e))<<24-e%4*8;return new i.e(r,t)}}},4768:function(n,t,r){r.d(t,{d:function(){return e}});var i=r(8702),e={stringify:function(n){try{return decodeURIComponent(escape(i.m.stringify(n)))}catch(n){throw new Error("Malformed UTF-8 data")}},parse:function(n){return i.m.parse(unescape(encodeURIComponent(n)))}}},9054:function(n,t,r){r.d(t,{M:function(){return e}});var i=r(1756);var e=function(){if("undefined"!=typeof window){var n=window.crypto||window.msCrypto;if(!n){if((0,i.w)("<",11))return console.warn("IE <= 10 uses insecure random generator. Please consider to use IE11 or another modern browser"),function(){return Math.floor(512*Math.random())%256};throw new Error("Crypto module not found")}return function(){return n.getRandomValues(new Uint32Array(1))[0]}}return void 0!==r.g&&r.g.crypto?function(){return r.g.crypto.randomBytes(4).readInt32LE()}:function(){return require("crypto").randomBytes(4).readInt32LE()}}()}},t={};function r(i){var e=t[i];if(void 0!==e)return e.exports;var o=t[i]={exports:{}};return n[i](o,o.exports,r),o.exports}r.d=function(n,t){for(var i in t)r.o(t,i)&&!r.o(n,i)&&Object.defineProperty(n,i,{enumerable:!0,get:t[i]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(n){if("object"==typeof window)return window}}(),r.o=function(n,t){return Object.prototype.hasOwnProperty.call(n,t)},r.r=function(n){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"Y",{value:!0})};var i={};return function(){r.r(i),r.d(i,{Rabbit:function(){return c}});var n,t=r(30),e=r(5693),o=r(9109),u=(n=function(t,r){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])})(t,r)},function(t,r){function i(){this.constructor=t}n(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}),f=function(){return(f=Object.assign||function(n){for(var t,r=1,i=arguments.length;r<i;r++)for(var e in t=arguments[r])Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e]);return n}).apply(this,arguments)},c=function(n){function t(t){var r=n.call(this,t)||this;return r.U=4,r.S=[],r.C=[],r.G=[],r.Z=[],r.$=[],r.nn=0,r.l=t,r.j(),r}return u(t,n),t.prototype.j=function(){for(var n=this.J.words,t=this.K,r=0;r<4;r++)n[r]=16711935&(n[r]<<8|n[r]>>>24)|4278255360&(n[r]<<24|n[r]>>>8);var i=this.Z=[n[0],n[3]<<16|n[2]>>>16,n[1],n[0]<<16|n[3]>>>16,n[2],n[1]<<16|n[0]>>>16,n[3],n[2]<<16|n[1]>>>16],e=this.$=[n[2]<<16|n[2]>>>16,4294901760&n[0]|65535&n[1],n[3]<<16|n[3]>>>16,4294901760&n[1]|65535&n[2],n[0]<<16|n[0]>>>16,4294901760&n[2]|65535&n[3],n[1]<<16|n[1]>>>16,4294901760&n[3]|65535&n[0]];this.nn=0;for(r=0;r<4;r++)this.nextState();for(r=0;r<8;r++)e[r]^=i[r+4&7];if(t){var o=t.words,u=o[0],f=o[1],c=16711935&(u<<8|u>>>24)|4278255360&(u<<24|u>>>8),s=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8),a=c>>>16|4294901760&s,h=s<<16|65535&c;e[0]^=c,e[1]^=a,e[2]^=s,e[3]^=h,e[4]^=c,e[5]^=a,e[6]^=s,e[7]^=h;for(r=0;r<4;r++)this.nextState()}},t.prototype.O=function(n,t){var r=this.Z;this.nextState(),this.S[0]=r[0]^r[5]>>>16^r[3]<<16,this.S[1]=r[2]^r[7]>>>16^r[5]<<16,this.S[2]=r[4]^r[1]>>>16^r[7]<<16,this.S[3]=r[6]^r[3]>>>16^r[1]<<16;for(var i=0;i<4;i++)this.S[i]=16711935&(this.S[i]<<8|this.S[i]>>>24)|4278255360&(this.S[i]<<24|this.S[i]>>>8),n[t+i]^=this.S[i]},t.prototype.nextState=function(){for(var n=this.Z,t=this.$,r=0;r<8;r++)this.C[r]=t[r];t[0]=t[0]+1295307597+this.nn|0,t[1]=t[1]+3545052371+(t[0]>>>0<this.C[0]>>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0<this.C[1]>>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0<this.C[2]>>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0<this.C[3]>>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0<this.C[4]>>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0<this.C[5]>>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0<this.C[6]>>>0?1:0)|0,this.nn=t[7]>>>0<this.C[7]>>>0?1:0;for(r=0;r<8;r++){var i=n[r]+t[r],e=65535&i,o=i>>>16,u=((e*e>>>17)+e*o>>>15)+o*o,f=((4294901760&i)*i|0)+((65535&i)*i|0);this.G[r]=u^f}var c=this.G;n[0]=c[0]+(c[7]<<16|c[7]>>>16)+(c[6]<<16|c[6]>>>16)|0,n[1]=c[1]+(c[0]<<8|c[0]>>>24)+c[7]|0,n[2]=c[2]+(c[1]<<16|c[1]>>>16)+(c[0]<<16|c[0]>>>16)|0,n[3]=c[3]+(c[2]<<8|c[2]>>>24)+c[1]|0,n[4]=c[4]+(c[3]<<16|c[3]>>>16)+(c[2]<<16|c[2]>>>16)|0,n[5]=c[5]+(c[4]<<8|c[4]>>>24)+c[3]|0,n[6]=c[6]+(c[5]<<16|c[5]>>>16)+(c[4]<<16|c[4]>>>16)|0,n[7]=c[7]+(c[6]<<8|c[6]>>>24)+c[5]|0},t.createEncryptor=function(n,r){return new t(f(f({},r=void 0===r?{}:r),{key:n}))},t.createDecryptor=function(n,r){return new t(f(f({},r=void 0===r?{}:r),{key:n}))},t.encrypt=function(n,r,i){return"string"==typeof r?e.E.encrypt(t,n,r,i):o.D.encrypt(t,n,r,i)},t.decrypt=function(n,r,i){return"string"==typeof r?e.E.decrypt(t,n,r,i):o.D.decrypt(t,n,r,i)},t.ivSize=4,t}(t.q)}(),i}()}));