-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathtriplesec-3.0.27-min.js
1 lines (1 loc) · 186 KB
/
triplesec-3.0.27-min.js
1
!function(e){"object"==typeof exports?module.exports=e():"function"==typeof define&&define.amd?define(e):"undefined"!=typeof window?window.triplesec=e():"undefined"!=typeof global?global.triplesec=e():"undefined"!=typeof self&&(self.triplesec=e())}(function(){return function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a="function"==typeof require&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n||e)},f,f.exports,e,t,n,r)}return n[o].exports}for(var i="function"==typeof require&&require,o=0;o<r.length;o++)s(r[o]);return s}({1:[function(require,module,exports){(function(){var AES,BlockCipher,G,Global,scrub_vec,__hasProp={}.hasOwnProperty;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;_i<4;i=++_i)_results.push([]);return _results}(),this.INV_SUB_MIX=function(){var _i,_results;for(_results=[],i=_i=0;_i<4;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;_i<256;i=++_i)i<128?_results.push(i<<1):_results.push(i<<1^283);return _results}(),x=0,xi=0,i=_i=0;_i<256;i=++_i)sx=(sx=xi^xi<<1^xi<<2^xi<<3^xi<<4)>>>8^255&sx^99,this.SBOX[x]=sx,this.INV_SBOX[sx]=x,x8=d[x4=d[x2=d[x]]],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 function(child,parent){function ctor(){this.constructor=child}for(var key in parent)__hasProp.call(parent,key)&&(child[key]=parent[key]);ctor.prototype=parent.prototype,child.prototype=new ctor,child.__super__=parent.prototype}(AES,BlockCipher),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;0<=ksRows?_i<ksRows:_i>ksRows;ksRow=0<=ksRows?++_i:--_i)this._keySchedule[ksRow]=ksRow<keySize?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]),this._keySchedule[ksRow-keySize]^t);for(this._invKeySchedule=[],invKsRow=_j=0;0<=ksRows?_j<ksRows:_j>ksRows;invKsRow=0<=ksRows?++_j:--_j)ksRow=ksRows-invKsRow,t=this._keySchedule[ksRow-(invKsRow%4?0:4)],this._invKeySchedule[invKsRow]=invKsRow<4||ksRow<=4?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,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,_i=1,_ref=this._nRounds;1<=_ref?_i<_ref:_i>_ref;1<=_ref?++_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}(),exports.AES=AES}).call(this)},{"./algbase":2,"./util":23}],2:[function(require,module,exports){(function(){var BlockCipher,BufferedBlockAlgorithm,Hasher,StreamCipher,WordArray,util,__hasProp={}.hasOwnProperty;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?_i<nWordsReady:_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 function(child,parent){function ctor(){this.constructor=child}for(var key in parent)__hasProp.call(parent,key)&&(child[key]=parent[key]);ctor.prototype=parent.prototype,child.prototype=new ctor,child.__super__=parent.prototype}(Hasher,BufferedBlockAlgorithm),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}(),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?_i<_ref:_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;return input=_arg.input,progress_hook=_arg.progress_hook,what=_arg.what,slice_args={update:function(_this){return function(lo,hi){var i,_i,_ref,_results;for(_results=[],i=_i=lo,_ref=_this.bsiw;_ref>0?_i<hi:_i>hi;i=_i+=_ref)_results.push(_this.encryptBlock(input,i));return _results}}(this),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":23,"./wordarray":24}],3:[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 _i,_len,_ref1;for(_i=0,_len=(_ref1=this.hashers).length;_i<_len;_i++)_ref1[_i].reset();return this},CombineBase.prototype.update=function(w){var _i,_len,_ref1;for(_i=0,_len=(_ref1=this.hashers).length;_i<_len;_i++)_ref1[_i].update(w);return this},CombineBase.prototype.scrub=function(){var _i,_len,_ref1;for(_i=0,_len=(_ref1=this.hashers).length;_i<_len;_i++)_ref1[_i].scrub();return this},CombineBase.prototype.finalize=function(w){var h,hashes,out,_i,_len,_ref1;for(out=(hashes=function(){var _i,_len,_ref1,_results;for(_results=[],_i=0,_len=(_ref1=this.hashers).length;_i<_len;_i++)h=_ref1[_i],_results.push(h.finalize(w));return _results}.call(this))[0],_i=0,_len=(_ref1=hashes.slice(1)).length;_i<_len;_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;_i<_len;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,CombineBase),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 tot,_i,_len,_ref1;for(tot=0,_i=0,_len=(_ref1=this.hashers).length;_i<_len;_i++)tot+=_ref1[_i].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}(),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;_i<_len;_i++)klass=klasses[_i],_results.push(new HMAC(key,klass));return _results}(),XOR.__super__.constructor.call(this)}return __extends(XOR,CombineBase),XOR.prototype.reset=function(){var i,_i,_len,_ref1;for(XOR.__super__.reset.call(this),i=_i=0,_len=(_ref1=this.hashers).length;_i<_len;i=++_i)_ref1[i].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(_results=[],_i=0,_len=(_ref1=this.hashers).length;_i<_len;_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}(),exports.Concat=Concat,exports.XOR=XOR}).call(this)},{"./hmac":8,"./sha3":19,"./sha512":21,"./wordarray":24}],4:[function(require,module,exports){(function(){var Cipher,Counter,StreamCipher,WordArray,bulk_encrypt,encrypt,iced,__hasProp={}.hasOwnProperty;iced=require("iced-runtime"),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),new WordArray(function(){var _i,_results;for(_results=[],i=_i=0;0<=len?_i<len:_i>len;i=0<=len?++_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&&i<this._value.words.length;)++this._value.words[i]>Counter.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 function(child,parent){function ctor(){this.constructor=child}for(var key in parent)__hasProp.call(parent,key)&&(child[key]=parent[key]);ctor.prototype=parent.prototype,child.prototype=new ctor,child.__super__=parent.prototype}(Cipher,StreamCipher),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}(),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_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:"/Users/max/src/keybase/triplesec/src/ctr.iced"}),cipher.bulk_encrypt({input:input,progress_hook:progress_hook,what:what},__iced_deferrals.defer({assign_fn: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":2,"./wordarray":24,"iced-runtime":29}],5:[function(require,module,exports){(function(){var AES,Base,Concat,Decryptor,Salsa20,TwoFish,V,WordArray,decrypt,iced,make_esc,_ref,__hasProp={}.hasOwnProperty;iced=require("iced-runtime"),WordArray=require("./wordarray").WordArray,require("./salsa20"),AES=require("./aes").AES,TwoFish=require("./twofish").TwoFish,require("./ctr"),Concat=require("./combine").Concat,require("./sha512").SHA512,Salsa20=require("./salsa20").Salsa20,Base=(_ref=require("./enc")).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 function(child,parent){function ctor(){this.constructor=child}for(var key in parent)__hasProp.call(parent,key)&&(child[key]=parent[key]);ctor.prototype=parent.prototype,child.prototype=new ctor,child.__super__=parent.prototype}(Decryptor,Base),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_passed_deferral=iced.findDeferral(arguments),function(_this){return function(__iced_k){if(null==(received=_this.ct.unshift(Concat.get_output_size()/4)))return __iced_k(err=new Error("Ciphertext underrun in signature"));!function(__iced_k){__iced_deferrals=new iced.Deferrals(__iced_k,{parent:___iced_passed_deferral,filename:"/Users/max/src/keybase/triplesec/src/dec.iced",funcname:"Decryptor.verify_sig"}),_this.sign({input:_this.ct,key:key,salt:_this.salt},__iced_deferrals.defer({assign_fn: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"))})}}(this)(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_passed_deferral=iced.findDeferral(arguments),progress_hook=_arg.progress_hook,function(_this){return function(__iced_k){__iced_deferrals=new iced.Deferrals(__iced_k,{parent:___iced_passed_deferral,filename:"/Users/max/src/keybase/triplesec/src/dec.iced",funcname:"Decryptor.generate_keys"}),_this.kdf({salt:_this.salt,progress_hook:progress_hook},__iced_deferrals.defer({assign_fn:function(){return err=arguments[0],keys=arguments[1]},lineno:114})),__iced_deferrals._fulfill()}}(this)(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_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(_this){return function(__iced_k){__iced_deferrals=new iced.Deferrals(__iced_k,{parent:___iced_passed_deferral,filename:"/Users/max/src/keybase/triplesec/src/dec.iced",funcname:"Decryptor.run"}),_this.read_header(esc(__iced_deferrals.defer({lineno:141}))),__iced_deferrals._fulfill()}}(this)(function(_this){return function(){__iced_deferrals=new iced.Deferrals(function(){__iced_deferrals=new iced.Deferrals(function(){__iced_deferrals=new iced.Deferrals(function(){__iced_deferrals=new iced.Deferrals(function(){__iced_deferrals=new iced.Deferrals(function(){__iced_deferrals=new iced.Deferrals(function(){__iced_deferrals=new iced.Deferrals(function(){__iced_deferrals=new iced.Deferrals(function(){__iced_deferrals=new iced.Deferrals(function(){return cb(null,pt.to_buffer())},{parent:___iced_passed_deferral,filename:"/Users/max/src/keybase/triplesec/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 pt=arguments[0]},lineno:150}))),__iced_deferrals._fulfill()},{parent:___iced_passed_deferral,filename:"/Users/max/src/keybase/triplesec/src/dec.iced",funcname:"Decryptor.run"}),_this.unshift_iv(Salsa20.ivSize,"Salsa",esc(__iced_deferrals.defer({assign_fn:function(){return iv=arguments[0]},lineno:149}))),__iced_deferrals._fulfill()},{parent:___iced_passed_deferral,filename:"/Users/max/src/keybase/triplesec/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 ct1=arguments[0]},lineno:148}))),__iced_deferrals._fulfill()},{parent:___iced_passed_deferral,filename:"/Users/max/src/keybase/triplesec/src/dec.iced",funcname:"Decryptor.run"}),_this.unshift_iv(TwoFish.ivSize,"2fish",esc(__iced_deferrals.defer({assign_fn:function(){return iv=arguments[0]},lineno:147}))),__iced_deferrals._fulfill()},{parent:___iced_passed_deferral,filename:"/Users/max/src/keybase/triplesec/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 ct2=arguments[0]},lineno:146}))),__iced_deferrals._fulfill()},{parent:___iced_passed_deferral,filename:"/Users/max/src/keybase/triplesec/src/dec.iced",funcname:"Decryptor.run"}),_this.unshift_iv(AES.ivSize,"AES",esc(__iced_deferrals.defer({assign_fn:function(){return iv=arguments[0]},lineno:145}))),__iced_deferrals._fulfill()},{parent:___iced_passed_deferral,filename:"/Users/max/src/keybase/triplesec/src/dec.iced",funcname:"Decryptor.run"}),_this.verify_sig(_this.keys.hmac,esc(__iced_deferrals.defer({lineno:144}))),__iced_deferrals._fulfill()},{parent:___iced_passed_deferral,filename:"/Users/max/src/keybase/triplesec/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()},{parent:___iced_passed_deferral,filename:"/Users/max/src/keybase/triplesec/src/dec.iced",funcname:"Decryptor.run"}),_this.read_salt(esc(__iced_deferrals.defer({lineno:142}))),__iced_deferrals._fulfill()}}(this))},Decryptor.prototype.clone=function(){var ret,_ref1;return ret=new Decryptor({key:null!=(_ref1=this.key)?_ref1.to_buffer():void 0,rng:this.rng,version:this.version}),ret.derived_keys=this.clone_derived_keys(),ret},Decryptor}(),decrypt=function(_arg,cb){var data,dec,err,key,progress_hook,pt,___iced_passed_deferral,__iced_deferrals;___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:"/Users/max/src/keybase/triplesec/src/dec.iced"}),dec.run({data:data,progress_hook:progress_hook},__iced_deferrals.defer({assign_fn:function(){return err=arguments[0],pt=arguments[1]},lineno:180})),__iced_deferrals._fulfill()}(function(){return dec.scrub(),cb(err,pt)})},exports.Decryptor=Decryptor,exports.decrypt=decrypt}).call(this)},{"./aes":1,"./combine":3,"./ctr":4,"./enc":7,"./salsa20":14,"./sha512":21,"./twofish":22,"./wordarray":24,"iced-error":25,"iced-runtime":29}],6:[function(require,module,exports){var Buffer=require("__browserify_Buffer");(function(){var ADRBG,DRBG,Lock,WordArray,hmac,iced;iced=require("iced-runtime"),hmac=require("./hmac"),require("./combine").XOR,require("./sha512"),require("./sha3"),WordArray=require("./wordarray").WordArray,Lock=require("iced-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;_i<n;i=++_i)_results.push(0);return _results}())),this.V=WordArray.from_buffer(new Buffer(function(){var _i,_results;for(_results=[],i=_i=0;_i<n;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 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=[],0;0===tmp.length||tmp.length*tmp[0].length*4<num_bytes;)this.V=this._hmac(this.K,this.V),tmp.push(this.V.words);return this._update(),this.reseed_counter+=1,new WordArray((_ref=[]).concat.apply(_ref,tmp)).truncate(num_bytes)},DRBG}(),ADRBG=function(){function ADRBG(gen_seed,hmac){this.gen_seed=gen_seed,this.hmac=hmac,this.drbg=null,this.lock=new Lock}return ADRBG.prototype.generate=function(n,cb){var ret,seed,___iced_passed_deferral,__iced_deferrals;___iced_passed_deferral=iced.findDeferral(arguments),function(_this){return function(__iced_k){__iced_deferrals=new iced.Deferrals(__iced_k,{parent:___iced_passed_deferral,filename:"/Users/max/src/keybase/triplesec/src/drbg.iced",funcname:"ADRBG.generate"}),_this.lock.acquire(__iced_deferrals.defer({lineno:148})),__iced_deferrals._fulfill()}}(this)(function(_this){return function(){!function(__iced_k){if(null!=_this.drbg)return __iced_k();!function(__iced_k){__iced_deferrals=new iced.Deferrals(__iced_k,{parent:___iced_passed_deferral,filename:"/Users/max/src/keybase/triplesec/src/drbg.iced",funcname:"ADRBG.generate"}),_this.gen_seed(256,__iced_deferrals.defer({assign_fn:function(){return seed=arguments[0]},lineno:150})),__iced_deferrals._fulfill()}(function(){return __iced_k(_this.drbg=new DRBG(seed,null,_this.hmac))})}(function(){!function(__iced_k){if(!(_this.drbg.reseed_counter>100))return __iced_k();!function(__iced_k){__iced_deferrals=new iced.Deferrals(__iced_k,{parent:___iced_passed_deferral,filename:"/Users/max/src/keybase/triplesec/src/drbg.iced",funcname:"ADRBG.generate"}),_this.gen_seed(256,__iced_deferrals.defer({assign_fn:function(){return seed=arguments[0]},lineno:153})),__iced_deferrals._fulfill()}(function(){return __iced_k(_this.drbg.reseed(seed))})}(function(){return ret=_this.drbg.generate(n),_this.lock.release(),cb(ret)})})}}(this))},ADRBG}(),exports.DRBG=DRBG,exports.ADRBG=ADRBG}).call(this)},{"./combine":3,"./hmac":8,"./sha3":19,"./sha512":21,"./wordarray":24,__browserify_Buffer:31,"iced-lock":26,"iced-runtime":29}],7:[function(require,module,exports){(function(){var AES,Base,CURRENT_VERSION,Concat,Encryptor,HMAC_SHA256,PBKDF2,Scrypt,TwoFish,V,WordArray,XOR,ctr,encrypt,iced,make_esc,prng,salsa20,util,_ref,__hasProp={}.hasOwnProperty;iced=require("iced-runtime"),WordArray=require("./wordarray").WordArray,salsa20=require("./salsa20"),AES=require("./aes").AES,TwoFish=require("./twofish").TwoFish,ctr=require("./ctr"),XOR=(_ref=require("./combine")).XOR,Concat=_ref.Concat,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,version:1},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,version:2},3:{header:[479516638,3],salt_size:16,xsalsa20_rev:!1,kdf:{klass:Scrypt,opts:{c:1,klass:HMAC_SHA256,N:15,r:8,p:1}},hmac_key_size:96,version:3}},exports.CURRENT_VERSION=CURRENT_VERSION=3,Base=function(){function Base(_arg){var key,version;if(key=_arg.key,version=_arg.version,this.version=V[null!=version?version:CURRENT_VERSION],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_passed_deferral=iced.findDeferral(arguments),salt=_arg.salt,extra_keymaterial=_arg.extra_keymaterial,progress_hook=_arg.progress_hook,function(_this){return function(__iced_k){__iced_deferrals=new iced.Deferrals(__iced_k,{parent:___iced_passed_deferral,filename:"/Users/max/src/keybase/triplesec/src/enc.iced",funcname:"Base.kdf"}),_this._check_scrubbed(_this.key,"in KDF",cb,__iced_deferrals.defer({lineno:97})),__iced_deferrals._fulfill()}}(this)(function(_this){return function(){salt_hex=salt.to_hex(),key=_this.key.clone(),__iced_deferrals=new iced.Deferrals(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:"/Users/max/src/keybase/triplesec/src/enc.iced",funcname:"Base.kdf"}),_this._kdf.run(args,__iced_deferrals.defer({assign_fn:function(){return raw=arguments[0]},lineno:124})),__iced_deferrals._fulfill()}(function(){var _i,_len;for(keys={},i=0,_i=0,_len=order.length;_i<_len;_i++)k=order[_i],v=lens[k],end=i+(len=v/4),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)})},{parent:___iced_passed_deferral,filename:"/Users/max/src/keybase/triplesec/src/enc.iced",funcname:"Base.kdf"}),_this._check_scrubbed(key,"KDF",cb,__iced_deferrals.defer({lineno:105})),__iced_deferrals._fulfill()}}(this))},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_passed_deferral=iced.findDeferral(arguments),input=_arg.input,key=_arg.key,salt=_arg.salt,progress_hook=_arg.progress_hook,function(_this){return function(__iced_k){__iced_deferrals=new iced.Deferrals(__iced_k,{parent:___iced_passed_deferral,filename:"/Users/max/src/keybase/triplesec/src/enc.iced",funcname:"Base.sign"}),_this._check_scrubbed(key,"HMAC",cb,__iced_deferrals.defer({lineno:182})),__iced_deferrals._fulfill()}}(this)(function(_this){return function(){input=new WordArray(_this.version.header).concat(salt).concat(input),__iced_deferrals=new iced.Deferrals(function(){return input.scrub(),cb(null,out)},{parent:___iced_passed_deferral,filename:"/Users/max/src/keybase/triplesec/src/enc.iced",funcname:"Base.sign"}),Concat.bulk_sign({key:key,input:input,progress_hook:progress_hook},__iced_deferrals.defer({assign_fn:function(){return out=arguments[0]},lineno:184})),__iced_deferrals._fulfill()}}(this))},Base.prototype.run_salsa20=function(_arg,cb){var args,ct,input,iv,key,output_iv,progress_hook,___iced_passed_deferral,__iced_deferrals;___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(_this){return function(__iced_k){__iced_deferrals=new iced.Deferrals(__iced_k,{parent:___iced_passed_deferral,filename:"/Users/max/src/keybase/triplesec/src/enc.iced",funcname:"Base.run_salsa20"}),_this._check_scrubbed(key,"Salsa20",cb,__iced_deferrals.defer({lineno:200})),__iced_deferrals._fulfill()}}(this)(function(_this){return 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()),__iced_deferrals=new iced.Deferrals(function(){output_iv&&(ct=iv.clone().concat(ct));_this.version.xsalsa20_rev&&(args.key.scrub(),args.iv.scrub());return cb(null,ct)},{parent:___iced_passed_deferral,filename:"/Users/max/src/keybase/triplesec/src/enc.iced",funcname:"Base.run_salsa20"}),salsa20.bulk_encrypt(args,__iced_deferrals.defer({assign_fn:function(){return ct=arguments[0]},lineno:212})),__iced_deferrals._fulfill()}}(this))},Base.prototype.run_twofish=function(_arg,cb){var block_cipher,ct,input,iv,key,progress_hook,___iced_passed_deferral,__iced_deferrals;___iced_passed_deferral=iced.findDeferral(arguments),input=_arg.input,key=_arg.key,iv=_arg.iv,progress_hook=_arg.progress_hook,function(_this){return function(__iced_k){__iced_deferrals=new iced.Deferrals(__iced_k,{parent:___iced_passed_deferral,filename:"/Users/max/src/keybase/triplesec/src/enc.iced",funcname:"Base.run_twofish"}),_this._check_scrubbed(key,"TwoFish",cb,__iced_deferrals.defer({lineno:235})),__iced_deferrals._fulfill()}}(this)(function(){block_cipher=new TwoFish(key),__iced_deferrals=new iced.Deferrals(function(){return block_cipher.scrub(),cb(null,iv.clone().concat(ct))},{parent:___iced_passed_deferral,filename:"/Users/max/src/keybase/triplesec/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 ct=arguments[0]},lineno:237})),__iced_deferrals._fulfill()})},Base.prototype.run_aes=function(_arg,cb){var block_cipher,ct,input,iv,key,progress_hook,___iced_passed_deferral,__iced_deferrals;___iced_passed_deferral=iced.findDeferral(arguments),input=_arg.input,key=_arg.key,iv=_arg.iv,progress_hook=_arg.progress_hook,function(_this){return function(__iced_k){__iced_deferrals=new iced.Deferrals(__iced_k,{parent:___iced_passed_deferral,filename:"/Users/max/src/keybase/triplesec/src/enc.iced",funcname:"Base.run_aes"}),_this._check_scrubbed(key,"AES",cb,__iced_deferrals.defer({lineno:252})),__iced_deferrals._fulfill()}}(this)(function(){block_cipher=new AES(key),__iced_deferrals=new iced.Deferrals(function(){return block_cipher.scrub(),cb(null,iv.clone().concat(ct))},{parent:___iced_passed_deferral,filename:"/Users/max/src/keybase/triplesec/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 ct=arguments[0]},lineno:254})),__iced_deferrals._fulfill()})},Base.prototype.scrub=function(){var algo,key,key_ring,salt,_ref1;if(null!=this.key&&this.key.scrub(),null!=this.derived_keys){_ref1=this.derived_keys;for(salt in _ref1){key_ring=_ref1[salt];for(algo in key_ring)key=key_ring[algo],"extra"!==algo&&key.scrub()}}return this.derived_keys={},null!=this.salt&&this.salt.scrub(),this.salt=null,this.key=null},Base.prototype.clone_derived_keys=function(){var algo,key,key_ring,ret,salt,_ref1;if(ret=null,null!=this.derived_keys){ret={},_ref1=this.derived_keys;for(salt in _ref1){key_ring=_ref1[salt],ret[salt]={};for(algo in key_ring)key=key_ring[algo],ret[salt][algo]="extra"===algo?key:key.clone()}}return ret},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 function(child,parent){function ctor(){this.constructor=child}for(var key in parent)__hasProp.call(parent,key)&&(child[key]=parent[key]);ctor.prototype=parent.prototype,child.prototype=new ctor,child.__super__=parent.prototype}(Encryptor,Base),Encryptor.prototype.pick_random_ivs=function(_arg,cb){var iv_lens,ivs,k,v,___iced_passed_deferral,__iced_deferrals;___iced_passed_deferral=iced.findDeferral(arguments),_arg.progress_hook,iv_lens={aes:AES.ivSize,twofish:TwoFish.ivSize,salsa20:salsa20.Salsa20.ivSize},ivs={},function(_this){return function(__iced_k){var _i,_k,_keys,_ref1,_while;_ref1=iv_lens,_keys=function(){var _results1;_results1=[];for(_k in _ref1)_results1.push(_k);return _results1}(),_i=0,(_while=function(__iced_k){var _break,_continue,_next;if(_break=__iced_k,_continue=function(){return iced.trampoline(function(){return++_i,_while(__iced_k)})},_next=_continue,!(_i<_keys.length))return _break();k=_keys[_i],v=_ref1[k],function(__iced_k){__iced_deferrals=new iced.Deferrals(__iced_k,{parent:___iced_passed_deferral,filename:"/Users/max/src/keybase/triplesec/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:377})),__iced_deferrals._fulfill()}(_next)})(__iced_k)}}(this)(function(){return cb(ivs)})},Encryptor.prototype.resalt=function(_arg,cb){var err,extra_keymaterial,progress_hook,salt,___iced_passed_deferral,__iced_deferrals;___iced_passed_deferral=iced.findDeferral(arguments),salt=_arg.salt,extra_keymaterial=_arg.extra_keymaterial,progress_hook=_arg.progress_hook,err=null,function(_this){return function(__iced_k){if(null!=salt)return __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));!function(__iced_k){__iced_deferrals=new iced.Deferrals(__iced_k,{parent:___iced_passed_deferral,filename:"/Users/max/src/keybase/triplesec/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:393})),__iced_deferrals._fulfill()}(__iced_k)}}(this)(function(_this){return function(){!function(__iced_k){if(null!=err)return __iced_k();!function(__iced_k){__iced_deferrals=new iced.Deferrals(__iced_k,{parent:___iced_passed_deferral,filename:"/Users/max/src/keybase/triplesec/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:399})),__iced_deferrals._fulfill()}(__iced_k)}(function(){return cb(err,_this.keys)})}}(this))},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_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(_this){return function(__iced_k){if(null==salt&&null!=_this.salt)return __iced_k();!function(__iced_k){__iced_deferrals=new iced.Deferrals(__iced_k,{parent:___iced_passed_deferral,filename:"/Users/max/src/keybase/triplesec/src/enc.iced",funcname:"Encryptor.run"}),_this.resalt({salt:salt,extra_keymaterial:extra_keymaterial,progress_hook:progress_hook},esc(__iced_deferrals.defer({lineno:430}))),__iced_deferrals._fulfill()}(__iced_k)}}(this)(function(_this){return function(){__iced_deferrals=new iced.Deferrals(function(){pt=WordArray.from_buffer(data),__iced_deferrals=new iced.Deferrals(function(){__iced_deferrals=new iced.Deferrals(function(){__iced_deferrals=new iced.Deferrals(function(){__iced_deferrals=new iced.Deferrals(function(){return ret=new WordArray(_this.version.header).concat(_this.salt).concat(sig).concat(ct3).to_buffer(),util.scrub_buffer(data),cb(null,ret)},{parent:___iced_passed_deferral,filename:"/Users/max/src/keybase/triplesec/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 sig=arguments[0]},lineno:436}))),__iced_deferrals._fulfill()},{parent:___iced_passed_deferral,filename:"/Users/max/src/keybase/triplesec/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 ct3=arguments[0]},lineno:435}))),__iced_deferrals._fulfill()},{parent:___iced_passed_deferral,filename:"/Users/max/src/keybase/triplesec/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 ct2=arguments[0]},lineno:434}))),__iced_deferrals._fulfill()},{parent:___iced_passed_deferral,filename:"/Users/max/src/keybase/triplesec/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 ct1=arguments[0]},lineno:433}))),__iced_deferrals._fulfill()},{parent:___iced_passed_deferral,filename:"/Users/max/src/keybase/triplesec/src/enc.iced",funcname:"Encryptor.run"}),_this.pick_random_ivs({progress_hook:progress_hook},__iced_deferrals.defer({assign_fn:function(){return ivs=arguments[0]},lineno:431})),__iced_deferrals._fulfill()}}(this))},Encryptor.prototype.clone=function(){var ret,_ref1,_ref2;return ret=new Encryptor({key:null!=(_ref1=this.key)?_ref1.to_buffer():void 0,rng:this.rng,version:null!=(_ref2=this.version)?_ref2.version:void 0}),ret.derived_keys=this.clone_derived_keys(),ret},Encryptor}(),encrypt=function(_arg,cb){var data,enc,err,key,progress_hook,ret,rng,version,___iced_passed_deferral,__iced_deferrals;___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:"/Users/max/src/keybase/triplesec/src/enc.iced"}),enc.run({data:data,progress_hook:progress_hook},__iced_deferrals.defer({assign_fn:function(){return err=arguments[0],ret=arguments[1]},lineno:475})),__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":1,"./combine":3,"./ctr":4,"./hmac":8,"./pbkdf2":11,"./prng":12,"./salsa20":14,"./scrypt":15,"./sha512":21,"./twofish":22,"./util":23,"./wordarray":24,"iced-error":25,"iced-runtime":29}],8:[function(require,module,exports){(function(){var HMAC,SHA256,SHA512,bulk_sign,iced,sign,util,__hasProp={}.hasOwnProperty;iced=require("iced-runtime"),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;0<=_ref?_i<_ref:_i>_ref;i=0<=_ref?++_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_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:"/Users/max/src/keybase/triplesec/src/hmac.iced"}),util.bulk(input.sigBytes,slice_args,{what:what,progress_hook:progress_hook,cb:__iced_deferrals.defer({assign_fn:function(){return res=arguments[0]},lineno:137})}),__iced_deferrals._fulfill()}(function(){return eng.scrub(),cb(res)})},exports.HMAC_SHA256=function(_super){function HMAC_SHA256(key){HMAC_SHA256.__super__.constructor.call(this,key,SHA256)}return function(child,parent){function ctor(){this.constructor=child}for(var key in parent)__hasProp.call(parent,key)&&(child[key]=parent[key]);ctor.prototype=parent.prototype,child.prototype=new ctor,child.__super__=parent.prototype}(HMAC_SHA256,HMAC),HMAC_SHA256}(),exports.HMAC=HMAC,exports.sign=sign,exports.bulk_sign=bulk_sign}).call(this)},{"./sha256":18,"./sha512":21,"./util":23,"iced-runtime":29}],9:[function(require,module,exports){var Buffer=require("__browserify_Buffer");(function(){var hmac,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,Salsa20:require("./salsa20").Salsa20},exports.hash={SHA1:require("./sha1").SHA1,SHA224:require("./sha224").SHA224,SHA256:require("./sha256").SHA256,SHA384:require("./sha384").SHA384,SHA512:require("./sha512").SHA512,SHA3:require("./sha3").SHA3,MD5:require("./md5").MD5,RIPEMD160:require("./ripemd160").RIPEMD160},exports.modes={CTR:require("./ctr")},exports.scrypt=require("./scrypt").scrypt,exports.pbkdf2=require("./pbkdf2").pbkdf2,exports.hmac=hmac=require("./hmac"),exports.HMAC_SHA256=hmac.HMAC_SHA256,exports.HMAC=hmac.HMAC}).call(this)},{"./aes":1,"./ctr":4,"./dec":5,"./enc":7,"./hmac":8,"./md5":10,"./pbkdf2":11,"./prng":12,"./ripemd160":13,"./salsa20":14,"./scrypt":15,"./sha1":16,"./sha224":17,"./sha256":18,"./sha3":19,"./sha384":20,"./sha512":21,"./twofish":22,"./util":23,"./wordarray":24,__browserify_Buffer:31}],10:[function(require,module,exports){(function(){var FF,GG,Global,HH,Hasher,II,MD5,WordArray,glbl,__hasProp={}.hasOwnProperty;WordArray=require("./wordarray").WordArray,Hasher=require("./algbase").Hasher,Global=function(){return function(){var i;this.T=function(){var _i,_results;for(_results=[],i=_i=0;_i<64;i=++_i)_results.push(4294967296*Math.abs(Math.sin(i+1))|0);return _results}()}}(),glbl=new Global,exports.MD5=MD5=function(_super){function MD5(){return MD5.__super__.constructor.apply(this,arguments)}return function(child,parent){function ctor(){this.constructor=child}for(var key in parent)__hasProp.call(parent,key)&&(child[key]=parent[key]);ctor.prototype=parent.prototype,child.prototype=new ctor,child.__super__=parent.prototype}(MD5,Hasher),MD5.blockSize=16,MD5.prototype.blockSize=MD5.blockSize,MD5.output_size=16,MD5.prototype.output_size=MD5.output_size,MD5.prototype._doReset=function(){return this._hash=new WordArray([1732584193,4023233417,2562383102,271733878])},MD5.prototype._doProcessBlock=function(M,offset){var H,M_offset_0,M_offset_1,M_offset_10,M_offset_11,M_offset_12,M_offset_13,M_offset_14,M_offset_15,M_offset_2,M_offset_3,M_offset_4,M_offset_5,M_offset_6,M_offset_7,M_offset_8,M_offset_9,M_offset_i,a,b,c,d,i,offset_i,_i;for(i=_i=0;_i<16;i=++_i)M_offset_i=M[offset_i=offset+i],M[offset_i]=16711935&(M_offset_i<<8|M_offset_i>>>24)|4278255360&(M_offset_i<<24|M_offset_i>>>8);return H=this._hash.words,M_offset_0=M[offset+0],M_offset_1=M[offset+1],M_offset_2=M[offset+2],M_offset_3=M[offset+3],M_offset_4=M[offset+4],M_offset_5=M[offset+5],M_offset_6=M[offset+6],M_offset_7=M[offset+7],M_offset_8=M[offset+8],M_offset_9=M[offset+9],M_offset_10=M[offset+10],M_offset_11=M[offset+11],M_offset_12=M[offset+12],M_offset_13=M[offset+13],M_offset_14=M[offset+14],M_offset_15=M[offset+15],a=H[0],b=H[1],c=H[2],d=H[3],a=FF(a,b,c,d,M_offset_0,7,glbl.T[0]),d=FF(d,a,b,c,M_offset_1,12,glbl.T[1]),c=FF(c,d,a,b,M_offset_2,17,glbl.T[2]),b=FF(b,c,d,a,M_offset_3,22,glbl.T[3]),a=FF(a,b,c,d,M_offset_4,7,glbl.T[4]),d=FF(d,a,b,c,M_offset_5,12,glbl.T[5]),c=FF(c,d,a,b,M_offset_6,17,glbl.T[6]),b=FF(b,c,d,a,M_offset_7,22,glbl.T[7]),a=FF(a,b,c,d,M_offset_8,7,glbl.T[8]),d=FF(d,a,b,c,M_offset_9,12,glbl.T[9]),c=FF(c,d,a,b,M_offset_10,17,glbl.T[10]),b=FF(b,c,d,a,M_offset_11,22,glbl.T[11]),a=FF(a,b,c,d,M_offset_12,7,glbl.T[12]),d=FF(d,a,b,c,M_offset_13,12,glbl.T[13]),c=FF(c,d,a,b,M_offset_14,17,glbl.T[14]),b=FF(b,c,d,a,M_offset_15,22,glbl.T[15]),a=GG(a,b,c,d,M_offset_1,5,glbl.T[16]),d=GG(d,a,b,c,M_offset_6,9,glbl.T[17]),c=GG(c,d,a,b,M_offset_11,14,glbl.T[18]),b=GG(b,c,d,a,M_offset_0,20,glbl.T[19]),a=GG(a,b,c,d,M_offset_5,5,glbl.T[20]),d=GG(d,a,b,c,M_offset_10,9,glbl.T[21]),c=GG(c,d,a,b,M_offset_15,14,glbl.T[22]),b=GG(b,c,d,a,M_offset_4,20,glbl.T[23]),a=GG(a,b,c,d,M_offset_9,5,glbl.T[24]),d=GG(d,a,b,c,M_offset_14,9,glbl.T[25]),c=GG(c,d,a,b,M_offset_3,14,glbl.T[26]),b=GG(b,c,d,a,M_offset_8,20,glbl.T[27]),a=GG(a,b,c,d,M_offset_13,5,glbl.T[28]),d=GG(d,a,b,c,M_offset_2,9,glbl.T[29]),c=GG(c,d,a,b,M_offset_7,14,glbl.T[30]),b=GG(b,c,d,a,M_offset_12,20,glbl.T[31]),a=HH(a,b,c,d,M_offset_5,4,glbl.T[32]),d=HH(d,a,b,c,M_offset_8,11,glbl.T[33]),c=HH(c,d,a,b,M_offset_11,16,glbl.T[34]),b=HH(b,c,d,a,M_offset_14,23,glbl.T[35]),a=HH(a,b,c,d,M_offset_1,4,glbl.T[36]),d=HH(d,a,b,c,M_offset_4,11,glbl.T[37]),c=HH(c,d,a,b,M_offset_7,16,glbl.T[38]),b=HH(b,c,d,a,M_offset_10,23,glbl.T[39]),a=HH(a,b,c,d,M_offset_13,4,glbl.T[40]),d=HH(d,a,b,c,M_offset_0,11,glbl.T[41]),c=HH(c,d,a,b,M_offset_3,16,glbl.T[42]),b=HH(b,c,d,a,M_offset_6,23,glbl.T[43]),a=HH(a,b,c,d,M_offset_9,4,glbl.T[44]),d=HH(d,a,b,c,M_offset_12,11,glbl.T[45]),c=HH(c,d,a,b,M_offset_15,16,glbl.T[46]),b=HH(b,c,d,a,M_offset_2,23,glbl.T[47]),a=II(a,b,c,d,M_offset_0,6,glbl.T[48]),d=II(d,a,b,c,M_offset_7,10,glbl.T[49]),c=II(c,d,a,b,M_offset_14,15,glbl.T[50]),b=II(b,c,d,a,M_offset_5,21,glbl.T[51]),a=II(a,b,c,d,M_offset_12,6,glbl.T[52]),d=II(d,a,b,c,M_offset_3,10,glbl.T[53]),c=II(c,d,a,b,M_offset_10,15,glbl.T[54]),b=II(b,c,d,a,M_offset_1,21,glbl.T[55]),a=II(a,b,c,d,M_offset_8,6,glbl.T[56]),d=II(d,a,b,c,M_offset_15,10,glbl.T[57]),c=II(c,d,a,b,M_offset_6,15,glbl.T[58]),b=II(b,c,d,a,M_offset_13,21,glbl.T[59]),a=II(a,b,c,d,M_offset_4,6,glbl.T[60]),d=II(d,a,b,c,M_offset_11,10,glbl.T[61]),c=II(c,d,a,b,M_offset_2,15,glbl.T[62]),b=II(b,c,d,a,M_offset_9,21,glbl.T[63]),H[0]=H[0]+a|0,H[1]=H[1]+b|0,H[2]=H[2]+c|0,H[3]=H[3]+d|0},MD5.prototype._doFinalize=function(){var H,H_i,data,dataWords,hash,i,nBitsLeft,nBitsTotal,nBitsTotalH,nBitsTotalL,_i;for(dataWords=(data=this._data).words,nBitsTotal=8*this._nDataBytes,dataWords[(nBitsLeft=8*data.sigBytes)>>>5]|=128<<24-nBitsLeft%32,nBitsTotalH=Math.floor(nBitsTotal/4294967296),nBitsTotalL=nBitsTotal,dataWords[15+(nBitsLeft+64>>>9<<4)]=16711935&(nBitsTotalH<<8|nBitsTotalH>>>24)|4278255360&(nBitsTotalH<<24|nBitsTotalH>>>8),dataWords[14+(nBitsLeft+64>>>9<<4)]=16711935&(nBitsTotalL<<8|nBitsTotalL>>>24)|4278255360&(nBitsTotalL<<24|nBitsTotalL>>>8),data.sigBytes=4*(dataWords.length+1),this._process(),H=(hash=this._hash).words,i=_i=0;_i<4;i=++_i)H_i=H[i],H[i]=16711935&(H_i<<8|H_i>>>24)|4278255360&(H_i<<24|H_i>>>8);return hash},MD5.prototype.copy_to=function(obj){return MD5.__super__.copy_to.call(this,obj),obj._hash=this._hash.clone()},MD5.prototype.clone=function(){var out;return out=new MD5,this.copy_to(out),out},MD5}(),FF=function(a,b,c,d,x,s,t){var n;return((n=a+(b&c|~b&d)+x+t)<<s|n>>>32-s)+b},GG=function(a,b,c,d,x,s,t){var n;return((n=a+(b&d|c&~d)+x+t)<<s|n>>>32-s)+b},HH=function(a,b,c,d,x,s,t){var n;return((n=a+(b^c^d)+x+t)<<s|n>>>32-s)+b},II=function(a,b,c,d,x,s,t){var n;return((n=a+(c^(b|~d))+x+t)<<s|n>>>32-s)+b},exports.transform=function(x){var out;return out=(new MD5).finalize(x),x.scrub(),out}}).call(this)},{"./algbase":2,"./wordarray":24}],11:[function(require,module,exports){(function(){var HMAC,PBKDF2,WordArray,iced,pbkdf2,util;iced=require("iced-runtime"),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_passed_deferral=iced.findDeferral(arguments),salt=_arg.salt,i=_arg.i,(progress_hook=_arg.progress_hook)(0),seed=salt.clone().concat(new WordArray([i])),U=this._PRF(seed),ret=U.clone(),i=1,function(_this){return function(__iced_k){var _while;(_while=function(__iced_k){var _break,_continue,_next;if(_break=__iced_k,_continue=function(){return iced.trampoline(function(){return _while(__iced_k)})},_next=_continue,!(i<_this.c))return _break();for(stop=Math.min(_this.c,i+128);i<stop;)U=_this._PRF(U),ret.xor(U,{}),i++;progress_hook(i),__iced_deferrals=new iced.Deferrals(function(){return _next(null)},{parent:___iced_passed_deferral,filename:"/Users/max/src/keybase/triplesec/src/pbkdf2.iced",funcname:"PBKDF2._gen_T_i"}),util.default_delay(0,0,__iced_deferrals.defer({lineno:57})),__iced_deferrals._fulfill()})(__iced_k)}}(this)(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,words,___iced_passed_deferral,__iced_deferrals,_begin,_end,_positive;___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=[],(ph=function(_this){return 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}}}(this))(0)(0),function(_this){return function(__iced_k){var _while;i=1,_positive=(_end=n)>(_begin=1),(_while=function(__iced_k){var _break,_continue,_next;if(_break=__iced_k,_continue=function(){return iced.trampoline(function(){return _positive?i+=1:i-=1,_while(__iced_k)})},_next=_continue,!0===_positive&&i>n||!1===_positive&&i<n)return _break();__iced_deferrals=new iced.Deferrals(function(){return _next(words.push(tmp.words))},{parent:___iced_passed_deferral,filename:"/Users/max/src/keybase/triplesec/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 tmp=arguments[0]},lineno:80})),__iced_deferrals._fulfill()})(__iced_k)}}(this)(function(_this){return 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))}}(this))},PBKDF2}(),pbkdf2=function(_arg,cb){var c,dkLen,eng,key,klass,out,progress_hook,salt,___iced_passed_deferral,__iced_deferrals;___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:"/Users/max/src/keybase/triplesec/src/pbkdf2.iced"}),eng.run({key:key,salt:salt,dkLen:dkLen,progress_hook:progress_hook},__iced_deferrals.defer({assign_fn:function(){return out=arguments[0]},lineno:106})),__iced_deferrals._fulfill()}(function(){return cb(out)})},exports.pbkdf2=pbkdf2,exports.PBKDF2=PBKDF2}).call(this)},{"./hmac":8,"./util":23,"./wordarray":24,"iced-runtime":29}],12:[function(require,module,exports){var Buffer=require("__browserify_Buffer");(function(){var ADRBG,PRNG,WordArray,XOR,browser_rng,generate,iced,m,more_entropy,native_rng,rng,util,_browser_rng_primitive,_native_rng,_prng,_ref,_ref1;if(iced=require("iced-runtime"),function(){},more_entropy=require("more-entropy"),ADRBG=require("./drbg").ADRBG,WordArray=require("./wordarray").WordArray,XOR=require("./combine").XOR,util=require("./util"),_browser_rng_primitive=null,browser_rng=function(n){var v;return v=new Uint8Array(n),_browser_rng_primitive(v),new Buffer(v)},null!=(_browser_rng_primitive=null!=(m="undefined"!=typeof window&&null!==window&&null!=(_ref=window.crypto)?_ref.getRandomValues:void 0)?m.bind(window.crypto):null!=(m="undefined"!=typeof window&&null!==window&&null!=(_ref1=window.msCrypto)?_ref1.getRandomValues:void 0)?m.bind(window.msCrypto):null))_native_rng=browser_rng;else try{null!=(rng=require("crypto").rng)&&(_native_rng=rng)}catch(_error){_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(){this.meg=new more_entropy.Generator,this.adrbg=new ADRBG(function(_this){return function(n,cb){return _this.gen_seed(n,cb)}}(this),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)).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_passed_deferral=iced.findDeferral(arguments),nbytes=nbits/8,(bufs=[]).push(this.now_to_buffer()),function(_this){return function(__iced_k){__iced_deferrals=new iced.Deferrals(__iced_k,{parent:___iced_passed_deferral,filename:"/Users/max/src/keybase/triplesec/src/prng.iced",funcname:"PRNG.gen_seed"}),_this.meg.generate(nbits,__iced_deferrals.defer({assign_fn:function(){return words=arguments[0]},lineno:83})),__iced_deferrals._fulfill()}}(this)(function(_this){return 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;_i<_len;_i++)b=bufs[_i],util.scrub_buffer(b);return cb(wa)}}(this))},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)},{"./combine":3,"./drbg":6,"./util":23,"./wordarray":24,__browserify_Buffer:31,"iced-runtime":29,"more-entropy":33}],13:[function(require,module,exports){(function(){var G,Global,Hasher,RIPEMD160,WordArray,f1,f2,f3,f4,f5,rotl,transform,_ref,__hasProp={}.hasOwnProperty;_ref=require("./wordarray"),WordArray=_ref.WordArray,_ref.X64Word,_ref.X64WordArray,Hasher=require("./algbase").Hasher,Global=function(){return function(){this._zl=new WordArray([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]),this._zr=new WordArray([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]),this._sl=new WordArray([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]),this._sr=new WordArray([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]),this._hl=new WordArray([0,1518500249,1859775393,2400959708,2840853838]),this._hr=new WordArray([1352829926,1548603684,1836072691,2053994217,0])}}(),G=new Global,RIPEMD160=function(_super){function RIPEMD160(){return RIPEMD160.__super__.constructor.apply(this,arguments)}return function(child,parent){function ctor(){this.constructor=child}for(var key in parent)__hasProp.call(parent,key)&&(child[key]=parent[key]);ctor.prototype=parent.prototype,child.prototype=new ctor,child.__super__=parent.prototype}(RIPEMD160,Hasher),RIPEMD160.blockSize=16,RIPEMD160.prototype.blockSize=RIPEMD160.blockSize,RIPEMD160.output_size=20,RIPEMD160.prototype.output_size=RIPEMD160.output_size,RIPEMD160.prototype._doReset=function(){return this._hash=new WordArray([1732584193,4023233417,2562383102,271733878,3285377520])},RIPEMD160.prototype.get_output_size=function(){return this.output_size},RIPEMD160.prototype._doProcessBlock=function(M,offset){var H,M_offset_i,al,ar,bl,br,cl,cr,dl,dr,el,er,hl,hr,i,offset_i,sl,sr,t,zl,zr,_i,_j;for(i=_i=0;_i<16;i=++_i)M_offset_i=M[offset_i=offset+i],M[offset_i]=16711935&(M_offset_i<<8|M_offset_i>>>24)|4278255360&(M_offset_i<<24|M_offset_i>>>8);for(H=this._hash.words,hl=G._hl.words,hr=G._hr.words,zl=G._zl.words,zr=G._zr.words,sl=G._sl.words,sr=G._sr.words,ar=al=H[0],br=bl=H[1],cr=cl=H[2],dr=dl=H[3],er=el=H[4],i=_j=0;_j<80;i=++_j)t=al+M[offset+zl[i]]|0,t+=i<16?f1(bl,cl,dl)+hl[0]:i<32?f2(bl,cl,dl)+hl[1]:i<48?f3(bl,cl,dl)+hl[2]:i<64?f4(bl,cl,dl)+hl[3]:f5(bl,cl,dl)+hl[4],t=(t=rotl(t|=0,sl[i]))+el|0,al=el,el=dl,dl=rotl(cl,10),cl=bl,bl=t,t=ar+M[offset+zr[i]]|0,t+=i<16?f5(br,cr,dr)+hr[0]:i<32?f4(br,cr,dr)+hr[1]:i<48?f3(br,cr,dr)+hr[2]:i<64?f2(br,cr,dr)+hr[3]:f1(br,cr,dr)+hr[4],t=(t=rotl(t|=0,sr[i]))+er|0,ar=er,er=dr,dr=rotl(cr,10),cr=br,br=t;return t=H[1]+cl+dr|0,H[1]=H[2]+dl+er|0,H[2]=H[3]+el+ar|0,H[3]=H[4]+al+br|0,H[4]=H[0]+bl+cr|0,H[0]=t},RIPEMD160.prototype._doFinalize=function(){var H,H_i,data,dataWords,hash,i,nBitsLeft,nBitsTotal,_i;for(dataWords=(data=this._data).words,nBitsTotal=8*this._nDataBytes,dataWords[(nBitsLeft=8*data.sigBytes)>>>5]|=128<<24-nBitsLeft%32,dataWords[14+(nBitsLeft+64>>>9<<4)]=16711935&(nBitsTotal<<8|nBitsTotal>>>24)|4278255360&(nBitsTotal<<24|nBitsTotal>>>8),data.sigBytes=4*(dataWords.length+1),this._process(),H=(hash=this._hash).words,i=_i=0;_i<5;i=++_i)H_i=H[i],H[i]=16711935&(H_i<<8|H_i>>>24)|4278255360&(H_i<<24|H_i>>>8);return hash},RIPEMD160.prototype.scrub=function(){return this._hash.scrub()},RIPEMD160.prototype.copy_to=function(obj){return RIPEMD160.__super__.copy_to.call(this,obj),obj._hash=this._hash.clone()},RIPEMD160.prototype.clone=function(){var out;return out=new RIPEMD160,this.copy_to(out),out},RIPEMD160}(),f1=function(x,y,z){return x^y^z},f2=function(x,y,z){return x&y|~x&z},f3=function(x,y,z){return(x|~y)^z},f4=function(x,y,z){return x&z|y&~z},f5=function(x,y,z){return x^(y|~z)},rotl=function(x,n){return x<<n|x>>>32-n},transform=function(x){var out;return out=(new RIPEMD160).finalize(x),x.scrub(),out},exports.RIPEMD160=RIPEMD160,exports.transform=transform}).call(this)},{"./algbase":2,"./wordarray":24}],14:[function(require,module,exports){var Buffer=require("__browserify_Buffer");(function(){var Cipher,Counter,Salsa20Core,Salsa20InnerCore,Salsa20WordStream,StreamCipher,WordArray,asum,endian_reverse,fixup_uint32,iced,util,_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-runtime"),_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;_i<_len;i=++_i)e=v[i],out[i]+=e;return!1},Salsa20InnerCore=function(){function Salsa20InnerCore(rounds){this.rounds=rounds}return Salsa20InnerCore.prototype._core=function(v){var u,x0,x1,x10,x11,x12,x13,x14,x15,x2,x3,x4,x5,x6,x7,x8,x9,_i,_ref1;for(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],_i=0,_ref1=this.rounds;_i<_ref1;_i+=2)x0^=(u=(x12^=(u=(x8^=(u=(x4^=(u=x0+x12|0)<<7|u>>>25)+x0|0)<<9|u>>>23)+x4|0)<<13|u>>>19)+x8|0)<<18|u>>>14,x5^=(u=(x1^=(u=(x13^=(u=(x9^=(u=x5+x1|0)<<7|u>>>25)+x5|0)<<9|u>>>23)+x9|0)<<13|u>>>19)+x13|0)<<18|u>>>14,x10^=(u=(x6^=(u=(x2^=(u=(x14^=(u=x10+x6|0)<<7|u>>>25)+x10|0)<<9|u>>>23)+x14|0)<<13|u>>>19)+x2|0)<<18|u>>>14,x15^=(u=(x11^=(u=(x7^=(u=(x3^=(u=x15+x11|0)<<7|u>>>25)+x15|0)<<9|u>>>23)+x3|0)<<13|u>>>19)+x7|0)<<18|u>>>14,x0^=(u=(x3^=(u=(x2^=(u=(x1^=(u=x0+x3|0)<<7|u>>>25)+x0|0)<<9|u>>>23)+x1|0)<<13|u>>>19)+x2|0)<<18|u>>>14,x5^=(u=(x4^=(u=(x7^=(u=(x6^=(u=x5+x4|0)<<7|u>>>25)+x5|0)<<9|u>>>23)+x6|0)<<13|u>>>19)+x7|0)<<18|u>>>14,x10^=(u=(x9^=(u=(x8^=(u=(x11^=(u=x10+x9|0)<<7|u>>>25)+x10|0)<<9|u>>>23)+x11|0)<<13|u>>>19)+x8|0)<<18|u>>>14,x15^=(u=(x14^=(u=(x13^=(u=(x12^=(u=x15+x14|0)<<7|u>>>25)+x15|0)<<9|u>>>23)+x12|0)<<13|u>>>19)+x13|0)<<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,Salsa20InnerCore),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;return n0=new WordArray(this.nonce.words.slice(0,4)),this.nonce=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;_i<_len;_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;_i<4;i=++_i)out[i+1]=key.words[i];for(C=(_ref1=32===key.sigBytes?[this.sigma,key.words.slice(4)]:[this.tau,key.words])[0],A=_ref1[1],i=_j=0;_j<4;i=++_j)out[i+11]=A[i];for(i=_k=0;_k<4;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}(),exports.Salsa20WordStream=Salsa20WordStream=function(_super){function Salsa20WordStream(){return Salsa20WordStream.__super__.constructor.apply(this,arguments)}return __extends(Salsa20WordStream,Salsa20Core),Salsa20WordStream.prototype._reset=function(){return Salsa20WordStream.__super__._reset.call(this)},Salsa20WordStream.prototype.getWordArray=function(nbytes){var blocks,i,nblocks,w,words,_i,_len,_ref1;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;0<=nblocks?_i<nblocks:_i>nblocks;i=0<=nblocks?++_i:--_i)_results.push(this._generateBlock());return _results}.call(this),words=(_ref1=[]).concat.apply(_ref1,blocks)),i=_i=0,_len=words.length;_i<_len;i=++_i)w=words[i],words[i]=endian_reverse(w);return new WordArray(words,nbytes)},Salsa20WordStream}(),exports.Salsa20=function(_super){function Salsa20(){return Salsa20.__super__.constructor.apply(this,arguments)}return __extends(Salsa20,Salsa20Core),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),i=_i=0,_len=(v=this._generateBlock()).length;_i<_len;i=++_i)e=v[i],this._buf.writeUInt32LE(fixup_uint32(e),4*i);return this._buf},Salsa20}(),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,StreamCipher),Cipher.prototype.scrub=function(){return this.salsa.scrub()},Cipher.prototype.get_pad=function(){return this.salsa.getWordArray()},Cipher}(),exports.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=function(_arg,cb){var cipher,input,iv,key,progress_hook,ret,___iced_passed_deferral,__iced_deferrals;___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:"/Users/max/src/keybase/triplesec/src/salsa20.iced"}),cipher.bulk_encrypt({input:input,progress_hook:progress_hook,what:"salsa20"},__iced_deferrals.defer({assign_fn:function(){return ret=arguments[0]},lineno:256})),__iced_deferrals._fulfill()}(function(){return cipher.scrub(),cb(ret)})},exports.Salsa20InnerCore=Salsa20InnerCore,exports.endian_reverse=endian_reverse,exports.asum=asum}).call(this)},{"./algbase":2,"./ctr":4,"./util":23,"./wordarray":24,__browserify_Buffer:31,"iced-runtime":29}],15:[function(require,module,exports){(function(){var HMAC_SHA256,Salsa20InnerCore,Scrypt,WordArray,blkcpy,blkxor,default_delay,endian_reverse,fixup_uint32,iced,pbkdf2,scrub_vec,scrypt,v_endian_reverse,_ref,_ref1,_ref2;iced=require("iced-runtime"),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,WordArray=_ref1.WordArray,_ref2=require("./util"),fixup_uint32=_ref2.fixup_uint32,default_delay=_ref2.default_delay,scrub_vec=_ref2.scrub_vec,new(function(){function Timer(){this.tot=0}return Timer.prototype.start=function(){return this._t=Date.now()},Timer.prototype.stop=function(){return this.tot+=Date.now()-this._t},Timer}()),blkcpy=function(D,S,d_offset,s_offset,len){var end,i,j;for(j=d_offset<<4|0,end=(i=s_offset<<4|0)+(len<<4)|0;i<end;)D[j]=S[i],D[j+1]=S[i+1],D[j+2]=S[i+2],D[j+3]=S[i+3],D[j+4]=S[i+4],D[j+5]=S[i+5],D[j+6]=S[i+6],D[j+7]=S[i+7],D[j+8]=S[i+8],D[j+9]=S[i+9],D[j+10]=S[i+10],D[j+11]=S[i+11],D[j+12]=S[i+12],D[j+13]=S[i+13],D[j+14]=S[i+14],D[j+15]=S[i+15],i+=16,j+=16;return!0},blkxor=function(D,S,s_offset,len){var i,j;for(len=len<<4|0,i=0,j=s_offset<<4|0;i<len;)D[i]^=S[j],D[i+1]^=S[j+1],D[i+2]^=S[j+2],D[i+3]^=S[j+3],D[i+4]^=S[j+4],D[i+5]^=S[j+5],D[i+6]^=S[j+6],D[i+7]^=S[j+7],D[i+8]^=S[j+8],D[i+9]^=S[j+9],D[i+10]^=S[j+10],D[i+11]^=S[j+11],D[i+12]^=S[j+12],D[i+13]^=S[j+13],D[i+14]^=S[j+14],D[i+15]^=S[j+15],i+=16,j+=16;return!0},v_endian_reverse=function(v){var e,i,_i,_len;for(i=_i=0,_len=v.length;_i<_len;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||15)),this.r||(this.r=8),this.p||(this.p=1),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(i=_i=0,_len=(X=this.s20ic._core(B)).length;_i<_len;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_passed_deferral=iced.findDeferral(arguments),key=_arg.key,salt=_arg.salt,dkLen=_arg.dkLen,progress_hook=_arg.progress_hook,c=_arg.c,function(_this){return function(__iced_k){__iced_deferrals=new iced.Deferrals(__iced_k,{parent:___iced_passed_deferral,filename:"/Users/max/src/keybase/triplesec/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 wa=arguments[0]},lineno:109})),__iced_deferrals._fulfill()}}(this)(function(){return cb(wa)})},Scrypt.prototype.blockmix_salsa8=function(B,Y){var X,i,_i,_ref3;for(X=this.X16_tmp,blkcpy(X,B,0,2*this.r-1,1),i=_i=0,_ref3=2*this.r;0<=_ref3?_i<_ref3:_i>_ref3;i=0<=_ref3?++_i:--_i)blkxor(X,B,i,1),this.salsa20_8(X),blkcpy(Y,X,i,0,1);for(i=0;i<this.r;)blkcpy(B,Y,i,2*i,1),i++;for(i=0;i<this.r;)blkcpy(B,Y,i+this.r,2*i+1,1),i++;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_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(_this){return function(__iced_k){var _while;(_while=function(__iced_k){var _break,_continue,_next;if(_break=__iced_k,_continue=function(){return iced.trampoline(function(){return _while(__iced_k)})},_next=_continue,!(i<_this.N))return _break();for(stop=Math.min(_this.N,i+2048);i<stop;)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:"/Users/max/src/keybase/triplesec/src/scrypt.iced",funcname:"Scrypt.smix"}),default_delay(0,0,__iced_deferrals.defer({lineno:166})),__iced_deferrals._fulfill()}(_next)})(__iced_k)}}(this)(function(_this){return function(){i=0,function(__iced_k){var _while;(_while=function(__iced_k){var _break,_continue,_next;if(_break=__iced_k,_continue=function(){return iced.trampoline(function(){return _while(__iced_k)})},_next=_continue,!(i<_this.N))return _break();for(stop=Math.min(_this.N,i+256);i<stop;)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:"/Users/max/src/keybase/triplesec/src/scrypt.iced",funcname:"Scrypt.smix"}),default_delay(0,0,__iced_deferrals.defer({lineno:183})),__iced_deferrals._fulfill()}(_next)})(function(){return blkcpy(B,X,0,0,lim),cb()})}()}}(this))},Scrypt.prototype.run=function(_arg,cb){var B,MAX,V,XY,dkLen,j,key,lph,out,progress_hook,salt,___iced_passed_deferral,__iced_deferrals,_begin,_end,_positive;___iced_passed_deferral=iced.findDeferral(arguments),key=_arg.key,salt=_arg.salt,dkLen=_arg.dkLen,progress_hook=_arg.progress_hook,dkLen>(MAX=4294967295)?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"),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(_this){return function(__iced_k){__iced_deferrals=new iced.Deferrals(__iced_k,{parent:___iced_passed_deferral,filename:"/Users/max/src/keybase/triplesec/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 B=arguments[0]},lineno:214})),__iced_deferrals._fulfill()}}(this)(function(_this){return 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 _while;j=0,_begin=0,_end=_this.p,_positive=_end>_begin,(_while=function(__iced_k){var _break,_continue,_next;if(_break=__iced_k,_continue=function(){return iced.trampoline(function(){return _positive?j+=1:j-=1,_while(__iced_k)})},_next=_continue,!0===_positive&&j>=_this.p||!1===_positive&&j<=_this.p)return _break();!function(__iced_k){__iced_deferrals=new iced.Deferrals(__iced_k,{parent:___iced_passed_deferral,filename:"/Users/max/src/keybase/triplesec/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:221})),__iced_deferrals._fulfill()}(_next)})(function(){v_endian_reverse(B),lph=function(o){return o.what+=" (pass 2)","function"==typeof progress_hook?progress_hook(o):void 0},__iced_deferrals=new iced.Deferrals(function(){return scrub_vec(XY),scrub_vec(V),scrub_vec(B),key.scrub(),cb(out)},{parent:___iced_passed_deferral,filename:"/Users/max/src/keybase/triplesec/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 out=arguments[0]},lineno:229})),__iced_deferrals._fulfill()})}()}}(this))},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_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:"/Users/max/src/keybase/triplesec/src/scrypt.iced"}),eng.run({key:key,salt:salt,progress_hook:progress_hook,dkLen:dkLen},__iced_deferrals.defer({assign_fn:function(){return wa=arguments[0]},lineno:259})),__iced_deferrals._fulfill()}(function(){return cb(wa)})},exports.Scrypt=Scrypt,exports.scrypt=scrypt,exports.v_endian_reverse=v_endian_reverse}).call(this)},{"./hmac":8,"./pbkdf2":11,"./salsa20":14,"./util":23,"./wordarray":24,"iced-runtime":29}],16:[function(require,module,exports){(function(){var Hasher,SHA1,W,WordArray,transform,__hasProp={}.hasOwnProperty;WordArray=require("./wordarray").WordArray,Hasher=require("./algbase").Hasher,W=[],SHA1=function(_super){function SHA1(){return SHA1.__super__.constructor.apply(this,arguments)}return function(child,parent){function ctor(){this.constructor=child}for(var key in parent)__hasProp.call(parent,key)&&(child[key]=parent[key]);ctor.prototype=parent.prototype,child.prototype=new ctor,child.__super__=parent.prototype}(SHA1,Hasher),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(a=(H=this._hash.words)[0],b=H[1],c=H[2],d=H[3],e=H[4],i=_i=0;_i<80;i=++_i)i<16?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+=i<20?1518500249+(b&c|~b&d):i<40?1859775393+(b^c^d):i<60?(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[14+(nBitsLeft+64>>>9<<4)]=Math.floor(nBitsTotal/4294967296),dataWords[15+(nBitsLeft+64>>>9<<4)]=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}(),transform=transform=function(x){var out;return out=(new SHA1).finalize(x),x.scrub(),out},exports.SHA1=SHA1,exports.transform=transform}).call(this)},{"./algbase":2,"./wordarray":24}],17:[function(require,module,exports){(function(){var SHA224,SHA256,WordArray,transform,__hasProp={}.hasOwnProperty;WordArray=require("./wordarray").WordArray,SHA256=require("./sha256").SHA256,SHA224=function(_super){function SHA224(){return SHA224.__super__.constructor.apply(this,arguments)}return function(child,parent){function ctor(){this.constructor=child}for(var key in parent)__hasProp.call(parent,key)&&(child[key]=parent[key]);ctor.prototype=parent.prototype,child.prototype=new ctor,child.__super__=parent.prototype}(SHA224,SHA256),SHA224.output_size=28,SHA224.prototype.output_size=SHA224.output_size,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}(),transform=function(x){var out;return out=(new SHA224).finalize(x),x.scrub(),out},exports.SHA224=SHA224,exports.transform=transform}).call(this)},{"./sha256":18,"./wordarray":24}],18:[function(require,module,exports){(function(){var Global,Hasher,SHA256,WordArray,glbl,transform,__hasProp={}.hasOwnProperty;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;2<=sqn?_i<=sqn:_i>=sqn;f=2<=sqn?++_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=[];nPrime<64;)this.isPrime(n)&&(nPrime<8&&(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 SHA256.__super__.constructor.apply(this,arguments)}return function(child,parent){function ctor(){this.constructor=child}for(var key in parent)__hasProp.call(parent,key)&&(child[key]=parent[key]);ctor.prototype=parent.prototype,child.prototype=new ctor,child.__super__=parent.prototype}(SHA256,Hasher),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,d,e,f,g,gamma0,gamma0x,gamma1,gamma1x,h,i,maj,sigma0,t1,_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;_i<64;i=++_i)i<16?W[i]=0|M[offset+i]:(gamma0=((gamma0x=W[i-15])<<25|gamma0x>>>7)^(gamma0x<<14|gamma0x>>>18)^gamma0x>>>3,gamma1=((gamma1x=W[i-2])<<15|gamma1x>>>17)^(gamma1x<<13|gamma1x>>>19)^gamma1x>>>10,W[i]=gamma0+W[i-7]+gamma1+W[i-16]),maj=a&b^a&c^b&c,sigma0=(a<<30|a>>>2)^(a<<19|a>>>13)^(a<<10|a>>>22),t1=h+((e<<26|e>>>6)^(e<<21|e>>>11)^(e<<7|e>>>25))+(e&f^~e&g)+K[i]+W[i],h=g,g=f,f=e,e=d+t1|0,d=c,c=b,b=a,a=t1+(sigma0+maj)|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[14+(nBitsLeft+64>>>9<<4)]=Math.floor(nBitsTotal/4294967296),dataWords[15+(nBitsLeft+64>>>9<<4)]=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}(),transform=function(x){var out;return out=(new SHA256).finalize(x),x.scrub(),out},exports.SHA256=SHA256,exports.transform=transform}).call(this)},{"./algbase":2,"./wordarray":24}],19:[function(require,module,exports){(function(){var Global,Hasher,SHA3,WordArray,X64Word,glbl,_ref,__hasProp={}.hasOwnProperty;_ref=require("./wordarray"),WordArray=_ref.WordArray,X64Word=_ref.X64Word,_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 newY,t,x,y,_i,_results;for(x=1,y=0,_results=[],t=_i=0;_i<24;t=++_i)this.RHO_OFFSETS[x+5*y]=(t+1)*(t+2)/2%64,newY=(2*x+3*y)%5,x=y%5,_results.push(y=newY);return _results},Global.prototype.compute_pi_indexes=function(){var x,y,_i,_results;for(_results=[],x=_i=0;_i<5;x=++_i)_results.push(function(){var _j,_results1;for(_results1=[],y=_j=0;_j<5;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;_i<24;i=++_i){for(roundConstantMsw=0,roundConstantLsw=0,j=_j=0;_j<7;j=++_j)1&LFSR&&((bitPosition=(1<<j)-1)<32?roundConstantLsw^=1<<bitPosition:roundConstantMsw^=1<<bitPosition-32),128&LFSR?LFSR=LFSR<<1^113:LFSR<<=1;_results.push(this.ROUND_CONSTANTS[i]=new X64Word(roundConstantMsw,roundConstantLsw))}return _results},Global.prototype.make_reusables=function(){var i;return this.T=function(){var _i,_results;for(_results=[],i=_i=0;_i<25;i=++_i)_results.push(new X64Word(0,0));return _results}()},Global}(),glbl=new Global,exports.SHA3=SHA3=function(_super){function SHA3(){return SHA3.__super__.constructor.apply(this,arguments)}return function(child,parent){function ctor(){this.constructor=child}for(var key in parent)__hasProp.call(parent,key)&&(child[key]=parent[key]);ctor.prototype=parent.prototype,child.prototype=new ctor,child.__super__=parent.prototype}(SHA3,Hasher),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;_i<25;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;0<=nBlockSizeLanes?_i<nBlockSizeLanes:_i>nBlockSizeLanes;i=0<=nBlockSizeLanes?++_i:--_i)M2i=16711935&((M2i=M[offset+2*i])<<8|M2i>>>24)|4278255360&(M2i<<24|M2i>>>8),M2i1=16711935&((M2i1=M[offset+2*i+1])<<8|M2i1>>>24)|4278255360&(M2i1<<24|M2i1>>>8),(lane=state[i]).high^=M2i1,lane.low^=M2i;for(_results=[],round=_j=0;_j<24;round=++_j){for(x=_k=0;_k<5;x=++_k){for(tMsw=tLsw=0,y=_l=0;_l<5;y=++_l)tMsw^=(lane=state[x+5*y]).high,tLsw^=lane.low;(Tx=G.T[x]).high=tMsw,Tx.low=tLsw}for(x=_m=0;_m<5;x=++_m)for(Tx4=G.T[(x+4)%5],Tx1Msw=(Tx1=G.T[(x+1)%5]).high,Tx1Lsw=Tx1.low,tMsw=Tx4.high^(Tx1Msw<<1|Tx1Lsw>>>31),tLsw=Tx4.low^(Tx1Lsw<<1|Tx1Msw>>>31),y=_n=0;_n<5;y=++_n)(lane=state[x+5*y]).high^=tMsw,lane.low^=tLsw;for(laneIndex=_o=1;_o<25;laneIndex=++_o)laneMsw=(lane=state[laneIndex]).high,laneLsw=lane.low,(rhoOffset=G.RHO_OFFSETS[laneIndex])<32?(tMsw=laneMsw<<rhoOffset|laneLsw>>>32-rhoOffset,tLsw=laneLsw<<rhoOffset|laneMsw>>>32-rhoOffset):(tMsw=laneLsw<<rhoOffset-32|laneMsw>>>64-rhoOffset,tLsw=laneMsw<<rhoOffset-32|laneLsw>>>64-rhoOffset),(TPiLane=G.T[G.PI_INDEXES[laneIndex]]).high=tMsw,TPiLane.low=tLsw;for(T0=G.T[0],state0=state[0],T0.high=state0.high,T0.low=state0.low,x=_p=0;_p<5;x=++_p)for(y=_q=0;_q<5;y=++_q)lane=state[laneIndex=x+5*y],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,outputLengthBytes,outputLengthLanes,state,_i;for(dataWords=(data=this._data).words,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,outputLengthLanes=(outputLengthBytes=this.outputLength/8)/8,hashWords=[],i=_i=0;0<=outputLengthLanes?_i<outputLengthLanes:_i>outputLengthLanes;i=0<=outputLengthLanes?++_i:--_i)laneMsw=16711935&((laneMsw=(lane=state[i]).high)<<8|laneMsw>>>24)|4278255360&(laneMsw<<24|laneMsw>>>8),laneLsw=16711935&((laneLsw=lane.low)<<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,_ref1,_results;for(_results=[],_i=0,_len=(_ref1=this._state).length;_i<_len;_i++)s=_ref1[_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}(),exports.transform=function(x){var out;return out=(new SHA3).finalize(x),x.scrub(),out}}).call(this)},{"./algbase":2,"./wordarray":24}],20:[function(require,module,exports){(function(){var Global,SHA384,SHA512,X64WordArray,transform,_ref,_ref1,__hasProp={}.hasOwnProperty;_ref=require("./wordarray"),X64WordArray=_ref.X64WordArray,_ref.WordArray,SHA512=(_ref1=require("./sha512")).SHA512,Global=_ref1.Global,SHA384=function(_super){function SHA384(){return SHA384.__super__.constructor.apply(this,arguments)}return function(child,parent){function ctor(){this.constructor=child}for(var key in parent)__hasProp.call(parent,key)&&(child[key]=parent[key]);ctor.prototype=parent.prototype,child.prototype=new ctor,child.__super__=parent.prototype}(SHA384,SHA512),SHA384.output_size=48,SHA384.prototype.output_size=SHA384.output_size,SHA384.prototype._doReset=function(){return this._hash=new X64WordArray(Global.convert([3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]))},SHA384.prototype._doFinalize=function(){var hash;return hash=SHA384.__super__._doFinalize.call(this),hash.sigBytes-=16,hash},SHA384.prototype.clone=function(){var out;return out=new SHA384,this.copy_to(out),out},SHA384}(),transform=function(x){var out;return out=(new SHA384).finalize(x),x.scrub(),out},exports.SHA384=SHA384,exports.transform=transform}).call(this)},{"./sha512":21,"./wordarray":24}],21:[function(require,module,exports){(function(){var Global,Hasher,SHA512,X64Word,X64WordArray,glbl,_ref,__hasProp={}.hasOwnProperty;_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;_i<80;i=++_i)_results.push(new X64Word(0,0));return _results}()}return Global.convert=function(raw){var i,_i,_ref1,_results;for(_results=[],i=_i=0,_ref1=raw.length;_i<_ref1;i=_i+=2)_results.push(new X64Word(raw[i],raw[i+1]));return _results},Global.prototype.convert=function(raw){return Global.convert(raw)},Global}(),exports.Global=Global,glbl=new Global,exports.SHA512=SHA512=function(_super){function SHA512(){return SHA512.__super__.constructor.apply(this,arguments)}return function(child,parent){function ctor(){this.constructor=child}for(var key in parent)__hasProp.call(parent,key)&&(child[key]=parent[key]);ctor.prototype=parent.prototype,child.prototype=new ctor,child.__super__=parent.prototype}(SHA512,Hasher),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],ah=H0h=H0.high,al=H0l=H0.low,bh=H1h=H1.high,bl=H1l=H1.low,ch=H2h=H2.high,cl=H2l=H2.low,dh=H3h=H3.high,dl=H3l=H3.low,eh=H4h=H4.high,el=H4l=H4.low,fh=H5h=H5.high,fl=H5l=H5.low,gh=H6h=H6.high,gl=H6l=H6.low,hh=H7h=H7.high,hl=H7l=H7.low,i=_i=0;_i<80;i=++_i)Wi=W[i],i<16?(Wih=Wi.high=0|M[offset+2*i],Wil=Wi.low=0|M[offset+2*i+1]):(gamma0h=((gamma0xh=(gamma0x=W[i-15]).high)>>>1|(gamma0xl=gamma0x.low)<<31)^(gamma0xh>>>8|gamma0xl<<24)^gamma0xh>>>7,gamma0l=(gamma0xl>>>1|gamma0xh<<31)^(gamma0xl>>>8|gamma0xh<<24)^(gamma0xl>>>7|gamma0xh<<25),gamma1h=((gamma1xh=(gamma1x=W[i-2]).high)>>>19|(gamma1xl=gamma1x.low)<<13)^(gamma1xh<<3|gamma1xl>>>29)^gamma1xh>>>6,gamma1l=(gamma1xl>>>19|gamma1xh<<13)^(gamma1xl<<3|gamma1xh>>>29)^(gamma1xl>>>6|gamma1xh<<26),Wi7h=(Wi7=W[i-7]).high,Wi7l=Wi7.low,Wi16h=(Wi16=W[i-16]).high,Wi16l=Wi16.low,Wih=(Wih=(Wih=gamma0h+Wi7h+((Wil=gamma0l+Wi7l)>>>0<gamma0l>>>0?1:0))+gamma1h+((Wil+=gamma1l)>>>0<gamma1l>>>0?1:0))+Wi16h+((Wil+=Wi16l)>>>0<Wi16l>>>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),Kih=(Ki=glbl.K[i]).high,Kil=Ki.low,t1h=(t1h=(t1h=(t1h=hh+sigma1h+((t1l=hl+sigma1l)>>>0<hl>>>0?1:0))+chh+((t1l+=chl)>>>0<chl>>>0?1:0))+Kih+((t1l+=Kil)>>>0<Kil>>>0?1:0))+Wih+((t1l+=Wil)>>>0<Wil>>>0?1:0),t2h=sigma0h+majh+((t2l=sigma0l+majl)>>>0<sigma0l>>>0?1:0),hh=gh,hl=gl,gh=fh,gl=fl,fh=eh,fl=el,eh=dh+t1h+((el=dl+t1l|0)>>>0<dl>>>0?1:0)|0,dh=ch,dl=cl,ch=bh,cl=bl,bh=ah,bl=al,ah=t1h+t2h+((al=t1l+t2l|0)>>>0<t1l>>>0?1:0)|0;return H0l=H0.low=H0l+al,H0.high=H0h+ah+(H0l>>>0<al>>>0?1:0),H1l=H1.low=H1l+bl,H1.high=H1h+bh+(H1l>>>0<bl>>>0?1:0),H2l=H2.low=H2l+cl,H2.high=H2h+ch+(H2l>>>0<cl>>>0?1:0),H3l=H3.low=H3l+dl,H3.high=H3h+dh+(H3l>>>0<dl>>>0?1:0),H4l=H4.low=H4l+el,H4.high=H4h+eh+(H4l>>>0<el>>>0?1:0),H5l=H5.low=H5l+fl,H5.high=H5h+fh+(H5l>>>0<fl>>>0?1:0),H6l=H6.low=H6l+gl,H6.high=H6h+gh+(H6l>>>0<gl>>>0?1:0),H7l=H7.low=H7l+hl,H7.high=H7h+hh+(H7l>>>0<hl>>>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[30+(nBitsLeft+128>>>10<<5)]=Math.floor(nBitsTotal/4294967296),dataWords[31+(nBitsLeft+128>>>10<<5)]=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}(),exports.transform=function(x){var out;return out=(new SHA512).finalize(x),x.scrub(),out}}).call(this)},{"./algbase":2,"./wordarray":24}],22:[function(require,module,exports){(function(){var BlockCipher,G,Global,scrub_vec,__hasProp={}.hasOwnProperty;BlockCipher=require("./algbase").BlockCipher,scrub_vec=require("./util").scrub_vec,Global=function(){return function(){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}}(),G=new Global,exports.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 function(child,parent){function ctor(){this.constructor=child}for(var key in parent)__hasProp.call(parent,key)&&(child[key]=parent[key]);ctor.prototype=parent.prototype,child.prototype=new ctor,child.__super__=parent.prototype}(TwoFish,BlockCipher),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 r,_i,_j;for(r=k1,_i=0;_i<4;++_i)r=this.RS_rem(r);for(r^=k0,_j=0;_j<4;++_j)r=this.RS_rem(r);return r},TwoFish.prototype.F32=function(x,k32){var b0,b1,b2,b3,k0,k1,k2,k3,m;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,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)),(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.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,_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;_i<256;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;0<=_ref?_j<_ref:_j>_ref;i=0<=_ref?++_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,20;_k<20;i=++_k)q=i*G.SK_STEP,A=this.F32(q,k32e),A+=B=(B=this.F32(q+G.SK_BUMP,k32o))<<8|B>>>24,this.gSubKeys[2*i]=A,A+=B,this.gSubKeys[2*i+1]=A<<G.SK_ROTL|A>>>32-G.SK_ROTL;for(k0=sBoxKeys[0],k1=sBoxKeys[1],k2=sBoxKeys[2],k3=sBoxKeys[3],this.gSBox=[],_results=[],i=_l=0;_l<256;i=++_l)b0=b1=b2=b3=i,1===(m=3&this.k64Cnt)?(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,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,_i=0;_i<16;_i+=2)x1^=(t0=this.Fe32_0(x2))+2*(t1=this.Fe32_3(x3))+this.gSubKeys[k--],x0=(x0<<1|x0>>>31)^t0+t1+this.gSubKeys[k--],x1=x1>>>1|x1<<31,x3^=(t0=this.Fe32_0(x0))+2*(t1=this.Fe32_3(x1))+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,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,_i=0;_i<16;_i+=2)x2=(x2^=(t0=this.Fe32_0(x0))+(t1=this.Fe32_3(x1))+this.gSubKeys[k++])>>>1|x2<<31,x3=(x3<<1|x3>>>31)^t0+2*t1+this.gSubKeys[k++],x0=(x0^=(t0=this.Fe32_0(x2))+(t1=this.Fe32_3(x3))+this.gSubKeys[k++])>>>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}()}).call(this)},{"./algbase":2,"./util":23}],23:[function(require,module,exports){var Buffer=require("__browserify_Buffer");(function(){var default_delay,iced,uint_max;iced=require("iced-runtime"),uint_max=Math.pow(2,32),exports.fixup_uint32=function(x){var x_pos;return x>uint_max||x<0?(x_pos=Math.abs(x)%uint_max,x<0?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;i<n_full_words;)b.writeUInt32LE(0,i),i+=4;for(;i<b.length;)b.writeUInt8(0,i),i++;return!1},exports.copy_buffer=function(b){var i,ret,_i,_ref;for(ret=new Buffer(b.length),i=_i=0,_ref=b.length;0<=_ref?_i<_ref:_i>_ref;i=0<=_ref?++_i:--_i)ret.writeUInt8(b.readUInt8(i),i);return ret},exports.scrub_vec=function(v){var i,_i,_ref;for(i=_i=0,_ref=v.length;0<=_ref?_i<_ref:_i>_ref;i=0<=_ref?++_i:--_i)v[i]=0;return!1},exports.default_delay=default_delay=function(i,n,cb){var ___iced_passed_deferral,__iced_deferrals;___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:"/Users/max/src/keybase/triplesec/src/util.iced"}),setImmediate(__iced_deferrals.defer({lineno:45})),__iced_deferrals._fulfill()}(__iced_k):function(__iced_k){__iced_deferrals=new iced.Deferrals(__iced_k,{parent:___iced_passed_deferral,filename:"/Users/max/src/keybase/triplesec/src/util.iced"}),setTimeout(__iced_deferrals.defer({lineno:47}),1),__iced_deferrals._fulfill()}(__iced_k)}(function(){return cb()})},exports.buffer_cmp_ule=function(b1,b2){var I,J,i,j,x,y;for(i=j=0,I=b1.length,J=b2.length;i<I&&0===b1.readUInt8(i);)i++;for(;j<J&&0===b2.readUInt8(j);)j++;if(I-i>J-j)return 1;if(J-j>I-i)return-1;for(;i<I;){if((x=b1.readUInt8(i))<(y=b2.readUInt8(j)))return-1;if(y<x)return 1;i++,j++}return 0},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_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})(0),function(__iced_k){var _while;(_while=function(__iced_k){var _break,_continue,_next;if(_break=__iced_k,_continue=function(){return iced.trampoline(function(){return _while(__iced_k)})},_next=_continue,!((left=total_words-i)>0))return _break();n_words=Math.min(n,left),update(i,i+n_words),call_ph(i),__iced_deferrals=new iced.Deferrals(function(){return _next(i+=n_words)},{parent:___iced_passed_deferral,filename:"/Users/max/src/keybase/triplesec/src/util.iced",funcname:"bulk"}),delay(i,total_words,__iced_deferrals.defer({lineno:105})),__iced_deferrals._fulfill()})(__iced_k)}(function(){return call_ph(total_words),ret=finalize(),cb(ret)})}}).call(this)},{__browserify_Buffer:31,"iced-runtime":29}],24:[function(require,module,exports){var Buffer=require("__browserify_Buffer");(function(){var WordArray,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;0<=_ref?_i<_ref:_i>_ref;i=0<=_ref?++_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;0<=_ref?_i<_ref:_i>_ref;i=0<=_ref?++_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;0<=thatSigBytes?_i<thatSigBytes:_i>thatSigBytes;i=0<=thatSigBytes?++_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,_i=0,_len=(_ref=this.words).length;_i<_len;_i++)w=_ref[_i],this.sigBytes-p>=4&&(w=util.fixup_uint32(w),out.writeUInt32BE(w,p),p+=4);for(;p<this.sigBytes;)ch=this.words[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(i=_i=0,_len=(_ref=this.words).length;_i<_len;i=++_i)w=_ref[i],this.words[i]=endian_reverse(w);return this},WordArray.prototype.split=function(n){var i,sz;if(this.sigBytes%4!=0||this.words.length%n!=0)throw new Error("bad key alignment");return sz=this.words.length/n,function(){var _i,_ref,_results;for(_results=[],i=_i=0,_ref=this.words.length;sz>0?_i<_ref:_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 last,p,words;for(words=[],p=0;b.length-p>=4;)words.push(b.readUInt32BE(p)),p+=4;if(p<b.length){for(last=0;p<b.length;)last|=b.readUInt8(p)<<24-p%4*8,p++;last=util.fixup_uint32(last),words.push(last)}return new WordArray(words,b.length)},WordArray.from_buffer_le=function(b){var last,p,words;for(words=[],p=0;b.length-p>=4;)words.push(b.readUInt32LE(p)),p+=4;if(p<b.length){for(last=0;p<b.length;)last|=b.readUInt8(p)<<p%4*8,p++;last=util.fixup_uint32(last),words.push(last)}return new WordArray(words,b.length)},WordArray.from_utf8=function(s){return WordArray.from_buffer(new Buffer(s,"utf8"))},WordArray.from_utf8_le=function(s){return WordArray.from_buffer_le(new Buffer(s,"utf8"))},WordArray.from_hex=function(s){return WordArray.from_buffer(new Buffer(s,"hex"))},WordArray.from_hex_le=function(s){return WordArray.from_buffer_le(new Buffer(s,"hex"))},WordArray.from_ui8a=function(v){return WordArray.from_buffer(ui8a_to_buffer(v))},WordArray.from_i32a=function(v){return new WordArray(Array.apply([],v))},WordArray.prototype.equal=function(wa){var i,ret,w,_i,_len,_ref;if(ret=!0,wa.sigBytes!==this.sigBytes)ret=!1;else for(i=_i=0,_len=(_ref=this.words).length;_i<_len;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<dst_offset+n_words)throw new Error("dest range exceeded ("+this.words.length+" < "+(dst_offset+n_words)+")");if(wa2.words.length<src_offset+n_words)throw new Error("source range exceeded");for(i=_i=0;0<=n_words?_i<n_words:_i>n_words;i=0<=n_words?++_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 _i,_len,_ref;for(_i=0,_len=(_ref=this.words).length;_i<_len;_i++)if(0!==_ref[_i])return!1;return!0},WordArray.prototype.scrub=function(){return util.scrub_vec(this.words)},WordArray.prototype.cmp_ule=function(wa2){return util.buffer_cmp_ule(this.to_buffer(),wa2.to_buffer())},WordArray.prototype.slice=function(low,hi){var n,sb;if(n=this.words.length,!(low<hi&&hi<=n))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=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=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=[],_i=0,_len=(_ref=this.words).length;_i<_len;_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(_results=[],_i=0,_len=(_ref=this.words).length;_i<_len;_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)},{"./util":23,__browserify_Buffer:31}],25:[function(require,module,exports){(function(){var BaseError,c_to_camel,ipush,make_error_klass,to_lower,util,__slice=[].slice;util=require("util"),exports.BaseError=BaseError=function(msg,constructor){return Error.captureStackTrace(this,this.constructor),this.message=msg||"Error"},util.inherits(BaseError,Error),BaseError.prototype.name="BaseError",to_lower=function(s){return s[0].toUpperCase()+s.slice(1).toLowerCase()},c_to_camel=function(s){var p;return function(){var _i,_len,_ref,_results;for(_results=[],_i=0,_len=(_ref=s.split(/_/)).length;_i<_len;_i++)p=_ref[_i],_results.push(to_lower(p));return _results}().join("")},make_error_klass=function(k,code,default_msg){var ctor;return ctor=function(msg){return BaseError.call(this,msg||default_msg,this.constructor),this.istack=[],this.code=code,this},util.inherits(ctor,BaseError),ctor.prototype.name=k,ctor.prototype.inspect=function(){return"["+k+": "+this.message+" (code "+this.code+")]"},ctor},exports.make_errors=function(d){var enam,errno,k,msg,out,val;out={msg:{},name:{},code:{}},d.OK="Success",errno=100;for(k in d)msg=d[k],"OK"!==k?(val=errno++,out[enam=c_to_camel(k)+"Error"]=make_error_klass(enam,val,msg)):val=0,out[k]=val,out.msg[k]=out.msg[val]=msg,out.name[k]=out.name[val]=k,out.code[k]=val;return out},ipush=function(e,msg){if(null!=msg)return null==e.istack&&(e.istack=[]),e.istack.push(msg)},exports.make_esc=function(gcb,where){return function(lcb){return function(){var args,err;return err=arguments[0],args=2<=arguments.length?__slice.call(arguments,1):[],null==err?lcb.apply(null,args):gcb.__esc?void 0:(gcb.__esc=!0,ipush(err,where),gcb(err))}}},exports.EscOk=function(){function EscOk(gcb,where){this.gcb=gcb,this.where=where}return EscOk.prototype.bailout=function(){var t;if(this.gcb)return t=this.gcb,this.gcb=null,t(!1)},EscOk.prototype.check_ok=function(cb){return function(_this){return function(){var args,ok;return ok=arguments[0],args=2<=arguments.length?__slice.call(arguments,1):[],ok?cb.apply(null,args):_this.bailout()}}(this)},EscOk.prototype.check_err=function(cb){return function(_this){return function(){var args,err;return err=arguments[0],args=2<=arguments.length?__slice.call(arguments,1):[],null!=err?(ipush(err,_this.where),_this.bailout()):cb.apply(null,args)}}(this)},EscOk.prototype.check_non_null=function(cb){return function(_this){return function(){var args;return null==(args=1<=arguments.length?__slice.call(arguments,0):[])[0]?_this.bailout():cb.apply(null,args)}}(this)},EscOk}(),exports.EscErr=function(){function EscErr(gcb,where){this.gcb=gcb,this.where=where}return EscErr.prototype.finish=function(err){var t;if(this.gcb)return t=this.gcb,this.gcb=null,t(err)},EscErr.prototype.check_ok=function(cb,eclass,emsg){return null==eclass&&(eclass=Error),null==emsg&&(emsg=null),function(){var args,err,ok;return ok=arguments[0],args=2<=arguments.length?__slice.call(arguments,1):[],ok?cb.apply(null,args):(err=new eclass(emsg),ipush(err,this.where),this.finish(err))}},EscErr.prototype.check_err=function(cb){return function(){var args,err;return err=arguments[0],args=2<=arguments.length?__slice.call(arguments,1):[],null!=err?(ipush(err,this.where),this.finish(err)):cb.apply(null,args)}},EscErr}(),exports.Canceler=function(){function Canceler(klass){this.klass=null!=klass?klass:Error,this._canceled=!1}return Canceler.prototype.is_canceled=function(){return this._canceled},Canceler.prototype.is_ok=function(){return!this._canceled},Canceler.prototype.cancel=function(){return this._canceled=!0},Canceler.prototype.err=function(){return this._canceled?new this.klass("Aborted"):null},Canceler}(),exports.chain=function(cb,f){return function(){var args;return args=1<=arguments.length?__slice.call(arguments,0):[],f(function(){return cb.apply(null,args)})}},exports.chain_err=function(cb,f){return function(){var args0;return args0=1<=arguments.length?__slice.call(arguments,0):[],f(function(){var args1;return args1=1<=arguments.length?__slice.call(arguments,0):[],cb.apply(null,null!=args1[0]&&null==args0[0]?args1:args0)})}}}).call(this)},{util:37}],26:[function(require,module,exports){(function(){var Lock,NamedLock,SingleFlighter,iced,__hasProp={}.hasOwnProperty;iced=require("iced-runtime"),exports.Lock=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(){return this._waiters.length?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 function(child,parent){function ctor(){this.constructor=child}for(var key in parent)__hasProp.call(parent,key)&&(child[key]=parent[key]);ctor.prototype=parent.prototype,child.prototype=new ctor,child.__super__=parent.prototype}(NamedLock,Lock),NamedLock.prototype.incref=function(){return++this.refs},NamedLock.prototype.decref=function(){return--this.refs},NamedLock.prototype.release=function(){if(NamedLock.__super__.release.call(this),0===this.decref())return delete this.tab.locks[this.name]},NamedLock}(),exports.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_passed_deferral=iced.findDeferral(arguments),l=this.locks[name]||this.create(name),was_open=l._open,l.incref(),function(__iced_k){if(!wait&&!l._open)return __iced_k(l=null);!function(__iced_k){__iced_deferrals=new iced.Deferrals(__iced_k,{parent:___iced_passed_deferral,filename:"/Users/max/src/iced/iced-lock/index.iced",funcname:"Table.acquire"}),l.acquire(__iced_deferrals.defer({lineno:69})),__iced_deferrals._fulfill()}(__iced_k)}(function(){return cb(l,was_open)})},Table.prototype.lookup=function(name){return this.locks[name]},Table}(),SingleFlighter=function(){function SingleFlighter(_arg){this.table=_arg.table,this.key=_arg.key,this.seqid=null,this.waiter=null,this.open=!0,this.refs=0}return SingleFlighter.prototype._incref=function(){return++this.refs},SingleFlighter.prototype._decref=function(){if(0==--this.refs)return this.table._remove({key:this.key})},SingleFlighter.prototype._enter=function(_arg,cb){var seqid,tmp;return seqid=_arg.seqid,this.open?(this.open=!1,this.seqid=seqid,cb(null,this)):null!=this.waiter?(seqid>this.waiter.seqid?(tmp=this.waiter,this.waiter={cb:cb,seqid:seqid},tmp.cb(new Error("our seqid="+tmp.seqid+" was preempted by "+seqid))):cb(new Error("our seqid="+seqid+" is too stale (since "+this.waiter.seqid+" is ahead of us)")),this._decref()):seqid>this.seqid?this.waiter={seqid:seqid,cb:cb}:(cb(new Error("our seqid="+seqid+" is too stale (since "+this.seqid+" is already in flight)")),this._decref())},SingleFlighter.prototype.release=function(){var cb,_ref;return null!=this.waiter?(_ref=this.waiter,this.seqid=_ref.seqid,cb=_ref.cb,this.waiter=null,cb(null,this)):(this.open=!0,this.seqid=null),this._decref()},SingleFlighter}(),exports.SingleFlightTable=function(){function SingleFlightTable(){this._jobs={}}return SingleFlightTable.prototype._create=function(_arg){var key;return key=_arg.key,this._jobs[key]=new SingleFlighter({table:this,key:key})},SingleFlightTable.prototype._remove=function(_arg){var key;return key=_arg.key,delete this._jobs[key]},SingleFlightTable.prototype.enter=function(_arg,cb){var key,s,seqid;return seqid=_arg.seqid,key=_arg.key,(s=this._jobs[key]||this._create({key:key}))._incref(),s._enter({seqid:seqid},cb)},SingleFlightTable}()}).call(this)},{"iced-runtime":29}],27:[function(require,module,exports){(function(){module.exports={k:"__iced_k",k_noop:"__iced_k_noop",param:"__iced_p_",ns:"iced",runtime:"runtime",Deferrals:"Deferrals",deferrals:"__iced_deferrals",fulfill:"_fulfill",b_while:"_break",t_while:"_while",c_while:"_continue",n_while:"_next",n_arg:"__iced_next_arg",defer_method:"defer",slot:"__slot",assign_fn:"assign_fn",autocb:"autocb",retslot:"ret",trace:"__iced_trace",passed_deferral:"__iced_passed_deferral",findDeferral:"findDeferral",lineno:"lineno",parent:"parent",filename:"filename",funcname:"funcname",catchExceptions:"catchExceptions",runtime_modes:["node","inline","window","none","browserify","interp"],trampoline:"trampoline",context:"context",defer_arg:"__iced_defer_"}}).call(this)},{}],28:[function(require,module,exports){(function(){var C,iced,_iand,_ior,_timeout,__slice=[].slice;C=require("./const"),exports.iced=iced=require("./runtime"),_timeout=function(cb,t,res,tmp){var arr,rv,which,___iced_passed_deferral,__iced_deferrals;___iced_passed_deferral=iced.findDeferral(arguments),rv=new iced.Rendezvous,tmp[0]=rv.id(!0).defer({assign_fn:function(){return arr=__slice.call(arguments,0)},lineno:20,context:__iced_deferrals}),setTimeout(rv.id(!1).defer({lineno:21,context:__iced_deferrals}),t),function(__iced_k){__iced_deferrals=new iced.Deferrals(__iced_k,{parent:___iced_passed_deferral,filename:"/Users/max/src/iced/iced-runtime/src/library.iced"}),rv.wait(__iced_deferrals.defer({assign_fn:function(){return which=arguments[0]},lineno:22})),__iced_deferrals._fulfill()}(function(){return res&&(res[0]=which),cb.apply(null,arr)})},exports.timeout=function(cb,t,res){var tmp;return tmp=[],_timeout(cb,t,res,tmp),tmp[0]},_iand=function(cb,res,tmp){var ok,___iced_passed_deferral,__iced_deferrals;___iced_passed_deferral=iced.findDeferral(arguments),function(__iced_k){__iced_deferrals=new iced.Deferrals(__iced_k,{parent:___iced_passed_deferral,filename:"/Users/max/src/iced/iced-runtime/src/library.iced"}),tmp[0]=__iced_deferrals.defer({assign_fn:function(){return ok=arguments[0]},lineno:39}),__iced_deferrals._fulfill()}(function(){return ok||(res[0]=!1),cb()})},exports.iand=function(cb,res){var tmp;return tmp=[],_iand(cb,res,tmp),tmp[0]},_ior=function(cb,res,tmp){var ok,___iced_passed_deferral,__iced_deferrals;___iced_passed_deferral=iced.findDeferral(arguments),function(__iced_k){__iced_deferrals=new iced.Deferrals(__iced_k,{parent:___iced_passed_deferral,filename:"/Users/max/src/iced/iced-runtime/src/library.iced"}),tmp[0]=__iced_deferrals.defer({assign_fn:function(){return ok=arguments[0]},lineno:58}),__iced_deferrals._fulfill()}(function(){return ok&&(res[0]=!0),cb()})},exports.ior=function(cb,res){var tmp;return tmp=[],_ior(cb,res,tmp),tmp[0]},exports.Pipeliner=function(){function Pipeliner(window,delay){this.window=window||1,this.delay=delay||0,this.queue=[],this.n_out=0,this.cb=null,this[C.deferrals]=this,this.defer=this._defer}return Pipeliner.prototype.waitInQueue=function(cb){var ___iced_passed_deferral,__iced_deferrals;___iced_passed_deferral=iced.findDeferral(arguments),function(_this){return function(__iced_k){var _while;(_while=function(__iced_k){var _break,_continue,_next;if(_break=__iced_k,_continue=function(){return iced.trampoline(function(){return _while(__iced_k)})},_next=_continue,!(_this.n_out>=_this.window))return _break();!function(__iced_k){__iced_deferrals=new iced.Deferrals(__iced_k,{parent:___iced_passed_deferral,filename:"/Users/max/src/iced/iced-runtime/src/library.iced",funcname:"Pipeliner.waitInQueue"}),_this.cb=__iced_deferrals.defer({lineno:100}),__iced_deferrals._fulfill()}(_next)})(__iced_k)}}(this)(function(_this){return function(){_this.n_out++,function(__iced_k){if(!_this.delay)return __iced_k();!function(__iced_k){__iced_deferrals=new iced.Deferrals(__iced_k,{parent:___iced_passed_deferral,filename:"/Users/max/src/iced/iced-runtime/src/library.iced",funcname:"Pipeliner.waitInQueue"}),setTimeout(__iced_deferrals.defer({lineno:108}),_this.delay),__iced_deferrals._fulfill()}(__iced_k)}(function(){return cb()})}}(this))},Pipeliner.prototype.__defer=function(out,deferArgs){var tmp,voidCb,___iced_passed_deferral,__iced_deferrals;___iced_passed_deferral=iced.findDeferral(arguments),function(__iced_k){__iced_deferrals=new iced.Deferrals(__iced_k,{parent:___iced_passed_deferral,filename:"/Users/max/src/iced/iced-runtime/src/library.iced",funcname:"Pipeliner.__defer"}),voidCb=__iced_deferrals.defer({lineno:122}),out[0]=function(){var args,_ref;return args=1<=arguments.length?__slice.call(arguments,0):[],null!=(_ref=deferArgs.assign_fn)&&_ref.apply(null,args),voidCb()},__iced_deferrals._fulfill()}(function(_this){return function(){if(_this.n_out--,_this.cb)return tmp=_this.cb,_this.cb=null,tmp()}}(this))},Pipeliner.prototype._defer=function(deferArgs){var tmp;return tmp=[],this.__defer(tmp,deferArgs),tmp[0]},Pipeliner.prototype.flush=function(autocb){var ___iced_passed_deferral,__iced_k,_while;__iced_k=autocb,___iced_passed_deferral=iced.findDeferral(arguments),(_while=function(_this){var __iced_deferrals;return function(__iced_k){var _break,_continue,_next;if(_break=__iced_k,_continue=function(){return iced.trampoline(function(){return _while(__iced_k)})},_next=_continue,!_this.n_out)return _break();!function(__iced_k){__iced_deferrals=new iced.Deferrals(__iced_k,{parent:___iced_passed_deferral,filename:"/Users/max/src/iced/iced-runtime/src/library.iced",funcname:"Pipeliner.flush"}),_this.cb=__iced_deferrals.defer({lineno:151}),__iced_deferrals._fulfill()}(_next)}}(this))(__iced_k)},Pipeliner}()}).call(this)},{"./const":27,"./runtime":30}],29:[function(require,module,exports){(function(){var k,mod,mods,v,_i,_len;for(exports.const=require("./const"),_i=0,_len=(mods=[require("./runtime"),require("./library")]).length;_i<_len;_i++){mod=mods[_i];for(k in mod)v=mod[k],exports[k]=v}}).call(this)},{"./const":27,"./library":28,"./runtime":30}],30:[function(require,module,exports){var process=require("__browserify_process");(function(){var C,exceptionHandler,make_defer_return,stackWalk,tick_counter,trampoline,warn,__active_trace,__c,_trace_to_string,__slice=[].slice;C=require("./const"),make_defer_return=function(obj,defer_args,id,trace_template,multi){var k,ret,trace,v;trace={};for(k in trace_template)v=trace_template[k],trace[k]=v;return trace[C.lineno]=null!=defer_args?defer_args[C.lineno]:void 0,ret=function(){var inner_args,o,_ref;return inner_args=1<=arguments.length?__slice.call(arguments,0):[],null!=defer_args&&null!=(_ref=defer_args.assign_fn)&&_ref.apply(null,inner_args),obj?(o=obj,multi||(obj=null),o._fulfill(id,trace)):warn("overused deferral at "+_trace_to_string(trace))},ret[C.trace]=trace,ret},__c=0,tick_counter=function(mod){return++__c%mod==0&&(__c=0,!0)},__active_trace=null,_trace_to_string=function(tr){return(tr[C.funcname]||"<anonymous>")+" ("+tr[C.filename]+":"+(tr[C.lineno]+1)+")"},warn=function(m){return"undefined"!=typeof console&&null!==console?console.error("ICED warning: "+m):void 0},exports.trampoline=trampoline=function(fn){return tick_counter(500)?null!=(void 0!==process&&null!==process?process.nextTick:void 0)?process.nextTick(fn):setTimeout(fn):fn()},exports.Deferrals=function(){function Deferrals(k,trace){this.trace=trace,this.continuation=k,this.count=1,this.ret=null}return Deferrals.prototype._call=function(trace){var c;return this.continuation?(__active_trace=trace,c=this.continuation,this.continuation=null,c(this.ret)):warn("Entered dead await at "+_trace_to_string(trace))},Deferrals.prototype._fulfill=function(id,trace){if(!(--this.count>0))return trampoline(function(_this){return function(){return _this._call(trace)}}(this))},Deferrals.prototype.defer=function(args){return this.count++,this,make_defer_return(this,args,null,this.trace)},Deferrals}(),exports.findDeferral=function(args){var a,_i,_len;for(_i=0,_len=args.length;_i<_len;_i++)if(null!=(a=args[_i])?a[C.trace]:void 0)return a;return null},exports.Rendezvous=function(){function Rendezvous(){this.completed=[],this.waiters=[],this.defer_id=0}var RvId;return RvId=function(){function RvId(rv,id,multi){this.rv=rv,this.id=id,this.multi=multi}return RvId.prototype.defer=function(defer_args){return this.rv._defer_with_id(this.id,defer_args,this.multi)},RvId}(),Rendezvous.prototype.wait=function(cb){var x;return this.completed.length?(x=this.completed.shift(),cb(x)):this.waiters.push(cb)},Rendezvous.prototype.defer=function(defer_args){var id;return id=this.defer_id++,this._defer_with_id(id,defer_args)},Rendezvous.prototype.id=function(i,multi){return multi=!!multi,new RvId(this,i,multi)},Rendezvous.prototype._fulfill=function(id,trace){return this.waiters.length?this.waiters.shift()(id):this.completed.push(id)},Rendezvous.prototype._defer_with_id=function(id,defer_args,multi){return this.count++,make_defer_return(this,defer_args,id,{},multi)},Rendezvous}(),exports.stackWalk=stackWalk=function(cb){var line,ret,tr,_ref;for(ret=[],tr=cb?cb[C.trace]:__active_trace;tr;)line=" at "+_trace_to_string(tr),ret.push(line),tr=null!=tr&&null!=(_ref=tr[C.parent])?_ref[C.trace]:void 0;return ret},exports.exceptionHandler=exceptionHandler=function(err,logger){var stack;if(logger||(logger=console.error),logger(err.stack),(stack=stackWalk()).length)return logger("Iced 'stack' trace (w/ real line numbers):"),logger(stack.join("\n"))},exports.catchExceptions=function(logger){return void 0!==process&&null!==process?process.on("uncaughtException",function(err){return exceptionHandler(err,logger),process.exit(1)}):void 0}}).call(this)},{"./const":27,__browserify_process:34}],31:[function(require,module,exports){require=function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a="function"==typeof require&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n||e)},f,f.exports,e,t,n,r)}return n[o].exports}for(var i="function"==typeof require&&require,o=0;o<r.length;o++)s(r[o]);return s}({PcZj9L:[function(require,module,exports){function Buffer(subject,encoding){var type=typeof subject;if("base64"===encoding&&"string"===type)for(subject=function(str){return str.trim?str.trim():str.replace(/^\s+|\s+$/g,"")}(subject);subject.length%4!=0;)subject+="=";var length;if("number"===type)length=coerce(subject);else if("string"===type)length=Buffer.byteLength(subject,encoding);else{if("object"!==type)throw new Error("First argument needs to be a number, array or string.");length=coerce(subject.length)}var buf=augment(new xUint8Array(length));if(Buffer.isBuffer(subject))buf.set(subject);else if(function(subject){return Array.isArray(subject)||Buffer.isBuffer(subject)||subject&&"object"==typeof subject&&"number"==typeof subject.length}(subject))for(var i=0;i<length;i++)Buffer.isBuffer(subject)?buf[i]=subject.readUInt8(i):buf[i]=subject[i];else"string"===type&&buf.write(subject,0,encoding);return buf}function _asciiWrite(buf,string,offset,length){return Buffer._charsWritten=blitBuffer(function(str){for(var byteArray=[],i=0;i<str.length;i++)byteArray.push(255&str.charCodeAt(i));return byteArray}(string),buf,offset,length)}function BufferWrite(string,offset,length,encoding){if(isFinite(offset))isFinite(length)||(encoding=length,length=void 0);else{var swap=encoding;encoding=offset,offset=length,length=swap}offset=Number(offset)||0;var remaining=this.length-offset;switch(length?(length=Number(length))>remaining&&(length=remaining):length=remaining,encoding=String(encoding||"utf8").toLowerCase()){case"hex":return function(buf,string,offset,length){offset=Number(offset)||0;var remaining=buf.length-offset;length?(length=Number(length))>remaining&&(length=remaining):length=remaining;var strLen=string.length;if(strLen%2!=0)throw new Error("Invalid hex string");length>strLen/2&&(length=strLen/2);for(var i=0;i<length;i++){var byte=parseInt(string.substr(2*i,2),16);if(isNaN(byte))throw new Error("Invalid hex string");buf[offset+i]=byte}return Buffer._charsWritten=2*i,i}(this,string,offset,length);case"utf8":case"utf-8":return function(buf,string,offset,length){return Buffer._charsWritten=blitBuffer(utf8ToBytes(string),buf,offset,length)}(this,string,offset,length);case"ascii":return _asciiWrite(this,string,offset,length);case"binary":return function(buf,string,offset,length){return _asciiWrite(buf,string,offset,length)}(this,string,offset,length);case"base64":return function(buf,string,offset,length){return Buffer._charsWritten=blitBuffer(base64ToBytes(string),buf,offset,length)}(this,string,offset,length);default:throw new Error("Unknown encoding")}}function BufferToString(encoding,start,end){var self=this instanceof ProxyBuffer?this._proxy:this;if(encoding=String(encoding||"utf8").toLowerCase(),start=Number(start)||0,(end=void 0!==end?Number(end):end=self.length)===start)return"";switch(encoding){case"hex":return function(buf,start,end){var len=buf.length;(!start||start<0)&&(start=0);(!end||end<0||end>len)&&(end=len);for(var out="",i=start;i<end;i++)out+=toHex(buf[i]);return out}(self,start,end);case"utf8":case"utf-8":return function(buf,start,end){var bytes=buf.slice(start,end),res="",tmp="",i=0;for(;i<bytes.length;)bytes[i]<=127?(res+=decodeUtf8Char(tmp)+String.fromCharCode(bytes[i]),tmp=""):tmp+="%"+bytes[i].toString(16),i++;return res+decodeUtf8Char(tmp)}(self,start,end);case"ascii":return _asciiSlice(self,start,end);case"binary":return function(buf,start,end){return _asciiSlice(buf,start,end)}(self,start,end);case"base64":return function(buf,start,end){var bytes=buf.slice(start,end);return require("base64-js").fromByteArray(bytes)}(self,start,end);default:throw new Error("Unknown encoding")}}function BufferToJSON(){return{type:"Buffer",data:Array.prototype.slice.call(this,0)}}function BufferCopy(target,target_start,start,end){if(start||(start=0),end||0===end||(end=this.length),target_start||(target_start=0),end!==start&&0!==target.length&&0!==this.length){if(end<start)throw new Error("sourceEnd < sourceStart");if(target_start<0||target_start>=target.length)throw new Error("targetStart out of bounds");if(start<0||start>=this.length)throw new Error("sourceStart out of bounds");if(end<0||end>this.length)throw new Error("sourceEnd out of bounds");end>this.length&&(end=this.length),target.length-target_start<end-start&&(end=target.length-target_start+start);for(var i=0;i<end-start;i++)target[i+target_start]=this[i+start]}}function _asciiSlice(buf,start,end){for(var bytes=buf.slice(start,end),ret="",i=0;i<bytes.length;i++)ret+=String.fromCharCode(bytes[i]);return ret}function BufferSlice(start,end){var len=this.length;return start=clamp(start,len,0),end=clamp(end,len,len),augment(this.subarray(start,end))}function BufferReadUInt8(offset,noAssert){if(noAssert||(assert(void 0!==offset&&null!==offset,"missing offset"),assert(offset<this.length,"Trying to read beyond buffer length")),!(offset>=this.length))return this[offset]}function _readUInt16(buf,offset,littleEndian,noAssert){noAssert||(assert("boolean"==typeof littleEndian,"missing or invalid endian"),assert(void 0!==offset&&null!==offset,"missing offset"),assert(offset+1<buf.length,"Trying to read beyond buffer length"));var len=buf.length;if(!(offset>=len)){if(offset+1===len){var dv=new xDataView(new xArrayBuffer(2));return dv.setUint8(0,buf[len-1]),dv.getUint16(0,littleEndian)}return buf._dataview.getUint16(offset,littleEndian)}}function BufferReadUInt16LE(offset,noAssert){return _readUInt16(this,offset,!0,noAssert)}function BufferReadUInt16BE(offset,noAssert){return _readUInt16(this,offset,!1,noAssert)}function _readUInt32(buf,offset,littleEndian,noAssert){noAssert||(assert("boolean"==typeof littleEndian,"missing or invalid endian"),assert(void 0!==offset&&null!==offset,"missing offset"),assert(offset+3<buf.length,"Trying to read beyond buffer length"));var len=buf.length;if(!(offset>=len)){if(offset+3>=len){for(var dv=new xDataView(new xArrayBuffer(4)),i=0;i+offset<len;i++)dv.setUint8(i,buf[i+offset]);return dv.getUint32(0,littleEndian)}return buf._dataview.getUint32(offset,littleEndian)}}function BufferReadUInt32LE(offset,noAssert){return _readUInt32(this,offset,!0,noAssert)}function BufferReadUInt32BE(offset,noAssert){return _readUInt32(this,offset,!1,noAssert)}function BufferReadInt8(offset,noAssert){if(noAssert||(assert(void 0!==offset&&null!==offset,"missing offset"),assert(offset<this.length,"Trying to read beyond buffer length")),!(offset>=this.length))return this._dataview.getInt8(offset)}function _readInt16(buf,offset,littleEndian,noAssert){noAssert||(assert("boolean"==typeof littleEndian,"missing or invalid endian"),assert(void 0!==offset&&null!==offset,"missing offset"),assert(offset+1<buf.length,"Trying to read beyond buffer length"));var len=buf.length;if(!(offset>=len)){if(offset+1===len){var dv=new xDataView(new xArrayBuffer(2));return dv.setUint8(0,buf[len-1]),dv.getInt16(0,littleEndian)}return buf._dataview.getInt16(offset,littleEndian)}}function BufferReadInt16LE(offset,noAssert){return _readInt16(this,offset,!0,noAssert)}function BufferReadInt16BE(offset,noAssert){return _readInt16(this,offset,!1,noAssert)}function _readInt32(buf,offset,littleEndian,noAssert){noAssert||(assert("boolean"==typeof littleEndian,"missing or invalid endian"),assert(void 0!==offset&&null!==offset,"missing offset"),assert(offset+3<buf.length,"Trying to read beyond buffer length"));var len=buf.length;if(!(offset>=len)){if(offset+3>=len){for(var dv=new xDataView(new xArrayBuffer(4)),i=0;i+offset<len;i++)dv.setUint8(i,buf[i+offset]);return dv.getInt32(0,littleEndian)}return buf._dataview.getInt32(offset,littleEndian)}}function BufferReadInt32LE(offset,noAssert){return _readInt32(this,offset,!0,noAssert)}function BufferReadInt32BE(offset,noAssert){return _readInt32(this,offset,!1,noAssert)}function _readFloat(buf,offset,littleEndian,noAssert){return noAssert||(assert("boolean"==typeof littleEndian,"missing or invalid endian"),assert(offset+3<buf.length,"Trying to read beyond buffer length")),buf._dataview.getFloat32(offset,littleEndian)}function BufferReadFloatLE(offset,noAssert){return _readFloat(this,offset,!0,noAssert)}function BufferReadFloatBE(offset,noAssert){return _readFloat(this,offset,!1,noAssert)}function _readDouble(buf,offset,littleEndian,noAssert){return noAssert||(assert("boolean"==typeof littleEndian,"missing or invalid endian"),assert(offset+7<buf.length,"Trying to read beyond buffer length")),buf._dataview.getFloat64(offset,littleEndian)}function BufferReadDoubleLE(offset,noAssert){return _readDouble(this,offset,!0,noAssert)}function BufferReadDoubleBE(offset,noAssert){return _readDouble(this,offset,!1,noAssert)}function BufferWriteUInt8(value,offset,noAssert){noAssert||(assert(void 0!==value&&null!==value,"missing value"),assert(void 0!==offset&&null!==offset,"missing offset"),assert(offset<this.length,"trying to write beyond buffer length"),verifuint(value,255)),offset>=this.length||(this[offset]=value)}function _writeUInt16(buf,value,offset,littleEndian,noAssert){noAssert||(assert(void 0!==value&&null!==value,"missing value"),assert("boolean"==typeof littleEndian,"missing or invalid endian"),assert(void 0!==offset&&null!==offset,"missing offset"),assert(offset+1<buf.length,"trying to write beyond buffer length"),verifuint(value,65535));var len=buf.length;if(!(offset>=len))if(offset+1===len){var dv=new xDataView(new xArrayBuffer(2));dv.setUint16(0,value,littleEndian),buf[offset]=dv.getUint8(0)}else buf._dataview.setUint16(offset,value,littleEndian)}function BufferWriteUInt16LE(value,offset,noAssert){_writeUInt16(this,value,offset,!0,noAssert)}function BufferWriteUInt16BE(value,offset,noAssert){_writeUInt16(this,value,offset,!1,noAssert)}function _writeUInt32(buf,value,offset,littleEndian,noAssert){noAssert||(assert(void 0!==value&&null!==value,"missing value"),assert("boolean"==typeof littleEndian,"missing or invalid endian"),assert(void 0!==offset&&null!==offset,"missing offset"),assert(offset+3<buf.length,"trying to write beyond buffer length"),verifuint(value,4294967295));var len=buf.length;if(!(offset>=len))if(offset+3>=len){var dv=new xDataView(new xArrayBuffer(4));dv.setUint32(0,value,littleEndian);for(var i=0;i+offset<len;i++)buf[i+offset]=dv.getUint8(i)}else buf._dataview.setUint32(offset,value,littleEndian)}function BufferWriteUInt32LE(value,offset,noAssert){_writeUInt32(this,value,offset,!0,noAssert)}function BufferWriteUInt32BE(value,offset,noAssert){_writeUInt32(this,value,offset,!1,noAssert)}function BufferWriteInt8(value,offset,noAssert){noAssert||(assert(void 0!==value&&null!==value,"missing value"),assert(void 0!==offset&&null!==offset,"missing offset"),assert(offset<this.length,"Trying to write beyond buffer length"),verifsint(value,127,-128)),offset>=this.length||this._dataview.setInt8(offset,value)}function _writeInt16(buf,value,offset,littleEndian,noAssert){noAssert||(assert(void 0!==value&&null!==value,"missing value"),assert("boolean"==typeof littleEndian,"missing or invalid endian"),assert(void 0!==offset&&null!==offset,"missing offset"),assert(offset+1<buf.length,"Trying to write beyond buffer length"),verifsint(value,32767,-32768));var len=buf.length;if(!(offset>=len))if(offset+1===len){var dv=new xDataView(new xArrayBuffer(2));dv.setInt16(0,value,littleEndian),buf[offset]=dv.getUint8(0)}else buf._dataview.setInt16(offset,value,littleEndian)}function BufferWriteInt16LE(value,offset,noAssert){_writeInt16(this,value,offset,!0,noAssert)}function BufferWriteInt16BE(value,offset,noAssert){_writeInt16(this,value,offset,!1,noAssert)}function _writeInt32(buf,value,offset,littleEndian,noAssert){noAssert||(assert(void 0!==value&&null!==value,"missing value"),assert("boolean"==typeof littleEndian,"missing or invalid endian"),assert(void 0!==offset&&null!==offset,"missing offset"),assert(offset+3<buf.length,"Trying to write beyond buffer length"),verifsint(value,2147483647,-2147483648));var len=buf.length;if(!(offset>=len))if(offset+3>=len){var dv=new xDataView(new xArrayBuffer(4));dv.setInt32(0,value,littleEndian);for(var i=0;i+offset<len;i++)buf[i+offset]=dv.getUint8(i)}else buf._dataview.setInt32(offset,value,littleEndian)}function BufferWriteInt32LE(value,offset,noAssert){_writeInt32(this,value,offset,!0,noAssert)}function BufferWriteInt32BE(value,offset,noAssert){_writeInt32(this,value,offset,!1,noAssert)}function _writeFloat(buf,value,offset,littleEndian,noAssert){noAssert||(assert(void 0!==value&&null!==value,"missing value"),assert("boolean"==typeof littleEndian,"missing or invalid endian"),assert(void 0!==offset&&null!==offset,"missing offset"),assert(offset+3<buf.length,"Trying to write beyond buffer length"),verifIEEE754(value,3.4028234663852886e38,-3.4028234663852886e38));var len=buf.length;if(!(offset>=len))if(offset+3>=len){var dv=new xDataView(new xArrayBuffer(4));dv.setFloat32(0,value,littleEndian);for(var i=0;i+offset<len;i++)buf[i+offset]=dv.getUint8(i)}else buf._dataview.setFloat32(offset,value,littleEndian)}function BufferWriteFloatLE(value,offset,noAssert){_writeFloat(this,value,offset,!0,noAssert)}function BufferWriteFloatBE(value,offset,noAssert){_writeFloat(this,value,offset,!1,noAssert)}function _writeDouble(buf,value,offset,littleEndian,noAssert){noAssert||(assert(void 0!==value&&null!==value,"missing value"),assert("boolean"==typeof littleEndian,"missing or invalid endian"),assert(void 0!==offset&&null!==offset,"missing offset"),assert(offset+7<buf.length,"Trying to write beyond buffer length"),verifIEEE754(value,1.7976931348623157e308,-1.7976931348623157e308));var len=buf.length;if(!(offset>=len))if(offset+7>=len){var dv=new xDataView(new xArrayBuffer(8));dv.setFloat64(0,value,littleEndian);for(var i=0;i+offset<len;i++)buf[i+offset]=dv.getUint8(i)}else buf._dataview.setFloat64(offset,value,littleEndian)}function BufferWriteDoubleLE(value,offset,noAssert){_writeDouble(this,value,offset,!0,noAssert)}function BufferWriteDoubleBE(value,offset,noAssert){_writeDouble(this,value,offset,!1,noAssert)}function BufferFill(value,start,end){if(value||(value=0),start||(start=0),end||(end=this.length),"string"==typeof value&&(value=value.charCodeAt(0)),"number"!=typeof value||isNaN(value))throw new Error("value is not a number");if(end<start)throw new Error("end < start");if(end!==start&&0!==this.length){if(start<0||start>=this.length)throw new Error("start out of bounds");if(end<0||end>this.length)throw new Error("end out of bounds");for(var i=start;i<end;i++)this[i]=value}}function BufferInspect(){for(var out=[],len=this.length,i=0;i<len;i++)if(out[i]=toHex(this[i]),i===exports.INSPECT_MAX_BYTES){out[i+1]="...";break}return"<Buffer "+out.join(" ")+">"}function BufferToArrayBuffer(){return new Buffer(this).buffer}function ProxyBuffer(arr){this._arr=arr,0!==arr.byteLength&&(this._dataview=new xDataView(arr.buffer,arr.byteOffset,arr.byteLength))}function augment(arr){if(void 0===browserSupport&&(browserSupport=function(){var arr=new xUint8Array(0);arr.foo=function(){return 42};try{return 42===arr.foo()}catch(e){return!1}}()),browserSupport)return arr.write=BufferWrite,arr.toString=BufferToString,arr.toLocaleString=BufferToString,arr.toJSON=BufferToJSON,arr.copy=BufferCopy,arr.slice=BufferSlice,arr.readUInt8=BufferReadUInt8,arr.readUInt16LE=BufferReadUInt16LE,arr.readUInt16BE=BufferReadUInt16BE,arr.readUInt32LE=BufferReadUInt32LE,arr.readUInt32BE=BufferReadUInt32BE,arr.readInt8=BufferReadInt8,arr.readInt16LE=BufferReadInt16LE,arr.readInt16BE=BufferReadInt16BE,arr.readInt32LE=BufferReadInt32LE,arr.readInt32BE=BufferReadInt32BE,arr.readFloatLE=BufferReadFloatLE,arr.readFloatBE=BufferReadFloatBE,arr.readDoubleLE=BufferReadDoubleLE,arr.readDoubleBE=BufferReadDoubleBE,arr.writeUInt8=BufferWriteUInt8,arr.writeUInt16LE=BufferWriteUInt16LE,arr.writeUInt16BE=BufferWriteUInt16BE,arr.writeUInt32LE=BufferWriteUInt32LE,arr.writeUInt32BE=BufferWriteUInt32BE,arr.writeInt8=BufferWriteInt8,arr.writeInt16LE=BufferWriteInt16LE,arr.writeInt16BE=BufferWriteInt16BE,arr.writeInt32LE=BufferWriteInt32LE,arr.writeInt32BE=BufferWriteInt32BE,arr.writeFloatLE=BufferWriteFloatLE,arr.writeFloatBE=BufferWriteFloatBE,arr.writeDoubleLE=BufferWriteDoubleLE,arr.writeDoubleBE=BufferWriteDoubleBE,arr.fill=BufferFill,arr.inspect=BufferInspect,arr.toArrayBuffer=BufferToArrayBuffer,arr._isBuffer=!0,0!==arr.byteLength&&(arr._dataview=new xDataView(arr.buffer,arr.byteOffset,arr.byteLength)),arr;var proxyBuffer=new ProxyBuffer(arr),proxy=new Proxy(proxyBuffer,ProxyHandler);return proxyBuffer._proxy=proxy,proxy}function clamp(index,len,defaultValue){return"number"!=typeof index?defaultValue:(index=~~index)>=len?len:index>=0?index:(index+=len)>=0?index:0}function coerce(length){return(length=~~Math.ceil(+length))<0?0:length}function toHex(n){return n<16?"0"+n.toString(16):n.toString(16)}function utf8ToBytes(str){for(var byteArray=[],i=0;i<str.length;i++)if(str.charCodeAt(i)<=127)byteArray.push(str.charCodeAt(i));else for(var h=encodeURIComponent(str.charAt(i)).substr(1).split("%"),j=0;j<h.length;j++)byteArray.push(parseInt(h[j],16));return byteArray}function base64ToBytes(str){return require("base64-js").toByteArray(str)}function blitBuffer(src,dst,offset,length){for(var i=0;i<length&&!(i+offset>=dst.length||i>=src.length);)dst[i+offset]=src[i],i++;return i}function decodeUtf8Char(str){try{return decodeURIComponent(str)}catch(err){return String.fromCharCode(65533)}}function verifuint(value,max){assert("number"==typeof value,"cannot write a non-number as a number"),assert(value>=0,"specified a negative value for writing an unsigned value"),assert(value<=max,"value is larger than maximum value for type"),assert(Math.floor(value)===value,"value has a fractional component")}function verifsint(value,max,min){assert("number"==typeof value,"cannot write a non-number as a number"),assert(value<=max,"value larger than maximum allowed value"),assert(value>=min,"value smaller than minimum allowed value"),assert(Math.floor(value)===value,"value has a fractional component")}function verifIEEE754(value,max,min){assert("number"==typeof value,"cannot write a non-number as a number"),assert(value<=max,"value larger than maximum allowed value"),assert(value>=min,"value smaller than minimum allowed value")}function assert(test,message){if(!test)throw new Error(message||"Failed assertion")}var TA=require("typedarray"),xDataView="undefined"==typeof DataView?TA.DataView:DataView,xArrayBuffer="undefined"==typeof ArrayBuffer?TA.ArrayBuffer:ArrayBuffer,xUint8Array="undefined"==typeof Uint8Array?TA.Uint8Array:Uint8Array;exports.Buffer=Buffer,exports.SlowBuffer=Buffer,exports.INSPECT_MAX_BYTES=50,Buffer.poolSize=8192;var browserSupport;Buffer.isEncoding=function(encoding){switch((encoding+"").toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}},Buffer.isBuffer=function(b){return b&&b._isBuffer},Buffer.byteLength=function(str,encoding){switch(encoding||"utf8"){case"hex":return str.length/2;case"utf8":case"utf-8":return utf8ToBytes(str).length;case"ascii":case"binary":return str.length;case"base64":return base64ToBytes(str).length;default:throw new Error("Unknown encoding")}},Buffer.concat=function(list,totalLength){if(!Array.isArray(list))throw new Error("Usage: Buffer.concat(list, [totalLength])\nlist should be an Array.");var i,buf;if(0===list.length)return new Buffer(0);if(1===list.length)return list[0];if("number"!=typeof totalLength)for(totalLength=0,i=0;i<list.length;i++)totalLength+=(buf=list[i]).length;var buffer=new Buffer(totalLength),pos=0;for(i=0;i<list.length;i++)(buf=list[i]).copy(buffer,pos),pos+=buf.length;return buffer},ProxyBuffer.prototype.write=BufferWrite,ProxyBuffer.prototype.toString=BufferToString,ProxyBuffer.prototype.toLocaleString=BufferToString,ProxyBuffer.prototype.toJSON=BufferToJSON,ProxyBuffer.prototype.copy=BufferCopy,ProxyBuffer.prototype.slice=BufferSlice,ProxyBuffer.prototype.readUInt8=BufferReadUInt8,ProxyBuffer.prototype.readUInt16LE=BufferReadUInt16LE,ProxyBuffer.prototype.readUInt16BE=BufferReadUInt16BE,ProxyBuffer.prototype.readUInt32LE=BufferReadUInt32LE,ProxyBuffer.prototype.readUInt32BE=BufferReadUInt32BE,ProxyBuffer.prototype.readInt8=BufferReadInt8,ProxyBuffer.prototype.readInt16LE=BufferReadInt16LE,ProxyBuffer.prototype.readInt16BE=BufferReadInt16BE,ProxyBuffer.prototype.readInt32LE=BufferReadInt32LE,ProxyBuffer.prototype.readInt32BE=BufferReadInt32BE,ProxyBuffer.prototype.readFloatLE=BufferReadFloatLE,ProxyBuffer.prototype.readFloatBE=BufferReadFloatBE,ProxyBuffer.prototype.readDoubleLE=BufferReadDoubleLE,ProxyBuffer.prototype.readDoubleBE=BufferReadDoubleBE,ProxyBuffer.prototype.writeUInt8=BufferWriteUInt8,ProxyBuffer.prototype.writeUInt16LE=BufferWriteUInt16LE,ProxyBuffer.prototype.writeUInt16BE=BufferWriteUInt16BE,ProxyBuffer.prototype.writeUInt32LE=BufferWriteUInt32LE,ProxyBuffer.prototype.writeUInt32BE=BufferWriteUInt32BE,ProxyBuffer.prototype.writeInt8=BufferWriteInt8,ProxyBuffer.prototype.writeInt16LE=BufferWriteInt16LE,ProxyBuffer.prototype.writeInt16BE=BufferWriteInt16BE,ProxyBuffer.prototype.writeInt32LE=BufferWriteInt32LE,ProxyBuffer.prototype.writeInt32BE=BufferWriteInt32BE,ProxyBuffer.prototype.writeFloatLE=BufferWriteFloatLE,ProxyBuffer.prototype.writeFloatBE=BufferWriteFloatBE,ProxyBuffer.prototype.writeDoubleLE=BufferWriteDoubleLE,ProxyBuffer.prototype.writeDoubleBE=BufferWriteDoubleBE,ProxyBuffer.prototype.fill=BufferFill,ProxyBuffer.prototype.inspect=BufferInspect,ProxyBuffer.prototype.toArrayBuffer=BufferToArrayBuffer,ProxyBuffer.prototype._isBuffer=!0,ProxyBuffer.prototype.subarray=function(){return this._arr.subarray.apply(this._arr,arguments)},ProxyBuffer.prototype.set=function(){return this._arr.set.apply(this._arr,arguments)};var ProxyHandler={get:function(target,name){return name in target?target[name]:target._arr[name]},set:function(target,name,value){target._arr[name]=value}}},{"base64-js":3,typedarray:4}],"native-buffer-browserify":[function(require,module,exports){module.exports=require("PcZj9L")},{}],3:[function(require,module,exports){!function(exports){"use strict";var lookup="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";module.exports.toByteArray=function(b64){var i,j,l,tmp,placeHolders,arr;if(b64.length%4>0)throw"Invalid string. Length must be a multiple of 4";for(arr=[],l=(placeHolders=(placeHolders=b64.indexOf("="))>0?b64.length-placeHolders:0)>0?b64.length-4:b64.length,i=0,j=0;i<l;i+=4,j+=3)tmp=lookup.indexOf(b64[i])<<18|lookup.indexOf(b64[i+1])<<12|lookup.indexOf(b64[i+2])<<6|lookup.indexOf(b64[i+3]),arr.push((16711680&tmp)>>16),arr.push((65280&tmp)>>8),arr.push(255&tmp);return 2===placeHolders?(tmp=lookup.indexOf(b64[i])<<2|lookup.indexOf(b64[i+1])>>4,arr.push(255&tmp)):1===placeHolders&&(tmp=lookup.indexOf(b64[i])<<10|lookup.indexOf(b64[i+1])<<4|lookup.indexOf(b64[i+2])>>2,arr.push(tmp>>8&255),arr.push(255&tmp)),arr},module.exports.fromByteArray=function(uint8){function tripletToBase64(num){return lookup[num>>18&63]+lookup[num>>12&63]+lookup[num>>6&63]+lookup[63&num]}var i,temp,length,extraBytes=uint8.length%3,output="";for(i=0,length=uint8.length-extraBytes;i<length;i+=3)output+=tripletToBase64(temp=(uint8[i]<<16)+(uint8[i+1]<<8)+uint8[i+2]);switch(extraBytes){case 1:temp=uint8[uint8.length-1],output+=lookup[temp>>2],output+=lookup[temp<<4&63],output+="==";break;case 2:temp=(uint8[uint8.length-2]<<8)+uint8[uint8.length-1],output+=lookup[temp>>10],output+=lookup[temp>>4&63],output+=lookup[temp<<2&63],output+="="}return output}}()},{}],4:[function(require,module,exports){function configureProperties(obj){if(getOwnPropertyNames&&defineProperty){var i,props=getOwnPropertyNames(obj);for(i=0;i<props.length;i+=1)defineProperty(obj,props[i],{value:obj[props[i]],writable:!1,enumerable:!1,configurable:!1})}}function as_signed(value,bits){var s=32-bits;return value<<s>>s}function as_unsigned(value,bits){var s=32-bits;return value<<s>>>s}function packI8(n){return[255&n]}function unpackI8(bytes){return as_signed(bytes[0],8)}function packU8(n){return[255&n]}function unpackU8(bytes){return as_unsigned(bytes[0],8)}function packU8Clamped(n){return n=round(Number(n)),[n<0?0:n>255?255:255&n]}function packI16(n){return[n>>8&255,255&n]}function unpackI16(bytes){return as_signed(bytes[0]<<8|bytes[1],16)}function packU16(n){return[n>>8&255,255&n]}function unpackU16(bytes){return as_unsigned(bytes[0]<<8|bytes[1],16)}function packI32(n){return[n>>24&255,n>>16&255,n>>8&255,255&n]}function unpackI32(bytes){return as_signed(bytes[0]<<24|bytes[1]<<16|bytes[2]<<8|bytes[3],32)}function packU32(n){return[n>>24&255,n>>16&255,n>>8&255,255&n]}function unpackU32(bytes){return as_unsigned(bytes[0]<<24|bytes[1]<<16|bytes[2]<<8|bytes[3],32)}function packIEEE754(v,ebits,fbits){function roundToEven(n){var w=floor(n),f=n-w;return f<.5?w:f>.5?w+1:w%2?w+1:w}var s,e,f,i,bits,str,bytes,bias=(1<<ebits-1)-1;for(v!=v?(e=(1<<ebits)-1,f=pow(2,fbits-1),s=0):v===1/0||v===-1/0?(e=(1<<ebits)-1,f=0,s=v<0?1:0):0===v?(e=0,f=0,s=1/v==-1/0?1:0):(s=v<0,(v=abs(v))>=pow(2,1-bias)?(e=min(floor(log(v)/LN2),1023),(f=roundToEven(v/pow(2,e)*pow(2,fbits)))/pow(2,fbits)>=2&&(e+=1,f=1),e>bias?(e=(1<<ebits)-1,f=0):(e+=bias,f-=pow(2,fbits))):(e=0,f=roundToEven(v/pow(2,1-bias-fbits)))),bits=[],i=fbits;i;i-=1)bits.push(f%2?1:0),f=floor(f/2);for(i=ebits;i;i-=1)bits.push(e%2?1:0),e=floor(e/2);for(bits.push(s?1:0),bits.reverse(),str=bits.join(""),bytes=[];str.length;)bytes.push(parseInt(str.substring(0,8),2)),str=str.substring(8);return bytes}function unpackIEEE754(bytes,ebits,fbits){var i,j,b,str,bias,s,e,f,bits=[];for(i=bytes.length;i;i-=1)for(b=bytes[i-1],j=8;j;j-=1)bits.push(b%2?1:0),b>>=1;return bits.reverse(),str=bits.join(""),bias=(1<<ebits-1)-1,s=parseInt(str.substring(0,1),2)?-1:1,e=parseInt(str.substring(1,1+ebits),2),f=parseInt(str.substring(1+ebits),2),e===(1<<ebits)-1?0!==f?NaN:s*(1/0):e>0?s*pow(2,e-bias)*(1+f/pow(2,fbits)):0!==f?s*pow(2,-(bias-1))*(f/pow(2,fbits)):s<0?-0:0}function unpackF64(b){return unpackIEEE754(b,11,52)}function packF64(v){return packIEEE754(v,11,52)}function unpackF32(b){return unpackIEEE754(b,8,23)}function packF32(v){return packIEEE754(v,8,23)}var undefined=void 0,MAX_ARRAY_LENGTH=1e5,ECMAScript=function(){var opts=Object.prototype.toString,ophop=Object.prototype.hasOwnProperty;return{Class:function(v){return opts.call(v).replace(/^\[object *|\]$/g,"")},HasProperty:function(o,p){return p in o},HasOwnProperty:function(o,p){return ophop.call(o,p)},IsCallable:function(o){return"function"==typeof o},ToInt32:function(v){return v>>0},ToUint32:function(v){return v>>>0}}}(),LN2=Math.LN2,abs=Math.abs,floor=Math.floor,log=Math.log,min=Math.min,pow=Math.pow,round=Math.round,defineProperty=Object.defineProperty||function(o,p,desc){if(!o===Object(o))throw new TypeError("Object.defineProperty called on non-object");return ECMAScript.HasProperty(desc,"get")&&Object.prototype.__defineGetter__&&Object.prototype.__defineGetter__.call(o,p,desc.get),ECMAScript.HasProperty(desc,"set")&&Object.prototype.__defineSetter__&&Object.prototype.__defineSetter__.call(o,p,desc.set),ECMAScript.HasProperty(desc,"value")&&(o[p]=desc.value),o},getOwnPropertyNames=Object.getOwnPropertyNames||function(o){if(o!==Object(o))throw new TypeError("Object.getOwnPropertyNames called on non-object");var p,props=[];for(p in o)ECMAScript.HasOwnProperty(o,p)&&props.push(p);return props};!function(){function makeConstructor(bytesPerElement,pack,unpack){var ctor;return ctor=function(buffer,byteOffset,length){var array,sequence,i,s;if(arguments.length&&"number"!=typeof arguments[0])if("object"==typeof arguments[0]&&arguments[0].constructor===ctor)for(array=arguments[0],this.length=array.length,this.byteLength=this.length*this.BYTES_PER_ELEMENT,this.buffer=new ArrayBuffer(this.byteLength),this.byteOffset=0,i=0;i<this.length;i+=1)this._setter(i,array._getter(i));else if("object"!=typeof arguments[0]||(arguments[0]instanceof ArrayBuffer||"ArrayBuffer"===ECMAScript.Class(arguments[0]))){if("object"!=typeof arguments[0]||!(arguments[0]instanceof ArrayBuffer||"ArrayBuffer"===ECMAScript.Class(arguments[0])))throw new TypeError("Unexpected argument type(s)");if(this.buffer=buffer,this.byteOffset=ECMAScript.ToUint32(byteOffset),this.byteOffset>this.buffer.byteLength)throw new RangeError("byteOffset out of range");if(this.byteOffset%this.BYTES_PER_ELEMENT)throw new RangeError("ArrayBuffer length minus the byteOffset is not a multiple of the element size.");if(arguments.length<3){if(this.byteLength=this.buffer.byteLength-this.byteOffset,this.byteLength%this.BYTES_PER_ELEMENT)throw new RangeError("length of buffer minus byteOffset not a multiple of the element size");this.length=this.byteLength/this.BYTES_PER_ELEMENT}else this.length=ECMAScript.ToUint32(length),this.byteLength=this.length*this.BYTES_PER_ELEMENT;if(this.byteOffset+this.byteLength>this.buffer.byteLength)throw new RangeError("byteOffset and length reference an area beyond the end of the buffer")}else for(sequence=arguments[0],this.length=ECMAScript.ToUint32(sequence.length),this.byteLength=this.length*this.BYTES_PER_ELEMENT,this.buffer=new ArrayBuffer(this.byteLength),this.byteOffset=0,i=0;i<this.length;i+=1)s=sequence[i],this._setter(i,Number(s));else{if(this.length=ECMAScript.ToInt32(arguments[0]),length<0)throw new RangeError("ArrayBufferView size is not a small enough positive integer");this.byteLength=this.length*this.BYTES_PER_ELEMENT,this.buffer=new ArrayBuffer(this.byteLength),this.byteOffset=0}this.constructor=ctor,configureProperties(this),function(obj){function makeArrayAccessor(index){defineProperty(obj,index,{get:function(){return obj._getter(index)},set:function(v){obj._setter(index,v)},enumerable:!0,configurable:!1})}if(defineProperty){if(obj.length>MAX_ARRAY_LENGTH)throw new RangeError("Array too large for polyfill");var i;for(i=0;i<obj.length;i+=1)makeArrayAccessor(i)}}(this)},ctor.prototype=new ArrayBufferView,ctor.prototype.BYTES_PER_ELEMENT=bytesPerElement,ctor.prototype._pack=pack,ctor.prototype._unpack=unpack,ctor.BYTES_PER_ELEMENT=bytesPerElement,ctor.prototype._getter=function(index){if(arguments.length<1)throw new SyntaxError("Not enough arguments");if((index=ECMAScript.ToUint32(index))>=this.length)return undefined;var i,o,bytes=[];for(i=0,o=this.byteOffset+index*this.BYTES_PER_ELEMENT;i<this.BYTES_PER_ELEMENT;i+=1,o+=1)bytes.push(this.buffer._bytes[o]);return this._unpack(bytes)},ctor.prototype.get=ctor.prototype._getter,ctor.prototype._setter=function(index,value){if(arguments.length<2)throw new SyntaxError("Not enough arguments");if((index=ECMAScript.ToUint32(index))>=this.length)return undefined;var i,o,bytes=this._pack(value);for(i=0,o=this.byteOffset+index*this.BYTES_PER_ELEMENT;i<this.BYTES_PER_ELEMENT;i+=1,o+=1)this.buffer._bytes[o]=bytes[i]},ctor.prototype.set=function(index,value){if(arguments.length<1)throw new SyntaxError("Not enough arguments");var array,sequence,offset,len,i,s,d,byteOffset,byteLength,tmp;if("object"==typeof arguments[0]&&arguments[0].constructor===this.constructor){if(array=arguments[0],(offset=ECMAScript.ToUint32(arguments[1]))+array.length>this.length)throw new RangeError("Offset plus length of array is out of range");if(byteOffset=this.byteOffset+offset*this.BYTES_PER_ELEMENT,byteLength=array.length*this.BYTES_PER_ELEMENT,array.buffer===this.buffer){for(tmp=[],i=0,s=array.byteOffset;i<byteLength;i+=1,s+=1)tmp[i]=array.buffer._bytes[s];for(i=0,d=byteOffset;i<byteLength;i+=1,d+=1)this.buffer._bytes[d]=tmp[i]}else for(i=0,s=array.byteOffset,d=byteOffset;i<byteLength;i+=1,s+=1,d+=1)this.buffer._bytes[d]=array.buffer._bytes[s]}else{if("object"!=typeof arguments[0]||void 0===arguments[0].length)throw new TypeError("Unexpected argument type(s)");if(sequence=arguments[0],len=ECMAScript.ToUint32(sequence.length),(offset=ECMAScript.ToUint32(arguments[1]))+len>this.length)throw new RangeError("Offset plus length of array is out of range");for(i=0;i<len;i+=1)s=sequence[i],this._setter(offset+i,Number(s))}},ctor.prototype.subarray=function(start,end){function clamp(v,min,max){return v<min?min:v>max?max:v}start=ECMAScript.ToInt32(start),end=ECMAScript.ToInt32(end),arguments.length<1&&(start=0),arguments.length<2&&(end=this.length),start<0&&(start=this.length+start),end<0&&(end=this.length+end),start=clamp(start,0,this.length);var len=(end=clamp(end,0,this.length))-start;return len<0&&(len=0),new this.constructor(this.buffer,this.byteOffset+start*this.BYTES_PER_ELEMENT,len)},ctor}var ArrayBuffer=function(length){if((length=ECMAScript.ToInt32(length))<0)throw new RangeError("ArrayBuffer size is not a small enough positive integer");this.byteLength=length,this._bytes=[],this._bytes.length=length;var i;for(i=0;i<this.byteLength;i+=1)this._bytes[i]=0;configureProperties(this)};exports.ArrayBuffer=exports.ArrayBuffer||ArrayBuffer;var ArrayBufferView=function(){},Int8Array=makeConstructor(1,packI8,unpackI8),Uint8Array=makeConstructor(1,packU8,unpackU8),Uint8ClampedArray=makeConstructor(1,packU8Clamped,unpackU8),Int16Array=makeConstructor(2,packI16,unpackI16),Uint16Array=makeConstructor(2,packU16,unpackU16),Int32Array=makeConstructor(4,packI32,unpackI32),Uint32Array=makeConstructor(4,packU32,unpackU32),Float32Array=makeConstructor(4,packF32,unpackF32),Float64Array=makeConstructor(8,packF64,unpackF64);exports.Int8Array=exports.Int8Array||Int8Array,exports.Uint8Array=exports.Uint8Array||Uint8Array,exports.Uint8ClampedArray=exports.Uint8ClampedArray||Uint8ClampedArray,exports.Int16Array=exports.Int16Array||Int16Array,exports.Uint16Array=exports.Uint16Array||Uint16Array,exports.Int32Array=exports.Int32Array||Int32Array,exports.Uint32Array=exports.Uint32Array||Uint32Array,exports.Float32Array=exports.Float32Array||Float32Array,exports.Float64Array=exports.Float64Array||Float64Array}(),function(){function r(array,index){return ECMAScript.IsCallable(array.get)?array.get(index):array[index]}function makeGetter(arrayType){return function(byteOffset,littleEndian){if((byteOffset=ECMAScript.ToUint32(byteOffset))+arrayType.BYTES_PER_ELEMENT>this.byteLength)throw new RangeError("Array index out of range");byteOffset+=this.byteOffset;var i,uint8Array=new Uint8Array(this.buffer,byteOffset,arrayType.BYTES_PER_ELEMENT),bytes=[];for(i=0;i<arrayType.BYTES_PER_ELEMENT;i+=1)bytes.push(r(uint8Array,i));return Boolean(littleEndian)===Boolean(IS_BIG_ENDIAN)&&bytes.reverse(),r(new arrayType(new Uint8Array(bytes).buffer),0)}}function makeSetter(arrayType){return function(byteOffset,value,littleEndian){if((byteOffset=ECMAScript.ToUint32(byteOffset))+arrayType.BYTES_PER_ELEMENT>this.byteLength)throw new RangeError("Array index out of range");var i,typeArray=new arrayType([value]),byteArray=new Uint8Array(typeArray.buffer),bytes=[];for(i=0;i<arrayType.BYTES_PER_ELEMENT;i+=1)bytes.push(r(byteArray,i));Boolean(littleEndian)===Boolean(IS_BIG_ENDIAN)&&bytes.reverse(),new Uint8Array(this.buffer,byteOffset,arrayType.BYTES_PER_ELEMENT).set(bytes)}}var IS_BIG_ENDIAN=function(){var u16array=new exports.Uint16Array([4660]);return 18===r(new exports.Uint8Array(u16array.buffer),0)}(),DataView=function(buffer,byteOffset,byteLength){if(0===arguments.length)buffer=new ArrayBuffer(0);else if(!(buffer instanceof ArrayBuffer||"ArrayBuffer"===ECMAScript.Class(buffer)))throw new TypeError("TypeError");if(this.buffer=buffer||new ArrayBuffer(0),this.byteOffset=ECMAScript.ToUint32(byteOffset),this.byteOffset>this.buffer.byteLength)throw new RangeError("byteOffset out of range");if(arguments.length<3?this.byteLength=this.buffer.byteLength-this.byteOffset:this.byteLength=ECMAScript.ToUint32(byteLength),this.byteOffset+this.byteLength>this.buffer.byteLength)throw new RangeError("byteOffset and length reference an area beyond the end of the buffer");configureProperties(this)};DataView.prototype.getUint8=makeGetter(exports.Uint8Array),DataView.prototype.getInt8=makeGetter(exports.Int8Array),DataView.prototype.getUint16=makeGetter(exports.Uint16Array),DataView.prototype.getInt16=makeGetter(exports.Int16Array),DataView.prototype.getUint32=makeGetter(exports.Uint32Array),DataView.prototype.getInt32=makeGetter(exports.Int32Array),DataView.prototype.getFloat32=makeGetter(exports.Float32Array),DataView.prototype.getFloat64=makeGetter(exports.Float64Array),DataView.prototype.setUint8=makeSetter(exports.Uint8Array),DataView.prototype.setInt8=makeSetter(exports.Int8Array),DataView.prototype.setUint16=makeSetter(exports.Uint16Array),DataView.prototype.setInt16=makeSetter(exports.Int16Array),DataView.prototype.setUint32=makeSetter(exports.Uint32Array),DataView.prototype.setInt32=makeSetter(exports.Int32Array),DataView.prototype.setFloat32=makeSetter(exports.Float32Array),DataView.prototype.setFloat64=makeSetter(exports.Float64Array),exports.DataView=exports.DataView||DataView}()},{}]},{},[]),module.exports=require("native-buffer-browserify").Buffer},{}],32:[function(require,module,exports){(function(){var Generator,iced,__iced_k_noop;iced=require("iced-runtime"),__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,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_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;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()},!(harvested_bits<bits_wanted))return _break();!function(__iced_k){if(_this.entropies.length)return e=_this.entropies.splice(0,1)[0],harvested_bits+=e[1],__iced_k(res.push(e[0]));!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)})(__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,_i,_len,_ref;for(bits=0,_i=0,_len=(_ref=this.entropies).length;_i<_len;_i++)bits+=_ref[_i][1];return bits},Generator.prototype.delay=function(cb){var delay,___iced_passed_deferral,__iced_deferrals;___iced_passed_deferral=iced.findDeferral(arguments),delay=this.is_generating?this.loop_delay:this.lazy_loop_delay,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()}(function(){return cb()})},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;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()},!_this.running)return _break();_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),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)}}(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()<d+this.work_min+1;)i++,x=Math.sin(Math.sqrt(Math.log(i+x)));return i},Generator}(),"undefined"!=typeof window&&null!==window&&(window.Generator=Generator),void 0!==exports&&null!==exports&&(exports.Generator=Generator)}).call(this)},{"iced-runtime":29}],33:[function(require,module,exports){(function(){exports.Generator=require("../lib/generator").Generator}).call(this)},{"../lib/generator":32}],34:[function(require,module,exports){var process=module.exports={};process.nextTick=function(){var canSetImmediate="undefined"!=typeof window&&window.setImmediate,canPost="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(canSetImmediate)return function(f){return window.setImmediate(f)};if(canPost){var queue=[];return window.addEventListener("message",function(ev){var source=ev.source;if((source===window||null===source)&&"process-tick"===ev.data&&(ev.stopPropagation(),queue.length>0)){queue.shift()()}},!0),function(fn){queue.push(fn),window.postMessage("process-tick","*")}}return function(fn){setTimeout(fn,0)}}(),process.title="browser",process.browser=!0,process.env={},process.argv=[],process.binding=function(name){throw new Error("process.binding is not supported")},process.cwd=function(){return"/"},process.chdir=function(dir){throw new Error("process.chdir is not supported")}},{}],35:[function(require,module,exports){"function"==typeof Object.create?module.exports=function(ctor,superCtor){ctor.super_=superCtor,ctor.prototype=Object.create(superCtor.prototype,{constructor:{value:ctor,enumerable:!1,writable:!0,configurable:!0}})}:module.exports=function(ctor,superCtor){ctor.super_=superCtor;var TempCtor=function(){};TempCtor.prototype=superCtor.prototype,ctor.prototype=new TempCtor,ctor.prototype.constructor=ctor}},{}],36:[function(require,module,exports){module.exports=function(arg){return arg&&"object"==typeof arg&&"function"==typeof arg.copy&&"function"==typeof arg.fill&&"function"==typeof arg.readUInt8}},{}],37:[function(require,module,exports){function inspect(obj,opts){var ctx={seen:[],stylize:stylizeNoColor};return arguments.length>=3&&(ctx.depth=arguments[2]),arguments.length>=4&&(ctx.colors=arguments[3]),isBoolean(opts)?ctx.showHidden=opts:opts&&exports._extend(ctx,opts),isUndefined(ctx.showHidden)&&(ctx.showHidden=!1),isUndefined(ctx.depth)&&(ctx.depth=2),isUndefined(ctx.colors)&&(ctx.colors=!1),isUndefined(ctx.customInspect)&&(ctx.customInspect=!0),ctx.colors&&(ctx.stylize=stylizeWithColor),formatValue(ctx,obj,ctx.depth)}function stylizeWithColor(str,styleType){var style=inspect.styles[styleType];return style?"["+inspect.colors[style][0]+"m"+str+"["+inspect.colors[style][1]+"m":str}function stylizeNoColor(str,styleType){return str}function formatValue(ctx,value,recurseTimes){if(ctx.customInspect&&value&&isFunction(value.inspect)&&value.inspect!==exports.inspect&&(!value.constructor||value.constructor.prototype!==value)){var ret=value.inspect(recurseTimes,ctx);return isString(ret)||(ret=formatValue(ctx,ret,recurseTimes)),ret}var primitive=function(ctx,value){if(isUndefined(value))return ctx.stylize("undefined","undefined");if(isString(value)){var simple="'"+JSON.stringify(value).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return ctx.stylize(simple,"string")}if(isNumber(value))return ctx.stylize(""+value,"number");if(isBoolean(value))return ctx.stylize(""+value,"boolean");if(isNull(value))return ctx.stylize("null","null")}(ctx,value);if(primitive)return primitive;var keys=Object.keys(value),visibleKeys=function(array){var hash={};return array.forEach(function(val,idx){hash[val]=!0}),hash}(keys);if(ctx.showHidden&&(keys=Object.getOwnPropertyNames(value)),isError(value)&&(keys.indexOf("message")>=0||keys.indexOf("description")>=0))return formatError(value);if(0===keys.length){if(isFunction(value)){var name=value.name?": "+value.name:"";return ctx.stylize("[Function"+name+"]","special")}if(isRegExp(value))return ctx.stylize(RegExp.prototype.toString.call(value),"regexp");if(isDate(value))return ctx.stylize(Date.prototype.toString.call(value),"date");if(isError(value))return formatError(value)}var base="",array=!1,braces=["{","}"];if(isArray(value)&&(array=!0,braces=["[","]"]),isFunction(value)){base=" [Function"+(value.name?": "+value.name:"")+"]"}if(isRegExp(value)&&(base=" "+RegExp.prototype.toString.call(value)),isDate(value)&&(base=" "+Date.prototype.toUTCString.call(value)),isError(value)&&(base=" "+formatError(value)),0===keys.length&&(!array||0==value.length))return braces[0]+base+braces[1];if(recurseTimes<0)return isRegExp(value)?ctx.stylize(RegExp.prototype.toString.call(value),"regexp"):ctx.stylize("[Object]","special");ctx.seen.push(value);var output;return output=array?function(ctx,value,recurseTimes,visibleKeys,keys){for(var output=[],i=0,l=value.length;i<l;++i)hasOwnProperty(value,String(i))?output.push(formatProperty(ctx,value,recurseTimes,visibleKeys,String(i),!0)):output.push("");return keys.forEach(function(key){key.match(/^\d+$/)||output.push(formatProperty(ctx,value,recurseTimes,visibleKeys,key,!0))}),output}(ctx,value,recurseTimes,visibleKeys,keys):keys.map(function(key){return formatProperty(ctx,value,recurseTimes,visibleKeys,key,array)}),ctx.seen.pop(),function(output,base,braces){var numLinesEst=0;if(output.reduce(function(prev,cur){return numLinesEst++,cur.indexOf("\n")>=0&&numLinesEst++,prev+cur.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60)return braces[0]+(""===base?"":base+"\n ")+" "+output.join(",\n ")+" "+braces[1];return braces[0]+base+" "+output.join(", ")+" "+braces[1]}(output,base,braces)}function formatError(value){return"["+Error.prototype.toString.call(value)+"]"}function formatProperty(ctx,value,recurseTimes,visibleKeys,key,array){var name,str,desc;if((desc=Object.getOwnPropertyDescriptor(value,key)||{value:value[key]}).get?str=desc.set?ctx.stylize("[Getter/Setter]","special"):ctx.stylize("[Getter]","special"):desc.set&&(str=ctx.stylize("[Setter]","special")),hasOwnProperty(visibleKeys,key)||(name="["+key+"]"),str||(ctx.seen.indexOf(desc.value)<0?(str=isNull(recurseTimes)?formatValue(ctx,desc.value,null):formatValue(ctx,desc.value,recurseTimes-1)).indexOf("\n")>-1&&(str=array?str.split("\n").map(function(line){return" "+line}).join("\n").substr(2):"\n"+str.split("\n").map(function(line){return" "+line}).join("\n")):str=ctx.stylize("[Circular]","special")),isUndefined(name)){if(array&&key.match(/^\d+$/))return str;(name=JSON.stringify(""+key)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(name=name.substr(1,name.length-2),name=ctx.stylize(name,"name")):(name=name.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),name=ctx.stylize(name,"string"))}return name+": "+str}function isArray(ar){return Array.isArray(ar)}function isBoolean(arg){return"boolean"==typeof arg}function isNull(arg){return null===arg}function isNumber(arg){return"number"==typeof arg}function isString(arg){return"string"==typeof arg}function isUndefined(arg){return void 0===arg}function isRegExp(re){return isObject(re)&&"[object RegExp]"===objectToString(re)}function isObject(arg){return"object"==typeof arg&&null!==arg}function isDate(d){return isObject(d)&&"[object Date]"===objectToString(d)}function isError(e){return isObject(e)&&("[object Error]"===objectToString(e)||e instanceof Error)}function isFunction(arg){return"function"==typeof arg}function objectToString(o){return Object.prototype.toString.call(o)}function pad(n){return n<10?"0"+n.toString(10):n.toString(10)}function hasOwnProperty(obj,prop){return Object.prototype.hasOwnProperty.call(obj,prop)}var process=require("__browserify_process"),global="undefined"!=typeof self?self:"undefined"!=typeof window?window:{},formatRegExp=/%[sdj%]/g;exports.format=function(f){if(!isString(f)){for(var objects=[],i=0;i<arguments.length;i++)objects.push(inspect(arguments[i]));return objects.join(" ")}for(var i=1,args=arguments,len=args.length,str=String(f).replace(formatRegExp,function(x){if("%%"===x)return"%";if(i>=len)return x;switch(x){case"%s":return String(args[i++]);case"%d":return Number(args[i++]);case"%j":try{return JSON.stringify(args[i++])}catch(_){return"[Circular]"}default:return x}}),x=args[i];i<len;x=args[++i])isNull(x)||!isObject(x)?str+=" "+x:str+=" "+inspect(x);return str},exports.deprecate=function(fn,msg){if(isUndefined(global.process))return function(){return exports.deprecate(fn,msg).apply(this,arguments)};if(!0===process.noDeprecation)return fn;var warned=!1;return function(){if(!warned){if(process.throwDeprecation)throw new Error(msg);process.traceDeprecation?console.trace(msg):console.error(msg),warned=!0}return fn.apply(this,arguments)}};var debugEnviron,debugs={};exports.debuglog=function(set){if(isUndefined(debugEnviron)&&(debugEnviron=process.env.NODE_DEBUG||""),set=set.toUpperCase(),!debugs[set])if(new RegExp("\\b"+set+"\\b","i").test(debugEnviron)){var pid=process.pid;debugs[set]=function(){var msg=exports.format.apply(exports,arguments);console.error("%s %d: %s",set,pid,msg)}}else debugs[set]=function(){};return debugs[set]},exports.inspect=inspect,inspect.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},inspect.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},exports.isArray=isArray,exports.isBoolean=isBoolean,exports.isNull=isNull,exports.isNullOrUndefined=function(arg){return null==arg},exports.isNumber=isNumber,exports.isString=isString,exports.isSymbol=function(arg){return"symbol"==typeof arg},exports.isUndefined=isUndefined,exports.isRegExp=isRegExp,exports.isObject=isObject,exports.isDate=isDate,exports.isError=isError,exports.isFunction=isFunction,exports.isPrimitive=function(arg){return null===arg||"boolean"==typeof arg||"number"==typeof arg||"string"==typeof arg||"symbol"==typeof arg||void 0===arg},exports.isBuffer=require("./support/isBuffer");var months=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];exports.log=function(){console.log("%s - %s",function(){var d=new Date,time=[pad(d.getHours()),pad(d.getMinutes()),pad(d.getSeconds())].join(":");return[d.getDate(),months[d.getMonth()],time].join(" ")}(),exports.format.apply(exports,arguments))},exports.inherits=require("inherits"),exports._extend=function(origin,add){if(!add||!isObject(add))return origin;for(var keys=Object.keys(add),i=keys.length;i--;)origin[keys[i]]=add[keys[i]];return origin}},{"./support/isBuffer":36,__browserify_process:34,inherits:35}]},{},[9])(9)});