Array.prototype.map||(Array.prototype.map=function(a,e){var b,c,f;if(null==this)throw new TypeError(" this is null or not defined");var d=Object(this),m=d.length>>>0;if("[object Function]"!={}.toString.call(a))throw new TypeError(a+" is not a function");e&&(b=e);c=Array(m);for(f=0;f>>32-b},rotr:function(a,b){return a<<32-b|a>>>b},endian:function(a){if(a.constructor==Number)return e.rotl(a,8)&16711935|e.rotl(a,24)&4278255360;for(var b=0;b>>5]|=(a[d]&255)<< 24-e%32;return b},wordsToBytes:function(a){for(var b=[],d=0;d<32*a.length;d+=8)b.push(a[d>>>5]>>>24-d%32&255);return b},bytesToHex:function(a){for(var b=[],d=0;d>>4).toString(16)),b.push((a[d]&15).toString(16));return b.join("")},hexToBytes:function(a){for(var b=[],d=0;dh;h++)8*d+6*h<=8*a.length?b.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>> 6*(3-h)&63)):b.push("=");return b.join("")},base64ToBytes:function(a){a=a.replace(/[^A-Z0-9+\/]/ig,"");for(var b=[],d=0,e=0;d>>6-2*e);return b}},a=a.charenc={};a.UTF8={stringToBytes:function(a){return b.stringToBytes(unescape(encodeURIComponent(a)))},bytesToString:function(a){return decodeURIComponent(escape(b.bytesToString(a)))}}; var b=a.Binary={stringToBytes:function(a){for(var b=[],d=0;d>5]|=128<<24-f%32;b[(f+64>>9<<4)+15]=f;for(y=0;yA;A++){16>A?m[A]=b[A+y]:(z=m[A-15],k=m[A-2],m[A]=((z<<25|z>>>7)^(z<<14|z>>>18)^z>>>3)+(m[A-7]>>>0)+((k<<15|k>>>17)^(k<<13|k>>>19)^k>>>10)+(m[A-16]>>>0));k=f&l^f&t^l&t;var n=(f<<30|f>>>2)^(f<<19|f>>>13)^(f<<10|f>>>22);z=(x>>>0)+((g<<26|g>>>6)^(g<<21|g>>>11)^(g<<7|g>>>25))+ (g&v^~g&C)+d[A]+(m[A]>>>0);k=n+k;x=C;C=v;v=g;g=u+z>>>0;u=t;t=l;l=f;f=z+k>>>0}a[0]+=f;a[1]+=l;a[2]+=t;a[3]+=u;a[4]+=g;a[5]+=v;a[6]+=C;a[7]+=x}return a};m._blocksize=16;m._digestsize=32})(); (function(){var a=Crypto,e=a.util,b=a.charenc,c=b.UTF8,f=b.Binary;a.PBKDF2=function(b,m,h,q){b.constructor==String&&(b=c.stringToBytes(b));m.constructor==String&&(m=c.stringToBytes(m));for(var r=q&&q.hasher||a.SHA1,s=q&&q.iterations||1,l=[],t=1;l.length4*a._blocksize&&(h=a(h,{asBytes:!0}));var r=h.slice(0);h=h.slice(0);for(var s=0;s<4*a._blocksize;s++)r[s]^=92,h[s]^=54;a=a(r.concat(a(h.concat(b),{asBytes:!0})),{asBytes:!0});return q&&q.asBytes?a:q&&q.asString?f.bytesToString(a):e.bytesToHex(a)}})(); (function(){function a(a,b){for(var k=0,n=0;8>n;n++){b&1&&(k^=a);var w=a&128;a=a<<1&255;w&&(a^=27);b>>>=1}return k}for(var e=Crypto,b=e.util,c=e.charenc.UTF8,f=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207, 208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233, 206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],d=[],m=0;256>m;m++)d[f[m]]=m;for(var h=[],q=[],r=[],s=[],l=[],t=[],m=0;256>m;m++)h[m]=a(m,2),q[m]=a(m,3),r[m]=a(m,9),s[m]=a(m,11),l[m]=a(m,13),t[m]=a(m,14);var u=[0,1,2,4,8,16,32,64,128,27,54],g=[[],[],[],[]],v,C,x,y=e.AES={encrypt:function(a,d,k){k=k||{};var n=k.mode||new e.mode.OFB;n.fixOptions&&n.fixOptions(k);a=a.constructor==String?c.stringToBytes(a):a;var w=k.iv||b.randomBytes(4*y._blocksize);d=d.constructor==String?e.PBKDF2(d, w,32,{asBytes:!0}):d;y._init(d);n.encrypt(y,a,w);a=k.iv?a:w.concat(a);return k&&k.asBytes?a:b.bytesToBase64(a)},decrypt:function(a,d,k){k=k||{};var n=k.mode||new e.mode.OFB;n.fixOptions&&n.fixOptions(k);a=a.constructor==String?b.base64ToBytes(a):a;var w=k.iv||a.splice(0,4*y._blocksize);d=d.constructor==String?e.PBKDF2(d,w,32,{asBytes:!0}):d;y._init(d);n.decrypt(y,a,w);return k&&k.asBytes?a:c.bytesToString(a)},_blocksize:4,_encryptblock:function(a,b){for(var k=0;kn;n++)g[k][n]= a[b+4*n+k];for(k=0;4>k;k++)for(n=0;4>n;n++)g[k][n]^=x[n][k];for(var w=1;wk;k++)for(n=0;4>n;n++)g[k][n]=f[g[k][n]];g[1].push(g[1].shift());g[2].push(g[2].shift());g[2].push(g[2].shift());g[3].unshift(g[3].pop());for(n=0;4>n;n++){var k=g[0][n],d=g[1][n],c=g[2][n],e=g[3][n];g[0][n]=h[k]^q[d]^c^e;g[1][n]=k^h[d]^q[c]^e;g[2][n]=k^d^h[c]^q[e];g[3][n]=q[k]^d^c^h[e]}for(k=0;4>k;k++)for(n=0;4>n;n++)g[k][n]^=x[4*w+n][k]}for(k=0;4>k;k++)for(n=0;4>n;n++)g[k][n]=f[g[k][n]];g[1].push(g[1].shift()); g[2].push(g[2].shift());g[2].push(g[2].shift());g[3].unshift(g[3].pop());for(k=0;4>k;k++)for(n=0;4>n;n++)g[k][n]^=x[4*C+n][k];for(k=0;kn;n++)a[b+4*n+k]=g[k][n]},_decryptblock:function(a,b){for(var k=0;kn;n++)g[k][n]=a[b+4*n+k];for(k=0;4>k;k++)for(n=0;4>n;n++)g[k][n]^=x[4*C+n][k];for(var w=1;wk;k++)for(n=0;4>n;n++)g[k][n]=d[g[k][n]]; for(k=0;4>k;k++)for(n=0;4>n;n++)g[k][n]^=x[4*(C-w)+n][k];for(n=0;4>n;n++){var k=g[0][n],c=g[1][n],e=g[2][n],f=g[3][n];g[0][n]=t[k]^s[c]^l[e]^r[f];g[1][n]=r[k]^t[c]^s[e]^l[f];g[2][n]=l[k]^r[c]^t[e]^s[f];g[3][n]=s[k]^l[c]^r[e]^t[f]}}g[1].unshift(g[1].pop());g[2].push(g[2].shift());g[2].push(g[2].shift());g[3].push(g[3].shift());for(k=0;4>k;k++)for(n=0;4>n;n++)g[k][n]=d[g[k][n]];for(k=0;4>k;k++)for(n=0;4>n;n++)g[k][n]^=x[n][k];for(k=0;kn;n++)a[b+4*n+k]=g[k][n]},_init:function(a){v= a.length/4;C=v+6;y._keyexpansion(a)},_keyexpansion:function(a){x=[];for(var b=0;b4*a._blocksize)throw Error("Invalid padding length of "+e+" specified for "+c+". Wrong cipher specification or key used?");for(a=1;a=a?b^c^d:16<=a&&31>=a?b&c|~b&d:32<=a&&47>=a?(b|~c)^d:48<=a&&63>=a?b&d|c&~d:64<=a&&79>=a?b^(c|~d):"rmd160_f: j out of range"}function e(a,b){var c=(a&65535)+(b&65535);return(a>>16)+(b>>16)+(c>>16)<<16|c&65535}function b(a,b){return a<>>32-b}var c=Crypto,f=c.util,d=c.charenc,m=d.UTF8,h=d.Binary;f.bytesToLWords=function(a){for(var b=Array(a.length>>2),c=0;c>5]|=(a[c/8]&255)<>5]>>>c%32&255);return b};var q=c.RIPEMD160=function(a,b){var c=f.lWordsToBytes(q._rmd160(a));return b&&b.asBytes?c:b&&b.asString?h.bytesToString(c):f.bytesToHex(c)};q._rmd160=function(c){c.constructor==String&&(c=m.stringToBytes(c));var d=f.bytesToLWords(c);c=8*c.length;d[c>>5]|=128<>>9<<4)+14]=c;c=1732584193;for(var h=4023233417,q=2562383102,x=271733878,y=3285377520,A=0;A=p;++p)z=e(k,a(p,n,w,B)),z=e(z,d[A+r[p]]),z=e(z,0<=p&&15>=p?0:16<=p&&31>=p?1518500249:32<=p&&47>=p?1859775393:48<=p&&63>=p?2400959708:64<=p&&79>=p?2840853838:"rmd160_K1: j out of range"),z=e(b(z,l[p]),D),k=D,D=B,B=b(w,10),w=n,n=z,z=e(E,a(79-p,F,G,H)),z=e(z,d[A+s[p]]),z=e(z,0<=p&&15>=p?1352829926:16<=p&&31>=p?1548603684:32<=p&&47>=p?1836072691:48<=p&&63>=p?2053994217:64<=p&&79>=p?0:"rmd160_K2: j out of range"),z=e(b(z,t[p]),I),E=I,I=H,H=b(G,10),G=F,F=z;z=e(h,e(w,H));h=e(q,e(B, I));q=e(x,e(D,E));x=e(y,e(k,F));y=e(c,e(n,G));c=z}return[c,h,q,x,y]};var r=[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],s=[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],l=[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],t=[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]})(); (function(){var a=window.SecureRandom=function(){};a.state;a.pool;a.pptr;a.poolCopyOnInit;a.poolSize=256;a.prototype.nextBytes=function(b){var c;if(window.crypto&&window.crypto.getRandomValues&&window.Uint8Array)try{var d=new Uint8Array(b.length);window.crypto.getRandomValues(d);for(c=0;c>8);a.seedInt8(b>>16);a.seedInt8(b>>24)};a.seedInt16=function(b){a.seedInt8(b);a.seedInt8(b>>8)};a.seedInt8=function(b){a.pool[a.pptr++]^=b&255;a.pptr>=a.poolSize&&(a.pptr-=a.poolSize)};a.ArcFour=function(){function a(){this.j=this.i=0;this.S=[]}a.prototype.init=function(a){var b,c,d; for(b=0;256>b;++b)this.S[b]=b;for(b=c=0;256>b;++b)c=c+this.S[b]+a[b%a.length]&255,d=this.S[b],this.S[b]=this.S[c],this.S[c]=d;this.j=this.i=0};a.prototype.next=function(){var a;this.i=this.i+1&255;this.j=this.j+this.S[this.i]&255;a=this.S[this.i];this.S[this.i]=this.S[this.j];this.S[this.j]=a;return this.S[a+this.S[this.i]&255]};return new a};if(null==a.pool){a.pool=[];a.pptr=0;var e;if(window.crypto&&window.crypto.getRandomValues&&window.Uint8Array)try{var b=new Uint8Array(a.poolSize);window.crypto.getRandomValues(b); for(e=0;e>>8,a.pool[a.pptr++]=e&255;a.pptr=Math.floor(a.poolSize*Math.random());a.seedTime();e=""+window.screen.height*window.screen.width*window.screen.colorDepth;e+=window.screen.availHeight*window.screen.availWidth*window.screen.pixelDepth;b=(new Date).getTimezoneOffset();e=e+b+navigator.userAgent;for(var f="",b=0;b=m+1;--d)s=s.multiply(l).mod(a),f.testBit(d)?(l=s.multiply(c).mod(a),h=h.multiply(r).mod(a),q=r.multiply(q).subtract(b.multiply(s)).mod(a),r=r.multiply(r).subtract(l.shiftLeft(1)).mod(a)):(l=s,h=h.multiply(q).subtract(s).mod(a),r=r.multiply(q).subtract(b.multiply(s)).mod(a),q=q.multiply(q).subtract(s.shiftLeft(1)).mod(a));s=s.multiply(l).mod(a);l=s.multiply(c).mod(a);h=h.multiply(q).subtract(s).mod(a); q=r.multiply(q).subtract(b.multiply(s)).mod(a);s=s.multiply(l).mod(a);for(d=1;d<=m;++d)h=h.multiply(q).mod(a),q=q.multiply(q).subtract(s.shiftLeft(1)).mod(a),s=s.multiply(s).mod(a);return[h,q]};a.PointFp=function(a,b,c,f,d){this.curve=a;this.x=b;this.y=c;this.z=null==f?BigInteger.ONE:f;this.zinv=null;this.compressed=!!d};a.PointFp.prototype.getX=function(){null==this.zinv&&(this.zinv=this.z.modInverse(this.curve.q));var a=this.x.toBigInteger().multiply(this.zinv);this.curve.reduce(a);return this.curve.fromBigInteger(a)}; a.PointFp.prototype.getY=function(){null==this.zinv&&(this.zinv=this.z.modInverse(this.curve.q));var a=this.y.toBigInteger().multiply(this.zinv);this.curve.reduce(a);return this.curve.fromBigInteger(a)};a.PointFp.prototype.equals=function(a){return a==this?!0:this.isInfinity()?a.isInfinity():a.isInfinity()?this.isInfinity():a.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(a.z)).mod(this.curve.q).equals(BigInteger.ZERO)?a.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(a.z)).mod(this.curve.q).equals(BigInteger.ZERO): !1};a.PointFp.prototype.isInfinity=function(){return null==this.x&&null==this.y?!0:this.z.equals(BigInteger.ZERO)&&!this.y.toBigInteger().equals(BigInteger.ZERO)};a.PointFp.prototype.negate=function(){return new a.PointFp(this.curve,this.x,this.y.negate(),this.z)};a.PointFp.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var b=e.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(e.z)).mod(this.curve.q),c=e.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(e.z)).mod(this.curve.q); if(BigInteger.ZERO.equals(c))return BigInteger.ZERO.equals(b)?this.twice():this.curve.getInfinity();var f=new BigInteger("3"),d=this.x.toBigInteger(),m=this.y.toBigInteger();e.x.toBigInteger();e.y.toBigInteger();var h=c.square(),q=h.multiply(c),d=d.multiply(h),h=b.square().multiply(this.z),c=h.subtract(d.shiftLeft(1)).multiply(e.z).subtract(q).multiply(c).mod(this.curve.q),b=d.multiply(f).multiply(b).subtract(m.multiply(q)).subtract(h.multiply(b)).multiply(e.z).add(b.multiply(q)).mod(this.curve.q); e=q.multiply(this.z).multiply(e.z).mod(this.curve.q);return new a.PointFp(this.curve,this.curve.fromBigInteger(c),this.curve.fromBigInteger(b),e)};a.PointFp.prototype.twice=function(){if(this.isInfinity())return this;if(0==this.y.toBigInteger().signum())return this.curve.getInfinity();var e=new BigInteger("3"),b=this.x.toBigInteger(),c=this.y.toBigInteger(),f=c.multiply(this.z),d=f.multiply(c).mod(this.curve.q),c=this.curve.a.toBigInteger(),m=b.square().multiply(e);BigInteger.ZERO.equals(c)||(m=m.add(this.z.square().multiply(c))); m=m.mod(this.curve.q);c=m.square().subtract(b.shiftLeft(3).multiply(d)).shiftLeft(1).multiply(f).mod(this.curve.q);e=m.multiply(e).multiply(b).subtract(d.shiftLeft(1)).shiftLeft(2).multiply(d).subtract(m.square().multiply(m)).mod(this.curve.q);f=f.square().multiply(f).shiftLeft(3).mod(this.curve.q);return new a.PointFp(this.curve,this.curve.fromBigInteger(c),this.curve.fromBigInteger(e),f)};a.PointFp.prototype.multiply=function(a){if(this.isInfinity())return this;if(0==a.signum())return this.curve.getInfinity(); var b=a.multiply(new BigInteger("3")),c=this.negate(),f=this,d;for(d=b.bitLength()-2;0c.bitLength()?a.bitLength()-1:c.bitLength()-1;for(var d=this.curve.getInfinity(),m=this.add(b);0<=f;)d=d.twice(),a.testBit(f)?d=c.testBit(f)?d.add(m):d.add(this):c.testBit(f)&&(d=d.add(b)),--f;return d};a.PointFp.prototype.getEncoded=function(e){var b=this.getX().toBigInteger(), c=this.getY().toBigInteger(),b=a.integerToBytes(b,32);e?c.isEven()?b.unshift(2):b.unshift(3):(b.unshift(4),b=b.concat(a.integerToBytes(c,32)));return b};a.PointFp.decodeFrom=function(e,b){var c=b.length-1,f=b.slice(1,1+c/2),c=b.slice(1+c/2,1+c);f.unshift(0);c.unshift(0);f=new BigInteger(f);c=new BigInteger(c);return new a.PointFp(e,e.fromBigInteger(f),e.fromBigInteger(c))};a.PointFp.prototype.add2D=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;if(this.x.equals(e.x))return this.y.equals(e.y)? this.twice():this.curve.getInfinity();var b=e.x.subtract(this.x),b=e.y.subtract(this.y).divide(b);e=b.square().subtract(this.x).subtract(e.x);b=b.multiply(this.x.subtract(e)).subtract(this.y);return new a.PointFp(this.curve,e,b)};a.PointFp.prototype.twice2D=function(){if(this.isInfinity())return this;if(0==this.y.toBigInteger().signum())return this.curve.getInfinity();var e=this.curve.fromBigInteger(BigInteger.valueOf(2)),b=this.curve.fromBigInteger(BigInteger.valueOf(3)),b=this.x.square().multiply(b).add(this.curve.a).divide(this.y.multiply(e)), e=b.square().subtract(this.x.multiply(e)),b=b.multiply(this.x.subtract(e)).subtract(this.y);return new a.PointFp(this.curve,e,b)};a.PointFp.prototype.multiply2D=function(a){if(this.isInfinity())return this;if(0==a.signum())return this.curve.getInfinity();var b=a.multiply(new BigInteger("3")),c=this.negate(),f=this,d;for(d=b.bitLength()-2;0b.compareTo(BigInteger.ONE)||0c.compareTo(BigInteger.ONE)||0c.length;)c.unshift(0);return c};a.X9Parameters=function(a,b,c,f){this.curve=a;this.g=b;this.n=c;this.h=f};a.X9Parameters.prototype.getCurve=function(){return this.curve};a.X9Parameters.prototype.getG=function(){return this.g};a.X9Parameters.prototype.getN=function(){return this.n};a.X9Parameters.prototype.getH=function(){return this.h}; a.secNamedCurves={secp256k1:function(){var e=a.fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F"),b=BigInteger.ZERO,c=a.fromHex("7"),f=a.fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141"),d=BigInteger.ONE,e=new a.CurveFp(e,b,c),b=e.decodePointHex("0479BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8");return new a.X9Parameters(e,b,f,d)}};a.getSECCurveByName=function(e){return void 0== a.secNamedCurves[e]?null:a.secNamedCurves[e]()}})(); (function(a,e){function b(a){if(a&&("number"!==typeof a||0!==a%1||au.maxBits))throw Error("Number of bits must be an integer between "+u.minBits+" and "+u.maxBits+", inclusive.");g.radix=u.radix;g.bits=a||u.bits;g.size=Math.pow(2,g.bits);g.max=g.size-1;a=[];for(var b=[],c=1,d=u.primitivePolynomials[g.bits],f=0;f=g.size&&(c^=d,c&=g.max);g.logs=a;g.exps=b}function c(){return g.bits&&g.size&&g.max&&g.logs&&g.exps&&g.logs.length===g.size&&g.exps.length=== g.size?!0:!1}function f(){function a(b,c,k,n){for(var w="",d=0,f=c.length-1;du.maxBits))throw Error("Number of bits must be an integer between "+ u.minBits+" and "+u.maxBits+", inclusive.");var c=Math.pow(2,b)-1,d=c.toString(g.radix).length,f=parseInt(a.substr(1,d),g.radix);if("number"!==typeof f||0!==f%1||1>f||f>c)throw Error("Share id must be an integer between 1 and "+g.max+", inclusive.");a=a.substr(d+1);if(!a.length)throw Error("Invalid share: zero-length share.");return{bits:b,id:f,value:a}}function h(a,c){for(var d,f,e=[],h=[],k="",n,w=0,B=c.length;wg.bits;d-=g.bits)c.push(parseInt(a.slice(d-g.bits,d),2));c.push(parseInt(a.slice(0,d),2));return c}function s(a,b){b=b||g.bits;var c=a.length%b;return(c?Array(b-c+1).join("0"):"")+a}function l(a){for(var b="",c,d=a.length-1;0<=d;d--){c=parseInt(a[d],16);if(isNaN(c))throw Error("Invalid hex character.");b=s(c.toString(2),4)+b}return b}function t(a){var b="",c;a=s(a,4);for(var d=a.length;4<=d;d-=4){c=parseInt(a.slice(d-4,d),2);if(isNaN(c))throw Error("Invalid binary character."); b=c.toString(16)+b}return b}var u={bits:8,radix:16,minBits:3,maxBits:20,bytesPerChar:2,maxBytesPerChar:6,primitivePolynomials:[null,null,1,3,3,5,3,3,29,17,9,5,83,27,43,3,45,9,39,39,9,5,3,33,27,9,71,39,9,5,83],warning:"WARNING:\nA secure random number generator was not found.\nUsing Math.random(), which is NOT cryptographically strong!"},g={};a.getConfig=function(){return{bits:g.bits,unsafePRNG:g.unsafePRNG}};a.init=b;a.setRNG=function(a,b){c()||this.init();g.unsafePRNG=!1;a=a||f();if("function"!== typeof a||"string"!==typeof a(g.bits)||!parseInt(a(g.bits),2)||a(g.bits).length>g.bits||a(g.bits).lengtha)throw Error("Number of bits must be an integer greater than 1.");g.unsafePRNG&&d();return t(g.rng(a))}; a.share=function(a,b,f,e,m){c()||this.init();"function"!==typeof g.rng&&this.setRNG();e=e||0;if("string"!==typeof a)throw Error("Secret must be a string.");if("number"!==typeof b||0!==b%1||2>b)throw Error("Number of shares must be an integer between 2 and 2^bits-1 ("+g.max+"), inclusive.");if(b>g.max)throw m=Math.ceil(Math.log(b+1)/Math.LN2),Error("Number of shares must be an integer between 2 and 2^bits-1 ("+g.max+"), inclusive. To create "+b+" shares, use at least "+m+" bits.");if("number"!==typeof f|| 0!==f%1||2>f)throw Error("Threshold number of shares must be an integer between 2 and 2^bits-1 ("+g.max+"), inclusive.");if(f>g.max)throw m=Math.ceil(Math.log(f+1)/Math.LN2),Error("Threshold number of shares must be an integer between 2 and 2^bits-1 ("+g.max+"), inclusive. To use a threshold of "+f+", use at least "+m+" bits.");if("number"!==typeof e||0!==e%1)throw Error("Zero-pad length must be an integer greater than 1.");g.unsafePRNG&&d();a="1"+l(a);a=r(a,e);e=Array(b);for(var h=Array(b),k=0, n=a.length;ka||a>c)throw Error("Share id must be an integer between 1 and "+g.max+", inclusive.");c=c.toString(g.radix).length;return g.bits.toString(36).toUpperCase()+s(a.toString(g.radix),c)+h(a,b)};a._lagrange=q;a.str2hex=function(a,b){if("string"!==typeof a)throw Error("Input must be a character string."); b=b||u.bytesPerChar;if("number"!==typeof b||0!==b%1||1>b||b>u.maxBytesPerChar)throw Error("Bytes per character must be an integer between 1 and "+u.maxBytesPerChar+", inclusive.");for(var c=2*b,d=Math.pow(16,c)-1,f="",e,k=0,n=a.length;kd)throw c=Math.ceil(Math.log(e+1)/Math.log(256)),Error("Invalid character code ("+e+"). Maximum allowable is 256^bytes-1 ("+d+"). To convert this character, use at least "+c+" bytes."); f=s(e.toString(16),c)+f}return f};a.hex2str=function(a,b){if("string"!==typeof a)throw Error("Input must be a hexadecimal string.");b=b||u.bytesPerChar;if("number"!==typeof b||0!==b%1||1>b||b>u.maxBytesPerChar)throw Error("Bytes per character must be an integer between 1 and "+u.maxBytesPerChar+", inclusive.");var c=2*b,d="";a=s(a,c);for(var f=0,e=a.length;f>=15;0<=--e;){var g=this[a]&32767,l=this[a++]>>15,h=b*g+l*m,g=m*g+((h&32767)<<15)+c[d]+(f&1073741823);f=(g>>>30)+(h>>>15)+b*l+(f>>>30);c[d++]=g&1073741823}return f}function c(a,b,c,d,f,e){var m=b&16383;for(b>>=14;0<=--e;){var g=this[a]&16383,l=this[a++]>>14,h=b*g+l*m,g=m*g+((h&16383)<<14)+c[d]+f;f= (g>>28)+(h>>14)+b*l;c[d++]=g&268435455}return f}function f(a,b){var c=u[a.charCodeAt(b)];return null==c?-1:c}function d(b){var c=a();c.fromInt(b);return c}function m(a){var b=1,c;0!=(c=a>>>16)&&(a=c,b+=16);0!=(c=a>>8)&&(a=c,b+=8);0!=(c=a>>4)&&(a=c,b+=4);0!=(c=a>>2)&&(a=c,b+=2);0!=a>>1&&(b+=1);return b}function h(a,b){return a&b}function q(a,b){return a|b}function r(a,b){return a^b}function s(a,b){return a&~b}var l=window.BigInteger=function(a,b,c){null!=a&&("number"==typeof a?this.fromNumber(a,b, c):null==b&&"string"!=typeof a?this.fromString(a,256):this.fromString(a,b))},t;"Microsoft Internet Explorer"==navigator.appName?(l.prototype.am=b,t=30):"Netscape"!=navigator.appName?(l.prototype.am=e,t=26):(l.prototype.am=c,t=28);l.prototype.DB=t;l.prototype.DM=(1<=g;++g)u[t++]=g;t=97;for(g=10;36>g;++g)u[t++]=g;t=65;for(g=10;36>g;++g)u[t++]=g;l.prototype.copyTo=function(a){for(var b= this.t-1;0<=b;--b)a[b]=this[b];a.t=this.t;a.s=this.s};l.prototype.fromInt=function(a){this.t=1;this.s=0>a?-1:0;0a?this[0]=a+this.DV:this.t=0};l.prototype.fromString=function(a,b){var c;if(16==b)c=4;else if(8==b)c=3;else if(256==b)c=8;else if(2==b)c=1;else if(32==b)c=5;else if(4==b)c=2;else{this.fromRadix(a,b);return}this.s=this.t=0;for(var d=a.length,e=!1,m=0;0<=--d;){var g=8==c?a[d]&255:f(a,d);0>g?"-"==a.charAt(d)&&(e=!0):(e=!1,0==m?this[this.t++]=g:m+c>this.DB?(this[this.t-1]|=(g& (1<>this.DB-m):this[this.t-1]|=g<=this.DB&&(m-=this.DB))}8==c&&0!=(a[0]&128)&&(this.s=-1,0>d|m,m=(this[g]&f)<=this.t)b.t=0;else{var d=a%this.DB,f=this.DB-d,e=(1<>d;for(var m=c+1;m>d;0>=this.DB;if(a.t>=this.DB;d+=this.s}else{for(d+=this.s;c>=this.DB;d-=a.s}b.s=0>d?-1:0;-1>d?b[c++]=this.DV+d:0=b.DV&&(a[c+b.t]-=b.DV,a[c+b.t+1]=1)}0=f.t)){var e=this.abs();if(e.t>this.F2:0),s=this.FV/r,r=(1<h&&l.ZERO.subTo(d,d)}}}};l.prototype.invDigit=function(){if(1>this.t)return 0;var a=this[0];if(0==(a&1))return 0;var b=a&3,b=b*(2-(a&15)*b)&15,b=b*(2-(a&255)*b)&255,b=b*(2-((a&65535)*b&65535))&65535,b=b*(2-a*b%this.DV)%this.DV;return 0b)return l.ONE;var d=a(),f=a(),e=c.convert(this),g=m(b)-1;for(e.copyTo(d);0<=--g;)if(c.sqrTo(d,f),0<(b&1<this.s)return"-"+this.negate().toString(a);if(16==a)a=4;else if(8==a)a=3;else if(2==a)a=1;else if(32==a)a=5;else if(4==a)a=2;else return this.toRadix(a);var b=(1<>m)&&(d=!0,f="0123456789abcdefghijklmnopqrstuvwxyz".charAt(c));0<= e;)m>(m+=this.DB-a)):(c=this[e]>>(m-=a)&b,0>=m&&(m+=this.DB,--e)),0this.s?this.negate():this};l.prototype.compareTo=function(a){var b=this.s-a.s;if(0!=b)return b;var c=this.t,b=c-a.t;if(0!=b)return 0>this.s?-b:b;for(;0<=--c;)if(0!=(b=this[c]-a[c]))return b;return 0}; l.prototype.bitLength=function(){return 0>=this.t?0:this.DB*(this.t-1)+m(this[this.t-1]^this.s&this.DM)};l.prototype.mod=function(b){var c=a();this.abs().divRemTo(b,null,c);0>this.s&&0a||b.isEven()?new x(b):new y(b);return this.exp(a,c)};l.ZERO=d(0);l.ONE=d(1);var v=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191, 193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997], C=67108864/v[v.length-1];l.prototype.chunkSize=function(a){return Math.floor(Math.LN2*this.DB/Math.log(a))};l.prototype.toRadix=function(b){null==b&&(b=10);if(0==this.signum()||2>b||36q?"-"==a.charAt(h)&&0==this.signum()&&(e=!0):(g=b*g+q,++m>=c&&(this.dMultiply(d),this.dAddOffset(g,0),g=m=0))}0a)this.fromInt(1);else for(this.fromNumber(a,c),this.testBit(a-1)||this.bitwiseTo(l.ONE.shiftLeft(a-1),q,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(b);)this.dAddOffset(2, 0),this.bitLength()>a&&this.subTo(l.ONE.shiftLeft(a-1),this);else{c=[];var d=a&7;c.length=(a>>3)+1;b.nextBytes(c);c[0]=0>=this.DB;if(a.t>=this.DB;d+=this.s}else{for(d+=this.s;c>=this.DB;d+=a.s}b.s=0>d?-1:0;0d&&(b[c++]=this.DV+d);b.t=c;b.clamp()};l.prototype.dMultiply=function(a){this[this.t]=this.am(0,a-1,this,0,0,this.t);++this.t;this.clamp()};l.prototype.dAddOffset= function(a,b){if(0!=a){for(;this.t<=b;)this[this.t++]=0;for(this[b]+=a;this[b]>=this.DV;)this[b]-=this.DV,++b>=this.t&&(this[this.t++]=0),++this[b]}};l.prototype.multiplyLowerTo=function(a,b,c){var d=Math.min(this.t+a.t,b);c.s=0;for(c.t=d;0=a)return 0;var b=this.DV%a,c=0>this.s?a-1:0;if(0=d)return!1;var f=c.shiftRight(d);b=b+1>>1;b>v.length&&(b=v.length);for(var e=a(),m=0;mthis.s){if(1==this.t)return this[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this[0];if(0==this.t)return 0}return(this[1]&(1<<32-this.DB)-1)<>24};l.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16};l.prototype.signum=function(){return 0>this.s?-1:0>=this.t||1==this.t&&0>=this[0]?0:1};l.prototype.toByteArray=function(){var a=this.t,b=[];b[0]=this.s;var c=this.DB-a*this.DB%8,d,f=0;if(0>c)!=(this.s&this.DM)>>c&&(b[f++]=d|this.s<c?(d=(this[a]&(1<>(c+=this.DB-8)):(d=this[a]>>(c-=8)&255,0>=c&&(c+=this.DB,--a)),0!=(d& 128)&&(d|=-256),0==f&&(this.s&128)!=(d&128)&&++f,0this.compareTo(a)?this:a};l.prototype.max=function(a){return 0b?this.rShiftTo(-b,c):this.lShiftTo(b,c);return c};l.prototype.shiftRight=function(b){var c=a();0>b?this.lShiftTo(-b,c):this.rShiftTo(b,c);return c};l.prototype.getLowestSetBit=function(){for(var a=0;a>=16,c+=16); 0==(a&255)&&(a>>=8,c+=8);0==(a&15)&&(a>>=4,c+=4);0==(a&3)&&(a>>=2,c+=2);0==(a&1)&&++c;a=c}return b+a}return 0>this.s?this.t*this.DB:-1};l.prototype.bitCount=function(){for(var a=0,b=this.s&this.DM,c=0;c=this.t?0!=this.s:0!=(this[b]&1<=f)return g;e=18>f?1:48>f?3:144>f?4:768>f?5:6;h=8>f?new x(c):c.isEven()?new z(c):new y(c);var l=[],q=3,r=e-1,t=(1<=r?s=b[p]>>f-r&t:(s=(b[p]&(1<>this.DB+f-r));for(q=e;0==(s&1);)s>>=1,--q;0>(f-=q)&&(f+=this.DB,--p);if(u)l[s].copyTo(g), u=!1;else{for(;1--f&&(f=this.DB-1,--p)}return h.revert(g)};l.prototype.modInverse=function(a){var b=a.isEven();if(this.isEven()&&b||0==a.signum())return l.ZERO;for(var c=a.clone(),f=this.clone(),e=d(1),m=d(0),g=d(0),h=d(1);0!=c.signum();){for(;c.isEven();)c.rShiftTo(1,c),b?(e.isEven()&&m.isEven()||(e.addTo(this,e),m.subTo(a,m)),e.rShiftTo(1,e)):m.isEven()||m.subTo(a, m),m.rShiftTo(1,m);for(;f.isEven();)f.rShiftTo(1,f),b?(g.isEven()&&h.isEven()||(g.addTo(this,g),h.subTo(a,h)),g.rShiftTo(1,g)):h.isEven()||h.subTo(a,h),h.rShiftTo(1,h);0<=c.compareTo(f)?(c.subTo(f,c),b&&e.subTo(g,e),m.subTo(h,m)):(f.subTo(c,f),b&&g.subTo(e,g),h.subTo(m,h))}if(0!=f.compareTo(l.ONE))return l.ZERO;if(0<=h.compareTo(a))return h.subtract(a);if(0>h.signum())h.addTo(a,h);else return h;return 0>h.signum()?h.add(a):h};l.prototype.pow=function(a){return this.exp(a,new A)};l.prototype.gcd=function(a){var b= 0>this.s?this.negate():this.clone();a=0>a.s?a.negate():a.clone();if(0>b.compareTo(a)){var c=b,b=a;a=c}var c=b.getLowestSetBit(),d=a.getLowestSetBit();if(0>d)return b;ca?a+256:a})):a};l.fromByteArrayUnsigned= function(a){return a.length?a[0]&128?new l([0].concat(a)):new l(a):a.valueOf(0)};l.prototype.toByteArraySigned=function(){var a=this.abs().toByteArrayUnsigned();0>this.compareTo(l.ZERO)?a[0]&128?a.unshift(128):a[0]|=128:a[0]&128&&a.unshift(0);return a};l.fromByteArraySigned=function(a){return a[0]&128?(a[0]&=127,l.fromByteArrayUnsigned(a).negate()):l.fromByteArrayUnsigned(a)};var x=window.Classic=function(a){this.m=a};x.prototype.convert=function(a){return 0>a.s||0<=a.compareTo(this.m)?a.mod(this.m): a};x.prototype.revert=function(a){return a};x.prototype.reduce=function(a){a.divRemTo(this.m,null,a)};x.prototype.mulTo=function(a,b,c){a.multiplyTo(b,c);this.reduce(c)};x.prototype.sqrTo=function(a,b){a.squareTo(b);this.reduce(b)};var y=window.Montgomery=function(a){this.m=a;this.mp=a.invDigit();this.mpl=this.mp&32767;this.mph=this.mp>>15;this.um=(1<b.s&&0>15)*this.mpl&this.um)<<15)&a.DM,c=b+this.m.t;for(a[c]+=this.m.am(0,d,a,b,0,this.m.t);a[c]>=a.DV;)a[c]-=a.DV,a[++c]++}a.clamp();a.drShiftTo(this.m.t,a);0<=a.compareTo(this.m)&&a.subTo(this.m,a)};y.prototype.mulTo=function(a,b,c){a.multiplyTo(b,c);this.reduce(c)}; y.prototype.sqrTo=function(a,b){a.squareTo(b);this.reduce(b)};var A=window.NullExp=function(){};A.prototype.convert=function(a){return a};A.prototype.revert=function(a){return a};A.prototype.mulTo=function(a,b,c){a.multiplyTo(b,c)};A.prototype.sqrTo=function(a,b){a.squareTo(b)};var z=window.Barrett=function(b){this.r2=a();this.q3=a();l.ONE.dlShiftTo(2*b.t,this.r2);this.mu=this.r2.divide(b);this.m=b};z.prototype.convert=function(b){if(0>b.s||b.t>2*this.m.t)return b.mod(this.m);if(0>b.compareTo(this.m))return b; var c=a();b.copyTo(c);this.reduce(c);return c};z.prototype.revert=function(a){return a};z.prototype.reduce=function(a){a.drShiftTo(this.m.t-1,this.r2);a.t>this.m.t+1&&(a.t=this.m.t+1,a.clamp());this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3);for(this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);0>a.compareTo(this.r2);)a.dAddOffset(1,this.m.t+1);for(a.subTo(this.r2,a);0<=a.compareTo(this.m);)a.subTo(this.m,a)};z.prototype.mulTo=function(a,b,c){a.multiplyTo(b,c);this.reduce(c)};z.prototype.sqrTo= function(a,b){a.squareTo(b);this.reduce(b)}})(); (function(){var a=window.QRCode=function(a,c){this.typeNumber=a;this.errorCorrectLevel=c;this.modules=null;this.moduleCount=0;this.dataCache=null;this.dataList=[]};a.prototype={addData:function(b){b=new a.QR8bitByte(b);this.dataList.push(b);this.dataCache=null},isDark:function(a,c){if(0>a||this.moduleCount<=a||0>c||this.moduleCount<=c)throw Error(a+","+c);return this.modules[a][c]},getModuleCount:function(){return this.moduleCount},make:function(){this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(b, c){this.moduleCount=4*this.typeNumber+17;this.modules=Array(this.moduleCount);for(var f=0;f=f;f++)if(!(-1>=a+f||this.moduleCount<=a+f))for(var d=-1;7>=d;d++)-1>=c+d||this.moduleCount<=c+d||(this.modules[a+f][c+d]=0<=f&&6>=f&&(0==d||6==d)||0<=d&&6>=d&&(0==f||6==f)||2<=f&&4>=f&&2<=d&&4>=d?!0:!1)},getBestMaskPattern:function(){for(var b=0,c=0,f=0;8>f;f++){this.makeImpl(!0,f);var d=a.Util.getLostPoint(this);if(0==f||b>d)b= d,c=f}return c},createMovieClip:function(a,c,f){a=a.createEmptyMovieClip(c,f);this.make();for(c=0;c=h;h++)for(var q=-2;2>=q;q++)this.modules[d+h][e+q]=-2==h||2==h||-2==q||2==q||0==h&&0==q?!0:!1}},setupTypeNumber:function(b){for(var c=a.Util.getBCHTypeNumber(this.typeNumber),f=0;18>f;f++){var d=!b&&1==(c>>f&1);this.modules[Math.floor(f/3)][f%3+this.moduleCount-8-3]=d}for(f=0;18>f;f++)d=!b&& 1==(c>>f&1),this.modules[f%3+this.moduleCount-8-3][Math.floor(f/3)]=d},setupTypeInfo:function(b,c){for(var f=a.Util.getBCHTypeInfo(this.errorCorrectLevel<<3|c),d=0;15>d;d++){var e=!b&&1==(f>>d&1);6>d?this.modules[d][8]=e:8>d?this.modules[d+1][8]=e:this.modules[this.moduleCount-15+d][8]=e}for(d=0;15>d;d++)e=!b&&1==(f>>d&1),8>d?this.modules[8][this.moduleCount-d-1]=e:9>d?this.modules[8][15-d-1+1]=e:this.modules[8][15-d-1]=e;this.modules[this.moduleCount-8][8]=!b},mapData:function(b,c){for(var f=-1, d=this.moduleCount-1,e=7,h=0,q=this.moduleCount-1;0r;r++)if(null==this.modules[d][q-r]){var s=!1;h>>e&1));a.Util.getMask(c,d,q-r)&&(s=!s);this.modules[d][q-r]=s;e--; -1==e&&(h++,e=7)}d+=f;if(0>d||this.moduleCount<=d){d-=f;f=-f;break}}}};a.PAD0=236;a.PAD1=17;a.createData=function(b,c,f){c=a.RSBlock.getRSBlocks(b,c);for(var d=new a.BitBuffer,e=0;e8*b)throw Error("code length overflow. ("+d.getLengthInBits()+">"+8*b+")");for(d.getLengthInBits()+4<=8*b&&d.put(0,4);0!=d.getLengthInBits()%8;)d.putBit(!1);for(;!(d.getLengthInBits()>=8*b);){d.put(a.PAD0,8);if(d.getLengthInBits()>=8*b)break;d.put(a.PAD1,8)}return a.createBytes(d,c)};a.createBytes=function(b,c){for(var f=0,d=0,e=0,h=Array(c.length),q=Array(c.length),r=0;r>>=1;return c},getPatternPosition:function(b){return a.Util.PATTERN_POSITION_TABLE[b-1]},getMask:function(b,c,f){switch(b){case a.MaskPattern.PATTERN000:return 0==(c+f)%2;case a.MaskPattern.PATTERN001:return 0==c%2;case a.MaskPattern.PATTERN010:return 0==f%3;case a.MaskPattern.PATTERN011:return 0==(c+f)%3;case a.MaskPattern.PATTERN100:return 0==(Math.floor(c/2)+Math.floor(f/3))%2;case a.MaskPattern.PATTERN101:return 0==c*f%2+c*f%3;case a.MaskPattern.PATTERN110:return 0== (c*f%2+c*f%3)%2;case a.MaskPattern.PATTERN111:return 0==(c*f%3+(c+f)%2)%2;default:throw Error("bad maskPattern:"+b);}},getErrorCorrectPolynomial:function(b){for(var c=new a.Polynomial([1],0),f=0;fc)switch(b){case a.Mode.MODE_NUMBER:return 10;case a.Mode.MODE_ALPHA_NUM:return 9;case a.Mode.MODE_8BIT_BYTE:return 8;case a.Mode.MODE_KANJI:return 8;default:throw Error("mode:"+b);}else if(27> c)switch(b){case a.Mode.MODE_NUMBER:return 12;case a.Mode.MODE_ALPHA_NUM:return 11;case a.Mode.MODE_8BIT_BYTE:return 16;case a.Mode.MODE_KANJI:return 10;default:throw Error("mode:"+b);}else if(41>c)switch(b){case a.Mode.MODE_NUMBER:return 14;case a.Mode.MODE_ALPHA_NUM:return 13;case a.Mode.MODE_8BIT_BYTE:return 16;case a.Mode.MODE_KANJI:return 12;default:throw Error("mode:"+b);}else throw Error("type:"+c);},getLostPoint:function(a){for(var c=a.getModuleCount(),f=0,d=0;d=r;r++)if(!(0>d+r||c<=d+r))for(var s=-1;1>=s;s++)0>e+s||c<=e+s||0==r&&0==s||q!=a.isDark(d+r,e+s)||h++;5b)throw Error("glog("+b+")");return a.Math.LOG_TABLE[b]},gexp:function(b){for(;0>b;)b+=255;for(;256<=b;)b-=255;return a.Math.EXP_TABLE[b]},EXP_TABLE:Array(256),LOG_TABLE:Array(256)};for(var e=0;8>e;e++)a.Math.EXP_TABLE[e]=1<e;e++)a.Math.EXP_TABLE[e]=a.Math.EXP_TABLE[e- 4]^a.Math.EXP_TABLE[e-5]^a.Math.EXP_TABLE[e-6]^a.Math.EXP_TABLE[e-8];for(e=0;255>e;e++)a.Math.LOG_TABLE[a.Math.EXP_TABLE[e]]=e;a.Polynomial=function(a,c){if(void 0==a.length)throw Error(a.length+"/"+c);for(var f=0;fthis.getLength()-b.getLength())return this;for(var c=a.Math.glog(this.get(0))-a.Math.glog(b.get(0)),f=Array(this.getLength()),d=0;d>>7-a%8&1)},put:function(a,c){for(var f=0;f>>c-f-1&1))},getLengthInBits:function(){return this.length},putBit:function(a){var c=Math.floor(this.length/8);this.buffer.length<=c&&this.buffer.push(0);a&&(this.buffer[c]|=128>>>this.length%8);this.length++}}})(); (function(a){})("object"===typeof module?module.exports:window.Bitcoin={}); (function(a){a.Base58={alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",validRegex:/^[1-9A-HJ-NP-Za-km-z]+$/,base:BigInteger.valueOf(58),encode:function(a){for(var c=BigInteger.fromByteArrayUnsigned(a),f=[];0<=c.compareTo(e.base);){var d=c.mod(e.base);f.unshift(e.alphabet[d.intValue()]);c=c.subtract(d).divide(e.base)}f.unshift(e.alphabet[c.intValue()]);for(c=0;cm)throw"Invalid character";c=c.add(BigInteger.valueOf(m).multiply(e.base.pow(a.length-1-d)));"1"==a[d]?f++:f=0}for(a=c.toByteArrayUnsigned();0=r.compareTo(BigInteger.ZERO));e=q.modInverse(e).multiply(h.add(d.multiply(r))).mod(e);return c.serializeSig(r,e)},verify:function(b, d,e){var h;if(Bitcoin.Util.isArray(d))d=c.parseSig(d),h=d.r,d=d.s;else if("object"===typeof d&&d.r&&d.s)h=d.r,d=d.s;else throw"Invalid value for signature";if(!(e instanceof ec.PointFp))if(Bitcoin.Util.isArray(e))e=EllipticCurve.PointFp.decodeFrom(a.getCurve(),e);else throw"Invalid format for pubkey value, must be byte array or ec.PointFp";b=BigInteger.fromByteArrayUnsigned(b);return c.verifyRaw(b,h,d,e)},verifyRaw:function(b,c,e,h){var q=a.getN(),r=a.getG();if(0>c.compareTo(BigInteger.ONE)||0<=c.compareTo(q)|| 0>e.compareTo(BigInteger.ONE)||0<=e.compareTo(q))return!1;e=e.modInverse(q);b=b.multiply(e).mod(q);e=c.multiply(e).mod(q);return r.multiply(b).add(h.multiply(e)).getX().toBigInteger().mod(q).equals(c)},serializeSig:function(a,b){var c=a.toByteArraySigned(),e=b.toByteArraySigned(),q=[];q.push(2);q.push(c.length);q=q.concat(c);q.push(2);q.push(e.length);q=q.concat(e);q.unshift(q.length);q.unshift(48);return q},parseSig:function(a){var b;if(48!=a[0])throw Error("Signature not a valid DERSequence");b= 2;if(2!=a[b])throw Error("First element in signature must be a DERInteger");var c=a.slice(b+2,b+2+a[b+1]);b+=2+a[b+1];if(2!=a[b])throw Error("Second element in signature must be a DERInteger");a=a.slice(b+2,b+2+a[b+1]);c=BigInteger.fromByteArrayUnsigned(c);a=BigInteger.fromByteArrayUnsigned(a);return{r:c,s:a}},parseSigCompact:function(b){if(65!==b.length)throw"Signature has the wrong length";var c=b[0]-27;if(0>c||7>1,s=a.getN();h=a.getG();var l=a.getCurve(),t=l.getQ(),u=l.getA().toBigInteger(),g=l.getB().toBigInteger();b||(b=t.add(BigInteger.ONE).divide(BigInteger.valueOf(4)));r=r?e.add(s):e;u=r.multiply(r).multiply(r).add(u.multiply(r)).add(g).mod(t).modPow(b,t);u.isEven();q=(u.isEven()?!q:q)?u:t.subtract(u);q=new EllipticCurve.PointFp(l,l.fromBigInteger(r),l.fromBigInteger(q)); q.validate();m=BigInteger.fromByteArrayUnsigned(m);l=BigInteger.ZERO.subtract(m).mod(s);s=e.modInverse(s);u=Math.max(d.bitLength(),l.bitLength());t=q.add2D(h);r=q.curve.getInfinity();for(u-=1;0<=u;--u)r=r.twice2D(),r.z=BigInteger.ONE,d.testBit(u)?r=l.testBit(u)?r.add2D(t):r.add2D(q):l.testBit(u)&&(r=r.add2D(h));h=r.multiply(s);h.validate();if(!c.verifyRaw(m,e,d,h))throw"Pubkey recovery unsuccessful";e=new Bitcoin.ECKey;e.pub=h;return e},calcPubkeyRecoveryParam:function(a,b,c,e){for(var q=0;4>q;q++)try{if(Bitcoin.ECDSA.recoverPubKey(b, c,e,q).getBitcoinAddress().toString()==a)return q}catch(r){}throw"Unable to find valid recovery factor";}};return c}(); Bitcoin.ECKey=function(){var a=Bitcoin.ECDSA,e=EllipticCurve.getSECCurveByName("secp256k1");new SecureRandom;var b=function(c){if(!c)c=e.getN(),this.priv=a.getBigRandom(c);else if(c instanceof BigInteger)this.priv=c;else if(Bitcoin.Util.isArray(c))this.priv=BigInteger.fromByteArrayUnsigned(c);else if("string"==typeof c){var f=null;b.isWalletImportFormat(c)?f=b.decodeWalletImportFormat(c):b.isCompressedWalletImportFormat(c)?(f=b.decodeCompressedWalletImportFormat(c),this.compressed=!0):b.isMiniFormat(c)? f=Crypto.SHA256(c,{asBytes:!0}):b.isHexFormat(c)?f=Crypto.util.hexToBytes(c):b.isBase64Format(c)&&(f=Crypto.util.base64ToBytes(c));b.isBase6Format(c)?this.priv=new BigInteger(c,6):this.priv=null==f||32!=f.length?null:BigInteger.fromByteArrayUnsigned(f)}this.compressed=void 0==this.compressed?!!b.compressByDefault:this.compressed};b.privateKeyPrefix=128;b.compressByDefault=!1;b.prototype.setCompressed=function(a){this.compressed=!!a;this.pubPoint&&(this.pubPoint.compressed=this.compressed);return this}; b.prototype.getPub=function(){return this.compressed?this.pubComp?this.pubComp:this.pubComp=this.getPubPoint().getEncoded(1):this.pubUncomp?this.pubUncomp:this.pubUncomp=this.getPubPoint().getEncoded(0)};b.prototype.getPubPoint=function(){this.pubPoint||(this.pubPoint=e.getG().multiply(this.priv),this.pubPoint.compressed=this.compressed);return this.pubPoint};b.prototype.getPubKeyHex=function(){return this.compressed?this.pubKeyHexComp?this.pubKeyHexComp:this.pubKeyHexComp=Crypto.util.bytesToHex(this.getPub()).toString().toUpperCase(): this.pubKeyHexUncomp?this.pubKeyHexUncomp:this.pubKeyHexUncomp=Crypto.util.bytesToHex(this.getPub()).toString().toUpperCase()};b.prototype.getPubKeyHash=function(){return this.compressed?this.pubKeyHashComp?this.pubKeyHashComp:this.pubKeyHashComp=Bitcoin.Util.sha256ripe160(this.getPub()):this.pubKeyHashUncomp?this.pubKeyHashUncomp:this.pubKeyHashUncomp=Bitcoin.Util.sha256ripe160(this.getPub())};b.prototype.getBitcoinAddress=function(){var a=this.getPubKeyHash();return(new Bitcoin.Address(a)).toString()}; b.prototype.setPub=function(a){Bitcoin.Util.isArray(a)&&(a=Crypto.util.bytesToHex(a).toString().toUpperCase());a=e.getCurve().decodePointHex(a);this.setCompressed(a.compressed);this.pubPoint=a;return this};b.prototype.getBitcoinWalletImportFormat=function(){var a=this.getBitcoinPrivateKeyByteArray();a.unshift(b.privateKeyPrefix);this.compressed&&a.push(1);var e=Crypto.SHA256(Crypto.SHA256(a,{asBytes:!0}),{asBytes:!0}),a=a.concat(e.slice(0,4));return Bitcoin.Base58.encode(a)};b.prototype.getBitcoinHexFormat= function(){return Crypto.util.bytesToHex(this.getBitcoinPrivateKeyByteArray()).toString().toUpperCase()};b.prototype.getBitcoinBase64Format=function(){return Crypto.util.bytesToBase64(this.getBitcoinPrivateKeyByteArray())};b.prototype.getBitcoinPrivateKeyByteArray=function(){for(var a=this.priv.toByteArrayUnsigned();32>a.length;)a.unshift(0);return a};b.prototype.toString=function(a){a=a||"";return"base64"==a.toString().toLowerCase()||"b64"==a.toString().toLowerCase()?this.getBitcoinBase64Format(): "wif"==a.toString().toLowerCase()?this.getBitcoinWalletImportFormat():this.getBitcoinHexFormat()};b.prototype.sign=function(b){return a.sign(b,this.priv)};b.prototype.verify=function(b,e){return a.verify(b,e,this.getPub())};b.decodeWalletImportFormat=function(a){var e=Bitcoin.Base58.decode(a);a=e.slice(0,33);var d=Crypto.SHA256(Crypto.SHA256(a,{asBytes:!0}),{asBytes:!0});if(d[0]!=e[33]||d[1]!=e[34]||d[2]!=e[35]||d[3]!=e[36])throw"Checksum validation failed!";e=a.shift();if(e!=b.privateKeyPrefix)throw"Version "+ e+" not supported!";return a};b.decodeCompressedWalletImportFormat=function(a){var e=Bitcoin.Base58.decode(a);a=e.slice(0,34);var d=Crypto.SHA256(Crypto.SHA256(a,{asBytes:!0}),{asBytes:!0});if(d[0]!=e[34]||d[1]!=e[35]||d[2]!=e[36]||d[3]!=e[37])throw"Checksum validation failed!";e=a.shift();if(e!=b.privateKeyPrefix)throw"Version "+e+" not supported!";a.pop();return a};b.isHexFormat=function(a){a=a.toString();return/^[A-Fa-f0-9]{64}$/.test(a)};b.isWalletImportFormat=function(a){a=a.toString();return 128== b.privateKeyPrefix?/^5[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{50}$/.test(a):/^9[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{50}$/.test(a)};b.isCompressedWalletImportFormat=function(a){a=a.toString();return 128==b.privateKeyPrefix?/^[LK][123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{51}$/.test(a):/^c[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{51}$/.test(a)};b.isBase64Format=function(a){a=a.toString();return/^[ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789=+\/]{44}$/.test(a)}; b.isBase6Format=function(a){a=a.toString();return/^[012345]{99}$/.test(a)};b.isMiniFormat=function(a){a=a.toString();var b=/^S[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21}$/.test(a),d=/^S[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{25}$/.test(a),e=/^S[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{29}$/.test(a);a=Crypto.SHA256(a+"?",{asBytes:!0});return(0===a[0]||1===a[0])&&(b||d||e)};return b}(); Bitcoin.Util={isArray:Array.isArray||function(a){return"[object Array]"===Object.prototype.toString.call(a)},makeFilledArray:function(a,e){for(var b=[],c=0;ca?[a]:65536>=a?[253,a>>>8,a&255]:a<=1<<32?[254].concat(Crypto.util.wordsToBytes([a])):[255].concat(Crypto.util.wordsToBytes([a>>>32,a]))},valueToBigInt:function(a){return a instanceof BigInteger?a:BigInteger.fromByteArrayUnsigned(a)},formatValue:function(a){var e=this.valueToBigInt(a).toString(); a=8e.length;)e="0"+e;for(e=e.replace(/0*$/,"");2>e.length;)e+="0";return a+"."+e},parseValue:function(a){var e=a.split(".");a=e[0];for(e=e[1]||"0";8>e.length;)e+="0";e=e.replace(/^0+/g,"");a=BigInteger.valueOf(parseInt(a));a=a.multiply(BigInteger.valueOf(1E8));return a=a.add(BigInteger.valueOf(parseInt(e)))},sha256ripe160:function(a){return Crypto.RIPEMD160(Crypto.SHA256(a,{asBytes:!0}),{asBytes:!0})},dsha256:function(a){return Crypto.SHA256(Crypto.SHA256(a, {asBytes:!0}),{asBytes:!0})}}; (function(){var a=null;window.Crypto_scrypt=function(e,b,c,f,d,m,h){function q(){function a(c,d,e,f,l,k){var m=128*e,q;h(c,d,k,0,m);for(q=0;qn;n++)q[n]= (m[4*n+0]&255)<<0,q[n]|=(m[4*n+1]&255)<<8,q[n]|=(m[4*n+2]&255)<<16,q[n]|=(m[4*n+3]&255)<<24;for(var n=q,r=0,s=p,t=0,u=16;u--;)s[t++]=n[r++];for(n=8;0n;++n)q[n]=p[n]+q[n];for(n=0;16>n;n++)p=4*n,m[p+0]=q[n]>>0&255,m[p+1]=q[n]>>8&255,m[p+2]=q[n]>>16&255,m[p+3]=q[n]>> 24&255;h(l,0,a,d+64*k,64)}for(k=0;k>>32-b}function g(a,b,c,d,e){for(e>>=6;e--;)c[d++]^=a[b++],c[d++]^=a[b++],c[d++]^=a[b++],c[d++]^=a[b++],c[d++]^=a[b++],c[d++]^=a[b++],c[d++]^=a[b++],c[d++]^=a[b++],c[d++]^=a[b++],c[d++]^=a[b++],c[d++]^=a[b++],c[d++]^=a[b++],c[d++]^=a[b++],c[d++]^=a[b++],c[d++]^=a[b++],c[d++]^=a[b++],c[d++]^=a[b++],c[d++]^=a[b++],c[d++]^=a[b++],c[d++]^=a[b++],c[d++]^=a[b++], c[d++]^=a[b++],c[d++]^=a[b++],c[d++]^=a[b++],c[d++]^=a[b++],c[d++]^=a[b++],c[d++]^=a[b++],c[d++]^=a[b++],c[d++]^=a[b++],c[d++]^=a[b++],c[d++]^=a[b++],c[d++]^=a[b++],c[d++]^=a[b++],c[d++]^=a[b++],c[d++]^=a[b++],c[d++]^=a[b++],c[d++]^=a[b++],c[d++]^=a[b++],c[d++]^=a[b++],c[d++]^=a[b++],c[d++]^=a[b++],c[d++]^=a[b++],c[d++]^=a[b++],c[d++]^=a[b++],c[d++]^=a[b++],c[d++]^=a[b++],c[d++]^=a[b++],c[d++]^=a[b++],c[d++]^=a[b++],c[d++]^=a[b++],c[d++]^=a[b++],c[d++]^=a[b++],c[d++]^=a[b++],c[d++]^=a[b++],c[d++]^= a[b++],c[d++]^=a[b++],c[d++]^=a[b++],c[d++]^=a[b++],c[d++]^=a[b++],c[d++]^=a[b++],c[d++]^=a[b++],c[d++]^=a[b++],c[d++]^=a[b++],c[d++]^=a[b++]}function h(a,b,c,d,e){for(e>>=5;e--;)c[d++]=a[b++],c[d++]=a[b++],c[d++]=a[b++],c[d++]=a[b++],c[d++]=a[b++],c[d++]=a[b++],c[d++]=a[b++],c[d++]=a[b++],c[d++]=a[b++],c[d++]=a[b++],c[d++]=a[b++],c[d++]=a[b++],c[d++]=a[b++],c[d++]=a[b++],c[d++]=a[b++],c[d++]=a[b++],c[d++]=a[b++],c[d++]=a[b++],c[d++]=a[b++],c[d++]=a[b++],c[d++]=a[b++],c[d++]=a[b++],c[d++]=a[b++], c[d++]=a[b++],c[d++]=a[b++],c[d++]=a[b++],c[d++]=a[b++],c[d++]=a[b++],c[d++]=a[b++],c[d++]=a[b++],c[d++]=a[b++],c[d++]=a[b++]}var l=[],k=[];if("undefined"===typeof s)onmessage=function(b){b=b.data;var c=b[0],d=b[1],e=b[4],f=[];h(b[3],128*e*d,f,0,128*d);a(f,0,d,c,k,l);postMessage([e,f])};else for(var m=0;m 0 and a power of 2");if(c>1.67772159921875E7/f)throw Error("Parameter N is too large");if(f>1.67772159921875E7/d)throw Error("Parameter r is too large"); var r={iterations:1,hasher:Crypto.SHA256,asBytes:!0},s=Crypto.PBKDF2(e,b,128*d*f,r);try{var l=0,t=0;b=function(){if(!a){var b="("+q.toString()+")()",g;try{g=new Blob([b],{type:"text/javascript"})}catch(u){window.BlobBuilder=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,g=new BlobBuilder,g.append(b),g=g.getBlob("text/javascript")}a=URL.createObjectURL(g)}var y=new Worker(a);y.onmessage=function(a){var b=a.data[0];a=a.data[1];t++;l