{"version":3,"sources":["../node_modules/browserify-sign/algos.js","../node_modules/browserify-cipher/browser.js","../node_modules/browserify-des/index.js","../node_modules/browserify-aes/encrypter.js","../node_modules/browserify-aes/modes/ecb.js","../node_modules/browserify-aes/modes/cbc.js","../node_modules/browserify-aes/modes/cfb.js","../node_modules/browserify-aes/modes/cfb8.js","../node_modules/browserify-aes/modes/cfb1.js","../node_modules/browserify-aes/modes/ofb.js","../node_modules/browserify-aes/ghash.js","../node_modules/browserify-aes/decrypter.js","../node_modules/browserify-des/modes.js","../node_modules/browserify-sign/browser/index.js","../node_modules/browserify-sign/browser/sign.js","../node_modules/browserify-sign/browser/verify.js","../node_modules/browserify-aes/aes.js","../node_modules/browserify-aes/browser.js","../node_modules/browserify-aes/modes/index.js","../node_modules/browserify-rsa/index.js","../node_modules/browserify-aes/modes/ctr.js","../node_modules/browserify-aes/incr32.js","../node_modules/browserify-aes/authCipher.js","../node_modules/browserify-aes/streamCipher.js"],"names":["module","exports","require","DES","aes","aesModes","desModes","ebtk","createCipheriv","suite","key","iv","toLowerCase","mode","TypeError","createDecipheriv","decrypt","createCipher","Cipher","password","keyLen","ivLen","keys","Cipheriv","createDecipher","Decipher","Decipheriv","listCiphers","getCiphers","Object","concat","CipherBase","des","inherits","Buffer","modes","CBC","instantiate","EDE","opts","call","this","type","modeName","isBuffer","from","slice","_des","create","des3","prototype","_update","data","update","_final","final","MODES","AuthCipher","StreamCipher","Transform","_cache","Splitter","_cipher","AES","_prev","_mode","_autopadding","chunk","thing","add","out","get","encrypt","push","PADDING","alloc","cache","allocUnsafe","config","length","flush","scrub","equals","Error","setAutoPadding","setTo","len","padBuff","i","writeUInt8","self","block","encryptBlock","decryptBlock","xor","pad","encryptStart","encryptByte","byteParam","bit","value","shiftIn","buffer","getBlock","ZEROES","fromArray","buf","writeUInt32BE","GHASH","h","state","ghash","_multiply","j","lsbVi","Vi","readUInt32BE","Zi","abl","bl","_last","last","padded","unpad","autoPadding","createHash","stream","sign","verify","algorithms","Sign","algorithm","Writable","_hashType","hash","_hash","_tag","id","_signType","Verify","createSign","createVerify","forEach","_write","_","done","enc","end","digest","sig","toString","sigBuffer","createHmac","crt","EC","ec","BN","parseKeys","curves","getKey","x","q","algo","toArray","byteLength","zeros","hlen","hbits","bits","bits2int","mod","bits2octets","v","fill","k","obits","shift","bitLength","ishrn","makeKey","kv","t","cmp","makeR","g","p","toRed","mont","redPow","fromRed","hashType","signType","tag","priv","curve","curveId","join","keyFromPrivate","privateKey","toDER","ecSign","params","priv_key","r","H","s","invm","imul","mul","cmpn","res","dsaSign","undefined","padding","modulus","checkValue","b","pub","pubkey","subjectPrivateKey","ecVerify","y","pub_key","unpacked","signature","decode","montp","w","dsaVerify","padNum","red","publicExponent","Math","min","asUInt32Array","Array","scrubVec","cryptBlock","M","keySchedule","SUB_MIX","SBOX","nRounds","t0","t1","t2","t3","SUB_MIX0","SUB_MIX1","SUB_MIX2","SUB_MIX3","s0","s1","s2","s3","ksRow","round","RCON","G","d","INV_SBOX","INV_SUB_MIX","xi","sx","x2","x4","x8","_key","_reset","blockSize","keySize","keyWords","ksRows","invKeySchedule","ik","ksR","tt","_nRounds","_keySchedule","_invKeySchedule","encryptBlockRaw","m1","ciphers","deciphers","modeModules","ECB","CFB","CFB8","CFB1","OFB","CTR","GCM","randomBytes","getr","umod","prime1","prime2","msg","blinds","blinder","unblinder","blind","blinded","c1","c2","qinv","coefficient","exponent1","m2","exponent2","isub","iadd","toArrayLike","incr32","chunkNum","ceil","start","offset","item","readUInt8","ck","_ghash","_finID","toPad","ivBits","tail","writeUIntBE","calcIv","_secCache","_decrypt","_alen","_len","_authTag","_called","rump","a","xorTest","getAuthTag","setAuthTag","setAAD"],"mappings":"sHAEAA,EAAOC,QAAUC,EAAQ,I,uBCFzB,IAAIC,EAAMD,EAAQ,MACdE,EAAMF,EAAQ,KACdG,EAAWH,EAAQ,KACnBI,EAAWJ,EAAQ,MACnBK,EAAOL,EAAQ,KAsCnB,SAASM,EAAgBC,EAAOC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SAC9C,EAEA/Q,EAAaR,UAAUI,OAAS,WAC9Bb,KAAKqB,QAAQmB,OACf,EAEAjF,EAAOC,QAAUyD,C","file":"static/js/main~44fd26a2.ff1bde81.chunk.js","sourcesContent":["'use strict';\n\nmodule.exports = require('./browser/algorithms.json');\n","var DES = require('browserify-des')\nvar aes = require('browserify-aes/browser')\nvar aesModes = require('browserify-aes/modes')\nvar desModes = require('browserify-des/modes')\nvar ebtk = require('evp_bytestokey')\n\nfunction createCipher (suite, password) {\n suite = suite.toLowerCase()\n\n var keyLen, ivLen\n if (aesModes[suite]) {\n keyLen = aesModes[suite].key\n ivLen = aesModes[suite].iv\n } else if (desModes[suite]) {\n keyLen = desModes[suite].key * 8\n ivLen = desModes[suite].iv\n } else {\n throw new TypeError('invalid suite type')\n }\n\n var keys = ebtk(password, false, keyLen, ivLen)\n return createCipheriv(suite, keys.key, keys.iv)\n}\n\nfunction createDecipher (suite, password) {\n suite = suite.toLowerCase()\n\n var keyLen, ivLen\n if (aesModes[suite]) {\n keyLen = aesModes[suite].key\n ivLen = aesModes[suite].iv\n } else if (desModes[suite]) {\n keyLen = desModes[suite].key * 8\n ivLen = desModes[suite].iv\n } else {\n throw new TypeError('invalid suite type')\n }\n\n var keys = ebtk(password, false, keyLen, ivLen)\n return createDecipheriv(suite, keys.key, keys.iv)\n}\n\nfunction createCipheriv (suite, key, iv) {\n suite = suite.toLowerCase()\n if (aesModes[suite]) return aes.createCipheriv(suite, key, iv)\n if (desModes[suite]) return new DES({ key: key, iv: iv, mode: suite })\n\n throw new TypeError('invalid suite type')\n}\n\nfunction createDecipheriv (suite, key, iv) {\n suite = suite.toLowerCase()\n if (aesModes[suite]) return aes.createDecipheriv(suite, key, iv)\n if (desModes[suite]) return new DES({ key: key, iv: iv, mode: suite, decrypt: true })\n\n throw new TypeError('invalid suite type')\n}\n\nfunction getCiphers () {\n return Object.keys(desModes).concat(aes.getCiphers())\n}\n\nexports.createCipher = exports.Cipher = createCipher\nexports.createCipheriv = exports.Cipheriv = createCipheriv\nexports.createDecipher = exports.Decipher = createDecipher\nexports.createDecipheriv = exports.Decipheriv = createDecipheriv\nexports.listCiphers = exports.getCiphers = getCiphers\n","var CipherBase = require('cipher-base')\nvar des = require('des.js')\nvar inherits = require('inherits')\nvar Buffer = require('safe-buffer').Buffer\n\nvar modes = {\n 'des-ede3-cbc': des.CBC.instantiate(des.EDE),\n 'des-ede3': des.EDE,\n 'des-ede-cbc': des.CBC.instantiate(des.EDE),\n 'des-ede': des.EDE,\n 'des-cbc': des.CBC.instantiate(des.DES),\n 'des-ecb': des.DES\n}\nmodes.des = modes['des-cbc']\nmodes.des3 = modes['des-ede3-cbc']\nmodule.exports = DES\ninherits(DES, CipherBase)\nfunction DES (opts) {\n CipherBase.call(this)\n var modeName = opts.mode.toLowerCase()\n var mode = modes[modeName]\n var type\n if (opts.decrypt) {\n type = 'decrypt'\n } else {\n type = 'encrypt'\n }\n var key = opts.key\n if (!Buffer.isBuffer(key)) {\n key = Buffer.from(key)\n }\n if (modeName === 'des-ede' || modeName === 'des-ede-cbc') {\n key = Buffer.concat([key, key.slice(0, 8)])\n }\n var iv = opts.iv\n if (!Buffer.isBuffer(iv)) {\n iv = Buffer.from(iv)\n }\n this._des = mode.create({\n key: key,\n iv: iv,\n type: type\n })\n}\nDES.prototype._update = function (data) {\n return Buffer.from(this._des.update(data))\n}\nDES.prototype._final = function () {\n return Buffer.from(this._des.final())\n}\n","var MODES = require('./modes')\nvar AuthCipher = require('./authCipher')\nvar Buffer = require('safe-buffer').Buffer\nvar StreamCipher = require('./streamCipher')\nvar Transform = require('cipher-base')\nvar aes = require('./aes')\nvar ebtk = require('evp_bytestokey')\nvar inherits = require('inherits')\n\nfunction Cipher (mode, key, iv) {\n Transform.call(this)\n\n this._cache = new Splitter()\n this._cipher = new aes.AES(key)\n this._prev = Buffer.from(iv)\n this._mode = mode\n this._autopadding = true\n}\n\ninherits(Cipher, Transform)\n\nCipher.prototype._update = function (data) {\n this._cache.add(data)\n var chunk\n var thing\n var out = []\n\n while ((chunk = this._cache.get())) {\n thing = this._mode.encrypt(this, chunk)\n out.push(thing)\n }\n\n return Buffer.concat(out)\n}\n\nvar PADDING = Buffer.alloc(16, 0x10)\n\nCipher.prototype._final = function () {\n var chunk = this._cache.flush()\n if (this._autopadding) {\n chunk = this._mode.encrypt(this, chunk)\n this._cipher.scrub()\n return chunk\n }\n\n if (!chunk.equals(PADDING)) {\n this._cipher.scrub()\n throw new Error('data not multiple of block length')\n }\n}\n\nCipher.prototype.setAutoPadding = function (setTo) {\n this._autopadding = !!setTo\n return this\n}\n\nfunction Splitter () {\n this.cache = Buffer.allocUnsafe(0)\n}\n\nSplitter.prototype.add = function (data) {\n this.cache = Buffer.concat([this.cache, data])\n}\n\nSplitter.prototype.get = function () {\n if (this.cache.length > 15) {\n var out = this.cache.slice(0, 16)\n this.cache = this.cache.slice(16)\n return out\n }\n return null\n}\n\nSplitter.prototype.flush = function () {\n var len = 16 - this.cache.length\n var padBuff = Buffer.allocUnsafe(len)\n\n var i = -1\n while (++i < len) {\n padBuff.writeUInt8(len, i)\n }\n\n return Buffer.concat([this.cache, padBuff])\n}\n\nfunction createCipheriv (suite, password, iv) {\n var config = MODES[suite.toLowerCase()]\n if (!config) throw new TypeError('invalid suite type')\n\n if (typeof password === 'string') password = Buffer.from(password)\n if (password.length !== config.key / 8) throw new TypeError('invalid key length ' + password.length)\n\n if (typeof iv === 'string') iv = Buffer.from(iv)\n if (config.mode !== 'GCM' && iv.length !== config.iv) throw new TypeError('invalid iv length ' + iv.length)\n\n if (config.type === 'stream') {\n return new StreamCipher(config.module, password, iv)\n } else if (config.type === 'auth') {\n return new AuthCipher(config.module, password, iv)\n }\n\n return new Cipher(config.module, password, iv)\n}\n\nfunction createCipher (suite, password) {\n var config = MODES[suite.toLowerCase()]\n if (!config) throw new TypeError('invalid suite type')\n\n var keys = ebtk(password, false, config.key, config.iv)\n return createCipheriv(suite, keys.key, keys.iv)\n}\n\nexports.createCipheriv = createCipheriv\nexports.createCipher = createCipher\n","exports.encrypt = function (self, block) {\n return self._cipher.encryptBlock(block)\n}\n\nexports.decrypt = function (self, block) {\n return self._cipher.decryptBlock(block)\n}\n","var xor = require('buffer-xor')\n\nexports.encrypt = function (self, block) {\n var data = xor(block, self._prev)\n\n self._prev = self._cipher.encryptBlock(data)\n return self._prev\n}\n\nexports.decrypt = function (self, block) {\n var pad = self._prev\n\n self._prev = block\n var out = self._cipher.decryptBlock(block)\n\n return xor(out, pad)\n}\n","var Buffer = require('safe-buffer').Buffer\nvar xor = require('buffer-xor')\n\nfunction encryptStart (self, data, decrypt) {\n var len = data.length\n var out = xor(data, self._cache)\n self._cache = self._cache.slice(len)\n self._prev = Buffer.concat([self._prev, decrypt ? data : out])\n return out\n}\n\nexports.encrypt = function (self, data, decrypt) {\n var out = Buffer.allocUnsafe(0)\n var len\n\n while (data.length) {\n if (self._cache.length === 0) {\n self._cache = self._cipher.encryptBlock(self._prev)\n self._prev = Buffer.allocUnsafe(0)\n }\n\n if (self._cache.length <= data.length) {\n len = self._cache.length\n out = Buffer.concat([out, encryptStart(self, data.slice(0, len), decrypt)])\n data = data.slice(len)\n } else {\n out = Buffer.concat([out, encryptStart(self, data, decrypt)])\n break\n }\n }\n\n return out\n}\n","var Buffer = require('safe-buffer').Buffer\n\nfunction encryptByte (self, byteParam, decrypt) {\n var pad = self._cipher.encryptBlock(self._prev)\n var out = pad[0] ^ byteParam\n\n self._prev = Buffer.concat([\n self._prev.slice(1),\n Buffer.from([decrypt ? byteParam : out])\n ])\n\n return out\n}\n\nexports.encrypt = function (self, chunk, decrypt) {\n var len = chunk.length\n var out = Buffer.allocUnsafe(len)\n var i = -1\n\n while (++i < len) {\n out[i] = encryptByte(self, chunk[i], decrypt)\n }\n\n return out\n}\n","var Buffer = require('safe-buffer').Buffer\n\nfunction encryptByte (self, byteParam, decrypt) {\n var pad\n var i = -1\n var len = 8\n var out = 0\n var bit, value\n while (++i < len) {\n pad = self._cipher.encryptBlock(self._prev)\n bit = (byteParam & (1 << (7 - i))) ? 0x80 : 0\n value = pad[0] ^ bit\n out += ((value & 0x80) >> (i % 8))\n self._prev = shiftIn(self._prev, decrypt ? bit : value)\n }\n return out\n}\n\nfunction shiftIn (buffer, value) {\n var len = buffer.length\n var i = -1\n var out = Buffer.allocUnsafe(buffer.length)\n buffer = Buffer.concat([buffer, Buffer.from([value])])\n\n while (++i < len) {\n out[i] = buffer[i] << 1 | buffer[i + 1] >> (7)\n }\n\n return out\n}\n\nexports.encrypt = function (self, chunk, decrypt) {\n var len = chunk.length\n var out = Buffer.allocUnsafe(len)\n var i = -1\n\n while (++i < len) {\n out[i] = encryptByte(self, chunk[i], decrypt)\n }\n\n return out\n}\n","var xor = require('buffer-xor')\n\nfunction getBlock (self) {\n self._prev = self._cipher.encryptBlock(self._prev)\n return self._prev\n}\n\nexports.encrypt = function (self, chunk) {\n while (self._cache.length < chunk.length) {\n self._cache = Buffer.concat([self._cache, getBlock(self)])\n }\n\n var pad = self._cache.slice(0, chunk.length)\n self._cache = self._cache.slice(chunk.length)\n return xor(chunk, pad)\n}\n","var Buffer = require('safe-buffer').Buffer\nvar ZEROES = Buffer.alloc(16, 0)\n\nfunction toArray (buf) {\n return [\n buf.readUInt32BE(0),\n buf.readUInt32BE(4),\n buf.readUInt32BE(8),\n buf.readUInt32BE(12)\n ]\n}\n\nfunction fromArray (out) {\n var buf = Buffer.allocUnsafe(16)\n buf.writeUInt32BE(out[0] >>> 0, 0)\n buf.writeUInt32BE(out[1] >>> 0, 4)\n buf.writeUInt32BE(out[2] >>> 0, 8)\n buf.writeUInt32BE(out[3] >>> 0, 12)\n return buf\n}\n\nfunction GHASH (key) {\n this.h = key\n this.state = Buffer.alloc(16, 0)\n this.cache = Buffer.allocUnsafe(0)\n}\n\n// from http://bitwiseshiftleft.github.io/sjcl/doc/symbols/src/core_gcm.js.html\n// by Juho Vähä-Herttua\nGHASH.prototype.ghash = function (block) {\n var i = -1\n while (++i < block.length) {\n this.state[i] ^= block[i]\n }\n this._multiply()\n}\n\nGHASH.prototype._multiply = function () {\n var Vi = toArray(this.h)\n var Zi = [0, 0, 0, 0]\n var j, xi, lsbVi\n var i = -1\n while (++i < 128) {\n xi = (this.state[~~(i / 8)] & (1 << (7 - (i % 8)))) !== 0\n if (xi) {\n // Z_i+1 = Z_i ^ V_i\n Zi[0] ^= Vi[0]\n Zi[1] ^= Vi[1]\n Zi[2] ^= Vi[2]\n Zi[3] ^= Vi[3]\n }\n\n // Store the value of LSB(V_i)\n lsbVi = (Vi[3] & 1) !== 0\n\n // V_i+1 = V_i >> 1\n for (j = 3; j > 0; j--) {\n Vi[j] = (Vi[j] >>> 1) | ((Vi[j - 1] & 1) << 31)\n }\n Vi[0] = Vi[0] >>> 1\n\n // If LSB(V_i) is 1, V_i+1 = (V_i >> 1) ^ R\n if (lsbVi) {\n Vi[0] = Vi[0] ^ (0xe1 << 24)\n }\n }\n this.state = fromArray(Zi)\n}\n\nGHASH.prototype.update = function (buf) {\n this.cache = Buffer.concat([this.cache, buf])\n var chunk\n while (this.cache.length >= 16) {\n chunk = this.cache.slice(0, 16)\n this.cache = this.cache.slice(16)\n this.ghash(chunk)\n }\n}\n\nGHASH.prototype.final = function (abl, bl) {\n if (this.cache.length) {\n this.ghash(Buffer.concat([this.cache, ZEROES], 16))\n }\n\n this.ghash(fromArray([0, abl, 0, bl]))\n return this.state\n}\n\nmodule.exports = GHASH\n","var AuthCipher = require('./authCipher')\nvar Buffer = require('safe-buffer').Buffer\nvar MODES = require('./modes')\nvar StreamCipher = require('./streamCipher')\nvar Transform = require('cipher-base')\nvar aes = require('./aes')\nvar ebtk = require('evp_bytestokey')\nvar inherits = require('inherits')\n\nfunction Decipher (mode, key, iv) {\n Transform.call(this)\n\n this._cache = new Splitter()\n this._last = void 0\n this._cipher = new aes.AES(key)\n this._prev = Buffer.from(iv)\n this._mode = mode\n this._autopadding = true\n}\n\ninherits(Decipher, Transform)\n\nDecipher.prototype._update = function (data) {\n this._cache.add(data)\n var chunk\n var thing\n var out = []\n while ((chunk = this._cache.get(this._autopadding))) {\n thing = this._mode.decrypt(this, chunk)\n out.push(thing)\n }\n return Buffer.concat(out)\n}\n\nDecipher.prototype._final = function () {\n var chunk = this._cache.flush()\n if (this._autopadding) {\n return unpad(this._mode.decrypt(this, chunk))\n } else if (chunk) {\n throw new Error('data not multiple of block length')\n }\n}\n\nDecipher.prototype.setAutoPadding = function (setTo) {\n this._autopadding = !!setTo\n return this\n}\n\nfunction Splitter () {\n this.cache = Buffer.allocUnsafe(0)\n}\n\nSplitter.prototype.add = function (data) {\n this.cache = Buffer.concat([this.cache, data])\n}\n\nSplitter.prototype.get = function (autoPadding) {\n var out\n if (autoPadding) {\n if (this.cache.length > 16) {\n out = this.cache.slice(0, 16)\n this.cache = this.cache.slice(16)\n return out\n }\n } else {\n if (this.cache.length >= 16) {\n out = this.cache.slice(0, 16)\n this.cache = this.cache.slice(16)\n return out\n }\n }\n\n return null\n}\n\nSplitter.prototype.flush = function () {\n if (this.cache.length) return this.cache\n}\n\nfunction unpad (last) {\n var padded = last[15]\n if (padded < 1 || padded > 16) {\n throw new Error('unable to decrypt data')\n }\n var i = -1\n while (++i < padded) {\n if (last[(i + (16 - padded))] !== padded) {\n throw new Error('unable to decrypt data')\n }\n }\n if (padded === 16) return\n\n return last.slice(0, 16 - padded)\n}\n\nfunction createDecipheriv (suite, password, iv) {\n var config = MODES[suite.toLowerCase()]\n if (!config) throw new TypeError('invalid suite type')\n\n if (typeof iv === 'string') iv = Buffer.from(iv)\n if (config.mode !== 'GCM' && iv.length !== config.iv) throw new TypeError('invalid iv length ' + iv.length)\n\n if (typeof password === 'string') password = Buffer.from(password)\n if (password.length !== config.key / 8) throw new TypeError('invalid key length ' + password.length)\n\n if (config.type === 'stream') {\n return new StreamCipher(config.module, password, iv, true)\n } else if (config.type === 'auth') {\n return new AuthCipher(config.module, password, iv, true)\n }\n\n return new Decipher(config.module, password, iv)\n}\n\nfunction createDecipher (suite, password) {\n var config = MODES[suite.toLowerCase()]\n if (!config) throw new TypeError('invalid suite type')\n\n var keys = ebtk(password, false, config.key, config.iv)\n return createDecipheriv(suite, keys.key, keys.iv)\n}\n\nexports.createDecipher = createDecipher\nexports.createDecipheriv = createDecipheriv\n","exports['des-ecb'] = {\n key: 8,\n iv: 0\n}\nexports['des-cbc'] = exports.des = {\n key: 8,\n iv: 8\n}\nexports['des-ede3-cbc'] = exports.des3 = {\n key: 24,\n iv: 8\n}\nexports['des-ede3'] = {\n key: 24,\n iv: 0\n}\nexports['des-ede-cbc'] = {\n key: 16,\n iv: 8\n}\nexports['des-ede'] = {\n key: 16,\n iv: 0\n}\n","'use strict';\n\nvar Buffer = require('safe-buffer').Buffer;\nvar createHash = require('create-hash');\nvar stream = require('readable-stream');\nvar inherits = require('inherits');\nvar sign = require('./sign');\nvar verify = require('./verify');\n\nvar algorithms = require('./algorithms.json');\nObject.keys(algorithms).forEach(function (key) {\n algorithms[key].id = Buffer.from(algorithms[key].id, 'hex');\n algorithms[key.toLowerCase()] = algorithms[key];\n});\n\nfunction Sign(algorithm) {\n stream.Writable.call(this);\n\n var data = algorithms[algorithm];\n if (!data) { throw new Error('Unknown message digest'); }\n\n this._hashType = data.hash;\n this._hash = createHash(data.hash);\n this._tag = data.id;\n this._signType = data.sign;\n}\ninherits(Sign, stream.Writable);\n\nSign.prototype._write = function _write(data, _, done) {\n this._hash.update(data);\n done();\n};\n\nSign.prototype.update = function update(data, enc) {\n this._hash.update(typeof data === 'string' ? Buffer.from(data, enc) : data);\n\n return this;\n};\n\nSign.prototype.sign = function signMethod(key, enc) {\n this.end();\n var hash = this._hash.digest();\n var sig = sign(hash, key, this._hashType, this._signType, this._tag);\n\n return enc ? sig.toString(enc) : sig;\n};\n\nfunction Verify(algorithm) {\n stream.Writable.call(this);\n\n var data = algorithms[algorithm];\n if (!data) { throw new Error('Unknown message digest'); }\n\n this._hash = createHash(data.hash);\n this._tag = data.id;\n this._signType = data.sign;\n}\ninherits(Verify, stream.Writable);\n\nVerify.prototype._write = function _write(data, _, done) {\n this._hash.update(data);\n done();\n};\n\nVerify.prototype.update = function update(data, enc) {\n this._hash.update(typeof data === 'string' ? Buffer.from(data, enc) : data);\n\n return this;\n};\n\nVerify.prototype.verify = function verifyMethod(key, sig, enc) {\n var sigBuffer = typeof sig === 'string' ? Buffer.from(sig, enc) : sig;\n\n this.end();\n var hash = this._hash.digest();\n return verify(sigBuffer, hash, key, this._signType, this._tag);\n};\n\nfunction createSign(algorithm) {\n return new Sign(algorithm);\n}\n\nfunction createVerify(algorithm) {\n return new Verify(algorithm);\n}\n\nmodule.exports = {\n Sign: createSign,\n Verify: createVerify,\n createSign: createSign,\n createVerify: createVerify\n};\n","'use strict';\n\n// much of this based on https://github.com/indutny/self-signed/blob/gh-pages/lib/rsa.js\nvar Buffer = require('safe-buffer').Buffer;\nvar createHmac = require('create-hmac');\nvar crt = require('browserify-rsa');\nvar EC = require('elliptic').ec;\nvar BN = require('bn.js');\nvar parseKeys = require('parse-asn1');\nvar curves = require('./curves.json');\n\nvar RSA_PKCS1_PADDING = 1;\n\nfunction sign(hash, key, hashType, signType, tag) {\n var priv = parseKeys(key);\n if (priv.curve) {\n // rsa keys can be interpreted as ecdsa ones in openssl\n if (signType !== 'ecdsa' && signType !== 'ecdsa/rsa') { throw new Error('wrong private key type'); }\n return ecSign(hash, priv);\n } else if (priv.type === 'dsa') {\n if (signType !== 'dsa') { throw new Error('wrong private key type'); }\n return dsaSign(hash, priv, hashType);\n }\n if (signType !== 'rsa' && signType !== 'ecdsa/rsa') { throw new Error('wrong private key type'); }\n if (key.padding !== undefined && key.padding !== RSA_PKCS1_PADDING) { throw new Error('illegal or unsupported padding mode'); }\n\n hash = Buffer.concat([tag, hash]);\n var len = priv.modulus.byteLength();\n var pad = [0, 1];\n while (hash.length + pad.length + 1 < len) { pad.push(0xff); }\n pad.push(0x00);\n var i = -1;\n while (++i < hash.length) { pad.push(hash[i]); }\n\n var out = crt(pad, priv);\n return out;\n}\n\nfunction ecSign(hash, priv) {\n var curveId = curves[priv.curve.join('.')];\n if (!curveId) { throw new Error('unknown curve ' + priv.curve.join('.')); }\n\n var curve = new EC(curveId);\n var key = curve.keyFromPrivate(priv.privateKey);\n var out = key.sign(hash);\n\n return Buffer.from(out.toDER());\n}\n\nfunction dsaSign(hash, priv, algo) {\n var x = priv.params.priv_key;\n var p = priv.params.p;\n var q = priv.params.q;\n var g = priv.params.g;\n var r = new BN(0);\n var k;\n var H = bits2int(hash, q).mod(q);\n var s = false;\n var kv = getKey(x, q, hash, algo);\n while (s === false) {\n k = makeKey(q, kv, algo);\n r = makeR(g, k, p, q);\n s = k.invm(q).imul(H.add(x.mul(r))).mod(q);\n if (s.cmpn(0) === 0) {\n s = false;\n r = new BN(0);\n }\n }\n return toDER(r, s);\n}\n\nfunction toDER(r, s) {\n r = r.toArray();\n s = s.toArray();\n\n // Pad values\n if (r[0] & 0x80) { r = [0].concat(r); }\n if (s[0] & 0x80) { s = [0].concat(s); }\n\n var total = r.length + s.length + 4;\n var res = [\n 0x30, total, 0x02, r.length\n ];\n res = res.concat(r, [0x02, s.length], s);\n return Buffer.from(res);\n}\n\nfunction getKey(x, q, hash, algo) {\n x = Buffer.from(x.toArray());\n if (x.length < q.byteLength()) {\n var zeros = Buffer.alloc(q.byteLength() - x.length);\n x = Buffer.concat([zeros, x]);\n }\n var hlen = hash.length;\n var hbits = bits2octets(hash, q);\n var v = Buffer.alloc(hlen);\n v.fill(1);\n var k = Buffer.alloc(hlen);\n k = createHmac(algo, k).update(v).update(Buffer.from([0])).update(x).update(hbits).digest();\n v = createHmac(algo, k).update(v).digest();\n k = createHmac(algo, k).update(v).update(Buffer.from([1])).update(x).update(hbits).digest();\n v = createHmac(algo, k).update(v).digest();\n return { k: k, v: v };\n}\n\nfunction bits2int(obits, q) {\n var bits = new BN(obits);\n var shift = (obits.length << 3) - q.bitLength();\n if (shift > 0) { bits.ishrn(shift); }\n return bits;\n}\n\nfunction bits2octets(bits, q) {\n bits = bits2int(bits, q);\n bits = bits.mod(q);\n var out = Buffer.from(bits.toArray());\n if (out.length < q.byteLength()) {\n var zeros = Buffer.alloc(q.byteLength() - out.length);\n out = Buffer.concat([zeros, out]);\n }\n return out;\n}\n\nfunction makeKey(q, kv, algo) {\n var t;\n var k;\n\n do {\n t = Buffer.alloc(0);\n\n while (t.length * 8 < q.bitLength()) {\n kv.v = createHmac(algo, kv.k).update(kv.v).digest();\n t = Buffer.concat([t, kv.v]);\n }\n\n k = bits2int(t, q);\n kv.k = createHmac(algo, kv.k).update(kv.v).update(Buffer.from([0])).digest();\n kv.v = createHmac(algo, kv.k).update(kv.v).digest();\n } while (k.cmp(q) !== -1);\n\n return k;\n}\n\nfunction makeR(g, k, p, q) {\n return g.toRed(BN.mont(p)).redPow(k).fromRed().mod(q);\n}\n\nmodule.exports = sign;\nmodule.exports.getKey = getKey;\nmodule.exports.makeKey = makeKey;\n","'use strict';\n\n// much of this based on https://github.com/indutny/self-signed/blob/gh-pages/lib/rsa.js\nvar Buffer = require('safe-buffer').Buffer;\nvar BN = require('bn.js');\nvar EC = require('elliptic').ec;\nvar parseKeys = require('parse-asn1');\nvar curves = require('./curves.json');\n\nfunction verify(sig, hash, key, signType, tag) {\n var pub = parseKeys(key);\n if (pub.type === 'ec') {\n // rsa keys can be interpreted as ecdsa ones in openssl\n if (signType !== 'ecdsa' && signType !== 'ecdsa/rsa') { throw new Error('wrong public key type'); }\n return ecVerify(sig, hash, pub);\n } else if (pub.type === 'dsa') {\n if (signType !== 'dsa') { throw new Error('wrong public key type'); }\n return dsaVerify(sig, hash, pub);\n }\n if (signType !== 'rsa' && signType !== 'ecdsa/rsa') { throw new Error('wrong public key type'); }\n\n hash = Buffer.concat([tag, hash]);\n var len = pub.modulus.byteLength();\n var pad = [1];\n var padNum = 0;\n while (hash.length + pad.length + 2 < len) {\n pad.push(0xff);\n padNum += 1;\n }\n pad.push(0x00);\n var i = -1;\n while (++i < hash.length) {\n pad.push(hash[i]);\n }\n pad = Buffer.from(pad);\n var red = BN.mont(pub.modulus);\n sig = new BN(sig).toRed(red);\n\n sig = sig.redPow(new BN(pub.publicExponent));\n sig = Buffer.from(sig.fromRed().toArray());\n var out = padNum < 8 ? 1 : 0;\n len = Math.min(sig.length, pad.length);\n if (sig.length !== pad.length) { out = 1; }\n\n i = -1;\n while (++i < len) { out |= sig[i] ^ pad[i]; }\n return out === 0;\n}\n\nfunction ecVerify(sig, hash, pub) {\n var curveId = curves[pub.data.algorithm.curve.join('.')];\n if (!curveId) { throw new Error('unknown curve ' + pub.data.algorithm.curve.join('.')); }\n\n var curve = new EC(curveId);\n var pubkey = pub.data.subjectPrivateKey.data;\n\n return curve.verify(hash, sig, pubkey);\n}\n\nfunction dsaVerify(sig, hash, pub) {\n var p = pub.data.p;\n var q = pub.data.q;\n var g = pub.data.g;\n var y = pub.data.pub_key;\n var unpacked = parseKeys.signature.decode(sig, 'der');\n var s = unpacked.s;\n var r = unpacked.r;\n checkValue(s, q);\n checkValue(r, q);\n var montp = BN.mont(p);\n var w = s.invm(q);\n var v = g.toRed(montp)\n .redPow(new BN(hash).mul(w).mod(q))\n .fromRed()\n .mul(y.toRed(montp).redPow(r.mul(w).mod(q)).fromRed())\n .mod(p)\n .mod(q);\n return v.cmp(r) === 0;\n}\n\nfunction checkValue(b, q) {\n if (b.cmpn(0) <= 0) { throw new Error('invalid sig'); }\n if (b.cmp(q) >= 0) { throw new Error('invalid sig'); }\n}\n\nmodule.exports = verify;\n","// based on the aes implimentation in triple sec\n// https://github.com/keybase/triplesec\n// which is in turn based on the one from crypto-js\n// https://code.google.com/p/crypto-js/\n\nvar Buffer = require('safe-buffer').Buffer\n\nfunction asUInt32Array (buf) {\n if (!Buffer.isBuffer(buf)) buf = Buffer.from(buf)\n\n var len = (buf.length / 4) | 0\n var out = new Array(len)\n\n for (var i = 0; i < len; i++) {\n out[i] = buf.readUInt32BE(i * 4)\n }\n\n return out\n}\n\nfunction scrubVec (v) {\n for (var i = 0; i < v.length; v++) {\n v[i] = 0\n }\n}\n\nfunction cryptBlock (M, keySchedule, SUB_MIX, SBOX, nRounds) {\n var SUB_MIX0 = SUB_MIX[0]\n var SUB_MIX1 = SUB_MIX[1]\n var SUB_MIX2 = SUB_MIX[2]\n var SUB_MIX3 = SUB_MIX[3]\n\n var s0 = M[0] ^ keySchedule[0]\n var s1 = M[1] ^ keySchedule[1]\n var s2 = M[2] ^ keySchedule[2]\n var s3 = M[3] ^ keySchedule[3]\n var t0, t1, t2, t3\n var ksRow = 4\n\n for (var round = 1; round < nRounds; round++) {\n t0 = SUB_MIX0[s0 >>> 24] ^ SUB_MIX1[(s1 >>> 16) & 0xff] ^ SUB_MIX2[(s2 >>> 8) & 0xff] ^ SUB_MIX3[s3 & 0xff] ^ keySchedule[ksRow++]\n t1 = SUB_MIX0[s1 >>> 24] ^ SUB_MIX1[(s2 >>> 16) & 0xff] ^ SUB_MIX2[(s3 >>> 8) & 0xff] ^ SUB_MIX3[s0 & 0xff] ^ keySchedule[ksRow++]\n t2 = SUB_MIX0[s2 >>> 24] ^ SUB_MIX1[(s3 >>> 16) & 0xff] ^ SUB_MIX2[(s0 >>> 8) & 0xff] ^ SUB_MIX3[s1 & 0xff] ^ keySchedule[ksRow++]\n t3 = SUB_MIX0[s3 >>> 24] ^ SUB_MIX1[(s0 >>> 16) & 0xff] ^ SUB_MIX2[(s1 >>> 8) & 0xff] ^ SUB_MIX3[s2 & 0xff] ^ keySchedule[ksRow++]\n s0 = t0\n s1 = t1\n s2 = t2\n s3 = t3\n }\n\n t0 = ((SBOX[s0 >>> 24] << 24) | (SBOX[(s1 >>> 16) & 0xff] << 16) | (SBOX[(s2 >>> 8) & 0xff] << 8) | SBOX[s3 & 0xff]) ^ keySchedule[ksRow++]\n t1 = ((SBOX[s1 >>> 24] << 24) | (SBOX[(s2 >>> 16) & 0xff] << 16) | (SBOX[(s3 >>> 8) & 0xff] << 8) | SBOX[s0 & 0xff]) ^ keySchedule[ksRow++]\n t2 = ((SBOX[s2 >>> 24] << 24) | (SBOX[(s3 >>> 16) & 0xff] << 16) | (SBOX[(s0 >>> 8) & 0xff] << 8) | SBOX[s1 & 0xff]) ^ keySchedule[ksRow++]\n t3 = ((SBOX[s3 >>> 24] << 24) | (SBOX[(s0 >>> 16) & 0xff] << 16) | (SBOX[(s1 >>> 8) & 0xff] << 8) | SBOX[s2 & 0xff]) ^ keySchedule[ksRow++]\n t0 = t0 >>> 0\n t1 = t1 >>> 0\n t2 = t2 >>> 0\n t3 = t3 >>> 0\n\n return [t0, t1, t2, t3]\n}\n\n// AES constants\nvar RCON = [0x00, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36]\nvar G = (function () {\n // Compute double table\n var d = new Array(256)\n for (var j = 0; j < 256; j++) {\n if (j < 128) {\n d[j] = j << 1\n } else {\n d[j] = (j << 1) ^ 0x11b\n }\n }\n\n var SBOX = []\n var INV_SBOX = []\n var SUB_MIX = [[], [], [], []]\n var INV_SUB_MIX = [[], [], [], []]\n\n // Walk GF(2^8)\n var x = 0\n var xi = 0\n for (var i = 0; i < 256; ++i) {\n // Compute sbox\n var sx = xi ^ (xi << 1) ^ (xi << 2) ^ (xi << 3) ^ (xi << 4)\n sx = (sx >>> 8) ^ (sx & 0xff) ^ 0x63\n SBOX[x] = sx\n INV_SBOX[sx] = x\n\n // Compute multiplication\n var x2 = d[x]\n var x4 = d[x2]\n var x8 = d[x4]\n\n // Compute sub bytes, mix columns tables\n var t = (d[sx] * 0x101) ^ (sx * 0x1010100)\n SUB_MIX[0][x] = (t << 24) | (t >>> 8)\n SUB_MIX[1][x] = (t << 16) | (t >>> 16)\n SUB_MIX[2][x] = (t << 8) | (t >>> 24)\n SUB_MIX[3][x] = t\n\n // Compute inv sub bytes, inv mix columns tables\n t = (x8 * 0x1010101) ^ (x4 * 0x10001) ^ (x2 * 0x101) ^ (x * 0x1010100)\n INV_SUB_MIX[0][sx] = (t << 24) | (t >>> 8)\n INV_SUB_MIX[1][sx] = (t << 16) | (t >>> 16)\n INV_SUB_MIX[2][sx] = (t << 8) | (t >>> 24)\n INV_SUB_MIX[3][sx] = t\n\n if (x === 0) {\n x = xi = 1\n } else {\n x = x2 ^ d[d[d[x8 ^ x2]]]\n xi ^= d[d[xi]]\n }\n }\n\n return {\n SBOX: SBOX,\n INV_SBOX: INV_SBOX,\n SUB_MIX: SUB_MIX,\n INV_SUB_MIX: INV_SUB_MIX\n }\n})()\n\nfunction AES (key) {\n this._key = asUInt32Array(key)\n this._reset()\n}\n\nAES.blockSize = 4 * 4\nAES.keySize = 256 / 8\nAES.prototype.blockSize = AES.blockSize\nAES.prototype.keySize = AES.keySize\nAES.prototype._reset = function () {\n var keyWords = this._key\n var keySize = keyWords.length\n var nRounds = keySize + 6\n var ksRows = (nRounds + 1) * 4\n\n var keySchedule = []\n for (var k = 0; k < keySize; k++) {\n keySchedule[k] = keyWords[k]\n }\n\n for (k = keySize; k < ksRows; k++) {\n var t = keySchedule[k - 1]\n\n if (k % keySize === 0) {\n t = (t << 8) | (t >>> 24)\n t =\n (G.SBOX[t >>> 24] << 24) |\n (G.SBOX[(t >>> 16) & 0xff] << 16) |\n (G.SBOX[(t >>> 8) & 0xff] << 8) |\n (G.SBOX[t & 0xff])\n\n t ^= RCON[(k / keySize) | 0] << 24\n } else if (keySize > 6 && k % keySize === 4) {\n t =\n (G.SBOX[t >>> 24] << 24) |\n (G.SBOX[(t >>> 16) & 0xff] << 16) |\n (G.SBOX[(t >>> 8) & 0xff] << 8) |\n (G.SBOX[t & 0xff])\n }\n\n keySchedule[k] = keySchedule[k - keySize] ^ t\n }\n\n var invKeySchedule = []\n for (var ik = 0; ik < ksRows; ik++) {\n var ksR = ksRows - ik\n var tt = keySchedule[ksR - (ik % 4 ? 0 : 4)]\n\n if (ik < 4 || ksR <= 4) {\n invKeySchedule[ik] = tt\n } else {\n invKeySchedule[ik] =\n G.INV_SUB_MIX[0][G.SBOX[tt >>> 24]] ^\n G.INV_SUB_MIX[1][G.SBOX[(tt >>> 16) & 0xff]] ^\n G.INV_SUB_MIX[2][G.SBOX[(tt >>> 8) & 0xff]] ^\n G.INV_SUB_MIX[3][G.SBOX[tt & 0xff]]\n }\n }\n\n this._nRounds = nRounds\n this._keySchedule = keySchedule\n this._invKeySchedule = invKeySchedule\n}\n\nAES.prototype.encryptBlockRaw = function (M) {\n M = asUInt32Array(M)\n return cryptBlock(M, this._keySchedule, G.SUB_MIX, G.SBOX, this._nRounds)\n}\n\nAES.prototype.encryptBlock = function (M) {\n var out = this.encryptBlockRaw(M)\n var buf = Buffer.allocUnsafe(16)\n buf.writeUInt32BE(out[0], 0)\n buf.writeUInt32BE(out[1], 4)\n buf.writeUInt32BE(out[2], 8)\n buf.writeUInt32BE(out[3], 12)\n return buf\n}\n\nAES.prototype.decryptBlock = function (M) {\n M = asUInt32Array(M)\n\n // swap\n var m1 = M[1]\n M[1] = M[3]\n M[3] = m1\n\n var out = cryptBlock(M, this._invKeySchedule, G.INV_SUB_MIX, G.INV_SBOX, this._nRounds)\n var buf = Buffer.allocUnsafe(16)\n buf.writeUInt32BE(out[0], 0)\n buf.writeUInt32BE(out[3], 4)\n buf.writeUInt32BE(out[2], 8)\n buf.writeUInt32BE(out[1], 12)\n return buf\n}\n\nAES.prototype.scrub = function () {\n scrubVec(this._keySchedule)\n scrubVec(this._invKeySchedule)\n scrubVec(this._key)\n}\n\nmodule.exports.AES = AES\n","var ciphers = require('./encrypter')\nvar deciphers = require('./decrypter')\nvar modes = require('./modes/list.json')\n\nfunction getCiphers () {\n return Object.keys(modes)\n}\n\nexports.createCipher = exports.Cipher = ciphers.createCipher\nexports.createCipheriv = exports.Cipheriv = ciphers.createCipheriv\nexports.createDecipher = exports.Decipher = deciphers.createDecipher\nexports.createDecipheriv = exports.Decipheriv = deciphers.createDecipheriv\nexports.listCiphers = exports.getCiphers = getCiphers\n","var modeModules = {\n ECB: require('./ecb'),\n CBC: require('./cbc'),\n CFB: require('./cfb'),\n CFB8: require('./cfb8'),\n CFB1: require('./cfb1'),\n OFB: require('./ofb'),\n CTR: require('./ctr'),\n GCM: require('./ctr')\n}\n\nvar modes = require('./list.json')\n\nfor (var key in modes) {\n modes[key].module = modeModules[modes[key].mode]\n}\n\nmodule.exports = modes\n","var BN = require('bn.js')\nvar randomBytes = require('randombytes')\n\nfunction blind (priv) {\n var r = getr(priv)\n var blinder = r.toRed(BN.mont(priv.modulus)).redPow(new BN(priv.publicExponent)).fromRed()\n return { blinder: blinder, unblinder: r.invm(priv.modulus) }\n}\n\nfunction getr (priv) {\n var len = priv.modulus.byteLength()\n var r\n do {\n r = new BN(randomBytes(len))\n } while (r.cmp(priv.modulus) >= 0 || !r.umod(priv.prime1) || !r.umod(priv.prime2))\n return r\n}\n\nfunction crt (msg, priv) {\n var blinds = blind(priv)\n var len = priv.modulus.byteLength()\n var blinded = new BN(msg).mul(blinds.blinder).umod(priv.modulus)\n var c1 = blinded.toRed(BN.mont(priv.prime1))\n var c2 = blinded.toRed(BN.mont(priv.prime2))\n var qinv = priv.coefficient\n var p = priv.prime1\n var q = priv.prime2\n var m1 = c1.redPow(priv.exponent1).fromRed()\n var m2 = c2.redPow(priv.exponent2).fromRed()\n var h = m1.isub(m2).imul(qinv).umod(p).imul(q)\n return m2.iadd(h).imul(blinds.unblinder).umod(priv.modulus).toArrayLike(Buffer, 'be', len)\n}\ncrt.getr = getr\n\nmodule.exports = crt\n","var xor = require('buffer-xor')\nvar Buffer = require('safe-buffer').Buffer\nvar incr32 = require('../incr32')\n\nfunction getBlock (self) {\n var out = self._cipher.encryptBlockRaw(self._prev)\n incr32(self._prev)\n return out\n}\n\nvar blockSize = 16\nexports.encrypt = function (self, chunk) {\n var chunkNum = Math.ceil(chunk.length / blockSize)\n var start = self._cache.length\n self._cache = Buffer.concat([\n self._cache,\n Buffer.allocUnsafe(chunkNum * blockSize)\n ])\n for (var i = 0; i < chunkNum; i++) {\n var out = getBlock(self)\n var offset = start + i * blockSize\n self._cache.writeUInt32BE(out[0], offset + 0)\n self._cache.writeUInt32BE(out[1], offset + 4)\n self._cache.writeUInt32BE(out[2], offset + 8)\n self._cache.writeUInt32BE(out[3], offset + 12)\n }\n var pad = self._cache.slice(0, chunk.length)\n self._cache = self._cache.slice(chunk.length)\n return xor(chunk, pad)\n}\n","function incr32 (iv) {\n var len = iv.length\n var item\n while (len--) {\n item = iv.readUInt8(len)\n if (item === 255) {\n iv.writeUInt8(0, len)\n } else {\n item++\n iv.writeUInt8(item, len)\n break\n }\n }\n}\nmodule.exports = incr32\n","var aes = require('./aes')\nvar Buffer = require('safe-buffer').Buffer\nvar Transform = require('cipher-base')\nvar inherits = require('inherits')\nvar GHASH = require('./ghash')\nvar xor = require('buffer-xor')\nvar incr32 = require('./incr32')\n\nfunction xorTest (a, b) {\n var out = 0\n if (a.length !== b.length) out++\n\n var len = Math.min(a.length, b.length)\n for (var i = 0; i < len; ++i) {\n out += (a[i] ^ b[i])\n }\n\n return out\n}\n\nfunction calcIv (self, iv, ck) {\n if (iv.length === 12) {\n self._finID = Buffer.concat([iv, Buffer.from([0, 0, 0, 1])])\n return Buffer.concat([iv, Buffer.from([0, 0, 0, 2])])\n }\n var ghash = new GHASH(ck)\n var len = iv.length\n var toPad = len % 16\n ghash.update(iv)\n if (toPad) {\n toPad = 16 - toPad\n ghash.update(Buffer.alloc(toPad, 0))\n }\n ghash.update(Buffer.alloc(8, 0))\n var ivBits = len * 8\n var tail = Buffer.alloc(8)\n tail.writeUIntBE(ivBits, 0, 8)\n ghash.update(tail)\n self._finID = ghash.state\n var out = Buffer.from(self._finID)\n incr32(out)\n return out\n}\nfunction StreamCipher (mode, key, iv, decrypt) {\n Transform.call(this)\n\n var h = Buffer.alloc(4, 0)\n\n this._cipher = new aes.AES(key)\n var ck = this._cipher.encryptBlock(h)\n this._ghash = new GHASH(ck)\n iv = calcIv(this, iv, ck)\n\n this._prev = Buffer.from(iv)\n this._cache = Buffer.allocUnsafe(0)\n this._secCache = Buffer.allocUnsafe(0)\n this._decrypt = decrypt\n this._alen = 0\n this._len = 0\n this._mode = mode\n\n this._authTag = null\n this._called = false\n}\n\ninherits(StreamCipher, Transform)\n\nStreamCipher.prototype._update = function (chunk) {\n if (!this._called && this._alen) {\n var rump = 16 - (this._alen % 16)\n if (rump < 16) {\n rump = Buffer.alloc(rump, 0)\n this._ghash.update(rump)\n }\n }\n\n this._called = true\n var out = this._mode.encrypt(this, chunk)\n if (this._decrypt) {\n this._ghash.update(chunk)\n } else {\n this._ghash.update(out)\n }\n this._len += chunk.length\n return out\n}\n\nStreamCipher.prototype._final = function () {\n if (this._decrypt && !this._authTag) throw new Error('Unsupported state or unable to authenticate data')\n\n var tag = xor(this._ghash.final(this._alen * 8, this._len * 8), this._cipher.encryptBlock(this._finID))\n if (this._decrypt && xorTest(tag, this._authTag)) throw new Error('Unsupported state or unable to authenticate data')\n\n this._authTag = tag\n this._cipher.scrub()\n}\n\nStreamCipher.prototype.getAuthTag = function getAuthTag () {\n if (this._decrypt || !Buffer.isBuffer(this._authTag)) throw new Error('Attempting to get auth tag in unsupported state')\n\n return this._authTag\n}\n\nStreamCipher.prototype.setAuthTag = function setAuthTag (tag) {\n if (!this._decrypt) throw new Error('Attempting to set auth tag in unsupported state')\n\n this._authTag = tag\n}\n\nStreamCipher.prototype.setAAD = function setAAD (buf) {\n if (this._called) throw new Error('Attempting to set AAD in unsupported state')\n\n this._ghash.update(buf)\n this._alen += buf.length\n}\n\nmodule.exports = StreamCipher\n","var aes = require('./aes')\nvar Buffer = require('safe-buffer').Buffer\nvar Transform = require('cipher-base')\nvar inherits = require('inherits')\n\nfunction StreamCipher (mode, key, iv, decrypt) {\n Transform.call(this)\n\n this._cipher = new aes.AES(key)\n this._prev = Buffer.from(iv)\n this._cache = Buffer.allocUnsafe(0)\n this._secCache = Buffer.allocUnsafe(0)\n this._decrypt = decrypt\n this._mode = mode\n}\n\ninherits(StreamCipher, Transform)\n\nStreamCipher.prototype._update = function (chunk) {\n return this._mode.encrypt(this, chunk, this._decrypt)\n}\n\nStreamCipher.prototype._final = function () {\n this._cipher.scrub()\n}\n\nmodule.exports = StreamCipher\n"],"sourceRoot":""}