text: shadow$provide.module$node_modules$des_DOT_js$lib$des$des=function(global,require,module,exports){function DESState(){this.tmp=Array(2);this.keys=null}function DES(options){Cipher.call(this,options);var state=new DESState;this._desState=state;this.deriveKeys(state,options.key)}var assert=require("module$node_modules$minimalistic_assert$index");global=require("module$node_modules$inherits$inherits_browser");var utils=require("module$node_modules$des_DOT_js$lib$des$utils"),Cipher=require("module$node_modules$des_DOT_js$lib$des$cipher");
  global(DES,Cipher);module.exports=DES;DES.create=function(options){return new DES(options)};var shiftTable=[1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1];DES.prototype.deriveKeys=function(state,key){state.keys=Array(32);assert.equal(key.length,this.blockSize,"Invalid key length");var kL=utils.readUInt32BE(key,0);key=utils.readUInt32BE(key,4);utils.pc1(kL,key,state.tmp,0);kL=state.tmp[0];key=state.tmp[1];for(var i=0;i<state.keys.length;i+=2){var shift=shiftTable[i>>>1];kL=utils.r28shl(kL,shift);key=utils.r28shl(key,
  shift);utils.pc2(kL,key,state.keys,i)}};DES.prototype._update=function(inp,inOff,out,outOff){var state=this._desState,l=utils.readUInt32BE(inp,inOff);inp=utils.readUInt32BE(inp,inOff+4);utils.ip(l,inp,state.tmp,0);l=state.tmp[0];inp=state.tmp[1];"encrypt"===this.type?this._encrypt(state,l,inp,state.tmp,0):this._decrypt(state,l,inp,state.tmp,0);l=state.tmp[0];inp=state.tmp[1];utils.writeUInt32BE(out,l,outOff);utils.writeUInt32BE(out,inp,outOff+4)};DES.prototype._pad=function(buffer,off){for(var value=
  buffer.length-off;off<buffer.length;off++)buffer[off]=value;return!0};DES.prototype._unpad=function(buffer){for(var pad=buffer[buffer.length-1],i=buffer.length-pad;i<buffer.length;i++)assert.equal(buffer[i],pad);return buffer.slice(0,buffer.length-pad)};DES.prototype._encrypt=function(state,lStart,rStart,out,off){for(var i=0;i<state.keys.length;i+=2){var keyL=state.keys[i],keyR=state.keys[i+1];utils.expand(rStart,state.tmp,0);keyL^=state.tmp[0];keyR^=state.tmp[1];keyL=utils.substitute(keyL,keyR);
  keyL=utils.permute(keyL);keyR=rStart;rStart=(lStart^keyL)>>>0;lStart=keyR}utils.rip(rStart,lStart,out,off)};DES.prototype._decrypt=function(state,lStart,rStart,out,off){for(var i=state.keys.length-2;0<=i;i-=2){var keyL=state.keys[i],keyR=state.keys[i+1];utils.expand(rStart,state.tmp,0);keyL^=state.tmp[0];keyR^=state.tmp[1];keyL=utils.substitute(keyL,keyR);keyL=utils.permute(keyL);keyR=rStart;rStart=(lStart^keyL)>>>0;lStart=keyR}utils.rip(rStart,lStart,out,off)}}
  //# sourceMappingURL=module$node_modules$des_DOT_js$lib$des$des.js.map
  