1 |
- (window.webpackJsonp=window.webpackJsonp||[]).push([["npm.browserify-aes"],{"0145":function(e,t){t.encrypt=function(e,t){return e._cipher.encryptBlock(t)},t.decrypt=function(e,t){return e._cipher.decryptBlock(t)}},"09f5":function(e,t,r){var c=r("39f5"),i=r("8707").Buffer,n=r("6430");function a(e,t,r,a){n.call(this),this._cipher=new c.AES(t),this._prev=i.from(r),this._cache=i.allocUnsafe(0),this._secCache=i.allocUnsafe(0),this._decrypt=a,this._mode=e}r("3fb5")(a,n),a.prototype._update=function(e){return this._mode.encrypt(this,e,this._decrypt)},a.prototype._final=function(){this._cipher.scrub()},e.exports=a},3505:function(e,t,r){var c=r("8707").Buffer,i=r("8c8a");function n(e,t,r){var n=t.length,a=i(t,e._cache);return e._cache=e._cache.slice(n),e._prev=c.concat([e._prev,r?t:a]),a}t.encrypt=function(e,t,r){for(var i,a=c.allocUnsafe(0);t.length;){if(0===e._cache.length&&(e._cache=e._cipher.encryptBlock(e._prev),e._prev=c.allocUnsafe(0)),!(e._cache.length<=t.length)){a=c.concat([a,n(e,t,r)]);break}i=e._cache.length,a=c.concat([a,n(e,t.slice(0,i),r)]),t=t.slice(i)}return a}},"39f5":function(e,t,r){var c=r("8707").Buffer;function i(e){c.isBuffer(e)||(e=c.from(e));for(var t=e.length/4|0,r=new Array(t),i=0;i<t;i++)r[i]=e.readUInt32BE(4*i);return r}function n(e){for(;0<e.length;e++)e[0]=0}function a(e,t,r,c,i){for(var n,a,h,o,s=r[0],p=r[1],f=r[2],u=r[3],l=e[0]^t[0],_=e[1]^t[1],y=e[2]^t[2],v=e[3]^t[3],d=4,B=1;B<i;B++)n=s[l>>>24]^p[_>>>16&255]^f[y>>>8&255]^u[255&v]^t[d++],a=s[_>>>24]^p[y>>>16&255]^f[v>>>8&255]^u[255&l]^t[d++],h=s[y>>>24]^p[v>>>16&255]^f[l>>>8&255]^u[255&_]^t[d++],o=s[v>>>24]^p[l>>>16&255]^f[_>>>8&255]^u[255&y]^t[d++],l=n,_=a,y=h,v=o;return n=(c[l>>>24]<<24|c[_>>>16&255]<<16|c[y>>>8&255]<<8|c[255&v])^t[d++],a=(c[_>>>24]<<24|c[y>>>16&255]<<16|c[v>>>8&255]<<8|c[255&l])^t[d++],h=(c[y>>>24]<<24|c[v>>>16&255]<<16|c[l>>>8&255]<<8|c[255&_])^t[d++],o=(c[v>>>24]<<24|c[l>>>16&255]<<16|c[_>>>8&255]<<8|c[255&y])^t[d++],[n>>>=0,a>>>=0,h>>>=0,o>>>=0]}var h=[0,1,2,4,8,16,32,64,128,27,54],o=function(){for(var e=new Array(256),t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;for(var r=[],c=[],i=[[],[],[],[]],n=[[],[],[],[]],a=0,h=0,o=0;o<256;++o){var s=h^h<<1^h<<2^h<<3^h<<4;s=s>>>8^255&s^99,r[a]=s,c[s]=a;var p=e[a],f=e[p],u=e[f],l=257*e[s]^16843008*s;i[0][a]=l<<24|l>>>8,i[1][a]=l<<16|l>>>16,i[2][a]=l<<8|l>>>24,i[3][a]=l,l=16843009*u^65537*f^257*p^16843008*a,n[0][s]=l<<24|l>>>8,n[1][s]=l<<16|l>>>16,n[2][s]=l<<8|l>>>24,n[3][s]=l,0===a?a=h=1:(a=p^e[e[e[u^p]]],h^=e[e[h]])}return{SBOX:r,INV_SBOX:c,SUB_MIX:i,INV_SUB_MIX:n}}();function s(e){this._key=i(e),this._reset()}s.blockSize=16,s.keySize=32,s.prototype.blockSize=s.blockSize,s.prototype.keySize=s.keySize,s.prototype._reset=function(){for(var e=this._key,t=e.length,r=t+6,c=4*(r+1),i=[],n=0;n<t;n++)i[n]=e[n];for(n=t;n<c;n++){var a=i[n-1];n%t==0?(a=a<<8|a>>>24,a=o.SBOX[a>>>24]<<24|o.SBOX[a>>>16&255]<<16|o.SBOX[a>>>8&255]<<8|o.SBOX[255&a],a^=h[n/t|0]<<24):t>6&&n%t==4&&(a=o.SBOX[a>>>24]<<24|o.SBOX[a>>>16&255]<<16|o.SBOX[a>>>8&255]<<8|o.SBOX[255&a]),i[n]=i[n-t]^a}for(var s=[],p=0;p<c;p++){var f=c-p,u=i[f-(p%4?0:4)];s[p]=p<4||f<=4?u:o.INV_SUB_MIX[0][o.SBOX[u>>>24]]^o.INV_SUB_MIX[1][o.SBOX[u>>>16&255]]^o.INV_SUB_MIX[2][o.SBOX[u>>>8&255]]^o.INV_SUB_MIX[3][o.SBOX[255&u]]}this._nRounds=r,this._keySchedule=i,this._invKeySchedule=s},s.prototype.encryptBlockRaw=function(e){return a(e=i(e),this._keySchedule,o.SUB_MIX,o.SBOX,this._nRounds)},s.prototype.encryptBlock=function(e){var t=this.encryptBlockRaw(e),r=c.allocUnsafe(16);return r.writeUInt32BE(t[0],0),r.writeUInt32BE(t[1],4),r.writeUInt32BE(t[2],8),r.writeUInt32BE(t[3],12),r},s.prototype.decryptBlock=function(e){var t=(e=i(e))[1];e[1]=e[3],e[3]=t;var r=a(e,this._invKeySchedule,o.INV_SUB_MIX,o.INV_SBOX,this._nRounds),n=c.allocUnsafe(16);return n.writeUInt32BE(r[0],0),n.writeUInt32BE(r[3],4),n.writeUInt32BE(r[2],8),n.writeUInt32BE(r[1],12),n},s.prototype.scrub=function(){n(this._keySchedule),n(this._invKeySchedule),n(this._key)},e.exports.AES=s},"3f62":function(e,t,r){var c=r("8707").Buffer,i=c.alloc(16,0);function n(e){var t=c.allocUnsafe(16);return t.writeUInt32BE(e[0]>>>0,0),t.writeUInt32BE(e[1]>>>0,4),t.writeUInt32BE(e[2]>>>0,8),t.writeUInt32BE(e[3]>>>0,12),t}function a(e){this.h=e,this.state=c.alloc(16,0),this.cache=c.allocUnsafe(0)}a.prototype.ghash=function(e){for(var t=-1;++t<e.length;)this.state[t]^=e[t];this._multiply()},a.prototype._multiply=function(){for(var e,t,r=function(e){return[e.readUInt32BE(0),e.readUInt32BE(4),e.readUInt32BE(8),e.readUInt32BE(12)]}(this.h),c=[0,0,0,0],i=-1;++i<128;){for(0!=(this.state[~~(i/8)]&1<<7-i%8)&&(c[0]^=r[0],c[1]^=r[1],c[2]^=r[2],c[3]^=r[3]),t=0!=(1&r[3]),e=3;e>0;e--)r[e]=r[e]>>>1|(1&r[e-1])<<31;r[0]=r[0]>>>1,t&&(r[0]=r[0]^225<<24)}this.state=n(c)},a.prototype.update=function(e){var t;for(this.cache=c.concat([this.cache,e]);this.cache.length>=16;)t=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(t)},a.prototype.final=function(e,t){return this.cache.length&&this.ghash(c.concat([this.cache,i],16)),this.ghash(n([0,e,0,t])),this.state},e.exports=a},4228:function(e,t,r){var c=r("82f0"),i=r("8707").Buffer,n=r("bac2"),a=r("09f5"),h=r("6430"),o=r("39f5"),s=r("ae84");function p(e,t,r){h.call(this),this._cache=new f,this._last=void 0,this._cipher=new o.AES(t),this._prev=i.from(r),this._mode=e,this._autopadding=!0}function f(){this.cache=i.allocUnsafe(0)}function u(e,t,r){var h=n[e.toLowerCase()];if(!h)throw new TypeError("invalid suite type");if("string"==typeof r&&(r=i.from(r)),"GCM"!==h.mode&&r.length!==h.iv)throw new TypeError("invalid iv length "+r.length);if("string"==typeof t&&(t=i.from(t)),t.length!==h.key/8)throw new TypeError("invalid key length "+t.length);return"stream"===h.type?new a(h.module,t,r,!0):"auth"===h.type?new c(h.module,t,r,!0):new p(h.module,t,r)}r("3fb5")(p,h),p.prototype._update=function(e){var t,r;this._cache.add(e);for(var c=[];t=this._cache.get(this._autopadding);)r=this._mode.decrypt(this,t),c.push(r);return i.concat(c)},p.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return function(e){var t=e[15];if(t<1||t>16)throw new Error("unable to decrypt data");for(var r=-1;++r<t;)if(e[r+(16-t)]!==t)throw new Error("unable to decrypt data");if(16!==t)return e.slice(0,16-t)}(this._mode.decrypt(this,e));if(e)throw new Error("data not multiple of block length")},p.prototype.setAutoPadding=function(e){return this._autopadding=!!e,this},f.prototype.add=function(e){this.cache=i.concat([this.cache,e])},f.prototype.get=function(e){var t;if(e){if(this.cache.length>16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t}else if(this.cache.length>=16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t;return null},f.prototype.flush=function(){if(this.cache.length)return this.cache},t.createDecipher=function(e,t){var r=n[e.toLowerCase()];if(!r)throw new TypeError("invalid suite type");var c=s(t,!1,r.key,r.iv);return u(e,c.key,c.iv)},t.createDecipheriv=u},5165:function(e,t,r){(function(e){var c=r("8c8a");function i(e){return e._prev=e._cipher.encryptBlock(e._prev),e._prev}t.encrypt=function(t,r){for(;t._cache.length<r.length;)t._cache=e.concat([t._cache,i(t)]);var n=t._cache.slice(0,r.length);return t._cache=t._cache.slice(r.length),c(r,n)}}).call(this,r("b639").Buffer)},5239:function(e,t,r){var c=r("8707").Buffer;function i(e,t,r){for(var c,i,a=-1,h=0;++a<8;)c=t&1<<7-a?128:0,h+=(128&(i=e._cipher.encryptBlock(e._prev)[0]^c))>>a%8,e._prev=n(e._prev,r?c:i);return h}function n(e,t){var r=e.length,i=-1,n=c.allocUnsafe(e.length);for(e=c.concat([e,c.from([t])]);++i<r;)n[i]=e[i]<<1|e[i+1]>>7;return n}t.encrypt=function(e,t,r){for(var n=t.length,a=c.allocUnsafe(n),h=-1;++h<n;)a[h]=i(e,t[h],r);return a}},"62c9":function(e,t,r){var c=r("8707").Buffer;function i(e,t,r){var i=e._cipher.encryptBlock(e._prev)[0]^t;return e._prev=c.concat([e._prev.slice(1),c.from([r?t:i])]),i}t.encrypt=function(e,t,r){for(var n=t.length,a=c.allocUnsafe(n),h=-1;++h<n;)a[h]=i(e,t[h],r);return a}},"6ade":function(e,t,r){var c=r("8c8a"),i=r("8707").Buffer,n=r("bd9d");function a(e){var t=e._cipher.encryptBlockRaw(e._prev);return n(e._prev),t}t.encrypt=function(e,t){var r=Math.ceil(t.length/16),n=e._cache.length;e._cache=i.concat([e._cache,i.allocUnsafe(16*r)]);for(var h=0;h<r;h++){var o=a(e),s=n+16*h;e._cache.writeUInt32BE(o[0],s+0),e._cache.writeUInt32BE(o[1],s+4),e._cache.writeUInt32BE(o[2],s+8),e._cache.writeUInt32BE(o[3],s+12)}var p=e._cache.slice(0,t.length);return e._cache=e._cache.slice(t.length),c(t,p)}},"82f0":function(e,t,r){var c=r("39f5"),i=r("8707").Buffer,n=r("6430"),a=r("3fb5"),h=r("3f62"),o=r("8c8a"),s=r("bd9d");function p(e,t,r){if(12===t.length)return e._finID=i.concat([t,i.from([0,0,0,1])]),i.concat([t,i.from([0,0,0,2])]);var c=new h(r),n=t.length,a=n%16;c.update(t),a&&(a=16-a,c.update(i.alloc(a,0))),c.update(i.alloc(8,0));var o=8*n,p=i.alloc(8);p.writeUIntBE(o,0,8),c.update(p),e._finID=c.state;var f=i.from(e._finID);return s(f),f}function f(e,t,r,a){n.call(this);var o=i.alloc(4,0);this._cipher=new c.AES(t);var s=this._cipher.encryptBlock(o);this._ghash=new h(s),r=p(this,r,s),this._prev=i.from(r),this._cache=i.allocUnsafe(0),this._secCache=i.allocUnsafe(0),this._decrypt=a,this._alen=0,this._len=0,this._mode=e,this._authTag=null,this._called=!1}a(f,n),f.prototype._update=function(e){if(!this._called&&this._alen){var t=16-this._alen%16;t<16&&(t=i.alloc(t,0),this._ghash.update(t))}this._called=!0;var r=this._mode.encrypt(this,e);return this._decrypt?this._ghash.update(e):this._ghash.update(r),this._len+=e.length,r},f.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var e=o(this._ghash.final(8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt&&function(e,t){var r=0;e.length!==t.length&&r++;for(var c=Math.min(e.length,t.length),i=0;i<c;++i)r+=e[i]^t[i];return r}(e,this._authTag))throw new Error("Unsupported state or unable to authenticate data");this._authTag=e,this._cipher.scrub()},f.prototype.getAuthTag=function(){if(this._decrypt||!i.isBuffer(this._authTag))throw new Error("Attempting to get auth tag in unsupported state");return this._authTag},f.prototype.setAuthTag=function(e){if(!this._decrypt)throw new Error("Attempting to set auth tag in unsupported state");this._authTag=e},f.prototype.setAAD=function(e){if(this._called)throw new Error("Attempting to set AAD in unsupported state");this._ghash.update(e),this._alen+=e.length},e.exports=f},8947:function(e,t,r){var c=r("bac2"),i=r("82f0"),n=r("8707").Buffer,a=r("09f5"),h=r("6430"),o=r("39f5"),s=r("ae84");function p(e,t,r){h.call(this),this._cache=new u,this._cipher=new o.AES(t),this._prev=n.from(r),this._mode=e,this._autopadding=!0}r("3fb5")(p,h),p.prototype._update=function(e){var t,r;this._cache.add(e);for(var c=[];t=this._cache.get();)r=this._mode.encrypt(this,t),c.push(r);return n.concat(c)};var f=n.alloc(16,16);function u(){this.cache=n.allocUnsafe(0)}function l(e,t,r){var h=c[e.toLowerCase()];if(!h)throw new TypeError("invalid suite type");if("string"==typeof t&&(t=n.from(t)),t.length!==h.key/8)throw new TypeError("invalid key length "+t.length);if("string"==typeof r&&(r=n.from(r)),"GCM"!==h.mode&&r.length!==h.iv)throw new TypeError("invalid iv length "+r.length);return"stream"===h.type?new a(h.module,t,r):"auth"===h.type?new i(h.module,t,r):new p(h.module,t,r)}p.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return e=this._mode.encrypt(this,e),this._cipher.scrub(),e;if(!e.equals(f))throw this._cipher.scrub(),new Error("data not multiple of block length")},p.prototype.setAutoPadding=function(e){return this._autopadding=!!e,this},u.prototype.add=function(e){this.cache=n.concat([this.cache,e])},u.prototype.get=function(){if(this.cache.length>15){var e=this.cache.slice(0,16);return this.cache=this.cache.slice(16),e}return null},u.prototype.flush=function(){for(var e=16-this.cache.length,t=n.allocUnsafe(e),r=-1;++r<e;)t.writeUInt8(e,r);return n.concat([this.cache,t])},t.createCipheriv=l,t.createCipher=function(e,t){var r=c[e.toLowerCase()];if(!r)throw new TypeError("invalid suite type");var i=s(t,!1,r.key,r.iv);return l(e,i.key,i.iv)}},bac2:function(e,t,r){var c={ECB:r("0145"),CBC:r("c119"),CFB:r("3505"),CFB8:r("62c9"),CFB1:r("5239"),OFB:r("5165"),CTR:r("6ade"),GCM:r("6ade")},i=r("e85f");for(var n in i)i[n].module=c[i[n].mode];e.exports=i},bd9d:function(e,t){e.exports=function(e){for(var t,r=e.length;r--;){if(255!==(t=e.readUInt8(r))){t++,e.writeUInt8(t,r);break}e.writeUInt8(0,r)}}},c119:function(e,t,r){var c=r("8c8a");t.encrypt=function(e,t){var r=c(t,e._prev);return e._prev=e._cipher.encryptBlock(r),e._prev},t.decrypt=function(e,t){var r=e._prev;e._prev=t;var i=e._cipher.decryptBlock(t);return c(i,r)}},e85f:function(e){e.exports=JSON.parse('{"aes-128-ecb":{"cipher":"AES","key":128,"iv":0,"mode":"ECB","type":"block"},"aes-192-ecb":{"cipher":"AES","key":192,"iv":0,"mode":"ECB","type":"block"},"aes-256-ecb":{"cipher":"AES","key":256,"iv":0,"mode":"ECB","type":"block"},"aes-128-cbc":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes-192-cbc":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes-256-cbc":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes128":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes192":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes256":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes-128-cfb":{"cipher":"AES","key":128,"iv":16,"mode":"CFB","type":"stream"},"aes-192-cfb":{"cipher":"AES","key":192,"iv":16,"mode":"CFB","type":"stream"},"aes-256-cfb":{"cipher":"AES","key":256,"iv":16,"mode":"CFB","type":"stream"},"aes-128-cfb8":{"cipher":"AES","key":128,"iv":16,"mode":"CFB8","type":"stream"},"aes-192-cfb8":{"cipher":"AES","key":192,"iv":16,"mode":"CFB8","type":"stream"},"aes-256-cfb8":{"cipher":"AES","key":256,"iv":16,"mode":"CFB8","type":"stream"},"aes-128-cfb1":{"cipher":"AES","key":128,"iv":16,"mode":"CFB1","type":"stream"},"aes-192-cfb1":{"cipher":"AES","key":192,"iv":16,"mode":"CFB1","type":"stream"},"aes-256-cfb1":{"cipher":"AES","key":256,"iv":16,"mode":"CFB1","type":"stream"},"aes-128-ofb":{"cipher":"AES","key":128,"iv":16,"mode":"OFB","type":"stream"},"aes-192-ofb":{"cipher":"AES","key":192,"iv":16,"mode":"OFB","type":"stream"},"aes-256-ofb":{"cipher":"AES","key":256,"iv":16,"mode":"OFB","type":"stream"},"aes-128-ctr":{"cipher":"AES","key":128,"iv":16,"mode":"CTR","type":"stream"},"aes-192-ctr":{"cipher":"AES","key":192,"iv":16,"mode":"CTR","type":"stream"},"aes-256-ctr":{"cipher":"AES","key":256,"iv":16,"mode":"CTR","type":"stream"},"aes-128-gcm":{"cipher":"AES","key":128,"iv":12,"mode":"GCM","type":"auth"},"aes-192-gcm":{"cipher":"AES","key":192,"iv":12,"mode":"GCM","type":"auth"},"aes-256-gcm":{"cipher":"AES","key":256,"iv":12,"mode":"GCM","type":"auth"}}')},fda6:function(e,t,r){var c=r("8947"),i=r("4228"),n=r("e85f");t.createCipher=t.Cipher=c.createCipher,t.createCipheriv=t.Cipheriv=c.createCipheriv,t.createDecipher=t.Decipher=i.createDecipher,t.createDecipheriv=t.Decipheriv=i.createDecipheriv,t.listCiphers=t.getCiphers=function(){return Object.keys(n)}}}]);
|