|
@@ 12-12 (lines=1) @@
|
| 9 |
|
c._forceRed(this)},s.prototype.iadd=function(a,b){this._verify2(a,b);var c=a.iadd(b);return c.cmp(this.m)>=0&&c.isub(this.m),c},s.prototype.sub=function(a,b){this._verify2(a,b);var c=a.sub(b);return c.cmpn(0)<0&&c.iadd(this.m),c._forceRed(this)},s.prototype.isub=function(a,b){this._verify2(a,b);var c=a.isub(b);return c.cmpn(0)<0&&c.iadd(this.m),c},s.prototype.shl=function(a,b){return this._verify1(a),this.imod(a.ushln(b))},s.prototype.imul=function(a,b){return this._verify2(a,b),this.imod(a.imul(b))},s.prototype.mul=function(a,b){return this._verify2(a,b),this.imod(a.mul(b))},s.prototype.isqr=function(a){return this.imul(a,a.clone())},s.prototype.sqr=function(a){return this.mul(a,a)},s.prototype.sqrt=function(a){if(a.isZero())return a.clone();var b=this.m.andln(3);if(d(b%2===1),3===b){var c=this.m.add(new f(1)).iushrn(2);return this.pow(a,c)}for(var e=this.m.subn(1),g=0;!e.isZero()&&0===e.andln(1);)g++,e.iushrn(1);d(!e.isZero());var h=new f(1).toRed(this),i=h.redNeg(),j=this.m.subn(1).iushrn(1),k=this.m.bitLength();for(k=new f(2*k*k).toRed(this);0!==this.pow(k,j).cmp(i);)k.redIAdd(i);for(var l=this.pow(k,e),m=this.pow(a,e.addn(1).iushrn(1)),n=this.pow(a,e),o=g;0!==n.cmp(h);){for(var p=n,q=0;0!==p.cmp(h);q++)p=p.redSqr();d(q<o);var r=this.pow(l,new f(1).iushln(o-q-1));m=m.redMul(r),l=r.redSqr(),n=n.redMul(l),o=q}return m},s.prototype.invm=function(a){var b=a._invmp(this.m);return 0!==b.negative?(b.negative=0,this.imod(b).redNeg()):this.imod(b)},s.prototype.pow=function(a,b){if(b.isZero())return new f(1).toRed(this);if(0===b.cmpn(1))return a.clone();var c=4,d=new Array(1<<c);d[0]=new f(1).toRed(this),d[1]=a;for(var e=2;e<d.length;e++)d[e]=this.mul(d[e-1],a);var g=d[0],h=0,i=0,j=b.bitLength()%26;for(0===j&&(j=26),e=b.length-1;e>=0;e--){for(var k=b.words[e],l=j-1;l>=0;l--){var m=k>>l&1;g!==d[0]&&(g=this.sqr(g)),0!==m||0!==h?(h<<=1,h|=m,i++,(i===c||0===e&&0===l)&&(g=this.mul(g,d[h]),i=0,h=0)):i=0}j=26}return g},s.prototype.convertTo=function(a){var b=a.umod(this.m);return b===a?b.clone():b},s.prototype.convertFrom=function(a){var b=a.clone();return b.red=null,b},f.mont=function(a){return new t(a)},e(t,s),t.prototype.convertTo=function(a){return this.imod(a.ushln(this.shift))},t.prototype.convertFrom=function(a){var b=this.imod(a.mul(this.rinv));return b.red=null,b},t.prototype.imul=function(a,b){if(a.isZero()||b.isZero())return a.words[0]=0,a.length=1,a;var c=a.imul(b),d=c.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),e=c.isub(d).iushrn(this.shift),f=e;return e.cmp(this.m)>=0?f=e.isub(this.m):e.cmpn(0)<0&&(f=e.iadd(this.m)),f._forceRed(this)},t.prototype.mul=function(a,b){if(a.isZero()||b.isZero())return new f(0)._forceRed(this);var c=a.mul(b),d=c.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),e=c.isub(d).iushrn(this.shift),g=e;return e.cmp(this.m)>=0?g=e.isub(this.m):e.cmpn(0)<0&&(g=e.iadd(this.m)),g._forceRed(this)},t.prototype.invm=function(a){var b=this.imod(a._invmp(this.m).mul(this.r2));return b._forceRed(this)}}("undefined"==typeof b||b,this)},{buffer:77}],76:[function(a,b,c){function d(a){this.rand=a}var e;if(b.exports=function(a){return e||(e=new d(null)),e.generate(a)},b.exports.Rand=d,d.prototype.generate=function(a){return this._rand(a)},d.prototype._rand=function(a){if(this.rand.getBytes)return this.rand.getBytes(a);for(var b=new Uint8Array(a),c=0;c<b.length;c++)b[c]=this.rand.getByte();return b},"object"==typeof self)self.crypto&&self.crypto.getRandomValues?d.prototype._rand=function(a){var b=new Uint8Array(a);return self.crypto.getRandomValues(b),b}:self.msCrypto&&self.msCrypto.getRandomValues?d.prototype._rand=function(a){var b=new Uint8Array(a);return self.msCrypto.getRandomValues(b),b}:"object"==typeof window&&(d.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var f=a("crypto");if("function"!=typeof f.randomBytes)throw new Error("Not supported");d.prototype._rand=function(a){return f.randomBytes(a)}}catch(a){}},{crypto:77}],77:[function(a,b,c){},{}],78:[function(a,b,c){function d(a){Buffer.isBuffer(a)||(a=Buffer.from(a));for(var b=a.length/4|0,c=new Array(b),d=0;d<b;d++)c[d]=a.readUInt32BE(4*d);return c}function e(a){for(var b=0;b<a.length;a++)a[b]=0}function f(a,b,c,d,e){for(var f,g,h,i,j=c[0],k=c[1],l=c[2],m=c[3],n=a[0]^b[0],o=a[1]^b[1],p=a[2]^b[2],q=a[3]^b[3],r=4,s=1;s<e;s++)f=j[n>>>24]^k[o>>>16&255]^l[p>>>8&255]^m[255&q]^b[r++],g=j[o>>>24]^k[p>>>16&255]^l[q>>>8&255]^m[255&n]^b[r++],h=j[p>>>24]^k[q>>>16&255]^l[n>>>8&255]^m[255&o]^b[r++],i=j[q>>>24]^k[n>>>16&255]^l[o>>>8&255]^m[255&p]^b[r++],n=f,o=g,p=h,q=i;return f=(d[n>>>24]<<24|d[o>>>16&255]<<16|d[p>>>8&255]<<8|d[255&q])^b[r++],g=(d[o>>>24]<<24|d[p>>>16&255]<<16|d[q>>>8&255]<<8|d[255&n])^b[r++],h=(d[p>>>24]<<24|d[q>>>16&255]<<16|d[n>>>8&255]<<8|d[255&o])^b[r++],i=(d[q>>>24]<<24|d[n>>>16&255]<<16|d[o>>>8&255]<<8|d[255&p])^b[r++],f>>>=0,g>>>=0,h>>>=0,i>>>=0,[f,g,h,i]}function g(a){this._key=d(a),this._reset()}var Buffer=a("safe-buffer").Buffer,h=[0,1,2,4,8,16,32,64,128,27,54],i=function(){for(var a=new Array(256),b=0;b<256;b++)b<128?a[b]=b<<1:a[b]=b<<1^283;for(var c=[],d=[],e=[[],[],[],[]],f=[[],[],[],[]],g=0,h=0,i=0;i<256;++i){var j=h^h<<1^h<<2^h<<3^h<<4;j=j>>>8^255&j^99,c[g]=j,d[j]=g;var k=a[g],l=a[k],m=a[l],n=257*a[j]^16843008*j;e[0][g]=n<<24|n>>>8,e[1][g]=n<<16|n>>>16,e[2][g]=n<<8|n>>>24,e[3][g]=n,n=16843009*m^65537*l^257*k^16843008*g,f[0][j]=n<<24|n>>>8,f[1][j]=n<<16|n>>>16,f[2][j]=n<<8|n>>>24,f[3][j]=n,0===g?g=h=1:(g=k^a[a[a[m^k]]],h^=a[a[h]])}return{SBOX:c,INV_SBOX:d,SUB_MIX:e,INV_SUB_MIX:f}}();g.blockSize=16,g.keySize=32,g.prototype.blockSize=g.blockSize,g.prototype.keySize=g.keySize,g.prototype._reset=function(){for(var a=this._key,b=a.length,c=b+6,d=4*(c+1),e=[],f=0;f<b;f++)e[f]=a[f];for(f=b;f<d;f++){var g=e[f-1];f%b===0?(g=g<<8|g>>>24,g=i.SBOX[g>>>24]<<24|i.SBOX[g>>>16&255]<<16|i.SBOX[g>>>8&255]<<8|i.SBOX[255&g],g^=h[f/b|0]<<24):b>6&&f%b===4&&(g=i.SBOX[g>>>24]<<24|i.SBOX[g>>>16&255]<<16|i.SBOX[g>>>8&255]<<8|i.SBOX[255&g]),e[f]=e[f-b]^g}for(var j=[],k=0;k<d;k++){var l=d-k,m=e[l-(k%4?0:4)];k<4||l<=4?j[k]=m:j[k]=i.INV_SUB_MIX[0][i.SBOX[m>>>24]]^i.INV_SUB_MIX[1][i.SBOX[m>>>16&255]]^i.INV_SUB_MIX[2][i.SBOX[m>>>8&255]]^i.INV_SUB_MIX[3][i.SBOX[255&m]]}this._nRounds=c,this._keySchedule=e,this._invKeySchedule=j},g.prototype.encryptBlockRaw=function(a){return a=d(a),f(a,this._keySchedule,i.SUB_MIX,i.SBOX,this._nRounds)},g.prototype.encryptBlock=function(a){var b=this.encryptBlockRaw(a),c=Buffer.allocUnsafe(16);return c.writeUInt32BE(b[0],0),c.writeUInt32BE(b[1],4),c.writeUInt32BE(b[2],8),c.writeUInt32BE(b[3],12),c},g.prototype.decryptBlock=function(a){a=d(a);var b=a[1];a[1]=a[3],a[3]=b;var c=f(a,this._invKeySchedule,i.INV_SUB_MIX,i.INV_SBOX,this._nRounds),e=Buffer.allocUnsafe(16);return e.writeUInt32BE(c[0],0),e.writeUInt32BE(c[3],4),e.writeUInt32BE(c[2],8),e.writeUInt32BE(c[1],12),e},g.prototype.scrub=function(){e(this._keySchedule),e(this._invKeySchedule),e(this._key)},b.exports.AES=g},{"safe-buffer":288}],79:[function(a,b,c){function d(a,b){var c=0;a.length!==b.length&&c++;for(var d=Math.min(a.length,b.length),e=0;e<d;++e)c+=a[e]^b[e];return c}function e(a,b,c){if(12===b.length)return a._finID=Buffer.concat([b,Buffer.from([0,0,0,1])]),Buffer.concat([b,Buffer.from([0,0,0,2])]);var d=new j(c),e=b.length,f=e%16;d.update(b),f&&(f=16-f,d.update(Buffer.alloc(f,0))),d.update(Buffer.alloc(8,0));var g=8*e,h=Buffer.alloc(8);h.writeUIntBE(g,0,8),d.update(h),a._finID=d.state;var i=Buffer.from(a._finID);return l(i),i}function f(a,b,c,d){h.call(this);var f=Buffer.alloc(4,0);this._cipher=new g.AES(b);var i=this._cipher.encryptBlock(f);this._ghash=new j(i),c=e(this,c,i),this._prev=Buffer.from(c),this._cache=Buffer.allocUnsafe(0),this._secCache=Buffer.allocUnsafe(0),this._decrypt=d,this._alen=0,this._len=0,this._mode=a,this._authTag=null,this._called=!1}var g=a("./aes"),Buffer=a("safe-buffer").Buffer,h=a("cipher-base"),i=a("inherits"),j=a("./ghash"),k=a("buffer-xor"),l=a("./incr32");i(f,h),f.prototype._update=function(a){if(!this._called&&this._alen){var b=16-this._alen%16;b<16&&(b=Buffer.alloc(b,0),this._ghash.update(b))}this._called=!0;var c=this._mode.encrypt(this,a);return this._decrypt?this._ghash.update(a):this._ghash.update(c),this._len+=a.length,c},f.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var a=k(this._ghash.final(8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt&&d(a,this._authTag))throw new Error("Unsupported state or unable to authenticate data");this._authTag=a,this._cipher.scrub()},f.prototype.getAuthTag=function(){if(this._decrypt||!Buffer.isBuffer(this._authTag))throw new Error("Attempting to get auth tag in unsupported state");return this._authTag},f.prototype.setAuthTag=function(a){if(!this._decrypt)throw new Error("Attempting to set auth tag in unsupported state");this._authTag=a},f.prototype.setAAD=function(a){if(this._called)throw new Error("Attempting to set AAD in unsupported state");this._ghash.update(a),this._alen+=a.length},b.exports=f},{"./aes":78,"./ghash":83,"./incr32":84,"buffer-xor":103,"cipher-base":106,inherits:226,"safe-buffer":288}],80:[function(a,b,c){function d(){return Object.keys(g)}var e=a("./encrypter"),f=a("./decrypter"),g=a("./modes/list.json");c.createCipher=c.Cipher=e.createCipher,c.createCipheriv=c.Cipheriv=e.createCipheriv,c.createDecipher=c.Decipher=f.createDecipher,c.createDecipheriv=c.Decipheriv=f.createDecipheriv,c.listCiphers=c.getCiphers=d},{"./decrypter":81,"./encrypter":82,"./modes/list.json":92}],81:[function(a,b,c){function d(a,b,c){l.call(this),this._cache=new e,this._last=void 0,this._cipher=new m.AES(b),this._prev=Buffer.from(c),this._mode=a,this._autopadding=!0}function e(){this.cache=Buffer.allocUnsafe(0)}function f(a){for(var b=a[15],c=-1;++c<b;)if(a[c+(16-b)]!==b)throw new Error("unable to decrypt data");if(16!==b)return a.slice(0,16-b)}function g(a,b,c){var e=j[a.toLowerCase()];if(!e)throw new TypeError("invalid suite type");if("string"==typeof c&&(c=Buffer.from(c)),"GCM"!==e.mode&&c.length!==e.iv)throw new TypeError("invalid iv length "+c.length);if("string"==typeof b&&(b=Buffer.from(b)),b.length!==e.key/8)throw new TypeError("invalid key length "+b.length);return"stream"===e.type?new k(e.module,b,c,!0):"auth"===e.type?new i(e.module,b,c,!0):new d(e.module,b,c)}function h(a,b){var c=j[a.toLowerCase()];if(!c)throw new TypeError("invalid suite type");var d=n(b,!1,c.key,c.iv);return g(a,d.key,d.iv)}var i=a("./authCipher"),Buffer=a("safe-buffer").Buffer,j=a("./modes"),k=a("./streamCipher"),l=a("cipher-base"),m=a("./aes"),n=a("evp_bytestokey"),o=a("inherits");o(d,l),d.prototype._update=function(a){this._cache.add(a);for(var b,c,d=[];b=this._cache.get(this._autopadding);)c=this._mode.decrypt(this,b),d.push(c);return Buffer.concat(d)},d.prototype._final=function(){var a=this._cache.flush();if(this._autopadding)return f(this._mode.decrypt(this,a));if(a)throw new Error("data not multiple of block length")},d.prototype.setAutoPadding=function(a){return this._autopadding=!!a,this},e.prototype.add=function(a){this.cache=Buffer.concat([this.cache,a])},e.prototype.get=function(a){var b;if(a){if(this.cache.length>16)return b=this.cache.slice(0,16),this.cache=this.cache.slice(16),b}else if(this.cache.length>=16)return b=this.cache.slice(0,16),this.cache=this.cache.slice(16),b;return null},e.prototype.flush=function(){if(this.cache.length)return this.cache},c.createDecipher=h,c.createDecipheriv=g},{"./aes":78,"./authCipher":79,"./modes":91,"./streamCipher":94,"cipher-base":106,evp_bytestokey:209,inherits:226,"safe-buffer":288}],82:[function(a,b,c){function d(a,b,c){k.call(this),this._cache=new e,this._cipher=new l.AES(b),this._prev=Buffer.from(c),this._mode=a,this._autopadding=!0}function e(){this.cache=Buffer.allocUnsafe(0)}function f(a,b,c){var e=h[a.toLowerCase()];if(!e)throw new TypeError("invalid suite type");if("string"==typeof b&&(b=Buffer.from(b)),b.length!==e.key/8)throw new TypeError("invalid key length "+b.length);if("string"==typeof c&&(c=Buffer.from(c)),"GCM"!==e.mode&&c.length!==e.iv)throw new TypeError("invalid iv length "+c.length);return"stream"===e.type?new j(e.module,b,c):"auth"===e.type?new i(e.module,b,c):new d(e.module,b,c)}function g(a,b){var c=h[a.toLowerCase()];if(!c)throw new TypeError("invalid suite type");var d=m(b,!1,c.key,c.iv);return f(a,d.key,d.iv)}var h=a("./modes"),i=a("./authCipher"),Buffer=a("safe-buffer").Buffer,j=a("./streamCipher"),k=a("cipher-base"),l=a("./aes"),m=a("evp_bytestokey"),n=a("inherits");n(d,k),d.prototype._update=function(a){this._cache.add(a);for(var b,c,d=[];b=this._cache.get();)c=this._mode.encrypt(this,b),d.push(c);return Buffer.concat(d)};var o=Buffer.alloc(16,16);d.prototype._final=function(){var a=this._cache.flush();if(this._autopadding)return a=this._mode.encrypt(this,a),this._cipher.scrub(),a;if(!a.equals(o))throw this._cipher.scrub(),new Error("data not multiple of block length")},d.prototype.setAutoPadding=function(a){return this._autopadding=!!a,this},e.prototype.add=function(a){this.cache=Buffer.concat([this.cache,a])},e.prototype.get=function(){if(this.cache.length>15){var a=this.cache.slice(0,16);return this.cache=this.cache.slice(16),a}return null},e.prototype.flush=function(){for(var a=16-this.cache.length,b=Buffer.allocUnsafe(a),c=-1;++c<a;)b.writeUInt8(a,c);return Buffer.concat([this.cache,b])},c.createCipheriv=f,c.createCipher=g},{"./aes":78,"./authCipher":79,"./modes":91,"./streamCipher":94,"cipher-base":106,evp_bytestokey:209,inherits:226,"safe-buffer":288}],83:[function(a,b,c){function d(a){return[a.readUInt32BE(0),a.readUInt32BE(4),a.readUInt32BE(8),a.readUInt32BE(12)]}function e(a){var b=Buffer.allocUnsafe(16);return b.writeUInt32BE(a[0]>>>0,0),b.writeUInt32BE(a[1]>>>0,4),b.writeUInt32BE(a[2]>>>0,8),b.writeUInt32BE(a[3]>>>0,12),b}function f(a){this.h=a,this.state=Buffer.alloc(16,0),this.cache=Buffer.allocUnsafe(0)}var Buffer=a("safe-buffer").Buffer,g=Buffer.alloc(16,0);f.prototype.ghash=function(a){for(var b=-1;++b<a.length;)this.state[b]^=a[b];this._multiply()},f.prototype._multiply=function(){for(var a,b,c,f=d(this.h),g=[0,0,0,0],h=-1;++h<128;){for(b=0!==(this.state[~~(h/8)]&1<<7-h%8),b&&(g[0]^=f[0],g[1]^=f[1],g[2]^=f[2],g[3]^=f[3]),c=0!==(1&f[3]),a=3;a>0;a--)f[a]=f[a]>>>1|(1&f[a-1])<<31;f[0]=f[0]>>>1,c&&(f[0]=f[0]^225<<24)}this.state=e(g)},f.prototype.update=function(a){this.cache=Buffer.concat([this.cache,a]);for(var b;this.cache.length>=16;)b=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(b)},f.prototype.final=function(a,b){return this.cache.length&&this.ghash(Buffer.concat([this.cache,g],16)),this.ghash(e([0,a,0,b])),this.state},b.exports=f},{"safe-buffer":288}],84:[function(a,b,c){function d(a){for(var b,c=a.length;c--;){if(b=a.readUInt8(c),255!==b){b++,a.writeUInt8(b,c);break}a.writeUInt8(0,c)}}b.exports=d},{}],85:[function(a,b,c){var d=a("buffer-xor");c.encrypt=function(a,b){var c=d(b,a._prev);return a._prev=a._cipher.encryptBlock(c),a._prev},c.decrypt=function(a,b){var c=a._prev;a._prev=b;var e=a._cipher.decryptBlock(b);return d(e,c)}},{"buffer-xor":103}],86:[function(a,b,c){function d(a,b,c){var d=b.length,f=e(b,a._cache);return a._cache=a._cache.slice(d),a._prev=Buffer.concat([a._prev,c?b:f]),f}var Buffer=a("safe-buffer").Buffer,e=a("buffer-xor");c.encrypt=function(a,b,c){for(var e,f=Buffer.allocUnsafe(0);b.length;){if(0===a._cache.length&&(a._cache=a._cipher.encryptBlock(a._prev),a._prev=Buffer.allocUnsafe(0)),!(a._cache.length<=b.length)){f=Buffer.concat([f,d(a,b,c)]);break}e=a._cache.length,f=Buffer.concat([f,d(a,b.slice(0,e),c)]),b=b.slice(e)}return f}},{"buffer-xor":103,"safe-buffer":288}],87:[function(a,b,c){function d(a,b,c){for(var d,f,g,h=-1,i=8,j=0;++h<i;)d=a._cipher.encryptBlock(a._prev),f=b&1<<7-h?128:0,g=d[0]^f,j+=(128&g)>>h%8,a._prev=e(a._prev,c?f:g);return j}function e(a,b){var c=a.length,d=-1,e=Buffer.allocUnsafe(a.length);for(a=Buffer.concat([a,Buffer.from([b])]);++d<c;)e[d]=a[d]<<1|a[d+1]>>7;return e}var Buffer=a("safe-buffer").Buffer;c.encrypt=function(a,b,c){for(var e=b.length,f=Buffer.allocUnsafe(e),g=-1;++g<e;)f[g]=d(a,b[g],c);return f}},{"safe-buffer":288}],88:[function(a,b,c){function d(a,b,c){var d=a._cipher.encryptBlock(a._prev),e=d[0]^b;return a._prev=Buffer.concat([a._prev.slice(1),Buffer.from([c?b:e])]),e}var Buffer=a("safe-buffer").Buffer;c.encrypt=function(a,b,c){for(var e=b.length,f=Buffer.allocUnsafe(e),g=-1;++g<e;)f[g]=d(a,b[g],c);return f}},{"safe-buffer":288}],89:[function(a,b,c){function d(a){var b=a._cipher.encryptBlockRaw(a._prev);return f(a._prev),b}var e=a("buffer-xor"),Buffer=a("safe-buffer").Buffer,f=a("../incr32"),g=16;c.encrypt=function(a,b){var c=Math.ceil(b.length/g),f=a._cache.length;a._cache=Buffer.concat([a._cache,Buffer.allocUnsafe(c*g)]);for(var h=0;h<c;h++){var i=d(a),j=f+h*g;a._cache.writeUInt32BE(i[0],j+0),a._cache.writeUInt32BE(i[1],j+4),a._cache.writeUInt32BE(i[2],j+8),a._cache.writeUInt32BE(i[3],j+12)}var k=a._cache.slice(0,b.length);return a._cache=a._cache.slice(b.length),e(b,k)}},{"../incr32":84,"buffer-xor":103,"safe-buffer":288}],90:[function(a,b,c){c.encrypt=function(a,b){return a._cipher.encryptBlock(b)},c.decrypt=function(a,b){return a._cipher.decryptBlock(b)}},{}],91:[function(a,b,c){var d={ECB:a("./ecb"),CBC:a("./cbc"),CFB:a("./cfb"),CFB8:a("./cfb8"),CFB1:a("./cfb1"),OFB:a("./ofb"),CTR:a("./ctr"),GCM:a("./ctr")},e=a("./list.json");for(var f in e)e[f].module=d[e[f].mode];b.exports=e},{"./cbc":85,"./cfb":86,"./cfb1":87,"./cfb8":88,"./ctr":89,"./ecb":90,"./list.json":92,"./ofb":93}],92:[function(a,b,c){b.exports={"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"}}},{}],93:[function(a,b,c){(function(Buffer){function b(a){return a._prev=a._cipher.encryptBlock(a._prev),a._prev}var d=a("buffer-xor");c.encrypt=function(a,c){for(;a._cache.length<c.length;)a._cache=Buffer.concat([a._cache,b(a)]);var e=a._cache.slice(0,c.length);return a._cache=a._cache.slice(c.length),d(c,e)}}).call(this,a("buffer").Buffer)},{buffer:104,"buffer-xor":103}],94:[function(a,b,c){function d(a,b,c,d){f.call(this),this._cipher=new e.AES(b),this._prev=Buffer.from(c),this._cache=Buffer.allocUnsafe(0),this._secCache=Buffer.allocUnsafe(0),this._decrypt=d,this._mode=a}var e=a("./aes"),Buffer=a("safe-buffer").Buffer,f=a("cipher-base"),g=a("inherits");g(d,f),d.prototype._update=function(a){return this._mode.encrypt(this,a,this._decrypt)},d.prototype._final=function(){this._cipher.scrub()},b.exports=d},{"./aes":78,"cipher-base":106,inherits:226,"safe-buffer":288}],95:[function(a,b,c){function d(a,b){var c,d;if(a=a.toLowerCase(),m[a])c=m[a].key,d=m[a].iv;else{if(!l[a])throw new TypeError("invalid suite type");c=8*l[a].key,d=l[a].iv}var e=i(b,!1,c,d);return f(a,e.key,e.iv)}function e(a,b){var c,d;if(a=a.toLowerCase(),m[a])c=m[a].key,d=m[a].iv;else{if(!l[a])throw new TypeError("invalid suite type");c=8*l[a].key,d=l[a].iv}var e=i(b,!1,c,d);return g(a,e.key,e.iv)}function f(a,b,c){if(a=a.toLowerCase(),m[a])return j.createCipheriv(a,b,c);if(l[a])return new k({key:b,iv:c,mode:a});throw new TypeError("invalid suite type")}function g(a,b,c){if(a=a.toLowerCase(),m[a])return j.createDecipheriv(a,b,c);if(l[a])return new k({key:b,iv:c,mode:a,decrypt:!0});throw new TypeError("invalid suite type")}function h(){return Object.keys(l).concat(j.getCiphers())}var i=a("evp_bytestokey"),j=a("browserify-aes/browser"),k=a("browserify-des"),l=a("browserify-des/modes"),m=a("browserify-aes/modes");c.createCipher=c.Cipher=d,c.createCipheriv=c.Cipheriv=f,c.createDecipher=c.Decipher=e,c.createDecipheriv=c.Decipheriv=g,c.listCiphers=c.getCiphers=h},{"browserify-aes/browser":80,"browserify-aes/modes":91,"browserify-des":96,"browserify-des/modes":97,evp_bytestokey:209}],96:[function(a,b,c){(function(Buffer){function c(a){d.call(this);var b,c=a.mode.toLowerCase(),e=g[c];b=a.decrypt?"decrypt":"encrypt";var f=a.key;"des-ede"!==c&&"des-ede-cbc"!==c||(f=Buffer.concat([f,f.slice(0,8)]));var h=a.iv;this._des=e.create({key:f,iv:h,type:b})}var d=a("cipher-base"),e=a("des.js"),f=a("inherits"),g={"des-ede3-cbc":e.CBC.instantiate(e.EDE),"des-ede3":e.EDE,"des-ede-cbc":e.CBC.instantiate(e.EDE),"des-ede":e.EDE,"des-cbc":e.CBC.instantiate(e.DES),"des-ecb":e.DES};g.des=g["des-cbc"],g.des3=g["des-ede3-cbc"],b.exports=c,f(c,d),c.prototype._update=function(a){return new Buffer(this._des.update(a))},c.prototype._final=function(){return new Buffer(this._des.final())}}).call(this,a("buffer").Buffer)},{buffer:104,"cipher-base":106,"des.js":177,inherits:226}],97:[function(a,b,c){c["des-ecb"]={key:8,iv:0},c["des-cbc"]=c.des={key:8,iv:8},c["des-ede3-cbc"]=c.des3={key:24,iv:8},c["des-ede3"]={key:24,iv:0},c["des-ede-cbc"]={key:16,iv:8},c["des-ede"]={key:16,iv:0}},{}],98:[function(a,b,c){arguments[4][73][0].apply(c,arguments)},{"base-x":21,dup:73}],99:[function(a,b,c){(function(Buffer){"use strict";var c=a("bs58");b.exports=function(a){function b(b){var d=a(b);return c.encode(Buffer.concat([b,d],b.length+4))}function d(b){var c=b.slice(0,-4),d=b.slice(-4),e=a(c);if(!(d[0]^e[0]|d[1]^e[1]|d[2]^e[2]|d[3]^e[3]))return c}function e(a){var b=c.decodeUnsafe(a);if(b)return d(b)}function f(b){var e=c.decode(b),f=d(e,a);if(!f)throw new Error("Invalid checksum");return f}return{encode:b,decode:f,decodeUnsafe:e}}}).call(this,a("buffer").Buffer)},{bs58:98,buffer:104}],100:[function(a,b,c){"use strict";function d(a){var b=e("sha256").update(a).digest();return e("sha256").update(b).digest()}var e=a("create-hash"),f=a("./base");b.exports=f(d)},{"./base":99,"create-hash":110}],101:[function(a,b,c){(function(Buffer){"use strict";b.exports=function(a,b){if(!Buffer.isBuffer(a)||!Buffer.isBuffer(b))throw new TypeError("Arguments must be Buffers");if(a===b)return!0;if("function"==typeof a.equals)return a.equals(b);if(a.length!==b.length)return!1;for(var c=0;c<a.length;c++)if(a[c]!==b[c])return!1;return!0}}).call(this,{isBuffer:a("../is-buffer/index.js")})},{"../is-buffer/index.js":227}],102:[function(a,b,c){(function(Buffer){b.exports=function(a){for(var b=new Buffer(a.length),c=0,d=a.length-1;c<=d;++c,--d)b[c]=a[d],b[d]=a[c];return b}}).call(this,a("buffer").Buffer)},{buffer:104}],103:[function(a,b,c){(function(Buffer){b.exports=function(a,b){for(var c=Math.min(a.length,b.length),d=new Buffer(c),e=0;e<c;++e)d[e]=a[e]^b[e];return d}}).call(this,a("buffer").Buffer)},{buffer:104}],104:[function(a,b,c){"use strict";function d(){try{var a=new Uint8Array(1);return a.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===a.foo()}catch(a){return!1}}function e(a){if(a>Y)throw new RangeError("Invalid typed array length");var b=new Uint8Array(a);return b.__proto__=Buffer.prototype,b}function Buffer(a,b,c){if("number"==typeof a){if("string"==typeof b)throw new Error("If encoding is specified then the first argument must be a string");return i(a)}return f(a,b,c)}function f(a,b,c){if("number"==typeof a)throw new TypeError('"value" argument must not be a number');return T(a)?l(a,b,c):"string"==typeof a?j(a,b):m(a)}function g(a){if("number"!=typeof a)throw new TypeError('"size" argument must be a number');if(a<0)throw new RangeError('"size" argument must not be negative')}function h(a,b,c){return g(a),a<=0?e(a):void 0!==b?"string"==typeof c?e(a).fill(b,c):e(a).fill(b):e(a)}function i(a){return g(a),e(a<0?0:0|n(a))}function j(a,b){if("string"==typeof b&&""!==b||(b="utf8"),!Buffer.isEncoding(b))throw new TypeError('"encoding" must be a valid string encoding');var c=0|p(a,b),d=e(c),f=d.write(a,b);return f!==c&&(d=d.slice(0,f)),d}function k(a){for(var b=a.length<0?0:0|n(a.length),c=e(b),d=0;d<b;d+=1)c[d]=255&a[d];return c}function l(a,b,c){if(b<0||a.byteLength<b)throw new RangeError("'offset' is out of bounds");if(a.byteLength<b+(c||0))throw new RangeError("'length' is out of bounds");var d;return d=void 0===b&&void 0===c?new Uint8Array(a):void 0===c?new Uint8Array(a,b):new Uint8Array(a,b,c),d.__proto__=Buffer.prototype,d}function m(a){if(Buffer.isBuffer(a)){var b=0|n(a.length),c=e(b);return 0===c.length?c:(a.copy(c,0,0,b),c)}if(a){if(U(a)||"length"in a)return"number"!=typeof a.length||V(a.length)?e(0):k(a);if("Buffer"===a.type&&Array.isArray(a.data))return k(a.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function n(a){if(a>=Y)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Y.toString(16)+" bytes");return 0|a}function o(a){return+a!=a&&(a=0),Buffer.alloc(+a)}function p(a,b){if(Buffer.isBuffer(a))return a.length;if(U(a)||T(a))return a.byteLength;"string"!=typeof a&&(a=""+a);var c=a.length;if(0===c)return 0;for(var d=!1;;)switch(b){case"ascii":case"latin1":case"binary":return c;case"utf8":case"utf-8":case void 0:return O(a).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*c;case"hex":return c>>>1;case"base64":return R(a).length;default:if(d)return O(a).length;b=(""+b).toLowerCase(),d=!0}}function q(a,b,c){var d=!1;if((void 0===b||b<0)&&(b=0),b>this.length)return"";if((void 0===c||c>this.length)&&(c=this.length),c<=0)return"";if(c>>>=0,b>>>=0,c<=b)return"";for(a||(a="utf8");;)switch(a){case"hex":return F(this,b,c);case"utf8":case"utf-8":return B(this,b,c);case"ascii":return D(this,b,c);case"latin1":case"binary":return E(this,b,c);case"base64":return A(this,b,c);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return G(this,b,c);default:if(d)throw new TypeError("Unknown encoding: "+a);a=(a+"").toLowerCase(),d=!0}}function r(a,b,c){var d=a[b];a[b]=a[c],a[c]=d}function s(a,b,c,d,e){if(0===a.length)return-1;if("string"==typeof c?(d=c,c=0):c>2147483647?c=2147483647:c<-2147483648&&(c=-2147483648),c=+c,V(c)&&(c=e?0:a.length-1),c<0&&(c=a.length+c),c>=a.length){if(e)return-1;c=a.length-1}else if(c<0){if(!e)return-1;c=0}if("string"==typeof b&&(b=Buffer.from(b,d)),Buffer.isBuffer(b))return 0===b.length?-1:t(a,b,c,d,e);if("number"==typeof b)return b&=255,"function"==typeof Uint8Array.prototype.indexOf?e?Uint8Array.prototype.indexOf.call(a,b,c):Uint8Array.prototype.lastIndexOf.call(a,b,c):t(a,[b],c,d,e);throw new TypeError("val must be string, number or Buffer")}function t(a,b,c,d,e){function f(a,b){return 1===g?a[b]:a.readUInt16BE(b*g)}var g=1,h=a.length,i=b.length;if(void 0!==d&&(d=String(d).toLowerCase(),"ucs2"===d||"ucs-2"===d||"utf16le"===d||"utf-16le"===d)){if(a.length<2||b.length<2)return-1;g=2,h/=2,i/=2,c/=2}var j;if(e){var k=-1;for(j=c;j<h;j++)if(f(a,j)===f(b,k===-1?0:j-k)){if(k===-1&&(k=j),j-k+1===i)return k*g}else k!==-1&&(j-=j-k),k=-1}else for(c+i>h&&(c=h-i),j=c;j>=0;j--){for(var l=!0,m=0;m<i;m++)if(f(a,j+m)!==f(b,m)){l=!1;break}if(l)return j}return-1}function u(a,b,c,d){c=Number(c)||0;var e=a.length-c;d?(d=Number(d),d>e&&(d=e)):d=e;var f=b.length;if(f%2!==0)throw new TypeError("Invalid hex string");d>f/2&&(d=f/2);for(var g=0;g<d;++g){var h=parseInt(b.substr(2*g,2),16);if(V(h))return g;a[c+g]=h}return g}function v(a,b,c,d){return S(O(b,a.length-c),a,c,d)}function w(a,b,c,d){return S(P(b),a,c,d)}function x(a,b,c,d){return w(a,b,c,d)}function y(a,b,c,d){return S(R(b),a,c,d)}function z(a,b,c,d){return S(Q(b,a.length-c),a,c,d)}function A(a,b,c){return 0===b&&c===a.length?W.fromByteArray(a):W.fromByteArray(a.slice(b,c))}function B(a,b,c){c=Math.min(a.length,c);for(var d=[],e=b;e<c;){var f=a[e],g=null,h=f>239?4:f>223?3:f>191?2:1;if(e+h<=c){var i,j,k,l;switch(h){case 1:f<128&&(g=f);break;case 2:i=a[e+1],128===(192&i)&&(l=(31&f)<<6|63&i,l>127&&(g=l));break;case 3:i=a[e+1],j=a[e+2],128===(192&i)&&128===(192&j)&&(l=(15&f)<<12|(63&i)<<6|63&j,l>2047&&(l<55296||l>57343)&&(g=l));break;case 4:i=a[e+1],j=a[e+2],k=a[e+3],128===(192&i)&&128===(192&j)&&128===(192&k)&&(l=(15&f)<<18|(63&i)<<12|(63&j)<<6|63&k,l>65535&&l<1114112&&(g=l))}}null===g?(g=65533,h=1):g>65535&&(g-=65536,d.push(g>>>10&1023|55296),g=56320|1023&g),d.push(g),e+=h}return C(d)}function C(a){var b=a.length;if(b<=Z)return String.fromCharCode.apply(String,a);for(var c="",d=0;d<b;)c+=String.fromCharCode.apply(String,a.slice(d,d+=Z));return c}function D(a,b,c){var d="";c=Math.min(a.length,c);for(var e=b;e<c;++e)d+=String.fromCharCode(127&a[e]);return d}function E(a,b,c){var d="";c=Math.min(a.length,c);for(var e=b;e<c;++e)d+=String.fromCharCode(a[e]);return d}function F(a,b,c){var d=a.length;(!b||b<0)&&(b=0),(!c||c<0||c>d)&&(c=d);for(var e="",f=b;f<c;++f)e+=N(a[f]);return e}function G(a,b,c){for(var d=a.slice(b,c),e="",f=0;f<d.length;f+=2)e+=String.fromCharCode(d[f]+256*d[f+1]);return e}function H(a,b,c){if(a%1!==0||a<0)throw new RangeError("offset is not uint");if(a+b>c)throw new RangeError("Trying to access beyond buffer length")}function I(a,b,c,d,e,f){if(!Buffer.isBuffer(a))throw new TypeError('"buffer" argument must be a Buffer instance');if(b>e||b<f)throw new RangeError('"value" argument is out of bounds');if(c+d>a.length)throw new RangeError("Index out of range")}function J(a,b,c,d,e,f){if(c+d>a.length)throw new RangeError("Index out of range");if(c<0)throw new RangeError("Index out of range")}function K(a,b,c,d,e){return b=+b,c>>>=0,e||J(a,b,c,4,3.4028234663852886e38,-3.4028234663852886e38),X.write(a,b,c,d,23,4),c+4}function L(a,b,c,d,e){return b=+b,c>>>=0,e||J(a,b,c,8,1.7976931348623157e308,-1.7976931348623157e308),X.write(a,b,c,d,52,8),c+8}function M(a){if(a=a.trim().replace($,""),a.length<2)return"";for(;a.length%4!==0;)a+="=";return a}function N(a){return a<16?"0"+a.toString(16):a.toString(16)}function O(a,b){b=b||1/0;for(var c,d=a.length,e=null,f=[],g=0;g<d;++g){if(c=a.charCodeAt(g),c>55295&&c<57344){if(!e){if(c>56319){(b-=3)>-1&&f.push(239,191,189);continue}if(g+1===d){(b-=3)>-1&&f.push(239,191,189);continue}e=c;continue}if(c<56320){(b-=3)>-1&&f.push(239,191,189),e=c;continue}c=(e-55296<<10|c-56320)+65536}else e&&(b-=3)>-1&&f.push(239,191,189);if(e=null,c<128){if((b-=1)<0)break;f.push(c)}else if(c<2048){if((b-=2)<0)break;f.push(c>>6|192,63&c|128)}else if(c<65536){if((b-=3)<0)break;f.push(c>>12|224,c>>6&63|128,63&c|128)}else{if(!(c<1114112))throw new Error("Invalid code point");if((b-=4)<0)break;f.push(c>>18|240,c>>12&63|128,c>>6&63|128,63&c|128)}}return f}function P(a){for(var b=[],c=0;c<a.length;++c)b.push(255&a.charCodeAt(c));return b}function Q(a,b){for(var c,d,e,f=[],g=0;g<a.length&&!((b-=2)<0);++g)c=a.charCodeAt(g),d=c>>8,e=c%256,f.push(e),f.push(d); |
| 10 |
|
return f}function R(a){return W.toByteArray(M(a))}function S(a,b,c,d){for(var e=0;e<d&&!(e+c>=b.length||e>=a.length);++e)b[e+c]=a[e];return e}function T(a){return a instanceof ArrayBuffer||null!=a&&null!=a.constructor&&"ArrayBuffer"===a.constructor.name&&"number"==typeof a.byteLength}function U(a){return"function"==typeof ArrayBuffer.isView&&ArrayBuffer.isView(a)}function V(a){return a!==a}var W=a("base64-js"),X=a("ieee754");c.Buffer=Buffer,c.SlowBuffer=o,c.INSPECT_MAX_BYTES=50;var Y=2147483647;c.kMaxLength=Y,Buffer.TYPED_ARRAY_SUPPORT=d(),Buffer.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),"undefined"!=typeof Symbol&&Symbol.species&&Buffer[Symbol.species]===Buffer&&Object.defineProperty(Buffer,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),Buffer.poolSize=8192,Buffer.from=function(a,b,c){return f(a,b,c)},Buffer.prototype.__proto__=Uint8Array.prototype,Buffer.__proto__=Uint8Array,Buffer.alloc=function(a,b,c){return h(a,b,c)},Buffer.allocUnsafe=function(a){return i(a)},Buffer.allocUnsafeSlow=function(a){return i(a)},Buffer.isBuffer=function(a){return null!=a&&a._isBuffer===!0},Buffer.compare=function(a,b){if(!Buffer.isBuffer(a)||!Buffer.isBuffer(b))throw new TypeError("Arguments must be Buffers");if(a===b)return 0;for(var c=a.length,d=b.length,e=0,f=Math.min(c,d);e<f;++e)if(a[e]!==b[e]){c=a[e],d=b[e];break}return c<d?-1:d<c?1:0},Buffer.isEncoding=function(a){switch(String(a).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},Buffer.concat=function(a,b){if(!Array.isArray(a))throw new TypeError('"list" argument must be an Array of Buffers');if(0===a.length)return Buffer.alloc(0);var c;if(void 0===b)for(b=0,c=0;c<a.length;++c)b+=a[c].length;var d=Buffer.allocUnsafe(b),e=0;for(c=0;c<a.length;++c){var f=a[c];if(!Buffer.isBuffer(f))throw new TypeError('"list" argument must be an Array of Buffers');f.copy(d,e),e+=f.length}return d},Buffer.byteLength=p,Buffer.prototype._isBuffer=!0,Buffer.prototype.swap16=function(){var a=this.length;if(a%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var b=0;b<a;b+=2)r(this,b,b+1);return this},Buffer.prototype.swap32=function(){var a=this.length;if(a%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var b=0;b<a;b+=4)r(this,b,b+3),r(this,b+1,b+2);return this},Buffer.prototype.swap64=function(){var a=this.length;if(a%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var b=0;b<a;b+=8)r(this,b,b+7),r(this,b+1,b+6),r(this,b+2,b+5),r(this,b+3,b+4);return this},Buffer.prototype.toString=function(){var a=this.length;return 0===a?"":0===arguments.length?B(this,0,a):q.apply(this,arguments)},Buffer.prototype.equals=function(a){if(!Buffer.isBuffer(a))throw new TypeError("Argument must be a Buffer");return this===a||0===Buffer.compare(this,a)},Buffer.prototype.inspect=function(){var a="",b=c.INSPECT_MAX_BYTES;return this.length>0&&(a=this.toString("hex",0,b).match(/.{2}/g).join(" "),this.length>b&&(a+=" ... ")),"<Buffer "+a+">"},Buffer.prototype.compare=function(a,b,c,d,e){if(!Buffer.isBuffer(a))throw new TypeError("Argument must be a Buffer");if(void 0===b&&(b=0),void 0===c&&(c=a?a.length:0),void 0===d&&(d=0),void 0===e&&(e=this.length),b<0||c>a.length||d<0||e>this.length)throw new RangeError("out of range index");if(d>=e&&b>=c)return 0;if(d>=e)return-1;if(b>=c)return 1;if(b>>>=0,c>>>=0,d>>>=0,e>>>=0,this===a)return 0;for(var f=e-d,g=c-b,h=Math.min(f,g),i=this.slice(d,e),j=a.slice(b,c),k=0;k<h;++k)if(i[k]!==j[k]){f=i[k],g=j[k];break}return f<g?-1:g<f?1:0},Buffer.prototype.includes=function(a,b,c){return this.indexOf(a,b,c)!==-1},Buffer.prototype.indexOf=function(a,b,c){return s(this,a,b,c,!0)},Buffer.prototype.lastIndexOf=function(a,b,c){return s(this,a,b,c,!1)},Buffer.prototype.write=function(a,b,c,d){if(void 0===b)d="utf8",c=this.length,b=0;else if(void 0===c&&"string"==typeof b)d=b,c=this.length,b=0;else{if(!isFinite(b))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");b>>>=0,isFinite(c)?(c>>>=0,void 0===d&&(d="utf8")):(d=c,c=void 0)}var e=this.length-b;if((void 0===c||c>e)&&(c=e),a.length>0&&(c<0||b<0)||b>this.length)throw new RangeError("Attempt to write outside buffer bounds");d||(d="utf8");for(var f=!1;;)switch(d){case"hex":return u(this,a,b,c);case"utf8":case"utf-8":return v(this,a,b,c);case"ascii":return w(this,a,b,c);case"latin1":case"binary":return x(this,a,b,c);case"base64":return y(this,a,b,c);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return z(this,a,b,c);default:if(f)throw new TypeError("Unknown encoding: "+d);d=(""+d).toLowerCase(),f=!0}},Buffer.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Z=4096;Buffer.prototype.slice=function(a,b){var c=this.length;a=~~a,b=void 0===b?c:~~b,a<0?(a+=c,a<0&&(a=0)):a>c&&(a=c),b<0?(b+=c,b<0&&(b=0)):b>c&&(b=c),b<a&&(b=a);var d=this.subarray(a,b);return d.__proto__=Buffer.prototype,d},Buffer.prototype.readUIntLE=function(a,b,c){a>>>=0,b>>>=0,c||H(a,b,this.length);for(var d=this[a],e=1,f=0;++f<b&&(e*=256);)d+=this[a+f]*e;return d},Buffer.prototype.readUIntBE=function(a,b,c){a>>>=0,b>>>=0,c||H(a,b,this.length);for(var d=this[a+--b],e=1;b>0&&(e*=256);)d+=this[a+--b]*e;return d},Buffer.prototype.readUInt8=function(a,b){return a>>>=0,b||H(a,1,this.length),this[a]},Buffer.prototype.readUInt16LE=function(a,b){return a>>>=0,b||H(a,2,this.length),this[a]|this[a+1]<<8},Buffer.prototype.readUInt16BE=function(a,b){return a>>>=0,b||H(a,2,this.length),this[a]<<8|this[a+1]},Buffer.prototype.readUInt32LE=function(a,b){return a>>>=0,b||H(a,4,this.length),(this[a]|this[a+1]<<8|this[a+2]<<16)+16777216*this[a+3]},Buffer.prototype.readUInt32BE=function(a,b){return a>>>=0,b||H(a,4,this.length),16777216*this[a]+(this[a+1]<<16|this[a+2]<<8|this[a+3])},Buffer.prototype.readIntLE=function(a,b,c){a>>>=0,b>>>=0,c||H(a,b,this.length);for(var d=this[a],e=1,f=0;++f<b&&(e*=256);)d+=this[a+f]*e;return e*=128,d>=e&&(d-=Math.pow(2,8*b)),d},Buffer.prototype.readIntBE=function(a,b,c){a>>>=0,b>>>=0,c||H(a,b,this.length);for(var d=b,e=1,f=this[a+--d];d>0&&(e*=256);)f+=this[a+--d]*e;return e*=128,f>=e&&(f-=Math.pow(2,8*b)),f},Buffer.prototype.readInt8=function(a,b){return a>>>=0,b||H(a,1,this.length),128&this[a]?(255-this[a]+1)*-1:this[a]},Buffer.prototype.readInt16LE=function(a,b){a>>>=0,b||H(a,2,this.length);var c=this[a]|this[a+1]<<8;return 32768&c?4294901760|c:c},Buffer.prototype.readInt16BE=function(a,b){a>>>=0,b||H(a,2,this.length);var c=this[a+1]|this[a]<<8;return 32768&c?4294901760|c:c},Buffer.prototype.readInt32LE=function(a,b){return a>>>=0,b||H(a,4,this.length),this[a]|this[a+1]<<8|this[a+2]<<16|this[a+3]<<24},Buffer.prototype.readInt32BE=function(a,b){return a>>>=0,b||H(a,4,this.length),this[a]<<24|this[a+1]<<16|this[a+2]<<8|this[a+3]},Buffer.prototype.readFloatLE=function(a,b){return a>>>=0,b||H(a,4,this.length),X.read(this,a,!0,23,4)},Buffer.prototype.readFloatBE=function(a,b){return a>>>=0,b||H(a,4,this.length),X.read(this,a,!1,23,4)},Buffer.prototype.readDoubleLE=function(a,b){return a>>>=0,b||H(a,8,this.length),X.read(this,a,!0,52,8)},Buffer.prototype.readDoubleBE=function(a,b){return a>>>=0,b||H(a,8,this.length),X.read(this,a,!1,52,8)},Buffer.prototype.writeUIntLE=function(a,b,c,d){if(a=+a,b>>>=0,c>>>=0,!d){var e=Math.pow(2,8*c)-1;I(this,a,b,c,e,0)}var f=1,g=0;for(this[b]=255&a;++g<c&&(f*=256);)this[b+g]=a/f&255;return b+c},Buffer.prototype.writeUIntBE=function(a,b,c,d){if(a=+a,b>>>=0,c>>>=0,!d){var e=Math.pow(2,8*c)-1;I(this,a,b,c,e,0)}var f=c-1,g=1;for(this[b+f]=255&a;--f>=0&&(g*=256);)this[b+f]=a/g&255;return b+c},Buffer.prototype.writeUInt8=function(a,b,c){return a=+a,b>>>=0,c||I(this,a,b,1,255,0),this[b]=255&a,b+1},Buffer.prototype.writeUInt16LE=function(a,b,c){return a=+a,b>>>=0,c||I(this,a,b,2,65535,0),this[b]=255&a,this[b+1]=a>>>8,b+2},Buffer.prototype.writeUInt16BE=function(a,b,c){return a=+a,b>>>=0,c||I(this,a,b,2,65535,0),this[b]=a>>>8,this[b+1]=255&a,b+2},Buffer.prototype.writeUInt32LE=function(a,b,c){return a=+a,b>>>=0,c||I(this,a,b,4,4294967295,0),this[b+3]=a>>>24,this[b+2]=a>>>16,this[b+1]=a>>>8,this[b]=255&a,b+4},Buffer.prototype.writeUInt32BE=function(a,b,c){return a=+a,b>>>=0,c||I(this,a,b,4,4294967295,0),this[b]=a>>>24,this[b+1]=a>>>16,this[b+2]=a>>>8,this[b+3]=255&a,b+4},Buffer.prototype.writeIntLE=function(a,b,c,d){if(a=+a,b>>>=0,!d){var e=Math.pow(2,8*c-1);I(this,a,b,c,e-1,-e)}var f=0,g=1,h=0;for(this[b]=255&a;++f<c&&(g*=256);)a<0&&0===h&&0!==this[b+f-1]&&(h=1),this[b+f]=(a/g>>0)-h&255;return b+c},Buffer.prototype.writeIntBE=function(a,b,c,d){if(a=+a,b>>>=0,!d){var e=Math.pow(2,8*c-1);I(this,a,b,c,e-1,-e)}var f=c-1,g=1,h=0;for(this[b+f]=255&a;--f>=0&&(g*=256);)a<0&&0===h&&0!==this[b+f+1]&&(h=1),this[b+f]=(a/g>>0)-h&255;return b+c},Buffer.prototype.writeInt8=function(a,b,c){return a=+a,b>>>=0,c||I(this,a,b,1,127,-128),a<0&&(a=255+a+1),this[b]=255&a,b+1},Buffer.prototype.writeInt16LE=function(a,b,c){return a=+a,b>>>=0,c||I(this,a,b,2,32767,-32768),this[b]=255&a,this[b+1]=a>>>8,b+2},Buffer.prototype.writeInt16BE=function(a,b,c){return a=+a,b>>>=0,c||I(this,a,b,2,32767,-32768),this[b]=a>>>8,this[b+1]=255&a,b+2},Buffer.prototype.writeInt32LE=function(a,b,c){return a=+a,b>>>=0,c||I(this,a,b,4,2147483647,-2147483648),this[b]=255&a,this[b+1]=a>>>8,this[b+2]=a>>>16,this[b+3]=a>>>24,b+4},Buffer.prototype.writeInt32BE=function(a,b,c){return a=+a,b>>>=0,c||I(this,a,b,4,2147483647,-2147483648),a<0&&(a=4294967295+a+1),this[b]=a>>>24,this[b+1]=a>>>16,this[b+2]=a>>>8,this[b+3]=255&a,b+4},Buffer.prototype.writeFloatLE=function(a,b,c){return K(this,a,b,!0,c)},Buffer.prototype.writeFloatBE=function(a,b,c){return K(this,a,b,!1,c)},Buffer.prototype.writeDoubleLE=function(a,b,c){return L(this,a,b,!0,c)},Buffer.prototype.writeDoubleBE=function(a,b,c){return L(this,a,b,!1,c)},Buffer.prototype.copy=function(a,b,c,d){if(c||(c=0),d||0===d||(d=this.length),b>=a.length&&(b=a.length),b||(b=0),d>0&&d<c&&(d=c),d===c)return 0;if(0===a.length||0===this.length)return 0;if(b<0)throw new RangeError("targetStart out of bounds");if(c<0||c>=this.length)throw new RangeError("sourceStart out of bounds");if(d<0)throw new RangeError("sourceEnd out of bounds");d>this.length&&(d=this.length),a.length-b<d-c&&(d=a.length-b+c);var e,f=d-c;if(this===a&&c<b&&b<d)for(e=f-1;e>=0;--e)a[e+b]=this[e+c];else if(f<1e3)for(e=0;e<f;++e)a[e+b]=this[e+c];else Uint8Array.prototype.set.call(a,this.subarray(c,c+f),b);return f},Buffer.prototype.fill=function(a,b,c,d){if("string"==typeof a){if("string"==typeof b?(d=b,b=0,c=this.length):"string"==typeof c&&(d=c,c=this.length),1===a.length){var e=a.charCodeAt(0);e<256&&(a=e)}if(void 0!==d&&"string"!=typeof d)throw new TypeError("encoding must be a string");if("string"==typeof d&&!Buffer.isEncoding(d))throw new TypeError("Unknown encoding: "+d)}else"number"==typeof a&&(a&=255);if(b<0||this.length<b||this.length<c)throw new RangeError("Out of range index");if(c<=b)return this;b>>>=0,c=void 0===c?this.length:c>>>0,a||(a=0);var f;if("number"==typeof a)for(f=b;f<c;++f)this[f]=a;else{var g=Buffer.isBuffer(a)?a:new Buffer(a,d),h=g.length;for(f=0;f<c-b;++f)this[f+b]=g[f%h]}return this};var $=/[^+\/0-9A-Za-z-_]/g},{"base64-js":105,ieee754:224}],105:[function(a,b,c){"use strict";function d(a){var b=a.length;if(b%4>0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===a[b-2]?2:"="===a[b-1]?1:0}function e(a){return 3*a.length/4-d(a)}function f(a){var b,c,e,f,g,h=a.length;f=d(a),g=new l(3*h/4-f),c=f>0?h-4:h;var i=0;for(b=0;b<c;b+=4)e=k[a.charCodeAt(b)]<<18|k[a.charCodeAt(b+1)]<<12|k[a.charCodeAt(b+2)]<<6|k[a.charCodeAt(b+3)],g[i++]=e>>16&255,g[i++]=e>>8&255,g[i++]=255&e;return 2===f?(e=k[a.charCodeAt(b)]<<2|k[a.charCodeAt(b+1)]>>4,g[i++]=255&e):1===f&&(e=k[a.charCodeAt(b)]<<10|k[a.charCodeAt(b+1)]<<4|k[a.charCodeAt(b+2)]>>2,g[i++]=e>>8&255,g[i++]=255&e),g}function g(a){return j[a>>18&63]+j[a>>12&63]+j[a>>6&63]+j[63&a]}function h(a,b,c){for(var d,e=[],f=b;f<c;f+=3)d=(a[f]<<16)+(a[f+1]<<8)+a[f+2],e.push(g(d));return e.join("")}function i(a){for(var b,c=a.length,d=c%3,e="",f=[],g=16383,i=0,k=c-d;i<k;i+=g)f.push(h(a,i,i+g>k?k:i+g));return 1===d?(b=a[c-1],e+=j[b>>2],e+=j[b<<4&63],e+="=="):2===d&&(b=(a[c-2]<<8)+a[c-1],e+=j[b>>10],e+=j[b>>4&63],e+=j[b<<2&63],e+="="),f.push(e),f.join("")}c.byteLength=e,c.toByteArray=f,c.fromByteArray=i;for(var j=[],k=[],l="undefined"!=typeof Uint8Array?Uint8Array:Array,m="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,o=m.length;n<o;++n)j[n]=m[n],k[m.charCodeAt(n)]=n;k["-".charCodeAt(0)]=62,k["_".charCodeAt(0)]=63},{}],106:[function(a,b,c){function d(a){e.call(this),this.hashMode="string"==typeof a,this.hashMode?this[a]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}var Buffer=a("safe-buffer").Buffer,e=a("stream").Transform,f=a("string_decoder").StringDecoder,g=a("inherits");g(d,e),d.prototype.update=function(a,b,c){"string"==typeof a&&(a=Buffer.from(a,b));var d=this._update(a);return this.hashMode?this:(c&&(d=this._toString(d,c)),d)},d.prototype.setAutoPadding=function(){},d.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},d.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},d.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},d.prototype._transform=function(a,b,c){var d;try{this.hashMode?this._update(a):this.push(this._update(a))}catch(a){d=a}finally{c(d)}},d.prototype._flush=function(a){var b;try{this.push(this.__final())}catch(a){b=a}a(b)},d.prototype._finalOrDigest=function(a){var b=this.__final()||Buffer.alloc(0);return a&&(b=this._toString(b,a,!0)),b},d.prototype._toString=function(a,b,c){if(this._decoder||(this._decoder=new f(b),this._encoding=b),this._encoding!==b)throw new Error("can't switch encodings");var d=this._decoder.write(a);return c&&(d+=this._decoder.end()),d},b.exports=d},{inherits:226,"safe-buffer":288,stream:304,string_decoder:305}],107:[function(a,b,c){function d(a){if(a)return e(a)}function e(a){for(var b in d.prototype)a[b]=d.prototype[b];return a}b.exports=d,d.prototype.on=d.prototype.addEventListener=function(a,b){return this._callbacks=this._callbacks||{},(this._callbacks[a]=this._callbacks[a]||[]).push(b),this},d.prototype.once=function(a,b){function c(){d.off(a,c),b.apply(this,arguments)}var d=this;return this._callbacks=this._callbacks||{},c.fn=b,this.on(a,c),this},d.prototype.off=d.prototype.removeListener=d.prototype.removeAllListeners=d.prototype.removeEventListener=function(a,b){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var c=this._callbacks[a];if(!c)return this;if(1==arguments.length)return delete this._callbacks[a],this;for(var d,e=0;e<c.length;e++)if(d=c[e],d===b||d.fn===b){c.splice(e,1);break}return this},d.prototype.emit=function(a){this._callbacks=this._callbacks||{};var b=[].slice.call(arguments,1),c=this._callbacks[a];if(c){c=c.slice(0);for(var d=0,e=c.length;d<e;++d)c[d].apply(this,b)}return this},d.prototype.listeners=function(a){return this._callbacks=this._callbacks||{},this._callbacks[a]||[]},d.prototype.hasListeners=function(a){return!!this.listeners(a).length}},{}],108:[function(a,b,c){(function(Buffer){function a(a){return Array.isArray?Array.isArray(a):"[object Array]"===p(a)}function b(a){return"boolean"==typeof a}function d(a){return null===a}function e(a){return null==a}function f(a){return"number"==typeof a}function g(a){return"string"==typeof a}function h(a){return"symbol"==typeof a}function i(a){return void 0===a}function j(a){return"[object RegExp]"===p(a)}function k(a){return"object"==typeof a&&null!==a}function l(a){return"[object Date]"===p(a)}function m(a){return"[object Error]"===p(a)||a instanceof Error}function n(a){return"function"==typeof a}function o(a){return null===a||"boolean"==typeof a||"number"==typeof a||"string"==typeof a||"symbol"==typeof a||"undefined"==typeof a}function p(a){return Object.prototype.toString.call(a)}c.isArray=a,c.isBoolean=b,c.isNull=d,c.isNullOrUndefined=e,c.isNumber=f,c.isString=g,c.isSymbol=h,c.isUndefined=i,c.isRegExp=j,c.isObject=k,c.isDate=l,c.isError=m,c.isFunction=n,c.isPrimitive=o,c.isBuffer=Buffer.isBuffer}).call(this,{isBuffer:a("../../is-buffer/index.js")})},{"../../is-buffer/index.js":227}],109:[function(a,b,c){(function(Buffer){function c(a){this.curveType=g[a],this.curveType||(this.curveType={name:a}),this.curve=new e.ec(this.curveType.name),this.keys=void 0}function d(a,b,c){Array.isArray(a)||(a=a.toArray());var d=new Buffer(a);if(c&&d.length<c){var e=new Buffer(c-d.length);e.fill(0),d=Buffer.concat([e,d])}return b?d.toString(b):d}var e=a("elliptic"),f=a("bn.js");b.exports=function(a){return new c(a)};var g={secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}};g.p224=g.secp224r1,g.p256=g.secp256r1=g.prime256v1,g.p192=g.secp192r1=g.prime192v1,g.p384=g.secp384r1,g.p521=g.secp521r1,c.prototype.generateKeys=function(a,b){return this.keys=this.curve.genKeyPair(),this.getPublicKey(a,b)},c.prototype.computeSecret=function(a,b,c){b=b||"utf8",Buffer.isBuffer(a)||(a=new Buffer(a,b));var e=this.curve.keyFromPublic(a).getPublic(),f=e.mul(this.keys.getPrivate()).getX();return d(f,c,this.curveType.byteLength)},c.prototype.getPublicKey=function(a,b){var c=this.keys.getPublic("compressed"===b,!0);return"hybrid"===b&&(c[c.length-1]%2?c[0]=7:c[0]=6),d(c,a)},c.prototype.getPrivateKey=function(a){return d(this.keys.getPrivate(),a)},c.prototype.setPublicKey=function(a,b){return b=b||"utf8",Buffer.isBuffer(a)||(a=new Buffer(a,b)),this.keys._importPublic(a),this},c.prototype.setPrivateKey=function(a,b){b=b||"utf8",Buffer.isBuffer(a)||(a=new Buffer(a,b));var c=new f(a);return c=c.toString(16),this.keys._importPrivate(c),this}}).call(this,a("buffer").Buffer)},{"bn.js":75,buffer:104,elliptic:192}],110:[function(a,b,c){(function(Buffer){"use strict";function c(a){i.call(this,"digest"),this._hash=a,this.buffers=[]}function d(a){i.call(this,"digest"),this._hash=a}var e=a("inherits"),f=a("./md5"),g=a("ripemd160"),h=a("sha.js"),i=a("cipher-base");e(c,i),c.prototype._update=function(a){this.buffers.push(a)},c.prototype._final=function(){var a=Buffer.concat(this.buffers),b=this._hash(a);return this.buffers=null,b},e(d,i),d.prototype._update=function(a){this._hash.update(a)},d.prototype._final=function(){return this._hash.digest()},b.exports=function(a){return a=a.toLowerCase(),"md5"===a?new c(f):new d("rmd160"===a||"ripemd160"===a?new g:h(a))}}).call(this,a("buffer").Buffer)},{"./md5":112,buffer:104,"cipher-base":106,inherits:226,ripemd160:287,"sha.js":296}],111:[function(a,b,c){(function(Buffer){"use strict";function a(a){if(a.length%c!==0){var b=a.length+(c-a.length%c);a=Buffer.concat([a,d],b)}for(var e=new Array(a.length>>>2),f=0,g=0;f<a.length;f+=c,g++)e[g]=a.readInt32LE(f);return e}var c=4,d=new Buffer(c);d.fill(0);var e=8,f=16;b.exports=function(b,c){var d=c(a(b),b.length*e);b=new Buffer(f);for(var g=0;g<d.length;g++)b.writeInt32LE(d[g],g<<2,!0);return b}}).call(this,a("buffer").Buffer)},{buffer:104}],112:[function(a,b,c){"use strict";function d(a,b){a[b>>5]|=128<<b%32,a[(b+64>>>9<<4)+14]=b;for(var c=1732584193,d=-271733879,e=-1732584194,k=271733878,l=0;l<a.length;l+=16){var m=c,n=d,o=e,p=k;c=f(c,d,e,k,a[l+0],7,-680876936),k=f(k,c,d,e,a[l+1],12,-389564586),e=f(e,k,c,d,a[l+2],17,606105819),d=f(d,e,k,c,a[l+3],22,-1044525330),c=f(c,d,e,k,a[l+4],7,-176418897),k=f(k,c,d,e,a[l+5],12,1200080426),e=f(e,k,c,d,a[l+6],17,-1473231341),d=f(d,e,k,c,a[l+7],22,-45705983),c=f(c,d,e,k,a[l+8],7,1770035416),k=f(k,c,d,e,a[l+9],12,-1958414417),e=f(e,k,c,d,a[l+10],17,-42063),d=f(d,e,k,c,a[l+11],22,-1990404162),c=f(c,d,e,k,a[l+12],7,1804603682),k=f(k,c,d,e,a[l+13],12,-40341101),e=f(e,k,c,d,a[l+14],17,-1502002290),d=f(d,e,k,c,a[l+15],22,1236535329),c=g(c,d,e,k,a[l+1],5,-165796510),k=g(k,c,d,e,a[l+6],9,-1069501632),e=g(e,k,c,d,a[l+11],14,643717713),d=g(d,e,k,c,a[l+0],20,-373897302),c=g(c,d,e,k,a[l+5],5,-701558691),k=g(k,c,d,e,a[l+10],9,38016083),e=g(e,k,c,d,a[l+15],14,-660478335),d=g(d,e,k,c,a[l+4],20,-405537848),c=g(c,d,e,k,a[l+9],5,568446438),k=g(k,c,d,e,a[l+14],9,-1019803690),e=g(e,k,c,d,a[l+3],14,-187363961),d=g(d,e,k,c,a[l+8],20,1163531501),c=g(c,d,e,k,a[l+13],5,-1444681467),k=g(k,c,d,e,a[l+2],9,-51403784),e=g(e,k,c,d,a[l+7],14,1735328473),d=g(d,e,k,c,a[l+12],20,-1926607734),c=h(c,d,e,k,a[l+5],4,-378558),k=h(k,c,d,e,a[l+8],11,-2022574463),e=h(e,k,c,d,a[l+11],16,1839030562),d=h(d,e,k,c,a[l+14],23,-35309556),c=h(c,d,e,k,a[l+1],4,-1530992060),k=h(k,c,d,e,a[l+4],11,1272893353),e=h(e,k,c,d,a[l+7],16,-155497632),d=h(d,e,k,c,a[l+10],23,-1094730640),c=h(c,d,e,k,a[l+13],4,681279174),k=h(k,c,d,e,a[l+0],11,-358537222),e=h(e,k,c,d,a[l+3],16,-722521979),d=h(d,e,k,c,a[l+6],23,76029189),c=h(c,d,e,k,a[l+9],4,-640364487),k=h(k,c,d,e,a[l+12],11,-421815835),e=h(e,k,c,d,a[l+15],16,530742520),d=h(d,e,k,c,a[l+2],23,-995338651),c=i(c,d,e,k,a[l+0],6,-198630844),k=i(k,c,d,e,a[l+7],10,1126891415),e=i(e,k,c,d,a[l+14],15,-1416354905),d=i(d,e,k,c,a[l+5],21,-57434055),c=i(c,d,e,k,a[l+12],6,1700485571),k=i(k,c,d,e,a[l+3],10,-1894986606),e=i(e,k,c,d,a[l+10],15,-1051523),d=i(d,e,k,c,a[l+1],21,-2054922799),c=i(c,d,e,k,a[l+8],6,1873313359),k=i(k,c,d,e,a[l+15],10,-30611744),e=i(e,k,c,d,a[l+6],15,-1560198380),d=i(d,e,k,c,a[l+13],21,1309151649),c=i(c,d,e,k,a[l+4],6,-145523070),k=i(k,c,d,e,a[l+11],10,-1120210379),e=i(e,k,c,d,a[l+2],15,718787259),d=i(d,e,k,c,a[l+9],21,-343485551),c=j(c,m),d=j(d,n),e=j(e,o),k=j(k,p)}return[c,d,e,k]}function e(a,b,c,d,e,f){return j(k(j(j(b,a),j(d,f)),e),c)}function f(a,b,c,d,f,g,h){return e(b&c|~b&d,a,b,f,g,h)}function g(a,b,c,d,f,g,h){return e(b&d|c&~d,a,b,f,g,h)}function h(a,b,c,d,f,g,h){return e(b^c^d,a,b,f,g,h)}function i(a,b,c,d,f,g,h){return e(c^(b|~d),a,b,f,g,h)}function j(a,b){var c=(65535&a)+(65535&b),d=(a>>16)+(b>>16)+(c>>16);return d<<16|65535&c}function k(a,b){return a<<b|a>>>32-b}var l=a("./make-hash");b.exports=function(a){return l(a,d)}},{"./make-hash":111}],113:[function(a,b,c){"use strict";function d(a,b){g.call(this,"digest"),"string"==typeof b&&(b=Buffer.from(b));var c="sha512"===a||"sha384"===a?128:64;if(this._alg=a,this._key=b,b.length>c){var d="rmd160"===a?new i:j(a);b=d.update(b).digest()}else b.length<c&&(b=Buffer.concat([b,k],c));for(var e=this._ipad=Buffer.allocUnsafe(c),f=this._opad=Buffer.allocUnsafe(c),h=0;h<c;h++)e[h]=54^b[h],f[h]=92^b[h];this._hash="rmd160"===a?new i:j(a),this._hash.update(e)}var e=a("inherits"),f=a("./legacy"),g=a("cipher-base"),Buffer=a("safe-buffer").Buffer,h=a("create-hash/md5"),i=a("ripemd160"),j=a("sha.js"),k=Buffer.alloc(128);e(d,g),d.prototype._update=function(a){this._hash.update(a)},d.prototype._final=function(){var a=this._hash.digest(),b="rmd160"===this._alg?new i:j(this._alg);return b.update(this._opad).update(a).digest()},b.exports=function(a,b){return a=a.toLowerCase(),"rmd160"===a||"ripemd160"===a?new d("rmd160",b):"md5"===a?new f(h,b):new d(a,b)}},{"./legacy":114,"cipher-base":106,"create-hash/md5":112,inherits:226,ripemd160:287,"safe-buffer":288,"sha.js":296}],114:[function(a,b,c){"use strict";function d(a,b){f.call(this,"digest"),"string"==typeof b&&(b=Buffer.from(b)),this._alg=a,this._key=b,b.length>h?b=a(b):b.length<h&&(b=Buffer.concat([b,g],h));for(var c=this._ipad=Buffer.allocUnsafe(h),d=this._opad=Buffer.allocUnsafe(h),e=0;e<h;e++)c[e]=54^b[e],d[e]=92^b[e];this._hash=[c]}var e=a("inherits"),Buffer=a("safe-buffer").Buffer,f=a("cipher-base"),g=Buffer.alloc(128),h=64;e(d,f),d.prototype._update=function(a){this._hash.push(a)},d.prototype._final=function(){var a=this._alg(Buffer.concat(this._hash));return this._alg(Buffer.concat([this._opad,a]))},b.exports=d},{"cipher-base":106,inherits:226,"safe-buffer":288}],115:[function(a,b,c){"use strict";c.randomBytes=c.rng=c.pseudoRandomBytes=c.prng=a("randombytes"),c.createHash=c.Hash=a("create-hash"),c.createHmac=c.Hmac=a("create-hmac");var d=a("browserify-sign/algos"),e=Object.keys(d),f=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(e);c.getHashes=function(){return f};var g=a("pbkdf2");c.pbkdf2=g.pbkdf2,c.pbkdf2Sync=g.pbkdf2Sync;var h=a("browserify-cipher");c.Cipher=h.Cipher,c.createCipher=h.createCipher,c.Cipheriv=h.Cipheriv,c.createCipheriv=h.createCipheriv,c.Decipher=h.Decipher,c.createDecipher=h.createDecipher,c.Decipheriv=h.Decipheriv,c.createDecipheriv=h.createDecipheriv,c.getCiphers=h.getCiphers,c.listCiphers=h.listCiphers;var i=a("diffie-hellman");c.DiffieHellmanGroup=i.DiffieHellmanGroup,c.createDiffieHellmanGroup=i.createDiffieHellmanGroup,c.getDiffieHellman=i.getDiffieHellman,c.createDiffieHellman=i.createDiffieHellman,c.DiffieHellman=i.DiffieHellman;var j=a("browserify-sign");c.createSign=j.createSign,c.Sign=j.Sign,c.createVerify=j.createVerify,c.Verify=j.Verify,c.createECDH=a("create-ecdh");var k=a("public-encrypt");c.publicEncrypt=k.publicEncrypt,c.privateEncrypt=k.privateEncrypt,c.publicDecrypt=k.publicDecrypt,c.privateDecrypt=k.privateDecrypt;var l=a("randomfill");c.randomFill=l.randomFill,c.randomFillSync=l.randomFillSync,c.createCredentials=function(){throw new Error(["sorry, createCredentials is not implemented yet","we accept pull requests","https://github.com/crypto-browserify/crypto-browserify"].join("\n"))},c.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6}},{"browserify-cipher":95,"browserify-sign":134,"browserify-sign/algos":131,"create-ecdh":109,"create-hash":110,"create-hmac":113,"diffie-hellman":183,pbkdf2:236,"public-encrypt":239,randombytes:271,randomfill:272}],116:[function(a,b,c){var d=c;d.bignum=a("bn.js"),d.define=a("./asn1/api").define,d.base=a("./asn1/base"),d.constants=a("./asn1/constants"),d.decoders=a("./asn1/decoders"),d.encoders=a("./asn1/encoders")},{"./asn1/api":117,"./asn1/base":119,"./asn1/constants":123,"./asn1/decoders":125,"./asn1/encoders":128,"bn.js":75}],117:[function(a,b,c){function d(a,b){this.name=a,this.body=b,this.decoders={},this.encoders={}}var e=a("../asn1"),f=a("inherits"),g=c;g.define=function(a,b){return new d(a,b)},d.prototype._createNamed=function(b){var c;try{c=a("vm").runInThisContext("(function "+this.name+"(entity) {\n this._initNamed(entity);\n})")}catch(a){c=function(a){this._initNamed(a)}}return f(c,b),c.prototype._initNamed=function(a){b.call(this,a)},new c(this)},d.prototype._getDecoder=function(a){return a=a||"der",this.decoders.hasOwnProperty(a)||(this.decoders[a]=this._createNamed(e.decoders[a])),this.decoders[a]},d.prototype.decode=function(a,b,c){return this._getDecoder(b).decode(a,c)},d.prototype._getEncoder=function(a){return a=a||"der",this.encoders.hasOwnProperty(a)||(this.encoders[a]=this._createNamed(e.encoders[a])),this.encoders[a]},d.prototype.encode=function(a,b,c){return this._getEncoder(b).encode(a,c)}},{"../asn1":116,inherits:226,vm:322}],118:[function(a,b,c){function d(a,b){return g.call(this,b),Buffer.isBuffer(a)?(this.base=a,this.offset=0,void(this.length=a.length)):void this.error("Input not Buffer")}function e(a,b){if(Array.isArray(a))this.length=0,this.value=a.map(function(a){return a instanceof e||(a=new e(a,b)),this.length+=a.length,a},this);else if("number"==typeof a){if(!(0<=a&&a<=255))return b.error("non-byte EncoderBuffer value");this.value=a,this.length=1}else if("string"==typeof a)this.value=a,this.length=Buffer.byteLength(a);else{if(!Buffer.isBuffer(a))return b.error("Unsupported type: "+typeof a);this.value=a,this.length=a.length}}var f=a("inherits"),g=a("../base").Reporter,Buffer=a("buffer").Buffer;f(d,g),c.DecoderBuffer=d,d.prototype.save=function(){return{offset:this.offset,reporter:g.prototype.save.call(this)}},d.prototype.restore=function(a){var b=new d(this.base);return b.offset=a.offset,b.length=this.offset,this.offset=a.offset,g.prototype.restore.call(this,a.reporter),b},d.prototype.isEmpty=function(){return this.offset===this.length},d.prototype.readUInt8=function(a){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(a||"DecoderBuffer overrun")},d.prototype.skip=function(a,b){if(!(this.offset+a<=this.length))return this.error(b||"DecoderBuffer overrun");var c=new d(this.base);return c._reporterState=this._reporterState,c.offset=this.offset,c.length=this.offset+a,this.offset+=a,c},d.prototype.raw=function(a){return this.base.slice(a?a.offset:this.offset,this.length)},c.EncoderBuffer=e,e.prototype.join=function(a,b){return a||(a=new Buffer(this.length)),b||(b=0),0===this.length?a:(Array.isArray(this.value)?this.value.forEach(function(c){c.join(a,b),b+=c.length}):("number"==typeof this.value?a[b]=this.value:"string"==typeof this.value?a.write(this.value,b):Buffer.isBuffer(this.value)&&this.value.copy(a,b),b+=this.length),a)}},{"../base":119,buffer:104,inherits:226}],119:[function(a,b,c){var d=c;d.Reporter=a("./reporter").Reporter,d.DecoderBuffer=a("./buffer").DecoderBuffer,d.EncoderBuffer=a("./buffer").EncoderBuffer,d.Node=a("./node")},{"./buffer":118,"./node":120,"./reporter":121}],120:[function(a,b,c){function d(a,b){var c={};this._baseState=c,c.enc=a,c.parent=b||null,c.children=null,c.tag=null,c.args=null,c.reverseArgs=null,c.choice=null,c.optional=!1,c.any=!1,c.obj=!1,c.use=null,c.useDecoder=null,c.key=null,c.default=null,c.explicit=null,c.implicit=null,c.contains=null,c.parent||(c.children=[],this._wrap())}var e=a("../base").Reporter,f=a("../base").EncoderBuffer,g=a("../base").DecoderBuffer,h=a("minimalistic-assert"),i=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],j=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(i),k=["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"];b.exports=d;var l=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];d.prototype.clone=function(){var a=this._baseState,b={};l.forEach(function(c){b[c]=a[c]});var c=new this.constructor(b.parent);return c._baseState=b,c},d.prototype._wrap=function(){var a=this._baseState;j.forEach(function(b){this[b]=function(){var c=new this.constructor(this);return a.children.push(c),c[b].apply(c,arguments)}},this)},d.prototype._init=function(a){var b=this._baseState;h(null===b.parent),a.call(this),b.children=b.children.filter(function(a){return a._baseState.parent===this},this),h.equal(b.children.length,1,"Root node can have only one child")},d.prototype._useArgs=function(a){var b=this._baseState,c=a.filter(function(a){return a instanceof this.constructor},this);a=a.filter(function(a){return!(a instanceof this.constructor)},this),0!==c.length&&(h(null===b.children),b.children=c,c.forEach(function(a){a._baseState.parent=this},this)),0!==a.length&&(h(null===b.args),b.args=a,b.reverseArgs=a.map(function(a){if("object"!=typeof a||a.constructor!==Object)return a;var b={}; |
| 11 |
|
return Object.keys(a).forEach(function(c){c==(0|c)&&(c|=0);var d=a[c];b[d]=c}),b}))},k.forEach(function(a){d.prototype[a]=function(){var b=this._baseState;throw new Error(a+" not implemented for encoding: "+b.enc)}}),i.forEach(function(a){d.prototype[a]=function(){var b=this._baseState,c=Array.prototype.slice.call(arguments);return h(null===b.tag),b.tag=a,this._useArgs(c),this}}),d.prototype.use=function(a){h(a);var b=this._baseState;return h(null===b.use),b.use=a,this},d.prototype.optional=function(){var a=this._baseState;return a.optional=!0,this},d.prototype.def=function(a){var b=this._baseState;return h(null===b.default),b.default=a,b.optional=!0,this},d.prototype.explicit=function(a){var b=this._baseState;return h(null===b.explicit&&null===b.implicit),b.explicit=a,this},d.prototype.implicit=function(a){var b=this._baseState;return h(null===b.explicit&&null===b.implicit),b.implicit=a,this},d.prototype.obj=function(){var a=this._baseState,b=Array.prototype.slice.call(arguments);return a.obj=!0,0!==b.length&&this._useArgs(b),this},d.prototype.key=function(a){var b=this._baseState;return h(null===b.key),b.key=a,this},d.prototype.any=function(){var a=this._baseState;return a.any=!0,this},d.prototype.choice=function(a){var b=this._baseState;return h(null===b.choice),b.choice=a,this._useArgs(Object.keys(a).map(function(b){return a[b]})),this},d.prototype.contains=function(a){var b=this._baseState;return h(null===b.use),b.contains=a,this},d.prototype._decode=function(a,b){var c=this._baseState;if(null===c.parent)return a.wrapResult(c.children[0]._decode(a,b));var d=c.default,e=!0,f=null;if(null!==c.key&&(f=a.enterKey(c.key)),c.optional){var h=null;if(null!==c.explicit?h=c.explicit:null!==c.implicit?h=c.implicit:null!==c.tag&&(h=c.tag),null!==h||c.any){if(e=this._peekTag(a,h,c.any),a.isError(e))return e}else{var i=a.save();try{null===c.choice?this._decodeGeneric(c.tag,a,b):this._decodeChoice(a,b),e=!0}catch(a){e=!1}a.restore(i)}}var j;if(c.obj&&e&&(j=a.enterObject()),e){if(null!==c.explicit){var k=this._decodeTag(a,c.explicit);if(a.isError(k))return k;a=k}var l=a.offset;if(null===c.use&&null===c.choice){if(c.any)var i=a.save();var m=this._decodeTag(a,null!==c.implicit?c.implicit:c.tag,c.any);if(a.isError(m))return m;c.any?d=a.raw(i):a=m}if(b&&b.track&&null!==c.tag&&b.track(a.path(),l,a.length,"tagged"),b&&b.track&&null!==c.tag&&b.track(a.path(),a.offset,a.length,"content"),d=c.any?d:null===c.choice?this._decodeGeneric(c.tag,a,b):this._decodeChoice(a,b),a.isError(d))return d;if(c.any||null!==c.choice||null===c.children||c.children.forEach(function(c){c._decode(a,b)}),c.contains&&("octstr"===c.tag||"bitstr"===c.tag)){var n=new g(d);d=this._getUse(c.contains,a._reporterState.obj)._decode(n,b)}}return c.obj&&e&&(d=a.leaveObject(j)),null===c.key||null===d&&e!==!0?null!==f&&a.exitKey(f):a.leaveKey(f,c.key,d),d},d.prototype._decodeGeneric=function(a,b,c){var d=this._baseState;return"seq"===a||"set"===a?null:"seqof"===a||"setof"===a?this._decodeList(b,a,d.args[0],c):/str$/.test(a)?this._decodeStr(b,a,c):"objid"===a&&d.args?this._decodeObjid(b,d.args[0],d.args[1],c):"objid"===a?this._decodeObjid(b,null,null,c):"gentime"===a||"utctime"===a?this._decodeTime(b,a,c):"null_"===a?this._decodeNull(b,c):"bool"===a?this._decodeBool(b,c):"objDesc"===a?this._decodeStr(b,a,c):"int"===a||"enum"===a?this._decodeInt(b,d.args&&d.args[0],c):null!==d.use?this._getUse(d.use,b._reporterState.obj)._decode(b,c):b.error("unknown tag: "+a)},d.prototype._getUse=function(a,b){var c=this._baseState;return c.useDecoder=this._use(a,b),h(null===c.useDecoder._baseState.parent),c.useDecoder=c.useDecoder._baseState.children[0],c.implicit!==c.useDecoder._baseState.implicit&&(c.useDecoder=c.useDecoder.clone(),c.useDecoder._baseState.implicit=c.implicit),c.useDecoder},d.prototype._decodeChoice=function(a,b){var c=this._baseState,d=null,e=!1;return Object.keys(c.choice).some(function(f){var g=a.save(),h=c.choice[f];try{var i=h._decode(a,b);if(a.isError(i))return!1;d={type:f,value:i},e=!0}catch(b){return a.restore(g),!1}return!0},this),e?d:a.error("Choice not matched")},d.prototype._createEncoderBuffer=function(a){return new f(a,this.reporter)},d.prototype._encode=function(a,b,c){var d=this._baseState;if(null===d.default||d.default!==a){var e=this._encodeValue(a,b,c);if(void 0!==e&&!this._skipDefault(e,b,c))return e}},d.prototype._encodeValue=function(a,b,c){var d=this._baseState;if(null===d.parent)return d.children[0]._encode(a,b||new e);var f=null;if(this.reporter=b,d.optional&&void 0===a){if(null===d.default)return;a=d.default}var g=null,h=!1;if(d.any)f=this._createEncoderBuffer(a);else if(d.choice)f=this._encodeChoice(a,b);else if(d.contains)g=this._getUse(d.contains,c)._encode(a,b),h=!0;else if(d.children)g=d.children.map(function(c){if("null_"===c._baseState.tag)return c._encode(null,b,a);if(null===c._baseState.key)return b.error("Child should have a key");var d=b.enterKey(c._baseState.key);if("object"!=typeof a)return b.error("Child expected, but input is not object");var e=c._encode(a[c._baseState.key],b,a);return b.leaveKey(d),e},this).filter(function(a){return a}),g=this._createEncoderBuffer(g);else if("seqof"===d.tag||"setof"===d.tag){if(!d.args||1!==d.args.length)return b.error("Too many args for : "+d.tag);if(!Array.isArray(a))return b.error("seqof/setof, but data is not Array");var i=this.clone();i._baseState.implicit=null,g=this._createEncoderBuffer(a.map(function(c){var d=this._baseState;return this._getUse(d.args[0],a)._encode(c,b)},i))}else null!==d.use?f=this._getUse(d.use,c)._encode(a,b):(g=this._encodePrimitive(d.tag,a),h=!0);var f;if(!d.any&&null===d.choice){var j=null!==d.implicit?d.implicit:d.tag,k=null===d.implicit?"universal":"context";null===j?null===d.use&&b.error("Tag could be omitted only for .use()"):null===d.use&&(f=this._encodeComposite(j,h,k,g))}return null!==d.explicit&&(f=this._encodeComposite(d.explicit,!1,"context",f)),f},d.prototype._encodeChoice=function(a,b){var c=this._baseState,d=c.choice[a.type];return d||h(!1,a.type+" not found in "+JSON.stringify(Object.keys(c.choice))),d._encode(a.value,b)},d.prototype._encodePrimitive=function(a,b){var c=this._baseState;if(/str$/.test(a))return this._encodeStr(b,a);if("objid"===a&&c.args)return this._encodeObjid(b,c.reverseArgs[0],c.args[1]);if("objid"===a)return this._encodeObjid(b,null,null);if("gentime"===a||"utctime"===a)return this._encodeTime(b,a);if("null_"===a)return this._encodeNull();if("int"===a||"enum"===a)return this._encodeInt(b,c.args&&c.reverseArgs[0]);if("bool"===a)return this._encodeBool(b);if("objDesc"===a)return this._encodeStr(b,a);throw new Error("Unsupported tag: "+a)},d.prototype._isNumstr=function(a){return/^[0-9 ]*$/.test(a)},d.prototype._isPrintstr=function(a){return/^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(a)}},{"../base":119,"minimalistic-assert":234}],121:[function(a,b,c){function d(a){this._reporterState={obj:null,path:[],options:a||{},errors:[]}}function e(a,b){this.path=a,this.rethrow(b)}var f=a("inherits");c.Reporter=d,d.prototype.isError=function(a){return a instanceof e},d.prototype.save=function(){var a=this._reporterState;return{obj:a.obj,pathLen:a.path.length}},d.prototype.restore=function(a){var b=this._reporterState;b.obj=a.obj,b.path=b.path.slice(0,a.pathLen)},d.prototype.enterKey=function(a){return this._reporterState.path.push(a)},d.prototype.exitKey=function(a){var b=this._reporterState;b.path=b.path.slice(0,a-1)},d.prototype.leaveKey=function(a,b,c){var d=this._reporterState;this.exitKey(a),null!==d.obj&&(d.obj[b]=c)},d.prototype.path=function(){return this._reporterState.path.join("/")},d.prototype.enterObject=function(){var a=this._reporterState,b=a.obj;return a.obj={},b},d.prototype.leaveObject=function(a){var b=this._reporterState,c=b.obj;return b.obj=a,c},d.prototype.error=function(a){var b,c=this._reporterState,d=a instanceof e;if(b=d?a:new e(c.path.map(function(a){return"["+JSON.stringify(a)+"]"}).join(""),a.message||a,a.stack),!c.options.partial)throw b;return d||c.errors.push(b),b},d.prototype.wrapResult=function(a){var b=this._reporterState;return b.options.partial?{result:this.isError(a)?null:a,errors:b.errors}:a},f(e,Error),e.prototype.rethrow=function(a){if(this.message=a+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,e),!this.stack)try{throw new Error(this.message)}catch(a){this.stack=a.stack}return this}},{inherits:226}],122:[function(a,b,c){var d=a("../constants");c.tagClass={0:"universal",1:"application",2:"context",3:"private"},c.tagClassByName=d._reverse(c.tagClass),c.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},c.tagByName=d._reverse(c.tag)},{"../constants":123}],123:[function(a,b,c){var d=c;d._reverse=function(a){var b={};return Object.keys(a).forEach(function(c){(0|c)==c&&(c|=0);var d=a[c];b[d]=c}),b},d.der=a("./der")},{"./der":122}],124:[function(a,b,c){function d(a){this.enc="der",this.name=a.name,this.entity=a,this.tree=new e,this.tree._init(a.body)}function e(a){j.Node.call(this,"der",a)}function f(a,b){var c=a.readUInt8(b);if(a.isError(c))return c;var d=l.tagClass[c>>6],e=0===(32&c);if(31===(31&c)){var f=c;for(c=0;128===(128&f);){if(f=a.readUInt8(b),a.isError(f))return f;c<<=7,c|=127&f}}else c&=31;var g=l.tag[c];return{cls:d,primitive:e,tag:c,tagStr:g}}function g(a,b,c){var d=a.readUInt8(c);if(a.isError(d))return d;if(!b&&128===d)return null;if(0===(128&d))return d;var e=127&d;if(e>4)return a.error("length octect is too long");d=0;for(var f=0;f<e;f++){d<<=8;var g=a.readUInt8(c);if(a.isError(g))return g;d|=g}return d}var h=a("inherits"),i=a("../../asn1"),j=i.base,k=i.bignum,l=i.constants.der;b.exports=d,d.prototype.decode=function(a,b){return a instanceof j.DecoderBuffer||(a=new j.DecoderBuffer(a,b)),this.tree._decode(a,b)},h(e,j.Node),e.prototype._peekTag=function(a,b,c){if(a.isEmpty())return!1;var d=a.save(),e=f(a,'Failed to peek tag: "'+b+'"');return a.isError(e)?e:(a.restore(d),e.tag===b||e.tagStr===b||e.tagStr+"of"===b||c)},e.prototype._decodeTag=function(a,b,c){var d=f(a,'Failed to decode tag of "'+b+'"');if(a.isError(d))return d;var e=g(a,d.primitive,'Failed to get length of "'+b+'"');if(a.isError(e))return e;if(!c&&d.tag!==b&&d.tagStr!==b&&d.tagStr+"of"!==b)return a.error('Failed to match tag: "'+b+'"');if(d.primitive||null!==e)return a.skip(e,'Failed to match body of: "'+b+'"');var h=a.save(),i=this._skipUntilEnd(a,'Failed to skip indefinite length body: "'+this.tag+'"');return a.isError(i)?i:(e=a.offset-h.offset,a.restore(h),a.skip(e,'Failed to match body of: "'+b+'"'))},e.prototype._skipUntilEnd=function(a,b){for(;;){var c=f(a,b);if(a.isError(c))return c;var d=g(a,c.primitive,b);if(a.isError(d))return d;var e;if(e=c.primitive||null!==d?a.skip(d):this._skipUntilEnd(a,b),a.isError(e))return e;if("end"===c.tagStr)break}},e.prototype._decodeList=function(a,b,c,d){for(var e=[];!a.isEmpty();){var f=this._peekTag(a,"end");if(a.isError(f))return f;var g=c.decode(a,"der",d);if(a.isError(g)&&f)break;e.push(g)}return e},e.prototype._decodeStr=function(a,b){if("bitstr"===b){var c=a.readUInt8();return a.isError(c)?c:{unused:c,data:a.raw()}}if("bmpstr"===b){var d=a.raw();if(d.length%2===1)return a.error("Decoding of string type: bmpstr length mismatch");for(var e="",f=0;f<d.length/2;f++)e+=String.fromCharCode(d.readUInt16BE(2*f));return e}if("numstr"===b){var g=a.raw().toString("ascii");return this._isNumstr(g)?g:a.error("Decoding of string type: numstr unsupported characters")}if("octstr"===b)return a.raw();if("objDesc"===b)return a.raw();if("printstr"===b){var h=a.raw().toString("ascii");return this._isPrintstr(h)?h:a.error("Decoding of string type: printstr unsupported characters")}return/str$/.test(b)?a.raw().toString():a.error("Decoding of string type: "+b+" unsupported")},e.prototype._decodeObjid=function(a,b,c){for(var d,e=[],f=0;!a.isEmpty();){var g=a.readUInt8();f<<=7,f|=127&g,0===(128&g)&&(e.push(f),f=0)}128&g&&e.push(f);var h=e[0]/40|0,i=e[0]%40;if(d=c?e:[h,i].concat(e.slice(1)),b){var j=b[d.join(" ")];void 0===j&&(j=b[d.join(".")]),void 0!==j&&(d=j)}return d},e.prototype._decodeTime=function(a,b){var c=a.raw().toString();if("gentime"===b)var d=0|c.slice(0,4),e=0|c.slice(4,6),f=0|c.slice(6,8),g=0|c.slice(8,10),h=0|c.slice(10,12),i=0|c.slice(12,14);else{if("utctime"!==b)return a.error("Decoding "+b+" time is not supported yet");var d=0|c.slice(0,2),e=0|c.slice(2,4),f=0|c.slice(4,6),g=0|c.slice(6,8),h=0|c.slice(8,10),i=0|c.slice(10,12);d=d<70?2e3+d:1900+d}return Date.UTC(d,e-1,f,g,h,i,0)},e.prototype._decodeNull=function(a){return null},e.prototype._decodeBool=function(a){var b=a.readUInt8();return a.isError(b)?b:0!==b},e.prototype._decodeInt=function(a,b){var c=a.raw(),d=new k(c);return b&&(d=b[d.toString(10)]||d),d},e.prototype._use=function(a,b){return"function"==typeof a&&(a=a(b)),a._getDecoder("der").tree}},{"../../asn1":116,inherits:226}],125:[function(a,b,c){var d=c;d.der=a("./der"),d.pem=a("./pem")},{"./der":124,"./pem":126}],126:[function(a,b,c){function d(a){f.call(this,a),this.enc="pem"}var e=a("inherits"),Buffer=a("buffer").Buffer,f=a("./der");e(d,f),b.exports=d,d.prototype.decode=function(a,b){for(var c=a.toString().split(/[\r\n]+/g),d=b.label.toUpperCase(),e=/^-----(BEGIN|END) ([^-]+)-----$/,g=-1,h=-1,i=0;i<c.length;i++){var j=c[i].match(e);if(null!==j&&j[2]===d){if(g!==-1){if("END"!==j[1])break;h=i;break}if("BEGIN"!==j[1])break;g=i}}if(g===-1||h===-1)throw new Error("PEM section not found for: "+d);var k=c.slice(g+1,h).join("");k.replace(/[^a-z0-9\+\/=]+/gi,"");var l=new Buffer(k,"base64");return f.prototype.decode.call(this,l,b)}},{"./der":124,buffer:104,inherits:226}],127:[function(a,b,c){function d(a){this.enc="der",this.name=a.name,this.entity=a,this.tree=new e,this.tree._init(a.body)}function e(a){j.Node.call(this,"der",a)}function f(a){return a<10?"0"+a:a}function g(a,b,c,d){var e;if("seqof"===a?a="seq":"setof"===a&&(a="set"),k.tagByName.hasOwnProperty(a))e=k.tagByName[a];else{if("number"!=typeof a||(0|a)!==a)return d.error("Unknown tag: "+a);e=a}return e>=31?d.error("Multi-octet tag encoding unsupported"):(b||(e|=32),e|=k.tagClassByName[c||"universal"]<<6)}var h=a("inherits"),Buffer=a("buffer").Buffer,i=a("../../asn1"),j=i.base,k=i.constants.der;b.exports=d,d.prototype.encode=function(a,b){return this.tree._encode(a,b).join()},h(e,j.Node),e.prototype._encodeComposite=function(a,b,c,d){var e=g(a,b,c,this.reporter);if(d.length<128){var f=new Buffer(2);return f[0]=e,f[1]=d.length,this._createEncoderBuffer([f,d])}for(var h=1,i=d.length;i>=256;i>>=8)h++;var f=new Buffer(2+h);f[0]=e,f[1]=128|h;for(var i=1+h,j=d.length;j>0;i--,j>>=8)f[i]=255&j;return this._createEncoderBuffer([f,d])},e.prototype._encodeStr=function(a,b){if("bitstr"===b)return this._createEncoderBuffer([0|a.unused,a.data]);if("bmpstr"===b){for(var c=new Buffer(2*a.length),d=0;d<a.length;d++)c.writeUInt16BE(a.charCodeAt(d),2*d);return this._createEncoderBuffer(c)}return"numstr"===b?this._isNumstr(a)?this._createEncoderBuffer(a):this.reporter.error("Encoding of string type: numstr supports only digits and space"):"printstr"===b?this._isPrintstr(a)?this._createEncoderBuffer(a):this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark"):/str$/.test(b)?this._createEncoderBuffer(a):"objDesc"===b?this._createEncoderBuffer(a):this.reporter.error("Encoding of string type: "+b+" unsupported")},e.prototype._encodeObjid=function(a,b,c){if("string"==typeof a){if(!b)return this.reporter.error("string objid given, but no values map found");if(!b.hasOwnProperty(a))return this.reporter.error("objid not found in values map");a=b[a].split(/[\s\.]+/g);for(var d=0;d<a.length;d++)a[d]|=0}else if(Array.isArray(a)){a=a.slice();for(var d=0;d<a.length;d++)a[d]|=0}if(!Array.isArray(a))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(a));if(!c){if(a[1]>=40)return this.reporter.error("Second objid identifier OOB");a.splice(0,2,40*a[0]+a[1])}for(var e=0,d=0;d<a.length;d++){var f=a[d];for(e++;f>=128;f>>=7)e++}for(var g=new Buffer(e),h=g.length-1,d=a.length-1;d>=0;d--){var f=a[d];for(g[h--]=127&f;(f>>=7)>0;)g[h--]=128|127&f}return this._createEncoderBuffer(g)},e.prototype._encodeTime=function(a,b){var c,d=new Date(a);return"gentime"===b?c=[f(d.getFullYear()),f(d.getUTCMonth()+1),f(d.getUTCDate()),f(d.getUTCHours()),f(d.getUTCMinutes()),f(d.getUTCSeconds()),"Z"].join(""):"utctime"===b?c=[f(d.getFullYear()%100),f(d.getUTCMonth()+1),f(d.getUTCDate()),f(d.getUTCHours()),f(d.getUTCMinutes()),f(d.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+b+" time is not supported yet"),this._encodeStr(c,"octstr")},e.prototype._encodeNull=function(){return this._createEncoderBuffer("")},e.prototype._encodeInt=function(a,b){if("string"==typeof a){if(!b)return this.reporter.error("String int or enum given, but no values map");if(!b.hasOwnProperty(a))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(a));a=b[a]}if("number"!=typeof a&&!Buffer.isBuffer(a)){var c=a.toArray();!a.sign&&128&c[0]&&c.unshift(0),a=new Buffer(c)}if(Buffer.isBuffer(a)){var d=a.length;0===a.length&&d++;var e=new Buffer(d);return a.copy(e),0===a.length&&(e[0]=0),this._createEncoderBuffer(e)}if(a<128)return this._createEncoderBuffer(a);if(a<256)return this._createEncoderBuffer([0,a]);for(var d=1,f=a;f>=256;f>>=8)d++;for(var e=new Array(d),f=e.length-1;f>=0;f--)e[f]=255&a,a>>=8;return 128&e[0]&&e.unshift(0),this._createEncoderBuffer(new Buffer(e))},e.prototype._encodeBool=function(a){return this._createEncoderBuffer(a?255:0)},e.prototype._use=function(a,b){return"function"==typeof a&&(a=a(b)),a._getEncoder("der").tree},e.prototype._skipDefault=function(a,b,c){var d,e=this._baseState;if(null===e.default)return!1;var f=a.join();if(void 0===e.defaultBuffer&&(e.defaultBuffer=this._encodeValue(e.default,b,c).join()),f.length!==e.defaultBuffer.length)return!1;for(d=0;d<f.length;d++)if(f[d]!==e.defaultBuffer[d])return!1;return!0}},{"../../asn1":116,buffer:104,inherits:226}],128:[function(a,b,c){var d=c;d.der=a("./der"),d.pem=a("./pem")},{"./der":127,"./pem":129}],129:[function(a,b,c){function d(a){f.call(this,a),this.enc="pem"}var e=a("inherits"),f=a("./der");e(d,f),b.exports=d,d.prototype.encode=function(a,b){for(var c=f.prototype.encode.call(this,a),d=c.toString("base64"),e=["-----BEGIN "+b.label+"-----"],g=0;g<d.length;g+=64)e.push(d.slice(g,g+64));return e.push("-----END "+b.label+"-----"),e.join("\n")}},{"./der":127,inherits:226}],130:[function(a,b,c){(function(Buffer){function c(a){var b=e(a),c=b.toRed(f.mont(a.modulus)).redPow(new f(a.publicExponent)).fromRed();return{blinder:c,unblinder:b.invm(a.modulus)}}function d(a,b){var d=c(b),e=b.modulus.byteLength(),g=(f.mont(b.modulus),new f(a).mul(d.blinder).umod(b.modulus)),h=g.toRed(f.mont(b.prime1)),i=g.toRed(f.mont(b.prime2)),j=b.coefficient,k=b.prime1,l=b.prime2,m=h.redPow(b.exponent1),n=i.redPow(b.exponent2);m=m.fromRed(),n=n.fromRed();var o=m.isub(n).imul(j).umod(k);return o.imul(l),n.iadd(o),new Buffer(n.imul(d.unblinder).umod(b.modulus).toArray(!1,e))}function e(a){for(var b=a.modulus.byteLength(),c=new f(g(b));c.cmp(a.modulus)>=0||!c.umod(a.prime1)||!c.umod(a.prime2);)c=new f(g(b));return c}var f=a("bn.js"),g=a("randombytes");b.exports=d,d.getr=e}).call(this,a("buffer").Buffer)},{"bn.js":75,buffer:104,randombytes:271}],131:[function(a,b,c){b.exports=a("./browser/algorithms.json")},{"./browser/algorithms.json":132}],132:[function(a,b,c){b.exports={sha224WithRSAEncryption:{sign:"rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},"RSA-SHA224":{sign:"ecdsa/rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},sha256WithRSAEncryption:{sign:"rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},"RSA-SHA256":{sign:"ecdsa/rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},sha384WithRSAEncryption:{sign:"rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},"RSA-SHA384":{sign:"ecdsa/rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},sha512WithRSAEncryption:{sign:"rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA512":{sign:"ecdsa/rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA1":{sign:"rsa",hash:"sha1",id:"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{sign:"ecdsa",hash:"sha1",id:""},sha256:{sign:"ecdsa",hash:"sha256",id:""},sha224:{sign:"ecdsa",hash:"sha224",id:""},sha384:{sign:"ecdsa",hash:"sha384",id:""},sha512:{sign:"ecdsa",hash:"sha512",id:""},"DSA-SHA":{sign:"dsa",hash:"sha1",id:""},"DSA-SHA1":{sign:"dsa",hash:"sha1",id:""},DSA:{sign:"dsa",hash:"sha1",id:""},"DSA-WITH-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-WITH-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-WITH-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-WITH-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-RIPEMD160":{sign:"dsa",hash:"rmd160",id:""},ripemd160WithRSA:{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},"RSA-RIPEMD160":{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},md5WithRSAEncryption:{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"},"RSA-MD5":{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"}}},{}],133:[function(a,b,c){b.exports={"1.3.132.0.10":"secp256k1","1.3.132.0.33":"p224","1.2.840.10045.3.1.1":"p192","1.2.840.10045.3.1.7":"p256","1.3.132.0.34":"p384","1.3.132.0.35":"p521"}},{}],134:[function(a,b,c){(function(Buffer){function c(a){h.Writable.call(this);var b=l[a];if(!b)throw new Error("Unknown message digest");this._hashType=b.hash,this._hash=g(b.hash),this._tag=b.id,this._signType=b.sign}function d(a){h.Writable.call(this);var b=l[a];if(!b)throw new Error("Unknown message digest");this._hash=g(b.hash),this._tag=b.id,this._signType=b.sign}function e(a){return new c(a)}function f(a){return new d(a)}var g=a("create-hash"),h=a("stream"),i=a("inherits"),j=a("./sign"),k=a("./verify"),l=a("./algorithms.json");Object.keys(l).forEach(function(a){l[a].id=new Buffer(l[a].id,"hex"),l[a.toLowerCase()]=l[a]}),i(c,h.Writable),c.prototype._write=function(a,b,c){this._hash.update(a),c()},c.prototype.update=function(a,b){return"string"==typeof a&&(a=new Buffer(a,b)),this._hash.update(a),this},c.prototype.sign=function(a,b){this.end();var c=this._hash.digest(),d=j(c,a,this._hashType,this._signType,this._tag);return b?d.toString(b):d},i(d,h.Writable),d.prototype._write=function(a,b,c){this._hash.update(a),c()},d.prototype.update=function(a,b){return"string"==typeof a&&(a=new Buffer(a,b)),this._hash.update(a),this},d.prototype.verify=function(a,b,c){"string"==typeof b&&(b=new Buffer(b,c)),this.end();var d=this._hash.digest();return k(b,d,a,this._signType,this._tag)},b.exports={Sign:e,Verify:f,createSign:e,createVerify:f}}).call(this,a("buffer").Buffer)},{"./algorithms.json":132,"./sign":135,"./verify":136,buffer:104,"create-hash":110,inherits:226,stream:304}],135:[function(a,b,c){(function(Buffer){function c(a,b,c,f,g){var h=p(b);if(h.curve){if("ecdsa"!==f&&"ecdsa/rsa"!==f)throw new Error("wrong private key type");return d(a,h)}if("dsa"===h.type){if("dsa"!==f)throw new Error("wrong private key type");return e(a,h,c)}if("rsa"!==f&&"ecdsa/rsa"!==f)throw new Error("wrong private key type");a=Buffer.concat([g,a]);for(var i=h.modulus.byteLength(),j=[0,1];a.length+j.length+1<i;)j.push(255);j.push(0);for(var k=-1;++k<a.length;)j.push(a[k]);var l=m(j,h);return l}function d(a,b){var c=q[b.curve.join(".")];if(!c)throw new Error("unknown curve "+b.curve.join("."));var d=new n(c),e=d.keyFromPrivate(b.privateKey),f=e.sign(a);return new Buffer(f.toDER())}function e(a,b,c){for(var d,e=b.params.priv_key,i=b.params.p,l=b.params.q,m=b.params.g,n=new o(0),p=h(a,l).mod(l),q=!1,r=g(e,l,a,c);q===!1;)d=j(l,r,c),n=k(m,d,i,l),q=d.invm(l).imul(p.add(e.mul(n))).mod(l),0===q.cmpn(0)&&(q=!1,n=new o(0));return f(n,q)}function f(a,b){a=a.toArray(),b=b.toArray(),128&a[0]&&(a=[0].concat(a)),128&b[0]&&(b=[0].concat(b));var c=a.length+b.length+4,d=[48,c,2,a.length];return d=d.concat(a,[2,b.length],b),new Buffer(d)}function g(a,b,c,d){if(a=new Buffer(a.toArray()),a.length<b.byteLength()){var e=new Buffer(b.byteLength()-a.length);e.fill(0),a=Buffer.concat([e,a])}var f=c.length,g=i(c,b),h=new Buffer(f);h.fill(1);var j=new Buffer(f);return j.fill(0),j=l(d,j).update(h).update(new Buffer([0])).update(a).update(g).digest(),h=l(d,j).update(h).digest(),j=l(d,j).update(h).update(new Buffer([1])).update(a).update(g).digest(),h=l(d,j).update(h).digest(),{k:j,v:h}}function h(a,b){var c=new o(a),d=(a.length<<3)-b.bitLength();return d>0&&c.ishrn(d),c}function i(a,b){a=h(a,b),a=a.mod(b);var c=new Buffer(a.toArray());if(c.length<b.byteLength()){var d=new Buffer(b.byteLength()-c.length);d.fill(0),c=Buffer.concat([d,c])}return c}function j(a,b,c){var d,e;do{for(d=new Buffer(0);8*d.length<a.bitLength();)b.v=l(c,b.k).update(b.v).digest(),d=Buffer.concat([d,b.v]);e=h(d,a),b.k=l(c,b.k).update(b.v).update(new Buffer([0])).digest(),b.v=l(c,b.k).update(b.v).digest()}while(e.cmp(a)!==-1);return e}function k(a,b,c,d){return a.toRed(o.mont(c)).redPow(b).fromRed().mod(d)}var l=a("create-hmac"),m=a("browserify-rsa"),n=a("elliptic").ec,o=a("bn.js"),p=a("parse-asn1"),q=a("./curves.json");b.exports=c,b.exports.getKey=g,b.exports.makeKey=j}).call(this,a("buffer").Buffer)},{"./curves.json":133,"bn.js":75,"browserify-rsa":130,buffer:104,"create-hmac":113,elliptic:192,"parse-asn1":141}],136:[function(a,b,c){(function(Buffer){function c(a,b,c,f,h){var j=i(c);if("ec"===j.type){if("ecdsa"!==f&&"ecdsa/rsa"!==f)throw new Error("wrong public key type");return d(a,b,j)}if("dsa"===j.type){if("dsa"!==f)throw new Error("wrong public key type");return e(a,b,j)}if("rsa"!==f&&"ecdsa/rsa"!==f)throw new Error("wrong public key type");b=Buffer.concat([h,b]);for(var k=j.modulus.byteLength(),l=[1],m=0;b.length+l.length+2<k;)l.push(255),m++;l.push(0);for(var n=-1;++n<b.length;)l.push(b[n]);l=new Buffer(l);var o=g.mont(j.modulus);a=new g(a).toRed(o),a=a.redPow(new g(j.publicExponent)),a=new Buffer(a.fromRed().toArray());var p=m<8?1:0;for(k=Math.min(a.length,l.length),a.length!==l.length&&(p=1),n=-1;++n<k;)p|=a[n]^l[n];return 0===p}function d(a,b,c){var d=j[c.data.algorithm.curve.join(".")];if(!d)throw new Error("unknown curve "+c.data.algorithm.curve.join("."));var e=new h(d),f=c.data.subjectPrivateKey.data;return e.verify(b,a,f)}function e(a,b,c){var d=c.data.p,e=c.data.q,h=c.data.g,j=c.data.pub_key,k=i.signature.decode(a,"der"),l=k.s,m=k.r;f(l,e),f(m,e);var n=g.mont(d),o=l.invm(e),p=h.toRed(n).redPow(new g(b).mul(o).mod(e)).fromRed().mul(j.toRed(n).redPow(m.mul(o).mod(e)).fromRed()).mod(d).mod(e);return 0===p.cmp(m)}function f(a,b){if(a.cmpn(0)<=0)throw new Error("invalid sig");if(a.cmp(b)>=b)throw new Error("invalid sig")}var g=a("bn.js"),h=a("elliptic").ec,i=a("parse-asn1"),j=a("./curves.json");b.exports=c}).call(this,a("buffer").Buffer)},{"./curves.json":133,"bn.js":75,buffer:104,elliptic:192,"parse-asn1":141}],137:[function(a,b,c){b.exports={"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}},{}],138:[function(a,b,c){"use strict";var d=a("asn1.js");c.certificate=a("./certificate");var e=d.define("RSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())});c.RSAPrivateKey=e;var f=d.define("RSAPublicKey",function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())});c.RSAPublicKey=f;var g=d.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(h),this.key("subjectPublicKey").bitstr())});c.PublicKey=g;var h=d.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())}),i=d.define("PrivateKeyInfo",function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(h),this.key("subjectPrivateKey").octstr())});c.PrivateKey=i;var j=d.define("EncryptedPrivateKeyInfo",function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())});c.EncryptedPrivateKey=j;var k=d.define("DSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())});c.DSAPrivateKey=k,c.DSAparam=d.define("DSAparam",function(){this.int()});var l=d.define("ECPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(m),this.key("publicKey").optional().explicit(1).bitstr())});c.ECPrivateKey=l;var m=d.define("ECParameters",function(){this.choice({namedCurve:this.objid()})});c.signature=d.define("signature",function(){this.seq().obj(this.key("r").int(),this.key("s").int())})},{"./certificate":139,"asn1.js":116}],139:[function(a,b,c){"use strict";var d=a("asn1.js"),e=d.define("Time",function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})}),f=d.define("AttributeTypeValue",function(){this.seq().obj(this.key("type").objid(),this.key("value").any())}),g=d.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional())}),h=d.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(g),this.key("subjectPublicKey").bitstr())}),i=d.define("RelativeDistinguishedName",function(){this.setof(f)}),j=d.define("RDNSequence",function(){this.seqof(i)}),k=d.define("Name",function(){this.choice({rdnSequence:this.use(j)})}),l=d.define("Validity",function(){this.seq().obj(this.key("notBefore").use(e),this.key("notAfter").use(e))}),m=d.define("Extension",function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())}),n=d.define("TBSCertificate",function(){this.seq().obj(this.key("version").explicit(0).int(),this.key("serialNumber").int(),this.key("signature").use(g),this.key("issuer").use(k),this.key("validity").use(l),this.key("subject").use(k),this.key("subjectPublicKeyInfo").use(h),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(m).optional())}),o=d.define("X509Certificate",function(){this.seq().obj(this.key("tbsCertificate").use(n),this.key("signatureAlgorithm").use(g),this.key("signatureValue").bitstr())});b.exports=o},{"asn1.js":116}],140:[function(a,b,c){(function(Buffer){var c=/Proc-Type: 4,ENCRYPTED\n\r?DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)\n\r?\n\r?([0-9A-z\n\r\+\/\=]+)\n\r?/m,d=/^-----BEGIN ((?:.* KEY)|CERTIFICATE)-----\n/m,e=/^-----BEGIN ((?:.* KEY)|CERTIFICATE)-----\n\r?([0-9A-z\n\r\+\/\=]+)\n\r?-----END \1-----$/m,f=a("evp_bytestokey"),g=a("browserify-aes"); |
| 12 |
|
b.exports=function(a,b){var h,i=a.toString(),j=i.match(c);if(j){var k="aes"+j[1],l=new Buffer(j[2],"hex"),m=new Buffer(j[3].replace(/\r?\n/g,""),"base64"),n=f(b,l.slice(0,8),parseInt(j[1],10)).key,o=[],p=g.createDecipheriv(k,n,l);o.push(p.update(m)),o.push(p.final()),h=Buffer.concat(o)}else{var q=i.match(e);h=new Buffer(q[2].replace(/\r?\n/g,""),"base64")}var r=i.match(d)[1];return{tag:r,data:h}}}).call(this,a("buffer").Buffer)},{"browserify-aes":80,buffer:104,evp_bytestokey:209}],141:[function(a,b,c){(function(Buffer){function c(a){var b;"object"!=typeof a||Buffer.isBuffer(a)||(b=a.passphrase,a=a.key),"string"==typeof a&&(a=new Buffer(a));var c,f,h=g(a,b),i=h.tag,j=h.data;switch(i){case"CERTIFICATE":f=e.certificate.decode(j,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(f||(f=e.PublicKey.decode(j,"der")),c=f.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return e.RSAPublicKey.decode(f.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return f.subjectPrivateKey=f.subjectPublicKey,{type:"ec",data:f};case"1.2.840.10040.4.1":return f.algorithm.params.pub_key=e.DSAparam.decode(f.subjectPublicKey.data,"der"),{type:"dsa",data:f.algorithm.params};default:throw new Error("unknown key id "+c)}throw new Error("unknown key type "+i);case"ENCRYPTED PRIVATE KEY":j=e.EncryptedPrivateKey.decode(j,"der"),j=d(j,b);case"PRIVATE KEY":switch(f=e.PrivateKey.decode(j,"der"),c=f.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return e.RSAPrivateKey.decode(f.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:f.algorithm.curve,privateKey:e.ECPrivateKey.decode(f.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return f.algorithm.params.priv_key=e.DSAparam.decode(f.subjectPrivateKey,"der"),{type:"dsa",params:f.algorithm.params};default:throw new Error("unknown key id "+c)}throw new Error("unknown key type "+i);case"RSA PUBLIC KEY":return e.RSAPublicKey.decode(j,"der");case"RSA PRIVATE KEY":return e.RSAPrivateKey.decode(j,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:e.DSAPrivateKey.decode(j,"der")};case"EC PRIVATE KEY":return j=e.ECPrivateKey.decode(j,"der"),{curve:j.parameters.value,privateKey:j.privateKey};default:throw new Error("unknown key type "+i)}}function d(a,b){var c=a.algorithm.decrypt.kde.kdeparams.salt,d=parseInt(a.algorithm.decrypt.kde.kdeparams.iters.toString(),10),e=f[a.algorithm.decrypt.cipher.algo.join(".")],g=a.algorithm.decrypt.cipher.iv,j=a.subjectPrivateKey,k=parseInt(e.split("-")[1],10)/8,l=i.pbkdf2Sync(b,c,d,k),m=h.createDecipheriv(e,l,g),n=[];return n.push(m.update(j)),n.push(m.final()),Buffer.concat(n)}var e=a("./asn1"),f=a("./aesid.json"),g=a("./fixProc"),h=a("browserify-aes"),i=a("pbkdf2");b.exports=c,c.signature=e.signature}).call(this,a("buffer").Buffer)},{"./aesid.json":137,"./asn1":138,"./fixProc":140,"browserify-aes":80,buffer:104,pbkdf2:236}],142:[function(a,b,c){!function(d,e,f){"object"==typeof c?b.exports=c=e(a("./core"),a("./enc-base64"),a("./md5"),a("./evpkdf"),a("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(d.CryptoJS)}(this,function(a){return function(){var b=a,c=b.lib,d=c.BlockCipher,e=b.algo,f=[],g=[],h=[],i=[],j=[],k=[],l=[],m=[],n=[],o=[];!function(){for(var a=[],b=0;b<256;b++)b<128?a[b]=b<<1:a[b]=b<<1^283;for(var c=0,d=0,b=0;b<256;b++){var e=d^d<<1^d<<2^d<<3^d<<4;e=e>>>8^255&e^99,f[c]=e,g[e]=c;var p=a[c],q=a[p],r=a[q],s=257*a[e]^16843008*e;h[c]=s<<24|s>>>8,i[c]=s<<16|s>>>16,j[c]=s<<8|s>>>24,k[c]=s;var s=16843009*r^65537*q^257*p^16843008*c;l[e]=s<<24|s>>>8,m[e]=s<<16|s>>>16,n[e]=s<<8|s>>>24,o[e]=s,c?(c=p^a[a[a[r^p]]],d^=a[a[d]]):c=d=1}}();var p=[0,1,2,4,8,16,32,64,128,27,54],q=e.AES=d.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var a=this._keyPriorReset=this._key,b=a.words,c=a.sigBytes/4,d=this._nRounds=c+6,e=4*(d+1),g=this._keySchedule=[],h=0;h<e;h++)if(h<c)g[h]=b[h];else{var i=g[h-1];h%c?c>6&&h%c==4&&(i=f[i>>>24]<<24|f[i>>>16&255]<<16|f[i>>>8&255]<<8|f[255&i]):(i=i<<8|i>>>24,i=f[i>>>24]<<24|f[i>>>16&255]<<16|f[i>>>8&255]<<8|f[255&i],i^=p[h/c|0]<<24),g[h]=g[h-c]^i}for(var j=this._invKeySchedule=[],k=0;k<e;k++){var h=e-k;if(k%4)var i=g[h];else var i=g[h-4];k<4||h<=4?j[k]=i:j[k]=l[f[i>>>24]]^m[f[i>>>16&255]]^n[f[i>>>8&255]]^o[f[255&i]]}}},encryptBlock:function(a,b){this._doCryptBlock(a,b,this._keySchedule,h,i,j,k,f)},decryptBlock:function(a,b){var c=a[b+1];a[b+1]=a[b+3],a[b+3]=c,this._doCryptBlock(a,b,this._invKeySchedule,l,m,n,o,g);var c=a[b+1];a[b+1]=a[b+3],a[b+3]=c},_doCryptBlock:function(a,b,c,d,e,f,g,h){for(var i=this._nRounds,j=a[b]^c[0],k=a[b+1]^c[1],l=a[b+2]^c[2],m=a[b+3]^c[3],n=4,o=1;o<i;o++){var p=d[j>>>24]^e[k>>>16&255]^f[l>>>8&255]^g[255&m]^c[n++],q=d[k>>>24]^e[l>>>16&255]^f[m>>>8&255]^g[255&j]^c[n++],r=d[l>>>24]^e[m>>>16&255]^f[j>>>8&255]^g[255&k]^c[n++],s=d[m>>>24]^e[j>>>16&255]^f[k>>>8&255]^g[255&l]^c[n++];j=p,k=q,l=r,m=s}var p=(h[j>>>24]<<24|h[k>>>16&255]<<16|h[l>>>8&255]<<8|h[255&m])^c[n++],q=(h[k>>>24]<<24|h[l>>>16&255]<<16|h[m>>>8&255]<<8|h[255&j])^c[n++],r=(h[l>>>24]<<24|h[m>>>16&255]<<16|h[j>>>8&255]<<8|h[255&k])^c[n++],s=(h[m>>>24]<<24|h[j>>>16&255]<<16|h[k>>>8&255]<<8|h[255&l])^c[n++];a[b]=p,a[b+1]=q,a[b+2]=r,a[b+3]=s},keySize:8});b.AES=d._createHelper(q)}(),a.AES})},{"./cipher-core":143,"./core":144,"./enc-base64":145,"./evpkdf":147,"./md5":152}],143:[function(a,b,c){!function(d,e){"object"==typeof c?b.exports=c=e(a("./core")):"function"==typeof define&&define.amd?define(["./core"],e):e(d.CryptoJS)}(this,function(a){a.lib.Cipher||function(b){var c=a,d=c.lib,e=d.Base,f=d.WordArray,g=d.BufferedBlockAlgorithm,h=c.enc,i=(h.Utf8,h.Base64),j=c.algo,k=j.EvpKDF,l=d.Cipher=g.extend({cfg:e.extend(),createEncryptor:function(a,b){return this.create(this._ENC_XFORM_MODE,a,b)},createDecryptor:function(a,b){return this.create(this._DEC_XFORM_MODE,a,b)},init:function(a,b,c){this.cfg=this.cfg.extend(c),this._xformMode=a,this._key=b,this.reset()},reset:function(){g.reset.call(this),this._doReset()},process:function(a){return this._append(a),this._process()},finalize:function(a){a&&this._append(a);var b=this._doFinalize();return b},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function a(a){return"string"==typeof a?x:u}return function(b){return{encrypt:function(c,d,e){return a(d).encrypt(b,c,d,e)},decrypt:function(c,d,e){return a(d).decrypt(b,c,d,e)}}}}()}),m=(d.StreamCipher=l.extend({_doFinalize:function(){var a=this._process(!0);return a},blockSize:1}),c.mode={}),n=d.BlockCipherMode=e.extend({createEncryptor:function(a,b){return this.Encryptor.create(a,b)},createDecryptor:function(a,b){return this.Decryptor.create(a,b)},init:function(a,b){this._cipher=a,this._iv=b}}),o=m.CBC=function(){function a(a,c,d){var e=this._iv;if(e){var f=e;this._iv=b}else var f=this._prevBlock;for(var g=0;g<d;g++)a[c+g]^=f[g]}var c=n.extend();return c.Encryptor=c.extend({processBlock:function(b,c){var d=this._cipher,e=d.blockSize;a.call(this,b,c,e),d.encryptBlock(b,c),this._prevBlock=b.slice(c,c+e)}}),c.Decryptor=c.extend({processBlock:function(b,c){var d=this._cipher,e=d.blockSize,f=b.slice(c,c+e);d.decryptBlock(b,c),a.call(this,b,c,e),this._prevBlock=f}}),c}(),p=c.pad={},q=p.Pkcs7={pad:function(a,b){for(var c=4*b,d=c-a.sigBytes%c,e=d<<24|d<<16|d<<8|d,g=[],h=0;h<d;h+=4)g.push(e);var i=f.create(g,d);a.concat(i)},unpad:function(a){var b=255&a.words[a.sigBytes-1>>>2];a.sigBytes-=b}},r=(d.BlockCipher=l.extend({cfg:l.cfg.extend({mode:o,padding:q}),reset:function(){l.reset.call(this);var a=this.cfg,b=a.iv,c=a.mode;if(this._xformMode==this._ENC_XFORM_MODE)var d=c.createEncryptor;else{var d=c.createDecryptor;this._minBufferSize=1}this._mode=d.call(c,this,b&&b.words)},_doProcessBlock:function(a,b){this._mode.processBlock(a,b)},_doFinalize:function(){var a=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){a.pad(this._data,this.blockSize);var b=this._process(!0)}else{var b=this._process(!0);a.unpad(b)}return b},blockSize:4}),d.CipherParams=e.extend({init:function(a){this.mixIn(a)},toString:function(a){return(a||this.formatter).stringify(this)}})),s=c.format={},t=s.OpenSSL={stringify:function(a){var b=a.ciphertext,c=a.salt;if(c)var d=f.create([1398893684,1701076831]).concat(c).concat(b);else var d=b;return d.toString(i)},parse:function(a){var b=i.parse(a),c=b.words;if(1398893684==c[0]&&1701076831==c[1]){var d=f.create(c.slice(2,4));c.splice(0,4),b.sigBytes-=16}return r.create({ciphertext:b,salt:d})}},u=d.SerializableCipher=e.extend({cfg:e.extend({format:t}),encrypt:function(a,b,c,d){d=this.cfg.extend(d);var e=a.createEncryptor(c,d),f=e.finalize(b),g=e.cfg;return r.create({ciphertext:f,key:c,iv:g.iv,algorithm:a,mode:g.mode,padding:g.padding,blockSize:a.blockSize,formatter:d.format})},decrypt:function(a,b,c,d){d=this.cfg.extend(d),b=this._parse(b,d.format);var e=a.createDecryptor(c,d).finalize(b.ciphertext);return e},_parse:function(a,b){return"string"==typeof a?b.parse(a,this):a}}),v=c.kdf={},w=v.OpenSSL={execute:function(a,b,c,d){d||(d=f.random(8));var e=k.create({keySize:b+c}).compute(a,d),g=f.create(e.words.slice(b),4*c);return e.sigBytes=4*b,r.create({key:e,iv:g,salt:d})}},x=d.PasswordBasedCipher=u.extend({cfg:u.cfg.extend({kdf:w}),encrypt:function(a,b,c,d){d=this.cfg.extend(d);var e=d.kdf.execute(c,a.keySize,a.ivSize);d.iv=e.iv;var f=u.encrypt.call(this,a,b,e.key,d);return f.mixIn(e),f},decrypt:function(a,b,c,d){d=this.cfg.extend(d),b=this._parse(b,d.format);var e=d.kdf.execute(c,a.keySize,a.ivSize,b.salt);d.iv=e.iv;var f=u.decrypt.call(this,a,b,e.key,d);return f}})}()})},{"./core":144}],144:[function(a,b,c){!function(a,d){"object"==typeof c?b.exports=c=d():"function"==typeof define&&define.amd?define([],d):a.CryptoJS=d()}(this,function(){var a=a||function(a,b){var c=Object.create||function(){function a(){}return function(b){var c;return a.prototype=b,c=new a,a.prototype=null,c}}(),d={},e=d.lib={},f=e.Base=function(){return{extend:function(a){var b=c(this);return a&&b.mixIn(a),b.hasOwnProperty("init")&&this.init!==b.init||(b.init=function(){b.$super.init.apply(this,arguments)}),b.init.prototype=b,b.$super=this,b},create:function(){var a=this.extend();return a.init.apply(a,arguments),a},init:function(){},mixIn:function(a){for(var b in a)a.hasOwnProperty(b)&&(this[b]=a[b]);a.hasOwnProperty("toString")&&(this.toString=a.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),g=e.WordArray=f.extend({init:function(a,c){a=this.words=a||[],c!=b?this.sigBytes=c:this.sigBytes=4*a.length},toString:function(a){return(a||i).stringify(this)},concat:function(a){var b=this.words,c=a.words,d=this.sigBytes,e=a.sigBytes;if(this.clamp(),d%4)for(var f=0;f<e;f++){var g=c[f>>>2]>>>24-f%4*8&255;b[d+f>>>2]|=g<<24-(d+f)%4*8}else for(var f=0;f<e;f+=4)b[d+f>>>2]=c[f>>>2];return this.sigBytes+=e,this},clamp:function(){var b=this.words,c=this.sigBytes;b[c>>>2]&=4294967295<<32-c%4*8,b.length=a.ceil(c/4)},clone:function(){var a=f.clone.call(this);return a.words=this.words.slice(0),a},random:function(b){for(var c,d=[],e=function(b){var b=b,c=987654321,d=4294967295;return function(){c=36969*(65535&c)+(c>>16)&d,b=18e3*(65535&b)+(b>>16)&d;var e=(c<<16)+b&d;return e/=4294967296,e+=.5,e*(a.random()>.5?1:-1)}},f=0;f<b;f+=4){var h=e(4294967296*(c||a.random()));c=987654071*h(),d.push(4294967296*h()|0)}return new g.init(d,b)}}),h=d.enc={},i=h.Hex={stringify:function(a){for(var b=a.words,c=a.sigBytes,d=[],e=0;e<c;e++){var f=b[e>>>2]>>>24-e%4*8&255;d.push((f>>>4).toString(16)),d.push((15&f).toString(16))}return d.join("")},parse:function(a){for(var b=a.length,c=[],d=0;d<b;d+=2)c[d>>>3]|=parseInt(a.substr(d,2),16)<<24-d%8*4;return new g.init(c,b/2)}},j=h.Latin1={stringify:function(a){for(var b=a.words,c=a.sigBytes,d=[],e=0;e<c;e++){var f=b[e>>>2]>>>24-e%4*8&255;d.push(String.fromCharCode(f))}return d.join("")},parse:function(a){for(var b=a.length,c=[],d=0;d<b;d++)c[d>>>2]|=(255&a.charCodeAt(d))<<24-d%4*8;return new g.init(c,b)}},k=h.Utf8={stringify:function(a){try{return decodeURIComponent(escape(j.stringify(a)))}catch(a){throw new Error("Malformed UTF-8 data")}},parse:function(a){return j.parse(unescape(encodeURIComponent(a)))}},l=e.BufferedBlockAlgorithm=f.extend({reset:function(){this._data=new g.init,this._nDataBytes=0},_append:function(a){"string"==typeof a&&(a=k.parse(a)),this._data.concat(a),this._nDataBytes+=a.sigBytes},_process:function(b){var c=this._data,d=c.words,e=c.sigBytes,f=this.blockSize,h=4*f,i=e/h;i=b?a.ceil(i):a.max((0|i)-this._minBufferSize,0);var j=i*f,k=a.min(4*j,e);if(j){for(var l=0;l<j;l+=f)this._doProcessBlock(d,l);var m=d.splice(0,j);c.sigBytes-=k}return new g.init(m,k)},clone:function(){var a=f.clone.call(this);return a._data=this._data.clone(),a},_minBufferSize:0}),m=(e.Hasher=l.extend({cfg:f.extend(),init:function(a){this.cfg=this.cfg.extend(a),this.reset()},reset:function(){l.reset.call(this),this._doReset()},update:function(a){return this._append(a),this._process(),this},finalize:function(a){a&&this._append(a);var b=this._doFinalize();return b},blockSize:16,_createHelper:function(a){return function(b,c){return new a.init(c).finalize(b)}},_createHmacHelper:function(a){return function(b,c){return new m.HMAC.init(a,c).finalize(b)}}}),d.algo={});return d}(Math);return a})},{}],145:[function(a,b,c){!function(d,e){"object"==typeof c?b.exports=c=e(a("./core")):"function"==typeof define&&define.amd?define(["./core"],e):e(d.CryptoJS)}(this,function(a){return function(){function b(a,b,c){for(var d=[],f=0,g=0;g<b;g++)if(g%4){var h=c[a.charCodeAt(g-1)]<<g%4*2,i=c[a.charCodeAt(g)]>>>6-g%4*2;d[f>>>2]|=(h|i)<<24-f%4*8,f++}return e.create(d,f)}var c=a,d=c.lib,e=d.WordArray,f=c.enc;f.Base64={stringify:function(a){var b=a.words,c=a.sigBytes,d=this._map;a.clamp();for(var e=[],f=0;f<c;f+=3)for(var g=b[f>>>2]>>>24-f%4*8&255,h=b[f+1>>>2]>>>24-(f+1)%4*8&255,i=b[f+2>>>2]>>>24-(f+2)%4*8&255,j=g<<16|h<<8|i,k=0;k<4&&f+.75*k<c;k++)e.push(d.charAt(j>>>6*(3-k)&63));var l=d.charAt(64);if(l)for(;e.length%4;)e.push(l);return e.join("")},parse:function(a){var c=a.length,d=this._map,e=this._reverseMap;if(!e){e=this._reverseMap=[];for(var f=0;f<d.length;f++)e[d.charCodeAt(f)]=f}var g=d.charAt(64);if(g){var h=a.indexOf(g);h!==-1&&(c=h)}return b(a,c,e)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),a.enc.Base64})},{"./core":144}],146:[function(a,b,c){!function(d,e){"object"==typeof c?b.exports=c=e(a("./core")):"function"==typeof define&&define.amd?define(["./core"],e):e(d.CryptoJS)}(this,function(a){return function(){function b(a){return a<<8&4278255360|a>>>8&16711935}var c=a,d=c.lib,e=d.WordArray,f=c.enc;f.Utf16=f.Utf16BE={stringify:function(a){for(var b=a.words,c=a.sigBytes,d=[],e=0;e<c;e+=2){var f=b[e>>>2]>>>16-e%4*8&65535;d.push(String.fromCharCode(f))}return d.join("")},parse:function(a){for(var b=a.length,c=[],d=0;d<b;d++)c[d>>>1]|=a.charCodeAt(d)<<16-d%2*16;return e.create(c,2*b)}};f.Utf16LE={stringify:function(a){for(var c=a.words,d=a.sigBytes,e=[],f=0;f<d;f+=2){var g=b(c[f>>>2]>>>16-f%4*8&65535);e.push(String.fromCharCode(g))}return e.join("")},parse:function(a){for(var c=a.length,d=[],f=0;f<c;f++)d[f>>>1]|=b(a.charCodeAt(f)<<16-f%2*16);return e.create(d,2*c)}}}(),a.enc.Utf16})},{"./core":144}],147:[function(a,b,c){!function(d,e,f){"object"==typeof c?b.exports=c=e(a("./core"),a("./sha1"),a("./hmac")):"function"==typeof define&&define.amd?define(["./core","./sha1","./hmac"],e):e(d.CryptoJS)}(this,function(a){return function(){var b=a,c=b.lib,d=c.Base,e=c.WordArray,f=b.algo,g=f.MD5,h=f.EvpKDF=d.extend({cfg:d.extend({keySize:4,hasher:g,iterations:1}),init:function(a){this.cfg=this.cfg.extend(a)},compute:function(a,b){for(var c=this.cfg,d=c.hasher.create(),f=e.create(),g=f.words,h=c.keySize,i=c.iterations;g.length<h;){j&&d.update(j);var j=d.update(a).finalize(b);d.reset();for(var k=1;k<i;k++)j=d.finalize(j),d.reset();f.concat(j)}return f.sigBytes=4*h,f}});b.EvpKDF=function(a,b,c){return h.create(c).compute(a,b)}}(),a.EvpKDF})},{"./core":144,"./hmac":149,"./sha1":168}],148:[function(a,b,c){!function(d,e,f){"object"==typeof c?b.exports=c=e(a("./core"),a("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],e):e(d.CryptoJS)}(this,function(a){return function(b){var c=a,d=c.lib,e=d.CipherParams,f=c.enc,g=f.Hex,h=c.format;h.Hex={stringify:function(a){return a.ciphertext.toString(g)},parse:function(a){var b=g.parse(a);return e.create({ciphertext:b})}}}(),a.format.Hex})},{"./cipher-core":143,"./core":144}],149:[function(a,b,c){!function(d,e){"object"==typeof c?b.exports=c=e(a("./core")):"function"==typeof define&&define.amd?define(["./core"],e):e(d.CryptoJS)}(this,function(a){!function(){var b=a,c=b.lib,d=c.Base,e=b.enc,f=e.Utf8,g=b.algo;g.HMAC=d.extend({init:function(a,b){a=this._hasher=new a.init,"string"==typeof b&&(b=f.parse(b));var c=a.blockSize,d=4*c;b.sigBytes>d&&(b=a.finalize(b)),b.clamp();for(var e=this._oKey=b.clone(),g=this._iKey=b.clone(),h=e.words,i=g.words,j=0;j<c;j++)h[j]^=1549556828,i[j]^=909522486;e.sigBytes=g.sigBytes=d,this.reset()},reset:function(){var a=this._hasher;a.reset(),a.update(this._iKey)},update:function(a){return this._hasher.update(a),this},finalize:function(a){var b=this._hasher,c=b.finalize(a);b.reset();var d=b.finalize(this._oKey.clone().concat(c));return d}})}()})},{"./core":144}],150:[function(a,b,c){!function(d,e,f){"object"==typeof c?b.exports=c=e(a("./core"),a("./x64-core"),a("./lib-typedarrays"),a("./enc-utf16"),a("./enc-base64"),a("./md5"),a("./sha1"),a("./sha256"),a("./sha224"),a("./sha512"),a("./sha384"),a("./sha3"),a("./ripemd160"),a("./hmac"),a("./pbkdf2"),a("./evpkdf"),a("./cipher-core"),a("./mode-cfb"),a("./mode-ctr"),a("./mode-ctr-gladman"),a("./mode-ofb"),a("./mode-ecb"),a("./pad-ansix923"),a("./pad-iso10126"),a("./pad-iso97971"),a("./pad-zeropadding"),a("./pad-nopadding"),a("./format-hex"),a("./aes"),a("./tripledes"),a("./rc4"),a("./rabbit"),a("./rabbit-legacy")):"function"==typeof define&&define.amd?define(["./core","./x64-core","./lib-typedarrays","./enc-utf16","./enc-base64","./md5","./sha1","./sha256","./sha224","./sha512","./sha384","./sha3","./ripemd160","./hmac","./pbkdf2","./evpkdf","./cipher-core","./mode-cfb","./mode-ctr","./mode-ctr-gladman","./mode-ofb","./mode-ecb","./pad-ansix923","./pad-iso10126","./pad-iso97971","./pad-zeropadding","./pad-nopadding","./format-hex","./aes","./tripledes","./rc4","./rabbit","./rabbit-legacy"],e):d.CryptoJS=e(d.CryptoJS)}(this,function(a){return a})},{"./aes":142,"./cipher-core":143,"./core":144,"./enc-base64":145,"./enc-utf16":146,"./evpkdf":147,"./format-hex":148,"./hmac":149,"./lib-typedarrays":151,"./md5":152,"./mode-cfb":153,"./mode-ctr":155,"./mode-ctr-gladman":154,"./mode-ecb":156,"./mode-ofb":157,"./pad-ansix923":158,"./pad-iso10126":159,"./pad-iso97971":160,"./pad-nopadding":161,"./pad-zeropadding":162,"./pbkdf2":163,"./rabbit":165,"./rabbit-legacy":164,"./rc4":166,"./ripemd160":167,"./sha1":168,"./sha224":169,"./sha256":170,"./sha3":171,"./sha384":172,"./sha512":173,"./tripledes":174,"./x64-core":175}],151:[function(a,b,c){!function(d,e){"object"==typeof c?b.exports=c=e(a("./core")):"function"==typeof define&&define.amd?define(["./core"],e):e(d.CryptoJS)}(this,function(a){return function(){if("function"==typeof ArrayBuffer){var b=a,c=b.lib,d=c.WordArray,e=d.init,f=d.init=function(a){if(a instanceof ArrayBuffer&&(a=new Uint8Array(a)),(a instanceof Int8Array||"undefined"!=typeof Uint8ClampedArray&&a instanceof Uint8ClampedArray||a instanceof Int16Array||a instanceof Uint16Array||a instanceof Int32Array||a instanceof Uint32Array||a instanceof Float32Array||a instanceof Float64Array)&&(a=new Uint8Array(a.buffer,a.byteOffset,a.byteLength)),a instanceof Uint8Array){for(var b=a.byteLength,c=[],d=0;d<b;d++)c[d>>>2]|=a[d]<<24-d%4*8;e.call(this,c,b)}else e.apply(this,arguments)};f.prototype=d}}(),a.lib.WordArray})},{"./core":144}],152:[function(a,b,c){!function(d,e){"object"==typeof c?b.exports=c=e(a("./core")):"function"==typeof define&&define.amd?define(["./core"],e):e(d.CryptoJS)}(this,function(a){return function(b){function c(a,b,c,d,e,f,g){var h=a+(b&c|~b&d)+e+g;return(h<<f|h>>>32-f)+b}function d(a,b,c,d,e,f,g){var h=a+(b&d|c&~d)+e+g;return(h<<f|h>>>32-f)+b}function e(a,b,c,d,e,f,g){var h=a+(b^c^d)+e+g;return(h<<f|h>>>32-f)+b}function f(a,b,c,d,e,f,g){var h=a+(c^(b|~d))+e+g;return(h<<f|h>>>32-f)+b}var g=a,h=g.lib,i=h.WordArray,j=h.Hasher,k=g.algo,l=[];!function(){for(var a=0;a<64;a++)l[a]=4294967296*b.abs(b.sin(a+1))|0}();var m=k.MD5=j.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(a,b){for(var g=0;g<16;g++){var h=b+g,i=a[h];a[h]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var j=this._hash.words,k=a[b+0],m=a[b+1],n=a[b+2],o=a[b+3],p=a[b+4],q=a[b+5],r=a[b+6],s=a[b+7],t=a[b+8],u=a[b+9],v=a[b+10],w=a[b+11],x=a[b+12],y=a[b+13],z=a[b+14],A=a[b+15],B=j[0],C=j[1],D=j[2],E=j[3];B=c(B,C,D,E,k,7,l[0]),E=c(E,B,C,D,m,12,l[1]),D=c(D,E,B,C,n,17,l[2]),C=c(C,D,E,B,o,22,l[3]),B=c(B,C,D,E,p,7,l[4]),E=c(E,B,C,D,q,12,l[5]),D=c(D,E,B,C,r,17,l[6]),C=c(C,D,E,B,s,22,l[7]),B=c(B,C,D,E,t,7,l[8]),E=c(E,B,C,D,u,12,l[9]),D=c(D,E,B,C,v,17,l[10]),C=c(C,D,E,B,w,22,l[11]),B=c(B,C,D,E,x,7,l[12]),E=c(E,B,C,D,y,12,l[13]),D=c(D,E,B,C,z,17,l[14]),C=c(C,D,E,B,A,22,l[15]),B=d(B,C,D,E,m,5,l[16]),E=d(E,B,C,D,r,9,l[17]),D=d(D,E,B,C,w,14,l[18]),C=d(C,D,E,B,k,20,l[19]),B=d(B,C,D,E,q,5,l[20]),E=d(E,B,C,D,v,9,l[21]),D=d(D,E,B,C,A,14,l[22]),C=d(C,D,E,B,p,20,l[23]),B=d(B,C,D,E,u,5,l[24]),E=d(E,B,C,D,z,9,l[25]),D=d(D,E,B,C,o,14,l[26]),C=d(C,D,E,B,t,20,l[27]),B=d(B,C,D,E,y,5,l[28]),E=d(E,B,C,D,n,9,l[29]),D=d(D,E,B,C,s,14,l[30]),C=d(C,D,E,B,x,20,l[31]),B=e(B,C,D,E,q,4,l[32]),E=e(E,B,C,D,t,11,l[33]),D=e(D,E,B,C,w,16,l[34]),C=e(C,D,E,B,z,23,l[35]),B=e(B,C,D,E,m,4,l[36]),E=e(E,B,C,D,p,11,l[37]),D=e(D,E,B,C,s,16,l[38]),C=e(C,D,E,B,v,23,l[39]),B=e(B,C,D,E,y,4,l[40]),E=e(E,B,C,D,k,11,l[41]),D=e(D,E,B,C,o,16,l[42]),C=e(C,D,E,B,r,23,l[43]),B=e(B,C,D,E,u,4,l[44]),E=e(E,B,C,D,x,11,l[45]),D=e(D,E,B,C,A,16,l[46]),C=e(C,D,E,B,n,23,l[47]),B=f(B,C,D,E,k,6,l[48]),E=f(E,B,C,D,s,10,l[49]),D=f(D,E,B,C,z,15,l[50]),C=f(C,D,E,B,q,21,l[51]),B=f(B,C,D,E,x,6,l[52]),E=f(E,B,C,D,o,10,l[53]),D=f(D,E,B,C,v,15,l[54]),C=f(C,D,E,B,m,21,l[55]),B=f(B,C,D,E,t,6,l[56]),E=f(E,B,C,D,A,10,l[57]),D=f(D,E,B,C,r,15,l[58]),C=f(C,D,E,B,y,21,l[59]),B=f(B,C,D,E,p,6,l[60]),E=f(E,B,C,D,w,10,l[61]),D=f(D,E,B,C,n,15,l[62]),C=f(C,D,E,B,u,21,l[63]),j[0]=j[0]+B|0,j[1]=j[1]+C|0,j[2]=j[2]+D|0,j[3]=j[3]+E|0},_doFinalize:function(){var a=this._data,c=a.words,d=8*this._nDataBytes,e=8*a.sigBytes;c[e>>>5]|=128<<24-e%32;var f=b.floor(d/4294967296),g=d;c[(e+64>>>9<<4)+15]=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8),c[(e+64>>>9<<4)+14]=16711935&(g<<8|g>>>24)|4278255360&(g<<24|g>>>8),a.sigBytes=4*(c.length+1),this._process();for(var h=this._hash,i=h.words,j=0;j<4;j++){var k=i[j];i[j]=16711935&(k<<8|k>>>24)|4278255360&(k<<24|k>>>8)}return h},clone:function(){var a=j.clone.call(this);return a._hash=this._hash.clone(),a}});g.MD5=j._createHelper(m),g.HmacMD5=j._createHmacHelper(m)}(Math),a.MD5})},{"./core":144}],153:[function(a,b,c){!function(d,e,f){"object"==typeof c?b.exports=c=e(a("./core"),a("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],e):e(d.CryptoJS)}(this,function(a){return a.mode.CFB=function(){function b(a,b,c,d){var e=this._iv;if(e){var f=e.slice(0);this._iv=void 0}else var f=this._prevBlock;d.encryptBlock(f,0);for(var g=0;g<c;g++)a[b+g]^=f[g]}var c=a.lib.BlockCipherMode.extend();return c.Encryptor=c.extend({processBlock:function(a,c){var d=this._cipher,e=d.blockSize;b.call(this,a,c,e,d),this._prevBlock=a.slice(c,c+e)}}),c.Decryptor=c.extend({processBlock:function(a,c){var d=this._cipher,e=d.blockSize,f=a.slice(c,c+e);b.call(this,a,c,e,d),this._prevBlock=f}}),c}(),a.mode.CFB})},{"./cipher-core":143,"./core":144}],154:[function(a,b,c){!function(d,e,f){"object"==typeof c?b.exports=c=e(a("./core"),a("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],e):e(d.CryptoJS)}(this,function(a){return a.mode.CTRGladman=function(){function b(a){if(255===(a>>24&255)){var b=a>>16&255,c=a>>8&255,d=255&a;255===b?(b=0,255===c?(c=0,255===d?d=0:++d):++c):++b,a=0,a+=b<<16,a+=c<<8,a+=d}else a+=1<<24;return a}function c(a){return 0===(a[0]=b(a[0]))&&(a[1]=b(a[1])),a}var d=a.lib.BlockCipherMode.extend(),e=d.Encryptor=d.extend({processBlock:function(a,b){var d=this._cipher,e=d.blockSize,f=this._iv,g=this._counter;f&&(g=this._counter=f.slice(0),this._iv=void 0),c(g);var h=g.slice(0);d.encryptBlock(h,0);for(var i=0;i<e;i++)a[b+i]^=h[i]}});return d.Decryptor=e,d}(),a.mode.CTRGladman})},{"./cipher-core":143,"./core":144}],155:[function(a,b,c){!function(d,e,f){"object"==typeof c?b.exports=c=e(a("./core"),a("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],e):e(d.CryptoJS)}(this,function(a){return a.mode.CTR=function(){var b=a.lib.BlockCipherMode.extend(),c=b.Encryptor=b.extend({processBlock:function(a,b){var c=this._cipher,d=c.blockSize,e=this._iv,f=this._counter;e&&(f=this._counter=e.slice(0),this._iv=void 0);var g=f.slice(0);c.encryptBlock(g,0),f[d-1]=f[d-1]+1|0;for(var h=0;h<d;h++)a[b+h]^=g[h]}});return b.Decryptor=c,b}(),a.mode.CTR})},{"./cipher-core":143,"./core":144}],156:[function(a,b,c){!function(d,e,f){"object"==typeof c?b.exports=c=e(a("./core"),a("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],e):e(d.CryptoJS)}(this,function(a){return a.mode.ECB=function(){var b=a.lib.BlockCipherMode.extend();return b.Encryptor=b.extend({processBlock:function(a,b){this._cipher.encryptBlock(a,b)}}),b.Decryptor=b.extend({processBlock:function(a,b){this._cipher.decryptBlock(a,b)}}),b}(),a.mode.ECB})},{"./cipher-core":143,"./core":144}],157:[function(a,b,c){!function(d,e,f){"object"==typeof c?b.exports=c=e(a("./core"),a("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],e):e(d.CryptoJS)}(this,function(a){return a.mode.OFB=function(){var b=a.lib.BlockCipherMode.extend(),c=b.Encryptor=b.extend({processBlock:function(a,b){var c=this._cipher,d=c.blockSize,e=this._iv,f=this._keystream;e&&(f=this._keystream=e.slice(0),this._iv=void 0),c.encryptBlock(f,0);for(var g=0;g<d;g++)a[b+g]^=f[g]}});return b.Decryptor=c,b}(),a.mode.OFB})},{"./cipher-core":143,"./core":144}],158:[function(a,b,c){!function(d,e,f){"object"==typeof c?b.exports=c=e(a("./core"),a("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],e):e(d.CryptoJS)}(this,function(a){return a.pad.AnsiX923={pad:function(a,b){var c=a.sigBytes,d=4*b,e=d-c%d,f=c+e-1;a.clamp(),a.words[f>>>2]|=e<<24-f%4*8,a.sigBytes+=e},unpad:function(a){var b=255&a.words[a.sigBytes-1>>>2];a.sigBytes-=b}},a.pad.Ansix923})},{"./cipher-core":143,"./core":144}],159:[function(a,b,c){!function(d,e,f){"object"==typeof c?b.exports=c=e(a("./core"),a("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],e):e(d.CryptoJS)}(this,function(a){return a.pad.Iso10126={pad:function(b,c){var d=4*c,e=d-b.sigBytes%d;b.concat(a.lib.WordArray.random(e-1)).concat(a.lib.WordArray.create([e<<24],1))},unpad:function(a){var b=255&a.words[a.sigBytes-1>>>2];a.sigBytes-=b}},a.pad.Iso10126})},{"./cipher-core":143,"./core":144}],160:[function(a,b,c){!function(d,e,f){"object"==typeof c?b.exports=c=e(a("./core"),a("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],e):e(d.CryptoJS)}(this,function(a){return a.pad.Iso97971={pad:function(b,c){b.concat(a.lib.WordArray.create([2147483648],1)),a.pad.ZeroPadding.pad(b,c)},unpad:function(b){a.pad.ZeroPadding.unpad(b),b.sigBytes--}},a.pad.Iso97971})},{"./cipher-core":143,"./core":144}],161:[function(a,b,c){!function(d,e,f){"object"==typeof c?b.exports=c=e(a("./core"),a("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],e):e(d.CryptoJS)}(this,function(a){return a.pad.NoPadding={pad:function(){},unpad:function(){}},a.pad.NoPadding})},{"./cipher-core":143,"./core":144}],162:[function(a,b,c){!function(d,e,f){"object"==typeof c?b.exports=c=e(a("./core"),a("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],e):e(d.CryptoJS)}(this,function(a){return a.pad.ZeroPadding={pad:function(a,b){var c=4*b;a.clamp(),a.sigBytes+=c-(a.sigBytes%c||c)},unpad:function(a){for(var b=a.words,c=a.sigBytes-1;!(b[c>>>2]>>>24-c%4*8&255);)c--;a.sigBytes=c+1}},a.pad.ZeroPadding})},{"./cipher-core":143,"./core":144}],163:[function(a,b,c){!function(d,e,f){"object"==typeof c?b.exports=c=e(a("./core"),a("./sha1"),a("./hmac")):"function"==typeof define&&define.amd?define(["./core","./sha1","./hmac"],e):e(d.CryptoJS)}(this,function(a){return function(){var b=a,c=b.lib,d=c.Base,e=c.WordArray,f=b.algo,g=f.SHA1,h=f.HMAC,i=f.PBKDF2=d.extend({cfg:d.extend({keySize:4,hasher:g,iterations:1}),init:function(a){this.cfg=this.cfg.extend(a)},compute:function(a,b){for(var c=this.cfg,d=h.create(c.hasher,a),f=e.create(),g=e.create([1]),i=f.words,j=g.words,k=c.keySize,l=c.iterations;i.length<k;){var m=d.update(b).finalize(g);d.reset();for(var n=m.words,o=n.length,p=m,q=1;q<l;q++){p=d.finalize(p),d.reset();for(var r=p.words,s=0;s<o;s++)n[s]^=r[s]}f.concat(m),j[0]++}return f.sigBytes=4*k,f}});b.PBKDF2=function(a,b,c){return i.create(c).compute(a,b)}}(),a.PBKDF2})},{"./core":144,"./hmac":149,"./sha1":168}],164:[function(a,b,c){!function(d,e,f){"object"==typeof c?b.exports=c=e(a("./core"),a("./enc-base64"),a("./md5"),a("./evpkdf"),a("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(d.CryptoJS)}(this,function(a){return function(){function b(){for(var a=this._X,b=this._C,c=0;c<8;c++)h[c]=b[c];b[0]=b[0]+1295307597+this._b|0,b[1]=b[1]+3545052371+(b[0]>>>0<h[0]>>>0?1:0)|0,b[2]=b[2]+886263092+(b[1]>>>0<h[1]>>>0?1:0)|0,b[3]=b[3]+1295307597+(b[2]>>>0<h[2]>>>0?1:0)|0,b[4]=b[4]+3545052371+(b[3]>>>0<h[3]>>>0?1:0)|0,b[5]=b[5]+886263092+(b[4]>>>0<h[4]>>>0?1:0)|0,b[6]=b[6]+1295307597+(b[5]>>>0<h[5]>>>0?1:0)|0,b[7]=b[7]+3545052371+(b[6]>>>0<h[6]>>>0?1:0)|0,this._b=b[7]>>>0<h[7]>>>0?1:0;for(var c=0;c<8;c++){var d=a[c]+b[c],e=65535&d,f=d>>>16,g=((e*e>>>17)+e*f>>>15)+f*f,j=((4294901760&d)*d|0)+((65535&d)*d|0);i[c]=g^j}a[0]=i[0]+(i[7]<<16|i[7]>>>16)+(i[6]<<16|i[6]>>>16)|0,a[1]=i[1]+(i[0]<<8|i[0]>>>24)+i[7]|0,a[2]=i[2]+(i[1]<<16|i[1]>>>16)+(i[0]<<16|i[0]>>>16)|0,a[3]=i[3]+(i[2]<<8|i[2]>>>24)+i[1]|0,a[4]=i[4]+(i[3]<<16|i[3]>>>16)+(i[2]<<16|i[2]>>>16)|0,a[5]=i[5]+(i[4]<<8|i[4]>>>24)+i[3]|0,a[6]=i[6]+(i[5]<<16|i[5]>>>16)+(i[4]<<16|i[4]>>>16)|0,a[7]=i[7]+(i[6]<<8|i[6]>>>24)+i[5]|0}var c=a,d=c.lib,e=d.StreamCipher,f=c.algo,g=[],h=[],i=[],j=f.RabbitLegacy=e.extend({_doReset:function(){var a=this._key.words,c=this.cfg.iv,d=this._X=[a[0],a[3]<<16|a[2]>>>16,a[1],a[0]<<16|a[3]>>>16,a[2],a[1]<<16|a[0]>>>16,a[3],a[2]<<16|a[1]>>>16],e=this._C=[a[2]<<16|a[2]>>>16,4294901760&a[0]|65535&a[1],a[3]<<16|a[3]>>>16,4294901760&a[1]|65535&a[2],a[0]<<16|a[0]>>>16,4294901760&a[2]|65535&a[3],a[1]<<16|a[1]>>>16,4294901760&a[3]|65535&a[0]];this._b=0;for(var f=0;f<4;f++)b.call(this);for(var f=0;f<8;f++)e[f]^=d[f+4&7];if(c){var g=c.words,h=g[0],i=g[1],j=16711935&(h<<8|h>>>24)|4278255360&(h<<24|h>>>8),k=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),l=j>>>16|4294901760&k,m=k<<16|65535&j;e[0]^=j,e[1]^=l,e[2]^=k,e[3]^=m,e[4]^=j,e[5]^=l,e[6]^=k,e[7]^=m;for(var f=0;f<4;f++)b.call(this)}},_doProcessBlock:function(a,c){var d=this._X;b.call(this),g[0]=d[0]^d[5]>>>16^d[3]<<16,g[1]=d[2]^d[7]>>>16^d[5]<<16,g[2]=d[4]^d[1]>>>16^d[7]<<16,g[3]=d[6]^d[3]>>>16^d[1]<<16;for(var e=0;e<4;e++)g[e]=16711935&(g[e]<<8|g[e]>>>24)|4278255360&(g[e]<<24|g[e]>>>8),a[c+e]^=g[e]},blockSize:4,ivSize:2});c.RabbitLegacy=e._createHelper(j)}(),a.RabbitLegacy})},{"./cipher-core":143,"./core":144,"./enc-base64":145,"./evpkdf":147,"./md5":152}],165:[function(a,b,c){!function(d,e,f){"object"==typeof c?b.exports=c=e(a("./core"),a("./enc-base64"),a("./md5"),a("./evpkdf"),a("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(d.CryptoJS); |
| 13 |
|
}(this,function(a){return function(){function b(){for(var a=this._X,b=this._C,c=0;c<8;c++)h[c]=b[c];b[0]=b[0]+1295307597+this._b|0,b[1]=b[1]+3545052371+(b[0]>>>0<h[0]>>>0?1:0)|0,b[2]=b[2]+886263092+(b[1]>>>0<h[1]>>>0?1:0)|0,b[3]=b[3]+1295307597+(b[2]>>>0<h[2]>>>0?1:0)|0,b[4]=b[4]+3545052371+(b[3]>>>0<h[3]>>>0?1:0)|0,b[5]=b[5]+886263092+(b[4]>>>0<h[4]>>>0?1:0)|0,b[6]=b[6]+1295307597+(b[5]>>>0<h[5]>>>0?1:0)|0,b[7]=b[7]+3545052371+(b[6]>>>0<h[6]>>>0?1:0)|0,this._b=b[7]>>>0<h[7]>>>0?1:0;for(var c=0;c<8;c++){var d=a[c]+b[c],e=65535&d,f=d>>>16,g=((e*e>>>17)+e*f>>>15)+f*f,j=((4294901760&d)*d|0)+((65535&d)*d|0);i[c]=g^j}a[0]=i[0]+(i[7]<<16|i[7]>>>16)+(i[6]<<16|i[6]>>>16)|0,a[1]=i[1]+(i[0]<<8|i[0]>>>24)+i[7]|0,a[2]=i[2]+(i[1]<<16|i[1]>>>16)+(i[0]<<16|i[0]>>>16)|0,a[3]=i[3]+(i[2]<<8|i[2]>>>24)+i[1]|0,a[4]=i[4]+(i[3]<<16|i[3]>>>16)+(i[2]<<16|i[2]>>>16)|0,a[5]=i[5]+(i[4]<<8|i[4]>>>24)+i[3]|0,a[6]=i[6]+(i[5]<<16|i[5]>>>16)+(i[4]<<16|i[4]>>>16)|0,a[7]=i[7]+(i[6]<<8|i[6]>>>24)+i[5]|0}var c=a,d=c.lib,e=d.StreamCipher,f=c.algo,g=[],h=[],i=[],j=f.Rabbit=e.extend({_doReset:function(){for(var a=this._key.words,c=this.cfg.iv,d=0;d<4;d++)a[d]=16711935&(a[d]<<8|a[d]>>>24)|4278255360&(a[d]<<24|a[d]>>>8);var e=this._X=[a[0],a[3]<<16|a[2]>>>16,a[1],a[0]<<16|a[3]>>>16,a[2],a[1]<<16|a[0]>>>16,a[3],a[2]<<16|a[1]>>>16],f=this._C=[a[2]<<16|a[2]>>>16,4294901760&a[0]|65535&a[1],a[3]<<16|a[3]>>>16,4294901760&a[1]|65535&a[2],a[0]<<16|a[0]>>>16,4294901760&a[2]|65535&a[3],a[1]<<16|a[1]>>>16,4294901760&a[3]|65535&a[0]];this._b=0;for(var d=0;d<4;d++)b.call(this);for(var d=0;d<8;d++)f[d]^=e[d+4&7];if(c){var g=c.words,h=g[0],i=g[1],j=16711935&(h<<8|h>>>24)|4278255360&(h<<24|h>>>8),k=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),l=j>>>16|4294901760&k,m=k<<16|65535&j;f[0]^=j,f[1]^=l,f[2]^=k,f[3]^=m,f[4]^=j,f[5]^=l,f[6]^=k,f[7]^=m;for(var d=0;d<4;d++)b.call(this)}},_doProcessBlock:function(a,c){var d=this._X;b.call(this),g[0]=d[0]^d[5]>>>16^d[3]<<16,g[1]=d[2]^d[7]>>>16^d[5]<<16,g[2]=d[4]^d[1]>>>16^d[7]<<16,g[3]=d[6]^d[3]>>>16^d[1]<<16;for(var e=0;e<4;e++)g[e]=16711935&(g[e]<<8|g[e]>>>24)|4278255360&(g[e]<<24|g[e]>>>8),a[c+e]^=g[e]},blockSize:4,ivSize:2});c.Rabbit=e._createHelper(j)}(),a.Rabbit})},{"./cipher-core":143,"./core":144,"./enc-base64":145,"./evpkdf":147,"./md5":152}],166:[function(a,b,c){!function(d,e,f){"object"==typeof c?b.exports=c=e(a("./core"),a("./enc-base64"),a("./md5"),a("./evpkdf"),a("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(d.CryptoJS)}(this,function(a){return function(){function b(){for(var a=this._S,b=this._i,c=this._j,d=0,e=0;e<4;e++){b=(b+1)%256,c=(c+a[b])%256;var f=a[b];a[b]=a[c],a[c]=f,d|=a[(a[b]+a[c])%256]<<24-8*e}return this._i=b,this._j=c,d}var c=a,d=c.lib,e=d.StreamCipher,f=c.algo,g=f.RC4=e.extend({_doReset:function(){for(var a=this._key,b=a.words,c=a.sigBytes,d=this._S=[],e=0;e<256;e++)d[e]=e;for(var e=0,f=0;e<256;e++){var g=e%c,h=b[g>>>2]>>>24-g%4*8&255;f=(f+d[e]+h)%256;var i=d[e];d[e]=d[f],d[f]=i}this._i=this._j=0},_doProcessBlock:function(a,c){a[c]^=b.call(this)},keySize:8,ivSize:0});c.RC4=e._createHelper(g);var h=f.RC4Drop=g.extend({cfg:g.cfg.extend({drop:192}),_doReset:function(){g._doReset.call(this);for(var a=this.cfg.drop;a>0;a--)b.call(this)}});c.RC4Drop=e._createHelper(h)}(),a.RC4})},{"./cipher-core":143,"./core":144,"./enc-base64":145,"./evpkdf":147,"./md5":152}],167:[function(a,b,c){!function(d,e){"object"==typeof c?b.exports=c=e(a("./core")):"function"==typeof define&&define.amd?define(["./core"],e):e(d.CryptoJS)}(this,function(a){return function(b){function c(a,b,c){return a^b^c}function d(a,b,c){return a&b|~a&c}function e(a,b,c){return(a|~b)^c}function f(a,b,c){return a&c|b&~c}function g(a,b,c){return a^(b|~c)}function h(a,b){return a<<b|a>>>32-b}var i=a,j=i.lib,k=j.WordArray,l=j.Hasher,m=i.algo,n=k.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),o=k.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),p=k.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),q=k.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),r=k.create([0,1518500249,1859775393,2400959708,2840853838]),s=k.create([1352829926,1548603684,1836072691,2053994217,0]),t=m.RIPEMD160=l.extend({_doReset:function(){this._hash=k.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(a,b){for(var i=0;i<16;i++){var j=b+i,k=a[j];a[j]=16711935&(k<<8|k>>>24)|4278255360&(k<<24|k>>>8)}var l,m,t,u,v,w,x,y,z,A,B=this._hash.words,C=r.words,D=s.words,E=n.words,F=o.words,G=p.words,H=q.words;w=l=B[0],x=m=B[1],y=t=B[2],z=u=B[3],A=v=B[4];for(var I,i=0;i<80;i+=1)I=l+a[b+E[i]]|0,I+=i<16?c(m,t,u)+C[0]:i<32?d(m,t,u)+C[1]:i<48?e(m,t,u)+C[2]:i<64?f(m,t,u)+C[3]:g(m,t,u)+C[4],I|=0,I=h(I,G[i]),I=I+v|0,l=v,v=u,u=h(t,10),t=m,m=I,I=w+a[b+F[i]]|0,I+=i<16?g(x,y,z)+D[0]:i<32?f(x,y,z)+D[1]:i<48?e(x,y,z)+D[2]:i<64?d(x,y,z)+D[3]:c(x,y,z)+D[4],I|=0,I=h(I,H[i]),I=I+A|0,w=A,A=z,z=h(y,10),y=x,x=I;I=B[1]+t+z|0,B[1]=B[2]+u+A|0,B[2]=B[3]+v+w|0,B[3]=B[4]+l+x|0,B[4]=B[0]+m+y|0,B[0]=I},_doFinalize:function(){var a=this._data,b=a.words,c=8*this._nDataBytes,d=8*a.sigBytes;b[d>>>5]|=128<<24-d%32,b[(d+64>>>9<<4)+14]=16711935&(c<<8|c>>>24)|4278255360&(c<<24|c>>>8),a.sigBytes=4*(b.length+1),this._process();for(var e=this._hash,f=e.words,g=0;g<5;g++){var h=f[g];f[g]=16711935&(h<<8|h>>>24)|4278255360&(h<<24|h>>>8)}return e},clone:function(){var a=l.clone.call(this);return a._hash=this._hash.clone(),a}});i.RIPEMD160=l._createHelper(t),i.HmacRIPEMD160=l._createHmacHelper(t)}(Math),a.RIPEMD160})},{"./core":144}],168:[function(a,b,c){!function(d,e){"object"==typeof c?b.exports=c=e(a("./core")):"function"==typeof define&&define.amd?define(["./core"],e):e(d.CryptoJS)}(this,function(a){return function(){var b=a,c=b.lib,d=c.WordArray,e=c.Hasher,f=b.algo,g=[],h=f.SHA1=e.extend({_doReset:function(){this._hash=new d.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(a,b){for(var c=this._hash.words,d=c[0],e=c[1],f=c[2],h=c[3],i=c[4],j=0;j<80;j++){if(j<16)g[j]=0|a[b+j];else{var k=g[j-3]^g[j-8]^g[j-14]^g[j-16];g[j]=k<<1|k>>>31}var l=(d<<5|d>>>27)+i+g[j];l+=j<20?(e&f|~e&h)+1518500249:j<40?(e^f^h)+1859775393:j<60?(e&f|e&h|f&h)-1894007588:(e^f^h)-899497514,i=h,h=f,f=e<<30|e>>>2,e=d,d=l}c[0]=c[0]+d|0,c[1]=c[1]+e|0,c[2]=c[2]+f|0,c[3]=c[3]+h|0,c[4]=c[4]+i|0},_doFinalize:function(){var a=this._data,b=a.words,c=8*this._nDataBytes,d=8*a.sigBytes;return b[d>>>5]|=128<<24-d%32,b[(d+64>>>9<<4)+14]=Math.floor(c/4294967296),b[(d+64>>>9<<4)+15]=c,a.sigBytes=4*b.length,this._process(),this._hash},clone:function(){var a=e.clone.call(this);return a._hash=this._hash.clone(),a}});b.SHA1=e._createHelper(h),b.HmacSHA1=e._createHmacHelper(h)}(),a.SHA1})},{"./core":144}],169:[function(a,b,c){!function(d,e,f){"object"==typeof c?b.exports=c=e(a("./core"),a("./sha256")):"function"==typeof define&&define.amd?define(["./core","./sha256"],e):e(d.CryptoJS)}(this,function(a){return function(){var b=a,c=b.lib,d=c.WordArray,e=b.algo,f=e.SHA256,g=e.SHA224=f.extend({_doReset:function(){this._hash=new d.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var a=f._doFinalize.call(this);return a.sigBytes-=4,a}});b.SHA224=f._createHelper(g),b.HmacSHA224=f._createHmacHelper(g)}(),a.SHA224})},{"./core":144,"./sha256":170}],170:[function(a,b,c){!function(d,e){"object"==typeof c?b.exports=c=e(a("./core")):"function"==typeof define&&define.amd?define(["./core"],e):e(d.CryptoJS)}(this,function(a){return function(b){var c=a,d=c.lib,e=d.WordArray,f=d.Hasher,g=c.algo,h=[],i=[];!function(){function a(a){for(var c=b.sqrt(a),d=2;d<=c;d++)if(!(a%d))return!1;return!0}function c(a){return 4294967296*(a-(0|a))|0}for(var d=2,e=0;e<64;)a(d)&&(e<8&&(h[e]=c(b.pow(d,.5))),i[e]=c(b.pow(d,1/3)),e++),d++}();var j=[],k=g.SHA256=f.extend({_doReset:function(){this._hash=new e.init(h.slice(0))},_doProcessBlock:function(a,b){for(var c=this._hash.words,d=c[0],e=c[1],f=c[2],g=c[3],h=c[4],k=c[5],l=c[6],m=c[7],n=0;n<64;n++){if(n<16)j[n]=0|a[b+n];else{var o=j[n-15],p=(o<<25|o>>>7)^(o<<14|o>>>18)^o>>>3,q=j[n-2],r=(q<<15|q>>>17)^(q<<13|q>>>19)^q>>>10;j[n]=p+j[n-7]+r+j[n-16]}var s=h&k^~h&l,t=d&e^d&f^e&f,u=(d<<30|d>>>2)^(d<<19|d>>>13)^(d<<10|d>>>22),v=(h<<26|h>>>6)^(h<<21|h>>>11)^(h<<7|h>>>25),w=m+v+s+i[n]+j[n],x=u+t;m=l,l=k,k=h,h=g+w|0,g=f,f=e,e=d,d=w+x|0}c[0]=c[0]+d|0,c[1]=c[1]+e|0,c[2]=c[2]+f|0,c[3]=c[3]+g|0,c[4]=c[4]+h|0,c[5]=c[5]+k|0,c[6]=c[6]+l|0,c[7]=c[7]+m|0},_doFinalize:function(){var a=this._data,c=a.words,d=8*this._nDataBytes,e=8*a.sigBytes;return c[e>>>5]|=128<<24-e%32,c[(e+64>>>9<<4)+14]=b.floor(d/4294967296),c[(e+64>>>9<<4)+15]=d,a.sigBytes=4*c.length,this._process(),this._hash},clone:function(){var a=f.clone.call(this);return a._hash=this._hash.clone(),a}});c.SHA256=f._createHelper(k),c.HmacSHA256=f._createHmacHelper(k)}(Math),a.SHA256})},{"./core":144}],171:[function(a,b,c){!function(d,e,f){"object"==typeof c?b.exports=c=e(a("./core"),a("./x64-core")):"function"==typeof define&&define.amd?define(["./core","./x64-core"],e):e(d.CryptoJS)}(this,function(a){return function(b){var c=a,d=c.lib,e=d.WordArray,f=d.Hasher,g=c.x64,h=g.Word,i=c.algo,j=[],k=[],l=[];!function(){for(var a=1,b=0,c=0;c<24;c++){j[a+5*b]=(c+1)*(c+2)/2%64;var d=b%5,e=(2*a+3*b)%5;a=d,b=e}for(var a=0;a<5;a++)for(var b=0;b<5;b++)k[a+5*b]=b+(2*a+3*b)%5*5;for(var f=1,g=0;g<24;g++){for(var i=0,m=0,n=0;n<7;n++){if(1&f){var o=(1<<n)-1;o<32?m^=1<<o:i^=1<<o-32}128&f?f=f<<1^113:f<<=1}l[g]=h.create(i,m)}}();var m=[];!function(){for(var a=0;a<25;a++)m[a]=h.create()}();var n=i.SHA3=f.extend({cfg:f.cfg.extend({outputLength:512}),_doReset:function(){for(var a=this._state=[],b=0;b<25;b++)a[b]=new h.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(a,b){for(var c=this._state,d=this.blockSize/2,e=0;e<d;e++){var f=a[b+2*e],g=a[b+2*e+1];f=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8),g=16711935&(g<<8|g>>>24)|4278255360&(g<<24|g>>>8);var h=c[e];h.high^=g,h.low^=f}for(var i=0;i<24;i++){for(var n=0;n<5;n++){for(var o=0,p=0,q=0;q<5;q++){var h=c[n+5*q];o^=h.high,p^=h.low}var r=m[n];r.high=o,r.low=p}for(var n=0;n<5;n++)for(var s=m[(n+4)%5],t=m[(n+1)%5],u=t.high,v=t.low,o=s.high^(u<<1|v>>>31),p=s.low^(v<<1|u>>>31),q=0;q<5;q++){var h=c[n+5*q];h.high^=o,h.low^=p}for(var w=1;w<25;w++){var h=c[w],x=h.high,y=h.low,z=j[w];if(z<32)var o=x<<z|y>>>32-z,p=y<<z|x>>>32-z;else var o=y<<z-32|x>>>64-z,p=x<<z-32|y>>>64-z;var A=m[k[w]];A.high=o,A.low=p}var B=m[0],C=c[0];B.high=C.high,B.low=C.low;for(var n=0;n<5;n++)for(var q=0;q<5;q++){var w=n+5*q,h=c[w],D=m[w],E=m[(n+1)%5+5*q],F=m[(n+2)%5+5*q];h.high=D.high^~E.high&F.high,h.low=D.low^~E.low&F.low}var h=c[0],G=l[i];h.high^=G.high,h.low^=G.low}},_doFinalize:function(){var a=this._data,c=a.words,d=(8*this._nDataBytes,8*a.sigBytes),f=32*this.blockSize;c[d>>>5]|=1<<24-d%32,c[(b.ceil((d+1)/f)*f>>>5)-1]|=128,a.sigBytes=4*c.length,this._process();for(var g=this._state,h=this.cfg.outputLength/8,i=h/8,j=[],k=0;k<i;k++){var l=g[k],m=l.high,n=l.low;m=16711935&(m<<8|m>>>24)|4278255360&(m<<24|m>>>8),n=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8),j.push(n),j.push(m)}return new e.init(j,h)},clone:function(){for(var a=f.clone.call(this),b=a._state=this._state.slice(0),c=0;c<25;c++)b[c]=b[c].clone();return a}});c.SHA3=f._createHelper(n),c.HmacSHA3=f._createHmacHelper(n)}(Math),a.SHA3})},{"./core":144,"./x64-core":175}],172:[function(a,b,c){!function(d,e,f){"object"==typeof c?b.exports=c=e(a("./core"),a("./x64-core"),a("./sha512")):"function"==typeof define&&define.amd?define(["./core","./x64-core","./sha512"],e):e(d.CryptoJS)}(this,function(a){return function(){var b=a,c=b.x64,d=c.Word,e=c.WordArray,f=b.algo,g=f.SHA512,h=f.SHA384=g.extend({_doReset:function(){this._hash=new e.init([new d.init(3418070365,3238371032),new d.init(1654270250,914150663),new d.init(2438529370,812702999),new d.init(355462360,4144912697),new d.init(1731405415,4290775857),new d.init(2394180231,1750603025),new d.init(3675008525,1694076839),new d.init(1203062813,3204075428)])},_doFinalize:function(){var a=g._doFinalize.call(this);return a.sigBytes-=16,a}});b.SHA384=g._createHelper(h),b.HmacSHA384=g._createHmacHelper(h)}(),a.SHA384})},{"./core":144,"./sha512":173,"./x64-core":175}],173:[function(a,b,c){!function(d,e,f){"object"==typeof c?b.exports=c=e(a("./core"),a("./x64-core")):"function"==typeof define&&define.amd?define(["./core","./x64-core"],e):e(d.CryptoJS)}(this,function(a){return function(){function b(){return g.create.apply(g,arguments)}var c=a,d=c.lib,e=d.Hasher,f=c.x64,g=f.Word,h=f.WordArray,i=c.algo,j=[b(1116352408,3609767458),b(1899447441,602891725),b(3049323471,3964484399),b(3921009573,2173295548),b(961987163,4081628472),b(1508970993,3053834265),b(2453635748,2937671579),b(2870763221,3664609560),b(3624381080,2734883394),b(310598401,1164996542),b(607225278,1323610764),b(1426881987,3590304994),b(1925078388,4068182383),b(2162078206,991336113),b(2614888103,633803317),b(3248222580,3479774868),b(3835390401,2666613458),b(4022224774,944711139),b(264347078,2341262773),b(604807628,2007800933),b(770255983,1495990901),b(1249150122,1856431235),b(1555081692,3175218132),b(1996064986,2198950837),b(2554220882,3999719339),b(2821834349,766784016),b(2952996808,2566594879),b(3210313671,3203337956),b(3336571891,1034457026),b(3584528711,2466948901),b(113926993,3758326383),b(338241895,168717936),b(666307205,1188179964),b(773529912,1546045734),b(1294757372,1522805485),b(1396182291,2643833823),b(1695183700,2343527390),b(1986661051,1014477480),b(2177026350,1206759142),b(2456956037,344077627),b(2730485921,1290863460),b(2820302411,3158454273),b(3259730800,3505952657),b(3345764771,106217008),b(3516065817,3606008344),b(3600352804,1432725776),b(4094571909,1467031594),b(275423344,851169720),b(430227734,3100823752),b(506948616,1363258195),b(659060556,3750685593),b(883997877,3785050280),b(958139571,3318307427),b(1322822218,3812723403),b(1537002063,2003034995),b(1747873779,3602036899),b(1955562222,1575990012),b(2024104815,1125592928),b(2227730452,2716904306),b(2361852424,442776044),b(2428436474,593698344),b(2756734187,3733110249),b(3204031479,2999351573),b(3329325298,3815920427),b(3391569614,3928383900),b(3515267271,566280711),b(3940187606,3454069534),b(4118630271,4000239992),b(116418474,1914138554),b(174292421,2731055270),b(289380356,3203993006),b(460393269,320620315),b(685471733,587496836),b(852142971,1086792851),b(1017036298,365543100),b(1126000580,2618297676),b(1288033470,3409855158),b(1501505948,4234509866),b(1607167915,987167468),b(1816402316,1246189591)],k=[];!function(){for(var a=0;a<80;a++)k[a]=b()}();var l=i.SHA512=e.extend({_doReset:function(){this._hash=new h.init([new g.init(1779033703,4089235720),new g.init(3144134277,2227873595),new g.init(1013904242,4271175723),new g.init(2773480762,1595750129),new g.init(1359893119,2917565137),new g.init(2600822924,725511199),new g.init(528734635,4215389547),new g.init(1541459225,327033209)])},_doProcessBlock:function(a,b){for(var c=this._hash.words,d=c[0],e=c[1],f=c[2],g=c[3],h=c[4],i=c[5],l=c[6],m=c[7],n=d.high,o=d.low,p=e.high,q=e.low,r=f.high,s=f.low,t=g.high,u=g.low,v=h.high,w=h.low,x=i.high,y=i.low,z=l.high,A=l.low,B=m.high,C=m.low,D=n,E=o,F=p,G=q,H=r,I=s,J=t,K=u,L=v,M=w,N=x,O=y,P=z,Q=A,R=B,S=C,T=0;T<80;T++){var U=k[T];if(T<16)var V=U.high=0|a[b+2*T],W=U.low=0|a[b+2*T+1];else{var X=k[T-15],Y=X.high,Z=X.low,$=(Y>>>1|Z<<31)^(Y>>>8|Z<<24)^Y>>>7,_=(Z>>>1|Y<<31)^(Z>>>8|Y<<24)^(Z>>>7|Y<<25),aa=k[T-2],ba=aa.high,ca=aa.low,da=(ba>>>19|ca<<13)^(ba<<3|ca>>>29)^ba>>>6,ea=(ca>>>19|ba<<13)^(ca<<3|ba>>>29)^(ca>>>6|ba<<26),fa=k[T-7],ga=fa.high,ha=fa.low,ia=k[T-16],ja=ia.high,ka=ia.low,W=_+ha,V=$+ga+(W>>>0<_>>>0?1:0),W=W+ea,V=V+da+(W>>>0<ea>>>0?1:0),W=W+ka,V=V+ja+(W>>>0<ka>>>0?1:0);U.high=V,U.low=W}var la=L&N^~L&P,ma=M&O^~M&Q,na=D&F^D&H^F&H,oa=E&G^E&I^G&I,pa=(D>>>28|E<<4)^(D<<30|E>>>2)^(D<<25|E>>>7),qa=(E>>>28|D<<4)^(E<<30|D>>>2)^(E<<25|D>>>7),ra=(L>>>14|M<<18)^(L>>>18|M<<14)^(L<<23|M>>>9),sa=(M>>>14|L<<18)^(M>>>18|L<<14)^(M<<23|L>>>9),ta=j[T],ua=ta.high,va=ta.low,wa=S+sa,xa=R+ra+(wa>>>0<S>>>0?1:0),wa=wa+ma,xa=xa+la+(wa>>>0<ma>>>0?1:0),wa=wa+va,xa=xa+ua+(wa>>>0<va>>>0?1:0),wa=wa+W,xa=xa+V+(wa>>>0<W>>>0?1:0),ya=qa+oa,za=pa+na+(ya>>>0<qa>>>0?1:0);R=P,S=Q,P=N,Q=O,N=L,O=M,M=K+wa|0,L=J+xa+(M>>>0<K>>>0?1:0)|0,J=H,K=I,H=F,I=G,F=D,G=E,E=wa+ya|0,D=xa+za+(E>>>0<wa>>>0?1:0)|0}o=d.low=o+E,d.high=n+D+(o>>>0<E>>>0?1:0),q=e.low=q+G,e.high=p+F+(q>>>0<G>>>0?1:0),s=f.low=s+I,f.high=r+H+(s>>>0<I>>>0?1:0),u=g.low=u+K,g.high=t+J+(u>>>0<K>>>0?1:0),w=h.low=w+M,h.high=v+L+(w>>>0<M>>>0?1:0),y=i.low=y+O,i.high=x+N+(y>>>0<O>>>0?1:0),A=l.low=A+Q,l.high=z+P+(A>>>0<Q>>>0?1:0),C=m.low=C+S,m.high=B+R+(C>>>0<S>>>0?1:0)},_doFinalize:function(){var a=this._data,b=a.words,c=8*this._nDataBytes,d=8*a.sigBytes;b[d>>>5]|=128<<24-d%32,b[(d+128>>>10<<5)+30]=Math.floor(c/4294967296),b[(d+128>>>10<<5)+31]=c,a.sigBytes=4*b.length,this._process();var e=this._hash.toX32();return e},clone:function(){var a=e.clone.call(this);return a._hash=this._hash.clone(),a},blockSize:32});c.SHA512=e._createHelper(l),c.HmacSHA512=e._createHmacHelper(l)}(),a.SHA512})},{"./core":144,"./x64-core":175}],174:[function(a,b,c){!function(d,e,f){"object"==typeof c?b.exports=c=e(a("./core"),a("./enc-base64"),a("./md5"),a("./evpkdf"),a("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(d.CryptoJS)}(this,function(a){return function(){function b(a,b){var c=(this._lBlock>>>a^this._rBlock)&b;this._rBlock^=c,this._lBlock^=c<<a}function c(a,b){var c=(this._rBlock>>>a^this._lBlock)&b;this._lBlock^=c,this._rBlock^=c<<a}var d=a,e=d.lib,f=e.WordArray,g=e.BlockCipher,h=d.algo,i=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],j=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],k=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],l=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],m=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],n=h.DES=g.extend({_doReset:function(){for(var a=this._key,b=a.words,c=[],d=0;d<56;d++){var e=i[d]-1;c[d]=b[e>>>5]>>>31-e%32&1}for(var f=this._subKeys=[],g=0;g<16;g++){for(var h=f[g]=[],l=k[g],d=0;d<24;d++)h[d/6|0]|=c[(j[d]-1+l)%28]<<31-d%6,h[4+(d/6|0)]|=c[28+(j[d+24]-1+l)%28]<<31-d%6;h[0]=h[0]<<1|h[0]>>>31;for(var d=1;d<7;d++)h[d]=h[d]>>>4*(d-1)+3;h[7]=h[7]<<5|h[7]>>>27}for(var m=this._invSubKeys=[],d=0;d<16;d++)m[d]=f[15-d]},encryptBlock:function(a,b){this._doCryptBlock(a,b,this._subKeys)},decryptBlock:function(a,b){this._doCryptBlock(a,b,this._invSubKeys)},_doCryptBlock:function(a,d,e){this._lBlock=a[d],this._rBlock=a[d+1],b.call(this,4,252645135),b.call(this,16,65535),c.call(this,2,858993459),c.call(this,8,16711935),b.call(this,1,1431655765);for(var f=0;f<16;f++){for(var g=e[f],h=this._lBlock,i=this._rBlock,j=0,k=0;k<8;k++)j|=l[k][((i^g[k])&m[k])>>>0];this._lBlock=i,this._rBlock=h^j}var n=this._lBlock;this._lBlock=this._rBlock,this._rBlock=n,b.call(this,1,1431655765),c.call(this,8,16711935),c.call(this,2,858993459),b.call(this,16,65535),b.call(this,4,252645135),a[d]=this._lBlock,a[d+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});d.DES=g._createHelper(n);var o=h.TripleDES=g.extend({_doReset:function(){var a=this._key,b=a.words;this._des1=n.createEncryptor(f.create(b.slice(0,2))),this._des2=n.createEncryptor(f.create(b.slice(2,4))),this._des3=n.createEncryptor(f.create(b.slice(4,6)))},encryptBlock:function(a,b){this._des1.encryptBlock(a,b),this._des2.decryptBlock(a,b),this._des3.encryptBlock(a,b)},decryptBlock:function(a,b){this._des3.decryptBlock(a,b),this._des2.encryptBlock(a,b),this._des1.decryptBlock(a,b)},keySize:6,ivSize:2,blockSize:2});d.TripleDES=g._createHelper(o)}(),a.TripleDES})},{"./cipher-core":143,"./core":144,"./enc-base64":145,"./evpkdf":147,"./md5":152}],175:[function(a,b,c){!function(d,e){"object"==typeof c?b.exports=c=e(a("./core")):"function"==typeof define&&define.amd?define(["./core"],e):e(d.CryptoJS)}(this,function(a){return function(b){var c=a,d=c.lib,e=d.Base,f=d.WordArray,g=c.x64={};g.Word=e.extend({init:function(a,b){this.high=a,this.low=b}}),g.WordArray=e.extend({init:function(a,c){a=this.words=a||[],c!=b?this.sigBytes=c:this.sigBytes=8*a.length},toX32:function(){for(var a=this.words,b=a.length,c=[],d=0;d<b;d++){var e=a[d];c.push(e.high),c.push(e.low)}return f.create(c,this.sigBytes)},clone:function(){for(var a=e.clone.call(this),b=a.words=this.words.slice(0),c=b.length,d=0;d<c;d++)b[d]=b[d].clone();return a}})}(),a})},{"./core":144}],176:[function(a,b,c){function d(a){return d.enabled(a)?function(b){b=e(b);var c=new Date,f=c-(d[a]||c);d[a]=c,b=a+" "+b+" +"+d.humanize(f),window.console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}:function(){}}function e(a){return a instanceof Error?a.stack||a.message:a}b.exports=d,d.names=[],d.skips=[],d.enable=function(a){try{localStorage.debug=a}catch(a){}for(var b=(a||"").split(/[\s,]+/),c=b.length,e=0;e<c;e++)a=b[e].replace("*",".*?"),"-"===a[0]?d.skips.push(new RegExp("^"+a.substr(1)+"$")):d.names.push(new RegExp("^"+a+"$"))},d.disable=function(){d.enable("")},d.humanize=function(a){var b=1e3,c=6e4,d=60*c;return a>=d?(a/d).toFixed(1)+"h":a>=c?(a/c).toFixed(1)+"m":a>=b?(a/b|0)+"s":a+"ms"},d.enabled=function(a){for(var b=0,c=d.skips.length;b<c;b++)if(d.skips[b].test(a))return!1;for(var b=0,c=d.names.length;b<c;b++)if(d.names[b].test(a))return!0;return!1};try{window.localStorage&&d.enable(localStorage.debug)}catch(a){}},{}],177:[function(a,b,c){"use strict";c.utils=a("./des/utils"),c.Cipher=a("./des/cipher"),c.DES=a("./des/des"),c.CBC=a("./des/cbc"),c.EDE=a("./des/ede")},{"./des/cbc":178,"./des/cipher":179,"./des/des":180,"./des/ede":181,"./des/utils":182}],178:[function(a,b,c){"use strict";function d(a){f.equal(a.length,8,"Invalid IV length"),this.iv=new Array(8);for(var b=0;b<this.iv.length;b++)this.iv[b]=a[b]}function e(a){function b(b){a.call(this,b),this._cbcInit()}g(b,a);for(var c=Object.keys(h),d=0;d<c.length;d++){var e=c[d];b.prototype[e]=h[e]}return b.create=function(a){return new b(a)},b}var f=a("minimalistic-assert"),g=a("inherits"),h={};c.instantiate=e,h._cbcInit=function(){var a=new d(this.options.iv);this._cbcState=a},h._update=function(a,b,c,d){var e=this._cbcState,f=this.constructor.super_.prototype,g=e.iv;if("encrypt"===this.type){for(var h=0;h<this.blockSize;h++)g[h]^=a[b+h];f._update.call(this,g,0,c,d);for(var h=0;h<this.blockSize;h++)g[h]=c[d+h]}else{f._update.call(this,a,b,c,d);for(var h=0;h<this.blockSize;h++)c[d+h]^=g[h];for(var h=0;h<this.blockSize;h++)g[h]=a[b+h]}}},{inherits:226,"minimalistic-assert":234}],179:[function(a,b,c){"use strict";function d(a){this.options=a,this.type=this.options.type,this.blockSize=8,this._init(),this.buffer=new Array(this.blockSize),this.bufferOff=0}var e=a("minimalistic-assert");b.exports=d,d.prototype._init=function(){},d.prototype.update=function(a){return 0===a.length?[]:"decrypt"===this.type?this._updateDecrypt(a):this._updateEncrypt(a)},d.prototype._buffer=function(a,b){for(var c=Math.min(this.buffer.length-this.bufferOff,a.length-b),d=0;d<c;d++)this.buffer[this.bufferOff+d]=a[b+d];return this.bufferOff+=c,c},d.prototype._flushBuffer=function(a,b){return this._update(this.buffer,0,a,b),this.bufferOff=0,this.blockSize},d.prototype._updateEncrypt=function(a){var b=0,c=0,d=(this.bufferOff+a.length)/this.blockSize|0,e=new Array(d*this.blockSize);0!==this.bufferOff&&(b+=this._buffer(a,b),this.bufferOff===this.buffer.length&&(c+=this._flushBuffer(e,c)));for(var f=a.length-(a.length-b)%this.blockSize;b<f;b+=this.blockSize)this._update(a,b,e,c),c+=this.blockSize;for(;b<a.length;b++,this.bufferOff++)this.buffer[this.bufferOff]=a[b];return e; |
| 14 |
|
},d.prototype._updateDecrypt=function(a){for(var b=0,c=0,d=Math.ceil((this.bufferOff+a.length)/this.blockSize)-1,e=new Array(d*this.blockSize);d>0;d--)b+=this._buffer(a,b),c+=this._flushBuffer(e,c);return b+=this._buffer(a,b),e},d.prototype.final=function(a){var b;a&&(b=this.update(a));var c;return c="encrypt"===this.type?this._finalEncrypt():this._finalDecrypt(),b?b.concat(c):c},d.prototype._pad=function(a,b){if(0===b)return!1;for(;b<a.length;)a[b++]=0;return!0},d.prototype._finalEncrypt=function(){if(!this._pad(this.buffer,this.bufferOff))return[];var a=new Array(this.blockSize);return this._update(this.buffer,0,a,0),a},d.prototype._unpad=function(a){return a},d.prototype._finalDecrypt=function(){e.equal(this.bufferOff,this.blockSize,"Not enough data to decrypt");var a=new Array(this.blockSize);return this._flushBuffer(a,0),this._unpad(a)}},{"minimalistic-assert":234}],180:[function(a,b,c){"use strict";function d(){this.tmp=new Array(2),this.keys=null}function e(a){j.call(this,a);var b=new d;this._desState=b,this.deriveKeys(b,a.key)}var f=a("minimalistic-assert"),g=a("inherits"),h=a("../des"),i=h.utils,j=h.Cipher;g(e,j),b.exports=e,e.create=function(a){return new e(a)};var k=[1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1];e.prototype.deriveKeys=function(a,b){a.keys=new Array(32),f.equal(b.length,this.blockSize,"Invalid key length");var c=i.readUInt32BE(b,0),d=i.readUInt32BE(b,4);i.pc1(c,d,a.tmp,0),c=a.tmp[0],d=a.tmp[1];for(var e=0;e<a.keys.length;e+=2){var g=k[e>>>1];c=i.r28shl(c,g),d=i.r28shl(d,g),i.pc2(c,d,a.keys,e)}},e.prototype._update=function(a,b,c,d){var e=this._desState,f=i.readUInt32BE(a,b),g=i.readUInt32BE(a,b+4);i.ip(f,g,e.tmp,0),f=e.tmp[0],g=e.tmp[1],"encrypt"===this.type?this._encrypt(e,f,g,e.tmp,0):this._decrypt(e,f,g,e.tmp,0),f=e.tmp[0],g=e.tmp[1],i.writeUInt32BE(c,f,d),i.writeUInt32BE(c,g,d+4)},e.prototype._pad=function(a,b){for(var c=a.length-b,d=b;d<a.length;d++)a[d]=c;return!0},e.prototype._unpad=function(a){for(var b=a[a.length-1],c=a.length-b;c<a.length;c++)f.equal(a[c],b);return a.slice(0,a.length-b)},e.prototype._encrypt=function(a,b,c,d,e){for(var f=b,g=c,h=0;h<a.keys.length;h+=2){var j=a.keys[h],k=a.keys[h+1];i.expand(g,a.tmp,0),j^=a.tmp[0],k^=a.tmp[1];var l=i.substitute(j,k),m=i.permute(l),n=g;g=(f^m)>>>0,f=n}i.rip(g,f,d,e)},e.prototype._decrypt=function(a,b,c,d,e){for(var f=c,g=b,h=a.keys.length-2;h>=0;h-=2){var j=a.keys[h],k=a.keys[h+1];i.expand(f,a.tmp,0),j^=a.tmp[0],k^=a.tmp[1];var l=i.substitute(j,k),m=i.permute(l),n=f;f=(g^m)>>>0,g=n}i.rip(f,g,d,e)}},{"../des":177,inherits:226,"minimalistic-assert":234}],181:[function(a,b,c){"use strict";function d(a,b){f.equal(b.length,24,"Invalid key length");var c=b.slice(0,8),d=b.slice(8,16),e=b.slice(16,24);"encrypt"===a?this.ciphers=[j.create({type:"encrypt",key:c}),j.create({type:"decrypt",key:d}),j.create({type:"encrypt",key:e})]:this.ciphers=[j.create({type:"decrypt",key:e}),j.create({type:"encrypt",key:d}),j.create({type:"decrypt",key:c})]}function e(a){i.call(this,a);var b=new d(this.type,this.options.key);this._edeState=b}var f=a("minimalistic-assert"),g=a("inherits"),h=a("../des"),i=h.Cipher,j=h.DES;g(e,i),b.exports=e,e.create=function(a){return new e(a)},e.prototype._update=function(a,b,c,d){var e=this._edeState;e.ciphers[0]._update(a,b,c,d),e.ciphers[1]._update(c,d,c,d),e.ciphers[2]._update(c,d,c,d)},e.prototype._pad=j.prototype._pad,e.prototype._unpad=j.prototype._unpad},{"../des":177,inherits:226,"minimalistic-assert":234}],182:[function(a,b,c){"use strict";c.readUInt32BE=function(a,b){var c=a[0+b]<<24|a[1+b]<<16|a[2+b]<<8|a[3+b];return c>>>0},c.writeUInt32BE=function(a,b,c){a[0+c]=b>>>24,a[1+c]=b>>>16&255,a[2+c]=b>>>8&255,a[3+c]=255&b},c.ip=function(a,b,c,d){for(var e=0,f=0,g=6;g>=0;g-=2){for(var h=0;h<=24;h+=8)e<<=1,e|=b>>>h+g&1;for(var h=0;h<=24;h+=8)e<<=1,e|=a>>>h+g&1}for(var g=6;g>=0;g-=2){for(var h=1;h<=25;h+=8)f<<=1,f|=b>>>h+g&1;for(var h=1;h<=25;h+=8)f<<=1,f|=a>>>h+g&1}c[d+0]=e>>>0,c[d+1]=f>>>0},c.rip=function(a,b,c,d){for(var e=0,f=0,g=0;g<4;g++)for(var h=24;h>=0;h-=8)e<<=1,e|=b>>>h+g&1,e<<=1,e|=a>>>h+g&1;for(var g=4;g<8;g++)for(var h=24;h>=0;h-=8)f<<=1,f|=b>>>h+g&1,f<<=1,f|=a>>>h+g&1;c[d+0]=e>>>0,c[d+1]=f>>>0},c.pc1=function(a,b,c,d){for(var e=0,f=0,g=7;g>=5;g--){for(var h=0;h<=24;h+=8)e<<=1,e|=b>>h+g&1;for(var h=0;h<=24;h+=8)e<<=1,e|=a>>h+g&1}for(var h=0;h<=24;h+=8)e<<=1,e|=b>>h+g&1;for(var g=1;g<=3;g++){for(var h=0;h<=24;h+=8)f<<=1,f|=b>>h+g&1;for(var h=0;h<=24;h+=8)f<<=1,f|=a>>h+g&1}for(var h=0;h<=24;h+=8)f<<=1,f|=a>>h+g&1;c[d+0]=e>>>0,c[d+1]=f>>>0},c.r28shl=function(a,b){return a<<b&268435455|a>>>28-b};var d=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];c.pc2=function(a,b,c,e){for(var f=0,g=0,h=d.length>>>1,i=0;i<h;i++)f<<=1,f|=a>>>d[i]&1;for(var i=h;i<d.length;i++)g<<=1,g|=b>>>d[i]&1;c[e+0]=f>>>0,c[e+1]=g>>>0},c.expand=function(a,b,c){var d=0,e=0;d=(1&a)<<5|a>>>27;for(var f=23;f>=15;f-=4)d<<=6,d|=a>>>f&63;for(var f=11;f>=3;f-=4)e|=a>>>f&63,e<<=6;e|=(31&a)<<1|a>>>31,b[c+0]=d>>>0,b[c+1]=e>>>0};var e=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];c.substitute=function(a,b){for(var c=0,d=0;d<4;d++){var f=a>>>18-6*d&63,g=e[64*d+f];c<<=4,c|=g}for(var d=0;d<4;d++){var f=b>>>18-6*d&63,g=e[256+64*d+f];c<<=4,c|=g}return c>>>0};var f=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];c.permute=function(a){for(var b=0,c=0;c<f.length;c++)b<<=1,b|=a>>>f[c]&1;return b>>>0},c.padSplit=function(a,b,c){for(var d=a.toString(2);d.length<b;)d="0"+d;for(var e=[],f=0;f<b;f+=c)e.push(d.slice(f,f+c));return e.join(" ")}},{}],183:[function(a,b,c){(function(Buffer){function b(a){var b=new Buffer(f[a].prime,"hex"),c=new Buffer(f[a].gen,"hex");return new g(b,c)}function d(a,b,c,f){return Buffer.isBuffer(b)||void 0===h[b]?d(a,"binary",b,c):(b=b||"binary",f=f||"binary",c=c||new Buffer([2]),Buffer.isBuffer(c)||(c=new Buffer(c,f)),"number"==typeof a?new g(e(a,c),c,!0):(Buffer.isBuffer(a)||(a=new Buffer(a,b)),new g(a,c,!0)))}var e=a("./lib/generatePrime"),f=a("./lib/primes.json"),g=a("./lib/dh"),h={binary:!0,hex:!0,base64:!0};c.DiffieHellmanGroup=c.createDiffieHellmanGroup=c.getDiffieHellman=b,c.createDiffieHellman=c.DiffieHellman=d}).call(this,a("buffer").Buffer)},{"./lib/dh":184,"./lib/generatePrime":185,"./lib/primes.json":186,buffer:104}],184:[function(a,b,c){(function(Buffer){function c(a,b){return b=b||"utf8",Buffer.isBuffer(a)||(a=new Buffer(a,b)),this._pub=new h(a),this}function d(a,b){return b=b||"utf8",Buffer.isBuffer(a)||(a=new Buffer(a,b)),this._priv=new h(a),this}function e(a,b){var c=b.toString("hex"),d=[c,a.toString(16)].join("_");if(d in r)return r[d];var e=0;if(a.isEven()||!p.simpleSieve||!p.fermatTest(a)||!j.test(a))return e+=1,e+="02"===c||"05"===c?8:4,r[d]=e,e;j.test(a.shrn(1))||(e+=2);var f;switch(c){case"02":a.mod(k).cmp(l)&&(e+=8);break;case"05":f=a.mod(m),f.cmp(n)&&f.cmp(o)&&(e+=8);break;default:e+=4}return r[d]=e,e}function f(a,b,e){this.setGenerator(b),this.__prime=new h(a),this._prime=h.mont(this.__prime),this._primeLen=a.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,e?(this.setPublicKey=c,this.setPrivateKey=d):this._primeCode=8}function g(a,b){var c=new Buffer(a.toArray());return b?c.toString(b):c}var h=a("bn.js"),i=a("miller-rabin"),j=new i,k=new h(24),l=new h(11),m=new h(10),n=new h(3),o=new h(7),p=a("./generatePrime"),q=a("randombytes");b.exports=f;var r={};Object.defineProperty(f.prototype,"verifyError",{enumerable:!0,get:function(){return"number"!=typeof this._primeCode&&(this._primeCode=e(this.__prime,this.__gen)),this._primeCode}}),f.prototype.generateKeys=function(){return this._priv||(this._priv=new h(q(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},f.prototype.computeSecret=function(a){a=new h(a),a=a.toRed(this._prime);var b=a.redPow(this._priv).fromRed(),c=new Buffer(b.toArray()),d=this.getPrime();if(c.length<d.length){var e=new Buffer(d.length-c.length);e.fill(0),c=Buffer.concat([e,c])}return c},f.prototype.getPublicKey=function(a){return g(this._pub,a)},f.prototype.getPrivateKey=function(a){return g(this._priv,a)},f.prototype.getPrime=function(a){return g(this.__prime,a)},f.prototype.getGenerator=function(a){return g(this._gen,a)},f.prototype.setGenerator=function(a,b){return b=b||"utf8",Buffer.isBuffer(a)||(a=new Buffer(a,b)),this.__gen=a,this._gen=new h(a),this}}).call(this,a("buffer").Buffer)},{"./generatePrime":185,"bn.js":75,buffer:104,"miller-rabin":233,randombytes:271}],185:[function(a,b,c){function d(){if(null!==t)return t;var a=1048576,b=[];b[0]=2;for(var c=1,d=3;d<a;d+=2){for(var e=Math.ceil(Math.sqrt(d)),f=0;f<c&&b[f]<=e&&d%b[f]!==0;f++);c!==f&&b[f]<=e||(b[c++]=d)}return t=b,b}function e(a){for(var b=d(),c=0;c<b.length;c++)if(0===a.modn(b[c]))return 0===a.cmpn(b[c]);return!0}function f(a){var b=i.mont(a);return 0===n.toRed(b).redPow(a.subn(1)).fromRed().cmpn(1)}function g(a,b){if(a<16)return new i(2===b||5===b?[140,123]:[140,39]);b=new i(b);for(var c,d;;){for(c=new i(h(Math.ceil(a/8)));c.bitLength()>a;)c.ishrn(1);if(c.isEven()&&c.iadd(m),c.testn(1)||c.iadd(n),b.cmp(n)){if(!b.cmp(o))for(;c.mod(p).cmp(q);)c.iadd(s)}else for(;c.mod(j).cmp(r);)c.iadd(s);if(d=c.shrn(1),e(d)&&e(c)&&f(d)&&f(c)&&l.test(d)&&l.test(c))return c}}var h=a("randombytes");b.exports=g,g.simpleSieve=e,g.fermatTest=f;var i=a("bn.js"),j=new i(24),k=a("miller-rabin"),l=new k,m=new i(1),n=new i(2),o=new i(5),p=(new i(16),new i(8),new i(10)),q=new i(3),r=(new i(7),new i(11)),s=new i(4),t=(new i(12),null)},{"bn.js":75,"miller-rabin":233,randombytes:271}],186:[function(a,b,c){b.exports={modp1:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},modp2:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},modp5:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},modp14:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},modp15:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},modp16:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},modp17:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},modp18:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}}},{}],187:[function(a,b,c){function d(a,b,c,d,e,f,g){this.p=a,this.a=b,this.b=c,this.G=Point.fromAffine(this,d,e),this.n=f,this.h=g,this.infinity=new Point(this,null,null,BigInteger.ZERO),this.pOverFour=a.add(BigInteger.ONE).shiftRight(2),this.pLength=Math.floor((this.p.bitLength()+7)/8)}var e=a("assert"),BigInteger=a("bigi"),Point=a("./point");d.prototype.pointFromX=function(a,b){var c=b.pow(3).add(this.a.multiply(b)).add(this.b).mod(this.p),d=c.modPow(this.pOverFour,this.p),e=d;return d.isEven()^!a&&(e=this.p.subtract(e)),Point.fromAffine(this,b,e)},d.prototype.isInfinity=function(a){return a===this.infinity||0===a.z.signum()&&0!==a.y.signum()},d.prototype.isOnCurve=function(a){if(this.isInfinity(a))return!0;var b=a.affineX,c=a.affineY,d=this.a,e=this.b,f=this.p;if(b.signum()<0||b.compareTo(f)>=0)return!1;if(c.signum()<0||c.compareTo(f)>=0)return!1;var g=c.square().mod(f),h=b.pow(3).add(d.multiply(b)).add(e).mod(f);return g.equals(h)},d.prototype.validate=function(a){e(!this.isInfinity(a),"Point is at infinity"),e(this.isOnCurve(a),"Point is not on the curve");var b=a.multiply(this.n);return e(this.isInfinity(b),"Point is not a scalar multiple of G"),!0},b.exports=d},{"./point":191,assert:19,bigi:25}],188:[function(a,b,c){b.exports={secp128r1:{p:"fffffffdffffffffffffffffffffffff",a:"fffffffdfffffffffffffffffffffffc",b:"e87579c11079f43dd824993c2cee5ed3",n:"fffffffe0000000075a30d1b9038a115",h:"01",Gx:"161ff7528b899b2d0c28607ca52c5b86",Gy:"cf5ac8395bafeb13c02da292dded7a83"},secp160k1:{p:"fffffffffffffffffffffffffffffffeffffac73",a:"00",b:"07",n:"0100000000000000000001b8fa16dfab9aca16b6b3",h:"01",Gx:"3b4c382ce37aa192a4019e763036f4f5dd4d7ebb",Gy:"938cf935318fdced6bc28286531733c3f03c4fee"},secp160r1:{p:"ffffffffffffffffffffffffffffffff7fffffff",a:"ffffffffffffffffffffffffffffffff7ffffffc",b:"1c97befc54bd7a8b65acf89f81d4d4adc565fa45",n:"0100000000000000000001f4c8f927aed3ca752257",h:"01",Gx:"4a96b5688ef573284664698968c38bb913cbfc82",Gy:"23a628553168947d59dcc912042351377ac5fb32"},secp192k1:{p:"fffffffffffffffffffffffffffffffffffffffeffffee37",a:"00",b:"03",n:"fffffffffffffffffffffffe26f2fc170f69466a74defd8d",h:"01",Gx:"db4ff10ec057e9ae26b07d0280b7f4341da5d1b1eae06c7d",Gy:"9b2f2f6d9c5628a7844163d015be86344082aa88d95e2f9d"},secp192r1:{p:"fffffffffffffffffffffffffffffffeffffffffffffffff",a:"fffffffffffffffffffffffffffffffefffffffffffffffc",b:"64210519e59c80e70fa7e9ab72243049feb8deecc146b9b1",n:"ffffffffffffffffffffffff99def836146bc9b1b4d22831",h:"01",Gx:"188da80eb03090f67cbf20eb43a18800f4ff0afd82ff1012",Gy:"07192b95ffc8da78631011ed6b24cdd573f977a11e794811"},secp256k1:{p:"fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f",a:"00",b:"07",n:"fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",h:"01",Gx:"79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798",Gy:"483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8"},secp256r1:{p:"ffffffff00000001000000000000000000000000ffffffffffffffffffffffff",a:"ffffffff00000001000000000000000000000000fffffffffffffffffffffffc",b:"5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b",n:"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551",h:"01",Gx:"6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296",Gy:"4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5"}}},{}],189:[function(a,b,c){var Point=a("./point"),d=a("./curve"),e=a("./names");b.exports={Curve:d,Point:Point,getCurveByName:e}},{"./curve":187,"./names":190,"./point":191}],190:[function(a,b,c){function d(a){var b=e[a];if(!b)return null;var c=new BigInteger(b.p,16),d=new BigInteger(b.a,16),g=new BigInteger(b.b,16),h=new BigInteger(b.n,16),i=new BigInteger(b.h,16),j=new BigInteger(b.Gx,16),k=new BigInteger(b.Gy,16);return new f(c,d,g,j,k,h,i)}var BigInteger=a("bigi"),e=a("./curves.json"),f=a("./curve");b.exports=d},{"./curve":187,"./curves.json":188,bigi:25}],191:[function(a,b,c){(function(Buffer){function Point(a,b,d,e){c.notStrictEqual(e,void 0,"Missing Z coordinate"),this.curve=a,this.x=b,this.y=d,this.z=e,this._zInv=null,this.compressed=!0}var c=a("assert"),BigInteger=a("bigi"),d=BigInteger.valueOf(3);Object.defineProperty(Point.prototype,"zInv",{get:function(){return null===this._zInv&&(this._zInv=this.z.modInverse(this.curve.p)),this._zInv}}),Object.defineProperty(Point.prototype,"affineX",{get:function(){return this.x.multiply(this.zInv).mod(this.curve.p)}}),Object.defineProperty(Point.prototype,"affineY",{get:function(){return this.y.multiply(this.zInv).mod(this.curve.p)}}),Point.fromAffine=function(a,b,c){return new Point(a,b,c,BigInteger.ONE)},Point.prototype.equals=function(a){if(a===this)return!0;if(this.curve.isInfinity(this))return this.curve.isInfinity(a);if(this.curve.isInfinity(a))return this.curve.isInfinity(this);var b=a.y.multiply(this.z).subtract(this.y.multiply(a.z)).mod(this.curve.p);if(0!==b.signum())return!1;var c=a.x.multiply(this.z).subtract(this.x.multiply(a.z)).mod(this.curve.p);return 0===c.signum()},Point.prototype.negate=function(){var a=this.curve.p.subtract(this.y);return new Point(this.curve,this.x,a,this.z)},Point.prototype.add=function(a){if(this.curve.isInfinity(this))return a;if(this.curve.isInfinity(a))return this;var b=this.x,c=this.y,e=a.x,f=a.y,g=f.multiply(this.z).subtract(c.multiply(a.z)).mod(this.curve.p),h=e.multiply(this.z).subtract(b.multiply(a.z)).mod(this.curve.p);if(0===h.signum())return 0===g.signum()?this.twice():this.curve.infinity;var i=h.square(),j=i.multiply(h),k=b.multiply(i),l=g.square().multiply(this.z),m=l.subtract(k.shiftLeft(1)).multiply(a.z).subtract(j).multiply(h).mod(this.curve.p),n=k.multiply(d).multiply(g).subtract(c.multiply(j)).subtract(l.multiply(g)).multiply(a.z).add(g.multiply(j)).mod(this.curve.p),o=j.multiply(this.z).multiply(a.z).mod(this.curve.p);return new Point(this.curve,m,n,o)},Point.prototype.twice=function(){if(this.curve.isInfinity(this))return this;if(0===this.y.signum())return this.curve.infinity;var a=this.x,b=this.y,c=b.multiply(this.z).mod(this.curve.p),e=c.multiply(b).mod(this.curve.p),f=this.curve.a,g=a.square().multiply(d);0!==f.signum()&&(g=g.add(this.z.square().multiply(f))),g=g.mod(this.curve.p);var h=g.square().subtract(a.shiftLeft(3).multiply(e)).shiftLeft(1).multiply(c).mod(this.curve.p),i=g.multiply(d).multiply(a).subtract(e.shiftLeft(1)).shiftLeft(2).multiply(e).subtract(g.pow(3)).mod(this.curve.p),j=c.pow(3).shiftLeft(3).mod(this.curve.p);return new Point(this.curve,h,i,j)},Point.prototype.multiply=function(a){if(this.curve.isInfinity(this))return this;if(0===a.signum())return this.curve.infinity;for(var b=a,c=b.multiply(d),e=this.negate(),f=this,g=c.bitLength()-2;g>0;--g){var h=c.testBit(g),i=b.testBit(g);f=f.twice(),h!==i&&(f=f.add(h?this:e))}return f},Point.prototype.multiplyTwo=function(a,b,c){for(var d=Math.max(a.bitLength(),c.bitLength())-1,e=this.curve.infinity,f=this.add(b);d>=0;){var g=a.testBit(d),h=c.testBit(d);e=e.twice(),g?e=h?e.add(f):e.add(this):h&&(e=e.add(b)),--d}return e},Point.prototype.getEncoded=function(a){if(null==a&&(a=this.compressed),this.curve.isInfinity(this))return new Buffer("00","hex");var b,c=this.affineX,d=this.affineY,e=this.curve.pLength;return a?(b=new Buffer(1+e),b.writeUInt8(d.isEven()?2:3,0)):(b=new Buffer(1+e+e),b.writeUInt8(4,0),d.toBuffer(e).copy(b,1+e)),c.toBuffer(e).copy(b,1),b},Point.decodeFrom=function(a,b){var d,e=b.readUInt8(0),f=4!==e,g=Math.floor((a.p.bitLength()+7)/8),h=BigInteger.fromBuffer(b.slice(1,1+g));if(f){c.equal(b.length,g+1,"Invalid sequence length"),c(2===e||3===e,"Invalid sequence tag");var i=3===e;d=a.pointFromX(i,h)}else{c.equal(b.length,1+g+g,"Invalid sequence length");var j=BigInteger.fromBuffer(b.slice(1+g));d=Point.fromAffine(a,h,j)}return d.compressed=f,d},Point.prototype.toString=function(){return this.curve.isInfinity(this)?"(INFINITY)":"("+this.affineX.toString()+","+this.affineY.toString()+")"},b.exports=Point}).call(this,a("buffer").Buffer)},{assert:19,bigi:25,buffer:104}],192:[function(a,b,c){"use strict";var d=c;d.version=a("../package.json").version,d.utils=a("./elliptic/utils"),d.rand=a("brorand"),d.curve=a("./elliptic/curve"),d.curves=a("./elliptic/curves"),d.ec=a("./elliptic/ec"),d.eddsa=a("./elliptic/eddsa")},{"../package.json":207,"./elliptic/curve":195,"./elliptic/curves":198,"./elliptic/ec":199,"./elliptic/eddsa":202,"./elliptic/utils":206,brorand:76}],193:[function(a,b,c){"use strict";function d(a,b){this.type=a,this.p=new f(b.p,16),this.red=b.prime?f.red(b.prime):f.mont(this.p),this.zero=new f(0).toRed(this.red),this.one=new f(1).toRed(this.red),this.two=new f(2).toRed(this.red),this.n=b.n&&new f(b.n,16),this.g=b.g&&this.pointFromJSON(b.g,b.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4);var c=this.n&&this.p.div(this.n);!c||c.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function e(a,b){this.curve=a,this.type=b,this.precomputed=null}var f=a("bn.js"),g=a("../../elliptic"),h=g.utils,i=h.getNAF,j=h.getJSF,k=h.assert;b.exports=d,d.prototype.point=function(){throw new Error("Not implemented")},d.prototype.validate=function(){throw new Error("Not implemented")},d.prototype._fixedNafMul=function(a,b){k(a.precomputed);var c=a._getDoubles(),d=i(b,1),e=(1<<c.step+1)-(c.step%2===0?2:1);e/=3;for(var f=[],g=0;g<d.length;g+=c.step){for(var h=0,b=g+c.step-1;b>=g;b--)h=(h<<1)+d[b];f.push(h)}for(var j=this.jpoint(null,null,null),l=this.jpoint(null,null,null),m=e;m>0;m--){for(var g=0;g<f.length;g++){var h=f[g];h===m?l=l.mixedAdd(c.points[g]):h===-m&&(l=l.mixedAdd(c.points[g].neg()))}j=j.add(l)}return j.toP()},d.prototype._wnafMul=function(a,b){var c=4,d=a._getNAFPoints(c);c=d.wnd;for(var e=d.points,f=i(b,c),g=this.jpoint(null,null,null),h=f.length-1;h>=0;h--){for(var b=0;h>=0&&0===f[h];h--)b++;if(h>=0&&b++,g=g.dblp(b),h<0)break;var j=f[h];k(0!==j),g="affine"===a.type?j>0?g.mixedAdd(e[j-1>>1]):g.mixedAdd(e[-j-1>>1].neg()):j>0?g.add(e[j-1>>1]):g.add(e[-j-1>>1].neg())}return"affine"===a.type?g.toP():g},d.prototype._wnafMulAdd=function(a,b,c,d,e){for(var f=this._wnafT1,g=this._wnafT2,h=this._wnafT3,k=0,l=0;l<d;l++){var m=b[l],n=m._getNAFPoints(a);f[l]=n.wnd,g[l]=n.points}for(var l=d-1;l>=1;l-=2){var o=l-1,p=l;if(1===f[o]&&1===f[p]){var q=[b[o],null,null,b[p]];0===b[o].y.cmp(b[p].y)?(q[1]=b[o].add(b[p]),q[2]=b[o].toJ().mixedAdd(b[p].neg())):0===b[o].y.cmp(b[p].y.redNeg())?(q[1]=b[o].toJ().mixedAdd(b[p]),q[2]=b[o].add(b[p].neg())):(q[1]=b[o].toJ().mixedAdd(b[p]),q[2]=b[o].toJ().mixedAdd(b[p].neg()));var r=[-3,-1,-5,-7,0,7,5,1,3],s=j(c[o],c[p]);k=Math.max(s[0].length,k),h[o]=new Array(k),h[p]=new Array(k);for(var t=0;t<k;t++){var u=0|s[0][t],v=0|s[1][t];h[o][t]=r[3*(u+1)+(v+1)],h[p][t]=0,g[o]=q}}else h[o]=i(c[o],f[o]),h[p]=i(c[p],f[p]),k=Math.max(h[o].length,k),k=Math.max(h[p].length,k)}for(var w=this.jpoint(null,null,null),x=this._wnafT4,l=k;l>=0;l--){for(var y=0;l>=0;){for(var z=!0,t=0;t<d;t++)x[t]=0|h[t][l],0!==x[t]&&(z=!1);if(!z)break;y++,l--}if(l>=0&&y++,w=w.dblp(y),l<0)break;for(var t=0;t<d;t++){var m,A=x[t];0!==A&&(A>0?m=g[t][A-1>>1]:A<0&&(m=g[t][-A-1>>1].neg()),w="affine"===m.type?w.mixedAdd(m):w.add(m))}}for(var l=0;l<d;l++)g[l]=null;return e?w:w.toP()},d.BasePoint=e,e.prototype.eq=function(){throw new Error("Not implemented")},e.prototype.validate=function(){return this.curve.validate(this)},d.prototype.decodePoint=function(a,b){a=h.toArray(a,b);var c=this.p.byteLength();if((4===a[0]||6===a[0]||7===a[0])&&a.length-1===2*c){6===a[0]?k(a[a.length-1]%2===0):7===a[0]&&k(a[a.length-1]%2===1);var d=this.point(a.slice(1,1+c),a.slice(1+c,1+2*c));return d}if((2===a[0]||3===a[0])&&a.length-1===c)return this.pointFromX(a.slice(1,1+c),3===a[0]);throw new Error("Unknown point format")},e.prototype.encodeCompressed=function(a){return this.encode(a,!0)},e.prototype._encode=function(a){var b=this.curve.p.byteLength(),c=this.getX().toArray("be",b);return a?[this.getY().isEven()?2:3].concat(c):[4].concat(c,this.getY().toArray("be",b))},e.prototype.encode=function(a,b){return h.encode(this._encode(b),a)},e.prototype.precompute=function(a){if(this.precomputed)return this;var b={doubles:null,naf:null,beta:null};return b.naf=this._getNAFPoints(8),b.doubles=this._getDoubles(4,a),b.beta=this._getBeta(),this.precomputed=b,this},e.prototype._hasDoubles=function(a){if(!this.precomputed)return!1;var b=this.precomputed.doubles;return!!b&&b.points.length>=Math.ceil((a.bitLength()+1)/b.step)},e.prototype._getDoubles=function(a,b){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var c=[this],d=this,e=0;e<b;e+=a){for(var f=0;f<a;f++)d=d.dbl();c.push(d)}return{step:a,points:c}},e.prototype._getNAFPoints=function(a){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var b=[this],c=(1<<a)-1,d=1===c?null:this.dbl(),e=1;e<c;e++)b[e]=b[e-1].add(d);return{wnd:a,points:b}},e.prototype._getBeta=function(){return null},e.prototype.dblp=function(a){for(var b=this,c=0;c<a;c++)b=b.dbl();return b}},{"../../elliptic":192,"bn.js":75}],194:[function(a,b,c){"use strict";function d(a){this.twisted=1!==(0|a.a),this.mOneA=this.twisted&&(0|a.a)===-1,this.extended=this.mOneA,i.call(this,"edwards",a),this.a=new g(a.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new g(a.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new g(a.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),j(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1===(0|a.c)}function Point(a,b,c,d,e){i.BasePoint.call(this,a,"projective"),null===b&&null===c&&null===d?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new g(b,16),this.y=new g(c,16),this.z=d?new g(d,16):this.curve.one,this.t=e&&new g(e,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}var e=a("../curve"),f=a("../../elliptic"),g=a("bn.js"),h=a("inherits"),i=e.base,j=f.utils.assert;h(d,i),b.exports=d,d.prototype._mulA=function(a){return this.mOneA?a.redNeg():this.a.redMul(a); |
| 15 |
|
},d.prototype._mulC=function(a){return this.oneC?a:this.c.redMul(a)},d.prototype.jpoint=function(a,b,c,d){return this.point(a,b,c,d)},d.prototype.pointFromX=function(a,b){a=new g(a,16),a.red||(a=a.toRed(this.red));var c=a.redSqr(),d=this.c2.redSub(this.a.redMul(c)),e=this.one.redSub(this.c2.redMul(this.d).redMul(c)),f=d.redMul(e.redInvm()),h=f.redSqrt();if(0!==h.redSqr().redSub(f).cmp(this.zero))throw new Error("invalid point");var i=h.fromRed().isOdd();return(b&&!i||!b&&i)&&(h=h.redNeg()),this.point(a,h)},d.prototype.pointFromY=function(a,b){a=new g(a,16),a.red||(a=a.toRed(this.red));var c=a.redSqr(),d=c.redSub(this.one),e=c.redMul(this.d).redAdd(this.one),f=d.redMul(e.redInvm());if(0===f.cmp(this.zero)){if(b)throw new Error("invalid point");return this.point(this.zero,a)}var h=f.redSqrt();if(0!==h.redSqr().redSub(f).cmp(this.zero))throw new Error("invalid point");return h.isOdd()!==b&&(h=h.redNeg()),this.point(h,a)},d.prototype.validate=function(a){if(a.isInfinity())return!0;a.normalize();var b=a.x.redSqr(),c=a.y.redSqr(),d=b.redMul(this.a).redAdd(c),e=this.c2.redMul(this.one.redAdd(this.d.redMul(b).redMul(c)));return 0===d.cmp(e)},h(Point,i.BasePoint),d.prototype.pointFromJSON=function(a){return Point.fromJSON(this,a)},d.prototype.point=function(a,b,c,d){return new Point(this,a,b,c,d)},Point.fromJSON=function(a,b){return new Point(a,b[0],b[1],b[2])},Point.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},Point.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&0===this.y.cmp(this.z)},Point.prototype._extDbl=function(){var a=this.x.redSqr(),b=this.y.redSqr(),c=this.z.redSqr();c=c.redIAdd(c);var d=this.curve._mulA(a),e=this.x.redAdd(this.y).redSqr().redISub(a).redISub(b),f=d.redAdd(b),g=f.redSub(c),h=d.redSub(b),i=e.redMul(g),j=f.redMul(h),k=e.redMul(h),l=g.redMul(f);return this.curve.point(i,j,l,k)},Point.prototype._projDbl=function(){var a,b,c,d=this.x.redAdd(this.y).redSqr(),e=this.x.redSqr(),f=this.y.redSqr();if(this.curve.twisted){var g=this.curve._mulA(e),h=g.redAdd(f);if(this.zOne)a=d.redSub(e).redSub(f).redMul(h.redSub(this.curve.two)),b=h.redMul(g.redSub(f)),c=h.redSqr().redSub(h).redSub(h);else{var i=this.z.redSqr(),j=h.redSub(i).redISub(i);a=d.redSub(e).redISub(f).redMul(j),b=h.redMul(g.redSub(f)),c=h.redMul(j)}}else{var g=e.redAdd(f),i=this.curve._mulC(this.c.redMul(this.z)).redSqr(),j=g.redSub(i).redSub(i);a=this.curve._mulC(d.redISub(g)).redMul(j),b=this.curve._mulC(g).redMul(e.redISub(f)),c=g.redMul(j)}return this.curve.point(a,b,c)},Point.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},Point.prototype._extAdd=function(a){var b=this.y.redSub(this.x).redMul(a.y.redSub(a.x)),c=this.y.redAdd(this.x).redMul(a.y.redAdd(a.x)),d=this.t.redMul(this.curve.dd).redMul(a.t),e=this.z.redMul(a.z.redAdd(a.z)),f=c.redSub(b),g=e.redSub(d),h=e.redAdd(d),i=c.redAdd(b),j=f.redMul(g),k=h.redMul(i),l=f.redMul(i),m=g.redMul(h);return this.curve.point(j,k,m,l)},Point.prototype._projAdd=function(a){var b,c,d=this.z.redMul(a.z),e=d.redSqr(),f=this.x.redMul(a.x),g=this.y.redMul(a.y),h=this.curve.d.redMul(f).redMul(g),i=e.redSub(h),j=e.redAdd(h),k=this.x.redAdd(this.y).redMul(a.x.redAdd(a.y)).redISub(f).redISub(g),l=d.redMul(i).redMul(k);return this.curve.twisted?(b=d.redMul(j).redMul(g.redSub(this.curve._mulA(f))),c=i.redMul(j)):(b=d.redMul(j).redMul(g.redSub(f)),c=this.curve._mulC(i).redMul(j)),this.curve.point(l,b,c)},Point.prototype.add=function(a){return this.isInfinity()?a:a.isInfinity()?this:this.curve.extended?this._extAdd(a):this._projAdd(a)},Point.prototype.mul=function(a){return this._hasDoubles(a)?this.curve._fixedNafMul(this,a):this.curve._wnafMul(this,a)},Point.prototype.mulAdd=function(a,b,c){return this.curve._wnafMulAdd(1,[this,b],[a,c],2,!1)},Point.prototype.jmulAdd=function(a,b,c){return this.curve._wnafMulAdd(1,[this,b],[a,c],2,!0)},Point.prototype.normalize=function(){if(this.zOne)return this;var a=this.z.redInvm();return this.x=this.x.redMul(a),this.y=this.y.redMul(a),this.t&&(this.t=this.t.redMul(a)),this.z=this.curve.one,this.zOne=!0,this},Point.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},Point.prototype.getX=function(){return this.normalize(),this.x.fromRed()},Point.prototype.getY=function(){return this.normalize(),this.y.fromRed()},Point.prototype.eq=function(a){return this===a||0===this.getX().cmp(a.getX())&&0===this.getY().cmp(a.getY())},Point.prototype.eqXToP=function(a){var b=a.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(b))return!0;for(var c=a.clone(),d=this.curve.redN.redMul(this.z);;){if(c.iadd(this.curve.n),c.cmp(this.curve.p)>=0)return!1;if(b.redIAdd(d),0===this.x.cmp(b))return!0}return!1},Point.prototype.toP=Point.prototype.normalize,Point.prototype.mixedAdd=Point.prototype.add},{"../../elliptic":192,"../curve":195,"bn.js":75,inherits:226}],195:[function(a,b,c){"use strict";var d=c;d.base=a("./base"),d.short=a("./short"),d.mont=a("./mont"),d.edwards=a("./edwards")},{"./base":193,"./edwards":194,"./mont":196,"./short":197}],196:[function(a,b,c){"use strict";function d(a){h.call(this,"mont",a),this.a=new f(a.a,16).toRed(this.red),this.b=new f(a.b,16).toRed(this.red),this.i4=new f(4).toRed(this.red).redInvm(),this.two=new f(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function Point(a,b,c){h.BasePoint.call(this,a,"projective"),null===b&&null===c?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new f(b,16),this.z=new f(c,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}var e=a("../curve"),f=a("bn.js"),g=a("inherits"),h=e.base,i=a("../../elliptic"),j=i.utils;g(d,h),b.exports=d,d.prototype.validate=function(a){var b=a.normalize().x,c=b.redSqr(),d=c.redMul(b).redAdd(c.redMul(this.a)).redAdd(b),e=d.redSqrt();return 0===e.redSqr().cmp(d)},g(Point,h.BasePoint),d.prototype.decodePoint=function(a,b){return this.point(j.toArray(a,b),1)},d.prototype.point=function(a,b){return new Point(this,a,b)},d.prototype.pointFromJSON=function(a){return Point.fromJSON(this,a)},Point.prototype.precompute=function(){},Point.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},Point.fromJSON=function(a,b){return new Point(a,b[0],b[1]||a.one)},Point.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},Point.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},Point.prototype.dbl=function(){var a=this.x.redAdd(this.z),b=a.redSqr(),c=this.x.redSub(this.z),d=c.redSqr(),e=b.redSub(d),f=b.redMul(d),g=e.redMul(d.redAdd(this.curve.a24.redMul(e)));return this.curve.point(f,g)},Point.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},Point.prototype.diffAdd=function(a,b){var c=this.x.redAdd(this.z),d=this.x.redSub(this.z),e=a.x.redAdd(a.z),f=a.x.redSub(a.z),g=f.redMul(c),h=e.redMul(d),i=b.z.redMul(g.redAdd(h).redSqr()),j=b.x.redMul(g.redISub(h).redSqr());return this.curve.point(i,j)},Point.prototype.mul=function(a){for(var b=a.clone(),c=this,d=this.curve.point(null,null),e=this,f=[];0!==b.cmpn(0);b.iushrn(1))f.push(b.andln(1));for(var g=f.length-1;g>=0;g--)0===f[g]?(c=c.diffAdd(d,e),d=d.dbl()):(d=c.diffAdd(d,e),c=c.dbl());return d},Point.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},Point.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},Point.prototype.eq=function(a){return 0===this.getX().cmp(a.getX())},Point.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},Point.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},{"../../elliptic":192,"../curve":195,"bn.js":75,inherits:226}],197:[function(a,b,c){"use strict";function d(a){j.call(this,"short",a),this.a=new h(a.a,16).toRed(this.red),this.b=new h(a.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(a),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function Point(a,b,c,d){j.BasePoint.call(this,a,"affine"),null===b&&null===c?(this.x=null,this.y=null,this.inf=!0):(this.x=new h(b,16),this.y=new h(c,16),d&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function e(a,b,c,d){j.BasePoint.call(this,a,"jacobian"),null===b&&null===c&&null===d?(this.x=this.curve.one,this.y=this.curve.one,this.z=new h(0)):(this.x=new h(b,16),this.y=new h(c,16),this.z=new h(d,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}var f=a("../curve"),g=a("../../elliptic"),h=a("bn.js"),i=a("inherits"),j=f.base,k=g.utils.assert;i(d,j),b.exports=d,d.prototype._getEndomorphism=function(a){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var b,c;if(a.beta)b=new h(a.beta,16).toRed(this.red);else{var d=this._getEndoRoots(this.p);b=d[0].cmp(d[1])<0?d[0]:d[1],b=b.toRed(this.red)}if(a.lambda)c=new h(a.lambda,16);else{var e=this._getEndoRoots(this.n);0===this.g.mul(e[0]).x.cmp(this.g.x.redMul(b))?c=e[0]:(c=e[1],k(0===this.g.mul(c).x.cmp(this.g.x.redMul(b))))}var f;return f=a.basis?a.basis.map(function(a){return{a:new h(a.a,16),b:new h(a.b,16)}}):this._getEndoBasis(c),{beta:b,lambda:c,basis:f}}},d.prototype._getEndoRoots=function(a){var b=a===this.p?this.red:h.mont(a),c=new h(2).toRed(b).redInvm(),d=c.redNeg(),e=new h(3).toRed(b).redNeg().redSqrt().redMul(c),f=d.redAdd(e).fromRed(),g=d.redSub(e).fromRed();return[f,g]},d.prototype._getEndoBasis=function(a){for(var b,c,d,e,f,g,i,j,k,l=this.n.ushrn(Math.floor(this.n.bitLength()/2)),m=a,n=this.n.clone(),o=new h(1),p=new h(0),q=new h(0),r=new h(1),s=0;0!==m.cmpn(0);){var t=n.div(m);j=n.sub(t.mul(m)),k=q.sub(t.mul(o));var u=r.sub(t.mul(p));if(!d&&j.cmp(l)<0)b=i.neg(),c=o,d=j.neg(),e=k;else if(d&&2===++s)break;i=j,n=m,m=j,q=o,o=k,r=p,p=u}f=j.neg(),g=k;var v=d.sqr().add(e.sqr()),w=f.sqr().add(g.sqr());return w.cmp(v)>=0&&(f=b,g=c),d.negative&&(d=d.neg(),e=e.neg()),f.negative&&(f=f.neg(),g=g.neg()),[{a:d,b:e},{a:f,b:g}]},d.prototype._endoSplit=function(a){var b=this.endo.basis,c=b[0],d=b[1],e=d.b.mul(a).divRound(this.n),f=c.b.neg().mul(a).divRound(this.n),g=e.mul(c.a),h=f.mul(d.a),i=e.mul(c.b),j=f.mul(d.b),k=a.sub(g).sub(h),l=i.add(j).neg();return{k1:k,k2:l}},d.prototype.pointFromX=function(a,b){a=new h(a,16),a.red||(a=a.toRed(this.red));var c=a.redSqr().redMul(a).redIAdd(a.redMul(this.a)).redIAdd(this.b),d=c.redSqrt();if(0!==d.redSqr().redSub(c).cmp(this.zero))throw new Error("invalid point");var e=d.fromRed().isOdd();return(b&&!e||!b&&e)&&(d=d.redNeg()),this.point(a,d)},d.prototype.validate=function(a){if(a.inf)return!0;var b=a.x,c=a.y,d=this.a.redMul(b),e=b.redSqr().redMul(b).redIAdd(d).redIAdd(this.b);return 0===c.redSqr().redISub(e).cmpn(0)},d.prototype._endoWnafMulAdd=function(a,b,c){for(var d=this._endoWnafT1,e=this._endoWnafT2,f=0;f<a.length;f++){var g=this._endoSplit(b[f]),h=a[f],i=h._getBeta();g.k1.negative&&(g.k1.ineg(),h=h.neg(!0)),g.k2.negative&&(g.k2.ineg(),i=i.neg(!0)),d[2*f]=h,d[2*f+1]=i,e[2*f]=g.k1,e[2*f+1]=g.k2}for(var j=this._wnafMulAdd(1,d,e,2*f,c),k=0;k<2*f;k++)d[k]=null,e[k]=null;return j},i(Point,j.BasePoint),d.prototype.point=function(a,b,c){return new Point(this,a,b,c)},d.prototype.pointFromJSON=function(a,b){return Point.fromJSON(this,a,b)},Point.prototype._getBeta=function(){if(this.curve.endo){var a=this.precomputed;if(a&&a.beta)return a.beta;var b=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(a){var c=this.curve,d=function(a){return c.point(a.x.redMul(c.endo.beta),a.y)};a.beta=b,b.precomputed={beta:null,naf:a.naf&&{wnd:a.naf.wnd,points:a.naf.points.map(d)},doubles:a.doubles&&{step:a.doubles.step,points:a.doubles.points.map(d)}}}return b}},Point.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},Point.fromJSON=function(a,b,c){function d(b){return a.point(b[0],b[1],c)}"string"==typeof b&&(b=JSON.parse(b));var e=a.point(b[0],b[1],c);if(!b[2])return e;var f=b[2];return e.precomputed={beta:null,doubles:f.doubles&&{step:f.doubles.step,points:[e].concat(f.doubles.points.map(d))},naf:f.naf&&{wnd:f.naf.wnd,points:[e].concat(f.naf.points.map(d))}},e},Point.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},Point.prototype.isInfinity=function(){return this.inf},Point.prototype.add=function(a){if(this.inf)return a;if(a.inf)return this;if(this.eq(a))return this.dbl();if(this.neg().eq(a))return this.curve.point(null,null);if(0===this.x.cmp(a.x))return this.curve.point(null,null);var b=this.y.redSub(a.y);0!==b.cmpn(0)&&(b=b.redMul(this.x.redSub(a.x).redInvm()));var c=b.redSqr().redISub(this.x).redISub(a.x),d=b.redMul(this.x.redSub(c)).redISub(this.y);return this.curve.point(c,d)},Point.prototype.dbl=function(){if(this.inf)return this;var a=this.y.redAdd(this.y);if(0===a.cmpn(0))return this.curve.point(null,null);var b=this.curve.a,c=this.x.redSqr(),d=a.redInvm(),e=c.redAdd(c).redIAdd(c).redIAdd(b).redMul(d),f=e.redSqr().redISub(this.x.redAdd(this.x)),g=e.redMul(this.x.redSub(f)).redISub(this.y);return this.curve.point(f,g)},Point.prototype.getX=function(){return this.x.fromRed()},Point.prototype.getY=function(){return this.y.fromRed()},Point.prototype.mul=function(a){return a=new h(a,16),this._hasDoubles(a)?this.curve._fixedNafMul(this,a):this.curve.endo?this.curve._endoWnafMulAdd([this],[a]):this.curve._wnafMul(this,a)},Point.prototype.mulAdd=function(a,b,c){var d=[this,b],e=[a,c];return this.curve.endo?this.curve._endoWnafMulAdd(d,e):this.curve._wnafMulAdd(1,d,e,2)},Point.prototype.jmulAdd=function(a,b,c){var d=[this,b],e=[a,c];return this.curve.endo?this.curve._endoWnafMulAdd(d,e,!0):this.curve._wnafMulAdd(1,d,e,2,!0)},Point.prototype.eq=function(a){return this===a||this.inf===a.inf&&(this.inf||0===this.x.cmp(a.x)&&0===this.y.cmp(a.y))},Point.prototype.neg=function(a){if(this.inf)return this;var b=this.curve.point(this.x,this.y.redNeg());if(a&&this.precomputed){var c=this.precomputed,d=function(a){return a.neg()};b.precomputed={naf:c.naf&&{wnd:c.naf.wnd,points:c.naf.points.map(d)},doubles:c.doubles&&{step:c.doubles.step,points:c.doubles.points.map(d)}}}return b},Point.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var a=this.curve.jpoint(this.x,this.y,this.curve.one);return a},i(e,j.BasePoint),d.prototype.jpoint=function(a,b,c){return new e(this,a,b,c)},e.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var a=this.z.redInvm(),b=a.redSqr(),c=this.x.redMul(b),d=this.y.redMul(b).redMul(a);return this.curve.point(c,d)},e.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},e.prototype.add=function(a){if(this.isInfinity())return a;if(a.isInfinity())return this;var b=a.z.redSqr(),c=this.z.redSqr(),d=this.x.redMul(b),e=a.x.redMul(c),f=this.y.redMul(b.redMul(a.z)),g=a.y.redMul(c.redMul(this.z)),h=d.redSub(e),i=f.redSub(g);if(0===h.cmpn(0))return 0!==i.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var j=h.redSqr(),k=j.redMul(h),l=d.redMul(j),m=i.redSqr().redIAdd(k).redISub(l).redISub(l),n=i.redMul(l.redISub(m)).redISub(f.redMul(k)),o=this.z.redMul(a.z).redMul(h);return this.curve.jpoint(m,n,o)},e.prototype.mixedAdd=function(a){if(this.isInfinity())return a.toJ();if(a.isInfinity())return this;var b=this.z.redSqr(),c=this.x,d=a.x.redMul(b),e=this.y,f=a.y.redMul(b).redMul(this.z),g=c.redSub(d),h=e.redSub(f);if(0===g.cmpn(0))return 0!==h.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var i=g.redSqr(),j=i.redMul(g),k=c.redMul(i),l=h.redSqr().redIAdd(j).redISub(k).redISub(k),m=h.redMul(k.redISub(l)).redISub(e.redMul(j)),n=this.z.redMul(g);return this.curve.jpoint(l,m,n)},e.prototype.dblp=function(a){if(0===a)return this;if(this.isInfinity())return this;if(!a)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var b=this,c=0;c<a;c++)b=b.dbl();return b}for(var d=this.curve.a,e=this.curve.tinv,f=this.x,g=this.y,h=this.z,i=h.redSqr().redSqr(),j=g.redAdd(g),c=0;c<a;c++){var k=f.redSqr(),l=j.redSqr(),m=l.redSqr(),n=k.redAdd(k).redIAdd(k).redIAdd(d.redMul(i)),o=f.redMul(l),p=n.redSqr().redISub(o.redAdd(o)),q=o.redISub(p),r=n.redMul(q);r=r.redIAdd(r).redISub(m);var s=j.redMul(h);c+1<a&&(i=i.redMul(m)),f=p,h=s,j=r}return this.curve.jpoint(f,j.redMul(e),h)},e.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},e.prototype._zeroDbl=function(){var a,b,c;if(this.zOne){var d=this.x.redSqr(),e=this.y.redSqr(),f=e.redSqr(),g=this.x.redAdd(e).redSqr().redISub(d).redISub(f);g=g.redIAdd(g);var h=d.redAdd(d).redIAdd(d),i=h.redSqr().redISub(g).redISub(g),j=f.redIAdd(f);j=j.redIAdd(j),j=j.redIAdd(j),a=i,b=h.redMul(g.redISub(i)).redISub(j),c=this.y.redAdd(this.y)}else{var k=this.x.redSqr(),l=this.y.redSqr(),m=l.redSqr(),n=this.x.redAdd(l).redSqr().redISub(k).redISub(m);n=n.redIAdd(n);var o=k.redAdd(k).redIAdd(k),p=o.redSqr(),q=m.redIAdd(m);q=q.redIAdd(q),q=q.redIAdd(q),a=p.redISub(n).redISub(n),b=o.redMul(n.redISub(a)).redISub(q),c=this.y.redMul(this.z),c=c.redIAdd(c)}return this.curve.jpoint(a,b,c)},e.prototype._threeDbl=function(){var a,b,c;if(this.zOne){var d=this.x.redSqr(),e=this.y.redSqr(),f=e.redSqr(),g=this.x.redAdd(e).redSqr().redISub(d).redISub(f);g=g.redIAdd(g);var h=d.redAdd(d).redIAdd(d).redIAdd(this.curve.a),i=h.redSqr().redISub(g).redISub(g);a=i;var j=f.redIAdd(f);j=j.redIAdd(j),j=j.redIAdd(j),b=h.redMul(g.redISub(i)).redISub(j),c=this.y.redAdd(this.y)}else{var k=this.z.redSqr(),l=this.y.redSqr(),m=this.x.redMul(l),n=this.x.redSub(k).redMul(this.x.redAdd(k));n=n.redAdd(n).redIAdd(n);var o=m.redIAdd(m);o=o.redIAdd(o);var p=o.redAdd(o);a=n.redSqr().redISub(p),c=this.y.redAdd(this.z).redSqr().redISub(l).redISub(k);var q=l.redSqr();q=q.redIAdd(q),q=q.redIAdd(q),q=q.redIAdd(q),b=n.redMul(o.redISub(a)).redISub(q)}return this.curve.jpoint(a,b,c)},e.prototype._dbl=function(){var a=this.curve.a,b=this.x,c=this.y,d=this.z,e=d.redSqr().redSqr(),f=b.redSqr(),g=c.redSqr(),h=f.redAdd(f).redIAdd(f).redIAdd(a.redMul(e)),i=b.redAdd(b);i=i.redIAdd(i);var j=i.redMul(g),k=h.redSqr().redISub(j.redAdd(j)),l=j.redISub(k),m=g.redSqr();m=m.redIAdd(m),m=m.redIAdd(m),m=m.redIAdd(m);var n=h.redMul(l).redISub(m),o=c.redAdd(c).redMul(d);return this.curve.jpoint(k,n,o)},e.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var a=this.x.redSqr(),b=this.y.redSqr(),c=this.z.redSqr(),d=b.redSqr(),e=a.redAdd(a).redIAdd(a),f=e.redSqr(),g=this.x.redAdd(b).redSqr().redISub(a).redISub(d);g=g.redIAdd(g),g=g.redAdd(g).redIAdd(g),g=g.redISub(f);var h=g.redSqr(),i=d.redIAdd(d);i=i.redIAdd(i),i=i.redIAdd(i),i=i.redIAdd(i);var j=e.redIAdd(g).redSqr().redISub(f).redISub(h).redISub(i),k=b.redMul(j);k=k.redIAdd(k),k=k.redIAdd(k);var l=this.x.redMul(h).redISub(k);l=l.redIAdd(l),l=l.redIAdd(l);var m=this.y.redMul(j.redMul(i.redISub(j)).redISub(g.redMul(h)));m=m.redIAdd(m),m=m.redIAdd(m),m=m.redIAdd(m);var n=this.z.redAdd(g).redSqr().redISub(c).redISub(h);return this.curve.jpoint(l,m,n)},e.prototype.mul=function(a,b){return a=new h(a,b),this.curve._wnafMul(this,a)},e.prototype.eq=function(a){if("affine"===a.type)return this.eq(a.toJ());if(this===a)return!0;var b=this.z.redSqr(),c=a.z.redSqr();if(0!==this.x.redMul(c).redISub(a.x.redMul(b)).cmpn(0))return!1;var d=b.redMul(this.z),e=c.redMul(a.z);return 0===this.y.redMul(e).redISub(a.y.redMul(d)).cmpn(0)},e.prototype.eqXToP=function(a){var b=this.z.redSqr(),c=a.toRed(this.curve.red).redMul(b);if(0===this.x.cmp(c))return!0;for(var d=a.clone(),e=this.curve.redN.redMul(b);;){if(d.iadd(this.curve.n),d.cmp(this.curve.p)>=0)return!1;if(c.redIAdd(e),0===this.x.cmp(c))return!0}return!1},e.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},e.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},{"../../elliptic":192,"../curve":195,"bn.js":75,inherits:226}],198:[function(a,b,c){"use strict";function d(a){"short"===a.type?this.curve=new h.curve.short(a):"edwards"===a.type?this.curve=new h.curve.edwards(a):this.curve=new h.curve.mont(a),this.g=this.curve.g,this.n=this.curve.n,this.hash=a.hash,i(this.g.validate(),"Invalid curve"),i(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function e(a,b){Object.defineProperty(f,a,{configurable:!0,enumerable:!0,get:function(){var c=new d(b);return Object.defineProperty(f,a,{configurable:!0,enumerable:!0,value:c}),c}})}var f=c,g=a("hash.js"),h=a("../elliptic"),i=h.utils.assert;f.PresetCurve=d,e("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:g.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),e("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:g.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),e("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:g.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),e("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:g.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),e("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:g.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),e("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:g.sha256,gRed:!1,g:["9"]}),e("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:g.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var j;try{j=a("./precomputed/secp256k1")}catch(a){j=void 0}e("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:g.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",j]})},{"../elliptic":192,"./precomputed/secp256k1":205,"hash.js":211}],199:[function(a,b,c){"use strict";function d(a){return this instanceof d?("string"==typeof a&&(i(g.curves.hasOwnProperty(a),"Unknown curve "+a),a=g.curves[a]),a instanceof g.curves.PresetCurve&&(a={curve:a}),this.curve=a.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=a.curve.g,this.g.precompute(a.curve.n.bitLength()+1),void(this.hash=a.hash||a.curve.hash)):new d(a)}var e=a("bn.js"),f=a("hmac-drbg"),g=a("../../elliptic"),h=g.utils,i=h.assert,j=a("./key"),k=a("./signature");b.exports=d,d.prototype.keyPair=function(a){return new j(this,a)},d.prototype.keyFromPrivate=function(a,b){return j.fromPrivate(this,a,b)},d.prototype.keyFromPublic=function(a,b){return j.fromPublic(this,a,b)},d.prototype.genKeyPair=function(a){a||(a={});for(var b=new f({hash:this.hash,pers:a.pers,persEnc:a.persEnc||"utf8",entropy:a.entropy||g.rand(this.hash.hmacStrength),entropyEnc:a.entropy&&a.entropyEnc||"utf8",nonce:this.n.toArray()}),c=this.n.byteLength(),d=this.n.sub(new e(2));;){var h=new e(b.generate(c));if(!(h.cmp(d)>0))return h.iaddn(1),this.keyFromPrivate(h)}},d.prototype._truncateToN=function(a,b){var c=8*a.byteLength()-this.n.bitLength();return c>0&&(a=a.ushrn(c)),!b&&a.cmp(this.n)>=0?a.sub(this.n):a},d.prototype.sign=function(a,b,c,d){"object"==typeof c&&(d=c,c=null),d||(d={}),b=this.keyFromPrivate(b,c),a=this._truncateToN(new e(a,16));for(var g=this.n.byteLength(),h=b.getPrivate().toArray("be",g),i=a.toArray("be",g),j=new f({hash:this.hash,entropy:h,nonce:i,pers:d.pers,persEnc:d.persEnc||"utf8"}),l=this.n.sub(new e(1)),m=0;!0;m++){var n=d.k?d.k(m):new e(j.generate(this.n.byteLength()));if(n=this._truncateToN(n,!0),!(n.cmpn(1)<=0||n.cmp(l)>=0)){var o=this.g.mul(n);if(!o.isInfinity()){var p=o.getX(),q=p.umod(this.n);if(0!==q.cmpn(0)){var r=n.invm(this.n).mul(q.mul(b.getPrivate()).iadd(a));if(r=r.umod(this.n),0!==r.cmpn(0)){var s=(o.getY().isOdd()?1:0)|(0!==p.cmp(q)?2:0);return d.canonical&&r.cmp(this.nh)>0&&(r=this.n.sub(r),s^=1),new k({r:q,s:r,recoveryParam:s})}}}}}},d.prototype.verify=function(a,b,c,d){a=this._truncateToN(new e(a,16)),c=this.keyFromPublic(c,d),b=new k(b,"hex");var f=b.r,g=b.s;if(f.cmpn(1)<0||f.cmp(this.n)>=0)return!1;if(g.cmpn(1)<0||g.cmp(this.n)>=0)return!1;var h=g.invm(this.n),i=h.mul(a).umod(this.n),j=h.mul(f).umod(this.n);if(!this.curve._maxwellTrick){var l=this.g.mulAdd(i,c.getPublic(),j);return!l.isInfinity()&&0===l.getX().umod(this.n).cmp(f)}var l=this.g.jmulAdd(i,c.getPublic(),j);return!l.isInfinity()&&l.eqXToP(f)},d.prototype.recoverPubKey=function(a,b,c,d){i((3&c)===c,"The recovery param is more than two bits"),b=new k(b,d);var f=this.n,g=new e(a),h=b.r,j=b.s,l=1&c,m=c>>1;if(h.cmp(this.curve.p.umod(this.curve.n))>=0&&m)throw new Error("Unable to find sencond key candinate");h=m?this.curve.pointFromX(h.add(this.curve.n),l):this.curve.pointFromX(h,l);var n=b.r.invm(f),o=f.sub(g).mul(n).umod(f),p=j.mul(n).umod(f);return this.g.mulAdd(o,h,p)},d.prototype.getKeyRecoveryParam=function(a,b,c,d){if(b=new k(b,d),null!==b.recoveryParam)return b.recoveryParam;for(var e=0;e<4;e++){var f;try{f=this.recoverPubKey(a,b,e)}catch(a){continue}if(f.eq(c))return e}throw new Error("Unable to find valid recovery factor")}},{"../../elliptic":192,"./key":200,"./signature":201,"bn.js":75,"hmac-drbg":223}],200:[function(a,b,c){"use strict";function d(a,b){this.ec=a,this.priv=null,this.pub=null,b.priv&&this._importPrivate(b.priv,b.privEnc),b.pub&&this._importPublic(b.pub,b.pubEnc)}var e=a("bn.js"),f=a("../../elliptic"),g=f.utils,h=g.assert;b.exports=d,d.fromPublic=function(a,b,c){return b instanceof d?b:new d(a,{pub:b,pubEnc:c})},d.fromPrivate=function(a,b,c){return b instanceof d?b:new d(a,{priv:b,privEnc:c})},d.prototype.validate=function(){var a=this.getPublic();return a.isInfinity()?{result:!1,reason:"Invalid public key"}:a.validate()?a.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},d.prototype.getPublic=function(a,b){return"string"==typeof a&&(b=a,a=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),b?this.pub.encode(b,a):this.pub},d.prototype.getPrivate=function(a){return"hex"===a?this.priv.toString(16,2):this.priv},d.prototype._importPrivate=function(a,b){this.priv=new e(a,b||16),this.priv=this.priv.umod(this.ec.curve.n)},d.prototype._importPublic=function(a,b){return a.x||a.y?("mont"===this.ec.curve.type?h(a.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||h(a.x&&a.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(a.x,a.y))):void(this.pub=this.ec.curve.decodePoint(a,b))},d.prototype.derive=function(a){return a.mul(this.priv).getX()},d.prototype.sign=function(a,b,c){return this.ec.sign(a,this,b,c)},d.prototype.verify=function(a,b){return this.ec.verify(a,b,this)},d.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}},{"../../elliptic":192,"bn.js":75}],201:[function(a,b,c){"use strict";function d(a,b){return a instanceof d?a:void(this._importDER(a,b)||(l(a.r&&a.s,"Signature without r or s"),this.r=new i(a.r,16),this.s=new i(a.s,16),void 0===a.recoveryParam?this.recoveryParam=null:this.recoveryParam=a.recoveryParam))}function e(){this.place=0}function f(a,b){var c=a[b.place++];if(!(128&c))return c;for(var d=15&c,e=0,f=0,g=b.place;f<d;f++,g++)e<<=8,e|=a[g];return b.place=g,e}function g(a){for(var b=0,c=a.length-1;!a[b]&&!(128&a[b+1])&&b<c;)b++;return 0===b?a:a.slice(b)}function h(a,b){if(b<128)return void a.push(b);var c=1+(Math.log(b)/Math.LN2>>>3);for(a.push(128|c);--c;)a.push(b>>>(c<<3)&255);a.push(b)}var i=a("bn.js"),j=a("../../elliptic"),k=j.utils,l=k.assert;b.exports=d,d.prototype._importDER=function(a,b){a=k.toArray(a,b);var c=new e;if(48!==a[c.place++])return!1;var d=f(a,c);if(d+c.place!==a.length)return!1;if(2!==a[c.place++])return!1;var g=f(a,c),h=a.slice(c.place,g+c.place);if(c.place+=g,2!==a[c.place++])return!1;var j=f(a,c);if(a.length!==j+c.place)return!1; |
|
@@ 12-12 (lines=1) @@
|
| 9 |
|
c._forceRed(this)},s.prototype.iadd=function(a,b){this._verify2(a,b);var c=a.iadd(b);return c.cmp(this.m)>=0&&c.isub(this.m),c},s.prototype.sub=function(a,b){this._verify2(a,b);var c=a.sub(b);return c.cmpn(0)<0&&c.iadd(this.m),c._forceRed(this)},s.prototype.isub=function(a,b){this._verify2(a,b);var c=a.isub(b);return c.cmpn(0)<0&&c.iadd(this.m),c},s.prototype.shl=function(a,b){return this._verify1(a),this.imod(a.ushln(b))},s.prototype.imul=function(a,b){return this._verify2(a,b),this.imod(a.imul(b))},s.prototype.mul=function(a,b){return this._verify2(a,b),this.imod(a.mul(b))},s.prototype.isqr=function(a){return this.imul(a,a.clone())},s.prototype.sqr=function(a){return this.mul(a,a)},s.prototype.sqrt=function(a){if(a.isZero())return a.clone();var b=this.m.andln(3);if(d(b%2===1),3===b){var c=this.m.add(new f(1)).iushrn(2);return this.pow(a,c)}for(var e=this.m.subn(1),g=0;!e.isZero()&&0===e.andln(1);)g++,e.iushrn(1);d(!e.isZero());var h=new f(1).toRed(this),i=h.redNeg(),j=this.m.subn(1).iushrn(1),k=this.m.bitLength();for(k=new f(2*k*k).toRed(this);0!==this.pow(k,j).cmp(i);)k.redIAdd(i);for(var l=this.pow(k,e),m=this.pow(a,e.addn(1).iushrn(1)),n=this.pow(a,e),o=g;0!==n.cmp(h);){for(var p=n,q=0;0!==p.cmp(h);q++)p=p.redSqr();d(q<o);var r=this.pow(l,new f(1).iushln(o-q-1));m=m.redMul(r),l=r.redSqr(),n=n.redMul(l),o=q}return m},s.prototype.invm=function(a){var b=a._invmp(this.m);return 0!==b.negative?(b.negative=0,this.imod(b).redNeg()):this.imod(b)},s.prototype.pow=function(a,b){if(b.isZero())return new f(1).toRed(this);if(0===b.cmpn(1))return a.clone();var c=4,d=new Array(1<<c);d[0]=new f(1).toRed(this),d[1]=a;for(var e=2;e<d.length;e++)d[e]=this.mul(d[e-1],a);var g=d[0],h=0,i=0,j=b.bitLength()%26;for(0===j&&(j=26),e=b.length-1;e>=0;e--){for(var k=b.words[e],l=j-1;l>=0;l--){var m=k>>l&1;g!==d[0]&&(g=this.sqr(g)),0!==m||0!==h?(h<<=1,h|=m,i++,(i===c||0===e&&0===l)&&(g=this.mul(g,d[h]),i=0,h=0)):i=0}j=26}return g},s.prototype.convertTo=function(a){var b=a.umod(this.m);return b===a?b.clone():b},s.prototype.convertFrom=function(a){var b=a.clone();return b.red=null,b},f.mont=function(a){return new t(a)},e(t,s),t.prototype.convertTo=function(a){return this.imod(a.ushln(this.shift))},t.prototype.convertFrom=function(a){var b=this.imod(a.mul(this.rinv));return b.red=null,b},t.prototype.imul=function(a,b){if(a.isZero()||b.isZero())return a.words[0]=0,a.length=1,a;var c=a.imul(b),d=c.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),e=c.isub(d).iushrn(this.shift),f=e;return e.cmp(this.m)>=0?f=e.isub(this.m):e.cmpn(0)<0&&(f=e.iadd(this.m)),f._forceRed(this)},t.prototype.mul=function(a,b){if(a.isZero()||b.isZero())return new f(0)._forceRed(this);var c=a.mul(b),d=c.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),e=c.isub(d).iushrn(this.shift),g=e;return e.cmp(this.m)>=0?g=e.isub(this.m):e.cmpn(0)<0&&(g=e.iadd(this.m)),g._forceRed(this)},t.prototype.invm=function(a){var b=this.imod(a._invmp(this.m).mul(this.r2));return b._forceRed(this)}}("undefined"==typeof b||b,this)},{buffer:77}],76:[function(a,b,c){function d(a){this.rand=a}var e;if(b.exports=function(a){return e||(e=new d(null)),e.generate(a)},b.exports.Rand=d,d.prototype.generate=function(a){return this._rand(a)},d.prototype._rand=function(a){if(this.rand.getBytes)return this.rand.getBytes(a);for(var b=new Uint8Array(a),c=0;c<b.length;c++)b[c]=this.rand.getByte();return b},"object"==typeof self)self.crypto&&self.crypto.getRandomValues?d.prototype._rand=function(a){var b=new Uint8Array(a);return self.crypto.getRandomValues(b),b}:self.msCrypto&&self.msCrypto.getRandomValues?d.prototype._rand=function(a){var b=new Uint8Array(a);return self.msCrypto.getRandomValues(b),b}:"object"==typeof window&&(d.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var f=a("crypto");if("function"!=typeof f.randomBytes)throw new Error("Not supported");d.prototype._rand=function(a){return f.randomBytes(a)}}catch(a){}},{crypto:77}],77:[function(a,b,c){},{}],78:[function(a,b,c){function d(a){Buffer.isBuffer(a)||(a=Buffer.from(a));for(var b=a.length/4|0,c=new Array(b),d=0;d<b;d++)c[d]=a.readUInt32BE(4*d);return c}function e(a){for(var b=0;b<a.length;a++)a[b]=0}function f(a,b,c,d,e){for(var f,g,h,i,j=c[0],k=c[1],l=c[2],m=c[3],n=a[0]^b[0],o=a[1]^b[1],p=a[2]^b[2],q=a[3]^b[3],r=4,s=1;s<e;s++)f=j[n>>>24]^k[o>>>16&255]^l[p>>>8&255]^m[255&q]^b[r++],g=j[o>>>24]^k[p>>>16&255]^l[q>>>8&255]^m[255&n]^b[r++],h=j[p>>>24]^k[q>>>16&255]^l[n>>>8&255]^m[255&o]^b[r++],i=j[q>>>24]^k[n>>>16&255]^l[o>>>8&255]^m[255&p]^b[r++],n=f,o=g,p=h,q=i;return f=(d[n>>>24]<<24|d[o>>>16&255]<<16|d[p>>>8&255]<<8|d[255&q])^b[r++],g=(d[o>>>24]<<24|d[p>>>16&255]<<16|d[q>>>8&255]<<8|d[255&n])^b[r++],h=(d[p>>>24]<<24|d[q>>>16&255]<<16|d[n>>>8&255]<<8|d[255&o])^b[r++],i=(d[q>>>24]<<24|d[n>>>16&255]<<16|d[o>>>8&255]<<8|d[255&p])^b[r++],f>>>=0,g>>>=0,h>>>=0,i>>>=0,[f,g,h,i]}function g(a){this._key=d(a),this._reset()}var Buffer=a("safe-buffer").Buffer,h=[0,1,2,4,8,16,32,64,128,27,54],i=function(){for(var a=new Array(256),b=0;b<256;b++)b<128?a[b]=b<<1:a[b]=b<<1^283;for(var c=[],d=[],e=[[],[],[],[]],f=[[],[],[],[]],g=0,h=0,i=0;i<256;++i){var j=h^h<<1^h<<2^h<<3^h<<4;j=j>>>8^255&j^99,c[g]=j,d[j]=g;var k=a[g],l=a[k],m=a[l],n=257*a[j]^16843008*j;e[0][g]=n<<24|n>>>8,e[1][g]=n<<16|n>>>16,e[2][g]=n<<8|n>>>24,e[3][g]=n,n=16843009*m^65537*l^257*k^16843008*g,f[0][j]=n<<24|n>>>8,f[1][j]=n<<16|n>>>16,f[2][j]=n<<8|n>>>24,f[3][j]=n,0===g?g=h=1:(g=k^a[a[a[m^k]]],h^=a[a[h]])}return{SBOX:c,INV_SBOX:d,SUB_MIX:e,INV_SUB_MIX:f}}();g.blockSize=16,g.keySize=32,g.prototype.blockSize=g.blockSize,g.prototype.keySize=g.keySize,g.prototype._reset=function(){for(var a=this._key,b=a.length,c=b+6,d=4*(c+1),e=[],f=0;f<b;f++)e[f]=a[f];for(f=b;f<d;f++){var g=e[f-1];f%b===0?(g=g<<8|g>>>24,g=i.SBOX[g>>>24]<<24|i.SBOX[g>>>16&255]<<16|i.SBOX[g>>>8&255]<<8|i.SBOX[255&g],g^=h[f/b|0]<<24):b>6&&f%b===4&&(g=i.SBOX[g>>>24]<<24|i.SBOX[g>>>16&255]<<16|i.SBOX[g>>>8&255]<<8|i.SBOX[255&g]),e[f]=e[f-b]^g}for(var j=[],k=0;k<d;k++){var l=d-k,m=e[l-(k%4?0:4)];k<4||l<=4?j[k]=m:j[k]=i.INV_SUB_MIX[0][i.SBOX[m>>>24]]^i.INV_SUB_MIX[1][i.SBOX[m>>>16&255]]^i.INV_SUB_MIX[2][i.SBOX[m>>>8&255]]^i.INV_SUB_MIX[3][i.SBOX[255&m]]}this._nRounds=c,this._keySchedule=e,this._invKeySchedule=j},g.prototype.encryptBlockRaw=function(a){return a=d(a),f(a,this._keySchedule,i.SUB_MIX,i.SBOX,this._nRounds)},g.prototype.encryptBlock=function(a){var b=this.encryptBlockRaw(a),c=Buffer.allocUnsafe(16);return c.writeUInt32BE(b[0],0),c.writeUInt32BE(b[1],4),c.writeUInt32BE(b[2],8),c.writeUInt32BE(b[3],12),c},g.prototype.decryptBlock=function(a){a=d(a);var b=a[1];a[1]=a[3],a[3]=b;var c=f(a,this._invKeySchedule,i.INV_SUB_MIX,i.INV_SBOX,this._nRounds),e=Buffer.allocUnsafe(16);return e.writeUInt32BE(c[0],0),e.writeUInt32BE(c[3],4),e.writeUInt32BE(c[2],8),e.writeUInt32BE(c[1],12),e},g.prototype.scrub=function(){e(this._keySchedule),e(this._invKeySchedule),e(this._key)},b.exports.AES=g},{"safe-buffer":288}],79:[function(a,b,c){function d(a,b){var c=0;a.length!==b.length&&c++;for(var d=Math.min(a.length,b.length),e=0;e<d;++e)c+=a[e]^b[e];return c}function e(a,b,c){if(12===b.length)return a._finID=Buffer.concat([b,Buffer.from([0,0,0,1])]),Buffer.concat([b,Buffer.from([0,0,0,2])]);var d=new j(c),e=b.length,f=e%16;d.update(b),f&&(f=16-f,d.update(Buffer.alloc(f,0))),d.update(Buffer.alloc(8,0));var g=8*e,h=Buffer.alloc(8);h.writeUIntBE(g,0,8),d.update(h),a._finID=d.state;var i=Buffer.from(a._finID);return l(i),i}function f(a,b,c,d){h.call(this);var f=Buffer.alloc(4,0);this._cipher=new g.AES(b);var i=this._cipher.encryptBlock(f);this._ghash=new j(i),c=e(this,c,i),this._prev=Buffer.from(c),this._cache=Buffer.allocUnsafe(0),this._secCache=Buffer.allocUnsafe(0),this._decrypt=d,this._alen=0,this._len=0,this._mode=a,this._authTag=null,this._called=!1}var g=a("./aes"),Buffer=a("safe-buffer").Buffer,h=a("cipher-base"),i=a("inherits"),j=a("./ghash"),k=a("buffer-xor"),l=a("./incr32");i(f,h),f.prototype._update=function(a){if(!this._called&&this._alen){var b=16-this._alen%16;b<16&&(b=Buffer.alloc(b,0),this._ghash.update(b))}this._called=!0;var c=this._mode.encrypt(this,a);return this._decrypt?this._ghash.update(a):this._ghash.update(c),this._len+=a.length,c},f.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var a=k(this._ghash.final(8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt&&d(a,this._authTag))throw new Error("Unsupported state or unable to authenticate data");this._authTag=a,this._cipher.scrub()},f.prototype.getAuthTag=function(){if(this._decrypt||!Buffer.isBuffer(this._authTag))throw new Error("Attempting to get auth tag in unsupported state");return this._authTag},f.prototype.setAuthTag=function(a){if(!this._decrypt)throw new Error("Attempting to set auth tag in unsupported state");this._authTag=a},f.prototype.setAAD=function(a){if(this._called)throw new Error("Attempting to set AAD in unsupported state");this._ghash.update(a),this._alen+=a.length},b.exports=f},{"./aes":78,"./ghash":83,"./incr32":84,"buffer-xor":103,"cipher-base":106,inherits:226,"safe-buffer":288}],80:[function(a,b,c){function d(){return Object.keys(g)}var e=a("./encrypter"),f=a("./decrypter"),g=a("./modes/list.json");c.createCipher=c.Cipher=e.createCipher,c.createCipheriv=c.Cipheriv=e.createCipheriv,c.createDecipher=c.Decipher=f.createDecipher,c.createDecipheriv=c.Decipheriv=f.createDecipheriv,c.listCiphers=c.getCiphers=d},{"./decrypter":81,"./encrypter":82,"./modes/list.json":92}],81:[function(a,b,c){function d(a,b,c){l.call(this),this._cache=new e,this._last=void 0,this._cipher=new m.AES(b),this._prev=Buffer.from(c),this._mode=a,this._autopadding=!0}function e(){this.cache=Buffer.allocUnsafe(0)}function f(a){for(var b=a[15],c=-1;++c<b;)if(a[c+(16-b)]!==b)throw new Error("unable to decrypt data");if(16!==b)return a.slice(0,16-b)}function g(a,b,c){var e=j[a.toLowerCase()];if(!e)throw new TypeError("invalid suite type");if("string"==typeof c&&(c=Buffer.from(c)),"GCM"!==e.mode&&c.length!==e.iv)throw new TypeError("invalid iv length "+c.length);if("string"==typeof b&&(b=Buffer.from(b)),b.length!==e.key/8)throw new TypeError("invalid key length "+b.length);return"stream"===e.type?new k(e.module,b,c,!0):"auth"===e.type?new i(e.module,b,c,!0):new d(e.module,b,c)}function h(a,b){var c=j[a.toLowerCase()];if(!c)throw new TypeError("invalid suite type");var d=n(b,!1,c.key,c.iv);return g(a,d.key,d.iv)}var i=a("./authCipher"),Buffer=a("safe-buffer").Buffer,j=a("./modes"),k=a("./streamCipher"),l=a("cipher-base"),m=a("./aes"),n=a("evp_bytestokey"),o=a("inherits");o(d,l),d.prototype._update=function(a){this._cache.add(a);for(var b,c,d=[];b=this._cache.get(this._autopadding);)c=this._mode.decrypt(this,b),d.push(c);return Buffer.concat(d)},d.prototype._final=function(){var a=this._cache.flush();if(this._autopadding)return f(this._mode.decrypt(this,a));if(a)throw new Error("data not multiple of block length")},d.prototype.setAutoPadding=function(a){return this._autopadding=!!a,this},e.prototype.add=function(a){this.cache=Buffer.concat([this.cache,a])},e.prototype.get=function(a){var b;if(a){if(this.cache.length>16)return b=this.cache.slice(0,16),this.cache=this.cache.slice(16),b}else if(this.cache.length>=16)return b=this.cache.slice(0,16),this.cache=this.cache.slice(16),b;return null},e.prototype.flush=function(){if(this.cache.length)return this.cache},c.createDecipher=h,c.createDecipheriv=g},{"./aes":78,"./authCipher":79,"./modes":91,"./streamCipher":94,"cipher-base":106,evp_bytestokey:209,inherits:226,"safe-buffer":288}],82:[function(a,b,c){function d(a,b,c){k.call(this),this._cache=new e,this._cipher=new l.AES(b),this._prev=Buffer.from(c),this._mode=a,this._autopadding=!0}function e(){this.cache=Buffer.allocUnsafe(0)}function f(a,b,c){var e=h[a.toLowerCase()];if(!e)throw new TypeError("invalid suite type");if("string"==typeof b&&(b=Buffer.from(b)),b.length!==e.key/8)throw new TypeError("invalid key length "+b.length);if("string"==typeof c&&(c=Buffer.from(c)),"GCM"!==e.mode&&c.length!==e.iv)throw new TypeError("invalid iv length "+c.length);return"stream"===e.type?new j(e.module,b,c):"auth"===e.type?new i(e.module,b,c):new d(e.module,b,c)}function g(a,b){var c=h[a.toLowerCase()];if(!c)throw new TypeError("invalid suite type");var d=m(b,!1,c.key,c.iv);return f(a,d.key,d.iv)}var h=a("./modes"),i=a("./authCipher"),Buffer=a("safe-buffer").Buffer,j=a("./streamCipher"),k=a("cipher-base"),l=a("./aes"),m=a("evp_bytestokey"),n=a("inherits");n(d,k),d.prototype._update=function(a){this._cache.add(a);for(var b,c,d=[];b=this._cache.get();)c=this._mode.encrypt(this,b),d.push(c);return Buffer.concat(d)};var o=Buffer.alloc(16,16);d.prototype._final=function(){var a=this._cache.flush();if(this._autopadding)return a=this._mode.encrypt(this,a),this._cipher.scrub(),a;if(!a.equals(o))throw this._cipher.scrub(),new Error("data not multiple of block length")},d.prototype.setAutoPadding=function(a){return this._autopadding=!!a,this},e.prototype.add=function(a){this.cache=Buffer.concat([this.cache,a])},e.prototype.get=function(){if(this.cache.length>15){var a=this.cache.slice(0,16);return this.cache=this.cache.slice(16),a}return null},e.prototype.flush=function(){for(var a=16-this.cache.length,b=Buffer.allocUnsafe(a),c=-1;++c<a;)b.writeUInt8(a,c);return Buffer.concat([this.cache,b])},c.createCipheriv=f,c.createCipher=g},{"./aes":78,"./authCipher":79,"./modes":91,"./streamCipher":94,"cipher-base":106,evp_bytestokey:209,inherits:226,"safe-buffer":288}],83:[function(a,b,c){function d(a){return[a.readUInt32BE(0),a.readUInt32BE(4),a.readUInt32BE(8),a.readUInt32BE(12)]}function e(a){var b=Buffer.allocUnsafe(16);return b.writeUInt32BE(a[0]>>>0,0),b.writeUInt32BE(a[1]>>>0,4),b.writeUInt32BE(a[2]>>>0,8),b.writeUInt32BE(a[3]>>>0,12),b}function f(a){this.h=a,this.state=Buffer.alloc(16,0),this.cache=Buffer.allocUnsafe(0)}var Buffer=a("safe-buffer").Buffer,g=Buffer.alloc(16,0);f.prototype.ghash=function(a){for(var b=-1;++b<a.length;)this.state[b]^=a[b];this._multiply()},f.prototype._multiply=function(){for(var a,b,c,f=d(this.h),g=[0,0,0,0],h=-1;++h<128;){for(b=0!==(this.state[~~(h/8)]&1<<7-h%8),b&&(g[0]^=f[0],g[1]^=f[1],g[2]^=f[2],g[3]^=f[3]),c=0!==(1&f[3]),a=3;a>0;a--)f[a]=f[a]>>>1|(1&f[a-1])<<31;f[0]=f[0]>>>1,c&&(f[0]=f[0]^225<<24)}this.state=e(g)},f.prototype.update=function(a){this.cache=Buffer.concat([this.cache,a]);for(var b;this.cache.length>=16;)b=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(b)},f.prototype.final=function(a,b){return this.cache.length&&this.ghash(Buffer.concat([this.cache,g],16)),this.ghash(e([0,a,0,b])),this.state},b.exports=f},{"safe-buffer":288}],84:[function(a,b,c){function d(a){for(var b,c=a.length;c--;){if(b=a.readUInt8(c),255!==b){b++,a.writeUInt8(b,c);break}a.writeUInt8(0,c)}}b.exports=d},{}],85:[function(a,b,c){var d=a("buffer-xor");c.encrypt=function(a,b){var c=d(b,a._prev);return a._prev=a._cipher.encryptBlock(c),a._prev},c.decrypt=function(a,b){var c=a._prev;a._prev=b;var e=a._cipher.decryptBlock(b);return d(e,c)}},{"buffer-xor":103}],86:[function(a,b,c){function d(a,b,c){var d=b.length,f=e(b,a._cache);return a._cache=a._cache.slice(d),a._prev=Buffer.concat([a._prev,c?b:f]),f}var Buffer=a("safe-buffer").Buffer,e=a("buffer-xor");c.encrypt=function(a,b,c){for(var e,f=Buffer.allocUnsafe(0);b.length;){if(0===a._cache.length&&(a._cache=a._cipher.encryptBlock(a._prev),a._prev=Buffer.allocUnsafe(0)),!(a._cache.length<=b.length)){f=Buffer.concat([f,d(a,b,c)]);break}e=a._cache.length,f=Buffer.concat([f,d(a,b.slice(0,e),c)]),b=b.slice(e)}return f}},{"buffer-xor":103,"safe-buffer":288}],87:[function(a,b,c){function d(a,b,c){for(var d,f,g,h=-1,i=8,j=0;++h<i;)d=a._cipher.encryptBlock(a._prev),f=b&1<<7-h?128:0,g=d[0]^f,j+=(128&g)>>h%8,a._prev=e(a._prev,c?f:g);return j}function e(a,b){var c=a.length,d=-1,e=Buffer.allocUnsafe(a.length);for(a=Buffer.concat([a,Buffer.from([b])]);++d<c;)e[d]=a[d]<<1|a[d+1]>>7;return e}var Buffer=a("safe-buffer").Buffer;c.encrypt=function(a,b,c){for(var e=b.length,f=Buffer.allocUnsafe(e),g=-1;++g<e;)f[g]=d(a,b[g],c);return f}},{"safe-buffer":288}],88:[function(a,b,c){function d(a,b,c){var d=a._cipher.encryptBlock(a._prev),e=d[0]^b;return a._prev=Buffer.concat([a._prev.slice(1),Buffer.from([c?b:e])]),e}var Buffer=a("safe-buffer").Buffer;c.encrypt=function(a,b,c){for(var e=b.length,f=Buffer.allocUnsafe(e),g=-1;++g<e;)f[g]=d(a,b[g],c);return f}},{"safe-buffer":288}],89:[function(a,b,c){function d(a){var b=a._cipher.encryptBlockRaw(a._prev);return f(a._prev),b}var e=a("buffer-xor"),Buffer=a("safe-buffer").Buffer,f=a("../incr32"),g=16;c.encrypt=function(a,b){var c=Math.ceil(b.length/g),f=a._cache.length;a._cache=Buffer.concat([a._cache,Buffer.allocUnsafe(c*g)]);for(var h=0;h<c;h++){var i=d(a),j=f+h*g;a._cache.writeUInt32BE(i[0],j+0),a._cache.writeUInt32BE(i[1],j+4),a._cache.writeUInt32BE(i[2],j+8),a._cache.writeUInt32BE(i[3],j+12)}var k=a._cache.slice(0,b.length);return a._cache=a._cache.slice(b.length),e(b,k)}},{"../incr32":84,"buffer-xor":103,"safe-buffer":288}],90:[function(a,b,c){c.encrypt=function(a,b){return a._cipher.encryptBlock(b)},c.decrypt=function(a,b){return a._cipher.decryptBlock(b)}},{}],91:[function(a,b,c){var d={ECB:a("./ecb"),CBC:a("./cbc"),CFB:a("./cfb"),CFB8:a("./cfb8"),CFB1:a("./cfb1"),OFB:a("./ofb"),CTR:a("./ctr"),GCM:a("./ctr")},e=a("./list.json");for(var f in e)e[f].module=d[e[f].mode];b.exports=e},{"./cbc":85,"./cfb":86,"./cfb1":87,"./cfb8":88,"./ctr":89,"./ecb":90,"./list.json":92,"./ofb":93}],92:[function(a,b,c){b.exports={"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"}}},{}],93:[function(a,b,c){(function(Buffer){function b(a){return a._prev=a._cipher.encryptBlock(a._prev),a._prev}var d=a("buffer-xor");c.encrypt=function(a,c){for(;a._cache.length<c.length;)a._cache=Buffer.concat([a._cache,b(a)]);var e=a._cache.slice(0,c.length);return a._cache=a._cache.slice(c.length),d(c,e)}}).call(this,a("buffer").Buffer)},{buffer:104,"buffer-xor":103}],94:[function(a,b,c){function d(a,b,c,d){f.call(this),this._cipher=new e.AES(b),this._prev=Buffer.from(c),this._cache=Buffer.allocUnsafe(0),this._secCache=Buffer.allocUnsafe(0),this._decrypt=d,this._mode=a}var e=a("./aes"),Buffer=a("safe-buffer").Buffer,f=a("cipher-base"),g=a("inherits");g(d,f),d.prototype._update=function(a){return this._mode.encrypt(this,a,this._decrypt)},d.prototype._final=function(){this._cipher.scrub()},b.exports=d},{"./aes":78,"cipher-base":106,inherits:226,"safe-buffer":288}],95:[function(a,b,c){function d(a,b){var c,d;if(a=a.toLowerCase(),m[a])c=m[a].key,d=m[a].iv;else{if(!l[a])throw new TypeError("invalid suite type");c=8*l[a].key,d=l[a].iv}var e=i(b,!1,c,d);return f(a,e.key,e.iv)}function e(a,b){var c,d;if(a=a.toLowerCase(),m[a])c=m[a].key,d=m[a].iv;else{if(!l[a])throw new TypeError("invalid suite type");c=8*l[a].key,d=l[a].iv}var e=i(b,!1,c,d);return g(a,e.key,e.iv)}function f(a,b,c){if(a=a.toLowerCase(),m[a])return j.createCipheriv(a,b,c);if(l[a])return new k({key:b,iv:c,mode:a});throw new TypeError("invalid suite type")}function g(a,b,c){if(a=a.toLowerCase(),m[a])return j.createDecipheriv(a,b,c);if(l[a])return new k({key:b,iv:c,mode:a,decrypt:!0});throw new TypeError("invalid suite type")}function h(){return Object.keys(l).concat(j.getCiphers())}var i=a("evp_bytestokey"),j=a("browserify-aes/browser"),k=a("browserify-des"),l=a("browserify-des/modes"),m=a("browserify-aes/modes");c.createCipher=c.Cipher=d,c.createCipheriv=c.Cipheriv=f,c.createDecipher=c.Decipher=e,c.createDecipheriv=c.Decipheriv=g,c.listCiphers=c.getCiphers=h},{"browserify-aes/browser":80,"browserify-aes/modes":91,"browserify-des":96,"browserify-des/modes":97,evp_bytestokey:209}],96:[function(a,b,c){(function(Buffer){function c(a){d.call(this);var b,c=a.mode.toLowerCase(),e=g[c];b=a.decrypt?"decrypt":"encrypt";var f=a.key;"des-ede"!==c&&"des-ede-cbc"!==c||(f=Buffer.concat([f,f.slice(0,8)]));var h=a.iv;this._des=e.create({key:f,iv:h,type:b})}var d=a("cipher-base"),e=a("des.js"),f=a("inherits"),g={"des-ede3-cbc":e.CBC.instantiate(e.EDE),"des-ede3":e.EDE,"des-ede-cbc":e.CBC.instantiate(e.EDE),"des-ede":e.EDE,"des-cbc":e.CBC.instantiate(e.DES),"des-ecb":e.DES};g.des=g["des-cbc"],g.des3=g["des-ede3-cbc"],b.exports=c,f(c,d),c.prototype._update=function(a){return new Buffer(this._des.update(a))},c.prototype._final=function(){return new Buffer(this._des.final())}}).call(this,a("buffer").Buffer)},{buffer:104,"cipher-base":106,"des.js":177,inherits:226}],97:[function(a,b,c){c["des-ecb"]={key:8,iv:0},c["des-cbc"]=c.des={key:8,iv:8},c["des-ede3-cbc"]=c.des3={key:24,iv:8},c["des-ede3"]={key:24,iv:0},c["des-ede-cbc"]={key:16,iv:8},c["des-ede"]={key:16,iv:0}},{}],98:[function(a,b,c){arguments[4][73][0].apply(c,arguments)},{"base-x":21,dup:73}],99:[function(a,b,c){(function(Buffer){"use strict";var c=a("bs58");b.exports=function(a){function b(b){var d=a(b);return c.encode(Buffer.concat([b,d],b.length+4))}function d(b){var c=b.slice(0,-4),d=b.slice(-4),e=a(c);if(!(d[0]^e[0]|d[1]^e[1]|d[2]^e[2]|d[3]^e[3]))return c}function e(a){var b=c.decodeUnsafe(a);if(b)return d(b)}function f(b){var e=c.decode(b),f=d(e,a);if(!f)throw new Error("Invalid checksum");return f}return{encode:b,decode:f,decodeUnsafe:e}}}).call(this,a("buffer").Buffer)},{bs58:98,buffer:104}],100:[function(a,b,c){"use strict";function d(a){var b=e("sha256").update(a).digest();return e("sha256").update(b).digest()}var e=a("create-hash"),f=a("./base");b.exports=f(d)},{"./base":99,"create-hash":110}],101:[function(a,b,c){(function(Buffer){"use strict";b.exports=function(a,b){if(!Buffer.isBuffer(a)||!Buffer.isBuffer(b))throw new TypeError("Arguments must be Buffers");if(a===b)return!0;if("function"==typeof a.equals)return a.equals(b);if(a.length!==b.length)return!1;for(var c=0;c<a.length;c++)if(a[c]!==b[c])return!1;return!0}}).call(this,{isBuffer:a("../is-buffer/index.js")})},{"../is-buffer/index.js":227}],102:[function(a,b,c){(function(Buffer){b.exports=function(a){for(var b=new Buffer(a.length),c=0,d=a.length-1;c<=d;++c,--d)b[c]=a[d],b[d]=a[c];return b}}).call(this,a("buffer").Buffer)},{buffer:104}],103:[function(a,b,c){(function(Buffer){b.exports=function(a,b){for(var c=Math.min(a.length,b.length),d=new Buffer(c),e=0;e<c;++e)d[e]=a[e]^b[e];return d}}).call(this,a("buffer").Buffer)},{buffer:104}],104:[function(a,b,c){"use strict";function d(){try{var a=new Uint8Array(1);return a.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===a.foo()}catch(a){return!1}}function e(a){if(a>Y)throw new RangeError("Invalid typed array length");var b=new Uint8Array(a);return b.__proto__=Buffer.prototype,b}function Buffer(a,b,c){if("number"==typeof a){if("string"==typeof b)throw new Error("If encoding is specified then the first argument must be a string");return i(a)}return f(a,b,c)}function f(a,b,c){if("number"==typeof a)throw new TypeError('"value" argument must not be a number');return T(a)?l(a,b,c):"string"==typeof a?j(a,b):m(a)}function g(a){if("number"!=typeof a)throw new TypeError('"size" argument must be a number');if(a<0)throw new RangeError('"size" argument must not be negative')}function h(a,b,c){return g(a),a<=0?e(a):void 0!==b?"string"==typeof c?e(a).fill(b,c):e(a).fill(b):e(a)}function i(a){return g(a),e(a<0?0:0|n(a))}function j(a,b){if("string"==typeof b&&""!==b||(b="utf8"),!Buffer.isEncoding(b))throw new TypeError('"encoding" must be a valid string encoding');var c=0|p(a,b),d=e(c),f=d.write(a,b);return f!==c&&(d=d.slice(0,f)),d}function k(a){for(var b=a.length<0?0:0|n(a.length),c=e(b),d=0;d<b;d+=1)c[d]=255&a[d];return c}function l(a,b,c){if(b<0||a.byteLength<b)throw new RangeError("'offset' is out of bounds");if(a.byteLength<b+(c||0))throw new RangeError("'length' is out of bounds");var d;return d=void 0===b&&void 0===c?new Uint8Array(a):void 0===c?new Uint8Array(a,b):new Uint8Array(a,b,c),d.__proto__=Buffer.prototype,d}function m(a){if(Buffer.isBuffer(a)){var b=0|n(a.length),c=e(b);return 0===c.length?c:(a.copy(c,0,0,b),c)}if(a){if(U(a)||"length"in a)return"number"!=typeof a.length||V(a.length)?e(0):k(a);if("Buffer"===a.type&&Array.isArray(a.data))return k(a.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function n(a){if(a>=Y)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Y.toString(16)+" bytes");return 0|a}function o(a){return+a!=a&&(a=0),Buffer.alloc(+a)}function p(a,b){if(Buffer.isBuffer(a))return a.length;if(U(a)||T(a))return a.byteLength;"string"!=typeof a&&(a=""+a);var c=a.length;if(0===c)return 0;for(var d=!1;;)switch(b){case"ascii":case"latin1":case"binary":return c;case"utf8":case"utf-8":case void 0:return O(a).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*c;case"hex":return c>>>1;case"base64":return R(a).length;default:if(d)return O(a).length;b=(""+b).toLowerCase(),d=!0}}function q(a,b,c){var d=!1;if((void 0===b||b<0)&&(b=0),b>this.length)return"";if((void 0===c||c>this.length)&&(c=this.length),c<=0)return"";if(c>>>=0,b>>>=0,c<=b)return"";for(a||(a="utf8");;)switch(a){case"hex":return F(this,b,c);case"utf8":case"utf-8":return B(this,b,c);case"ascii":return D(this,b,c);case"latin1":case"binary":return E(this,b,c);case"base64":return A(this,b,c);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return G(this,b,c);default:if(d)throw new TypeError("Unknown encoding: "+a);a=(a+"").toLowerCase(),d=!0}}function r(a,b,c){var d=a[b];a[b]=a[c],a[c]=d}function s(a,b,c,d,e){if(0===a.length)return-1;if("string"==typeof c?(d=c,c=0):c>2147483647?c=2147483647:c<-2147483648&&(c=-2147483648),c=+c,V(c)&&(c=e?0:a.length-1),c<0&&(c=a.length+c),c>=a.length){if(e)return-1;c=a.length-1}else if(c<0){if(!e)return-1;c=0}if("string"==typeof b&&(b=Buffer.from(b,d)),Buffer.isBuffer(b))return 0===b.length?-1:t(a,b,c,d,e);if("number"==typeof b)return b&=255,"function"==typeof Uint8Array.prototype.indexOf?e?Uint8Array.prototype.indexOf.call(a,b,c):Uint8Array.prototype.lastIndexOf.call(a,b,c):t(a,[b],c,d,e);throw new TypeError("val must be string, number or Buffer")}function t(a,b,c,d,e){function f(a,b){return 1===g?a[b]:a.readUInt16BE(b*g)}var g=1,h=a.length,i=b.length;if(void 0!==d&&(d=String(d).toLowerCase(),"ucs2"===d||"ucs-2"===d||"utf16le"===d||"utf-16le"===d)){if(a.length<2||b.length<2)return-1;g=2,h/=2,i/=2,c/=2}var j;if(e){var k=-1;for(j=c;j<h;j++)if(f(a,j)===f(b,k===-1?0:j-k)){if(k===-1&&(k=j),j-k+1===i)return k*g}else k!==-1&&(j-=j-k),k=-1}else for(c+i>h&&(c=h-i),j=c;j>=0;j--){for(var l=!0,m=0;m<i;m++)if(f(a,j+m)!==f(b,m)){l=!1;break}if(l)return j}return-1}function u(a,b,c,d){c=Number(c)||0;var e=a.length-c;d?(d=Number(d),d>e&&(d=e)):d=e;var f=b.length;if(f%2!==0)throw new TypeError("Invalid hex string");d>f/2&&(d=f/2);for(var g=0;g<d;++g){var h=parseInt(b.substr(2*g,2),16);if(V(h))return g;a[c+g]=h}return g}function v(a,b,c,d){return S(O(b,a.length-c),a,c,d)}function w(a,b,c,d){return S(P(b),a,c,d)}function x(a,b,c,d){return w(a,b,c,d)}function y(a,b,c,d){return S(R(b),a,c,d)}function z(a,b,c,d){return S(Q(b,a.length-c),a,c,d)}function A(a,b,c){return 0===b&&c===a.length?W.fromByteArray(a):W.fromByteArray(a.slice(b,c))}function B(a,b,c){c=Math.min(a.length,c);for(var d=[],e=b;e<c;){var f=a[e],g=null,h=f>239?4:f>223?3:f>191?2:1;if(e+h<=c){var i,j,k,l;switch(h){case 1:f<128&&(g=f);break;case 2:i=a[e+1],128===(192&i)&&(l=(31&f)<<6|63&i,l>127&&(g=l));break;case 3:i=a[e+1],j=a[e+2],128===(192&i)&&128===(192&j)&&(l=(15&f)<<12|(63&i)<<6|63&j,l>2047&&(l<55296||l>57343)&&(g=l));break;case 4:i=a[e+1],j=a[e+2],k=a[e+3],128===(192&i)&&128===(192&j)&&128===(192&k)&&(l=(15&f)<<18|(63&i)<<12|(63&j)<<6|63&k,l>65535&&l<1114112&&(g=l))}}null===g?(g=65533,h=1):g>65535&&(g-=65536,d.push(g>>>10&1023|55296),g=56320|1023&g),d.push(g),e+=h}return C(d)}function C(a){var b=a.length;if(b<=Z)return String.fromCharCode.apply(String,a);for(var c="",d=0;d<b;)c+=String.fromCharCode.apply(String,a.slice(d,d+=Z));return c}function D(a,b,c){var d="";c=Math.min(a.length,c);for(var e=b;e<c;++e)d+=String.fromCharCode(127&a[e]);return d}function E(a,b,c){var d="";c=Math.min(a.length,c);for(var e=b;e<c;++e)d+=String.fromCharCode(a[e]);return d}function F(a,b,c){var d=a.length;(!b||b<0)&&(b=0),(!c||c<0||c>d)&&(c=d);for(var e="",f=b;f<c;++f)e+=N(a[f]);return e}function G(a,b,c){for(var d=a.slice(b,c),e="",f=0;f<d.length;f+=2)e+=String.fromCharCode(d[f]+256*d[f+1]);return e}function H(a,b,c){if(a%1!==0||a<0)throw new RangeError("offset is not uint");if(a+b>c)throw new RangeError("Trying to access beyond buffer length")}function I(a,b,c,d,e,f){if(!Buffer.isBuffer(a))throw new TypeError('"buffer" argument must be a Buffer instance');if(b>e||b<f)throw new RangeError('"value" argument is out of bounds');if(c+d>a.length)throw new RangeError("Index out of range")}function J(a,b,c,d,e,f){if(c+d>a.length)throw new RangeError("Index out of range");if(c<0)throw new RangeError("Index out of range")}function K(a,b,c,d,e){return b=+b,c>>>=0,e||J(a,b,c,4,3.4028234663852886e38,-3.4028234663852886e38),X.write(a,b,c,d,23,4),c+4}function L(a,b,c,d,e){return b=+b,c>>>=0,e||J(a,b,c,8,1.7976931348623157e308,-1.7976931348623157e308),X.write(a,b,c,d,52,8),c+8}function M(a){if(a=a.trim().replace($,""),a.length<2)return"";for(;a.length%4!==0;)a+="=";return a}function N(a){return a<16?"0"+a.toString(16):a.toString(16)}function O(a,b){b=b||1/0;for(var c,d=a.length,e=null,f=[],g=0;g<d;++g){if(c=a.charCodeAt(g),c>55295&&c<57344){if(!e){if(c>56319){(b-=3)>-1&&f.push(239,191,189);continue}if(g+1===d){(b-=3)>-1&&f.push(239,191,189);continue}e=c;continue}if(c<56320){(b-=3)>-1&&f.push(239,191,189),e=c;continue}c=(e-55296<<10|c-56320)+65536}else e&&(b-=3)>-1&&f.push(239,191,189);if(e=null,c<128){if((b-=1)<0)break;f.push(c)}else if(c<2048){if((b-=2)<0)break;f.push(c>>6|192,63&c|128)}else if(c<65536){if((b-=3)<0)break;f.push(c>>12|224,c>>6&63|128,63&c|128)}else{if(!(c<1114112))throw new Error("Invalid code point");if((b-=4)<0)break;f.push(c>>18|240,c>>12&63|128,c>>6&63|128,63&c|128)}}return f}function P(a){for(var b=[],c=0;c<a.length;++c)b.push(255&a.charCodeAt(c));return b}function Q(a,b){for(var c,d,e,f=[],g=0;g<a.length&&!((b-=2)<0);++g)c=a.charCodeAt(g),d=c>>8,e=c%256,f.push(e),f.push(d); |
| 10 |
|
return f}function R(a){return W.toByteArray(M(a))}function S(a,b,c,d){for(var e=0;e<d&&!(e+c>=b.length||e>=a.length);++e)b[e+c]=a[e];return e}function T(a){return a instanceof ArrayBuffer||null!=a&&null!=a.constructor&&"ArrayBuffer"===a.constructor.name&&"number"==typeof a.byteLength}function U(a){return"function"==typeof ArrayBuffer.isView&&ArrayBuffer.isView(a)}function V(a){return a!==a}var W=a("base64-js"),X=a("ieee754");c.Buffer=Buffer,c.SlowBuffer=o,c.INSPECT_MAX_BYTES=50;var Y=2147483647;c.kMaxLength=Y,Buffer.TYPED_ARRAY_SUPPORT=d(),Buffer.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),"undefined"!=typeof Symbol&&Symbol.species&&Buffer[Symbol.species]===Buffer&&Object.defineProperty(Buffer,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),Buffer.poolSize=8192,Buffer.from=function(a,b,c){return f(a,b,c)},Buffer.prototype.__proto__=Uint8Array.prototype,Buffer.__proto__=Uint8Array,Buffer.alloc=function(a,b,c){return h(a,b,c)},Buffer.allocUnsafe=function(a){return i(a)},Buffer.allocUnsafeSlow=function(a){return i(a)},Buffer.isBuffer=function(a){return null!=a&&a._isBuffer===!0},Buffer.compare=function(a,b){if(!Buffer.isBuffer(a)||!Buffer.isBuffer(b))throw new TypeError("Arguments must be Buffers");if(a===b)return 0;for(var c=a.length,d=b.length,e=0,f=Math.min(c,d);e<f;++e)if(a[e]!==b[e]){c=a[e],d=b[e];break}return c<d?-1:d<c?1:0},Buffer.isEncoding=function(a){switch(String(a).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},Buffer.concat=function(a,b){if(!Array.isArray(a))throw new TypeError('"list" argument must be an Array of Buffers');if(0===a.length)return Buffer.alloc(0);var c;if(void 0===b)for(b=0,c=0;c<a.length;++c)b+=a[c].length;var d=Buffer.allocUnsafe(b),e=0;for(c=0;c<a.length;++c){var f=a[c];if(!Buffer.isBuffer(f))throw new TypeError('"list" argument must be an Array of Buffers');f.copy(d,e),e+=f.length}return d},Buffer.byteLength=p,Buffer.prototype._isBuffer=!0,Buffer.prototype.swap16=function(){var a=this.length;if(a%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var b=0;b<a;b+=2)r(this,b,b+1);return this},Buffer.prototype.swap32=function(){var a=this.length;if(a%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var b=0;b<a;b+=4)r(this,b,b+3),r(this,b+1,b+2);return this},Buffer.prototype.swap64=function(){var a=this.length;if(a%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var b=0;b<a;b+=8)r(this,b,b+7),r(this,b+1,b+6),r(this,b+2,b+5),r(this,b+3,b+4);return this},Buffer.prototype.toString=function(){var a=this.length;return 0===a?"":0===arguments.length?B(this,0,a):q.apply(this,arguments)},Buffer.prototype.equals=function(a){if(!Buffer.isBuffer(a))throw new TypeError("Argument must be a Buffer");return this===a||0===Buffer.compare(this,a)},Buffer.prototype.inspect=function(){var a="",b=c.INSPECT_MAX_BYTES;return this.length>0&&(a=this.toString("hex",0,b).match(/.{2}/g).join(" "),this.length>b&&(a+=" ... ")),"<Buffer "+a+">"},Buffer.prototype.compare=function(a,b,c,d,e){if(!Buffer.isBuffer(a))throw new TypeError("Argument must be a Buffer");if(void 0===b&&(b=0),void 0===c&&(c=a?a.length:0),void 0===d&&(d=0),void 0===e&&(e=this.length),b<0||c>a.length||d<0||e>this.length)throw new RangeError("out of range index");if(d>=e&&b>=c)return 0;if(d>=e)return-1;if(b>=c)return 1;if(b>>>=0,c>>>=0,d>>>=0,e>>>=0,this===a)return 0;for(var f=e-d,g=c-b,h=Math.min(f,g),i=this.slice(d,e),j=a.slice(b,c),k=0;k<h;++k)if(i[k]!==j[k]){f=i[k],g=j[k];break}return f<g?-1:g<f?1:0},Buffer.prototype.includes=function(a,b,c){return this.indexOf(a,b,c)!==-1},Buffer.prototype.indexOf=function(a,b,c){return s(this,a,b,c,!0)},Buffer.prototype.lastIndexOf=function(a,b,c){return s(this,a,b,c,!1)},Buffer.prototype.write=function(a,b,c,d){if(void 0===b)d="utf8",c=this.length,b=0;else if(void 0===c&&"string"==typeof b)d=b,c=this.length,b=0;else{if(!isFinite(b))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");b>>>=0,isFinite(c)?(c>>>=0,void 0===d&&(d="utf8")):(d=c,c=void 0)}var e=this.length-b;if((void 0===c||c>e)&&(c=e),a.length>0&&(c<0||b<0)||b>this.length)throw new RangeError("Attempt to write outside buffer bounds");d||(d="utf8");for(var f=!1;;)switch(d){case"hex":return u(this,a,b,c);case"utf8":case"utf-8":return v(this,a,b,c);case"ascii":return w(this,a,b,c);case"latin1":case"binary":return x(this,a,b,c);case"base64":return y(this,a,b,c);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return z(this,a,b,c);default:if(f)throw new TypeError("Unknown encoding: "+d);d=(""+d).toLowerCase(),f=!0}},Buffer.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Z=4096;Buffer.prototype.slice=function(a,b){var c=this.length;a=~~a,b=void 0===b?c:~~b,a<0?(a+=c,a<0&&(a=0)):a>c&&(a=c),b<0?(b+=c,b<0&&(b=0)):b>c&&(b=c),b<a&&(b=a);var d=this.subarray(a,b);return d.__proto__=Buffer.prototype,d},Buffer.prototype.readUIntLE=function(a,b,c){a>>>=0,b>>>=0,c||H(a,b,this.length);for(var d=this[a],e=1,f=0;++f<b&&(e*=256);)d+=this[a+f]*e;return d},Buffer.prototype.readUIntBE=function(a,b,c){a>>>=0,b>>>=0,c||H(a,b,this.length);for(var d=this[a+--b],e=1;b>0&&(e*=256);)d+=this[a+--b]*e;return d},Buffer.prototype.readUInt8=function(a,b){return a>>>=0,b||H(a,1,this.length),this[a]},Buffer.prototype.readUInt16LE=function(a,b){return a>>>=0,b||H(a,2,this.length),this[a]|this[a+1]<<8},Buffer.prototype.readUInt16BE=function(a,b){return a>>>=0,b||H(a,2,this.length),this[a]<<8|this[a+1]},Buffer.prototype.readUInt32LE=function(a,b){return a>>>=0,b||H(a,4,this.length),(this[a]|this[a+1]<<8|this[a+2]<<16)+16777216*this[a+3]},Buffer.prototype.readUInt32BE=function(a,b){return a>>>=0,b||H(a,4,this.length),16777216*this[a]+(this[a+1]<<16|this[a+2]<<8|this[a+3])},Buffer.prototype.readIntLE=function(a,b,c){a>>>=0,b>>>=0,c||H(a,b,this.length);for(var d=this[a],e=1,f=0;++f<b&&(e*=256);)d+=this[a+f]*e;return e*=128,d>=e&&(d-=Math.pow(2,8*b)),d},Buffer.prototype.readIntBE=function(a,b,c){a>>>=0,b>>>=0,c||H(a,b,this.length);for(var d=b,e=1,f=this[a+--d];d>0&&(e*=256);)f+=this[a+--d]*e;return e*=128,f>=e&&(f-=Math.pow(2,8*b)),f},Buffer.prototype.readInt8=function(a,b){return a>>>=0,b||H(a,1,this.length),128&this[a]?(255-this[a]+1)*-1:this[a]},Buffer.prototype.readInt16LE=function(a,b){a>>>=0,b||H(a,2,this.length);var c=this[a]|this[a+1]<<8;return 32768&c?4294901760|c:c},Buffer.prototype.readInt16BE=function(a,b){a>>>=0,b||H(a,2,this.length);var c=this[a+1]|this[a]<<8;return 32768&c?4294901760|c:c},Buffer.prototype.readInt32LE=function(a,b){return a>>>=0,b||H(a,4,this.length),this[a]|this[a+1]<<8|this[a+2]<<16|this[a+3]<<24},Buffer.prototype.readInt32BE=function(a,b){return a>>>=0,b||H(a,4,this.length),this[a]<<24|this[a+1]<<16|this[a+2]<<8|this[a+3]},Buffer.prototype.readFloatLE=function(a,b){return a>>>=0,b||H(a,4,this.length),X.read(this,a,!0,23,4)},Buffer.prototype.readFloatBE=function(a,b){return a>>>=0,b||H(a,4,this.length),X.read(this,a,!1,23,4)},Buffer.prototype.readDoubleLE=function(a,b){return a>>>=0,b||H(a,8,this.length),X.read(this,a,!0,52,8)},Buffer.prototype.readDoubleBE=function(a,b){return a>>>=0,b||H(a,8,this.length),X.read(this,a,!1,52,8)},Buffer.prototype.writeUIntLE=function(a,b,c,d){if(a=+a,b>>>=0,c>>>=0,!d){var e=Math.pow(2,8*c)-1;I(this,a,b,c,e,0)}var f=1,g=0;for(this[b]=255&a;++g<c&&(f*=256);)this[b+g]=a/f&255;return b+c},Buffer.prototype.writeUIntBE=function(a,b,c,d){if(a=+a,b>>>=0,c>>>=0,!d){var e=Math.pow(2,8*c)-1;I(this,a,b,c,e,0)}var f=c-1,g=1;for(this[b+f]=255&a;--f>=0&&(g*=256);)this[b+f]=a/g&255;return b+c},Buffer.prototype.writeUInt8=function(a,b,c){return a=+a,b>>>=0,c||I(this,a,b,1,255,0),this[b]=255&a,b+1},Buffer.prototype.writeUInt16LE=function(a,b,c){return a=+a,b>>>=0,c||I(this,a,b,2,65535,0),this[b]=255&a,this[b+1]=a>>>8,b+2},Buffer.prototype.writeUInt16BE=function(a,b,c){return a=+a,b>>>=0,c||I(this,a,b,2,65535,0),this[b]=a>>>8,this[b+1]=255&a,b+2},Buffer.prototype.writeUInt32LE=function(a,b,c){return a=+a,b>>>=0,c||I(this,a,b,4,4294967295,0),this[b+3]=a>>>24,this[b+2]=a>>>16,this[b+1]=a>>>8,this[b]=255&a,b+4},Buffer.prototype.writeUInt32BE=function(a,b,c){return a=+a,b>>>=0,c||I(this,a,b,4,4294967295,0),this[b]=a>>>24,this[b+1]=a>>>16,this[b+2]=a>>>8,this[b+3]=255&a,b+4},Buffer.prototype.writeIntLE=function(a,b,c,d){if(a=+a,b>>>=0,!d){var e=Math.pow(2,8*c-1);I(this,a,b,c,e-1,-e)}var f=0,g=1,h=0;for(this[b]=255&a;++f<c&&(g*=256);)a<0&&0===h&&0!==this[b+f-1]&&(h=1),this[b+f]=(a/g>>0)-h&255;return b+c},Buffer.prototype.writeIntBE=function(a,b,c,d){if(a=+a,b>>>=0,!d){var e=Math.pow(2,8*c-1);I(this,a,b,c,e-1,-e)}var f=c-1,g=1,h=0;for(this[b+f]=255&a;--f>=0&&(g*=256);)a<0&&0===h&&0!==this[b+f+1]&&(h=1),this[b+f]=(a/g>>0)-h&255;return b+c},Buffer.prototype.writeInt8=function(a,b,c){return a=+a,b>>>=0,c||I(this,a,b,1,127,-128),a<0&&(a=255+a+1),this[b]=255&a,b+1},Buffer.prototype.writeInt16LE=function(a,b,c){return a=+a,b>>>=0,c||I(this,a,b,2,32767,-32768),this[b]=255&a,this[b+1]=a>>>8,b+2},Buffer.prototype.writeInt16BE=function(a,b,c){return a=+a,b>>>=0,c||I(this,a,b,2,32767,-32768),this[b]=a>>>8,this[b+1]=255&a,b+2},Buffer.prototype.writeInt32LE=function(a,b,c){return a=+a,b>>>=0,c||I(this,a,b,4,2147483647,-2147483648),this[b]=255&a,this[b+1]=a>>>8,this[b+2]=a>>>16,this[b+3]=a>>>24,b+4},Buffer.prototype.writeInt32BE=function(a,b,c){return a=+a,b>>>=0,c||I(this,a,b,4,2147483647,-2147483648),a<0&&(a=4294967295+a+1),this[b]=a>>>24,this[b+1]=a>>>16,this[b+2]=a>>>8,this[b+3]=255&a,b+4},Buffer.prototype.writeFloatLE=function(a,b,c){return K(this,a,b,!0,c)},Buffer.prototype.writeFloatBE=function(a,b,c){return K(this,a,b,!1,c)},Buffer.prototype.writeDoubleLE=function(a,b,c){return L(this,a,b,!0,c)},Buffer.prototype.writeDoubleBE=function(a,b,c){return L(this,a,b,!1,c)},Buffer.prototype.copy=function(a,b,c,d){if(c||(c=0),d||0===d||(d=this.length),b>=a.length&&(b=a.length),b||(b=0),d>0&&d<c&&(d=c),d===c)return 0;if(0===a.length||0===this.length)return 0;if(b<0)throw new RangeError("targetStart out of bounds");if(c<0||c>=this.length)throw new RangeError("sourceStart out of bounds");if(d<0)throw new RangeError("sourceEnd out of bounds");d>this.length&&(d=this.length),a.length-b<d-c&&(d=a.length-b+c);var e,f=d-c;if(this===a&&c<b&&b<d)for(e=f-1;e>=0;--e)a[e+b]=this[e+c];else if(f<1e3)for(e=0;e<f;++e)a[e+b]=this[e+c];else Uint8Array.prototype.set.call(a,this.subarray(c,c+f),b);return f},Buffer.prototype.fill=function(a,b,c,d){if("string"==typeof a){if("string"==typeof b?(d=b,b=0,c=this.length):"string"==typeof c&&(d=c,c=this.length),1===a.length){var e=a.charCodeAt(0);e<256&&(a=e)}if(void 0!==d&&"string"!=typeof d)throw new TypeError("encoding must be a string");if("string"==typeof d&&!Buffer.isEncoding(d))throw new TypeError("Unknown encoding: "+d)}else"number"==typeof a&&(a&=255);if(b<0||this.length<b||this.length<c)throw new RangeError("Out of range index");if(c<=b)return this;b>>>=0,c=void 0===c?this.length:c>>>0,a||(a=0);var f;if("number"==typeof a)for(f=b;f<c;++f)this[f]=a;else{var g=Buffer.isBuffer(a)?a:new Buffer(a,d),h=g.length;for(f=0;f<c-b;++f)this[f+b]=g[f%h]}return this};var $=/[^+\/0-9A-Za-z-_]/g},{"base64-js":105,ieee754:224}],105:[function(a,b,c){"use strict";function d(a){var b=a.length;if(b%4>0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===a[b-2]?2:"="===a[b-1]?1:0}function e(a){return 3*a.length/4-d(a)}function f(a){var b,c,e,f,g,h=a.length;f=d(a),g=new l(3*h/4-f),c=f>0?h-4:h;var i=0;for(b=0;b<c;b+=4)e=k[a.charCodeAt(b)]<<18|k[a.charCodeAt(b+1)]<<12|k[a.charCodeAt(b+2)]<<6|k[a.charCodeAt(b+3)],g[i++]=e>>16&255,g[i++]=e>>8&255,g[i++]=255&e;return 2===f?(e=k[a.charCodeAt(b)]<<2|k[a.charCodeAt(b+1)]>>4,g[i++]=255&e):1===f&&(e=k[a.charCodeAt(b)]<<10|k[a.charCodeAt(b+1)]<<4|k[a.charCodeAt(b+2)]>>2,g[i++]=e>>8&255,g[i++]=255&e),g}function g(a){return j[a>>18&63]+j[a>>12&63]+j[a>>6&63]+j[63&a]}function h(a,b,c){for(var d,e=[],f=b;f<c;f+=3)d=(a[f]<<16)+(a[f+1]<<8)+a[f+2],e.push(g(d));return e.join("")}function i(a){for(var b,c=a.length,d=c%3,e="",f=[],g=16383,i=0,k=c-d;i<k;i+=g)f.push(h(a,i,i+g>k?k:i+g));return 1===d?(b=a[c-1],e+=j[b>>2],e+=j[b<<4&63],e+="=="):2===d&&(b=(a[c-2]<<8)+a[c-1],e+=j[b>>10],e+=j[b>>4&63],e+=j[b<<2&63],e+="="),f.push(e),f.join("")}c.byteLength=e,c.toByteArray=f,c.fromByteArray=i;for(var j=[],k=[],l="undefined"!=typeof Uint8Array?Uint8Array:Array,m="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,o=m.length;n<o;++n)j[n]=m[n],k[m.charCodeAt(n)]=n;k["-".charCodeAt(0)]=62,k["_".charCodeAt(0)]=63},{}],106:[function(a,b,c){function d(a){e.call(this),this.hashMode="string"==typeof a,this.hashMode?this[a]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}var Buffer=a("safe-buffer").Buffer,e=a("stream").Transform,f=a("string_decoder").StringDecoder,g=a("inherits");g(d,e),d.prototype.update=function(a,b,c){"string"==typeof a&&(a=Buffer.from(a,b));var d=this._update(a);return this.hashMode?this:(c&&(d=this._toString(d,c)),d)},d.prototype.setAutoPadding=function(){},d.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},d.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},d.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},d.prototype._transform=function(a,b,c){var d;try{this.hashMode?this._update(a):this.push(this._update(a))}catch(a){d=a}finally{c(d)}},d.prototype._flush=function(a){var b;try{this.push(this.__final())}catch(a){b=a}a(b)},d.prototype._finalOrDigest=function(a){var b=this.__final()||Buffer.alloc(0);return a&&(b=this._toString(b,a,!0)),b},d.prototype._toString=function(a,b,c){if(this._decoder||(this._decoder=new f(b),this._encoding=b),this._encoding!==b)throw new Error("can't switch encodings");var d=this._decoder.write(a);return c&&(d+=this._decoder.end()),d},b.exports=d},{inherits:226,"safe-buffer":288,stream:304,string_decoder:305}],107:[function(a,b,c){function d(a){if(a)return e(a)}function e(a){for(var b in d.prototype)a[b]=d.prototype[b];return a}b.exports=d,d.prototype.on=d.prototype.addEventListener=function(a,b){return this._callbacks=this._callbacks||{},(this._callbacks[a]=this._callbacks[a]||[]).push(b),this},d.prototype.once=function(a,b){function c(){d.off(a,c),b.apply(this,arguments)}var d=this;return this._callbacks=this._callbacks||{},c.fn=b,this.on(a,c),this},d.prototype.off=d.prototype.removeListener=d.prototype.removeAllListeners=d.prototype.removeEventListener=function(a,b){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var c=this._callbacks[a];if(!c)return this;if(1==arguments.length)return delete this._callbacks[a],this;for(var d,e=0;e<c.length;e++)if(d=c[e],d===b||d.fn===b){c.splice(e,1);break}return this},d.prototype.emit=function(a){this._callbacks=this._callbacks||{};var b=[].slice.call(arguments,1),c=this._callbacks[a];if(c){c=c.slice(0);for(var d=0,e=c.length;d<e;++d)c[d].apply(this,b)}return this},d.prototype.listeners=function(a){return this._callbacks=this._callbacks||{},this._callbacks[a]||[]},d.prototype.hasListeners=function(a){return!!this.listeners(a).length}},{}],108:[function(a,b,c){(function(Buffer){function a(a){return Array.isArray?Array.isArray(a):"[object Array]"===p(a)}function b(a){return"boolean"==typeof a}function d(a){return null===a}function e(a){return null==a}function f(a){return"number"==typeof a}function g(a){return"string"==typeof a}function h(a){return"symbol"==typeof a}function i(a){return void 0===a}function j(a){return"[object RegExp]"===p(a)}function k(a){return"object"==typeof a&&null!==a}function l(a){return"[object Date]"===p(a)}function m(a){return"[object Error]"===p(a)||a instanceof Error}function n(a){return"function"==typeof a}function o(a){return null===a||"boolean"==typeof a||"number"==typeof a||"string"==typeof a||"symbol"==typeof a||"undefined"==typeof a}function p(a){return Object.prototype.toString.call(a)}c.isArray=a,c.isBoolean=b,c.isNull=d,c.isNullOrUndefined=e,c.isNumber=f,c.isString=g,c.isSymbol=h,c.isUndefined=i,c.isRegExp=j,c.isObject=k,c.isDate=l,c.isError=m,c.isFunction=n,c.isPrimitive=o,c.isBuffer=Buffer.isBuffer}).call(this,{isBuffer:a("../../is-buffer/index.js")})},{"../../is-buffer/index.js":227}],109:[function(a,b,c){(function(Buffer){function c(a){this.curveType=g[a],this.curveType||(this.curveType={name:a}),this.curve=new e.ec(this.curveType.name),this.keys=void 0}function d(a,b,c){Array.isArray(a)||(a=a.toArray());var d=new Buffer(a);if(c&&d.length<c){var e=new Buffer(c-d.length);e.fill(0),d=Buffer.concat([e,d])}return b?d.toString(b):d}var e=a("elliptic"),f=a("bn.js");b.exports=function(a){return new c(a)};var g={secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}};g.p224=g.secp224r1,g.p256=g.secp256r1=g.prime256v1,g.p192=g.secp192r1=g.prime192v1,g.p384=g.secp384r1,g.p521=g.secp521r1,c.prototype.generateKeys=function(a,b){return this.keys=this.curve.genKeyPair(),this.getPublicKey(a,b)},c.prototype.computeSecret=function(a,b,c){b=b||"utf8",Buffer.isBuffer(a)||(a=new Buffer(a,b));var e=this.curve.keyFromPublic(a).getPublic(),f=e.mul(this.keys.getPrivate()).getX();return d(f,c,this.curveType.byteLength)},c.prototype.getPublicKey=function(a,b){var c=this.keys.getPublic("compressed"===b,!0);return"hybrid"===b&&(c[c.length-1]%2?c[0]=7:c[0]=6),d(c,a)},c.prototype.getPrivateKey=function(a){return d(this.keys.getPrivate(),a)},c.prototype.setPublicKey=function(a,b){return b=b||"utf8",Buffer.isBuffer(a)||(a=new Buffer(a,b)),this.keys._importPublic(a),this},c.prototype.setPrivateKey=function(a,b){b=b||"utf8",Buffer.isBuffer(a)||(a=new Buffer(a,b));var c=new f(a);return c=c.toString(16),this.keys._importPrivate(c),this}}).call(this,a("buffer").Buffer)},{"bn.js":75,buffer:104,elliptic:192}],110:[function(a,b,c){(function(Buffer){"use strict";function c(a){i.call(this,"digest"),this._hash=a,this.buffers=[]}function d(a){i.call(this,"digest"),this._hash=a}var e=a("inherits"),f=a("./md5"),g=a("ripemd160"),h=a("sha.js"),i=a("cipher-base");e(c,i),c.prototype._update=function(a){this.buffers.push(a)},c.prototype._final=function(){var a=Buffer.concat(this.buffers),b=this._hash(a);return this.buffers=null,b},e(d,i),d.prototype._update=function(a){this._hash.update(a)},d.prototype._final=function(){return this._hash.digest()},b.exports=function(a){return a=a.toLowerCase(),"md5"===a?new c(f):new d("rmd160"===a||"ripemd160"===a?new g:h(a))}}).call(this,a("buffer").Buffer)},{"./md5":112,buffer:104,"cipher-base":106,inherits:226,ripemd160:287,"sha.js":296}],111:[function(a,b,c){(function(Buffer){"use strict";function a(a){if(a.length%c!==0){var b=a.length+(c-a.length%c);a=Buffer.concat([a,d],b)}for(var e=new Array(a.length>>>2),f=0,g=0;f<a.length;f+=c,g++)e[g]=a.readInt32LE(f);return e}var c=4,d=new Buffer(c);d.fill(0);var e=8,f=16;b.exports=function(b,c){var d=c(a(b),b.length*e);b=new Buffer(f);for(var g=0;g<d.length;g++)b.writeInt32LE(d[g],g<<2,!0);return b}}).call(this,a("buffer").Buffer)},{buffer:104}],112:[function(a,b,c){"use strict";function d(a,b){a[b>>5]|=128<<b%32,a[(b+64>>>9<<4)+14]=b;for(var c=1732584193,d=-271733879,e=-1732584194,k=271733878,l=0;l<a.length;l+=16){var m=c,n=d,o=e,p=k;c=f(c,d,e,k,a[l+0],7,-680876936),k=f(k,c,d,e,a[l+1],12,-389564586),e=f(e,k,c,d,a[l+2],17,606105819),d=f(d,e,k,c,a[l+3],22,-1044525330),c=f(c,d,e,k,a[l+4],7,-176418897),k=f(k,c,d,e,a[l+5],12,1200080426),e=f(e,k,c,d,a[l+6],17,-1473231341),d=f(d,e,k,c,a[l+7],22,-45705983),c=f(c,d,e,k,a[l+8],7,1770035416),k=f(k,c,d,e,a[l+9],12,-1958414417),e=f(e,k,c,d,a[l+10],17,-42063),d=f(d,e,k,c,a[l+11],22,-1990404162),c=f(c,d,e,k,a[l+12],7,1804603682),k=f(k,c,d,e,a[l+13],12,-40341101),e=f(e,k,c,d,a[l+14],17,-1502002290),d=f(d,e,k,c,a[l+15],22,1236535329),c=g(c,d,e,k,a[l+1],5,-165796510),k=g(k,c,d,e,a[l+6],9,-1069501632),e=g(e,k,c,d,a[l+11],14,643717713),d=g(d,e,k,c,a[l+0],20,-373897302),c=g(c,d,e,k,a[l+5],5,-701558691),k=g(k,c,d,e,a[l+10],9,38016083),e=g(e,k,c,d,a[l+15],14,-660478335),d=g(d,e,k,c,a[l+4],20,-405537848),c=g(c,d,e,k,a[l+9],5,568446438),k=g(k,c,d,e,a[l+14],9,-1019803690),e=g(e,k,c,d,a[l+3],14,-187363961),d=g(d,e,k,c,a[l+8],20,1163531501),c=g(c,d,e,k,a[l+13],5,-1444681467),k=g(k,c,d,e,a[l+2],9,-51403784),e=g(e,k,c,d,a[l+7],14,1735328473),d=g(d,e,k,c,a[l+12],20,-1926607734),c=h(c,d,e,k,a[l+5],4,-378558),k=h(k,c,d,e,a[l+8],11,-2022574463),e=h(e,k,c,d,a[l+11],16,1839030562),d=h(d,e,k,c,a[l+14],23,-35309556),c=h(c,d,e,k,a[l+1],4,-1530992060),k=h(k,c,d,e,a[l+4],11,1272893353),e=h(e,k,c,d,a[l+7],16,-155497632),d=h(d,e,k,c,a[l+10],23,-1094730640),c=h(c,d,e,k,a[l+13],4,681279174),k=h(k,c,d,e,a[l+0],11,-358537222),e=h(e,k,c,d,a[l+3],16,-722521979),d=h(d,e,k,c,a[l+6],23,76029189),c=h(c,d,e,k,a[l+9],4,-640364487),k=h(k,c,d,e,a[l+12],11,-421815835),e=h(e,k,c,d,a[l+15],16,530742520),d=h(d,e,k,c,a[l+2],23,-995338651),c=i(c,d,e,k,a[l+0],6,-198630844),k=i(k,c,d,e,a[l+7],10,1126891415),e=i(e,k,c,d,a[l+14],15,-1416354905),d=i(d,e,k,c,a[l+5],21,-57434055),c=i(c,d,e,k,a[l+12],6,1700485571),k=i(k,c,d,e,a[l+3],10,-1894986606),e=i(e,k,c,d,a[l+10],15,-1051523),d=i(d,e,k,c,a[l+1],21,-2054922799),c=i(c,d,e,k,a[l+8],6,1873313359),k=i(k,c,d,e,a[l+15],10,-30611744),e=i(e,k,c,d,a[l+6],15,-1560198380),d=i(d,e,k,c,a[l+13],21,1309151649),c=i(c,d,e,k,a[l+4],6,-145523070),k=i(k,c,d,e,a[l+11],10,-1120210379),e=i(e,k,c,d,a[l+2],15,718787259),d=i(d,e,k,c,a[l+9],21,-343485551),c=j(c,m),d=j(d,n),e=j(e,o),k=j(k,p)}return[c,d,e,k]}function e(a,b,c,d,e,f){return j(k(j(j(b,a),j(d,f)),e),c)}function f(a,b,c,d,f,g,h){return e(b&c|~b&d,a,b,f,g,h)}function g(a,b,c,d,f,g,h){return e(b&d|c&~d,a,b,f,g,h)}function h(a,b,c,d,f,g,h){return e(b^c^d,a,b,f,g,h)}function i(a,b,c,d,f,g,h){return e(c^(b|~d),a,b,f,g,h)}function j(a,b){var c=(65535&a)+(65535&b),d=(a>>16)+(b>>16)+(c>>16);return d<<16|65535&c}function k(a,b){return a<<b|a>>>32-b}var l=a("./make-hash");b.exports=function(a){return l(a,d)}},{"./make-hash":111}],113:[function(a,b,c){"use strict";function d(a,b){g.call(this,"digest"),"string"==typeof b&&(b=Buffer.from(b));var c="sha512"===a||"sha384"===a?128:64;if(this._alg=a,this._key=b,b.length>c){var d="rmd160"===a?new i:j(a);b=d.update(b).digest()}else b.length<c&&(b=Buffer.concat([b,k],c));for(var e=this._ipad=Buffer.allocUnsafe(c),f=this._opad=Buffer.allocUnsafe(c),h=0;h<c;h++)e[h]=54^b[h],f[h]=92^b[h];this._hash="rmd160"===a?new i:j(a),this._hash.update(e)}var e=a("inherits"),f=a("./legacy"),g=a("cipher-base"),Buffer=a("safe-buffer").Buffer,h=a("create-hash/md5"),i=a("ripemd160"),j=a("sha.js"),k=Buffer.alloc(128);e(d,g),d.prototype._update=function(a){this._hash.update(a)},d.prototype._final=function(){var a=this._hash.digest(),b="rmd160"===this._alg?new i:j(this._alg);return b.update(this._opad).update(a).digest()},b.exports=function(a,b){return a=a.toLowerCase(),"rmd160"===a||"ripemd160"===a?new d("rmd160",b):"md5"===a?new f(h,b):new d(a,b)}},{"./legacy":114,"cipher-base":106,"create-hash/md5":112,inherits:226,ripemd160:287,"safe-buffer":288,"sha.js":296}],114:[function(a,b,c){"use strict";function d(a,b){f.call(this,"digest"),"string"==typeof b&&(b=Buffer.from(b)),this._alg=a,this._key=b,b.length>h?b=a(b):b.length<h&&(b=Buffer.concat([b,g],h));for(var c=this._ipad=Buffer.allocUnsafe(h),d=this._opad=Buffer.allocUnsafe(h),e=0;e<h;e++)c[e]=54^b[e],d[e]=92^b[e];this._hash=[c]}var e=a("inherits"),Buffer=a("safe-buffer").Buffer,f=a("cipher-base"),g=Buffer.alloc(128),h=64;e(d,f),d.prototype._update=function(a){this._hash.push(a)},d.prototype._final=function(){var a=this._alg(Buffer.concat(this._hash));return this._alg(Buffer.concat([this._opad,a]))},b.exports=d},{"cipher-base":106,inherits:226,"safe-buffer":288}],115:[function(a,b,c){"use strict";c.randomBytes=c.rng=c.pseudoRandomBytes=c.prng=a("randombytes"),c.createHash=c.Hash=a("create-hash"),c.createHmac=c.Hmac=a("create-hmac");var d=a("browserify-sign/algos"),e=Object.keys(d),f=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(e);c.getHashes=function(){return f};var g=a("pbkdf2");c.pbkdf2=g.pbkdf2,c.pbkdf2Sync=g.pbkdf2Sync;var h=a("browserify-cipher");c.Cipher=h.Cipher,c.createCipher=h.createCipher,c.Cipheriv=h.Cipheriv,c.createCipheriv=h.createCipheriv,c.Decipher=h.Decipher,c.createDecipher=h.createDecipher,c.Decipheriv=h.Decipheriv,c.createDecipheriv=h.createDecipheriv,c.getCiphers=h.getCiphers,c.listCiphers=h.listCiphers;var i=a("diffie-hellman");c.DiffieHellmanGroup=i.DiffieHellmanGroup,c.createDiffieHellmanGroup=i.createDiffieHellmanGroup,c.getDiffieHellman=i.getDiffieHellman,c.createDiffieHellman=i.createDiffieHellman,c.DiffieHellman=i.DiffieHellman;var j=a("browserify-sign");c.createSign=j.createSign,c.Sign=j.Sign,c.createVerify=j.createVerify,c.Verify=j.Verify,c.createECDH=a("create-ecdh");var k=a("public-encrypt");c.publicEncrypt=k.publicEncrypt,c.privateEncrypt=k.privateEncrypt,c.publicDecrypt=k.publicDecrypt,c.privateDecrypt=k.privateDecrypt;var l=a("randomfill");c.randomFill=l.randomFill,c.randomFillSync=l.randomFillSync,c.createCredentials=function(){throw new Error(["sorry, createCredentials is not implemented yet","we accept pull requests","https://github.com/crypto-browserify/crypto-browserify"].join("\n"))},c.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6}},{"browserify-cipher":95,"browserify-sign":134,"browserify-sign/algos":131,"create-ecdh":109,"create-hash":110,"create-hmac":113,"diffie-hellman":183,pbkdf2:236,"public-encrypt":239,randombytes:271,randomfill:272}],116:[function(a,b,c){var d=c;d.bignum=a("bn.js"),d.define=a("./asn1/api").define,d.base=a("./asn1/base"),d.constants=a("./asn1/constants"),d.decoders=a("./asn1/decoders"),d.encoders=a("./asn1/encoders")},{"./asn1/api":117,"./asn1/base":119,"./asn1/constants":123,"./asn1/decoders":125,"./asn1/encoders":128,"bn.js":75}],117:[function(a,b,c){function d(a,b){this.name=a,this.body=b,this.decoders={},this.encoders={}}var e=a("../asn1"),f=a("inherits"),g=c;g.define=function(a,b){return new d(a,b)},d.prototype._createNamed=function(b){var c;try{c=a("vm").runInThisContext("(function "+this.name+"(entity) {\n this._initNamed(entity);\n})")}catch(a){c=function(a){this._initNamed(a)}}return f(c,b),c.prototype._initNamed=function(a){b.call(this,a)},new c(this)},d.prototype._getDecoder=function(a){return a=a||"der",this.decoders.hasOwnProperty(a)||(this.decoders[a]=this._createNamed(e.decoders[a])),this.decoders[a]},d.prototype.decode=function(a,b,c){return this._getDecoder(b).decode(a,c)},d.prototype._getEncoder=function(a){return a=a||"der",this.encoders.hasOwnProperty(a)||(this.encoders[a]=this._createNamed(e.encoders[a])),this.encoders[a]},d.prototype.encode=function(a,b,c){return this._getEncoder(b).encode(a,c)}},{"../asn1":116,inherits:226,vm:322}],118:[function(a,b,c){function d(a,b){return g.call(this,b),Buffer.isBuffer(a)?(this.base=a,this.offset=0,void(this.length=a.length)):void this.error("Input not Buffer")}function e(a,b){if(Array.isArray(a))this.length=0,this.value=a.map(function(a){return a instanceof e||(a=new e(a,b)),this.length+=a.length,a},this);else if("number"==typeof a){if(!(0<=a&&a<=255))return b.error("non-byte EncoderBuffer value");this.value=a,this.length=1}else if("string"==typeof a)this.value=a,this.length=Buffer.byteLength(a);else{if(!Buffer.isBuffer(a))return b.error("Unsupported type: "+typeof a);this.value=a,this.length=a.length}}var f=a("inherits"),g=a("../base").Reporter,Buffer=a("buffer").Buffer;f(d,g),c.DecoderBuffer=d,d.prototype.save=function(){return{offset:this.offset,reporter:g.prototype.save.call(this)}},d.prototype.restore=function(a){var b=new d(this.base);return b.offset=a.offset,b.length=this.offset,this.offset=a.offset,g.prototype.restore.call(this,a.reporter),b},d.prototype.isEmpty=function(){return this.offset===this.length},d.prototype.readUInt8=function(a){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(a||"DecoderBuffer overrun")},d.prototype.skip=function(a,b){if(!(this.offset+a<=this.length))return this.error(b||"DecoderBuffer overrun");var c=new d(this.base);return c._reporterState=this._reporterState,c.offset=this.offset,c.length=this.offset+a,this.offset+=a,c},d.prototype.raw=function(a){return this.base.slice(a?a.offset:this.offset,this.length)},c.EncoderBuffer=e,e.prototype.join=function(a,b){return a||(a=new Buffer(this.length)),b||(b=0),0===this.length?a:(Array.isArray(this.value)?this.value.forEach(function(c){c.join(a,b),b+=c.length}):("number"==typeof this.value?a[b]=this.value:"string"==typeof this.value?a.write(this.value,b):Buffer.isBuffer(this.value)&&this.value.copy(a,b),b+=this.length),a)}},{"../base":119,buffer:104,inherits:226}],119:[function(a,b,c){var d=c;d.Reporter=a("./reporter").Reporter,d.DecoderBuffer=a("./buffer").DecoderBuffer,d.EncoderBuffer=a("./buffer").EncoderBuffer,d.Node=a("./node")},{"./buffer":118,"./node":120,"./reporter":121}],120:[function(a,b,c){function d(a,b){var c={};this._baseState=c,c.enc=a,c.parent=b||null,c.children=null,c.tag=null,c.args=null,c.reverseArgs=null,c.choice=null,c.optional=!1,c.any=!1,c.obj=!1,c.use=null,c.useDecoder=null,c.key=null,c.default=null,c.explicit=null,c.implicit=null,c.contains=null,c.parent||(c.children=[],this._wrap())}var e=a("../base").Reporter,f=a("../base").EncoderBuffer,g=a("../base").DecoderBuffer,h=a("minimalistic-assert"),i=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],j=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(i),k=["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"];b.exports=d;var l=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];d.prototype.clone=function(){var a=this._baseState,b={};l.forEach(function(c){b[c]=a[c]});var c=new this.constructor(b.parent);return c._baseState=b,c},d.prototype._wrap=function(){var a=this._baseState;j.forEach(function(b){this[b]=function(){var c=new this.constructor(this);return a.children.push(c),c[b].apply(c,arguments)}},this)},d.prototype._init=function(a){var b=this._baseState;h(null===b.parent),a.call(this),b.children=b.children.filter(function(a){return a._baseState.parent===this},this),h.equal(b.children.length,1,"Root node can have only one child")},d.prototype._useArgs=function(a){var b=this._baseState,c=a.filter(function(a){return a instanceof this.constructor},this);a=a.filter(function(a){return!(a instanceof this.constructor)},this),0!==c.length&&(h(null===b.children),b.children=c,c.forEach(function(a){a._baseState.parent=this},this)),0!==a.length&&(h(null===b.args),b.args=a,b.reverseArgs=a.map(function(a){if("object"!=typeof a||a.constructor!==Object)return a;var b={}; |
| 11 |
|
return Object.keys(a).forEach(function(c){c==(0|c)&&(c|=0);var d=a[c];b[d]=c}),b}))},k.forEach(function(a){d.prototype[a]=function(){var b=this._baseState;throw new Error(a+" not implemented for encoding: "+b.enc)}}),i.forEach(function(a){d.prototype[a]=function(){var b=this._baseState,c=Array.prototype.slice.call(arguments);return h(null===b.tag),b.tag=a,this._useArgs(c),this}}),d.prototype.use=function(a){h(a);var b=this._baseState;return h(null===b.use),b.use=a,this},d.prototype.optional=function(){var a=this._baseState;return a.optional=!0,this},d.prototype.def=function(a){var b=this._baseState;return h(null===b.default),b.default=a,b.optional=!0,this},d.prototype.explicit=function(a){var b=this._baseState;return h(null===b.explicit&&null===b.implicit),b.explicit=a,this},d.prototype.implicit=function(a){var b=this._baseState;return h(null===b.explicit&&null===b.implicit),b.implicit=a,this},d.prototype.obj=function(){var a=this._baseState,b=Array.prototype.slice.call(arguments);return a.obj=!0,0!==b.length&&this._useArgs(b),this},d.prototype.key=function(a){var b=this._baseState;return h(null===b.key),b.key=a,this},d.prototype.any=function(){var a=this._baseState;return a.any=!0,this},d.prototype.choice=function(a){var b=this._baseState;return h(null===b.choice),b.choice=a,this._useArgs(Object.keys(a).map(function(b){return a[b]})),this},d.prototype.contains=function(a){var b=this._baseState;return h(null===b.use),b.contains=a,this},d.prototype._decode=function(a,b){var c=this._baseState;if(null===c.parent)return a.wrapResult(c.children[0]._decode(a,b));var d=c.default,e=!0,f=null;if(null!==c.key&&(f=a.enterKey(c.key)),c.optional){var h=null;if(null!==c.explicit?h=c.explicit:null!==c.implicit?h=c.implicit:null!==c.tag&&(h=c.tag),null!==h||c.any){if(e=this._peekTag(a,h,c.any),a.isError(e))return e}else{var i=a.save();try{null===c.choice?this._decodeGeneric(c.tag,a,b):this._decodeChoice(a,b),e=!0}catch(a){e=!1}a.restore(i)}}var j;if(c.obj&&e&&(j=a.enterObject()),e){if(null!==c.explicit){var k=this._decodeTag(a,c.explicit);if(a.isError(k))return k;a=k}var l=a.offset;if(null===c.use&&null===c.choice){if(c.any)var i=a.save();var m=this._decodeTag(a,null!==c.implicit?c.implicit:c.tag,c.any);if(a.isError(m))return m;c.any?d=a.raw(i):a=m}if(b&&b.track&&null!==c.tag&&b.track(a.path(),l,a.length,"tagged"),b&&b.track&&null!==c.tag&&b.track(a.path(),a.offset,a.length,"content"),d=c.any?d:null===c.choice?this._decodeGeneric(c.tag,a,b):this._decodeChoice(a,b),a.isError(d))return d;if(c.any||null!==c.choice||null===c.children||c.children.forEach(function(c){c._decode(a,b)}),c.contains&&("octstr"===c.tag||"bitstr"===c.tag)){var n=new g(d);d=this._getUse(c.contains,a._reporterState.obj)._decode(n,b)}}return c.obj&&e&&(d=a.leaveObject(j)),null===c.key||null===d&&e!==!0?null!==f&&a.exitKey(f):a.leaveKey(f,c.key,d),d},d.prototype._decodeGeneric=function(a,b,c){var d=this._baseState;return"seq"===a||"set"===a?null:"seqof"===a||"setof"===a?this._decodeList(b,a,d.args[0],c):/str$/.test(a)?this._decodeStr(b,a,c):"objid"===a&&d.args?this._decodeObjid(b,d.args[0],d.args[1],c):"objid"===a?this._decodeObjid(b,null,null,c):"gentime"===a||"utctime"===a?this._decodeTime(b,a,c):"null_"===a?this._decodeNull(b,c):"bool"===a?this._decodeBool(b,c):"objDesc"===a?this._decodeStr(b,a,c):"int"===a||"enum"===a?this._decodeInt(b,d.args&&d.args[0],c):null!==d.use?this._getUse(d.use,b._reporterState.obj)._decode(b,c):b.error("unknown tag: "+a)},d.prototype._getUse=function(a,b){var c=this._baseState;return c.useDecoder=this._use(a,b),h(null===c.useDecoder._baseState.parent),c.useDecoder=c.useDecoder._baseState.children[0],c.implicit!==c.useDecoder._baseState.implicit&&(c.useDecoder=c.useDecoder.clone(),c.useDecoder._baseState.implicit=c.implicit),c.useDecoder},d.prototype._decodeChoice=function(a,b){var c=this._baseState,d=null,e=!1;return Object.keys(c.choice).some(function(f){var g=a.save(),h=c.choice[f];try{var i=h._decode(a,b);if(a.isError(i))return!1;d={type:f,value:i},e=!0}catch(b){return a.restore(g),!1}return!0},this),e?d:a.error("Choice not matched")},d.prototype._createEncoderBuffer=function(a){return new f(a,this.reporter)},d.prototype._encode=function(a,b,c){var d=this._baseState;if(null===d.default||d.default!==a){var e=this._encodeValue(a,b,c);if(void 0!==e&&!this._skipDefault(e,b,c))return e}},d.prototype._encodeValue=function(a,b,c){var d=this._baseState;if(null===d.parent)return d.children[0]._encode(a,b||new e);var f=null;if(this.reporter=b,d.optional&&void 0===a){if(null===d.default)return;a=d.default}var g=null,h=!1;if(d.any)f=this._createEncoderBuffer(a);else if(d.choice)f=this._encodeChoice(a,b);else if(d.contains)g=this._getUse(d.contains,c)._encode(a,b),h=!0;else if(d.children)g=d.children.map(function(c){if("null_"===c._baseState.tag)return c._encode(null,b,a);if(null===c._baseState.key)return b.error("Child should have a key");var d=b.enterKey(c._baseState.key);if("object"!=typeof a)return b.error("Child expected, but input is not object");var e=c._encode(a[c._baseState.key],b,a);return b.leaveKey(d),e},this).filter(function(a){return a}),g=this._createEncoderBuffer(g);else if("seqof"===d.tag||"setof"===d.tag){if(!d.args||1!==d.args.length)return b.error("Too many args for : "+d.tag);if(!Array.isArray(a))return b.error("seqof/setof, but data is not Array");var i=this.clone();i._baseState.implicit=null,g=this._createEncoderBuffer(a.map(function(c){var d=this._baseState;return this._getUse(d.args[0],a)._encode(c,b)},i))}else null!==d.use?f=this._getUse(d.use,c)._encode(a,b):(g=this._encodePrimitive(d.tag,a),h=!0);var f;if(!d.any&&null===d.choice){var j=null!==d.implicit?d.implicit:d.tag,k=null===d.implicit?"universal":"context";null===j?null===d.use&&b.error("Tag could be omitted only for .use()"):null===d.use&&(f=this._encodeComposite(j,h,k,g))}return null!==d.explicit&&(f=this._encodeComposite(d.explicit,!1,"context",f)),f},d.prototype._encodeChoice=function(a,b){var c=this._baseState,d=c.choice[a.type];return d||h(!1,a.type+" not found in "+JSON.stringify(Object.keys(c.choice))),d._encode(a.value,b)},d.prototype._encodePrimitive=function(a,b){var c=this._baseState;if(/str$/.test(a))return this._encodeStr(b,a);if("objid"===a&&c.args)return this._encodeObjid(b,c.reverseArgs[0],c.args[1]);if("objid"===a)return this._encodeObjid(b,null,null);if("gentime"===a||"utctime"===a)return this._encodeTime(b,a);if("null_"===a)return this._encodeNull();if("int"===a||"enum"===a)return this._encodeInt(b,c.args&&c.reverseArgs[0]);if("bool"===a)return this._encodeBool(b);if("objDesc"===a)return this._encodeStr(b,a);throw new Error("Unsupported tag: "+a)},d.prototype._isNumstr=function(a){return/^[0-9 ]*$/.test(a)},d.prototype._isPrintstr=function(a){return/^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(a)}},{"../base":119,"minimalistic-assert":234}],121:[function(a,b,c){function d(a){this._reporterState={obj:null,path:[],options:a||{},errors:[]}}function e(a,b){this.path=a,this.rethrow(b)}var f=a("inherits");c.Reporter=d,d.prototype.isError=function(a){return a instanceof e},d.prototype.save=function(){var a=this._reporterState;return{obj:a.obj,pathLen:a.path.length}},d.prototype.restore=function(a){var b=this._reporterState;b.obj=a.obj,b.path=b.path.slice(0,a.pathLen)},d.prototype.enterKey=function(a){return this._reporterState.path.push(a)},d.prototype.exitKey=function(a){var b=this._reporterState;b.path=b.path.slice(0,a-1)},d.prototype.leaveKey=function(a,b,c){var d=this._reporterState;this.exitKey(a),null!==d.obj&&(d.obj[b]=c)},d.prototype.path=function(){return this._reporterState.path.join("/")},d.prototype.enterObject=function(){var a=this._reporterState,b=a.obj;return a.obj={},b},d.prototype.leaveObject=function(a){var b=this._reporterState,c=b.obj;return b.obj=a,c},d.prototype.error=function(a){var b,c=this._reporterState,d=a instanceof e;if(b=d?a:new e(c.path.map(function(a){return"["+JSON.stringify(a)+"]"}).join(""),a.message||a,a.stack),!c.options.partial)throw b;return d||c.errors.push(b),b},d.prototype.wrapResult=function(a){var b=this._reporterState;return b.options.partial?{result:this.isError(a)?null:a,errors:b.errors}:a},f(e,Error),e.prototype.rethrow=function(a){if(this.message=a+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,e),!this.stack)try{throw new Error(this.message)}catch(a){this.stack=a.stack}return this}},{inherits:226}],122:[function(a,b,c){var d=a("../constants");c.tagClass={0:"universal",1:"application",2:"context",3:"private"},c.tagClassByName=d._reverse(c.tagClass),c.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},c.tagByName=d._reverse(c.tag)},{"../constants":123}],123:[function(a,b,c){var d=c;d._reverse=function(a){var b={};return Object.keys(a).forEach(function(c){(0|c)==c&&(c|=0);var d=a[c];b[d]=c}),b},d.der=a("./der")},{"./der":122}],124:[function(a,b,c){function d(a){this.enc="der",this.name=a.name,this.entity=a,this.tree=new e,this.tree._init(a.body)}function e(a){j.Node.call(this,"der",a)}function f(a,b){var c=a.readUInt8(b);if(a.isError(c))return c;var d=l.tagClass[c>>6],e=0===(32&c);if(31===(31&c)){var f=c;for(c=0;128===(128&f);){if(f=a.readUInt8(b),a.isError(f))return f;c<<=7,c|=127&f}}else c&=31;var g=l.tag[c];return{cls:d,primitive:e,tag:c,tagStr:g}}function g(a,b,c){var d=a.readUInt8(c);if(a.isError(d))return d;if(!b&&128===d)return null;if(0===(128&d))return d;var e=127&d;if(e>4)return a.error("length octect is too long");d=0;for(var f=0;f<e;f++){d<<=8;var g=a.readUInt8(c);if(a.isError(g))return g;d|=g}return d}var h=a("inherits"),i=a("../../asn1"),j=i.base,k=i.bignum,l=i.constants.der;b.exports=d,d.prototype.decode=function(a,b){return a instanceof j.DecoderBuffer||(a=new j.DecoderBuffer(a,b)),this.tree._decode(a,b)},h(e,j.Node),e.prototype._peekTag=function(a,b,c){if(a.isEmpty())return!1;var d=a.save(),e=f(a,'Failed to peek tag: "'+b+'"');return a.isError(e)?e:(a.restore(d),e.tag===b||e.tagStr===b||e.tagStr+"of"===b||c)},e.prototype._decodeTag=function(a,b,c){var d=f(a,'Failed to decode tag of "'+b+'"');if(a.isError(d))return d;var e=g(a,d.primitive,'Failed to get length of "'+b+'"');if(a.isError(e))return e;if(!c&&d.tag!==b&&d.tagStr!==b&&d.tagStr+"of"!==b)return a.error('Failed to match tag: "'+b+'"');if(d.primitive||null!==e)return a.skip(e,'Failed to match body of: "'+b+'"');var h=a.save(),i=this._skipUntilEnd(a,'Failed to skip indefinite length body: "'+this.tag+'"');return a.isError(i)?i:(e=a.offset-h.offset,a.restore(h),a.skip(e,'Failed to match body of: "'+b+'"'))},e.prototype._skipUntilEnd=function(a,b){for(;;){var c=f(a,b);if(a.isError(c))return c;var d=g(a,c.primitive,b);if(a.isError(d))return d;var e;if(e=c.primitive||null!==d?a.skip(d):this._skipUntilEnd(a,b),a.isError(e))return e;if("end"===c.tagStr)break}},e.prototype._decodeList=function(a,b,c,d){for(var e=[];!a.isEmpty();){var f=this._peekTag(a,"end");if(a.isError(f))return f;var g=c.decode(a,"der",d);if(a.isError(g)&&f)break;e.push(g)}return e},e.prototype._decodeStr=function(a,b){if("bitstr"===b){var c=a.readUInt8();return a.isError(c)?c:{unused:c,data:a.raw()}}if("bmpstr"===b){var d=a.raw();if(d.length%2===1)return a.error("Decoding of string type: bmpstr length mismatch");for(var e="",f=0;f<d.length/2;f++)e+=String.fromCharCode(d.readUInt16BE(2*f));return e}if("numstr"===b){var g=a.raw().toString("ascii");return this._isNumstr(g)?g:a.error("Decoding of string type: numstr unsupported characters")}if("octstr"===b)return a.raw();if("objDesc"===b)return a.raw();if("printstr"===b){var h=a.raw().toString("ascii");return this._isPrintstr(h)?h:a.error("Decoding of string type: printstr unsupported characters")}return/str$/.test(b)?a.raw().toString():a.error("Decoding of string type: "+b+" unsupported")},e.prototype._decodeObjid=function(a,b,c){for(var d,e=[],f=0;!a.isEmpty();){var g=a.readUInt8();f<<=7,f|=127&g,0===(128&g)&&(e.push(f),f=0)}128&g&&e.push(f);var h=e[0]/40|0,i=e[0]%40;if(d=c?e:[h,i].concat(e.slice(1)),b){var j=b[d.join(" ")];void 0===j&&(j=b[d.join(".")]),void 0!==j&&(d=j)}return d},e.prototype._decodeTime=function(a,b){var c=a.raw().toString();if("gentime"===b)var d=0|c.slice(0,4),e=0|c.slice(4,6),f=0|c.slice(6,8),g=0|c.slice(8,10),h=0|c.slice(10,12),i=0|c.slice(12,14);else{if("utctime"!==b)return a.error("Decoding "+b+" time is not supported yet");var d=0|c.slice(0,2),e=0|c.slice(2,4),f=0|c.slice(4,6),g=0|c.slice(6,8),h=0|c.slice(8,10),i=0|c.slice(10,12);d=d<70?2e3+d:1900+d}return Date.UTC(d,e-1,f,g,h,i,0)},e.prototype._decodeNull=function(a){return null},e.prototype._decodeBool=function(a){var b=a.readUInt8();return a.isError(b)?b:0!==b},e.prototype._decodeInt=function(a,b){var c=a.raw(),d=new k(c);return b&&(d=b[d.toString(10)]||d),d},e.prototype._use=function(a,b){return"function"==typeof a&&(a=a(b)),a._getDecoder("der").tree}},{"../../asn1":116,inherits:226}],125:[function(a,b,c){var d=c;d.der=a("./der"),d.pem=a("./pem")},{"./der":124,"./pem":126}],126:[function(a,b,c){function d(a){f.call(this,a),this.enc="pem"}var e=a("inherits"),Buffer=a("buffer").Buffer,f=a("./der");e(d,f),b.exports=d,d.prototype.decode=function(a,b){for(var c=a.toString().split(/[\r\n]+/g),d=b.label.toUpperCase(),e=/^-----(BEGIN|END) ([^-]+)-----$/,g=-1,h=-1,i=0;i<c.length;i++){var j=c[i].match(e);if(null!==j&&j[2]===d){if(g!==-1){if("END"!==j[1])break;h=i;break}if("BEGIN"!==j[1])break;g=i}}if(g===-1||h===-1)throw new Error("PEM section not found for: "+d);var k=c.slice(g+1,h).join("");k.replace(/[^a-z0-9\+\/=]+/gi,"");var l=new Buffer(k,"base64");return f.prototype.decode.call(this,l,b)}},{"./der":124,buffer:104,inherits:226}],127:[function(a,b,c){function d(a){this.enc="der",this.name=a.name,this.entity=a,this.tree=new e,this.tree._init(a.body)}function e(a){j.Node.call(this,"der",a)}function f(a){return a<10?"0"+a:a}function g(a,b,c,d){var e;if("seqof"===a?a="seq":"setof"===a&&(a="set"),k.tagByName.hasOwnProperty(a))e=k.tagByName[a];else{if("number"!=typeof a||(0|a)!==a)return d.error("Unknown tag: "+a);e=a}return e>=31?d.error("Multi-octet tag encoding unsupported"):(b||(e|=32),e|=k.tagClassByName[c||"universal"]<<6)}var h=a("inherits"),Buffer=a("buffer").Buffer,i=a("../../asn1"),j=i.base,k=i.constants.der;b.exports=d,d.prototype.encode=function(a,b){return this.tree._encode(a,b).join()},h(e,j.Node),e.prototype._encodeComposite=function(a,b,c,d){var e=g(a,b,c,this.reporter);if(d.length<128){var f=new Buffer(2);return f[0]=e,f[1]=d.length,this._createEncoderBuffer([f,d])}for(var h=1,i=d.length;i>=256;i>>=8)h++;var f=new Buffer(2+h);f[0]=e,f[1]=128|h;for(var i=1+h,j=d.length;j>0;i--,j>>=8)f[i]=255&j;return this._createEncoderBuffer([f,d])},e.prototype._encodeStr=function(a,b){if("bitstr"===b)return this._createEncoderBuffer([0|a.unused,a.data]);if("bmpstr"===b){for(var c=new Buffer(2*a.length),d=0;d<a.length;d++)c.writeUInt16BE(a.charCodeAt(d),2*d);return this._createEncoderBuffer(c)}return"numstr"===b?this._isNumstr(a)?this._createEncoderBuffer(a):this.reporter.error("Encoding of string type: numstr supports only digits and space"):"printstr"===b?this._isPrintstr(a)?this._createEncoderBuffer(a):this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark"):/str$/.test(b)?this._createEncoderBuffer(a):"objDesc"===b?this._createEncoderBuffer(a):this.reporter.error("Encoding of string type: "+b+" unsupported")},e.prototype._encodeObjid=function(a,b,c){if("string"==typeof a){if(!b)return this.reporter.error("string objid given, but no values map found");if(!b.hasOwnProperty(a))return this.reporter.error("objid not found in values map");a=b[a].split(/[\s\.]+/g);for(var d=0;d<a.length;d++)a[d]|=0}else if(Array.isArray(a)){a=a.slice();for(var d=0;d<a.length;d++)a[d]|=0}if(!Array.isArray(a))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(a));if(!c){if(a[1]>=40)return this.reporter.error("Second objid identifier OOB");a.splice(0,2,40*a[0]+a[1])}for(var e=0,d=0;d<a.length;d++){var f=a[d];for(e++;f>=128;f>>=7)e++}for(var g=new Buffer(e),h=g.length-1,d=a.length-1;d>=0;d--){var f=a[d];for(g[h--]=127&f;(f>>=7)>0;)g[h--]=128|127&f}return this._createEncoderBuffer(g)},e.prototype._encodeTime=function(a,b){var c,d=new Date(a);return"gentime"===b?c=[f(d.getFullYear()),f(d.getUTCMonth()+1),f(d.getUTCDate()),f(d.getUTCHours()),f(d.getUTCMinutes()),f(d.getUTCSeconds()),"Z"].join(""):"utctime"===b?c=[f(d.getFullYear()%100),f(d.getUTCMonth()+1),f(d.getUTCDate()),f(d.getUTCHours()),f(d.getUTCMinutes()),f(d.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+b+" time is not supported yet"),this._encodeStr(c,"octstr")},e.prototype._encodeNull=function(){return this._createEncoderBuffer("")},e.prototype._encodeInt=function(a,b){if("string"==typeof a){if(!b)return this.reporter.error("String int or enum given, but no values map");if(!b.hasOwnProperty(a))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(a));a=b[a]}if("number"!=typeof a&&!Buffer.isBuffer(a)){var c=a.toArray();!a.sign&&128&c[0]&&c.unshift(0),a=new Buffer(c)}if(Buffer.isBuffer(a)){var d=a.length;0===a.length&&d++;var e=new Buffer(d);return a.copy(e),0===a.length&&(e[0]=0),this._createEncoderBuffer(e)}if(a<128)return this._createEncoderBuffer(a);if(a<256)return this._createEncoderBuffer([0,a]);for(var d=1,f=a;f>=256;f>>=8)d++;for(var e=new Array(d),f=e.length-1;f>=0;f--)e[f]=255&a,a>>=8;return 128&e[0]&&e.unshift(0),this._createEncoderBuffer(new Buffer(e))},e.prototype._encodeBool=function(a){return this._createEncoderBuffer(a?255:0)},e.prototype._use=function(a,b){return"function"==typeof a&&(a=a(b)),a._getEncoder("der").tree},e.prototype._skipDefault=function(a,b,c){var d,e=this._baseState;if(null===e.default)return!1;var f=a.join();if(void 0===e.defaultBuffer&&(e.defaultBuffer=this._encodeValue(e.default,b,c).join()),f.length!==e.defaultBuffer.length)return!1;for(d=0;d<f.length;d++)if(f[d]!==e.defaultBuffer[d])return!1;return!0}},{"../../asn1":116,buffer:104,inherits:226}],128:[function(a,b,c){var d=c;d.der=a("./der"),d.pem=a("./pem")},{"./der":127,"./pem":129}],129:[function(a,b,c){function d(a){f.call(this,a),this.enc="pem"}var e=a("inherits"),f=a("./der");e(d,f),b.exports=d,d.prototype.encode=function(a,b){for(var c=f.prototype.encode.call(this,a),d=c.toString("base64"),e=["-----BEGIN "+b.label+"-----"],g=0;g<d.length;g+=64)e.push(d.slice(g,g+64));return e.push("-----END "+b.label+"-----"),e.join("\n")}},{"./der":127,inherits:226}],130:[function(a,b,c){(function(Buffer){function c(a){var b=e(a),c=b.toRed(f.mont(a.modulus)).redPow(new f(a.publicExponent)).fromRed();return{blinder:c,unblinder:b.invm(a.modulus)}}function d(a,b){var d=c(b),e=b.modulus.byteLength(),g=(f.mont(b.modulus),new f(a).mul(d.blinder).umod(b.modulus)),h=g.toRed(f.mont(b.prime1)),i=g.toRed(f.mont(b.prime2)),j=b.coefficient,k=b.prime1,l=b.prime2,m=h.redPow(b.exponent1),n=i.redPow(b.exponent2);m=m.fromRed(),n=n.fromRed();var o=m.isub(n).imul(j).umod(k);return o.imul(l),n.iadd(o),new Buffer(n.imul(d.unblinder).umod(b.modulus).toArray(!1,e))}function e(a){for(var b=a.modulus.byteLength(),c=new f(g(b));c.cmp(a.modulus)>=0||!c.umod(a.prime1)||!c.umod(a.prime2);)c=new f(g(b));return c}var f=a("bn.js"),g=a("randombytes");b.exports=d,d.getr=e}).call(this,a("buffer").Buffer)},{"bn.js":75,buffer:104,randombytes:271}],131:[function(a,b,c){b.exports=a("./browser/algorithms.json")},{"./browser/algorithms.json":132}],132:[function(a,b,c){b.exports={sha224WithRSAEncryption:{sign:"rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},"RSA-SHA224":{sign:"ecdsa/rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},sha256WithRSAEncryption:{sign:"rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},"RSA-SHA256":{sign:"ecdsa/rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},sha384WithRSAEncryption:{sign:"rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},"RSA-SHA384":{sign:"ecdsa/rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},sha512WithRSAEncryption:{sign:"rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA512":{sign:"ecdsa/rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA1":{sign:"rsa",hash:"sha1",id:"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{sign:"ecdsa",hash:"sha1",id:""},sha256:{sign:"ecdsa",hash:"sha256",id:""},sha224:{sign:"ecdsa",hash:"sha224",id:""},sha384:{sign:"ecdsa",hash:"sha384",id:""},sha512:{sign:"ecdsa",hash:"sha512",id:""},"DSA-SHA":{sign:"dsa",hash:"sha1",id:""},"DSA-SHA1":{sign:"dsa",hash:"sha1",id:""},DSA:{sign:"dsa",hash:"sha1",id:""},"DSA-WITH-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-WITH-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-WITH-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-WITH-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-RIPEMD160":{sign:"dsa",hash:"rmd160",id:""},ripemd160WithRSA:{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},"RSA-RIPEMD160":{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},md5WithRSAEncryption:{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"},"RSA-MD5":{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"}}},{}],133:[function(a,b,c){b.exports={"1.3.132.0.10":"secp256k1","1.3.132.0.33":"p224","1.2.840.10045.3.1.1":"p192","1.2.840.10045.3.1.7":"p256","1.3.132.0.34":"p384","1.3.132.0.35":"p521"}},{}],134:[function(a,b,c){(function(Buffer){function c(a){h.Writable.call(this);var b=l[a];if(!b)throw new Error("Unknown message digest");this._hashType=b.hash,this._hash=g(b.hash),this._tag=b.id,this._signType=b.sign}function d(a){h.Writable.call(this);var b=l[a];if(!b)throw new Error("Unknown message digest");this._hash=g(b.hash),this._tag=b.id,this._signType=b.sign}function e(a){return new c(a)}function f(a){return new d(a)}var g=a("create-hash"),h=a("stream"),i=a("inherits"),j=a("./sign"),k=a("./verify"),l=a("./algorithms.json");Object.keys(l).forEach(function(a){l[a].id=new Buffer(l[a].id,"hex"),l[a.toLowerCase()]=l[a]}),i(c,h.Writable),c.prototype._write=function(a,b,c){this._hash.update(a),c()},c.prototype.update=function(a,b){return"string"==typeof a&&(a=new Buffer(a,b)),this._hash.update(a),this},c.prototype.sign=function(a,b){this.end();var c=this._hash.digest(),d=j(c,a,this._hashType,this._signType,this._tag);return b?d.toString(b):d},i(d,h.Writable),d.prototype._write=function(a,b,c){this._hash.update(a),c()},d.prototype.update=function(a,b){return"string"==typeof a&&(a=new Buffer(a,b)),this._hash.update(a),this},d.prototype.verify=function(a,b,c){"string"==typeof b&&(b=new Buffer(b,c)),this.end();var d=this._hash.digest();return k(b,d,a,this._signType,this._tag)},b.exports={Sign:e,Verify:f,createSign:e,createVerify:f}}).call(this,a("buffer").Buffer)},{"./algorithms.json":132,"./sign":135,"./verify":136,buffer:104,"create-hash":110,inherits:226,stream:304}],135:[function(a,b,c){(function(Buffer){function c(a,b,c,f,g){var h=p(b);if(h.curve){if("ecdsa"!==f&&"ecdsa/rsa"!==f)throw new Error("wrong private key type");return d(a,h)}if("dsa"===h.type){if("dsa"!==f)throw new Error("wrong private key type");return e(a,h,c)}if("rsa"!==f&&"ecdsa/rsa"!==f)throw new Error("wrong private key type");a=Buffer.concat([g,a]);for(var i=h.modulus.byteLength(),j=[0,1];a.length+j.length+1<i;)j.push(255);j.push(0);for(var k=-1;++k<a.length;)j.push(a[k]);var l=m(j,h);return l}function d(a,b){var c=q[b.curve.join(".")];if(!c)throw new Error("unknown curve "+b.curve.join("."));var d=new n(c),e=d.keyFromPrivate(b.privateKey),f=e.sign(a);return new Buffer(f.toDER())}function e(a,b,c){for(var d,e=b.params.priv_key,i=b.params.p,l=b.params.q,m=b.params.g,n=new o(0),p=h(a,l).mod(l),q=!1,r=g(e,l,a,c);q===!1;)d=j(l,r,c),n=k(m,d,i,l),q=d.invm(l).imul(p.add(e.mul(n))).mod(l),0===q.cmpn(0)&&(q=!1,n=new o(0));return f(n,q)}function f(a,b){a=a.toArray(),b=b.toArray(),128&a[0]&&(a=[0].concat(a)),128&b[0]&&(b=[0].concat(b));var c=a.length+b.length+4,d=[48,c,2,a.length];return d=d.concat(a,[2,b.length],b),new Buffer(d)}function g(a,b,c,d){if(a=new Buffer(a.toArray()),a.length<b.byteLength()){var e=new Buffer(b.byteLength()-a.length);e.fill(0),a=Buffer.concat([e,a])}var f=c.length,g=i(c,b),h=new Buffer(f);h.fill(1);var j=new Buffer(f);return j.fill(0),j=l(d,j).update(h).update(new Buffer([0])).update(a).update(g).digest(),h=l(d,j).update(h).digest(),j=l(d,j).update(h).update(new Buffer([1])).update(a).update(g).digest(),h=l(d,j).update(h).digest(),{k:j,v:h}}function h(a,b){var c=new o(a),d=(a.length<<3)-b.bitLength();return d>0&&c.ishrn(d),c}function i(a,b){a=h(a,b),a=a.mod(b);var c=new Buffer(a.toArray());if(c.length<b.byteLength()){var d=new Buffer(b.byteLength()-c.length);d.fill(0),c=Buffer.concat([d,c])}return c}function j(a,b,c){var d,e;do{for(d=new Buffer(0);8*d.length<a.bitLength();)b.v=l(c,b.k).update(b.v).digest(),d=Buffer.concat([d,b.v]);e=h(d,a),b.k=l(c,b.k).update(b.v).update(new Buffer([0])).digest(),b.v=l(c,b.k).update(b.v).digest()}while(e.cmp(a)!==-1);return e}function k(a,b,c,d){return a.toRed(o.mont(c)).redPow(b).fromRed().mod(d)}var l=a("create-hmac"),m=a("browserify-rsa"),n=a("elliptic").ec,o=a("bn.js"),p=a("parse-asn1"),q=a("./curves.json");b.exports=c,b.exports.getKey=g,b.exports.makeKey=j}).call(this,a("buffer").Buffer)},{"./curves.json":133,"bn.js":75,"browserify-rsa":130,buffer:104,"create-hmac":113,elliptic:192,"parse-asn1":141}],136:[function(a,b,c){(function(Buffer){function c(a,b,c,f,h){var j=i(c);if("ec"===j.type){if("ecdsa"!==f&&"ecdsa/rsa"!==f)throw new Error("wrong public key type");return d(a,b,j)}if("dsa"===j.type){if("dsa"!==f)throw new Error("wrong public key type");return e(a,b,j)}if("rsa"!==f&&"ecdsa/rsa"!==f)throw new Error("wrong public key type");b=Buffer.concat([h,b]);for(var k=j.modulus.byteLength(),l=[1],m=0;b.length+l.length+2<k;)l.push(255),m++;l.push(0);for(var n=-1;++n<b.length;)l.push(b[n]);l=new Buffer(l);var o=g.mont(j.modulus);a=new g(a).toRed(o),a=a.redPow(new g(j.publicExponent)),a=new Buffer(a.fromRed().toArray());var p=m<8?1:0;for(k=Math.min(a.length,l.length),a.length!==l.length&&(p=1),n=-1;++n<k;)p|=a[n]^l[n];return 0===p}function d(a,b,c){var d=j[c.data.algorithm.curve.join(".")];if(!d)throw new Error("unknown curve "+c.data.algorithm.curve.join("."));var e=new h(d),f=c.data.subjectPrivateKey.data;return e.verify(b,a,f)}function e(a,b,c){var d=c.data.p,e=c.data.q,h=c.data.g,j=c.data.pub_key,k=i.signature.decode(a,"der"),l=k.s,m=k.r;f(l,e),f(m,e);var n=g.mont(d),o=l.invm(e),p=h.toRed(n).redPow(new g(b).mul(o).mod(e)).fromRed().mul(j.toRed(n).redPow(m.mul(o).mod(e)).fromRed()).mod(d).mod(e);return 0===p.cmp(m)}function f(a,b){if(a.cmpn(0)<=0)throw new Error("invalid sig");if(a.cmp(b)>=b)throw new Error("invalid sig")}var g=a("bn.js"),h=a("elliptic").ec,i=a("parse-asn1"),j=a("./curves.json");b.exports=c}).call(this,a("buffer").Buffer)},{"./curves.json":133,"bn.js":75,buffer:104,elliptic:192,"parse-asn1":141}],137:[function(a,b,c){b.exports={"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}},{}],138:[function(a,b,c){"use strict";var d=a("asn1.js");c.certificate=a("./certificate");var e=d.define("RSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())});c.RSAPrivateKey=e;var f=d.define("RSAPublicKey",function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())});c.RSAPublicKey=f;var g=d.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(h),this.key("subjectPublicKey").bitstr())});c.PublicKey=g;var h=d.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())}),i=d.define("PrivateKeyInfo",function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(h),this.key("subjectPrivateKey").octstr())});c.PrivateKey=i;var j=d.define("EncryptedPrivateKeyInfo",function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())});c.EncryptedPrivateKey=j;var k=d.define("DSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())});c.DSAPrivateKey=k,c.DSAparam=d.define("DSAparam",function(){this.int()});var l=d.define("ECPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(m),this.key("publicKey").optional().explicit(1).bitstr())});c.ECPrivateKey=l;var m=d.define("ECParameters",function(){this.choice({namedCurve:this.objid()})});c.signature=d.define("signature",function(){this.seq().obj(this.key("r").int(),this.key("s").int())})},{"./certificate":139,"asn1.js":116}],139:[function(a,b,c){"use strict";var d=a("asn1.js"),e=d.define("Time",function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})}),f=d.define("AttributeTypeValue",function(){this.seq().obj(this.key("type").objid(),this.key("value").any())}),g=d.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional())}),h=d.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(g),this.key("subjectPublicKey").bitstr())}),i=d.define("RelativeDistinguishedName",function(){this.setof(f)}),j=d.define("RDNSequence",function(){this.seqof(i)}),k=d.define("Name",function(){this.choice({rdnSequence:this.use(j)})}),l=d.define("Validity",function(){this.seq().obj(this.key("notBefore").use(e),this.key("notAfter").use(e))}),m=d.define("Extension",function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())}),n=d.define("TBSCertificate",function(){this.seq().obj(this.key("version").explicit(0).int(),this.key("serialNumber").int(),this.key("signature").use(g),this.key("issuer").use(k),this.key("validity").use(l),this.key("subject").use(k),this.key("subjectPublicKeyInfo").use(h),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(m).optional())}),o=d.define("X509Certificate",function(){this.seq().obj(this.key("tbsCertificate").use(n),this.key("signatureAlgorithm").use(g),this.key("signatureValue").bitstr())});b.exports=o},{"asn1.js":116}],140:[function(a,b,c){(function(Buffer){var c=/Proc-Type: 4,ENCRYPTED\n\r?DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)\n\r?\n\r?([0-9A-z\n\r\+\/\=]+)\n\r?/m,d=/^-----BEGIN ((?:.* KEY)|CERTIFICATE)-----\n/m,e=/^-----BEGIN ((?:.* KEY)|CERTIFICATE)-----\n\r?([0-9A-z\n\r\+\/\=]+)\n\r?-----END \1-----$/m,f=a("evp_bytestokey"),g=a("browserify-aes"); |
| 12 |
|
b.exports=function(a,b){var h,i=a.toString(),j=i.match(c);if(j){var k="aes"+j[1],l=new Buffer(j[2],"hex"),m=new Buffer(j[3].replace(/\r?\n/g,""),"base64"),n=f(b,l.slice(0,8),parseInt(j[1],10)).key,o=[],p=g.createDecipheriv(k,n,l);o.push(p.update(m)),o.push(p.final()),h=Buffer.concat(o)}else{var q=i.match(e);h=new Buffer(q[2].replace(/\r?\n/g,""),"base64")}var r=i.match(d)[1];return{tag:r,data:h}}}).call(this,a("buffer").Buffer)},{"browserify-aes":80,buffer:104,evp_bytestokey:209}],141:[function(a,b,c){(function(Buffer){function c(a){var b;"object"!=typeof a||Buffer.isBuffer(a)||(b=a.passphrase,a=a.key),"string"==typeof a&&(a=new Buffer(a));var c,f,h=g(a,b),i=h.tag,j=h.data;switch(i){case"CERTIFICATE":f=e.certificate.decode(j,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(f||(f=e.PublicKey.decode(j,"der")),c=f.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return e.RSAPublicKey.decode(f.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return f.subjectPrivateKey=f.subjectPublicKey,{type:"ec",data:f};case"1.2.840.10040.4.1":return f.algorithm.params.pub_key=e.DSAparam.decode(f.subjectPublicKey.data,"der"),{type:"dsa",data:f.algorithm.params};default:throw new Error("unknown key id "+c)}throw new Error("unknown key type "+i);case"ENCRYPTED PRIVATE KEY":j=e.EncryptedPrivateKey.decode(j,"der"),j=d(j,b);case"PRIVATE KEY":switch(f=e.PrivateKey.decode(j,"der"),c=f.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return e.RSAPrivateKey.decode(f.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:f.algorithm.curve,privateKey:e.ECPrivateKey.decode(f.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return f.algorithm.params.priv_key=e.DSAparam.decode(f.subjectPrivateKey,"der"),{type:"dsa",params:f.algorithm.params};default:throw new Error("unknown key id "+c)}throw new Error("unknown key type "+i);case"RSA PUBLIC KEY":return e.RSAPublicKey.decode(j,"der");case"RSA PRIVATE KEY":return e.RSAPrivateKey.decode(j,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:e.DSAPrivateKey.decode(j,"der")};case"EC PRIVATE KEY":return j=e.ECPrivateKey.decode(j,"der"),{curve:j.parameters.value,privateKey:j.privateKey};default:throw new Error("unknown key type "+i)}}function d(a,b){var c=a.algorithm.decrypt.kde.kdeparams.salt,d=parseInt(a.algorithm.decrypt.kde.kdeparams.iters.toString(),10),e=f[a.algorithm.decrypt.cipher.algo.join(".")],g=a.algorithm.decrypt.cipher.iv,j=a.subjectPrivateKey,k=parseInt(e.split("-")[1],10)/8,l=i.pbkdf2Sync(b,c,d,k),m=h.createDecipheriv(e,l,g),n=[];return n.push(m.update(j)),n.push(m.final()),Buffer.concat(n)}var e=a("./asn1"),f=a("./aesid.json"),g=a("./fixProc"),h=a("browserify-aes"),i=a("pbkdf2");b.exports=c,c.signature=e.signature}).call(this,a("buffer").Buffer)},{"./aesid.json":137,"./asn1":138,"./fixProc":140,"browserify-aes":80,buffer:104,pbkdf2:236}],142:[function(a,b,c){!function(d,e,f){"object"==typeof c?b.exports=c=e(a("./core"),a("./enc-base64"),a("./md5"),a("./evpkdf"),a("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(d.CryptoJS)}(this,function(a){return function(){var b=a,c=b.lib,d=c.BlockCipher,e=b.algo,f=[],g=[],h=[],i=[],j=[],k=[],l=[],m=[],n=[],o=[];!function(){for(var a=[],b=0;b<256;b++)b<128?a[b]=b<<1:a[b]=b<<1^283;for(var c=0,d=0,b=0;b<256;b++){var e=d^d<<1^d<<2^d<<3^d<<4;e=e>>>8^255&e^99,f[c]=e,g[e]=c;var p=a[c],q=a[p],r=a[q],s=257*a[e]^16843008*e;h[c]=s<<24|s>>>8,i[c]=s<<16|s>>>16,j[c]=s<<8|s>>>24,k[c]=s;var s=16843009*r^65537*q^257*p^16843008*c;l[e]=s<<24|s>>>8,m[e]=s<<16|s>>>16,n[e]=s<<8|s>>>24,o[e]=s,c?(c=p^a[a[a[r^p]]],d^=a[a[d]]):c=d=1}}();var p=[0,1,2,4,8,16,32,64,128,27,54],q=e.AES=d.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var a=this._keyPriorReset=this._key,b=a.words,c=a.sigBytes/4,d=this._nRounds=c+6,e=4*(d+1),g=this._keySchedule=[],h=0;h<e;h++)if(h<c)g[h]=b[h];else{var i=g[h-1];h%c?c>6&&h%c==4&&(i=f[i>>>24]<<24|f[i>>>16&255]<<16|f[i>>>8&255]<<8|f[255&i]):(i=i<<8|i>>>24,i=f[i>>>24]<<24|f[i>>>16&255]<<16|f[i>>>8&255]<<8|f[255&i],i^=p[h/c|0]<<24),g[h]=g[h-c]^i}for(var j=this._invKeySchedule=[],k=0;k<e;k++){var h=e-k;if(k%4)var i=g[h];else var i=g[h-4];k<4||h<=4?j[k]=i:j[k]=l[f[i>>>24]]^m[f[i>>>16&255]]^n[f[i>>>8&255]]^o[f[255&i]]}}},encryptBlock:function(a,b){this._doCryptBlock(a,b,this._keySchedule,h,i,j,k,f)},decryptBlock:function(a,b){var c=a[b+1];a[b+1]=a[b+3],a[b+3]=c,this._doCryptBlock(a,b,this._invKeySchedule,l,m,n,o,g);var c=a[b+1];a[b+1]=a[b+3],a[b+3]=c},_doCryptBlock:function(a,b,c,d,e,f,g,h){for(var i=this._nRounds,j=a[b]^c[0],k=a[b+1]^c[1],l=a[b+2]^c[2],m=a[b+3]^c[3],n=4,o=1;o<i;o++){var p=d[j>>>24]^e[k>>>16&255]^f[l>>>8&255]^g[255&m]^c[n++],q=d[k>>>24]^e[l>>>16&255]^f[m>>>8&255]^g[255&j]^c[n++],r=d[l>>>24]^e[m>>>16&255]^f[j>>>8&255]^g[255&k]^c[n++],s=d[m>>>24]^e[j>>>16&255]^f[k>>>8&255]^g[255&l]^c[n++];j=p,k=q,l=r,m=s}var p=(h[j>>>24]<<24|h[k>>>16&255]<<16|h[l>>>8&255]<<8|h[255&m])^c[n++],q=(h[k>>>24]<<24|h[l>>>16&255]<<16|h[m>>>8&255]<<8|h[255&j])^c[n++],r=(h[l>>>24]<<24|h[m>>>16&255]<<16|h[j>>>8&255]<<8|h[255&k])^c[n++],s=(h[m>>>24]<<24|h[j>>>16&255]<<16|h[k>>>8&255]<<8|h[255&l])^c[n++];a[b]=p,a[b+1]=q,a[b+2]=r,a[b+3]=s},keySize:8});b.AES=d._createHelper(q)}(),a.AES})},{"./cipher-core":143,"./core":144,"./enc-base64":145,"./evpkdf":147,"./md5":152}],143:[function(a,b,c){!function(d,e){"object"==typeof c?b.exports=c=e(a("./core")):"function"==typeof define&&define.amd?define(["./core"],e):e(d.CryptoJS)}(this,function(a){a.lib.Cipher||function(b){var c=a,d=c.lib,e=d.Base,f=d.WordArray,g=d.BufferedBlockAlgorithm,h=c.enc,i=(h.Utf8,h.Base64),j=c.algo,k=j.EvpKDF,l=d.Cipher=g.extend({cfg:e.extend(),createEncryptor:function(a,b){return this.create(this._ENC_XFORM_MODE,a,b)},createDecryptor:function(a,b){return this.create(this._DEC_XFORM_MODE,a,b)},init:function(a,b,c){this.cfg=this.cfg.extend(c),this._xformMode=a,this._key=b,this.reset()},reset:function(){g.reset.call(this),this._doReset()},process:function(a){return this._append(a),this._process()},finalize:function(a){a&&this._append(a);var b=this._doFinalize();return b},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function a(a){return"string"==typeof a?x:u}return function(b){return{encrypt:function(c,d,e){return a(d).encrypt(b,c,d,e)},decrypt:function(c,d,e){return a(d).decrypt(b,c,d,e)}}}}()}),m=(d.StreamCipher=l.extend({_doFinalize:function(){var a=this._process(!0);return a},blockSize:1}),c.mode={}),n=d.BlockCipherMode=e.extend({createEncryptor:function(a,b){return this.Encryptor.create(a,b)},createDecryptor:function(a,b){return this.Decryptor.create(a,b)},init:function(a,b){this._cipher=a,this._iv=b}}),o=m.CBC=function(){function a(a,c,d){var e=this._iv;if(e){var f=e;this._iv=b}else var f=this._prevBlock;for(var g=0;g<d;g++)a[c+g]^=f[g]}var c=n.extend();return c.Encryptor=c.extend({processBlock:function(b,c){var d=this._cipher,e=d.blockSize;a.call(this,b,c,e),d.encryptBlock(b,c),this._prevBlock=b.slice(c,c+e)}}),c.Decryptor=c.extend({processBlock:function(b,c){var d=this._cipher,e=d.blockSize,f=b.slice(c,c+e);d.decryptBlock(b,c),a.call(this,b,c,e),this._prevBlock=f}}),c}(),p=c.pad={},q=p.Pkcs7={pad:function(a,b){for(var c=4*b,d=c-a.sigBytes%c,e=d<<24|d<<16|d<<8|d,g=[],h=0;h<d;h+=4)g.push(e);var i=f.create(g,d);a.concat(i)},unpad:function(a){var b=255&a.words[a.sigBytes-1>>>2];a.sigBytes-=b}},r=(d.BlockCipher=l.extend({cfg:l.cfg.extend({mode:o,padding:q}),reset:function(){l.reset.call(this);var a=this.cfg,b=a.iv,c=a.mode;if(this._xformMode==this._ENC_XFORM_MODE)var d=c.createEncryptor;else{var d=c.createDecryptor;this._minBufferSize=1}this._mode=d.call(c,this,b&&b.words)},_doProcessBlock:function(a,b){this._mode.processBlock(a,b)},_doFinalize:function(){var a=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){a.pad(this._data,this.blockSize);var b=this._process(!0)}else{var b=this._process(!0);a.unpad(b)}return b},blockSize:4}),d.CipherParams=e.extend({init:function(a){this.mixIn(a)},toString:function(a){return(a||this.formatter).stringify(this)}})),s=c.format={},t=s.OpenSSL={stringify:function(a){var b=a.ciphertext,c=a.salt;if(c)var d=f.create([1398893684,1701076831]).concat(c).concat(b);else var d=b;return d.toString(i)},parse:function(a){var b=i.parse(a),c=b.words;if(1398893684==c[0]&&1701076831==c[1]){var d=f.create(c.slice(2,4));c.splice(0,4),b.sigBytes-=16}return r.create({ciphertext:b,salt:d})}},u=d.SerializableCipher=e.extend({cfg:e.extend({format:t}),encrypt:function(a,b,c,d){d=this.cfg.extend(d);var e=a.createEncryptor(c,d),f=e.finalize(b),g=e.cfg;return r.create({ciphertext:f,key:c,iv:g.iv,algorithm:a,mode:g.mode,padding:g.padding,blockSize:a.blockSize,formatter:d.format})},decrypt:function(a,b,c,d){d=this.cfg.extend(d),b=this._parse(b,d.format);var e=a.createDecryptor(c,d).finalize(b.ciphertext);return e},_parse:function(a,b){return"string"==typeof a?b.parse(a,this):a}}),v=c.kdf={},w=v.OpenSSL={execute:function(a,b,c,d){d||(d=f.random(8));var e=k.create({keySize:b+c}).compute(a,d),g=f.create(e.words.slice(b),4*c);return e.sigBytes=4*b,r.create({key:e,iv:g,salt:d})}},x=d.PasswordBasedCipher=u.extend({cfg:u.cfg.extend({kdf:w}),encrypt:function(a,b,c,d){d=this.cfg.extend(d);var e=d.kdf.execute(c,a.keySize,a.ivSize);d.iv=e.iv;var f=u.encrypt.call(this,a,b,e.key,d);return f.mixIn(e),f},decrypt:function(a,b,c,d){d=this.cfg.extend(d),b=this._parse(b,d.format);var e=d.kdf.execute(c,a.keySize,a.ivSize,b.salt);d.iv=e.iv;var f=u.decrypt.call(this,a,b,e.key,d);return f}})}()})},{"./core":144}],144:[function(a,b,c){!function(a,d){"object"==typeof c?b.exports=c=d():"function"==typeof define&&define.amd?define([],d):a.CryptoJS=d()}(this,function(){var a=a||function(a,b){var c=Object.create||function(){function a(){}return function(b){var c;return a.prototype=b,c=new a,a.prototype=null,c}}(),d={},e=d.lib={},f=e.Base=function(){return{extend:function(a){var b=c(this);return a&&b.mixIn(a),b.hasOwnProperty("init")&&this.init!==b.init||(b.init=function(){b.$super.init.apply(this,arguments)}),b.init.prototype=b,b.$super=this,b},create:function(){var a=this.extend();return a.init.apply(a,arguments),a},init:function(){},mixIn:function(a){for(var b in a)a.hasOwnProperty(b)&&(this[b]=a[b]);a.hasOwnProperty("toString")&&(this.toString=a.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),g=e.WordArray=f.extend({init:function(a,c){a=this.words=a||[],c!=b?this.sigBytes=c:this.sigBytes=4*a.length},toString:function(a){return(a||i).stringify(this)},concat:function(a){var b=this.words,c=a.words,d=this.sigBytes,e=a.sigBytes;if(this.clamp(),d%4)for(var f=0;f<e;f++){var g=c[f>>>2]>>>24-f%4*8&255;b[d+f>>>2]|=g<<24-(d+f)%4*8}else for(var f=0;f<e;f+=4)b[d+f>>>2]=c[f>>>2];return this.sigBytes+=e,this},clamp:function(){var b=this.words,c=this.sigBytes;b[c>>>2]&=4294967295<<32-c%4*8,b.length=a.ceil(c/4)},clone:function(){var a=f.clone.call(this);return a.words=this.words.slice(0),a},random:function(b){for(var c,d=[],e=function(b){var b=b,c=987654321,d=4294967295;return function(){c=36969*(65535&c)+(c>>16)&d,b=18e3*(65535&b)+(b>>16)&d;var e=(c<<16)+b&d;return e/=4294967296,e+=.5,e*(a.random()>.5?1:-1)}},f=0;f<b;f+=4){var h=e(4294967296*(c||a.random()));c=987654071*h(),d.push(4294967296*h()|0)}return new g.init(d,b)}}),h=d.enc={},i=h.Hex={stringify:function(a){for(var b=a.words,c=a.sigBytes,d=[],e=0;e<c;e++){var f=b[e>>>2]>>>24-e%4*8&255;d.push((f>>>4).toString(16)),d.push((15&f).toString(16))}return d.join("")},parse:function(a){for(var b=a.length,c=[],d=0;d<b;d+=2)c[d>>>3]|=parseInt(a.substr(d,2),16)<<24-d%8*4;return new g.init(c,b/2)}},j=h.Latin1={stringify:function(a){for(var b=a.words,c=a.sigBytes,d=[],e=0;e<c;e++){var f=b[e>>>2]>>>24-e%4*8&255;d.push(String.fromCharCode(f))}return d.join("")},parse:function(a){for(var b=a.length,c=[],d=0;d<b;d++)c[d>>>2]|=(255&a.charCodeAt(d))<<24-d%4*8;return new g.init(c,b)}},k=h.Utf8={stringify:function(a){try{return decodeURIComponent(escape(j.stringify(a)))}catch(a){throw new Error("Malformed UTF-8 data")}},parse:function(a){return j.parse(unescape(encodeURIComponent(a)))}},l=e.BufferedBlockAlgorithm=f.extend({reset:function(){this._data=new g.init,this._nDataBytes=0},_append:function(a){"string"==typeof a&&(a=k.parse(a)),this._data.concat(a),this._nDataBytes+=a.sigBytes},_process:function(b){var c=this._data,d=c.words,e=c.sigBytes,f=this.blockSize,h=4*f,i=e/h;i=b?a.ceil(i):a.max((0|i)-this._minBufferSize,0);var j=i*f,k=a.min(4*j,e);if(j){for(var l=0;l<j;l+=f)this._doProcessBlock(d,l);var m=d.splice(0,j);c.sigBytes-=k}return new g.init(m,k)},clone:function(){var a=f.clone.call(this);return a._data=this._data.clone(),a},_minBufferSize:0}),m=(e.Hasher=l.extend({cfg:f.extend(),init:function(a){this.cfg=this.cfg.extend(a),this.reset()},reset:function(){l.reset.call(this),this._doReset()},update:function(a){return this._append(a),this._process(),this},finalize:function(a){a&&this._append(a);var b=this._doFinalize();return b},blockSize:16,_createHelper:function(a){return function(b,c){return new a.init(c).finalize(b)}},_createHmacHelper:function(a){return function(b,c){return new m.HMAC.init(a,c).finalize(b)}}}),d.algo={});return d}(Math);return a})},{}],145:[function(a,b,c){!function(d,e){"object"==typeof c?b.exports=c=e(a("./core")):"function"==typeof define&&define.amd?define(["./core"],e):e(d.CryptoJS)}(this,function(a){return function(){function b(a,b,c){for(var d=[],f=0,g=0;g<b;g++)if(g%4){var h=c[a.charCodeAt(g-1)]<<g%4*2,i=c[a.charCodeAt(g)]>>>6-g%4*2;d[f>>>2]|=(h|i)<<24-f%4*8,f++}return e.create(d,f)}var c=a,d=c.lib,e=d.WordArray,f=c.enc;f.Base64={stringify:function(a){var b=a.words,c=a.sigBytes,d=this._map;a.clamp();for(var e=[],f=0;f<c;f+=3)for(var g=b[f>>>2]>>>24-f%4*8&255,h=b[f+1>>>2]>>>24-(f+1)%4*8&255,i=b[f+2>>>2]>>>24-(f+2)%4*8&255,j=g<<16|h<<8|i,k=0;k<4&&f+.75*k<c;k++)e.push(d.charAt(j>>>6*(3-k)&63));var l=d.charAt(64);if(l)for(;e.length%4;)e.push(l);return e.join("")},parse:function(a){var c=a.length,d=this._map,e=this._reverseMap;if(!e){e=this._reverseMap=[];for(var f=0;f<d.length;f++)e[d.charCodeAt(f)]=f}var g=d.charAt(64);if(g){var h=a.indexOf(g);h!==-1&&(c=h)}return b(a,c,e)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),a.enc.Base64})},{"./core":144}],146:[function(a,b,c){!function(d,e){"object"==typeof c?b.exports=c=e(a("./core")):"function"==typeof define&&define.amd?define(["./core"],e):e(d.CryptoJS)}(this,function(a){return function(){function b(a){return a<<8&4278255360|a>>>8&16711935}var c=a,d=c.lib,e=d.WordArray,f=c.enc;f.Utf16=f.Utf16BE={stringify:function(a){for(var b=a.words,c=a.sigBytes,d=[],e=0;e<c;e+=2){var f=b[e>>>2]>>>16-e%4*8&65535;d.push(String.fromCharCode(f))}return d.join("")},parse:function(a){for(var b=a.length,c=[],d=0;d<b;d++)c[d>>>1]|=a.charCodeAt(d)<<16-d%2*16;return e.create(c,2*b)}};f.Utf16LE={stringify:function(a){for(var c=a.words,d=a.sigBytes,e=[],f=0;f<d;f+=2){var g=b(c[f>>>2]>>>16-f%4*8&65535);e.push(String.fromCharCode(g))}return e.join("")},parse:function(a){for(var c=a.length,d=[],f=0;f<c;f++)d[f>>>1]|=b(a.charCodeAt(f)<<16-f%2*16);return e.create(d,2*c)}}}(),a.enc.Utf16})},{"./core":144}],147:[function(a,b,c){!function(d,e,f){"object"==typeof c?b.exports=c=e(a("./core"),a("./sha1"),a("./hmac")):"function"==typeof define&&define.amd?define(["./core","./sha1","./hmac"],e):e(d.CryptoJS)}(this,function(a){return function(){var b=a,c=b.lib,d=c.Base,e=c.WordArray,f=b.algo,g=f.MD5,h=f.EvpKDF=d.extend({cfg:d.extend({keySize:4,hasher:g,iterations:1}),init:function(a){this.cfg=this.cfg.extend(a)},compute:function(a,b){for(var c=this.cfg,d=c.hasher.create(),f=e.create(),g=f.words,h=c.keySize,i=c.iterations;g.length<h;){j&&d.update(j);var j=d.update(a).finalize(b);d.reset();for(var k=1;k<i;k++)j=d.finalize(j),d.reset();f.concat(j)}return f.sigBytes=4*h,f}});b.EvpKDF=function(a,b,c){return h.create(c).compute(a,b)}}(),a.EvpKDF})},{"./core":144,"./hmac":149,"./sha1":168}],148:[function(a,b,c){!function(d,e,f){"object"==typeof c?b.exports=c=e(a("./core"),a("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],e):e(d.CryptoJS)}(this,function(a){return function(b){var c=a,d=c.lib,e=d.CipherParams,f=c.enc,g=f.Hex,h=c.format;h.Hex={stringify:function(a){return a.ciphertext.toString(g)},parse:function(a){var b=g.parse(a);return e.create({ciphertext:b})}}}(),a.format.Hex})},{"./cipher-core":143,"./core":144}],149:[function(a,b,c){!function(d,e){"object"==typeof c?b.exports=c=e(a("./core")):"function"==typeof define&&define.amd?define(["./core"],e):e(d.CryptoJS)}(this,function(a){!function(){var b=a,c=b.lib,d=c.Base,e=b.enc,f=e.Utf8,g=b.algo;g.HMAC=d.extend({init:function(a,b){a=this._hasher=new a.init,"string"==typeof b&&(b=f.parse(b));var c=a.blockSize,d=4*c;b.sigBytes>d&&(b=a.finalize(b)),b.clamp();for(var e=this._oKey=b.clone(),g=this._iKey=b.clone(),h=e.words,i=g.words,j=0;j<c;j++)h[j]^=1549556828,i[j]^=909522486;e.sigBytes=g.sigBytes=d,this.reset()},reset:function(){var a=this._hasher;a.reset(),a.update(this._iKey)},update:function(a){return this._hasher.update(a),this},finalize:function(a){var b=this._hasher,c=b.finalize(a);b.reset();var d=b.finalize(this._oKey.clone().concat(c));return d}})}()})},{"./core":144}],150:[function(a,b,c){!function(d,e,f){"object"==typeof c?b.exports=c=e(a("./core"),a("./x64-core"),a("./lib-typedarrays"),a("./enc-utf16"),a("./enc-base64"),a("./md5"),a("./sha1"),a("./sha256"),a("./sha224"),a("./sha512"),a("./sha384"),a("./sha3"),a("./ripemd160"),a("./hmac"),a("./pbkdf2"),a("./evpkdf"),a("./cipher-core"),a("./mode-cfb"),a("./mode-ctr"),a("./mode-ctr-gladman"),a("./mode-ofb"),a("./mode-ecb"),a("./pad-ansix923"),a("./pad-iso10126"),a("./pad-iso97971"),a("./pad-zeropadding"),a("./pad-nopadding"),a("./format-hex"),a("./aes"),a("./tripledes"),a("./rc4"),a("./rabbit"),a("./rabbit-legacy")):"function"==typeof define&&define.amd?define(["./core","./x64-core","./lib-typedarrays","./enc-utf16","./enc-base64","./md5","./sha1","./sha256","./sha224","./sha512","./sha384","./sha3","./ripemd160","./hmac","./pbkdf2","./evpkdf","./cipher-core","./mode-cfb","./mode-ctr","./mode-ctr-gladman","./mode-ofb","./mode-ecb","./pad-ansix923","./pad-iso10126","./pad-iso97971","./pad-zeropadding","./pad-nopadding","./format-hex","./aes","./tripledes","./rc4","./rabbit","./rabbit-legacy"],e):d.CryptoJS=e(d.CryptoJS)}(this,function(a){return a})},{"./aes":142,"./cipher-core":143,"./core":144,"./enc-base64":145,"./enc-utf16":146,"./evpkdf":147,"./format-hex":148,"./hmac":149,"./lib-typedarrays":151,"./md5":152,"./mode-cfb":153,"./mode-ctr":155,"./mode-ctr-gladman":154,"./mode-ecb":156,"./mode-ofb":157,"./pad-ansix923":158,"./pad-iso10126":159,"./pad-iso97971":160,"./pad-nopadding":161,"./pad-zeropadding":162,"./pbkdf2":163,"./rabbit":165,"./rabbit-legacy":164,"./rc4":166,"./ripemd160":167,"./sha1":168,"./sha224":169,"./sha256":170,"./sha3":171,"./sha384":172,"./sha512":173,"./tripledes":174,"./x64-core":175}],151:[function(a,b,c){!function(d,e){"object"==typeof c?b.exports=c=e(a("./core")):"function"==typeof define&&define.amd?define(["./core"],e):e(d.CryptoJS)}(this,function(a){return function(){if("function"==typeof ArrayBuffer){var b=a,c=b.lib,d=c.WordArray,e=d.init,f=d.init=function(a){if(a instanceof ArrayBuffer&&(a=new Uint8Array(a)),(a instanceof Int8Array||"undefined"!=typeof Uint8ClampedArray&&a instanceof Uint8ClampedArray||a instanceof Int16Array||a instanceof Uint16Array||a instanceof Int32Array||a instanceof Uint32Array||a instanceof Float32Array||a instanceof Float64Array)&&(a=new Uint8Array(a.buffer,a.byteOffset,a.byteLength)),a instanceof Uint8Array){for(var b=a.byteLength,c=[],d=0;d<b;d++)c[d>>>2]|=a[d]<<24-d%4*8;e.call(this,c,b)}else e.apply(this,arguments)};f.prototype=d}}(),a.lib.WordArray})},{"./core":144}],152:[function(a,b,c){!function(d,e){"object"==typeof c?b.exports=c=e(a("./core")):"function"==typeof define&&define.amd?define(["./core"],e):e(d.CryptoJS)}(this,function(a){return function(b){function c(a,b,c,d,e,f,g){var h=a+(b&c|~b&d)+e+g;return(h<<f|h>>>32-f)+b}function d(a,b,c,d,e,f,g){var h=a+(b&d|c&~d)+e+g;return(h<<f|h>>>32-f)+b}function e(a,b,c,d,e,f,g){var h=a+(b^c^d)+e+g;return(h<<f|h>>>32-f)+b}function f(a,b,c,d,e,f,g){var h=a+(c^(b|~d))+e+g;return(h<<f|h>>>32-f)+b}var g=a,h=g.lib,i=h.WordArray,j=h.Hasher,k=g.algo,l=[];!function(){for(var a=0;a<64;a++)l[a]=4294967296*b.abs(b.sin(a+1))|0}();var m=k.MD5=j.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(a,b){for(var g=0;g<16;g++){var h=b+g,i=a[h];a[h]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var j=this._hash.words,k=a[b+0],m=a[b+1],n=a[b+2],o=a[b+3],p=a[b+4],q=a[b+5],r=a[b+6],s=a[b+7],t=a[b+8],u=a[b+9],v=a[b+10],w=a[b+11],x=a[b+12],y=a[b+13],z=a[b+14],A=a[b+15],B=j[0],C=j[1],D=j[2],E=j[3];B=c(B,C,D,E,k,7,l[0]),E=c(E,B,C,D,m,12,l[1]),D=c(D,E,B,C,n,17,l[2]),C=c(C,D,E,B,o,22,l[3]),B=c(B,C,D,E,p,7,l[4]),E=c(E,B,C,D,q,12,l[5]),D=c(D,E,B,C,r,17,l[6]),C=c(C,D,E,B,s,22,l[7]),B=c(B,C,D,E,t,7,l[8]),E=c(E,B,C,D,u,12,l[9]),D=c(D,E,B,C,v,17,l[10]),C=c(C,D,E,B,w,22,l[11]),B=c(B,C,D,E,x,7,l[12]),E=c(E,B,C,D,y,12,l[13]),D=c(D,E,B,C,z,17,l[14]),C=c(C,D,E,B,A,22,l[15]),B=d(B,C,D,E,m,5,l[16]),E=d(E,B,C,D,r,9,l[17]),D=d(D,E,B,C,w,14,l[18]),C=d(C,D,E,B,k,20,l[19]),B=d(B,C,D,E,q,5,l[20]),E=d(E,B,C,D,v,9,l[21]),D=d(D,E,B,C,A,14,l[22]),C=d(C,D,E,B,p,20,l[23]),B=d(B,C,D,E,u,5,l[24]),E=d(E,B,C,D,z,9,l[25]),D=d(D,E,B,C,o,14,l[26]),C=d(C,D,E,B,t,20,l[27]),B=d(B,C,D,E,y,5,l[28]),E=d(E,B,C,D,n,9,l[29]),D=d(D,E,B,C,s,14,l[30]),C=d(C,D,E,B,x,20,l[31]),B=e(B,C,D,E,q,4,l[32]),E=e(E,B,C,D,t,11,l[33]),D=e(D,E,B,C,w,16,l[34]),C=e(C,D,E,B,z,23,l[35]),B=e(B,C,D,E,m,4,l[36]),E=e(E,B,C,D,p,11,l[37]),D=e(D,E,B,C,s,16,l[38]),C=e(C,D,E,B,v,23,l[39]),B=e(B,C,D,E,y,4,l[40]),E=e(E,B,C,D,k,11,l[41]),D=e(D,E,B,C,o,16,l[42]),C=e(C,D,E,B,r,23,l[43]),B=e(B,C,D,E,u,4,l[44]),E=e(E,B,C,D,x,11,l[45]),D=e(D,E,B,C,A,16,l[46]),C=e(C,D,E,B,n,23,l[47]),B=f(B,C,D,E,k,6,l[48]),E=f(E,B,C,D,s,10,l[49]),D=f(D,E,B,C,z,15,l[50]),C=f(C,D,E,B,q,21,l[51]),B=f(B,C,D,E,x,6,l[52]),E=f(E,B,C,D,o,10,l[53]),D=f(D,E,B,C,v,15,l[54]),C=f(C,D,E,B,m,21,l[55]),B=f(B,C,D,E,t,6,l[56]),E=f(E,B,C,D,A,10,l[57]),D=f(D,E,B,C,r,15,l[58]),C=f(C,D,E,B,y,21,l[59]),B=f(B,C,D,E,p,6,l[60]),E=f(E,B,C,D,w,10,l[61]),D=f(D,E,B,C,n,15,l[62]),C=f(C,D,E,B,u,21,l[63]),j[0]=j[0]+B|0,j[1]=j[1]+C|0,j[2]=j[2]+D|0,j[3]=j[3]+E|0},_doFinalize:function(){var a=this._data,c=a.words,d=8*this._nDataBytes,e=8*a.sigBytes;c[e>>>5]|=128<<24-e%32;var f=b.floor(d/4294967296),g=d;c[(e+64>>>9<<4)+15]=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8),c[(e+64>>>9<<4)+14]=16711935&(g<<8|g>>>24)|4278255360&(g<<24|g>>>8),a.sigBytes=4*(c.length+1),this._process();for(var h=this._hash,i=h.words,j=0;j<4;j++){var k=i[j];i[j]=16711935&(k<<8|k>>>24)|4278255360&(k<<24|k>>>8)}return h},clone:function(){var a=j.clone.call(this);return a._hash=this._hash.clone(),a}});g.MD5=j._createHelper(m),g.HmacMD5=j._createHmacHelper(m)}(Math),a.MD5})},{"./core":144}],153:[function(a,b,c){!function(d,e,f){"object"==typeof c?b.exports=c=e(a("./core"),a("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],e):e(d.CryptoJS)}(this,function(a){return a.mode.CFB=function(){function b(a,b,c,d){var e=this._iv;if(e){var f=e.slice(0);this._iv=void 0}else var f=this._prevBlock;d.encryptBlock(f,0);for(var g=0;g<c;g++)a[b+g]^=f[g]}var c=a.lib.BlockCipherMode.extend();return c.Encryptor=c.extend({processBlock:function(a,c){var d=this._cipher,e=d.blockSize;b.call(this,a,c,e,d),this._prevBlock=a.slice(c,c+e)}}),c.Decryptor=c.extend({processBlock:function(a,c){var d=this._cipher,e=d.blockSize,f=a.slice(c,c+e);b.call(this,a,c,e,d),this._prevBlock=f}}),c}(),a.mode.CFB})},{"./cipher-core":143,"./core":144}],154:[function(a,b,c){!function(d,e,f){"object"==typeof c?b.exports=c=e(a("./core"),a("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],e):e(d.CryptoJS)}(this,function(a){return a.mode.CTRGladman=function(){function b(a){if(255===(a>>24&255)){var b=a>>16&255,c=a>>8&255,d=255&a;255===b?(b=0,255===c?(c=0,255===d?d=0:++d):++c):++b,a=0,a+=b<<16,a+=c<<8,a+=d}else a+=1<<24;return a}function c(a){return 0===(a[0]=b(a[0]))&&(a[1]=b(a[1])),a}var d=a.lib.BlockCipherMode.extend(),e=d.Encryptor=d.extend({processBlock:function(a,b){var d=this._cipher,e=d.blockSize,f=this._iv,g=this._counter;f&&(g=this._counter=f.slice(0),this._iv=void 0),c(g);var h=g.slice(0);d.encryptBlock(h,0);for(var i=0;i<e;i++)a[b+i]^=h[i]}});return d.Decryptor=e,d}(),a.mode.CTRGladman})},{"./cipher-core":143,"./core":144}],155:[function(a,b,c){!function(d,e,f){"object"==typeof c?b.exports=c=e(a("./core"),a("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],e):e(d.CryptoJS)}(this,function(a){return a.mode.CTR=function(){var b=a.lib.BlockCipherMode.extend(),c=b.Encryptor=b.extend({processBlock:function(a,b){var c=this._cipher,d=c.blockSize,e=this._iv,f=this._counter;e&&(f=this._counter=e.slice(0),this._iv=void 0);var g=f.slice(0);c.encryptBlock(g,0),f[d-1]=f[d-1]+1|0;for(var h=0;h<d;h++)a[b+h]^=g[h]}});return b.Decryptor=c,b}(),a.mode.CTR})},{"./cipher-core":143,"./core":144}],156:[function(a,b,c){!function(d,e,f){"object"==typeof c?b.exports=c=e(a("./core"),a("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],e):e(d.CryptoJS)}(this,function(a){return a.mode.ECB=function(){var b=a.lib.BlockCipherMode.extend();return b.Encryptor=b.extend({processBlock:function(a,b){this._cipher.encryptBlock(a,b)}}),b.Decryptor=b.extend({processBlock:function(a,b){this._cipher.decryptBlock(a,b)}}),b}(),a.mode.ECB})},{"./cipher-core":143,"./core":144}],157:[function(a,b,c){!function(d,e,f){"object"==typeof c?b.exports=c=e(a("./core"),a("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],e):e(d.CryptoJS)}(this,function(a){return a.mode.OFB=function(){var b=a.lib.BlockCipherMode.extend(),c=b.Encryptor=b.extend({processBlock:function(a,b){var c=this._cipher,d=c.blockSize,e=this._iv,f=this._keystream;e&&(f=this._keystream=e.slice(0),this._iv=void 0),c.encryptBlock(f,0);for(var g=0;g<d;g++)a[b+g]^=f[g]}});return b.Decryptor=c,b}(),a.mode.OFB})},{"./cipher-core":143,"./core":144}],158:[function(a,b,c){!function(d,e,f){"object"==typeof c?b.exports=c=e(a("./core"),a("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],e):e(d.CryptoJS)}(this,function(a){return a.pad.AnsiX923={pad:function(a,b){var c=a.sigBytes,d=4*b,e=d-c%d,f=c+e-1;a.clamp(),a.words[f>>>2]|=e<<24-f%4*8,a.sigBytes+=e},unpad:function(a){var b=255&a.words[a.sigBytes-1>>>2];a.sigBytes-=b}},a.pad.Ansix923})},{"./cipher-core":143,"./core":144}],159:[function(a,b,c){!function(d,e,f){"object"==typeof c?b.exports=c=e(a("./core"),a("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],e):e(d.CryptoJS)}(this,function(a){return a.pad.Iso10126={pad:function(b,c){var d=4*c,e=d-b.sigBytes%d;b.concat(a.lib.WordArray.random(e-1)).concat(a.lib.WordArray.create([e<<24],1))},unpad:function(a){var b=255&a.words[a.sigBytes-1>>>2];a.sigBytes-=b}},a.pad.Iso10126})},{"./cipher-core":143,"./core":144}],160:[function(a,b,c){!function(d,e,f){"object"==typeof c?b.exports=c=e(a("./core"),a("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],e):e(d.CryptoJS)}(this,function(a){return a.pad.Iso97971={pad:function(b,c){b.concat(a.lib.WordArray.create([2147483648],1)),a.pad.ZeroPadding.pad(b,c)},unpad:function(b){a.pad.ZeroPadding.unpad(b),b.sigBytes--}},a.pad.Iso97971})},{"./cipher-core":143,"./core":144}],161:[function(a,b,c){!function(d,e,f){"object"==typeof c?b.exports=c=e(a("./core"),a("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],e):e(d.CryptoJS)}(this,function(a){return a.pad.NoPadding={pad:function(){},unpad:function(){}},a.pad.NoPadding})},{"./cipher-core":143,"./core":144}],162:[function(a,b,c){!function(d,e,f){"object"==typeof c?b.exports=c=e(a("./core"),a("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],e):e(d.CryptoJS)}(this,function(a){return a.pad.ZeroPadding={pad:function(a,b){var c=4*b;a.clamp(),a.sigBytes+=c-(a.sigBytes%c||c)},unpad:function(a){for(var b=a.words,c=a.sigBytes-1;!(b[c>>>2]>>>24-c%4*8&255);)c--;a.sigBytes=c+1}},a.pad.ZeroPadding})},{"./cipher-core":143,"./core":144}],163:[function(a,b,c){!function(d,e,f){"object"==typeof c?b.exports=c=e(a("./core"),a("./sha1"),a("./hmac")):"function"==typeof define&&define.amd?define(["./core","./sha1","./hmac"],e):e(d.CryptoJS)}(this,function(a){return function(){var b=a,c=b.lib,d=c.Base,e=c.WordArray,f=b.algo,g=f.SHA1,h=f.HMAC,i=f.PBKDF2=d.extend({cfg:d.extend({keySize:4,hasher:g,iterations:1}),init:function(a){this.cfg=this.cfg.extend(a)},compute:function(a,b){for(var c=this.cfg,d=h.create(c.hasher,a),f=e.create(),g=e.create([1]),i=f.words,j=g.words,k=c.keySize,l=c.iterations;i.length<k;){var m=d.update(b).finalize(g);d.reset();for(var n=m.words,o=n.length,p=m,q=1;q<l;q++){p=d.finalize(p),d.reset();for(var r=p.words,s=0;s<o;s++)n[s]^=r[s]}f.concat(m),j[0]++}return f.sigBytes=4*k,f}});b.PBKDF2=function(a,b,c){return i.create(c).compute(a,b)}}(),a.PBKDF2})},{"./core":144,"./hmac":149,"./sha1":168}],164:[function(a,b,c){!function(d,e,f){"object"==typeof c?b.exports=c=e(a("./core"),a("./enc-base64"),a("./md5"),a("./evpkdf"),a("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(d.CryptoJS)}(this,function(a){return function(){function b(){for(var a=this._X,b=this._C,c=0;c<8;c++)h[c]=b[c];b[0]=b[0]+1295307597+this._b|0,b[1]=b[1]+3545052371+(b[0]>>>0<h[0]>>>0?1:0)|0,b[2]=b[2]+886263092+(b[1]>>>0<h[1]>>>0?1:0)|0,b[3]=b[3]+1295307597+(b[2]>>>0<h[2]>>>0?1:0)|0,b[4]=b[4]+3545052371+(b[3]>>>0<h[3]>>>0?1:0)|0,b[5]=b[5]+886263092+(b[4]>>>0<h[4]>>>0?1:0)|0,b[6]=b[6]+1295307597+(b[5]>>>0<h[5]>>>0?1:0)|0,b[7]=b[7]+3545052371+(b[6]>>>0<h[6]>>>0?1:0)|0,this._b=b[7]>>>0<h[7]>>>0?1:0;for(var c=0;c<8;c++){var d=a[c]+b[c],e=65535&d,f=d>>>16,g=((e*e>>>17)+e*f>>>15)+f*f,j=((4294901760&d)*d|0)+((65535&d)*d|0);i[c]=g^j}a[0]=i[0]+(i[7]<<16|i[7]>>>16)+(i[6]<<16|i[6]>>>16)|0,a[1]=i[1]+(i[0]<<8|i[0]>>>24)+i[7]|0,a[2]=i[2]+(i[1]<<16|i[1]>>>16)+(i[0]<<16|i[0]>>>16)|0,a[3]=i[3]+(i[2]<<8|i[2]>>>24)+i[1]|0,a[4]=i[4]+(i[3]<<16|i[3]>>>16)+(i[2]<<16|i[2]>>>16)|0,a[5]=i[5]+(i[4]<<8|i[4]>>>24)+i[3]|0,a[6]=i[6]+(i[5]<<16|i[5]>>>16)+(i[4]<<16|i[4]>>>16)|0,a[7]=i[7]+(i[6]<<8|i[6]>>>24)+i[5]|0}var c=a,d=c.lib,e=d.StreamCipher,f=c.algo,g=[],h=[],i=[],j=f.RabbitLegacy=e.extend({_doReset:function(){var a=this._key.words,c=this.cfg.iv,d=this._X=[a[0],a[3]<<16|a[2]>>>16,a[1],a[0]<<16|a[3]>>>16,a[2],a[1]<<16|a[0]>>>16,a[3],a[2]<<16|a[1]>>>16],e=this._C=[a[2]<<16|a[2]>>>16,4294901760&a[0]|65535&a[1],a[3]<<16|a[3]>>>16,4294901760&a[1]|65535&a[2],a[0]<<16|a[0]>>>16,4294901760&a[2]|65535&a[3],a[1]<<16|a[1]>>>16,4294901760&a[3]|65535&a[0]];this._b=0;for(var f=0;f<4;f++)b.call(this);for(var f=0;f<8;f++)e[f]^=d[f+4&7];if(c){var g=c.words,h=g[0],i=g[1],j=16711935&(h<<8|h>>>24)|4278255360&(h<<24|h>>>8),k=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),l=j>>>16|4294901760&k,m=k<<16|65535&j;e[0]^=j,e[1]^=l,e[2]^=k,e[3]^=m,e[4]^=j,e[5]^=l,e[6]^=k,e[7]^=m;for(var f=0;f<4;f++)b.call(this)}},_doProcessBlock:function(a,c){var d=this._X;b.call(this),g[0]=d[0]^d[5]>>>16^d[3]<<16,g[1]=d[2]^d[7]>>>16^d[5]<<16,g[2]=d[4]^d[1]>>>16^d[7]<<16,g[3]=d[6]^d[3]>>>16^d[1]<<16;for(var e=0;e<4;e++)g[e]=16711935&(g[e]<<8|g[e]>>>24)|4278255360&(g[e]<<24|g[e]>>>8),a[c+e]^=g[e]},blockSize:4,ivSize:2});c.RabbitLegacy=e._createHelper(j)}(),a.RabbitLegacy})},{"./cipher-core":143,"./core":144,"./enc-base64":145,"./evpkdf":147,"./md5":152}],165:[function(a,b,c){!function(d,e,f){"object"==typeof c?b.exports=c=e(a("./core"),a("./enc-base64"),a("./md5"),a("./evpkdf"),a("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(d.CryptoJS); |
| 13 |
|
}(this,function(a){return function(){function b(){for(var a=this._X,b=this._C,c=0;c<8;c++)h[c]=b[c];b[0]=b[0]+1295307597+this._b|0,b[1]=b[1]+3545052371+(b[0]>>>0<h[0]>>>0?1:0)|0,b[2]=b[2]+886263092+(b[1]>>>0<h[1]>>>0?1:0)|0,b[3]=b[3]+1295307597+(b[2]>>>0<h[2]>>>0?1:0)|0,b[4]=b[4]+3545052371+(b[3]>>>0<h[3]>>>0?1:0)|0,b[5]=b[5]+886263092+(b[4]>>>0<h[4]>>>0?1:0)|0,b[6]=b[6]+1295307597+(b[5]>>>0<h[5]>>>0?1:0)|0,b[7]=b[7]+3545052371+(b[6]>>>0<h[6]>>>0?1:0)|0,this._b=b[7]>>>0<h[7]>>>0?1:0;for(var c=0;c<8;c++){var d=a[c]+b[c],e=65535&d,f=d>>>16,g=((e*e>>>17)+e*f>>>15)+f*f,j=((4294901760&d)*d|0)+((65535&d)*d|0);i[c]=g^j}a[0]=i[0]+(i[7]<<16|i[7]>>>16)+(i[6]<<16|i[6]>>>16)|0,a[1]=i[1]+(i[0]<<8|i[0]>>>24)+i[7]|0,a[2]=i[2]+(i[1]<<16|i[1]>>>16)+(i[0]<<16|i[0]>>>16)|0,a[3]=i[3]+(i[2]<<8|i[2]>>>24)+i[1]|0,a[4]=i[4]+(i[3]<<16|i[3]>>>16)+(i[2]<<16|i[2]>>>16)|0,a[5]=i[5]+(i[4]<<8|i[4]>>>24)+i[3]|0,a[6]=i[6]+(i[5]<<16|i[5]>>>16)+(i[4]<<16|i[4]>>>16)|0,a[7]=i[7]+(i[6]<<8|i[6]>>>24)+i[5]|0}var c=a,d=c.lib,e=d.StreamCipher,f=c.algo,g=[],h=[],i=[],j=f.Rabbit=e.extend({_doReset:function(){for(var a=this._key.words,c=this.cfg.iv,d=0;d<4;d++)a[d]=16711935&(a[d]<<8|a[d]>>>24)|4278255360&(a[d]<<24|a[d]>>>8);var e=this._X=[a[0],a[3]<<16|a[2]>>>16,a[1],a[0]<<16|a[3]>>>16,a[2],a[1]<<16|a[0]>>>16,a[3],a[2]<<16|a[1]>>>16],f=this._C=[a[2]<<16|a[2]>>>16,4294901760&a[0]|65535&a[1],a[3]<<16|a[3]>>>16,4294901760&a[1]|65535&a[2],a[0]<<16|a[0]>>>16,4294901760&a[2]|65535&a[3],a[1]<<16|a[1]>>>16,4294901760&a[3]|65535&a[0]];this._b=0;for(var d=0;d<4;d++)b.call(this);for(var d=0;d<8;d++)f[d]^=e[d+4&7];if(c){var g=c.words,h=g[0],i=g[1],j=16711935&(h<<8|h>>>24)|4278255360&(h<<24|h>>>8),k=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),l=j>>>16|4294901760&k,m=k<<16|65535&j;f[0]^=j,f[1]^=l,f[2]^=k,f[3]^=m,f[4]^=j,f[5]^=l,f[6]^=k,f[7]^=m;for(var d=0;d<4;d++)b.call(this)}},_doProcessBlock:function(a,c){var d=this._X;b.call(this),g[0]=d[0]^d[5]>>>16^d[3]<<16,g[1]=d[2]^d[7]>>>16^d[5]<<16,g[2]=d[4]^d[1]>>>16^d[7]<<16,g[3]=d[6]^d[3]>>>16^d[1]<<16;for(var e=0;e<4;e++)g[e]=16711935&(g[e]<<8|g[e]>>>24)|4278255360&(g[e]<<24|g[e]>>>8),a[c+e]^=g[e]},blockSize:4,ivSize:2});c.Rabbit=e._createHelper(j)}(),a.Rabbit})},{"./cipher-core":143,"./core":144,"./enc-base64":145,"./evpkdf":147,"./md5":152}],166:[function(a,b,c){!function(d,e,f){"object"==typeof c?b.exports=c=e(a("./core"),a("./enc-base64"),a("./md5"),a("./evpkdf"),a("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(d.CryptoJS)}(this,function(a){return function(){function b(){for(var a=this._S,b=this._i,c=this._j,d=0,e=0;e<4;e++){b=(b+1)%256,c=(c+a[b])%256;var f=a[b];a[b]=a[c],a[c]=f,d|=a[(a[b]+a[c])%256]<<24-8*e}return this._i=b,this._j=c,d}var c=a,d=c.lib,e=d.StreamCipher,f=c.algo,g=f.RC4=e.extend({_doReset:function(){for(var a=this._key,b=a.words,c=a.sigBytes,d=this._S=[],e=0;e<256;e++)d[e]=e;for(var e=0,f=0;e<256;e++){var g=e%c,h=b[g>>>2]>>>24-g%4*8&255;f=(f+d[e]+h)%256;var i=d[e];d[e]=d[f],d[f]=i}this._i=this._j=0},_doProcessBlock:function(a,c){a[c]^=b.call(this)},keySize:8,ivSize:0});c.RC4=e._createHelper(g);var h=f.RC4Drop=g.extend({cfg:g.cfg.extend({drop:192}),_doReset:function(){g._doReset.call(this);for(var a=this.cfg.drop;a>0;a--)b.call(this)}});c.RC4Drop=e._createHelper(h)}(),a.RC4})},{"./cipher-core":143,"./core":144,"./enc-base64":145,"./evpkdf":147,"./md5":152}],167:[function(a,b,c){!function(d,e){"object"==typeof c?b.exports=c=e(a("./core")):"function"==typeof define&&define.amd?define(["./core"],e):e(d.CryptoJS)}(this,function(a){return function(b){function c(a,b,c){return a^b^c}function d(a,b,c){return a&b|~a&c}function e(a,b,c){return(a|~b)^c}function f(a,b,c){return a&c|b&~c}function g(a,b,c){return a^(b|~c)}function h(a,b){return a<<b|a>>>32-b}var i=a,j=i.lib,k=j.WordArray,l=j.Hasher,m=i.algo,n=k.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),o=k.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),p=k.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),q=k.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),r=k.create([0,1518500249,1859775393,2400959708,2840853838]),s=k.create([1352829926,1548603684,1836072691,2053994217,0]),t=m.RIPEMD160=l.extend({_doReset:function(){this._hash=k.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(a,b){for(var i=0;i<16;i++){var j=b+i,k=a[j];a[j]=16711935&(k<<8|k>>>24)|4278255360&(k<<24|k>>>8)}var l,m,t,u,v,w,x,y,z,A,B=this._hash.words,C=r.words,D=s.words,E=n.words,F=o.words,G=p.words,H=q.words;w=l=B[0],x=m=B[1],y=t=B[2],z=u=B[3],A=v=B[4];for(var I,i=0;i<80;i+=1)I=l+a[b+E[i]]|0,I+=i<16?c(m,t,u)+C[0]:i<32?d(m,t,u)+C[1]:i<48?e(m,t,u)+C[2]:i<64?f(m,t,u)+C[3]:g(m,t,u)+C[4],I|=0,I=h(I,G[i]),I=I+v|0,l=v,v=u,u=h(t,10),t=m,m=I,I=w+a[b+F[i]]|0,I+=i<16?g(x,y,z)+D[0]:i<32?f(x,y,z)+D[1]:i<48?e(x,y,z)+D[2]:i<64?d(x,y,z)+D[3]:c(x,y,z)+D[4],I|=0,I=h(I,H[i]),I=I+A|0,w=A,A=z,z=h(y,10),y=x,x=I;I=B[1]+t+z|0,B[1]=B[2]+u+A|0,B[2]=B[3]+v+w|0,B[3]=B[4]+l+x|0,B[4]=B[0]+m+y|0,B[0]=I},_doFinalize:function(){var a=this._data,b=a.words,c=8*this._nDataBytes,d=8*a.sigBytes;b[d>>>5]|=128<<24-d%32,b[(d+64>>>9<<4)+14]=16711935&(c<<8|c>>>24)|4278255360&(c<<24|c>>>8),a.sigBytes=4*(b.length+1),this._process();for(var e=this._hash,f=e.words,g=0;g<5;g++){var h=f[g];f[g]=16711935&(h<<8|h>>>24)|4278255360&(h<<24|h>>>8)}return e},clone:function(){var a=l.clone.call(this);return a._hash=this._hash.clone(),a}});i.RIPEMD160=l._createHelper(t),i.HmacRIPEMD160=l._createHmacHelper(t)}(Math),a.RIPEMD160})},{"./core":144}],168:[function(a,b,c){!function(d,e){"object"==typeof c?b.exports=c=e(a("./core")):"function"==typeof define&&define.amd?define(["./core"],e):e(d.CryptoJS)}(this,function(a){return function(){var b=a,c=b.lib,d=c.WordArray,e=c.Hasher,f=b.algo,g=[],h=f.SHA1=e.extend({_doReset:function(){this._hash=new d.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(a,b){for(var c=this._hash.words,d=c[0],e=c[1],f=c[2],h=c[3],i=c[4],j=0;j<80;j++){if(j<16)g[j]=0|a[b+j];else{var k=g[j-3]^g[j-8]^g[j-14]^g[j-16];g[j]=k<<1|k>>>31}var l=(d<<5|d>>>27)+i+g[j];l+=j<20?(e&f|~e&h)+1518500249:j<40?(e^f^h)+1859775393:j<60?(e&f|e&h|f&h)-1894007588:(e^f^h)-899497514,i=h,h=f,f=e<<30|e>>>2,e=d,d=l}c[0]=c[0]+d|0,c[1]=c[1]+e|0,c[2]=c[2]+f|0,c[3]=c[3]+h|0,c[4]=c[4]+i|0},_doFinalize:function(){var a=this._data,b=a.words,c=8*this._nDataBytes,d=8*a.sigBytes;return b[d>>>5]|=128<<24-d%32,b[(d+64>>>9<<4)+14]=Math.floor(c/4294967296),b[(d+64>>>9<<4)+15]=c,a.sigBytes=4*b.length,this._process(),this._hash},clone:function(){var a=e.clone.call(this);return a._hash=this._hash.clone(),a}});b.SHA1=e._createHelper(h),b.HmacSHA1=e._createHmacHelper(h)}(),a.SHA1})},{"./core":144}],169:[function(a,b,c){!function(d,e,f){"object"==typeof c?b.exports=c=e(a("./core"),a("./sha256")):"function"==typeof define&&define.amd?define(["./core","./sha256"],e):e(d.CryptoJS)}(this,function(a){return function(){var b=a,c=b.lib,d=c.WordArray,e=b.algo,f=e.SHA256,g=e.SHA224=f.extend({_doReset:function(){this._hash=new d.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var a=f._doFinalize.call(this);return a.sigBytes-=4,a}});b.SHA224=f._createHelper(g),b.HmacSHA224=f._createHmacHelper(g)}(),a.SHA224})},{"./core":144,"./sha256":170}],170:[function(a,b,c){!function(d,e){"object"==typeof c?b.exports=c=e(a("./core")):"function"==typeof define&&define.amd?define(["./core"],e):e(d.CryptoJS)}(this,function(a){return function(b){var c=a,d=c.lib,e=d.WordArray,f=d.Hasher,g=c.algo,h=[],i=[];!function(){function a(a){for(var c=b.sqrt(a),d=2;d<=c;d++)if(!(a%d))return!1;return!0}function c(a){return 4294967296*(a-(0|a))|0}for(var d=2,e=0;e<64;)a(d)&&(e<8&&(h[e]=c(b.pow(d,.5))),i[e]=c(b.pow(d,1/3)),e++),d++}();var j=[],k=g.SHA256=f.extend({_doReset:function(){this._hash=new e.init(h.slice(0))},_doProcessBlock:function(a,b){for(var c=this._hash.words,d=c[0],e=c[1],f=c[2],g=c[3],h=c[4],k=c[5],l=c[6],m=c[7],n=0;n<64;n++){if(n<16)j[n]=0|a[b+n];else{var o=j[n-15],p=(o<<25|o>>>7)^(o<<14|o>>>18)^o>>>3,q=j[n-2],r=(q<<15|q>>>17)^(q<<13|q>>>19)^q>>>10;j[n]=p+j[n-7]+r+j[n-16]}var s=h&k^~h&l,t=d&e^d&f^e&f,u=(d<<30|d>>>2)^(d<<19|d>>>13)^(d<<10|d>>>22),v=(h<<26|h>>>6)^(h<<21|h>>>11)^(h<<7|h>>>25),w=m+v+s+i[n]+j[n],x=u+t;m=l,l=k,k=h,h=g+w|0,g=f,f=e,e=d,d=w+x|0}c[0]=c[0]+d|0,c[1]=c[1]+e|0,c[2]=c[2]+f|0,c[3]=c[3]+g|0,c[4]=c[4]+h|0,c[5]=c[5]+k|0,c[6]=c[6]+l|0,c[7]=c[7]+m|0},_doFinalize:function(){var a=this._data,c=a.words,d=8*this._nDataBytes,e=8*a.sigBytes;return c[e>>>5]|=128<<24-e%32,c[(e+64>>>9<<4)+14]=b.floor(d/4294967296),c[(e+64>>>9<<4)+15]=d,a.sigBytes=4*c.length,this._process(),this._hash},clone:function(){var a=f.clone.call(this);return a._hash=this._hash.clone(),a}});c.SHA256=f._createHelper(k),c.HmacSHA256=f._createHmacHelper(k)}(Math),a.SHA256})},{"./core":144}],171:[function(a,b,c){!function(d,e,f){"object"==typeof c?b.exports=c=e(a("./core"),a("./x64-core")):"function"==typeof define&&define.amd?define(["./core","./x64-core"],e):e(d.CryptoJS)}(this,function(a){return function(b){var c=a,d=c.lib,e=d.WordArray,f=d.Hasher,g=c.x64,h=g.Word,i=c.algo,j=[],k=[],l=[];!function(){for(var a=1,b=0,c=0;c<24;c++){j[a+5*b]=(c+1)*(c+2)/2%64;var d=b%5,e=(2*a+3*b)%5;a=d,b=e}for(var a=0;a<5;a++)for(var b=0;b<5;b++)k[a+5*b]=b+(2*a+3*b)%5*5;for(var f=1,g=0;g<24;g++){for(var i=0,m=0,n=0;n<7;n++){if(1&f){var o=(1<<n)-1;o<32?m^=1<<o:i^=1<<o-32}128&f?f=f<<1^113:f<<=1}l[g]=h.create(i,m)}}();var m=[];!function(){for(var a=0;a<25;a++)m[a]=h.create()}();var n=i.SHA3=f.extend({cfg:f.cfg.extend({outputLength:512}),_doReset:function(){for(var a=this._state=[],b=0;b<25;b++)a[b]=new h.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(a,b){for(var c=this._state,d=this.blockSize/2,e=0;e<d;e++){var f=a[b+2*e],g=a[b+2*e+1];f=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8),g=16711935&(g<<8|g>>>24)|4278255360&(g<<24|g>>>8);var h=c[e];h.high^=g,h.low^=f}for(var i=0;i<24;i++){for(var n=0;n<5;n++){for(var o=0,p=0,q=0;q<5;q++){var h=c[n+5*q];o^=h.high,p^=h.low}var r=m[n];r.high=o,r.low=p}for(var n=0;n<5;n++)for(var s=m[(n+4)%5],t=m[(n+1)%5],u=t.high,v=t.low,o=s.high^(u<<1|v>>>31),p=s.low^(v<<1|u>>>31),q=0;q<5;q++){var h=c[n+5*q];h.high^=o,h.low^=p}for(var w=1;w<25;w++){var h=c[w],x=h.high,y=h.low,z=j[w];if(z<32)var o=x<<z|y>>>32-z,p=y<<z|x>>>32-z;else var o=y<<z-32|x>>>64-z,p=x<<z-32|y>>>64-z;var A=m[k[w]];A.high=o,A.low=p}var B=m[0],C=c[0];B.high=C.high,B.low=C.low;for(var n=0;n<5;n++)for(var q=0;q<5;q++){var w=n+5*q,h=c[w],D=m[w],E=m[(n+1)%5+5*q],F=m[(n+2)%5+5*q];h.high=D.high^~E.high&F.high,h.low=D.low^~E.low&F.low}var h=c[0],G=l[i];h.high^=G.high,h.low^=G.low}},_doFinalize:function(){var a=this._data,c=a.words,d=(8*this._nDataBytes,8*a.sigBytes),f=32*this.blockSize;c[d>>>5]|=1<<24-d%32,c[(b.ceil((d+1)/f)*f>>>5)-1]|=128,a.sigBytes=4*c.length,this._process();for(var g=this._state,h=this.cfg.outputLength/8,i=h/8,j=[],k=0;k<i;k++){var l=g[k],m=l.high,n=l.low;m=16711935&(m<<8|m>>>24)|4278255360&(m<<24|m>>>8),n=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8),j.push(n),j.push(m)}return new e.init(j,h)},clone:function(){for(var a=f.clone.call(this),b=a._state=this._state.slice(0),c=0;c<25;c++)b[c]=b[c].clone();return a}});c.SHA3=f._createHelper(n),c.HmacSHA3=f._createHmacHelper(n)}(Math),a.SHA3})},{"./core":144,"./x64-core":175}],172:[function(a,b,c){!function(d,e,f){"object"==typeof c?b.exports=c=e(a("./core"),a("./x64-core"),a("./sha512")):"function"==typeof define&&define.amd?define(["./core","./x64-core","./sha512"],e):e(d.CryptoJS)}(this,function(a){return function(){var b=a,c=b.x64,d=c.Word,e=c.WordArray,f=b.algo,g=f.SHA512,h=f.SHA384=g.extend({_doReset:function(){this._hash=new e.init([new d.init(3418070365,3238371032),new d.init(1654270250,914150663),new d.init(2438529370,812702999),new d.init(355462360,4144912697),new d.init(1731405415,4290775857),new d.init(2394180231,1750603025),new d.init(3675008525,1694076839),new d.init(1203062813,3204075428)])},_doFinalize:function(){var a=g._doFinalize.call(this);return a.sigBytes-=16,a}});b.SHA384=g._createHelper(h),b.HmacSHA384=g._createHmacHelper(h)}(),a.SHA384})},{"./core":144,"./sha512":173,"./x64-core":175}],173:[function(a,b,c){!function(d,e,f){"object"==typeof c?b.exports=c=e(a("./core"),a("./x64-core")):"function"==typeof define&&define.amd?define(["./core","./x64-core"],e):e(d.CryptoJS)}(this,function(a){return function(){function b(){return g.create.apply(g,arguments)}var c=a,d=c.lib,e=d.Hasher,f=c.x64,g=f.Word,h=f.WordArray,i=c.algo,j=[b(1116352408,3609767458),b(1899447441,602891725),b(3049323471,3964484399),b(3921009573,2173295548),b(961987163,4081628472),b(1508970993,3053834265),b(2453635748,2937671579),b(2870763221,3664609560),b(3624381080,2734883394),b(310598401,1164996542),b(607225278,1323610764),b(1426881987,3590304994),b(1925078388,4068182383),b(2162078206,991336113),b(2614888103,633803317),b(3248222580,3479774868),b(3835390401,2666613458),b(4022224774,944711139),b(264347078,2341262773),b(604807628,2007800933),b(770255983,1495990901),b(1249150122,1856431235),b(1555081692,3175218132),b(1996064986,2198950837),b(2554220882,3999719339),b(2821834349,766784016),b(2952996808,2566594879),b(3210313671,3203337956),b(3336571891,1034457026),b(3584528711,2466948901),b(113926993,3758326383),b(338241895,168717936),b(666307205,1188179964),b(773529912,1546045734),b(1294757372,1522805485),b(1396182291,2643833823),b(1695183700,2343527390),b(1986661051,1014477480),b(2177026350,1206759142),b(2456956037,344077627),b(2730485921,1290863460),b(2820302411,3158454273),b(3259730800,3505952657),b(3345764771,106217008),b(3516065817,3606008344),b(3600352804,1432725776),b(4094571909,1467031594),b(275423344,851169720),b(430227734,3100823752),b(506948616,1363258195),b(659060556,3750685593),b(883997877,3785050280),b(958139571,3318307427),b(1322822218,3812723403),b(1537002063,2003034995),b(1747873779,3602036899),b(1955562222,1575990012),b(2024104815,1125592928),b(2227730452,2716904306),b(2361852424,442776044),b(2428436474,593698344),b(2756734187,3733110249),b(3204031479,2999351573),b(3329325298,3815920427),b(3391569614,3928383900),b(3515267271,566280711),b(3940187606,3454069534),b(4118630271,4000239992),b(116418474,1914138554),b(174292421,2731055270),b(289380356,3203993006),b(460393269,320620315),b(685471733,587496836),b(852142971,1086792851),b(1017036298,365543100),b(1126000580,2618297676),b(1288033470,3409855158),b(1501505948,4234509866),b(1607167915,987167468),b(1816402316,1246189591)],k=[];!function(){for(var a=0;a<80;a++)k[a]=b()}();var l=i.SHA512=e.extend({_doReset:function(){this._hash=new h.init([new g.init(1779033703,4089235720),new g.init(3144134277,2227873595),new g.init(1013904242,4271175723),new g.init(2773480762,1595750129),new g.init(1359893119,2917565137),new g.init(2600822924,725511199),new g.init(528734635,4215389547),new g.init(1541459225,327033209)])},_doProcessBlock:function(a,b){for(var c=this._hash.words,d=c[0],e=c[1],f=c[2],g=c[3],h=c[4],i=c[5],l=c[6],m=c[7],n=d.high,o=d.low,p=e.high,q=e.low,r=f.high,s=f.low,t=g.high,u=g.low,v=h.high,w=h.low,x=i.high,y=i.low,z=l.high,A=l.low,B=m.high,C=m.low,D=n,E=o,F=p,G=q,H=r,I=s,J=t,K=u,L=v,M=w,N=x,O=y,P=z,Q=A,R=B,S=C,T=0;T<80;T++){var U=k[T];if(T<16)var V=U.high=0|a[b+2*T],W=U.low=0|a[b+2*T+1];else{var X=k[T-15],Y=X.high,Z=X.low,$=(Y>>>1|Z<<31)^(Y>>>8|Z<<24)^Y>>>7,_=(Z>>>1|Y<<31)^(Z>>>8|Y<<24)^(Z>>>7|Y<<25),aa=k[T-2],ba=aa.high,ca=aa.low,da=(ba>>>19|ca<<13)^(ba<<3|ca>>>29)^ba>>>6,ea=(ca>>>19|ba<<13)^(ca<<3|ba>>>29)^(ca>>>6|ba<<26),fa=k[T-7],ga=fa.high,ha=fa.low,ia=k[T-16],ja=ia.high,ka=ia.low,W=_+ha,V=$+ga+(W>>>0<_>>>0?1:0),W=W+ea,V=V+da+(W>>>0<ea>>>0?1:0),W=W+ka,V=V+ja+(W>>>0<ka>>>0?1:0);U.high=V,U.low=W}var la=L&N^~L&P,ma=M&O^~M&Q,na=D&F^D&H^F&H,oa=E&G^E&I^G&I,pa=(D>>>28|E<<4)^(D<<30|E>>>2)^(D<<25|E>>>7),qa=(E>>>28|D<<4)^(E<<30|D>>>2)^(E<<25|D>>>7),ra=(L>>>14|M<<18)^(L>>>18|M<<14)^(L<<23|M>>>9),sa=(M>>>14|L<<18)^(M>>>18|L<<14)^(M<<23|L>>>9),ta=j[T],ua=ta.high,va=ta.low,wa=S+sa,xa=R+ra+(wa>>>0<S>>>0?1:0),wa=wa+ma,xa=xa+la+(wa>>>0<ma>>>0?1:0),wa=wa+va,xa=xa+ua+(wa>>>0<va>>>0?1:0),wa=wa+W,xa=xa+V+(wa>>>0<W>>>0?1:0),ya=qa+oa,za=pa+na+(ya>>>0<qa>>>0?1:0);R=P,S=Q,P=N,Q=O,N=L,O=M,M=K+wa|0,L=J+xa+(M>>>0<K>>>0?1:0)|0,J=H,K=I,H=F,I=G,F=D,G=E,E=wa+ya|0,D=xa+za+(E>>>0<wa>>>0?1:0)|0}o=d.low=o+E,d.high=n+D+(o>>>0<E>>>0?1:0),q=e.low=q+G,e.high=p+F+(q>>>0<G>>>0?1:0),s=f.low=s+I,f.high=r+H+(s>>>0<I>>>0?1:0),u=g.low=u+K,g.high=t+J+(u>>>0<K>>>0?1:0),w=h.low=w+M,h.high=v+L+(w>>>0<M>>>0?1:0),y=i.low=y+O,i.high=x+N+(y>>>0<O>>>0?1:0),A=l.low=A+Q,l.high=z+P+(A>>>0<Q>>>0?1:0),C=m.low=C+S,m.high=B+R+(C>>>0<S>>>0?1:0)},_doFinalize:function(){var a=this._data,b=a.words,c=8*this._nDataBytes,d=8*a.sigBytes;b[d>>>5]|=128<<24-d%32,b[(d+128>>>10<<5)+30]=Math.floor(c/4294967296),b[(d+128>>>10<<5)+31]=c,a.sigBytes=4*b.length,this._process();var e=this._hash.toX32();return e},clone:function(){var a=e.clone.call(this);return a._hash=this._hash.clone(),a},blockSize:32});c.SHA512=e._createHelper(l),c.HmacSHA512=e._createHmacHelper(l)}(),a.SHA512})},{"./core":144,"./x64-core":175}],174:[function(a,b,c){!function(d,e,f){"object"==typeof c?b.exports=c=e(a("./core"),a("./enc-base64"),a("./md5"),a("./evpkdf"),a("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(d.CryptoJS)}(this,function(a){return function(){function b(a,b){var c=(this._lBlock>>>a^this._rBlock)&b;this._rBlock^=c,this._lBlock^=c<<a}function c(a,b){var c=(this._rBlock>>>a^this._lBlock)&b;this._lBlock^=c,this._rBlock^=c<<a}var d=a,e=d.lib,f=e.WordArray,g=e.BlockCipher,h=d.algo,i=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],j=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],k=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],l=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],m=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],n=h.DES=g.extend({_doReset:function(){for(var a=this._key,b=a.words,c=[],d=0;d<56;d++){var e=i[d]-1;c[d]=b[e>>>5]>>>31-e%32&1}for(var f=this._subKeys=[],g=0;g<16;g++){for(var h=f[g]=[],l=k[g],d=0;d<24;d++)h[d/6|0]|=c[(j[d]-1+l)%28]<<31-d%6,h[4+(d/6|0)]|=c[28+(j[d+24]-1+l)%28]<<31-d%6;h[0]=h[0]<<1|h[0]>>>31;for(var d=1;d<7;d++)h[d]=h[d]>>>4*(d-1)+3;h[7]=h[7]<<5|h[7]>>>27}for(var m=this._invSubKeys=[],d=0;d<16;d++)m[d]=f[15-d]},encryptBlock:function(a,b){this._doCryptBlock(a,b,this._subKeys)},decryptBlock:function(a,b){this._doCryptBlock(a,b,this._invSubKeys)},_doCryptBlock:function(a,d,e){this._lBlock=a[d],this._rBlock=a[d+1],b.call(this,4,252645135),b.call(this,16,65535),c.call(this,2,858993459),c.call(this,8,16711935),b.call(this,1,1431655765);for(var f=0;f<16;f++){for(var g=e[f],h=this._lBlock,i=this._rBlock,j=0,k=0;k<8;k++)j|=l[k][((i^g[k])&m[k])>>>0];this._lBlock=i,this._rBlock=h^j}var n=this._lBlock;this._lBlock=this._rBlock,this._rBlock=n,b.call(this,1,1431655765),c.call(this,8,16711935),c.call(this,2,858993459),b.call(this,16,65535),b.call(this,4,252645135),a[d]=this._lBlock,a[d+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});d.DES=g._createHelper(n);var o=h.TripleDES=g.extend({_doReset:function(){var a=this._key,b=a.words;this._des1=n.createEncryptor(f.create(b.slice(0,2))),this._des2=n.createEncryptor(f.create(b.slice(2,4))),this._des3=n.createEncryptor(f.create(b.slice(4,6)))},encryptBlock:function(a,b){this._des1.encryptBlock(a,b),this._des2.decryptBlock(a,b),this._des3.encryptBlock(a,b)},decryptBlock:function(a,b){this._des3.decryptBlock(a,b),this._des2.encryptBlock(a,b),this._des1.decryptBlock(a,b)},keySize:6,ivSize:2,blockSize:2});d.TripleDES=g._createHelper(o)}(),a.TripleDES})},{"./cipher-core":143,"./core":144,"./enc-base64":145,"./evpkdf":147,"./md5":152}],175:[function(a,b,c){!function(d,e){"object"==typeof c?b.exports=c=e(a("./core")):"function"==typeof define&&define.amd?define(["./core"],e):e(d.CryptoJS)}(this,function(a){return function(b){var c=a,d=c.lib,e=d.Base,f=d.WordArray,g=c.x64={};g.Word=e.extend({init:function(a,b){this.high=a,this.low=b}}),g.WordArray=e.extend({init:function(a,c){a=this.words=a||[],c!=b?this.sigBytes=c:this.sigBytes=8*a.length},toX32:function(){for(var a=this.words,b=a.length,c=[],d=0;d<b;d++){var e=a[d];c.push(e.high),c.push(e.low)}return f.create(c,this.sigBytes)},clone:function(){for(var a=e.clone.call(this),b=a.words=this.words.slice(0),c=b.length,d=0;d<c;d++)b[d]=b[d].clone();return a}})}(),a})},{"./core":144}],176:[function(a,b,c){function d(a){return d.enabled(a)?function(b){b=e(b);var c=new Date,f=c-(d[a]||c);d[a]=c,b=a+" "+b+" +"+d.humanize(f),window.console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}:function(){}}function e(a){return a instanceof Error?a.stack||a.message:a}b.exports=d,d.names=[],d.skips=[],d.enable=function(a){try{localStorage.debug=a}catch(a){}for(var b=(a||"").split(/[\s,]+/),c=b.length,e=0;e<c;e++)a=b[e].replace("*",".*?"),"-"===a[0]?d.skips.push(new RegExp("^"+a.substr(1)+"$")):d.names.push(new RegExp("^"+a+"$"))},d.disable=function(){d.enable("")},d.humanize=function(a){var b=1e3,c=6e4,d=60*c;return a>=d?(a/d).toFixed(1)+"h":a>=c?(a/c).toFixed(1)+"m":a>=b?(a/b|0)+"s":a+"ms"},d.enabled=function(a){for(var b=0,c=d.skips.length;b<c;b++)if(d.skips[b].test(a))return!1;for(var b=0,c=d.names.length;b<c;b++)if(d.names[b].test(a))return!0;return!1};try{window.localStorage&&d.enable(localStorage.debug)}catch(a){}},{}],177:[function(a,b,c){"use strict";c.utils=a("./des/utils"),c.Cipher=a("./des/cipher"),c.DES=a("./des/des"),c.CBC=a("./des/cbc"),c.EDE=a("./des/ede")},{"./des/cbc":178,"./des/cipher":179,"./des/des":180,"./des/ede":181,"./des/utils":182}],178:[function(a,b,c){"use strict";function d(a){f.equal(a.length,8,"Invalid IV length"),this.iv=new Array(8);for(var b=0;b<this.iv.length;b++)this.iv[b]=a[b]}function e(a){function b(b){a.call(this,b),this._cbcInit()}g(b,a);for(var c=Object.keys(h),d=0;d<c.length;d++){var e=c[d];b.prototype[e]=h[e]}return b.create=function(a){return new b(a)},b}var f=a("minimalistic-assert"),g=a("inherits"),h={};c.instantiate=e,h._cbcInit=function(){var a=new d(this.options.iv);this._cbcState=a},h._update=function(a,b,c,d){var e=this._cbcState,f=this.constructor.super_.prototype,g=e.iv;if("encrypt"===this.type){for(var h=0;h<this.blockSize;h++)g[h]^=a[b+h];f._update.call(this,g,0,c,d);for(var h=0;h<this.blockSize;h++)g[h]=c[d+h]}else{f._update.call(this,a,b,c,d);for(var h=0;h<this.blockSize;h++)c[d+h]^=g[h];for(var h=0;h<this.blockSize;h++)g[h]=a[b+h]}}},{inherits:226,"minimalistic-assert":234}],179:[function(a,b,c){"use strict";function d(a){this.options=a,this.type=this.options.type,this.blockSize=8,this._init(),this.buffer=new Array(this.blockSize),this.bufferOff=0}var e=a("minimalistic-assert");b.exports=d,d.prototype._init=function(){},d.prototype.update=function(a){return 0===a.length?[]:"decrypt"===this.type?this._updateDecrypt(a):this._updateEncrypt(a)},d.prototype._buffer=function(a,b){for(var c=Math.min(this.buffer.length-this.bufferOff,a.length-b),d=0;d<c;d++)this.buffer[this.bufferOff+d]=a[b+d];return this.bufferOff+=c,c},d.prototype._flushBuffer=function(a,b){return this._update(this.buffer,0,a,b),this.bufferOff=0,this.blockSize},d.prototype._updateEncrypt=function(a){var b=0,c=0,d=(this.bufferOff+a.length)/this.blockSize|0,e=new Array(d*this.blockSize);0!==this.bufferOff&&(b+=this._buffer(a,b),this.bufferOff===this.buffer.length&&(c+=this._flushBuffer(e,c)));for(var f=a.length-(a.length-b)%this.blockSize;b<f;b+=this.blockSize)this._update(a,b,e,c),c+=this.blockSize;for(;b<a.length;b++,this.bufferOff++)this.buffer[this.bufferOff]=a[b];return e; |
| 14 |
|
},d.prototype._updateDecrypt=function(a){for(var b=0,c=0,d=Math.ceil((this.bufferOff+a.length)/this.blockSize)-1,e=new Array(d*this.blockSize);d>0;d--)b+=this._buffer(a,b),c+=this._flushBuffer(e,c);return b+=this._buffer(a,b),e},d.prototype.final=function(a){var b;a&&(b=this.update(a));var c;return c="encrypt"===this.type?this._finalEncrypt():this._finalDecrypt(),b?b.concat(c):c},d.prototype._pad=function(a,b){if(0===b)return!1;for(;b<a.length;)a[b++]=0;return!0},d.prototype._finalEncrypt=function(){if(!this._pad(this.buffer,this.bufferOff))return[];var a=new Array(this.blockSize);return this._update(this.buffer,0,a,0),a},d.prototype._unpad=function(a){return a},d.prototype._finalDecrypt=function(){e.equal(this.bufferOff,this.blockSize,"Not enough data to decrypt");var a=new Array(this.blockSize);return this._flushBuffer(a,0),this._unpad(a)}},{"minimalistic-assert":234}],180:[function(a,b,c){"use strict";function d(){this.tmp=new Array(2),this.keys=null}function e(a){j.call(this,a);var b=new d;this._desState=b,this.deriveKeys(b,a.key)}var f=a("minimalistic-assert"),g=a("inherits"),h=a("../des"),i=h.utils,j=h.Cipher;g(e,j),b.exports=e,e.create=function(a){return new e(a)};var k=[1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1];e.prototype.deriveKeys=function(a,b){a.keys=new Array(32),f.equal(b.length,this.blockSize,"Invalid key length");var c=i.readUInt32BE(b,0),d=i.readUInt32BE(b,4);i.pc1(c,d,a.tmp,0),c=a.tmp[0],d=a.tmp[1];for(var e=0;e<a.keys.length;e+=2){var g=k[e>>>1];c=i.r28shl(c,g),d=i.r28shl(d,g),i.pc2(c,d,a.keys,e)}},e.prototype._update=function(a,b,c,d){var e=this._desState,f=i.readUInt32BE(a,b),g=i.readUInt32BE(a,b+4);i.ip(f,g,e.tmp,0),f=e.tmp[0],g=e.tmp[1],"encrypt"===this.type?this._encrypt(e,f,g,e.tmp,0):this._decrypt(e,f,g,e.tmp,0),f=e.tmp[0],g=e.tmp[1],i.writeUInt32BE(c,f,d),i.writeUInt32BE(c,g,d+4)},e.prototype._pad=function(a,b){for(var c=a.length-b,d=b;d<a.length;d++)a[d]=c;return!0},e.prototype._unpad=function(a){for(var b=a[a.length-1],c=a.length-b;c<a.length;c++)f.equal(a[c],b);return a.slice(0,a.length-b)},e.prototype._encrypt=function(a,b,c,d,e){for(var f=b,g=c,h=0;h<a.keys.length;h+=2){var j=a.keys[h],k=a.keys[h+1];i.expand(g,a.tmp,0),j^=a.tmp[0],k^=a.tmp[1];var l=i.substitute(j,k),m=i.permute(l),n=g;g=(f^m)>>>0,f=n}i.rip(g,f,d,e)},e.prototype._decrypt=function(a,b,c,d,e){for(var f=c,g=b,h=a.keys.length-2;h>=0;h-=2){var j=a.keys[h],k=a.keys[h+1];i.expand(f,a.tmp,0),j^=a.tmp[0],k^=a.tmp[1];var l=i.substitute(j,k),m=i.permute(l),n=f;f=(g^m)>>>0,g=n}i.rip(f,g,d,e)}},{"../des":177,inherits:226,"minimalistic-assert":234}],181:[function(a,b,c){"use strict";function d(a,b){f.equal(b.length,24,"Invalid key length");var c=b.slice(0,8),d=b.slice(8,16),e=b.slice(16,24);"encrypt"===a?this.ciphers=[j.create({type:"encrypt",key:c}),j.create({type:"decrypt",key:d}),j.create({type:"encrypt",key:e})]:this.ciphers=[j.create({type:"decrypt",key:e}),j.create({type:"encrypt",key:d}),j.create({type:"decrypt",key:c})]}function e(a){i.call(this,a);var b=new d(this.type,this.options.key);this._edeState=b}var f=a("minimalistic-assert"),g=a("inherits"),h=a("../des"),i=h.Cipher,j=h.DES;g(e,i),b.exports=e,e.create=function(a){return new e(a)},e.prototype._update=function(a,b,c,d){var e=this._edeState;e.ciphers[0]._update(a,b,c,d),e.ciphers[1]._update(c,d,c,d),e.ciphers[2]._update(c,d,c,d)},e.prototype._pad=j.prototype._pad,e.prototype._unpad=j.prototype._unpad},{"../des":177,inherits:226,"minimalistic-assert":234}],182:[function(a,b,c){"use strict";c.readUInt32BE=function(a,b){var c=a[0+b]<<24|a[1+b]<<16|a[2+b]<<8|a[3+b];return c>>>0},c.writeUInt32BE=function(a,b,c){a[0+c]=b>>>24,a[1+c]=b>>>16&255,a[2+c]=b>>>8&255,a[3+c]=255&b},c.ip=function(a,b,c,d){for(var e=0,f=0,g=6;g>=0;g-=2){for(var h=0;h<=24;h+=8)e<<=1,e|=b>>>h+g&1;for(var h=0;h<=24;h+=8)e<<=1,e|=a>>>h+g&1}for(var g=6;g>=0;g-=2){for(var h=1;h<=25;h+=8)f<<=1,f|=b>>>h+g&1;for(var h=1;h<=25;h+=8)f<<=1,f|=a>>>h+g&1}c[d+0]=e>>>0,c[d+1]=f>>>0},c.rip=function(a,b,c,d){for(var e=0,f=0,g=0;g<4;g++)for(var h=24;h>=0;h-=8)e<<=1,e|=b>>>h+g&1,e<<=1,e|=a>>>h+g&1;for(var g=4;g<8;g++)for(var h=24;h>=0;h-=8)f<<=1,f|=b>>>h+g&1,f<<=1,f|=a>>>h+g&1;c[d+0]=e>>>0,c[d+1]=f>>>0},c.pc1=function(a,b,c,d){for(var e=0,f=0,g=7;g>=5;g--){for(var h=0;h<=24;h+=8)e<<=1,e|=b>>h+g&1;for(var h=0;h<=24;h+=8)e<<=1,e|=a>>h+g&1}for(var h=0;h<=24;h+=8)e<<=1,e|=b>>h+g&1;for(var g=1;g<=3;g++){for(var h=0;h<=24;h+=8)f<<=1,f|=b>>h+g&1;for(var h=0;h<=24;h+=8)f<<=1,f|=a>>h+g&1}for(var h=0;h<=24;h+=8)f<<=1,f|=a>>h+g&1;c[d+0]=e>>>0,c[d+1]=f>>>0},c.r28shl=function(a,b){return a<<b&268435455|a>>>28-b};var d=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];c.pc2=function(a,b,c,e){for(var f=0,g=0,h=d.length>>>1,i=0;i<h;i++)f<<=1,f|=a>>>d[i]&1;for(var i=h;i<d.length;i++)g<<=1,g|=b>>>d[i]&1;c[e+0]=f>>>0,c[e+1]=g>>>0},c.expand=function(a,b,c){var d=0,e=0;d=(1&a)<<5|a>>>27;for(var f=23;f>=15;f-=4)d<<=6,d|=a>>>f&63;for(var f=11;f>=3;f-=4)e|=a>>>f&63,e<<=6;e|=(31&a)<<1|a>>>31,b[c+0]=d>>>0,b[c+1]=e>>>0};var e=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];c.substitute=function(a,b){for(var c=0,d=0;d<4;d++){var f=a>>>18-6*d&63,g=e[64*d+f];c<<=4,c|=g}for(var d=0;d<4;d++){var f=b>>>18-6*d&63,g=e[256+64*d+f];c<<=4,c|=g}return c>>>0};var f=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];c.permute=function(a){for(var b=0,c=0;c<f.length;c++)b<<=1,b|=a>>>f[c]&1;return b>>>0},c.padSplit=function(a,b,c){for(var d=a.toString(2);d.length<b;)d="0"+d;for(var e=[],f=0;f<b;f+=c)e.push(d.slice(f,f+c));return e.join(" ")}},{}],183:[function(a,b,c){(function(Buffer){function b(a){var b=new Buffer(f[a].prime,"hex"),c=new Buffer(f[a].gen,"hex");return new g(b,c)}function d(a,b,c,f){return Buffer.isBuffer(b)||void 0===h[b]?d(a,"binary",b,c):(b=b||"binary",f=f||"binary",c=c||new Buffer([2]),Buffer.isBuffer(c)||(c=new Buffer(c,f)),"number"==typeof a?new g(e(a,c),c,!0):(Buffer.isBuffer(a)||(a=new Buffer(a,b)),new g(a,c,!0)))}var e=a("./lib/generatePrime"),f=a("./lib/primes.json"),g=a("./lib/dh"),h={binary:!0,hex:!0,base64:!0};c.DiffieHellmanGroup=c.createDiffieHellmanGroup=c.getDiffieHellman=b,c.createDiffieHellman=c.DiffieHellman=d}).call(this,a("buffer").Buffer)},{"./lib/dh":184,"./lib/generatePrime":185,"./lib/primes.json":186,buffer:104}],184:[function(a,b,c){(function(Buffer){function c(a,b){return b=b||"utf8",Buffer.isBuffer(a)||(a=new Buffer(a,b)),this._pub=new h(a),this}function d(a,b){return b=b||"utf8",Buffer.isBuffer(a)||(a=new Buffer(a,b)),this._priv=new h(a),this}function e(a,b){var c=b.toString("hex"),d=[c,a.toString(16)].join("_");if(d in r)return r[d];var e=0;if(a.isEven()||!p.simpleSieve||!p.fermatTest(a)||!j.test(a))return e+=1,e+="02"===c||"05"===c?8:4,r[d]=e,e;j.test(a.shrn(1))||(e+=2);var f;switch(c){case"02":a.mod(k).cmp(l)&&(e+=8);break;case"05":f=a.mod(m),f.cmp(n)&&f.cmp(o)&&(e+=8);break;default:e+=4}return r[d]=e,e}function f(a,b,e){this.setGenerator(b),this.__prime=new h(a),this._prime=h.mont(this.__prime),this._primeLen=a.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,e?(this.setPublicKey=c,this.setPrivateKey=d):this._primeCode=8}function g(a,b){var c=new Buffer(a.toArray());return b?c.toString(b):c}var h=a("bn.js"),i=a("miller-rabin"),j=new i,k=new h(24),l=new h(11),m=new h(10),n=new h(3),o=new h(7),p=a("./generatePrime"),q=a("randombytes");b.exports=f;var r={};Object.defineProperty(f.prototype,"verifyError",{enumerable:!0,get:function(){return"number"!=typeof this._primeCode&&(this._primeCode=e(this.__prime,this.__gen)),this._primeCode}}),f.prototype.generateKeys=function(){return this._priv||(this._priv=new h(q(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},f.prototype.computeSecret=function(a){a=new h(a),a=a.toRed(this._prime);var b=a.redPow(this._priv).fromRed(),c=new Buffer(b.toArray()),d=this.getPrime();if(c.length<d.length){var e=new Buffer(d.length-c.length);e.fill(0),c=Buffer.concat([e,c])}return c},f.prototype.getPublicKey=function(a){return g(this._pub,a)},f.prototype.getPrivateKey=function(a){return g(this._priv,a)},f.prototype.getPrime=function(a){return g(this.__prime,a)},f.prototype.getGenerator=function(a){return g(this._gen,a)},f.prototype.setGenerator=function(a,b){return b=b||"utf8",Buffer.isBuffer(a)||(a=new Buffer(a,b)),this.__gen=a,this._gen=new h(a),this}}).call(this,a("buffer").Buffer)},{"./generatePrime":185,"bn.js":75,buffer:104,"miller-rabin":233,randombytes:271}],185:[function(a,b,c){function d(){if(null!==t)return t;var a=1048576,b=[];b[0]=2;for(var c=1,d=3;d<a;d+=2){for(var e=Math.ceil(Math.sqrt(d)),f=0;f<c&&b[f]<=e&&d%b[f]!==0;f++);c!==f&&b[f]<=e||(b[c++]=d)}return t=b,b}function e(a){for(var b=d(),c=0;c<b.length;c++)if(0===a.modn(b[c]))return 0===a.cmpn(b[c]);return!0}function f(a){var b=i.mont(a);return 0===n.toRed(b).redPow(a.subn(1)).fromRed().cmpn(1)}function g(a,b){if(a<16)return new i(2===b||5===b?[140,123]:[140,39]);b=new i(b);for(var c,d;;){for(c=new i(h(Math.ceil(a/8)));c.bitLength()>a;)c.ishrn(1);if(c.isEven()&&c.iadd(m),c.testn(1)||c.iadd(n),b.cmp(n)){if(!b.cmp(o))for(;c.mod(p).cmp(q);)c.iadd(s)}else for(;c.mod(j).cmp(r);)c.iadd(s);if(d=c.shrn(1),e(d)&&e(c)&&f(d)&&f(c)&&l.test(d)&&l.test(c))return c}}var h=a("randombytes");b.exports=g,g.simpleSieve=e,g.fermatTest=f;var i=a("bn.js"),j=new i(24),k=a("miller-rabin"),l=new k,m=new i(1),n=new i(2),o=new i(5),p=(new i(16),new i(8),new i(10)),q=new i(3),r=(new i(7),new i(11)),s=new i(4),t=(new i(12),null)},{"bn.js":75,"miller-rabin":233,randombytes:271}],186:[function(a,b,c){b.exports={modp1:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},modp2:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},modp5:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},modp14:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},modp15:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},modp16:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},modp17:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},modp18:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}}},{}],187:[function(a,b,c){function d(a,b,c,d,e,f,g){this.p=a,this.a=b,this.b=c,this.G=Point.fromAffine(this,d,e),this.n=f,this.h=g,this.infinity=new Point(this,null,null,BigInteger.ZERO),this.pOverFour=a.add(BigInteger.ONE).shiftRight(2),this.pLength=Math.floor((this.p.bitLength()+7)/8)}var e=a("assert"),BigInteger=a("bigi"),Point=a("./point");d.prototype.pointFromX=function(a,b){var c=b.pow(3).add(this.a.multiply(b)).add(this.b).mod(this.p),d=c.modPow(this.pOverFour,this.p),e=d;return d.isEven()^!a&&(e=this.p.subtract(e)),Point.fromAffine(this,b,e)},d.prototype.isInfinity=function(a){return a===this.infinity||0===a.z.signum()&&0!==a.y.signum()},d.prototype.isOnCurve=function(a){if(this.isInfinity(a))return!0;var b=a.affineX,c=a.affineY,d=this.a,e=this.b,f=this.p;if(b.signum()<0||b.compareTo(f)>=0)return!1;if(c.signum()<0||c.compareTo(f)>=0)return!1;var g=c.square().mod(f),h=b.pow(3).add(d.multiply(b)).add(e).mod(f);return g.equals(h)},d.prototype.validate=function(a){e(!this.isInfinity(a),"Point is at infinity"),e(this.isOnCurve(a),"Point is not on the curve");var b=a.multiply(this.n);return e(this.isInfinity(b),"Point is not a scalar multiple of G"),!0},b.exports=d},{"./point":191,assert:19,bigi:25}],188:[function(a,b,c){b.exports={secp128r1:{p:"fffffffdffffffffffffffffffffffff",a:"fffffffdfffffffffffffffffffffffc",b:"e87579c11079f43dd824993c2cee5ed3",n:"fffffffe0000000075a30d1b9038a115",h:"01",Gx:"161ff7528b899b2d0c28607ca52c5b86",Gy:"cf5ac8395bafeb13c02da292dded7a83"},secp160k1:{p:"fffffffffffffffffffffffffffffffeffffac73",a:"00",b:"07",n:"0100000000000000000001b8fa16dfab9aca16b6b3",h:"01",Gx:"3b4c382ce37aa192a4019e763036f4f5dd4d7ebb",Gy:"938cf935318fdced6bc28286531733c3f03c4fee"},secp160r1:{p:"ffffffffffffffffffffffffffffffff7fffffff",a:"ffffffffffffffffffffffffffffffff7ffffffc",b:"1c97befc54bd7a8b65acf89f81d4d4adc565fa45",n:"0100000000000000000001f4c8f927aed3ca752257",h:"01",Gx:"4a96b5688ef573284664698968c38bb913cbfc82",Gy:"23a628553168947d59dcc912042351377ac5fb32"},secp192k1:{p:"fffffffffffffffffffffffffffffffffffffffeffffee37",a:"00",b:"03",n:"fffffffffffffffffffffffe26f2fc170f69466a74defd8d",h:"01",Gx:"db4ff10ec057e9ae26b07d0280b7f4341da5d1b1eae06c7d",Gy:"9b2f2f6d9c5628a7844163d015be86344082aa88d95e2f9d"},secp192r1:{p:"fffffffffffffffffffffffffffffffeffffffffffffffff",a:"fffffffffffffffffffffffffffffffefffffffffffffffc",b:"64210519e59c80e70fa7e9ab72243049feb8deecc146b9b1",n:"ffffffffffffffffffffffff99def836146bc9b1b4d22831",h:"01",Gx:"188da80eb03090f67cbf20eb43a18800f4ff0afd82ff1012",Gy:"07192b95ffc8da78631011ed6b24cdd573f977a11e794811"},secp256k1:{p:"fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f",a:"00",b:"07",n:"fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",h:"01",Gx:"79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798",Gy:"483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8"},secp256r1:{p:"ffffffff00000001000000000000000000000000ffffffffffffffffffffffff",a:"ffffffff00000001000000000000000000000000fffffffffffffffffffffffc",b:"5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b",n:"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551",h:"01",Gx:"6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296",Gy:"4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5"}}},{}],189:[function(a,b,c){var Point=a("./point"),d=a("./curve"),e=a("./names");b.exports={Curve:d,Point:Point,getCurveByName:e}},{"./curve":187,"./names":190,"./point":191}],190:[function(a,b,c){function d(a){var b=e[a];if(!b)return null;var c=new BigInteger(b.p,16),d=new BigInteger(b.a,16),g=new BigInteger(b.b,16),h=new BigInteger(b.n,16),i=new BigInteger(b.h,16),j=new BigInteger(b.Gx,16),k=new BigInteger(b.Gy,16);return new f(c,d,g,j,k,h,i)}var BigInteger=a("bigi"),e=a("./curves.json"),f=a("./curve");b.exports=d},{"./curve":187,"./curves.json":188,bigi:25}],191:[function(a,b,c){(function(Buffer){function Point(a,b,d,e){c.notStrictEqual(e,void 0,"Missing Z coordinate"),this.curve=a,this.x=b,this.y=d,this.z=e,this._zInv=null,this.compressed=!0}var c=a("assert"),BigInteger=a("bigi"),d=BigInteger.valueOf(3);Object.defineProperty(Point.prototype,"zInv",{get:function(){return null===this._zInv&&(this._zInv=this.z.modInverse(this.curve.p)),this._zInv}}),Object.defineProperty(Point.prototype,"affineX",{get:function(){return this.x.multiply(this.zInv).mod(this.curve.p)}}),Object.defineProperty(Point.prototype,"affineY",{get:function(){return this.y.multiply(this.zInv).mod(this.curve.p)}}),Point.fromAffine=function(a,b,c){return new Point(a,b,c,BigInteger.ONE)},Point.prototype.equals=function(a){if(a===this)return!0;if(this.curve.isInfinity(this))return this.curve.isInfinity(a);if(this.curve.isInfinity(a))return this.curve.isInfinity(this);var b=a.y.multiply(this.z).subtract(this.y.multiply(a.z)).mod(this.curve.p);if(0!==b.signum())return!1;var c=a.x.multiply(this.z).subtract(this.x.multiply(a.z)).mod(this.curve.p);return 0===c.signum()},Point.prototype.negate=function(){var a=this.curve.p.subtract(this.y);return new Point(this.curve,this.x,a,this.z)},Point.prototype.add=function(a){if(this.curve.isInfinity(this))return a;if(this.curve.isInfinity(a))return this;var b=this.x,c=this.y,e=a.x,f=a.y,g=f.multiply(this.z).subtract(c.multiply(a.z)).mod(this.curve.p),h=e.multiply(this.z).subtract(b.multiply(a.z)).mod(this.curve.p);if(0===h.signum())return 0===g.signum()?this.twice():this.curve.infinity;var i=h.square(),j=i.multiply(h),k=b.multiply(i),l=g.square().multiply(this.z),m=l.subtract(k.shiftLeft(1)).multiply(a.z).subtract(j).multiply(h).mod(this.curve.p),n=k.multiply(d).multiply(g).subtract(c.multiply(j)).subtract(l.multiply(g)).multiply(a.z).add(g.multiply(j)).mod(this.curve.p),o=j.multiply(this.z).multiply(a.z).mod(this.curve.p);return new Point(this.curve,m,n,o)},Point.prototype.twice=function(){if(this.curve.isInfinity(this))return this;if(0===this.y.signum())return this.curve.infinity;var a=this.x,b=this.y,c=b.multiply(this.z).mod(this.curve.p),e=c.multiply(b).mod(this.curve.p),f=this.curve.a,g=a.square().multiply(d);0!==f.signum()&&(g=g.add(this.z.square().multiply(f))),g=g.mod(this.curve.p);var h=g.square().subtract(a.shiftLeft(3).multiply(e)).shiftLeft(1).multiply(c).mod(this.curve.p),i=g.multiply(d).multiply(a).subtract(e.shiftLeft(1)).shiftLeft(2).multiply(e).subtract(g.pow(3)).mod(this.curve.p),j=c.pow(3).shiftLeft(3).mod(this.curve.p);return new Point(this.curve,h,i,j)},Point.prototype.multiply=function(a){if(this.curve.isInfinity(this))return this;if(0===a.signum())return this.curve.infinity;for(var b=a,c=b.multiply(d),e=this.negate(),f=this,g=c.bitLength()-2;g>0;--g){var h=c.testBit(g),i=b.testBit(g);f=f.twice(),h!==i&&(f=f.add(h?this:e))}return f},Point.prototype.multiplyTwo=function(a,b,c){for(var d=Math.max(a.bitLength(),c.bitLength())-1,e=this.curve.infinity,f=this.add(b);d>=0;){var g=a.testBit(d),h=c.testBit(d);e=e.twice(),g?e=h?e.add(f):e.add(this):h&&(e=e.add(b)),--d}return e},Point.prototype.getEncoded=function(a){if(null==a&&(a=this.compressed),this.curve.isInfinity(this))return new Buffer("00","hex");var b,c=this.affineX,d=this.affineY,e=this.curve.pLength;return a?(b=new Buffer(1+e),b.writeUInt8(d.isEven()?2:3,0)):(b=new Buffer(1+e+e),b.writeUInt8(4,0),d.toBuffer(e).copy(b,1+e)),c.toBuffer(e).copy(b,1),b},Point.decodeFrom=function(a,b){var d,e=b.readUInt8(0),f=4!==e,g=Math.floor((a.p.bitLength()+7)/8),h=BigInteger.fromBuffer(b.slice(1,1+g));if(f){c.equal(b.length,g+1,"Invalid sequence length"),c(2===e||3===e,"Invalid sequence tag");var i=3===e;d=a.pointFromX(i,h)}else{c.equal(b.length,1+g+g,"Invalid sequence length");var j=BigInteger.fromBuffer(b.slice(1+g));d=Point.fromAffine(a,h,j)}return d.compressed=f,d},Point.prototype.toString=function(){return this.curve.isInfinity(this)?"(INFINITY)":"("+this.affineX.toString()+","+this.affineY.toString()+")"},b.exports=Point}).call(this,a("buffer").Buffer)},{assert:19,bigi:25,buffer:104}],192:[function(a,b,c){"use strict";var d=c;d.version=a("../package.json").version,d.utils=a("./elliptic/utils"),d.rand=a("brorand"),d.curve=a("./elliptic/curve"),d.curves=a("./elliptic/curves"),d.ec=a("./elliptic/ec"),d.eddsa=a("./elliptic/eddsa")},{"../package.json":207,"./elliptic/curve":195,"./elliptic/curves":198,"./elliptic/ec":199,"./elliptic/eddsa":202,"./elliptic/utils":206,brorand:76}],193:[function(a,b,c){"use strict";function d(a,b){this.type=a,this.p=new f(b.p,16),this.red=b.prime?f.red(b.prime):f.mont(this.p),this.zero=new f(0).toRed(this.red),this.one=new f(1).toRed(this.red),this.two=new f(2).toRed(this.red),this.n=b.n&&new f(b.n,16),this.g=b.g&&this.pointFromJSON(b.g,b.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4);var c=this.n&&this.p.div(this.n);!c||c.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function e(a,b){this.curve=a,this.type=b,this.precomputed=null}var f=a("bn.js"),g=a("../../elliptic"),h=g.utils,i=h.getNAF,j=h.getJSF,k=h.assert;b.exports=d,d.prototype.point=function(){throw new Error("Not implemented")},d.prototype.validate=function(){throw new Error("Not implemented")},d.prototype._fixedNafMul=function(a,b){k(a.precomputed);var c=a._getDoubles(),d=i(b,1),e=(1<<c.step+1)-(c.step%2===0?2:1);e/=3;for(var f=[],g=0;g<d.length;g+=c.step){for(var h=0,b=g+c.step-1;b>=g;b--)h=(h<<1)+d[b];f.push(h)}for(var j=this.jpoint(null,null,null),l=this.jpoint(null,null,null),m=e;m>0;m--){for(var g=0;g<f.length;g++){var h=f[g];h===m?l=l.mixedAdd(c.points[g]):h===-m&&(l=l.mixedAdd(c.points[g].neg()))}j=j.add(l)}return j.toP()},d.prototype._wnafMul=function(a,b){var c=4,d=a._getNAFPoints(c);c=d.wnd;for(var e=d.points,f=i(b,c),g=this.jpoint(null,null,null),h=f.length-1;h>=0;h--){for(var b=0;h>=0&&0===f[h];h--)b++;if(h>=0&&b++,g=g.dblp(b),h<0)break;var j=f[h];k(0!==j),g="affine"===a.type?j>0?g.mixedAdd(e[j-1>>1]):g.mixedAdd(e[-j-1>>1].neg()):j>0?g.add(e[j-1>>1]):g.add(e[-j-1>>1].neg())}return"affine"===a.type?g.toP():g},d.prototype._wnafMulAdd=function(a,b,c,d,e){for(var f=this._wnafT1,g=this._wnafT2,h=this._wnafT3,k=0,l=0;l<d;l++){var m=b[l],n=m._getNAFPoints(a);f[l]=n.wnd,g[l]=n.points}for(var l=d-1;l>=1;l-=2){var o=l-1,p=l;if(1===f[o]&&1===f[p]){var q=[b[o],null,null,b[p]];0===b[o].y.cmp(b[p].y)?(q[1]=b[o].add(b[p]),q[2]=b[o].toJ().mixedAdd(b[p].neg())):0===b[o].y.cmp(b[p].y.redNeg())?(q[1]=b[o].toJ().mixedAdd(b[p]),q[2]=b[o].add(b[p].neg())):(q[1]=b[o].toJ().mixedAdd(b[p]),q[2]=b[o].toJ().mixedAdd(b[p].neg()));var r=[-3,-1,-5,-7,0,7,5,1,3],s=j(c[o],c[p]);k=Math.max(s[0].length,k),h[o]=new Array(k),h[p]=new Array(k);for(var t=0;t<k;t++){var u=0|s[0][t],v=0|s[1][t];h[o][t]=r[3*(u+1)+(v+1)],h[p][t]=0,g[o]=q}}else h[o]=i(c[o],f[o]),h[p]=i(c[p],f[p]),k=Math.max(h[o].length,k),k=Math.max(h[p].length,k)}for(var w=this.jpoint(null,null,null),x=this._wnafT4,l=k;l>=0;l--){for(var y=0;l>=0;){for(var z=!0,t=0;t<d;t++)x[t]=0|h[t][l],0!==x[t]&&(z=!1);if(!z)break;y++,l--}if(l>=0&&y++,w=w.dblp(y),l<0)break;for(var t=0;t<d;t++){var m,A=x[t];0!==A&&(A>0?m=g[t][A-1>>1]:A<0&&(m=g[t][-A-1>>1].neg()),w="affine"===m.type?w.mixedAdd(m):w.add(m))}}for(var l=0;l<d;l++)g[l]=null;return e?w:w.toP()},d.BasePoint=e,e.prototype.eq=function(){throw new Error("Not implemented")},e.prototype.validate=function(){return this.curve.validate(this)},d.prototype.decodePoint=function(a,b){a=h.toArray(a,b);var c=this.p.byteLength();if((4===a[0]||6===a[0]||7===a[0])&&a.length-1===2*c){6===a[0]?k(a[a.length-1]%2===0):7===a[0]&&k(a[a.length-1]%2===1);var d=this.point(a.slice(1,1+c),a.slice(1+c,1+2*c));return d}if((2===a[0]||3===a[0])&&a.length-1===c)return this.pointFromX(a.slice(1,1+c),3===a[0]);throw new Error("Unknown point format")},e.prototype.encodeCompressed=function(a){return this.encode(a,!0)},e.prototype._encode=function(a){var b=this.curve.p.byteLength(),c=this.getX().toArray("be",b);return a?[this.getY().isEven()?2:3].concat(c):[4].concat(c,this.getY().toArray("be",b))},e.prototype.encode=function(a,b){return h.encode(this._encode(b),a)},e.prototype.precompute=function(a){if(this.precomputed)return this;var b={doubles:null,naf:null,beta:null};return b.naf=this._getNAFPoints(8),b.doubles=this._getDoubles(4,a),b.beta=this._getBeta(),this.precomputed=b,this},e.prototype._hasDoubles=function(a){if(!this.precomputed)return!1;var b=this.precomputed.doubles;return!!b&&b.points.length>=Math.ceil((a.bitLength()+1)/b.step)},e.prototype._getDoubles=function(a,b){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var c=[this],d=this,e=0;e<b;e+=a){for(var f=0;f<a;f++)d=d.dbl();c.push(d)}return{step:a,points:c}},e.prototype._getNAFPoints=function(a){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var b=[this],c=(1<<a)-1,d=1===c?null:this.dbl(),e=1;e<c;e++)b[e]=b[e-1].add(d);return{wnd:a,points:b}},e.prototype._getBeta=function(){return null},e.prototype.dblp=function(a){for(var b=this,c=0;c<a;c++)b=b.dbl();return b}},{"../../elliptic":192,"bn.js":75}],194:[function(a,b,c){"use strict";function d(a){this.twisted=1!==(0|a.a),this.mOneA=this.twisted&&(0|a.a)===-1,this.extended=this.mOneA,i.call(this,"edwards",a),this.a=new g(a.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new g(a.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new g(a.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),j(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1===(0|a.c)}function Point(a,b,c,d,e){i.BasePoint.call(this,a,"projective"),null===b&&null===c&&null===d?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new g(b,16),this.y=new g(c,16),this.z=d?new g(d,16):this.curve.one,this.t=e&&new g(e,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}var e=a("../curve"),f=a("../../elliptic"),g=a("bn.js"),h=a("inherits"),i=e.base,j=f.utils.assert;h(d,i),b.exports=d,d.prototype._mulA=function(a){return this.mOneA?a.redNeg():this.a.redMul(a); |
| 15 |
|
},d.prototype._mulC=function(a){return this.oneC?a:this.c.redMul(a)},d.prototype.jpoint=function(a,b,c,d){return this.point(a,b,c,d)},d.prototype.pointFromX=function(a,b){a=new g(a,16),a.red||(a=a.toRed(this.red));var c=a.redSqr(),d=this.c2.redSub(this.a.redMul(c)),e=this.one.redSub(this.c2.redMul(this.d).redMul(c)),f=d.redMul(e.redInvm()),h=f.redSqrt();if(0!==h.redSqr().redSub(f).cmp(this.zero))throw new Error("invalid point");var i=h.fromRed().isOdd();return(b&&!i||!b&&i)&&(h=h.redNeg()),this.point(a,h)},d.prototype.pointFromY=function(a,b){a=new g(a,16),a.red||(a=a.toRed(this.red));var c=a.redSqr(),d=c.redSub(this.one),e=c.redMul(this.d).redAdd(this.one),f=d.redMul(e.redInvm());if(0===f.cmp(this.zero)){if(b)throw new Error("invalid point");return this.point(this.zero,a)}var h=f.redSqrt();if(0!==h.redSqr().redSub(f).cmp(this.zero))throw new Error("invalid point");return h.isOdd()!==b&&(h=h.redNeg()),this.point(h,a)},d.prototype.validate=function(a){if(a.isInfinity())return!0;a.normalize();var b=a.x.redSqr(),c=a.y.redSqr(),d=b.redMul(this.a).redAdd(c),e=this.c2.redMul(this.one.redAdd(this.d.redMul(b).redMul(c)));return 0===d.cmp(e)},h(Point,i.BasePoint),d.prototype.pointFromJSON=function(a){return Point.fromJSON(this,a)},d.prototype.point=function(a,b,c,d){return new Point(this,a,b,c,d)},Point.fromJSON=function(a,b){return new Point(a,b[0],b[1],b[2])},Point.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},Point.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&0===this.y.cmp(this.z)},Point.prototype._extDbl=function(){var a=this.x.redSqr(),b=this.y.redSqr(),c=this.z.redSqr();c=c.redIAdd(c);var d=this.curve._mulA(a),e=this.x.redAdd(this.y).redSqr().redISub(a).redISub(b),f=d.redAdd(b),g=f.redSub(c),h=d.redSub(b),i=e.redMul(g),j=f.redMul(h),k=e.redMul(h),l=g.redMul(f);return this.curve.point(i,j,l,k)},Point.prototype._projDbl=function(){var a,b,c,d=this.x.redAdd(this.y).redSqr(),e=this.x.redSqr(),f=this.y.redSqr();if(this.curve.twisted){var g=this.curve._mulA(e),h=g.redAdd(f);if(this.zOne)a=d.redSub(e).redSub(f).redMul(h.redSub(this.curve.two)),b=h.redMul(g.redSub(f)),c=h.redSqr().redSub(h).redSub(h);else{var i=this.z.redSqr(),j=h.redSub(i).redISub(i);a=d.redSub(e).redISub(f).redMul(j),b=h.redMul(g.redSub(f)),c=h.redMul(j)}}else{var g=e.redAdd(f),i=this.curve._mulC(this.c.redMul(this.z)).redSqr(),j=g.redSub(i).redSub(i);a=this.curve._mulC(d.redISub(g)).redMul(j),b=this.curve._mulC(g).redMul(e.redISub(f)),c=g.redMul(j)}return this.curve.point(a,b,c)},Point.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},Point.prototype._extAdd=function(a){var b=this.y.redSub(this.x).redMul(a.y.redSub(a.x)),c=this.y.redAdd(this.x).redMul(a.y.redAdd(a.x)),d=this.t.redMul(this.curve.dd).redMul(a.t),e=this.z.redMul(a.z.redAdd(a.z)),f=c.redSub(b),g=e.redSub(d),h=e.redAdd(d),i=c.redAdd(b),j=f.redMul(g),k=h.redMul(i),l=f.redMul(i),m=g.redMul(h);return this.curve.point(j,k,m,l)},Point.prototype._projAdd=function(a){var b,c,d=this.z.redMul(a.z),e=d.redSqr(),f=this.x.redMul(a.x),g=this.y.redMul(a.y),h=this.curve.d.redMul(f).redMul(g),i=e.redSub(h),j=e.redAdd(h),k=this.x.redAdd(this.y).redMul(a.x.redAdd(a.y)).redISub(f).redISub(g),l=d.redMul(i).redMul(k);return this.curve.twisted?(b=d.redMul(j).redMul(g.redSub(this.curve._mulA(f))),c=i.redMul(j)):(b=d.redMul(j).redMul(g.redSub(f)),c=this.curve._mulC(i).redMul(j)),this.curve.point(l,b,c)},Point.prototype.add=function(a){return this.isInfinity()?a:a.isInfinity()?this:this.curve.extended?this._extAdd(a):this._projAdd(a)},Point.prototype.mul=function(a){return this._hasDoubles(a)?this.curve._fixedNafMul(this,a):this.curve._wnafMul(this,a)},Point.prototype.mulAdd=function(a,b,c){return this.curve._wnafMulAdd(1,[this,b],[a,c],2,!1)},Point.prototype.jmulAdd=function(a,b,c){return this.curve._wnafMulAdd(1,[this,b],[a,c],2,!0)},Point.prototype.normalize=function(){if(this.zOne)return this;var a=this.z.redInvm();return this.x=this.x.redMul(a),this.y=this.y.redMul(a),this.t&&(this.t=this.t.redMul(a)),this.z=this.curve.one,this.zOne=!0,this},Point.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},Point.prototype.getX=function(){return this.normalize(),this.x.fromRed()},Point.prototype.getY=function(){return this.normalize(),this.y.fromRed()},Point.prototype.eq=function(a){return this===a||0===this.getX().cmp(a.getX())&&0===this.getY().cmp(a.getY())},Point.prototype.eqXToP=function(a){var b=a.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(b))return!0;for(var c=a.clone(),d=this.curve.redN.redMul(this.z);;){if(c.iadd(this.curve.n),c.cmp(this.curve.p)>=0)return!1;if(b.redIAdd(d),0===this.x.cmp(b))return!0}return!1},Point.prototype.toP=Point.prototype.normalize,Point.prototype.mixedAdd=Point.prototype.add},{"../../elliptic":192,"../curve":195,"bn.js":75,inherits:226}],195:[function(a,b,c){"use strict";var d=c;d.base=a("./base"),d.short=a("./short"),d.mont=a("./mont"),d.edwards=a("./edwards")},{"./base":193,"./edwards":194,"./mont":196,"./short":197}],196:[function(a,b,c){"use strict";function d(a){h.call(this,"mont",a),this.a=new f(a.a,16).toRed(this.red),this.b=new f(a.b,16).toRed(this.red),this.i4=new f(4).toRed(this.red).redInvm(),this.two=new f(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function Point(a,b,c){h.BasePoint.call(this,a,"projective"),null===b&&null===c?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new f(b,16),this.z=new f(c,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}var e=a("../curve"),f=a("bn.js"),g=a("inherits"),h=e.base,i=a("../../elliptic"),j=i.utils;g(d,h),b.exports=d,d.prototype.validate=function(a){var b=a.normalize().x,c=b.redSqr(),d=c.redMul(b).redAdd(c.redMul(this.a)).redAdd(b),e=d.redSqrt();return 0===e.redSqr().cmp(d)},g(Point,h.BasePoint),d.prototype.decodePoint=function(a,b){return this.point(j.toArray(a,b),1)},d.prototype.point=function(a,b){return new Point(this,a,b)},d.prototype.pointFromJSON=function(a){return Point.fromJSON(this,a)},Point.prototype.precompute=function(){},Point.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},Point.fromJSON=function(a,b){return new Point(a,b[0],b[1]||a.one)},Point.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},Point.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},Point.prototype.dbl=function(){var a=this.x.redAdd(this.z),b=a.redSqr(),c=this.x.redSub(this.z),d=c.redSqr(),e=b.redSub(d),f=b.redMul(d),g=e.redMul(d.redAdd(this.curve.a24.redMul(e)));return this.curve.point(f,g)},Point.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},Point.prototype.diffAdd=function(a,b){var c=this.x.redAdd(this.z),d=this.x.redSub(this.z),e=a.x.redAdd(a.z),f=a.x.redSub(a.z),g=f.redMul(c),h=e.redMul(d),i=b.z.redMul(g.redAdd(h).redSqr()),j=b.x.redMul(g.redISub(h).redSqr());return this.curve.point(i,j)},Point.prototype.mul=function(a){for(var b=a.clone(),c=this,d=this.curve.point(null,null),e=this,f=[];0!==b.cmpn(0);b.iushrn(1))f.push(b.andln(1));for(var g=f.length-1;g>=0;g--)0===f[g]?(c=c.diffAdd(d,e),d=d.dbl()):(d=c.diffAdd(d,e),c=c.dbl());return d},Point.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},Point.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},Point.prototype.eq=function(a){return 0===this.getX().cmp(a.getX())},Point.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},Point.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},{"../../elliptic":192,"../curve":195,"bn.js":75,inherits:226}],197:[function(a,b,c){"use strict";function d(a){j.call(this,"short",a),this.a=new h(a.a,16).toRed(this.red),this.b=new h(a.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(a),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function Point(a,b,c,d){j.BasePoint.call(this,a,"affine"),null===b&&null===c?(this.x=null,this.y=null,this.inf=!0):(this.x=new h(b,16),this.y=new h(c,16),d&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function e(a,b,c,d){j.BasePoint.call(this,a,"jacobian"),null===b&&null===c&&null===d?(this.x=this.curve.one,this.y=this.curve.one,this.z=new h(0)):(this.x=new h(b,16),this.y=new h(c,16),this.z=new h(d,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}var f=a("../curve"),g=a("../../elliptic"),h=a("bn.js"),i=a("inherits"),j=f.base,k=g.utils.assert;i(d,j),b.exports=d,d.prototype._getEndomorphism=function(a){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var b,c;if(a.beta)b=new h(a.beta,16).toRed(this.red);else{var d=this._getEndoRoots(this.p);b=d[0].cmp(d[1])<0?d[0]:d[1],b=b.toRed(this.red)}if(a.lambda)c=new h(a.lambda,16);else{var e=this._getEndoRoots(this.n);0===this.g.mul(e[0]).x.cmp(this.g.x.redMul(b))?c=e[0]:(c=e[1],k(0===this.g.mul(c).x.cmp(this.g.x.redMul(b))))}var f;return f=a.basis?a.basis.map(function(a){return{a:new h(a.a,16),b:new h(a.b,16)}}):this._getEndoBasis(c),{beta:b,lambda:c,basis:f}}},d.prototype._getEndoRoots=function(a){var b=a===this.p?this.red:h.mont(a),c=new h(2).toRed(b).redInvm(),d=c.redNeg(),e=new h(3).toRed(b).redNeg().redSqrt().redMul(c),f=d.redAdd(e).fromRed(),g=d.redSub(e).fromRed();return[f,g]},d.prototype._getEndoBasis=function(a){for(var b,c,d,e,f,g,i,j,k,l=this.n.ushrn(Math.floor(this.n.bitLength()/2)),m=a,n=this.n.clone(),o=new h(1),p=new h(0),q=new h(0),r=new h(1),s=0;0!==m.cmpn(0);){var t=n.div(m);j=n.sub(t.mul(m)),k=q.sub(t.mul(o));var u=r.sub(t.mul(p));if(!d&&j.cmp(l)<0)b=i.neg(),c=o,d=j.neg(),e=k;else if(d&&2===++s)break;i=j,n=m,m=j,q=o,o=k,r=p,p=u}f=j.neg(),g=k;var v=d.sqr().add(e.sqr()),w=f.sqr().add(g.sqr());return w.cmp(v)>=0&&(f=b,g=c),d.negative&&(d=d.neg(),e=e.neg()),f.negative&&(f=f.neg(),g=g.neg()),[{a:d,b:e},{a:f,b:g}]},d.prototype._endoSplit=function(a){var b=this.endo.basis,c=b[0],d=b[1],e=d.b.mul(a).divRound(this.n),f=c.b.neg().mul(a).divRound(this.n),g=e.mul(c.a),h=f.mul(d.a),i=e.mul(c.b),j=f.mul(d.b),k=a.sub(g).sub(h),l=i.add(j).neg();return{k1:k,k2:l}},d.prototype.pointFromX=function(a,b){a=new h(a,16),a.red||(a=a.toRed(this.red));var c=a.redSqr().redMul(a).redIAdd(a.redMul(this.a)).redIAdd(this.b),d=c.redSqrt();if(0!==d.redSqr().redSub(c).cmp(this.zero))throw new Error("invalid point");var e=d.fromRed().isOdd();return(b&&!e||!b&&e)&&(d=d.redNeg()),this.point(a,d)},d.prototype.validate=function(a){if(a.inf)return!0;var b=a.x,c=a.y,d=this.a.redMul(b),e=b.redSqr().redMul(b).redIAdd(d).redIAdd(this.b);return 0===c.redSqr().redISub(e).cmpn(0)},d.prototype._endoWnafMulAdd=function(a,b,c){for(var d=this._endoWnafT1,e=this._endoWnafT2,f=0;f<a.length;f++){var g=this._endoSplit(b[f]),h=a[f],i=h._getBeta();g.k1.negative&&(g.k1.ineg(),h=h.neg(!0)),g.k2.negative&&(g.k2.ineg(),i=i.neg(!0)),d[2*f]=h,d[2*f+1]=i,e[2*f]=g.k1,e[2*f+1]=g.k2}for(var j=this._wnafMulAdd(1,d,e,2*f,c),k=0;k<2*f;k++)d[k]=null,e[k]=null;return j},i(Point,j.BasePoint),d.prototype.point=function(a,b,c){return new Point(this,a,b,c)},d.prototype.pointFromJSON=function(a,b){return Point.fromJSON(this,a,b)},Point.prototype._getBeta=function(){if(this.curve.endo){var a=this.precomputed;if(a&&a.beta)return a.beta;var b=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(a){var c=this.curve,d=function(a){return c.point(a.x.redMul(c.endo.beta),a.y)};a.beta=b,b.precomputed={beta:null,naf:a.naf&&{wnd:a.naf.wnd,points:a.naf.points.map(d)},doubles:a.doubles&&{step:a.doubles.step,points:a.doubles.points.map(d)}}}return b}},Point.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},Point.fromJSON=function(a,b,c){function d(b){return a.point(b[0],b[1],c)}"string"==typeof b&&(b=JSON.parse(b));var e=a.point(b[0],b[1],c);if(!b[2])return e;var f=b[2];return e.precomputed={beta:null,doubles:f.doubles&&{step:f.doubles.step,points:[e].concat(f.doubles.points.map(d))},naf:f.naf&&{wnd:f.naf.wnd,points:[e].concat(f.naf.points.map(d))}},e},Point.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},Point.prototype.isInfinity=function(){return this.inf},Point.prototype.add=function(a){if(this.inf)return a;if(a.inf)return this;if(this.eq(a))return this.dbl();if(this.neg().eq(a))return this.curve.point(null,null);if(0===this.x.cmp(a.x))return this.curve.point(null,null);var b=this.y.redSub(a.y);0!==b.cmpn(0)&&(b=b.redMul(this.x.redSub(a.x).redInvm()));var c=b.redSqr().redISub(this.x).redISub(a.x),d=b.redMul(this.x.redSub(c)).redISub(this.y);return this.curve.point(c,d)},Point.prototype.dbl=function(){if(this.inf)return this;var a=this.y.redAdd(this.y);if(0===a.cmpn(0))return this.curve.point(null,null);var b=this.curve.a,c=this.x.redSqr(),d=a.redInvm(),e=c.redAdd(c).redIAdd(c).redIAdd(b).redMul(d),f=e.redSqr().redISub(this.x.redAdd(this.x)),g=e.redMul(this.x.redSub(f)).redISub(this.y);return this.curve.point(f,g)},Point.prototype.getX=function(){return this.x.fromRed()},Point.prototype.getY=function(){return this.y.fromRed()},Point.prototype.mul=function(a){return a=new h(a,16),this._hasDoubles(a)?this.curve._fixedNafMul(this,a):this.curve.endo?this.curve._endoWnafMulAdd([this],[a]):this.curve._wnafMul(this,a)},Point.prototype.mulAdd=function(a,b,c){var d=[this,b],e=[a,c];return this.curve.endo?this.curve._endoWnafMulAdd(d,e):this.curve._wnafMulAdd(1,d,e,2)},Point.prototype.jmulAdd=function(a,b,c){var d=[this,b],e=[a,c];return this.curve.endo?this.curve._endoWnafMulAdd(d,e,!0):this.curve._wnafMulAdd(1,d,e,2,!0)},Point.prototype.eq=function(a){return this===a||this.inf===a.inf&&(this.inf||0===this.x.cmp(a.x)&&0===this.y.cmp(a.y))},Point.prototype.neg=function(a){if(this.inf)return this;var b=this.curve.point(this.x,this.y.redNeg());if(a&&this.precomputed){var c=this.precomputed,d=function(a){return a.neg()};b.precomputed={naf:c.naf&&{wnd:c.naf.wnd,points:c.naf.points.map(d)},doubles:c.doubles&&{step:c.doubles.step,points:c.doubles.points.map(d)}}}return b},Point.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var a=this.curve.jpoint(this.x,this.y,this.curve.one);return a},i(e,j.BasePoint),d.prototype.jpoint=function(a,b,c){return new e(this,a,b,c)},e.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var a=this.z.redInvm(),b=a.redSqr(),c=this.x.redMul(b),d=this.y.redMul(b).redMul(a);return this.curve.point(c,d)},e.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},e.prototype.add=function(a){if(this.isInfinity())return a;if(a.isInfinity())return this;var b=a.z.redSqr(),c=this.z.redSqr(),d=this.x.redMul(b),e=a.x.redMul(c),f=this.y.redMul(b.redMul(a.z)),g=a.y.redMul(c.redMul(this.z)),h=d.redSub(e),i=f.redSub(g);if(0===h.cmpn(0))return 0!==i.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var j=h.redSqr(),k=j.redMul(h),l=d.redMul(j),m=i.redSqr().redIAdd(k).redISub(l).redISub(l),n=i.redMul(l.redISub(m)).redISub(f.redMul(k)),o=this.z.redMul(a.z).redMul(h);return this.curve.jpoint(m,n,o)},e.prototype.mixedAdd=function(a){if(this.isInfinity())return a.toJ();if(a.isInfinity())return this;var b=this.z.redSqr(),c=this.x,d=a.x.redMul(b),e=this.y,f=a.y.redMul(b).redMul(this.z),g=c.redSub(d),h=e.redSub(f);if(0===g.cmpn(0))return 0!==h.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var i=g.redSqr(),j=i.redMul(g),k=c.redMul(i),l=h.redSqr().redIAdd(j).redISub(k).redISub(k),m=h.redMul(k.redISub(l)).redISub(e.redMul(j)),n=this.z.redMul(g);return this.curve.jpoint(l,m,n)},e.prototype.dblp=function(a){if(0===a)return this;if(this.isInfinity())return this;if(!a)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var b=this,c=0;c<a;c++)b=b.dbl();return b}for(var d=this.curve.a,e=this.curve.tinv,f=this.x,g=this.y,h=this.z,i=h.redSqr().redSqr(),j=g.redAdd(g),c=0;c<a;c++){var k=f.redSqr(),l=j.redSqr(),m=l.redSqr(),n=k.redAdd(k).redIAdd(k).redIAdd(d.redMul(i)),o=f.redMul(l),p=n.redSqr().redISub(o.redAdd(o)),q=o.redISub(p),r=n.redMul(q);r=r.redIAdd(r).redISub(m);var s=j.redMul(h);c+1<a&&(i=i.redMul(m)),f=p,h=s,j=r}return this.curve.jpoint(f,j.redMul(e),h)},e.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},e.prototype._zeroDbl=function(){var a,b,c;if(this.zOne){var d=this.x.redSqr(),e=this.y.redSqr(),f=e.redSqr(),g=this.x.redAdd(e).redSqr().redISub(d).redISub(f);g=g.redIAdd(g);var h=d.redAdd(d).redIAdd(d),i=h.redSqr().redISub(g).redISub(g),j=f.redIAdd(f);j=j.redIAdd(j),j=j.redIAdd(j),a=i,b=h.redMul(g.redISub(i)).redISub(j),c=this.y.redAdd(this.y)}else{var k=this.x.redSqr(),l=this.y.redSqr(),m=l.redSqr(),n=this.x.redAdd(l).redSqr().redISub(k).redISub(m);n=n.redIAdd(n);var o=k.redAdd(k).redIAdd(k),p=o.redSqr(),q=m.redIAdd(m);q=q.redIAdd(q),q=q.redIAdd(q),a=p.redISub(n).redISub(n),b=o.redMul(n.redISub(a)).redISub(q),c=this.y.redMul(this.z),c=c.redIAdd(c)}return this.curve.jpoint(a,b,c)},e.prototype._threeDbl=function(){var a,b,c;if(this.zOne){var d=this.x.redSqr(),e=this.y.redSqr(),f=e.redSqr(),g=this.x.redAdd(e).redSqr().redISub(d).redISub(f);g=g.redIAdd(g);var h=d.redAdd(d).redIAdd(d).redIAdd(this.curve.a),i=h.redSqr().redISub(g).redISub(g);a=i;var j=f.redIAdd(f);j=j.redIAdd(j),j=j.redIAdd(j),b=h.redMul(g.redISub(i)).redISub(j),c=this.y.redAdd(this.y)}else{var k=this.z.redSqr(),l=this.y.redSqr(),m=this.x.redMul(l),n=this.x.redSub(k).redMul(this.x.redAdd(k));n=n.redAdd(n).redIAdd(n);var o=m.redIAdd(m);o=o.redIAdd(o);var p=o.redAdd(o);a=n.redSqr().redISub(p),c=this.y.redAdd(this.z).redSqr().redISub(l).redISub(k);var q=l.redSqr();q=q.redIAdd(q),q=q.redIAdd(q),q=q.redIAdd(q),b=n.redMul(o.redISub(a)).redISub(q)}return this.curve.jpoint(a,b,c)},e.prototype._dbl=function(){var a=this.curve.a,b=this.x,c=this.y,d=this.z,e=d.redSqr().redSqr(),f=b.redSqr(),g=c.redSqr(),h=f.redAdd(f).redIAdd(f).redIAdd(a.redMul(e)),i=b.redAdd(b);i=i.redIAdd(i);var j=i.redMul(g),k=h.redSqr().redISub(j.redAdd(j)),l=j.redISub(k),m=g.redSqr();m=m.redIAdd(m),m=m.redIAdd(m),m=m.redIAdd(m);var n=h.redMul(l).redISub(m),o=c.redAdd(c).redMul(d);return this.curve.jpoint(k,n,o)},e.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var a=this.x.redSqr(),b=this.y.redSqr(),c=this.z.redSqr(),d=b.redSqr(),e=a.redAdd(a).redIAdd(a),f=e.redSqr(),g=this.x.redAdd(b).redSqr().redISub(a).redISub(d);g=g.redIAdd(g),g=g.redAdd(g).redIAdd(g),g=g.redISub(f);var h=g.redSqr(),i=d.redIAdd(d);i=i.redIAdd(i),i=i.redIAdd(i),i=i.redIAdd(i);var j=e.redIAdd(g).redSqr().redISub(f).redISub(h).redISub(i),k=b.redMul(j);k=k.redIAdd(k),k=k.redIAdd(k);var l=this.x.redMul(h).redISub(k);l=l.redIAdd(l),l=l.redIAdd(l);var m=this.y.redMul(j.redMul(i.redISub(j)).redISub(g.redMul(h)));m=m.redIAdd(m),m=m.redIAdd(m),m=m.redIAdd(m);var n=this.z.redAdd(g).redSqr().redISub(c).redISub(h);return this.curve.jpoint(l,m,n)},e.prototype.mul=function(a,b){return a=new h(a,b),this.curve._wnafMul(this,a)},e.prototype.eq=function(a){if("affine"===a.type)return this.eq(a.toJ());if(this===a)return!0;var b=this.z.redSqr(),c=a.z.redSqr();if(0!==this.x.redMul(c).redISub(a.x.redMul(b)).cmpn(0))return!1;var d=b.redMul(this.z),e=c.redMul(a.z);return 0===this.y.redMul(e).redISub(a.y.redMul(d)).cmpn(0)},e.prototype.eqXToP=function(a){var b=this.z.redSqr(),c=a.toRed(this.curve.red).redMul(b);if(0===this.x.cmp(c))return!0;for(var d=a.clone(),e=this.curve.redN.redMul(b);;){if(d.iadd(this.curve.n),d.cmp(this.curve.p)>=0)return!1;if(c.redIAdd(e),0===this.x.cmp(c))return!0}return!1},e.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},e.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},{"../../elliptic":192,"../curve":195,"bn.js":75,inherits:226}],198:[function(a,b,c){"use strict";function d(a){"short"===a.type?this.curve=new h.curve.short(a):"edwards"===a.type?this.curve=new h.curve.edwards(a):this.curve=new h.curve.mont(a),this.g=this.curve.g,this.n=this.curve.n,this.hash=a.hash,i(this.g.validate(),"Invalid curve"),i(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function e(a,b){Object.defineProperty(f,a,{configurable:!0,enumerable:!0,get:function(){var c=new d(b);return Object.defineProperty(f,a,{configurable:!0,enumerable:!0,value:c}),c}})}var f=c,g=a("hash.js"),h=a("../elliptic"),i=h.utils.assert;f.PresetCurve=d,e("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:g.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),e("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:g.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),e("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:g.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),e("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:g.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),e("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:g.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),e("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:g.sha256,gRed:!1,g:["9"]}),e("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:g.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var j;try{j=a("./precomputed/secp256k1")}catch(a){j=void 0}e("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:g.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",j]})},{"../elliptic":192,"./precomputed/secp256k1":205,"hash.js":211}],199:[function(a,b,c){"use strict";function d(a){return this instanceof d?("string"==typeof a&&(i(g.curves.hasOwnProperty(a),"Unknown curve "+a),a=g.curves[a]),a instanceof g.curves.PresetCurve&&(a={curve:a}),this.curve=a.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=a.curve.g,this.g.precompute(a.curve.n.bitLength()+1),void(this.hash=a.hash||a.curve.hash)):new d(a)}var e=a("bn.js"),f=a("hmac-drbg"),g=a("../../elliptic"),h=g.utils,i=h.assert,j=a("./key"),k=a("./signature");b.exports=d,d.prototype.keyPair=function(a){return new j(this,a)},d.prototype.keyFromPrivate=function(a,b){return j.fromPrivate(this,a,b)},d.prototype.keyFromPublic=function(a,b){return j.fromPublic(this,a,b)},d.prototype.genKeyPair=function(a){a||(a={});for(var b=new f({hash:this.hash,pers:a.pers,persEnc:a.persEnc||"utf8",entropy:a.entropy||g.rand(this.hash.hmacStrength),entropyEnc:a.entropy&&a.entropyEnc||"utf8",nonce:this.n.toArray()}),c=this.n.byteLength(),d=this.n.sub(new e(2));;){var h=new e(b.generate(c));if(!(h.cmp(d)>0))return h.iaddn(1),this.keyFromPrivate(h)}},d.prototype._truncateToN=function(a,b){var c=8*a.byteLength()-this.n.bitLength();return c>0&&(a=a.ushrn(c)),!b&&a.cmp(this.n)>=0?a.sub(this.n):a},d.prototype.sign=function(a,b,c,d){"object"==typeof c&&(d=c,c=null),d||(d={}),b=this.keyFromPrivate(b,c),a=this._truncateToN(new e(a,16));for(var g=this.n.byteLength(),h=b.getPrivate().toArray("be",g),i=a.toArray("be",g),j=new f({hash:this.hash,entropy:h,nonce:i,pers:d.pers,persEnc:d.persEnc||"utf8"}),l=this.n.sub(new e(1)),m=0;!0;m++){var n=d.k?d.k(m):new e(j.generate(this.n.byteLength()));if(n=this._truncateToN(n,!0),!(n.cmpn(1)<=0||n.cmp(l)>=0)){var o=this.g.mul(n);if(!o.isInfinity()){var p=o.getX(),q=p.umod(this.n);if(0!==q.cmpn(0)){var r=n.invm(this.n).mul(q.mul(b.getPrivate()).iadd(a));if(r=r.umod(this.n),0!==r.cmpn(0)){var s=(o.getY().isOdd()?1:0)|(0!==p.cmp(q)?2:0);return d.canonical&&r.cmp(this.nh)>0&&(r=this.n.sub(r),s^=1),new k({r:q,s:r,recoveryParam:s})}}}}}},d.prototype.verify=function(a,b,c,d){a=this._truncateToN(new e(a,16)),c=this.keyFromPublic(c,d),b=new k(b,"hex");var f=b.r,g=b.s;if(f.cmpn(1)<0||f.cmp(this.n)>=0)return!1;if(g.cmpn(1)<0||g.cmp(this.n)>=0)return!1;var h=g.invm(this.n),i=h.mul(a).umod(this.n),j=h.mul(f).umod(this.n);if(!this.curve._maxwellTrick){var l=this.g.mulAdd(i,c.getPublic(),j);return!l.isInfinity()&&0===l.getX().umod(this.n).cmp(f)}var l=this.g.jmulAdd(i,c.getPublic(),j);return!l.isInfinity()&&l.eqXToP(f)},d.prototype.recoverPubKey=function(a,b,c,d){i((3&c)===c,"The recovery param is more than two bits"),b=new k(b,d);var f=this.n,g=new e(a),h=b.r,j=b.s,l=1&c,m=c>>1;if(h.cmp(this.curve.p.umod(this.curve.n))>=0&&m)throw new Error("Unable to find sencond key candinate");h=m?this.curve.pointFromX(h.add(this.curve.n),l):this.curve.pointFromX(h,l);var n=b.r.invm(f),o=f.sub(g).mul(n).umod(f),p=j.mul(n).umod(f);return this.g.mulAdd(o,h,p)},d.prototype.getKeyRecoveryParam=function(a,b,c,d){if(b=new k(b,d),null!==b.recoveryParam)return b.recoveryParam;for(var e=0;e<4;e++){var f;try{f=this.recoverPubKey(a,b,e)}catch(a){continue}if(f.eq(c))return e}throw new Error("Unable to find valid recovery factor")}},{"../../elliptic":192,"./key":200,"./signature":201,"bn.js":75,"hmac-drbg":223}],200:[function(a,b,c){"use strict";function d(a,b){this.ec=a,this.priv=null,this.pub=null,b.priv&&this._importPrivate(b.priv,b.privEnc),b.pub&&this._importPublic(b.pub,b.pubEnc)}var e=a("bn.js"),f=a("../../elliptic"),g=f.utils,h=g.assert;b.exports=d,d.fromPublic=function(a,b,c){return b instanceof d?b:new d(a,{pub:b,pubEnc:c})},d.fromPrivate=function(a,b,c){return b instanceof d?b:new d(a,{priv:b,privEnc:c})},d.prototype.validate=function(){var a=this.getPublic();return a.isInfinity()?{result:!1,reason:"Invalid public key"}:a.validate()?a.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},d.prototype.getPublic=function(a,b){return"string"==typeof a&&(b=a,a=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),b?this.pub.encode(b,a):this.pub},d.prototype.getPrivate=function(a){return"hex"===a?this.priv.toString(16,2):this.priv},d.prototype._importPrivate=function(a,b){this.priv=new e(a,b||16),this.priv=this.priv.umod(this.ec.curve.n)},d.prototype._importPublic=function(a,b){return a.x||a.y?("mont"===this.ec.curve.type?h(a.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||h(a.x&&a.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(a.x,a.y))):void(this.pub=this.ec.curve.decodePoint(a,b))},d.prototype.derive=function(a){return a.mul(this.priv).getX()},d.prototype.sign=function(a,b,c){return this.ec.sign(a,this,b,c)},d.prototype.verify=function(a,b){return this.ec.verify(a,b,this)},d.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}},{"../../elliptic":192,"bn.js":75}],201:[function(a,b,c){"use strict";function d(a,b){return a instanceof d?a:void(this._importDER(a,b)||(l(a.r&&a.s,"Signature without r or s"),this.r=new i(a.r,16),this.s=new i(a.s,16),void 0===a.recoveryParam?this.recoveryParam=null:this.recoveryParam=a.recoveryParam))}function e(){this.place=0}function f(a,b){var c=a[b.place++];if(!(128&c))return c;for(var d=15&c,e=0,f=0,g=b.place;f<d;f++,g++)e<<=8,e|=a[g];return b.place=g,e}function g(a){for(var b=0,c=a.length-1;!a[b]&&!(128&a[b+1])&&b<c;)b++;return 0===b?a:a.slice(b)}function h(a,b){if(b<128)return void a.push(b);var c=1+(Math.log(b)/Math.LN2>>>3);for(a.push(128|c);--c;)a.push(b>>>(c<<3)&255);a.push(b)}var i=a("bn.js"),j=a("../../elliptic"),k=j.utils,l=k.assert;b.exports=d,d.prototype._importDER=function(a,b){a=k.toArray(a,b);var c=new e;if(48!==a[c.place++])return!1;var d=f(a,c);if(d+c.place!==a.length)return!1;if(2!==a[c.place++])return!1;var g=f(a,c),h=a.slice(c.place,g+c.place);if(c.place+=g,2!==a[c.place++])return!1;var j=f(a,c);if(a.length!==j+c.place)return!1; |