11 lines
2.0 KiB
JavaScript
11 lines
2.0 KiB
JavaScript
/*
|
|
CryptoJS v3.0.2
|
|
code.google.com/p/crypto-js
|
|
(c) 2009-2012 by Jeff Mott. All rights reserved.
|
|
code.google.com/p/crypto-js/wiki/License
|
|
*/
|
|
(function(){function k(){var c=this._X,b=this._C;b[0]=b[0]+1295307597+this._b|0;b[1]=b[1]+3545052371+(1295307597>b[0]>>>0?1:0)|0;b[2]=b[2]+886263092+(3545052371>b[1]>>>0?1:0)|0;b[3]=b[3]+1295307597+(886263092>b[2]>>>0?1:0)|0;b[4]=b[4]+3545052371+(1295307597>b[3]>>>0?1:0)|0;b[5]=b[5]+886263092+(3545052371>b[4]>>>0?1:0)|0;b[6]=b[6]+1295307597+(886263092>b[5]>>>0?1:0)|0;b[7]=b[7]+3545052371+(1295307597>b[6]>>>0?1:0)|0;this._b=3545052371>b[7]>>>0?1:0;for(var a=0;8>a;a++){var d=c[a]+b[a],e=d&65535,g=d>>>
|
|
16;h[a]=((e*e>>>17)+e*g>>>15)+g*g^((d&4294901760)*d|0)+((d&65535)*d|0)}var b=h[0],a=h[1],d=h[2],e=h[3],g=h[4],f=h[5],i=h[6],j=h[7];c[0]=b+(j<<16|j>>>16)+(i<<16|i>>>16)|0;c[1]=a+(b<<8|b>>>24)+j|0;c[2]=d+(a<<16|a>>>16)+(b<<16|b>>>16)|0;c[3]=e+(d<<8|d>>>24)+a|0;c[4]=g+(e<<16|e>>>16)+(d<<16|d>>>16)|0;c[5]=f+(g<<8|g>>>24)+e|0;c[6]=i+(f<<16|f>>>16)+(g<<16|g>>>16)|0;c[7]=j+(i<<8|i>>>24)+f|0}var l=CryptoJS,m=l.lib.StreamCipher,f=[],h=[],n=l.algo.Rabbit=m.extend({_doReset:function(){for(var c=this._key.words,
|
|
b=c[0],a=c[1],d=c[2],e=c[3],c=this._X=[b,e<<16|d>>>16,a,b<<16|e>>>16,d,a<<16|b>>>16,e,d<<16|a>>>16],b=this._C=[d<<16|d>>>16,b&4294901760|a&65535,e<<16|e>>>16,a&4294901760|d&65535,b<<16|b>>>16,d&4294901760|e&65535,a<<16|a>>>16,e&4294901760|b&65535],a=this._b=0;4>a;a++)k.call(this);for(a=0;8>a;a++)b[a]^=c[a+4&7];if(c=this.cfg.iv){a=c.words;c=a[0];a=a[1];c=(c<<8|c>>>24)&16711935|(c<<24|c>>>8)&4278255360;a=(a<<8|a>>>24)&16711935|(a<<24|a>>>8)&4278255360;d=c>>>16|a&4294901760;e=a<<16|c&65535;b[0]^=c;b[1]^=
|
|
d;b[2]^=a;b[3]^=e;b[4]^=c;b[5]^=d;b[6]^=a;b[7]^=e;for(a=0;4>a;a++)k.call(this)}},_doProcessBlock:function(c,b){var a=this._X;k.call(this);f[0]=a[0]^a[5]>>>16^a[3]<<16;f[1]=a[2]^a[7]>>>16^a[5]<<16;f[2]=a[4]^a[1]>>>16^a[7]<<16;f[3]=a[6]^a[3]>>>16^a[1]<<16;for(a=0;4>a;a++){var d=f[a],d=(d<<8|d>>>24)&16711935|(d<<24|d>>>8)&4278255360;c[b+a]^=d}},blockSize:4,ivSize:2});l.Rabbit=m._createHelper(n)})();
|