>p)>0&&(m=!0,r=int2char(d));i>=0;)k>p?(d=(this[i]&(1<>(p+=this.DB-k)):(d=this[i]>>(p-=k)&km,0>=p&&(p+=this.DB,--i)),d>0&&(m=!0),m&&(r+=int2char(d));return m?r:"0"},BigInteger.prototype.negate=function(){var r=nbi();return BigInteger.ZERO.subTo(this,r),r},BigInteger.prototype.abs=function(){return this.s<0?this.negate():this},BigInteger.prototype.compareTo=function(a){var r=this.s-a.s;if(0!=r)return r;var i=this.t;if(r=i-a.t,0!=r)return this.s<0?-r:r;for(;--i>=0;)if(0!=(r=this[i]-a[i]))return r;return 0},BigInteger.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+nbits(this[this.t-1]^this.s&this.DM)},BigInteger.prototype.mod=function(a){var r=nbi();return this.abs().divRemTo(a,null,r),this.s<0&&r.compareTo(BigInteger.ZERO)>0&&a.subTo(r,r),r},BigInteger.prototype.modPowInt=function(e,m){var z;return z=256>e||m.isEven()?new Classic(m):new Montgomery(m),
+this.exp(e,z)},BigInteger.ZERO=nbv(0),BigInteger.ONE=nbv(1);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=function(r){return Math.floor(Math.LN2*this.DB/Math.log(r))},BigInteger.prototype.toRadix=function(b){if(null==b&&(b=10),0==this.signum()||2>b||b>36)return"0";var cs=this.chunkSize(b),a=Math.pow(b,cs),d=nbv(a),y=nbi(),z=nbi(),r="";for(this.divRemTo(d,y,z);y.signum()>0;)r=(a+z.intValue()).toString(b).substr(1)+r,y.divRemTo(d,y,z);return z.intValue().toString(b)+r},BigInteger.prototype.fromRadix=function(s,b){this.fromInt(0),null==b&&(b=10);for(var cs=this.chunkSize(b),d=Math.pow(b,cs),mi=!1,j=0,w=0,i=0;ix?"-"==s.charAt(i)&&0==this.signum()&&(mi=!0):(w=b*w+x,++j>=cs&&(this.dMultiply(d),this.dAddOffset(w,0),j=0,w=0))}j>0&&(this.dMultiply(Math.pow(b,j)),this.dAddOffset(w,0)),mi&&BigInteger.ZERO.subTo(this,this)},BigInteger.prototype.fromNumber=function(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 x=new Array,t=7&a;x.length=(a>>3)+1,b.nextBytes(x),t>0?x[0]&=(1<i;++i)r[i]=op(this[i],a[i]);if(a.ti;)c+=this[i]+a[i],r[i++]=c&this.DM,c>>=this.DB;if(a.t>=this.DB;c+=this.s}else{for(c+=this.s;i>=this.DB;c+=a.s}r.s=0>c?-1:0,c>0?r[i++]=c:-1>c&&(r[i++]=this.DV+c),r.t=i,r.clamp()},BigInteger.prototype.dMultiply=function(n){this[this.t]=this.am(0,n-1,this,0,0,this.t),++this.t,this.clamp()},BigInteger.prototype.dAddOffset=function(n,w){if(0!=n){for(;this.t<=w;)this[this.t++]=0;for(this[w]+=n;this[w]>=this.DV;)this[w]-=this.DV,++w>=this.t&&(this[this.t++]=0),++this[w]}},BigInteger.prototype.multiplyLowerTo=function(a,n,r){var i=Math.min(this.t+a.t,n);for(r.s=0,r.t=i;i>0;)r[--i]=0;var j;for(j=r.t-this.t;j>i;++i)r[i+this.t]=this.am(0,a[i],r,i,0,this.t);for(j=Math.min(a.t,n);j>i;++i)this.am(0,a[i],r,i,0,n-i);r.clamp()},BigInteger.prototype.multiplyUpperTo=function(a,n,r){--n;var i=r.t=this.t+a.t-n;for(r.s=0;--i>=0;)r[i]=0;for(i=Math.max(n-this.t,0);i=n)return 0;var d=this.DV%n,r=this.s<0?n-1:0;if(this.t>0)if(0==d)r=this[0]%n;else for(var i=this.t-1;i>=0;--i)r=(d*r+this[i])%n;return r},BigInteger.prototype.millerRabin=function(t){var n1=this.subtract(BigInteger.ONE),k=n1.getLowestSetBit();if(0>=k)return!1;var r=n1.shiftRight(k);t=t+1>>1,t>lowprimes.length&&(t=lowprimes.length);for(var a=nbi(),i=0;t>i;++i){a.fromInt(lowprimes[Math.floor(Math.random()*lowprimes.length)]);var y=a.modPow(r,this);if(0!=y.compareTo(BigInteger.ONE)&&0!=y.compareTo(n1)){for(var j=1;j++>24},BigInteger.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},BigInteger.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},BigInteger.prototype.toByteArray=function(){var i=this.t,r=new Array;r[0]=this.s;var d,p=this.DB-i*this.DB%8,k=0;if(i-- >0)for(p>p)!=(this.s&this.DM)>>p&&(r[k++]=d|this.s<=0;)8>p?(d=(this[i]&(1<>(p+=this.DB-8)):(d=this[i]>>(p-=8)&255,0>=p&&(p+=this.DB,--i)),0!=(128&d)&&(d|=-256),0==k&&(128&this.s)!=(128&d)&&++k,(k>0||d!=this.s)&&(r[k++]=d);return r},BigInteger.prototype.equals=function(a){return 0==this.compareTo(a)},BigInteger.prototype.min=function(a){return this.compareTo(a)<0?this:a},BigInteger.prototype.max=function(a){return this.compareTo(a)>0?this:a},BigInteger.prototype.and=function(a){var r=nbi();return this.bitwiseTo(a,op_and,r),r},BigInteger.prototype.or=function(a){var r=nbi();return this.bitwiseTo(a,op_or,r),r},BigInteger.prototype.xor=function(a){var r=nbi();return this.bitwiseTo(a,op_xor,r),r},BigInteger.prototype.andNot=function(a){var r=nbi();return this.bitwiseTo(a,op_andnot,r),r},BigInteger.prototype.not=function(){for(var r=nbi(),i=0;in?this.rShiftTo(-n,r):this.lShiftTo(n,r),r},BigInteger.prototype.shiftRight=function(n){var r=nbi();return 0>n?this.lShiftTo(-n,r):this.rShiftTo(n,r),r},BigInteger.prototype.getLowestSetBit=function(){for(var i=0;i=this.t?0!=this.s:0!=(this[j]&1<=i)return r;k=18>i?1:48>i?3:144>i?4:768>i?5:6,z=8>i?new Classic(m):m.isEven()?new Barrett(m):new Montgomery(m);var g=new Array,n=3,k1=k-1,km=(1<1){var g2=nbi();for(z.sqrTo(g[1],g2);km>=n;)g[n]=nbi(),z.mulTo(g2,g[n-2],g[n]),n+=2}var w,t,j=e.t-1,is1=!0,r2=nbi();for(i=nbits(e[j])-1;j>=0;){for(i>=k1?w=e[j]>>i-k1&km:(w=(e[j]&(1<0&&(w|=e[j-1]>>this.DB+i-k1)),n=k;0==(1&w);)w>>=1,--n;if((i-=n)<0&&(i+=this.DB,--j),is1)g[w].copyTo(r),is1=!1;else{for(;n>1;)z.sqrTo(r,r2),z.sqrTo(r2,r),n-=2;n>0?z.sqrTo(r,r2):(t=r,r=r2,r2=t),z.mulTo(r2,g[w],r)}for(;j>=0&&0==(e[j]&1<=0?(u.subTo(v,u),ac&&a.subTo(c,a),b.subTo(d,b)):(v.subTo(u,v),ac&&c.subTo(a,c),d.subTo(b,d))}return 0!=v.compareTo(BigInteger.ONE)?BigInteger.ZERO:d.compareTo(m)>=0?d.subtract(m):d.signum()<0?(d.addTo(m,d),d.signum()<0?d.add(m):d):d},BigInteger.prototype.pow=function(e){return this.exp(e,new NullExp)},BigInteger.prototype.gcd=function(a){var x=this.s<0?this.negate():this.clone(),y=a.s<0?a.negate():a.clone();if(x.compareTo(y)<0){var t=x;x=y,y=t}var i=x.getLowestSetBit(),g=y.getLowestSetBit();if(0>g)return x;for(g>i&&(g=i),g>0&&(x.rShiftTo(g,x),y.rShiftTo(g,y));x.signum()>0;)(i=x.getLowestSetBit())>0&&x.rShiftTo(i,x),(i=y.getLowestSetBit())>0&&y.rShiftTo(i,y),x.compareTo(y)>=0?(x.subTo(y,x),x.rShiftTo(1,x)):(y.subTo(x,y),y.rShiftTo(1,y));return g>0&&y.lShiftTo(g,y),y},BigInteger.prototype.isProbablePrime=function(t){var i,x=this.abs();if(1==x.t&&x[0]<=lowprimes[lowprimes.length-1]){for(i=0;im;)m*=lowprimes[j++];for(m=x.modInt(m);j>i;)if(m%lowprimes[i++]==0)return!1}return x.millerRabin(t)},BigInteger.prototype.square=function(){var r=nbi();return this.squareTo(r),r},BigInteger.valueOf=nbv,BigInteger.prototype.toByteArrayUnsigned=function(){var ba=this.abs().toByteArray();return ba.length?(0==ba[0]&&(ba=ba.slice(1)),ba.map(function(v){return 0>v?v+256:v})):ba},BigInteger.fromByteArrayUnsigned=function(ba){return ba.length?new BigInteger(128&ba[0]?[0].concat(ba):ba):ba.valueOf(0)},BigInteger.prototype.toByteArraySigned=function(){var val=this.abs().toByteArrayUnsigned(),neg=this.compareTo(BigInteger.ZERO)<0;return neg?128&val[0]?val.unshift(128):val[0]|=128:128&val[0]&&val.unshift(0),val},BigInteger.fromByteArraySigned=function(ba){return 128&ba[0]?(ba[0]&=127,BigInteger.fromByteArrayUnsigned(ba).negate()):BigInteger.fromByteArrayUnsigned(ba)},Classic.prototype.convert=function(x){return x.s<0||x.compareTo(this.m)>=0?x.mod(this.m):x},Classic.prototype.revert=function(x){return x},Classic.prototype.reduce=function(x){x.divRemTo(this.m,null,x)},Classic.prototype.mulTo=function(x,y,r){x.multiplyTo(y,r),this.reduce(r)},Classic.prototype.sqrTo=function(x,r){x.squareTo(r),this.reduce(r)},Montgomery.prototype.convert=function(x){var r=nbi();return x.abs().dlShiftTo(this.m.t,r),r.divRemTo(this.m,null,r),x.s<0&&r.compareTo(BigInteger.ZERO)>0&&this.m.subTo(r,r),r},Montgomery.prototype.revert=function(x){var r=nbi();return x.copyTo(r),this.reduce(r),r},Montgomery.prototype.reduce=function(x){for(;x.t<=this.mt2;)x[x.t++]=0;for(var i=0;i>15)*this.mpl&this.um)<<15)&x.DM;for(j=i+this.m.t,x[j]+=this.m.am(0,u0,x,i,0,this.m.t);x[j]>=x.DV;)x[j]-=x.DV,x[++j]++}x.clamp(),x.drShiftTo(this.m.t,x),x.compareTo(this.m)>=0&&x.subTo(this.m,x)},Montgomery.prototype.mulTo=function(x,y,r){x.multiplyTo(y,r),this.reduce(r)},Montgomery.prototype.sqrTo=function(x,r){x.squareTo(r),this.reduce(r)},NullExp.prototype.convert=function(x){return x},NullExp.prototype.revert=function(x){return x},NullExp.prototype.mulTo=function(x,y,r){x.multiplyTo(y,r)},NullExp.prototype.sqrTo=function(x,r){x.squareTo(r)},Barrett.prototype.convert=function(x){if(x.s<0||x.t>2*this.m.t)return x.mod(this.m);if(x.compareTo(this.m)<0)return x;var r=nbi();return x.copyTo(r),this.reduce(r),r},Barrett.prototype.revert=function(x){return x},Barrett.prototype.reduce=function(x){for(x.drShiftTo(this.m.t-1,this.r2),x.t>this.m.t+1&&(x.t=this.m.t+1,x.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);x.compareTo(this.r2)<0;)x.dAddOffset(1,this.m.t+1);for(x.subTo(this.r2,x);x.compareTo(this.m)>=0;)x.subTo(this.m,x)},Barrett.prototype.mulTo=function(x,y,r){x.multiplyTo(y,r),this.reduce(r)},Barrett.prototype.sqrTo=function(x,r){x.squareTo(r),this.reduce(r)}}(exports);var BigInteger=exports.BigInteger;!function(Crypto){var base64map="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",util=Crypto.util={rotl:function(n,b){return n<>>32-b},rotr:function(n,b){return n<<32-b|n>>>b},endian:function(n){if(n.constructor==Number)return 16711935&util.rotl(n,8)|4278255360&util.rotl(n,24);for(var i=0;i0;n--)bytes.push(Math.floor(256*Math.random()));return bytes},bytesToWords:function(bytes){for(var words=[],i=0,b=0;i>>5]|=(255&bytes[i])<<24-b%32;return words},wordsToBytes:function(words){for(var bytes=[],b=0;b<32*words.length;b+=8)bytes.push(words[b>>>5]>>>24-b%32&255);return bytes},bytesToHex:function(bytes){for(var hex=[],i=0;i>>4).toString(16)),hex.push((15&bytes[i]).toString(16));return hex.join("")},hexToBytes:function(hex){for(var bytes=[],c=0;cj;j++)8*i+6*j<=8*bytes.length?base64.push(base64map.charAt(triplet>>>6*(3-j)&63)):base64.push("=");return base64.join("")},base64ToBytes:function(base64){base64=base64.replace(/[^A-Z0-9+\/]/gi,"");for(var bytes=[],i=0,imod4=0;i>>6-2*imod4);return bytes}},charenc=Crypto.charenc={},Binary=(charenc.UTF8={stringToBytes:function(str){return Binary.stringToBytes(unescape(encodeURIComponent(str)))},bytesToString:function(bytes){return decodeURIComponent(escape(Binary.bytesToString(bytes)))}},charenc.Binary={stringToBytes:function(str){for(var bytes=[],i=0;i=0&&15>=j?x^y^z:j>=16&&31>=j?x&y|~x&z:j>=32&&47>=j?(x|~y)^z:j>=48&&63>=j?x&z|y&~z:j>=64&&79>=j?x^(y|~z):"rmd160_f: j out of range"}function rmd160_K1(j){return j>=0&&15>=j?0:j>=16&&31>=j?1518500249:j>=32&&47>=j?1859775393:j>=48&&63>=j?2400959708:j>=64&&79>=j?2840853838:"rmd160_K1: j out of range"}function rmd160_K2(j){return j>=0&&15>=j?1352829926:j>=16&&31>=j?1548603684:j>=32&&47>=j?1836072691:j>=48&&63>=j?2053994217:j>=64&&79>=j?0:"rmd160_K2: j out of range"}function safe_add(x,y){var lsw=(65535&x)+(65535&y),msw=(x>>16)+(y>>16)+(lsw>>16);return msw<<16|65535&lsw}function bit_rol(num,cnt){return num<>>32-cnt}var C=Crypto,util=C.util,charenc=C.charenc,UTF8=charenc.UTF8,Binary=charenc.Binary;util.bytesToLWords=function(bytes){for(var output=Array(bytes.length>>2),i=0;i>5]|=(255&bytes[i/8])<>5]>>>i%32&255);return output};var RIPEMD160=C.RIPEMD160=function(message,options){var digestbytes=util.lWordsToBytes(RIPEMD160._rmd160(message));return options&&options.asBytes?digestbytes:options&&options.asString?Binary.bytesToString(digestbytes):util.bytesToHex(digestbytes)};RIPEMD160._rmd160=function(message){message.constructor==String&&(message=UTF8.stringToBytes(message));var x=util.bytesToLWords(message),len=8*message.length;x[len>>5]|=128<>>9<<4)+14]=len;for(var h0=1732584193,h1=4023233417,h2=2562383102,h3=271733878,h4=3285377520,i=0;i=j;++j)T=safe_add(A1,rmd160_f(j,B1,C1,D1)),T=safe_add(T,x[i+rmd160_r1[j]]),T=safe_add(T,rmd160_K1(j)),T=safe_add(bit_rol(T,rmd160_s1[j]),E1),A1=E1,E1=D1,D1=bit_rol(C1,10),C1=B1,B1=T,T=safe_add(A2,rmd160_f(79-j,B2,C2,D2)),T=safe_add(T,x[i+rmd160_r2[j]]),T=safe_add(T,rmd160_K2(j)),T=safe_add(bit_rol(T,rmd160_s2[j]),E2),A2=E2,E2=D2,D2=bit_rol(C2,10),C2=B2,B2=T;T=safe_add(h1,safe_add(C1,D2)),h1=safe_add(h2,safe_add(D1,E2)),h2=safe_add(h3,safe_add(E1,A2)),h3=safe_add(h4,safe_add(A1,B2)),h4=safe_add(h0,safe_add(B1,C2)),h0=T}return[h0,h1,h2,h3,h4]};var rmd160_r1=[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],rmd160_r2=[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],rmd160_s1=[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],rmd160_s2=[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]}(Crypto),function(Crypto){var C=Crypto,util=C.util,charenc=C.charenc,UTF8=charenc.UTF8,Binary=charenc.Binary,K=[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],SHA256=C.SHA256=function(message,options){var digestbytes=util.wordsToBytes(SHA256._sha256(message));return options&&options.asBytes?digestbytes:options&&options.asString?Binary.bytesToString(digestbytes):util.bytesToHex(digestbytes)};SHA256._sha256=function(message){message.constructor==String&&(message=UTF8.stringToBytes(message));var a,b,c,d,e,f,g,h,i,j,t1,t2,m=util.bytesToWords(message),l=8*message.length,H=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],w=[];m[l>>5]|=128<<24-l%32,m[(l+64>>9<<4)+15]=l;for(var i=0;ij;j++){if(16>j)w[j]=m[j+i];else{var gamma0x=w[j-15],gamma1x=w[j-2],gamma0=(gamma0x<<25|gamma0x>>>7)^(gamma0x<<14|gamma0x>>>18)^gamma0x>>>3,gamma1=(gamma1x<<15|gamma1x>>>17)^(gamma1x<<13|gamma1x>>>19)^gamma1x>>>10;w[j]=gamma0+(w[j-7]>>>0)+gamma1+(w[j-16]>>>0)}var ch=e&f^~e&g,maj=a&b^a&c^b&c,sigma0=(a<<30|a>>>2)^(a<<19|a>>>13)^(a<<10|a>>>22),sigma1=(e<<26|e>>>6)^(e<<21|e>>>11)^(e<<7|e>>>25);t1=(h>>>0)+sigma1+ch+K[j]+(w[j]>>>0),t2=sigma0+maj,h=g,g=f,f=e,e=d+t1>>>0,d=c,c=b,b=a,a=t1+t2>>>0}H[0]+=a,H[1]+=b,H[2]+=c,H[3]+=d,H[4]+=e,H[5]+=f,H[6]+=g,H[7]+=h}return H},SHA256._blocksize=16,SHA256._digestsize=32}(Crypto),function(exports){var ec=exports.EllipticCurve=function(){};ec.FieldElementFp=function(q,x){this.x=x,this.q=q},ec.FieldElementFp.prototype.equals=function(other){return other==this?!0:this.q.equals(other.q)&&this.x.equals(other.x)},ec.FieldElementFp.prototype.toBigInteger=function(){return this.x},ec.FieldElementFp.prototype.negate=function(){return new ec.FieldElementFp(this.q,this.x.negate().mod(this.q))},ec.FieldElementFp.prototype.add=function(b){return new ec.FieldElementFp(this.q,this.x.add(b.toBigInteger()).mod(this.q))},ec.FieldElementFp.prototype.subtract=function(b){return new ec.FieldElementFp(this.q,this.x.subtract(b.toBigInteger()).mod(this.q))},ec.FieldElementFp.prototype.multiply=function(b){return new ec.FieldElementFp(this.q,this.x.multiply(b.toBigInteger()).mod(this.q))},ec.FieldElementFp.prototype.square=function(){return new ec.FieldElementFp(this.q,this.x.square().mod(this.q))},ec.FieldElementFp.prototype.divide=function(b){return new ec.FieldElementFp(this.q,this.x.multiply(b.toBigInteger().modInverse(this.q)).mod(this.q))},ec.FieldElementFp.prototype.getByteLength=function(){return Math.floor((this.toBigInteger().bitLength()+7)/8)},ec.FieldElementFp.prototype.sqrt=function(){throw new Error("this feature is disabled since we don't have a randomness source")},ec.FieldElementFp.fastLucasSequence=function(p,P,Q,k){for(var n=k.bitLength(),s=k.getLowestSetBit(),Uh=BigInteger.ONE,Vl=BigInteger.TWO,Vh=P,Ql=BigInteger.ONE,Qh=BigInteger.ONE,j=n-1;j>=s+1;--j)Ql=Ql.multiply(Qh).mod(p),k.testBit(j)?(Qh=Ql.multiply(Q).mod(p),Uh=Uh.multiply(Vh).mod(p),Vl=Vh.multiply(Vl).subtract(P.multiply(Ql)).mod(p),Vh=Vh.multiply(Vh).subtract(Qh.shiftLeft(1)).mod(p)):(Qh=Ql,Uh=Uh.multiply(Vl).subtract(Ql).mod(p),Vh=Vh.multiply(Vl).subtract(P.multiply(Ql)).mod(p),Vl=Vl.multiply(Vl).subtract(Ql.shiftLeft(1)).mod(p));Ql=Ql.multiply(Qh).mod(p),Qh=Ql.multiply(Q).mod(p),Uh=Uh.multiply(Vl).subtract(Ql).mod(p),Vl=Vh.multiply(Vl).subtract(P.multiply(Ql)).mod(p),Ql=Ql.multiply(Qh).mod(p);for(var j=1;s>=j;++j)Uh=Uh.multiply(Vl).mod(p),Vl=Vl.multiply(Vl).subtract(Ql.shiftLeft(1)).mod(p),Ql=Ql.multiply(Ql).mod(p);return[Uh,Vl]},ec.PointFp=function(curve,x,y,z,compressed){this.curve=curve,this.x=x,this.y=y,null==z?this.z=BigInteger.ONE:this.z=z,this.zinv=null,this.compressed=!!compressed},ec.PointFp.prototype.getX=function(){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))},ec.PointFp.prototype.getY=function(){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))},ec.PointFp.prototype.equals=function(other){if(other==this)return!0;if(this.isInfinity())return other.isInfinity();if(other.isInfinity())return this.isInfinity();var u,v;return u=other.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(other.z)).mod(this.curve.q),u.equals(BigInteger.ZERO)?(v=other.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(other.z)).mod(this.curve.q),v.equals(BigInteger.ZERO)):!1},ec.PointFp.prototype.isInfinity=function(){return null==this.x&&null==this.y?!0:this.z.equals(BigInteger.ZERO)&&!this.y.toBigInteger().equals(BigInteger.ZERO)},ec.PointFp.prototype.negate=function(){return new ec.PointFp(this.curve,this.x,this.y.negate(),this.z)},ec.PointFp.prototype.add=function(b){if(this.isInfinity())return b;if(b.isInfinity())return this;var u=b.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(b.z)).mod(this.curve.q),v=b.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(b.z)).mod(this.curve.q);if(BigInteger.ZERO.equals(v))return BigInteger.ZERO.equals(u)?this.twice():this.curve.getInfinity();var THREE=new BigInteger("3"),x1=this.x.toBigInteger(),y1=this.y.toBigInteger(),v2=(b.x.toBigInteger(),b.y.toBigInteger(),v.square()),v3=v2.multiply(v),x1v2=x1.multiply(v2),zu2=u.square().multiply(this.z),x3=zu2.subtract(x1v2.shiftLeft(1)).multiply(b.z).subtract(v3).multiply(v).mod(this.curve.q),y3=x1v2.multiply(THREE).multiply(u).subtract(y1.multiply(v3)).subtract(zu2.multiply(u)).multiply(b.z).add(u.multiply(v3)).mod(this.curve.q),z3=v3.multiply(this.z).multiply(b.z).mod(this.curve.q);return new ec.PointFp(this.curve,this.curve.fromBigInteger(x3),this.curve.fromBigInteger(y3),z3)},ec.PointFp.prototype.twice=function(){if(this.isInfinity())return this;if(0==this.y.toBigInteger().signum())return this.curve.getInfinity();var THREE=new BigInteger("3"),x1=this.x.toBigInteger(),y1=this.y.toBigInteger(),y1z1=y1.multiply(this.z),y1sqz1=y1z1.multiply(y1).mod(this.curve.q),a=this.curve.a.toBigInteger(),w=x1.square().multiply(THREE);BigInteger.ZERO.equals(a)||(w=w.add(this.z.square().multiply(a))),w=w.mod(this.curve.q);var x3=w.square().subtract(x1.shiftLeft(3).multiply(y1sqz1)).shiftLeft(1).multiply(y1z1).mod(this.curve.q),y3=w.multiply(THREE).multiply(x1).subtract(y1sqz1.shiftLeft(1)).shiftLeft(2).multiply(y1sqz1).subtract(w.square().multiply(w)).mod(this.curve.q),z3=y1z1.square().multiply(y1z1).shiftLeft(3).mod(this.curve.q);return new ec.PointFp(this.curve,this.curve.fromBigInteger(x3),this.curve.fromBigInteger(y3),z3)},ec.PointFp.prototype.multiply=function(k){if(this.isInfinity())return this;if(0==k.signum())return this.curve.getInfinity();var i,e=k,h=e.multiply(new BigInteger("3")),neg=this.negate(),R=this;for(i=h.bitLength()-2;i>0;--i){R=R.twice();var hBit=h.testBit(i),eBit=e.testBit(i);hBit!=eBit&&(R=R.add(hBit?this:neg))}return R},ec.PointFp.prototype.multiplyTwo=function(j,x,k){var i;i=j.bitLength()>k.bitLength()?j.bitLength()-1:k.bitLength()-1;for(var R=this.curve.getInfinity(),both=this.add(x);i>=0;)R=R.twice(),j.testBit(i)?R=k.testBit(i)?R.add(both):R.add(this):k.testBit(i)&&(R=R.add(x)),--i;return R},ec.PointFp.prototype.getEncoded=function(compressed){var x=this.getX().toBigInteger(),y=this.getY().toBigInteger(),len=32,enc=ec.integerToBytes(x,len);return compressed?y.isEven()?enc.unshift(2):enc.unshift(3):(enc.unshift(4),enc=enc.concat(ec.integerToBytes(y,len))),enc},ec.PointFp.decodeFrom=function(curve,enc){var dataLen=(enc[0],enc.length-1),xBa=enc.slice(1,1+dataLen/2),yBa=enc.slice(1+dataLen/2,1+dataLen);xBa.unshift(0),yBa.unshift(0);var x=new BigInteger(xBa),y=new BigInteger(yBa);return new ec.PointFp(curve,curve.fromBigInteger(x),curve.fromBigInteger(y))},ec.PointFp.prototype.add2D=function(b){if(this.isInfinity())return b;if(b.isInfinity())return this;if(this.x.equals(b.x))return this.y.equals(b.y)?this.twice():this.curve.getInfinity();var x_x=b.x.subtract(this.x),y_y=b.y.subtract(this.y),gamma=y_y.divide(x_x),x3=gamma.square().subtract(this.x).subtract(b.x),y3=gamma.multiply(this.x.subtract(x3)).subtract(this.y);return new ec.PointFp(this.curve,x3,y3)},ec.PointFp.prototype.twice2D=function(){if(this.isInfinity())return this;if(0==this.y.toBigInteger().signum())return this.curve.getInfinity();var TWO=this.curve.fromBigInteger(BigInteger.valueOf(2)),THREE=this.curve.fromBigInteger(BigInteger.valueOf(3)),gamma=this.x.square().multiply(THREE).add(this.curve.a).divide(this.y.multiply(TWO)),x3=gamma.square().subtract(this.x.multiply(TWO)),y3=gamma.multiply(this.x.subtract(x3)).subtract(this.y);return new ec.PointFp(this.curve,x3,y3)},ec.PointFp.prototype.multiply2D=function(k){if(this.isInfinity())return this;if(0==k.signum())return this.curve.getInfinity();var i,e=k,h=e.multiply(new BigInteger("3")),neg=this.negate(),R=this;for(i=h.bitLength()-2;i>0;--i){R=R.twice();var hBit=h.testBit(i),eBit=e.testBit(i);hBit!=eBit&&(R=R.add2D(hBit?this:neg))}return R},ec.PointFp.prototype.isOnCurve=function(){var x=this.getX().toBigInteger(),y=this.getY().toBigInteger(),a=this.curve.getA().toBigInteger(),b=this.curve.getB().toBigInteger(),n=this.curve.getQ(),lhs=y.multiply(y).mod(n),rhs=x.multiply(x).multiply(x).add(a.multiply(x)).add(b).mod(n);return lhs.equals(rhs)},ec.PointFp.prototype.toString=function(){return"("+this.getX().toBigInteger().toString()+","+this.getY().toBigInteger().toString()+")"},ec.PointFp.prototype.validate=function(){var n=this.curve.getQ();if(this.isInfinity())throw new Error("Point is at infinity.");var x=this.getX().toBigInteger(),y=this.getY().toBigInteger();if(x.compareTo(BigInteger.ONE)<0||x.compareTo(n.subtract(BigInteger.ONE))>0)throw new Error("x coordinate out of bounds");if(y.compareTo(BigInteger.ONE)<0||y.compareTo(n.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(n).isInfinity())throw new Error("Point is not a scalar multiple of G.");return!0},ec.CurveFp=function(q,a,b){this.q=q,this.a=this.fromBigInteger(a),this.b=this.fromBigInteger(b),this.infinity=new ec.PointFp(this,null,null)},ec.CurveFp.prototype.getQ=function(){return this.q},ec.CurveFp.prototype.getA=function(){return this.a},ec.CurveFp.prototype.getB=function(){return this.b},ec.CurveFp.prototype.equals=function(other){return other==this?!0:this.q.equals(other.q)&&this.a.equals(other.a)&&this.b.equals(other.b)},ec.CurveFp.prototype.getInfinity=function(){return this.infinity},ec.CurveFp.prototype.fromBigInteger=function(x){return new ec.FieldElementFp(this.q,x)},ec.CurveFp.prototype.decodePointHex=function(s){var firstByte=parseInt(s.substr(0,2),16);switch(firstByte){case 0:return this.infinity;case 2:case 3:var yTilde=1&firstByte,xHex=s.substr(2,s.length-2),X1=new BigInteger(xHex,16);return this.decompressPoint(yTilde,X1);case 4:case 6:case 7:var len=(s.length-2)/2,xHex=s.substr(2,len),yHex=s.substr(len+2,len);return new ec.PointFp(this,this.fromBigInteger(new BigInteger(xHex,16)),this.fromBigInteger(new BigInteger(yHex,16)));default:return null}},ec.CurveFp.prototype.decompressPoint=function(yTilde,X1){var x=this.fromBigInteger(X1),alpha=x.multiply(x.square().add(this.getA())).add(this.getB()),beta=alpha.sqrt();if(null==beta)throw new Error("Invalid point compression");var betaValue=beta.toBigInteger(),bit0=betaValue.testBit(0)?1:0;return bit0!=yTilde&&(beta=this.fromBigInteger(this.getQ().subtract(betaValue))),new ec.PointFp(this,x,beta,null,!0)},ec.fromHex=function(s){return new BigInteger(s,16)},ec.integerToBytes=function(i,len){var bytes=i.toByteArrayUnsigned();if(lenbytes.length;)bytes.unshift(0);return bytes},ec.X9Parameters=function(curve,g,n,h){this.curve=curve,this.g=g,this.n=n,this.h=h},ec.X9Parameters.prototype.getCurve=function(){return this.curve},ec.X9Parameters.prototype.getG=function(){return this.g},ec.X9Parameters.prototype.getN=function(){return this.n},ec.X9Parameters.prototype.getH=function(){return this.h},ec.secNamedCurves={secp256k1:function(){var p=ec.fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F"),a=BigInteger.ZERO,b=ec.fromHex("7"),n=ec.fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141"),h=BigInteger.ONE,curve=new ec.CurveFp(p,a,b),G=curve.decodePointHex("0479BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8");return new ec.X9Parameters(curve,G,n,h)}},ec.getSECCurveByName=function(name){return void 0==ec.secNamedCurves[name]?null:ec.secNamedCurves[name]()}}(exports);var EllipticCurve=exports.EllipticCurve;!function(Bitcoin){Bitcoin.Address=function(bytes){"string"==typeof bytes&&(bytes=Bitcoin.Address.decodeString(bytes)),this.hash=bytes,this.version=Bitcoin.Address.networkVersion},Bitcoin.Address.networkVersion=0,Bitcoin.Address.prototype.toString=function(){var hash=this.hash.slice(0);hash.unshift(this.version);var checksum=Crypto.SHA256(Crypto.SHA256(hash,{asBytes:!0}),{asBytes:!0}),bytes=hash.concat(checksum.slice(0,4));return Bitcoin.Base58.encode(bytes)},Bitcoin.Address.prototype.getHashBase64=function(){return Crypto.util.bytesToBase64(this.hash)},Bitcoin.Address.decodeString=function(string){var bytes=Bitcoin.Base58.decode(string),hash=bytes.slice(0,21),checksum=Crypto.SHA256(Crypto.SHA256(hash,{asBytes:!0}),{asBytes:!0});if(checksum[0]!=bytes[21]||checksum[1]!=bytes[22]||checksum[2]!=bytes[23]||checksum[3]!=bytes[24])throw"Checksum validation failed!";var version=hash.shift();
+if(0!=version)throw"Version "+version+" not supported!";return hash}}(Bitcoin),function(Bitcoin){Bitcoin.Base58={alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",validRegex:/^[1-9A-HJ-NP-Za-km-z]+$/,base:BigInteger.valueOf(58),encode:function(input){for(var bi=BigInteger.fromByteArrayUnsigned(input),chars=[];bi.compareTo(B58.base)>=0;){var mod=bi.mod(B58.base);chars.unshift(B58.alphabet[mod.intValue()]),bi=bi.subtract(mod).divide(B58.base)}chars.unshift(B58.alphabet[bi.intValue()]);for(var i=0;i=0;i--){var alphaIndex=B58.alphabet.indexOf(input[i]);if(0>alphaIndex)throw"Invalid character";bi=bi.add(BigInteger.valueOf(alphaIndex).multiply(B58.base.pow(input.length-1-i))),"1"==input[i]?leadingZerosNum++:leadingZerosNum=0}for(var bytes=bi.toByteArrayUnsigned();leadingZerosNum-- >0;)bytes.unshift(0);return bytes}};var B58=Bitcoin.Base58}(Bitcoin),function(Bitcoin){Bitcoin.ECKey=function(){var ecparams=EllipticCurve.getSECCurveByName("secp256k1"),ECKey=function(input){if(input instanceof BigInteger)this.priv=input;else if(Bitcoin.Util.isArray(input))this.priv=BigInteger.fromByteArrayUnsigned(input);else{if("string"!=typeof input)throw new Error("no plausible constructor behavior");var bytes=null;ECKey.isWalletImportFormat(input)?bytes=ECKey.decodeWalletImportFormat(input):ECKey.isCompressedWalletImportFormat(input)?(bytes=ECKey.decodeCompressedWalletImportFormat(input),this.compressed=!0):ECKey.isMiniFormat(input)?bytes=Crypto.SHA256(input,{asBytes:!0}):ECKey.isHexFormat(input)?bytes=Crypto.util.hexToBytes(input):ECKey.isBase64Format(input)&&(bytes=Crypto.util.base64ToBytes(input)),ECKey.isBase6Format(input)?this.priv=new BigInteger(input,6):null==bytes||32!=bytes.length?this.priv=null:this.priv=BigInteger.fromByteArrayUnsigned(bytes)}this.compressed=void 0==this.compressed?!!ECKey.compressByDefault:this.compressed};return ECKey.privateKeyPrefix=128,ECKey.compressByDefault=!1,ECKey.prototype.setCompressed=function(v){return this.compressed=!!v,this.pubPoint&&(this.pubPoint.compressed=this.compressed),this},ECKey.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)},ECKey.prototype.getPubPoint=function(){return this.pubPoint||(this.pubPoint=ecparams.getG().multiply(this.priv),this.pubPoint.compressed=this.compressed),this.pubPoint},ECKey.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()},ECKey.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())},ECKey.prototype.getBitcoinAddress=function(){var hash=this.getPubKeyHash(),addr=new Bitcoin.Address(hash);return addr.toString()},ECKey.prototype.setPub=function(pub){Bitcoin.Util.isArray(pub)&&(pub=Crypto.util.bytesToHex(pub).toString().toUpperCase());var ecPoint=ecparams.getCurve().decodePointHex(pub);return this.setCompressed(ecPoint.compressed),this.pubPoint=ecPoint,this},ECKey.prototype.getBitcoinWalletImportFormat=function(){var bytes=this.getBitcoinPrivateKeyByteArray();bytes.unshift(ECKey.privateKeyPrefix),this.compressed&&bytes.push(1);var checksum=Crypto.SHA256(Crypto.SHA256(bytes,{asBytes:!0}),{asBytes:!0});bytes=bytes.concat(checksum.slice(0,4));var privWif=Bitcoin.Base58.encode(bytes);return privWif},ECKey.prototype.getBitcoinHexFormat=function(){return Crypto.util.bytesToHex(this.getBitcoinPrivateKeyByteArray()).toString().toUpperCase()},ECKey.prototype.getBitcoinBase64Format=function(){return Crypto.util.bytesToBase64(this.getBitcoinPrivateKeyByteArray())},ECKey.prototype.getBitcoinPrivateKeyByteArray=function(){for(var bytes=this.priv.toByteArrayUnsigned();bytes.length<32;)bytes.unshift(0);return bytes},ECKey.prototype.toString=function(format){return format=format||"","base64"==format.toString().toLowerCase()||"b64"==format.toString().toLowerCase()?this.getBitcoinBase64Format():"wif"==format.toString().toLowerCase()?this.getBitcoinWalletImportFormat():this.getBitcoinHexFormat()},ECKey.decodeWalletImportFormat=function(privStr){var bytes=Bitcoin.Base58.decode(privStr),hash=bytes.slice(0,33),checksum=Crypto.SHA256(Crypto.SHA256(hash,{asBytes:!0}),{asBytes:!0});if(checksum[0]!=bytes[33]||checksum[1]!=bytes[34]||checksum[2]!=bytes[35]||checksum[3]!=bytes[36])throw"Checksum validation failed!";var version=hash.shift();if(version!=ECKey.privateKeyPrefix)throw"Version "+version+" not supported!";return hash},ECKey.decodeCompressedWalletImportFormat=function(privStr){var bytes=Bitcoin.Base58.decode(privStr),hash=bytes.slice(0,34),checksum=Crypto.SHA256(Crypto.SHA256(hash,{asBytes:!0}),{asBytes:!0});if(checksum[0]!=bytes[34]||checksum[1]!=bytes[35]||checksum[2]!=bytes[36]||checksum[3]!=bytes[37])throw"Checksum validation failed!";var version=hash.shift();if(version!=ECKey.privateKeyPrefix)throw"Version "+version+" not supported!";return hash.pop(),hash},ECKey.isHexFormat=function(key){return key=key.toString(),/^[A-Fa-f0-9]{64}$/.test(key)},ECKey.isWalletImportFormat=function(key){return key=key.toString(),128==ECKey.privateKeyPrefix?/^5[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{50}$/.test(key):/^9[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{50}$/.test(key)},ECKey.isCompressedWalletImportFormat=function(key){return key=key.toString(),128==ECKey.privateKeyPrefix?/^[LK][123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{51}$/.test(key):/^c[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{51}$/.test(key)},ECKey.isBase64Format=function(key){return key=key.toString(),/^[ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789=+\/]{44}$/.test(key)},ECKey.isBase6Format=function(key){return key=key.toString(),/^[012345]{99}$/.test(key)},ECKey.isMiniFormat=function(key){key=key.toString();var validChars22=/^S[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21}$/.test(key),validChars26=/^S[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{25}$/.test(key),validChars30=/^S[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{29}$/.test(key),testBytes=Crypto.SHA256(key+"?",{asBytes:!0});return(0===testBytes[0]||1===testBytes[0])&&(validChars22||validChars26||validChars30)},ECKey}()}(Bitcoin),function(Bitcoin){Bitcoin.Util={isArray:Array.isArray||function(o){return"[object Array]"===Object.prototype.toString.call(o)},makeFilledArray:function(len,val){for(var array=[],i=0;len>i;)array[i++]=val;return array},numToVarInt:function(i){return 253>i?[i]:65536>=i?[253,i>>>8,255&i]:1>=i?[254].concat(Crypto.util.wordsToBytes([i])):[255].concat(Crypto.util.wordsToBytes([i>>>32,i]))},valueToBigInt:function(valueBuffer){return valueBuffer instanceof BigInteger?valueBuffer:BigInteger.fromByteArrayUnsigned(valueBuffer)},formatValue:function(valueBuffer){for(var value=this.valueToBigInt(valueBuffer).toString(),integerPart=value.length>8?value.substr(0,value.length-8):"0",decimalPart=value.length>8?value.substr(value.length-8):value;decimalPart.length<8;)decimalPart="0"+decimalPart;for(decimalPart=decimalPart.replace(/0*$/,"");decimalPart.length<2;)decimalPart+="0";return integerPart+"."+decimalPart},parseValue:function(valueString){for(var valueComp=valueString.split("."),integralPart=valueComp[0],fractionalPart=valueComp[1]||"0";fractionalPart.length<8;)fractionalPart+="0";fractionalPart=fractionalPart.replace(/^0+/g,"");var value=BigInteger.valueOf(parseInt(integralPart));return value=value.multiply(BigInteger.valueOf(1e8)),value=value.add(BigInteger.valueOf(parseInt(fractionalPart)))},sha256ripe160:function(data){return Crypto.RIPEMD160(Crypto.SHA256(data,{asBytes:!0}),{asBytes:!0})},dsha256:function(data){return Crypto.SHA256(Crypto.SHA256(data,{asBytes:!0}),{asBytes:!0})}}}(Bitcoin)},{}],17:[function(require,module,exports){(function(){var AES,BlockCipher,G,Global,scrub_vec,__hasProp={}.hasOwnProperty,__extends=function(child,parent){function ctor(){this.constructor=child}for(var key in parent)__hasProp.call(parent,key)&&(child[key]=parent[key]);return ctor.prototype=parent.prototype,child.prototype=new ctor,child.__super__=parent.prototype,child};BlockCipher=require("./algbase").BlockCipher,scrub_vec=require("./util").scrub_vec,Global=function(){function Global(){var i;this.SBOX=[],this.INV_SBOX=[],this.SUB_MIX=function(){var _i,_results;for(_results=[],i=_i=0;4>_i;i=++_i)_results.push([]);return _results}(),this.INV_SUB_MIX=function(){var _i,_results;for(_results=[],i=_i=0;4>_i;i=++_i)_results.push([]);return _results}(),this.init(),this.RCON=[0,1,2,4,8,16,32,64,128,27,54]}return Global.prototype.init=function(){var d,i,sx,t,x,x2,x4,x8,xi,_i;for(d=function(){var _i,_results;for(_results=[],i=_i=0;256>_i;i=++_i)128>i?_results.push(i<<1):_results.push(i<<1^283);return _results}(),x=0,xi=0,i=_i=0;256>_i;i=++_i)sx=xi^xi<<1^xi<<2^xi<<3^xi<<4,sx=sx>>>8^255&sx^99,this.SBOX[x]=sx,this.INV_SBOX[sx]=x,x2=d[x],x4=d[x2],x8=d[x4],t=257*d[sx]^16843008*sx,this.SUB_MIX[0][x]=t<<24|t>>>8,this.SUB_MIX[1][x]=t<<16|t>>>16,this.SUB_MIX[2][x]=t<<8|t>>>24,this.SUB_MIX[3][x]=t,t=16843009*x8^65537*x4^257*x2^16843008*x,this.INV_SUB_MIX[0][sx]=t<<24|t>>>8,this.INV_SUB_MIX[1][sx]=t<<16|t>>>16,this.INV_SUB_MIX[2][sx]=t<<8|t>>>24,this.INV_SUB_MIX[3][sx]=t,0===x?x=xi=1:(x=x2^d[d[d[x8^x2]]],xi^=d[d[xi]]);return!0},Global}(),G=new Global,AES=function(_super){function AES(key){this._key=key.clone(),this._doReset()}return __extends(AES,_super),AES.blockSize=16,AES.prototype.blockSize=AES.blockSize,AES.keySize=32,AES.prototype.keySize=AES.keySize,AES.ivSize=AES.blockSize,AES.prototype.ivSize=AES.ivSize,AES.prototype._doReset=function(){var invKsRow,keySize,keyWords,ksRow,ksRows,t,_i,_j;for(keyWords=this._key.words,keySize=this._key.sigBytes/4,this._nRounds=keySize+6,ksRows=4*(this._nRounds+1),this._keySchedule=[],ksRow=_i=0;ksRows>=0?ksRows>_i:_i>ksRows;ksRow=ksRows>=0?++_i:--_i)this._keySchedule[ksRow]=keySize>ksRow?keyWords[ksRow]:(t=this._keySchedule[ksRow-1],ksRow%keySize===0?(t=t<<8|t>>>24,t=G.SBOX[t>>>24]<<24|G.SBOX[t>>>16&255]<<16|G.SBOX[t>>>8&255]<<8|G.SBOX[255&t],t^=G.RCON[ksRow/keySize|0]<<24):keySize>6&&ksRow%keySize===4?t=G.SBOX[t>>>24]<<24|G.SBOX[t>>>16&255]<<16|G.SBOX[t>>>8&255]<<8|G.SBOX[255&t]:void 0,this._keySchedule[ksRow-keySize]^t);for(this._invKeySchedule=[],invKsRow=_j=0;ksRows>=0?ksRows>_j:_j>ksRows;invKsRow=ksRows>=0?++_j:--_j)ksRow=ksRows-invKsRow,t=this._keySchedule[ksRow-(invKsRow%4?0:4)],this._invKeySchedule[invKsRow]=4>invKsRow||4>=ksRow?t:G.INV_SUB_MIX[0][G.SBOX[t>>>24]]^G.INV_SUB_MIX[1][G.SBOX[t>>>16&255]]^G.INV_SUB_MIX[2][G.SBOX[t>>>8&255]]^G.INV_SUB_MIX[3][G.SBOX[255&t]];return!0},AES.prototype.encryptBlock=function(M,offset){return null==offset&&(offset=0),this._doCryptBlock(M,offset,this._keySchedule,G.SUB_MIX,G.SBOX)},AES.prototype.decryptBlock=function(M,offset){var _ref,_ref1;return null==offset&&(offset=0),_ref=[M[offset+3],M[offset+1]],M[offset+1]=_ref[0],M[offset+3]=_ref[1],this._doCryptBlock(M,offset,this._invKeySchedule,G.INV_SUB_MIX,G.INV_SBOX),_ref1=[M[offset+3],M[offset+1]],M[offset+1]=_ref1[0],M[offset+3]=_ref1[1],_ref1},AES.prototype.scrub=function(){return scrub_vec(this._keySchedule),scrub_vec(this._invKeySchedule),this._key.scrub()},AES.prototype._doCryptBlock=function(M,offset,keySchedule,SUB_MIX,SBOX){var ksRow,round,s0,s1,s2,s3,t0,t1,t2,t3,_i,_ref;for(s0=M[offset]^keySchedule[0],s1=M[offset+1]^keySchedule[1],s2=M[offset+2]^keySchedule[2],s3=M[offset+3]^keySchedule[3],ksRow=4,round=_i=1,_ref=this._nRounds;_ref>=1?_ref>_i:_i>_ref;round=_ref>=1?++_i:--_i)t0=SUB_MIX[0][s0>>>24]^SUB_MIX[1][s1>>>16&255]^SUB_MIX[2][s2>>>8&255]^SUB_MIX[3][255&s3]^keySchedule[ksRow++],t1=SUB_MIX[0][s1>>>24]^SUB_MIX[1][s2>>>16&255]^SUB_MIX[2][s3>>>8&255]^SUB_MIX[3][255&s0]^keySchedule[ksRow++],t2=SUB_MIX[0][s2>>>24]^SUB_MIX[1][s3>>>16&255]^SUB_MIX[2][s0>>>8&255]^SUB_MIX[3][255&s1]^keySchedule[ksRow++],t3=SUB_MIX[0][s3>>>24]^SUB_MIX[1][s0>>>16&255]^SUB_MIX[2][s1>>>8&255]^SUB_MIX[3][255&s2]^keySchedule[ksRow++],s0=t0,s1=t1,s2=t2,s3=t3;return t0=(SBOX[s0>>>24]<<24|SBOX[s1>>>16&255]<<16|SBOX[s2>>>8&255]<<8|SBOX[255&s3])^keySchedule[ksRow++],t1=(SBOX[s1>>>24]<<24|SBOX[s2>>>16&255]<<16|SBOX[s3>>>8&255]<<8|SBOX[255&s0])^keySchedule[ksRow++],t2=(SBOX[s2>>>24]<<24|SBOX[s3>>>16&255]<<16|SBOX[s0>>>8&255]<<8|SBOX[255&s1])^keySchedule[ksRow++],t3=(SBOX[s3>>>24]<<24|SBOX[s0>>>16&255]<<16|SBOX[s1>>>8&255]<<8|SBOX[255&s2])^keySchedule[ksRow++],M[offset]=t0,M[offset+1]=t1,M[offset+2]=t2,M[offset+3]=t3},AES}(BlockCipher),exports.AES=AES}).call(this)},{"./algbase":18,"./util":37}],18:[function(require,module,exports){(function(){var BlockCipher,BufferedBlockAlgorithm,Hasher,StreamCipher,WordArray,util,__hasProp={}.hasOwnProperty,__extends=function(child,parent){function ctor(){this.constructor=child}for(var key in parent)__hasProp.call(parent,key)&&(child[key]=parent[key]);return ctor.prototype=parent.prototype,child.prototype=new ctor,child.__super__=parent.prototype,child};WordArray=require("./wordarray").WordArray,util=require("./util"),BufferedBlockAlgorithm=function(){function BufferedBlockAlgorithm(){this.reset()}return BufferedBlockAlgorithm.prototype._minBufferSize=0,BufferedBlockAlgorithm.prototype.reset=function(){return this._data=new WordArray,this._nDataBytes=0},BufferedBlockAlgorithm.prototype._append=function(data){return this._data.concat(data),this._nDataBytes+=data.sigBytes},BufferedBlockAlgorithm.prototype._process=function(doFlush){var blockSizeBytes,data,dataSigBytes,dataWords,nBlocksReady,nBytesReady,nWordsReady,offset,processedWords,_i,_ref;if(data=this._data,dataWords=data.words,dataSigBytes=data.sigBytes,blockSizeBytes=4*this.blockSize,nBlocksReady=dataSigBytes/blockSizeBytes,nBlocksReady=doFlush?Math.ceil(nBlocksReady):Math.max((0|nBlocksReady)-this._minBufferSize,0),nWordsReady=nBlocksReady*this.blockSize,nBytesReady=Math.min(4*nWordsReady,dataSigBytes),nWordsReady){for(offset=_i=0,_ref=this.blockSize;_ref>0?nWordsReady>_i:_i>nWordsReady;offset=_i+=_ref)this._doProcessBlock(dataWords,offset);processedWords=dataWords.splice(0,nWordsReady),data.sigBytes-=nBytesReady}return new WordArray(processedWords,nBytesReady)},BufferedBlockAlgorithm.prototype.copy_to=function(out){return out._data=this._data.clone(),out._nDataBytes=this._nDataBytes},BufferedBlockAlgorithm.prototype.clone=function(){var obj;return obj=new BufferedBlockAlgorithm,this.copy_to(obj),obj},BufferedBlockAlgorithm}(),Hasher=function(_super){function Hasher(){Hasher.__super__.constructor.call(this)}return __extends(Hasher,_super),Hasher.prototype.reset=function(){return Hasher.__super__.reset.call(this),this._doReset(),this},Hasher.prototype.update=function(messageUpdate){return this._append(messageUpdate),this._process(),this},Hasher.prototype.finalize=function(messageUpdate){return messageUpdate&&this._append(messageUpdate),this._doFinalize()},Hasher.prototype.bufhash=function(input){var out,wa_in,wa_out;return wa_in=WordArray.from_buffer(input),wa_out=this.finalize(wa_in),out=wa_out.to_buffer(),wa_in.scrub(),wa_out.scrub(),out},Hasher}(BufferedBlockAlgorithm),exports.BlockCipher=BlockCipher=function(){function BlockCipher(key){}return BlockCipher.prototype.encryptBlock=function(M,offset){},BlockCipher}(),StreamCipher=function(){function StreamCipher(){}return StreamCipher.prototype.encryptBlock=function(word_array,dst_offset){var n_words,pad;return null==dst_offset&&(dst_offset=0),pad=this.get_pad(),n_words=Math.min(word_array.words.length-dst_offset,this.bsiw),word_array.xor(pad,{dst_offset:dst_offset,n_words:n_words}),pad.scrub(),this.bsiw},StreamCipher.prototype.encrypt=function(word_array){var i,_i,_ref,_ref1;for(i=_i=0,_ref=word_array.words.length,_ref1=this.bsiw;_ref1>0?_ref>_i:_i>_ref;i=_i+=_ref1)this.encryptBlock(word_array,i);return word_array},StreamCipher.prototype.bulk_encrypt=function(_arg,cb){var async_args,input,progress_hook,slice_args,what,_this=this;return input=_arg.input,progress_hook=_arg.progress_hook,what=_arg.what,slice_args={update:function(lo,hi){var i,_i,_ref,_results;for(_results=[],i=_i=lo,_ref=_this.bsiw;_ref>0?hi>_i:_i>hi;i=_i+=_ref)_results.push(_this.encryptBlock(input,i));return _results},finalize:function(){return input},default_n:1024*this.bsiw},async_args={progress_hook:progress_hook,cb:cb,what:what},util.bulk(input.sigBytes,slice_args,async_args)},StreamCipher}(),exports.BlockCipher=BlockCipher,exports.Hasher=Hasher,exports.BufferedBlockAlgorithm=BufferedBlockAlgorithm,exports.StreamCipher=StreamCipher}).call(this)},{"./util":37,"./wordarray":38}],19:[function(require,module,exports){(function(){var CombineBase,Concat,HMAC,SHA3,SHA512,WordArray,XOR,bulk_sign,_ref,__hasProp={}.hasOwnProperty,__extends=function(child,parent){function ctor(){this.constructor=child}for(var key in parent)__hasProp.call(parent,key)&&(child[key]=parent[key]);return ctor.prototype=parent.prototype,child.prototype=new ctor,child.__super__=parent.prototype,child};_ref=require("./hmac"),HMAC=_ref.HMAC,bulk_sign=_ref.bulk_sign,SHA512=require("./sha512").SHA512,SHA3=require("./sha3").SHA3,WordArray=require("./wordarray").WordArray,CombineBase=function(){function CombineBase(){this.hasherBlockSize=this.hashers[0].hasherBlockSize,this.hasherBlockSizeBytes=4*this.hasherBlockSize,this.reset()}return CombineBase.prototype.reset=function(){var h,_i,_len,_ref1;for(_ref1=this.hashers,_i=0,_len=_ref1.length;_len>_i;_i++)h=_ref1[_i],h.reset();return this},CombineBase.prototype.update=function(w){var h,_i,_len,_ref1;for(_ref1=this.hashers,_i=0,_len=_ref1.length;_len>_i;_i++)h=_ref1[_i],h.update(w);return this},CombineBase.prototype.scrub=function(){var h,_i,_len,_ref1;for(_ref1=this.hashers,_i=0,_len=_ref1.length;_len>_i;_i++)h=_ref1[_i],h.scrub();return this},CombineBase.prototype.finalize=function(w){var h,hashes,out,_i,_len,_ref1;for(hashes=function(){var _i,_len,_ref1,_results;for(_ref1=this.hashers,_results=[],_i=0,_len=_ref1.length;_len>_i;_i++)h=_ref1[_i],_results.push(h.finalize(w));return _results}.call(this),out=hashes[0],_ref1=hashes.slice(1),_i=0,_len=_ref1.length;_len>_i;_i++)h=_ref1[_i],this._coalesce(out,h),h.scrub();return out},CombineBase}(),Concat=function(_super){function Concat(key,klasses){var hm,i,klass,subkey,subkeys;null==klasses&&(klasses=[SHA512,SHA3]),subkeys=key.split(klasses.length),this.hashers=function(){var _i,_len,_results;for(_results=[],i=_i=0,_len=klasses.length;_len>_i;i=++_i)klass=klasses[i],subkey=subkeys[i],hm=new HMAC(subkey,klass),subkey.scrub(),_results.push(hm);return _results}(),Concat.__super__.constructor.call(this)}return __extends(Concat,_super),Concat.get_output_size=function(){return SHA512.output_size+SHA3.output_size},Concat.prototype._coalesce=function(out,h){return out.concat(h)},Concat.prototype.get_output_size=function(){var h,tot,_i,_len,_ref1;for(tot=0,_ref1=this.hashers,_i=0,_len=_ref1.length;_len>_i;_i++)h=_ref1[_i],tot+=h.get_output_size();return tot},Concat.sign=function(_arg){var input,key;return key=_arg.key,input=_arg.input,new Concat(key).finalize(input)},Concat.bulk_sign=function(args,cb){return args.klass=Concat,args.what="HMAC-SHA512-SHA3",bulk_sign(args,cb)},Concat}(CombineBase),XOR=function(_super){function XOR(key,klasses){var klass;null==klasses&&(klasses=[SHA512,SHA3]),this.hashers=function(){var _i,_len,_results;for(_results=[],_i=0,_len=klasses.length;_len>_i;_i++)klass=klasses[_i],_results.push(new HMAC(key,klass));return _results}(),XOR.__super__.constructor.call(this)}return __extends(XOR,_super),XOR.prototype.reset=function(){var h,i,_i,_len,_ref1;for(XOR.__super__.reset.call(this),_ref1=this.hashers,i=_i=0,_len=_ref1.length;_len>_i;i=++_i)h=_ref1[i],h.update(new WordArray([i]));return this},XOR.get_output_size=function(){return Math.max(SHA512.output_size,SHA3.output_size)},XOR.prototype._coalesce=function(out,h){return out.xor(h,{})},XOR.prototype.get_output_size=function(){var h;return Math.max.apply(Math,function(){var _i,_len,_ref1,_results;for(_ref1=this.hashers,_results=[],_i=0,_len=_ref1.length;_len>_i;_i++)h=_ref1[_i],_results.push(h.get_output_size());return _results}.call(this))},XOR.sign=function(_arg){var input,key;return key=_arg.key,input=_arg.input,new XOR(key).finalize(input)},XOR.bulk_sign=function(arg,cb){return arg.klass=XOR,arg.what="HMAC-SHA512-XOR-SHA3",bulk_sign(arg,cb)},XOR}(CombineBase),exports.Concat=Concat,exports.XOR=XOR}).call(this)},{"./hmac":24,"./sha3":34,"./sha512":35,"./wordarray":38}],20:[function(require,module,exports){(function(){var Cipher,Counter,StreamCipher,WordArray,bulk_encrypt,encrypt,iced,__iced_k,__iced_k_noop,__hasProp={}.hasOwnProperty,__extends=function(child,parent){function ctor(){this.constructor=child}for(var key in parent)__hasProp.call(parent,key)&&(child[key]=parent[key]);return ctor.prototype=parent.prototype,child.prototype=new ctor,child.__super__=parent.prototype,child};iced=require("iced-coffee-script/lib/coffee-script/iced").runtime,__iced_k=__iced_k_noop=function(){},WordArray=require("./wordarray").WordArray,StreamCipher=require("./algbase").StreamCipher,Counter=function(){function Counter(_arg){var i,len,value;value=_arg.value,len=_arg.len,this._value=null!=value?value.clone():(null==len?len=2:void 0,new WordArray(function(){var _i,_results;for(_results=[],i=_i=0;len>=0?len>_i:_i>len;i=len>=0?++_i:--_i)_results.push(0);return _results}()))}return Counter.prototype.WORD_MAX=4294967295,Counter.prototype.inc=function(){var go,i;for(go=!0,i=this._value.words.length-1;go&&i>=0;)++this._value.words[i]>Counter.WORD_MAX?this._value.words[i]=0:go=!1,i--;return this},Counter.prototype.inc_le=function(){var go,i;for(go=!0,i=0;go&&iCounter.WORD_MAX?this._value.words[i]=0:go=!1,i++;return this},Counter.prototype.get=function(){return this._value},Counter.prototype.copy=function(){return this._value.clone()},Counter}(),Cipher=function(_super){function Cipher(_arg){if(this.block_cipher=_arg.block_cipher,this.iv=_arg.iv,Cipher.__super__.constructor.call(this),this.bsiw=this.block_cipher.blockSize/4,this.iv.sigBytes!==this.block_cipher.blockSize)throw new Error("IV is wrong length ("+this.iv.sigBytes+")");this.ctr=new Counter({value:this.iv})}return __extends(Cipher,_super),Cipher.prototype.scrub=function(){return this.block_cipher.scrub()},Cipher.prototype.get_pad=function(){var pad;return pad=this.ctr.copy(),this.ctr.inc(),this.block_cipher.encryptBlock(pad.words),pad},Cipher}(StreamCipher),encrypt=function(_arg){var block_cipher,cipher,input,iv,ret;return block_cipher=_arg.block_cipher,iv=_arg.iv,input=_arg.input,cipher=new Cipher({block_cipher:block_cipher,iv:iv}),ret=cipher.encrypt(input),cipher.scrub(),ret},bulk_encrypt=function(_arg,cb){var block_cipher,cipher,input,iv,progress_hook,ret,what,___iced_passed_deferral,__iced_deferrals,__iced_k;__iced_k=__iced_k_noop,___iced_passed_deferral=iced.findDeferral(arguments),block_cipher=_arg.block_cipher,iv=_arg.iv,input=_arg.input,progress_hook=_arg.progress_hook,what=_arg.what,cipher=new Cipher({block_cipher:block_cipher,iv:iv}),function(__iced_k){__iced_deferrals=new iced.Deferrals(__iced_k,{parent:___iced_passed_deferral,filename:"src/ctr.iced",funcname:"bulk_encrypt"}),cipher.bulk_encrypt({input:input,progress_hook:progress_hook,what:what},__iced_deferrals.defer({assign_fn:function(){return function(){return ret=arguments[0]}}(),lineno:121})),__iced_deferrals._fulfill()}(function(){return cb(ret)})},exports.Counter=Counter,exports.Cipher=Cipher,exports.encrypt=encrypt,exports.bulk_encrypt=bulk_encrypt}).call(this)},{"./algbase":18,"./wordarray":38,"iced-coffee-script/lib/coffee-script/iced":9}],21:[function(require,module,exports){(function(){var AES,Base,Concat,Decryptor,SHA512,Salsa20,TwoFish,V,WordArray,ctr,decrypt,iced,make_esc,salsa20,__iced_k,__iced_k_noop,_ref,__hasProp={}.hasOwnProperty,__extends=function(child,parent){function ctor(){this.constructor=child}for(var key in parent)__hasProp.call(parent,key)&&(child[key]=parent[key]);return ctor.prototype=parent.prototype,child.prototype=new ctor,child.__super__=parent.prototype,child};iced=require("iced-coffee-script/lib/coffee-script/iced").runtime,__iced_k=__iced_k_noop=function(){},WordArray=require("./wordarray").WordArray,salsa20=require("./salsa20"),AES=require("./aes").AES,TwoFish=require("./twofish").TwoFish,ctr=require("./ctr"),Concat=require("./combine").Concat,SHA512=require("./sha512").SHA512,Salsa20=require("./salsa20").Salsa20,_ref=require("./enc"),Base=_ref.Base,V=_ref.V,make_esc=require("iced-error").make_esc,Decryptor=function(_super){function Decryptor(_arg){var enc,key;key=_arg.key,enc=_arg.enc,Decryptor.__super__.constructor.call(this,{key:key}),null!=enc&&(this.key=enc.key,this.derived_keys=enc.derived_keys)}return __extends(Decryptor,_super),Decryptor.prototype.read_header=function(cb){var err,wa;return err=null==(wa=this.ct.unshift(2))?new Error("Ciphertext underrun in header"):null==(this.version=V[wa.words[1]])?new Error("bad header; couldn't find a good version (got "+wa.words[1]+")"):wa.words[0]!==this.version.header[0]?new Error("Bad header: unrecognized magic value"):null,cb(err)},Decryptor.prototype.verify_sig=function(key,cb){var computed,err,received,___iced_passed_deferral,__iced_deferrals,__iced_k,_this=this;__iced_k=__iced_k_noop,___iced_passed_deferral=iced.findDeferral(arguments),function(__iced_k){return null==(received=_this.ct.unshift(Concat.get_output_size()/4))?__iced_k(err=new Error("Ciphertext underrun in signature")):void!function(__iced_k){__iced_deferrals=new iced.Deferrals(__iced_k,{parent:___iced_passed_deferral,filename:"src/dec.iced",funcname:"Decryptor.verify_sig"}),_this.sign({input:_this.ct,key:key,salt:_this.salt},__iced_deferrals.defer({assign_fn:function(){return function(){return err=arguments[0],computed=arguments[1]}}(),lineno:63})),__iced_deferrals._fulfill()}(function(){return __iced_k(err=null!=err?err:received.equal(computed)?null:new Error("Signature mismatch or bad decryption key"))})}(function(){return cb(err)})},Decryptor.prototype.unshift_iv=function(n_bytes,which,cb){var err,iv;return err=null!=(iv=this.ct.unshift(n_bytes/4))?null:new Error("Ciphertext underrun in "+which),cb(err,iv)},Decryptor.prototype.read_salt=function(cb){var err;return err=null==(this.salt=this.ct.unshift(this.version.salt_size/4))?new Error("Ciphertext underrrun in read_salt"):null,cb(err)},Decryptor.prototype.generate_keys=function(_arg,cb){var err,keys,progress_hook,___iced_passed_deferral,__iced_deferrals,__iced_k,_this=this;__iced_k=__iced_k_noop,___iced_passed_deferral=iced.findDeferral(arguments),progress_hook=_arg.progress_hook,function(__iced_k){__iced_deferrals=new iced.Deferrals(__iced_k,{parent:___iced_passed_deferral,filename:"src/dec.iced",funcname:"Decryptor.generate_keys"}),_this.kdf({salt:_this.salt,progress_hook:progress_hook},__iced_deferrals.defer({assign_fn:function(){return function(){return err=arguments[0],keys=arguments[1]}}(),lineno:114})),__iced_deferrals._fulfill()}(function(){return cb(err,keys)})},Decryptor.prototype.run=function(_arg,cb){var ct1,ct2,data,esc,iv,progress_hook,pt,___iced_passed_deferral,__iced_deferrals,__iced_k,_this=this;__iced_k=__iced_k_noop,___iced_passed_deferral=iced.findDeferral(arguments),data=_arg.data,progress_hook=_arg.progress_hook,esc=make_esc(cb,"Decryptor::run"),this.ct=WordArray.from_buffer(data),function(__iced_k){__iced_deferrals=new iced.Deferrals(__iced_k,{parent:___iced_passed_deferral,filename:"src/dec.iced",funcname:"Decryptor.run"}),_this.read_header(esc(__iced_deferrals.defer({lineno:141}))),__iced_deferrals._fulfill()}(function(){!function(__iced_k){__iced_deferrals=new iced.Deferrals(__iced_k,{parent:___iced_passed_deferral,filename:"src/dec.iced",funcname:"Decryptor.run"}),_this.read_salt(esc(__iced_deferrals.defer({lineno:142}))),__iced_deferrals._fulfill()}(function(){!function(__iced_k){__iced_deferrals=new iced.Deferrals(__iced_k,{parent:___iced_passed_deferral,filename:"src/dec.iced",funcname:"Decryptor.run"}),_this.generate_keys({progress_hook:progress_hook},esc(__iced_deferrals.defer({assign_fn:function(__slot_1){return function(){return __slot_1.keys=arguments[0]}}(_this),lineno:143}))),__iced_deferrals._fulfill()}(function(){!function(__iced_k){__iced_deferrals=new iced.Deferrals(__iced_k,{parent:___iced_passed_deferral,filename:"src/dec.iced",funcname:"Decryptor.run"}),_this.verify_sig(_this.keys.hmac,esc(__iced_deferrals.defer({lineno:144}))),__iced_deferrals._fulfill()}(function(){!function(__iced_k){__iced_deferrals=new iced.Deferrals(__iced_k,{parent:___iced_passed_deferral,filename:"src/dec.iced",funcname:"Decryptor.run"}),_this.unshift_iv(AES.ivSize,"AES",esc(__iced_deferrals.defer({assign_fn:function(){return function(){return iv=arguments[0]}}(),lineno:145}))),__iced_deferrals._fulfill()}(function(){!function(__iced_k){__iced_deferrals=new iced.Deferrals(__iced_k,{parent:___iced_passed_deferral,filename:"src/dec.iced",funcname:"Decryptor.run"}),_this.run_aes({iv:iv,input:_this.ct,key:_this.keys.aes,progress_hook:progress_hook},esc(__iced_deferrals.defer({assign_fn:function(){return function(){return ct2=arguments[0]}}(),lineno:146}))),__iced_deferrals._fulfill()}(function(){!function(__iced_k){__iced_deferrals=new iced.Deferrals(__iced_k,{parent:___iced_passed_deferral,filename:"src/dec.iced",funcname:"Decryptor.run"}),_this.unshift_iv(TwoFish.ivSize,"2fish",esc(__iced_deferrals.defer({assign_fn:function(){return function(){return iv=arguments[0]}}(),lineno:147}))),__iced_deferrals._fulfill()}(function(){!function(__iced_k){__iced_deferrals=new iced.Deferrals(__iced_k,{parent:___iced_passed_deferral,filename:"src/dec.iced",funcname:"Decryptor.run"}),_this.run_twofish({iv:iv,input:_this.ct,key:_this.keys.twofish,progress_hook:progress_hook},esc(__iced_deferrals.defer({assign_fn:function(){return function(){return ct1=arguments[0]}}(),lineno:148}))),__iced_deferrals._fulfill()}(function(){!function(__iced_k){__iced_deferrals=new iced.Deferrals(__iced_k,{parent:___iced_passed_deferral,filename:"src/dec.iced",funcname:"Decryptor.run"}),_this.unshift_iv(Salsa20.ivSize,"Salsa",esc(__iced_deferrals.defer({assign_fn:function(){return function(){return iv=arguments[0]}}(),lineno:149}))),__iced_deferrals._fulfill()}(function(){!function(__iced_k){__iced_deferrals=new iced.Deferrals(__iced_k,{parent:___iced_passed_deferral,filename:"src/dec.iced",funcname:"Decryptor.run"}),_this.run_salsa20({iv:iv,input:_this.ct,key:_this.keys.salsa20,output_iv:!1,progress_hook:progress_hook},esc(__iced_deferrals.defer({assign_fn:function(){return function(){return pt=arguments[0]}}(),lineno:150}))),__iced_deferrals._fulfill()}(function(){return cb(null,pt.to_buffer())})})})})})})})})})})},Decryptor}(Base),decrypt=function(_arg,cb){var data,dec,err,key,progress_hook,pt,___iced_passed_deferral,__iced_deferrals,__iced_k;__iced_k=__iced_k_noop,___iced_passed_deferral=iced.findDeferral(arguments),key=_arg.key,data=_arg.data,progress_hook=_arg.progress_hook,dec=new Decryptor({key:key}),function(__iced_k){__iced_deferrals=new iced.Deferrals(__iced_k,{parent:___iced_passed_deferral,filename:"src/dec.iced",funcname:"decrypt"}),dec.run({data:data,progress_hook:progress_hook},__iced_deferrals.defer({assign_fn:function(){return function(){return err=arguments[0],pt=arguments[1]}}(),lineno:168})),__iced_deferrals._fulfill()}(function(){return dec.scrub(),cb(err,pt)})},exports.Decryptor=Decryptor,exports.decrypt=decrypt}).call(this)},{
+"./aes":17,"./combine":19,"./ctr":20,"./enc":23,"./salsa20":29,"./sha512":35,"./twofish":36,"./wordarray":38,"iced-coffee-script/lib/coffee-script/iced":9,"iced-error":10}],22:[function(require,module,exports){(function(Buffer){(function(){var ADRBG,DRBG,Lock,WordArray,XOR,hmac,iced,sha3,sha512,__iced_k,__iced_k_noop;iced=require("iced-coffee-script/lib/coffee-script/iced").runtime,__iced_k=__iced_k_noop=function(){},hmac=require("./hmac"),XOR=require("./combine").XOR,sha512=require("./sha512"),sha3=require("./sha3"),WordArray=require("./wordarray").WordArray,Lock=require("./lock").Lock,DRBG=function(){function DRBG(entropy,personalization_string,hmac_func){this.hmac=hmac_func||hmac.sign,this.security_strength=256,entropy=this.check_entropy(entropy),personalization_string||(personalization_string=new WordArray([])),this._instantiate(entropy,personalization_string)}return DRBG.prototype.check_entropy=function(entropy,reseed){if(null==reseed&&(reseed=!1),8*entropy.sigBytes*2<(reseed?2:3)*this.security_strength)throw new Error("entropy must be at least "+1.5*this.security_strength+" bits.");return entropy},DRBG.prototype._hmac=function(key,input){return this.hmac({key:key,input:input})},DRBG.prototype._update=function(provided_data){var V,V_in;return V=new WordArray([0],1),null!=provided_data&&(V=V.concat(provided_data)),V_in=this.V.clone().concat(V),this.K=this._hmac(this.K,V_in),V_in.scrub(),V.scrub(),this.V=this._hmac(this.K,this.V),null!=provided_data&&(V_in=this.V.clone().concat(new WordArray([1<<24],1)).concat(provided_data),this.K=this._hmac(this.K,V_in),V_in.scrub(),this.V=this._hmac(this.K,this.V)),null!=provided_data?provided_data.scrub():void 0},DRBG.prototype._instantiate=function(entropy,personalization_string){var i,n,seed_material;return seed_material=entropy.concat(personalization_string),n=64,this.K=WordArray.from_buffer(new Buffer(function(){var _i,_results;for(_results=[],i=_i=0;n>=0?n>_i:_i>n;i=n>=0?++_i:--_i)_results.push(0);return _results}())),this.V=WordArray.from_buffer(new Buffer(function(){var _i,_results;for(_results=[],i=_i=0;n>=0?n>_i:_i>n;i=n>=0?++_i:--_i)_results.push(1);return _results}())),this._update(seed_material),entropy.scrub(),this.reseed_counter=1},DRBG.prototype.reseed=function(entropy){return this._update(this.check_entropy(entropy,!0)),this.reseed_counter=1},DRBG.prototype.generate=function(num_bytes){var i,tmp,_ref;if(8*num_bytes>7500)throw new Error("generate cannot generate > 7500 bits in 1 call.");if(this.reseed_counter>=1e4)throw new Error("Need a reseed!");for(tmp=[],i=0;0===tmp.length||tmp.length*tmp[0].length*4100?void!function(__iced_k){__iced_deferrals=new iced.Deferrals(__iced_k,{parent:___iced_passed_deferral,filename:"src/drbg.iced",funcname:"ADRBG.generate"}),_this.gen_seed(256,__iced_deferrals.defer({assign_fn:function(){return function(){return seed=arguments[0]}}(),lineno:153})),__iced_deferrals._fulfill()}(function(){return __iced_k(_this.drbg.reseed(seed))}):__iced_k()}(function(){return ret=_this.drbg.generate(n),_this.lock.release(),cb(ret)})})})},ADRBG}(),exports.DRBG=DRBG,exports.ADRBG=ADRBG}).call(this)}).call(this,require("buffer").Buffer)},{"./combine":19,"./hmac":24,"./lock":25,"./sha3":34,"./sha512":35,"./wordarray":38,buffer:1,"iced-coffee-script/lib/coffee-script/iced":9}],23:[function(require,module,exports){(function(){var AES,Base,Concat,Encryptor,HMAC_SHA256,PBKDF2,SHA512,Scrypt,TwoFish,V,WordArray,XOR,ctr,encrypt,iced,make_esc,prng,salsa20,util,__iced_k,__iced_k_noop,_ref,__hasProp={}.hasOwnProperty,__extends=function(child,parent){function ctor(){this.constructor=child}for(var key in parent)__hasProp.call(parent,key)&&(child[key]=parent[key]);return ctor.prototype=parent.prototype,child.prototype=new ctor,child.__super__=parent.prototype,child};iced=require("iced-coffee-script/lib/coffee-script/iced").runtime,__iced_k=__iced_k_noop=function(){},WordArray=require("./wordarray").WordArray,salsa20=require("./salsa20"),AES=require("./aes").AES,TwoFish=require("./twofish").TwoFish,ctr=require("./ctr"),_ref=require("./combine"),XOR=_ref.XOR,Concat=_ref.Concat,SHA512=require("./sha512").SHA512,PBKDF2=require("./pbkdf2").PBKDF2,Scrypt=require("./scrypt").Scrypt,util=require("./util"),prng=require("./prng"),make_esc=require("iced-error").make_esc,HMAC_SHA256=require("./hmac").HMAC_SHA256,V={1:{header:[479516638,1],salt_size:8,xsalsa20_rev:!0,kdf:{klass:PBKDF2,opts:{c:1024,klass:XOR}},hmac_key_size:96},2:{header:[479516638,2],salt_size:16,xsalsa20_rev:!0,kdf:{klass:Scrypt,opts:{c:64,klass:XOR,N:12,r:8,p:1}},hmac_key_size:96},3:{header:[479516638,3],salt_size:16,xsalsa20_rev:!1,kdf:{klass:Scrypt,opts:{c:1,klass:HMAC_SHA256,N:16,r:8,p:1}},hmac_key_size:96}},Base=function(){function Base(_arg){var key,version;if(key=_arg.key,version=_arg.version,this.version=V[null!=version?version:1],null==this.version)throw new Error("unknown version: "+version);this.set_key(key),this.derived_keys={}}return Base.prototype.kdf=function(_arg,cb){var args,dkLen,end,extra_keymaterial,i,k,key,keys,len,lens,order,progress_hook,raw,salt,salt_hex,v,___iced_passed_deferral,__iced_deferrals,__iced_k,_this=this;__iced_k=__iced_k_noop,___iced_passed_deferral=iced.findDeferral(arguments),salt=_arg.salt,extra_keymaterial=_arg.extra_keymaterial,progress_hook=_arg.progress_hook,function(__iced_k){__iced_deferrals=new iced.Deferrals(__iced_k,{parent:___iced_passed_deferral,filename:"src/enc.iced",funcname:"Base.kdf"}),_this._check_scrubbed(_this.key,"in KDF",cb,__iced_deferrals.defer({lineno:90})),__iced_deferrals._fulfill()}(function(){salt_hex=salt.to_hex(),key=_this.key.clone(),function(__iced_k){__iced_deferrals=new iced.Deferrals(__iced_k,{parent:___iced_passed_deferral,filename:"src/enc.iced",funcname:"Base.kdf"}),_this._check_scrubbed(key,"KDF",cb,__iced_deferrals.defer({lineno:98})),__iced_deferrals._fulfill()}(function(){!function(__iced_k){if(null!=(keys=_this.derived_keys[salt_hex]))return __iced_k();_this._kdf=new _this.version.kdf.klass(_this.version.kdf.opts),lens={hmac:_this.version.hmac_key_size,aes:AES.keySize,twofish:TwoFish.keySize,salsa20:salsa20.Salsa20.keySize},order=["hmac","aes","twofish","salsa20"],dkLen=extra_keymaterial||0;for(k in lens)v=lens[k],dkLen+=v;args={dkLen:dkLen,key:key,progress_hook:progress_hook,salt:salt},function(__iced_k){__iced_deferrals=new iced.Deferrals(__iced_k,{parent:___iced_passed_deferral,filename:"src/enc.iced",funcname:"Base.kdf"}),_this._kdf.run(args,__iced_deferrals.defer({assign_fn:function(){return function(){return raw=arguments[0]}}(),lineno:117})),__iced_deferrals._fulfill()}(function(){var _i,_len;for(keys={},i=0,_i=0,_len=order.length;_len>_i;_i++)k=order[_i],v=lens[k],len=v/4,end=i+len,keys[k]=new WordArray(raw.words.slice(i,end)),i=end;return keys.extra=new WordArray(raw.words.slice(end)).to_buffer(),__iced_k(_this.derived_keys[salt_hex]=keys)})}(function(){return cb(null,keys)})})})},Base.prototype.set_key=function(key){var wakey;return null==key?this.scrub():(wakey=WordArray.from_buffer(key),this.key&&this.key.equal(wakey)?void 0:(this.scrub(),this.key=wakey))},Base.prototype._check_scrubbed=function(key,where,ecb,okcb){return null==key||key.is_scrubbed()?ecb(new Error(""+where+": Failed due to scrubbed key!"),null):okcb()},Base.prototype.sign=function(_arg,cb){var input,key,out,progress_hook,salt,___iced_passed_deferral,__iced_deferrals,__iced_k,_this=this;__iced_k=__iced_k_noop,___iced_passed_deferral=iced.findDeferral(arguments),input=_arg.input,key=_arg.key,salt=_arg.salt,progress_hook=_arg.progress_hook,function(__iced_k){__iced_deferrals=new iced.Deferrals(__iced_k,{parent:___iced_passed_deferral,filename:"src/enc.iced",funcname:"Base.sign"}),_this._check_scrubbed(key,"HMAC",cb,__iced_deferrals.defer({lineno:175})),__iced_deferrals._fulfill()}(function(){input=new WordArray(_this.version.header).concat(salt).concat(input),function(__iced_k){__iced_deferrals=new iced.Deferrals(__iced_k,{parent:___iced_passed_deferral,filename:"src/enc.iced",funcname:"Base.sign"}),Concat.bulk_sign({key:key,input:input,progress_hook:progress_hook},__iced_deferrals.defer({assign_fn:function(){return function(){return out=arguments[0]}}(),lineno:177})),__iced_deferrals._fulfill()}(function(){return input.scrub(),cb(null,out)})})},Base.prototype.run_salsa20=function(_arg,cb){var args,ct,input,iv,key,output_iv,progress_hook,___iced_passed_deferral,__iced_deferrals,__iced_k,_this=this;__iced_k=__iced_k_noop,___iced_passed_deferral=iced.findDeferral(arguments),input=_arg.input,key=_arg.key,iv=_arg.iv,output_iv=_arg.output_iv,progress_hook=_arg.progress_hook,function(__iced_k){__iced_deferrals=new iced.Deferrals(__iced_k,{parent:___iced_passed_deferral,filename:"src/enc.iced",funcname:"Base.run_salsa20"}),_this._check_scrubbed(key,"Salsa20",cb,__iced_deferrals.defer({lineno:193})),__iced_deferrals._fulfill()}(function(){args={input:input,progress_hook:progress_hook,key:key,iv:iv},_this.version.xsalsa20_rev&&(args.key=key.clone().endian_reverse(),args.iv=iv.clone().endian_reverse()),function(__iced_k){__iced_deferrals=new iced.Deferrals(__iced_k,{parent:___iced_passed_deferral,filename:"src/enc.iced",funcname:"Base.run_salsa20"}),salsa20.bulk_encrypt(args,__iced_deferrals.defer({assign_fn:function(){return function(){return ct=arguments[0]}}(),lineno:205})),__iced_deferrals._fulfill()}(function(){return output_iv&&(ct=iv.clone().concat(ct)),_this.version.xsalsa20_rev&&(args.key.scrub(),args.iv.scrub()),cb(null,ct)})})},Base.prototype.run_twofish=function(_arg,cb){var block_cipher,ct,input,iv,key,progress_hook,___iced_passed_deferral,__iced_deferrals,__iced_k,_this=this;__iced_k=__iced_k_noop,___iced_passed_deferral=iced.findDeferral(arguments),input=_arg.input,key=_arg.key,iv=_arg.iv,progress_hook=_arg.progress_hook,function(__iced_k){__iced_deferrals=new iced.Deferrals(__iced_k,{parent:___iced_passed_deferral,filename:"src/enc.iced",funcname:"Base.run_twofish"}),_this._check_scrubbed(key,"TwoFish",cb,__iced_deferrals.defer({lineno:228})),__iced_deferrals._fulfill()}(function(){block_cipher=new TwoFish(key),function(__iced_k){__iced_deferrals=new iced.Deferrals(__iced_k,{parent:___iced_passed_deferral,filename:"src/enc.iced",funcname:"Base.run_twofish"}),ctr.bulk_encrypt({block_cipher:block_cipher,iv:iv,input:input,progress_hook:progress_hook,what:"twofish"},__iced_deferrals.defer({assign_fn:function(){return function(){return ct=arguments[0]}}(),lineno:230})),__iced_deferrals._fulfill()}(function(){return block_cipher.scrub(),cb(null,iv.clone().concat(ct))})})},Base.prototype.run_aes=function(_arg,cb){var block_cipher,ct,input,iv,key,progress_hook,___iced_passed_deferral,__iced_deferrals,__iced_k,_this=this;__iced_k=__iced_k_noop,___iced_passed_deferral=iced.findDeferral(arguments),input=_arg.input,key=_arg.key,iv=_arg.iv,progress_hook=_arg.progress_hook,function(__iced_k){__iced_deferrals=new iced.Deferrals(__iced_k,{parent:___iced_passed_deferral,filename:"src/enc.iced",funcname:"Base.run_aes"}),_this._check_scrubbed(key,"AES",cb,__iced_deferrals.defer({lineno:245})),__iced_deferrals._fulfill()}(function(){block_cipher=new AES(key),function(__iced_k){__iced_deferrals=new iced.Deferrals(__iced_k,{parent:___iced_passed_deferral,filename:"src/enc.iced",funcname:"Base.run_aes"}),ctr.bulk_encrypt({block_cipher:block_cipher,iv:iv,input:input,progress_hook:progress_hook,what:"aes"},__iced_deferrals.defer({assign_fn:function(){return function(){return ct=arguments[0]}}(),lineno:247})),__iced_deferrals._fulfill()}(function(){return block_cipher.scrub(),cb(null,iv.clone().concat(ct))})})},Base.prototype.scrub=function(){var key,key_ring,salt,_i,_len,_ref1;if(null!=this.key&&this.key.scrub(),null!=this.derived_keys){_ref1=this.derived_keys;for(salt in _ref1)for(key_ring=_ref1[salt],_i=0,_len=key_ring.length;_len>_i;_i++)key=key_ring[_i],key.scrub()}return this.derived_keys={},null!=this.salt&&this.salt.scrub(),this.salt=null,this.key=null},Base}(),Encryptor=function(_super){function Encryptor(_arg){var key,rng,version;key=_arg.key,rng=_arg.rng,version=_arg.version,Encryptor.__super__.constructor.call(this,{key:key,version:version}),this.rng=rng||prng.generate}return __extends(Encryptor,_super),Encryptor.prototype.pick_random_ivs=function(_arg,cb){var iv_lens,ivs,k,progress_hook,v,___iced_passed_deferral,__iced_deferrals,__iced_k,_this=this;__iced_k=__iced_k_noop,___iced_passed_deferral=iced.findDeferral(arguments),progress_hook=_arg.progress_hook,iv_lens={aes:AES.ivSize,twofish:TwoFish.ivSize,salsa20:salsa20.Salsa20.ivSize},ivs={},function(__iced_k){var _i,_k,_keys,_ref1,_results,_while;_ref1=iv_lens,_keys=function(){var _results1;_results1=[];for(_k in _ref1)_results1.push(_k);return _results1}(),_i=0,_results=[],(_while=function(__iced_k){var _break,_continue,_next;return _break=function(){return __iced_k(_results)},_continue=function(){return iced.trampoline(function(){return++_i,_while(__iced_k)})},_next=function(__iced_next_arg){return _results.push(__iced_next_arg),_continue()},_i<_keys.length?(k=_keys[_i],v=_ref1[k],function(__iced_k){__iced_deferrals=new iced.Deferrals(__iced_k,{parent:___iced_passed_deferral,filename:"src/enc.iced",funcname:"Encryptor.pick_random_ivs"}),_this.rng(v,__iced_deferrals.defer({assign_fn:function(__slot_1,__slot_2){return function(){return __slot_1[__slot_2]=arguments[0]}}(ivs,k),lineno:349})),__iced_deferrals._fulfill()}(_next),void 0):_break()})(__iced_k)}(function(){return cb(ivs)})},Encryptor.prototype.resalt=function(_arg,cb){var err,extra_keymaterial,progress_hook,salt,___iced_passed_deferral,__iced_deferrals,__iced_k,_this=this;__iced_k=__iced_k_noop,___iced_passed_deferral=iced.findDeferral(arguments),salt=_arg.salt,extra_keymaterial=_arg.extra_keymaterial,progress_hook=_arg.progress_hook,err=null,function(__iced_k){return null!=salt?__iced_k(salt.length!==_this.version.salt_size?err=new Error("Need a salt of exactly "+_this.version.salt_size+" bytes (got "+salt.length+")"):_this.salt=WordArray.alloc(salt)):void!function(__iced_k){__iced_deferrals=new iced.Deferrals(__iced_k,{parent:___iced_passed_deferral,filename:"src/enc.iced",funcname:"Encryptor.resalt"}),_this.rng(_this.version.salt_size,__iced_deferrals.defer({assign_fn:function(__slot_1){return function(){return __slot_1.salt=arguments[0]}}(_this),lineno:365})),__iced_deferrals._fulfill()}(__iced_k)}(function(){!function(__iced_k){return null!=err?__iced_k():void!function(__iced_k){__iced_deferrals=new iced.Deferrals(__iced_k,{parent:___iced_passed_deferral,filename:"src/enc.iced",funcname:"Encryptor.resalt"}),_this.kdf({extra_keymaterial:extra_keymaterial,progress_hook:progress_hook,salt:_this.salt},__iced_deferrals.defer({assign_fn:function(__slot_1){return function(){return err=arguments[0],__slot_1.keys=arguments[1]}}(_this),lineno:371})),__iced_deferrals._fulfill()}(__iced_k)}(function(){return cb(err,_this.keys)})})},Encryptor.prototype.run=function(_arg,cb){var ct1,ct2,ct3,data,esc,extra_keymaterial,ivs,progress_hook,pt,ret,salt,sig,___iced_passed_deferral,__iced_deferrals,__iced_k,_this=this;__iced_k=__iced_k_noop,___iced_passed_deferral=iced.findDeferral(arguments),data=_arg.data,salt=_arg.salt,extra_keymaterial=_arg.extra_keymaterial,progress_hook=_arg.progress_hook,esc=make_esc(cb,"Encryptor::run"),function(__iced_k){return null==salt&&null!=_this.salt?__iced_k():void!function(__iced_k){__iced_deferrals=new iced.Deferrals(__iced_k,{parent:___iced_passed_deferral,filename:"src/enc.iced",funcname:"Encryptor.run"}),_this.resalt({salt:salt,extra_keymaterial:extra_keymaterial,progress_hook:progress_hook},esc(__iced_deferrals.defer({lineno:402}))),__iced_deferrals._fulfill()}(__iced_k)}(function(){!function(__iced_k){__iced_deferrals=new iced.Deferrals(__iced_k,{parent:___iced_passed_deferral,filename:"src/enc.iced",funcname:"Encryptor.run"}),_this.pick_random_ivs({progress_hook:progress_hook},__iced_deferrals.defer({assign_fn:function(){return function(){return ivs=arguments[0]}}(),lineno:403})),__iced_deferrals._fulfill()}(function(){pt=WordArray.from_buffer(data),function(__iced_k){__iced_deferrals=new iced.Deferrals(__iced_k,{parent:___iced_passed_deferral,filename:"src/enc.iced",funcname:"Encryptor.run"}),_this.run_salsa20({input:pt,key:_this.keys.salsa20,progress_hook:progress_hook,iv:ivs.salsa20,output_iv:!0},esc(__iced_deferrals.defer({assign_fn:function(){return function(){return ct1=arguments[0]}}(),lineno:405}))),__iced_deferrals._fulfill()}(function(){!function(__iced_k){__iced_deferrals=new iced.Deferrals(__iced_k,{parent:___iced_passed_deferral,filename:"src/enc.iced",funcname:"Encryptor.run"}),_this.run_twofish({input:ct1,key:_this.keys.twofish,progress_hook:progress_hook,iv:ivs.twofish},esc(__iced_deferrals.defer({assign_fn:function(){return function(){return ct2=arguments[0]}}(),lineno:406}))),__iced_deferrals._fulfill()}(function(){!function(__iced_k){__iced_deferrals=new iced.Deferrals(__iced_k,{parent:___iced_passed_deferral,filename:"src/enc.iced",funcname:"Encryptor.run"}),_this.run_aes({input:ct2,key:_this.keys.aes,progress_hook:progress_hook,iv:ivs.aes},esc(__iced_deferrals.defer({assign_fn:function(){return function(){return ct3=arguments[0]}}(),lineno:407}))),__iced_deferrals._fulfill()}(function(){!function(__iced_k){__iced_deferrals=new iced.Deferrals(__iced_k,{parent:___iced_passed_deferral,filename:"src/enc.iced",funcname:"Encryptor.run"}),_this.sign({input:ct3,key:_this.keys.hmac,progress_hook:progress_hook,salt:_this.salt},esc(__iced_deferrals.defer({assign_fn:function(){return function(){return sig=arguments[0]}}(),lineno:408}))),__iced_deferrals._fulfill()}(function(){return ret=new WordArray(_this.version.header).concat(_this.salt).concat(sig).concat(ct3).to_buffer(),util.scrub_buffer(data),cb(null,ret)})})})})})})},Encryptor}(Base),encrypt=function(_arg,cb){var data,enc,err,key,progress_hook,ret,rng,version,___iced_passed_deferral,__iced_deferrals,__iced_k;__iced_k=__iced_k_noop,___iced_passed_deferral=iced.findDeferral(arguments),key=_arg.key,data=_arg.data,rng=_arg.rng,progress_hook=_arg.progress_hook,version=_arg.version,enc=new Encryptor({key:key,rng:rng,version:version}),function(__iced_k){__iced_deferrals=new iced.Deferrals(__iced_k,{parent:___iced_passed_deferral,filename:"src/enc.iced",funcname:"encrypt"}),enc.run({data:data,progress_hook:progress_hook},__iced_deferrals.defer({assign_fn:function(){return function(){return err=arguments[0],ret=arguments[1]}}(),lineno:436})),__iced_deferrals._fulfill()}(function(){return enc.scrub(),cb(err,ret)})},exports.V=V,exports.encrypt=encrypt,exports.Base=Base,exports.Encryptor=Encryptor}).call(this)},{"./aes":17,"./combine":19,"./ctr":20,"./hmac":24,"./pbkdf2":27,"./prng":28,"./salsa20":29,"./scrypt":30,"./sha512":35,"./twofish":36,"./util":37,"./wordarray":38,"iced-coffee-script/lib/coffee-script/iced":9,"iced-error":10}],24:[function(require,module,exports){(function(){var HMAC,HMAC_SHA256,SHA256,SHA512,bulk_sign,iced,sign,util,__iced_k,__iced_k_noop,__hasProp={}.hasOwnProperty,__extends=function(child,parent){function ctor(){this.constructor=child}for(var key in parent)__hasProp.call(parent,key)&&(child[key]=parent[key]);return ctor.prototype=parent.prototype,child.prototype=new ctor,child.__super__=parent.prototype,child};iced=require("iced-coffee-script/lib/coffee-script/iced").runtime,__iced_k=__iced_k_noop=function(){},SHA512=require("./sha512").SHA512,SHA256=require("./sha256").SHA256,util=require("./util"),HMAC=function(){function HMAC(key,klass){var i,_i,_ref;for(null==klass&&(klass=SHA512),this.key=key.clone(),this.hasher=new klass,this.hasherBlockSize=this.hasher.blockSize,this.hasherBlockSizeBytes=4*this.hasherBlockSize,this.key.sigBytes>this.hasherBlockSizeBytes&&(this.key=this.hasher.finalize(this.key)),this.key.clamp(),this._oKey=this.key.clone(),this._iKey=this.key.clone(),i=_i=0,_ref=this.hasherBlockSize;_ref>=0?_ref>_i:_i>_ref;i=_ref>=0?++_i:--_i)this._oKey.words[i]^=1549556828,this._iKey.words[i]^=909522486;this._oKey.sigBytes=this._iKey.sigBytes=this.hasherBlockSizeBytes,this.reset()}return HMAC.outputSize=64,HMAC.prototype.outputSize=HMAC.outputSize,HMAC.prototype.get_output_size=function(){return this.hasher.output_size},HMAC.prototype.reset=function(){return this.hasher.reset().update(this._iKey)},HMAC.prototype.update=function(wa){return this.hasher.update(wa),this},HMAC.prototype.finalize=function(wa){var innerHash,innerHash2,out;return innerHash=this.hasher.finalize(wa),this.hasher.reset(),innerHash2=this._oKey.clone().concat(innerHash),out=this.hasher.finalize(innerHash2),innerHash.scrub(),innerHash2.scrub(),out},HMAC.prototype.scrub=function(){return this.key.scrub(),this._iKey.scrub(),this._oKey.scrub()},HMAC}(),sign=function(_arg){var eng,hash_class,input,key,out;return key=_arg.key,input=_arg.input,hash_class=_arg.hash_class,eng=new HMAC(key,hash_class),out=eng.finalize(input.clamp()),eng.scrub(),out},bulk_sign=function(_arg,cb){var eng,input,key,klass,progress_hook,res,slice_args,what,___iced_passed_deferral,__iced_deferrals,__iced_k;__iced_k=__iced_k_noop,___iced_passed_deferral=iced.findDeferral(arguments),key=_arg.key,input=_arg.input,progress_hook=_arg.progress_hook,klass=_arg.klass,what=_arg.what,klass||(klass=HMAC),what||(what="hmac_sha512"),eng=new klass(key),input.clamp(),slice_args={update:function(lo,hi){return eng.update(input.slice(lo,hi))},finalize:function(){return eng.finalize()},default_n:1e3*eng.hasherBlockSize},function(__iced_k){__iced_deferrals=new iced.Deferrals(__iced_k,{parent:___iced_passed_deferral,filename:"src/hmac.iced",funcname:"bulk_sign"}),util.bulk(input.sigBytes,slice_args,{what:what,progress_hook:progress_hook,cb:__iced_deferrals.defer({assign_fn:function(){return function(){return res=arguments[0]}}(),lineno:137})}),__iced_deferrals._fulfill()}(function(){return eng.scrub(),cb(res)})},exports.HMAC_SHA256=HMAC_SHA256=function(_super){function HMAC_SHA256(key){HMAC_SHA256.__super__.constructor.call(this,key,SHA256)}return __extends(HMAC_SHA256,_super),HMAC_SHA256}(HMAC),exports.HMAC=HMAC,exports.sign=sign,exports.bulk_sign=bulk_sign}).call(this)},{"./sha256":33,"./sha512":35,"./util":37,"iced-coffee-script/lib/coffee-script/iced":9}],25:[function(require,module,exports){(function(){var Lock,NamedLock,Table,iced,__iced_k,__iced_k_noop,__hasProp={}.hasOwnProperty,__extends=function(child,parent){function ctor(){this.constructor=child}for(var key in parent)__hasProp.call(parent,key)&&(child[key]=parent[key]);return ctor.prototype=parent.prototype,child.prototype=new ctor,child.__super__=parent.prototype,child};iced=require("iced-coffee-script/lib/coffee-script/iced").runtime,__iced_k=__iced_k_noop=function(){},Lock=function(){function Lock(){this._open=!0,this._waiters=[]}return Lock.prototype.acquire=function(cb){return this._open?(this._open=!1,cb()):this._waiters.push(cb)},Lock.prototype.release=function(){var w;return this._waiters.length?(w=this._waiters.shift())():this._open=!0},Lock.prototype.open=function(){return this._open},Lock}(),NamedLock=function(_super){function NamedLock(tab,name){this.tab=tab,this.name=name,NamedLock.__super__.constructor.call(this),this.refs=0}return __extends(NamedLock,_super),NamedLock.prototype.incref=function(){return++this.refs},NamedLock.prototype.decref=function(){return--this.refs},NamedLock.prototype.release=function(){return NamedLock.__super__.release.call(this),0===this.decref()?delete this.tab[this.name]:void 0},NamedLock}(Lock),Table=function(){function Table(){this.locks={}}return Table.prototype.create=function(name){var l;return l=new NamedLock(this,name),this.locks[name]=l},Table.prototype.acquire=function(name,cb,wait){var l,was_open,___iced_passed_deferral,__iced_deferrals,__iced_k;__iced_k=__iced_k_noop,___iced_passed_deferral=iced.findDeferral(arguments),l=this.locks[name]||this.create(name),was_open=l._open,l.incref(),function(__iced_k){return wait||l._open?void!function(__iced_k){__iced_deferrals=new iced.Deferrals(__iced_k,{parent:___iced_passed_deferral,filename:"src/lock.iced",funcname:"Table.acquire"}),l.acquire(__iced_deferrals.defer({lineno:68})),__iced_deferrals._fulfill()}(__iced_k):__iced_k(l=null)}(function(){return cb(l,was_open)})},Table.prototype.lookup=function(name){return this.locks[name]},Table}(),exports.Lock=Lock,exports.Table=Table}).call(this)},{"iced-coffee-script/lib/coffee-script/iced":9}],26:[function(require,module,exports){(function(Buffer){(function(){var k,v,_ref,_ref1;_ref=require("./enc");for(k in _ref)v=_ref[k],exports[k]=v;_ref1=require("./dec");for(k in _ref1)v=_ref1[k],exports[k]=v;exports.prng=require("./prng"),exports.Buffer=Buffer,exports.WordArray=require("./wordarray").WordArray,exports.util=require("./util"),exports.ciphers={AES:require("./aes").AES,TwoFish:require("./twofish").TwoFish},exports.hash={SHA1:require("./sha1").SHA1,SHA224:require("./sha224").SHA224,SHA256:require("./sha256").SHA256,SHA512:require("./sha512").SHA512,SHA3:require("./sha3").SHA3},exports.scrypt=require("./scrypt").scrypt,exports.pbkdf2=require("./pbkdf2").pbkdf2,exports.HMAC_SHA256=require("./hmac").HMAC_SHA256}).call(this)}).call(this,require("buffer").Buffer)},{"./aes":17,"./dec":21,"./enc":23,"./hmac":24,"./pbkdf2":27,"./prng":28,"./scrypt":30,"./sha1":31,"./sha224":32,"./sha256":33,"./sha3":34,"./sha512":35,"./twofish":36,"./util":37,"./wordarray":38,buffer:1}],27:[function(require,module,exports){(function(){var HMAC,PBKDF2,WordArray,iced,pbkdf2,util,__iced_k,__iced_k_noop;iced=require("iced-coffee-script/lib/coffee-script/iced").runtime,__iced_k=__iced_k_noop=function(){},HMAC=require("./hmac").HMAC,WordArray=require("./wordarray").WordArray,util=require("./util"),PBKDF2=function(){function PBKDF2(_arg){this.klass=_arg.klass,this.c=_arg.c,this.c||(this.c=1024),this.klass||(this.klass=HMAC)}return PBKDF2.prototype._PRF=function(input){return this.prf.reset(),this.prf.finalize(input)},PBKDF2.prototype._gen_T_i=function(_arg,cb){var U,i,progress_hook,ret,salt,seed,stop,___iced_passed_deferral,__iced_deferrals,__iced_k,_this=this;__iced_k=__iced_k_noop,___iced_passed_deferral=iced.findDeferral(arguments),salt=_arg.salt,i=_arg.i,progress_hook=_arg.progress_hook,progress_hook(0),seed=salt.clone().concat(new WordArray([i])),U=this._PRF(seed),ret=U.clone(),i=1,function(__iced_k){var _results,_while;_results=[],(_while=function(__iced_k){var _break,_continue,_next;if(_break=function(){return __iced_k(_results)},_continue=function(){return iced.trampoline(function(){return _while(__iced_k)})},_next=function(__iced_next_arg){return _results.push(__iced_next_arg),_continue()},!(i<_this.c))return _break();for(stop=Math.min(_this.c,i+128);stop>i;)U=_this._PRF(U),ret.xor(U,{}),i++;progress_hook(i),function(__iced_k){__iced_deferrals=new iced.Deferrals(__iced_k,{parent:___iced_passed_deferral,filename:"src/pbkdf2.iced",funcname:"PBKDF2._gen_T_i"}),util.default_delay(0,0,__iced_deferrals.defer({lineno:57})),__iced_deferrals._fulfill()}(function(){return _next(null)})})(__iced_k)}(function(){return progress_hook(i),cb(ret)})},PBKDF2.prototype.run=function(_arg,cb){var bs,dkLen,flat,i,key,n,ph,progress_hook,salt,tmp,tph,words,___iced_passed_deferral,__iced_deferrals,__iced_k,_this=this;__iced_k=__iced_k_noop,___iced_passed_deferral=iced.findDeferral(arguments),key=_arg.key,salt=_arg.salt,dkLen=_arg.dkLen,progress_hook=_arg.progress_hook,this.prf=new this.klass(key),bs=this.prf.get_output_size(),n=Math.ceil(dkLen/bs),words=[],tph=null,ph=function(block){return function(iter){return"function"==typeof progress_hook?progress_hook({what:"pbkdf2",total:n*_this.c,i:block*_this.c+iter}):void 0}},ph(0)(0),function(__iced_k){var _results,_while;i=1,_results=[],(_while=function(__iced_k){var _break,_continue,_next;return _break=function(){return __iced_k(_results)},_continue=function(){return iced.trampoline(function(){return++i,_while(__iced_k)})},_next=function(__iced_next_arg){return _results.push(__iced_next_arg),_continue()},n>=i?void!function(__iced_k){__iced_deferrals=new iced.Deferrals(__iced_k,{parent:___iced_passed_deferral,filename:"src/pbkdf2.iced",funcname:"PBKDF2.run"}),_this._gen_T_i({salt:salt,i:i,progress_hook:ph(i-1)},__iced_deferrals.defer({assign_fn:function(){return function(){return tmp=arguments[0]}}(),lineno:80})),__iced_deferrals._fulfill()}(function(){return _next(words.push(tmp.words))}):_break()})(__iced_k)}(function(){var _ref;return ph(n)(0),flat=(_ref=[]).concat.apply(_ref,words),key.scrub(),_this.prf.scrub(),_this.prf=null,cb(new WordArray(flat,dkLen))})},PBKDF2}(),pbkdf2=function(_arg,cb){var c,dkLen,eng,key,klass,out,progress_hook,salt,___iced_passed_deferral,__iced_deferrals,__iced_k;__iced_k=__iced_k_noop,___iced_passed_deferral=iced.findDeferral(arguments),key=_arg.key,salt=_arg.salt,klass=_arg.klass,c=_arg.c,dkLen=_arg.dkLen,progress_hook=_arg.progress_hook,eng=new PBKDF2({klass:klass,c:c}),function(__iced_k){__iced_deferrals=new iced.Deferrals(__iced_k,{parent:___iced_passed_deferral,filename:"src/pbkdf2.iced",funcname:"pbkdf2"}),eng.run({key:key,salt:salt,dkLen:dkLen,progress_hook:progress_hook},__iced_deferrals.defer({assign_fn:function(){return function(){return out=arguments[0]}}(),lineno:106})),__iced_deferrals._fulfill()}(function(){return cb(out)})},exports.pbkdf2=pbkdf2,exports.PBKDF2=PBKDF2}).call(this)},{"./hmac":24,"./util":37,"./wordarray":38,"iced-coffee-script/lib/coffee-script/iced":9}],28:[function(require,module,exports){(function(Buffer){(function(){var ADRBG,PRNG,WordArray,XOR,browser_rng,e,generate,iced,more_entropy,native_rng,rng,util,__iced_k,__iced_k_noop,_native_rng,_prng,_ref;if(iced=require("iced-coffee-script/lib/coffee-script/iced").runtime,__iced_k=__iced_k_noop=function(){},more_entropy=require("more-entropy"),ADRBG=require("./drbg").ADRBG,WordArray=require("./wordarray").WordArray,XOR=require("./combine").XOR,util=require("./util"),browser_rng=function(n){var v;return v=new Uint8Array(n),window.crypto.getRandomValues(v),new Buffer(v)},null!=("undefined"!=typeof window&&null!==window&&null!=(_ref=window.crypto)?_ref.getRandomValues:void 0))_native_rng=browser_rng;else try{rng=require("crypto").rng,null!=rng&&(_native_rng=rng)}catch(_error){e=_error}native_rng=function(x){if(null==_native_rng)throw new Error('No rng found; tried requiring "crypto" and window.crypto');return _native_rng(x)},PRNG=function(){function PRNG(){var _this=this;this.meg=new more_entropy.Generator,this.adrbg=new ADRBG(function(n,cb){return _this.gen_seed(n,cb)},XOR.sign)}return PRNG.prototype.now_to_buffer=function(){var buf,d,ms,s;return d=Date.now(),ms=d%1e3,s=Math.floor(d/1e3),buf=new Buffer(8),buf.writeUInt32BE(s,0),buf.writeUInt32BE(ms,4),buf},PRNG.prototype.gen_seed=function(nbits,cb){var b,bufs,cat,nbytes,wa,words,___iced_passed_deferral,__iced_deferrals,__iced_k,_this=this;
+__iced_k=__iced_k_noop,___iced_passed_deferral=iced.findDeferral(arguments),nbytes=nbits/8,bufs=[],bufs.push(this.now_to_buffer()),function(__iced_k){__iced_deferrals=new iced.Deferrals(__iced_k,{parent:___iced_passed_deferral,filename:"src/prng.iced",funcname:"PRNG.gen_seed"}),_this.meg.generate(nbits,__iced_deferrals.defer({assign_fn:function(){return function(){return words=arguments[0]}}(),lineno:76})),__iced_deferrals._fulfill()}(function(){var _i,_len;for(bufs.push(_this.now_to_buffer()),bufs.push(new Buffer(words)),bufs.push(native_rng(nbytes)),bufs.push(_this.now_to_buffer()),cat=Buffer.concat(bufs),wa=WordArray.from_buffer(cat),util.scrub_buffer(cat),_i=0,_len=bufs.length;_len>_i;_i++)b=bufs[_i],util.scrub_buffer(b);return cb(wa)})},PRNG.prototype.generate=function(n,cb){return this.adrbg.generate(n,cb)},PRNG}(),_prng=null,generate=function(n,cb){return null==_prng&&(_prng=new PRNG),_prng.generate(n,cb)},exports.PRNG=PRNG,exports.generate=generate,exports.native_rng=native_rng}).call(this)}).call(this,require("buffer").Buffer)},{"./combine":19,"./drbg":22,"./util":37,"./wordarray":38,buffer:1,"iced-coffee-script/lib/coffee-script/iced":9,"more-entropy":40}],29:[function(require,module,exports){(function(Buffer){(function(){var Cipher,Counter,Salsa20,Salsa20Core,Salsa20InnerCore,Salsa20WordStream,StreamCipher,WordArray,asum,bulk_encrypt,encrypt,endian_reverse,fixup_uint32,iced,util,__iced_k,__iced_k_noop,_ref,_ref1,_ref2,__hasProp={}.hasOwnProperty,__extends=function(child,parent){function ctor(){this.constructor=child}for(var key in parent)__hasProp.call(parent,key)&&(child[key]=parent[key]);return ctor.prototype=parent.prototype,child.prototype=new ctor,child.__super__=parent.prototype,child};iced=require("iced-coffee-script/lib/coffee-script/iced").runtime,__iced_k=__iced_k_noop=function(){},_ref=require("./wordarray"),endian_reverse=_ref.endian_reverse,WordArray=_ref.WordArray,Counter=require("./ctr").Counter,fixup_uint32=require("./util").fixup_uint32,StreamCipher=require("./algbase").StreamCipher,util=require("./util"),asum=function(out,v){var e,i,_i,_len;for(i=_i=0,_len=v.length;_len>_i;i=++_i)e=v[i],out[i]+=e;return!1},Salsa20InnerCore=function(){function Salsa20InnerCore(rounds){this.rounds=rounds}return Salsa20InnerCore.prototype._core=function(v){"use asm";var i,u,x0,x1,x10,x11,x12,x13,x14,x15,x2,x3,x4,x5,x6,x7,x8,x9,_i,_ref1;x0=v[0],x1=v[1],x2=v[2],x3=v[3],x4=v[4],x5=v[5],x6=v[6],x7=v[7],x8=v[8],x9=v[9],x10=v[10],x11=v[11],x12=v[12],x13=v[13],x14=v[14],x15=v[15];for(i=_i=0,_ref1=this.rounds;_i<_ref1;i=_i+=2){u=x0+x12|0;x4^=u<<7|u>>>25;u=x4+x0|0;x8^=u<<9|u>>>23;u=x8+x4|0;x12^=u<<13|u>>>19;u=x12+x8|0;x0^=u<<18|u>>>14;u=x5+x1|0;x9^=u<<7|u>>>25;u=x9+x5|0;x13^=u<<9|u>>>23;u=x13+x9|0;x1^=u<<13|u>>>19;u=x1+x13|0;x5^=u<<18|u>>>14;u=x10+x6|0;x14^=u<<7|u>>>25;u=x14+x10|0;x2^=u<<9|u>>>23;u=x2+x14|0;x6^=u<<13|u>>>19;u=x6+x2|0;x10^=u<<18|u>>>14;u=x15+x11|0;x3^=u<<7|u>>>25;u=x3+x15|0;x7^=u<<9|u>>>23;u=x7+x3|0;x11^=u<<13|u>>>19;u=x11+x7|0;x15^=u<<18|u>>>14;u=x0+x3|0;x1^=u<<7|u>>>25;u=x1+x0|0;x2^=u<<9|u>>>23;u=x2+x1|0;x3^=u<<13|u>>>19;u=x3+x2|0;x0^=u<<18|u>>>14;u=x5+x4|0;x6^=u<<7|u>>>25;u=x6+x5|0;x7^=u<<9|u>>>23;u=x7+x6|0;x4^=u<<13|u>>>19;u=x4+x7|0;x5^=u<<18|u>>>14;u=x10+x9|0;x11^=u<<7|u>>>25;u=x11+x10|0;x8^=u<<9|u>>>23;u=x8+x11|0;x9^=u<<13|u>>>19;u=x9+x8|0;x10^=u<<18|u>>>14;u=x15+x14|0;x12^=u<<7|u>>>25;u=x12+x15|0;x13^=u<<9|u>>>23;u=x13+x12|0;x14^=u<<13|u>>>19;u=x14+x13|0;x15^=u<<18|u>>>14}return[x0,x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12,x13,x14,x15]},Salsa20InnerCore}(),Salsa20Core=function(_super){function Salsa20Core(key,nonce){var _ref1;if(Salsa20Core.__super__.constructor.call(this,20),this.key=key.clone().endian_reverse(),this.nonce=nonce.clone().endian_reverse(),(16!==this.key.sigBytes||8!==this.nonce.sigBytes)&&(32!==this.key.sigBytes||8!==(_ref1=this.nonce.sigBytes)&&24!==_ref1))throw new Error("Bad key/nonce lengths");24===this.nonce.sigBytes&&this.xsalsa_setup(),this.input=this.key_iv_setup(this.nonce,this.key),this._reset()}return __extends(Salsa20Core,_super),Salsa20Core.prototype.sigma=WordArray.from_buffer_le(new Buffer("expand 32-byte k")),Salsa20Core.prototype.tau=WordArray.from_buffer_le(new Buffer("expand 16-byte k")),Salsa20Core.blockSize=64,Salsa20Core.prototype.blockSize=Salsa20Core.blockSize,Salsa20Core.keySize=32,Salsa20Core.prototype.keySize=Salsa20Core.keySize,Salsa20Core.ivSize=24,Salsa20Core.prototype.ivSize=Salsa20Core.ivSize,Salsa20Core.prototype.scrub=function(){return this.key.scrub(),this.nonce.scrub(),util.scrub_vec(this.input)},Salsa20Core.prototype.xsalsa_setup=function(){var n0,n1;return n0=new WordArray(this.nonce.words.slice(0,4)),this.nonce=n1=new WordArray(this.nonce.words.slice(4)),this.key=this.hsalsa20(n0,this.key)},Salsa20Core.prototype.hsalsa20=function(nonce,key){var i,indexes,input,v;return input=this.key_iv_setup(nonce,key),input[8]=nonce.words[2],input[9]=nonce.words[3],v=this._core(input),indexes=[0,5,10,15,6,7,8,9],v=function(){var _i,_len,_results;for(_results=[],_i=0,_len=indexes.length;_len>_i;_i++)i=indexes[_i],_results.push(fixup_uint32(v[i]));return _results}(),util.scrub_vec(input),new WordArray(v)},Salsa20Core.prototype.key_iv_setup=function(nonce,key){var A,C,i,out,_i,_j,_k,_ref1;for(out=[],i=_i=0;4>_i;i=++_i)out[i+1]=key.words[i];for(_ref1=32===key.sigBytes?[this.sigma,key.words.slice(4)]:[this.tau,key.words],C=_ref1[0],A=_ref1[1],i=_j=0;4>_j;i=++_j)out[i+11]=A[i];for(i=_k=0;4>_k;i=++_k)out[5*i]=C.words[i];return out[6]=nonce.words[0],out[7]=nonce.words[1],out},Salsa20Core.prototype.counter_setup=function(){return this.input[8]=this.counter.get().words[0],this.input[9]=this.counter.get().words[1]},Salsa20Core.prototype._reset=function(){return this.counter=new Counter({len:2})},Salsa20Core.prototype._generateBlock=function(){var v;return this.counter_setup(),v=this._core(this.input),asum(v,this.input),this.counter.inc_le(),v},Salsa20Core}(Salsa20InnerCore),exports.Salsa20WordStream=Salsa20WordStream=function(_super){function Salsa20WordStream(){return _ref1=Salsa20WordStream.__super__.constructor.apply(this,arguments)}return __extends(Salsa20WordStream,_super),Salsa20WordStream.prototype._reset=function(){return Salsa20WordStream.__super__._reset.call(this)},Salsa20WordStream.prototype.getWordArray=function(nbytes){var blocks,i,nblocks,w,words,_i,_len,_ref2;for(null==nbytes||nbytes===this.blockSize?words=this._generateBlock():(nblocks=Math.ceil(nbytes/this.blockSize),blocks=function(){var _i,_results;for(_results=[],i=_i=0;nblocks>=0?nblocks>_i:_i>nblocks;i=nblocks>=0?++_i:--_i)_results.push(this._generateBlock());return _results}.call(this),words=(_ref2=[]).concat.apply(_ref2,blocks)),i=_i=0,_len=words.length;_len>_i;i=++_i)w=words[i],words[i]=endian_reverse(w);return new WordArray(words,nbytes)},Salsa20WordStream}(Salsa20Core),exports.Salsa20=Salsa20=function(_super){function Salsa20(){return _ref2=Salsa20.__super__.constructor.apply(this,arguments)}return __extends(Salsa20,_super),Salsa20.prototype._reset=function(){return Salsa20.__super__._reset.call(this),this._i=this.blockSize},Salsa20.prototype.getBytes=function(needed){var bsz,n,v;if(null==needed&&(needed=this.blockSize),v=[],bsz=this.blockSize,this._i===bsz&&needed===bsz)return this._generateBlockBuffer();for(;needed>0;)this._i===bsz&&(this._generateBlockBuffer(),this._i=0),n=Math.min(needed,bsz-this._i),v.push(n===bsz?this._buf:this._buf.slice(this._i,this._i+n)),this._i+=n,needed-=n;return Buffer.concat(v)},Salsa20.prototype._generateBlockBuffer=function(){var e,i,v,_i,_len;for(this._buf=new Buffer(this.blockSize),v=this._generateBlock(),i=_i=0,_len=v.length;_len>_i;i=++_i)e=v[i],this._buf.writeUInt32LE(fixup_uint32(e),4*i);return this._buf},Salsa20}(Salsa20Core),exports.Cipher=Cipher=function(_super){function Cipher(_arg){var iv,key;key=_arg.key,iv=_arg.iv,Cipher.__super__.constructor.call(this),this.salsa=new Salsa20WordStream(key,iv),this.bsiw=this.salsa.blockSize/4}return __extends(Cipher,_super),Cipher.prototype.scrub=function(){return this.salsa.scrub()},Cipher.prototype.get_pad=function(){var pad;return pad=this.salsa.getWordArray()},Cipher}(StreamCipher),exports.encrypt=encrypt=function(_arg){var cipher,input,iv,key,ret;return key=_arg.key,iv=_arg.iv,input=_arg.input,cipher=new Cipher({key:key,iv:iv}),ret=cipher.encrypt(input),cipher.scrub(),ret},exports.bulk_encrypt=bulk_encrypt=function(_arg,cb){var cipher,input,iv,key,progress_hook,ret,___iced_passed_deferral,__iced_deferrals,__iced_k;__iced_k=__iced_k_noop,___iced_passed_deferral=iced.findDeferral(arguments),key=_arg.key,iv=_arg.iv,input=_arg.input,progress_hook=_arg.progress_hook,cipher=new Cipher({key:key,iv:iv}),function(__iced_k){__iced_deferrals=new iced.Deferrals(__iced_k,{parent:___iced_passed_deferral,filename:"src/salsa20.iced",funcname:"bulk_encrypt"}),cipher.bulk_encrypt({input:input,progress_hook:progress_hook,what:"salsa20"},__iced_deferrals.defer({assign_fn:function(){return function(){return ret=arguments[0]}}(),lineno:257})),__iced_deferrals._fulfill()}(function(){return cipher.scrub(),cb(ret)})},exports.Salsa20InnerCore=Salsa20InnerCore,exports.endian_reverse=endian_reverse,exports.asum=asum}).call(this)}).call(this,require("buffer").Buffer)},{"./algbase":18,"./ctr":20,"./util":37,"./wordarray":38,buffer:1,"iced-coffee-script/lib/coffee-script/iced":9}],30:[function(require,module,exports){(function(){var HMAC_SHA256,Salsa20InnerCore,Scrypt,WordArray,blkcpy,blkxor,default_delay,endian_reverse,fixup_uint32,iced,pbkdf2,scrub_vec,scrypt,ui8a_to_buffer,v_endian_reverse,__iced_k,__iced_k_noop,_ref,_ref1,_ref2;iced=require("iced-coffee-script/lib/coffee-script/iced").runtime,__iced_k=__iced_k_noop=function(){},HMAC_SHA256=require("./hmac").HMAC_SHA256,pbkdf2=require("./pbkdf2").pbkdf2,_ref=require("./salsa20"),endian_reverse=_ref.endian_reverse,Salsa20InnerCore=_ref.Salsa20InnerCore,_ref1=require("./wordarray"),ui8a_to_buffer=_ref1.ui8a_to_buffer,WordArray=_ref1.WordArray,_ref2=require("./util"),fixup_uint32=_ref2.fixup_uint32,default_delay=_ref2.default_delay,scrub_vec=_ref2.scrub_vec,blkcpy=function(D,S,d_offset,s_offset,len){"use asm";var end,i,j;j=d_offset<<4|0;i=s_offset<<4|0;end=i+(len<<4)|0;while(i_i;i=++_i)e=v[i],v[i]=endian_reverse(e);return!0},Scrypt=function(){function Scrypt(_arg){var N,c,c0,c1;N=_arg.N,this.r=_arg.r,this.p=_arg.p,c=_arg.c,c0=_arg.c0,c1=_arg.c1,this.klass=_arg.klass,this.N||(this.N=1<<(N||10)),this.r||(this.r=16),this.p||(this.p=2),this.c0=c0||c||1,this.c1=c1||c||1,this.klass||(this.klass=HMAC_SHA256),this.X16_tmp=new Int32Array(16),this.s20ic=new Salsa20InnerCore(8)}return Scrypt.prototype.salsa20_8=function(B){var X,i,x,_i,_len;for(X=this.s20ic._core(B),i=_i=0,_len=X.length;_len>_i;i=++_i)x=X[i],B[i]+=x;return!0},Scrypt.prototype.pbkdf2=function(_arg,cb){var c,dkLen,key,progress_hook,salt,wa,___iced_passed_deferral,__iced_deferrals,__iced_k,_this=this;__iced_k=__iced_k_noop,___iced_passed_deferral=iced.findDeferral(arguments),key=_arg.key,salt=_arg.salt,dkLen=_arg.dkLen,progress_hook=_arg.progress_hook,c=_arg.c,function(__iced_k){__iced_deferrals=new iced.Deferrals(__iced_k,{parent:___iced_passed_deferral,filename:"src/scrypt.iced",funcname:"Scrypt.pbkdf2"}),pbkdf2({key:key,salt:salt,c:c,dkLen:dkLen,klass:_this.klass,progress_hook:progress_hook},__iced_deferrals.defer({assign_fn:function(){return function(){return wa=arguments[0]}}(),lineno:103})),__iced_deferrals._fulfill()}(function(){return cb(wa)})},Scrypt.prototype.blockmix_salsa8=function(B,Y){var X,i,_i,_j,_k,_ref3,_ref4,_ref5;for(X=this.X16_tmp,blkcpy(X,B,0,2*this.r-1,1),i=_i=0,_ref3=2*this.r;_ref3>=0?_ref3>_i:_i>_ref3;i=_ref3>=0?++_i:--_i)blkxor(X,B,i,1),this.salsa20_8(X),blkcpy(Y,X,i,0,1);for(i=_j=0,_ref4=this.r;_ref4>=0?_ref4>_j:_j>_ref4;i=_ref4>=0?++_j:--_j)blkcpy(B,Y,i,2*i,1);for(i=_k=0,_ref5=this.r;_ref5>=0?_ref5>_k:_k>_ref5;i=_ref5>=0?++_k:--_k)blkcpy(B,Y,i+this.r,2*i+1,1);return!0},Scrypt.prototype.smix=function(_arg,cb){var B,V,X,XY,Y,i,j,lim,progress_hook,stop,___iced_passed_deferral,__iced_deferrals,__iced_k,_this=this;__iced_k=__iced_k_noop,___iced_passed_deferral=iced.findDeferral(arguments),B=_arg.B,V=_arg.V,XY=_arg.XY,progress_hook=_arg.progress_hook,X=XY,lim=2*this.r,Y=XY.subarray(16*lim),blkcpy(X,B,0,0,lim),i=0,function(__iced_k){var _results,_while;_results=[],(_while=function(__iced_k){var _break,_continue,_next;if(_break=function(){return __iced_k(_results)},_continue=function(){return iced.trampoline(function(){return _while(__iced_k)})},_next=function(__iced_next_arg){return _results.push(__iced_next_arg),_continue()},!(i<_this.N))return _break();for(stop=Math.min(_this.N,i+2048);stop>i;)blkcpy(V,X,lim*i,0,lim),_this.blockmix_salsa8(X,Y),i++;"function"==typeof progress_hook&&progress_hook(i),function(__iced_k){__iced_deferrals=new iced.Deferrals(__iced_k,{parent:___iced_passed_deferral,filename:"src/scrypt.iced",funcname:"Scrypt.smix"}),default_delay(0,0,__iced_deferrals.defer({lineno:156})),__iced_deferrals._fulfill()}(_next)})(__iced_k)}(function(){i=0,function(__iced_k){var _results,_while;_results=[],(_while=function(__iced_k){var _break,_continue,_next;if(_break=function(){return __iced_k(_results)},_continue=function(){return iced.trampoline(function(){return _while(__iced_k)})},_next=function(__iced_next_arg){return _results.push(__iced_next_arg),_continue()},!(i<_this.N))return _break();for(stop=Math.min(_this.N,i+256);stop>i;)j=fixup_uint32(X[16*(lim-1)])&_this.N-1,blkxor(X,V,j*lim,lim),_this.blockmix_salsa8(X,Y),i++;"function"==typeof progress_hook&&progress_hook(i+_this.N),function(__iced_k){__iced_deferrals=new iced.Deferrals(__iced_k,{parent:___iced_passed_deferral,filename:"src/scrypt.iced",funcname:"Scrypt.smix"}),default_delay(0,0,__iced_deferrals.defer({lineno:173})),__iced_deferrals._fulfill()}(_next)})(__iced_k)}(function(){return blkcpy(B,X,0,0,lim),cb()})})},Scrypt.prototype.run=function(_arg,cb){var B,MAX,V,XY,dkLen,err,j,key,lph,out,progress_hook,ret,salt,___iced_passed_deferral,__iced_deferrals,__iced_k,_this=this;__iced_k=__iced_k_noop,___iced_passed_deferral=iced.findDeferral(arguments),key=_arg.key,salt=_arg.salt,dkLen=_arg.dkLen,progress_hook=_arg.progress_hook,MAX=4294967295,err=ret=null,err=dkLen>MAX?err=new Error("asked for too much data"):this.r*this.p>=1<<30?new Error("r & p are too big"):this.r>MAX/128/this.p||this.r>MAX/256||this.N>MAX/128/this.r?new Error("N is too big"):null,XY=new Int32Array(64*this.r),V=new Int32Array(32*this.r*this.N),lph=function(o){return o.what+=" (pass 1)","function"==typeof progress_hook?progress_hook(o):void 0},function(__iced_k){__iced_deferrals=new iced.Deferrals(__iced_k,{parent:___iced_passed_deferral,filename:"src/scrypt.iced",funcname:"Scrypt.run"}),_this.pbkdf2({key:key.clone(),salt:salt,dkLen:128*_this.r*_this.p,c:_this.c0,progress_hook:lph},__iced_deferrals.defer({assign_fn:function(){return function(){return B=arguments[0]}}(),lineno:204})),__iced_deferrals._fulfill()}(function(){B=new Int32Array(B.words),v_endian_reverse(B),lph=function(j){return function(i){return"function"==typeof progress_hook?progress_hook({i:i+j*_this.N*2,what:"scrypt",total:_this.p*_this.N*2}):void 0}},function(__iced_k){var _results,_while;j=0,_results=[],(_while=function(__iced_k){var _break,_continue,_next;return _break=function(){return __iced_k(_results)},_continue=function(){return iced.trampoline(function(){return++j,_while(__iced_k)})},_next=function(__iced_next_arg){return _results.push(__iced_next_arg),_continue()},j<_this.p?void!function(__iced_k){__iced_deferrals=new iced.Deferrals(__iced_k,{parent:___iced_passed_deferral,filename:"src/scrypt.iced",funcname:"Scrypt.run"}),_this.smix({B:B.subarray(32*_this.r*j),V:V,XY:XY,progress_hook:lph(j)},__iced_deferrals.defer({lineno:211})),__iced_deferrals._fulfill()}(_next):_break()})(__iced_k)}(function(){v_endian_reverse(B),lph=function(o){return o.what+=" (pass 2)","function"==typeof progress_hook?progress_hook(o):void 0},function(__iced_k){__iced_deferrals=new iced.Deferrals(__iced_k,{parent:___iced_passed_deferral,filename:"src/scrypt.iced",funcname:"Scrypt.run"}),_this.pbkdf2({key:key,salt:WordArray.from_i32a(B),dkLen:dkLen,c:_this.c1,progress_hook:lph},__iced_deferrals.defer({assign_fn:function(){return function(){return out=arguments[0]}}(),lineno:219})),__iced_deferrals._fulfill()}(function(){return scrub_vec(XY),scrub_vec(V),scrub_vec(B),key.scrub(),cb(out)})})})},Scrypt}(),scrypt=function(_arg,cb){var N,c,c0,c1,dkLen,eng,key,klass,p,progress_hook,r,salt,wa,___iced_passed_deferral,__iced_deferrals,__iced_k;__iced_k=__iced_k_noop,___iced_passed_deferral=iced.findDeferral(arguments),key=_arg.key,salt=_arg.salt,r=_arg.r,N=_arg.N,p=_arg.p,c0=_arg.c0,c1=_arg.c1,c=_arg.c,klass=_arg.klass,progress_hook=_arg.progress_hook,dkLen=_arg.dkLen,eng=new Scrypt({r:r,N:N,p:p,c:c,c0:c0,c1:c1,klass:klass}),function(__iced_k){__iced_deferrals=new iced.Deferrals(__iced_k,{parent:___iced_passed_deferral,filename:"src/scrypt.iced",funcname:"scrypt"}),eng.run({key:key,salt:salt,progress_hook:progress_hook,dkLen:dkLen},__iced_deferrals.defer({assign_fn:function(){return function(){return wa=arguments[0]}}(),lineno:249})),__iced_deferrals._fulfill()}(function(){return cb(wa)})},exports.Scrypt=Scrypt,exports.scrypt=scrypt,exports.v_endian_reverse=v_endian_reverse}).call(this)},{"./hmac":24,"./pbkdf2":27,"./salsa20":29,"./util":37,"./wordarray":38,"iced-coffee-script/lib/coffee-script/iced":9}],31:[function(require,module,exports){(function(){var Hasher,SHA1,W,WordArray,transform,_ref,__hasProp={}.hasOwnProperty,__extends=function(child,parent){function ctor(){this.constructor=child}for(var key in parent)__hasProp.call(parent,key)&&(child[key]=parent[key]);return ctor.prototype=parent.prototype,child.prototype=new ctor,child.__super__=parent.prototype,child};WordArray=require("./wordarray").WordArray,Hasher=require("./algbase").Hasher,W=[],SHA1=function(_super){function SHA1(){return _ref=SHA1.__super__.constructor.apply(this,arguments)}return __extends(SHA1,_super),SHA1.blockSize=16,SHA1.prototype.blockSize=SHA1.blockSize,SHA1.output_size=20,SHA1.prototype.output_size=SHA1.output_size,SHA1.prototype._doReset=function(){return this._hash=new WordArray([1732584193,4023233417,2562383102,271733878,3285377520])},SHA1.prototype._doProcessBlock=function(M,offset){var H,a,b,c,d,e,i,n,t,_i;for(H=this._hash.words,a=H[0],b=H[1],c=H[2],d=H[3],e=H[4],i=_i=0;80>_i;i=++_i)16>i?W[i]=0|M[offset+i]:(n=W[i-3]^W[i-8]^W[i-14]^W[i-16],W[i]=n<<1|n>>>31),t=(a<<5|a>>>27)+e+W[i],t+=20>i?(b&c|~b&d)+1518500249:40>i?(b^c^d)+1859775393:60>i?(b&c|b&d|c&d)-1894007588:(b^c^d)-899497514,e=d,d=c,c=b<<30|b>>>2,b=a,a=t;return H[0]=H[0]+a|0,H[1]=H[1]+b|0,H[2]=H[2]+c|0,H[3]=H[3]+d|0,H[4]=H[4]+e|0},SHA1.prototype._doFinalize=function(){var data,dataWords,nBitsLeft,nBitsTotal;return data=this._data,dataWords=data.words,nBitsTotal=8*this._nDataBytes,nBitsLeft=8*data.sigBytes,dataWords[nBitsLeft>>>5]|=128<<24-nBitsLeft%32,dataWords[(nBitsLeft+64>>>9<<4)+14]=Math.floor(nBitsTotal/4294967296),dataWords[(nBitsLeft+64>>>9<<4)+15]=nBitsTotal,data.sigBytes=4*dataWords.length,this._process(),this._hash},SHA1.prototype.copy_to=function(obj){return SHA1.__super__.copy_to.call(this,obj),obj._hash=this._hash.clone()},SHA1.prototype.clone=function(){var out;return out=new SHA1,this.copy_to(out),out},SHA1}(Hasher),transform=transform=function(x){var out;return out=(new SHA1).finalize(x),x.scrub(),out},exports.SHA1=SHA1,exports.transform=transform}).call(this)},{"./algbase":18,"./wordarray":38}],32:[function(require,module,exports){(function(){var SHA224,SHA256,WordArray,transform,_ref,__hasProp={}.hasOwnProperty,__extends=function(child,parent){function ctor(){this.constructor=child}for(var key in parent)__hasProp.call(parent,key)&&(child[key]=parent[key]);return ctor.prototype=parent.prototype,child.prototype=new ctor,child.__super__=parent.prototype,child};WordArray=require("./wordarray").WordArray,SHA256=require("./sha256").SHA256,SHA224=function(_super){function SHA224(){return _ref=SHA224.__super__.constructor.apply(this,arguments)}return __extends(SHA224,_super),SHA224.prototype._doReset=function(){return this._hash=new WordArray([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},SHA224.prototype._doFinalize=function(){var hash;return hash=SHA224.__super__._doFinalize.call(this),hash.sigBytes-=4,hash},SHA224.prototype.clone=function(){var out;return out=new SHA224,this.copy_to(out),out},SHA224}(SHA256),transform=function(x){var out;return out=(new SHA224).finalize(x),x.scrub(),out},exports.SHA224=SHA224,exports.transform=transform}).call(this)},{"./sha256":33,"./wordarray":38}],33:[function(require,module,exports){(function(){var Global,Hasher,SHA256,WordArray,glbl,transform,_ref,__hasProp={}.hasOwnProperty,__extends=function(child,parent){function ctor(){this.constructor=child}for(var key in parent)__hasProp.call(parent,key)&&(child[key]=parent[key]);return ctor.prototype=parent.prototype,child.prototype=new ctor,child.__super__=parent.prototype,child};WordArray=require("./wordarray").WordArray,Hasher=require("./algbase").Hasher,Global=function(){function Global(){this.H=[],this.K=[],this.W=[],this.init()}return Global.prototype.isPrime=function(n){var f,sqn,_i;if(2===n||3===n||5===n||7===n)return!0;if(1===n||4===n||6===n||8===n||9===n)return!1;for(sqn=Math.ceil(Math.sqrt(n)),f=_i=2;sqn>=2?sqn>=_i:_i>=sqn;f=sqn>=2?++_i:--_i)if(n%f===0)return!1;return!0},Global.prototype.getFractionalBits=function(n){return 4294967296*(n-(0|n))|0},Global.prototype.init=function(){var n,nPrime,_results;for(n=2,nPrime=0,_results=[];64>nPrime;)this.isPrime(n)&&(8>nPrime&&(this.H[nPrime]=this.getFractionalBits(Math.pow(n,.5))),this.K[nPrime]=this.getFractionalBits(Math.pow(n,1/3)),nPrime++),_results.push(n++);return _results},Global}(),glbl=new Global,SHA256=function(_super){function SHA256(){return _ref=SHA256.__super__.constructor.apply(this,arguments)}return __extends(SHA256,_super),SHA256.blockSize=16,SHA256.prototype.blockSize=SHA256.blockSize,SHA256.output_size=32,SHA256.prototype.output_size=SHA256.output_size,SHA256.prototype._doReset=function(){return this._hash=new WordArray(glbl.H.slice(0))},SHA256.prototype.get_output_size=function(){return this.output_size},SHA256.prototype._doProcessBlock=function(M,offset){var H,K,W,a,b,c,ch,d,e,f,g,gamma0,gamma0x,gamma1,gamma1x,h,i,maj,sigma0,sigma1,t1,t2,_i;for(H=this._hash.words,W=glbl.W,K=glbl.K,a=H[0],b=H[1],c=H[2],d=H[3],e=H[4],f=H[5],g=H[6],h=H[7],i=_i=0;64>_i;i=++_i)16>i?W[i]=0|M[offset+i]:(gamma0x=W[i-15],gamma0=(gamma0x<<25|gamma0x>>>7)^(gamma0x<<14|gamma0x>>>18)^gamma0x>>>3,gamma1x=W[i-2],gamma1=(gamma1x<<15|gamma1x>>>17)^(gamma1x<<13|gamma1x>>>19)^gamma1x>>>10,W[i]=gamma0+W[i-7]+gamma1+W[i-16]),ch=e&f^~e&g,maj=a&b^a&c^b&c,sigma0=(a<<30|a>>>2)^(a<<19|a>>>13)^(a<<10|a>>>22),sigma1=(e<<26|e>>>6)^(e<<21|e>>>11)^(e<<7|e>>>25),t1=h+sigma1+ch+K[i]+W[i],t2=sigma0+maj,h=g,g=f,f=e,e=d+t1|0,d=c,c=b,b=a,a=t1+t2|0;return H[0]=H[0]+a|0,H[1]=H[1]+b|0,H[2]=H[2]+c|0,H[3]=H[3]+d|0,H[4]=H[4]+e|0,H[5]=H[5]+f|0,H[6]=H[6]+g|0,H[7]=H[7]+h|0},SHA256.prototype._doFinalize=function(){var data,dataWords,nBitsLeft,nBitsTotal;return data=this._data,dataWords=data.words,nBitsTotal=8*this._nDataBytes,nBitsLeft=8*data.sigBytes,dataWords[nBitsLeft>>>5]|=128<<24-nBitsLeft%32,dataWords[(nBitsLeft+64>>>9<<4)+14]=Math.floor(nBitsTotal/4294967296),dataWords[(nBitsLeft+64>>>9<<4)+15]=nBitsTotal,data.sigBytes=4*dataWords.length,this._process(),this._hash},SHA256.prototype.scrub=function(){return this._hash.scrub()},SHA256.prototype.copy_to=function(obj){return SHA256.__super__.copy_to.call(this,obj),obj._hash=this._hash.clone()},SHA256.prototype.clone=function(){var out;return out=new SHA256,this.copy_to(out),out},SHA256}(Hasher),transform=function(x){var out;return out=(new SHA256).finalize(x),x.scrub(),out},exports.SHA256=SHA256,exports.transform=transform}).call(this)},{"./algbase":18,"./wordarray":38}],34:[function(require,module,exports){(function(){var Global,Hasher,SHA3,WordArray,X64Word,X64WordArray,glbl,_ref,_ref1,__hasProp={}.hasOwnProperty,__extends=function(child,parent){function ctor(){this.constructor=child}for(var key in parent)__hasProp.call(parent,key)&&(child[key]=parent[key]);return ctor.prototype=parent.prototype,child.prototype=new ctor,child.__super__=parent.prototype,child};_ref=require("./wordarray"),WordArray=_ref.WordArray,X64Word=_ref.X64Word,X64WordArray=_ref.X64WordArray,Hasher=require("./algbase").Hasher,Global=function(){function Global(){this.RHO_OFFSETS=[],this.PI_INDEXES=[],this.ROUND_CONSTANTS=[],this.T=[],this.compute_rho_offsets(),this.compute_pi_indexes(),this.compute_round_constants(),this.make_reusables()}return Global.prototype.compute_rho_offsets=function(){var newX,newY,t,x,y,_i,_results;for(x=1,y=0,_results=[],t=_i=0;24>_i;t=++_i)this.RHO_OFFSETS[x+5*y]=(t+1)*(t+2)/2%64,newX=y%5,newY=(2*x+3*y)%5,x=newX,_results.push(y=newY);return _results},Global.prototype.compute_pi_indexes=function(){var x,y,_i,_results;for(_results=[],x=_i=0;5>_i;x=++_i)_results.push(function(){var _j,_results1;for(_results1=[],y=_j=0;5>_j;y=++_j)_results1.push(this.PI_INDEXES[x+5*y]=y+(2*x+3*y)%5*5);return _results1}.call(this));return _results},Global.prototype.compute_round_constants=function(){var LFSR,bitPosition,i,j,roundConstantLsw,roundConstantMsw,_i,_j,_results;for(LFSR=1,_results=[],i=_i=0;24>_i;i=++_i){for(roundConstantMsw=0,roundConstantLsw=0,j=_j=0;7>_j;j=++_j)1&LFSR&&(bitPosition=(1<bitPosition?roundConstantLsw^=1<_i;i=++_i)_results.push(new X64Word(0,0));return _results}()},Global}(),glbl=new Global,exports.SHA3=SHA3=function(_super){function SHA3(){return _ref1=SHA3.__super__.constructor.apply(this,arguments)}return __extends(SHA3,_super),SHA3.outputLength=512,SHA3.prototype.outputLength=SHA3.outputLength,SHA3.blockSize=(1600-2*SHA3.outputLength)/32,SHA3.prototype.blockSize=SHA3.blockSize,SHA3.output_size=SHA3.outputLength/8,SHA3.prototype.output_size=SHA3.output_size,SHA3.prototype._doReset=function(){var i;return this._state=function(){var _i,_results;for(_results=[],i=_i=0;25>_i;i=++_i)_results.push(new X64Word(0,0));return _results}()},SHA3.prototype._doProcessBlock=function(M,offset){var G,M2i,M2i1,T0,TLane,TPiLane,Tx,Tx1,Tx1Lane,Tx1Lsw,Tx1Msw,Tx2Lane,Tx4,i,lane,laneIndex,laneLsw,laneMsw,nBlockSizeLanes,rhoOffset,round,roundConstant,state,state0,tLsw,tMsw,x,y,_i,_j,_k,_l,_m,_n,_o,_p,_q,_results;for(G=glbl,state=this._state,nBlockSizeLanes=this.blockSize/2,i=_i=0;nBlockSizeLanes>=0?nBlockSizeLanes>_i:_i>nBlockSizeLanes;i=nBlockSizeLanes>=0?++_i:--_i)M2i=M[offset+2*i],M2i1=M[offset+2*i+1],M2i=16711935&(M2i<<8|M2i>>>24)|4278255360&(M2i<<24|M2i>>>8),M2i1=16711935&(M2i1<<8|M2i1>>>24)|4278255360&(M2i1<<24|M2i1>>>8),lane=state[i],lane.high^=M2i1,lane.low^=M2i;for(_results=[],round=_j=0;24>_j;round=++_j){for(x=_k=0;5>_k;x=++_k){for(tMsw=tLsw=0,y=_l=0;5>_l;y=++_l)lane=state[x+5*y],tMsw^=lane.high,tLsw^=lane.low;Tx=G.T[x],Tx.high=tMsw,Tx.low=tLsw}for(x=_m=0;5>_m;x=++_m)for(Tx4=G.T[(x+4)%5],Tx1=G.T[(x+1)%5],Tx1Msw=Tx1.high,Tx1Lsw=Tx1.low,tMsw=Tx4.high^(Tx1Msw<<1|Tx1Lsw>>>31),tLsw=Tx4.low^(Tx1Lsw<<1|Tx1Msw>>>31),y=_n=0;5>_n;y=++_n)lane=state[x+5*y],lane.high^=tMsw,lane.low^=tLsw;for(laneIndex=_o=1;25>_o;laneIndex=++_o)lane=state[laneIndex],laneMsw=lane.high,laneLsw=lane.low,rhoOffset=G.RHO_OFFSETS[laneIndex],32>rhoOffset?(tMsw=laneMsw<>>32-rhoOffset,tLsw=laneLsw<>>32-rhoOffset):(tMsw=laneLsw<>>64-rhoOffset,tLsw=laneMsw<>>64-rhoOffset),TPiLane=G.T[G.PI_INDEXES[laneIndex]],TPiLane.high=tMsw,TPiLane.low=tLsw;for(T0=G.T[0],state0=state[0],T0.high=state0.high,T0.low=state0.low,x=_p=0;5>_p;x=++_p)for(y=_q=0;5>_q;y=++_q)laneIndex=x+5*y,lane=state[laneIndex],TLane=G.T[laneIndex],Tx1Lane=G.T[(x+1)%5+5*y],Tx2Lane=G.T[(x+2)%5+5*y],lane.high=TLane.high^~Tx1Lane.high&Tx2Lane.high,lane.low=TLane.low^~Tx1Lane.low&Tx2Lane.low;lane=state[0],roundConstant=G.ROUND_CONSTANTS[round],lane.high^=roundConstant.high,_results.push(lane.low^=roundConstant.low)}return _results},SHA3.prototype._doFinalize=function(){var blockSizeBits,data,dataWords,hashWords,i,lane,laneLsw,laneMsw,nBitsLeft,nBitsTotal,outputLengthBytes,outputLengthLanes,state,_i;for(data=this._data,dataWords=data.words,nBitsTotal=8*this._nDataBytes,nBitsLeft=8*data.sigBytes,blockSizeBits=32*this.blockSize,dataWords[nBitsLeft>>>5]|=1<<24-nBitsLeft%32,dataWords[(Math.ceil((nBitsLeft+1)/blockSizeBits)*blockSizeBits>>>5)-1]|=128,data.sigBytes=4*dataWords.length,this._process(),state=this._state,outputLengthBytes=this.outputLength/8,outputLengthLanes=outputLengthBytes/8,hashWords=[],i=_i=0;outputLengthLanes>=0?outputLengthLanes>_i:_i>outputLengthLanes;i=outputLengthLanes>=0?++_i:--_i)lane=state[i],laneMsw=lane.high,laneLsw=lane.low,laneMsw=16711935&(laneMsw<<8|laneMsw>>>24)|4278255360&(laneMsw<<24|laneMsw>>>8),laneLsw=16711935&(laneLsw<<8|laneLsw>>>24)|4278255360&(laneLsw<<24|laneLsw>>>8),hashWords.push(laneLsw),hashWords.push(laneMsw);return new WordArray(hashWords,outputLengthBytes)},SHA3.prototype.copy_to=function(obj){var s;return SHA3.__super__.copy_to.call(this,obj),obj._state=function(){var _i,_len,_ref2,_results;for(_ref2=this._state,_results=[],_i=0,_len=_ref2.length;_len>_i;_i++)s=_ref2[_i],_results.push(s.clone());return _results}.call(this)},SHA3.prototype.scrub=function(){},SHA3.prototype.clone=function(){var out;return out=new SHA3,this.copy_to(out),out},SHA3}(Hasher),exports.transform=function(x){var out;return out=(new SHA3).finalize(x),x.scrub(),out}}).call(this)},{"./algbase":18,"./wordarray":38}],35:[function(require,module,exports){(function(){var Global,Hasher,SHA512,X64Word,X64WordArray,glbl,_ref,_ref1,__hasProp={}.hasOwnProperty,__extends=function(child,parent){function ctor(){this.constructor=child}for(var key in parent)__hasProp.call(parent,key)&&(child[key]=parent[key]);return ctor.prototype=parent.prototype,child.prototype=new ctor,child.__super__=parent.prototype,child};_ref=require("./wordarray"),X64Word=_ref.X64Word,X64WordArray=_ref.X64WordArray,Hasher=require("./algbase").Hasher,Global=function(){function Global(){var i;this.K=this.convert([1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591]),
+this.I=new X64WordArray(this.convert([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209])),this.W=function(){var _i,_results;for(_results=[],i=_i=0;80>_i;i=++_i)_results.push(new X64Word(0,0));return _results}()}return Global.prototype.convert=function(raw){var i,_i,_ref1,_results;for(_results=[],i=_i=0,_ref1=raw.length;_ref1>_i;i=_i+=2)_results.push(new X64Word(raw[i],raw[i+1]));return _results},Global}(),glbl=new Global,exports.SHA512=SHA512=function(_super){function SHA512(){return _ref1=SHA512.__super__.constructor.apply(this,arguments)}return __extends(SHA512,_super),SHA512.blockSize=32,SHA512.prototype.blockSize=SHA512.blockSize,SHA512.output_size=64,SHA512.prototype.output_size=SHA512.output_size,SHA512.prototype._doReset=function(){return this._hash=glbl.I.clone()},SHA512.prototype._doProcessBlock=function(M,offset){var H,H0,H0h,H0l,H1,H1h,H1l,H2,H2h,H2l,H3,H3h,H3l,H4,H4h,H4l,H5,H5h,H5l,H6,H6h,H6l,H7,H7h,H7l,Ki,Kih,Kil,W,Wi,Wi16,Wi16h,Wi16l,Wi7,Wi7h,Wi7l,Wih,Wil,ah,al,bh,bl,ch,chh,chl,cl,dh,dl,eh,el,fh,fl,gamma0h,gamma0l,gamma0x,gamma0xh,gamma0xl,gamma1h,gamma1l,gamma1x,gamma1xh,gamma1xl,gh,gl,hh,hl,i,majh,majl,sigma0h,sigma0l,sigma1h,sigma1l,t1h,t1l,t2h,t2l,_i;for(H=this._hash.words,W=glbl.W,H0=H[0],H1=H[1],H2=H[2],H3=H[3],H4=H[4],H5=H[5],H6=H[6],H7=H[7],H0h=H0.high,H0l=H0.low,H1h=H1.high,H1l=H1.low,H2h=H2.high,H2l=H2.low,H3h=H3.high,H3l=H3.low,H4h=H4.high,H4l=H4.low,H5h=H5.high,H5l=H5.low,H6h=H6.high,H6l=H6.low,H7h=H7.high,H7l=H7.low,ah=H0h,al=H0l,bh=H1h,bl=H1l,ch=H2h,cl=H2l,dh=H3h,dl=H3l,eh=H4h,el=H4l,fh=H5h,fl=H5l,gh=H6h,gl=H6l,hh=H7h,hl=H7l,i=_i=0;80>_i;i=++_i)Wi=W[i],16>i?(Wih=Wi.high=0|M[offset+2*i],Wil=Wi.low=0|M[offset+2*i+1]):(gamma0x=W[i-15],gamma0xh=gamma0x.high,gamma0xl=gamma0x.low,gamma0h=(gamma0xh>>>1|gamma0xl<<31)^(gamma0xh>>>8|gamma0xl<<24)^gamma0xh>>>7,gamma0l=(gamma0xl>>>1|gamma0xh<<31)^(gamma0xl>>>8|gamma0xh<<24)^(gamma0xl>>>7|gamma0xh<<25),gamma1x=W[i-2],gamma1xh=gamma1x.high,gamma1xl=gamma1x.low,gamma1h=(gamma1xh>>>19|gamma1xl<<13)^(gamma1xh<<3|gamma1xl>>>29)^gamma1xh>>>6,gamma1l=(gamma1xl>>>19|gamma1xh<<13)^(gamma1xl<<3|gamma1xh>>>29)^(gamma1xl>>>6|gamma1xh<<26),Wi7=W[i-7],Wi7h=Wi7.high,Wi7l=Wi7.low,Wi16=W[i-16],Wi16h=Wi16.high,Wi16l=Wi16.low,Wil=gamma0l+Wi7l,Wih=gamma0h+Wi7h+(gamma0l>>>0>Wil>>>0?1:0),Wil+=gamma1l,Wih=Wih+gamma1h+(gamma1l>>>0>Wil>>>0?1:0),Wil+=Wi16l,Wih=Wih+Wi16h+(Wi16l>>>0>Wil>>>0?1:0),Wi.high=Wih,Wi.low=Wil),chh=eh&fh^~eh&gh,chl=el&fl^~el&gl,majh=ah&bh^ah&ch^bh&ch,majl=al&bl^al&cl^bl&cl,sigma0h=(ah>>>28|al<<4)^(ah<<30|al>>>2)^(ah<<25|al>>>7),sigma0l=(al>>>28|ah<<4)^(al<<30|ah>>>2)^(al<<25|ah>>>7),sigma1h=(eh>>>14|el<<18)^(eh>>>18|el<<14)^(eh<<23|el>>>9),sigma1l=(el>>>14|eh<<18)^(el>>>18|eh<<14)^(el<<23|eh>>>9),Ki=glbl.K[i],Kih=Ki.high,Kil=Ki.low,t1l=hl+sigma1l,t1h=hh+sigma1h+(hl>>>0>t1l>>>0?1:0),t1l+=chl,t1h=t1h+chh+(chl>>>0>t1l>>>0?1:0),t1l+=Kil,t1h=t1h+Kih+(Kil>>>0>t1l>>>0?1:0),t1l+=Wil,t1h=t1h+Wih+(Wil>>>0>t1l>>>0?1:0),t2l=sigma0l+majl,t2h=sigma0h+majh+(sigma0l>>>0>t2l>>>0?1:0),hh=gh,hl=gl,gh=fh,gl=fl,fh=eh,fl=el,el=dl+t1l|0,eh=dh+t1h+(dl>>>0>el>>>0?1:0)|0,dh=ch,dl=cl,ch=bh,cl=bl,bh=ah,bl=al,al=t1l+t2l|0,ah=t1h+t2h+(t1l>>>0>al>>>0?1:0)|0;return H0l=H0.low=H0l+al,H0.high=H0h+ah+(al>>>0>H0l>>>0?1:0),H1l=H1.low=H1l+bl,H1.high=H1h+bh+(bl>>>0>H1l>>>0?1:0),H2l=H2.low=H2l+cl,H2.high=H2h+ch+(cl>>>0>H2l>>>0?1:0),H3l=H3.low=H3l+dl,H3.high=H3h+dh+(dl>>>0>H3l>>>0?1:0),H4l=H4.low=H4l+el,H4.high=H4h+eh+(el>>>0>H4l>>>0?1:0),H5l=H5.low=H5l+fl,H5.high=H5h+fh+(fl>>>0>H5l>>>0?1:0),H6l=H6.low=H6l+gl,H6.high=H6h+gh+(gl>>>0>H6l>>>0?1:0),H7l=H7.low=H7l+hl,H7.high=H7h+hh+(hl>>>0>H7l>>>0?1:0)},SHA512.prototype._doFinalize=function(){var dataWords,nBitsLeft,nBitsTotal;return dataWords=this._data.words,nBitsTotal=8*this._nDataBytes,nBitsLeft=8*this._data.sigBytes,dataWords[nBitsLeft>>>5]|=128<<24-nBitsLeft%32,dataWords[(nBitsLeft+128>>>10<<5)+30]=Math.floor(nBitsTotal/4294967296),dataWords[(nBitsLeft+128>>>10<<5)+31]=nBitsTotal,this._data.sigBytes=4*dataWords.length,this._process(),this._hash.toX32()},SHA512.prototype.copy_to=function(obj){return SHA512.__super__.copy_to.call(this,obj),obj._hash=this._hash.clone()},SHA512.prototype.clone=function(){var out;return out=new SHA512,this.copy_to(out),out},SHA512}(Hasher),exports.transform=function(x){var out;return out=(new SHA512).finalize(x),x.scrub(),out}}).call(this)},{"./algbase":18,"./wordarray":38}],36:[function(require,module,exports){(function(){var BlockCipher,G,Global,TwoFish,scrub_vec,__hasProp={}.hasOwnProperty,__extends=function(child,parent){function ctor(){this.constructor=child}for(var key in parent)__hasProp.call(parent,key)&&(child[key]=parent[key]);return ctor.prototype=parent.prototype,child.prototype=new ctor,child.__super__=parent.prototype,child};BlockCipher=require("./algbase").BlockCipher,scrub_vec=require("./util").scrub_vec,Global=function(){function Global(){this.P=[[169,103,179,232,4,253,163,118,154,146,128,120,228,221,209,56,13,198,53,152,24,247,236,108,67,117,55,38,250,19,148,72,242,208,139,48,132,84,223,35,25,91,61,89,243,174,162,130,99,1,131,46,217,81,155,124,166,235,165,190,22,12,227,97,192,140,58,245,115,44,37,11,187,78,137,107,83,106,180,241,225,230,189,69,226,244,182,102,204,149,3,86,212,28,30,215,251,195,142,181,233,207,191,186,234,119,57,175,51,201,98,113,129,121,9,173,36,205,249,216,229,197,185,77,68,8,134,231,161,29,170,237,6,112,178,210,65,123,160,17,49,194,39,144,32,246,96,255,150,92,177,171,158,156,82,27,95,147,10,239,145,133,73,238,45,79,143,59,71,135,109,70,214,62,105,100,42,206,203,47,252,151,5,122,172,127,213,26,75,14,167,90,40,20,63,41,136,60,76,2,184,218,176,23,85,31,138,125,87,199,141,116,183,196,159,114,126,21,34,18,88,7,153,52,110,80,222,104,101,188,219,248,200,168,43,64,220,254,50,164,202,16,33,240,211,93,15,0,111,157,54,66,74,94,193,224],[117,243,198,244,219,123,251,200,74,211,230,107,69,125,232,75,214,50,216,253,55,113,241,225,48,15,248,27,135,250,6,63,94,186,174,91,138,0,188,157,109,193,177,14,128,93,210,213,160,132,7,20,181,144,44,163,178,115,76,84,146,116,54,81,56,176,189,90,252,96,98,150,108,66,247,16,124,40,39,140,19,149,156,199,36,70,59,112,202,227,133,203,17,208,147,184,166,131,32,255,159,119,195,204,3,111,8,191,64,231,43,226,121,12,170,130,65,58,234,185,228,154,164,151,126,218,122,23,102,148,161,29,61,240,222,179,11,114,167,28,239,209,83,62,143,51,38,95,236,118,42,73,129,136,238,33,196,26,235,217,197,57,153,205,173,49,139,1,24,35,221,31,78,45,249,72,79,242,101,142,120,92,88,25,141,229,152,87,103,127,5,100,175,99,182,254,245,183,60,165,206,233,104,68,224,77,67,105,41,46,172,21,89,168,10,158,110,71,223,52,53,106,207,220,34,201,192,155,137,212,237,171,18,162,13,82,187,2,47,169,215,97,30,180,80,4,246,194,22,37,134,86,85,9,190,145]],this.P_00=1,this.P_01=0,this.P_02=0,this.P_03=1,this.P_04=1,this.P_10=0,this.P_11=0,this.P_12=1,this.P_13=1,this.P_14=0,this.P_20=1,this.P_21=1,this.P_22=0,this.P_23=0,this.P_24=0,this.P_30=0,this.P_31=1,this.P_32=1,this.P_33=0,this.P_34=1,this.GF256_FDBK=361,this.GF256_FDBK_2=this.GF256_FDBK/2,this.GF256_FDBK_4=this.GF256_FDBK/4,this.RS_GF_FDBK=333,this.SK_STEP=33686018,this.SK_BUMP=16843009,this.SK_ROTL=9}return Global}(),G=new Global,exports.TwoFish=TwoFish=function(_super){function TwoFish(key){this._key=key.clone(),this.gMDS0=[],this.gMDS1=[],this.gMDS2=[],this.gMDS3=[],this.gSubKeys=[],this.gSBox=[],this.k64Cnt=0,this._doReset()}return __extends(TwoFish,_super),TwoFish.blockSize=16,TwoFish.prototype.blockSize=TwoFish.blockSize,TwoFish.keySize=32,TwoFish.prototype.keySize=TwoFish.keySize,TwoFish.ivSize=TwoFish.blockSize,TwoFish.prototype.ivSize=TwoFish.ivSize,TwoFish.prototype.getByte=function(x,n){return x>>>8*n&255},TwoFish.prototype.switchEndianness=function(word){return(255&word)<<24|(word>>8&255)<<16|(word>>16&255)<<8|word>>24&255},TwoFish.prototype.LFSR1=function(x){return x>>1^(0!==(1&x)?G.GF256_FDBK_2:0)},TwoFish.prototype.LFSR2=function(x){return x>>2^(0!==(2&x)?G.GF256_FDBK_2:0)^(0!==(1&x)?G.GF256_FDBK_4:0)},TwoFish.prototype.Mx_X=function(x){return x^this.LFSR2(x)},TwoFish.prototype.Mx_Y=function(x){return x^this.LFSR1(x)^this.LFSR2(x)},TwoFish.prototype.RS_rem=function(x){var b,g2,g3;return b=x>>>24&255,g2=255&(b<<1^(0!==(128&b)?G.RS_GF_FDBK:0)),g3=b>>>1^(0!==(1&b)?G.RS_GF_FDBK>>>1:0)^g2,x<<8^g3<<24^g2<<16^g3<<8^b},TwoFish.prototype.RS_MDS_Encode=function(k0,k1){var i,r,_i,_j;for(r=k1,i=_i=0;4>_i;i=++_i)r=this.RS_rem(r);for(r^=k0,i=_j=0;4>_j;i=++_j)r=this.RS_rem(r);return r},TwoFish.prototype.F32=function(x,k32){var b0,b1,b2,b3,k0,k1,k2,k3,m,res;return b0=this.getByte(x,0),b1=this.getByte(x,1),b2=this.getByte(x,2),b3=this.getByte(x,3),k0=k32[0],k1=k32[1],k2=k32[2],k3=k32[3],m=3&this.k64Cnt,res=1===m?this.gMDS0[255&G.P[G.P_01][b0]^this.getByte(k0,0)]^this.gMDS1[255&G.P[G.P_11][b1]^this.getByte(k0,1)]^this.gMDS2[255&G.P[G.P_21][b2]^this.getByte(k0,2)]^this.gMDS3[255&G.P[G.P_31][b3]^this.getByte(k0,3)]:(0===m?(b0=255&G.P[G.P_04][b0]^this.getByte(k3,0),b1=255&G.P[G.P_14][b1]^this.getByte(k3,1),b2=255&G.P[G.P_24][b2]^this.getByte(k3,2),b3=255&G.P[G.P_34][b3]^this.getByte(k3,3)):void 0,0===m||3===m?(b0=255&G.P[G.P_03][b0]^this.getByte(k2,0),b1=255&G.P[G.P_13][b1]^this.getByte(k2,1),b2=255&G.P[G.P_23][b2]^this.getByte(k2,2),b3=255&G.P[G.P_33][b3]^this.getByte(k2,3)):void 0,this.gMDS0[255&G.P[G.P_01][255&G.P[G.P_02][b0]^this.getByte(k1,0)]^this.getByte(k0,0)]^this.gMDS1[255&G.P[G.P_11][255&G.P[G.P_12][b1]^this.getByte(k1,1)]^this.getByte(k0,1)]^this.gMDS2[255&G.P[G.P_21][255&G.P[G.P_22][b2]^this.getByte(k1,2)]^this.getByte(k0,2)]^this.gMDS3[255&G.P[G.P_31][255&G.P[G.P_32][b3]^this.getByte(k1,3)]^this.getByte(k0,3)])},TwoFish.prototype.Fe32_0=function(x){return this.gSBox[0+2*(255&x)]^this.gSBox[1+2*(x>>>8&255)]^this.gSBox[512+2*(x>>>16&255)]^this.gSBox[513+2*(x>>>24&255)]},TwoFish.prototype.Fe32_3=function(x){return this.gSBox[0+2*(x>>>24&255)]^this.gSBox[1+2*(255&x)]^this.gSBox[512+2*(x>>>8&255)]^this.gSBox[513+2*(x>>>16&255)]},TwoFish.prototype._doReset=function(){var A,B,b0,b1,b2,b3,i,j,k0,k1,k2,k3,k32e,k32o,m,m1,mX,mY,p,q,sBoxKeys,_i,_j,_k,_l,_ref,_ref1,_results;if(k32e=[],k32o=[],sBoxKeys=[],m1=[],mX=[],mY=[],this.k64Cnt=this._key.words.length/2,this.k64Cnt<1)throw"Key size less than 64 bits";if(this.k64Cnt>4)throw"Key size larger than 256 bits";for(i=_i=0;256>_i;i=++_i)j=255&G.P[0][i],m1[0]=j,mX[0]=255&this.Mx_X(j),mY[0]=255&this.Mx_Y(j),j=255&G.P[1][i],m1[1]=j,mX[1]=255&this.Mx_X(j),mY[1]=255&this.Mx_Y(j),this.gMDS0[i]=m1[G.P_00]|mX[G.P_00]<<8|mY[G.P_00]<<16|mY[G.P_00]<<24,this.gMDS1[i]=mY[G.P_10]|mY[G.P_10]<<8|mX[G.P_10]<<16|m1[G.P_10]<<24,this.gMDS2[i]=mX[G.P_20]|mY[G.P_20]<<8|m1[G.P_20]<<16|mY[G.P_20]<<24,this.gMDS3[i]=mX[G.P_30]|m1[G.P_30]<<8|mY[G.P_30]<<16|mX[G.P_30]<<24;for(i=_j=0,_ref=this.k64Cnt;_ref>=0?_ref>_j:_j>_ref;i=_ref>=0?++_j:--_j)p=2*i,k32e[i]=this.switchEndianness(this._key.words[p]),k32o[i]=this.switchEndianness(this._key.words[p+1]),sBoxKeys[this.k64Cnt-1-i]=this.RS_MDS_Encode(k32e[i],k32o[i]);for(i=_k=0,_ref1=20;_ref1>=0?_ref1>_k:_k>_ref1;i=_ref1>=0?++_k:--_k)q=i*G.SK_STEP,A=this.F32(q,k32e),B=this.F32(q+G.SK_BUMP,k32o),B=B<<8|B>>>24,A+=B,this.gSubKeys[2*i]=A,A+=B,this.gSubKeys[2*i+1]=A<>>32-G.SK_ROTL;for(k0=sBoxKeys[0],k1=sBoxKeys[1],k2=sBoxKeys[2],k3=sBoxKeys[3],this.gSBox=[],_results=[],i=_l=0;256>_l;i=++_l)b0=b1=b2=b3=i,m=3&this.k64Cnt,1===m?(this.gSBox[2*i]=this.gMDS0[255&G.P[G.P_01][b0]^this.getByte(k0,0)],this.gSBox[2*i+1]=this.gMDS1[255&G.P[G.P_11][b1]^this.getByte(k0,1)],this.gSBox[2*i+512]=this.gMDS2[255&G.P[G.P_21][b2]^this.getByte(k0,2)],_results.push(this.gSBox[2*i+513]=this.gMDS3[255&G.P[G.P_31][b3]^this.getByte(k0,3)])):(0===m&&(b0=255&G.P[G.P_04][b0]^this.getByte(k3,0),b1=255&G.P[G.P_14][b1]^this.getByte(k3,1),b2=255&G.P[G.P_24][b2]^this.getByte(k3,2),b3=255&G.P[G.P_34][b3]^this.getByte(k3,3)),0!==m&&3!==m||(b0=255&G.P[G.P_03][b0]^this.getByte(k2,0),b1=255&G.P[G.P_13][b1]^this.getByte(k2,1),b2=255&G.P[G.P_23][b2]^this.getByte(k2,2),b3=255&G.P[G.P_33][b3]^this.getByte(k2,3)),this.gSBox[2*i]=this.gMDS0[255&G.P[G.P_01][255&G.P[G.P_02][b0]^this.getByte(k1,0)]^this.getByte(k0,0)],this.gSBox[2*i+1]=this.gMDS1[255&G.P[G.P_11][255&G.P[G.P_12][b1]^this.getByte(k1,1)]^this.getByte(k0,1)],this.gSBox[2*i+512]=this.gMDS2[255&G.P[G.P_21][255&G.P[G.P_22][b2]^this.getByte(k1,2)]^this.getByte(k0,2)],_results.push(this.gSBox[2*i+513]=this.gMDS3[255&G.P[G.P_31][255&G.P[G.P_32][b3]^this.getByte(k1,3)]^this.getByte(k0,3)]));return _results},TwoFish.prototype.scrub=function(){return scrub_vec(this.gSubKeys),scrub_vec(this.gSBox),this._key.scrub()},TwoFish.prototype.decryptBlock=function(M,offset){var k,r,t0,t1,x0,x1,x2,x3,_i;for(null==offset&&(offset=0),x2=this.switchEndianness(M[offset])^this.gSubKeys[4],x3=this.switchEndianness(M[offset+1])^this.gSubKeys[5],x0=this.switchEndianness(M[offset+2])^this.gSubKeys[6],x1=this.switchEndianness(M[offset+3])^this.gSubKeys[7],k=39,r=_i=0;16>_i;r=_i+=2)t0=this.Fe32_0(x2),t1=this.Fe32_3(x3),x1^=t0+2*t1+this.gSubKeys[k--],x0=(x0<<1|x0>>>31)^t0+t1+this.gSubKeys[k--],x1=x1>>>1|x1<<31,t0=this.Fe32_0(x0),t1=this.Fe32_3(x1),x3^=t0+2*t1+this.gSubKeys[k--],x2=(x2<<1|x2>>>31)^t0+t1+this.gSubKeys[k--],x3=x3>>>1|x3<<31;return M[offset]=this.switchEndianness(x0^this.gSubKeys[0]),M[offset+1]=this.switchEndianness(x1^this.gSubKeys[1]),M[offset+2]=this.switchEndianness(x2^this.gSubKeys[2]),M[offset+3]=this.switchEndianness(x3^this.gSubKeys[3])},TwoFish.prototype.encryptBlock=function(M,offset){var k,r,t0,t1,x0,x1,x2,x3,_i;for(null==offset&&(offset=0),x0=this.switchEndianness(M[offset])^this.gSubKeys[0],x1=this.switchEndianness(M[offset+1])^this.gSubKeys[1],x2=this.switchEndianness(M[offset+2])^this.gSubKeys[2],x3=this.switchEndianness(M[offset+3])^this.gSubKeys[3],k=8,r=_i=0;16>_i;r=_i+=2)t0=this.Fe32_0(x0),t1=this.Fe32_3(x1),x2^=t0+t1+this.gSubKeys[k++],x2=x2>>>1|x2<<31,x3=(x3<<1|x3>>>31)^t0+2*t1+this.gSubKeys[k++],t0=this.Fe32_0(x2),t1=this.Fe32_3(x3),x0^=t0+t1+this.gSubKeys[k++],x0=x0>>>1|x0<<31,x1=(x1<<1|x1>>>31)^t0+2*t1+this.gSubKeys[k++];return M[offset]=this.switchEndianness(x2^this.gSubKeys[4]),M[offset+1]=this.switchEndianness(x3^this.gSubKeys[5]),M[offset+2]=this.switchEndianness(x0^this.gSubKeys[6]),M[offset+3]=this.switchEndianness(x1^this.gSubKeys[7])},TwoFish}(BlockCipher)}).call(this)},{"./algbase":18,"./util":37}],37:[function(require,module,exports){(function(){var default_delay,iced,uint_max,__iced_k,__iced_k_noop;iced=require("iced-coffee-script/lib/coffee-script/iced").runtime,__iced_k=__iced_k_noop=function(){},uint_max=Math.pow(2,32),exports.fixup_uint32=function(x){var ret,x_pos;return ret=x>uint_max||0>x?(x_pos=Math.abs(x)%uint_max,0>x?uint_max-x_pos:x_pos):x},exports.scrub_buffer=function(b){var i,n_full_words;for(n_full_words=b.length>>2,i=0;n_full_words>i;)b.writeUInt32LE(0,i),i+=4;for(;i=0?_ref>_i:_i>_ref;i=_ref>=0?++_i:--_i)v[i]=0;return!1},exports.default_delay=default_delay=function(i,n,cb){var ___iced_passed_deferral,__iced_deferrals,__iced_k;__iced_k=__iced_k_noop,___iced_passed_deferral=iced.findDeferral(arguments),function(__iced_k){"undefined"!=typeof setImmediate&&null!==setImmediate?!function(__iced_k){__iced_deferrals=new iced.Deferrals(__iced_k,{parent:___iced_passed_deferral,filename:"src/util.iced",funcname:"default_delay"}),setImmediate(__iced_deferrals.defer({lineno:37})),__iced_deferrals._fulfill()}(__iced_k):!function(__iced_k){__iced_deferrals=new iced.Deferrals(__iced_k,{parent:___iced_passed_deferral,filename:"src/util.iced",funcname:"default_delay"}),setTimeout(__iced_deferrals.defer({lineno:39}),1),__iced_deferrals._fulfill()}(__iced_k)}(function(){return cb()})},exports.bulk=function(n_input_bytes,_arg,_arg1){var call_ph,cb,default_n,delay,finalize,i,left,n,n_words,progress_hook,ret,total_words,update,what,___iced_passed_deferral,__iced_deferrals,__iced_k;__iced_k=__iced_k_noop,___iced_passed_deferral=iced.findDeferral(arguments),update=_arg.update,finalize=_arg.finalize,default_n=_arg.default_n,delay=_arg1.delay,n=_arg1.n,cb=_arg1.cb,what=_arg1.what,progress_hook=_arg1.progress_hook,i=0,left=0,total_words=Math.ceil(n_input_bytes/4),delay||(delay=default_delay),n||(n=default_n),call_ph=function(i){return"function"==typeof progress_hook?progress_hook({what:what,i:i,total:total_words}):void 0},call_ph(0),function(__iced_k){var _results,_while;_results=[],(_while=function(__iced_k){var _break,_continue,_next;return _break=function(){return __iced_k(_results)},_continue=function(){return iced.trampoline(function(){return _while(__iced_k)})},_next=function(__iced_next_arg){return _results.push(__iced_next_arg),_continue()},(left=total_words-i)>0?(n_words=Math.min(n,left),update(i,i+n_words),call_ph(i),function(__iced_k){__iced_deferrals=new iced.Deferrals(__iced_k,{parent:___iced_passed_deferral,filename:"src/util.iced",funcname:"bulk"}),delay(i,total_words,__iced_deferrals.defer({lineno:73})),__iced_deferrals._fulfill()}(function(){return _next(i+=n_words)}),void 0):_break()})(__iced_k)}(function(){return call_ph(total_words),ret=finalize(),cb(ret)})}}).call(this)},{"iced-coffee-script/lib/coffee-script/iced":9}],38:[function(require,module,exports){(function(Buffer){(function(){var WordArray,X64Word,X64WordArray,buffer_to_ui8a,endian_reverse,ui8a_to_buffer,util;util=require("./util"),buffer_to_ui8a=function(b){var i,ret,_i,_ref;for(ret=new Uint8Array(b.length),i=_i=0,_ref=b.length;_ref>=0?_ref>_i:_i>_ref;i=_ref>=0?++_i:--_i)ret[i]=b.readUInt8(i);return ret},ui8a_to_buffer=function(v){var i,ret,_i,_ref;for(ret=new Buffer(v.length),i=_i=0,_ref=v.length;_ref>=0?_ref>_i:_i>_ref;i=_ref>=0?++_i:--_i)ret.writeUInt8(v[i],i);return ret},endian_reverse=function(x){return x>>>24&255|(x>>>16&255)<<8|(x>>>8&255)<<16|(255&x)<<24},exports.WordArray=WordArray=function(){function WordArray(words,sigBytes){this.words=words||[],this.sigBytes=null!=sigBytes?sigBytes:4*this.words.length}return WordArray.prototype.concat=function(wordArray){var i,thatByte,thatSigBytes,thatWords,_i;if(thatWords=wordArray.words,thatSigBytes=wordArray.sigBytes,this.clamp(),this.sigBytes%4)for(i=_i=0;thatSigBytes>=0?thatSigBytes>_i:_i>thatSigBytes;i=thatSigBytes>=0?++_i:--_i)thatByte=thatWords[i>>>2]>>>24-i%4*8&255,this.words[this.sigBytes+i>>>2]|=thatByte<<24-(this.sigBytes+i)%4*8;else this.words=this.words.concat(thatWords);return this.sigBytes+=thatSigBytes,this},WordArray.prototype.clamp=function(){return this.words[this.sigBytes>>>2]&=4294967295<<32-this.sigBytes%4*8,this.words.length=Math.ceil(this.sigBytes/4),this},WordArray.prototype.clone=function(){return new WordArray(this.words.slice(0),this.sigBytes)},WordArray.prototype.to_buffer=function(){var ch,out,p,w,_i,_len,_ref;for(out=new Buffer(this.sigBytes),p=0,_ref=this.words,_i=0,_len=_ref.length;_len>_i;_i++)w=_ref[_i],this.sigBytes-p>=4&&(w=util.fixup_uint32(w),out.writeUInt32BE(w,p),p+=4);for(;p>>2]>>>24-p%4*8&255,out.writeUInt8(ch,p),p++;return out},WordArray.prototype.endian_reverse=function(){var i,w,_i,_len,_ref;for(_ref=this.words,i=_i=0,_len=_ref.length;_len>_i;i=++_i)w=_ref[i],this.words[i]=endian_reverse(w);return this},WordArray.prototype.split=function(n){var i,out,sz;if(this.sigBytes%4!==0||this.words.length%n!==0)throw new Error("bad key alignment");return sz=this.words.length/n,out=function(){var _i,_ref,_results;for(_results=[],i=_i=0,_ref=this.words.length;sz>0?_ref>_i:_i>_ref;i=_i+=sz)_results.push(new WordArray(this.words.slice(i,i+sz)));return _results}.call(this)},WordArray.prototype.to_utf8=function(){return this.to_buffer().toString("utf8")},WordArray.prototype.to_hex=function(){return this.to_buffer().toString("hex")},WordArray.prototype.to_ui8a=function(){return buffer_to_ui8a(this.to_buffer())},WordArray.alloc=function(b){return Buffer.isBuffer(b)?WordArray.from_buffer(b):"object"==typeof b&&b instanceof WordArray?b:"string"==typeof b?WordArray.from_hex(b):null},WordArray.from_buffer=function(b){var ch,last,p,words;for(words=[],p=0;b.length-p>=4;)words.push(b.readUInt32BE(p)),p+=4;if(p=4;)words.push(b.readUInt32LE(p)),p+=4;if(p_i;i=++_i)w=_ref[i],util.fixup_uint32(w)!==util.fixup_uint32(wa.words[i])&&(ret=!1);return ret},WordArray.prototype.xor=function(wa2,_arg){var dst_offset,i,n_words,src_offset,tmp,_i;if(dst_offset=_arg.dst_offset,src_offset=_arg.src_offset,n_words=_arg.n_words,dst_offset||(dst_offset=0),src_offset||(src_offset=0),null==n_words&&(n_words=wa2.words.length-src_offset),this.words.length=0?n_words>_i:_i>n_words;i=n_words>=0?++_i:--_i)tmp=this.words[dst_offset+i]^wa2.words[src_offset+i],this.words[dst_offset+i]=util.fixup_uint32(tmp);return this},WordArray.prototype.truncate=function(n_bytes){var n_words;if(!(n_bytes<=this.sigBytes))throw new Error("Cannot truncate: "+n_bytes+" > "+this.sigBytes);return n_words=Math.ceil(n_bytes/4),new WordArray(this.words.slice(0,n_words),n_bytes)},WordArray.prototype.unshift=function(n_words){var ret;return this.words.length>=n_words?(ret=this.words.splice(0,n_words),this.sigBytes-=4*n_words,new WordArray(ret)):null},WordArray.prototype.is_scrubbed=function(){var w,_i,_len,_ref;for(_ref=this.words,_i=0,_len=_ref.length;_len>_i;_i++)if(w=_ref[_i],0!==w)return!1;return!0},WordArray.prototype.scrub=function(){return util.scrub_vec(this.words)},WordArray.prototype.slice=function(low,hi){var n,sb;if(n=this.words.length,!(hi>low&&n>=hi))throw new Error("Bad WordArray slice ["+low+","+hi+")] when only "+n+" avail");return sb=4*(hi-low),hi===n&&(sb-=4*n-this.sigBytes),new WordArray(this.words.slice(low,hi),sb)},WordArray}(),exports.X64Word=X64Word=function(){function X64Word(high,low){this.high=high,this.low=low}return X64Word.prototype.clone=function(){return new X64Word(this.high,this.low)},X64Word}(),exports.X64WordArray=X64WordArray=function(){function X64WordArray(words,sigBytes){this.sigBytes=sigBytes,this.words=words||[],this.sigBytes||(this.sigBytes=8*this.words.length)}return X64WordArray.prototype.toX32=function(){var v,w,_i,_len,_ref;for(v=[],_ref=this.words,_i=0,_len=_ref.length;_len>_i;_i++)w=_ref[_i],v.push(w.high),v.push(w.low);return new WordArray(v,this.sigBytes)},X64WordArray.prototype.clone=function(){var w;return new X64WordArray(function(){var _i,_len,_ref,_results;for(_ref=this.words,_results=[],_i=0,_len=_ref.length;_len>_i;_i++)w=_ref[_i],_results.push(w.clone());return _results}.call(this),this.sigBytes)},X64WordArray}(),exports.buffer_to_ui8a=buffer_to_ui8a,exports.ui8a_to_buffer=ui8a_to_buffer,exports.endian_reverse=endian_reverse}).call(this)}).call(this,require("buffer").Buffer)},{"./util":37,buffer:1}],39:[function(require,module,exports){(function(){var Generator,iced,__iced_k,__iced_k_noop;iced=require("iced-runtime"),__iced_k=__iced_k_noop=function(){},Generator=Generator=function(){function Generator(opts){opts=opts||{},this.lazy_loop_delay=opts.lazy_loop_delay||30,this.loop_delay=opts.loop_delay||5,this.work_min=opts.work_min||1,this.auto_stop_bits=opts.auto_stop_bits||4096,this.max_bits_per_delta=opts.max_bits_per_delta||4,this.auto_stop=opts.auto_stop?opts.auto_stop:!0,this.entropies=[],this.running=!0,this.is_generating=!1,this.timer_race_loop()}return Generator.prototype.generate=function(bits_wanted,cb){var e,harvested_bits,res,___iced_passed_deferral,__iced_deferrals,__iced_k;__iced_k=__iced_k_noop,___iced_passed_deferral=iced.findDeferral(arguments),this.is_generating=!0,this.running||this.resume(),harvested_bits=0,res=[],function(_this){return function(__iced_k){var _results,_while;_results=[],(_while=function(__iced_k){var _break,_continue,_next;return _break=function(){return __iced_k(_results)},_continue=function(){return iced.trampoline(function(){return _while(__iced_k)})},_next=function(__iced_next_arg){return _results.push(__iced_next_arg),_continue()},bits_wanted>harvested_bits?void!function(__iced_k){return _this.entropies.length?(e=_this.entropies.splice(0,1)[0],harvested_bits+=e[1],__iced_k(res.push(e[0]))):void!function(__iced_k){__iced_deferrals=new iced.Deferrals(__iced_k,{parent:___iced_passed_deferral,filename:"/Users/chris/git/more-entropy/src/generator.iced",funcname:"Generator.generate"}),_this.delay(__iced_deferrals.defer({lineno:28})),__iced_deferrals._fulfill()}(__iced_k)}(_next):_break()})(__iced_k)}}(this)(function(_this){return function(){return _this.auto_stop&&_this.stop(),_this.is_generating=!1,cb(res)}}(this))},Generator.prototype.stop=function(){return this.running=!1},Generator.prototype.resume=function(){return this.running=!0,this.timer_race_loop()},Generator.prototype.reset=function(){return this.entropies=[],this.total_bits=0},Generator.prototype.count_unused_bits=function(){var bits,e,_i,_len,_ref;for(bits=0,_ref=this.entropies,_i=0,_len=_ref.length;_len>_i;_i++)e=_ref[_i],bits+=e[1];return bits},Generator.prototype.delay=function(cb){var delay,___iced_passed_deferral,__iced_deferrals,__iced_k;__iced_k=__iced_k_noop,___iced_passed_deferral=iced.findDeferral(arguments),delay=this.is_generating?this.loop_delay:this.lazy_loop_delay,function(_this){return function(__iced_k){__iced_deferrals=new iced.Deferrals(__iced_k,{parent:___iced_passed_deferral,filename:"/Users/chris/git/more-entropy/src/generator.iced",funcname:"Generator.delay"}),setTimeout(__iced_deferrals.defer({lineno:50}),delay),__iced_deferrals._fulfill()}}(this)(function(_this){return function(){return cb()}}(this))},Generator.prototype.timer_race_loop=function(){var ___iced_passed_deferral,__iced_k,_results,_while;__iced_k=__iced_k_noop,___iced_passed_deferral=iced.findDeferral(arguments),this._last_count=null,_results=[],(_while=function(_this){var count,delta,entropy,v,__iced_deferrals;return function(__iced_k){var _break,_continue,_next;return _break=function(){return __iced_k(_results)},_continue=function(){return iced.trampoline(function(){return _while(__iced_k)})},_next=function(__iced_next_arg){return _results.push(__iced_next_arg),_continue()},_this.running?(_this.count_unused_bits()<_this.auto_stop_bits&&(count=_this.millisecond_count(),null!=_this._last_count&&(delta=count-_this._last_count)&&(entropy=Math.floor(_this.log_2(Math.abs(delta))),entropy=Math.min(_this.max_bits_per_delta,entropy),v=[delta,entropy],_this.entropies.push(v)),_this._last_count=count),void function(__iced_k){__iced_deferrals=new iced.Deferrals(__iced_k,{parent:___iced_passed_deferral,filename:"/Users/chris/git/more-entropy/src/generator.iced",funcname:"Generator.timer_race_loop"}),_this.delay(__iced_deferrals.defer({lineno:64})),__iced_deferrals._fulfill()}(_next)):_break()}}(this))(__iced_k)},Generator.prototype.log_2=function(x){return Math.log(x)/Math.LN2},Generator.prototype.millisecond_count=function(){var d,i,x;for(d=Date.now(),i=x=0;Date.now()_i;_i++)obj=_ref1[_i],obj.scrub();return out=generate(seed_final),out.seeds=seeds,cb(out)})}}(this))}}).call(this,require("buffer").Buffer)},{"../json/params.json":42,buffer:1,"iced-runtime":13,"keybase-bitcoin":15,triplesec:26}],42:[function(require,module,exports){module.exports={N:18,p:1,r:8,dkLen:32,pbkdf2c:65536}},{}]},{},[41])(41)});
\ No newline at end of file
diff --git a/package.json b/package.json
new file mode 100644
index 00000000..1765d058
--- /dev/null
+++ b/package.json
@@ -0,0 +1,29 @@
+{
+ "name": "coinbin",
+ "authors": [
+ "OutCast3k"
+ ],
+ "description": "A Open Source Browser Based Bitcoin Wallet.",
+ "contributors": [
+ {
+ "name": "Bitcoin Co. Ltd.",
+ "email": "contact@bitcoin.co.th"
+ },
+ {
+ "name": "David Apple",
+ "email": "davidapple@protonmail.com"
+ }
+ ],
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/davidapple/coinbin"
+ },
+ "main": "Gruntfile.js",
+ "license": "MIT",
+ "devDependencies": {
+ "grunt": "^0.4.5",
+ "grunt-contrib-coffee": "^1.0.0",
+ "grunt-contrib-concat": "^1.0.0",
+ "grunt-contrib-uglify": "^1.0.1"
+ }
+}