UNPKG

1.7 MBSource Map (JSON)View Raw
1{"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/util.js","../../src/biginteger/index.js","../../src/encoding/base64.js","../../src/enums.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/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/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/crypto/public_key/elliptic/curves.js","../../src/crypto/public_key/elliptic/ecdsa.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/public_key/index.js","../../src/crypto/public_key/dsa.js","../../src/crypto/signature.js","../../src/type/ecdh_symkey.js","../../src/type/kdf_params.js","../../src/crypto/crypto.js","../../src/crypto/index.js","../../node_modules/@openpgp/pako/lib/utils/common.js","../../node_modules/@openpgp/pako/lib/zlib/trees.js","../../node_modules/@openpgp/pako/lib/zlib/constants.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/packet.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"],"sourcesContent":["const doneWritingPromise = Symbol('doneWritingPromise');\nconst doneWritingResolve = Symbol('doneWritingResolve');\nconst doneWritingReject = Symbol('doneWritingReject');\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 return {\n read: async () => {\n await this[doneWritingPromise];\n if (!this.length) {\n return { value: undefined, done: true };\n }\n return { value: this.shift(), done: false };\n }\n };\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) || this._cancelling) {\n this._reading = false;\n break;\n }\n }\n } catch(e) {\n this.emit('error', e);\n }\n }\n\n _destroy(reason) {\n this._reader.cancel(reason);\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';\nimport { ArrayStream, doneWritingPromise } from './writer';\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 = () => {};\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(cancel) {\n let pulled = false;\n let backpressureChangePromiseResolve;\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 cancel\n }, {highWaterMark: 0}),\n writable: new WritableStream({\n write: async function(chunk) {\n outputController.enqueue(chunk);\n if (!pulled) {\n await new Promise(resolve => {\n backpressureChangePromiseResolve = resolve;\n });\n backpressureChangePromiseResolve = 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 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 const writer = getWriter(output);\n await writer.write(result);\n await writer.close();\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() {\n incomingTransformController.error(new Error('Readable side was canceled.'));\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 const tee0 = new ArrayStream();\n const tee1 = new ArrayStream();\n (async () => {\n const reader = getReader(input);\n const writer1 = getWriter(tee0);\n const writer2 = getWriter(tee1);\n try {\n while (true) {\n await writer1.ready;\n await writer2.ready;\n const { done, value } = await reader.read();\n if (done) {\n await writer1.close();\n await writer2.close();\n break;\n }\n await writer1.write(value);\n await writer2.write(value);\n }\n } catch (e) {\n await writer1.abort(e);\n await writer2.abort(e);\n } finally {\n reader.releaseLock();\n writer1.releaseLock();\n writer2.releaseLock();\n }\n })();\n return [tee0, tee1];\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 (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 (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","// 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';\n\nconst debugMode = globalThis.process && globalThis.process.env.NODE_ENV === 'development';\n\nconst util = {\n isString: function(data) {\n return typeof data === 'string' || String.prototype.isPrototypeOf(data);\n },\n\n isArray: function(data) {\n return Array.prototype.isPrototypeOf(data);\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(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(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 * Detect Node.js runtime.\n */\n detectNode: function() {\n return typeof globalThis.process === 'object' &&\n typeof globalThis.process.versions === 'object';\n },\n\n /**\n * Detect native BigInt support\n */\n detectBigInt: () => typeof BigInt !== 'undefined',\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 (util.detectNode()) {\n const os = require('os');\n return os.cpus().length;\n }\n\n return navigator.hardwareConcurrency || 1;\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,}|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 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'); 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 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\nexport default util;\n","import util from '../util';\nimport BigInteger from './native.interface';\n\nasync function getBigInteger() {\n if (util.detectBigInt()) {\n return BigInteger;\n } else {\n const { default: BigInteger } = await import('./bn.interface');\n return BigInteger;\n }\n}\n\n// eslint-disable-next-line import/prefer-default-export\nexport { getBigInteger };\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","/**\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 */\n 'ED25519': 'ed25519',\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 */\n 'X25519': 'curve25519',\n 'cv25519': 'curve25519',\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-rfc4880bis-04#section-9.1|RFC4880bis-04, 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)\n * [{@link https://tools.ietf.org/html/draft-koch-eddsa-for-openpgp-04|Draft RFC}] */\n eddsa: 22,\n /** Reserved for AEDH */\n aedh: 23,\n /** Reserved for AEDSA */\n aedsa: 24\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 /** Asserts validity and converts from string/integer to integer. */\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 /** Converts from an integer to string. */\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};\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.\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 /**\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 * @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: ['preferred-email-encoding@pgp.com', 'pka-address@gnupg.org'],\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.brainpoolP256r1, enums.curve.brainpoolP384r1, enums.curve.brainpoolP512r1, 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.js';\nimport enums from '../enums.js';\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. RFC4880, section 6.3: \"OpenPGP should consider improperly formatted\n * Armor Headers to be corruption of the ASCII Armor.\"\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 throw 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 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 on message failed: '\" + checksum + \"' should be '\" +\n checksumVerifiedString + \"'\");\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('\\n-----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.js';\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 }\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// TODO use webCrypto or nodeCrypto when possible.\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.js';\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","'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';\n\nconst webCrypto = util.getWebCrypto();\nconst nodeCrypto = util.getNodeCrypto();\n\nfunction nodeHash(type) {\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\nlet hashFunctions;\nif (nodeCrypto) { // Use Node native crypto for all hash functions\n hashFunctions = {\n md5: nodeHash('md5'),\n sha1: nodeHash('sha1'),\n sha224: nodeHash('sha224'),\n sha256: nodeHash('sha256'),\n sha384: nodeHash('sha384'),\n sha512: nodeHash('sha512'),\n ripemd: nodeHash('ripemd160')\n };\n} else { // Use JS fallbacks\n hashFunctions = {\n md5: md5,\n sha1: asmcryptoHash(Sha1, navigator.userAgent.indexOf('Edge') === -1 && 'SHA-1'),\n sha224: hashjsHash(sha224),\n sha256: asmcryptoHash(Sha256, 'SHA-256'),\n sha384: hashjsHash(sha384, 'SHA-384'),\n sha512: hashjsHash(sha512, 'SHA-512'), // asmcrypto sha512 is huge.\n ripemd: hashjsHash(ripemd160)\n };\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 1:\n // - MD5 [HAC]\n return this.md5(data);\n case 2:\n // - SHA-1 [FIPS180]\n return this.sha1(data);\n case 3:\n // - RIPE-MD/160 [HAC]\n return this.ripemd(data);\n case 8:\n // - SHA256 [FIPS180]\n return this.sha256(data);\n case 9:\n // - SHA384 [FIPS180]\n return this.sha384(data);\n case 10:\n // - SHA512 [FIPS180]\n return this.sha512(data);\n case 11:\n // - SHA224 [FIPS180]\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 1: // - MD5 [HAC]\n return 16;\n case 2: // - SHA-1 [FIPS180]\n case 3: // - RIPE-MD/160 [HAC]\n return 20;\n case 8: // - SHA256 [FIPS180]\n return 32;\n case 9: // - SHA384 [FIPS180]\n return 48;\n case 10: // - SHA512 [FIPS180]\n return 64;\n case 11: // - SHA224 [FIPS180]\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","// 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';\n\nimport * as stream from '@openpgp/web-stream-tools';\nimport * as cipher from '../cipher';\nimport util from '../../util';\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\nexport async function encrypt(algo, key, plaintext, iv, config) {\n if (util.getNodeCrypto() && nodeAlgos[algo]) { // Node crypto library.\n return nodeEncrypt(algo, key, plaintext, iv);\n }\n if (algo.substr(0, 3) === 'aes') {\n return aesEncrypt(algo, key, plaintext, iv, config);\n }\n\n const cipherfn = new cipher[algo](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\nexport async function decrypt(algo, key, ciphertext, iv) {\n if (util.getNodeCrypto() && nodeAlgos[algo]) { // Node crypto library.\n return nodeDecrypt(algo, key, ciphertext, iv);\n }\n if (algo.substr(0, 3) === 'aes') {\n return aesDecrypt(algo, key, ciphertext, iv);\n }\n\n const cipherfn = new cipher[algo](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;\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 } = cipher[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 cipherObj = new nodeCrypto.createCipheriv(nodeAlgos[algo], key, iv);\n return stream.transform(pt, value => new Uint8Array(cipherObj.update(value)));\n}\n\nfunction nodeDecrypt(algo, key, ct, iv) {\n const decipherObj = new nodeCrypto.createDecipheriv(nodeAlgos[algo], 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';\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 navigator.userAgent.indexOf('Edge') === -1\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 {String} cipher - The symmetric cipher algorithm to use e.g. 'aes128'\n * @param {Uint8Array} key - The encryption key\n */\nasync function EAX(cipher, key) {\n if (cipher.substr(0, 3) !== 'aes') {\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';\n\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 {String} cipher - The symmetric cipher algorithm to use e.g. 'aes128'\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 aes = new ciphers[cipher](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';\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 {String} cipher - The symmetric cipher algorithm to use e.g. 'aes128'\n * @param {Uint8Array} key - The encryption key\n */\nasync function GCM(cipher, key) {\n if (cipher.substr(0, 3) !== 'aes') {\n throw new Error('GCM mode supports only AES cipher');\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 (\n !pt.length ||\n // iOS does not support GCM-en/decrypting empty messages\n // Also, synchronous en/decryption might be faster in this case.\n (!adata.length && navigator.userAgent.indexOf('Edge') !== -1)\n // Edge does not support GCM-en/decrypting without ADATA\n ) {\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 (\n ct.length === tagLength ||\n // iOS does not support GCM-en/decrypting empty messages\n // Also, synchronous en/decryption might be faster in this case.\n (!adata.length && navigator.userAgent.indexOf('Edge') !== -1)\n // Edge does not support GCM-en/decrypting without ADATA\n ) {\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 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 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 * Buffer for secure random numbers\n */\nclass RandomBuffer {\n constructor() {\n this.buffer = null;\n this.size = null;\n this.callback = null;\n }\n\n /**\n * Initialize buffer\n * @param {Integer} size - size of buffer\n */\n init(size, callback) {\n this.buffer = new Uint8Array(size);\n this.size = 0;\n this.callback = callback;\n }\n\n /**\n * Concat array of secure random numbers to buffer\n * @param {Uint8Array} buf\n */\n set(buf) {\n if (!this.buffer) {\n throw new Error('RandomBuffer is not initialized');\n }\n if (!(buf instanceof Uint8Array)) {\n throw new Error('Invalid type: buf not an Uint8Array');\n }\n const freeSpace = this.buffer.length - this.size;\n if (buf.length > freeSpace) {\n buf = buf.subarray(0, freeSpace);\n }\n // set buf with offset old size of buffer\n this.buffer.set(buf, this.size);\n this.size += buf.length;\n }\n\n /**\n * Take numbers out of buffer and copy to array\n * @param {Uint8Array} buf - The destination array\n */\n async get(buf) {\n if (!this.buffer) {\n throw new Error('RandomBuffer is not initialized');\n }\n if (!(buf instanceof Uint8Array)) {\n throw new Error('Invalid type: buf not an Uint8Array');\n }\n if (this.size < buf.length) {\n if (!this.callback) {\n throw new Error('Random number buffer depleted');\n }\n // Wait for random bytes from main context, then try again\n await this.callback();\n return this.get(buf);\n }\n for (let i = 0; i < buf.length; i++) {\n buf[i] = this.buffer[--this.size];\n // clear buffer value\n this.buffer[this.size] = 0;\n }\n }\n}\n\n/**\n * Retrieve secure random byte array of the specified length\n * @param {Integer} length - Length in bytes to generate\n * @returns {Promise<Uint8Array>} Random byte array.\n * @async\n */\nexport async function getRandomBytes(length) {\n const buf = new Uint8Array(length);\n if (typeof crypto !== 'undefined' && crypto.getRandomValues) {\n crypto.getRandomValues(buf);\n } else if (nodeCrypto) {\n const bytes = nodeCrypto.randomBytes(buf.length);\n buf.set(bytes);\n } else if (randomBuffer.buffer) {\n await randomBuffer.get(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\nexport const randomBuffer = new RandomBuffer();\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';\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 {Promise<Uint8Array>} Random padding.\n * @async\n */\nasync function getPKCS1Padding(length) {\n const result = new Uint8Array(length);\n let count = 0;\n while (count < length) {\n const randomBytes = await 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 {Promise<Uint8Array>} EME-PKCS1 padded message.\n * @async\n */\nexport async 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 = await 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 * @returns {Uint8Array} Message.\n */\nexport function emeDecode(encoded) {\n let i = 2;\n while (encoded[i] !== 0 && i < encoded.length) {\n i++;\n }\n const psLen = i - 2;\n const separator = encoded[i++];\n if (encoded[0] === 0 && encoded[1] === 2 && psLen >= 8 && separator === 0) {\n return encoded.subarray(i);\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 = util.detectNode() ? 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 = util.detectNode() ? 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 * @returns {Promise<String>} RSA Plaintext.\n * @async\n */\nexport async function decrypt(data, n, e, d, p, q, u) {\n if (util.getNodeCrypto()) {\n return nodeDecrypt(data, n, e, d, p, q, u);\n }\n return bnDecrypt(data, n, e, d, p, q, u);\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) => nodeCrypto.generateKeyPair('rsa', opts, (err, _, der) => {\n if (err) {\n reject(err);\n } else {\n resolve(RSAPrivateKey.decode(der, 'der'));\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 (e.g. old MS Edge 50% of the time).\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 // add hash field for ms edge support\n return new Uint8Array(await webCrypto.sign({ 'name': 'RSASSA-PKCS1-v1_5', 'hash': hashName }, 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 // add hash field for ms edge support\n return webCrypto.verify({ 'name': 'RSASSA-PKCS1-v1_5', 'hash': hashName }, 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(await 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) {\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()));\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 = await 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 * @returns {Promise<Uint8Array>} Unpadded message.\n * @async\n */\nexport async function decrypt(c1, c2, p, x) {\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()));\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","// 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.js';\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';\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.eddsa,\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 Curve {\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 Error('Not valid 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 = await 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 = await 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(await 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 Curve(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\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 Curve, 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 { Curve, webCurves, privateToJWK, rawPublicToJWK, validateStandardParams } from './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 Curve(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 Curve(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 Curve(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 = await 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 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.js';\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 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: sha256 or stronger is required 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 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 const signature = util.concatUint8Array([r, s]);\n return nacl.sign.detached.verify(hashed, signature, publicKey.subarray(1));\n}\n/**\n * Validate 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","// 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.js';\nimport { Curve, jwkToRawPublic, rawPublicToJWK, privateToJWK, validateStandardParams } from './curves';\nimport * as aesKW from '../../aes_kw';\nimport * as cipher from '../../cipher';\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';\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 {Curve} 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 = await 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 Curve(oid);\n const { publicKey, sharedKey } = await genPublicEphemeralKey(curve, Q);\n const param = buildEcdhParam(enums.publicKey.ecdh, oid, kdfParams, fingerprint);\n const cipherAlgo = enums.read(enums.symmetric, kdfParams.cipher);\n const Z = await kdf(kdfParams.hash, sharedKey, cipher[cipherAlgo].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 {Curve} 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 Curve(oid);\n const { sharedKey } = await genPrivateEphemeralKey(curve, V, Q, d);\n const param = buildEcdhParam(enums.publicKey.ecdh, oid, kdfParams, fingerprint);\n const cipherAlgo = enums.read(enums.symmetric, 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, cipher[cipherAlgo].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 {Curve} 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 {Curve} 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 {Curve} 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 {Curve} 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 {Curve} 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 {Curve} 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 Asymmetric cryptography functions\n * @module crypto/public_key\n * @private\n */\n\nimport nacl from '@openpgp/tweetnacl/nacl-fast-light.js';\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","// 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 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';\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 EdDSA signatures:\n // - MPI of an EC point r.\n // - EdDSA value s, in MPI, in the little endian representation\n case enums.publicKey.eddsa: {\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 default:\n throw new Error('Invalid 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.Curve(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.eddsa: {\n const { oid, Q } = publicParams;\n // signature already padded on parsing\n return publicKey.elliptic.eddsa.verify(oid, hashAlgo, signature, data, Q, hashed);\n }\n default:\n throw new Error('Invalid 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.eddsa: {\n const { oid, Q } = publicKeyParams;\n const { seed } = privateKeyParams;\n return publicKey.elliptic.eddsa.sign(oid, hashAlgo, data, Q, seed, hashed);\n }\n default:\n throw new Error('Invalid 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\n *\n * @module type/ecdh_symkey\n * @private\n */\n\nimport util from '../util';\n\nclass ECDHSymmetricKey {\n constructor(data) {\n if (typeof data === 'undefined') {\n data = new Uint8Array([]);\n } else if (util.isString(data)) {\n data = util.stringToUint8Array(data);\n } else {\n data = new Uint8Array(data);\n }\n this.data = data;\n }\n\n /**\n * Read an ECDHSymmetricKey from an Uint8Array\n * @param {Uint8Array} input - Where to read the encoded symmetric key 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.data = input.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} An array containing the value\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\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 Error('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","// 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 * as cipher from './cipher';\nimport { getRandomBytes } from './random';\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 { Curve } from './public_key/elliptic/curves';\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} algo - Public key algorithm\n * @param {Object} publicParams - Algorithm-specific public key parameters\n * @param {Uint8Array} data - 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(algo, publicParams, data, fingerprint) {\n switch (algo) {\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 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 * @returns {Promise<Uint8Array>} Decrypted data.\n * @async\n */\nexport async function publicKeyDecrypt(algo, publicKeyParams, privateKeyParams, sessionKeyParams, fingerprint) {\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);\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);\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 default:\n throw new Error('Invalid 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 const Q = util.readMPI(bytes.subarray(read)); read += Q.length + 2;\n return { read: read, publicParams: { oid, Q } };\n }\n case enums.publicKey.eddsa: {\n const oid = new OID(); read += oid.read(bytes);\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 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 default:\n throw new Error('Invalid 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 Curve(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.eddsa: {\n let seed = util.readMPI(bytes.subarray(read)); read += seed.length + 2;\n seed = util.leftPad(seed, 32);\n return { read, privateParams: { seed } };\n }\n default:\n throw new Error('Invalid 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 default:\n throw new Error('Invalid 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 const orderedParams = Object.keys(params).map(name => {\n const param = params[name];\n return util.isUint8Array(param) ? util.uint8ArrayToMPI(param) : param.write();\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.eddsa:\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.dsa:\n case enums.publicKey.elgamal:\n throw new Error('Unsupported algorithm for key generation.');\n default:\n throw new Error('Invalid 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.eddsa: {\n const { oid, Q } = publicParams;\n const { seed } = privateParams;\n return publicKey.elliptic.eddsa.validateParams(oid, Q, seed);\n }\n default:\n throw new Error('Invalid 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 prefixrandom = await getRandomBytes(cipher[algo].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 {Promise<Uint8Array>} Random bytes as a string to be used as a key.\n * @async\n */\nexport function generateSessionKey(algo) {\n return getRandomBytes(cipher[algo].keySize);\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/* 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// (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// 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 comment or Z_NULL */\n this.comment = '';\n /* space at comment (only when reading header) */\n // this.comm_max = 0;\n /* true if there was or will be a header crc */\n this.hcrc = 0;\n /* true when done reading gzip header (not used when writing a gzip file) */\n this.done = false;\n }\n}","'use strict';\n\nimport * as zlib_inflate from \"./zlib/inflate.js\";\nimport * as utils from \"./utils/common.js\";\nimport * as strings from \"./utils/strings.js\";\nimport * as c from \"./zlib/constants.js\";\nimport msg from \"./zlib/messages.js\";\nimport ZStream from \"./zlib/zstream.js\";\nimport GZheader from \"./zlib/gzheader.js\";\n\n/**\n * class Inflate\n *\n * Generic JS-style wrapper for zlib calls. If you don't need\n * streaming behaviour - use more simple functions: [[inflate]]\n * and [[inflateRaw]].\n **/\n\n/* internal\n * inflate.chunks -> Array\n *\n * Chunks of output data, if [[Inflate#onData]] not overridden.\n **/\n\n/**\n * Inflate.result -> Uint8Array|Array|String\n *\n * Uncompressed result, generated by default [[Inflate#onData]]\n * and [[Inflate#onEnd]] handlers. Filled after you push last chunk\n * (call [[Inflate#push]] with `Z_FINISH` / `true` param) or if you\n * push a chunk with explicit flush (call [[Inflate#push]] with\n * `Z_SYNC_FLUSH` param).\n **/\n\n/**\n * Inflate.err -> Number\n *\n * Error code after inflate finished. 0 (Z_OK) on success.\n * Should be checked if broken data possible.\n **/\n\n/**\n * Inflate.msg -> String\n *\n * Error message, if [[Inflate.err]] != 0\n **/\n\n\n/**\n * new Inflate(options)\n * - options (Object): zlib inflate options.\n *\n * Creates new inflator instance with specified params. Throws exception\n * on bad params. Supported options:\n *\n * - `windowBits`\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 inflate\n * - `to` (String) - if equal to 'string', then result will be converted\n * from utf8 to utf16 (javascript) string. When string output requested,\n * chunk length can differ from `chunkSize`, depending on content.\n *\n * By default, when no options set, autodetect deflate/gzip data format via\n * wrapper header.\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 inflate = new pako.Inflate({ level: 3});\n *\n * inflate.push(chunk1, false);\n * inflate.push(chunk2, true); // true -> last chunk\n *\n * if (inflate.err) { throw new Error(inflate.err); }\n *\n * console.log(inflate.result);\n * ```\n **/\nclass Inflate {\n constructor(options) {\n this.options = {\n chunkSize: 16384,\n windowBits: 0,\n ...(options || {})\n };\n\n const opt = this.options;\n\n // Force window size for `raw` data, if not set directly,\n // because we have no header for autodetect.\n if (opt.raw && (opt.windowBits >= 0) && (opt.windowBits < 16)) {\n opt.windowBits = -opt.windowBits;\n if (opt.windowBits === 0) { opt.windowBits = -15; }\n }\n\n // If `windowBits` not defined (and mode not raw) - set autodetect flag for gzip/deflate\n if ((opt.windowBits >= 0) && (opt.windowBits < 16) &&\n !(options && options.windowBits)) {\n opt.windowBits += 32;\n }\n\n // Gzip header has no info about windows size, we can do autodetect only\n // for deflate. So, if window size not set, force it to max when gzip possible\n if ((opt.windowBits > 15) && (opt.windowBits < 48)) {\n // bit 3 (16) -> gzipped data\n // bit 4 (32) -> autodetect gzip/deflate\n if ((opt.windowBits & 15) === 0) {\n opt.windowBits |= 15;\n }\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 let status = zlib_inflate.inflateInit2(\n this.strm,\n opt.windowBits\n );\n\n if (status !== c.Z_OK) {\n throw new Error(msg[status]);\n }\n\n this.header = new GZheader();\n\n zlib_inflate.inflateGetHeader(this.strm, this.header);\n\n // Setup dictionary\n if (opt.dictionary) {\n // Convert data if needed\n if (typeof opt.dictionary === 'string') {\n opt.dictionary = strings.string2buf(opt.dictionary);\n } else if (opt.dictionary instanceof ArrayBuffer) {\n opt.dictionary = new Uint8Array(opt.dictionary);\n }\n if (opt.raw) { //In raw mode we need to set the dictionary early\n status = zlib_inflate.inflateSetDictionary(this.strm, opt.dictionary);\n if (status !== c.Z_OK) {\n throw new Error(msg[status]);\n }\n }\n }\n }\n /**\n * Inflate#push(data[, mode]) -> Boolean\n * - data (Uint8Array|Array|ArrayBuffer|String): input data\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 inflate pipe, generating [[Inflate#onData]] calls with\n * new output 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 * [[Inflate#onEnd]]. For interim explicit flushes (without ending the stream) you\n * can use mode Z_SYNC_FLUSH, keeping the decompression context.\n *\n * On fail call [[Inflate#onEnd]] with error code and return false.\n *\n * We strongly recommend to use `Uint8Array` on input for best speed (output\n * 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, dictionary } } = this;\n let status, _mode;\n let next_out_utf8, tail, utf8str;\n\n // Flag to properly process Z_BUF_ERROR on testing inflate call\n // when we check that all output data was flushed.\n let allowBufError = false;\n\n if (this.ended) { return false; }\n _mode = (mode === ~~mode) ? mode : ((mode === true) ? c.Z_FINISH : c.Z_NO_FLUSH);\n\n // Convert data if needed\n if (typeof data === 'string') {\n // Only binary strings can be decompressed on practice\n strm.input = strings.binstring2buf(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\n status = zlib_inflate.inflate(strm, c.Z_NO_FLUSH); /* no bad return value */\n\n if (status === c.Z_NEED_DICT && dictionary) {\n status = zlib_inflate.inflateSetDictionary(this.strm, dictionary);\n }\n\n if (status === c.Z_BUF_ERROR && allowBufError === true) {\n status = c.Z_OK;\n allowBufError = false;\n }\n\n if (status !== c.Z_STREAM_END && status !== c.Z_OK) {\n this.onEnd(status);\n this.ended = true;\n return false;\n }\n\n if (strm.next_out) {\n if (strm.avail_out === 0 || status === c.Z_STREAM_END || (strm.avail_in === 0 && (_mode === c.Z_FINISH || _mode === c.Z_SYNC_FLUSH))) {\n this.onData(utils.shrinkBuf(strm.output, strm.next_out));\n }\n }\n\n // When no more input data, we should check that internal inflate buffers\n // are flushed. The only way to do it when avail_out = 0 - run one more\n // inflate pass. But if output data not exists, inflate return Z_BUF_ERROR.\n // Here we set flag to process this error properly.\n //\n // NOTE. Deflate does not return error in this case and does not needs such\n // logic.\n if (strm.avail_in === 0 && strm.avail_out === 0) {\n allowBufError = true;\n }\n\n } while ((strm.avail_in > 0 || strm.avail_out === 0) && status !== c.Z_STREAM_END);\n\n if (status === c.Z_STREAM_END) {\n _mode = c.Z_FINISH;\n }\n\n // Finalize on the last chunk.\n if (_mode === c.Z_FINISH) {\n status = zlib_inflate.inflateEnd(this.strm);\n this.onEnd(status);\n this.ended = true;\n return status === c.Z_OK;\n }\n\n // callback interim results if Z_SYNC_FLUSH.\n if (_mode === c.Z_SYNC_FLUSH) {\n this.onEnd(c.Z_OK);\n strm.avail_out = 0;\n return true;\n }\n\n return true;\n };\n\n /**\n * Inflate#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\n /**\n * Inflate#onEnd(status) -> Void\n * - status (Number): inflate status. 0 (Z_OK) on success,\n * other if not.\n *\n * Called either after you tell inflate 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 === c.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 * inflate(data[, options]) -> Uint8Array|Array|String\n * - data (Uint8Array|Array|String): input data to decompress.\n * - options (Object): zlib inflate options.\n *\n * Decompress `data` with inflate/ungzip and `options`. Autodetect\n * format via wrapper header by default. That's why we don't provide\n * separate `ungzip` method.\n *\n * Supported options are:\n *\n * - windowBits\n *\n * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)\n * for more information.\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 converted\n * from utf8 to utf16 (javascript) string. When string output requested,\n * chunk length can differ from `chunkSize`, depending on content.\n *\n *\n * ##### Example:\n *\n * ```javascript\n * var pako = require('pako')\n * , input = pako.deflate([1,2,3,4,5,6,7,8,9])\n * , output;\n *\n * try {\n * output = pako.inflate(input);\n * } catch (err)\n * console.log(err);\n * }\n * ```\n **/\nfunction inflate(input, options) {\n const inflator = new Inflate(options);\n\n inflator.push(input, true);\n\n // That will never happens, if you don't cheat with options :)\n if (inflator.err) { throw new Error(inflator.msg || msg[inflator.err]); }\n\n return inflator.result;\n}\n\n\n/**\n * inflateRaw(data[, options]) -> Uint8Array|Array|String\n * - data (Uint8Array|Array|String): input data to decompress.\n * - options (Object): zlib inflate options.\n *\n * The same as [[inflate]], but creates raw data, without wrapper\n * (header and adler32 crc).\n **/\nfunction inflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return inflate(input, options);\n}\n\n\n/**\n * ungzip(data[, options]) -> Uint8Array|Array|String\n * - data (Uint8Array|Array|String): input data to decompress.\n * - options (Object): zlib inflate options.\n *\n * Just shortcut to [[inflate]], because it autodetects format\n * by header.content. Done for convenience.\n **/\n\nexport { Inflate, inflate, inflateRaw, inflate as ungzip };\n","/*\nnode-bzip - a pure-javascript Node.JS module for decoding bzip2 data\n\nCopyright (C) 2012 Eli Skeggs\n\nThis library is free software; you can redistribute it and/or\nmodify it under the terms of the GNU Lesser General Public\nLicense as published by the Free Software Foundation; either\nversion 2.1 of the License, or (at your option) any later version.\n\nThis library is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\nLesser General Public License for more details.\n\nYou should have received a copy of the GNU Lesser General Public\nLicense along with this library; if not, see\nhttp://www.gnu.org/licenses/lgpl-2.1.html\n\nAdapted from bzip2.js, copyright 2011 antimatter15 (antimatter15@gmail.com).\n\nBased on micro-bunzip by Rob Landley (rob@landley.net).\n\nBased on bzip2 decompression code by Julian R Seward (jseward@acm.org),\nwhich also acknowledges contributions by Mike Burrows, David Wheeler,\nPeter Fenwick, Alistair Moffat, Radford Neal, Ian H. Witten,\nRobert Sedgewick, and Jon L. Bentley.\n*/\n\nvar BITMASK = [0x00, 0x01, 0x03, 0x07, 0x0F, 0x1F, 0x3F, 0x7F, 0xFF];\n\n// offset in bytes\nvar BitReader = function(stream) {\n this.stream = stream;\n this.bitOffset = 0;\n this.curByte = 0;\n this.hasByte = false;\n};\n\nBitReader.prototype._ensureByte = function() {\n if (!this.hasByte) {\n this.curByte = this.stream.readByte();\n this.hasByte = true;\n }\n};\n\n// reads bits from the buffer\nBitReader.prototype.read = function(bits) {\n var result = 0;\n while (bits > 0) {\n this._ensureByte();\n var remaining = 8 - this.bitOffset;\n // if we're in a byte\n if (bits >= remaining) {\n result <<= remaining;\n result |= BITMASK[remaining] & this.curByte;\n this.hasByte = false;\n this.bitOffset = 0;\n bits -= remaining;\n } else {\n result <<= bits;\n var shift = remaining - bits;\n result |= (this.curByte & (BITMASK[bits] << shift)) >> shift;\n this.bitOffset += bits;\n bits = 0;\n }\n }\n return result;\n};\n\n// seek to an arbitrary point in the buffer (expressed in bits)\nBitReader.prototype.seek = function(pos) {\n var n_bit = pos % 8;\n var n_byte = (pos - n_bit) / 8;\n this.bitOffset = n_bit;\n this.stream.seek(n_byte);\n this.hasByte = false;\n};\n\n// reads 6 bytes worth of data using the read method\nBitReader.prototype.pi = function() {\n var buf = new Uint8Array(6), i;\n for (i = 0; i < buf.length; i++) {\n buf[i] = this.read(8);\n }\n return bufToHex(buf);\n};\n\nfunction bufToHex(buf) {\n return Array.prototype.map.call(buf, x => ('00' + x.toString(16)).slice(-2)).join('');\n}\n\nmodule.exports = BitReader;\n","/* very simple input/output stream interface */\nvar Stream = function() {\n};\n\n// input streams //////////////\n/** Returns the next byte, or -1 for EOF. */\nStream.prototype.readByte = function() {\n throw new Error(\"abstract method readByte() not implemented\");\n};\n/** Attempts to fill the buffer; returns number of bytes read, or\n * -1 for EOF. */\nStream.prototype.read = function(buffer, bufOffset, length) {\n var bytesRead = 0;\n while (bytesRead < length) {\n var c = this.readByte();\n if (c < 0) { // EOF\n return (bytesRead===0) ? -1 : bytesRead;\n }\n buffer[bufOffset++] = c;\n bytesRead++;\n }\n return bytesRead;\n};\nStream.prototype.seek = function(new_pos) {\n throw new Error(\"abstract method seek() not implemented\");\n};\n\n// output streams ///////////\nStream.prototype.writeByte = function(_byte) {\n throw new Error(\"abstract method readByte() not implemented\");\n};\nStream.prototype.write = function(buffer, bufOffset, length) {\n var i;\n for (i=0; i<length; i++) {\n this.writeByte(buffer[bufOffset++]);\n }\n return length;\n};\nStream.prototype.flush = function() {\n};\n\nmodule.exports = Stream;\n","/* CRC32, used in Bzip2 implementation.\n * This is a port of CRC32.java from the jbzip2 implementation at\n * https://code.google.com/p/jbzip2\n * which is:\n * Copyright (c) 2011 Matthew Francis\n *\n * Permission is hereby granted, free of charge, to any person\n * obtaining a copy of this software and associated documentation\n * files (the \"Software\"), to deal in the Software without\n * restriction, including without limitation the rights to use,\n * copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following\n * conditions:\n *\n * The above copyright notice and this permission notice shall be\n * included in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n * OTHER DEALINGS IN THE SOFTWARE.\n * This JavaScript implementation is:\n * Copyright (c) 2013 C. Scott Ananian\n * with the same licensing terms as Matthew Francis' original implementation.\n */\nmodule.exports = (function() {\n\n /**\n * A static CRC lookup table\n */\n var crc32Lookup = new Uint32Array([\n 0x00000000, 0x04c11db7, 0x09823b6e, 0x0d4326d9, 0x130476dc, 0x17c56b6b, 0x1a864db2, 0x1e475005,\n 0x2608edb8, 0x22c9f00f, 0x2f8ad6d6, 0x2b4bcb61, 0x350c9b64, 0x31cd86d3, 0x3c8ea00a, 0x384fbdbd,\n 0x4c11db70, 0x48d0c6c7, 0x4593e01e, 0x4152fda9, 0x5f15adac, 0x5bd4b01b, 0x569796c2, 0x52568b75,\n 0x6a1936c8, 0x6ed82b7f, 0x639b0da6, 0x675a1011, 0x791d4014, 0x7ddc5da3, 0x709f7b7a, 0x745e66cd,\n 0x9823b6e0, 0x9ce2ab57, 0x91a18d8e, 0x95609039, 0x8b27c03c, 0x8fe6dd8b, 0x82a5fb52, 0x8664e6e5,\n 0xbe2b5b58, 0xbaea46ef, 0xb7a96036, 0xb3687d81, 0xad2f2d84, 0xa9ee3033, 0xa4ad16ea, 0xa06c0b5d,\n 0xd4326d90, 0xd0f37027, 0xddb056fe, 0xd9714b49, 0xc7361b4c, 0xc3f706fb, 0xceb42022, 0xca753d95,\n 0xf23a8028, 0xf6fb9d9f, 0xfbb8bb46, 0xff79a6f1, 0xe13ef6f4, 0xe5ffeb43, 0xe8bccd9a, 0xec7dd02d,\n 0x34867077, 0x30476dc0, 0x3d044b19, 0x39c556ae, 0x278206ab, 0x23431b1c, 0x2e003dc5, 0x2ac12072,\n 0x128e9dcf, 0x164f8078, 0x1b0ca6a1, 0x1fcdbb16, 0x018aeb13, 0x054bf6a4, 0x0808d07d, 0x0cc9cdca,\n 0x7897ab07, 0x7c56b6b0, 0x71159069, 0x75d48dde, 0x6b93dddb, 0x6f52c06c, 0x6211e6b5, 0x66d0fb02,\n 0x5e9f46bf, 0x5a5e5b08, 0x571d7dd1, 0x53dc6066, 0x4d9b3063, 0x495a2dd4, 0x44190b0d, 0x40d816ba,\n 0xaca5c697, 0xa864db20, 0xa527fdf9, 0xa1e6e04e, 0xbfa1b04b, 0xbb60adfc, 0xb6238b25, 0xb2e29692,\n 0x8aad2b2f, 0x8e6c3698, 0x832f1041, 0x87ee0df6, 0x99a95df3, 0x9d684044, 0x902b669d, 0x94ea7b2a,\n 0xe0b41de7, 0xe4750050, 0xe9362689, 0xedf73b3e, 0xf3b06b3b, 0xf771768c, 0xfa325055, 0xfef34de2,\n 0xc6bcf05f, 0xc27dede8, 0xcf3ecb31, 0xcbffd686, 0xd5b88683, 0xd1799b34, 0xdc3abded, 0xd8fba05a,\n 0x690ce0ee, 0x6dcdfd59, 0x608edb80, 0x644fc637, 0x7a089632, 0x7ec98b85, 0x738aad5c, 0x774bb0eb,\n 0x4f040d56, 0x4bc510e1, 0x46863638, 0x42472b8f, 0x5c007b8a, 0x58c1663d, 0x558240e4, 0x51435d53,\n 0x251d3b9e, 0x21dc2629, 0x2c9f00f0, 0x285e1d47, 0x36194d42, 0x32d850f5, 0x3f9b762c, 0x3b5a6b9b,\n 0x0315d626, 0x07d4cb91, 0x0a97ed48, 0x0e56f0ff, 0x1011a0fa, 0x14d0bd4d, 0x19939b94, 0x1d528623,\n 0xf12f560e, 0xf5ee4bb9, 0xf8ad6d60, 0xfc6c70d7, 0xe22b20d2, 0xe6ea3d65, 0xeba91bbc, 0xef68060b,\n 0xd727bbb6, 0xd3e6a601, 0xdea580d8, 0xda649d6f, 0xc423cd6a, 0xc0e2d0dd, 0xcda1f604, 0xc960ebb3,\n 0xbd3e8d7e, 0xb9ff90c9, 0xb4bcb610, 0xb07daba7, 0xae3afba2, 0xaafbe615, 0xa7b8c0cc, 0xa379dd7b,\n 0x9b3660c6, 0x9ff77d71, 0x92b45ba8, 0x9675461f, 0x8832161a, 0x8cf30bad, 0x81b02d74, 0x857130c3,\n 0x5d8a9099, 0x594b8d2e, 0x5408abf7, 0x50c9b640, 0x4e8ee645, 0x4a4ffbf2, 0x470cdd2b, 0x43cdc09c,\n 0x7b827d21, 0x7f436096, 0x7200464f, 0x76c15bf8, 0x68860bfd, 0x6c47164a, 0x61043093, 0x65c52d24,\n 0x119b4be9, 0x155a565e, 0x18197087, 0x1cd86d30, 0x029f3d35, 0x065e2082, 0x0b1d065b, 0x0fdc1bec,\n 0x3793a651, 0x3352bbe6, 0x3e119d3f, 0x3ad08088, 0x2497d08d, 0x2056cd3a, 0x2d15ebe3, 0x29d4f654,\n 0xc5a92679, 0xc1683bce, 0xcc2b1d17, 0xc8ea00a0, 0xd6ad50a5, 0xd26c4d12, 0xdf2f6bcb, 0xdbee767c,\n 0xe3a1cbc1, 0xe760d676, 0xea23f0af, 0xeee2ed18, 0xf0a5bd1d, 0xf464a0aa, 0xf9278673, 0xfde69bc4,\n 0x89b8fd09, 0x8d79e0be, 0x803ac667, 0x84fbdbd0, 0x9abc8bd5, 0x9e7d9662, 0x933eb0bb, 0x97ffad0c,\n 0xafb010b1, 0xab710d06, 0xa6322bdf, 0xa2f33668, 0xbcb4666d, 0xb8757bda, 0xb5365d03, 0xb1f740b4\n ]);\n\n var CRC32 = function() {\n /**\n * The current CRC\n */\n var crc = 0xffffffff;\n\n /**\n * @return The current CRC\n */\n this.getCRC = function() {\n return (~crc) >>> 0; // return an unsigned value\n };\n\n /**\n * Update the CRC with a single byte\n * @param value The value to update the CRC with\n */\n this.updateCRC = function(value) {\n crc = (crc << 8) ^ crc32Lookup[((crc >>> 24) ^ value) & 0xff];\n };\n\n /**\n * Update the CRC with a sequence of identical bytes\n * @param value The value to update the CRC with\n * @param count The number of bytes\n */\n this.updateCRCRun = function(value, count) {\n while (count-- > 0) {\n crc = (crc << 8) ^ crc32Lookup[((crc >>> 24) ^ value) & 0xff];\n }\n };\n };\n return CRC32;\n})();\n","/*\nseek-bzip - a pure-javascript module for seeking within bzip2 data\n\nCopyright (C) 2013 C. Scott Ananian\nCopyright (C) 2012 Eli Skeggs\nCopyright (C) 2011 Kevin Kwok\n\nThis library is free software; you can redistribute it and/or\nmodify it under the terms of the GNU Lesser General Public\nLicense as published by the Free Software Foundation; either\nversion 2.1 of the License, or (at your option) any later version.\n\nThis library is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\nLesser General Public License for more details.\n\nYou should have received a copy of the GNU Lesser General Public\nLicense along with this library; if not, see\nhttp://www.gnu.org/licenses/lgpl-2.1.html\n\nAdapted from node-bzip, copyright 2012 Eli Skeggs.\nAdapted from bzip2.js, copyright 2011 Kevin Kwok (antimatter15@gmail.com).\n\nBased on micro-bunzip by Rob Landley (rob@landley.net).\n\nBased on bzip2 decompression code by Julian R Seward (jseward@acm.org),\nwhich also acknowledges contributions by Mike Burrows, David Wheeler,\nPeter Fenwick, Alistair Moffat, Radford Neal, Ian H. Witten,\nRobert Sedgewick, and Jon L. Bentley.\n*/\n\nvar BitReader = require('./bitreader');\nvar Stream = require('./stream');\nvar CRC32 = require('./crc32');\n\nvar MAX_HUFCODE_BITS = 20;\nvar MAX_SYMBOLS = 258;\nvar SYMBOL_RUNA = 0;\nvar SYMBOL_RUNB = 1;\nvar MIN_GROUPS = 2;\nvar MAX_GROUPS = 6;\nvar GROUP_SIZE = 50;\n\nvar WHOLEPI = \"314159265359\";\nvar SQRTPI = \"177245385090\";\n\nvar mtf = function(array, index) {\n var src = array[index], i;\n for (i = index; i > 0; i--) {\n array[i] = array[i-1];\n }\n array[0] = src;\n return src;\n};\n\nvar Err = {\n OK: 0,\n LAST_BLOCK: -1,\n NOT_BZIP_DATA: -2,\n UNEXPECTED_INPUT_EOF: -3,\n UNEXPECTED_OUTPUT_EOF: -4,\n DATA_ERROR: -5,\n OUT_OF_MEMORY: -6,\n OBSOLETE_INPUT: -7,\n END_OF_BLOCK: -8\n};\nvar ErrorMessages = {};\nErrorMessages[Err.LAST_BLOCK] = \"Bad file checksum\";\nErrorMessages[Err.NOT_BZIP_DATA] = \"Not bzip data\";\nErrorMessages[Err.UNEXPECTED_INPUT_EOF] = \"Unexpected input EOF\";\nErrorMessages[Err.UNEXPECTED_OUTPUT_EOF] = \"Unexpected output EOF\";\nErrorMessages[Err.DATA_ERROR] = \"Data error\";\nErrorMessages[Err.OUT_OF_MEMORY] = \"Out of memory\";\nErrorMessages[Err.OBSOLETE_INPUT] = \"Obsolete (pre 0.9.5) bzip format not supported.\";\n\nvar _throw = function(status, optDetail) {\n var msg = ErrorMessages[status] || 'unknown error';\n if (optDetail) { msg += ': '+optDetail; }\n var e = new TypeError(msg);\n e.errorCode = status;\n throw e;\n};\n\nvar Bunzip = function(inputStream, outputStream) {\n this.writePos = this.writeCurrent = this.writeCount = 0;\n\n this._start_bunzip(inputStream, outputStream);\n};\nBunzip.prototype._init_block = function() {\n var moreBlocks = this._get_next_block();\n if ( !moreBlocks ) {\n this.writeCount = -1;\n return false; /* no more blocks */\n }\n this.blockCRC = new CRC32();\n return true;\n};\n/* XXX micro-bunzip uses (inputStream, inputBuffer, len) as arguments */\nBunzip.prototype._start_bunzip = function(inputStream, outputStream) {\n /* Ensure that file starts with \"BZh['1'-'9'].\" */\n var buf = new Uint8Array(4);\n if (inputStream.read(buf, 0, 4) !== 4 ||\n String.fromCharCode(buf[0], buf[1], buf[2]) !== 'BZh')\n _throw(Err.NOT_BZIP_DATA, 'bad magic');\n\n var level = buf[3] - 0x30;\n if (level < 1 || level > 9)\n _throw(Err.NOT_BZIP_DATA, 'level out of range');\n\n this.reader = new BitReader(inputStream);\n\n /* Fourth byte (ascii '1'-'9'), indicates block size in units of 100k of\n uncompressed data. Allocate intermediate buffer for block. */\n this.dbufSize = 100000 * level;\n this.nextoutput = 0;\n this.outputStream = outputStream;\n this.streamCRC = 0;\n};\nBunzip.prototype._get_next_block = function() {\n var i, j, k;\n var reader = this.reader;\n // this is get_next_block() function from micro-bunzip:\n /* Read in header signature and CRC, then validate signature.\n (last block signature means CRC is for whole file, return now) */\n var h = reader.pi();\n if (h === SQRTPI) { // last block\n return false; /* no more blocks */\n }\n if (h !== WHOLEPI)\n _throw(Err.NOT_BZIP_DATA);\n this.targetBlockCRC = reader.read(32) >>> 0; // (convert to unsigned)\n this.streamCRC = (this.targetBlockCRC ^\n ((this.streamCRC << 1) | (this.streamCRC>>>31))) >>> 0;\n /* We can add support for blockRandomised if anybody complains. There was\n some code for this in busybox 1.0.0-pre3, but nobody ever noticed that\n it didn't actually work. */\n if (reader.read(1))\n _throw(Err.OBSOLETE_INPUT);\n var origPointer = reader.read(24);\n if (origPointer > this.dbufSize)\n _throw(Err.DATA_ERROR, 'initial position out of bounds');\n /* mapping table: if some byte values are never used (encoding things\n like ascii text), the compression code removes the gaps to have fewer\n symbols to deal with, and writes a sparse bitfield indicating which\n values were present. We make a translation table to convert the symbols\n back to the corresponding bytes. */\n var t = reader.read(16);\n var symToByte = new Uint8Array(256), symTotal = 0;\n for (i = 0; i < 16; i++) {\n if (t & (1 << (0xF - i))) {\n var o = i * 16;\n k = reader.read(16);\n for (j = 0; j < 16; j++)\n if (k & (1 << (0xF - j)))\n symToByte[symTotal++] = o + j;\n }\n }\n\n /* How many different huffman coding groups does this block use? */\n var groupCount = reader.read(3);\n if (groupCount < MIN_GROUPS || groupCount > MAX_GROUPS)\n _throw(Err.DATA_ERROR);\n /* nSelectors: Every GROUP_SIZE many symbols we select a new huffman coding\n group. Read in the group selector list, which is stored as MTF encoded\n bit runs. (MTF=Move To Front, as each value is used it's moved to the\n start of the list.) */\n var nSelectors = reader.read(15);\n if (nSelectors === 0)\n _throw(Err.DATA_ERROR);\n\n var mtfSymbol = new Uint8Array(256);\n for (i = 0; i < groupCount; i++)\n mtfSymbol[i] = i;\n\n var selectors = new Uint8Array(nSelectors); // was 32768...\n\n for (i = 0; i < nSelectors; i++) {\n /* Get next value */\n for (j = 0; reader.read(1); j++)\n if (j >= groupCount) _throw(Err.DATA_ERROR);\n /* Decode MTF to get the next selector */\n selectors[i] = mtf(mtfSymbol, j);\n }\n\n /* Read the huffman coding tables for each group, which code for symTotal\n literal symbols, plus two run symbols (RUNA, RUNB) */\n var symCount = symTotal + 2;\n var groups = [], hufGroup;\n for (j = 0; j < groupCount; j++) {\n var length = new Uint8Array(symCount), temp = new Uint16Array(MAX_HUFCODE_BITS + 1);\n /* Read huffman code lengths for each symbol. They're stored in\n a way similar to mtf; record a starting value for the first symbol,\n and an offset from the previous value for everys symbol after that. */\n t = reader.read(5); // lengths\n for (i = 0; i < symCount; i++) {\n for (;;) {\n if (t < 1 || t > MAX_HUFCODE_BITS) _throw(Err.DATA_ERROR);\n /* If first bit is 0, stop. Else second bit indicates whether\n to increment or decrement the value. */\n if(!reader.read(1))\n break;\n if(!reader.read(1))\n t++;\n else\n t--;\n }\n length[i] = t;\n }\n\n /* Find largest and smallest lengths in this group */\n var minLen, maxLen;\n minLen = maxLen = length[0];\n for (i = 1; i < symCount; i++) {\n if (length[i] > maxLen)\n maxLen = length[i];\n else if (length[i] < minLen)\n minLen = length[i];\n }\n\n /* Calculate permute[], base[], and limit[] tables from length[].\n *\n * permute[] is the lookup table for converting huffman coded symbols\n * into decoded symbols. base[] is the amount to subtract from the\n * value of a huffman symbol of a given length when using permute[].\n *\n * limit[] indicates the largest numerical value a symbol with a given\n * number of bits can have. This is how the huffman codes can vary in\n * length: each code with a value>limit[length] needs another bit.\n */\n hufGroup = {};\n groups.push(hufGroup);\n hufGroup.permute = new Uint16Array(MAX_SYMBOLS);\n hufGroup.limit = new Uint32Array(MAX_HUFCODE_BITS + 2);\n hufGroup.base = new Uint32Array(MAX_HUFCODE_BITS + 1);\n hufGroup.minLen = minLen;\n hufGroup.maxLen = maxLen;\n /* Calculate permute[]. Concurently, initialize temp[] and limit[]. */\n var pp = 0;\n for (i = minLen; i <= maxLen; i++) {\n temp[i] = hufGroup.limit[i] = 0;\n for (t = 0; t < symCount; t++)\n if (length[t] === i)\n hufGroup.permute[pp++] = t;\n }\n /* Count symbols coded for at each bit length */\n for (i = 0; i < symCount; i++)\n temp[length[i]]++;\n /* Calculate limit[] (the largest symbol-coding value at each bit\n * length, which is (previous limit<<1)+symbols at this level), and\n * base[] (number of symbols to ignore at each bit length, which is\n * limit minus the cumulative count of symbols coded for already). */\n pp = t = 0;\n for (i = minLen; i < maxLen; i++) {\n pp += temp[i];\n /* We read the largest possible symbol size and then unget bits\n after determining how many we need, and those extra bits could\n be set to anything. (They're noise from future symbols.) At\n each level we're really only interested in the first few bits,\n so here we set all the trailing to-be-ignored bits to 1 so they\n don't affect the value>limit[length] comparison. */\n hufGroup.limit[i] = pp - 1;\n pp <<= 1;\n t += temp[i];\n hufGroup.base[i + 1] = pp - t;\n }\n hufGroup.limit[maxLen + 1] = Number.MAX_VALUE; /* Sentinal value for reading next sym. */\n hufGroup.limit[maxLen] = pp + temp[maxLen] - 1;\n hufGroup.base[minLen] = 0;\n }\n /* We've finished reading and digesting the block header. Now read this\n block's huffman coded symbols from the file and undo the huffman coding\n and run length encoding, saving the result into dbuf[dbufCount++]=uc */\n\n /* Initialize symbol occurrence counters and symbol Move To Front table */\n var byteCount = new Uint32Array(256);\n for (i = 0; i < 256; i++)\n mtfSymbol[i] = i;\n /* Loop through compressed symbols. */\n var runPos = 0, dbufCount = 0, selector = 0, uc;\n var dbuf = this.dbuf = new Uint32Array(this.dbufSize);\n symCount = 0;\n for (;;) {\n /* Determine which huffman coding group to use. */\n if (!(symCount--)) {\n symCount = GROUP_SIZE - 1;\n if (selector >= nSelectors) { _throw(Err.DATA_ERROR); }\n hufGroup = groups[selectors[selector++]];\n }\n /* Read next huffman-coded symbol. */\n i = hufGroup.minLen;\n j = reader.read(i);\n for (;;i++) {\n if (i > hufGroup.maxLen) { _throw(Err.DATA_ERROR); }\n if (j <= hufGroup.limit[i])\n break;\n j = (j << 1) | reader.read(1);\n }\n /* Huffman decode value to get nextSym (with bounds checking) */\n j -= hufGroup.base[i];\n if (j < 0 || j >= MAX_SYMBOLS) { _throw(Err.DATA_ERROR); }\n var nextSym = hufGroup.permute[j];\n /* We have now decoded the symbol, which indicates either a new literal\n byte, or a repeated run of the most recent literal byte. First,\n check if nextSym indicates a repeated run, and if so loop collecting\n how many times to repeat the last literal. */\n if (nextSym === SYMBOL_RUNA || nextSym === SYMBOL_RUNB) {\n /* If this is the start of a new run, zero out counter */\n if (!runPos){\n runPos = 1;\n t = 0;\n }\n /* Neat trick that saves 1 symbol: instead of or-ing 0 or 1 at\n each bit position, add 1 or 2 instead. For example,\n 1011 is 1<<0 + 1<<1 + 2<<2. 1010 is 2<<0 + 2<<1 + 1<<2.\n You can make any bit pattern that way using 1 less symbol than\n the basic or 0/1 method (except all bits 0, which would use no\n symbols, but a run of length 0 doesn't mean anything in this\n context). Thus space is saved. */\n if (nextSym === SYMBOL_RUNA)\n t += runPos;\n else\n t += 2 * runPos;\n runPos <<= 1;\n continue;\n }\n /* When we hit the first non-run symbol after a run, we now know\n how many times to repeat the last literal, so append that many\n copies to our buffer of decoded symbols (dbuf) now. (The last\n literal used is the one at the head of the mtfSymbol array.) */\n if (runPos){\n runPos = 0;\n if (dbufCount + t > this.dbufSize) { _throw(Err.DATA_ERROR); }\n uc = symToByte[mtfSymbol[0]];\n byteCount[uc] += t;\n while (t--)\n dbuf[dbufCount++] = uc;\n }\n /* Is this the terminating symbol? */\n if (nextSym > symTotal)\n break;\n /* At this point, nextSym indicates a new literal character. Subtract\n one to get the position in the MTF array at which this literal is\n currently to be found. (Note that the result can't be -1 or 0,\n because 0 and 1 are RUNA and RUNB. But another instance of the\n first symbol in the mtf array, position 0, would have been handled\n as part of a run above. Therefore 1 unused mtf position minus\n 2 non-literal nextSym values equals -1.) */\n if (dbufCount >= this.dbufSize) { _throw(Err.DATA_ERROR); }\n i = nextSym - 1;\n uc = mtf(mtfSymbol, i);\n uc = symToByte[uc];\n /* We have our literal byte. Save it into dbuf. */\n byteCount[uc]++;\n dbuf[dbufCount++] = uc;\n }\n /* At this point, we've read all the huffman-coded symbols (and repeated\n runs) for this block from the input stream, and decoded them into the\n intermediate buffer. There are dbufCount many decoded bytes in dbuf[].\n Now undo the Burrows-Wheeler transform on dbuf.\n See http://dogma.net/markn/articles/bwt/bwt.htm\n */\n if (origPointer < 0 || origPointer >= dbufCount) { _throw(Err.DATA_ERROR); }\n /* Turn byteCount into cumulative occurrence counts of 0 to n-1. */\n j = 0;\n for (i = 0; i < 256; i++) {\n k = j + byteCount[i];\n byteCount[i] = j;\n j = k;\n }\n /* Figure out what order dbuf would be in if we sorted it. */\n for (i = 0; i < dbufCount; i++) {\n uc = dbuf[i] & 0xff;\n dbuf[byteCount[uc]] |= (i << 8);\n byteCount[uc]++;\n }\n /* Decode first byte by hand to initialize \"previous\" byte. Note that it\n doesn't get output, and if the first three characters are identical\n it doesn't qualify as a run (hence writeRunCountdown=5). */\n var pos = 0, current = 0, run = 0;\n if (dbufCount) {\n pos = dbuf[origPointer];\n current = (pos & 0xff);\n pos >>= 8;\n run = -1;\n }\n this.writePos = pos;\n this.writeCurrent = current;\n this.writeCount = dbufCount;\n this.writeRun = run;\n\n return true; /* more blocks to come */\n};\n/* Undo burrows-wheeler transform on intermediate buffer to produce output.\n If start_bunzip was initialized with out_fd=-1, then up to len bytes of\n data are written to outbuf. Return value is number of bytes written or\n error (all errors are negative numbers). If out_fd!=-1, outbuf and len\n are ignored, data is written to out_fd and return is RETVAL_OK or error.\n*/\nBunzip.prototype._read_bunzip = function(outputBuffer, len) {\n var copies, previous, outbyte;\n /* james@jamestaylor.org: writeCount goes to -1 when the buffer is fully\n decoded, which results in this returning RETVAL_LAST_BLOCK, also\n equal to -1... Confusing, I'm returning 0 here to indicate no\n bytes written into the buffer */\n if (this.writeCount < 0) { return 0; }\n\n var gotcount = 0;\n var dbuf = this.dbuf, pos = this.writePos, current = this.writeCurrent;\n var dbufCount = this.writeCount, outputsize = this.outputsize;\n var run = this.writeRun;\n\n while (dbufCount) {\n dbufCount--;\n previous = current;\n pos = dbuf[pos];\n current = pos & 0xff;\n pos >>= 8;\n if (run++ === 3){\n copies = current;\n outbyte = previous;\n current = -1;\n } else {\n copies = 1;\n outbyte = current;\n }\n this.blockCRC.updateCRCRun(outbyte, copies);\n while (copies--) {\n this.outputStream.writeByte(outbyte);\n this.nextoutput++;\n }\n if (current != previous)\n run = 0;\n }\n this.writeCount = dbufCount;\n // check CRC\n if (this.blockCRC.getCRC() !== this.targetBlockCRC) {\n _throw(Err.DATA_ERROR, \"Bad block CRC \"+\n \"(got \"+this.blockCRC.getCRC().toString(16)+\n \" expected \"+this.targetBlockCRC.toString(16)+\")\");\n }\n return this.nextoutput;\n};\n\nvar coerceInputStream = function(input) {\n if ('readByte' in input) { return input; }\n var inputStream = new Stream();\n inputStream.pos = 0;\n inputStream.readByte = function() { return input[this.pos++]; };\n inputStream.seek = function(pos) { this.pos = pos; };\n inputStream.eof = function() { return this.pos >= input.length; };\n return inputStream;\n};\nvar coerceOutputStream = function(output) {\n var outputStream = new Stream();\n var resizeOk = true;\n if (output) {\n if (typeof(output)==='number') {\n outputStream.buffer = new Uint8Array(output);\n resizeOk = false;\n } else if ('writeByte' in output) {\n return output;\n } else {\n outputStream.buffer = output;\n resizeOk = false;\n }\n } else {\n outputStream.buffer = new Uint8Array(16384);\n }\n outputStream.pos = 0;\n outputStream.writeByte = function(_byte) {\n if (resizeOk && this.pos >= this.buffer.length) {\n var newBuffer = new Uint8Array(this.buffer.length*2);\n newBuffer.set(this.buffer);\n this.buffer = newBuffer;\n }\n this.buffer[this.pos++] = _byte;\n };\n outputStream.getBuffer = function() {\n // trim buffer\n if (this.pos !== this.buffer.length) {\n if (!resizeOk)\n throw new TypeError('outputsize does not match decoded input');\n var newBuffer = new Uint8Array(this.pos);\n newBuffer.set(this.buffer.subarray(0, this.pos));\n this.buffer = newBuffer;\n }\n return this.buffer;\n };\n outputStream._coerced = true;\n return outputStream;\n};\n\n/* Static helper functions */\n// 'input' can be a stream or a buffer\n// 'output' can be a stream or a buffer or a number (buffer size)\nconst decode = function(input, output, multistream) {\n // make a stream from a buffer, if necessary\n var inputStream = coerceInputStream(input);\n var outputStream = coerceOutputStream(output);\n\n var bz = new Bunzip(inputStream, outputStream);\n while (true) {\n if ('eof' in inputStream && inputStream.eof()) break;\n if (bz._init_block()) {\n bz._read_bunzip();\n } else {\n var targetStreamCRC = bz.reader.read(32) >>> 0; // (convert to unsigned)\n if (targetStreamCRC !== bz.streamCRC) {\n _throw(Err.DATA_ERROR, \"Bad stream CRC \"+\n \"(got \"+bz.streamCRC.toString(16)+\n \" expected \"+targetStreamCRC.toString(16)+\")\");\n }\n if (multistream &&\n 'eof' in inputStream &&\n !inputStream.eof()) {\n // note that start_bunzip will also resync the bit reader to next byte\n bz._start_bunzip(inputStream, outputStream);\n } else break;\n }\n }\n if ('getBuffer' in outputStream)\n return outputStream.getBuffer();\n};\nconst decodeBlock = function(input, pos, output) {\n // make a stream from a buffer, if necessary\n var inputStream = coerceInputStream(input);\n var outputStream = coerceOutputStream(output);\n var bz = new Bunzip(inputStream, outputStream);\n bz.reader.seek(pos);\n /* Fill the decode buffer for the block */\n var moreBlocks = bz._get_next_block();\n if (moreBlocks) {\n /* Init the CRC for writing */\n bz.blockCRC = new CRC32();\n\n /* Zero this so the current byte from before the seek is not written */\n bz.writeCopies = 0;\n\n /* Decompress the block and write to stdout */\n bz._read_bunzip();\n // XXX keep writing?\n }\n if ('getBuffer' in outputStream)\n return outputStream.getBuffer();\n};\n/* Reads bzip2 file from stream or buffer `input`, and invoke\n * `callback(position, size)` once for each bzip2 block,\n * where position gives the starting position (in *bits*)\n * and size gives uncompressed size of the block (in *bytes*). */\nconst table = function(input, callback, multistream) {\n // make a stream from a buffer, if necessary\n var inputStream = new Stream();\n inputStream.delegate = coerceInputStream(input);\n inputStream.pos = 0;\n inputStream.readByte = function() {\n this.pos++;\n return this.delegate.readByte();\n };\n if (inputStream.delegate.eof) {\n inputStream.eof = inputStream.delegate.eof.bind(inputStream.delegate);\n }\n var outputStream = new Stream();\n outputStream.pos = 0;\n outputStream.writeByte = function() { this.pos++; };\n\n var bz = new Bunzip(inputStream, outputStream);\n var blockSize = bz.dbufSize;\n while (true) {\n if ('eof' in inputStream && inputStream.eof()) break;\n\n var position = inputStream.pos*8 + bz.reader.bitOffset;\n if (bz.reader.hasByte) { position -= 8; }\n\n if (bz._init_block()) {\n var start = outputStream.pos;\n bz._read_bunzip();\n callback(position, outputStream.pos - start);\n } else {\n var crc = bz.reader.read(32); // (but we ignore the crc)\n if (multistream &&\n 'eof' in inputStream &&\n !inputStream.eof()) {\n // note that start_bunzip will also resync the bit reader to next byte\n bz._start_bunzip(inputStream, outputStream);\n console.assert(bz.dbufSize === blockSize,\n \"shouldn't change block size within multistream file\");\n } else break;\n }\n }\n};\n\nmodule.exports = {\n Bunzip,\n Stream,\n Err,\n decode,\n decodeBlock,\n table\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 enums from '../enums';\nimport util from '../util';\n\n/**\n * Implementation of the Literal Data Packet (Tag 11)\n *\n * {@link https://tools.ietf.org/html/rfc4880#section-5.9|RFC4880 5.9}:\n * A Literal Data packet contains the body of a message; data that is not to be\n * further interpreted.\n */\nclass LiteralDataPacket {\n static get tag() {\n return enums.packet.literalData;\n }\n\n /**\n * @param {Date} date - The creation date of the literal package\n */\n constructor(date = new Date()) {\n this.format = 'utf8'; // default format for literal data packets\n this.date = util.normalizeDate(date);\n this.text = null; // textual data representation\n this.data = null; // literal data representation\n this.filename = '';\n }\n\n /**\n * Set the packet data to a javascript native string, end of line\n * will be normalized to \\r\\n and by default text is converted to UTF8\n * @param {String | ReadableStream<String>} text - Any native javascript string\n * @param {utf8|binary|text|mime} [format] - The format of the string of bytes\n */\n setText(text, format = 'utf8') {\n this.format = format;\n this.text = text;\n this.data = null;\n }\n\n /**\n * Returns literal data packets as native JavaScript string\n * with normalized end of line to \\n\n * @param {Boolean} [clone] - Whether to return a clone so that getBytes/getText can be called again\n * @returns {String | ReadableStream<String>} Literal data as text.\n */\n getText(clone = false) {\n if (this.text === null || util.isStream(this.text)) { // Assume that this.text has been read\n this.text = util.decodeUTF8(util.nativeEOL(this.getBytes(clone)));\n }\n return this.text;\n }\n\n /**\n * Set the packet data to value represented by the provided string of bytes.\n * @param {Uint8Array | ReadableStream<Uint8Array>} bytes - The string of bytes\n * @param {utf8|binary|text|mime} format - The format of the string of bytes\n */\n setBytes(bytes, format) {\n this.format = format;\n this.data = bytes;\n this.text = null;\n }\n\n\n /**\n * Get the byte sequence representing the literal packet data\n * @param {Boolean} [clone] - Whether to return a clone so that getBytes/getText can be called again\n * @returns {Uint8Array | ReadableStream<Uint8Array>} A sequence of bytes.\n */\n getBytes(clone = false) {\n if (this.data === null) {\n // encode UTF8 and normalize EOL to \\r\\n\n this.data = util.canonicalizeEOL(util.encodeUTF8(this.text));\n }\n if (clone) {\n return stream.passiveClone(this.data);\n }\n return this.data;\n }\n\n\n /**\n * Sets the filename of the literal packet data\n * @param {String} filename - Any native javascript string\n */\n setFilename(filename) {\n this.filename = filename;\n }\n\n\n /**\n * Get the filename of the literal packet data\n * @returns {String} Filename.\n */\n getFilename() {\n return this.filename;\n }\n\n /**\n * Parsing function for a literal data packet (tag 11).\n *\n * @param {Uint8Array | ReadableStream<Uint8Array>} input - Payload of a tag 11 packet\n * @returns {Promise<LiteralDataPacket>} Object representation.\n * @async\n */\n async read(bytes) {\n await stream.parse(bytes, async reader => {\n // - A one-octet field that describes how the data is formatted.\n const format = enums.read(enums.literal, await reader.readByte());\n\n const filename_len = await reader.readByte();\n this.filename = util.decodeUTF8(await reader.readBytes(filename_len));\n\n this.date = util.readDate(await reader.readBytes(4));\n\n const data = reader.remainder();\n\n this.setBytes(data, format);\n });\n }\n\n /**\n * Creates a Uint8Array representation of the packet, excluding the data\n *\n * @returns {Uint8Array} Uint8Array representation of the packet.\n */\n writeHeader() {\n const filename = util.encodeUTF8(this.filename);\n const filename_length = new Uint8Array([filename.length]);\n\n const format = new Uint8Array([enums.write(enums.literal, this.format)]);\n const date = util.writeDate(this.date);\n\n return util.concatUint8Array([format, filename_length, filename, date]);\n }\n\n /**\n * Creates a Uint8Array representation of the packet\n *\n * @returns {Uint8Array | ReadableStream<Uint8Array>} Uint8Array representation of the packet.\n */\n write() {\n const header = this.writeHeader();\n const data = this.getBytes();\n\n return util.concat([header, data]);\n }\n}\n\nexport default LiteralDataPacket;\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 callback-return */\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 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 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\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 { readSimpleLength, UnsupportedError, writeSimpleLength } from './packet';\nimport KeyID from '../type/keyid.js';\nimport crypto from '../crypto';\nimport enums from '../enums';\nimport util from '../util';\nimport defaultConfig from '../config';\n\n// Symbol to store cryptographic validity of the signature, to avoid recomputing multiple times on verification.\nconst verified = Symbol('verified');\n\n// GPG puts the Issuer and Signature subpackets in the unhashed area.\n// Tampering with those invalidates the signature, so we still trust them and parse them.\n// All other unhashed subpackets are ignored.\nconst allowedUnhashedSubpackets = new Set([\n enums.signatureSubpacket.issuer,\n enums.signatureSubpacket.issuerFingerprint,\n enums.signatureSubpacket.embeddedSignature\n]);\n\n/**\n * Implementation of the Signature Packet (Tag 2)\n *\n * {@link https://tools.ietf.org/html/rfc4880#section-5.2|RFC4480 5.2}:\n * A Signature packet describes a binding between some public key and\n * some data. The most common signatures are a signature of a file or a\n * block of text, and a signature that is a certification of a User ID.\n */\nclass SignaturePacket {\n static get tag() {\n return enums.packet.signature;\n }\n\n constructor() {\n this.version = null;\n this.signatureType = null;\n this.hashAlgorithm = null;\n this.publicKeyAlgorithm = null;\n\n this.signatureData = null;\n this.unhashedSubpackets = [];\n this.signedHashValue = null;\n\n this.created = null;\n this.signatureExpirationTime = null;\n this.signatureNeverExpires = true;\n this.exportable = null;\n this.trustLevel = null;\n this.trustAmount = null;\n this.regularExpression = null;\n this.revocable = null;\n this.keyExpirationTime = null;\n this.keyNeverExpires = null;\n this.preferredSymmetricAlgorithms = null;\n this.revocationKeyClass = null;\n this.revocationKeyAlgorithm = null;\n this.revocationKeyFingerprint = null;\n this.issuerKeyID = new KeyID();\n this.rawNotations = [];\n this.notations = {};\n this.preferredHashAlgorithms = null;\n this.preferredCompressionAlgorithms = null;\n this.keyServerPreferences = null;\n this.preferredKeyServer = null;\n this.isPrimaryUserID = null;\n this.policyURI = null;\n this.keyFlags = null;\n this.signersUserID = null;\n this.reasonForRevocationFlag = null;\n this.reasonForRevocationString = null;\n this.features = null;\n this.signatureTargetPublicKeyAlgorithm = null;\n this.signatureTargetHashAlgorithm = null;\n this.signatureTargetHash = null;\n this.embeddedSignature = null;\n this.issuerKeyVersion = null;\n this.issuerFingerprint = null;\n this.preferredAEADAlgorithms = null;\n\n this.revoked = null;\n this[verified] = null;\n }\n\n /**\n * parsing function for a signature packet (tag 2).\n * @param {String} bytes - Payload of a tag 2 packet\n * @returns {SignaturePacket} Object representation.\n */\n read(bytes) {\n let i = 0;\n this.version = bytes[i++];\n\n if (this.version !== 4 && this.version !== 5) {\n throw new UnsupportedError(`Version ${this.version} of the signature packet is unsupported.`);\n }\n\n this.signatureType = bytes[i++];\n this.publicKeyAlgorithm = bytes[i++];\n this.hashAlgorithm = bytes[i++];\n\n // hashed subpackets\n i += this.readSubPackets(bytes.subarray(i, bytes.length), true);\n if (!this.created) {\n throw new Error('Missing signature creation time subpacket.');\n }\n\n // A V4 signature hashes the packet body\n // starting from its first field, the version number, through the end\n // of the hashed subpacket data. Thus, the fields hashed are the\n // signature version, the signature type, the public-key algorithm, the\n // hash algorithm, the hashed subpacket length, and the hashed\n // subpacket body.\n this.signatureData = bytes.subarray(0, i);\n\n // unhashed subpackets\n i += this.readSubPackets(bytes.subarray(i, bytes.length), false);\n\n // Two-octet field holding left 16 bits of signed hash value.\n this.signedHashValue = bytes.subarray(i, i + 2);\n i += 2;\n\n this.params = crypto.signature.parseSignatureParams(this.publicKeyAlgorithm, bytes.subarray(i, bytes.length));\n }\n\n /**\n * @returns {Uint8Array | ReadableStream<Uint8Array>}\n */\n writeParams() {\n if (this.params instanceof Promise) {\n return stream.fromAsync(\n async () => crypto.serializeParams(this.publicKeyAlgorithm, await this.params)\n );\n }\n return crypto.serializeParams(this.publicKeyAlgorithm, this.params);\n }\n\n write() {\n const arr = [];\n arr.push(this.signatureData);\n arr.push(this.writeUnhashedSubPackets());\n arr.push(this.signedHashValue);\n arr.push(this.writeParams());\n return util.concat(arr);\n }\n\n /**\n * Signs provided data. This needs to be done prior to serialization.\n * @param {SecretKeyPacket} key - Private key used to sign the message.\n * @param {Object} data - Contains packets to be signed.\n * @param {Date} [date] - The signature creation time.\n * @param {Boolean} [detached] - Whether to create a detached signature\n * @throws {Error} if signing failed\n * @async\n */\n async sign(key, data, date = new Date(), detached = false) {\n const signatureType = enums.write(enums.signature, this.signatureType);\n const publicKeyAlgorithm = enums.write(enums.publicKey, this.publicKeyAlgorithm);\n const hashAlgorithm = enums.write(enums.hash, this.hashAlgorithm);\n\n if (key.version === 5) {\n this.version = 5;\n } else {\n this.version = 4;\n }\n const arr = [new Uint8Array([this.version, signatureType, publicKeyAlgorithm, hashAlgorithm])];\n\n this.created = util.normalizeDate(date);\n this.issuerKeyVersion = key.version;\n this.issuerFingerprint = key.getFingerprintBytes();\n this.issuerKeyID = key.getKeyID();\n\n // Add hashed subpackets\n arr.push(this.writeHashedSubPackets());\n\n this.signatureData = util.concat(arr);\n\n const toHash = this.toHash(signatureType, data, detached);\n const hash = await this.hash(signatureType, data, toHash, detached);\n\n this.signedHashValue = stream.slice(stream.clone(hash), 0, 2);\n const signed = async () => crypto.signature.sign(\n publicKeyAlgorithm, hashAlgorithm, key.publicParams, key.privateParams, toHash, await stream.readToEnd(hash)\n );\n if (util.isStream(hash)) {\n this.params = signed();\n } else {\n this.params = await signed();\n\n // Store the fact that this signature is valid, e.g. for when we call `await\n // getLatestValidSignature(this.revocationSignatures, key, data)` later.\n // Note that this only holds up if the key and data passed to verify are the\n // same as the ones passed to sign.\n this[verified] = true;\n }\n }\n\n /**\n * Creates Uint8Array of bytes of all subpacket data except Issuer and Embedded Signature subpackets\n * @returns {Uint8Array} Subpacket data.\n */\n writeHashedSubPackets() {\n const sub = enums.signatureSubpacket;\n const arr = [];\n let bytes;\n if (this.created === null) {\n throw new Error('Missing signature creation time');\n }\n arr.push(writeSubPacket(sub.signatureCreationTime, util.writeDate(this.created)));\n if (this.signatureExpirationTime !== null) {\n arr.push(writeSubPacket(sub.signatureExpirationTime, util.writeNumber(this.signatureExpirationTime, 4)));\n }\n if (this.exportable !== null) {\n arr.push(writeSubPacket(sub.exportableCertification, new Uint8Array([this.exportable ? 1 : 0])));\n }\n if (this.trustLevel !== null) {\n bytes = new Uint8Array([this.trustLevel, this.trustAmount]);\n arr.push(writeSubPacket(sub.trustSignature, bytes));\n }\n if (this.regularExpression !== null) {\n arr.push(writeSubPacket(sub.regularExpression, this.regularExpression));\n }\n if (this.revocable !== null) {\n arr.push(writeSubPacket(sub.revocable, new Uint8Array([this.revocable ? 1 : 0])));\n }\n if (this.keyExpirationTime !== null) {\n arr.push(writeSubPacket(sub.keyExpirationTime, util.writeNumber(this.keyExpirationTime, 4)));\n }\n if (this.preferredSymmetricAlgorithms !== null) {\n bytes = util.stringToUint8Array(util.uint8ArrayToString(this.preferredSymmetricAlgorithms));\n arr.push(writeSubPacket(sub.preferredSymmetricAlgorithms, bytes));\n }\n if (this.revocationKeyClass !== null) {\n bytes = new Uint8Array([this.revocationKeyClass, this.revocationKeyAlgorithm]);\n bytes = util.concat([bytes, this.revocationKeyFingerprint]);\n arr.push(writeSubPacket(sub.revocationKey, bytes));\n }\n this.rawNotations.forEach(([{ name, value, humanReadable }]) => {\n bytes = [new Uint8Array([humanReadable ? 0x80 : 0, 0, 0, 0])];\n // 2 octets of name length\n bytes.push(util.writeNumber(name.length, 2));\n // 2 octets of value length\n bytes.push(util.writeNumber(value.length, 2));\n bytes.push(util.stringToUint8Array(name));\n bytes.push(value);\n bytes = util.concat(bytes);\n arr.push(writeSubPacket(sub.notationData, bytes));\n });\n if (this.preferredHashAlgorithms !== null) {\n bytes = util.stringToUint8Array(util.uint8ArrayToString(this.preferredHashAlgorithms));\n arr.push(writeSubPacket(sub.preferredHashAlgorithms, bytes));\n }\n if (this.preferredCompressionAlgorithms !== null) {\n bytes = util.stringToUint8Array(util.uint8ArrayToString(this.preferredCompressionAlgorithms));\n arr.push(writeSubPacket(sub.preferredCompressionAlgorithms, bytes));\n }\n if (this.keyServerPreferences !== null) {\n bytes = util.stringToUint8Array(util.uint8ArrayToString(this.keyServerPreferences));\n arr.push(writeSubPacket(sub.keyServerPreferences, bytes));\n }\n if (this.preferredKeyServer !== null) {\n arr.push(writeSubPacket(sub.preferredKeyServer, util.stringToUint8Array(this.preferredKeyServer)));\n }\n if (this.isPrimaryUserID !== null) {\n arr.push(writeSubPacket(sub.primaryUserID, new Uint8Array([this.isPrimaryUserID ? 1 : 0])));\n }\n if (this.policyURI !== null) {\n arr.push(writeSubPacket(sub.policyURI, util.stringToUint8Array(this.policyURI)));\n }\n if (this.keyFlags !== null) {\n bytes = util.stringToUint8Array(util.uint8ArrayToString(this.keyFlags));\n arr.push(writeSubPacket(sub.keyFlags, bytes));\n }\n if (this.signersUserID !== null) {\n arr.push(writeSubPacket(sub.signersUserID, util.stringToUint8Array(this.signersUserID)));\n }\n if (this.reasonForRevocationFlag !== null) {\n bytes = util.stringToUint8Array(String.fromCharCode(this.reasonForRevocationFlag) + this.reasonForRevocationString);\n arr.push(writeSubPacket(sub.reasonForRevocation, bytes));\n }\n if (this.features !== null) {\n bytes = util.stringToUint8Array(util.uint8ArrayToString(this.features));\n arr.push(writeSubPacket(sub.features, bytes));\n }\n if (this.signatureTargetPublicKeyAlgorithm !== null) {\n bytes = [new Uint8Array([this.signatureTargetPublicKeyAlgorithm, this.signatureTargetHashAlgorithm])];\n bytes.push(util.stringToUint8Array(this.signatureTargetHash));\n bytes = util.concat(bytes);\n arr.push(writeSubPacket(sub.signatureTarget, bytes));\n }\n if (this.preferredAEADAlgorithms !== null) {\n bytes = util.stringToUint8Array(util.uint8ArrayToString(this.preferredAEADAlgorithms));\n arr.push(writeSubPacket(sub.preferredAEADAlgorithms, bytes));\n }\n\n const result = util.concat(arr);\n const length = util.writeNumber(result.length, 2);\n\n return util.concat([length, result]);\n }\n\n /**\n * Creates Uint8Array of bytes of Issuer and Embedded Signature subpackets\n * @returns {Uint8Array} Subpacket data.\n */\n writeUnhashedSubPackets() {\n const sub = enums.signatureSubpacket;\n const arr = [];\n let bytes;\n if (!this.issuerKeyID.isNull() && this.issuerKeyVersion !== 5) {\n // If the version of [the] key is greater than 4, this subpacket\n // MUST NOT be included in the signature.\n arr.push(writeSubPacket(sub.issuer, this.issuerKeyID.write()));\n }\n if (this.embeddedSignature !== null) {\n arr.push(writeSubPacket(sub.embeddedSignature, this.embeddedSignature.write()));\n }\n if (this.issuerFingerprint !== null) {\n bytes = [new Uint8Array([this.issuerKeyVersion]), this.issuerFingerprint];\n bytes = util.concat(bytes);\n arr.push(writeSubPacket(sub.issuerFingerprint, bytes));\n }\n this.unhashedSubpackets.forEach(data => {\n arr.push(writeSimpleLength(data.length));\n arr.push(data);\n });\n\n const result = util.concat(arr);\n const length = util.writeNumber(result.length, 2);\n\n return util.concat([length, result]);\n }\n\n // V4 signature sub packets\n readSubPacket(bytes, hashed = true) {\n let mypos = 0;\n\n // The leftmost bit denotes a \"critical\" packet\n const critical = bytes[mypos] & 0x80;\n const type = bytes[mypos] & 0x7F;\n\n if (!hashed && !allowedUnhashedSubpackets.has(type)) {\n this.unhashedSubpackets.push(bytes.subarray(mypos, bytes.length));\n return;\n }\n\n mypos++;\n\n // subpacket type\n switch (type) {\n case enums.signatureSubpacket.signatureCreationTime:\n // Signature Creation Time\n this.created = util.readDate(bytes.subarray(mypos, bytes.length));\n break;\n case enums.signatureSubpacket.signatureExpirationTime: {\n // Signature Expiration Time in seconds\n const seconds = util.readNumber(bytes.subarray(mypos, bytes.length));\n\n this.signatureNeverExpires = seconds === 0;\n this.signatureExpirationTime = seconds;\n\n break;\n }\n case enums.signatureSubpacket.exportableCertification:\n // Exportable Certification\n this.exportable = bytes[mypos++] === 1;\n break;\n case enums.signatureSubpacket.trustSignature:\n // Trust Signature\n this.trustLevel = bytes[mypos++];\n this.trustAmount = bytes[mypos++];\n break;\n case enums.signatureSubpacket.regularExpression:\n // Regular Expression\n this.regularExpression = bytes[mypos];\n break;\n case enums.signatureSubpacket.revocable:\n // Revocable\n this.revocable = bytes[mypos++] === 1;\n break;\n case enums.signatureSubpacket.keyExpirationTime: {\n // Key Expiration Time in seconds\n const seconds = util.readNumber(bytes.subarray(mypos, bytes.length));\n\n this.keyExpirationTime = seconds;\n this.keyNeverExpires = seconds === 0;\n\n break;\n }\n case enums.signatureSubpacket.preferredSymmetricAlgorithms:\n // Preferred Symmetric Algorithms\n this.preferredSymmetricAlgorithms = [...bytes.subarray(mypos, bytes.length)];\n break;\n case enums.signatureSubpacket.revocationKey:\n // Revocation Key\n // (1 octet of class, 1 octet of public-key algorithm ID, 20\n // octets of\n // fingerprint)\n this.revocationKeyClass = bytes[mypos++];\n this.revocationKeyAlgorithm = bytes[mypos++];\n this.revocationKeyFingerprint = bytes.subarray(mypos, mypos + 20);\n break;\n\n case enums.signatureSubpacket.issuer:\n // Issuer\n this.issuerKeyID.read(bytes.subarray(mypos, bytes.length));\n break;\n\n case enums.signatureSubpacket.notationData: {\n // Notation Data\n const humanReadable = !!(bytes[mypos] & 0x80);\n\n // We extract key/value tuple from the byte stream.\n mypos += 4;\n const m = util.readNumber(bytes.subarray(mypos, mypos + 2));\n mypos += 2;\n const n = util.readNumber(bytes.subarray(mypos, mypos + 2));\n mypos += 2;\n\n const name = util.uint8ArrayToString(bytes.subarray(mypos, mypos + m));\n const value = bytes.subarray(mypos + m, mypos + m + n);\n\n this.rawNotations.push({ name, humanReadable, value, critical });\n\n if (humanReadable) {\n this.notations[name] = util.uint8ArrayToString(value);\n }\n break;\n }\n case enums.signatureSubpacket.preferredHashAlgorithms:\n // Preferred Hash Algorithms\n this.preferredHashAlgorithms = [...bytes.subarray(mypos, bytes.length)];\n break;\n case enums.signatureSubpacket.preferredCompressionAlgorithms:\n // Preferred Compression Algorithms\n this.preferredCompressionAlgorithms = [...bytes.subarray(mypos, bytes.length)];\n break;\n case enums.signatureSubpacket.keyServerPreferences:\n // Key Server Preferences\n this.keyServerPreferences = [...bytes.subarray(mypos, bytes.length)];\n break;\n case enums.signatureSubpacket.preferredKeyServer:\n // Preferred Key Server\n this.preferredKeyServer = util.uint8ArrayToString(bytes.subarray(mypos, bytes.length));\n break;\n case enums.signatureSubpacket.primaryUserID:\n // Primary User ID\n this.isPrimaryUserID = bytes[mypos++] !== 0;\n break;\n case enums.signatureSubpacket.policyURI:\n // Policy URI\n this.policyURI = util.uint8ArrayToString(bytes.subarray(mypos, bytes.length));\n break;\n case enums.signatureSubpacket.keyFlags:\n // Key Flags\n this.keyFlags = [...bytes.subarray(mypos, bytes.length)];\n break;\n case enums.signatureSubpacket.signersUserID:\n // Signer's User ID\n this.signersUserID = util.uint8ArrayToString(bytes.subarray(mypos, bytes.length));\n break;\n case enums.signatureSubpacket.reasonForRevocation:\n // Reason for Revocation\n this.reasonForRevocationFlag = bytes[mypos++];\n this.reasonForRevocationString = util.uint8ArrayToString(bytes.subarray(mypos, bytes.length));\n break;\n case enums.signatureSubpacket.features:\n // Features\n this.features = [...bytes.subarray(mypos, bytes.length)];\n break;\n case enums.signatureSubpacket.signatureTarget: {\n // Signature Target\n // (1 octet public-key algorithm, 1 octet hash algorithm, N octets hash)\n this.signatureTargetPublicKeyAlgorithm = bytes[mypos++];\n this.signatureTargetHashAlgorithm = bytes[mypos++];\n\n const len = crypto.getHashByteLength(this.signatureTargetHashAlgorithm);\n\n this.signatureTargetHash = util.uint8ArrayToString(bytes.subarray(mypos, mypos + len));\n break;\n }\n case enums.signatureSubpacket.embeddedSignature:\n // Embedded Signature\n this.embeddedSignature = new SignaturePacket();\n this.embeddedSignature.read(bytes.subarray(mypos, bytes.length));\n break;\n case enums.signatureSubpacket.issuerFingerprint:\n // Issuer Fingerprint\n this.issuerKeyVersion = bytes[mypos++];\n this.issuerFingerprint = bytes.subarray(mypos, bytes.length);\n if (this.issuerKeyVersion === 5) {\n this.issuerKeyID.read(this.issuerFingerprint);\n } else {\n this.issuerKeyID.read(this.issuerFingerprint.subarray(-8));\n }\n break;\n case enums.signatureSubpacket.preferredAEADAlgorithms:\n // Preferred AEAD Algorithms\n this.preferredAEADAlgorithms = [...bytes.subarray(mypos, bytes.length)];\n break;\n default: {\n const err = new Error(`Unknown signature subpacket type ${type}`);\n if (critical) {\n throw err;\n } else {\n util.printDebug(err);\n }\n }\n }\n }\n\n readSubPackets(bytes, trusted = true, config) {\n // Two-octet scalar octet count for following subpacket data.\n const subpacketLength = util.readNumber(bytes.subarray(0, 2));\n\n let i = 2;\n\n // subpacket data set (zero or more subpackets)\n while (i < 2 + subpacketLength) {\n const len = readSimpleLength(bytes.subarray(i, bytes.length));\n i += len.offset;\n\n this.readSubPacket(bytes.subarray(i, i + len.len), trusted, config);\n\n i += len.len;\n }\n\n return i;\n }\n\n // Produces data to produce signature on\n toSign(type, data) {\n const t = enums.signature;\n\n switch (type) {\n case t.binary:\n if (data.text !== null) {\n return util.encodeUTF8(data.getText(true));\n }\n return data.getBytes(true);\n\n case t.text: {\n const bytes = data.getBytes(true);\n // normalize EOL to \\r\\n\n return util.canonicalizeEOL(bytes);\n }\n case t.standalone:\n return new Uint8Array(0);\n\n case t.certGeneric:\n case t.certPersona:\n case t.certCasual:\n case t.certPositive:\n case t.certRevocation: {\n let packet;\n let tag;\n\n if (data.userID) {\n tag = 0xB4;\n packet = data.userID;\n } else if (data.userAttribute) {\n tag = 0xD1;\n packet = data.userAttribute;\n } else {\n throw new Error('Either a userID or userAttribute packet needs to be ' +\n 'supplied for certification.');\n }\n\n const bytes = packet.write();\n\n return util.concat([this.toSign(t.key, data),\n new Uint8Array([tag]),\n util.writeNumber(bytes.length, 4),\n bytes]);\n }\n case t.subkeyBinding:\n case t.subkeyRevocation:\n case t.keyBinding:\n return util.concat([this.toSign(t.key, data), this.toSign(t.key, {\n key: data.bind\n })]);\n\n case t.key:\n if (data.key === undefined) {\n throw new Error('Key packet is required for this signature.');\n }\n return data.key.writeForHash(this.version);\n\n case t.keyRevocation:\n return this.toSign(t.key, data);\n case t.timestamp:\n return new Uint8Array(0);\n case t.thirdParty:\n throw new Error('Not implemented');\n default:\n throw new Error('Unknown signature type.');\n }\n }\n\n calculateTrailer(data, detached) {\n let length = 0;\n return stream.transform(stream.clone(this.signatureData), value => {\n length += value.length;\n }, () => {\n const arr = [];\n if (this.version === 5 && (this.signatureType === enums.signature.binary || this.signatureType === enums.signature.text)) {\n if (detached) {\n arr.push(new Uint8Array(6));\n } else {\n arr.push(data.writeHeader());\n }\n }\n arr.push(new Uint8Array([this.version, 0xFF]));\n if (this.version === 5) {\n arr.push(new Uint8Array(4));\n }\n arr.push(util.writeNumber(length, 4));\n // For v5, this should really be writeNumber(length, 8) rather than the\n // hardcoded 4 zero bytes above\n return util.concat(arr);\n });\n }\n\n toHash(signatureType, data, detached = false) {\n const bytes = this.toSign(signatureType, data);\n\n return util.concat([bytes, this.signatureData, this.calculateTrailer(data, detached)]);\n }\n\n async hash(signatureType, data, toHash, detached = false) {\n const hashAlgorithm = enums.write(enums.hash, this.hashAlgorithm);\n if (!toHash) toHash = this.toHash(signatureType, data, detached);\n return crypto.hash.digest(hashAlgorithm, toHash);\n }\n\n /**\n * verifies the signature packet. Note: not all signature types are implemented\n * @param {PublicSubkeyPacket|PublicKeyPacket|\n * SecretSubkeyPacket|SecretKeyPacket} key - the public key to verify the signature\n * @param {module:enums.signature} signatureType - Expected signature type\n * @param {String|Object} data - Data which on the signature applies\n * @param {Date} [date] - Use the given date instead of the current time to check for signature validity and expiration\n * @param {Boolean} [detached] - Whether to verify a detached signature\n * @param {Object} [config] - Full configuration, defaults to openpgp.config\n * @throws {Error} if signature validation failed\n * @async\n */\n async verify(key, signatureType, data, date = new Date(), detached = false, config = defaultConfig) {\n const publicKeyAlgorithm = enums.write(enums.publicKey, this.publicKeyAlgorithm);\n const hashAlgorithm = enums.write(enums.hash, this.hashAlgorithm);\n if (!this.issuerKeyID.equals(key.getKeyID())) {\n throw new Error('Signature was not issued by the given public key');\n }\n if (publicKeyAlgorithm !== enums.write(enums.publicKey, key.algorithm)) {\n throw new Error('Public key algorithm used to sign signature does not match issuer key algorithm.');\n }\n\n const isMessageSignature = signatureType === enums.signature.binary || signatureType === enums.signature.text;\n // Cryptographic validity is cached after one successful verification.\n // However, for message signatures, we always re-verify, since the passed `data` can change\n const skipVerify = this[verified] && !isMessageSignature;\n if (!skipVerify) {\n let toHash;\n let hash;\n if (this.hashed) {\n hash = await this.hashed;\n } else {\n toHash = this.toHash(signatureType, data, detached);\n hash = await this.hash(signatureType, data, toHash);\n }\n hash = await stream.readToEnd(hash);\n if (this.signedHashValue[0] !== hash[0] ||\n this.signedHashValue[1] !== hash[1]) {\n throw new Error('Signed digest did not match');\n }\n\n this.params = await this.params;\n\n this[verified] = await crypto.signature.verify(\n publicKeyAlgorithm, hashAlgorithm, this.params, key.publicParams,\n toHash, hash\n );\n\n if (!this[verified]) {\n throw new Error('Signature verification failed');\n }\n }\n\n const normDate = util.normalizeDate(date);\n if (normDate && this.created > normDate) {\n throw new Error('Signature creation time is in the future');\n }\n if (normDate && normDate >= this.getExpirationTime()) {\n throw new Error('Signature is expired');\n }\n if (config.rejectHashAlgorithms.has(hashAlgorithm)) {\n throw new Error('Insecure hash algorithm: ' + enums.read(enums.hash, hashAlgorithm).toUpperCase());\n }\n if (config.rejectMessageHashAlgorithms.has(hashAlgorithm) &&\n [enums.signature.binary, enums.signature.text].includes(this.signatureType)) {\n throw new Error('Insecure message hash algorithm: ' + enums.read(enums.hash, hashAlgorithm).toUpperCase());\n }\n this.rawNotations.forEach(({ name, critical }) => {\n if (critical && (config.knownNotations.indexOf(name) < 0)) {\n throw new Error(`Unknown critical notation: ${name}`);\n }\n });\n if (this.revocationKeyClass !== null) {\n throw new Error('This key is intended to be revoked with an authorized key, which OpenPGP.js does not support.');\n }\n }\n\n /**\n * Verifies signature expiration date\n * @param {Date} [date] - Use the given date for verification instead of the current time\n * @returns {Boolean} True if expired.\n */\n isExpired(date = new Date()) {\n const normDate = util.normalizeDate(date);\n if (normDate !== null) {\n return !(this.created <= normDate && normDate < this.getExpirationTime());\n }\n return false;\n }\n\n /**\n * Returns the expiration time of the signature or Infinity if signature does not expire\n * @returns {Date | Infinity} Expiration time.\n */\n getExpirationTime() {\n return this.signatureNeverExpires ? Infinity : new Date(this.created.getTime() + this.signatureExpirationTime * 1000);\n }\n}\n\nexport default SignaturePacket;\n\n/**\n * Creates a string representation of a sub signature packet\n * @see {@link https://tools.ietf.org/html/rfc4880#section-5.2.3.1|RFC4880 5.2.3.1}\n * @see {@link https://tools.ietf.org/html/rfc4880#section-5.2.3.2|RFC4880 5.2.3.2}\n * @param {Integer} type - Subpacket signature type.\n * @param {String} data - Data to be included\n * @returns {String} A string-representation of a sub signature packet.\n * @private\n */\nfunction writeSubPacket(type, data) {\n const arr = [];\n arr.push(writeSimpleLength(data.length + 1));\n arr.push(new Uint8Array([type]));\n arr.push(data);\n return util.concat(arr);\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 SignaturePacket from './signature';\nimport KeyID from '../type/keyid';\nimport enums from '../enums';\nimport util from '../util';\nimport { UnsupportedError } from './packet';\n\nconst VERSION = 3;\n\n/**\n * Implementation of the One-Pass Signature Packets (Tag 4)\n *\n * {@link https://tools.ietf.org/html/rfc4880#section-5.4|RFC4880 5.4}:\n * The One-Pass Signature packet precedes the signed data and contains\n * enough information to allow the receiver to begin calculating any\n * hashes needed to verify the signature. It allows the Signature\n * packet to be placed at the end of the message, so that the signer\n * can compute the entire signed message in one pass.\n */\nclass OnePassSignaturePacket {\n static get tag() {\n return enums.packet.onePassSignature;\n }\n\n constructor() {\n /** A one-octet version number. The current version is 3. */\n this.version = null;\n /**\n * A one-octet signature type.\n * Signature types are described in\n * {@link https://tools.ietf.org/html/rfc4880#section-5.2.1|RFC4880 Section 5.2.1}.\n */\n this.signatureType = null;\n /**\n * A one-octet number describing the hash algorithm used.\n * @see {@link https://tools.ietf.org/html/rfc4880#section-9.4|RFC4880 9.4}\n */\n this.hashAlgorithm = null;\n /**\n * A one-octet number describing the public-key algorithm used.\n * @see {@link https://tools.ietf.org/html/rfc4880#section-9.1|RFC4880 9.1}\n */\n this.publicKeyAlgorithm = null;\n /** An eight-octet number holding the Key ID of the signing key. */\n this.issuerKeyID = null;\n /**\n * A one-octet number holding a flag showing whether the signature is nested.\n * A zero value indicates that the next packet is another One-Pass Signature packet\n * that describes another signature to be applied to the same message data.\n */\n this.flags = null;\n }\n\n /**\n * parsing function for a one-pass signature packet (tag 4).\n * @param {Uint8Array} bytes - Payload of a tag 4 packet\n * @returns {OnePassSignaturePacket} Object representation.\n */\n read(bytes) {\n let mypos = 0;\n // A one-octet version number. The current version is 3.\n this.version = bytes[mypos++];\n if (this.version !== VERSION) {\n throw new UnsupportedError(`Version ${this.version} of the one-pass signature packet is unsupported.`);\n }\n\n // A one-octet signature type. Signature types are described in\n // Section 5.2.1.\n this.signatureType = bytes[mypos++];\n\n // A one-octet number describing the hash algorithm used.\n this.hashAlgorithm = bytes[mypos++];\n\n // A one-octet number describing the public-key algorithm used.\n this.publicKeyAlgorithm = bytes[mypos++];\n\n // An eight-octet number holding the Key ID of the signing key.\n this.issuerKeyID = new KeyID();\n this.issuerKeyID.read(bytes.subarray(mypos, mypos + 8));\n mypos += 8;\n\n // A one-octet number holding a flag showing whether the signature\n // is nested. A zero value indicates that the next packet is\n // another One-Pass Signature packet that describes another\n // signature to be applied to the same message data.\n this.flags = bytes[mypos++];\n return this;\n }\n\n /**\n * creates a string representation of a one-pass signature packet\n * @returns {Uint8Array} A Uint8Array representation of a one-pass signature packet.\n */\n write() {\n const start = new Uint8Array([VERSION, enums.write(enums.signature, this.signatureType),\n enums.write(enums.hash, this.hashAlgorithm),\n enums.write(enums.publicKey, this.publicKeyAlgorithm)]);\n\n const end = new Uint8Array([this.flags]);\n\n return util.concatUint8Array([start, this.issuerKeyID.write(), end]);\n }\n\n calculateTrailer(...args) {\n return stream.fromAsync(async () => SignaturePacket.prototype.calculateTrailer.apply(await this.correspondingSig, args));\n }\n\n async verify() {\n const correspondingSig = await this.correspondingSig;\n if (!correspondingSig || correspondingSig.constructor.tag !== enums.packet.signature) {\n throw new Error('Corresponding signature packet missing');\n }\n if (\n correspondingSig.signatureType !== this.signatureType ||\n correspondingSig.hashAlgorithm !== this.hashAlgorithm ||\n correspondingSig.publicKeyAlgorithm !== this.publicKeyAlgorithm ||\n !correspondingSig.issuerKeyID.equals(this.issuerKeyID)\n ) {\n throw new Error('Corresponding signature packet does not match one-pass signature packet');\n }\n correspondingSig.hashed = this.hashed;\n return correspondingSig.verify.apply(correspondingSig, arguments);\n }\n}\n\nOnePassSignaturePacket.prototype.hash = SignaturePacket.prototype.hash;\nOnePassSignaturePacket.prototype.toHash = SignaturePacket.prototype.toHash;\nOnePassSignaturePacket.prototype.toSign = SignaturePacket.prototype.toSign;\n\nexport default OnePassSignaturePacket;\n","import * as stream from '@openpgp/web-stream-tools';\nimport {\n readPackets, supportsStreaming,\n writeTag, writeHeader,\n writePartialLength, writeSimpleLength,\n UnsupportedError\n} from './packet';\nimport util from '../util';\nimport enums from '../enums';\nimport defaultConfig from '../config';\n\n/**\n * Instantiate a new packet given its tag\n * @function newPacketFromTag\n * @param {module:enums.packet} tag - Property value from {@link module:enums.packet}\n * @param {Object} allowedPackets - mapping where keys are allowed packet tags, pointing to their Packet class\n * @returns {Object} New packet object with type based on tag\n * @throws {Error|UnsupportedError} for disallowed or unknown packets\n */\nexport function newPacketFromTag(tag, allowedPackets) {\n if (!allowedPackets[tag]) {\n // distinguish between disallowed packets and unknown ones\n let packetType;\n try {\n packetType = enums.read(enums.packet, tag);\n } catch (e) {\n throw new UnsupportedError(`Unknown packet type with tag: ${tag}`);\n }\n throw new Error(`Packet not allowed in this context: ${packetType}`);\n }\n return new allowedPackets[tag]();\n}\n\n/**\n * This class represents a list of openpgp packets.\n * Take care when iterating over it - the packets themselves\n * are stored as numerical indices.\n * @extends Array\n */\nclass PacketList extends Array {\n /**\n * Parses the given binary data and returns a list of packets.\n * Equivalent to calling `read` on an empty PacketList instance.\n * @param {Uint8Array | ReadableStream<Uint8Array>} bytes - binary data to parse\n * @param {Object} allowedPackets - mapping where keys are allowed packet tags, pointing to their Packet class\n * @param {Object} [config] - full configuration, defaults to openpgp.config\n * @returns {PacketList} parsed list of packets\n * @throws on parsing errors\n * @async\n */\n static async fromBinary(bytes, allowedPackets, config = defaultConfig) {\n const packets = new PacketList();\n await packets.read(bytes, allowedPackets, config);\n return packets;\n }\n\n /**\n * Reads a stream of binary data and interprets it as a list of packets.\n * @param {Uint8Array | ReadableStream<Uint8Array>} bytes - binary data to parse\n * @param {Object} allowedPackets - mapping where keys are allowed packet tags, pointing to their Packet class\n * @param {Object} [config] - full configuration, defaults to openpgp.config\n * @throws on parsing errors\n * @async\n */\n async read(bytes, allowedPackets, config = defaultConfig) {\n this.stream = stream.transformPair(bytes, async (readable, writable) => {\n const writer = stream.getWriter(writable);\n try {\n while (true) {\n await writer.ready;\n const done = await readPackets(readable, async parsed => {\n try {\n if (parsed.tag === enums.packet.marker || parsed.tag === enums.packet.trust) {\n // According to the spec, these packet types should be ignored and not cause parsing errors, even if not esplicitly allowed:\n // - Marker packets MUST be ignored when received: https://github.com/openpgpjs/openpgpjs/issues/1145\n // - Trust packets SHOULD be ignored outside of keyrings (unsupported): https://datatracker.ietf.org/doc/html/rfc4880#section-5.10\n return;\n }\n const packet = newPacketFromTag(parsed.tag, allowedPackets);\n packet.packets = new PacketList();\n packet.fromStream = util.isStream(parsed.packet);\n await packet.read(parsed.packet, config);\n await writer.write(packet);\n } catch (e) {\n const throwUnsupportedError = !config.ignoreUnsupportedPackets && e instanceof UnsupportedError;\n const throwMalformedError = !config.ignoreMalformedPackets && !(e instanceof UnsupportedError);\n if (throwUnsupportedError || throwMalformedError || supportsStreaming(parsed.tag)) {\n // The packets that support streaming are the ones that contain message data.\n // Those are also the ones we want to be more strict about and throw on parse errors\n // (since we likely cannot process the message without these packets anyway).\n await writer.abort(e);\n }\n util.printDebugError(e);\n }\n });\n if (done) {\n await writer.ready;\n await writer.close();\n return;\n }\n }\n } catch (e) {\n await writer.abort(e);\n }\n });\n\n // Wait until first few packets have been read\n const reader = stream.getReader(this.stream);\n while (true) {\n const { done, value } = await reader.read();\n if (!done) {\n this.push(value);\n } else {\n this.stream = null;\n }\n if (done || supportsStreaming(value.constructor.tag)) {\n break;\n }\n }\n reader.releaseLock();\n }\n\n /**\n * Creates a binary representation of openpgp objects contained within the\n * class instance.\n * @returns {Uint8Array} A Uint8Array containing valid openpgp packets.\n */\n write() {\n const arr = [];\n\n for (let i = 0; i < this.length; i++) {\n const packetbytes = this[i].write();\n if (util.isStream(packetbytes) && supportsStreaming(this[i].constructor.tag)) {\n let buffer = [];\n let bufferLength = 0;\n const minLength = 512;\n arr.push(writeTag(this[i].constructor.tag));\n arr.push(stream.transform(packetbytes, value => {\n buffer.push(value);\n bufferLength += value.length;\n if (bufferLength >= minLength) {\n const powerOf2 = Math.min(Math.log(bufferLength) / Math.LN2 | 0, 30);\n const chunkSize = 2 ** powerOf2;\n const bufferConcat = util.concat([writePartialLength(powerOf2)].concat(buffer));\n buffer = [bufferConcat.subarray(1 + chunkSize)];\n bufferLength = buffer[0].length;\n return bufferConcat.subarray(0, 1 + chunkSize);\n }\n }, () => util.concat([writeSimpleLength(bufferLength)].concat(buffer))));\n } else {\n if (util.isStream(packetbytes)) {\n let length = 0;\n arr.push(stream.transform(stream.clone(packetbytes), value => {\n length += value.length;\n }, () => writeHeader(this[i].constructor.tag, length)));\n } else {\n arr.push(writeHeader(this[i].constructor.tag, packetbytes.length));\n }\n arr.push(packetbytes);\n }\n }\n\n return util.concat(arr);\n }\n\n /**\n * Creates a new PacketList with all packets matching the given tag(s)\n * @param {...module:enums.packet} tags - packet tags to look for\n * @returns {PacketList}\n */\n filterByTag(...tags) {\n const filtered = new PacketList();\n\n const handle = tag => packetType => tag === packetType;\n\n for (let i = 0; i < this.length; i++) {\n if (tags.some(handle(this[i].constructor.tag))) {\n filtered.push(this[i]);\n }\n }\n\n return filtered;\n }\n\n /**\n * Traverses packet list and returns first packet with matching tag\n * @param {module:enums.packet} tag - The packet tag\n * @returns {Packet|undefined}\n */\n findPacket(tag) {\n return this.find(packet => packet.constructor.tag === tag);\n }\n\n /**\n * Find indices of packets with the given tag(s)\n * @param {...module:enums.packet} tags - packet tags to look for\n * @returns {Integer[]} packet indices\n */\n indexOfTag(...tags) {\n const tagIndex = [];\n const that = this;\n\n const handle = tag => packetType => tag === packetType;\n\n for (let i = 0; i < this.length; i++) {\n if (tags.some(handle(that[i].constructor.tag))) {\n tagIndex.push(i);\n }\n }\n return tagIndex;\n }\n}\n\nexport default PacketList;\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 { Deflate } from '@openpgp/pako/lib/deflate';\nimport { Inflate } from '@openpgp/pako/lib/inflate';\nimport { Z_SYNC_FLUSH, Z_FINISH } from '@openpgp/pako/lib/zlib/constants';\nimport { decode as BunzipDecode } from '@openpgp/seek-bzip';\nimport * as stream from '@openpgp/web-stream-tools';\nimport enums from '../enums';\nimport util from '../util';\nimport defaultConfig from '../config';\n\nimport LiteralDataPacket from './literal_data';\nimport OnePassSignaturePacket from './one_pass_signature';\nimport SignaturePacket from './signature';\nimport PacketList from './packetlist';\n\n// A Compressed Data packet can contain the following packet types\nconst allowedPackets = /*#__PURE__*/ util.constructAllowedPackets([\n LiteralDataPacket,\n OnePassSignaturePacket,\n SignaturePacket\n]);\n\n/**\n * Implementation of the Compressed Data Packet (Tag 8)\n *\n * {@link https://tools.ietf.org/html/rfc4880#section-5.6|RFC4880 5.6}:\n * The Compressed Data packet contains compressed data. Typically,\n * this packet is found as the contents of an encrypted packet, or following\n * a Signature or One-Pass Signature packet, and contains a literal data packet.\n */\nclass CompressedDataPacket {\n static get tag() {\n return enums.packet.compressedData;\n }\n\n /**\n * @param {Object} [config] - Full configuration, defaults to openpgp.config\n */\n constructor(config = defaultConfig) {\n /**\n * List of packets\n * @type {PacketList}\n */\n this.packets = null;\n /**\n * Compression algorithm\n * @type {compression}\n */\n this.algorithm = enums.read(enums.compression, config.preferredCompressionAlgorithm);\n\n /**\n * Compressed packet data\n * @type {Uint8Array | ReadableStream<Uint8Array>}\n */\n this.compressed = null;\n\n /**\n * zip/zlib compression level, between 1 and 9\n */\n this.deflateLevel = config.deflateLevel;\n }\n\n /**\n * Parsing function for the packet.\n * @param {Uint8Array | ReadableStream<Uint8Array>} bytes - Payload of a tag 8 packet\n * @param {Object} [config] - Full configuration, defaults to openpgp.config\n */\n async read(bytes, config = defaultConfig) {\n await stream.parse(bytes, async reader => {\n\n // One octet that gives the algorithm used to compress the packet.\n this.algorithm = enums.read(enums.compression, await reader.readByte());\n\n // Compressed data, which makes up the remainder of the packet.\n this.compressed = reader.remainder();\n\n await this.decompress(config);\n });\n }\n\n\n /**\n * Return the compressed packet.\n * @returns {Uint8Array | ReadableStream<Uint8Array>} Binary compressed packet.\n */\n write() {\n if (this.compressed === null) {\n this.compress();\n }\n\n return util.concat([new Uint8Array([enums.write(enums.compression, this.algorithm)]), this.compressed]);\n }\n\n\n /**\n * Decompression method for decompressing the compressed data\n * read by read_packet\n * @param {Object} [config] - Full configuration, defaults to openpgp.config\n */\n async decompress(config = defaultConfig) {\n\n if (!decompress_fns[this.algorithm]) {\n throw new Error(this.algorithm + ' decompression not supported');\n }\n\n this.packets = await PacketList.fromBinary(decompress_fns[this.algorithm](this.compressed), allowedPackets, config);\n }\n\n /**\n * Compress the packet data (member decompressedData)\n */\n compress() {\n if (!compress_fns[this.algorithm]) {\n throw new Error(this.algorithm + ' compression not supported');\n }\n\n this.compressed = compress_fns[this.algorithm](this.packets.write(), this.deflateLevel);\n }\n}\n\nexport default CompressedDataPacket;\n\n//////////////////////////\n// //\n// Helper functions //\n// //\n//////////////////////////\n\n\nconst nodeZlib = util.getNodeZlib();\n\nfunction uncompressed(data) {\n return data;\n}\n\nfunction node_zlib(func, create, options = {}) {\n return function (data) {\n if (!util.isStream(data) || stream.isArrayStream(data)) {\n return stream.fromAsync(() => stream.readToEnd(data).then(data => {\n return new Promise((resolve, reject) => {\n func(data, options, (err, result) => {\n if (err) return reject(err);\n resolve(result);\n });\n });\n }));\n }\n return stream.nodeToWeb(stream.webToNode(data).pipe(create(options)));\n };\n}\n\nfunction pako_zlib(constructor, options = {}) {\n return function(data) {\n const obj = new constructor(options);\n return stream.transform(data, value => {\n if (value.length) {\n obj.push(value, Z_SYNC_FLUSH);\n return obj.result;\n }\n }, () => {\n if (constructor === Deflate) {\n obj.push([], Z_FINISH);\n return obj.result;\n }\n });\n };\n}\n\nfunction bzip2(func) {\n return function(data) {\n return stream.fromAsync(async () => func(await stream.readToEnd(data)));\n };\n}\n\nconst compress_fns = nodeZlib ? {\n zip: /*#__PURE__*/ (compressed, level) => node_zlib(nodeZlib.deflateRaw, nodeZlib.createDeflateRaw, { level })(compressed),\n zlib: /*#__PURE__*/ (compressed, level) => node_zlib(nodeZlib.deflate, nodeZlib.createDeflate, { level })(compressed)\n} : {\n zip: /*#__PURE__*/ (compressed, level) => pako_zlib(Deflate, { raw: true, level })(compressed),\n zlib: /*#__PURE__*/ (compressed, level) => pako_zlib(Deflate, { level })(compressed)\n};\n\nconst decompress_fns = nodeZlib ? {\n uncompressed: uncompressed,\n zip: /*#__PURE__*/ node_zlib(nodeZlib.inflateRaw, nodeZlib.createInflateRaw),\n zlib: /*#__PURE__*/ node_zlib(nodeZlib.inflate, nodeZlib.createInflate),\n bzip2: /*#__PURE__*/ bzip2(BunzipDecode)\n} : {\n uncompressed: uncompressed,\n zip: /*#__PURE__*/ pako_zlib(Inflate, { raw: true }),\n zlib: /*#__PURE__*/ pako_zlib(Inflate),\n bzip2: /*#__PURE__*/ bzip2(BunzipDecode)\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\nimport * as stream from '@openpgp/web-stream-tools';\nimport crypto from '../crypto';\nimport enums from '../enums';\nimport util from '../util';\nimport defaultConfig from '../config';\n\nimport LiteralDataPacket from './literal_data';\nimport CompressedDataPacket from './compressed_data';\nimport OnePassSignaturePacket from './one_pass_signature';\nimport SignaturePacket from './signature';\nimport PacketList from './packetlist';\nimport { UnsupportedError } from './packet';\n\n// A SEIP packet can contain the following packet types\nconst allowedPackets = /*#__PURE__*/ util.constructAllowedPackets([\n LiteralDataPacket,\n CompressedDataPacket,\n OnePassSignaturePacket,\n SignaturePacket\n]);\n\nconst VERSION = 1; // A one-octet version number of the data packet.\n\n/**\n * Implementation of the Sym. Encrypted Integrity Protected Data Packet (Tag 18)\n *\n * {@link https://tools.ietf.org/html/rfc4880#section-5.13|RFC4880 5.13}:\n * The Symmetrically Encrypted Integrity Protected Data packet is\n * a variant of the Symmetrically Encrypted Data packet. It is a new feature\n * created for OpenPGP that addresses the problem of detecting a modification to\n * encrypted data. It is used in combination with a Modification Detection Code\n * packet.\n */\nclass SymEncryptedIntegrityProtectedDataPacket {\n static get tag() {\n return enums.packet.symEncryptedIntegrityProtectedData;\n }\n\n constructor() {\n this.version = VERSION;\n this.encrypted = null;\n this.packets = null;\n }\n\n async read(bytes) {\n await stream.parse(bytes, async reader => {\n const version = await reader.readByte();\n // - A one-octet version number. The only currently defined value is 1.\n if (version !== VERSION) {\n throw new UnsupportedError(`Version ${version} of the SEIP packet is unsupported.`);\n }\n\n // - Encrypted data, the output of the selected symmetric-key cipher\n // operating in Cipher Feedback mode with shift amount equal to the\n // block size of the cipher (CFB-n where n is the block size).\n this.encrypted = reader.remainder();\n });\n }\n\n write() {\n return util.concat([new Uint8Array([VERSION]), this.encrypted]);\n }\n\n /**\n * Encrypt the payload in the packet.\n * @param {String} sessionKeyAlgorithm - The selected symmetric encryption algorithm to be used e.g. 'aes128'\n * @param {Uint8Array} key - The key of cipher blocksize length to be used\n * @param {Object} [config] - Full configuration, defaults to openpgp.config\n * @returns {Promise<Boolean>}\n * @async\n */\n async encrypt(sessionKeyAlgorithm, key, config = defaultConfig) {\n let bytes = this.packets.write();\n if (stream.isArrayStream(bytes)) bytes = await stream.readToEnd(bytes);\n const prefix = await crypto.getPrefixRandom(sessionKeyAlgorithm);\n const mdc = new Uint8Array([0xD3, 0x14]); // modification detection code packet\n\n const tohash = util.concat([prefix, bytes, mdc]);\n const hash = await crypto.hash.sha1(stream.passiveClone(tohash));\n const plaintext = util.concat([tohash, hash]);\n\n this.encrypted = await crypto.mode.cfb.encrypt(sessionKeyAlgorithm, key, plaintext, new Uint8Array(crypto.cipher[sessionKeyAlgorithm].blockSize), config);\n return true;\n }\n\n /**\n * Decrypts the encrypted data contained in the packet.\n * @param {String} sessionKeyAlgorithm - The selected symmetric encryption algorithm to be used e.g. 'aes128'\n * @param {Uint8Array} key - The key of cipher blocksize length to be used\n * @param {Object} [config] - Full configuration, defaults to openpgp.config\n * @returns {Promise<Boolean>}\n * @async\n */\n async decrypt(sessionKeyAlgorithm, key, config = defaultConfig) {\n let encrypted = stream.clone(this.encrypted);\n if (stream.isArrayStream(encrypted)) encrypted = await stream.readToEnd(encrypted);\n const decrypted = await crypto.mode.cfb.decrypt(sessionKeyAlgorithm, key, encrypted, new Uint8Array(crypto.cipher[sessionKeyAlgorithm].blockSize));\n\n // there must be a modification detection code packet as the\n // last packet and everything gets hashed except the hash itself\n const realHash = stream.slice(stream.passiveClone(decrypted), -20);\n const tohash = stream.slice(decrypted, 0, -20);\n const verifyHash = Promise.all([\n stream.readToEnd(await crypto.hash.sha1(stream.passiveClone(tohash))),\n stream.readToEnd(realHash)\n ]).then(([hash, mdc]) => {\n if (!util.equalsUint8Array(hash, mdc)) {\n throw new Error('Modification detected.');\n }\n return new Uint8Array();\n });\n const bytes = stream.slice(tohash, crypto.cipher[sessionKeyAlgorithm].blockSize + 2); // Remove random prefix\n let packetbytes = stream.slice(bytes, 0, -2); // Remove MDC packet\n packetbytes = stream.concat([packetbytes, stream.fromAsync(() => verifyHash)]);\n if (!util.isStream(encrypted) || !config.allowUnauthenticatedStream) {\n packetbytes = await stream.readToEnd(packetbytes);\n }\n this.packets = await PacketList.fromBinary(packetbytes, allowedPackets, config);\n return true;\n }\n}\n\nexport default SymEncryptedIntegrityProtectedDataPacket;\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\nimport * as stream from '@openpgp/web-stream-tools';\nimport crypto from '../crypto';\nimport enums from '../enums';\nimport util from '../util';\nimport defaultConfig from '../config';\nimport { UnsupportedError } from './packet';\n\nimport LiteralDataPacket from './literal_data';\nimport CompressedDataPacket from './compressed_data';\nimport OnePassSignaturePacket from './one_pass_signature';\nimport SignaturePacket from './signature';\nimport PacketList from './packetlist';\n\n// An AEAD-encrypted Data packet can contain the following packet types\nconst allowedPackets = /*#__PURE__*/ util.constructAllowedPackets([\n LiteralDataPacket,\n CompressedDataPacket,\n OnePassSignaturePacket,\n SignaturePacket\n]);\n\nconst VERSION = 1; // A one-octet version number of the data packet.\n\n/**\n * Implementation of the Symmetrically Encrypted Authenticated Encryption with\n * Additional Data (AEAD) Protected Data Packet\n *\n * {@link https://tools.ietf.org/html/draft-ford-openpgp-format-00#section-2.1}:\n * AEAD Protected Data Packet\n */\nclass AEADEncryptedDataPacket {\n static get tag() {\n return enums.packet.aeadEncryptedData;\n }\n\n constructor() {\n this.version = VERSION;\n this.cipherAlgo = null;\n this.aeadAlgorithm = 'eax';\n this.aeadAlgo = null;\n this.chunkSizeByte = null;\n this.iv = null;\n this.encrypted = null;\n this.packets = null;\n }\n\n /**\n * Parse an encrypted payload of bytes in the order: version, IV, ciphertext (see specification)\n * @param {Uint8Array | ReadableStream<Uint8Array>} bytes\n */\n async read(bytes) {\n await stream.parse(bytes, async reader => {\n const version = await reader.readByte();\n if (version !== VERSION) { // The only currently defined value is 1.\n throw new UnsupportedError(`Version ${version} of the AEAD-encrypted data packet is not supported.`);\n }\n this.cipherAlgo = await reader.readByte();\n this.aeadAlgo = await reader.readByte();\n this.chunkSizeByte = await reader.readByte();\n const mode = crypto.mode[enums.read(enums.aead, this.aeadAlgo)];\n this.iv = await reader.readBytes(mode.ivLength);\n this.encrypted = reader.remainder();\n });\n }\n\n /**\n * Write the encrypted payload of bytes in the order: version, IV, ciphertext (see specification)\n * @returns {Uint8Array | ReadableStream<Uint8Array>} The encrypted payload.\n */\n write() {\n return util.concat([new Uint8Array([this.version, this.cipherAlgo, this.aeadAlgo, this.chunkSizeByte]), this.iv, this.encrypted]);\n }\n\n /**\n * Decrypt the encrypted payload.\n * @param {String} sessionKeyAlgorithm - The session key's cipher algorithm e.g. 'aes128'\n * @param {Uint8Array} key - The session key used to encrypt the payload\n * @param {Object} [config] - Full configuration, defaults to openpgp.config\n * @throws {Error} if decryption was not successful\n * @async\n */\n async decrypt(sessionKeyAlgorithm, key, config = defaultConfig) {\n this.packets = await PacketList.fromBinary(\n await this.crypt('decrypt', key, stream.clone(this.encrypted)),\n allowedPackets,\n config\n );\n }\n\n /**\n * Encrypt the packet list payload.\n * @param {String} sessionKeyAlgorithm - The session key's cipher algorithm e.g. 'aes128'\n * @param {Uint8Array} key - The session key used to encrypt the payload\n * @param {Object} [config] - Full configuration, defaults to openpgp.config\n * @throws {Error} if encryption was not successful\n * @async\n */\n async encrypt(sessionKeyAlgorithm, key, config = defaultConfig) {\n this.cipherAlgo = enums.write(enums.symmetric, sessionKeyAlgorithm);\n this.aeadAlgo = enums.write(enums.aead, this.aeadAlgorithm);\n const mode = crypto.mode[enums.read(enums.aead, this.aeadAlgo)];\n this.iv = await crypto.random.getRandomBytes(mode.ivLength); // generate new random IV\n this.chunkSizeByte = config.aeadChunkSizeByte;\n const data = this.packets.write();\n this.encrypted = await this.crypt('encrypt', key, data);\n }\n\n /**\n * En/decrypt the payload.\n * @param {encrypt|decrypt} fn - Whether to encrypt or decrypt\n * @param {Uint8Array} key - The session key used to en/decrypt the payload\n * @param {Uint8Array | ReadableStream<Uint8Array>} data - The data to en/decrypt\n * @returns {Promise<Uint8Array | ReadableStream<Uint8Array>>}\n * @async\n */\n async crypt(fn, key, data) {\n const cipher = enums.read(enums.symmetric, this.cipherAlgo);\n const mode = crypto.mode[enums.read(enums.aead, this.aeadAlgo)];\n const modeInstance = await mode(cipher, key);\n const tagLengthIfDecrypting = fn === 'decrypt' ? mode.tagLength : 0;\n const tagLengthIfEncrypting = fn === 'encrypt' ? mode.tagLength : 0;\n const chunkSize = 2 ** (this.chunkSizeByte + 6) + tagLengthIfDecrypting; // ((uint64_t)1 << (c + 6))\n const adataBuffer = new ArrayBuffer(21);\n const adataArray = new Uint8Array(adataBuffer, 0, 13);\n const adataTagArray = new Uint8Array(adataBuffer);\n const adataView = new DataView(adataBuffer);\n const chunkIndexArray = new Uint8Array(adataBuffer, 5, 8);\n adataArray.set([0xC0 | AEADEncryptedDataPacket.tag, this.version, this.cipherAlgo, this.aeadAlgo, this.chunkSizeByte], 0);\n let chunkIndex = 0;\n let latestPromise = Promise.resolve();\n let cryptedBytes = 0;\n let queuedBytes = 0;\n const iv = this.iv;\n return stream.transformPair(data, async (readable, writable) => {\n if (util.isStream(readable) !== 'array') {\n const buffer = new stream.TransformStream({}, {\n highWaterMark: util.getHardwareConcurrency() * 2 ** (this.chunkSizeByte + 6),\n size: array => array.length\n });\n stream.pipe(buffer.readable, writable);\n writable = buffer.writable;\n }\n const reader = stream.getReader(readable);\n const writer = stream.getWriter(writable);\n try {\n while (true) {\n let chunk = await reader.readBytes(chunkSize + tagLengthIfDecrypting) || new Uint8Array();\n const finalChunk = chunk.subarray(chunk.length - tagLengthIfDecrypting);\n chunk = chunk.subarray(0, chunk.length - tagLengthIfDecrypting);\n let cryptedPromise;\n let done;\n if (!chunkIndex || chunk.length) {\n reader.unshift(finalChunk);\n cryptedPromise = modeInstance[fn](chunk, mode.getNonce(iv, chunkIndexArray), adataArray);\n queuedBytes += chunk.length - tagLengthIfDecrypting + tagLengthIfEncrypting;\n } else {\n // After the last chunk, we either encrypt a final, empty\n // data chunk to get the final authentication tag or\n // validate that final authentication tag.\n adataView.setInt32(13 + 4, cryptedBytes); // Should be setInt64(13, ...)\n cryptedPromise = modeInstance[fn](finalChunk, mode.getNonce(iv, chunkIndexArray), adataTagArray);\n queuedBytes += tagLengthIfEncrypting;\n done = true;\n }\n cryptedBytes += chunk.length - tagLengthIfDecrypting;\n // eslint-disable-next-line no-loop-func\n latestPromise = latestPromise.then(() => cryptedPromise).then(async crypted => {\n await writer.ready;\n await writer.write(crypted);\n queuedBytes -= crypted.length;\n }).catch(err => writer.abort(err));\n if (done || queuedBytes > writer.desiredSize) {\n await latestPromise; // Respect backpressure\n }\n if (!done) {\n adataView.setInt32(5 + 4, ++chunkIndex); // Should be setInt64(5, ...)\n } else {\n await writer.close();\n break;\n }\n }\n } catch (e) {\n await writer.abort(e);\n }\n });\n }\n}\n\nexport default AEADEncryptedDataPacket;\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 KeyID from '../type/keyid';\nimport crypto from '../crypto';\nimport enums from '../enums';\nimport util from '../util';\nimport { UnsupportedError } from './packet';\n\nconst VERSION = 3;\n\n/**\n * Public-Key Encrypted Session Key Packets (Tag 1)\n *\n * {@link https://tools.ietf.org/html/rfc4880#section-5.1|RFC4880 5.1}:\n * A Public-Key Encrypted Session Key packet holds the session key\n * used to encrypt a message. Zero or more Public-Key Encrypted Session Key\n * packets and/or Symmetric-Key Encrypted Session Key packets may precede a\n * Symmetrically Encrypted Data Packet, which holds an encrypted message. The\n * message is encrypted with the session key, and the session key is itself\n * encrypted and stored in the Encrypted Session Key packet(s). The\n * Symmetrically Encrypted Data Packet is preceded by one Public-Key Encrypted\n * Session Key packet for each OpenPGP key to which the message is encrypted.\n * The recipient of the message finds a session key that is encrypted to their\n * public key, decrypts the session key, and then uses the session key to\n * decrypt the message.\n */\nclass PublicKeyEncryptedSessionKeyPacket {\n static get tag() {\n return enums.packet.publicKeyEncryptedSessionKey;\n }\n\n constructor() {\n this.version = 3;\n\n this.publicKeyID = new KeyID();\n this.publicKeyAlgorithm = null;\n\n this.sessionKey = null;\n this.sessionKeyAlgorithm = null;\n\n /** @type {Object} */\n this.encrypted = {};\n }\n\n /**\n * Parsing function for a publickey encrypted session key packet (tag 1).\n *\n * @param {Uint8Array} bytes - Payload of a tag 1 packet\n */\n read(bytes) {\n this.version = bytes[0];\n if (this.version !== VERSION) {\n throw new UnsupportedError(`Version ${this.version} of the PKESK packet is unsupported.`);\n }\n this.publicKeyID.read(bytes.subarray(1, bytes.length));\n this.publicKeyAlgorithm = enums.read(enums.publicKey, bytes[9]);\n\n const algo = enums.write(enums.publicKey, this.publicKeyAlgorithm);\n this.encrypted = crypto.parseEncSessionKeyParams(algo, bytes.subarray(10));\n }\n\n /**\n * Create a binary representation of a tag 1 packet\n *\n * @returns {Uint8Array} The Uint8Array representation.\n */\n write() {\n const algo = enums.write(enums.publicKey, this.publicKeyAlgorithm);\n\n const arr = [\n new Uint8Array([this.version]),\n this.publicKeyID.write(),\n new Uint8Array([enums.write(enums.publicKey, this.publicKeyAlgorithm)]),\n crypto.serializeParams(algo, this.encrypted)\n ];\n\n return util.concatUint8Array(arr);\n }\n\n /**\n * Encrypt session key packet\n * @param {PublicKeyPacket} key - Public key\n * @throws {Error} if encryption failed\n * @async\n */\n async encrypt(key) {\n const data = util.concatUint8Array([\n new Uint8Array([enums.write(enums.symmetric, this.sessionKeyAlgorithm)]),\n this.sessionKey,\n util.writeChecksum(this.sessionKey)\n ]);\n const algo = enums.write(enums.publicKey, this.publicKeyAlgorithm);\n this.encrypted = await crypto.publicKeyEncrypt(\n algo, key.publicParams, data, key.getFingerprintBytes());\n }\n\n /**\n * Decrypts the session key (only for public key encrypted session key\n * packets (tag 1)\n * @param {SecretKeyPacket} key - decrypted private key\n * @throws {Error} if decryption failed\n * @async\n */\n async decrypt(key) {\n const algo = enums.write(enums.publicKey, this.publicKeyAlgorithm);\n const keyAlgo = enums.write(enums.publicKey, key.algorithm);\n // check that session key algo matches the secret key algo\n if (algo !== keyAlgo) {\n throw new Error('Decryption error');\n }\n const decoded = await crypto.publicKeyDecrypt(algo, key.publicParams, key.privateParams, this.encrypted, key.getFingerprintBytes());\n const checksum = decoded.subarray(decoded.length - 2);\n const sessionKey = decoded.subarray(1, decoded.length - 2);\n if (!util.equalsUint8Array(checksum, util.writeChecksum(sessionKey))) {\n throw new Error('Decryption error');\n } else {\n this.sessionKey = sessionKey;\n this.sessionKeyAlgorithm = enums.read(enums.symmetric, decoded[0]);\n }\n }\n}\n\nexport default PublicKeyEncryptedSessionKeyPacket;\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 * Implementation of the String-to-key specifier\n *\n * {@link https://tools.ietf.org/html/rfc4880#section-3.7|RFC4880 3.7}:\n * String-to-key (S2K) specifiers are used to convert passphrase strings\n * into symmetric-key encryption/decryption keys. They are used in two\n * places, currently: to encrypt the secret part of private keys in the\n * private keyring, and to convert passphrases to encryption keys for\n * symmetrically encrypted messages.\n * @module type/s2k\n * @private\n */\n\nimport defaultConfig from '../config';\nimport crypto from '../crypto';\nimport enums from '../enums.js';\nimport util from '../util.js';\n\nclass S2K {\n /**\n * @param {Object} [config] - Full configuration, defaults to openpgp.config\n */\n constructor(config = defaultConfig) {\n /** @type {module:enums.hash} */\n this.algorithm = 'sha256';\n /** @type {module:enums.s2k} */\n this.type = 'iterated';\n /** @type {Integer} */\n this.c = config.s2kIterationCountByte;\n /** Eight bytes of salt in a binary string.\n * @type {String}\n */\n this.salt = null;\n }\n\n getCount() {\n // Exponent bias, defined in RFC4880\n const expbias = 6;\n\n return (16 + (this.c & 15)) << ((this.c >> 4) + expbias);\n }\n\n /**\n * Parsing function for a string-to-key specifier ({@link https://tools.ietf.org/html/rfc4880#section-3.7|RFC 4880 3.7}).\n * @param {String} bytes - Payload of string-to-key specifier\n * @returns {Integer} Actual length of the object.\n */\n read(bytes) {\n let i = 0;\n this.type = enums.read(enums.s2k, bytes[i++]);\n this.algorithm = bytes[i++];\n if (this.type !== 'gnu') {\n this.algorithm = enums.read(enums.hash, this.algorithm);\n }\n\n switch (this.type) {\n case 'simple':\n break;\n\n case 'salted':\n this.salt = bytes.subarray(i, i + 8);\n i += 8;\n break;\n\n case 'iterated':\n this.salt = bytes.subarray(i, i + 8);\n i += 8;\n\n // Octet 10: count, a one-octet, coded value\n this.c = bytes[i++];\n break;\n\n case 'gnu':\n if (util.uint8ArrayToString(bytes.subarray(i, i + 3)) === 'GNU') {\n i += 3; // GNU\n const gnuExtType = 1000 + bytes[i++];\n if (gnuExtType === 1001) {\n this.type = 'gnu-dummy';\n // GnuPG extension mode 1001 -- don't write secret key at all\n } else {\n throw new Error('Unknown s2k gnu protection mode.');\n }\n } else {\n throw new Error('Unknown s2k type.');\n }\n break;\n\n default:\n throw new Error('Unknown s2k type.');\n }\n\n return i;\n }\n\n /**\n * Serializes s2k information\n * @returns {Uint8Array} Binary representation of s2k.\n */\n write() {\n if (this.type === 'gnu-dummy') {\n return new Uint8Array([101, 0, ...util.stringToUint8Array('GNU'), 1]);\n }\n\n const arr = [new Uint8Array([enums.write(enums.s2k, this.type), enums.write(enums.hash, this.algorithm)])];\n\n switch (this.type) {\n case 'simple':\n break;\n case 'salted':\n arr.push(this.salt);\n break;\n case 'iterated':\n arr.push(this.salt);\n arr.push(new Uint8Array([this.c]));\n break;\n case 'gnu':\n throw new Error('GNU s2k type not supported.');\n default:\n throw new Error('Unknown s2k type.');\n }\n\n return util.concatUint8Array(arr);\n }\n\n /**\n * Produces a key using the specified passphrase and the defined\n * hashAlgorithm\n * @param {String} passphrase - Passphrase containing user input\n * @returns {Promise<Uint8Array>} Produced key with a length corresponding to.\n * hashAlgorithm hash length\n * @async\n */\n async produceKey(passphrase, numBytes) {\n passphrase = util.encodeUTF8(passphrase);\n const algorithm = enums.write(enums.hash, this.algorithm);\n\n const arr = [];\n let rlength = 0;\n\n let prefixlen = 0;\n while (rlength < numBytes) {\n let toHash;\n switch (this.type) {\n case 'simple':\n toHash = util.concatUint8Array([new Uint8Array(prefixlen), passphrase]);\n break;\n case 'salted':\n toHash = util.concatUint8Array([new Uint8Array(prefixlen), this.salt, passphrase]);\n break;\n case 'iterated': {\n const data = util.concatUint8Array([this.salt, passphrase]);\n let datalen = data.length;\n const count = Math.max(this.getCount(), datalen);\n toHash = new Uint8Array(prefixlen + count);\n toHash.set(data, prefixlen);\n for (let pos = prefixlen + datalen; pos < count; pos += datalen, datalen *= 2) {\n toHash.copyWithin(pos, prefixlen, pos);\n }\n break;\n }\n case 'gnu':\n throw new Error('GNU s2k type not supported.');\n default:\n throw new Error('Unknown s2k type.');\n }\n const result = await crypto.hash.digest(algorithm, toHash);\n arr.push(result);\n rlength += result.length;\n prefixlen++;\n }\n\n return util.concatUint8Array(arr).subarray(0, numBytes);\n }\n}\n\nexport default S2K;\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 S2K from '../type/s2k';\nimport defaultConfig from '../config';\nimport crypto from '../crypto';\nimport enums from '../enums';\nimport util from '../util';\nimport { UnsupportedError } from './packet';\n\n/**\n * Symmetric-Key Encrypted Session Key Packets (Tag 3)\n *\n * {@link https://tools.ietf.org/html/rfc4880#section-5.3|RFC4880 5.3}:\n * The Symmetric-Key Encrypted Session Key packet holds the\n * symmetric-key encryption of a session key used to encrypt a message.\n * Zero or more Public-Key Encrypted Session Key packets and/or\n * Symmetric-Key Encrypted Session Key packets may precede a\n * Symmetrically Encrypted Data packet that holds an encrypted message.\n * The message is encrypted with a session key, and the session key is\n * itself encrypted and stored in the Encrypted Session Key packet or\n * the Symmetric-Key Encrypted Session Key packet.\n */\nclass SymEncryptedSessionKeyPacket {\n static get tag() {\n return enums.packet.symEncryptedSessionKey;\n }\n\n /**\n * @param {Object} [config] - Full configuration, defaults to openpgp.config\n */\n constructor(config = defaultConfig) {\n this.version = config.aeadProtect ? 5 : 4;\n this.sessionKey = null;\n this.sessionKeyEncryptionAlgorithm = null;\n this.sessionKeyAlgorithm = 'aes256';\n this.aeadAlgorithm = enums.read(enums.aead, config.preferredAEADAlgorithm);\n this.encrypted = null;\n this.s2k = null;\n this.iv = null;\n }\n\n /**\n * Parsing function for a symmetric encrypted session key packet (tag 3).\n *\n * @param {Uint8Array} bytes - Payload of a tag 3 packet\n */\n read(bytes) {\n let offset = 0;\n\n // A one-octet version number. The only currently defined version is 4.\n this.version = bytes[offset++];\n if (this.version !== 4 && this.version !== 5) {\n throw new UnsupportedError(`Version ${this.version} of the SKESK packet is unsupported.`);\n }\n\n // A one-octet number describing the symmetric algorithm used.\n const algo = enums.read(enums.symmetric, bytes[offset++]);\n\n if (this.version === 5) {\n // A one-octet AEAD algorithm.\n this.aeadAlgorithm = enums.read(enums.aead, bytes[offset++]);\n }\n\n // A string-to-key (S2K) specifier, length as defined above.\n this.s2k = new S2K();\n offset += this.s2k.read(bytes.subarray(offset, bytes.length));\n\n if (this.version === 5) {\n const mode = crypto.mode[this.aeadAlgorithm];\n\n // A starting initialization vector of size specified by the AEAD\n // algorithm.\n this.iv = bytes.subarray(offset, offset += mode.ivLength);\n }\n\n // The encrypted session key itself, which is decrypted with the\n // string-to-key object. This is optional in version 4.\n if (this.version === 5 || offset < bytes.length) {\n this.encrypted = bytes.subarray(offset, bytes.length);\n this.sessionKeyEncryptionAlgorithm = algo;\n } else {\n this.sessionKeyAlgorithm = algo;\n }\n }\n\n /**\n * Create a binary representation of a tag 3 packet\n *\n * @returns {Uint8Array} The Uint8Array representation.\n */\n write() {\n const algo = this.encrypted === null ?\n this.sessionKeyAlgorithm :\n this.sessionKeyEncryptionAlgorithm;\n\n let bytes;\n\n if (this.version === 5) {\n bytes = util.concatUint8Array([new Uint8Array([this.version, enums.write(enums.symmetric, algo), enums.write(enums.aead, this.aeadAlgorithm)]), this.s2k.write(), this.iv, this.encrypted]);\n } else {\n bytes = util.concatUint8Array([new Uint8Array([this.version, enums.write(enums.symmetric, algo)]), this.s2k.write()]);\n\n if (this.encrypted !== null) {\n bytes = util.concatUint8Array([bytes, this.encrypted]);\n }\n }\n\n return bytes;\n }\n\n /**\n * Decrypts the session key\n * @param {String} passphrase - The passphrase in string form\n * @throws {Error} if decryption was not successful\n * @async\n */\n async decrypt(passphrase) {\n const algo = this.sessionKeyEncryptionAlgorithm !== null ?\n this.sessionKeyEncryptionAlgorithm :\n this.sessionKeyAlgorithm;\n\n const length = crypto.cipher[algo].keySize;\n const key = await this.s2k.produceKey(passphrase, length);\n\n if (this.version === 5) {\n const mode = crypto.mode[this.aeadAlgorithm];\n const adata = new Uint8Array([0xC0 | SymEncryptedSessionKeyPacket.tag, this.version, enums.write(enums.symmetric, this.sessionKeyEncryptionAlgorithm), enums.write(enums.aead, this.aeadAlgorithm)]);\n const modeInstance = await mode(algo, key);\n this.sessionKey = await modeInstance.decrypt(this.encrypted, this.iv, adata);\n } else if (this.encrypted !== null) {\n const decrypted = await crypto.mode.cfb.decrypt(algo, key, this.encrypted, new Uint8Array(crypto.cipher[algo].blockSize));\n\n this.sessionKeyAlgorithm = enums.read(enums.symmetric, decrypted[0]);\n this.sessionKey = decrypted.subarray(1, decrypted.length);\n } else {\n this.sessionKey = key;\n }\n }\n\n /**\n * Encrypts the session key\n * @param {String} passphrase - The passphrase in string form\n * @param {Object} [config] - Full configuration, defaults to openpgp.config\n * @throws {Error} if encryption was not successful\n * @async\n */\n async encrypt(passphrase, config = defaultConfig) {\n const algo = this.sessionKeyEncryptionAlgorithm !== null ?\n this.sessionKeyEncryptionAlgorithm :\n this.sessionKeyAlgorithm;\n\n this.sessionKeyEncryptionAlgorithm = algo;\n\n this.s2k = new S2K(config);\n this.s2k.salt = await crypto.random.getRandomBytes(8);\n\n const length = crypto.cipher[algo].keySize;\n const key = await this.s2k.produceKey(passphrase, length);\n\n if (this.sessionKey === null) {\n this.sessionKey = await crypto.generateSessionKey(this.sessionKeyAlgorithm);\n }\n\n if (this.version === 5) {\n const mode = crypto.mode[this.aeadAlgorithm];\n this.iv = await crypto.random.getRandomBytes(mode.ivLength); // generate new random IV\n const adata = new Uint8Array([0xC0 | SymEncryptedSessionKeyPacket.tag, this.version, enums.write(enums.symmetric, this.sessionKeyEncryptionAlgorithm), enums.write(enums.aead, this.aeadAlgorithm)]);\n const modeInstance = await mode(algo, key);\n this.encrypted = await modeInstance.encrypt(this.sessionKey, this.iv, adata);\n } else {\n const algo_enum = new Uint8Array([enums.write(enums.symmetric, this.sessionKeyAlgorithm)]);\n const private_key = util.concatUint8Array([algo_enum, this.sessionKey]);\n this.encrypted = await crypto.mode.cfb.encrypt(algo, key, private_key, new Uint8Array(crypto.cipher[algo].blockSize), config);\n }\n }\n}\n\nexport default SymEncryptedSessionKeyPacket;\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 KeyID from '../type/keyid';\nimport defaultConfig from '../config';\nimport crypto from '../crypto';\nimport enums from '../enums';\nimport util from '../util';\nimport { UnsupportedError } from './packet';\n\n/**\n * Implementation of the Key Material Packet (Tag 5,6,7,14)\n *\n * {@link https://tools.ietf.org/html/rfc4880#section-5.5|RFC4480 5.5}:\n * A key material packet contains all the information about a public or\n * private key. There are four variants of this packet type, and two\n * major versions.\n *\n * A Public-Key packet starts a series of packets that forms an OpenPGP\n * key (sometimes called an OpenPGP certificate).\n */\nclass PublicKeyPacket {\n static get tag() {\n return enums.packet.publicKey;\n }\n\n /**\n * @param {Date} [date] - Creation date\n * @param {Object} [config] - Full configuration, defaults to openpgp.config\n */\n constructor(date = new Date(), config = defaultConfig) {\n /**\n * Packet version\n * @type {Integer}\n */\n this.version = config.v5Keys ? 5 : 4;\n /**\n * Key creation date.\n * @type {Date}\n */\n this.created = util.normalizeDate(date);\n /**\n * Public key algorithm.\n * @type {String}\n */\n this.algorithm = null;\n /**\n * Algorithm specific public params\n * @type {Object}\n */\n this.publicParams = null;\n /**\n * Time until expiration in days (V3 only)\n * @type {Integer}\n */\n this.expirationTimeV3 = 0;\n /**\n * Fingerprint bytes\n * @type {Uint8Array}\n */\n this.fingerprint = null;\n /**\n * KeyID\n * @type {module:type/keyid~KeyID}\n */\n this.keyID = null;\n }\n\n /**\n * Create a PublicKeyPacket from a SecretKeyPacket\n * @param {SecretKeyPacket} secretKeyPacket - key packet to convert\n * @returns {PublicKeyPacket} public key packet\n * @static\n */\n static fromSecretKeyPacket(secretKeyPacket) {\n const keyPacket = new PublicKeyPacket();\n const { version, created, algorithm, publicParams, keyID, fingerprint } = secretKeyPacket;\n keyPacket.version = version;\n keyPacket.created = created;\n keyPacket.algorithm = algorithm;\n keyPacket.publicParams = publicParams;\n keyPacket.keyID = keyID;\n keyPacket.fingerprint = fingerprint;\n return keyPacket;\n }\n\n /**\n * Internal Parser for public keys as specified in {@link https://tools.ietf.org/html/rfc4880#section-5.5.2|RFC 4880 section 5.5.2 Public-Key Packet Formats}\n * @param {Uint8Array} bytes - Input array to read the packet from\n * @returns {Object} This object with attributes set by the parser\n * @async\n */\n async read(bytes) {\n let pos = 0;\n // A one-octet version number (3, 4 or 5).\n this.version = bytes[pos++];\n\n if (this.version === 4 || this.version === 5) {\n // - A four-octet number denoting the time that the key was created.\n this.created = util.readDate(bytes.subarray(pos, pos + 4));\n pos += 4;\n\n // - A one-octet number denoting the public-key algorithm of this key.\n this.algorithm = enums.read(enums.publicKey, bytes[pos++]);\n const algo = enums.write(enums.publicKey, this.algorithm);\n\n if (this.version === 5) {\n // - A four-octet scalar octet count for the following key material.\n pos += 4;\n }\n\n // - A series of values comprising the key material.\n try {\n const { read, publicParams } = crypto.parsePublicKeyParams(algo, bytes.subarray(pos));\n this.publicParams = publicParams;\n pos += read;\n } catch (err) {\n throw new Error('Error reading MPIs');\n }\n\n // we set the fingerprint and keyID already to make it possible to put together the key packets directly in the Key constructor\n await this.computeFingerprintAndKeyID();\n return pos;\n }\n throw new UnsupportedError(`Version ${this.version} of the key packet is unsupported.`);\n }\n\n /**\n * Creates an OpenPGP public key packet for the given key.\n * @returns {Uint8Array} Bytes encoding the public key OpenPGP packet.\n */\n write() {\n const arr = [];\n // Version\n arr.push(new Uint8Array([this.version]));\n arr.push(util.writeDate(this.created));\n // A one-octet number denoting the public-key algorithm of this key\n const algo = enums.write(enums.publicKey, this.algorithm);\n arr.push(new Uint8Array([algo]));\n\n const params = crypto.serializeParams(algo, this.publicParams);\n if (this.version === 5) {\n // A four-octet scalar octet count for the following key material\n arr.push(util.writeNumber(params.length, 4));\n }\n // Algorithm-specific params\n arr.push(params);\n return util.concatUint8Array(arr);\n }\n\n /**\n * Write packet in order to be hashed; either for a signature or a fingerprint\n * @param {Integer} version - target version of signature or key\n */\n writeForHash(version) {\n const bytes = this.writePublicKey();\n\n if (version === 5) {\n return util.concatUint8Array([new Uint8Array([0x9A]), util.writeNumber(bytes.length, 4), bytes]);\n }\n return util.concatUint8Array([new Uint8Array([0x99]), util.writeNumber(bytes.length, 2), bytes]);\n }\n\n /**\n * Check whether secret-key data is available in decrypted form. Returns null for public keys.\n * @returns {Boolean|null}\n */\n isDecrypted() {\n return null;\n }\n\n /**\n * Returns the creation time of the key\n * @returns {Date}\n */\n getCreationTime() {\n return this.created;\n }\n\n /**\n * Return the key ID of the key\n * @returns {module:type/keyid~KeyID} The 8-byte key ID\n */\n getKeyID() {\n return this.keyID;\n }\n\n /**\n * Computes and set the key ID and fingerprint of the key\n * @async\n */\n async computeFingerprintAndKeyID() {\n await this.computeFingerprint();\n this.keyID = new KeyID();\n\n if (this.version === 5) {\n this.keyID.read(this.fingerprint.subarray(0, 8));\n } else if (this.version === 4) {\n this.keyID.read(this.fingerprint.subarray(12, 20));\n } else {\n throw new Error('Unsupported key version');\n }\n }\n\n /**\n * Computes and set the fingerprint of the key\n */\n async computeFingerprint() {\n const toHash = this.writeForHash(this.version);\n\n if (this.version === 5) {\n this.fingerprint = await crypto.hash.sha256(toHash);\n } else if (this.version === 4) {\n this.fingerprint = await crypto.hash.sha1(toHash);\n } else {\n throw new Error('Unsupported key version');\n }\n }\n\n /**\n * Returns the fingerprint of the key, as an array of bytes\n * @returns {Uint8Array} A Uint8Array containing the fingerprint\n */\n getFingerprintBytes() {\n return this.fingerprint;\n }\n\n /**\n * Calculates and returns the fingerprint of the key, as a string\n * @returns {String} A string containing the fingerprint in lowercase hex\n */\n getFingerprint() {\n return util.uint8ArrayToHex(this.getFingerprintBytes());\n }\n\n /**\n * Calculates whether two keys have the same fingerprint without actually calculating the fingerprint\n * @returns {Boolean} Whether the two keys have the same version and public key data.\n */\n hasSameFingerprintAs(other) {\n return this.version === other.version && util.equalsUint8Array(this.writePublicKey(), other.writePublicKey());\n }\n\n /**\n * Returns algorithm information\n * @returns {Object} An object of the form {algorithm: String, bits:int, curve:String}.\n */\n getAlgorithmInfo() {\n const result = {};\n result.algorithm = this.algorithm;\n // RSA, DSA or ElGamal public modulo\n const modulo = this.publicParams.n || this.publicParams.p;\n if (modulo) {\n result.bits = util.uint8ArrayBitLength(modulo);\n } else {\n result.curve = this.publicParams.oid.getName();\n }\n return result;\n }\n}\n\n/**\n * Alias of read()\n * @see PublicKeyPacket#read\n */\nPublicKeyPacket.prototype.readPublicKey = PublicKeyPacket.prototype.read;\n\n/**\n * Alias of write()\n * @see PublicKeyPacket#write\n */\nPublicKeyPacket.prototype.writePublicKey = PublicKeyPacket.prototype.write;\n\nexport default PublicKeyPacket;\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 crypto from '../crypto';\nimport enums from '../enums';\nimport util from '../util';\nimport defaultConfig from '../config';\n\nimport LiteralDataPacket from './literal_data';\nimport CompressedDataPacket from './compressed_data';\nimport OnePassSignaturePacket from './one_pass_signature';\nimport SignaturePacket from './signature';\nimport PacketList from './packetlist';\n\n// A SE packet can contain the following packet types\nconst allowedPackets = /*#__PURE__*/ util.constructAllowedPackets([\n LiteralDataPacket,\n CompressedDataPacket,\n OnePassSignaturePacket,\n SignaturePacket\n]);\n\n/**\n * Implementation of the Symmetrically Encrypted Data Packet (Tag 9)\n *\n * {@link https://tools.ietf.org/html/rfc4880#section-5.7|RFC4880 5.7}:\n * The Symmetrically Encrypted Data packet contains data encrypted with a\n * symmetric-key algorithm. When it has been decrypted, it contains other\n * packets (usually a literal data packet or compressed data packet, but in\n * theory other Symmetrically Encrypted Data packets or sequences of packets\n * that form whole OpenPGP messages).\n */\nclass SymmetricallyEncryptedDataPacket {\n static get tag() {\n return enums.packet.symmetricallyEncryptedData;\n }\n\n constructor() {\n /**\n * Encrypted secret-key data\n */\n this.encrypted = null;\n /**\n * Decrypted packets contained within.\n * @type {PacketList}\n */\n this.packets = null;\n }\n\n read(bytes) {\n this.encrypted = bytes;\n }\n\n write() {\n return this.encrypted;\n }\n\n /**\n * Decrypt the symmetrically-encrypted packet data\n * See {@link https://tools.ietf.org/html/rfc4880#section-9.2|RFC 4880 9.2} for algorithms.\n * @param {module:enums.symmetric} sessionKeyAlgorithm - Symmetric key algorithm to use\n * @param {Uint8Array} key - The key of cipher blocksize length to be used\n * @param {Object} [config] - Full configuration, defaults to openpgp.config\n\n * @throws {Error} if decryption was not successful\n * @async\n */\n async decrypt(sessionKeyAlgorithm, key, config = defaultConfig) {\n // If MDC errors are not being ignored, all missing MDC packets in symmetrically encrypted data should throw an error\n if (!config.allowUnauthenticatedMessages) {\n throw new Error('Message is not authenticated.');\n }\n\n const encrypted = await stream.readToEnd(stream.clone(this.encrypted));\n const decrypted = await crypto.mode.cfb.decrypt(sessionKeyAlgorithm, key,\n encrypted.subarray(crypto.cipher[sessionKeyAlgorithm].blockSize + 2),\n encrypted.subarray(2, crypto.cipher[sessionKeyAlgorithm].blockSize + 2)\n );\n\n this.packets = await PacketList.fromBinary(decrypted, allowedPackets, config);\n }\n\n /**\n * Encrypt the symmetrically-encrypted packet data\n * See {@link https://tools.ietf.org/html/rfc4880#section-9.2|RFC 4880 9.2} for algorithms.\n * @param {module:enums.symmetric} sessionKeyAlgorithm - Symmetric key algorithm to use\n * @param {Uint8Array} key - The key of cipher blocksize length to be used\n * @param {Object} [config] - Full configuration, defaults to openpgp.config\n * @throws {Error} if encryption was not successful\n * @async\n */\n async encrypt(algo, key, config = defaultConfig) {\n const data = this.packets.write();\n\n const prefix = await crypto.getPrefixRandom(algo);\n const FRE = await crypto.mode.cfb.encrypt(algo, key, prefix, new Uint8Array(crypto.cipher[algo].blockSize), config);\n const ciphertext = await crypto.mode.cfb.encrypt(algo, key, data, FRE.subarray(2), config);\n this.encrypted = util.concat([FRE, ciphertext]);\n }\n}\n\nexport default SymmetricallyEncryptedDataPacket;\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 enums from '../enums';\n\n/**\n * Implementation of the strange \"Marker packet\" (Tag 10)\n *\n * {@link https://tools.ietf.org/html/rfc4880#section-5.8|RFC4880 5.8}:\n * An experimental version of PGP used this packet as the Literal\n * packet, but no released version of PGP generated Literal packets with this\n * tag. With PGP 5.x, this packet has been reassigned and is reserved for use as\n * the Marker packet.\n *\n * The body of this packet consists of:\n * The three octets 0x50, 0x47, 0x50 (which spell \"PGP\" in UTF-8).\n *\n * Such a packet MUST be ignored when received. It may be placed at the\n * beginning of a message that uses features not available in PGP\n * version 2.6 in order to cause that version to report that newer\n * software is necessary to process the message.\n */\nclass MarkerPacket {\n static get tag() {\n return enums.packet.marker;\n }\n\n /**\n * Parsing function for a marker data packet (tag 10).\n * @param {Uint8Array} bytes - Payload of a tag 10 packet\n * @returns {Boolean} whether the packet payload contains \"PGP\"\n */\n read(bytes) {\n if (bytes[0] === 0x50 && // P\n bytes[1] === 0x47 && // G\n bytes[2] === 0x50) { // P\n return true;\n }\n return false;\n }\n\n write() {\n return new Uint8Array([0x50, 0x47, 0x50]);\n }\n}\n\nexport default MarkerPacket;\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 PublicKeyPacket from './public_key';\nimport enums from '../enums';\n\n/**\n * A Public-Subkey packet (tag 14) has exactly the same format as a\n * Public-Key packet, but denotes a subkey. One or more subkeys may be\n * associated with a top-level key. By convention, the top-level key\n * provides signature services, and the subkeys provide encryption\n * services.\n * @extends PublicKeyPacket\n */\nclass PublicSubkeyPacket extends PublicKeyPacket {\n static get tag() {\n return enums.packet.publicSubkey;\n }\n\n /**\n * @param {Date} [date] - Creation date\n * @param {Object} [config] - Full configuration, defaults to openpgp.config\n */\n // eslint-disable-next-line no-useless-constructor\n constructor(date, config) {\n super(date, config);\n }\n\n /**\n * Create a PublicSubkeyPacket from a SecretSubkeyPacket\n * @param {SecretSubkeyPacket} secretSubkeyPacket - subkey packet to convert\n * @returns {SecretSubkeyPacket} public key packet\n * @static\n */\n static fromSecretSubkeyPacket(secretSubkeyPacket) {\n const keyPacket = new PublicSubkeyPacket();\n const { version, created, algorithm, publicParams, keyID, fingerprint } = secretSubkeyPacket;\n keyPacket.version = version;\n keyPacket.created = created;\n keyPacket.algorithm = algorithm;\n keyPacket.publicParams = publicParams;\n keyPacket.keyID = keyID;\n keyPacket.fingerprint = fingerprint;\n return keyPacket;\n }\n}\n\nexport default PublicSubkeyPacket;\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 { readSimpleLength, writeSimpleLength } from './packet';\nimport enums from '../enums';\nimport util from '../util';\n\n/**\n * Implementation of the User Attribute Packet (Tag 17)\n *\n * The User Attribute packet is a variation of the User ID packet. It\n * is capable of storing more types of data than the User ID packet,\n * which is limited to text. Like the User ID packet, a User Attribute\n * packet may be certified by the key owner (\"self-signed\") or any other\n * key owner who cares to certify it. Except as noted, a User Attribute\n * packet may be used anywhere that a User ID packet may be used.\n *\n * While User Attribute packets are not a required part of the OpenPGP\n * standard, implementations SHOULD provide at least enough\n * compatibility to properly handle a certification signature on the\n * User Attribute packet. A simple way to do this is by treating the\n * User Attribute packet as a User ID packet with opaque contents, but\n * an implementation may use any method desired.\n */\nclass UserAttributePacket {\n static get tag() {\n return enums.packet.userAttribute;\n }\n\n constructor() {\n this.attributes = [];\n }\n\n /**\n * parsing function for a user attribute packet (tag 17).\n * @param {Uint8Array} input - Payload of a tag 17 packet\n */\n read(bytes) {\n let i = 0;\n while (i < bytes.length) {\n const len = readSimpleLength(bytes.subarray(i, bytes.length));\n i += len.offset;\n\n this.attributes.push(util.uint8ArrayToString(bytes.subarray(i, i + len.len)));\n i += len.len;\n }\n }\n\n /**\n * Creates a binary representation of the user attribute packet\n * @returns {Uint8Array} String representation.\n */\n write() {\n const arr = [];\n for (let i = 0; i < this.attributes.length; i++) {\n arr.push(writeSimpleLength(this.attributes[i].length));\n arr.push(util.stringToUint8Array(this.attributes[i]));\n }\n return util.concatUint8Array(arr);\n }\n\n /**\n * Compare for equality\n * @param {UserAttributePacket} usrAttr\n * @returns {Boolean} True if equal.\n */\n equals(usrAttr) {\n if (!usrAttr || !(usrAttr instanceof UserAttributePacket)) {\n return false;\n }\n return this.attributes.every(function(attr, index) {\n return attr === usrAttr.attributes[index];\n });\n }\n}\n\nexport default UserAttributePacket;\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 PublicKeyPacket from './public_key';\nimport S2K from '../type/s2k';\nimport crypto from '../crypto';\nimport enums from '../enums';\nimport util from '../util';\nimport defaultConfig from '../config';\n\n/**\n * A Secret-Key packet contains all the information that is found in a\n * Public-Key packet, including the public-key material, but also\n * includes the secret-key material after all the public-key fields.\n * @extends PublicKeyPacket\n */\nclass SecretKeyPacket extends PublicKeyPacket {\n static get tag() {\n return enums.packet.secretKey;\n }\n\n /**\n * @param {Date} [date] - Creation date\n * @param {Object} [config] - Full configuration, defaults to openpgp.config\n */\n constructor(date = new Date(), config = defaultConfig) {\n super(date, config);\n /**\n * Secret-key data\n */\n this.keyMaterial = null;\n /**\n * Indicates whether secret-key data is encrypted. `this.isEncrypted === false` means data is available in decrypted form.\n */\n this.isEncrypted = null;\n /**\n * S2K usage\n * @type {Integer}\n */\n this.s2kUsage = 0;\n /**\n * S2K object\n * @type {type/s2k}\n */\n this.s2k = null;\n /**\n * Symmetric algorithm\n * @type {String}\n */\n this.symmetric = null;\n /**\n * AEAD algorithm\n * @type {String}\n */\n this.aead = null;\n /**\n * Decrypted private parameters, referenced by name\n * @type {Object}\n */\n this.privateParams = null;\n }\n\n // 5.5.3. Secret-Key Packet Formats\n\n /**\n * Internal parser for private keys as specified in\n * {@link https://tools.ietf.org/html/draft-ietf-openpgp-rfc4880bis-04#section-5.5.3|RFC4880bis-04 section 5.5.3}\n * @param {String} bytes - Input string to read the packet from\n * @async\n */\n async read(bytes) {\n // - A Public-Key or Public-Subkey packet, as described above.\n let i = await this.readPublicKey(bytes);\n\n // - One octet indicating string-to-key usage conventions. Zero\n // indicates that the secret-key data is not encrypted. 255 or 254\n // indicates that a string-to-key specifier is being given. Any\n // other value is a symmetric-key encryption algorithm identifier.\n this.s2kUsage = bytes[i++];\n\n // - Only for a version 5 packet, a one-octet scalar octet count of\n // the next 4 optional fields.\n if (this.version === 5) {\n i++;\n }\n\n // - [Optional] If string-to-key usage octet was 255, 254, or 253, a\n // one-octet symmetric encryption algorithm.\n if (this.s2kUsage === 255 || this.s2kUsage === 254 || this.s2kUsage === 253) {\n this.symmetric = bytes[i++];\n this.symmetric = enums.read(enums.symmetric, this.symmetric);\n\n // - [Optional] If string-to-key usage octet was 253, a one-octet\n // AEAD algorithm.\n if (this.s2kUsage === 253) {\n this.aead = bytes[i++];\n this.aead = enums.read(enums.aead, this.aead);\n }\n\n // - [Optional] If string-to-key usage octet was 255, 254, or 253, a\n // string-to-key specifier. The length of the string-to-key\n // specifier is implied by its type, as described above.\n this.s2k = new S2K();\n i += this.s2k.read(bytes.subarray(i, bytes.length));\n\n if (this.s2k.type === 'gnu-dummy') {\n return;\n }\n } else if (this.s2kUsage) {\n this.symmetric = this.s2kUsage;\n this.symmetric = enums.read(enums.symmetric, this.symmetric);\n }\n\n // - [Optional] If secret data is encrypted (string-to-key usage octet\n // not zero), an Initial Vector (IV) of the same length as the\n // cipher's block size.\n if (this.s2kUsage) {\n this.iv = bytes.subarray(\n i,\n i + crypto.cipher[this.symmetric].blockSize\n );\n\n i += this.iv.length;\n }\n\n // - Only for a version 5 packet, a four-octet scalar octet count for\n // the following key material.\n if (this.version === 5) {\n i += 4;\n }\n\n // - Plain or encrypted multiprecision integers comprising the secret\n // key data. These algorithm-specific fields are as described\n // below.\n this.keyMaterial = bytes.subarray(i);\n this.isEncrypted = !!this.s2kUsage;\n\n if (!this.isEncrypted) {\n const cleartext = this.keyMaterial.subarray(0, -2);\n if (!util.equalsUint8Array(util.writeChecksum(cleartext), this.keyMaterial.subarray(-2))) {\n throw new Error('Key checksum mismatch');\n }\n try {\n const algo = enums.write(enums.publicKey, this.algorithm);\n const { privateParams } = crypto.parsePrivateKeyParams(algo, cleartext, this.publicParams);\n this.privateParams = privateParams;\n } catch (err) {\n throw new Error('Error reading MPIs');\n }\n }\n }\n\n /**\n * Creates an OpenPGP key packet for the given key.\n * @returns {Uint8Array} A string of bytes containing the secret key OpenPGP packet.\n */\n write() {\n const arr = [this.writePublicKey()];\n\n arr.push(new Uint8Array([this.s2kUsage]));\n\n const optionalFieldsArr = [];\n // - [Optional] If string-to-key usage octet was 255, 254, or 253, a\n // one- octet symmetric encryption algorithm.\n if (this.s2kUsage === 255 || this.s2kUsage === 254 || this.s2kUsage === 253) {\n optionalFieldsArr.push(enums.write(enums.symmetric, this.symmetric));\n\n // - [Optional] If string-to-key usage octet was 253, a one-octet\n // AEAD algorithm.\n if (this.s2kUsage === 253) {\n optionalFieldsArr.push(enums.write(enums.aead, this.aead));\n }\n\n // - [Optional] If string-to-key usage octet was 255, 254, or 253, a\n // string-to-key specifier. The length of the string-to-key\n // specifier is implied by its type, as described above.\n optionalFieldsArr.push(...this.s2k.write());\n }\n\n // - [Optional] If secret data is encrypted (string-to-key usage octet\n // not zero), an Initial Vector (IV) of the same length as the\n // cipher's block size.\n if (this.s2kUsage && this.s2k.type !== 'gnu-dummy') {\n optionalFieldsArr.push(...this.iv);\n }\n\n if (this.version === 5) {\n arr.push(new Uint8Array([optionalFieldsArr.length]));\n }\n arr.push(new Uint8Array(optionalFieldsArr));\n\n if (!this.isDummy()) {\n if (!this.s2kUsage) {\n const algo = enums.write(enums.publicKey, this.algorithm);\n this.keyMaterial = crypto.serializeParams(algo, this.privateParams);\n }\n\n if (this.version === 5) {\n arr.push(util.writeNumber(this.keyMaterial.length, 4));\n }\n arr.push(this.keyMaterial);\n\n if (!this.s2kUsage) {\n arr.push(util.writeChecksum(this.keyMaterial));\n }\n }\n\n return util.concatUint8Array(arr);\n }\n\n /**\n * Check whether secret-key data is available in decrypted form.\n * Returns false for gnu-dummy keys and null for public keys.\n * @returns {Boolean|null}\n */\n isDecrypted() {\n return this.isEncrypted === false;\n }\n\n /**\n * Check whether this is a gnu-dummy key\n * @returns {Boolean}\n */\n isDummy() {\n return !!(this.s2k && this.s2k.type === 'gnu-dummy');\n }\n\n /**\n * Remove private key material, converting the key to a dummy one.\n * The resulting key cannot be used for signing/decrypting but can still verify signatures.\n * @param {Object} [config] - Full configuration, defaults to openpgp.config\n */\n makeDummy(config = defaultConfig) {\n if (this.isDummy()) {\n return;\n }\n if (this.isDecrypted()) {\n this.clearPrivateParams();\n }\n this.isEncrypted = null;\n this.keyMaterial = null;\n this.s2k = new S2K(config);\n this.s2k.algorithm = 0;\n this.s2k.c = 0;\n this.s2k.type = 'gnu-dummy';\n this.s2kUsage = 254;\n this.symmetric = 'aes256';\n }\n\n /**\n * Encrypt the payload. By default, we use aes256 and iterated, salted string\n * to key specifier. If the key is in a decrypted state (isEncrypted === false)\n * and the passphrase is empty or undefined, the key will be set as not encrypted.\n * This can be used to remove passphrase protection after calling decrypt().\n * @param {String} passphrase\n * @param {Object} [config] - Full configuration, defaults to openpgp.config\n * @throws {Error} if encryption was not successful\n * @async\n */\n async encrypt(passphrase, config = defaultConfig) {\n if (this.isDummy()) {\n return;\n }\n\n if (!this.isDecrypted()) {\n throw new Error('Key packet is already encrypted');\n }\n\n if (this.isDecrypted() && !passphrase) {\n this.s2kUsage = 0;\n return;\n } else if (!passphrase) {\n throw new Error('The key must be decrypted before removing passphrase protection.');\n }\n\n this.s2k = new S2K(config);\n this.s2k.salt = await crypto.random.getRandomBytes(8);\n const algo = enums.write(enums.publicKey, this.algorithm);\n const cleartext = crypto.serializeParams(algo, this.privateParams);\n this.symmetric = 'aes256';\n const key = await produceEncryptionKey(this.s2k, passphrase, this.symmetric);\n const blockLen = crypto.cipher[this.symmetric].blockSize;\n this.iv = await crypto.random.getRandomBytes(blockLen);\n\n if (config.aeadProtect) {\n this.s2kUsage = 253;\n this.aead = 'eax';\n const mode = crypto.mode[this.aead];\n const modeInstance = await mode(this.symmetric, key);\n this.keyMaterial = await modeInstance.encrypt(cleartext, this.iv.subarray(0, mode.ivLength), new Uint8Array());\n } else {\n this.s2kUsage = 254;\n this.keyMaterial = await crypto.mode.cfb.encrypt(this.symmetric, key, util.concatUint8Array([\n cleartext,\n await crypto.hash.sha1(cleartext, config)\n ]), this.iv, config);\n }\n }\n\n /**\n * Decrypts the private key params which are needed to use the key.\n * Successful decryption does not imply key integrity, call validate() to confirm that.\n * {@link SecretKeyPacket.isDecrypted} should be false, as\n * otherwise calls to this function will throw an error.\n * @param {String} passphrase - The passphrase for this private key as string\n * @throws {Error} if the key is already decrypted, or if decryption was not successful\n * @async\n */\n async decrypt(passphrase) {\n if (this.isDummy()) {\n return false;\n }\n\n if (this.isDecrypted()) {\n throw new Error('Key packet is already decrypted.');\n }\n\n let key;\n if (this.s2kUsage === 254 || this.s2kUsage === 253) {\n key = await produceEncryptionKey(this.s2k, passphrase, this.symmetric);\n } else if (this.s2kUsage === 255) {\n throw new Error('Encrypted private key is authenticated using an insecure two-byte hash');\n } else {\n throw new Error('Private key is encrypted using an insecure S2K function: unsalted MD5');\n }\n\n let cleartext;\n if (this.s2kUsage === 253) {\n const mode = crypto.mode[this.aead];\n try {\n const modeInstance = await mode(this.symmetric, key);\n cleartext = await modeInstance.decrypt(this.keyMaterial, this.iv.subarray(0, mode.ivLength), new Uint8Array());\n } catch (err) {\n if (err.message === 'Authentication tag mismatch') {\n throw new Error('Incorrect key passphrase: ' + err.message);\n }\n throw err;\n }\n } else {\n const cleartextWithHash = await crypto.mode.cfb.decrypt(this.symmetric, key, this.keyMaterial, this.iv);\n\n cleartext = cleartextWithHash.subarray(0, -20);\n const hash = await crypto.hash.sha1(cleartext);\n\n if (!util.equalsUint8Array(hash, cleartextWithHash.subarray(-20))) {\n throw new Error('Incorrect key passphrase');\n }\n }\n\n try {\n const algo = enums.write(enums.publicKey, this.algorithm);\n const { privateParams } = crypto.parsePrivateKeyParams(algo, cleartext, this.publicParams);\n this.privateParams = privateParams;\n } catch (err) {\n throw new Error('Error reading MPIs');\n }\n this.isEncrypted = false;\n this.keyMaterial = null;\n this.s2kUsage = 0;\n }\n\n /**\n * Checks that the key parameters are consistent\n * @throws {Error} if validation was not successful\n * @async\n */\n async validate() {\n if (this.isDummy()) {\n return;\n }\n\n if (!this.isDecrypted()) {\n throw new Error('Key is not decrypted');\n }\n\n const algo = enums.write(enums.publicKey, this.algorithm);\n\n let validParams;\n try {\n // this can throw if some parameters are undefined\n validParams = await crypto.validateParams(algo, this.publicParams, this.privateParams);\n } catch (_) {\n validParams = false;\n }\n if (!validParams) {\n throw new Error('Key is invalid');\n }\n }\n\n async generate(bits, curve) {\n const algo = enums.write(enums.publicKey, this.algorithm);\n const { privateParams, publicParams } = await crypto.generateParams(algo, bits, curve);\n this.privateParams = privateParams;\n this.publicParams = publicParams;\n this.isEncrypted = false;\n }\n\n /**\n * Clear private key parameters\n */\n clearPrivateParams() {\n if (this.isDummy()) {\n return;\n }\n\n Object.keys(this.privateParams).forEach(name => {\n const param = this.privateParams[name];\n param.fill(0);\n delete this.privateParams[name];\n });\n this.privateParams = null;\n this.isEncrypted = true;\n }\n}\n\nasync function produceEncryptionKey(s2k, passphrase, algorithm) {\n return s2k.produceKey(\n passphrase,\n crypto.cipher[algorithm].keySize\n );\n}\n\nexport default SecretKeyPacket;\n","\n// email-addresses.js - RFC 5322 email address parser\n// v 3.1.0\n//\n// http://tools.ietf.org/html/rfc5322\n//\n// This library does not validate email addresses.\n// emailAddresses attempts to parse addresses using the (fairly liberal)\n// grammar specified in RFC 5322.\n//\n// email-addresses returns {\n// ast: <an abstract syntax tree based on rfc5322>,\n// addresses: [{\n// node: <node in ast for this address>,\n// name: <display-name>,\n// address: <addr-spec>,\n// local: <local-part>,\n// domain: <domain>\n// }, ...]\n// }\n//\n// emailAddresses.parseOneAddress and emailAddresses.parseAddressList\n// work as you might expect. Try it out.\n//\n// Many thanks to Dominic Sayers and his documentation on the is_email function,\n// http://code.google.com/p/isemail/ , which helped greatly in writing this parser.\n\n(function (global) {\n\"use strict\";\n\nfunction parse5322(opts) {\n\n // tokenizing functions\n\n function inStr() { return pos < len; }\n function curTok() { return parseString[pos]; }\n function getPos() { return pos; }\n function setPos(i) { pos = i; }\n function nextTok() { pos += 1; }\n function initialize() {\n pos = 0;\n len = parseString.length;\n }\n\n // parser helper functions\n\n function o(name, value) {\n return {\n name: name,\n tokens: value || \"\",\n semantic: value || \"\",\n children: []\n };\n }\n\n function wrap(name, ast) {\n var n;\n if (ast === null) { return null; }\n n = o(name);\n n.tokens = ast.tokens;\n n.semantic = ast.semantic;\n n.children.push(ast);\n return n;\n }\n\n function add(parent, child) {\n if (child !== null) {\n parent.tokens += child.tokens;\n parent.semantic += child.semantic;\n }\n parent.children.push(child);\n return parent;\n }\n\n function compareToken(fxnCompare) {\n var tok;\n if (!inStr()) { return null; }\n tok = curTok();\n if (fxnCompare(tok)) {\n nextTok();\n return o('token', tok);\n }\n return null;\n }\n\n function literal(lit) {\n return function literalFunc() {\n return wrap('literal', compareToken(function (tok) {\n return tok === lit;\n }));\n };\n }\n\n function and() {\n var args = arguments;\n return function andFunc() {\n var i, s, result, start;\n start = getPos();\n s = o('and');\n for (i = 0; i < args.length; i += 1) {\n result = args[i]();\n if (result === null) {\n setPos(start);\n return null;\n }\n add(s, result);\n }\n return s;\n };\n }\n\n function or() {\n var args = arguments;\n return function orFunc() {\n var i, result, start;\n start = getPos();\n for (i = 0; i < args.length; i += 1) {\n result = args[i]();\n if (result !== null) {\n return result;\n }\n setPos(start);\n }\n return null;\n };\n }\n\n function opt(prod) {\n return function optFunc() {\n var result, start;\n start = getPos();\n result = prod();\n if (result !== null) {\n return result;\n }\n else {\n setPos(start);\n return o('opt');\n }\n };\n }\n\n function invis(prod) {\n return function invisFunc() {\n var result = prod();\n if (result !== null) {\n result.semantic = \"\";\n }\n return result;\n };\n }\n\n function colwsp(prod) {\n return function collapseSemanticWhitespace() {\n var result = prod();\n if (result !== null && result.semantic.length > 0) {\n result.semantic = \" \";\n }\n return result;\n };\n }\n\n function star(prod, minimum) {\n return function starFunc() {\n var s, result, count, start, min;\n start = getPos();\n s = o('star');\n count = 0;\n min = minimum === undefined ? 0 : minimum;\n while ((result = prod()) !== null) {\n count = count + 1;\n add(s, result);\n }\n if (count >= min) {\n return s;\n }\n else {\n setPos(start);\n return null;\n }\n };\n }\n\n // One expects names to get normalized like this:\n // \" First Last \" -> \"First Last\"\n // \"First Last\" -> \"First Last\"\n // \"First Last\" -> \"First Last\"\n function collapseWhitespace(s) {\n return s.replace(/([ \\t]|\\r\\n)+/g, ' ').replace(/^\\s*/, '').replace(/\\s*$/, '');\n }\n\n // UTF-8 pseudo-production (RFC 6532)\n // RFC 6532 extends RFC 5322 productions to include UTF-8\n // using the following productions:\n // UTF8-non-ascii = UTF8-2 / UTF8-3 / UTF8-4\n // UTF8-2 = <Defined in Section 4 of RFC3629>\n // UTF8-3 = <Defined in Section 4 of RFC3629>\n // UTF8-4 = <Defined in Section 4 of RFC3629>\n //\n // For reference, the extended RFC 5322 productions are:\n // VCHAR =/ UTF8-non-ascii\n // ctext =/ UTF8-non-ascii\n // atext =/ UTF8-non-ascii\n // qtext =/ UTF8-non-ascii\n // dtext =/ UTF8-non-ascii\n function isUTF8NonAscii(tok) {\n // In JavaScript, we just deal directly with Unicode code points,\n // so we aren't checking individual bytes for UTF-8 encoding.\n // Just check that the character is non-ascii.\n return tok.charCodeAt(0) >= 128;\n }\n\n\n // common productions (RFC 5234)\n // http://tools.ietf.org/html/rfc5234\n // B.1. Core Rules\n\n // CR = %x0D\n // ; carriage return\n function cr() { return wrap('cr', literal('\\r')()); }\n\n // CRLF = CR LF\n // ; Internet standard newline\n function crlf() { return wrap('crlf', and(cr, lf)()); }\n\n // DQUOTE = %x22\n // ; \" (Double Quote)\n function dquote() { return wrap('dquote', literal('\"')()); }\n\n // HTAB = %x09\n // ; horizontal tab\n function htab() { return wrap('htab', literal('\\t')()); }\n\n // LF = %x0A\n // ; linefeed\n function lf() { return wrap('lf', literal('\\n')()); }\n\n // SP = %x20\n function sp() { return wrap('sp', literal(' ')()); }\n\n // VCHAR = %x21-7E\n // ; visible (printing) characters\n function vchar() {\n return wrap('vchar', compareToken(function vcharFunc(tok) {\n var code = tok.charCodeAt(0);\n var accept = (0x21 <= code && code <= 0x7E);\n if (opts.rfc6532) {\n accept = accept || isUTF8NonAscii(tok);\n }\n return accept;\n }));\n }\n\n // WSP = SP / HTAB\n // ; white space\n function wsp() { return wrap('wsp', or(sp, htab)()); }\n\n\n // email productions (RFC 5322)\n // http://tools.ietf.org/html/rfc5322\n // 3.2.1. Quoted characters\n\n // quoted-pair = (\"\\\" (VCHAR / WSP)) / obs-qp\n function quotedPair() {\n var qp = wrap('quoted-pair',\n or(\n and(literal('\\\\'), or(vchar, wsp)),\n obsQP\n )());\n if (qp === null) { return null; }\n // a quoted pair will be two characters, and the \"\\\" character\n // should be semantically \"invisible\" (RFC 5322 3.2.1)\n qp.semantic = qp.semantic[1];\n return qp;\n }\n\n // 3.2.2. Folding White Space and Comments\n\n // FWS = ([*WSP CRLF] 1*WSP) / obs-FWS\n function fws() {\n return wrap('fws', or(\n obsFws,\n and(\n opt(and(\n star(wsp),\n invis(crlf)\n )),\n star(wsp, 1)\n )\n )());\n }\n\n // ctext = %d33-39 / ; Printable US-ASCII\n // %d42-91 / ; characters not including\n // %d93-126 / ; \"(\", \")\", or \"\\\"\n // obs-ctext\n function ctext() {\n return wrap('ctext', or(\n function ctextFunc1() {\n return compareToken(function ctextFunc2(tok) {\n var code = tok.charCodeAt(0);\n var accept =\n (33 <= code && code <= 39) ||\n (42 <= code && code <= 91) ||\n (93 <= code && code <= 126);\n if (opts.rfc6532) {\n accept = accept || isUTF8NonAscii(tok);\n }\n return accept;\n });\n },\n obsCtext\n )());\n }\n\n // ccontent = ctext / quoted-pair / comment\n function ccontent() {\n return wrap('ccontent', or(ctext, quotedPair, comment)());\n }\n\n // comment = \"(\" *([FWS] ccontent) [FWS] \")\"\n function comment() {\n return wrap('comment', and(\n literal('('),\n star(and(opt(fws), ccontent)),\n opt(fws),\n literal(')')\n )());\n }\n\n // CFWS = (1*([FWS] comment) [FWS]) / FWS\n function cfws() {\n return wrap('cfws', or(\n and(\n star(\n and(opt(fws), comment),\n 1\n ),\n opt(fws)\n ),\n fws\n )());\n }\n\n // 3.2.3. Atom\n\n //atext = ALPHA / DIGIT / ; Printable US-ASCII\n // \"!\" / \"#\" / ; characters not including\n // \"$\" / \"%\" / ; specials. Used for atoms.\n // \"&\" / \"'\" /\n // \"*\" / \"+\" /\n // \"-\" / \"/\" /\n // \"=\" / \"?\" /\n // \"^\" / \"_\" /\n // \"`\" / \"{\" /\n // \"|\" / \"}\" /\n // \"~\"\n function atext() {\n return wrap('atext', compareToken(function atextFunc(tok) {\n var accept =\n ('a' <= tok && tok <= 'z') ||\n ('A' <= tok && tok <= 'Z') ||\n ('0' <= tok && tok <= '9') ||\n (['!', '#', '$', '%', '&', '\\'', '*', '+', '-', '/',\n '=', '?', '^', '_', '`', '{', '|', '}', '~'].indexOf(tok) >= 0);\n if (opts.rfc6532) {\n accept = accept || isUTF8NonAscii(tok);\n }\n return accept;\n }));\n }\n\n // atom = [CFWS] 1*atext [CFWS]\n function atom() {\n return wrap('atom', and(colwsp(opt(cfws)), star(atext, 1), colwsp(opt(cfws)))());\n }\n\n // dot-atom-text = 1*atext *(\".\" 1*atext)\n function dotAtomText() {\n var s, maybeText;\n s = wrap('dot-atom-text', star(atext, 1)());\n if (s === null) { return s; }\n maybeText = star(and(literal('.'), star(atext, 1)))();\n if (maybeText !== null) {\n add(s, maybeText);\n }\n return s;\n }\n\n // dot-atom = [CFWS] dot-atom-text [CFWS]\n function dotAtom() {\n return wrap('dot-atom', and(invis(opt(cfws)), dotAtomText, invis(opt(cfws)))());\n }\n\n // 3.2.4. Quoted Strings\n\n // qtext = %d33 / ; Printable US-ASCII\n // %d35-91 / ; characters not including\n // %d93-126 / ; \"\\\" or the quote character\n // obs-qtext\n function qtext() {\n return wrap('qtext', or(\n function qtextFunc1() {\n return compareToken(function qtextFunc2(tok) {\n var code = tok.charCodeAt(0);\n var accept =\n (33 === code) ||\n (35 <= code && code <= 91) ||\n (93 <= code && code <= 126);\n if (opts.rfc6532) {\n accept = accept || isUTF8NonAscii(tok);\n }\n return accept;\n });\n },\n obsQtext\n )());\n }\n\n // qcontent = qtext / quoted-pair\n function qcontent() {\n return wrap('qcontent', or(qtext, quotedPair)());\n }\n\n // quoted-string = [CFWS]\n // DQUOTE *([FWS] qcontent) [FWS] DQUOTE\n // [CFWS]\n function quotedString() {\n return wrap('quoted-string', and(\n invis(opt(cfws)),\n invis(dquote), star(and(opt(colwsp(fws)), qcontent)), opt(invis(fws)), invis(dquote),\n invis(opt(cfws))\n )());\n }\n\n // 3.2.5 Miscellaneous Tokens\n\n // word = atom / quoted-string\n function word() {\n return wrap('word', or(atom, quotedString)());\n }\n\n // phrase = 1*word / obs-phrase\n function phrase() {\n return wrap('phrase', or(obsPhrase, star(word, 1))());\n }\n\n // 3.4. Address Specification\n // address = mailbox / group\n function address() {\n return wrap('address', or(mailbox, group)());\n }\n\n // mailbox = name-addr / addr-spec\n function mailbox() {\n return wrap('mailbox', or(nameAddr, addrSpec)());\n }\n\n // name-addr = [display-name] angle-addr\n function nameAddr() {\n return wrap('name-addr', and(opt(displayName), angleAddr)());\n }\n\n // angle-addr = [CFWS] \"<\" addr-spec \">\" [CFWS] /\n // obs-angle-addr\n function angleAddr() {\n return wrap('angle-addr', or(\n and(\n invis(opt(cfws)),\n literal('<'),\n addrSpec,\n literal('>'),\n invis(opt(cfws))\n ),\n obsAngleAddr\n )());\n }\n\n // group = display-name \":\" [group-list] \";\" [CFWS]\n function group() {\n return wrap('group', and(\n displayName,\n literal(':'),\n opt(groupList),\n literal(';'),\n invis(opt(cfws))\n )());\n }\n\n // display-name = phrase\n function displayName() {\n return wrap('display-name', function phraseFixedSemantic() {\n var result = phrase();\n if (result !== null) {\n result.semantic = collapseWhitespace(result.semantic);\n }\n return result;\n }());\n }\n\n // mailbox-list = (mailbox *(\",\" mailbox)) / obs-mbox-list\n function mailboxList() {\n return wrap('mailbox-list', or(\n and(\n mailbox,\n star(and(literal(','), mailbox))\n ),\n obsMboxList\n )());\n }\n\n // address-list = (address *(\",\" address)) / obs-addr-list\n function addressList() {\n return wrap('address-list', or(\n and(\n address,\n star(and(literal(','), address))\n ),\n obsAddrList\n )());\n }\n\n // group-list = mailbox-list / CFWS / obs-group-list\n function groupList() {\n return wrap('group-list', or(\n mailboxList,\n invis(cfws),\n obsGroupList\n )());\n }\n\n // 3.4.1 Addr-Spec Specification\n\n // local-part = dot-atom / quoted-string / obs-local-part\n function localPart() {\n // note: quoted-string, dotAtom are proper subsets of obs-local-part\n // so we really just have to look for obsLocalPart, if we don't care about the exact parse tree\n return wrap('local-part', or(obsLocalPart, dotAtom, quotedString)());\n }\n\n // dtext = %d33-90 / ; Printable US-ASCII\n // %d94-126 / ; characters not including\n // obs-dtext ; \"[\", \"]\", or \"\\\"\n function dtext() {\n return wrap('dtext', or(\n function dtextFunc1() {\n return compareToken(function dtextFunc2(tok) {\n var code = tok.charCodeAt(0);\n var accept =\n (33 <= code && code <= 90) ||\n (94 <= code && code <= 126);\n if (opts.rfc6532) {\n accept = accept || isUTF8NonAscii(tok);\n }\n return accept;\n });\n },\n obsDtext\n )()\n );\n }\n\n // domain-literal = [CFWS] \"[\" *([FWS] dtext) [FWS] \"]\" [CFWS]\n function domainLiteral() {\n return wrap('domain-literal', and(\n invis(opt(cfws)),\n literal('['),\n star(and(opt(fws), dtext)),\n opt(fws),\n literal(']'),\n invis(opt(cfws))\n )());\n }\n\n // domain = dot-atom / domain-literal / obs-domain\n function domain() {\n return wrap('domain', function domainCheckTLD() {\n var result = or(obsDomain, dotAtom, domainLiteral)();\n if (opts.rejectTLD) {\n if (result && result.semantic && result.semantic.indexOf('.') < 0) {\n return null;\n }\n }\n // strip all whitespace from domains\n if (result) {\n result.semantic = result.semantic.replace(/\\s+/g, '');\n }\n return result;\n }());\n }\n\n // addr-spec = local-part \"@\" domain\n function addrSpec() {\n return wrap('addr-spec', and(\n localPart, literal('@'), domain\n )());\n }\n\n // 3.6.2 Originator Fields\n // Below we only parse the field body, not the name of the field\n // like \"From:\", \"Sender:\", or \"Reply-To:\". Other libraries that\n // parse email headers can parse those and defer to these productions\n // for the \"RFC 5322\" part.\n\n // RFC 6854 2.1. Replacement of RFC 5322, Section 3.6.2. Originator Fields\n // from = \"From:\" (mailbox-list / address-list) CRLF\n function fromSpec() {\n return wrap('from', or(\n mailboxList,\n addressList\n )());\n }\n\n // RFC 6854 2.1. Replacement of RFC 5322, Section 3.6.2. Originator Fields\n // sender = \"Sender:\" (mailbox / address) CRLF\n function senderSpec() {\n return wrap('sender', or(\n mailbox,\n address\n )());\n }\n\n // RFC 6854 2.1. Replacement of RFC 5322, Section 3.6.2. Originator Fields\n // reply-to = \"Reply-To:\" address-list CRLF\n function replyToSpec() {\n return wrap('reply-to', addressList());\n }\n\n // 4.1. Miscellaneous Obsolete Tokens\n\n // obs-NO-WS-CTL = %d1-8 / ; US-ASCII control\n // %d11 / ; characters that do not\n // %d12 / ; include the carriage\n // %d14-31 / ; return, line feed, and\n // %d127 ; white space characters\n function obsNoWsCtl() {\n return opts.strict ? null : wrap('obs-NO-WS-CTL', compareToken(function (tok) {\n var code = tok.charCodeAt(0);\n return ((1 <= code && code <= 8) ||\n (11 === code || 12 === code) ||\n (14 <= code && code <= 31) ||\n (127 === code));\n }));\n }\n\n // obs-ctext = obs-NO-WS-CTL\n function obsCtext() { return opts.strict ? null : wrap('obs-ctext', obsNoWsCtl()); }\n\n // obs-qtext = obs-NO-WS-CTL\n function obsQtext() { return opts.strict ? null : wrap('obs-qtext', obsNoWsCtl()); }\n\n // obs-qp = \"\\\" (%d0 / obs-NO-WS-CTL / LF / CR)\n function obsQP() {\n return opts.strict ? null : wrap('obs-qp', and(\n literal('\\\\'),\n or(literal('\\0'), obsNoWsCtl, lf, cr)\n )());\n }\n\n // obs-phrase = word *(word / \".\" / CFWS)\n function obsPhrase() {\n if (opts.strict ) return null;\n return opts.atInDisplayName ? wrap('obs-phrase', and(\n word,\n star(or(word, literal('.'), literal('@'), colwsp(cfws)))\n )()) :\n wrap('obs-phrase', and(\n word,\n star(or(word, literal('.'), colwsp(cfws)))\n )());\n }\n\n // 4.2. Obsolete Folding White Space\n\n // NOTE: read the errata http://www.rfc-editor.org/errata_search.php?rfc=5322&eid=1908\n // obs-FWS = 1*([CRLF] WSP)\n function obsFws() {\n return opts.strict ? null : wrap('obs-FWS', star(\n and(invis(opt(crlf)), wsp),\n 1\n )());\n }\n\n // 4.4. Obsolete Addressing\n\n // obs-angle-addr = [CFWS] \"<\" obs-route addr-spec \">\" [CFWS]\n function obsAngleAddr() {\n return opts.strict ? null : wrap('obs-angle-addr', and(\n invis(opt(cfws)),\n literal('<'),\n obsRoute,\n addrSpec,\n literal('>'),\n invis(opt(cfws))\n )());\n }\n\n // obs-route = obs-domain-list \":\"\n function obsRoute() {\n return opts.strict ? null : wrap('obs-route', and(\n obsDomainList,\n literal(':')\n )());\n }\n\n // obs-domain-list = *(CFWS / \",\") \"@\" domain\n // *(\",\" [CFWS] [\"@\" domain])\n function obsDomainList() {\n return opts.strict ? null : wrap('obs-domain-list', and(\n star(or(invis(cfws), literal(','))),\n literal('@'),\n domain,\n star(and(\n literal(','),\n invis(opt(cfws)),\n opt(and(literal('@'), domain))\n ))\n )());\n }\n\n // obs-mbox-list = *([CFWS] \",\") mailbox *(\",\" [mailbox / CFWS])\n function obsMboxList() {\n return opts.strict ? null : wrap('obs-mbox-list', and(\n star(and(\n invis(opt(cfws)),\n literal(',')\n )),\n mailbox,\n star(and(\n literal(','),\n opt(and(\n mailbox,\n invis(cfws)\n ))\n ))\n )());\n }\n\n // obs-addr-list = *([CFWS] \",\") address *(\",\" [address / CFWS])\n function obsAddrList() {\n return opts.strict ? null : wrap('obs-addr-list', and(\n star(and(\n invis(opt(cfws)),\n literal(',')\n )),\n address,\n star(and(\n literal(','),\n opt(and(\n address,\n invis(cfws)\n ))\n ))\n )());\n }\n\n // obs-group-list = 1*([CFWS] \",\") [CFWS]\n function obsGroupList() {\n return opts.strict ? null : wrap('obs-group-list', and(\n star(and(\n invis(opt(cfws)),\n literal(',')\n ), 1),\n invis(opt(cfws))\n )());\n }\n\n // obs-local-part = word *(\".\" word)\n function obsLocalPart() {\n return opts.strict ? null : wrap('obs-local-part', and(word, star(and(literal('.'), word)))());\n }\n\n // obs-domain = atom *(\".\" atom)\n function obsDomain() {\n return opts.strict ? null : wrap('obs-domain', and(atom, star(and(literal('.'), atom)))());\n }\n\n // obs-dtext = obs-NO-WS-CTL / quoted-pair\n function obsDtext() {\n return opts.strict ? null : wrap('obs-dtext', or(obsNoWsCtl, quotedPair)());\n }\n\n /////////////////////////////////////////////////////\n\n // ast analysis\n\n function findNode(name, root) {\n var i, stack, node;\n if (root === null || root === undefined) { return null; }\n stack = [root];\n while (stack.length > 0) {\n node = stack.pop();\n if (node.name === name) {\n return node;\n }\n for (i = node.children.length - 1; i >= 0; i -= 1) {\n stack.push(node.children[i]);\n }\n }\n return null;\n }\n\n function findAllNodes(name, root) {\n var i, stack, node, result;\n if (root === null || root === undefined) { return null; }\n stack = [root];\n result = [];\n while (stack.length > 0) {\n node = stack.pop();\n if (node.name === name) {\n result.push(node);\n }\n for (i = node.children.length - 1; i >= 0; i -= 1) {\n stack.push(node.children[i]);\n }\n }\n return result;\n }\n\n function findAllNodesNoChildren(names, root) {\n var i, stack, node, result, namesLookup;\n if (root === null || root === undefined) { return null; }\n stack = [root];\n result = [];\n namesLookup = {};\n for (i = 0; i < names.length; i += 1) {\n namesLookup[names[i]] = true;\n }\n\n while (stack.length > 0) {\n node = stack.pop();\n if (node.name in namesLookup) {\n result.push(node);\n // don't look at children (hence findAllNodesNoChildren)\n } else {\n for (i = node.children.length - 1; i >= 0; i -= 1) {\n stack.push(node.children[i]);\n }\n }\n }\n return result;\n }\n\n function giveResult(ast) {\n var addresses, groupsAndMailboxes, i, groupOrMailbox, result;\n if (ast === null) {\n return null;\n }\n addresses = [];\n\n // An address is a 'group' (i.e. a list of mailboxes) or a 'mailbox'.\n groupsAndMailboxes = findAllNodesNoChildren(['group', 'mailbox'], ast);\n for (i = 0; i < groupsAndMailboxes.length; i += 1) {\n groupOrMailbox = groupsAndMailboxes[i];\n if (groupOrMailbox.name === 'group') {\n addresses.push(giveResultGroup(groupOrMailbox));\n } else if (groupOrMailbox.name === 'mailbox') {\n addresses.push(giveResultMailbox(groupOrMailbox));\n }\n }\n\n result = {\n ast: ast,\n addresses: addresses,\n };\n if (opts.simple) {\n result = simplifyResult(result);\n }\n if (opts.oneResult) {\n return oneResult(result);\n }\n if (opts.simple) {\n return result && result.addresses;\n } else {\n return result;\n }\n }\n\n function giveResultGroup(group) {\n var i;\n var groupName = findNode('display-name', group);\n var groupResultMailboxes = [];\n var mailboxes = findAllNodesNoChildren(['mailbox'], group);\n for (i = 0; i < mailboxes.length; i += 1) {\n groupResultMailboxes.push(giveResultMailbox(mailboxes[i]));\n }\n return {\n node: group,\n parts: {\n name: groupName,\n },\n type: group.name, // 'group'\n name: grabSemantic(groupName),\n addresses: groupResultMailboxes,\n };\n }\n\n function giveResultMailbox(mailbox) {\n var name = findNode('display-name', mailbox);\n var aspec = findNode('addr-spec', mailbox);\n var cfws = findAllNodes('cfws', mailbox);\n var comments = findAllNodesNoChildren(['comment'], mailbox);\n\n\n var local = findNode('local-part', aspec);\n var domain = findNode('domain', aspec);\n return {\n node: mailbox,\n parts: {\n name: name,\n address: aspec,\n local: local,\n domain: domain,\n comments: cfws\n },\n type: mailbox.name, // 'mailbox'\n name: grabSemantic(name),\n address: grabSemantic(aspec),\n local: grabSemantic(local),\n domain: grabSemantic(domain),\n comments: concatComments(comments),\n groupName: grabSemantic(mailbox.groupName),\n };\n }\n\n function grabSemantic(n) {\n return n !== null && n !== undefined ? n.semantic : null;\n }\n\n function simplifyResult(result) {\n var i;\n if (result && result.addresses) {\n for (i = 0; i < result.addresses.length; i += 1) {\n delete result.addresses[i].node;\n }\n }\n return result;\n }\n\n function concatComments(comments) {\n var result = '';\n if (comments) {\n for (var i = 0; i < comments.length; i += 1) {\n result += grabSemantic(comments[i]);\n }\n }\n return result;\n }\n\n function oneResult(result) {\n if (!result) { return null; }\n if (!opts.partial && result.addresses.length > 1) { return null; }\n return result.addresses && result.addresses[0];\n }\n\n /////////////////////////////////////////////////////\n\n var parseString, pos, len, parsed, startProduction;\n\n opts = handleOpts(opts, {});\n if (opts === null) { return null; }\n\n parseString = opts.input;\n\n startProduction = {\n 'address': address,\n 'address-list': addressList,\n 'angle-addr': angleAddr,\n 'from': fromSpec,\n 'group': group,\n 'mailbox': mailbox,\n 'mailbox-list': mailboxList,\n 'reply-to': replyToSpec,\n 'sender': senderSpec,\n }[opts.startAt] || addressList;\n\n if (!opts.strict) {\n initialize();\n opts.strict = true;\n parsed = startProduction(parseString);\n if (opts.partial || !inStr()) {\n return giveResult(parsed);\n }\n opts.strict = false;\n }\n\n initialize();\n parsed = startProduction(parseString);\n if (!opts.partial && inStr()) { return null; }\n return giveResult(parsed);\n}\n\nfunction parseOneAddressSimple(opts) {\n return parse5322(handleOpts(opts, {\n oneResult: true,\n rfc6532: true,\n simple: true,\n startAt: 'address-list',\n }));\n}\n\nfunction parseAddressListSimple(opts) {\n return parse5322(handleOpts(opts, {\n rfc6532: true,\n simple: true,\n startAt: 'address-list',\n }));\n}\n\nfunction parseFromSimple(opts) {\n return parse5322(handleOpts(opts, {\n rfc6532: true,\n simple: true,\n startAt: 'from',\n }));\n}\n\nfunction parseSenderSimple(opts) {\n return parse5322(handleOpts(opts, {\n oneResult: true,\n rfc6532: true,\n simple: true,\n startAt: 'sender',\n }));\n}\n\nfunction parseReplyToSimple(opts) {\n return parse5322(handleOpts(opts, {\n rfc6532: true,\n simple: true,\n startAt: 'reply-to',\n }));\n}\n\nfunction handleOpts(opts, defs) {\n function isString(str) {\n return Object.prototype.toString.call(str) === '[object String]';\n }\n\n function isObject(o) {\n return o === Object(o);\n }\n\n function isNullUndef(o) {\n return o === null || o === undefined;\n }\n\n var defaults, o;\n\n if (isString(opts)) {\n opts = { input: opts };\n } else if (!isObject(opts)) {\n return null;\n }\n\n if (!isString(opts.input)) { return null; }\n if (!defs) { return null; }\n\n defaults = {\n oneResult: false,\n partial: false,\n rejectTLD: false,\n rfc6532: false,\n simple: false,\n startAt: 'address-list',\n strict: false,\n atInDisplayName: false\n };\n\n for (o in defaults) {\n if (isNullUndef(opts[o])) {\n opts[o] = !isNullUndef(defs[o]) ? defs[o] : defaults[o];\n }\n }\n return opts;\n}\n\nparse5322.parseOneAddress = parseOneAddressSimple;\nparse5322.parseAddressList = parseAddressListSimple;\nparse5322.parseFrom = parseFromSimple;\nparse5322.parseSender = parseSenderSimple;\nparse5322.parseReplyTo = parseReplyToSimple;\n\nif (typeof module !== 'undefined' && typeof module.exports !== 'undefined') {\n module.exports = parse5322;\n} else {\n global.emailAddresses = parse5322;\n}\n\n}(this));\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 emailAddresses from 'email-addresses';\n\nimport enums from '../enums';\nimport util from '../util';\nimport defaultConfig from '../config';\n\n/**\n * Implementation of the User ID Packet (Tag 13)\n *\n * A User ID packet consists of UTF-8 text that is intended to represent\n * the name and email address of the key holder. By convention, it\n * includes an RFC 2822 [RFC2822] mail name-addr, but there are no\n * restrictions on its content. The packet length in the header\n * specifies the length of the User ID.\n */\nclass UserIDPacket {\n static get tag() {\n return enums.packet.userID;\n }\n\n constructor() {\n /** A string containing the user id. Usually in the form\n * John Doe <john@example.com>\n * @type {String}\n */\n this.userID = '';\n\n this.name = '';\n this.email = '';\n this.comment = '';\n }\n\n /**\n * Create UserIDPacket instance from object\n * @param {Object} userID - Object specifying userID name, email and comment\n * @returns {UserIDPacket}\n * @static\n */\n static fromObject(userID) {\n if (util.isString(userID) ||\n (userID.name && !util.isString(userID.name)) ||\n (userID.email && !util.isEmailAddress(userID.email)) ||\n (userID.comment && !util.isString(userID.comment))) {\n throw new Error('Invalid user ID format');\n }\n const packet = new UserIDPacket();\n Object.assign(packet, userID);\n const components = [];\n if (packet.name) components.push(packet.name);\n if (packet.comment) components.push(`(${packet.comment})`);\n if (packet.email) components.push(`<${packet.email}>`);\n packet.userID = components.join(' ');\n return packet;\n }\n\n /**\n * Parsing function for a user id packet (tag 13).\n * @param {Uint8Array} input - Payload of a tag 13 packet\n */\n read(bytes, config = defaultConfig) {\n const userID = util.decodeUTF8(bytes);\n if (userID.length > config.maxUserIDLength) {\n throw new Error('User ID string is too long');\n }\n try {\n const { name, address: email, comments } = emailAddresses.parseOneAddress({ input: userID, atInDisplayName: true });\n this.comment = comments.replace(/^\\(|\\)$/g, '');\n this.name = name;\n this.email = email;\n } catch (e) {}\n this.userID = userID;\n }\n\n /**\n * Creates a binary representation of the user id packet\n * @returns {Uint8Array} Binary representation.\n */\n write() {\n return util.encodeUTF8(this.userID);\n }\n\n equals(otherUserID) {\n return otherUserID && otherUserID.userID === this.userID;\n }\n}\n\nexport default UserIDPacket;\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 SecretKeyPacket from './secret_key';\nimport enums from '../enums';\nimport defaultConfig from '../config';\n\n/**\n * A Secret-Subkey packet (tag 7) is the subkey analog of the Secret\n * Key packet and has exactly the same format.\n * @extends SecretKeyPacket\n */\nclass SecretSubkeyPacket extends SecretKeyPacket {\n static get tag() {\n return enums.packet.secretSubkey;\n }\n\n /**\n * @param {Date} [date] - Creation date\n * @param {Object} [config] - Full configuration, defaults to openpgp.config\n */\n constructor(date = new Date(), config = defaultConfig) {\n super(date, config);\n }\n}\n\nexport default SecretSubkeyPacket;\n","import enums from '../enums';\nimport { UnsupportedError } from './packet';\n\n/**\n * Implementation of the Trust Packet (Tag 12)\n *\n * {@link https://tools.ietf.org/html/rfc4880#section-5.10|RFC4880 5.10}:\n * The Trust packet is used only within keyrings and is not normally\n * exported. Trust packets contain data that record the user's\n * specifications of which key holders are trustworthy introducers,\n * along with other information that implementing software uses for\n * trust information. The format of Trust packets is defined by a given\n * implementation.\n *\n * Trust packets SHOULD NOT be emitted to output streams that are\n * transferred to other users, and they SHOULD be ignored on any input\n * other than local keyring files.\n */\nclass TrustPacket {\n static get tag() {\n return enums.packet.trust;\n }\n\n /**\n * Parsing function for a trust packet (tag 12).\n * Currently not implemented as we ignore trust packets\n */\n read() {\n throw new UnsupportedError('Trust packets are not supported');\n }\n\n write() {\n throw new UnsupportedError('Trust packets are not supported');\n }\n}\n\nexport default TrustPacket;\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 { armor, unarmor } from './encoding/armor';\nimport { PacketList, SignaturePacket } from './packet';\nimport enums from './enums';\nimport util from './util';\nimport defaultConfig from './config';\n\n// A Signature can contain the following packets\nconst allowedPackets = /*#__PURE__*/ util.constructAllowedPackets([SignaturePacket]);\n\n/**\n * Class that represents an OpenPGP signature.\n */\nexport class Signature {\n /**\n * @param {PacketList} packetlist - The signature packets\n */\n constructor(packetlist) {\n this.packets = packetlist || new PacketList();\n }\n\n /**\n * Returns binary encoded signature\n * @returns {ReadableStream<Uint8Array>} Binary signature.\n */\n write() {\n return this.packets.write();\n }\n\n /**\n * Returns ASCII armored text of signature\n * @param {Object} [config] - Full configuration, defaults to openpgp.config\n * @returns {ReadableStream<String>} ASCII armor.\n */\n armor(config = defaultConfig) {\n return armor(enums.armor.signature, this.write(), undefined, undefined, undefined, config);\n }\n\n /**\n * Returns an array of KeyIDs of all of the issuers who created this signature\n * @returns {Array<KeyID>} The Key IDs of the signing keys\n */\n getSigningKeyIDs() {\n return this.packets.map(packet => packet.issuerKeyID);\n }\n}\n\n/**\n * reads an (optionally armored) OpenPGP signature and returns a signature object\n * @param {Object} options\n * @param {String} [options.armoredSignature] - Armored signature to be parsed\n * @param {Uint8Array} [options.binarySignature] - Binary signature to be parsed\n * @param {Object} [options.config] - Custom configuration settings to overwrite those in [config]{@link module:config}\n * @returns {Promise<Signature>} New signature object.\n * @async\n * @static\n */\nexport async function readSignature({ armoredSignature, binarySignature, config, ...rest }) {\n config = { ...defaultConfig, ...config };\n let input = armoredSignature || binarySignature;\n if (!input) {\n throw new Error('readSignature: must pass options object containing `armoredSignature` or `binarySignature`');\n }\n if (armoredSignature && !util.isString(armoredSignature)) {\n throw new Error('readSignature: options.armoredSignature must be a string');\n }\n if (binarySignature && !util.isUint8Array(binarySignature)) {\n throw new Error('readSignature: options.binarySignature must be a Uint8Array');\n }\n const unknownOptions = Object.keys(rest); if (unknownOptions.length > 0) throw new Error(`Unknown option: ${unknownOptions.join(', ')}`);\n\n if (armoredSignature) {\n const { type, data } = await unarmor(input, config);\n if (type !== enums.armor.signature) {\n throw new Error('Armored text not of type signature');\n }\n input = data;\n }\n const packetlist = await PacketList.fromBinary(input, allowedPackets, config);\n return new Signature(packetlist);\n}\n","/**\n * @fileoverview Provides helpers methods for key module\n * @module key/helper\n * @private\n */\n\nimport {\n PublicKeyPacket,\n PublicSubkeyPacket,\n SecretKeyPacket,\n SecretSubkeyPacket,\n SignaturePacket\n} from '../packet';\nimport enums from '../enums';\nimport crypto from '../crypto';\nimport util from '../util';\nimport defaultConfig from '../config';\n\nexport async function generateSecretSubkey(options, config) {\n const secretSubkeyPacket = new SecretSubkeyPacket(options.date, config);\n secretSubkeyPacket.packets = null;\n secretSubkeyPacket.algorithm = enums.read(enums.publicKey, options.algorithm);\n await secretSubkeyPacket.generate(options.rsaBits, options.curve);\n await secretSubkeyPacket.computeFingerprintAndKeyID();\n return secretSubkeyPacket;\n}\n\nexport async function generateSecretKey(options, config) {\n const secretKeyPacket = new SecretKeyPacket(options.date, config);\n secretKeyPacket.packets = null;\n secretKeyPacket.algorithm = enums.read(enums.publicKey, options.algorithm);\n await secretKeyPacket.generate(options.rsaBits, options.curve, options.config);\n await secretKeyPacket.computeFingerprintAndKeyID();\n return secretKeyPacket;\n}\n\n/**\n * Returns the valid and non-expired signature that has the latest creation date, while ignoring signatures created in the future.\n * @param {Array<SignaturePacket>} signatures - List of signatures\n * @param {PublicKeyPacket|PublicSubkeyPacket} publicKey - Public key packet to verify the signature\n * @param {Date} date - Use the given date instead of the current time\n * @param {Object} config - full configuration\n * @returns {Promise<SignaturePacket>} The latest valid signature.\n * @async\n */\nexport async function getLatestValidSignature(signatures, publicKey, signatureType, dataToVerify, date = new Date(), config) {\n let latestValid;\n let exception;\n for (let i = signatures.length - 1; i >= 0; i--) {\n try {\n if (\n (!latestValid || signatures[i].created >= latestValid.created)\n ) {\n await signatures[i].verify(publicKey, signatureType, dataToVerify, date, undefined, config);\n latestValid = signatures[i];\n }\n } catch (e) {\n exception = e;\n }\n }\n if (!latestValid) {\n throw util.wrapError(\n `Could not find valid ${enums.read(enums.signature, signatureType)} signature in key ${publicKey.getKeyID().toHex()}`\n .replace('certGeneric ', 'self-')\n .replace(/([a-z])([A-Z])/g, (_, $1, $2) => $1 + ' ' + $2.toLowerCase())\n , exception);\n }\n return latestValid;\n}\n\nexport function isDataExpired(keyPacket, signature, date = new Date()) {\n const normDate = util.normalizeDate(date);\n if (normDate !== null) {\n const expirationTime = getKeyExpirationTime(keyPacket, signature);\n return !(keyPacket.created <= normDate && normDate < expirationTime);\n }\n return false;\n}\n\n/**\n * Create Binding signature to the key according to the {@link https://tools.ietf.org/html/rfc4880#section-5.2.1}\n * @param {SecretSubkeyPacket} subkey - Subkey key packet\n * @param {SecretKeyPacket} primaryKey - Primary key packet\n * @param {Object} options\n * @param {Object} config - Full configuration\n */\nexport async function createBindingSignature(subkey, primaryKey, options, config) {\n const dataToSign = {};\n dataToSign.key = primaryKey;\n dataToSign.bind = subkey;\n const subkeySignaturePacket = new SignaturePacket();\n subkeySignaturePacket.signatureType = enums.signature.subkeyBinding;\n subkeySignaturePacket.publicKeyAlgorithm = primaryKey.algorithm;\n subkeySignaturePacket.hashAlgorithm = await getPreferredHashAlgo(null, subkey, undefined, undefined, config);\n if (options.sign) {\n subkeySignaturePacket.keyFlags = [enums.keyFlags.signData];\n subkeySignaturePacket.embeddedSignature = await createSignaturePacket(dataToSign, null, subkey, {\n signatureType: enums.signature.keyBinding\n }, options.date, undefined, undefined, config);\n } else {\n subkeySignaturePacket.keyFlags = [enums.keyFlags.encryptCommunication | enums.keyFlags.encryptStorage];\n }\n if (options.keyExpirationTime > 0) {\n subkeySignaturePacket.keyExpirationTime = options.keyExpirationTime;\n subkeySignaturePacket.keyNeverExpires = false;\n }\n await subkeySignaturePacket.sign(primaryKey, dataToSign, options.date);\n return subkeySignaturePacket;\n}\n\n/**\n * Returns the preferred signature hash algorithm of a key\n * @param {Key} [key] - The key to get preferences from\n * @param {SecretKeyPacket|SecretSubkeyPacket} keyPacket - key packet used for signing\n * @param {Date} [date] - Use the given date for verification instead of the current time\n * @param {Object} [userID] - User ID\n * @param {Object} config - full configuration\n * @returns {Promise<String>}\n * @async\n */\nexport async function getPreferredHashAlgo(key, keyPacket, date = new Date(), userID = {}, config) {\n let hashAlgo = config.preferredHashAlgorithm;\n let prefAlgo = hashAlgo;\n if (key) {\n const primaryUser = await key.getPrimaryUser(date, userID, config);\n if (primaryUser.selfCertification.preferredHashAlgorithms) {\n [prefAlgo] = primaryUser.selfCertification.preferredHashAlgorithms;\n hashAlgo = crypto.hash.getHashByteLength(hashAlgo) <= crypto.hash.getHashByteLength(prefAlgo) ?\n prefAlgo : hashAlgo;\n }\n }\n switch (Object.getPrototypeOf(keyPacket)) {\n case SecretKeyPacket.prototype:\n case PublicKeyPacket.prototype:\n case SecretSubkeyPacket.prototype:\n case PublicSubkeyPacket.prototype:\n switch (keyPacket.algorithm) {\n case 'ecdh':\n case 'ecdsa':\n case 'eddsa':\n prefAlgo = crypto.publicKey.elliptic.getPreferredHashAlgo(keyPacket.publicParams.oid);\n }\n }\n return crypto.hash.getHashByteLength(hashAlgo) <= crypto.hash.getHashByteLength(prefAlgo) ?\n prefAlgo : hashAlgo;\n}\n\n/**\n * Returns the preferred symmetric/aead/compression algorithm for a set of keys\n * @param {symmetric|aead|compression} type - Type of preference to return\n * @param {Array<Key>} [keys] - Set of keys\n * @param {Date} [date] - Use the given date for verification instead of the current time\n * @param {Array} [userIDs] - User IDs\n * @param {Object} [config] - Full configuration, defaults to openpgp.config\n * @returns {Promise<module:enums.symmetric|aead|compression>} Preferred algorithm\n * @async\n */\nexport async function getPreferredAlgo(type, keys = [], date = new Date(), userIDs = [], config = defaultConfig) {\n const defaultAlgo = { // these are all must-implement in rfc4880bis\n 'symmetric': enums.symmetric.aes128,\n 'aead': enums.aead.eax,\n 'compression': enums.compression.uncompressed\n }[type];\n const preferredSenderAlgo = {\n 'symmetric': config.preferredSymmetricAlgorithm,\n 'aead': config.preferredAEADAlgorithm,\n 'compression': config.preferredCompressionAlgorithm\n }[type];\n const prefPropertyName = {\n 'symmetric': 'preferredSymmetricAlgorithms',\n 'aead': 'preferredAEADAlgorithms',\n 'compression': 'preferredCompressionAlgorithms'\n }[type];\n\n // if preferredSenderAlgo appears in the prefs of all recipients, we pick it\n // otherwise we use the default algo\n // if no keys are available, preferredSenderAlgo is returned\n const senderAlgoSupport = await Promise.all(keys.map(async function(key, i) {\n const primaryUser = await key.getPrimaryUser(date, userIDs[i], config);\n const recipientPrefs = primaryUser.selfCertification[prefPropertyName];\n return !!recipientPrefs && recipientPrefs.indexOf(preferredSenderAlgo) >= 0;\n }));\n return senderAlgoSupport.every(Boolean) ? preferredSenderAlgo : defaultAlgo;\n}\n\n/**\n * Create signature packet\n * @param {Object} dataToSign - Contains packets to be signed\n * @param {PrivateKey} privateKey - key to get preferences from\n * @param {SecretKeyPacket|\n * SecretSubkeyPacket} signingKeyPacket secret key packet for signing\n * @param {Object} [signatureProperties] - Properties to write on the signature packet before signing\n * @param {Date} [date] - Override the creationtime of the signature\n * @param {Object} [userID] - User ID\n * @param {Object} [detached] - Whether to create a detached signature packet\n * @param {Object} config - full configuration\n * @returns {Promise<SignaturePacket>} Signature packet.\n */\nexport async function createSignaturePacket(dataToSign, privateKey, signingKeyPacket, signatureProperties, date, userID, detached = false, config) {\n if (signingKeyPacket.isDummy()) {\n throw new Error('Cannot sign with a gnu-dummy key.');\n }\n if (!signingKeyPacket.isDecrypted()) {\n throw new Error('Signing key is not decrypted.');\n }\n const signaturePacket = new SignaturePacket();\n Object.assign(signaturePacket, signatureProperties);\n signaturePacket.publicKeyAlgorithm = signingKeyPacket.algorithm;\n signaturePacket.hashAlgorithm = await getPreferredHashAlgo(privateKey, signingKeyPacket, date, userID, config);\n await signaturePacket.sign(signingKeyPacket, dataToSign, date, detached);\n return signaturePacket;\n}\n\n/**\n * Merges signatures from source[attr] to dest[attr]\n * @param {Object} source\n * @param {Object} dest\n * @param {String} attr\n * @param {Date} [date] - date to use for signature expiration check, instead of the current time\n * @param {Function} [checkFn] - signature only merged if true\n */\nexport async function mergeSignatures(source, dest, attr, date = new Date(), checkFn) {\n source = source[attr];\n if (source) {\n if (!dest[attr].length) {\n dest[attr] = source;\n } else {\n await Promise.all(source.map(async function(sourceSig) {\n if (!sourceSig.isExpired(date) && (!checkFn || await checkFn(sourceSig)) &&\n !dest[attr].some(function(destSig) {\n return util.equalsUint8Array(destSig.writeParams(), sourceSig.writeParams());\n })) {\n dest[attr].push(sourceSig);\n }\n }));\n }\n }\n}\n\n/**\n * Checks if a given certificate or binding signature is revoked\n * @param {SecretKeyPacket|\n * PublicKeyPacket} primaryKey The primary key packet\n * @param {Object} dataToVerify - The data to check\n * @param {Array<SignaturePacket>} revocations - The revocation signatures to check\n * @param {SignaturePacket} signature - The certificate or signature to check\n * @param {PublicSubkeyPacket|\n * SecretSubkeyPacket|\n * PublicKeyPacket|\n * SecretKeyPacket} key, optional The key packet to verify the signature, instead of the primary key\n * @param {Date} date - Use the given date instead of the current time\n * @param {Object} config - Full configuration\n * @returns {Promise<Boolean>} True if the signature revokes the data.\n * @async\n */\nexport async function isDataRevoked(primaryKey, signatureType, dataToVerify, revocations, signature, key, date = new Date(), config) {\n key = key || primaryKey;\n const revocationKeyIDs = [];\n await Promise.all(revocations.map(async function(revocationSignature) {\n try {\n if (\n // Note: a third-party revocation signature could legitimately revoke a\n // self-signature if the signature has an authorized revocation key.\n // However, we don't support passing authorized revocation keys, nor\n // verifying such revocation signatures. Instead, we indicate an error\n // when parsing a key with an authorized revocation key, and ignore\n // third-party revocation signatures here. (It could also be revoking a\n // third-party key certification, which should only affect\n // `verifyAllCertifications`.)\n !signature || revocationSignature.issuerKeyID.equals(signature.issuerKeyID)\n ) {\n await revocationSignature.verify(\n key, signatureType, dataToVerify, config.revocationsExpire ? date : null, false, config\n );\n\n // TODO get an identifier of the revoked object instead\n revocationKeyIDs.push(revocationSignature.issuerKeyID);\n }\n } catch (e) {}\n }));\n // TODO further verify that this is the signature that should be revoked\n if (signature) {\n signature.revoked = revocationKeyIDs.some(keyID => keyID.equals(signature.issuerKeyID)) ? true :\n signature.revoked || false;\n return signature.revoked;\n }\n return revocationKeyIDs.length > 0;\n}\n\n/**\n * Returns key expiration time based on the given certification signature.\n * The expiration time of the signature is ignored.\n * @param {PublicSubkeyPacket|PublicKeyPacket} keyPacket - key to check\n * @param {SignaturePacket} signature - signature to process\n * @returns {Date|Infinity} expiration time or infinity if the key does not expire\n */\nexport function getKeyExpirationTime(keyPacket, signature) {\n let expirationTime;\n // check V4 expiration time\n if (signature.keyNeverExpires === false) {\n expirationTime = keyPacket.created.getTime() + signature.keyExpirationTime * 1000;\n }\n return expirationTime ? new Date(expirationTime) : Infinity;\n}\n\n/**\n * Returns whether aead is supported by all keys in the set\n * @param {Array<Key>} keys - Set of keys\n * @param {Date} [date] - Use the given date for verification instead of the current time\n * @param {Array} [userIDs] - User IDs\n * @param {Object} config - full configuration\n * @returns {Promise<Boolean>}\n * @async\n */\nexport async function isAEADSupported(keys, date = new Date(), userIDs = [], config = defaultConfig) {\n let supported = true;\n // TODO replace when Promise.some or Promise.any are implemented\n await Promise.all(keys.map(async function(key, i) {\n const primaryUser = await key.getPrimaryUser(date, userIDs[i], config);\n if (!primaryUser.selfCertification.features ||\n !(primaryUser.selfCertification.features[0] & enums.features.aead)) {\n supported = false;\n }\n }));\n return supported;\n}\n\nexport function sanitizeKeyOptions(options, subkeyDefaults = {}) {\n options.type = options.type || subkeyDefaults.type;\n options.curve = options.curve || subkeyDefaults.curve;\n options.rsaBits = options.rsaBits || subkeyDefaults.rsaBits;\n options.keyExpirationTime = options.keyExpirationTime !== undefined ? options.keyExpirationTime : subkeyDefaults.keyExpirationTime;\n options.passphrase = util.isString(options.passphrase) ? options.passphrase : subkeyDefaults.passphrase;\n options.date = options.date || subkeyDefaults.date;\n\n options.sign = options.sign || false;\n\n switch (options.type) {\n case 'ecc':\n try {\n options.curve = enums.write(enums.curve, options.curve);\n } catch (e) {\n throw new Error('Invalid curve');\n }\n if (options.curve === enums.curve.ed25519 || options.curve === enums.curve.curve25519) {\n options.curve = options.sign ? enums.curve.ed25519 : enums.curve.curve25519;\n }\n if (options.sign) {\n options.algorithm = options.curve === enums.curve.ed25519 ? enums.publicKey.eddsa : enums.publicKey.ecdsa;\n } else {\n options.algorithm = enums.publicKey.ecdh;\n }\n break;\n case 'rsa':\n options.algorithm = enums.publicKey.rsaEncryptSign;\n break;\n default:\n throw new Error(`Unsupported key type ${options.type}`);\n }\n return options;\n}\n\nexport function isValidSigningKeyPacket(keyPacket, signature) {\n const keyAlgo = enums.write(enums.publicKey, keyPacket.algorithm);\n return keyAlgo !== enums.publicKey.rsaEncrypt &&\n keyAlgo !== enums.publicKey.elgamal &&\n keyAlgo !== enums.publicKey.ecdh &&\n (!signature.keyFlags ||\n (signature.keyFlags[0] & enums.keyFlags.signData) !== 0);\n}\n\nexport function isValidEncryptionKeyPacket(keyPacket, signature) {\n const keyAlgo = enums.write(enums.publicKey, keyPacket.algorithm);\n return keyAlgo !== enums.publicKey.dsa &&\n keyAlgo !== enums.publicKey.rsaSign &&\n keyAlgo !== enums.publicKey.ecdsa &&\n keyAlgo !== enums.publicKey.eddsa &&\n (!signature.keyFlags ||\n (signature.keyFlags[0] & enums.keyFlags.encryptCommunication) !== 0 ||\n (signature.keyFlags[0] & enums.keyFlags.encryptStorage) !== 0);\n}\n\nexport function isValidDecryptionKeyPacket(signature, config) {\n if (config.allowInsecureDecryptionWithSigningKeys) {\n // This is only relevant for RSA keys, all other signing algorithms cannot decrypt\n return true;\n }\n\n return !signature.keyFlags ||\n (signature.keyFlags[0] & enums.keyFlags.encryptCommunication) !== 0 ||\n (signature.keyFlags[0] & enums.keyFlags.encryptStorage) !== 0;\n}\n\n/**\n * Check key against blacklisted algorithms and minimum strength requirements.\n * @param {SecretKeyPacket|PublicKeyPacket|\n * SecretSubkeyPacket|PublicSubkeyPacket} keyPacket\n * @param {Config} config\n * @throws {Error} if the key packet does not meet the requirements\n */\nexport function checkKeyRequirements(keyPacket, config) {\n const keyAlgo = enums.write(enums.publicKey, keyPacket.algorithm);\n if (config.rejectPublicKeyAlgorithms.has(keyAlgo)) {\n throw new Error(`${keyPacket.algorithm} keys are considered too weak.`);\n }\n const algoInfo = keyPacket.getAlgorithmInfo();\n switch (keyAlgo) {\n case enums.publicKey.rsaEncryptSign:\n case enums.publicKey.rsaSign:\n case enums.publicKey.rsaEncrypt:\n if (algoInfo.bits < config.minRSABits) {\n throw new Error(`RSA keys shorter than ${config.minRSABits} bits are considered too weak.`);\n }\n break;\n case enums.publicKey.ecdsa:\n case enums.publicKey.eddsa:\n case enums.publicKey.ecdh:\n if (config.rejectCurves.has(algoInfo.curve)) {\n throw new Error(`Support for ${keyPacket.algorithm} keys using curve ${algoInfo.curve} is disabled.`);\n }\n break;\n default:\n break;\n }\n}\n","/**\n * @module key/User\n * @private\n */\n\nimport enums from '../enums';\nimport util from '../util';\nimport { PacketList } from '../packet';\nimport { mergeSignatures, isDataRevoked, createSignaturePacket } from './helper';\n\n/**\n * Class that represents an user ID or attribute packet and the relevant signatures.\n * @param {UserIDPacket|UserAttributePacket} userPacket - packet containing the user info\n * @param {Key} mainKey - reference to main Key object containing the primary key and subkeys that the user is associated with\n */\nclass User {\n constructor(userPacket, mainKey) {\n this.userID = userPacket.constructor.tag === enums.packet.userID ? userPacket : null;\n this.userAttribute = userPacket.constructor.tag === enums.packet.userAttribute ? userPacket : null;\n this.selfCertifications = [];\n this.otherCertifications = [];\n this.revocationSignatures = [];\n this.mainKey = mainKey;\n }\n\n /**\n * Transforms structured user data to packetlist\n * @returns {PacketList}\n */\n toPacketList() {\n const packetlist = new PacketList();\n packetlist.push(this.userID || this.userAttribute);\n packetlist.push(...this.revocationSignatures);\n packetlist.push(...this.selfCertifications);\n packetlist.push(...this.otherCertifications);\n return packetlist;\n }\n\n /**\n * Shallow clone\n * @returns {User}\n */\n clone() {\n const user = new User(this.userID || this.userAttribute, this.mainKey);\n user.selfCertifications = [...this.selfCertifications];\n user.otherCertifications = [...this.otherCertifications];\n user.revocationSignatures = [...this.revocationSignatures];\n return user;\n }\n\n /**\n * Generate third-party certifications over this user and its primary key\n * @param {Array<PrivateKey>} signingKeys - Decrypted private keys for signing\n * @param {Date} [date] - Date to use as creation date of the certificate, instead of the current time\n * @param {Object} config - Full configuration\n * @returns {Promise<User>} New user with new certifications.\n * @async\n */\n async certify(signingKeys, date, config) {\n const primaryKey = this.mainKey.keyPacket;\n const dataToSign = {\n userID: this.userID,\n userAttribute: this.userAttribute,\n key: primaryKey\n };\n const user = new User(dataToSign.userID || dataToSign.userAttribute, this.mainKey);\n user.otherCertifications = await Promise.all(signingKeys.map(async function(privateKey) {\n if (!privateKey.isPrivate()) {\n throw new Error('Need private key for signing');\n }\n if (privateKey.hasSameFingerprintAs(primaryKey)) {\n throw new Error(\"The user's own key can only be used for self-certifications\");\n }\n const signingKey = await privateKey.getSigningKey(undefined, date, undefined, config);\n return createSignaturePacket(dataToSign, privateKey, signingKey.keyPacket, {\n // Most OpenPGP implementations use generic certification (0x10)\n signatureType: enums.signature.certGeneric,\n keyFlags: [enums.keyFlags.certifyKeys | enums.keyFlags.signData]\n }, date, undefined, undefined, config);\n }));\n await user.update(this, date, config);\n return user;\n }\n\n /**\n * Checks if a given certificate of the user is revoked\n * @param {SignaturePacket} certificate - The certificate to verify\n * @param {PublicSubkeyPacket|\n * SecretSubkeyPacket|\n * PublicKeyPacket|\n * SecretKeyPacket} [keyPacket] The key packet to verify the signature, instead of the primary key\n * @param {Date} [date] - Use the given date for verification instead of the current time\n * @param {Object} config - Full configuration\n * @returns {Promise<Boolean>} True if the certificate is revoked.\n * @async\n */\n async isRevoked(certificate, keyPacket, date = new Date(), config) {\n const primaryKey = this.mainKey.keyPacket;\n return isDataRevoked(primaryKey, enums.signature.certRevocation, {\n key: primaryKey,\n userID: this.userID,\n userAttribute: this.userAttribute\n }, this.revocationSignatures, certificate, keyPacket, date, config);\n }\n\n /**\n * Verifies the user certificate.\n * @param {SignaturePacket} certificate - A certificate of this user\n * @param {Array<PublicKey>} verificationKeys - Array of keys to verify certificate signatures\n * @param {Date} [date] - Use the given date instead of the current time\n * @param {Object} config - Full configuration\n * @returns {Promise<true|null>} true if the certificate could be verified, or null if the verification keys do not correspond to the certificate\n * @throws if the user certificate is invalid.\n * @async\n */\n async verifyCertificate(certificate, verificationKeys, date = new Date(), config) {\n const that = this;\n const primaryKey = this.mainKey.keyPacket;\n const dataToVerify = {\n userID: this.userID,\n userAttribute: this.userAttribute,\n key: primaryKey\n };\n const { issuerKeyID } = certificate;\n const issuerKeys = verificationKeys.filter(key => key.getKeys(issuerKeyID).length > 0);\n if (issuerKeys.length === 0) {\n return null;\n }\n await Promise.all(issuerKeys.map(async key => {\n const signingKey = await key.getSigningKey(issuerKeyID, certificate.created, undefined, config);\n if (certificate.revoked || await that.isRevoked(certificate, signingKey.keyPacket, date, config)) {\n throw new Error('User certificate is revoked');\n }\n try {\n await certificate.verify(signingKey.keyPacket, enums.signature.certGeneric, dataToVerify, date, undefined, config);\n } catch (e) {\n throw util.wrapError('User certificate is invalid', e);\n }\n }));\n return true;\n }\n\n /**\n * Verifies all user certificates\n * @param {Array<PublicKey>} verificationKeys - Array of keys to verify certificate signatures\n * @param {Date} [date] - Use the given date instead of the current time\n * @param {Object} config - Full configuration\n * @returns {Promise<Array<{\n * keyID: module:type/keyid~KeyID,\n * valid: Boolean | null\n * }>>} List of signer's keyID and validity of signature.\n * Signature validity is null if the verification keys do not correspond to the certificate.\n * @async\n */\n async verifyAllCertifications(verificationKeys, date = new Date(), config) {\n const that = this;\n const certifications = this.selfCertifications.concat(this.otherCertifications);\n return Promise.all(certifications.map(async certification => ({\n keyID: certification.issuerKeyID,\n valid: await that.verifyCertificate(certification, verificationKeys, date, config).catch(() => false)\n })));\n }\n\n /**\n * Verify User. Checks for existence of self signatures, revocation signatures\n * and validity of self signature.\n * @param {Date} date - Use the given date instead of the current time\n * @param {Object} config - Full configuration\n * @returns {Promise<true>} Status of user.\n * @throws {Error} if there are no valid self signatures.\n * @async\n */\n async verify(date = new Date(), config) {\n if (!this.selfCertifications.length) {\n throw new Error('No self-certifications found');\n }\n const that = this;\n const primaryKey = this.mainKey.keyPacket;\n const dataToVerify = {\n userID: this.userID,\n userAttribute: this.userAttribute,\n key: primaryKey\n };\n // TODO replace when Promise.some or Promise.any are implemented\n let exception;\n for (let i = this.selfCertifications.length - 1; i >= 0; i--) {\n try {\n const selfCertification = this.selfCertifications[i];\n if (selfCertification.revoked || await that.isRevoked(selfCertification, undefined, date, config)) {\n throw new Error('Self-certification is revoked');\n }\n try {\n await selfCertification.verify(primaryKey, enums.signature.certGeneric, dataToVerify, date, undefined, config);\n } catch (e) {\n throw util.wrapError('Self-certification is invalid', e);\n }\n return true;\n } catch (e) {\n exception = e;\n }\n }\n throw exception;\n }\n\n /**\n * Update user with new components from specified user\n * @param {User} sourceUser - Source user to merge\n * @param {Date} date - Date to verify the validity of signatures\n * @param {Object} config - Full configuration\n * @returns {Promise<undefined>}\n * @async\n */\n async update(sourceUser, date, config) {\n const primaryKey = this.mainKey.keyPacket;\n const dataToVerify = {\n userID: this.userID,\n userAttribute: this.userAttribute,\n key: primaryKey\n };\n // self signatures\n await mergeSignatures(sourceUser, this, 'selfCertifications', date, async function(srcSelfSig) {\n try {\n await srcSelfSig.verify(primaryKey, enums.signature.certGeneric, dataToVerify, date, false, config);\n return true;\n } catch (e) {\n return false;\n }\n });\n // other signatures\n await mergeSignatures(sourceUser, this, 'otherCertifications', date);\n // revocation signatures\n await mergeSignatures(sourceUser, this, 'revocationSignatures', date, function(srcRevSig) {\n return isDataRevoked(primaryKey, enums.signature.certRevocation, dataToVerify, [srcRevSig], undefined, undefined, date, config);\n });\n }\n}\n\nexport default User;\n","/**\n * @module key/Subkey\n * @private\n */\n\nimport enums from '../enums';\nimport * as helper from './helper';\nimport { PacketList } from '../packet';\nimport defaultConfig from '../config';\n\n/**\n * Class that represents a subkey packet and the relevant signatures.\n * @borrows PublicSubkeyPacket#getKeyID as Subkey#getKeyID\n * @borrows PublicSubkeyPacket#getFingerprint as Subkey#getFingerprint\n * @borrows PublicSubkeyPacket#hasSameFingerprintAs as Subkey#hasSameFingerprintAs\n * @borrows PublicSubkeyPacket#getAlgorithmInfo as Subkey#getAlgorithmInfo\n * @borrows PublicSubkeyPacket#getCreationTime as Subkey#getCreationTime\n * @borrows PublicSubkeyPacket#isDecrypted as Subkey#isDecrypted\n */\nclass Subkey {\n /**\n * @param {SecretSubkeyPacket|PublicSubkeyPacket} subkeyPacket - subkey packet to hold in the Subkey\n * @param {Key} mainKey - reference to main Key object, containing the primary key packet corresponding to the subkey\n */\n constructor(subkeyPacket, mainKey) {\n this.keyPacket = subkeyPacket;\n this.bindingSignatures = [];\n this.revocationSignatures = [];\n this.mainKey = mainKey;\n }\n\n /**\n * Transforms structured subkey data to packetlist\n * @returns {PacketList}\n */\n toPacketList() {\n const packetlist = new PacketList();\n packetlist.push(this.keyPacket);\n packetlist.push(...this.revocationSignatures);\n packetlist.push(...this.bindingSignatures);\n return packetlist;\n }\n\n /**\n * Shallow clone\n * @return {Subkey}\n */\n clone() {\n const subkey = new Subkey(this.keyPacket, this.mainKey);\n subkey.bindingSignatures = [...this.bindingSignatures];\n subkey.revocationSignatures = [...this.revocationSignatures];\n return subkey;\n }\n\n /**\n * Checks if a binding signature of a subkey is revoked\n * @param {SignaturePacket} signature - The binding signature to verify\n * @param {PublicSubkeyPacket|\n * SecretSubkeyPacket|\n * PublicKeyPacket|\n * SecretKeyPacket} key, optional The key to verify the signature\n * @param {Date} [date] - Use the given date for verification instead of the current time\n * @param {Object} [config] - Full configuration, defaults to openpgp.config\n * @returns {Promise<Boolean>} True if the binding signature is revoked.\n * @async\n */\n async isRevoked(signature, key, date = new Date(), config = defaultConfig) {\n const primaryKey = this.mainKey.keyPacket;\n return helper.isDataRevoked(\n primaryKey, enums.signature.subkeyRevocation, {\n key: primaryKey,\n bind: this.keyPacket\n }, this.revocationSignatures, signature, key, date, config\n );\n }\n\n /**\n * Verify subkey. Checks for revocation signatures, expiration time\n * and valid binding signature.\n * @param {Date} date - Use the given date instead of the current time\n * @param {Object} [config] - Full configuration, defaults to openpgp.config\n * @returns {Promise<SignaturePacket>}\n * @throws {Error} if the subkey is invalid.\n * @async\n */\n async verify(date = new Date(), config = defaultConfig) {\n const primaryKey = this.mainKey.keyPacket;\n const dataToVerify = { key: primaryKey, bind: this.keyPacket };\n // check subkey binding signatures\n const bindingSignature = await helper.getLatestValidSignature(this.bindingSignatures, primaryKey, enums.signature.subkeyBinding, dataToVerify, date, config);\n // check binding signature is not revoked\n if (bindingSignature.revoked || await this.isRevoked(bindingSignature, null, date, config)) {\n throw new Error('Subkey is revoked');\n }\n // check for expiration time\n if (helper.isDataExpired(this.keyPacket, bindingSignature, date)) {\n throw new Error('Subkey is expired');\n }\n return bindingSignature;\n }\n\n /**\n * Returns the expiration time of the subkey or Infinity if key does not expire.\n * Returns null if the subkey is invalid.\n * @param {Date} date - Use the given date instead of the current time\n * @param {Object} [config] - Full configuration, defaults to openpgp.config\n * @returns {Promise<Date | Infinity | null>}\n * @async\n */\n async getExpirationTime(date = new Date(), config = defaultConfig) {\n const primaryKey = this.mainKey.keyPacket;\n const dataToVerify = { key: primaryKey, bind: this.keyPacket };\n let bindingSignature;\n try {\n bindingSignature = await helper.getLatestValidSignature(this.bindingSignatures, primaryKey, enums.signature.subkeyBinding, dataToVerify, date, config);\n } catch (e) {\n return null;\n }\n const keyExpiry = helper.getKeyExpirationTime(this.keyPacket, bindingSignature);\n const sigExpiry = bindingSignature.getExpirationTime();\n return keyExpiry < sigExpiry ? keyExpiry : sigExpiry;\n }\n\n /**\n * Update subkey with new components from specified subkey\n * @param {Subkey} subkey - Source subkey to merge\n * @param {Date} [date] - Date to verify validity of signatures\n * @param {Object} [config] - Full configuration, defaults to openpgp.config\n * @throws {Error} if update failed\n * @async\n */\n async update(subkey, date = new Date(), config = defaultConfig) {\n const primaryKey = this.mainKey.keyPacket;\n if (!this.hasSameFingerprintAs(subkey)) {\n throw new Error('Subkey update method: fingerprints of subkeys not equal');\n }\n // key packet\n if (this.keyPacket.constructor.tag === enums.packet.publicSubkey &&\n subkey.keyPacket.constructor.tag === enums.packet.secretSubkey) {\n this.keyPacket = subkey.keyPacket;\n }\n // update missing binding signatures\n const that = this;\n const dataToVerify = { key: primaryKey, bind: that.keyPacket };\n await helper.mergeSignatures(subkey, this, 'bindingSignatures', date, async function(srcBindSig) {\n for (let i = 0; i < that.bindingSignatures.length; i++) {\n if (that.bindingSignatures[i].issuerKeyID.equals(srcBindSig.issuerKeyID)) {\n if (srcBindSig.created > that.bindingSignatures[i].created) {\n that.bindingSignatures[i] = srcBindSig;\n }\n return false;\n }\n }\n try {\n await srcBindSig.verify(primaryKey, enums.signature.subkeyBinding, dataToVerify, date, undefined, config);\n return true;\n } catch (e) {\n return false;\n }\n });\n // revocation signatures\n await helper.mergeSignatures(subkey, this, 'revocationSignatures', date, function(srcRevSig) {\n return helper.isDataRevoked(primaryKey, enums.signature.subkeyRevocation, dataToVerify, [srcRevSig], undefined, undefined, date, config);\n });\n }\n\n /**\n * Revokes the subkey\n * @param {SecretKeyPacket} primaryKey - decrypted private primary key for revocation\n * @param {Object} reasonForRevocation - optional, object indicating the reason for revocation\n * @param {module:enums.reasonForRevocation} reasonForRevocation.flag optional, flag indicating the reason for revocation\n * @param {String} reasonForRevocation.string optional, string explaining the reason for revocation\n * @param {Date} date - optional, override the creationtime of the revocation signature\n * @param {Object} [config] - Full configuration, defaults to openpgp.config\n * @returns {Promise<Subkey>} New subkey with revocation signature.\n * @async\n */\n async revoke(\n primaryKey,\n {\n flag: reasonForRevocationFlag = enums.reasonForRevocation.noReason,\n string: reasonForRevocationString = ''\n } = {},\n date = new Date(),\n config = defaultConfig\n ) {\n const dataToSign = { key: primaryKey, bind: this.keyPacket };\n const subkey = new Subkey(this.keyPacket, this.mainKey);\n subkey.revocationSignatures.push(await helper.createSignaturePacket(dataToSign, null, primaryKey, {\n signatureType: enums.signature.subkeyRevocation,\n reasonForRevocationFlag: enums.write(enums.reasonForRevocation, reasonForRevocationFlag),\n reasonForRevocationString\n }, date, undefined, false, config));\n await subkey.update(this);\n return subkey;\n }\n\n hasSameFingerprintAs(other) {\n return this.keyPacket.hasSameFingerprintAs(other.keyPacket || other);\n }\n}\n\n['getKeyID', 'getFingerprint', 'getAlgorithmInfo', 'getCreationTime', 'isDecrypted'].forEach(name => {\n Subkey.prototype[name] =\n function() {\n return this.keyPacket[name]();\n };\n});\n\nexport default Subkey;\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 { armor, unarmor } from '../encoding/armor';\nimport {\n PacketList,\n SignaturePacket\n} from '../packet';\nimport defaultConfig from '../config';\nimport enums from '../enums';\nimport util from '../util';\nimport User from './user';\nimport Subkey from './subkey';\nimport * as helper from './helper';\nimport PrivateKey from './private_key';\nimport PublicKey from './public_key';\n\n// A key revocation certificate can contain the following packets\nconst allowedRevocationPackets = /*#__PURE__*/ util.constructAllowedPackets([SignaturePacket]);\n\n/**\n * Abstract class that represents an OpenPGP key. Must contain a primary key.\n * Can contain additional subkeys, signatures, user ids, user attributes.\n * @borrows PublicKeyPacket#getKeyID as Key#getKeyID\n * @borrows PublicKeyPacket#getFingerprint as Key#getFingerprint\n * @borrows PublicKeyPacket#hasSameFingerprintAs as Key#hasSameFingerprintAs\n * @borrows PublicKeyPacket#getAlgorithmInfo as Key#getAlgorithmInfo\n * @borrows PublicKeyPacket#getCreationTime as Key#getCreationTime\n */\nclass Key {\n /**\n * Transforms packetlist to structured key data\n * @param {PacketList} packetlist - The packets that form a key\n * @param {Set<enums.packet>} disallowedPackets - disallowed packet tags\n */\n packetListToStructure(packetlist, disallowedPackets = new Set()) {\n let user;\n let primaryKeyID;\n let subkey;\n for (const packet of packetlist) {\n const tag = packet.constructor.tag;\n if (disallowedPackets.has(tag)) {\n throw new Error(`Unexpected packet type: ${tag}`);\n }\n switch (tag) {\n case enums.packet.publicKey:\n case enums.packet.secretKey:\n if (this.keyPacket) {\n throw new Error('Key block contains multiple keys');\n }\n this.keyPacket = packet;\n primaryKeyID = this.getKeyID();\n if (!primaryKeyID) {\n throw new Error('Missing Key ID');\n }\n break;\n case enums.packet.userID:\n case enums.packet.userAttribute:\n user = new User(packet, this);\n this.users.push(user);\n break;\n case enums.packet.publicSubkey:\n case enums.packet.secretSubkey:\n user = null;\n subkey = new Subkey(packet, this);\n this.subkeys.push(subkey);\n break;\n case enums.packet.signature:\n switch (packet.signatureType) {\n case enums.signature.certGeneric:\n case enums.signature.certPersona:\n case enums.signature.certCasual:\n case enums.signature.certPositive:\n if (!user) {\n util.printDebug('Dropping certification signatures without preceding user packet');\n continue;\n }\n if (packet.issuerKeyID.equals(primaryKeyID)) {\n user.selfCertifications.push(packet);\n } else {\n user.otherCertifications.push(packet);\n }\n break;\n case enums.signature.certRevocation:\n if (user) {\n user.revocationSignatures.push(packet);\n } else {\n this.directSignatures.push(packet);\n }\n break;\n case enums.signature.key:\n this.directSignatures.push(packet);\n break;\n case enums.signature.subkeyBinding:\n if (!subkey) {\n util.printDebug('Dropping subkey binding signature without preceding subkey packet');\n continue;\n }\n subkey.bindingSignatures.push(packet);\n break;\n case enums.signature.keyRevocation:\n this.revocationSignatures.push(packet);\n break;\n case enums.signature.subkeyRevocation:\n if (!subkey) {\n util.printDebug('Dropping subkey revocation signature without preceding subkey packet');\n continue;\n }\n subkey.revocationSignatures.push(packet);\n break;\n }\n break;\n }\n }\n }\n\n /**\n * Transforms structured key data to packetlist\n * @returns {PacketList} The packets that form a key.\n */\n toPacketList() {\n const packetlist = new PacketList();\n packetlist.push(this.keyPacket);\n packetlist.push(...this.revocationSignatures);\n packetlist.push(...this.directSignatures);\n this.users.map(user => packetlist.push(...user.toPacketList()));\n this.subkeys.map(subkey => packetlist.push(...subkey.toPacketList()));\n return packetlist;\n }\n\n /**\n * Clones the key object\n * @param {Boolean} [deep=false] Whether to return a deep clone\n * @returns {Promise<Key>} Clone of the key.\n */\n clone(deep = false) {\n const key = new this.constructor(this.toPacketList());\n if (deep) {\n key.getKeys().forEach(k => {\n // shallow clone the key packets\n k.keyPacket = Object.create(\n Object.getPrototypeOf(k.keyPacket),\n Object.getOwnPropertyDescriptors(k.keyPacket)\n );\n if (!k.keyPacket.isDecrypted()) return;\n // deep clone the private params, which are cleared during encryption\n const privateParams = {};\n Object.keys(k.keyPacket.privateParams).forEach(name => {\n privateParams[name] = new Uint8Array(k.keyPacket.privateParams[name]);\n });\n k.keyPacket.privateParams = privateParams;\n });\n }\n return key;\n }\n\n /**\n * Returns an array containing all public or private subkeys matching keyID;\n * If no keyID is given, returns all subkeys.\n * @param {type/keyID} [keyID] - key ID to look for\n * @returns {Array<Subkey>} array of subkeys\n */\n getSubkeys(keyID = null) {\n const subkeys = this.subkeys.filter(subkey => (\n !keyID || subkey.getKeyID().equals(keyID, true)\n ));\n return subkeys;\n }\n\n /**\n * Returns an array containing all public or private keys matching keyID.\n * If no keyID is given, returns all keys, starting with the primary key.\n * @param {type/keyid~KeyID} [keyID] - key ID to look for\n * @returns {Array<Key|Subkey>} array of keys\n */\n getKeys(keyID = null) {\n const keys = [];\n if (!keyID || this.getKeyID().equals(keyID, true)) {\n keys.push(this);\n }\n return keys.concat(this.getSubkeys(keyID));\n }\n\n /**\n * Returns key IDs of all keys\n * @returns {Array<module:type/keyid~KeyID>}\n */\n getKeyIDs() {\n return this.getKeys().map(key => key.getKeyID());\n }\n\n /**\n * Returns userIDs\n * @returns {Array<string>} Array of userIDs.\n */\n getUserIDs() {\n return this.users.map(user => {\n return user.userID ? user.userID.userID : null;\n }).filter(userID => userID !== null);\n }\n\n /**\n * Returns binary encoded key\n * @returns {Uint8Array} Binary key.\n */\n write() {\n return this.toPacketList().write();\n }\n\n /**\n * Returns last created key or key by given keyID that is available for signing and verification\n * @param {module:type/keyid~KeyID} [keyID] - key ID of a specific key to retrieve\n * @param {Date} [date] - use the fiven date date to to check key validity instead of the current date\n * @param {Object} [userID] - filter keys for the given user ID\n * @param {Object} [config] - Full configuration, defaults to openpgp.config\n * @returns {Promise<Key|Subkey>} signing key\n * @throws if no valid signing key was found\n * @async\n */\n async getSigningKey(keyID = null, date = new Date(), userID = {}, config = defaultConfig) {\n await this.verifyPrimaryKey(date, userID, config);\n const primaryKey = this.keyPacket;\n const subkeys = this.subkeys.slice().sort((a, b) => b.keyPacket.created - a.keyPacket.created);\n let exception;\n for (const subkey of subkeys) {\n if (!keyID || subkey.getKeyID().equals(keyID)) {\n try {\n await subkey.verify(date, config);\n const dataToVerify = { key: primaryKey, bind: subkey.keyPacket };\n const bindingSignature = await helper.getLatestValidSignature(\n subkey.bindingSignatures, primaryKey, enums.signature.subkeyBinding, dataToVerify, date, config\n );\n if (!helper.isValidSigningKeyPacket(subkey.keyPacket, bindingSignature)) {\n continue;\n }\n if (!bindingSignature.embeddedSignature) {\n throw new Error('Missing embedded signature');\n }\n // verify embedded signature\n await helper.getLatestValidSignature(\n [bindingSignature.embeddedSignature], subkey.keyPacket, enums.signature.keyBinding, dataToVerify, date, config\n );\n helper.checkKeyRequirements(subkey.keyPacket, config);\n return subkey;\n } catch (e) {\n exception = e;\n }\n }\n }\n\n try {\n const primaryUser = await this.getPrimaryUser(date, userID, config);\n if ((!keyID || primaryKey.getKeyID().equals(keyID)) &&\n helper.isValidSigningKeyPacket(primaryKey, primaryUser.selfCertification, config)) {\n helper.checkKeyRequirements(primaryKey, config);\n return this;\n }\n } catch (e) {\n exception = e;\n }\n throw util.wrapError('Could not find valid signing key packet in key ' + this.getKeyID().toHex(), exception);\n }\n\n /**\n * Returns last created key or key by given keyID that is available for encryption or decryption\n * @param {module:type/keyid~KeyID} [keyID] - key ID of a specific key to retrieve\n * @param {Date} [date] - use the fiven date date to to check key validity instead of the current date\n * @param {Object} [userID] - filter keys for the given user ID\n * @param {Object} [config] - Full configuration, defaults to openpgp.config\n * @returns {Promise<Key|Subkey>} encryption key\n * @throws if no valid encryption key was found\n * @async\n */\n async getEncryptionKey(keyID, date = new Date(), userID = {}, config = defaultConfig) {\n await this.verifyPrimaryKey(date, userID, config);\n const primaryKey = this.keyPacket;\n // V4: by convention subkeys are preferred for encryption service\n const subkeys = this.subkeys.slice().sort((a, b) => b.keyPacket.created - a.keyPacket.created);\n let exception;\n for (const subkey of subkeys) {\n if (!keyID || subkey.getKeyID().equals(keyID)) {\n try {\n await subkey.verify(date, config);\n const dataToVerify = { key: primaryKey, bind: subkey.keyPacket };\n const bindingSignature = await helper.getLatestValidSignature(subkey.bindingSignatures, primaryKey, enums.signature.subkeyBinding, dataToVerify, date, config);\n if (helper.isValidEncryptionKeyPacket(subkey.keyPacket, bindingSignature)) {\n helper.checkKeyRequirements(subkey.keyPacket, config);\n return subkey;\n }\n } catch (e) {\n exception = e;\n }\n }\n }\n\n try {\n // if no valid subkey for encryption, evaluate primary key\n const primaryUser = await this.getPrimaryUser(date, userID, config);\n if ((!keyID || primaryKey.getKeyID().equals(keyID)) &&\n helper.isValidEncryptionKeyPacket(primaryKey, primaryUser.selfCertification)) {\n helper.checkKeyRequirements(primaryKey, config);\n return this;\n }\n } catch (e) {\n exception = e;\n }\n throw util.wrapError('Could not find valid encryption key packet in key ' + this.getKeyID().toHex(), exception);\n }\n\n /**\n * Checks if a signature on a key is revoked\n * @param {SignaturePacket} signature - The signature to verify\n * @param {PublicSubkeyPacket|\n * SecretSubkeyPacket|\n * PublicKeyPacket|\n * SecretKeyPacket} key, optional The key to verify the signature\n * @param {Date} [date] - Use the given date for verification, instead of the current time\n * @param {Object} [config] - Full configuration, defaults to openpgp.config\n * @returns {Promise<Boolean>} True if the certificate is revoked.\n * @async\n */\n async isRevoked(signature, key, date = new Date(), config = defaultConfig) {\n return helper.isDataRevoked(\n this.keyPacket, enums.signature.keyRevocation, { key: this.keyPacket }, this.revocationSignatures, signature, key, date, config\n );\n }\n\n /**\n * Verify primary key. Checks for revocation signatures, expiration time\n * and valid self signature. Throws if the primary key is invalid.\n * @param {Date} [date] - Use the given date for verification instead of the current time\n * @param {Object} [userID] - User ID\n * @param {Object} [config] - Full configuration, defaults to openpgp.config\n * @throws {Error} If key verification failed\n * @async\n */\n async verifyPrimaryKey(date = new Date(), userID = {}, config = defaultConfig) {\n const primaryKey = this.keyPacket;\n // check for key revocation signatures\n if (await this.isRevoked(null, null, date, config)) {\n throw new Error('Primary key is revoked');\n }\n // check for valid, unrevoked, unexpired self signature\n const { selfCertification } = await this.getPrimaryUser(date, userID, config);\n // check for expiration time in binding signatures\n if (helper.isDataExpired(primaryKey, selfCertification, date)) {\n throw new Error('Primary key is expired');\n }\n // check for expiration time in direct signatures\n const directSignature = await helper.getLatestValidSignature(\n this.directSignatures, primaryKey, enums.signature.key, { key: primaryKey }, date, config\n ).catch(() => {}); // invalid signatures are discarded, to avoid breaking the key\n\n if (directSignature && helper.isDataExpired(primaryKey, directSignature, date)) {\n throw new Error('Primary key is expired');\n }\n }\n\n /**\n * Returns the expiration date of the primary key, considering self-certifications and direct-key signatures.\n * Returns `Infinity` if the key doesn't expire, or `null` if the key is revoked or invalid.\n * @param {Object} [userID] - User ID to consider instead of the primary user\n * @param {Object} [config] - Full configuration, defaults to openpgp.config\n * @returns {Promise<Date | Infinity | null>}\n * @async\n */\n async getExpirationTime(userID, config = defaultConfig) {\n let primaryKeyExpiry;\n try {\n const { selfCertification } = await this.getPrimaryUser(null, userID, config);\n const selfSigKeyExpiry = helper.getKeyExpirationTime(this.keyPacket, selfCertification);\n const selfSigExpiry = selfCertification.getExpirationTime();\n const directSignature = await helper.getLatestValidSignature(\n this.directSignatures, this.keyPacket, enums.signature.key, { key: this.keyPacket }, null, config\n ).catch(() => {});\n if (directSignature) {\n const directSigKeyExpiry = helper.getKeyExpirationTime(this.keyPacket, directSignature);\n // We do not support the edge case where the direct signature expires, since it would invalidate the corresponding key expiration,\n // causing a discountinous validy period for the key\n primaryKeyExpiry = Math.min(selfSigKeyExpiry, selfSigExpiry, directSigKeyExpiry);\n } else {\n primaryKeyExpiry = selfSigKeyExpiry < selfSigExpiry ? selfSigKeyExpiry : selfSigExpiry;\n }\n } catch (e) {\n primaryKeyExpiry = null;\n }\n\n return util.normalizeDate(primaryKeyExpiry);\n }\n\n\n /**\n * Returns primary user and most significant (latest valid) self signature\n * - if multiple primary users exist, returns the one with the latest self signature\n * - otherwise, returns the user with the latest self signature\n * @param {Date} [date] - Use the given date for verification instead of the current time\n * @param {Object} [userID] - User ID to get instead of the primary user, if it exists\n * @param {Object} [config] - Full configuration, defaults to openpgp.config\n * @returns {Promise<{\n * user: User,\n * selfCertification: SignaturePacket\n * }>} The primary user and the self signature\n * @async\n */\n async getPrimaryUser(date = new Date(), userID = {}, config = defaultConfig) {\n const primaryKey = this.keyPacket;\n const users = [];\n let exception;\n for (let i = 0; i < this.users.length; i++) {\n try {\n const user = this.users[i];\n if (!user.userID) {\n continue;\n }\n if (\n (userID.name !== undefined && user.userID.name !== userID.name) ||\n (userID.email !== undefined && user.userID.email !== userID.email) ||\n (userID.comment !== undefined && user.userID.comment !== userID.comment)\n ) {\n throw new Error('Could not find user that matches that user ID');\n }\n const dataToVerify = { userID: user.userID, key: primaryKey };\n const selfCertification = await helper.getLatestValidSignature(user.selfCertifications, primaryKey, enums.signature.certGeneric, dataToVerify, date, config);\n users.push({ index: i, user, selfCertification });\n } catch (e) {\n exception = e;\n }\n }\n if (!users.length) {\n throw exception || new Error('Could not find primary user');\n }\n await Promise.all(users.map(async function (a) {\n return a.user.revoked || a.user.isRevoked(a.selfCertification, null, date, config);\n }));\n // sort by primary user flag and signature creation time\n const primaryUser = users.sort(function(a, b) {\n const A = a.selfCertification;\n const B = b.selfCertification;\n return B.revoked - A.revoked || A.isPrimaryUserID - B.isPrimaryUserID || A.created - B.created;\n }).pop();\n const { user, selfCertification: cert } = primaryUser;\n if (cert.revoked || await user.isRevoked(cert, null, date, config)) {\n throw new Error('Primary user is revoked');\n }\n return primaryUser;\n }\n\n /**\n * Update key with new components from specified key with same key ID:\n * users, subkeys, certificates are merged into the destination key,\n * duplicates and expired signatures are ignored.\n *\n * If the source key is a private key and the destination key is public,\n * a private key is returned.\n * @param {Key} sourceKey - Source key to merge\n * @param {Date} [date] - Date to verify validity of signatures and keys\n * @param {Object} [config] - Full configuration, defaults to openpgp.config\n * @returns {Promise<Key>} updated key\n * @async\n */\n async update(sourceKey, date = new Date(), config = defaultConfig) {\n if (!this.hasSameFingerprintAs(sourceKey)) {\n throw new Error('Primary key fingerprints must be equal to update the key');\n }\n if (!this.isPrivate() && sourceKey.isPrivate()) {\n // check for equal subkey packets\n const equal = (this.subkeys.length === sourceKey.subkeys.length) &&\n (this.subkeys.every(destSubkey => {\n return sourceKey.subkeys.some(srcSubkey => {\n return destSubkey.hasSameFingerprintAs(srcSubkey);\n });\n }));\n if (!equal) {\n throw new Error('Cannot update public key with private key if subkeys mismatch');\n }\n\n return sourceKey.update(this, config);\n }\n // from here on, either:\n // - destination key is private, source key is public\n // - the keys are of the same type\n // hence we don't need to convert the destination key type\n const updatedKey = this.clone();\n // revocation signatures\n await helper.mergeSignatures(sourceKey, updatedKey, 'revocationSignatures', date, srcRevSig => {\n return helper.isDataRevoked(updatedKey.keyPacket, enums.signature.keyRevocation, updatedKey, [srcRevSig], null, sourceKey.keyPacket, date, config);\n });\n // direct signatures\n await helper.mergeSignatures(sourceKey, updatedKey, 'directSignatures', date);\n // update users\n await Promise.all(sourceKey.users.map(async srcUser => {\n // multiple users with the same ID/attribute are not explicitly disallowed by the spec\n // hence we support them, just in case\n const usersToUpdate = updatedKey.users.filter(dstUser => (\n (srcUser.userID && srcUser.userID.equals(dstUser.userID)) ||\n (srcUser.userAttribute && srcUser.userAttribute.equals(dstUser.userAttribute))\n ));\n if (usersToUpdate.length > 0) {\n await Promise.all(\n usersToUpdate.map(userToUpdate => userToUpdate.update(srcUser, date, config))\n );\n } else {\n const newUser = srcUser.clone();\n newUser.mainKey = updatedKey;\n updatedKey.users.push(newUser);\n }\n }));\n // update subkeys\n await Promise.all(sourceKey.subkeys.map(async srcSubkey => {\n // multiple subkeys with same fingerprint might be preset\n const subkeysToUpdate = updatedKey.subkeys.filter(dstSubkey => (\n dstSubkey.hasSameFingerprintAs(srcSubkey)\n ));\n if (subkeysToUpdate.length > 0) {\n await Promise.all(\n subkeysToUpdate.map(subkeyToUpdate => subkeyToUpdate.update(srcSubkey, date, config))\n );\n } else {\n const newSubkey = srcSubkey.clone();\n newSubkey.mainKey = updatedKey;\n updatedKey.subkeys.push(newSubkey);\n }\n }));\n\n return updatedKey;\n }\n\n /**\n * Get revocation certificate from a revoked key.\n * (To get a revocation certificate for an unrevoked key, call revoke() first.)\n * @param {Date} date - Use the given date instead of the current time\n * @param {Object} [config] - Full configuration, defaults to openpgp.config\n * @returns {Promise<String>} Armored revocation certificate.\n * @async\n */\n async getRevocationCertificate(date = new Date(), config = defaultConfig) {\n const dataToVerify = { key: this.keyPacket };\n const revocationSignature = await helper.getLatestValidSignature(this.revocationSignatures, this.keyPacket, enums.signature.keyRevocation, dataToVerify, date, config);\n const packetlist = new PacketList();\n packetlist.push(revocationSignature);\n return armor(enums.armor.publicKey, packetlist.write(), null, null, 'This is a revocation certificate');\n }\n\n /**\n * Applies a revocation certificate to a key\n * This adds the first signature packet in the armored text to the key,\n * if it is a valid revocation signature.\n * @param {String} revocationCertificate - armored revocation certificate\n * @param {Date} [date] - Date to verify the certificate\n * @param {Object} [config] - Full configuration, defaults to openpgp.config\n * @returns {Promise<Key>} Revoked key.\n * @async\n */\n async applyRevocationCertificate(revocationCertificate, date = new Date(), config = defaultConfig) {\n const input = await unarmor(revocationCertificate, config);\n const packetlist = await PacketList.fromBinary(input.data, allowedRevocationPackets, config);\n const revocationSignature = packetlist.findPacket(enums.packet.signature);\n if (!revocationSignature || revocationSignature.signatureType !== enums.signature.keyRevocation) {\n throw new Error('Could not find revocation signature packet');\n }\n if (!revocationSignature.issuerKeyID.equals(this.getKeyID())) {\n throw new Error('Revocation signature does not match key');\n }\n try {\n await revocationSignature.verify(this.keyPacket, enums.signature.keyRevocation, { key: this.keyPacket }, date, undefined, config);\n } catch (e) {\n throw util.wrapError('Could not verify revocation signature', e);\n }\n const key = this.clone();\n key.revocationSignatures.push(revocationSignature);\n return key;\n }\n\n /**\n * Signs primary user of key\n * @param {Array<PrivateKey>} privateKeys - decrypted private keys for signing\n * @param {Date} [date] - Use the given date for verification instead of the current time\n * @param {Object} [userID] - User ID to get instead of the primary user, if it exists\n * @param {Object} [config] - Full configuration, defaults to openpgp.config\n * @returns {Promise<Key>} Key with new certificate signature.\n * @async\n */\n async signPrimaryUser(privateKeys, date, userID, config = defaultConfig) {\n const { index, user } = await this.getPrimaryUser(date, userID, config);\n const userSign = await user.certify(privateKeys, date, config);\n const key = this.clone();\n key.users[index] = userSign;\n return key;\n }\n\n /**\n * Signs all users of key\n * @param {Array<PrivateKey>} privateKeys - decrypted private keys for signing\n * @param {Date} [date] - Use the given date for signing, instead of the current time\n * @param {Object} [config] - Full configuration, defaults to openpgp.config\n * @returns {Promise<Key>} Key with new certificate signature.\n * @async\n */\n async signAllUsers(privateKeys, date = new Date(), config = defaultConfig) {\n const key = this.clone();\n key.users = await Promise.all(this.users.map(function(user) {\n return user.certify(privateKeys, date, config);\n }));\n return key;\n }\n\n /**\n * Verifies primary user of key\n * - if no arguments are given, verifies the self certificates;\n * - otherwise, verifies all certificates signed with given keys.\n * @param {Array<PublicKey>} [verificationKeys] - array of keys to verify certificate signatures, instead of the primary key\n * @param {Date} [date] - Use the given date for verification instead of the current time\n * @param {Object} [userID] - User ID to get instead of the primary user, if it exists\n * @param {Object} [config] - Full configuration, defaults to openpgp.config\n * @returns {Promise<Array<{\n * keyID: module:type/keyid~KeyID,\n * valid: Boolean|null\n * }>>} List of signer's keyID and validity of signature.\n * Signature validity is null if the verification keys do not correspond to the certificate.\n * @async\n */\n async verifyPrimaryUser(verificationKeys, date = new Date(), userID, config = defaultConfig) {\n const primaryKey = this.keyPacket;\n const { user } = await this.getPrimaryUser(date, userID, config);\n const results = verificationKeys ?\n await user.verifyAllCertifications(verificationKeys, date, config) :\n [{ keyID: primaryKey.getKeyID(), valid: await user.verify(date, config).catch(() => false) }];\n return results;\n }\n\n /**\n * Verifies all users of key\n * - if no arguments are given, verifies the self certificates;\n * - otherwise, verifies all certificates signed with given keys.\n * @param {Array<PublicKey>} [verificationKeys] - array of keys to verify certificate signatures\n * @param {Date} [date] - Use the given date for verification instead of the current time\n * @param {Object} [config] - Full configuration, defaults to openpgp.config\n * @returns {Promise<Array<{\n * userID: String,\n * keyID: module:type/keyid~KeyID,\n * valid: Boolean|null\n * }>>} List of userID, signer's keyID and validity of signature.\n * Signature validity is null if the verification keys do not correspond to the certificate.\n * @async\n */\n async verifyAllUsers(verificationKeys, date = new Date(), config = defaultConfig) {\n const primaryKey = this.keyPacket;\n const results = [];\n await Promise.all(this.users.map(async user => {\n const signatures = verificationKeys ?\n await user.verifyAllCertifications(verificationKeys, date, config) :\n [{ keyID: primaryKey.getKeyID(), valid: await user.verify(date, config).catch(() => false) }];\n\n results.push(...signatures.map(\n signature => ({\n userID: user.userID.userID,\n keyID: signature.keyID,\n valid: signature.valid\n }))\n );\n }));\n return results;\n }\n}\n\n['getKeyID', 'getFingerprint', 'getAlgorithmInfo', 'getCreationTime', 'hasSameFingerprintAs'].forEach(name => {\n Key.prototype[name] =\n Subkey.prototype[name];\n});\n\nexport default Key;\n\n/**\n * Creates a PublicKey or PrivateKey depending on the packetlist in input\n * @param {PacketList} - packets to parse\n * @return {Key} parsed key\n * @throws if no key packet was found\n */\nexport function createKey(packetlist) {\n for (const packet of packetlist) {\n switch (packet.constructor.tag) {\n case enums.packet.secretKey:\n return new PrivateKey(packetlist);\n case enums.packet.publicKey:\n return new PublicKey(packetlist);\n }\n }\n throw new Error('No key packet found');\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 { armor } from '../encoding/armor';\nimport defaultConfig from '../config';\nimport enums from '../enums';\nimport Key from './key';\n\n/**\n * Class that represents an OpenPGP Public Key\n */\nclass PublicKey extends Key {\n /**\n * @param {PacketList} packetlist - The packets that form this key\n */\n constructor(packetlist) {\n super();\n this.keyPacket = null;\n this.revocationSignatures = [];\n this.directSignatures = [];\n this.users = [];\n this.subkeys = [];\n if (packetlist) {\n this.packetListToStructure(packetlist, new Set([enums.packet.secretKey, enums.packet.secretSubkey]));\n if (!this.keyPacket) {\n throw new Error('Invalid key: missing public-key packet');\n }\n }\n }\n\n /**\n * Returns true if this is a private key\n * @returns {false}\n */\n isPrivate() {\n return false;\n }\n\n /**\n * Returns key as public key (shallow copy)\n * @returns {PublicKey} New public Key\n */\n toPublic() {\n return this;\n }\n\n /**\n * Returns ASCII armored text of key\n * @param {Object} [config] - Full configuration, defaults to openpgp.config\n * @returns {ReadableStream<String>} ASCII armor.\n */\n armor(config = defaultConfig) {\n return armor(enums.armor.publicKey, this.toPacketList().write(), undefined, undefined, undefined, config);\n }\n}\n\nexport default PublicKey;\n\n","import PublicKey from './public_key';\nimport { armor } from '../encoding/armor';\nimport {\n PacketList,\n PublicKeyPacket,\n PublicSubkeyPacket\n} from '../packet';\nimport defaultConfig from '../config';\nimport enums from '../enums';\nimport * as helper from './helper';\n\n/**\n * Class that represents an OpenPGP Private key\n */\nclass PrivateKey extends PublicKey {\n /**\n * @param {PacketList} packetlist - The packets that form this key\n */\n constructor(packetlist) {\n super();\n this.packetListToStructure(packetlist, new Set([enums.packet.publicKey, enums.packet.publicSubkey]));\n if (!this.keyPacket) {\n throw new Error('Invalid key: missing private-key packet');\n }\n }\n\n /**\n * Returns true if this is a private key\n * @returns {Boolean}\n */\n isPrivate() {\n return true;\n }\n\n /**\n * Returns key as public key (shallow copy)\n * @returns {PublicKey} New public Key\n */\n toPublic() {\n const packetlist = new PacketList();\n const keyPackets = this.toPacketList();\n for (const keyPacket of keyPackets) {\n switch (keyPacket.constructor.tag) {\n case enums.packet.secretKey: {\n const pubKeyPacket = PublicKeyPacket.fromSecretKeyPacket(keyPacket);\n packetlist.push(pubKeyPacket);\n break;\n }\n case enums.packet.secretSubkey: {\n const pubSubkeyPacket = PublicSubkeyPacket.fromSecretSubkeyPacket(keyPacket);\n packetlist.push(pubSubkeyPacket);\n break;\n }\n default:\n packetlist.push(keyPacket);\n }\n }\n return new PublicKey(packetlist);\n }\n\n /**\n * Returns ASCII armored text of key\n * @param {Object} [config] - Full configuration, defaults to openpgp.config\n * @returns {ReadableStream<String>} ASCII armor.\n */\n armor(config = defaultConfig) {\n return armor(enums.armor.privateKey, this.toPacketList().write(), undefined, undefined, undefined, config);\n }\n\n /**\n * Returns all keys that are available for decryption, matching the keyID when given\n * This is useful to retrieve keys for session key decryption\n * @param {module:type/keyid~KeyID} keyID, optional\n * @param {Date} date, optional\n * @param {String} userID, optional\n * @param {Object} [config] - Full configuration, defaults to openpgp.config\n * @returns {Promise<Array<Key|Subkey>>} Array of decryption keys.\n * @async\n */\n async getDecryptionKeys(keyID, date = new Date(), userID = {}, config = defaultConfig) {\n const primaryKey = this.keyPacket;\n const keys = [];\n for (let i = 0; i < this.subkeys.length; i++) {\n if (!keyID || this.subkeys[i].getKeyID().equals(keyID, true)) {\n try {\n const dataToVerify = { key: primaryKey, bind: this.subkeys[i].keyPacket };\n const bindingSignature = await helper.getLatestValidSignature(this.subkeys[i].bindingSignatures, primaryKey, enums.signature.subkeyBinding, dataToVerify, date, config);\n if (helper.isValidDecryptionKeyPacket(bindingSignature, config)) {\n keys.push(this.subkeys[i]);\n }\n } catch (e) {}\n }\n }\n\n // evaluate primary key\n const primaryUser = await this.getPrimaryUser(date, userID, config);\n if ((!keyID || primaryKey.getKeyID().equals(keyID, true)) &&\n helper.isValidDecryptionKeyPacket(primaryUser.selfCertification, config)) {\n keys.push(this);\n }\n\n return keys;\n }\n\n /**\n * Returns true if the primary key or any subkey is decrypted.\n * A dummy key is considered encrypted.\n */\n isDecrypted() {\n return this.getKeys().some(({ keyPacket }) => keyPacket.isDecrypted());\n }\n\n /**\n * Check whether the private and public primary key parameters correspond\n * Together with verification of binding signatures, this guarantees key integrity\n * In case of gnu-dummy primary key, it is enough to validate any signing subkeys\n * otherwise all encryption subkeys are validated\n * If only gnu-dummy keys are found, we cannot properly validate so we throw an error\n * @param {Object} [config] - Full configuration, defaults to openpgp.config\n * @throws {Error} if validation was not successful and the key cannot be trusted\n * @async\n */\n async validate(config = defaultConfig) {\n if (!this.isPrivate()) {\n throw new Error('Cannot validate a public key');\n }\n\n let signingKeyPacket;\n if (!this.keyPacket.isDummy()) {\n signingKeyPacket = this.keyPacket;\n } else {\n /**\n * It is enough to validate any signing keys\n * since its binding signatures are also checked\n */\n const signingKey = await this.getSigningKey(null, null, undefined, { ...config, rejectPublicKeyAlgorithms: new Set(), minRSABits: 0 });\n // This could again be a dummy key\n if (signingKey && !signingKey.keyPacket.isDummy()) {\n signingKeyPacket = signingKey.keyPacket;\n }\n }\n\n if (signingKeyPacket) {\n return signingKeyPacket.validate();\n } else {\n const keys = this.getKeys();\n const allDummies = keys.map(key => key.keyPacket.isDummy()).every(Boolean);\n if (allDummies) {\n throw new Error('Cannot validate an all-gnu-dummy key');\n }\n\n return Promise.all(keys.map(async key => key.keyPacket.validate()));\n }\n }\n\n /**\n * Clear private key parameters\n */\n clearPrivateParams() {\n this.getKeys().forEach(({ keyPacket }) => {\n if (keyPacket.isDecrypted()) {\n keyPacket.clearPrivateParams();\n }\n });\n }\n\n /**\n * Revokes the key\n * @param {Object} reasonForRevocation - optional, object indicating the reason for revocation\n * @param {module:enums.reasonForRevocation} reasonForRevocation.flag optional, flag indicating the reason for revocation\n * @param {String} reasonForRevocation.string optional, string explaining the reason for revocation\n * @param {Date} date - optional, override the creationtime of the revocation signature\n * @param {Object} [config] - Full configuration, defaults to openpgp.config\n * @returns {Promise<PrivateKey>} New key with revocation signature.\n * @async\n */\n async revoke(\n {\n flag: reasonForRevocationFlag = enums.reasonForRevocation.noReason,\n string: reasonForRevocationString = ''\n } = {},\n date = new Date(),\n config = defaultConfig\n ) {\n if (!this.isPrivate()) {\n throw new Error('Need private key for revoking');\n }\n const dataToSign = { key: this.keyPacket };\n const key = this.clone();\n key.revocationSignatures.push(await helper.createSignaturePacket(dataToSign, null, this.keyPacket, {\n signatureType: enums.signature.keyRevocation,\n reasonForRevocationFlag: enums.write(enums.reasonForRevocation, reasonForRevocationFlag),\n reasonForRevocationString\n }, date, undefined, undefined, config));\n return key;\n }\n\n\n /**\n * Generates a new OpenPGP subkey, and returns a clone of the Key object with the new subkey added.\n * Supports RSA and ECC keys. Defaults to the algorithm and bit size/curve of the primary key. DSA primary keys default to RSA subkeys.\n * @param {ecc|rsa} options.type The subkey algorithm: ECC or RSA\n * @param {String} options.curve (optional) Elliptic curve for ECC keys\n * @param {Integer} options.rsaBits (optional) Number of bits for RSA subkeys\n * @param {Number} options.keyExpirationTime (optional) Number of seconds from the key creation time after which the key expires\n * @param {Date} options.date (optional) Override the creation date of the key and the key signatures\n * @param {Boolean} options.sign (optional) Indicates whether the subkey should sign rather than encrypt. Defaults to false\n * @param {Object} options.config (optional) custom configuration settings to overwrite those in [config]{@link module:config}\n * @returns {Promise<PrivateKey>}\n * @async\n */\n async addSubkey(options = {}) {\n const config = { ...defaultConfig, ...options.config };\n if (options.passphrase) {\n throw new Error('Subkey could not be encrypted here, please encrypt whole key');\n }\n if (options.rsaBits < config.minRSABits) {\n throw new Error(`rsaBits should be at least ${config.minRSABits}, got: ${options.rsaBits}`);\n }\n const secretKeyPacket = this.keyPacket;\n if (secretKeyPacket.isDummy()) {\n throw new Error('Cannot add subkey to gnu-dummy primary key');\n }\n if (!secretKeyPacket.isDecrypted()) {\n throw new Error('Key is not decrypted');\n }\n const defaultOptions = secretKeyPacket.getAlgorithmInfo();\n defaultOptions.type = defaultOptions.curve ? 'ecc' : 'rsa'; // DSA keys default to RSA\n defaultOptions.rsaBits = defaultOptions.bits || 4096;\n defaultOptions.curve = defaultOptions.curve || 'curve25519';\n options = helper.sanitizeKeyOptions(options, defaultOptions);\n const keyPacket = await helper.generateSecretSubkey(options);\n const bindingSignature = await helper.createBindingSignature(keyPacket, secretKeyPacket, options, config);\n const packetList = this.toPacketList();\n packetList.push(keyPacket, bindingSignature);\n return new PrivateKey(packetList);\n }\n}\n\nexport default PrivateKey;\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 {\n PacketList,\n UserIDPacket,\n SignaturePacket,\n PublicKeyPacket,\n PublicSubkeyPacket,\n SecretKeyPacket,\n SecretSubkeyPacket,\n UserAttributePacket\n} from '../packet';\nimport PrivateKey from './private_key';\nimport { createKey } from './key';\nimport * as helper from './helper';\nimport enums from '../enums';\nimport util from '../util';\nimport defaultConfig from '../config';\nimport { unarmor } from '../encoding/armor';\n\n// A Key can contain the following packets\nconst allowedKeyPackets = /*#__PURE__*/ util.constructAllowedPackets([\n PublicKeyPacket,\n PublicSubkeyPacket,\n SecretKeyPacket,\n SecretSubkeyPacket,\n UserIDPacket,\n UserAttributePacket,\n SignaturePacket\n]);\n\n/**\n * Generates a new OpenPGP key. Supports RSA and ECC keys.\n * By default, primary and subkeys will be of same type.\n * @param {ecc|rsa} options.type The primary key algorithm type: ECC or RSA\n * @param {String} options.curve Elliptic curve for ECC keys\n * @param {Integer} options.rsaBits Number of bits for RSA keys\n * @param {Array<String|Object>} options.userIDs User IDs as strings or objects: 'Jo Doe <info@jo.com>' or { name:'Jo Doe', email:'info@jo.com' }\n * @param {String} options.passphrase Passphrase used to encrypt the resulting private key\n * @param {Number} options.keyExpirationTime (optional) Number of seconds from the key creation time after which the key expires\n * @param {Date} options.date Creation date of the key and the key signatures\n * @param {Object} config - Full configuration\n * @param {Array<Object>} options.subkeys (optional) options for each subkey, default to main key options. e.g. [{sign: true, passphrase: '123'}]\n * sign parameter defaults to false, and indicates whether the subkey should sign rather than encrypt\n * @returns {Promise<{{ key: PrivateKey, revocationCertificate: String }}>}\n * @async\n * @static\n * @private\n */\nexport async function generate(options, config) {\n options.sign = true; // primary key is always a signing key\n options = helper.sanitizeKeyOptions(options);\n options.subkeys = options.subkeys.map((subkey, index) => helper.sanitizeKeyOptions(options.subkeys[index], options));\n let promises = [helper.generateSecretKey(options, config)];\n promises = promises.concat(options.subkeys.map(options => helper.generateSecretSubkey(options, config)));\n const packets = await Promise.all(promises);\n\n const key = await wrapKeyObject(packets[0], packets.slice(1), options, config);\n const revocationCertificate = await key.getRevocationCertificate(options.date, config);\n key.revocationSignatures = [];\n return { key, revocationCertificate };\n}\n\n/**\n * Reformats and signs an OpenPGP key with a given User ID. Currently only supports RSA keys.\n * @param {PrivateKey} options.privateKey The private key to reformat\n * @param {Array<String|Object>} options.userIDs User IDs as strings or objects: 'Jo Doe <info@jo.com>' or { name:'Jo Doe', email:'info@jo.com' }\n * @param {String} options.passphrase Passphrase used to encrypt the resulting private key\n * @param {Number} options.keyExpirationTime Number of seconds from the key creation time after which the key expires\n * @param {Date} options.date Override the creation date of the key signatures\n * @param {Array<Object>} options.subkeys (optional) options for each subkey, default to main key options. e.g. [{sign: true, passphrase: '123'}]\n * @param {Object} config - Full configuration\n *\n * @returns {Promise<{{ key: PrivateKey, revocationCertificate: String }}>}\n * @async\n * @static\n * @private\n */\nexport async function reformat(options, config) {\n options = sanitize(options);\n const { privateKey } = options;\n\n if (!privateKey.isPrivate()) {\n throw new Error('Cannot reformat a public key');\n }\n\n if (privateKey.keyPacket.isDummy()) {\n throw new Error('Cannot reformat a gnu-dummy primary key');\n }\n\n const isDecrypted = privateKey.getKeys().every(({ keyPacket }) => keyPacket.isDecrypted());\n if (!isDecrypted) {\n throw new Error('Key is not decrypted');\n }\n\n const secretKeyPacket = privateKey.keyPacket;\n\n if (!options.subkeys) {\n options.subkeys = await Promise.all(privateKey.subkeys.map(async subkey => {\n const secretSubkeyPacket = subkey.keyPacket;\n const dataToVerify = { key: secretKeyPacket, bind: secretSubkeyPacket };\n const bindingSignature = await (\n helper.getLatestValidSignature(subkey.bindingSignatures, secretKeyPacket, enums.signature.subkeyBinding, dataToVerify, null, config)\n ).catch(() => ({}));\n return {\n sign: bindingSignature.keyFlags && (bindingSignature.keyFlags[0] & enums.keyFlags.signData)\n };\n }));\n }\n\n const secretSubkeyPackets = privateKey.subkeys.map(subkey => subkey.keyPacket);\n if (options.subkeys.length !== secretSubkeyPackets.length) {\n throw new Error('Number of subkey options does not match number of subkeys');\n }\n\n options.subkeys = options.subkeys.map(subkeyOptions => sanitize(subkeyOptions, options));\n\n const key = await wrapKeyObject(secretKeyPacket, secretSubkeyPackets, options, config);\n const revocationCertificate = await key.getRevocationCertificate(options.date, config);\n key.revocationSignatures = [];\n return { key, revocationCertificate };\n\n function sanitize(options, subkeyDefaults = {}) {\n options.keyExpirationTime = options.keyExpirationTime || subkeyDefaults.keyExpirationTime;\n options.passphrase = util.isString(options.passphrase) ? options.passphrase : subkeyDefaults.passphrase;\n options.date = options.date || subkeyDefaults.date;\n\n return options;\n }\n}\n\n/**\n * Construct PrivateKey object from the given key packets, add certification signatures and set passphrase protection\n * The new key includes a revocation certificate that must be removed before returning the key, otherwise the key is considered revoked.\n * @param {SecretKeyPacket} secretKeyPacket\n * @param {SecretSubkeyPacket} secretSubkeyPackets\n * @param {Object} options\n * @param {Object} config - Full configuration\n * @returns {PrivateKey}\n */\nasync function wrapKeyObject(secretKeyPacket, secretSubkeyPackets, options, config) {\n // set passphrase protection\n if (options.passphrase) {\n await secretKeyPacket.encrypt(options.passphrase, config);\n }\n\n await Promise.all(secretSubkeyPackets.map(async function(secretSubkeyPacket, index) {\n const subkeyPassphrase = options.subkeys[index].passphrase;\n if (subkeyPassphrase) {\n await secretSubkeyPacket.encrypt(subkeyPassphrase, config);\n }\n }));\n\n const packetlist = new PacketList();\n packetlist.push(secretKeyPacket);\n\n await Promise.all(options.userIDs.map(async function(userID, index) {\n function createPreferredAlgos(algos, preferredAlgo) {\n return [preferredAlgo, ...algos.filter(algo => algo !== preferredAlgo)];\n }\n\n const userIDPacket = UserIDPacket.fromObject(userID);\n const dataToSign = {};\n dataToSign.userID = userIDPacket;\n dataToSign.key = secretKeyPacket;\n const signaturePacket = new SignaturePacket();\n signaturePacket.signatureType = enums.signature.certGeneric;\n signaturePacket.publicKeyAlgorithm = secretKeyPacket.algorithm;\n signaturePacket.hashAlgorithm = await helper.getPreferredHashAlgo(null, secretKeyPacket, undefined, undefined, config);\n signaturePacket.keyFlags = [enums.keyFlags.certifyKeys | enums.keyFlags.signData];\n signaturePacket.preferredSymmetricAlgorithms = createPreferredAlgos([\n // prefer aes256, aes128, then aes192 (no WebCrypto support: https://www.chromium.org/blink/webcrypto#TOC-AES-support)\n enums.symmetric.aes256,\n enums.symmetric.aes128,\n enums.symmetric.aes192\n ], config.preferredSymmetricAlgorithm);\n if (config.aeadProtect) {\n signaturePacket.preferredAEADAlgorithms = createPreferredAlgos([\n enums.aead.eax,\n enums.aead.ocb\n ], config.preferredAEADAlgorithm);\n }\n signaturePacket.preferredHashAlgorithms = createPreferredAlgos([\n // prefer fast asm.js implementations (SHA-256)\n enums.hash.sha256,\n enums.hash.sha512\n ], config.preferredHashAlgorithm);\n signaturePacket.preferredCompressionAlgorithms = createPreferredAlgos([\n enums.compression.zlib,\n enums.compression.zip,\n enums.compression.uncompressed\n ], config.preferredCompressionAlgorithm);\n if (index === 0) {\n signaturePacket.isPrimaryUserID = true;\n }\n // integrity protection always enabled\n signaturePacket.features = [0];\n signaturePacket.features[0] |= enums.features.modificationDetection;\n if (config.aeadProtect) {\n signaturePacket.features[0] |= enums.features.aead;\n }\n if (config.v5Keys) {\n signaturePacket.features[0] |= enums.features.v5Keys;\n }\n if (options.keyExpirationTime > 0) {\n signaturePacket.keyExpirationTime = options.keyExpirationTime;\n signaturePacket.keyNeverExpires = false;\n }\n await signaturePacket.sign(secretKeyPacket, dataToSign, options.date);\n\n return { userIDPacket, signaturePacket };\n })).then(list => {\n list.forEach(({ userIDPacket, signaturePacket }) => {\n packetlist.push(userIDPacket);\n packetlist.push(signaturePacket);\n });\n });\n\n await Promise.all(secretSubkeyPackets.map(async function(secretSubkeyPacket, index) {\n const subkeyOptions = options.subkeys[index];\n const subkeySignaturePacket = await helper.createBindingSignature(secretSubkeyPacket, secretKeyPacket, subkeyOptions, config);\n return { secretSubkeyPacket, subkeySignaturePacket };\n })).then(packets => {\n packets.forEach(({ secretSubkeyPacket, subkeySignaturePacket }) => {\n packetlist.push(secretSubkeyPacket);\n packetlist.push(subkeySignaturePacket);\n });\n });\n\n // Add revocation signature packet for creating a revocation certificate.\n // This packet should be removed before returning the key.\n const dataToSign = { key: secretKeyPacket };\n packetlist.push(await helper.createSignaturePacket(dataToSign, null, secretKeyPacket, {\n signatureType: enums.signature.keyRevocation,\n reasonForRevocationFlag: enums.reasonForRevocation.noReason,\n reasonForRevocationString: ''\n }, options.date, undefined, undefined, config));\n\n if (options.passphrase) {\n secretKeyPacket.clearPrivateParams();\n }\n\n await Promise.all(secretSubkeyPackets.map(async function(secretSubkeyPacket, index) {\n const subkeyPassphrase = options.subkeys[index].passphrase;\n if (subkeyPassphrase) {\n secretSubkeyPacket.clearPrivateParams();\n }\n }));\n\n return new PrivateKey(packetlist);\n}\n\n/**\n * Reads an (optionally armored) OpenPGP key and returns a key object\n * @param {Object} options\n * @param {String} [options.armoredKey] - Armored key to be parsed\n * @param {Uint8Array} [options.binaryKey] - Binary key to be parsed\n * @param {Object} [options.config] - Custom configuration settings to overwrite those in [config]{@link module:config}\n * @returns {Promise<Key>} Key object.\n * @async\n * @static\n */\nexport async function readKey({ armoredKey, binaryKey, config, ...rest }) {\n config = { ...defaultConfig, ...config };\n if (!armoredKey && !binaryKey) {\n throw new Error('readKey: must pass options object containing `armoredKey` or `binaryKey`');\n }\n if (armoredKey && !util.isString(armoredKey)) {\n throw new Error('readKey: options.armoredKey must be a string');\n }\n if (binaryKey && !util.isUint8Array(binaryKey)) {\n throw new Error('readKey: options.binaryKey must be a Uint8Array');\n }\n const unknownOptions = Object.keys(rest); if (unknownOptions.length > 0) throw new Error(`Unknown option: ${unknownOptions.join(', ')}`);\n\n let input;\n if (armoredKey) {\n const { type, data } = await unarmor(armoredKey, config);\n if (!(type === enums.armor.publicKey || type === enums.armor.privateKey)) {\n throw new Error('Armored text not of type key');\n }\n input = data;\n } else {\n input = binaryKey;\n }\n const packetlist = await PacketList.fromBinary(input, allowedKeyPackets, config);\n return createKey(packetlist);\n}\n\n/**\n * Reads an (optionally armored) OpenPGP private key and returns a PrivateKey object\n * @param {Object} options\n * @param {String} [options.armoredKey] - Armored key to be parsed\n * @param {Uint8Array} [options.binaryKey] - Binary key to be parsed\n * @param {Object} [options.config] - Custom configuration settings to overwrite those in [config]{@link module:config}\n * @returns {Promise<PrivateKey>} Key object.\n * @async\n * @static\n */\nexport async function readPrivateKey({ armoredKey, binaryKey, config, ...rest }) {\n config = { ...defaultConfig, ...config };\n if (!armoredKey && !binaryKey) {\n throw new Error('readPrivateKey: must pass options object containing `armoredKey` or `binaryKey`');\n }\n if (armoredKey && !util.isString(armoredKey)) {\n throw new Error('readPrivateKey: options.armoredKey must be a string');\n }\n if (binaryKey && !util.isUint8Array(binaryKey)) {\n throw new Error('readPrivateKey: options.binaryKey must be a Uint8Array');\n }\n const unknownOptions = Object.keys(rest); if (unknownOptions.length > 0) throw new Error(`Unknown option: ${unknownOptions.join(', ')}`);\n\n let input;\n if (armoredKey) {\n const { type, data } = await unarmor(armoredKey, config);\n if (!(type === enums.armor.privateKey)) {\n throw new Error('Armored text not of type private key');\n }\n input = data;\n } else {\n input = binaryKey;\n }\n const packetlist = await PacketList.fromBinary(input, allowedKeyPackets, config);\n return new PrivateKey(packetlist);\n}\n\n/**\n * Reads an (optionally armored) OpenPGP key block and returns a list of key objects\n * @param {Object} options\n * @param {String} [options.armoredKeys] - Armored keys to be parsed\n * @param {Uint8Array} [options.binaryKeys] - Binary keys to be parsed\n * @param {Object} [options.config] - Custom configuration settings to overwrite those in [config]{@link module:config}\n * @returns {Promise<Array<Key>>} Key objects.\n * @async\n * @static\n */\nexport async function readKeys({ armoredKeys, binaryKeys, config, ...rest }) {\n config = { ...defaultConfig, ...config };\n let input = armoredKeys || binaryKeys;\n if (!input) {\n throw new Error('readKeys: must pass options object containing `armoredKeys` or `binaryKeys`');\n }\n if (armoredKeys && !util.isString(armoredKeys)) {\n throw new Error('readKeys: options.armoredKeys must be a string');\n }\n if (binaryKeys && !util.isUint8Array(binaryKeys)) {\n throw new Error('readKeys: options.binaryKeys must be a Uint8Array');\n }\n const unknownOptions = Object.keys(rest); if (unknownOptions.length > 0) throw new Error(`Unknown option: ${unknownOptions.join(', ')}`);\n\n if (armoredKeys) {\n const { type, data } = await unarmor(armoredKeys, config);\n if (type !== enums.armor.publicKey && type !== enums.armor.privateKey) {\n throw new Error('Armored text not of type key');\n }\n input = data;\n }\n const keys = [];\n const packetlist = await PacketList.fromBinary(input, allowedKeyPackets, config);\n const keyIndex = packetlist.indexOfTag(enums.packet.publicKey, enums.packet.secretKey);\n if (keyIndex.length === 0) {\n throw new Error('No key packet found');\n }\n for (let i = 0; i < keyIndex.length; i++) {\n const oneKeyList = packetlist.slice(keyIndex[i], keyIndex[i + 1]);\n const newKey = createKey(oneKeyList);\n keys.push(newKey);\n }\n return keys;\n}\n\n/**\n * Reads an (optionally armored) OpenPGP private key block and returns a list of PrivateKey objects\n * @param {Object} options\n * @param {String} [options.armoredKeys] - Armored keys to be parsed\n * @param {Uint8Array} [options.binaryKeys] - Binary keys to be parsed\n * @param {Object} [options.config] - Custom configuration settings to overwrite those in [config]{@link module:config}\n * @returns {Promise<Array<PrivateKey>>} Key objects.\n * @async\n * @static\n */\nexport async function readPrivateKeys({ armoredKeys, binaryKeys, config }) {\n config = { ...defaultConfig, ...config };\n let input = armoredKeys || binaryKeys;\n if (!input) {\n throw new Error('readPrivateKeys: must pass options object containing `armoredKeys` or `binaryKeys`');\n }\n if (armoredKeys && !util.isString(armoredKeys)) {\n throw new Error('readPrivateKeys: options.armoredKeys must be a string');\n }\n if (binaryKeys && !util.isUint8Array(binaryKeys)) {\n throw new Error('readPrivateKeys: options.binaryKeys must be a Uint8Array');\n }\n if (armoredKeys) {\n const { type, data } = await unarmor(armoredKeys, config);\n if (type !== enums.armor.privateKey) {\n throw new Error('Armored text not of type private key');\n }\n input = data;\n }\n const keys = [];\n const packetlist = await PacketList.fromBinary(input, allowedKeyPackets, config);\n const keyIndex = packetlist.indexOfTag(enums.packet.secretKey);\n if (keyIndex.length === 0) {\n throw new Error('No secret key packet found');\n }\n for (let i = 0; i < keyIndex.length; i++) {\n const oneKeyList = packetlist.slice(keyIndex[i], keyIndex[i + 1]);\n const newKey = new PrivateKey(oneKeyList);\n keys.push(newKey);\n }\n return keys;\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 { armor, unarmor } from './encoding/armor';\nimport KeyID from './type/keyid';\nimport defaultConfig from './config';\nimport crypto from './crypto';\nimport enums from './enums';\nimport util from './util';\nimport { Signature } from './signature';\nimport { getPreferredHashAlgo, getPreferredAlgo, isAEADSupported, createSignaturePacket } from './key';\nimport {\n PacketList,\n LiteralDataPacket,\n CompressedDataPacket,\n AEADEncryptedDataPacket,\n SymEncryptedIntegrityProtectedDataPacket,\n SymmetricallyEncryptedDataPacket,\n PublicKeyEncryptedSessionKeyPacket,\n SymEncryptedSessionKeyPacket,\n OnePassSignaturePacket,\n SignaturePacket\n} from './packet';\n\n// A Message can contain the following packets\nconst allowedMessagePackets = /*#__PURE__*/ util.constructAllowedPackets([\n LiteralDataPacket,\n CompressedDataPacket,\n AEADEncryptedDataPacket,\n SymEncryptedIntegrityProtectedDataPacket,\n SymmetricallyEncryptedDataPacket,\n PublicKeyEncryptedSessionKeyPacket,\n SymEncryptedSessionKeyPacket,\n OnePassSignaturePacket,\n SignaturePacket\n]);\n// A SKESK packet can contain the following packets\nconst allowedSymSessionKeyPackets = /*#__PURE__*/ util.constructAllowedPackets([SymEncryptedSessionKeyPacket]);\n// A detached signature can contain the following packets\nconst allowedDetachedSignaturePackets = /*#__PURE__*/ util.constructAllowedPackets([SignaturePacket]);\n\n/**\n * Class that represents an OpenPGP message.\n * Can be an encrypted message, signed message, compressed message or literal message\n * See {@link https://tools.ietf.org/html/rfc4880#section-11.3}\n */\nexport class Message {\n /**\n * @param {PacketList} packetlist - The packets that form this message\n */\n constructor(packetlist) {\n this.packets = packetlist || new PacketList();\n }\n\n /**\n * Returns the key IDs of the keys to which the session key is encrypted\n * @returns {Array<module:type/keyid~KeyID>} Array of keyID objects.\n */\n getEncryptionKeyIDs() {\n const keyIDs = [];\n const pkESKeyPacketlist = this.packets.filterByTag(enums.packet.publicKeyEncryptedSessionKey);\n pkESKeyPacketlist.forEach(function(packet) {\n keyIDs.push(packet.publicKeyID);\n });\n return keyIDs;\n }\n\n /**\n * Returns the key IDs of the keys that signed the message\n * @returns {Array<module:type/keyid~KeyID>} Array of keyID objects.\n */\n getSigningKeyIDs() {\n const msg = this.unwrapCompressed();\n // search for one pass signatures\n const onePassSigList = msg.packets.filterByTag(enums.packet.onePassSignature);\n if (onePassSigList.length > 0) {\n return onePassSigList.map(packet => packet.issuerKeyID);\n }\n // if nothing found look for signature packets\n const signatureList = msg.packets.filterByTag(enums.packet.signature);\n return signatureList.map(packet => packet.issuerKeyID);\n }\n\n /**\n * Decrypt the message. Either a private key, a session key, or a password must be specified.\n * @param {Array<PrivateKey>} [decryptionKeys] - Private keys with decrypted secret data\n * @param {Array<String>} [passwords] - Passwords used to decrypt\n * @param {Array<Object>} [sessionKeys] - Session keys in the form: { data:Uint8Array, algorithm:String, [aeadAlgorithm:String] }\n * @param {Date} [date] - Use the given date for key verification instead of the current time\n * @param {Object} [config] - Full configuration, defaults to openpgp.config\n * @returns {Promise<Message>} New message with decrypted content.\n * @async\n */\n async decrypt(decryptionKeys, passwords, sessionKeys, date = new Date(), config = defaultConfig) {\n const keyObjs = sessionKeys || await this.decryptSessionKeys(decryptionKeys, passwords, date, config);\n\n const symEncryptedPacketlist = this.packets.filterByTag(\n enums.packet.symmetricallyEncryptedData,\n enums.packet.symEncryptedIntegrityProtectedData,\n enums.packet.aeadEncryptedData\n );\n\n if (symEncryptedPacketlist.length === 0) {\n return this;\n }\n\n const symEncryptedPacket = symEncryptedPacketlist[0];\n let exception = null;\n const decryptedPromise = Promise.all(keyObjs.map(async keyObj => {\n if (!keyObj || !util.isUint8Array(keyObj.data) || !util.isString(keyObj.algorithm)) {\n throw new Error('Invalid session key for decryption.');\n }\n\n try {\n await symEncryptedPacket.decrypt(keyObj.algorithm, keyObj.data, config);\n } catch (e) {\n util.printDebugError(e);\n exception = e;\n }\n }));\n // We don't await stream.cancel here because it only returns when the other copy is canceled too.\n stream.cancel(symEncryptedPacket.encrypted); // Don't keep copy of encrypted data in memory.\n symEncryptedPacket.encrypted = null;\n await decryptedPromise;\n\n if (!symEncryptedPacket.packets || !symEncryptedPacket.packets.length) {\n throw exception || new Error('Decryption failed.');\n }\n\n const resultMsg = new Message(symEncryptedPacket.packets);\n symEncryptedPacket.packets = new PacketList(); // remove packets after decryption\n\n return resultMsg;\n }\n\n /**\n * Decrypt encrypted session keys either with private keys or passwords.\n * @param {Array<PrivateKey>} [decryptionKeys] - Private keys with decrypted secret data\n * @param {Array<String>} [passwords] - Passwords used to decrypt\n * @param {Date} [date] - Use the given date for key verification, instead of current time\n * @param {Object} [config] - Full configuration, defaults to openpgp.config\n * @returns {Promise<Array<{\n * data: Uint8Array,\n * algorithm: String\n * }>>} array of object with potential sessionKey, algorithm pairs\n * @async\n */\n async decryptSessionKeys(decryptionKeys, passwords, date = new Date(), config = defaultConfig) {\n let keyPackets = [];\n\n let exception;\n if (passwords) {\n const symESKeyPacketlist = this.packets.filterByTag(enums.packet.symEncryptedSessionKey);\n if (symESKeyPacketlist.length === 0) {\n throw new Error('No symmetrically encrypted session key packet found.');\n }\n await Promise.all(passwords.map(async function(password, i) {\n let packets;\n if (i) {\n packets = await PacketList.fromBinary(symESKeyPacketlist.write(), allowedSymSessionKeyPackets, config);\n } else {\n packets = symESKeyPacketlist;\n }\n await Promise.all(packets.map(async function(keyPacket) {\n try {\n await keyPacket.decrypt(password);\n keyPackets.push(keyPacket);\n } catch (err) {\n util.printDebugError(err);\n }\n }));\n }));\n } else if (decryptionKeys) {\n const pkESKeyPacketlist = this.packets.filterByTag(enums.packet.publicKeyEncryptedSessionKey);\n if (pkESKeyPacketlist.length === 0) {\n throw new Error('No public key encrypted session key packet found.');\n }\n await Promise.all(pkESKeyPacketlist.map(async function(keyPacket) {\n await Promise.all(decryptionKeys.map(async function(decryptionKey) {\n let algos = [\n enums.symmetric.aes256, // Old OpenPGP.js default fallback\n enums.symmetric.aes128, // RFC4880bis fallback\n enums.symmetric.tripledes, // RFC4880 fallback\n enums.symmetric.cast5 // Golang OpenPGP fallback\n ];\n try {\n const primaryUser = await decryptionKey.getPrimaryUser(date, undefined, config); // TODO: Pass userID from somewhere.\n if (primaryUser.selfCertification.preferredSymmetricAlgorithms) {\n algos = algos.concat(primaryUser.selfCertification.preferredSymmetricAlgorithms);\n }\n } catch (e) {}\n\n // do not check key expiration to allow decryption of old messages\n const decryptionKeyPackets = (await decryptionKey.getDecryptionKeys(keyPacket.publicKeyID, null, undefined, config)).map(key => key.keyPacket);\n await Promise.all(decryptionKeyPackets.map(async function(decryptionKeyPacket) {\n if (!decryptionKeyPacket || decryptionKeyPacket.isDummy()) {\n return;\n }\n if (!decryptionKeyPacket.isDecrypted()) {\n throw new Error('Decryption key is not decrypted.');\n }\n try {\n await keyPacket.decrypt(decryptionKeyPacket);\n if (!algos.includes(enums.write(enums.symmetric, keyPacket.sessionKeyAlgorithm))) {\n throw new Error('A non-preferred symmetric algorithm was used.');\n }\n keyPackets.push(keyPacket);\n } catch (err) {\n util.printDebugError(err);\n exception = err;\n }\n }));\n }));\n stream.cancel(keyPacket.encrypted); // Don't keep copy of encrypted data in memory.\n keyPacket.encrypted = null;\n }));\n } else {\n throw new Error('No key or password specified.');\n }\n\n if (keyPackets.length) {\n // Return only unique session keys\n if (keyPackets.length > 1) {\n const seen = new Set();\n keyPackets = keyPackets.filter(item => {\n const k = item.sessionKeyAlgorithm + util.uint8ArrayToString(item.sessionKey);\n if (seen.has(k)) {\n return false;\n }\n seen.add(k);\n return true;\n });\n }\n\n return keyPackets.map(packet => ({ data: packet.sessionKey, algorithm: packet.sessionKeyAlgorithm }));\n }\n throw exception || new Error('Session key decryption failed.');\n }\n\n /**\n * Get literal data that is the body of the message\n * @returns {(Uint8Array|null)} Literal body of the message as Uint8Array.\n */\n getLiteralData() {\n const msg = this.unwrapCompressed();\n const literal = msg.packets.findPacket(enums.packet.literalData);\n return (literal && literal.getBytes()) || null;\n }\n\n /**\n * Get filename from literal data packet\n * @returns {(String|null)} Filename of literal data packet as string.\n */\n getFilename() {\n const msg = this.unwrapCompressed();\n const literal = msg.packets.findPacket(enums.packet.literalData);\n return (literal && literal.getFilename()) || null;\n }\n\n /**\n * Get literal data as text\n * @returns {(String|null)} Literal body of the message interpreted as text.\n */\n getText() {\n const msg = this.unwrapCompressed();\n const literal = msg.packets.findPacket(enums.packet.literalData);\n if (literal) {\n return literal.getText();\n }\n return null;\n }\n\n /**\n * Generate a new session key object, taking the algorithm preferences of the passed encryption keys into account, if any.\n * @param {Array<PublicKey>} [encryptionKeys] - Public key(s) to select algorithm preferences for\n * @param {Date} [date] - Date to select algorithm preferences at\n * @param {Array<Object>} [userIDs] - User IDs to select algorithm preferences for\n * @param {Object} [config] - Full configuration, defaults to openpgp.config\n * @returns {Promise<{ data: Uint8Array, algorithm: String, aeadAlgorithm: undefined|String }>} Object with session key data and algorithms.\n * @async\n */\n static async generateSessionKey(encryptionKeys = [], date = new Date(), userIDs = [], config = defaultConfig) {\n const algorithm = enums.read(enums.symmetric, await getPreferredAlgo('symmetric', encryptionKeys, date, userIDs, config));\n const aeadAlgorithm = config.aeadProtect && await isAEADSupported(encryptionKeys, date, userIDs, config) ?\n enums.read(enums.aead, await getPreferredAlgo('aead', encryptionKeys, date, userIDs, config)) :\n undefined;\n\n const sessionKeyData = await crypto.generateSessionKey(algorithm);\n return { data: sessionKeyData, algorithm, aeadAlgorithm };\n }\n\n /**\n * Encrypt the message either with public keys, passwords, or both at once.\n * @param {Array<PublicKey>} [encryptionKeys] - Public key(s) for message encryption\n * @param {Array<String>} [passwords] - Password(s) for message encryption\n * @param {Object} [sessionKey] - Session key in the form: { data:Uint8Array, algorithm:String, [aeadAlgorithm:String] }\n * @param {Boolean} [wildcard] - Use a key ID of 0 instead of the public key IDs\n * @param {Array<module:type/keyid~KeyID>} [encryptionKeyIDs] - Array of key IDs to use for encryption. Each encryptionKeyIDs[i] corresponds to keys[i]\n * @param {Date} [date] - Override the creation date of the literal package\n * @param {Array<Object>} [userIDs] - User IDs to encrypt for, e.g. [{ name:'Robert Receiver', email:'robert@openpgp.org' }]\n * @param {Object} [config] - Full configuration, defaults to openpgp.config\n * @returns {Promise<Message>} New message with encrypted content.\n * @async\n */\n async encrypt(encryptionKeys, passwords, sessionKey, wildcard = false, encryptionKeyIDs = [], date = new Date(), userIDs = [], config = defaultConfig) {\n if (sessionKey) {\n if (!util.isUint8Array(sessionKey.data) || !util.isString(sessionKey.algorithm)) {\n throw new Error('Invalid session key for encryption.');\n }\n } else if (encryptionKeys && encryptionKeys.length) {\n sessionKey = await Message.generateSessionKey(encryptionKeys, date, userIDs, config);\n } else if (passwords && passwords.length) {\n sessionKey = await Message.generateSessionKey(undefined, undefined, undefined, config);\n } else {\n throw new Error('No keys, passwords, or session key provided.');\n }\n\n const { data: sessionKeyData, algorithm, aeadAlgorithm } = sessionKey;\n\n const msg = await Message.encryptSessionKey(sessionKeyData, algorithm, aeadAlgorithm, encryptionKeys, passwords, wildcard, encryptionKeyIDs, date, userIDs, config);\n\n let symEncryptedPacket;\n if (aeadAlgorithm) {\n symEncryptedPacket = new AEADEncryptedDataPacket();\n symEncryptedPacket.aeadAlgorithm = aeadAlgorithm;\n } else {\n symEncryptedPacket = new SymEncryptedIntegrityProtectedDataPacket();\n }\n symEncryptedPacket.packets = this.packets;\n\n await symEncryptedPacket.encrypt(algorithm, sessionKeyData, config);\n\n msg.packets.push(symEncryptedPacket);\n symEncryptedPacket.packets = new PacketList(); // remove packets after encryption\n return msg;\n }\n\n /**\n * Encrypt a session key either with public keys, passwords, or both at once.\n * @param {Uint8Array} sessionKey - session key for encryption\n * @param {String} algorithm - session key algorithm\n * @param {String} [aeadAlgorithm] - AEAD algorithm, e.g. 'eax' or 'ocb'\n * @param {Array<PublicKey>} [encryptionKeys] - Public key(s) for message encryption\n * @param {Array<String>} [passwords] - For message encryption\n * @param {Boolean} [wildcard] - Use a key ID of 0 instead of the public key IDs\n * @param {Array<module:type/keyid~KeyID>} [encryptionKeyIDs] - Array of key IDs to use for encryption. Each encryptionKeyIDs[i] corresponds to encryptionKeys[i]\n * @param {Date} [date] - Override the date\n * @param {Array} [userIDs] - User IDs to encrypt for, e.g. [{ name:'Robert Receiver', email:'robert@openpgp.org' }]\n * @param {Object} [config] - Full configuration, defaults to openpgp.config\n * @returns {Promise<Message>} New message with encrypted content.\n * @async\n */\n static async encryptSessionKey(sessionKey, algorithm, aeadAlgorithm, encryptionKeys, passwords, wildcard = false, encryptionKeyIDs = [], date = new Date(), userIDs = [], config = defaultConfig) {\n const packetlist = new PacketList();\n\n if (encryptionKeys) {\n const results = await Promise.all(encryptionKeys.map(async function(primaryKey, i) {\n const encryptionKey = await primaryKey.getEncryptionKey(encryptionKeyIDs[i], date, userIDs, config);\n const pkESKeyPacket = new PublicKeyEncryptedSessionKeyPacket();\n pkESKeyPacket.publicKeyID = wildcard ? KeyID.wildcard() : encryptionKey.getKeyID();\n pkESKeyPacket.publicKeyAlgorithm = encryptionKey.keyPacket.algorithm;\n pkESKeyPacket.sessionKey = sessionKey;\n pkESKeyPacket.sessionKeyAlgorithm = algorithm;\n await pkESKeyPacket.encrypt(encryptionKey.keyPacket);\n delete pkESKeyPacket.sessionKey; // delete plaintext session key after encryption\n return pkESKeyPacket;\n }));\n packetlist.push(...results);\n }\n if (passwords) {\n const testDecrypt = async function(keyPacket, password) {\n try {\n await keyPacket.decrypt(password);\n return 1;\n } catch (e) {\n return 0;\n }\n };\n\n const sum = (accumulator, currentValue) => accumulator + currentValue;\n\n const encryptPassword = async function(sessionKey, algorithm, aeadAlgorithm, password) {\n const symEncryptedSessionKeyPacket = new SymEncryptedSessionKeyPacket(config);\n symEncryptedSessionKeyPacket.sessionKey = sessionKey;\n symEncryptedSessionKeyPacket.sessionKeyAlgorithm = algorithm;\n if (aeadAlgorithm) {\n symEncryptedSessionKeyPacket.aeadAlgorithm = aeadAlgorithm;\n }\n await symEncryptedSessionKeyPacket.encrypt(password, config);\n\n if (config.passwordCollisionCheck) {\n const results = await Promise.all(passwords.map(pwd => testDecrypt(symEncryptedSessionKeyPacket, pwd)));\n if (results.reduce(sum) !== 1) {\n return encryptPassword(sessionKey, algorithm, password);\n }\n }\n\n delete symEncryptedSessionKeyPacket.sessionKey; // delete plaintext session key after encryption\n return symEncryptedSessionKeyPacket;\n };\n\n const results = await Promise.all(passwords.map(pwd => encryptPassword(sessionKey, algorithm, aeadAlgorithm, pwd)));\n packetlist.push(...results);\n }\n\n return new Message(packetlist);\n }\n\n /**\n * Sign the message (the literal data packet of the message)\n * @param {Array<PrivateKey>} signingKeys - private keys with decrypted secret key data for signing\n * @param {Signature} [signature] - Any existing detached signature to add to the message\n * @param {Array<module:type/keyid~KeyID>} [signingKeyIDs] - Array of key IDs to use for signing. Each signingKeyIDs[i] corresponds to signingKeys[i]\n * @param {Date} [date] - Override the creation time of the signature\n * @param {Array} [userIDs] - User IDs to sign with, e.g. [{ name:'Steve Sender', email:'steve@openpgp.org' }]\n * @param {Object} [config] - Full configuration, defaults to openpgp.config\n * @returns {Promise<Message>} New message with signed content.\n * @async\n */\n async sign(signingKeys = [], signature = null, signingKeyIDs = [], date = new Date(), userIDs = [], config = defaultConfig) {\n const packetlist = new PacketList();\n\n const literalDataPacket = this.packets.findPacket(enums.packet.literalData);\n if (!literalDataPacket) {\n throw new Error('No literal data packet to sign.');\n }\n\n let i;\n let existingSigPacketlist;\n // If data packet was created from Uint8Array, use binary, otherwise use text\n const signatureType = literalDataPacket.text === null ?\n enums.signature.binary : enums.signature.text;\n\n if (signature) {\n existingSigPacketlist = signature.packets.filterByTag(enums.packet.signature);\n for (i = existingSigPacketlist.length - 1; i >= 0; i--) {\n const signaturePacket = existingSigPacketlist[i];\n const onePassSig = new OnePassSignaturePacket();\n onePassSig.signatureType = signaturePacket.signatureType;\n onePassSig.hashAlgorithm = signaturePacket.hashAlgorithm;\n onePassSig.publicKeyAlgorithm = signaturePacket.publicKeyAlgorithm;\n onePassSig.issuerKeyID = signaturePacket.issuerKeyID;\n if (!signingKeys.length && i === 0) {\n onePassSig.flags = 1;\n }\n packetlist.push(onePassSig);\n }\n }\n\n await Promise.all(Array.from(signingKeys).reverse().map(async function (primaryKey, i) {\n if (!primaryKey.isPrivate()) {\n throw new Error('Need private key for signing');\n }\n const signingKeyID = signingKeyIDs[signingKeys.length - 1 - i];\n const signingKey = await primaryKey.getSigningKey(signingKeyID, date, userIDs, config);\n const onePassSig = new OnePassSignaturePacket();\n onePassSig.signatureType = signatureType;\n onePassSig.hashAlgorithm = await getPreferredHashAlgo(primaryKey, signingKey.keyPacket, date, userIDs, config);\n onePassSig.publicKeyAlgorithm = signingKey.keyPacket.algorithm;\n onePassSig.issuerKeyID = signingKey.getKeyID();\n if (i === signingKeys.length - 1) {\n onePassSig.flags = 1;\n }\n return onePassSig;\n })).then(onePassSignatureList => {\n onePassSignatureList.forEach(onePassSig => packetlist.push(onePassSig));\n });\n\n packetlist.push(literalDataPacket);\n packetlist.push(...(await createSignaturePackets(literalDataPacket, signingKeys, signature, signingKeyIDs, date, userIDs, false, config)));\n\n return new Message(packetlist);\n }\n\n /**\n * Compresses the message (the literal and -if signed- signature data packets of the message)\n * @param {module:enums.compression} algo - compression algorithm\n * @param {Object} [config] - Full configuration, defaults to openpgp.config\n * @returns {Message} New message with compressed content.\n */\n compress(algo, config = defaultConfig) {\n if (algo === enums.compression.uncompressed) {\n return this;\n }\n\n const compressed = new CompressedDataPacket(config);\n compressed.algorithm = enums.read(enums.compression, algo);\n compressed.packets = this.packets;\n\n const packetList = new PacketList();\n packetList.push(compressed);\n\n return new Message(packetList);\n }\n\n /**\n * Create a detached signature for the message (the literal data packet of the message)\n * @param {Array<PrivateKey>} signingKeys - private keys with decrypted secret key data for signing\n * @param {Signature} [signature] - Any existing detached signature\n * @param {Array<module:type/keyid~KeyID>} [signingKeyIDs] - Array of key IDs to use for signing. Each signingKeyIDs[i] corresponds to signingKeys[i]\n * @param {Date} [date] - Override the creation time of the signature\n * @param {Array} [userIDs] - User IDs to sign with, e.g. [{ name:'Steve Sender', email:'steve@openpgp.org' }]\n * @param {Object} [config] - Full configuration, defaults to openpgp.config\n * @returns {Promise<Signature>} New detached signature of message content.\n * @async\n */\n async signDetached(signingKeys = [], signature = null, signingKeyIDs = [], date = new Date(), userIDs = [], config = defaultConfig) {\n const literalDataPacket = this.packets.findPacket(enums.packet.literalData);\n if (!literalDataPacket) {\n throw new Error('No literal data packet to sign.');\n }\n return new Signature(await createSignaturePackets(literalDataPacket, signingKeys, signature, signingKeyIDs, date, userIDs, true, config));\n }\n\n /**\n * Verify message signatures\n * @param {Array<PublicKey>} verificationKeys - Array of public keys to verify signatures\n * @param {Date} [date] - Verify the signature against the given date, i.e. check signature creation time < date < expiration time\n * @param {Object} [config] - Full configuration, defaults to openpgp.config\n * @returns {Promise<Array<{\n * keyID: module:type/keyid~KeyID,\n * signature: Promise<Signature>,\n * verified: Promise<true>\n * }>>} List of signer's keyID and validity of signatures.\n * @async\n */\n async verify(verificationKeys, date = new Date(), config = defaultConfig) {\n const msg = this.unwrapCompressed();\n const literalDataList = msg.packets.filterByTag(enums.packet.literalData);\n if (literalDataList.length !== 1) {\n throw new Error('Can only verify message with one literal data packet.');\n }\n if (stream.isArrayStream(msg.packets.stream)) {\n msg.packets.push(...await stream.readToEnd(msg.packets.stream, _ => _ || []));\n }\n const onePassSigList = msg.packets.filterByTag(enums.packet.onePassSignature).reverse();\n const signatureList = msg.packets.filterByTag(enums.packet.signature);\n if (onePassSigList.length && !signatureList.length && util.isStream(msg.packets.stream) && !stream.isArrayStream(msg.packets.stream)) {\n await Promise.all(onePassSigList.map(async onePassSig => {\n onePassSig.correspondingSig = new Promise((resolve, reject) => {\n onePassSig.correspondingSigResolve = resolve;\n onePassSig.correspondingSigReject = reject;\n });\n onePassSig.signatureData = stream.fromAsync(async () => (await onePassSig.correspondingSig).signatureData);\n onePassSig.hashed = stream.readToEnd(await onePassSig.hash(onePassSig.signatureType, literalDataList[0], undefined, false));\n onePassSig.hashed.catch(() => {});\n }));\n msg.packets.stream = stream.transformPair(msg.packets.stream, async (readable, writable) => {\n const reader = stream.getReader(readable);\n const writer = stream.getWriter(writable);\n try {\n for (let i = 0; i < onePassSigList.length; i++) {\n const { value: signature } = await reader.read();\n onePassSigList[i].correspondingSigResolve(signature);\n }\n await reader.readToEnd();\n await writer.ready;\n await writer.close();\n } catch (e) {\n onePassSigList.forEach(onePassSig => {\n onePassSig.correspondingSigReject(e);\n });\n await writer.abort(e);\n }\n });\n return createVerificationObjects(onePassSigList, literalDataList, verificationKeys, date, false, config);\n }\n return createVerificationObjects(signatureList, literalDataList, verificationKeys, date, false, config);\n }\n\n /**\n * Verify detached message signature\n * @param {Array<PublicKey>} verificationKeys - Array of public keys to verify signatures\n * @param {Signature} signature\n * @param {Date} date - Verify the signature against the given date, i.e. check signature creation time < date < expiration time\n * @param {Object} [config] - Full configuration, defaults to openpgp.config\n * @returns {Promise<Array<{\n * keyID: module:type/keyid~KeyID,\n * signature: Promise<Signature>,\n * verified: Promise<true>\n * }>>} List of signer's keyID and validity of signature.\n * @async\n */\n verifyDetached(signature, verificationKeys, date = new Date(), config = defaultConfig) {\n const msg = this.unwrapCompressed();\n const literalDataList = msg.packets.filterByTag(enums.packet.literalData);\n if (literalDataList.length !== 1) {\n throw new Error('Can only verify message with one literal data packet.');\n }\n const signatureList = signature.packets;\n return createVerificationObjects(signatureList, literalDataList, verificationKeys, date, true, config);\n }\n\n /**\n * Unwrap compressed message\n * @returns {Message} Message Content of compressed message.\n */\n unwrapCompressed() {\n const compressed = this.packets.filterByTag(enums.packet.compressedData);\n if (compressed.length) {\n return new Message(compressed[0].packets);\n }\n return this;\n }\n\n /**\n * Append signature to unencrypted message object\n * @param {String|Uint8Array} detachedSignature - The detached ASCII-armored or Uint8Array PGP signature\n * @param {Object} [config] - Full configuration, defaults to openpgp.config\n */\n async appendSignature(detachedSignature, config = defaultConfig) {\n await this.packets.read(\n util.isUint8Array(detachedSignature) ? detachedSignature : (await unarmor(detachedSignature)).data,\n allowedDetachedSignaturePackets,\n config\n );\n }\n\n /**\n * Returns binary encoded message\n * @returns {ReadableStream<Uint8Array>} Binary message.\n */\n write() {\n return this.packets.write();\n }\n\n /**\n * Returns ASCII armored text of message\n * @param {Object} [config] - Full configuration, defaults to openpgp.config\n * @returns {ReadableStream<String>} ASCII armor.\n */\n armor(config = defaultConfig) {\n return armor(enums.armor.message, this.write(), null, null, null, config);\n }\n}\n\n/**\n * Create signature packets for the message\n * @param {LiteralDataPacket} literalDataPacket - the literal data packet to sign\n * @param {Array<PrivateKey>} [signingKeys] - private keys with decrypted secret key data for signing\n * @param {Signature} [signature] - Any existing detached signature to append\n * @param {Array<module:type/keyid~KeyID>} [signingKeyIDs] - Array of key IDs to use for signing. Each signingKeyIDs[i] corresponds to signingKeys[i]\n * @param {Date} [date] - Override the creationtime of the signature\n * @param {Array} [userIDs] - User IDs to sign with, e.g. [{ name:'Steve Sender', email:'steve@openpgp.org' }]\n * @param {Boolean} [detached] - Whether to create detached signature packets\n * @param {Object} [config] - Full configuration, defaults to openpgp.config\n * @returns {Promise<PacketList>} List of signature packets.\n * @async\n * @private\n */\nexport async function createSignaturePackets(literalDataPacket, signingKeys, signature = null, signingKeyIDs = [], date = new Date(), userIDs = [], detached = false, config = defaultConfig) {\n const packetlist = new PacketList();\n\n // If data packet was created from Uint8Array, use binary, otherwise use text\n const signatureType = literalDataPacket.text === null ?\n enums.signature.binary : enums.signature.text;\n\n await Promise.all(signingKeys.map(async (primaryKey, i) => {\n const userID = userIDs[i];\n if (!primaryKey.isPrivate()) {\n throw new Error('Need private key for signing');\n }\n const signingKey = await primaryKey.getSigningKey(signingKeyIDs[i], date, userID, config);\n return createSignaturePacket(literalDataPacket, primaryKey, signingKey.keyPacket, { signatureType }, date, userID, detached, config);\n })).then(signatureList => {\n packetlist.push(...signatureList);\n });\n\n if (signature) {\n const existingSigPacketlist = signature.packets.filterByTag(enums.packet.signature);\n packetlist.push(...existingSigPacketlist);\n }\n return packetlist;\n}\n\n/**\n * Create object containing signer's keyID and validity of signature\n * @param {SignaturePacket} signature - Signature packet\n * @param {Array<LiteralDataPacket>} literalDataList - Array of literal data packets\n * @param {Array<PublicKey>} verificationKeys - Array of public keys to verify signatures\n * @param {Date} [date] - Check signature validity with respect to the given date\n * @param {Boolean} [detached] - Whether to verify detached signature packets\n * @param {Object} [config] - Full configuration, defaults to openpgp.config\n * @returns {Promise<{\n * keyID: module:type/keyid~KeyID,\n * signature: Promise<Signature>,\n * verified: Promise<true>\n * }>} signer's keyID and validity of signature\n * @async\n * @private\n */\nasync function createVerificationObject(signature, literalDataList, verificationKeys, date = new Date(), detached = false, config = defaultConfig) {\n let primaryKey;\n let unverifiedSigningKey;\n\n for (const key of verificationKeys) {\n const issuerKeys = key.getKeys(signature.issuerKeyID);\n if (issuerKeys.length > 0) {\n primaryKey = key;\n unverifiedSigningKey = issuerKeys[0];\n break;\n }\n }\n\n const isOnePassSignature = signature instanceof OnePassSignaturePacket;\n const signaturePacketPromise = isOnePassSignature ? signature.correspondingSig : signature;\n\n const verifiedSig = {\n keyID: signature.issuerKeyID,\n verified: (async () => {\n if (!unverifiedSigningKey) {\n throw new Error(`Could not find signing key with key ID ${signature.issuerKeyID.toHex()}`);\n }\n\n await signature.verify(unverifiedSigningKey.keyPacket, signature.signatureType, literalDataList[0], date, detached, config);\n const signaturePacket = await signaturePacketPromise;\n if (unverifiedSigningKey.getCreationTime() > signaturePacket.created) {\n throw new Error('Key is newer than the signature');\n }\n // We pass the signature creation time to check whether the key was expired at the time of signing.\n // We check this after signature verification because for streamed one-pass signatures, the creation time is not available before\n await primaryKey.getSigningKey(unverifiedSigningKey.getKeyID(), signaturePacket.created, undefined, config);\n return true;\n })(),\n signature: (async () => {\n const signaturePacket = await signaturePacketPromise;\n const packetlist = new PacketList();\n signaturePacket && packetlist.push(signaturePacket);\n return new Signature(packetlist);\n })()\n };\n\n // Mark potential promise rejections as \"handled\". This is needed because in\n // some cases, we reject them before the user has a reasonable chance to\n // handle them (e.g. `await readToEnd(result.data); await result.verified` and\n // the data stream errors).\n verifiedSig.signature.catch(() => {});\n verifiedSig.verified.catch(() => {});\n\n return verifiedSig;\n}\n\n/**\n * Create list of objects containing signer's keyID and validity of signature\n * @param {Array<SignaturePacket>} signatureList - Array of signature packets\n * @param {Array<LiteralDataPacket>} literalDataList - Array of literal data packets\n * @param {Array<PublicKey>} verificationKeys - Array of public keys to verify signatures\n * @param {Date} date - Verify the signature against the given date,\n * i.e. check signature creation time < date < expiration time\n * @param {Boolean} [detached] - Whether to verify detached signature packets\n * @param {Object} [config] - Full configuration, defaults to openpgp.config\n * @returns {Promise<Array<{\n * keyID: module:type/keyid~KeyID,\n * signature: Promise<Signature>,\n * verified: Promise<true>\n * }>>} list of signer's keyID and validity of signatures (one entry per signature packet in input)\n * @async\n * @private\n */\nexport async function createVerificationObjects(signatureList, literalDataList, verificationKeys, date = new Date(), detached = false, config = defaultConfig) {\n return Promise.all(signatureList.filter(function(signature) {\n return ['text', 'binary'].includes(enums.read(enums.signature, signature.signatureType));\n }).map(async function(signature) {\n return createVerificationObject(signature, literalDataList, verificationKeys, date, detached, config);\n }));\n}\n\n/**\n * Reads an (optionally armored) OpenPGP message and returns a Message object\n * @param {Object} options\n * @param {String | ReadableStream<String>} [options.armoredMessage] - Armored message to be parsed\n * @param {Uint8Array | ReadableStream<Uint8Array>} [options.binaryMessage] - Binary to be parsed\n * @param {Object} [options.config] - Custom configuration settings to overwrite those in [config]{@link module:config}\n * @returns {Promise<Message>} New message object.\n * @async\n * @static\n */\nexport async function readMessage({ armoredMessage, binaryMessage, config, ...rest }) {\n config = { ...defaultConfig, ...config };\n let input = armoredMessage || binaryMessage;\n if (!input) {\n throw new Error('readMessage: must pass options object containing `armoredMessage` or `binaryMessage`');\n }\n if (armoredMessage && !util.isString(armoredMessage) && !util.isStream(armoredMessage)) {\n throw new Error('readMessage: options.armoredMessage must be a string or stream');\n }\n if (binaryMessage && !util.isUint8Array(binaryMessage) && !util.isStream(binaryMessage)) {\n throw new Error('readMessage: options.binaryMessage must be a Uint8Array or stream');\n }\n const unknownOptions = Object.keys(rest); if (unknownOptions.length > 0) throw new Error(`Unknown option: ${unknownOptions.join(', ')}`);\n\n const streamType = util.isStream(input);\n if (streamType) {\n await stream.loadStreamsPonyfill();\n input = stream.toStream(input);\n }\n if (armoredMessage) {\n const { type, data } = await unarmor(input, config);\n if (type !== enums.armor.message) {\n throw new Error('Armored text not of type message');\n }\n input = data;\n }\n const packetlist = await PacketList.fromBinary(input, allowedMessagePackets, config);\n const message = new Message(packetlist);\n message.fromStream = streamType;\n return message;\n}\n\n/**\n * Creates new message object from text or binary data.\n * @param {Object} options\n * @param {String | ReadableStream<String>} [options.text] - The text message contents\n * @param {Uint8Array | ReadableStream<Uint8Array>} [options.binary] - The binary message contents\n * @param {String} [options.filename=\"\"] - Name of the file (if any)\n * @param {Date} [options.date=current date] - Date of the message, or modification date of the file\n * @param {'utf8'|'binary'|'text'|'mime'} [options.format='utf8' if text is passed, 'binary' otherwise] - Data packet type\n * @returns {Promise<Message>} New message object.\n * @async\n * @static\n */\nexport async function createMessage({ text, binary, filename, date = new Date(), format = text !== undefined ? 'utf8' : 'binary', ...rest }) {\n let input = text !== undefined ? text : binary;\n if (input === undefined) {\n throw new Error('createMessage: must pass options object containing `text` or `binary`');\n }\n if (text && !util.isString(text) && !util.isStream(text)) {\n throw new Error('createMessage: options.text must be a string or stream');\n }\n if (binary && !util.isUint8Array(binary) && !util.isStream(binary)) {\n throw new Error('createMessage: options.binary must be a Uint8Array or stream');\n }\n const unknownOptions = Object.keys(rest); if (unknownOptions.length > 0) throw new Error(`Unknown option: ${unknownOptions.join(', ')}`);\n\n const streamType = util.isStream(input);\n if (streamType) {\n await stream.loadStreamsPonyfill();\n input = stream.toStream(input);\n }\n const literalDataPacket = new LiteralDataPacket(date);\n if (text !== undefined) {\n literalDataPacket.setText(input, format);\n } else {\n literalDataPacket.setBytes(input, format);\n }\n if (filename !== undefined) {\n literalDataPacket.setFilename(filename);\n }\n const literalDataPacketlist = new PacketList();\n literalDataPacketlist.push(literalDataPacket);\n const message = new Message(literalDataPacketlist);\n message.fromStream = streamType;\n return message;\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 { armor, unarmor } from './encoding/armor';\nimport enums from './enums';\nimport util from './util';\nimport { PacketList, LiteralDataPacket, SignaturePacket } from './packet';\nimport { Signature } from './signature';\nimport { createVerificationObjects, createSignaturePackets } from './message';\nimport defaultConfig from './config';\n\n// A Cleartext message can contain the following packets\nconst allowedPackets = /*#__PURE__*/ util.constructAllowedPackets([SignaturePacket]);\n\n/**\n * Class that represents an OpenPGP cleartext signed message.\n * See {@link https://tools.ietf.org/html/rfc4880#section-7}\n */\nexport class CleartextMessage {\n /**\n * @param {String} text - The cleartext of the signed message\n * @param {Signature} signature - The detached signature or an empty signature for unsigned messages\n */\n constructor(text, signature) {\n // normalize EOL to canonical form <CR><LF>\n this.text = util.removeTrailingSpaces(text).replace(/\\r?\\n/g, '\\r\\n');\n if (signature && !(signature instanceof Signature)) {\n throw new Error('Invalid signature input');\n }\n this.signature = signature || new Signature(new PacketList());\n }\n\n /**\n * Returns the key IDs of the keys that signed the cleartext message\n * @returns {Array<module:type/keyid~KeyID>} Array of keyID objects.\n */\n getSigningKeyIDs() {\n const keyIDs = [];\n const signatureList = this.signature.packets;\n signatureList.forEach(function(packet) {\n keyIDs.push(packet.issuerKeyID);\n });\n return keyIDs;\n }\n\n /**\n * Sign the cleartext message\n * @param {Array<Key>} privateKeys - private keys with decrypted secret key data for signing\n * @param {Signature} [signature] - Any existing detached signature\n * @param {Array<module:type/keyid~KeyID>} [signingKeyIDs] - Array of key IDs to use for signing. Each signingKeyIDs[i] corresponds to privateKeys[i]\n * @param {Date} [date] - The creation time of the signature that should be created\n * @param {Array} [userIDs] - User IDs to sign with, e.g. [{ name:'Steve Sender', email:'steve@openpgp.org' }]\n * @param {Object} [config] - Full configuration, defaults to openpgp.config\n * @returns {Promise<CleartextMessage>} New cleartext message with signed content.\n * @async\n */\n async sign(privateKeys, signature = null, signingKeyIDs = [], date = new Date(), userIDs = [], config = defaultConfig) {\n const literalDataPacket = new LiteralDataPacket();\n literalDataPacket.setText(this.text);\n const newSignature = new Signature(await createSignaturePackets(literalDataPacket, privateKeys, signature, signingKeyIDs, date, userIDs, true, config));\n return new CleartextMessage(this.text, newSignature);\n }\n\n /**\n * Verify signatures of cleartext signed message\n * @param {Array<Key>} keys - Array of keys to verify signatures\n * @param {Date} [date] - Verify the signature against the given date, i.e. check signature creation time < date < expiration time\n * @param {Object} [config] - Full configuration, defaults to openpgp.config\n * @returns {Promise<Array<{\n * keyID: module:type/keyid~KeyID,\n * signature: Promise<Signature>,\n * verified: Promise<true>\n * }>>} List of signer's keyID and validity of signature.\n * @async\n */\n verify(keys, date = new Date(), config = defaultConfig) {\n const signatureList = this.signature.packets;\n const literalDataPacket = new LiteralDataPacket();\n // we assume that cleartext signature is generated based on UTF8 cleartext\n literalDataPacket.setText(this.text);\n return createVerificationObjects(signatureList, [literalDataPacket], keys, date, true, config);\n }\n\n /**\n * Get cleartext\n * @returns {String} Cleartext of message.\n */\n getText() {\n // normalize end of line to \\n\n return this.text.replace(/\\r\\n/g, '\\n');\n }\n\n /**\n * Returns ASCII armored text of cleartext signed message\n * @param {Object} [config] - Full configuration, defaults to openpgp.config\n * @returns {String | ReadableStream<String>} ASCII armor.\n */\n armor(config = defaultConfig) {\n let hashes = this.signature.packets.map(function(packet) {\n return enums.read(enums.hash, packet.hashAlgorithm).toUpperCase();\n });\n hashes = hashes.filter(function(item, i, ar) { return ar.indexOf(item) === i; });\n const body = {\n hash: hashes.join(),\n text: this.text,\n data: this.signature.packets.write()\n };\n return armor(enums.armor.signed, body, undefined, undefined, undefined, config);\n }\n}\n\n/**\n * Reads an OpenPGP cleartext signed message and returns a CleartextMessage object\n * @param {Object} options\n * @param {String} options.cleartextMessage - Text to be parsed\n * @param {Object} [options.config] - Custom configuration settings to overwrite those in [config]{@link module:config}\n * @returns {Promise<CleartextMessage>} New cleartext message object.\n * @async\n * @static\n */\nexport async function readCleartextMessage({ cleartextMessage, config, ...rest }) {\n config = { ...defaultConfig, ...config };\n if (!cleartextMessage) {\n throw new Error('readCleartextMessage: must pass options object containing `cleartextMessage`');\n }\n if (!util.isString(cleartextMessage)) {\n throw new Error('readCleartextMessage: options.cleartextMessage must be a string');\n }\n const unknownOptions = Object.keys(rest); if (unknownOptions.length > 0) throw new Error(`Unknown option: ${unknownOptions.join(', ')}`);\n\n const input = await unarmor(cleartextMessage);\n if (input.type !== enums.armor.signed) {\n throw new Error('No cleartext signed message.');\n }\n const packetlist = await PacketList.fromBinary(input.data, allowedPackets, config);\n verifyHeaders(input.headers, packetlist);\n const signature = new Signature(packetlist);\n return new CleartextMessage(input.text, signature);\n}\n\n/**\n * Compare hash algorithm specified in the armor header with signatures\n * @param {Array<String>} headers - Armor headers\n * @param {PacketList} packetlist - The packetlist with signature packets\n * @private\n */\nfunction verifyHeaders(headers, packetlist) {\n const checkHashAlgos = function(hashAlgos) {\n const check = packet => algo => packet.hashAlgorithm === algo;\n\n for (let i = 0; i < packetlist.length; i++) {\n if (packetlist[i].constructor.tag === enums.packet.signature && !hashAlgos.some(check(packetlist[i]))) {\n return false;\n }\n }\n return true;\n };\n\n let oneHeader = null;\n let hashAlgos = [];\n headers.forEach(function(header) {\n oneHeader = header.match(/Hash: (.+)/); // get header value\n if (oneHeader) {\n oneHeader = oneHeader[1].replace(/\\s/g, ''); // remove whitespace\n oneHeader = oneHeader.split(',');\n oneHeader = oneHeader.map(function(hash) {\n hash = hash.toLowerCase();\n try {\n return enums.write(enums.hash, hash);\n } catch (e) {\n throw new Error('Unknown hash algorithm in armor header: ' + hash);\n }\n });\n hashAlgos = hashAlgos.concat(oneHeader);\n } else {\n throw new Error('Only \"Hash\" header allowed in cleartext signed message');\n }\n });\n\n if (!hashAlgos.length && !checkHashAlgos([enums.hash.md5])) {\n throw new Error('If no \"Hash\" header in cleartext signed message, then only MD5 signatures allowed');\n } else if (hashAlgos.length && !checkHashAlgos(hashAlgos)) {\n throw new Error('Hash algorithm mismatch in armor header and signature');\n }\n}\n\n/**\n * Creates a new CleartextMessage object from text\n * @param {Object} options\n * @param {String} options.text\n * @static\n * @async\n */\nexport async function createCleartextMessage({ text, ...rest }) {\n if (!text) {\n throw new Error('createCleartextMessage: must pass options object containing `text`');\n }\n if (!util.isString(text)) {\n throw new Error('createCleartextMessage: options.text must be a string');\n }\n const unknownOptions = Object.keys(rest); if (unknownOptions.length > 0) throw new Error(`Unknown option: ${unknownOptions.join(', ')}`);\n\n return new CleartextMessage(text);\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\nimport * as stream from '@openpgp/web-stream-tools';\nimport { Message } from './message';\nimport { CleartextMessage } from './cleartext';\nimport { generate, reformat, getPreferredAlgo } from './key';\nimport defaultConfig from './config';\nimport util from './util';\nimport { checkKeyRequirements } from './key/helper';\n\n\n//////////////////////\n// //\n// Key handling //\n// //\n//////////////////////\n\n\n/**\n * Generates a new OpenPGP key pair. Supports RSA and ECC keys. By default, primary and subkeys will be of same type.\n * The generated primary key will have signing capabilities. By default, one subkey with encryption capabilities is also generated.\n * @param {Object} options\n * @param {Object|Array<Object>} options.userIDs - User IDs as objects: `{ name: 'Jo Doe', email: 'info@jo.com' }`\n * @param {'ecc'|'rsa'} [options.type='ecc'] - The primary key algorithm type: ECC (default) or RSA\n * @param {String} [options.passphrase=(not protected)] - The passphrase used to encrypt the generated private key. If omitted, the key won't be encrypted.\n * @param {Number} [options.rsaBits=4096] - Number of bits for RSA keys\n * @param {String} [options.curve='curve25519'] - Elliptic curve for ECC keys:\n * curve25519 (default), p256, p384, p521, secp256k1,\n * brainpoolP256r1, brainpoolP384r1, or brainpoolP512r1\n * @param {Date} [options.date=current date] - Override the creation date of the key and the key signatures\n * @param {Number} [options.keyExpirationTime=0 (never expires)] - Number of seconds from the key creation time after which the key expires\n * @param {Array<Object>} [options.subkeys=a single encryption subkey] - Options for each subkey e.g. `[{sign: true, passphrase: '123'}]`\n * default to main key options, except for `sign` parameter that defaults to false, and indicates whether the subkey should sign rather than encrypt\n * @param {'armored'|'binary'|'object'} [options.format='armored'] - format of the output keys\n * @param {Object} [options.config] - Custom configuration settings to overwrite those in [config]{@link module:config}\n * @returns {Promise<Object>} The generated key object in the form:\n * { privateKey:PrivateKey|Uint8Array|String, publicKey:PublicKey|Uint8Array|String, revocationCertificate:String }\n * @async\n * @static\n */\nexport async function generateKey({ userIDs = [], passphrase = '', type = 'ecc', rsaBits = 4096, curve = 'curve25519', keyExpirationTime = 0, date = new Date(), subkeys = [{}], format = 'armored', config, ...rest }) {\n config = { ...defaultConfig, ...config }; checkConfig(config);\n userIDs = toArray(userIDs);\n const unknownOptions = Object.keys(rest); if (unknownOptions.length > 0) throw new Error(`Unknown option: ${unknownOptions.join(', ')}`);\n\n if (userIDs.length === 0) {\n throw new Error('UserIDs are required for key generation');\n }\n if (type === 'rsa' && rsaBits < config.minRSABits) {\n throw new Error(`rsaBits should be at least ${config.minRSABits}, got: ${rsaBits}`);\n }\n\n const options = { userIDs, passphrase, type, rsaBits, curve, keyExpirationTime, date, subkeys };\n\n try {\n const { key, revocationCertificate } = await generate(options, config);\n key.getKeys().forEach(({ keyPacket }) => checkKeyRequirements(keyPacket, config));\n\n return {\n privateKey: formatObject(key, format, config),\n publicKey: formatObject(key.toPublic(), format, config),\n revocationCertificate\n };\n } catch (err) {\n throw util.wrapError('Error generating keypair', err);\n }\n}\n\n/**\n * Reformats signature packets for a key and rewraps key object.\n * @param {Object} options\n * @param {PrivateKey} options.privateKey - Private key to reformat\n * @param {Object|Array<Object>} options.userIDs - User IDs as objects: `{ name: 'Jo Doe', email: 'info@jo.com' }`\n * @param {String} [options.passphrase=(not protected)] - The passphrase used to encrypt the reformatted private key. If omitted, the key won't be encrypted.\n * @param {Number} [options.keyExpirationTime=0 (never expires)] - Number of seconds from the key creation time after which the key expires\n * @param {Date} [options.date] - Override the creation date of the key signatures\n * @param {'armored'|'binary'|'object'} [options.format='armored'] - format of the output keys\n * @param {Object} [options.config] - Custom configuration settings to overwrite those in [config]{@link module:config}\n * @returns {Promise<Object>} The generated key object in the form:\n * { privateKey:PrivateKey|Uint8Array|String, publicKey:PublicKey|Uint8Array|String, revocationCertificate:String }\n * @async\n * @static\n */\nexport async function reformatKey({ privateKey, userIDs = [], passphrase = '', keyExpirationTime = 0, date, format = 'armored', config, ...rest }) {\n config = { ...defaultConfig, ...config }; checkConfig(config);\n userIDs = toArray(userIDs);\n const unknownOptions = Object.keys(rest); if (unknownOptions.length > 0) throw new Error(`Unknown option: ${unknownOptions.join(', ')}`);\n\n if (userIDs.length === 0) {\n throw new Error('UserIDs are required for key reformat');\n }\n const options = { privateKey, userIDs, passphrase, keyExpirationTime, date };\n\n try {\n const { key: reformattedKey, revocationCertificate } = await reformat(options, config);\n\n return {\n privateKey: formatObject(reformattedKey, format, config),\n publicKey: formatObject(reformattedKey.toPublic(), format, config),\n revocationCertificate\n };\n } catch (err) {\n throw util.wrapError('Error reformatting keypair', err);\n }\n}\n\n/**\n * Revokes a key. Requires either a private key or a revocation certificate.\n * If a revocation certificate is passed, the reasonForRevocation parameter will be ignored.\n * @param {Object} options\n * @param {Key} options.key - Public or private key to revoke\n * @param {String} [options.revocationCertificate] - Revocation certificate to revoke the key with\n * @param {Object} [options.reasonForRevocation] - Object indicating the reason for revocation\n * @param {module:enums.reasonForRevocation} [options.reasonForRevocation.flag=[noReason]{@link module:enums.reasonForRevocation}] - Flag indicating the reason for revocation\n * @param {String} [options.reasonForRevocation.string=\"\"] - String explaining the reason for revocation\n * @param {Date} [options.date] - Use the given date instead of the current time to verify validity of revocation certificate (if provided), or as creation time of the revocation signature\n * @param {'armored'|'binary'|'object'} [options.format='armored'] - format of the output key(s)\n * @param {Object} [options.config] - Custom configuration settings to overwrite those in [config]{@link module:config}\n * @returns {Promise<Object>} The revoked key in the form:\n * { privateKey:PrivateKey|Uint8Array|String, publicKey:PublicKey|Uint8Array|String } if private key is passed, or\n * { privateKey: null, publicKey:PublicKey|Uint8Array|String } otherwise\n * @async\n * @static\n */\nexport async function revokeKey({ key, revocationCertificate, reasonForRevocation, date = new Date(), format = 'armored', config, ...rest }) {\n config = { ...defaultConfig, ...config }; checkConfig(config);\n const unknownOptions = Object.keys(rest); if (unknownOptions.length > 0) throw new Error(`Unknown option: ${unknownOptions.join(', ')}`);\n\n try {\n const revokedKey = revocationCertificate ?\n await key.applyRevocationCertificate(revocationCertificate, date, config) :\n await key.revoke(reasonForRevocation, date, config);\n\n return revokedKey.isPrivate() ? {\n privateKey: formatObject(revokedKey, format, config),\n publicKey: formatObject(revokedKey.toPublic(), format, config)\n } : {\n privateKey: null,\n publicKey: formatObject(revokedKey, format, config)\n };\n } catch (err) {\n throw util.wrapError('Error revoking key', err);\n }\n}\n\n/**\n * Unlock a private key with the given passphrase.\n * This method does not change the original key.\n * @param {Object} options\n * @param {PrivateKey} options.privateKey - The private key to decrypt\n * @param {String|Array<String>} options.passphrase - The user's passphrase(s)\n * @param {Object} [options.config] - Custom configuration settings to overwrite those in [config]{@link module:config}\n * @returns {Promise<PrivateKey>} The unlocked key object.\n * @async\n */\nexport async function decryptKey({ privateKey, passphrase, config, ...rest }) {\n config = { ...defaultConfig, ...config }; checkConfig(config);\n const unknownOptions = Object.keys(rest); if (unknownOptions.length > 0) throw new Error(`Unknown option: ${unknownOptions.join(', ')}`);\n\n if (!privateKey.isPrivate()) {\n throw new Error('Cannot decrypt a public key');\n }\n const clonedPrivateKey = privateKey.clone(true);\n const passphrases = util.isArray(passphrase) ? passphrase : [passphrase];\n\n try {\n await Promise.all(clonedPrivateKey.getKeys().map(key => (\n // try to decrypt each key with any of the given passphrases\n util.anyPromise(passphrases.map(passphrase => key.keyPacket.decrypt(passphrase)))\n )));\n\n await clonedPrivateKey.validate(config);\n return clonedPrivateKey;\n } catch (err) {\n clonedPrivateKey.clearPrivateParams();\n throw util.wrapError('Error decrypting private key', err);\n }\n}\n\n/**\n * Lock a private key with the given passphrase.\n * This method does not change the original key.\n * @param {Object} options\n * @param {PrivateKey} options.privateKey - The private key to encrypt\n * @param {String|Array<String>} options.passphrase - If multiple passphrases, they should be in the same order as the packets each should encrypt\n * @param {Object} [options.config] - Custom configuration settings to overwrite those in [config]{@link module:config}\n * @returns {Promise<PrivateKey>} The locked key object.\n * @async\n */\nexport async function encryptKey({ privateKey, passphrase, config, ...rest }) {\n config = { ...defaultConfig, ...config }; checkConfig(config);\n const unknownOptions = Object.keys(rest); if (unknownOptions.length > 0) throw new Error(`Unknown option: ${unknownOptions.join(', ')}`);\n\n if (!privateKey.isPrivate()) {\n throw new Error('Cannot encrypt a public key');\n }\n const clonedPrivateKey = privateKey.clone(true);\n\n const keys = clonedPrivateKey.getKeys();\n const passphrases = util.isArray(passphrase) ? passphrase : new Array(keys.length).fill(passphrase);\n if (passphrases.length !== keys.length) {\n throw new Error('Invalid number of passphrases given for key encryption');\n }\n\n try {\n await Promise.all(keys.map(async (key, i) => {\n const { keyPacket } = key;\n await keyPacket.encrypt(passphrases[i], config);\n keyPacket.clearPrivateParams();\n }));\n return clonedPrivateKey;\n } catch (err) {\n clonedPrivateKey.clearPrivateParams();\n throw util.wrapError('Error encrypting private key', err);\n }\n}\n\n\n///////////////////////////////////////////\n// //\n// Message encryption and decryption //\n// //\n///////////////////////////////////////////\n\n\n/**\n * Encrypts a message using public keys, passwords or both at once. At least one of `encryptionKeys` or `passwords`\n * must be specified. If signing keys are specified, those will be used to sign the message.\n * @param {Object} options\n * @param {Message} options.message - Message to be encrypted as created by {@link createMessage}\n * @param {PublicKey|PublicKey[]} [options.encryptionKeys] - Array of keys or single key, used to encrypt the message\n * @param {PrivateKey|PrivateKey[]} [options.signingKeys] - Private keys for signing. If omitted message will not be signed\n * @param {String|String[]} [options.passwords] - Array of passwords or a single password to encrypt the message\n * @param {Object} [options.sessionKey] - Session key in the form: `{ data:Uint8Array, algorithm:String }`\n * @param {'armored'|'binary'|'object'} [options.format='armored'] - Format of the returned message\n * @param {Signature} [options.signature] - A detached signature to add to the encrypted message\n * @param {Boolean} [options.wildcard=false] - Use a key ID of 0 instead of the public key IDs\n * @param {KeyID|KeyID[]} [options.signingKeyIDs=latest-created valid signing (sub)keys] - Array of key IDs to use for signing. Each `signingKeyIDs[i]` corresponds to `signingKeys[i]`\n * @param {KeyID|KeyID[]} [options.encryptionKeyIDs=latest-created valid encryption (sub)keys] - Array of key IDs to use for encryption. Each `encryptionKeyIDs[i]` corresponds to `encryptionKeys[i]`\n * @param {Date} [options.date=current date] - Override the creation date of the message signature\n * @param {Object|Object[]} [options.signingUserIDs=primary user IDs] - Array of user IDs to sign with, one per key in `signingKeys`, e.g. `[{ name: 'Steve Sender', email: 'steve@openpgp.org' }]`\n * @param {Object|Object[]} [options.encryptionUserIDs=primary user IDs] - Array of user IDs to encrypt for, one per key in `encryptionKeys`, e.g. `[{ name: 'Robert Receiver', email: 'robert@openpgp.org' }]`\n * @param {Object} [options.config] - Custom configuration settings to overwrite those in [config]{@link module:config}\n * @returns {Promise<MaybeStream<String>|MaybeStream<Uint8Array>>} Encrypted message (string if `armor` was true, the default; Uint8Array if `armor` was false).\n * @async\n * @static\n */\nexport async function encrypt({ message, encryptionKeys, signingKeys, passwords, sessionKey, format = 'armored', signature = null, wildcard = false, signingKeyIDs = [], encryptionKeyIDs = [], date = new Date(), signingUserIDs = [], encryptionUserIDs = [], config, ...rest }) {\n config = { ...defaultConfig, ...config }; checkConfig(config);\n checkMessage(message); checkOutputMessageFormat(format);\n encryptionKeys = toArray(encryptionKeys); signingKeys = toArray(signingKeys); passwords = toArray(passwords);\n signingKeyIDs = toArray(signingKeyIDs); encryptionKeyIDs = toArray(encryptionKeyIDs); signingUserIDs = toArray(signingUserIDs); encryptionUserIDs = toArray(encryptionUserIDs);\n if (rest.detached) {\n throw new Error(\"The `detached` option has been removed from openpgp.encrypt, separately call openpgp.sign instead. Don't forget to remove the `privateKeys` option as well.\");\n }\n if (rest.publicKeys) throw new Error('The `publicKeys` option has been removed from openpgp.encrypt, pass `encryptionKeys` instead');\n if (rest.privateKeys) throw new Error('The `privateKeys` option has been removed from openpgp.encrypt, pass `signingKeys` instead');\n if (rest.armor !== undefined) throw new Error('The `armor` option has been removed from openpgp.encrypt, pass `format` instead.');\n const unknownOptions = Object.keys(rest); if (unknownOptions.length > 0) throw new Error(`Unknown option: ${unknownOptions.join(', ')}`);\n\n if (!signingKeys) {\n signingKeys = [];\n }\n const streaming = message.fromStream;\n try {\n if (signingKeys.length || signature) { // sign the message only if signing keys or signature is specified\n message = await message.sign(signingKeys, signature, signingKeyIDs, date, signingUserIDs, config);\n }\n message = message.compress(\n await getPreferredAlgo('compression', encryptionKeys, date, encryptionUserIDs, config),\n config\n );\n message = await message.encrypt(encryptionKeys, passwords, sessionKey, wildcard, encryptionKeyIDs, date, encryptionUserIDs, config);\n if (format === 'object') return message;\n // serialize data\n const armor = format === 'armored';\n const data = armor ? message.armor(config) : message.write();\n return convertStream(data, streaming, armor ? 'utf8' : 'binary');\n } catch (err) {\n throw util.wrapError('Error encrypting message', err);\n }\n}\n\n/**\n * Decrypts a message with the user's private key, a session key or a password.\n * One of `decryptionKeys`, `sessionkeys` or `passwords` must be specified (passing a combination of these options is not supported).\n * @param {Object} options\n * @param {Message} options.message - The message object with the encrypted data\n * @param {PrivateKey|PrivateKey[]} [options.decryptionKeys] - Private keys with decrypted secret key data or session key\n * @param {String|String[]} [options.passwords] - Passwords to decrypt the message\n * @param {Object|Object[]} [options.sessionKeys] - Session keys in the form: { data:Uint8Array, algorithm:String }\n * @param {PublicKey|PublicKey[]} [options.verificationKeys] - Array of public keys or single key, to verify signatures\n * @param {Boolean} [options.expectSigned=false] - If true, data decryption fails if the message is not signed with the provided publicKeys\n * @param {'utf8'|'binary'} [options.format='utf8'] - Whether to return data as a string(Stream) or Uint8Array(Stream). If 'utf8' (the default), also normalize newlines.\n * @param {Signature} [options.signature] - Detached signature for verification\n * @param {Date} [options.date=current date] - Use the given date for verification instead of the current time\n * @param {Object} [options.config] - Custom configuration settings to overwrite those in [config]{@link module:config}\n * @returns {Promise<Object>} Object containing decrypted and verified message in the form:\n *\n * {\n * data: MaybeStream<String>, (if format was 'utf8', the default)\n * data: MaybeStream<Uint8Array>, (if format was 'binary')\n * filename: String,\n * signatures: [\n * {\n * keyID: module:type/keyid~KeyID,\n * verified: Promise<true>,\n * signature: Promise<Signature>\n * }, ...\n * ]\n * }\n *\n * where `signatures` contains a separate entry for each signature packet found in the input message.\n * @async\n * @static\n */\nexport async function decrypt({ message, decryptionKeys, passwords, sessionKeys, verificationKeys, expectSigned = false, format = 'utf8', signature = null, date = new Date(), config, ...rest }) {\n config = { ...defaultConfig, ...config }; checkConfig(config);\n checkMessage(message); verificationKeys = toArray(verificationKeys); decryptionKeys = toArray(decryptionKeys); passwords = toArray(passwords); sessionKeys = toArray(sessionKeys);\n if (rest.privateKeys) throw new Error('The `privateKeys` option has been removed from openpgp.decrypt, pass `decryptionKeys` instead');\n if (rest.publicKeys) throw new Error('The `publicKeys` option has been removed from openpgp.decrypt, pass `verificationKeys` instead');\n const unknownOptions = Object.keys(rest); if (unknownOptions.length > 0) throw new Error(`Unknown option: ${unknownOptions.join(', ')}`);\n\n try {\n const decrypted = await message.decrypt(decryptionKeys, passwords, sessionKeys, date, config);\n if (!verificationKeys) {\n verificationKeys = [];\n }\n\n const result = {};\n result.signatures = signature ? await decrypted.verifyDetached(signature, verificationKeys, date, config) : await decrypted.verify(verificationKeys, date, config);\n result.data = format === 'binary' ? decrypted.getLiteralData() : decrypted.getText();\n result.filename = decrypted.getFilename();\n linkStreams(result, message);\n if (expectSigned) {\n if (verificationKeys.length === 0) {\n throw new Error('Verification keys are required to verify message signatures');\n }\n if (result.signatures.length === 0) {\n throw new Error('Message is not signed');\n }\n result.data = stream.concat([\n result.data,\n stream.fromAsync(async () => {\n await util.anyPromise(result.signatures.map(sig => sig.verified));\n })\n ]);\n }\n result.data = await convertStream(result.data, message.fromStream, format);\n return result;\n } catch (err) {\n throw util.wrapError('Error decrypting message', err);\n }\n}\n\n\n//////////////////////////////////////////\n// //\n// Message signing and verification //\n// //\n//////////////////////////////////////////\n\n\n/**\n * Signs a message.\n * @param {Object} options\n * @param {CleartextMessage|Message} options.message - (cleartext) message to be signed\n * @param {PrivateKey|PrivateKey[]} options.signingKeys - Array of keys or single key with decrypted secret key data to sign cleartext\n * @param {'armored'|'binary'|'object'} [options.format='armored'] - Format of the returned message\n * @param {Boolean} [options.detached=false] - If the return value should contain a detached signature\n * @param {KeyID|KeyID[]} [options.signingKeyIDs=latest-created valid signing (sub)keys] - Array of key IDs to use for signing. Each signingKeyIDs[i] corresponds to signingKeys[i]\n * @param {Date} [options.date=current date] - Override the creation date of the signature\n * @param {Object|Object[]} [options.signingUserIDs=primary user IDs] - Array of user IDs to sign with, one per key in `signingKeys`, e.g. `[{ name: 'Steve Sender', email: 'steve@openpgp.org' }]`\n * @param {Object} [options.config] - Custom configuration settings to overwrite those in [config]{@link module:config}\n * @returns {Promise<MaybeStream<String|Uint8Array>>} Signed message (string if `armor` was true, the default; Uint8Array if `armor` was false).\n * @async\n * @static\n */\nexport async function sign({ message, signingKeys, format = 'armored', detached = false, signingKeyIDs = [], date = new Date(), signingUserIDs = [], config, ...rest }) {\n config = { ...defaultConfig, ...config }; checkConfig(config);\n checkCleartextOrMessage(message); checkOutputMessageFormat(format);\n signingKeys = toArray(signingKeys); signingKeyIDs = toArray(signingKeyIDs); signingUserIDs = toArray(signingUserIDs);\n\n if (rest.privateKeys) throw new Error('The `privateKeys` option has been removed from openpgp.sign, pass `signingKeys` instead');\n if (rest.armor !== undefined) throw new Error('The `armor` option has been removed from openpgp.sign, pass `format` instead.');\n const unknownOptions = Object.keys(rest); if (unknownOptions.length > 0) throw new Error(`Unknown option: ${unknownOptions.join(', ')}`);\n\n if (message instanceof CleartextMessage && format === 'binary') throw new Error('Cannot return signed cleartext message in binary format');\n if (message instanceof CleartextMessage && detached) throw new Error('Cannot detach-sign a cleartext message');\n\n if (!signingKeys || signingKeys.length === 0) {\n throw new Error('No signing keys provided');\n }\n\n try {\n let signature;\n if (detached) {\n signature = await message.signDetached(signingKeys, undefined, signingKeyIDs, date, signingUserIDs, config);\n } else {\n signature = await message.sign(signingKeys, undefined, signingKeyIDs, date, signingUserIDs, config);\n }\n if (format === 'object') return signature;\n\n const armor = format === 'armored';\n signature = armor ? signature.armor(config) : signature.write();\n if (detached) {\n signature = stream.transformPair(message.packets.write(), async (readable, writable) => {\n await Promise.all([\n stream.pipe(signature, writable),\n stream.readToEnd(readable).catch(() => {})\n ]);\n });\n }\n return convertStream(signature, message.fromStream, armor ? 'utf8' : 'binary');\n } catch (err) {\n throw util.wrapError('Error signing message', err);\n }\n}\n\n/**\n * Verifies signatures of cleartext signed message\n * @param {Object} options\n * @param {CleartextMessage|Message} options.message - (cleartext) message object with signatures\n * @param {PublicKey|PublicKey[]} options.verificationKeys - Array of publicKeys or single key, to verify signatures\n * @param {Boolean} [options.expectSigned=false] - If true, verification throws if the message is not signed with the provided publicKeys\n * @param {'utf8'|'binary'} [options.format='utf8'] - Whether to return data as a string(Stream) or Uint8Array(Stream). If 'utf8' (the default), also normalize newlines.\n * @param {Signature} [options.signature] - Detached signature for verification\n * @param {Date} [options.date=current date] - Use the given date for verification instead of the current time\n * @param {Object} [options.config] - Custom configuration settings to overwrite those in [config]{@link module:config}\n * @returns {Promise<Object>} Object containing verified message in the form:\n *\n * {\n * data: MaybeStream<String>, (if `message` was a CleartextMessage)\n * data: MaybeStream<Uint8Array>, (if `message` was a Message)\n * signatures: [\n * {\n * keyID: module:type/keyid~KeyID,\n * verified: Promise<true>,\n * signature: Promise<Signature>\n * }, ...\n * ]\n * }\n *\n * where `signatures` contains a separate entry for each signature packet found in the input message.\n * @async\n * @static\n */\nexport async function verify({ message, verificationKeys, expectSigned = false, format = 'utf8', signature = null, date = new Date(), config, ...rest }) {\n config = { ...defaultConfig, ...config }; checkConfig(config);\n checkCleartextOrMessage(message); verificationKeys = toArray(verificationKeys);\n if (rest.publicKeys) throw new Error('The `publicKeys` option has been removed from openpgp.verify, pass `verificationKeys` instead');\n const unknownOptions = Object.keys(rest); if (unknownOptions.length > 0) throw new Error(`Unknown option: ${unknownOptions.join(', ')}`);\n\n if (message instanceof CleartextMessage && format === 'binary') throw new Error(\"Can't return cleartext message data as binary\");\n if (message instanceof CleartextMessage && signature) throw new Error(\"Can't verify detached cleartext signature\");\n\n try {\n const result = {};\n if (signature) {\n result.signatures = await message.verifyDetached(signature, verificationKeys, date, config);\n } else {\n result.signatures = await message.verify(verificationKeys, date, config);\n }\n result.data = format === 'binary' ? message.getLiteralData() : message.getText();\n if (message.fromStream) linkStreams(result, message);\n if (expectSigned) {\n if (result.signatures.length === 0) {\n throw new Error('Message is not signed');\n }\n result.data = stream.concat([\n result.data,\n stream.fromAsync(async () => {\n await util.anyPromise(result.signatures.map(sig => sig.verified));\n })\n ]);\n }\n result.data = await convertStream(result.data, message.fromStream, format);\n return result;\n } catch (err) {\n throw util.wrapError('Error verifying signed message', err);\n }\n}\n\n\n///////////////////////////////////////////////\n// //\n// Session key encryption and decryption //\n// //\n///////////////////////////////////////////////\n\n/**\n * Generate a new session key object, taking the algorithm preferences of the passed public keys into account.\n * @param {Object} options\n * @param {PublicKey|PublicKey[]} options.encryptionKeys - Array of public keys or single key used to select algorithm preferences for\n * @param {Date} [options.date=current date] - Date to select algorithm preferences at\n * @param {Object|Object[]} [options.encryptionUserIDs=primary user IDs] - User IDs to select algorithm preferences for\n * @param {Object} [options.config] - Custom configuration settings to overwrite those in [config]{@link module:config}\n * @returns {Promise<{ data: Uint8Array, algorithm: String }>} Object with session key data and algorithm.\n * @async\n * @static\n */\nexport async function generateSessionKey({ encryptionKeys, date = new Date(), encryptionUserIDs = [], config, ...rest }) {\n config = { ...defaultConfig, ...config }; checkConfig(config);\n encryptionKeys = toArray(encryptionKeys); encryptionUserIDs = toArray(encryptionUserIDs);\n if (rest.publicKeys) throw new Error('The `publicKeys` option has been removed from openpgp.generateSessionKey, pass `encryptionKeys` instead');\n const unknownOptions = Object.keys(rest); if (unknownOptions.length > 0) throw new Error(`Unknown option: ${unknownOptions.join(', ')}`);\n\n try {\n const sessionKeys = await Message.generateSessionKey(encryptionKeys, date, encryptionUserIDs, config);\n return sessionKeys;\n } catch (err) {\n throw util.wrapError('Error generating session key', err);\n }\n}\n\n/**\n * Encrypt a symmetric session key with public keys, passwords, or both at once.\n * At least one of `encryptionKeys` or `passwords` must be specified.\n * @param {Object} options\n * @param {Uint8Array} options.data - The session key to be encrypted e.g. 16 random bytes (for aes128)\n * @param {String} options.algorithm - Algorithm of the symmetric session key e.g. 'aes128' or 'aes256'\n * @param {String} [options.aeadAlgorithm] - AEAD algorithm, e.g. 'eax' or 'ocb'\n * @param {PublicKey|PublicKey[]} [options.encryptionKeys] - Array of public keys or single key, used to encrypt the key\n * @param {String|String[]} [options.passwords] - Passwords for the message\n * @param {'armored'|'binary'} [options.format='armored'] - Format of the returned value\n * @param {Boolean} [options.wildcard=false] - Use a key ID of 0 instead of the public key IDs\n * @param {KeyID|KeyID[]} [options.encryptionKeyIDs=latest-created valid encryption (sub)keys] - Array of key IDs to use for encryption. Each encryptionKeyIDs[i] corresponds to encryptionKeys[i]\n * @param {Date} [options.date=current date] - Override the date\n * @param {Object|Object[]} [options.encryptionUserIDs=primary user IDs] - Array of user IDs to encrypt for, one per key in `encryptionKeys`, e.g. `[{ name: 'Phil Zimmermann', email: 'phil@openpgp.org' }]`\n * @param {Object} [options.config] - Custom configuration settings to overwrite those in [config]{@link module:config}\n * @returns {Promise<String|Uint8Array>} Encrypted session keys (string if `armor` was true, the default; Uint8Array if `armor` was false).\n * @async\n * @static\n */\nexport async function encryptSessionKey({ data, algorithm, aeadAlgorithm, encryptionKeys, passwords, format = 'armored', wildcard = false, encryptionKeyIDs = [], date = new Date(), encryptionUserIDs = [], config, ...rest }) {\n config = { ...defaultConfig, ...config }; checkConfig(config);\n checkBinary(data); checkString(algorithm, 'algorithm'); checkOutputMessageFormat(format);\n encryptionKeys = toArray(encryptionKeys); passwords = toArray(passwords); encryptionKeyIDs = toArray(encryptionKeyIDs); encryptionUserIDs = toArray(encryptionUserIDs);\n if (rest.publicKeys) throw new Error('The `publicKeys` option has been removed from openpgp.encryptSessionKey, pass `encryptionKeys` instead');\n const unknownOptions = Object.keys(rest); if (unknownOptions.length > 0) throw new Error(`Unknown option: ${unknownOptions.join(', ')}`);\n\n try {\n const message = await Message.encryptSessionKey(data, algorithm, aeadAlgorithm, encryptionKeys, passwords, wildcard, encryptionKeyIDs, date, encryptionUserIDs, config);\n return formatObject(message, format, config);\n } catch (err) {\n throw util.wrapError('Error encrypting session key', err);\n }\n}\n\n/**\n * Decrypt symmetric session keys using private keys or passwords (not both).\n * One of `decryptionKeys` or `passwords` must be specified.\n * @param {Object} options\n * @param {Message} options.message - A message object containing the encrypted session key packets\n * @param {PrivateKey|PrivateKey[]} [options.decryptionKeys] - Private keys with decrypted secret key data\n * @param {String|String[]} [options.passwords] - Passwords to decrypt the session key\n * @param {Date} [options.date] - Date to use for key verification instead of the current time\n * @param {Object} [options.config] - Custom configuration settings to overwrite those in [config]{@link module:config}\n * @returns {Promise<Object[]>} Array of decrypted session key, algorithm pairs in the form:\n * { data:Uint8Array, algorithm:String }\n * @throws if no session key could be found or decrypted\n * @async\n * @static\n */\nexport async function decryptSessionKeys({ message, decryptionKeys, passwords, date = new Date(), config, ...rest }) {\n config = { ...defaultConfig, ...config }; checkConfig(config);\n checkMessage(message); decryptionKeys = toArray(decryptionKeys); passwords = toArray(passwords);\n if (rest.privateKeys) throw new Error('The `privateKeys` option has been removed from openpgp.decryptSessionKeys, pass `decryptionKeys` instead');\n const unknownOptions = Object.keys(rest); if (unknownOptions.length > 0) throw new Error(`Unknown option: ${unknownOptions.join(', ')}`);\n\n try {\n const sessionKeys = await message.decryptSessionKeys(decryptionKeys, passwords, date, config);\n return sessionKeys;\n } catch (err) {\n throw util.wrapError('Error decrypting session keys', err);\n }\n}\n\n\n//////////////////////////\n// //\n// Helper functions //\n// //\n//////////////////////////\n\n\n/**\n * Input validation\n * @private\n */\nfunction checkString(data, name) {\n if (!util.isString(data)) {\n throw new Error('Parameter [' + (name || 'data') + '] must be of type String');\n }\n}\nfunction checkBinary(data, name) {\n if (!util.isUint8Array(data)) {\n throw new Error('Parameter [' + (name || 'data') + '] must be of type Uint8Array');\n }\n}\nfunction checkMessage(message) {\n if (!(message instanceof Message)) {\n throw new Error('Parameter [message] needs to be of type Message');\n }\n}\nfunction checkCleartextOrMessage(message) {\n if (!(message instanceof CleartextMessage) && !(message instanceof Message)) {\n throw new Error('Parameter [message] needs to be of type Message or CleartextMessage');\n }\n}\nfunction checkOutputMessageFormat(format) {\n if (format !== 'armored' && format !== 'binary' && format !== 'object') {\n throw new Error(`Unsupported format ${format}`);\n }\n}\nconst defaultConfigPropsCount = Object.keys(defaultConfig).length;\nfunction checkConfig(config) {\n const inputConfigProps = Object.keys(config);\n if (inputConfigProps.length !== defaultConfigPropsCount) {\n for (const inputProp of inputConfigProps) {\n if (defaultConfig[inputProp] === undefined) {\n throw new Error(`Unknown config property: ${inputProp}`);\n }\n }\n }\n}\n\n/**\n * Normalize parameter to an array if it is not undefined.\n * @param {Object} param - the parameter to be normalized\n * @returns {Array<Object>|undefined} The resulting array or undefined.\n * @private\n */\nfunction toArray(param) {\n if (param && !util.isArray(param)) {\n param = [param];\n }\n return param;\n}\n\n/**\n * Convert data to or from Stream\n * @param {Object} data - the data to convert\n * @param {'web'|'ponyfill'|'node'|false} streaming - Whether to return a ReadableStream, and of what type\n * @param {'utf8'|'binary'} [encoding] - How to return data in Node Readable streams\n * @returns {Promise<Object>} The data in the respective format.\n * @async\n * @private\n */\nasync function convertStream(data, streaming, encoding = 'utf8') {\n const streamType = util.isStream(data);\n if (streamType === 'array') {\n return stream.readToEnd(data);\n }\n if (streaming === 'node') {\n data = stream.webToNode(data);\n if (encoding !== 'binary') data.setEncoding(encoding);\n return data;\n }\n if (streaming === 'web' && streamType === 'ponyfill') {\n return stream.toNativeReadable(data);\n }\n return data;\n}\n\n/**\n * Link result.data to the message stream for cancellation.\n * Also, forward errors in the message to result.data.\n * @param {Object} result - the data to convert\n * @param {Message} message - message object\n * @returns {Object}\n * @private\n */\nfunction linkStreams(result, message) {\n result.data = stream.transformPair(message.packets.stream, async (readable, writable) => {\n await stream.pipe(result.data, writable, {\n preventClose: true\n });\n const writer = stream.getWriter(writable);\n try {\n // Forward errors in the message stream to result.data.\n await stream.readToEnd(readable, _ => _);\n await writer.close();\n } catch (e) {\n await writer.abort(e);\n }\n });\n}\n\n/**\n * Convert the object to the given format\n * @param {Key|Message} object\n * @param {'armored'|'binary'|'object'} format\n * @param {Object} config - Full configuration\n * @returns {String|Uint8Array|Object}\n */\nfunction formatObject(object, format, config) {\n switch (format) {\n case 'object':\n return object;\n case 'armored':\n return object.armor(config);\n case 'binary':\n return object.write();\n default:\n throw new Error(`Unsupported format ${format}`);\n }\n}\n"],"names":["doneWritingPromise","Symbol","doneWritingResolve","doneWritingReject","ArrayStream","Array","constructor","super","this","Promise","resolve","reject","catch","isArrayStream","input","getReader","isArray","Writer","writer","getWriter","releaseLock","closed","call","stream","prototype","read","async","length","value","shift","done","undefined","write","chunk","push","close","abort","reason","isNode","globalThis","process","versions","NodeReadableStream","isStream","ReadableStream","isPrototypeOf","streams.ReadableStream","isUint8Array","Uint8Array","concatUint8Array","arrays","totalLength","i","Error","result","pos","forEach","element","set","NodeBuffer","nodeToWeb","webToNode","nodeStream","canceled","start","controller","pause","on","isBuffer","buffer","byteOffset","byteLength","enqueue","e","error","pull","resume","cancel","destroy","NodeReadable","webStream","options","_reader","streams.getReader","_read","size","_cancelling","_reading","emit","_destroy","doneReadingSet","WeakSet","externalBuffer","Reader","slice","streams.isArrayStream","reader","bind","_releaseLock","_cancel","streamType","streams.isStream","streams.nodeToWeb","doneReading","has","add","readLine","returnVal","streams.concat","lineEndIndex","indexOf","concat","substr","unshift","readByte","byte","streams.slice","readBytes","bufferLength","bufferConcat","peekBytes","bytes","values","filter","readToEnd","join","toPonyfillReadable","toNativeReadable","WritableStream","TransformStream","loadStreamsPonyfill","ponyfill","adapter","all","import","createReadableStreamWrapper","toStream","toArrayStream","list","some","map","transform","transformWithCancel","transforms","prev","transformPair","readable","writable","then","pipe","preventClose","concatStream","concatArrayStream","target","preventAbort","preventCancel","ready","pipeTo","transformRaw","transformStream","backpressureChangePromiseResolve","outputController","pulled","highWaterMark","finish","output","data","result1","result2","flush","fn","incomingTransformController","incoming","pipeDonePromise","outgoing","setTimeout","parse","returnValue","transformed","remainder","clone","teed","tee0","tee1","writer1","writer2","tee","overwrite","passiveClone","Object","entries","getOwnPropertyDescriptors","name","descriptor","get","defineProperty","begin","end","Infinity","bytesRead","Math","max","terminate","lastBytes","console","warn","fromAsync","subarray","arrayStream","BigInteger","n","hex","hexByte","toString","BigInt","iinc","inc","idec","dec","iadd","x","isub","sub","imul","mul","imod","m","isNegative","mod","modExp","isZero","isOne","exp","r","lsb","rx","modInv","gcd","_egcd","b","y","xPrev","yPrev","a","q","tmp","ileftShift","leftShift","irightShift","rightShift","equal","lt","lte","gt","gte","isEven","abs","res","toNumber","number","Number","MAX_SAFE_INTEGER","getBit","bitLength","zero","one","negOne","bitlen","eight","len","toUint8Array","endian","rawLength","offset","parseInt","reverse","debugMode","env","NODE_ENV","util","isString","String","stream.isUint8Array","stream.isStream","readNumber","writeNumber","readDate","Date","writeDate","time","numeric","floor","getTime","normalizeDate","now","readMPI","bytelen","leftPad","padded","uint8ArrayToMPI","bin","bitSize","uint8ArrayBitLength","stripped","ceil","prefix","nbits","hexToUint8Array","k","uint8ArrayToHex","h","c","stringToUint8Array","str","stream.transform","charCodeAt","uint8ArrayToString","bs","j","fromCharCode","apply","encodeUTF8","encoder","TextEncoder","lastChunk","encode","decodeUTF8","utf8","decoder","TextDecoder","decode","stream.concat","stream.concatUint8Array","equalsUint8Array","array1","array2","writeChecksum","text","s","printDebug","log","printDebugError","t","double","doubleVar","last","shiftRight","array","bits","getWebCrypto","crypto","subtle","detectNode","detectBigInt","getBigInteger","default","getNodeCrypto","getNodeZlib","getNodeBuffer","Buffer","getHardwareConcurrency","cpus","navigator","hardwareConcurrency","isEmailAddress","test","canonicalizeEOL","carryOverCR","index","indices","normalized","nativeEOL","copyWithin","removeTrailingSpaces","split","line","wrapError","message","constructAllowedPackets","allowedClasses","PacketClass","tag","anyPromise","promises","exception","promise","encodeChunk","decodeChunk","buf","lines","encoded","spaces","spacechars","spacechar","includes","decoded","b64ToUint8Array","base64","replace","uint8ArrayToB64","url","from","btoa","atob","byValue","curve","p256","secp256r1","prime256v1","p384","secp384r1","p521","secp521r1","secp256k1","ED25519","ed25519","Ed25519","X25519","cv25519","curve25519","Curve25519","brainpoolP256r1","brainpoolP384r1","brainpoolP512r1","s2k","simple","salted","iterated","gnu","publicKey","rsaEncryptSign","rsaEncrypt","rsaSign","elgamal","dsa","ecdh","ecdsa","eddsa","aedh","aedsa","symmetric","plaintext","idea","tripledes","cast5","blowfish","aes128","aes192","aes256","twofish","compression","uncompressed","zip","zlib","bzip2","hash","md5","sha1","ripemd","sha256","sha384","sha512","sha224","webHash","aead","eax","ocb","experimentalGCM","packet","publicKeyEncryptedSessionKey","signature","symEncryptedSessionKey","onePassSignature","secretKey","secretSubkey","compressedData","symmetricallyEncryptedData","marker","literalData","trust","userID","publicSubkey","userAttribute","symEncryptedIntegrityProtectedData","modificationDetectionCode","aeadEncryptedData","literal","binary","mime","standalone","certGeneric","certPersona","certCasual","certPositive","certRevocation","subkeyBinding","keyBinding","key","keyRevocation","subkeyRevocation","timestamp","thirdParty","signatureSubpacket","signatureCreationTime","signatureExpirationTime","exportableCertification","trustSignature","regularExpression","revocable","keyExpirationTime","placeholderBackwardsCompatibility","preferredSymmetricAlgorithms","revocationKey","issuer","notationData","preferredHashAlgorithms","preferredCompressionAlgorithms","keyServerPreferences","preferredKeyServer","primaryUserID","policyURI","keyFlags","signersUserID","reasonForRevocation","features","signatureTarget","embeddedSignature","issuerFingerprint","preferredAEADAlgorithms","certifyKeys","signData","encryptCommunication","encryptStorage","splitPrivateKey","authentication","sharedPrivateKey","armor","multipartSection","multipartLast","signed","privateKey","noReason","keySuperseded","keyCompromised","keyRetired","userIDInvalid","modificationDetection","v5Keys","type","preferredHashAlgorithm","enums","preferredSymmetricAlgorithm","preferredCompressionAlgorithm","deflateLevel","aeadProtect","preferredAEADAlgorithm","aeadChunkSizeByte","s2kIterationCountByte","allowUnauthenticatedMessages","allowUnauthenticatedStream","checksumRequired","minRSABits","passwordCollisionCheck","revocationsExpire","allowInsecureDecryptionWithSigningKeys","minBytesForWebCrypto","ignoreUnsupportedPackets","ignoreMalformedPackets","showVersion","showComment","versionString","commentString","maxUserIDLength","knownNotations","useIndutnyElliptic","rejectHashAlgorithms","Set","rejectMessageHashAlgorithms","rejectPublicKeyAlgorithms","rejectCurves","getType","header","match","addheader","customComment","config","getCheckSum","base64.encode","crc","len32","isLittleEndian","arr32","Uint32Array","crc_table","createcrc24","ArrayBuffer","DataView","setInt16","Int16Array","verifyHeaders","headers","splitChecksum","body","checksum","lastEquals","lastIndexOf","unarmor","defaultConfig","reSplit","reEmptyLine","headersDone","textDone","lastHeaders","base64.decode","stream.transformPair","stream.getReader","stream.getWriter","parts","checksumVerified","stream.readToEnd","stream.passiveClone","stream.pipe","checksumVerifiedString","stream.isArrayStream","messageType","partIndex","partTotal","bodyClone","KeyID","toHex","equals","keyID","matchWildcard","isWildcard","isNull","mapToHex","fromID","wildcard","AES_asm","gexp3","glog3","ginit_done","gmul","aes_sbox","aes_sinv","aes_enc","aes_dec","aes_init_done","aes_init","_s","ginv","d","ginit","wrapper","foreign","heap","asm","stdlib","S0","S1","S2","S3","I0","I1","I2","I3","N0","N1","N2","N3","M0","M1","M2","M3","H0","H1","H2","H3","R","HEAP","DATA","_core","x0","x1","x2","x3","t1","t2","t3","y0","y1","y2","y3","_ecb_enc","_ecb_dec","_cbc_enc","_cbc_dec","_cfb_enc","_cfb_dec","_ofb","_ctr","_gcm_mac","z0","z1","z2","z3","set_rounds","set_state","s0","s1","s2","s3","set_iv","i0","i1","i2","i3","set_nonce","n0","n1","n2","n3","set_mask","m0","m1","m2","m3","set_counter","c0","c1","c2","c3","get_state","get_iv","gcm_init","cipher","mode","ret","_cipher_modes","mac","_mac_modes","set_key","ks","k0","k1","k2","k3","k4","k5","k6","k7","ekeys","dkeys","rcon","jj","ENC","ECB","CBC","CFB","OFB","CTR","DEC","MAC","GCM","HEAP_DATA","is_bytes","_heap_init","heapSize","_heap_write","hpos","dpos","dlen","hlen","wlen","joinBytes","arg","totalLenght","reduce","sum","curr","cursor","IllegalStateError","args","IllegalArgumentError","SecurityError","heap_pool","asm_pool","AES","iv","padding","acquire_asm","pop","reset","release_asm","keylen","keyview","getUint32","ivview","AES_Encrypt_process","TypeError","amode","rpos","AES_Encrypt_finish","plen","rlen","hasOwnProperty","p","AES_Decrypt_process","AES_Decrypt_finish","pad","pcheck","AES_ECB","encrypt","decrypt","aes","C","aesECB","block","blockSize","keySize","des","keys","spfunction1","spfunction2","spfunction3","spfunction4","spfunction5","spfunction6","spfunction7","spfunction8","temp","right1","right2","left","right","looping","cbcleft","cbcleft2","cbcright","cbcright2","endloop","loopinc","iterations","padLength","paddedMessage","desAddPadding","desRemovePadding","desCreateKeys","pc2bytes0","pc2bytes1","pc2bytes2","pc2bytes3","pc2bytes4","pc2bytes5","pc2bytes6","pc2bytes7","pc2bytes8","pc2bytes9","pc2bytes10","pc2bytes11","pc2bytes12","pc2bytes13","shifts","lefttemp","righttemp","TripleDES","OpenPGPSymEncCAST5","BlockSize","KeySize","setKey","masking","rotate","keySchedule","getBlockSize","src","dst","l","f1","f2","f3","scheduleA","scheduleB","I","sBox","inn","w","ki","half","round","CAST5","MAXINT","rotw","getW","setW","splice","getB","TF","tf","keyBytes","dataBytes","dataOffset","tfsKey","tfsM","tfsG0","tfsG1","tfsFrnd","blk","tfsIrnd","blocksize","open","meKey","moKey","inKey","kLen","sKey","f01","f5b","fef","q0","q1","q2","q3","ror4","ashx","ffm5b","ffmEf","mdsRem","u","qp","hFun","finalize","createTwofish","Blowfish","BF","bf","init","encryptBlock","BLOCKSIZE","SBOXES","PARRAY","NN","_clean","xx","_F","yy","dd","cc","bb","aa","sboxes","_encryptBlock","vals","ii","dataL","dataR","parray","vector","off","_decryptBlock","kk","sha1_asm","H4","TOTAL0","TOTAL1","I4","O0","O1","O2","O3","O4","w0","w1","w2","w3","w4","w5","w6","w7","w8","w9","w10","w11","w12","w13","w14","w15","w16","w17","w18","w19","w20","w21","w22","w23","w24","w25","w26","w27","w28","w29","w30","w31","w32","w33","w34","w35","w36","w37","w38","w39","w40","w41","w42","w43","w44","w45","w46","w47","w48","w49","w50","w51","w52","w53","w54","w55","w56","w57","w58","w59","w60","w61","w62","w63","w64","w65","w66","w67","w68","w69","w70","w71","w72","w73","w74","w75","w76","w77","w78","w79","_core_heap","_state_to_heap","h0","h1","h2","h3","h4","total0","total1","hashed","hmac_reset","_hmac_opad","hmac_init","p0","p1","p2","p3","p4","p5","p6","p7","p8","p9","p10","p11","p12","p13","p14","p15","hmac_finish","t0","t4","pbkdf2_generate_block","count","Hash","HASH_SIZE","Sha1","NAME","BLOCK_SIZE","asm_function","Sha256","H5","H6","H7","I5","I6","I7","O5","O6","O7","f","g","h5","h6","h7","t5","t6","t7","sha256_asm","assert","val","msg","module","create","ctor","superCtor","super_","enumerable","configurable","TempCtor","htonl","zero2","word","zero8","inherits","enc","hi","lo","ah","al","bh","bl","ch","cl","dh","dl","carry","eh","el","num","BlockHash","pending","pendingTotal","outSize","hmacStrength","_delta8","_delta32","update","utils","toArray","join32","_update","digest","_pad","_digest","rotr32","ch32","z","maj32","p32","sum32","sum32_4","sum32_5","shaCommon","s0_256","s1_256","g0_256","g1_256","common","sha256_K","SHA256","W","SHA224","T1","T2","toHex32","split32","rotr64_hi","rotr64_lo","shr64_hi","shr64_lo","sum64","sum64_hi","sum64_lo","sum64_4_hi","sum64_4_lo","sum64_5_hi","sum64_5_lo","sha512_K","SHA512","ch64_hi","xh","xl","yh","yl","zh","ch64_lo","zl","maj64_hi","maj64_lo","s0_512_hi","s0_512_lo","s1_512_hi","s1_512_lo","g0_512_hi","g0_512_lo","g1_512_hi","g1_512_lo","SHA384","_prepareBlock","c0_hi","c0_lo","c1_hi","c1_lo","c2_hi","c2_lo","c3_hi","c3_lo","fh","fl","gh","gl","hh","hl","c4_hi","c4_lo","T1_hi","T1_lo","T2_hi","T2_lo","rotl32","sum32_3","RIPEMD160","K","Kh","A","B","D","E","Ah","Bh","Ch","Dh","Eh","T","rh","sh","md5cycle","ff","gg","add32","cmn","md5blk","md5blks","hex_chr","rhex","webCrypto","nodeCrypto","nodeHash","shasum","createHash","hashjsHash","webCryptoHash","hashInstance","asmcryptoHash","hashFunctions","entree","state","substring","tail","md51","userAgent","ripemd160","algo","getHashByteLength","AES_CFB","knownAlgos","getCiphers","nodeAlgos","pt","cipherObj","createCipheriv","nodeEncrypt","ALGO","_key","importKey","cbc_pt","ct","xorMut","webEncrypt","cfb","aesEncrypt","cipherfn","block_size","blockc","ciphertext","encblock","decipherObj","createDecipheriv","nodeDecrypt","aesDecrypt","blockp","decblock","AES_CTR","nonce","AES_CTR_set_options","counter","mask","pow","view","AES_CBC","rightXORMut","zeroBlock","CMAC","cbc","blockLength","padding2","two","OMAC","cmac","en","final","EAX","omac","ctr","adata","omacNonce","omacAdata","ciphered","ctTag","omacCiphered","getNonce","chunkIndex","ivLength","tagLength","ntz","S","xor","OCB","encipher","decipher","maxNtz","crypt","newMaxNtz","extendKeyVariables","paddedNonce","bottom","kTop","stretched","xorInput","$","cipherInput","ciphers","mask_x","mask_$","constructKeyVariables","crypted","AES_GCM","tagSize","gamma0","noncelen","noncebuf","_gcm_mac_process","nonceview","RangeError","cleartext","tagsize","AES_GCM_encrypt","AES_GCM_decrypt","AES_GCM_Encrypt_process","AES_GCM_Encrypt_finish","alen","clen","AES_GCM_Decrypt_process","tlen","AES_GCM_Decrypt_finish","atag","acheck","additionalData","setAAD","getAuthTag","de","setAuthTag","gcm","nacl","gf","Float64Array","randombytes","_9","gf0","gf1","_121665","D2","X","Y","crypto_verify_32","xi","yi","vn","set25519","car25519","o","v","sel25519","pack25519","neq25519","par25519","unpack25519","Z","M","t8","t9","t10","t11","t12","t13","t14","t15","t16","t17","t18","t19","t20","t21","t22","t23","t24","t25","t26","t27","t28","t29","t30","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","b10","b11","b12","b13","b14","b15","inv25519","crypto_scalarmult","x32","x16","crypto_scalarmult_base","cswap","pack","tx","ty","zi","scalarmult","scalarbase","crypto_sign_keypair","pk","sk","seeded","L","modL","unpackneg","chk","den","den2","den4","den6","pow2523","crypto_sign_BYTES","checkArrayTypes","arguments","cleanup","arr","scalarMult","box","keyPair","fromSecretKey","sign","signedMsg","sm","smlen","crypto_sign","detached","sig","verify","crypto_sign_open","fromSeed","seed","setPRNG","self","msCrypto","getRandomValues","min","randomBytes","exports","getRandomBytes","randomBuffer","getRandomBigInteger","modulus","callback","freeSpace","randomProbablePrime","thirty","adds","isProbablePrime","smallPrimes","every","divisionTest","fermat","rand","millerRabin","hash_headers","emeEncode","keyLength","mLength","PS","getPKCS1Padding","emeDecode","psLen","separator","emsaEncode","emLen","hashPrefix","tLen","fill","EM","asn1","RSAPrivateKey","define","seq","obj","int","RSAPublicKey","hashAlgo","hashName","jwk","pNum","qNum","dNum","dq","dp","kty","qi","ext","privateToJWK","webSign","err","BN","pBNum","qBNum","dBNum","subn","createSign","keyObject","version","publicExponent","privateExponent","prime1","prime2","exponent1","exponent2","coefficient","createPrivateKey","der","format","pem","label","nodeSign","bnSign","publicToJWK","webVerify","createVerify","nodeVerify","EM1","EM2","bnVerify","constants","RSA_PKCS1_PADDING","publicEncrypt","bnEncrypt","privateDecrypt","unblinder","blinder","mp","mq","bnDecrypt","keyGenOpt","modulusLength","generateKey","exportKey","generateKeyPair","opts","publicKeyEncoding","privateKeyEncoding","prv","_","toArrayLike","phi","nSizeOver3","rde","pSize","n1023","threshold","rqx","OID","oid","getName","keyFromPrivate","indutnyCurve","priv","keyFromPublic","pub","validate","getIndutnyCurve","elliptic","ec","webCurves","knownCurves","getCurves","nodeCurves","curves","keyType","node","web","payloadSize","sharedSize","Curve","oidOrName","params","genKeyPair","webCryptoKey","namedCurve","jwkToRawPublic","webGenKeyPair","createECDH","generateKeys","getPublicKey","getPrivateKey","nodeGenKeyPair","entropy","getPublic","getPrivate","validateStandardParams","Q","supportedCurves","curveName","dG","validationErrors","eq","bufX","bufY","rawPublicToJWK","crv","ECPrivateKey","parameters","unused","ECDSASignature","ellipticSign","SubjectPublicKeyInfo","algorithm","subjectPublicKey","ellipticVerify","octstr","explicit","optional","any","bitstr","AlgorithmIdentifier","objid","use","wrap","IV","P","unpack","unwrap","createArrayBuffer","setUint32","provided","computed","buildEcdhParam","public_algo","kdfParams","fingerprint","kdf","param","stripLeading","stripTrailing","genPublicEphemeralKey","sharedKey","genPrivateEphemeralKey","recipient","deriveBits","public","webPublicEphemeralKey","sender","computeSecret","nodePublicEphemeralKey","V","derive","ellipticPublicEphemeralKey","secret","webPrivateEphemeralKey","setPrivateKey","nodePrivateEphemeralKey","ellipticPrivateEphemeralKey","pkcs5.encode","cipherAlgo","wrappedKey","aesKW.wrap","pkcs5.decode","aesKW.unwrap","rsa","xr","u1","u2","qSize","n150","publicParams","curveSize","publicKeyParams","privateKeyParams","ECDHSymmetricKey","KDFParams","ECDHSymkey","sessionKeyParams","privateParams","orderedParams","generate","validateParams","algoModule","prefixrandom","repeat","random","pkcs1","pkcs5","aesKW","assign","TYPED_OK","Uint16Array","Int32Array","shrinkBuf","fnTyped","arraySet","dest","src_offs","dest_offs","flattenChunks","chunks","fnUntyped","Buf8","Buf16","Buf32","extra_lbits","extra_dbits","extra_blbits","bl_order","static_ltree","static_dtree","D_CODES","_dist_code","_length_code","MAX_MATCH","base_length","base_dist","StaticTreeDesc","static_tree","extra_bits","extra_base","elems","max_length","has_stree","static_l_desc","static_d_desc","static_bl_desc","TreeDesc","dyn_tree","stat_desc","max_code","d_code","dist","put_short","pending_buf","send_bits","bi_valid","bi_buf","send_code","tree","bi_reverse","code","gen_codes","bl_count","next_code","MAX_BITS","init_block","LITERALS","dyn_ltree","dyn_dtree","bl_tree","END_BLOCK","opt_len","static_len","last_lit","matches","bi_windup","smaller","depth","_n2","_m2","pqdownheap","heap_len","compress_block","ltree","dtree","lc","extra","lx","d_buf","l_buf","build_tree","desc","stree","heap_max","base","xbits","overflow","gen_bitlen","scan_tree","curlen","prevlen","nextlen","max_count","min_count","REP_3_6","REPZ_3_10","REPZ_11_138","send_tree","static_init_done","_tr_init","LENGTH_CODES","L_CODES","tr_static_init","l_desc","d_desc","bl_desc","_tr_stored_block","stored_len","utils.arraySet","window","copy_block","_tr_align","STATIC_TREES","bi_flush","_tr_flush_block","opt_lenb","static_lenb","max_blindex","level","strm","data_type","black_mask","detect_data_type","BL_CODES","build_bl_tree","strategy","lcodes","dcodes","blcodes","rank","send_all_trees","_tr_tally","lit_bufsize","adler32","adler","crcTable","table","makeTable","crc32","errorCode","flush_pending","avail_out","pending_out","next_out","total_out","flush_block_only","trees._tr_flush_block","block_start","strstart","put_byte","putShortMSB","read_buf","avail_in","next_in","total_in","longest_match","cur_match","chain_length","max_chain_length","scan","best_len","prev_length","nice_match","limit","w_size","_win","wmask","w_mask","strend","scan_end1","scan_end","good_match","lookahead","match_start","fill_window","_w_size","more","window_size","hash_size","head","insert","ins_h","hash_shift","hash_mask","deflate_fast","hash_head","bflush","match_length","trees._tr_tally","max_lazy_match","MIN_MATCH","deflate_slow","max_insert","prev_match","match_available","Config","good_length","max_lazy","nice_length","max_chain","func","configuration_table","max_block_size","pending_buf_size","max_start","DeflateState","status","gzhead","gzindex","method","last_flush","w_bits","hash_bits","utils.Buf16","HEAP_SIZE","deflateReset","trees._tr_init","deflateResetKeep","lm_init","deflate","old_flush","beg","hcrc","comment","os","level_flags","bstate","deflate_huff","deflate_rle","trees._tr_align","trees._tr_stored_block","__","_utf8len","utils.Buf8","string2buf","m_pos","buf_len","str_len","ZStream","Deflate","chunkSize","windowBits","memLevel","opt","raw","gzip","ended","zlib_deflate.deflateInit2","dictionary","dict","strings.string2buf","avail","next","tmpDict","dictLength","zlib_deflate.deflateSetDictionary","_dict_set","_mode","zlib_deflate.deflate","onEnd","onData","utils.shrinkBuf","zlib_deflate.deflateEnd","utils.flattenChunks","inflate_fast","_in","_out","hold","here","op","from_source","dmax","wsize","whave","wnext","s_window","lcode","lencode","dcode","distcode","lmask","lenbits","dmask","distbits","top","dolen","dodist","sane","lbase","lext","dbase","dext","inflate_table","lens","lens_index","codes","table_index","work","incr","low","sym","root","drop","used","huff","base_index","MAXBITS","offs","here_bits","here_op","here_val","extra_index","zswap32","InflateState","havedict","flags","check","total","wbits","ncode","nlen","ndist","have","lendyn","distdyn","back","was","inflateReset","utils.Buf32","inflateResetKeep","inflateInit2","inflateReset2","lenfix","distfix","virgin","fixedtables","updatewindow","copy","inflate","put","last_bits","last_op","last_val","hbuf","order","inf_leave","xflags","extra_len","inflateSetDictionary","dictid","GZheader","Inflate","zlib_inflate.inflateInit2","zlib_inflate.inflateGetHeader","zlib_inflate.inflateSetDictionary","allowBufError","strings.binstring2buf","zlib_inflate.inflate","zlib_inflate.inflateEnd","BITMASK","BitReader","bitOffset","curByte","hasByte","_ensureByte","remaining","seek","n_bit","n_byte","pi","bufToHex","Stream","bufOffset","new_pos","writeByte","_byte","crc32Lookup","getCRC","updateCRC","updateCRCRun","mtf","Err","OK","LAST_BLOCK","NOT_BZIP_DATA","UNEXPECTED_INPUT_EOF","UNEXPECTED_OUTPUT_EOF","DATA_ERROR","OUT_OF_MEMORY","OBSOLETE_INPUT","END_OF_BLOCK","ErrorMessages","_throw","optDetail","Bunzip","inputStream","outputStream","writePos","writeCurrent","writeCount","_start_bunzip","_init_block","_get_next_block","blockCRC","CRC32","dbufSize","nextoutput","streamCRC","targetBlockCRC","origPointer","symToByte","symTotal","groupCount","nSelectors","mtfSymbol","selectors","hufGroup","symCount","groups","minLen","maxLen","MAX_HUFCODE_BITS","permute","pp","MAX_VALUE","byteCount","uc","runPos","dbufCount","selector","dbuf","GROUP_SIZE","nextSym","current","run","writeRun","_read_bunzip","outputBuffer","copies","previous","outbyte","outputsize","coerceInputStream","eof","coerceOutputStream","resizeOk","newBuffer","getBuffer","_coerced","multistream","bz","targetStreamCRC","LiteralDataPacket","date","filename","setText","getText","getBytes","setBytes","setFilename","getFilename","stream.parse","filename_len","writeHeader","filename_length","readSimpleLength","writeSimpleLength","writePartialLength","power","writeTag","tag_type","supportsStreaming","readPackets","callbackReturned","peekedBytes","headerByte","packetLength","packetLengthType","packetSupportsStreaming","wasPartialLength","stream.ArrayStream","stream.TransformStream","lengthByte","nextPacket","UnsupportedError","captureStackTrace","verified","allowedUnhashedSubpackets","SignaturePacket","signatureType","hashAlgorithm","publicKeyAlgorithm","signatureData","unhashedSubpackets","signedHashValue","created","signatureNeverExpires","exportable","trustLevel","trustAmount","keyNeverExpires","revocationKeyClass","revocationKeyAlgorithm","revocationKeyFingerprint","issuerKeyID","rawNotations","notations","isPrimaryUserID","reasonForRevocationFlag","reasonForRevocationString","signatureTargetPublicKeyAlgorithm","signatureTargetHashAlgorithm","signatureTargetHash","issuerKeyVersion","revoked","readSubPackets","parseSignatureParams","writeParams","stream.fromAsync","serializeParams","writeUnhashedSubPackets","getFingerprintBytes","getKeyID","writeHashedSubPackets","toHash","stream.slice","stream.clone","writeSubPacket","humanReadable","readSubPacket","mypos","critical","seconds","trusted","subpacketLength","toSign","writeForHash","calculateTrailer","isMessageSignature","normDate","getExpirationTime","toUpperCase","isExpired","OnePassSignaturePacket","correspondingSig","newPacketFromTag","allowedPackets","packetType","PacketList","fromBinary","packets","parsed","fromStream","throwUnsupportedError","throwMalformedError","packetbytes","minLength","powerOf2","LN2","filterByTag","tags","filtered","handle","findPacket","find","indexOfTag","tagIndex","that","CompressedDataPacket","compressed","decompress","compress","decompress_fns","compress_fns","nodeZlib","node_zlib","stream.nodeToWeb","stream.webToNode","pako_zlib","deflateRaw","createDeflateRaw","createDeflate","inflateRaw","createInflateRaw","createInflate","BunzipDecode","SymEncryptedIntegrityProtectedDataPacket","encrypted","sessionKeyAlgorithm","getPrefixRandom","mdc","tohash","decrypted","realHash","verifyHash","AEADEncryptedDataPacket","aeadAlgorithm","aeadAlgo","chunkSizeByte","modeInstance","tagLengthIfDecrypting","tagLengthIfEncrypting","adataBuffer","adataArray","adataTagArray","adataView","chunkIndexArray","latestPromise","cryptedBytes","queuedBytes","finalChunk","cryptedPromise","setInt32","desiredSize","PublicKeyEncryptedSessionKeyPacket","publicKeyID","sessionKey","parseEncSessionKeyParams","publicKeyEncrypt","publicKeyDecrypt","S2K","salt","getCount","produceKey","passphrase","numBytes","rlength","prefixlen","datalen","SymEncryptedSessionKeyPacket","sessionKeyEncryptionAlgorithm","generateSessionKey","algo_enum","private_key","PublicKeyPacket","expirationTimeV3","fromSecretKeyPacket","secretKeyPacket","keyPacket","parsePublicKeyParams","computeFingerprintAndKeyID","writePublicKey","isDecrypted","getCreationTime","computeFingerprint","getFingerprint","hasSameFingerprintAs","other","getAlgorithmInfo","modulo","readPublicKey","SymmetricallyEncryptedDataPacket","FRE","MarkerPacket","PublicSubkeyPacket","fromSecretSubkeyPacket","secretSubkeyPacket","UserAttributePacket","attributes","usrAttr","attr","SecretKeyPacket","keyMaterial","isEncrypted","s2kUsage","parsePrivateKeyParams","optionalFieldsArr","isDummy","makeDummy","clearPrivateParams","produceEncryptionKey","blockLen","cleartextWithHash","validParams","generateParams","global","parse5322","inStr","getPos","setPos","initialize","parseString","tokens","semantic","children","ast","parent","child","compareToken","fxnCompare","tok","lit","and","or","prod","invis","colwsp","star","minimum","isUTF8NonAscii","cr","crlf","lf","dquote","htab","sp","vchar","accept","rfc6532","wsp","quotedPair","obsQP","fws","obsFws","ctext","obsCtext","ccontent","cfws","atext","atom","dotAtomText","maybeText","dotAtom","qtext","obsQtext","qcontent","quotedString","address","mailbox","group","nameAddr","addrSpec","displayName","angleAddr","obsAngleAddr","groupList","obsPhrase","collapseWhitespace","mailboxList","obsMboxList","addressList","obsAddrList","obsGroupList","localPart","obsLocalPart","dtext","obsDtext","domainLiteral","domain","obsDomain","rejectTLD","obsNoWsCtl","strict","atInDisplayName","obsRoute","obsDomainList","findNode","stack","findAllNodesNoChildren","names","namesLookup","giveResult","addresses","groupsAndMailboxes","groupOrMailbox","giveResultGroup","giveResultMailbox","simplifyResult","oneResult","partial","groupName","groupResultMailboxes","mailboxes","grabSemantic","aspec","findAllNodes","comments","local","concatComments","startProduction","handleOpts","startAt","defs","isNullUndef","defaults","isObject","parseOneAddress","parseAddressList","parseFrom","parseSender","parseReplyTo","UserIDPacket","email","fromObject","components","emailAddresses","otherUserID","SecretSubkeyPacket","TrustPacket","Signature","packetlist","getSigningKeyIDs","readSignature","armoredSignature","binarySignature","rest","unknownOptions","generateSecretSubkey","rsaBits","generateSecretKey","getLatestValidSignature","signatures","dataToVerify","latestValid","$1","$2","toLowerCase","isDataExpired","expirationTime","getKeyExpirationTime","createBindingSignature","subkey","primaryKey","dataToSign","subkeySignaturePacket","getPreferredHashAlgo","createSignaturePacket","prefAlgo","primaryUser","getPrimaryUser","selfCertification","getPrototypeOf","getPreferredAlgo","userIDs","defaultAlgo","preferredSenderAlgo","prefPropertyName","recipientPrefs","Boolean","signingKeyPacket","signatureProperties","signaturePacket","mergeSignatures","source","checkFn","sourceSig","destSig","isDataRevoked","revocations","revocationKeyIDs","revocationSignature","sanitizeKeyOptions","subkeyDefaults","isValidSigningKeyPacket","keyAlgo","isValidEncryptionKeyPacket","isValidDecryptionKeyPacket","checkKeyRequirements","algoInfo","User","userPacket","mainKey","selfCertifications","otherCertifications","revocationSignatures","toPacketList","user","certify","signingKeys","isPrivate","signingKey","getSigningKey","isRevoked","certificate","verifyCertificate","verificationKeys","issuerKeys","getKeys","verifyAllCertifications","certifications","certification","valid","sourceUser","srcSelfSig","srcRevSig","Subkey","subkeyPacket","bindingSignatures","helper.isDataRevoked","bindingSignature","helper.getLatestValidSignature","helper.isDataExpired","keyExpiry","helper.getKeyExpirationTime","sigExpiry","helper.mergeSignatures","srcBindSig","revoke","flag","string","helper.createSignaturePacket","allowedRevocationPackets","Key","packetListToStructure","disallowedPackets","primaryKeyID","users","subkeys","directSignatures","deep","getSubkeys","getKeyIDs","getUserIDs","verifyPrimaryKey","sort","helper.isValidSigningKeyPacket","helper.checkKeyRequirements","getEncryptionKey","helper.isValidEncryptionKeyPacket","directSignature","primaryKeyExpiry","selfSigKeyExpiry","selfSigExpiry","directSigKeyExpiry","cert","sourceKey","destSubkey","srcSubkey","updatedKey","usersToUpdate","dstUser","srcUser","userToUpdate","newUser","subkeysToUpdate","dstSubkey","subkeyToUpdate","newSubkey","getRevocationCertificate","applyRevocationCertificate","revocationCertificate","signPrimaryUser","privateKeys","userSign","signAllUsers","verifyPrimaryUser","verifyAllUsers","results","createKey","PrivateKey","PublicKey","toPublic","keyPackets","pubKeyPacket","pubSubkeyPacket","getDecryptionKeys","helper.isValidDecryptionKeyPacket","addSubkey","defaultOptions","helper.sanitizeKeyOptions","helper.generateSecretSubkey","helper.createBindingSignature","packetList","allowedKeyPackets","wrapKeyObject","secretSubkeyPackets","subkeyPassphrase","createPreferredAlgos","algos","preferredAlgo","userIDPacket","helper.getPreferredHashAlgo","subkeyOptions","readKey","armoredKey","binaryKey","readPrivateKey","readKeys","armoredKeys","binaryKeys","keyIndex","newKey","readPrivateKeys","oneKeyList","allowedMessagePackets","allowedSymSessionKeyPackets","allowedDetachedSignaturePackets","Message","getEncryptionKeyIDs","keyIDs","unwrapCompressed","onePassSigList","decryptionKeys","passwords","sessionKeys","keyObjs","decryptSessionKeys","symEncryptedPacketlist","symEncryptedPacket","decryptedPromise","keyObj","stream.cancel","resultMsg","symESKeyPacketlist","password","pkESKeyPacketlist","decryptionKey","decryptionKeyPackets","decryptionKeyPacket","seen","item","getLiteralData","encryptionKeys","supported","isAEADSupported","encryptionKeyIDs","sessionKeyData","encryptSessionKey","encryptionKey","pkESKeyPacket","testDecrypt","accumulator","currentValue","encryptPassword","symEncryptedSessionKeyPacket","pwd","signingKeyIDs","literalDataPacket","existingSigPacketlist","onePassSig","signingKeyID","onePassSignatureList","createSignaturePackets","signDetached","literalDataList","signatureList","correspondingSigResolve","correspondingSigReject","createVerificationObjects","verifyDetached","appendSignature","detachedSignature","unverifiedSigningKey","signaturePacketPromise","verifiedSig","createVerificationObject","readMessage","armoredMessage","binaryMessage","stream.loadStreamsPonyfill","stream.toStream","createMessage","literalDataPacketlist","CleartextMessage","newSignature","hashes","ar","readCleartextMessage","cleartextMessage","checkHashAlgos","hashAlgos","oneHeader","createCleartextMessage","checkConfig","helper.generateSecretKey","formatObject","reformatKey","reformattedKey","sanitize","reformat","revokeKey","revokedKey","decryptKey","clonedPrivateKey","passphrases","encryptKey","signingUserIDs","encryptionUserIDs","checkMessage","checkOutputMessageFormat","publicKeys","streaming","convertStream","expectSigned","linkStreams","checkCleartextOrMessage","checkBinary","checkString","defaultConfigPropsCount","inputConfigProps","inputProp","encoding","setEncoding","stream.toNativeReadable","object"],"mappings":";6GAAMA,EAAqBC,OAAO,sBAC5BC,EAAqBD,OAAO,sBAC5BE,EAAoBF,OAAO,qBAEjC,MAAMG,UAAoBC,MACxBC,cACEC,QACAC,KAAKR,GAAsB,IAAIS,SAAQ,CAACC,EAASC,KAC/CH,KAAKN,GAAsBQ,EAC3BF,KAAKL,GAAqBQ,KAE5BH,KAAKR,GAAoBY,OAAM,UAqBnC,SAASC,EAAcC,GACrB,OAAOA,GAASA,EAAMC,WAAaV,MAAMW,QAAQF,GAQnD,SAASG,EAAOH,GACd,IAAKD,EAAcC,GAAQ,CACzB,MAAMI,EAASJ,EAAMK,YACfC,EAAcF,EAAOE,YAK3B,OAJAF,EAAOE,YAAc,KACnBF,EAAOG,OAAOT,OAAM,eACpBQ,EAAYE,KAAKJ,IAEZA,EAETV,KAAKe,OAAST,EApChBV,EAAYoB,UAAUT,UAAY,WAChC,MAAO,CACLU,KAAMC,gBACElB,KAAKR,GACNQ,KAAKmB,OAGH,CAAEC,MAAOpB,KAAKqB,QAASC,MAAM,GAF3B,CAAEF,WAAOG,EAAWD,MAAM,MAuCzCb,EAAOO,UAAUQ,MAAQN,eAAeO,GACtCzB,KAAKe,OAAOW,KAAKD,IAQnBhB,EAAOO,UAAUW,MAAQT,iBACvBlB,KAAKe,OAAOrB,MAQde,EAAOO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