forked from btchip/bitgo-chrome
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbitcoinjs-lib.min.js
More file actions
7 lines (6 loc) · 101 KB
/
bitcoinjs-lib.min.js
File metadata and controls
7 lines (6 loc) · 101 KB
1
2
3
4
5
6
7
/*! bitcoinjs-lib 2015-11-19 */
function smix(a,b,c,d,e,f){var g,h=0,i=128*c;for(arraycopy32(a,b,f,h,i),g=0;d>g;g++)arraycopy32(f,h,e,g*i,i),blockmix_salsa8(f,h,i,c);for(g=0;d>g;g++){var j=integerify(f,h,c)&d-1;blockxor(e,j*i,f,h,i),blockmix_salsa8(f,h,i,c)}arraycopy32(f,h,a,b,i)}function blockmix_salsa8(a,b,c,d){var e,f=[];for(arraycopy32(a,b+64*(2*d-1),f,0,64),e=0;2*d>e;e++)blockxor(a,64*e,f,0,64),salsa20_8(f),arraycopy32(f,0,a,c+64*e,64);for(e=0;d>e;e++)arraycopy32(a,c+2*e*64,a,b+64*e,64);for(e=0;d>e;e++)arraycopy32(a,c+64*(2*e+1),a,b+64*(e+d),64)}function R(a,b){return a<<b|a>>>32-b}function salsa20_8(a){var b,c=new Array(32),d=new Array(32);for(b=0;16>b;b++)c[b]=(255&a[4*b+0])<<0,c[b]|=(255&a[4*b+1])<<8,c[b]|=(255&a[4*b+2])<<16,c[b]|=(255&a[4*b+3])<<24;for(arraycopy(c,0,d,0,16),b=8;b>0;b-=2)d[4]^=R(d[0]+d[12],7),d[8]^=R(d[4]+d[0],9),d[12]^=R(d[8]+d[4],13),d[0]^=R(d[12]+d[8],18),d[9]^=R(d[5]+d[1],7),d[13]^=R(d[9]+d[5],9),d[1]^=R(d[13]+d[9],13),d[5]^=R(d[1]+d[13],18),d[14]^=R(d[10]+d[6],7),d[2]^=R(d[14]+d[10],9),d[6]^=R(d[2]+d[14],13),d[10]^=R(d[6]+d[2],18),d[3]^=R(d[15]+d[11],7),d[7]^=R(d[3]+d[15],9),d[11]^=R(d[7]+d[3],13),d[15]^=R(d[11]+d[7],18),d[1]^=R(d[0]+d[3],7),d[2]^=R(d[1]+d[0],9),d[3]^=R(d[2]+d[1],13),d[0]^=R(d[3]+d[2],18),d[6]^=R(d[5]+d[4],7),d[7]^=R(d[6]+d[5],9),d[4]^=R(d[7]+d[6],13),d[5]^=R(d[4]+d[7],18),d[11]^=R(d[10]+d[9],7),d[8]^=R(d[11]+d[10],9),d[9]^=R(d[8]+d[11],13),d[10]^=R(d[9]+d[8],18),d[12]^=R(d[15]+d[14],7),d[13]^=R(d[12]+d[15],9),d[14]^=R(d[13]+d[12],13),d[15]^=R(d[14]+d[13],18);for(b=0;16>b;++b)c[b]=d[b]+c[b];for(b=0;16>b;b++){var e=4*b;a[e+0]=c[b]>>0&255,a[e+1]=c[b]>>8&255,a[e+2]=c[b]>>16&255,a[e+3]=c[b]>>24&255}}function blockxor(a,b,c,d,e){for(var f=e>>6;f--;)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 integerify(a,b,c){var d;return b+=64*(2*c-1),d=(255&a[b+0])<<0,d|=(255&a[b+1])<<8,d|=(255&a[b+2])<<16,d|=(255&a[b+3])<<24}function arraycopy(a,b,c,d,e){for(;e--;)c[d++]=a[b++]}function arraycopy16(a,b,c,d,e){for(var f=e>>4;f--;)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 arraycopy32(a,b,c,d,e){for(var f=e>>5;f--;)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 SecureRandom(){Crypto.util.randomBytes=function(a){var b=new Array(a);return(new SecureRandom).nextBytes(b),b}}function BigInteger(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))}function nbi(){return new BigInteger(null)}function am1(a,b,c,d,e,f){for(;--f>=0;){var g=b*this[a++]+c[d]+e;e=Math.floor(g/67108864),c[d++]=67108863&g}return e}function am2(a,b,c,d,e,f){for(var g=32767&b,h=b>>15;--f>=0;){var i=32767&this[a],j=this[a++]>>15,k=h*i+j*g;i=g*i+((32767&k)<<15)+c[d]+(1073741823&e),e=(i>>>30)+(k>>>15)+h*j+(e>>>30),c[d++]=1073741823&i}return e}function am3(a,b,c,d,e,f){for(var g=16383&b,h=b>>14;--f>=0;){var i=16383&this[a],j=this[a++]>>14,k=h*i+j*g;i=g*i+((16383&k)<<14)+c[d]+e,e=(i>>28)+(k>>14)+h*j,c[d++]=268435455&i}return e}function int2char(a){return BI_RM.charAt(a)}function intAt(a,b){var c=BI_RC[a.charCodeAt(b)];return null==c?-1:c}function bnpCopyTo(a){for(var b=this.t-1;b>=0;--b)a[b]=this[b];a.t=this.t,a.s=this.s}function bnpFromInt(a){this.t=1,this.s=0>a?-1:0,a>0?this[0]=a:-1>a?this[0]=a+this.DV:this.t=0}function nbv(a){var b=nbi();return b.fromInt(a),b}function bnpFromString(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)return void this.fromRadix(a,b);c=2}this.t=0,this.s=0;for(var d=a.length,e=!1,f=0;--d>=0;){var g=8==c?255&a[d]:intAt(a,d);0>g?"-"==a.charAt(d)&&(e=!0):(e=!1,0==f?this[this.t++]=g:f+c>this.DB?(this[this.t-1]|=(g&(1<<this.DB-f)-1)<<f,this[this.t++]=g>>this.DB-f):this[this.t-1]|=g<<f,f+=c,f>=this.DB&&(f-=this.DB))}8==c&&0!=(128&a[0])&&(this.s=-1,f>0&&(this[this.t-1]|=(1<<this.DB-f)-1<<f)),this.clamp(),e&&BigInteger.ZERO.subTo(this,this)}function bnpClamp(){for(var a=this.s&this.DM;this.t>0&&this[this.t-1]==a;)--this.t}function bnToString(a){if(this.s<0)return"-"+this.negate().toString(a);var b;if(16==a)b=4;else if(8==a)b=3;else if(2==a)b=1;else if(32==a)b=5;else{if(4!=a)return this.toRadix(a);b=2}var c,d=(1<<b)-1,e=!1,f="",g=this.t,h=this.DB-g*this.DB%b;if(g-->0)for(h<this.DB&&(c=this[g]>>h)>0&&(e=!0,f=int2char(c));g>=0;)b>h?(c=(this[g]&(1<<h)-1)<<b-h,c|=this[--g]>>(h+=this.DB-b)):(c=this[g]>>(h-=b)&d,0>=h&&(h+=this.DB,--g)),c>0&&(e=!0),e&&(f+=int2char(c));return e?f:"0"}function bnNegate(){var a=nbi();return BigInteger.ZERO.subTo(this,a),a}function bnAbs(){return this.s<0?this.negate():this}function bnCompareTo(a){var b=this.s-a.s;if(0!=b)return b;var c=this.t;if(b=c-a.t,0!=b)return this.s<0?-b:b;for(;--c>=0;)if(0!=(b=this[c]-a[c]))return b;return 0}function nbits(a){var b,c=1;return 0!=(b=a>>>16)&&(a=b,c+=16),0!=(b=a>>8)&&(a=b,c+=8),0!=(b=a>>4)&&(a=b,c+=4),0!=(b=a>>2)&&(a=b,c+=2),0!=(b=a>>1)&&(a=b,c+=1),c}function bnBitLength(){return this.t<=0?0:this.DB*(this.t-1)+nbits(this[this.t-1]^this.s&this.DM)}function bnpDLShiftTo(a,b){var c;for(c=this.t-1;c>=0;--c)b[c+a]=this[c];for(c=a-1;c>=0;--c)b[c]=0;b.t=this.t+a,b.s=this.s}function bnpDRShiftTo(a,b){for(var c=a;c<this.t;++c)b[c-a]=this[c];b.t=Math.max(this.t-a,0),b.s=this.s}function bnpLShiftTo(a,b){var c,d=a%this.DB,e=this.DB-d,f=(1<<e)-1,g=Math.floor(a/this.DB),h=this.s<<d&this.DM;for(c=this.t-1;c>=0;--c)b[c+g+1]=this[c]>>e|h,h=(this[c]&f)<<d;for(c=g-1;c>=0;--c)b[c]=0;b[g]=h,b.t=this.t+g+1,b.s=this.s,b.clamp()}function bnpRShiftTo(a,b){b.s=this.s;var c=Math.floor(a/this.DB);if(c>=this.t)return void(b.t=0);var d=a%this.DB,e=this.DB-d,f=(1<<d)-1;b[0]=this[c]>>d;for(var g=c+1;g<this.t;++g)b[g-c-1]|=(this[g]&f)<<e,b[g-c]=this[g]>>d;d>0&&(b[this.t-c-1]|=(this.s&f)<<e),b.t=this.t-c,b.clamp()}function bnpSubTo(a,b){for(var c=0,d=0,e=Math.min(a.t,this.t);e>c;)d+=this[c]-a[c],b[c++]=d&this.DM,d>>=this.DB;if(a.t<this.t){for(d-=a.s;c<this.t;)d+=this[c],b[c++]=d&this.DM,d>>=this.DB;d+=this.s}else{for(d+=this.s;c<a.t;)d-=a[c],b[c++]=d&this.DM,d>>=this.DB;d-=a.s}b.s=0>d?-1:0,-1>d?b[c++]=this.DV+d:d>0&&(b[c++]=d),b.t=c,b.clamp()}function bnpMultiplyTo(a,b){var c=this.abs(),d=a.abs(),e=c.t;for(b.t=e+d.t;--e>=0;)b[e]=0;for(e=0;e<d.t;++e)b[e+c.t]=c.am(0,d[e],b,e,0,c.t);b.s=0,b.clamp(),this.s!=a.s&&BigInteger.ZERO.subTo(b,b)}function bnpSquareTo(a){for(var b=this.abs(),c=a.t=2*b.t;--c>=0;)a[c]=0;for(c=0;c<b.t-1;++c){var d=b.am(c,b[c],a,2*c,0,1);(a[c+b.t]+=b.am(c+1,2*b[c],a,2*c+1,d,b.t-c-1))>=b.DV&&(a[c+b.t]-=b.DV,a[c+b.t+1]=1)}a.t>0&&(a[a.t-1]+=b.am(c,b[c],a,2*c,0,1)),a.s=0,a.clamp()}function bnpDivRemTo(a,b,c){var d=a.abs();if(!(d.t<=0)){var e=this.abs();if(e.t<d.t)return null!=b&&b.fromInt(0),void(null!=c&&this.copyTo(c));null==c&&(c=nbi());var f=nbi(),g=this.s,h=a.s,i=this.DB-nbits(d[d.t-1]);i>0?(d.lShiftTo(i,f),e.lShiftTo(i,c)):(d.copyTo(f),e.copyTo(c));var j=f.t,k=f[j-1];if(0!=k){var l=k*(1<<this.F1)+(j>1?f[j-2]>>this.F2:0),m=this.FV/l,n=(1<<this.F1)/l,o=1<<this.F2,p=c.t,q=p-j,r=null==b?nbi():b;for(f.dlShiftTo(q,r),c.compareTo(r)>=0&&(c[c.t++]=1,c.subTo(r,c)),BigInteger.ONE.dlShiftTo(j,r),r.subTo(f,f);f.t<j;)f[f.t++]=0;for(;--q>=0;){var s=c[--p]==k?this.DM:Math.floor(c[p]*m+(c[p-1]+o)*n);if((c[p]+=f.am(0,s,c,q,0,j))<s)for(f.dlShiftTo(q,r),c.subTo(r,c);c[p]<--s;)c.subTo(r,c)}null!=b&&(c.drShiftTo(j,b),g!=h&&BigInteger.ZERO.subTo(b,b)),c.t=j,c.clamp(),i>0&&c.rShiftTo(i,c),0>g&&BigInteger.ZERO.subTo(c,c)}}}function bnMod(a){var b=nbi();return this.abs().divRemTo(a,null,b),this.s<0&&b.compareTo(BigInteger.ZERO)>0&&a.subTo(b,b),b}function Classic(a){this.m=a}function cConvert(a){return a.s<0||a.compareTo(this.m)>=0?a.mod(this.m):a}function cRevert(a){return a}function cReduce(a){a.divRemTo(this.m,null,a)}function cMulTo(a,b,c){a.multiplyTo(b,c),this.reduce(c)}function cSqrTo(a,b){a.squareTo(b),this.reduce(b)}function bnpInvDigit(){if(this.t<1)return 0;var a=this[0];if(0==(1&a))return 0;var b=3&a;return b=b*(2-(15&a)*b)&15,b=b*(2-(255&a)*b)&255,b=b*(2-((65535&a)*b&65535))&65535,b=b*(2-a*b%this.DV)%this.DV,b>0?this.DV-b:-b}function Montgomery(a){this.m=a,this.mp=a.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<a.DB-15)-1,this.mt2=2*a.t}function montConvert(a){var b=nbi();return a.abs().dlShiftTo(this.m.t,b),b.divRemTo(this.m,null,b),a.s<0&&b.compareTo(BigInteger.ZERO)>0&&this.m.subTo(b,b),b}function montRevert(a){var b=nbi();return a.copyTo(b),this.reduce(b),b}function montReduce(a){for(;a.t<=this.mt2;)a[a.t++]=0;for(var b=0;b<this.m.t;++b){var c=32767&a[b],d=c*this.mpl+((c*this.mph+(a[b]>>15)*this.mpl&this.um)<<15)&a.DM;for(c=b+this.m.t,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),a.compareTo(this.m)>=0&&a.subTo(this.m,a)}function montSqrTo(a,b){a.squareTo(b),this.reduce(b)}function montMulTo(a,b,c){a.multiplyTo(b,c),this.reduce(c)}function bnpIsEven(){return 0==(this.t>0?1&this[0]:this.s)}function bnpExp(a,b){if(a>4294967295||1>a)return BigInteger.ONE;var c=nbi(),d=nbi(),e=b.convert(this),f=nbits(a)-1;for(e.copyTo(c);--f>=0;)if(b.sqrTo(c,d),(a&1<<f)>0)b.mulTo(d,e,c);else{var g=c;c=d,d=g}return b.revert(c)}function bnModPowInt(a,b){var c;return c=256>a||b.isEven()?new Classic(b):new Montgomery(b),this.exp(a,c)}function bnClone(){var a=nbi();return this.copyTo(a),a}function bnIntValue(){if(this.s<0){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)<<this.DB|this[0]}function bnByteValue(){return 0==this.t?this.s:this[0]<<24>>24}function bnShortValue(){return 0==this.t?this.s:this[0]<<16>>16}function bnpChunkSize(a){return Math.floor(Math.LN2*this.DB/Math.log(a))}function bnSigNum(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1}function bnpToRadix(a){if(null==a&&(a=10),0==this.signum()||2>a||a>36)return"0";var b=this.chunkSize(a),c=Math.pow(a,b),d=nbv(c),e=nbi(),f=nbi(),g="";for(this.divRemTo(d,e,f);e.signum()>0;)g=(c+f.intValue()).toString(a).substr(1)+g,e.divRemTo(d,e,f);return f.intValue().toString(a)+g}function bnpFromRadix(a,b){this.fromInt(0),null==b&&(b=10);for(var c=this.chunkSize(b),d=Math.pow(b,c),e=!1,f=0,g=0,h=0;h<a.length;++h){var i=intAt(a,h);0>i?"-"==a.charAt(h)&&0==this.signum()&&(e=!0):(g=b*g+i,++f>=c&&(this.dMultiply(d),this.dAddOffset(g,0),f=0,g=0))}f>0&&(this.dMultiply(Math.pow(b,f)),this.dAddOffset(g,0)),e&&BigInteger.ZERO.subTo(this,this)}function bnpFromNumber(a,b,c){if("number"==typeof b)if(2>a)this.fromInt(1);else for(this.fromNumber(a,c),this.testBit(a-1)||this.bitwiseTo(BigInteger.ONE.shiftLeft(a-1),op_or,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(b);)this.dAddOffset(2,0),this.bitLength()>a&&this.subTo(BigInteger.ONE.shiftLeft(a-1),this);else{var d=new Array,e=7&a;d.length=(a>>3)+1,b.nextBytes(d),e>0?d[0]&=(1<<e)-1:d[0]=0,this.fromString(d,256)}}function bnToByteArray(){var a=this.t,b=new Array;b[0]=this.s;var c,d=this.DB-a*this.DB%8,e=0;if(a-->0)for(d<this.DB&&(c=this[a]>>d)!=(this.s&this.DM)>>d&&(b[e++]=c|this.s<<this.DB-d);a>=0;)8>d?(c=(this[a]&(1<<d)-1)<<8-d,c|=this[--a]>>(d+=this.DB-8)):(c=this[a]>>(d-=8)&255,0>=d&&(d+=this.DB,--a)),0!=(128&c)&&(c|=-256),0==e&&(128&this.s)!=(128&c)&&++e,(e>0||c!=this.s)&&(b[e++]=c);return b}function bnEquals(a){return 0==this.compareTo(a)}function bnMin(a){return this.compareTo(a)<0?this:a}function bnMax(a){return this.compareTo(a)>0?this:a}function bnpBitwiseTo(a,b,c){var d,e,f=Math.min(a.t,this.t);for(d=0;f>d;++d)c[d]=b(this[d],a[d]);if(a.t<this.t){for(e=a.s&this.DM,d=f;d<this.t;++d)c[d]=b(this[d],e);c.t=this.t}else{for(e=this.s&this.DM,d=f;d<a.t;++d)c[d]=b(e,a[d]);c.t=a.t}c.s=b(this.s,a.s),c.clamp()}function op_and(a,b){return a&b}function bnAnd(a){var b=nbi();return this.bitwiseTo(a,op_and,b),b}function op_or(a,b){return a|b}function bnOr(a){var b=nbi();return this.bitwiseTo(a,op_or,b),b}function op_xor(a,b){return a^b}function bnXor(a){var b=nbi();return this.bitwiseTo(a,op_xor,b),b}function op_andnot(a,b){return a&~b}function bnAndNot(a){var b=nbi();return this.bitwiseTo(a,op_andnot,b),b}function bnNot(){for(var a=nbi(),b=0;b<this.t;++b)a[b]=this.DM&~this[b];return a.t=this.t,a.s=~this.s,a}function bnShiftLeft(a){var b=nbi();return 0>a?this.rShiftTo(-a,b):this.lShiftTo(a,b),b}function bnShiftRight(a){var b=nbi();return 0>a?this.lShiftTo(-a,b):this.rShiftTo(a,b),b}function lbit(a){if(0==a)return-1;var b=0;return 0==(65535&a)&&(a>>=16,b+=16),0==(255&a)&&(a>>=8,b+=8),0==(15&a)&&(a>>=4,b+=4),0==(3&a)&&(a>>=2,b+=2),0==(1&a)&&++b,b}function bnGetLowestSetBit(){for(var a=0;a<this.t;++a)if(0!=this[a])return a*this.DB+lbit(this[a]);return this.s<0?this.t*this.DB:-1}function cbit(a){for(var b=0;0!=a;)a&=a-1,++b;return b}function bnBitCount(){for(var a=0,b=this.s&this.DM,c=0;c<this.t;++c)a+=cbit(this[c]^b);return a}function bnTestBit(a){var b=Math.floor(a/this.DB);return b>=this.t?0!=this.s:0!=(this[b]&1<<a%this.DB)}function bnpChangeBit(a,b){var c=BigInteger.ONE.shiftLeft(a);return this.bitwiseTo(c,b,c),c}function bnSetBit(a){return this.changeBit(a,op_or)}function bnClearBit(a){return this.changeBit(a,op_andnot)}function bnFlipBit(a){return this.changeBit(a,op_xor)}function bnpAddTo(a,b){for(var c=0,d=0,e=Math.min(a.t,this.t);e>c;)d+=this[c]+a[c],b[c++]=d&this.DM,d>>=this.DB;if(a.t<this.t){for(d+=a.s;c<this.t;)d+=this[c],b[c++]=d&this.DM,d>>=this.DB;d+=this.s}else{for(d+=this.s;c<a.t;)d+=a[c],b[c++]=d&this.DM,d>>=this.DB;d+=a.s}b.s=0>d?-1:0,d>0?b[c++]=d:-1>d&&(b[c++]=this.DV+d),b.t=c,b.clamp()}function bnAdd(a){var b=nbi();return this.addTo(a,b),b}function bnSubtract(a){var b=nbi();return this.subTo(a,b),b}function bnMultiply(a){var b=nbi();return this.multiplyTo(a,b),b}function bnSquare(){var a=nbi();return this.squareTo(a),a}function bnDivide(a){var b=nbi();return this.divRemTo(a,b,null),b}function bnRemainder(a){var b=nbi();return this.divRemTo(a,null,b),b}function bnDivideAndRemainder(a){var b=nbi(),c=nbi();return this.divRemTo(a,b,c),new Array(b,c)}function bnpDMultiply(a){this[this.t]=this.am(0,a-1,this,0,0,this.t),++this.t,this.clamp()}function bnpDAddOffset(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]}}function NullExp(){}function nNop(a){return a}function nMulTo(a,b,c){a.multiplyTo(b,c)}function nSqrTo(a,b){a.squareTo(b)}function bnPow(a){return this.exp(a,new NullExp)}function bnpMultiplyLowerTo(a,b,c){var d=Math.min(this.t+a.t,b);for(c.s=0,c.t=d;d>0;)c[--d]=0;var e;for(e=c.t-this.t;e>d;++d)c[d+this.t]=this.am(0,a[d],c,d,0,this.t);for(e=Math.min(a.t,b);e>d;++d)this.am(0,a[d],c,d,0,b-d);c.clamp()}function bnpMultiplyUpperTo(a,b,c){--b;var d=c.t=this.t+a.t-b;for(c.s=0;--d>=0;)c[d]=0;for(d=Math.max(b-this.t,0);d<a.t;++d)c[this.t+d-b]=this.am(b-d,a[d],c,0,0,this.t+d-b);c.clamp(),c.drShiftTo(1,c)}function Barrett(a){this.r2=nbi(),this.q3=nbi(),BigInteger.ONE.dlShiftTo(2*a.t,this.r2),this.mu=this.r2.divide(a),this.m=a}function barrettConvert(a){if(a.s<0||a.t>2*this.m.t)return a.mod(this.m);if(a.compareTo(this.m)<0)return a;var b=nbi();return a.copyTo(b),this.reduce(b),b}function barrettRevert(a){return a}function barrettReduce(a){for(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),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);a.compareTo(this.r2)<0;)a.dAddOffset(1,this.m.t+1);for(a.subTo(this.r2,a);a.compareTo(this.m)>=0;)a.subTo(this.m,a)}function barrettSqrTo(a,b){a.squareTo(b),this.reduce(b)}function barrettMulTo(a,b,c){a.multiplyTo(b,c),this.reduce(c)}function bnModPow(a,b){var c,d,e=a.bitLength(),f=nbv(1);if(0>=e)return f;c=18>e?1:48>e?3:144>e?4:768>e?5:6,d=8>e?new Classic(b):b.isEven()?new Barrett(b):new Montgomery(b);var g=new Array,h=3,i=c-1,j=(1<<c)-1;if(g[1]=d.convert(this),c>1){var k=nbi();for(d.sqrTo(g[1],k);j>=h;)g[h]=nbi(),d.mulTo(k,g[h-2],g[h]),h+=2}var l,m,n=a.t-1,o=!0,p=nbi();for(e=nbits(a[n])-1;n>=0;){for(e>=i?l=a[n]>>e-i&j:(l=(a[n]&(1<<e+1)-1)<<i-e,n>0&&(l|=a[n-1]>>this.DB+e-i)),h=c;0==(1&l);)l>>=1,--h;if((e-=h)<0&&(e+=this.DB,--n),o)g[l].copyTo(f),o=!1;else{for(;h>1;)d.sqrTo(f,p),d.sqrTo(p,f),h-=2;h>0?d.sqrTo(f,p):(m=f,f=p,p=m),d.mulTo(p,g[l],f)}for(;n>=0&&0==(a[n]&1<<e);)d.sqrTo(f,p),m=f,f=p,p=m,--e<0&&(e=this.DB-1,--n)}return d.revert(f)}function bnGCD(a){var b=this.s<0?this.negate():this.clone(),c=a.s<0?a.negate():a.clone();if(b.compareTo(c)<0){var d=b;b=c,c=d}var e=b.getLowestSetBit(),f=c.getLowestSetBit();if(0>f)return b;for(f>e&&(f=e),f>0&&(b.rShiftTo(f,b),c.rShiftTo(f,c));b.signum()>0;)(e=b.getLowestSetBit())>0&&b.rShiftTo(e,b),(e=c.getLowestSetBit())>0&&c.rShiftTo(e,c),b.compareTo(c)>=0?(b.subTo(c,b),b.rShiftTo(1,b)):(c.subTo(b,c),c.rShiftTo(1,c));return f>0&&c.lShiftTo(f,c),c}function bnpModInt(a){if(0>=a)return 0;var b=this.DV%a,c=this.s<0?a-1:0;if(this.t>0)if(0==b)c=this[0]%a;else for(var d=this.t-1;d>=0;--d)c=(b*c+this[d])%a;return c}function bnModInverse(a){var b=a.isEven();if(this.isEven()&&b||0==a.signum())return BigInteger.ZERO;for(var c=a.clone(),d=this.clone(),e=nbv(1),f=nbv(0),g=nbv(0),h=nbv(1);0!=c.signum();){for(;c.isEven();)c.rShiftTo(1,c),b?(e.isEven()&&f.isEven()||(e.addTo(this,e),f.subTo(a,f)),e.rShiftTo(1,e)):f.isEven()||f.subTo(a,f),f.rShiftTo(1,f);for(;d.isEven();)d.rShiftTo(1,d),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);c.compareTo(d)>=0?(c.subTo(d,c),b&&e.subTo(g,e),f.subTo(h,f)):(d.subTo(c,d),b&&g.subTo(e,g),h.subTo(f,h))}return 0!=d.compareTo(BigInteger.ONE)?BigInteger.ZERO:h.compareTo(a)>=0?h.subtract(a):h.signum()<0?(h.addTo(a,h),h.signum()<0?h.add(a):h):h}function bnIsProbablePrime(a){var b,c=this.abs();if(1==c.t&&c[0]<=lowprimes[lowprimes.length-1]){for(b=0;b<lowprimes.length;++b)if(c[0]==lowprimes[b])return!0;return!1}if(c.isEven())return!1;for(b=1;b<lowprimes.length;){for(var d=lowprimes[b],e=b+1;e<lowprimes.length&&lplim>d;)d*=lowprimes[e++];for(d=c.modInt(d);e>b;)if(d%lowprimes[b++]==0)return!1}return c.millerRabin(a)}function bnpMillerRabin(a){var b=this.subtract(BigInteger.ONE),c=b.getLowestSetBit();if(0>=c)return!1;var d=b.shiftRight(c);a=a+1>>1,a>lowprimes.length&&(a=lowprimes.length);for(var e=nbi(),f=0;a>f;++f){e.fromInt(lowprimes[Math.floor(Math.random()*lowprimes.length)]);var g=e.modPow(d,this);if(0!=g.compareTo(BigInteger.ONE)&&0!=g.compareTo(b)){for(var h=1;h++<c&&0!=g.compareTo(b);)if(g=g.modPowInt(2,this),0==g.compareTo(BigInteger.ONE))return!1;if(0!=g.compareTo(b))return!1}}return!0}function ECFieldElementFp(a,b){this.x=b,this.q=a}function feFpEquals(a){return a==this?!0:this.q.equals(a.q)&&this.x.equals(a.x)}function feFpToBigInteger(){return this.x}function feFpNegate(){return new ECFieldElementFp(this.q,this.x.negate().mod(this.q))}function feFpAdd(a){return new ECFieldElementFp(this.q,this.x.add(a.toBigInteger()).mod(this.q))}function feFpSubtract(a){return new ECFieldElementFp(this.q,this.x.subtract(a.toBigInteger()).mod(this.q))}function feFpMultiply(a){return new ECFieldElementFp(this.q,this.x.multiply(a.toBigInteger()).mod(this.q))}function feFpSquare(){return new ECFieldElementFp(this.q,this.x.square().mod(this.q))}function feFpDivide(a){return new ECFieldElementFp(this.q,this.x.multiply(a.toBigInteger().modInverse(this.q)).mod(this.q))}function ECPointFp(a,b,c,d){this.curve=a,this.x=b,this.y=c,null==d?this.z=BigInteger.ONE:this.z=d,this.zinv=null}function pointFpGetX(){return null==this.zinv&&(this.zinv=this.z.modInverse(this.curve.q)),this.curve.fromBigInteger(this.x.toBigInteger().multiply(this.zinv).mod(this.curve.q))}function pointFpGetY(){return null==this.zinv&&(this.zinv=this.z.modInverse(this.curve.q)),this.curve.fromBigInteger(this.y.toBigInteger().multiply(this.zinv).mod(this.curve.q))}function pointFpEquals(a){if(a==this)return!0;if(this.isInfinity())return a.isInfinity();if(a.isInfinity())return this.isInfinity();var b,c;return b=a.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(a.z)).mod(this.curve.q),b.equals(BigInteger.ZERO)?(c=a.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(a.z)).mod(this.curve.q),c.equals(BigInteger.ZERO)):!1}function pointFpIsInfinity(){return null==this.x&&null==this.y?!0:this.z.equals(BigInteger.ZERO)&&!this.y.toBigInteger().equals(BigInteger.ZERO)}function pointFpNegate(){return new ECPointFp(this.curve,this.x,this.y.negate(),this.z)}function pointFpAdd(a){if(this.isInfinity())return a;if(a.isInfinity())return this;var b=a.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(a.z)).mod(this.curve.q),c=a.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(a.z)).mod(this.curve.q);if(BigInteger.ZERO.equals(c))return BigInteger.ZERO.equals(b)?this.twice():this.curve.getInfinity();var d=new BigInteger("3"),e=this.x.toBigInteger(),f=this.y.toBigInteger(),g=(a.x.toBigInteger(),a.y.toBigInteger(),c.square()),h=g.multiply(c),i=e.multiply(g),j=b.square().multiply(this.z),k=j.subtract(i.shiftLeft(1)).multiply(a.z).subtract(h).multiply(c).mod(this.curve.q),l=i.multiply(d).multiply(b).subtract(f.multiply(h)).subtract(j.multiply(b)).multiply(a.z).add(b.multiply(h)).mod(this.curve.q),m=h.multiply(this.z).multiply(a.z).mod(this.curve.q);return new ECPointFp(this.curve,this.curve.fromBigInteger(k),this.curve.fromBigInteger(l),m)}function pointFpTwice(){if(this.isInfinity())return this;if(0==this.y.toBigInteger().signum())return this.curve.getInfinity();var a=new BigInteger("3"),b=this.x.toBigInteger(),c=this.y.toBigInteger(),d=c.multiply(this.z),e=d.multiply(c).mod(this.curve.q),f=this.curve.a.toBigInteger(),g=b.square().multiply(a);BigInteger.ZERO.equals(f)||(g=g.add(this.z.square().multiply(f))),g=g.mod(this.curve.q);var h=g.square().subtract(b.shiftLeft(3).multiply(e)).shiftLeft(1).multiply(d).mod(this.curve.q),i=g.multiply(a).multiply(b).subtract(e.shiftLeft(1)).shiftLeft(2).multiply(e).subtract(g.square().multiply(g)).mod(this.curve.q),j=d.square().multiply(d).shiftLeft(3).mod(this.curve.q);return new ECPointFp(this.curve,this.curve.fromBigInteger(h),this.curve.fromBigInteger(i),j)}function pointFpMultiply(a){if(this.isInfinity())return this;if(0==a.signum())return this.curve.getInfinity();var b,c=a,d=c.multiply(new BigInteger("3")),e=this.negate(),f=this;for(b=d.bitLength()-2;b>0;--b){f=f.twice();var g=d.testBit(b),h=c.testBit(b);g!=h&&(f=f.add(g?this:e))}return f}function pointFpMultiplyTwo(a,b,c){var d;d=a.bitLength()>c.bitLength()?a.bitLength()-1:c.bitLength()-1;for(var e=this.curve.getInfinity(),f=this.add(b);d>=0;)e=e.twice(),a.testBit(d)?e=c.testBit(d)?e.add(f):e.add(this):c.testBit(d)&&(e=e.add(b)),--d;return e}function ECCurveFp(a,b,c){this.q=a,this.a=this.fromBigInteger(b),this.b=this.fromBigInteger(c),this.infinity=new ECPointFp(this,null,null)}function curveFpGetQ(){return this.q}function curveFpGetA(){return this.a}function curveFpGetB(){return this.b}function curveFpEquals(a){return a==this?!0:this.q.equals(a.q)&&this.a.equals(a.a)&&this.b.equals(a.b)}function curveFpGetInfinity(){return this.infinity}function curveFpFromBigInteger(a){return new ECFieldElementFp(this.q,a)}function curveFpDecompressPoint(a,b){if(this.q.mod(BigInteger.valueOf(4)).equals(BigInteger.valueOf(3))){var c=b.multiply(b.square().add(this.a)).add(this.b),d=c.x.modPow(this.q.add(BigInteger.ONE).divide(BigInteger.valueOf(4)),this.q);return d.testBit(0)!==a&&(d=this.q.subtract(d)),new ECPointFp(this,b,this.fromBigInteger(d))}throw new Error("point decompression only implements sqrt for q = 3 mod 4")}function curveFpDecodePointHex(a){switch(parseInt(a.substr(0,2),16)){case 0:return this.infinity;case 2:return this.decompressPoint(!1,this.fromBigInteger(new BigInteger(a.substr(2),16)));case 3:return this.decompressPoint(!0,this.fromBigInteger(new BigInteger(a.substr(2),16)));case 4:case 6:case 7:var b=(a.length-2)/2,c=a.substr(2,b),d=a.substr(b+2,b);return new ECPointFp(this,this.fromBigInteger(new BigInteger(c,16)),this.fromBigInteger(new BigInteger(d,16)));default:return null}}function X9ECParameters(a,b,c,d){this.curve=a,this.g=b,this.n=c,this.h=d}function x9getCurve(){return this.curve}function x9getG(){return this.g}function x9getN(){return this.n}function x9getH(){return this.h}function fromHex(a){return new BigInteger(a,16)}function secp128r1(){var a=fromHex("FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFF"),b=fromHex("FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFC"),c=fromHex("E87579C11079F43DD824993C2CEE5ED3"),d=fromHex("FFFFFFFE0000000075A30D1B9038A115"),e=BigInteger.ONE,f=new ECCurveFp(a,b,c),g=f.decodePointHex("04161FF7528B899B2D0C28607CA52C5B86CF5AC8395BAFEB13C02DA292DDED7A83");return new X9ECParameters(f,g,d,e)}function secp160k1(){var a=fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC73"),b=BigInteger.ZERO,c=fromHex("7"),d=fromHex("0100000000000000000001B8FA16DFAB9ACA16B6B3"),e=BigInteger.ONE,f=new ECCurveFp(a,b,c),g=f.decodePointHex("043B4C382CE37AA192A4019E763036F4F5DD4D7EBB938CF935318FDCED6BC28286531733C3F03C4FEE");return new X9ECParameters(f,g,d,e)}function secp160r1(){var a=fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFF"),b=fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFC"),c=fromHex("1C97BEFC54BD7A8B65ACF89F81D4D4ADC565FA45"),d=fromHex("0100000000000000000001F4C8F927AED3CA752257"),e=BigInteger.ONE,f=new ECCurveFp(a,b,c),g=f.decodePointHex("044A96B5688EF573284664698968C38BB913CBFC8223A628553168947D59DCC912042351377AC5FB32");return new X9ECParameters(f,g,d,e)}function secp192k1(){var a=fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFEE37"),b=BigInteger.ZERO,c=fromHex("3"),d=fromHex("FFFFFFFFFFFFFFFFFFFFFFFE26F2FC170F69466A74DEFD8D"),e=BigInteger.ONE,f=new ECCurveFp(a,b,c),g=f.decodePointHex("04DB4FF10EC057E9AE26B07D0280B7F4341DA5D1B1EAE06C7D9B2F2F6D9C5628A7844163D015BE86344082AA88D95E2F9D");return new X9ECParameters(f,g,d,e)}function secp192r1(){var a=fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF"),b=fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFC"),c=fromHex("64210519E59C80E70FA7E9AB72243049FEB8DEECC146B9B1"),d=fromHex("FFFFFFFFFFFFFFFFFFFFFFFF99DEF836146BC9B1B4D22831"),e=BigInteger.ONE,f=new ECCurveFp(a,b,c),g=f.decodePointHex("04188DA80EB03090F67CBF20EB43A18800F4FF0AFD82FF101207192B95FFC8DA78631011ED6B24CDD573F977A11E794811");return new X9ECParameters(f,g,d,e)}function secp224r1(){var a=fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001"),b=fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFE"),c=fromHex("B4050A850C04B3ABF54132565044B0B7D7BFD8BA270B39432355FFB4"),d=fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFF16A2E0B8F03E13DD29455C5C2A3D"),e=BigInteger.ONE,f=new ECCurveFp(a,b,c),g=f.decodePointHex("04B70E0CBD6BB4BF7F321390B94A03C1D356C21122343280D6115C1D21BD376388B5F723FB4C22DFE6CD4375A05A07476444D5819985007E34");return new X9ECParameters(f,g,d,e)}function secp256k1(){var a=fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F"),b=BigInteger.ZERO,c=fromHex("7"),d=fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141"),e=BigInteger.ONE,f=new ECCurveFp(a,b,c),g=f.decodePointHex("0479BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8");return new X9ECParameters(f,g,d,e)}function secp256r1(){var a=fromHex("FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF"),b=fromHex("FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC"),c=fromHex("5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B"),d=fromHex("FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551"),e=BigInteger.ONE,f=new ECCurveFp(a,b,c),g=f.decodePointHex("046B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C2964FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5");return new X9ECParameters(f,g,d,e)}function getSECCurveByName(a){return"secp128r1"==a?secp128r1():"secp160k1"==a?secp160k1():"secp160r1"==a?secp160r1():"secp192k1"==a?secp192k1():"secp192r1"==a?secp192r1():"secp224r1"==a?secp224r1():"secp256k1"==a?secp256k1():"secp256r1"==a?secp256r1():null}function integerToBytes(a,b){var c=a.toByteArrayUnsigned();if(b<c.length)c=c.slice(c.length-b);else for(;b>c.length;)c.unshift(0);return c}function dmp(a){return a instanceof BigInteger||(a=a.toBigInteger()),Crypto.util.bytesToHex(a.toByteArrayUnsigned())}"undefined"==typeof window&&(window=global,window.navigator={}),window.Bitcoin={},"undefined"!=typeof Crypto&&Crypto.util||!function(){var a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",b=window.Crypto={},c=b.util={rotl:function(a,b){return a<<b|a>>>32-b},rotr:function(a,b){return a<<32-b|a>>>b},endian:function(a){if(a.constructor==Number)return 16711935&c.rotl(a,8)|4278255360&c.rotl(a,24);for(var b=0;b<a.length;b++)a[b]=c.endian(a[b]);return a},randomBytes:function(a){for(var b=[];a>0;a--)b.push(Math.floor(256*Math.random()));return b},bytesToWords:function(a){for(var b=[],c=0,d=0;c<a.length;c++,d+=8)b[d>>>5]|=(255&a[c])<<24-d%32;return b},wordsToBytes:function(a){for(var b=[],c=0;c<32*a.length;c+=8)b.push(a[c>>>5]>>>24-c%32&255);return b},bytesToHex:function(a){for(var b=[],c=0;c<a.length;c++)b.push((a[c]>>>4).toString(16)),b.push((15&a[c]).toString(16));return b.join("")},hexToBytes:function(a){for(var b=[],c=0;c<a.length;c+=2)b.push(parseInt(a.substr(c,2),16));return b},bytesToBase64:function(b){for(var c=[],d=0;d<b.length;d+=3)for(var e=b[d]<<16|b[d+1]<<8|b[d+2],f=0;4>f;f++)8*d+6*f<=8*b.length?c.push(a.charAt(e>>>6*(3-f)&63)):c.push("=");return c.join("")},base64ToBytes:function(b){b=b.replace(/[^A-Z0-9+\/]/gi,"");for(var c=[],d=0,e=0;d<b.length;e=++d%4)0!=e&&c.push((a.indexOf(b.charAt(d-1))&Math.pow(2,-2*e+8)-1)<<2*e|a.indexOf(b.charAt(d))>>>6-2*e);return c}},d=b.charenc={},e=(d.UTF8={stringToBytes:function(a){return e.stringToBytes(unescape(encodeURIComponent(a)))},bytesToString:function(a){return decodeURIComponent(escape(e.bytesToString(a)))}},d.Binary={stringToBytes:function(a){for(var b=[],c=0;c<a.length;c++)b.push(255&a.charCodeAt(c));return b},bytesToString:function(a){for(var b=[],c=0;c<a.length;c++)b.push(String.fromCharCode(a[c]));return b.join("")}})}(),function(){var a=Crypto.util;a.u32=function(a){return a>>>0},a.add=function(){for(var a=this.u32(arguments[0]),b=1;b<arguments.length;b++)a=this.u32(a+this.u32(arguments[b]));return a},a.mult=function(a,b){return this.add((4294901760&b)*a,(65535&b)*a)},a.gt=function(a,b){return this.u32(a)>this.u32(b)},a.lt=function(a,b){return this.u32(a)<this.u32(b)}}(),function(a){function b(a,b){var c=4*a._blocksize,d=c-b.length%c;return d}var c=a.pad={},d=function(a,b,c,d){var e=b.pop();if(0==e)throw new Error("Invalid zero-length padding specified for "+c+". Wrong cipher specification or key used?");
var f=4*a._blocksize;if(e>f)throw new Error("Invalid padding length of "+e+" specified for "+c+". Wrong cipher specification or key used?");for(var g=1;e>g;g++){var h=b.pop();if(void 0!=d&&d!=h)throw new Error("Invalid padding byte of 0x"+h.toString(16)+" specified for "+c+". Wrong cipher specification or key used?")}};c.NoPadding={pad:function(a,b){},unpad:function(a,b){}},c.ZeroPadding={pad:function(a,b){var c=4*a._blocksize,d=b.length%c;if(0!=d)for(d=c-d;d>0;d--)b.push(0)},unpad:function(a,b){for(;0==b[b.length-1];)b.pop()}},c.iso7816={pad:function(a,c){var d=b(a,c);for(c.push(128);d>1;d--)c.push(0)},unpad:function(a,b){var c;for(c=4*a._blocksize;c>0;c--){var d=b.pop();if(128==d)return;if(0!=d)throw new Error("ISO-7816 padding byte must be 0, not 0x"+d.toString(16)+". Wrong cipher specification or key used?")}throw new Error("ISO-7816 padded beyond cipher block size. Wrong cipher specification or key used?")}},c.ansix923={pad:function(a,c){for(var d=b(a,c),e=1;d>e;e++)c.push(0);c.push(d)},unpad:function(a,b){d(a,b,"ANSI X.923",0)}},c.iso10126={pad:function(a,c){for(var d=b(a,c),e=1;d>e;e++)c.push(Math.floor(256*Math.random()));c.push(d)},unpad:function(a,b){d(a,b,"ISO 10126",void 0)}},c.pkcs7={pad:function(a,c){for(var d=b(a,c),e=0;d>e;e++)c.push(d)},unpad:function(a,b){d(a,b,"PKCS 7",b[b.length-1])}};var e=a.mode={},f=e.Mode=function(a){a&&(this._padding=a)};f.prototype={encrypt:function(a,b,c){this._padding.pad(a,b),this._doEncrypt(a,b,c)},decrypt:function(a,b,c){this._doDecrypt(a,b,c),this._padding.unpad(a,b)},_padding:c.iso7816};var g=e.ECB=function(){f.apply(this,arguments)},h=g.prototype=new f;h._doEncrypt=function(a,b,c){for(var d=4*a._blocksize,e=0;e<b.length;e+=d)a._encryptblock(b,e)},h._doDecrypt=function(a,b,c){for(var d=4*a._blocksize,e=0;e<b.length;e+=d)a._decryptblock(b,e)},h.fixOptions=function(a){a.iv=[]};var i=e.CBC=function(){f.apply(this,arguments)},j=i.prototype=new f;j._doEncrypt=function(a,b,c){for(var d=4*a._blocksize,e=0;e<b.length;e+=d){if(0==e)for(var f=0;d>f;f++)b[f]^=c[f];else for(var f=0;d>f;f++)b[e+f]^=b[e+f-d];a._encryptblock(b,e)}},j._doDecrypt=function(a,b,c){for(var d=4*a._blocksize,e=c,f=0;f<b.length;f+=d){var g=b.slice(f,f+d);a._decryptblock(b,f);for(var h=0;d>h;h++)b[f+h]^=e[h];e=g}};var k=e.CFB=function(){f.apply(this,arguments)},l=k.prototype=new f;l._padding=c.NoPadding,l._doEncrypt=function(a,b,c){for(var d=4*a._blocksize,e=c.slice(0),f=0;f<b.length;f++){var g=f%d;0==g&&a._encryptblock(e,0),b[f]^=e[g],e[g]=b[f]}},l._doDecrypt=function(a,b,c){for(var d=4*a._blocksize,e=c.slice(0),f=0;f<b.length;f++){var g=f%d;0==g&&a._encryptblock(e,0);var h=b[f];b[f]^=e[g],e[g]=h}};var m=e.OFB=function(){f.apply(this,arguments)},n=m.prototype=new f;n._padding=c.NoPadding,n._doEncrypt=function(a,b,c){for(var d=4*a._blocksize,e=c.slice(0),f=0;f<b.length;f++)f%d==0&&a._encryptblock(e,0),b[f]^=e[f%d]},n._doDecrypt=n._doEncrypt;var o=e.CTR=function(){f.apply(this,arguments)},p=o.prototype=new f;p._padding=c.NoPadding,p._doEncrypt=function(a,b,c){for(var d=4*a._blocksize,e=c.slice(0),f=0;f<b.length;){var g=e.slice(0);a._encryptblock(g,0);for(var h=0;f<b.length&&d>h;h++,f++)b[f]^=g[h];256==++e[d-1]&&(e[d-1]=0,256==++e[d-2]&&(e[d-2]=0,256==++e[d-3]&&(e[d-3]=0,++e[d-4])))}},p._doDecrypt=p._doEncrypt}(Crypto),function(){var a=Crypto,b=a.util,c=a.charenc,d=c.UTF8,e=c.Binary,f=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],g=a.SHA256=function(a,c){var d=b.wordsToBytes(g._sha256(a));return c&&c.asBytes?d:c&&c.asString?e.bytesToString(d):b.bytesToHex(d)};g._sha256=function(a){a.constructor==String&&(a=d.stringToBytes(a));var c,e,g,h,i,j,k,l,m,n,o,p,q=b.bytesToWords(a),r=8*a.length,s=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],t=[];q[r>>5]|=128<<24-r%32,q[(r+64>>9<<4)+15]=r;for(var m=0;m<q.length;m+=16){c=s[0],e=s[1],g=s[2],h=s[3],i=s[4],j=s[5],k=s[6],l=s[7];for(var n=0;64>n;n++){if(16>n)t[n]=q[n+m];else{var u=t[n-15],v=t[n-2],w=(u<<25|u>>>7)^(u<<14|u>>>18)^u>>>3,x=(v<<15|v>>>17)^(v<<13|v>>>19)^v>>>10;t[n]=w+(t[n-7]>>>0)+x+(t[n-16]>>>0)}var y=i&j^~i&k,z=c&e^c&g^e&g,A=(c<<30|c>>>2)^(c<<19|c>>>13)^(c<<10|c>>>22),B=(i<<26|i>>>6)^(i<<21|i>>>11)^(i<<7|i>>>25);o=(l>>>0)+B+y+f[n]+(t[n]>>>0),p=A+z,l=k,k=j,j=i,i=h+o>>>0,h=g,g=e,e=c,c=o+p>>>0}s[0]+=c,s[1]+=e,s[2]+=g,s[3]+=h,s[4]+=i,s[5]+=j,s[6]+=k,s[7]+=l}return s},g._blocksize=16,g._digestsize=32}(),function(){function a(a,b){for(var c=0,d=0;8>d;d++){1&b&&(c^=a);var e=128&a;a=a<<1&255,e&&(a^=27),b>>>=1}return c}for(var b=Crypto,c=b.util,d=b.charenc,e=d.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],g=[],h=0;256>h;h++)g[f[h]]=h;for(var i=[],j=[],k=[],l=[],m=[],n=[],h=0;256>h;h++)i[h]=a(h,2),j[h]=a(h,3),k[h]=a(h,9),l[h]=a(h,11),m[h]=a(h,13),n[h]=a(h,14);var o,p,q,r=[0,1,2,4,8,16,32,64,128,27,54],s=[[],[],[],[]],t=b.AES={encrypt:function(a,d,f){f=f||{};var g=f.mode||new b.mode.OFB;g.fixOptions&&g.fixOptions(f);var h=a.constructor==String?e.stringToBytes(a):a,i=f.iv||c.randomBytes(4*t._blocksize),j=d.constructor==String?b.PBKDF2(d,i,32,{asBytes:!0}):d;return t._init(j),g.encrypt(t,h,i),h=f.iv?h:i.concat(h),f&&f.asBytes?h:c.bytesToBase64(h)},decrypt:function(a,d,f){f=f||{};var g=f.mode||new b.mode.OFB;g.fixOptions&&g.fixOptions(f);var h=a.constructor==String?c.base64ToBytes(a):a,i=f.iv||h.splice(0,4*t._blocksize),j=d.constructor==String?b.PBKDF2(d,i,32,{asBytes:!0}):d;return t._init(j),g.decrypt(t,h,i),f&&f.asBytes?h:e.bytesToString(h)},_blocksize:4,_encryptblock:function(a,b){for(var c=0;c<t._blocksize;c++)for(var d=0;4>d;d++)s[c][d]=a[b+4*d+c];for(var c=0;4>c;c++)for(var d=0;4>d;d++)s[c][d]^=q[d][c];for(var e=1;p>e;e++){for(var c=0;4>c;c++)for(var d=0;4>d;d++)s[c][d]=f[s[c][d]];s[1].push(s[1].shift()),s[2].push(s[2].shift()),s[2].push(s[2].shift()),s[3].unshift(s[3].pop());for(var d=0;4>d;d++){var g=s[0][d],h=s[1][d],k=s[2][d],l=s[3][d];s[0][d]=i[g]^j[h]^k^l,s[1][d]=g^i[h]^j[k]^l,s[2][d]=g^h^i[k]^j[l],s[3][d]=j[g]^h^k^i[l]}for(var c=0;4>c;c++)for(var d=0;4>d;d++)s[c][d]^=q[4*e+d][c]}for(var c=0;4>c;c++)for(var d=0;4>d;d++)s[c][d]=f[s[c][d]];s[1].push(s[1].shift()),s[2].push(s[2].shift()),s[2].push(s[2].shift()),s[3].unshift(s[3].pop());for(var c=0;4>c;c++)for(var d=0;4>d;d++)s[c][d]^=q[4*p+d][c];for(var c=0;c<t._blocksize;c++)for(var d=0;4>d;d++)a[b+4*d+c]=s[c][d]},_decryptblock:function(a,b){for(var c=0;c<t._blocksize;c++)for(var d=0;4>d;d++)s[c][d]=a[b+4*d+c];for(var c=0;4>c;c++)for(var d=0;4>d;d++)s[c][d]^=q[4*p+d][c];for(var e=1;p>e;e++){s[1].unshift(s[1].pop()),s[2].push(s[2].shift()),s[2].push(s[2].shift()),s[3].push(s[3].shift());for(var c=0;4>c;c++)for(var d=0;4>d;d++)s[c][d]=g[s[c][d]];for(var c=0;4>c;c++)for(var d=0;4>d;d++)s[c][d]^=q[4*(p-e)+d][c];for(var d=0;4>d;d++){var f=s[0][d],h=s[1][d],i=s[2][d],j=s[3][d];s[0][d]=n[f]^l[h]^m[i]^k[j],s[1][d]=k[f]^n[h]^l[i]^m[j],s[2][d]=m[f]^k[h]^n[i]^l[j],s[3][d]=l[f]^m[h]^k[i]^n[j]}}s[1].unshift(s[1].pop()),s[2].push(s[2].shift()),s[2].push(s[2].shift()),s[3].push(s[3].shift());for(var c=0;4>c;c++)for(var d=0;4>d;d++)s[c][d]=g[s[c][d]];for(var c=0;4>c;c++)for(var d=0;4>d;d++)s[c][d]^=q[d][c];for(var c=0;c<t._blocksize;c++)for(var d=0;4>d;d++)a[b+4*d+c]=s[c][d]},_init:function(a){o=a.length/4,p=o+6,t._keyexpansion(a)},_keyexpansion:function(a){q=[];for(var b=0;o>b;b++)q[b]=[a[4*b],a[4*b+1],a[4*b+2],a[4*b+3]];for(var b=o;b<t._blocksize*(p+1);b++){var c=[q[b-1][0],q[b-1][1],q[b-1][2],q[b-1][3]];b%o==0?(c.push(c.shift()),c[0]=f[c[0]],c[1]=f[c[1]],c[2]=f[c[2]],c[3]=f[c[3]],c[0]^=r[b/o]):o>6&&b%o==4&&(c[0]=f[c[0]],c[1]=f[c[1]],c[2]=f[c[2]],c[3]=f[c[3]]),q[b]=[q[b-o][0]^c[0],q[b-o][1]^c[1],q[b-o][2]^c[2],q[b-o][3]^c[3]]}}}}(),function(){var a=Crypto,b=a.util,c=a.charenc,d=c.UTF8,e=c.Binary;a.PBKDF2=function(c,f,g,h){function i(b,c){return a.HMAC(j,c,b,{asBytes:!0})}c.constructor==String&&(c=d.stringToBytes(c)),f.constructor==String&&(f=d.stringToBytes(f));for(var j=h&&h.hasher||a.SHA1,k=h&&h.iterations||1,l=[],m=1;l.length<g;){for(var n=i(c,f.concat(b.wordsToBytes([m]))),o=n,p=1;k>p;p++){o=i(c,o);for(var q=0;q<n.length;q++)n[q]^=o[q]}l=l.concat(n),m++}return l.length=g,h&&h.asBytes?l:h&&h.asString?e.bytesToString(l):b.bytesToHex(l)}}(),function(){var a=Crypto,b=a.util,c=a.charenc,d=c.UTF8,e=c.Binary;a.HMAC=function(a,c,f,g){c.constructor==String&&(c=d.stringToBytes(c)),f.constructor==String&&(f=d.stringToBytes(f)),f.length>4*a._blocksize&&(f=a(f,{asBytes:!0}));for(var h=f.slice(0),i=f.slice(0),j=0;j<4*a._blocksize;j++)h[j]^=92,i[j]^=54;var k=a(h.concat(a(i.concat(c),{asBytes:!0})),{asBytes:!0});return g&&g.asBytes?k:g&&g.asString?e.bytesToString(k):b.bytesToHex(k)}}(),function(){function a(a,b,c,d){return a>=0&&15>=a?b^c^d:a>=16&&31>=a?b&c|~b&d:a>=32&&47>=a?(b|~c)^d:a>=48&&63>=a?b&d|c&~d:a>=64&&79>=a?b^(c|~d):"rmd160_f: j out of range"}function b(a){return a>=0&&15>=a?0:a>=16&&31>=a?1518500249:a>=32&&47>=a?1859775393:a>=48&&63>=a?2400959708:a>=64&&79>=a?2840853838:"rmd160_K1: j out of range"}function c(a){return a>=0&&15>=a?1352829926:a>=16&&31>=a?1548603684:a>=32&&47>=a?1836072691:a>=48&&63>=a?2053994217:a>=64&&79>=a?0:"rmd160_K2: j out of range"}function d(a,b){var c=(65535&a)+(65535&b),d=(a>>16)+(b>>16)+(c>>16);return d<<16|65535&c}function e(a,b){return a<<b|a>>>32-b}var f=Crypto,g=f.util,h=f.charenc,i=h.UTF8,j=h.Binary;g.bytesToLWords=function(a){for(var b=Array(a.length>>2),c=0;c<b.length;c++)b[c]=0;for(var c=0;c<8*a.length;c+=8)b[c>>5]|=(255&a[c/8])<<c%32;return b},g.lWordsToBytes=function(a){for(var b=[],c=0;c<32*a.length;c+=8)b.push(a[c>>5]>>>c%32&255);return b};var k=f.RIPEMD160=function(a,b){var c=g.lWordsToBytes(k._rmd160(a));return b&&b.asBytes?c:b&&b.asString?j.bytesToString(c):g.bytesToHex(c)};k._rmd160=function(f){f.constructor==String&&(f=i.stringToBytes(f));var h=g.bytesToLWords(f),j=8*f.length;h[j>>5]|=128<<j%32,h[(j+64>>>9<<4)+14]=j;for(var k=1732584193,p=4023233417,q=2562383102,r=271733878,s=3285377520,t=0;t<h.length;t+=16){for(var u,v=k,w=p,x=q,y=r,z=s,A=k,B=p,C=q,D=r,E=s,F=0;79>=F;++F)u=d(v,a(F,w,x,y)),u=d(u,h[t+l[F]]),u=d(u,b(F)),u=d(e(u,n[F]),z),v=z,z=y,y=e(x,10),x=w,w=u,u=d(A,a(79-F,B,C,D)),u=d(u,h[t+m[F]]),u=d(u,c(F)),u=d(e(u,o[F]),E),A=E,E=D,D=e(C,10),C=B,B=u;u=d(p,d(x,D)),p=d(q,d(y,E)),q=d(r,d(z,A)),r=d(s,d(v,B)),s=d(k,d(w,C)),k=u}return[k,p,q,r,s]};var l=[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],m=[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],n=[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],o=[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(){function a(a){throw a}function b(a,b){this.a=a,this.b=b}function c(a,b){var c,d=[],e=(1<<b)-1,f=a.length*b;for(c=0;f>c;c+=b)d[c>>>5]|=(a.charCodeAt(c/b)&e)<<32-b-c%32;return{value:d,binLen:f}}function d(b){var c,d,e=[],f=b.length;for(0!==f%2&&a("String of HEX type must be in byte increments"),c=0;f>c;c+=2)d=parseInt(b.substr(c,2),16),isNaN(d)&&a("String of HEX type contains invalid characters"),e[c>>>3]|=d<<24-4*(c%8);return{value:e,binLen:4*f}}function e(b){var c,d,e,f,g,h=[],i=0;for(-1===b.search(/^[a-zA-Z0-9=+\/]+$/)&&a("Invalid character in base-64 string"),c=b.indexOf("="),b=b.replace(/\=/g,""),-1!==c&&c<b.length&&a("Invalid '=' found in base-64 string"),d=0;d<b.length;d+=4){for(g=b.substr(d,4),e=f=0;e<g.length;e+=1)c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(g[e]),f|=c<<18-6*e;for(e=0;e<g.length-1;e+=1)h[i>>2]|=(f>>>16-8*e&255)<<24-8*(i%4),i+=1}return{value:h,binLen:8*i}}function f(a,b){var c,d,e="",f=4*a.length;for(c=0;f>c;c+=1)d=a[c>>>2]>>>8*(3-c%4),e+="0123456789abcdef".charAt(d>>>4&15)+"0123456789abcdef".charAt(15&d);return b.outputUpper?e.toUpperCase():e}function g(a,b){var c,d,e,f="",g=4*a.length;for(c=0;g>c;c+=3)for(e=(a[c>>>2]>>>8*(3-c%4)&255)<<16|(a[c+1>>>2]>>>8*(3-(c+1)%4)&255)<<8|a[c+2>>>2]>>>8*(3-(c+2)%4)&255,d=0;4>d;d+=1)f=8*c+6*d<=32*a.length?f+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>>6*(3-d)&63):f+b.b64Pad;return f}function h(b){var c={outputUpper:!1,b64Pad:"="};try{b.hasOwnProperty("outputUpper")&&(c.outputUpper=b.outputUpper),b.hasOwnProperty("b64Pad")&&(c.b64Pad=b.b64Pad)}catch(d){}return"boolean"!=typeof c.outputUpper&&a("Invalid outputUpper formatting option"),"string"!=typeof c.b64Pad&&a("Invalid b64Pad formatting option"),c}function i(a,c){var d=u,d=new b(a.a,a.b);return d=32>=c?new b(d.a>>>c|d.b<<32-c&4294967295,d.b>>>c|d.a<<32-c&4294967295):new b(d.b>>>c-32|d.a<<64-c&4294967295,d.a>>>c-32|d.b<<64-c&4294967295)}function j(a,c){var d=u;return d=32>=c?new b(a.a>>>c,a.b>>>c|a.a<<32-c&4294967295):new b(0,a.a>>>c-32)}function k(a,c,d){return new b(a.a&c.a^~a.a&d.a,a.b&c.b^~a.b&d.b)}function l(a,c,d){return new b(a.a&c.a^a.a&d.a^c.a&d.a,a.b&c.b^a.b&d.b^c.b&d.b)}function m(a){var c=i(a,28),d=i(a,34);return a=i(a,39),new b(c.a^d.a^a.a,c.b^d.b^a.b)}function n(a){var c=i(a,14),d=i(a,18);return a=i(a,41),new b(c.a^d.a^a.a,c.b^d.b^a.b)}function o(a){var c=i(a,1),d=i(a,8);return a=j(a,7),new b(c.a^d.a^a.a,c.b^d.b^a.b)}function p(a){var c=i(a,19),d=i(a,61);return a=j(a,6),new b(c.a^d.a^a.a,c.b^d.b^a.b)}function q(a,c){var d,e,f;return d=(65535&a.b)+(65535&c.b),e=(a.b>>>16)+(c.b>>>16)+(d>>>16),f=(65535&e)<<16|65535&d,d=(65535&a.a)+(65535&c.a)+(e>>>16),e=(a.a>>>16)+(c.a>>>16)+(d>>>16),new b((65535&e)<<16|65535&d,f)}function r(a,c,d,e){var f,g,h;return f=(65535&a.b)+(65535&c.b)+(65535&d.b)+(65535&e.b),g=(a.b>>>16)+(c.b>>>16)+(d.b>>>16)+(e.b>>>16)+(f>>>16),h=(65535&g)<<16|65535&f,f=(65535&a.a)+(65535&c.a)+(65535&d.a)+(65535&e.a)+(g>>>16),g=(a.a>>>16)+(c.a>>>16)+(d.a>>>16)+(e.a>>>16)+(f>>>16),new b((65535&g)<<16|65535&f,h)}function s(a,c,d,e,f){var g,h,i;return g=(65535&a.b)+(65535&c.b)+(65535&d.b)+(65535&e.b)+(65535&f.b),h=(a.b>>>16)+(c.b>>>16)+(d.b>>>16)+(e.b>>>16)+(f.b>>>16)+(g>>>16),i=(65535&h)<<16|65535&g,g=(65535&a.a)+(65535&c.a)+(65535&d.a)+(65535&e.a)+(65535&f.a)+(h>>>16),h=(a.a>>>16)+(c.a>>>16)+(d.a>>>16)+(e.a>>>16)+(f.a>>>16)+(g>>>16),new b((65535&h)<<16|65535&g,i)}function t(c,d,e){var f,g,h,i,j,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q=[];for("SHA-384"===e||"SHA-512"===e?(y=80,f=(d+128>>>10<<5)+31,B=32,C=2,M=b,D=q,E=r,F=s,G=o,H=p,I=m,J=n,L=l,K=k,N=[new M(1116352408,3609767458),new M(1899447441,602891725),new M(3049323471,3964484399),new M(3921009573,2173295548),new M(961987163,4081628472),new M(1508970993,3053834265),new M(2453635748,2937671579),new M(2870763221,3664609560),new M(3624381080,2734883394),new M(310598401,1164996542),new M(607225278,1323610764),new M(1426881987,3590304994),new M(1925078388,4068182383),new M(2162078206,991336113),new M(2614888103,633803317),new M(3248222580,3479774868),new M(3835390401,2666613458),new M(4022224774,944711139),new M(264347078,2341262773),new M(604807628,2007800933),new M(770255983,1495990901),new M(1249150122,1856431235),new M(1555081692,3175218132),new M(1996064986,2198950837),new M(2554220882,3999719339),new M(2821834349,766784016),new M(2952996808,2566594879),new M(3210313671,3203337956),new M(3336571891,1034457026),new M(3584528711,2466948901),new M(113926993,3758326383),new M(338241895,168717936),new M(666307205,1188179964),new M(773529912,1546045734),new M(1294757372,1522805485),new M(1396182291,2643833823),new M(1695183700,2343527390),new M(1986661051,1014477480),new M(2177026350,1206759142),new M(2456956037,344077627),new M(2730485921,1290863460),new M(2820302411,3158454273),new M(3259730800,3505952657),new M(3345764771,106217008),new M(3516065817,3606008344),new M(3600352804,1432725776),new M(4094571909,1467031594),new M(275423344,851169720),new M(430227734,3100823752),new M(506948616,1363258195),new M(659060556,3750685593),new M(883997877,3785050280),new M(958139571,3318307427),new M(1322822218,3812723403),new M(1537002063,2003034995),new M(1747873779,3602036899),new M(1955562222,1575990012),new M(2024104815,1125592928),new M(2227730452,2716904306),new M(2361852424,442776044),new M(2428436474,593698344),new M(2756734187,3733110249),new M(3204031479,2999351573),new M(3329325298,3815920427),new M(3391569614,3928383900),new M(3515267271,566280711),new M(3940187606,3454069534),new M(4118630271,4000239992),new M(116418474,1914138554),new M(174292421,2731055270),new M(289380356,3203993006),new M(460393269,320620315),new M(685471733,587496836),new M(852142971,1086792851),new M(1017036298,365543100),new M(1126000580,2618297676),new M(1288033470,3409855158),new M(1501505948,4234509866),new M(1607167915,987167468),new M(1816402316,1246189591)],x="SHA-384"===e?[new M(3418070365,3238371032),new M(1654270250,914150663),new M(2438529370,812702999),new M(355462360,4144912697),new M(1731405415,4290775857),new M(41048885895,1750603025),new M(3675008525,1694076839),new M(1203062813,3204075428)]:[new M(1779033703,4089235720),new M(3144134277,2227873595),new M(1013904242,4271175723),new M(2773480762,1595750129),new M(1359893119,2917565137),new M(2600822924,725511199),new M(528734635,4215389547),new M(1541459225,327033209)]):a("Unexpected error in SHA-2 implementation"),c[d>>>5]|=128<<24-d%32,c[f]=d,O=c.length,z=0;O>z;z+=B){for(d=x[0],f=x[1],g=x[2],h=x[3],i=x[4],j=x[5],t=x[6],u=x[7],A=0;y>A;A+=1)Q[A]=16>A?new M(c[A*C+z],c[A*C+z+1]):E(H(Q[A-2]),Q[A-7],G(Q[A-15]),Q[A-16]),v=F(u,J(i),K(i,j,t),N[A],Q[A]),w=D(I(d),L(d,f,g)),u=t,t=j,j=i,i=D(h,v),h=g,g=f,f=d,d=D(v,w);x[0]=D(d,x[0]),x[1]=D(f,x[1]),x[2]=D(g,x[2]),x[3]=D(h,x[3]),x[4]=D(i,x[4]),x[5]=D(j,x[5]),x[6]=D(t,x[6]),x[7]=D(u,x[7])}return"SHA-384"===e?P=[x[0].a,x[0].b,x[1].a,x[1].b,x[2].a,x[2].b,x[3].a,x[3].b,x[4].a,x[4].b,x[5].a,x[5].b]:"SHA-512"===e?P=[x[0].a,x[0].b,x[1].a,x[1].b,x[2].a,x[2].b,x[3].a,x[3].b,x[4].a,x[4].b,x[5].a,x[5].b,x[6].a,x[6].b,x[7].a,x[7].b]:a("Unexpected error in SHA-2 implementation"),P}var u=null;window.jsSHA=function(b,i,j){var k=u,l=u,m=0,n=[0],o=0,p=u,o="undefined"!=typeof j?j:8;8===o||16===o||a("charSize must be 8 or 16"),"HEX"===i?(0!==b.length%2&&a("srcString of HEX type must be in byte increments"),p=d(b),m=p.binLen,n=p.value):"ASCII"===i||"TEXT"===i?(p=c(b,o),m=p.binLen,n=p.value):"B64"===i?(p=e(b),m=p.binLen,n=p.value):a("inputFormat must be HEX, TEXT, ASCII, or B64"),this.getHash=function(b,c,d){var e=u,i=n.slice(),j="";switch(c){case"HEX":e=f;break;case"B64":e=g;break;default:a("format must be HEX or B64")}return"SHA-384"===b?(u===k&&(k=t(i,m,b)),j=e(k,h(d))):"SHA-512"===b?(u===l&&(l=t(i,m,b)),j=e(l,h(d))):a("Chosen SHA variant is not supported"),j},this.getHMAC=function(b,i,j,k,l){var p,q,r,s,v,w=[],x=[],y=u;switch(k){case"HEX":p=f;break;case"B64":p=g;break;default:a("outputFormat must be HEX or B64")}for("SHA-384"===j?(r=128,v=384):"SHA-512"===j?(r=128,v=512):a("Chosen SHA variant is not supported"),"HEX"===i?(y=d(b),s=y.binLen,q=y.value):"ASCII"===i||"TEXT"===i?(y=c(b,o),s=y.binLen,q=y.value):"B64"===i?(y=e(b),s=y.binLen,q=y.value):a("inputFormat must be HEX, TEXT, ASCII, or B64"),b=8*r,i=r/4-1,s/8>r?(q=t(q,s,j),q[i]&=4294967040):r>s/8&&(q[i]&=4294967040),r=0;i>=r;r+=1)w[r]=909522486^q[r],x[r]=1549556828^q[r];return j=t(x.concat(t(w.concat(n),b+m,j)),b+v,j),p(j,h(l))}}}();var MAX_VALUE=2147483647;Bitcoin.scrypt=function(a,b,c,d,e,f){if(0==c||0!=(c&c-1))throw Error("N must be > 0 and a power of 2");if(c>MAX_VALUE/128/d)throw Error("Parameter N is too large");if(d>MAX_VALUE/128/e)throw Error("Parameter r is too large");var g,h={iterations:1,hasher:Crypto.SHA256,asBytes:!0},i=[],j=[],k=[],l=[],j=Crypto.PBKDF2(a,b,128*e*d,h);for(g=0;e>g;g++)smix(j,128*g*d,d,c,l,k);return i=Crypto.PBKDF2(a,j,f,h)},SecureRandom.prototype.clientSideRandomInit=function(){sjcl.random.startCollectors()},SecureRandom.prototype.nextBytes=function(a){for(var b=a.length,c=sjcl.random.randomWords(b),d=0;b>d;++d)c[d]<0&&(c[d]=-c[d]),a[d]=c[d]%256},Bitcoin.SecureRandom=SecureRandom;var dbits,canary=0xdeadbeefcafe,j_lm=15715070==(16777215&canary);j_lm&&"Microsoft Internet Explorer"==navigator.appName?(BigInteger.prototype.am=am2,dbits=30):j_lm&&"Netscape"!=navigator.appName?(BigInteger.prototype.am=am1,dbits=26):(BigInteger.prototype.am=am3,dbits=28),BigInteger.prototype.DB=dbits,BigInteger.prototype.DM=(1<<dbits)-1,BigInteger.prototype.DV=1<<dbits;var BI_FP=52;BigInteger.prototype.FV=Math.pow(2,BI_FP),BigInteger.prototype.F1=BI_FP-dbits,BigInteger.prototype.F2=2*dbits-BI_FP;var BI_RM="0123456789abcdefghijklmnopqrstuvwxyz",BI_RC=new Array,rr,vv;for(rr="0".charCodeAt(0),vv=0;9>=vv;++vv)BI_RC[rr++]=vv;for(rr="a".charCodeAt(0),vv=10;36>vv;++vv)BI_RC[rr++]=vv;for(rr="A".charCodeAt(0),vv=10;36>vv;++vv)BI_RC[rr++]=vv;Classic.prototype.convert=cConvert,Classic.prototype.revert=cRevert,Classic.prototype.reduce=cReduce,Classic.prototype.mulTo=cMulTo,Classic.prototype.sqrTo=cSqrTo,Montgomery.prototype.convert=montConvert,Montgomery.prototype.revert=montRevert,Montgomery.prototype.reduce=montReduce,Montgomery.prototype.mulTo=montMulTo,Montgomery.prototype.sqrTo=montSqrTo,BigInteger.prototype.copyTo=bnpCopyTo,BigInteger.prototype.fromInt=bnpFromInt,BigInteger.prototype.fromString=bnpFromString,BigInteger.prototype.clamp=bnpClamp,BigInteger.prototype.dlShiftTo=bnpDLShiftTo,BigInteger.prototype.drShiftTo=bnpDRShiftTo,BigInteger.prototype.lShiftTo=bnpLShiftTo,BigInteger.prototype.rShiftTo=bnpRShiftTo,BigInteger.prototype.subTo=bnpSubTo,BigInteger.prototype.multiplyTo=bnpMultiplyTo,BigInteger.prototype.squareTo=bnpSquareTo,BigInteger.prototype.divRemTo=bnpDivRemTo,BigInteger.prototype.invDigit=bnpInvDigit,BigInteger.prototype.isEven=bnpIsEven,BigInteger.prototype.exp=bnpExp,BigInteger.prototype.toString=bnToString,BigInteger.prototype.negate=bnNegate,BigInteger.prototype.abs=bnAbs,BigInteger.prototype.compareTo=bnCompareTo,BigInteger.prototype.bitLength=bnBitLength,BigInteger.prototype.mod=bnMod,BigInteger.prototype.modPowInt=bnModPowInt,BigInteger.ZERO=nbv(0),BigInteger.ONE=nbv(1),NullExp.prototype.convert=nNop,NullExp.prototype.revert=nNop,NullExp.prototype.mulTo=nMulTo,NullExp.prototype.sqrTo=nSqrTo,Barrett.prototype.convert=barrettConvert,Barrett.prototype.revert=barrettRevert,Barrett.prototype.reduce=barrettReduce,Barrett.prototype.mulTo=barrettMulTo,Barrett.prototype.sqrTo=barrettSqrTo;var lowprimes=[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],lplim=(1<<26)/lowprimes[lowprimes.length-1];BigInteger.prototype.chunkSize=bnpChunkSize,BigInteger.prototype.toRadix=bnpToRadix,BigInteger.prototype.fromRadix=bnpFromRadix,BigInteger.prototype.fromNumber=bnpFromNumber,BigInteger.prototype.bitwiseTo=bnpBitwiseTo,BigInteger.prototype.changeBit=bnpChangeBit,BigInteger.prototype.addTo=bnpAddTo,BigInteger.prototype.dMultiply=bnpDMultiply,BigInteger.prototype.dAddOffset=bnpDAddOffset,BigInteger.prototype.multiplyLowerTo=bnpMultiplyLowerTo,BigInteger.prototype.multiplyUpperTo=bnpMultiplyUpperTo,BigInteger.prototype.modInt=bnpModInt,BigInteger.prototype.millerRabin=bnpMillerRabin,BigInteger.prototype.clone=bnClone,BigInteger.prototype.intValue=bnIntValue,BigInteger.prototype.byteValue=bnByteValue,BigInteger.prototype.shortValue=bnShortValue,BigInteger.prototype.signum=bnSigNum,BigInteger.prototype.toByteArray=bnToByteArray,BigInteger.prototype.equals=bnEquals,BigInteger.prototype.min=bnMin,BigInteger.prototype.max=bnMax,BigInteger.prototype.and=bnAnd,BigInteger.prototype.or=bnOr,BigInteger.prototype.xor=bnXor,BigInteger.prototype.andNot=bnAndNot,BigInteger.prototype.not=bnNot,BigInteger.prototype.shiftLeft=bnShiftLeft,BigInteger.prototype.shiftRight=bnShiftRight,BigInteger.prototype.getLowestSetBit=bnGetLowestSetBit,BigInteger.prototype.bitCount=bnBitCount,BigInteger.prototype.testBit=bnTestBit,BigInteger.prototype.setBit=bnSetBit,BigInteger.prototype.clearBit=bnClearBit,BigInteger.prototype.flipBit=bnFlipBit,BigInteger.prototype.add=bnAdd,BigInteger.prototype.subtract=bnSubtract,BigInteger.prototype.multiply=bnMultiply,BigInteger.prototype.divide=bnDivide,BigInteger.prototype.remainder=bnRemainder,BigInteger.prototype.divideAndRemainder=bnDivideAndRemainder,BigInteger.prototype.modPow=bnModPow,BigInteger.prototype.modInverse=bnModInverse,BigInteger.prototype.pow=bnPow,BigInteger.prototype.gcd=bnGCD,BigInteger.prototype.isProbablePrime=bnIsProbablePrime,BigInteger.prototype.square=bnSquare,ECFieldElementFp.prototype.equals=feFpEquals,ECFieldElementFp.prototype.toBigInteger=feFpToBigInteger,ECFieldElementFp.prototype.negate=feFpNegate,ECFieldElementFp.prototype.add=feFpAdd,ECFieldElementFp.prototype.subtract=feFpSubtract,ECFieldElementFp.prototype.multiply=feFpMultiply,ECFieldElementFp.prototype.square=feFpSquare,ECFieldElementFp.prototype.divide=feFpDivide,ECPointFp.prototype.getX=pointFpGetX,ECPointFp.prototype.getY=pointFpGetY,ECPointFp.prototype.equals=pointFpEquals,ECPointFp.prototype.isInfinity=pointFpIsInfinity,ECPointFp.prototype.negate=pointFpNegate,ECPointFp.prototype.add=pointFpAdd,ECPointFp.prototype.twice=pointFpTwice,ECPointFp.prototype.multiply=pointFpMultiply,ECPointFp.prototype.multiplyTwo=pointFpMultiplyTwo,ECCurveFp.prototype.getQ=curveFpGetQ,ECCurveFp.prototype.getA=curveFpGetA,ECCurveFp.prototype.getB=curveFpGetB,ECCurveFp.prototype.equals=curveFpEquals,ECCurveFp.prototype.getInfinity=curveFpGetInfinity,ECCurveFp.prototype.fromBigInteger=curveFpFromBigInteger,ECCurveFp.prototype.decodePointHex=curveFpDecodePointHex,ECCurveFp.prototype.decompressPoint=curveFpDecompressPoint,X9ECParameters.prototype.getCurve=x9getCurve,X9ECParameters.prototype.getG=x9getG,X9ECParameters.prototype.getN=x9getN,X9ECParameters.prototype.getH=x9getH;var EventEmitter=function(){};EventEmitter.prototype.on=function(a,b,c){c||(c=this),this._listeners||(this._listeners={}),this._listeners[a]||(this._listeners[a]=[]),this._unbinders||(this._unbinders={}),this._unbinders[a]||(this._unbinders[a]=[]);var d=function(a){b.apply(c,[a])};this._unbinders[a].push(b),this._listeners[a].push(d)},EventEmitter.prototype.trigger=function(a,b){if(void 0===b&&(b={}),this._listeners||(this._listeners={}),this._listeners[a])for(var c=this._listeners[a].length;c--;)this._listeners[a][c](b)},EventEmitter.prototype.removeListener=function(a,b){if(this._unbinders||(this._unbinders={}),this._unbinders[a])for(var c=this._unbinders[a].length;c--;)this._unbinders[a][c]===b&&(this._unbinders[a].splice(c,1),this._listeners[a].splice(c,1))},EventEmitter.augment=function(a){for(var b in EventEmitter.prototype)a[b]||(a[b]=EventEmitter.prototype[b])},BigInteger.valueOf=nbv,BigInteger.prototype.toByteArrayUnsigned=function(){var a=this.abs().toByteArray();return a.length?(0==a[0]&&(a=a.slice(1)),a.map(function(a){return 0>a?a+256:a})):a},BigInteger.fromByteArrayUnsigned=function(a){return a.length?new BigInteger(128&a[0]?[0].concat(a):a):a.valueOf(0)},BigInteger.prototype.toByteArraySigned=function(){var a=this.abs().toByteArrayUnsigned(),b=this.compareTo(BigInteger.ZERO)<0;return b?128&a[0]?a.unshift(128):a[0]|=128:128&a[0]&&a.unshift(0),a},BigInteger.fromByteArraySigned=function(a){return 128&a[0]?(a[0]&=127,BigInteger.fromByteArrayUnsigned(a).negate()):BigInteger.fromByteArrayUnsigned(a)};var names=["log","debug","info","warn","error","assert","dir","dirxml","group","groupEnd","time","timeEnd","count","trace","profile","profileEnd"];"undefined"==typeof window.console&&(window.console={});for(var i=0;i<names.length;++i)"undefined"==typeof window.console[names[i]]&&(window.console[names[i]]=function(){});Bitcoin.Util={isArray:Array.isArray||function(a){return"[object Array]"===Object.prototype.toString.call(a)},makeFilledArray:function(a,b){for(var c=[],d=0;a>d;)c[d++]=b;return c},numToBytes:function(a,b){return void 0===b&&(b=8),0===b?[]:[a%256].concat(this.numToBytes(Math.floor(a/256),b-1))},bytesToNum:function(a){for(var b=0,c=1,d=0;d<a.length;++d)b+=a[d]*c,c*=256;return b},numToVarInt:function(a){if(253>a)return[a];if(65536>a)return[253,255&a,a>>>8];if(4294967296>a)return[254].concat(Crypto.util.wordsToBytes([a]).reverse());throw"long long not implemented"},hexToBytes:function(a){for(var b=[],c=0;c<a.length;c+=2){var d=parseInt(a.substr(c,2),16);if(isNaN(d))throw"illegal input";b.push(d)}return b},bytesToHex:function(a){for(var b=[],c=0;c<a.length;c++){if(a[c]>255)throw"illegal input";b.push((a[c]>>>4).toString(16)),b.push((15&a[c]).toString(16))}return b.join("")},valueToBigInt:function(a){return a instanceof BigInteger?a:BigInteger.fromByteArrayUnsigned(a)},formatValue:function(a){for(var b=this.valueToBigInt(a).toString(),c=b.length>8?b.substr(0,b.length-8):"0",d=b.length>8?b.substr(b.length-8):b;d.length<8;)d="0"+d;for(d=d.replace(/0*$/,"");d.length<2;)d+="0";return c+"."+d},parseValue:function(a){for(var b=a.split("."),c=b[0],d=b[1]||"0";d.length<8;)d+="0";d=d.replace(/^0+/g,"");var e=BigInteger.valueOf(parseInt(c));return e=e.multiply(BigInteger.valueOf(1e8)),e=e.add(BigInteger.valueOf(parseInt(d)))},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(a){a.Base58={alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",validRegex:/^[1-9A-HJ-NP-Za-km-z]+$/,base:BigInteger.valueOf(58),encode:function(a){if(!(a instanceof Array))throw"illegal argument";for(var c=BigInteger.fromByteArrayUnsigned(a),d=[];c.compareTo(b.base)>=0;){var e=c.mod(b.base);d.unshift(b.alphabet[e.intValue()]),c=c.subtract(e).divide(b.base)}d.unshift(b.alphabet[c.intValue()]);for(var f=0;f<a.length&&0==a[f];f++)d.unshift(b.alphabet[0]);return d.join("")},decode:function(a){if("string"!=typeof a)throw"illegal argument";for(var c=BigInteger.valueOf(0),d=0,e=a.length-1;e>=0;e--){
var f=b.alphabet.indexOf(a[e]);if(0>f)throw"Invalid character";c=c.add(BigInteger.valueOf(f).multiply(b.base.pow(a.length-1-e))),"1"==a[e]?d++:d=0}for(var g=c.toByteArrayUnsigned();d-->0;)g.unshift(0);return g},encodeFromString:function(a){if("string"!=typeof a)throw"input must be a string";for(var b=[],c=0;c<a.length;++c)b.push(a.charCodeAt(c));return this.encode(b)},decodeToString:function(a){if("string"!=typeof a)throw"input must be a string";for(var b="",c=this.decode(a),d=0;d<c.length;++d)b+=String.fromCharCode(parseInt(c[d],10));return b}};var b=a.Base58}("undefined"!=typeof Bitcoin?Bitcoin:module.exports);var MAINNET_PUBLIC=76067358,MAINNET_PRIVATE=76066276,TESTNET_PUBLIC=70617039,TESTNET_PRIVATE=70615956,BIP32=function(a){if("string"==typeof a){var b=Bitcoin.Base58.decode(a);if(82!=b.length)throw new Error("Not enough data");var c=b.slice(78,82);a=b.slice(0,78);var d=Crypto.SHA256(Crypto.SHA256(a,{asBytes:!0}),{asBytes:!0});if(d[0]!=c[0]||d[1]!=c[1]||d[2]!=c[2]||d[3]!=c[3])throw new Error("Invalid checksum");this.init_from_bytes(a)}};BIP32.prototype.initFromBadXprv=function(a){var b=Bitcoin.Base58.decode(a),c=b.length,d=b.slice(c-4,c);bytes=b.slice(0,c-4);var e=Crypto.SHA256(Crypto.SHA256(bytes,{asBytes:!0}),{asBytes:!0});if(e[0]!=d[0]||e[1]!=d[1]||e[2]!=d[2]||e[3]!=d[3])throw new Error("Invalid checksum");return this.init_from_bad_bytes(bytes),this},BIP32.prototype.initFromSeed=function(a){var b=new jsSHA(a,"HEX"),c=b.getHMAC("Bitcoin seed","TEXT","SHA-512","HEX");c=Crypto.util.hexToBytes(c);var d=c.slice(0,32),e=c.slice(32,64);return this.version=MAINNET_PRIVATE,this.depth=0,this.parent_fingerprint=[0,0,0,0],this.child_index=0,this.chain_code=e,this.eckey=new Bitcoin.ECKey(d),this.eckey.setCompressed(!0),this.extended_public_key=void 0,this.extended_private_key=void 0,this.has_private_key=!0,this.build_extended_public_key(),this.build_extended_private_key(),this},BIP32.prototype.init_from_bytes=function(a){function b(a,b){if(a.length<b)throw new Error("not enough data");for(var c=0,d=0;b>d;d++)c*=256,c+=a[d];return c}function c(a){return b(a,1)}function d(a){return b(a,4)}function e(a){var b=getSECCurveByName("secp256k1");return b.getCurve().decodePointHex(Crypto.util.bytesToHex(a))}if(78!=a.length)throw new Error("expected 78 bytes of data");this.version=d(a.slice(0,4)),this.depth=c(a.slice(4,5)),this.parent_fingerprint=a.slice(5,9),this.child_index=d(a.slice(9,13)),this.chain_code=a.slice(13,45);var f=a.slice(45,78);if(this.version!=MAINNET_PRIVATE&&this.version!=TESTNET_PRIVATE||0!=f[0]){if(this.version!=MAINNET_PUBLIC&&this.version!=TESTNET_PUBLIC||2!=f[0]&&3!=f[0])throw new Error("Invalid key");this.eckey=new Bitcoin.ECKey("0"),this.eckey.pubPoint=e(f),this.eckey.setCompressed(!0),this.has_private_key=!1}else this.eckey=new Bitcoin.ECKey(f.slice(1,33)),this.eckey.setCompressed(!0),this.has_private_key=!0;this.build_extended_public_key(),this.build_extended_private_key()},BIP32.prototype.init_from_bad_bytes=function(a){function b(a,b){if(a.length<b)throw new Error("not enough data");for(var c=0,d=0;b>d;d++)c*=256,c+=a[d];return c}function c(a){return b(a,1)}function d(a){return b(a,4)}function e(a){var b=getSECCurveByName("secp256k1");return b.getCurve().decodePointHex(Crypto.util.bytesToHex(a))}this.version=d(a.slice(0,4)),this.depth=c(a.slice(4,5)),this.parent_fingerprint=a.slice(5,9),this.child_index=d(a.slice(9,13)),this.chain_code=a.slice(13,45);for(var f=a.slice(45);f.length<32;)f.unshift(0);if(this.version!=MAINNET_PRIVATE&&this.version!=TESTNET_PRIVATE||0!=f[0]){if(this.version!=MAINNET_PUBLIC&&this.version!=TESTNET_PUBLIC||2!=f[0]&&3!=f[0])throw new Error("Invalid key");this.eckey=new Bitcoin.ECKey("0"),this.eckey.pubPoint=e(f),this.eckey.setCompressed(!0),this.has_private_key=!1}else this.eckey=new Bitcoin.ECKey(f.slice(1,33)),this.eckey.setCompressed(!0),this.has_private_key=!0;this.build_extended_public_key(),this.build_extended_private_key()},BIP32.prototype.build_extended_public_key=function(){this.extended_public_key=[];var a=MAINNET_PUBLIC;(this.version==TESTNET_PUBLIC||this.version==TESTNET_PRIVATE)&&(a=TESTNET_PUBLIC),this.extended_public_key.push(a>>24),this.extended_public_key.push(a>>16&255),this.extended_public_key.push(a>>8&255),this.extended_public_key.push(255&a),this.extended_public_key.push(this.depth),this.extended_public_key=this.extended_public_key.concat(this.parent_fingerprint),this.extended_public_key.push(this.child_index>>>24),this.extended_public_key.push(this.child_index>>>16&255),this.extended_public_key.push(this.child_index>>>8&255),this.extended_public_key.push(255&this.child_index),this.extended_public_key=this.extended_public_key.concat(this.chain_code),this.extended_public_key=this.extended_public_key.concat(this.eckey.getPub())},BIP32.prototype.extended_public_key_string=function(a){if(void 0===a||"base58"===a){var b=Crypto.SHA256(Crypto.SHA256(this.extended_public_key,{asBytes:!0}),{asBytes:!0}),c=b.slice(0,4),d=this.extended_public_key.concat(c);return Bitcoin.Base58.encode(d)}if("hex"===a)return Crypto.util.bytesToHex(this.extended_public_key);throw new Error("bad format")},BIP32.prototype.build_extended_private_key=function(){if(this.has_private_key){this.extended_private_key=[];var a=MAINNET_PRIVATE;(this.version==TESTNET_PUBLIC||this.version==TESTNET_PRIVATE)&&(a=TESTNET_PRIVATE),this.extended_private_key.push(a>>24),this.extended_private_key.push(a>>16&255),this.extended_private_key.push(a>>8&255),this.extended_private_key.push(255&a),this.extended_private_key.push(this.depth),this.extended_private_key=this.extended_private_key.concat(this.parent_fingerprint),this.extended_private_key.push(this.child_index>>>24),this.extended_private_key.push(this.child_index>>>16&255),this.extended_private_key.push(this.child_index>>>8&255),this.extended_private_key.push(255&this.child_index),this.extended_private_key=this.extended_private_key.concat(this.chain_code),this.extended_private_key.push(0);for(var b=this.eckey.priv.toByteArrayUnsigned();b.length<32;)b.unshift(0);this.extended_private_key=this.extended_private_key.concat(b)}},BIP32.prototype.extended_private_key_string=function(a){if(!this.has_private_key)throw"no private key";if(void 0===a||"base58"===a){var b=Crypto.SHA256(Crypto.SHA256(this.extended_private_key,{asBytes:!0}),{asBytes:!0}),c=b.slice(0,4),d=this.extended_private_key.concat(c);return Bitcoin.Base58.encode(d)}if("hex"===a)return Crypto.util.bytesToHex(this.extended_private_key);throw new Error("bad format")},BIP32.prototype.derive=function(a){var b=a.split("/"),c=this;for(var d in b)if(b.hasOwnProperty(d)){var e=b[d];if(0!=d){var f=e.length>1&&"'"==e[e.length-1],g=parseInt(f?e.slice(0,e.length-1):e);if(e>=2147483648)throw"index too large";f&&(g|=2147483648),c=c.derive_child(g)}else if("m"!=e)throw new Error("invalid path")}return c},BIP32.prototype.derive_child=function(a){var b=[];b.push(a>>24&255),b.push(a>>16&255),b.push(a>>8&255),b.push(255&a);var c=0!=(2147483648&a),d=getSECCurveByName("secp256k1");if(c&&(!this.has_private_key||this.version!=MAINNET_PRIVATE&&this.version!=TESTNET_PRIVATE))throw new Error("Cannot do private key derivation without private key");var e=null;if(this.has_private_key){var f=null;f=c?[0].concat(this.eckey.priv.toByteArrayUnsigned()).concat(b):this.eckey.getPub().concat(b);var g=new jsSHA(Crypto.util.bytesToHex(f),"HEX"),h=g.getHMAC(Crypto.util.bytesToHex(this.chain_code),"HEX","SHA-512","HEX"),i=new BigInteger(h.slice(0,64),16),j=Crypto.util.hexToBytes(h.slice(64,128)),k=(d.getCurve(),i.add(this.eckey.priv).mod(d.getN()));e=new BIP32,e.chain_code=j,e.eckey=new Bitcoin.ECKey(k.toByteArrayUnsigned()),e.has_private_key=!0}else{var f=this.eckey.getPub().concat(b),g=new jsSHA(Crypto.util.bytesToHex(f),"HEX"),h=g.getHMAC(Crypto.util.bytesToHex(this.chain_code),"HEX","SHA-512","HEX"),i=new BigInteger(h.slice(0,64),16),j=Crypto.util.hexToBytes(h.slice(64,128)),k=d.getG().multiply(i).add(this.eckey.getPubPoint());e=new BIP32,e.chain_code=j,e.eckey=new Bitcoin.ECKey("0"),e.eckey.setPub(k.getEncoded(!0)),e.has_private_key=!1}return e.child_index=a,e.parent_fingerprint=this.eckey.getPubKeyHash().slice(0,4),e.version=this.version,e.depth=this.depth+1,e.eckey.setCompressed(!0),e.build_extended_public_key(),e.build_extended_private_key(),e},Bitcoin.BIP32=BIP32,function(){var a=Bitcoin.Address=function(a,b){if("string"==typeof a)return this.fromString(a),this;if(a instanceof Bitcoin.ECKey&&(a=a.getPubKeyHash()),!(a instanceof Array))throw"can't convert to address";this.hash=a,this.version=b||Bitcoin.Address.pubKeyHashVersion};a.prototype.toString=function(){var a=this.hash.slice(0);a.unshift(this.version);var b=Crypto.SHA256(Crypto.SHA256(a,{asBytes:!0}),{asBytes:!0}),c=a.concat(b.slice(0,4));return Bitcoin.Base58.encode(c)},a.prototype.getHashBase64=function(){return Crypto.util.bytesToBase64(this.hash)},a.decodeString=function(a){throw"Bitcoin.Address.decodeString is depricated"},a.prototype.fromString=function(a){var b=Bitcoin.Base58.decode(a),c=b.slice(0,21),d=Crypto.SHA256(Crypto.SHA256(c,{asBytes:!0}),{asBytes:!0});if(d[0]!=b[21]||d[1]!=b[22]||d[2]!=b[23]||d[3]!=b[24])throw"Checksum validation failed!";if(this.version=c.shift(),this.hash=c,this.version!=Bitcoin.Address.pubKeyHashVersion&&this.version!=Bitcoin.Address.p2shVersion)throw"Version "+this.version+" not supported!"},a.createMultiSigAddress=function(a,b){if(0>=b||b>a.length||b>16)throw"invalid number of keys required";for(var c=0;c<a.length;++c)if("[object Array]"!=Object.prototype.toString.call(a[c]))throw"pub keys are not of right type";var d=Bitcoin.Script.createMultiSigScript(b,a),e=d.buffer,f=Bitcoin.Util.sha256ripe160(e),g=new Bitcoin.Address(f);return g.redeemScript=e,g.version=Bitcoin.Address.p2shVersion,g},a.prototype.isP2SHAddress=function(){return this.version==Bitcoin.Address.p2shVersion},a.prototype.isPubKeyHashAddress=function(){return this.version==Bitcoin.Address.pubKeyHashVersion},a.validate=function(a){try{new Bitcoin.Address(a)}catch(b){return!1}return!0},a.fromPubKey=function(a){return new Bitcoin.Address(Bitcoin.Util.sha256ripe160(a))}}(),ECFieldElementFp.prototype.getByteLength=function(){return Math.floor((this.toBigInteger().bitLength()+7)/8)},ECPointFp.prototype.getEncoded=function(a){var b=this.getX().toBigInteger(),c=this.getY().toBigInteger(),d=integerToBytes(b,32);return a?c.isEven()?d.unshift(2):d.unshift(3):(d.unshift(4),d=d.concat(integerToBytes(c,32))),d},ECPointFp.decodeFrom=function(a,b){var c=(b[0],b.length-1),d=b.slice(1,1+c/2),e=b.slice(1+c/2,1+c);d.unshift(0),e.unshift(0);var f=new BigInteger(d),g=new BigInteger(e);return new ECPointFp(a,a.fromBigInteger(f),a.fromBigInteger(g))},ECPointFp.prototype.add2D=function(a){if(this.isInfinity())return a;if(a.isInfinity())return this;if(this.x.equals(a.x))return this.y.equals(a.y)?this.twice():this.curve.getInfinity();var b=a.x.subtract(this.x),c=a.y.subtract(this.y),d=c.divide(b),e=d.square().subtract(this.x).subtract(a.x),f=d.multiply(this.x.subtract(e)).subtract(this.y);return new ECPointFp(this.curve,e,f)},ECPointFp.prototype.twice2D=function(){if(this.isInfinity())return this;if(0==this.y.toBigInteger().signum())return this.curve.getInfinity();var a=this.curve.fromBigInteger(BigInteger.valueOf(2)),b=this.curve.fromBigInteger(BigInteger.valueOf(3)),c=this.x.square().multiply(b).add(this.curve.a).divide(this.y.multiply(a)),d=c.square().subtract(this.x.multiply(a)),e=c.multiply(this.x.subtract(d)).subtract(this.y);return new ECPointFp(this.curve,d,e)},ECPointFp.prototype.multiply2D=function(a){if(this.isInfinity())return this;if(0==a.signum())return this.curve.getInfinity();var b,c=a,d=c.multiply(new BigInteger("3")),e=this.negate(),f=this;for(b=d.bitLength()-2;b>0;--b){f=f.twice();var g=d.testBit(b),h=c.testBit(b);g!=h&&(f=f.add2D(g?this:e))}return f},ECPointFp.prototype.isOnCurve=function(){var a=this.getX().toBigInteger(),b=this.getY().toBigInteger(),c=this.curve.getA().toBigInteger(),d=this.curve.getB().toBigInteger(),e=this.curve.getQ(),f=b.multiply(b).mod(e),g=a.multiply(a).multiply(a).add(c.multiply(a)).add(d).mod(e);return f.equals(g)},ECPointFp.prototype.toString=function(){return"("+this.getX().toBigInteger().toString()+","+this.getY().toBigInteger().toString()+")"},ECPointFp.prototype.validate=function(){var a=this.curve.getQ();if(this.isInfinity())throw new Error("Point is at infinity.");var b=this.getX().toBigInteger(),c=this.getY().toBigInteger();if(b.compareTo(BigInteger.ONE)<0||b.compareTo(a.subtract(BigInteger.ONE))>0)throw new Error("x coordinate out of bounds");if(c.compareTo(BigInteger.ONE)<0||c.compareTo(a.subtract(BigInteger.ONE))>0)throw new Error("y coordinate out of bounds");if(!this.isOnCurve())throw new Error("Point is not on the curve.");if(this.multiply(a).isInfinity())throw new Error("Point is not a scalar multiple of G.");return!0},Bitcoin.ECDSA=function(){function a(a,b,c,d){for(var e=Math.max(b.bitLength(),d.bitLength()),f=a.add2D(c),g=a.curve.getInfinity(),h=e-1;h>=0;--h)g=g.twice2D(),g.z=BigInteger.ONE,b.testBit(h)?g=d.testBit(h)?g.add2D(f):g.add2D(a):d.testBit(h)&&(g=g.add2D(c));return g}var b=getSECCurveByName("secp256k1"),c=new SecureRandom,d=null,e={getBigRandom:function(a){return new BigInteger(a.bitLength(),c).mod(a.subtract(BigInteger.ONE)).add(BigInteger.ONE)},sign:function(a,c){var d=c,f=b.getN(),g=BigInteger.fromByteArrayUnsigned(a);do var h=e.getBigRandom(f),i=b.getG(),j=i.multiply(h),k=j.getX().toBigInteger().mod(f);while(k.compareTo(BigInteger.ZERO)<=0);var l=h.modInverse(f).multiply(g.add(d.multiply(k))).mod(f);return e.serializeSig(k,l)},verify:function(a,c,d){var f,g;if(Bitcoin.Util.isArray(c)){var h=e.parseSig(c);f=h.r,g=h.s}else{if("object"!=typeof c||!c.r||!c.s)throw"Invalid value for signature";f=c.r,g=c.s}var i;if(d instanceof ECPointFp)i=d;else{if(!Bitcoin.Util.isArray(d))throw"Invalid format for pubkey value, must be byte array or ECPointFp";i=ECPointFp.decodeFrom(b.getCurve(),d)}var j=BigInteger.fromByteArrayUnsigned(a);return e.verifyRaw(j,f,g,i)},verifyRaw:function(a,c,d,e){var f=b.getN(),g=b.getG();if(c.compareTo(BigInteger.ONE)<0||c.compareTo(f)>=0)return!1;if(d.compareTo(BigInteger.ONE)<0||d.compareTo(f)>=0)return!1;var h=d.modInverse(f),i=a.multiply(h).mod(f),j=c.multiply(h).mod(f),k=g.multiply(i).add(e.multiply(j)),l=k.getX().toBigInteger().mod(f);return l.equals(c)},serializeSig:function(a,b){var c=a.toByteArraySigned(),d=b.toByteArraySigned(),e=[];return e.push(2),e.push(c.length),e=e.concat(c),e.push(2),e.push(d.length),e=e.concat(d),e.unshift(e.length),e.unshift(48),e},parseSig:function(a){var b;if(48!=a[0])throw new Error("Signature not a valid DERSequence");if(b=2,2!=a[b])throw new Error("First element in signature must be a DERInteger");var c=a.slice(b+2,b+2+a[b+1]);if(b+=2+a[b+1],2!=a[b])throw new Error("Second element in signature must be a DERInteger");var d=a.slice(b+2,b+2+a[b+1]);b+=2+a[b+1];var e=BigInteger.fromByteArrayUnsigned(c),f=BigInteger.fromByteArrayUnsigned(d);return{r:e,s:f}},parseSigCompact:function(a){if(65!==a.length)throw"Signature has the wrong length";var c=a[0]-27;if(0>c||c>7)throw"Invalid signature type";var d=b.getN(),e=BigInteger.fromByteArrayUnsigned(a.slice(1,33)).mod(d),f=BigInteger.fromByteArrayUnsigned(a.slice(33,65)).mod(d);return{r:e,s:f,i:c}},recoverPubKey:function(c,f,g,h){h=3&h;var i=1&h,j=h>>1,k=b.getN(),l=b.getG(),m=b.getCurve(),n=m.getQ(),o=m.getA().toBigInteger(),p=m.getB().toBigInteger();d||(d=n.add(BigInteger.ONE).divide(BigInteger.valueOf(4)));var q=j?c.add(k):c,r=q.multiply(q).multiply(q).add(o.multiply(q)).add(p).mod(n),s=r.modPow(d,n),t=(s.isEven()?h%2:(h+1)%2,(s.isEven()?!i:i)?s:n.subtract(s)),u=new ECPointFp(m,m.fromBigInteger(q),m.fromBigInteger(t));u.validate();var v=BigInteger.fromByteArrayUnsigned(g),w=BigInteger.ZERO.subtract(v).mod(k),x=c.modInverse(k),y=a(u,f,l,w).multiply(x);if(y.validate(),!e.verifyRaw(v,c,f,y))throw"Pubkey recovery unsuccessful";var z=new Bitcoin.ECKey;return z.setPub(y.getEncoded()),z},calcPubkeyRecoveryParam:function(a,b,c,d){for(var e=0;4>e;e++)try{var f=Bitcoin.ECDSA.recoverPubKey(b,c,d,e);if(f.getBitcoinAddress().toString()==a)return e}catch(g){}throw"Unable to find valid recovery factor"}};return e}(),Bitcoin.ECKey=function(){var a=Bitcoin.ECDSA,b=getSECCurveByName("secp256k1"),c=(new SecureRandom,function(d){if(d){if(d instanceof BigInteger)this.priv=d;else if(Bitcoin.Util.isArray(d))this.priv=BigInteger.fromByteArrayUnsigned(d);else if("string"==typeof d){var e=null;c.isWalletImportFormat(d)?e=c.decodeWalletImportFormat(d):c.isCompressedWalletImportFormat(d)?(e=c.decodeCompressedWalletImportFormat(d),this.compressed=!0):c.isMiniFormat(d)?e=Crypto.SHA256(d,{asBytes:!0}):c.isHexFormat(d)?e=Crypto.util.hexToBytes(d):c.isBase64Format(d)&&(e=Crypto.util.base64ToBytes(d)),null==e||32!=e.length?this.priv=null:this.priv=BigInteger.fromByteArrayUnsigned(e)}}else{var f=b.getN();this.priv=a.getBigRandom(f)}this.compressed=void 0==this.compressed?!!c.compressByDefault:this.compressed});return c.privateKeyPrefix=128,c.compressByDefault=!1,c.prototype.setCompressed=function(a){return this.compressed=!!a,this.pubPoint&&(this.pubPoint.compressed=this.compressed),this},c.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)},c.prototype.getPubPoint=function(){return this.pubPoint||(this.pubPoint=b.getG().multiply(this.priv),this.pubPoint.compressed=this.compressed),this.pubPoint},c.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()},c.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())},c.prototype.getBitcoinAddress=function(){var a=this.getPubKeyHash(),b=new Bitcoin.Address(a);return b},c.createPubKeyFromChain=function(a,c){if(!Bitcoin.Util.isArray(c))throw"chaincode must be a byte array";for(var d=Crypto.SHA256(Crypto.SHA256(a,{asBytes:!0}),{asBytes:!0}),e=0;32>e;e++)d[e]^=c[e];var f=BigInteger.fromByteArrayUnsigned(d),g=ECPointFp.decodeFrom(b.getCurve(),a).multiply(f),h=g.getEncoded();return h},c.createECKeyFromChain=function(a,d){if(!Bitcoin.Util.isArray(d))throw"chaincode must be a byte array";var e;e=a instanceof c?a:new c(a);var a=e.priv,f=e.compressed;f&&e.setCompressed(!1);var g=e.getPub();f&&e.setCompressed(!0);for(var h=Crypto.SHA256(Crypto.SHA256(g,{asBytes:!0}),{asBytes:!0}),i=0;32>i;i++)h[i]^=d[i];var j=BigInteger.fromByteArrayUnsigned(h),k=BigInteger.fromByteArrayUnsigned(a),l=b.getN(),m=j.multiply(k).mod(l),n=(b.getG().multiply(m),m?m.toByteArrayUnsigned():[]);return new c(n)},c.prototype.setPub=function(a){Bitcoin.Util.isArray(a)&&(a=Crypto.util.bytesToHex(a).toString().toUpperCase());var c=b.getCurve().decodePointHex(a);return this.setCompressed(c.compressed),this.pubPoint=c,this},c.prototype.getWalletImportFormat=function(){var a=this.getPrivateKeyByteArray();a.unshift(c.privateKeyPrefix),this.compressed&&a.push(1);var b=Bitcoin.Util.dsha256(a);a=a.concat(b.slice(0,4));var d=Bitcoin.Base58.encode(a);return d},c.prototype.getEncryptedFormat=function(a){return Bitcoin.BIP38.encode(this,a)},c.prototype.getHexFormat=function(){return Crypto.util.bytesToHex(this.getPrivateKeyByteArray()).toString().toUpperCase()},c.prototype.getBase64Format=function(){return Crypto.util.bytesToBase64(this.getPrivateKeyByteArray())},c.prototype.getPrivateKeyByteArray=function(){for(var a=this.priv.toByteArrayUnsigned();a.length<32;)a.unshift(0);return a},c.prototype.toString=function(a){return a=a||"","base64"==a.toString().toLowerCase()||"b64"==a.toString().toLowerCase()?this.getBase64Format():"wif"==a.toString().toLowerCase()?this.getWalletImportFormat():this.getHexFormat()},c.prototype.sign=function(b){return a.sign(b,this.priv)},c.prototype.verify=function(b,c){return a.verify(b,c,this.getPubPoint())},c.decodeWalletImportFormat=function(a){var b=Bitcoin.Base58.decode(a),d=b.slice(0,33),e=Bitcoin.Util.dsha256(d);if(e[0]!=b[33]||e[1]!=b[34]||e[2]!=b[35]||e[3]!=b[36])throw"Checksum validation failed!";var f=d.shift();if(f!=c.privateKeyPrefix)throw"Version "+f+" not supported!";return d},c.decodeCompressedWalletImportFormat=function(a){var b=Bitcoin.Base58.decode(a),d=b.slice(0,34),e=Bitcoin.Util.dsha256(d);if(e[0]!=b[34]||e[1]!=b[35]||e[2]!=b[36]||e[3]!=b[37])throw"Checksum validation failed!";var f=d.shift();if(f!=c.privateKeyPrefix)throw"Version "+f+" not supported!";return d.pop(),d},c.decodeEncryptedFormat=function(a,b){return Bitcoin.BIP38.decode(a,b)},c.isHexFormat=function(a){return a=a.toString(),/^[A-Fa-f0-9]{64}$/.test(a)},c.isWalletImportFormat=function(a){return a=a.toString(),128==c.privateKeyPrefix?/^5[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{50}$/.test(a):/^9[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{50}$/.test(a)},c.isCompressedWalletImportFormat=function(a){return a=a.toString(),c.privateKeyPrefix==c.privateKeyPrefix?/^[LK][123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{51}$/.test(a):/^c[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{51}$/.test(a)},c.isBase64Format=function(a){return a=a.toString(),/^[ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789=+\/]{44}$/.test(a)},c.isMiniFormat=function(a){a=a.toString();var b=/^S[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21}$/.test(a),c=/^S[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{25}$/.test(a),d=/^S[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{29}$/.test(a),e=Crypto.SHA256(a+"?",{asBytes:!0});return(0===e[0]||1===e[0])&&(b||c||d)},c.isBIP38Format=function(a){return Bitcoin.BIP38.isBIP38Format(a)},c}(),function(){var a=Bitcoin.Opcode=function(a){this.code=a};a.prototype.toString=function(){return a.reverseMap[this.code]},a.map={OP_0:0,OP_FALSE:0,OP_PUSHDATA1:76,OP_PUSHDATA2:77,OP_PUSHDATA4:78,OP_1NEGATE:79,OP_RESERVED:80,OP_1:81,OP_TRUE:81,OP_2:82,OP_3:83,OP_4:84,OP_5:85,OP_6:86,OP_7:87,OP_8:88,OP_9:89,OP_10:90,OP_11:91,OP_12:92,OP_13:93,OP_14:94,OP_15:95,OP_16:96,OP_NOP:97,OP_VER:98,OP_IF:99,OP_NOTIF:100,OP_VERIF:101,OP_VERNOTIF:102,OP_ELSE:103,OP_ENDIF:104,OP_VERIFY:105,OP_RETURN:106,OP_TOALTSTACK:107,OP_FROMALTSTACK:108,OP_2DROP:109,OP_2DUP:110,OP_3DUP:111,OP_2OVER:112,OP_2ROT:113,OP_2SWAP:114,OP_IFDUP:115,OP_DEPTH:116,OP_DROP:117,OP_DUP:118,OP_NIP:119,OP_OVER:120,OP_PICK:121,OP_ROLL:122,OP_ROT:123,OP_SWAP:124,OP_TUCK:125,OP_CAT:126,OP_SUBSTR:127,OP_LEFT:128,OP_RIGHT:129,OP_SIZE:130,OP_INVERT:131,OP_AND:132,OP_OR:133,OP_XOR:134,OP_EQUAL:135,OP_EQUALVERIFY:136,OP_RESERVED1:137,OP_RESERVED2:138,OP_1ADD:139,OP_1SUB:140,OP_2MUL:141,OP_2DIV:142,OP_NEGATE:143,OP_ABS:144,OP_NOT:145,OP_0NOTEQUAL:146,OP_ADD:147,OP_SUB:148,OP_MUL:149,OP_DIV:150,OP_MOD:151,OP_LSHIFT:152,OP_RSHIFT:153,OP_BOOLAND:154,OP_BOOLOR:155,OP_NUMEQUAL:156,OP_NUMEQUALVERIFY:157,OP_NUMNOTEQUAL:158,OP_LESSTHAN:159,OP_GREATERTHAN:160,OP_LESSTHANOREQUAL:161,OP_GREATERTHANOREQUAL:162,OP_MIN:163,OP_MAX:164,OP_WITHIN:165,OP_RIPEMD160:166,OP_SHA1:167,OP_SHA256:168,OP_HASH160:169,OP_HASH256:170,OP_CODESEPARATOR:171,OP_CHECKSIG:172,OP_CHECKSIGVERIFY:173,OP_CHECKMULTISIG:174,OP_CHECKMULTISIGVERIFY:175,OP_NOP1:176,OP_NOP2:177,OP_NOP3:178,OP_NOP4:179,OP_NOP5:180,OP_NOP6:181,OP_NOP7:182,OP_NOP8:183,OP_NOP9:184,OP_NOP10:185,OP_PUBKEYHASH:253,OP_PUBKEY:254,OP_INVALIDOPCODE:255},a.reverseMap=[];for(var b in a.map)a.reverseMap[a.map[b]]=b}(),function(){var a=Bitcoin.Opcode.map,b=Bitcoin.Script=function(a){if(a)if("string"==typeof a)this.buffer=Crypto.util.hexToBytes(a);else if(Bitcoin.Util.isArray(a))this.buffer=a;else{if(!(a instanceof b))throw new Error("Invalid script");this.buffer=a.buffer}else this.buffer=[];this.parse()};b.prototype.parse=function(){function b(a){c.chunks.push(c.buffer.slice(d,d+a)),d+=a}var c=this;this.chunks=[];for(var d=0;d<this.buffer.length;){var e=this.buffer[d++];e>=240&&(e=e<<8|this.buffer[d++]);var f;e>0&&e<a.OP_PUSHDATA1?b(e):e==a.OP_PUSHDATA1?(f=this.buffer[d++],b(f)):e==a.OP_PUSHDATA2?(f=this.buffer[d++]<<8|this.buffer[d++],b(f)):e==a.OP_PUSHDATA4?(f=this.buffer[d++]<<24|this.buffer[d++]<<16|this.buffer[d++]<<8|this.buffer[d++],b(f)):this.chunks.push(e)}},b.prototype.getOutType=function(){return this.chunks[this.chunks.length-1]==a.OP_CHECKMULTISIG&&this.chunks[this.chunks.length-2]<=a.OP_1+2?"Multisig":5==this.chunks.length&&this.chunks[0]==a.OP_DUP&&this.chunks[1]==a.OP_HASH160&&this.chunks[3]==a.OP_EQUALVERIFY&&this.chunks[4]==a.OP_CHECKSIG?"Address":3==this.chunks.length&&this.chunks[0]==a.OP_HASH160&&this.chunks[2]==a.OP_EQUAL?"P2SH":2==this.chunks.length&&this.chunks[1]==a.OP_CHECKSIG?"Pubkey":"Strange"},b.prototype.simpleOutHash=function(){switch(this.getOutType()){case"Address":return this.chunks[2];case"Pubkey":return Bitcoin.Util.sha256ripe160(this.chunks[0]);case"P2SH":return this.chunks[1];default:throw new Error("Encountered non-standard scriptPubKey")}},b.prototype.simpleOutPubKeyHash=b.prototype.simpleOutHash,b.prototype.getInType=function(){var b=this.chunks;return 1==b.length&&Bitcoin.Util.isArray(b[0])?"Pubkey":2==b.length&&Bitcoin.Util.isArray(b[0])&&Bitcoin.Util.isArray(b[1])?"Address":b[0]==a.OP_0&&b.slice(1).reduce(function(c,d,e){return c&&(d==a.OP_0||Array.isArray(d)&&(48==d[0]||e==b.length-2))},!0)?"Multisig":"Strange"},b.prototype.simpleInPubKey=function(){switch(this.getInType()){case"Address":return this.chunks[1];case"Pubkey":throw new Error("Script does not contain pubkey.");default:throw new Error("Encountered non-standard scriptSig")}},b.prototype.simpleInHash=function(){return Bitcoin.Util.sha256ripe160(this.simpleInPubKey())},b.prototype.simpleInPubKeyHash=b.prototype.simpleInHash,b.prototype.writeOp=function(a){this.buffer.push(a),this.chunks.push(a)},b.prototype.writeBytes=function(b){b.length<a.OP_PUSHDATA1?this.buffer.push(b.length):b.length<=255?(this.buffer.push(a.OP_PUSHDATA1),this.buffer.push(b.length)):b.length<=65535?(this.buffer.push(a.OP_PUSHDATA2),this.buffer.push(255&b.length),this.buffer.push(b.length>>>8&255)):(this.buffer.push(a.OP_PUSHDATA4),this.buffer.push(255&b.length),this.buffer.push(b.length>>>8&255),this.buffer.push(b.length>>>16&255),this.buffer.push(b.length>>>24&255)),this.buffer=this.buffer.concat(b),this.chunks.push(b)},b.createOutputScript=function(b){if(!(b instanceof Bitcoin.Address))throw"invalid argument";var c=new Bitcoin.Script;if(b.version==Bitcoin.Address.pubKeyHashVersion)c.writeOp(a.OP_DUP),c.writeOp(a.OP_HASH160),c.writeBytes(b.hash),c.writeOp(a.OP_EQUALVERIFY),c.writeOp(a.OP_CHECKSIG);else{if(b.version!=Bitcoin.Address.p2shVersion)throw"Unknown address version";c.writeOp(a.OP_HASH160),c.writeBytes(b.hash),c.writeOp(a.OP_EQUAL)}return c},b.prototype.extractAddresses=function(a){switch(this.getOutType()){case"Address":return a.push(new Bitcoin.Address(this.chunks[2])),1;case"Pubkey":return a.push(new Bitcoin.Address(Bitcoin.Util.sha256ripe160(this.chunks[0]))),1;case"P2SH":return a.push(new Bitcoin.Address(this.chunks[1],Bitcoin.Address.p2shVersion)),1;case"Multisig":for(var b=[],c=this.extractMultiSigPubKeys(b),d=0;d<b.length;++d)a.push(new Bitcoin.Address(Util.sha256ripe160(b[d])));return c;default:throw new Error("Encountered non-standard scriptPubKey")}},b.prototype.extractMultiSigPubKeys=function(b){if(0==this.chunks.length||this.chunks[this.chunks.length-1]!=a.OP_CHECKMULTISIG||this.chunks[this.chunks.length-2]>a.OP_1+2)throw"not a multisig script";for(var c=1;c<this.chunks.length-2;++c)b.push(this.chunks[c]);return this.chunks[4]-a.OP_1+1},b.createMultiSigScript=function(b,c){var d=new Bitcoin.Script;d.writeOp(a.OP_1+b-1);for(var e=0;e<c.length;++e)d.writeBytes(c[e]);return d.writeOp(a.OP_1+c.length-1),d.writeOp(a.OP_CHECKMULTISIG),d},b.createInputScript=function(a,c){var d=new b;return d.writeBytes(a),d.writeBytes(c),d},b.prototype.toString=function(){for(var a=[],b=0;b<this.chunks.length;b++){var c=this.chunks[b];c in Bitcoin.Opcode.reverseMap?a.push(Bitcoin.Opcode.reverseMap[c]):a.push(Bitcoin.Util.bytesToHex(c))}return a.join(" ")},b.prototype.clone=function(){return new b(this.buffer)}}(),function(){function a(a,b){if(a.length<b)return 0;for(var c=a.slice(0,b),d=1,e=0,f=0;b>f;f++){var g=a.shift();e+=g*d,d*=256}return 4>=b?e:c}function b(b){return a(b,1)}function c(b){return a(b,2)}function d(b){return a(b,4)}function e(b){return a(b,8)}function f(a){return a instanceof BigInteger||a>65535}function g(a,b){for(var c=a.slice(0,b),d=0;b>d;d++)a.shift();return c}function h(a){var b=i(a);return f(b)?[]:g(a,b)}function i(a){var f=b(a);return 253==f?c(a):254==f?d(a):255==f?e(a):f}var j=Bitcoin.Script,k=Bitcoin.Transaction=function(a){if(this.version=1,this.locktime=0,this.ins=[],this.outs=[],this.timestamp=null,this.block=null,a){if(a.version&&(this.version=a.version),a.locktime&&(this.locktime=a.locktime),a.ins&&a.ins.length)for(var b=0;b<a.ins.length;b++)this.addInput(new p(a.ins[b]));if(a.outs&&a.outs.length)for(var b=0;b<a.outs.length;b++)this.addOutput(new q(a.outs[b]));a.timestamp&&(this.timestamp=a.timestamp),a.block&&(this.block=a.block)}};k.objectify=function(a){for(var b=[],c=0;c<a.length;c++)b.push(new k(a[c]));return b},k.prototype.addInput=function(a,b){if(arguments[0]instanceof p)return void this.ins.push(arguments[0]);if(!(a instanceof k)||"number"!=typeof b)throw"invalid argument";this.ins.push(new p({outpoint:{hash:Bitcoin.Util.bytesToHex(a.getHashBytes()),index:b},script:a.outs[b].script,sequence:4294967295}))},k.prototype.clearInputs=function(a){this.ins=[]},k.prototype.serialize=function(){var a=[];a=a.concat(Crypto.util.wordsToBytes([parseInt(this.version)]).reverse()),a=a.concat(Bitcoin.Util.numToVarInt(this.ins.length));for(var b=0;b<this.ins.length;b++){var c=this.ins[b];a=a.concat(Crypto.util.hexToBytes(c.outpoint.hash).reverse()),a=a.concat(Crypto.util.wordsToBytes([parseInt(c.outpoint.index)]).reverse());var d=c.script.buffer;a=a.concat(Bitcoin.Util.numToVarInt(d.length)),a=a.concat(d),a=a.concat(Crypto.util.wordsToBytes([parseInt(c.sequence)]).reverse())}a=a.concat(Bitcoin.Util.numToVarInt(this.outs.length));for(var b=0;b<this.outs.length;b++){var e=this.outs[b];a=a.concat(Bitcoin.Util.numToBytes(e.value,8));var d=e.script.buffer;a=a.concat(Bitcoin.Util.numToVarInt(d.length)),a=a.concat(d)}return a=a.concat(Crypto.util.wordsToBytes([parseInt(this.locktime)]).reverse())};var l=1,m=2,n=3,o=80;k.prototype.hashTransactionForSignature=function(a,b,c){for(var d=this.clone(),e=0;e<d.ins.length;e++)d.ins[e].script=new j;if(d.ins[b].script=a,(31&c)==m){d.outs=[];for(var e=0;e<d.ins.length;e++)e!=b&&(d.ins[e].sequence=0)}else if((31&c)==n)throw"sighash_single not implemented";c&o&&(d.ins=[d.ins[b]]);var f=d.serialize();f=f.concat(Crypto.util.wordsToBytes([parseInt(c)]).reverse());var g=Crypto.SHA256(f,{asBytes:!0});return Crypto.SHA256(g,{asBytes:!0})},k.prototype.getHashBytes=function(){var a=this.serialize();return Crypto.SHA256(Crypto.SHA256(a,{asBytes:!0}),{asBytes:!0})},k.prototype.clone=function(){var a=new k;a.version=this.version,a.locktime=this.locktime;for(var b=0;b<this.ins.length;b++){var c=this.ins[b].clone();a.addInput(c)}for(var b=0;b<this.outs.length;b++){var d=this.outs[b].clone();a.addOutput(d)}return a},k.prototype.analyze=function(a){if(!(a instanceof Bitcoin.Wallet))return null;for(var b=!0,c=!0,d=null,e=null,f=null,g=this.outs.length-1;g>=0;g--){var h=this.outs[g],i=h.script.simpleOutPubKeyHash();a.hasHash(i)?e=i:c=!1,d=i}for(var g=this.ins.length-1;g>=0;g--){var j=this.ins[g];if(f=j.script.simpleInPubKeyHash(),!a.hasHash(f)){b=!1;break}}var k=this.calcImpact(a),l={};return l.impact=k,k.sign>0&&k.value.compareTo(BigInteger.ZERO)>0?(l.type="recv",
l.addr=new Bitcoin.Address(e)):b&&c?l.type="self":b?(l.type="sent",l.addr=new Bitcoin.Address(d)):l.type="other",l},k.prototype.getDescription=function(a){var b=this.analyze(a);if(!b)return"";switch(b.type){case"recv":return"Received with "+b.addr;case"sent":return"Payment to "+b.addr;case"self":return"Payment to yourself";case"other":default:return""}},k.prototype.getTotalOutValue=function(){for(var a=BigInteger.ZERO,b=0;b<this.outs.length;b++){var c=this.outs[b];a=a.add(Bitcoin.Util.valueToBigInt(c.value))}return a},k.prototype.getTotalValue=k.prototype.getTotalOutValue;var p=Bitcoin.TransactionIn=function(a){if(!(a&&a.script instanceof j&&a.outpoint&&"string"==typeof a.outpoint.hash&&"number"==typeof a.outpoint.index))throw"illegal argument";this.outpoint=a.outpoint,this.script=a.script,this.sequence=a.sequence};p.prototype.clone=function(){var a=new p({outpoint:{hash:this.outpoint.hash,index:this.outpoint.index},script:this.script.clone(),sequence:this.sequence});return a};var q=Bitcoin.TransactionOut=function(a){if(!(a&&a.script instanceof j&&"number"==typeof a.value))throw"invalid argument";this.script=a.script,this.value=a.value};q.prototype.clone=function(){var a=new q({script:this.script.clone(),value:this.value});return a},k.deserialize=function(a){var b=new Bitcoin.Transaction,c=a.slice(0),j=d(c);if(1!=j)return null;var k=i(c);if(f(k))return null;for(var l=0;k>l;l++){var m=g(c,32),n=d(c),o=h(c),p=d(c),q=new Bitcoin.TransactionIn({outpoint:{hash:Crypto.util.bytesToHex(m.reverse()),index:n},script:new Bitcoin.Script(o),sequence:p});b.addInput(q)}var r=i(c);if(f(r))return null;for(var l=0;r>l;l++){var s=e(c),o=h(c),t=new Bitcoin.TransactionOut({value:Bitcoin.Util.bytesToNum(s),script:new Bitcoin.Script(o)});b.addOutput(t)}var u=d(c);return b.locktime=u,b},k.prototype.verifyInputSignatures=function(a,b){if(0>a||a>=this.ins.length)throw"illegal index";if(!(b instanceof Bitcoin.Script))throw"illegal argument";var c=this.ins[a].script,d=1,e=[],f=[];switch(c.getInType()){case"Multisig":var g=c.chunks[c.chunks.length-1];b=new Bitcoin.Script(g),d=b.chunks[0]-Bitcoin.Opcode.map.OP_1+1;for(var h=1;h<c.chunks.length-1;++h)e.push(c.chunks[h]);for(var h=1;h<b.chunks.length-2;++h)f.push(b.chunks[h]);break;case"Address":d=1,e.push(c.chunks[0]),f.push(c.chunks[1]);break;default:return 0}for(var i=0,j=0;j<e.length;++j)if(e[j]!=Bitcoin.Opcode.map.OP_0){for(var k=e[j].pop(),l=this.hashTransactionForSignature(b,a,k),m=!1,n=0;n<f.length;++n){var o=(new Bitcoin.ECKey).setPub(f[n]);if(m=o.verify(l,e[j])){f.splice(n,1);break}}if(!m)throw"invalid signature";i++}return d>i&&(i=-i),i},k.prototype.verifySignatures=function(a){if(!(a instanceof Array))throw"illegal argument";for(var b=0;b<a.length;++b)if("string"==typeof a[b]&&(a[b]=new j(Bitcoin.Util.hexToBytes(a[b]))),!(a[b]instanceof Bitcoin.Script))throw"illegal argument";for(var c=0,d=0;d<this.ins.length;++d)try{var e=this.verifyInputSignatures(d,a[d])>0;e&&c++}catch(f){}return c},k.prototype.createStandardProof=function(a){if(!(a instanceof Bitcoin.ECKey))throw"invalid argument";return{hash:Bitcoin.Util.bytesToHex(a.getPubKeyHash()),key:a}},k.prototype.createP2SHProof=function(a){if(!(a instanceof Bitcoin.Script))throw"invalid argument";return{scriptHash:Bitcoin.Util.bytesToHex(Bitcoin.Util.sha256ripe160(a.buffer)),redeemScript:a}},k.prototype.signInput=function(a,b,c){if(c=c||l,0>a||a>=this.ins.length)throw"illegal index";var d=this.ins[a];if(0==d.script.chunks.length)throw"transaction input missing script";var e=d.script.getOutType();if("Address"==e){if(Bitcoin.Util.bytesToHex(d.script.simpleOutHash())!=b.hash)throw"invalid proof";var f=this.hashTransactionForSignature(d.script,a,c),g=b.key.sign(f);return g.push(parseInt(c,10)),d.script=Bitcoin.Script.createInputScript(g,b.key.getPub()),!0}if("P2SH"==e){if(Bitcoin.Util.bytesToHex(d.script.simpleOutHash())!=b.scriptHash)throw"invalid proof";var h=b.redeemScript.chunks[0]-Bitcoin.Opcode.map.OP_1+1;if(0>h||h>15)throw"Can't determine required number of signatures";var i=new Bitcoin.Script;i.writeOp(Bitcoin.Opcode.map.OP_0);for(var j=0;h>j;++j)i.writeOp(Bitcoin.Opcode.map.OP_0);return i.writeBytes(b.redeemScript.buffer),d.script=i,!1}if("Strange"==e){var k=function(a,b){if(!(b instanceof Bitcoin.ECKey))throw"invalid argument";if(!(a instanceof Bitcoin.Script))throw"invalid argument";for(var c=b.getPub().toString(),d=1;d<a.chunks.length-2;++d){var e=a.chunks[d];if(e.toString()==c.toString())return!0}return!1},m=function(a,b,c,d){for(var e=1;1+c>e&&0!=a.chunks[e];++e){var f=a.chunks[e].slice(0);if(f.pop(),d.verify(b,f))return!0}return!1},n=new Bitcoin.Script(d.script.chunks[d.script.chunks.length-1]);if("Multisig"!=n.getOutType())throw"unrecognized input type";var h=n.chunks[0]-Bitcoin.Opcode.map.OP_1+1;if(0>h||h>15)throw"Can't determine required number of signatures";var o=this.hashTransactionForSignature(n,a,c),i=new Bitcoin.Script;i.writeOp(Bitcoin.Opcode.map.OP_0);for(var p=!1,j=1;1+h>j;++j)if(0==d.script.chunks[j])if(p)i.writeOp(Bitcoin.Opcode.map.OP_0);else{if(!k(n,b.key))return!1;if(m(d.script,o,h,b.key))return!1;var g=b.key.sign(o);g.push(parseInt(c,10)),i.writeBytes(g),p=!0}else i.writeBytes(d.script.chunks[j]);return i.writeBytes(n.buffer),this.ins[a].script=i,!0}return!1},k.prototype.signInputWithKey=function(a,b){try{var c=this.createStandardProof(b);return this.signInput(a,c,l)}catch(d){}return!1},k.prototype.signMultiSigWithKey=function(a,b,c){try{if("P2SH"==this.ins[a].script.getOutType()){var d=this.createP2SHProof(c);this.signInput(a,d)}var e=this.createStandardProof(b);return this.signInput(a,e)}catch(f){}return!1},k.prototype.signWithKey=function(a){for(var b=0,c=this.createStandardProof(a),d=0;d<this.ins.length;++d)try{this.signInput(d,c,l),b++}catch(e){}return b},k.prototype.signWithMultiSigScript=function(a,b){var c=0;if(!(a instanceof Array&&b instanceof Bitcoin.Script))throw"invalid argument";a.forEach(function(a){if(!(a instanceof Bitcoin.ECKey))throw"invalid key"});var d=b.chunks[0]-Bitcoin.Opcode.map.OP_1+1;if(0>d||d>15)throw"Can't determine required number of signatures";for(var e=0;e<this.ins.length;++e){if("P2SH"==this.ins[e].script.getOutType()){var f=this.createP2SHProof(b);this.signInput(e,f)}var g=this.createStandardProof(a[0]);this.signInput(e,g)&&c++}return c},k.prototype.addOutput=function(a,b){if(arguments[0]instanceof Bitcoin.TransactionOut)return void this.outs.push(arguments[0]);if(!(a&&a instanceof Bitcoin.Address&&"number"==typeof b))throw"invalid argument";this.outs.push(new Bitcoin.TransactionOut({value:b,script:Bitcoin.Script.createOutputScript(a)}))},k.prototype.clearOutputs=function(a){this.outs=[]}}(),function(){Bitcoin.setNetwork=function(a){"prod"==a?(Bitcoin.network="prod",Bitcoin.Address.pubKeyHashVersion=0,Bitcoin.Address.p2shVersion=5,Bitcoin.ECKey.privateKeyPrefix=128):(Bitcoin.network="testnet",Bitcoin.Address.pubKeyHashVersion=111,Bitcoin.Address.p2shVersion=196,Bitcoin.ECKey.privateKeyPrefix=239)},Bitcoin.setNetwork("prod"),Array.prototype.compare=function(a){if(!a)return!1;if(this.length!=a.length)return!1;for(var b=0;b<this.length;b++)if(this[b]instanceof Array&&a[b]instanceof Array){if(!this[b].compare(a[b]))return!1}else if(this[b]!=a[b])return!1;return!0},"object"==typeof module&&(module.exports=function(a){sjcl=require("sjcl");var b=require("crypto"),c=Bitcoin.Util.hexToBytes(b.randomBytes(128).toString("hex"));return sjcl.random.addEntropy(c,1024,"crypto.randomBytes"),Bitcoin.setNetwork(a),Bitcoin})}();
//# sourceMappingURL=bitcoinjs-lib.min.js.map