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EAAQ,CAACA,IAEJA,CACT,CAWAtqD,eAAes4F,GAAc1vF,EAAMyvF,EAAWW,EAAW,QACvD,MAAMv0F,EAAayU,EAAK7X,SAASuH,GACjC,MAAmB,UAAfnE,EACKghB,EAAiB7c,GAER,SAAdyvF,GACFzvF,EAAOmvE,EAAiBnvE,GACP,WAAbowF,GAAuBpwF,EAAKqwF,YAAYD,GACrCpwF,GAES,QAAdyvF,GAAsC,aAAf5zF,EAClBy0F,EAAwBtwF,GAE1BA,CACT,CAUA,SAAS4vF,GAAYl4F,EAAQ+X,GAC3B/X,EAAOsI,KAAOwc,EAAqB/M,EAAQ09D,QAAQn2E,QAAQI,MAAOsH,EAAUC,WACpEoe,EAAYrlB,EAAOsI,KAAMrB,EAAU,CACvCE,cAAc,IAEhB,MAAMlI,EAAS+lB,EAAiB/d,GAChC,UAEQke,EAAiBne,GAAU67C,GAAKA,UAChC5jD,EAAOsB,QACb,MAAOqC,SACD3D,EAAOuB,MAAMoC,MAGzB,CASA,SAASg0F,GAAaiC,EAAQ/3C,EAAQ79B,GACpC,OAAQ69B,GACN,IAAK,SACH,OAAO+3C,EACT,IAAK,UACH,OAAOA,EAAOlhF,MAAMsL,GACtB,IAAK,SACH,OAAO41E,EAAOx4F,QAChB,QACE,MAAUoB,MAAM,sBAAsBq/C,GAE5C"}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                {"version":3,"file":"openpgp.min.mjs","sources":["../../node_modules/@openpgp/web-stream-tools/lib/writer.js","../../node_modules/@openpgp/web-stream-tools/lib/util.js","../../node_modules/@openpgp/web-stream-tools/lib/node-conversions.js","../../node_modules/@openpgp/web-stream-tools/lib/reader.js","../../node_modules/@openpgp/web-stream-tools/lib/streams.js","../../src/biginteger/native.interface.js","../../src/biginteger/index.js","../../src/enums.js","../../src/util.js","../../src/encoding/base64.js","../../src/config/config.js","../../src/encoding/armor.js","../../src/type/keyid.js","../../node_modules/@openpgp/asmcrypto.js/dist_es8/aes/aes.asm.js","../../node_modules/@openpgp/asmcrypto.js/dist_es8/other/utils.js","../../node_modules/@openpgp/asmcrypto.js/dist_es8/other/errors.js","../../node_modules/@openpgp/asmcrypto.js/dist_es8/aes/aes.js","../../node_modules/@openpgp/asmcrypto.js/dist_es8/aes/ecb.js","../../src/crypto/cipher/aes.js","../../src/crypto/cipher/des.js","../../src/crypto/cipher/cast5.js","../../src/crypto/cipher/twofish.js","../../src/crypto/cipher/blowfish.js","../../src/crypto/cipher/index.js","../../node_modules/@openpgp/asmcrypto.js/dist_es8/hash/sha1/sha1.asm.js","../../node_modules/@openpgp/asmcrypto.js/dist_es8/hash/hash.js","../../node_modules/@openpgp/asmcrypto.js/dist_es8/hash/sha1/sha1.js","../../node_modules/@openpgp/asmcrypto.js/dist_es8/hash/sha256/sha256.js","../../node_modules/@openpgp/asmcrypto.js/dist_es8/hash/sha256/sha256.asm.js","../../node_modules/minimalistic-assert/index.js","../../node_modules/inherits/inherits_browser.js","../../node_modules/inherits/inherits.js","../../node_modules/hash.js/lib/hash/utils.js","../../node_modules/hash.js/lib/hash/common.js","../../node_modules/hash.js/lib/hash/sha/common.js","../../node_modules/hash.js/lib/hash/sha/256.js","../../node_modules/hash.js/lib/hash/sha/224.js","../../node_modules/hash.js/lib/hash/sha/512.js","../../node_modules/hash.js/lib/hash/sha/384.js","../../node_modules/hash.js/lib/hash/ripemd.js","../../src/crypto/hash/md5.js","../../src/crypto/hash/index.js","../../node_modules/@openpgp/asmcrypto.js/dist_es8/aes/cfb.js","../../src/crypto/cipher/getCipher.js","../../src/crypto/mode/cfb.js","../../node_modules/@openpgp/asmcrypto.js/dist_es8/aes/ctr.js","../../node_modules/@openpgp/asmcrypto.js/dist_es8/aes/cbc.js","../../src/crypto/cmac.js","../../src/crypto/mode/eax.js","../../src/crypto/mode/ocb.js","../../node_modules/@openpgp/asmcrypto.js/dist_es8/aes/gcm.js","../../src/crypto/mode/gcm.js","../../src/crypto/mode/index.js","../../node_modules/@openpgp/tweetnacl/nacl-fast-light.js","../../src/crypto/random.js","../../src/crypto/public_key/prime.js","../../src/crypto/pkcs1.js","../../src/crypto/public_key/rsa.js","../../src/crypto/public_key/elgamal.js","../../src/type/oid.js","../../src/crypto/public_key/elliptic/indutnyKey.js","../../src/packet/packet.js","../../src/crypto/public_key/elliptic/oid_curves.js","../../src/crypto/public_key/elliptic/ecdsa.js","../../src/crypto/public_key/elliptic/eddsa_legacy.js","../../src/crypto/public_key/elliptic/eddsa.js","../../src/crypto/aes_kw.js","../../src/crypto/pkcs5.js","../../src/crypto/public_key/elliptic/ecdh.js","../../src/crypto/hkdf.js","../../src/crypto/public_key/elliptic/ecdh_x.js","../../src/crypto/public_key/dsa.js","../../src/crypto/public_key/index.js","../../src/crypto/signature.js","../../src/type/ecdh_symkey.js","../../src/type/kdf_params.js","../../src/type/ecdh_x_symkey.js","../../src/crypto/crypto.js","../../src/crypto/index.js","../../node_modules/@openpgp/pako/lib/utils/common.js","../../node_modules/@openpgp/pako/lib/zlib/constants.js","../../node_modules/@openpgp/pako/lib/zlib/trees.js","../../node_modules/@openpgp/pako/lib/zlib/adler32.js","../../node_modules/@openpgp/pako/lib/zlib/crc32.js","../../node_modules/@openpgp/pako/lib/zlib/messages.js","../../node_modules/@openpgp/pako/lib/zlib/deflate.js","../../node_modules/@openpgp/pako/lib/utils/strings.js","../../node_modules/@openpgp/pako/lib/zlib/zstream.js","../../node_modules/@openpgp/pako/lib/deflate.js","../../node_modules/@openpgp/pako/lib/zlib/inffast.js","../../node_modules/@openpgp/pako/lib/zlib/inftrees.js","../../node_modules/@openpgp/pako/lib/zlib/inflate.js","../../node_modules/@openpgp/pako/lib/zlib/gzheader.js","../../node_modules/@openpgp/pako/lib/inflate.js","../../node_modules/@openpgp/seek-bzip/lib/bitreader.js","../../node_modules/@openpgp/seek-bzip/lib/stream.js","../../node_modules/@openpgp/seek-bzip/lib/crc32.js","../../node_modules/@openpgp/seek-bzip/lib/index.js","../../src/packet/literal_data.js","../../src/packet/signature.js","../../src/packet/one_pass_signature.js","../../src/packet/packetlist.js","../../src/packet/compressed_data.js","../../src/packet/sym_encrypted_integrity_protected_data.js","../../src/packet/aead_encrypted_data.js","../../src/packet/public_key_encrypted_session_key.js","../../src/type/s2k.js","../../src/packet/sym_encrypted_session_key.js","../../src/packet/public_key.js","../../src/packet/symmetrically_encrypted_data.js","../../src/packet/marker.js","../../src/packet/public_subkey.js","../../src/packet/user_attribute.js","../../src/packet/secret_key.js","../../node_modules/email-addresses/lib/email-addresses.js","../../src/packet/userid.js","../../src/packet/secret_subkey.js","../../src/packet/trust.js","../../src/signature.js","../../src/key/helper.js","../../src/key/user.js","../../src/key/subkey.js","../../src/key/key.js","../../src/key/public_key.js","../../src/key/private_key.js","../../src/key/factory.js","../../src/message.js","../../src/cleartext.js","../../src/openpgp.js","../../node_modules/@openpgp/web-stream-tools/node_modules/web-streams-polyfill/dist/ponyfill.es6.mjs","../../node_modules/@mattiasbuelens/web-streams-adapter/dist/web-streams-adapter.mjs","../../node_modules/bn.js/lib/bn.js","../../src/biginteger/bn.interface.js","../../node_modules/brorand/index.js","../../node_modules/minimalistic-crypto-utils/lib/utils.js","../../node_modules/@openpgp/elliptic/lib/elliptic/utils.js","../../node_modules/@openpgp/elliptic/lib/elliptic/curve/base.js","../../node_modules/@openpgp/elliptic/lib/elliptic/curve/short.js","../../node_modules/@openpgp/elliptic/lib/elliptic/curve/mont.js","../../node_modules/@openpgp/elliptic/lib/elliptic/curve/edwards.js","../../node_modules/@openpgp/elliptic/lib/elliptic/curve/index.js","../../node_modules/hash.js/lib/hash/sha/1.js","../../node_modules/hash.js/lib/hash/sha.js","../../node_modules/hash.js/lib/hash/hmac.js","../../node_modules/hash.js/lib/hash.js","../../node_modules/@openpgp/elliptic/lib/elliptic/precomputed/secp256k1.js","../../node_modules/@openpgp/elliptic/lib/elliptic/curves.js","../../node_modules/hmac-drbg/lib/hmac-drbg.js","../../node_modules/@openpgp/elliptic/lib/elliptic/ec/key.js","../../node_modules/@openpgp/elliptic/lib/elliptic/ec/signature.js","../../node_modules/@openpgp/elliptic/lib/elliptic/ec/index.js","../../node_modules/@openpgp/elliptic/lib/elliptic/eddsa/key.js","../../node_modules/@openpgp/elliptic/lib/elliptic/eddsa/signature.js","../../node_modules/@openpgp/elliptic/lib/elliptic/eddsa/index.js","../../node_modules/@openpgp/elliptic/lib/elliptic.js"],"sourcesContent":["const doneWritingPromise = Symbol('doneWritingPromise');\nconst doneWritingResolve = Symbol('doneWritingResolve');\nconst doneWritingReject = Symbol('doneWritingReject');\n\nconst readingIndex = Symbol('readingIndex');\n\nclass ArrayStream extends Array {\n  constructor() {\n    super();\n    this[doneWritingPromise] = new Promise((resolve, reject) => {\n      this[doneWritingResolve] = resolve;\n      this[doneWritingReject] = reject;\n    });\n    this[doneWritingPromise].catch(() => {});\n  }\n}\n\nArrayStream.prototype.getReader = function() {\n  if (this[readingIndex] === undefined) {\n    this[readingIndex] = 0;\n  }\n  return {\n    read: async () => {\n      await this[doneWritingPromise];\n      if (this[readingIndex] === this.length) {\n        return { value: undefined, done: true };\n      }\n      return { value: this[this[readingIndex]++], done: false };\n    }\n  };\n};\n\nArrayStream.prototype.readToEnd = async function(join) {\n  await this[doneWritingPromise];\n  const result = join(this.slice(this[readingIndex]));\n  this.length = 0;\n  return result;\n};\n\nArrayStream.prototype.clone = function() {\n  const clone = new ArrayStream();\n  clone[doneWritingPromise] = this[doneWritingPromise].then(() => {\n    clone.push(...this);\n  });\n  return clone;\n};\n\n/**\n * Check whether data is an ArrayStream\n * @param {Any} input  data to check\n * @returns {boolean}\n */\nfunction isArrayStream(input) {\n  return input && input.getReader && Array.isArray(input);\n}\n\n/**\n * A wrapper class over the native WritableStreamDefaultWriter.\n * It also lets you \"write data to\" array streams instead of streams.\n * @class\n */\nfunction Writer(input) {\n  if (!isArrayStream(input)) {\n    const writer = input.getWriter();\n    const releaseLock = writer.releaseLock;\n    writer.releaseLock = () => {\n      writer.closed.catch(function() {});\n      releaseLock.call(writer);\n    };\n    return writer;\n  }\n  this.stream = input;\n}\n\n/**\n * Write a chunk of data.\n * @returns {Promise<undefined>}\n * @async\n */\nWriter.prototype.write = async function(chunk) {\n  this.stream.push(chunk);\n};\n\n/**\n * Close the stream.\n * @returns {Promise<undefined>}\n * @async\n */\nWriter.prototype.close = async function() {\n  this.stream[doneWritingResolve]();\n};\n\n/**\n * Error the stream.\n * @returns {Promise<Object>}\n * @async\n */\nWriter.prototype.abort = async function(reason) {\n  this.stream[doneWritingReject](reason);\n  return reason;\n};\n\n/**\n * Release the writer's lock.\n * @returns {undefined}\n * @async\n */\nWriter.prototype.releaseLock = function() {};\n\n\nexport { ArrayStream, isArrayStream, Writer, doneWritingPromise };\n","import * as streams from './streams';\nimport { isArrayStream } from './writer';\n\nconst isNode = typeof globalThis.process === 'object' &&\n  typeof globalThis.process.versions === 'object';\n\nconst NodeReadableStream = isNode && require('stream').Readable;\n\n/**\n * Check whether data is a Stream, and if so of which type\n * @param {Any} input  data to check\n * @returns {'web'|'ponyfill'|'node'|'array'|'web-like'|false}\n */\nfunction isStream(input) {\n  if (isArrayStream(input)) {\n    return 'array';\n  }\n  if (globalThis.ReadableStream && globalThis.ReadableStream.prototype.isPrototypeOf(input)) {\n    return 'web';\n  }\n  if (streams.ReadableStream && streams.ReadableStream.prototype.isPrototypeOf(input)) {\n    return 'ponyfill';\n  }\n  if (NodeReadableStream && NodeReadableStream.prototype.isPrototypeOf(input)) {\n    return 'node';\n  }\n  if (input && input.getReader) {\n    return 'web-like';\n  }\n  return false;\n}\n\n/**\n * Check whether data is a Uint8Array\n * @param {Any} input  data to check\n * @returns {Boolean}\n */\nfunction isUint8Array(input) {\n  return Uint8Array.prototype.isPrototypeOf(input);\n}\n\n/**\n * Concat Uint8Arrays\n * @param {Array<Uint8array>} Array of Uint8Arrays to concatenate\n * @returns {Uint8array} Concatenated array\n */\nfunction concatUint8Array(arrays) {\n  if (arrays.length === 1) return arrays[0];\n\n  let totalLength = 0;\n  for (let i = 0; i < arrays.length; i++) {\n    if (!isUint8Array(arrays[i])) {\n      throw new Error('concatUint8Array: Data must be in the form of a Uint8Array');\n    }\n\n    totalLength += arrays[i].length;\n  }\n\n  const result = new Uint8Array(totalLength);\n  let pos = 0;\n  arrays.forEach(function (element) {\n    result.set(element, pos);\n    pos += element.length;\n  });\n\n  return result;\n}\n\nexport { isNode, isStream, isArrayStream, isUint8Array, concatUint8Array };\n","import { isNode } from './util';\nimport * as streams from './streams';\n\nconst NodeBuffer = isNode && require('buffer').Buffer;\nconst NodeReadableStream = isNode && require('stream').Readable;\n\n/**\n * Web / node stream conversion functions\n * From https://github.com/gwicke/node-web-streams\n */\n\nlet nodeToWeb;\nlet webToNode;\n\nif (NodeReadableStream) {\n\n  /**\n   * Convert a Node Readable Stream to a Web ReadableStream\n   * @param {Readable} nodeStream\n   * @returns {ReadableStream}\n   */\n  nodeToWeb = function(nodeStream) {\n    let canceled = false;\n    return new streams.ReadableStream({\n      start(controller) {\n        nodeStream.pause();\n        nodeStream.on('data', chunk => {\n          if (canceled) {\n            return;\n          }\n          if (NodeBuffer.isBuffer(chunk)) {\n            chunk = new Uint8Array(chunk.buffer, chunk.byteOffset, chunk.byteLength);\n          }\n          controller.enqueue(chunk);\n          nodeStream.pause();\n        });\n        nodeStream.on('end', () => {\n          if (canceled) {\n            return;\n          }\n          controller.close();\n        });\n        nodeStream.on('error', e => controller.error(e));\n      },\n      pull() {\n        nodeStream.resume();\n      },\n      cancel(reason) {\n        canceled = true;\n        nodeStream.destroy(reason);\n      }\n    });\n  };\n\n\n  class NodeReadable extends NodeReadableStream {\n    constructor(webStream, options) {\n      super(options);\n      this._reader = streams.getReader(webStream);\n    }\n\n    async _read(size) {\n      try {\n        while (true) {\n          const { done, value } = await this._reader.read();\n          if (done) {\n            this.push(null);\n            break;\n          }\n          if (!this.push(value)) {\n            break;\n          }\n        }\n      } catch (e) {\n        this.destroy(e);\n      }\n    }\n\n    async _destroy(error, callback) {\n      this._reader.cancel(error).then(callback, callback);\n    }\n  }\n\n  /**\n   * Convert a Web ReadableStream to a Node Readable Stream\n   * @param {ReadableStream} webStream\n   * @param {Object} options\n   * @returns {Readable}\n   */\n  webToNode = function(webStream, options) {\n    return new NodeReadable(webStream, options);\n  };\n\n}\n\nexport { nodeToWeb, webToNode };\n","import * as streams from './streams';\nimport { isUint8Array } from './util';\n\nconst doneReadingSet = new WeakSet();\nconst externalBuffer = Symbol('externalBuffer');\n\n/**\n * A wrapper class over the native ReadableStreamDefaultReader.\n * This additionally implements pushing back data on the stream, which\n * lets us implement peeking and a host of convenience functions.\n * It also lets you read data other than streams, such as a Uint8Array.\n * @class\n */\nfunction Reader(input) {\n  this.stream = input;\n  if (input[externalBuffer]) {\n    this[externalBuffer] = input[externalBuffer].slice();\n  }\n  if (streams.isArrayStream(input)) {\n    const reader = input.getReader();\n    this._read = reader.read.bind(reader);\n    this._releaseLock = () => {};\n    this._cancel = async () => {};\n    return;\n  }\n  let streamType = streams.isStream(input);\n  if (streamType === 'node') {\n    input = streams.nodeToWeb(input);\n  }\n  if (streamType) {\n    const reader = input.getReader();\n    this._read = reader.read.bind(reader);\n    this._releaseLock = () => {\n      reader.closed.catch(function() {});\n      reader.releaseLock();\n    };\n    this._cancel = reader.cancel.bind(reader);\n    return;\n  }\n  let doneReading = false;\n  this._read = async () => {\n    if (doneReading || doneReadingSet.has(input)) {\n      return { value: undefined, done: true };\n    }\n    doneReading = true;\n    return { value: input, done: false };\n  };\n  this._releaseLock = () => {\n    if (doneReading) {\n      try {\n        doneReadingSet.add(input);\n      } catch(e) {}\n    }\n  };\n}\n\n/**\n * Read a chunk of data.\n * @returns {Promise<Object>} Either { done: false, value: Uint8Array | String } or { done: true, value: undefined }\n * @async\n */\nReader.prototype.read = async function() {\n  if (this[externalBuffer] && this[externalBuffer].length) {\n    const value = this[externalBuffer].shift();\n    return { done: false, value };\n  }\n  return this._read();\n};\n\n/**\n * Allow others to read the stream.\n */\nReader.prototype.releaseLock = function() {\n  if (this[externalBuffer]) {\n    this.stream[externalBuffer] = this[externalBuffer];\n  }\n  this._releaseLock();\n};\n\n/**\n * Cancel the stream.\n */\nReader.prototype.cancel = function(reason) {\n  return this._cancel(reason);\n};\n\n/**\n * Read up to and including the first \\n character.\n * @returns {Promise<String|Undefined>}\n * @async\n */\nReader.prototype.readLine = async function() {\n  let buffer = [];\n  let returnVal;\n  while (!returnVal) {\n    let { done, value } = await this.read();\n    value += '';\n    if (done) {\n      if (buffer.length) return streams.concat(buffer);\n      return;\n    }\n    const lineEndIndex = value.indexOf('\\n') + 1;\n    if (lineEndIndex) {\n      returnVal = streams.concat(buffer.concat(value.substr(0, lineEndIndex)));\n      buffer = [];\n    }\n    if (lineEndIndex !== value.length) {\n      buffer.push(value.substr(lineEndIndex));\n    }\n  }\n  this.unshift(...buffer);\n  return returnVal;\n};\n\n/**\n * Read a single byte/character.\n * @returns {Promise<Number|String|Undefined>}\n * @async\n */\nReader.prototype.readByte = async function() {\n  const { done, value } = await this.read();\n  if (done) return;\n  const byte = value[0];\n  this.unshift(streams.slice(value, 1));\n  return byte;\n};\n\n/**\n * Read a specific amount of bytes/characters, unless the stream ends before that amount.\n * @returns {Promise<Uint8Array|String|Undefined>}\n * @async\n */\nReader.prototype.readBytes = async function(length) {\n  const buffer = [];\n  let bufferLength = 0;\n  while (true) {\n    const { done, value } = await this.read();\n    if (done) {\n      if (buffer.length) return streams.concat(buffer);\n      return;\n    }\n    buffer.push(value);\n    bufferLength += value.length;\n    if (bufferLength >= length) {\n      const bufferConcat = streams.concat(buffer);\n      this.unshift(streams.slice(bufferConcat, length));\n      return streams.slice(bufferConcat, 0, length);\n    }\n  }\n};\n\n/**\n * Peek (look ahead) a specific amount of bytes/characters, unless the stream ends before that amount.\n * @returns {Promise<Uint8Array|String|Undefined>}\n * @async\n */\nReader.prototype.peekBytes = async function(length) {\n  const bytes = await this.readBytes(length);\n  this.unshift(bytes);\n  return bytes;\n};\n\n/**\n * Push data to the front of the stream.\n * Data must have been read in the last call to read*.\n * @param {...(Uint8Array|String|Undefined)} values\n */\nReader.prototype.unshift = function(...values) {\n  if (!this[externalBuffer]) {\n    this[externalBuffer] = [];\n  }\n  if (\n    values.length === 1 && isUint8Array(values[0]) &&\n    this[externalBuffer].length && values[0].length &&\n    this[externalBuffer][0].byteOffset >= values[0].length\n  ) {\n    this[externalBuffer][0] = new Uint8Array(\n      this[externalBuffer][0].buffer,\n      this[externalBuffer][0].byteOffset - values[0].length,\n      this[externalBuffer][0].byteLength + values[0].length\n    );\n    return;\n  }\n  this[externalBuffer].unshift(...values.filter(value => value && value.length));\n};\n\n/**\n * Read the stream to the end and return its contents, concatenated by the join function (defaults to streams.concat).\n * @param {Function} join\n * @returns {Promise<Uint8array|String|Any>} the return value of join()\n * @async\n */\nReader.prototype.readToEnd = async function(join=streams.concat) {\n  const result = [];\n  while (true) {\n    const { done, value } = await this.read();\n    if (done) break;\n    result.push(value);\n  }\n  return join(result);\n};\n\nexport { Reader, externalBuffer };\n","import { isNode, isStream, isArrayStream, isUint8Array, concatUint8Array } from './util';\nimport { nodeToWeb, webToNode } from './node-conversions';\nimport { Reader, externalBuffer } from './reader';\nimport { ArrayStream, Writer } from './writer';\n\nlet { ReadableStream, WritableStream, TransformStream } = globalThis;\n\nlet toPonyfillReadable, toNativeReadable;\n\nasync function loadStreamsPonyfill() {\n  if (TransformStream) {\n    return;\n  }\n\n  const [ponyfill, adapter] = await Promise.all([\n    import('web-streams-polyfill/ponyfill/es6'),\n    import('@mattiasbuelens/web-streams-adapter')\n  ]);\n\n  ({ ReadableStream, WritableStream, TransformStream } = ponyfill);\n\n  const { createReadableStreamWrapper } = adapter;\n\n  if (globalThis.ReadableStream && ReadableStream !== globalThis.ReadableStream) {\n    toPonyfillReadable = createReadableStreamWrapper(ReadableStream);\n    toNativeReadable = createReadableStreamWrapper(globalThis.ReadableStream);\n  }\n}\n\nconst NodeBuffer = isNode && require('buffer').Buffer;\n\n/**\n * Convert data to Stream\n * @param {ReadableStream|Uint8array|String} input  data to convert\n * @returns {ReadableStream} Converted data\n */\nfunction toStream(input) {\n  let streamType = isStream(input);\n  if (streamType === 'node') {\n    return nodeToWeb(input);\n  }\n  if (streamType === 'web' && toPonyfillReadable) {\n    return toPonyfillReadable(input);\n  }\n  if (streamType) {\n    return input;\n  }\n  return new ReadableStream({\n    start(controller) {\n      controller.enqueue(input);\n      controller.close();\n    }\n  });\n}\n\n/**\n * Convert data to ArrayStream\n * @param {Object} input  data to convert\n * @returns {ArrayStream} Converted data\n */\nfunction toArrayStream(input) {\n  if (isStream(input)) {\n    return input;\n  }\n  const stream = new ArrayStream();\n  (async () => {\n    const writer = getWriter(stream);\n    await writer.write(input);\n    await writer.close();\n  })();\n  return stream;\n}\n\n/**\n * Concat a list of Uint8Arrays, Strings or Streams\n * The caller should not mix Uint8Arrays with Strings, but may mix Streams with non-Streams.\n * @param {Array<Uint8array|String|ReadableStream>} Array of Uint8Arrays/Strings/Streams to concatenate\n * @returns {Uint8array|String|ReadableStream} Concatenated array\n */\nfunction concat(list) {\n  if (list.some(stream => isStream(stream) && !isArrayStream(stream))) {\n    return concatStream(list);\n  }\n  if (list.some(stream => isArrayStream(stream))) {\n    return concatArrayStream(list);\n  }\n  if (typeof list[0] === 'string') {\n    return list.join('');\n  }\n  if (NodeBuffer && NodeBuffer.isBuffer(list[0])) {\n    return NodeBuffer.concat(list);\n  }\n  return concatUint8Array(list);\n}\n\n/**\n * Concat a list of Streams\n * @param {Array<ReadableStream|Uint8array|String>} list  Array of Uint8Arrays/Strings/Streams to concatenate\n * @returns {ReadableStream} Concatenated list\n */\nfunction concatStream(list) {\n  list = list.map(toStream);\n  const transform = transformWithCancel(async function(reason) {\n    await Promise.all(transforms.map(stream => cancel(stream, reason)));\n  });\n  let prev = Promise.resolve();\n  const transforms = list.map((stream, i) => transformPair(stream, (readable, writable) => {\n    prev = prev.then(() => pipe(readable, transform.writable, {\n      preventClose: i !== list.length - 1\n    }));\n    return prev;\n  }));\n  return transform.readable;\n}\n\n/**\n * Concat a list of ArrayStreams\n * @param {Array<ArrayStream|Uint8array|String>} list  Array of Uint8Arrays/Strings/ArrayStreams to concatenate\n * @returns {ArrayStream} Concatenated streams\n */\nfunction concatArrayStream(list) {\n  const result = new ArrayStream();\n  let prev = Promise.resolve();\n  list.forEach((stream, i) => {\n    prev = prev.then(() => pipe(stream, result, {\n      preventClose: i !== list.length - 1\n    }));\n    return prev;\n  });\n  return result;\n}\n\n/**\n * Get a Reader\n * @param {ReadableStream|Uint8array|String} input\n * @returns {Reader}\n */\nfunction getReader(input) {\n  return new Reader(input);\n}\n\n/**\n * Get a Writer\n * @param {WritableStream} input\n * @returns {Writer}\n */\nfunction getWriter(input) {\n  return new Writer(input);\n}\n\n/**\n * Pipe a readable stream to a writable stream. Don't throw on input stream errors, but forward them to the output stream.\n * @param {ReadableStream|Uint8array|String} input\n * @param {WritableStream} target\n * @param {Object} (optional) options\n * @returns {Promise<undefined>} Promise indicating when piping has finished (input stream closed or errored)\n * @async\n */\nasync function pipe(input, target, {\n  preventClose = false,\n  preventAbort = false,\n  preventCancel = false\n} = {}) {\n  if (isStream(input) && !isArrayStream(input)) {\n    input = toStream(input);\n    try {\n      if (input[externalBuffer]) {\n        const writer = getWriter(target);\n        for (let i = 0; i < input[externalBuffer].length; i++) {\n          await writer.ready;\n          await writer.write(input[externalBuffer][i]);\n        }\n        writer.releaseLock();\n      }\n      await input.pipeTo(target, {\n        preventClose,\n        preventAbort,\n        preventCancel\n      });\n    } catch(e) {}\n    return;\n  }\n  input = toArrayStream(input);\n  const reader = getReader(input);\n  const writer = getWriter(target);\n  try {\n    while (true) {\n      await writer.ready;\n      const { done, value } = await reader.read();\n      if (done) {\n        if (!preventClose) await writer.close();\n        break;\n      }\n      await writer.write(value);\n    }\n  } catch (e) {\n    if (!preventAbort) await writer.abort(e);\n  } finally {\n    reader.releaseLock();\n    writer.releaseLock();\n  }\n}\n\n/**\n * Pipe a readable stream through a transform stream.\n * @param {ReadableStream|Uint8array|String} input\n * @param {Object} (optional) options\n * @returns {ReadableStream} transformed stream\n */\nfunction transformRaw(input, options) {\n  const transformStream = new TransformStream(options);\n  pipe(input, transformStream.writable);\n  return transformStream.readable;\n}\n\n/**\n * Create a cancelable TransformStream.\n * @param {Function} cancel\n * @returns {TransformStream}\n */\nfunction transformWithCancel(customCancel) {\n  let pulled = false;\n  let cancelled = false;\n  let backpressureChangePromiseResolve, backpressureChangePromiseReject;\n  let outputController;\n  return {\n    readable: new ReadableStream({\n      start(controller) {\n        outputController = controller;\n      },\n      pull() {\n        if (backpressureChangePromiseResolve) {\n          backpressureChangePromiseResolve();\n        } else {\n          pulled = true;\n        }\n      },\n      async cancel(reason) {\n        cancelled = true;\n        if (customCancel) {\n          await customCancel(reason);\n        }\n        if (backpressureChangePromiseReject) {\n          backpressureChangePromiseReject(reason);\n        }\n      }\n    }, {highWaterMark: 0}),\n    writable: new WritableStream({\n      write: async function(chunk) {\n        if (cancelled) {\n          throw new Error('Stream is cancelled');\n        }\n        outputController.enqueue(chunk);\n        if (!pulled) {\n          await new Promise((resolve, reject) => {\n            backpressureChangePromiseResolve = resolve;\n            backpressureChangePromiseReject = reject;\n          });\n          backpressureChangePromiseResolve = null;\n          backpressureChangePromiseReject = null;\n        } else {\n          pulled = false;\n        }\n      },\n      close: outputController.close.bind(outputController),\n      abort: outputController.error.bind(outputController)\n    })\n  };\n}\n\n/**\n * Transform a stream using helper functions which are called on each chunk, and on stream close, respectively.\n * @param {ReadableStream|Uint8array|String} input\n * @param {Function} process\n * @param {Function} finish\n * @returns {ReadableStream|Uint8array|String}\n */\nfunction transform(input, process = () => undefined, finish = () => undefined) {\n  if (isArrayStream(input)) {\n    const output = new ArrayStream();\n    (async () => {\n      const writer = getWriter(output);\n      try {\n        const data = await readToEnd(input);\n        const result1 = process(data);\n        const result2 = finish();\n        let result;\n        if (result1 !== undefined && result2 !== undefined) result = concat([result1, result2]);\n        else result = result1 !== undefined ? result1 : result2;\n        await writer.write(result);\n        await writer.close();\n      } catch (e) {\n        await writer.abort(e);\n      }\n    })();\n    return output;\n  }\n  if (isStream(input)) {\n    return transformRaw(input, {\n      async transform(value, controller) {\n        try {\n          const result = await process(value);\n          if (result !== undefined) controller.enqueue(result);\n        } catch(e) {\n          controller.error(e);\n        }\n      },\n      async flush(controller) {\n        try {\n          const result = await finish();\n          if (result !== undefined) controller.enqueue(result);\n        } catch(e) {\n          controller.error(e);\n        }\n      }\n    });\n  }\n  const result1 = process(input);\n  const result2 = finish();\n  if (result1 !== undefined && result2 !== undefined) return concat([result1, result2]);\n  return result1 !== undefined ? result1 : result2;\n}\n\n/**\n * Transform a stream using a helper function which is passed a readable and a writable stream.\n *   This function also maintains the possibility to cancel the input stream,\n *   and does so on cancelation of the output stream, despite cancelation\n *   normally being impossible when the input stream is being read from.\n * @param {ReadableStream|Uint8array|String} input\n * @param {Function} fn\n * @returns {ReadableStream}\n */\nfunction transformPair(input, fn) {\n  if (isStream(input) && !isArrayStream(input)) {\n    let incomingTransformController;\n    const incoming = new TransformStream({\n      start(controller) {\n        incomingTransformController = controller;\n      }\n    });\n\n    const pipeDonePromise = pipe(input, incoming.writable);\n\n    const outgoing = transformWithCancel(async function(reason) {\n      incomingTransformController.error(reason);\n      await pipeDonePromise;\n      await new Promise(setTimeout);\n    });\n    fn(incoming.readable, outgoing.writable);\n    return outgoing.readable;\n  }\n  input = toArrayStream(input);\n  const output = new ArrayStream();\n  fn(input, output);\n  return output;\n}\n\n/**\n * Parse a stream using a helper function which is passed a Reader.\n *   The reader additionally has a remainder() method which returns a\n *   stream pointing to the remainder of input, and is linked to input\n *   for cancelation.\n * @param {ReadableStream|Uint8array|String} input\n * @param {Function} fn\n * @returns {Any} the return value of fn()\n */\nfunction parse(input, fn) {\n  let returnValue;\n  const transformed = transformPair(input, (readable, writable) => {\n    const reader = getReader(readable);\n    reader.remainder = () => {\n      reader.releaseLock();\n      pipe(readable, writable);\n      return transformed;\n    };\n    returnValue = fn(reader);\n  });\n  return returnValue;\n}\n\n/**\n * Tee a Stream for reading it twice. The input stream can no longer be read after tee()ing.\n *   Reading either of the two returned streams will pull from the input stream.\n *   The input stream will only be canceled if both of the returned streams are canceled.\n * @param {ReadableStream|Uint8array|String} input\n * @returns {Array<ReadableStream|Uint8array|String>} array containing two copies of input\n */\nfunction tee(input) {\n  if (isArrayStream(input)) {\n    throw new Error('ArrayStream cannot be tee()d, use clone() instead');\n  }\n  if (isStream(input)) {\n    const teed = toStream(input).tee();\n    teed[0][externalBuffer] = teed[1][externalBuffer] = input[externalBuffer];\n    return teed;\n  }\n  return [slice(input), slice(input)];\n}\n\n/**\n * Clone a Stream for reading it twice. The input stream can still be read after clone()ing.\n *   Reading from the clone will pull from the input stream.\n *   The input stream will only be canceled if both the clone and the input stream are canceled.\n * @param {ReadableStream|Uint8array|String} input\n * @returns {ReadableStream|Uint8array|String} cloned input\n */\nfunction clone(input) {\n  if (isArrayStream(input)) {\n    return input.clone();\n  }\n  if (isStream(input)) {\n    const teed = tee(input);\n    overwrite(input, teed[0]);\n    return teed[1];\n  }\n  return slice(input);\n}\n\n/**\n * Clone a Stream for reading it twice. Data will arrive at the same rate as the input stream is being read.\n *   Reading from the clone will NOT pull from the input stream. Data only arrives when reading the input stream.\n *   The input stream will NOT be canceled if the clone is canceled, only if the input stream are canceled.\n *   If the input stream is canceled, the clone will be errored.\n * @param {ReadableStream|Uint8array|String} input\n * @returns {ReadableStream|Uint8array|String} cloned input\n */\nfunction passiveClone(input) {\n  if (isArrayStream(input)) {\n    return clone(input);\n  }\n  if (isStream(input)) {\n    return new ReadableStream({\n      start(controller) {\n        const transformed = transformPair(input, async (readable, writable) => {\n          const reader = getReader(readable);\n          const writer = getWriter(writable);\n          try {\n            while (true) {\n              await writer.ready;\n              const { done, value } = await reader.read();\n              if (done) {\n                try { controller.close(); } catch(e) {}\n                await writer.close();\n                return;\n              }\n              try { controller.enqueue(value); } catch(e) {}\n              await writer.write(value);\n            }\n          } catch(e) {\n            controller.error(e);\n            await writer.abort(e);\n          }\n        });\n        overwrite(input, transformed);\n      }\n    });\n  }\n  return slice(input);\n}\n\n/**\n * Modify a stream object to point to a different stream object.\n *   This is used internally by clone() and passiveClone() to provide an abstraction over tee().\n * @param {ReadableStream} input\n * @param {ReadableStream} clone\n */\nfunction overwrite(input, clone) {\n  // Overwrite input.getReader, input.locked, etc to point to clone\n  Object.entries(Object.getOwnPropertyDescriptors(input.constructor.prototype)).forEach(([name, descriptor]) => {\n    if (name === 'constructor') {\n      return;\n    }\n    if (descriptor.value) {\n      descriptor.value = descriptor.value.bind(clone);\n    } else {\n      descriptor.get = descriptor.get.bind(clone);\n    }\n    Object.defineProperty(input, name, descriptor);\n  });\n}\n\n/**\n * Return a stream pointing to a part of the input stream.\n * @param {ReadableStream|Uint8array|String} input\n * @returns {ReadableStream|Uint8array|String} clone\n */\nfunction slice(input, begin=0, end=Infinity) {\n  if (isArrayStream(input)) {\n    throw new Error('Not implemented');\n  }\n  if (isStream(input)) {\n    if (begin >= 0 && end >= 0) {\n      let bytesRead = 0;\n      return transformRaw(input, {\n        transform(value, controller) {\n          if (bytesRead < end) {\n            if (bytesRead + value.length >= begin) {\n              controller.enqueue(slice(value, Math.max(begin - bytesRead, 0), end - bytesRead));\n            }\n            bytesRead += value.length;\n          } else {\n            controller.terminate();\n          }\n        }\n      });\n    }\n    if (begin < 0 && (end < 0 || end === Infinity)) {\n      let lastBytes = [];\n      return transform(input, value => {\n        if (value.length >= -begin) lastBytes = [value];\n        else lastBytes.push(value);\n      }, () => slice(concat(lastBytes), begin, end));\n    }\n    if (begin === 0 && end < 0) {\n      let lastBytes;\n      return transform(input, value => {\n        const returnValue = lastBytes ? concat([lastBytes, value]) : value;\n        if (returnValue.length >= -end) {\n          lastBytes = slice(returnValue, end);\n          return slice(returnValue, begin, end);\n        } else {\n          lastBytes = returnValue;\n        }\n      });\n    }\n    console.warn(`stream.slice(input, ${begin}, ${end}) not implemented efficiently.`);\n    return fromAsync(async () => slice(await readToEnd(input), begin, end));\n  }\n  if (input[externalBuffer]) {\n    input = concat(input[externalBuffer].concat([input]));\n  }\n  if (isUint8Array(input) && !(NodeBuffer && NodeBuffer.isBuffer(input))) {\n    if (end === Infinity) end = input.length;\n    return input.subarray(begin, end);\n  }\n  return input.slice(begin, end);\n}\n\n/**\n * Read a stream to the end and return its contents, concatenated by the join function (defaults to concat).\n * @param {ReadableStream|Uint8array|String} input\n * @param {Function} join\n * @returns {Promise<Uint8array|String|Any>} the return value of join()\n * @async\n */\nasync function readToEnd(input, join=concat) {\n  if (isArrayStream(input)) {\n    return input.readToEnd(join);\n  }\n  if (isStream(input)) {\n    return getReader(input).readToEnd(join);\n  }\n  return input;\n}\n\n/**\n * Cancel a stream.\n * @param {ReadableStream|Uint8array|String} input\n * @param {Any} reason\n * @returns {Promise<Any>} indicates when the stream has been canceled\n * @async\n */\nasync function cancel(input, reason) {\n  if (isStream(input)) {\n    if (input.cancel) {\n      return input.cancel(reason);\n    }\n    if (input.destroy) {\n      input.destroy(reason);\n      await new Promise(setTimeout);\n      return reason;\n    }\n  }\n}\n\n/**\n * Convert an async function to an ArrayStream. When the function returns, its return value is written to the stream.\n * @param {Function} fn\n * @returns {ArrayStream}\n */\nfunction fromAsync(fn) {\n  const arrayStream = new ArrayStream();\n  (async () => {\n    const writer = getWriter(arrayStream);\n    try {\n      await writer.write(await fn());\n      await writer.close();\n    } catch (e) {\n      await writer.abort(e);\n    }\n  })();\n  return arrayStream;\n}\n\n\nexport { ReadableStream, WritableStream, TransformStream, ArrayStream, loadStreamsPonyfill, isStream, isArrayStream, isUint8Array, toStream, toPonyfillReadable, toNativeReadable, concatUint8Array, concatStream, concat, getReader, getWriter, pipe, transformRaw, transform, transformPair, parse, clone, passiveClone, slice, readToEnd, cancel, fromAsync, nodeToWeb, webToNode };\n","/* eslint-disable new-cap */\n\n/**\n * @fileoverview\n * BigInteger implementation of basic operations\n * that wraps the native BigInt library.\n * Operations are not constant time,\n * but we try and limit timing leakage where we can\n * @module biginteger/native\n * @private\n */\n\n/**\n * @private\n */\nexport default class BigInteger {\n  /**\n   * Get a BigInteger (input must be big endian for strings and arrays)\n   * @param {Number|String|Uint8Array} n - Value to convert\n   * @throws {Error} on null or undefined input\n   */\n  constructor(n) {\n    if (n === undefined) {\n      throw new Error('Invalid BigInteger input');\n    }\n\n    if (n instanceof Uint8Array) {\n      const bytes = n;\n      const hex = new Array(bytes.length);\n      for (let i = 0; i < bytes.length; i++) {\n        const hexByte = bytes[i].toString(16);\n        hex[i] = (bytes[i] <= 0xF) ? ('0' + hexByte) : hexByte;\n      }\n      this.value = BigInt('0x0' + hex.join(''));\n    } else {\n      this.value = BigInt(n);\n    }\n  }\n\n  clone() {\n    return new BigInteger(this.value);\n  }\n\n  /**\n   * BigInteger increment in place\n   */\n  iinc() {\n    this.value++;\n    return this;\n  }\n\n  /**\n   * BigInteger increment\n   * @returns {BigInteger} this + 1.\n   */\n  inc() {\n    return this.clone().iinc();\n  }\n\n  /**\n   * BigInteger decrement in place\n   */\n  idec() {\n    this.value--;\n    return this;\n  }\n\n  /**\n   * BigInteger decrement\n   * @returns {BigInteger} this - 1.\n   */\n  dec() {\n    return this.clone().idec();\n  }\n\n  /**\n   * BigInteger addition in place\n   * @param {BigInteger} x - Value to add\n   */\n  iadd(x) {\n    this.value += x.value;\n    return this;\n  }\n\n  /**\n   * BigInteger addition\n   * @param {BigInteger} x - Value to add\n   * @returns {BigInteger} this + x.\n   */\n  add(x) {\n    return this.clone().iadd(x);\n  }\n\n  /**\n   * BigInteger subtraction in place\n   * @param {BigInteger} x - Value to subtract\n   */\n  isub(x) {\n    this.value -= x.value;\n    return this;\n  }\n\n  /**\n   * BigInteger subtraction\n   * @param {BigInteger} x - Value to subtract\n   * @returns {BigInteger} this - x.\n   */\n  sub(x) {\n    return this.clone().isub(x);\n  }\n\n  /**\n   * BigInteger multiplication in place\n   * @param {BigInteger} x - Value to multiply\n   */\n  imul(x) {\n    this.value *= x.value;\n    return this;\n  }\n\n  /**\n   * BigInteger multiplication\n   * @param {BigInteger} x - Value to multiply\n   * @returns {BigInteger} this * x.\n   */\n  mul(x) {\n    return this.clone().imul(x);\n  }\n\n  /**\n   * Compute value modulo m, in place\n   * @param {BigInteger} m - Modulo\n   */\n  imod(m) {\n    this.value %= m.value;\n    if (this.isNegative()) {\n      this.iadd(m);\n    }\n    return this;\n  }\n\n  /**\n   * Compute value modulo m\n   * @param {BigInteger} m - Modulo\n   * @returns {BigInteger} this mod m.\n   */\n  mod(m) {\n    return this.clone().imod(m);\n  }\n\n  /**\n   * Compute modular exponentiation using square and multiply\n   * @param {BigInteger} e - Exponent\n   * @param {BigInteger} n - Modulo\n   * @returns {BigInteger} this ** e mod n.\n   */\n  modExp(e, n) {\n    if (n.isZero()) throw Error('Modulo cannot be zero');\n    if (n.isOne()) return new BigInteger(0);\n    if (e.isNegative()) throw Error('Unsopported negative exponent');\n\n    let exp = e.value;\n    let x = this.value;\n\n    x %= n.value;\n    let r = BigInt(1);\n    while (exp > BigInt(0)) {\n      const lsb = exp & BigInt(1);\n      exp >>= BigInt(1); // e / 2\n      // Always compute multiplication step, to reduce timing leakage\n      const rx = (r * x) % n.value;\n      // Update r only if lsb is 1 (odd exponent)\n      r = lsb ? rx : r;\n      x = (x * x) % n.value; // Square\n    }\n    return new BigInteger(r);\n  }\n\n\n  /**\n   * Compute the inverse of this value modulo n\n   * Note: this and and n must be relatively prime\n   * @param {BigInteger} n - Modulo\n   * @returns {BigInteger} x such that this*x = 1 mod n\n   * @throws {Error} if the inverse does not exist\n   */\n  modInv(n) {\n    const { gcd, x } = this._egcd(n);\n    if (!gcd.isOne()) {\n      throw new Error('Inverse does not exist');\n    }\n    return x.add(n).mod(n);\n  }\n\n  /**\n   * Extended Eucleadian algorithm (http://anh.cs.luc.edu/331/notes/xgcd.pdf)\n   * Given a = this and b, compute (x, y) such that ax + by = gdc(a, b)\n   * @param {BigInteger} b - Second operand\n   * @returns {{ gcd, x, y: BigInteger }}\n   */\n  _egcd(b) {\n    let x = BigInt(0);\n    let y = BigInt(1);\n    let xPrev = BigInt(1);\n    let yPrev = BigInt(0);\n\n    let a = this.value;\n    b = b.value;\n\n    while (b !== BigInt(0)) {\n      const q = a / b;\n      let tmp = x;\n      x = xPrev - q * x;\n      xPrev = tmp;\n\n      tmp = y;\n      y = yPrev - q * y;\n      yPrev = tmp;\n\n      tmp = b;\n      b = a % b;\n      a = tmp;\n    }\n\n    return {\n      x: new BigInteger(xPrev),\n      y: new BigInteger(yPrev),\n      gcd: new BigInteger(a)\n    };\n  }\n\n  /**\n   * Compute greatest common divisor between this and n\n   * @param {BigInteger} b - Operand\n   * @returns {BigInteger} gcd\n   */\n  gcd(b) {\n    let a = this.value;\n    b = b.value;\n    while (b !== BigInt(0)) {\n      const tmp = b;\n      b = a % b;\n      a = tmp;\n    }\n    return new BigInteger(a);\n  }\n\n  /**\n   * Shift this to the left by x, in place\n   * @param {BigInteger} x - Shift value\n   */\n  ileftShift(x) {\n    this.value <<= x.value;\n    return this;\n  }\n\n  /**\n   * Shift this to the left by x\n   * @param {BigInteger} x - Shift value\n   * @returns {BigInteger} this << x.\n   */\n  leftShift(x) {\n    return this.clone().ileftShift(x);\n  }\n\n  /**\n   * Shift this to the right by x, in place\n   * @param {BigInteger} x - Shift value\n   */\n  irightShift(x) {\n    this.value >>= x.value;\n    return this;\n  }\n\n  /**\n   * Shift this to the right by x\n   * @param {BigInteger} x - Shift value\n   * @returns {BigInteger} this >> x.\n   */\n  rightShift(x) {\n    return this.clone().irightShift(x);\n  }\n\n  /**\n   * Whether this value is equal to x\n   * @param {BigInteger} x\n   * @returns {Boolean}\n   */\n  equal(x) {\n    return this.value === x.value;\n  }\n\n  /**\n   * Whether this value is less than x\n   * @param {BigInteger} x\n   * @returns {Boolean}\n   */\n  lt(x) {\n    return this.value < x.value;\n  }\n\n  /**\n   * Whether this value is less than or equal to x\n   * @param {BigInteger} x\n   * @returns {Boolean}\n   */\n  lte(x) {\n    return this.value <= x.value;\n  }\n\n  /**\n   * Whether this value is greater than x\n   * @param {BigInteger} x\n   * @returns {Boolean}\n   */\n  gt(x) {\n    return this.value > x.value;\n  }\n\n  /**\n   * Whether this value is greater than or equal to x\n   * @param {BigInteger} x\n   * @returns {Boolean}\n   */\n  gte(x) {\n    return this.value >= x.value;\n  }\n\n  isZero() {\n    return this.value === BigInt(0);\n  }\n\n  isOne() {\n    return this.value === BigInt(1);\n  }\n\n  isNegative() {\n    return this.value < BigInt(0);\n  }\n\n  isEven() {\n    return !(this.value & BigInt(1));\n  }\n\n  abs() {\n    const res = this.clone();\n    if (this.isNegative()) {\n      res.value = -res.value;\n    }\n    return res;\n  }\n\n  /**\n   * Get this value as a string\n   * @returns {String} this value.\n   */\n  toString() {\n    return this.value.toString();\n  }\n\n  /**\n   * Get this value as an exact Number (max 53 bits)\n   * Fails if this value is too large\n   * @returns {Number}\n   */\n  toNumber() {\n    const number = Number(this.value);\n    if (number > Number.MAX_SAFE_INTEGER) {\n      // We throw and error to conform with the bn.js implementation\n      throw new Error('Number can only safely store up to 53 bits');\n    }\n    return number;\n  }\n\n  /**\n   * Get value of i-th bit\n   * @param {Number} i - Bit index\n   * @returns {Number} Bit value.\n   */\n  getBit(i) {\n    const bit = (this.value >> BigInt(i)) & BigInt(1);\n    return (bit === BigInt(0)) ? 0 : 1;\n  }\n\n  /**\n   * Compute bit length\n   * @returns {Number} Bit length.\n   */\n  bitLength() {\n    const zero = new BigInteger(0);\n    const one = new BigInteger(1);\n    const negOne = new BigInteger(-1);\n\n    // -1n >> -1n is -1n\n    // 1n >> 1n is 0n\n    const target = this.isNegative() ? negOne : zero;\n    let bitlen = 1;\n    const tmp = this.clone();\n    while (!tmp.irightShift(one).equal(target)) {\n      bitlen++;\n    }\n    return bitlen;\n  }\n\n  /**\n   * Compute byte length\n   * @returns {Number} Byte length.\n   */\n  byteLength() {\n    const zero = new BigInteger(0);\n    const negOne = new BigInteger(-1);\n\n    const target = this.isNegative() ? negOne : zero;\n    const eight = new BigInteger(8);\n    let len = 1;\n    const tmp = this.clone();\n    while (!tmp.irightShift(eight).equal(target)) {\n      len++;\n    }\n    return len;\n  }\n\n  /**\n   * Get Uint8Array representation of this number\n   * @param {String} endian - Endianess of output array (defaults to 'be')\n   * @param {Number} length - Of output array\n   * @returns {Uint8Array}\n   */\n  toUint8Array(endian = 'be', length) {\n    // we get and parse the hex string (https://coolaj86.com/articles/convert-js-bigints-to-typedarrays/)\n    // this is faster than shift+mod iterations\n    let hex = this.value.toString(16);\n    if (hex.length % 2 === 1) {\n      hex = '0' + hex;\n    }\n\n    const rawLength = hex.length / 2;\n    const bytes = new Uint8Array(length || rawLength);\n    // parse hex\n    const offset = length ? (length - rawLength) : 0;\n    let i = 0;\n    while (i < rawLength) {\n      bytes[i + offset] = parseInt(hex.slice(2 * i, 2 * i + 2), 16);\n      i++;\n    }\n\n    if (endian !== 'be') {\n      bytes.reverse();\n    }\n\n    return bytes;\n  }\n}\n","import BigInteger from './native.interface';\n\nconst detectBigInt = () => typeof BigInt !== 'undefined';\n\nasync function getBigInteger() {\n  if (detectBigInt()) {\n    return BigInteger;\n  } else {\n    const { default: BigInteger } = await import('./bn.interface');\n    return BigInteger;\n  }\n}\n\nexport { getBigInteger };\n","/**\n * @module enums\n */\n\nconst byValue = Symbol('byValue');\n\nexport default {\n\n  /** Maps curve names under various standards to one\n   * @see {@link https://wiki.gnupg.org/ECC|ECC - GnuPG wiki}\n   * @enum {String}\n   * @readonly\n   */\n  curve: {\n    /** NIST P-256 Curve */\n    'p256':                'p256',\n    'P-256':               'p256',\n    'secp256r1':           'p256',\n    'prime256v1':          'p256',\n    '1.2.840.10045.3.1.7': 'p256',\n    '2a8648ce3d030107':    'p256',\n    '2A8648CE3D030107':    'p256',\n\n    /** NIST P-384 Curve */\n    'p384':         'p384',\n    'P-384':        'p384',\n    'secp384r1':    'p384',\n    '1.3.132.0.34': 'p384',\n    '2b81040022':   'p384',\n    '2B81040022':   'p384',\n\n    /** NIST P-521 Curve */\n    'p521':         'p521',\n    'P-521':        'p521',\n    'secp521r1':    'p521',\n    '1.3.132.0.35': 'p521',\n    '2b81040023':   'p521',\n    '2B81040023':   'p521',\n\n    /** SECG SECP256k1 Curve */\n    'secp256k1':    'secp256k1',\n    '1.3.132.0.10': 'secp256k1',\n    '2b8104000a':   'secp256k1',\n    '2B8104000A':   'secp256k1',\n\n    /** Ed25519 - deprecated by crypto-refresh (replaced by standaone Ed25519 algo) */\n    'ed25519Legacy':          'ed25519',\n    'ED25519':                'ed25519',\n    /** @deprecated use `ed25519Legacy` instead */\n    'ed25519':                'ed25519',\n    'Ed25519':                'ed25519',\n    '1.3.6.1.4.1.11591.15.1': 'ed25519',\n    '2b06010401da470f01':     'ed25519',\n    '2B06010401DA470F01':     'ed25519',\n\n    /** Curve25519 - deprecated by crypto-refresh (replaced by standaone X25519 algo) */\n    'curve25519Legacy':       'curve25519',\n    'X25519':                 'curve25519',\n    'cv25519':                'curve25519',\n    /** @deprecated use `curve25519Legacy` instead */\n    'curve25519':             'curve25519',\n    'Curve25519':             'curve25519',\n    '1.3.6.1.4.1.3029.1.5.1': 'curve25519',\n    '2b060104019755010501':   'curve25519',\n    '2B060104019755010501':   'curve25519',\n\n    /** BrainpoolP256r1 Curve */\n    'brainpoolP256r1':       'brainpoolP256r1',\n    '1.3.36.3.3.2.8.1.1.7':  'brainpoolP256r1',\n    '2b2403030208010107':    'brainpoolP256r1',\n    '2B2403030208010107':    'brainpoolP256r1',\n\n    /** BrainpoolP384r1 Curve */\n    'brainpoolP384r1':       'brainpoolP384r1',\n    '1.3.36.3.3.2.8.1.1.11': 'brainpoolP384r1',\n    '2b240303020801010b':    'brainpoolP384r1',\n    '2B240303020801010B':    'brainpoolP384r1',\n\n    /** BrainpoolP512r1 Curve */\n    'brainpoolP512r1':       'brainpoolP512r1',\n    '1.3.36.3.3.2.8.1.1.13': 'brainpoolP512r1',\n    '2b240303020801010d':    'brainpoolP512r1',\n    '2B240303020801010D':    'brainpoolP512r1'\n  },\n\n  /** A string to key specifier type\n   * @enum {Integer}\n   * @readonly\n   */\n  s2k: {\n    simple: 0,\n    salted: 1,\n    iterated: 3,\n    gnu: 101\n  },\n\n  /** {@link https://tools.ietf.org/html/draft-ietf-openpgp-crypto-refresh-08.html#section-9.1|crypto-refresh RFC, section 9.1}\n   * @enum {Integer}\n   * @readonly\n   */\n  publicKey: {\n    /** RSA (Encrypt or Sign) [HAC] */\n    rsaEncryptSign: 1,\n    /** RSA (Encrypt only) [HAC] */\n    rsaEncrypt: 2,\n    /** RSA (Sign only) [HAC] */\n    rsaSign: 3,\n    /** Elgamal (Encrypt only) [ELGAMAL] [HAC] */\n    elgamal: 16,\n    /** DSA (Sign only) [FIPS186] [HAC] */\n    dsa: 17,\n    /** ECDH (Encrypt only) [RFC6637] */\n    ecdh: 18,\n    /** ECDSA (Sign only) [RFC6637] */\n    ecdsa: 19,\n    /** EdDSA (Sign only) - deprecated by crypto-refresh (replaced by `ed25519` identifier below)\n     * [{@link https://tools.ietf.org/html/draft-koch-eddsa-for-openpgp-04|Draft RFC}] */\n    eddsaLegacy: 22, // NB: this is declared before `eddsa` to translate 22 to 'eddsa' for backwards compatibility\n    /** @deprecated use `eddsaLegacy` instead */\n    ed25519Legacy: 22,\n    /** @deprecated use `eddsaLegacy` instead */\n    eddsa: 22,\n    /** Reserved for AEDH */\n    aedh: 23,\n    /** Reserved for AEDSA */\n    aedsa: 24,\n    /** X25519 (Encrypt only) */\n    x25519: 25,\n    /** X448 (Encrypt only) */\n    x448: 26,\n    /** Ed25519 (Sign only) */\n    ed25519: 27,\n    /** Ed448 (Sign only) */\n    ed448: 28\n  },\n\n  /** {@link https://tools.ietf.org/html/rfc4880#section-9.2|RFC4880, section 9.2}\n   * @enum {Integer}\n   * @readonly\n   */\n  symmetric: {\n    plaintext: 0,\n    /** Not implemented! */\n    idea: 1,\n    tripledes: 2,\n    cast5: 3,\n    blowfish: 4,\n    aes128: 7,\n    aes192: 8,\n    aes256: 9,\n    twofish: 10\n  },\n\n  /** {@link https://tools.ietf.org/html/rfc4880#section-9.3|RFC4880, section 9.3}\n   * @enum {Integer}\n   * @readonly\n   */\n  compression: {\n    uncompressed: 0,\n    /** RFC1951 */\n    zip: 1,\n    /** RFC1950 */\n    zlib: 2,\n    bzip2: 3\n  },\n\n  /** {@link https://tools.ietf.org/html/rfc4880#section-9.4|RFC4880, section 9.4}\n   * @enum {Integer}\n   * @readonly\n   */\n  hash: {\n    md5: 1,\n    sha1: 2,\n    ripemd: 3,\n    sha256: 8,\n    sha384: 9,\n    sha512: 10,\n    sha224: 11\n  },\n\n  /** A list of hash names as accepted by webCrypto functions.\n   * {@link https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/digest|Parameters, algo}\n   * @enum {String}\n   */\n  webHash: {\n    'SHA-1': 2,\n    'SHA-256': 8,\n    'SHA-384': 9,\n    'SHA-512': 10\n  },\n\n  /** {@link https://tools.ietf.org/html/draft-ietf-openpgp-rfc4880bis-04#section-9.6|RFC4880bis-04, section 9.6}\n   * @enum {Integer}\n   * @readonly\n   */\n  aead: {\n    eax: 1,\n    ocb: 2,\n    experimentalGCM: 100 // Private algorithm\n  },\n\n  /** A list of packet types and numeric tags associated with them.\n   * @enum {Integer}\n   * @readonly\n   */\n  packet: {\n    publicKeyEncryptedSessionKey: 1,\n    signature: 2,\n    symEncryptedSessionKey: 3,\n    onePassSignature: 4,\n    secretKey: 5,\n    publicKey: 6,\n    secretSubkey: 7,\n    compressedData: 8,\n    symmetricallyEncryptedData: 9,\n    marker: 10,\n    literalData: 11,\n    trust: 12,\n    userID: 13,\n    publicSubkey: 14,\n    userAttribute: 17,\n    symEncryptedIntegrityProtectedData: 18,\n    modificationDetectionCode: 19,\n    aeadEncryptedData: 20 // see IETF draft: https://tools.ietf.org/html/draft-ford-openpgp-format-00#section-2.1\n  },\n\n  /** Data types in the literal packet\n   * @enum {Integer}\n   * @readonly\n   */\n  literal: {\n    /** Binary data 'b' */\n    binary: 'b'.charCodeAt(),\n    /** Text data 't' */\n    text: 't'.charCodeAt(),\n    /** Utf8 data 'u' */\n    utf8: 'u'.charCodeAt(),\n    /** MIME message body part 'm' */\n    mime: 'm'.charCodeAt()\n  },\n\n\n  /** One pass signature packet type\n   * @enum {Integer}\n   * @readonly\n   */\n  signature: {\n    /** 0x00: Signature of a binary document. */\n    binary: 0,\n    /** 0x01: Signature of a canonical text document.\n     *\n     * Canonicalyzing the document by converting line endings. */\n    text: 1,\n    /** 0x02: Standalone signature.\n     *\n     * This signature is a signature of only its own subpacket contents.\n     * It is calculated identically to a signature over a zero-lengh\n     * binary document.  Note that it doesn't make sense to have a V3\n     * standalone signature. */\n    standalone: 2,\n    /** 0x10: Generic certification of a User ID and Public-Key packet.\n     *\n     * The issuer of this certification does not make any particular\n     * assertion as to how well the certifier has checked that the owner\n     * of the key is in fact the person described by the User ID. */\n    certGeneric: 16,\n    /** 0x11: Persona certification of a User ID and Public-Key packet.\n     *\n     * The issuer of this certification has not done any verification of\n     * the claim that the owner of this key is the User ID specified. */\n    certPersona: 17,\n    /** 0x12: Casual certification of a User ID and Public-Key packet.\n     *\n     * The issuer of this certification has done some casual\n     * verification of the claim of identity. */\n    certCasual: 18,\n    /** 0x13: Positive certification of a User ID and Public-Key packet.\n     *\n     * The issuer of this certification has done substantial\n     * verification of the claim of identity.\n     *\n     * Most OpenPGP implementations make their \"key signatures\" as 0x10\n     * certifications.  Some implementations can issue 0x11-0x13\n     * certifications, but few differentiate between the types. */\n    certPositive: 19,\n    /** 0x30: Certification revocation signature\n     *\n     * This signature revokes an earlier User ID certification signature\n     * (signature class 0x10 through 0x13) or direct-key signature\n     * (0x1F).  It should be issued by the same key that issued the\n     * revoked signature or an authorized revocation key.  The signature\n     * is computed over the same data as the certificate that it\n     * revokes, and should have a later creation date than that\n     * certificate. */\n    certRevocation: 48,\n    /** 0x18: Subkey Binding Signature\n     *\n     * This signature is a statement by the top-level signing key that\n     * indicates that it owns the subkey.  This signature is calculated\n     * directly on the primary key and subkey, and not on any User ID or\n     * other packets.  A signature that binds a signing subkey MUST have\n     * an Embedded Signature subpacket in this binding signature that\n     * contains a 0x19 signature made by the signing subkey on the\n     * primary key and subkey. */\n    subkeyBinding: 24,\n    /** 0x19: Primary Key Binding Signature\n     *\n     * This signature is a statement by a signing subkey, indicating\n     * that it is owned by the primary key and subkey.  This signature\n     * is calculated the same way as a 0x18 signature: directly on the\n     * primary key and subkey, and not on any User ID or other packets.\n     *\n     * When a signature is made over a key, the hash data starts with the\n     * octet 0x99, followed by a two-octet length of the key, and then body\n     * of the key packet.  (Note that this is an old-style packet header for\n     * a key packet with two-octet length.)  A subkey binding signature\n     * (type 0x18) or primary key binding signature (type 0x19) then hashes\n     * the subkey using the same format as the main key (also using 0x99 as\n     * the first octet). */\n    keyBinding: 25,\n    /** 0x1F: Signature directly on a key\n     *\n     * This signature is calculated directly on a key.  It binds the\n     * information in the Signature subpackets to the key, and is\n     * appropriate to be used for subpackets that provide information\n     * about the key, such as the Revocation Key subpacket.  It is also\n     * appropriate for statements that non-self certifiers want to make\n     * about the key itself, rather than the binding between a key and a\n     * name. */\n    key: 31,\n    /** 0x20: Key revocation signature\n     *\n     * The signature is calculated directly on the key being revoked.  A\n     * revoked key is not to be used.  Only revocation signatures by the\n     * key being revoked, or by an authorized revocation key, should be\n     * considered valid revocation signatures.a */\n    keyRevocation: 32,\n    /** 0x28: Subkey revocation signature\n     *\n     * The signature is calculated directly on the subkey being revoked.\n     * A revoked subkey is not to be used.  Only revocation signatures\n     * by the top-level signature key that is bound to this subkey, or\n     * by an authorized revocation key, should be considered valid\n     * revocation signatures.\n     *\n     * Key revocation signatures (types 0x20 and 0x28)\n     * hash only the key being revoked. */\n    subkeyRevocation: 40,\n    /** 0x40: Timestamp signature.\n     * This signature is only meaningful for the timestamp contained in\n     * it. */\n    timestamp: 64,\n    /** 0x50: Third-Party Confirmation signature.\n     *\n     * This signature is a signature over some other OpenPGP Signature\n     * packet(s).  It is analogous to a notary seal on the signed data.\n     * A third-party signature SHOULD include Signature Target\n     * subpacket(s) to give easy identification.  Note that we really do\n     * mean SHOULD.  There are plausible uses for this (such as a blind\n     * party that only sees the signature, not the key or source\n     * document) that cannot include a target subpacket. */\n    thirdParty: 80\n  },\n\n  /** Signature subpacket type\n   * @enum {Integer}\n   * @readonly\n   */\n  signatureSubpacket: {\n    signatureCreationTime: 2,\n    signatureExpirationTime: 3,\n    exportableCertification: 4,\n    trustSignature: 5,\n    regularExpression: 6,\n    revocable: 7,\n    keyExpirationTime: 9,\n    placeholderBackwardsCompatibility: 10,\n    preferredSymmetricAlgorithms: 11,\n    revocationKey: 12,\n    issuer: 16,\n    notationData: 20,\n    preferredHashAlgorithms: 21,\n    preferredCompressionAlgorithms: 22,\n    keyServerPreferences: 23,\n    preferredKeyServer: 24,\n    primaryUserID: 25,\n    policyURI: 26,\n    keyFlags: 27,\n    signersUserID: 28,\n    reasonForRevocation: 29,\n    features: 30,\n    signatureTarget: 31,\n    embeddedSignature: 32,\n    issuerFingerprint: 33,\n    preferredAEADAlgorithms: 34\n  },\n\n  /** Key flags\n   * @enum {Integer}\n   * @readonly\n   */\n  keyFlags: {\n    /** 0x01 - This key may be used to certify other keys. */\n    certifyKeys: 1,\n    /** 0x02 - This key may be used to sign data. */\n    signData: 2,\n    /** 0x04 - This key may be used to encrypt communications. */\n    encryptCommunication: 4,\n    /** 0x08 - This key may be used to encrypt storage. */\n    encryptStorage: 8,\n    /** 0x10 - The private component of this key may have been split\n     *        by a secret-sharing mechanism. */\n    splitPrivateKey: 16,\n    /** 0x20 - This key may be used for authentication. */\n    authentication: 32,\n    /** 0x80 - The private component of this key may be in the\n     *        possession of more than one person. */\n    sharedPrivateKey: 128\n  },\n\n  /** Armor type\n   * @enum {Integer}\n   * @readonly\n   */\n  armor: {\n    multipartSection: 0,\n    multipartLast: 1,\n    signed: 2,\n    message: 3,\n    publicKey: 4,\n    privateKey: 5,\n    signature: 6\n  },\n\n  /** {@link https://tools.ietf.org/html/rfc4880#section-5.2.3.23|RFC4880, section 5.2.3.23}\n   * @enum {Integer}\n   * @readonly\n   */\n  reasonForRevocation: {\n    /** No reason specified (key revocations or cert revocations) */\n    noReason: 0,\n    /** Key is superseded (key revocations) */\n    keySuperseded: 1,\n    /** Key material has been compromised (key revocations) */\n    keyCompromised: 2,\n    /** Key is retired and no longer used (key revocations) */\n    keyRetired: 3,\n    /** User ID information is no longer valid (cert revocations) */\n    userIDInvalid: 32\n  },\n\n  /** {@link https://tools.ietf.org/html/draft-ietf-openpgp-rfc4880bis-04#section-5.2.3.25|RFC4880bis-04, section 5.2.3.25}\n   * @enum {Integer}\n   * @readonly\n   */\n  features: {\n    /** 0x01 - Modification Detection (packets 18 and 19) */\n    modificationDetection: 1,\n    /** 0x02 - AEAD Encrypted Data Packet (packet 20) and version 5\n     *         Symmetric-Key Encrypted Session Key Packets (packet 3) */\n    aead: 2,\n    /** 0x04 - Version 5 Public-Key Packet format and corresponding new\n      *        fingerprint format */\n    v5Keys: 4\n  },\n\n  /**\n   * Asserts validity of given value and converts from string/integer to integer.\n   * @param {Object} type target enum type\n   * @param {String|Integer} e value to check and/or convert\n   * @returns {Integer} enum value if it exists\n   * @throws {Error} if the value is invalid\n   */\n  write: function(type, e) {\n    if (typeof e === 'number') {\n      e = this.read(type, e);\n    }\n\n    if (type[e] !== undefined) {\n      return type[e];\n    }\n\n    throw new Error('Invalid enum value.');\n  },\n\n  /**\n   * Converts enum integer value to the corresponding string, if it exists.\n   * @param {Object} type target enum type\n   * @param {Integer} e value to convert\n   * @returns {String} name of enum value if it exists\n   * @throws {Error} if the value is invalid\n   */\n  read: function(type, e) {\n    if (!type[byValue]) {\n      type[byValue] = [];\n      Object.entries(type).forEach(([key, value]) => {\n        type[byValue][value] = key;\n      });\n    }\n\n    if (type[byValue][e] !== undefined) {\n      return type[byValue][e];\n    }\n\n    throw new Error('Invalid enum value.');\n  }\n};\n","// GPG4Browsers - An OpenPGP implementation in javascript\n// Copyright (C) 2011 Recurity Labs GmbH\n//\n// This library is free software; you can redistribute it and/or\n// modify it under the terms of the GNU Lesser General Public\n// License as published by the Free Software Foundation; either\n// version 3.0 of the License, or (at your option) any later version.\n//\n// This library is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n// Lesser General Public License for more details.\n//\n// You should have received a copy of the GNU Lesser General Public\n// License along with this library; if not, write to the Free Software\n// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n\n/* eslint-disable no-console */\n\n/**\n * This object contains utility functions\n * @module util\n * @private\n */\n\nimport * as stream from '@openpgp/web-stream-tools';\nimport { getBigInteger } from './biginteger';\nimport enums from './enums';\n\nconst debugMode = (() => {\n  try {\n    return process.env.NODE_ENV === 'development'; // eslint-disable-line no-process-env\n  } catch (e) {}\n  return false;\n})();\n\nconst util = {\n  isString: function(data) {\n    return typeof data === 'string' || data instanceof String;\n  },\n\n  isArray: function(data) {\n    return data instanceof Array;\n  },\n\n  isUint8Array: stream.isUint8Array,\n\n  isStream: stream.isStream,\n\n  readNumber: function (bytes) {\n    let n = 0;\n    for (let i = 0; i < bytes.length; i++) {\n      n += (256 ** i) * bytes[bytes.length - 1 - i];\n    }\n    return n;\n  },\n\n  writeNumber: function (n, bytes) {\n    const b = new Uint8Array(bytes);\n    for (let i = 0; i < bytes; i++) {\n      b[i] = (n >> (8 * (bytes - i - 1))) & 0xFF;\n    }\n\n    return b;\n  },\n\n  readDate: function (bytes) {\n    const n = util.readNumber(bytes);\n    const d = new Date(n * 1000);\n    return d;\n  },\n\n  writeDate: function (time) {\n    const numeric = Math.floor(time.getTime() / 1000);\n\n    return util.writeNumber(numeric, 4);\n  },\n\n  normalizeDate: function (time = Date.now()) {\n    return time === null || time === Infinity ? time : new Date(Math.floor(+time / 1000) * 1000);\n  },\n\n  /**\n   * Read one MPI from bytes in input\n   * @param {Uint8Array} bytes - Input data to parse\n   * @returns {Uint8Array} Parsed MPI.\n   */\n  readMPI: function (bytes) {\n    const bits = (bytes[0] << 8) | bytes[1];\n    const bytelen = (bits + 7) >>> 3;\n    return bytes.subarray(2, 2 + bytelen);\n  },\n\n  /**\n   * Left-pad Uint8Array to length by adding 0x0 bytes\n   * @param {Uint8Array} bytes - Data to pad\n   * @param {Number} length - Padded length\n   * @returns {Uint8Array} Padded bytes.\n   */\n  leftPad(bytes, length) {\n    const padded = new Uint8Array(length);\n    const offset = length - bytes.length;\n    padded.set(bytes, offset);\n    return padded;\n  },\n\n  /**\n   * Convert a Uint8Array to an MPI-formatted Uint8Array.\n   * @param {Uint8Array} bin - An array of 8-bit integers to convert\n   * @returns {Uint8Array} MPI-formatted Uint8Array.\n   */\n  uint8ArrayToMPI: function (bin) {\n    const bitSize = util.uint8ArrayBitLength(bin);\n    if (bitSize === 0) {\n      throw new Error('Zero MPI');\n    }\n    const stripped = bin.subarray(bin.length - Math.ceil(bitSize / 8));\n    const prefix = new Uint8Array([(bitSize & 0xFF00) >> 8, bitSize & 0xFF]);\n    return util.concatUint8Array([prefix, stripped]);\n  },\n\n  /**\n   * Return bit length of the input data\n   * @param {Uint8Array} bin input data (big endian)\n   * @returns bit length\n   */\n  uint8ArrayBitLength: function (bin) {\n    let i; // index of leading non-zero byte\n    for (i = 0; i < bin.length; i++) if (bin[i] !== 0) break;\n    if (i === bin.length) {\n      return 0;\n    }\n    const stripped = bin.subarray(i);\n    return (stripped.length - 1) * 8 + util.nbits(stripped[0]);\n  },\n\n  /**\n   * Convert a hex string to an array of 8-bit integers\n   * @param {String} hex - A hex string to convert\n   * @returns {Uint8Array} An array of 8-bit integers.\n   */\n  hexToUint8Array: function (hex) {\n    const result = new Uint8Array(hex.length >> 1);\n    for (let k = 0; k < hex.length >> 1; k++) {\n      result[k] = parseInt(hex.substr(k << 1, 2), 16);\n    }\n    return result;\n  },\n\n  /**\n   * Convert an array of 8-bit integers to a hex string\n   * @param {Uint8Array} bytes - Array of 8-bit integers to convert\n   * @returns {String} Hexadecimal representation of the array.\n   */\n  uint8ArrayToHex: function (bytes) {\n    const r = [];\n    const e = bytes.length;\n    let c = 0;\n    let h;\n    while (c < e) {\n      h = bytes[c++].toString(16);\n      while (h.length < 2) {\n        h = '0' + h;\n      }\n      r.push('' + h);\n    }\n    return r.join('');\n  },\n\n  /**\n   * Convert a string to an array of 8-bit integers\n   * @param {String} str - String to convert\n   * @returns {Uint8Array} An array of 8-bit integers.\n   */\n  stringToUint8Array: function (str) {\n    return stream.transform(str, str => {\n      if (!util.isString(str)) {\n        throw new Error('stringToUint8Array: Data must be in the form of a string');\n      }\n\n      const result = new Uint8Array(str.length);\n      for (let i = 0; i < str.length; i++) {\n        result[i] = str.charCodeAt(i);\n      }\n      return result;\n    });\n  },\n\n  /**\n   * Convert an array of 8-bit integers to a string\n   * @param {Uint8Array} bytes - An array of 8-bit integers to convert\n   * @returns {String} String representation of the array.\n   */\n  uint8ArrayToString: function (bytes) {\n    bytes = new Uint8Array(bytes);\n    const result = [];\n    const bs = 1 << 14;\n    const j = bytes.length;\n\n    for (let i = 0; i < j; i += bs) {\n      result.push(String.fromCharCode.apply(String, bytes.subarray(i, i + bs < j ? i + bs : j)));\n    }\n    return result.join('');\n  },\n\n  /**\n   * Convert a native javascript string to a Uint8Array of utf8 bytes\n   * @param {String|ReadableStream} str - The string to convert\n   * @returns {Uint8Array|ReadableStream} A valid squence of utf8 bytes.\n   */\n  encodeUTF8: function (str) {\n    const encoder = new TextEncoder('utf-8');\n    // eslint-disable-next-line no-inner-declarations\n    function process(value, lastChunk = false) {\n      return encoder.encode(value, { stream: !lastChunk });\n    }\n    return stream.transform(str, process, () => process('', true));\n  },\n\n  /**\n   * Convert a Uint8Array of utf8 bytes to a native javascript string\n   * @param {Uint8Array|ReadableStream} utf8 - A valid squence of utf8 bytes\n   * @returns {String|ReadableStream} A native javascript string.\n   */\n  decodeUTF8: function (utf8) {\n    const decoder = new TextDecoder('utf-8');\n    // eslint-disable-next-line no-inner-declarations\n    function process(value, lastChunk = false) {\n      return decoder.decode(value, { stream: !lastChunk });\n    }\n    return stream.transform(utf8, process, () => process(new Uint8Array(), true));\n  },\n\n  /**\n   * Concat a list of Uint8Arrays, Strings or Streams\n   * The caller must not mix Uint8Arrays with Strings, but may mix Streams with non-Streams.\n   * @param {Array<Uint8Array|String|ReadableStream>} Array - Of Uint8Arrays/Strings/Streams to concatenate\n   * @returns {Uint8Array|String|ReadableStream} Concatenated array.\n   */\n  concat: stream.concat,\n\n  /**\n   * Concat Uint8Arrays\n   * @param {Array<Uint8Array>} Array - Of Uint8Arrays to concatenate\n   * @returns {Uint8Array} Concatenated array.\n   */\n  concatUint8Array: stream.concatUint8Array,\n\n  /**\n   * Check Uint8Array equality\n   * @param {Uint8Array} array1 - First array\n   * @param {Uint8Array} array2 - Second array\n   * @returns {Boolean} Equality.\n   */\n  equalsUint8Array: function (array1, array2) {\n    if (!util.isUint8Array(array1) || !util.isUint8Array(array2)) {\n      throw new Error('Data must be in the form of a Uint8Array');\n    }\n\n    if (array1.length !== array2.length) {\n      return false;\n    }\n\n    for (let i = 0; i < array1.length; i++) {\n      if (array1[i] !== array2[i]) {\n        return false;\n      }\n    }\n    return true;\n  },\n\n  /**\n   * Calculates a 16bit sum of a Uint8Array by adding each character\n   * codes modulus 65535\n   * @param {Uint8Array} Uint8Array - To create a sum of\n   * @returns {Uint8Array} 2 bytes containing the sum of all charcodes % 65535.\n   */\n  writeChecksum: function (text) {\n    let s = 0;\n    for (let i = 0; i < text.length; i++) {\n      s = (s + text[i]) & 0xFFFF;\n    }\n    return util.writeNumber(s, 2);\n  },\n\n  /**\n   * Helper function to print a debug message. Debug\n   * messages are only printed if\n   * @param {String} str - String of the debug message\n   */\n  printDebug: function (str) {\n    if (debugMode) {\n      console.log('[OpenPGP.js debug]', str);\n    }\n  },\n\n  /**\n   * Helper function to print a debug error. Debug\n   * messages are only printed if\n   * @param {String} str - String of the debug message\n   */\n  printDebugError: function (error) {\n    if (debugMode) {\n      console.error('[OpenPGP.js debug]', error);\n    }\n  },\n\n  // returns bit length of the integer x\n  nbits: function (x) {\n    let r = 1;\n    let t = x >>> 16;\n    if (t !== 0) {\n      x = t;\n      r += 16;\n    }\n    t = x >> 8;\n    if (t !== 0) {\n      x = t;\n      r += 8;\n    }\n    t = x >> 4;\n    if (t !== 0) {\n      x = t;\n      r += 4;\n    }\n    t = x >> 2;\n    if (t !== 0) {\n      x = t;\n      r += 2;\n    }\n    t = x >> 1;\n    if (t !== 0) {\n      x = t;\n      r += 1;\n    }\n    return r;\n  },\n\n  /**\n   * If S[1] == 0, then double(S) == (S[2..128] || 0);\n   * otherwise, double(S) == (S[2..128] || 0) xor\n   * (zeros(120) || 10000111).\n   *\n   * Both OCB and EAX (through CMAC) require this function to be constant-time.\n   *\n   * @param {Uint8Array} data\n   */\n  double: function(data) {\n    const doubleVar = new Uint8Array(data.length);\n    const last = data.length - 1;\n    for (let i = 0; i < last; i++) {\n      doubleVar[i] = (data[i] << 1) ^ (data[i + 1] >> 7);\n    }\n    doubleVar[last] = (data[last] << 1) ^ ((data[0] >> 7) * 0x87);\n    return doubleVar;\n  },\n\n  /**\n   * Shift a Uint8Array to the right by n bits\n   * @param {Uint8Array} array - The array to shift\n   * @param {Integer} bits - Amount of bits to shift (MUST be smaller\n   * than 8)\n   * @returns {String} Resulting array.\n   */\n  shiftRight: function (array, bits) {\n    if (bits) {\n      for (let i = array.length - 1; i >= 0; i--) {\n        array[i] >>= bits;\n        if (i > 0) {\n          array[i] |= (array[i - 1] << (8 - bits));\n        }\n      }\n    }\n    return array;\n  },\n\n  /**\n   * Get native Web Cryptography api, only the current version of the spec.\n   * @returns {Object} The SubtleCrypto api or 'undefined'.\n   */\n  getWebCrypto: function() {\n    return typeof globalThis !== 'undefined' && globalThis.crypto && globalThis.crypto.subtle;\n  },\n\n  /**\n   * Get BigInteger class\n   * It wraps the native BigInt type if it's available\n   * Otherwise it relies on bn.js\n   * @returns {BigInteger}\n   * @async\n   */\n  getBigInteger,\n\n  /**\n   * Get native Node.js crypto api.\n   * @returns {Object} The crypto module or 'undefined'.\n   */\n  getNodeCrypto: function() {\n    return require('crypto');\n  },\n\n  getNodeZlib: function() {\n    return require('zlib');\n  },\n\n  /**\n   * Get native Node.js Buffer constructor. This should be used since\n   * Buffer is not available under browserify.\n   * @returns {Function} The Buffer constructor or 'undefined'.\n   */\n  getNodeBuffer: function() {\n    return (require('buffer') || {}).Buffer;\n  },\n\n  getHardwareConcurrency: function() {\n    if (typeof navigator !== 'undefined') {\n      return navigator.hardwareConcurrency || 1;\n    }\n\n    const os = require('os'); // Assume we're on Node.js.\n    return os.cpus().length;\n  },\n\n  isEmailAddress: function(data) {\n    if (!util.isString(data)) {\n      return false;\n    }\n    const re = /^(([^<>()[\\]\\\\.,;:\\s@\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+([a-zA-Z]{2,}[0-9]*|xn--[a-zA-Z\\-0-9]+)))$/;\n    return re.test(data);\n  },\n\n  /**\n   * Normalize line endings to <CR><LF>\n   * Support any encoding where CR=0x0D, LF=0x0A\n   */\n  canonicalizeEOL: function(data) {\n    const CR = 13;\n    const LF = 10;\n    let carryOverCR = false;\n\n    return stream.transform(data, bytes => {\n      if (carryOverCR) {\n        bytes = util.concatUint8Array([new Uint8Array([CR]), bytes]);\n      }\n\n      if (bytes[bytes.length - 1] === CR) {\n        carryOverCR = true;\n        bytes = bytes.subarray(0, -1);\n      } else {\n        carryOverCR = false;\n      }\n\n      let index;\n      const indices = [];\n      for (let i = 0; ; i = index) {\n        index = bytes.indexOf(LF, i) + 1;\n        if (index) {\n          if (bytes[index - 2] !== CR) indices.push(index);\n        } else {\n          break;\n        }\n      }\n      if (!indices.length) {\n        return bytes;\n      }\n\n      const normalized = new Uint8Array(bytes.length + indices.length);\n      let j = 0;\n      for (let i = 0; i < indices.length; i++) {\n        const sub = bytes.subarray(indices[i - 1] || 0, indices[i]);\n        normalized.set(sub, j);\n        j += sub.length;\n        normalized[j - 1] = CR;\n        normalized[j] = LF;\n        j++;\n      }\n      normalized.set(bytes.subarray(indices[indices.length - 1] || 0), j);\n      return normalized;\n    }, () => (carryOverCR ? new Uint8Array([CR]) : undefined));\n  },\n\n  /**\n   * Convert line endings from canonicalized <CR><LF> to native <LF>\n   * Support any encoding where CR=0x0D, LF=0x0A\n   */\n  nativeEOL: function(data) {\n    const CR = 13;\n    const LF = 10;\n    let carryOverCR = false;\n\n    return stream.transform(data, bytes => {\n      if (carryOverCR && bytes[0] !== LF) {\n        bytes = util.concatUint8Array([new Uint8Array([CR]), bytes]);\n      } else {\n        bytes = new Uint8Array(bytes); // Don't mutate passed bytes\n      }\n\n      if (bytes[bytes.length - 1] === CR) {\n        carryOverCR = true;\n        bytes = bytes.subarray(0, -1);\n      } else {\n        carryOverCR = false;\n      }\n\n      let index;\n      let j = 0;\n      for (let i = 0; i !== bytes.length; i = index) {\n        index = bytes.indexOf(CR, i) + 1;\n        if (!index) index = bytes.length;\n        const last = index - (bytes[index] === LF ? 1 : 0);\n        if (i) bytes.copyWithin(j, i, last);\n        j += last - i;\n      }\n      return bytes.subarray(0, j);\n    }, () => (carryOverCR ? new Uint8Array([CR]) : undefined));\n  },\n\n  /**\n   * Remove trailing spaces, carriage returns and tabs from each line\n   */\n  removeTrailingSpaces: function(text) {\n    return text.split('\\n').map(line => {\n      let i = line.length - 1;\n      for (; i >= 0 && (line[i] === ' ' || line[i] === '\\t' || line[i] === '\\r'); i--);\n      return line.substr(0, i + 1);\n    }).join('\\n');\n  },\n\n  wrapError: function(message, error) {\n    if (!error) {\n      return new Error(message);\n    }\n\n    // update error message\n    try {\n      error.message = message + ': ' + error.message;\n    } catch (e) {}\n\n    return error;\n  },\n\n  /**\n   * Map allowed packet tags to corresponding classes\n   * Meant to be used to format `allowedPacket` for Packetlist.read\n   * @param {Array<Object>} allowedClasses\n   * @returns {Object} map from enum.packet to corresponding *Packet class\n   */\n  constructAllowedPackets: function(allowedClasses) {\n    const map = {};\n    allowedClasses.forEach(PacketClass => {\n      if (!PacketClass.tag) {\n        throw new Error('Invalid input: expected a packet class');\n      }\n      map[PacketClass.tag] = PacketClass;\n    });\n    return map;\n  },\n\n  /**\n   * Return a Promise that will resolve as soon as one of the promises in input resolves\n   * or will reject if all input promises all rejected\n   * (similar to Promise.any, but with slightly different error handling)\n   * @param {Array<Promise>} promises\n   * @return {Promise<Any>} Promise resolving to the result of the fastest fulfilled promise\n   *                          or rejected with the Error of the last resolved Promise (if all promises are rejected)\n   */\n  anyPromise: function(promises) {\n    // eslint-disable-next-line no-async-promise-executor\n    return new Promise(async (resolve, reject) => {\n      let exception;\n      await Promise.all(promises.map(async promise => {\n        try {\n          resolve(await promise);\n        } catch (e) {\n          exception = e;\n        }\n      }));\n      reject(exception);\n    });\n  },\n\n  /**\n   * Return either `a` or `b` based on `cond`, in algorithmic constant time.\n   * @param {Boolean} cond\n   * @param {Uint8Array} a\n   * @param {Uint8Array} b\n   * @returns `a` if `cond` is true, `b` otherwise\n   */\n  selectUint8Array: function(cond, a, b) {\n    const length = Math.max(a.length, b.length);\n    const result = new Uint8Array(length);\n    let end = 0;\n    for (let i = 0; i < result.length; i++) {\n      result[i] = (a[i] & (256 - cond)) | (b[i] & (255 + cond));\n      end += (cond & i < a.length) | ((1 - cond) & i < b.length);\n    }\n    return result.subarray(0, end);\n  },\n  /**\n   * Return either `a` or `b` based on `cond`, in algorithmic constant time.\n   * NB: it only supports `a, b` with values between 0-255.\n   * @param {Boolean} cond\n   * @param {Uint8} a\n   * @param {Uint8} b\n   * @returns `a` if `cond` is true, `b` otherwise\n   */\n  selectUint8: function(cond, a, b) {\n    return (a & (256 - cond)) | (b & (255 + cond));\n  },\n  /**\n   * @param {module:enums.symmetric} cipherAlgo\n   */\n  isAES: function(cipherAlgo) {\n    return cipherAlgo === enums.symmetric.aes128 || cipherAlgo === enums.symmetric.aes192 || cipherAlgo === enums.symmetric.aes256;\n  }\n};\n\nexport default util;\n","/* OpenPGP radix-64/base64 string encoding/decoding\n * Copyright 2005 Herbert Hanewinkel, www.haneWIN.de\n * version 1.0, check www.haneWIN.de for the latest version\n *\n * This software is provided as-is, without express or implied warranty.\n * Permission to use, copy, modify, distribute or sell this software, with or\n * without fee, for any purpose and by any individual or organization, is hereby\n * granted, provided that the above copyright notice and this paragraph appear\n * in all copies. Distribution as a part of an application or binary must\n * include the above copyright notice in the documentation and/or other materials\n * provided with the application or distribution.\n */\n\n/**\n * @module encoding/base64\n * @private\n */\n\nimport * as stream from '@openpgp/web-stream-tools';\nimport util from '../util';\n\nconst Buffer = util.getNodeBuffer();\n\nlet encodeChunk;\nlet decodeChunk;\nif (Buffer) {\n  encodeChunk = buf => Buffer.from(buf).toString('base64');\n  decodeChunk = str => {\n    const b = Buffer.from(str, 'base64');\n    return new Uint8Array(b.buffer, b.byteOffset, b.byteLength);\n  };\n} else {\n  encodeChunk = buf => btoa(util.uint8ArrayToString(buf));\n  decodeChunk = str => util.stringToUint8Array(atob(str));\n}\n\n/**\n * Convert binary array to radix-64\n * @param {Uint8Array | ReadableStream<Uint8Array>} data - Uint8Array to convert\n * @returns {String | ReadableStream<String>} Radix-64 version of input string.\n * @static\n */\nexport function encode(data) {\n  let buf = new Uint8Array();\n  return stream.transform(data, value => {\n    buf = util.concatUint8Array([buf, value]);\n    const r = [];\n    const bytesPerLine = 45; // 60 chars per line * (3 bytes / 4 chars of base64).\n    const lines = Math.floor(buf.length / bytesPerLine);\n    const bytes = lines * bytesPerLine;\n    const encoded = encodeChunk(buf.subarray(0, bytes));\n    for (let i = 0; i < lines; i++) {\n      r.push(encoded.substr(i * 60, 60));\n      r.push('\\n');\n    }\n    buf = buf.subarray(bytes);\n    return r.join('');\n  }, () => (buf.length ? encodeChunk(buf) + '\\n' : ''));\n}\n\n/**\n * Convert radix-64 to binary array\n * @param {String | ReadableStream<String>} data - Radix-64 string to convert\n * @returns {Uint8Array | ReadableStream<Uint8Array>} Binary array version of input string.\n * @static\n */\nexport function decode(data) {\n  let buf = '';\n  return stream.transform(data, value => {\n    buf += value;\n\n    // Count how many whitespace characters there are in buf\n    let spaces = 0;\n    const spacechars = [' ', '\\t', '\\r', '\\n'];\n    for (let i = 0; i < spacechars.length; i++) {\n      const spacechar = spacechars[i];\n      for (let pos = buf.indexOf(spacechar); pos !== -1; pos = buf.indexOf(spacechar, pos + 1)) {\n        spaces++;\n      }\n    }\n\n    // Backtrack until we have 4n non-whitespace characters\n    // that we can safely base64-decode\n    let length = buf.length;\n    for (; length > 0 && (length - spaces) % 4 !== 0; length--) {\n      if (spacechars.includes(buf[length])) spaces--;\n    }\n\n    const decoded = decodeChunk(buf.substr(0, length));\n    buf = buf.substr(length);\n    return decoded;\n  }, () => decodeChunk(buf));\n}\n\n/**\n * Convert a Base-64 encoded string an array of 8-bit integer\n *\n * Note: accepts both Radix-64 and URL-safe strings\n * @param {String} base64 - Base-64 encoded string to convert\n * @returns {Uint8Array} An array of 8-bit integers.\n */\nexport function b64ToUint8Array(base64) {\n  return decode(base64.replace(/-/g, '+').replace(/_/g, '/'));\n}\n\n/**\n * Convert an array of 8-bit integer to a Base-64 encoded string\n * @param {Uint8Array} bytes - An array of 8-bit integers to convert\n * @param {bool} url - If true, output is URL-safe\n * @returns {String} Base-64 encoded string.\n */\nexport function uint8ArrayToB64(bytes, url) {\n  let encoded = encode(bytes).replace(/[\\r\\n]/g, '');\n  if (url) {\n    encoded = encoded.replace(/[+]/g, '-').replace(/[/]/g, '_').replace(/[=]/g, '');\n  }\n  return encoded;\n}\n","// GPG4Browsers - An OpenPGP implementation in javascript\n// Copyright (C) 2011 Recurity Labs GmbH\n//\n// This library is free software; you can redistribute it and/or\n// modify it under the terms of the GNU Lesser General Public\n// License as published by the Free Software Foundation; either\n// version 3.0 of the License, or (at your option) any later version.\n//\n// This library is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n// Lesser General Public License for more details.\n//\n// You should have received a copy of the GNU Lesser General Public\n// License along with this library; if not, write to the Free Software\n// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n\n/**\n * Global configuration values.\n */\n\nimport enums from '../enums';\n\nexport default {\n  /**\n   * @memberof module:config\n   * @property {Integer} preferredHashAlgorithm Default hash algorithm {@link module:enums.hash}\n   */\n  preferredHashAlgorithm: enums.hash.sha256,\n  /**\n   * @memberof module:config\n   * @property {Integer} preferredSymmetricAlgorithm Default encryption cipher {@link module:enums.symmetric}\n   */\n  preferredSymmetricAlgorithm: enums.symmetric.aes256,\n  /**\n   * @memberof module:config\n   * @property {Integer} compression Default compression algorithm {@link module:enums.compression}\n   */\n  preferredCompressionAlgorithm: enums.compression.uncompressed,\n  /**\n   * @memberof module:config\n   * @property {Integer} deflateLevel Default zip/zlib compression level, between 1 and 9\n   */\n  deflateLevel: 6,\n\n  /**\n   * Use Authenticated Encryption with Additional Data (AEAD) protection for symmetric encryption.\n   * Note: not all OpenPGP implementations are compatible with this option.\n   * **FUTURE OPENPGP.JS VERSIONS MAY BREAK COMPATIBILITY WHEN USING THIS OPTION**\n   * @see {@link https://tools.ietf.org/html/draft-ietf-openpgp-rfc4880bis-07|RFC4880bis-07}\n   * @memberof module:config\n   * @property {Boolean} aeadProtect\n   */\n  aeadProtect: false,\n  /**\n   * Default Authenticated Encryption with Additional Data (AEAD) encryption mode\n   * Only has an effect when aeadProtect is set to true.\n   * @memberof module:config\n   * @property {Integer} preferredAEADAlgorithm Default AEAD mode {@link module:enums.aead}\n   */\n  preferredAEADAlgorithm: enums.aead.eax,\n  /**\n   * Chunk Size Byte for Authenticated Encryption with Additional Data (AEAD) mode\n   * Only has an effect when aeadProtect is set to true.\n   * Must be an integer value from 0 to 56.\n   * @memberof module:config\n   * @property {Integer} aeadChunkSizeByte\n   */\n  aeadChunkSizeByte: 12,\n  /**\n   * Use V5 keys.\n   * Note: not all OpenPGP implementations are compatible with this option.\n   * **FUTURE OPENPGP.JS VERSIONS MAY BREAK COMPATIBILITY WHEN USING THIS OPTION**\n   * @memberof module:config\n   * @property {Boolean} v5Keys\n   */\n  v5Keys: false,\n  /**\n   * {@link https://tools.ietf.org/html/rfc4880#section-3.7.1.3|RFC4880 3.7.1.3}:\n   * Iteration Count Byte for S2K (String to Key)\n   * @memberof module:config\n   * @property {Integer} s2kIterationCountByte\n   */\n  s2kIterationCountByte: 224,\n  /**\n   * Allow decryption of messages without integrity protection.\n   * This is an **insecure** setting:\n   *  - message modifications cannot be detected, thus processing the decrypted data is potentially unsafe.\n   *  - it enables downgrade attacks against integrity-protected messages.\n   * @memberof module:config\n   * @property {Boolean} allowUnauthenticatedMessages\n   */\n  allowUnauthenticatedMessages: false,\n  /**\n   * Allow streaming unauthenticated data before its integrity has been checked. This would allow the application to\n   * process large streams while limiting memory usage by releasing the decrypted chunks as soon as possible\n   * and deferring checking their integrity until the decrypted stream has been read in full.\n   *\n   * This setting is **insecure** if the partially decrypted message is processed further or displayed to the user.\n   * @memberof module:config\n   * @property {Boolean} allowUnauthenticatedStream\n   */\n  allowUnauthenticatedStream: false,\n  /**\n   * @memberof module:config\n   * @property {Boolean} checksumRequired Do not throw error when armor is missing a checksum\n   */\n  checksumRequired: false,\n  /**\n   * Minimum RSA key size allowed for key generation and message signing, verification and encryption.\n   * The default is 2047 since due to a bug, previous versions of OpenPGP.js could generate 2047-bit keys instead of 2048-bit ones.\n   * @memberof module:config\n   * @property {Number} minRSABits\n   */\n  minRSABits: 2047,\n  /**\n   * Work-around for rare GPG decryption bug when encrypting with multiple passwords.\n   * **Slower and slightly less secure**\n   * @memberof module:config\n   * @property {Boolean} passwordCollisionCheck\n   */\n  passwordCollisionCheck: false,\n  /**\n   * @memberof module:config\n   * @property {Boolean} revocationsExpire If true, expired revocation signatures are ignored\n   */\n  revocationsExpire: false,\n  /**\n   * Allow decryption using RSA keys without `encrypt` flag.\n   * This setting is potentially insecure, but it is needed to get around an old openpgpjs bug\n   * where key flags were ignored when selecting a key for encryption.\n   * @memberof module:config\n   * @property {Boolean} allowInsecureDecryptionWithSigningKeys\n   */\n  allowInsecureDecryptionWithSigningKeys: false,\n  /**\n   * Allow verification of message signatures with keys whose validity at the time of signing cannot be determined.\n   * Instead, a verification key will also be consider valid as long as it is valid at the current time.\n   * This setting is potentially insecure, but it is needed to verify messages signed with keys that were later reformatted,\n   * and have self-signature's creation date that does not match the primary key creation date.\n   * @memberof module:config\n   * @property {Boolean} allowInsecureDecryptionWithSigningKeys\n   */\n  allowInsecureVerificationWithReformattedKeys: false,\n\n  /**\n   * Enable constant-time decryption of RSA- and ElGamal-encrypted session keys, to hinder Bleichenbacher-like attacks (https://link.springer.com/chapter/10.1007/BFb0055716).\n   * This setting has measurable performance impact and it is only helpful in application scenarios where both of the following conditions apply:\n   * - new/incoming messages are automatically decrypted (without user interaction);\n   * - an attacker can determine how long it takes to decrypt each message (e.g. due to decryption errors being logged remotely).\n   * See also `constantTimePKCS1DecryptionSupportedSymmetricAlgorithms`.\n   * @memberof module:config\n   * @property {Boolean} constantTimePKCS1Decryption\n   */\n  constantTimePKCS1Decryption: false,\n  /**\n   * This setting is only meaningful if `constantTimePKCS1Decryption` is enabled.\n   * Decryption of RSA- and ElGamal-encrypted session keys of symmetric algorithms different from the ones specified here will fail.\n   * However, the more algorithms are added, the slower the decryption procedure becomes.\n   * @memberof module:config\n   * @property {Set<Integer>} constantTimePKCS1DecryptionSupportedSymmetricAlgorithms {@link module:enums.symmetric}\n   */\n  constantTimePKCS1DecryptionSupportedSymmetricAlgorithms: new Set([enums.symmetric.aes128, enums.symmetric.aes192, enums.symmetric.aes256]),\n\n  /**\n   * @memberof module:config\n   * @property {Integer} minBytesForWebCrypto The minimum amount of bytes for which to use native WebCrypto APIs when available\n   */\n  minBytesForWebCrypto: 1000,\n  /**\n   * @memberof module:config\n   * @property {Boolean} ignoreUnsupportedPackets Ignore unsupported/unrecognizable packets on parsing instead of throwing an error\n   */\n  ignoreUnsupportedPackets: true,\n  /**\n   * @memberof module:config\n   * @property {Boolean} ignoreMalformedPackets Ignore malformed packets on parsing instead of throwing an error\n   */\n  ignoreMalformedPackets: false,\n  /**\n   * Parsing of packets is normally restricted to a predefined set of packets. For example a Sym. Encrypted Integrity Protected Data Packet can only\n   * contain a certain set of packets including LiteralDataPacket. With this setting we can allow additional packets, which is probably not advisable\n   * as a global config setting, but can be used for specific function calls (e.g. decrypt method of Message).\n   * @memberof module:config\n   * @property {Array} additionalAllowedPackets Allow additional packets on parsing. Defined as array of packet classes, e.g. [PublicKeyPacket]\n   */\n  additionalAllowedPackets: [],\n  /**\n   * @memberof module:config\n   * @property {Boolean} showVersion Whether to include {@link module:config/config.versionString} in armored messages\n   */\n  showVersion: false,\n  /**\n   * @memberof module:config\n   * @property {Boolean} showComment Whether to include {@link module:config/config.commentString} in armored messages\n   */\n  showComment: false,\n  /**\n   * @memberof module:config\n   * @property {String} versionString A version string to be included in armored messages\n   */\n  versionString: 'OpenPGP.js VERSION',\n  /**\n   * @memberof module:config\n   * @property {String} commentString A comment string to be included in armored messages\n   */\n  commentString: 'https://openpgpjs.org',\n\n  /**\n   * Max userID string length (used for parsing)\n   * @memberof module:config\n   * @property {Integer} maxUserIDLength\n   */\n  maxUserIDLength: 1024 * 5,\n  /**\n   * Contains notatations that are considered \"known\". Known notations do not trigger\n   * validation error when the notation is marked as critical.\n   * @memberof module:config\n   * @property {Array} knownNotations\n   */\n  knownNotations: [],\n  /**\n   * Whether to use the indutny/elliptic library for curves (other than Curve25519) that are not supported by the available native crypto API.\n   * When false, certain standard curves will not be supported (depending on the platform).\n   * Note: the indutny/elliptic curve library is not designed to be constant time.\n   * @memberof module:config\n   * @property {Boolean} useIndutnyElliptic\n   */\n  useIndutnyElliptic: true,\n  /**\n   * Reject insecure hash algorithms\n   * @memberof module:config\n   * @property {Set<Integer>} rejectHashAlgorithms {@link module:enums.hash}\n   */\n  rejectHashAlgorithms: new Set([enums.hash.md5, enums.hash.ripemd]),\n  /**\n   * Reject insecure message hash algorithms\n   * @memberof module:config\n   * @property {Set<Integer>} rejectMessageHashAlgorithms {@link module:enums.hash}\n   */\n  rejectMessageHashAlgorithms: new Set([enums.hash.md5, enums.hash.ripemd, enums.hash.sha1]),\n  /**\n   * Reject insecure public key algorithms for key generation and message encryption, signing or verification\n   * @memberof module:config\n   * @property {Set<Integer>} rejectPublicKeyAlgorithms {@link module:enums.publicKey}\n   */\n  rejectPublicKeyAlgorithms: new Set([enums.publicKey.elgamal, enums.publicKey.dsa]),\n  /**\n   * Reject non-standard curves for key generation, message encryption, signing or verification\n   * @memberof module:config\n   * @property {Set<String>} rejectCurves {@link module:enums.curve}\n   */\n  rejectCurves: new Set([enums.curve.secp256k1])\n};\n","// GPG4Browsers - An OpenPGP implementation in javascript\n// Copyright (C) 2011 Recurity Labs GmbH\n//\n// This library is free software; you can redistribute it and/or\n// modify it under the terms of the GNU Lesser General Public\n// License as published by the Free Software Foundation; either\n// version 3.0 of the License, or (at your option) any later version.\n//\n// This library is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n// Lesser General Public License for more details.\n//\n// You should have received a copy of the GNU Lesser General Public\n// License along with this library; if not, write to the Free Software\n// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n\nimport * as stream from '@openpgp/web-stream-tools';\nimport * as base64 from './base64';\nimport enums from '../enums';\nimport util from '../util';\nimport defaultConfig from '../config';\n\n/**\n * Finds out which Ascii Armoring type is used. Throws error if unknown type.\n * @param {String} text - ascii armored text\n * @returns {Integer} 0 = MESSAGE PART n of m.\n *         1 = MESSAGE PART n\n *         2 = SIGNED MESSAGE\n *         3 = PGP MESSAGE\n *         4 = PUBLIC KEY BLOCK\n *         5 = PRIVATE KEY BLOCK\n *         6 = SIGNATURE\n * @private\n */\nfunction getType(text) {\n  const reHeader = /^-----BEGIN PGP (MESSAGE, PART \\d+\\/\\d+|MESSAGE, PART \\d+|SIGNED MESSAGE|MESSAGE|PUBLIC KEY BLOCK|PRIVATE KEY BLOCK|SIGNATURE)-----$/m;\n\n  const header = text.match(reHeader);\n\n  if (!header) {\n    throw new Error('Unknown ASCII armor type');\n  }\n\n  // BEGIN PGP MESSAGE, PART X/Y\n  // Used for multi-part messages, where the armor is split amongst Y\n  // parts, and this is the Xth part out of Y.\n  if (/MESSAGE, PART \\d+\\/\\d+/.test(header[1])) {\n    return enums.armor.multipartSection;\n  } else\n  // BEGIN PGP MESSAGE, PART X\n  // Used for multi-part messages, where this is the Xth part of an\n  // unspecified number of parts. Requires the MESSAGE-ID Armor\n  // Header to be used.\n  if (/MESSAGE, PART \\d+/.test(header[1])) {\n    return enums.armor.multipartLast;\n  } else\n  // BEGIN PGP SIGNED MESSAGE\n  if (/SIGNED MESSAGE/.test(header[1])) {\n    return enums.armor.signed;\n  } else\n  // BEGIN PGP MESSAGE\n  // Used for signed, encrypted, or compressed files.\n  if (/MESSAGE/.test(header[1])) {\n    return enums.armor.message;\n  } else\n  // BEGIN PGP PUBLIC KEY BLOCK\n  // Used for armoring public keys.\n  if (/PUBLIC KEY BLOCK/.test(header[1])) {\n    return enums.armor.publicKey;\n  } else\n  // BEGIN PGP PRIVATE KEY BLOCK\n  // Used for armoring private keys.\n  if (/PRIVATE KEY BLOCK/.test(header[1])) {\n    return enums.armor.privateKey;\n  } else\n  // BEGIN PGP SIGNATURE\n  // Used for detached signatures, OpenPGP/MIME signatures, and\n  // cleartext signatures. Note that PGP 2.x uses BEGIN PGP MESSAGE\n  // for detached signatures.\n  if (/SIGNATURE/.test(header[1])) {\n    return enums.armor.signature;\n  }\n}\n\n/**\n * Add additional information to the armor version of an OpenPGP binary\n * packet block.\n * @author  Alex\n * @version 2011-12-16\n * @param {String} [customComment] - Additional comment to add to the armored string\n * @returns {String} The header information.\n * @private\n */\nfunction addheader(customComment, config) {\n  let result = '';\n  if (config.showVersion) {\n    result += 'Version: ' + config.versionString + '\\n';\n  }\n  if (config.showComment) {\n    result += 'Comment: ' + config.commentString + '\\n';\n  }\n  if (customComment) {\n    result += 'Comment: ' + customComment + '\\n';\n  }\n  result += '\\n';\n  return result;\n}\n\n\n/**\n * Calculates a checksum over the given data and returns it base64 encoded\n * @param {String | ReadableStream<String>} data - Data to create a CRC-24 checksum for\n * @returns {String | ReadableStream<String>} Base64 encoded checksum.\n * @private\n */\nfunction getCheckSum(data) {\n  const crc = createcrc24(data);\n  return base64.encode(crc);\n}\n\n// https://create.stephan-brumme.com/crc32/#slicing-by-8-overview\n\nconst crc_table = [\n  new Array(0xFF),\n  new Array(0xFF),\n  new Array(0xFF),\n  new Array(0xFF)\n];\n\nfor (let i = 0; i <= 0xFF; i++) {\n  let crc = i << 16;\n  for (let j = 0; j < 8; j++) {\n    crc = (crc << 1) ^ ((crc & 0x800000) !== 0 ? 0x864CFB : 0);\n  }\n  crc_table[0][i] =\n    ((crc & 0xFF0000) >> 16) |\n    (crc & 0x00FF00) |\n    ((crc & 0x0000FF) << 16);\n}\nfor (let i = 0; i <= 0xFF; i++) {\n  crc_table[1][i] = (crc_table[0][i] >> 8) ^ crc_table[0][crc_table[0][i] & 0xFF];\n}\nfor (let i = 0; i <= 0xFF; i++) {\n  crc_table[2][i] = (crc_table[1][i] >> 8) ^ crc_table[0][crc_table[1][i] & 0xFF];\n}\nfor (let i = 0; i <= 0xFF; i++) {\n  crc_table[3][i] = (crc_table[2][i] >> 8) ^ crc_table[0][crc_table[2][i] & 0xFF];\n}\n\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView#Endianness\nconst isLittleEndian = (function() {\n  const buffer = new ArrayBuffer(2);\n  new DataView(buffer).setInt16(0, 0xFF, true /* littleEndian */);\n  // Int16Array uses the platform's endianness.\n  return new Int16Array(buffer)[0] === 0xFF;\n}());\n\n/**\n * Internal function to calculate a CRC-24 checksum over a given string (data)\n * @param {String | ReadableStream<String>} input - Data to create a CRC-24 checksum for\n * @returns {Uint8Array | ReadableStream<Uint8Array>} The CRC-24 checksum.\n * @private\n */\nfunction createcrc24(input) {\n  let crc = 0xCE04B7;\n  return stream.transform(input, value => {\n    const len32 = isLittleEndian ? Math.floor(value.length / 4) : 0;\n    const arr32 = new Uint32Array(value.buffer, value.byteOffset, len32);\n    for (let i = 0; i < len32; i++) {\n      crc ^= arr32[i];\n      crc =\n        crc_table[0][(crc >> 24) & 0xFF] ^\n        crc_table[1][(crc >> 16) & 0xFF] ^\n        crc_table[2][(crc >> 8) & 0xFF] ^\n        crc_table[3][(crc >> 0) & 0xFF];\n    }\n    for (let i = len32 * 4; i < value.length; i++) {\n      crc = (crc >> 8) ^ crc_table[0][(crc & 0xFF) ^ value[i]];\n    }\n  }, () => new Uint8Array([crc, crc >> 8, crc >> 16]));\n}\n\n/**\n * Verify armored headers. crypto-refresh-06, section 6.2:\n * \"An OpenPGP implementation may consider improperly formatted Armor\n * Headers to be corruption of the ASCII Armor, but SHOULD make an\n * effort to recover.\"\n * @private\n * @param {Array<String>} headers - Armor headers\n */\nfunction verifyHeaders(headers) {\n  for (let i = 0; i < headers.length; i++) {\n    if (!/^([^\\s:]|[^\\s:][^:]*[^\\s:]): .+$/.test(headers[i])) {\n      util.printDebugError(new Error('Improperly formatted armor header: ' + headers[i]));\n    }\n    if (!/^(Version|Comment|MessageID|Hash|Charset): .+$/.test(headers[i])) {\n      util.printDebugError(new Error('Unknown header: ' + headers[i]));\n    }\n  }\n}\n\n/**\n * Splits a message into two parts, the body and the checksum. This is an internal function\n * @param {String} text - OpenPGP armored message part\n * @returns {Object} An object with attribute \"body\" containing the body.\n * and an attribute \"checksum\" containing the checksum.\n * @private\n */\nfunction splitChecksum(text) {\n  let body = text;\n  let checksum = '';\n\n  const lastEquals = text.lastIndexOf('=');\n\n  if (lastEquals >= 0 && lastEquals !== text.length - 1) { // '=' as the last char means no checksum\n    body = text.slice(0, lastEquals);\n    checksum = text.slice(lastEquals + 1).substr(0, 4);\n  }\n\n  return { body: body, checksum: checksum };\n}\n\n/**\n * Dearmor an OpenPGP armored message; verify the checksum and return\n * the encoded bytes\n * @param {String} input - OpenPGP armored message\n * @returns {Promise<Object>} An object with attribute \"text\" containing the message text,\n * an attribute \"data\" containing a stream of bytes and \"type\" for the ASCII armor type\n * @async\n * @static\n */\nexport function unarmor(input, config = defaultConfig) {\n  // eslint-disable-next-line no-async-promise-executor\n  return new Promise(async (resolve, reject) => {\n    try {\n      const reSplit = /^-----[^-]+-----$/m;\n      const reEmptyLine = /^[ \\f\\r\\t\\u00a0\\u2000-\\u200a\\u202f\\u205f\\u3000]*$/;\n\n      let type;\n      const headers = [];\n      let lastHeaders = headers;\n      let headersDone;\n      let text = [];\n      let textDone;\n      let checksum;\n      let data = base64.decode(stream.transformPair(input, async (readable, writable) => {\n        const reader = stream.getReader(readable);\n        try {\n          while (true) {\n            let line = await reader.readLine();\n            if (line === undefined) {\n              throw new Error('Misformed armored text');\n            }\n            // remove trailing whitespace at end of lines\n            line = util.removeTrailingSpaces(line.replace(/[\\r\\n]/g, ''));\n            if (!type) {\n              if (reSplit.test(line)) {\n                type = getType(line);\n              }\n            } else if (!headersDone) {\n              if (reSplit.test(line)) {\n                reject(new Error('Mandatory blank line missing between armor headers and armor data'));\n              }\n              if (!reEmptyLine.test(line)) {\n                lastHeaders.push(line);\n              } else {\n                verifyHeaders(lastHeaders);\n                headersDone = true;\n                if (textDone || type !== 2) {\n                  resolve({ text, data, headers, type });\n                  break;\n                }\n              }\n            } else if (!textDone && type === 2) {\n              if (!reSplit.test(line)) {\n                // Reverse dash-escaping for msg\n                text.push(line.replace(/^- /, ''));\n              } else {\n                text = text.join('\\r\\n');\n                textDone = true;\n                verifyHeaders(lastHeaders);\n                lastHeaders = [];\n                headersDone = false;\n              }\n            }\n          }\n        } catch (e) {\n          reject(e);\n          return;\n        }\n        const writer = stream.getWriter(writable);\n        try {\n          while (true) {\n            await writer.ready;\n            const { done, value } = await reader.read();\n            if (done) {\n              throw new Error('Misformed armored text');\n            }\n            const line = value + '';\n            if (line.indexOf('=') === -1 && line.indexOf('-') === -1) {\n              await writer.write(line);\n            } else {\n              let remainder = await reader.readToEnd();\n              if (!remainder.length) remainder = '';\n              remainder = line + remainder;\n              remainder = util.removeTrailingSpaces(remainder.replace(/\\r/g, ''));\n              const parts = remainder.split(reSplit);\n              if (parts.length === 1) {\n                throw new Error('Misformed armored text');\n              }\n              const split = splitChecksum(parts[0].slice(0, -1));\n              checksum = split.checksum;\n              await writer.write(split.body);\n              break;\n            }\n          }\n          await writer.ready;\n          await writer.close();\n        } catch (e) {\n          await writer.abort(e);\n        }\n      }));\n      data = stream.transformPair(data, async (readable, writable) => {\n        const checksumVerified = stream.readToEnd(getCheckSum(stream.passiveClone(readable)));\n        checksumVerified.catch(() => {});\n        await stream.pipe(readable, writable, {\n          preventClose: true\n        });\n        const writer = stream.getWriter(writable);\n        try {\n          const checksumVerifiedString = (await checksumVerified).replace('\\n', '');\n          if (checksum !== checksumVerifiedString && (checksum || config.checksumRequired)) {\n            throw new Error('Ascii armor integrity check failed');\n          }\n          await writer.ready;\n          await writer.close();\n        } catch (e) {\n          await writer.abort(e);\n        }\n      });\n    } catch (e) {\n      reject(e);\n    }\n  }).then(async result => {\n    if (stream.isArrayStream(result.data)) {\n      result.data = await stream.readToEnd(result.data);\n    }\n    return result;\n  });\n}\n\n\n/**\n * Armor an OpenPGP binary packet block\n * @param {module:enums.armor} messageType - Type of the message\n * @param {Uint8Array | ReadableStream<Uint8Array>} body - The message body to armor\n * @param {Integer} [partIndex]\n * @param {Integer} [partTotal]\n * @param {String} [customComment] - Additional comment to add to the armored string\n * @returns {String | ReadableStream<String>} Armored text.\n * @static\n */\nexport function armor(messageType, body, partIndex, partTotal, customComment, config = defaultConfig) {\n  let text;\n  let hash;\n  if (messageType === enums.armor.signed) {\n    text = body.text;\n    hash = body.hash;\n    body = body.data;\n  }\n  const bodyClone = stream.passiveClone(body);\n  const result = [];\n  switch (messageType) {\n    case enums.armor.multipartSection:\n      result.push('-----BEGIN PGP MESSAGE, PART ' + partIndex + '/' + partTotal + '-----\\n');\n      result.push(addheader(customComment, config));\n      result.push(base64.encode(body));\n      result.push('=', getCheckSum(bodyClone));\n      result.push('-----END PGP MESSAGE, PART ' + partIndex + '/' + partTotal + '-----\\n');\n      break;\n    case enums.armor.multipartLast:\n      result.push('-----BEGIN PGP MESSAGE, PART ' + partIndex + '-----\\n');\n      result.push(addheader(customComment, config));\n      result.push(base64.encode(body));\n      result.push('=', getCheckSum(bodyClone));\n      result.push('-----END PGP MESSAGE, PART ' + partIndex + '-----\\n');\n      break;\n    case enums.armor.signed:\n      result.push('-----BEGIN PGP SIGNED MESSAGE-----\\n');\n      result.push('Hash: ' + hash + '\\n\\n');\n      result.push(text.replace(/^-/mg, '- -'));\n      result.push('\\n-----BEGIN PGP SIGNATURE-----\\n');\n      result.push(addheader(customComment, config));\n      result.push(base64.encode(body));\n      result.push('=', getCheckSum(bodyClone));\n      result.push('-----END PGP SIGNATURE-----\\n');\n      break;\n    case enums.armor.message:\n      result.push('-----BEGIN PGP MESSAGE-----\\n');\n      result.push(addheader(customComment, config));\n      result.push(base64.encode(body));\n      result.push('=', getCheckSum(bodyClone));\n      result.push('-----END PGP MESSAGE-----\\n');\n      break;\n    case enums.armor.publicKey:\n      result.push('-----BEGIN PGP PUBLIC KEY BLOCK-----\\n');\n      result.push(addheader(customComment, config));\n      result.push(base64.encode(body));\n      result.push('=', getCheckSum(bodyClone));\n      result.push('-----END PGP PUBLIC KEY BLOCK-----\\n');\n      break;\n    case enums.armor.privateKey:\n      result.push('-----BEGIN PGP PRIVATE KEY BLOCK-----\\n');\n      result.push(addheader(customComment, config));\n      result.push(base64.encode(body));\n      result.push('=', getCheckSum(bodyClone));\n      result.push('-----END PGP PRIVATE KEY BLOCK-----\\n');\n      break;\n    case enums.armor.signature:\n      result.push('-----BEGIN PGP SIGNATURE-----\\n');\n      result.push(addheader(customComment, config));\n      result.push(base64.encode(body));\n      result.push('=', getCheckSum(bodyClone));\n      result.push('-----END PGP SIGNATURE-----\\n');\n      break;\n  }\n\n  return util.concat(result);\n}\n","// GPG4Browsers - An OpenPGP implementation in javascript\n// Copyright (C) 2011 Recurity Labs GmbH\n//\n// This library is free software; you can redistribute it and/or\n// modify it under the terms of the GNU Lesser General Public\n// License as published by the Free Software Foundation; either\n// version 3.0 of the License, or (at your option) any later version.\n//\n// This library is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n// Lesser General Public License for more details.\n//\n// You should have received a copy of the GNU Lesser General Public\n// License along with this library; if not, write to the Free Software\n// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n\n/**\n * @module type/keyid\n * @private\n */\n\nimport util from '../util';\n\n/**\n * Implementation of type key id\n *\n * {@link https://tools.ietf.org/html/rfc4880#section-3.3|RFC4880 3.3}:\n * A Key ID is an eight-octet scalar that identifies a key.\n * Implementations SHOULD NOT assume that Key IDs are unique.  The\n * section \"Enhanced Key Formats\" below describes how Key IDs are\n * formed.\n */\nclass KeyID {\n  constructor() {\n    this.bytes = '';\n  }\n\n  /**\n   * Parsing method for a key id\n   * @param {Uint8Array} bytes - Input to read the key id from\n   */\n  read(bytes) {\n    this.bytes = util.uint8ArrayToString(bytes.subarray(0, 8));\n    return this.bytes.length;\n  }\n\n  /**\n   * Serializes the Key ID\n   * @returns {Uint8Array} Key ID as a Uint8Array.\n   */\n  write() {\n    return util.stringToUint8Array(this.bytes);\n  }\n\n  /**\n   * Returns the Key ID represented as a hexadecimal string\n   * @returns {String} Key ID as a hexadecimal string.\n   */\n  toHex() {\n    return util.uint8ArrayToHex(util.stringToUint8Array(this.bytes));\n  }\n\n  /**\n   * Checks equality of Key ID's\n   * @param {KeyID} keyID\n   * @param {Boolean} matchWildcard - Indicates whether to check if either keyID is a wildcard\n   */\n  equals(keyID, matchWildcard = false) {\n    return (matchWildcard && (keyID.isWildcard() || this.isWildcard())) || this.bytes === keyID.bytes;\n  }\n\n  /**\n   * Checks to see if the Key ID is unset\n   * @returns {Boolean} True if the Key ID is null.\n   */\n  isNull() {\n    return this.bytes === '';\n  }\n\n  /**\n   * Checks to see if the Key ID is a \"wildcard\" Key ID (all zeros)\n   * @returns {Boolean} True if this is a wildcard Key ID.\n   */\n  isWildcard() {\n    return /^0+$/.test(this.toHex());\n  }\n\n  static mapToHex(keyID) {\n    return keyID.toHex();\n  }\n\n  static fromID(hex) {\n    const keyID = new KeyID();\n    keyID.read(util.hexToUint8Array(hex));\n    return keyID;\n  }\n\n  static wildcard() {\n    const keyID = new KeyID();\n    keyID.read(new Uint8Array(8));\n    return keyID;\n  }\n}\n\nexport default KeyID;\n","/**\n * @file {@link http://asmjs.org Asm.js} implementation of the {@link https://en.wikipedia.org/wiki/Advanced_Encryption_Standard Advanced Encryption Standard}.\n * @author Artem S Vybornov <vybornov@gmail.com>\n * @license MIT\n */\nexport var AES_asm = function () {\n  \"use strict\";\n\n  /**\n   * Galois Field stuff init flag\n   */\n  var ginit_done = false;\n\n  /**\n   * Galois Field exponentiation and logarithm tables for 3 (the generator)\n   */\n  var gexp3, glog3;\n\n  /**\n   * Init Galois Field tables\n   */\n  function ginit() {\n    gexp3 = [],\n      glog3 = [];\n\n    var a = 1, c, d;\n    for (c = 0; c < 255; c++) {\n      gexp3[c] = a;\n\n      // Multiply by three\n      d = a & 0x80, a <<= 1, a &= 255;\n      if (d === 0x80) a ^= 0x1b;\n      a ^= gexp3[c];\n\n      // Set the log table value\n      glog3[gexp3[c]] = c;\n    }\n    gexp3[255] = gexp3[0];\n    glog3[0] = 0;\n\n    ginit_done = true;\n  }\n\n  /**\n   * Galois Field multiplication\n   * @param {number} a\n   * @param {number} b\n   * @return {number}\n   */\n  function gmul(a, b) {\n    var c = gexp3[(glog3[a] + glog3[b]) % 255];\n    if (a === 0 || b === 0) c = 0;\n    return c;\n  }\n\n  /**\n   * Galois Field reciprocal\n   * @param {number} a\n   * @return {number}\n   */\n  function ginv(a) {\n    var i = gexp3[255 - glog3[a]];\n    if (a === 0) i = 0;\n    return i;\n  }\n\n  /**\n   * AES stuff init flag\n   */\n  var aes_init_done = false;\n\n  /**\n   * Encryption, Decryption, S-Box and KeyTransform tables\n   *\n   * @type {number[]}\n   */\n  var aes_sbox;\n\n  /**\n   * @type {number[]}\n   */\n  var aes_sinv;\n\n  /**\n   * @type {number[][]}\n   */\n  var aes_enc;\n\n  /**\n   * @type {number[][]}\n   */\n  var aes_dec;\n\n  /**\n   * Init AES tables\n   */\n  function aes_init() {\n    if (!ginit_done) ginit();\n\n    // Calculates AES S-Box value\n    function _s(a) {\n      var c, s, x;\n      s = x = ginv(a);\n      for (c = 0; c < 4; c++) {\n        s = ((s << 1) | (s >>> 7)) & 255;\n        x ^= s;\n      }\n      x ^= 99;\n      return x;\n    }\n\n    // Tables\n    aes_sbox = [],\n      aes_sinv = [],\n      aes_enc = [[], [], [], []],\n      aes_dec = [[], [], [], []];\n\n    for (var i = 0; i < 256; i++) {\n      var s = _s(i);\n\n      // S-Box and its inverse\n      aes_sbox[i] = s;\n      aes_sinv[s] = i;\n\n      // Ecryption and Decryption tables\n      aes_enc[0][i] = (gmul(2, s) << 24) | (s << 16) | (s << 8) | gmul(3, s);\n      aes_dec[0][s] = (gmul(14, i) << 24) | (gmul(9, i) << 16) | (gmul(13, i) << 8) | gmul(11, i);\n      // Rotate tables\n      for (var t = 1; t < 4; t++) {\n        aes_enc[t][i] = (aes_enc[t - 1][i] >>> 8) | (aes_enc[t - 1][i] << 24);\n        aes_dec[t][s] = (aes_dec[t - 1][s] >>> 8) | (aes_dec[t - 1][s] << 24);\n      }\n    }\n\n    aes_init_done = true;\n  }\n\n  /**\n   * Asm.js module constructor.\n   *\n   * <p>\n   * Heap buffer layout by offset:\n   * <pre>\n   * 0x0000   encryption key schedule\n   * 0x0400   decryption key schedule\n   * 0x0800   sbox\n   * 0x0c00   inv sbox\n   * 0x1000   encryption tables\n   * 0x2000   decryption tables\n   * 0x3000   reserved (future GCM multiplication lookup table)\n   * 0x4000   data\n   * </pre>\n   * Don't touch anything before <code>0x400</code>.\n   * </p>\n   *\n   * @alias AES_asm\n   * @class\n   * @param foreign - <i>ignored</i>\n   * @param buffer - heap buffer to link with\n   */\n  var wrapper = function (foreign, buffer) {\n    // Init AES stuff for the first time\n    if (!aes_init_done) aes_init();\n\n    // Fill up AES tables\n    var heap = new Uint32Array(buffer);\n    heap.set(aes_sbox, 0x0800 >> 2);\n    heap.set(aes_sinv, 0x0c00 >> 2);\n    for (var i = 0; i < 4; i++) {\n      heap.set(aes_enc[i], (0x1000 + 0x400 * i) >> 2);\n      heap.set(aes_dec[i], (0x2000 + 0x400 * i) >> 2);\n    }\n\n    /**\n     * Calculate AES key schedules.\n     * @instance\n     * @memberof AES_asm\n     * @param {number} ks - key size, 4/6/8 (for 128/192/256-bit key correspondingly)\n     * @param {number} k0 - key vector components\n     * @param {number} k1 - key vector components\n     * @param {number} k2 - key vector components\n     * @param {number} k3 - key vector components\n     * @param {number} k4 - key vector components\n     * @param {number} k5 - key vector components\n     * @param {number} k6 - key vector components\n     * @param {number} k7 - key vector components\n     */\n    function set_key(ks, k0, k1, k2, k3, k4, k5, k6, k7) {\n      var ekeys = heap.subarray(0x000, 60),\n        dkeys = heap.subarray(0x100, 0x100 + 60);\n\n      // Encryption key schedule\n      ekeys.set([k0, k1, k2, k3, k4, k5, k6, k7]);\n      for (var i = ks, rcon = 1; i < 4 * ks + 28; i++) {\n        var k = ekeys[i - 1];\n        if ((i % ks === 0) || (ks === 8 && i % ks === 4)) {\n          k = aes_sbox[k >>> 24] << 24 ^ aes_sbox[k >>> 16 & 255] << 16 ^ aes_sbox[k >>> 8 & 255] << 8 ^ aes_sbox[k & 255];\n        }\n        if (i % ks === 0) {\n          k = (k << 8) ^ (k >>> 24) ^ (rcon << 24);\n          rcon = (rcon << 1) ^ ((rcon & 0x80) ? 0x1b : 0);\n        }\n        ekeys[i] = ekeys[i - ks] ^ k;\n      }\n\n      // Decryption key schedule\n      for (var j = 0; j < i; j += 4) {\n        for (var jj = 0; jj < 4; jj++) {\n          var k = ekeys[i - (4 + j) + (4 - jj) % 4];\n          if (j < 4 || j >= i - 4) {\n            dkeys[j + jj] = k;\n          } else {\n            dkeys[j + jj] = aes_dec[0][aes_sbox[k >>> 24]]\n              ^ aes_dec[1][aes_sbox[k >>> 16 & 255]]\n              ^ aes_dec[2][aes_sbox[k >>> 8 & 255]]\n              ^ aes_dec[3][aes_sbox[k & 255]];\n          }\n        }\n      }\n\n      // Set rounds number\n      asm.set_rounds(ks + 5);\n    }\n\n    // create library object with necessary properties\n    var stdlib = {Uint8Array: Uint8Array, Uint32Array: Uint32Array};\n\n    var asm = function (stdlib, foreign, buffer) {\n      \"use asm\";\n\n      var S0 = 0, S1 = 0, S2 = 0, S3 = 0,\n        I0 = 0, I1 = 0, I2 = 0, I3 = 0,\n        N0 = 0, N1 = 0, N2 = 0, N3 = 0,\n        M0 = 0, M1 = 0, M2 = 0, M3 = 0,\n        H0 = 0, H1 = 0, H2 = 0, H3 = 0,\n        R = 0;\n\n      var HEAP = new stdlib.Uint32Array(buffer),\n        DATA = new stdlib.Uint8Array(buffer);\n\n      /**\n       * AES core\n       * @param {number} k - precomputed key schedule offset\n       * @param {number} s - precomputed sbox table offset\n       * @param {number} t - precomputed round table offset\n       * @param {number} r - number of inner rounds to perform\n       * @param {number} x0 - 128-bit input block vector\n       * @param {number} x1 - 128-bit input block vector\n       * @param {number} x2 - 128-bit input block vector\n       * @param {number} x3 - 128-bit input block vector\n       */\n      function _core(k, s, t, r, x0, x1, x2, x3) {\n        k = k | 0;\n        s = s | 0;\n        t = t | 0;\n        r = r | 0;\n        x0 = x0 | 0;\n        x1 = x1 | 0;\n        x2 = x2 | 0;\n        x3 = x3 | 0;\n\n        var t1 = 0, t2 = 0, t3 = 0,\n          y0 = 0, y1 = 0, y2 = 0, y3 = 0,\n          i = 0;\n\n        t1 = t | 0x400, t2 = t | 0x800, t3 = t | 0xc00;\n\n        // round 0\n        x0 = x0 ^ HEAP[(k | 0) >> 2],\n          x1 = x1 ^ HEAP[(k | 4) >> 2],\n          x2 = x2 ^ HEAP[(k | 8) >> 2],\n          x3 = x3 ^ HEAP[(k | 12) >> 2];\n\n        // round 1..r\n        for (i = 16; (i | 0) <= (r << 4); i = (i + 16) | 0) {\n          y0 = HEAP[(t | x0 >> 22 & 1020) >> 2] ^ HEAP[(t1 | x1 >> 14 & 1020) >> 2] ^ HEAP[(t2 | x2 >> 6 & 1020) >> 2] ^ HEAP[(t3 | x3 << 2 & 1020) >> 2] ^ HEAP[(k | i | 0) >> 2],\n            y1 = HEAP[(t | x1 >> 22 & 1020) >> 2] ^ HEAP[(t1 | x2 >> 14 & 1020) >> 2] ^ HEAP[(t2 | x3 >> 6 & 1020) >> 2] ^ HEAP[(t3 | x0 << 2 & 1020) >> 2] ^ HEAP[(k | i | 4) >> 2],\n            y2 = HEAP[(t | x2 >> 22 & 1020) >> 2] ^ HEAP[(t1 | x3 >> 14 & 1020) >> 2] ^ HEAP[(t2 | x0 >> 6 & 1020) >> 2] ^ HEAP[(t3 | x1 << 2 & 1020) >> 2] ^ HEAP[(k | i | 8) >> 2],\n            y3 = HEAP[(t | x3 >> 22 & 1020) >> 2] ^ HEAP[(t1 | x0 >> 14 & 1020) >> 2] ^ HEAP[(t2 | x1 >> 6 & 1020) >> 2] ^ HEAP[(t3 | x2 << 2 & 1020) >> 2] ^ HEAP[(k | i | 12) >> 2];\n          x0 = y0, x1 = y1, x2 = y2, x3 = y3;\n        }\n\n        // final round\n        S0 = HEAP[(s | x0 >> 22 & 1020) >> 2] << 24 ^ HEAP[(s | x1 >> 14 & 1020) >> 2] << 16 ^ HEAP[(s | x2 >> 6 & 1020) >> 2] << 8 ^ HEAP[(s | x3 << 2 & 1020) >> 2] ^ HEAP[(k | i | 0) >> 2],\n          S1 = HEAP[(s | x1 >> 22 & 1020) >> 2] << 24 ^ HEAP[(s | x2 >> 14 & 1020) >> 2] << 16 ^ HEAP[(s | x3 >> 6 & 1020) >> 2] << 8 ^ HEAP[(s | x0 << 2 & 1020) >> 2] ^ HEAP[(k | i | 4) >> 2],\n          S2 = HEAP[(s | x2 >> 22 & 1020) >> 2] << 24 ^ HEAP[(s | x3 >> 14 & 1020) >> 2] << 16 ^ HEAP[(s | x0 >> 6 & 1020) >> 2] << 8 ^ HEAP[(s | x1 << 2 & 1020) >> 2] ^ HEAP[(k | i | 8) >> 2],\n          S3 = HEAP[(s | x3 >> 22 & 1020) >> 2] << 24 ^ HEAP[(s | x0 >> 14 & 1020) >> 2] << 16 ^ HEAP[(s | x1 >> 6 & 1020) >> 2] << 8 ^ HEAP[(s | x2 << 2 & 1020) >> 2] ^ HEAP[(k | i | 12) >> 2];\n      }\n\n      /**\n       * ECB mode encryption\n       * @param {number} x0 - 128-bit input block vector\n       * @param {number} x1 - 128-bit input block vector\n       * @param {number} x2 - 128-bit input block vector\n       * @param {number} x3 - 128-bit input block vector\n       */\n      function _ecb_enc(x0, x1, x2, x3) {\n        x0 = x0 | 0;\n        x1 = x1 | 0;\n        x2 = x2 | 0;\n        x3 = x3 | 0;\n\n        _core(\n          0x0000, 0x0800, 0x1000,\n          R,\n          x0,\n          x1,\n          x2,\n          x3\n        );\n      }\n\n      /**\n       * ECB mode decryption\n       * @param {number} x0 - 128-bit input block vector\n       * @param {number} x1 - 128-bit input block vector\n       * @param {number} x2 - 128-bit input block vector\n       * @param {number} x3 - 128-bit input block vector\n       */\n      function _ecb_dec(x0, x1, x2, x3) {\n        x0 = x0 | 0;\n        x1 = x1 | 0;\n        x2 = x2 | 0;\n        x3 = x3 | 0;\n\n        var t = 0;\n\n        _core(\n          0x0400, 0x0c00, 0x2000,\n          R,\n          x0,\n          x3,\n          x2,\n          x1\n        );\n\n        t = S1, S1 = S3, S3 = t;\n      }\n\n\n      /**\n       * CBC mode encryption\n       * @param {number} x0 - 128-bit input block vector\n       * @param {number} x1 - 128-bit input block vector\n       * @param {number} x2 - 128-bit input block vector\n       * @param {number} x3 - 128-bit input block vector\n       */\n      function _cbc_enc(x0, x1, x2, x3) {\n        x0 = x0 | 0;\n        x1 = x1 | 0;\n        x2 = x2 | 0;\n        x3 = x3 | 0;\n\n        _core(\n          0x0000, 0x0800, 0x1000,\n          R,\n          I0 ^ x0,\n          I1 ^ x1,\n          I2 ^ x2,\n          I3 ^ x3\n        );\n\n        I0 = S0,\n          I1 = S1,\n          I2 = S2,\n          I3 = S3;\n      }\n\n      /**\n       * CBC mode decryption\n       * @param {number} x0 - 128-bit input block vector\n       * @param {number} x1 - 128-bit input block vector\n       * @param {number} x2 - 128-bit input block vector\n       * @param {number} x3 - 128-bit input block vector\n       */\n      function _cbc_dec(x0, x1, x2, x3) {\n        x0 = x0 | 0;\n        x1 = x1 | 0;\n        x2 = x2 | 0;\n        x3 = x3 | 0;\n\n        var t = 0;\n\n        _core(\n          0x0400, 0x0c00, 0x2000,\n          R,\n          x0,\n          x3,\n          x2,\n          x1\n        );\n\n        t = S1, S1 = S3, S3 = t;\n\n        S0 = S0 ^ I0,\n          S1 = S1 ^ I1,\n          S2 = S2 ^ I2,\n          S3 = S3 ^ I3;\n\n        I0 = x0,\n          I1 = x1,\n          I2 = x2,\n          I3 = x3;\n      }\n\n      /**\n       * CFB mode encryption\n       * @param {number} x0 - 128-bit input block vector\n       * @param {number} x1 - 128-bit input block vector\n       * @param {number} x2 - 128-bit input block vector\n       * @param {number} x3 - 128-bit input block vector\n       */\n      function _cfb_enc(x0, x1, x2, x3) {\n        x0 = x0 | 0;\n        x1 = x1 | 0;\n        x2 = x2 | 0;\n        x3 = x3 | 0;\n\n        _core(\n          0x0000, 0x0800, 0x1000,\n          R,\n          I0,\n          I1,\n          I2,\n          I3\n        );\n\n        I0 = S0 = S0 ^ x0,\n          I1 = S1 = S1 ^ x1,\n          I2 = S2 = S2 ^ x2,\n          I3 = S3 = S3 ^ x3;\n      }\n\n\n      /**\n       * CFB mode decryption\n       * @param {number} x0 - 128-bit input block vector\n       * @param {number} x1 - 128-bit input block vector\n       * @param {number} x2 - 128-bit input block vector\n       * @param {number} x3 - 128-bit input block vector\n       */\n      function _cfb_dec(x0, x1, x2, x3) {\n        x0 = x0 | 0;\n        x1 = x1 | 0;\n        x2 = x2 | 0;\n        x3 = x3 | 0;\n\n        _core(\n          0x0000, 0x0800, 0x1000,\n          R,\n          I0,\n          I1,\n          I2,\n          I3\n        );\n\n        S0 = S0 ^ x0,\n          S1 = S1 ^ x1,\n          S2 = S2 ^ x2,\n          S3 = S3 ^ x3;\n\n        I0 = x0,\n          I1 = x1,\n          I2 = x2,\n          I3 = x3;\n      }\n\n      /**\n       * OFB mode encryption / decryption\n       * @param {number} x0 - 128-bit input block vector\n       * @param {number} x1 - 128-bit input block vector\n       * @param {number} x2 - 128-bit input block vector\n       * @param {number} x3 - 128-bit input block vector\n       */\n      function _ofb(x0, x1, x2, x3) {\n        x0 = x0 | 0;\n        x1 = x1 | 0;\n        x2 = x2 | 0;\n        x3 = x3 | 0;\n\n        _core(\n          0x0000, 0x0800, 0x1000,\n          R,\n          I0,\n          I1,\n          I2,\n          I3\n        );\n\n        I0 = S0,\n          I1 = S1,\n          I2 = S2,\n          I3 = S3;\n\n        S0 = S0 ^ x0,\n          S1 = S1 ^ x1,\n          S2 = S2 ^ x2,\n          S3 = S3 ^ x3;\n      }\n\n      /**\n       * CTR mode encryption / decryption\n       * @param {number} x0 - 128-bit input block vector\n       * @param {number} x1 - 128-bit input block vector\n       * @param {number} x2 - 128-bit input block vector\n       * @param {number} x3 - 128-bit input block vector\n       */\n      function _ctr(x0, x1, x2, x3) {\n        x0 = x0 | 0;\n        x1 = x1 | 0;\n        x2 = x2 | 0;\n        x3 = x3 | 0;\n\n        _core(\n          0x0000, 0x0800, 0x1000,\n          R,\n          N0,\n          N1,\n          N2,\n          N3\n        );\n\n        N3 = (~M3 & N3) | M3 & (N3 + 1);\n          N2 = (~M2 & N2) | M2 & (N2 + ((N3 | 0) == 0));\n          N1 = (~M1 & N1) | M1 & (N1 + ((N2 | 0) == 0));\n          N0 = (~M0 & N0) | M0 & (N0 + ((N1 | 0) == 0));\n\n        S0 = S0 ^ x0;\n          S1 = S1 ^ x1;\n          S2 = S2 ^ x2;\n          S3 = S3 ^ x3;\n      }\n\n      /**\n       * GCM mode MAC calculation\n       * @param {number} x0 - 128-bit input block vector\n       * @param {number} x1 - 128-bit input block vector\n       * @param {number} x2 - 128-bit input block vector\n       * @param {number} x3 - 128-bit input block vector\n       */\n      function _gcm_mac(x0, x1, x2, x3) {\n        x0 = x0 | 0;\n        x1 = x1 | 0;\n        x2 = x2 | 0;\n        x3 = x3 | 0;\n\n        var y0 = 0, y1 = 0, y2 = 0, y3 = 0,\n          z0 = 0, z1 = 0, z2 = 0, z3 = 0,\n          i = 0, c = 0;\n\n        x0 = x0 ^ I0,\n          x1 = x1 ^ I1,\n          x2 = x2 ^ I2,\n          x3 = x3 ^ I3;\n\n        y0 = H0 | 0,\n          y1 = H1 | 0,\n          y2 = H2 | 0,\n          y3 = H3 | 0;\n\n        for (; (i | 0) < 128; i = (i + 1) | 0) {\n          if (y0 >>> 31) {\n            z0 = z0 ^ x0,\n              z1 = z1 ^ x1,\n              z2 = z2 ^ x2,\n              z3 = z3 ^ x3;\n          }\n\n          y0 = (y0 << 1) | (y1 >>> 31),\n            y1 = (y1 << 1) | (y2 >>> 31),\n            y2 = (y2 << 1) | (y3 >>> 31),\n            y3 = (y3 << 1);\n\n          c = x3 & 1;\n\n          x3 = (x3 >>> 1) | (x2 << 31),\n            x2 = (x2 >>> 1) | (x1 << 31),\n            x1 = (x1 >>> 1) | (x0 << 31),\n            x0 = (x0 >>> 1);\n\n          if (c) x0 = x0 ^ 0xe1000000;\n        }\n\n        I0 = z0,\n          I1 = z1,\n          I2 = z2,\n          I3 = z3;\n      }\n\n      /**\n       * Set the internal rounds number.\n       * @instance\n       * @memberof AES_asm\n       * @param {number} r - number if inner AES rounds\n       */\n      function set_rounds(r) {\n        r = r | 0;\n        R = r;\n      }\n\n      /**\n       * Populate the internal state of the module.\n       * @instance\n       * @memberof AES_asm\n       * @param {number} s0 - state vector\n       * @param {number} s1 - state vector\n       * @param {number} s2 - state vector\n       * @param {number} s3 - state vector\n       */\n      function set_state(s0, s1, s2, s3) {\n        s0 = s0 | 0;\n        s1 = s1 | 0;\n        s2 = s2 | 0;\n        s3 = s3 | 0;\n\n        S0 = s0,\n          S1 = s1,\n          S2 = s2,\n          S3 = s3;\n      }\n\n      /**\n       * Populate the internal iv of the module.\n       * @instance\n       * @memberof AES_asm\n       * @param {number} i0 - iv vector\n       * @param {number} i1 - iv vector\n       * @param {number} i2 - iv vector\n       * @param {number} i3 - iv vector\n       */\n      function set_iv(i0, i1, i2, i3) {\n        i0 = i0 | 0;\n        i1 = i1 | 0;\n        i2 = i2 | 0;\n        i3 = i3 | 0;\n\n        I0 = i0,\n          I1 = i1,\n          I2 = i2,\n          I3 = i3;\n      }\n\n      /**\n       * Set nonce for CTR-family modes.\n       * @instance\n       * @memberof AES_asm\n       * @param {number} n0 - nonce vector\n       * @param {number} n1 - nonce vector\n       * @param {number} n2 - nonce vector\n       * @param {number} n3 - nonce vector\n       */\n      function set_nonce(n0, n1, n2, n3) {\n        n0 = n0 | 0;\n        n1 = n1 | 0;\n        n2 = n2 | 0;\n        n3 = n3 | 0;\n\n        N0 = n0,\n          N1 = n1,\n          N2 = n2,\n          N3 = n3;\n      }\n\n      /**\n       * Set counter mask for CTR-family modes.\n       * @instance\n       * @memberof AES_asm\n       * @param {number} m0 - counter mask vector\n       * @param {number} m1 - counter mask vector\n       * @param {number} m2 - counter mask vector\n       * @param {number} m3 - counter mask vector\n       */\n      function set_mask(m0, m1, m2, m3) {\n        m0 = m0 | 0;\n        m1 = m1 | 0;\n        m2 = m2 | 0;\n        m3 = m3 | 0;\n\n        M0 = m0,\n          M1 = m1,\n          M2 = m2,\n          M3 = m3;\n      }\n\n      /**\n       * Set counter for CTR-family modes.\n       * @instance\n       * @memberof AES_asm\n       * @param {number} c0 - counter vector\n       * @param {number} c1 - counter vector\n       * @param {number} c2 - counter vector\n       * @param {number} c3 - counter vector\n       */\n      function set_counter(c0, c1, c2, c3) {\n        c0 = c0 | 0;\n        c1 = c1 | 0;\n        c2 = c2 | 0;\n        c3 = c3 | 0;\n\n        N3 = (~M3 & N3) | M3 & c3,\n          N2 = (~M2 & N2) | M2 & c2,\n          N1 = (~M1 & N1) | M1 & c1,\n          N0 = (~M0 & N0) | M0 & c0;\n      }\n\n      /**\n       * Store the internal state vector into the heap.\n       * @instance\n       * @memberof AES_asm\n       * @param {number} pos - offset where to put the data\n       * @return {number} The number of bytes have been written into the heap, always 16.\n       */\n      function get_state(pos) {\n        pos = pos | 0;\n\n        if (pos & 15) return -1;\n\n        DATA[pos | 0] = S0 >>> 24,\n          DATA[pos | 1] = S0 >>> 16 & 255,\n          DATA[pos | 2] = S0 >>> 8 & 255,\n          DATA[pos | 3] = S0 & 255,\n          DATA[pos | 4] = S1 >>> 24,\n          DATA[pos | 5] = S1 >>> 16 & 255,\n          DATA[pos | 6] = S1 >>> 8 & 255,\n          DATA[pos | 7] = S1 & 255,\n          DATA[pos | 8] = S2 >>> 24,\n          DATA[pos | 9] = S2 >>> 16 & 255,\n          DATA[pos | 10] = S2 >>> 8 & 255,\n          DATA[pos | 11] = S2 & 255,\n          DATA[pos | 12] = S3 >>> 24,\n          DATA[pos | 13] = S3 >>> 16 & 255,\n          DATA[pos | 14] = S3 >>> 8 & 255,\n          DATA[pos | 15] = S3 & 255;\n\n        return 16;\n      }\n\n      /**\n       * Store the internal iv vector into the heap.\n       * @instance\n       * @memberof AES_asm\n       * @param {number} pos - offset where to put the data\n       * @return {number} The number of bytes have been written into the heap, always 16.\n       */\n      function get_iv(pos) {\n        pos = pos | 0;\n\n        if (pos & 15) return -1;\n\n        DATA[pos | 0] = I0 >>> 24,\n          DATA[pos | 1] = I0 >>> 16 & 255,\n          DATA[pos | 2] = I0 >>> 8 & 255,\n          DATA[pos | 3] = I0 & 255,\n          DATA[pos | 4] = I1 >>> 24,\n          DATA[pos | 5] = I1 >>> 16 & 255,\n          DATA[pos | 6] = I1 >>> 8 & 255,\n          DATA[pos | 7] = I1 & 255,\n          DATA[pos | 8] = I2 >>> 24,\n          DATA[pos | 9] = I2 >>> 16 & 255,\n          DATA[pos | 10] = I2 >>> 8 & 255,\n          DATA[pos | 11] = I2 & 255,\n          DATA[pos | 12] = I3 >>> 24,\n          DATA[pos | 13] = I3 >>> 16 & 255,\n          DATA[pos | 14] = I3 >>> 8 & 255,\n          DATA[pos | 15] = I3 & 255;\n\n        return 16;\n      }\n\n      /**\n       * GCM initialization.\n       * @instance\n       * @memberof AES_asm\n       */\n      function gcm_init() {\n        _ecb_enc(0, 0, 0, 0);\n        H0 = S0,\n          H1 = S1,\n          H2 = S2,\n          H3 = S3;\n      }\n\n      /**\n       * Perform ciphering operation on the supplied data.\n       * @instance\n       * @memberof AES_asm\n       * @param {number} mode - block cipher mode (see {@link AES_asm} mode constants)\n       * @param {number} pos - offset of the data being processed\n       * @param {number} len - length of the data being processed\n       * @return {number} Actual amount of data have been processed.\n       */\n      function cipher(mode, pos, len) {\n        mode = mode | 0;\n        pos = pos | 0;\n        len = len | 0;\n\n        var ret = 0;\n\n        if (pos & 15) return -1;\n\n        while ((len | 0) >= 16) {\n          _cipher_modes[mode & 7](\n            DATA[pos | 0] << 24 | DATA[pos | 1] << 16 | DATA[pos | 2] << 8 | DATA[pos | 3],\n            DATA[pos | 4] << 24 | DATA[pos | 5] << 16 | DATA[pos | 6] << 8 | DATA[pos | 7],\n            DATA[pos | 8] << 24 | DATA[pos | 9] << 16 | DATA[pos | 10] << 8 | DATA[pos | 11],\n            DATA[pos | 12] << 24 | DATA[pos | 13] << 16 | DATA[pos | 14] << 8 | DATA[pos | 15]\n          );\n\n          DATA[pos | 0] = S0 >>> 24,\n            DATA[pos | 1] = S0 >>> 16 & 255,\n            DATA[pos | 2] = S0 >>> 8 & 255,\n            DATA[pos | 3] = S0 & 255,\n            DATA[pos | 4] = S1 >>> 24,\n            DATA[pos | 5] = S1 >>> 16 & 255,\n            DATA[pos | 6] = S1 >>> 8 & 255,\n            DATA[pos | 7] = S1 & 255,\n            DATA[pos | 8] = S2 >>> 24,\n            DATA[pos | 9] = S2 >>> 16 & 255,\n            DATA[pos | 10] = S2 >>> 8 & 255,\n            DATA[pos | 11] = S2 & 255,\n            DATA[pos | 12] = S3 >>> 24,\n            DATA[pos | 13] = S3 >>> 16 & 255,\n            DATA[pos | 14] = S3 >>> 8 & 255,\n            DATA[pos | 15] = S3 & 255;\n\n          ret = (ret + 16) | 0,\n            pos = (pos + 16) | 0,\n            len = (len - 16) | 0;\n        }\n\n        return ret | 0;\n      }\n\n      /**\n       * Calculates MAC of the supplied data.\n       * @instance\n       * @memberof AES_asm\n       * @param {number} mode - block cipher mode (see {@link AES_asm} mode constants)\n       * @param {number} pos - offset of the data being processed\n       * @param {number} len - length of the data being processed\n       * @return {number} Actual amount of data have been processed.\n       */\n      function mac(mode, pos, len) {\n        mode = mode | 0;\n        pos = pos | 0;\n        len = len | 0;\n\n        var ret = 0;\n\n        if (pos & 15) return -1;\n\n        while ((len | 0) >= 16) {\n          _mac_modes[mode & 1](\n            DATA[pos | 0] << 24 | DATA[pos | 1] << 16 | DATA[pos | 2] << 8 | DATA[pos | 3],\n            DATA[pos | 4] << 24 | DATA[pos | 5] << 16 | DATA[pos | 6] << 8 | DATA[pos | 7],\n            DATA[pos | 8] << 24 | DATA[pos | 9] << 16 | DATA[pos | 10] << 8 | DATA[pos | 11],\n            DATA[pos | 12] << 24 | DATA[pos | 13] << 16 | DATA[pos | 14] << 8 | DATA[pos | 15]\n          );\n\n          ret = (ret + 16) | 0,\n            pos = (pos + 16) | 0,\n            len = (len - 16) | 0;\n        }\n\n        return ret | 0;\n      }\n\n      /**\n       * AES cipher modes table (virual methods)\n       */\n      var _cipher_modes = [_ecb_enc, _ecb_dec, _cbc_enc, _cbc_dec, _cfb_enc, _cfb_dec, _ofb, _ctr];\n\n      /**\n       * AES MAC modes table (virual methods)\n       */\n      var _mac_modes = [_cbc_enc, _gcm_mac];\n\n      /**\n       * Asm.js module exports\n       */\n      return {\n        set_rounds: set_rounds,\n        set_state: set_state,\n        set_iv: set_iv,\n        set_nonce: set_nonce,\n        set_mask: set_mask,\n        set_counter: set_counter,\n        get_state: get_state,\n        get_iv: get_iv,\n        gcm_init: gcm_init,\n        cipher: cipher,\n        mac: mac,\n      };\n    }(stdlib, foreign, buffer);\n\n    asm.set_key = set_key;\n\n    return asm;\n  };\n\n  /**\n   * AES enciphering mode constants\n   * @enum {number}\n   * @const\n   */\n  wrapper.ENC = {\n    ECB: 0,\n    CBC: 2,\n    CFB: 4,\n    OFB: 6,\n    CTR: 7,\n  },\n\n    /**\n     * AES deciphering mode constants\n     * @enum {number}\n     * @const\n     */\n    wrapper.DEC = {\n      ECB: 1,\n      CBC: 3,\n      CFB: 5,\n      OFB: 6,\n      CTR: 7,\n    },\n\n    /**\n     * AES MAC mode constants\n     * @enum {number}\n     * @const\n     */\n    wrapper.MAC = {\n      CBC: 0,\n      GCM: 1,\n    };\n\n  /**\n   * Heap data offset\n   * @type {number}\n   * @const\n   */\n  wrapper.HEAP_DATA = 0x4000;\n\n  return wrapper;\n}();\n","const local_atob = typeof atob === 'undefined' ? (str) => require('buffer').Buffer.from(str, 'base64').toString('binary') : atob;\nconst local_btoa = typeof btoa === 'undefined' ? (str) => require('buffer').Buffer.from(str, 'binary').toString('base64') : btoa;\nexport function string_to_bytes(str, utf8 = false) {\n    var len = str.length, bytes = new Uint8Array(utf8 ? 4 * len : len);\n    for (var i = 0, j = 0; i < len; i++) {\n        var c = str.charCodeAt(i);\n        if (utf8 && 0xd800 <= c && c <= 0xdbff) {\n            if (++i >= len)\n                throw new Error('Malformed string, low surrogate expected at position ' + i);\n            c = ((c ^ 0xd800) << 10) | 0x10000 | (str.charCodeAt(i) ^ 0xdc00);\n        }\n        else if (!utf8 && c >>> 8) {\n            throw new Error('Wide characters are not allowed.');\n        }\n        if (!utf8 || c <= 0x7f) {\n            bytes[j++] = c;\n        }\n        else if (c <= 0x7ff) {\n            bytes[j++] = 0xc0 | (c >> 6);\n            bytes[j++] = 0x80 | (c & 0x3f);\n        }\n        else if (c <= 0xffff) {\n            bytes[j++] = 0xe0 | (c >> 12);\n            bytes[j++] = 0x80 | ((c >> 6) & 0x3f);\n            bytes[j++] = 0x80 | (c & 0x3f);\n        }\n        else {\n            bytes[j++] = 0xf0 | (c >> 18);\n            bytes[j++] = 0x80 | ((c >> 12) & 0x3f);\n            bytes[j++] = 0x80 | ((c >> 6) & 0x3f);\n            bytes[j++] = 0x80 | (c & 0x3f);\n        }\n    }\n    return bytes.subarray(0, j);\n}\nexport function hex_to_bytes(str) {\n    var len = str.length;\n    if (len & 1) {\n        str = '0' + str;\n        len++;\n    }\n    var bytes = new Uint8Array(len >> 1);\n    for (var i = 0; i < len; i += 2) {\n        bytes[i >> 1] = parseInt(str.substr(i, 2), 16);\n    }\n    return bytes;\n}\nexport function base64_to_bytes(str) {\n    return string_to_bytes(local_atob(str));\n}\nexport function bytes_to_string(bytes, utf8 = false) {\n    var len = bytes.length, chars = new Array(len);\n    for (var i = 0, j = 0; i < len; i++) {\n        var b = bytes[i];\n        if (!utf8 || b < 128) {\n            chars[j++] = b;\n        }\n        else if (b >= 192 && b < 224 && i + 1 < len) {\n            chars[j++] = ((b & 0x1f) << 6) | (bytes[++i] & 0x3f);\n        }\n        else if (b >= 224 && b < 240 && i + 2 < len) {\n            chars[j++] = ((b & 0xf) << 12) | ((bytes[++i] & 0x3f) << 6) | (bytes[++i] & 0x3f);\n        }\n        else if (b >= 240 && b < 248 && i + 3 < len) {\n            var c = ((b & 7) << 18) | ((bytes[++i] & 0x3f) << 12) | ((bytes[++i] & 0x3f) << 6) | (bytes[++i] & 0x3f);\n            if (c <= 0xffff) {\n                chars[j++] = c;\n            }\n            else {\n                c ^= 0x10000;\n                chars[j++] = 0xd800 | (c >> 10);\n                chars[j++] = 0xdc00 | (c & 0x3ff);\n            }\n        }\n        else {\n            throw new Error('Malformed UTF8 character at byte offset ' + i);\n        }\n    }\n    var str = '', bs = 16384;\n    for (var i = 0; i < j; i += bs) {\n        str += String.fromCharCode.apply(String, chars.slice(i, i + bs <= j ? i + bs : j));\n    }\n    return str;\n}\nexport function bytes_to_hex(arr) {\n    var str = '';\n    for (var i = 0; i < arr.length; i++) {\n        var h = (arr[i] & 0xff).toString(16);\n        if (h.length < 2)\n            str += '0';\n        str += h;\n    }\n    return str;\n}\nexport function bytes_to_base64(arr) {\n    return local_btoa(bytes_to_string(arr));\n}\nexport function pow2_ceil(a) {\n    a -= 1;\n    a |= a >>> 1;\n    a |= a >>> 2;\n    a |= a >>> 4;\n    a |= a >>> 8;\n    a |= a >>> 16;\n    a += 1;\n    return a;\n}\nexport function is_number(a) {\n    return typeof a === 'number';\n}\nexport function is_string(a) {\n    return typeof a === 'string';\n}\nexport function is_buffer(a) {\n    return a instanceof ArrayBuffer;\n}\nexport function is_bytes(a) {\n    return a instanceof Uint8Array;\n}\nexport function is_typed_array(a) {\n    return (a instanceof Int8Array ||\n        a instanceof Uint8Array ||\n        a instanceof Int16Array ||\n        a instanceof Uint16Array ||\n        a instanceof Int32Array ||\n        a instanceof Uint32Array ||\n        a instanceof Float32Array ||\n        a instanceof Float64Array);\n}\nexport function _heap_init(heap, heapSize) {\n    const size = heap ? heap.byteLength : heapSize || 65536;\n    if (size & 0xfff || size <= 0)\n        throw new Error('heap size must be a positive integer and a multiple of 4096');\n    heap = heap || new Uint8Array(new ArrayBuffer(size));\n    return heap;\n}\nexport function _heap_write(heap, hpos, data, dpos, dlen) {\n    const hlen = heap.length - hpos;\n    const wlen = hlen < dlen ? hlen : dlen;\n    heap.set(data.subarray(dpos, dpos + wlen), hpos);\n    return wlen;\n}\nexport function joinBytes(...arg) {\n    const totalLenght = arg.reduce((sum, curr) => sum + curr.length, 0);\n    const ret = new Uint8Array(totalLenght);\n    let cursor = 0;\n    for (let i = 0; i < arg.length; i++) {\n        ret.set(arg[i], cursor);\n        cursor += arg[i].length;\n    }\n    return ret;\n}\n","export class IllegalStateError extends Error {\n    constructor(...args) {\n        super(...args);\n        Object.create(Error.prototype, { name: { value: 'IllegalStateError' } });\n    }\n}\nexport class IllegalArgumentError extends Error {\n    constructor(...args) {\n        super(...args);\n        Object.create(Error.prototype, { name: { value: 'IllegalArgumentError' } });\n    }\n}\nexport class SecurityError extends Error {\n    constructor(...args) {\n        super(...args);\n        Object.create(Error.prototype, { name: { value: 'SecurityError' } });\n    }\n}\n","import { AES_asm } from './aes.asm';\nimport { _heap_init, _heap_write, is_bytes } from '../other/utils';\nimport { IllegalArgumentError, SecurityError } from '../other/errors';\nconst heap_pool = [];\nconst asm_pool = [];\nexport class AES {\n    constructor(key, iv, padding = true, mode, heap, asm) {\n        this.pos = 0;\n        this.len = 0;\n        this.mode = mode;\n        // The AES object state\n        this.pos = 0;\n        this.len = 0;\n        this.key = key;\n        this.iv = iv;\n        this.padding = padding;\n        // The AES \"worker\"\n        this.acquire_asm(heap, asm);\n    }\n    acquire_asm(heap, asm) {\n        if (this.heap === undefined || this.asm === undefined) {\n            this.heap = heap || heap_pool.pop() || _heap_init().subarray(AES_asm.HEAP_DATA);\n            this.asm = asm || asm_pool.pop() || new AES_asm(null, this.heap.buffer);\n            this.reset(this.key, this.iv);\n        }\n        return { heap: this.heap, asm: this.asm };\n    }\n    release_asm() {\n        if (this.heap !== undefined && this.asm !== undefined) {\n            heap_pool.push(this.heap);\n            asm_pool.push(this.asm);\n        }\n        this.heap = undefined;\n        this.asm = undefined;\n    }\n    reset(key, iv) {\n        const { asm } = this.acquire_asm();\n        // Key\n        const keylen = key.length;\n        if (keylen !== 16 && keylen !== 24 && keylen !== 32)\n            throw new IllegalArgumentError('illegal key size');\n        const keyview = new DataView(key.buffer, key.byteOffset, key.byteLength);\n        asm.set_key(keylen >> 2, keyview.getUint32(0), keyview.getUint32(4), keyview.getUint32(8), keyview.getUint32(12), keylen > 16 ? keyview.getUint32(16) : 0, keylen > 16 ? keyview.getUint32(20) : 0, keylen > 24 ? keyview.getUint32(24) : 0, keylen > 24 ? keyview.getUint32(28) : 0);\n        // IV\n        if (iv !== undefined) {\n            if (iv.length !== 16)\n                throw new IllegalArgumentError('illegal iv size');\n            let ivview = new DataView(iv.buffer, iv.byteOffset, iv.byteLength);\n            asm.set_iv(ivview.getUint32(0), ivview.getUint32(4), ivview.getUint32(8), ivview.getUint32(12));\n        }\n        else {\n            asm.set_iv(0, 0, 0, 0);\n        }\n    }\n    AES_Encrypt_process(data) {\n        if (!is_bytes(data))\n            throw new TypeError(\"data isn't of expected type\");\n        let { heap, asm } = this.acquire_asm();\n        let amode = AES_asm.ENC[this.mode];\n        let hpos = AES_asm.HEAP_DATA;\n        let pos = this.pos;\n        let len = this.len;\n        let dpos = 0;\n        let dlen = data.length || 0;\n        let rpos = 0;\n        let rlen = (len + dlen) & -16;\n        let wlen = 0;\n        let result = new Uint8Array(rlen);\n        while (dlen > 0) {\n            wlen = _heap_write(heap, pos + len, data, dpos, dlen);\n            len += wlen;\n            dpos += wlen;\n            dlen -= wlen;\n            wlen = asm.cipher(amode, hpos + pos, len);\n            if (wlen)\n                result.set(heap.subarray(pos, pos + wlen), rpos);\n            rpos += wlen;\n            if (wlen < len) {\n                pos += wlen;\n                len -= wlen;\n            }\n            else {\n                pos = 0;\n                len = 0;\n            }\n        }\n        this.pos = pos;\n        this.len = len;\n        return result;\n    }\n    AES_Encrypt_finish() {\n        let { heap, asm } = this.acquire_asm();\n        let amode = AES_asm.ENC[this.mode];\n        let hpos = AES_asm.HEAP_DATA;\n        let pos = this.pos;\n        let len = this.len;\n        let plen = 16 - (len % 16);\n        let rlen = len;\n        if (this.hasOwnProperty('padding')) {\n            if (this.padding) {\n                for (let p = 0; p < plen; ++p) {\n                    heap[pos + len + p] = plen;\n                }\n                len += plen;\n                rlen = len;\n            }\n            else if (len % 16) {\n                throw new IllegalArgumentError('data length must be a multiple of the block size');\n            }\n        }\n        else {\n            len += plen;\n        }\n        const result = new Uint8Array(rlen);\n        if (len)\n            asm.cipher(amode, hpos + pos, len);\n        if (rlen)\n            result.set(heap.subarray(pos, pos + rlen));\n        this.pos = 0;\n        this.len = 0;\n        this.release_asm();\n        return result;\n    }\n    AES_Decrypt_process(data) {\n        if (!is_bytes(data))\n            throw new TypeError(\"data isn't of expected type\");\n        let { heap, asm } = this.acquire_asm();\n        let amode = AES_asm.DEC[this.mode];\n        let hpos = AES_asm.HEAP_DATA;\n        let pos = this.pos;\n        let len = this.len;\n        let dpos = 0;\n        let dlen = data.length || 0;\n        let rpos = 0;\n        let rlen = (len + dlen) & -16;\n        let plen = 0;\n        let wlen = 0;\n        if (this.padding) {\n            plen = len + dlen - rlen || 16;\n            rlen -= plen;\n        }\n        const result = new Uint8Array(rlen);\n        while (dlen > 0) {\n            wlen = _heap_write(heap, pos + len, data, dpos, dlen);\n            len += wlen;\n            dpos += wlen;\n            dlen -= wlen;\n            wlen = asm.cipher(amode, hpos + pos, len - (!dlen ? plen : 0));\n            if (wlen)\n                result.set(heap.subarray(pos, pos + wlen), rpos);\n            rpos += wlen;\n            if (wlen < len) {\n                pos += wlen;\n                len -= wlen;\n            }\n            else {\n                pos = 0;\n                len = 0;\n            }\n        }\n        this.pos = pos;\n        this.len = len;\n        return result;\n    }\n    AES_Decrypt_finish() {\n        let { heap, asm } = this.acquire_asm();\n        let amode = AES_asm.DEC[this.mode];\n        let hpos = AES_asm.HEAP_DATA;\n        let pos = this.pos;\n        let len = this.len;\n        let rlen = len;\n        if (len > 0) {\n            if (len % 16) {\n                if (this.hasOwnProperty('padding')) {\n                    throw new IllegalArgumentError('data length must be a multiple of the block size');\n                }\n                else {\n                    len += 16 - (len % 16);\n                }\n            }\n            asm.cipher(amode, hpos + pos, len);\n            if (this.hasOwnProperty('padding') && this.padding) {\n                let pad = heap[pos + rlen - 1];\n                if (pad < 1 || pad > 16 || pad > rlen)\n                    throw new SecurityError('bad padding');\n                let pcheck = 0;\n                for (let i = pad; i > 1; i--)\n                    pcheck |= pad ^ heap[pos + rlen - i];\n                if (pcheck)\n                    throw new SecurityError('bad padding');\n                rlen -= pad;\n            }\n        }\n        const result = new Uint8Array(rlen);\n        if (rlen > 0) {\n            result.set(heap.subarray(pos, pos + rlen));\n        }\n        this.pos = 0;\n        this.len = 0;\n        this.release_asm();\n        return result;\n    }\n}\n","import { AES } from './aes';\nimport { joinBytes } from '../other/utils';\nexport class AES_ECB {\n    static encrypt(data, key, padding = false) {\n        return new AES_ECB(key, padding).encrypt(data);\n    }\n    static decrypt(data, key, padding = false) {\n        return new AES_ECB(key, padding).decrypt(data);\n    }\n    constructor(key, padding = false, aes) {\n        this.aes = aes ? aes : new AES(key, undefined, padding, 'ECB');\n    }\n    encrypt(data) {\n        const r1 = this.aes.AES_Encrypt_process(data);\n        const r2 = this.aes.AES_Encrypt_finish();\n        return joinBytes(r1, r2);\n    }\n    decrypt(data) {\n        const r1 = this.aes.AES_Decrypt_process(data);\n        const r2 = this.aes.AES_Decrypt_finish();\n        return joinBytes(r1, r2);\n    }\n}\n","import { AES_ECB } from '@openpgp/asmcrypto.js/dist_es8/aes/ecb';\n\n/**\n * Javascript AES implementation.\n * This is used as fallback if the native Crypto APIs are not available.\n */\nfunction aes(length) {\n  const C = function(key) {\n    const aesECB = new AES_ECB(key);\n\n    this.encrypt = function(block) {\n      return aesECB.encrypt(block);\n    };\n\n    this.decrypt = function(block) {\n      return aesECB.decrypt(block);\n    };\n  };\n\n  C.blockSize = C.prototype.blockSize = 16;\n  C.keySize = C.prototype.keySize = length / 8;\n\n  return C;\n}\n\nexport default aes;\n","//Paul Tero, July 2001\n//http://www.tero.co.uk/des/\n//\n//Optimised for performance with large blocks by Michael Hayworth, November 2001\n//http://www.netdealing.com\n//\n// Modified by Recurity Labs GmbH\n\n//THIS SOFTWARE IS PROVIDED \"AS IS\" AND\n//ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n//IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n//ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE\n//FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n//DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n//OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n//HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\n//OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n//SUCH DAMAGE.\n\n//des\n//this takes the key, the message, and whether to encrypt or decrypt\n\nfunction des(keys, message, encrypt, mode, iv, padding) {\n  //declaring this locally speeds things up a bit\n  const spfunction1 = [\n    0x1010400, 0, 0x10000, 0x1010404, 0x1010004, 0x10404, 0x4, 0x10000, 0x400, 0x1010400,\n    0x1010404, 0x400, 0x1000404, 0x1010004, 0x1000000, 0x4, 0x404, 0x1000400, 0x1000400, 0x10400, 0x10400, 0x1010000,\n    0x1010000, 0x1000404, 0x10004, 0x1000004, 0x1000004, 0x10004, 0, 0x404, 0x10404, 0x1000000, 0x10000, 0x1010404, 0x4,\n    0x1010000, 0x1010400, 0x1000000, 0x1000000, 0x400, 0x1010004, 0x10000, 0x10400, 0x1000004, 0x400, 0x4, 0x1000404,\n    0x10404, 0x1010404, 0x10004, 0x1010000, 0x1000404, 0x1000004, 0x404, 0x10404, 0x1010400, 0x404, 0x1000400,\n    0x1000400, 0, 0x10004, 0x10400, 0, 0x1010004\n  ];\n  const spfunction2 = [\n    -0x7fef7fe0, -0x7fff8000, 0x8000, 0x108020, 0x100000, 0x20, -0x7fefffe0, -0x7fff7fe0,\n    -0x7fffffe0, -0x7fef7fe0, -0x7fef8000, -0x80000000, -0x7fff8000, 0x100000, 0x20, -0x7fefffe0, 0x108000, 0x100020,\n    -0x7fff7fe0, 0, -0x80000000, 0x8000, 0x108020, -0x7ff00000, 0x100020, -0x7fffffe0, 0, 0x108000, 0x8020, -0x7fef8000,\n    -0x7ff00000, 0x8020, 0, 0x108020, -0x7fefffe0, 0x100000, -0x7fff7fe0, -0x7ff00000, -0x7fef8000, 0x8000, -0x7ff00000,\n    -0x7fff8000, 0x20, -0x7fef7fe0, 0x108020, 0x20, 0x8000, -0x80000000, 0x8020, -0x7fef8000, 0x100000, -0x7fffffe0,\n    0x100020, -0x7fff7fe0, -0x7fffffe0, 0x100020, 0x108000, 0, -0x7fff8000, 0x8020, -0x80000000, -0x7fefffe0,\n    -0x7fef7fe0, 0x108000\n  ];\n  const spfunction3 = [\n    0x208, 0x8020200, 0, 0x8020008, 0x8000200, 0, 0x20208, 0x8000200, 0x20008, 0x8000008,\n    0x8000008, 0x20000, 0x8020208, 0x20008, 0x8020000, 0x208, 0x8000000, 0x8, 0x8020200, 0x200, 0x20200, 0x8020000,\n    0x8020008, 0x20208, 0x8000208, 0x20200, 0x20000, 0x8000208, 0x8, 0x8020208, 0x200, 0x8000000, 0x8020200, 0x8000000,\n    0x20008, 0x208, 0x20000, 0x8020200, 0x8000200, 0, 0x200, 0x20008, 0x8020208, 0x8000200, 0x8000008, 0x200, 0,\n    0x8020008, 0x8000208, 0x20000, 0x8000000, 0x8020208, 0x8, 0x20208, 0x20200, 0x8000008, 0x8020000, 0x8000208, 0x208,\n    0x8020000, 0x20208, 0x8, 0x8020008, 0x20200\n  ];\n  const spfunction4 = [\n    0x802001, 0x2081, 0x2081, 0x80, 0x802080, 0x800081, 0x800001, 0x2001, 0, 0x802000,\n    0x802000, 0x802081, 0x81, 0, 0x800080, 0x800001, 0x1, 0x2000, 0x800000, 0x802001, 0x80, 0x800000, 0x2001, 0x2080,\n    0x800081, 0x1, 0x2080, 0x800080, 0x2000, 0x802080, 0x802081, 0x81, 0x800080, 0x800001, 0x802000, 0x802081, 0x81, 0,\n    0, 0x802000, 0x2080, 0x800080, 0x800081, 0x1, 0x802001, 0x2081, 0x2081, 0x80, 0x802081, 0x81, 0x1, 0x2000, 0x800001,\n    0x2001, 0x802080, 0x800081, 0x2001, 0x2080, 0x800000, 0x802001, 0x80, 0x800000, 0x2000, 0x802080\n  ];\n  const spfunction5 = [\n    0x100, 0x2080100, 0x2080000, 0x42000100, 0x80000, 0x100, 0x40000000, 0x2080000,\n    0x40080100, 0x80000, 0x2000100, 0x40080100, 0x42000100, 0x42080000, 0x80100, 0x40000000, 0x2000000, 0x40080000,\n    0x40080000, 0, 0x40000100, 0x42080100, 0x42080100, 0x2000100, 0x42080000, 0x40000100, 0, 0x42000000, 0x2080100,\n    0x2000000, 0x42000000, 0x80100, 0x80000, 0x42000100, 0x100, 0x2000000, 0x40000000, 0x2080000, 0x42000100,\n    0x40080100, 0x2000100, 0x40000000, 0x42080000, 0x2080100, 0x40080100, 0x100, 0x2000000, 0x42080000, 0x42080100,\n    0x80100, 0x42000000, 0x42080100, 0x2080000, 0, 0x40080000, 0x42000000, 0x80100, 0x2000100, 0x40000100, 0x80000, 0,\n    0x40080000, 0x2080100, 0x40000100\n  ];\n  const spfunction6 = [\n    0x20000010, 0x20400000, 0x4000, 0x20404010, 0x20400000, 0x10, 0x20404010, 0x400000,\n    0x20004000, 0x404010, 0x400000, 0x20000010, 0x400010, 0x20004000, 0x20000000, 0x4010, 0, 0x400010, 0x20004010,\n    0x4000, 0x404000, 0x20004010, 0x10, 0x20400010, 0x20400010, 0, 0x404010, 0x20404000, 0x4010, 0x404000, 0x20404000,\n    0x20000000, 0x20004000, 0x10, 0x20400010, 0x404000, 0x20404010, 0x400000, 0x4010, 0x20000010, 0x400000, 0x20004000,\n    0x20000000, 0x4010, 0x20000010, 0x20404010, 0x404000, 0x20400000, 0x404010, 0x20404000, 0, 0x20400010, 0x10, 0x4000,\n    0x20400000, 0x404010, 0x4000, 0x400010, 0x20004010, 0, 0x20404000, 0x20000000, 0x400010, 0x20004010\n  ];\n  const spfunction7 = [\n    0x200000, 0x4200002, 0x4000802, 0, 0x800, 0x4000802, 0x200802, 0x4200800, 0x4200802,\n    0x200000, 0, 0x4000002, 0x2, 0x4000000, 0x4200002, 0x802, 0x4000800, 0x200802, 0x200002, 0x4000800, 0x4000002,\n    0x4200000, 0x4200800, 0x200002, 0x4200000, 0x800, 0x802, 0x4200802, 0x200800, 0x2, 0x4000000, 0x200800, 0x4000000,\n    0x200800, 0x200000, 0x4000802, 0x4000802, 0x4200002, 0x4200002, 0x2, 0x200002, 0x4000000, 0x4000800, 0x200000,\n    0x4200800, 0x802, 0x200802, 0x4200800, 0x802, 0x4000002, 0x4200802, 0x4200000, 0x200800, 0, 0x2, 0x4200802, 0,\n    0x200802, 0x4200000, 0x800, 0x4000002, 0x4000800, 0x800, 0x200002\n  ];\n  const spfunction8 = [\n    0x10001040, 0x1000, 0x40000, 0x10041040, 0x10000000, 0x10001040, 0x40, 0x10000000,\n    0x40040, 0x10040000, 0x10041040, 0x41000, 0x10041000, 0x41040, 0x1000, 0x40, 0x10040000, 0x10000040, 0x10001000,\n    0x1040, 0x41000, 0x40040, 0x10040040, 0x10041000, 0x1040, 0, 0, 0x10040040, 0x10000040, 0x10001000, 0x41040,\n    0x40000, 0x41040, 0x40000, 0x10041000, 0x1000, 0x40, 0x10040040, 0x1000, 0x41040, 0x10001000, 0x40, 0x10000040,\n    0x10040000, 0x10040040, 0x10000000, 0x40000, 0x10001040, 0, 0x10041040, 0x40040, 0x10000040, 0x10040000, 0x10001000,\n    0x10001040, 0, 0x10041040, 0x41000, 0x41000, 0x1040, 0x1040, 0x40040, 0x10000000, 0x10041000\n  ];\n\n  //create the 16 or 48 subkeys we will need\n  let m = 0;\n  let i;\n  let j;\n  let temp;\n  let right1;\n  let right2;\n  let left;\n  let right;\n  let looping;\n  let cbcleft;\n  let cbcleft2;\n  let cbcright;\n  let cbcright2;\n  let endloop;\n  let loopinc;\n  let len = message.length;\n\n  //set up the loops for single and triple des\n  const iterations = keys.length === 32 ? 3 : 9; //single or triple des\n  if (iterations === 3) {\n    looping = encrypt ? [0, 32, 2] : [30, -2, -2];\n  } else {\n    looping = encrypt ? [0, 32, 2, 62, 30, -2, 64, 96, 2] : [94, 62, -2, 32, 64, 2, 30, -2, -2];\n  }\n\n  //pad the message depending on the padding parameter\n  //only add padding if encrypting - note that you need to use the same padding option for both encrypt and decrypt\n  if (encrypt) {\n    message = desAddPadding(message, padding);\n    len = message.length;\n  }\n\n  //store the result here\n  let result = new Uint8Array(len);\n  let k = 0;\n\n  if (mode === 1) { //CBC mode\n    cbcleft = (iv[m++] << 24) | (iv[m++] << 16) | (iv[m++] << 8) | iv[m++];\n    cbcright = (iv[m++] << 24) | (iv[m++] << 16) | (iv[m++] << 8) | iv[m++];\n    m = 0;\n  }\n\n  //loop through each 64 bit chunk of the message\n  while (m < len) {\n    left = (message[m++] << 24) | (message[m++] << 16) | (message[m++] << 8) | message[m++];\n    right = (message[m++] << 24) | (message[m++] << 16) | (message[m++] << 8) | message[m++];\n\n    //for Cipher Block Chaining mode, xor the message with the previous result\n    if (mode === 1) {\n      if (encrypt) {\n        left ^= cbcleft;\n        right ^= cbcright;\n      } else {\n        cbcleft2 = cbcleft;\n        cbcright2 = cbcright;\n        cbcleft = left;\n        cbcright = right;\n      }\n    }\n\n    //first each 64 but chunk of the message must be permuted according to IP\n    temp = ((left >>> 4) ^ right) & 0x0f0f0f0f;\n    right ^= temp;\n    left ^= (temp << 4);\n    temp = ((left >>> 16) ^ right) & 0x0000ffff;\n    right ^= temp;\n    left ^= (temp << 16);\n    temp = ((right >>> 2) ^ left) & 0x33333333;\n    left ^= temp;\n    right ^= (temp << 2);\n    temp = ((right >>> 8) ^ left) & 0x00ff00ff;\n    left ^= temp;\n    right ^= (temp << 8);\n    temp = ((left >>> 1) ^ right) & 0x55555555;\n    right ^= temp;\n    left ^= (temp << 1);\n\n    left = ((left << 1) | (left >>> 31));\n    right = ((right << 1) | (right >>> 31));\n\n    //do this either 1 or 3 times for each chunk of the message\n    for (j = 0; j < iterations; j += 3) {\n      endloop = looping[j + 1];\n      loopinc = looping[j + 2];\n      //now go through and perform the encryption or decryption\n      for (i = looping[j]; i !== endloop; i += loopinc) { //for efficiency\n        right1 = right ^ keys[i];\n        right2 = ((right >>> 4) | (right << 28)) ^ keys[i + 1];\n        //the result is attained by passing these bytes through the S selection functions\n        temp = left;\n        left = right;\n        right = temp ^ (spfunction2[(right1 >>> 24) & 0x3f] | spfunction4[(right1 >>> 16) & 0x3f] | spfunction6[(right1 >>>\n          8) & 0x3f] | spfunction8[right1 & 0x3f] | spfunction1[(right2 >>> 24) & 0x3f] | spfunction3[(right2 >>> 16) &\n          0x3f] | spfunction5[(right2 >>> 8) & 0x3f] | spfunction7[right2 & 0x3f]);\n      }\n      temp = left;\n      left = right;\n      right = temp; //unreverse left and right\n    } //for either 1 or 3 iterations\n\n    //move then each one bit to the right\n    left = ((left >>> 1) | (left << 31));\n    right = ((right >>> 1) | (right << 31));\n\n    //now perform IP-1, which is IP in the opposite direction\n    temp = ((left >>> 1) ^ right) & 0x55555555;\n    right ^= temp;\n    left ^= (temp << 1);\n    temp = ((right >>> 8) ^ left) & 0x00ff00ff;\n    left ^= temp;\n    right ^= (temp << 8);\n    temp = ((right >>> 2) ^ left) & 0x33333333;\n    left ^= temp;\n    right ^= (temp << 2);\n    temp = ((left >>> 16) ^ right) & 0x0000ffff;\n    right ^= temp;\n    left ^= (temp << 16);\n    temp = ((left >>> 4) ^ right) & 0x0f0f0f0f;\n    right ^= temp;\n    left ^= (temp << 4);\n\n    //for Cipher Block Chaining mode, xor the message with the previous result\n    if (mode === 1) {\n      if (encrypt) {\n        cbcleft = left;\n        cbcright = right;\n      } else {\n        left ^= cbcleft2;\n        right ^= cbcright2;\n      }\n    }\n\n    result[k++] = (left >>> 24);\n    result[k++] = ((left >>> 16) & 0xff);\n    result[k++] = ((left >>> 8) & 0xff);\n    result[k++] = (left & 0xff);\n    result[k++] = (right >>> 24);\n    result[k++] = ((right >>> 16) & 0xff);\n    result[k++] = ((right >>> 8) & 0xff);\n    result[k++] = (right & 0xff);\n  } //for every 8 characters, or 64 bits in the message\n\n  //only remove padding if decrypting - note that you need to use the same padding option for both encrypt and decrypt\n  if (!encrypt) {\n    result = desRemovePadding(result, padding);\n  }\n\n  return result;\n} //end of des\n\n\n//desCreateKeys\n//this takes as input a 64 bit key (even though only 56 bits are used)\n//as an array of 2 integers, and returns 16 48 bit keys\n\nfunction desCreateKeys(key) {\n  //declaring this locally speeds things up a bit\n  const pc2bytes0 = [\n    0, 0x4, 0x20000000, 0x20000004, 0x10000, 0x10004, 0x20010000, 0x20010004, 0x200, 0x204,\n    0x20000200, 0x20000204, 0x10200, 0x10204, 0x20010200, 0x20010204\n  ];\n  const pc2bytes1 = [\n    0, 0x1, 0x100000, 0x100001, 0x4000000, 0x4000001, 0x4100000, 0x4100001, 0x100, 0x101, 0x100100,\n    0x100101, 0x4000100, 0x4000101, 0x4100100, 0x4100101\n  ];\n  const pc2bytes2 = [\n    0, 0x8, 0x800, 0x808, 0x1000000, 0x1000008, 0x1000800, 0x1000808, 0, 0x8, 0x800, 0x808,\n    0x1000000, 0x1000008, 0x1000800, 0x1000808\n  ];\n  const pc2bytes3 = [\n    0, 0x200000, 0x8000000, 0x8200000, 0x2000, 0x202000, 0x8002000, 0x8202000, 0x20000, 0x220000,\n    0x8020000, 0x8220000, 0x22000, 0x222000, 0x8022000, 0x8222000\n  ];\n  const pc2bytes4 = [\n    0, 0x40000, 0x10, 0x40010, 0, 0x40000, 0x10, 0x40010, 0x1000, 0x41000, 0x1010, 0x41010, 0x1000,\n    0x41000, 0x1010, 0x41010\n  ];\n  const pc2bytes5 = [\n    0, 0x400, 0x20, 0x420, 0, 0x400, 0x20, 0x420, 0x2000000, 0x2000400, 0x2000020, 0x2000420,\n    0x2000000, 0x2000400, 0x2000020, 0x2000420\n  ];\n  const pc2bytes6 = [\n    0, 0x10000000, 0x80000, 0x10080000, 0x2, 0x10000002, 0x80002, 0x10080002, 0, 0x10000000,\n    0x80000, 0x10080000, 0x2, 0x10000002, 0x80002, 0x10080002\n  ];\n  const pc2bytes7 = [\n    0, 0x10000, 0x800, 0x10800, 0x20000000, 0x20010000, 0x20000800, 0x20010800, 0x20000, 0x30000,\n    0x20800, 0x30800, 0x20020000, 0x20030000, 0x20020800, 0x20030800\n  ];\n  const pc2bytes8 = [\n    0, 0x40000, 0, 0x40000, 0x2, 0x40002, 0x2, 0x40002, 0x2000000, 0x2040000, 0x2000000, 0x2040000,\n    0x2000002, 0x2040002, 0x2000002, 0x2040002\n  ];\n  const pc2bytes9 = [\n    0, 0x10000000, 0x8, 0x10000008, 0, 0x10000000, 0x8, 0x10000008, 0x400, 0x10000400, 0x408,\n    0x10000408, 0x400, 0x10000400, 0x408, 0x10000408\n  ];\n  const pc2bytes10 = [\n    0, 0x20, 0, 0x20, 0x100000, 0x100020, 0x100000, 0x100020, 0x2000, 0x2020, 0x2000, 0x2020,\n    0x102000, 0x102020, 0x102000, 0x102020\n  ];\n  const pc2bytes11 = [\n    0, 0x1000000, 0x200, 0x1000200, 0x200000, 0x1200000, 0x200200, 0x1200200, 0x4000000, 0x5000000,\n    0x4000200, 0x5000200, 0x4200000, 0x5200000, 0x4200200, 0x5200200\n  ];\n  const pc2bytes12 = [\n    0, 0x1000, 0x8000000, 0x8001000, 0x80000, 0x81000, 0x8080000, 0x8081000, 0x10, 0x1010,\n    0x8000010, 0x8001010, 0x80010, 0x81010, 0x8080010, 0x8081010\n  ];\n  const pc2bytes13 = [0, 0x4, 0x100, 0x104, 0, 0x4, 0x100, 0x104, 0x1, 0x5, 0x101, 0x105, 0x1, 0x5, 0x101, 0x105];\n\n  //how many iterations (1 for des, 3 for triple des)\n  const iterations = key.length > 8 ? 3 : 1; //changed by Paul 16/6/2007 to use Triple DES for 9+ byte keys\n  //stores the return keys\n  const keys = new Array(32 * iterations);\n  //now define the left shifts which need to be done\n  const shifts = [0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0];\n  //other variables\n  let lefttemp;\n  let righttemp;\n  let m = 0;\n  let n = 0;\n  let temp;\n\n  for (let j = 0; j < iterations; j++) { //either 1 or 3 iterations\n    let left = (key[m++] << 24) | (key[m++] << 16) | (key[m++] << 8) | key[m++];\n    let right = (key[m++] << 24) | (key[m++] << 16) | (key[m++] << 8) | key[m++];\n\n    temp = ((left >>> 4) ^ right) & 0x0f0f0f0f;\n    right ^= temp;\n    left ^= (temp << 4);\n    temp = ((right >>> -16) ^ left) & 0x0000ffff;\n    left ^= temp;\n    right ^= (temp << -16);\n    temp = ((left >>> 2) ^ right) & 0x33333333;\n    right ^= temp;\n    left ^= (temp << 2);\n    temp = ((right >>> -16) ^ left) & 0x0000ffff;\n    left ^= temp;\n    right ^= (temp << -16);\n    temp = ((left >>> 1) ^ right) & 0x55555555;\n    right ^= temp;\n    left ^= (temp << 1);\n    temp = ((right >>> 8) ^ left) & 0x00ff00ff;\n    left ^= temp;\n    right ^= (temp << 8);\n    temp = ((left >>> 1) ^ right) & 0x55555555;\n    right ^= temp;\n    left ^= (temp << 1);\n\n    //the right side needs to be shifted and to get the last four bits of the left side\n    temp = (left << 8) | ((right >>> 20) & 0x000000f0);\n    //left needs to be put upside down\n    left = (right << 24) | ((right << 8) & 0xff0000) | ((right >>> 8) & 0xff00) | ((right >>> 24) & 0xf0);\n    right = temp;\n\n    //now go through and perform these shifts on the left and right keys\n    for (let i = 0; i < shifts.length; i++) {\n      //shift the keys either one or two bits to the left\n      if (shifts[i]) {\n        left = (left << 2) | (left >>> 26);\n        right = (right << 2) | (right >>> 26);\n      } else {\n        left = (left << 1) | (left >>> 27);\n        right = (right << 1) | (right >>> 27);\n      }\n      left &= -0xf;\n      right &= -0xf;\n\n      //now apply PC-2, in such a way that E is easier when encrypting or decrypting\n      //this conversion will look like PC-2 except only the last 6 bits of each byte are used\n      //rather than 48 consecutive bits and the order of lines will be according to\n      //how the S selection functions will be applied: S2, S4, S6, S8, S1, S3, S5, S7\n      lefttemp = pc2bytes0[left >>> 28] | pc2bytes1[(left >>> 24) & 0xf] | pc2bytes2[(left >>> 20) & 0xf] | pc2bytes3[(\n        left >>> 16) & 0xf] | pc2bytes4[(left >>> 12) & 0xf] | pc2bytes5[(left >>> 8) & 0xf] | pc2bytes6[(left >>> 4) &\n        0xf];\n      righttemp = pc2bytes7[right >>> 28] | pc2bytes8[(right >>> 24) & 0xf] | pc2bytes9[(right >>> 20) & 0xf] |\n        pc2bytes10[(right >>> 16) & 0xf] | pc2bytes11[(right >>> 12) & 0xf] | pc2bytes12[(right >>> 8) & 0xf] |\n        pc2bytes13[(right >>> 4) & 0xf];\n      temp = ((righttemp >>> 16) ^ lefttemp) & 0x0000ffff;\n      keys[n++] = lefttemp ^ temp;\n      keys[n++] = righttemp ^ (temp << 16);\n    }\n  } //for each iterations\n  //return the keys we've created\n  return keys;\n} //end of desCreateKeys\n\n\nfunction desAddPadding(message, padding) {\n  const padLength = 8 - (message.length % 8);\n\n  let pad;\n  if (padding === 2 && (padLength < 8)) { //pad the message with spaces\n    pad = ' '.charCodeAt(0);\n  } else if (padding === 1) { //PKCS7 padding\n    pad = padLength;\n  } else if (!padding && (padLength < 8)) { //pad the message out with null bytes\n    pad = 0;\n  } else if (padLength === 8) {\n    return message;\n  } else {\n    throw new Error('des: invalid padding');\n  }\n\n  const paddedMessage = new Uint8Array(message.length + padLength);\n  for (let i = 0; i < message.length; i++) {\n    paddedMessage[i] = message[i];\n  }\n  for (let j = 0; j < padLength; j++) {\n    paddedMessage[message.length + j] = pad;\n  }\n\n  return paddedMessage;\n}\n\nfunction desRemovePadding(message, padding) {\n  let padLength = null;\n  let pad;\n  if (padding === 2) { // space padded\n    pad = ' '.charCodeAt(0);\n  } else if (padding === 1) { // PKCS7\n    padLength = message[message.length - 1];\n  } else if (!padding) { // null padding\n    pad = 0;\n  } else {\n    throw new Error('des: invalid padding');\n  }\n\n  if (!padLength) {\n    padLength = 1;\n    while (message[message.length - padLength] === pad) {\n      padLength++;\n    }\n    padLength--;\n  }\n\n  return message.subarray(0, message.length - padLength);\n}\n\n// added by Recurity Labs\n\nexport function TripleDES(key) {\n  this.key = [];\n\n  for (let i = 0; i < 3; i++) {\n    this.key.push(new Uint8Array(key.subarray(i * 8, (i * 8) + 8)));\n  }\n\n  this.encrypt = function(block) {\n    return des(\n      desCreateKeys(this.key[2]),\n      des(\n        desCreateKeys(this.key[1]),\n        des(\n          desCreateKeys(this.key[0]),\n          block, true, 0, null, null\n        ),\n        false, 0, null, null\n      ), true, 0, null, null\n    );\n  };\n}\n\nTripleDES.keySize = TripleDES.prototype.keySize = 24;\nTripleDES.blockSize = TripleDES.prototype.blockSize = 8;\n\n// This is \"original\" DES\n\nexport function DES(key) {\n  this.key = key;\n\n  this.encrypt = function(block, padding) {\n    const keys = desCreateKeys(this.key);\n    return des(keys, block, true, 0, null, padding);\n  };\n\n  this.decrypt = function(block, padding) {\n    const keys = desCreateKeys(this.key);\n    return des(keys, block, false, 0, null, padding);\n  };\n}\n","// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// Copyright 2010 pjacobs@xeekr.com . All rights reserved.\n\n// Modified by Recurity Labs GmbH\n\n// fixed/modified by Herbert Hanewinkel, www.haneWIN.de\n// check www.haneWIN.de for the latest version\n\n// cast5.js is a Javascript implementation of CAST-128, as defined in RFC 2144.\n// CAST-128 is a common OpenPGP cipher.\n\n\n// CAST5 constructor\n\nfunction OpenPGPSymEncCAST5() {\n  this.BlockSize = 8;\n  this.KeySize = 16;\n\n  this.setKey = function(key) {\n    this.masking = new Array(16);\n    this.rotate = new Array(16);\n\n    this.reset();\n\n    if (key.length === this.KeySize) {\n      this.keySchedule(key);\n    } else {\n      throw new Error('CAST-128: keys must be 16 bytes');\n    }\n    return true;\n  };\n\n  this.reset = function() {\n    for (let i = 0; i < 16; i++) {\n      this.masking[i] = 0;\n      this.rotate[i] = 0;\n    }\n  };\n\n  this.getBlockSize = function() {\n    return this.BlockSize;\n  };\n\n  this.encrypt = function(src) {\n    const dst = new Array(src.length);\n\n    for (let i = 0; i < src.length; i += 8) {\n      let l = (src[i] << 24) | (src[i + 1] << 16) | (src[i + 2] << 8) | src[i + 3];\n      let r = (src[i + 4] << 24) | (src[i + 5] << 16) | (src[i + 6] << 8) | src[i + 7];\n      let t;\n\n      t = r;\n      r = l ^ f1(r, this.masking[0], this.rotate[0]);\n      l = t;\n      t = r;\n      r = l ^ f2(r, this.masking[1], this.rotate[1]);\n      l = t;\n      t = r;\n      r = l ^ f3(r, this.masking[2], this.rotate[2]);\n      l = t;\n      t = r;\n      r = l ^ f1(r, this.masking[3], this.rotate[3]);\n      l = t;\n\n      t = r;\n      r = l ^ f2(r, this.masking[4], this.rotate[4]);\n      l = t;\n      t = r;\n      r = l ^ f3(r, this.masking[5], this.rotate[5]);\n      l = t;\n      t = r;\n      r = l ^ f1(r, this.masking[6], this.rotate[6]);\n      l = t;\n      t = r;\n      r = l ^ f2(r, this.masking[7], this.rotate[7]);\n      l = t;\n\n      t = r;\n      r = l ^ f3(r, this.masking[8], this.rotate[8]);\n      l = t;\n      t = r;\n      r = l ^ f1(r, this.masking[9], this.rotate[9]);\n      l = t;\n      t = r;\n      r = l ^ f2(r, this.masking[10], this.rotate[10]);\n      l = t;\n      t = r;\n      r = l ^ f3(r, this.masking[11], this.rotate[11]);\n      l = t;\n\n      t = r;\n      r = l ^ f1(r, this.masking[12], this.rotate[12]);\n      l = t;\n      t = r;\n      r = l ^ f2(r, this.masking[13], this.rotate[13]);\n      l = t;\n      t = r;\n      r = l ^ f3(r, this.masking[14], this.rotate[14]);\n      l = t;\n      t = r;\n      r = l ^ f1(r, this.masking[15], this.rotate[15]);\n      l = t;\n\n      dst[i] = (r >>> 24) & 255;\n      dst[i + 1] = (r >>> 16) & 255;\n      dst[i + 2] = (r >>> 8) & 255;\n      dst[i + 3] = r & 255;\n      dst[i + 4] = (l >>> 24) & 255;\n      dst[i + 5] = (l >>> 16) & 255;\n      dst[i + 6] = (l >>> 8) & 255;\n      dst[i + 7] = l & 255;\n    }\n\n    return dst;\n  };\n\n  this.decrypt = function(src) {\n    const dst = new Array(src.length);\n\n    for (let i = 0; i < src.length; i += 8) {\n      let l = (src[i] << 24) | (src[i + 1] << 16) | (src[i + 2] << 8) | src[i + 3];\n      let r = (src[i + 4] << 24) | (src[i + 5] << 16) | (src[i + 6] << 8) | src[i + 7];\n      let t;\n\n      t = r;\n      r = l ^ f1(r, this.masking[15], this.rotate[15]);\n      l = t;\n      t = r;\n      r = l ^ f3(r, this.masking[14], this.rotate[14]);\n      l = t;\n      t = r;\n      r = l ^ f2(r, this.masking[13], this.rotate[13]);\n      l = t;\n      t = r;\n      r = l ^ f1(r, this.masking[12], this.rotate[12]);\n      l = t;\n\n      t = r;\n      r = l ^ f3(r, this.masking[11], this.rotate[11]);\n      l = t;\n      t = r;\n      r = l ^ f2(r, this.masking[10], this.rotate[10]);\n      l = t;\n      t = r;\n      r = l ^ f1(r, this.masking[9], this.rotate[9]);\n      l = t;\n      t = r;\n      r = l ^ f3(r, this.masking[8], this.rotate[8]);\n      l = t;\n\n      t = r;\n      r = l ^ f2(r, this.masking[7], this.rotate[7]);\n      l = t;\n      t = r;\n      r = l ^ f1(r, this.masking[6], this.rotate[6]);\n      l = t;\n      t = r;\n      r = l ^ f3(r, this.masking[5], this.rotate[5]);\n      l = t;\n      t = r;\n      r = l ^ f2(r, this.masking[4], this.rotate[4]);\n      l = t;\n\n      t = r;\n      r = l ^ f1(r, this.masking[3], this.rotate[3]);\n      l = t;\n      t = r;\n      r = l ^ f3(r, this.masking[2], this.rotate[2]);\n      l = t;\n      t = r;\n      r = l ^ f2(r, this.masking[1], this.rotate[1]);\n      l = t;\n      t = r;\n      r = l ^ f1(r, this.masking[0], this.rotate[0]);\n      l = t;\n\n      dst[i] = (r >>> 24) & 255;\n      dst[i + 1] = (r >>> 16) & 255;\n      dst[i + 2] = (r >>> 8) & 255;\n      dst[i + 3] = r & 255;\n      dst[i + 4] = (l >>> 24) & 255;\n      dst[i + 5] = (l >> 16) & 255;\n      dst[i + 6] = (l >> 8) & 255;\n      dst[i + 7] = l & 255;\n    }\n\n    return dst;\n  };\n  const scheduleA = new Array(4);\n\n  scheduleA[0] = new Array(4);\n  scheduleA[0][0] = [4, 0, 0xd, 0xf, 0xc, 0xe, 0x8];\n  scheduleA[0][1] = [5, 2, 16 + 0, 16 + 2, 16 + 1, 16 + 3, 0xa];\n  scheduleA[0][2] = [6, 3, 16 + 7, 16 + 6, 16 + 5, 16 + 4, 9];\n  scheduleA[0][3] = [7, 1, 16 + 0xa, 16 + 9, 16 + 0xb, 16 + 8, 0xb];\n\n  scheduleA[1] = new Array(4);\n  scheduleA[1][0] = [0, 6, 16 + 5, 16 + 7, 16 + 4, 16 + 6, 16 + 0];\n  scheduleA[1][1] = [1, 4, 0, 2, 1, 3, 16 + 2];\n  scheduleA[1][2] = [2, 5, 7, 6, 5, 4, 16 + 1];\n  scheduleA[1][3] = [3, 7, 0xa, 9, 0xb, 8, 16 + 3];\n\n  scheduleA[2] = new Array(4);\n  scheduleA[2][0] = [4, 0, 0xd, 0xf, 0xc, 0xe, 8];\n  scheduleA[2][1] = [5, 2, 16 + 0, 16 + 2, 16 + 1, 16 + 3, 0xa];\n  scheduleA[2][2] = [6, 3, 16 + 7, 16 + 6, 16 + 5, 16 + 4, 9];\n  scheduleA[2][3] = [7, 1, 16 + 0xa, 16 + 9, 16 + 0xb, 16 + 8, 0xb];\n\n\n  scheduleA[3] = new Array(4);\n  scheduleA[3][0] = [0, 6, 16 + 5, 16 + 7, 16 + 4, 16 + 6, 16 + 0];\n  scheduleA[3][1] = [1, 4, 0, 2, 1, 3, 16 + 2];\n  scheduleA[3][2] = [2, 5, 7, 6, 5, 4, 16 + 1];\n  scheduleA[3][3] = [3, 7, 0xa, 9, 0xb, 8, 16 + 3];\n\n  const scheduleB = new Array(4);\n\n  scheduleB[0] = new Array(4);\n  scheduleB[0][0] = [16 + 8, 16 + 9, 16 + 7, 16 + 6, 16 + 2];\n  scheduleB[0][1] = [16 + 0xa, 16 + 0xb, 16 + 5, 16 + 4, 16 + 6];\n  scheduleB[0][2] = [16 + 0xc, 16 + 0xd, 16 + 3, 16 + 2, 16 + 9];\n  scheduleB[0][3] = [16 + 0xe, 16 + 0xf, 16 + 1, 16 + 0, 16 + 0xc];\n\n  scheduleB[1] = new Array(4);\n  scheduleB[1][0] = [3, 2, 0xc, 0xd, 8];\n  scheduleB[1][1] = [1, 0, 0xe, 0xf, 0xd];\n  scheduleB[1][2] = [7, 6, 8, 9, 3];\n  scheduleB[1][3] = [5, 4, 0xa, 0xb, 7];\n\n\n  scheduleB[2] = new Array(4);\n  scheduleB[2][0] = [16 + 3, 16 + 2, 16 + 0xc, 16 + 0xd, 16 + 9];\n  scheduleB[2][1] = [16 + 1, 16 + 0, 16 + 0xe, 16 + 0xf, 16 + 0xc];\n  scheduleB[2][2] = [16 + 7, 16 + 6, 16 + 8, 16 + 9, 16 + 2];\n  scheduleB[2][3] = [16 + 5, 16 + 4, 16 + 0xa, 16 + 0xb, 16 + 6];\n\n\n  scheduleB[3] = new Array(4);\n  scheduleB[3][0] = [8, 9, 7, 6, 3];\n  scheduleB[3][1] = [0xa, 0xb, 5, 4, 7];\n  scheduleB[3][2] = [0xc, 0xd, 3, 2, 8];\n  scheduleB[3][3] = [0xe, 0xf, 1, 0, 0xd];\n\n  // changed 'in' to 'inn' (in javascript 'in' is a reserved word)\n  this.keySchedule = function(inn) {\n    const t = new Array(8);\n    const k = new Array(32);\n\n    let j;\n\n    for (let i = 0; i < 4; i++) {\n      j = i * 4;\n      t[i] = (inn[j] << 24) | (inn[j + 1] << 16) | (inn[j + 2] << 8) | inn[j + 3];\n    }\n\n    const x = [6, 7, 4, 5];\n    let ki = 0;\n    let w;\n\n    for (let half = 0; half < 2; half++) {\n      for (let round = 0; round < 4; round++) {\n        for (j = 0; j < 4; j++) {\n          const a = scheduleA[round][j];\n          w = t[a[1]];\n\n          w ^= sBox[4][(t[a[2] >>> 2] >>> (24 - 8 * (a[2] & 3))) & 0xff];\n          w ^= sBox[5][(t[a[3] >>> 2] >>> (24 - 8 * (a[3] & 3))) & 0xff];\n          w ^= sBox[6][(t[a[4] >>> 2] >>> (24 - 8 * (a[4] & 3))) & 0xff];\n          w ^= sBox[7][(t[a[5] >>> 2] >>> (24 - 8 * (a[5] & 3))) & 0xff];\n          w ^= sBox[x[j]][(t[a[6] >>> 2] >>> (24 - 8 * (a[6] & 3))) & 0xff];\n          t[a[0]] = w;\n        }\n\n        for (j = 0; j < 4; j++) {\n          const b = scheduleB[round][j];\n          w = sBox[4][(t[b[0] >>> 2] >>> (24 - 8 * (b[0] & 3))) & 0xff];\n\n          w ^= sBox[5][(t[b[1] >>> 2] >>> (24 - 8 * (b[1] & 3))) & 0xff];\n          w ^= sBox[6][(t[b[2] >>> 2] >>> (24 - 8 * (b[2] & 3))) & 0xff];\n          w ^= sBox[7][(t[b[3] >>> 2] >>> (24 - 8 * (b[3] & 3))) & 0xff];\n          w ^= sBox[4 + j][(t[b[4] >>> 2] >>> (24 - 8 * (b[4] & 3))) & 0xff];\n          k[ki] = w;\n          ki++;\n        }\n      }\n    }\n\n    for (let i = 0; i < 16; i++) {\n      this.masking[i] = k[i];\n      this.rotate[i] = k[16 + i] & 0x1f;\n    }\n  };\n\n  // These are the three 'f' functions. See RFC 2144, section 2.2.\n\n  function f1(d, m, r) {\n    const t = m + d;\n    const I = (t << r) | (t >>> (32 - r));\n    return ((sBox[0][I >>> 24] ^ sBox[1][(I >>> 16) & 255]) - sBox[2][(I >>> 8) & 255]) + sBox[3][I & 255];\n  }\n\n  function f2(d, m, r) {\n    const t = m ^ d;\n    const I = (t << r) | (t >>> (32 - r));\n    return ((sBox[0][I >>> 24] - sBox[1][(I >>> 16) & 255]) + sBox[2][(I >>> 8) & 255]) ^ sBox[3][I & 255];\n  }\n\n  function f3(d, m, r) {\n    const t = m - d;\n    const I = (t << r) | (t >>> (32 - r));\n    return ((sBox[0][I >>> 24] + sBox[1][(I >>> 16) & 255]) ^ sBox[2][(I >>> 8) & 255]) - sBox[3][I & 255];\n  }\n\n  const sBox = new Array(8);\n  sBox[0] = [\n    0x30fb40d4, 0x9fa0ff0b, 0x6beccd2f, 0x3f258c7a, 0x1e213f2f, 0x9c004dd3, 0x6003e540, 0xcf9fc949,\n    0xbfd4af27, 0x88bbbdb5, 0xe2034090, 0x98d09675, 0x6e63a0e0, 0x15c361d2, 0xc2e7661d, 0x22d4ff8e,\n    0x28683b6f, 0xc07fd059, 0xff2379c8, 0x775f50e2, 0x43c340d3, 0xdf2f8656, 0x887ca41a, 0xa2d2bd2d,\n    0xa1c9e0d6, 0x346c4819, 0x61b76d87, 0x22540f2f, 0x2abe32e1, 0xaa54166b, 0x22568e3a, 0xa2d341d0,\n    0x66db40c8, 0xa784392f, 0x004dff2f, 0x2db9d2de, 0x97943fac, 0x4a97c1d8, 0x527644b7, 0xb5f437a7,\n    0xb82cbaef, 0xd751d159, 0x6ff7f0ed, 0x5a097a1f, 0x827b68d0, 0x90ecf52e, 0x22b0c054, 0xbc8e5935,\n    0x4b6d2f7f, 0x50bb64a2, 0xd2664910, 0xbee5812d, 0xb7332290, 0xe93b159f, 0xb48ee411, 0x4bff345d,\n    0xfd45c240, 0xad31973f, 0xc4f6d02e, 0x55fc8165, 0xd5b1caad, 0xa1ac2dae, 0xa2d4b76d, 0xc19b0c50,\n    0x882240f2, 0x0c6e4f38, 0xa4e4bfd7, 0x4f5ba272, 0x564c1d2f, 0xc59c5319, 0xb949e354, 0xb04669fe,\n    0xb1b6ab8a, 0xc71358dd, 0x6385c545, 0x110f935d, 0x57538ad5, 0x6a390493, 0xe63d37e0, 0x2a54f6b3,\n    0x3a787d5f, 0x6276a0b5, 0x19a6fcdf, 0x7a42206a, 0x29f9d4d5, 0xf61b1891, 0xbb72275e, 0xaa508167,\n    0x38901091, 0xc6b505eb, 0x84c7cb8c, 0x2ad75a0f, 0x874a1427, 0xa2d1936b, 0x2ad286af, 0xaa56d291,\n    0xd7894360, 0x425c750d, 0x93b39e26, 0x187184c9, 0x6c00b32d, 0x73e2bb14, 0xa0bebc3c, 0x54623779,\n    0x64459eab, 0x3f328b82, 0x7718cf82, 0x59a2cea6, 0x04ee002e, 0x89fe78e6, 0x3fab0950, 0x325ff6c2,\n    0x81383f05, 0x6963c5c8, 0x76cb5ad6, 0xd49974c9, 0xca180dcf, 0x380782d5, 0xc7fa5cf6, 0x8ac31511,\n    0x35e79e13, 0x47da91d0, 0xf40f9086, 0xa7e2419e, 0x31366241, 0x051ef495, 0xaa573b04, 0x4a805d8d,\n    0x548300d0, 0x00322a3c, 0xbf64cddf, 0xba57a68e, 0x75c6372b, 0x50afd341, 0xa7c13275, 0x915a0bf5,\n    0x6b54bfab, 0x2b0b1426, 0xab4cc9d7, 0x449ccd82, 0xf7fbf265, 0xab85c5f3, 0x1b55db94, 0xaad4e324,\n    0xcfa4bd3f, 0x2deaa3e2, 0x9e204d02, 0xc8bd25ac, 0xeadf55b3, 0xd5bd9e98, 0xe31231b2, 0x2ad5ad6c,\n    0x954329de, 0xadbe4528, 0xd8710f69, 0xaa51c90f, 0xaa786bf6, 0x22513f1e, 0xaa51a79b, 0x2ad344cc,\n    0x7b5a41f0, 0xd37cfbad, 0x1b069505, 0x41ece491, 0xb4c332e6, 0x032268d4, 0xc9600acc, 0xce387e6d,\n    0xbf6bb16c, 0x6a70fb78, 0x0d03d9c9, 0xd4df39de, 0xe01063da, 0x4736f464, 0x5ad328d8, 0xb347cc96,\n    0x75bb0fc3, 0x98511bfb, 0x4ffbcc35, 0xb58bcf6a, 0xe11f0abc, 0xbfc5fe4a, 0xa70aec10, 0xac39570a,\n    0x3f04442f, 0x6188b153, 0xe0397a2e, 0x5727cb79, 0x9ceb418f, 0x1cacd68d, 0x2ad37c96, 0x0175cb9d,\n    0xc69dff09, 0xc75b65f0, 0xd9db40d8, 0xec0e7779, 0x4744ead4, 0xb11c3274, 0xdd24cb9e, 0x7e1c54bd,\n    0xf01144f9, 0xd2240eb1, 0x9675b3fd, 0xa3ac3755, 0xd47c27af, 0x51c85f4d, 0x56907596, 0xa5bb15e6,\n    0x580304f0, 0xca042cf1, 0x011a37ea, 0x8dbfaadb, 0x35ba3e4a, 0x3526ffa0, 0xc37b4d09, 0xbc306ed9,\n    0x98a52666, 0x5648f725, 0xff5e569d, 0x0ced63d0, 0x7c63b2cf, 0x700b45e1, 0xd5ea50f1, 0x85a92872,\n    0xaf1fbda7, 0xd4234870, 0xa7870bf3, 0x2d3b4d79, 0x42e04198, 0x0cd0ede7, 0x26470db8, 0xf881814c,\n    0x474d6ad7, 0x7c0c5e5c, 0xd1231959, 0x381b7298, 0xf5d2f4db, 0xab838653, 0x6e2f1e23, 0x83719c9e,\n    0xbd91e046, 0x9a56456e, 0xdc39200c, 0x20c8c571, 0x962bda1c, 0xe1e696ff, 0xb141ab08, 0x7cca89b9,\n    0x1a69e783, 0x02cc4843, 0xa2f7c579, 0x429ef47d, 0x427b169c, 0x5ac9f049, 0xdd8f0f00, 0x5c8165bf\n  ];\n\n  sBox[1] = [\n    0x1f201094, 0xef0ba75b, 0x69e3cf7e, 0x393f4380, 0xfe61cf7a, 0xeec5207a, 0x55889c94, 0x72fc0651,\n    0xada7ef79, 0x4e1d7235, 0xd55a63ce, 0xde0436ba, 0x99c430ef, 0x5f0c0794, 0x18dcdb7d, 0xa1d6eff3,\n    0xa0b52f7b, 0x59e83605, 0xee15b094, 0xe9ffd909, 0xdc440086, 0xef944459, 0xba83ccb3, 0xe0c3cdfb,\n    0xd1da4181, 0x3b092ab1, 0xf997f1c1, 0xa5e6cf7b, 0x01420ddb, 0xe4e7ef5b, 0x25a1ff41, 0xe180f806,\n    0x1fc41080, 0x179bee7a, 0xd37ac6a9, 0xfe5830a4, 0x98de8b7f, 0x77e83f4e, 0x79929269, 0x24fa9f7b,\n    0xe113c85b, 0xacc40083, 0xd7503525, 0xf7ea615f, 0x62143154, 0x0d554b63, 0x5d681121, 0xc866c359,\n    0x3d63cf73, 0xcee234c0, 0xd4d87e87, 0x5c672b21, 0x071f6181, 0x39f7627f, 0x361e3084, 0xe4eb573b,\n    0x602f64a4, 0xd63acd9c, 0x1bbc4635, 0x9e81032d, 0x2701f50c, 0x99847ab4, 0xa0e3df79, 0xba6cf38c,\n    0x10843094, 0x2537a95e, 0xf46f6ffe, 0xa1ff3b1f, 0x208cfb6a, 0x8f458c74, 0xd9e0a227, 0x4ec73a34,\n    0xfc884f69, 0x3e4de8df, 0xef0e0088, 0x3559648d, 0x8a45388c, 0x1d804366, 0x721d9bfd, 0xa58684bb,\n    0xe8256333, 0x844e8212, 0x128d8098, 0xfed33fb4, 0xce280ae1, 0x27e19ba5, 0xd5a6c252, 0xe49754bd,\n    0xc5d655dd, 0xeb667064, 0x77840b4d, 0xa1b6a801, 0x84db26a9, 0xe0b56714, 0x21f043b7, 0xe5d05860,\n    0x54f03084, 0x066ff472, 0xa31aa153, 0xdadc4755, 0xb5625dbf, 0x68561be6, 0x83ca6b94, 0x2d6ed23b,\n    0xeccf01db, 0xa6d3d0ba, 0xb6803d5c, 0xaf77a709, 0x33b4a34c, 0x397bc8d6, 0x5ee22b95, 0x5f0e5304,\n    0x81ed6f61, 0x20e74364, 0xb45e1378, 0xde18639b, 0x881ca122, 0xb96726d1, 0x8049a7e8, 0x22b7da7b,\n    0x5e552d25, 0x5272d237, 0x79d2951c, 0xc60d894c, 0x488cb402, 0x1ba4fe5b, 0xa4b09f6b, 0x1ca815cf,\n    0xa20c3005, 0x8871df63, 0xb9de2fcb, 0x0cc6c9e9, 0x0beeff53, 0xe3214517, 0xb4542835, 0x9f63293c,\n    0xee41e729, 0x6e1d2d7c, 0x50045286, 0x1e6685f3, 0xf33401c6, 0x30a22c95, 0x31a70850, 0x60930f13,\n    0x73f98417, 0xa1269859, 0xec645c44, 0x52c877a9, 0xcdff33a6, 0xa02b1741, 0x7cbad9a2, 0x2180036f,\n    0x50d99c08, 0xcb3f4861, 0xc26bd765, 0x64a3f6ab, 0x80342676, 0x25a75e7b, 0xe4e6d1fc, 0x20c710e6,\n    0xcdf0b680, 0x17844d3b, 0x31eef84d, 0x7e0824e4, 0x2ccb49eb, 0x846a3bae, 0x8ff77888, 0xee5d60f6,\n    0x7af75673, 0x2fdd5cdb, 0xa11631c1, 0x30f66f43, 0xb3faec54, 0x157fd7fa, 0xef8579cc, 0xd152de58,\n    0xdb2ffd5e, 0x8f32ce19, 0x306af97a, 0x02f03ef8, 0x99319ad5, 0xc242fa0f, 0xa7e3ebb0, 0xc68e4906,\n    0xb8da230c, 0x80823028, 0xdcdef3c8, 0xd35fb171, 0x088a1bc8, 0xbec0c560, 0x61a3c9e8, 0xbca8f54d,\n    0xc72feffa, 0x22822e99, 0x82c570b4, 0xd8d94e89, 0x8b1c34bc, 0x301e16e6, 0x273be979, 0xb0ffeaa6,\n    0x61d9b8c6, 0x00b24869, 0xb7ffce3f, 0x08dc283b, 0x43daf65a, 0xf7e19798, 0x7619b72f, 0x8f1c9ba4,\n    0xdc8637a0, 0x16a7d3b1, 0x9fc393b7, 0xa7136eeb, 0xc6bcc63e, 0x1a513742, 0xef6828bc, 0x520365d6,\n    0x2d6a77ab, 0x3527ed4b, 0x821fd216, 0x095c6e2e, 0xdb92f2fb, 0x5eea29cb, 0x145892f5, 0x91584f7f,\n    0x5483697b, 0x2667a8cc, 0x85196048, 0x8c4bacea, 0x833860d4, 0x0d23e0f9, 0x6c387e8a, 0x0ae6d249,\n    0xb284600c, 0xd835731d, 0xdcb1c647, 0xac4c56ea, 0x3ebd81b3, 0x230eabb0, 0x6438bc87, 0xf0b5b1fa,\n    0x8f5ea2b3, 0xfc184642, 0x0a036b7a, 0x4fb089bd, 0x649da589, 0xa345415e, 0x5c038323, 0x3e5d3bb9,\n    0x43d79572, 0x7e6dd07c, 0x06dfdf1e, 0x6c6cc4ef, 0x7160a539, 0x73bfbe70, 0x83877605, 0x4523ecf1\n  ];\n\n  sBox[2] = [\n    0x8defc240, 0x25fa5d9f, 0xeb903dbf, 0xe810c907, 0x47607fff, 0x369fe44b, 0x8c1fc644, 0xaececa90,\n    0xbeb1f9bf, 0xeefbcaea, 0xe8cf1950, 0x51df07ae, 0x920e8806, 0xf0ad0548, 0xe13c8d83, 0x927010d5,\n    0x11107d9f, 0x07647db9, 0xb2e3e4d4, 0x3d4f285e, 0xb9afa820, 0xfade82e0, 0xa067268b, 0x8272792e,\n    0x553fb2c0, 0x489ae22b, 0xd4ef9794, 0x125e3fbc, 0x21fffcee, 0x825b1bfd, 0x9255c5ed, 0x1257a240,\n    0x4e1a8302, 0xbae07fff, 0x528246e7, 0x8e57140e, 0x3373f7bf, 0x8c9f8188, 0xa6fc4ee8, 0xc982b5a5,\n    0xa8c01db7, 0x579fc264, 0x67094f31, 0xf2bd3f5f, 0x40fff7c1, 0x1fb78dfc, 0x8e6bd2c1, 0x437be59b,\n    0x99b03dbf, 0xb5dbc64b, 0x638dc0e6, 0x55819d99, 0xa197c81c, 0x4a012d6e, 0xc5884a28, 0xccc36f71,\n    0xb843c213, 0x6c0743f1, 0x8309893c, 0x0feddd5f, 0x2f7fe850, 0xd7c07f7e, 0x02507fbf, 0x5afb9a04,\n    0xa747d2d0, 0x1651192e, 0xaf70bf3e, 0x58c31380, 0x5f98302e, 0x727cc3c4, 0x0a0fb402, 0x0f7fef82,\n    0x8c96fdad, 0x5d2c2aae, 0x8ee99a49, 0x50da88b8, 0x8427f4a0, 0x1eac5790, 0x796fb449, 0x8252dc15,\n    0xefbd7d9b, 0xa672597d, 0xada840d8, 0x45f54504, 0xfa5d7403, 0xe83ec305, 0x4f91751a, 0x925669c2,\n    0x23efe941, 0xa903f12e, 0x60270df2, 0x0276e4b6, 0x94fd6574, 0x927985b2, 0x8276dbcb, 0x02778176,\n    0xf8af918d, 0x4e48f79e, 0x8f616ddf, 0xe29d840e, 0x842f7d83, 0x340ce5c8, 0x96bbb682, 0x93b4b148,\n    0xef303cab, 0x984faf28, 0x779faf9b, 0x92dc560d, 0x224d1e20, 0x8437aa88, 0x7d29dc96, 0x2756d3dc,\n    0x8b907cee, 0xb51fd240, 0xe7c07ce3, 0xe566b4a1, 0xc3e9615e, 0x3cf8209d, 0x6094d1e3, 0xcd9ca341,\n    0x5c76460e, 0x00ea983b, 0xd4d67881, 0xfd47572c, 0xf76cedd9, 0xbda8229c, 0x127dadaa, 0x438a074e,\n    0x1f97c090, 0x081bdb8a, 0x93a07ebe, 0xb938ca15, 0x97b03cff, 0x3dc2c0f8, 0x8d1ab2ec, 0x64380e51,\n    0x68cc7bfb, 0xd90f2788, 0x12490181, 0x5de5ffd4, 0xdd7ef86a, 0x76a2e214, 0xb9a40368, 0x925d958f,\n    0x4b39fffa, 0xba39aee9, 0xa4ffd30b, 0xfaf7933b, 0x6d498623, 0x193cbcfa, 0x27627545, 0x825cf47a,\n    0x61bd8ba0, 0xd11e42d1, 0xcead04f4, 0x127ea392, 0x10428db7, 0x8272a972, 0x9270c4a8, 0x127de50b,\n    0x285ba1c8, 0x3c62f44f, 0x35c0eaa5, 0xe805d231, 0x428929fb, 0xb4fcdf82, 0x4fb66a53, 0x0e7dc15b,\n    0x1f081fab, 0x108618ae, 0xfcfd086d, 0xf9ff2889, 0x694bcc11, 0x236a5cae, 0x12deca4d, 0x2c3f8cc5,\n    0xd2d02dfe, 0xf8ef5896, 0xe4cf52da, 0x95155b67, 0x494a488c, 0xb9b6a80c, 0x5c8f82bc, 0x89d36b45,\n    0x3a609437, 0xec00c9a9, 0x44715253, 0x0a874b49, 0xd773bc40, 0x7c34671c, 0x02717ef6, 0x4feb5536,\n    0xa2d02fff, 0xd2bf60c4, 0xd43f03c0, 0x50b4ef6d, 0x07478cd1, 0x006e1888, 0xa2e53f55, 0xb9e6d4bc,\n    0xa2048016, 0x97573833, 0xd7207d67, 0xde0f8f3d, 0x72f87b33, 0xabcc4f33, 0x7688c55d, 0x7b00a6b0,\n    0x947b0001, 0x570075d2, 0xf9bb88f8, 0x8942019e, 0x4264a5ff, 0x856302e0, 0x72dbd92b, 0xee971b69,\n    0x6ea22fde, 0x5f08ae2b, 0xaf7a616d, 0xe5c98767, 0xcf1febd2, 0x61efc8c2, 0xf1ac2571, 0xcc8239c2,\n    0x67214cb8, 0xb1e583d1, 0xb7dc3e62, 0x7f10bdce, 0xf90a5c38, 0x0ff0443d, 0x606e6dc6, 0x60543a49,\n    0x5727c148, 0x2be98a1d, 0x8ab41738, 0x20e1be24, 0xaf96da0f, 0x68458425, 0x99833be5, 0x600d457d,\n    0x282f9350, 0x8334b362, 0xd91d1120, 0x2b6d8da0, 0x642b1e31, 0x9c305a00, 0x52bce688, 0x1b03588a,\n    0xf7baefd5, 0x4142ed9c, 0xa4315c11, 0x83323ec5, 0xdfef4636, 0xa133c501, 0xe9d3531c, 0xee353783\n  ];\n\n  sBox[3] = [\n    0x9db30420, 0x1fb6e9de, 0xa7be7bef, 0xd273a298, 0x4a4f7bdb, 0x64ad8c57, 0x85510443, 0xfa020ed1,\n    0x7e287aff, 0xe60fb663, 0x095f35a1, 0x79ebf120, 0xfd059d43, 0x6497b7b1, 0xf3641f63, 0x241e4adf,\n    0x28147f5f, 0x4fa2b8cd, 0xc9430040, 0x0cc32220, 0xfdd30b30, 0xc0a5374f, 0x1d2d00d9, 0x24147b15,\n    0xee4d111a, 0x0fca5167, 0x71ff904c, 0x2d195ffe, 0x1a05645f, 0x0c13fefe, 0x081b08ca, 0x05170121,\n    0x80530100, 0xe83e5efe, 0xac9af4f8, 0x7fe72701, 0xd2b8ee5f, 0x06df4261, 0xbb9e9b8a, 0x7293ea25,\n    0xce84ffdf, 0xf5718801, 0x3dd64b04, 0xa26f263b, 0x7ed48400, 0x547eebe6, 0x446d4ca0, 0x6cf3d6f5,\n    0x2649abdf, 0xaea0c7f5, 0x36338cc1, 0x503f7e93, 0xd3772061, 0x11b638e1, 0x72500e03, 0xf80eb2bb,\n    0xabe0502e, 0xec8d77de, 0x57971e81, 0xe14f6746, 0xc9335400, 0x6920318f, 0x081dbb99, 0xffc304a5,\n    0x4d351805, 0x7f3d5ce3, 0xa6c866c6, 0x5d5bcca9, 0xdaec6fea, 0x9f926f91, 0x9f46222f, 0x3991467d,\n    0xa5bf6d8e, 0x1143c44f, 0x43958302, 0xd0214eeb, 0x022083b8, 0x3fb6180c, 0x18f8931e, 0x281658e6,\n    0x26486e3e, 0x8bd78a70, 0x7477e4c1, 0xb506e07c, 0xf32d0a25, 0x79098b02, 0xe4eabb81, 0x28123b23,\n    0x69dead38, 0x1574ca16, 0xdf871b62, 0x211c40b7, 0xa51a9ef9, 0x0014377b, 0x041e8ac8, 0x09114003,\n    0xbd59e4d2, 0xe3d156d5, 0x4fe876d5, 0x2f91a340, 0x557be8de, 0x00eae4a7, 0x0ce5c2ec, 0x4db4bba6,\n    0xe756bdff, 0xdd3369ac, 0xec17b035, 0x06572327, 0x99afc8b0, 0x56c8c391, 0x6b65811c, 0x5e146119,\n    0x6e85cb75, 0xbe07c002, 0xc2325577, 0x893ff4ec, 0x5bbfc92d, 0xd0ec3b25, 0xb7801ab7, 0x8d6d3b24,\n    0x20c763ef, 0xc366a5fc, 0x9c382880, 0x0ace3205, 0xaac9548a, 0xeca1d7c7, 0x041afa32, 0x1d16625a,\n    0x6701902c, 0x9b757a54, 0x31d477f7, 0x9126b031, 0x36cc6fdb, 0xc70b8b46, 0xd9e66a48, 0x56e55a79,\n    0x026a4ceb, 0x52437eff, 0x2f8f76b4, 0x0df980a5, 0x8674cde3, 0xedda04eb, 0x17a9be04, 0x2c18f4df,\n    0xb7747f9d, 0xab2af7b4, 0xefc34d20, 0x2e096b7c, 0x1741a254, 0xe5b6a035, 0x213d42f6, 0x2c1c7c26,\n    0x61c2f50f, 0x6552daf9, 0xd2c231f8, 0x25130f69, 0xd8167fa2, 0x0418f2c8, 0x001a96a6, 0x0d1526ab,\n    0x63315c21, 0x5e0a72ec, 0x49bafefd, 0x187908d9, 0x8d0dbd86, 0x311170a7, 0x3e9b640c, 0xcc3e10d7,\n    0xd5cad3b6, 0x0caec388, 0xf73001e1, 0x6c728aff, 0x71eae2a1, 0x1f9af36e, 0xcfcbd12f, 0xc1de8417,\n    0xac07be6b, 0xcb44a1d8, 0x8b9b0f56, 0x013988c3, 0xb1c52fca, 0xb4be31cd, 0xd8782806, 0x12a3a4e2,\n    0x6f7de532, 0x58fd7eb6, 0xd01ee900, 0x24adffc2, 0xf4990fc5, 0x9711aac5, 0x001d7b95, 0x82e5e7d2,\n    0x109873f6, 0x00613096, 0xc32d9521, 0xada121ff, 0x29908415, 0x7fbb977f, 0xaf9eb3db, 0x29c9ed2a,\n    0x5ce2a465, 0xa730f32c, 0xd0aa3fe8, 0x8a5cc091, 0xd49e2ce7, 0x0ce454a9, 0xd60acd86, 0x015f1919,\n    0x77079103, 0xdea03af6, 0x78a8565e, 0xdee356df, 0x21f05cbe, 0x8b75e387, 0xb3c50651, 0xb8a5c3ef,\n    0xd8eeb6d2, 0xe523be77, 0xc2154529, 0x2f69efdf, 0xafe67afb, 0xf470c4b2, 0xf3e0eb5b, 0xd6cc9876,\n    0x39e4460c, 0x1fda8538, 0x1987832f, 0xca007367, 0xa99144f8, 0x296b299e, 0x492fc295, 0x9266beab,\n    0xb5676e69, 0x9bd3ddda, 0xdf7e052f, 0xdb25701c, 0x1b5e51ee, 0xf65324e6, 0x6afce36c, 0x0316cc04,\n    0x8644213e, 0xb7dc59d0, 0x7965291f, 0xccd6fd43, 0x41823979, 0x932bcdf6, 0xb657c34d, 0x4edfd282,\n    0x7ae5290c, 0x3cb9536b, 0x851e20fe, 0x9833557e, 0x13ecf0b0, 0xd3ffb372, 0x3f85c5c1, 0x0aef7ed2\n  ];\n\n  sBox[4] = [\n    0x7ec90c04, 0x2c6e74b9, 0x9b0e66df, 0xa6337911, 0xb86a7fff, 0x1dd358f5, 0x44dd9d44, 0x1731167f,\n    0x08fbf1fa, 0xe7f511cc, 0xd2051b00, 0x735aba00, 0x2ab722d8, 0x386381cb, 0xacf6243a, 0x69befd7a,\n    0xe6a2e77f, 0xf0c720cd, 0xc4494816, 0xccf5c180, 0x38851640, 0x15b0a848, 0xe68b18cb, 0x4caadeff,\n    0x5f480a01, 0x0412b2aa, 0x259814fc, 0x41d0efe2, 0x4e40b48d, 0x248eb6fb, 0x8dba1cfe, 0x41a99b02,\n    0x1a550a04, 0xba8f65cb, 0x7251f4e7, 0x95a51725, 0xc106ecd7, 0x97a5980a, 0xc539b9aa, 0x4d79fe6a,\n    0xf2f3f763, 0x68af8040, 0xed0c9e56, 0x11b4958b, 0xe1eb5a88, 0x8709e6b0, 0xd7e07156, 0x4e29fea7,\n    0x6366e52d, 0x02d1c000, 0xc4ac8e05, 0x9377f571, 0x0c05372a, 0x578535f2, 0x2261be02, 0xd642a0c9,\n    0xdf13a280, 0x74b55bd2, 0x682199c0, 0xd421e5ec, 0x53fb3ce8, 0xc8adedb3, 0x28a87fc9, 0x3d959981,\n    0x5c1ff900, 0xfe38d399, 0x0c4eff0b, 0x062407ea, 0xaa2f4fb1, 0x4fb96976, 0x90c79505, 0xb0a8a774,\n    0xef55a1ff, 0xe59ca2c2, 0xa6b62d27, 0xe66a4263, 0xdf65001f, 0x0ec50966, 0xdfdd55bc, 0x29de0655,\n    0x911e739a, 0x17af8975, 0x32c7911c, 0x89f89468, 0x0d01e980, 0x524755f4, 0x03b63cc9, 0x0cc844b2,\n    0xbcf3f0aa, 0x87ac36e9, 0xe53a7426, 0x01b3d82b, 0x1a9e7449, 0x64ee2d7e, 0xcddbb1da, 0x01c94910,\n    0xb868bf80, 0x0d26f3fd, 0x9342ede7, 0x04a5c284, 0x636737b6, 0x50f5b616, 0xf24766e3, 0x8eca36c1,\n    0x136e05db, 0xfef18391, 0xfb887a37, 0xd6e7f7d4, 0xc7fb7dc9, 0x3063fcdf, 0xb6f589de, 0xec2941da,\n    0x26e46695, 0xb7566419, 0xf654efc5, 0xd08d58b7, 0x48925401, 0xc1bacb7f, 0xe5ff550f, 0xb6083049,\n    0x5bb5d0e8, 0x87d72e5a, 0xab6a6ee1, 0x223a66ce, 0xc62bf3cd, 0x9e0885f9, 0x68cb3e47, 0x086c010f,\n    0xa21de820, 0xd18b69de, 0xf3f65777, 0xfa02c3f6, 0x407edac3, 0xcbb3d550, 0x1793084d, 0xb0d70eba,\n    0x0ab378d5, 0xd951fb0c, 0xded7da56, 0x4124bbe4, 0x94ca0b56, 0x0f5755d1, 0xe0e1e56e, 0x6184b5be,\n    0x580a249f, 0x94f74bc0, 0xe327888e, 0x9f7b5561, 0xc3dc0280, 0x05687715, 0x646c6bd7, 0x44904db3,\n    0x66b4f0a3, 0xc0f1648a, 0x697ed5af, 0x49e92ff6, 0x309e374f, 0x2cb6356a, 0x85808573, 0x4991f840,\n    0x76f0ae02, 0x083be84d, 0x28421c9a, 0x44489406, 0x736e4cb8, 0xc1092910, 0x8bc95fc6, 0x7d869cf4,\n    0x134f616f, 0x2e77118d, 0xb31b2be1, 0xaa90b472, 0x3ca5d717, 0x7d161bba, 0x9cad9010, 0xaf462ba2,\n    0x9fe459d2, 0x45d34559, 0xd9f2da13, 0xdbc65487, 0xf3e4f94e, 0x176d486f, 0x097c13ea, 0x631da5c7,\n    0x445f7382, 0x175683f4, 0xcdc66a97, 0x70be0288, 0xb3cdcf72, 0x6e5dd2f3, 0x20936079, 0x459b80a5,\n    0xbe60e2db, 0xa9c23101, 0xeba5315c, 0x224e42f2, 0x1c5c1572, 0xf6721b2c, 0x1ad2fff3, 0x8c25404e,\n    0x324ed72f, 0x4067b7fd, 0x0523138e, 0x5ca3bc78, 0xdc0fd66e, 0x75922283, 0x784d6b17, 0x58ebb16e,\n    0x44094f85, 0x3f481d87, 0xfcfeae7b, 0x77b5ff76, 0x8c2302bf, 0xaaf47556, 0x5f46b02a, 0x2b092801,\n    0x3d38f5f7, 0x0ca81f36, 0x52af4a8a, 0x66d5e7c0, 0xdf3b0874, 0x95055110, 0x1b5ad7a8, 0xf61ed5ad,\n    0x6cf6e479, 0x20758184, 0xd0cefa65, 0x88f7be58, 0x4a046826, 0x0ff6f8f3, 0xa09c7f70, 0x5346aba0,\n    0x5ce96c28, 0xe176eda3, 0x6bac307f, 0x376829d2, 0x85360fa9, 0x17e3fe2a, 0x24b79767, 0xf5a96b20,\n    0xd6cd2595, 0x68ff1ebf, 0x7555442c, 0xf19f06be, 0xf9e0659a, 0xeeb9491d, 0x34010718, 0xbb30cab8,\n    0xe822fe15, 0x88570983, 0x750e6249, 0xda627e55, 0x5e76ffa8, 0xb1534546, 0x6d47de08, 0xefe9e7d4\n  ];\n\n  sBox[5] = [\n    0xf6fa8f9d, 0x2cac6ce1, 0x4ca34867, 0xe2337f7c, 0x95db08e7, 0x016843b4, 0xeced5cbc, 0x325553ac,\n    0xbf9f0960, 0xdfa1e2ed, 0x83f0579d, 0x63ed86b9, 0x1ab6a6b8, 0xde5ebe39, 0xf38ff732, 0x8989b138,\n    0x33f14961, 0xc01937bd, 0xf506c6da, 0xe4625e7e, 0xa308ea99, 0x4e23e33c, 0x79cbd7cc, 0x48a14367,\n    0xa3149619, 0xfec94bd5, 0xa114174a, 0xeaa01866, 0xa084db2d, 0x09a8486f, 0xa888614a, 0x2900af98,\n    0x01665991, 0xe1992863, 0xc8f30c60, 0x2e78ef3c, 0xd0d51932, 0xcf0fec14, 0xf7ca07d2, 0xd0a82072,\n    0xfd41197e, 0x9305a6b0, 0xe86be3da, 0x74bed3cd, 0x372da53c, 0x4c7f4448, 0xdab5d440, 0x6dba0ec3,\n    0x083919a7, 0x9fbaeed9, 0x49dbcfb0, 0x4e670c53, 0x5c3d9c01, 0x64bdb941, 0x2c0e636a, 0xba7dd9cd,\n    0xea6f7388, 0xe70bc762, 0x35f29adb, 0x5c4cdd8d, 0xf0d48d8c, 0xb88153e2, 0x08a19866, 0x1ae2eac8,\n    0x284caf89, 0xaa928223, 0x9334be53, 0x3b3a21bf, 0x16434be3, 0x9aea3906, 0xefe8c36e, 0xf890cdd9,\n    0x80226dae, 0xc340a4a3, 0xdf7e9c09, 0xa694a807, 0x5b7c5ecc, 0x221db3a6, 0x9a69a02f, 0x68818a54,\n    0xceb2296f, 0x53c0843a, 0xfe893655, 0x25bfe68a, 0xb4628abc, 0xcf222ebf, 0x25ac6f48, 0xa9a99387,\n    0x53bddb65, 0xe76ffbe7, 0xe967fd78, 0x0ba93563, 0x8e342bc1, 0xe8a11be9, 0x4980740d, 0xc8087dfc,\n    0x8de4bf99, 0xa11101a0, 0x7fd37975, 0xda5a26c0, 0xe81f994f, 0x9528cd89, 0xfd339fed, 0xb87834bf,\n    0x5f04456d, 0x22258698, 0xc9c4c83b, 0x2dc156be, 0x4f628daa, 0x57f55ec5, 0xe2220abe, 0xd2916ebf,\n    0x4ec75b95, 0x24f2c3c0, 0x42d15d99, 0xcd0d7fa0, 0x7b6e27ff, 0xa8dc8af0, 0x7345c106, 0xf41e232f,\n    0x35162386, 0xe6ea8926, 0x3333b094, 0x157ec6f2, 0x372b74af, 0x692573e4, 0xe9a9d848, 0xf3160289,\n    0x3a62ef1d, 0xa787e238, 0xf3a5f676, 0x74364853, 0x20951063, 0x4576698d, 0xb6fad407, 0x592af950,\n    0x36f73523, 0x4cfb6e87, 0x7da4cec0, 0x6c152daa, 0xcb0396a8, 0xc50dfe5d, 0xfcd707ab, 0x0921c42f,\n    0x89dff0bb, 0x5fe2be78, 0x448f4f33, 0x754613c9, 0x2b05d08d, 0x48b9d585, 0xdc049441, 0xc8098f9b,\n    0x7dede786, 0xc39a3373, 0x42410005, 0x6a091751, 0x0ef3c8a6, 0x890072d6, 0x28207682, 0xa9a9f7be,\n    0xbf32679d, 0xd45b5b75, 0xb353fd00, 0xcbb0e358, 0x830f220a, 0x1f8fb214, 0xd372cf08, 0xcc3c4a13,\n    0x8cf63166, 0x061c87be, 0x88c98f88, 0x6062e397, 0x47cf8e7a, 0xb6c85283, 0x3cc2acfb, 0x3fc06976,\n    0x4e8f0252, 0x64d8314d, 0xda3870e3, 0x1e665459, 0xc10908f0, 0x513021a5, 0x6c5b68b7, 0x822f8aa0,\n    0x3007cd3e, 0x74719eef, 0xdc872681, 0x073340d4, 0x7e432fd9, 0x0c5ec241, 0x8809286c, 0xf592d891,\n    0x08a930f6, 0x957ef305, 0xb7fbffbd, 0xc266e96f, 0x6fe4ac98, 0xb173ecc0, 0xbc60b42a, 0x953498da,\n    0xfba1ae12, 0x2d4bd736, 0x0f25faab, 0xa4f3fceb, 0xe2969123, 0x257f0c3d, 0x9348af49, 0x361400bc,\n    0xe8816f4a, 0x3814f200, 0xa3f94043, 0x9c7a54c2, 0xbc704f57, 0xda41e7f9, 0xc25ad33a, 0x54f4a084,\n    0xb17f5505, 0x59357cbe, 0xedbd15c8, 0x7f97c5ab, 0xba5ac7b5, 0xb6f6deaf, 0x3a479c3a, 0x5302da25,\n    0x653d7e6a, 0x54268d49, 0x51a477ea, 0x5017d55b, 0xd7d25d88, 0x44136c76, 0x0404a8c8, 0xb8e5a121,\n    0xb81a928a, 0x60ed5869, 0x97c55b96, 0xeaec991b, 0x29935913, 0x01fdb7f1, 0x088e8dfa, 0x9ab6f6f5,\n    0x3b4cbf9f, 0x4a5de3ab, 0xe6051d35, 0xa0e1d855, 0xd36b4cf1, 0xf544edeb, 0xb0e93524, 0xbebb8fbd,\n    0xa2d762cf, 0x49c92f54, 0x38b5f331, 0x7128a454, 0x48392905, 0xa65b1db8, 0x851c97bd, 0xd675cf2f\n  ];\n\n  sBox[6] = [\n    0x85e04019, 0x332bf567, 0x662dbfff, 0xcfc65693, 0x2a8d7f6f, 0xab9bc912, 0xde6008a1, 0x2028da1f,\n    0x0227bce7, 0x4d642916, 0x18fac300, 0x50f18b82, 0x2cb2cb11, 0xb232e75c, 0x4b3695f2, 0xb28707de,\n    0xa05fbcf6, 0xcd4181e9, 0xe150210c, 0xe24ef1bd, 0xb168c381, 0xfde4e789, 0x5c79b0d8, 0x1e8bfd43,\n    0x4d495001, 0x38be4341, 0x913cee1d, 0x92a79c3f, 0x089766be, 0xbaeeadf4, 0x1286becf, 0xb6eacb19,\n    0x2660c200, 0x7565bde4, 0x64241f7a, 0x8248dca9, 0xc3b3ad66, 0x28136086, 0x0bd8dfa8, 0x356d1cf2,\n    0x107789be, 0xb3b2e9ce, 0x0502aa8f, 0x0bc0351e, 0x166bf52a, 0xeb12ff82, 0xe3486911, 0xd34d7516,\n    0x4e7b3aff, 0x5f43671b, 0x9cf6e037, 0x4981ac83, 0x334266ce, 0x8c9341b7, 0xd0d854c0, 0xcb3a6c88,\n    0x47bc2829, 0x4725ba37, 0xa66ad22b, 0x7ad61f1e, 0x0c5cbafa, 0x4437f107, 0xb6e79962, 0x42d2d816,\n    0x0a961288, 0xe1a5c06e, 0x13749e67, 0x72fc081a, 0xb1d139f7, 0xf9583745, 0xcf19df58, 0xbec3f756,\n    0xc06eba30, 0x07211b24, 0x45c28829, 0xc95e317f, 0xbc8ec511, 0x38bc46e9, 0xc6e6fa14, 0xbae8584a,\n    0xad4ebc46, 0x468f508b, 0x7829435f, 0xf124183b, 0x821dba9f, 0xaff60ff4, 0xea2c4e6d, 0x16e39264,\n    0x92544a8b, 0x009b4fc3, 0xaba68ced, 0x9ac96f78, 0x06a5b79a, 0xb2856e6e, 0x1aec3ca9, 0xbe838688,\n    0x0e0804e9, 0x55f1be56, 0xe7e5363b, 0xb3a1f25d, 0xf7debb85, 0x61fe033c, 0x16746233, 0x3c034c28,\n    0xda6d0c74, 0x79aac56c, 0x3ce4e1ad, 0x51f0c802, 0x98f8f35a, 0x1626a49f, 0xeed82b29, 0x1d382fe3,\n    0x0c4fb99a, 0xbb325778, 0x3ec6d97b, 0x6e77a6a9, 0xcb658b5c, 0xd45230c7, 0x2bd1408b, 0x60c03eb7,\n    0xb9068d78, 0xa33754f4, 0xf430c87d, 0xc8a71302, 0xb96d8c32, 0xebd4e7be, 0xbe8b9d2d, 0x7979fb06,\n    0xe7225308, 0x8b75cf77, 0x11ef8da4, 0xe083c858, 0x8d6b786f, 0x5a6317a6, 0xfa5cf7a0, 0x5dda0033,\n    0xf28ebfb0, 0xf5b9c310, 0xa0eac280, 0x08b9767a, 0xa3d9d2b0, 0x79d34217, 0x021a718d, 0x9ac6336a,\n    0x2711fd60, 0x438050e3, 0x069908a8, 0x3d7fedc4, 0x826d2bef, 0x4eeb8476, 0x488dcf25, 0x36c9d566,\n    0x28e74e41, 0xc2610aca, 0x3d49a9cf, 0xbae3b9df, 0xb65f8de6, 0x92aeaf64, 0x3ac7d5e6, 0x9ea80509,\n    0xf22b017d, 0xa4173f70, 0xdd1e16c3, 0x15e0d7f9, 0x50b1b887, 0x2b9f4fd5, 0x625aba82, 0x6a017962,\n    0x2ec01b9c, 0x15488aa9, 0xd716e740, 0x40055a2c, 0x93d29a22, 0xe32dbf9a, 0x058745b9, 0x3453dc1e,\n    0xd699296e, 0x496cff6f, 0x1c9f4986, 0xdfe2ed07, 0xb87242d1, 0x19de7eae, 0x053e561a, 0x15ad6f8c,\n    0x66626c1c, 0x7154c24c, 0xea082b2a, 0x93eb2939, 0x17dcb0f0, 0x58d4f2ae, 0x9ea294fb, 0x52cf564c,\n    0x9883fe66, 0x2ec40581, 0x763953c3, 0x01d6692e, 0xd3a0c108, 0xa1e7160e, 0xe4f2dfa6, 0x693ed285,\n    0x74904698, 0x4c2b0edd, 0x4f757656, 0x5d393378, 0xa132234f, 0x3d321c5d, 0xc3f5e194, 0x4b269301,\n    0xc79f022f, 0x3c997e7e, 0x5e4f9504, 0x3ffafbbd, 0x76f7ad0e, 0x296693f4, 0x3d1fce6f, 0xc61e45be,\n    0xd3b5ab34, 0xf72bf9b7, 0x1b0434c0, 0x4e72b567, 0x5592a33d, 0xb5229301, 0xcfd2a87f, 0x60aeb767,\n    0x1814386b, 0x30bcc33d, 0x38a0c07d, 0xfd1606f2, 0xc363519b, 0x589dd390, 0x5479f8e6, 0x1cb8d647,\n    0x97fd61a9, 0xea7759f4, 0x2d57539d, 0x569a58cf, 0xe84e63ad, 0x462e1b78, 0x6580f87e, 0xf3817914,\n    0x91da55f4, 0x40a230f3, 0xd1988f35, 0xb6e318d2, 0x3ffa50bc, 0x3d40f021, 0xc3c0bdae, 0x4958c24c,\n    0x518f36b2, 0x84b1d370, 0x0fedce83, 0x878ddada, 0xf2a279c7, 0x94e01be8, 0x90716f4b, 0x954b8aa3\n  ];\n\n  sBox[7] = [\n    0xe216300d, 0xbbddfffc, 0xa7ebdabd, 0x35648095, 0x7789f8b7, 0xe6c1121b, 0x0e241600, 0x052ce8b5,\n    0x11a9cfb0, 0xe5952f11, 0xece7990a, 0x9386d174, 0x2a42931c, 0x76e38111, 0xb12def3a, 0x37ddddfc,\n    0xde9adeb1, 0x0a0cc32c, 0xbe197029, 0x84a00940, 0xbb243a0f, 0xb4d137cf, 0xb44e79f0, 0x049eedfd,\n    0x0b15a15d, 0x480d3168, 0x8bbbde5a, 0x669ded42, 0xc7ece831, 0x3f8f95e7, 0x72df191b, 0x7580330d,\n    0x94074251, 0x5c7dcdfa, 0xabbe6d63, 0xaa402164, 0xb301d40a, 0x02e7d1ca, 0x53571dae, 0x7a3182a2,\n    0x12a8ddec, 0xfdaa335d, 0x176f43e8, 0x71fb46d4, 0x38129022, 0xce949ad4, 0xb84769ad, 0x965bd862,\n    0x82f3d055, 0x66fb9767, 0x15b80b4e, 0x1d5b47a0, 0x4cfde06f, 0xc28ec4b8, 0x57e8726e, 0x647a78fc,\n    0x99865d44, 0x608bd593, 0x6c200e03, 0x39dc5ff6, 0x5d0b00a3, 0xae63aff2, 0x7e8bd632, 0x70108c0c,\n    0xbbd35049, 0x2998df04, 0x980cf42a, 0x9b6df491, 0x9e7edd53, 0x06918548, 0x58cb7e07, 0x3b74ef2e,\n    0x522fffb1, 0xd24708cc, 0x1c7e27cd, 0xa4eb215b, 0x3cf1d2e2, 0x19b47a38, 0x424f7618, 0x35856039,\n    0x9d17dee7, 0x27eb35e6, 0xc9aff67b, 0x36baf5b8, 0x09c467cd, 0xc18910b1, 0xe11dbf7b, 0x06cd1af8,\n    0x7170c608, 0x2d5e3354, 0xd4de495a, 0x64c6d006, 0xbcc0c62c, 0x3dd00db3, 0x708f8f34, 0x77d51b42,\n    0x264f620f, 0x24b8d2bf, 0x15c1b79e, 0x46a52564, 0xf8d7e54e, 0x3e378160, 0x7895cda5, 0x859c15a5,\n    0xe6459788, 0xc37bc75f, 0xdb07ba0c, 0x0676a3ab, 0x7f229b1e, 0x31842e7b, 0x24259fd7, 0xf8bef472,\n    0x835ffcb8, 0x6df4c1f2, 0x96f5b195, 0xfd0af0fc, 0xb0fe134c, 0xe2506d3d, 0x4f9b12ea, 0xf215f225,\n    0xa223736f, 0x9fb4c428, 0x25d04979, 0x34c713f8, 0xc4618187, 0xea7a6e98, 0x7cd16efc, 0x1436876c,\n    0xf1544107, 0xbedeee14, 0x56e9af27, 0xa04aa441, 0x3cf7c899, 0x92ecbae6, 0xdd67016d, 0x151682eb,\n    0xa842eedf, 0xfdba60b4, 0xf1907b75, 0x20e3030f, 0x24d8c29e, 0xe139673b, 0xefa63fb8, 0x71873054,\n    0xb6f2cf3b, 0x9f326442, 0xcb15a4cc, 0xb01a4504, 0xf1e47d8d, 0x844a1be5, 0xbae7dfdc, 0x42cbda70,\n    0xcd7dae0a, 0x57e85b7a, 0xd53f5af6, 0x20cf4d8c, 0xcea4d428, 0x79d130a4, 0x3486ebfb, 0x33d3cddc,\n    0x77853b53, 0x37effcb5, 0xc5068778, 0xe580b3e6, 0x4e68b8f4, 0xc5c8b37e, 0x0d809ea2, 0x398feb7c,\n    0x132a4f94, 0x43b7950e, 0x2fee7d1c, 0x223613bd, 0xdd06caa2, 0x37df932b, 0xc4248289, 0xacf3ebc3,\n    0x5715f6b7, 0xef3478dd, 0xf267616f, 0xc148cbe4, 0x9052815e, 0x5e410fab, 0xb48a2465, 0x2eda7fa4,\n    0xe87b40e4, 0xe98ea084, 0x5889e9e1, 0xefd390fc, 0xdd07d35b, 0xdb485694, 0x38d7e5b2, 0x57720101,\n    0x730edebc, 0x5b643113, 0x94917e4f, 0x503c2fba, 0x646f1282, 0x7523d24a, 0xe0779695, 0xf9c17a8f,\n    0x7a5b2121, 0xd187b896, 0x29263a4d, 0xba510cdf, 0x81f47c9f, 0xad1163ed, 0xea7b5965, 0x1a00726e,\n    0x11403092, 0x00da6d77, 0x4a0cdd61, 0xad1f4603, 0x605bdfb0, 0x9eedc364, 0x22ebe6a8, 0xcee7d28a,\n    0xa0e736a0, 0x5564a6b9, 0x10853209, 0xc7eb8f37, 0x2de705ca, 0x8951570f, 0xdf09822b, 0xbd691a6c,\n    0xaa12e4f2, 0x87451c0f, 0xe0f6a27a, 0x3ada4819, 0x4cf1764f, 0x0d771c2b, 0x67cdb156, 0x350d8384,\n    0x5938fa0f, 0x42399ef3, 0x36997b07, 0x0e84093d, 0x4aa93e61, 0x8360d87b, 0x1fa98b0c, 0x1149382c,\n    0xe97625a5, 0x0614d1b7, 0x0e25244b, 0x0c768347, 0x589e8d82, 0x0d2059d1, 0xa466bb1e, 0xf8da0a82,\n    0x04f19130, 0xba6e4ec0, 0x99265164, 0x1ee7230d, 0x50b2ad80, 0xeaee6801, 0x8db2a283, 0xea8bf59e\n  ];\n}\n\nfunction CAST5(key) {\n  this.cast5 = new OpenPGPSymEncCAST5();\n  this.cast5.setKey(key);\n\n  this.encrypt = function(block) {\n    return this.cast5.encrypt(block);\n  };\n}\n\nCAST5.blockSize = CAST5.prototype.blockSize = 8;\nCAST5.keySize = CAST5.prototype.keySize = 16;\n\nexport default CAST5;\n","/* eslint-disable no-mixed-operators, no-fallthrough */\n\n\n/* Modified by Recurity Labs GmbH\n *\n * Cipher.js\n * A block-cipher algorithm implementation on JavaScript\n * See Cipher.readme.txt for further information.\n *\n * Copyright(c) 2009 Atsushi Oka [ http://oka.nu/ ]\n * This script file is distributed under the LGPL\n *\n * ACKNOWLEDGMENT\n *\n *     The main subroutines are written by Michiel van Everdingen.\n *\n *     Michiel van Everdingen\n *     http://home.versatel.nl/MAvanEverdingen/index.html\n *\n *     All rights for these routines are reserved to Michiel van Everdingen.\n *\n */\n\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n//Math\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\nconst MAXINT = 0xFFFFFFFF;\n\nfunction rotw(w, n) {\n  return (w << n | w >>> (32 - n)) & MAXINT;\n}\n\nfunction getW(a, i) {\n  return a[i] | a[i + 1] << 8 | a[i + 2] << 16 | a[i + 3] << 24;\n}\n\nfunction setW(a, i, w) {\n  a.splice(i, 4, w & 0xFF, (w >>> 8) & 0xFF, (w >>> 16) & 0xFF, (w >>> 24) & 0xFF);\n}\n\nfunction getB(x, n) {\n  return (x >>> (n * 8)) & 0xFF;\n}\n\n// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n// Twofish\n// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\nfunction createTwofish() {\n  //\n  let keyBytes = null;\n  let dataBytes = null;\n  let dataOffset = -1;\n  // var dataLength = -1;\n  // var idx2 = -1;\n  //\n\n  let tfsKey = [];\n  let tfsM = [\n    [],\n    [],\n    [],\n    []\n  ];\n\n  function tfsInit(key) {\n    keyBytes = key;\n    let i;\n    let a;\n    let b;\n    let c;\n    let d;\n    const meKey = [];\n    const moKey = [];\n    const inKey = [];\n    let kLen;\n    const sKey = [];\n    let f01;\n    let f5b;\n    let fef;\n\n    const q0 = [\n      [8, 1, 7, 13, 6, 15, 3, 2, 0, 11, 5, 9, 14, 12, 10, 4],\n      [2, 8, 11, 13, 15, 7, 6, 14, 3, 1, 9, 4, 0, 10, 12, 5]\n    ];\n    const q1 = [\n      [14, 12, 11, 8, 1, 2, 3, 5, 15, 4, 10, 6, 7, 0, 9, 13],\n      [1, 14, 2, 11, 4, 12, 3, 7, 6, 13, 10, 5, 15, 9, 0, 8]\n    ];\n    const q2 = [\n      [11, 10, 5, 14, 6, 13, 9, 0, 12, 8, 15, 3, 2, 4, 7, 1],\n      [4, 12, 7, 5, 1, 6, 9, 10, 0, 14, 13, 8, 2, 11, 3, 15]\n    ];\n    const q3 = [\n      [13, 7, 15, 4, 1, 2, 6, 14, 9, 11, 3, 0, 8, 5, 12, 10],\n      [11, 9, 5, 1, 12, 3, 13, 14, 6, 4, 7, 15, 2, 0, 8, 10]\n    ];\n    const ror4 = [0, 8, 1, 9, 2, 10, 3, 11, 4, 12, 5, 13, 6, 14, 7, 15];\n    const ashx = [0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12, 5, 14, 7];\n    const q = [\n      [],\n      []\n    ];\n    const m = [\n      [],\n      [],\n      [],\n      []\n    ];\n\n    function ffm5b(x) {\n      return x ^ (x >> 2) ^ [0, 90, 180, 238][x & 3];\n    }\n\n    function ffmEf(x) {\n      return x ^ (x >> 1) ^ (x >> 2) ^ [0, 238, 180, 90][x & 3];\n    }\n\n    function mdsRem(p, q) {\n      let i;\n      let t;\n      let u;\n      for (i = 0; i < 8; i++) {\n        t = q >>> 24;\n        q = ((q << 8) & MAXINT) | p >>> 24;\n        p = (p << 8) & MAXINT;\n        u = t << 1;\n        if (t & 128) {\n          u ^= 333;\n        }\n        q ^= t ^ (u << 16);\n        u ^= t >>> 1;\n        if (t & 1) {\n          u ^= 166;\n        }\n        q ^= u << 24 | u << 8;\n      }\n      return q;\n    }\n\n    function qp(n, x) {\n      const a = x >> 4;\n      const b = x & 15;\n      const c = q0[n][a ^ b];\n      const d = q1[n][ror4[b] ^ ashx[a]];\n      return q3[n][ror4[d] ^ ashx[c]] << 4 | q2[n][c ^ d];\n    }\n\n    function hFun(x, key) {\n      let a = getB(x, 0);\n      let b = getB(x, 1);\n      let c = getB(x, 2);\n      let d = getB(x, 3);\n      switch (kLen) {\n        case 4:\n          a = q[1][a] ^ getB(key[3], 0);\n          b = q[0][b] ^ getB(key[3], 1);\n          c = q[0][c] ^ getB(key[3], 2);\n          d = q[1][d] ^ getB(key[3], 3);\n        case 3:\n          a = q[1][a] ^ getB(key[2], 0);\n          b = q[1][b] ^ getB(key[2], 1);\n          c = q[0][c] ^ getB(key[2], 2);\n          d = q[0][d] ^ getB(key[2], 3);\n        case 2:\n          a = q[0][q[0][a] ^ getB(key[1], 0)] ^ getB(key[0], 0);\n          b = q[0][q[1][b] ^ getB(key[1], 1)] ^ getB(key[0], 1);\n          c = q[1][q[0][c] ^ getB(key[1], 2)] ^ getB(key[0], 2);\n          d = q[1][q[1][d] ^ getB(key[1], 3)] ^ getB(key[0], 3);\n      }\n      return m[0][a] ^ m[1][b] ^ m[2][c] ^ m[3][d];\n    }\n\n    keyBytes = keyBytes.slice(0, 32);\n    i = keyBytes.length;\n    while (i !== 16 && i !== 24 && i !== 32) {\n      keyBytes[i++] = 0;\n    }\n\n    for (i = 0; i < keyBytes.length; i += 4) {\n      inKey[i >> 2] = getW(keyBytes, i);\n    }\n    for (i = 0; i < 256; i++) {\n      q[0][i] = qp(0, i);\n      q[1][i] = qp(1, i);\n    }\n    for (i = 0; i < 256; i++) {\n      f01 = q[1][i];\n      f5b = ffm5b(f01);\n      fef = ffmEf(f01);\n      m[0][i] = f01 + (f5b << 8) + (fef << 16) + (fef << 24);\n      m[2][i] = f5b + (fef << 8) + (f01 << 16) + (fef << 24);\n      f01 = q[0][i];\n      f5b = ffm5b(f01);\n      fef = ffmEf(f01);\n      m[1][i] = fef + (fef << 8) + (f5b << 16) + (f01 << 24);\n      m[3][i] = f5b + (f01 << 8) + (fef << 16) + (f5b << 24);\n    }\n\n    kLen = inKey.length / 2;\n    for (i = 0; i < kLen; i++) {\n      a = inKey[i + i];\n      meKey[i] = a;\n      b = inKey[i + i + 1];\n      moKey[i] = b;\n      sKey[kLen - i - 1] = mdsRem(a, b);\n    }\n    for (i = 0; i < 40; i += 2) {\n      a = 0x1010101 * i;\n      b = a + 0x1010101;\n      a = hFun(a, meKey);\n      b = rotw(hFun(b, moKey), 8);\n      tfsKey[i] = (a + b) & MAXINT;\n      tfsKey[i + 1] = rotw(a + 2 * b, 9);\n    }\n    for (i = 0; i < 256; i++) {\n      a = b = c = d = i;\n      switch (kLen) {\n        case 4:\n          a = q[1][a] ^ getB(sKey[3], 0);\n          b = q[0][b] ^ getB(sKey[3], 1);\n          c = q[0][c] ^ getB(sKey[3], 2);\n          d = q[1][d] ^ getB(sKey[3], 3);\n        case 3:\n          a = q[1][a] ^ getB(sKey[2], 0);\n          b = q[1][b] ^ getB(sKey[2], 1);\n          c = q[0][c] ^ getB(sKey[2], 2);\n          d = q[0][d] ^ getB(sKey[2], 3);\n        case 2:\n          tfsM[0][i] = m[0][q[0][q[0][a] ^ getB(sKey[1], 0)] ^ getB(sKey[0], 0)];\n          tfsM[1][i] = m[1][q[0][q[1][b] ^ getB(sKey[1], 1)] ^ getB(sKey[0], 1)];\n          tfsM[2][i] = m[2][q[1][q[0][c] ^ getB(sKey[1], 2)] ^ getB(sKey[0], 2)];\n          tfsM[3][i] = m[3][q[1][q[1][d] ^ getB(sKey[1], 3)] ^ getB(sKey[0], 3)];\n      }\n    }\n  }\n\n  function tfsG0(x) {\n    return tfsM[0][getB(x, 0)] ^ tfsM[1][getB(x, 1)] ^ tfsM[2][getB(x, 2)] ^ tfsM[3][getB(x, 3)];\n  }\n\n  function tfsG1(x) {\n    return tfsM[0][getB(x, 3)] ^ tfsM[1][getB(x, 0)] ^ tfsM[2][getB(x, 1)] ^ tfsM[3][getB(x, 2)];\n  }\n\n  function tfsFrnd(r, blk) {\n    let a = tfsG0(blk[0]);\n    let b = tfsG1(blk[1]);\n    blk[2] = rotw(blk[2] ^ (a + b + tfsKey[4 * r + 8]) & MAXINT, 31);\n    blk[3] = rotw(blk[3], 1) ^ (a + 2 * b + tfsKey[4 * r + 9]) & MAXINT;\n    a = tfsG0(blk[2]);\n    b = tfsG1(blk[3]);\n    blk[0] = rotw(blk[0] ^ (a + b + tfsKey[4 * r + 10]) & MAXINT, 31);\n    blk[1] = rotw(blk[1], 1) ^ (a + 2 * b + tfsKey[4 * r + 11]) & MAXINT;\n  }\n\n  function tfsIrnd(i, blk) {\n    let a = tfsG0(blk[0]);\n    let b = tfsG1(blk[1]);\n    blk[2] = rotw(blk[2], 1) ^ (a + b + tfsKey[4 * i + 10]) & MAXINT;\n    blk[3] = rotw(blk[3] ^ (a + 2 * b + tfsKey[4 * i + 11]) & MAXINT, 31);\n    a = tfsG0(blk[2]);\n    b = tfsG1(blk[3]);\n    blk[0] = rotw(blk[0], 1) ^ (a + b + tfsKey[4 * i + 8]) & MAXINT;\n    blk[1] = rotw(blk[1] ^ (a + 2 * b + tfsKey[4 * i + 9]) & MAXINT, 31);\n  }\n\n  function tfsClose() {\n    tfsKey = [];\n    tfsM = [\n      [],\n      [],\n      [],\n      []\n    ];\n  }\n\n  function tfsEncrypt(data, offset) {\n    dataBytes = data;\n    dataOffset = offset;\n    const blk = [getW(dataBytes, dataOffset) ^ tfsKey[0],\n      getW(dataBytes, dataOffset + 4) ^ tfsKey[1],\n      getW(dataBytes, dataOffset + 8) ^ tfsKey[2],\n      getW(dataBytes, dataOffset + 12) ^ tfsKey[3]];\n    for (let j = 0; j < 8; j++) {\n      tfsFrnd(j, blk);\n    }\n    setW(dataBytes, dataOffset, blk[2] ^ tfsKey[4]);\n    setW(dataBytes, dataOffset + 4, blk[3] ^ tfsKey[5]);\n    setW(dataBytes, dataOffset + 8, blk[0] ^ tfsKey[6]);\n    setW(dataBytes, dataOffset + 12, blk[1] ^ tfsKey[7]);\n    dataOffset += 16;\n    return dataBytes;\n  }\n\n  function tfsDecrypt(data, offset) {\n    dataBytes = data;\n    dataOffset = offset;\n    const blk = [getW(dataBytes, dataOffset) ^ tfsKey[4],\n      getW(dataBytes, dataOffset + 4) ^ tfsKey[5],\n      getW(dataBytes, dataOffset + 8) ^ tfsKey[6],\n      getW(dataBytes, dataOffset + 12) ^ tfsKey[7]];\n    for (let j = 7; j >= 0; j--) {\n      tfsIrnd(j, blk);\n    }\n    setW(dataBytes, dataOffset, blk[2] ^ tfsKey[0]);\n    setW(dataBytes, dataOffset + 4, blk[3] ^ tfsKey[1]);\n    setW(dataBytes, dataOffset + 8, blk[0] ^ tfsKey[2]);\n    setW(dataBytes, dataOffset + 12, blk[1] ^ tfsKey[3]);\n    dataOffset += 16;\n  }\n\n  // added by Recurity Labs\n\n  function tfsFinal() {\n    return dataBytes;\n  }\n\n  return {\n    name: 'twofish',\n    blocksize: 128 / 8,\n    open: tfsInit,\n    close: tfsClose,\n    encrypt: tfsEncrypt,\n    decrypt: tfsDecrypt,\n    // added by Recurity Labs\n    finalize: tfsFinal\n  };\n}\n\n// added by Recurity Labs\n\nfunction TF(key) {\n  this.tf = createTwofish();\n  this.tf.open(Array.from(key), 0);\n\n  this.encrypt = function(block) {\n    return this.tf.encrypt(Array.from(block), 0);\n  };\n}\n\nTF.keySize = TF.prototype.keySize = 32;\nTF.blockSize = TF.prototype.blockSize = 16;\n\nexport default TF;\n","/* Modified by Recurity Labs GmbH\n *\n * Originally written by nklein software (nklein.com)\n */\n\n/*\n * Javascript implementation based on Bruce Schneier's reference implementation.\n *\n *\n * The constructor doesn't do much of anything.  It's just here\n * so we can start defining properties and methods and such.\n */\nfunction Blowfish() {}\n\n/*\n * Declare the block size so that protocols know what size\n * Initialization Vector (IV) they will need.\n */\nBlowfish.prototype.BLOCKSIZE = 8;\n\n/*\n * These are the default SBOXES.\n */\nBlowfish.prototype.SBOXES = [\n  [\n    0xd1310ba6, 0x98dfb5ac, 0x2ffd72db, 0xd01adfb7, 0xb8e1afed, 0x6a267e96,\n    0xba7c9045, 0xf12c7f99, 0x24a19947, 0xb3916cf7, 0x0801f2e2, 0x858efc16,\n    0x636920d8, 0x71574e69, 0xa458fea3, 0xf4933d7e, 0x0d95748f, 0x728eb658,\n    0x718bcd58, 0x82154aee, 0x7b54a41d, 0xc25a59b5, 0x9c30d539, 0x2af26013,\n    0xc5d1b023, 0x286085f0, 0xca417918, 0xb8db38ef, 0x8e79dcb0, 0x603a180e,\n    0x6c9e0e8b, 0xb01e8a3e, 0xd71577c1, 0xbd314b27, 0x78af2fda, 0x55605c60,\n    0xe65525f3, 0xaa55ab94, 0x57489862, 0x63e81440, 0x55ca396a, 0x2aab10b6,\n    0xb4cc5c34, 0x1141e8ce, 0xa15486af, 0x7c72e993, 0xb3ee1411, 0x636fbc2a,\n    0x2ba9c55d, 0x741831f6, 0xce5c3e16, 0x9b87931e, 0xafd6ba33, 0x6c24cf5c,\n    0x7a325381, 0x28958677, 0x3b8f4898, 0x6b4bb9af, 0xc4bfe81b, 0x66282193,\n    0x61d809cc, 0xfb21a991, 0x487cac60, 0x5dec8032, 0xef845d5d, 0xe98575b1,\n    0xdc262302, 0xeb651b88, 0x23893e81, 0xd396acc5, 0x0f6d6ff3, 0x83f44239,\n    0x2e0b4482, 0xa4842004, 0x69c8f04a, 0x9e1f9b5e, 0x21c66842, 0xf6e96c9a,\n    0x670c9c61, 0xabd388f0, 0x6a51a0d2, 0xd8542f68, 0x960fa728, 0xab5133a3,\n    0x6eef0b6c, 0x137a3be4, 0xba3bf050, 0x7efb2a98, 0xa1f1651d, 0x39af0176,\n    0x66ca593e, 0x82430e88, 0x8cee8619, 0x456f9fb4, 0x7d84a5c3, 0x3b8b5ebe,\n    0xe06f75d8, 0x85c12073, 0x401a449f, 0x56c16aa6, 0x4ed3aa62, 0x363f7706,\n    0x1bfedf72, 0x429b023d, 0x37d0d724, 0xd00a1248, 0xdb0fead3, 0x49f1c09b,\n    0x075372c9, 0x80991b7b, 0x25d479d8, 0xf6e8def7, 0xe3fe501a, 0xb6794c3b,\n    0x976ce0bd, 0x04c006ba, 0xc1a94fb6, 0x409f60c4, 0x5e5c9ec2, 0x196a2463,\n    0x68fb6faf, 0x3e6c53b5, 0x1339b2eb, 0x3b52ec6f, 0x6dfc511f, 0x9b30952c,\n    0xcc814544, 0xaf5ebd09, 0xbee3d004, 0xde334afd, 0x660f2807, 0x192e4bb3,\n    0xc0cba857, 0x45c8740f, 0xd20b5f39, 0xb9d3fbdb, 0x5579c0bd, 0x1a60320a,\n    0xd6a100c6, 0x402c7279, 0x679f25fe, 0xfb1fa3cc, 0x8ea5e9f8, 0xdb3222f8,\n    0x3c7516df, 0xfd616b15, 0x2f501ec8, 0xad0552ab, 0x323db5fa, 0xfd238760,\n    0x53317b48, 0x3e00df82, 0x9e5c57bb, 0xca6f8ca0, 0x1a87562e, 0xdf1769db,\n    0xd542a8f6, 0x287effc3, 0xac6732c6, 0x8c4f5573, 0x695b27b0, 0xbbca58c8,\n    0xe1ffa35d, 0xb8f011a0, 0x10fa3d98, 0xfd2183b8, 0x4afcb56c, 0x2dd1d35b,\n    0x9a53e479, 0xb6f84565, 0xd28e49bc, 0x4bfb9790, 0xe1ddf2da, 0xa4cb7e33,\n    0x62fb1341, 0xcee4c6e8, 0xef20cada, 0x36774c01, 0xd07e9efe, 0x2bf11fb4,\n    0x95dbda4d, 0xae909198, 0xeaad8e71, 0x6b93d5a0, 0xd08ed1d0, 0xafc725e0,\n    0x8e3c5b2f, 0x8e7594b7, 0x8ff6e2fb, 0xf2122b64, 0x8888b812, 0x900df01c,\n    0x4fad5ea0, 0x688fc31c, 0xd1cff191, 0xb3a8c1ad, 0x2f2f2218, 0xbe0e1777,\n    0xea752dfe, 0x8b021fa1, 0xe5a0cc0f, 0xb56f74e8, 0x18acf3d6, 0xce89e299,\n    0xb4a84fe0, 0xfd13e0b7, 0x7cc43b81, 0xd2ada8d9, 0x165fa266, 0x80957705,\n    0x93cc7314, 0x211a1477, 0xe6ad2065, 0x77b5fa86, 0xc75442f5, 0xfb9d35cf,\n    0xebcdaf0c, 0x7b3e89a0, 0xd6411bd3, 0xae1e7e49, 0x00250e2d, 0x2071b35e,\n    0x226800bb, 0x57b8e0af, 0x2464369b, 0xf009b91e, 0x5563911d, 0x59dfa6aa,\n    0x78c14389, 0xd95a537f, 0x207d5ba2, 0x02e5b9c5, 0x83260376, 0x6295cfa9,\n    0x11c81968, 0x4e734a41, 0xb3472dca, 0x7b14a94a, 0x1b510052, 0x9a532915,\n    0xd60f573f, 0xbc9bc6e4, 0x2b60a476, 0x81e67400, 0x08ba6fb5, 0x571be91f,\n    0xf296ec6b, 0x2a0dd915, 0xb6636521, 0xe7b9f9b6, 0xff34052e, 0xc5855664,\n    0x53b02d5d, 0xa99f8fa1, 0x08ba4799, 0x6e85076a\n  ],\n  [\n    0x4b7a70e9, 0xb5b32944, 0xdb75092e, 0xc4192623, 0xad6ea6b0, 0x49a7df7d,\n    0x9cee60b8, 0x8fedb266, 0xecaa8c71, 0x699a17ff, 0x5664526c, 0xc2b19ee1,\n    0x193602a5, 0x75094c29, 0xa0591340, 0xe4183a3e, 0x3f54989a, 0x5b429d65,\n    0x6b8fe4d6, 0x99f73fd6, 0xa1d29c07, 0xefe830f5, 0x4d2d38e6, 0xf0255dc1,\n    0x4cdd2086, 0x8470eb26, 0x6382e9c6, 0x021ecc5e, 0x09686b3f, 0x3ebaefc9,\n    0x3c971814, 0x6b6a70a1, 0x687f3584, 0x52a0e286, 0xb79c5305, 0xaa500737,\n    0x3e07841c, 0x7fdeae5c, 0x8e7d44ec, 0x5716f2b8, 0xb03ada37, 0xf0500c0d,\n    0xf01c1f04, 0x0200b3ff, 0xae0cf51a, 0x3cb574b2, 0x25837a58, 0xdc0921bd,\n    0xd19113f9, 0x7ca92ff6, 0x94324773, 0x22f54701, 0x3ae5e581, 0x37c2dadc,\n    0xc8b57634, 0x9af3dda7, 0xa9446146, 0x0fd0030e, 0xecc8c73e, 0xa4751e41,\n    0xe238cd99, 0x3bea0e2f, 0x3280bba1, 0x183eb331, 0x4e548b38, 0x4f6db908,\n    0x6f420d03, 0xf60a04bf, 0x2cb81290, 0x24977c79, 0x5679b072, 0xbcaf89af,\n    0xde9a771f, 0xd9930810, 0xb38bae12, 0xdccf3f2e, 0x5512721f, 0x2e6b7124,\n    0x501adde6, 0x9f84cd87, 0x7a584718, 0x7408da17, 0xbc9f9abc, 0xe94b7d8c,\n    0xec7aec3a, 0xdb851dfa, 0x63094366, 0xc464c3d2, 0xef1c1847, 0x3215d908,\n    0xdd433b37, 0x24c2ba16, 0x12a14d43, 0x2a65c451, 0x50940002, 0x133ae4dd,\n    0x71dff89e, 0x10314e55, 0x81ac77d6, 0x5f11199b, 0x043556f1, 0xd7a3c76b,\n    0x3c11183b, 0x5924a509, 0xf28fe6ed, 0x97f1fbfa, 0x9ebabf2c, 0x1e153c6e,\n    0x86e34570, 0xeae96fb1, 0x860e5e0a, 0x5a3e2ab3, 0x771fe71c, 0x4e3d06fa,\n    0x2965dcb9, 0x99e71d0f, 0x803e89d6, 0x5266c825, 0x2e4cc978, 0x9c10b36a,\n    0xc6150eba, 0x94e2ea78, 0xa5fc3c53, 0x1e0a2df4, 0xf2f74ea7, 0x361d2b3d,\n    0x1939260f, 0x19c27960, 0x5223a708, 0xf71312b6, 0xebadfe6e, 0xeac31f66,\n    0xe3bc4595, 0xa67bc883, 0xb17f37d1, 0x018cff28, 0xc332ddef, 0xbe6c5aa5,\n    0x65582185, 0x68ab9802, 0xeecea50f, 0xdb2f953b, 0x2aef7dad, 0x5b6e2f84,\n    0x1521b628, 0x29076170, 0xecdd4775, 0x619f1510, 0x13cca830, 0xeb61bd96,\n    0x0334fe1e, 0xaa0363cf, 0xb5735c90, 0x4c70a239, 0xd59e9e0b, 0xcbaade14,\n    0xeecc86bc, 0x60622ca7, 0x9cab5cab, 0xb2f3846e, 0x648b1eaf, 0x19bdf0ca,\n    0xa02369b9, 0x655abb50, 0x40685a32, 0x3c2ab4b3, 0x319ee9d5, 0xc021b8f7,\n    0x9b540b19, 0x875fa099, 0x95f7997e, 0x623d7da8, 0xf837889a, 0x97e32d77,\n    0x11ed935f, 0x16681281, 0x0e358829, 0xc7e61fd6, 0x96dedfa1, 0x7858ba99,\n    0x57f584a5, 0x1b227263, 0x9b83c3ff, 0x1ac24696, 0xcdb30aeb, 0x532e3054,\n    0x8fd948e4, 0x6dbc3128, 0x58ebf2ef, 0x34c6ffea, 0xfe28ed61, 0xee7c3c73,\n    0x5d4a14d9, 0xe864b7e3, 0x42105d14, 0x203e13e0, 0x45eee2b6, 0xa3aaabea,\n    0xdb6c4f15, 0xfacb4fd0, 0xc742f442, 0xef6abbb5, 0x654f3b1d, 0x41cd2105,\n    0xd81e799e, 0x86854dc7, 0xe44b476a, 0x3d816250, 0xcf62a1f2, 0x5b8d2646,\n    0xfc8883a0, 0xc1c7b6a3, 0x7f1524c3, 0x69cb7492, 0x47848a0b, 0x5692b285,\n    0x095bbf00, 0xad19489d, 0x1462b174, 0x23820e00, 0x58428d2a, 0x0c55f5ea,\n    0x1dadf43e, 0x233f7061, 0x3372f092, 0x8d937e41, 0xd65fecf1, 0x6c223bdb,\n    0x7cde3759, 0xcbee7460, 0x4085f2a7, 0xce77326e, 0xa6078084, 0x19f8509e,\n    0xe8efd855, 0x61d99735, 0xa969a7aa, 0xc50c06c2, 0x5a04abfc, 0x800bcadc,\n    0x9e447a2e, 0xc3453484, 0xfdd56705, 0x0e1e9ec9, 0xdb73dbd3, 0x105588cd,\n    0x675fda79, 0xe3674340, 0xc5c43465, 0x713e38d8, 0x3d28f89e, 0xf16dff20,\n    0x153e21e7, 0x8fb03d4a, 0xe6e39f2b, 0xdb83adf7\n  ],\n  [\n    0xe93d5a68, 0x948140f7, 0xf64c261c, 0x94692934, 0x411520f7, 0x7602d4f7,\n    0xbcf46b2e, 0xd4a20068, 0xd4082471, 0x3320f46a, 0x43b7d4b7, 0x500061af,\n    0x1e39f62e, 0x97244546, 0x14214f74, 0xbf8b8840, 0x4d95fc1d, 0x96b591af,\n    0x70f4ddd3, 0x66a02f45, 0xbfbc09ec, 0x03bd9785, 0x7fac6dd0, 0x31cb8504,\n    0x96eb27b3, 0x55fd3941, 0xda2547e6, 0xabca0a9a, 0x28507825, 0x530429f4,\n    0x0a2c86da, 0xe9b66dfb, 0x68dc1462, 0xd7486900, 0x680ec0a4, 0x27a18dee,\n    0x4f3ffea2, 0xe887ad8c, 0xb58ce006, 0x7af4d6b6, 0xaace1e7c, 0xd3375fec,\n    0xce78a399, 0x406b2a42, 0x20fe9e35, 0xd9f385b9, 0xee39d7ab, 0x3b124e8b,\n    0x1dc9faf7, 0x4b6d1856, 0x26a36631, 0xeae397b2, 0x3a6efa74, 0xdd5b4332,\n    0x6841e7f7, 0xca7820fb, 0xfb0af54e, 0xd8feb397, 0x454056ac, 0xba489527,\n    0x55533a3a, 0x20838d87, 0xfe6ba9b7, 0xd096954b, 0x55a867bc, 0xa1159a58,\n    0xcca92963, 0x99e1db33, 0xa62a4a56, 0x3f3125f9, 0x5ef47e1c, 0x9029317c,\n    0xfdf8e802, 0x04272f70, 0x80bb155c, 0x05282ce3, 0x95c11548, 0xe4c66d22,\n    0x48c1133f, 0xc70f86dc, 0x07f9c9ee, 0x41041f0f, 0x404779a4, 0x5d886e17,\n    0x325f51eb, 0xd59bc0d1, 0xf2bcc18f, 0x41113564, 0x257b7834, 0x602a9c60,\n    0xdff8e8a3, 0x1f636c1b, 0x0e12b4c2, 0x02e1329e, 0xaf664fd1, 0xcad18115,\n    0x6b2395e0, 0x333e92e1, 0x3b240b62, 0xeebeb922, 0x85b2a20e, 0xe6ba0d99,\n    0xde720c8c, 0x2da2f728, 0xd0127845, 0x95b794fd, 0x647d0862, 0xe7ccf5f0,\n    0x5449a36f, 0x877d48fa, 0xc39dfd27, 0xf33e8d1e, 0x0a476341, 0x992eff74,\n    0x3a6f6eab, 0xf4f8fd37, 0xa812dc60, 0xa1ebddf8, 0x991be14c, 0xdb6e6b0d,\n    0xc67b5510, 0x6d672c37, 0x2765d43b, 0xdcd0e804, 0xf1290dc7, 0xcc00ffa3,\n    0xb5390f92, 0x690fed0b, 0x667b9ffb, 0xcedb7d9c, 0xa091cf0b, 0xd9155ea3,\n    0xbb132f88, 0x515bad24, 0x7b9479bf, 0x763bd6eb, 0x37392eb3, 0xcc115979,\n    0x8026e297, 0xf42e312d, 0x6842ada7, 0xc66a2b3b, 0x12754ccc, 0x782ef11c,\n    0x6a124237, 0xb79251e7, 0x06a1bbe6, 0x4bfb6350, 0x1a6b1018, 0x11caedfa,\n    0x3d25bdd8, 0xe2e1c3c9, 0x44421659, 0x0a121386, 0xd90cec6e, 0xd5abea2a,\n    0x64af674e, 0xda86a85f, 0xbebfe988, 0x64e4c3fe, 0x9dbc8057, 0xf0f7c086,\n    0x60787bf8, 0x6003604d, 0xd1fd8346, 0xf6381fb0, 0x7745ae04, 0xd736fccc,\n    0x83426b33, 0xf01eab71, 0xb0804187, 0x3c005e5f, 0x77a057be, 0xbde8ae24,\n    0x55464299, 0xbf582e61, 0x4e58f48f, 0xf2ddfda2, 0xf474ef38, 0x8789bdc2,\n    0x5366f9c3, 0xc8b38e74, 0xb475f255, 0x46fcd9b9, 0x7aeb2661, 0x8b1ddf84,\n    0x846a0e79, 0x915f95e2, 0x466e598e, 0x20b45770, 0x8cd55591, 0xc902de4c,\n    0xb90bace1, 0xbb8205d0, 0x11a86248, 0x7574a99e, 0xb77f19b6, 0xe0a9dc09,\n    0x662d09a1, 0xc4324633, 0xe85a1f02, 0x09f0be8c, 0x4a99a025, 0x1d6efe10,\n    0x1ab93d1d, 0x0ba5a4df, 0xa186f20f, 0x2868f169, 0xdcb7da83, 0x573906fe,\n    0xa1e2ce9b, 0x4fcd7f52, 0x50115e01, 0xa70683fa, 0xa002b5c4, 0x0de6d027,\n    0x9af88c27, 0x773f8641, 0xc3604c06, 0x61a806b5, 0xf0177a28, 0xc0f586e0,\n    0x006058aa, 0x30dc7d62, 0x11e69ed7, 0x2338ea63, 0x53c2dd94, 0xc2c21634,\n    0xbbcbee56, 0x90bcb6de, 0xebfc7da1, 0xce591d76, 0x6f05e409, 0x4b7c0188,\n    0x39720a3d, 0x7c927c24, 0x86e3725f, 0x724d9db9, 0x1ac15bb4, 0xd39eb8fc,\n    0xed545578, 0x08fca5b5, 0xd83d7cd3, 0x4dad0fc4, 0x1e50ef5e, 0xb161e6f8,\n    0xa28514d9, 0x6c51133c, 0x6fd5c7e7, 0x56e14ec4, 0x362abfce, 0xddc6c837,\n    0xd79a3234, 0x92638212, 0x670efa8e, 0x406000e0\n  ],\n  [\n    0x3a39ce37, 0xd3faf5cf, 0xabc27737, 0x5ac52d1b, 0x5cb0679e, 0x4fa33742,\n    0xd3822740, 0x99bc9bbe, 0xd5118e9d, 0xbf0f7315, 0xd62d1c7e, 0xc700c47b,\n    0xb78c1b6b, 0x21a19045, 0xb26eb1be, 0x6a366eb4, 0x5748ab2f, 0xbc946e79,\n    0xc6a376d2, 0x6549c2c8, 0x530ff8ee, 0x468dde7d, 0xd5730a1d, 0x4cd04dc6,\n    0x2939bbdb, 0xa9ba4650, 0xac9526e8, 0xbe5ee304, 0xa1fad5f0, 0x6a2d519a,\n    0x63ef8ce2, 0x9a86ee22, 0xc089c2b8, 0x43242ef6, 0xa51e03aa, 0x9cf2d0a4,\n    0x83c061ba, 0x9be96a4d, 0x8fe51550, 0xba645bd6, 0x2826a2f9, 0xa73a3ae1,\n    0x4ba99586, 0xef5562e9, 0xc72fefd3, 0xf752f7da, 0x3f046f69, 0x77fa0a59,\n    0x80e4a915, 0x87b08601, 0x9b09e6ad, 0x3b3ee593, 0xe990fd5a, 0x9e34d797,\n    0x2cf0b7d9, 0x022b8b51, 0x96d5ac3a, 0x017da67d, 0xd1cf3ed6, 0x7c7d2d28,\n    0x1f9f25cf, 0xadf2b89b, 0x5ad6b472, 0x5a88f54c, 0xe029ac71, 0xe019a5e6,\n    0x47b0acfd, 0xed93fa9b, 0xe8d3c48d, 0x283b57cc, 0xf8d56629, 0x79132e28,\n    0x785f0191, 0xed756055, 0xf7960e44, 0xe3d35e8c, 0x15056dd4, 0x88f46dba,\n    0x03a16125, 0x0564f0bd, 0xc3eb9e15, 0x3c9057a2, 0x97271aec, 0xa93a072a,\n    0x1b3f6d9b, 0x1e6321f5, 0xf59c66fb, 0x26dcf319, 0x7533d928, 0xb155fdf5,\n    0x03563482, 0x8aba3cbb, 0x28517711, 0xc20ad9f8, 0xabcc5167, 0xccad925f,\n    0x4de81751, 0x3830dc8e, 0x379d5862, 0x9320f991, 0xea7a90c2, 0xfb3e7bce,\n    0x5121ce64, 0x774fbe32, 0xa8b6e37e, 0xc3293d46, 0x48de5369, 0x6413e680,\n    0xa2ae0810, 0xdd6db224, 0x69852dfd, 0x09072166, 0xb39a460a, 0x6445c0dd,\n    0x586cdecf, 0x1c20c8ae, 0x5bbef7dd, 0x1b588d40, 0xccd2017f, 0x6bb4e3bb,\n    0xdda26a7e, 0x3a59ff45, 0x3e350a44, 0xbcb4cdd5, 0x72eacea8, 0xfa6484bb,\n    0x8d6612ae, 0xbf3c6f47, 0xd29be463, 0x542f5d9e, 0xaec2771b, 0xf64e6370,\n    0x740e0d8d, 0xe75b1357, 0xf8721671, 0xaf537d5d, 0x4040cb08, 0x4eb4e2cc,\n    0x34d2466a, 0x0115af84, 0xe1b00428, 0x95983a1d, 0x06b89fb4, 0xce6ea048,\n    0x6f3f3b82, 0x3520ab82, 0x011a1d4b, 0x277227f8, 0x611560b1, 0xe7933fdc,\n    0xbb3a792b, 0x344525bd, 0xa08839e1, 0x51ce794b, 0x2f32c9b7, 0xa01fbac9,\n    0xe01cc87e, 0xbcc7d1f6, 0xcf0111c3, 0xa1e8aac7, 0x1a908749, 0xd44fbd9a,\n    0xd0dadecb, 0xd50ada38, 0x0339c32a, 0xc6913667, 0x8df9317c, 0xe0b12b4f,\n    0xf79e59b7, 0x43f5bb3a, 0xf2d519ff, 0x27d9459c, 0xbf97222c, 0x15e6fc2a,\n    0x0f91fc71, 0x9b941525, 0xfae59361, 0xceb69ceb, 0xc2a86459, 0x12baa8d1,\n    0xb6c1075e, 0xe3056a0c, 0x10d25065, 0xcb03a442, 0xe0ec6e0e, 0x1698db3b,\n    0x4c98a0be, 0x3278e964, 0x9f1f9532, 0xe0d392df, 0xd3a0342b, 0x8971f21e,\n    0x1b0a7441, 0x4ba3348c, 0xc5be7120, 0xc37632d8, 0xdf359f8d, 0x9b992f2e,\n    0xe60b6f47, 0x0fe3f11d, 0xe54cda54, 0x1edad891, 0xce6279cf, 0xcd3e7e6f,\n    0x1618b166, 0xfd2c1d05, 0x848fd2c5, 0xf6fb2299, 0xf523f357, 0xa6327623,\n    0x93a83531, 0x56cccd02, 0xacf08162, 0x5a75ebb5, 0x6e163697, 0x88d273cc,\n    0xde966292, 0x81b949d0, 0x4c50901b, 0x71c65614, 0xe6c6c7bd, 0x327a140a,\n    0x45e1d006, 0xc3f27b9a, 0xc9aa53fd, 0x62a80f00, 0xbb25bfe2, 0x35bdd2f6,\n    0x71126905, 0xb2040222, 0xb6cbcf7c, 0xcd769c2b, 0x53113ec0, 0x1640e3d3,\n    0x38abbd60, 0x2547adf0, 0xba38209c, 0xf746ce76, 0x77afa1c5, 0x20756060,\n    0x85cbfe4e, 0x8ae88dd8, 0x7aaaf9b0, 0x4cf9aa7e, 0x1948c25c, 0x02fb8a8c,\n    0x01c36ae4, 0xd6ebe1f9, 0x90d4f869, 0xa65cdea0, 0x3f09252d, 0xc208e69f,\n    0xb74e6132, 0xce77e25b, 0x578fdfe3, 0x3ac372e6\n  ]\n];\n\n//*\n//* This is the default PARRAY\n//*\nBlowfish.prototype.PARRAY = [\n  0x243f6a88, 0x85a308d3, 0x13198a2e, 0x03707344, 0xa4093822, 0x299f31d0,\n  0x082efa98, 0xec4e6c89, 0x452821e6, 0x38d01377, 0xbe5466cf, 0x34e90c6c,\n  0xc0ac29b7, 0xc97c50dd, 0x3f84d5b5, 0xb5470917, 0x9216d5d9, 0x8979fb1b\n];\n\n//*\n//* This is the number of rounds the cipher will go\n//*\nBlowfish.prototype.NN = 16;\n\n//*\n//* This function is needed to get rid of problems\n//* with the high-bit getting set.  If we don't do\n//* this, then sometimes ( aa & 0x00FFFFFFFF ) is not\n//* equal to ( bb & 0x00FFFFFFFF ) even when they\n//* agree bit-for-bit for the first 32 bits.\n//*\nBlowfish.prototype._clean = function(xx) {\n  if (xx < 0) {\n    const yy = xx & 0x7FFFFFFF;\n    xx = yy + 0x80000000;\n  }\n  return xx;\n};\n\n//*\n//* This is the mixing function that uses the sboxes\n//*\nBlowfish.prototype._F = function(xx) {\n  let yy;\n\n  const dd = xx & 0x00FF;\n  xx >>>= 8;\n  const cc = xx & 0x00FF;\n  xx >>>= 8;\n  const bb = xx & 0x00FF;\n  xx >>>= 8;\n  const aa = xx & 0x00FF;\n\n  yy = this.sboxes[0][aa] + this.sboxes[1][bb];\n  yy ^= this.sboxes[2][cc];\n  yy += this.sboxes[3][dd];\n\n  return yy;\n};\n\n//*\n//* This method takes an array with two values, left and right\n//* and does NN rounds of Blowfish on them.\n//*\nBlowfish.prototype._encryptBlock = function(vals) {\n  let dataL = vals[0];\n  let dataR = vals[1];\n\n  let ii;\n\n  for (ii = 0; ii < this.NN; ++ii) {\n    dataL ^= this.parray[ii];\n    dataR = this._F(dataL) ^ dataR;\n\n    const tmp = dataL;\n    dataL = dataR;\n    dataR = tmp;\n  }\n\n  dataL ^= this.parray[this.NN + 0];\n  dataR ^= this.parray[this.NN + 1];\n\n  vals[0] = this._clean(dataR);\n  vals[1] = this._clean(dataL);\n};\n\n//*\n//* This method takes a vector of numbers and turns them\n//* into long words so that they can be processed by the\n//* real algorithm.\n//*\n//* Maybe I should make the real algorithm above take a vector\n//* instead.  That will involve more looping, but it won't require\n//* the F() method to deconstruct the vector.\n//*\nBlowfish.prototype.encryptBlock = function(vector) {\n  let ii;\n  const vals = [0, 0];\n  const off = this.BLOCKSIZE / 2;\n  for (ii = 0; ii < this.BLOCKSIZE / 2; ++ii) {\n    vals[0] = (vals[0] << 8) | (vector[ii + 0] & 0x00FF);\n    vals[1] = (vals[1] << 8) | (vector[ii + off] & 0x00FF);\n  }\n\n  this._encryptBlock(vals);\n\n  const ret = [];\n  for (ii = 0; ii < this.BLOCKSIZE / 2; ++ii) {\n    ret[ii + 0] = ((vals[0] >>> (24 - 8 * (ii))) & 0x00FF);\n    ret[ii + off] = ((vals[1] >>> (24 - 8 * (ii))) & 0x00FF);\n    // vals[ 0 ] = ( vals[ 0 ] >>> 8 );\n    // vals[ 1 ] = ( vals[ 1 ] >>> 8 );\n  }\n\n  return ret;\n};\n\n//*\n//* This method takes an array with two values, left and right\n//* and undoes NN rounds of Blowfish on them.\n//*\nBlowfish.prototype._decryptBlock = function(vals) {\n  let dataL = vals[0];\n  let dataR = vals[1];\n\n  let ii;\n\n  for (ii = this.NN + 1; ii > 1; --ii) {\n    dataL ^= this.parray[ii];\n    dataR = this._F(dataL) ^ dataR;\n\n    const tmp = dataL;\n    dataL = dataR;\n    dataR = tmp;\n  }\n\n  dataL ^= this.parray[1];\n  dataR ^= this.parray[0];\n\n  vals[0] = this._clean(dataR);\n  vals[1] = this._clean(dataL);\n};\n\n//*\n//* This method takes a key array and initializes the\n//* sboxes and parray for this encryption.\n//*\nBlowfish.prototype.init = function(key) {\n  let ii;\n  let jj = 0;\n\n  this.parray = [];\n  for (ii = 0; ii < this.NN + 2; ++ii) {\n    let data = 0x00000000;\n    for (let kk = 0; kk < 4; ++kk) {\n      data = (data << 8) | (key[jj] & 0x00FF);\n      if (++jj >= key.length) {\n        jj = 0;\n      }\n    }\n    this.parray[ii] = this.PARRAY[ii] ^ data;\n  }\n\n  this.sboxes = [];\n  for (ii = 0; ii < 4; ++ii) {\n    this.sboxes[ii] = [];\n    for (jj = 0; jj < 256; ++jj) {\n      this.sboxes[ii][jj] = this.SBOXES[ii][jj];\n    }\n  }\n\n  const vals = [0x00000000, 0x00000000];\n\n  for (ii = 0; ii < this.NN + 2; ii += 2) {\n    this._encryptBlock(vals);\n    this.parray[ii + 0] = vals[0];\n    this.parray[ii + 1] = vals[1];\n  }\n\n  for (ii = 0; ii < 4; ++ii) {\n    for (jj = 0; jj < 256; jj += 2) {\n      this._encryptBlock(vals);\n      this.sboxes[ii][jj + 0] = vals[0];\n      this.sboxes[ii][jj + 1] = vals[1];\n    }\n  }\n};\n\n// added by Recurity Labs\nfunction BF(key) {\n  this.bf = new Blowfish();\n  this.bf.init(key);\n\n  this.encrypt = function(block) {\n    return this.bf.encryptBlock(block);\n  };\n}\n\nBF.keySize = BF.prototype.keySize = 16;\nBF.blockSize = BF.prototype.blockSize = 8;\n\nexport default BF;\n","/**\n * @fileoverview Symmetric cryptography functions\n * @module crypto/cipher\n * @private\n */\n\nimport aes from './aes';\nimport { DES, TripleDES } from './des';\nimport CAST5 from './cast5';\nimport TF from './twofish';\nimport BF from './blowfish';\n\n/**\n * AES-128 encryption and decryption (ID 7)\n * @function\n * @param {String} key - 128-bit key\n * @see {@link https://github.com/asmcrypto/asmcrypto.js|asmCrypto}\n * @see {@link https://csrc.nist.gov/publications/fips/fips197/fips-197.pdf|NIST FIPS-197}\n * @returns {Object}\n */\nexport const aes128 = aes(128);\n/**\n * AES-128 Block Cipher (ID 8)\n * @function\n * @param {String} key - 192-bit key\n * @see {@link https://github.com/asmcrypto/asmcrypto.js|asmCrypto}\n * @see {@link https://csrc.nist.gov/publications/fips/fips197/fips-197.pdf|NIST FIPS-197}\n * @returns {Object}\n */\nexport const aes192 = aes(192);\n/**\n * AES-128 Block Cipher (ID 9)\n * @function\n * @param {String} key - 256-bit key\n * @see {@link https://github.com/asmcrypto/asmcrypto.js|asmCrypto}\n * @see {@link https://csrc.nist.gov/publications/fips/fips197/fips-197.pdf|NIST FIPS-197}\n * @returns {Object}\n */\nexport const aes256 = aes(256);\n// Not in OpenPGP specifications\nexport const des = DES;\n/**\n * Triple DES Block Cipher (ID 2)\n * @function\n * @param {String} key - 192-bit key\n * @see {@link https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-67r2.pdf|NIST SP 800-67}\n * @returns {Object}\n */\nexport const tripledes = TripleDES;\n/**\n * CAST-128 Block Cipher (ID 3)\n * @function\n * @param {String} key - 128-bit key\n * @see {@link https://tools.ietf.org/html/rfc2144|The CAST-128 Encryption Algorithm}\n * @returns {Object}\n */\nexport const cast5 = CAST5;\n/**\n * Twofish Block Cipher (ID 10)\n * @function\n * @param {String} key - 256-bit key\n * @see {@link https://tools.ietf.org/html/rfc4880#ref-TWOFISH|TWOFISH}\n * @returns {Object}\n */\nexport const twofish = TF;\n/**\n * Blowfish Block Cipher (ID 4)\n * @function\n * @param {String} key - 128-bit key\n * @see {@link https://tools.ietf.org/html/rfc4880#ref-BLOWFISH|BLOWFISH}\n * @returns {Object}\n */\nexport const blowfish = BF;\n/**\n * Not implemented\n * @function\n * @throws {Error}\n */\nexport const idea = function() {\n  throw new Error('IDEA symmetric-key algorithm not implemented');\n};\n","export var sha1_asm = function ( stdlib, foreign, buffer ) {\n    \"use asm\";\n\n    // SHA256 state\n    var H0 = 0, H1 = 0, H2 = 0, H3 = 0, H4 = 0,\n        TOTAL0 = 0, TOTAL1 = 0;\n\n    // HMAC state\n    var I0 = 0, I1 = 0, I2 = 0, I3 = 0, I4 = 0,\n        O0 = 0, O1 = 0, O2 = 0, O3 = 0, O4 = 0;\n\n    // I/O buffer\n    var HEAP = new stdlib.Uint8Array(buffer);\n\n    function _core ( w0, w1, w2, w3, w4, w5, w6, w7, w8, w9, w10, w11, w12, w13, w14, w15 ) {\n        w0 = w0|0;\n        w1 = w1|0;\n        w2 = w2|0;\n        w3 = w3|0;\n        w4 = w4|0;\n        w5 = w5|0;\n        w6 = w6|0;\n        w7 = w7|0;\n        w8 = w8|0;\n        w9 = w9|0;\n        w10 = w10|0;\n        w11 = w11|0;\n        w12 = w12|0;\n        w13 = w13|0;\n        w14 = w14|0;\n        w15 = w15|0;\n\n        var a = 0, b = 0, c = 0, d = 0, e = 0, n = 0, t = 0,\n            w16 = 0, w17 = 0, w18 = 0, w19 = 0,\n            w20 = 0, w21 = 0, w22 = 0, w23 = 0, w24 = 0, w25 = 0, w26 = 0, w27 = 0, w28 = 0, w29 = 0,\n            w30 = 0, w31 = 0, w32 = 0, w33 = 0, w34 = 0, w35 = 0, w36 = 0, w37 = 0, w38 = 0, w39 = 0,\n            w40 = 0, w41 = 0, w42 = 0, w43 = 0, w44 = 0, w45 = 0, w46 = 0, w47 = 0, w48 = 0, w49 = 0,\n            w50 = 0, w51 = 0, w52 = 0, w53 = 0, w54 = 0, w55 = 0, w56 = 0, w57 = 0, w58 = 0, w59 = 0,\n            w60 = 0, w61 = 0, w62 = 0, w63 = 0, w64 = 0, w65 = 0, w66 = 0, w67 = 0, w68 = 0, w69 = 0,\n            w70 = 0, w71 = 0, w72 = 0, w73 = 0, w74 = 0, w75 = 0, w76 = 0, w77 = 0, w78 = 0, w79 = 0;\n\n        a = H0;\n        b = H1;\n        c = H2;\n        d = H3;\n        e = H4;\n\n        // 0\n        t = ( w0 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (~b & d)) + 0x5a827999 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 1\n        t = ( w1 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (~b & d)) + 0x5a827999 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 2\n        t = ( w2 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (~b & d)) + 0x5a827999 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 3\n        t = ( w3 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (~b & d)) + 0x5a827999 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 4\n        t = ( w4 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (~b & d)) + 0x5a827999 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 5\n        t = ( w5 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (~b & d)) + 0x5a827999 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 6\n        t = ( w6 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (~b & d)) + 0x5a827999 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 7\n        t = ( w7 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (~b & d)) + 0x5a827999 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 8\n        t = ( w8 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (~b & d)) + 0x5a827999 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 9\n        t = ( w9 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (~b & d)) + 0x5a827999 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 10\n        t = ( w10 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (~b & d)) + 0x5a827999 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 11\n        t = ( w11 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (~b & d)) + 0x5a827999 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 12\n        t = ( w12 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (~b & d)) + 0x5a827999 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 13\n        t = ( w13 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (~b & d)) + 0x5a827999 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 14\n        t = ( w14 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (~b & d)) + 0x5a827999 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 15\n        t = ( w15 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (~b & d)) + 0x5a827999 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 16\n        n = w13 ^ w8 ^ w2 ^ w0;\n        w16 = (n << 1) | (n >>> 31);\n        t = (w16 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (~b & d)) + 0x5a827999 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 17\n        n = w14 ^ w9 ^ w3 ^ w1;\n        w17 = (n << 1) | (n >>> 31);\n        t = (w17 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (~b & d)) + 0x5a827999 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 18\n        n = w15 ^ w10 ^ w4 ^ w2;\n        w18 = (n << 1) | (n >>> 31);\n        t = (w18 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (~b & d)) + 0x5a827999 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 19\n        n = w16 ^ w11 ^ w5 ^ w3;\n        w19 = (n << 1) | (n >>> 31);\n        t = (w19 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (~b & d)) + 0x5a827999 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 20\n        n = w17 ^ w12 ^ w6 ^ w4;\n        w20 = (n << 1) | (n >>> 31);\n        t = (w20 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) + 0x6ed9eba1 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 21\n        n = w18 ^ w13 ^ w7 ^ w5;\n        w21 = (n << 1) | (n >>> 31);\n        t = (w21 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) + 0x6ed9eba1 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 22\n        n = w19 ^ w14 ^ w8 ^ w6;\n        w22 = (n << 1) | (n >>> 31);\n        t = (w22 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) + 0x6ed9eba1 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 23\n        n = w20 ^ w15 ^ w9 ^ w7;\n        w23 = (n << 1) | (n >>> 31);\n        t = (w23 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) + 0x6ed9eba1 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 24\n        n = w21 ^ w16 ^ w10 ^ w8;\n        w24 = (n << 1) | (n >>> 31);\n        t = (w24 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) + 0x6ed9eba1 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 25\n        n = w22 ^ w17 ^ w11 ^ w9;\n        w25 = (n << 1) | (n >>> 31);\n        t = (w25 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) + 0x6ed9eba1 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 26\n        n = w23 ^ w18 ^ w12 ^ w10;\n        w26 = (n << 1) | (n >>> 31);\n        t = (w26 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) + 0x6ed9eba1 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 27\n        n = w24 ^ w19 ^ w13 ^ w11;\n        w27 = (n << 1) | (n >>> 31);\n        t = (w27 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) + 0x6ed9eba1 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 28\n        n = w25 ^ w20 ^ w14 ^ w12;\n        w28 = (n << 1) | (n >>> 31);\n        t = (w28 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) + 0x6ed9eba1 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 29\n        n = w26 ^ w21 ^ w15 ^ w13;\n        w29 = (n << 1) | (n >>> 31);\n        t = (w29 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) + 0x6ed9eba1 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 30\n        n = w27 ^ w22 ^ w16 ^ w14;\n        w30 = (n << 1) | (n >>> 31);\n        t = (w30 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) + 0x6ed9eba1 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 31\n        n = w28 ^ w23 ^ w17 ^ w15;\n        w31 = (n << 1) | (n >>> 31);\n        t = (w31 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) + 0x6ed9eba1 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 32\n        n = w29 ^ w24 ^ w18 ^ w16;\n        w32 = (n << 1) | (n >>> 31);\n        t = (w32 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) + 0x6ed9eba1 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 33\n        n = w30 ^ w25 ^ w19 ^ w17;\n        w33 = (n << 1) | (n >>> 31);\n        t = (w33 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) + 0x6ed9eba1 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 34\n        n = w31 ^ w26 ^ w20 ^ w18;\n        w34 = (n << 1) | (n >>> 31);\n        t = (w34 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) + 0x6ed9eba1 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 35\n        n = w32 ^ w27 ^ w21 ^ w19;\n        w35 = (n << 1) | (n >>> 31);\n        t = (w35 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) + 0x6ed9eba1 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 36\n        n = w33 ^ w28 ^ w22 ^ w20;\n        w36 = (n << 1) | (n >>> 31);\n        t = (w36 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) + 0x6ed9eba1 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 37\n        n = w34 ^ w29 ^ w23 ^ w21;\n        w37 = (n << 1) | (n >>> 31);\n        t = (w37 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) + 0x6ed9eba1 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 38\n        n = w35 ^ w30 ^ w24 ^ w22;\n        w38 = (n << 1) | (n >>> 31);\n        t = (w38 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) + 0x6ed9eba1 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 39\n        n = w36 ^ w31 ^ w25 ^ w23;\n        w39 = (n << 1) | (n >>> 31);\n        t = (w39 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) + 0x6ed9eba1 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 40\n        n = w37 ^ w32 ^ w26 ^ w24;\n        w40 = (n << 1) | (n >>> 31);\n        t = (w40 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (b & d) | (c & d)) - 0x70e44324 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 41\n        n = w38 ^ w33 ^ w27 ^ w25;\n        w41 = (n << 1) | (n >>> 31);\n        t = (w41 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (b & d) | (c & d)) - 0x70e44324 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 42\n        n = w39 ^ w34 ^ w28 ^ w26;\n        w42 = (n << 1) | (n >>> 31);\n        t = (w42 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (b & d) | (c & d)) - 0x70e44324 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 43\n        n = w40 ^ w35 ^ w29 ^ w27;\n        w43 = (n << 1) | (n >>> 31);\n        t = (w43 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (b & d) | (c & d)) - 0x70e44324 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 44\n        n = w41 ^ w36 ^ w30 ^ w28;\n        w44 = (n << 1) | (n >>> 31);\n        t = (w44 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (b & d) | (c & d)) - 0x70e44324 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 45\n        n = w42 ^ w37 ^ w31 ^ w29;\n        w45 = (n << 1) | (n >>> 31);\n        t = (w45 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (b & d) | (c & d)) - 0x70e44324 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 46\n        n = w43 ^ w38 ^ w32 ^ w30;\n        w46 = (n << 1) | (n >>> 31);\n        t = (w46 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (b & d) | (c & d)) - 0x70e44324 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 47\n        n = w44 ^ w39 ^ w33 ^ w31;\n        w47 = (n << 1) | (n >>> 31);\n        t = (w47 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (b & d) | (c & d)) - 0x70e44324 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 48\n        n = w45 ^ w40 ^ w34 ^ w32;\n        w48 = (n << 1) | (n >>> 31);\n        t = (w48 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (b & d) | (c & d)) - 0x70e44324 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 49\n        n = w46 ^ w41 ^ w35 ^ w33;\n        w49 = (n << 1) | (n >>> 31);\n        t = (w49 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (b & d) | (c & d)) - 0x70e44324 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 50\n        n = w47 ^ w42 ^ w36 ^ w34;\n        w50 = (n << 1) | (n >>> 31);\n        t = (w50 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (b & d) | (c & d)) - 0x70e44324 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 51\n        n = w48 ^ w43 ^ w37 ^ w35;\n        w51 = (n << 1) | (n >>> 31);\n        t = (w51 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (b & d) | (c & d)) - 0x70e44324 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 52\n        n = w49 ^ w44 ^ w38 ^ w36;\n        w52 = (n << 1) | (n >>> 31);\n        t = (w52 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (b & d) | (c & d)) - 0x70e44324 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 53\n        n = w50 ^ w45 ^ w39 ^ w37;\n        w53 = (n << 1) | (n >>> 31);\n        t = (w53 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (b & d) | (c & d)) - 0x70e44324 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 54\n        n = w51 ^ w46 ^ w40 ^ w38;\n        w54 = (n << 1) | (n >>> 31);\n        t = (w54 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (b & d) | (c & d)) - 0x70e44324 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 55\n        n = w52 ^ w47 ^ w41 ^ w39;\n        w55 = (n << 1) | (n >>> 31);\n        t = (w55 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (b & d) | (c & d)) - 0x70e44324 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 56\n        n = w53 ^ w48 ^ w42 ^ w40;\n        w56 = (n << 1) | (n >>> 31);\n        t = (w56 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (b & d) | (c & d)) - 0x70e44324 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 57\n        n = w54 ^ w49 ^ w43 ^ w41;\n        w57 = (n << 1) | (n >>> 31);\n        t = (w57 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (b & d) | (c & d)) - 0x70e44324 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 58\n        n = w55 ^ w50 ^ w44 ^ w42;\n        w58 = (n << 1) | (n >>> 31);\n        t = (w58 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (b & d) | (c & d)) - 0x70e44324 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 59\n        n = w56 ^ w51 ^ w45 ^ w43;\n        w59 = (n << 1) | (n >>> 31);\n        t = (w59 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (b & d) | (c & d)) - 0x70e44324 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 60\n        n = w57 ^ w52 ^ w46 ^ w44;\n        w60 = (n << 1) | (n >>> 31);\n        t = (w60 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) - 0x359d3e2a )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 61\n        n = w58 ^ w53 ^ w47 ^ w45;\n        w61 = (n << 1) | (n >>> 31);\n        t = (w61 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) - 0x359d3e2a )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 62\n        n = w59 ^ w54 ^ w48 ^ w46;\n        w62 = (n << 1) | (n >>> 31);\n        t = (w62 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) - 0x359d3e2a )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 63\n        n = w60 ^ w55 ^ w49 ^ w47;\n        w63 = (n << 1) | (n >>> 31);\n        t = (w63 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) - 0x359d3e2a )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 64\n        n = w61 ^ w56 ^ w50 ^ w48;\n        w64 = (n << 1) | (n >>> 31);\n        t = (w64 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) - 0x359d3e2a )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 65\n        n = w62 ^ w57 ^ w51 ^ w49;\n        w65 = (n << 1) | (n >>> 31);\n        t = (w65 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) - 0x359d3e2a )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 66\n        n = w63 ^ w58 ^ w52 ^ w50;\n        w66 = (n << 1) | (n >>> 31);\n        t = (w66 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) - 0x359d3e2a )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 67\n        n = w64 ^ w59 ^ w53 ^ w51;\n        w67 = (n << 1) | (n >>> 31);\n        t = (w67 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) - 0x359d3e2a )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 68\n        n = w65 ^ w60 ^ w54 ^ w52;\n        w68 = (n << 1) | (n >>> 31);\n        t = (w68 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) - 0x359d3e2a )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 69\n        n = w66 ^ w61 ^ w55 ^ w53;\n        w69 = (n << 1) | (n >>> 31);\n        t = (w69 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) - 0x359d3e2a )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 70\n        n = w67 ^ w62 ^ w56 ^ w54;\n        w70 = (n << 1) | (n >>> 31);\n        t = (w70 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) - 0x359d3e2a )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 71\n        n = w68 ^ w63 ^ w57 ^ w55;\n        w71 = (n << 1) | (n >>> 31);\n        t = (w71 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) - 0x359d3e2a )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 72\n        n = w69 ^ w64 ^ w58 ^ w56;\n        w72 = (n << 1) | (n >>> 31);\n        t = (w72 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) - 0x359d3e2a )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 73\n        n = w70 ^ w65 ^ w59 ^ w57;\n        w73 = (n << 1) | (n >>> 31);\n        t = (w73 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) - 0x359d3e2a )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 74\n        n = w71 ^ w66 ^ w60 ^ w58;\n        w74 = (n << 1) | (n >>> 31);\n        t = (w74 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) - 0x359d3e2a )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 75\n        n = w72 ^ w67 ^ w61 ^ w59;\n        w75 = (n << 1) | (n >>> 31);\n        t = (w75 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) - 0x359d3e2a )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 76\n        n = w73 ^ w68 ^ w62 ^ w60;\n        w76 = (n << 1) | (n >>> 31);\n        t = (w76 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) - 0x359d3e2a )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 77\n        n = w74 ^ w69 ^ w63 ^ w61;\n        w77 = (n << 1) | (n >>> 31);\n        t = (w77 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) - 0x359d3e2a )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 78\n        n = w75 ^ w70 ^ w64 ^ w62;\n        w78 = (n << 1) | (n >>> 31);\n        t = (w78 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) - 0x359d3e2a )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 79\n        n = w76 ^ w71 ^ w65 ^ w63;\n        w79 = (n << 1) | (n >>> 31);\n        t = (w79 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) - 0x359d3e2a )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        H0 = ( H0 + a )|0;\n        H1 = ( H1 + b )|0;\n        H2 = ( H2 + c )|0;\n        H3 = ( H3 + d )|0;\n        H4 = ( H4 + e )|0;\n\n    }\n\n    function _core_heap ( offset ) {\n        offset = offset|0;\n\n        _core(\n            HEAP[offset|0]<<24 | HEAP[offset|1]<<16 | HEAP[offset|2]<<8 | HEAP[offset|3],\n            HEAP[offset|4]<<24 | HEAP[offset|5]<<16 | HEAP[offset|6]<<8 | HEAP[offset|7],\n            HEAP[offset|8]<<24 | HEAP[offset|9]<<16 | HEAP[offset|10]<<8 | HEAP[offset|11],\n            HEAP[offset|12]<<24 | HEAP[offset|13]<<16 | HEAP[offset|14]<<8 | HEAP[offset|15],\n            HEAP[offset|16]<<24 | HEAP[offset|17]<<16 | HEAP[offset|18]<<8 | HEAP[offset|19],\n            HEAP[offset|20]<<24 | HEAP[offset|21]<<16 | HEAP[offset|22]<<8 | HEAP[offset|23],\n            HEAP[offset|24]<<24 | HEAP[offset|25]<<16 | HEAP[offset|26]<<8 | HEAP[offset|27],\n            HEAP[offset|28]<<24 | HEAP[offset|29]<<16 | HEAP[offset|30]<<8 | HEAP[offset|31],\n            HEAP[offset|32]<<24 | HEAP[offset|33]<<16 | HEAP[offset|34]<<8 | HEAP[offset|35],\n            HEAP[offset|36]<<24 | HEAP[offset|37]<<16 | HEAP[offset|38]<<8 | HEAP[offset|39],\n            HEAP[offset|40]<<24 | HEAP[offset|41]<<16 | HEAP[offset|42]<<8 | HEAP[offset|43],\n            HEAP[offset|44]<<24 | HEAP[offset|45]<<16 | HEAP[offset|46]<<8 | HEAP[offset|47],\n            HEAP[offset|48]<<24 | HEAP[offset|49]<<16 | HEAP[offset|50]<<8 | HEAP[offset|51],\n            HEAP[offset|52]<<24 | HEAP[offset|53]<<16 | HEAP[offset|54]<<8 | HEAP[offset|55],\n            HEAP[offset|56]<<24 | HEAP[offset|57]<<16 | HEAP[offset|58]<<8 | HEAP[offset|59],\n            HEAP[offset|60]<<24 | HEAP[offset|61]<<16 | HEAP[offset|62]<<8 | HEAP[offset|63]\n        );\n    }\n\n    // offset — multiple of 32\n    function _state_to_heap ( output ) {\n        output = output|0;\n\n        HEAP[output|0] = H0>>>24;\n        HEAP[output|1] = H0>>>16&255;\n        HEAP[output|2] = H0>>>8&255;\n        HEAP[output|3] = H0&255;\n        HEAP[output|4] = H1>>>24;\n        HEAP[output|5] = H1>>>16&255;\n        HEAP[output|6] = H1>>>8&255;\n        HEAP[output|7] = H1&255;\n        HEAP[output|8] = H2>>>24;\n        HEAP[output|9] = H2>>>16&255;\n        HEAP[output|10] = H2>>>8&255;\n        HEAP[output|11] = H2&255;\n        HEAP[output|12] = H3>>>24;\n        HEAP[output|13] = H3>>>16&255;\n        HEAP[output|14] = H3>>>8&255;\n        HEAP[output|15] = H3&255;\n        HEAP[output|16] = H4>>>24;\n        HEAP[output|17] = H4>>>16&255;\n        HEAP[output|18] = H4>>>8&255;\n        HEAP[output|19] = H4&255;\n    }\n\n    function reset () {\n        H0 = 0x67452301;\n        H1 = 0xefcdab89;\n        H2 = 0x98badcfe;\n        H3 = 0x10325476;\n        H4 = 0xc3d2e1f0;\n        TOTAL0 = TOTAL1 = 0;\n    }\n\n    function init ( h0, h1, h2, h3, h4, total0, total1 ) {\n        h0 = h0|0;\n        h1 = h1|0;\n        h2 = h2|0;\n        h3 = h3|0;\n        h4 = h4|0;\n        total0 = total0|0;\n        total1 = total1|0;\n\n        H0 = h0;\n        H1 = h1;\n        H2 = h2;\n        H3 = h3;\n        H4 = h4;\n        TOTAL0 = total0;\n        TOTAL1 = total1;\n    }\n\n    // offset — multiple of 64\n    function process ( offset, length ) {\n        offset = offset|0;\n        length = length|0;\n\n        var hashed = 0;\n\n        if ( offset & 63 )\n            return -1;\n\n        while ( (length|0) >= 64 ) {\n            _core_heap(offset);\n\n            offset = ( offset + 64 )|0;\n            length = ( length - 64 )|0;\n\n            hashed = ( hashed + 64 )|0;\n        }\n\n        TOTAL0 = ( TOTAL0 + hashed )|0;\n        if ( TOTAL0>>>0 < hashed>>>0 ) TOTAL1 = ( TOTAL1 + 1 )|0;\n\n        return hashed|0;\n    }\n\n    // offset — multiple of 64\n    // output — multiple of 32\n    function finish ( offset, length, output ) {\n        offset = offset|0;\n        length = length|0;\n        output = output|0;\n\n        var hashed = 0,\n            i = 0;\n\n        if ( offset & 63 )\n            return -1;\n\n        if ( ~output )\n            if ( output & 31 )\n                return -1;\n\n        if ( (length|0) >= 64 ) {\n            hashed = process( offset, length )|0;\n            if ( (hashed|0) == -1 )\n                return -1;\n\n            offset = ( offset + hashed )|0;\n            length = ( length - hashed )|0;\n        }\n\n        hashed = ( hashed + length )|0;\n        TOTAL0 = ( TOTAL0 + length )|0;\n        if ( TOTAL0>>>0 < length>>>0 ) TOTAL1 = (TOTAL1 + 1)|0;\n\n        HEAP[offset|length] = 0x80;\n\n        if ( (length|0) >= 56 ) {\n            for ( i = (length+1)|0; (i|0) < 64; i = (i+1)|0 )\n                HEAP[offset|i] = 0x00;\n            _core_heap(offset);\n\n            length = 0;\n\n            HEAP[offset|0] = 0;\n        }\n\n        for ( i = (length+1)|0; (i|0) < 59; i = (i+1)|0 )\n            HEAP[offset|i] = 0;\n\n        HEAP[offset|56] = TOTAL1>>>21&255;\n        HEAP[offset|57] = TOTAL1>>>13&255;\n        HEAP[offset|58] = TOTAL1>>>5&255;\n        HEAP[offset|59] = TOTAL1<<3&255 | TOTAL0>>>29;\n        HEAP[offset|60] = TOTAL0>>>21&255;\n        HEAP[offset|61] = TOTAL0>>>13&255;\n        HEAP[offset|62] = TOTAL0>>>5&255;\n        HEAP[offset|63] = TOTAL0<<3&255;\n        _core_heap(offset);\n\n        if ( ~output )\n            _state_to_heap(output);\n\n        return hashed|0;\n    }\n\n    function hmac_reset () {\n        H0 = I0;\n        H1 = I1;\n        H2 = I2;\n        H3 = I3;\n        H4 = I4;\n        TOTAL0 = 64;\n        TOTAL1 = 0;\n    }\n\n    function _hmac_opad () {\n        H0 = O0;\n        H1 = O1;\n        H2 = O2;\n        H3 = O3;\n        H4 = O4;\n        TOTAL0 = 64;\n        TOTAL1 = 0;\n    }\n\n    function hmac_init ( p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15 ) {\n        p0 = p0|0;\n        p1 = p1|0;\n        p2 = p2|0;\n        p3 = p3|0;\n        p4 = p4|0;\n        p5 = p5|0;\n        p6 = p6|0;\n        p7 = p7|0;\n        p8 = p8|0;\n        p9 = p9|0;\n        p10 = p10|0;\n        p11 = p11|0;\n        p12 = p12|0;\n        p13 = p13|0;\n        p14 = p14|0;\n        p15 = p15|0;\n\n        // opad\n        reset();\n        _core(\n            p0 ^ 0x5c5c5c5c,\n            p1 ^ 0x5c5c5c5c,\n            p2 ^ 0x5c5c5c5c,\n            p3 ^ 0x5c5c5c5c,\n            p4 ^ 0x5c5c5c5c,\n            p5 ^ 0x5c5c5c5c,\n            p6 ^ 0x5c5c5c5c,\n            p7 ^ 0x5c5c5c5c,\n            p8 ^ 0x5c5c5c5c,\n            p9 ^ 0x5c5c5c5c,\n            p10 ^ 0x5c5c5c5c,\n            p11 ^ 0x5c5c5c5c,\n            p12 ^ 0x5c5c5c5c,\n            p13 ^ 0x5c5c5c5c,\n            p14 ^ 0x5c5c5c5c,\n            p15 ^ 0x5c5c5c5c\n        );\n        O0 = H0;\n        O1 = H1;\n        O2 = H2;\n        O3 = H3;\n        O4 = H4;\n\n        // ipad\n        reset();\n        _core(\n            p0 ^ 0x36363636,\n            p1 ^ 0x36363636,\n            p2 ^ 0x36363636,\n            p3 ^ 0x36363636,\n            p4 ^ 0x36363636,\n            p5 ^ 0x36363636,\n            p6 ^ 0x36363636,\n            p7 ^ 0x36363636,\n            p8 ^ 0x36363636,\n            p9 ^ 0x36363636,\n            p10 ^ 0x36363636,\n            p11 ^ 0x36363636,\n            p12 ^ 0x36363636,\n            p13 ^ 0x36363636,\n            p14 ^ 0x36363636,\n            p15 ^ 0x36363636\n        );\n        I0 = H0;\n        I1 = H1;\n        I2 = H2;\n        I3 = H3;\n        I4 = H4;\n\n        TOTAL0 = 64;\n        TOTAL1 = 0;\n    }\n\n    // offset — multiple of 64\n    // output — multiple of 32\n    function hmac_finish ( offset, length, output ) {\n        offset = offset|0;\n        length = length|0;\n        output = output|0;\n\n        var t0 = 0, t1 = 0, t2 = 0, t3 = 0, t4 = 0, hashed = 0;\n\n        if ( offset & 63 )\n            return -1;\n\n        if ( ~output )\n            if ( output & 31 )\n                return -1;\n\n        hashed = finish( offset, length, -1 )|0;\n        t0 = H0, t1 = H1, t2 = H2, t3 = H3, t4 = H4;\n\n        _hmac_opad();\n        _core( t0, t1, t2, t3, t4, 0x80000000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 672 );\n\n        if ( ~output )\n            _state_to_heap(output);\n\n        return hashed|0;\n    }\n\n    // salt is assumed to be already processed\n    // offset — multiple of 64\n    // output — multiple of 32\n    function pbkdf2_generate_block ( offset, length, block, count, output ) {\n        offset = offset|0;\n        length = length|0;\n        block = block|0;\n        count = count|0;\n        output = output|0;\n\n        var h0 = 0, h1 = 0, h2 = 0, h3 = 0, h4 = 0,\n            t0 = 0, t1 = 0, t2 = 0, t3 = 0, t4 = 0;\n\n        if ( offset & 63 )\n            return -1;\n\n        if ( ~output )\n            if ( output & 31 )\n                return -1;\n\n        // pad block number into heap\n        // FIXME probable OOB write\n        HEAP[(offset+length)|0]   = block>>>24;\n        HEAP[(offset+length+1)|0] = block>>>16&255;\n        HEAP[(offset+length+2)|0] = block>>>8&255;\n        HEAP[(offset+length+3)|0] = block&255;\n\n        // finish first iteration\n        hmac_finish( offset, (length+4)|0, -1 )|0;\n        h0 = t0 = H0, h1 = t1 = H1, h2 = t2 = H2, h3 = t3 = H3, h4 = t4 = H4;\n        count = (count-1)|0;\n\n        // perform the rest iterations\n        while ( (count|0) > 0 ) {\n            hmac_reset();\n            _core( t0, t1, t2, t3, t4, 0x80000000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 672 );\n            t0 = H0, t1 = H1, t2 = H2, t3 = H3, t4 = H4;\n\n            _hmac_opad();\n            _core( t0, t1, t2, t3, t4, 0x80000000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 672 );\n            t0 = H0, t1 = H1, t2 = H2, t3 = H3, t4 = H4;\n\n            h0 = h0 ^ H0;\n            h1 = h1 ^ H1;\n            h2 = h2 ^ H2;\n            h3 = h3 ^ H3;\n            h4 = h4 ^ H4;\n\n            count = (count-1)|0;\n        }\n\n        H0 = h0;\n        H1 = h1;\n        H2 = h2;\n        H3 = h3;\n        H4 = h4;\n\n        if ( ~output )\n            _state_to_heap(output);\n\n        return 0;\n    }\n\n    return {\n      // SHA1\n      reset: reset,\n      init: init,\n      process: process,\n      finish: finish,\n\n      // HMAC-SHA1\n      hmac_reset: hmac_reset,\n      hmac_init: hmac_init,\n      hmac_finish: hmac_finish,\n\n      // PBKDF2-HMAC-SHA1\n      pbkdf2_generate_block: pbkdf2_generate_block\n    }\n}\n","import { _heap_write } from '../other/utils';\nimport { IllegalStateError } from '../other/errors';\nexport class Hash {\n    constructor() {\n        this.pos = 0;\n        this.len = 0;\n    }\n    reset() {\n        const { asm } = this.acquire_asm();\n        this.result = null;\n        this.pos = 0;\n        this.len = 0;\n        asm.reset();\n        return this;\n    }\n    process(data) {\n        if (this.result !== null)\n            throw new IllegalStateError('state must be reset before processing new data');\n        const { asm, heap } = this.acquire_asm();\n        let hpos = this.pos;\n        let hlen = this.len;\n        let dpos = 0;\n        let dlen = data.length;\n        let wlen = 0;\n        while (dlen > 0) {\n            wlen = _heap_write(heap, hpos + hlen, data, dpos, dlen);\n            hlen += wlen;\n            dpos += wlen;\n            dlen -= wlen;\n            wlen = asm.process(hpos, hlen);\n            hpos += wlen;\n            hlen -= wlen;\n            if (!hlen)\n                hpos = 0;\n        }\n        this.pos = hpos;\n        this.len = hlen;\n        return this;\n    }\n    finish() {\n        if (this.result !== null)\n            throw new IllegalStateError('state must be reset before processing new data');\n        const { asm, heap } = this.acquire_asm();\n        asm.finish(this.pos, this.len, 0);\n        this.result = new Uint8Array(this.HASH_SIZE);\n        this.result.set(heap.subarray(0, this.HASH_SIZE));\n        this.pos = 0;\n        this.len = 0;\n        this.release_asm();\n        return this;\n    }\n}\n","import { sha1_asm } from './sha1.asm';\nimport { Hash } from '../hash';\nimport { _heap_init } from '../../other/utils';\nexport const _sha1_block_size = 64;\nexport const _sha1_hash_size = 20;\nconst heap_pool = [];\nconst asm_pool = [];\nexport class Sha1 extends Hash {\n    constructor() {\n        super();\n        this.NAME = 'sha1';\n        this.BLOCK_SIZE = _sha1_block_size;\n        this.HASH_SIZE = _sha1_hash_size;\n        this.acquire_asm();\n    }\n    acquire_asm() {\n        if (this.heap === undefined || this.asm === undefined) {\n            this.heap = heap_pool.pop() || _heap_init();\n            this.asm = asm_pool.pop() || sha1_asm({ Uint8Array: Uint8Array }, null, this.heap.buffer);\n            this.reset();\n        }\n        return { heap: this.heap, asm: this.asm };\n    }\n    release_asm() {\n        if (this.heap !== undefined && this.asm !== undefined) {\n            heap_pool.push(this.heap);\n            asm_pool.push(this.asm);\n        }\n        this.heap = undefined;\n        this.asm = undefined;\n    }\n    static bytes(data) {\n        return new Sha1().process(data).finish().result;\n    }\n}\nSha1.NAME = 'sha1';\nSha1.heap_pool = [];\nSha1.asm_pool = [];\nSha1.asm_function = sha1_asm;\n","import { sha256_asm } from './sha256.asm';\nimport { Hash } from '../hash';\nimport { _heap_init } from '../../other/utils';\nexport const _sha256_block_size = 64;\nexport const _sha256_hash_size = 32;\nconst heap_pool = [];\nconst asm_pool = [];\nexport class Sha256 extends Hash {\n    constructor() {\n        super();\n        this.NAME = 'sha256';\n        this.BLOCK_SIZE = _sha256_block_size;\n        this.HASH_SIZE = _sha256_hash_size;\n        this.acquire_asm();\n    }\n    acquire_asm() {\n        if (this.heap === undefined || this.asm === undefined) {\n            this.heap = heap_pool.pop() || _heap_init();\n            this.asm = asm_pool.pop() || sha256_asm({ Uint8Array: Uint8Array }, null, this.heap.buffer);\n            this.reset();\n        }\n        return { heap: this.heap, asm: this.asm };\n    }\n    release_asm() {\n        if (this.heap !== undefined && this.asm !== undefined) {\n            heap_pool.push(this.heap);\n            asm_pool.push(this.asm);\n        }\n        this.heap = undefined;\n        this.asm = undefined;\n    }\n    static bytes(data) {\n        return new Sha256().process(data).finish().result;\n    }\n}\nSha256.NAME = 'sha256';\n","export var sha256_asm = function ( stdlib, foreign, buffer ) {\n    \"use asm\";\n\n    // SHA256 state\n    var H0 = 0, H1 = 0, H2 = 0, H3 = 0, H4 = 0, H5 = 0, H6 = 0, H7 = 0,\n        TOTAL0 = 0, TOTAL1 = 0;\n\n    // HMAC state\n    var I0 = 0, I1 = 0, I2 = 0, I3 = 0, I4 = 0, I5 = 0, I6 = 0, I7 = 0,\n        O0 = 0, O1 = 0, O2 = 0, O3 = 0, O4 = 0, O5 = 0, O6 = 0, O7 = 0;\n\n    // I/O buffer\n    var HEAP = new stdlib.Uint8Array(buffer);\n\n    function _core ( w0, w1, w2, w3, w4, w5, w6, w7, w8, w9, w10, w11, w12, w13, w14, w15 ) {\n        w0 = w0|0;\n        w1 = w1|0;\n        w2 = w2|0;\n        w3 = w3|0;\n        w4 = w4|0;\n        w5 = w5|0;\n        w6 = w6|0;\n        w7 = w7|0;\n        w8 = w8|0;\n        w9 = w9|0;\n        w10 = w10|0;\n        w11 = w11|0;\n        w12 = w12|0;\n        w13 = w13|0;\n        w14 = w14|0;\n        w15 = w15|0;\n\n        var a = 0, b = 0, c = 0, d = 0, e = 0, f = 0, g = 0, h = 0;\n\n        a = H0;\n        b = H1;\n        c = H2;\n        d = H3;\n        e = H4;\n        f = H5;\n        g = H6;\n        h = H7;\n        \n        // 0\n        h = ( w0 + h + ( e>>>6 ^ e>>>11 ^ e>>>25 ^ e<<26 ^ e<<21 ^ e<<7 ) +  ( g ^ e & (f^g) ) + 0x428a2f98 )|0;\n        d = ( d + h )|0;\n        h = ( h + ( (a & b) ^ ( c & (a ^ b) ) ) + ( a>>>2 ^ a>>>13 ^ a>>>22 ^ a<<30 ^ a<<19 ^ a<<10 ) )|0;\n\n        // 1\n        g = ( w1 + g + ( d>>>6 ^ d>>>11 ^ d>>>25 ^ d<<26 ^ d<<21 ^ d<<7 ) +  ( f ^ d & (e^f) ) + 0x71374491 )|0;\n        c = ( c + g )|0;\n        g = ( g + ( (h & a) ^ ( b & (h ^ a) ) ) + ( h>>>2 ^ h>>>13 ^ h>>>22 ^ h<<30 ^ h<<19 ^ h<<10 ) )|0;\n\n        // 2\n        f = ( w2 + f + ( c>>>6 ^ c>>>11 ^ c>>>25 ^ c<<26 ^ c<<21 ^ c<<7 ) +  ( e ^ c & (d^e) ) + 0xb5c0fbcf )|0;\n        b = ( b + f )|0;\n        f = ( f + ( (g & h) ^ ( a & (g ^ h) ) ) + ( g>>>2 ^ g>>>13 ^ g>>>22 ^ g<<30 ^ g<<19 ^ g<<10 ) )|0;\n\n        // 3\n        e = ( w3 + e + ( b>>>6 ^ b>>>11 ^ b>>>25 ^ b<<26 ^ b<<21 ^ b<<7 ) +  ( d ^ b & (c^d) ) + 0xe9b5dba5 )|0;\n        a = ( a + e )|0;\n        e = ( e + ( (f & g) ^ ( h & (f ^ g) ) ) + ( f>>>2 ^ f>>>13 ^ f>>>22 ^ f<<30 ^ f<<19 ^ f<<10 ) )|0;\n\n        // 4\n        d = ( w4 + d + ( a>>>6 ^ a>>>11 ^ a>>>25 ^ a<<26 ^ a<<21 ^ a<<7 ) +  ( c ^ a & (b^c) ) + 0x3956c25b )|0;\n        h = ( h + d )|0;\n        d = ( d + ( (e & f) ^ ( g & (e ^ f) ) ) + ( e>>>2 ^ e>>>13 ^ e>>>22 ^ e<<30 ^ e<<19 ^ e<<10 ) )|0;\n\n        // 5\n        c = ( w5 + c + ( h>>>6 ^ h>>>11 ^ h>>>25 ^ h<<26 ^ h<<21 ^ h<<7 ) +  ( b ^ h & (a^b) ) + 0x59f111f1 )|0;\n        g = ( g + c )|0;\n        c = ( c + ( (d & e) ^ ( f & (d ^ e) ) ) + ( d>>>2 ^ d>>>13 ^ d>>>22 ^ d<<30 ^ d<<19 ^ d<<10 ) )|0;\n\n        // 6\n        b = ( w6 + b + ( g>>>6 ^ g>>>11 ^ g>>>25 ^ g<<26 ^ g<<21 ^ g<<7 ) +  ( a ^ g & (h^a) ) + 0x923f82a4 )|0;\n        f = ( f + b )|0;\n        b = ( b + ( (c & d) ^ ( e & (c ^ d) ) ) + ( c>>>2 ^ c>>>13 ^ c>>>22 ^ c<<30 ^ c<<19 ^ c<<10 ) )|0;\n\n        // 7\n        a = ( w7 + a + ( f>>>6 ^ f>>>11 ^ f>>>25 ^ f<<26 ^ f<<21 ^ f<<7 ) +  ( h ^ f & (g^h) ) + 0xab1c5ed5 )|0;\n        e = ( e + a )|0;\n        a = ( a + ( (b & c) ^ ( d & (b ^ c) ) ) + ( b>>>2 ^ b>>>13 ^ b>>>22 ^ b<<30 ^ b<<19 ^ b<<10 ) )|0;\n\n        // 8\n        h = ( w8 + h + ( e>>>6 ^ e>>>11 ^ e>>>25 ^ e<<26 ^ e<<21 ^ e<<7 ) +  ( g ^ e & (f^g) ) + 0xd807aa98 )|0;\n        d = ( d + h )|0;\n        h = ( h + ( (a & b) ^ ( c & (a ^ b) ) ) + ( a>>>2 ^ a>>>13 ^ a>>>22 ^ a<<30 ^ a<<19 ^ a<<10 ) )|0;\n\n        // 9\n        g = ( w9 + g + ( d>>>6 ^ d>>>11 ^ d>>>25 ^ d<<26 ^ d<<21 ^ d<<7 ) +  ( f ^ d & (e^f) ) + 0x12835b01 )|0;\n        c = ( c + g )|0;\n        g = ( g + ( (h & a) ^ ( b & (h ^ a) ) ) + ( h>>>2 ^ h>>>13 ^ h>>>22 ^ h<<30 ^ h<<19 ^ h<<10 ) )|0;\n\n        // 10\n        f = ( w10 + f + ( c>>>6 ^ c>>>11 ^ c>>>25 ^ c<<26 ^ c<<21 ^ c<<7 ) +  ( e ^ c & (d^e) ) + 0x243185be )|0;\n        b = ( b + f )|0;\n        f = ( f + ( (g & h) ^ ( a & (g ^ h) ) ) + ( g>>>2 ^ g>>>13 ^ g>>>22 ^ g<<30 ^ g<<19 ^ g<<10 ) )|0;\n\n        // 11\n        e = ( w11 + e + ( b>>>6 ^ b>>>11 ^ b>>>25 ^ b<<26 ^ b<<21 ^ b<<7 ) +  ( d ^ b & (c^d) ) + 0x550c7dc3 )|0;\n        a = ( a + e )|0;\n        e = ( e + ( (f & g) ^ ( h & (f ^ g) ) ) + ( f>>>2 ^ f>>>13 ^ f>>>22 ^ f<<30 ^ f<<19 ^ f<<10 ) )|0;\n\n        // 12\n        d = ( w12 + d + ( a>>>6 ^ a>>>11 ^ a>>>25 ^ a<<26 ^ a<<21 ^ a<<7 ) +  ( c ^ a & (b^c) ) + 0x72be5d74 )|0;\n        h = ( h + d )|0;\n        d = ( d + ( (e & f) ^ ( g & (e ^ f) ) ) + ( e>>>2 ^ e>>>13 ^ e>>>22 ^ e<<30 ^ e<<19 ^ e<<10 ) )|0;\n\n        // 13\n        c = ( w13 + c + ( h>>>6 ^ h>>>11 ^ h>>>25 ^ h<<26 ^ h<<21 ^ h<<7 ) +  ( b ^ h & (a^b) ) + 0x80deb1fe )|0;\n        g = ( g + c )|0;\n        c = ( c + ( (d & e) ^ ( f & (d ^ e) ) ) + ( d>>>2 ^ d>>>13 ^ d>>>22 ^ d<<30 ^ d<<19 ^ d<<10 ) )|0;\n\n        // 14\n        b = ( w14 + b + ( g>>>6 ^ g>>>11 ^ g>>>25 ^ g<<26 ^ g<<21 ^ g<<7 ) +  ( a ^ g & (h^a) ) + 0x9bdc06a7 )|0;\n        f = ( f + b )|0;\n        b = ( b + ( (c & d) ^ ( e & (c ^ d) ) ) + ( c>>>2 ^ c>>>13 ^ c>>>22 ^ c<<30 ^ c<<19 ^ c<<10 ) )|0;\n\n        // 15\n        a = ( w15 + a + ( f>>>6 ^ f>>>11 ^ f>>>25 ^ f<<26 ^ f<<21 ^ f<<7 ) +  ( h ^ f & (g^h) ) + 0xc19bf174 )|0;\n        e = ( e + a )|0;\n        a = ( a + ( (b & c) ^ ( d & (b ^ c) ) ) + ( b>>>2 ^ b>>>13 ^ b>>>22 ^ b<<30 ^ b<<19 ^ b<<10 ) )|0;\n\n        // 16\n        w0 = ( ( w1>>>7  ^ w1>>>18 ^ w1>>>3  ^ w1<<25 ^ w1<<14 ) + ( w14>>>17 ^ w14>>>19 ^ w14>>>10 ^ w14<<15 ^ w14<<13 ) + w0 + w9 )|0;\n        h = ( w0 + h + ( e>>>6 ^ e>>>11 ^ e>>>25 ^ e<<26 ^ e<<21 ^ e<<7 ) +  ( g ^ e & (f^g) ) + 0xe49b69c1 )|0;\n        d = ( d + h )|0;\n        h = ( h + ( (a & b) ^ ( c & (a ^ b) ) ) + ( a>>>2 ^ a>>>13 ^ a>>>22 ^ a<<30 ^ a<<19 ^ a<<10 ) )|0;\n\n        // 17\n        w1 = ( ( w2>>>7  ^ w2>>>18 ^ w2>>>3  ^ w2<<25 ^ w2<<14 ) + ( w15>>>17 ^ w15>>>19 ^ w15>>>10 ^ w15<<15 ^ w15<<13 ) + w1 + w10 )|0;\n        g = ( w1 + g + ( d>>>6 ^ d>>>11 ^ d>>>25 ^ d<<26 ^ d<<21 ^ d<<7 ) +  ( f ^ d & (e^f) ) + 0xefbe4786 )|0;\n        c = ( c + g )|0;\n        g = ( g + ( (h & a) ^ ( b & (h ^ a) ) ) + ( h>>>2 ^ h>>>13 ^ h>>>22 ^ h<<30 ^ h<<19 ^ h<<10 ) )|0;\n\n        // 18\n        w2 = ( ( w3>>>7  ^ w3>>>18 ^ w3>>>3  ^ w3<<25 ^ w3<<14 ) + ( w0>>>17 ^ w0>>>19 ^ w0>>>10 ^ w0<<15 ^ w0<<13 ) + w2 + w11 )|0;\n        f = ( w2 + f + ( c>>>6 ^ c>>>11 ^ c>>>25 ^ c<<26 ^ c<<21 ^ c<<7 ) +  ( e ^ c & (d^e) ) + 0x0fc19dc6 )|0;\n        b = ( b + f )|0;\n        f = ( f + ( (g & h) ^ ( a & (g ^ h) ) ) + ( g>>>2 ^ g>>>13 ^ g>>>22 ^ g<<30 ^ g<<19 ^ g<<10 ) )|0;\n\n        // 19\n        w3 = ( ( w4>>>7  ^ w4>>>18 ^ w4>>>3  ^ w4<<25 ^ w4<<14 ) + ( w1>>>17 ^ w1>>>19 ^ w1>>>10 ^ w1<<15 ^ w1<<13 ) + w3 + w12 )|0;\n        e = ( w3 + e + ( b>>>6 ^ b>>>11 ^ b>>>25 ^ b<<26 ^ b<<21 ^ b<<7 ) +  ( d ^ b & (c^d) ) + 0x240ca1cc )|0;\n        a = ( a + e )|0;\n        e = ( e + ( (f & g) ^ ( h & (f ^ g) ) ) + ( f>>>2 ^ f>>>13 ^ f>>>22 ^ f<<30 ^ f<<19 ^ f<<10 ) )|0;\n\n        // 20\n        w4 = ( ( w5>>>7  ^ w5>>>18 ^ w5>>>3  ^ w5<<25 ^ w5<<14 ) + ( w2>>>17 ^ w2>>>19 ^ w2>>>10 ^ w2<<15 ^ w2<<13 ) + w4 + w13 )|0;\n        d = ( w4 + d + ( a>>>6 ^ a>>>11 ^ a>>>25 ^ a<<26 ^ a<<21 ^ a<<7 ) +  ( c ^ a & (b^c) ) + 0x2de92c6f )|0;\n        h = ( h + d )|0;\n        d = ( d + ( (e & f) ^ ( g & (e ^ f) ) ) + ( e>>>2 ^ e>>>13 ^ e>>>22 ^ e<<30 ^ e<<19 ^ e<<10 ) )|0;\n\n        // 21\n        w5 = ( ( w6>>>7  ^ w6>>>18 ^ w6>>>3  ^ w6<<25 ^ w6<<14 ) + ( w3>>>17 ^ w3>>>19 ^ w3>>>10 ^ w3<<15 ^ w3<<13 ) + w5 + w14 )|0;\n        c = ( w5 + c + ( h>>>6 ^ h>>>11 ^ h>>>25 ^ h<<26 ^ h<<21 ^ h<<7 ) +  ( b ^ h & (a^b) ) + 0x4a7484aa )|0;\n        g = ( g + c )|0;\n        c = ( c + ( (d & e) ^ ( f & (d ^ e) ) ) + ( d>>>2 ^ d>>>13 ^ d>>>22 ^ d<<30 ^ d<<19 ^ d<<10 ) )|0;\n\n        // 22\n        w6 = ( ( w7>>>7  ^ w7>>>18 ^ w7>>>3  ^ w7<<25 ^ w7<<14 ) + ( w4>>>17 ^ w4>>>19 ^ w4>>>10 ^ w4<<15 ^ w4<<13 ) + w6 + w15 )|0;\n        b = ( w6 + b + ( g>>>6 ^ g>>>11 ^ g>>>25 ^ g<<26 ^ g<<21 ^ g<<7 ) +  ( a ^ g & (h^a) ) + 0x5cb0a9dc )|0;\n        f = ( f + b )|0;\n        b = ( b + ( (c & d) ^ ( e & (c ^ d) ) ) + ( c>>>2 ^ c>>>13 ^ c>>>22 ^ c<<30 ^ c<<19 ^ c<<10 ) )|0;\n\n        // 23\n        w7 = ( ( w8>>>7  ^ w8>>>18 ^ w8>>>3  ^ w8<<25 ^ w8<<14 ) + ( w5>>>17 ^ w5>>>19 ^ w5>>>10 ^ w5<<15 ^ w5<<13 ) + w7 + w0 )|0;\n        a = ( w7 + a + ( f>>>6 ^ f>>>11 ^ f>>>25 ^ f<<26 ^ f<<21 ^ f<<7 ) +  ( h ^ f & (g^h) ) + 0x76f988da )|0;\n        e = ( e + a )|0;\n        a = ( a + ( (b & c) ^ ( d & (b ^ c) ) ) + ( b>>>2 ^ b>>>13 ^ b>>>22 ^ b<<30 ^ b<<19 ^ b<<10 ) )|0;\n\n        // 24\n        w8 = ( ( w9>>>7  ^ w9>>>18 ^ w9>>>3  ^ w9<<25 ^ w9<<14 ) + ( w6>>>17 ^ w6>>>19 ^ w6>>>10 ^ w6<<15 ^ w6<<13 ) + w8 + w1 )|0;\n        h = ( w8 + h + ( e>>>6 ^ e>>>11 ^ e>>>25 ^ e<<26 ^ e<<21 ^ e<<7 ) +  ( g ^ e & (f^g) ) + 0x983e5152 )|0;\n        d = ( d + h )|0;\n        h = ( h + ( (a & b) ^ ( c & (a ^ b) ) ) + ( a>>>2 ^ a>>>13 ^ a>>>22 ^ a<<30 ^ a<<19 ^ a<<10 ) )|0;\n\n        // 25\n        w9 = ( ( w10>>>7  ^ w10>>>18 ^ w10>>>3  ^ w10<<25 ^ w10<<14 ) + ( w7>>>17 ^ w7>>>19 ^ w7>>>10 ^ w7<<15 ^ w7<<13 ) + w9 + w2 )|0;\n        g = ( w9 + g + ( d>>>6 ^ d>>>11 ^ d>>>25 ^ d<<26 ^ d<<21 ^ d<<7 ) +  ( f ^ d & (e^f) ) + 0xa831c66d )|0;\n        c = ( c + g )|0;\n        g = ( g + ( (h & a) ^ ( b & (h ^ a) ) ) + ( h>>>2 ^ h>>>13 ^ h>>>22 ^ h<<30 ^ h<<19 ^ h<<10 ) )|0;\n\n        // 26\n        w10 = ( ( w11>>>7  ^ w11>>>18 ^ w11>>>3  ^ w11<<25 ^ w11<<14 ) + ( w8>>>17 ^ w8>>>19 ^ w8>>>10 ^ w8<<15 ^ w8<<13 ) + w10 + w3 )|0;\n        f = ( w10 + f + ( c>>>6 ^ c>>>11 ^ c>>>25 ^ c<<26 ^ c<<21 ^ c<<7 ) +  ( e ^ c & (d^e) ) + 0xb00327c8 )|0;\n        b = ( b + f )|0;\n        f = ( f + ( (g & h) ^ ( a & (g ^ h) ) ) + ( g>>>2 ^ g>>>13 ^ g>>>22 ^ g<<30 ^ g<<19 ^ g<<10 ) )|0;\n\n        // 27\n        w11 = ( ( w12>>>7  ^ w12>>>18 ^ w12>>>3  ^ w12<<25 ^ w12<<14 ) + ( w9>>>17 ^ w9>>>19 ^ w9>>>10 ^ w9<<15 ^ w9<<13 ) + w11 + w4 )|0;\n        e = ( w11 + e + ( b>>>6 ^ b>>>11 ^ b>>>25 ^ b<<26 ^ b<<21 ^ b<<7 ) +  ( d ^ b & (c^d) ) + 0xbf597fc7 )|0;\n        a = ( a + e )|0;\n        e = ( e + ( (f & g) ^ ( h & (f ^ g) ) ) + ( f>>>2 ^ f>>>13 ^ f>>>22 ^ f<<30 ^ f<<19 ^ f<<10 ) )|0;\n\n        // 28\n        w12 = ( ( w13>>>7  ^ w13>>>18 ^ w13>>>3  ^ w13<<25 ^ w13<<14 ) + ( w10>>>17 ^ w10>>>19 ^ w10>>>10 ^ w10<<15 ^ w10<<13 ) + w12 + w5 )|0;\n        d = ( w12 + d + ( a>>>6 ^ a>>>11 ^ a>>>25 ^ a<<26 ^ a<<21 ^ a<<7 ) +  ( c ^ a & (b^c) ) + 0xc6e00bf3 )|0;\n        h = ( h + d )|0;\n        d = ( d + ( (e & f) ^ ( g & (e ^ f) ) ) + ( e>>>2 ^ e>>>13 ^ e>>>22 ^ e<<30 ^ e<<19 ^ e<<10 ) )|0;\n\n        // 29\n        w13 = ( ( w14>>>7  ^ w14>>>18 ^ w14>>>3  ^ w14<<25 ^ w14<<14 ) + ( w11>>>17 ^ w11>>>19 ^ w11>>>10 ^ w11<<15 ^ w11<<13 ) + w13 + w6 )|0;\n        c = ( w13 + c + ( h>>>6 ^ h>>>11 ^ h>>>25 ^ h<<26 ^ h<<21 ^ h<<7 ) +  ( b ^ h & (a^b) ) + 0xd5a79147 )|0;\n        g = ( g + c )|0;\n        c = ( c + ( (d & e) ^ ( f & (d ^ e) ) ) + ( d>>>2 ^ d>>>13 ^ d>>>22 ^ d<<30 ^ d<<19 ^ d<<10 ) )|0;\n\n        // 30\n        w14 = ( ( w15>>>7  ^ w15>>>18 ^ w15>>>3  ^ w15<<25 ^ w15<<14 ) + ( w12>>>17 ^ w12>>>19 ^ w12>>>10 ^ w12<<15 ^ w12<<13 ) + w14 + w7 )|0;\n        b = ( w14 + b + ( g>>>6 ^ g>>>11 ^ g>>>25 ^ g<<26 ^ g<<21 ^ g<<7 ) +  ( a ^ g & (h^a) ) + 0x06ca6351 )|0;\n        f = ( f + b )|0;\n        b = ( b + ( (c & d) ^ ( e & (c ^ d) ) ) + ( c>>>2 ^ c>>>13 ^ c>>>22 ^ c<<30 ^ c<<19 ^ c<<10 ) )|0;\n\n        // 31\n        w15 = ( ( w0>>>7  ^ w0>>>18 ^ w0>>>3  ^ w0<<25 ^ w0<<14 ) + ( w13>>>17 ^ w13>>>19 ^ w13>>>10 ^ w13<<15 ^ w13<<13 ) + w15 + w8 )|0;\n        a = ( w15 + a + ( f>>>6 ^ f>>>11 ^ f>>>25 ^ f<<26 ^ f<<21 ^ f<<7 ) +  ( h ^ f & (g^h) ) + 0x14292967 )|0;\n        e = ( e + a )|0;\n        a = ( a + ( (b & c) ^ ( d & (b ^ c) ) ) + ( b>>>2 ^ b>>>13 ^ b>>>22 ^ b<<30 ^ b<<19 ^ b<<10 ) )|0;\n\n        // 32\n        w0 = ( ( w1>>>7  ^ w1>>>18 ^ w1>>>3  ^ w1<<25 ^ w1<<14 ) + ( w14>>>17 ^ w14>>>19 ^ w14>>>10 ^ w14<<15 ^ w14<<13 ) + w0 + w9 )|0;\n        h = ( w0 + h + ( e>>>6 ^ e>>>11 ^ e>>>25 ^ e<<26 ^ e<<21 ^ e<<7 ) +  ( g ^ e & (f^g) ) + 0x27b70a85 )|0;\n        d = ( d + h )|0;\n        h = ( h + ( (a & b) ^ ( c & (a ^ b) ) ) + ( a>>>2 ^ a>>>13 ^ a>>>22 ^ a<<30 ^ a<<19 ^ a<<10 ) )|0;\n\n        // 33\n        w1 = ( ( w2>>>7  ^ w2>>>18 ^ w2>>>3  ^ w2<<25 ^ w2<<14 ) + ( w15>>>17 ^ w15>>>19 ^ w15>>>10 ^ w15<<15 ^ w15<<13 ) + w1 + w10 )|0;\n        g = ( w1 + g + ( d>>>6 ^ d>>>11 ^ d>>>25 ^ d<<26 ^ d<<21 ^ d<<7 ) +  ( f ^ d & (e^f) ) + 0x2e1b2138 )|0;\n        c = ( c + g )|0;\n        g = ( g + ( (h & a) ^ ( b & (h ^ a) ) ) + ( h>>>2 ^ h>>>13 ^ h>>>22 ^ h<<30 ^ h<<19 ^ h<<10 ) )|0;\n\n        // 34\n        w2 = ( ( w3>>>7  ^ w3>>>18 ^ w3>>>3  ^ w3<<25 ^ w3<<14 ) + ( w0>>>17 ^ w0>>>19 ^ w0>>>10 ^ w0<<15 ^ w0<<13 ) + w2 + w11 )|0;\n        f = ( w2 + f + ( c>>>6 ^ c>>>11 ^ c>>>25 ^ c<<26 ^ c<<21 ^ c<<7 ) +  ( e ^ c & (d^e) ) + 0x4d2c6dfc )|0;\n        b = ( b + f )|0;\n        f = ( f + ( (g & h) ^ ( a & (g ^ h) ) ) + ( g>>>2 ^ g>>>13 ^ g>>>22 ^ g<<30 ^ g<<19 ^ g<<10 ) )|0;\n\n        // 35\n        w3 = ( ( w4>>>7  ^ w4>>>18 ^ w4>>>3  ^ w4<<25 ^ w4<<14 ) + ( w1>>>17 ^ w1>>>19 ^ w1>>>10 ^ w1<<15 ^ w1<<13 ) + w3 + w12 )|0;\n        e = ( w3 + e + ( b>>>6 ^ b>>>11 ^ b>>>25 ^ b<<26 ^ b<<21 ^ b<<7 ) +  ( d ^ b & (c^d) ) + 0x53380d13 )|0;\n        a = ( a + e )|0;\n        e = ( e + ( (f & g) ^ ( h & (f ^ g) ) ) + ( f>>>2 ^ f>>>13 ^ f>>>22 ^ f<<30 ^ f<<19 ^ f<<10 ) )|0;\n\n        // 36\n        w4 = ( ( w5>>>7  ^ w5>>>18 ^ w5>>>3  ^ w5<<25 ^ w5<<14 ) + ( w2>>>17 ^ w2>>>19 ^ w2>>>10 ^ w2<<15 ^ w2<<13 ) + w4 + w13 )|0;\n        d = ( w4 + d + ( a>>>6 ^ a>>>11 ^ a>>>25 ^ a<<26 ^ a<<21 ^ a<<7 ) +  ( c ^ a & (b^c) ) + 0x650a7354 )|0;\n        h = ( h + d )|0;\n        d = ( d + ( (e & f) ^ ( g & (e ^ f) ) ) + ( e>>>2 ^ e>>>13 ^ e>>>22 ^ e<<30 ^ e<<19 ^ e<<10 ) )|0;\n\n        // 37\n        w5 = ( ( w6>>>7  ^ w6>>>18 ^ w6>>>3  ^ w6<<25 ^ w6<<14 ) + ( w3>>>17 ^ w3>>>19 ^ w3>>>10 ^ w3<<15 ^ w3<<13 ) + w5 + w14 )|0;\n        c = ( w5 + c + ( h>>>6 ^ h>>>11 ^ h>>>25 ^ h<<26 ^ h<<21 ^ h<<7 ) +  ( b ^ h & (a^b) ) + 0x766a0abb )|0;\n        g = ( g + c )|0;\n        c = ( c + ( (d & e) ^ ( f & (d ^ e) ) ) + ( d>>>2 ^ d>>>13 ^ d>>>22 ^ d<<30 ^ d<<19 ^ d<<10 ) )|0;\n\n        // 38\n        w6 = ( ( w7>>>7  ^ w7>>>18 ^ w7>>>3  ^ w7<<25 ^ w7<<14 ) + ( w4>>>17 ^ w4>>>19 ^ w4>>>10 ^ w4<<15 ^ w4<<13 ) + w6 + w15 )|0;\n        b = ( w6 + b + ( g>>>6 ^ g>>>11 ^ g>>>25 ^ g<<26 ^ g<<21 ^ g<<7 ) +  ( a ^ g & (h^a) ) + 0x81c2c92e )|0;\n        f = ( f + b )|0;\n        b = ( b + ( (c & d) ^ ( e & (c ^ d) ) ) + ( c>>>2 ^ c>>>13 ^ c>>>22 ^ c<<30 ^ c<<19 ^ c<<10 ) )|0;\n\n        // 39\n        w7 = ( ( w8>>>7  ^ w8>>>18 ^ w8>>>3  ^ w8<<25 ^ w8<<14 ) + ( w5>>>17 ^ w5>>>19 ^ w5>>>10 ^ w5<<15 ^ w5<<13 ) + w7 + w0 )|0;\n        a = ( w7 + a + ( f>>>6 ^ f>>>11 ^ f>>>25 ^ f<<26 ^ f<<21 ^ f<<7 ) +  ( h ^ f & (g^h) ) + 0x92722c85 )|0;\n        e = ( e + a )|0;\n        a = ( a + ( (b & c) ^ ( d & (b ^ c) ) ) + ( b>>>2 ^ b>>>13 ^ b>>>22 ^ b<<30 ^ b<<19 ^ b<<10 ) )|0;\n\n        // 40\n        w8 = ( ( w9>>>7  ^ w9>>>18 ^ w9>>>3  ^ w9<<25 ^ w9<<14 ) + ( w6>>>17 ^ w6>>>19 ^ w6>>>10 ^ w6<<15 ^ w6<<13 ) + w8 + w1 )|0;\n        h = ( w8 + h + ( e>>>6 ^ e>>>11 ^ e>>>25 ^ e<<26 ^ e<<21 ^ e<<7 ) +  ( g ^ e & (f^g) ) + 0xa2bfe8a1 )|0;\n        d = ( d + h )|0;\n        h = ( h + ( (a & b) ^ ( c & (a ^ b) ) ) + ( a>>>2 ^ a>>>13 ^ a>>>22 ^ a<<30 ^ a<<19 ^ a<<10 ) )|0;\n\n        // 41\n        w9 = ( ( w10>>>7  ^ w10>>>18 ^ w10>>>3  ^ w10<<25 ^ w10<<14 ) + ( w7>>>17 ^ w7>>>19 ^ w7>>>10 ^ w7<<15 ^ w7<<13 ) + w9 + w2 )|0;\n        g = ( w9 + g + ( d>>>6 ^ d>>>11 ^ d>>>25 ^ d<<26 ^ d<<21 ^ d<<7 ) +  ( f ^ d & (e^f) ) + 0xa81a664b )|0;\n        c = ( c + g )|0;\n        g = ( g + ( (h & a) ^ ( b & (h ^ a) ) ) + ( h>>>2 ^ h>>>13 ^ h>>>22 ^ h<<30 ^ h<<19 ^ h<<10 ) )|0;\n\n        // 42\n        w10 = ( ( w11>>>7  ^ w11>>>18 ^ w11>>>3  ^ w11<<25 ^ w11<<14 ) + ( w8>>>17 ^ w8>>>19 ^ w8>>>10 ^ w8<<15 ^ w8<<13 ) + w10 + w3 )|0;\n        f = ( w10 + f + ( c>>>6 ^ c>>>11 ^ c>>>25 ^ c<<26 ^ c<<21 ^ c<<7 ) +  ( e ^ c & (d^e) ) + 0xc24b8b70 )|0;\n        b = ( b + f )|0;\n        f = ( f + ( (g & h) ^ ( a & (g ^ h) ) ) + ( g>>>2 ^ g>>>13 ^ g>>>22 ^ g<<30 ^ g<<19 ^ g<<10 ) )|0;\n\n        // 43\n        w11 = ( ( w12>>>7  ^ w12>>>18 ^ w12>>>3  ^ w12<<25 ^ w12<<14 ) + ( w9>>>17 ^ w9>>>19 ^ w9>>>10 ^ w9<<15 ^ w9<<13 ) + w11 + w4 )|0;\n        e = ( w11 + e + ( b>>>6 ^ b>>>11 ^ b>>>25 ^ b<<26 ^ b<<21 ^ b<<7 ) +  ( d ^ b & (c^d) ) + 0xc76c51a3 )|0;\n        a = ( a + e )|0;\n        e = ( e + ( (f & g) ^ ( h & (f ^ g) ) ) + ( f>>>2 ^ f>>>13 ^ f>>>22 ^ f<<30 ^ f<<19 ^ f<<10 ) )|0;\n\n        // 44\n        w12 = ( ( w13>>>7  ^ w13>>>18 ^ w13>>>3  ^ w13<<25 ^ w13<<14 ) + ( w10>>>17 ^ w10>>>19 ^ w10>>>10 ^ w10<<15 ^ w10<<13 ) + w12 + w5 )|0;\n        d = ( w12 + d + ( a>>>6 ^ a>>>11 ^ a>>>25 ^ a<<26 ^ a<<21 ^ a<<7 ) +  ( c ^ a & (b^c) ) + 0xd192e819 )|0;\n        h = ( h + d )|0;\n        d = ( d + ( (e & f) ^ ( g & (e ^ f) ) ) + ( e>>>2 ^ e>>>13 ^ e>>>22 ^ e<<30 ^ e<<19 ^ e<<10 ) )|0;\n\n        // 45\n        w13 = ( ( w14>>>7  ^ w14>>>18 ^ w14>>>3  ^ w14<<25 ^ w14<<14 ) + ( w11>>>17 ^ w11>>>19 ^ w11>>>10 ^ w11<<15 ^ w11<<13 ) + w13 + w6 )|0;\n        c = ( w13 + c + ( h>>>6 ^ h>>>11 ^ h>>>25 ^ h<<26 ^ h<<21 ^ h<<7 ) +  ( b ^ h & (a^b) ) + 0xd6990624 )|0;\n        g = ( g + c )|0;\n        c = ( c + ( (d & e) ^ ( f & (d ^ e) ) ) + ( d>>>2 ^ d>>>13 ^ d>>>22 ^ d<<30 ^ d<<19 ^ d<<10 ) )|0;\n\n        // 46\n        w14 = ( ( w15>>>7  ^ w15>>>18 ^ w15>>>3  ^ w15<<25 ^ w15<<14 ) + ( w12>>>17 ^ w12>>>19 ^ w12>>>10 ^ w12<<15 ^ w12<<13 ) + w14 + w7 )|0;\n        b = ( w14 + b + ( g>>>6 ^ g>>>11 ^ g>>>25 ^ g<<26 ^ g<<21 ^ g<<7 ) +  ( a ^ g & (h^a) ) + 0xf40e3585 )|0;\n        f = ( f + b )|0;\n        b = ( b + ( (c & d) ^ ( e & (c ^ d) ) ) + ( c>>>2 ^ c>>>13 ^ c>>>22 ^ c<<30 ^ c<<19 ^ c<<10 ) )|0;\n\n        // 47\n        w15 = ( ( w0>>>7  ^ w0>>>18 ^ w0>>>3  ^ w0<<25 ^ w0<<14 ) + ( w13>>>17 ^ w13>>>19 ^ w13>>>10 ^ w13<<15 ^ w13<<13 ) + w15 + w8 )|0;\n        a = ( w15 + a + ( f>>>6 ^ f>>>11 ^ f>>>25 ^ f<<26 ^ f<<21 ^ f<<7 ) +  ( h ^ f & (g^h) ) + 0x106aa070 )|0;\n        e = ( e + a )|0;\n        a = ( a + ( (b & c) ^ ( d & (b ^ c) ) ) + ( b>>>2 ^ b>>>13 ^ b>>>22 ^ b<<30 ^ b<<19 ^ b<<10 ) )|0;\n\n        // 48\n        w0 = ( ( w1>>>7  ^ w1>>>18 ^ w1>>>3  ^ w1<<25 ^ w1<<14 ) + ( w14>>>17 ^ w14>>>19 ^ w14>>>10 ^ w14<<15 ^ w14<<13 ) + w0 + w9 )|0;\n        h = ( w0 + h + ( e>>>6 ^ e>>>11 ^ e>>>25 ^ e<<26 ^ e<<21 ^ e<<7 ) +  ( g ^ e & (f^g) ) + 0x19a4c116 )|0;\n        d = ( d + h )|0;\n        h = ( h + ( (a & b) ^ ( c & (a ^ b) ) ) + ( a>>>2 ^ a>>>13 ^ a>>>22 ^ a<<30 ^ a<<19 ^ a<<10 ) )|0;\n\n        // 49\n        w1 = ( ( w2>>>7  ^ w2>>>18 ^ w2>>>3  ^ w2<<25 ^ w2<<14 ) + ( w15>>>17 ^ w15>>>19 ^ w15>>>10 ^ w15<<15 ^ w15<<13 ) + w1 + w10 )|0;\n        g = ( w1 + g + ( d>>>6 ^ d>>>11 ^ d>>>25 ^ d<<26 ^ d<<21 ^ d<<7 ) +  ( f ^ d & (e^f) ) + 0x1e376c08 )|0;\n        c = ( c + g )|0;\n        g = ( g + ( (h & a) ^ ( b & (h ^ a) ) ) + ( h>>>2 ^ h>>>13 ^ h>>>22 ^ h<<30 ^ h<<19 ^ h<<10 ) )|0;\n\n        // 50\n        w2 = ( ( w3>>>7  ^ w3>>>18 ^ w3>>>3  ^ w3<<25 ^ w3<<14 ) + ( w0>>>17 ^ w0>>>19 ^ w0>>>10 ^ w0<<15 ^ w0<<13 ) + w2 + w11 )|0;\n        f = ( w2 + f + ( c>>>6 ^ c>>>11 ^ c>>>25 ^ c<<26 ^ c<<21 ^ c<<7 ) +  ( e ^ c & (d^e) ) + 0x2748774c )|0;\n        b = ( b + f )|0;\n        f = ( f + ( (g & h) ^ ( a & (g ^ h) ) ) + ( g>>>2 ^ g>>>13 ^ g>>>22 ^ g<<30 ^ g<<19 ^ g<<10 ) )|0;\n\n        // 51\n        w3 = ( ( w4>>>7  ^ w4>>>18 ^ w4>>>3  ^ w4<<25 ^ w4<<14 ) + ( w1>>>17 ^ w1>>>19 ^ w1>>>10 ^ w1<<15 ^ w1<<13 ) + w3 + w12 )|0;\n        e = ( w3 + e + ( b>>>6 ^ b>>>11 ^ b>>>25 ^ b<<26 ^ b<<21 ^ b<<7 ) +  ( d ^ b & (c^d) ) + 0x34b0bcb5 )|0;\n        a = ( a + e )|0;\n        e = ( e + ( (f & g) ^ ( h & (f ^ g) ) ) + ( f>>>2 ^ f>>>13 ^ f>>>22 ^ f<<30 ^ f<<19 ^ f<<10 ) )|0;\n\n        // 52\n        w4 = ( ( w5>>>7  ^ w5>>>18 ^ w5>>>3  ^ w5<<25 ^ w5<<14 ) + ( w2>>>17 ^ w2>>>19 ^ w2>>>10 ^ w2<<15 ^ w2<<13 ) + w4 + w13 )|0;\n        d = ( w4 + d + ( a>>>6 ^ a>>>11 ^ a>>>25 ^ a<<26 ^ a<<21 ^ a<<7 ) +  ( c ^ a & (b^c) ) + 0x391c0cb3 )|0;\n        h = ( h + d )|0;\n        d = ( d + ( (e & f) ^ ( g & (e ^ f) ) ) + ( e>>>2 ^ e>>>13 ^ e>>>22 ^ e<<30 ^ e<<19 ^ e<<10 ) )|0;\n\n        // 53\n        w5 = ( ( w6>>>7  ^ w6>>>18 ^ w6>>>3  ^ w6<<25 ^ w6<<14 ) + ( w3>>>17 ^ w3>>>19 ^ w3>>>10 ^ w3<<15 ^ w3<<13 ) + w5 + w14 )|0;\n        c = ( w5 + c + ( h>>>6 ^ h>>>11 ^ h>>>25 ^ h<<26 ^ h<<21 ^ h<<7 ) +  ( b ^ h & (a^b) ) + 0x4ed8aa4a )|0;\n        g = ( g + c )|0;\n        c = ( c + ( (d & e) ^ ( f & (d ^ e) ) ) + ( d>>>2 ^ d>>>13 ^ d>>>22 ^ d<<30 ^ d<<19 ^ d<<10 ) )|0;\n\n        // 54\n        w6 = ( ( w7>>>7  ^ w7>>>18 ^ w7>>>3  ^ w7<<25 ^ w7<<14 ) + ( w4>>>17 ^ w4>>>19 ^ w4>>>10 ^ w4<<15 ^ w4<<13 ) + w6 + w15 )|0;\n        b = ( w6 + b + ( g>>>6 ^ g>>>11 ^ g>>>25 ^ g<<26 ^ g<<21 ^ g<<7 ) +  ( a ^ g & (h^a) ) + 0x5b9cca4f )|0;\n        f = ( f + b )|0;\n        b = ( b + ( (c & d) ^ ( e & (c ^ d) ) ) + ( c>>>2 ^ c>>>13 ^ c>>>22 ^ c<<30 ^ c<<19 ^ c<<10 ) )|0;\n\n        // 55\n        w7 = ( ( w8>>>7  ^ w8>>>18 ^ w8>>>3  ^ w8<<25 ^ w8<<14 ) + ( w5>>>17 ^ w5>>>19 ^ w5>>>10 ^ w5<<15 ^ w5<<13 ) + w7 + w0 )|0;\n        a = ( w7 + a + ( f>>>6 ^ f>>>11 ^ f>>>25 ^ f<<26 ^ f<<21 ^ f<<7 ) +  ( h ^ f & (g^h) ) + 0x682e6ff3 )|0;\n        e = ( e + a )|0;\n        a = ( a + ( (b & c) ^ ( d & (b ^ c) ) ) + ( b>>>2 ^ b>>>13 ^ b>>>22 ^ b<<30 ^ b<<19 ^ b<<10 ) )|0;\n\n        // 56\n        w8 = ( ( w9>>>7  ^ w9>>>18 ^ w9>>>3  ^ w9<<25 ^ w9<<14 ) + ( w6>>>17 ^ w6>>>19 ^ w6>>>10 ^ w6<<15 ^ w6<<13 ) + w8 + w1 )|0;\n        h = ( w8 + h + ( e>>>6 ^ e>>>11 ^ e>>>25 ^ e<<26 ^ e<<21 ^ e<<7 ) +  ( g ^ e & (f^g) ) + 0x748f82ee )|0;\n        d = ( d + h )|0;\n        h = ( h + ( (a & b) ^ ( c & (a ^ b) ) ) + ( a>>>2 ^ a>>>13 ^ a>>>22 ^ a<<30 ^ a<<19 ^ a<<10 ) )|0;\n\n        // 57\n        w9 = ( ( w10>>>7  ^ w10>>>18 ^ w10>>>3  ^ w10<<25 ^ w10<<14 ) + ( w7>>>17 ^ w7>>>19 ^ w7>>>10 ^ w7<<15 ^ w7<<13 ) + w9 + w2 )|0;\n        g = ( w9 + g + ( d>>>6 ^ d>>>11 ^ d>>>25 ^ d<<26 ^ d<<21 ^ d<<7 ) +  ( f ^ d & (e^f) ) + 0x78a5636f )|0;\n        c = ( c + g )|0;\n        g = ( g + ( (h & a) ^ ( b & (h ^ a) ) ) + ( h>>>2 ^ h>>>13 ^ h>>>22 ^ h<<30 ^ h<<19 ^ h<<10 ) )|0;\n\n        // 58\n        w10 = ( ( w11>>>7  ^ w11>>>18 ^ w11>>>3  ^ w11<<25 ^ w11<<14 ) + ( w8>>>17 ^ w8>>>19 ^ w8>>>10 ^ w8<<15 ^ w8<<13 ) + w10 + w3 )|0;\n        f = ( w10 + f + ( c>>>6 ^ c>>>11 ^ c>>>25 ^ c<<26 ^ c<<21 ^ c<<7 ) +  ( e ^ c & (d^e) ) + 0x84c87814 )|0;\n        b = ( b + f )|0;\n        f = ( f + ( (g & h) ^ ( a & (g ^ h) ) ) + ( g>>>2 ^ g>>>13 ^ g>>>22 ^ g<<30 ^ g<<19 ^ g<<10 ) )|0;\n\n        // 59\n        w11 = ( ( w12>>>7  ^ w12>>>18 ^ w12>>>3  ^ w12<<25 ^ w12<<14 ) + ( w9>>>17 ^ w9>>>19 ^ w9>>>10 ^ w9<<15 ^ w9<<13 ) + w11 + w4 )|0;\n        e = ( w11 + e + ( b>>>6 ^ b>>>11 ^ b>>>25 ^ b<<26 ^ b<<21 ^ b<<7 ) +  ( d ^ b & (c^d) ) + 0x8cc70208 )|0;\n        a = ( a + e )|0;\n        e = ( e + ( (f & g) ^ ( h & (f ^ g) ) ) + ( f>>>2 ^ f>>>13 ^ f>>>22 ^ f<<30 ^ f<<19 ^ f<<10 ) )|0;\n\n        // 60\n        w12 = ( ( w13>>>7  ^ w13>>>18 ^ w13>>>3  ^ w13<<25 ^ w13<<14 ) + ( w10>>>17 ^ w10>>>19 ^ w10>>>10 ^ w10<<15 ^ w10<<13 ) + w12 + w5 )|0;\n        d = ( w12 + d + ( a>>>6 ^ a>>>11 ^ a>>>25 ^ a<<26 ^ a<<21 ^ a<<7 ) +  ( c ^ a & (b^c) ) + 0x90befffa )|0;\n        h = ( h + d )|0;\n        d = ( d + ( (e & f) ^ ( g & (e ^ f) ) ) + ( e>>>2 ^ e>>>13 ^ e>>>22 ^ e<<30 ^ e<<19 ^ e<<10 ) )|0;\n\n        // 61\n        w13 = ( ( w14>>>7  ^ w14>>>18 ^ w14>>>3  ^ w14<<25 ^ w14<<14 ) + ( w11>>>17 ^ w11>>>19 ^ w11>>>10 ^ w11<<15 ^ w11<<13 ) + w13 + w6 )|0;\n        c = ( w13 + c + ( h>>>6 ^ h>>>11 ^ h>>>25 ^ h<<26 ^ h<<21 ^ h<<7 ) +  ( b ^ h & (a^b) ) + 0xa4506ceb )|0;\n        g = ( g + c )|0;\n        c = ( c + ( (d & e) ^ ( f & (d ^ e) ) ) + ( d>>>2 ^ d>>>13 ^ d>>>22 ^ d<<30 ^ d<<19 ^ d<<10 ) )|0;\n\n        // 62\n        w14 = ( ( w15>>>7  ^ w15>>>18 ^ w15>>>3  ^ w15<<25 ^ w15<<14 ) + ( w12>>>17 ^ w12>>>19 ^ w12>>>10 ^ w12<<15 ^ w12<<13 ) + w14 + w7 )|0;\n        b = ( w14 + b + ( g>>>6 ^ g>>>11 ^ g>>>25 ^ g<<26 ^ g<<21 ^ g<<7 ) +  ( a ^ g & (h^a) ) + 0xbef9a3f7 )|0;\n        f = ( f + b )|0;\n        b = ( b + ( (c & d) ^ ( e & (c ^ d) ) ) + ( c>>>2 ^ c>>>13 ^ c>>>22 ^ c<<30 ^ c<<19 ^ c<<10 ) )|0;\n\n        // 63\n        w15 = ( ( w0>>>7  ^ w0>>>18 ^ w0>>>3  ^ w0<<25 ^ w0<<14 ) + ( w13>>>17 ^ w13>>>19 ^ w13>>>10 ^ w13<<15 ^ w13<<13 ) + w15 + w8 )|0;\n        a = ( w15 + a + ( f>>>6 ^ f>>>11 ^ f>>>25 ^ f<<26 ^ f<<21 ^ f<<7 ) +  ( h ^ f & (g^h) ) + 0xc67178f2 )|0;\n        e = ( e + a )|0;\n        a = ( a + ( (b & c) ^ ( d & (b ^ c) ) ) + ( b>>>2 ^ b>>>13 ^ b>>>22 ^ b<<30 ^ b<<19 ^ b<<10 ) )|0;\n\n        H0 = ( H0 + a )|0;\n        H1 = ( H1 + b )|0;\n        H2 = ( H2 + c )|0;\n        H3 = ( H3 + d )|0;\n        H4 = ( H4 + e )|0;\n        H5 = ( H5 + f )|0;\n        H6 = ( H6 + g )|0;\n        H7 = ( H7 + h )|0;\n    }\n\n    function _core_heap ( offset ) {\n        offset = offset|0;\n\n        _core(\n            HEAP[offset|0]<<24 | HEAP[offset|1]<<16 | HEAP[offset|2]<<8 | HEAP[offset|3],\n            HEAP[offset|4]<<24 | HEAP[offset|5]<<16 | HEAP[offset|6]<<8 | HEAP[offset|7],\n            HEAP[offset|8]<<24 | HEAP[offset|9]<<16 | HEAP[offset|10]<<8 | HEAP[offset|11],\n            HEAP[offset|12]<<24 | HEAP[offset|13]<<16 | HEAP[offset|14]<<8 | HEAP[offset|15],\n            HEAP[offset|16]<<24 | HEAP[offset|17]<<16 | HEAP[offset|18]<<8 | HEAP[offset|19],\n            HEAP[offset|20]<<24 | HEAP[offset|21]<<16 | HEAP[offset|22]<<8 | HEAP[offset|23],\n            HEAP[offset|24]<<24 | HEAP[offset|25]<<16 | HEAP[offset|26]<<8 | HEAP[offset|27],\n            HEAP[offset|28]<<24 | HEAP[offset|29]<<16 | HEAP[offset|30]<<8 | HEAP[offset|31],\n            HEAP[offset|32]<<24 | HEAP[offset|33]<<16 | HEAP[offset|34]<<8 | HEAP[offset|35],\n            HEAP[offset|36]<<24 | HEAP[offset|37]<<16 | HEAP[offset|38]<<8 | HEAP[offset|39],\n            HEAP[offset|40]<<24 | HEAP[offset|41]<<16 | HEAP[offset|42]<<8 | HEAP[offset|43],\n            HEAP[offset|44]<<24 | HEAP[offset|45]<<16 | HEAP[offset|46]<<8 | HEAP[offset|47],\n            HEAP[offset|48]<<24 | HEAP[offset|49]<<16 | HEAP[offset|50]<<8 | HEAP[offset|51],\n            HEAP[offset|52]<<24 | HEAP[offset|53]<<16 | HEAP[offset|54]<<8 | HEAP[offset|55],\n            HEAP[offset|56]<<24 | HEAP[offset|57]<<16 | HEAP[offset|58]<<8 | HEAP[offset|59],\n            HEAP[offset|60]<<24 | HEAP[offset|61]<<16 | HEAP[offset|62]<<8 | HEAP[offset|63]\n        );\n    }\n\n    // offset — multiple of 32\n    function _state_to_heap ( output ) {\n        output = output|0;\n\n        HEAP[output|0] = H0>>>24;\n        HEAP[output|1] = H0>>>16&255;\n        HEAP[output|2] = H0>>>8&255;\n        HEAP[output|3] = H0&255;\n        HEAP[output|4] = H1>>>24;\n        HEAP[output|5] = H1>>>16&255;\n        HEAP[output|6] = H1>>>8&255;\n        HEAP[output|7] = H1&255;\n        HEAP[output|8] = H2>>>24;\n        HEAP[output|9] = H2>>>16&255;\n        HEAP[output|10] = H2>>>8&255;\n        HEAP[output|11] = H2&255;\n        HEAP[output|12] = H3>>>24;\n        HEAP[output|13] = H3>>>16&255;\n        HEAP[output|14] = H3>>>8&255;\n        HEAP[output|15] = H3&255;\n        HEAP[output|16] = H4>>>24;\n        HEAP[output|17] = H4>>>16&255;\n        HEAP[output|18] = H4>>>8&255;\n        HEAP[output|19] = H4&255;\n        HEAP[output|20] = H5>>>24;\n        HEAP[output|21] = H5>>>16&255;\n        HEAP[output|22] = H5>>>8&255;\n        HEAP[output|23] = H5&255;\n        HEAP[output|24] = H6>>>24;\n        HEAP[output|25] = H6>>>16&255;\n        HEAP[output|26] = H6>>>8&255;\n        HEAP[output|27] = H6&255;\n        HEAP[output|28] = H7>>>24;\n        HEAP[output|29] = H7>>>16&255;\n        HEAP[output|30] = H7>>>8&255;\n        HEAP[output|31] = H7&255;\n    }\n\n    function reset () {\n        H0 = 0x6a09e667;\n        H1 = 0xbb67ae85;\n        H2 = 0x3c6ef372;\n        H3 = 0xa54ff53a;\n        H4 = 0x510e527f;\n        H5 = 0x9b05688c;\n        H6 = 0x1f83d9ab;\n        H7 = 0x5be0cd19;\n        TOTAL0 = TOTAL1 = 0;\n    }\n\n    function init ( h0, h1, h2, h3, h4, h5, h6, h7, total0, total1 ) {\n        h0 = h0|0;\n        h1 = h1|0;\n        h2 = h2|0;\n        h3 = h3|0;\n        h4 = h4|0;\n        h5 = h5|0;\n        h6 = h6|0;\n        h7 = h7|0;\n        total0 = total0|0;\n        total1 = total1|0;\n\n        H0 = h0;\n        H1 = h1;\n        H2 = h2;\n        H3 = h3;\n        H4 = h4;\n        H5 = h5;\n        H6 = h6;\n        H7 = h7;\n        TOTAL0 = total0;\n        TOTAL1 = total1;\n    }\n\n    // offset — multiple of 64\n    function process ( offset, length ) {\n        offset = offset|0;\n        length = length|0;\n\n        var hashed = 0;\n\n        if ( offset & 63 )\n            return -1;\n\n        while ( (length|0) >= 64 ) {\n            _core_heap(offset);\n\n            offset = ( offset + 64 )|0;\n            length = ( length - 64 )|0;\n\n            hashed = ( hashed + 64 )|0;\n        }\n\n        TOTAL0 = ( TOTAL0 + hashed )|0;\n        if ( TOTAL0>>>0 < hashed>>>0 ) TOTAL1 = ( TOTAL1 + 1 )|0;\n\n        return hashed|0;\n    }\n\n    // offset — multiple of 64\n    // output — multiple of 32\n    function finish ( offset, length, output ) {\n        offset = offset|0;\n        length = length|0;\n        output = output|0;\n\n        var hashed = 0,\n            i = 0;\n\n        if ( offset & 63 )\n            return -1;\n\n        if ( ~output )\n            if ( output & 31 )\n                return -1;\n\n        if ( (length|0) >= 64 ) {\n            hashed = process( offset, length )|0;\n            if ( (hashed|0) == -1 )\n                return -1;\n\n            offset = ( offset + hashed )|0;\n            length = ( length - hashed )|0;\n        }\n\n        hashed = ( hashed + length )|0;\n        TOTAL0 = ( TOTAL0 + length )|0;\n        if ( TOTAL0>>>0 < length>>>0 ) TOTAL1 = ( TOTAL1 + 1 )|0;\n\n        HEAP[offset|length] = 0x80;\n\n        if ( (length|0) >= 56 ) {\n            for ( i = (length+1)|0; (i|0) < 64; i = (i+1)|0 )\n                HEAP[offset|i] = 0x00;\n\n            _core_heap(offset);\n\n            length = 0;\n\n            HEAP[offset|0] = 0;\n        }\n\n        for ( i = (length+1)|0; (i|0) < 59; i = (i+1)|0 )\n            HEAP[offset|i] = 0;\n\n        HEAP[offset|56] = TOTAL1>>>21&255;\n        HEAP[offset|57] = TOTAL1>>>13&255;\n        HEAP[offset|58] = TOTAL1>>>5&255;\n        HEAP[offset|59] = TOTAL1<<3&255 | TOTAL0>>>29;\n        HEAP[offset|60] = TOTAL0>>>21&255;\n        HEAP[offset|61] = TOTAL0>>>13&255;\n        HEAP[offset|62] = TOTAL0>>>5&255;\n        HEAP[offset|63] = TOTAL0<<3&255;\n        _core_heap(offset);\n\n        if ( ~output )\n            _state_to_heap(output);\n\n        return hashed|0;\n    }\n\n    function hmac_reset () {\n        H0 = I0;\n        H1 = I1;\n        H2 = I2;\n        H3 = I3;\n        H4 = I4;\n        H5 = I5;\n        H6 = I6;\n        H7 = I7;\n        TOTAL0 = 64;\n        TOTAL1 = 0;\n    }\n\n    function _hmac_opad () {\n        H0 = O0;\n        H1 = O1;\n        H2 = O2;\n        H3 = O3;\n        H4 = O4;\n        H5 = O5;\n        H6 = O6;\n        H7 = O7;\n        TOTAL0 = 64;\n        TOTAL1 = 0;\n    }\n\n    function hmac_init ( p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15 ) {\n        p0 = p0|0;\n        p1 = p1|0;\n        p2 = p2|0;\n        p3 = p3|0;\n        p4 = p4|0;\n        p5 = p5|0;\n        p6 = p6|0;\n        p7 = p7|0;\n        p8 = p8|0;\n        p9 = p9|0;\n        p10 = p10|0;\n        p11 = p11|0;\n        p12 = p12|0;\n        p13 = p13|0;\n        p14 = p14|0;\n        p15 = p15|0;\n\n        // opad\n        reset();\n        _core(\n            p0 ^ 0x5c5c5c5c,\n            p1 ^ 0x5c5c5c5c,\n            p2 ^ 0x5c5c5c5c,\n            p3 ^ 0x5c5c5c5c,\n            p4 ^ 0x5c5c5c5c,\n            p5 ^ 0x5c5c5c5c,\n            p6 ^ 0x5c5c5c5c,\n            p7 ^ 0x5c5c5c5c,\n            p8 ^ 0x5c5c5c5c,\n            p9 ^ 0x5c5c5c5c,\n            p10 ^ 0x5c5c5c5c,\n            p11 ^ 0x5c5c5c5c,\n            p12 ^ 0x5c5c5c5c,\n            p13 ^ 0x5c5c5c5c,\n            p14 ^ 0x5c5c5c5c,\n            p15 ^ 0x5c5c5c5c\n        );\n        O0 = H0;\n        O1 = H1;\n        O2 = H2;\n        O3 = H3;\n        O4 = H4;\n        O5 = H5;\n        O6 = H6;\n        O7 = H7;\n\n        // ipad\n        reset();\n        _core(\n            p0 ^ 0x36363636,\n            p1 ^ 0x36363636,\n            p2 ^ 0x36363636,\n            p3 ^ 0x36363636,\n            p4 ^ 0x36363636,\n            p5 ^ 0x36363636,\n            p6 ^ 0x36363636,\n            p7 ^ 0x36363636,\n            p8 ^ 0x36363636,\n            p9 ^ 0x36363636,\n            p10 ^ 0x36363636,\n            p11 ^ 0x36363636,\n            p12 ^ 0x36363636,\n            p13 ^ 0x36363636,\n            p14 ^ 0x36363636,\n            p15 ^ 0x36363636\n        );\n        I0 = H0;\n        I1 = H1;\n        I2 = H2;\n        I3 = H3;\n        I4 = H4;\n        I5 = H5;\n        I6 = H6;\n        I7 = H7;\n\n        TOTAL0 = 64;\n        TOTAL1 = 0;\n    }\n\n    // offset — multiple of 64\n    // output — multiple of 32\n    function hmac_finish ( offset, length, output ) {\n        offset = offset|0;\n        length = length|0;\n        output = output|0;\n\n        var t0 = 0, t1 = 0, t2 = 0, t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0,\n            hashed = 0;\n\n        if ( offset & 63 )\n            return -1;\n\n        if ( ~output )\n            if ( output & 31 )\n                return -1;\n\n        hashed = finish( offset, length, -1 )|0;\n        t0 = H0, t1 = H1, t2 = H2, t3 = H3, t4 = H4, t5 = H5, t6 = H6, t7 = H7;\n\n        _hmac_opad();\n        _core( t0, t1, t2, t3, t4, t5, t6, t7, 0x80000000, 0, 0, 0, 0, 0, 0, 768 );\n\n        if ( ~output )\n            _state_to_heap(output);\n\n        return hashed|0;\n    }\n\n    // salt is assumed to be already processed\n    // offset — multiple of 64\n    // output — multiple of 32\n    function pbkdf2_generate_block ( offset, length, block, count, output ) {\n        offset = offset|0;\n        length = length|0;\n        block = block|0;\n        count = count|0;\n        output = output|0;\n\n        var h0 = 0, h1 = 0, h2 = 0, h3 = 0, h4 = 0, h5 = 0, h6 = 0, h7 = 0,\n            t0 = 0, t1 = 0, t2 = 0, t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0;\n\n        if ( offset & 63 )\n            return -1;\n\n        if ( ~output )\n            if ( output & 31 )\n                return -1;\n\n        // pad block number into heap\n        // FIXME probable OOB write\n        HEAP[(offset+length)|0]   = block>>>24;\n        HEAP[(offset+length+1)|0] = block>>>16&255;\n        HEAP[(offset+length+2)|0] = block>>>8&255;\n        HEAP[(offset+length+3)|0] = block&255;\n\n        // finish first iteration\n        hmac_finish( offset, (length+4)|0, -1 )|0;\n        h0 = t0 = H0, h1 = t1 = H1, h2 = t2 = H2, h3 = t3 = H3, h4 = t4 = H4, h5 = t5 = H5, h6 = t6 = H6, h7 = t7 = H7;\n        count = (count-1)|0;\n\n        // perform the rest iterations\n        while ( (count|0) > 0 ) {\n            hmac_reset();\n            _core( t0, t1, t2, t3, t4, t5, t6, t7, 0x80000000, 0, 0, 0, 0, 0, 0, 768 );\n            t0 = H0, t1 = H1, t2 = H2, t3 = H3, t4 = H4, t5 = H5, t6 = H6, t7 = H7;\n\n            _hmac_opad();\n            _core( t0, t1, t2, t3, t4, t5, t6, t7, 0x80000000, 0, 0, 0, 0, 0, 0, 768 );\n            t0 = H0, t1 = H1, t2 = H2, t3 = H3, t4 = H4, t5 = H5, t6 = H6, t7 = H7;\n\n            h0 = h0 ^ H0;\n            h1 = h1 ^ H1;\n            h2 = h2 ^ H2;\n            h3 = h3 ^ H3;\n            h4 = h4 ^ H4;\n            h5 = h5 ^ H5;\n            h6 = h6 ^ H6;\n            h7 = h7 ^ H7;\n\n            count = (count-1)|0;\n        }\n\n        H0 = h0;\n        H1 = h1;\n        H2 = h2;\n        H3 = h3;\n        H4 = h4;\n        H5 = h5;\n        H6 = h6;\n        H7 = h7;\n\n        if ( ~output )\n            _state_to_heap(output);\n\n        return 0;\n    }\n\n    return {\n      // SHA256\n      reset: reset,\n      init: init,\n      process: process,\n      finish: finish,\n\n      // HMAC-SHA256\n      hmac_reset: hmac_reset,\n      hmac_init: hmac_init,\n      hmac_finish: hmac_finish,\n\n      // PBKDF2-HMAC-SHA256\n      pbkdf2_generate_block: pbkdf2_generate_block\n    }\n}\n","module.exports = assert;\n\nfunction assert(val, msg) {\n  if (!val)\n    throw new Error(msg || 'Assertion failed');\n}\n\nassert.equal = function assertEqual(l, r, msg) {\n  if (l != r)\n    throw new Error(msg || ('Assertion failed: ' + l + ' != ' + r));\n};\n","if (typeof Object.create === 'function') {\n  // implementation from standard node.js 'util' module\n  module.exports = function inherits(ctor, superCtor) {\n    ctor.super_ = superCtor\n    ctor.prototype = Object.create(superCtor.prototype, {\n      constructor: {\n        value: ctor,\n        enumerable: false,\n        writable: true,\n        configurable: true\n      }\n    });\n  };\n} else {\n  // old school shim for old browsers\n  module.exports = function inherits(ctor, superCtor) {\n    ctor.super_ = superCtor\n    var TempCtor = function () {}\n    TempCtor.prototype = superCtor.prototype\n    ctor.prototype = new TempCtor()\n    ctor.prototype.constructor = ctor\n  }\n}\n","try {\n  var util = require('util');\n  if (typeof util.inherits !== 'function') throw '';\n  module.exports = util.inherits;\n} catch (e) {\n  module.exports = require('./inherits_browser.js');\n}\n","'use strict';\n\nvar assert = require('minimalistic-assert');\nvar inherits = require('inherits');\n\nexports.inherits = inherits;\n\nfunction toArray(msg, enc) {\n  if (Array.isArray(msg))\n    return msg.slice();\n  if (!msg)\n    return [];\n  var res = [];\n  if (typeof msg === 'string') {\n    if (!enc) {\n      for (var i = 0; i < msg.length; i++) {\n        var c = msg.charCodeAt(i);\n        var hi = c >> 8;\n        var lo = c & 0xff;\n        if (hi)\n          res.push(hi, lo);\n        else\n          res.push(lo);\n      }\n    } else if (enc === 'hex') {\n      msg = msg.replace(/[^a-z0-9]+/ig, '');\n      if (msg.length % 2 !== 0)\n        msg = '0' + msg;\n      for (i = 0; i < msg.length; i += 2)\n        res.push(parseInt(msg[i] + msg[i + 1], 16));\n    }\n  } else {\n    for (i = 0; i < msg.length; i++)\n      res[i] = msg[i] | 0;\n  }\n  return res;\n}\nexports.toArray = toArray;\n\nfunction toHex(msg) {\n  var res = '';\n  for (var i = 0; i < msg.length; i++)\n    res += zero2(msg[i].toString(16));\n  return res;\n}\nexports.toHex = toHex;\n\nfunction htonl(w) {\n  var res = (w >>> 24) |\n            ((w >>> 8) & 0xff00) |\n            ((w << 8) & 0xff0000) |\n            ((w & 0xff) << 24);\n  return res >>> 0;\n}\nexports.htonl = htonl;\n\nfunction toHex32(msg, endian) {\n  var res = '';\n  for (var i = 0; i < msg.length; i++) {\n    var w = msg[i];\n    if (endian === 'little')\n      w = htonl(w);\n    res += zero8(w.toString(16));\n  }\n  return res;\n}\nexports.toHex32 = toHex32;\n\nfunction zero2(word) {\n  if (word.length === 1)\n    return '0' + word;\n  else\n    return word;\n}\nexports.zero2 = zero2;\n\nfunction zero8(word) {\n  if (word.length === 7)\n    return '0' + word;\n  else if (word.length === 6)\n    return '00' + word;\n  else if (word.length === 5)\n    return '000' + word;\n  else if (word.length === 4)\n    return '0000' + word;\n  else if (word.length === 3)\n    return '00000' + word;\n  else if (word.length === 2)\n    return '000000' + word;\n  else if (word.length === 1)\n    return '0000000' + word;\n  else\n    return word;\n}\nexports.zero8 = zero8;\n\nfunction join32(msg, start, end, endian) {\n  var len = end - start;\n  assert(len % 4 === 0);\n  var res = new Array(len / 4);\n  for (var i = 0, k = start; i < res.length; i++, k += 4) {\n    var w;\n    if (endian === 'big')\n      w = (msg[k] << 24) | (msg[k + 1] << 16) | (msg[k + 2] << 8) | msg[k + 3];\n    else\n      w = (msg[k + 3] << 24) | (msg[k + 2] << 16) | (msg[k + 1] << 8) | msg[k];\n    res[i] = w >>> 0;\n  }\n  return res;\n}\nexports.join32 = join32;\n\nfunction split32(msg, endian) {\n  var res = new Array(msg.length * 4);\n  for (var i = 0, k = 0; i < msg.length; i++, k += 4) {\n    var m = msg[i];\n    if (endian === 'big') {\n      res[k] = m >>> 24;\n      res[k + 1] = (m >>> 16) & 0xff;\n      res[k + 2] = (m >>> 8) & 0xff;\n      res[k + 3] = m & 0xff;\n    } else {\n      res[k + 3] = m >>> 24;\n      res[k + 2] = (m >>> 16) & 0xff;\n      res[k + 1] = (m >>> 8) & 0xff;\n      res[k] = m & 0xff;\n    }\n  }\n  return res;\n}\nexports.split32 = split32;\n\nfunction rotr32(w, b) {\n  return (w >>> b) | (w << (32 - b));\n}\nexports.rotr32 = rotr32;\n\nfunction rotl32(w, b) {\n  return (w << b) | (w >>> (32 - b));\n}\nexports.rotl32 = rotl32;\n\nfunction sum32(a, b) {\n  return (a + b) >>> 0;\n}\nexports.sum32 = sum32;\n\nfunction sum32_3(a, b, c) {\n  return (a + b + c) >>> 0;\n}\nexports.sum32_3 = sum32_3;\n\nfunction sum32_4(a, b, c, d) {\n  return (a + b + c + d) >>> 0;\n}\nexports.sum32_4 = sum32_4;\n\nfunction sum32_5(a, b, c, d, e) {\n  return (a + b + c + d + e) >>> 0;\n}\nexports.sum32_5 = sum32_5;\n\nfunction sum64(buf, pos, ah, al) {\n  var bh = buf[pos];\n  var bl = buf[pos + 1];\n\n  var lo = (al + bl) >>> 0;\n  var hi = (lo < al ? 1 : 0) + ah + bh;\n  buf[pos] = hi >>> 0;\n  buf[pos + 1] = lo;\n}\nexports.sum64 = sum64;\n\nfunction sum64_hi(ah, al, bh, bl) {\n  var lo = (al + bl) >>> 0;\n  var hi = (lo < al ? 1 : 0) + ah + bh;\n  return hi >>> 0;\n}\nexports.sum64_hi = sum64_hi;\n\nfunction sum64_lo(ah, al, bh, bl) {\n  var lo = al + bl;\n  return lo >>> 0;\n}\nexports.sum64_lo = sum64_lo;\n\nfunction sum64_4_hi(ah, al, bh, bl, ch, cl, dh, dl) {\n  var carry = 0;\n  var lo = al;\n  lo = (lo + bl) >>> 0;\n  carry += lo < al ? 1 : 0;\n  lo = (lo + cl) >>> 0;\n  carry += lo < cl ? 1 : 0;\n  lo = (lo + dl) >>> 0;\n  carry += lo < dl ? 1 : 0;\n\n  var hi = ah + bh + ch + dh + carry;\n  return hi >>> 0;\n}\nexports.sum64_4_hi = sum64_4_hi;\n\nfunction sum64_4_lo(ah, al, bh, bl, ch, cl, dh, dl) {\n  var lo = al + bl + cl + dl;\n  return lo >>> 0;\n}\nexports.sum64_4_lo = sum64_4_lo;\n\nfunction sum64_5_hi(ah, al, bh, bl, ch, cl, dh, dl, eh, el) {\n  var carry = 0;\n  var lo = al;\n  lo = (lo + bl) >>> 0;\n  carry += lo < al ? 1 : 0;\n  lo = (lo + cl) >>> 0;\n  carry += lo < cl ? 1 : 0;\n  lo = (lo + dl) >>> 0;\n  carry += lo < dl ? 1 : 0;\n  lo = (lo + el) >>> 0;\n  carry += lo < el ? 1 : 0;\n\n  var hi = ah + bh + ch + dh + eh + carry;\n  return hi >>> 0;\n}\nexports.sum64_5_hi = sum64_5_hi;\n\nfunction sum64_5_lo(ah, al, bh, bl, ch, cl, dh, dl, eh, el) {\n  var lo = al + bl + cl + dl + el;\n\n  return lo >>> 0;\n}\nexports.sum64_5_lo = sum64_5_lo;\n\nfunction rotr64_hi(ah, al, num) {\n  var r = (al << (32 - num)) | (ah >>> num);\n  return r >>> 0;\n}\nexports.rotr64_hi = rotr64_hi;\n\nfunction rotr64_lo(ah, al, num) {\n  var r = (ah << (32 - num)) | (al >>> num);\n  return r >>> 0;\n}\nexports.rotr64_lo = rotr64_lo;\n\nfunction shr64_hi(ah, al, num) {\n  return ah >>> num;\n}\nexports.shr64_hi = shr64_hi;\n\nfunction shr64_lo(ah, al, num) {\n  var r = (ah << (32 - num)) | (al >>> num);\n  return r >>> 0;\n}\nexports.shr64_lo = shr64_lo;\n","'use strict';\n\nvar utils = require('./utils');\nvar assert = require('minimalistic-assert');\n\nfunction BlockHash() {\n  this.pending = null;\n  this.pendingTotal = 0;\n  this.blockSize = this.constructor.blockSize;\n  this.outSize = this.constructor.outSize;\n  this.hmacStrength = this.constructor.hmacStrength;\n  this.padLength = this.constructor.padLength / 8;\n  this.endian = 'big';\n\n  this._delta8 = this.blockSize / 8;\n  this._delta32 = this.blockSize / 32;\n}\nexports.BlockHash = BlockHash;\n\nBlockHash.prototype.update = function update(msg, enc) {\n  // Convert message to array, pad it, and join into 32bit blocks\n  msg = utils.toArray(msg, enc);\n  if (!this.pending)\n    this.pending = msg;\n  else\n    this.pending = this.pending.concat(msg);\n  this.pendingTotal += msg.length;\n\n  // Enough data, try updating\n  if (this.pending.length >= this._delta8) {\n    msg = this.pending;\n\n    // Process pending data in blocks\n    var r = msg.length % this._delta8;\n    this.pending = msg.slice(msg.length - r, msg.length);\n    if (this.pending.length === 0)\n      this.pending = null;\n\n    msg = utils.join32(msg, 0, msg.length - r, this.endian);\n    for (var i = 0; i < msg.length; i += this._delta32)\n      this._update(msg, i, i + this._delta32);\n  }\n\n  return this;\n};\n\nBlockHash.prototype.digest = function digest(enc) {\n  this.update(this._pad());\n  assert(this.pending === null);\n\n  return this._digest(enc);\n};\n\nBlockHash.prototype._pad = function pad() {\n  var len = this.pendingTotal;\n  var bytes = this._delta8;\n  var k = bytes - ((len + this.padLength) % bytes);\n  var res = new Array(k + this.padLength);\n  res[0] = 0x80;\n  for (var i = 1; i < k; i++)\n    res[i] = 0;\n\n  // Append length\n  len <<= 3;\n  if (this.endian === 'big') {\n    for (var t = 8; t < this.padLength; t++)\n      res[i++] = 0;\n\n    res[i++] = 0;\n    res[i++] = 0;\n    res[i++] = 0;\n    res[i++] = 0;\n    res[i++] = (len >>> 24) & 0xff;\n    res[i++] = (len >>> 16) & 0xff;\n    res[i++] = (len >>> 8) & 0xff;\n    res[i++] = len & 0xff;\n  } else {\n    res[i++] = len & 0xff;\n    res[i++] = (len >>> 8) & 0xff;\n    res[i++] = (len >>> 16) & 0xff;\n    res[i++] = (len >>> 24) & 0xff;\n    res[i++] = 0;\n    res[i++] = 0;\n    res[i++] = 0;\n    res[i++] = 0;\n\n    for (t = 8; t < this.padLength; t++)\n      res[i++] = 0;\n  }\n\n  return res;\n};\n","'use strict';\n\nvar utils = require('../utils');\nvar rotr32 = utils.rotr32;\n\nfunction ft_1(s, x, y, z) {\n  if (s === 0)\n    return ch32(x, y, z);\n  if (s === 1 || s === 3)\n    return p32(x, y, z);\n  if (s === 2)\n    return maj32(x, y, z);\n}\nexports.ft_1 = ft_1;\n\nfunction ch32(x, y, z) {\n  return (x & y) ^ ((~x) & z);\n}\nexports.ch32 = ch32;\n\nfunction maj32(x, y, z) {\n  return (x & y) ^ (x & z) ^ (y & z);\n}\nexports.maj32 = maj32;\n\nfunction p32(x, y, z) {\n  return x ^ y ^ z;\n}\nexports.p32 = p32;\n\nfunction s0_256(x) {\n  return rotr32(x, 2) ^ rotr32(x, 13) ^ rotr32(x, 22);\n}\nexports.s0_256 = s0_256;\n\nfunction s1_256(x) {\n  return rotr32(x, 6) ^ rotr32(x, 11) ^ rotr32(x, 25);\n}\nexports.s1_256 = s1_256;\n\nfunction g0_256(x) {\n  return rotr32(x, 7) ^ rotr32(x, 18) ^ (x >>> 3);\n}\nexports.g0_256 = g0_256;\n\nfunction g1_256(x) {\n  return rotr32(x, 17) ^ rotr32(x, 19) ^ (x >>> 10);\n}\nexports.g1_256 = g1_256;\n","'use strict';\n\nvar utils = require('../utils');\nvar common = require('../common');\nvar shaCommon = require('./common');\nvar assert = require('minimalistic-assert');\n\nvar sum32 = utils.sum32;\nvar sum32_4 = utils.sum32_4;\nvar sum32_5 = utils.sum32_5;\nvar ch32 = shaCommon.ch32;\nvar maj32 = shaCommon.maj32;\nvar s0_256 = shaCommon.s0_256;\nvar s1_256 = shaCommon.s1_256;\nvar g0_256 = shaCommon.g0_256;\nvar g1_256 = shaCommon.g1_256;\n\nvar BlockHash = common.BlockHash;\n\nvar sha256_K = [\n  0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5,\n  0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,\n  0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3,\n  0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,\n  0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc,\n  0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,\n  0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7,\n  0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,\n  0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13,\n  0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,\n  0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3,\n  0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,\n  0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5,\n  0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,\n  0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208,\n  0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2\n];\n\nfunction SHA256() {\n  if (!(this instanceof SHA256))\n    return new SHA256();\n\n  BlockHash.call(this);\n  this.h = [\n    0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a,\n    0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19\n  ];\n  this.k = sha256_K;\n  this.W = new Array(64);\n}\nutils.inherits(SHA256, BlockHash);\nmodule.exports = SHA256;\n\nSHA256.blockSize = 512;\nSHA256.outSize = 256;\nSHA256.hmacStrength = 192;\nSHA256.padLength = 64;\n\nSHA256.prototype._update = function _update(msg, start) {\n  var W = this.W;\n\n  for (var i = 0; i < 16; i++)\n    W[i] = msg[start + i];\n  for (; i < W.length; i++)\n    W[i] = sum32_4(g1_256(W[i - 2]), W[i - 7], g0_256(W[i - 15]), W[i - 16]);\n\n  var a = this.h[0];\n  var b = this.h[1];\n  var c = this.h[2];\n  var d = this.h[3];\n  var e = this.h[4];\n  var f = this.h[5];\n  var g = this.h[6];\n  var h = this.h[7];\n\n  assert(this.k.length === W.length);\n  for (i = 0; i < W.length; i++) {\n    var T1 = sum32_5(h, s1_256(e), ch32(e, f, g), this.k[i], W[i]);\n    var T2 = sum32(s0_256(a), maj32(a, b, c));\n    h = g;\n    g = f;\n    f = e;\n    e = sum32(d, T1);\n    d = c;\n    c = b;\n    b = a;\n    a = sum32(T1, T2);\n  }\n\n  this.h[0] = sum32(this.h[0], a);\n  this.h[1] = sum32(this.h[1], b);\n  this.h[2] = sum32(this.h[2], c);\n  this.h[3] = sum32(this.h[3], d);\n  this.h[4] = sum32(this.h[4], e);\n  this.h[5] = sum32(this.h[5], f);\n  this.h[6] = sum32(this.h[6], g);\n  this.h[7] = sum32(this.h[7], h);\n};\n\nSHA256.prototype._digest = function digest(enc) {\n  if (enc === 'hex')\n    return utils.toHex32(this.h, 'big');\n  else\n    return utils.split32(this.h, 'big');\n};\n","'use strict';\n\nvar utils = require('../utils');\nvar SHA256 = require('./256');\n\nfunction SHA224() {\n  if (!(this instanceof SHA224))\n    return new SHA224();\n\n  SHA256.call(this);\n  this.h = [\n    0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939,\n    0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4 ];\n}\nutils.inherits(SHA224, SHA256);\nmodule.exports = SHA224;\n\nSHA224.blockSize = 512;\nSHA224.outSize = 224;\nSHA224.hmacStrength = 192;\nSHA224.padLength = 64;\n\nSHA224.prototype._digest = function digest(enc) {\n  // Just truncate output\n  if (enc === 'hex')\n    return utils.toHex32(this.h.slice(0, 7), 'big');\n  else\n    return utils.split32(this.h.slice(0, 7), 'big');\n};\n\n","'use strict';\n\nvar utils = require('../utils');\nvar common = require('../common');\nvar assert = require('minimalistic-assert');\n\nvar rotr64_hi = utils.rotr64_hi;\nvar rotr64_lo = utils.rotr64_lo;\nvar shr64_hi = utils.shr64_hi;\nvar shr64_lo = utils.shr64_lo;\nvar sum64 = utils.sum64;\nvar sum64_hi = utils.sum64_hi;\nvar sum64_lo = utils.sum64_lo;\nvar sum64_4_hi = utils.sum64_4_hi;\nvar sum64_4_lo = utils.sum64_4_lo;\nvar sum64_5_hi = utils.sum64_5_hi;\nvar sum64_5_lo = utils.sum64_5_lo;\n\nvar BlockHash = common.BlockHash;\n\nvar sha512_K = [\n  0x428a2f98, 0xd728ae22, 0x71374491, 0x23ef65cd,\n  0xb5c0fbcf, 0xec4d3b2f, 0xe9b5dba5, 0x8189dbbc,\n  0x3956c25b, 0xf348b538, 0x59f111f1, 0xb605d019,\n  0x923f82a4, 0xaf194f9b, 0xab1c5ed5, 0xda6d8118,\n  0xd807aa98, 0xa3030242, 0x12835b01, 0x45706fbe,\n  0x243185be, 0x4ee4b28c, 0x550c7dc3, 0xd5ffb4e2,\n  0x72be5d74, 0xf27b896f, 0x80deb1fe, 0x3b1696b1,\n  0x9bdc06a7, 0x25c71235, 0xc19bf174, 0xcf692694,\n  0xe49b69c1, 0x9ef14ad2, 0xefbe4786, 0x384f25e3,\n  0x0fc19dc6, 0x8b8cd5b5, 0x240ca1cc, 0x77ac9c65,\n  0x2de92c6f, 0x592b0275, 0x4a7484aa, 0x6ea6e483,\n  0x5cb0a9dc, 0xbd41fbd4, 0x76f988da, 0x831153b5,\n  0x983e5152, 0xee66dfab, 0xa831c66d, 0x2db43210,\n  0xb00327c8, 0x98fb213f, 0xbf597fc7, 0xbeef0ee4,\n  0xc6e00bf3, 0x3da88fc2, 0xd5a79147, 0x930aa725,\n  0x06ca6351, 0xe003826f, 0x14292967, 0x0a0e6e70,\n  0x27b70a85, 0x46d22ffc, 0x2e1b2138, 0x5c26c926,\n  0x4d2c6dfc, 0x5ac42aed, 0x53380d13, 0x9d95b3df,\n  0x650a7354, 0x8baf63de, 0x766a0abb, 0x3c77b2a8,\n  0x81c2c92e, 0x47edaee6, 0x92722c85, 0x1482353b,\n  0xa2bfe8a1, 0x4cf10364, 0xa81a664b, 0xbc423001,\n  0xc24b8b70, 0xd0f89791, 0xc76c51a3, 0x0654be30,\n  0xd192e819, 0xd6ef5218, 0xd6990624, 0x5565a910,\n  0xf40e3585, 0x5771202a, 0x106aa070, 0x32bbd1b8,\n  0x19a4c116, 0xb8d2d0c8, 0x1e376c08, 0x5141ab53,\n  0x2748774c, 0xdf8eeb99, 0x34b0bcb5, 0xe19b48a8,\n  0x391c0cb3, 0xc5c95a63, 0x4ed8aa4a, 0xe3418acb,\n  0x5b9cca4f, 0x7763e373, 0x682e6ff3, 0xd6b2b8a3,\n  0x748f82ee, 0x5defb2fc, 0x78a5636f, 0x43172f60,\n  0x84c87814, 0xa1f0ab72, 0x8cc70208, 0x1a6439ec,\n  0x90befffa, 0x23631e28, 0xa4506ceb, 0xde82bde9,\n  0xbef9a3f7, 0xb2c67915, 0xc67178f2, 0xe372532b,\n  0xca273ece, 0xea26619c, 0xd186b8c7, 0x21c0c207,\n  0xeada7dd6, 0xcde0eb1e, 0xf57d4f7f, 0xee6ed178,\n  0x06f067aa, 0x72176fba, 0x0a637dc5, 0xa2c898a6,\n  0x113f9804, 0xbef90dae, 0x1b710b35, 0x131c471b,\n  0x28db77f5, 0x23047d84, 0x32caab7b, 0x40c72493,\n  0x3c9ebe0a, 0x15c9bebc, 0x431d67c4, 0x9c100d4c,\n  0x4cc5d4be, 0xcb3e42b6, 0x597f299c, 0xfc657e2a,\n  0x5fcb6fab, 0x3ad6faec, 0x6c44198c, 0x4a475817\n];\n\nfunction SHA512() {\n  if (!(this instanceof SHA512))\n    return new SHA512();\n\n  BlockHash.call(this);\n  this.h = [\n    0x6a09e667, 0xf3bcc908,\n    0xbb67ae85, 0x84caa73b,\n    0x3c6ef372, 0xfe94f82b,\n    0xa54ff53a, 0x5f1d36f1,\n    0x510e527f, 0xade682d1,\n    0x9b05688c, 0x2b3e6c1f,\n    0x1f83d9ab, 0xfb41bd6b,\n    0x5be0cd19, 0x137e2179 ];\n  this.k = sha512_K;\n  this.W = new Array(160);\n}\nutils.inherits(SHA512, BlockHash);\nmodule.exports = SHA512;\n\nSHA512.blockSize = 1024;\nSHA512.outSize = 512;\nSHA512.hmacStrength = 192;\nSHA512.padLength = 128;\n\nSHA512.prototype._prepareBlock = function _prepareBlock(msg, start) {\n  var W = this.W;\n\n  // 32 x 32bit words\n  for (var i = 0; i < 32; i++)\n    W[i] = msg[start + i];\n  for (; i < W.length; i += 2) {\n    var c0_hi = g1_512_hi(W[i - 4], W[i - 3]);  // i - 2\n    var c0_lo = g1_512_lo(W[i - 4], W[i - 3]);\n    var c1_hi = W[i - 14];  // i - 7\n    var c1_lo = W[i - 13];\n    var c2_hi = g0_512_hi(W[i - 30], W[i - 29]);  // i - 15\n    var c2_lo = g0_512_lo(W[i - 30], W[i - 29]);\n    var c3_hi = W[i - 32];  // i - 16\n    var c3_lo = W[i - 31];\n\n    W[i] = sum64_4_hi(\n      c0_hi, c0_lo,\n      c1_hi, c1_lo,\n      c2_hi, c2_lo,\n      c3_hi, c3_lo);\n    W[i + 1] = sum64_4_lo(\n      c0_hi, c0_lo,\n      c1_hi, c1_lo,\n      c2_hi, c2_lo,\n      c3_hi, c3_lo);\n  }\n};\n\nSHA512.prototype._update = function _update(msg, start) {\n  this._prepareBlock(msg, start);\n\n  var W = this.W;\n\n  var ah = this.h[0];\n  var al = this.h[1];\n  var bh = this.h[2];\n  var bl = this.h[3];\n  var ch = this.h[4];\n  var cl = this.h[5];\n  var dh = this.h[6];\n  var dl = this.h[7];\n  var eh = this.h[8];\n  var el = this.h[9];\n  var fh = this.h[10];\n  var fl = this.h[11];\n  var gh = this.h[12];\n  var gl = this.h[13];\n  var hh = this.h[14];\n  var hl = this.h[15];\n\n  assert(this.k.length === W.length);\n  for (var i = 0; i < W.length; i += 2) {\n    var c0_hi = hh;\n    var c0_lo = hl;\n    var c1_hi = s1_512_hi(eh, el);\n    var c1_lo = s1_512_lo(eh, el);\n    var c2_hi = ch64_hi(eh, el, fh, fl, gh, gl);\n    var c2_lo = ch64_lo(eh, el, fh, fl, gh, gl);\n    var c3_hi = this.k[i];\n    var c3_lo = this.k[i + 1];\n    var c4_hi = W[i];\n    var c4_lo = W[i + 1];\n\n    var T1_hi = sum64_5_hi(\n      c0_hi, c0_lo,\n      c1_hi, c1_lo,\n      c2_hi, c2_lo,\n      c3_hi, c3_lo,\n      c4_hi, c4_lo);\n    var T1_lo = sum64_5_lo(\n      c0_hi, c0_lo,\n      c1_hi, c1_lo,\n      c2_hi, c2_lo,\n      c3_hi, c3_lo,\n      c4_hi, c4_lo);\n\n    c0_hi = s0_512_hi(ah, al);\n    c0_lo = s0_512_lo(ah, al);\n    c1_hi = maj64_hi(ah, al, bh, bl, ch, cl);\n    c1_lo = maj64_lo(ah, al, bh, bl, ch, cl);\n\n    var T2_hi = sum64_hi(c0_hi, c0_lo, c1_hi, c1_lo);\n    var T2_lo = sum64_lo(c0_hi, c0_lo, c1_hi, c1_lo);\n\n    hh = gh;\n    hl = gl;\n\n    gh = fh;\n    gl = fl;\n\n    fh = eh;\n    fl = el;\n\n    eh = sum64_hi(dh, dl, T1_hi, T1_lo);\n    el = sum64_lo(dl, dl, T1_hi, T1_lo);\n\n    dh = ch;\n    dl = cl;\n\n    ch = bh;\n    cl = bl;\n\n    bh = ah;\n    bl = al;\n\n    ah = sum64_hi(T1_hi, T1_lo, T2_hi, T2_lo);\n    al = sum64_lo(T1_hi, T1_lo, T2_hi, T2_lo);\n  }\n\n  sum64(this.h, 0, ah, al);\n  sum64(this.h, 2, bh, bl);\n  sum64(this.h, 4, ch, cl);\n  sum64(this.h, 6, dh, dl);\n  sum64(this.h, 8, eh, el);\n  sum64(this.h, 10, fh, fl);\n  sum64(this.h, 12, gh, gl);\n  sum64(this.h, 14, hh, hl);\n};\n\nSHA512.prototype._digest = function digest(enc) {\n  if (enc === 'hex')\n    return utils.toHex32(this.h, 'big');\n  else\n    return utils.split32(this.h, 'big');\n};\n\nfunction ch64_hi(xh, xl, yh, yl, zh) {\n  var r = (xh & yh) ^ ((~xh) & zh);\n  if (r < 0)\n    r += 0x100000000;\n  return r;\n}\n\nfunction ch64_lo(xh, xl, yh, yl, zh, zl) {\n  var r = (xl & yl) ^ ((~xl) & zl);\n  if (r < 0)\n    r += 0x100000000;\n  return r;\n}\n\nfunction maj64_hi(xh, xl, yh, yl, zh) {\n  var r = (xh & yh) ^ (xh & zh) ^ (yh & zh);\n  if (r < 0)\n    r += 0x100000000;\n  return r;\n}\n\nfunction maj64_lo(xh, xl, yh, yl, zh, zl) {\n  var r = (xl & yl) ^ (xl & zl) ^ (yl & zl);\n  if (r < 0)\n    r += 0x100000000;\n  return r;\n}\n\nfunction s0_512_hi(xh, xl) {\n  var c0_hi = rotr64_hi(xh, xl, 28);\n  var c1_hi = rotr64_hi(xl, xh, 2);  // 34\n  var c2_hi = rotr64_hi(xl, xh, 7);  // 39\n\n  var r = c0_hi ^ c1_hi ^ c2_hi;\n  if (r < 0)\n    r += 0x100000000;\n  return r;\n}\n\nfunction s0_512_lo(xh, xl) {\n  var c0_lo = rotr64_lo(xh, xl, 28);\n  var c1_lo = rotr64_lo(xl, xh, 2);  // 34\n  var c2_lo = rotr64_lo(xl, xh, 7);  // 39\n\n  var r = c0_lo ^ c1_lo ^ c2_lo;\n  if (r < 0)\n    r += 0x100000000;\n  return r;\n}\n\nfunction s1_512_hi(xh, xl) {\n  var c0_hi = rotr64_hi(xh, xl, 14);\n  var c1_hi = rotr64_hi(xh, xl, 18);\n  var c2_hi = rotr64_hi(xl, xh, 9);  // 41\n\n  var r = c0_hi ^ c1_hi ^ c2_hi;\n  if (r < 0)\n    r += 0x100000000;\n  return r;\n}\n\nfunction s1_512_lo(xh, xl) {\n  var c0_lo = rotr64_lo(xh, xl, 14);\n  var c1_lo = rotr64_lo(xh, xl, 18);\n  var c2_lo = rotr64_lo(xl, xh, 9);  // 41\n\n  var r = c0_lo ^ c1_lo ^ c2_lo;\n  if (r < 0)\n    r += 0x100000000;\n  return r;\n}\n\nfunction g0_512_hi(xh, xl) {\n  var c0_hi = rotr64_hi(xh, xl, 1);\n  var c1_hi = rotr64_hi(xh, xl, 8);\n  var c2_hi = shr64_hi(xh, xl, 7);\n\n  var r = c0_hi ^ c1_hi ^ c2_hi;\n  if (r < 0)\n    r += 0x100000000;\n  return r;\n}\n\nfunction g0_512_lo(xh, xl) {\n  var c0_lo = rotr64_lo(xh, xl, 1);\n  var c1_lo = rotr64_lo(xh, xl, 8);\n  var c2_lo = shr64_lo(xh, xl, 7);\n\n  var r = c0_lo ^ c1_lo ^ c2_lo;\n  if (r < 0)\n    r += 0x100000000;\n  return r;\n}\n\nfunction g1_512_hi(xh, xl) {\n  var c0_hi = rotr64_hi(xh, xl, 19);\n  var c1_hi = rotr64_hi(xl, xh, 29);  // 61\n  var c2_hi = shr64_hi(xh, xl, 6);\n\n  var r = c0_hi ^ c1_hi ^ c2_hi;\n  if (r < 0)\n    r += 0x100000000;\n  return r;\n}\n\nfunction g1_512_lo(xh, xl) {\n  var c0_lo = rotr64_lo(xh, xl, 19);\n  var c1_lo = rotr64_lo(xl, xh, 29);  // 61\n  var c2_lo = shr64_lo(xh, xl, 6);\n\n  var r = c0_lo ^ c1_lo ^ c2_lo;\n  if (r < 0)\n    r += 0x100000000;\n  return r;\n}\n","'use strict';\n\nvar utils = require('../utils');\n\nvar SHA512 = require('./512');\n\nfunction SHA384() {\n  if (!(this instanceof SHA384))\n    return new SHA384();\n\n  SHA512.call(this);\n  this.h = [\n    0xcbbb9d5d, 0xc1059ed8,\n    0x629a292a, 0x367cd507,\n    0x9159015a, 0x3070dd17,\n    0x152fecd8, 0xf70e5939,\n    0x67332667, 0xffc00b31,\n    0x8eb44a87, 0x68581511,\n    0xdb0c2e0d, 0x64f98fa7,\n    0x47b5481d, 0xbefa4fa4 ];\n}\nutils.inherits(SHA384, SHA512);\nmodule.exports = SHA384;\n\nSHA384.blockSize = 1024;\nSHA384.outSize = 384;\nSHA384.hmacStrength = 192;\nSHA384.padLength = 128;\n\nSHA384.prototype._digest = function digest(enc) {\n  if (enc === 'hex')\n    return utils.toHex32(this.h.slice(0, 12), 'big');\n  else\n    return utils.split32(this.h.slice(0, 12), 'big');\n};\n","'use strict';\n\nvar utils = require('./utils');\nvar common = require('./common');\n\nvar rotl32 = utils.rotl32;\nvar sum32 = utils.sum32;\nvar sum32_3 = utils.sum32_3;\nvar sum32_4 = utils.sum32_4;\nvar BlockHash = common.BlockHash;\n\nfunction RIPEMD160() {\n  if (!(this instanceof RIPEMD160))\n    return new RIPEMD160();\n\n  BlockHash.call(this);\n\n  this.h = [ 0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0 ];\n  this.endian = 'little';\n}\nutils.inherits(RIPEMD160, BlockHash);\nexports.ripemd160 = RIPEMD160;\n\nRIPEMD160.blockSize = 512;\nRIPEMD160.outSize = 160;\nRIPEMD160.hmacStrength = 192;\nRIPEMD160.padLength = 64;\n\nRIPEMD160.prototype._update = function update(msg, start) {\n  var A = this.h[0];\n  var B = this.h[1];\n  var C = this.h[2];\n  var D = this.h[3];\n  var E = this.h[4];\n  var Ah = A;\n  var Bh = B;\n  var Ch = C;\n  var Dh = D;\n  var Eh = E;\n  for (var j = 0; j < 80; j++) {\n    var T = sum32(\n      rotl32(\n        sum32_4(A, f(j, B, C, D), msg[r[j] + start], K(j)),\n        s[j]),\n      E);\n    A = E;\n    E = D;\n    D = rotl32(C, 10);\n    C = B;\n    B = T;\n    T = sum32(\n      rotl32(\n        sum32_4(Ah, f(79 - j, Bh, Ch, Dh), msg[rh[j] + start], Kh(j)),\n        sh[j]),\n      Eh);\n    Ah = Eh;\n    Eh = Dh;\n    Dh = rotl32(Ch, 10);\n    Ch = Bh;\n    Bh = T;\n  }\n  T = sum32_3(this.h[1], C, Dh);\n  this.h[1] = sum32_3(this.h[2], D, Eh);\n  this.h[2] = sum32_3(this.h[3], E, Ah);\n  this.h[3] = sum32_3(this.h[4], A, Bh);\n  this.h[4] = sum32_3(this.h[0], B, Ch);\n  this.h[0] = T;\n};\n\nRIPEMD160.prototype._digest = function digest(enc) {\n  if (enc === 'hex')\n    return utils.toHex32(this.h, 'little');\n  else\n    return utils.split32(this.h, 'little');\n};\n\nfunction f(j, x, y, z) {\n  if (j <= 15)\n    return x ^ y ^ z;\n  else if (j <= 31)\n    return (x & y) | ((~x) & z);\n  else if (j <= 47)\n    return (x | (~y)) ^ z;\n  else if (j <= 63)\n    return (x & z) | (y & (~z));\n  else\n    return x ^ (y | (~z));\n}\n\nfunction K(j) {\n  if (j <= 15)\n    return 0x00000000;\n  else if (j <= 31)\n    return 0x5a827999;\n  else if (j <= 47)\n    return 0x6ed9eba1;\n  else if (j <= 63)\n    return 0x8f1bbcdc;\n  else\n    return 0xa953fd4e;\n}\n\nfunction Kh(j) {\n  if (j <= 15)\n    return 0x50a28be6;\n  else if (j <= 31)\n    return 0x5c4dd124;\n  else if (j <= 47)\n    return 0x6d703ef3;\n  else if (j <= 63)\n    return 0x7a6d76e9;\n  else\n    return 0x00000000;\n}\n\nvar r = [\n  0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,\n  7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8,\n  3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12,\n  1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2,\n  4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13\n];\n\nvar rh = [\n  5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12,\n  6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2,\n  15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13,\n  8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14,\n  12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11\n];\n\nvar s = [\n  11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8,\n  7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12,\n  11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5,\n  11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12,\n  9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6\n];\n\nvar sh = [\n  8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6,\n  9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11,\n  9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5,\n  15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8,\n  8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11\n];\n","/**\n * A fast MD5 JavaScript implementation\n * Copyright (c) 2012 Joseph Myers\n * http://www.myersdaily.org/joseph/javascript/md5-text.html\n *\n * Permission to use, copy, modify, and distribute this software\n * and its documentation for any purposes and without\n * fee is hereby granted provided that this copyright notice\n * appears in all copies.\n *\n * Of course, this soft is provided \"as is\" without express or implied\n * warranty of any kind.\n */\n\nimport util from '../../util';\n\n// MD5 Digest\nasync function md5(entree) {\n  const digest = md51(util.uint8ArrayToString(entree));\n  return util.hexToUint8Array(hex(digest));\n}\n\nfunction md5cycle(x, k) {\n  let a = x[0];\n  let b = x[1];\n  let c = x[2];\n  let d = x[3];\n\n  a = ff(a, b, c, d, k[0], 7, -680876936);\n  d = ff(d, a, b, c, k[1], 12, -389564586);\n  c = ff(c, d, a, b, k[2], 17, 606105819);\n  b = ff(b, c, d, a, k[3], 22, -1044525330);\n  a = ff(a, b, c, d, k[4], 7, -176418897);\n  d = ff(d, a, b, c, k[5], 12, 1200080426);\n  c = ff(c, d, a, b, k[6], 17, -1473231341);\n  b = ff(b, c, d, a, k[7], 22, -45705983);\n  a = ff(a, b, c, d, k[8], 7, 1770035416);\n  d = ff(d, a, b, c, k[9], 12, -1958414417);\n  c = ff(c, d, a, b, k[10], 17, -42063);\n  b = ff(b, c, d, a, k[11], 22, -1990404162);\n  a = ff(a, b, c, d, k[12], 7, 1804603682);\n  d = ff(d, a, b, c, k[13], 12, -40341101);\n  c = ff(c, d, a, b, k[14], 17, -1502002290);\n  b = ff(b, c, d, a, k[15], 22, 1236535329);\n\n  a = gg(a, b, c, d, k[1], 5, -165796510);\n  d = gg(d, a, b, c, k[6], 9, -1069501632);\n  c = gg(c, d, a, b, k[11], 14, 643717713);\n  b = gg(b, c, d, a, k[0], 20, -373897302);\n  a = gg(a, b, c, d, k[5], 5, -701558691);\n  d = gg(d, a, b, c, k[10], 9, 38016083);\n  c = gg(c, d, a, b, k[15], 14, -660478335);\n  b = gg(b, c, d, a, k[4], 20, -405537848);\n  a = gg(a, b, c, d, k[9], 5, 568446438);\n  d = gg(d, a, b, c, k[14], 9, -1019803690);\n  c = gg(c, d, a, b, k[3], 14, -187363961);\n  b = gg(b, c, d, a, k[8], 20, 1163531501);\n  a = gg(a, b, c, d, k[13], 5, -1444681467);\n  d = gg(d, a, b, c, k[2], 9, -51403784);\n  c = gg(c, d, a, b, k[7], 14, 1735328473);\n  b = gg(b, c, d, a, k[12], 20, -1926607734);\n\n  a = hh(a, b, c, d, k[5], 4, -378558);\n  d = hh(d, a, b, c, k[8], 11, -2022574463);\n  c = hh(c, d, a, b, k[11], 16, 1839030562);\n  b = hh(b, c, d, a, k[14], 23, -35309556);\n  a = hh(a, b, c, d, k[1], 4, -1530992060);\n  d = hh(d, a, b, c, k[4], 11, 1272893353);\n  c = hh(c, d, a, b, k[7], 16, -155497632);\n  b = hh(b, c, d, a, k[10], 23, -1094730640);\n  a = hh(a, b, c, d, k[13], 4, 681279174);\n  d = hh(d, a, b, c, k[0], 11, -358537222);\n  c = hh(c, d, a, b, k[3], 16, -722521979);\n  b = hh(b, c, d, a, k[6], 23, 76029189);\n  a = hh(a, b, c, d, k[9], 4, -640364487);\n  d = hh(d, a, b, c, k[12], 11, -421815835);\n  c = hh(c, d, a, b, k[15], 16, 530742520);\n  b = hh(b, c, d, a, k[2], 23, -995338651);\n\n  a = ii(a, b, c, d, k[0], 6, -198630844);\n  d = ii(d, a, b, c, k[7], 10, 1126891415);\n  c = ii(c, d, a, b, k[14], 15, -1416354905);\n  b = ii(b, c, d, a, k[5], 21, -57434055);\n  a = ii(a, b, c, d, k[12], 6, 1700485571);\n  d = ii(d, a, b, c, k[3], 10, -1894986606);\n  c = ii(c, d, a, b, k[10], 15, -1051523);\n  b = ii(b, c, d, a, k[1], 21, -2054922799);\n  a = ii(a, b, c, d, k[8], 6, 1873313359);\n  d = ii(d, a, b, c, k[15], 10, -30611744);\n  c = ii(c, d, a, b, k[6], 15, -1560198380);\n  b = ii(b, c, d, a, k[13], 21, 1309151649);\n  a = ii(a, b, c, d, k[4], 6, -145523070);\n  d = ii(d, a, b, c, k[11], 10, -1120210379);\n  c = ii(c, d, a, b, k[2], 15, 718787259);\n  b = ii(b, c, d, a, k[9], 21, -343485551);\n\n  x[0] = add32(a, x[0]);\n  x[1] = add32(b, x[1]);\n  x[2] = add32(c, x[2]);\n  x[3] = add32(d, x[3]);\n}\n\nfunction cmn(q, a, b, x, s, t) {\n  a = add32(add32(a, q), add32(x, t));\n  return add32((a << s) | (a >>> (32 - s)), b);\n}\n\nfunction ff(a, b, c, d, x, s, t) {\n  return cmn((b & c) | ((~b) & d), a, b, x, s, t);\n}\n\nfunction gg(a, b, c, d, x, s, t) {\n  return cmn((b & d) | (c & (~d)), a, b, x, s, t);\n}\n\nfunction hh(a, b, c, d, x, s, t) {\n  return cmn(b ^ c ^ d, a, b, x, s, t);\n}\n\nfunction ii(a, b, c, d, x, s, t) {\n  return cmn(c ^ (b | (~d)), a, b, x, s, t);\n}\n\nfunction md51(s) {\n  const n = s.length;\n  const state = [1732584193, -271733879, -1732584194, 271733878];\n  let i;\n  for (i = 64; i <= s.length; i += 64) {\n    md5cycle(state, md5blk(s.substring(i - 64, i)));\n  }\n  s = s.substring(i - 64);\n  const tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];\n  for (i = 0; i < s.length; i++) {\n    tail[i >> 2] |= s.charCodeAt(i) << ((i % 4) << 3);\n  }\n  tail[i >> 2] |= 0x80 << ((i % 4) << 3);\n  if (i > 55) {\n    md5cycle(state, tail);\n    for (i = 0; i < 16; i++) {\n      tail[i] = 0;\n    }\n  }\n  tail[14] = n * 8;\n  md5cycle(state, tail);\n  return state;\n}\n\n/* there needs to be support for Unicode here,\n * unless we pretend that we can redefine the MD-5\n * algorithm for multi-byte characters (perhaps\n * by adding every four 16-bit characters and\n * shortening the sum to 32 bits). Otherwise\n * I suggest performing MD-5 as if every character\n * was two bytes--e.g., 0040 0025 = @%--but then\n * how will an ordinary MD-5 sum be matched?\n * There is no way to standardize text to something\n * like UTF-8 before transformation; speed cost is\n * utterly prohibitive. The JavaScript standard\n * itself needs to look at this: it should start\n * providing access to strings as preformed UTF-8\n * 8-bit unsigned value arrays.\n */\nfunction md5blk(s) { /* I figured global was faster.   */\n  const md5blks = [];\n  let i; /* Andy King said do it this way. */\n  for (i = 0; i < 64; i += 4) {\n    md5blks[i >> 2] = s.charCodeAt(i) + (s.charCodeAt(i + 1) << 8) + (s.charCodeAt(i + 2) << 16) + (s.charCodeAt(i + 3) <<\n      24);\n  }\n  return md5blks;\n}\n\nconst hex_chr = '0123456789abcdef'.split('');\n\nfunction rhex(n) {\n  let s = '';\n  let j = 0;\n  for (; j < 4; j++) {\n    s += hex_chr[(n >> (j * 8 + 4)) & 0x0F] + hex_chr[(n >> (j * 8)) & 0x0F];\n  }\n  return s;\n}\n\nfunction hex(x) {\n  for (let i = 0; i < x.length; i++) {\n    x[i] = rhex(x[i]);\n  }\n  return x.join('');\n}\n\n/* this function is much faster,\nso if possible we use it. Some IEs\nare the only ones I know of that\nneed the idiotic second function,\ngenerated by an if clause.  */\n\nfunction add32(a, b) {\n  return (a + b) & 0xFFFFFFFF;\n}\n\nexport default md5;\n","/**\n * @fileoverview Provides an interface to hashing functions available in Node.js or external libraries.\n * @see {@link https://github.com/asmcrypto/asmcrypto.js|asmCrypto}\n * @see {@link https://github.com/indutny/hash.js|hash.js}\n * @module crypto/hash\n * @private\n */\n\nimport { Sha1 } from '@openpgp/asmcrypto.js/dist_es8/hash/sha1/sha1';\nimport { Sha256 } from '@openpgp/asmcrypto.js/dist_es8/hash/sha256/sha256';\nimport sha224 from 'hash.js/lib/hash/sha/224';\nimport sha384 from 'hash.js/lib/hash/sha/384';\nimport sha512 from 'hash.js/lib/hash/sha/512';\nimport { ripemd160 } from 'hash.js/lib/hash/ripemd';\nimport * as stream from '@openpgp/web-stream-tools';\nimport md5 from './md5';\nimport util from '../../util';\nimport defaultConfig from '../../config';\nimport enums from '../../enums';\n\nconst webCrypto = util.getWebCrypto();\nconst nodeCrypto = util.getNodeCrypto();\nconst nodeCryptoHashes = nodeCrypto && nodeCrypto.getHashes();\n\nfunction nodeHash(type) {\n  if (!nodeCrypto || !nodeCryptoHashes.includes(type)) {\n    return;\n  }\n  return async function (data) {\n    const shasum = nodeCrypto.createHash(type);\n    return stream.transform(data, value => {\n      shasum.update(value);\n    }, () => new Uint8Array(shasum.digest()));\n  };\n}\n\nfunction hashjsHash(hash, webCryptoHash) {\n  return async function(data, config = defaultConfig) {\n    if (stream.isArrayStream(data)) {\n      data = await stream.readToEnd(data);\n    }\n    if (!util.isStream(data) && webCrypto && webCryptoHash && data.length >= config.minBytesForWebCrypto) {\n      return new Uint8Array(await webCrypto.digest(webCryptoHash, data));\n    }\n    const hashInstance = hash();\n    return stream.transform(data, value => {\n      hashInstance.update(value);\n    }, () => new Uint8Array(hashInstance.digest()));\n  };\n}\n\nfunction asmcryptoHash(hash, webCryptoHash) {\n  return async function(data, config = defaultConfig) {\n    if (stream.isArrayStream(data)) {\n      data = await stream.readToEnd(data);\n    }\n    if (util.isStream(data)) {\n      const hashInstance = new hash();\n      return stream.transform(data, value => {\n        hashInstance.process(value);\n      }, () => hashInstance.finish().result);\n    } else if (webCrypto && webCryptoHash && data.length >= config.minBytesForWebCrypto) {\n      return new Uint8Array(await webCrypto.digest(webCryptoHash, data));\n    } else {\n      return hash.bytes(data);\n    }\n  };\n}\n\nconst hashFunctions = {\n  md5: nodeHash('md5') || md5,\n  sha1: nodeHash('sha1') || asmcryptoHash(Sha1, 'SHA-1'),\n  sha224: nodeHash('sha224') || hashjsHash(sha224),\n  sha256: nodeHash('sha256') || asmcryptoHash(Sha256, 'SHA-256'),\n  sha384: nodeHash('sha384') || hashjsHash(sha384, 'SHA-384'),\n  sha512: nodeHash('sha512') || hashjsHash(sha512, 'SHA-512'), // asmcrypto sha512 is huge.\n  ripemd: nodeHash('ripemd160') || hashjsHash(ripemd160)\n};\n\nexport default {\n\n  /** @see module:md5 */\n  md5: hashFunctions.md5,\n  /** @see asmCrypto */\n  sha1: hashFunctions.sha1,\n  /** @see hash.js */\n  sha224: hashFunctions.sha224,\n  /** @see asmCrypto */\n  sha256: hashFunctions.sha256,\n  /** @see hash.js */\n  sha384: hashFunctions.sha384,\n  /** @see asmCrypto */\n  sha512: hashFunctions.sha512,\n  /** @see hash.js */\n  ripemd: hashFunctions.ripemd,\n\n  /**\n   * Create a hash on the specified data using the specified algorithm\n   * @param {module:enums.hash} algo - Hash algorithm type (see {@link https://tools.ietf.org/html/rfc4880#section-9.4|RFC 4880 9.4})\n   * @param {Uint8Array} data - Data to be hashed\n   * @returns {Promise<Uint8Array>} Hash value.\n   */\n  digest: function(algo, data) {\n    switch (algo) {\n      case enums.hash.md5:\n        return this.md5(data);\n      case enums.hash.sha1:\n        return this.sha1(data);\n      case enums.hash.ripemd:\n        return this.ripemd(data);\n      case enums.hash.sha256:\n        return this.sha256(data);\n      case enums.hash.sha384:\n        return this.sha384(data);\n      case enums.hash.sha512:\n        return this.sha512(data);\n      case enums.hash.sha224:\n        return this.sha224(data);\n      default:\n        throw new Error('Invalid hash function.');\n    }\n  },\n\n  /**\n   * Returns the hash size in bytes of the specified hash algorithm type\n   * @param {module:enums.hash} algo - Hash algorithm type (See {@link https://tools.ietf.org/html/rfc4880#section-9.4|RFC 4880 9.4})\n   * @returns {Integer} Size in bytes of the resulting hash.\n   */\n  getHashByteLength: function(algo) {\n    switch (algo) {\n      case enums.hash.md5:\n        return 16;\n      case enums.hash.sha1:\n      case enums.hash.ripemd:\n        return 20;\n      case enums.hash.sha256:\n        return 32;\n      case enums.hash.sha384:\n        return 48;\n      case enums.hash.sha512:\n        return 64;\n      case enums.hash.sha224:\n        return 28;\n      default:\n        throw new Error('Invalid hash algorithm.');\n    }\n  }\n};\n","import { AES } from './aes';\nimport { joinBytes } from '../other/utils';\nexport class AES_CFB {\n    static encrypt(data, key, iv) {\n        return new AES_CFB(key, iv).encrypt(data);\n    }\n    static decrypt(data, key, iv) {\n        return new AES_CFB(key, iv).decrypt(data);\n    }\n    constructor(key, iv, aes) {\n        this.aes = aes ? aes : new AES(key, iv, true, 'CFB');\n        delete this.aes.padding;\n    }\n    encrypt(data) {\n        const r1 = this.aes.AES_Encrypt_process(data);\n        const r2 = this.aes.AES_Encrypt_finish();\n        return joinBytes(r1, r2);\n    }\n    decrypt(data) {\n        const r1 = this.aes.AES_Decrypt_process(data);\n        const r2 = this.aes.AES_Decrypt_finish();\n        return joinBytes(r1, r2);\n    }\n}\n","import * as cipher from '.';\nimport enums from '../../enums';\n\n/**\n * Get implementation of the given cipher\n * @param {enums.symmetric} algo\n * @returns {Object}\n * @throws {Error} on invalid algo\n */\nexport default function getCipher(algo) {\n  const algoName = enums.read(enums.symmetric, algo);\n  return cipher[algoName];\n}\n","// Modified by ProtonTech AG\n\n// Modified by Recurity Labs GmbH\n\n// modified version of https://www.hanewin.net/encrypt/PGdecode.js:\n\n/* OpenPGP encryption using RSA/AES\n * Copyright 2005-2006 Herbert Hanewinkel, www.haneWIN.de\n * version 2.0, check www.haneWIN.de for the latest version\n\n * This software is provided as-is, without express or implied warranty.\n * Permission to use, copy, modify, distribute or sell this software, with or\n * without fee, for any purpose and by any individual or organization, is hereby\n * granted, provided that the above copyright notice and this paragraph appear\n * in all copies. Distribution as a part of an application or binary must\n * include the above copyright notice in the documentation and/or other\n * materials provided with the application or distribution.\n */\n\n/**\n * @module crypto/mode/cfb\n * @private\n */\n\nimport { AES_CFB } from '@openpgp/asmcrypto.js/dist_es8/aes/cfb';\nimport * as stream from '@openpgp/web-stream-tools';\nimport getCipher from '../cipher/getCipher';\nimport util from '../../util';\nimport enums from '../../enums';\n\nconst webCrypto = util.getWebCrypto();\nconst nodeCrypto = util.getNodeCrypto();\n\nconst knownAlgos = nodeCrypto ? nodeCrypto.getCiphers() : [];\nconst nodeAlgos = {\n  idea: knownAlgos.includes('idea-cfb') ? 'idea-cfb' : undefined, /* Unused, not implemented */\n  tripledes: knownAlgos.includes('des-ede3-cfb') ? 'des-ede3-cfb' : undefined,\n  cast5: knownAlgos.includes('cast5-cfb') ? 'cast5-cfb' : undefined,\n  blowfish: knownAlgos.includes('bf-cfb') ? 'bf-cfb' : undefined,\n  aes128: knownAlgos.includes('aes-128-cfb') ? 'aes-128-cfb' : undefined,\n  aes192: knownAlgos.includes('aes-192-cfb') ? 'aes-192-cfb' : undefined,\n  aes256: knownAlgos.includes('aes-256-cfb') ? 'aes-256-cfb' : undefined\n  /* twofish is not implemented in OpenSSL */\n};\n\n/**\n * CFB encryption\n * @param {enums.symmetric} algo - block cipher algorithm\n * @param {Uint8Array} key\n * @param {MaybeStream<Uint8Array>} plaintext\n * @param {Uint8Array} iv\n * @param {Object} config - full configuration, defaults to openpgp.config\n * @returns MaybeStream<Uint8Array>\n */\nexport async function encrypt(algo, key, plaintext, iv, config) {\n  const algoName = enums.read(enums.symmetric, algo);\n  if (util.getNodeCrypto() && nodeAlgos[algoName]) { // Node crypto library.\n    return nodeEncrypt(algo, key, plaintext, iv);\n  }\n  if (util.isAES(algo)) {\n    return aesEncrypt(algo, key, plaintext, iv, config);\n  }\n\n  const Cipher = getCipher(algo);\n  const cipherfn = new Cipher(key);\n  const block_size = cipherfn.blockSize;\n\n  const blockc = iv.slice();\n  let pt = new Uint8Array();\n  const process = chunk => {\n    if (chunk) {\n      pt = util.concatUint8Array([pt, chunk]);\n    }\n    const ciphertext = new Uint8Array(pt.length);\n    let i;\n    let j = 0;\n    while (chunk ? pt.length >= block_size : pt.length) {\n      const encblock = cipherfn.encrypt(blockc);\n      for (i = 0; i < block_size; i++) {\n        blockc[i] = pt[i] ^ encblock[i];\n        ciphertext[j++] = blockc[i];\n      }\n      pt = pt.subarray(block_size);\n    }\n    return ciphertext.subarray(0, j);\n  };\n  return stream.transform(plaintext, process, process);\n}\n\n/**\n * CFB decryption\n * @param {enums.symmetric} algo - block cipher algorithm\n * @param {Uint8Array} key\n * @param {MaybeStream<Uint8Array>} ciphertext\n * @param {Uint8Array} iv\n * @returns MaybeStream<Uint8Array>\n */\nexport async function decrypt(algo, key, ciphertext, iv) {\n  const algoName = enums.read(enums.symmetric, algo);\n  if (util.getNodeCrypto() && nodeAlgos[algoName]) { // Node crypto library.\n    return nodeDecrypt(algo, key, ciphertext, iv);\n  }\n  if (util.isAES(algo)) {\n    return aesDecrypt(algo, key, ciphertext, iv);\n  }\n\n  const Cipher = getCipher(algo);\n  const cipherfn = new Cipher(key);\n  const block_size = cipherfn.blockSize;\n\n  let blockp = iv;\n  let ct = new Uint8Array();\n  const process = chunk => {\n    if (chunk) {\n      ct = util.concatUint8Array([ct, chunk]);\n    }\n    const plaintext = new Uint8Array(ct.length);\n    let i;\n    let j = 0;\n    while (chunk ? ct.length >= block_size : ct.length) {\n      const decblock = cipherfn.encrypt(blockp);\n      blockp = ct.subarray(0, block_size);\n      for (i = 0; i < block_size; i++) {\n        plaintext[j++] = blockp[i] ^ decblock[i];\n      }\n      ct = ct.subarray(block_size);\n    }\n    return plaintext.subarray(0, j);\n  };\n  return stream.transform(ciphertext, process, process);\n}\n\nfunction aesEncrypt(algo, key, pt, iv, config) {\n  if (\n    util.getWebCrypto() &&\n    key.length !== 24 && // Chrome doesn't support 192 bit keys, see https://www.chromium.org/blink/webcrypto#TOC-AES-support\n    !util.isStream(pt) &&\n    pt.length >= 3000 * config.minBytesForWebCrypto // Default to a 3MB minimum. Chrome is pretty slow for small messages, see: https://bugs.chromium.org/p/chromium/issues/detail?id=701188#c2\n  ) { // Web Crypto\n    return webEncrypt(algo, key, pt, iv);\n  }\n  // asm.js fallback\n  const cfb = new AES_CFB(key, iv);\n  return stream.transform(pt, value => cfb.aes.AES_Encrypt_process(value), () => cfb.aes.AES_Encrypt_finish());\n}\n\nfunction aesDecrypt(algo, key, ct, iv) {\n  if (util.isStream(ct)) {\n    const cfb = new AES_CFB(key, iv);\n    return stream.transform(ct, value => cfb.aes.AES_Decrypt_process(value), () => cfb.aes.AES_Decrypt_finish());\n  }\n  return AES_CFB.decrypt(ct, key, iv);\n}\n\nfunction xorMut(a, b) {\n  for (let i = 0; i < a.length; i++) {\n    a[i] = a[i] ^ b[i];\n  }\n}\n\nasync function webEncrypt(algo, key, pt, iv) {\n  const ALGO = 'AES-CBC';\n  const _key = await webCrypto.importKey('raw', key, { name: ALGO }, false, ['encrypt']);\n  const { blockSize } = getCipher(algo);\n  const cbc_pt = util.concatUint8Array([new Uint8Array(blockSize), pt]);\n  const ct = new Uint8Array(await webCrypto.encrypt({ name: ALGO, iv }, _key, cbc_pt)).subarray(0, pt.length);\n  xorMut(ct, pt);\n  return ct;\n}\n\nfunction nodeEncrypt(algo, key, pt, iv) {\n  const algoName = enums.read(enums.symmetric, algo);\n  const cipherObj = new nodeCrypto.createCipheriv(nodeAlgos[algoName], key, iv);\n  return stream.transform(pt, value => new Uint8Array(cipherObj.update(value)));\n}\n\nfunction nodeDecrypt(algo, key, ct, iv) {\n  const algoName = enums.read(enums.symmetric, algo);\n  const decipherObj = new nodeCrypto.createDecipheriv(nodeAlgos[algoName], key, iv);\n  return stream.transform(ct, value => new Uint8Array(decipherObj.update(value)));\n}\n","import { AES } from './aes';\nimport { IllegalArgumentError } from '../other/errors';\nimport { joinBytes } from '../other/utils';\nexport class AES_CTR {\n    static encrypt(data, key, nonce) {\n        return new AES_CTR(key, nonce).encrypt(data);\n    }\n    static decrypt(data, key, nonce) {\n        return new AES_CTR(key, nonce).encrypt(data);\n    }\n    constructor(key, nonce, aes) {\n        this.aes = aes ? aes : new AES(key, undefined, false, 'CTR');\n        delete this.aes.padding;\n        this.AES_CTR_set_options(nonce);\n    }\n    encrypt(data) {\n        const r1 = this.aes.AES_Encrypt_process(data);\n        const r2 = this.aes.AES_Encrypt_finish();\n        return joinBytes(r1, r2);\n    }\n    decrypt(data) {\n        const r1 = this.aes.AES_Encrypt_process(data);\n        const r2 = this.aes.AES_Encrypt_finish();\n        return joinBytes(r1, r2);\n    }\n    AES_CTR_set_options(nonce, counter, size) {\n        let { asm } = this.aes.acquire_asm();\n        if (size !== undefined) {\n            if (size < 8 || size > 48)\n                throw new IllegalArgumentError('illegal counter size');\n            let mask = Math.pow(2, size) - 1;\n            asm.set_mask(0, 0, (mask / 0x100000000) | 0, mask | 0);\n        }\n        else {\n            size = 48;\n            asm.set_mask(0, 0, 0xffff, 0xffffffff);\n        }\n        if (nonce !== undefined) {\n            let len = nonce.length;\n            if (!len || len > 16)\n                throw new IllegalArgumentError('illegal nonce size');\n            let view = new DataView(new ArrayBuffer(16));\n            new Uint8Array(view.buffer).set(nonce);\n            asm.set_nonce(view.getUint32(0), view.getUint32(4), view.getUint32(8), view.getUint32(12));\n        }\n        else {\n            throw new Error('nonce is required');\n        }\n        if (counter !== undefined) {\n            if (counter < 0 || counter >= Math.pow(2, size))\n                throw new IllegalArgumentError('illegal counter value');\n            asm.set_counter(0, 0, (counter / 0x100000000) | 0, counter | 0);\n        }\n    }\n}\n","import { AES } from './aes';\nimport { joinBytes } from '../other/utils';\nexport class AES_CBC {\n    static encrypt(data, key, padding = true, iv) {\n        return new AES_CBC(key, iv, padding).encrypt(data);\n    }\n    static decrypt(data, key, padding = true, iv) {\n        return new AES_CBC(key, iv, padding).decrypt(data);\n    }\n    constructor(key, iv, padding = true, aes) {\n        this.aes = aes ? aes : new AES(key, iv, padding, 'CBC');\n    }\n    encrypt(data) {\n        const r1 = this.aes.AES_Encrypt_process(data);\n        const r2 = this.aes.AES_Encrypt_finish();\n        return joinBytes(r1, r2);\n    }\n    decrypt(data) {\n        const r1 = this.aes.AES_Decrypt_process(data);\n        const r2 = this.aes.AES_Decrypt_finish();\n        return joinBytes(r1, r2);\n    }\n}\n","/**\n * @fileoverview This module implements AES-CMAC on top of\n * native AES-CBC using either the WebCrypto API or Node.js' crypto API.\n * @module crypto/cmac\n * @private\n */\n\nimport { AES_CBC } from '@openpgp/asmcrypto.js/dist_es8/aes/cbc';\nimport util from '../util';\n\nconst webCrypto = util.getWebCrypto();\nconst nodeCrypto = util.getNodeCrypto();\n\n\n/**\n * This implementation of CMAC is based on the description of OMAC in\n * http://web.cs.ucdavis.edu/~rogaway/papers/eax.pdf. As per that\n * document:\n *\n * We have made a small modification to the OMAC algorithm as it was\n * originally presented, changing one of its two constants.\n * Specifically, the constant 4 at line 85 was the constant 1/2 (the\n * multiplicative inverse of 2) in the original definition of OMAC [14].\n * The OMAC authors indicate that they will promulgate this modification\n * [15], which slightly simplifies implementations.\n */\n\nconst blockLength = 16;\n\n\n/**\n * xor `padding` into the end of `data`. This function implements \"the\n * operation xor→ [which] xors the shorter string into the end of longer\n * one\". Since data is always as least as long as padding, we can\n * simplify the implementation.\n * @param {Uint8Array} data\n * @param {Uint8Array} padding\n */\nfunction rightXORMut(data, padding) {\n  const offset = data.length - blockLength;\n  for (let i = 0; i < blockLength; i++) {\n    data[i + offset] ^= padding[i];\n  }\n  return data;\n}\n\nfunction pad(data, padding, padding2) {\n  // if |M| in {n, 2n, 3n, ...}\n  if (data.length && data.length % blockLength === 0) {\n    // then return M xor→ B,\n    return rightXORMut(data, padding);\n  }\n  // else return (M || 10^(n−1−(|M| mod n))) xor→ P\n  const padded = new Uint8Array(data.length + (blockLength - (data.length % blockLength)));\n  padded.set(data);\n  padded[data.length] = 0b10000000;\n  return rightXORMut(padded, padding2);\n}\n\nconst zeroBlock = new Uint8Array(blockLength);\n\nexport default async function CMAC(key) {\n  const cbc = await CBC(key);\n\n  // L ← E_K(0^n); B ← 2L; P ← 4L\n  const padding = util.double(await cbc(zeroBlock));\n  const padding2 = util.double(padding);\n\n  return async function(data) {\n    // return CBC_K(pad(M; B, P))\n    return (await cbc(pad(data, padding, padding2))).subarray(-blockLength);\n  };\n}\n\nasync function CBC(key) {\n  if (util.getWebCrypto() && key.length !== 24) { // WebCrypto (no 192 bit support) see: https://www.chromium.org/blink/webcrypto#TOC-AES-support\n    key = await webCrypto.importKey('raw', key, { name: 'AES-CBC', length: key.length * 8 }, false, ['encrypt']);\n    return async function(pt) {\n      const ct = await webCrypto.encrypt({ name: 'AES-CBC', iv: zeroBlock, length: blockLength * 8 }, key, pt);\n      return new Uint8Array(ct).subarray(0, ct.byteLength - blockLength);\n    };\n  }\n  if (util.getNodeCrypto()) { // Node crypto library\n    return async function(pt) {\n      const en = new nodeCrypto.createCipheriv('aes-' + (key.length * 8) + '-cbc', key, zeroBlock);\n      const ct = en.update(pt);\n      return new Uint8Array(ct);\n    };\n  }\n  // asm.js fallback\n  return async function(pt) {\n    return AES_CBC.encrypt(pt, key, false, zeroBlock);\n  };\n}\n","// OpenPGP.js - An OpenPGP implementation in javascript\n// Copyright (C) 2018 ProtonTech AG\n//\n// This library is free software; you can redistribute it and/or\n// modify it under the terms of the GNU Lesser General Public\n// License as published by the Free Software Foundation; either\n// version 3.0 of the License, or (at your option) any later version.\n//\n// This library is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n// Lesser General Public License for more details.\n//\n// You should have received a copy of the GNU Lesser General Public\n// License along with this library; if not, write to the Free Software\n// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n\n/**\n * @fileoverview This module implements AES-EAX en/decryption on top of\n * native AES-CTR using either the WebCrypto API or Node.js' crypto API.\n * @module crypto/mode/eax\n * @private\n */\n\nimport { AES_CTR } from '@openpgp/asmcrypto.js/dist_es8/aes/ctr';\nimport CMAC from '../cmac';\nimport util from '../../util';\nimport enums from '../../enums';\n\nconst webCrypto = util.getWebCrypto();\nconst nodeCrypto = util.getNodeCrypto();\nconst Buffer = util.getNodeBuffer();\n\n\nconst blockLength = 16;\nconst ivLength = blockLength;\nconst tagLength = blockLength;\n\nconst zero = new Uint8Array(blockLength);\nconst one = new Uint8Array(blockLength); one[blockLength - 1] = 1;\nconst two = new Uint8Array(blockLength); two[blockLength - 1] = 2;\n\nasync function OMAC(key) {\n  const cmac = await CMAC(key);\n  return function(t, message) {\n    return cmac(util.concatUint8Array([t, message]));\n  };\n}\n\nasync function CTR(key) {\n  if (\n    util.getWebCrypto() &&\n    key.length !== 24 // WebCrypto (no 192 bit support) see: https://www.chromium.org/blink/webcrypto#TOC-AES-support\n  ) {\n    key = await webCrypto.importKey('raw', key, { name: 'AES-CTR', length: key.length * 8 }, false, ['encrypt']);\n    return async function(pt, iv) {\n      const ct = await webCrypto.encrypt({ name: 'AES-CTR', counter: iv, length: blockLength * 8 }, key, pt);\n      return new Uint8Array(ct);\n    };\n  }\n  if (util.getNodeCrypto()) { // Node crypto library\n    return async function(pt, iv) {\n      const en = new nodeCrypto.createCipheriv('aes-' + (key.length * 8) + '-ctr', key, iv);\n      const ct = Buffer.concat([en.update(pt), en.final()]);\n      return new Uint8Array(ct);\n    };\n  }\n  // asm.js fallback\n  return async function(pt, iv) {\n    return AES_CTR.encrypt(pt, key, iv);\n  };\n}\n\n\n/**\n * Class to en/decrypt using EAX mode.\n * @param {enums.symmetric} cipher - The symmetric cipher algorithm to use\n * @param {Uint8Array} key - The encryption key\n */\nasync function EAX(cipher, key) {\n  if (cipher !== enums.symmetric.aes128 &&\n    cipher !== enums.symmetric.aes192 &&\n    cipher !== enums.symmetric.aes256) {\n    throw new Error('EAX mode supports only AES cipher');\n  }\n\n  const [\n    omac,\n    ctr\n  ] = await Promise.all([\n    OMAC(key),\n    CTR(key)\n  ]);\n\n  return {\n    /**\n     * Encrypt plaintext input.\n     * @param {Uint8Array} plaintext - The cleartext input to be encrypted\n     * @param {Uint8Array} nonce - The nonce (16 bytes)\n     * @param {Uint8Array} adata - Associated data to sign\n     * @returns {Promise<Uint8Array>} The ciphertext output.\n     */\n    encrypt: async function(plaintext, nonce, adata) {\n      const [\n        omacNonce,\n        omacAdata\n      ] = await Promise.all([\n        omac(zero, nonce),\n        omac(one, adata)\n      ]);\n      const ciphered = await ctr(plaintext, omacNonce);\n      const omacCiphered = await omac(two, ciphered);\n      const tag = omacCiphered; // Assumes that omac(*).length === tagLength.\n      for (let i = 0; i < tagLength; i++) {\n        tag[i] ^= omacAdata[i] ^ omacNonce[i];\n      }\n      return util.concatUint8Array([ciphered, tag]);\n    },\n\n    /**\n     * Decrypt ciphertext input.\n     * @param {Uint8Array} ciphertext - The ciphertext input to be decrypted\n     * @param {Uint8Array} nonce - The nonce (16 bytes)\n     * @param {Uint8Array} adata - Associated data to verify\n     * @returns {Promise<Uint8Array>} The plaintext output.\n     */\n    decrypt: async function(ciphertext, nonce, adata) {\n      if (ciphertext.length < tagLength) throw new Error('Invalid EAX ciphertext');\n      const ciphered = ciphertext.subarray(0, -tagLength);\n      const ctTag = ciphertext.subarray(-tagLength);\n      const [\n        omacNonce,\n        omacAdata,\n        omacCiphered\n      ] = await Promise.all([\n        omac(zero, nonce),\n        omac(one, adata),\n        omac(two, ciphered)\n      ]);\n      const tag = omacCiphered; // Assumes that omac(*).length === tagLength.\n      for (let i = 0; i < tagLength; i++) {\n        tag[i] ^= omacAdata[i] ^ omacNonce[i];\n      }\n      if (!util.equalsUint8Array(ctTag, tag)) throw new Error('Authentication tag mismatch');\n      const plaintext = await ctr(ciphered, omacNonce);\n      return plaintext;\n    }\n  };\n}\n\n\n/**\n * Get EAX nonce as defined by {@link https://tools.ietf.org/html/draft-ietf-openpgp-rfc4880bis-04#section-5.16.1|RFC4880bis-04, section 5.16.1}.\n * @param {Uint8Array} iv - The initialization vector (16 bytes)\n * @param {Uint8Array} chunkIndex - The chunk index (8 bytes)\n */\nEAX.getNonce = function(iv, chunkIndex) {\n  const nonce = iv.slice();\n  for (let i = 0; i < chunkIndex.length; i++) {\n    nonce[8 + i] ^= chunkIndex[i];\n  }\n  return nonce;\n};\n\nEAX.blockLength = blockLength;\nEAX.ivLength = ivLength;\nEAX.tagLength = tagLength;\n\nexport default EAX;\n","// OpenPGP.js - An OpenPGP implementation in javascript\n// Copyright (C) 2018 ProtonTech AG\n//\n// This library is free software; you can redistribute it and/or\n// modify it under the terms of the GNU Lesser General Public\n// License as published by the Free Software Foundation; either\n// version 3.0 of the License, or (at your option) any later version.\n//\n// This library is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n// Lesser General Public License for more details.\n//\n// You should have received a copy of the GNU Lesser General Public\n// License along with this library; if not, write to the Free Software\n// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n\n/**\n * @fileoverview This module implements AES-OCB en/decryption.\n * @module crypto/mode/ocb\n * @private\n */\n\nimport * as ciphers from '../cipher';\nimport util from '../../util';\nimport enums from '../../enums';\n\nconst blockLength = 16;\nconst ivLength = 15;\n\n// https://tools.ietf.org/html/draft-ietf-openpgp-rfc4880bis-04#section-5.16.2:\n// While OCB [RFC7253] allows the authentication tag length to be of any\n// number up to 128 bits long, this document requires a fixed\n// authentication tag length of 128 bits (16 octets) for simplicity.\nconst tagLength = 16;\n\n\nfunction ntz(n) {\n  let ntz = 0;\n  for (let i = 1; (n & i) === 0; i <<= 1) {\n    ntz++;\n  }\n  return ntz;\n}\n\nfunction xorMut(S, T) {\n  for (let i = 0; i < S.length; i++) {\n    S[i] ^= T[i];\n  }\n  return S;\n}\n\nfunction xor(S, T) {\n  return xorMut(S.slice(), T);\n}\n\nconst zeroBlock = new Uint8Array(blockLength);\nconst one = new Uint8Array([1]);\n\n/**\n * Class to en/decrypt using OCB mode.\n * @param {enums.symmetric} cipher - The symmetric cipher algorithm to use\n * @param {Uint8Array} key - The encryption key\n */\nasync function OCB(cipher, key) {\n\n  let maxNtz = 0;\n  let encipher;\n  let decipher;\n  let mask;\n\n  constructKeyVariables(cipher, key);\n\n  function constructKeyVariables(cipher, key) {\n    const cipherName = enums.read(enums.symmetric, cipher);\n    const aes = new ciphers[cipherName](key);\n    encipher = aes.encrypt.bind(aes);\n    decipher = aes.decrypt.bind(aes);\n\n    const mask_x = encipher(zeroBlock);\n    const mask_$ = util.double(mask_x);\n    mask = [];\n    mask[0] = util.double(mask_$);\n\n\n    mask.x = mask_x;\n    mask.$ = mask_$;\n  }\n\n  function extendKeyVariables(text, adata) {\n    const newMaxNtz = util.nbits(Math.max(text.length, adata.length) / blockLength | 0) - 1;\n    for (let i = maxNtz + 1; i <= newMaxNtz; i++) {\n      mask[i] = util.double(mask[i - 1]);\n    }\n    maxNtz = newMaxNtz;\n  }\n\n  function hash(adata) {\n    if (!adata.length) {\n      // Fast path\n      return zeroBlock;\n    }\n\n    //\n    // Consider A as a sequence of 128-bit blocks\n    //\n    const m = adata.length / blockLength | 0;\n\n    const offset = new Uint8Array(blockLength);\n    const sum = new Uint8Array(blockLength);\n    for (let i = 0; i < m; i++) {\n      xorMut(offset, mask[ntz(i + 1)]);\n      xorMut(sum, encipher(xor(offset, adata)));\n      adata = adata.subarray(blockLength);\n    }\n\n    //\n    // Process any final partial block; compute final hash value\n    //\n    if (adata.length) {\n      xorMut(offset, mask.x);\n\n      const cipherInput = new Uint8Array(blockLength);\n      cipherInput.set(adata, 0);\n      cipherInput[adata.length] = 0b10000000;\n      xorMut(cipherInput, offset);\n\n      xorMut(sum, encipher(cipherInput));\n    }\n\n    return sum;\n  }\n\n  /**\n   * Encrypt/decrypt data.\n   * @param {encipher|decipher} fn - Encryption/decryption block cipher function\n   * @param {Uint8Array} text - The cleartext or ciphertext (without tag) input\n   * @param {Uint8Array} nonce - The nonce (15 bytes)\n   * @param {Uint8Array} adata - Associated data to sign\n   * @returns {Promise<Uint8Array>} The ciphertext or plaintext output, with tag appended in both cases.\n   */\n  function crypt(fn, text, nonce, adata) {\n    //\n    // Consider P as a sequence of 128-bit blocks\n    //\n    const m = text.length / blockLength | 0;\n\n    //\n    // Key-dependent variables\n    //\n    extendKeyVariables(text, adata);\n\n    //\n    // Nonce-dependent and per-encryption variables\n    //\n    //    Nonce = num2str(TAGLEN mod 128,7) || zeros(120-bitlen(N)) || 1 || N\n    // Note: We assume here that tagLength mod 16 == 0.\n    const paddedNonce = util.concatUint8Array([zeroBlock.subarray(0, ivLength - nonce.length), one, nonce]);\n    //    bottom = str2num(Nonce[123..128])\n    const bottom = paddedNonce[blockLength - 1] & 0b111111;\n    //    Ktop = ENCIPHER(K, Nonce[1..122] || zeros(6))\n    paddedNonce[blockLength - 1] &= 0b11000000;\n    const kTop = encipher(paddedNonce);\n    //    Stretch = Ktop || (Ktop[1..64] xor Ktop[9..72])\n    const stretched = util.concatUint8Array([kTop, xor(kTop.subarray(0, 8), kTop.subarray(1, 9))]);\n    //    Offset_0 = Stretch[1+bottom..128+bottom]\n    const offset = util.shiftRight(stretched.subarray(0 + (bottom >> 3), 17 + (bottom >> 3)), 8 - (bottom & 7)).subarray(1);\n    //    Checksum_0 = zeros(128)\n    const checksum = new Uint8Array(blockLength);\n\n    const ct = new Uint8Array(text.length + tagLength);\n\n    //\n    // Process any whole blocks\n    //\n    let i;\n    let pos = 0;\n    for (i = 0; i < m; i++) {\n      // Offset_i = Offset_{i-1} xor L_{ntz(i)}\n      xorMut(offset, mask[ntz(i + 1)]);\n      // C_i = Offset_i xor ENCIPHER(K, P_i xor Offset_i)\n      // P_i = Offset_i xor DECIPHER(K, C_i xor Offset_i)\n      ct.set(xorMut(fn(xor(offset, text)), offset), pos);\n      // Checksum_i = Checksum_{i-1} xor P_i\n      xorMut(checksum, fn === encipher ? text : ct.subarray(pos));\n\n      text = text.subarray(blockLength);\n      pos += blockLength;\n    }\n\n    //\n    // Process any final partial block and compute raw tag\n    //\n    if (text.length) {\n      // Offset_* = Offset_m xor L_*\n      xorMut(offset, mask.x);\n      // Pad = ENCIPHER(K, Offset_*)\n      const padding = encipher(offset);\n      // C_* = P_* xor Pad[1..bitlen(P_*)]\n      ct.set(xor(text, padding), pos);\n\n      // Checksum_* = Checksum_m xor (P_* || 1 || new Uint8Array(127-bitlen(P_*)))\n      const xorInput = new Uint8Array(blockLength);\n      xorInput.set(fn === encipher ? text : ct.subarray(pos, -tagLength), 0);\n      xorInput[text.length] = 0b10000000;\n      xorMut(checksum, xorInput);\n      pos += text.length;\n    }\n    // Tag = ENCIPHER(K, Checksum_* xor Offset_* xor L_$) xor HASH(K,A)\n    const tag = xorMut(encipher(xorMut(xorMut(checksum, offset), mask.$)), hash(adata));\n\n    //\n    // Assemble ciphertext\n    //\n    // C = C_1 || C_2 || ... || C_m || C_* || Tag[1..TAGLEN]\n    ct.set(tag, pos);\n    return ct;\n  }\n\n\n  return {\n    /**\n     * Encrypt plaintext input.\n     * @param {Uint8Array} plaintext - The cleartext input to be encrypted\n     * @param {Uint8Array} nonce - The nonce (15 bytes)\n     * @param {Uint8Array} adata - Associated data to sign\n     * @returns {Promise<Uint8Array>} The ciphertext output.\n     */\n    encrypt: async function(plaintext, nonce, adata) {\n      return crypt(encipher, plaintext, nonce, adata);\n    },\n\n    /**\n     * Decrypt ciphertext input.\n     * @param {Uint8Array} ciphertext - The ciphertext input to be decrypted\n     * @param {Uint8Array} nonce - The nonce (15 bytes)\n     * @param {Uint8Array} adata - Associated data to sign\n     * @returns {Promise<Uint8Array>} The ciphertext output.\n     */\n    decrypt: async function(ciphertext, nonce, adata) {\n      if (ciphertext.length < tagLength) throw new Error('Invalid OCB ciphertext');\n\n      const tag = ciphertext.subarray(-tagLength);\n      ciphertext = ciphertext.subarray(0, -tagLength);\n\n      const crypted = crypt(decipher, ciphertext, nonce, adata);\n      // if (Tag[1..TAGLEN] == T)\n      if (util.equalsUint8Array(tag, crypted.subarray(-tagLength))) {\n        return crypted.subarray(0, -tagLength);\n      }\n      throw new Error('Authentication tag mismatch');\n    }\n  };\n}\n\n\n/**\n * Get OCB nonce as defined by {@link https://tools.ietf.org/html/draft-ietf-openpgp-rfc4880bis-04#section-5.16.2|RFC4880bis-04, section 5.16.2}.\n * @param {Uint8Array} iv - The initialization vector (15 bytes)\n * @param {Uint8Array} chunkIndex - The chunk index (8 bytes)\n */\nOCB.getNonce = function(iv, chunkIndex) {\n  const nonce = iv.slice();\n  for (let i = 0; i < chunkIndex.length; i++) {\n    nonce[7 + i] ^= chunkIndex[i];\n  }\n  return nonce;\n};\n\nOCB.blockLength = blockLength;\nOCB.ivLength = ivLength;\nOCB.tagLength = tagLength;\n\nexport default OCB;\n","import { IllegalArgumentError, IllegalStateError, SecurityError } from '../other/errors';\nimport { _heap_write } from '../other/utils';\nimport { AES } from './aes';\nimport { AES_asm } from './aes.asm';\nconst _AES_GCM_data_maxLength = 68719476704; // 2^36 - 2^5\nexport class AES_GCM {\n    constructor(key, nonce, adata, tagSize = 16, aes) {\n        this.tagSize = tagSize;\n        this.gamma0 = 0;\n        this.counter = 1;\n        this.aes = aes ? aes : new AES(key, undefined, false, 'CTR');\n        let { asm, heap } = this.aes.acquire_asm();\n        // Init GCM\n        asm.gcm_init();\n        // Tag size\n        if (this.tagSize < 4 || this.tagSize > 16)\n            throw new IllegalArgumentError('illegal tagSize value');\n        // Nonce\n        const noncelen = nonce.length || 0;\n        const noncebuf = new Uint8Array(16);\n        if (noncelen !== 12) {\n            this._gcm_mac_process(nonce);\n            heap[0] = 0;\n            heap[1] = 0;\n            heap[2] = 0;\n            heap[3] = 0;\n            heap[4] = 0;\n            heap[5] = 0;\n            heap[6] = 0;\n            heap[7] = 0;\n            heap[8] = 0;\n            heap[9] = 0;\n            heap[10] = 0;\n            heap[11] = noncelen >>> 29;\n            heap[12] = (noncelen >>> 21) & 255;\n            heap[13] = (noncelen >>> 13) & 255;\n            heap[14] = (noncelen >>> 5) & 255;\n            heap[15] = (noncelen << 3) & 255;\n            asm.mac(AES_asm.MAC.GCM, AES_asm.HEAP_DATA, 16);\n            asm.get_iv(AES_asm.HEAP_DATA);\n            asm.set_iv(0, 0, 0, 0);\n            noncebuf.set(heap.subarray(0, 16));\n        }\n        else {\n            noncebuf.set(nonce);\n            noncebuf[15] = 1;\n        }\n        const nonceview = new DataView(noncebuf.buffer);\n        this.gamma0 = nonceview.getUint32(12);\n        asm.set_nonce(nonceview.getUint32(0), nonceview.getUint32(4), nonceview.getUint32(8), 0);\n        asm.set_mask(0, 0, 0, 0xffffffff);\n        // Associated data\n        if (adata !== undefined) {\n            if (adata.length > _AES_GCM_data_maxLength)\n                throw new IllegalArgumentError('illegal adata length');\n            if (adata.length) {\n                this.adata = adata;\n                this._gcm_mac_process(adata);\n            }\n            else {\n                this.adata = undefined;\n            }\n        }\n        else {\n            this.adata = undefined;\n        }\n        // Counter\n        if (this.counter < 1 || this.counter > 0xffffffff)\n            throw new RangeError('counter must be a positive 32-bit integer');\n        asm.set_counter(0, 0, 0, (this.gamma0 + this.counter) | 0);\n    }\n    static encrypt(cleartext, key, nonce, adata, tagsize) {\n        return new AES_GCM(key, nonce, adata, tagsize).encrypt(cleartext);\n    }\n    static decrypt(ciphertext, key, nonce, adata, tagsize) {\n        return new AES_GCM(key, nonce, adata, tagsize).decrypt(ciphertext);\n    }\n    encrypt(data) {\n        return this.AES_GCM_encrypt(data);\n    }\n    decrypt(data) {\n        return this.AES_GCM_decrypt(data);\n    }\n    AES_GCM_Encrypt_process(data) {\n        let dpos = 0;\n        let dlen = data.length || 0;\n        let { asm, heap } = this.aes.acquire_asm();\n        let counter = this.counter;\n        let pos = this.aes.pos;\n        let len = this.aes.len;\n        let rpos = 0;\n        let rlen = (len + dlen) & -16;\n        let wlen = 0;\n        if (((counter - 1) << 4) + len + dlen > _AES_GCM_data_maxLength)\n            throw new RangeError('counter overflow');\n        const result = new Uint8Array(rlen);\n        while (dlen > 0) {\n            wlen = _heap_write(heap, pos + len, data, dpos, dlen);\n            len += wlen;\n            dpos += wlen;\n            dlen -= wlen;\n            wlen = asm.cipher(AES_asm.ENC.CTR, AES_asm.HEAP_DATA + pos, len);\n            wlen = asm.mac(AES_asm.MAC.GCM, AES_asm.HEAP_DATA + pos, wlen);\n            if (wlen)\n                result.set(heap.subarray(pos, pos + wlen), rpos);\n            counter += wlen >>> 4;\n            rpos += wlen;\n            if (wlen < len) {\n                pos += wlen;\n                len -= wlen;\n            }\n            else {\n                pos = 0;\n                len = 0;\n            }\n        }\n        this.counter = counter;\n        this.aes.pos = pos;\n        this.aes.len = len;\n        return result;\n    }\n    AES_GCM_Encrypt_finish() {\n        let { asm, heap } = this.aes.acquire_asm();\n        let counter = this.counter;\n        let tagSize = this.tagSize;\n        let adata = this.adata;\n        let pos = this.aes.pos;\n        let len = this.aes.len;\n        const result = new Uint8Array(len + tagSize);\n        asm.cipher(AES_asm.ENC.CTR, AES_asm.HEAP_DATA + pos, (len + 15) & -16);\n        if (len)\n            result.set(heap.subarray(pos, pos + len));\n        let i = len;\n        for (; i & 15; i++)\n            heap[pos + i] = 0;\n        asm.mac(AES_asm.MAC.GCM, AES_asm.HEAP_DATA + pos, i);\n        const alen = adata !== undefined ? adata.length : 0;\n        const clen = ((counter - 1) << 4) + len;\n        heap[0] = 0;\n        heap[1] = 0;\n        heap[2] = 0;\n        heap[3] = alen >>> 29;\n        heap[4] = alen >>> 21;\n        heap[5] = (alen >>> 13) & 255;\n        heap[6] = (alen >>> 5) & 255;\n        heap[7] = (alen << 3) & 255;\n        heap[8] = heap[9] = heap[10] = 0;\n        heap[11] = clen >>> 29;\n        heap[12] = (clen >>> 21) & 255;\n        heap[13] = (clen >>> 13) & 255;\n        heap[14] = (clen >>> 5) & 255;\n        heap[15] = (clen << 3) & 255;\n        asm.mac(AES_asm.MAC.GCM, AES_asm.HEAP_DATA, 16);\n        asm.get_iv(AES_asm.HEAP_DATA);\n        asm.set_counter(0, 0, 0, this.gamma0);\n        asm.cipher(AES_asm.ENC.CTR, AES_asm.HEAP_DATA, 16);\n        result.set(heap.subarray(0, tagSize), len);\n        this.counter = 1;\n        this.aes.pos = 0;\n        this.aes.len = 0;\n        return result;\n    }\n    AES_GCM_Decrypt_process(data) {\n        let dpos = 0;\n        let dlen = data.length || 0;\n        let { asm, heap } = this.aes.acquire_asm();\n        let counter = this.counter;\n        let tagSize = this.tagSize;\n        let pos = this.aes.pos;\n        let len = this.aes.len;\n        let rpos = 0;\n        let rlen = len + dlen > tagSize ? (len + dlen - tagSize) & -16 : 0;\n        let tlen = len + dlen - rlen;\n        let wlen = 0;\n        if (((counter - 1) << 4) + len + dlen > _AES_GCM_data_maxLength)\n            throw new RangeError('counter overflow');\n        const result = new Uint8Array(rlen);\n        while (dlen > tlen) {\n            wlen = _heap_write(heap, pos + len, data, dpos, dlen - tlen);\n            len += wlen;\n            dpos += wlen;\n            dlen -= wlen;\n            wlen = asm.mac(AES_asm.MAC.GCM, AES_asm.HEAP_DATA + pos, wlen);\n            wlen = asm.cipher(AES_asm.DEC.CTR, AES_asm.HEAP_DATA + pos, wlen);\n            if (wlen)\n                result.set(heap.subarray(pos, pos + wlen), rpos);\n            counter += wlen >>> 4;\n            rpos += wlen;\n            pos = 0;\n            len = 0;\n        }\n        if (dlen > 0) {\n            len += _heap_write(heap, 0, data, dpos, dlen);\n        }\n        this.counter = counter;\n        this.aes.pos = pos;\n        this.aes.len = len;\n        return result;\n    }\n    AES_GCM_Decrypt_finish() {\n        let { asm, heap } = this.aes.acquire_asm();\n        let tagSize = this.tagSize;\n        let adata = this.adata;\n        let counter = this.counter;\n        let pos = this.aes.pos;\n        let len = this.aes.len;\n        let rlen = len - tagSize;\n        if (len < tagSize)\n            throw new IllegalStateError('authentication tag not found');\n        const result = new Uint8Array(rlen);\n        const atag = new Uint8Array(heap.subarray(pos + rlen, pos + len));\n        let i = rlen;\n        for (; i & 15; i++)\n            heap[pos + i] = 0;\n        asm.mac(AES_asm.MAC.GCM, AES_asm.HEAP_DATA + pos, i);\n        asm.cipher(AES_asm.DEC.CTR, AES_asm.HEAP_DATA + pos, i);\n        if (rlen)\n            result.set(heap.subarray(pos, pos + rlen));\n        const alen = adata !== undefined ? adata.length : 0;\n        const clen = ((counter - 1) << 4) + len - tagSize;\n        heap[0] = 0;\n        heap[1] = 0;\n        heap[2] = 0;\n        heap[3] = alen >>> 29;\n        heap[4] = alen >>> 21;\n        heap[5] = (alen >>> 13) & 255;\n        heap[6] = (alen >>> 5) & 255;\n        heap[7] = (alen << 3) & 255;\n        heap[8] = heap[9] = heap[10] = 0;\n        heap[11] = clen >>> 29;\n        heap[12] = (clen >>> 21) & 255;\n        heap[13] = (clen >>> 13) & 255;\n        heap[14] = (clen >>> 5) & 255;\n        heap[15] = (clen << 3) & 255;\n        asm.mac(AES_asm.MAC.GCM, AES_asm.HEAP_DATA, 16);\n        asm.get_iv(AES_asm.HEAP_DATA);\n        asm.set_counter(0, 0, 0, this.gamma0);\n        asm.cipher(AES_asm.ENC.CTR, AES_asm.HEAP_DATA, 16);\n        let acheck = 0;\n        for (let i = 0; i < tagSize; ++i)\n            acheck |= atag[i] ^ heap[i];\n        if (acheck)\n            throw new SecurityError('data integrity check failed');\n        this.counter = 1;\n        this.aes.pos = 0;\n        this.aes.len = 0;\n        return result;\n    }\n    AES_GCM_decrypt(data) {\n        const result1 = this.AES_GCM_Decrypt_process(data);\n        const result2 = this.AES_GCM_Decrypt_finish();\n        const result = new Uint8Array(result1.length + result2.length);\n        if (result1.length)\n            result.set(result1);\n        if (result2.length)\n            result.set(result2, result1.length);\n        return result;\n    }\n    AES_GCM_encrypt(data) {\n        const result1 = this.AES_GCM_Encrypt_process(data);\n        const result2 = this.AES_GCM_Encrypt_finish();\n        const result = new Uint8Array(result1.length + result2.length);\n        if (result1.length)\n            result.set(result1);\n        if (result2.length)\n            result.set(result2, result1.length);\n        return result;\n    }\n    _gcm_mac_process(data) {\n        let { asm, heap } = this.aes.acquire_asm();\n        let dpos = 0;\n        let dlen = data.length || 0;\n        let wlen = 0;\n        while (dlen > 0) {\n            wlen = _heap_write(heap, 0, data, dpos, dlen);\n            dpos += wlen;\n            dlen -= wlen;\n            while (wlen & 15)\n                heap[wlen++] = 0;\n            asm.mac(AES_asm.MAC.GCM, AES_asm.HEAP_DATA, wlen);\n        }\n    }\n}\n","// OpenPGP.js - An OpenPGP implementation in javascript\n// Copyright (C) 2016 Tankred Hase\n//\n// This library is free software; you can redistribute it and/or\n// modify it under the terms of the GNU Lesser General Public\n// License as published by the Free Software Foundation; either\n// version 3.0 of the License, or (at your option) any later version.\n//\n// This library is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n// Lesser General Public License for more details.\n//\n// You should have received a copy of the GNU Lesser General Public\n// License along with this library; if not, write to the Free Software\n// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n\n/**\n * @fileoverview This module wraps native AES-GCM en/decryption for both\n * the WebCrypto api as well as node.js' crypto api.\n * @module crypto/mode/gcm\n * @private\n */\n\nimport { AES_GCM } from '@openpgp/asmcrypto.js/dist_es8/aes/gcm';\nimport util from '../../util';\nimport enums from '../../enums';\n\nconst webCrypto = util.getWebCrypto();\nconst nodeCrypto = util.getNodeCrypto();\nconst Buffer = util.getNodeBuffer();\n\nconst blockLength = 16;\nconst ivLength = 12; // size of the IV in bytes\nconst tagLength = 16; // size of the tag in bytes\nconst ALGO = 'AES-GCM';\n\n/**\n * Class to en/decrypt using GCM mode.\n * @param {enums.symmetric} cipher - The symmetric cipher algorithm to use\n * @param {Uint8Array} key - The encryption key\n */\nasync function GCM(cipher, key) {\n  if (cipher !== enums.symmetric.aes128 &&\n    cipher !== enums.symmetric.aes192 &&\n    cipher !== enums.symmetric.aes256) {\n    throw new Error('GCM mode supports only AES cipher');\n  }\n\n  if (util.getNodeCrypto()) { // Node crypto library\n    return {\n      encrypt: async function(pt, iv, adata = new Uint8Array()) {\n        const en = new nodeCrypto.createCipheriv('aes-' + (key.length * 8) + '-gcm', key, iv);\n        en.setAAD(adata);\n        const ct = Buffer.concat([en.update(pt), en.final(), en.getAuthTag()]); // append auth tag to ciphertext\n        return new Uint8Array(ct);\n      },\n\n      decrypt: async function(ct, iv, adata = new Uint8Array()) {\n        const de = new nodeCrypto.createDecipheriv('aes-' + (key.length * 8) + '-gcm', key, iv);\n        de.setAAD(adata);\n        de.setAuthTag(ct.slice(ct.length - tagLength, ct.length)); // read auth tag at end of ciphertext\n        const pt = Buffer.concat([de.update(ct.slice(0, ct.length - tagLength)), de.final()]);\n        return new Uint8Array(pt);\n      }\n    };\n  }\n\n  if (util.getWebCrypto() && key.length !== 24) { // WebCrypto (no 192 bit support) see: https://www.chromium.org/blink/webcrypto#TOC-AES-support\n    const _key = await webCrypto.importKey('raw', key, { name: ALGO }, false, ['encrypt', 'decrypt']);\n\n    return {\n      encrypt: async function(pt, iv, adata = new Uint8Array()) {\n        if (!pt.length) { // iOS does not support GCM-en/decrypting empty messages\n          return AES_GCM.encrypt(pt, key, iv, adata);\n        }\n        const ct = await webCrypto.encrypt({ name: ALGO, iv, additionalData: adata, tagLength: tagLength * 8 }, _key, pt);\n        return new Uint8Array(ct);\n      },\n\n      decrypt: async function(ct, iv, adata = new Uint8Array()) {\n        if (ct.length === tagLength) { // iOS does not support GCM-en/decrypting empty messages\n          return AES_GCM.decrypt(ct, key, iv, adata);\n        }\n        const pt = await webCrypto.decrypt({ name: ALGO, iv, additionalData: adata, tagLength: tagLength * 8 }, _key, ct);\n        return new Uint8Array(pt);\n      }\n    };\n  }\n\n  return {\n    encrypt: async function(pt, iv, adata) {\n      return AES_GCM.encrypt(pt, key, iv, adata);\n    },\n\n    decrypt: async function(ct, iv, adata) {\n      return AES_GCM.decrypt(ct, key, iv, adata);\n    }\n  };\n}\n\n\n/**\n * Get GCM nonce. Note: this operation is not defined by the standard.\n * A future version of the standard may define GCM mode differently,\n * hopefully under a different ID (we use Private/Experimental algorithm\n * ID 100) so that we can maintain backwards compatibility.\n * @param {Uint8Array} iv - The initialization vector (12 bytes)\n * @param {Uint8Array} chunkIndex - The chunk index (8 bytes)\n */\nGCM.getNonce = function(iv, chunkIndex) {\n  const nonce = iv.slice();\n  for (let i = 0; i < chunkIndex.length; i++) {\n    nonce[4 + i] ^= chunkIndex[i];\n  }\n  return nonce;\n};\n\nGCM.blockLength = blockLength;\nGCM.ivLength = ivLength;\nGCM.tagLength = tagLength;\n\nexport default GCM;\n","/**\n * @fileoverview Cipher modes\n * @module crypto/mode\n * @private\n */\n\nimport * as cfb from './cfb';\nimport eax from './eax';\nimport ocb from './ocb';\nimport gcm from './gcm';\n\nexport default {\n  /** @see module:crypto/mode/cfb */\n  cfb: cfb,\n  /** @see module:crypto/mode/gcm */\n  gcm: gcm,\n  experimentalGCM: gcm,\n  /** @see module:crypto/mode/eax */\n  eax: eax,\n  /** @see module:crypto/mode/ocb */\n  ocb: ocb\n};\n","/*jshint bitwise: false*/\n\n(function(nacl) {\n'use strict';\n\n// Ported in 2014 by Dmitry Chestnykh and Devi Mandiri.\n// Public domain.\n//\n// Implementation derived from TweetNaCl version 20140427.\n// See for details: http://tweetnacl.cr.yp.to/\n\nvar gf = function(init) {\n  var i, r = new Float64Array(16);\n  if (init) for (i = 0; i < init.length; i++) r[i] = init[i];\n  return r;\n};\n\n//  Pluggable, initialized in high-level API below.\nvar randombytes = function(/* x, n */) { throw new Error('no PRNG'); };\n\nvar _9 = new Uint8Array(32); _9[0] = 9;\n\nvar gf0 = gf(),\n    gf1 = gf([1]),\n    _121665 = gf([0xdb41, 1]),\n    D = gf([0x78a3, 0x1359, 0x4dca, 0x75eb, 0xd8ab, 0x4141, 0x0a4d, 0x0070, 0xe898, 0x7779, 0x4079, 0x8cc7, 0xfe73, 0x2b6f, 0x6cee, 0x5203]),\n    D2 = gf([0xf159, 0x26b2, 0x9b94, 0xebd6, 0xb156, 0x8283, 0x149a, 0x00e0, 0xd130, 0xeef3, 0x80f2, 0x198e, 0xfce7, 0x56df, 0xd9dc, 0x2406]),\n    X = gf([0xd51a, 0x8f25, 0x2d60, 0xc956, 0xa7b2, 0x9525, 0xc760, 0x692c, 0xdc5c, 0xfdd6, 0xe231, 0xc0a4, 0x53fe, 0xcd6e, 0x36d3, 0x2169]),\n    Y = gf([0x6658, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666]),\n    I = gf([0xa0b0, 0x4a0e, 0x1b27, 0xc4ee, 0xe478, 0xad2f, 0x1806, 0x2f43, 0xd7a7, 0x3dfb, 0x0099, 0x2b4d, 0xdf0b, 0x4fc1, 0x2480, 0x2b83]);\n\nfunction vn(x, xi, y, yi, n) {\n  var i,d = 0;\n  for (i = 0; i < n; i++) d |= x[xi+i]^y[yi+i];\n  return (1 & ((d - 1) >>> 8)) - 1;\n}\n\nfunction crypto_verify_32(x, xi, y, yi) {\n  return vn(x,xi,y,yi,32);\n}\n\nfunction set25519(r, a) {\n  var i;\n  for (i = 0; i < 16; i++) r[i] = a[i]|0;\n}\n\nfunction car25519(o) {\n  var i, v, c = 1;\n  for (i = 0; i < 16; i++) {\n    v = o[i] + c + 65535;\n    c = Math.floor(v / 65536);\n    o[i] = v - c * 65536;\n  }\n  o[0] += c-1 + 37 * (c-1);\n}\n\nfunction sel25519(p, q, b) {\n  var t, c = ~(b-1);\n  for (var i = 0; i < 16; i++) {\n    t = c & (p[i] ^ q[i]);\n    p[i] ^= t;\n    q[i] ^= t;\n  }\n}\n\nfunction pack25519(o, n) {\n  var i, j, b;\n  var m = gf(), t = gf();\n  for (i = 0; i < 16; i++) t[i] = n[i];\n  car25519(t);\n  car25519(t);\n  car25519(t);\n  for (j = 0; j < 2; j++) {\n    m[0] = t[0] - 0xffed;\n    for (i = 1; i < 15; i++) {\n      m[i] = t[i] - 0xffff - ((m[i-1]>>16) & 1);\n      m[i-1] &= 0xffff;\n    }\n    m[15] = t[15] - 0x7fff - ((m[14]>>16) & 1);\n    b = (m[15]>>16) & 1;\n    m[14] &= 0xffff;\n    sel25519(t, m, 1-b);\n  }\n  for (i = 0; i < 16; i++) {\n    o[2*i] = t[i] & 0xff;\n    o[2*i+1] = t[i]>>8;\n  }\n}\n\nfunction neq25519(a, b) {\n  var c = new Uint8Array(32), d = new Uint8Array(32);\n  pack25519(c, a);\n  pack25519(d, b);\n  return crypto_verify_32(c, 0, d, 0);\n}\n\nfunction par25519(a) {\n  var d = new Uint8Array(32);\n  pack25519(d, a);\n  return d[0] & 1;\n}\n\nfunction unpack25519(o, n) {\n  var i;\n  for (i = 0; i < 16; i++) o[i] = n[2*i] + (n[2*i+1] << 8);\n  o[15] &= 0x7fff;\n}\n\nfunction A(o, a, b) {\n  for (var i = 0; i < 16; i++) o[i] = a[i] + b[i];\n}\n\nfunction Z(o, a, b) {\n  for (var i = 0; i < 16; i++) o[i] = a[i] - b[i];\n}\n\nfunction M(o, a, b) {\n  var v, c,\n     t0 = 0,  t1 = 0,  t2 = 0,  t3 = 0,  t4 = 0,  t5 = 0,  t6 = 0,  t7 = 0,\n     t8 = 0,  t9 = 0, t10 = 0, t11 = 0, t12 = 0, t13 = 0, t14 = 0, t15 = 0,\n    t16 = 0, t17 = 0, t18 = 0, t19 = 0, t20 = 0, t21 = 0, t22 = 0, t23 = 0,\n    t24 = 0, t25 = 0, t26 = 0, t27 = 0, t28 = 0, t29 = 0, t30 = 0,\n    b0 = b[0],\n    b1 = b[1],\n    b2 = b[2],\n    b3 = b[3],\n    b4 = b[4],\n    b5 = b[5],\n    b6 = b[6],\n    b7 = b[7],\n    b8 = b[8],\n    b9 = b[9],\n    b10 = b[10],\n    b11 = b[11],\n    b12 = b[12],\n    b13 = b[13],\n    b14 = b[14],\n    b15 = b[15];\n\n  v = a[0];\n  t0 += v * b0;\n  t1 += v * b1;\n  t2 += v * b2;\n  t3 += v * b3;\n  t4 += v * b4;\n  t5 += v * b5;\n  t6 += v * b6;\n  t7 += v * b7;\n  t8 += v * b8;\n  t9 += v * b9;\n  t10 += v * b10;\n  t11 += v * b11;\n  t12 += v * b12;\n  t13 += v * b13;\n  t14 += v * b14;\n  t15 += v * b15;\n  v = a[1];\n  t1 += v * b0;\n  t2 += v * b1;\n  t3 += v * b2;\n  t4 += v * b3;\n  t5 += v * b4;\n  t6 += v * b5;\n  t7 += v * b6;\n  t8 += v * b7;\n  t9 += v * b8;\n  t10 += v * b9;\n  t11 += v * b10;\n  t12 += v * b11;\n  t13 += v * b12;\n  t14 += v * b13;\n  t15 += v * b14;\n  t16 += v * b15;\n  v = a[2];\n  t2 += v * b0;\n  t3 += v * b1;\n  t4 += v * b2;\n  t5 += v * b3;\n  t6 += v * b4;\n  t7 += v * b5;\n  t8 += v * b6;\n  t9 += v * b7;\n  t10 += v * b8;\n  t11 += v * b9;\n  t12 += v * b10;\n  t13 += v * b11;\n  t14 += v * b12;\n  t15 += v * b13;\n  t16 += v * b14;\n  t17 += v * b15;\n  v = a[3];\n  t3 += v * b0;\n  t4 += v * b1;\n  t5 += v * b2;\n  t6 += v * b3;\n  t7 += v * b4;\n  t8 += v * b5;\n  t9 += v * b6;\n  t10 += v * b7;\n  t11 += v * b8;\n  t12 += v * b9;\n  t13 += v * b10;\n  t14 += v * b11;\n  t15 += v * b12;\n  t16 += v * b13;\n  t17 += v * b14;\n  t18 += v * b15;\n  v = a[4];\n  t4 += v * b0;\n  t5 += v * b1;\n  t6 += v * b2;\n  t7 += v * b3;\n  t8 += v * b4;\n  t9 += v * b5;\n  t10 += v * b6;\n  t11 += v * b7;\n  t12 += v * b8;\n  t13 += v * b9;\n  t14 += v * b10;\n  t15 += v * b11;\n  t16 += v * b12;\n  t17 += v * b13;\n  t18 += v * b14;\n  t19 += v * b15;\n  v = a[5];\n  t5 += v * b0;\n  t6 += v * b1;\n  t7 += v * b2;\n  t8 += v * b3;\n  t9 += v * b4;\n  t10 += v * b5;\n  t11 += v * b6;\n  t12 += v * b7;\n  t13 += v * b8;\n  t14 += v * b9;\n  t15 += v * b10;\n  t16 += v * b11;\n  t17 += v * b12;\n  t18 += v * b13;\n  t19 += v * b14;\n  t20 += v * b15;\n  v = a[6];\n  t6 += v * b0;\n  t7 += v * b1;\n  t8 += v * b2;\n  t9 += v * b3;\n  t10 += v * b4;\n  t11 += v * b5;\n  t12 += v * b6;\n  t13 += v * b7;\n  t14 += v * b8;\n  t15 += v * b9;\n  t16 += v * b10;\n  t17 += v * b11;\n  t18 += v * b12;\n  t19 += v * b13;\n  t20 += v * b14;\n  t21 += v * b15;\n  v = a[7];\n  t7 += v * b0;\n  t8 += v * b1;\n  t9 += v * b2;\n  t10 += v * b3;\n  t11 += v * b4;\n  t12 += v * b5;\n  t13 += v * b6;\n  t14 += v * b7;\n  t15 += v * b8;\n  t16 += v * b9;\n  t17 += v * b10;\n  t18 += v * b11;\n  t19 += v * b12;\n  t20 += v * b13;\n  t21 += v * b14;\n  t22 += v * b15;\n  v = a[8];\n  t8 += v * b0;\n  t9 += v * b1;\n  t10 += v * b2;\n  t11 += v * b3;\n  t12 += v * b4;\n  t13 += v * b5;\n  t14 += v * b6;\n  t15 += v * b7;\n  t16 += v * b8;\n  t17 += v * b9;\n  t18 += v * b10;\n  t19 += v * b11;\n  t20 += v * b12;\n  t21 += v * b13;\n  t22 += v * b14;\n  t23 += v * b15;\n  v = a[9];\n  t9 += v * b0;\n  t10 += v * b1;\n  t11 += v * b2;\n  t12 += v * b3;\n  t13 += v * b4;\n  t14 += v * b5;\n  t15 += v * b6;\n  t16 += v * b7;\n  t17 += v * b8;\n  t18 += v * b9;\n  t19 += v * b10;\n  t20 += v * b11;\n  t21 += v * b12;\n  t22 += v * b13;\n  t23 += v * b14;\n  t24 += v * b15;\n  v = a[10];\n  t10 += v * b0;\n  t11 += v * b1;\n  t12 += v * b2;\n  t13 += v * b3;\n  t14 += v * b4;\n  t15 += v * b5;\n  t16 += v * b6;\n  t17 += v * b7;\n  t18 += v * b8;\n  t19 += v * b9;\n  t20 += v * b10;\n  t21 += v * b11;\n  t22 += v * b12;\n  t23 += v * b13;\n  t24 += v * b14;\n  t25 += v * b15;\n  v = a[11];\n  t11 += v * b0;\n  t12 += v * b1;\n  t13 += v * b2;\n  t14 += v * b3;\n  t15 += v * b4;\n  t16 += v * b5;\n  t17 += v * b6;\n  t18 += v * b7;\n  t19 += v * b8;\n  t20 += v * b9;\n  t21 += v * b10;\n  t22 += v * b11;\n  t23 += v * b12;\n  t24 += v * b13;\n  t25 += v * b14;\n  t26 += v * b15;\n  v = a[12];\n  t12 += v * b0;\n  t13 += v * b1;\n  t14 += v * b2;\n  t15 += v * b3;\n  t16 += v * b4;\n  t17 += v * b5;\n  t18 += v * b6;\n  t19 += v * b7;\n  t20 += v * b8;\n  t21 += v * b9;\n  t22 += v * b10;\n  t23 += v * b11;\n  t24 += v * b12;\n  t25 += v * b13;\n  t26 += v * b14;\n  t27 += v * b15;\n  v = a[13];\n  t13 += v * b0;\n  t14 += v * b1;\n  t15 += v * b2;\n  t16 += v * b3;\n  t17 += v * b4;\n  t18 += v * b5;\n  t19 += v * b6;\n  t20 += v * b7;\n  t21 += v * b8;\n  t22 += v * b9;\n  t23 += v * b10;\n  t24 += v * b11;\n  t25 += v * b12;\n  t26 += v * b13;\n  t27 += v * b14;\n  t28 += v * b15;\n  v = a[14];\n  t14 += v * b0;\n  t15 += v * b1;\n  t16 += v * b2;\n  t17 += v * b3;\n  t18 += v * b4;\n  t19 += v * b5;\n  t20 += v * b6;\n  t21 += v * b7;\n  t22 += v * b8;\n  t23 += v * b9;\n  t24 += v * b10;\n  t25 += v * b11;\n  t26 += v * b12;\n  t27 += v * b13;\n  t28 += v * b14;\n  t29 += v * b15;\n  v = a[15];\n  t15 += v * b0;\n  t16 += v * b1;\n  t17 += v * b2;\n  t18 += v * b3;\n  t19 += v * b4;\n  t20 += v * b5;\n  t21 += v * b6;\n  t22 += v * b7;\n  t23 += v * b8;\n  t24 += v * b9;\n  t25 += v * b10;\n  t26 += v * b11;\n  t27 += v * b12;\n  t28 += v * b13;\n  t29 += v * b14;\n  t30 += v * b15;\n\n  t0  += 38 * t16;\n  t1  += 38 * t17;\n  t2  += 38 * t18;\n  t3  += 38 * t19;\n  t4  += 38 * t20;\n  t5  += 38 * t21;\n  t6  += 38 * t22;\n  t7  += 38 * t23;\n  t8  += 38 * t24;\n  t9  += 38 * t25;\n  t10 += 38 * t26;\n  t11 += 38 * t27;\n  t12 += 38 * t28;\n  t13 += 38 * t29;\n  t14 += 38 * t30;\n  // t15 left as is\n\n  // first car\n  c = 1;\n  v =  t0 + c + 65535; c = Math.floor(v / 65536);  t0 = v - c * 65536;\n  v =  t1 + c + 65535; c = Math.floor(v / 65536);  t1 = v - c * 65536;\n  v =  t2 + c + 65535; c = Math.floor(v / 65536);  t2 = v - c * 65536;\n  v =  t3 + c + 65535; c = Math.floor(v / 65536);  t3 = v - c * 65536;\n  v =  t4 + c + 65535; c = Math.floor(v / 65536);  t4 = v - c * 65536;\n  v =  t5 + c + 65535; c = Math.floor(v / 65536);  t5 = v - c * 65536;\n  v =  t6 + c + 65535; c = Math.floor(v / 65536);  t6 = v - c * 65536;\n  v =  t7 + c + 65535; c = Math.floor(v / 65536);  t7 = v - c * 65536;\n  v =  t8 + c + 65535; c = Math.floor(v / 65536);  t8 = v - c * 65536;\n  v =  t9 + c + 65535; c = Math.floor(v / 65536);  t9 = v - c * 65536;\n  v = t10 + c + 65535; c = Math.floor(v / 65536); t10 = v - c * 65536;\n  v = t11 + c + 65535; c = Math.floor(v / 65536); t11 = v - c * 65536;\n  v = t12 + c + 65535; c = Math.floor(v / 65536); t12 = v - c * 65536;\n  v = t13 + c + 65535; c = Math.floor(v / 65536); t13 = v - c * 65536;\n  v = t14 + c + 65535; c = Math.floor(v / 65536); t14 = v - c * 65536;\n  v = t15 + c + 65535; c = Math.floor(v / 65536); t15 = v - c * 65536;\n  t0 += c-1 + 37 * (c-1);\n\n  // second car\n  c = 1;\n  v =  t0 + c + 65535; c = Math.floor(v / 65536);  t0 = v - c * 65536;\n  v =  t1 + c + 65535; c = Math.floor(v / 65536);  t1 = v - c * 65536;\n  v =  t2 + c + 65535; c = Math.floor(v / 65536);  t2 = v - c * 65536;\n  v =  t3 + c + 65535; c = Math.floor(v / 65536);  t3 = v - c * 65536;\n  v =  t4 + c + 65535; c = Math.floor(v / 65536);  t4 = v - c * 65536;\n  v =  t5 + c + 65535; c = Math.floor(v / 65536);  t5 = v - c * 65536;\n  v =  t6 + c + 65535; c = Math.floor(v / 65536);  t6 = v - c * 65536;\n  v =  t7 + c + 65535; c = Math.floor(v / 65536);  t7 = v - c * 65536;\n  v =  t8 + c + 65535; c = Math.floor(v / 65536);  t8 = v - c * 65536;\n  v =  t9 + c + 65535; c = Math.floor(v / 65536);  t9 = v - c * 65536;\n  v = t10 + c + 65535; c = Math.floor(v / 65536); t10 = v - c * 65536;\n  v = t11 + c + 65535; c = Math.floor(v / 65536); t11 = v - c * 65536;\n  v = t12 + c + 65535; c = Math.floor(v / 65536); t12 = v - c * 65536;\n  v = t13 + c + 65535; c = Math.floor(v / 65536); t13 = v - c * 65536;\n  v = t14 + c + 65535; c = Math.floor(v / 65536); t14 = v - c * 65536;\n  v = t15 + c + 65535; c = Math.floor(v / 65536); t15 = v - c * 65536;\n  t0 += c-1 + 37 * (c-1);\n\n  o[ 0] = t0;\n  o[ 1] = t1;\n  o[ 2] = t2;\n  o[ 3] = t3;\n  o[ 4] = t4;\n  o[ 5] = t5;\n  o[ 6] = t6;\n  o[ 7] = t7;\n  o[ 8] = t8;\n  o[ 9] = t9;\n  o[10] = t10;\n  o[11] = t11;\n  o[12] = t12;\n  o[13] = t13;\n  o[14] = t14;\n  o[15] = t15;\n}\n\nfunction S(o, a) {\n  M(o, a, a);\n}\n\nfunction inv25519(o, i) {\n  var c = gf();\n  var a;\n  for (a = 0; a < 16; a++) c[a] = i[a];\n  for (a = 253; a >= 0; a--) {\n    S(c, c);\n    if(a !== 2 && a !== 4) M(c, c, i);\n  }\n  for (a = 0; a < 16; a++) o[a] = c[a];\n}\n\nfunction pow2523(o, i) {\n  var c = gf();\n  var a;\n  for (a = 0; a < 16; a++) c[a] = i[a];\n  for (a = 250; a >= 0; a--) {\n      S(c, c);\n      if(a !== 1) M(c, c, i);\n  }\n  for (a = 0; a < 16; a++) o[a] = c[a];\n}\n\nfunction crypto_scalarmult(q, n, p) {\n  var z = new Uint8Array(32);\n  var x = new Float64Array(80), r, i;\n  var a = gf(), b = gf(), c = gf(),\n      d = gf(), e = gf(), f = gf();\n  for (i = 0; i < 31; i++) z[i] = n[i];\n  z[31]=(n[31]&127)|64;\n  z[0]&=248;\n  unpack25519(x,p);\n  for (i = 0; i < 16; i++) {\n    b[i]=x[i];\n    d[i]=a[i]=c[i]=0;\n  }\n  a[0]=d[0]=1;\n  for (i=254; i>=0; --i) {\n    r=(z[i>>>3]>>>(i&7))&1;\n    sel25519(a,b,r);\n    sel25519(c,d,r);\n    A(e,a,c);\n    Z(a,a,c);\n    A(c,b,d);\n    Z(b,b,d);\n    S(d,e);\n    S(f,a);\n    M(a,c,a);\n    M(c,b,e);\n    A(e,a,c);\n    Z(a,a,c);\n    S(b,a);\n    Z(c,d,f);\n    M(a,c,_121665);\n    A(a,a,d);\n    M(c,c,a);\n    M(a,d,f);\n    M(d,b,x);\n    S(b,e);\n    sel25519(a,b,r);\n    sel25519(c,d,r);\n  }\n  for (i = 0; i < 16; i++) {\n    x[i+16]=a[i];\n    x[i+32]=c[i];\n    x[i+48]=b[i];\n    x[i+64]=d[i];\n  }\n  var x32 = x.subarray(32);\n  var x16 = x.subarray(16);\n  inv25519(x32,x32);\n  M(x16,x16,x32);\n  pack25519(q,x16);\n  return 0;\n}\n\nfunction crypto_scalarmult_base(q, n) {\n  return crypto_scalarmult(q, n, _9);\n}\n\nfunction crypto_box_keypair(y, x) {\n  randombytes(x, 32);\n  return crypto_scalarmult_base(y, x);\n}\n\nfunction add(p, q) {\n  var a = gf(), b = gf(), c = gf(),\n      d = gf(), e = gf(), f = gf(),\n      g = gf(), h = gf(), t = gf();\n\n  Z(a, p[1], p[0]);\n  Z(t, q[1], q[0]);\n  M(a, a, t);\n  A(b, p[0], p[1]);\n  A(t, q[0], q[1]);\n  M(b, b, t);\n  M(c, p[3], q[3]);\n  M(c, c, D2);\n  M(d, p[2], q[2]);\n  A(d, d, d);\n  Z(e, b, a);\n  Z(f, d, c);\n  A(g, d, c);\n  A(h, b, a);\n\n  M(p[0], e, f);\n  M(p[1], h, g);\n  M(p[2], g, f);\n  M(p[3], e, h);\n}\n\nfunction cswap(p, q, b) {\n  var i;\n  for (i = 0; i < 4; i++) {\n    sel25519(p[i], q[i], b);\n  }\n}\n\nfunction pack(r, p) {\n  var tx = gf(), ty = gf(), zi = gf();\n  inv25519(zi, p[2]);\n  M(tx, p[0], zi);\n  M(ty, p[1], zi);\n  pack25519(r, ty);\n  r[31] ^= par25519(tx) << 7;\n}\n\nfunction scalarmult(p, q, s) {\n  var b, i;\n  set25519(p[0], gf0);\n  set25519(p[1], gf1);\n  set25519(p[2], gf1);\n  set25519(p[3], gf0);\n  for (i = 255; i >= 0; --i) {\n    b = (s[(i/8)|0] >> (i&7)) & 1;\n    cswap(p, q, b);\n    add(q, p);\n    add(p, p);\n    cswap(p, q, b);\n  }\n}\n\nfunction scalarbase(p, s) {\n  var q = [gf(), gf(), gf(), gf()];\n  set25519(q[0], X);\n  set25519(q[1], Y);\n  set25519(q[2], gf1);\n  M(q[3], X, Y);\n  scalarmult(p, q, s);\n}\n\nfunction crypto_sign_keypair(pk, sk, seeded) {\n  var d;\n  var p = [gf(), gf(), gf(), gf()];\n  var i;\n\n  if (!seeded) randombytes(sk, 32);\n  d = nacl.hash(sk.subarray(0, 32));\n  d[0] &= 248;\n  d[31] &= 127;\n  d[31] |= 64;\n\n  scalarbase(p, d);\n  pack(pk, p);\n\n  for (i = 0; i < 32; i++) sk[i+32] = pk[i];\n  return 0;\n}\n\nvar L = new Float64Array([0xed, 0xd3, 0xf5, 0x5c, 0x1a, 0x63, 0x12, 0x58, 0xd6, 0x9c, 0xf7, 0xa2, 0xde, 0xf9, 0xde, 0x14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x10]);\n\nfunction modL(r, x) {\n  var carry, i, j, k;\n  for (i = 63; i >= 32; --i) {\n    carry = 0;\n    for (j = i - 32, k = i - 12; j < k; ++j) {\n      x[j] += carry - 16 * x[i] * L[j - (i - 32)];\n      carry = Math.floor((x[j] + 128) / 256);\n      x[j] -= carry * 256;\n    }\n    x[j] += carry;\n    x[i] = 0;\n  }\n  carry = 0;\n  for (j = 0; j < 32; j++) {\n    x[j] += carry - (x[31] >> 4) * L[j];\n    carry = x[j] >> 8;\n    x[j] &= 255;\n  }\n  for (j = 0; j < 32; j++) x[j] -= carry * L[j];\n  for (i = 0; i < 32; i++) {\n    x[i+1] += x[i] >> 8;\n    r[i] = x[i] & 255;\n  }\n}\n\nfunction reduce(r) {\n  var x = new Float64Array(64), i;\n  for (i = 0; i < 64; i++) x[i] = r[i];\n  for (i = 0; i < 64; i++) r[i] = 0;\n  modL(r, x);\n}\n\n// Note: difference from C - smlen returned, not passed as argument.\nfunction crypto_sign(sm, m, n, sk) {\n  var d, h, r;\n  var i, j, x = new Float64Array(64);\n  var p = [gf(), gf(), gf(), gf()];\n\n  d = nacl.hash(sk.subarray(0, 32));\n  d[0] &= 248;\n  d[31] &= 127;\n  d[31] |= 64;\n\n  var smlen = n + 64;\n  for (i = 0; i < n; i++) sm[64 + i] = m[i];\n  for (i = 0; i < 32; i++) sm[32 + i] = d[32 + i];\n\n  r = nacl.hash(sm.subarray(32, smlen));\n  reduce(r);\n  scalarbase(p, r);\n  pack(sm, p);\n\n  for (i = 32; i < 64; i++) sm[i] = sk[i];\n  h = nacl.hash(sm.subarray(0, smlen));\n  reduce(h);\n\n  for (i = 0; i < 64; i++) x[i] = 0;\n  for (i = 0; i < 32; i++) x[i] = r[i];\n  for (i = 0; i < 32; i++) {\n    for (j = 0; j < 32; j++) {\n      x[i+j] += h[i] * d[j];\n    }\n  }\n\n  modL(sm.subarray(32), x);\n  return smlen;\n}\n\nfunction unpackneg(r, p) {\n  var t = gf(), chk = gf(), num = gf(),\n      den = gf(), den2 = gf(), den4 = gf(),\n      den6 = gf();\n\n  set25519(r[2], gf1);\n  unpack25519(r[1], p);\n  S(num, r[1]);\n  M(den, num, D);\n  Z(num, num, r[2]);\n  A(den, r[2], den);\n\n  S(den2, den);\n  S(den4, den2);\n  M(den6, den4, den2);\n  M(t, den6, num);\n  M(t, t, den);\n\n  pow2523(t, t);\n  M(t, t, num);\n  M(t, t, den);\n  M(t, t, den);\n  M(r[0], t, den);\n\n  S(chk, r[0]);\n  M(chk, chk, den);\n  if (neq25519(chk, num)) M(r[0], r[0], I);\n\n  S(chk, r[0]);\n  M(chk, chk, den);\n  if (neq25519(chk, num)) return -1;\n\n  if (par25519(r[0]) === (p[31]>>7)) Z(r[0], gf0, r[0]);\n\n  M(r[3], r[0], r[1]);\n  return 0;\n}\n\nfunction crypto_sign_open(m, sm, n, pk) {\n  var i;\n  var t = new Uint8Array(32), h;\n  var p = [gf(), gf(), gf(), gf()],\n      q = [gf(), gf(), gf(), gf()];\n\n  if (n < 64) return -1;\n\n  if (unpackneg(q, pk)) return -1;\n\n  for (i = 0; i < n; i++) m[i] = sm[i];\n  for (i = 0; i < 32; i++) m[i+32] = pk[i];\n  h = nacl.hash(m.subarray(0, n));\n  reduce(h);\n  scalarmult(p, q, h);\n\n  scalarbase(q, sm.subarray(32));\n  add(p, q);\n  pack(t, p);\n\n  n -= 64;\n  if (crypto_verify_32(sm, 0, t, 0)) {\n    for (i = 0; i < n; i++) m[i] = 0;\n    return -1;\n  }\n\n  for (i = 0; i < n; i++) m[i] = sm[i + 64];\n  return n;\n}\n\nvar crypto_scalarmult_BYTES = 32,\n    crypto_scalarmult_SCALARBYTES = 32,\n    crypto_box_PUBLICKEYBYTES = 32,\n    crypto_box_SECRETKEYBYTES = 32,\n    crypto_sign_BYTES = 64,\n    crypto_sign_PUBLICKEYBYTES = 32,\n    crypto_sign_SECRETKEYBYTES = 64,\n    crypto_sign_SEEDBYTES = 32;\n\nfunction checkArrayTypes() {\n  for (var i = 0; i < arguments.length; i++) {\n    if (!(arguments[i] instanceof Uint8Array))\n      throw new TypeError('unexpected type, use Uint8Array');\n  }\n}\n\nfunction cleanup(arr) {\n  for (var i = 0; i < arr.length; i++) arr[i] = 0;\n}\n\nnacl.scalarMult = function(n, p) {\n  checkArrayTypes(n, p);\n  if (n.length !== crypto_scalarmult_SCALARBYTES) throw new Error('bad n size');\n  if (p.length !== crypto_scalarmult_BYTES) throw new Error('bad p size');\n  var q = new Uint8Array(crypto_scalarmult_BYTES);\n  crypto_scalarmult(q, n, p);\n  return q;\n};\n\nnacl.box = {};\n\nnacl.box.keyPair = function() {\n  var pk = new Uint8Array(crypto_box_PUBLICKEYBYTES);\n  var sk = new Uint8Array(crypto_box_SECRETKEYBYTES);\n  crypto_box_keypair(pk, sk);\n  return {publicKey: pk, secretKey: sk};\n};\n\nnacl.box.keyPair.fromSecretKey = function(secretKey) {\n  checkArrayTypes(secretKey);\n  if (secretKey.length !== crypto_box_SECRETKEYBYTES)\n    throw new Error('bad secret key size');\n  var pk = new Uint8Array(crypto_box_PUBLICKEYBYTES);\n  crypto_scalarmult_base(pk, secretKey);\n  return {publicKey: pk, secretKey: new Uint8Array(secretKey)};\n};\n\nnacl.sign = function(msg, secretKey) {\n  checkArrayTypes(msg, secretKey);\n  if (secretKey.length !== crypto_sign_SECRETKEYBYTES)\n    throw new Error('bad secret key size');\n  var signedMsg = new Uint8Array(crypto_sign_BYTES+msg.length);\n  crypto_sign(signedMsg, msg, msg.length, secretKey);\n  return signedMsg;\n};\n\nnacl.sign.detached = function(msg, secretKey) {\n  var signedMsg = nacl.sign(msg, secretKey);\n  var sig = new Uint8Array(crypto_sign_BYTES);\n  for (var i = 0; i < sig.length; i++) sig[i] = signedMsg[i];\n  return sig;\n};\n\nnacl.sign.detached.verify = function(msg, sig, publicKey) {\n  checkArrayTypes(msg, sig, publicKey);\n  if (sig.length !== crypto_sign_BYTES)\n    throw new Error('bad signature size');\n  if (publicKey.length !== crypto_sign_PUBLICKEYBYTES)\n    throw new Error('bad public key size');\n  var sm = new Uint8Array(crypto_sign_BYTES + msg.length);\n  var m = new Uint8Array(crypto_sign_BYTES + msg.length);\n  var i;\n  for (i = 0; i < crypto_sign_BYTES; i++) sm[i] = sig[i];\n  for (i = 0; i < msg.length; i++) sm[i+crypto_sign_BYTES] = msg[i];\n  return (crypto_sign_open(m, sm, sm.length, publicKey) >= 0);\n};\n\nnacl.sign.keyPair = function() {\n  var pk = new Uint8Array(crypto_sign_PUBLICKEYBYTES);\n  var sk = new Uint8Array(crypto_sign_SECRETKEYBYTES);\n  crypto_sign_keypair(pk, sk);\n  return {publicKey: pk, secretKey: sk};\n};\n\nnacl.sign.keyPair.fromSecretKey = function(secretKey) {\n  checkArrayTypes(secretKey);\n  if (secretKey.length !== crypto_sign_SECRETKEYBYTES)\n    throw new Error('bad secret key size');\n  var pk = new Uint8Array(crypto_sign_PUBLICKEYBYTES);\n  for (var i = 0; i < pk.length; i++) pk[i] = secretKey[32+i];\n  return {publicKey: pk, secretKey: new Uint8Array(secretKey)};\n};\n\nnacl.sign.keyPair.fromSeed = function(seed) {\n  checkArrayTypes(seed);\n  if (seed.length !== crypto_sign_SEEDBYTES)\n    throw new Error('bad seed size');\n  var pk = new Uint8Array(crypto_sign_PUBLICKEYBYTES);\n  var sk = new Uint8Array(crypto_sign_SECRETKEYBYTES);\n  for (var i = 0; i < 32; i++) sk[i] = seed[i];\n  crypto_sign_keypair(pk, sk, true);\n  return {publicKey: pk, secretKey: sk};\n};\n\nnacl.setPRNG = function(fn) {\n  randombytes = fn;\n};\n\n(function() {\n  // Initialize PRNG if environment provides CSPRNG.\n  // If not, methods calling randombytes will throw.\n  var crypto = typeof self !== 'undefined' ? (self.crypto || self.msCrypto) : null;\n  if (crypto && crypto.getRandomValues) {\n    // Browsers.\n    var QUOTA = 65536;\n    nacl.setPRNG(function(x, n) {\n      var i, v = new Uint8Array(n);\n      for (i = 0; i < n; i += QUOTA) {\n        crypto.getRandomValues(v.subarray(i, i + Math.min(n - i, QUOTA)));\n      }\n      for (i = 0; i < n; i++) x[i] = v[i];\n      cleanup(v);\n    });\n  } else if (typeof require !== 'undefined') {\n    // Node.js.\n    crypto = require('crypto');\n    if (crypto && crypto.randomBytes) {\n      nacl.setPRNG(function(x, n) {\n        var i, v = crypto.randomBytes(n);\n        for (i = 0; i < n; i++) x[i] = v[i];\n        cleanup(v);\n      });\n    }\n  }\n})();\n\n})(typeof module !== 'undefined' && module.exports ? module.exports : (self.nacl = self.nacl || {}));\n","// GPG4Browsers - An OpenPGP implementation in javascript\n// Copyright (C) 2011 Recurity Labs GmbH\n//\n// This library is free software; you can redistribute it and/or\n// modify it under the terms of the GNU Lesser General Public\n// License as published by the Free Software Foundation; either\n// version 3.0 of the License, or (at your option) any later version.\n//\n// This library is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n// Lesser General Public License for more details.\n//\n// You should have received a copy of the GNU Lesser General Public\n// License along with this library; if not, write to the Free Software\n// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n\n// The GPG4Browsers crypto interface\n\n/**\n * @fileoverview Provides tools for retrieving secure randomness from browsers or Node.js\n * @module crypto/random\n * @private\n */\nimport util from '../util';\n\nconst nodeCrypto = util.getNodeCrypto();\n\n/**\n * Retrieve secure random byte array of the specified length\n * @param {Integer} length - Length in bytes to generate\n * @returns {Uint8Array} Random byte array.\n */\nexport function getRandomBytes(length) {\n  const buf = new Uint8Array(length);\n  if (nodeCrypto) {\n    const bytes = nodeCrypto.randomBytes(buf.length);\n    buf.set(bytes);\n  } else if (typeof crypto !== 'undefined' && crypto.getRandomValues) {\n    crypto.getRandomValues(buf);\n  } else {\n    throw new Error('No secure random number generator available.');\n  }\n  return buf;\n}\n\n/**\n * Create a secure random BigInteger that is greater than or equal to min and less than max.\n * @param {module:BigInteger} min - Lower bound, included\n * @param {module:BigInteger} max - Upper bound, excluded\n * @returns {Promise<module:BigInteger>} Random BigInteger.\n * @async\n */\nexport async function getRandomBigInteger(min, max) {\n  const BigInteger = await util.getBigInteger();\n\n  if (max.lt(min)) {\n    throw new Error('Illegal parameter value: max <= min');\n  }\n\n  const modulus = max.sub(min);\n  const bytes = modulus.byteLength();\n\n  // Using a while loop is necessary to avoid bias introduced by the mod operation.\n  // However, we request 64 extra random bits so that the bias is negligible.\n  // Section B.1.1 here: https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.186-4.pdf\n  const r = new BigInteger(await getRandomBytes(bytes + 8));\n  return r.mod(modulus).add(min);\n}\n","// OpenPGP.js - An OpenPGP implementation in javascript\n// Copyright (C) 2018 Proton Technologies AG\n//\n// This library is free software; you can redistribute it and/or\n// modify it under the terms of the GNU Lesser General Public\n// License as published by the Free Software Foundation; either\n// version 3.0 of the License, or (at your option) any later version.\n//\n// This library is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n// Lesser General Public License for more details.\n//\n// You should have received a copy of the GNU Lesser General Public\n// License along with this library; if not, write to the Free Software\n// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n\n/**\n * @fileoverview Algorithms for probabilistic random prime generation\n * @module crypto/public_key/prime\n * @private\n */\n\nimport util from '../../util';\nimport { getRandomBigInteger } from '../random';\n\n/**\n * Generate a probably prime random number\n * @param {Integer} bits - Bit length of the prime\n * @param {BigInteger} e - Optional RSA exponent to check against the prime\n * @param {Integer} k - Optional number of iterations of Miller-Rabin test\n * @returns BigInteger\n * @async\n */\nexport async function randomProbablePrime(bits, e, k) {\n  const BigInteger = await util.getBigInteger();\n  const one = new BigInteger(1);\n  const min = one.leftShift(new BigInteger(bits - 1));\n  const thirty = new BigInteger(30);\n  /*\n   * We can avoid any multiples of 3 and 5 by looking at n mod 30\n   * n mod 30 = 0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29\n   * the next possible prime is mod 30:\n   *            1  7  7  7  7  7  7 11 11 11 11 13 13 17 17 17 17 19 19 23 23 23 23 29 29 29 29 29 29 1\n   */\n  const adds = [1, 6, 5, 4, 3, 2, 1, 4, 3, 2, 1, 2, 1, 4, 3, 2, 1, 2, 1, 4, 3, 2, 1, 6, 5, 4, 3, 2, 1, 2];\n\n  const n = await getRandomBigInteger(min, min.leftShift(one));\n  let i = n.mod(thirty).toNumber();\n\n  do {\n    n.iadd(new BigInteger(adds[i]));\n    i = (i + adds[i]) % adds.length;\n    // If reached the maximum, go back to the minimum.\n    if (n.bitLength() > bits) {\n      n.imod(min.leftShift(one)).iadd(min);\n      i = n.mod(thirty).toNumber();\n    }\n  } while (!await isProbablePrime(n, e, k));\n  return n;\n}\n\n/**\n * Probabilistic primality testing\n * @param {BigInteger} n - Number to test\n * @param {BigInteger} e - Optional RSA exponent to check against the prime\n * @param {Integer} k - Optional number of iterations of Miller-Rabin test\n * @returns {boolean}\n * @async\n */\nexport async function isProbablePrime(n, e, k) {\n  if (e && !n.dec().gcd(e).isOne()) {\n    return false;\n  }\n  if (!await divisionTest(n)) {\n    return false;\n  }\n  if (!await fermat(n)) {\n    return false;\n  }\n  if (!await millerRabin(n, k)) {\n    return false;\n  }\n  // TODO implement the Lucas test\n  // See Section C.3.3 here: https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.186-4.pdf\n  return true;\n}\n\n/**\n * Tests whether n is probably prime or not using Fermat's test with b = 2.\n * Fails if b^(n-1) mod n != 1.\n * @param {BigInteger} n - Number to test\n * @param {BigInteger} b - Optional Fermat test base\n * @returns {boolean}\n */\nexport async function fermat(n, b) {\n  const BigInteger = await util.getBigInteger();\n  b = b || new BigInteger(2);\n  return b.modExp(n.dec(), n).isOne();\n}\n\nexport async function divisionTest(n) {\n  const BigInteger = await util.getBigInteger();\n  return smallPrimes.every(m => {\n    return n.mod(new BigInteger(m)) !== 0;\n  });\n}\n\n// https://github.com/gpg/libgcrypt/blob/master/cipher/primegen.c\nconst smallPrimes = [\n  7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43,\n  47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101,\n  103, 107, 109, 113, 127, 131, 137, 139, 149, 151,\n  157, 163, 167, 173, 179, 181, 191, 193, 197, 199,\n  211, 223, 227, 229, 233, 239, 241, 251, 257, 263,\n  269, 271, 277, 281, 283, 293, 307, 311, 313, 317,\n  331, 337, 347, 349, 353, 359, 367, 373, 379, 383,\n  389, 397, 401, 409, 419, 421, 431, 433, 439, 443,\n  449, 457, 461, 463, 467, 479, 487, 491, 499, 503,\n  509, 521, 523, 541, 547, 557, 563, 569, 571, 577,\n  587, 593, 599, 601, 607, 613, 617, 619, 631, 641,\n  643, 647, 653, 659, 661, 673, 677, 683, 691, 701,\n  709, 719, 727, 733, 739, 743, 751, 757, 761, 769,\n  773, 787, 797, 809, 811, 821, 823, 827, 829, 839,\n  853, 857, 859, 863, 877, 881, 883, 887, 907, 911,\n  919, 929, 937, 941, 947, 953, 967, 971, 977, 983,\n  991, 997, 1009, 1013, 1019, 1021, 1031, 1033,\n  1039, 1049, 1051, 1061, 1063, 1069, 1087, 1091,\n  1093, 1097, 1103, 1109, 1117, 1123, 1129, 1151,\n  1153, 1163, 1171, 1181, 1187, 1193, 1201, 1213,\n  1217, 1223, 1229, 1231, 1237, 1249, 1259, 1277,\n  1279, 1283, 1289, 1291, 1297, 1301, 1303, 1307,\n  1319, 1321, 1327, 1361, 1367, 1373, 1381, 1399,\n  1409, 1423, 1427, 1429, 1433, 1439, 1447, 1451,\n  1453, 1459, 1471, 1481, 1483, 1487, 1489, 1493,\n  1499, 1511, 1523, 1531, 1543, 1549, 1553, 1559,\n  1567, 1571, 1579, 1583, 1597, 1601, 1607, 1609,\n  1613, 1619, 1621, 1627, 1637, 1657, 1663, 1667,\n  1669, 1693, 1697, 1699, 1709, 1721, 1723, 1733,\n  1741, 1747, 1753, 1759, 1777, 1783, 1787, 1789,\n  1801, 1811, 1823, 1831, 1847, 1861, 1867, 1871,\n  1873, 1877, 1879, 1889, 1901, 1907, 1913, 1931,\n  1933, 1949, 1951, 1973, 1979, 1987, 1993, 1997,\n  1999, 2003, 2011, 2017, 2027, 2029, 2039, 2053,\n  2063, 2069, 2081, 2083, 2087, 2089, 2099, 2111,\n  2113, 2129, 2131, 2137, 2141, 2143, 2153, 2161,\n  2179, 2203, 2207, 2213, 2221, 2237, 2239, 2243,\n  2251, 2267, 2269, 2273, 2281, 2287, 2293, 2297,\n  2309, 2311, 2333, 2339, 2341, 2347, 2351, 2357,\n  2371, 2377, 2381, 2383, 2389, 2393, 2399, 2411,\n  2417, 2423, 2437, 2441, 2447, 2459, 2467, 2473,\n  2477, 2503, 2521, 2531, 2539, 2543, 2549, 2551,\n  2557, 2579, 2591, 2593, 2609, 2617, 2621, 2633,\n  2647, 2657, 2659, 2663, 2671, 2677, 2683, 2687,\n  2689, 2693, 2699, 2707, 2711, 2713, 2719, 2729,\n  2731, 2741, 2749, 2753, 2767, 2777, 2789, 2791,\n  2797, 2801, 2803, 2819, 2833, 2837, 2843, 2851,\n  2857, 2861, 2879, 2887, 2897, 2903, 2909, 2917,\n  2927, 2939, 2953, 2957, 2963, 2969, 2971, 2999,\n  3001, 3011, 3019, 3023, 3037, 3041, 3049, 3061,\n  3067, 3079, 3083, 3089, 3109, 3119, 3121, 3137,\n  3163, 3167, 3169, 3181, 3187, 3191, 3203, 3209,\n  3217, 3221, 3229, 3251, 3253, 3257, 3259, 3271,\n  3299, 3301, 3307, 3313, 3319, 3323, 3329, 3331,\n  3343, 3347, 3359, 3361, 3371, 3373, 3389, 3391,\n  3407, 3413, 3433, 3449, 3457, 3461, 3463, 3467,\n  3469, 3491, 3499, 3511, 3517, 3527, 3529, 3533,\n  3539, 3541, 3547, 3557, 3559, 3571, 3581, 3583,\n  3593, 3607, 3613, 3617, 3623, 3631, 3637, 3643,\n  3659, 3671, 3673, 3677, 3691, 3697, 3701, 3709,\n  3719, 3727, 3733, 3739, 3761, 3767, 3769, 3779,\n  3793, 3797, 3803, 3821, 3823, 3833, 3847, 3851,\n  3853, 3863, 3877, 3881, 3889, 3907, 3911, 3917,\n  3919, 3923, 3929, 3931, 3943, 3947, 3967, 3989,\n  4001, 4003, 4007, 4013, 4019, 4021, 4027, 4049,\n  4051, 4057, 4073, 4079, 4091, 4093, 4099, 4111,\n  4127, 4129, 4133, 4139, 4153, 4157, 4159, 4177,\n  4201, 4211, 4217, 4219, 4229, 4231, 4241, 4243,\n  4253, 4259, 4261, 4271, 4273, 4283, 4289, 4297,\n  4327, 4337, 4339, 4349, 4357, 4363, 4373, 4391,\n  4397, 4409, 4421, 4423, 4441, 4447, 4451, 4457,\n  4463, 4481, 4483, 4493, 4507, 4513, 4517, 4519,\n  4523, 4547, 4549, 4561, 4567, 4583, 4591, 4597,\n  4603, 4621, 4637, 4639, 4643, 4649, 4651, 4657,\n  4663, 4673, 4679, 4691, 4703, 4721, 4723, 4729,\n  4733, 4751, 4759, 4783, 4787, 4789, 4793, 4799,\n  4801, 4813, 4817, 4831, 4861, 4871, 4877, 4889,\n  4903, 4909, 4919, 4931, 4933, 4937, 4943, 4951,\n  4957, 4967, 4969, 4973, 4987, 4993, 4999\n];\n\n\n// Miller-Rabin - Miller Rabin algorithm for primality test\n// Copyright Fedor Indutny, 2014.\n//\n// This software is licensed under the MIT License.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// Adapted on Jan 2018 from version 4.0.1 at https://github.com/indutny/miller-rabin\n\n// Sample syntax for Fixed-Base Miller-Rabin:\n// millerRabin(n, k, () => new BN(small_primes[Math.random() * small_primes.length | 0]))\n\n/**\n * Tests whether n is probably prime or not using the Miller-Rabin test.\n * See HAC Remark 4.28.\n * @param {BigInteger} n - Number to test\n * @param {Integer} k - Optional number of iterations of Miller-Rabin test\n * @param {Function} rand - Optional function to generate potential witnesses\n * @returns {boolean}\n * @async\n */\nexport async function millerRabin(n, k, rand) {\n  const BigInteger = await util.getBigInteger();\n  const len = n.bitLength();\n\n  if (!k) {\n    k = Math.max(1, (len / 48) | 0);\n  }\n\n  const n1 = n.dec(); // n - 1\n\n  // Find d and s, (n - 1) = (2 ^ s) * d;\n  let s = 0;\n  while (!n1.getBit(s)) { s++; }\n  const d = n.rightShift(new BigInteger(s));\n\n  for (; k > 0; k--) {\n    const a = rand ? rand() : await getRandomBigInteger(new BigInteger(2), n1);\n\n    let x = a.modExp(d, n);\n    if (x.isOne() || x.equal(n1)) {\n      continue;\n    }\n\n    let i;\n    for (i = 1; i < s; i++) {\n      x = x.mul(x).mod(n);\n\n      if (x.isOne()) {\n        return false;\n      }\n      if (x.equal(n1)) {\n        break;\n      }\n    }\n\n    if (i === s) {\n      return false;\n    }\n  }\n\n  return true;\n}\n","// GPG4Browsers - An OpenPGP implementation in javascript\n// Copyright (C) 2011 Recurity Labs GmbH\n//\n// This library is free software; you can redistribute it and/or\n// modify it under the terms of the GNU Lesser General Public\n// License as published by the Free Software Foundation; either\n// version 3.0 of the License, or (at your option) any later version.\n//\n// This library is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n// Lesser General Public License for more details.\n//\n// You should have received a copy of the GNU Lesser General Public\n// License along with this library; if not, write to the Free Software\n// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n\n/**\n * @fileoverview Provides EME-PKCS1-v1_5 encoding and decoding and EMSA-PKCS1-v1_5 encoding function\n * @see module:crypto/public_key/rsa\n * @see module:crypto/public_key/elliptic/ecdh\n * @see PublicKeyEncryptedSessionKeyPacket\n * @module crypto/pkcs1\n * @private\n */\n\nimport { getRandomBytes } from './random';\nimport hash from './hash';\nimport util from '../util';\n\n/**\n * ASN1 object identifiers for hashes\n * @see {@link https://tools.ietf.org/html/rfc4880#section-5.2.2}\n */\nconst hash_headers = [];\nhash_headers[1] = [0x30, 0x20, 0x30, 0x0c, 0x06, 0x08, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x02, 0x05, 0x05, 0x00, 0x04,\n  0x10];\nhash_headers[2] = [0x30, 0x21, 0x30, 0x09, 0x06, 0x05, 0x2b, 0x0e, 0x03, 0x02, 0x1a, 0x05, 0x00, 0x04, 0x14];\nhash_headers[3] = [0x30, 0x21, 0x30, 0x09, 0x06, 0x05, 0x2B, 0x24, 0x03, 0x02, 0x01, 0x05, 0x00, 0x04, 0x14];\nhash_headers[8] = [0x30, 0x31, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01, 0x05, 0x00,\n  0x04, 0x20];\nhash_headers[9] = [0x30, 0x41, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x02, 0x05, 0x00,\n  0x04, 0x30];\nhash_headers[10] = [0x30, 0x51, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x03, 0x05,\n  0x00, 0x04, 0x40];\nhash_headers[11] = [0x30, 0x2d, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x04, 0x05,\n  0x00, 0x04, 0x1C];\n\n/**\n * Create padding with secure random data\n * @private\n * @param {Integer} length - Length of the padding in bytes\n * @returns {Uint8Array} Random padding.\n */\nfunction getPKCS1Padding(length) {\n  const result = new Uint8Array(length);\n  let count = 0;\n  while (count < length) {\n    const randomBytes = getRandomBytes(length - count);\n    for (let i = 0; i < randomBytes.length; i++) {\n      if (randomBytes[i] !== 0) {\n        result[count++] = randomBytes[i];\n      }\n    }\n  }\n  return result;\n}\n\n/**\n * Create a EME-PKCS1-v1_5 padded message\n * @see {@link https://tools.ietf.org/html/rfc4880#section-13.1.1|RFC 4880 13.1.1}\n * @param {Uint8Array} message - Message to be encoded\n * @param {Integer} keyLength - The length in octets of the key modulus\n * @returns {Uint8Array} EME-PKCS1 padded message.\n */\nexport function emeEncode(message, keyLength) {\n  const mLength = message.length;\n  // length checking\n  if (mLength > keyLength - 11) {\n    throw new Error('Message too long');\n  }\n  // Generate an octet string PS of length k - mLen - 3 consisting of\n  // pseudo-randomly generated nonzero octets\n  const PS = getPKCS1Padding(keyLength - mLength - 3);\n  // Concatenate PS, the message M, and other padding to form an\n  // encoded message EM of length k octets as EM = 0x00 || 0x02 || PS || 0x00 || M.\n  const encoded = new Uint8Array(keyLength);\n  // 0x00 byte\n  encoded[1] = 2;\n  encoded.set(PS, 2);\n  // 0x00 bytes\n  encoded.set(message, keyLength - mLength);\n  return encoded;\n}\n\n/**\n * Decode a EME-PKCS1-v1_5 padded message\n * @see {@link https://tools.ietf.org/html/rfc4880#section-13.1.2|RFC 4880 13.1.2}\n * @param {Uint8Array} encoded - Encoded message bytes\n * @param {Uint8Array} randomPayload - Data to return in case of decoding error (needed for constant-time processing)\n * @returns {Uint8Array} decoded data or `randomPayload` (on error, if given)\n * @throws {Error} on decoding failure, unless `randomPayload` is provided\n */\nexport function emeDecode(encoded, randomPayload) {\n  // encoded format: 0x00 0x02 <PS> 0x00 <payload>\n  let offset = 2;\n  let separatorNotFound = 1;\n  for (let j = offset; j < encoded.length; j++) {\n    separatorNotFound &= encoded[j] !== 0;\n    offset += separatorNotFound;\n  }\n\n  const psLen = offset - 2;\n  const payload = encoded.subarray(offset + 1); // discard the 0x00 separator\n  const isValidPadding = encoded[0] === 0 & encoded[1] === 2 & psLen >= 8 & !separatorNotFound;\n\n  if (randomPayload) {\n    return util.selectUint8Array(isValidPadding, payload, randomPayload);\n  }\n\n  if (isValidPadding) {\n    return payload;\n  }\n\n  throw new Error('Decryption error');\n}\n\n/**\n * Create a EMSA-PKCS1-v1_5 padded message\n * @see {@link https://tools.ietf.org/html/rfc4880#section-13.1.3|RFC 4880 13.1.3}\n * @param {Integer} algo - Hash algorithm type used\n * @param {Uint8Array} hashed - Message to be encoded\n * @param {Integer} emLen - Intended length in octets of the encoded message\n * @returns {Uint8Array} Encoded message.\n */\nexport async function emsaEncode(algo, hashed, emLen) {\n  let i;\n  if (hashed.length !== hash.getHashByteLength(algo)) {\n    throw new Error('Invalid hash length');\n  }\n  // produce an ASN.1 DER value for the hash function used.\n  // Let T be the full hash prefix\n  const hashPrefix = new Uint8Array(hash_headers[algo].length);\n  for (i = 0; i < hash_headers[algo].length; i++) {\n    hashPrefix[i] = hash_headers[algo][i];\n  }\n  // and let tLen be the length in octets prefix and hashed data\n  const tLen = hashPrefix.length + hashed.length;\n  if (emLen < tLen + 11) {\n    throw new Error('Intended encoded message length too short');\n  }\n  // an octet string PS consisting of emLen - tLen - 3 octets with hexadecimal value 0xFF\n  // The length of PS will be at least 8 octets\n  const PS = new Uint8Array(emLen - tLen - 3).fill(0xff);\n\n  // Concatenate PS, the hash prefix, hashed data, and other padding to form the\n  // encoded message EM as EM = 0x00 || 0x01 || PS || 0x00 || prefix || hashed\n  const EM = new Uint8Array(emLen);\n  EM[1] = 0x01;\n  EM.set(PS, 2);\n  EM.set(hashPrefix, emLen - tLen);\n  EM.set(hashed, emLen - hashed.length);\n  return EM;\n}\n","// GPG4Browsers - An OpenPGP implementation in javascript\n// Copyright (C) 2011 Recurity Labs GmbH\n//\n// This library is free software; you can redistribute it and/or\n// modify it under the terms of the GNU Lesser General Public\n// License as published by the Free Software Foundation; either\n// version 3.0 of the License, or (at your option) any later version.\n//\n// This library is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n// Lesser General Public License for more details.\n//\n// You should have received a copy of the GNU Lesser General Public\n// License along with this library; if not, write to the Free Software\n// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n\n/**\n * @fileoverview RSA implementation\n * @module crypto/public_key/rsa\n * @private\n */\n\nimport { randomProbablePrime } from './prime';\nimport { getRandomBigInteger } from '../random';\nimport util from '../../util';\nimport { uint8ArrayToB64, b64ToUint8Array } from '../../encoding/base64';\nimport { emsaEncode, emeEncode, emeDecode } from '../pkcs1';\nimport enums from '../../enums';\n\nconst webCrypto = util.getWebCrypto();\nconst nodeCrypto = util.getNodeCrypto();\nconst asn1 = nodeCrypto ? require('asn1.js') : undefined;\n\n/* eslint-disable no-invalid-this */\nconst RSAPrivateKey = nodeCrypto ? asn1.define('RSAPrivateKey', function () {\n  this.seq().obj( // used for native NodeJS crypto\n    this.key('version').int(), // 0\n    this.key('modulus').int(), // n\n    this.key('publicExponent').int(), // e\n    this.key('privateExponent').int(), // d\n    this.key('prime1').int(), // p\n    this.key('prime2').int(), // q\n    this.key('exponent1').int(), // dp\n    this.key('exponent2').int(), // dq\n    this.key('coefficient').int() // u\n  );\n}) : undefined;\n\nconst RSAPublicKey = nodeCrypto ? asn1.define('RSAPubliceKey', function () {\n  this.seq().obj( // used for native NodeJS crypto\n    this.key('modulus').int(), // n\n    this.key('publicExponent').int() // e\n  );\n}) : undefined;\n/* eslint-enable no-invalid-this */\n\n/** Create signature\n * @param {module:enums.hash} hashAlgo - Hash algorithm\n * @param {Uint8Array} data - Message\n * @param {Uint8Array} n - RSA public modulus\n * @param {Uint8Array} e - RSA public exponent\n * @param {Uint8Array} d - RSA private exponent\n * @param {Uint8Array} p - RSA private prime p\n * @param {Uint8Array} q - RSA private prime q\n * @param {Uint8Array} u - RSA private coefficient\n * @param {Uint8Array} hashed - Hashed message\n * @returns {Promise<Uint8Array>} RSA Signature.\n * @async\n */\nexport async function sign(hashAlgo, data, n, e, d, p, q, u, hashed) {\n  if (data && !util.isStream(data)) {\n    if (util.getWebCrypto()) {\n      try {\n        return await webSign(enums.read(enums.webHash, hashAlgo), data, n, e, d, p, q, u);\n      } catch (err) {\n        util.printDebugError(err);\n      }\n    } else if (util.getNodeCrypto()) {\n      return nodeSign(hashAlgo, data, n, e, d, p, q, u);\n    }\n  }\n  return bnSign(hashAlgo, n, d, hashed);\n}\n\n/**\n * Verify signature\n * @param {module:enums.hash} hashAlgo - Hash algorithm\n * @param {Uint8Array} data - Message\n * @param {Uint8Array} s - Signature\n * @param {Uint8Array} n - RSA public modulus\n * @param {Uint8Array} e - RSA public exponent\n * @param {Uint8Array} hashed - Hashed message\n * @returns {Boolean}\n * @async\n */\nexport async function verify(hashAlgo, data, s, n, e, hashed) {\n  if (data && !util.isStream(data)) {\n    if (util.getWebCrypto()) {\n      try {\n        return await webVerify(enums.read(enums.webHash, hashAlgo), data, s, n, e);\n      } catch (err) {\n        util.printDebugError(err);\n      }\n    } else if (util.getNodeCrypto()) {\n      return nodeVerify(hashAlgo, data, s, n, e);\n    }\n  }\n  return bnVerify(hashAlgo, s, n, e, hashed);\n}\n\n/**\n * Encrypt message\n * @param {Uint8Array} data - Message\n * @param {Uint8Array} n - RSA public modulus\n * @param {Uint8Array} e - RSA public exponent\n * @returns {Promise<Uint8Array>} RSA Ciphertext.\n * @async\n */\nexport async function encrypt(data, n, e) {\n  if (util.getNodeCrypto()) {\n    return nodeEncrypt(data, n, e);\n  }\n  return bnEncrypt(data, n, e);\n}\n\n/**\n * Decrypt RSA message\n * @param {Uint8Array} m - Message\n * @param {Uint8Array} n - RSA public modulus\n * @param {Uint8Array} e - RSA public exponent\n * @param {Uint8Array} d - RSA private exponent\n * @param {Uint8Array} p - RSA private prime p\n * @param {Uint8Array} q - RSA private prime q\n * @param {Uint8Array} u - RSA private coefficient\n * @param {Uint8Array} randomPayload - Data to return on decryption error, instead of throwing\n *                                     (needed for constant-time processing)\n * @returns {Promise<String>} RSA Plaintext.\n * @throws {Error} on decryption error, unless `randomPayload` is given\n * @async\n */\nexport async function decrypt(data, n, e, d, p, q, u, randomPayload) {\n  // Node v18.19.1, 20.11.1 and 21.6.2 have disabled support for PKCS#1 decryption,\n  // and we want to avoid checking the error type to decide if the random payload\n  // should indeed be returned.\n  if (util.getNodeCrypto() && !randomPayload) {\n    try {\n      return await nodeDecrypt(data, n, e, d, p, q, u);\n    } catch (err) {\n      util.printDebugError(err);\n    }\n  }\n  return bnDecrypt(data, n, e, d, p, q, u, randomPayload);\n}\n\n/**\n * Generate a new random private key B bits long with public exponent E.\n *\n * When possible, webCrypto or nodeCrypto is used. Otherwise, primes are generated using\n * 40 rounds of the Miller-Rabin probabilistic random prime generation algorithm.\n * @see module:crypto/public_key/prime\n * @param {Integer} bits - RSA bit length\n * @param {Integer} e - RSA public exponent\n * @returns {{n, e, d,\n *            p, q ,u: Uint8Array}} RSA public modulus, RSA public exponent, RSA private exponent,\n *                                  RSA private prime p, RSA private prime q, u = p ** -1 mod q\n * @async\n */\nexport async function generate(bits, e) {\n  const BigInteger = await util.getBigInteger();\n\n  e = new BigInteger(e);\n\n  // Native RSA keygen using Web Crypto\n  if (util.getWebCrypto()) {\n    const keyGenOpt = {\n      name: 'RSASSA-PKCS1-v1_5',\n      modulusLength: bits, // the specified keysize in bits\n      publicExponent: e.toUint8Array(), // take three bytes (max 65537) for exponent\n      hash: {\n        name: 'SHA-1' // not required for actual RSA keys, but for crypto api 'sign' and 'verify'\n      }\n    };\n    const keyPair = await webCrypto.generateKey(keyGenOpt, true, ['sign', 'verify']);\n\n    // export the generated keys as JsonWebKey (JWK)\n    // https://tools.ietf.org/html/draft-ietf-jose-json-web-key-33\n    const jwk = await webCrypto.exportKey('jwk', keyPair.privateKey);\n    // map JWK parameters to corresponding OpenPGP names\n    return {\n      n: b64ToUint8Array(jwk.n),\n      e: e.toUint8Array(),\n      d: b64ToUint8Array(jwk.d),\n      // switch p and q\n      p: b64ToUint8Array(jwk.q),\n      q: b64ToUint8Array(jwk.p),\n      // Since p and q are switched in places, u is the inverse of jwk.q\n      u: b64ToUint8Array(jwk.qi)\n    };\n  } else if (util.getNodeCrypto() && nodeCrypto.generateKeyPair && RSAPrivateKey) {\n    const opts = {\n      modulusLength: bits,\n      publicExponent: e.toNumber(),\n      publicKeyEncoding: { type: 'pkcs1', format: 'der' },\n      privateKeyEncoding: { type: 'pkcs1', format: 'der' }\n    };\n    const prv = await new Promise((resolve, reject) => {\n      nodeCrypto.generateKeyPair('rsa', opts, (err, _, der) => {\n        if (err) {\n          reject(err);\n        } else {\n          resolve(RSAPrivateKey.decode(der, 'der'));\n        }\n      });\n    });\n    /**\n     * OpenPGP spec differs from DER spec, DER: `u = (inverse of q) mod p`, OpenPGP: `u = (inverse of p) mod q`.\n     * @link https://tools.ietf.org/html/rfc3447#section-3.2\n     * @link https://tools.ietf.org/html/draft-ietf-openpgp-rfc4880bis-08#section-5.6.1\n     */\n    return {\n      n: prv.modulus.toArrayLike(Uint8Array),\n      e: prv.publicExponent.toArrayLike(Uint8Array),\n      d: prv.privateExponent.toArrayLike(Uint8Array),\n      // switch p and q\n      p: prv.prime2.toArrayLike(Uint8Array),\n      q: prv.prime1.toArrayLike(Uint8Array),\n      // Since p and q are switched in places, we can keep u as defined by DER\n      u: prv.coefficient.toArrayLike(Uint8Array)\n    };\n  }\n\n  // RSA keygen fallback using 40 iterations of the Miller-Rabin test\n  // See https://stackoverflow.com/a/6330138 for justification\n  // Also see section C.3 here: https://nvlpubs.nist.gov/nistpubs/FIPS/NIST\n  let p;\n  let q;\n  let n;\n  do {\n    q = await randomProbablePrime(bits - (bits >> 1), e, 40);\n    p = await randomProbablePrime(bits >> 1, e, 40);\n    n = p.mul(q);\n  } while (n.bitLength() !== bits);\n\n  const phi = p.dec().imul(q.dec());\n\n  if (q.lt(p)) {\n    [p, q] = [q, p];\n  }\n\n  return {\n    n: n.toUint8Array(),\n    e: e.toUint8Array(),\n    d: e.modInv(phi).toUint8Array(),\n    p: p.toUint8Array(),\n    q: q.toUint8Array(),\n    // dp: d.mod(p.subn(1)),\n    // dq: d.mod(q.subn(1)),\n    u: p.modInv(q).toUint8Array()\n  };\n}\n\n/**\n * Validate RSA parameters\n * @param {Uint8Array} n - RSA public modulus\n * @param {Uint8Array} e - RSA public exponent\n * @param {Uint8Array} d - RSA private exponent\n * @param {Uint8Array} p - RSA private prime p\n * @param {Uint8Array} q - RSA private prime q\n * @param {Uint8Array} u - RSA inverse of p w.r.t. q\n * @returns {Promise<Boolean>} Whether params are valid.\n * @async\n */\nexport async function validateParams(n, e, d, p, q, u) {\n  const BigInteger = await util.getBigInteger();\n  n = new BigInteger(n);\n  p = new BigInteger(p);\n  q = new BigInteger(q);\n\n  // expect pq = n\n  if (!p.mul(q).equal(n)) {\n    return false;\n  }\n\n  const two = new BigInteger(2);\n  // expect p*u = 1 mod q\n  u = new BigInteger(u);\n  if (!p.mul(u).mod(q).isOne()) {\n    return false;\n  }\n\n  e = new BigInteger(e);\n  d = new BigInteger(d);\n  /**\n   * In RSA pkcs#1 the exponents (d, e) are inverses modulo lcm(p-1, q-1)\n   * We check that [de = 1 mod (p-1)] and [de = 1 mod (q-1)]\n   * By CRT on coprime factors of (p-1, q-1) it follows that [de = 1 mod lcm(p-1, q-1)]\n   *\n   * We blind the multiplication with r, and check that rde = r mod lcm(p-1, q-1)\n   */\n  const nSizeOver3 = new BigInteger(Math.floor(n.bitLength() / 3));\n  const r = await getRandomBigInteger(two, two.leftShift(nSizeOver3)); // r in [ 2, 2^{|n|/3} ) < p and q\n  const rde = r.mul(d).mul(e);\n\n  const areInverses = rde.mod(p.dec()).equal(r) && rde.mod(q.dec()).equal(r);\n  if (!areInverses) {\n    return false;\n  }\n\n  return true;\n}\n\nasync function bnSign(hashAlgo, n, d, hashed) {\n  const BigInteger = await util.getBigInteger();\n  n = new BigInteger(n);\n  const m = new BigInteger(await emsaEncode(hashAlgo, hashed, n.byteLength()));\n  d = new BigInteger(d);\n  if (m.gte(n)) {\n    throw new Error('Message size cannot exceed modulus size');\n  }\n  return m.modExp(d, n).toUint8Array('be', n.byteLength());\n}\n\nasync function webSign(hashName, data, n, e, d, p, q, u) {\n  /** OpenPGP keys require that p < q, and Safari Web Crypto requires that p > q.\n   * We swap them in privateToJWK, so it usually works out, but nevertheless,\n   * not all OpenPGP keys are compatible with this requirement.\n   * OpenPGP.js used to generate RSA keys the wrong way around (p > q), and still\n   * does if the underlying Web Crypto does so (though the tested implementations\n   * don't do so).\n   */\n  const jwk = await privateToJWK(n, e, d, p, q, u);\n  const algo = {\n    name: 'RSASSA-PKCS1-v1_5',\n    hash: { name: hashName }\n  };\n  const key = await webCrypto.importKey('jwk', jwk, algo, false, ['sign']);\n  return new Uint8Array(await webCrypto.sign('RSASSA-PKCS1-v1_5', key, data));\n}\n\nasync function nodeSign(hashAlgo, data, n, e, d, p, q, u) {\n  const { default: BN } = await import('bn.js');\n  const pBNum = new BN(p);\n  const qBNum = new BN(q);\n  const dBNum = new BN(d);\n  const dq = dBNum.mod(qBNum.subn(1)); // d mod (q-1)\n  const dp = dBNum.mod(pBNum.subn(1)); // d mod (p-1)\n  const sign = nodeCrypto.createSign(enums.read(enums.hash, hashAlgo));\n  sign.write(data);\n  sign.end();\n  const keyObject = {\n    version: 0,\n    modulus: new BN(n),\n    publicExponent: new BN(e),\n    privateExponent: new BN(d),\n    // switch p and q\n    prime1: new BN(q),\n    prime2: new BN(p),\n    // switch dp and dq\n    exponent1: dq,\n    exponent2: dp,\n    coefficient: new BN(u)\n  };\n  if (typeof nodeCrypto.createPrivateKey !== 'undefined') { //from version 11.6.0 Node supports der encoded key objects\n    const der = RSAPrivateKey.encode(keyObject, 'der');\n    return new Uint8Array(sign.sign({ key: der, format: 'der', type: 'pkcs1' }));\n  }\n  const pem = RSAPrivateKey.encode(keyObject, 'pem', {\n    label: 'RSA PRIVATE KEY'\n  });\n  return new Uint8Array(sign.sign(pem));\n}\n\nasync function bnVerify(hashAlgo, s, n, e, hashed) {\n  const BigInteger = await util.getBigInteger();\n  n = new BigInteger(n);\n  s = new BigInteger(s);\n  e = new BigInteger(e);\n  if (s.gte(n)) {\n    throw new Error('Signature size cannot exceed modulus size');\n  }\n  const EM1 = s.modExp(e, n).toUint8Array('be', n.byteLength());\n  const EM2 = await emsaEncode(hashAlgo, hashed, n.byteLength());\n  return util.equalsUint8Array(EM1, EM2);\n}\n\nasync function webVerify(hashName, data, s, n, e) {\n  const jwk = publicToJWK(n, e);\n  const key = await webCrypto.importKey('jwk', jwk, {\n    name: 'RSASSA-PKCS1-v1_5',\n    hash: { name:  hashName }\n  }, false, ['verify']);\n  return webCrypto.verify('RSASSA-PKCS1-v1_5', key, s, data);\n}\n\nasync function nodeVerify(hashAlgo, data, s, n, e) {\n  const { default: BN } = await import('bn.js');\n\n  const verify = nodeCrypto.createVerify(enums.read(enums.hash, hashAlgo));\n  verify.write(data);\n  verify.end();\n  const keyObject = {\n    modulus: new BN(n),\n    publicExponent: new BN(e)\n  };\n  let key;\n  if (typeof nodeCrypto.createPrivateKey !== 'undefined') { //from version 11.6.0 Node supports der encoded key objects\n    const der = RSAPublicKey.encode(keyObject, 'der');\n    key = { key: der, format: 'der', type: 'pkcs1' };\n  } else {\n    key = RSAPublicKey.encode(keyObject, 'pem', {\n      label: 'RSA PUBLIC KEY'\n    });\n  }\n  try {\n    return await verify.verify(key, s);\n  } catch (err) {\n    return false;\n  }\n}\n\nasync function nodeEncrypt(data, n, e) {\n  const { default: BN } = await import('bn.js');\n\n  const keyObject = {\n    modulus: new BN(n),\n    publicExponent: new BN(e)\n  };\n  let key;\n  if (typeof nodeCrypto.createPrivateKey !== 'undefined') {\n    const der = RSAPublicKey.encode(keyObject, 'der');\n    key = { key: der, format: 'der', type: 'pkcs1', padding: nodeCrypto.constants.RSA_PKCS1_PADDING };\n  } else {\n    const pem = RSAPublicKey.encode(keyObject, 'pem', {\n      label: 'RSA PUBLIC KEY'\n    });\n    key = { key: pem, padding: nodeCrypto.constants.RSA_PKCS1_PADDING };\n  }\n  return new Uint8Array(nodeCrypto.publicEncrypt(key, data));\n}\n\nasync function bnEncrypt(data, n, e) {\n  const BigInteger = await util.getBigInteger();\n  n = new BigInteger(n);\n  data = new BigInteger(emeEncode(data, n.byteLength()));\n  e = new BigInteger(e);\n  if (data.gte(n)) {\n    throw new Error('Message size cannot exceed modulus size');\n  }\n  return data.modExp(e, n).toUint8Array('be', n.byteLength());\n}\n\nasync function nodeDecrypt(data, n, e, d, p, q, u) {\n  const { default: BN } = await import('bn.js');\n\n  const pBNum = new BN(p);\n  const qBNum = new BN(q);\n  const dBNum = new BN(d);\n  const dq = dBNum.mod(qBNum.subn(1)); // d mod (q-1)\n  const dp = dBNum.mod(pBNum.subn(1)); // d mod (p-1)\n  const keyObject = {\n    version: 0,\n    modulus: new BN(n),\n    publicExponent: new BN(e),\n    privateExponent: new BN(d),\n    // switch p and q\n    prime1: new BN(q),\n    prime2: new BN(p),\n    // switch dp and dq\n    exponent1: dq,\n    exponent2: dp,\n    coefficient: new BN(u)\n  };\n  let key;\n  if (typeof nodeCrypto.createPrivateKey !== 'undefined') {\n    const der = RSAPrivateKey.encode(keyObject, 'der');\n    key = { key: der, format: 'der' , type: 'pkcs1', padding: nodeCrypto.constants.RSA_PKCS1_PADDING };\n  } else {\n    const pem = RSAPrivateKey.encode(keyObject, 'pem', {\n      label: 'RSA PRIVATE KEY'\n    });\n    key = { key: pem, padding: nodeCrypto.constants.RSA_PKCS1_PADDING };\n  }\n  try {\n    return new Uint8Array(nodeCrypto.privateDecrypt(key, data));\n  } catch (err) {\n    throw new Error('Decryption error');\n  }\n}\n\nasync function bnDecrypt(data, n, e, d, p, q, u, randomPayload) {\n  const BigInteger = await util.getBigInteger();\n  data = new BigInteger(data);\n  n = new BigInteger(n);\n  e = new BigInteger(e);\n  d = new BigInteger(d);\n  p = new BigInteger(p);\n  q = new BigInteger(q);\n  u = new BigInteger(u);\n  if (data.gte(n)) {\n    throw new Error('Data too large.');\n  }\n  const dq = d.mod(q.dec()); // d mod (q-1)\n  const dp = d.mod(p.dec()); // d mod (p-1)\n\n  const unblinder = (await getRandomBigInteger(new BigInteger(2), n)).mod(n);\n  const blinder = unblinder.modInv(n).modExp(e, n);\n  data = data.mul(blinder).mod(n);\n\n\n  const mp = data.modExp(dp, p); // data**{d mod (q-1)} mod p\n  const mq = data.modExp(dq, q); // data**{d mod (p-1)} mod q\n  const h = u.mul(mq.sub(mp)).mod(q); // u * (mq-mp) mod q (operands already < q)\n\n  let result = h.mul(p).add(mp); // result < n due to relations above\n\n  result = result.mul(unblinder).mod(n);\n\n\n  return emeDecode(result.toUint8Array('be', n.byteLength()), randomPayload);\n}\n\n/** Convert Openpgp private key params to jwk key according to\n * @link https://tools.ietf.org/html/rfc7517\n * @param {String} hashAlgo\n * @param {Uint8Array} n\n * @param {Uint8Array} e\n * @param {Uint8Array} d\n * @param {Uint8Array} p\n * @param {Uint8Array} q\n * @param {Uint8Array} u\n */\nasync function privateToJWK(n, e, d, p, q, u) {\n  const BigInteger = await util.getBigInteger();\n  const pNum = new BigInteger(p);\n  const qNum = new BigInteger(q);\n  const dNum = new BigInteger(d);\n\n  let dq = dNum.mod(qNum.dec()); // d mod (q-1)\n  let dp = dNum.mod(pNum.dec()); // d mod (p-1)\n  dp = dp.toUint8Array();\n  dq = dq.toUint8Array();\n  return {\n    kty: 'RSA',\n    n: uint8ArrayToB64(n, true),\n    e: uint8ArrayToB64(e, true),\n    d: uint8ArrayToB64(d, true),\n    // switch p and q\n    p: uint8ArrayToB64(q, true),\n    q: uint8ArrayToB64(p, true),\n    // switch dp and dq\n    dp: uint8ArrayToB64(dq, true),\n    dq: uint8ArrayToB64(dp, true),\n    qi: uint8ArrayToB64(u, true),\n    ext: true\n  };\n}\n\n/** Convert Openpgp key public params to jwk key according to\n * @link https://tools.ietf.org/html/rfc7517\n * @param {String} hashAlgo\n * @param {Uint8Array} n\n * @param {Uint8Array} e\n */\nfunction publicToJWK(n, e) {\n  return {\n    kty: 'RSA',\n    n: uint8ArrayToB64(n, true),\n    e: uint8ArrayToB64(e, true),\n    ext: true\n  };\n}\n","// GPG4Browsers - An OpenPGP implementation in javascript\n// Copyright (C) 2011 Recurity Labs GmbH\n//\n// This library is free software; you can redistribute it and/or\n// modify it under the terms of the GNU Lesser General Public\n// License as published by the Free Software Foundation; either\n// version 3.0 of the License, or (at your option) any later version.\n//\n// This library is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n// Lesser General Public License for more details.\n//\n// You should have received a copy of the GNU Lesser General Public\n// License along with this library; if not, write to the Free Software\n// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n\n/**\n * @fileoverview ElGamal implementation\n * @module crypto/public_key/elgamal\n * @private\n */\n\nimport util from '../../util';\nimport { getRandomBigInteger } from '../random';\nimport { emeEncode, emeDecode } from '../pkcs1';\n\n/**\n * ElGamal Encryption function\n * Note that in OpenPGP, the message needs to be padded with PKCS#1 (same as RSA)\n * @param {Uint8Array} data - To be padded and encrypted\n * @param {Uint8Array} p\n * @param {Uint8Array} g\n * @param {Uint8Array} y\n * @returns {Promise<{ c1: Uint8Array, c2: Uint8Array }>}\n * @async\n */\nexport async function encrypt(data, p, g, y) {\n  const BigInteger = await util.getBigInteger();\n  p = new BigInteger(p);\n  g = new BigInteger(g);\n  y = new BigInteger(y);\n\n  const padded = emeEncode(data, p.byteLength());\n  const m = new BigInteger(padded);\n\n  // OpenPGP uses a \"special\" version of ElGamal where g is generator of the full group Z/pZ*\n  // hence g has order p-1, and to avoid that k = 0 mod p-1, we need to pick k in [1, p-2]\n  const k = await getRandomBigInteger(new BigInteger(1), p.dec());\n  return {\n    c1: g.modExp(k, p).toUint8Array(),\n    c2: y.modExp(k, p).imul(m).imod(p).toUint8Array()\n  };\n}\n\n/**\n * ElGamal Encryption function\n * @param {Uint8Array} c1\n * @param {Uint8Array} c2\n * @param {Uint8Array} p\n * @param {Uint8Array} x\n * @param {Uint8Array} randomPayload - Data to return on unpadding error, instead of throwing\n *                                     (needed for constant-time processing)\n * @returns {Promise<Uint8Array>} Unpadded message.\n * @throws {Error} on decryption error, unless `randomPayload` is given\n * @async\n */\nexport async function decrypt(c1, c2, p, x, randomPayload) {\n  const BigInteger = await util.getBigInteger();\n  c1 = new BigInteger(c1);\n  c2 = new BigInteger(c2);\n  p = new BigInteger(p);\n  x = new BigInteger(x);\n\n  const padded = c1.modExp(x, p).modInv(p).imul(c2).imod(p);\n  return emeDecode(padded.toUint8Array('be', p.byteLength()), randomPayload);\n}\n\n/**\n * Validate ElGamal parameters\n * @param {Uint8Array} p - ElGamal prime\n * @param {Uint8Array} g - ElGamal group generator\n * @param {Uint8Array} y - ElGamal public key\n * @param {Uint8Array} x - ElGamal private exponent\n * @returns {Promise<Boolean>} Whether params are valid.\n * @async\n */\nexport async function validateParams(p, g, y, x) {\n  const BigInteger = await util.getBigInteger();\n  p = new BigInteger(p);\n  g = new BigInteger(g);\n  y = new BigInteger(y);\n\n  const one = new BigInteger(1);\n  // Check that 1 < g < p\n  if (g.lte(one) || g.gte(p)) {\n    return false;\n  }\n\n  // Expect p-1 to be large\n  const pSize = new BigInteger(p.bitLength());\n  const n1023 = new BigInteger(1023);\n  if (pSize.lt(n1023)) {\n    return false;\n  }\n\n  /**\n   * g should have order p-1\n   * Check that g ** (p-1) = 1 mod p\n   */\n  if (!g.modExp(p.dec(), p).isOne()) {\n    return false;\n  }\n\n  /**\n   * Since p-1 is not prime, g might have a smaller order that divides p-1\n   * We want to make sure that the order is large enough to hinder a small subgroup attack\n   *\n   * We just check g**i != 1 for all i up to a threshold\n   */\n  let res = g;\n  const i = new BigInteger(1);\n  const threshold = new BigInteger(2).leftShift(new BigInteger(17)); // we want order > threshold\n  while (i.lt(threshold)) {\n    res = res.mul(g).imod(p);\n    if (res.isOne()) {\n      return false;\n    }\n    i.iinc();\n  }\n\n  /**\n   * Re-derive public key y' = g ** x mod p\n   * Expect y == y'\n   *\n   * Blinded exponentiation computes g**{r(p-1) + x} to compare to y\n   */\n  x = new BigInteger(x);\n  const two = new BigInteger(2);\n  const r = await getRandomBigInteger(two.leftShift(pSize.dec()), two.leftShift(pSize)); // draw r of same size as p-1\n  const rqx = p.dec().imul(r).iadd(x);\n  if (!y.equal(g.modExp(rqx, p))) {\n    return false;\n  }\n\n  return true;\n}\n","// OpenPGP.js - An OpenPGP implementation in javascript\n// Copyright (C) 2015-2016 Decentral\n//\n// This library is free software; you can redistribute it and/or\n// modify it under the terms of the GNU Lesser General Public\n// License as published by the Free Software Foundation; either\n// version 3.0 of the License, or (at your option) any later version.\n//\n// This library is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n// Lesser General Public License for more details.\n//\n// You should have received a copy of the GNU Lesser General Public\n// License along with this library; if not, write to the Free Software\n// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n\n/**\n * Wrapper to an OID value\n *\n * {@link https://tools.ietf.org/html/rfc6637#section-11|RFC6637, section 11}:\n * The sequence of octets in the third column is the result of applying\n * the Distinguished Encoding Rules (DER) to the ASN.1 Object Identifier\n * with subsequent truncation.  The truncation removes the two fields of\n * encoded Object Identifier.  The first omitted field is one octet\n * representing the Object Identifier tag, and the second omitted field\n * is the length of the Object Identifier body.  For example, the\n * complete ASN.1 DER encoding for the NIST P-256 curve OID is \"06 08 2A\n * 86 48 CE 3D 03 01 07\", from which the first entry in the table above\n * is constructed by omitting the first two octets.  Only the truncated\n * sequence of octets is the valid representation of a curve OID.\n * @module type/oid\n * @private\n */\n\nimport util from '../util';\nimport enums from '../enums';\n\nclass OID {\n  constructor(oid) {\n    if (oid instanceof OID) {\n      this.oid = oid.oid;\n    } else if (util.isArray(oid) ||\n               util.isUint8Array(oid)) {\n      oid = new Uint8Array(oid);\n      if (oid[0] === 0x06) { // DER encoded oid byte array\n        if (oid[1] !== oid.length - 2) {\n          throw new Error('Length mismatch in DER encoded oid');\n        }\n        oid = oid.subarray(2);\n      }\n      this.oid = oid;\n    } else {\n      this.oid = '';\n    }\n  }\n\n  /**\n   * Method to read an OID object\n   * @param {Uint8Array} input - Where to read the OID from\n   * @returns {Number} Number of read bytes.\n   */\n  read(input) {\n    if (input.length >= 1) {\n      const length = input[0];\n      if (input.length >= 1 + length) {\n        this.oid = input.subarray(1, 1 + length);\n        return 1 + this.oid.length;\n      }\n    }\n    throw new Error('Invalid oid');\n  }\n\n  /**\n   * Serialize an OID object\n   * @returns {Uint8Array} Array with the serialized value the OID.\n   */\n  write() {\n    return util.concatUint8Array([new Uint8Array([this.oid.length]), this.oid]);\n  }\n\n  /**\n   * Serialize an OID object as a hex string\n   * @returns {string} String with the hex value of the OID.\n   */\n  toHex() {\n    return util.uint8ArrayToHex(this.oid);\n  }\n\n  /**\n   * If a known curve object identifier, return the canonical name of the curve\n   * @returns {string} String with the canonical name of the curve.\n   */\n  getName() {\n    const hex = this.toHex();\n    if (enums.curve[hex]) {\n      return enums.write(enums.curve, hex);\n    } else {\n      throw new Error('Unknown curve object identifier.');\n    }\n  }\n}\n\nexport default OID;\n","// OpenPGP.js - An OpenPGP implementation in javascript\n// Copyright (C) 2015-2016 Decentral\n//\n// This library is free software; you can redistribute it and/or\n// modify it under the terms of the GNU Lesser General Public\n// License as published by the Free Software Foundation; either\n// version 3.0 of the License, or (at your option) any later version.\n//\n// This library is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n// Lesser General Public License for more details.\n//\n// You should have received a copy of the GNU Lesser General Public\n// License along with this library; if not, write to the Free Software\n// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n\n/**\n * @fileoverview Wrapper for a KeyPair of an curve from indutny/elliptic library\n * @module crypto/public_key/elliptic/indutnyKey\n * @private\n */\n\nimport config from '../../../config';\n\nexport function keyFromPrivate(indutnyCurve, priv) {\n  const keyPair = indutnyCurve.keyPair({ priv: priv });\n  return keyPair;\n}\n\nexport function keyFromPublic(indutnyCurve, pub) {\n  const keyPair = indutnyCurve.keyPair({ pub: pub });\n  if (keyPair.validate().result !== true) {\n    throw new Error('Invalid elliptic public key');\n  }\n  return keyPair;\n}\n\nexport async function getIndutnyCurve(name) {\n  if (!config.useIndutnyElliptic) {\n    throw new Error('This curve is only supported in the full build of OpenPGP.js');\n  }\n  const { default: elliptic } = await import('@openpgp/elliptic');\n  return new elliptic.ec(name);\n}\n","// GPG4Browsers - An OpenPGP implementation in javascript\n// Copyright (C) 2011 Recurity Labs GmbH\n//\n// This library is free software; you can redistribute it and/or\n// modify it under the terms of the GNU Lesser General Public\n// License as published by the Free Software Foundation; either\n// version 3.0 of the License, or (at your option) any later version.\n//\n// This library is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n// Lesser General Public License for more details.\n//\n// You should have received a copy of the GNU Lesser General Public\n// License along with this library; if not, write to the Free Software\n// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n\n/**\n * @fileoverview Functions for reading and writing packets\n * @module packet/packet\n * @private\n */\n\nimport * as stream from '@openpgp/web-stream-tools';\nimport enums from '../enums';\nimport util from '../util';\n\nexport function readSimpleLength(bytes) {\n  let len = 0;\n  let offset;\n  const type = bytes[0];\n\n\n  if (type < 192) {\n    [len] = bytes;\n    offset = 1;\n  } else if (type < 255) {\n    len = ((bytes[0] - 192) << 8) + (bytes[1]) + 192;\n    offset = 2;\n  } else if (type === 255) {\n    len = util.readNumber(bytes.subarray(1, 1 + 4));\n    offset = 5;\n  }\n\n  return {\n    len: len,\n    offset: offset\n  };\n}\n\n/**\n * Encodes a given integer of length to the openpgp length specifier to a\n * string\n *\n * @param {Integer} length - The length to encode\n * @returns {Uint8Array} String with openpgp length representation.\n */\nexport function writeSimpleLength(length) {\n  if (length < 192) {\n    return new Uint8Array([length]);\n  } else if (length > 191 && length < 8384) {\n    /*\n      * let a = (total data packet length) - 192 let bc = two octet\n      * representation of a let d = b + 192\n      */\n    return new Uint8Array([((length - 192) >> 8) + 192, (length - 192) & 0xFF]);\n  }\n  return util.concatUint8Array([new Uint8Array([255]), util.writeNumber(length, 4)]);\n}\n\nexport function writePartialLength(power) {\n  if (power < 0 || power > 30) {\n    throw new Error('Partial Length power must be between 1 and 30');\n  }\n  return new Uint8Array([224 + power]);\n}\n\nexport function writeTag(tag_type) {\n  /* we're only generating v4 packet headers here */\n  return new Uint8Array([0xC0 | tag_type]);\n}\n\n/**\n * Writes a packet header version 4 with the given tag_type and length to a\n * string\n *\n * @param {Integer} tag_type - Tag type\n * @param {Integer} length - Length of the payload\n * @returns {String} String of the header.\n */\nexport function writeHeader(tag_type, length) {\n  /* we're only generating v4 packet headers here */\n  return util.concatUint8Array([writeTag(tag_type), writeSimpleLength(length)]);\n}\n\n/**\n * Whether the packet type supports partial lengths per RFC4880\n * @param {Integer} tag - Tag type\n * @returns {Boolean} String of the header.\n */\nexport function supportsStreaming(tag) {\n  return [\n    enums.packet.literalData,\n    enums.packet.compressedData,\n    enums.packet.symmetricallyEncryptedData,\n    enums.packet.symEncryptedIntegrityProtectedData,\n    enums.packet.aeadEncryptedData\n  ].includes(tag);\n}\n\n/**\n * Generic static Packet Parser function\n *\n * @param {Uint8Array | ReadableStream<Uint8Array>} input - Input stream as string\n * @param {Function} callback - Function to call with the parsed packet\n * @returns {Boolean} Returns false if the stream was empty and parsing is done, and true otherwise.\n */\nexport async function readPackets(input, callback) {\n  const reader = stream.getReader(input);\n  let writer;\n  let callbackReturned;\n  try {\n    const peekedBytes = await reader.peekBytes(2);\n    // some sanity checks\n    if (!peekedBytes || peekedBytes.length < 2 || (peekedBytes[0] & 0x80) === 0) {\n      throw new Error('Error during parsing. This message / key probably does not conform to a valid OpenPGP format.');\n    }\n    const headerByte = await reader.readByte();\n    let tag = -1;\n    let format = -1;\n    let packetLength;\n\n    format = 0; // 0 = old format; 1 = new format\n    if ((headerByte & 0x40) !== 0) {\n      format = 1;\n    }\n\n    let packetLengthType;\n    if (format) {\n      // new format header\n      tag = headerByte & 0x3F; // bit 5-0\n    } else {\n      // old format header\n      tag = (headerByte & 0x3F) >> 2; // bit 5-2\n      packetLengthType = headerByte & 0x03; // bit 1-0\n    }\n\n    const packetSupportsStreaming = supportsStreaming(tag);\n    let packet = null;\n    if (packetSupportsStreaming) {\n      if (util.isStream(input) === 'array') {\n        const arrayStream = new stream.ArrayStream();\n        writer = stream.getWriter(arrayStream);\n        packet = arrayStream;\n      } else {\n        const transform = new stream.TransformStream();\n        writer = stream.getWriter(transform.writable);\n        packet = transform.readable;\n      }\n      // eslint-disable-next-line callback-return\n      callbackReturned = callback({ tag, packet });\n    } else {\n      packet = [];\n    }\n\n    let wasPartialLength;\n    do {\n      if (!format) {\n        // 4.2.1. Old Format Packet Lengths\n        switch (packetLengthType) {\n          case 0:\n            // The packet has a one-octet length. The header is 2 octets\n            // long.\n            packetLength = await reader.readByte();\n            break;\n          case 1:\n            // The packet has a two-octet length. The header is 3 octets\n            // long.\n            packetLength = (await reader.readByte() << 8) | await reader.readByte();\n            break;\n          case 2:\n            // The packet has a four-octet length. The header is 5\n            // octets long.\n            packetLength = (await reader.readByte() << 24) | (await reader.readByte() << 16) | (await reader.readByte() <<\n              8) | await reader.readByte();\n            break;\n          default:\n            // 3 - The packet is of indeterminate length. The header is 1\n            // octet long, and the implementation must determine how long\n            // the packet is. If the packet is in a file, this means that\n            // the packet extends until the end of the file. In general,\n            // an implementation SHOULD NOT use indeterminate-length\n            // packets except where the end of the data will be clear\n            // from the context, and even then it is better to use a\n            // definite length, or a new format header. The new format\n            // headers described below have a mechanism for precisely\n            // encoding data of indeterminate length.\n            packetLength = Infinity;\n            break;\n        }\n      } else { // 4.2.2. New Format Packet Lengths\n        // 4.2.2.1. One-Octet Lengths\n        const lengthByte = await reader.readByte();\n        wasPartialLength = false;\n        if (lengthByte < 192) {\n          packetLength = lengthByte;\n          // 4.2.2.2. Two-Octet Lengths\n        } else if (lengthByte >= 192 && lengthByte < 224) {\n          packetLength = ((lengthByte - 192) << 8) + (await reader.readByte()) + 192;\n          // 4.2.2.4. Partial Body Lengths\n        } else if (lengthByte > 223 && lengthByte < 255) {\n          packetLength = 1 << (lengthByte & 0x1F);\n          wasPartialLength = true;\n          if (!packetSupportsStreaming) {\n            throw new TypeError('This packet type does not support partial lengths.');\n          }\n          // 4.2.2.3. Five-Octet Lengths\n        } else {\n          packetLength = (await reader.readByte() << 24) | (await reader.readByte() << 16) | (await reader.readByte() <<\n            8) | await reader.readByte();\n        }\n      }\n      if (packetLength > 0) {\n        let bytesRead = 0;\n        while (true) {\n          if (writer) await writer.ready;\n          const { done, value } = await reader.read();\n          if (done) {\n            if (packetLength === Infinity) break;\n            throw new Error('Unexpected end of packet');\n          }\n          const chunk = packetLength === Infinity ? value : value.subarray(0, packetLength - bytesRead);\n          if (writer) await writer.write(chunk);\n          else packet.push(chunk);\n          bytesRead += value.length;\n          if (bytesRead >= packetLength) {\n            reader.unshift(value.subarray(packetLength - bytesRead + value.length));\n            break;\n          }\n        }\n      }\n    } while (wasPartialLength);\n\n    // If this was not a packet that \"supports streaming\", we peek to check\n    // whether it is the last packet in the message. We peek 2 bytes instead\n    // of 1 because the beginning of this function also peeks 2 bytes, and we\n    // want to cut a `subarray` of the correct length into `web-stream-tools`'\n    // `externalBuffer` as a tiny optimization here.\n    //\n    // If it *was* a streaming packet (i.e. the data packets), we peek at the\n    // entire remainder of the stream, in order to forward errors in the\n    // remainder of the stream to the packet data. (Note that this means we\n    // read/peek at all signature packets before closing the literal data\n    // packet, for example.) This forwards MDC errors to the literal data\n    // stream, for example, so that they don't get lost / forgotten on\n    // decryptedMessage.packets.stream, which we never look at.\n    //\n    // An example of what we do when stream-parsing a message containing\n    // [ one-pass signature packet, literal data packet, signature packet ]:\n    // 1. Read the one-pass signature packet\n    // 2. Peek 2 bytes of the literal data packet\n    // 3. Parse the one-pass signature packet\n    //\n    // 4. Read the literal data packet, simultaneously stream-parsing it\n    // 5. Peek until the end of the message\n    // 6. Finish parsing the literal data packet\n    //\n    // 7. Read the signature packet again (we already peeked at it in step 5)\n    // 8. Peek at the end of the stream again (`peekBytes` returns undefined)\n    // 9. Parse the signature packet\n    //\n    // Note that this means that if there's an error in the very end of the\n    // stream, such as an MDC error, we throw in step 5 instead of in step 8\n    // (or never), which is the point of this exercise.\n    const nextPacket = await reader.peekBytes(packetSupportsStreaming ? Infinity : 2);\n    if (writer) {\n      await writer.ready;\n      await writer.close();\n    } else {\n      packet = util.concatUint8Array(packet);\n      // eslint-disable-next-line callback-return\n      await callback({ tag, packet });\n    }\n    return !nextPacket || !nextPacket.length;\n  } catch (e) {\n    if (writer) {\n      await writer.abort(e);\n      return true;\n    } else {\n      throw e;\n    }\n  } finally {\n    if (writer) {\n      await callbackReturned;\n    }\n    reader.releaseLock();\n  }\n}\n\nexport class UnsupportedError extends Error {\n  constructor(...params) {\n    super(...params);\n\n    if (Error.captureStackTrace) {\n      Error.captureStackTrace(this, UnsupportedError);\n    }\n\n    this.name = 'UnsupportedError';\n  }\n}\n\nexport class UnparseablePacket {\n  constructor(tag, rawContent) {\n    this.tag = tag;\n    this.rawContent = rawContent;\n  }\n\n  write() {\n    return this.rawContent;\n  }\n}\n","// OpenPGP.js - An OpenPGP implementation in javascript\n// Copyright (C) 2015-2016 Decentral\n//\n// This library is free software; you can redistribute it and/or\n// modify it under the terms of the GNU Lesser General Public\n// License as published by the Free Software Foundation; either\n// version 3.0 of the License, or (at your option) any later version.\n//\n// This library is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n// Lesser General Public License for more details.\n//\n// You should have received a copy of the GNU Lesser General Public\n// License along with this library; if not, write to the Free Software\n// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n\n/**\n * @fileoverview Wrapper of an instance of an Elliptic Curve\n * @module crypto/public_key/elliptic/curve\n * @private\n */\n\nimport nacl from '@openpgp/tweetnacl/nacl-fast-light';\nimport { getRandomBytes } from '../../random';\nimport enums from '../../../enums';\nimport util from '../../../util';\nimport { uint8ArrayToB64, b64ToUint8Array } from '../../../encoding/base64';\nimport OID from '../../../type/oid';\nimport { keyFromPublic, keyFromPrivate, getIndutnyCurve } from './indutnyKey';\nimport { UnsupportedError } from '../../../packet/packet';\n\nconst webCrypto = util.getWebCrypto();\nconst nodeCrypto = util.getNodeCrypto();\n\nconst webCurves = {\n  'p256': 'P-256',\n  'p384': 'P-384',\n  'p521': 'P-521'\n};\nconst knownCurves = nodeCrypto ? nodeCrypto.getCurves() : [];\nconst nodeCurves = nodeCrypto ? {\n  secp256k1: knownCurves.includes('secp256k1') ? 'secp256k1' : undefined,\n  p256: knownCurves.includes('prime256v1') ? 'prime256v1' : undefined,\n  p384: knownCurves.includes('secp384r1') ? 'secp384r1' : undefined,\n  p521: knownCurves.includes('secp521r1') ? 'secp521r1' : undefined,\n  ed25519: knownCurves.includes('ED25519') ? 'ED25519' : undefined,\n  curve25519: knownCurves.includes('X25519') ? 'X25519' : undefined,\n  brainpoolP256r1: knownCurves.includes('brainpoolP256r1') ? 'brainpoolP256r1' : undefined,\n  brainpoolP384r1: knownCurves.includes('brainpoolP384r1') ? 'brainpoolP384r1' : undefined,\n  brainpoolP512r1: knownCurves.includes('brainpoolP512r1') ? 'brainpoolP512r1' : undefined\n} : {};\n\nconst curves = {\n  p256: {\n    oid: [0x06, 0x08, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x03, 0x01, 0x07],\n    keyType: enums.publicKey.ecdsa,\n    hash: enums.hash.sha256,\n    cipher: enums.symmetric.aes128,\n    node: nodeCurves.p256,\n    web: webCurves.p256,\n    payloadSize: 32,\n    sharedSize: 256\n  },\n  p384: {\n    oid: [0x06, 0x05, 0x2B, 0x81, 0x04, 0x00, 0x22],\n    keyType: enums.publicKey.ecdsa,\n    hash: enums.hash.sha384,\n    cipher: enums.symmetric.aes192,\n    node: nodeCurves.p384,\n    web: webCurves.p384,\n    payloadSize: 48,\n    sharedSize: 384\n  },\n  p521: {\n    oid: [0x06, 0x05, 0x2B, 0x81, 0x04, 0x00, 0x23],\n    keyType: enums.publicKey.ecdsa,\n    hash: enums.hash.sha512,\n    cipher: enums.symmetric.aes256,\n    node: nodeCurves.p521,\n    web: webCurves.p521,\n    payloadSize: 66,\n    sharedSize: 528\n  },\n  secp256k1: {\n    oid: [0x06, 0x05, 0x2B, 0x81, 0x04, 0x00, 0x0A],\n    keyType: enums.publicKey.ecdsa,\n    hash: enums.hash.sha256,\n    cipher: enums.symmetric.aes128,\n    node: nodeCurves.secp256k1,\n    payloadSize: 32\n  },\n  ed25519: {\n    oid: [0x06, 0x09, 0x2B, 0x06, 0x01, 0x04, 0x01, 0xDA, 0x47, 0x0F, 0x01],\n    keyType: enums.publicKey.eddsaLegacy,\n    hash: enums.hash.sha512,\n    node: false, // nodeCurves.ed25519 TODO\n    payloadSize: 32\n  },\n  curve25519: {\n    oid: [0x06, 0x0A, 0x2B, 0x06, 0x01, 0x04, 0x01, 0x97, 0x55, 0x01, 0x05, 0x01],\n    keyType: enums.publicKey.ecdh,\n    hash: enums.hash.sha256,\n    cipher: enums.symmetric.aes128,\n    node: false, // nodeCurves.curve25519 TODO\n    payloadSize: 32\n  },\n  brainpoolP256r1: {\n    oid: [0x06, 0x09, 0x2B, 0x24, 0x03, 0x03, 0x02, 0x08, 0x01, 0x01, 0x07],\n    keyType: enums.publicKey.ecdsa,\n    hash: enums.hash.sha256,\n    cipher: enums.symmetric.aes128,\n    node: nodeCurves.brainpoolP256r1,\n    payloadSize: 32\n  },\n  brainpoolP384r1: {\n    oid: [0x06, 0x09, 0x2B, 0x24, 0x03, 0x03, 0x02, 0x08, 0x01, 0x01, 0x0B],\n    keyType: enums.publicKey.ecdsa,\n    hash: enums.hash.sha384,\n    cipher: enums.symmetric.aes192,\n    node: nodeCurves.brainpoolP384r1,\n    payloadSize: 48\n  },\n  brainpoolP512r1: {\n    oid: [0x06, 0x09, 0x2B, 0x24, 0x03, 0x03, 0x02, 0x08, 0x01, 0x01, 0x0D],\n    keyType: enums.publicKey.ecdsa,\n    hash: enums.hash.sha512,\n    cipher: enums.symmetric.aes256,\n    node: nodeCurves.brainpoolP512r1,\n    payloadSize: 64\n  }\n};\n\nclass CurveWithOID {\n  constructor(oidOrName, params) {\n    try {\n      if (util.isArray(oidOrName) ||\n          util.isUint8Array(oidOrName)) {\n        // by oid byte array\n        oidOrName = new OID(oidOrName);\n      }\n      if (oidOrName instanceof OID) {\n        // by curve OID\n        oidOrName = oidOrName.getName();\n      }\n      // by curve name or oid string\n      this.name = enums.write(enums.curve, oidOrName);\n    } catch (err) {\n      throw new UnsupportedError('Unknown curve');\n    }\n    params = params || curves[this.name];\n\n    this.keyType = params.keyType;\n\n    this.oid = params.oid;\n    this.hash = params.hash;\n    this.cipher = params.cipher;\n    this.node = params.node && curves[this.name];\n    this.web = params.web && curves[this.name];\n    this.payloadSize = params.payloadSize;\n    if (this.web && util.getWebCrypto()) {\n      this.type = 'web';\n    } else if (this.node && util.getNodeCrypto()) {\n      this.type = 'node';\n    } else if (this.name === 'curve25519') {\n      this.type = 'curve25519';\n    } else if (this.name === 'ed25519') {\n      this.type = 'ed25519';\n    }\n  }\n\n  async genKeyPair() {\n    let keyPair;\n    switch (this.type) {\n      case 'web':\n        try {\n          return await webGenKeyPair(this.name);\n        } catch (err) {\n          util.printDebugError('Browser did not support generating ec key ' + err.message);\n          break;\n        }\n      case 'node':\n        return nodeGenKeyPair(this.name);\n      case 'curve25519': {\n        const privateKey = getRandomBytes(32);\n        privateKey[0] = (privateKey[0] & 127) | 64;\n        privateKey[31] &= 248;\n        const secretKey = privateKey.slice().reverse();\n        keyPair = nacl.box.keyPair.fromSecretKey(secretKey);\n        const publicKey = util.concatUint8Array([new Uint8Array([0x40]), keyPair.publicKey]);\n        return { publicKey, privateKey };\n      }\n      case 'ed25519': {\n        const privateKey = getRandomBytes(32);\n        const keyPair = nacl.sign.keyPair.fromSeed(privateKey);\n        const publicKey = util.concatUint8Array([new Uint8Array([0x40]), keyPair.publicKey]);\n        return { publicKey, privateKey };\n      }\n    }\n    const indutnyCurve = await getIndutnyCurve(this.name);\n    keyPair = await indutnyCurve.genKeyPair({\n      entropy: util.uint8ArrayToString(getRandomBytes(32))\n    });\n    return { publicKey: new Uint8Array(keyPair.getPublic('array', false)), privateKey: keyPair.getPrivate().toArrayLike(Uint8Array) };\n  }\n}\n\nasync function generate(curve) {\n  const BigInteger = await util.getBigInteger();\n\n  curve = new CurveWithOID(curve);\n  const keyPair = await curve.genKeyPair();\n  const Q = new BigInteger(keyPair.publicKey).toUint8Array();\n  const secret = new BigInteger(keyPair.privateKey).toUint8Array('be', curve.payloadSize);\n  return {\n    oid: curve.oid,\n    Q,\n    secret,\n    hash: curve.hash,\n    cipher: curve.cipher\n  };\n}\n\n/**\n * Get preferred hash algo to use with the given curve\n * @param {module:type/oid} oid - curve oid\n * @returns {enums.hash} hash algorithm\n */\nfunction getPreferredHashAlgo(oid) {\n  return curves[enums.write(enums.curve, oid.toHex())].hash;\n}\n\n/**\n * Validate ECDH and ECDSA parameters\n * Not suitable for EdDSA (different secret key format)\n * @param {module:enums.publicKey} algo - EC algorithm, to filter supported curves\n * @param {module:type/oid} oid - EC object identifier\n * @param {Uint8Array} Q - EC public point\n * @param {Uint8Array} d - EC secret scalar\n * @returns {Promise<Boolean>} Whether params are valid.\n * @async\n */\nasync function validateStandardParams(algo, oid, Q, d) {\n  const supportedCurves = {\n    p256: true,\n    p384: true,\n    p521: true,\n    secp256k1: true,\n    curve25519: algo === enums.publicKey.ecdh,\n    brainpoolP256r1: true,\n    brainpoolP384r1: true,\n    brainpoolP512r1: true\n  };\n\n  // Check whether the given curve is supported\n  const curveName = oid.getName();\n  if (!supportedCurves[curveName]) {\n    return false;\n  }\n\n  if (curveName === 'curve25519') {\n    d = d.slice().reverse();\n    // Re-derive public point Q'\n    const { publicKey } = nacl.box.keyPair.fromSecretKey(d);\n\n    Q = new Uint8Array(Q);\n    const dG = new Uint8Array([0x40, ...publicKey]); // Add public key prefix\n    if (!util.equalsUint8Array(dG, Q)) {\n      return false;\n    }\n\n    return true;\n  }\n\n  const curve = await getIndutnyCurve(curveName);\n  try {\n    // Parse Q and check that it is on the curve but not at infinity\n    Q = keyFromPublic(curve, Q).getPublic();\n  } catch (validationErrors) {\n    return false;\n  }\n\n  /**\n   * Re-derive public point Q' = dG from private key\n   * Expect Q == Q'\n   */\n  const dG = keyFromPrivate(curve, d).getPublic();\n  if (!dG.eq(Q)) {\n    return false;\n  }\n\n  return true;\n}\n\nexport {\n  CurveWithOID, curves, webCurves, nodeCurves, generate, getPreferredHashAlgo, jwkToRawPublic, rawPublicToJWK, privateToJWK, validateStandardParams\n};\n\n//////////////////////////\n//                      //\n//   Helper functions   //\n//                      //\n//////////////////////////\n\n\nasync function webGenKeyPair(name) {\n  // Note: keys generated with ECDSA and ECDH are structurally equivalent\n  const webCryptoKey = await webCrypto.generateKey({ name: 'ECDSA', namedCurve: webCurves[name] }, true, ['sign', 'verify']);\n\n  const privateKey = await webCrypto.exportKey('jwk', webCryptoKey.privateKey);\n  const publicKey = await webCrypto.exportKey('jwk', webCryptoKey.publicKey);\n\n  return {\n    publicKey: jwkToRawPublic(publicKey),\n    privateKey: b64ToUint8Array(privateKey.d, true)\n  };\n}\n\nasync function nodeGenKeyPair(name) {\n  // Note: ECDSA and ECDH key generation is structurally equivalent\n  const ecdh = nodeCrypto.createECDH(nodeCurves[name]);\n  await ecdh.generateKeys();\n  return {\n    publicKey: new Uint8Array(ecdh.getPublicKey()),\n    privateKey: new Uint8Array(ecdh.getPrivateKey())\n  };\n}\n\n//////////////////////////\n//                      //\n//   Helper functions   //\n//                      //\n//////////////////////////\n\n/**\n * @param {JsonWebKey} jwk - key for conversion\n *\n * @returns {Uint8Array} Raw public key.\n */\nfunction jwkToRawPublic(jwk) {\n  const bufX = b64ToUint8Array(jwk.x);\n  const bufY = b64ToUint8Array(jwk.y);\n  const publicKey = new Uint8Array(bufX.length + bufY.length + 1);\n  publicKey[0] = 0x04;\n  publicKey.set(bufX, 1);\n  publicKey.set(bufY, bufX.length + 1);\n  return publicKey;\n}\n\n/**\n * @param {Integer} payloadSize - ec payload size\n * @param {String} name - curve name\n * @param {Uint8Array} publicKey - public key\n *\n * @returns {JsonWebKey} Public key in jwk format.\n */\nfunction rawPublicToJWK(payloadSize, name, publicKey) {\n  const len = payloadSize;\n  const bufX = publicKey.slice(1, len + 1);\n  const bufY = publicKey.slice(len + 1, len * 2 + 1);\n  // https://www.rfc-editor.org/rfc/rfc7518.txt\n  const jwk = {\n    kty: 'EC',\n    crv: name,\n    x: uint8ArrayToB64(bufX, true),\n    y: uint8ArrayToB64(bufY, true),\n    ext: true\n  };\n  return jwk;\n}\n\n/**\n * @param {Integer} payloadSize - ec payload size\n * @param {String} name - curve name\n * @param {Uint8Array} publicKey - public key\n * @param {Uint8Array} privateKey - private key\n *\n * @returns {JsonWebKey} Private key in jwk format.\n */\nfunction privateToJWK(payloadSize, name, publicKey, privateKey) {\n  const jwk = rawPublicToJWK(payloadSize, name, publicKey);\n  jwk.d = uint8ArrayToB64(privateKey, true);\n  return jwk;\n}\n","// OpenPGP.js - An OpenPGP implementation in javascript\n// Copyright (C) 2015-2016 Decentral\n//\n// This library is free software; you can redistribute it and/or\n// modify it under the terms of the GNU Lesser General Public\n// License as published by the Free Software Foundation; either\n// version 3.0 of the License, or (at your option) any later version.\n//\n// This library is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n// Lesser General Public License for more details.\n//\n// You should have received a copy of the GNU Lesser General Public\n// License along with this library; if not, write to the Free Software\n// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n\n/**\n * @fileoverview Implementation of ECDSA following RFC6637 for Openpgpjs\n * @module crypto/public_key/elliptic/ecdsa\n * @private\n */\n\nimport enums from '../../../enums';\nimport util from '../../../util';\nimport { getRandomBytes } from '../../random';\nimport hash from '../../hash';\nimport { CurveWithOID, webCurves, privateToJWK, rawPublicToJWK, validateStandardParams } from './oid_curves';\nimport { getIndutnyCurve, keyFromPrivate, keyFromPublic } from './indutnyKey';\n\nconst webCrypto = util.getWebCrypto();\nconst nodeCrypto = util.getNodeCrypto();\n\n/**\n * Sign a message using the provided key\n * @param {module:type/oid} oid - Elliptic curve object identifier\n * @param {module:enums.hash} hashAlgo - Hash algorithm used to sign\n * @param {Uint8Array} message - Message to sign\n * @param {Uint8Array} publicKey - Public key\n * @param {Uint8Array} privateKey - Private key used to sign the message\n * @param {Uint8Array} hashed - The hashed message\n * @returns {Promise<{\n *   r: Uint8Array,\n *   s: Uint8Array\n * }>} Signature of the message\n * @async\n */\nexport async function sign(oid, hashAlgo, message, publicKey, privateKey, hashed) {\n  const curve = new CurveWithOID(oid);\n  if (message && !util.isStream(message)) {\n    const keyPair = { publicKey, privateKey };\n    switch (curve.type) {\n      case 'web': {\n        // If browser doesn't support a curve, we'll catch it\n        try {\n          // Need to await to make sure browser succeeds\n          return await webSign(curve, hashAlgo, message, keyPair);\n        } catch (err) {\n          // We do not fallback if the error is related to key integrity\n          // Unfortunaley Safari does not support p521 and throws a DataError when using it\n          // So we need to always fallback for that curve\n          if (curve.name !== 'p521' && (err.name === 'DataError' || err.name === 'OperationError')) {\n            throw err;\n          }\n          util.printDebugError('Browser did not support signing: ' + err.message);\n        }\n        break;\n      }\n      case 'node': {\n        const signature = await nodeSign(curve, hashAlgo, message, keyPair);\n        return {\n          r: signature.r.toArrayLike(Uint8Array),\n          s: signature.s.toArrayLike(Uint8Array)\n        };\n      }\n    }\n  }\n  return ellipticSign(curve, hashed, privateKey);\n}\n\n/**\n * Verifies if a signature is valid for a message\n * @param {module:type/oid} oid - Elliptic curve object identifier\n * @param {module:enums.hash} hashAlgo - Hash algorithm used in the signature\n * @param  {{r: Uint8Array,\n             s: Uint8Array}}   signature Signature to verify\n * @param {Uint8Array} message - Message to verify\n * @param {Uint8Array} publicKey - Public key used to verify the message\n * @param {Uint8Array} hashed - The hashed message\n * @returns {Boolean}\n * @async\n */\nexport async function verify(oid, hashAlgo, signature, message, publicKey, hashed) {\n  const curve = new CurveWithOID(oid);\n  if (message && !util.isStream(message)) {\n    switch (curve.type) {\n      case 'web':\n        try {\n          // Need to await to make sure browser succeeds\n          return await webVerify(curve, hashAlgo, signature, message, publicKey);\n        } catch (err) {\n          // We do not fallback if the error is related to key integrity\n          // Unfortunately Safari does not support p521 and throws a DataError when using it\n          // So we need to always fallback for that curve\n          if (curve.name !== 'p521' && (err.name === 'DataError' || err.name === 'OperationError')) {\n            throw err;\n          }\n          util.printDebugError('Browser did not support verifying: ' + err.message);\n        }\n        break;\n      case 'node':\n        return nodeVerify(curve, hashAlgo, signature, message, publicKey);\n    }\n  }\n  const digest = (typeof hashAlgo === 'undefined') ? message : hashed;\n  return ellipticVerify(curve, signature, digest, publicKey);\n}\n\n/**\n * Validate ECDSA parameters\n * @param {module:type/oid} oid - Elliptic curve object identifier\n * @param {Uint8Array} Q - ECDSA public point\n * @param {Uint8Array} d - ECDSA secret scalar\n * @returns {Promise<Boolean>} Whether params are valid.\n * @async\n */\nexport async function validateParams(oid, Q, d) {\n  const curve = new CurveWithOID(oid);\n  // Reject curves x25519 and ed25519\n  if (curve.keyType !== enums.publicKey.ecdsa) {\n    return false;\n  }\n\n  // To speed up the validation, we try to use node- or webcrypto when available\n  // and sign + verify a random message\n  switch (curve.type) {\n    case 'web':\n    case 'node': {\n      const message = getRandomBytes(8);\n      const hashAlgo = enums.hash.sha256;\n      const hashed = await hash.digest(hashAlgo, message);\n      try {\n        const signature = await sign(oid, hashAlgo, message, Q, d, hashed);\n        return await verify(oid, hashAlgo, signature, message, Q, hashed);\n      } catch (err) {\n        return false;\n      }\n    }\n    default:\n      return validateStandardParams(enums.publicKey.ecdsa, oid, Q, d);\n  }\n}\n\n\n//////////////////////////\n//                      //\n//   Helper functions   //\n//                      //\n//////////////////////////\n\nasync function ellipticSign(curve, hashed, privateKey) {\n  const indutnyCurve = await getIndutnyCurve(curve.name);\n  const key = keyFromPrivate(indutnyCurve, privateKey);\n  const signature = key.sign(hashed);\n  return {\n    r: signature.r.toArrayLike(Uint8Array),\n    s: signature.s.toArrayLike(Uint8Array)\n  };\n}\n\nasync function ellipticVerify(curve, signature, digest, publicKey) {\n  const indutnyCurve = await getIndutnyCurve(curve.name);\n  const key = keyFromPublic(indutnyCurve, publicKey);\n  return key.verify(digest, signature);\n}\n\nasync function webSign(curve, hashAlgo, message, keyPair) {\n  const len = curve.payloadSize;\n  const jwk = privateToJWK(curve.payloadSize, webCurves[curve.name], keyPair.publicKey, keyPair.privateKey);\n  const key = await webCrypto.importKey(\n    'jwk',\n    jwk,\n    {\n      'name': 'ECDSA',\n      'namedCurve': webCurves[curve.name],\n      'hash': { name: enums.read(enums.webHash, curve.hash) }\n    },\n    false,\n    ['sign']\n  );\n\n  const signature = new Uint8Array(await webCrypto.sign(\n    {\n      'name': 'ECDSA',\n      'namedCurve': webCurves[curve.name],\n      'hash': { name: enums.read(enums.webHash, hashAlgo) }\n    },\n    key,\n    message\n  ));\n\n  return {\n    r: signature.slice(0, len),\n    s: signature.slice(len, len << 1)\n  };\n}\n\nasync function webVerify(curve, hashAlgo, { r, s }, message, publicKey) {\n  const jwk = rawPublicToJWK(curve.payloadSize, webCurves[curve.name], publicKey);\n  const key = await webCrypto.importKey(\n    'jwk',\n    jwk,\n    {\n      'name': 'ECDSA',\n      'namedCurve': webCurves[curve.name],\n      'hash': { name: enums.read(enums.webHash, curve.hash) }\n    },\n    false,\n    ['verify']\n  );\n\n  const signature = util.concatUint8Array([r, s]).buffer;\n\n  return webCrypto.verify(\n    {\n      'name': 'ECDSA',\n      'namedCurve': webCurves[curve.name],\n      'hash': { name: enums.read(enums.webHash, hashAlgo) }\n    },\n    key,\n    signature,\n    message\n  );\n}\n\nasync function nodeSign(curve, hashAlgo, message, keyPair) {\n  const sign = nodeCrypto.createSign(enums.read(enums.hash, hashAlgo));\n  sign.write(message);\n  sign.end();\n  const key = ECPrivateKey.encode({\n    version: 1,\n    parameters: curve.oid,\n    privateKey: Array.from(keyPair.privateKey),\n    publicKey: { unused: 0, data: Array.from(keyPair.publicKey) }\n  }, 'pem', {\n    label: 'EC PRIVATE KEY'\n  });\n\n  return ECDSASignature.decode(sign.sign(key), 'der');\n}\n\nasync function nodeVerify(curve, hashAlgo, { r, s }, message, publicKey) {\n  const { default: BN } = await import('bn.js');\n\n  const verify = nodeCrypto.createVerify(enums.read(enums.hash, hashAlgo));\n  verify.write(message);\n  verify.end();\n  const key = SubjectPublicKeyInfo.encode({\n    algorithm: {\n      algorithm: [1, 2, 840, 10045, 2, 1],\n      parameters: curve.oid\n    },\n    subjectPublicKey: { unused: 0, data: Array.from(publicKey) }\n  }, 'pem', {\n    label: 'PUBLIC KEY'\n  });\n  const signature = ECDSASignature.encode({\n    r: new BN(r), s: new BN(s)\n  }, 'der');\n\n  try {\n    return verify.verify(key, signature);\n  } catch (err) {\n    return false;\n  }\n}\n\n// Originally written by Owen Smith https://github.com/omsmith\n// Adapted on Feb 2018 from https://github.com/Brightspace/node-jwk-to-pem/\n\n/* eslint-disable no-invalid-this */\n\nconst asn1 = nodeCrypto ? require('asn1.js') : undefined;\n\nconst ECDSASignature = nodeCrypto ?\n  asn1.define('ECDSASignature', function() {\n    this.seq().obj(\n      this.key('r').int(),\n      this.key('s').int()\n    );\n  }) : undefined;\n\nconst ECPrivateKey = nodeCrypto ?\n  asn1.define('ECPrivateKey', function() {\n    this.seq().obj(\n      this.key('version').int(),\n      this.key('privateKey').octstr(),\n      this.key('parameters').explicit(0).optional().any(),\n      this.key('publicKey').explicit(1).optional().bitstr()\n    );\n  }) : undefined;\n\nconst AlgorithmIdentifier = nodeCrypto ?\n  asn1.define('AlgorithmIdentifier', function() {\n    this.seq().obj(\n      this.key('algorithm').objid(),\n      this.key('parameters').optional().any()\n    );\n  }) : undefined;\n\nconst SubjectPublicKeyInfo = nodeCrypto ?\n  asn1.define('SubjectPublicKeyInfo', function() {\n    this.seq().obj(\n      this.key('algorithm').use(AlgorithmIdentifier),\n      this.key('subjectPublicKey').bitstr()\n    );\n  }) : undefined;\n","// OpenPGP.js - An OpenPGP implementation in javascript\n// Copyright (C) 2018 Proton Technologies AG\n//\n// This library is free software; you can redistribute it and/or\n// modify it under the terms of the GNU Lesser General Public\n// License as published by the Free Software Foundation; either\n// version 3.0 of the License, or (at your option) any later version.\n//\n// This library is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n// Lesser General Public License for more details.\n//\n// You should have received a copy of the GNU Lesser General Public\n// License along with this library; if not, write to the Free Software\n// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n\n/**\n * @fileoverview Implementation of legacy EdDSA following RFC4880bis-03 for OpenPGP.\n * This key type has been deprecated by the crypto-refresh RFC.\n * @module crypto/public_key/elliptic/eddsa_legacy\n * @private\n */\n\nimport sha512 from 'hash.js/lib/hash/sha/512';\nimport nacl from '@openpgp/tweetnacl/nacl-fast-light';\nimport util from '../../../util';\nimport enums from '../../../enums';\nimport hash from '../../hash';\n\nnacl.hash = bytes => new Uint8Array(sha512().update(bytes).digest());\n\n/**\n * Sign a message using the provided legacy EdDSA key\n * @param {module:type/oid} oid - Elliptic curve object identifier\n * @param {module:enums.hash} hashAlgo - Hash algorithm used to sign (must be sha256 or stronger)\n * @param {Uint8Array} message - Message to sign\n * @param {Uint8Array} publicKey - Public key\n * @param {Uint8Array} privateKey - Private key used to sign the message\n * @param {Uint8Array} hashed - The hashed message\n * @returns {Promise<{\n *   r: Uint8Array,\n *   s: Uint8Array\n * }>} Signature of the message\n * @async\n */\nexport async function sign(oid, hashAlgo, message, publicKey, privateKey, hashed) {\n  if (hash.getHashByteLength(hashAlgo) < hash.getHashByteLength(enums.hash.sha256)) {\n    // see https://tools.ietf.org/id/draft-ietf-openpgp-rfc4880bis-10.html#section-15-7.2\n    throw new Error('Hash algorithm too weak for EdDSA.');\n  }\n  const secretKey = util.concatUint8Array([privateKey, publicKey.subarray(1)]);\n  const signature = nacl.sign.detached(hashed, secretKey);\n  // EdDSA signature params are returned in little-endian format\n  return {\n    r: signature.subarray(0, 32),\n    s: signature.subarray(32)\n  };\n}\n\n/**\n * Verifies if a legacy EdDSA signature is valid for a message\n * @param {module:type/oid} oid - Elliptic curve object identifier\n * @param {module:enums.hash} hashAlgo - Hash algorithm used in the signature\n * @param  {{r: Uint8Array,\n             s: Uint8Array}}   signature Signature to verify the message\n * @param {Uint8Array} m - Message to verify\n * @param {Uint8Array} publicKey - Public key used to verify the message\n * @param {Uint8Array} hashed - The hashed message\n * @returns {Boolean}\n * @async\n */\nexport async function verify(oid, hashAlgo, { r, s }, m, publicKey, hashed) {\n  if (hash.getHashByteLength(hashAlgo) < hash.getHashByteLength(enums.hash.sha256)) {\n    throw new Error('Hash algorithm too weak for EdDSA.');\n  }\n  const signature = util.concatUint8Array([r, s]);\n  return nacl.sign.detached.verify(hashed, signature, publicKey.subarray(1));\n}\n/**\n * Validate legacy EdDSA parameters\n * @param {module:type/oid} oid - Elliptic curve object identifier\n * @param {Uint8Array} Q - EdDSA public point\n * @param {Uint8Array} k - EdDSA secret seed\n * @returns {Promise<Boolean>} Whether params are valid.\n * @async\n */\nexport async function validateParams(oid, Q, k) {\n  // Check whether the given curve is supported\n  if (oid.getName() !== 'ed25519') {\n    return false;\n  }\n\n  /**\n   * Derive public point Q' = dG from private key\n   * and expect Q == Q'\n   */\n  const { publicKey } = nacl.sign.keyPair.fromSeed(k);\n  const dG = new Uint8Array([0x40, ...publicKey]); // Add public key prefix\n  return util.equalsUint8Array(Q, dG);\n\n}\n","// OpenPGP.js - An OpenPGP implementation in javascript\n// Copyright (C) 2018 Proton Technologies AG\n//\n// This library is free software; you can redistribute it and/or\n// modify it under the terms of the GNU Lesser General Public\n// License as published by the Free Software Foundation; either\n// version 3.0 of the License, or (at your option) any later version.\n//\n// This library is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n// Lesser General Public License for more details.\n//\n// You should have received a copy of the GNU Lesser General Public\n// License along with this library; if not, write to the Free Software\n// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n\n/**\n * @fileoverview Implementation of EdDSA following RFC4880bis-03 for OpenPGP\n * @module crypto/public_key/elliptic/eddsa\n * @private\n */\n\nimport sha512 from 'hash.js/lib/hash/sha/512';\nimport nacl from '@openpgp/tweetnacl/nacl-fast-light';\nimport util from '../../../util';\nimport enums from '../../../enums';\nimport hash from '../../hash';\nimport { getRandomBytes } from '../../random';\n\nnacl.hash = bytes => new Uint8Array(sha512().update(bytes).digest());\n\n/**\n * Generate (non-legacy) EdDSA key\n * @param {module:enums.publicKey} algo - Algorithm identifier\n * @returns {Promise<{ A: Uint8Array, seed: Uint8Array }>}\n */\nexport async function generate(algo) {\n  switch (algo) {\n    case enums.publicKey.ed25519: {\n      const seed = getRandomBytes(32);\n      const { publicKey: A } = nacl.sign.keyPair.fromSeed(seed);\n      return { A, seed };\n    }\n    default:\n      throw new Error('Unsupported EdDSA algorithm');\n  }\n}\n\n/**\n * Sign a message using the provided key\n * @param {module:enums.publicKey} algo - Algorithm identifier\n * @param {module:enums.hash} hashAlgo - Hash algorithm used to sign (must be sha256 or stronger)\n * @param {Uint8Array} message - Message to sign\n * @param {Uint8Array} publicKey - Public key\n * @param {Uint8Array} privateKey - Private key used to sign the message\n * @param {Uint8Array} hashed - The hashed message\n * @returns {Promise<{\n *   RS: Uint8Array\n * }>} Signature of the message\n * @async\n */\nexport async function sign(algo, hashAlgo, message, publicKey, privateKey, hashed) {\n  if (hash.getHashByteLength(hashAlgo) < hash.getHashByteLength(getPreferredHashAlgo(algo))) {\n    throw new Error('Hash algorithm too weak for EdDSA.');\n  }\n  switch (algo) {\n    case enums.publicKey.ed25519: {\n      const secretKey = util.concatUint8Array([privateKey, publicKey]);\n      const signature = nacl.sign.detached(hashed, secretKey);\n      return { RS: signature };\n    }\n    case enums.publicKey.ed448:\n    default:\n      throw new Error('Unsupported EdDSA algorithm');\n  }\n\n}\n\n/**\n * Verifies if a signature is valid for a message\n * @param {module:enums.publicKey} algo - Algorithm identifier\n * @param {module:enums.hash} hashAlgo - Hash algorithm used in the signature\n * @param  {{ RS: Uint8Array }} signature Signature to verify the message\n * @param {Uint8Array} m - Message to verify\n * @param {Uint8Array} publicKey - Public key used to verify the message\n * @param {Uint8Array} hashed - The hashed message\n * @returns {Boolean}\n * @async\n */\nexport async function verify(algo, hashAlgo, { RS }, m, publicKey, hashed) {\n  if (hash.getHashByteLength(hashAlgo) < hash.getHashByteLength(getPreferredHashAlgo(algo))) {\n    throw new Error('Hash algorithm too weak for EdDSA.');\n  }\n  switch (algo) {\n    case enums.publicKey.ed25519: {\n      return nacl.sign.detached.verify(hashed, RS, publicKey);\n    }\n    case enums.publicKey.ed448:\n    default:\n      throw new Error('Unsupported EdDSA algorithm');\n  }\n}\n/**\n * Validate (non-legacy) EdDSA parameters\n * @param {module:enums.publicKey} algo - Algorithm identifier\n * @param {Uint8Array} A - EdDSA public point\n * @param {Uint8Array} seed - EdDSA secret seed\n * @param {Uint8Array} oid - (legacy only) EdDSA OID\n * @returns {Promise<Boolean>} Whether params are valid.\n * @async\n */\nexport async function validateParams(algo, A, seed) {\n  switch (algo) {\n    case enums.publicKey.ed25519: {\n      /**\n       * Derive public point A' from private key\n       * and expect A == A'\n       */\n      const { publicKey } = nacl.sign.keyPair.fromSeed(seed);\n      return util.equalsUint8Array(A, publicKey);\n    }\n\n    case enums.publicKey.ed448: // unsupported\n    default:\n      return false;\n  }\n}\n\nexport function getPreferredHashAlgo(algo) {\n  switch (algo) {\n    case enums.publicKey.ed25519:\n      return enums.hash.sha256;\n    default:\n      throw new Error('Unknown EdDSA algo');\n  }\n}\n","// OpenPGP.js - An OpenPGP implementation in javascript\n// Copyright (C) 2015-2016 Decentral\n//\n// This library is free software; you can redistribute it and/or\n// modify it under the terms of the GNU Lesser General Public\n// License as published by the Free Software Foundation; either\n// version 3.0 of the License, or (at your option) any later version.\n//\n// This library is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n// Lesser General Public License for more details.\n//\n// You should have received a copy of the GNU Lesser General Public\n// License along with this library; if not, write to the Free Software\n// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n\n/**\n * @fileoverview Implementation of RFC 3394 AES Key Wrap & Key Unwrap funcions\n * @see module:crypto/public_key/elliptic/ecdh\n * @module crypto/aes_kw\n * @private\n */\n\nimport * as cipher from './cipher';\nimport util from '../util';\n\n/**\n * AES key wrap\n * @function\n * @param {Uint8Array} key\n * @param {Uint8Array} data\n * @returns {Uint8Array}\n */\nexport function wrap(key, data) {\n  const aes = new cipher['aes' + (key.length * 8)](key);\n  const IV = new Uint32Array([0xA6A6A6A6, 0xA6A6A6A6]);\n  const P = unpack(data);\n  let A = IV;\n  const R = P;\n  const n = P.length / 2;\n  const t = new Uint32Array([0, 0]);\n  let B = new Uint32Array(4);\n  for (let j = 0; j <= 5; ++j) {\n    for (let i = 0; i < n; ++i) {\n      t[1] = n * j + (1 + i);\n      // B = A\n      B[0] = A[0];\n      B[1] = A[1];\n      // B = A || R[i]\n      B[2] = R[2 * i];\n      B[3] = R[2 * i + 1];\n      // B = AES(K, B)\n      B = unpack(aes.encrypt(pack(B)));\n      // A = MSB(64, B) ^ t\n      A = B.subarray(0, 2);\n      A[0] ^= t[0];\n      A[1] ^= t[1];\n      // R[i] = LSB(64, B)\n      R[2 * i] = B[2];\n      R[2 * i + 1] = B[3];\n    }\n  }\n  return pack(A, R);\n}\n\n/**\n * AES key unwrap\n * @function\n * @param {String} key\n * @param {String} data\n * @returns {Uint8Array}\n * @throws {Error}\n */\nexport function unwrap(key, data) {\n  const aes = new cipher['aes' + (key.length * 8)](key);\n  const IV = new Uint32Array([0xA6A6A6A6, 0xA6A6A6A6]);\n  const C = unpack(data);\n  let A = C.subarray(0, 2);\n  const R = C.subarray(2);\n  const n = C.length / 2 - 1;\n  const t = new Uint32Array([0, 0]);\n  let B = new Uint32Array(4);\n  for (let j = 5; j >= 0; --j) {\n    for (let i = n - 1; i >= 0; --i) {\n      t[1] = n * j + (i + 1);\n      // B = A ^ t\n      B[0] = A[0] ^ t[0];\n      B[1] = A[1] ^ t[1];\n      // B = (A ^ t) || R[i]\n      B[2] = R[2 * i];\n      B[3] = R[2 * i + 1];\n      // B = AES-1(B)\n      B = unpack(aes.decrypt(pack(B)));\n      // A = MSB(64, B)\n      A = B.subarray(0, 2);\n      // R[i] = LSB(64, B)\n      R[2 * i] = B[2];\n      R[2 * i + 1] = B[3];\n    }\n  }\n  if (A[0] === IV[0] && A[1] === IV[1]) {\n    return pack(R);\n  }\n  throw new Error('Key Data Integrity failed');\n}\n\nfunction createArrayBuffer(data) {\n  if (util.isString(data)) {\n    const { length } = data;\n    const buffer = new ArrayBuffer(length);\n    const view = new Uint8Array(buffer);\n    for (let j = 0; j < length; ++j) {\n      view[j] = data.charCodeAt(j);\n    }\n    return buffer;\n  }\n  return new Uint8Array(data).buffer;\n}\n\nfunction unpack(data) {\n  const { length } = data;\n  const buffer = createArrayBuffer(data);\n  const view = new DataView(buffer);\n  const arr = new Uint32Array(length / 4);\n  for (let i = 0; i < length / 4; ++i) {\n    arr[i] = view.getUint32(4 * i);\n  }\n  return arr;\n}\n\nfunction pack() {\n  let length = 0;\n  for (let k = 0; k < arguments.length; ++k) {\n    length += 4 * arguments[k].length;\n  }\n  const buffer = new ArrayBuffer(length);\n  const view = new DataView(buffer);\n  let offset = 0;\n  for (let i = 0; i < arguments.length; ++i) {\n    for (let j = 0; j < arguments[i].length; ++j) {\n      view.setUint32(offset + 4 * j, arguments[i][j]);\n    }\n    offset += 4 * arguments[i].length;\n  }\n  return new Uint8Array(buffer);\n}\n","// OpenPGP.js - An OpenPGP implementation in javascript\n// Copyright (C) 2015-2016 Decentral\n//\n// This library is free software; you can redistribute it and/or\n// modify it under the terms of the GNU Lesser General Public\n// License as published by the Free Software Foundation; either\n// version 3.0 of the License, or (at your option) any later version.\n//\n// This library is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n// Lesser General Public License for more details.\n//\n// You should have received a copy of the GNU Lesser General Public\n// License along with this library; if not, write to the Free Software\n// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n\nimport util from '../util';\n\n/**\n * @fileoverview Functions to add and remove PKCS5 padding\n * @see PublicKeyEncryptedSessionKeyPacket\n * @module crypto/pkcs5\n * @private\n */\n\n/**\n * Add pkcs5 padding to a message\n * @param {Uint8Array} message - message to pad\n * @returns {Uint8Array} Padded message.\n */\nexport function encode(message) {\n  const c = 8 - (message.length % 8);\n  const padded = new Uint8Array(message.length + c).fill(c);\n  padded.set(message);\n  return padded;\n}\n\n/**\n * Remove pkcs5 padding from a message\n * @param {Uint8Array} message - message to remove padding from\n * @returns {Uint8Array} Message without padding.\n */\nexport function decode(message) {\n  const len = message.length;\n  if (len > 0) {\n    const c = message[len - 1];\n    if (c >= 1) {\n      const provided = message.subarray(len - c);\n      const computed = new Uint8Array(c).fill(c);\n      if (util.equalsUint8Array(provided, computed)) {\n        return message.subarray(0, len - c);\n      }\n    }\n  }\n  throw new Error('Invalid padding');\n}\n","// OpenPGP.js - An OpenPGP implementation in javascript\n// Copyright (C) 2015-2016 Decentral\n//\n// This library is free software; you can redistribute it and/or\n// modify it under the terms of the GNU Lesser General Public\n// License as published by the Free Software Foundation; either\n// version 3.0 of the License, or (at your option) any later version.\n//\n// This library is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n// Lesser General Public License for more details.\n//\n// You should have received a copy of the GNU Lesser General Public\n// License along with this library; if not, write to the Free Software\n// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n\n/**\n * @fileoverview Key encryption and decryption for RFC 6637 ECDH\n * @module crypto/public_key/elliptic/ecdh\n * @private\n */\n\nimport nacl from '@openpgp/tweetnacl/nacl-fast-light';\nimport { CurveWithOID, jwkToRawPublic, rawPublicToJWK, privateToJWK, validateStandardParams } from './oid_curves';\nimport * as aesKW from '../../aes_kw';\nimport { getRandomBytes } from '../../random';\nimport hash from '../../hash';\nimport enums from '../../../enums';\nimport util from '../../../util';\nimport { b64ToUint8Array } from '../../../encoding/base64';\nimport * as pkcs5 from '../../pkcs5';\nimport { keyFromPublic, keyFromPrivate, getIndutnyCurve } from './indutnyKey';\nimport getCipher from '../../cipher/getCipher';\n\nconst webCrypto = util.getWebCrypto();\nconst nodeCrypto = util.getNodeCrypto();\n\n/**\n * Validate ECDH parameters\n * @param {module:type/oid} oid - Elliptic curve object identifier\n * @param {Uint8Array} Q - ECDH public point\n * @param {Uint8Array} d - ECDH secret scalar\n * @returns {Promise<Boolean>} Whether params are valid.\n * @async\n */\nexport async function validateParams(oid, Q, d) {\n  return validateStandardParams(enums.publicKey.ecdh, oid, Q, d);\n}\n\n// Build Param for ECDH algorithm (RFC 6637)\nfunction buildEcdhParam(public_algo, oid, kdfParams, fingerprint) {\n  return util.concatUint8Array([\n    oid.write(),\n    new Uint8Array([public_algo]),\n    kdfParams.write(),\n    util.stringToUint8Array('Anonymous Sender    '),\n    fingerprint.subarray(0, 20)\n  ]);\n}\n\n// Key Derivation Function (RFC 6637)\nasync function kdf(hashAlgo, X, length, param, stripLeading = false, stripTrailing = false) {\n  // Note: X is little endian for Curve25519, big-endian for all others.\n  // This is not ideal, but the RFC's are unclear\n  // https://tools.ietf.org/html/draft-ietf-openpgp-rfc4880bis-02#appendix-B\n  let i;\n  if (stripLeading) {\n    // Work around old go crypto bug\n    for (i = 0; i < X.length && X[i] === 0; i++);\n    X = X.subarray(i);\n  }\n  if (stripTrailing) {\n    // Work around old OpenPGP.js bug\n    for (i = X.length - 1; i >= 0 && X[i] === 0; i--);\n    X = X.subarray(0, i + 1);\n  }\n  const digest = await hash.digest(hashAlgo, util.concatUint8Array([\n    new Uint8Array([0, 0, 0, 1]),\n    X,\n    param\n  ]));\n  return digest.subarray(0, length);\n}\n\n/**\n * Generate ECDHE ephemeral key and secret from public key\n *\n * @param {CurveWithOID} curve - Elliptic curve object\n * @param {Uint8Array} Q - Recipient public key\n * @returns {Promise<{publicKey: Uint8Array, sharedKey: Uint8Array}>}\n * @async\n */\nasync function genPublicEphemeralKey(curve, Q) {\n  switch (curve.type) {\n    case 'curve25519': {\n      const d = getRandomBytes(32);\n      const { secretKey, sharedKey } = await genPrivateEphemeralKey(curve, Q, null, d);\n      let { publicKey } = nacl.box.keyPair.fromSecretKey(secretKey);\n      publicKey = util.concatUint8Array([new Uint8Array([0x40]), publicKey]);\n      return { publicKey, sharedKey }; // Note: sharedKey is little-endian here, unlike below\n    }\n    case 'web':\n      if (curve.web && util.getWebCrypto()) {\n        try {\n          return await webPublicEphemeralKey(curve, Q);\n        } catch (err) {\n          util.printDebugError(err);\n        }\n      }\n      break;\n    case 'node':\n      return nodePublicEphemeralKey(curve, Q);\n  }\n  return ellipticPublicEphemeralKey(curve, Q);\n}\n\n/**\n * Encrypt and wrap a session key\n *\n * @param {module:type/oid} oid - Elliptic curve object identifier\n * @param {module:type/kdf_params} kdfParams - KDF params including cipher and algorithm to use\n * @param {Uint8Array} data - Unpadded session key data\n * @param {Uint8Array} Q - Recipient public key\n * @param {Uint8Array} fingerprint - Recipient fingerprint\n * @returns {Promise<{publicKey: Uint8Array, wrappedKey: Uint8Array}>}\n * @async\n */\nexport async function encrypt(oid, kdfParams, data, Q, fingerprint) {\n  const m = pkcs5.encode(data);\n\n  const curve = new CurveWithOID(oid);\n  const { publicKey, sharedKey } = await genPublicEphemeralKey(curve, Q);\n  const param = buildEcdhParam(enums.publicKey.ecdh, oid, kdfParams, fingerprint);\n  const { keySize } = getCipher(kdfParams.cipher);\n  const Z = await kdf(kdfParams.hash, sharedKey, keySize, param);\n  const wrappedKey = aesKW.wrap(Z, m);\n  return { publicKey, wrappedKey };\n}\n\n/**\n * Generate ECDHE secret from private key and public part of ephemeral key\n *\n * @param {CurveWithOID} curve - Elliptic curve object\n * @param {Uint8Array} V - Public part of ephemeral key\n * @param {Uint8Array} Q - Recipient public key\n * @param {Uint8Array} d - Recipient private key\n * @returns {Promise<{secretKey: Uint8Array, sharedKey: Uint8Array}>}\n * @async\n */\nasync function genPrivateEphemeralKey(curve, V, Q, d) {\n  if (d.length !== curve.payloadSize) {\n    const privateKey = new Uint8Array(curve.payloadSize);\n    privateKey.set(d, curve.payloadSize - d.length);\n    d = privateKey;\n  }\n  switch (curve.type) {\n    case 'curve25519': {\n      const secretKey = d.slice().reverse();\n      const sharedKey = nacl.scalarMult(secretKey, V.subarray(1));\n      return { secretKey, sharedKey }; // Note: sharedKey is little-endian here, unlike below\n    }\n    case 'web':\n      if (curve.web && util.getWebCrypto()) {\n        try {\n          return await webPrivateEphemeralKey(curve, V, Q, d);\n        } catch (err) {\n          util.printDebugError(err);\n        }\n      }\n      break;\n    case 'node':\n      return nodePrivateEphemeralKey(curve, V, d);\n  }\n  return ellipticPrivateEphemeralKey(curve, V, d);\n}\n\n/**\n * Decrypt and unwrap the value derived from session key\n *\n * @param {module:type/oid} oid - Elliptic curve object identifier\n * @param {module:type/kdf_params} kdfParams - KDF params including cipher and algorithm to use\n * @param {Uint8Array} V - Public part of ephemeral key\n * @param {Uint8Array} C - Encrypted and wrapped value derived from session key\n * @param {Uint8Array} Q - Recipient public key\n * @param {Uint8Array} d - Recipient private key\n * @param {Uint8Array} fingerprint - Recipient fingerprint\n * @returns {Promise<Uint8Array>} Value derived from session key.\n * @async\n */\nexport async function decrypt(oid, kdfParams, V, C, Q, d, fingerprint) {\n  const curve = new CurveWithOID(oid);\n  const { sharedKey } = await genPrivateEphemeralKey(curve, V, Q, d);\n  const param = buildEcdhParam(enums.publicKey.ecdh, oid, kdfParams, fingerprint);\n  const { keySize } = getCipher(kdfParams.cipher);\n  let err;\n  for (let i = 0; i < 3; i++) {\n    try {\n      // Work around old go crypto bug and old OpenPGP.js bug, respectively.\n      const Z = await kdf(kdfParams.hash, sharedKey, keySize, param, i === 1, i === 2);\n      return pkcs5.decode(aesKW.unwrap(Z, C));\n    } catch (e) {\n      err = e;\n    }\n  }\n  throw err;\n}\n\n/**\n * Generate ECDHE secret from private key and public part of ephemeral key using webCrypto\n *\n * @param {CurveWithOID} curve - Elliptic curve object\n * @param {Uint8Array} V - Public part of ephemeral key\n * @param {Uint8Array} Q - Recipient public key\n * @param {Uint8Array} d - Recipient private key\n * @returns {Promise<{secretKey: Uint8Array, sharedKey: Uint8Array}>}\n * @async\n */\nasync function webPrivateEphemeralKey(curve, V, Q, d) {\n  const recipient = privateToJWK(curve.payloadSize, curve.web.web, Q, d);\n  let privateKey = webCrypto.importKey(\n    'jwk',\n    recipient,\n    {\n      name: 'ECDH',\n      namedCurve: curve.web.web\n    },\n    true,\n    ['deriveKey', 'deriveBits']\n  );\n  const jwk = rawPublicToJWK(curve.payloadSize, curve.web.web, V);\n  let sender = webCrypto.importKey(\n    'jwk',\n    jwk,\n    {\n      name: 'ECDH',\n      namedCurve: curve.web.web\n    },\n    true,\n    []\n  );\n  [privateKey, sender] = await Promise.all([privateKey, sender]);\n  let S = webCrypto.deriveBits(\n    {\n      name: 'ECDH',\n      namedCurve: curve.web.web,\n      public: sender\n    },\n    privateKey,\n    curve.web.sharedSize\n  );\n  let secret = webCrypto.exportKey(\n    'jwk',\n    privateKey\n  );\n  [S, secret] = await Promise.all([S, secret]);\n  const sharedKey = new Uint8Array(S);\n  const secretKey = b64ToUint8Array(secret.d, true);\n  return { secretKey, sharedKey };\n}\n\n/**\n * Generate ECDHE ephemeral key and secret from public key using webCrypto\n *\n * @param {CurveWithOID} curve - Elliptic curve object\n * @param {Uint8Array} Q - Recipient public key\n * @returns {Promise<{publicKey: Uint8Array, sharedKey: Uint8Array}>}\n * @async\n */\nasync function webPublicEphemeralKey(curve, Q) {\n  const jwk = rawPublicToJWK(curve.payloadSize, curve.web.web, Q);\n  let keyPair = webCrypto.generateKey(\n    {\n      name: 'ECDH',\n      namedCurve: curve.web.web\n    },\n    true,\n    ['deriveKey', 'deriveBits']\n  );\n  let recipient = webCrypto.importKey(\n    'jwk',\n    jwk,\n    {\n      name: 'ECDH',\n      namedCurve: curve.web.web\n    },\n    false,\n    []\n  );\n  [keyPair, recipient] = await Promise.all([keyPair, recipient]);\n  let s = webCrypto.deriveBits(\n    {\n      name: 'ECDH',\n      namedCurve: curve.web.web,\n      public: recipient\n    },\n    keyPair.privateKey,\n    curve.web.sharedSize\n  );\n  let p = webCrypto.exportKey(\n    'jwk',\n    keyPair.publicKey\n  );\n  [s, p] = await Promise.all([s, p]);\n  const sharedKey = new Uint8Array(s);\n  const publicKey = new Uint8Array(jwkToRawPublic(p));\n  return { publicKey, sharedKey };\n}\n\n/**\n * Generate ECDHE secret from private key and public part of ephemeral key using indutny/elliptic\n *\n * @param {CurveWithOID} curve - Elliptic curve object\n * @param {Uint8Array} V - Public part of ephemeral key\n * @param {Uint8Array} d - Recipient private key\n * @returns {Promise<{secretKey: Uint8Array, sharedKey: Uint8Array}>}\n * @async\n */\nasync function ellipticPrivateEphemeralKey(curve, V, d) {\n  const indutnyCurve = await getIndutnyCurve(curve.name);\n  V = keyFromPublic(indutnyCurve, V);\n  d = keyFromPrivate(indutnyCurve, d);\n  const secretKey = new Uint8Array(d.getPrivate());\n  const S = d.derive(V.getPublic());\n  const len = indutnyCurve.curve.p.byteLength();\n  const sharedKey = S.toArrayLike(Uint8Array, 'be', len);\n  return { secretKey, sharedKey };\n}\n\n/**\n * Generate ECDHE ephemeral key and secret from public key using indutny/elliptic\n *\n * @param {CurveWithOID} curve - Elliptic curve object\n * @param {Uint8Array} Q - Recipient public key\n * @returns {Promise<{publicKey: Uint8Array, sharedKey: Uint8Array}>}\n * @async\n */\nasync function ellipticPublicEphemeralKey(curve, Q) {\n  const indutnyCurve = await getIndutnyCurve(curve.name);\n  const v = await curve.genKeyPair();\n  Q = keyFromPublic(indutnyCurve, Q);\n  const V = keyFromPrivate(indutnyCurve, v.privateKey);\n  const publicKey = v.publicKey;\n  const S = V.derive(Q.getPublic());\n  const len = indutnyCurve.curve.p.byteLength();\n  const sharedKey = S.toArrayLike(Uint8Array, 'be', len);\n  return { publicKey, sharedKey };\n}\n\n/**\n * Generate ECDHE secret from private key and public part of ephemeral key using nodeCrypto\n *\n * @param {CurveWithOID} curve - Elliptic curve object\n * @param {Uint8Array} V - Public part of ephemeral key\n * @param {Uint8Array} d - Recipient private key\n * @returns {Promise<{secretKey: Uint8Array, sharedKey: Uint8Array}>}\n * @async\n */\nasync function nodePrivateEphemeralKey(curve, V, d) {\n  const recipient = nodeCrypto.createECDH(curve.node.node);\n  recipient.setPrivateKey(d);\n  const sharedKey = new Uint8Array(recipient.computeSecret(V));\n  const secretKey = new Uint8Array(recipient.getPrivateKey());\n  return { secretKey, sharedKey };\n}\n\n/**\n * Generate ECDHE ephemeral key and secret from public key using nodeCrypto\n *\n * @param {CurveWithOID} curve - Elliptic curve object\n * @param {Uint8Array} Q - Recipient public key\n * @returns {Promise<{publicKey: Uint8Array, sharedKey: Uint8Array}>}\n * @async\n */\nasync function nodePublicEphemeralKey(curve, Q) {\n  const sender = nodeCrypto.createECDH(curve.node.node);\n  sender.generateKeys();\n  const sharedKey = new Uint8Array(sender.computeSecret(Q));\n  const publicKey = new Uint8Array(sender.getPublicKey());\n  return { publicKey, sharedKey };\n}\n","/**\n * @fileoverview This module implements HKDF using either the WebCrypto API or Node.js' crypto API.\n * @module crypto/hkdf\n * @private\n */\n\nimport enums from '../enums';\nimport util from '../util';\n\nconst webCrypto = util.getWebCrypto();\nconst nodeCrypto = util.getNodeCrypto();\nconst nodeSubtleCrypto = nodeCrypto && nodeCrypto.webcrypto && nodeCrypto.webcrypto.subtle;\n\nexport default async function HKDF(hashAlgo, inputKey, salt, info, outLen) {\n  const hash = enums.read(enums.webHash, hashAlgo);\n  if (!hash) throw new Error('Hash algo not supported with HKDF');\n\n  if (webCrypto || nodeSubtleCrypto) {\n    const crypto = webCrypto || nodeSubtleCrypto;\n    const importedKey = await crypto.importKey('raw', inputKey, 'HKDF', false, ['deriveBits']);\n    const bits = await crypto.deriveBits({ name: 'HKDF', hash, salt, info }, importedKey, outLen * 8);\n    return new Uint8Array(bits);\n  }\n\n  if (nodeCrypto) {\n    const hashAlgoName = enums.read(enums.hash, hashAlgo);\n    // Node-only HKDF implementation based on https://www.rfc-editor.org/rfc/rfc5869\n\n    const computeHMAC = (hmacKey, hmacMessage) => nodeCrypto.createHmac(hashAlgoName, hmacKey).update(hmacMessage).digest();\n    // Step 1: Extract\n    // PRK = HMAC-Hash(salt, IKM)\n    const pseudoRandomKey = computeHMAC(salt, inputKey);\n\n    const hashLen = pseudoRandomKey.length;\n\n    // Step 2: Expand\n    // HKDF-Expand(PRK, info, L) -> OKM\n    const n = Math.ceil(outLen / hashLen);\n    const outputKeyingMaterial = new Uint8Array(n * hashLen);\n\n    // HMAC input buffer updated at each iteration\n    const roundInput = new Uint8Array(hashLen + info.length + 1);\n    // T_i and last byte are updated at each iteration, but `info` remains constant\n    roundInput.set(info, hashLen);\n\n    for (let i = 0; i < n; i++) {\n      // T(0) = empty string (zero length)\n      // T(i) = HMAC-Hash(PRK, T(i-1) | info | i)\n      roundInput[roundInput.length - 1] = i + 1;\n      // t = T(i+1)\n      const t = computeHMAC(pseudoRandomKey, i > 0 ? roundInput : roundInput.subarray(hashLen));\n      roundInput.set(t, 0);\n\n      outputKeyingMaterial.set(t, i * hashLen);\n    }\n\n    return outputKeyingMaterial.subarray(0, outLen);\n  }\n\n  throw new Error('No HKDF implementation available');\n}\n","/**\n * @fileoverview Key encryption and decryption for RFC 6637 ECDH\n * @module crypto/public_key/elliptic/ecdh\n * @private\n */\n\nimport nacl from '@openpgp/tweetnacl/nacl-fast-light';\nimport * as aesKW from '../../aes_kw';\nimport { getRandomBytes } from '../../random';\n\nimport enums from '../../../enums';\nimport util from '../../../util';\nimport getCipher from '../../cipher/getCipher';\nimport computeHKDF from '../../hkdf';\n\nconst HKDF_INFO = {\n  x25519: util.encodeUTF8('OpenPGP X25519')\n};\n\n/**\n * Generate ECDH key for Montgomery curves\n * @param {module:enums.publicKey} algo - Algorithm identifier\n * @returns {Promise<{ A: Uint8Array, k: Uint8Array }>}\n */\nexport async function generate(algo) {\n  switch (algo) {\n    case enums.publicKey.x25519: {\n      // k stays in little-endian, unlike legacy ECDH over curve25519\n      const k = getRandomBytes(32);\n      const { publicKey: A } = nacl.box.keyPair.fromSecretKey(k);\n      return { A, k };\n    }\n    default:\n      throw new Error('Unsupported ECDH algorithm');\n  }\n}\n\n/**\n* Validate ECDH parameters\n* @param {module:enums.publicKey} algo - Algorithm identifier\n* @param {Uint8Array} A - ECDH public point\n* @param {Uint8Array} k - ECDH secret scalar\n* @returns {Promise<Boolean>} Whether params are valid.\n* @async\n*/\nexport async function validateParams(algo, A, k) {\n  switch (algo) {\n    case enums.publicKey.x25519: {\n      /**\n       * Derive public point A' from private key\n       * and expect A == A'\n       */\n      const { publicKey } = nacl.box.keyPair.fromSecretKey(k);\n      return util.equalsUint8Array(A, publicKey);\n    }\n\n    default:\n      return false;\n  }\n}\n\n/**\n * Wrap and encrypt a session key\n *\n * @param {module:enums.publicKey} algo - Algorithm identifier\n * @param {Uint8Array} data - session key data to be encrypted\n * @param {Uint8Array} recipientA - Recipient public key (K_B)\n * @returns {Promise<{\n *  ephemeralPublicKey: Uint8Array,\n * wrappedKey: Uint8Array\n * }>} ephemeral public key (K_A) and encrypted key\n * @async\n */\nexport async function encrypt(algo, data, recipientA) {\n  switch (algo) {\n    case enums.publicKey.x25519: {\n      const ephemeralSecretKey = getRandomBytes(32);\n      const sharedSecret = nacl.scalarMult(ephemeralSecretKey, recipientA);\n      const { publicKey: ephemeralPublicKey } = nacl.box.keyPair.fromSecretKey(ephemeralSecretKey);\n      const hkdfInput = util.concatUint8Array([\n        ephemeralPublicKey,\n        recipientA,\n        sharedSecret\n      ]);\n      const { keySize } = getCipher(enums.symmetric.aes128);\n      const encryptionKey = await computeHKDF(enums.hash.sha256, hkdfInput, new Uint8Array(), HKDF_INFO.x25519, keySize);\n      const wrappedKey = aesKW.wrap(encryptionKey, data);\n      return { ephemeralPublicKey, wrappedKey };\n    }\n\n    default:\n      throw new Error('Unsupported ECDH algorithm');\n  }\n}\n\n/**\n * Decrypt and unwrap the session key\n *\n * @param {module:enums.publicKey} algo - Algorithm identifier\n * @param {Uint8Array} ephemeralPublicKey - (K_A)\n * @param {Uint8Array} wrappedKey,\n * @param {Uint8Array} A - Recipient public key (K_b), needed for KDF\n * @param {Uint8Array} k - Recipient secret key (b)\n * @returns {Promise<Uint8Array>} decrypted session key data\n * @async\n */\nexport async function decrypt(algo, ephemeralPublicKey, wrappedKey, A, k) {\n  switch (algo) {\n    case enums.publicKey.x25519: {\n      const sharedSecret = nacl.scalarMult(k, ephemeralPublicKey);\n      const hkdfInput = util.concatUint8Array([\n        ephemeralPublicKey,\n        A,\n        sharedSecret\n      ]);\n      const { keySize } = getCipher(enums.symmetric.aes128);\n      const encryptionKey = await computeHKDF(enums.hash.sha256, hkdfInput, new Uint8Array(), HKDF_INFO.x25519, keySize);\n      return aesKW.unwrap(encryptionKey, wrappedKey);\n    }\n    default:\n      throw new Error('Unsupported ECDH algorithm');\n  }\n}\n","// GPG4Browsers - An OpenPGP implementation in javascript\n// Copyright (C) 2011 Recurity Labs GmbH\n//\n// This library is free software; you can redistribute it and/or\n// modify it under the terms of the GNU Lesser General Public\n// License as published by the Free Software Foundation; either\n// version 3.0 of the License, or (at your option) any later version.\n//\n// This library is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n// Lesser General Public License for more details.\n//\n// You should have received a copy of the GNU Lesser General Public\n// License along with this library; if not, write to the Free Software\n// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n\n/**\n * @fileoverview A Digital signature algorithm implementation\n * @module crypto/public_key/dsa\n * @private\n */\nimport { getRandomBigInteger } from '../random';\nimport util from '../../util';\nimport { isProbablePrime } from './prime';\n\n/*\n  TODO regarding the hash function, read:\n   https://tools.ietf.org/html/rfc4880#section-13.6\n   https://tools.ietf.org/html/rfc4880#section-14\n*/\n\n/**\n * DSA Sign function\n * @param {Integer} hashAlgo\n * @param {Uint8Array} hashed\n * @param {Uint8Array} g\n * @param {Uint8Array} p\n * @param {Uint8Array} q\n * @param {Uint8Array} x\n * @returns {Promise<{ r: Uint8Array, s: Uint8Array }>}\n * @async\n */\nexport async function sign(hashAlgo, hashed, g, p, q, x) {\n  const BigInteger = await util.getBigInteger();\n  const one = new BigInteger(1);\n  p = new BigInteger(p);\n  q = new BigInteger(q);\n  g = new BigInteger(g);\n  x = new BigInteger(x);\n\n  let k;\n  let r;\n  let s;\n  let t;\n  g = g.mod(p);\n  x = x.mod(q);\n  // If the output size of the chosen hash is larger than the number of\n  // bits of q, the hash result is truncated to fit by taking the number\n  // of leftmost bits equal to the number of bits of q.  This (possibly\n  // truncated) hash function result is treated as a number and used\n  // directly in the DSA signature algorithm.\n  const h = new BigInteger(hashed.subarray(0, q.byteLength())).mod(q);\n  // FIPS-186-4, section 4.6:\n  // The values of r and s shall be checked to determine if r = 0 or s = 0.\n  // If either r = 0 or s = 0, a new value of k shall be generated, and the\n  // signature shall be recalculated. It is extremely unlikely that r = 0\n  // or s = 0 if signatures are generated properly.\n  while (true) {\n    // See Appendix B here: https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.186-4.pdf\n    k = await getRandomBigInteger(one, q); // returns in [1, q-1]\n    r = g.modExp(k, p).imod(q); // (g**k mod p) mod q\n    if (r.isZero()) {\n      continue;\n    }\n    const xr = x.mul(r).imod(q);\n    t = h.add(xr).imod(q); // H(m) + x*r mod q\n    s = k.modInv(q).imul(t).imod(q); // k**-1 * (H(m) + x*r) mod q\n    if (s.isZero()) {\n      continue;\n    }\n    break;\n  }\n  return {\n    r: r.toUint8Array('be', q.byteLength()),\n    s: s.toUint8Array('be', q.byteLength())\n  };\n}\n\n/**\n * DSA Verify function\n * @param {Integer} hashAlgo\n * @param {Uint8Array} r\n * @param {Uint8Array} s\n * @param {Uint8Array} hashed\n * @param {Uint8Array} g\n * @param {Uint8Array} p\n * @param {Uint8Array} q\n * @param {Uint8Array} y\n * @returns {boolean}\n * @async\n */\nexport async function verify(hashAlgo, r, s, hashed, g, p, q, y) {\n  const BigInteger = await util.getBigInteger();\n  const zero = new BigInteger(0);\n  r = new BigInteger(r);\n  s = new BigInteger(s);\n\n  p = new BigInteger(p);\n  q = new BigInteger(q);\n  g = new BigInteger(g);\n  y = new BigInteger(y);\n\n  if (r.lte(zero) || r.gte(q) ||\n      s.lte(zero) || s.gte(q)) {\n    util.printDebug('invalid DSA Signature');\n    return false;\n  }\n  const h = new BigInteger(hashed.subarray(0, q.byteLength())).imod(q);\n  const w = s.modInv(q); // s**-1 mod q\n  if (w.isZero()) {\n    util.printDebug('invalid DSA Signature');\n    return false;\n  }\n\n  g = g.mod(p);\n  y = y.mod(p);\n  const u1 = h.mul(w).imod(q); // H(m) * w mod q\n  const u2 = r.mul(w).imod(q); // r * w mod q\n  const t1 = g.modExp(u1, p); // g**u1 mod p\n  const t2 = y.modExp(u2, p); // y**u2 mod p\n  const v = t1.mul(t2).imod(p).imod(q); // (g**u1 * y**u2 mod p) mod q\n  return v.equal(r);\n}\n\n/**\n * Validate DSA parameters\n * @param {Uint8Array} p - DSA prime\n * @param {Uint8Array} q - DSA group order\n * @param {Uint8Array} g - DSA sub-group generator\n * @param {Uint8Array} y - DSA public key\n * @param {Uint8Array} x - DSA private key\n * @returns {Promise<Boolean>} Whether params are valid.\n * @async\n */\nexport async function validateParams(p, q, g, y, x) {\n  const BigInteger = await util.getBigInteger();\n  p = new BigInteger(p);\n  q = new BigInteger(q);\n  g = new BigInteger(g);\n  y = new BigInteger(y);\n  const one = new BigInteger(1);\n  // Check that 1 < g < p\n  if (g.lte(one) || g.gte(p)) {\n    return false;\n  }\n\n  /**\n   * Check that subgroup order q divides p-1\n   */\n  if (!p.dec().mod(q).isZero()) {\n    return false;\n  }\n\n  /**\n   * g has order q\n   * Check that g ** q = 1 mod p\n   */\n  if (!g.modExp(q, p).isOne()) {\n    return false;\n  }\n\n  /**\n   * Check q is large and probably prime (we mainly want to avoid small factors)\n   */\n  const qSize = new BigInteger(q.bitLength());\n  const n150 = new BigInteger(150);\n  if (qSize.lt(n150) || !(await isProbablePrime(q, null, 32))) {\n    return false;\n  }\n\n  /**\n   * Re-derive public key y' = g ** x mod p\n   * Expect y == y'\n   *\n   * Blinded exponentiation computes g**{rq + x} to compare to y\n   */\n  x = new BigInteger(x);\n  const two = new BigInteger(2);\n  const r = await getRandomBigInteger(two.leftShift(qSize.dec()), two.leftShift(qSize)); // draw r of same size as q\n  const rqx = q.mul(r).add(x);\n  if (!y.equal(g.modExp(rqx, p))) {\n    return false;\n  }\n\n  return true;\n}\n","/**\n * @fileoverview Asymmetric cryptography functions\n * @module crypto/public_key\n * @private\n */\n\nimport nacl from '@openpgp/tweetnacl/nacl-fast-light';\nimport * as rsa from './rsa';\nimport * as elgamal from './elgamal';\nimport * as elliptic from './elliptic';\nimport * as dsa from './dsa';\n\nexport default {\n  /** @see module:crypto/public_key/rsa */\n  rsa: rsa,\n  /** @see module:crypto/public_key/elgamal */\n  elgamal: elgamal,\n  /** @see module:crypto/public_key/elliptic */\n  elliptic: elliptic,\n  /** @see module:crypto/public_key/dsa */\n  dsa: dsa,\n  /** @see tweetnacl */\n  nacl: nacl\n};\n","/**\n * @fileoverview Provides functions for asymmetric signing and signature verification\n * @module crypto/signature\n * @private\n */\n\nimport publicKey from './public_key';\nimport enums from '../enums';\nimport util from '../util';\nimport { UnsupportedError } from '../packet/packet';\n\n/**\n * Parse signature in binary form to get the parameters.\n * The returned values are only padded for EdDSA, since in the other cases their expected length\n * depends on the key params, hence we delegate the padding to the signature verification function.\n * See {@link https://tools.ietf.org/html/rfc4880#section-9.1|RFC 4880 9.1}\n * See {@link https://tools.ietf.org/html/rfc4880#section-5.2.2|RFC 4880 5.2.2.}\n * @param {module:enums.publicKey} algo - Public key algorithm\n * @param {Uint8Array} signature - Data for which the signature was created\n * @returns {Promise<Object>} True if signature is valid.\n * @async\n */\nexport function parseSignatureParams(algo, signature) {\n  let read = 0;\n  switch (algo) {\n    // Algorithm-Specific Fields for RSA signatures:\n    // -  MPI of RSA signature value m**d mod n.\n    case enums.publicKey.rsaEncryptSign:\n    case enums.publicKey.rsaEncrypt:\n    case enums.publicKey.rsaSign: {\n      const s = util.readMPI(signature.subarray(read));\n      // The signature needs to be the same length as the public key modulo n.\n      // We pad s on signature verification, where we have access to n.\n      return { s };\n    }\n    // Algorithm-Specific Fields for DSA or ECDSA signatures:\n    // -  MPI of DSA or ECDSA value r.\n    // -  MPI of DSA or ECDSA value s.\n    case enums.publicKey.dsa:\n    case enums.publicKey.ecdsa:\n    {\n      const r = util.readMPI(signature.subarray(read)); read += r.length + 2;\n      const s = util.readMPI(signature.subarray(read));\n      return { r, s };\n    }\n    // Algorithm-Specific Fields for legacy EdDSA signatures:\n    // -  MPI of an EC point r.\n    // -  EdDSA value s, in MPI, in the little endian representation\n    case enums.publicKey.eddsaLegacy: {\n      // When parsing little-endian MPI data, we always need to left-pad it, as done with big-endian values:\n      // https://www.ietf.org/archive/id/draft-ietf-openpgp-rfc4880bis-10.html#section-3.2-9\n      let r = util.readMPI(signature.subarray(read)); read += r.length + 2;\n      r = util.leftPad(r, 32);\n      let s = util.readMPI(signature.subarray(read));\n      s = util.leftPad(s, 32);\n      return { r, s };\n    }\n    // Algorithm-Specific Fields for Ed25519 signatures:\n    // - 64 octets of the native signature\n    case enums.publicKey.ed25519: {\n      const RS = signature.subarray(read, read + 64); read += RS.length;\n      return { RS };\n    }\n    default:\n      throw new UnsupportedError('Unknown signature algorithm.');\n  }\n}\n\n/**\n * Verifies the signature provided for data using specified algorithms and public key parameters.\n * See {@link https://tools.ietf.org/html/rfc4880#section-9.1|RFC 4880 9.1}\n * and {@link https://tools.ietf.org/html/rfc4880#section-9.4|RFC 4880 9.4}\n * for public key and hash algorithms.\n * @param {module:enums.publicKey} algo - Public key algorithm\n * @param {module:enums.hash} hashAlgo - Hash algorithm\n * @param {Object} signature - Named algorithm-specific signature parameters\n * @param {Object} publicParams - Algorithm-specific public key parameters\n * @param {Uint8Array} data - Data for which the signature was created\n * @param {Uint8Array} hashed - The hashed data\n * @returns {Promise<Boolean>} True if signature is valid.\n * @async\n */\nexport async function verify(algo, hashAlgo, signature, publicParams, data, hashed) {\n  switch (algo) {\n    case enums.publicKey.rsaEncryptSign:\n    case enums.publicKey.rsaEncrypt:\n    case enums.publicKey.rsaSign: {\n      const { n, e } = publicParams;\n      const s = util.leftPad(signature.s, n.length); // padding needed for webcrypto and node crypto\n      return publicKey.rsa.verify(hashAlgo, data, s, n, e, hashed);\n    }\n    case enums.publicKey.dsa: {\n      const { g, p, q, y } = publicParams;\n      const { r, s } = signature; // no need to pad, since we always handle them as BigIntegers\n      return publicKey.dsa.verify(hashAlgo, r, s, hashed, g, p, q, y);\n    }\n    case enums.publicKey.ecdsa: {\n      const { oid, Q } = publicParams;\n      const curveSize = new publicKey.elliptic.CurveWithOID(oid).payloadSize;\n      // padding needed for webcrypto\n      const r = util.leftPad(signature.r, curveSize);\n      const s = util.leftPad(signature.s, curveSize);\n      return publicKey.elliptic.ecdsa.verify(oid, hashAlgo, { r, s }, data, Q, hashed);\n    }\n    case enums.publicKey.eddsaLegacy: {\n      const { oid, Q } = publicParams;\n      // signature already padded on parsing\n      return publicKey.elliptic.eddsaLegacy.verify(oid, hashAlgo, signature, data, Q, hashed);\n    }\n    case enums.publicKey.ed25519: {\n      const { A } = publicParams;\n      return publicKey.elliptic.eddsa.verify(algo, hashAlgo, signature, data, A, hashed);\n    }\n    default:\n      throw new Error('Unknown signature algorithm.');\n  }\n}\n\n/**\n * Creates a signature on data using specified algorithms and private key parameters.\n * See {@link https://tools.ietf.org/html/rfc4880#section-9.1|RFC 4880 9.1}\n * and {@link https://tools.ietf.org/html/rfc4880#section-9.4|RFC 4880 9.4}\n * for public key and hash algorithms.\n * @param {module:enums.publicKey} algo - Public key algorithm\n * @param {module:enums.hash} hashAlgo - Hash algorithm\n * @param {Object} publicKeyParams - Algorithm-specific public and private key parameters\n * @param {Object} privateKeyParams - Algorithm-specific public and private key parameters\n * @param {Uint8Array} data - Data to be signed\n * @param {Uint8Array} hashed - The hashed data\n * @returns {Promise<Object>} Signature                      Object containing named signature parameters.\n * @async\n */\nexport async function sign(algo, hashAlgo, publicKeyParams, privateKeyParams, data, hashed) {\n  if (!publicKeyParams || !privateKeyParams) {\n    throw new Error('Missing key parameters');\n  }\n  switch (algo) {\n    case enums.publicKey.rsaEncryptSign:\n    case enums.publicKey.rsaEncrypt:\n    case enums.publicKey.rsaSign: {\n      const { n, e } = publicKeyParams;\n      const { d, p, q, u } = privateKeyParams;\n      const s = await publicKey.rsa.sign(hashAlgo, data, n, e, d, p, q, u, hashed);\n      return { s };\n    }\n    case enums.publicKey.dsa: {\n      const { g, p, q } = publicKeyParams;\n      const { x } = privateKeyParams;\n      return publicKey.dsa.sign(hashAlgo, hashed, g, p, q, x);\n    }\n    case enums.publicKey.elgamal: {\n      throw new Error('Signing with Elgamal is not defined in the OpenPGP standard.');\n    }\n    case enums.publicKey.ecdsa: {\n      const { oid, Q } = publicKeyParams;\n      const { d } = privateKeyParams;\n      return publicKey.elliptic.ecdsa.sign(oid, hashAlgo, data, Q, d, hashed);\n    }\n    case enums.publicKey.eddsaLegacy: {\n      const { oid, Q } = publicKeyParams;\n      const { seed } = privateKeyParams;\n      return publicKey.elliptic.eddsaLegacy.sign(oid, hashAlgo, data, Q, seed, hashed);\n    }\n    case enums.publicKey.ed25519: {\n      const { A } = publicKeyParams;\n      const { seed } = privateKeyParams;\n      return publicKey.elliptic.eddsa.sign(algo, hashAlgo, data, A, seed, hashed);\n    }\n    default:\n      throw new Error('Unknown signature algorithm.');\n  }\n}\n","// OpenPGP.js - An OpenPGP implementation in javascript\n// Copyright (C) 2015-2016 Decentral\n//\n// This library is free software; you can redistribute it and/or\n// modify it under the terms of the GNU Lesser General Public\n// License as published by the Free Software Foundation; either\n// version 3.0 of the License, or (at your option) any later version.\n//\n// This library is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n// Lesser General Public License for more details.\n//\n// You should have received a copy of the GNU Lesser General Public\n// License along with this library; if not, write to the Free Software\n// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n\n/**\n * Encoded symmetric key for ECDH (incl. legacy x25519)\n *\n * @module type/ecdh_symkey\n * @private\n */\n\nimport util from '../util';\n\nclass ECDHSymmetricKey {\n  constructor(data) {\n    if (data) {\n      this.data = data;\n    }\n  }\n\n  /**\n   * Read an ECDHSymmetricKey from an Uint8Array:\n   * - 1 octect for the length `l`\n   * - `l` octects of encoded session key data\n   * @param {Uint8Array} bytes\n   * @returns {Number} Number of read bytes.\n   */\n  read(bytes) {\n    if (bytes.length >= 1) {\n      const length = bytes[0];\n      if (bytes.length >= 1 + length) {\n        this.data = bytes.subarray(1, 1 + length);\n        return 1 + this.data.length;\n      }\n    }\n    throw new Error('Invalid symmetric key');\n  }\n\n  /**\n   * Write an ECDHSymmetricKey as an Uint8Array\n   * @returns  {Uint8Array} Serialised data\n   */\n  write() {\n    return util.concatUint8Array([new Uint8Array([this.data.length]), this.data]);\n  }\n}\n\nexport default ECDHSymmetricKey;\n","// OpenPGP.js - An OpenPGP implementation in javascript\n// Copyright (C) 2015-2016 Decentral\n//\n// This library is free software; you can redistribute it and/or\n// modify it under the terms of the GNU Lesser General Public\n// License as published by the Free Software Foundation; either\n// version 3.0 of the License, or (at your option) any later version.\n//\n// This library is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n// Lesser General Public License for more details.\n//\n// You should have received a copy of the GNU Lesser General Public\n// License along with this library; if not, write to the Free Software\n// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n\nimport { UnsupportedError } from '../packet/packet';\n\n/**\n * Implementation of type KDF parameters\n *\n * {@link https://tools.ietf.org/html/rfc6637#section-7|RFC 6637 7}:\n * A key derivation function (KDF) is necessary to implement the EC\n * encryption.  The Concatenation Key Derivation Function (Approved\n * Alternative 1) [NIST-SP800-56A] with the KDF hash function that is\n * SHA2-256 [FIPS-180-3] or stronger is REQUIRED.\n * @module type/kdf_params\n * @private\n */\n\nclass KDFParams {\n  /**\n   * @param {enums.hash} hash - Hash algorithm\n   * @param {enums.symmetric} cipher - Symmetric algorithm\n   */\n  constructor(data) {\n    if (data) {\n      const { hash, cipher } = data;\n      this.hash = hash;\n      this.cipher = cipher;\n    } else {\n      this.hash = null;\n      this.cipher = null;\n    }\n  }\n\n  /**\n   * Read KDFParams from an Uint8Array\n   * @param {Uint8Array} input - Where to read the KDFParams from\n   * @returns {Number} Number of read bytes.\n   */\n  read(input) {\n    if (input.length < 4 || input[0] !== 3 || input[1] !== 1) {\n      throw new UnsupportedError('Cannot read KDFParams');\n    }\n    this.hash = input[2];\n    this.cipher = input[3];\n    return 4;\n  }\n\n  /**\n   * Write KDFParams to an Uint8Array\n   * @returns  {Uint8Array}  Array with the KDFParams value\n   */\n  write() {\n    return new Uint8Array([3, 1, this.hash, this.cipher]);\n  }\n}\n\nexport default KDFParams;\n","/**\n * Encoded symmetric key for x25519 and x448\n * The payload format varies for v3 and v6 PKESK:\n * the former includes an algorithm byte preceeding the encrypted session key.\n *\n * @module type/x25519x448_symkey\n */\n\nimport util from '../util';\n\nclass ECDHXSymmetricKey {\n  static fromObject({ wrappedKey, algorithm }) {\n    const instance = new ECDHXSymmetricKey();\n    instance.wrappedKey = wrappedKey;\n    instance.algorithm = algorithm;\n    return instance;\n  }\n\n  /**\n   * - 1 octect for the length `l`\n   * - `l` octects of encoded session key data (with optional leading algorithm byte)\n   * @param {Uint8Array} bytes\n   * @returns {Number} Number of read bytes.\n   */\n  read(bytes) {\n    let read = 0;\n    let followLength = bytes[read++];\n    this.algorithm = followLength % 2 ? bytes[read++] : null; // session key size is always even\n    followLength -= followLength % 2;\n    this.wrappedKey = bytes.subarray(read, read + followLength); read += followLength;\n  }\n\n  /**\n   * Write an MontgomerySymmetricKey as an Uint8Array\n   * @returns  {Uint8Array} Serialised data\n   */\n  write() {\n    return util.concatUint8Array([\n      this.algorithm ?\n        new Uint8Array([this.wrappedKey.length + 1, this.algorithm]) :\n        new Uint8Array([this.wrappedKey.length]),\n      this.wrappedKey\n    ]);\n  }\n}\n\nexport default ECDHXSymmetricKey;\n","// GPG4Browsers - An OpenPGP implementation in javascript\n// Copyright (C) 2011 Recurity Labs GmbH\n//\n// This library is free software; you can redistribute it and/or\n// modify it under the terms of the GNU Lesser General Public\n// License as published by the Free Software Foundation; either\n// version 3.0 of the License, or (at your option) any later version.\n//\n// This library is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n// Lesser General Public License for more details.\n//\n// You should have received a copy of the GNU Lesser General Public\n// License along with this library; if not, write to the Free Software\n// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n\n// The GPG4Browsers crypto interface\n\n/**\n * @fileoverview Provides functions for asymmetric encryption and decryption as\n * well as key generation and parameter handling for all public-key cryptosystems.\n * @module crypto/crypto\n * @private\n */\n\nimport publicKey from './public_key';\nimport mode from './mode';\nimport { getRandomBytes } from './random';\nimport getCipher from './cipher/getCipher';\nimport ECDHSymkey from '../type/ecdh_symkey';\nimport KDFParams from '../type/kdf_params';\nimport enums from '../enums';\nimport util from '../util';\nimport OID from '../type/oid';\nimport { CurveWithOID } from './public_key/elliptic/oid_curves';\nimport { UnsupportedError } from '../packet/packet';\nimport ECDHXSymmetricKey from '../type/ecdh_x_symkey';\n\n/**\n * Encrypts data using specified algorithm and public key parameters.\n * See {@link https://tools.ietf.org/html/rfc4880#section-9.1|RFC 4880 9.1} for public key algorithms.\n * @param {module:enums.publicKey} keyAlgo - Public key algorithm\n * @param {module:enums.symmetric} symmetricAlgo - Cipher algorithm\n * @param {Object} publicParams - Algorithm-specific public key parameters\n * @param {Uint8Array} data - Session key data to be encrypted\n * @param {Uint8Array} fingerprint - Recipient fingerprint\n * @returns {Promise<Object>} Encrypted session key parameters.\n * @async\n */\nexport async function publicKeyEncrypt(keyAlgo, symmetricAlgo, publicParams, data, fingerprint) {\n  switch (keyAlgo) {\n    case enums.publicKey.rsaEncrypt:\n    case enums.publicKey.rsaEncryptSign: {\n      const { n, e } = publicParams;\n      const c = await publicKey.rsa.encrypt(data, n, e);\n      return { c };\n    }\n    case enums.publicKey.elgamal: {\n      const { p, g, y } = publicParams;\n      return publicKey.elgamal.encrypt(data, p, g, y);\n    }\n    case enums.publicKey.ecdh: {\n      const { oid, Q, kdfParams } = publicParams;\n      const { publicKey: V, wrappedKey: C } = await publicKey.elliptic.ecdh.encrypt(\n        oid, kdfParams, data, Q, fingerprint);\n      return { V, C: new ECDHSymkey(C) };\n    }\n    case enums.publicKey.x25519: {\n      if (!util.isAES(symmetricAlgo)) {\n        // see https://gitlab.com/openpgp-wg/rfc4880bis/-/merge_requests/276\n        throw new Error('X25519 keys can only encrypt AES session keys');\n      }\n      const { A } = publicParams;\n      const { ephemeralPublicKey, wrappedKey } = await publicKey.elliptic.ecdhX.encrypt(\n        keyAlgo, data, A);\n      const C = ECDHXSymmetricKey.fromObject({ algorithm: symmetricAlgo, wrappedKey });\n      return { ephemeralPublicKey, C };\n    }\n    default:\n      return [];\n  }\n}\n\n/**\n * Decrypts data using specified algorithm and private key parameters.\n * See {@link https://tools.ietf.org/html/rfc4880#section-5.5.3|RFC 4880 5.5.3}\n * @param {module:enums.publicKey} algo - Public key algorithm\n * @param {Object} publicKeyParams - Algorithm-specific public key parameters\n * @param {Object} privateKeyParams - Algorithm-specific private key parameters\n * @param {Object} sessionKeyParams - Encrypted session key parameters\n * @param {Uint8Array} fingerprint - Recipient fingerprint\n * @param {Uint8Array} [randomPayload] - Data to return on decryption error, instead of throwing\n *                                    (needed for constant-time processing in RSA and ElGamal)\n * @returns {Promise<Uint8Array>} Decrypted data.\n * @throws {Error} on sensitive decryption error, unless `randomPayload` is given\n * @async\n */\nexport async function publicKeyDecrypt(algo, publicKeyParams, privateKeyParams, sessionKeyParams, fingerprint, randomPayload) {\n  switch (algo) {\n    case enums.publicKey.rsaEncryptSign:\n    case enums.publicKey.rsaEncrypt: {\n      const { c } = sessionKeyParams;\n      const { n, e } = publicKeyParams;\n      const { d, p, q, u } = privateKeyParams;\n      return publicKey.rsa.decrypt(c, n, e, d, p, q, u, randomPayload);\n    }\n    case enums.publicKey.elgamal: {\n      const { c1, c2 } = sessionKeyParams;\n      const p = publicKeyParams.p;\n      const x = privateKeyParams.x;\n      return publicKey.elgamal.decrypt(c1, c2, p, x, randomPayload);\n    }\n    case enums.publicKey.ecdh: {\n      const { oid, Q, kdfParams } = publicKeyParams;\n      const { d } = privateKeyParams;\n      const { V, C } = sessionKeyParams;\n      return publicKey.elliptic.ecdh.decrypt(\n        oid, kdfParams, V, C.data, Q, d, fingerprint);\n    }\n    case enums.publicKey.x25519: {\n      const { A } = publicKeyParams;\n      const { k } = privateKeyParams;\n      const { ephemeralPublicKey, C } = sessionKeyParams;\n      if (!util.isAES(C.algorithm)) {\n        throw new Error('AES session key expected');\n      }\n      return publicKey.elliptic.ecdhX.decrypt(\n        algo, ephemeralPublicKey, C.wrappedKey, A, k);\n    }\n    default:\n      throw new Error('Unknown public key encryption algorithm.');\n  }\n}\n\n/**\n * Parse public key material in binary form to get the key parameters\n * @param {module:enums.publicKey} algo - The key algorithm\n * @param {Uint8Array} bytes - The key material to parse\n * @returns {{ read: Number, publicParams: Object }} Number of read bytes plus key parameters referenced by name.\n */\nexport function parsePublicKeyParams(algo, bytes) {\n  let read = 0;\n  switch (algo) {\n    case enums.publicKey.rsaEncrypt:\n    case enums.publicKey.rsaEncryptSign:\n    case enums.publicKey.rsaSign: {\n      const n = util.readMPI(bytes.subarray(read)); read += n.length + 2;\n      const e = util.readMPI(bytes.subarray(read)); read += e.length + 2;\n      return { read, publicParams: { n, e } };\n    }\n    case enums.publicKey.dsa: {\n      const p = util.readMPI(bytes.subarray(read)); read += p.length + 2;\n      const q = util.readMPI(bytes.subarray(read)); read += q.length + 2;\n      const g = util.readMPI(bytes.subarray(read)); read += g.length + 2;\n      const y = util.readMPI(bytes.subarray(read)); read += y.length + 2;\n      return { read, publicParams: { p, q, g, y } };\n    }\n    case enums.publicKey.elgamal: {\n      const p = util.readMPI(bytes.subarray(read)); read += p.length + 2;\n      const g = util.readMPI(bytes.subarray(read)); read += g.length + 2;\n      const y = util.readMPI(bytes.subarray(read)); read += y.length + 2;\n      return { read, publicParams: { p, g, y } };\n    }\n    case enums.publicKey.ecdsa: {\n      const oid = new OID(); read += oid.read(bytes);\n      checkSupportedCurve(oid);\n      const Q = util.readMPI(bytes.subarray(read)); read += Q.length + 2;\n      return { read: read, publicParams: { oid, Q } };\n    }\n    case enums.publicKey.eddsaLegacy: {\n      const oid = new OID(); read += oid.read(bytes);\n      checkSupportedCurve(oid);\n      let Q = util.readMPI(bytes.subarray(read)); read += Q.length + 2;\n      Q = util.leftPad(Q, 33);\n      return { read: read, publicParams: { oid, Q } };\n    }\n    case enums.publicKey.ecdh: {\n      const oid = new OID(); read += oid.read(bytes);\n      checkSupportedCurve(oid);\n      const Q = util.readMPI(bytes.subarray(read)); read += Q.length + 2;\n      const kdfParams = new KDFParams(); read += kdfParams.read(bytes.subarray(read));\n      return { read: read, publicParams: { oid, Q, kdfParams } };\n    }\n    case enums.publicKey.ed25519:\n    case enums.publicKey.x25519: {\n      const A = bytes.subarray(read, read + 32); read += A.length;\n      return { read, publicParams: { A } };\n    }\n    default:\n      throw new UnsupportedError('Unknown public key encryption algorithm.');\n  }\n}\n\n/**\n * Parse private key material in binary form to get the key parameters\n * @param {module:enums.publicKey} algo - The key algorithm\n * @param {Uint8Array} bytes - The key material to parse\n * @param {Object} publicParams - (ECC only) public params, needed to format some private params\n * @returns {{ read: Number, privateParams: Object }} Number of read bytes plus the key parameters referenced by name.\n */\nexport function parsePrivateKeyParams(algo, bytes, publicParams) {\n  let read = 0;\n  switch (algo) {\n    case enums.publicKey.rsaEncrypt:\n    case enums.publicKey.rsaEncryptSign:\n    case enums.publicKey.rsaSign: {\n      const d = util.readMPI(bytes.subarray(read)); read += d.length + 2;\n      const p = util.readMPI(bytes.subarray(read)); read += p.length + 2;\n      const q = util.readMPI(bytes.subarray(read)); read += q.length + 2;\n      const u = util.readMPI(bytes.subarray(read)); read += u.length + 2;\n      return { read, privateParams: { d, p, q, u } };\n    }\n    case enums.publicKey.dsa:\n    case enums.publicKey.elgamal: {\n      const x = util.readMPI(bytes.subarray(read)); read += x.length + 2;\n      return { read, privateParams: { x } };\n    }\n    case enums.publicKey.ecdsa:\n    case enums.publicKey.ecdh: {\n      const curve = new CurveWithOID(publicParams.oid);\n      let d = util.readMPI(bytes.subarray(read)); read += d.length + 2;\n      d = util.leftPad(d, curve.payloadSize);\n      return { read, privateParams: { d } };\n    }\n    case enums.publicKey.eddsaLegacy: {\n      const curve = new CurveWithOID(publicParams.oid);\n      let seed = util.readMPI(bytes.subarray(read)); read += seed.length + 2;\n      seed = util.leftPad(seed, curve.payloadSize);\n      return { read, privateParams: { seed } };\n    }\n    case enums.publicKey.ed25519: {\n      const seed = bytes.subarray(read, read + 32); read += seed.length;\n      return { read, privateParams: { seed } };\n    }\n    case enums.publicKey.x25519: {\n      const k = bytes.subarray(read, read + 32); read += k.length;\n      return { read, privateParams: { k } };\n    }\n    default:\n      throw new UnsupportedError('Unknown public key encryption algorithm.');\n  }\n}\n\n/** Returns the types comprising the encrypted session key of an algorithm\n * @param {module:enums.publicKey} algo - The key algorithm\n * @param {Uint8Array} bytes - The key material to parse\n * @returns {Object} The session key parameters referenced by name.\n */\nexport function parseEncSessionKeyParams(algo, bytes) {\n  let read = 0;\n  switch (algo) {\n    //   Algorithm-Specific Fields for RSA encrypted session keys:\n    //       - MPI of RSA encrypted value m**e mod n.\n    case enums.publicKey.rsaEncrypt:\n    case enums.publicKey.rsaEncryptSign: {\n      const c = util.readMPI(bytes.subarray(read));\n      return { c };\n    }\n\n    //   Algorithm-Specific Fields for Elgamal encrypted session keys:\n    //       - MPI of Elgamal value g**k mod p\n    //       - MPI of Elgamal value m * y**k mod p\n    case enums.publicKey.elgamal: {\n      const c1 = util.readMPI(bytes.subarray(read)); read += c1.length + 2;\n      const c2 = util.readMPI(bytes.subarray(read));\n      return { c1, c2 };\n    }\n    //   Algorithm-Specific Fields for ECDH encrypted session keys:\n    //       - MPI containing the ephemeral key used to establish the shared secret\n    //       - ECDH Symmetric Key\n    case enums.publicKey.ecdh: {\n      const V = util.readMPI(bytes.subarray(read)); read += V.length + 2;\n      const C = new ECDHSymkey(); C.read(bytes.subarray(read));\n      return { V, C };\n    }\n    //   Algorithm-Specific Fields for X25519 encrypted session keys:\n    //       - 32 octets representing an ephemeral X25519 public key.\n    //       - A one-octet size of the following fields.\n    //       - The one-octet algorithm identifier, if it was passed (in the case of a v3 PKESK packet).\n    //       - The encrypted session key.\n    case enums.publicKey.x25519: {\n      const ephemeralPublicKey = bytes.subarray(read, read + 32); read += ephemeralPublicKey.length;\n      const C = new ECDHXSymmetricKey(); C.read(bytes.subarray(read));\n      return { ephemeralPublicKey, C };\n    }\n    default:\n      throw new UnsupportedError('Unknown public key encryption algorithm.');\n  }\n}\n\n/**\n * Convert params to MPI and serializes them in the proper order\n * @param {module:enums.publicKey} algo - The public key algorithm\n * @param {Object} params - The key parameters indexed by name\n * @returns {Uint8Array} The array containing the MPIs.\n */\nexport function serializeParams(algo, params) {\n  // Some algorithms do not rely on MPIs to store the binary params\n  const algosWithNativeRepresentation = new Set([enums.publicKey.ed25519, enums.publicKey.x25519]);\n  const orderedParams = Object.keys(params).map(name => {\n    const param = params[name];\n    if (!util.isUint8Array(param)) return param.write();\n    return algosWithNativeRepresentation.has(algo) ? param : util.uint8ArrayToMPI(param);\n  });\n  return util.concatUint8Array(orderedParams);\n}\n\n/**\n * Generate algorithm-specific key parameters\n * @param {module:enums.publicKey} algo - The public key algorithm\n * @param {Integer} bits - Bit length for RSA keys\n * @param {module:type/oid} oid - Object identifier for ECC keys\n * @returns {Promise<{ publicParams: {Object}, privateParams: {Object} }>} The parameters referenced by name.\n * @async\n */\nexport function generateParams(algo, bits, oid) {\n  switch (algo) {\n    case enums.publicKey.rsaEncrypt:\n    case enums.publicKey.rsaEncryptSign:\n    case enums.publicKey.rsaSign: {\n      return publicKey.rsa.generate(bits, 65537).then(({ n, e, d, p, q, u }) => ({\n        privateParams: { d, p, q, u },\n        publicParams: { n, e }\n      }));\n    }\n    case enums.publicKey.ecdsa:\n      return publicKey.elliptic.generate(oid).then(({ oid, Q, secret }) => ({\n        privateParams: { d: secret },\n        publicParams: { oid: new OID(oid), Q }\n      }));\n    case enums.publicKey.eddsaLegacy:\n      return publicKey.elliptic.generate(oid).then(({ oid, Q, secret }) => ({\n        privateParams: { seed: secret },\n        publicParams: { oid: new OID(oid), Q }\n      }));\n    case enums.publicKey.ecdh:\n      return publicKey.elliptic.generate(oid).then(({ oid, Q, secret, hash, cipher }) => ({\n        privateParams: { d: secret },\n        publicParams: {\n          oid: new OID(oid),\n          Q,\n          kdfParams: new KDFParams({ hash, cipher })\n        }\n      }));\n    case enums.publicKey.ed25519:\n      return publicKey.elliptic.eddsa.generate(algo).then(({ A, seed }) => ({\n        privateParams: { seed },\n        publicParams: { A }\n      }));\n    case enums.publicKey.x25519:\n      return publicKey.elliptic.ecdhX.generate(algo).then(({ A, k }) => ({\n        privateParams: { k },\n        publicParams: { A }\n      }));\n    case enums.publicKey.dsa:\n    case enums.publicKey.elgamal:\n      throw new Error('Unsupported algorithm for key generation.');\n    default:\n      throw new Error('Unknown public key algorithm.');\n  }\n}\n\n/**\n * Validate algorithm-specific key parameters\n * @param {module:enums.publicKey} algo - The public key algorithm\n * @param {Object} publicParams - Algorithm-specific public key parameters\n * @param {Object} privateParams - Algorithm-specific private key parameters\n * @returns {Promise<Boolean>} Whether the parameters are valid.\n * @async\n */\nexport async function validateParams(algo, publicParams, privateParams) {\n  if (!publicParams || !privateParams) {\n    throw new Error('Missing key parameters');\n  }\n  switch (algo) {\n    case enums.publicKey.rsaEncrypt:\n    case enums.publicKey.rsaEncryptSign:\n    case enums.publicKey.rsaSign: {\n      const { n, e } = publicParams;\n      const { d, p, q, u } = privateParams;\n      return publicKey.rsa.validateParams(n, e, d, p, q, u);\n    }\n    case enums.publicKey.dsa: {\n      const { p, q, g, y } = publicParams;\n      const { x } = privateParams;\n      return publicKey.dsa.validateParams(p, q, g, y, x);\n    }\n    case enums.publicKey.elgamal: {\n      const { p, g, y } = publicParams;\n      const { x } = privateParams;\n      return publicKey.elgamal.validateParams(p, g, y, x);\n    }\n    case enums.publicKey.ecdsa:\n    case enums.publicKey.ecdh: {\n      const algoModule = publicKey.elliptic[enums.read(enums.publicKey, algo)];\n      const { oid, Q } = publicParams;\n      const { d } = privateParams;\n      return algoModule.validateParams(oid, Q, d);\n    }\n    case enums.publicKey.eddsaLegacy: {\n      const { Q, oid } = publicParams;\n      const { seed } = privateParams;\n      return publicKey.elliptic.eddsaLegacy.validateParams(oid, Q, seed);\n    }\n    case enums.publicKey.ed25519: {\n      const { A } = publicParams;\n      const { seed } = privateParams;\n      return publicKey.elliptic.eddsa.validateParams(algo, A, seed);\n    }\n    case enums.publicKey.x25519: {\n      const { A } = publicParams;\n      const { k } = privateParams;\n      return publicKey.elliptic.ecdhX.validateParams(algo, A, k);\n    }\n    default:\n      throw new Error('Unknown public key algorithm.');\n  }\n}\n\n/**\n * Generates a random byte prefix for the specified algorithm\n * See {@link https://tools.ietf.org/html/rfc4880#section-9.2|RFC 4880 9.2} for algorithms.\n * @param {module:enums.symmetric} algo - Symmetric encryption algorithm\n * @returns {Promise<Uint8Array>} Random bytes with length equal to the block size of the cipher, plus the last two bytes repeated.\n * @async\n */\nexport async function getPrefixRandom(algo) {\n  const { blockSize } = getCipher(algo);\n  const prefixrandom = await getRandomBytes(blockSize);\n  const repeat = new Uint8Array([prefixrandom[prefixrandom.length - 2], prefixrandom[prefixrandom.length - 1]]);\n  return util.concat([prefixrandom, repeat]);\n}\n\n/**\n * Generating a session key for the specified symmetric algorithm\n * See {@link https://tools.ietf.org/html/rfc4880#section-9.2|RFC 4880 9.2} for algorithms.\n * @param {module:enums.symmetric} algo - Symmetric encryption algorithm\n * @returns {Uint8Array} Random bytes as a string to be used as a key.\n */\nexport function generateSessionKey(algo) {\n  const { keySize } = getCipher(algo);\n  return getRandomBytes(keySize);\n}\n\n/**\n * Get implementation of the given AEAD mode\n * @param {enums.aead} algo\n * @returns {Object}\n * @throws {Error} on invalid algo\n */\nexport function getAEADMode(algo) {\n  const algoName = enums.read(enums.aead, algo);\n  return mode[algoName];\n}\n\nexport { getCipher };\n\n/**\n * Check whether the given curve OID is supported\n * @param {module:type/oid} oid - EC object identifier\n * @throws {UnsupportedError} if curve is not supported\n */\nfunction checkSupportedCurve(oid) {\n  try {\n    oid.getName();\n  } catch (e) {\n    throw new UnsupportedError('Unknown curve OID');\n  }\n}\n\n/**\n * Get preferred hash algo for a given elliptic algo\n * @param {module:enums.publicKey} algo - alrogithm identifier\n * @param {module:type/oid} [oid] - curve OID if needed by algo\n */\nexport function getPreferredCurveHashAlgo(algo, oid) {\n  switch (algo) {\n    case enums.publicKey.ecdsa:\n    case enums.publicKey.eddsaLegacy:\n      return publicKey.elliptic.getPreferredHashAlgo(oid);\n    case enums.publicKey.ed25519:\n      return publicKey.elliptic.eddsa.getPreferredHashAlgo(algo);\n    default:\n      throw new Error('Unknown elliptic signing algo');\n  }\n}\n","/**\n * @fileoverview Provides access to all cryptographic primitives used in OpenPGP.js\n * @see module:crypto/crypto\n * @see module:crypto/signature\n * @see module:crypto/public_key\n * @see module:crypto/cipher\n * @see module:crypto/random\n * @see module:crypto/hash\n * @module crypto\n * @private\n */\n\nimport * as cipher from './cipher';\nimport hash from './hash';\nimport mode from './mode';\nimport publicKey from './public_key';\nimport * as signature from './signature';\nimport * as random from './random';\nimport * as pkcs1 from './pkcs1';\nimport * as pkcs5 from './pkcs5';\nimport * as crypto from './crypto';\nimport * as aesKW from './aes_kw';\n\n// TODO move cfb and gcm to cipher\nconst mod = {\n  /** @see module:crypto/cipher */\n  cipher: cipher,\n  /** @see module:crypto/hash */\n  hash: hash,\n  /** @see module:crypto/mode */\n  mode: mode,\n  /** @see module:crypto/public_key */\n  publicKey: publicKey,\n  /** @see module:crypto/signature */\n  signature: signature,\n  /** @see module:crypto/random */\n  random: random,\n  /** @see module:crypto/pkcs1 */\n  pkcs1: pkcs1,\n  /** @see module:crypto/pkcs5 */\n  pkcs5: pkcs5,\n  /** @see module:crypto/aes_kw */\n  aesKW: aesKW\n};\n\nObject.assign(mod, crypto);\n\nexport default mod;\n","\n\n\nvar TYPED_OK = typeof Uint8Array !== \"undefined\" &&\n  typeof Uint16Array !== \"undefined\" &&\n  typeof Int32Array !== \"undefined\";\n\nfunction _has(obj, key) {\n    return Object.prototype.hasOwnProperty.call(obj, key);\n}\n\nexport function assign(obj /*...args obj, from1, from2, from3, ...*/) {\n    var sources = Array.prototype.slice.call(arguments, 1);\n    while (sources.length) {\n        var source = sources.shift();\n        if (!source) {\n            continue; \n        }\n\n        if (typeof source !== \"object\") {\n            throw new TypeError(source + \"must be non-object\");\n        }\n\n        for (var p in source) {\n            if (_has(source, p)) {\n                obj[p] = source[p];\n            }\n        }\n    }\n\n    return obj;\n    //return Object.assign(...args);\n}\n\n\n// reduce buffer size, avoiding mem copy\nexport function shrinkBuf(buf, size) {\n    if (buf.length === size) {\n        return buf; \n    }\n    if (buf.subarray) {\n        return buf.subarray(0, size); \n    }\n    buf.length = size;\n    return buf;\n}\n\n\nconst fnTyped = {\n    arraySet: function (dest, src, src_offs, len, dest_offs) {\n        if (src.subarray && dest.subarray) {\n            dest.set(src.subarray(src_offs, src_offs + len), dest_offs);\n            return;\n        }\n        // Fallback to ordinary array\n        for (let i = 0; i < len; i++) {\n            dest[dest_offs + i] = src[src_offs + i];\n        }\n    },\n    // Join array of chunks to single array.\n    flattenChunks: function (chunks) {\n        let i, l, len, pos, chunk;\n\n        // calculate data length\n        len = 0;\n        for (i = 0, l = chunks.length; i < l; i++) {\n            len += chunks[i].length;\n        }\n\n        // join chunks\n        const result = new Uint8Array(len);\n        pos = 0;\n        for (i = 0, l = chunks.length; i < l; i++) {\n            chunk = chunks[i];\n            result.set(chunk, pos);\n            pos += chunk.length;\n        }\n\n        return result;\n    }\n};\n\nconst fnUntyped = {\n    arraySet: function (dest, src, src_offs, len, dest_offs) {\n        for (let i = 0; i < len; i++) {\n            dest[dest_offs + i] = src[src_offs + i];\n        }\n    },\n    // Join array of chunks to single array.\n    flattenChunks: function (chunks) {\n        return [].concat.apply([], chunks);\n    }\n};\n\n\n// Enable/Disable typed arrays use, for testing\n//\n\nexport let Buf8 = TYPED_OK ? Uint8Array : Array;\nexport let Buf16 = TYPED_OK ? Uint16Array : Array;\nexport let Buf32 = TYPED_OK ? Int32Array : Array;\nexport let flattenChunks = TYPED_OK ? fnTyped.flattenChunks : fnUntyped.flattenChunks;\nexport let arraySet = TYPED_OK ? fnTyped.arraySet : fnUntyped.arraySet;\nexport function setTyped(on) {\n    if (on) {\n        Buf8 = Uint8Array;\n        Buf16 = Uint16Array;\n        Buf32 = Int32Array;\n        ({ flattenChunks, arraySet } = fnTyped);\n    } else {\n        Buf8 = Array;\n        Buf16 = Array;\n        Buf32 = Array;\n        ({ flattenChunks, arraySet } = fnUntyped);\n    }\n}","\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n//   claim that you wrote the original software. If you use this software\n//   in a product, an acknowledgment in the product documentation would be\n//   appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n//   misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\n/* Allowed flush values; see deflate() and inflate() below for details */\nexport const Z_NO_FLUSH =         0;\nexport const Z_PARTIAL_FLUSH =    1;\nexport const Z_SYNC_FLUSH =       2;\nexport const Z_FULL_FLUSH =       3;\nexport const Z_FINISH =           4;\nexport const Z_BLOCK =            5;\nexport const Z_TREES =            6;\n\n/* Return codes for the compression/decompression functions. Negative values\n * are errors, positive values are used for special but normal events.\n */\nexport const Z_OK =               0;\nexport const Z_STREAM_END =       1;\nexport const Z_NEED_DICT =        2;\nexport const Z_ERRNO =           -1;\nexport const Z_STREAM_ERROR =    -2;\nexport const Z_DATA_ERROR =      -3;\n//export const Z_MEM_ERROR =     -4;\nexport const Z_BUF_ERROR =       -5;\n//export const Z_VERSION_ERROR = -6;\n\n    /* compression levels */\nexport const Z_NO_COMPRESSION =         0;\nexport const Z_BEST_SPEED =             1;\nexport const Z_BEST_COMPRESSION =       9;\nexport const Z_DEFAULT_COMPRESSION =   -1;\n\n\nexport const Z_FILTERED =               1;\nexport const Z_HUFFMAN_ONLY =           2;\nexport const Z_RLE =                    3;\nexport const Z_FIXED =                  4;\nexport const Z_DEFAULT_STRATEGY =       0;\n\n/* Possible values of the data_type field (though see inflate()) */\nexport const Z_BINARY =                 0;\nexport const Z_TEXT =                   1;\n//export const Z_ASCII =                1; // = Z_TEXT (deprecated)\nexport const Z_UNKNOWN =                2;\n\n/* The deflate compression method */\nexport const Z_DEFLATED =               8;\n//export const Z_NULL =                 null // Use -1 or null inline, depending on var type\n","\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n//   claim that you wrote the original software. If you use this software\n//   in a product, an acknowledgment in the product documentation would be\n//   appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n//   misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\n/* eslint-disable space-unary-ops */\n\nimport * as utils from \"../utils/common.js\";\nimport {\n    Z_FIXED,\n    Z_BINARY,\n    Z_TEXT,\n    Z_UNKNOWN\n} from \"./constants.js\";\n\n/*============================================================================*/\n\n\nfunction zero(buf) {\n    let len = buf.length; while (--len >= 0) {\n        buf[len] = 0; \n    } \n}\n\n// From zutil.h\n\nconst STORED_BLOCK = 0;\nconst STATIC_TREES = 1;\nconst DYN_TREES    = 2;\n/* The three kinds of block type */\n\nconst MIN_MATCH    = 3;\nconst MAX_MATCH    = 258;\n/* The minimum and maximum match lengths */\n\n// From deflate.h\n/* ===========================================================================\n * Internal compression state.\n */\n\nconst LENGTH_CODES  = 29;\n/* number of length codes, not counting the special END_BLOCK code */\n\nconst LITERALS      = 256;\n/* number of literal bytes 0..255 */\n\nconst L_CODES       = LITERALS + 1 + LENGTH_CODES;\n/* number of Literal or Length codes, including the END_BLOCK code */\n\nconst D_CODES       = 30;\n/* number of distance codes */\n\nconst BL_CODES      = 19;\n/* number of codes used to transfer the bit lengths */\n\nconst HEAP_SIZE     = 2 * L_CODES + 1;\n/* maximum heap size */\n\nconst MAX_BITS      = 15;\n/* All codes must not exceed MAX_BITS bits */\n\nconst Buf_size      = 16;\n/* size of bit buffer in bi_buf */\n\n\n/* ===========================================================================\n * Constants\n */\n\nconst MAX_BL_BITS = 7;\n/* Bit length codes must not exceed MAX_BL_BITS bits */\n\nconst END_BLOCK   = 256;\n/* end of block literal code */\n\nconst REP_3_6     = 16;\n/* repeat previous bit length 3-6 times (2 bits of repeat count) */\n\nconst REPZ_3_10   = 17;\n/* repeat a zero length 3-10 times  (3 bits of repeat count) */\n\nconst REPZ_11_138 = 18;\n/* repeat a zero length 11-138 times  (7 bits of repeat count) */\n\n/* eslint-disable comma-spacing,array-bracket-spacing */\nconst extra_lbits =   /* extra bits for each length code */\n  [0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0];\n\nconst extra_dbits =   /* extra bits for each distance code */\n  [0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13];\n\nconst extra_blbits =  /* extra bits for each bit length code */\n  [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7];\n\nconst bl_order =\n  [16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];\n/* eslint-enable comma-spacing,array-bracket-spacing */\n\n/* The lengths of the bit length codes are sent in order of decreasing\n * probability, to avoid transmitting the lengths for unused bit length codes.\n */\n\n/* ===========================================================================\n * Local data. These are initialized only once.\n */\n\n// We pre-fill arrays with 0 to avoid uninitialized gaps\n\nconst DIST_CODE_LEN = 512; /* see definition of array dist_code below */\n\n// !!!! Use flat array instead of structure, Freq = i*2, Len = i*2+1\nconst static_ltree  = new Array((L_CODES + 2) * 2);\nzero(static_ltree);\n/* The static literal tree. Since the bit lengths are imposed, there is no\n * need for the L_CODES extra codes used during heap construction. However\n * The codes 286 and 287 are needed to build a canonical tree (see _tr_init\n * below).\n */\n\nconst static_dtree  = new Array(D_CODES * 2);\nzero(static_dtree);\n/* The static distance tree. (Actually a trivial tree since all codes use\n * 5 bits.)\n */\n\nconst _dist_code    = new Array(DIST_CODE_LEN);\nzero(_dist_code);\n/* Distance codes. The first 256 values correspond to the distances\n * 3 .. 258, the last 256 values correspond to the top 8 bits of\n * the 15 bit distances.\n */\n\nconst _length_code  = new Array(MAX_MATCH - MIN_MATCH + 1);\nzero(_length_code);\n/* length code for each normalized match length (0 == MIN_MATCH) */\n\nconst base_length   = new Array(LENGTH_CODES);\nzero(base_length);\n/* First normalized length for each code (0 = MIN_MATCH) */\n\nconst base_dist     = new Array(D_CODES);\nzero(base_dist);\n/* First normalized distance for each code (0 = distance of 1) */\n\n\nfunction StaticTreeDesc(static_tree, extra_bits, extra_base, elems, max_length) {\n\n    this.static_tree  = static_tree;  /* static tree or NULL */\n    this.extra_bits   = extra_bits;   /* extra bits for each code or NULL */\n    this.extra_base   = extra_base;   /* base index for extra_bits */\n    this.elems        = elems;        /* max number of elements in the tree */\n    this.max_length   = max_length;   /* max bit length for the codes */\n\n    // show if `static_tree` has data or dummy - needed for monomorphic objects\n    this.has_stree    = static_tree && static_tree.length;\n}\n\n\nlet static_l_desc;\nlet static_d_desc;\nlet static_bl_desc;\n\n\nfunction TreeDesc(dyn_tree, stat_desc) {\n    this.dyn_tree = dyn_tree;     /* the dynamic tree */\n    this.max_code = 0;            /* largest code with non zero frequency */\n    this.stat_desc = stat_desc;   /* the corresponding static tree */\n}\n\n\n\nfunction d_code(dist) {\n    return dist < 256 ? _dist_code[dist] : _dist_code[256 + (dist >>> 7)];\n}\n\n\n/* ===========================================================================\n * Output a short LSB first on the stream.\n * IN assertion: there is enough room in pendingBuf.\n */\nfunction put_short(s, w) {\n//    put_byte(s, (uch)((w) & 0xff));\n//    put_byte(s, (uch)((ush)(w) >> 8));\n    s.pending_buf[s.pending++] = w & 0xff;\n    s.pending_buf[s.pending++] = w >>> 8 & 0xff;\n}\n\n\n/* ===========================================================================\n * Send a value on a given number of bits.\n * IN assertion: length <= 16 and value fits in length bits.\n */\nfunction send_bits(s, value, length) {\n    if (s.bi_valid > Buf_size - length) {\n        s.bi_buf |= value << s.bi_valid & 0xffff;\n        put_short(s, s.bi_buf);\n        s.bi_buf = value >> Buf_size - s.bi_valid;\n        s.bi_valid += length - Buf_size;\n    } else {\n        s.bi_buf |= value << s.bi_valid & 0xffff;\n        s.bi_valid += length;\n    }\n}\n\n\nfunction send_code(s, c, tree) {\n    send_bits(s, tree[c * 2]/*.Code*/, tree[c * 2 + 1]/*.Len*/);\n}\n\n\n/* ===========================================================================\n * Reverse the first len bits of a code, using straightforward code (a faster\n * method would use a table)\n * IN assertion: 1 <= len <= 15\n */\nfunction bi_reverse(code, len) {\n    let res = 0;\n    do {\n        res |= code & 1;\n        code >>>= 1;\n        res <<= 1;\n    } while (--len > 0);\n    return res >>> 1;\n}\n\n\n/* ===========================================================================\n * Flush the bit buffer, keeping at most 7 bits in it.\n */\nfunction bi_flush(s) {\n    if (s.bi_valid === 16) {\n        put_short(s, s.bi_buf);\n        s.bi_buf = 0;\n        s.bi_valid = 0;\n\n    } else if (s.bi_valid >= 8) {\n        s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n        s.bi_buf >>= 8;\n        s.bi_valid -= 8;\n    }\n}\n\n\n/* ===========================================================================\n * Compute the optimal bit lengths for a tree and update the total bit length\n * for the current block.\n * IN assertion: the fields freq and dad are set, heap[heap_max] and\n *    above are the tree nodes sorted by increasing frequency.\n * OUT assertions: the field len is set to the optimal bit length, the\n *     array bl_count contains the frequencies for each bit length.\n *     The length opt_len is updated; static_len is also updated if stree is\n *     not null.\n */\nfunction gen_bitlen(s, desc)\n//    deflate_state *s;\n//    tree_desc *desc;    /* the tree descriptor */\n{\n    const tree            = desc.dyn_tree;\n    const max_code        = desc.max_code;\n    const stree           = desc.stat_desc.static_tree;\n    const has_stree       = desc.stat_desc.has_stree;\n    const extra           = desc.stat_desc.extra_bits;\n    const base            = desc.stat_desc.extra_base;\n    const max_length      = desc.stat_desc.max_length;\n    let h;              /* heap index */\n    let n, m;           /* iterate over the tree elements */\n    let bits;           /* bit length */\n    let xbits;          /* extra bits */\n    let f;              /* frequency */\n    let overflow = 0;   /* number of elements with bit length too large */\n\n    for (bits = 0; bits <= MAX_BITS; bits++) {\n        s.bl_count[bits] = 0;\n    }\n\n    /* In a first pass, compute the optimal bit lengths (which may\n   * overflow in the case of the bit length tree).\n   */\n    tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */\n\n    for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n        n = s.heap[h];\n        bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;\n        if (bits > max_length) {\n            bits = max_length;\n            overflow++;\n        }\n        tree[n * 2 + 1]/*.Len*/ = bits;\n        /* We overwrite tree[n].Dad which is no longer needed */\n\n        if (n > max_code) {\n            continue; \n        } /* not a leaf node */\n\n        s.bl_count[bits]++;\n        xbits = 0;\n        if (n >= base) {\n            xbits = extra[n - base];\n        }\n        f = tree[n * 2]/*.Freq*/;\n        s.opt_len += f * (bits + xbits);\n        if (has_stree) {\n            s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);\n        }\n    }\n    if (overflow === 0) {\n        return; \n    }\n\n    // Trace((stderr,\"\\nbit length overflow\\n\"));\n    /* This happens for example on obj2 and pic of the Calgary corpus */\n\n    /* Find the first bit length which could increase: */\n    do {\n        bits = max_length - 1;\n        while (s.bl_count[bits] === 0) {\n            bits--; \n        }\n        s.bl_count[bits]--;      /* move one leaf down the tree */\n        s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */\n        s.bl_count[max_length]--;\n        /* The brother of the overflow item also moves one step up,\n     * but this does not affect bl_count[max_length]\n     */\n        overflow -= 2;\n    } while (overflow > 0);\n\n    /* Now recompute all bit lengths, scanning in increasing frequency.\n   * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n   * lengths instead of fixing only the wrong ones. This idea is taken\n   * from 'ar' written by Haruhiko Okumura.)\n   */\n    for (bits = max_length; bits !== 0; bits--) {\n        n = s.bl_count[bits];\n        while (n !== 0) {\n            m = s.heap[--h];\n            if (m > max_code) {\n                continue; \n            }\n            if (tree[m * 2 + 1]/*.Len*/ !== bits) {\n                // Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n                s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;\n                tree[m * 2 + 1]/*.Len*/ = bits;\n            }\n            n--;\n        }\n    }\n}\n\n\n/* ===========================================================================\n * Generate the codes for a given tree and bit counts (which need not be\n * optimal).\n * IN assertion: the array bl_count contains the bit length statistics for\n * the given tree and the field len is set for all tree elements.\n * OUT assertion: the field code is set for all tree elements of non\n *     zero code length.\n */\nfunction gen_codes(tree, max_code, bl_count)\n//    ct_data *tree;             /* the tree to decorate */\n//    int max_code;              /* largest code with non zero frequency */\n//    ushf *bl_count;            /* number of codes at each bit length */\n{\n    const next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n    let code = 0;              /* running code value */\n    let bits;                  /* bit index */\n    let n;                     /* code index */\n\n    /* The distribution counts are first used to generate the code values\n   * without bit reversal.\n   */\n    for (bits = 1; bits <= MAX_BITS; bits++) {\n        next_code[bits] = code = code + bl_count[bits - 1] << 1;\n    }\n    /* Check that the bit counts in bl_count are consistent. The last code\n   * must be all ones.\n   */\n    //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n    //        \"inconsistent bit counts\");\n    //Tracev((stderr,\"\\ngen_codes: max_code %d \", max_code));\n\n    for (n = 0;  n <= max_code; n++) {\n        const len = tree[n * 2 + 1]/*.Len*/;\n        if (len === 0) {\n            continue; \n        }\n        /* Now reverse the bits */\n        tree[n * 2]/*.Code*/ = bi_reverse(next_code[len]++, len);\n\n    //Tracecv(tree != static_ltree, (stderr,\"\\nn %3d %c l %2d c %4x (%x) \",\n    //     n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));\n    }\n}\n\n\n/* ===========================================================================\n * Initialize the various 'constant' tables.\n */\nfunction tr_static_init() {\n    let n;        /* iterates over tree elements */\n    let bits;     /* bit counter */\n    let length;   /* length value */\n    let code;     /* code value */\n    let dist;     /* distance index */\n    const bl_count = new Array(MAX_BITS + 1);\n    /* number of codes at each bit length for an optimal tree */\n\n    // do check in _tr_init()\n    //if (static_init_done) return;\n\n    /* For some embedded targets, global variables are not initialized: */\n    /*#ifdef NO_INIT_GLOBAL_POINTERS\n  static_l_desc.static_tree = static_ltree;\n  static_l_desc.extra_bits = extra_lbits;\n  static_d_desc.static_tree = static_dtree;\n  static_d_desc.extra_bits = extra_dbits;\n  static_bl_desc.extra_bits = extra_blbits;\n#endif*/\n\n    /* Initialize the mapping length (0..255) -> length code (0..28) */\n    length = 0;\n    for (code = 0; code < LENGTH_CODES - 1; code++) {\n        base_length[code] = length;\n        for (n = 0; n < 1 << extra_lbits[code]; n++) {\n            _length_code[length++] = code;\n        }\n    }\n    //Assert (length == 256, \"tr_static_init: length != 256\");\n    /* Note that the length 255 (match length 258) can be represented\n   * in two different ways: code 284 + 5 bits or code 285, so we\n   * overwrite length_code[255] to use the best encoding:\n   */\n    _length_code[length - 1] = code;\n\n    /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n    dist = 0;\n    for (code = 0; code < 16; code++) {\n        base_dist[code] = dist;\n        for (n = 0; n < 1 << extra_dbits[code]; n++) {\n            _dist_code[dist++] = code;\n        }\n    }\n    //Assert (dist == 256, \"tr_static_init: dist != 256\");\n    dist >>= 7; /* from now on, all distances are divided by 128 */\n    for (; code < D_CODES; code++) {\n        base_dist[code] = dist << 7;\n        for (n = 0; n < 1 << extra_dbits[code] - 7; n++) {\n            _dist_code[256 + dist++] = code;\n        }\n    }\n    //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n    /* Construct the codes of the static literal tree */\n    for (bits = 0; bits <= MAX_BITS; bits++) {\n        bl_count[bits] = 0;\n    }\n\n    n = 0;\n    while (n <= 143) {\n        static_ltree[n * 2 + 1]/*.Len*/ = 8;\n        n++;\n        bl_count[8]++;\n    }\n    while (n <= 255) {\n        static_ltree[n * 2 + 1]/*.Len*/ = 9;\n        n++;\n        bl_count[9]++;\n    }\n    while (n <= 279) {\n        static_ltree[n * 2 + 1]/*.Len*/ = 7;\n        n++;\n        bl_count[7]++;\n    }\n    while (n <= 287) {\n        static_ltree[n * 2 + 1]/*.Len*/ = 8;\n        n++;\n        bl_count[8]++;\n    }\n    /* Codes 286 and 287 do not exist, but we must include them in the\n   * tree construction to get a canonical Huffman tree (longest code\n   * all ones)\n   */\n    gen_codes(static_ltree, L_CODES + 1, bl_count);\n\n    /* The static distance tree is trivial: */\n    for (n = 0; n < D_CODES; n++) {\n        static_dtree[n * 2 + 1]/*.Len*/ = 5;\n        static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);\n    }\n\n    // Now data ready and we can init static trees\n    static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);\n    static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0,          D_CODES, MAX_BITS);\n    static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0,         BL_CODES, MAX_BL_BITS);\n\n    //static_init_done = true;\n}\n\n\n/* ===========================================================================\n * Initialize a new block.\n */\nfunction init_block(s) {\n    let n; /* iterates over tree elements */\n\n    /* Initialize the trees. */\n    for (n = 0; n < L_CODES;  n++) {\n        s.dyn_ltree[n * 2]/*.Freq*/ = 0; \n    }\n    for (n = 0; n < D_CODES;  n++) {\n        s.dyn_dtree[n * 2]/*.Freq*/ = 0; \n    }\n    for (n = 0; n < BL_CODES; n++) {\n        s.bl_tree[n * 2]/*.Freq*/ = 0; \n    }\n\n    s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1;\n    s.opt_len = s.static_len = 0;\n    s.last_lit = s.matches = 0;\n}\n\n\n/* ===========================================================================\n * Flush the bit buffer and align the output on a byte boundary\n */\nfunction bi_windup(s) {\n    if (s.bi_valid > 8) {\n        put_short(s, s.bi_buf);\n    } else if (s.bi_valid > 0) {\n    //put_byte(s, (Byte)s->bi_buf);\n        s.pending_buf[s.pending++] = s.bi_buf;\n    }\n    s.bi_buf = 0;\n    s.bi_valid = 0;\n}\n\n/* ===========================================================================\n * Copy a stored block, storing first the length and its\n * one's complement if requested.\n */\nfunction copy_block(s, buf, len, header)\n//DeflateState *s;\n//charf    *buf;    /* the input data */\n//unsigned len;     /* its length */\n//int      header;  /* true if block header must be written */\n{\n    bi_windup(s);        /* align on byte boundary */\n\n    if (header) {\n        put_short(s, len);\n        put_short(s, ~len);\n    }\n    //  while (len--) {\n    //    put_byte(s, *buf++);\n    //  }\n    utils.arraySet(s.pending_buf, s.window, buf, len, s.pending);\n    s.pending += len;\n}\n\n/* ===========================================================================\n * Compares to subtrees, using the tree depth as tie breaker when\n * the subtrees have equal frequency. This minimizes the worst case length.\n */\nfunction smaller(tree, n, m, depth) {\n    const _n2 = n * 2;\n    const _m2 = m * 2;\n    return tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||\n         tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m];\n}\n\n/* ===========================================================================\n * Restore the heap property by moving down the tree starting at node k,\n * exchanging a node with the smallest of its two sons if necessary, stopping\n * when the heap property is re-established (each father smaller than its\n * two sons).\n */\nfunction pqdownheap(s, tree, k)\n//    deflate_state *s;\n//    ct_data *tree;  /* the tree to restore */\n//    int k;               /* node to move down */\n{\n    const v = s.heap[k];\n    let j = k << 1;  /* left son of k */\n    while (j <= s.heap_len) {\n    /* Set j to the smallest of the two sons: */\n        if (j < s.heap_len &&\n      smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n            j++;\n        }\n        /* Exit if v is smaller than both sons */\n        if (smaller(tree, v, s.heap[j], s.depth)) {\n            break; \n        }\n\n        /* Exchange v with the smallest son */\n        s.heap[k] = s.heap[j];\n        k = j;\n\n        /* And continue down the tree, setting j to the left son of k */\n        j <<= 1;\n    }\n    s.heap[k] = v;\n}\n\n\n// inlined manually\n// var SMALLEST = 1;\n\n/* ===========================================================================\n * Send the block data compressed using the given Huffman trees\n */\nfunction compress_block(s, ltree, dtree)\n//    deflate_state *s;\n//    const ct_data *ltree; /* literal tree */\n//    const ct_data *dtree; /* distance tree */\n{\n    let dist;           /* distance of matched string */\n    let lc;             /* match length or unmatched char (if dist == 0) */\n    let lx = 0;         /* running index in l_buf */\n    let code;           /* the code to send */\n    let extra;          /* number of extra bits to send */\n\n    if (s.last_lit !== 0) {\n        do {\n            dist = s.pending_buf[s.d_buf + lx * 2] << 8 | s.pending_buf[s.d_buf + lx * 2 + 1];\n            lc = s.pending_buf[s.l_buf + lx];\n            lx++;\n\n            if (dist === 0) {\n                send_code(s, lc, ltree); /* send a literal byte */\n                //Tracecv(isgraph(lc), (stderr,\" '%c' \", lc));\n            } else {\n                /* Here, lc is the match length - MIN_MATCH */\n                code = _length_code[lc];\n                send_code(s, code + LITERALS + 1, ltree); /* send the length code */\n                extra = extra_lbits[code];\n                if (extra !== 0) {\n                    lc -= base_length[code];\n                    send_bits(s, lc, extra);       /* send the extra length bits */\n                }\n                dist--; /* dist is now the match distance - 1 */\n                code = d_code(dist);\n                //Assert (code < D_CODES, \"bad d_code\");\n\n                send_code(s, code, dtree);       /* send the distance code */\n                extra = extra_dbits[code];\n                if (extra !== 0) {\n                    dist -= base_dist[code];\n                    send_bits(s, dist, extra);   /* send the extra distance bits */\n                }\n            } /* literal or match pair ? */\n\n            /* Check that the overlay between pending_buf and d_buf+l_buf is ok: */\n            //Assert((uInt)(s->pending) < s->lit_bufsize + 2*lx,\n            //       \"pendingBuf overflow\");\n\n        } while (lx < s.last_lit);\n    }\n\n    send_code(s, END_BLOCK, ltree);\n}\n\n\n/* ===========================================================================\n * Construct one Huffman tree and assigns the code bit strings and lengths.\n * Update the total bit length for the current block.\n * IN assertion: the field freq is set for all tree elements.\n * OUT assertions: the fields len and code are set to the optimal bit length\n *     and corresponding code. The length opt_len is updated; static_len is\n *     also updated if stree is not null. The field max_code is set.\n */\nfunction build_tree(s, desc)\n//    deflate_state *s;\n//    tree_desc *desc; /* the tree descriptor */\n{\n    const tree     = desc.dyn_tree;\n    const stree    = desc.stat_desc.static_tree;\n    const has_stree = desc.stat_desc.has_stree;\n    const elems    = desc.stat_desc.elems;\n    let n, m;          /* iterate over heap elements */\n    let max_code = -1; /* largest code with non zero frequency */\n    let node;          /* new node being created */\n\n    /* Construct the initial heap, with least frequent element in\n   * heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n+1].\n   * heap[0] is not used.\n   */\n    s.heap_len = 0;\n    s.heap_max = HEAP_SIZE;\n\n    for (n = 0; n < elems; n++) {\n        if (tree[n * 2]/*.Freq*/ !== 0) {\n            s.heap[++s.heap_len] = max_code = n;\n            s.depth[n] = 0;\n\n        } else {\n            tree[n * 2 + 1]/*.Len*/ = 0;\n        }\n    }\n\n    /* The pkzip format requires that at least one distance code exists,\n   * and that at least one bit should be sent even if there is only one\n   * possible code. So to avoid special checks later on we force at least\n   * two codes of non zero frequency.\n   */\n    while (s.heap_len < 2) {\n        node = s.heap[++s.heap_len] = max_code < 2 ? ++max_code : 0;\n        tree[node * 2]/*.Freq*/ = 1;\n        s.depth[node] = 0;\n        s.opt_len--;\n\n        if (has_stree) {\n            s.static_len -= stree[node * 2 + 1]/*.Len*/;\n        }\n    /* node is 0 or 1 so it does not have extra bits */\n    }\n    desc.max_code = max_code;\n\n    /* The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree,\n   * establish sub-heaps of increasing lengths:\n   */\n    for (n = s.heap_len >> 1/*int /2*/; n >= 1; n--) {\n        pqdownheap(s, tree, n); \n    }\n\n    /* Construct the Huffman tree by repeatedly combining the least two\n   * frequent nodes.\n   */\n    node = elems;              /* next internal node of the tree */\n    do {\n    //pqremove(s, tree, n);  /* n = node of least frequency */\n    /*** pqremove ***/\n        n = s.heap[1/*SMALLEST*/];\n        s.heap[1/*SMALLEST*/] = s.heap[s.heap_len--];\n        pqdownheap(s, tree, 1/*SMALLEST*/);\n        /***/\n\n        m = s.heap[1/*SMALLEST*/]; /* m = node of next least frequency */\n\n        s.heap[--s.heap_max] = n; /* keep the nodes sorted by frequency */\n        s.heap[--s.heap_max] = m;\n\n        /* Create a new node father of n and m */\n        tree[node * 2]/*.Freq*/ = tree[n * 2]/*.Freq*/ + tree[m * 2]/*.Freq*/;\n        s.depth[node] = (s.depth[n] >= s.depth[m] ? s.depth[n] : s.depth[m]) + 1;\n        tree[n * 2 + 1]/*.Dad*/ = tree[m * 2 + 1]/*.Dad*/ = node;\n\n        /* and insert the new node in the heap */\n        s.heap[1/*SMALLEST*/] = node++;\n        pqdownheap(s, tree, 1/*SMALLEST*/);\n\n    } while (s.heap_len >= 2);\n\n    s.heap[--s.heap_max] = s.heap[1/*SMALLEST*/];\n\n    /* At this point, the fields freq and dad are set. We can now\n   * generate the bit lengths.\n   */\n    gen_bitlen(s, desc);\n\n    /* The field len is now set, we can generate the bit codes */\n    gen_codes(tree, max_code, s.bl_count);\n}\n\n\n/* ===========================================================================\n * Scan a literal or distance tree to determine the frequencies of the codes\n * in the bit length tree.\n */\nfunction scan_tree(s, tree, max_code)\n//    deflate_state *s;\n//    ct_data *tree;   /* the tree to be scanned */\n//    int max_code;    /* and its largest code of non zero frequency */\n{\n    let n;                     /* iterates over all tree elements */\n    let prevlen = -1;          /* last emitted length */\n    let curlen;                /* length of current code */\n\n    let nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n    let count = 0;             /* repeat count of the current code */\n    let max_count = 7;         /* max repeat count */\n    let min_count = 4;         /* min repeat count */\n\n    if (nextlen === 0) {\n        max_count = 138;\n        min_count = 3;\n    }\n    tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */\n\n    for (n = 0; n <= max_code; n++) {\n        curlen = nextlen;\n        nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n        if (++count < max_count && curlen === nextlen) {\n            continue;\n\n        } else if (count < min_count) {\n            s.bl_tree[curlen * 2]/*.Freq*/ += count;\n\n        } else if (curlen !== 0) {\n\n            if (curlen !== prevlen) {\n                s.bl_tree[curlen * 2]/*.Freq*/++; \n            }\n            s.bl_tree[REP_3_6 * 2]/*.Freq*/++;\n\n        } else if (count <= 10) {\n            s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;\n\n        } else {\n            s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;\n        }\n\n        count = 0;\n        prevlen = curlen;\n\n        if (nextlen === 0) {\n            max_count = 138;\n            min_count = 3;\n\n        } else if (curlen === nextlen) {\n            max_count = 6;\n            min_count = 3;\n\n        } else {\n            max_count = 7;\n            min_count = 4;\n        }\n    }\n}\n\n\n/* ===========================================================================\n * Send a literal or distance tree in compressed form, using the codes in\n * bl_tree.\n */\nfunction send_tree(s, tree, max_code)\n//    deflate_state *s;\n//    ct_data *tree; /* the tree to be scanned */\n//    int max_code;       /* and its largest code of non zero frequency */\n{\n    let n;                     /* iterates over all tree elements */\n    let prevlen = -1;          /* last emitted length */\n    let curlen;                /* length of current code */\n\n    let nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n    let count = 0;             /* repeat count of the current code */\n    let max_count = 7;         /* max repeat count */\n    let min_count = 4;         /* min repeat count */\n\n    /* tree[max_code+1].Len = -1; */  /* guard already set */\n    if (nextlen === 0) {\n        max_count = 138;\n        min_count = 3;\n    }\n\n    for (n = 0; n <= max_code; n++) {\n        curlen = nextlen;\n        nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n        if (++count < max_count && curlen === nextlen) {\n            continue;\n\n        } else if (count < min_count) {\n            do {\n                send_code(s, curlen, s.bl_tree); \n            } while (--count !== 0);\n\n        } else if (curlen !== 0) {\n            if (curlen !== prevlen) {\n                send_code(s, curlen, s.bl_tree);\n                count--;\n            }\n            //Assert(count >= 3 && count <= 6, \" 3_6?\");\n            send_code(s, REP_3_6, s.bl_tree);\n            send_bits(s, count - 3, 2);\n\n        } else if (count <= 10) {\n            send_code(s, REPZ_3_10, s.bl_tree);\n            send_bits(s, count - 3, 3);\n\n        } else {\n            send_code(s, REPZ_11_138, s.bl_tree);\n            send_bits(s, count - 11, 7);\n        }\n\n        count = 0;\n        prevlen = curlen;\n        if (nextlen === 0) {\n            max_count = 138;\n            min_count = 3;\n\n        } else if (curlen === nextlen) {\n            max_count = 6;\n            min_count = 3;\n\n        } else {\n            max_count = 7;\n            min_count = 4;\n        }\n    }\n}\n\n\n/* ===========================================================================\n * Construct the Huffman tree for the bit lengths and return the index in\n * bl_order of the last bit length code to send.\n */\nfunction build_bl_tree(s) {\n    let max_blindex;  /* index of last bit length code of non zero freq */\n\n    /* Determine the bit length frequencies for literal and distance trees */\n    scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n    scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n\n    /* Build the bit length tree: */\n    build_tree(s, s.bl_desc);\n    /* opt_len now includes the length of the tree representations, except\n   * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n   */\n\n    /* Determine the number of bit length codes to send. The pkzip format\n   * requires that at least 4 bit length codes be sent. (appnote.txt says\n   * 3 but the actual value used is 4.)\n   */\n    for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n        if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {\n            break;\n        }\n    }\n    /* Update opt_len to include the bit length tree and counts */\n    s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n    //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n    //        s->opt_len, s->static_len));\n\n    return max_blindex;\n}\n\n\n/* ===========================================================================\n * Send the header for a block using dynamic Huffman trees: the counts, the\n * lengths of the bit length codes, the literal tree and the distance tree.\n * IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4.\n */\nfunction send_all_trees(s, lcodes, dcodes, blcodes)\n//    deflate_state *s;\n//    int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n    let rank;                    /* index in bl_order */\n\n    //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n    //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n    //        \"too many codes\");\n    //Tracev((stderr, \"\\nbl counts: \"));\n    send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */\n    send_bits(s, dcodes - 1,   5);\n    send_bits(s, blcodes - 4,  4); /* not -3 as stated in appnote.txt */\n    for (rank = 0; rank < blcodes; rank++) {\n    //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n        send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3);\n    }\n    //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n    send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */\n    //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n    send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */\n    //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}\n\n\n/* ===========================================================================\n * Check if the data type is TEXT or BINARY, using the following algorithm:\n * - TEXT if the two conditions below are satisfied:\n *    a) There are no non-portable control characters belonging to the\n *       \"black list\" (0..6, 14..25, 28..31).\n *    b) There is at least one printable character belonging to the\n *       \"white list\" (9 {TAB}, 10 {LF}, 13 {CR}, 32..255).\n * - BINARY otherwise.\n * - The following partially-portable control characters form a\n *   \"gray list\" that is ignored in this detection algorithm:\n *   (7 {BEL}, 8 {BS}, 11 {VT}, 12 {FF}, 26 {SUB}, 27 {ESC}).\n * IN assertion: the fields Freq of dyn_ltree are set.\n */\nfunction detect_data_type(s) {\n    /* black_mask is the bit mask of black-listed bytes\n   * set bits 0..6, 14..25, and 28..31\n   * 0xf3ffc07f = binary 11110011111111111100000001111111\n   */\n    let black_mask = 0xf3ffc07f;\n    let n;\n\n    /* Check for non-textual (\"black-listed\") bytes. */\n    for (n = 0; n <= 31; n++, black_mask >>>= 1) {\n        if (black_mask & 1 && s.dyn_ltree[n * 2]/*.Freq*/ !== 0) {\n            return Z_BINARY;\n        }\n    }\n\n    /* Check for textual (\"white-listed\") bytes. */\n    if (s.dyn_ltree[9 * 2]/*.Freq*/ !== 0 || s.dyn_ltree[10 * 2]/*.Freq*/ !== 0 ||\n      s.dyn_ltree[13 * 2]/*.Freq*/ !== 0) {\n        return Z_TEXT;\n    }\n    for (n = 32; n < LITERALS; n++) {\n        if (s.dyn_ltree[n * 2]/*.Freq*/ !== 0) {\n            return Z_TEXT;\n        }\n    }\n\n    /* There are no \"black-listed\" or \"white-listed\" bytes:\n   * this stream either is empty or has tolerated (\"gray-listed\") bytes only.\n   */\n    return Z_BINARY;\n}\n\n\nlet static_init_done = false;\n\n/* ===========================================================================\n * Initialize the tree data structures for a new zlib stream.\n */\nfunction _tr_init(s) {\n\n    if (!static_init_done) {\n        tr_static_init();\n        static_init_done = true;\n    }\n\n    s.l_desc  = new TreeDesc(s.dyn_ltree, static_l_desc);\n    s.d_desc  = new TreeDesc(s.dyn_dtree, static_d_desc);\n    s.bl_desc = new TreeDesc(s.bl_tree, static_bl_desc);\n\n    s.bi_buf = 0;\n    s.bi_valid = 0;\n\n    /* Initialize the first block of the first file: */\n    init_block(s);\n}\n\n\n/* ===========================================================================\n * Send a stored block\n */\nfunction _tr_stored_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf;       /* input block */\n//ulg stored_len;   /* length of input block */\n//int last;         /* one if this is the last block for a file */\n{\n    send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3);    /* send block type */\n    copy_block(s, buf, stored_len, true); /* with header */\n}\n\n\n/* ===========================================================================\n * Send one empty static block to give enough lookahead for inflate.\n * This takes 10 bits, of which 7 may remain in the bit buffer.\n */\nfunction _tr_align(s) {\n    send_bits(s, STATIC_TREES << 1, 3);\n    send_code(s, END_BLOCK, static_ltree);\n    bi_flush(s);\n}\n\n\n/* ===========================================================================\n * Determine the best encoding for the current block: dynamic trees, static\n * trees or store, and output the encoded block to the zip file.\n */\nfunction _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf;       /* input block, or NULL if too old */\n//ulg stored_len;   /* length of input block */\n//int last;         /* one if this is the last block for a file */\n{\n    let opt_lenb, static_lenb;  /* opt_len and static_len in bytes */\n    let max_blindex = 0;        /* index of last bit length code of non zero freq */\n\n    /* Build the Huffman trees unless a stored block is forced */\n    if (s.level > 0) {\n\n        /* Check if the file is binary or text */\n        if (s.strm.data_type === Z_UNKNOWN) {\n            s.strm.data_type = detect_data_type(s);\n        }\n\n        /* Construct the literal and distance trees */\n        build_tree(s, s.l_desc);\n        // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n        //        s->static_len));\n\n        build_tree(s, s.d_desc);\n        // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n        //        s->static_len));\n        /* At this point, opt_len and static_len are the total bit lengths of\n     * the compressed block data, excluding the tree representations.\n     */\n\n        /* Build the bit length tree for the above two trees, and get the index\n     * in bl_order of the last bit length code to send.\n     */\n        max_blindex = build_bl_tree(s);\n\n        /* Determine the best encoding. Compute the block lengths in bytes. */\n        opt_lenb = s.opt_len + 3 + 7 >>> 3;\n        static_lenb = s.static_len + 3 + 7 >>> 3;\n\n        // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n        //        opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n        //        s->last_lit));\n\n        if (static_lenb <= opt_lenb) {\n            opt_lenb = static_lenb; \n        }\n\n    } else {\n    // Assert(buf != (char*)0, \"lost buf\");\n        opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n    }\n\n    if (stored_len + 4 <= opt_lenb && buf !== -1) {\n    /* 4: two words for the lengths */\n\n        /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n     * Otherwise we can't have processed more than WSIZE input bytes since\n     * the last block flush, because compression would have been\n     * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n     * transform a block into a stored block.\n     */\n        _tr_stored_block(s, buf, stored_len, last);\n\n    } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n        send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n        compress_block(s, static_ltree, static_dtree);\n\n    } else {\n        send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n        send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n        compress_block(s, s.dyn_ltree, s.dyn_dtree);\n    }\n    // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n    /* The above check is made mod 2^32, for files larger than 512 MB\n   * and uLong implemented on 32 bits.\n   */\n    init_block(s);\n\n    if (last) {\n        bi_windup(s);\n    }\n    // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n    //       s->compressed_len-7*last));\n}\n\n/* ===========================================================================\n * Save the match info and tally the frequency counts. Return true if\n * the current block must be flushed.\n */\nfunction _tr_tally(s, dist, lc)\n//    deflate_state *s;\n//    unsigned dist;  /* distance of matched string */\n//    unsigned lc;    /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n    //var out_length, in_length, dcode;\n\n    s.pending_buf[s.d_buf + s.last_lit * 2]     = dist >>> 8 & 0xff;\n    s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n    s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n    s.last_lit++;\n\n    if (dist === 0) {\n    /* lc is the unmatched char */\n        s.dyn_ltree[lc * 2]/*.Freq*/++;\n    } else {\n        s.matches++;\n        /* Here, lc is the match length - MIN_MATCH */\n        dist--;             /* dist = match distance - 1 */\n        //Assert((ush)dist < (ush)MAX_DIST(s) &&\n        //       (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n        //       (ush)d_code(dist) < (ush)D_CODES,  \"_tr_tally: bad match\");\n\n        s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++;\n        s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n    }\n\n    // (!) This block is disabled in zlib defaults,\n    // don't enable it for binary compatibility\n\n    //#ifdef TRUNCATE_BLOCK\n    //  /* Try to guess if it is profitable to stop the current block here */\n    //  if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n    //    /* Compute an upper bound for the compressed length */\n    //    out_length = s.last_lit*8;\n    //    in_length = s.strstart - s.block_start;\n    //\n    //    for (dcode = 0; dcode < D_CODES; dcode++) {\n    //      out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n    //    }\n    //    out_length >>>= 3;\n    //    //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n    //    //       s->last_lit, in_length, out_length,\n    //    //       100L - out_length*100L/in_length));\n    //    if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n    //      return true;\n    //    }\n    //  }\n    //#endif\n\n    return s.last_lit === s.lit_bufsize - 1;\n    /* We avoid equality with lit_bufsize because of wraparound at 64K\n   * on 16 bit machines and because stored blocks are restricted to\n   * 64K-1 bytes.\n   */\n}\n\nexport {\n    _tr_init,\n    _tr_stored_block,\n    _tr_flush_block,\n    _tr_tally,\n    _tr_align\n};","\n\n// Note: adler32 takes 12% for level 0 and 2% for level 6.\n// It isn't worth it to make additional optimizations as in original.\n// Small size is preferable.\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n//   claim that you wrote the original software. If you use this software\n//   in a product, an acknowledgment in the product documentation would be\n//   appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n//   misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nexport default function adler32(adler, buf, len, pos) {\n    let s1 = adler & 0xffff |0,\n        s2 = adler >>> 16 & 0xffff |0,\n        n = 0;\n\n    while (len !== 0) {\n    // Set limit ~ twice less than 5552, to keep\n    // s2 in 31-bits, because we force signed ints.\n    // in other case %= will fail.\n        n = len > 2000 ? 2000 : len;\n        len -= n;\n\n        do {\n            s1 = s1 + buf[pos++] |0;\n            s2 = s2 + s1 |0;\n        } while (--n);\n\n        s1 %= 65521;\n        s2 %= 65521;\n    }\n\n    return s1 | s2 << 16 |0;\n}\n","\n\n// Note: we can't get significant speed boost here.\n// So write code to minimize size - no pregenerated tables\n// and array tools dependencies.\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n//   claim that you wrote the original software. If you use this software\n//   in a product, an acknowledgment in the product documentation would be\n//   appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n//   misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\n// Use ordinary array, since untyped makes no boost here\nfunction makeTable() {\n    let c;\n    const table = [];\n\n    for (let n = 0; n < 256; n++) {\n        c = n;\n        for (let k = 0; k < 8; k++) {\n            c = c & 1 ? 0xEDB88320 ^ c >>> 1 : c >>> 1;\n        }\n        table[n] = c;\n    }\n\n    return table;\n}\n\n// Create table on load. Just 255 signed longs. Not a problem.\nconst crcTable = makeTable();\n\n\nexport default function crc32(crc, buf, len, pos) {\n    const t = crcTable,\n        end = pos + len;\n\n    crc ^= -1;\n\n    for (let i = pos; i < end; i++) {\n        crc = crc >>> 8 ^ t[(crc ^ buf[i]) & 0xFF];\n    }\n\n    return crc ^ -1; // >>> 0;\n}","\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n//   claim that you wrote the original software. If you use this software\n//   in a product, an acknowledgment in the product documentation would be\n//   appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n//   misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nexport default {\n    2:      \"need dictionary\",     /* Z_NEED_DICT       2  */\n    1:      \"stream end\",          /* Z_STREAM_END      1  */\n    0:      \"\",                    /* Z_OK              0  */\n    \"-1\":   \"file error\",          /* Z_ERRNO         (-1) */\n    \"-2\":   \"stream error\",        /* Z_STREAM_ERROR  (-2) */\n    \"-3\":   \"data error\",          /* Z_DATA_ERROR    (-3) */\n    \"-4\":   \"insufficient memory\", /* Z_MEM_ERROR     (-4) */\n    \"-5\":   \"buffer error\",        /* Z_BUF_ERROR     (-5) */\n    \"-6\":   \"incompatible version\" /* Z_VERSION_ERROR (-6) */\n};\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n//   claim that you wrote the original software. If you use this software\n//   in a product, an acknowledgment in the product documentation would be\n//   appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n//   misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nimport * as utils from \"../utils/common.js\";\nimport * as trees from \"./trees.js\";\nimport adler32 from \"./adler32.js\";\nimport crc32 from \"./crc32.js\";\nimport msg from \"./messages.js\";\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\n\nimport {\n  Z_NO_FLUSH,\n  Z_PARTIAL_FLUSH,\n  Z_FULL_FLUSH,\n  Z_FINISH,\n  Z_BLOCK,\n  Z_OK,\n  Z_STREAM_END,\n  Z_STREAM_ERROR,\n  Z_DATA_ERROR,\n  Z_BUF_ERROR,\n  Z_DEFAULT_COMPRESSION,\n  Z_FILTERED,\n  Z_HUFFMAN_ONLY,\n  Z_RLE,\n  Z_FIXED,\n  Z_DEFAULT_STRATEGY,\n  Z_UNKNOWN,\n  Z_DEFLATED\n} from \"./constants.js\";\n\n/*============================================================================*/\n\n\nconst MAX_MEM_LEVEL = 9;\n/* Maximum value for memLevel in deflateInit2 */\nconst MAX_WBITS = 15;\n/* 32K LZ77 window */\nconst DEF_MEM_LEVEL = 8;\n\n\nconst LENGTH_CODES = 29;\n/* number of length codes, not counting the special END_BLOCK code */\nconst LITERALS = 256;\n/* number of literal bytes 0..255 */\nconst L_CODES = LITERALS + 1 + LENGTH_CODES;\n/* number of Literal or Length codes, including the END_BLOCK code */\nconst D_CODES = 30;\n/* number of distance codes */\nconst BL_CODES = 19;\n/* number of codes used to transfer the bit lengths */\nconst HEAP_SIZE = 2 * L_CODES + 1;\n/* maximum heap size */\nconst MAX_BITS = 15;\n/* All codes must not exceed MAX_BITS bits */\n\nconst MIN_MATCH = 3;\nconst MAX_MATCH = 258;\nconst MIN_LOOKAHEAD = (MAX_MATCH + MIN_MATCH + 1);\n\nconst PRESET_DICT = 0x20;\n\nconst INIT_STATE = 42;\nconst EXTRA_STATE = 69;\nconst NAME_STATE = 73;\nconst COMMENT_STATE = 91;\nconst HCRC_STATE = 103;\nconst BUSY_STATE = 113;\nconst FINISH_STATE = 666;\n\nconst BS_NEED_MORE = 1; /* block not completed, need more input or more output */\nconst BS_BLOCK_DONE = 2; /* block flush performed */\nconst BS_FINISH_STARTED = 3; /* finish started, need only more output at next deflate */\nconst BS_FINISH_DONE = 4; /* finish done, accept no more input or output */\n\nconst OS_CODE = 0x03; // Unix :) . Don't detect, use this default.\n\nfunction err(strm, errorCode) {\n  strm.msg = msg[errorCode];\n  return errorCode;\n}\n\nfunction rank(f) {\n  return ((f) << 1) - ((f) > 4 ? 9 : 0);\n}\n\nfunction zero(buf) { let len = buf.length; while (--len >= 0) { buf[len] = 0; } }\n\n\n/* =========================================================================\n * Flush as much pending output as possible. All deflate() output goes\n * through this function so some applications may wish to modify it\n * to avoid allocating a large strm->output buffer and copying into it.\n * (See also read_buf()).\n */\nfunction flush_pending(strm) {\n  const s = strm.state;\n\n  //_tr_flush_bits(s);\n  let len = s.pending;\n  if (len > strm.avail_out) {\n    len = strm.avail_out;\n  }\n  if (len === 0) { return; }\n\n  utils.arraySet(strm.output, s.pending_buf, s.pending_out, len, strm.next_out);\n  strm.next_out += len;\n  s.pending_out += len;\n  strm.total_out += len;\n  strm.avail_out -= len;\n  s.pending -= len;\n  if (s.pending === 0) {\n    s.pending_out = 0;\n  }\n}\n\n\nfunction flush_block_only(s, last) {\n  trees._tr_flush_block(s, (s.block_start >= 0 ? s.block_start : -1), s.strstart - s.block_start, last);\n  s.block_start = s.strstart;\n  flush_pending(s.strm);\n}\n\n\nfunction put_byte(s, b) {\n  s.pending_buf[s.pending++] = b;\n}\n\n\n/* =========================================================================\n * Put a short in the pending buffer. The 16-bit value is put in MSB order.\n * IN assertion: the stream state is correct and there is enough room in\n * pending_buf.\n */\nfunction putShortMSB(s, b) {\n  //  put_byte(s, (Byte)(b >> 8));\n  //  put_byte(s, (Byte)(b & 0xff));\n  s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n  s.pending_buf[s.pending++] = b & 0xff;\n}\n\n\n/* ===========================================================================\n * Read a new buffer from the current input stream, update the adler32\n * and total number of bytes read.  All deflate() input goes through\n * this function so some applications may wish to modify it to avoid\n * allocating a large strm->input buffer and copying from it.\n * (See also flush_pending()).\n */\nfunction read_buf(strm, buf, start, size) {\n  let len = strm.avail_in;\n\n  if (len > size) { len = size; }\n  if (len === 0) { return 0; }\n\n  strm.avail_in -= len;\n\n  // zmemcpy(buf, strm->next_in, len);\n  utils.arraySet(buf, strm.input, strm.next_in, len, start);\n  if (strm.state.wrap === 1) {\n    strm.adler = adler32(strm.adler, buf, len, start);\n  }\n\n  else if (strm.state.wrap === 2) {\n    strm.adler = crc32(strm.adler, buf, len, start);\n  }\n\n  strm.next_in += len;\n  strm.total_in += len;\n\n  return len;\n}\n\n\n/* ===========================================================================\n * Set match_start to the longest match starting at the given string and\n * return its length. Matches shorter or equal to prev_length are discarded,\n * in which case the result is equal to prev_length and match_start is\n * garbage.\n * IN assertions: cur_match is the head of the hash chain for the current\n *   string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1\n * OUT assertion: the match length is not greater than s->lookahead.\n */\nfunction longest_match(s, cur_match) {\n  let chain_length = s.max_chain_length;      /* max hash chain length */\n  let scan = s.strstart; /* current string */\n  let match;                       /* matched string */\n  let len;                           /* length of current match */\n  let best_len = s.prev_length;              /* best match length so far */\n  let nice_match = s.nice_match;             /* stop if match long enough */\n  const limit = (s.strstart > (s.w_size - MIN_LOOKAHEAD)) ?\n    s.strstart - (s.w_size - MIN_LOOKAHEAD) : 0/*NIL*/;\n\n  const _win = s.window; // shortcut\n\n  const wmask = s.w_mask;\n  const prev = s.prev;\n\n  /* Stop when cur_match becomes <= limit. To simplify the code,\n   * we prevent matches with the string of window index 0.\n   */\n\n  const strend = s.strstart + MAX_MATCH;\n  let scan_end1 = _win[scan + best_len - 1];\n  let scan_end = _win[scan + best_len];\n\n  /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.\n   * It is easy to get rid of this optimization if necessary.\n   */\n  // Assert(s->hash_bits >= 8 && MAX_MATCH == 258, \"Code too clever\");\n\n  /* Do not waste too much time if we already have a good match: */\n  if (s.prev_length >= s.good_match) {\n    chain_length >>= 2;\n  }\n  /* Do not look for matches beyond the end of the input. This is necessary\n   * to make deflate deterministic.\n   */\n  if (nice_match > s.lookahead) { nice_match = s.lookahead; }\n\n  // Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, \"need lookahead\");\n\n  do {\n    // Assert(cur_match < s->strstart, \"no future\");\n    match = cur_match;\n\n    /* Skip to next match if the match length cannot increase\n     * or if the match length is less than 2.  Note that the checks below\n     * for insufficient lookahead only occur occasionally for performance\n     * reasons.  Therefore uninitialized memory will be accessed, and\n     * conditional jumps will be made that depend on those values.\n     * However the length of the match is limited to the lookahead, so\n     * the output of deflate is not affected by the uninitialized values.\n     */\n\n    if (_win[match + best_len] !== scan_end ||\n      _win[match + best_len - 1] !== scan_end1 ||\n      _win[match] !== _win[scan] ||\n      _win[++match] !== _win[scan + 1]) {\n      continue;\n    }\n\n    /* The check at best_len-1 can be removed because it will be made\n     * again later. (This heuristic is not always a win.)\n     * It is not necessary to compare scan[2] and match[2] since they\n     * are always equal when the other bytes match, given that\n     * the hash keys are equal and that HASH_BITS >= 8.\n     */\n    scan += 2;\n    match++;\n    // Assert(*scan == *match, \"match[2]?\");\n\n    /* We check for insufficient lookahead only every 8th comparison;\n     * the 256th check will be made at strstart+258.\n     */\n    do {\n      /*jshint noempty:false*/\n    } while (_win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n    _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n    _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n    _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n      scan < strend);\n\n    // Assert(scan <= s->window+(unsigned)(s->window_size-1), \"wild scan\");\n\n    len = MAX_MATCH - (strend - scan);\n    scan = strend - MAX_MATCH;\n\n    if (len > best_len) {\n      s.match_start = cur_match;\n      best_len = len;\n      if (len >= nice_match) {\n        break;\n      }\n      scan_end1 = _win[scan + best_len - 1];\n      scan_end = _win[scan + best_len];\n    }\n  } while ((cur_match = prev[cur_match & wmask]) > limit && --chain_length !== 0);\n\n  if (best_len <= s.lookahead) {\n    return best_len;\n  }\n  return s.lookahead;\n}\n\n\n/* ===========================================================================\n * Fill the window when the lookahead becomes insufficient.\n * Updates strstart and lookahead.\n *\n * IN assertion: lookahead < MIN_LOOKAHEAD\n * OUT assertions: strstart <= window_size-MIN_LOOKAHEAD\n *    At least one byte has been read, or avail_in == 0; reads are\n *    performed for at least two bytes (required for the zip translate_eol\n *    option -- not supported here).\n */\nfunction fill_window(s) {\n  const _w_size = s.w_size;\n  let p, n, m, more, str;\n\n  //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n  do {\n    more = s.window_size - s.lookahead - s.strstart;\n\n    // JS ints have 32 bit, block below not needed\n    /* Deal with !@#$% 64K limit: */\n    //if (sizeof(int) <= 2) {\n    //    if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n    //        more = wsize;\n    //\n    //  } else if (more == (unsigned)(-1)) {\n    //        /* Very unlikely, but possible on 16 bit machine if\n    //         * strstart == 0 && lookahead == 1 (input done a byte at time)\n    //         */\n    //        more--;\n    //    }\n    //}\n\n\n    /* If the window is almost full and there is insufficient lookahead,\n     * move the upper half to the lower one to make room in the upper half.\n     */\n    if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n\n      utils.arraySet(s.window, s.window, _w_size, _w_size, 0);\n      s.match_start -= _w_size;\n      s.strstart -= _w_size;\n      /* we now have strstart >= MAX_DIST */\n      s.block_start -= _w_size;\n\n      /* Slide the hash table (could be avoided with 32 bit values\n       at the expense of memory usage). We slide even when level == 0\n       to keep the hash table consistent if we switch back to level > 0\n       later. (Using level 0 permanently is not an optimal usage of\n       zlib, so we don't care about this pathological case.)\n       */\n\n      n = s.hash_size;\n      p = n;\n      do {\n        m = s.head[--p];\n        s.head[p] = (m >= _w_size ? m - _w_size : 0);\n      } while (--n);\n\n      n = _w_size;\n      p = n;\n      do {\n        m = s.prev[--p];\n        s.prev[p] = (m >= _w_size ? m - _w_size : 0);\n        /* If n is not on any hash chain, prev[n] is garbage but\n         * its value will never be used.\n         */\n      } while (--n);\n\n      more += _w_size;\n    }\n    if (s.strm.avail_in === 0) {\n      break;\n    }\n\n    /* If there was no sliding:\n     *    strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n     *    more == window_size - lookahead - strstart\n     * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n     * => more >= window_size - 2*WSIZE + 2\n     * In the BIG_MEM or MMAP case (not yet supported),\n     *   window_size == input_size + MIN_LOOKAHEAD  &&\n     *   strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n     * Otherwise, window_size == 2*WSIZE so more >= 2.\n     * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n     */\n    //Assert(more >= 2, \"more < 2\");\n    n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n    s.lookahead += n;\n\n    /* Initialize the hash value now that we have some input: */\n    if (s.lookahead + s.insert >= MIN_MATCH) {\n      str = s.strstart - s.insert;\n      s.ins_h = s.window[str];\n\n      /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n      s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;\n      //#if MIN_MATCH != 3\n      //        Call update_hash() MIN_MATCH-3 more times\n      //#endif\n      while (s.insert) {\n        /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n        s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n\n        s.prev[str & s.w_mask] = s.head[s.ins_h];\n        s.head[s.ins_h] = str;\n        str++;\n        s.insert--;\n        if (s.lookahead + s.insert < MIN_MATCH) {\n          break;\n        }\n      }\n    }\n    /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n     * but this is not important since only literal bytes will be emitted.\n     */\n\n  } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n\n  /* If the WIN_INIT bytes after the end of the current data have never been\n   * written, then zero those bytes in order to avoid memory check reports of\n   * the use of uninitialized (or uninitialised as Julian writes) bytes by\n   * the longest match routines.  Update the high water mark for the next\n   * time through here.  WIN_INIT is set to MAX_MATCH since the longest match\n   * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n   */\n  //  if (s.high_water < s.window_size) {\n  //    var curr = s.strstart + s.lookahead;\n  //    var init = 0;\n  //\n  //    if (s.high_water < curr) {\n  //      /* Previous high water mark below current data -- zero WIN_INIT\n  //       * bytes or up to end of window, whichever is less.\n  //       */\n  //      init = s.window_size - curr;\n  //      if (init > WIN_INIT)\n  //        init = WIN_INIT;\n  //      zmemzero(s->window + curr, (unsigned)init);\n  //      s->high_water = curr + init;\n  //    }\n  //    else if (s->high_water < (ulg)curr + WIN_INIT) {\n  //      /* High water mark at or above current data, but below current data\n  //       * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n  //       * to end of window, whichever is less.\n  //       */\n  //      init = (ulg)curr + WIN_INIT - s->high_water;\n  //      if (init > s->window_size - s->high_water)\n  //        init = s->window_size - s->high_water;\n  //      zmemzero(s->window + s->high_water, (unsigned)init);\n  //      s->high_water += init;\n  //    }\n  //  }\n  //\n  //  Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n  //    \"not enough room for search\");\n}\n\n/* ===========================================================================\n * Copy without compression as much as possible from the input stream, return\n * the current block state.\n * This function does not insert new strings in the dictionary since\n * uncompressible data is probably not useful. This function is used\n * only for the level=0 compression option.\n * NOTE: this function should be optimized to avoid extra copying from\n * window to pending_buf.\n */\nfunction deflate_stored(s, flush) {\n  /* Stored blocks are limited to 0xffff bytes, pending_buf is limited\n   * to pending_buf_size, and each stored block has a 5 byte header:\n   */\n  let max_block_size = 0xffff;\n\n  if (max_block_size > s.pending_buf_size - 5) {\n    max_block_size = s.pending_buf_size - 5;\n  }\n\n  /* Copy as much as possible from input to output: */\n  for (; ;) {\n    /* Fill the window as much as possible: */\n    if (s.lookahead <= 1) {\n\n      //Assert(s->strstart < s->w_size+MAX_DIST(s) ||\n      //  s->block_start >= (long)s->w_size, \"slide too late\");\n      //      if (!(s.strstart < s.w_size + (s.w_size - MIN_LOOKAHEAD) ||\n      //        s.block_start >= s.w_size)) {\n      //        throw  new Error(\"slide too late\");\n      //      }\n\n      fill_window(s);\n      if (s.lookahead === 0 && flush === Z_NO_FLUSH) {\n        return BS_NEED_MORE;\n      }\n\n      if (s.lookahead === 0) {\n        break;\n      }\n      /* flush the current block */\n    }\n    //Assert(s->block_start >= 0L, \"block gone\");\n    //    if (s.block_start < 0) throw new Error(\"block gone\");\n\n    s.strstart += s.lookahead;\n    s.lookahead = 0;\n\n    /* Emit a stored block if pending_buf will be full: */\n    const max_start = s.block_start + max_block_size;\n\n    if (s.strstart === 0 || s.strstart >= max_start) {\n      /* strstart == 0 is possible when wraparound on 16-bit machine */\n      s.lookahead = s.strstart - max_start;\n      s.strstart = max_start;\n      /*** FLUSH_BLOCK(s, 0); ***/\n      flush_block_only(s, false);\n      if (s.strm.avail_out === 0) {\n        return BS_NEED_MORE;\n      }\n      /***/\n\n\n    }\n    /* Flush if we may have to slide, otherwise block_start may become\n     * negative and the data will be gone:\n     */\n    if (s.strstart - s.block_start >= (s.w_size - MIN_LOOKAHEAD)) {\n      /*** FLUSH_BLOCK(s, 0); ***/\n      flush_block_only(s, false);\n      if (s.strm.avail_out === 0) {\n        return BS_NEED_MORE;\n      }\n      /***/\n    }\n  }\n\n  s.insert = 0;\n\n  if (flush === Z_FINISH) {\n    /*** FLUSH_BLOCK(s, 1); ***/\n    flush_block_only(s, true);\n    if (s.strm.avail_out === 0) {\n      return BS_FINISH_STARTED;\n    }\n    /***/\n    return BS_FINISH_DONE;\n  }\n\n  if (s.strstart > s.block_start) {\n    /*** FLUSH_BLOCK(s, 0); ***/\n    flush_block_only(s, false);\n    if (s.strm.avail_out === 0) {\n      return BS_NEED_MORE;\n    }\n    /***/\n  }\n\n  return BS_NEED_MORE;\n}\n\n/* ===========================================================================\n * Compress as much as possible from the input stream, return the current\n * block state.\n * This function does not perform lazy evaluation of matches and inserts\n * new strings in the dictionary only for unmatched strings or for short\n * matches. It is used only for the fast compression options.\n */\nfunction deflate_fast(s, flush) {\n  let hash_head;        /* head of the hash chain */\n  let bflush;           /* set if current block must be flushed */\n\n  for (; ;) {\n    /* Make sure that we always have enough lookahead, except\n     * at the end of the input file. We need MAX_MATCH bytes\n     * for the next match, plus MIN_MATCH bytes to insert the\n     * string following the next match.\n     */\n    if (s.lookahead < MIN_LOOKAHEAD) {\n      fill_window(s);\n      if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n        return BS_NEED_MORE;\n      }\n      if (s.lookahead === 0) {\n        break; /* flush the current block */\n      }\n    }\n\n    /* Insert the string window[strstart .. strstart+2] in the\n     * dictionary, and set hash_head to the head of the hash chain:\n     */\n    hash_head = 0/*NIL*/;\n    if (s.lookahead >= MIN_MATCH) {\n      /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n      s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n      hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n      s.head[s.ins_h] = s.strstart;\n      /***/\n    }\n\n    /* Find the longest match, discarding those <= prev_length.\n     * At this point we have always match_length < MIN_MATCH\n     */\n    if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n      /* To simplify the code, we prevent matches with the string\n       * of window index 0 (in particular we have to avoid a match\n       * of the string with itself at the start of the input file).\n       */\n      s.match_length = longest_match(s, hash_head);\n      /* longest_match() sets match_start */\n    }\n    if (s.match_length >= MIN_MATCH) {\n      // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n      /*** _tr_tally_dist(s, s.strstart - s.match_start,\n                     s.match_length - MIN_MATCH, bflush); ***/\n      bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n      s.lookahead -= s.match_length;\n\n      /* Insert new strings in the hash table only if the match length\n       * is not too large. This saves time but degrades compression.\n       */\n      if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n        s.match_length--; /* string at strstart already in table */\n        do {\n          s.strstart++;\n          /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n          s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n          hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n          s.head[s.ins_h] = s.strstart;\n          /***/\n          /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n           * always MIN_MATCH bytes ahead.\n           */\n        } while (--s.match_length !== 0);\n        s.strstart++;\n      } else {\n        s.strstart += s.match_length;\n        s.match_length = 0;\n        s.ins_h = s.window[s.strstart];\n        /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n        s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n        //#if MIN_MATCH != 3\n        //                Call UPDATE_HASH() MIN_MATCH-3 more times\n        //#endif\n        /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n         * matter since it will be recomputed at next deflate call.\n         */\n      }\n    } else {\n      /* No match, output a literal byte */\n      //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n      /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n      bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n      s.lookahead--;\n      s.strstart++;\n    }\n    if (bflush) {\n      /*** FLUSH_BLOCK(s, 0); ***/\n      flush_block_only(s, false);\n      if (s.strm.avail_out === 0) {\n        return BS_NEED_MORE;\n      }\n      /***/\n    }\n  }\n  s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1);\n  if (flush === Z_FINISH) {\n    /*** FLUSH_BLOCK(s, 1); ***/\n    flush_block_only(s, true);\n    if (s.strm.avail_out === 0) {\n      return BS_FINISH_STARTED;\n    }\n    /***/\n    return BS_FINISH_DONE;\n  }\n  if (s.last_lit) {\n    /*** FLUSH_BLOCK(s, 0); ***/\n    flush_block_only(s, false);\n    if (s.strm.avail_out === 0) {\n      return BS_NEED_MORE;\n    }\n    /***/\n  }\n  return BS_BLOCK_DONE;\n}\n\n/* ===========================================================================\n * Same as above, but achieves better compression. We use a lazy\n * evaluation for matches: a match is finally adopted only if there is\n * no better match at the next window position.\n */\nfunction deflate_slow(s, flush) {\n  let hash_head;          /* head of hash chain */\n  let bflush;              /* set if current block must be flushed */\n\n  let max_insert;\n\n  /* Process the input block. */\n  for (; ;) {\n    /* Make sure that we always have enough lookahead, except\n     * at the end of the input file. We need MAX_MATCH bytes\n     * for the next match, plus MIN_MATCH bytes to insert the\n     * string following the next match.\n     */\n    if (s.lookahead < MIN_LOOKAHEAD) {\n      fill_window(s);\n      if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n        return BS_NEED_MORE;\n      }\n      if (s.lookahead === 0) { break; } /* flush the current block */\n    }\n\n    /* Insert the string window[strstart .. strstart+2] in the\n     * dictionary, and set hash_head to the head of the hash chain:\n     */\n    hash_head = 0/*NIL*/;\n    if (s.lookahead >= MIN_MATCH) {\n      /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n      s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n      hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n      s.head[s.ins_h] = s.strstart;\n      /***/\n    }\n\n    /* Find the longest match, discarding those <= prev_length.\n     */\n    s.prev_length = s.match_length;\n    s.prev_match = s.match_start;\n    s.match_length = MIN_MATCH - 1;\n\n    if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n      s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n      /* To simplify the code, we prevent matches with the string\n       * of window index 0 (in particular we have to avoid a match\n       * of the string with itself at the start of the input file).\n       */\n      s.match_length = longest_match(s, hash_head);\n      /* longest_match() sets match_start */\n\n      if (s.match_length <= 5 &&\n        (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n        /* If prev_match is also MIN_MATCH, match_start is garbage\n         * but we will ignore the current match anyway.\n         */\n        s.match_length = MIN_MATCH - 1;\n      }\n    }\n    /* If there was a match at the previous step and the current\n     * match is not better, output the previous match:\n     */\n    if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n      max_insert = s.strstart + s.lookahead - MIN_MATCH;\n      /* Do not insert strings in hash table beyond this. */\n\n      //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n      /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n                     s.prev_length - MIN_MATCH, bflush);***/\n      bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n      /* Insert in hash table all strings up to the end of the match.\n       * strstart-1 and strstart are already inserted. If there is not\n       * enough lookahead, the last two strings are not inserted in\n       * the hash table.\n       */\n      s.lookahead -= s.prev_length - 1;\n      s.prev_length -= 2;\n      do {\n        if (++s.strstart <= max_insert) {\n          /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n          s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n          hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n          s.head[s.ins_h] = s.strstart;\n          /***/\n        }\n      } while (--s.prev_length !== 0);\n      s.match_available = 0;\n      s.match_length = MIN_MATCH - 1;\n      s.strstart++;\n\n      if (bflush) {\n        /*** FLUSH_BLOCK(s, 0); ***/\n        flush_block_only(s, false);\n        if (s.strm.avail_out === 0) {\n          return BS_NEED_MORE;\n        }\n        /***/\n      }\n\n    } else if (s.match_available) {\n      /* If there was no match at the previous position, output a\n       * single literal. If there was a match but the current match\n       * is longer, truncate the previous match to a single literal.\n       */\n      //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n      /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n      bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n      if (bflush) {\n        /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n        flush_block_only(s, false);\n        /***/\n      }\n      s.strstart++;\n      s.lookahead--;\n      if (s.strm.avail_out === 0) {\n        return BS_NEED_MORE;\n      }\n    } else {\n      /* There is no previous match to compare with, wait for\n       * the next step to decide.\n       */\n      s.match_available = 1;\n      s.strstart++;\n      s.lookahead--;\n    }\n  }\n  //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n  if (s.match_available) {\n    //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n    /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n    bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n    s.match_available = 0;\n  }\n  s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n  if (flush === Z_FINISH) {\n    /*** FLUSH_BLOCK(s, 1); ***/\n    flush_block_only(s, true);\n    if (s.strm.avail_out === 0) {\n      return BS_FINISH_STARTED;\n    }\n    /***/\n    return BS_FINISH_DONE;\n  }\n  if (s.last_lit) {\n    /*** FLUSH_BLOCK(s, 0); ***/\n    flush_block_only(s, false);\n    if (s.strm.avail_out === 0) {\n      return BS_NEED_MORE;\n    }\n    /***/\n  }\n\n  return BS_BLOCK_DONE;\n}\n\n\n/* ===========================================================================\n * For Z_RLE, simply look for runs of bytes, generate matches only of distance\n * one.  Do not maintain a hash table.  (It will be regenerated if this run of\n * deflate switches away from Z_RLE.)\n */\nfunction deflate_rle(s, flush) {\n  let bflush;            /* set if current block must be flushed */\n  let prev;              /* byte at distance one to match */\n  let scan, strend;      /* scan goes up to strend for length of run */\n\n  const _win = s.window;\n\n  for (; ;) {\n    /* Make sure that we always have enough lookahead, except\n     * at the end of the input file. We need MAX_MATCH bytes\n     * for the longest run, plus one for the unrolled loop.\n     */\n    if (s.lookahead <= MAX_MATCH) {\n      fill_window(s);\n      if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n        return BS_NEED_MORE;\n      }\n      if (s.lookahead === 0) { break; } /* flush the current block */\n    }\n\n    /* See how many times the previous byte repeats */\n    s.match_length = 0;\n    if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n      scan = s.strstart - 1;\n      prev = _win[scan];\n      if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n        strend = s.strstart + MAX_MATCH;\n        do {\n          /*jshint noempty:false*/\n        } while (prev === _win[++scan] && prev === _win[++scan] &&\n        prev === _win[++scan] && prev === _win[++scan] &&\n        prev === _win[++scan] && prev === _win[++scan] &&\n        prev === _win[++scan] && prev === _win[++scan] &&\n          scan < strend);\n        s.match_length = MAX_MATCH - (strend - scan);\n        if (s.match_length > s.lookahead) {\n          s.match_length = s.lookahead;\n        }\n      }\n      //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n    }\n\n    /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n    if (s.match_length >= MIN_MATCH) {\n      //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n      /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n      bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n      s.lookahead -= s.match_length;\n      s.strstart += s.match_length;\n      s.match_length = 0;\n    } else {\n      /* No match, output a literal byte */\n      //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n      /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n      bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n      s.lookahead--;\n      s.strstart++;\n    }\n    if (bflush) {\n      /*** FLUSH_BLOCK(s, 0); ***/\n      flush_block_only(s, false);\n      if (s.strm.avail_out === 0) {\n        return BS_NEED_MORE;\n      }\n      /***/\n    }\n  }\n  s.insert = 0;\n  if (flush === Z_FINISH) {\n    /*** FLUSH_BLOCK(s, 1); ***/\n    flush_block_only(s, true);\n    if (s.strm.avail_out === 0) {\n      return BS_FINISH_STARTED;\n    }\n    /***/\n    return BS_FINISH_DONE;\n  }\n  if (s.last_lit) {\n    /*** FLUSH_BLOCK(s, 0); ***/\n    flush_block_only(s, false);\n    if (s.strm.avail_out === 0) {\n      return BS_NEED_MORE;\n    }\n    /***/\n  }\n  return BS_BLOCK_DONE;\n}\n\n/* ===========================================================================\n * For Z_HUFFMAN_ONLY, do not look for matches.  Do not maintain a hash table.\n * (It will be regenerated if this run of deflate switches away from Huffman.)\n */\nfunction deflate_huff(s, flush) {\n  let bflush;             /* set if current block must be flushed */\n\n  for (; ;) {\n    /* Make sure that we have a literal to write. */\n    if (s.lookahead === 0) {\n      fill_window(s);\n      if (s.lookahead === 0) {\n        if (flush === Z_NO_FLUSH) {\n          return BS_NEED_MORE;\n        }\n        break;      /* flush the current block */\n      }\n    }\n\n    /* Output a literal byte */\n    s.match_length = 0;\n    //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n    /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n    bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n    s.lookahead--;\n    s.strstart++;\n    if (bflush) {\n      /*** FLUSH_BLOCK(s, 0); ***/\n      flush_block_only(s, false);\n      if (s.strm.avail_out === 0) {\n        return BS_NEED_MORE;\n      }\n      /***/\n    }\n  }\n  s.insert = 0;\n  if (flush === Z_FINISH) {\n    /*** FLUSH_BLOCK(s, 1); ***/\n    flush_block_only(s, true);\n    if (s.strm.avail_out === 0) {\n      return BS_FINISH_STARTED;\n    }\n    /***/\n    return BS_FINISH_DONE;\n  }\n  if (s.last_lit) {\n    /*** FLUSH_BLOCK(s, 0); ***/\n    flush_block_only(s, false);\n    if (s.strm.avail_out === 0) {\n      return BS_NEED_MORE;\n    }\n    /***/\n  }\n  return BS_BLOCK_DONE;\n}\n\n/* Values for max_lazy_match, good_match and max_chain_length, depending on\n * the desired pack level (0..9). The values given below have been tuned to\n * exclude worst case performance for pathological files. Better values may be\n * found for specific files.\n */\nclass Config {\n  constructor(good_length, max_lazy, nice_length, max_chain, func) {\n    this.good_length = good_length;\n    this.max_lazy = max_lazy;\n    this.nice_length = nice_length;\n    this.max_chain = max_chain;\n    this.func = func;\n  }\n};\n\nconst configuration_table = [\n  /*      good lazy nice chain */\n  new Config(0, 0, 0, 0, deflate_stored),          /* 0 store only */\n  new Config(4, 4, 8, 4, deflate_fast),            /* 1 max speed, no lazy matches */\n  new Config(4, 5, 16, 8, deflate_fast),           /* 2 */\n  new Config(4, 6, 32, 32, deflate_fast),          /* 3 */\n\n  new Config(4, 4, 16, 16, deflate_slow),          /* 4 lazy matches */\n  new Config(8, 16, 32, 32, deflate_slow),         /* 5 */\n  new Config(8, 16, 128, 128, deflate_slow),       /* 6 */\n  new Config(8, 32, 128, 256, deflate_slow),       /* 7 */\n  new Config(32, 128, 258, 1024, deflate_slow),    /* 8 */\n  new Config(32, 258, 258, 4096, deflate_slow)     /* 9 max compression */\n];\n\n\n/* ===========================================================================\n * Initialize the \"longest match\" routines for a new zlib stream\n */\nfunction lm_init(s) {\n  s.window_size = 2 * s.w_size;\n\n  /*** CLEAR_HASH(s); ***/\n  zero(s.head); // Fill with NIL (= 0);\n\n  /* Set the default configuration parameters:\n   */\n  s.max_lazy_match = configuration_table[s.level].max_lazy;\n  s.good_match = configuration_table[s.level].good_length;\n  s.nice_match = configuration_table[s.level].nice_length;\n  s.max_chain_length = configuration_table[s.level].max_chain;\n\n  s.strstart = 0;\n  s.block_start = 0;\n  s.lookahead = 0;\n  s.insert = 0;\n  s.match_length = s.prev_length = MIN_MATCH - 1;\n  s.match_available = 0;\n  s.ins_h = 0;\n}\n\nclass DeflateState {\n  constructor() {\n    this.strm = null;            /* pointer back to this zlib stream */\n    this.status = 0;            /* as the name implies */\n    this.pending_buf = null;      /* output still pending */\n    this.pending_buf_size = 0;  /* size of pending_buf */\n    this.pending_out = 0;       /* next pending byte to output to the stream */\n    this.pending = 0;           /* nb of bytes in the pending buffer */\n    this.wrap = 0;              /* bit 0 true for zlib, bit 1 true for gzip */\n    this.gzhead = null;         /* gzip header information to write */\n    this.gzindex = 0;           /* where in extra, name, or comment */\n    this.method = Z_DEFLATED; /* can only be DEFLATED */\n    this.last_flush = -1;   /* value of flush param for previous deflate call */\n\n    this.w_size = 0;  /* LZ77 window size (32K by default) */\n    this.w_bits = 0;  /* log2(w_size)  (8..16) */\n    this.w_mask = 0;  /* w_size - 1 */\n\n    this.window = null;\n    /* Sliding window. Input bytes are read into the second half of the window,\n     * and move to the first half later to keep a dictionary of at least wSize\n     * bytes. With this organization, matches are limited to a distance of\n     * wSize-MAX_MATCH bytes, but this ensures that IO is always\n     * performed with a length multiple of the block size.\n     */\n\n    this.window_size = 0;\n    /* Actual size of window: 2*wSize, except when the user input buffer\n     * is directly used as sliding window.\n     */\n\n    this.prev = null;\n    /* Link to older string with same hash index. To limit the size of this\n     * array to 64K, this link is maintained only for the last 32K strings.\n     * An index in this array is thus a window index modulo 32K.\n     */\n\n    this.head = null;   /* Heads of the hash chains or NIL. */\n\n    this.ins_h = 0;       /* hash index of string to be inserted */\n    this.hash_size = 0;   /* number of elements in hash table */\n    this.hash_bits = 0;   /* log2(hash_size) */\n    this.hash_mask = 0;   /* hash_size-1 */\n\n    this.hash_shift = 0;\n    /* Number of bits by which ins_h must be shifted at each input\n     * step. It must be such that after MIN_MATCH steps, the oldest\n     * byte no longer takes part in the hash key, that is:\n     *   hash_shift * MIN_MATCH >= hash_bits\n     */\n\n    this.block_start = 0;\n    /* Window position at the beginning of the current output block. Gets\n     * negative when the window is moved backwards.\n     */\n\n    this.match_length = 0;      /* length of best match */\n    this.prev_match = 0;        /* previous match */\n    this.match_available = 0;   /* set if previous match exists */\n    this.strstart = 0;          /* start of string to insert */\n    this.match_start = 0;       /* start of matching string */\n    this.lookahead = 0;         /* number of valid bytes ahead in window */\n\n    this.prev_length = 0;\n    /* Length of the best match at previous step. Matches not greater than this\n     * are discarded. This is used in the lazy match evaluation.\n     */\n\n    this.max_chain_length = 0;\n    /* To speed up deflation, hash chains are never searched beyond this\n     * length.  A higher limit improves compression ratio but degrades the\n     * speed.\n     */\n\n    this.max_lazy_match = 0;\n    /* Attempt to find a better match only when the current match is strictly\n     * smaller than this value. This mechanism is used only for compression\n     * levels >= 4.\n     */\n    // That's alias to max_lazy_match, don't use directly\n    //this.max_insert_length = 0;\n    /* Insert new strings in the hash table only if the match length is not\n     * greater than this length. This saves time but degrades compression.\n     * max_insert_length is used only for compression levels <= 3.\n     */\n\n    this.level = 0;     /* compression level (1..9) */\n    this.strategy = 0;  /* favor or force Huffman coding*/\n\n    this.good_match = 0;\n    /* Use a faster search when the previous match is longer than this */\n\n    this.nice_match = 0; /* Stop searching when current match exceeds this */\n\n                /* used by trees.c: */\n\n    /* Didn't use ct_data typedef below to suppress compiler warning */\n\n    // struct ct_data_s dyn_ltree[HEAP_SIZE];   /* literal and length tree */\n    // struct ct_data_s dyn_dtree[2*D_CODES+1]; /* distance tree */\n    // struct ct_data_s bl_tree[2*BL_CODES+1];  /* Huffman tree for bit lengths */\n\n    // Use flat array of DOUBLE size, with interleaved fata,\n    // because JS does not support effective\n    this.dyn_ltree  = new utils.Buf16(HEAP_SIZE * 2);\n    this.dyn_dtree  = new utils.Buf16((2 * D_CODES + 1) * 2);\n    this.bl_tree    = new utils.Buf16((2 * BL_CODES + 1) * 2);\n    zero(this.dyn_ltree);\n    zero(this.dyn_dtree);\n    zero(this.bl_tree);\n\n    this.l_desc   = null;         /* desc. for literal tree */\n    this.d_desc   = null;         /* desc. for distance tree */\n    this.bl_desc  = null;         /* desc. for bit length tree */\n\n    //ush bl_count[MAX_BITS+1];\n    this.bl_count = new utils.Buf16(MAX_BITS + 1);\n    /* number of codes at each bit length for an optimal tree */\n\n    //int heap[2*L_CODES+1];      /* heap used to build the Huffman trees */\n    this.heap = new utils.Buf16(2 * L_CODES + 1);  /* heap used to build the Huffman trees */\n    zero(this.heap);\n\n    this.heap_len = 0;               /* number of elements in the heap */\n    this.heap_max = 0;               /* element of largest frequency */\n    /* The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used.\n     * The same heap array is used to build all trees.\n     */\n\n    this.depth = new utils.Buf16(2 * L_CODES + 1); //uch depth[2*L_CODES+1];\n    zero(this.depth);\n    /* Depth of each subtree used as tie breaker for trees of equal frequency\n     */\n\n    this.l_buf = 0;          /* buffer index for literals or lengths */\n\n    this.lit_bufsize = 0;\n    /* Size of match buffer for literals/lengths.  There are 4 reasons for\n     * limiting lit_bufsize to 64K:\n     *   - frequencies can be kept in 16 bit counters\n     *   - if compression is not successful for the first block, all input\n     *     data is still in the window so we can still emit a stored block even\n     *     when input comes from standard input.  (This can also be done for\n     *     all blocks if lit_bufsize is not greater than 32K.)\n     *   - if compression is not successful for a file smaller than 64K, we can\n     *     even emit a stored file instead of a stored block (saving 5 bytes).\n     *     This is applicable only for zip (not gzip or zlib).\n     *   - creating new Huffman trees less frequently may not provide fast\n     *     adaptation to changes in the input data statistics. (Take for\n     *     example a binary file with poorly compressible code followed by\n     *     a highly compressible string table.) Smaller buffer sizes give\n     *     fast adaptation but have of course the overhead of transmitting\n     *     trees more frequently.\n     *   - I can't count above 4\n     */\n\n    this.last_lit = 0;      /* running index in l_buf */\n\n    this.d_buf = 0;\n    /* Buffer index for distances. To simplify the code, d_buf and l_buf have\n     * the same number of elements. To use different lengths, an extra flag\n     * array would be necessary.\n     */\n\n    this.opt_len = 0;       /* bit length of current block with optimal trees */\n    this.static_len = 0;    /* bit length of current block with static trees */\n    this.matches = 0;       /* number of string matches in current block */\n    this.insert = 0;        /* bytes at end of window left to insert */\n\n\n    this.bi_buf = 0;\n    /* Output buffer. bits are inserted starting at the bottom (least\n     * significant bits).\n     */\n    this.bi_valid = 0;\n    /* Number of valid bits in bi_buf.  All bits above the last valid bit\n     * are always zero.\n     */\n\n    // Used for window memory init. We safely ignore it for JS. That makes\n    // sense only for pointers and memory check tools.\n    //this.high_water = 0;\n    /* High water mark offset in window for initialized bytes -- bytes above\n     * this are set to zero in order to avoid memory check warnings when\n     * longest match routines access bytes past the input.  This is then\n     * updated to the new high water mark.\n     */\n  }\n}\n\nfunction deflateResetKeep(strm) {\n  let s;\n\n  if (!strm || !strm.state) {\n    return err(strm, Z_STREAM_ERROR);\n  }\n\n  strm.total_in = strm.total_out = 0;\n  strm.data_type = Z_UNKNOWN;\n\n  s = strm.state;\n  s.pending = 0;\n  s.pending_out = 0;\n\n  if (s.wrap < 0) {\n    s.wrap = -s.wrap;\n    /* was made negative by deflate(..., Z_FINISH); */\n  }\n  s.status = (s.wrap ? INIT_STATE : BUSY_STATE);\n  strm.adler = (s.wrap === 2) ?\n    0  // crc32(0, Z_NULL, 0)\n    :\n    1; // adler32(0, Z_NULL, 0)\n  s.last_flush = Z_NO_FLUSH;\n  trees._tr_init(s);\n  return Z_OK;\n}\n\n\nfunction deflateReset(strm) {\n  const ret = deflateResetKeep(strm);\n  if (ret === Z_OK) {\n    lm_init(strm.state);\n  }\n  return ret;\n}\n\n\nfunction deflateSetHeader(strm, head) {\n  if (!strm || !strm.state) { return Z_STREAM_ERROR; }\n  if (strm.state.wrap !== 2) { return Z_STREAM_ERROR; }\n  strm.state.gzhead = head;\n  return Z_OK;\n}\n\n\nfunction deflateInit2(strm, level, method, windowBits, memLevel, strategy) {\n  if (!strm) { // === Z_NULL\n    return Z_STREAM_ERROR;\n  }\n  let wrap = 1;\n\n  if (level === Z_DEFAULT_COMPRESSION) {\n    level = 6;\n  }\n\n  if (windowBits < 0) { /* suppress zlib wrapper */\n    wrap = 0;\n    windowBits = -windowBits;\n  }\n\n  else if (windowBits > 15) {\n    wrap = 2;           /* write gzip wrapper instead */\n    windowBits -= 16;\n  }\n\n\n  if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method !== Z_DEFLATED ||\n    windowBits < 8 || windowBits > 15 || level < 0 || level > 9 ||\n    strategy < 0 || strategy > Z_FIXED) {\n    return err(strm, Z_STREAM_ERROR);\n  }\n\n\n  if (windowBits === 8) {\n    windowBits = 9;\n  }\n  /* until 256-byte window bug fixed */\n\n  const s = new DeflateState();\n\n  strm.state = s;\n  s.strm = strm;\n\n  s.wrap = wrap;\n  s.gzhead = null;\n  s.w_bits = windowBits;\n  s.w_size = 1 << s.w_bits;\n  s.w_mask = s.w_size - 1;\n\n  s.hash_bits = memLevel + 7;\n  s.hash_size = 1 << s.hash_bits;\n  s.hash_mask = s.hash_size - 1;\n  s.hash_shift = ~~((s.hash_bits + MIN_MATCH - 1) / MIN_MATCH);\n  s.window = new utils.Buf8(s.w_size * 2);\n  s.head = new utils.Buf16(s.hash_size);\n  s.prev = new utils.Buf16(s.w_size);\n\n  // Don't need mem init magic for JS.\n  //s.high_water = 0;  /* nothing written to s->window yet */\n\n  s.lit_bufsize = 1 << (memLevel + 6); /* 16K elements by default */\n\n  s.pending_buf_size = s.lit_bufsize * 4;\n\n  //overlay = (ushf *) ZALLOC(strm, s->lit_bufsize, sizeof(ush)+2);\n  //s->pending_buf = (uchf *) overlay;\n  s.pending_buf = new utils.Buf8(s.pending_buf_size);\n\n  // It is offset from `s.pending_buf` (size is `s.lit_bufsize * 2`)\n  //s->d_buf = overlay + s->lit_bufsize/sizeof(ush);\n  s.d_buf = 1 * s.lit_bufsize;\n\n  //s->l_buf = s->pending_buf + (1+sizeof(ush))*s->lit_bufsize;\n  s.l_buf = (1 + 2) * s.lit_bufsize;\n\n  s.level = level;\n  s.strategy = strategy;\n  s.method = method;\n\n  return deflateReset(strm);\n}\n\nfunction deflateInit(strm, level) {\n  return deflateInit2(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY);\n}\n\n\nfunction deflate(strm, flush) {\n  let old_flush, s;\n  let beg, val; // for gzip header write only\n\n  if (!strm || !strm.state ||\n    flush > Z_BLOCK || flush < 0) {\n    return strm ? err(strm, Z_STREAM_ERROR) : Z_STREAM_ERROR;\n  }\n\n  s = strm.state;\n\n  if (!strm.output ||\n    (!strm.input && strm.avail_in !== 0) ||\n    (s.status === FINISH_STATE && flush !== Z_FINISH)) {\n    return err(strm, (strm.avail_out === 0) ? Z_BUF_ERROR : Z_STREAM_ERROR);\n  }\n\n  s.strm = strm; /* just in case */\n  old_flush = s.last_flush;\n  s.last_flush = flush;\n\n  /* Write the header */\n  if (s.status === INIT_STATE) {\n\n    if (s.wrap === 2) { // GZIP header\n      strm.adler = 0;  //crc32(0L, Z_NULL, 0);\n      put_byte(s, 31);\n      put_byte(s, 139);\n      put_byte(s, 8);\n      if (!s.gzhead) { // s->gzhead == Z_NULL\n        put_byte(s, 0);\n        put_byte(s, 0);\n        put_byte(s, 0);\n        put_byte(s, 0);\n        put_byte(s, 0);\n        put_byte(s, s.level === 9 ? 2 :\n          (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ?\n            4 : 0));\n        put_byte(s, OS_CODE);\n        s.status = BUSY_STATE;\n      }\n      else {\n        put_byte(s, (s.gzhead.text ? 1 : 0) +\n          (s.gzhead.hcrc ? 2 : 0) +\n          (!s.gzhead.extra ? 0 : 4) +\n          (!s.gzhead.name ? 0 : 8) +\n          (!s.gzhead.comment ? 0 : 16)\n        );\n        put_byte(s, s.gzhead.time & 0xff);\n        put_byte(s, (s.gzhead.time >> 8) & 0xff);\n        put_byte(s, (s.gzhead.time >> 16) & 0xff);\n        put_byte(s, (s.gzhead.time >> 24) & 0xff);\n        put_byte(s, s.level === 9 ? 2 :\n          (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ?\n            4 : 0));\n        put_byte(s, s.gzhead.os & 0xff);\n        if (s.gzhead.extra && s.gzhead.extra.length) {\n          put_byte(s, s.gzhead.extra.length & 0xff);\n          put_byte(s, (s.gzhead.extra.length >> 8) & 0xff);\n        }\n        if (s.gzhead.hcrc) {\n          strm.adler = crc32(strm.adler, s.pending_buf, s.pending, 0);\n        }\n        s.gzindex = 0;\n        s.status = EXTRA_STATE;\n      }\n    }\n    else // DEFLATE header\n    {\n      let header = (Z_DEFLATED + ((s.w_bits - 8) << 4)) << 8;\n      let level_flags = -1;\n\n      if (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2) {\n        level_flags = 0;\n      } else if (s.level < 6) {\n        level_flags = 1;\n      } else if (s.level === 6) {\n        level_flags = 2;\n      } else {\n        level_flags = 3;\n      }\n      header |= (level_flags << 6);\n      if (s.strstart !== 0) { header |= PRESET_DICT; }\n      header += 31 - (header % 31);\n\n      s.status = BUSY_STATE;\n      putShortMSB(s, header);\n\n      /* Save the adler32 of the preset dictionary: */\n      if (s.strstart !== 0) {\n        putShortMSB(s, strm.adler >>> 16);\n        putShortMSB(s, strm.adler & 0xffff);\n      }\n      strm.adler = 1; // adler32(0L, Z_NULL, 0);\n    }\n  }\n\n  //#ifdef GZIP\n  if (s.status === EXTRA_STATE) {\n    if (s.gzhead.extra/* != Z_NULL*/) {\n      beg = s.pending;  /* start of bytes to update crc */\n\n      while (s.gzindex < (s.gzhead.extra.length & 0xffff)) {\n        if (s.pending === s.pending_buf_size) {\n          if (s.gzhead.hcrc && s.pending > beg) {\n            strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n          }\n          flush_pending(strm);\n          beg = s.pending;\n          if (s.pending === s.pending_buf_size) {\n            break;\n          }\n        }\n        put_byte(s, s.gzhead.extra[s.gzindex] & 0xff);\n        s.gzindex++;\n      }\n      if (s.gzhead.hcrc && s.pending > beg) {\n        strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n      }\n      if (s.gzindex === s.gzhead.extra.length) {\n        s.gzindex = 0;\n        s.status = NAME_STATE;\n      }\n    }\n    else {\n      s.status = NAME_STATE;\n    }\n  }\n  if (s.status === NAME_STATE) {\n    if (s.gzhead.name/* != Z_NULL*/) {\n      beg = s.pending;  /* start of bytes to update crc */\n      //int val;\n\n      do {\n        if (s.pending === s.pending_buf_size) {\n          if (s.gzhead.hcrc && s.pending > beg) {\n            strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n          }\n          flush_pending(strm);\n          beg = s.pending;\n          if (s.pending === s.pending_buf_size) {\n            val = 1;\n            break;\n          }\n        }\n        // JS specific: little magic to add zero terminator to end of string\n        if (s.gzindex < s.gzhead.name.length) {\n          val = s.gzhead.name.charCodeAt(s.gzindex++) & 0xff;\n        } else {\n          val = 0;\n        }\n        put_byte(s, val);\n      } while (val !== 0);\n\n      if (s.gzhead.hcrc && s.pending > beg) {\n        strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n      }\n      if (val === 0) {\n        s.gzindex = 0;\n        s.status = COMMENT_STATE;\n      }\n    }\n    else {\n      s.status = COMMENT_STATE;\n    }\n  }\n  if (s.status === COMMENT_STATE) {\n    if (s.gzhead.comment/* != Z_NULL*/) {\n      beg = s.pending;  /* start of bytes to update crc */\n      //int val;\n\n      do {\n        if (s.pending === s.pending_buf_size) {\n          if (s.gzhead.hcrc && s.pending > beg) {\n            strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n          }\n          flush_pending(strm);\n          beg = s.pending;\n          if (s.pending === s.pending_buf_size) {\n            val = 1;\n            break;\n          }\n        }\n        // JS specific: little magic to add zero terminator to end of string\n        if (s.gzindex < s.gzhead.comment.length) {\n          val = s.gzhead.comment.charCodeAt(s.gzindex++) & 0xff;\n        } else {\n          val = 0;\n        }\n        put_byte(s, val);\n      } while (val !== 0);\n\n      if (s.gzhead.hcrc && s.pending > beg) {\n        strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n      }\n      if (val === 0) {\n        s.status = HCRC_STATE;\n      }\n    }\n    else {\n      s.status = HCRC_STATE;\n    }\n  }\n  if (s.status === HCRC_STATE) {\n    if (s.gzhead.hcrc) {\n      if (s.pending + 2 > s.pending_buf_size) {\n        flush_pending(strm);\n      }\n      if (s.pending + 2 <= s.pending_buf_size) {\n        put_byte(s, strm.adler & 0xff);\n        put_byte(s, (strm.adler >> 8) & 0xff);\n        strm.adler = 0; //crc32(0L, Z_NULL, 0);\n        s.status = BUSY_STATE;\n      }\n    }\n    else {\n      s.status = BUSY_STATE;\n    }\n  }\n  //#endif\n\n  /* Flush as much pending output as possible */\n  if (s.pending !== 0) {\n    flush_pending(strm);\n    if (strm.avail_out === 0) {\n      /* Since avail_out is 0, deflate will be called again with\n       * more output space, but possibly with both pending and\n       * avail_in equal to zero. There won't be anything to do,\n       * but this is not an error situation so make sure we\n       * return OK instead of BUF_ERROR at next call of deflate:\n       */\n      s.last_flush = -1;\n      return Z_OK;\n    }\n\n    /* Make sure there is something to do and avoid duplicate consecutive\n     * flushes. For repeated and useless calls with Z_FINISH, we keep\n     * returning Z_STREAM_END instead of Z_BUF_ERROR.\n     */\n  } else if (strm.avail_in === 0 && rank(flush) <= rank(old_flush) &&\n    flush !== Z_FINISH) {\n    return err(strm, Z_BUF_ERROR);\n  }\n\n  /* User must not provide more input after the first FINISH: */\n  if (s.status === FINISH_STATE && strm.avail_in !== 0) {\n    return err(strm, Z_BUF_ERROR);\n  }\n\n  /* Start a new block or continue the current one.\n   */\n  if (strm.avail_in !== 0 || s.lookahead !== 0 ||\n    (flush !== Z_NO_FLUSH && s.status !== FINISH_STATE)) {\n    var bstate = (s.strategy === Z_HUFFMAN_ONLY) ? deflate_huff(s, flush) :\n      (s.strategy === Z_RLE ? deflate_rle(s, flush) :\n        configuration_table[s.level].func(s, flush));\n\n    if (bstate === BS_FINISH_STARTED || bstate === BS_FINISH_DONE) {\n      s.status = FINISH_STATE;\n    }\n    if (bstate === BS_NEED_MORE || bstate === BS_FINISH_STARTED) {\n      if (strm.avail_out === 0) {\n        s.last_flush = -1;\n        /* avoid BUF_ERROR next call, see above */\n      }\n      return Z_OK;\n      /* If flush != Z_NO_FLUSH && avail_out == 0, the next call\n       * of deflate should use the same flush parameter to make sure\n       * that the flush is complete. So we don't have to output an\n       * empty block here, this will be done at next call. This also\n       * ensures that for a very small output buffer, we emit at most\n       * one empty block.\n       */\n    }\n    if (bstate === BS_BLOCK_DONE) {\n      if (flush === Z_PARTIAL_FLUSH) {\n        trees._tr_align(s);\n      }\n      else if (flush !== Z_BLOCK) { /* FULL_FLUSH or SYNC_FLUSH */\n\n        trees._tr_stored_block(s, 0, 0, false);\n        /* For a full flush, this empty block will be recognized\n         * as a special marker by inflate_sync().\n         */\n        if (flush === Z_FULL_FLUSH) {\n          /*** CLEAR_HASH(s); ***/             /* forget history */\n          zero(s.head); // Fill with NIL (= 0);\n\n          if (s.lookahead === 0) {\n            s.strstart = 0;\n            s.block_start = 0;\n            s.insert = 0;\n          }\n        }\n      }\n      flush_pending(strm);\n      if (strm.avail_out === 0) {\n        s.last_flush = -1; /* avoid BUF_ERROR at next call, see above */\n        return Z_OK;\n      }\n    }\n  }\n  //Assert(strm->avail_out > 0, \"bug2\");\n  //if (strm.avail_out <= 0) { throw new Error(\"bug2\");}\n\n  if (flush !== Z_FINISH) { return Z_OK; }\n  if (s.wrap <= 0) { return Z_STREAM_END; }\n\n  /* Write the trailer */\n  if (s.wrap === 2) {\n    put_byte(s, strm.adler & 0xff);\n    put_byte(s, (strm.adler >> 8) & 0xff);\n    put_byte(s, (strm.adler >> 16) & 0xff);\n    put_byte(s, (strm.adler >> 24) & 0xff);\n    put_byte(s, strm.total_in & 0xff);\n    put_byte(s, (strm.total_in >> 8) & 0xff);\n    put_byte(s, (strm.total_in >> 16) & 0xff);\n    put_byte(s, (strm.total_in >> 24) & 0xff);\n  }\n  else {\n    putShortMSB(s, strm.adler >>> 16);\n    putShortMSB(s, strm.adler & 0xffff);\n  }\n\n  flush_pending(strm);\n  /* If avail_out is zero, the application will call deflate again\n   * to flush the rest.\n   */\n  if (s.wrap > 0) { s.wrap = -s.wrap; }\n  /* write the trailer only once! */\n  return s.pending !== 0 ? Z_OK : Z_STREAM_END;\n}\n\nfunction deflateEnd(strm) {\n  let status;\n\n  if (!strm/*== Z_NULL*/ || !strm.state/*== Z_NULL*/) {\n    return Z_STREAM_ERROR;\n  }\n\n  status = strm.state.status;\n  if (status !== INIT_STATE &&\n    status !== EXTRA_STATE &&\n    status !== NAME_STATE &&\n    status !== COMMENT_STATE &&\n    status !== HCRC_STATE &&\n    status !== BUSY_STATE &&\n    status !== FINISH_STATE\n  ) {\n    return err(strm, Z_STREAM_ERROR);\n  }\n\n  strm.state = null;\n\n  return status === BUSY_STATE ? err(strm, Z_DATA_ERROR) : Z_OK;\n}\n\n\n/* =========================================================================\n * Initializes the compression dictionary from the given byte\n * sequence without producing any compressed output.\n */\nfunction deflateSetDictionary(strm, dictionary) {\n  let dictLength = dictionary.length;\n\n  let s;\n  let str, n;\n  let wrap;\n  let avail;\n  let next;\n  let input;\n  let tmpDict;\n\n  if (!strm/*== Z_NULL*/ || !strm.state/*== Z_NULL*/) {\n    return Z_STREAM_ERROR;\n  }\n\n  s = strm.state;\n  wrap = s.wrap;\n\n  if (wrap === 2 || (wrap === 1 && s.status !== INIT_STATE) || s.lookahead) {\n    return Z_STREAM_ERROR;\n  }\n\n  /* when using zlib wrappers, compute Adler-32 for provided dictionary */\n  if (wrap === 1) {\n    /* adler32(strm->adler, dictionary, dictLength); */\n    strm.adler = adler32(strm.adler, dictionary, dictLength, 0);\n  }\n\n  s.wrap = 0;   /* avoid computing Adler-32 in read_buf */\n\n  /* if dictionary would fill window, just replace the history */\n  if (dictLength >= s.w_size) {\n    if (wrap === 0) {            /* already empty otherwise */\n      /*** CLEAR_HASH(s); ***/\n      zero(s.head); // Fill with NIL (= 0);\n      s.strstart = 0;\n      s.block_start = 0;\n      s.insert = 0;\n    }\n    /* use the tail */\n    // dictionary = dictionary.slice(dictLength - s.w_size);\n    tmpDict = new utils.Buf8(s.w_size);\n    utils.arraySet(tmpDict, dictionary, dictLength - s.w_size, s.w_size, 0);\n    dictionary = tmpDict;\n    dictLength = s.w_size;\n  }\n  /* insert dictionary into window and hash */\n  avail = strm.avail_in;\n  next = strm.next_in;\n  input = strm.input;\n  strm.avail_in = dictLength;\n  strm.next_in = 0;\n  strm.input = dictionary;\n  fill_window(s);\n  while (s.lookahead >= MIN_MATCH) {\n    str = s.strstart;\n    n = s.lookahead - (MIN_MATCH - 1);\n    do {\n      /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n      s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n\n      s.prev[str & s.w_mask] = s.head[s.ins_h];\n\n      s.head[s.ins_h] = str;\n      str++;\n    } while (--n);\n    s.strstart = str;\n    s.lookahead = MIN_MATCH - 1;\n    fill_window(s);\n  }\n  s.strstart += s.lookahead;\n  s.block_start = s.strstart;\n  s.insert = s.lookahead;\n  s.lookahead = 0;\n  s.match_length = s.prev_length = MIN_MATCH - 1;\n  s.match_available = 0;\n  strm.next_in = next;\n  strm.input = input;\n  strm.avail_in = avail;\n  s.wrap = wrap;\n  return Z_OK;\n}\n\nconst deflateInfo = 'pako deflate (from Nodeca project)';\nexport {\n  deflateInit,\n  deflateInit2,\n  deflateReset,\n  deflateResetKeep,\n  deflateSetHeader,\n  deflate,\n  deflateEnd,\n  deflateSetDictionary,\n  deflateInfo\n};\n\n/* Not implemented\nexports.deflateBound = deflateBound;\nexports.deflateCopy = deflateCopy;\nexports.deflateParams = deflateParams;\nexports.deflatePending = deflatePending;\nexports.deflatePrime = deflatePrime;\nexports.deflateTune = deflateTune;\n*/\n","// String encode/decode helpers\n\n\n\nimport * as utils from \"./common.js\";\n\n\n// Quick check if we can use fast array to bin string conversion\n//\n// - apply(Array) can fail on Android 2.2\n// - apply(Uint8Array) can fail on iOS 5.1 Safari\n//\nlet STR_APPLY_OK = true;\nlet STR_APPLY_UIA_OK = true;\n\ntry {\n    String.fromCharCode.apply(null, [ 0 ]); \n} catch (__) {\n    STR_APPLY_OK = false; \n}\ntry {\n    String.fromCharCode.apply(null, new Uint8Array(1)); \n} catch (__) {\n    STR_APPLY_UIA_OK = false; \n}\n\n\n// Table with utf8 lengths (calculated by first byte of sequence)\n// Note, that 5 & 6-byte values and some 4-byte values can not be represented in JS,\n// because max possible codepoint is 0x10ffff\nconst _utf8len = new utils.Buf8(256);\nfor (let q = 0; q < 256; q++) {\n    _utf8len[q] = q >= 252 ? 6 : q >= 248 ? 5 : q >= 240 ? 4 : q >= 224 ? 3 : q >= 192 ? 2 : 1;\n}\n_utf8len[254] = _utf8len[254] = 1; // Invalid sequence start\n\n\n// convert string to array (typed, when possible)\nexport function string2buf (str) {\n    let c, c2, m_pos, i, buf_len = 0;\n    const str_len = str.length;\n\n    // count binary size\n    for (m_pos = 0; m_pos < str_len; m_pos++) {\n        c = str.charCodeAt(m_pos);\n        if ((c & 0xfc00) === 0xd800 && m_pos + 1 < str_len) {\n            c2 = str.charCodeAt(m_pos + 1);\n            if ((c2 & 0xfc00) === 0xdc00) {\n                c = 0x10000 + (c - 0xd800 << 10) + (c2 - 0xdc00);\n                m_pos++;\n            }\n        }\n        buf_len += c < 0x80 ? 1 : c < 0x800 ? 2 : c < 0x10000 ? 3 : 4;\n    }\n\n    // allocate buffer\n    const buf = new utils.Buf8(buf_len);\n\n    // convert\n    for (i = 0, m_pos = 0; i < buf_len; m_pos++) {\n        c = str.charCodeAt(m_pos);\n        if ((c & 0xfc00) === 0xd800 && m_pos + 1 < str_len) {\n            c2 = str.charCodeAt(m_pos + 1);\n            if ((c2 & 0xfc00) === 0xdc00) {\n                c = 0x10000 + (c - 0xd800 << 10) + (c2 - 0xdc00);\n                m_pos++;\n            }\n        }\n        if (c < 0x80) {\n            /* one byte */\n            buf[i++] = c;\n        } else if (c < 0x800) {\n            /* two bytes */\n            buf[i++] = 0xC0 | c >>> 6;\n            buf[i++] = 0x80 | c & 0x3f;\n        } else if (c < 0x10000) {\n            /* three bytes */\n            buf[i++] = 0xE0 | c >>> 12;\n            buf[i++] = 0x80 | c >>> 6 & 0x3f;\n            buf[i++] = 0x80 | c & 0x3f;\n        } else {\n            /* four bytes */\n            buf[i++] = 0xf0 | c >>> 18;\n            buf[i++] = 0x80 | c >>> 12 & 0x3f;\n            buf[i++] = 0x80 | c >>> 6 & 0x3f;\n            buf[i++] = 0x80 | c & 0x3f;\n        }\n    }\n\n    return buf;\n}\n\n// Helper (used in 2 places)\nfunction _buf2binstring(buf, len) {\n    // On Chrome, the arguments in a function call that are allowed is `65534`.\n    // If the length of the buffer is smaller than that, we can use this optimization,\n    // otherwise we will take a slower path.\n    if (len < 65534) {\n        if (buf.subarray && STR_APPLY_UIA_OK || !buf.subarray && STR_APPLY_OK) {\n            return String.fromCharCode.apply(null, utils.shrinkBuf(buf, len));\n        }\n    }\n\n    let result = \"\";\n    for (let i = 0; i < len; i++) {\n        result += String.fromCharCode(buf[i]);\n    }\n    return result;\n}\n\n\n// Convert byte array to binary string\nexport function buf2binstring (buf) {\n    return _buf2binstring(buf, buf.length);\n}\n\n\n// Convert binary string (typed, when possible)\nexport function binstring2buf (str) {\n    const buf = new utils.Buf8(str.length);\n    for (let i = 0, len = buf.length; i < len; i++) {\n        buf[i] = str.charCodeAt(i);\n    }\n    return buf;\n}\n\n\n// convert array to string\nexport function buf2string (buf, max) {\n    let i, out, c, c_len;\n    const len = max || buf.length;\n\n    // Reserve max possible length (2 words per char)\n    // NB: by unknown reasons, Array is significantly faster for\n    //     String.fromCharCode.apply than Uint16Array.\n    // var utf16buf = new Array(len * 2);\n    // try Uint16Array\n    const utf16buf = new Uint16Array(len * 2);\n\n    for (out = 0, i = 0; i < len;) {\n        c = buf[i++];\n        // quick process ascii\n        if (c < 0x80) {\n            utf16buf[out++] = c; continue; \n        }\n\n        c_len = _utf8len[c];\n        // skip 5 & 6 byte codes\n        if (c_len > 4) {\n            utf16buf[out++] = 0xfffd; i += c_len - 1; continue; \n        }\n\n        // apply mask on first byte\n        c &= c_len === 2 ? 0x1f : c_len === 3 ? 0x0f : 0x07;\n        // join the rest\n        while (c_len > 1 && i < len) {\n            c = c << 6 | buf[i++] & 0x3f;\n            c_len--;\n        }\n\n        // terminated by end of string?\n        if (c_len > 1) {\n            utf16buf[out++] = 0xfffd; continue; \n        }\n\n        if (c < 0x10000) {\n            utf16buf[out++] = c;\n        } else {\n            c -= 0x10000;\n            utf16buf[out++] = 0xd800 | c >> 10 & 0x3ff;\n            utf16buf[out++] = 0xdc00 | c & 0x3ff;\n        }\n    }\n\n    return _buf2binstring(utf16buf, out);\n}\n\n\n// Calculate max possible position in utf8 buffer,\n// that will not break sequence. If that's not possible\n// - (very small limits) return max size as is.\n//\n// buf[] - utf8 bytes array\n// max   - length limit (mandatory);\nexport function utf8border (buf, max) {\n    let pos;\n\n    max = max || buf.length;\n    if (max > buf.length) {\n        max = buf.length; \n    }\n\n    // go back from last position, until start of sequence found\n    pos = max - 1;\n    while (pos >= 0 && (buf[pos] & 0xC0) === 0x80) {\n        pos--; \n    }\n\n    // Very small and broken sequence,\n    // return max, because we should return something anyway.\n    if (pos < 0) {\n        return max; \n    }\n\n    // If we came to start of buffer - that means buffer is too small,\n    // return max too.\n    if (pos === 0) {\n        return max; \n    }\n\n    return pos + _utf8len[buf[pos]] > max ? pos : max;\n}\n","\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n//   claim that you wrote the original software. If you use this software\n//   in a product, an acknowledgment in the product documentation would be\n//   appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n//   misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nexport default class ZStream {\n  constructor() {\n    /* next input byte */\n    this.input = null; // JS specific, because we have no pointers\n    this.next_in = 0;\n    /* number of bytes available at input */\n    this.avail_in = 0;\n    /* total number of input bytes read so far */\n    this.total_in = 0;\n    /* next output byte should be put there */\n    this.output = null; // JS specific, because we have no pointers\n    this.next_out = 0;\n    /* remaining free space at output */\n    this.avail_out = 0;\n    /* total number of bytes output so far */\n    this.total_out = 0;\n    /* last error message, NULL if no error */\n    this.msg = ''/*Z_NULL*/;\n    /* not visible by applications */\n    this.state = null;\n    /* best guess about the data type: binary or text */\n    this.data_type = 2/*Z_UNKNOWN*/;\n    /* adler32 value of the uncompressed data */\n    this.adler = 0;\n  }\n}","'use strict';\n\nimport * as zlib_deflate from \"./zlib/deflate.js\";\nimport * as utils from \"./utils/common.js\";\nimport * as strings from \"./utils/strings.js\";\nimport msg from \"./zlib/messages.js\";\nimport ZStream from \"./zlib/zstream.js\";\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\nimport { Z_NO_FLUSH, Z_FINISH,\n  Z_OK, Z_STREAM_END, Z_SYNC_FLUSH,\n  Z_DEFAULT_COMPRESSION,\n  Z_DEFAULT_STRATEGY,\n  Z_DEFLATED } from \"./zlib/constants.js\"\n\n/* ===========================================================================*/\n\n\n/**\n * class Deflate\n *\n * Generic JS-style wrapper for zlib calls. If you don't need\n * streaming behaviour - use more simple functions: [[deflate]],\n * [[deflateRaw]] and [[gzip]].\n **/\n\n/* internal\n * Deflate.chunks -> Array\n *\n * Chunks of output data, if [[Deflate#onData]] not overridden.\n **/\n\n/**\n * Deflate.result -> Uint8Array|Array\n *\n * Compressed result, generated by default [[Deflate#onData]]\n * and [[Deflate#onEnd]] handlers. Filled after you push last chunk\n * (call [[Deflate#push]] with `Z_FINISH` / `true` param)  or if you\n * push a chunk with explicit flush (call [[Deflate#push]] with\n * `Z_SYNC_FLUSH` param).\n **/\n\n/**\n * Deflate.err -> Number\n *\n * Error code after deflate finished. 0 (Z_OK) on success.\n * You will not need it in real life, because deflate errors\n * are possible only on wrong options or bad `onData` / `onEnd`\n * custom handlers.\n **/\n\n/**\n * Deflate.msg -> String\n *\n * Error message, if [[Deflate.err]] != 0\n **/\n\n\n/**\n * new Deflate(options)\n * - options (Object): zlib deflate options.\n *\n * Creates new deflator instance with specified params. Throws exception\n * on bad params. Supported options:\n *\n * - `level`\n * - `windowBits`\n * - `memLevel`\n * - `strategy`\n * - `dictionary`\n *\n * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)\n * for more information on these.\n *\n * Additional options, for internal needs:\n *\n * - `chunkSize` - size of generated data chunks (16K by default)\n * - `raw` (Boolean) - do raw deflate\n * - `gzip` (Boolean) - create gzip wrapper\n * - `to` (String) - if equal to 'string', then result will be \"binary string\"\n *    (each char code [0..255])\n * - `header` (Object) - custom header for gzip\n *   - `text` (Boolean) - true if compressed data believed to be text\n *   - `time` (Number) - modification time, unix timestamp\n *   - `os` (Number) - operation system code\n *   - `extra` (Array) - array of bytes with extra data (max 65536)\n *   - `name` (String) - file name (binary string)\n *   - `comment` (String) - comment (binary string)\n *   - `hcrc` (Boolean) - true if header crc should be added\n *\n * ##### Example:\n *\n * ```javascript\n * var pako = require('pako')\n *   , chunk1 = Uint8Array([1,2,3,4,5,6,7,8,9])\n *   , chunk2 = Uint8Array([10,11,12,13,14,15,16,17,18,19]);\n *\n * var deflate = new pako.Deflate({ level: 3});\n *\n * deflate.push(chunk1, false);\n * deflate.push(chunk2, true);  // true -> last chunk\n *\n * if (deflate.err) { throw new Error(deflate.err); }\n *\n * console.log(deflate.result);\n * ```\n **/\n\nclass Deflate {\n  constructor(options) {\n    this.options = {\n      level: Z_DEFAULT_COMPRESSION,\n      method: Z_DEFLATED,\n      chunkSize: 16384,\n      windowBits: 15,\n      memLevel: 8,\n      strategy: Z_DEFAULT_STRATEGY,\n      ...(options || {})\n    };\n\n    const opt = this.options;\n\n    if (opt.raw && (opt.windowBits > 0)) {\n      opt.windowBits = -opt.windowBits;\n    }\n\n    else if (opt.gzip && (opt.windowBits > 0) && (opt.windowBits < 16)) {\n      opt.windowBits += 16;\n    }\n\n    this.err    = 0;      // error code, if happens (0 = Z_OK)\n    this.msg    = '';     // error message\n    this.ended  = false;  // used to avoid multiple onEnd() calls\n    this.chunks = [];     // chunks of compressed data\n\n    this.strm = new ZStream();\n    this.strm.avail_out = 0;\n\n    var status = zlib_deflate.deflateInit2(\n      this.strm,\n      opt.level,\n      opt.method,\n      opt.windowBits,\n      opt.memLevel,\n      opt.strategy\n    );\n\n    if (status !== Z_OK) {\n      throw new Error(msg[status]);\n    }\n\n    if (opt.header) {\n      zlib_deflate.deflateSetHeader(this.strm, opt.header);\n    }\n\n    if (opt.dictionary) {\n      let dict;\n      // Convert data if needed\n      if (typeof opt.dictionary === 'string') {\n        // If we need to compress text, change encoding to utf8.\n        dict = strings.string2buf(opt.dictionary);\n      } else if (opt.dictionary instanceof ArrayBuffer) {\n        dict = new Uint8Array(opt.dictionary);\n      } else {\n        dict = opt.dictionary;\n      }\n\n      status = zlib_deflate.deflateSetDictionary(this.strm, dict);\n\n      if (status !== Z_OK) {\n        throw new Error(msg[status]);\n      }\n\n      this._dict_set = true;\n    }\n  }\n\n  /**\n * Deflate#push(data[, mode]) -> Boolean\n * - data (Uint8Array|Array|ArrayBuffer|String): input data. Strings will be\n *   converted to utf8 byte sequence.\n * - mode (Number|Boolean): 0..6 for corresponding Z_NO_FLUSH..Z_TREE modes.\n *   See constants. Skipped or `false` means Z_NO_FLUSH, `true` means Z_FINISH.\n *\n * Sends input data to deflate pipe, generating [[Deflate#onData]] calls with\n * new compressed chunks. Returns `true` on success. The last data block must have\n * mode Z_FINISH (or `true`). That will flush internal pending buffers and call\n * [[Deflate#onEnd]]. For interim explicit flushes (without ending the stream) you\n * can use mode Z_SYNC_FLUSH, keeping the compression context.\n *\n * On fail call [[Deflate#onEnd]] with error code and return false.\n *\n * We strongly recommend to use `Uint8Array` on input for best speed (output\n * array format is detected automatically). Also, don't skip last param and always\n * use the same type in your code (boolean or number). That will improve JS speed.\n *\n * For regular `Array`-s make sure all elements are [0..255].\n *\n * ##### Example\n *\n * ```javascript\n * push(chunk, false); // push one of data chunks\n * ...\n * push(chunk, true);  // push last chunk\n * ```\n **/\n  push(data, mode) {\n    const { strm, options: { chunkSize } } = this;\n    var status, _mode;\n\n    if (this.ended) { return false; }\n\n    _mode = (mode === ~~mode) ? mode : ((mode === true) ? Z_FINISH : Z_NO_FLUSH);\n\n    // Convert data if needed\n    if (typeof data === 'string') {\n      // If we need to compress text, change encoding to utf8.\n      strm.input = strings.string2buf(data);\n    } else if (data instanceof ArrayBuffer) {\n      strm.input = new Uint8Array(data);\n    } else {\n      strm.input = data;\n    }\n\n    strm.next_in = 0;\n    strm.avail_in = strm.input.length;\n\n    do {\n      if (strm.avail_out === 0) {\n        strm.output = new utils.Buf8(chunkSize);\n        strm.next_out = 0;\n        strm.avail_out = chunkSize;\n      }\n      status = zlib_deflate.deflate(strm, _mode);    /* no bad return value */\n\n      if (status !== Z_STREAM_END && status !== Z_OK) {\n        this.onEnd(status);\n        this.ended = true;\n        return false;\n      }\n      if (strm.avail_out === 0 || (strm.avail_in === 0 && (_mode === Z_FINISH || _mode === Z_SYNC_FLUSH))) {\n        this.onData(utils.shrinkBuf(strm.output, strm.next_out));\n      }\n    } while ((strm.avail_in > 0 || strm.avail_out === 0) && status !== Z_STREAM_END);\n\n    // Finalize on the last chunk.\n    if (_mode === Z_FINISH) {\n      status = zlib_deflate.deflateEnd(this.strm);\n      this.onEnd(status);\n      this.ended = true;\n      return status === Z_OK;\n    }\n\n    // callback interim results if Z_SYNC_FLUSH.\n    if (_mode === Z_SYNC_FLUSH) {\n      this.onEnd(Z_OK);\n      strm.avail_out = 0;\n      return true;\n    }\n\n    return true;\n  };\n  /**\n   * Deflate#onData(chunk) -> Void\n   * - chunk (Uint8Array|Array|String): output data. Type of array depends\n   *   on js engine support. When string output requested, each chunk\n   *   will be string.\n   *\n   * By default, stores data blocks in `chunks[]` property and glue\n   * those in `onEnd`. Override this handler, if you need another behaviour.\n   **/\n  onData(chunk) {\n    this.chunks.push(chunk);\n  };\n\n  /**\n   * Deflate#onEnd(status) -> Void\n   * - status (Number): deflate status. 0 (Z_OK) on success,\n   *   other if not.\n   *\n   * Called once after you tell deflate that the input stream is\n   * complete (Z_FINISH) or should be flushed (Z_SYNC_FLUSH)\n   * or if an error happened. By default - join collected chunks,\n   * free memory and fill `results` / `err` properties.\n   **/\n  onEnd(status) {\n    // On success - join\n    if (status === Z_OK) {\n      this.result = utils.flattenChunks(this.chunks);\n    }\n    this.chunks = [];\n    this.err = status;\n    this.msg = this.strm.msg;\n  };\n}\n\n\n\n\n/**\n * deflate(data[, options]) -> Uint8Array|Array|String\n * - data (Uint8Array|Array|String): input data to compress.\n * - options (Object): zlib deflate options.\n *\n * Compress `data` with deflate algorithm and `options`.\n *\n * Supported options are:\n *\n * - level\n * - windowBits\n * - memLevel\n * - strategy\n * - dictionary\n *\n * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)\n * for more information on these.\n *\n * Sugar (options):\n *\n * - `raw` (Boolean) - say that we work with raw stream, if you don't wish to specify\n *   negative windowBits implicitly.\n * - `to` (String) - if equal to 'string', then result will be \"binary string\"\n *    (each char code [0..255])\n *\n * ##### Example:\n *\n * ```javascript\n * var pako = require('pako')\n *   , data = Uint8Array([1,2,3,4,5,6,7,8,9]);\n *\n * console.log(pako.deflate(data));\n * ```\n **/\nfunction deflate(input, options) {\n  const deflator = new Deflate(options);\n\n  deflator.push(input, true);\n\n  // That will never happens, if you don't cheat with options :)\n  if (deflator.err) { throw new Error(deflator.msg || msg[deflator.err]); }\n\n  return deflator.result;\n}\n\n\n/**\n * deflateRaw(data[, options]) -> Uint8Array|Array|String\n * - data (Uint8Array|Array|String): input data to compress.\n * - options (Object): zlib deflate options.\n *\n * The same as [[deflate]], but creates raw data, without wrapper\n * (header and adler32 crc).\n **/\nfunction deflateRaw(input, options) {\n  options = options || {};\n  options.raw = true;\n  return deflate(input, options);\n}\n\n\n/**\n * gzip(data[, options]) -> Uint8Array|Array|String\n * - data (Uint8Array|Array|String): input data to compress.\n * - options (Object): zlib deflate options.\n *\n * The same as [[deflate]], but create gzip wrapper instead of\n * deflate one.\n **/\nfunction gzip(input, options) {\n  options = options || {};\n  options.gzip = true;\n  return deflate(input, options);\n}\n\nexport { Deflate, deflate, deflateRaw, gzip };\n","\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n//   claim that you wrote the original software. If you use this software\n//   in a product, an acknowledgment in the product documentation would be\n//   appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n//   misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\n// See state defs from inflate.js\nconst BAD = 30;       /* got a data error -- remain here until reset */\nconst TYPE = 12;      /* i: waiting for type bits, including last-flag bit */\n\n/*\n   Decode literal, length, and distance codes and write out the resulting\n   literal and match bytes until either not enough input or output is\n   available, an end-of-block is encountered, or a data error is encountered.\n   When large enough input and output buffers are supplied to inflate(), for\n   example, a 16K input buffer and a 64K output buffer, more than 95% of the\n   inflate execution time is spent in this routine.\n\n   Entry assumptions:\n\n        state.mode === LEN\n        strm.avail_in >= 6\n        strm.avail_out >= 258\n        start >= strm.avail_out\n        state.bits < 8\n\n   On return, state.mode is one of:\n\n        LEN -- ran out of enough output space or enough available input\n        TYPE -- reached end of block code, inflate() to interpret next block\n        BAD -- error in block data\n\n   Notes:\n\n    - The maximum input bits used by a length/distance pair is 15 bits for the\n      length code, 5 bits for the length extra, 15 bits for the distance code,\n      and 13 bits for the distance extra.  This totals 48 bits, or six bytes.\n      Therefore if strm.avail_in >= 6, then there is enough input to avoid\n      checking for available input while decoding.\n\n    - The maximum bytes that a single length/distance pair can output is 258\n      bytes, which is the maximum length that can be coded.  inflate_fast()\n      requires strm.avail_out >= 258 for each loop to avoid checking for\n      output space.\n */\nexport default function inflate_fast(strm, start) {\n    let _in;                    /* local strm.input */\n    let _out;                   /* local strm.output */\n    // Use `s_window` instead `window`, avoid conflict with instrumentation tools\n    let hold;                   /* local strm.hold */\n    let bits;                   /* local strm.bits */\n    let here;                   /* retrieved table entry */\n    let op;                     /* code bits, operation, extra bits, or */\n    /*  window position, window bytes to copy */\n    let len;                    /* match length, unused bytes */\n    let dist;                   /* match distance */\n    let from;                   /* where to copy match from */\n    let from_source;\n\n\n\n    /* copy state to local variables */\n    const state = strm.state;\n    //here = state.here;\n    _in = strm.next_in;\n    const input = strm.input;\n    const last = _in + (strm.avail_in - 5);\n    _out = strm.next_out;\n    const output = strm.output;\n    const beg = _out - (start - strm.avail_out);\n    const end = _out + (strm.avail_out - 257);\n    //#ifdef INFLATE_STRICT\n    const dmax = state.dmax;\n    //#endif\n    const wsize = state.wsize;\n    const whave = state.whave;\n    const wnext = state.wnext;\n    const s_window = state.window;\n    hold = state.hold;\n    bits = state.bits;\n    const lcode = state.lencode;\n    const dcode = state.distcode;\n    const lmask = (1 << state.lenbits) - 1;\n    const dmask = (1 << state.distbits) - 1;\n\n\n    /* decode literals and length/distances until end-of-block or not enough\n     input data or output space */\n\n    top:\n    do {\n        if (bits < 15) {\n            hold += input[_in++] << bits;\n            bits += 8;\n            hold += input[_in++] << bits;\n            bits += 8;\n        }\n\n        here = lcode[hold & lmask];\n\n        dolen:\n        for (;;) { // Goto emulation\n            op = here >>> 24/*here.bits*/;\n            hold >>>= op;\n            bits -= op;\n            op = here >>> 16 & 0xff/*here.op*/;\n            if (op === 0) {                          /* literal */\n                //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?\n                //        \"inflate:         literal '%c'\\n\" :\n                //        \"inflate:         literal 0x%02x\\n\", here.val));\n                output[_out++] = here & 0xffff/*here.val*/;\n            } else if (op & 16) {                     /* length base */\n                len = here & 0xffff/*here.val*/;\n                op &= 15;                           /* number of extra bits */\n                if (op) {\n                    if (bits < op) {\n                        hold += input[_in++] << bits;\n                        bits += 8;\n                    }\n                    len += hold & (1 << op) - 1;\n                    hold >>>= op;\n                    bits -= op;\n                }\n                //Tracevv((stderr, \"inflate:         length %u\\n\", len));\n                if (bits < 15) {\n                    hold += input[_in++] << bits;\n                    bits += 8;\n                    hold += input[_in++] << bits;\n                    bits += 8;\n                }\n                here = dcode[hold & dmask];\n\n                dodist:\n                for (;;) { // goto emulation\n                    op = here >>> 24/*here.bits*/;\n                    hold >>>= op;\n                    bits -= op;\n                    op = here >>> 16 & 0xff/*here.op*/;\n\n                    if (op & 16) {                      /* distance base */\n                        dist = here & 0xffff/*here.val*/;\n                        op &= 15;                       /* number of extra bits */\n                        if (bits < op) {\n                            hold += input[_in++] << bits;\n                            bits += 8;\n                            if (bits < op) {\n                                hold += input[_in++] << bits;\n                                bits += 8;\n                            }\n                        }\n                        dist += hold & (1 << op) - 1;\n                        //#ifdef INFLATE_STRICT\n                        if (dist > dmax) {\n                            strm.msg = \"invalid distance too far back\";\n                            state.mode = BAD;\n                            break top;\n                        }\n                        //#endif\n                        hold >>>= op;\n                        bits -= op;\n                        //Tracevv((stderr, \"inflate:         distance %u\\n\", dist));\n                        op = _out - beg;                /* max distance in output */\n                        if (dist > op) {                /* see if copy from window */\n                            op = dist - op;               /* distance back in window */\n                            if (op > whave) {\n                                if (state.sane) {\n                                    strm.msg = \"invalid distance too far back\";\n                                    state.mode = BAD;\n                                    break top;\n                                }\n\n                                // (!) This block is disabled in zlib defaults,\n                                // don't enable it for binary compatibility\n                                //#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR\n                                //                if (len <= op - whave) {\n                                //                  do {\n                                //                    output[_out++] = 0;\n                                //                  } while (--len);\n                                //                  continue top;\n                                //                }\n                                //                len -= op - whave;\n                                //                do {\n                                //                  output[_out++] = 0;\n                                //                } while (--op > whave);\n                                //                if (op === 0) {\n                                //                  from = _out - dist;\n                                //                  do {\n                                //                    output[_out++] = output[from++];\n                                //                  } while (--len);\n                                //                  continue top;\n                                //                }\n                                //#endif\n                            }\n                            from = 0; // window index\n                            from_source = s_window;\n                            if (wnext === 0) {           /* very common case */\n                                from += wsize - op;\n                                if (op < len) {         /* some from window */\n                                    len -= op;\n                                    do {\n                                        output[_out++] = s_window[from++];\n                                    } while (--op);\n                                    from = _out - dist;  /* rest from output */\n                                    from_source = output;\n                                }\n                            } else if (wnext < op) {      /* wrap around window */\n                                from += wsize + wnext - op;\n                                op -= wnext;\n                                if (op < len) {         /* some from end of window */\n                                    len -= op;\n                                    do {\n                                        output[_out++] = s_window[from++];\n                                    } while (--op);\n                                    from = 0;\n                                    if (wnext < len) {  /* some from start of window */\n                                        op = wnext;\n                                        len -= op;\n                                        do {\n                                            output[_out++] = s_window[from++];\n                                        } while (--op);\n                                        from = _out - dist;      /* rest from output */\n                                        from_source = output;\n                                    }\n                                }\n                            } else {                      /* contiguous in window */\n                                from += wnext - op;\n                                if (op < len) {         /* some from window */\n                                    len -= op;\n                                    do {\n                                        output[_out++] = s_window[from++];\n                                    } while (--op);\n                                    from = _out - dist;  /* rest from output */\n                                    from_source = output;\n                                }\n                            }\n                            while (len > 2) {\n                                output[_out++] = from_source[from++];\n                                output[_out++] = from_source[from++];\n                                output[_out++] = from_source[from++];\n                                len -= 3;\n                            }\n                            if (len) {\n                                output[_out++] = from_source[from++];\n                                if (len > 1) {\n                                    output[_out++] = from_source[from++];\n                                }\n                            }\n                        } else {\n                            from = _out - dist;          /* copy direct from output */\n                            do {                        /* minimum length is three */\n                                output[_out++] = output[from++];\n                                output[_out++] = output[from++];\n                                output[_out++] = output[from++];\n                                len -= 3;\n                            } while (len > 2);\n                            if (len) {\n                                output[_out++] = output[from++];\n                                if (len > 1) {\n                                    output[_out++] = output[from++];\n                                }\n                            }\n                        }\n                    } else if ((op & 64) === 0) {          /* 2nd level distance code */\n                        here = dcode[(here & 0xffff)/*here.val*/ + (hold & (1 << op) - 1)];\n                        continue dodist;\n                    } else {\n                        strm.msg = \"invalid distance code\";\n                        state.mode = BAD;\n                        break top;\n                    }\n\n                    break; // need to emulate goto via \"continue\"\n                }\n            } else if ((op & 64) === 0) {              /* 2nd level length code */\n                here = lcode[(here & 0xffff)/*here.val*/ + (hold & (1 << op) - 1)];\n                continue dolen;\n            } else if (op & 32) {                     /* end-of-block */\n                //Tracevv((stderr, \"inflate:         end of block\\n\"));\n                state.mode = TYPE;\n                break top;\n            } else {\n                strm.msg = \"invalid literal/length code\";\n                state.mode = BAD;\n                break top;\n            }\n\n            break; // need to emulate goto via \"continue\"\n        }\n    } while (_in < last && _out < end);\n\n    /* return unused bytes (on entry, bits < 8, so in won't go too far back) */\n    len = bits >> 3;\n    _in -= len;\n    bits -= len << 3;\n    hold &= (1 << bits) - 1;\n\n    /* update state and return */\n    strm.next_in = _in;\n    strm.next_out = _out;\n    strm.avail_in = _in < last ? 5 + (last - _in) : 5 - (_in - last);\n    strm.avail_out = _out < end ? 257 + (end - _out) : 257 - (_out - end);\n    state.hold = hold;\n    state.bits = bits;\n    return;\n}\n","\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n//   claim that you wrote the original software. If you use this software\n//   in a product, an acknowledgment in the product documentation would be\n//   appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n//   misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nimport * as utils from \"../utils/common.js\";\n\nconst MAXBITS = 15;\nconst ENOUGH_LENS = 852;\nconst ENOUGH_DISTS = 592;\n//var ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS);\n\nconst CODES = 0;\nconst LENS = 1;\nconst DISTS = 2;\n\nconst lbase = [ /* Length codes 257..285 base */\n    3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,\n    35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0\n];\n\nconst lext = [ /* Length codes 257..285 extra */\n    16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18,\n    19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78\n];\n\nconst dbase = [ /* Distance codes 0..29 base */\n    1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,\n    257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,\n    8193, 12289, 16385, 24577, 0, 0\n];\n\nconst dext = [ /* Distance codes 0..29 extra */\n    16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22,\n    23, 23, 24, 24, 25, 25, 26, 26, 27, 27,\n    28, 28, 29, 29, 64, 64\n];\n\nexport default function inflate_table(type, lens, lens_index, codes, table, table_index, work, opts) {\n    const bits = opts.bits;\n    //here = opts.here; /* table entry for duplication */\n\n    let len = 0;               /* a code's length in bits */\n    let sym = 0;               /* index of code symbols */\n    let min = 0, max = 0;          /* minimum and maximum code lengths */\n    let root = 0;              /* number of index bits for root table */\n    let curr = 0;              /* number of index bits for current table */\n    let drop = 0;              /* code bits to drop for sub-table */\n    let left = 0;                   /* number of prefix codes available */\n    let used = 0;              /* code entries in table used */\n    let huff = 0;              /* Huffman code */\n    let incr;              /* for incrementing code, index */\n    let fill;              /* index for replicating entries */\n    let low;               /* low bits for current root entry */\n    let next;             /* next available space in table */\n    let base = null;     /* base value table to use */\n    let base_index = 0;\n    //  var shoextra;    /* extra bits table to use */\n    let end;                    /* use base and extra for symbol > end */\n    const count = new utils.Buf16(MAXBITS + 1); //[MAXBITS+1];    /* number of codes of each length */\n    const offs = new utils.Buf16(MAXBITS + 1); //[MAXBITS+1];     /* offsets in table for each length */\n    let extra = null;\n    let extra_index = 0;\n\n    let here_bits, here_op, here_val;\n\n    /*\n   Process a set of code lengths to create a canonical Huffman code.  The\n   code lengths are lens[0..codes-1].  Each length corresponds to the\n   symbols 0..codes-1.  The Huffman code is generated by first sorting the\n   symbols by length from short to long, and retaining the symbol order\n   for codes with equal lengths.  Then the code starts with all zero bits\n   for the first code of the shortest length, and the codes are integer\n   increments for the same length, and zeros are appended as the length\n   increases.  For the deflate format, these bits are stored backwards\n   from their more natural integer increment ordering, and so when the\n   decoding tables are built in the large loop below, the integer codes\n   are incremented backwards.\n\n   This routine assumes, but does not check, that all of the entries in\n   lens[] are in the range 0..MAXBITS.  The caller must assure this.\n   1..MAXBITS is interpreted as that code length.  zero means that that\n   symbol does not occur in this code.\n\n   The codes are sorted by computing a count of codes for each length,\n   creating from that a table of starting indices for each length in the\n   sorted table, and then entering the symbols in order in the sorted\n   table.  The sorted table is work[], with that space being provided by\n   the caller.\n\n   The length counts are used for other purposes as well, i.e. finding\n   the minimum and maximum length codes, determining if there are any\n   codes at all, checking for a valid set of lengths, and looking ahead\n   at length counts to determine sub-table sizes when building the\n   decoding tables.\n   */\n\n    /* accumulate lengths for codes (assumes lens[] all in 0..MAXBITS) */\n    for (len = 0; len <= MAXBITS; len++) {\n        count[len] = 0;\n    }\n    for (sym = 0; sym < codes; sym++) {\n        count[lens[lens_index + sym]]++;\n    }\n\n    /* bound code lengths, force root to be within code lengths */\n    root = bits;\n    for (max = MAXBITS; max >= 1; max--) {\n        if (count[max] !== 0) {\n            break; \n        }\n    }\n    if (root > max) {\n        root = max;\n    }\n    if (max === 0) {                     /* no symbols to code at all */\n    //table.op[opts.table_index] = 64;  //here.op = (var char)64;    /* invalid code marker */\n    //table.bits[opts.table_index] = 1;   //here.bits = (var char)1;\n    //table.val[opts.table_index++] = 0;   //here.val = (var short)0;\n        table[table_index++] = 1 << 24 | 64 << 16 | 0;\n\n\n        //table.op[opts.table_index] = 64;\n        //table.bits[opts.table_index] = 1;\n        //table.val[opts.table_index++] = 0;\n        table[table_index++] = 1 << 24 | 64 << 16 | 0;\n\n        opts.bits = 1;\n        return 0;     /* no symbols, but wait for decoding to report error */\n    }\n    for (min = 1; min < max; min++) {\n        if (count[min] !== 0) {\n            break; \n        }\n    }\n    if (root < min) {\n        root = min;\n    }\n\n    /* check for an over-subscribed or incomplete set of lengths */\n    left = 1;\n    for (len = 1; len <= MAXBITS; len++) {\n        left <<= 1;\n        left -= count[len];\n        if (left < 0) {\n            return -1;\n        }        /* over-subscribed */\n    }\n    if (left > 0 && (type === CODES || max !== 1)) {\n        return -1;                      /* incomplete set */\n    }\n\n    /* generate offsets into symbol table for each length for sorting */\n    offs[1] = 0;\n    for (len = 1; len < MAXBITS; len++) {\n        offs[len + 1] = offs[len] + count[len];\n    }\n\n    /* sort symbols by length, by symbol order within each length */\n    for (sym = 0; sym < codes; sym++) {\n        if (lens[lens_index + sym] !== 0) {\n            work[offs[lens[lens_index + sym]]++] = sym;\n        }\n    }\n\n    /*\n   Create and fill in decoding tables.  In this loop, the table being\n   filled is at next and has curr index bits.  The code being used is huff\n   with length len.  That code is converted to an index by dropping drop\n   bits off of the bottom.  For codes where len is less than drop + curr,\n   those top drop + curr - len bits are incremented through all values to\n   fill the table with replicated entries.\n\n   root is the number of index bits for the root table.  When len exceeds\n   root, sub-tables are created pointed to by the root entry with an index\n   of the low root bits of huff.  This is saved in low to check for when a\n   new sub-table should be started.  drop is zero when the root table is\n   being filled, and drop is root when sub-tables are being filled.\n\n   When a new sub-table is needed, it is necessary to look ahead in the\n   code lengths to determine what size sub-table is needed.  The length\n   counts are used for this, and so count[] is decremented as codes are\n   entered in the tables.\n\n   used keeps track of how many table entries have been allocated from the\n   provided *table space.  It is checked for LENS and DIST tables against\n   the constants ENOUGH_LENS and ENOUGH_DISTS to guard against changes in\n   the initial root table size constants.  See the comments in inftrees.h\n   for more information.\n\n   sym increments through all symbols, and the loop terminates when\n   all codes of length max, i.e. all codes, have been processed.  This\n   routine permits incomplete codes, so another loop after this one fills\n   in the rest of the decoding tables with invalid code markers.\n   */\n\n    /* set up for code type */\n    // poor man optimization - use if-else instead of switch,\n    // to avoid deopts in old v8\n    if (type === CODES) {\n        base = extra = work;    /* dummy value--not used */\n        end = 19;\n\n    } else if (type === LENS) {\n        base = lbase;\n        base_index -= 257;\n        extra = lext;\n        extra_index -= 257;\n        end = 256;\n\n    } else {                    /* DISTS */\n        base = dbase;\n        extra = dext;\n        end = -1;\n    }\n\n    /* initialize opts for loop */\n    huff = 0;                   /* starting code */\n    sym = 0;                    /* starting code symbol */\n    len = min;                  /* starting code length */\n    next = table_index;              /* current table to fill in */\n    curr = root;                /* current table index bits */\n    drop = 0;                   /* current bits to drop from code for index */\n    low = -1;                   /* trigger new sub-table when len > root */\n    used = 1 << root;          /* use root table entries */\n    const mask = used - 1;            /* mask for comparing low */\n\n    /* check available table space */\n    if (type === LENS && used > ENOUGH_LENS ||\n    type === DISTS && used > ENOUGH_DISTS) {\n        return 1;\n    }\n\n    /* process all codes and make table entries */\n    for (;;) {\n    /* create table entry */\n        here_bits = len - drop;\n        if (work[sym] < end) {\n            here_op = 0;\n            here_val = work[sym];\n        } else if (work[sym] > end) {\n            here_op = extra[extra_index + work[sym]];\n            here_val = base[base_index + work[sym]];\n        } else {\n            here_op = 32 + 64;         /* end of block */\n            here_val = 0;\n        }\n\n        /* replicate for those indices with low len bits equal to huff */\n        incr = 1 << len - drop;\n        fill = 1 << curr;\n        min = fill;                 /* save offset to next table */\n        do {\n            fill -= incr;\n            table[next + (huff >> drop) + fill] = here_bits << 24 | here_op << 16 | here_val |0;\n        } while (fill !== 0);\n\n        /* backwards increment the len-bit code huff */\n        incr = 1 << len - 1;\n        while (huff & incr) {\n            incr >>= 1;\n        }\n        if (incr !== 0) {\n            huff &= incr - 1;\n            huff += incr;\n        } else {\n            huff = 0;\n        }\n\n        /* go to next symbol, update count, len */\n        sym++;\n        if (--count[len] === 0) {\n            if (len === max) {\n                break; \n            }\n            len = lens[lens_index + work[sym]];\n        }\n\n        /* create new sub-table if needed */\n        if (len > root && (huff & mask) !== low) {\n            /* if first time, transition to sub-tables */\n            if (drop === 0) {\n                drop = root;\n            }\n\n            /* increment past last table */\n            next += min;            /* here min is 1 << curr */\n\n            /* determine length of next table */\n            curr = len - drop;\n            left = 1 << curr;\n            while (curr + drop < max) {\n                left -= count[curr + drop];\n                if (left <= 0) {\n                    break; \n                }\n                curr++;\n                left <<= 1;\n            }\n\n            /* check for enough space */\n            used += 1 << curr;\n            if (type === LENS && used > ENOUGH_LENS ||\n        type === DISTS && used > ENOUGH_DISTS) {\n                return 1;\n            }\n\n            /* point entry in root table to sub-table */\n            low = huff & mask;\n            /*table.op[low] = curr;\n      table.bits[low] = root;\n      table.val[low] = next - opts.table_index;*/\n            table[low] = root << 24 | curr << 16 | next - table_index |0;\n        }\n    }\n\n    /* fill in remaining table entry if code is incomplete (guaranteed to have\n   at most one remaining entry, since if the code is incomplete, the\n   maximum code length that was allowed to get this far is one bit) */\n    if (huff !== 0) {\n    //table.op[next + huff] = 64;            /* invalid code marker */\n    //table.bits[next + huff] = len - drop;\n    //table.val[next + huff] = 0;\n        table[next + huff] = len - drop << 24 | 64 << 16 |0;\n    }\n\n    /* set return parameters */\n    //opts.table_index += used;\n    opts.bits = root;\n    return 0;\n}\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n//   claim that you wrote the original software. If you use this software\n//   in a product, an acknowledgment in the product documentation would be\n//   appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n//   misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nimport * as utils from \"../utils/common.js\";\nimport adler32 from \"./adler32.js\";\nimport crc32 from \"./crc32.js\";\nimport inflate_fast from \"./inffast.js\";\nimport inflate_table from \"./inftrees.js\";\n\nconst CODES = 0;\nconst LENS = 1;\nconst DISTS = 2;\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\n\nimport {\n  Z_FINISH,\n  Z_BLOCK,\n  Z_TREES,\n  Z_OK,\n  Z_STREAM_END,\n  Z_NEED_DICT,\n  Z_STREAM_ERROR,\n  Z_DATA_ERROR,\n  Z_BUF_ERROR,\n  Z_DEFLATED\n} from \"./constants.js\";\n\n/* STATES ====================================================================*/\n/* ===========================================================================*/\n\n\nconst    HEAD = 1;       /* i: waiting for magic header */\nconst    FLAGS = 2;      /* i: waiting for method and flags (gzip) */\nconst    TIME = 3;       /* i: waiting for modification time (gzip) */\nconst    OS = 4;         /* i: waiting for extra flags and operating system (gzip) */\nconst    EXLEN = 5;      /* i: waiting for extra length (gzip) */\nconst    EXTRA = 6;      /* i: waiting for extra bytes (gzip) */\nconst    NAME = 7;       /* i: waiting for end of file name (gzip) */\nconst    COMMENT = 8;    /* i: waiting for end of comment (gzip) */\nconst    HCRC = 9;       /* i: waiting for header crc (gzip) */\nconst    DICTID = 10;    /* i: waiting for dictionary check value */\nconst    DICT = 11;      /* waiting for inflateSetDictionary() call */\nconst        TYPE = 12;      /* i: waiting for type bits, including last-flag bit */\nconst        TYPEDO = 13;    /* i: same, but skip check to exit inflate on new block */\nconst        STORED = 14;    /* i: waiting for stored size (length and complement) */\nconst        COPY_ = 15;     /* i/o: same as COPY below, but only first time in */\nconst        COPY = 16;      /* i/o: waiting for input or output to copy stored block */\nconst        TABLE = 17;     /* i: waiting for dynamic block table lengths */\nconst        LENLENS = 18;   /* i: waiting for code length code lengths */\nconst        CODELENS = 19;  /* i: waiting for length/lit and distance code lengths */\nconst            LEN_ = 20;      /* i: same as LEN below, but only first time in */\nconst            LEN = 21;       /* i: waiting for length/lit/eob code */\nconst            LENEXT = 22;    /* i: waiting for length extra bits */\nconst            DIST = 23;      /* i: waiting for distance code */\nconst            DISTEXT = 24;   /* i: waiting for distance extra bits */\nconst            MATCH = 25;     /* o: waiting for output space to copy string */\nconst            LIT = 26;       /* o: waiting for output space to write literal */\nconst    CHECK = 27;     /* i: waiting for 32-bit check value */\nconst    LENGTH = 28;    /* i: waiting for 32-bit length (gzip) */\nconst    DONE = 29;      /* finished check, done -- remain here until reset */\nconst    BAD = 30;       /* got a data error -- remain here until reset */\n//const    MEM = 31;       /* got an inflate() memory error -- remain here until reset */\nconst    SYNC = 32;      /* looking for synchronization bytes to restart inflate() */\n\n/* ===========================================================================*/\n\n\n\nconst ENOUGH_LENS = 852;\nconst ENOUGH_DISTS = 592;\n//var ENOUGH =  (ENOUGH_LENS+ENOUGH_DISTS);\n\nconst MAX_WBITS = 15;\n/* 32K LZ77 window */\nconst DEF_WBITS = MAX_WBITS;\n\n\nfunction zswap32(q) {\n  return  (((q >>> 24) & 0xff) +\n          ((q >>> 8) & 0xff00) +\n          ((q & 0xff00) << 8) +\n          ((q & 0xff) << 24));\n}\n\n\nclass InflateState {\n  constructor() {\n    this.mode = 0;             /* current inflate mode */\n    this.last = false;          /* true if processing last block */\n    this.wrap = 0;              /* bit 0 true for zlib, bit 1 true for gzip */\n    this.havedict = false;      /* true if dictionary provided */\n    this.flags = 0;             /* gzip header method and flags (0 if zlib) */\n    this.dmax = 0;              /* zlib header max distance (INFLATE_STRICT) */\n    this.check = 0;             /* protected copy of check value */\n    this.total = 0;             /* protected copy of output count */\n    // TODO: may be {}\n    this.head = null;           /* where to save gzip header information */\n\n    /* sliding window */\n    this.wbits = 0;             /* log base 2 of requested window size */\n    this.wsize = 0;             /* window size or zero if not using window */\n    this.whave = 0;             /* valid bytes in the window */\n    this.wnext = 0;             /* window write index */\n    this.window = null;         /* allocated sliding window, if needed */\n\n    /* bit accumulator */\n    this.hold = 0;              /* input bit accumulator */\n    this.bits = 0;              /* number of bits in \"in\" */\n\n    /* for string and stored block copying */\n    this.length = 0;            /* literal or length of data to copy */\n    this.offset = 0;            /* distance back to copy string from */\n\n    /* for table and code decoding */\n    this.extra = 0;             /* extra bits needed */\n\n    /* fixed and dynamic code tables */\n    this.lencode = null;          /* starting table for length/literal codes */\n    this.distcode = null;         /* starting table for distance codes */\n    this.lenbits = 0;           /* index bits for lencode */\n    this.distbits = 0;          /* index bits for distcode */\n\n    /* dynamic table building */\n    this.ncode = 0;             /* number of code length code lengths */\n    this.nlen = 0;              /* number of length code lengths */\n    this.ndist = 0;             /* number of distance code lengths */\n    this.have = 0;              /* number of code lengths in lens[] */\n    this.next = null;              /* next available space in codes[] */\n\n    this.lens = new utils.Buf16(320); /* temporary storage for code lengths */\n    this.work = new utils.Buf16(288); /* work area for code table building */\n\n    /*\n     because we don't have pointers in js, we use lencode and distcode directly\n     as buffers so we don't need codes\n    */\n    //this.codes = new utils.Buf32(ENOUGH);       /* space for code tables */\n    this.lendyn = null;              /* dynamic table for length/literal codes (JS specific) */\n    this.distdyn = null;             /* dynamic table for distance codes (JS specific) */\n    this.sane = 0;                   /* if false, allow invalid distance too far */\n    this.back = 0;                   /* bits back of last unprocessed length/lit */\n    this.was = 0;                    /* initial length of match */\n  }\n}\n\nfunction inflateResetKeep(strm) {\n  let state;\n\n  if (!strm || !strm.state) { return Z_STREAM_ERROR; }\n  state = strm.state;\n  strm.total_in = strm.total_out = state.total = 0;\n  strm.msg = ''; /*Z_NULL*/\n  if (state.wrap) {       /* to support ill-conceived Java test suite */\n    strm.adler = state.wrap & 1;\n  }\n  state.mode = HEAD;\n  state.last = 0;\n  state.havedict = 0;\n  state.dmax = 32768;\n  state.head = null/*Z_NULL*/;\n  state.hold = 0;\n  state.bits = 0;\n  //state.lencode = state.distcode = state.next = state.codes;\n  state.lencode = state.lendyn = new utils.Buf32(ENOUGH_LENS);\n  state.distcode = state.distdyn = new utils.Buf32(ENOUGH_DISTS);\n\n  state.sane = 1;\n  state.back = -1;\n  //Tracev((stderr, \"inflate: reset\\n\"));\n  return Z_OK;\n}\n\nfunction inflateReset(strm) {\n  let state;\n\n  if (!strm || !strm.state) { return Z_STREAM_ERROR; }\n  state = strm.state;\n  state.wsize = 0;\n  state.whave = 0;\n  state.wnext = 0;\n  return inflateResetKeep(strm);\n\n}\n\nfunction inflateReset2(strm, windowBits) {\n  let wrap;\n  let state;\n\n  /* get the state */\n  if (!strm || !strm.state) { return Z_STREAM_ERROR; }\n  state = strm.state;\n\n  /* extract wrap request from windowBits parameter */\n  if (windowBits < 0) {\n    wrap = 0;\n    windowBits = -windowBits;\n  }\n  else {\n    wrap = (windowBits >> 4) + 1;\n    if (windowBits < 48) {\n      windowBits &= 15;\n    }\n  }\n\n  /* set number of window bits, free window if different */\n  if (windowBits && (windowBits < 8 || windowBits > 15)) {\n    return Z_STREAM_ERROR;\n  }\n  if (state.window !== null && state.wbits !== windowBits) {\n    state.window = null;\n  }\n\n  /* update state and reset the rest of it */\n  state.wrap = wrap;\n  state.wbits = windowBits;\n  return inflateReset(strm);\n}\n\nfunction inflateInit2(strm, windowBits) {\n  let ret;\n  let state;\n\n  if (!strm) { return Z_STREAM_ERROR; }\n  //strm.msg = Z_NULL;                 /* in case we return an error */\n\n  state = new InflateState();\n\n  //if (state === Z_NULL) return Z_MEM_ERROR;\n  //Tracev((stderr, \"inflate: allocated\\n\"));\n  strm.state = state;\n  state.window = null/*Z_NULL*/;\n  ret = inflateReset2(strm, windowBits);\n  if (ret !== Z_OK) {\n    strm.state = null/*Z_NULL*/;\n  }\n  return ret;\n}\n\nfunction inflateInit(strm) {\n  return inflateInit2(strm, DEF_WBITS);\n}\n\n\n/*\n Return state with length and distance decoding tables and index sizes set to\n fixed code decoding.  Normally this returns fixed tables from inffixed.h.\n If BUILDFIXED is defined, then instead this routine builds the tables the\n first time it's called, and returns those tables the first time and\n thereafter.  This reduces the size of the code by about 2K bytes, in\n exchange for a little execution time.  However, BUILDFIXED should not be\n used for threaded applications, since the rewriting of the tables and virgin\n may not be thread-safe.\n */\nlet virgin = true;\n\nlet lenfix, distfix; // We have no pointers in JS, so keep tables separate\n\nfunction fixedtables(state) {\n  /* build fixed huffman tables if first call (may not be thread safe) */\n  if (virgin) {\n    let sym;\n\n    lenfix = new utils.Buf32(512);\n    distfix = new utils.Buf32(32);\n\n    /* literal/length table */\n    sym = 0;\n    while (sym < 144) { state.lens[sym++] = 8; }\n    while (sym < 256) { state.lens[sym++] = 9; }\n    while (sym < 280) { state.lens[sym++] = 7; }\n    while (sym < 288) { state.lens[sym++] = 8; }\n\n    inflate_table(LENS,  state.lens, 0, 288, lenfix,   0, state.work, { bits: 9 });\n\n    /* distance table */\n    sym = 0;\n    while (sym < 32) { state.lens[sym++] = 5; }\n\n    inflate_table(DISTS, state.lens, 0, 32,   distfix, 0, state.work, { bits: 5 });\n\n    /* do this just once */\n    virgin = false;\n  }\n\n  state.lencode = lenfix;\n  state.lenbits = 9;\n  state.distcode = distfix;\n  state.distbits = 5;\n}\n\n\n/*\n Update the window with the last wsize (normally 32K) bytes written before\n returning.  If window does not exist yet, create it.  This is only called\n when a window is already in use, or when output has been written during this\n inflate call, but the end of the deflate stream has not been reached yet.\n It is also called to create a window for dictionary data when a dictionary\n is loaded.\n\n Providing output buffers larger than 32K to inflate() should provide a speed\n advantage, since only the last 32K of output is copied to the sliding window\n upon return from inflate(), and since all distances after the first 32K of\n output will fall in the output data, making match copies simpler and faster.\n The advantage may be dependent on the size of the processor's data caches.\n */\nfunction updatewindow(strm, src, end, copy) {\n  let dist;\n  const state = strm.state;\n\n  /* if it hasn't been done already, allocate space for the window */\n  if (state.window === null) {\n    state.wsize = 1 << state.wbits;\n    state.wnext = 0;\n    state.whave = 0;\n\n    state.window = new utils.Buf8(state.wsize);\n  }\n\n  /* copy state->wsize or less output bytes into the circular window */\n  if (copy >= state.wsize) {\n    utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);\n    state.wnext = 0;\n    state.whave = state.wsize;\n  }\n  else {\n    dist = state.wsize - state.wnext;\n    if (dist > copy) {\n      dist = copy;\n    }\n    //zmemcpy(state->window + state->wnext, end - copy, dist);\n    utils.arraySet(state.window, src, end - copy, dist, state.wnext);\n    copy -= dist;\n    if (copy) {\n      //zmemcpy(state->window, end - copy, copy);\n      utils.arraySet(state.window, src, end - copy, copy, 0);\n      state.wnext = copy;\n      state.whave = state.wsize;\n    }\n    else {\n      state.wnext += dist;\n      if (state.wnext === state.wsize) { state.wnext = 0; }\n      if (state.whave < state.wsize) { state.whave += dist; }\n    }\n  }\n  return 0;\n}\n\nfunction inflate(strm, flush) {\n  let state;\n  let input, output;          // input/output buffers\n  let next;                   /* next input INDEX */\n  let put;                    /* next output INDEX */\n  let have, left;             /* available input and output */\n  let hold;                   /* bit buffer */\n  let bits;                   /* bits in bit buffer */\n  let _in, _out;              /* save starting available input and output */\n  let copy;                   /* number of stored or match bytes to copy */\n  let from;                   /* where to copy match bytes from */\n  let from_source;\n  let here = 0;               /* current decoding table entry */\n  let here_bits, here_op, here_val; // paked \"here\" denormalized (JS specific)\n  //var last;                   /* parent table entry */\n  let last_bits, last_op, last_val; // paked \"last\" denormalized (JS specific)\n  let len;                    /* length to copy for repeats, bits to drop */\n  let ret;                    /* return code */\n  let hbuf = new utils.Buf8(4);    /* buffer for gzip header crc calculation */\n  let opts;\n\n  let n; // temporary var for NEED_BITS\n\n  const order = /* permutation of code lengths */\n    [ 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 ];\n\n\n  if (!strm || !strm.state || !strm.output ||\n      (!strm.input && strm.avail_in !== 0)) {\n    return Z_STREAM_ERROR;\n  }\n\n  state = strm.state;\n  if (state.mode === TYPE) { state.mode = TYPEDO; }    /* skip check */\n\n\n  //--- LOAD() ---\n  put = strm.next_out;\n  output = strm.output;\n  left = strm.avail_out;\n  next = strm.next_in;\n  input = strm.input;\n  have = strm.avail_in;\n  hold = state.hold;\n  bits = state.bits;\n  //---\n\n  _in = have;\n  _out = left;\n  ret = Z_OK;\n\n  inf_leave: // goto emulation\n  for (;;) {\n    switch (state.mode) {\n      case HEAD:\n        if (state.wrap === 0) {\n          state.mode = TYPEDO;\n          break;\n        }\n        //=== NEEDBITS(16);\n        while (bits < 16) {\n          if (have === 0) { break inf_leave; }\n          have--;\n          hold += input[next++] << bits;\n          bits += 8;\n        }\n        //===//\n        if ((state.wrap & 2) && hold === 0x8b1f) {  /* gzip header */\n          state.check = 0/*crc32(0L, Z_NULL, 0)*/;\n          //=== CRC2(state.check, hold);\n          hbuf[0] = hold & 0xff;\n          hbuf[1] = (hold >>> 8) & 0xff;\n          state.check = crc32(state.check, hbuf, 2, 0);\n          //===//\n\n          //=== INITBITS();\n          hold = 0;\n          bits = 0;\n          //===//\n          state.mode = FLAGS;\n          break;\n        }\n        state.flags = 0;           /* expect zlib header */\n        if (state.head) {\n          state.head.done = false;\n        }\n        if (!(state.wrap & 1) ||   /* check if zlib header allowed */\n          (((hold & 0xff)/*BITS(8)*/ << 8) + (hold >> 8)) % 31) {\n          strm.msg = 'incorrect header check';\n          state.mode = BAD;\n          break;\n        }\n        if ((hold & 0x0f)/*BITS(4)*/ !== Z_DEFLATED) {\n          strm.msg = 'unknown compression method';\n          state.mode = BAD;\n          break;\n        }\n        //--- DROPBITS(4) ---//\n        hold >>>= 4;\n        bits -= 4;\n        //---//\n        len = (hold & 0x0f)/*BITS(4)*/ + 8;\n        if (state.wbits === 0) {\n          state.wbits = len;\n        }\n        else if (len > state.wbits) {\n          strm.msg = 'invalid window size';\n          state.mode = BAD;\n          break;\n        }\n        state.dmax = 1 << len;\n        //Tracev((stderr, \"inflate:   zlib header ok\\n\"));\n        strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/;\n        state.mode = hold & 0x200 ? DICTID : TYPE;\n        //=== INITBITS();\n        hold = 0;\n        bits = 0;\n        //===//\n        break;\n      case FLAGS:\n        //=== NEEDBITS(16); */\n        while (bits < 16) {\n          if (have === 0) { break inf_leave; }\n          have--;\n          hold += input[next++] << bits;\n          bits += 8;\n        }\n        //===//\n        state.flags = hold;\n        if ((state.flags & 0xff) !== Z_DEFLATED) {\n          strm.msg = 'unknown compression method';\n          state.mode = BAD;\n          break;\n        }\n        if (state.flags & 0xe000) {\n          strm.msg = 'unknown header flags set';\n          state.mode = BAD;\n          break;\n        }\n        if (state.head) {\n          state.head.text = ((hold >> 8) & 1);\n        }\n        if (state.flags & 0x0200) {\n          //=== CRC2(state.check, hold);\n          hbuf[0] = hold & 0xff;\n          hbuf[1] = (hold >>> 8) & 0xff;\n          state.check = crc32(state.check, hbuf, 2, 0);\n          //===//\n        }\n        //=== INITBITS();\n        hold = 0;\n        bits = 0;\n        //===//\n        state.mode = TIME;\n        /* falls through */\n      case TIME:\n        //=== NEEDBITS(32); */\n        while (bits < 32) {\n          if (have === 0) { break inf_leave; }\n          have--;\n          hold += input[next++] << bits;\n          bits += 8;\n        }\n        //===//\n        if (state.head) {\n          state.head.time = hold;\n        }\n        if (state.flags & 0x0200) {\n          //=== CRC4(state.check, hold)\n          hbuf[0] = hold & 0xff;\n          hbuf[1] = (hold >>> 8) & 0xff;\n          hbuf[2] = (hold >>> 16) & 0xff;\n          hbuf[3] = (hold >>> 24) & 0xff;\n          state.check = crc32(state.check, hbuf, 4, 0);\n          //===\n        }\n        //=== INITBITS();\n        hold = 0;\n        bits = 0;\n        //===//\n        state.mode = OS;\n        /* falls through */\n      case OS:\n        //=== NEEDBITS(16); */\n        while (bits < 16) {\n          if (have === 0) { break inf_leave; }\n          have--;\n          hold += input[next++] << bits;\n          bits += 8;\n        }\n        //===//\n        if (state.head) {\n          state.head.xflags = (hold & 0xff);\n          state.head.os = (hold >> 8);\n        }\n        if (state.flags & 0x0200) {\n          //=== CRC2(state.check, hold);\n          hbuf[0] = hold & 0xff;\n          hbuf[1] = (hold >>> 8) & 0xff;\n          state.check = crc32(state.check, hbuf, 2, 0);\n          //===//\n        }\n        //=== INITBITS();\n        hold = 0;\n        bits = 0;\n        //===//\n        state.mode = EXLEN;\n        /* falls through */\n      case EXLEN:\n        if (state.flags & 0x0400) {\n          //=== NEEDBITS(16); */\n          while (bits < 16) {\n            if (have === 0) { break inf_leave; }\n            have--;\n            hold += input[next++] << bits;\n            bits += 8;\n          }\n          //===//\n          state.length = hold;\n          if (state.head) {\n            state.head.extra_len = hold;\n          }\n          if (state.flags & 0x0200) {\n            //=== CRC2(state.check, hold);\n            hbuf[0] = hold & 0xff;\n            hbuf[1] = (hold >>> 8) & 0xff;\n            state.check = crc32(state.check, hbuf, 2, 0);\n            //===//\n          }\n          //=== INITBITS();\n          hold = 0;\n          bits = 0;\n          //===//\n        }\n        else if (state.head) {\n          state.head.extra = null/*Z_NULL*/;\n        }\n        state.mode = EXTRA;\n        /* falls through */\n      case EXTRA:\n        if (state.flags & 0x0400) {\n          copy = state.length;\n          if (copy > have) { copy = have; }\n          if (copy) {\n            if (state.head) {\n              len = state.head.extra_len - state.length;\n              if (!state.head.extra) {\n                // Use untyped array for more convenient processing later\n                state.head.extra = new Array(state.head.extra_len);\n              }\n              utils.arraySet(\n                state.head.extra,\n                input,\n                next,\n                // extra field is limited to 65536 bytes\n                // - no need for additional size check\n                copy,\n                /*len + copy > state.head.extra_max - len ? state.head.extra_max : copy,*/\n                len\n              );\n              //zmemcpy(state.head.extra + len, next,\n              //        len + copy > state.head.extra_max ?\n              //        state.head.extra_max - len : copy);\n            }\n            if (state.flags & 0x0200) {\n              state.check = crc32(state.check, input, copy, next);\n            }\n            have -= copy;\n            next += copy;\n            state.length -= copy;\n          }\n          if (state.length) { break inf_leave; }\n        }\n        state.length = 0;\n        state.mode = NAME;\n        /* falls through */\n      case NAME:\n        if (state.flags & 0x0800) {\n          if (have === 0) { break inf_leave; }\n          copy = 0;\n          do {\n            // TODO: 2 or 1 bytes?\n            len = input[next + copy++];\n            /* use constant limit because in js we should not preallocate memory */\n            if (state.head && len &&\n                (state.length < 65536 /*state.head.name_max*/)) {\n              state.head.name += String.fromCharCode(len);\n            }\n          } while (len && copy < have);\n\n          if (state.flags & 0x0200) {\n            state.check = crc32(state.check, input, copy, next);\n          }\n          have -= copy;\n          next += copy;\n          if (len) { break inf_leave; }\n        }\n        else if (state.head) {\n          state.head.name = null;\n        }\n        state.length = 0;\n        state.mode = COMMENT;\n        /* falls through */\n      case COMMENT:\n        if (state.flags & 0x1000) {\n          if (have === 0) { break inf_leave; }\n          copy = 0;\n          do {\n            len = input[next + copy++];\n            /* use constant limit because in js we should not preallocate memory */\n            if (state.head && len &&\n                (state.length < 65536 /*state.head.comm_max*/)) {\n              state.head.comment += String.fromCharCode(len);\n            }\n          } while (len && copy < have);\n          if (state.flags & 0x0200) {\n            state.check = crc32(state.check, input, copy, next);\n          }\n          have -= copy;\n          next += copy;\n          if (len) { break inf_leave; }\n        }\n        else if (state.head) {\n          state.head.comment = null;\n        }\n        state.mode = HCRC;\n        /* falls through */\n      case HCRC:\n        if (state.flags & 0x0200) {\n          //=== NEEDBITS(16); */\n          while (bits < 16) {\n            if (have === 0) { break inf_leave; }\n            have--;\n            hold += input[next++] << bits;\n            bits += 8;\n          }\n          //===//\n          if (hold !== (state.check & 0xffff)) {\n            strm.msg = 'header crc mismatch';\n            state.mode = BAD;\n            break;\n          }\n          //=== INITBITS();\n          hold = 0;\n          bits = 0;\n          //===//\n        }\n        if (state.head) {\n          state.head.hcrc = ((state.flags >> 9) & 1);\n          state.head.done = true;\n        }\n        strm.adler = state.check = 0;\n        state.mode = TYPE;\n        break;\n      case DICTID:\n        //=== NEEDBITS(32); */\n        while (bits < 32) {\n          if (have === 0) { break inf_leave; }\n          have--;\n          hold += input[next++] << bits;\n          bits += 8;\n        }\n        //===//\n        strm.adler = state.check = zswap32(hold);\n        //=== INITBITS();\n        hold = 0;\n        bits = 0;\n        //===//\n        state.mode = DICT;\n        /* falls through */\n      case DICT:\n        if (state.havedict === 0) {\n          //--- RESTORE() ---\n          strm.next_out = put;\n          strm.avail_out = left;\n          strm.next_in = next;\n          strm.avail_in = have;\n          state.hold = hold;\n          state.bits = bits;\n          //---\n          return Z_NEED_DICT;\n        }\n        strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/;\n        state.mode = TYPE;\n        /* falls through */\n      case TYPE:\n        if (flush === Z_BLOCK || flush === Z_TREES) { break inf_leave; }\n        /* falls through */\n      case TYPEDO:\n        if (state.last) {\n          //--- BYTEBITS() ---//\n          hold >>>= bits & 7;\n          bits -= bits & 7;\n          //---//\n          state.mode = CHECK;\n          break;\n        }\n        //=== NEEDBITS(3); */\n        while (bits < 3) {\n          if (have === 0) { break inf_leave; }\n          have--;\n          hold += input[next++] << bits;\n          bits += 8;\n        }\n        //===//\n        state.last = (hold & 0x01)/*BITS(1)*/;\n        //--- DROPBITS(1) ---//\n        hold >>>= 1;\n        bits -= 1;\n        //---//\n\n        switch ((hold & 0x03)/*BITS(2)*/) {\n          case 0:                             /* stored block */\n            //Tracev((stderr, \"inflate:     stored block%s\\n\",\n            //        state.last ? \" (last)\" : \"\"));\n            state.mode = STORED;\n            break;\n          case 1:                             /* fixed block */\n            fixedtables(state);\n            //Tracev((stderr, \"inflate:     fixed codes block%s\\n\",\n            //        state.last ? \" (last)\" : \"\"));\n            state.mode = LEN_;             /* decode codes */\n            if (flush === Z_TREES) {\n              //--- DROPBITS(2) ---//\n              hold >>>= 2;\n              bits -= 2;\n              //---//\n              break inf_leave;\n            }\n            break;\n          case 2:                             /* dynamic block */\n            //Tracev((stderr, \"inflate:     dynamic codes block%s\\n\",\n            //        state.last ? \" (last)\" : \"\"));\n            state.mode = TABLE;\n            break;\n          case 3:\n            strm.msg = 'invalid block type';\n            state.mode = BAD;\n        }\n        //--- DROPBITS(2) ---//\n        hold >>>= 2;\n        bits -= 2;\n        //---//\n        break;\n      case STORED:\n        //--- BYTEBITS() ---// /* go to byte boundary */\n        hold >>>= bits & 7;\n        bits -= bits & 7;\n        //---//\n        //=== NEEDBITS(32); */\n        while (bits < 32) {\n          if (have === 0) { break inf_leave; }\n          have--;\n          hold += input[next++] << bits;\n          bits += 8;\n        }\n        //===//\n        if ((hold & 0xffff) !== ((hold >>> 16) ^ 0xffff)) {\n          strm.msg = 'invalid stored block lengths';\n          state.mode = BAD;\n          break;\n        }\n        state.length = hold & 0xffff;\n        //Tracev((stderr, \"inflate:       stored length %u\\n\",\n        //        state.length));\n        //=== INITBITS();\n        hold = 0;\n        bits = 0;\n        //===//\n        state.mode = COPY_;\n        if (flush === Z_TREES) { break inf_leave; }\n        /* falls through */\n      case COPY_:\n        state.mode = COPY;\n        /* falls through */\n      case COPY:\n        copy = state.length;\n        if (copy) {\n          if (copy > have) { copy = have; }\n          if (copy > left) { copy = left; }\n          if (copy === 0) { break inf_leave; }\n          //--- zmemcpy(put, next, copy); ---\n          utils.arraySet(output, input, next, copy, put);\n          //---//\n          have -= copy;\n          next += copy;\n          left -= copy;\n          put += copy;\n          state.length -= copy;\n          break;\n        }\n        //Tracev((stderr, \"inflate:       stored end\\n\"));\n        state.mode = TYPE;\n        break;\n      case TABLE:\n        //=== NEEDBITS(14); */\n        while (bits < 14) {\n          if (have === 0) { break inf_leave; }\n          have--;\n          hold += input[next++] << bits;\n          bits += 8;\n        }\n        //===//\n        state.nlen = (hold & 0x1f)/*BITS(5)*/ + 257;\n        //--- DROPBITS(5) ---//\n        hold >>>= 5;\n        bits -= 5;\n        //---//\n        state.ndist = (hold & 0x1f)/*BITS(5)*/ + 1;\n        //--- DROPBITS(5) ---//\n        hold >>>= 5;\n        bits -= 5;\n        //---//\n        state.ncode = (hold & 0x0f)/*BITS(4)*/ + 4;\n        //--- DROPBITS(4) ---//\n        hold >>>= 4;\n        bits -= 4;\n        //---//\n//#ifndef PKZIP_BUG_WORKAROUND\n        if (state.nlen > 286 || state.ndist > 30) {\n          strm.msg = 'too many length or distance symbols';\n          state.mode = BAD;\n          break;\n        }\n//#endif\n        //Tracev((stderr, \"inflate:       table sizes ok\\n\"));\n        state.have = 0;\n        state.mode = LENLENS;\n        /* falls through */\n      case LENLENS:\n        while (state.have < state.ncode) {\n          //=== NEEDBITS(3);\n          while (bits < 3) {\n            if (have === 0) { break inf_leave; }\n            have--;\n            hold += input[next++] << bits;\n            bits += 8;\n          }\n          //===//\n          state.lens[order[state.have++]] = (hold & 0x07);//BITS(3);\n          //--- DROPBITS(3) ---//\n          hold >>>= 3;\n          bits -= 3;\n          //---//\n        }\n        while (state.have < 19) {\n          state.lens[order[state.have++]] = 0;\n        }\n        // We have separate tables & no pointers. 2 commented lines below not needed.\n        //state.next = state.codes;\n        //state.lencode = state.next;\n        // Switch to use dynamic table\n        state.lencode = state.lendyn;\n        state.lenbits = 7;\n\n        opts = { bits: state.lenbits };\n        ret = inflate_table(CODES, state.lens, 0, 19, state.lencode, 0, state.work, opts);\n        state.lenbits = opts.bits;\n\n        if (ret) {\n          strm.msg = 'invalid code lengths set';\n          state.mode = BAD;\n          break;\n        }\n        //Tracev((stderr, \"inflate:       code lengths ok\\n\"));\n        state.have = 0;\n        state.mode = CODELENS;\n        /* falls through */\n      case CODELENS:\n        while (state.have < state.nlen + state.ndist) {\n          for (;;) {\n            here = state.lencode[hold & ((1 << state.lenbits) - 1)];/*BITS(state.lenbits)*/\n            here_bits = here >>> 24;\n            here_op = (here >>> 16) & 0xff;\n            here_val = here & 0xffff;\n\n            if ((here_bits) <= bits) { break; }\n            //--- PULLBYTE() ---//\n            if (have === 0) { break inf_leave; }\n            have--;\n            hold += input[next++] << bits;\n            bits += 8;\n            //---//\n          }\n          if (here_val < 16) {\n            //--- DROPBITS(here.bits) ---//\n            hold >>>= here_bits;\n            bits -= here_bits;\n            //---//\n            state.lens[state.have++] = here_val;\n          }\n          else {\n            if (here_val === 16) {\n              //=== NEEDBITS(here.bits + 2);\n              n = here_bits + 2;\n              while (bits < n) {\n                if (have === 0) { break inf_leave; }\n                have--;\n                hold += input[next++] << bits;\n                bits += 8;\n              }\n              //===//\n              //--- DROPBITS(here.bits) ---//\n              hold >>>= here_bits;\n              bits -= here_bits;\n              //---//\n              if (state.have === 0) {\n                strm.msg = 'invalid bit length repeat';\n                state.mode = BAD;\n                break;\n              }\n              len = state.lens[state.have - 1];\n              copy = 3 + (hold & 0x03);//BITS(2);\n              //--- DROPBITS(2) ---//\n              hold >>>= 2;\n              bits -= 2;\n              //---//\n            }\n            else if (here_val === 17) {\n              //=== NEEDBITS(here.bits + 3);\n              n = here_bits + 3;\n              while (bits < n) {\n                if (have === 0) { break inf_leave; }\n                have--;\n                hold += input[next++] << bits;\n                bits += 8;\n              }\n              //===//\n              //--- DROPBITS(here.bits) ---//\n              hold >>>= here_bits;\n              bits -= here_bits;\n              //---//\n              len = 0;\n              copy = 3 + (hold & 0x07);//BITS(3);\n              //--- DROPBITS(3) ---//\n              hold >>>= 3;\n              bits -= 3;\n              //---//\n            }\n            else {\n              //=== NEEDBITS(here.bits + 7);\n              n = here_bits + 7;\n              while (bits < n) {\n                if (have === 0) { break inf_leave; }\n                have--;\n                hold += input[next++] << bits;\n                bits += 8;\n              }\n              //===//\n              //--- DROPBITS(here.bits) ---//\n              hold >>>= here_bits;\n              bits -= here_bits;\n              //---//\n              len = 0;\n              copy = 11 + (hold & 0x7f);//BITS(7);\n              //--- DROPBITS(7) ---//\n              hold >>>= 7;\n              bits -= 7;\n              //---//\n            }\n            if (state.have + copy > state.nlen + state.ndist) {\n              strm.msg = 'invalid bit length repeat';\n              state.mode = BAD;\n              break;\n            }\n            while (copy--) {\n              state.lens[state.have++] = len;\n            }\n          }\n        }\n\n        /* handle error breaks in while */\n        if (state.mode === BAD) { break; }\n\n        /* check for end-of-block code (better have one) */\n        if (state.lens[256] === 0) {\n          strm.msg = 'invalid code -- missing end-of-block';\n          state.mode = BAD;\n          break;\n        }\n\n        /* build code tables -- note: do not change the lenbits or distbits\n           values here (9 and 6) without reading the comments in inftrees.h\n           concerning the ENOUGH constants, which depend on those values */\n        state.lenbits = 9;\n\n        opts = { bits: state.lenbits };\n        ret = inflate_table(LENS, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts);\n        // We have separate tables & no pointers. 2 commented lines below not needed.\n        // state.next_index = opts.table_index;\n        state.lenbits = opts.bits;\n        // state.lencode = state.next;\n\n        if (ret) {\n          strm.msg = 'invalid literal/lengths set';\n          state.mode = BAD;\n          break;\n        }\n\n        state.distbits = 6;\n        //state.distcode.copy(state.codes);\n        // Switch to use dynamic table\n        state.distcode = state.distdyn;\n        opts = { bits: state.distbits };\n        ret = inflate_table(DISTS, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts);\n        // We have separate tables & no pointers. 2 commented lines below not needed.\n        // state.next_index = opts.table_index;\n        state.distbits = opts.bits;\n        // state.distcode = state.next;\n\n        if (ret) {\n          strm.msg = 'invalid distances set';\n          state.mode = BAD;\n          break;\n        }\n        //Tracev((stderr, 'inflate:       codes ok\\n'));\n        state.mode = LEN_;\n        if (flush === Z_TREES) { break inf_leave; }\n        /* falls through */\n      case LEN_:\n        state.mode = LEN;\n        /* falls through */\n      case LEN:\n        if (have >= 6 && left >= 258) {\n          //--- RESTORE() ---\n          strm.next_out = put;\n          strm.avail_out = left;\n          strm.next_in = next;\n          strm.avail_in = have;\n          state.hold = hold;\n          state.bits = bits;\n          //---\n          inflate_fast(strm, _out);\n          //--- LOAD() ---\n          put = strm.next_out;\n          output = strm.output;\n          left = strm.avail_out;\n          next = strm.next_in;\n          input = strm.input;\n          have = strm.avail_in;\n          hold = state.hold;\n          bits = state.bits;\n          //---\n\n          if (state.mode === TYPE) {\n            state.back = -1;\n          }\n          break;\n        }\n        state.back = 0;\n        for (;;) {\n          here = state.lencode[hold & ((1 << state.lenbits) - 1)];  /*BITS(state.lenbits)*/\n          here_bits = here >>> 24;\n          here_op = (here >>> 16) & 0xff;\n          here_val = here & 0xffff;\n\n          if (here_bits <= bits) { break; }\n          //--- PULLBYTE() ---//\n          if (have === 0) { break inf_leave; }\n          have--;\n          hold += input[next++] << bits;\n          bits += 8;\n          //---//\n        }\n        if (here_op && (here_op & 0xf0) === 0) {\n          last_bits = here_bits;\n          last_op = here_op;\n          last_val = here_val;\n          for (;;) {\n            here = state.lencode[last_val +\n                    ((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)];\n            here_bits = here >>> 24;\n            here_op = (here >>> 16) & 0xff;\n            here_val = here & 0xffff;\n\n            if ((last_bits + here_bits) <= bits) { break; }\n            //--- PULLBYTE() ---//\n            if (have === 0) { break inf_leave; }\n            have--;\n            hold += input[next++] << bits;\n            bits += 8;\n            //---//\n          }\n          //--- DROPBITS(last.bits) ---//\n          hold >>>= last_bits;\n          bits -= last_bits;\n          //---//\n          state.back += last_bits;\n        }\n        //--- DROPBITS(here.bits) ---//\n        hold >>>= here_bits;\n        bits -= here_bits;\n        //---//\n        state.back += here_bits;\n        state.length = here_val;\n        if (here_op === 0) {\n          //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?\n          //        \"inflate:         literal '%c'\\n\" :\n          //        \"inflate:         literal 0x%02x\\n\", here.val));\n          state.mode = LIT;\n          break;\n        }\n        if (here_op & 32) {\n          //Tracevv((stderr, \"inflate:         end of block\\n\"));\n          state.back = -1;\n          state.mode = TYPE;\n          break;\n        }\n        if (here_op & 64) {\n          strm.msg = 'invalid literal/length code';\n          state.mode = BAD;\n          break;\n        }\n        state.extra = here_op & 15;\n        state.mode = LENEXT;\n        /* falls through */\n      case LENEXT:\n        if (state.extra) {\n          //=== NEEDBITS(state.extra);\n          n = state.extra;\n          while (bits < n) {\n            if (have === 0) { break inf_leave; }\n            have--;\n            hold += input[next++] << bits;\n            bits += 8;\n          }\n          //===//\n          state.length += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/;\n          //--- DROPBITS(state.extra) ---//\n          hold >>>= state.extra;\n          bits -= state.extra;\n          //---//\n          state.back += state.extra;\n        }\n        //Tracevv((stderr, \"inflate:         length %u\\n\", state.length));\n        state.was = state.length;\n        state.mode = DIST;\n        /* falls through */\n      case DIST:\n        for (;;) {\n          here = state.distcode[hold & ((1 << state.distbits) - 1)];/*BITS(state.distbits)*/\n          here_bits = here >>> 24;\n          here_op = (here >>> 16) & 0xff;\n          here_val = here & 0xffff;\n\n          if ((here_bits) <= bits) { break; }\n          //--- PULLBYTE() ---//\n          if (have === 0) { break inf_leave; }\n          have--;\n          hold += input[next++] << bits;\n          bits += 8;\n          //---//\n        }\n        if ((here_op & 0xf0) === 0) {\n          last_bits = here_bits;\n          last_op = here_op;\n          last_val = here_val;\n          for (;;) {\n            here = state.distcode[last_val +\n                    ((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)];\n            here_bits = here >>> 24;\n            here_op = (here >>> 16) & 0xff;\n            here_val = here & 0xffff;\n\n            if ((last_bits + here_bits) <= bits) { break; }\n            //--- PULLBYTE() ---//\n            if (have === 0) { break inf_leave; }\n            have--;\n            hold += input[next++] << bits;\n            bits += 8;\n            //---//\n          }\n          //--- DROPBITS(last.bits) ---//\n          hold >>>= last_bits;\n          bits -= last_bits;\n          //---//\n          state.back += last_bits;\n        }\n        //--- DROPBITS(here.bits) ---//\n        hold >>>= here_bits;\n        bits -= here_bits;\n        //---//\n        state.back += here_bits;\n        if (here_op & 64) {\n          strm.msg = 'invalid distance code';\n          state.mode = BAD;\n          break;\n        }\n        state.offset = here_val;\n        state.extra = (here_op) & 15;\n        state.mode = DISTEXT;\n        /* falls through */\n      case DISTEXT:\n        if (state.extra) {\n          //=== NEEDBITS(state.extra);\n          n = state.extra;\n          while (bits < n) {\n            if (have === 0) { break inf_leave; }\n            have--;\n            hold += input[next++] << bits;\n            bits += 8;\n          }\n          //===//\n          state.offset += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/;\n          //--- DROPBITS(state.extra) ---//\n          hold >>>= state.extra;\n          bits -= state.extra;\n          //---//\n          state.back += state.extra;\n        }\n//#ifdef INFLATE_STRICT\n        if (state.offset > state.dmax) {\n          strm.msg = 'invalid distance too far back';\n          state.mode = BAD;\n          break;\n        }\n//#endif\n        //Tracevv((stderr, \"inflate:         distance %u\\n\", state.offset));\n        state.mode = MATCH;\n        /* falls through */\n      case MATCH:\n        if (left === 0) { break inf_leave; }\n        copy = _out - left;\n        if (state.offset > copy) {         /* copy from window */\n          copy = state.offset - copy;\n          if (copy > state.whave) {\n            if (state.sane) {\n              strm.msg = 'invalid distance too far back';\n              state.mode = BAD;\n              break;\n            }\n// (!) This block is disabled in zlib defaults,\n// don't enable it for binary compatibility\n//#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR\n//          Trace((stderr, \"inflate.c too far\\n\"));\n//          copy -= state.whave;\n//          if (copy > state.length) { copy = state.length; }\n//          if (copy > left) { copy = left; }\n//          left -= copy;\n//          state.length -= copy;\n//          do {\n//            output[put++] = 0;\n//          } while (--copy);\n//          if (state.length === 0) { state.mode = LEN; }\n//          break;\n//#endif\n          }\n          if (copy > state.wnext) {\n            copy -= state.wnext;\n            from = state.wsize - copy;\n          }\n          else {\n            from = state.wnext - copy;\n          }\n          if (copy > state.length) { copy = state.length; }\n          from_source = state.window;\n        }\n        else {                              /* copy from output */\n          from_source = output;\n          from = put - state.offset;\n          copy = state.length;\n        }\n        if (copy > left) { copy = left; }\n        left -= copy;\n        state.length -= copy;\n        do {\n          output[put++] = from_source[from++];\n        } while (--copy);\n        if (state.length === 0) { state.mode = LEN; }\n        break;\n      case LIT:\n        if (left === 0) { break inf_leave; }\n        output[put++] = state.length;\n        left--;\n        state.mode = LEN;\n        break;\n      case CHECK:\n        if (state.wrap) {\n          //=== NEEDBITS(32);\n          while (bits < 32) {\n            if (have === 0) { break inf_leave; }\n            have--;\n            // Use '|' instead of '+' to make sure that result is signed\n            hold |= input[next++] << bits;\n            bits += 8;\n          }\n          //===//\n          _out -= left;\n          strm.total_out += _out;\n          state.total += _out;\n          if (_out) {\n            strm.adler = state.check =\n                /*UPDATE(state.check, put - _out, _out);*/\n                (state.flags ? crc32(state.check, output, _out, put - _out) : adler32(state.check, output, _out, put - _out));\n\n          }\n          _out = left;\n          // NB: crc32 stored as signed 32-bit int, zswap32 returns signed too\n          if ((state.flags ? hold : zswap32(hold)) !== state.check) {\n            strm.msg = 'incorrect data check';\n            state.mode = BAD;\n            break;\n          }\n          //=== INITBITS();\n          hold = 0;\n          bits = 0;\n          //===//\n          //Tracev((stderr, \"inflate:   check matches trailer\\n\"));\n        }\n        state.mode = LENGTH;\n        /* falls through */\n      case LENGTH:\n        if (state.wrap && state.flags) {\n          //=== NEEDBITS(32);\n          while (bits < 32) {\n            if (have === 0) { break inf_leave; }\n            have--;\n            hold += input[next++] << bits;\n            bits += 8;\n          }\n          //===//\n          if (hold !== (state.total & 0xffffffff)) {\n            strm.msg = 'incorrect length check';\n            state.mode = BAD;\n            break;\n          }\n          //=== INITBITS();\n          hold = 0;\n          bits = 0;\n          //===//\n          //Tracev((stderr, \"inflate:   length matches trailer\\n\"));\n        }\n        state.mode = DONE;\n        /* falls through */\n      case DONE:\n        ret = Z_STREAM_END;\n        break inf_leave;\n      case BAD:\n        ret = Z_DATA_ERROR;\n        break inf_leave;\n      // case MEM:\n      //   return Z_MEM_ERROR;\n      case SYNC:\n        /* falls through */\n      default:\n        return Z_STREAM_ERROR;\n    }\n  }\n\n  // inf_leave <- here is real place for \"goto inf_leave\", emulated via \"break inf_leave\"\n\n  /*\n     Return from inflate(), updating the total counts and the check value.\n     If there was no progress during the inflate() call, return a buffer\n     error.  Call updatewindow() to create and/or update the window state.\n     Note: a memory error from inflate() is non-recoverable.\n   */\n\n  //--- RESTORE() ---\n  strm.next_out = put;\n  strm.avail_out = left;\n  strm.next_in = next;\n  strm.avail_in = have;\n  state.hold = hold;\n  state.bits = bits;\n  //---\n\n  if (state.wsize || (_out !== strm.avail_out && state.mode < BAD &&\n                      (state.mode < CHECK || flush !== Z_FINISH))) {\n    if (updatewindow(strm, strm.output, strm.next_out, _out - strm.avail_out)) {\n      // state.mode = MEM;\n      // return Z_MEM_ERROR;\n    }\n  }\n  _in -= strm.avail_in;\n  _out -= strm.avail_out;\n  strm.total_in += _in;\n  strm.total_out += _out;\n  state.total += _out;\n  if (state.wrap && _out) {\n    strm.adler = state.check = /*UPDATE(state.check, strm.next_out - _out, _out);*/\n      (state.flags ? crc32(state.check, output, _out, strm.next_out - _out) : adler32(state.check, output, _out, strm.next_out - _out));\n  }\n  strm.data_type = state.bits + (state.last ? 64 : 0) +\n                    (state.mode === TYPE ? 128 : 0) +\n                    (state.mode === LEN_ || state.mode === COPY_ ? 256 : 0);\n  if (((_in === 0 && _out === 0) || flush === Z_FINISH) && ret === Z_OK) {\n    ret = Z_BUF_ERROR;\n  }\n  return ret;\n}\n\nfunction inflateEnd(strm) {\n\n  if (!strm || !strm.state /*|| strm->zfree == (free_func)0*/) {\n    return Z_STREAM_ERROR;\n  }\n\n  const state = strm.state;\n  if (state.window) {\n    state.window = null;\n  }\n  strm.state = null;\n  return Z_OK;\n}\n\nfunction inflateGetHeader(strm, head) {\n  let state;\n\n  /* check state */\n  if (!strm || !strm.state) { return Z_STREAM_ERROR; }\n  state = strm.state;\n  if ((state.wrap & 2) === 0) { return Z_STREAM_ERROR; }\n\n  /* save header structure */\n  state.head = head;\n  head.done = false;\n  return Z_OK;\n}\n\nfunction inflateSetDictionary(strm, dictionary) {\n  const dictLength = dictionary.length;\n\n  let state;\n  let dictid;\n  let ret;\n\n  /* check state */\n  if (!strm /* == Z_NULL */ || !strm.state /* == Z_NULL */) { return Z_STREAM_ERROR; }\n  state = strm.state;\n\n  if (state.wrap !== 0 && state.mode !== DICT) {\n    return Z_STREAM_ERROR;\n  }\n\n  /* check for correct dictionary identifier */\n  if (state.mode === DICT) {\n    dictid = 1; /* adler32(0, null, 0)*/\n    /* dictid = adler32(dictid, dictionary, dictLength); */\n    dictid = adler32(dictid, dictionary, dictLength, 0);\n    if (dictid !== state.check) {\n      return Z_DATA_ERROR;\n    }\n  }\n  /* copy dictionary to window using updatewindow(), which will amend the\n   existing dictionary if appropriate */\n  ret = updatewindow(strm, dictionary, dictLength, dictLength);\n  // if (ret) {\n  //   state.mode = MEM;\n  //   return Z_MEM_ERROR;\n  // }\n  state.havedict = 1;\n  // Tracev((stderr, \"inflate:   dictionary set\\n\"));\n  return Z_OK;\n}\n\nconst inflateInfo = 'pako inflate (from Nodeca project)';\n\nexport {\n  inflateReset,\n  inflateReset2,\n  inflateResetKeep,\n  inflateInit,\n  inflateInit2,\n  inflate,\n  inflateEnd,\n  inflateGetHeader,\n  inflateSetDictionary,\n  inflateInfo\n};\n\n/* Not implemented\nexports.inflateCopy = inflateCopy;\nexports.inflateGetDictionary = inflateGetDictionary;\nexports.inflateMark = inflateMark;\nexports.inflatePrime = inflatePrime;\nexports.inflateSync = inflateSync;\nexports.inflateSyncPoint = inflateSyncPoint;\nexports.inflateUndermine = inflateUndermine;\n*/\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n//   claim that you wrote the original software. If you use this software\n//   in a product, an acknowledgment in the product documentation would be\n//   appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n//   misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nexport default class GZheader {\n  constructor() {\n    /* true if compressed data believed to be text */\n    this.text       = 0;\n    /* modification time */\n    this.time       = 0;\n    /* extra flags (not used when writing a gzip file) */\n    this.xflags     = 0;\n    /* operating system */\n    this.os         = 0;\n    /* pointer to extra field or Z_NULL if none */\n    this.extra      = null;\n    /* extra field length (valid if extra != Z_NULL) */\n    this.extra_len  = 0; // Actually, we don't need it in JS,\n                        // but leave for few code modifications\n\n    //\n    // Setup limits is not necessary because in js we should not preallocate memory\n    // for inflate use constant limit in 65536 bytes\n    //\n\n    /* space at extra (only when reading header) */\n    // this.extra_max  = 0;\n    /* pointer to zero-terminated file name or Z_NULL */\n    this.name       = '';\n    /* space at name (only when reading header) */\n    // this.name_max   = 0;\n    /* pointer to zero-terminated 