1 line
2.2 MiB
1 line
2.2 MiB
{"version":3,"file":"openpgp.min.js","sources":["../node_modules/@openpgp/web-stream-tools/lib/writer.js","../node_modules/@openpgp/web-stream-tools/lib/util.js","../node_modules/@openpgp/web-stream-tools/lib/node-conversions.js","../node_modules/@openpgp/web-stream-tools/lib/reader.js","../node_modules/@openpgp/web-stream-tools/lib/streams.js","../src/biginteger/native.interface.js","../src/biginteger/index.js","../src/util.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/cipher/getCipher.js","../src/crypto/mode/cfb.js","../node_modules/@openpgp/asmcrypto.js/dist_es8/aes/ctr.js","../node_modules/@openpgp/asmcrypto.js/dist_es8/aes/cbc.js","../src/crypto/cmac.js","../src/crypto/mode/eax.js","../src/crypto/mode/ocb.js","../node_modules/@openpgp/asmcrypto.js/dist_es8/aes/gcm.js","../src/crypto/mode/gcm.js","../src/crypto/mode/index.js","../node_modules/@openpgp/tweetnacl/nacl-fast-light.js","../src/crypto/random.js","../src/crypto/public_key/prime.js","../src/crypto/pkcs1.js","../src/crypto/public_key/rsa.js","../src/crypto/public_key/elgamal.js","../src/type/oid.js","../src/crypto/public_key/elliptic/indutnyKey.js","../src/packet/packet.js","../src/crypto/public_key/elliptic/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/dsa.js","../src/crypto/public_key/index.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/constants.js","../node_modules/@openpgp/pako/lib/zlib/trees.js","../node_modules/@openpgp/pako/lib/zlib/adler32.js","../node_modules/@openpgp/pako/lib/zlib/crc32.js","../node_modules/@openpgp/pako/lib/zlib/messages.js","../node_modules/@openpgp/pako/lib/zlib/deflate.js","../node_modules/@openpgp/pako/lib/utils/strings.js","../node_modules/@openpgp/pako/lib/zlib/zstream.js","../node_modules/@openpgp/pako/lib/deflate.js","../node_modules/@openpgp/pako/lib/zlib/inffast.js","../node_modules/@openpgp/pako/lib/zlib/inftrees.js","../node_modules/@openpgp/pako/lib/zlib/inflate.js","../node_modules/@openpgp/pako/lib/zlib/gzheader.js","../node_modules/@openpgp/pako/lib/inflate.js","../node_modules/@openpgp/seek-bzip/lib/bitreader.js","../node_modules/@openpgp/seek-bzip/lib/stream.js","../node_modules/@openpgp/seek-bzip/lib/crc32.js","../node_modules/@openpgp/seek-bzip/lib/index.js","../src/packet/literal_data.js","../src/packet/signature.js","../src/packet/one_pass_signature.js","../src/packet/packetlist.js","../src/packet/compressed_data.js","../src/packet/sym_encrypted_integrity_protected_data.js","../src/packet/aead_encrypted_data.js","../src/packet/public_key_encrypted_session_key.js","../src/type/s2k.js","../src/packet/sym_encrypted_session_key.js","../src/packet/public_key.js","../src/packet/symmetrically_encrypted_data.js","../src/packet/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/signature.js","../src/key/helper.js","../src/key/user.js","../src/key/subkey.js","../src/key/key.js","../src/key/public_key.js","../src/key/private_key.js","../src/key/factory.js","../src/message.js","../src/cleartext.js","../src/openpgp.js","../node_modules/@openpgp/web-stream-tools/node_modules/web-streams-polyfill/dist/ponyfill.es6.mjs","../node_modules/@mattiasbuelens/web-streams-adapter/dist/web-streams-adapter.mjs","../node_modules/bn.js/lib/bn.js","../src/biginteger/bn.interface.js","../node_modules/brorand/index.js","../node_modules/minimalistic-crypto-utils/lib/utils.js","../node_modules/@openpgp/elliptic/lib/elliptic/utils.js","../node_modules/@openpgp/elliptic/lib/elliptic/curve/base.js","../node_modules/@openpgp/elliptic/lib/elliptic/curve/short.js","../node_modules/@openpgp/elliptic/lib/elliptic/curve/mont.js","../node_modules/@openpgp/elliptic/lib/elliptic/curve/edwards.js","../node_modules/@openpgp/elliptic/lib/elliptic/curve/index.js","../node_modules/hash.js/lib/hash/sha/1.js","../node_modules/hash.js/lib/hash/sha.js","../node_modules/hash.js/lib/hash/hmac.js","../node_modules/hash.js/lib/hash.js","../node_modules/@openpgp/elliptic/lib/elliptic/precomputed/secp256k1.js","../node_modules/@openpgp/elliptic/lib/elliptic/curves.js","../node_modules/hmac-drbg/lib/hmac-drbg.js","../node_modules/@openpgp/elliptic/lib/elliptic/ec/key.js","../node_modules/@openpgp/elliptic/lib/elliptic/ec/signature.js","../node_modules/@openpgp/elliptic/lib/elliptic/ec/index.js","../node_modules/@openpgp/elliptic/lib/elliptic/eddsa/key.js","../node_modules/@openpgp/elliptic/lib/elliptic/eddsa/signature.js","../node_modules/@openpgp/elliptic/lib/elliptic/eddsa/index.js","../node_modules/@openpgp/elliptic/lib/elliptic.js","../src/packet/marker.js","../src/packet/trust.js"],"sourcesContent":["const doneWritingPromise = Symbol('doneWritingPromise');\nconst doneWritingResolve = Symbol('doneWritingResolve');\nconst doneWritingReject = Symbol('doneWritingReject');\n\nconst readingIndex = Symbol('readingIndex');\n\nclass ArrayStream extends Array {\n constructor() {\n super();\n this[doneWritingPromise] = new Promise((resolve, reject) => {\n this[doneWritingResolve] = resolve;\n this[doneWritingReject] = reject;\n });\n this[doneWritingPromise].catch(() => {});\n }\n}\n\nArrayStream.prototype.getReader = function() {\n if (this[readingIndex] === undefined) {\n this[readingIndex] = 0;\n }\n return {\n read: async () => {\n await this[doneWritingPromise];\n if (this[readingIndex] === this.length) {\n return { value: undefined, done: true };\n }\n return { value: this[this[readingIndex]++], done: false };\n }\n };\n};\n\nArrayStream.prototype.readToEnd = async function(join) {\n await this[doneWritingPromise];\n const result = join(this.slice(this[readingIndex]));\n this.length = 0;\n return result;\n};\n\nArrayStream.prototype.clone = function() {\n const clone = new ArrayStream();\n clone[doneWritingPromise] = this[doneWritingPromise].then(() => {\n clone.push(...this);\n });\n return clone;\n};\n\n/**\n * Check whether data is an ArrayStream\n * @param {Any} input data to check\n * @returns {boolean}\n */\nfunction isArrayStream(input) {\n return input && input.getReader && Array.isArray(input);\n}\n\n/**\n * A wrapper class over the native WritableStreamDefaultWriter.\n * It also lets you \"write data to\" array streams instead of streams.\n * @class\n */\nfunction Writer(input) {\n if (!isArrayStream(input)) {\n const writer = input.getWriter();\n const releaseLock = writer.releaseLock;\n writer.releaseLock = () => {\n writer.closed.catch(function() {});\n releaseLock.call(writer);\n };\n return writer;\n }\n this.stream = input;\n}\n\n/**\n * Write a chunk of data.\n * @returns {Promise<undefined>}\n * @async\n */\nWriter.prototype.write = async function(chunk) {\n this.stream.push(chunk);\n};\n\n/**\n * Close the stream.\n * @returns {Promise<undefined>}\n * @async\n */\nWriter.prototype.close = async function() {\n this.stream[doneWritingResolve]();\n};\n\n/**\n * Error the stream.\n * @returns {Promise<Object>}\n * @async\n */\nWriter.prototype.abort = async function(reason) {\n this.stream[doneWritingReject](reason);\n return reason;\n};\n\n/**\n * Release the writer's lock.\n * @returns {undefined}\n * @async\n */\nWriter.prototype.releaseLock = function() {};\n\n\nexport { ArrayStream, isArrayStream, Writer, doneWritingPromise };\n","import * as streams from './streams';\nimport { isArrayStream } from './writer';\n\nconst isNode = typeof globalThis.process === 'object' &&\n typeof globalThis.process.versions === 'object';\n\nconst NodeReadableStream = isNode && require('stream').Readable;\n\n/**\n * Check whether data is a Stream, and if so of which type\n * @param {Any} input data to check\n * @returns {'web'|'ponyfill'|'node'|'array'|'web-like'|false}\n */\nfunction isStream(input) {\n if (isArrayStream(input)) {\n return 'array';\n }\n if (globalThis.ReadableStream && globalThis.ReadableStream.prototype.isPrototypeOf(input)) {\n return 'web';\n }\n if (streams.ReadableStream && streams.ReadableStream.prototype.isPrototypeOf(input)) {\n return 'ponyfill';\n }\n if (NodeReadableStream && NodeReadableStream.prototype.isPrototypeOf(input)) {\n return 'node';\n }\n if (input && input.getReader) {\n return 'web-like';\n }\n return false;\n}\n\n/**\n * Check whether data is a Uint8Array\n * @param {Any} input data to check\n * @returns {Boolean}\n */\nfunction isUint8Array(input) {\n return Uint8Array.prototype.isPrototypeOf(input);\n}\n\n/**\n * Concat Uint8Arrays\n * @param {Array<Uint8array>} Array of Uint8Arrays to concatenate\n * @returns {Uint8array} Concatenated array\n */\nfunction concatUint8Array(arrays) {\n if (arrays.length === 1) return arrays[0];\n\n let totalLength = 0;\n for (let i = 0; i < arrays.length; i++) {\n if (!isUint8Array(arrays[i])) {\n throw new Error('concatUint8Array: Data must be in the form of a Uint8Array');\n }\n\n totalLength += arrays[i].length;\n }\n\n const result = new Uint8Array(totalLength);\n let pos = 0;\n arrays.forEach(function (element) {\n result.set(element, pos);\n pos += element.length;\n });\n\n return result;\n}\n\nexport { isNode, isStream, isArrayStream, isUint8Array, concatUint8Array };\n","import { isNode } from './util';\nimport * as streams from './streams';\n\nconst NodeBuffer = isNode && require('buffer').Buffer;\nconst NodeReadableStream = isNode && require('stream').Readable;\n\n/**\n * Web / node stream conversion functions\n * From https://github.com/gwicke/node-web-streams\n */\n\nlet nodeToWeb;\nlet webToNode;\n\nif (NodeReadableStream) {\n\n /**\n * Convert a Node Readable Stream to a Web ReadableStream\n * @param {Readable} nodeStream\n * @returns {ReadableStream}\n */\n nodeToWeb = function(nodeStream) {\n let canceled = false;\n return new streams.ReadableStream({\n start(controller) {\n nodeStream.pause();\n nodeStream.on('data', chunk => {\n if (canceled) {\n return;\n }\n if (NodeBuffer.isBuffer(chunk)) {\n chunk = new Uint8Array(chunk.buffer, chunk.byteOffset, chunk.byteLength);\n }\n controller.enqueue(chunk);\n nodeStream.pause();\n });\n nodeStream.on('end', () => {\n if (canceled) {\n return;\n }\n controller.close();\n });\n nodeStream.on('error', e => controller.error(e));\n },\n pull() {\n nodeStream.resume();\n },\n cancel(reason) {\n canceled = true;\n nodeStream.destroy(reason);\n }\n });\n };\n\n\n class NodeReadable extends NodeReadableStream {\n constructor(webStream, options) {\n super(options);\n this._reader = streams.getReader(webStream);\n }\n\n async _read(size) {\n try {\n while (true) {\n const { done, value } = await this._reader.read()\n if (done) {\n this.push(null);\n break;\n }\n if (!this.push(value) || 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';\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 writer = getWriter(output);\n try {\n const data = await readToEnd(input);\n const result1 = process(data);\n const result2 = finish();\n let result;\n if (result1 !== undefined && result2 !== undefined) result = concat([result1, result2]);\n else result = result1 !== undefined ? result1 : result2;\n await writer.write(result);\n await writer.close();\n } catch (e) {\n await writer.abort(e);\n }\n })();\n return output;\n }\n if (isStream(input)) {\n return transformRaw(input, {\n async transform(value, controller) {\n try {\n const result = await process(value);\n if (result !== undefined) controller.enqueue(result);\n } catch(e) {\n controller.error(e);\n }\n },\n async flush(controller) {\n try {\n const result = await finish();\n if (result !== undefined) controller.enqueue(result);\n } catch(e) {\n controller.error(e);\n }\n }\n });\n }\n const result1 = process(input);\n const result2 = finish();\n if (result1 !== undefined && result2 !== undefined) return concat([result1, result2]);\n return result1 !== undefined ? result1 : result2;\n}\n\n/**\n * Transform a stream using a helper function which is passed a readable and a writable stream.\n * This function also maintains the possibility to cancel the input stream,\n * and does so on cancelation of the output stream, despite cancelation\n * normally being impossible when the input stream is being read from.\n * @param {ReadableStream|Uint8array|String} input\n * @param {Function} fn\n * @returns {ReadableStream}\n */\nfunction transformPair(input, fn) {\n if (isStream(input) && !isArrayStream(input)) {\n let incomingTransformController;\n const incoming = new TransformStream({\n start(controller) {\n incomingTransformController = controller;\n }\n });\n\n const pipeDonePromise = pipe(input, incoming.writable);\n\n const outgoing = transformWithCancel(async function(reason) {\n incomingTransformController.error(reason);\n await pipeDonePromise;\n await new Promise(setTimeout);\n });\n fn(incoming.readable, outgoing.writable);\n return outgoing.readable;\n }\n input = toArrayStream(input);\n const output = new ArrayStream();\n fn(input, output);\n return output;\n}\n\n/**\n * Parse a stream using a helper function which is passed a Reader.\n * The reader additionally has a remainder() method which returns a\n * stream pointing to the remainder of input, and is linked to input\n * for cancelation.\n * @param {ReadableStream|Uint8array|String} input\n * @param {Function} fn\n * @returns {Any} the return value of fn()\n */\nfunction parse(input, fn) {\n let returnValue;\n const transformed = transformPair(input, (readable, writable) => {\n const reader = getReader(readable);\n reader.remainder = () => {\n reader.releaseLock();\n pipe(readable, writable);\n return transformed;\n };\n returnValue = fn(reader);\n });\n return returnValue;\n}\n\n/**\n * Tee a Stream for reading it twice. The input stream can no longer be read after tee()ing.\n * Reading either of the two returned streams will pull from the input stream.\n * The input stream will only be canceled if both of the returned streams are canceled.\n * @param {ReadableStream|Uint8array|String} input\n * @returns {Array<ReadableStream|Uint8array|String>} array containing two copies of input\n */\nfunction tee(input) {\n if (isArrayStream(input)) {\n throw new Error('ArrayStream cannot be tee()d, use clone() instead');\n }\n if (isStream(input)) {\n const teed = toStream(input).tee();\n teed[0][externalBuffer] = teed[1][externalBuffer] = input[externalBuffer];\n return teed;\n }\n return [slice(input), slice(input)];\n}\n\n/**\n * Clone a Stream for reading it twice. The input stream can still be read after clone()ing.\n * Reading from the clone will pull from the input stream.\n * The input stream will only be canceled if both the clone and the input stream are canceled.\n * @param {ReadableStream|Uint8array|String} input\n * @returns {ReadableStream|Uint8array|String} cloned input\n */\nfunction clone(input) {\n if (isArrayStream(input)) {\n return input.clone();\n }\n if (isStream(input)) {\n const teed = tee(input);\n overwrite(input, teed[0]);\n return teed[1];\n }\n return slice(input);\n}\n\n/**\n * Clone a Stream for reading it twice. Data will arrive at the same rate as the input stream is being read.\n * Reading from the clone will NOT pull from the input stream. Data only arrives when reading the input stream.\n * The input stream will NOT be canceled if the clone is canceled, only if the input stream are canceled.\n * If the input stream is canceled, the clone will be errored.\n * @param {ReadableStream|Uint8array|String} input\n * @returns {ReadableStream|Uint8array|String} cloned input\n */\nfunction passiveClone(input) {\n if (isArrayStream(input)) {\n return clone(input);\n }\n if (isStream(input)) {\n return new ReadableStream({\n start(controller) {\n const transformed = transformPair(input, async (readable, writable) => {\n const reader = getReader(readable);\n const writer = getWriter(writable);\n try {\n while (true) {\n await writer.ready;\n const { done, value } = await reader.read();\n if (done) {\n try { controller.close(); } catch(e) {}\n await writer.close();\n return;\n }\n try { controller.enqueue(value); } catch(e) {}\n await writer.write(value);\n }\n } catch(e) {\n controller.error(e);\n await writer.abort(e);\n }\n });\n overwrite(input, transformed);\n }\n });\n }\n return slice(input);\n}\n\n/**\n * Modify a stream object to point to a different stream object.\n * This is used internally by clone() and passiveClone() to provide an abstraction over tee().\n * @param {ReadableStream} input\n * @param {ReadableStream} clone\n */\nfunction overwrite(input, clone) {\n // Overwrite input.getReader, input.locked, etc to point to clone\n Object.entries(Object.getOwnPropertyDescriptors(input.constructor.prototype)).forEach(([name, descriptor]) => {\n if (name === 'constructor') {\n return;\n }\n if (descriptor.value) {\n descriptor.value = descriptor.value.bind(clone);\n } else {\n descriptor.get = descriptor.get.bind(clone);\n }\n Object.defineProperty(input, name, descriptor);\n });\n}\n\n/**\n * Return a stream pointing to a part of the input stream.\n * @param {ReadableStream|Uint8array|String} input\n * @returns {ReadableStream|Uint8array|String} clone\n */\nfunction slice(input, begin=0, end=Infinity) {\n if (isArrayStream(input)) {\n throw new Error('Not implemented');\n }\n if (isStream(input)) {\n if (begin >= 0 && end >= 0) {\n let bytesRead = 0;\n return transformRaw(input, {\n transform(value, controller) {\n if (bytesRead < end) {\n if (bytesRead + value.length >= begin) {\n controller.enqueue(slice(value, Math.max(begin - bytesRead, 0), end - bytesRead));\n }\n bytesRead += value.length;\n } else {\n controller.terminate();\n }\n }\n });\n }\n if (begin < 0 && (end < 0 || end === Infinity)) {\n let lastBytes = [];\n return transform(input, value => {\n if (value.length >= -begin) lastBytes = [value];\n else lastBytes.push(value);\n }, () => slice(concat(lastBytes), begin, end));\n }\n if (begin === 0 && end < 0) {\n let lastBytes;\n return transform(input, value => {\n const returnValue = lastBytes ? concat([lastBytes, value]) : value;\n if (returnValue.length >= -end) {\n lastBytes = slice(returnValue, end);\n return slice(returnValue, begin, end);\n } else {\n lastBytes = returnValue;\n }\n });\n }\n console.warn(`stream.slice(input, ${begin}, ${end}) not implemented efficiently.`);\n return fromAsync(async () => slice(await readToEnd(input), begin, end));\n }\n if (input[externalBuffer]) {\n input = concat(input[externalBuffer].concat([input]));\n }\n if (isUint8Array(input) && !(NodeBuffer && NodeBuffer.isBuffer(input))) {\n if (end === Infinity) end = input.length;\n return input.subarray(begin, end);\n }\n return input.slice(begin, end);\n}\n\n/**\n * Read a stream to the end and return its contents, concatenated by the join function (defaults to concat).\n * @param {ReadableStream|Uint8array|String} input\n * @param {Function} join\n * @returns {Promise<Uint8array|String|Any>} the return value of join()\n * @async\n */\nasync function readToEnd(input, join=concat) {\n if (isArrayStream(input)) {\n return input.readToEnd(join);\n }\n if (isStream(input)) {\n return getReader(input).readToEnd(join);\n }\n return input;\n}\n\n/**\n * Cancel a stream.\n * @param {ReadableStream|Uint8array|String} input\n * @param {Any} reason\n * @returns {Promise<Any>} indicates when the stream has been canceled\n * @async\n */\nasync function cancel(input, reason) {\n if (isStream(input)) {\n if (input.cancel) {\n return input.cancel(reason);\n }\n if (input.destroy) {\n input.destroy(reason);\n await new Promise(setTimeout);\n return reason;\n }\n }\n}\n\n/**\n * Convert an async function to an ArrayStream. When the function returns, its return value is written to the stream.\n * @param {Function} fn\n * @returns {ArrayStream}\n */\nfunction fromAsync(fn) {\n const arrayStream = new ArrayStream();\n (async () => {\n const writer = getWriter(arrayStream);\n try {\n await writer.write(await fn());\n await writer.close();\n } catch (e) {\n await writer.abort(e);\n }\n })();\n return arrayStream;\n}\n\n\nexport { ReadableStream, WritableStream, TransformStream, ArrayStream, loadStreamsPonyfill, isStream, isArrayStream, isUint8Array, toStream, toPonyfillReadable, toNativeReadable, concatUint8Array, concatStream, concat, getReader, getWriter, pipe, transformRaw, transform, transformPair, parse, clone, passiveClone, slice, readToEnd, cancel, fromAsync, nodeToWeb, webToNode };\n","/* eslint-disable new-cap */\n\n/**\n * @fileoverview\n * BigInteger implementation of basic operations\n * that wraps the native BigInt library.\n * Operations are not constant time,\n * but we try and limit timing leakage where we can\n * @module biginteger/native\n * @private\n */\n\n/**\n * @private\n */\nexport default class BigInteger {\n /**\n * Get a BigInteger (input must be big endian for strings and arrays)\n * @param {Number|String|Uint8Array} n - Value to convert\n * @throws {Error} on null or undefined input\n */\n constructor(n) {\n if (n === undefined) {\n throw new Error('Invalid BigInteger input');\n }\n\n if (n instanceof Uint8Array) {\n const bytes = n;\n const hex = new Array(bytes.length);\n for (let i = 0; i < bytes.length; i++) {\n const hexByte = bytes[i].toString(16);\n hex[i] = (bytes[i] <= 0xF) ? ('0' + hexByte) : hexByte;\n }\n this.value = BigInt('0x0' + hex.join(''));\n } else {\n this.value = BigInt(n);\n }\n }\n\n clone() {\n return new BigInteger(this.value);\n }\n\n /**\n * BigInteger increment in place\n */\n iinc() {\n this.value++;\n return this;\n }\n\n /**\n * BigInteger increment\n * @returns {BigInteger} this + 1.\n */\n inc() {\n return this.clone().iinc();\n }\n\n /**\n * BigInteger decrement in place\n */\n idec() {\n this.value--;\n return this;\n }\n\n /**\n * BigInteger decrement\n * @returns {BigInteger} this - 1.\n */\n dec() {\n return this.clone().idec();\n }\n\n /**\n * BigInteger addition in place\n * @param {BigInteger} x - Value to add\n */\n iadd(x) {\n this.value += x.value;\n return this;\n }\n\n /**\n * BigInteger addition\n * @param {BigInteger} x - Value to add\n * @returns {BigInteger} this + x.\n */\n add(x) {\n return this.clone().iadd(x);\n }\n\n /**\n * BigInteger subtraction in place\n * @param {BigInteger} x - Value to subtract\n */\n isub(x) {\n this.value -= x.value;\n return this;\n }\n\n /**\n * BigInteger subtraction\n * @param {BigInteger} x - Value to subtract\n * @returns {BigInteger} this - x.\n */\n sub(x) {\n return this.clone().isub(x);\n }\n\n /**\n * BigInteger multiplication in place\n * @param {BigInteger} x - Value to multiply\n */\n imul(x) {\n this.value *= x.value;\n return this;\n }\n\n /**\n * BigInteger multiplication\n * @param {BigInteger} x - Value to multiply\n * @returns {BigInteger} this * x.\n */\n mul(x) {\n return this.clone().imul(x);\n }\n\n /**\n * Compute value modulo m, in place\n * @param {BigInteger} m - Modulo\n */\n imod(m) {\n this.value %= m.value;\n if (this.isNegative()) {\n this.iadd(m);\n }\n return this;\n }\n\n /**\n * Compute value modulo m\n * @param {BigInteger} m - Modulo\n * @returns {BigInteger} this mod m.\n */\n mod(m) {\n return this.clone().imod(m);\n }\n\n /**\n * Compute modular exponentiation using square and multiply\n * @param {BigInteger} e - Exponent\n * @param {BigInteger} n - Modulo\n * @returns {BigInteger} this ** e mod n.\n */\n modExp(e, n) {\n if (n.isZero()) throw Error('Modulo cannot be zero');\n if (n.isOne()) return new BigInteger(0);\n if (e.isNegative()) throw Error('Unsopported negative exponent');\n\n let exp = e.value;\n let x = this.value;\n\n x %= n.value;\n let r = BigInt(1);\n while (exp > BigInt(0)) {\n const lsb = exp & BigInt(1);\n exp >>= BigInt(1); // e / 2\n // Always compute multiplication step, to reduce timing leakage\n const rx = (r * x) % n.value;\n // Update r only if lsb is 1 (odd exponent)\n r = lsb ? rx : r;\n x = (x * x) % n.value; // Square\n }\n return new BigInteger(r);\n }\n\n\n /**\n * Compute the inverse of this value modulo n\n * Note: this and and n must be relatively prime\n * @param {BigInteger} n - Modulo\n * @returns {BigInteger} x such that this*x = 1 mod n\n * @throws {Error} if the inverse does not exist\n */\n modInv(n) {\n const { gcd, x } = this._egcd(n);\n if (!gcd.isOne()) {\n throw new Error('Inverse does not exist');\n }\n return x.add(n).mod(n);\n }\n\n /**\n * Extended Eucleadian algorithm (http://anh.cs.luc.edu/331/notes/xgcd.pdf)\n * Given a = this and b, compute (x, y) such that ax + by = gdc(a, b)\n * @param {BigInteger} b - Second operand\n * @returns {{ gcd, x, y: BigInteger }}\n */\n _egcd(b) {\n let x = BigInt(0);\n let y = BigInt(1);\n let xPrev = BigInt(1);\n let yPrev = BigInt(0);\n\n let a = this.value;\n b = b.value;\n\n while (b !== BigInt(0)) {\n const q = a / b;\n let tmp = x;\n x = xPrev - q * x;\n xPrev = tmp;\n\n tmp = y;\n y = yPrev - q * y;\n yPrev = tmp;\n\n tmp = b;\n b = a % b;\n a = tmp;\n }\n\n return {\n x: new BigInteger(xPrev),\n y: new BigInteger(yPrev),\n gcd: new BigInteger(a)\n };\n }\n\n /**\n * Compute greatest common divisor between this and n\n * @param {BigInteger} b - Operand\n * @returns {BigInteger} gcd\n */\n gcd(b) {\n let a = this.value;\n b = b.value;\n while (b !== BigInt(0)) {\n const tmp = b;\n b = a % b;\n a = tmp;\n }\n return new BigInteger(a);\n }\n\n /**\n * Shift this to the left by x, in place\n * @param {BigInteger} x - Shift value\n */\n ileftShift(x) {\n this.value <<= x.value;\n return this;\n }\n\n /**\n * Shift this to the left by x\n * @param {BigInteger} x - Shift value\n * @returns {BigInteger} this << x.\n */\n leftShift(x) {\n return this.clone().ileftShift(x);\n }\n\n /**\n * Shift this to the right by x, in place\n * @param {BigInteger} x - Shift value\n */\n irightShift(x) {\n this.value >>= x.value;\n return this;\n }\n\n /**\n * Shift this to the right by x\n * @param {BigInteger} x - Shift value\n * @returns {BigInteger} this >> x.\n */\n rightShift(x) {\n return this.clone().irightShift(x);\n }\n\n /**\n * Whether this value is equal to x\n * @param {BigInteger} x\n * @returns {Boolean}\n */\n equal(x) {\n return this.value === x.value;\n }\n\n /**\n * Whether this value is less than x\n * @param {BigInteger} x\n * @returns {Boolean}\n */\n lt(x) {\n return this.value < x.value;\n }\n\n /**\n * Whether this value is less than or equal to x\n * @param {BigInteger} x\n * @returns {Boolean}\n */\n lte(x) {\n return this.value <= x.value;\n }\n\n /**\n * Whether this value is greater than x\n * @param {BigInteger} x\n * @returns {Boolean}\n */\n gt(x) {\n return this.value > x.value;\n }\n\n /**\n * Whether this value is greater than or equal to x\n * @param {BigInteger} x\n * @returns {Boolean}\n */\n gte(x) {\n return this.value >= x.value;\n }\n\n isZero() {\n return this.value === BigInt(0);\n }\n\n isOne() {\n return this.value === BigInt(1);\n }\n\n isNegative() {\n return this.value < BigInt(0);\n }\n\n isEven() {\n return !(this.value & BigInt(1));\n }\n\n abs() {\n const res = this.clone();\n if (this.isNegative()) {\n res.value = -res.value;\n }\n return res;\n }\n\n /**\n * Get this value as a string\n * @returns {String} this value.\n */\n toString() {\n return this.value.toString();\n }\n\n /**\n * Get this value as an exact Number (max 53 bits)\n * Fails if this value is too large\n * @returns {Number}\n */\n toNumber() {\n const number = Number(this.value);\n if (number > Number.MAX_SAFE_INTEGER) {\n // We throw and error to conform with the bn.js implementation\n throw new Error('Number can only safely store up to 53 bits');\n }\n return number;\n }\n\n /**\n * Get value of i-th bit\n * @param {Number} i - Bit index\n * @returns {Number} Bit value.\n */\n getBit(i) {\n const bit = (this.value >> BigInt(i)) & BigInt(1);\n return (bit === BigInt(0)) ? 0 : 1;\n }\n\n /**\n * Compute bit length\n * @returns {Number} Bit length.\n */\n bitLength() {\n const zero = new BigInteger(0);\n const one = new BigInteger(1);\n const negOne = new BigInteger(-1);\n\n // -1n >> -1n is -1n\n // 1n >> 1n is 0n\n const target = this.isNegative() ? negOne : zero;\n let bitlen = 1;\n const tmp = this.clone();\n while (!tmp.irightShift(one).equal(target)) {\n bitlen++;\n }\n return bitlen;\n }\n\n /**\n * Compute byte length\n * @returns {Number} Byte length.\n */\n byteLength() {\n const zero = new BigInteger(0);\n const negOne = new BigInteger(-1);\n\n const target = this.isNegative() ? negOne : zero;\n const eight = new BigInteger(8);\n let len = 1;\n const tmp = this.clone();\n while (!tmp.irightShift(eight).equal(target)) {\n len++;\n }\n return len;\n }\n\n /**\n * Get Uint8Array representation of this number\n * @param {String} endian - Endianess of output array (defaults to 'be')\n * @param {Number} length - Of output array\n * @returns {Uint8Array}\n */\n toUint8Array(endian = 'be', length) {\n // we get and parse the hex string (https://coolaj86.com/articles/convert-js-bigints-to-typedarrays/)\n // this is faster than shift+mod iterations\n let hex = this.value.toString(16);\n if (hex.length % 2 === 1) {\n hex = '0' + hex;\n }\n\n const rawLength = hex.length / 2;\n const bytes = new Uint8Array(length || rawLength);\n // parse hex\n const offset = length ? (length - rawLength) : 0;\n let i = 0;\n while (i < rawLength) {\n bytes[i + offset] = parseInt(hex.slice(2 * i, 2 * i + 2), 16);\n i++;\n }\n\n if (endian !== 'be') {\n bytes.reverse();\n }\n\n return bytes;\n }\n}\n","import BigInteger from './native.interface';\n\nconst detectBigInt = () => typeof BigInt !== 'undefined';\n\nasync function getBigInteger() {\n if (detectBigInt()) {\n return BigInteger;\n } else {\n const { default: BigInteger } = await import('./bn.interface');\n return BigInteger;\n }\n}\n\nexport { getBigInteger };\n","// 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 = (() => {\n try {\n return process.env.NODE_ENV === 'development'; // eslint-disable-line no-process-env\n } catch (e) {}\n return false;\n})();\n\nconst util = {\n isString: function(data) {\n return typeof data === 'string' || data instanceof String;\n },\n\n isArray: function(data) {\n return data instanceof Array;\n },\n\n isUint8Array: stream.isUint8Array,\n\n isStream: stream.isStream,\n\n readNumber: function (bytes) {\n let n = 0;\n for (let i = 0; i < bytes.length; i++) {\n n += (256 ** i) * bytes[bytes.length - 1 - i];\n }\n return n;\n },\n\n writeNumber: function (n, bytes) {\n const b = new Uint8Array(bytes);\n for (let i = 0; i < bytes; i++) {\n b[i] = (n >> (8 * (bytes - i - 1))) & 0xFF;\n }\n\n return b;\n },\n\n readDate: function (bytes) {\n const n = util.readNumber(bytes);\n const d = new Date(n * 1000);\n return d;\n },\n\n writeDate: function (time) {\n const numeric = Math.floor(time.getTime() / 1000);\n\n return util.writeNumber(numeric, 4);\n },\n\n normalizeDate: function (time = Date.now()) {\n return time === null || time === Infinity ? time : new Date(Math.floor(+time / 1000) * 1000);\n },\n\n /**\n * Read one MPI from bytes in input\n * @param {Uint8Array} bytes - Input data to parse\n * @returns {Uint8Array} Parsed MPI.\n */\n readMPI: function (bytes) {\n const bits = (bytes[0] << 8) | bytes[1];\n const bytelen = (bits + 7) >>> 3;\n return bytes.subarray(2, 2 + bytelen);\n },\n\n /**\n * Left-pad Uint8Array to length by adding 0x0 bytes\n * @param {Uint8Array} bytes - Data to pad\n * @param {Number} length - Padded length\n * @returns {Uint8Array} Padded bytes.\n */\n leftPad(bytes, length) {\n const padded = new Uint8Array(length);\n const offset = length - bytes.length;\n padded.set(bytes, offset);\n return padded;\n },\n\n /**\n * Convert a Uint8Array to an MPI-formatted Uint8Array.\n * @param {Uint8Array} bin - An array of 8-bit integers to convert\n * @returns {Uint8Array} MPI-formatted Uint8Array.\n */\n uint8ArrayToMPI: function (bin) {\n const bitSize = util.uint8ArrayBitLength(bin);\n if (bitSize === 0) {\n throw new Error('Zero MPI');\n }\n const stripped = bin.subarray(bin.length - Math.ceil(bitSize / 8));\n const prefix = new Uint8Array([(bitSize & 0xFF00) >> 8, bitSize & 0xFF]);\n return util.concatUint8Array([prefix, stripped]);\n },\n\n /**\n * Return bit length of the input data\n * @param {Uint8Array} bin input data (big endian)\n * @returns bit length\n */\n uint8ArrayBitLength: function (bin) {\n let i; // index of leading non-zero byte\n for (i = 0; i < bin.length; i++) if (bin[i] !== 0) break;\n if (i === bin.length) {\n return 0;\n }\n const stripped = bin.subarray(i);\n return (stripped.length - 1) * 8 + util.nbits(stripped[0]);\n },\n\n /**\n * Convert a hex string to an array of 8-bit integers\n * @param {String} hex - A hex string to convert\n * @returns {Uint8Array} An array of 8-bit integers.\n */\n hexToUint8Array: function (hex) {\n const result = new Uint8Array(hex.length >> 1);\n for (let k = 0; k < hex.length >> 1; k++) {\n result[k] = parseInt(hex.substr(k << 1, 2), 16);\n }\n return result;\n },\n\n /**\n * Convert an array of 8-bit integers to a hex string\n * @param {Uint8Array} bytes - Array of 8-bit integers to convert\n * @returns {String} Hexadecimal representation of the array.\n */\n uint8ArrayToHex: function (bytes) {\n const r = [];\n const e = bytes.length;\n let c = 0;\n let h;\n while (c < e) {\n h = bytes[c++].toString(16);\n while (h.length < 2) {\n h = '0' + h;\n }\n r.push('' + h);\n }\n return r.join('');\n },\n\n /**\n * Convert a string to an array of 8-bit integers\n * @param {String} str - String to convert\n * @returns {Uint8Array} An array of 8-bit integers.\n */\n stringToUint8Array: function (str) {\n return stream.transform(str, str => {\n if (!util.isString(str)) {\n throw new Error('stringToUint8Array: Data must be in the form of a string');\n }\n\n const result = new Uint8Array(str.length);\n for (let i = 0; i < str.length; i++) {\n result[i] = str.charCodeAt(i);\n }\n return result;\n });\n },\n\n /**\n * Convert an array of 8-bit integers to a string\n * @param {Uint8Array} bytes - An array of 8-bit integers to convert\n * @returns {String} String representation of the array.\n */\n uint8ArrayToString: function (bytes) {\n bytes = new Uint8Array(bytes);\n const result = [];\n const bs = 1 << 14;\n const j = bytes.length;\n\n for (let i = 0; i < j; i += bs) {\n result.push(String.fromCharCode.apply(String, bytes.subarray(i, i + bs < j ? i + bs : j)));\n }\n return result.join('');\n },\n\n /**\n * Convert a native javascript string to a Uint8Array of utf8 bytes\n * @param {String|ReadableStream} str - The string to convert\n * @returns {Uint8Array|ReadableStream} A valid squence of utf8 bytes.\n */\n encodeUTF8: function (str) {\n const encoder = new TextEncoder('utf-8');\n // eslint-disable-next-line no-inner-declarations\n function process(value, lastChunk = false) {\n return encoder.encode(value, { stream: !lastChunk });\n }\n return stream.transform(str, process, () => process('', true));\n },\n\n /**\n * Convert a Uint8Array of utf8 bytes to a native javascript string\n * @param {Uint8Array|ReadableStream} utf8 - A valid squence of utf8 bytes\n * @returns {String|ReadableStream} A native javascript string.\n */\n decodeUTF8: function (utf8) {\n const decoder = new TextDecoder('utf-8');\n // eslint-disable-next-line no-inner-declarations\n function process(value, lastChunk = false) {\n return decoder.decode(value, { stream: !lastChunk });\n }\n return stream.transform(utf8, process, () => process(new Uint8Array(), true));\n },\n\n /**\n * Concat a list of Uint8Arrays, Strings or Streams\n * The caller must not mix Uint8Arrays with Strings, but may mix Streams with non-Streams.\n * @param {Array<Uint8Array|String|ReadableStream>} Array - Of Uint8Arrays/Strings/Streams to concatenate\n * @returns {Uint8Array|String|ReadableStream} Concatenated array.\n */\n concat: stream.concat,\n\n /**\n * Concat Uint8Arrays\n * @param {Array<Uint8Array>} Array - Of Uint8Arrays to concatenate\n * @returns {Uint8Array} Concatenated array.\n */\n concatUint8Array: stream.concatUint8Array,\n\n /**\n * Check Uint8Array equality\n * @param {Uint8Array} array1 - First array\n * @param {Uint8Array} array2 - Second array\n * @returns {Boolean} Equality.\n */\n equalsUint8Array: function (array1, array2) {\n if (!util.isUint8Array(array1) || !util.isUint8Array(array2)) {\n throw new Error('Data must be in the form of a Uint8Array');\n }\n\n if (array1.length !== array2.length) {\n return false;\n }\n\n for (let i = 0; i < array1.length; i++) {\n if (array1[i] !== array2[i]) {\n return false;\n }\n }\n return true;\n },\n\n /**\n * Calculates a 16bit sum of a Uint8Array by adding each character\n * codes modulus 65535\n * @param {Uint8Array} Uint8Array - To create a sum of\n * @returns {Uint8Array} 2 bytes containing the sum of all charcodes % 65535.\n */\n writeChecksum: function (text) {\n let s = 0;\n for (let i = 0; i < text.length; i++) {\n s = (s + text[i]) & 0xFFFF;\n }\n return util.writeNumber(s, 2);\n },\n\n /**\n * Helper function to print a debug message. Debug\n * messages are only printed if\n * @param {String} str - String of the debug message\n */\n printDebug: function (str) {\n if (debugMode) {\n console.log('[OpenPGP.js debug]', str);\n }\n },\n\n /**\n * Helper function to print a debug error. Debug\n * messages are only printed if\n * @param {String} str - String of the debug message\n */\n printDebugError: function (error) {\n if (debugMode) {\n console.error('[OpenPGP.js debug]', error);\n }\n },\n\n // returns bit length of the integer x\n nbits: function (x) {\n let r = 1;\n let t = x >>> 16;\n if (t !== 0) {\n x = t;\n r += 16;\n }\n t = x >> 8;\n if (t !== 0) {\n x = t;\n r += 8;\n }\n t = x >> 4;\n if (t !== 0) {\n x = t;\n r += 4;\n }\n t = x >> 2;\n if (t !== 0) {\n x = t;\n r += 2;\n }\n t = x >> 1;\n if (t !== 0) {\n x = t;\n r += 1;\n }\n return r;\n },\n\n /**\n * If S[1] == 0, then double(S) == (S[2..128] || 0);\n * otherwise, double(S) == (S[2..128] || 0) xor\n * (zeros(120) || 10000111).\n *\n * Both OCB and EAX (through CMAC) require this function to be constant-time.\n *\n * @param {Uint8Array} data\n */\n double: function(data) {\n const doubleVar = new Uint8Array(data.length);\n const last = data.length - 1;\n for (let i = 0; i < last; i++) {\n doubleVar[i] = (data[i] << 1) ^ (data[i + 1] >> 7);\n }\n doubleVar[last] = (data[last] << 1) ^ ((data[0] >> 7) * 0x87);\n return doubleVar;\n },\n\n /**\n * Shift a Uint8Array to the right by n bits\n * @param {Uint8Array} array - The array to shift\n * @param {Integer} bits - Amount of bits to shift (MUST be smaller\n * than 8)\n * @returns {String} Resulting array.\n */\n shiftRight: function (array, bits) {\n if (bits) {\n for (let i = array.length - 1; i >= 0; i--) {\n array[i] >>= bits;\n if (i > 0) {\n array[i] |= (array[i - 1] << (8 - bits));\n }\n }\n }\n return array;\n },\n\n /**\n * Get native Web Cryptography api, only the current version of the spec.\n * @returns {Object} The SubtleCrypto api or 'undefined'.\n */\n getWebCrypto: function() {\n return typeof globalThis !== 'undefined' && globalThis.crypto && globalThis.crypto.subtle;\n },\n\n /**\n * Get BigInteger class\n * It wraps the native BigInt type if it's available\n * Otherwise it relies on bn.js\n * @returns {BigInteger}\n * @async\n */\n getBigInteger,\n\n /**\n * Get native Node.js crypto api.\n * @returns {Object} The crypto module or 'undefined'.\n */\n getNodeCrypto: function() {\n return require('crypto');\n },\n\n getNodeZlib: function() {\n return require('zlib');\n },\n\n /**\n * Get native Node.js Buffer constructor. This should be used since\n * Buffer is not available under browserify.\n * @returns {Function} The Buffer constructor or 'undefined'.\n */\n getNodeBuffer: function() {\n return (require('buffer') || {}).Buffer;\n },\n\n getHardwareConcurrency: function() {\n if (typeof navigator !== 'undefined') {\n return navigator.hardwareConcurrency || 1;\n }\n\n const os = require('os'); // Assume we're on Node.js.\n return os.cpus().length;\n },\n\n isEmailAddress: function(data) {\n if (!util.isString(data)) {\n return false;\n }\n const re = /^(([^<>()[\\]\\\\.,;:\\s@\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+([a-zA-Z]{2,}|xn--[a-zA-Z\\-0-9]+)))$/;\n return re.test(data);\n },\n\n /**\n * Normalize line endings to <CR><LF>\n * Support any encoding where CR=0x0D, LF=0x0A\n */\n canonicalizeEOL: function(data) {\n const CR = 13;\n const LF = 10;\n let carryOverCR = false;\n\n return stream.transform(data, bytes => {\n if (carryOverCR) {\n bytes = util.concatUint8Array([new Uint8Array([CR]), bytes]);\n }\n\n if (bytes[bytes.length - 1] === CR) {\n carryOverCR = true;\n bytes = bytes.subarray(0, -1);\n } else {\n carryOverCR = false;\n }\n\n let index;\n const indices = [];\n for (let i = 0; ; i = index) {\n index = bytes.indexOf(LF, i) + 1;\n if (index) {\n if (bytes[index - 2] !== CR) indices.push(index);\n } else {\n break;\n }\n }\n if (!indices.length) {\n return bytes;\n }\n\n const normalized = new Uint8Array(bytes.length + indices.length);\n let j = 0;\n for (let i = 0; i < indices.length; i++) {\n const sub = bytes.subarray(indices[i - 1] || 0, indices[i]);\n normalized.set(sub, j);\n j += sub.length;\n normalized[j - 1] = CR;\n normalized[j] = LF;\n j++;\n }\n normalized.set(bytes.subarray(indices[indices.length - 1] || 0), j);\n return normalized;\n }, () => (carryOverCR ? new Uint8Array([CR]) : undefined));\n },\n\n /**\n * Convert line endings from canonicalized <CR><LF> to native <LF>\n * Support any encoding where CR=0x0D, LF=0x0A\n */\n nativeEOL: function(data) {\n const CR = 13;\n const LF = 10;\n let carryOverCR = false;\n\n return stream.transform(data, bytes => {\n if (carryOverCR && bytes[0] !== LF) {\n bytes = util.concatUint8Array([new Uint8Array([CR]), bytes]);\n } else {\n bytes = new Uint8Array(bytes); // Don't mutate passed bytes\n }\n\n if (bytes[bytes.length - 1] === CR) {\n carryOverCR = true;\n bytes = bytes.subarray(0, -1);\n } else {\n carryOverCR = false;\n }\n\n let index;\n let j = 0;\n for (let i = 0; i !== bytes.length; i = index) {\n index = bytes.indexOf(CR, i) + 1;\n if (!index) index = bytes.length;\n const last = index - (bytes[index] === LF ? 1 : 0);\n if (i) bytes.copyWithin(j, i, last);\n j += last - i;\n }\n return bytes.subarray(0, j);\n }, () => (carryOverCR ? new Uint8Array([CR]) : undefined));\n },\n\n /**\n * Remove trailing spaces, carriage returns and tabs from each line\n */\n removeTrailingSpaces: function(text) {\n return text.split('\\n').map(line => {\n let i = line.length - 1;\n for (; i >= 0 && (line[i] === ' ' || line[i] === '\\t' || line[i] === '\\r'); i--);\n return line.substr(0, i + 1);\n }).join('\\n');\n },\n\n wrapError: function(message, error) {\n if (!error) {\n return new Error(message);\n }\n\n // update error message\n try {\n error.message = message + ': ' + error.message;\n } catch (e) {}\n\n return error;\n },\n\n /**\n * Map allowed packet tags to corresponding classes\n * Meant to be used to format `allowedPacket` for Packetlist.read\n * @param {Array<Object>} allowedClasses\n * @returns {Object} map from enum.packet to corresponding *Packet class\n */\n constructAllowedPackets: function(allowedClasses) {\n const map = {};\n allowedClasses.forEach(PacketClass => {\n if (!PacketClass.tag) {\n throw new Error('Invalid input: expected a packet class');\n }\n map[PacketClass.tag] = PacketClass;\n });\n return map;\n },\n\n /**\n * Return a Promise that will resolve as soon as one of the promises in input resolves\n * or will reject if all input promises all rejected\n * (similar to Promise.any, but with slightly different error handling)\n * @param {Array<Promise>} promises\n * @return {Promise<Any>} Promise resolving to the result of the fastest fulfilled promise\n * or rejected with the Error of the last resolved Promise (if all promises are rejected)\n */\n anyPromise: function(promises) {\n // eslint-disable-next-line no-async-promise-executor\n return new Promise(async (resolve, reject) => {\n let exception;\n await Promise.all(promises.map(async promise => {\n try {\n resolve(await promise);\n } catch (e) {\n exception = e;\n }\n }));\n reject(exception);\n });\n },\n\n /**\n * Return either `a` or `b` based on `cond`, in algorithmic constant time.\n * @param {Boolean} cond\n * @param {Uint8Array} a\n * @param {Uint8Array} b\n * @returns `a` if `cond` is true, `b` otherwise\n */\n selectUint8Array: function(cond, a, b) {\n const length = Math.max(a.length, b.length);\n const result = new Uint8Array(length);\n let end = 0;\n for (let i = 0; i < result.length; i++) {\n result[i] = (a[i] & (256 - cond)) | (b[i] & (255 + cond));\n end += (cond & i < a.length) | ((1 - cond) & i < b.length);\n }\n return result.subarray(0, end);\n },\n /**\n * Return either `a` or `b` based on `cond`, in algorithmic constant time.\n * NB: it only supports `a, b` with values between 0-255.\n * @param {Boolean} cond\n * @param {Uint8} a\n * @param {Uint8} b\n * @returns `a` if `cond` is true, `b` otherwise\n */\n selectUint8: function(cond, a, b) {\n return (a & (256 - cond)) | (b & (255 + cond));\n }\n};\n\nexport default util;\n","/* OpenPGP radix-64/base64 string encoding/decoding\n * Copyright 2005 Herbert Hanewinkel, www.haneWIN.de\n * version 1.0, check www.haneWIN.de for the latest version\n *\n * This software is provided as-is, without express or implied warranty.\n * Permission to use, copy, modify, distribute or sell this software, with or\n * without fee, for any purpose and by any individual or organization, is hereby\n * granted, provided that the above copyright notice and this paragraph appear\n * in all copies. Distribution as a part of an application or binary must\n * include the above copyright notice in the documentation and/or other materials\n * provided with the application or distribution.\n */\n\n/**\n * @module encoding/base64\n * @private\n */\n\nimport * as stream from '@openpgp/web-stream-tools';\nimport util from '../util';\n\nconst Buffer = util.getNodeBuffer();\n\nlet encodeChunk;\nlet decodeChunk;\nif (Buffer) {\n encodeChunk = buf => Buffer.from(buf).toString('base64');\n decodeChunk = str => {\n const b = Buffer.from(str, 'base64');\n return new Uint8Array(b.buffer, b.byteOffset, b.byteLength);\n };\n} else {\n encodeChunk = buf => btoa(util.uint8ArrayToString(buf));\n decodeChunk = str => util.stringToUint8Array(atob(str));\n}\n\n/**\n * Convert binary array to radix-64\n * @param {Uint8Array | ReadableStream<Uint8Array>} data - Uint8Array to convert\n * @returns {String | ReadableStream<String>} Radix-64 version of input string.\n * @static\n */\nexport function encode(data) {\n let buf = new Uint8Array();\n return stream.transform(data, value => {\n buf = util.concatUint8Array([buf, value]);\n const r = [];\n const bytesPerLine = 45; // 60 chars per line * (3 bytes / 4 chars of base64).\n const lines = Math.floor(buf.length / bytesPerLine);\n const bytes = lines * bytesPerLine;\n const encoded = encodeChunk(buf.subarray(0, bytes));\n for (let i = 0; i < lines; i++) {\n r.push(encoded.substr(i * 60, 60));\n r.push('\\n');\n }\n buf = buf.subarray(bytes);\n return r.join('');\n }, () => (buf.length ? encodeChunk(buf) + '\\n' : ''));\n}\n\n/**\n * Convert radix-64 to binary array\n * @param {String | ReadableStream<String>} data - Radix-64 string to convert\n * @returns {Uint8Array | ReadableStream<Uint8Array>} Binary array version of input string.\n * @static\n */\nexport function decode(data) {\n let buf = '';\n return stream.transform(data, value => {\n buf += value;\n\n // Count how many whitespace characters there are in buf\n let spaces = 0;\n const spacechars = [' ', '\\t', '\\r', '\\n'];\n for (let i = 0; i < spacechars.length; i++) {\n const spacechar = spacechars[i];\n for (let pos = buf.indexOf(spacechar); pos !== -1; pos = buf.indexOf(spacechar, pos + 1)) {\n spaces++;\n }\n }\n\n // Backtrack until we have 4n non-whitespace characters\n // that we can safely base64-decode\n let length = buf.length;\n for (; length > 0 && (length - spaces) % 4 !== 0; length--) {\n if (spacechars.includes(buf[length])) spaces--;\n }\n\n const decoded = decodeChunk(buf.substr(0, length));\n buf = buf.substr(length);\n return decoded;\n }, () => decodeChunk(buf));\n}\n\n/**\n * Convert a Base-64 encoded string an array of 8-bit integer\n *\n * Note: accepts both Radix-64 and URL-safe strings\n * @param {String} base64 - Base-64 encoded string to convert\n * @returns {Uint8Array} An array of 8-bit integers.\n */\nexport function b64ToUint8Array(base64) {\n return decode(base64.replace(/-/g, '+').replace(/_/g, '/'));\n}\n\n/**\n * Convert an array of 8-bit integer to a Base-64 encoded string\n * @param {Uint8Array} bytes - An array of 8-bit integers to convert\n * @param {bool} url - If true, output is URL-safe\n * @returns {String} Base-64 encoded string.\n */\nexport function uint8ArrayToB64(bytes, url) {\n let encoded = encode(bytes).replace(/[\\r\\n]/g, '');\n if (url) {\n encoded = encoded.replace(/[+]/g, '-').replace(/[/]/g, '_').replace(/[=]/g, '');\n }\n return encoded;\n}\n","/**\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 /**\n * Asserts validity of given value and converts from string/integer to integer.\n * @param {Object} type target enum type\n * @param {String|Integer} e value to check and/or convert\n * @returns {Integer} enum value if it exists\n * @throws {Error} if the value is invalid\n */\n write: function(type, e) {\n if (typeof e === 'number') {\n e = this.read(type, e);\n }\n\n if (type[e] !== undefined) {\n return type[e];\n }\n\n throw new Error('Invalid enum value.');\n },\n\n /**\n * Converts enum integer value to the corresponding string, if it exists.\n * @param {Object} type target enum type\n * @param {Integer} e value to convert\n * @returns {String} name of enum value if it exists\n * @throws {Error} if the value is invalid\n */\n read: function(type, e) {\n if (!type[byValue]) {\n type[byValue] = [];\n Object.entries(type).forEach(([key, value]) => {\n type[byValue][value] = key;\n });\n }\n\n if (type[byValue][e] !== undefined) {\n return type[byValue][e];\n }\n\n throw new Error('Invalid enum value.');\n }\n};\n","// GPG4Browsers - An OpenPGP implementation in javascript\n// Copyright (C) 2011 Recurity Labs GmbH\n//\n// This library is free software; you can redistribute it and/or\n// modify it under the terms of the GNU Lesser General Public\n// License as published by the Free Software Foundation; either\n// version 3.0 of the License, or (at your option) any later version.\n//\n// This library is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n// Lesser General Public License for more details.\n//\n// You should have received a copy of the GNU Lesser General Public\n// License along with this library; if not, write to the Free Software\n// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n\n/**\n * Global configuration values.\n */\n\nimport enums from '../enums';\n\nexport default {\n /**\n * @memberof module:config\n * @property {Integer} preferredHashAlgorithm Default hash algorithm {@link module:enums.hash}\n */\n preferredHashAlgorithm: enums.hash.sha256,\n /**\n * @memberof module:config\n * @property {Integer} preferredSymmetricAlgorithm Default encryption cipher {@link module:enums.symmetric}\n */\n preferredSymmetricAlgorithm: enums.symmetric.aes256,\n /**\n * @memberof module:config\n * @property {Integer} compression Default compression algorithm {@link module:enums.compression}\n */\n preferredCompressionAlgorithm: enums.compression.uncompressed,\n /**\n * @memberof module:config\n * @property {Integer} deflateLevel Default zip/zlib compression level, between 1 and 9\n */\n deflateLevel: 6,\n\n /**\n * Use Authenticated Encryption with Additional Data (AEAD) protection for symmetric encryption.\n * Note: not all OpenPGP implementations are compatible with this option.\n * **FUTURE OPENPGP.JS VERSIONS MAY BREAK COMPATIBILITY WHEN USING THIS OPTION**\n * @see {@link https://tools.ietf.org/html/draft-ietf-openpgp-rfc4880bis-07|RFC4880bis-07}\n * @memberof module:config\n * @property {Boolean} aeadProtect\n */\n aeadProtect: false,\n /**\n * Default Authenticated Encryption with Additional Data (AEAD) encryption mode\n * Only has an effect when aeadProtect is set to true.\n * @memberof module:config\n * @property {Integer} preferredAEADAlgorithm Default AEAD mode {@link module:enums.aead}\n */\n preferredAEADAlgorithm: enums.aead.eax,\n /**\n * Chunk Size Byte for Authenticated Encryption with Additional Data (AEAD) mode\n * Only has an effect when aeadProtect is set to true.\n * Must be an integer value from 0 to 56.\n * @memberof module:config\n * @property {Integer} aeadChunkSizeByte\n */\n aeadChunkSizeByte: 12,\n /**\n * Use V5 keys.\n * Note: not all OpenPGP implementations are compatible with this option.\n * **FUTURE OPENPGP.JS VERSIONS MAY BREAK COMPATIBILITY WHEN USING THIS OPTION**\n * @memberof module:config\n * @property {Boolean} v5Keys\n */\n v5Keys: false,\n /**\n * {@link https://tools.ietf.org/html/rfc4880#section-3.7.1.3|RFC4880 3.7.1.3}:\n * Iteration Count Byte for S2K (String to Key)\n * @memberof module:config\n * @property {Integer} s2kIterationCountByte\n */\n s2kIterationCountByte: 224,\n /**\n * Allow decryption of messages without integrity protection.\n * This is an **insecure** setting:\n * - message modifications cannot be detected, thus processing the decrypted data is potentially unsafe.\n * - it enables downgrade attacks against integrity-protected messages.\n * @memberof module:config\n * @property {Boolean} allowUnauthenticatedMessages\n */\n allowUnauthenticatedMessages: false,\n /**\n * Allow streaming unauthenticated data before its integrity has been checked. This would allow the application to\n * process large streams while limiting memory usage by releasing the decrypted chunks as soon as possible\n * and deferring checking their integrity until the decrypted stream has been read in full.\n *\n * This setting is **insecure** if the partially decrypted message is processed further or displayed to the user.\n * @memberof module:config\n * @property {Boolean} allowUnauthenticatedStream\n */\n allowUnauthenticatedStream: false,\n /**\n * @memberof module:config\n * @property {Boolean} checksumRequired Do not throw error when armor is missing a checksum\n */\n checksumRequired: false,\n /**\n * Minimum RSA key size allowed for key generation and message signing, verification and encryption.\n * The default is 2047 since due to a bug, previous versions of OpenPGP.js could generate 2047-bit keys instead of 2048-bit ones.\n * @memberof module:config\n * @property {Number} minRSABits\n */\n minRSABits: 2047,\n /**\n * Work-around for rare GPG decryption bug when encrypting with multiple passwords.\n * **Slower and slightly less secure**\n * @memberof module:config\n * @property {Boolean} passwordCollisionCheck\n */\n passwordCollisionCheck: false,\n /**\n * @memberof module:config\n * @property {Boolean} revocationsExpire If true, expired revocation signatures are ignored\n */\n revocationsExpire: false,\n /**\n * Allow decryption using RSA keys without `encrypt` flag.\n * This setting is potentially insecure, but it is needed to get around an old openpgpjs bug\n * where key flags were ignored when selecting a key for encryption.\n * @memberof module:config\n * @property {Boolean} allowInsecureDecryptionWithSigningKeys\n */\n allowInsecureDecryptionWithSigningKeys: false,\n /**\n * Allow verification of message signatures with keys whose validity at the time of signing cannot be determined.\n * Instead, a verification key will also be consider valid as long as it is valid at the current time.\n * This setting is potentially insecure, but it is needed to verify messages signed with keys that were later reformatted,\n * and have self-signature's creation date that does not match the primary key creation date.\n * @memberof module:config\n * @property {Boolean} allowInsecureDecryptionWithSigningKeys\n */\n allowInsecureVerificationWithReformattedKeys: false,\n\n /**\n * Enable constant-time decryption of RSA- and ElGamal-encrypted session keys, to hinder Bleichenbacher-like attacks (https://link.springer.com/chapter/10.1007/BFb0055716).\n * This setting has measurable performance impact and it is only helpful in application scenarios where both of the following conditions apply:\n * - new/incoming messages are automatically decrypted (without user interaction);\n * - an attacker can determine how long it takes to decrypt each message (e.g. due to decryption errors being logged remotely).\n * See also `constantTimePKCS1DecryptionSupportedSymmetricAlgorithms`.\n * @memberof module:config\n * @property {Boolean} constantTimePKCS1Decryption\n */\n constantTimePKCS1Decryption: false,\n /**\n * This setting is only meaningful if `constantTimePKCS1Decryption` is enabled.\n * Decryption of RSA- and ElGamal-encrypted session keys of symmetric algorithms different from the ones specified here will fail.\n * However, the more algorithms are added, the slower the decryption procedure becomes.\n * @memberof module:config\n * @property {Set<Integer>} constantTimePKCS1DecryptionSupportedSymmetricAlgorithms {@link module:enums.symmetric}\n */\n constantTimePKCS1DecryptionSupportedSymmetricAlgorithms: new Set([enums.symmetric.aes128, enums.symmetric.aes192, enums.symmetric.aes256]),\n\n /**\n * @memberof module:config\n * @property {Integer} minBytesForWebCrypto The minimum amount of bytes for which to use native WebCrypto APIs when available\n */\n minBytesForWebCrypto: 1000,\n /**\n * @memberof module:config\n * @property {Boolean} ignoreUnsupportedPackets Ignore unsupported/unrecognizable packets on parsing instead of throwing an error\n */\n ignoreUnsupportedPackets: true,\n /**\n * @memberof module:config\n * @property {Boolean} ignoreMalformedPackets Ignore malformed packets on parsing instead of throwing an error\n */\n ignoreMalformedPackets: false,\n /**\n * Parsing of packets is normally restricted to a predefined set of packets. For example a Sym. Encrypted Integrity Protected Data Packet can only\n * contain a certain set of packets including LiteralDataPacket. With this setting we can allow additional packets, which is probably not advisable\n * as a global config setting, but can be used for specific function calls (e.g. decrypt method of Message).\n * @memberof module:config\n * @property {Array} additionalAllowedPackets Allow additional packets on parsing. Defined as array of packet classes, e.g. [PublicKeyPacket]\n */\n additionalAllowedPackets: [],\n /**\n * @memberof module:config\n * @property {Boolean} showVersion Whether to include {@link module:config/config.versionString} in armored messages\n */\n showVersion: false,\n /**\n * @memberof module:config\n * @property {Boolean} showComment Whether to include {@link module:config/config.commentString} in armored messages\n */\n showComment: false,\n /**\n * @memberof module:config\n * @property {String} versionString A version string to be included in armored messages\n */\n versionString: 'OpenPGP.js VERSION',\n /**\n * @memberof module:config\n * @property {String} commentString A comment string to be included in armored messages\n */\n commentString: 'https://openpgpjs.org',\n\n /**\n * Max userID string length (used for parsing)\n * @memberof module:config\n * @property {Integer} maxUserIDLength\n */\n maxUserIDLength: 1024 * 5,\n /**\n * Contains notatations that are considered \"known\". Known notations do not trigger\n * validation error when the notation is marked as critical.\n * @memberof module:config\n * @property {Array} knownNotations\n */\n knownNotations: [],\n /**\n * Whether to use the indutny/elliptic library for curves (other than Curve25519) that are not supported by the available native crypto API.\n * When false, certain standard curves will not be supported (depending on the platform).\n * Note: the indutny/elliptic curve library is not designed to be constant time.\n * @memberof module:config\n * @property {Boolean} useIndutnyElliptic\n */\n useIndutnyElliptic: true,\n /**\n * Reject insecure hash algorithms\n * @memberof module:config\n * @property {Set<Integer>} rejectHashAlgorithms {@link module:enums.hash}\n */\n rejectHashAlgorithms: new Set([enums.hash.md5, enums.hash.ripemd]),\n /**\n * Reject insecure message hash algorithms\n * @memberof module:config\n * @property {Set<Integer>} rejectMessageHashAlgorithms {@link module:enums.hash}\n */\n rejectMessageHashAlgorithms: new Set([enums.hash.md5, enums.hash.ripemd, enums.hash.sha1]),\n /**\n * Reject insecure public key algorithms for key generation and message encryption, signing or verification\n * @memberof module:config\n * @property {Set<Integer>} rejectPublicKeyAlgorithms {@link module:enums.publicKey}\n */\n rejectPublicKeyAlgorithms: new Set([enums.publicKey.elgamal, enums.publicKey.dsa]),\n /**\n * Reject non-standard curves for key generation, message encryption, signing or verification\n * @memberof module:config\n * @property {Set<String>} rejectCurves {@link module:enums.curve}\n */\n rejectCurves: new Set([enums.curve.secp256k1])\n};\n","// GPG4Browsers - An OpenPGP implementation in javascript\n// Copyright (C) 2011 Recurity Labs GmbH\n//\n// This library is free software; you can redistribute it and/or\n// modify it under the terms of the GNU Lesser General Public\n// License as published by the Free Software Foundation; either\n// version 3.0 of the License, or (at your option) any later version.\n//\n// This library is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n// Lesser General Public License for more details.\n//\n// You should have received a copy of the GNU Lesser General Public\n// License along with this library; if not, write to the Free Software\n// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n\nimport * as stream from '@openpgp/web-stream-tools';\nimport * as base64 from './base64';\nimport enums from '../enums';\nimport util from '../util';\nimport defaultConfig from '../config';\n\n/**\n * Finds out which Ascii Armoring type is used. Throws error if unknown type.\n * @param {String} text - ascii armored text\n * @returns {Integer} 0 = MESSAGE PART n of m.\n * 1 = MESSAGE PART n\n * 2 = SIGNED MESSAGE\n * 3 = PGP MESSAGE\n * 4 = PUBLIC KEY BLOCK\n * 5 = PRIVATE KEY BLOCK\n * 6 = SIGNATURE\n * @private\n */\nfunction getType(text) {\n const reHeader = /^-----BEGIN PGP (MESSAGE, PART \\d+\\/\\d+|MESSAGE, PART \\d+|SIGNED MESSAGE|MESSAGE|PUBLIC KEY BLOCK|PRIVATE KEY BLOCK|SIGNATURE)-----$/m;\n\n const header = text.match(reHeader);\n\n if (!header) {\n throw new Error('Unknown ASCII armor type');\n }\n\n // BEGIN PGP MESSAGE, PART X/Y\n // Used for multi-part messages, where the armor is split amongst Y\n // parts, and this is the Xth part out of Y.\n if (/MESSAGE, PART \\d+\\/\\d+/.test(header[1])) {\n return enums.armor.multipartSection;\n } else\n // BEGIN PGP MESSAGE, PART X\n // Used for multi-part messages, where this is the Xth part of an\n // unspecified number of parts. Requires the MESSAGE-ID Armor\n // Header to be used.\n if (/MESSAGE, PART \\d+/.test(header[1])) {\n return enums.armor.multipartLast;\n } else\n // BEGIN PGP SIGNED MESSAGE\n if (/SIGNED MESSAGE/.test(header[1])) {\n return enums.armor.signed;\n } else\n // BEGIN PGP MESSAGE\n // Used for signed, encrypted, or compressed files.\n if (/MESSAGE/.test(header[1])) {\n return enums.armor.message;\n } else\n // BEGIN PGP PUBLIC KEY BLOCK\n // Used for armoring public keys.\n if (/PUBLIC KEY BLOCK/.test(header[1])) {\n return enums.armor.publicKey;\n } else\n // BEGIN PGP PRIVATE KEY BLOCK\n // Used for armoring private keys.\n if (/PRIVATE KEY BLOCK/.test(header[1])) {\n return enums.armor.privateKey;\n } else\n // BEGIN PGP SIGNATURE\n // Used for detached signatures, OpenPGP/MIME signatures, and\n // cleartext signatures. Note that PGP 2.x uses BEGIN PGP MESSAGE\n // for detached signatures.\n if (/SIGNATURE/.test(header[1])) {\n return enums.armor.signature;\n }\n}\n\n/**\n * Add additional information to the armor version of an OpenPGP binary\n * packet block.\n * @author Alex\n * @version 2011-12-16\n * @param {String} [customComment] - Additional comment to add to the armored string\n * @returns {String} The header information.\n * @private\n */\nfunction addheader(customComment, config) {\n let result = '';\n if (config.showVersion) {\n result += 'Version: ' + config.versionString + '\\n';\n }\n if (config.showComment) {\n result += 'Comment: ' + config.commentString + '\\n';\n }\n if (customComment) {\n result += 'Comment: ' + customComment + '\\n';\n }\n result += '\\n';\n return result;\n}\n\n\n/**\n * Calculates a checksum over the given data and returns it base64 encoded\n * @param {String | ReadableStream<String>} data - Data to create a CRC-24 checksum for\n * @returns {String | ReadableStream<String>} Base64 encoded checksum.\n * @private\n */\nfunction getCheckSum(data) {\n const crc = createcrc24(data);\n return base64.encode(crc);\n}\n\n// https://create.stephan-brumme.com/crc32/#slicing-by-8-overview\n\nconst crc_table = [\n new Array(0xFF),\n new Array(0xFF),\n new Array(0xFF),\n new Array(0xFF)\n];\n\nfor (let i = 0; i <= 0xFF; i++) {\n let crc = i << 16;\n for (let j = 0; j < 8; j++) {\n crc = (crc << 1) ^ ((crc & 0x800000) !== 0 ? 0x864CFB : 0);\n }\n crc_table[0][i] =\n ((crc & 0xFF0000) >> 16) |\n (crc & 0x00FF00) |\n ((crc & 0x0000FF) << 16);\n}\nfor (let i = 0; i <= 0xFF; i++) {\n crc_table[1][i] = (crc_table[0][i] >> 8) ^ crc_table[0][crc_table[0][i] & 0xFF];\n}\nfor (let i = 0; i <= 0xFF; i++) {\n crc_table[2][i] = (crc_table[1][i] >> 8) ^ crc_table[0][crc_table[1][i] & 0xFF];\n}\nfor (let i = 0; i <= 0xFF; i++) {\n crc_table[3][i] = (crc_table[2][i] >> 8) ^ crc_table[0][crc_table[2][i] & 0xFF];\n}\n\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView#Endianness\nconst isLittleEndian = (function() {\n const buffer = new ArrayBuffer(2);\n new DataView(buffer).setInt16(0, 0xFF, true /* littleEndian */);\n // Int16Array uses the platform's endianness.\n return new Int16Array(buffer)[0] === 0xFF;\n}());\n\n/**\n * Internal function to calculate a CRC-24 checksum over a given string (data)\n * @param {String | ReadableStream<String>} input - Data to create a CRC-24 checksum for\n * @returns {Uint8Array | ReadableStream<Uint8Array>} The CRC-24 checksum.\n * @private\n */\nfunction createcrc24(input) {\n let crc = 0xCE04B7;\n return stream.transform(input, value => {\n const len32 = isLittleEndian ? Math.floor(value.length / 4) : 0;\n const arr32 = new Uint32Array(value.buffer, value.byteOffset, len32);\n for (let i = 0; i < len32; i++) {\n crc ^= arr32[i];\n crc =\n crc_table[0][(crc >> 24) & 0xFF] ^\n crc_table[1][(crc >> 16) & 0xFF] ^\n crc_table[2][(crc >> 8) & 0xFF] ^\n crc_table[3][(crc >> 0) & 0xFF];\n }\n for (let i = len32 * 4; i < value.length; i++) {\n crc = (crc >> 8) ^ crc_table[0][(crc & 0xFF) ^ value[i]];\n }\n }, () => new Uint8Array([crc, crc >> 8, crc >> 16]));\n}\n\n/**\n * Verify armored headers. crypto-refresh-06, section 6.2:\n * \"An OpenPGP implementation may consider improperly formatted Armor\n * Headers to be corruption of the ASCII Armor, but SHOULD make an\n * effort to recover.\"\n * @private\n * @param {Array<String>} headers - Armor headers\n */\nfunction verifyHeaders(headers) {\n for (let i = 0; i < headers.length; i++) {\n if (!/^([^\\s:]|[^\\s:][^:]*[^\\s:]): .+$/.test(headers[i])) {\n util.printDebugError(new Error('Improperly formatted armor header: ' + headers[i]));\n }\n if (!/^(Version|Comment|MessageID|Hash|Charset): .+$/.test(headers[i])) {\n util.printDebugError(new Error('Unknown header: ' + headers[i]));\n }\n }\n}\n\n/**\n * Splits a message into two parts, the body and the checksum. This is an internal function\n * @param {String} text - OpenPGP armored message part\n * @returns {Object} An object with attribute \"body\" containing the body.\n * and an attribute \"checksum\" containing the checksum.\n * @private\n */\nfunction splitChecksum(text) {\n let body = text;\n let checksum = '';\n\n const lastEquals = text.lastIndexOf('=');\n\n if (lastEquals >= 0 && lastEquals !== text.length - 1) { // '=' as the last char means no checksum\n body = text.slice(0, lastEquals);\n checksum = text.slice(lastEquals + 1).substr(0, 4);\n }\n\n return { body: body, checksum: checksum };\n}\n\n/**\n * Dearmor an OpenPGP armored message; verify the checksum and return\n * the encoded bytes\n * @param {String} input - OpenPGP armored message\n * @returns {Promise<Object>} An object with attribute \"text\" containing the message text,\n * an attribute \"data\" containing a stream of bytes and \"type\" for the ASCII armor type\n * @async\n * @static\n */\nexport function unarmor(input, config = defaultConfig) {\n // eslint-disable-next-line no-async-promise-executor\n return new Promise(async (resolve, reject) => {\n try {\n const reSplit = /^-----[^-]+-----$/m;\n const reEmptyLine = /^[ \\f\\r\\t\\u00a0\\u2000-\\u200a\\u202f\\u205f\\u3000]*$/;\n\n let type;\n const headers = [];\n let lastHeaders = headers;\n let headersDone;\n let text = [];\n let textDone;\n let checksum;\n let data = base64.decode(stream.transformPair(input, async (readable, writable) => {\n const reader = stream.getReader(readable);\n try {\n while (true) {\n let line = await reader.readLine();\n if (line === undefined) {\n throw new Error('Misformed armored text');\n }\n // remove trailing whitespace at end of lines\n line = util.removeTrailingSpaces(line.replace(/[\\r\\n]/g, ''));\n if (!type) {\n if (reSplit.test(line)) {\n type = getType(line);\n }\n } else if (!headersDone) {\n if (reSplit.test(line)) {\n reject(new Error('Mandatory blank line missing between armor headers and armor data'));\n }\n if (!reEmptyLine.test(line)) {\n lastHeaders.push(line);\n } else {\n verifyHeaders(lastHeaders);\n headersDone = true;\n if (textDone || type !== 2) {\n resolve({ text, data, headers, type });\n break;\n }\n }\n } else if (!textDone && type === 2) {\n if (!reSplit.test(line)) {\n // Reverse dash-escaping for msg\n text.push(line.replace(/^- /, ''));\n } else {\n text = text.join('\\r\\n');\n textDone = true;\n verifyHeaders(lastHeaders);\n lastHeaders = [];\n headersDone = false;\n }\n }\n }\n } catch (e) {\n reject(e);\n return;\n }\n const writer = stream.getWriter(writable);\n try {\n while (true) {\n await writer.ready;\n const { done, value } = await reader.read();\n if (done) {\n throw new Error('Misformed armored text');\n }\n const line = value + '';\n if (line.indexOf('=') === -1 && line.indexOf('-') === -1) {\n await writer.write(line);\n } else {\n let remainder = await reader.readToEnd();\n if (!remainder.length) remainder = '';\n remainder = line + remainder;\n remainder = util.removeTrailingSpaces(remainder.replace(/\\r/g, ''));\n const parts = remainder.split(reSplit);\n if (parts.length === 1) {\n throw new Error('Misformed armored text');\n }\n const split = splitChecksum(parts[0].slice(0, -1));\n checksum = split.checksum;\n await writer.write(split.body);\n break;\n }\n }\n await writer.ready;\n await writer.close();\n } catch (e) {\n await writer.abort(e);\n }\n }));\n data = stream.transformPair(data, async (readable, writable) => {\n const checksumVerified = stream.readToEnd(getCheckSum(stream.passiveClone(readable)));\n checksumVerified.catch(() => {});\n await stream.pipe(readable, writable, {\n preventClose: true\n });\n const writer = stream.getWriter(writable);\n try {\n const checksumVerifiedString = (await checksumVerified).replace('\\n', '');\n if (checksum !== checksumVerifiedString && (checksum || config.checksumRequired)) {\n throw new Error('Ascii armor integrity check failed');\n }\n await writer.ready;\n await writer.close();\n } catch (e) {\n await writer.abort(e);\n }\n });\n } catch (e) {\n reject(e);\n }\n }).then(async result => {\n if (stream.isArrayStream(result.data)) {\n result.data = await stream.readToEnd(result.data);\n }\n return result;\n });\n}\n\n\n/**\n * Armor an OpenPGP binary packet block\n * @param {module:enums.armor} messageType - Type of the message\n * @param {Uint8Array | ReadableStream<Uint8Array>} body - The message body to armor\n * @param {Integer} [partIndex]\n * @param {Integer} [partTotal]\n * @param {String} [customComment] - Additional comment to add to the armored string\n * @returns {String | ReadableStream<String>} Armored text.\n * @static\n */\nexport function armor(messageType, body, partIndex, partTotal, customComment, config = defaultConfig) {\n let text;\n let hash;\n if (messageType === enums.armor.signed) {\n text = body.text;\n hash = body.hash;\n body = body.data;\n }\n const bodyClone = stream.passiveClone(body);\n const result = [];\n switch (messageType) {\n case enums.armor.multipartSection:\n result.push('-----BEGIN PGP MESSAGE, PART ' + partIndex + '/' + partTotal + '-----\\n');\n result.push(addheader(customComment, config));\n result.push(base64.encode(body));\n result.push('=', getCheckSum(bodyClone));\n result.push('-----END PGP MESSAGE, PART ' + partIndex + '/' + partTotal + '-----\\n');\n break;\n case enums.armor.multipartLast:\n result.push('-----BEGIN PGP MESSAGE, PART ' + partIndex + '-----\\n');\n result.push(addheader(customComment, config));\n result.push(base64.encode(body));\n result.push('=', getCheckSum(bodyClone));\n result.push('-----END PGP MESSAGE, PART ' + partIndex + '-----\\n');\n break;\n case enums.armor.signed:\n result.push('-----BEGIN PGP SIGNED MESSAGE-----\\n');\n result.push('Hash: ' + hash + '\\n\\n');\n result.push(text.replace(/^-/mg, '- -'));\n result.push('\\n-----BEGIN PGP SIGNATURE-----\\n');\n result.push(addheader(customComment, config));\n result.push(base64.encode(body));\n result.push('=', getCheckSum(bodyClone));\n result.push('-----END PGP SIGNATURE-----\\n');\n break;\n case enums.armor.message:\n result.push('-----BEGIN PGP MESSAGE-----\\n');\n result.push(addheader(customComment, config));\n result.push(base64.encode(body));\n result.push('=', getCheckSum(bodyClone));\n result.push('-----END PGP MESSAGE-----\\n');\n break;\n case enums.armor.publicKey:\n result.push('-----BEGIN PGP PUBLIC KEY BLOCK-----\\n');\n result.push(addheader(customComment, config));\n result.push(base64.encode(body));\n result.push('=', getCheckSum(bodyClone));\n result.push('-----END PGP PUBLIC KEY BLOCK-----\\n');\n break;\n case enums.armor.privateKey:\n result.push('-----BEGIN PGP PRIVATE KEY BLOCK-----\\n');\n result.push(addheader(customComment, config));\n result.push(base64.encode(body));\n result.push('=', getCheckSum(bodyClone));\n result.push('-----END PGP PRIVATE KEY BLOCK-----\\n');\n break;\n case enums.armor.signature:\n result.push('-----BEGIN PGP SIGNATURE-----\\n');\n result.push(addheader(customComment, config));\n result.push(base64.encode(body));\n result.push('=', getCheckSum(bodyClone));\n result.push('-----END PGP SIGNATURE-----\\n');\n break;\n }\n\n return util.concat(result);\n}\n","// GPG4Browsers - An OpenPGP implementation in javascript\n// Copyright (C) 2011 Recurity Labs GmbH\n//\n// This library is free software; you can redistribute it and/or\n// modify it under the terms of the GNU Lesser General Public\n// License as published by the Free Software Foundation; either\n// version 3.0 of the License, or (at your option) any later version.\n//\n// This library is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n// Lesser General Public License for more details.\n//\n// You should have received a copy of the GNU Lesser General Public\n// License along with this library; if not, write to the Free Software\n// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n\n/**\n * @module type/keyid\n * @private\n */\n\nimport util from '../util';\n\n/**\n * Implementation of type key id\n *\n * {@link https://tools.ietf.org/html/rfc4880#section-3.3|RFC4880 3.3}:\n * A Key ID is an eight-octet scalar that identifies a key.\n * Implementations SHOULD NOT assume that Key IDs are unique. The\n * section \"Enhanced Key Formats\" below describes how Key IDs are\n * formed.\n */\nclass KeyID {\n constructor() {\n this.bytes = '';\n }\n\n /**\n * Parsing method for a key id\n * @param {Uint8Array} bytes - Input to read the key id from\n */\n read(bytes) {\n this.bytes = util.uint8ArrayToString(bytes.subarray(0, 8));\n }\n\n /**\n * Serializes the Key ID\n * @returns {Uint8Array} Key ID as a Uint8Array.\n */\n write() {\n return util.stringToUint8Array(this.bytes);\n }\n\n /**\n * Returns the Key ID represented as a hexadecimal string\n * @returns {String} Key ID as a hexadecimal string.\n */\n toHex() {\n return util.uint8ArrayToHex(util.stringToUint8Array(this.bytes));\n }\n\n /**\n * Checks equality of Key ID's\n * @param {KeyID} keyID\n * @param {Boolean} matchWildcard - Indicates whether to check if either keyID is a wildcard\n */\n equals(keyID, matchWildcard = false) {\n return (matchWildcard && (keyID.isWildcard() || this.isWildcard())) || this.bytes === keyID.bytes;\n }\n\n /**\n * Checks to see if the Key ID is unset\n * @returns {Boolean} True if the Key ID is null.\n */\n isNull() {\n return this.bytes === '';\n }\n\n /**\n * Checks to see if the Key ID is a \"wildcard\" Key ID (all zeros)\n * @returns {Boolean} True if this is a wildcard Key ID.\n */\n isWildcard() {\n return /^0+$/.test(this.toHex());\n }\n\n static mapToHex(keyID) {\n return keyID.toHex();\n }\n\n static fromID(hex) {\n const keyID = new KeyID();\n keyID.read(util.hexToUint8Array(hex));\n return keyID;\n }\n\n static wildcard() {\n const keyID = new KeyID();\n keyID.read(new Uint8Array(8));\n return keyID;\n }\n}\n\nexport default KeyID;\n","/**\n * @file {@link http://asmjs.org Asm.js} implementation of the {@link https://en.wikipedia.org/wiki/Advanced_Encryption_Standard Advanced Encryption Standard}.\n * @author Artem S Vybornov <vybornov@gmail.com>\n * @license MIT\n */\nexport var AES_asm = function () {\n \"use strict\";\n\n /**\n * Galois Field stuff init flag\n */\n var ginit_done = false;\n\n /**\n * Galois Field exponentiation and logarithm tables for 3 (the generator)\n */\n var gexp3, glog3;\n\n /**\n * Init Galois Field tables\n */\n function ginit() {\n gexp3 = [],\n glog3 = [];\n\n var a = 1, c, d;\n for (c = 0; c < 255; c++) {\n gexp3[c] = a;\n\n // Multiply by three\n d = a & 0x80, a <<= 1, a &= 255;\n if (d === 0x80) a ^= 0x1b;\n a ^= gexp3[c];\n\n // Set the log table value\n glog3[gexp3[c]] = c;\n }\n gexp3[255] = gexp3[0];\n glog3[0] = 0;\n\n ginit_done = true;\n }\n\n /**\n * Galois Field multiplication\n * @param {number} a\n * @param {number} b\n * @return {number}\n */\n function gmul(a, b) {\n var c = gexp3[(glog3[a] + glog3[b]) % 255];\n if (a === 0 || b === 0) c = 0;\n return c;\n }\n\n /**\n * Galois Field reciprocal\n * @param {number} a\n * @return {number}\n */\n function ginv(a) {\n var i = gexp3[255 - glog3[a]];\n if (a === 0) i = 0;\n return i;\n }\n\n /**\n * AES stuff init flag\n */\n var aes_init_done = false;\n\n /**\n * Encryption, Decryption, S-Box and KeyTransform tables\n *\n * @type {number[]}\n */\n var aes_sbox;\n\n /**\n * @type {number[]}\n */\n var aes_sinv;\n\n /**\n * @type {number[][]}\n */\n var aes_enc;\n\n /**\n * @type {number[][]}\n */\n var aes_dec;\n\n /**\n * Init AES tables\n */\n function aes_init() {\n if (!ginit_done) ginit();\n\n // Calculates AES S-Box value\n function _s(a) {\n var c, s, x;\n s = x = ginv(a);\n for (c = 0; c < 4; c++) {\n s = ((s << 1) | (s >>> 7)) & 255;\n x ^= s;\n }\n x ^= 99;\n return x;\n }\n\n // Tables\n aes_sbox = [],\n aes_sinv = [],\n aes_enc = [[], [], [], []],\n aes_dec = [[], [], [], []];\n\n for (var i = 0; i < 256; i++) {\n var s = _s(i);\n\n // S-Box and its inverse\n aes_sbox[i] = s;\n aes_sinv[s] = i;\n\n // Ecryption and Decryption tables\n aes_enc[0][i] = (gmul(2, s) << 24) | (s << 16) | (s << 8) | gmul(3, s);\n aes_dec[0][s] = (gmul(14, i) << 24) | (gmul(9, i) << 16) | (gmul(13, i) << 8) | gmul(11, i);\n // Rotate tables\n for (var t = 1; t < 4; t++) {\n aes_enc[t][i] = (aes_enc[t - 1][i] >>> 8) | (aes_enc[t - 1][i] << 24);\n aes_dec[t][s] = (aes_dec[t - 1][s] >>> 8) | (aes_dec[t - 1][s] << 24);\n }\n }\n\n aes_init_done = true;\n }\n\n /**\n * Asm.js module constructor.\n *\n * <p>\n * Heap buffer layout by offset:\n * <pre>\n * 0x0000 encryption key schedule\n * 0x0400 decryption key schedule\n * 0x0800 sbox\n * 0x0c00 inv sbox\n * 0x1000 encryption tables\n * 0x2000 decryption tables\n * 0x3000 reserved (future GCM multiplication lookup table)\n * 0x4000 data\n * </pre>\n * Don't touch anything before <code>0x400</code>.\n * </p>\n *\n * @alias AES_asm\n * @class\n * @param foreign - <i>ignored</i>\n * @param buffer - heap buffer to link with\n */\n var wrapper = function (foreign, buffer) {\n // Init AES stuff for the first time\n if (!aes_init_done) aes_init();\n\n // Fill up AES tables\n var heap = new Uint32Array(buffer);\n heap.set(aes_sbox, 0x0800 >> 2);\n heap.set(aes_sinv, 0x0c00 >> 2);\n for (var i = 0; i < 4; i++) {\n heap.set(aes_enc[i], (0x1000 + 0x400 * i) >> 2);\n heap.set(aes_dec[i], (0x2000 + 0x400 * i) >> 2);\n }\n\n /**\n * Calculate AES key schedules.\n * @instance\n * @memberof AES_asm\n * @param {number} ks - key size, 4/6/8 (for 128/192/256-bit key correspondingly)\n * @param {number} k0 - key vector components\n * @param {number} k1 - key vector components\n * @param {number} k2 - key vector components\n * @param {number} k3 - key vector components\n * @param {number} k4 - key vector components\n * @param {number} k5 - key vector components\n * @param {number} k6 - key vector components\n * @param {number} k7 - key vector components\n */\n function set_key(ks, k0, k1, k2, k3, k4, k5, k6, k7) {\n var ekeys = heap.subarray(0x000, 60),\n dkeys = heap.subarray(0x100, 0x100 + 60);\n\n // Encryption key schedule\n ekeys.set([k0, k1, k2, k3, k4, k5, k6, k7]);\n for (var i = ks, rcon = 1; i < 4 * ks + 28; i++) {\n var k = ekeys[i - 1];\n if ((i % ks === 0) || (ks === 8 && i % ks === 4)) {\n k = aes_sbox[k >>> 24] << 24 ^ aes_sbox[k >>> 16 & 255] << 16 ^ aes_sbox[k >>> 8 & 255] << 8 ^ aes_sbox[k & 255];\n }\n if (i % ks === 0) {\n k = (k << 8) ^ (k >>> 24) ^ (rcon << 24);\n rcon = (rcon << 1) ^ ((rcon & 0x80) ? 0x1b : 0);\n }\n ekeys[i] = ekeys[i - ks] ^ k;\n }\n\n // Decryption key schedule\n for (var j = 0; j < i; j += 4) {\n for (var jj = 0; jj < 4; jj++) {\n var k = ekeys[i - (4 + j) + (4 - jj) % 4];\n if (j < 4 || j >= i - 4) {\n dkeys[j + jj] = k;\n } else {\n dkeys[j + jj] = aes_dec[0][aes_sbox[k >>> 24]]\n ^ aes_dec[1][aes_sbox[k >>> 16 & 255]]\n ^ aes_dec[2][aes_sbox[k >>> 8 & 255]]\n ^ aes_dec[3][aes_sbox[k & 255]];\n }\n }\n }\n\n // Set rounds number\n asm.set_rounds(ks + 5);\n }\n\n // create library object with necessary properties\n var stdlib = {Uint8Array: Uint8Array, Uint32Array: Uint32Array};\n\n var asm = function (stdlib, foreign, buffer) {\n \"use asm\";\n\n var S0 = 0, S1 = 0, S2 = 0, S3 = 0,\n I0 = 0, I1 = 0, I2 = 0, I3 = 0,\n N0 = 0, N1 = 0, N2 = 0, N3 = 0,\n M0 = 0, M1 = 0, M2 = 0, M3 = 0,\n H0 = 0, H1 = 0, H2 = 0, H3 = 0,\n R = 0;\n\n var HEAP = new stdlib.Uint32Array(buffer),\n DATA = new stdlib.Uint8Array(buffer);\n\n /**\n * AES core\n * @param {number} k - precomputed key schedule offset\n * @param {number} s - precomputed sbox table offset\n * @param {number} t - precomputed round table offset\n * @param {number} r - number of inner rounds to perform\n * @param {number} x0 - 128-bit input block vector\n * @param {number} x1 - 128-bit input block vector\n * @param {number} x2 - 128-bit input block vector\n * @param {number} x3 - 128-bit input block vector\n */\n function _core(k, s, t, r, x0, x1, x2, x3) {\n k = k | 0;\n s = s | 0;\n t = t | 0;\n r = r | 0;\n x0 = x0 | 0;\n x1 = x1 | 0;\n x2 = x2 | 0;\n x3 = x3 | 0;\n\n var t1 = 0, t2 = 0, t3 = 0,\n y0 = 0, y1 = 0, y2 = 0, y3 = 0,\n i = 0;\n\n t1 = t | 0x400, t2 = t | 0x800, t3 = t | 0xc00;\n\n // round 0\n x0 = x0 ^ HEAP[(k | 0) >> 2],\n x1 = x1 ^ HEAP[(k | 4) >> 2],\n x2 = x2 ^ HEAP[(k | 8) >> 2],\n x3 = x3 ^ HEAP[(k | 12) >> 2];\n\n // round 1..r\n for (i = 16; (i | 0) <= (r << 4); i = (i + 16) | 0) {\n y0 = HEAP[(t | x0 >> 22 & 1020) >> 2] ^ HEAP[(t1 | x1 >> 14 & 1020) >> 2] ^ HEAP[(t2 | x2 >> 6 & 1020) >> 2] ^ HEAP[(t3 | x3 << 2 & 1020) >> 2] ^ HEAP[(k | i | 0) >> 2],\n y1 = HEAP[(t | x1 >> 22 & 1020) >> 2] ^ HEAP[(t1 | x2 >> 14 & 1020) >> 2] ^ HEAP[(t2 | x3 >> 6 & 1020) >> 2] ^ HEAP[(t3 | x0 << 2 & 1020) >> 2] ^ HEAP[(k | i | 4) >> 2],\n y2 = HEAP[(t | x2 >> 22 & 1020) >> 2] ^ HEAP[(t1 | x3 >> 14 & 1020) >> 2] ^ HEAP[(t2 | x0 >> 6 & 1020) >> 2] ^ HEAP[(t3 | x1 << 2 & 1020) >> 2] ^ HEAP[(k | i | 8) >> 2],\n y3 = HEAP[(t | x3 >> 22 & 1020) >> 2] ^ HEAP[(t1 | x0 >> 14 & 1020) >> 2] ^ HEAP[(t2 | x1 >> 6 & 1020) >> 2] ^ HEAP[(t3 | x2 << 2 & 1020) >> 2] ^ HEAP[(k | i | 12) >> 2];\n x0 = y0, x1 = y1, x2 = y2, x3 = y3;\n }\n\n // final round\n S0 = HEAP[(s | x0 >> 22 & 1020) >> 2] << 24 ^ HEAP[(s | x1 >> 14 & 1020) >> 2] << 16 ^ HEAP[(s | x2 >> 6 & 1020) >> 2] << 8 ^ HEAP[(s | x3 << 2 & 1020) >> 2] ^ HEAP[(k | i | 0) >> 2],\n S1 = HEAP[(s | x1 >> 22 & 1020) >> 2] << 24 ^ HEAP[(s | x2 >> 14 & 1020) >> 2] << 16 ^ HEAP[(s | x3 >> 6 & 1020) >> 2] << 8 ^ HEAP[(s | x0 << 2 & 1020) >> 2] ^ HEAP[(k | i | 4) >> 2],\n S2 = HEAP[(s | x2 >> 22 & 1020) >> 2] << 24 ^ HEAP[(s | x3 >> 14 & 1020) >> 2] << 16 ^ HEAP[(s | x0 >> 6 & 1020) >> 2] << 8 ^ HEAP[(s | x1 << 2 & 1020) >> 2] ^ HEAP[(k | i | 8) >> 2],\n S3 = HEAP[(s | x3 >> 22 & 1020) >> 2] << 24 ^ HEAP[(s | x0 >> 14 & 1020) >> 2] << 16 ^ HEAP[(s | x1 >> 6 & 1020) >> 2] << 8 ^ HEAP[(s | x2 << 2 & 1020) >> 2] ^ HEAP[(k | i | 12) >> 2];\n }\n\n /**\n * ECB mode encryption\n * @param {number} x0 - 128-bit input block vector\n * @param {number} x1 - 128-bit input block vector\n * @param {number} x2 - 128-bit input block vector\n * @param {number} x3 - 128-bit input block vector\n */\n function _ecb_enc(x0, x1, x2, x3) {\n x0 = x0 | 0;\n x1 = x1 | 0;\n x2 = x2 | 0;\n x3 = x3 | 0;\n\n _core(\n 0x0000, 0x0800, 0x1000,\n R,\n x0,\n x1,\n x2,\n x3\n );\n }\n\n /**\n * ECB mode decryption\n * @param {number} x0 - 128-bit input block vector\n * @param {number} x1 - 128-bit input block vector\n * @param {number} x2 - 128-bit input block vector\n * @param {number} x3 - 128-bit input block vector\n */\n function _ecb_dec(x0, x1, x2, x3) {\n x0 = x0 | 0;\n x1 = x1 | 0;\n x2 = x2 | 0;\n x3 = x3 | 0;\n\n var t = 0;\n\n _core(\n 0x0400, 0x0c00, 0x2000,\n R,\n x0,\n x3,\n x2,\n x1\n );\n\n t = S1, S1 = S3, S3 = t;\n }\n\n\n /**\n * CBC mode encryption\n * @param {number} x0 - 128-bit input block vector\n * @param {number} x1 - 128-bit input block vector\n * @param {number} x2 - 128-bit input block vector\n * @param {number} x3 - 128-bit input block vector\n */\n function _cbc_enc(x0, x1, x2, x3) {\n x0 = x0 | 0;\n x1 = x1 | 0;\n x2 = x2 | 0;\n x3 = x3 | 0;\n\n _core(\n 0x0000, 0x0800, 0x1000,\n R,\n I0 ^ x0,\n I1 ^ x1,\n I2 ^ x2,\n I3 ^ x3\n );\n\n I0 = S0,\n I1 = S1,\n I2 = S2,\n I3 = S3;\n }\n\n /**\n * CBC mode decryption\n * @param {number} x0 - 128-bit input block vector\n * @param {number} x1 - 128-bit input block vector\n * @param {number} x2 - 128-bit input block vector\n * @param {number} x3 - 128-bit input block vector\n */\n function _cbc_dec(x0, x1, x2, x3) {\n x0 = x0 | 0;\n x1 = x1 | 0;\n x2 = x2 | 0;\n x3 = x3 | 0;\n\n var t = 0;\n\n _core(\n 0x0400, 0x0c00, 0x2000,\n R,\n x0,\n x3,\n x2,\n x1\n );\n\n t = S1, S1 = S3, S3 = t;\n\n S0 = S0 ^ I0,\n S1 = S1 ^ I1,\n S2 = S2 ^ I2,\n S3 = S3 ^ I3;\n\n I0 = x0,\n I1 = x1,\n I2 = x2,\n I3 = x3;\n }\n\n /**\n * CFB mode encryption\n * @param {number} x0 - 128-bit input block vector\n * @param {number} x1 - 128-bit input block vector\n * @param {number} x2 - 128-bit input block vector\n * @param {number} x3 - 128-bit input block vector\n */\n function _cfb_enc(x0, x1, x2, x3) {\n x0 = x0 | 0;\n x1 = x1 | 0;\n x2 = x2 | 0;\n x3 = x3 | 0;\n\n _core(\n 0x0000, 0x0800, 0x1000,\n R,\n I0,\n I1,\n I2,\n I3\n );\n\n I0 = S0 = S0 ^ x0,\n I1 = S1 = S1 ^ x1,\n I2 = S2 = S2 ^ x2,\n I3 = S3 = S3 ^ x3;\n }\n\n\n /**\n * CFB mode decryption\n * @param {number} x0 - 128-bit input block vector\n * @param {number} x1 - 128-bit input block vector\n * @param {number} x2 - 128-bit input block vector\n * @param {number} x3 - 128-bit input block vector\n */\n function _cfb_dec(x0, x1, x2, x3) {\n x0 = x0 | 0;\n x1 = x1 | 0;\n x2 = x2 | 0;\n x3 = x3 | 0;\n\n _core(\n 0x0000, 0x0800, 0x1000,\n R,\n I0,\n I1,\n I2,\n I3\n );\n\n S0 = S0 ^ x0,\n S1 = S1 ^ x1,\n S2 = S2 ^ x2,\n S3 = S3 ^ x3;\n\n I0 = x0,\n I1 = x1,\n I2 = x2,\n I3 = x3;\n }\n\n /**\n * OFB mode encryption / decryption\n * @param {number} x0 - 128-bit input block vector\n * @param {number} x1 - 128-bit input block vector\n * @param {number} x2 - 128-bit input block vector\n * @param {number} x3 - 128-bit input block vector\n */\n function _ofb(x0, x1, x2, x3) {\n x0 = x0 | 0;\n x1 = x1 | 0;\n x2 = x2 | 0;\n x3 = x3 | 0;\n\n _core(\n 0x0000, 0x0800, 0x1000,\n R,\n I0,\n I1,\n I2,\n I3\n );\n\n I0 = S0,\n I1 = S1,\n I2 = S2,\n I3 = S3;\n\n S0 = S0 ^ x0,\n S1 = S1 ^ x1,\n S2 = S2 ^ x2,\n S3 = S3 ^ x3;\n }\n\n /**\n * CTR mode encryption / decryption\n * @param {number} x0 - 128-bit input block vector\n * @param {number} x1 - 128-bit input block vector\n * @param {number} x2 - 128-bit input block vector\n * @param {number} x3 - 128-bit input block vector\n */\n function _ctr(x0, x1, x2, x3) {\n x0 = x0 | 0;\n x1 = x1 | 0;\n x2 = x2 | 0;\n x3 = x3 | 0;\n\n _core(\n 0x0000, 0x0800, 0x1000,\n R,\n N0,\n N1,\n N2,\n N3\n );\n\n N3 = (~M3 & N3) | M3 & (N3 + 1);\n N2 = (~M2 & N2) | M2 & (N2 + ((N3 | 0) == 0));\n N1 = (~M1 & N1) | M1 & (N1 + ((N2 | 0) == 0));\n N0 = (~M0 & N0) | M0 & (N0 + ((N1 | 0) == 0));\n\n S0 = S0 ^ x0;\n S1 = S1 ^ x1;\n S2 = S2 ^ x2;\n S3 = S3 ^ x3;\n }\n\n /**\n * GCM mode MAC calculation\n * @param {number} x0 - 128-bit input block vector\n * @param {number} x1 - 128-bit input block vector\n * @param {number} x2 - 128-bit input block vector\n * @param {number} x3 - 128-bit input block vector\n */\n function _gcm_mac(x0, x1, x2, x3) {\n x0 = x0 | 0;\n x1 = x1 | 0;\n x2 = x2 | 0;\n x3 = x3 | 0;\n\n var y0 = 0, y1 = 0, y2 = 0, y3 = 0,\n z0 = 0, z1 = 0, z2 = 0, z3 = 0,\n i = 0, c = 0;\n\n x0 = x0 ^ I0,\n x1 = x1 ^ I1,\n x2 = x2 ^ I2,\n x3 = x3 ^ I3;\n\n y0 = H0 | 0,\n y1 = H1 | 0,\n y2 = H2 | 0,\n y3 = H3 | 0;\n\n for (; (i | 0) < 128; i = (i + 1) | 0) {\n if (y0 >>> 31) {\n z0 = z0 ^ x0,\n z1 = z1 ^ x1,\n z2 = z2 ^ x2,\n z3 = z3 ^ x3;\n }\n\n y0 = (y0 << 1) | (y1 >>> 31),\n y1 = (y1 << 1) | (y2 >>> 31),\n y2 = (y2 << 1) | (y3 >>> 31),\n y3 = (y3 << 1);\n\n c = x3 & 1;\n\n x3 = (x3 >>> 1) | (x2 << 31),\n x2 = (x2 >>> 1) | (x1 << 31),\n x1 = (x1 >>> 1) | (x0 << 31),\n x0 = (x0 >>> 1);\n\n if (c) x0 = x0 ^ 0xe1000000;\n }\n\n I0 = z0,\n I1 = z1,\n I2 = z2,\n I3 = z3;\n }\n\n /**\n * Set the internal rounds number.\n * @instance\n * @memberof AES_asm\n * @param {number} r - number if inner AES rounds\n */\n function set_rounds(r) {\n r = r | 0;\n R = r;\n }\n\n /**\n * Populate the internal state of the module.\n * @instance\n * @memberof AES_asm\n * @param {number} s0 - state vector\n * @param {number} s1 - state vector\n * @param {number} s2 - state vector\n * @param {number} s3 - state vector\n */\n function set_state(s0, s1, s2, s3) {\n s0 = s0 | 0;\n s1 = s1 | 0;\n s2 = s2 | 0;\n s3 = s3 | 0;\n\n S0 = s0,\n S1 = s1,\n S2 = s2,\n S3 = s3;\n }\n\n /**\n * Populate the internal iv of the module.\n * @instance\n * @memberof AES_asm\n * @param {number} i0 - iv vector\n * @param {number} i1 - iv vector\n * @param {number} i2 - iv vector\n * @param {number} i3 - iv vector\n */\n function set_iv(i0, i1, i2, i3) {\n i0 = i0 | 0;\n i1 = i1 | 0;\n i2 = i2 | 0;\n i3 = i3 | 0;\n\n I0 = i0,\n I1 = i1,\n I2 = i2,\n I3 = i3;\n }\n\n /**\n * Set nonce for CTR-family modes.\n * @instance\n * @memberof AES_asm\n * @param {number} n0 - nonce vector\n * @param {number} n1 - nonce vector\n * @param {number} n2 - nonce vector\n * @param {number} n3 - nonce vector\n */\n function set_nonce(n0, n1, n2, n3) {\n n0 = n0 | 0;\n n1 = n1 | 0;\n n2 = n2 | 0;\n n3 = n3 | 0;\n\n N0 = n0,\n N1 = n1,\n N2 = n2,\n N3 = n3;\n }\n\n /**\n * Set counter mask for CTR-family modes.\n * @instance\n * @memberof AES_asm\n * @param {number} m0 - counter mask vector\n * @param {number} m1 - counter mask vector\n * @param {number} m2 - counter mask vector\n * @param {number} m3 - counter mask vector\n */\n function set_mask(m0, m1, m2, m3) {\n m0 = m0 | 0;\n m1 = m1 | 0;\n m2 = m2 | 0;\n m3 = m3 | 0;\n\n M0 = m0,\n M1 = m1,\n M2 = m2,\n M3 = m3;\n }\n\n /**\n * Set counter for CTR-family modes.\n * @instance\n * @memberof AES_asm\n * @param {number} c0 - counter vector\n * @param {number} c1 - counter vector\n * @param {number} c2 - counter vector\n * @param {number} c3 - counter vector\n */\n function set_counter(c0, c1, c2, c3) {\n c0 = c0 | 0;\n c1 = c1 | 0;\n c2 = c2 | 0;\n c3 = c3 | 0;\n\n N3 = (~M3 & N3) | M3 & c3,\n N2 = (~M2 & N2) | M2 & c2,\n N1 = (~M1 & N1) | M1 & c1,\n N0 = (~M0 & N0) | M0 & c0;\n }\n\n /**\n * Store the internal state vector into the heap.\n * @instance\n * @memberof AES_asm\n * @param {number} pos - offset where to put the data\n * @return {number} The number of bytes have been written into the heap, always 16.\n */\n function get_state(pos) {\n pos = pos | 0;\n\n if (pos & 15) return -1;\n\n DATA[pos | 0] = S0 >>> 24,\n DATA[pos | 1] = S0 >>> 16 & 255,\n DATA[pos | 2] = S0 >>> 8 & 255,\n DATA[pos | 3] = S0 & 255,\n DATA[pos | 4] = S1 >>> 24,\n DATA[pos | 5] = S1 >>> 16 & 255,\n DATA[pos | 6] = S1 >>> 8 & 255,\n DATA[pos | 7] = S1 & 255,\n DATA[pos | 8] = S2 >>> 24,\n DATA[pos | 9] = S2 >>> 16 & 255,\n DATA[pos | 10] = S2 >>> 8 & 255,\n DATA[pos | 11] = S2 & 255,\n DATA[pos | 12] = S3 >>> 24,\n DATA[pos | 13] = S3 >>> 16 & 255,\n DATA[pos | 14] = S3 >>> 8 & 255,\n DATA[pos | 15] = S3 & 255;\n\n return 16;\n }\n\n /**\n * Store the internal iv vector into the heap.\n * @instance\n * @memberof AES_asm\n * @param {number} pos - offset where to put the data\n * @return {number} The number of bytes have been written into the heap, always 16.\n */\n function get_iv(pos) {\n pos = pos | 0;\n\n if (pos & 15) return -1;\n\n DATA[pos | 0] = I0 >>> 24,\n DATA[pos | 1] = I0 >>> 16 & 255,\n DATA[pos | 2] = I0 >>> 8 & 255,\n DATA[pos | 3] = I0 & 255,\n DATA[pos | 4] = I1 >>> 24,\n DATA[pos | 5] = I1 >>> 16 & 255,\n DATA[pos | 6] = I1 >>> 8 & 255,\n DATA[pos | 7] = I1 & 255,\n DATA[pos | 8] = I2 >>> 24,\n DATA[pos | 9] = I2 >>> 16 & 255,\n DATA[pos | 10] = I2 >>> 8 & 255,\n DATA[pos | 11] = I2 & 255,\n DATA[pos | 12] = I3 >>> 24,\n DATA[pos | 13] = I3 >>> 16 & 255,\n DATA[pos | 14] = I3 >>> 8 & 255,\n DATA[pos | 15] = I3 & 255;\n\n return 16;\n }\n\n /**\n * GCM initialization.\n * @instance\n * @memberof AES_asm\n */\n function gcm_init() {\n _ecb_enc(0, 0, 0, 0);\n H0 = S0,\n H1 = S1,\n H2 = S2,\n H3 = S3;\n }\n\n /**\n * Perform ciphering operation on the supplied data.\n * @instance\n * @memberof AES_asm\n * @param {number} mode - block cipher mode (see {@link AES_asm} mode constants)\n * @param {number} pos - offset of the data being processed\n * @param {number} len - length of the data being processed\n * @return {number} Actual amount of data have been processed.\n */\n function cipher(mode, pos, len) {\n mode = mode | 0;\n pos = pos | 0;\n len = len | 0;\n\n var ret = 0;\n\n if (pos & 15) return -1;\n\n while ((len | 0) >= 16) {\n _cipher_modes[mode & 7](\n DATA[pos | 0] << 24 | DATA[pos | 1] << 16 | DATA[pos | 2] << 8 | DATA[pos | 3],\n DATA[pos | 4] << 24 | DATA[pos | 5] << 16 | DATA[pos | 6] << 8 | DATA[pos | 7],\n DATA[pos | 8] << 24 | DATA[pos | 9] << 16 | DATA[pos | 10] << 8 | DATA[pos | 11],\n DATA[pos | 12] << 24 | DATA[pos | 13] << 16 | DATA[pos | 14] << 8 | DATA[pos | 15]\n );\n\n DATA[pos | 0] = S0 >>> 24,\n DATA[pos | 1] = S0 >>> 16 & 255,\n DATA[pos | 2] = S0 >>> 8 & 255,\n DATA[pos | 3] = S0 & 255,\n DATA[pos | 4] = S1 >>> 24,\n DATA[pos | 5] = S1 >>> 16 & 255,\n DATA[pos | 6] = S1 >>> 8 & 255,\n DATA[pos | 7] = S1 & 255,\n DATA[pos | 8] = S2 >>> 24,\n DATA[pos | 9] = S2 >>> 16 & 255,\n DATA[pos | 10] = S2 >>> 8 & 255,\n DATA[pos | 11] = S2 & 255,\n DATA[pos | 12] = S3 >>> 24,\n DATA[pos | 13] = S3 >>> 16 & 255,\n DATA[pos | 14] = S3 >>> 8 & 255,\n DATA[pos | 15] = S3 & 255;\n\n ret = (ret + 16) | 0,\n pos = (pos + 16) | 0,\n len = (len - 16) | 0;\n }\n\n return ret | 0;\n }\n\n /**\n * Calculates MAC of the supplied data.\n * @instance\n * @memberof AES_asm\n * @param {number} mode - block cipher mode (see {@link AES_asm} mode constants)\n * @param {number} pos - offset of the data being processed\n * @param {number} len - length of the data being processed\n * @return {number} Actual amount of data have been processed.\n */\n function mac(mode, pos, len) {\n mode = mode | 0;\n pos = pos | 0;\n len = len | 0;\n\n var ret = 0;\n\n if (pos & 15) return -1;\n\n while ((len | 0) >= 16) {\n _mac_modes[mode & 1](\n DATA[pos | 0] << 24 | DATA[pos | 1] << 16 | DATA[pos | 2] << 8 | DATA[pos | 3],\n DATA[pos | 4] << 24 | DATA[pos | 5] << 16 | DATA[pos | 6] << 8 | DATA[pos | 7],\n DATA[pos | 8] << 24 | DATA[pos | 9] << 16 | DATA[pos | 10] << 8 | DATA[pos | 11],\n DATA[pos | 12] << 24 | DATA[pos | 13] << 16 | DATA[pos | 14] << 8 | DATA[pos | 15]\n );\n\n ret = (ret + 16) | 0,\n pos = (pos + 16) | 0,\n len = (len - 16) | 0;\n }\n\n return ret | 0;\n }\n\n /**\n * AES cipher modes table (virual methods)\n */\n var _cipher_modes = [_ecb_enc, _ecb_dec, _cbc_enc, _cbc_dec, _cfb_enc, _cfb_dec, _ofb, _ctr];\n\n /**\n * AES MAC modes table (virual methods)\n */\n var _mac_modes = [_cbc_enc, _gcm_mac];\n\n /**\n * Asm.js module exports\n */\n return {\n set_rounds: set_rounds,\n set_state: set_state,\n set_iv: set_iv,\n set_nonce: set_nonce,\n set_mask: set_mask,\n set_counter: set_counter,\n get_state: get_state,\n get_iv: get_iv,\n gcm_init: gcm_init,\n cipher: cipher,\n mac: mac,\n };\n }(stdlib, foreign, buffer);\n\n asm.set_key = set_key;\n\n return asm;\n };\n\n /**\n * AES enciphering mode constants\n * @enum {number}\n * @const\n */\n wrapper.ENC = {\n ECB: 0,\n CBC: 2,\n CFB: 4,\n OFB: 6,\n CTR: 7,\n },\n\n /**\n * AES deciphering mode constants\n * @enum {number}\n * @const\n */\n wrapper.DEC = {\n ECB: 1,\n CBC: 3,\n CFB: 5,\n OFB: 6,\n CTR: 7,\n },\n\n /**\n * AES MAC mode constants\n * @enum {number}\n * @const\n */\n wrapper.MAC = {\n CBC: 0,\n GCM: 1,\n };\n\n /**\n * Heap data offset\n * @type {number}\n * @const\n */\n wrapper.HEAP_DATA = 0x4000;\n\n return wrapper;\n}();\n","const local_atob = typeof atob === 'undefined' ? (str) => require('buffer').Buffer.from(str, 'base64').toString('binary') : atob;\nconst local_btoa = typeof btoa === 'undefined' ? (str) => require('buffer').Buffer.from(str, 'binary').toString('base64') : btoa;\nexport function string_to_bytes(str, utf8 = false) {\n var len = str.length, bytes = new Uint8Array(utf8 ? 4 * len : len);\n for (var i = 0, j = 0; i < len; i++) {\n var c = str.charCodeAt(i);\n if (utf8 && 0xd800 <= c && c <= 0xdbff) {\n if (++i >= len)\n throw new Error('Malformed string, low surrogate expected at position ' + i);\n c = ((c ^ 0xd800) << 10) | 0x10000 | (str.charCodeAt(i) ^ 0xdc00);\n }\n else if (!utf8 && c >>> 8) {\n throw new Error('Wide characters are not allowed.');\n }\n if (!utf8 || c <= 0x7f) {\n bytes[j++] = c;\n }\n else if (c <= 0x7ff) {\n bytes[j++] = 0xc0 | (c >> 6);\n bytes[j++] = 0x80 | (c & 0x3f);\n }\n else if (c <= 0xffff) {\n bytes[j++] = 0xe0 | (c >> 12);\n bytes[j++] = 0x80 | ((c >> 6) & 0x3f);\n bytes[j++] = 0x80 | (c & 0x3f);\n }\n else {\n bytes[j++] = 0xf0 | (c >> 18);\n bytes[j++] = 0x80 | ((c >> 12) & 0x3f);\n bytes[j++] = 0x80 | ((c >> 6) & 0x3f);\n bytes[j++] = 0x80 | (c & 0x3f);\n }\n }\n return bytes.subarray(0, j);\n}\nexport function hex_to_bytes(str) {\n var len = str.length;\n if (len & 1) {\n str = '0' + str;\n len++;\n }\n var bytes = new Uint8Array(len >> 1);\n for (var i = 0; i < len; i += 2) {\n bytes[i >> 1] = parseInt(str.substr(i, 2), 16);\n }\n return bytes;\n}\nexport function base64_to_bytes(str) {\n return string_to_bytes(local_atob(str));\n}\nexport function bytes_to_string(bytes, utf8 = false) {\n var len = bytes.length, chars = new Array(len);\n for (var i = 0, j = 0; i < len; i++) {\n var b = bytes[i];\n if (!utf8 || b < 128) {\n chars[j++] = b;\n }\n else if (b >= 192 && b < 224 && i + 1 < len) {\n chars[j++] = ((b & 0x1f) << 6) | (bytes[++i] & 0x3f);\n }\n else if (b >= 224 && b < 240 && i + 2 < len) {\n chars[j++] = ((b & 0xf) << 12) | ((bytes[++i] & 0x3f) << 6) | (bytes[++i] & 0x3f);\n }\n else if (b >= 240 && b < 248 && i + 3 < len) {\n var c = ((b & 7) << 18) | ((bytes[++i] & 0x3f) << 12) | ((bytes[++i] & 0x3f) << 6) | (bytes[++i] & 0x3f);\n if (c <= 0xffff) {\n chars[j++] = c;\n }\n else {\n c ^= 0x10000;\n chars[j++] = 0xd800 | (c >> 10);\n chars[j++] = 0xdc00 | (c & 0x3ff);\n }\n }\n else {\n throw new Error('Malformed UTF8 character at byte offset ' + i);\n }\n }\n var str = '', bs = 16384;\n for (var i = 0; i < j; i += bs) {\n str += String.fromCharCode.apply(String, chars.slice(i, i + bs <= j ? i + bs : j));\n }\n return str;\n}\nexport function bytes_to_hex(arr) {\n var str = '';\n for (var i = 0; i < arr.length; i++) {\n var h = (arr[i] & 0xff).toString(16);\n if (h.length < 2)\n str += '0';\n str += h;\n }\n return str;\n}\nexport function bytes_to_base64(arr) {\n return local_btoa(bytes_to_string(arr));\n}\nexport function pow2_ceil(a) {\n a -= 1;\n a |= a >>> 1;\n a |= a >>> 2;\n a |= a >>> 4;\n a |= a >>> 8;\n a |= a >>> 16;\n a += 1;\n return a;\n}\nexport function is_number(a) {\n return typeof a === 'number';\n}\nexport function is_string(a) {\n return typeof a === 'string';\n}\nexport function is_buffer(a) {\n return a instanceof ArrayBuffer;\n}\nexport function is_bytes(a) {\n return a instanceof Uint8Array;\n}\nexport function is_typed_array(a) {\n return (a instanceof Int8Array ||\n a instanceof Uint8Array ||\n a instanceof Int16Array ||\n a instanceof Uint16Array ||\n a instanceof Int32Array ||\n a instanceof Uint32Array ||\n a instanceof Float32Array ||\n a instanceof Float64Array);\n}\nexport function _heap_init(heap, heapSize) {\n const size = heap ? heap.byteLength : heapSize || 65536;\n if (size & 0xfff || size <= 0)\n throw new Error('heap size must be a positive integer and a multiple of 4096');\n heap = heap || new Uint8Array(new ArrayBuffer(size));\n return heap;\n}\nexport function _heap_write(heap, hpos, data, dpos, dlen) {\n const hlen = heap.length - hpos;\n const wlen = hlen < dlen ? hlen : dlen;\n heap.set(data.subarray(dpos, dpos + wlen), hpos);\n return wlen;\n}\nexport function joinBytes(...arg) {\n const totalLenght = arg.reduce((sum, curr) => sum + curr.length, 0);\n const ret = new Uint8Array(totalLenght);\n let cursor = 0;\n for (let i = 0; i < arg.length; i++) {\n ret.set(arg[i], cursor);\n cursor += arg[i].length;\n }\n return ret;\n}\n","export class IllegalStateError extends Error {\n constructor(...args) {\n super(...args);\n Object.create(Error.prototype, { name: { value: 'IllegalStateError' } });\n }\n}\nexport class IllegalArgumentError extends Error {\n constructor(...args) {\n super(...args);\n Object.create(Error.prototype, { name: { value: 'IllegalArgumentError' } });\n }\n}\nexport class SecurityError extends Error {\n constructor(...args) {\n super(...args);\n Object.create(Error.prototype, { name: { value: 'SecurityError' } });\n }\n}\n","import { AES_asm } from './aes.asm';\nimport { _heap_init, _heap_write, is_bytes } from '../other/utils';\nimport { IllegalArgumentError, SecurityError } from '../other/errors';\nconst heap_pool = [];\nconst asm_pool = [];\nexport class AES {\n constructor(key, iv, padding = true, mode, heap, asm) {\n this.pos = 0;\n this.len = 0;\n this.mode = mode;\n // The AES object state\n this.pos = 0;\n this.len = 0;\n this.key = key;\n this.iv = iv;\n this.padding = padding;\n // The AES \"worker\"\n this.acquire_asm(heap, asm);\n }\n acquire_asm(heap, asm) {\n if (this.heap === undefined || this.asm === undefined) {\n this.heap = heap || heap_pool.pop() || _heap_init().subarray(AES_asm.HEAP_DATA);\n this.asm = asm || asm_pool.pop() || new AES_asm(null, this.heap.buffer);\n this.reset(this.key, this.iv);\n }\n return { heap: this.heap, asm: this.asm };\n }\n release_asm() {\n if (this.heap !== undefined && this.asm !== undefined) {\n heap_pool.push(this.heap);\n asm_pool.push(this.asm);\n }\n this.heap = undefined;\n this.asm = undefined;\n }\n reset(key, iv) {\n const { asm } = this.acquire_asm();\n // Key\n const keylen = key.length;\n if (keylen !== 16 && keylen !== 24 && keylen !== 32)\n throw new IllegalArgumentError('illegal key size');\n const keyview = new DataView(key.buffer, key.byteOffset, key.byteLength);\n asm.set_key(keylen >> 2, keyview.getUint32(0), keyview.getUint32(4), keyview.getUint32(8), keyview.getUint32(12), keylen > 16 ? keyview.getUint32(16) : 0, keylen > 16 ? keyview.getUint32(20) : 0, keylen > 24 ? keyview.getUint32(24) : 0, keylen > 24 ? keyview.getUint32(28) : 0);\n // IV\n if (iv !== undefined) {\n if (iv.length !== 16)\n throw new IllegalArgumentError('illegal iv size');\n let ivview = new DataView(iv.buffer, iv.byteOffset, iv.byteLength);\n asm.set_iv(ivview.getUint32(0), ivview.getUint32(4), ivview.getUint32(8), ivview.getUint32(12));\n }\n else {\n asm.set_iv(0, 0, 0, 0);\n }\n }\n AES_Encrypt_process(data) {\n if (!is_bytes(data))\n throw new TypeError(\"data isn't of expected type\");\n let { heap, asm } = this.acquire_asm();\n let amode = AES_asm.ENC[this.mode];\n let hpos = AES_asm.HEAP_DATA;\n let pos = this.pos;\n let len = this.len;\n let dpos = 0;\n let dlen = data.length || 0;\n let rpos = 0;\n let rlen = (len + dlen) & -16;\n let wlen = 0;\n let result = new Uint8Array(rlen);\n while (dlen > 0) {\n wlen = _heap_write(heap, pos + len, data, dpos, dlen);\n len += wlen;\n dpos += wlen;\n dlen -= wlen;\n wlen = asm.cipher(amode, hpos + pos, len);\n if (wlen)\n result.set(heap.subarray(pos, pos + wlen), rpos);\n rpos += wlen;\n if (wlen < len) {\n pos += wlen;\n len -= wlen;\n }\n else {\n pos = 0;\n len = 0;\n }\n }\n this.pos = pos;\n this.len = len;\n return result;\n }\n AES_Encrypt_finish() {\n let { heap, asm } = this.acquire_asm();\n let amode = AES_asm.ENC[this.mode];\n let hpos = AES_asm.HEAP_DATA;\n let pos = this.pos;\n let len = this.len;\n let plen = 16 - (len % 16);\n let rlen = len;\n if (this.hasOwnProperty('padding')) {\n if (this.padding) {\n for (let p = 0; p < plen; ++p) {\n heap[pos + len + p] = plen;\n }\n len += plen;\n rlen = len;\n }\n else if (len % 16) {\n throw new IllegalArgumentError('data length must be a multiple of the block size');\n }\n }\n else {\n len += plen;\n }\n const result = new Uint8Array(rlen);\n if (len)\n asm.cipher(amode, hpos + pos, len);\n if (rlen)\n result.set(heap.subarray(pos, pos + rlen));\n this.pos = 0;\n this.len = 0;\n this.release_asm();\n return result;\n }\n AES_Decrypt_process(data) {\n if (!is_bytes(data))\n throw new TypeError(\"data isn't of expected type\");\n let { heap, asm } = this.acquire_asm();\n let amode = AES_asm.DEC[this.mode];\n let hpos = AES_asm.HEAP_DATA;\n let pos = this.pos;\n let len = this.len;\n let dpos = 0;\n let dlen = data.length || 0;\n let rpos = 0;\n let rlen = (len + dlen) & -16;\n let plen = 0;\n let wlen = 0;\n if (this.padding) {\n plen = len + dlen - rlen || 16;\n rlen -= plen;\n }\n const result = new Uint8Array(rlen);\n while (dlen > 0) {\n wlen = _heap_write(heap, pos + len, data, dpos, dlen);\n len += wlen;\n dpos += wlen;\n dlen -= wlen;\n wlen = asm.cipher(amode, hpos + pos, len - (!dlen ? plen : 0));\n if (wlen)\n result.set(heap.subarray(pos, pos + wlen), rpos);\n rpos += wlen;\n if (wlen < len) {\n pos += wlen;\n len -= wlen;\n }\n else {\n pos = 0;\n len = 0;\n }\n }\n this.pos = pos;\n this.len = len;\n return result;\n }\n AES_Decrypt_finish() {\n let { heap, asm } = this.acquire_asm();\n let amode = AES_asm.DEC[this.mode];\n let hpos = AES_asm.HEAP_DATA;\n let pos = this.pos;\n let len = this.len;\n let rlen = len;\n if (len > 0) {\n if (len % 16) {\n if (this.hasOwnProperty('padding')) {\n throw new IllegalArgumentError('data length must be a multiple of the block size');\n }\n else {\n len += 16 - (len % 16);\n }\n }\n asm.cipher(amode, hpos + pos, len);\n if (this.hasOwnProperty('padding') && this.padding) {\n let pad = heap[pos + rlen - 1];\n if (pad < 1 || pad > 16 || pad > rlen)\n throw new SecurityError('bad padding');\n let pcheck = 0;\n for (let i = pad; i > 1; i--)\n pcheck |= pad ^ heap[pos + rlen - i];\n if (pcheck)\n throw new SecurityError('bad padding');\n rlen -= pad;\n }\n }\n const result = new Uint8Array(rlen);\n if (rlen > 0) {\n result.set(heap.subarray(pos, pos + rlen));\n }\n this.pos = 0;\n this.len = 0;\n this.release_asm();\n return result;\n }\n}\n","import { AES } from './aes';\nimport { joinBytes } from '../other/utils';\nexport class AES_ECB {\n static encrypt(data, key, padding = false) {\n return new AES_ECB(key, padding).encrypt(data);\n }\n static decrypt(data, key, padding = false) {\n return new AES_ECB(key, padding).decrypt(data);\n }\n constructor(key, padding = false, aes) {\n this.aes = aes ? aes : new AES(key, undefined, padding, 'ECB');\n }\n encrypt(data) {\n const r1 = this.aes.AES_Encrypt_process(data);\n const r2 = this.aes.AES_Encrypt_finish();\n return joinBytes(r1, r2);\n }\n decrypt(data) {\n const r1 = this.aes.AES_Decrypt_process(data);\n const r2 = this.aes.AES_Decrypt_finish();\n return joinBytes(r1, r2);\n }\n}\n","import { AES_ECB } from '@openpgp/asmcrypto.js/dist_es8/aes/ecb';\n\n/**\n * Javascript AES implementation.\n * This is used as fallback if the native Crypto APIs are not available.\n */\nfunction aes(length) {\n const C = function(key) {\n const aesECB = new AES_ECB(key);\n\n this.encrypt = function(block) {\n return aesECB.encrypt(block);\n };\n\n this.decrypt = function(block) {\n return aesECB.decrypt(block);\n };\n };\n\n C.blockSize = C.prototype.blockSize = 16;\n C.keySize = C.prototype.keySize = length / 8;\n\n return C;\n}\n\nexport default aes;\n","//Paul Tero, July 2001\n//http://www.tero.co.uk/des/\n//\n//Optimised for performance with large blocks by Michael Hayworth, November 2001\n//http://www.netdealing.com\n//\n// Modified by Recurity Labs GmbH\n\n//THIS SOFTWARE IS PROVIDED \"AS IS\" AND\n//ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n//IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n//ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE\n//FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n//DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n//OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n//HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\n//OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n//SUCH DAMAGE.\n\n//des\n//this takes the key, the message, and whether to encrypt or decrypt\n\nfunction des(keys, message, encrypt, mode, iv, padding) {\n //declaring this locally speeds things up a bit\n const spfunction1 = [\n 0x1010400, 0, 0x10000, 0x1010404, 0x1010004, 0x10404, 0x4, 0x10000, 0x400, 0x1010400,\n 0x1010404, 0x400, 0x1000404, 0x1010004, 0x1000000, 0x4, 0x404, 0x1000400, 0x1000400, 0x10400, 0x10400, 0x1010000,\n 0x1010000, 0x1000404, 0x10004, 0x1000004, 0x1000004, 0x10004, 0, 0x404, 0x10404, 0x1000000, 0x10000, 0x1010404, 0x4,\n 0x1010000, 0x1010400, 0x1000000, 0x1000000, 0x400, 0x1010004, 0x10000, 0x10400, 0x1000004, 0x400, 0x4, 0x1000404,\n 0x10404, 0x1010404, 0x10004, 0x1010000, 0x1000404, 0x1000004, 0x404, 0x10404, 0x1010400, 0x404, 0x1000400,\n 0x1000400, 0, 0x10004, 0x10400, 0, 0x1010004\n ];\n const spfunction2 = [\n -0x7fef7fe0, -0x7fff8000, 0x8000, 0x108020, 0x100000, 0x20, -0x7fefffe0, -0x7fff7fe0,\n -0x7fffffe0, -0x7fef7fe0, -0x7fef8000, -0x80000000, -0x7fff8000, 0x100000, 0x20, -0x7fefffe0, 0x108000, 0x100020,\n -0x7fff7fe0, 0, -0x80000000, 0x8000, 0x108020, -0x7ff00000, 0x100020, -0x7fffffe0, 0, 0x108000, 0x8020, -0x7fef8000,\n -0x7ff00000, 0x8020, 0, 0x108020, -0x7fefffe0, 0x100000, -0x7fff7fe0, -0x7ff00000, -0x7fef8000, 0x8000, -0x7ff00000,\n -0x7fff8000, 0x20, -0x7fef7fe0, 0x108020, 0x20, 0x8000, -0x80000000, 0x8020, -0x7fef8000, 0x100000, -0x7fffffe0,\n 0x100020, -0x7fff7fe0, -0x7fffffe0, 0x100020, 0x108000, 0, -0x7fff8000, 0x8020, -0x80000000, -0x7fefffe0,\n -0x7fef7fe0, 0x108000\n ];\n const spfunction3 = [\n 0x208, 0x8020200, 0, 0x8020008, 0x8000200, 0, 0x20208, 0x8000200, 0x20008, 0x8000008,\n 0x8000008, 0x20000, 0x8020208, 0x20008, 0x8020000, 0x208, 0x8000000, 0x8, 0x8020200, 0x200, 0x20200, 0x8020000,\n 0x8020008, 0x20208, 0x8000208, 0x20200, 0x20000, 0x8000208, 0x8, 0x8020208, 0x200, 0x8000000, 0x8020200, 0x8000000,\n 0x20008, 0x208, 0x20000, 0x8020200, 0x8000200, 0, 0x200, 0x20008, 0x8020208, 0x8000200, 0x8000008, 0x200, 0,\n 0x8020008, 0x8000208, 0x20000, 0x8000000, 0x8020208, 0x8, 0x20208, 0x20200, 0x8000008, 0x8020000, 0x8000208, 0x208,\n 0x8020000, 0x20208, 0x8, 0x8020008, 0x20200\n ];\n const spfunction4 = [\n 0x802001, 0x2081, 0x2081, 0x80, 0x802080, 0x800081, 0x800001, 0x2001, 0, 0x802000,\n 0x802000, 0x802081, 0x81, 0, 0x800080, 0x800001, 0x1, 0x2000, 0x800000, 0x802001, 0x80, 0x800000, 0x2001, 0x2080,\n 0x800081, 0x1, 0x2080, 0x800080, 0x2000, 0x802080, 0x802081, 0x81, 0x800080, 0x800001, 0x802000, 0x802081, 0x81, 0,\n 0, 0x802000, 0x2080, 0x800080, 0x800081, 0x1, 0x802001, 0x2081, 0x2081, 0x80, 0x802081, 0x81, 0x1, 0x2000, 0x800001,\n 0x2001, 0x802080, 0x800081, 0x2001, 0x2080, 0x800000, 0x802001, 0x80, 0x800000, 0x2000, 0x802080\n ];\n const spfunction5 = [\n 0x100, 0x2080100, 0x2080000, 0x42000100, 0x80000, 0x100, 0x40000000, 0x2080000,\n 0x40080100, 0x80000, 0x2000100, 0x40080100, 0x42000100, 0x42080000, 0x80100, 0x40000000, 0x2000000, 0x40080000,\n 0x40080000, 0, 0x40000100, 0x42080100, 0x42080100, 0x2000100, 0x42080000, 0x40000100, 0, 0x42000000, 0x2080100,\n 0x2000000, 0x42000000, 0x80100, 0x80000, 0x42000100, 0x100, 0x2000000, 0x40000000, 0x2080000, 0x42000100,\n 0x40080100, 0x2000100, 0x40000000, 0x42080000, 0x2080100, 0x40080100, 0x100, 0x2000000, 0x42080000, 0x42080100,\n 0x80100, 0x42000000, 0x42080100, 0x2080000, 0, 0x40080000, 0x42000000, 0x80100, 0x2000100, 0x40000100, 0x80000, 0,\n 0x40080000, 0x2080100, 0x40000100\n ];\n const spfunction6 = [\n 0x20000010, 0x20400000, 0x4000, 0x20404010, 0x20400000, 0x10, 0x20404010, 0x400000,\n 0x20004000, 0x404010, 0x400000, 0x20000010, 0x400010, 0x20004000, 0x20000000, 0x4010, 0, 0x400010, 0x20004010,\n 0x4000, 0x404000, 0x20004010, 0x10, 0x20400010, 0x20400010, 0, 0x404010, 0x20404000, 0x4010, 0x404000, 0x20404000,\n 0x20000000, 0x20004000, 0x10, 0x20400010, 0x404000, 0x20404010, 0x400000, 0x4010, 0x20000010, 0x400000, 0x20004000,\n 0x20000000, 0x4010, 0x20000010, 0x20404010, 0x404000, 0x20400000, 0x404010, 0x20404000, 0, 0x20400010, 0x10, 0x4000,\n 0x20400000, 0x404010, 0x4000, 0x400010, 0x20004010, 0, 0x20404000, 0x20000000, 0x400010, 0x20004010\n ];\n const spfunction7 = [\n 0x200000, 0x4200002, 0x4000802, 0, 0x800, 0x4000802, 0x200802, 0x4200800, 0x4200802,\n 0x200000, 0, 0x4000002, 0x2, 0x4000000, 0x4200002, 0x802, 0x4000800, 0x200802, 0x200002, 0x4000800, 0x4000002,\n 0x4200000, 0x4200800, 0x200002, 0x4200000, 0x800, 0x802, 0x4200802, 0x200800, 0x2, 0x4000000, 0x200800, 0x4000000,\n 0x200800, 0x200000, 0x4000802, 0x4000802, 0x4200002, 0x4200002, 0x2, 0x200002, 0x4000000, 0x4000800, 0x200000,\n 0x4200800, 0x802, 0x200802, 0x4200800, 0x802, 0x4000002, 0x4200802, 0x4200000, 0x200800, 0, 0x2, 0x4200802, 0,\n 0x200802, 0x4200000, 0x800, 0x4000002, 0x4000800, 0x800, 0x200002\n ];\n const spfunction8 = [\n 0x10001040, 0x1000, 0x40000, 0x10041040, 0x10000000, 0x10001040, 0x40, 0x10000000,\n 0x40040, 0x10040000, 0x10041040, 0x41000, 0x10041000, 0x41040, 0x1000, 0x40, 0x10040000, 0x10000040, 0x10001000,\n 0x1040, 0x41000, 0x40040, 0x10040040, 0x10041000, 0x1040, 0, 0, 0x10040040, 0x10000040, 0x10001000, 0x41040,\n 0x40000, 0x41040, 0x40000, 0x10041000, 0x1000, 0x40, 0x10040040, 0x1000, 0x41040, 0x10001000, 0x40, 0x10000040,\n 0x10040000, 0x10040040, 0x10000000, 0x40000, 0x10001040, 0, 0x10041040, 0x40040, 0x10000040, 0x10040000, 0x10001000,\n 0x10001040, 0, 0x10041040, 0x41000, 0x41000, 0x1040, 0x1040, 0x40040, 0x10000000, 0x10041000\n ];\n\n //create the 16 or 48 subkeys we will need\n let m = 0;\n let i;\n let j;\n let temp;\n let right1;\n let right2;\n let left;\n let right;\n let looping;\n let cbcleft;\n let cbcleft2;\n let cbcright;\n let cbcright2;\n let endloop;\n let loopinc;\n let len = message.length;\n\n //set up the loops for single and triple des\n const iterations = keys.length === 32 ? 3 : 9; //single or triple des\n if (iterations === 3) {\n looping = encrypt ? [0, 32, 2] : [30, -2, -2];\n } else {\n looping = encrypt ? [0, 32, 2, 62, 30, -2, 64, 96, 2] : [94, 62, -2, 32, 64, 2, 30, -2, -2];\n }\n\n //pad the message depending on the padding parameter\n //only add padding if encrypting - note that you need to use the same padding option for both encrypt and decrypt\n if (encrypt) {\n message = desAddPadding(message, padding);\n len = message.length;\n }\n\n //store the result here\n let result = new Uint8Array(len);\n let k = 0;\n\n if (mode === 1) { //CBC mode\n cbcleft = (iv[m++] << 24) | (iv[m++] << 16) | (iv[m++] << 8) | iv[m++];\n cbcright = (iv[m++] << 24) | (iv[m++] << 16) | (iv[m++] << 8) | iv[m++];\n m = 0;\n }\n\n //loop through each 64 bit chunk of the message\n while (m < len) {\n left = (message[m++] << 24) | (message[m++] << 16) | (message[m++] << 8) | message[m++];\n right = (message[m++] << 24) | (message[m++] << 16) | (message[m++] << 8) | message[m++];\n\n //for Cipher Block Chaining mode, xor the message with the previous result\n if (mode === 1) {\n if (encrypt) {\n left ^= cbcleft;\n right ^= cbcright;\n } else {\n cbcleft2 = cbcleft;\n cbcright2 = cbcright;\n cbcleft = left;\n cbcright = right;\n }\n }\n\n //first each 64 but chunk of the message must be permuted according to IP\n temp = ((left >>> 4) ^ right) & 0x0f0f0f0f;\n right ^= temp;\n left ^= (temp << 4);\n temp = ((left >>> 16) ^ right) & 0x0000ffff;\n right ^= temp;\n left ^= (temp << 16);\n temp = ((right >>> 2) ^ left) & 0x33333333;\n left ^= temp;\n right ^= (temp << 2);\n temp = ((right >>> 8) ^ left) & 0x00ff00ff;\n left ^= temp;\n right ^= (temp << 8);\n temp = ((left >>> 1) ^ right) & 0x55555555;\n right ^= temp;\n left ^= (temp << 1);\n\n left = ((left << 1) | (left >>> 31));\n right = ((right << 1) | (right >>> 31));\n\n //do this either 1 or 3 times for each chunk of the message\n for (j = 0; j < iterations; j += 3) {\n endloop = looping[j + 1];\n loopinc = looping[j + 2];\n //now go through and perform the encryption or decryption\n for (i = looping[j]; i !== endloop; i += loopinc) { //for efficiency\n right1 = right ^ keys[i];\n right2 = ((right >>> 4) | (right << 28)) ^ keys[i + 1];\n //the result is attained by passing these bytes through the S selection functions\n temp = left;\n left = right;\n right = temp ^ (spfunction2[(right1 >>> 24) & 0x3f] | spfunction4[(right1 >>> 16) & 0x3f] | spfunction6[(right1 >>>\n 8) & 0x3f] | spfunction8[right1 & 0x3f] | spfunction1[(right2 >>> 24) & 0x3f] | spfunction3[(right2 >>> 16) &\n 0x3f] | spfunction5[(right2 >>> 8) & 0x3f] | spfunction7[right2 & 0x3f]);\n }\n temp = left;\n left = right;\n right = temp; //unreverse left and right\n } //for either 1 or 3 iterations\n\n //move then each one bit to the right\n left = ((left >>> 1) | (left << 31));\n right = ((right >>> 1) | (right << 31));\n\n //now perform IP-1, which is IP in the opposite direction\n temp = ((left >>> 1) ^ right) & 0x55555555;\n right ^= temp;\n left ^= (temp << 1);\n temp = ((right >>> 8) ^ left) & 0x00ff00ff;\n left ^= temp;\n right ^= (temp << 8);\n temp = ((right >>> 2) ^ left) & 0x33333333;\n left ^= temp;\n right ^= (temp << 2);\n temp = ((left >>> 16) ^ right) & 0x0000ffff;\n right ^= temp;\n left ^= (temp << 16);\n temp = ((left >>> 4) ^ right) & 0x0f0f0f0f;\n right ^= temp;\n left ^= (temp << 4);\n\n //for Cipher Block Chaining mode, xor the message with the previous result\n if (mode === 1) {\n if (encrypt) {\n cbcleft = left;\n cbcright = right;\n } else {\n left ^= cbcleft2;\n right ^= cbcright2;\n }\n }\n\n result[k++] = (left >>> 24);\n result[k++] = ((left >>> 16) & 0xff);\n result[k++] = ((left >>> 8) & 0xff);\n result[k++] = (left & 0xff);\n result[k++] = (right >>> 24);\n result[k++] = ((right >>> 16) & 0xff);\n result[k++] = ((right >>> 8) & 0xff);\n result[k++] = (right & 0xff);\n } //for every 8 characters, or 64 bits in the message\n\n //only remove padding if decrypting - note that you need to use the same padding option for both encrypt and decrypt\n if (!encrypt) {\n result = desRemovePadding(result, padding);\n }\n\n return result;\n} //end of des\n\n\n//desCreateKeys\n//this takes as input a 64 bit key (even though only 56 bits are used)\n//as an array of 2 integers, and returns 16 48 bit keys\n\nfunction desCreateKeys(key) {\n //declaring this locally speeds things up a bit\n const pc2bytes0 = [\n 0, 0x4, 0x20000000, 0x20000004, 0x10000, 0x10004, 0x20010000, 0x20010004, 0x200, 0x204,\n 0x20000200, 0x20000204, 0x10200, 0x10204, 0x20010200, 0x20010204\n ];\n const pc2bytes1 = [\n 0, 0x1, 0x100000, 0x100001, 0x4000000, 0x4000001, 0x4100000, 0x4100001, 0x100, 0x101, 0x100100,\n 0x100101, 0x4000100, 0x4000101, 0x4100100, 0x4100101\n ];\n const pc2bytes2 = [\n 0, 0x8, 0x800, 0x808, 0x1000000, 0x1000008, 0x1000800, 0x1000808, 0, 0x8, 0x800, 0x808,\n 0x1000000, 0x1000008, 0x1000800, 0x1000808\n ];\n const pc2bytes3 = [\n 0, 0x200000, 0x8000000, 0x8200000, 0x2000, 0x202000, 0x8002000, 0x8202000, 0x20000, 0x220000,\n 0x8020000, 0x8220000, 0x22000, 0x222000, 0x8022000, 0x8222000\n ];\n const pc2bytes4 = [\n 0, 0x40000, 0x10, 0x40010, 0, 0x40000, 0x10, 0x40010, 0x1000, 0x41000, 0x1010, 0x41010, 0x1000,\n 0x41000, 0x1010, 0x41010\n ];\n const pc2bytes5 = [\n 0, 0x400, 0x20, 0x420, 0, 0x400, 0x20, 0x420, 0x2000000, 0x2000400, 0x2000020, 0x2000420,\n 0x2000000, 0x2000400, 0x2000020, 0x2000420\n ];\n const pc2bytes6 = [\n 0, 0x10000000, 0x80000, 0x10080000, 0x2, 0x10000002, 0x80002, 0x10080002, 0, 0x10000000,\n 0x80000, 0x10080000, 0x2, 0x10000002, 0x80002, 0x10080002\n ];\n const pc2bytes7 = [\n 0, 0x10000, 0x800, 0x10800, 0x20000000, 0x20010000, 0x20000800, 0x20010800, 0x20000, 0x30000,\n 0x20800, 0x30800, 0x20020000, 0x20030000, 0x20020800, 0x20030800\n ];\n const pc2bytes8 = [\n 0, 0x40000, 0, 0x40000, 0x2, 0x40002, 0x2, 0x40002, 0x2000000, 0x2040000, 0x2000000, 0x2040000,\n 0x2000002, 0x2040002, 0x2000002, 0x2040002\n ];\n const pc2bytes9 = [\n 0, 0x10000000, 0x8, 0x10000008, 0, 0x10000000, 0x8, 0x10000008, 0x400, 0x10000400, 0x408,\n 0x10000408, 0x400, 0x10000400, 0x408, 0x10000408\n ];\n const pc2bytes10 = [\n 0, 0x20, 0, 0x20, 0x100000, 0x100020, 0x100000, 0x100020, 0x2000, 0x2020, 0x2000, 0x2020,\n 0x102000, 0x102020, 0x102000, 0x102020\n ];\n const pc2bytes11 = [\n 0, 0x1000000, 0x200, 0x1000200, 0x200000, 0x1200000, 0x200200, 0x1200200, 0x4000000, 0x5000000,\n 0x4000200, 0x5000200, 0x4200000, 0x5200000, 0x4200200, 0x5200200\n ];\n const pc2bytes12 = [\n 0, 0x1000, 0x8000000, 0x8001000, 0x80000, 0x81000, 0x8080000, 0x8081000, 0x10, 0x1010,\n 0x8000010, 0x8001010, 0x80010, 0x81010, 0x8080010, 0x8081010\n ];\n const pc2bytes13 = [0, 0x4, 0x100, 0x104, 0, 0x4, 0x100, 0x104, 0x1, 0x5, 0x101, 0x105, 0x1, 0x5, 0x101, 0x105];\n\n //how many iterations (1 for des, 3 for triple des)\n const iterations = key.length > 8 ? 3 : 1; //changed by Paul 16/6/2007 to use Triple DES for 9+ byte keys\n //stores the return keys\n const keys = new Array(32 * iterations);\n //now define the left shifts which need to be done\n const shifts = [0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0];\n //other variables\n let lefttemp;\n let righttemp;\n let m = 0;\n let n = 0;\n let temp;\n\n for (let j = 0; j < iterations; j++) { //either 1 or 3 iterations\n let left = (key[m++] << 24) | (key[m++] << 16) | (key[m++] << 8) | key[m++];\n let right = (key[m++] << 24) | (key[m++] << 16) | (key[m++] << 8) | key[m++];\n\n temp = ((left >>> 4) ^ right) & 0x0f0f0f0f;\n right ^= temp;\n left ^= (temp << 4);\n temp = ((right >>> -16) ^ left) & 0x0000ffff;\n left ^= temp;\n right ^= (temp << -16);\n temp = ((left >>> 2) ^ right) & 0x33333333;\n right ^= temp;\n left ^= (temp << 2);\n temp = ((right >>> -16) ^ left) & 0x0000ffff;\n left ^= temp;\n right ^= (temp << -16);\n temp = ((left >>> 1) ^ right) & 0x55555555;\n right ^= temp;\n left ^= (temp << 1);\n temp = ((right >>> 8) ^ left) & 0x00ff00ff;\n left ^= temp;\n right ^= (temp << 8);\n temp = ((left >>> 1) ^ right) & 0x55555555;\n right ^= temp;\n left ^= (temp << 1);\n\n //the right side needs to be shifted and to get the last four bits of the left side\n temp = (left << 8) | ((right >>> 20) & 0x000000f0);\n //left needs to be put upside down\n left = (right << 24) | ((right << 8) & 0xff0000) | ((right >>> 8) & 0xff00) | ((right >>> 24) & 0xf0);\n right = temp;\n\n //now go through and perform these shifts on the left and right keys\n for (let i = 0; i < shifts.length; i++) {\n //shift the keys either one or two bits to the left\n if (shifts[i]) {\n left = (left << 2) | (left >>> 26);\n right = (right << 2) | (right >>> 26);\n } else {\n left = (left << 1) | (left >>> 27);\n right = (right << 1) | (right >>> 27);\n }\n left &= -0xf;\n right &= -0xf;\n\n //now apply PC-2, in such a way that E is easier when encrypting or decrypting\n //this conversion will look like PC-2 except only the last 6 bits of each byte are used\n //rather than 48 consecutive bits and the order of lines will be according to\n //how the S selection functions will be applied: S2, S4, S6, S8, S1, S3, S5, S7\n lefttemp = pc2bytes0[left >>> 28] | pc2bytes1[(left >>> 24) & 0xf] | pc2bytes2[(left >>> 20) & 0xf] | pc2bytes3[(\n left >>> 16) & 0xf] | pc2bytes4[(left >>> 12) & 0xf] | pc2bytes5[(left >>> 8) & 0xf] | pc2bytes6[(left >>> 4) &\n 0xf];\n righttemp = pc2bytes7[right >>> 28] | pc2bytes8[(right >>> 24) & 0xf] | pc2bytes9[(right >>> 20) & 0xf] |\n pc2bytes10[(right >>> 16) & 0xf] | pc2bytes11[(right >>> 12) & 0xf] | pc2bytes12[(right >>> 8) & 0xf] |\n pc2bytes13[(right >>> 4) & 0xf];\n temp = ((righttemp >>> 16) ^ lefttemp) & 0x0000ffff;\n keys[n++] = lefttemp ^ temp;\n keys[n++] = righttemp ^ (temp << 16);\n }\n } //for each iterations\n //return the keys we've created\n return keys;\n} //end of desCreateKeys\n\n\nfunction desAddPadding(message, padding) {\n const padLength = 8 - (message.length % 8);\n\n let pad;\n if (padding === 2 && (padLength < 8)) { //pad the message with spaces\n pad = ' '.charCodeAt(0);\n } else if (padding === 1) { //PKCS7 padding\n pad = padLength;\n } else if (!padding && (padLength < 8)) { //pad the message out with null bytes\n pad = 0;\n } else if (padLength === 8) {\n return message;\n } else {\n throw new Error('des: invalid padding');\n }\n\n const paddedMessage = new Uint8Array(message.length + padLength);\n for (let i = 0; i < message.length; i++) {\n paddedMessage[i] = message[i];\n }\n for (let j = 0; j < padLength; j++) {\n paddedMessage[message.length + j] = pad;\n }\n\n return paddedMessage;\n}\n\nfunction desRemovePadding(message, padding) {\n let padLength = null;\n let pad;\n if (padding === 2) { // space padded\n pad = ' '.charCodeAt(0);\n } else if (padding === 1) { // PKCS7\n padLength = message[message.length - 1];\n } else if (!padding) { // null padding\n pad = 0;\n } else {\n throw new Error('des: invalid padding');\n }\n\n if (!padLength) {\n padLength = 1;\n while (message[message.length - padLength] === pad) {\n padLength++;\n }\n padLength--;\n }\n\n return message.subarray(0, message.length - padLength);\n}\n\n// added by Recurity Labs\n\nexport function TripleDES(key) {\n this.key = [];\n\n for (let i = 0; i < 3; i++) {\n this.key.push(new Uint8Array(key.subarray(i * 8, (i * 8) + 8)));\n }\n\n this.encrypt = function(block) {\n return des(\n desCreateKeys(this.key[2]),\n des(\n desCreateKeys(this.key[1]),\n des(\n desCreateKeys(this.key[0]),\n block, true, 0, null, null\n ),\n false, 0, null, null\n ), true, 0, null, null\n );\n };\n}\n\nTripleDES.keySize = TripleDES.prototype.keySize = 24;\nTripleDES.blockSize = TripleDES.prototype.blockSize = 8;\n\n// This is \"original\" DES\n\nexport function DES(key) {\n this.key = key;\n\n this.encrypt = function(block, padding) {\n const keys = desCreateKeys(this.key);\n return des(keys, block, true, 0, null, padding);\n };\n\n this.decrypt = function(block, padding) {\n const keys = desCreateKeys(this.key);\n return des(keys, block, false, 0, null, padding);\n };\n}\n","// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// Copyright 2010 pjacobs@xeekr.com . All rights reserved.\n\n// Modified by Recurity Labs GmbH\n\n// fixed/modified by Herbert Hanewinkel, www.haneWIN.de\n// check www.haneWIN.de for the latest version\n\n// cast5.js is a Javascript implementation of CAST-128, as defined in RFC 2144.\n// CAST-128 is a common OpenPGP cipher.\n\n\n// CAST5 constructor\n\nfunction OpenPGPSymEncCAST5() {\n this.BlockSize = 8;\n this.KeySize = 16;\n\n this.setKey = function(key) {\n this.masking = new Array(16);\n this.rotate = new Array(16);\n\n this.reset();\n\n if (key.length === this.KeySize) {\n this.keySchedule(key);\n } else {\n throw new Error('CAST-128: keys must be 16 bytes');\n }\n return true;\n };\n\n this.reset = function() {\n for (let i = 0; i < 16; i++) {\n this.masking[i] = 0;\n this.rotate[i] = 0;\n }\n };\n\n this.getBlockSize = function() {\n return this.BlockSize;\n };\n\n this.encrypt = function(src) {\n const dst = new Array(src.length);\n\n for (let i = 0; i < src.length; i += 8) {\n let l = (src[i] << 24) | (src[i + 1] << 16) | (src[i + 2] << 8) | src[i + 3];\n let r = (src[i + 4] << 24) | (src[i + 5] << 16) | (src[i + 6] << 8) | src[i + 7];\n let t;\n\n t = r;\n r = l ^ f1(r, this.masking[0], this.rotate[0]);\n l = t;\n t = r;\n r = l ^ f2(r, this.masking[1], this.rotate[1]);\n l = t;\n t = r;\n r = l ^ f3(r, this.masking[2], this.rotate[2]);\n l = t;\n t = r;\n r = l ^ f1(r, this.masking[3], this.rotate[3]);\n l = t;\n\n t = r;\n r = l ^ f2(r, this.masking[4], this.rotate[4]);\n l = t;\n t = r;\n r = l ^ f3(r, this.masking[5], this.rotate[5]);\n l = t;\n t = r;\n r = l ^ f1(r, this.masking[6], this.rotate[6]);\n l = t;\n t = r;\n r = l ^ f2(r, this.masking[7], this.rotate[7]);\n l = t;\n\n t = r;\n r = l ^ f3(r, this.masking[8], this.rotate[8]);\n l = t;\n t = r;\n r = l ^ f1(r, this.masking[9], this.rotate[9]);\n l = t;\n t = r;\n r = l ^ f2(r, this.masking[10], this.rotate[10]);\n l = t;\n t = r;\n r = l ^ f3(r, this.masking[11], this.rotate[11]);\n l = t;\n\n t = r;\n r = l ^ f1(r, this.masking[12], this.rotate[12]);\n l = t;\n t = r;\n r = l ^ f2(r, this.masking[13], this.rotate[13]);\n l = t;\n t = r;\n r = l ^ f3(r, this.masking[14], this.rotate[14]);\n l = t;\n t = r;\n r = l ^ f1(r, this.masking[15], this.rotate[15]);\n l = t;\n\n dst[i] = (r >>> 24) & 255;\n dst[i + 1] = (r >>> 16) & 255;\n dst[i + 2] = (r >>> 8) & 255;\n dst[i + 3] = r & 255;\n dst[i + 4] = (l >>> 24) & 255;\n dst[i + 5] = (l >>> 16) & 255;\n dst[i + 6] = (l >>> 8) & 255;\n dst[i + 7] = l & 255;\n }\n\n return dst;\n };\n\n this.decrypt = function(src) {\n const dst = new Array(src.length);\n\n for (let i = 0; i < src.length; i += 8) {\n let l = (src[i] << 24) | (src[i + 1] << 16) | (src[i + 2] << 8) | src[i + 3];\n let r = (src[i + 4] << 24) | (src[i + 5] << 16) | (src[i + 6] << 8) | src[i + 7];\n let t;\n\n t = r;\n r = l ^ f1(r, this.masking[15], this.rotate[15]);\n l = t;\n t = r;\n r = l ^ f3(r, this.masking[14], this.rotate[14]);\n l = t;\n t = r;\n r = l ^ f2(r, this.masking[13], this.rotate[13]);\n l = t;\n t = r;\n r = l ^ f1(r, this.masking[12], this.rotate[12]);\n l = t;\n\n t = r;\n r = l ^ f3(r, this.masking[11], this.rotate[11]);\n l = t;\n t = r;\n r = l ^ f2(r, this.masking[10], this.rotate[10]);\n l = t;\n t = r;\n r = l ^ f1(r, this.masking[9], this.rotate[9]);\n l = t;\n t = r;\n r = l ^ f3(r, this.masking[8], this.rotate[8]);\n l = t;\n\n t = r;\n r = l ^ f2(r, this.masking[7], this.rotate[7]);\n l = t;\n t = r;\n r = l ^ f1(r, this.masking[6], this.rotate[6]);\n l = t;\n t = r;\n r = l ^ f3(r, this.masking[5], this.rotate[5]);\n l = t;\n t = r;\n r = l ^ f2(r, this.masking[4], this.rotate[4]);\n l = t;\n\n t = r;\n r = l ^ f1(r, this.masking[3], this.rotate[3]);\n l = t;\n t = r;\n r = l ^ f3(r, this.masking[2], this.rotate[2]);\n l = t;\n t = r;\n r = l ^ f2(r, this.masking[1], this.rotate[1]);\n l = t;\n t = r;\n r = l ^ f1(r, this.masking[0], this.rotate[0]);\n l = t;\n\n dst[i] = (r >>> 24) & 255;\n dst[i + 1] = (r >>> 16) & 255;\n dst[i + 2] = (r >>> 8) & 255;\n dst[i + 3] = r & 255;\n dst[i + 4] = (l >>> 24) & 255;\n dst[i + 5] = (l >> 16) & 255;\n dst[i + 6] = (l >> 8) & 255;\n dst[i + 7] = l & 255;\n }\n\n return dst;\n };\n const scheduleA = new Array(4);\n\n scheduleA[0] = new Array(4);\n scheduleA[0][0] = [4, 0, 0xd, 0xf, 0xc, 0xe, 0x8];\n scheduleA[0][1] = [5, 2, 16 + 0, 16 + 2, 16 + 1, 16 + 3, 0xa];\n scheduleA[0][2] = [6, 3, 16 + 7, 16 + 6, 16 + 5, 16 + 4, 9];\n scheduleA[0][3] = [7, 1, 16 + 0xa, 16 + 9, 16 + 0xb, 16 + 8, 0xb];\n\n scheduleA[1] = new Array(4);\n scheduleA[1][0] = [0, 6, 16 + 5, 16 + 7, 16 + 4, 16 + 6, 16 + 0];\n scheduleA[1][1] = [1, 4, 0, 2, 1, 3, 16 + 2];\n scheduleA[1][2] = [2, 5, 7, 6, 5, 4, 16 + 1];\n scheduleA[1][3] = [3, 7, 0xa, 9, 0xb, 8, 16 + 3];\n\n scheduleA[2] = new Array(4);\n scheduleA[2][0] = [4, 0, 0xd, 0xf, 0xc, 0xe, 8];\n scheduleA[2][1] = [5, 2, 16 + 0, 16 + 2, 16 + 1, 16 + 3, 0xa];\n scheduleA[2][2] = [6, 3, 16 + 7, 16 + 6, 16 + 5, 16 + 4, 9];\n scheduleA[2][3] = [7, 1, 16 + 0xa, 16 + 9, 16 + 0xb, 16 + 8, 0xb];\n\n\n scheduleA[3] = new Array(4);\n scheduleA[3][0] = [0, 6, 16 + 5, 16 + 7, 16 + 4, 16 + 6, 16 + 0];\n scheduleA[3][1] = [1, 4, 0, 2, 1, 3, 16 + 2];\n scheduleA[3][2] = [2, 5, 7, 6, 5, 4, 16 + 1];\n scheduleA[3][3] = [3, 7, 0xa, 9, 0xb, 8, 16 + 3];\n\n const scheduleB = new Array(4);\n\n scheduleB[0] = new Array(4);\n scheduleB[0][0] = [16 + 8, 16 + 9, 16 + 7, 16 + 6, 16 + 2];\n scheduleB[0][1] = [16 + 0xa, 16 + 0xb, 16 + 5, 16 + 4, 16 + 6];\n scheduleB[0][2] = [16 + 0xc, 16 + 0xd, 16 + 3, 16 + 2, 16 + 9];\n scheduleB[0][3] = [16 + 0xe, 16 + 0xf, 16 + 1, 16 + 0, 16 + 0xc];\n\n scheduleB[1] = new Array(4);\n scheduleB[1][0] = [3, 2, 0xc, 0xd, 8];\n scheduleB[1][1] = [1, 0, 0xe, 0xf, 0xd];\n scheduleB[1][2] = [7, 6, 8, 9, 3];\n scheduleB[1][3] = [5, 4, 0xa, 0xb, 7];\n\n\n scheduleB[2] = new Array(4);\n scheduleB[2][0] = [16 + 3, 16 + 2, 16 + 0xc, 16 + 0xd, 16 + 9];\n scheduleB[2][1] = [16 + 1, 16 + 0, 16 + 0xe, 16 + 0xf, 16 + 0xc];\n scheduleB[2][2] = [16 + 7, 16 + 6, 16 + 8, 16 + 9, 16 + 2];\n scheduleB[2][3] = [16 + 5, 16 + 4, 16 + 0xa, 16 + 0xb, 16 + 6];\n\n\n scheduleB[3] = new Array(4);\n scheduleB[3][0] = [8, 9, 7, 6, 3];\n scheduleB[3][1] = [0xa, 0xb, 5, 4, 7];\n scheduleB[3][2] = [0xc, 0xd, 3, 2, 8];\n scheduleB[3][3] = [0xe, 0xf, 1, 0, 0xd];\n\n // changed 'in' to 'inn' (in javascript 'in' is a reserved word)\n this.keySchedule = function(inn) {\n const t = new Array(8);\n const k = new Array(32);\n\n let j;\n\n for (let i = 0; i < 4; i++) {\n j = i * 4;\n t[i] = (inn[j] << 24) | (inn[j + 1] << 16) | (inn[j + 2] << 8) | inn[j + 3];\n }\n\n const x = [6, 7, 4, 5];\n let ki = 0;\n let w;\n\n for (let half = 0; half < 2; half++) {\n for (let round = 0; round < 4; round++) {\n for (j = 0; j < 4; j++) {\n const a = scheduleA[round][j];\n w = t[a[1]];\n\n w ^= sBox[4][(t[a[2] >>> 2] >>> (24 - 8 * (a[2] & 3))) & 0xff];\n w ^= sBox[5][(t[a[3] >>> 2] >>> (24 - 8 * (a[3] & 3))) & 0xff];\n w ^= sBox[6][(t[a[4] >>> 2] >>> (24 - 8 * (a[4] & 3))) & 0xff];\n w ^= sBox[7][(t[a[5] >>> 2] >>> (24 - 8 * (a[5] & 3))) & 0xff];\n w ^= sBox[x[j]][(t[a[6] >>> 2] >>> (24 - 8 * (a[6] & 3))) & 0xff];\n t[a[0]] = w;\n }\n\n for (j = 0; j < 4; j++) {\n const b = scheduleB[round][j];\n w = sBox[4][(t[b[0] >>> 2] >>> (24 - 8 * (b[0] & 3))) & 0xff];\n\n w ^= sBox[5][(t[b[1] >>> 2] >>> (24 - 8 * (b[1] & 3))) & 0xff];\n w ^= sBox[6][(t[b[2] >>> 2] >>> (24 - 8 * (b[2] & 3))) & 0xff];\n w ^= sBox[7][(t[b[3] >>> 2] >>> (24 - 8 * (b[3] & 3))) & 0xff];\n w ^= sBox[4 + j][(t[b[4] >>> 2] >>> (24 - 8 * (b[4] & 3))) & 0xff];\n k[ki] = w;\n ki++;\n }\n }\n }\n\n for (let i = 0; i < 16; i++) {\n this.masking[i] = k[i];\n this.rotate[i] = k[16 + i] & 0x1f;\n }\n };\n\n // These are the three 'f' functions. See RFC 2144, section 2.2.\n\n function f1(d, m, r) {\n const t = m + d;\n const I = (t << r) | (t >>> (32 - r));\n return ((sBox[0][I >>> 24] ^ sBox[1][(I >>> 16) & 255]) - sBox[2][(I >>> 8) & 255]) + sBox[3][I & 255];\n }\n\n function f2(d, m, r) {\n const t = m ^ d;\n const I = (t << r) | (t >>> (32 - r));\n return ((sBox[0][I >>> 24] - sBox[1][(I >>> 16) & 255]) + sBox[2][(I >>> 8) & 255]) ^ sBox[3][I & 255];\n }\n\n function f3(d, m, r) {\n const t = m - d;\n const I = (t << r) | (t >>> (32 - r));\n return ((sBox[0][I >>> 24] + sBox[1][(I >>> 16) & 255]) ^ sBox[2][(I >>> 8) & 255]) - sBox[3][I & 255];\n }\n\n const sBox = new Array(8);\n sBox[0] = [\n 0x30fb40d4, 0x9fa0ff0b, 0x6beccd2f, 0x3f258c7a, 0x1e213f2f, 0x9c004dd3, 0x6003e540, 0xcf9fc949,\n 0xbfd4af27, 0x88bbbdb5, 0xe2034090, 0x98d09675, 0x6e63a0e0, 0x15c361d2, 0xc2e7661d, 0x22d4ff8e,\n 0x28683b6f, 0xc07fd059, 0xff2379c8, 0x775f50e2, 0x43c340d3, 0xdf2f8656, 0x887ca41a, 0xa2d2bd2d,\n 0xa1c9e0d6, 0x346c4819, 0x61b76d87, 0x22540f2f, 0x2abe32e1, 0xaa54166b, 0x22568e3a, 0xa2d341d0,\n 0x66db40c8, 0xa784392f, 0x004dff2f, 0x2db9d2de, 0x97943fac, 0x4a97c1d8, 0x527644b7, 0xb5f437a7,\n 0xb82cbaef, 0xd751d159, 0x6ff7f0ed, 0x5a097a1f, 0x827b68d0, 0x90ecf52e, 0x22b0c054, 0xbc8e5935,\n 0x4b6d2f7f, 0x50bb64a2, 0xd2664910, 0xbee5812d, 0xb7332290, 0xe93b159f, 0xb48ee411, 0x4bff345d,\n 0xfd45c240, 0xad31973f, 0xc4f6d02e, 0x55fc8165, 0xd5b1caad, 0xa1ac2dae, 0xa2d4b76d, 0xc19b0c50,\n 0x882240f2, 0x0c6e4f38, 0xa4e4bfd7, 0x4f5ba272, 0x564c1d2f, 0xc59c5319, 0xb949e354, 0xb04669fe,\n 0xb1b6ab8a, 0xc71358dd, 0x6385c545, 0x110f935d, 0x57538ad5, 0x6a390493, 0xe63d37e0, 0x2a54f6b3,\n 0x3a787d5f, 0x6276a0b5, 0x19a6fcdf, 0x7a42206a, 0x29f9d4d5, 0xf61b1891, 0xbb72275e, 0xaa508167,\n 0x38901091, 0xc6b505eb, 0x84c7cb8c, 0x2ad75a0f, 0x874a1427, 0xa2d1936b, 0x2ad286af, 0xaa56d291,\n 0xd7894360, 0x425c750d, 0x93b39e26, 0x187184c9, 0x6c00b32d, 0x73e2bb14, 0xa0bebc3c, 0x54623779,\n 0x64459eab, 0x3f328b82, 0x7718cf82, 0x59a2cea6, 0x04ee002e, 0x89fe78e6, 0x3fab0950, 0x325ff6c2,\n 0x81383f05, 0x6963c5c8, 0x76cb5ad6, 0xd49974c9, 0xca180dcf, 0x380782d5, 0xc7fa5cf6, 0x8ac31511,\n 0x35e79e13, 0x47da91d0, 0xf40f9086, 0xa7e2419e, 0x31366241, 0x051ef495, 0xaa573b04, 0x4a805d8d,\n 0x548300d0, 0x00322a3c, 0xbf64cddf, 0xba57a68e, 0x75c6372b, 0x50afd341, 0xa7c13275, 0x915a0bf5,\n 0x6b54bfab, 0x2b0b1426, 0xab4cc9d7, 0x449ccd82, 0xf7fbf265, 0xab85c5f3, 0x1b55db94, 0xaad4e324,\n 0xcfa4bd3f, 0x2deaa3e2, 0x9e204d02, 0xc8bd25ac, 0xeadf55b3, 0xd5bd9e98, 0xe31231b2, 0x2ad5ad6c,\n 0x954329de, 0xadbe4528, 0xd8710f69, 0xaa51c90f, 0xaa786bf6, 0x22513f1e, 0xaa51a79b, 0x2ad344cc,\n 0x7b5a41f0, 0xd37cfbad, 0x1b069505, 0x41ece491, 0xb4c332e6, 0x032268d4, 0xc9600acc, 0xce387e6d,\n 0xbf6bb16c, 0x6a70fb78, 0x0d03d9c9, 0xd4df39de, 0xe01063da, 0x4736f464, 0x5ad328d8, 0xb347cc96,\n 0x75bb0fc3, 0x98511bfb, 0x4ffbcc35, 0xb58bcf6a, 0xe11f0abc, 0xbfc5fe4a, 0xa70aec10, 0xac39570a,\n 0x3f04442f, 0x6188b153, 0xe0397a2e, 0x5727cb79, 0x9ceb418f, 0x1cacd68d, 0x2ad37c96, 0x0175cb9d,\n 0xc69dff09, 0xc75b65f0, 0xd9db40d8, 0xec0e7779, 0x4744ead4, 0xb11c3274, 0xdd24cb9e, 0x7e1c54bd,\n 0xf01144f9, 0xd2240eb1, 0x9675b3fd, 0xa3ac3755, 0xd47c27af, 0x51c85f4d, 0x56907596, 0xa5bb15e6,\n 0x580304f0, 0xca042cf1, 0x011a37ea, 0x8dbfaadb, 0x35ba3e4a, 0x3526ffa0, 0xc37b4d09, 0xbc306ed9,\n 0x98a52666, 0x5648f725, 0xff5e569d, 0x0ced63d0, 0x7c63b2cf, 0x700b45e1, 0xd5ea50f1, 0x85a92872,\n 0xaf1fbda7, 0xd4234870, 0xa7870bf3, 0x2d3b4d79, 0x42e04198, 0x0cd0ede7, 0x26470db8, 0xf881814c,\n 0x474d6ad7, 0x7c0c5e5c, 0xd1231959, 0x381b7298, 0xf5d2f4db, 0xab838653, 0x6e2f1e23, 0x83719c9e,\n 0xbd91e046, 0x9a56456e, 0xdc39200c, 0x20c8c571, 0x962bda1c, 0xe1e696ff, 0xb141ab08, 0x7cca89b9,\n 0x1a69e783, 0x02cc4843, 0xa2f7c579, 0x429ef47d, 0x427b169c, 0x5ac9f049, 0xdd8f0f00, 0x5c8165bf\n ];\n\n sBox[1] = [\n 0x1f201094, 0xef0ba75b, 0x69e3cf7e, 0x393f4380, 0xfe61cf7a, 0xeec5207a, 0x55889c94, 0x72fc0651,\n 0xada7ef79, 0x4e1d7235, 0xd55a63ce, 0xde0436ba, 0x99c430ef, 0x5f0c0794, 0x18dcdb7d, 0xa1d6eff3,\n 0xa0b52f7b, 0x59e83605, 0xee15b094, 0xe9ffd909, 0xdc440086, 0xef944459, 0xba83ccb3, 0xe0c3cdfb,\n 0xd1da4181, 0x3b092ab1, 0xf997f1c1, 0xa5e6cf7b, 0x01420ddb, 0xe4e7ef5b, 0x25a1ff41, 0xe180f806,\n 0x1fc41080, 0x179bee7a, 0xd37ac6a9, 0xfe5830a4, 0x98de8b7f, 0x77e83f4e, 0x79929269, 0x24fa9f7b,\n 0xe113c85b, 0xacc40083, 0xd7503525, 0xf7ea615f, 0x62143154, 0x0d554b63, 0x5d681121, 0xc866c359,\n 0x3d63cf73, 0xcee234c0, 0xd4d87e87, 0x5c672b21, 0x071f6181, 0x39f7627f, 0x361e3084, 0xe4eb573b,\n 0x602f64a4, 0xd63acd9c, 0x1bbc4635, 0x9e81032d, 0x2701f50c, 0x99847ab4, 0xa0e3df79, 0xba6cf38c,\n 0x10843094, 0x2537a95e, 0xf46f6ffe, 0xa1ff3b1f, 0x208cfb6a, 0x8f458c74, 0xd9e0a227, 0x4ec73a34,\n 0xfc884f69, 0x3e4de8df, 0xef0e0088, 0x3559648d, 0x8a45388c, 0x1d804366, 0x721d9bfd, 0xa58684bb,\n 0xe8256333, 0x844e8212, 0x128d8098, 0xfed33fb4, 0xce280ae1, 0x27e19ba5, 0xd5a6c252, 0xe49754bd,\n 0xc5d655dd, 0xeb667064, 0x77840b4d, 0xa1b6a801, 0x84db26a9, 0xe0b56714, 0x21f043b7, 0xe5d05860,\n 0x54f03084, 0x066ff472, 0xa31aa153, 0xdadc4755, 0xb5625dbf, 0x68561be6, 0x83ca6b94, 0x2d6ed23b,\n 0xeccf01db, 0xa6d3d0ba, 0xb6803d5c, 0xaf77a709, 0x33b4a34c, 0x397bc8d6, 0x5ee22b95, 0x5f0e5304,\n 0x81ed6f61, 0x20e74364, 0xb45e1378, 0xde18639b, 0x881ca122, 0xb96726d1, 0x8049a7e8, 0x22b7da7b,\n 0x5e552d25, 0x5272d237, 0x79d2951c, 0xc60d894c, 0x488cb402, 0x1ba4fe5b, 0xa4b09f6b, 0x1ca815cf,\n 0xa20c3005, 0x8871df63, 0xb9de2fcb, 0x0cc6c9e9, 0x0beeff53, 0xe3214517, 0xb4542835, 0x9f63293c,\n 0xee41e729, 0x6e1d2d7c, 0x50045286, 0x1e6685f3, 0xf33401c6, 0x30a22c95, 0x31a70850, 0x60930f13,\n 0x73f98417, 0xa1269859, 0xec645c44, 0x52c877a9, 0xcdff33a6, 0xa02b1741, 0x7cbad9a2, 0x2180036f,\n 0x50d99c08, 0xcb3f4861, 0xc26bd765, 0x64a3f6ab, 0x80342676, 0x25a75e7b, 0xe4e6d1fc, 0x20c710e6,\n 0xcdf0b680, 0x17844d3b, 0x31eef84d, 0x7e0824e4, 0x2ccb49eb, 0x846a3bae, 0x8ff77888, 0xee5d60f6,\n 0x7af75673, 0x2fdd5cdb, 0xa11631c1, 0x30f66f43, 0xb3faec54, 0x157fd7fa, 0xef8579cc, 0xd152de58,\n 0xdb2ffd5e, 0x8f32ce19, 0x306af97a, 0x02f03ef8, 0x99319ad5, 0xc242fa0f, 0xa7e3ebb0, 0xc68e4906,\n 0xb8da230c, 0x80823028, 0xdcdef3c8, 0xd35fb171, 0x088a1bc8, 0xbec0c560, 0x61a3c9e8, 0xbca8f54d,\n 0xc72feffa, 0x22822e99, 0x82c570b4, 0xd8d94e89, 0x8b1c34bc, 0x301e16e6, 0x273be979, 0xb0ffeaa6,\n 0x61d9b8c6, 0x00b24869, 0xb7ffce3f, 0x08dc283b, 0x43daf65a, 0xf7e19798, 0x7619b72f, 0x8f1c9ba4,\n 0xdc8637a0, 0x16a7d3b1, 0x9fc393b7, 0xa7136eeb, 0xc6bcc63e, 0x1a513742, 0xef6828bc, 0x520365d6,\n 0x2d6a77ab, 0x3527ed4b, 0x821fd216, 0x095c6e2e, 0xdb92f2fb, 0x5eea29cb, 0x145892f5, 0x91584f7f,\n 0x5483697b, 0x2667a8cc, 0x85196048, 0x8c4bacea, 0x833860d4, 0x0d23e0f9, 0x6c387e8a, 0x0ae6d249,\n 0xb284600c, 0xd835731d, 0xdcb1c647, 0xac4c56ea, 0x3ebd81b3, 0x230eabb0, 0x6438bc87, 0xf0b5b1fa,\n 0x8f5ea2b3, 0xfc184642, 0x0a036b7a, 0x4fb089bd, 0x649da589, 0xa345415e, 0x5c038323, 0x3e5d3bb9,\n 0x43d79572, 0x7e6dd07c, 0x06dfdf1e, 0x6c6cc4ef, 0x7160a539, 0x73bfbe70, 0x83877605, 0x4523ecf1\n ];\n\n sBox[2] = [\n 0x8defc240, 0x25fa5d9f, 0xeb903dbf, 0xe810c907, 0x47607fff, 0x369fe44b, 0x8c1fc644, 0xaececa90,\n 0xbeb1f9bf, 0xeefbcaea, 0xe8cf1950, 0x51df07ae, 0x920e8806, 0xf0ad0548, 0xe13c8d83, 0x927010d5,\n 0x11107d9f, 0x07647db9, 0xb2e3e4d4, 0x3d4f285e, 0xb9afa820, 0xfade82e0, 0xa067268b, 0x8272792e,\n 0x553fb2c0, 0x489ae22b, 0xd4ef9794, 0x125e3fbc, 0x21fffcee, 0x825b1bfd, 0x9255c5ed, 0x1257a240,\n 0x4e1a8302, 0xbae07fff, 0x528246e7, 0x8e57140e, 0x3373f7bf, 0x8c9f8188, 0xa6fc4ee8, 0xc982b5a5,\n 0xa8c01db7, 0x579fc264, 0x67094f31, 0xf2bd3f5f, 0x40fff7c1, 0x1fb78dfc, 0x8e6bd2c1, 0x437be59b,\n 0x99b03dbf, 0xb5dbc64b, 0x638dc0e6, 0x55819d99, 0xa197c81c, 0x4a012d6e, 0xc5884a28, 0xccc36f71,\n 0xb843c213, 0x6c0743f1, 0x8309893c, 0x0feddd5f, 0x2f7fe850, 0xd7c07f7e, 0x02507fbf, 0x5afb9a04,\n 0xa747d2d0, 0x1651192e, 0xaf70bf3e, 0x58c31380, 0x5f98302e, 0x727cc3c4, 0x0a0fb402, 0x0f7fef82,\n 0x8c96fdad, 0x5d2c2aae, 0x8ee99a49, 0x50da88b8, 0x8427f4a0, 0x1eac5790, 0x796fb449, 0x8252dc15,\n 0xefbd7d9b, 0xa672597d, 0xada840d8, 0x45f54504, 0xfa5d7403, 0xe83ec305, 0x4f91751a, 0x925669c2,\n 0x23efe941, 0xa903f12e, 0x60270df2, 0x0276e4b6, 0x94fd6574, 0x927985b2, 0x8276dbcb, 0x02778176,\n 0xf8af918d, 0x4e48f79e, 0x8f616ddf, 0xe29d840e, 0x842f7d83, 0x340ce5c8, 0x96bbb682, 0x93b4b148,\n 0xef303cab, 0x984faf28, 0x779faf9b, 0x92dc560d, 0x224d1e20, 0x8437aa88, 0x7d29dc96, 0x2756d3dc,\n 0x8b907cee, 0xb51fd240, 0xe7c07ce3, 0xe566b4a1, 0xc3e9615e, 0x3cf8209d, 0x6094d1e3, 0xcd9ca341,\n 0x5c76460e, 0x00ea983b, 0xd4d67881, 0xfd47572c, 0xf76cedd9, 0xbda8229c, 0x127dadaa, 0x438a074e,\n 0x1f97c090, 0x081bdb8a, 0x93a07ebe, 0xb938ca15, 0x97b03cff, 0x3dc2c0f8, 0x8d1ab2ec, 0x64380e51,\n 0x68cc7bfb, 0xd90f2788, 0x12490181, 0x5de5ffd4, 0xdd7ef86a, 0x76a2e214, 0xb9a40368, 0x925d958f,\n 0x4b39fffa, 0xba39aee9, 0xa4ffd30b, 0xfaf7933b, 0x6d498623, 0x193cbcfa, 0x27627545, 0x825cf47a,\n 0x61bd8ba0, 0xd11e42d1, 0xcead04f4, 0x127ea392, 0x10428db7, 0x8272a972, 0x9270c4a8, 0x127de50b,\n 0x285ba1c8, 0x3c62f44f, 0x35c0eaa5, 0xe805d231, 0x428929fb, 0xb4fcdf82, 0x4fb66a53, 0x0e7dc15b,\n 0x1f081fab, 0x108618ae, 0xfcfd086d, 0xf9ff2889, 0x694bcc11, 0x236a5cae, 0x12deca4d, 0x2c3f8cc5,\n 0xd2d02dfe, 0xf8ef5896, 0xe4cf52da, 0x95155b67, 0x494a488c, 0xb9b6a80c, 0x5c8f82bc, 0x89d36b45,\n 0x3a609437, 0xec00c9a9, 0x44715253, 0x0a874b49, 0xd773bc40, 0x7c34671c, 0x02717ef6, 0x4feb5536,\n 0xa2d02fff, 0xd2bf60c4, 0xd43f03c0, 0x50b4ef6d, 0x07478cd1, 0x006e1888, 0xa2e53f55, 0xb9e6d4bc,\n 0xa2048016, 0x97573833, 0xd7207d67, 0xde0f8f3d, 0x72f87b33, 0xabcc4f33, 0x7688c55d, 0x7b00a6b0,\n 0x947b0001, 0x570075d2, 0xf9bb88f8, 0x8942019e, 0x4264a5ff, 0x856302e0, 0x72dbd92b, 0xee971b69,\n 0x6ea22fde, 0x5f08ae2b, 0xaf7a616d, 0xe5c98767, 0xcf1febd2, 0x61efc8c2, 0xf1ac2571, 0xcc8239c2,\n 0x67214cb8, 0xb1e583d1, 0xb7dc3e62, 0x7f10bdce, 0xf90a5c38, 0x0ff0443d, 0x606e6dc6, 0x60543a49,\n 0x5727c148, 0x2be98a1d, 0x8ab41738, 0x20e1be24, 0xaf96da0f, 0x68458425, 0x99833be5, 0x600d457d,\n 0x282f9350, 0x8334b362, 0xd91d1120, 0x2b6d8da0, 0x642b1e31, 0x9c305a00, 0x52bce688, 0x1b03588a,\n 0xf7baefd5, 0x4142ed9c, 0xa4315c11, 0x83323ec5, 0xdfef4636, 0xa133c501, 0xe9d3531c, 0xee353783\n ];\n\n sBox[3] = [\n 0x9db30420, 0x1fb6e9de, 0xa7be7bef, 0xd273a298, 0x4a4f7bdb, 0x64ad8c57, 0x85510443, 0xfa020ed1,\n 0x7e287aff, 0xe60fb663, 0x095f35a1, 0x79ebf120, 0xfd059d43, 0x6497b7b1, 0xf3641f63, 0x241e4adf,\n 0x28147f5f, 0x4fa2b8cd, 0xc9430040, 0x0cc32220, 0xfdd30b30, 0xc0a5374f, 0x1d2d00d9, 0x24147b15,\n 0xee4d111a, 0x0fca5167, 0x71ff904c, 0x2d195ffe, 0x1a05645f, 0x0c13fefe, 0x081b08ca, 0x05170121,\n 0x80530100, 0xe83e5efe, 0xac9af4f8, 0x7fe72701, 0xd2b8ee5f, 0x06df4261, 0xbb9e9b8a, 0x7293ea25,\n 0xce84ffdf, 0xf5718801, 0x3dd64b04, 0xa26f263b, 0x7ed48400, 0x547eebe6, 0x446d4ca0, 0x6cf3d6f5,\n 0x2649abdf, 0xaea0c7f5, 0x36338cc1, 0x503f7e93, 0xd3772061, 0x11b638e1, 0x72500e03, 0xf80eb2bb,\n 0xabe0502e, 0xec8d77de, 0x57971e81, 0xe14f6746, 0xc9335400, 0x6920318f, 0x081dbb99, 0xffc304a5,\n 0x4d351805, 0x7f3d5ce3, 0xa6c866c6, 0x5d5bcca9, 0xdaec6fea, 0x9f926f91, 0x9f46222f, 0x3991467d,\n 0xa5bf6d8e, 0x1143c44f, 0x43958302, 0xd0214eeb, 0x022083b8, 0x3fb6180c, 0x18f8931e, 0x281658e6,\n 0x26486e3e, 0x8bd78a70, 0x7477e4c1, 0xb506e07c, 0xf32d0a25, 0x79098b02, 0xe4eabb81, 0x28123b23,\n 0x69dead38, 0x1574ca16, 0xdf871b62, 0x211c40b7, 0xa51a9ef9, 0x0014377b, 0x041e8ac8, 0x09114003,\n 0xbd59e4d2, 0xe3d156d5, 0x4fe876d5, 0x2f91a340, 0x557be8de, 0x00eae4a7, 0x0ce5c2ec, 0x4db4bba6,\n 0xe756bdff, 0xdd3369ac, 0xec17b035, 0x06572327, 0x99afc8b0, 0x56c8c391, 0x6b65811c, 0x5e146119,\n 0x6e85cb75, 0xbe07c002, 0xc2325577, 0x893ff4ec, 0x5bbfc92d, 0xd0ec3b25, 0xb7801ab7, 0x8d6d3b24,\n 0x20c763ef, 0xc366a5fc, 0x9c382880, 0x0ace3205, 0xaac9548a, 0xeca1d7c7, 0x041afa32, 0x1d16625a,\n 0x6701902c, 0x9b757a54, 0x31d477f7, 0x9126b031, 0x36cc6fdb, 0xc70b8b46, 0xd9e66a48, 0x56e55a79,\n 0x026a4ceb, 0x52437eff, 0x2f8f76b4, 0x0df980a5, 0x8674cde3, 0xedda04eb, 0x17a9be04, 0x2c18f4df,\n 0xb7747f9d, 0xab2af7b4, 0xefc34d20, 0x2e096b7c, 0x1741a254, 0xe5b6a035, 0x213d42f6, 0x2c1c7c26,\n 0x61c2f50f, 0x6552daf9, 0xd2c231f8, 0x25130f69, 0xd8167fa2, 0x0418f2c8, 0x001a96a6, 0x0d1526ab,\n 0x63315c21, 0x5e0a72ec, 0x49bafefd, 0x187908d9, 0x8d0dbd86, 0x311170a7, 0x3e9b640c, 0xcc3e10d7,\n 0xd5cad3b6, 0x0caec388, 0xf73001e1, 0x6c728aff, 0x71eae2a1, 0x1f9af36e, 0xcfcbd12f, 0xc1de8417,\n 0xac07be6b, 0xcb44a1d8, 0x8b9b0f56, 0x013988c3, 0xb1c52fca, 0xb4be31cd, 0xd8782806, 0x12a3a4e2,\n 0x6f7de532, 0x58fd7eb6, 0xd01ee900, 0x24adffc2, 0xf4990fc5, 0x9711aac5, 0x001d7b95, 0x82e5e7d2,\n 0x109873f6, 0x00613096, 0xc32d9521, 0xada121ff, 0x29908415, 0x7fbb977f, 0xaf9eb3db, 0x29c9ed2a,\n 0x5ce2a465, 0xa730f32c, 0xd0aa3fe8, 0x8a5cc091, 0xd49e2ce7, 0x0ce454a9, 0xd60acd86, 0x015f1919,\n 0x77079103, 0xdea03af6, 0x78a8565e, 0xdee356df, 0x21f05cbe, 0x8b75e387, 0xb3c50651, 0xb8a5c3ef,\n 0xd8eeb6d2, 0xe523be77, 0xc2154529, 0x2f69efdf, 0xafe67afb, 0xf470c4b2, 0xf3e0eb5b, 0xd6cc9876,\n 0x39e4460c, 0x1fda8538, 0x1987832f, 0xca007367, 0xa99144f8, 0x296b299e, 0x492fc295, 0x9266beab,\n 0xb5676e69, 0x9bd3ddda, 0xdf7e052f, 0xdb25701c, 0x1b5e51ee, 0xf65324e6, 0x6afce36c, 0x0316cc04,\n 0x8644213e, 0xb7dc59d0, 0x7965291f, 0xccd6fd43, 0x41823979, 0x932bcdf6, 0xb657c34d, 0x4edfd282,\n 0x7ae5290c, 0x3cb9536b, 0x851e20fe, 0x9833557e, 0x13ecf0b0, 0xd3ffb372, 0x3f85c5c1, 0x0aef7ed2\n ];\n\n sBox[4] = [\n 0x7ec90c04, 0x2c6e74b9, 0x9b0e66df, 0xa6337911, 0xb86a7fff, 0x1dd358f5, 0x44dd9d44, 0x1731167f,\n 0x08fbf1fa, 0xe7f511cc, 0xd2051b00, 0x735aba00, 0x2ab722d8, 0x386381cb, 0xacf6243a, 0x69befd7a,\n 0xe6a2e77f, 0xf0c720cd, 0xc4494816, 0xccf5c180, 0x38851640, 0x15b0a848, 0xe68b18cb, 0x4caadeff,\n 0x5f480a01, 0x0412b2aa, 0x259814fc, 0x41d0efe2, 0x4e40b48d, 0x248eb6fb, 0x8dba1cfe, 0x41a99b02,\n 0x1a550a04, 0xba8f65cb, 0x7251f4e7, 0x95a51725, 0xc106ecd7, 0x97a5980a, 0xc539b9aa, 0x4d79fe6a,\n 0xf2f3f763, 0x68af8040, 0xed0c9e56, 0x11b4958b, 0xe1eb5a88, 0x8709e6b0, 0xd7e07156, 0x4e29fea7,\n 0x6366e52d, 0x02d1c000, 0xc4ac8e05, 0x9377f571, 0x0c05372a, 0x578535f2, 0x2261be02, 0xd642a0c9,\n 0xdf13a280, 0x74b55bd2, 0x682199c0, 0xd421e5ec, 0x53fb3ce8, 0xc8adedb3, 0x28a87fc9, 0x3d959981,\n 0x5c1ff900, 0xfe38d399, 0x0c4eff0b, 0x062407ea, 0xaa2f4fb1, 0x4fb96976, 0x90c79505, 0xb0a8a774,\n 0xef55a1ff, 0xe59ca2c2, 0xa6b62d27, 0xe66a4263, 0xdf65001f, 0x0ec50966, 0xdfdd55bc, 0x29de0655,\n 0x911e739a, 0x17af8975, 0x32c7911c, 0x89f89468, 0x0d01e980, 0x524755f4, 0x03b63cc9, 0x0cc844b2,\n 0xbcf3f0aa, 0x87ac36e9, 0xe53a7426, 0x01b3d82b, 0x1a9e7449, 0x64ee2d7e, 0xcddbb1da, 0x01c94910,\n 0xb868bf80, 0x0d26f3fd, 0x9342ede7, 0x04a5c284, 0x636737b6, 0x50f5b616, 0xf24766e3, 0x8eca36c1,\n 0x136e05db, 0xfef18391, 0xfb887a37, 0xd6e7f7d4, 0xc7fb7dc9, 0x3063fcdf, 0xb6f589de, 0xec2941da,\n 0x26e46695, 0xb7566419, 0xf654efc5, 0xd08d58b7, 0x48925401, 0xc1bacb7f, 0xe5ff550f, 0xb6083049,\n 0x5bb5d0e8, 0x87d72e5a, 0xab6a6ee1, 0x223a66ce, 0xc62bf3cd, 0x9e0885f9, 0x68cb3e47, 0x086c010f,\n 0xa21de820, 0xd18b69de, 0xf3f65777, 0xfa02c3f6, 0x407edac3, 0xcbb3d550, 0x1793084d, 0xb0d70eba,\n 0x0ab378d5, 0xd951fb0c, 0xded7da56, 0x4124bbe4, 0x94ca0b56, 0x0f5755d1, 0xe0e1e56e, 0x6184b5be,\n 0x580a249f, 0x94f74bc0, 0xe327888e, 0x9f7b5561, 0xc3dc0280, 0x05687715, 0x646c6bd7, 0x44904db3,\n 0x66b4f0a3, 0xc0f1648a, 0x697ed5af, 0x49e92ff6, 0x309e374f, 0x2cb6356a, 0x85808573, 0x4991f840,\n 0x76f0ae02, 0x083be84d, 0x28421c9a, 0x44489406, 0x736e4cb8, 0xc1092910, 0x8bc95fc6, 0x7d869cf4,\n 0x134f616f, 0x2e77118d, 0xb31b2be1, 0xaa90b472, 0x3ca5d717, 0x7d161bba, 0x9cad9010, 0xaf462ba2,\n 0x9fe459d2, 0x45d34559, 0xd9f2da13, 0xdbc65487, 0xf3e4f94e, 0x176d486f, 0x097c13ea, 0x631da5c7,\n 0x445f7382, 0x175683f4, 0xcdc66a97, 0x70be0288, 0xb3cdcf72, 0x6e5dd2f3, 0x20936079, 0x459b80a5,\n 0xbe60e2db, 0xa9c23101, 0xeba5315c, 0x224e42f2, 0x1c5c1572, 0xf6721b2c, 0x1ad2fff3, 0x8c25404e,\n 0x324ed72f, 0x4067b7fd, 0x0523138e, 0x5ca3bc78, 0xdc0fd66e, 0x75922283, 0x784d6b17, 0x58ebb16e,\n 0x44094f85, 0x3f481d87, 0xfcfeae7b, 0x77b5ff76, 0x8c2302bf, 0xaaf47556, 0x5f46b02a, 0x2b092801,\n 0x3d38f5f7, 0x0ca81f36, 0x52af4a8a, 0x66d5e7c0, 0xdf3b0874, 0x95055110, 0x1b5ad7a8, 0xf61ed5ad,\n 0x6cf6e479, 0x20758184, 0xd0cefa65, 0x88f7be58, 0x4a046826, 0x0ff6f8f3, 0xa09c7f70, 0x5346aba0,\n 0x5ce96c28, 0xe176eda3, 0x6bac307f, 0x376829d2, 0x85360fa9, 0x17e3fe2a, 0x24b79767, 0xf5a96b20,\n 0xd6cd2595, 0x68ff1ebf, 0x7555442c, 0xf19f06be, 0xf9e0659a, 0xeeb9491d, 0x34010718, 0xbb30cab8,\n 0xe822fe15, 0x88570983, 0x750e6249, 0xda627e55, 0x5e76ffa8, 0xb1534546, 0x6d47de08, 0xefe9e7d4\n ];\n\n sBox[5] = [\n 0xf6fa8f9d, 0x2cac6ce1, 0x4ca34867, 0xe2337f7c, 0x95db08e7, 0x016843b4, 0xeced5cbc, 0x325553ac,\n 0xbf9f0960, 0xdfa1e2ed, 0x83f0579d, 0x63ed86b9, 0x1ab6a6b8, 0xde5ebe39, 0xf38ff732, 0x8989b138,\n 0x33f14961, 0xc01937bd, 0xf506c6da, 0xe4625e7e, 0xa308ea99, 0x4e23e33c, 0x79cbd7cc, 0x48a14367,\n 0xa3149619, 0xfec94bd5, 0xa114174a, 0xeaa01866, 0xa084db2d, 0x09a8486f, 0xa888614a, 0x2900af98,\n 0x01665991, 0xe1992863, 0xc8f30c60, 0x2e78ef3c, 0xd0d51932, 0xcf0fec14, 0xf7ca07d2, 0xd0a82072,\n 0xfd41197e, 0x9305a6b0, 0xe86be3da, 0x74bed3cd, 0x372da53c, 0x4c7f4448, 0xdab5d440, 0x6dba0ec3,\n 0x083919a7, 0x9fbaeed9, 0x49dbcfb0, 0x4e670c53, 0x5c3d9c01, 0x64bdb941, 0x2c0e636a, 0xba7dd9cd,\n 0xea6f7388, 0xe70bc762, 0x35f29adb, 0x5c4cdd8d, 0xf0d48d8c, 0xb88153e2, 0x08a19866, 0x1ae2eac8,\n 0x284caf89, 0xaa928223, 0x9334be53, 0x3b3a21bf, 0x16434be3, 0x9aea3906, 0xefe8c36e, 0xf890cdd9,\n 0x80226dae, 0xc340a4a3, 0xdf7e9c09, 0xa694a807, 0x5b7c5ecc, 0x221db3a6, 0x9a69a02f, 0x68818a54,\n 0xceb2296f, 0x53c0843a, 0xfe893655, 0x25bfe68a, 0xb4628abc, 0xcf222ebf, 0x25ac6f48, 0xa9a99387,\n 0x53bddb65, 0xe76ffbe7, 0xe967fd78, 0x0ba93563, 0x8e342bc1, 0xe8a11be9, 0x4980740d, 0xc8087dfc,\n 0x8de4bf99, 0xa11101a0, 0x7fd37975, 0xda5a26c0, 0xe81f994f, 0x9528cd89, 0xfd339fed, 0xb87834bf,\n 0x5f04456d, 0x22258698, 0xc9c4c83b, 0x2dc156be, 0x4f628daa, 0x57f55ec5, 0xe2220abe, 0xd2916ebf,\n 0x4ec75b95, 0x24f2c3c0, 0x42d15d99, 0xcd0d7fa0, 0x7b6e27ff, 0xa8dc8af0, 0x7345c106, 0xf41e232f,\n 0x35162386, 0xe6ea8926, 0x3333b094, 0x157ec6f2, 0x372b74af, 0x692573e4, 0xe9a9d848, 0xf3160289,\n 0x3a62ef1d, 0xa787e238, 0xf3a5f676, 0x74364853, 0x20951063, 0x4576698d, 0xb6fad407, 0x592af950,\n 0x36f73523, 0x4cfb6e87, 0x7da4cec0, 0x6c152daa, 0xcb0396a8, 0xc50dfe5d, 0xfcd707ab, 0x0921c42f,\n 0x89dff0bb, 0x5fe2be78, 0x448f4f33, 0x754613c9, 0x2b05d08d, 0x48b9d585, 0xdc049441, 0xc8098f9b,\n 0x7dede786, 0xc39a3373, 0x42410005, 0x6a091751, 0x0ef3c8a6, 0x890072d6, 0x28207682, 0xa9a9f7be,\n 0xbf32679d, 0xd45b5b75, 0xb353fd00, 0xcbb0e358, 0x830f220a, 0x1f8fb214, 0xd372cf08, 0xcc3c4a13,\n 0x8cf63166, 0x061c87be, 0x88c98f88, 0x6062e397, 0x47cf8e7a, 0xb6c85283, 0x3cc2acfb, 0x3fc06976,\n 0x4e8f0252, 0x64d8314d, 0xda3870e3, 0x1e665459, 0xc10908f0, 0x513021a5, 0x6c5b68b7, 0x822f8aa0,\n 0x3007cd3e, 0x74719eef, 0xdc872681, 0x073340d4, 0x7e432fd9, 0x0c5ec241, 0x8809286c, 0xf592d891,\n 0x08a930f6, 0x957ef305, 0xb7fbffbd, 0xc266e96f, 0x6fe4ac98, 0xb173ecc0, 0xbc60b42a, 0x953498da,\n 0xfba1ae12, 0x2d4bd736, 0x0f25faab, 0xa4f3fceb, 0xe2969123, 0x257f0c3d, 0x9348af49, 0x361400bc,\n 0xe8816f4a, 0x3814f200, 0xa3f94043, 0x9c7a54c2, 0xbc704f57, 0xda41e7f9, 0xc25ad33a, 0x54f4a084,\n 0xb17f5505, 0x59357cbe, 0xedbd15c8, 0x7f97c5ab, 0xba5ac7b5, 0xb6f6deaf, 0x3a479c3a, 0x5302da25,\n 0x653d7e6a, 0x54268d49, 0x51a477ea, 0x5017d55b, 0xd7d25d88, 0x44136c76, 0x0404a8c8, 0xb8e5a121,\n 0xb81a928a, 0x60ed5869, 0x97c55b96, 0xeaec991b, 0x29935913, 0x01fdb7f1, 0x088e8dfa, 0x9ab6f6f5,\n 0x3b4cbf9f, 0x4a5de3ab, 0xe6051d35, 0xa0e1d855, 0xd36b4cf1, 0xf544edeb, 0xb0e93524, 0xbebb8fbd,\n 0xa2d762cf, 0x49c92f54, 0x38b5f331, 0x7128a454, 0x48392905, 0xa65b1db8, 0x851c97bd, 0xd675cf2f\n ];\n\n sBox[6] = [\n 0x85e04019, 0x332bf567, 0x662dbfff, 0xcfc65693, 0x2a8d7f6f, 0xab9bc912, 0xde6008a1, 0x2028da1f,\n 0x0227bce7, 0x4d642916, 0x18fac300, 0x50f18b82, 0x2cb2cb11, 0xb232e75c, 0x4b3695f2, 0xb28707de,\n 0xa05fbcf6, 0xcd4181e9, 0xe150210c, 0xe24ef1bd, 0xb168c381, 0xfde4e789, 0x5c79b0d8, 0x1e8bfd43,\n 0x4d495001, 0x38be4341, 0x913cee1d, 0x92a79c3f, 0x089766be, 0xbaeeadf4, 0x1286becf, 0xb6eacb19,\n 0x2660c200, 0x7565bde4, 0x64241f7a, 0x8248dca9, 0xc3b3ad66, 0x28136086, 0x0bd8dfa8, 0x356d1cf2,\n 0x107789be, 0xb3b2e9ce, 0x0502aa8f, 0x0bc0351e, 0x166bf52a, 0xeb12ff82, 0xe3486911, 0xd34d7516,\n 0x4e7b3aff, 0x5f43671b, 0x9cf6e037, 0x4981ac83, 0x334266ce, 0x8c9341b7, 0xd0d854c0, 0xcb3a6c88,\n 0x47bc2829, 0x4725ba37, 0xa66ad22b, 0x7ad61f1e, 0x0c5cbafa, 0x4437f107, 0xb6e79962, 0x42d2d816,\n 0x0a961288, 0xe1a5c06e, 0x13749e67, 0x72fc081a, 0xb1d139f7, 0xf9583745, 0xcf19df58, 0xbec3f756,\n 0xc06eba30, 0x07211b24, 0x45c28829, 0xc95e317f, 0xbc8ec511, 0x38bc46e9, 0xc6e6fa14, 0xbae8584a,\n 0xad4ebc46, 0x468f508b, 0x7829435f, 0xf124183b, 0x821dba9f, 0xaff60ff4, 0xea2c4e6d, 0x16e39264,\n 0x92544a8b, 0x009b4fc3, 0xaba68ced, 0x9ac96f78, 0x06a5b79a, 0xb2856e6e, 0x1aec3ca9, 0xbe838688,\n 0x0e0804e9, 0x55f1be56, 0xe7e5363b, 0xb3a1f25d, 0xf7debb85, 0x61fe033c, 0x16746233, 0x3c034c28,\n 0xda6d0c74, 0x79aac56c, 0x3ce4e1ad, 0x51f0c802, 0x98f8f35a, 0x1626a49f, 0xeed82b29, 0x1d382fe3,\n 0x0c4fb99a, 0xbb325778, 0x3ec6d97b, 0x6e77a6a9, 0xcb658b5c, 0xd45230c7, 0x2bd1408b, 0x60c03eb7,\n 0xb9068d78, 0xa33754f4, 0xf430c87d, 0xc8a71302, 0xb96d8c32, 0xebd4e7be, 0xbe8b9d2d, 0x7979fb06,\n 0xe7225308, 0x8b75cf77, 0x11ef8da4, 0xe083c858, 0x8d6b786f, 0x5a6317a6, 0xfa5cf7a0, 0x5dda0033,\n 0xf28ebfb0, 0xf5b9c310, 0xa0eac280, 0x08b9767a, 0xa3d9d2b0, 0x79d34217, 0x021a718d, 0x9ac6336a,\n 0x2711fd60, 0x438050e3, 0x069908a8, 0x3d7fedc4, 0x826d2bef, 0x4eeb8476, 0x488dcf25, 0x36c9d566,\n 0x28e74e41, 0xc2610aca, 0x3d49a9cf, 0xbae3b9df, 0xb65f8de6, 0x92aeaf64, 0x3ac7d5e6, 0x9ea80509,\n 0xf22b017d, 0xa4173f70, 0xdd1e16c3, 0x15e0d7f9, 0x50b1b887, 0x2b9f4fd5, 0x625aba82, 0x6a017962,\n 0x2ec01b9c, 0x15488aa9, 0xd716e740, 0x40055a2c, 0x93d29a22, 0xe32dbf9a, 0x058745b9, 0x3453dc1e,\n 0xd699296e, 0x496cff6f, 0x1c9f4986, 0xdfe2ed07, 0xb87242d1, 0x19de7eae, 0x053e561a, 0x15ad6f8c,\n 0x66626c1c, 0x7154c24c, 0xea082b2a, 0x93eb2939, 0x17dcb0f0, 0x58d4f2ae, 0x9ea294fb, 0x52cf564c,\n 0x9883fe66, 0x2ec40581, 0x763953c3, 0x01d6692e, 0xd3a0c108, 0xa1e7160e, 0xe4f2dfa6, 0x693ed285,\n 0x74904698, 0x4c2b0edd, 0x4f757656, 0x5d393378, 0xa132234f, 0x3d321c5d, 0xc3f5e194, 0x4b269301,\n 0xc79f022f, 0x3c997e7e, 0x5e4f9504, 0x3ffafbbd, 0x76f7ad0e, 0x296693f4, 0x3d1fce6f, 0xc61e45be,\n 0xd3b5ab34, 0xf72bf9b7, 0x1b0434c0, 0x4e72b567, 0x5592a33d, 0xb5229301, 0xcfd2a87f, 0x60aeb767,\n 0x1814386b, 0x30bcc33d, 0x38a0c07d, 0xfd1606f2, 0xc363519b, 0x589dd390, 0x5479f8e6, 0x1cb8d647,\n 0x97fd61a9, 0xea7759f4, 0x2d57539d, 0x569a58cf, 0xe84e63ad, 0x462e1b78, 0x6580f87e, 0xf3817914,\n 0x91da55f4, 0x40a230f3, 0xd1988f35, 0xb6e318d2, 0x3ffa50bc, 0x3d40f021, 0xc3c0bdae, 0x4958c24c,\n 0x518f36b2, 0x84b1d370, 0x0fedce83, 0x878ddada, 0xf2a279c7, 0x94e01be8, 0x90716f4b, 0x954b8aa3\n ];\n\n sBox[7] = [\n 0xe216300d, 0xbbddfffc, 0xa7ebdabd, 0x35648095, 0x7789f8b7, 0xe6c1121b, 0x0e241600, 0x052ce8b5,\n 0x11a9cfb0, 0xe5952f11, 0xece7990a, 0x9386d174, 0x2a42931c, 0x76e38111, 0xb12def3a, 0x37ddddfc,\n 0xde9adeb1, 0x0a0cc32c, 0xbe197029, 0x84a00940, 0xbb243a0f, 0xb4d137cf, 0xb44e79f0, 0x049eedfd,\n 0x0b15a15d, 0x480d3168, 0x8bbbde5a, 0x669ded42, 0xc7ece831, 0x3f8f95e7, 0x72df191b, 0x7580330d,\n 0x94074251, 0x5c7dcdfa, 0xabbe6d63, 0xaa402164, 0xb301d40a, 0x02e7d1ca, 0x53571dae, 0x7a3182a2,\n 0x12a8ddec, 0xfdaa335d, 0x176f43e8, 0x71fb46d4, 0x38129022, 0xce949ad4, 0xb84769ad, 0x965bd862,\n 0x82f3d055, 0x66fb9767, 0x15b80b4e, 0x1d5b47a0, 0x4cfde06f, 0xc28ec4b8, 0x57e8726e, 0x647a78fc,\n 0x99865d44, 0x608bd593, 0x6c200e03, 0x39dc5ff6, 0x5d0b00a3, 0xae63aff2, 0x7e8bd632, 0x70108c0c,\n 0xbbd35049, 0x2998df04, 0x980cf42a, 0x9b6df491, 0x9e7edd53, 0x06918548, 0x58cb7e07, 0x3b74ef2e,\n 0x522fffb1, 0xd24708cc, 0x1c7e27cd, 0xa4eb215b, 0x3cf1d2e2, 0x19b47a38, 0x424f7618, 0x35856039,\n 0x9d17dee7, 0x27eb35e6, 0xc9aff67b, 0x36baf5b8, 0x09c467cd, 0xc18910b1, 0xe11dbf7b, 0x06cd1af8,\n 0x7170c608, 0x2d5e3354, 0xd4de495a, 0x64c6d006, 0xbcc0c62c, 0x3dd00db3, 0x708f8f34, 0x77d51b42,\n 0x264f620f, 0x24b8d2bf, 0x15c1b79e, 0x46a52564, 0xf8d7e54e, 0x3e378160, 0x7895cda5, 0x859c15a5,\n 0xe6459788, 0xc37bc75f, 0xdb07ba0c, 0x0676a3ab, 0x7f229b1e, 0x31842e7b, 0x24259fd7, 0xf8bef472,\n 0x835ffcb8, 0x6df4c1f2, 0x96f5b195, 0xfd0af0fc, 0xb0fe134c, 0xe2506d3d, 0x4f9b12ea, 0xf215f225,\n 0xa223736f, 0x9fb4c428, 0x25d04979, 0x34c713f8, 0xc4618187, 0xea7a6e98, 0x7cd16efc, 0x1436876c,\n 0xf1544107, 0xbedeee14, 0x56e9af27, 0xa04aa441, 0x3cf7c899, 0x92ecbae6, 0xdd67016d, 0x151682eb,\n 0xa842eedf, 0xfdba60b4, 0xf1907b75, 0x20e3030f, 0x24d8c29e, 0xe139673b, 0xefa63fb8, 0x71873054,\n 0xb6f2cf3b, 0x9f326442, 0xcb15a4cc, 0xb01a4504, 0xf1e47d8d, 0x844a1be5, 0xbae7dfdc, 0x42cbda70,\n 0xcd7dae0a, 0x57e85b7a, 0xd53f5af6, 0x20cf4d8c, 0xcea4d428, 0x79d130a4, 0x3486ebfb, 0x33d3cddc,\n 0x77853b53, 0x37effcb5, 0xc5068778, 0xe580b3e6, 0x4e68b8f4, 0xc5c8b37e, 0x0d809ea2, 0x398feb7c,\n 0x132a4f94, 0x43b7950e, 0x2fee7d1c, 0x223613bd, 0xdd06caa2, 0x37df932b, 0xc4248289, 0xacf3ebc3,\n 0x5715f6b7, 0xef3478dd, 0xf267616f, 0xc148cbe4, 0x9052815e, 0x5e410fab, 0xb48a2465, 0x2eda7fa4,\n 0xe87b40e4, 0xe98ea084, 0x5889e9e1, 0xefd390fc, 0xdd07d35b, 0xdb485694, 0x38d7e5b2, 0x57720101,\n 0x730edebc, 0x5b643113, 0x94917e4f, 0x503c2fba, 0x646f1282, 0x7523d24a, 0xe0779695, 0xf9c17a8f,\n 0x7a5b2121, 0xd187b896, 0x29263a4d, 0xba510cdf, 0x81f47c9f, 0xad1163ed, 0xea7b5965, 0x1a00726e,\n 0x11403092, 0x00da6d77, 0x4a0cdd61, 0xad1f4603, 0x605bdfb0, 0x9eedc364, 0x22ebe6a8, 0xcee7d28a,\n 0xa0e736a0, 0x5564a6b9, 0x10853209, 0xc7eb8f37, 0x2de705ca, 0x8951570f, 0xdf09822b, 0xbd691a6c,\n 0xaa12e4f2, 0x87451c0f, 0xe0f6a27a, 0x3ada4819, 0x4cf1764f, 0x0d771c2b, 0x67cdb156, 0x350d8384,\n 0x5938fa0f, 0x42399ef3, 0x36997b07, 0x0e84093d, 0x4aa93e61, 0x8360d87b, 0x1fa98b0c, 0x1149382c,\n 0xe97625a5, 0x0614d1b7, 0x0e25244b, 0x0c768347, 0x589e8d82, 0x0d2059d1, 0xa466bb1e, 0xf8da0a82,\n 0x04f19130, 0xba6e4ec0, 0x99265164, 0x1ee7230d, 0x50b2ad80, 0xeaee6801, 0x8db2a283, 0xea8bf59e\n ];\n}\n\nfunction CAST5(key) {\n this.cast5 = new OpenPGPSymEncCAST5();\n this.cast5.setKey(key);\n\n this.encrypt = function(block) {\n return this.cast5.encrypt(block);\n };\n}\n\nCAST5.blockSize = CAST5.prototype.blockSize = 8;\nCAST5.keySize = CAST5.prototype.keySize = 16;\n\nexport default CAST5;\n","/* eslint-disable no-mixed-operators, no-fallthrough */\n\n\n/* Modified by Recurity Labs GmbH\n *\n * Cipher.js\n * A block-cipher algorithm implementation on JavaScript\n * See Cipher.readme.txt for further information.\n *\n * Copyright(c) 2009 Atsushi Oka [ http://oka.nu/ ]\n * This script file is distributed under the LGPL\n *\n * ACKNOWLEDGMENT\n *\n * The main subroutines are written by Michiel van Everdingen.\n *\n * Michiel van Everdingen\n * http://home.versatel.nl/MAvanEverdingen/index.html\n *\n * All rights for these routines are reserved to Michiel van Everdingen.\n *\n */\n\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n//Math\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\nconst MAXINT = 0xFFFFFFFF;\n\nfunction rotw(w, n) {\n return (w << n | w >>> (32 - n)) & MAXINT;\n}\n\nfunction getW(a, i) {\n return a[i] | a[i + 1] << 8 | a[i + 2] << 16 | a[i + 3] << 24;\n}\n\nfunction setW(a, i, w) {\n a.splice(i, 4, w & 0xFF, (w >>> 8) & 0xFF, (w >>> 16) & 0xFF, (w >>> 24) & 0xFF);\n}\n\nfunction getB(x, n) {\n return (x >>> (n * 8)) & 0xFF;\n}\n\n// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n// Twofish\n// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\nfunction createTwofish() {\n //\n let keyBytes = null;\n let dataBytes = null;\n let dataOffset = -1;\n // var dataLength = -1;\n // var idx2 = -1;\n //\n\n let tfsKey = [];\n let tfsM = [\n [],\n [],\n [],\n []\n ];\n\n function tfsInit(key) {\n keyBytes = key;\n let i;\n let a;\n let b;\n let c;\n let d;\n const meKey = [];\n const moKey = [];\n const inKey = [];\n let kLen;\n const sKey = [];\n let f01;\n let f5b;\n let fef;\n\n const q0 = [\n [8, 1, 7, 13, 6, 15, 3, 2, 0, 11, 5, 9, 14, 12, 10, 4],\n [2, 8, 11, 13, 15, 7, 6, 14, 3, 1, 9, 4, 0, 10, 12, 5]\n ];\n const q1 = [\n [14, 12, 11, 8, 1, 2, 3, 5, 15, 4, 10, 6, 7, 0, 9, 13],\n [1, 14, 2, 11, 4, 12, 3, 7, 6, 13, 10, 5, 15, 9, 0, 8]\n ];\n const q2 = [\n [11, 10, 5, 14, 6, 13, 9, 0, 12, 8, 15, 3, 2, 4, 7, 1],\n [4, 12, 7, 5, 1, 6, 9, 10, 0, 14, 13, 8, 2, 11, 3, 15]\n ];\n const q3 = [\n [13, 7, 15, 4, 1, 2, 6, 14, 9, 11, 3, 0, 8, 5, 12, 10],\n [11, 9, 5, 1, 12, 3, 13, 14, 6, 4, 7, 15, 2, 0, 8, 10]\n ];\n const ror4 = [0, 8, 1, 9, 2, 10, 3, 11, 4, 12, 5, 13, 6, 14, 7, 15];\n const ashx = [0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12, 5, 14, 7];\n const q = [\n [],\n []\n ];\n const m = [\n [],\n [],\n [],\n []\n ];\n\n function ffm5b(x) {\n return x ^ (x >> 2) ^ [0, 90, 180, 238][x & 3];\n }\n\n function ffmEf(x) {\n return x ^ (x >> 1) ^ (x >> 2) ^ [0, 238, 180, 90][x & 3];\n }\n\n function mdsRem(p, q) {\n let i;\n let t;\n let u;\n for (i = 0; i < 8; i++) {\n t = q >>> 24;\n q = ((q << 8) & MAXINT) | p >>> 24;\n p = (p << 8) & MAXINT;\n u = t << 1;\n if (t & 128) {\n u ^= 333;\n }\n q ^= t ^ (u << 16);\n u ^= t >>> 1;\n if (t & 1) {\n u ^= 166;\n }\n q ^= u << 24 | u << 8;\n }\n return q;\n }\n\n function qp(n, x) {\n const a = x >> 4;\n const b = x & 15;\n const c = q0[n][a ^ b];\n const d = q1[n][ror4[b] ^ ashx[a]];\n return q3[n][ror4[d] ^ ashx[c]] << 4 | q2[n][c ^ d];\n }\n\n function hFun(x, key) {\n let a = getB(x, 0);\n let b = getB(x, 1);\n let c = getB(x, 2);\n let d = getB(x, 3);\n switch (kLen) {\n case 4:\n a = q[1][a] ^ getB(key[3], 0);\n b = q[0][b] ^ getB(key[3], 1);\n c = q[0][c] ^ getB(key[3], 2);\n d = q[1][d] ^ getB(key[3], 3);\n case 3:\n a = q[1][a] ^ getB(key[2], 0);\n b = q[1][b] ^ getB(key[2], 1);\n c = q[0][c] ^ getB(key[2], 2);\n d = q[0][d] ^ getB(key[2], 3);\n case 2:\n a = q[0][q[0][a] ^ getB(key[1], 0)] ^ getB(key[0], 0);\n b = q[0][q[1][b] ^ getB(key[1], 1)] ^ getB(key[0], 1);\n c = q[1][q[0][c] ^ getB(key[1], 2)] ^ getB(key[0], 2);\n d = q[1][q[1][d] ^ getB(key[1], 3)] ^ getB(key[0], 3);\n }\n return m[0][a] ^ m[1][b] ^ m[2][c] ^ m[3][d];\n }\n\n keyBytes = keyBytes.slice(0, 32);\n i = keyBytes.length;\n while (i !== 16 && i !== 24 && i !== 32) {\n keyBytes[i++] = 0;\n }\n\n for (i = 0; i < keyBytes.length; i += 4) {\n inKey[i >> 2] = getW(keyBytes, i);\n }\n for (i = 0; i < 256; i++) {\n q[0][i] = qp(0, i);\n q[1][i] = qp(1, i);\n }\n for (i = 0; i < 256; i++) {\n f01 = q[1][i];\n f5b = ffm5b(f01);\n fef = ffmEf(f01);\n m[0][i] = f01 + (f5b << 8) + (fef << 16) + (fef << 24);\n m[2][i] = f5b + (fef << 8) + (f01 << 16) + (fef << 24);\n f01 = q[0][i];\n f5b = ffm5b(f01);\n fef = ffmEf(f01);\n m[1][i] = fef + (fef << 8) + (f5b << 16) + (f01 << 24);\n m[3][i] = f5b + (f01 << 8) + (fef << 16) + (f5b << 24);\n }\n\n kLen = inKey.length / 2;\n for (i = 0; i < kLen; i++) {\n a = inKey[i + i];\n meKey[i] = a;\n b = inKey[i + i + 1];\n moKey[i] = b;\n sKey[kLen - i - 1] = mdsRem(a, b);\n }\n for (i = 0; i < 40; i += 2) {\n a = 0x1010101 * i;\n b = a + 0x1010101;\n a = hFun(a, meKey);\n b = rotw(hFun(b, moKey), 8);\n tfsKey[i] = (a + b) & MAXINT;\n tfsKey[i + 1] = rotw(a + 2 * b, 9);\n }\n for (i = 0; i < 256; i++) {\n a = b = c = d = i;\n switch (kLen) {\n case 4:\n a = q[1][a] ^ getB(sKey[3], 0);\n b = q[0][b] ^ getB(sKey[3], 1);\n c = q[0][c] ^ getB(sKey[3], 2);\n d = q[1][d] ^ getB(sKey[3], 3);\n case 3:\n a = q[1][a] ^ getB(sKey[2], 0);\n b = q[1][b] ^ getB(sKey[2], 1);\n c = q[0][c] ^ getB(sKey[2], 2);\n d = q[0][d] ^ getB(sKey[2], 3);\n case 2:\n tfsM[0][i] = m[0][q[0][q[0][a] ^ getB(sKey[1], 0)] ^ getB(sKey[0], 0)];\n tfsM[1][i] = m[1][q[0][q[1][b] ^ getB(sKey[1], 1)] ^ getB(sKey[0], 1)];\n tfsM[2][i] = m[2][q[1][q[0][c] ^ getB(sKey[1], 2)] ^ getB(sKey[0], 2)];\n tfsM[3][i] = m[3][q[1][q[1][d] ^ getB(sKey[1], 3)] ^ getB(sKey[0], 3)];\n }\n }\n }\n\n function tfsG0(x) {\n return tfsM[0][getB(x, 0)] ^ tfsM[1][getB(x, 1)] ^ tfsM[2][getB(x, 2)] ^ tfsM[3][getB(x, 3)];\n }\n\n function tfsG1(x) {\n return tfsM[0][getB(x, 3)] ^ tfsM[1][getB(x, 0)] ^ tfsM[2][getB(x, 1)] ^ tfsM[3][getB(x, 2)];\n }\n\n function tfsFrnd(r, blk) {\n let a = tfsG0(blk[0]);\n let b = tfsG1(blk[1]);\n blk[2] = rotw(blk[2] ^ (a + b + tfsKey[4 * r + 8]) & MAXINT, 31);\n blk[3] = rotw(blk[3], 1) ^ (a + 2 * b + tfsKey[4 * r + 9]) & MAXINT;\n a = tfsG0(blk[2]);\n b = tfsG1(blk[3]);\n blk[0] = rotw(blk[0] ^ (a + b + tfsKey[4 * r + 10]) & MAXINT, 31);\n blk[1] = rotw(blk[1], 1) ^ (a + 2 * b + tfsKey[4 * r + 11]) & MAXINT;\n }\n\n function tfsIrnd(i, blk) {\n let a = tfsG0(blk[0]);\n let b = tfsG1(blk[1]);\n blk[2] = rotw(blk[2], 1) ^ (a + b + tfsKey[4 * i + 10]) & MAXINT;\n blk[3] = rotw(blk[3] ^ (a + 2 * b + tfsKey[4 * i + 11]) & MAXINT, 31);\n a = tfsG0(blk[2]);\n b = tfsG1(blk[3]);\n blk[0] = rotw(blk[0], 1) ^ (a + b + tfsKey[4 * i + 8]) & MAXINT;\n blk[1] = rotw(blk[1] ^ (a + 2 * b + tfsKey[4 * i + 9]) & MAXINT, 31);\n }\n\n function tfsClose() {\n tfsKey = [];\n tfsM = [\n [],\n [],\n [],\n []\n ];\n }\n\n function tfsEncrypt(data, offset) {\n dataBytes = data;\n dataOffset = offset;\n const blk = [getW(dataBytes, dataOffset) ^ tfsKey[0],\n getW(dataBytes, dataOffset + 4) ^ tfsKey[1],\n getW(dataBytes, dataOffset + 8) ^ tfsKey[2],\n getW(dataBytes, dataOffset + 12) ^ tfsKey[3]];\n for (let j = 0; j < 8; j++) {\n tfsFrnd(j, blk);\n }\n setW(dataBytes, dataOffset, blk[2] ^ tfsKey[4]);\n setW(dataBytes, dataOffset + 4, blk[3] ^ tfsKey[5]);\n setW(dataBytes, dataOffset + 8, blk[0] ^ tfsKey[6]);\n setW(dataBytes, dataOffset + 12, blk[1] ^ tfsKey[7]);\n dataOffset += 16;\n return dataBytes;\n }\n\n function tfsDecrypt(data, offset) {\n dataBytes = data;\n dataOffset = offset;\n const blk = [getW(dataBytes, dataOffset) ^ tfsKey[4],\n getW(dataBytes, dataOffset + 4) ^ tfsKey[5],\n getW(dataBytes, dataOffset + 8) ^ tfsKey[6],\n getW(dataBytes, dataOffset + 12) ^ tfsKey[7]];\n for (let j = 7; j >= 0; j--) {\n tfsIrnd(j, blk);\n }\n setW(dataBytes, dataOffset, blk[2] ^ tfsKey[0]);\n setW(dataBytes, dataOffset + 4, blk[3] ^ tfsKey[1]);\n setW(dataBytes, dataOffset + 8, blk[0] ^ tfsKey[2]);\n setW(dataBytes, dataOffset + 12, blk[1] ^ tfsKey[3]);\n dataOffset += 16;\n }\n\n // added by Recurity Labs\n\n function tfsFinal() {\n return dataBytes;\n }\n\n return {\n name: 'twofish',\n blocksize: 128 / 8,\n open: tfsInit,\n close: tfsClose,\n encrypt: tfsEncrypt,\n decrypt: tfsDecrypt,\n // added by Recurity Labs\n finalize: tfsFinal\n };\n}\n\n// added by Recurity Labs\n\nfunction TF(key) {\n this.tf = createTwofish();\n this.tf.open(Array.from(key), 0);\n\n this.encrypt = function(block) {\n return this.tf.encrypt(Array.from(block), 0);\n };\n}\n\nTF.keySize = TF.prototype.keySize = 32;\nTF.blockSize = TF.prototype.blockSize = 16;\n\nexport default TF;\n","/* Modified by Recurity Labs GmbH\n *\n * Originally written by nklein software (nklein.com)\n */\n\n/*\n * Javascript implementation based on Bruce Schneier's reference implementation.\n *\n *\n * The constructor doesn't do much of anything. It's just here\n * so we can start defining properties and methods and such.\n */\nfunction Blowfish() {}\n\n/*\n * Declare the block size so that protocols know what size\n * Initialization Vector (IV) they will need.\n */\nBlowfish.prototype.BLOCKSIZE = 8;\n\n/*\n * These are the default SBOXES.\n */\nBlowfish.prototype.SBOXES = [\n [\n 0xd1310ba6, 0x98dfb5ac, 0x2ffd72db, 0xd01adfb7, 0xb8e1afed, 0x6a267e96,\n 0xba7c9045, 0xf12c7f99, 0x24a19947, 0xb3916cf7, 0x0801f2e2, 0x858efc16,\n 0x636920d8, 0x71574e69, 0xa458fea3, 0xf4933d7e, 0x0d95748f, 0x728eb658,\n 0x718bcd58, 0x82154aee, 0x7b54a41d, 0xc25a59b5, 0x9c30d539, 0x2af26013,\n 0xc5d1b023, 0x286085f0, 0xca417918, 0xb8db38ef, 0x8e79dcb0, 0x603a180e,\n 0x6c9e0e8b, 0xb01e8a3e, 0xd71577c1, 0xbd314b27, 0x78af2fda, 0x55605c60,\n 0xe65525f3, 0xaa55ab94, 0x57489862, 0x63e81440, 0x55ca396a, 0x2aab10b6,\n 0xb4cc5c34, 0x1141e8ce, 0xa15486af, 0x7c72e993, 0xb3ee1411, 0x636fbc2a,\n 0x2ba9c55d, 0x741831f6, 0xce5c3e16, 0x9b87931e, 0xafd6ba33, 0x6c24cf5c,\n 0x7a325381, 0x28958677, 0x3b8f4898, 0x6b4bb9af, 0xc4bfe81b, 0x66282193,\n 0x61d809cc, 0xfb21a991, 0x487cac60, 0x5dec8032, 0xef845d5d, 0xe98575b1,\n 0xdc262302, 0xeb651b88, 0x23893e81, 0xd396acc5, 0x0f6d6ff3, 0x83f44239,\n 0x2e0b4482, 0xa4842004, 0x69c8f04a, 0x9e1f9b5e, 0x21c66842, 0xf6e96c9a,\n 0x670c9c61, 0xabd388f0, 0x6a51a0d2, 0xd8542f68, 0x960fa728, 0xab5133a3,\n 0x6eef0b6c, 0x137a3be4, 0xba3bf050, 0x7efb2a98, 0xa1f1651d, 0x39af0176,\n 0x66ca593e, 0x82430e88, 0x8cee8619, 0x456f9fb4, 0x7d84a5c3, 0x3b8b5ebe,\n 0xe06f75d8, 0x85c12073, 0x401a449f, 0x56c16aa6, 0x4ed3aa62, 0x363f7706,\n 0x1bfedf72, 0x429b023d, 0x37d0d724, 0xd00a1248, 0xdb0fead3, 0x49f1c09b,\n 0x075372c9, 0x80991b7b, 0x25d479d8, 0xf6e8def7, 0xe3fe501a, 0xb6794c3b,\n 0x976ce0bd, 0x04c006ba, 0xc1a94fb6, 0x409f60c4, 0x5e5c9ec2, 0x196a2463,\n 0x68fb6faf, 0x3e6c53b5, 0x1339b2eb, 0x3b52ec6f, 0x6dfc511f, 0x9b30952c,\n 0xcc814544, 0xaf5ebd09, 0xbee3d004, 0xde334afd, 0x660f2807, 0x192e4bb3,\n 0xc0cba857, 0x45c8740f, 0xd20b5f39, 0xb9d3fbdb, 0x5579c0bd, 0x1a60320a,\n 0xd6a100c6, 0x402c7279, 0x679f25fe, 0xfb1fa3cc, 0x8ea5e9f8, 0xdb3222f8,\n 0x3c7516df, 0xfd616b15, 0x2f501ec8, 0xad0552ab, 0x323db5fa, 0xfd238760,\n 0x53317b48, 0x3e00df82, 0x9e5c57bb, 0xca6f8ca0, 0x1a87562e, 0xdf1769db,\n 0xd542a8f6, 0x287effc3, 0xac6732c6, 0x8c4f5573, 0x695b27b0, 0xbbca58c8,\n 0xe1ffa35d, 0xb8f011a0, 0x10fa3d98, 0xfd2183b8, 0x4afcb56c, 0x2dd1d35b,\n 0x9a53e479, 0xb6f84565, 0xd28e49bc, 0x4bfb9790, 0xe1ddf2da, 0xa4cb7e33,\n 0x62fb1341, 0xcee4c6e8, 0xef20cada, 0x36774c01, 0xd07e9efe, 0x2bf11fb4,\n 0x95dbda4d, 0xae909198, 0xeaad8e71, 0x6b93d5a0, 0xd08ed1d0, 0xafc725e0,\n 0x8e3c5b2f, 0x8e7594b7, 0x8ff6e2fb, 0xf2122b64, 0x8888b812, 0x900df01c,\n 0x4fad5ea0, 0x688fc31c, 0xd1cff191, 0xb3a8c1ad, 0x2f2f2218, 0xbe0e1777,\n 0xea752dfe, 0x8b021fa1, 0xe5a0cc0f, 0xb56f74e8, 0x18acf3d6, 0xce89e299,\n 0xb4a84fe0, 0xfd13e0b7, 0x7cc43b81, 0xd2ada8d9, 0x165fa266, 0x80957705,\n 0x93cc7314, 0x211a1477, 0xe6ad2065, 0x77b5fa86, 0xc75442f5, 0xfb9d35cf,\n 0xebcdaf0c, 0x7b3e89a0, 0xd6411bd3, 0xae1e7e49, 0x00250e2d, 0x2071b35e,\n 0x226800bb, 0x57b8e0af, 0x2464369b, 0xf009b91e, 0x5563911d, 0x59dfa6aa,\n 0x78c14389, 0xd95a537f, 0x207d5ba2, 0x02e5b9c5, 0x83260376, 0x6295cfa9,\n 0x11c81968, 0x4e734a41, 0xb3472dca, 0x7b14a94a, 0x1b510052, 0x9a532915,\n 0xd60f573f, 0xbc9bc6e4, 0x2b60a476, 0x81e67400, 0x08ba6fb5, 0x571be91f,\n 0xf296ec6b, 0x2a0dd915, 0xb6636521, 0xe7b9f9b6, 0xff34052e, 0xc5855664,\n 0x53b02d5d, 0xa99f8fa1, 0x08ba4799, 0x6e85076a\n ],\n [\n 0x4b7a70e9, 0xb5b32944, 0xdb75092e, 0xc4192623, 0xad6ea6b0, 0x49a7df7d,\n 0x9cee60b8, 0x8fedb266, 0xecaa8c71, 0x699a17ff, 0x5664526c, 0xc2b19ee1,\n 0x193602a5, 0x75094c29, 0xa0591340, 0xe4183a3e, 0x3f54989a, 0x5b429d65,\n 0x6b8fe4d6, 0x99f73fd6, 0xa1d29c07, 0xefe830f5, 0x4d2d38e6, 0xf0255dc1,\n 0x4cdd2086, 0x8470eb26, 0x6382e9c6, 0x021ecc5e, 0x09686b3f, 0x3ebaefc9,\n 0x3c971814, 0x6b6a70a1, 0x687f3584, 0x52a0e286, 0xb79c5305, 0xaa500737,\n 0x3e07841c, 0x7fdeae5c, 0x8e7d44ec, 0x5716f2b8, 0xb03ada37, 0xf0500c0d,\n 0xf01c1f04, 0x0200b3ff, 0xae0cf51a, 0x3cb574b2, 0x25837a58, 0xdc0921bd,\n 0xd19113f9, 0x7ca92ff6, 0x94324773, 0x22f54701, 0x3ae5e581, 0x37c2dadc,\n 0xc8b57634, 0x9af3dda7, 0xa9446146, 0x0fd0030e, 0xecc8c73e, 0xa4751e41,\n 0xe238cd99, 0x3bea0e2f, 0x3280bba1, 0x183eb331, 0x4e548b38, 0x4f6db908,\n 0x6f420d03, 0xf60a04bf, 0x2cb81290, 0x24977c79, 0x5679b072, 0xbcaf89af,\n 0xde9a771f, 0xd9930810, 0xb38bae12, 0xdccf3f2e, 0x5512721f, 0x2e6b7124,\n 0x501adde6, 0x9f84cd87, 0x7a584718, 0x7408da17, 0xbc9f9abc, 0xe94b7d8c,\n 0xec7aec3a, 0xdb851dfa, 0x63094366, 0xc464c3d2, 0xef1c1847, 0x3215d908,\n 0xdd433b37, 0x24c2ba16, 0x12a14d43, 0x2a65c451, 0x50940002, 0x133ae4dd,\n 0x71dff89e, 0x10314e55, 0x81ac77d6, 0x5f11199b, 0x043556f1, 0xd7a3c76b,\n 0x3c11183b, 0x5924a509, 0xf28fe6ed, 0x97f1fbfa, 0x9ebabf2c, 0x1e153c6e,\n 0x86e34570, 0xeae96fb1, 0x860e5e0a, 0x5a3e2ab3, 0x771fe71c, 0x4e3d06fa,\n 0x2965dcb9, 0x99e71d0f, 0x803e89d6, 0x5266c825, 0x2e4cc978, 0x9c10b36a,\n 0xc6150eba, 0x94e2ea78, 0xa5fc3c53, 0x1e0a2df4, 0xf2f74ea7, 0x361d2b3d,\n 0x1939260f, 0x19c27960, 0x5223a708, 0xf71312b6, 0xebadfe6e, 0xeac31f66,\n 0xe3bc4595, 0xa67bc883, 0xb17f37d1, 0x018cff28, 0xc332ddef, 0xbe6c5aa5,\n 0x65582185, 0x68ab9802, 0xeecea50f, 0xdb2f953b, 0x2aef7dad, 0x5b6e2f84,\n 0x1521b628, 0x29076170, 0xecdd4775, 0x619f1510, 0x13cca830, 0xeb61bd96,\n 0x0334fe1e, 0xaa0363cf, 0xb5735c90, 0x4c70a239, 0xd59e9e0b, 0xcbaade14,\n 0xeecc86bc, 0x60622ca7, 0x9cab5cab, 0xb2f3846e, 0x648b1eaf, 0x19bdf0ca,\n 0xa02369b9, 0x655abb50, 0x40685a32, 0x3c2ab4b3, 0x319ee9d5, 0xc021b8f7,\n 0x9b540b19, 0x875fa099, 0x95f7997e, 0x623d7da8, 0xf837889a, 0x97e32d77,\n 0x11ed935f, 0x16681281, 0x0e358829, 0xc7e61fd6, 0x96dedfa1, 0x7858ba99,\n 0x57f584a5, 0x1b227263, 0x9b83c3ff, 0x1ac24696, 0xcdb30aeb, 0x532e3054,\n 0x8fd948e4, 0x6dbc3128, 0x58ebf2ef, 0x34c6ffea, 0xfe28ed61, 0xee7c3c73,\n 0x5d4a14d9, 0xe864b7e3, 0x42105d14, 0x203e13e0, 0x45eee2b6, 0xa3aaabea,\n 0xdb6c4f15, 0xfacb4fd0, 0xc742f442, 0xef6abbb5, 0x654f3b1d, 0x41cd2105,\n 0xd81e799e, 0x86854dc7, 0xe44b476a, 0x3d816250, 0xcf62a1f2, 0x5b8d2646,\n 0xfc8883a0, 0xc1c7b6a3, 0x7f1524c3, 0x69cb7492, 0x47848a0b, 0x5692b285,\n 0x095bbf00, 0xad19489d, 0x1462b174, 0x23820e00, 0x58428d2a, 0x0c55f5ea,\n 0x1dadf43e, 0x233f7061, 0x3372f092, 0x8d937e41, 0xd65fecf1, 0x6c223bdb,\n 0x7cde3759, 0xcbee7460, 0x4085f2a7, 0xce77326e, 0xa6078084, 0x19f8509e,\n 0xe8efd855, 0x61d99735, 0xa969a7aa, 0xc50c06c2, 0x5a04abfc, 0x800bcadc,\n 0x9e447a2e, 0xc3453484, 0xfdd56705, 0x0e1e9ec9, 0xdb73dbd3, 0x105588cd,\n 0x675fda79, 0xe3674340, 0xc5c43465, 0x713e38d8, 0x3d28f89e, 0xf16dff20,\n 0x153e21e7, 0x8fb03d4a, 0xe6e39f2b, 0xdb83adf7\n ],\n [\n 0xe93d5a68, 0x948140f7, 0xf64c261c, 0x94692934, 0x411520f7, 0x7602d4f7,\n 0xbcf46b2e, 0xd4a20068, 0xd4082471, 0x3320f46a, 0x43b7d4b7, 0x500061af,\n 0x1e39f62e, 0x97244546, 0x14214f74, 0xbf8b8840, 0x4d95fc1d, 0x96b591af,\n 0x70f4ddd3, 0x66a02f45, 0xbfbc09ec, 0x03bd9785, 0x7fac6dd0, 0x31cb8504,\n 0x96eb27b3, 0x55fd3941, 0xda2547e6, 0xabca0a9a, 0x28507825, 0x530429f4,\n 0x0a2c86da, 0xe9b66dfb, 0x68dc1462, 0xd7486900, 0x680ec0a4, 0x27a18dee,\n 0x4f3ffea2, 0xe887ad8c, 0xb58ce006, 0x7af4d6b6, 0xaace1e7c, 0xd3375fec,\n 0xce78a399, 0x406b2a42, 0x20fe9e35, 0xd9f385b9, 0xee39d7ab, 0x3b124e8b,\n 0x1dc9faf7, 0x4b6d1856, 0x26a36631, 0xeae397b2, 0x3a6efa74, 0xdd5b4332,\n 0x6841e7f7, 0xca7820fb, 0xfb0af54e, 0xd8feb397, 0x454056ac, 0xba489527,\n 0x55533a3a, 0x20838d87, 0xfe6ba9b7, 0xd096954b, 0x55a867bc, 0xa1159a58,\n 0xcca92963, 0x99e1db33, 0xa62a4a56, 0x3f3125f9, 0x5ef47e1c, 0x9029317c,\n 0xfdf8e802, 0x04272f70, 0x80bb155c, 0x05282ce3, 0x95c11548, 0xe4c66d22,\n 0x48c1133f, 0xc70f86dc, 0x07f9c9ee, 0x41041f0f, 0x404779a4, 0x5d886e17,\n 0x325f51eb, 0xd59bc0d1, 0xf2bcc18f, 0x41113564, 0x257b7834, 0x602a9c60,\n 0xdff8e8a3, 0x1f636c1b, 0x0e12b4c2, 0x02e1329e, 0xaf664fd1, 0xcad18115,\n 0x6b2395e0, 0x333e92e1, 0x3b240b62, 0xeebeb922, 0x85b2a20e, 0xe6ba0d99,\n 0xde720c8c, 0x2da2f728, 0xd0127845, 0x95b794fd, 0x647d0862, 0xe7ccf5f0,\n 0x5449a36f, 0x877d48fa, 0xc39dfd27, 0xf33e8d1e, 0x0a476341, 0x992eff74,\n 0x3a6f6eab, 0xf4f8fd37, 0xa812dc60, 0xa1ebddf8, 0x991be14c, 0xdb6e6b0d,\n 0xc67b5510, 0x6d672c37, 0x2765d43b, 0xdcd0e804, 0xf1290dc7, 0xcc00ffa3,\n 0xb5390f92, 0x690fed0b, 0x667b9ffb, 0xcedb7d9c, 0xa091cf0b, 0xd9155ea3,\n 0xbb132f88, 0x515bad24, 0x7b9479bf, 0x763bd6eb, 0x37392eb3, 0xcc115979,\n 0x8026e297, 0xf42e312d, 0x6842ada7, 0xc66a2b3b, 0x12754ccc, 0x782ef11c,\n 0x6a124237, 0xb79251e7, 0x06a1bbe6, 0x4bfb6350, 0x1a6b1018, 0x11caedfa,\n 0x3d25bdd8, 0xe2e1c3c9, 0x44421659, 0x0a121386, 0xd90cec6e, 0xd5abea2a,\n 0x64af674e, 0xda86a85f, 0xbebfe988, 0x64e4c3fe, 0x9dbc8057, 0xf0f7c086,\n 0x60787bf8, 0x6003604d, 0xd1fd8346, 0xf6381fb0, 0x7745ae04, 0xd736fccc,\n 0x83426b33, 0xf01eab71, 0xb0804187, 0x3c005e5f, 0x77a057be, 0xbde8ae24,\n 0x55464299, 0xbf582e61, 0x4e58f48f, 0xf2ddfda2, 0xf474ef38, 0x8789bdc2,\n 0x5366f9c3, 0xc8b38e74, 0xb475f255, 0x46fcd9b9, 0x7aeb2661, 0x8b1ddf84,\n 0x846a0e79, 0x915f95e2, 0x466e598e, 0x20b45770, 0x8cd55591, 0xc902de4c,\n 0xb90bace1, 0xbb8205d0, 0x11a86248, 0x7574a99e, 0xb77f19b6, 0xe0a9dc09,\n 0x662d09a1, 0xc4324633, 0xe85a1f02, 0x09f0be8c, 0x4a99a025, 0x1d6efe10,\n 0x1ab93d1d, 0x0ba5a4df, 0xa186f20f, 0x2868f169, 0xdcb7da83, 0x573906fe,\n 0xa1e2ce9b, 0x4fcd7f52, 0x50115e01, 0xa70683fa, 0xa002b5c4, 0x0de6d027,\n 0x9af88c27, 0x773f8641, 0xc3604c06, 0x61a806b5, 0xf0177a28, 0xc0f586e0,\n 0x006058aa, 0x30dc7d62, 0x11e69ed7, 0x2338ea63, 0x53c2dd94, 0xc2c21634,\n 0xbbcbee56, 0x90bcb6de, 0xebfc7da1, 0xce591d76, 0x6f05e409, 0x4b7c0188,\n 0x39720a3d, 0x7c927c24, 0x86e3725f, 0x724d9db9, 0x1ac15bb4, 0xd39eb8fc,\n 0xed545578, 0x08fca5b5, 0xd83d7cd3, 0x4dad0fc4, 0x1e50ef5e, 0xb161e6f8,\n 0xa28514d9, 0x6c51133c, 0x6fd5c7e7, 0x56e14ec4, 0x362abfce, 0xddc6c837,\n 0xd79a3234, 0x92638212, 0x670efa8e, 0x406000e0\n ],\n [\n 0x3a39ce37, 0xd3faf5cf, 0xabc27737, 0x5ac52d1b, 0x5cb0679e, 0x4fa33742,\n 0xd3822740, 0x99bc9bbe, 0xd5118e9d, 0xbf0f7315, 0xd62d1c7e, 0xc700c47b,\n 0xb78c1b6b, 0x21a19045, 0xb26eb1be, 0x6a366eb4, 0x5748ab2f, 0xbc946e79,\n 0xc6a376d2, 0x6549c2c8, 0x530ff8ee, 0x468dde7d, 0xd5730a1d, 0x4cd04dc6,\n 0x2939bbdb, 0xa9ba4650, 0xac9526e8, 0xbe5ee304, 0xa1fad5f0, 0x6a2d519a,\n 0x63ef8ce2, 0x9a86ee22, 0xc089c2b8, 0x43242ef6, 0xa51e03aa, 0x9cf2d0a4,\n 0x83c061ba, 0x9be96a4d, 0x8fe51550, 0xba645bd6, 0x2826a2f9, 0xa73a3ae1,\n 0x4ba99586, 0xef5562e9, 0xc72fefd3, 0xf752f7da, 0x3f046f69, 0x77fa0a59,\n 0x80e4a915, 0x87b08601, 0x9b09e6ad, 0x3b3ee593, 0xe990fd5a, 0x9e34d797,\n 0x2cf0b7d9, 0x022b8b51, 0x96d5ac3a, 0x017da67d, 0xd1cf3ed6, 0x7c7d2d28,\n 0x1f9f25cf, 0xadf2b89b, 0x5ad6b472, 0x5a88f54c, 0xe029ac71, 0xe019a5e6,\n 0x47b0acfd, 0xed93fa9b, 0xe8d3c48d, 0x283b57cc, 0xf8d56629, 0x79132e28,\n 0x785f0191, 0xed756055, 0xf7960e44, 0xe3d35e8c, 0x15056dd4, 0x88f46dba,\n 0x03a16125, 0x0564f0bd, 0xc3eb9e15, 0x3c9057a2, 0x97271aec, 0xa93a072a,\n 0x1b3f6d9b, 0x1e6321f5, 0xf59c66fb, 0x26dcf319, 0x7533d928, 0xb155fdf5,\n 0x03563482, 0x8aba3cbb, 0x28517711, 0xc20ad9f8, 0xabcc5167, 0xccad925f,\n 0x4de81751, 0x3830dc8e, 0x379d5862, 0x9320f991, 0xea7a90c2, 0xfb3e7bce,\n 0x5121ce64, 0x774fbe32, 0xa8b6e37e, 0xc3293d46, 0x48de5369, 0x6413e680,\n 0xa2ae0810, 0xdd6db224, 0x69852dfd, 0x09072166, 0xb39a460a, 0x6445c0dd,\n 0x586cdecf, 0x1c20c8ae, 0x5bbef7dd, 0x1b588d40, 0xccd2017f, 0x6bb4e3bb,\n 0xdda26a7e, 0x3a59ff45, 0x3e350a44, 0xbcb4cdd5, 0x72eacea8, 0xfa6484bb,\n 0x8d6612ae, 0xbf3c6f47, 0xd29be463, 0x542f5d9e, 0xaec2771b, 0xf64e6370,\n 0x740e0d8d, 0xe75b1357, 0xf8721671, 0xaf537d5d, 0x4040cb08, 0x4eb4e2cc,\n 0x34d2466a, 0x0115af84, 0xe1b00428, 0x95983a1d, 0x06b89fb4, 0xce6ea048,\n 0x6f3f3b82, 0x3520ab82, 0x011a1d4b, 0x277227f8, 0x611560b1, 0xe7933fdc,\n 0xbb3a792b, 0x344525bd, 0xa08839e1, 0x51ce794b, 0x2f32c9b7, 0xa01fbac9,\n 0xe01cc87e, 0xbcc7d1f6, 0xcf0111c3, 0xa1e8aac7, 0x1a908749, 0xd44fbd9a,\n 0xd0dadecb, 0xd50ada38, 0x0339c32a, 0xc6913667, 0x8df9317c, 0xe0b12b4f,\n 0xf79e59b7, 0x43f5bb3a, 0xf2d519ff, 0x27d9459c, 0xbf97222c, 0x15e6fc2a,\n 0x0f91fc71, 0x9b941525, 0xfae59361, 0xceb69ceb, 0xc2a86459, 0x12baa8d1,\n 0xb6c1075e, 0xe3056a0c, 0x10d25065, 0xcb03a442, 0xe0ec6e0e, 0x1698db3b,\n 0x4c98a0be, 0x3278e964, 0x9f1f9532, 0xe0d392df, 0xd3a0342b, 0x8971f21e,\n 0x1b0a7441, 0x4ba3348c, 0xc5be7120, 0xc37632d8, 0xdf359f8d, 0x9b992f2e,\n 0xe60b6f47, 0x0fe3f11d, 0xe54cda54, 0x1edad891, 0xce6279cf, 0xcd3e7e6f,\n 0x1618b166, 0xfd2c1d05, 0x848fd2c5, 0xf6fb2299, 0xf523f357, 0xa6327623,\n 0x93a83531, 0x56cccd02, 0xacf08162, 0x5a75ebb5, 0x6e163697, 0x88d273cc,\n 0xde966292, 0x81b949d0, 0x4c50901b, 0x71c65614, 0xe6c6c7bd, 0x327a140a,\n 0x45e1d006, 0xc3f27b9a, 0xc9aa53fd, 0x62a80f00, 0xbb25bfe2, 0x35bdd2f6,\n 0x71126905, 0xb2040222, 0xb6cbcf7c, 0xcd769c2b, 0x53113ec0, 0x1640e3d3,\n 0x38abbd60, 0x2547adf0, 0xba38209c, 0xf746ce76, 0x77afa1c5, 0x20756060,\n 0x85cbfe4e, 0x8ae88dd8, 0x7aaaf9b0, 0x4cf9aa7e, 0x1948c25c, 0x02fb8a8c,\n 0x01c36ae4, 0xd6ebe1f9, 0x90d4f869, 0xa65cdea0, 0x3f09252d, 0xc208e69f,\n 0xb74e6132, 0xce77e25b, 0x578fdfe3, 0x3ac372e6\n ]\n];\n\n//*\n//* This is the default PARRAY\n//*\nBlowfish.prototype.PARRAY = [\n 0x243f6a88, 0x85a308d3, 0x13198a2e, 0x03707344, 0xa4093822, 0x299f31d0,\n 0x082efa98, 0xec4e6c89, 0x452821e6, 0x38d01377, 0xbe5466cf, 0x34e90c6c,\n 0xc0ac29b7, 0xc97c50dd, 0x3f84d5b5, 0xb5470917, 0x9216d5d9, 0x8979fb1b\n];\n\n//*\n//* This is the number of rounds the cipher will go\n//*\nBlowfish.prototype.NN = 16;\n\n//*\n//* This function is needed to get rid of problems\n//* with the high-bit getting set. If we don't do\n//* this, then sometimes ( aa & 0x00FFFFFFFF ) is not\n//* equal to ( bb & 0x00FFFFFFFF ) even when they\n//* agree bit-for-bit for the first 32 bits.\n//*\nBlowfish.prototype._clean = function(xx) {\n if (xx < 0) {\n const yy = xx & 0x7FFFFFFF;\n xx = yy + 0x80000000;\n }\n return xx;\n};\n\n//*\n//* This is the mixing function that uses the sboxes\n//*\nBlowfish.prototype._F = function(xx) {\n let yy;\n\n const dd = xx & 0x00FF;\n xx >>>= 8;\n const cc = xx & 0x00FF;\n xx >>>= 8;\n const bb = xx & 0x00FF;\n xx >>>= 8;\n const aa = xx & 0x00FF;\n\n yy = this.sboxes[0][aa] + this.sboxes[1][bb];\n yy ^= this.sboxes[2][cc];\n yy += this.sboxes[3][dd];\n\n return yy;\n};\n\n//*\n//* This method takes an array with two values, left and right\n//* and does NN rounds of Blowfish on them.\n//*\nBlowfish.prototype._encryptBlock = function(vals) {\n let dataL = vals[0];\n let dataR = vals[1];\n\n let ii;\n\n for (ii = 0; ii < this.NN; ++ii) {\n dataL ^= this.parray[ii];\n dataR = this._F(dataL) ^ dataR;\n\n const tmp = dataL;\n dataL = dataR;\n dataR = tmp;\n }\n\n dataL ^= this.parray[this.NN + 0];\n dataR ^= this.parray[this.NN + 1];\n\n vals[0] = this._clean(dataR);\n vals[1] = this._clean(dataL);\n};\n\n//*\n//* This method takes a vector of numbers and turns them\n//* into long words so that they can be processed by the\n//* real algorithm.\n//*\n//* Maybe I should make the real algorithm above take a vector\n//* instead. That will involve more looping, but it won't require\n//* the F() method to deconstruct the vector.\n//*\nBlowfish.prototype.encryptBlock = function(vector) {\n let ii;\n const vals = [0, 0];\n const off = this.BLOCKSIZE / 2;\n for (ii = 0; ii < this.BLOCKSIZE / 2; ++ii) {\n vals[0] = (vals[0] << 8) | (vector[ii + 0] & 0x00FF);\n vals[1] = (vals[1] << 8) | (vector[ii + off] & 0x00FF);\n }\n\n this._encryptBlock(vals);\n\n const ret = [];\n for (ii = 0; ii < this.BLOCKSIZE / 2; ++ii) {\n ret[ii + 0] = ((vals[0] >>> (24 - 8 * (ii))) & 0x00FF);\n ret[ii + off] = ((vals[1] >>> (24 - 8 * (ii))) & 0x00FF);\n // vals[ 0 ] = ( vals[ 0 ] >>> 8 );\n // vals[ 1 ] = ( vals[ 1 ] >>> 8 );\n }\n\n return ret;\n};\n\n//*\n//* This method takes an array with two values, left and right\n//* and undoes NN rounds of Blowfish on them.\n//*\nBlowfish.prototype._decryptBlock = function(vals) {\n let dataL = vals[0];\n let dataR = vals[1];\n\n let ii;\n\n for (ii = this.NN + 1; ii > 1; --ii) {\n dataL ^= this.parray[ii];\n dataR = this._F(dataL) ^ dataR;\n\n const tmp = dataL;\n dataL = dataR;\n dataR = tmp;\n }\n\n dataL ^= this.parray[1];\n dataR ^= this.parray[0];\n\n vals[0] = this._clean(dataR);\n vals[1] = this._clean(dataL);\n};\n\n//*\n//* This method takes a key array and initializes the\n//* sboxes and parray for this encryption.\n//*\nBlowfish.prototype.init = function(key) {\n let ii;\n let jj = 0;\n\n this.parray = [];\n for (ii = 0; ii < this.NN + 2; ++ii) {\n let data = 0x00000000;\n for (let kk = 0; kk < 4; ++kk) {\n data = (data << 8) | (key[jj] & 0x00FF);\n if (++jj >= key.length) {\n jj = 0;\n }\n }\n this.parray[ii] = this.PARRAY[ii] ^ data;\n }\n\n this.sboxes = [];\n for (ii = 0; ii < 4; ++ii) {\n this.sboxes[ii] = [];\n for (jj = 0; jj < 256; ++jj) {\n this.sboxes[ii][jj] = this.SBOXES[ii][jj];\n }\n }\n\n const vals = [0x00000000, 0x00000000];\n\n for (ii = 0; ii < this.NN + 2; ii += 2) {\n this._encryptBlock(vals);\n this.parray[ii + 0] = vals[0];\n this.parray[ii + 1] = vals[1];\n }\n\n for (ii = 0; ii < 4; ++ii) {\n for (jj = 0; jj < 256; jj += 2) {\n this._encryptBlock(vals);\n this.sboxes[ii][jj + 0] = vals[0];\n this.sboxes[ii][jj + 1] = vals[1];\n }\n }\n};\n\n// added by Recurity Labs\nfunction BF(key) {\n this.bf = new Blowfish();\n this.bf.init(key);\n\n this.encrypt = function(block) {\n return this.bf.encryptBlock(block);\n };\n}\n\nBF.keySize = BF.prototype.keySize = 16;\nBF.blockSize = BF.prototype.blockSize = 8;\n\nexport default BF;\n","/**\n * @fileoverview Symmetric cryptography functions\n * @module crypto/cipher\n * @private\n */\n\nimport aes from './aes';\nimport { DES, TripleDES } from './des';\nimport CAST5 from './cast5';\nimport TF from './twofish';\nimport BF from './blowfish';\n\n/**\n * AES-128 encryption and decryption (ID 7)\n * @function\n * @param {String} key - 128-bit key\n * @see {@link https://github.com/asmcrypto/asmcrypto.js|asmCrypto}\n * @see {@link https://csrc.nist.gov/publications/fips/fips197/fips-197.pdf|NIST FIPS-197}\n * @returns {Object}\n */\nexport const aes128 = aes(128);\n/**\n * AES-128 Block Cipher (ID 8)\n * @function\n * @param {String} key - 192-bit key\n * @see {@link https://github.com/asmcrypto/asmcrypto.js|asmCrypto}\n * @see {@link https://csrc.nist.gov/publications/fips/fips197/fips-197.pdf|NIST FIPS-197}\n * @returns {Object}\n */\nexport const aes192 = aes(192);\n/**\n * AES-128 Block Cipher (ID 9)\n * @function\n * @param {String} key - 256-bit key\n * @see {@link https://github.com/asmcrypto/asmcrypto.js|asmCrypto}\n * @see {@link https://csrc.nist.gov/publications/fips/fips197/fips-197.pdf|NIST FIPS-197}\n * @returns {Object}\n */\nexport const aes256 = aes(256);\n// Not in OpenPGP specifications\nexport const des = DES;\n/**\n * Triple DES Block Cipher (ID 2)\n * @function\n * @param {String} key - 192-bit key\n * @see {@link https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-67r2.pdf|NIST SP 800-67}\n * @returns {Object}\n */\nexport const tripledes = TripleDES;\n/**\n * CAST-128 Block Cipher (ID 3)\n * @function\n * @param {String} key - 128-bit key\n * @see {@link https://tools.ietf.org/html/rfc2144|The CAST-128 Encryption Algorithm}\n * @returns {Object}\n */\nexport const cast5 = CAST5;\n/**\n * Twofish Block Cipher (ID 10)\n * @function\n * @param {String} key - 256-bit key\n * @see {@link https://tools.ietf.org/html/rfc4880#ref-TWOFISH|TWOFISH}\n * @returns {Object}\n */\nexport const twofish = TF;\n/**\n * Blowfish Block Cipher (ID 4)\n * @function\n * @param {String} key - 128-bit key\n * @see {@link https://tools.ietf.org/html/rfc4880#ref-BLOWFISH|BLOWFISH}\n * @returns {Object}\n */\nexport const blowfish = BF;\n/**\n * Not implemented\n * @function\n * @throws {Error}\n */\nexport const idea = function() {\n throw new Error('IDEA symmetric-key algorithm not implemented');\n};\n","export var sha1_asm = function ( stdlib, foreign, buffer ) {\n \"use asm\";\n\n // SHA256 state\n var H0 = 0, H1 = 0, H2 = 0, H3 = 0, H4 = 0,\n TOTAL0 = 0, TOTAL1 = 0;\n\n // HMAC state\n var I0 = 0, I1 = 0, I2 = 0, I3 = 0, I4 = 0,\n O0 = 0, O1 = 0, O2 = 0, O3 = 0, O4 = 0;\n\n // I/O buffer\n var HEAP = new stdlib.Uint8Array(buffer);\n\n function _core ( w0, w1, w2, w3, w4, w5, w6, w7, w8, w9, w10, w11, w12, w13, w14, w15 ) {\n w0 = w0|0;\n w1 = w1|0;\n w2 = w2|0;\n w3 = w3|0;\n w4 = w4|0;\n w5 = w5|0;\n w6 = w6|0;\n w7 = w7|0;\n w8 = w8|0;\n w9 = w9|0;\n w10 = w10|0;\n w11 = w11|0;\n w12 = w12|0;\n w13 = w13|0;\n w14 = w14|0;\n w15 = w15|0;\n\n var a = 0, b = 0, c = 0, d = 0, e = 0, n = 0, t = 0,\n w16 = 0, w17 = 0, w18 = 0, w19 = 0,\n w20 = 0, w21 = 0, w22 = 0, w23 = 0, w24 = 0, w25 = 0, w26 = 0, w27 = 0, w28 = 0, w29 = 0,\n w30 = 0, w31 = 0, w32 = 0, w33 = 0, w34 = 0, w35 = 0, w36 = 0, w37 = 0, w38 = 0, w39 = 0,\n w40 = 0, w41 = 0, w42 = 0, w43 = 0, w44 = 0, w45 = 0, w46 = 0, w47 = 0, w48 = 0, w49 = 0,\n w50 = 0, w51 = 0, w52 = 0, w53 = 0, w54 = 0, w55 = 0, w56 = 0, w57 = 0, w58 = 0, w59 = 0,\n w60 = 0, w61 = 0, w62 = 0, w63 = 0, w64 = 0, w65 = 0, w66 = 0, w67 = 0, w68 = 0, w69 = 0,\n w70 = 0, w71 = 0, w72 = 0, w73 = 0, w74 = 0, w75 = 0, w76 = 0, w77 = 0, w78 = 0, w79 = 0;\n\n a = H0;\n b = H1;\n c = H2;\n d = H3;\n e = H4;\n\n // 0\n t = ( w0 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (~b & d)) + 0x5a827999 )|0;\n e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n // 1\n t = ( w1 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (~b & d)) + 0x5a827999 )|0;\n e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n // 2\n t = ( w2 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (~b & d)) + 0x5a827999 )|0;\n e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n // 3\n t = ( w3 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (~b & d)) + 0x5a827999 )|0;\n e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n // 4\n t = ( w4 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (~b & d)) + 0x5a827999 )|0;\n e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n // 5\n t = ( w5 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (~b & d)) + 0x5a827999 )|0;\n e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n // 6\n t = ( w6 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (~b & d)) + 0x5a827999 )|0;\n e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n // 7\n t = ( w7 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (~b & d)) + 0x5a827999 )|0;\n e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n // 8\n t = ( w8 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (~b & d)) + 0x5a827999 )|0;\n e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n // 9\n t = ( w9 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (~b & d)) + 0x5a827999 )|0;\n e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n // 10\n t = ( w10 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (~b & d)) + 0x5a827999 )|0;\n e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n // 11\n t = ( w11 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (~b & d)) + 0x5a827999 )|0;\n e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n // 12\n t = ( w12 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (~b & d)) + 0x5a827999 )|0;\n e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n // 13\n t = ( w13 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (~b & d)) + 0x5a827999 )|0;\n e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n // 14\n t = ( w14 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (~b & d)) + 0x5a827999 )|0;\n e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n // 15\n t = ( w15 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (~b & d)) + 0x5a827999 )|0;\n e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n // 16\n n = w13 ^ w8 ^ w2 ^ w0;\n w16 = (n << 1) | (n >>> 31);\n t = (w16 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (~b & d)) + 0x5a827999 )|0;\n e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n // 17\n n = w14 ^ w9 ^ w3 ^ w1;\n w17 = (n << 1) | (n >>> 31);\n t = (w17 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (~b & d)) + 0x5a827999 )|0;\n e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n // 18\n n = w15 ^ w10 ^ w4 ^ w2;\n w18 = (n << 1) | (n >>> 31);\n t = (w18 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (~b & d)) + 0x5a827999 )|0;\n e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n // 19\n n = w16 ^ w11 ^ w5 ^ w3;\n w19 = (n << 1) | (n >>> 31);\n t = (w19 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (~b & d)) + 0x5a827999 )|0;\n e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n // 20\n n = w17 ^ w12 ^ w6 ^ w4;\n w20 = (n << 1) | (n >>> 31);\n t = (w20 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) + 0x6ed9eba1 )|0;\n e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n // 21\n n = w18 ^ w13 ^ w7 ^ w5;\n w21 = (n << 1) | (n >>> 31);\n t = (w21 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) + 0x6ed9eba1 )|0;\n e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n // 22\n n = w19 ^ w14 ^ w8 ^ w6;\n w22 = (n << 1) | (n >>> 31);\n t = (w22 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) + 0x6ed9eba1 )|0;\n e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n // 23\n n = w20 ^ w15 ^ w9 ^ w7;\n w23 = (n << 1) | (n >>> 31);\n t = (w23 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) + 0x6ed9eba1 )|0;\n e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n // 24\n n = w21 ^ w16 ^ w10 ^ w8;\n w24 = (n << 1) | (n >>> 31);\n t = (w24 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) + 0x6ed9eba1 )|0;\n e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n // 25\n n = w22 ^ w17 ^ w11 ^ w9;\n w25 = (n << 1) | (n >>> 31);\n t = (w25 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) + 0x6ed9eba1 )|0;\n e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n // 26\n n = w23 ^ w18 ^ w12 ^ w10;\n w26 = (n << 1) | (n >>> 31);\n t = (w26 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) + 0x6ed9eba1 )|0;\n e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n // 27\n n = w24 ^ w19 ^ w13 ^ w11;\n w27 = (n << 1) | (n >>> 31);\n t = (w27 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) + 0x6ed9eba1 )|0;\n e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n // 28\n n = w25 ^ w20 ^ w14 ^ w12;\n w28 = (n << 1) | (n >>> 31);\n t = (w28 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) + 0x6ed9eba1 )|0;\n e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n // 29\n n = w26 ^ w21 ^ w15 ^ w13;\n w29 = (n << 1) | (n >>> 31);\n t = (w29 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) + 0x6ed9eba1 )|0;\n e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n // 30\n n = w27 ^ w22 ^ w16 ^ w14;\n w30 = (n << 1) | (n >>> 31);\n t = (w30 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) + 0x6ed9eba1 )|0;\n e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n // 31\n n = w28 ^ w23 ^ w17 ^ w15;\n w31 = (n << 1) | (n >>> 31);\n t = (w31 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) + 0x6ed9eba1 )|0;\n e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n // 32\n n = w29 ^ w24 ^ w18 ^ w16;\n w32 = (n << 1) | (n >>> 31);\n t = (w32 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) + 0x6ed9eba1 )|0;\n e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n // 33\n n = w30 ^ w25 ^ w19 ^ w17;\n w33 = (n << 1) | (n >>> 31);\n t = (w33 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) + 0x6ed9eba1 )|0;\n e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n // 34\n n = w31 ^ w26 ^ w20 ^ w18;\n w34 = (n << 1) | (n >>> 31);\n t = (w34 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) + 0x6ed9eba1 )|0;\n e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n // 35\n n = w32 ^ w27 ^ w21 ^ w19;\n w35 = (n << 1) | (n >>> 31);\n t = (w35 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) + 0x6ed9eba1 )|0;\n e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n // 36\n n = w33 ^ w28 ^ w22 ^ w20;\n w36 = (n << 1) | (n >>> 31);\n t = (w36 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) + 0x6ed9eba1 )|0;\n e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n // 37\n n = w34 ^ w29 ^ w23 ^ w21;\n w37 = (n << 1) | (n >>> 31);\n t = (w37 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) + 0x6ed9eba1 )|0;\n e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n // 38\n n = w35 ^ w30 ^ w24 ^ w22;\n w38 = (n << 1) | (n >>> 31);\n t = (w38 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) + 0x6ed9eba1 )|0;\n e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n // 39\n n = w36 ^ w31 ^ w25 ^ w23;\n w39 = (n << 1) | (n >>> 31);\n t = (w39 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) + 0x6ed9eba1 )|0;\n e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n // 40\n n = w37 ^ w32 ^ w26 ^ w24;\n w40 = (n << 1) | (n >>> 31);\n t = (w40 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (b & d) | (c & d)) - 0x70e44324 )|0;\n e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n // 41\n n = w38 ^ w33 ^ w27 ^ w25;\n w41 = (n << 1) | (n >>> 31);\n t = (w41 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (b & d) | (c & d)) - 0x70e44324 )|0;\n e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n // 42\n n = w39 ^ w34 ^ w28 ^ w26;\n w42 = (n << 1) | (n >>> 31);\n t = (w42 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (b & d) | (c & d)) - 0x70e44324 )|0;\n e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n // 43\n n = w40 ^ w35 ^ w29 ^ w27;\n w43 = (n << 1) | (n >>> 31);\n t = (w43 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (b & d) | (c & d)) - 0x70e44324 )|0;\n e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n // 44\n n = w41 ^ w36 ^ w30 ^ w28;\n w44 = (n << 1) | (n >>> 31);\n t = (w44 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (b & d) | (c & d)) - 0x70e44324 )|0;\n e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n // 45\n n = w42 ^ w37 ^ w31 ^ w29;\n w45 = (n << 1) | (n >>> 31);\n t = (w45 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (b & d) | (c & d)) - 0x70e44324 )|0;\n e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n // 46\n n = w43 ^ w38 ^ w32 ^ w30;\n w46 = (n << 1) | (n >>> 31);\n t = (w46 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (b & d) | (c & d)) - 0x70e44324 )|0;\n e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n // 47\n n = w44 ^ w39 ^ w33 ^ w31;\n w47 = (n << 1) | (n >>> 31);\n t = (w47 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (b & d) | (c & d)) - 0x70e44324 )|0;\n e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n // 48\n n = w45 ^ w40 ^ w34 ^ w32;\n w48 = (n << 1) | (n >>> 31);\n t = (w48 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (b & d) | (c & d)) - 0x70e44324 )|0;\n e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n // 49\n n = w46 ^ w41 ^ w35 ^ w33;\n w49 = (n << 1) | (n >>> 31);\n t = (w49 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (b & d) | (c & d)) - 0x70e44324 )|0;\n e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n // 50\n n = w47 ^ w42 ^ w36 ^ w34;\n w50 = (n << 1) | (n >>> 31);\n t = (w50 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (b & d) | (c & d)) - 0x70e44324 )|0;\n e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n // 51\n n = w48 ^ w43 ^ w37 ^ w35;\n w51 = (n << 1) | (n >>> 31);\n t = (w51 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (b & d) | (c & d)) - 0x70e44324 )|0;\n e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n // 52\n n = w49 ^ w44 ^ w38 ^ w36;\n w52 = (n << 1) | (n >>> 31);\n t = (w52 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (b & d) | (c & d)) - 0x70e44324 )|0;\n e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n // 53\n n = w50 ^ w45 ^ w39 ^ w37;\n w53 = (n << 1) | (n >>> 31);\n t = (w53 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (b & d) | (c & d)) - 0x70e44324 )|0;\n e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n // 54\n n = w51 ^ w46 ^ w40 ^ w38;\n w54 = (n << 1) | (n >>> 31);\n t = (w54 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (b & d) | (c & d)) - 0x70e44324 )|0;\n e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n // 55\n n = w52 ^ w47 ^ w41 ^ w39;\n w55 = (n << 1) | (n >>> 31);\n t = (w55 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (b & d) | (c & d)) - 0x70e44324 )|0;\n e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n // 56\n n = w53 ^ w48 ^ w42 ^ w40;\n w56 = (n << 1) | (n >>> 31);\n t = (w56 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (b & d) | (c & d)) - 0x70e44324 )|0;\n e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n // 57\n n = w54 ^ w49 ^ w43 ^ w41;\n w57 = (n << 1) | (n >>> 31);\n t = (w57 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (b & d) | (c & d)) - 0x70e44324 )|0;\n e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n // 58\n n = w55 ^ w50 ^ w44 ^ w42;\n w58 = (n << 1) | (n >>> 31);\n t = (w58 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (b & d) | (c & d)) - 0x70e44324 )|0;\n e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n // 59\n n = w56 ^ w51 ^ w45 ^ w43;\n w59 = (n << 1) | (n >>> 31);\n t = (w59 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (b & d) | (c & d)) - 0x70e44324 )|0;\n e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n // 60\n n = w57 ^ w52 ^ w46 ^ w44;\n w60 = (n << 1) | (n >>> 31);\n t = (w60 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) - 0x359d3e2a )|0;\n e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n // 61\n n = w58 ^ w53 ^ w47 ^ w45;\n w61 = (n << 1) | (n >>> 31);\n t = (w61 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) - 0x359d3e2a )|0;\n e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n // 62\n n = w59 ^ w54 ^ w48 ^ w46;\n w62 = (n << 1) | (n >>> 31);\n t = (w62 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) - 0x359d3e2a )|0;\n e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n // 63\n n = w60 ^ w55 ^ w49 ^ w47;\n w63 = (n << 1) | (n >>> 31);\n t = (w63 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) - 0x359d3e2a )|0;\n e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n // 64\n n = w61 ^ w56 ^ w50 ^ w48;\n w64 = (n << 1) | (n >>> 31);\n t = (w64 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) - 0x359d3e2a )|0;\n e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n // 65\n n = w62 ^ w57 ^ w51 ^ w49;\n w65 = (n << 1) | (n >>> 31);\n t = (w65 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) - 0x359d3e2a )|0;\n e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n // 66\n n = w63 ^ w58 ^ w52 ^ w50;\n w66 = (n << 1) | (n >>> 31);\n t = (w66 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) - 0x359d3e2a )|0;\n e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n // 67\n n = w64 ^ w59 ^ w53 ^ w51;\n w67 = (n << 1) | (n >>> 31);\n t = (w67 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) - 0x359d3e2a )|0;\n e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n // 68\n n = w65 ^ w60 ^ w54 ^ w52;\n w68 = (n << 1) | (n >>> 31);\n t = (w68 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) - 0x359d3e2a )|0;\n e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n // 69\n n = w66 ^ w61 ^ w55 ^ w53;\n w69 = (n << 1) | (n >>> 31);\n t = (w69 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) - 0x359d3e2a )|0;\n e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n // 70\n n = w67 ^ w62 ^ w56 ^ w54;\n w70 = (n << 1) | (n >>> 31);\n t = (w70 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) - 0x359d3e2a )|0;\n e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n // 71\n n = w68 ^ w63 ^ w57 ^ w55;\n w71 = (n << 1) | (n >>> 31);\n t = (w71 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) - 0x359d3e2a )|0;\n e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n // 72\n n = w69 ^ w64 ^ w58 ^ w56;\n w72 = (n << 1) | (n >>> 31);\n t = (w72 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) - 0x359d3e2a )|0;\n e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n // 73\n n = w70 ^ w65 ^ w59 ^ w57;\n w73 = (n << 1) | (n >>> 31);\n t = (w73 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) - 0x359d3e2a )|0;\n e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n // 74\n n = w71 ^ w66 ^ w60 ^ w58;\n w74 = (n << 1) | (n >>> 31);\n t = (w74 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) - 0x359d3e2a )|0;\n e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n // 75\n n = w72 ^ w67 ^ w61 ^ w59;\n w75 = (n << 1) | (n >>> 31);\n t = (w75 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) - 0x359d3e2a )|0;\n e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n // 76\n n = w73 ^ w68 ^ w62 ^ w60;\n w76 = (n << 1) | (n >>> 31);\n t = (w76 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) - 0x359d3e2a )|0;\n e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n // 77\n n = w74 ^ w69 ^ w63 ^ w61;\n w77 = (n << 1) | (n >>> 31);\n t = (w77 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) - 0x359d3e2a )|0;\n e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n // 78\n n = w75 ^ w70 ^ w64 ^ w62;\n w78 = (n << 1) | (n >>> 31);\n t = (w78 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) - 0x359d3e2a )|0;\n e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n // 79\n n = w76 ^ w71 ^ w65 ^ w63;\n w79 = (n << 1) | (n >>> 31);\n t = (w79 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) - 0x359d3e2a )|0;\n e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n H0 = ( H0 + a )|0;\n H1 = ( H1 + b )|0;\n H2 = ( H2 + c )|0;\n H3 = ( H3 + d )|0;\n H4 = ( H4 + e )|0;\n\n }\n\n function _core_heap ( offset ) {\n offset = offset|0;\n\n _core(\n HEAP[offset|0]<<24 | HEAP[offset|1]<<16 | HEAP[offset|2]<<8 | HEAP[offset|3],\n HEAP[offset|4]<<24 | HEAP[offset|5]<<16 | HEAP[offset|6]<<8 | HEAP[offset|7],\n HEAP[offset|8]<<24 | HEAP[offset|9]<<16 | HEAP[offset|10]<<8 | HEAP[offset|11],\n HEAP[offset|12]<<24 | HEAP[offset|13]<<16 | HEAP[offset|14]<<8 | HEAP[offset|15],\n HEAP[offset|16]<<24 | HEAP[offset|17]<<16 | HEAP[offset|18]<<8 | HEAP[offset|19],\n HEAP[offset|20]<<24 | HEAP[offset|21]<<16 | HEAP[offset|22]<<8 | HEAP[offset|23],\n HEAP[offset|24]<<24 | HEAP[offset|25]<<16 | HEAP[offset|26]<<8 | HEAP[offset|27],\n HEAP[offset|28]<<24 | HEAP[offset|29]<<16 | HEAP[offset|30]<<8 | HEAP[offset|31],\n HEAP[offset|32]<<24 | HEAP[offset|33]<<16 | HEAP[offset|34]<<8 | HEAP[offset|35],\n HEAP[offset|36]<<24 | HEAP[offset|37]<<16 | HEAP[offset|38]<<8 | HEAP[offset|39],\n HEAP[offset|40]<<24 | HEAP[offset|41]<<16 | HEAP[offset|42]<<8 | HEAP[offset|43],\n HEAP[offset|44]<<24 | HEAP[offset|45]<<16 | HEAP[offset|46]<<8 | HEAP[offset|47],\n HEAP[offset|48]<<24 | HEAP[offset|49]<<16 | HEAP[offset|50]<<8 | HEAP[offset|51],\n HEAP[offset|52]<<24 | HEAP[offset|53]<<16 | HEAP[offset|54]<<8 | HEAP[offset|55],\n HEAP[offset|56]<<24 | HEAP[offset|57]<<16 | HEAP[offset|58]<<8 | HEAP[offset|59],\n HEAP[offset|60]<<24 | HEAP[offset|61]<<16 | HEAP[offset|62]<<8 | HEAP[offset|63]\n );\n }\n\n // offset — multiple of 32\n function _state_to_heap ( output ) {\n output = output|0;\n\n HEAP[output|0] = H0>>>24;\n HEAP[output|1] = H0>>>16&255;\n HEAP[output|2] = H0>>>8&255;\n HEAP[output|3] = H0&255;\n HEAP[output|4] = H1>>>24;\n HEAP[output|5] = H1>>>16&255;\n HEAP[output|6] = H1>>>8&255;\n HEAP[output|7] = H1&255;\n HEAP[output|8] = H2>>>24;\n HEAP[output|9] = H2>>>16&255;\n HEAP[output|10] = H2>>>8&255;\n HEAP[output|11] = H2&255;\n HEAP[output|12] = H3>>>24;\n HEAP[output|13] = H3>>>16&255;\n HEAP[output|14] = H3>>>8&255;\n HEAP[output|15] = H3&255;\n HEAP[output|16] = H4>>>24;\n HEAP[output|17] = H4>>>16&255;\n HEAP[output|18] = H4>>>8&255;\n HEAP[output|19] = H4&255;\n }\n\n function reset () {\n H0 = 0x67452301;\n H1 = 0xefcdab89;\n H2 = 0x98badcfe;\n H3 = 0x10325476;\n H4 = 0xc3d2e1f0;\n TOTAL0 = TOTAL1 = 0;\n }\n\n function init ( h0, h1, h2, h3, h4, total0, total1 ) {\n h0 = h0|0;\n h1 = h1|0;\n h2 = h2|0;\n h3 = h3|0;\n h4 = h4|0;\n total0 = total0|0;\n total1 = total1|0;\n\n H0 = h0;\n H1 = h1;\n H2 = h2;\n H3 = h3;\n H4 = h4;\n TOTAL0 = total0;\n TOTAL1 = total1;\n }\n\n // offset — multiple of 64\n function process ( offset, length ) {\n offset = offset|0;\n length = length|0;\n\n var hashed = 0;\n\n if ( offset & 63 )\n return -1;\n\n while ( (length|0) >= 64 ) {\n _core_heap(offset);\n\n offset = ( offset + 64 )|0;\n length = ( length - 64 )|0;\n\n hashed = ( hashed + 64 )|0;\n }\n\n TOTAL0 = ( TOTAL0 + hashed )|0;\n if ( TOTAL0>>>0 < hashed>>>0 ) TOTAL1 = ( TOTAL1 + 1 )|0;\n\n return hashed|0;\n }\n\n // offset — multiple of 64\n // output — multiple of 32\n function finish ( offset, length, output ) {\n offset = offset|0;\n length = length|0;\n output = output|0;\n\n var hashed = 0,\n i = 0;\n\n if ( offset & 63 )\n return -1;\n\n if ( ~output )\n if ( output & 31 )\n return -1;\n\n if ( (length|0) >= 64 ) {\n hashed = process( offset, length )|0;\n if ( (hashed|0) == -1 )\n return -1;\n\n offset = ( offset + hashed )|0;\n length = ( length - hashed )|0;\n }\n\n hashed = ( hashed + length )|0;\n TOTAL0 = ( TOTAL0 + length )|0;\n if ( TOTAL0>>>0 < length>>>0 ) TOTAL1 = (TOTAL1 + 1)|0;\n\n HEAP[offset|length] = 0x80;\n\n if ( (length|0) >= 56 ) {\n for ( i = (length+1)|0; (i|0) < 64; i = (i+1)|0 )\n HEAP[offset|i] = 0x00;\n _core_heap(offset);\n\n length = 0;\n\n HEAP[offset|0] = 0;\n }\n\n for ( i = (length+1)|0; (i|0) < 59; i = (i+1)|0 )\n HEAP[offset|i] = 0;\n\n HEAP[offset|56] = TOTAL1>>>21&255;\n HEAP[offset|57] = TOTAL1>>>13&255;\n HEAP[offset|58] = TOTAL1>>>5&255;\n HEAP[offset|59] = TOTAL1<<3&255 | TOTAL0>>>29;\n HEAP[offset|60] = TOTAL0>>>21&255;\n HEAP[offset|61] = TOTAL0>>>13&255;\n HEAP[offset|62] = TOTAL0>>>5&255;\n HEAP[offset|63] = TOTAL0<<3&255;\n _core_heap(offset);\n\n if ( ~output )\n _state_to_heap(output);\n\n return hashed|0;\n }\n\n function hmac_reset () {\n H0 = I0;\n H1 = I1;\n H2 = I2;\n H3 = I3;\n H4 = I4;\n TOTAL0 = 64;\n TOTAL1 = 0;\n }\n\n function _hmac_opad () {\n H0 = O0;\n H1 = O1;\n H2 = O2;\n H3 = O3;\n H4 = O4;\n TOTAL0 = 64;\n TOTAL1 = 0;\n }\n\n function hmac_init ( p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15 ) {\n p0 = p0|0;\n p1 = p1|0;\n p2 = p2|0;\n p3 = p3|0;\n p4 = p4|0;\n p5 = p5|0;\n p6 = p6|0;\n p7 = p7|0;\n p8 = p8|0;\n p9 = p9|0;\n p10 = p10|0;\n p11 = p11|0;\n p12 = p12|0;\n p13 = p13|0;\n p14 = p14|0;\n p15 = p15|0;\n\n // opad\n reset();\n _core(\n p0 ^ 0x5c5c5c5c,\n p1 ^ 0x5c5c5c5c,\n p2 ^ 0x5c5c5c5c,\n p3 ^ 0x5c5c5c5c,\n p4 ^ 0x5c5c5c5c,\n p5 ^ 0x5c5c5c5c,\n p6 ^ 0x5c5c5c5c,\n p7 ^ 0x5c5c5c5c,\n p8 ^ 0x5c5c5c5c,\n p9 ^ 0x5c5c5c5c,\n p10 ^ 0x5c5c5c5c,\n p11 ^ 0x5c5c5c5c,\n p12 ^ 0x5c5c5c5c,\n p13 ^ 0x5c5c5c5c,\n p14 ^ 0x5c5c5c5c,\n p15 ^ 0x5c5c5c5c\n );\n O0 = H0;\n O1 = H1;\n O2 = H2;\n O3 = H3;\n O4 = H4;\n\n // ipad\n reset();\n _core(\n p0 ^ 0x36363636,\n p1 ^ 0x36363636,\n p2 ^ 0x36363636,\n p3 ^ 0x36363636,\n p4 ^ 0x36363636,\n p5 ^ 0x36363636,\n p6 ^ 0x36363636,\n p7 ^ 0x36363636,\n p8 ^ 0x36363636,\n p9 ^ 0x36363636,\n p10 ^ 0x36363636,\n p11 ^ 0x36363636,\n p12 ^ 0x36363636,\n p13 ^ 0x36363636,\n p14 ^ 0x36363636,\n p15 ^ 0x36363636\n );\n I0 = H0;\n I1 = H1;\n I2 = H2;\n I3 = H3;\n I4 = H4;\n\n TOTAL0 = 64;\n TOTAL1 = 0;\n }\n\n // offset — multiple of 64\n // output — multiple of 32\n function hmac_finish ( offset, length, output ) {\n offset = offset|0;\n length = length|0;\n output = output|0;\n\n var t0 = 0, t1 = 0, t2 = 0, t3 = 0, t4 = 0, hashed = 0;\n\n if ( offset & 63 )\n return -1;\n\n if ( ~output )\n if ( output & 31 )\n return -1;\n\n hashed = finish( offset, length, -1 )|0;\n t0 = H0, t1 = H1, t2 = H2, t3 = H3, t4 = H4;\n\n _hmac_opad();\n _core( t0, t1, t2, t3, t4, 0x80000000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 672 );\n\n if ( ~output )\n _state_to_heap(output);\n\n return hashed|0;\n }\n\n // salt is assumed to be already processed\n // offset — multiple of 64\n // output — multiple of 32\n function pbkdf2_generate_block ( offset, length, block, count, output ) {\n offset = offset|0;\n length = length|0;\n block = block|0;\n count = count|0;\n output = output|0;\n\n var h0 = 0, h1 = 0, h2 = 0, h3 = 0, h4 = 0,\n t0 = 0, t1 = 0, t2 = 0, t3 = 0, t4 = 0;\n\n if ( offset & 63 )\n return -1;\n\n if ( ~output )\n if ( output & 31 )\n return -1;\n\n // pad block number into heap\n // FIXME probable OOB write\n HEAP[(offset+length)|0] = block>>>24;\n HEAP[(offset+length+1)|0] = block>>>16&255;\n HEAP[(offset+length+2)|0] = block>>>8&255;\n HEAP[(offset+length+3)|0] = block&255;\n\n // finish first iteration\n hmac_finish( offset, (length+4)|0, -1 )|0;\n h0 = t0 = H0, h1 = t1 = H1, h2 = t2 = H2, h3 = t3 = H3, h4 = t4 = H4;\n count = (count-1)|0;\n\n // perform the rest iterations\n while ( (count|0) > 0 ) {\n hmac_reset();\n _core( t0, t1, t2, t3, t4, 0x80000000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 672 );\n t0 = H0, t1 = H1, t2 = H2, t3 = H3, t4 = H4;\n\n _hmac_opad();\n _core( t0, t1, t2, t3, t4, 0x80000000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 672 );\n t0 = H0, t1 = H1, t2 = H2, t3 = H3, t4 = H4;\n\n h0 = h0 ^ H0;\n h1 = h1 ^ H1;\n h2 = h2 ^ H2;\n h3 = h3 ^ H3;\n h4 = h4 ^ H4;\n\n count = (count-1)|0;\n }\n\n H0 = h0;\n H1 = h1;\n H2 = h2;\n H3 = h3;\n H4 = h4;\n\n if ( ~output )\n _state_to_heap(output);\n\n return 0;\n }\n\n return {\n // SHA1\n reset: reset,\n init: init,\n process: process,\n finish: finish,\n\n // HMAC-SHA1\n hmac_reset: hmac_reset,\n hmac_init: hmac_init,\n hmac_finish: hmac_finish,\n\n // PBKDF2-HMAC-SHA1\n pbkdf2_generate_block: pbkdf2_generate_block\n }\n}\n","import { _heap_write } from '../other/utils';\nimport { IllegalStateError } from '../other/errors';\nexport class Hash {\n constructor() {\n this.pos = 0;\n this.len = 0;\n }\n reset() {\n const { asm } = this.acquire_asm();\n this.result = null;\n this.pos = 0;\n this.len = 0;\n asm.reset();\n return this;\n }\n process(data) {\n if (this.result !== null)\n throw new IllegalStateError('state must be reset before processing new data');\n const { asm, heap } = this.acquire_asm();\n let hpos = this.pos;\n let hlen = this.len;\n let dpos = 0;\n let dlen = data.length;\n let wlen = 0;\n while (dlen > 0) {\n wlen = _heap_write(heap, hpos + hlen, data, dpos, dlen);\n hlen += wlen;\n dpos += wlen;\n dlen -= wlen;\n wlen = asm.process(hpos, hlen);\n hpos += wlen;\n hlen -= wlen;\n if (!hlen)\n hpos = 0;\n }\n this.pos = hpos;\n this.len = hlen;\n return this;\n }\n finish() {\n if (this.result !== null)\n throw new IllegalStateError('state must be reset before processing new data');\n const { asm, heap } = this.acquire_asm();\n asm.finish(this.pos, this.len, 0);\n this.result = new Uint8Array(this.HASH_SIZE);\n this.result.set(heap.subarray(0, this.HASH_SIZE));\n this.pos = 0;\n this.len = 0;\n this.release_asm();\n return this;\n }\n}\n","import { sha1_asm } from './sha1.asm';\nimport { Hash } from '../hash';\nimport { _heap_init } from '../../other/utils';\nexport const _sha1_block_size = 64;\nexport const _sha1_hash_size = 20;\nconst heap_pool = [];\nconst asm_pool = [];\nexport class Sha1 extends Hash {\n constructor() {\n super();\n this.NAME = 'sha1';\n this.BLOCK_SIZE = _sha1_block_size;\n this.HASH_SIZE = _sha1_hash_size;\n this.acquire_asm();\n }\n acquire_asm() {\n if (this.heap === undefined || this.asm === undefined) {\n this.heap = heap_pool.pop() || _heap_init();\n this.asm = asm_pool.pop() || sha1_asm({ Uint8Array: Uint8Array }, null, this.heap.buffer);\n this.reset();\n }\n return { heap: this.heap, asm: this.asm };\n }\n release_asm() {\n if (this.heap !== undefined && this.asm !== undefined) {\n heap_pool.push(this.heap);\n asm_pool.push(this.asm);\n }\n this.heap = undefined;\n this.asm = undefined;\n }\n static bytes(data) {\n return new Sha1().process(data).finish().result;\n }\n}\nSha1.NAME = 'sha1';\nSha1.heap_pool = [];\nSha1.asm_pool = [];\nSha1.asm_function = sha1_asm;\n","import { sha256_asm } from './sha256.asm';\nimport { Hash } from '../hash';\nimport { _heap_init } from '../../other/utils';\nexport const _sha256_block_size = 64;\nexport const _sha256_hash_size = 32;\nconst heap_pool = [];\nconst asm_pool = [];\nexport class Sha256 extends Hash {\n constructor() {\n super();\n this.NAME = 'sha256';\n this.BLOCK_SIZE = _sha256_block_size;\n this.HASH_SIZE = _sha256_hash_size;\n this.acquire_asm();\n }\n acquire_asm() {\n if (this.heap === undefined || this.asm === undefined) {\n this.heap = heap_pool.pop() || _heap_init();\n this.asm = asm_pool.pop() || sha256_asm({ Uint8Array: Uint8Array }, null, this.heap.buffer);\n this.reset();\n }\n return { heap: this.heap, asm: this.asm };\n }\n release_asm() {\n if (this.heap !== undefined && this.asm !== undefined) {\n heap_pool.push(this.heap);\n asm_pool.push(this.asm);\n }\n this.heap = undefined;\n this.asm = undefined;\n }\n static bytes(data) {\n return new Sha256().process(data).finish().result;\n }\n}\nSha256.NAME = 'sha256';\n","export var sha256_asm = function ( stdlib, foreign, buffer ) {\n \"use asm\";\n\n // SHA256 state\n var H0 = 0, H1 = 0, H2 = 0, H3 = 0, H4 = 0, H5 = 0, H6 = 0, H7 = 0,\n TOTAL0 = 0, TOTAL1 = 0;\n\n // HMAC state\n var I0 = 0, I1 = 0, I2 = 0, I3 = 0, I4 = 0, I5 = 0, I6 = 0, I7 = 0,\n O0 = 0, O1 = 0, O2 = 0, O3 = 0, O4 = 0, O5 = 0, O6 = 0, O7 = 0;\n\n // I/O buffer\n var HEAP = new stdlib.Uint8Array(buffer);\n\n function _core ( w0, w1, w2, w3, w4, w5, w6, w7, w8, w9, w10, w11, w12, w13, w14, w15 ) {\n w0 = w0|0;\n w1 = w1|0;\n w2 = w2|0;\n w3 = w3|0;\n w4 = w4|0;\n w5 = w5|0;\n w6 = w6|0;\n w7 = w7|0;\n w8 = w8|0;\n w9 = w9|0;\n w10 = w10|0;\n w11 = w11|0;\n w12 = w12|0;\n w13 = w13|0;\n w14 = w14|0;\n w15 = w15|0;\n\n var a = 0, b = 0, c = 0, d = 0, e = 0, f = 0, g = 0, h = 0;\n\n a = H0;\n b = H1;\n c = H2;\n d = H3;\n e = H4;\n f = H5;\n g = H6;\n h = H7;\n \n // 0\n h = ( w0 + h + ( e>>>6 ^ e>>>11 ^ e>>>25 ^ e<<26 ^ e<<21 ^ e<<7 ) + ( g ^ e & (f^g) ) + 0x428a2f98 )|0;\n d = ( d + h )|0;\n h = ( h + ( (a & b) ^ ( c & (a ^ b) ) ) + ( a>>>2 ^ a>>>13 ^ a>>>22 ^ a<<30 ^ a<<19 ^ a<<10 ) )|0;\n\n // 1\n g = ( w1 + g + ( d>>>6 ^ d>>>11 ^ d>>>25 ^ d<<26 ^ d<<21 ^ d<<7 ) + ( f ^ d & (e^f) ) + 0x71374491 )|0;\n c = ( c + g )|0;\n g = ( g + ( (h & a) ^ ( b & (h ^ a) ) ) + ( h>>>2 ^ h>>>13 ^ h>>>22 ^ h<<30 ^ h<<19 ^ h<<10 ) )|0;\n\n // 2\n f = ( w2 + f + ( c>>>6 ^ c>>>11 ^ c>>>25 ^ c<<26 ^ c<<21 ^ c<<7 ) + ( e ^ c & (d^e) ) + 0xb5c0fbcf )|0;\n b = ( b + f )|0;\n f = ( f + ( (g & h) ^ ( a & (g ^ h) ) ) + ( g>>>2 ^ g>>>13 ^ g>>>22 ^ g<<30 ^ g<<19 ^ g<<10 ) )|0;\n\n // 3\n e = ( w3 + e + ( b>>>6 ^ b>>>11 ^ b>>>25 ^ b<<26 ^ b<<21 ^ b<<7 ) + ( d ^ b & (c^d) ) + 0xe9b5dba5 )|0;\n a = ( a + e )|0;\n e = ( e + ( (f & g) ^ ( h & (f ^ g) ) ) + ( f>>>2 ^ f>>>13 ^ f>>>22 ^ f<<30 ^ f<<19 ^ f<<10 ) )|0;\n\n // 4\n d = ( w4 + d + ( a>>>6 ^ a>>>11 ^ a>>>25 ^ a<<26 ^ a<<21 ^ a<<7 ) + ( c ^ a & (b^c) ) + 0x3956c25b )|0;\n h = ( h + d )|0;\n d = ( d + ( (e & f) ^ ( g & (e ^ f) ) ) + ( e>>>2 ^ e>>>13 ^ e>>>22 ^ e<<30 ^ e<<19 ^ e<<10 ) )|0;\n\n // 5\n c = ( w5 + c + ( h>>>6 ^ h>>>11 ^ h>>>25 ^ h<<26 ^ h<<21 ^ h<<7 ) + ( b ^ h & (a^b) ) + 0x59f111f1 )|0;\n g = ( g + c )|0;\n c = ( c + ( (d & e) ^ ( f & (d ^ e) ) ) + ( d>>>2 ^ d>>>13 ^ d>>>22 ^ d<<30 ^ d<<19 ^ d<<10 ) )|0;\n\n // 6\n b = ( w6 + b + ( g>>>6 ^ g>>>11 ^ g>>>25 ^ g<<26 ^ g<<21 ^ g<<7 ) + ( a ^ g & (h^a) ) + 0x923f82a4 )|0;\n f = ( f + b )|0;\n b = ( b + ( (c & d) ^ ( e & (c ^ d) ) ) + ( c>>>2 ^ c>>>13 ^ c>>>22 ^ c<<30 ^ c<<19 ^ c<<10 ) )|0;\n\n // 7\n a = ( w7 + a + ( f>>>6 ^ f>>>11 ^ f>>>25 ^ f<<26 ^ f<<21 ^ f<<7 ) + ( h ^ f & (g^h) ) + 0xab1c5ed5 )|0;\n e = ( e + a )|0;\n a = ( a + ( (b & c) ^ ( d & (b ^ c) ) ) + ( b>>>2 ^ b>>>13 ^ b>>>22 ^ b<<30 ^ b<<19 ^ b<<10 ) )|0;\n\n // 8\n h = ( w8 + h + ( e>>>6 ^ e>>>11 ^ e>>>25 ^ e<<26 ^ e<<21 ^ e<<7 ) + ( g ^ e & (f^g) ) + 0xd807aa98 )|0;\n d = ( d + h )|0;\n h = ( h + ( (a & b) ^ ( c & (a ^ b) ) ) + ( a>>>2 ^ a>>>13 ^ a>>>22 ^ a<<30 ^ a<<19 ^ a<<10 ) )|0;\n\n // 9\n g = ( w9 + g + ( d>>>6 ^ d>>>11 ^ d>>>25 ^ d<<26 ^ d<<21 ^ d<<7 ) + ( f ^ d & (e^f) ) + 0x12835b01 )|0;\n c = ( c + g )|0;\n g = ( g + ( (h & a) ^ ( b & (h ^ a) ) ) + ( h>>>2 ^ h>>>13 ^ h>>>22 ^ h<<30 ^ h<<19 ^ h<<10 ) )|0;\n\n // 10\n f = ( w10 + f + ( c>>>6 ^ c>>>11 ^ c>>>25 ^ c<<26 ^ c<<21 ^ c<<7 ) + ( e ^ c & (d^e) ) + 0x243185be )|0;\n b = ( b + f )|0;\n f = ( f + ( (g & h) ^ ( a & (g ^ h) ) ) + ( g>>>2 ^ g>>>13 ^ g>>>22 ^ g<<30 ^ g<<19 ^ g<<10 ) )|0;\n\n // 11\n e = ( w11 + e + ( b>>>6 ^ b>>>11 ^ b>>>25 ^ b<<26 ^ b<<21 ^ b<<7 ) + ( d ^ b & (c^d) ) + 0x550c7dc3 )|0;\n a = ( a + e )|0;\n e = ( e + ( (f & g) ^ ( h & (f ^ g) ) ) + ( f>>>2 ^ f>>>13 ^ f>>>22 ^ f<<30 ^ f<<19 ^ f<<10 ) )|0;\n\n // 12\n d = ( w12 + d + ( a>>>6 ^ a>>>11 ^ a>>>25 ^ a<<26 ^ a<<21 ^ a<<7 ) + ( c ^ a & (b^c) ) + 0x72be5d74 )|0;\n h = ( h + d )|0;\n d = ( d + ( (e & f) ^ ( g & (e ^ f) ) ) + ( e>>>2 ^ e>>>13 ^ e>>>22 ^ e<<30 ^ e<<19 ^ e<<10 ) )|0;\n\n // 13\n c = ( w13 + c + ( h>>>6 ^ h>>>11 ^ h>>>25 ^ h<<26 ^ h<<21 ^ h<<7 ) + ( b ^ h & (a^b) ) + 0x80deb1fe )|0;\n g = ( g + c )|0;\n c = ( c + ( (d & e) ^ ( f & (d ^ e) ) ) + ( d>>>2 ^ d>>>13 ^ d>>>22 ^ d<<30 ^ d<<19 ^ d<<10 ) )|0;\n\n // 14\n b = ( w14 + b + ( g>>>6 ^ g>>>11 ^ g>>>25 ^ g<<26 ^ g<<21 ^ g<<7 ) + ( a ^ g & (h^a) ) + 0x9bdc06a7 )|0;\n f = ( f + b )|0;\n b = ( b + ( (c & d) ^ ( e & (c ^ d) ) ) + ( c>>>2 ^ c>>>13 ^ c>>>22 ^ c<<30 ^ c<<19 ^ c<<10 ) )|0;\n\n // 15\n a = ( w15 + a + ( f>>>6 ^ f>>>11 ^ f>>>25 ^ f<<26 ^ f<<21 ^ f<<7 ) + ( h ^ f & (g^h) ) + 0xc19bf174 )|0;\n e = ( e + a )|0;\n a = ( a + ( (b & c) ^ ( d & (b ^ c) ) ) + ( b>>>2 ^ b>>>13 ^ b>>>22 ^ b<<30 ^ b<<19 ^ b<<10 ) )|0;\n\n // 16\n w0 = ( ( w1>>>7 ^ w1>>>18 ^ w1>>>3 ^ w1<<25 ^ w1<<14 ) + ( w14>>>17 ^ w14>>>19 ^ w14>>>10 ^ w14<<15 ^ w14<<13 ) + w0 + w9 )|0;\n h = ( w0 + h + ( e>>>6 ^ e>>>11 ^ e>>>25 ^ e<<26 ^ e<<21 ^ e<<7 ) + ( g ^ e & (f^g) ) + 0xe49b69c1 )|0;\n d = ( d + h )|0;\n h = ( h + ( (a & b) ^ ( c & (a ^ b) ) ) + ( a>>>2 ^ a>>>13 ^ a>>>22 ^ a<<30 ^ a<<19 ^ a<<10 ) )|0;\n\n // 17\n w1 = ( ( w2>>>7 ^ w2>>>18 ^ w2>>>3 ^ w2<<25 ^ w2<<14 ) + ( w15>>>17 ^ w15>>>19 ^ w15>>>10 ^ w15<<15 ^ w15<<13 ) + w1 + w10 )|0;\n g = ( w1 + g + ( d>>>6 ^ d>>>11 ^ d>>>25 ^ d<<26 ^ d<<21 ^ d<<7 ) + ( f ^ d & (e^f) ) + 0xefbe4786 )|0;\n c = ( c + g )|0;\n g = ( g + ( (h & a) ^ ( b & (h ^ a) ) ) + ( h>>>2 ^ h>>>13 ^ h>>>22 ^ h<<30 ^ h<<19 ^ h<<10 ) )|0;\n\n // 18\n w2 = ( ( w3>>>7 ^ w3>>>18 ^ w3>>>3 ^ w3<<25 ^ w3<<14 ) + ( w0>>>17 ^ w0>>>19 ^ w0>>>10 ^ w0<<15 ^ w0<<13 ) + w2 + w11 )|0;\n f = ( w2 + f + ( c>>>6 ^ c>>>11 ^ c>>>25 ^ c<<26 ^ c<<21 ^ c<<7 ) + ( e ^ c & (d^e) ) + 0x0fc19dc6 )|0;\n b = ( b + f )|0;\n f = ( f + ( (g & h) ^ ( a & (g ^ h) ) ) + ( g>>>2 ^ g>>>13 ^ g>>>22 ^ g<<30 ^ g<<19 ^ g<<10 ) )|0;\n\n // 19\n w3 = ( ( w4>>>7 ^ w4>>>18 ^ w4>>>3 ^ w4<<25 ^ w4<<14 ) + ( w1>>>17 ^ w1>>>19 ^ w1>>>10 ^ w1<<15 ^ w1<<13 ) + w3 + w12 )|0;\n e = ( w3 + e + ( b>>>6 ^ b>>>11 ^ b>>>25 ^ b<<26 ^ b<<21 ^ b<<7 ) + ( d ^ b & (c^d) ) + 0x240ca1cc )|0;\n a = ( a + e )|0;\n e = ( e + ( (f & g) ^ ( h & (f ^ g) ) ) + ( f>>>2 ^ f>>>13 ^ f>>>22 ^ f<<30 ^ f<<19 ^ f<<10 ) )|0;\n\n // 20\n w4 = ( ( w5>>>7 ^ w5>>>18 ^ w5>>>3 ^ w5<<25 ^ w5<<14 ) + ( w2>>>17 ^ w2>>>19 ^ w2>>>10 ^ w2<<15 ^ w2<<13 ) + w4 + w13 )|0;\n d = ( w4 + d + ( a>>>6 ^ a>>>11 ^ a>>>25 ^ a<<26 ^ a<<21 ^ a<<7 ) + ( c ^ a & (b^c) ) + 0x2de92c6f )|0;\n h = ( h + d )|0;\n d = ( d + ( (e & f) ^ ( g & (e ^ f) ) ) + ( e>>>2 ^ e>>>13 ^ e>>>22 ^ e<<30 ^ e<<19 ^ e<<10 ) )|0;\n\n // 21\n w5 = ( ( w6>>>7 ^ w6>>>18 ^ w6>>>3 ^ w6<<25 ^ w6<<14 ) + ( w3>>>17 ^ w3>>>19 ^ w3>>>10 ^ w3<<15 ^ w3<<13 ) + w5 + w14 )|0;\n c = ( w5 + c + ( h>>>6 ^ h>>>11 ^ h>>>25 ^ h<<26 ^ h<<21 ^ h<<7 ) + ( b ^ h & (a^b) ) + 0x4a7484aa )|0;\n g = ( g + c )|0;\n c = ( c + ( (d & e) ^ ( f & (d ^ e) ) ) + ( d>>>2 ^ d>>>13 ^ d>>>22 ^ d<<30 ^ d<<19 ^ d<<10 ) )|0;\n\n // 22\n w6 = ( ( w7>>>7 ^ w7>>>18 ^ w7>>>3 ^ w7<<25 ^ w7<<14 ) + ( w4>>>17 ^ w4>>>19 ^ w4>>>10 ^ w4<<15 ^ w4<<13 ) + w6 + w15 )|0;\n b = ( w6 + b + ( g>>>6 ^ g>>>11 ^ g>>>25 ^ g<<26 ^ g<<21 ^ g<<7 ) + ( a ^ g & (h^a) ) + 0x5cb0a9dc )|0;\n f = ( f + b )|0;\n b = ( b + ( (c & d) ^ ( e & (c ^ d) ) ) + ( c>>>2 ^ c>>>13 ^ c>>>22 ^ c<<30 ^ c<<19 ^ c<<10 ) )|0;\n\n // 23\n w7 = ( ( w8>>>7 ^ w8>>>18 ^ w8>>>3 ^ w8<<25 ^ w8<<14 ) + ( w5>>>17 ^ w5>>>19 ^ w5>>>10 ^ w5<<15 ^ w5<<13 ) + w7 + w0 )|0;\n a = ( w7 + a + ( f>>>6 ^ f>>>11 ^ f>>>25 ^ f<<26 ^ f<<21 ^ f<<7 ) + ( h ^ f & (g^h) ) + 0x76f988da )|0;\n e = ( e + a )|0;\n a = ( a + ( (b & c) ^ ( d & (b ^ c) ) ) + ( b>>>2 ^ b>>>13 ^ b>>>22 ^ b<<30 ^ b<<19 ^ b<<10 ) )|0;\n\n // 24\n w8 = ( ( w9>>>7 ^ w9>>>18 ^ w9>>>3 ^ w9<<25 ^ w9<<14 ) + ( w6>>>17 ^ w6>>>19 ^ w6>>>10 ^ w6<<15 ^ w6<<13 ) + w8 + w1 )|0;\n h = ( w8 + h + ( e>>>6 ^ e>>>11 ^ e>>>25 ^ e<<26 ^ e<<21 ^ e<<7 ) + ( g ^ e & (f^g) ) + 0x983e5152 )|0;\n d = ( d + h )|0;\n h = ( h + ( (a & b) ^ ( c & (a ^ b) ) ) + ( a>>>2 ^ a>>>13 ^ a>>>22 ^ a<<30 ^ a<<19 ^ a<<10 ) )|0;\n\n // 25\n w9 = ( ( w10>>>7 ^ w10>>>18 ^ w10>>>3 ^ w10<<25 ^ w10<<14 ) + ( w7>>>17 ^ w7>>>19 ^ w7>>>10 ^ w7<<15 ^ w7<<13 ) + w9 + w2 )|0;\n g = ( w9 + g + ( d>>>6 ^ d>>>11 ^ d>>>25 ^ d<<26 ^ d<<21 ^ d<<7 ) + ( f ^ d & (e^f) ) + 0xa831c66d )|0;\n c = ( c + g )|0;\n g = ( g + ( (h & a) ^ ( b & (h ^ a) ) ) + ( h>>>2 ^ h>>>13 ^ h>>>22 ^ h<<30 ^ h<<19 ^ h<<10 ) )|0;\n\n // 26\n w10 = ( ( w11>>>7 ^ w11>>>18 ^ w11>>>3 ^ w11<<25 ^ w11<<14 ) + ( w8>>>17 ^ w8>>>19 ^ w8>>>10 ^ w8<<15 ^ w8<<13 ) + w10 + w3 )|0;\n f = ( w10 + f + ( c>>>6 ^ c>>>11 ^ c>>>25 ^ c<<26 ^ c<<21 ^ c<<7 ) + ( e ^ c & (d^e) ) + 0xb00327c8 )|0;\n b = ( b + f )|0;\n f = ( f + ( (g & h) ^ ( a & (g ^ h) ) ) + ( g>>>2 ^ g>>>13 ^ g>>>22 ^ g<<30 ^ g<<19 ^ g<<10 ) )|0;\n\n // 27\n w11 = ( ( w12>>>7 ^ w12>>>18 ^ w12>>>3 ^ w12<<25 ^ w12<<14 ) + ( w9>>>17 ^ w9>>>19 ^ w9>>>10 ^ w9<<15 ^ w9<<13 ) + w11 + w4 )|0;\n e = ( w11 + e + ( b>>>6 ^ b>>>11 ^ b>>>25 ^ b<<26 ^ b<<21 ^ b<<7 ) + ( d ^ b & (c^d) ) + 0xbf597fc7 )|0;\n a = ( a + e )|0;\n e = ( e + ( (f & g) ^ ( h & (f ^ g) ) ) + ( f>>>2 ^ f>>>13 ^ f>>>22 ^ f<<30 ^ f<<19 ^ f<<10 ) )|0;\n\n // 28\n w12 = ( ( w13>>>7 ^ w13>>>18 ^ w13>>>3 ^ w13<<25 ^ w13<<14 ) + ( w10>>>17 ^ w10>>>19 ^ w10>>>10 ^ w10<<15 ^ w10<<13 ) + w12 + w5 )|0;\n d = ( w12 + d + ( a>>>6 ^ a>>>11 ^ a>>>25 ^ a<<26 ^ a<<21 ^ a<<7 ) + ( c ^ a & (b^c) ) + 0xc6e00bf3 )|0;\n h = ( h + d )|0;\n d = ( d + ( (e & f) ^ ( g & (e ^ f) ) ) + ( e>>>2 ^ e>>>13 ^ e>>>22 ^ e<<30 ^ e<<19 ^ e<<10 ) )|0;\n\n // 29\n w13 = ( ( w14>>>7 ^ w14>>>18 ^ w14>>>3 ^ w14<<25 ^ w14<<14 ) + ( w11>>>17 ^ w11>>>19 ^ w11>>>10 ^ w11<<15 ^ w11<<13 ) + w13 + w6 )|0;\n c = ( w13 + c + ( h>>>6 ^ h>>>11 ^ h>>>25 ^ h<<26 ^ h<<21 ^ h<<7 ) + ( b ^ h & (a^b) ) + 0xd5a79147 )|0;\n g = ( g + c )|0;\n c = ( c + ( (d & e) ^ ( f & (d ^ e) ) ) + ( d>>>2 ^ d>>>13 ^ d>>>22 ^ d<<30 ^ d<<19 ^ d<<10 ) )|0;\n\n // 30\n w14 = ( ( w15>>>7 ^ w15>>>18 ^ w15>>>3 ^ w15<<25 ^ w15<<14 ) + ( w12>>>17 ^ w12>>>19 ^ w12>>>10 ^ w12<<15 ^ w12<<13 ) + w14 + w7 )|0;\n b = ( w14 + b + ( g>>>6 ^ g>>>11 ^ g>>>25 ^ g<<26 ^ g<<21 ^ g<<7 ) + ( a ^ g & (h^a) ) + 0x06ca6351 )|0;\n f = ( f + b )|0;\n b = ( b + ( (c & d) ^ ( e & (c ^ d) ) ) + ( c>>>2 ^ c>>>13 ^ c>>>22 ^ c<<30 ^ c<<19 ^ c<<10 ) )|0;\n\n // 31\n w15 = ( ( w0>>>7 ^ w0>>>18 ^ w0>>>3 ^ w0<<25 ^ w0<<14 ) + ( w13>>>17 ^ w13>>>19 ^ w13>>>10 ^ w13<<15 ^ w13<<13 ) + w15 + w8 )|0;\n a = ( w15 + a + ( f>>>6 ^ f>>>11 ^ f>>>25 ^ f<<26 ^ f<<21 ^ f<<7 ) + ( h ^ f & (g^h) ) + 0x14292967 )|0;\n e = ( e + a )|0;\n a = ( a + ( (b & c) ^ ( d & (b ^ c) ) ) + ( b>>>2 ^ b>>>13 ^ b>>>22 ^ b<<30 ^ b<<19 ^ b<<10 ) )|0;\n\n // 32\n w0 = ( ( w1>>>7 ^ w1>>>18 ^ w1>>>3 ^ w1<<25 ^ w1<<14 ) + ( w14>>>17 ^ w14>>>19 ^ w14>>>10 ^ w14<<15 ^ w14<<13 ) + w0 + w9 )|0;\n h = ( w0 + h + ( e>>>6 ^ e>>>11 ^ e>>>25 ^ e<<26 ^ e<<21 ^ e<<7 ) + ( g ^ e & (f^g) ) + 0x27b70a85 )|0;\n d = ( d + h )|0;\n h = ( h + ( (a & b) ^ ( c & (a ^ b) ) ) + ( a>>>2 ^ a>>>13 ^ a>>>22 ^ a<<30 ^ a<<19 ^ a<<10 ) )|0;\n\n // 33\n w1 = ( ( w2>>>7 ^ w2>>>18 ^ w2>>>3 ^ w2<<25 ^ w2<<14 ) + ( w15>>>17 ^ w15>>>19 ^ w15>>>10 ^ w15<<15 ^ w15<<13 ) + w1 + w10 )|0;\n g = ( w1 + g + ( d>>>6 ^ d>>>11 ^ d>>>25 ^ d<<26 ^ d<<21 ^ d<<7 ) + ( f ^ d & (e^f) ) + 0x2e1b2138 )|0;\n c = ( c + g )|0;\n g = ( g + ( (h & a) ^ ( b & (h ^ a) ) ) + ( h>>>2 ^ h>>>13 ^ h>>>22 ^ h<<30 ^ h<<19 ^ h<<10 ) )|0;\n\n // 34\n w2 = ( ( w3>>>7 ^ w3>>>18 ^ w3>>>3 ^ w3<<25 ^ w3<<14 ) + ( w0>>>17 ^ w0>>>19 ^ w0>>>10 ^ w0<<15 ^ w0<<13 ) + w2 + w11 )|0;\n f = ( w2 + f + ( c>>>6 ^ c>>>11 ^ c>>>25 ^ c<<26 ^ c<<21 ^ c<<7 ) + ( e ^ c & (d^e) ) + 0x4d2c6dfc )|0;\n b = ( b + f )|0;\n f = ( f + ( (g & h) ^ ( a & (g ^ h) ) ) + ( g>>>2 ^ g>>>13 ^ g>>>22 ^ g<<30 ^ g<<19 ^ g<<10 ) )|0;\n\n // 35\n w3 = ( ( w4>>>7 ^ w4>>>18 ^ w4>>>3 ^ w4<<25 ^ w4<<14 ) + ( w1>>>17 ^ w1>>>19 ^ w1>>>10 ^ w1<<15 ^ w1<<13 ) + w3 + w12 )|0;\n e = ( w3 + e + ( b>>>6 ^ b>>>11 ^ b>>>25 ^ b<<26 ^ b<<21 ^ b<<7 ) + ( d ^ b & (c^d) ) + 0x53380d13 )|0;\n a = ( a + e )|0;\n e = ( e + ( (f & g) ^ ( h & (f ^ g) ) ) + ( f>>>2 ^ f>>>13 ^ f>>>22 ^ f<<30 ^ f<<19 ^ f<<10 ) )|0;\n\n // 36\n w4 = ( ( w5>>>7 ^ w5>>>18 ^ w5>>>3 ^ w5<<25 ^ w5<<14 ) + ( w2>>>17 ^ w2>>>19 ^ w2>>>10 ^ w2<<15 ^ w2<<13 ) + w4 + w13 )|0;\n d = ( w4 + d + ( a>>>6 ^ a>>>11 ^ a>>>25 ^ a<<26 ^ a<<21 ^ a<<7 ) + ( c ^ a & (b^c) ) + 0x650a7354 )|0;\n h = ( h + d )|0;\n d = ( d + ( (e & f) ^ ( g & (e ^ f) ) ) + ( e>>>2 ^ e>>>13 ^ e>>>22 ^ e<<30 ^ e<<19 ^ e<<10 ) )|0;\n\n // 37\n w5 = ( ( w6>>>7 ^ w6>>>18 ^ w6>>>3 ^ w6<<25 ^ w6<<14 ) + ( w3>>>17 ^ w3>>>19 ^ w3>>>10 ^ w3<<15 ^ w3<<13 ) + w5 + w14 )|0;\n c = ( w5 + c + ( h>>>6 ^ h>>>11 ^ h>>>25 ^ h<<26 ^ h<<21 ^ h<<7 ) + ( b ^ h & (a^b) ) + 0x766a0abb )|0;\n g = ( g + c )|0;\n c = ( c + ( (d & e) ^ ( f & (d ^ e) ) ) + ( d>>>2 ^ d>>>13 ^ d>>>22 ^ d<<30 ^ d<<19 ^ d<<10 ) )|0;\n\n // 38\n w6 = ( ( w7>>>7 ^ w7>>>18 ^ w7>>>3 ^ w7<<25 ^ w7<<14 ) + ( w4>>>17 ^ w4>>>19 ^ w4>>>10 ^ w4<<15 ^ w4<<13 ) + w6 + w15 )|0;\n b = ( w6 + b + ( g>>>6 ^ g>>>11 ^ g>>>25 ^ g<<26 ^ g<<21 ^ g<<7 ) + ( a ^ g & (h^a) ) + 0x81c2c92e )|0;\n f = ( f + b )|0;\n b = ( b + ( (c & d) ^ ( e & (c ^ d) ) ) + ( c>>>2 ^ c>>>13 ^ c>>>22 ^ c<<30 ^ c<<19 ^ c<<10 ) )|0;\n\n // 39\n w7 = ( ( w8>>>7 ^ w8>>>18 ^ w8>>>3 ^ w8<<25 ^ w8<<14 ) + ( w5>>>17 ^ w5>>>19 ^ w5>>>10 ^ w5<<15 ^ w5<<13 ) + w7 + w0 )|0;\n a = ( w7 + a + ( f>>>6 ^ f>>>11 ^ f>>>25 ^ f<<26 ^ f<<21 ^ f<<7 ) + ( h ^ f & (g^h) ) + 0x92722c85 )|0;\n e = ( e + a )|0;\n a = ( a + ( (b & c) ^ ( d & (b ^ c) ) ) + ( b>>>2 ^ b>>>13 ^ b>>>22 ^ b<<30 ^ b<<19 ^ b<<10 ) )|0;\n\n // 40\n w8 = ( ( w9>>>7 ^ w9>>>18 ^ w9>>>3 ^ w9<<25 ^ w9<<14 ) + ( w6>>>17 ^ w6>>>19 ^ w6>>>10 ^ w6<<15 ^ w6<<13 ) + w8 + w1 )|0;\n h = ( w8 + h + ( e>>>6 ^ e>>>11 ^ e>>>25 ^ e<<26 ^ e<<21 ^ e<<7 ) + ( g ^ e & (f^g) ) + 0xa2bfe8a1 )|0;\n d = ( d + h )|0;\n h = ( h + ( (a & b) ^ ( c & (a ^ b) ) ) + ( a>>>2 ^ a>>>13 ^ a>>>22 ^ a<<30 ^ a<<19 ^ a<<10 ) )|0;\n\n // 41\n w9 = ( ( w10>>>7 ^ w10>>>18 ^ w10>>>3 ^ w10<<25 ^ w10<<14 ) + ( w7>>>17 ^ w7>>>19 ^ w7>>>10 ^ w7<<15 ^ w7<<13 ) + w9 + w2 )|0;\n g = ( w9 + g + ( d>>>6 ^ d>>>11 ^ d>>>25 ^ d<<26 ^ d<<21 ^ d<<7 ) + ( f ^ d & (e^f) ) + 0xa81a664b )|0;\n c = ( c + g )|0;\n g = ( g + ( (h & a) ^ ( b & (h ^ a) ) ) + ( h>>>2 ^ h>>>13 ^ h>>>22 ^ h<<30 ^ h<<19 ^ h<<10 ) )|0;\n\n // 42\n w10 = ( ( w11>>>7 ^ w11>>>18 ^ w11>>>3 ^ w11<<25 ^ w11<<14 ) + ( w8>>>17 ^ w8>>>19 ^ w8>>>10 ^ w8<<15 ^ w8<<13 ) + w10 + w3 )|0;\n f = ( w10 + f + ( c>>>6 ^ c>>>11 ^ c>>>25 ^ c<<26 ^ c<<21 ^ c<<7 ) + ( e ^ c & (d^e) ) + 0xc24b8b70 )|0;\n b = ( b + f )|0;\n f = ( f + ( (g & h) ^ ( a & (g ^ h) ) ) + ( g>>>2 ^ g>>>13 ^ g>>>22 ^ g<<30 ^ g<<19 ^ g<<10 ) )|0;\n\n // 43\n w11 = ( ( w12>>>7 ^ w12>>>18 ^ w12>>>3 ^ w12<<25 ^ w12<<14 ) + ( w9>>>17 ^ w9>>>19 ^ w9>>>10 ^ w9<<15 ^ w9<<13 ) + w11 + w4 )|0;\n e = ( w11 + e + ( b>>>6 ^ b>>>11 ^ b>>>25 ^ b<<26 ^ b<<21 ^ b<<7 ) + ( d ^ b & (c^d) ) + 0xc76c51a3 )|0;\n a = ( a + e )|0;\n e = ( e + ( (f & g) ^ ( h & (f ^ g) ) ) + ( f>>>2 ^ f>>>13 ^ f>>>22 ^ f<<30 ^ f<<19 ^ f<<10 ) )|0;\n\n // 44\n w12 = ( ( w13>>>7 ^ w13>>>18 ^ w13>>>3 ^ w13<<25 ^ w13<<14 ) + ( w10>>>17 ^ w10>>>19 ^ w10>>>10 ^ w10<<15 ^ w10<<13 ) + w12 + w5 )|0;\n d = ( w12 + d + ( a>>>6 ^ a>>>11 ^ a>>>25 ^ a<<26 ^ a<<21 ^ a<<7 ) + ( c ^ a & (b^c) ) + 0xd192e819 )|0;\n h = ( h + d )|0;\n d = ( d + ( (e & f) ^ ( g & (e ^ f) ) ) + ( e>>>2 ^ e>>>13 ^ e>>>22 ^ e<<30 ^ e<<19 ^ e<<10 ) )|0;\n\n // 45\n w13 = ( ( w14>>>7 ^ w14>>>18 ^ w14>>>3 ^ w14<<25 ^ w14<<14 ) + ( w11>>>17 ^ w11>>>19 ^ w11>>>10 ^ w11<<15 ^ w11<<13 ) + w13 + w6 )|0;\n c = ( w13 + c + ( h>>>6 ^ h>>>11 ^ h>>>25 ^ h<<26 ^ h<<21 ^ h<<7 ) + ( b ^ h & (a^b) ) + 0xd6990624 )|0;\n g = ( g + c )|0;\n c = ( c + ( (d & e) ^ ( f & (d ^ e) ) ) + ( d>>>2 ^ d>>>13 ^ d>>>22 ^ d<<30 ^ d<<19 ^ d<<10 ) )|0;\n\n // 46\n w14 = ( ( w15>>>7 ^ w15>>>18 ^ w15>>>3 ^ w15<<25 ^ w15<<14 ) + ( w12>>>17 ^ w12>>>19 ^ w12>>>10 ^ w12<<15 ^ w12<<13 ) + w14 + w7 )|0;\n b = ( w14 + b + ( g>>>6 ^ g>>>11 ^ g>>>25 ^ g<<26 ^ g<<21 ^ g<<7 ) + ( a ^ g & (h^a) ) + 0xf40e3585 )|0;\n f = ( f + b )|0;\n b = ( b + ( (c & d) ^ ( e & (c ^ d) ) ) + ( c>>>2 ^ c>>>13 ^ c>>>22 ^ c<<30 ^ c<<19 ^ c<<10 ) )|0;\n\n // 47\n w15 = ( ( w0>>>7 ^ w0>>>18 ^ w0>>>3 ^ w0<<25 ^ w0<<14 ) + ( w13>>>17 ^ w13>>>19 ^ w13>>>10 ^ w13<<15 ^ w13<<13 ) + w15 + w8 )|0;\n a = ( w15 + a + ( f>>>6 ^ f>>>11 ^ f>>>25 ^ f<<26 ^ f<<21 ^ f<<7 ) + ( h ^ f & (g^h) ) + 0x106aa070 )|0;\n e = ( e + a )|0;\n a = ( a + ( (b & c) ^ ( d & (b ^ c) ) ) + ( b>>>2 ^ b>>>13 ^ b>>>22 ^ b<<30 ^ b<<19 ^ b<<10 ) )|0;\n\n // 48\n w0 = ( ( w1>>>7 ^ w1>>>18 ^ w1>>>3 ^ w1<<25 ^ w1<<14 ) + ( w14>>>17 ^ w14>>>19 ^ w14>>>10 ^ w14<<15 ^ w14<<13 ) + w0 + w9 )|0;\n h = ( w0 + h + ( e>>>6 ^ e>>>11 ^ e>>>25 ^ e<<26 ^ e<<21 ^ e<<7 ) + ( g ^ e & (f^g) ) + 0x19a4c116 )|0;\n d = ( d + h )|0;\n h = ( h + ( (a & b) ^ ( c & (a ^ b) ) ) + ( a>>>2 ^ a>>>13 ^ a>>>22 ^ a<<30 ^ a<<19 ^ a<<10 ) )|0;\n\n // 49\n w1 = ( ( w2>>>7 ^ w2>>>18 ^ w2>>>3 ^ w2<<25 ^ w2<<14 ) + ( w15>>>17 ^ w15>>>19 ^ w15>>>10 ^ w15<<15 ^ w15<<13 ) + w1 + w10 )|0;\n g = ( w1 + g + ( d>>>6 ^ d>>>11 ^ d>>>25 ^ d<<26 ^ d<<21 ^ d<<7 ) + ( f ^ d & (e^f) ) + 0x1e376c08 )|0;\n c = ( c + g )|0;\n g = ( g + ( (h & a) ^ ( b & (h ^ a) ) ) + ( h>>>2 ^ h>>>13 ^ h>>>22 ^ h<<30 ^ h<<19 ^ h<<10 ) )|0;\n\n // 50\n w2 = ( ( w3>>>7 ^ w3>>>18 ^ w3>>>3 ^ w3<<25 ^ w3<<14 ) + ( w0>>>17 ^ w0>>>19 ^ w0>>>10 ^ w0<<15 ^ w0<<13 ) + w2 + w11 )|0;\n f = ( w2 + f + ( c>>>6 ^ c>>>11 ^ c>>>25 ^ c<<26 ^ c<<21 ^ c<<7 ) + ( e ^ c & (d^e) ) + 0x2748774c )|0;\n b = ( b + f )|0;\n f = ( f + ( (g & h) ^ ( a & (g ^ h) ) ) + ( g>>>2 ^ g>>>13 ^ g>>>22 ^ g<<30 ^ g<<19 ^ g<<10 ) )|0;\n\n // 51\n w3 = ( ( w4>>>7 ^ w4>>>18 ^ w4>>>3 ^ w4<<25 ^ w4<<14 ) + ( w1>>>17 ^ w1>>>19 ^ w1>>>10 ^ w1<<15 ^ w1<<13 ) + w3 + w12 )|0;\n e = ( w3 + e + ( b>>>6 ^ b>>>11 ^ b>>>25 ^ b<<26 ^ b<<21 ^ b<<7 ) + ( d ^ b & (c^d) ) + 0x34b0bcb5 )|0;\n a = ( a + e )|0;\n e = ( e + ( (f & g) ^ ( h & (f ^ g) ) ) + ( f>>>2 ^ f>>>13 ^ f>>>22 ^ f<<30 ^ f<<19 ^ f<<10 ) )|0;\n\n // 52\n w4 = ( ( w5>>>7 ^ w5>>>18 ^ w5>>>3 ^ w5<<25 ^ w5<<14 ) + ( w2>>>17 ^ w2>>>19 ^ w2>>>10 ^ w2<<15 ^ w2<<13 ) + w4 + w13 )|0;\n d = ( w4 + d + ( a>>>6 ^ a>>>11 ^ a>>>25 ^ a<<26 ^ a<<21 ^ a<<7 ) + ( c ^ a & (b^c) ) + 0x391c0cb3 )|0;\n h = ( h + d )|0;\n d = ( d + ( (e & f) ^ ( g & (e ^ f) ) ) + ( e>>>2 ^ e>>>13 ^ e>>>22 ^ e<<30 ^ e<<19 ^ e<<10 ) )|0;\n\n // 53\n w5 = ( ( w6>>>7 ^ w6>>>18 ^ w6>>>3 ^ w6<<25 ^ w6<<14 ) + ( w3>>>17 ^ w3>>>19 ^ w3>>>10 ^ w3<<15 ^ w3<<13 ) + w5 + w14 )|0;\n c = ( w5 + c + ( h>>>6 ^ h>>>11 ^ h>>>25 ^ h<<26 ^ h<<21 ^ h<<7 ) + ( b ^ h & (a^b) ) + 0x4ed8aa4a )|0;\n g = ( g + c )|0;\n c = ( c + ( (d & e) ^ ( f & (d ^ e) ) ) + ( d>>>2 ^ d>>>13 ^ d>>>22 ^ d<<30 ^ d<<19 ^ d<<10 ) )|0;\n\n // 54\n w6 = ( ( w7>>>7 ^ w7>>>18 ^ w7>>>3 ^ w7<<25 ^ w7<<14 ) + ( w4>>>17 ^ w4>>>19 ^ w4>>>10 ^ w4<<15 ^ w4<<13 ) + w6 + w15 )|0;\n b = ( w6 + b + ( g>>>6 ^ g>>>11 ^ g>>>25 ^ g<<26 ^ g<<21 ^ g<<7 ) + ( a ^ g & (h^a) ) + 0x5b9cca4f )|0;\n f = ( f + b )|0;\n b = ( b + ( (c & d) ^ ( e & (c ^ d) ) ) + ( c>>>2 ^ c>>>13 ^ c>>>22 ^ c<<30 ^ c<<19 ^ c<<10 ) )|0;\n\n // 55\n w7 = ( ( w8>>>7 ^ w8>>>18 ^ w8>>>3 ^ w8<<25 ^ w8<<14 ) + ( w5>>>17 ^ w5>>>19 ^ w5>>>10 ^ w5<<15 ^ w5<<13 ) + w7 + w0 )|0;\n a = ( w7 + a + ( f>>>6 ^ f>>>11 ^ f>>>25 ^ f<<26 ^ f<<21 ^ f<<7 ) + ( h ^ f & (g^h) ) + 0x682e6ff3 )|0;\n e = ( e + a )|0;\n a = ( a + ( (b & c) ^ ( d & (b ^ c) ) ) + ( b>>>2 ^ b>>>13 ^ b>>>22 ^ b<<30 ^ b<<19 ^ b<<10 ) )|0;\n\n // 56\n w8 = ( ( w9>>>7 ^ w9>>>18 ^ w9>>>3 ^ w9<<25 ^ w9<<14 ) + ( w6>>>17 ^ w6>>>19 ^ w6>>>10 ^ w6<<15 ^ w6<<13 ) + w8 + w1 )|0;\n h = ( w8 + h + ( e>>>6 ^ e>>>11 ^ e>>>25 ^ e<<26 ^ e<<21 ^ e<<7 ) + ( g ^ e & (f^g) ) + 0x748f82ee )|0;\n d = ( d + h )|0;\n h = ( h + ( (a & b) ^ ( c & (a ^ b) ) ) + ( a>>>2 ^ a>>>13 ^ a>>>22 ^ a<<30 ^ a<<19 ^ a<<10 ) )|0;\n\n // 57\n w9 = ( ( w10>>>7 ^ w10>>>18 ^ w10>>>3 ^ w10<<25 ^ w10<<14 ) + ( w7>>>17 ^ w7>>>19 ^ w7>>>10 ^ w7<<15 ^ w7<<13 ) + w9 + w2 )|0;\n g = ( w9 + g + ( d>>>6 ^ d>>>11 ^ d>>>25 ^ d<<26 ^ d<<21 ^ d<<7 ) + ( f ^ d & (e^f) ) + 0x78a5636f )|0;\n c = ( c + g )|0;\n g = ( g + ( (h & a) ^ ( b & (h ^ a) ) ) + ( h>>>2 ^ h>>>13 ^ h>>>22 ^ h<<30 ^ h<<19 ^ h<<10 ) )|0;\n\n // 58\n w10 = ( ( w11>>>7 ^ w11>>>18 ^ w11>>>3 ^ w11<<25 ^ w11<<14 ) + ( w8>>>17 ^ w8>>>19 ^ w8>>>10 ^ w8<<15 ^ w8<<13 ) + w10 + w3 )|0;\n f = ( w10 + f + ( c>>>6 ^ c>>>11 ^ c>>>25 ^ c<<26 ^ c<<21 ^ c<<7 ) + ( e ^ c & (d^e) ) + 0x84c87814 )|0;\n b = ( b + f )|0;\n f = ( f + ( (g & h) ^ ( a & (g ^ h) ) ) + ( g>>>2 ^ g>>>13 ^ g>>>22 ^ g<<30 ^ g<<19 ^ g<<10 ) )|0;\n\n // 59\n w11 = ( ( w12>>>7 ^ w12>>>18 ^ w12>>>3 ^ w12<<25 ^ w12<<14 ) + ( w9>>>17 ^ w9>>>19 ^ w9>>>10 ^ w9<<15 ^ w9<<13 ) + w11 + w4 )|0;\n e = ( w11 + e + ( b>>>6 ^ b>>>11 ^ b>>>25 ^ b<<26 ^ b<<21 ^ b<<7 ) + ( d ^ b & (c^d) ) + 0x8cc70208 )|0;\n a = ( a + e )|0;\n e = ( e + ( (f & g) ^ ( h & (f ^ g) ) ) + ( f>>>2 ^ f>>>13 ^ f>>>22 ^ f<<30 ^ f<<19 ^ f<<10 ) )|0;\n\n // 60\n w12 = ( ( w13>>>7 ^ w13>>>18 ^ w13>>>3 ^ w13<<25 ^ w13<<14 ) + ( w10>>>17 ^ w10>>>19 ^ w10>>>10 ^ w10<<15 ^ w10<<13 ) + w12 + w5 )|0;\n d = ( w12 + d + ( a>>>6 ^ a>>>11 ^ a>>>25 ^ a<<26 ^ a<<21 ^ a<<7 ) + ( c ^ a & (b^c) ) + 0x90befffa )|0;\n h = ( h + d )|0;\n d = ( d + ( (e & f) ^ ( g & (e ^ f) ) ) + ( e>>>2 ^ e>>>13 ^ e>>>22 ^ e<<30 ^ e<<19 ^ e<<10 ) )|0;\n\n // 61\n w13 = ( ( w14>>>7 ^ w14>>>18 ^ w14>>>3 ^ w14<<25 ^ w14<<14 ) + ( w11>>>17 ^ w11>>>19 ^ w11>>>10 ^ w11<<15 ^ w11<<13 ) + w13 + w6 )|0;\n c = ( w13 + c + ( h>>>6 ^ h>>>11 ^ h>>>25 ^ h<<26 ^ h<<21 ^ h<<7 ) + ( b ^ h & (a^b) ) + 0xa4506ceb )|0;\n g = ( g + c )|0;\n c = ( c + ( (d & e) ^ ( f & (d ^ e) ) ) + ( d>>>2 ^ d>>>13 ^ d>>>22 ^ d<<30 ^ d<<19 ^ d<<10 ) )|0;\n\n // 62\n w14 = ( ( w15>>>7 ^ w15>>>18 ^ w15>>>3 ^ w15<<25 ^ w15<<14 ) + ( w12>>>17 ^ w12>>>19 ^ w12>>>10 ^ w12<<15 ^ w12<<13 ) + w14 + w7 )|0;\n b = ( w14 + b + ( g>>>6 ^ g>>>11 ^ g>>>25 ^ g<<26 ^ g<<21 ^ g<<7 ) + ( a ^ g & (h^a) ) + 0xbef9a3f7 )|0;\n f = ( f + b )|0;\n b = ( b + ( (c & d) ^ ( e & (c ^ d) ) ) + ( c>>>2 ^ c>>>13 ^ c>>>22 ^ c<<30 ^ c<<19 ^ c<<10 ) )|0;\n\n // 63\n w15 = ( ( w0>>>7 ^ w0>>>18 ^ w0>>>3 ^ w0<<25 ^ w0<<14 ) + ( w13>>>17 ^ w13>>>19 ^ w13>>>10 ^ w13<<15 ^ w13<<13 ) + w15 + w8 )|0;\n a = ( w15 + a + ( f>>>6 ^ f>>>11 ^ f>>>25 ^ f<<26 ^ f<<21 ^ f<<7 ) + ( h ^ f & (g^h) ) + 0xc67178f2 )|0;\n e = ( e + a )|0;\n a = ( a + ( (b & c) ^ ( d & (b ^ c) ) ) + ( b>>>2 ^ b>>>13 ^ b>>>22 ^ b<<30 ^ b<<19 ^ b<<10 ) )|0;\n\n H0 = ( H0 + a )|0;\n H1 = ( H1 + b )|0;\n H2 = ( H2 + c )|0;\n H3 = ( H3 + d )|0;\n H4 = ( H4 + e )|0;\n H5 = ( H5 + f )|0;\n H6 = ( H6 + g )|0;\n H7 = ( H7 + h )|0;\n }\n\n function _core_heap ( offset ) {\n offset = offset|0;\n\n _core(\n HEAP[offset|0]<<24 | HEAP[offset|1]<<16 | HEAP[offset|2]<<8 | HEAP[offset|3],\n HEAP[offset|4]<<24 | HEAP[offset|5]<<16 | HEAP[offset|6]<<8 | HEAP[offset|7],\n HEAP[offset|8]<<24 | HEAP[offset|9]<<16 | HEAP[offset|10]<<8 | HEAP[offset|11],\n HEAP[offset|12]<<24 | HEAP[offset|13]<<16 | HEAP[offset|14]<<8 | HEAP[offset|15],\n HEAP[offset|16]<<24 | HEAP[offset|17]<<16 | HEAP[offset|18]<<8 | HEAP[offset|19],\n HEAP[offset|20]<<24 | HEAP[offset|21]<<16 | HEAP[offset|22]<<8 | HEAP[offset|23],\n HEAP[offset|24]<<24 | HEAP[offset|25]<<16 | HEAP[offset|26]<<8 | HEAP[offset|27],\n HEAP[offset|28]<<24 | HEAP[offset|29]<<16 | HEAP[offset|30]<<8 | HEAP[offset|31],\n HEAP[offset|32]<<24 | HEAP[offset|33]<<16 | HEAP[offset|34]<<8 | HEAP[offset|35],\n HEAP[offset|36]<<24 | HEAP[offset|37]<<16 | HEAP[offset|38]<<8 | HEAP[offset|39],\n HEAP[offset|40]<<24 | HEAP[offset|41]<<16 | HEAP[offset|42]<<8 | HEAP[offset|43],\n HEAP[offset|44]<<24 | HEAP[offset|45]<<16 | HEAP[offset|46]<<8 | HEAP[offset|47],\n HEAP[offset|48]<<24 | HEAP[offset|49]<<16 | HEAP[offset|50]<<8 | HEAP[offset|51],\n HEAP[offset|52]<<24 | HEAP[offset|53]<<16 | HEAP[offset|54]<<8 | HEAP[offset|55],\n HEAP[offset|56]<<24 | HEAP[offset|57]<<16 | HEAP[offset|58]<<8 | HEAP[offset|59],\n HEAP[offset|60]<<24 | HEAP[offset|61]<<16 | HEAP[offset|62]<<8 | HEAP[offset|63]\n );\n }\n\n // offset — multiple of 32\n function _state_to_heap ( output ) {\n output = output|0;\n\n HEAP[output|0] = H0>>>24;\n HEAP[output|1] = H0>>>16&255;\n HEAP[output|2] = H0>>>8&255;\n HEAP[output|3] = H0&255;\n HEAP[output|4] = H1>>>24;\n HEAP[output|5] = H1>>>16&255;\n HEAP[output|6] = H1>>>8&255;\n HEAP[output|7] = H1&255;\n HEAP[output|8] = H2>>>24;\n HEAP[output|9] = H2>>>16&255;\n HEAP[output|10] = H2>>>8&255;\n HEAP[output|11] = H2&255;\n HEAP[output|12] = H3>>>24;\n HEAP[output|13] = H3>>>16&255;\n HEAP[output|14] = H3>>>8&255;\n HEAP[output|15] = H3&255;\n HEAP[output|16] = H4>>>24;\n HEAP[output|17] = H4>>>16&255;\n HEAP[output|18] = H4>>>8&255;\n HEAP[output|19] = H4&255;\n HEAP[output|20] = H5>>>24;\n HEAP[output|21] = H5>>>16&255;\n HEAP[output|22] = H5>>>8&255;\n HEAP[output|23] = H5&255;\n HEAP[output|24] = H6>>>24;\n HEAP[output|25] = H6>>>16&255;\n HEAP[output|26] = H6>>>8&255;\n HEAP[output|27] = H6&255;\n HEAP[output|28] = H7>>>24;\n HEAP[output|29] = H7>>>16&255;\n HEAP[output|30] = H7>>>8&255;\n HEAP[output|31] = H7&255;\n }\n\n function reset () {\n H0 = 0x6a09e667;\n H1 = 0xbb67ae85;\n H2 = 0x3c6ef372;\n H3 = 0xa54ff53a;\n H4 = 0x510e527f;\n H5 = 0x9b05688c;\n H6 = 0x1f83d9ab;\n H7 = 0x5be0cd19;\n TOTAL0 = TOTAL1 = 0;\n }\n\n function init ( h0, h1, h2, h3, h4, h5, h6, h7, total0, total1 ) {\n h0 = h0|0;\n h1 = h1|0;\n h2 = h2|0;\n h3 = h3|0;\n h4 = h4|0;\n h5 = h5|0;\n h6 = h6|0;\n h7 = h7|0;\n total0 = total0|0;\n total1 = total1|0;\n\n H0 = h0;\n H1 = h1;\n H2 = h2;\n H3 = h3;\n H4 = h4;\n H5 = h5;\n H6 = h6;\n H7 = h7;\n TOTAL0 = total0;\n TOTAL1 = total1;\n }\n\n // offset — multiple of 64\n function process ( offset, length ) {\n offset = offset|0;\n length = length|0;\n\n var hashed = 0;\n\n if ( offset & 63 )\n return -1;\n\n while ( (length|0) >= 64 ) {\n _core_heap(offset);\n\n offset = ( offset + 64 )|0;\n length = ( length - 64 )|0;\n\n hashed = ( hashed + 64 )|0;\n }\n\n TOTAL0 = ( TOTAL0 + hashed )|0;\n if ( TOTAL0>>>0 < hashed>>>0 ) TOTAL1 = ( TOTAL1 + 1 )|0;\n\n return hashed|0;\n }\n\n // offset — multiple of 64\n // output — multiple of 32\n function finish ( offset, length, output ) {\n offset = offset|0;\n length = length|0;\n output = output|0;\n\n var hashed = 0,\n i = 0;\n\n if ( offset & 63 )\n return -1;\n\n if ( ~output )\n if ( output & 31 )\n return -1;\n\n if ( (length|0) >= 64 ) {\n hashed = process( offset, length )|0;\n if ( (hashed|0) == -1 )\n return -1;\n\n offset = ( offset + hashed )|0;\n length = ( length - hashed )|0;\n }\n\n hashed = ( hashed + length )|0;\n TOTAL0 = ( TOTAL0 + length )|0;\n if ( TOTAL0>>>0 < length>>>0 ) TOTAL1 = ( TOTAL1 + 1 )|0;\n\n HEAP[offset|length] = 0x80;\n\n if ( (length|0) >= 56 ) {\n for ( i = (length+1)|0; (i|0) < 64; i = (i+1)|0 )\n HEAP[offset|i] = 0x00;\n\n _core_heap(offset);\n\n length = 0;\n\n HEAP[offset|0] = 0;\n }\n\n for ( i = (length+1)|0; (i|0) < 59; i = (i+1)|0 )\n HEAP[offset|i] = 0;\n\n HEAP[offset|56] = TOTAL1>>>21&255;\n HEAP[offset|57] = TOTAL1>>>13&255;\n HEAP[offset|58] = TOTAL1>>>5&255;\n HEAP[offset|59] = TOTAL1<<3&255 | TOTAL0>>>29;\n HEAP[offset|60] = TOTAL0>>>21&255;\n HEAP[offset|61] = TOTAL0>>>13&255;\n HEAP[offset|62] = TOTAL0>>>5&255;\n HEAP[offset|63] = TOTAL0<<3&255;\n _core_heap(offset);\n\n if ( ~output )\n _state_to_heap(output);\n\n return hashed|0;\n }\n\n function hmac_reset () {\n H0 = I0;\n H1 = I1;\n H2 = I2;\n H3 = I3;\n H4 = I4;\n H5 = I5;\n H6 = I6;\n H7 = I7;\n TOTAL0 = 64;\n TOTAL1 = 0;\n }\n\n function _hmac_opad () {\n H0 = O0;\n H1 = O1;\n H2 = O2;\n H3 = O3;\n H4 = O4;\n H5 = O5;\n H6 = O6;\n H7 = O7;\n TOTAL0 = 64;\n TOTAL1 = 0;\n }\n\n function hmac_init ( p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15 ) {\n p0 = p0|0;\n p1 = p1|0;\n p2 = p2|0;\n p3 = p3|0;\n p4 = p4|0;\n p5 = p5|0;\n p6 = p6|0;\n p7 = p7|0;\n p8 = p8|0;\n p9 = p9|0;\n p10 = p10|0;\n p11 = p11|0;\n p12 = p12|0;\n p13 = p13|0;\n p14 = p14|0;\n p15 = p15|0;\n\n // opad\n reset();\n _core(\n p0 ^ 0x5c5c5c5c,\n p1 ^ 0x5c5c5c5c,\n p2 ^ 0x5c5c5c5c,\n p3 ^ 0x5c5c5c5c,\n p4 ^ 0x5c5c5c5c,\n p5 ^ 0x5c5c5c5c,\n p6 ^ 0x5c5c5c5c,\n p7 ^ 0x5c5c5c5c,\n p8 ^ 0x5c5c5c5c,\n p9 ^ 0x5c5c5c5c,\n p10 ^ 0x5c5c5c5c,\n p11 ^ 0x5c5c5c5c,\n p12 ^ 0x5c5c5c5c,\n p13 ^ 0x5c5c5c5c,\n p14 ^ 0x5c5c5c5c,\n p15 ^ 0x5c5c5c5c\n );\n O0 = H0;\n O1 = H1;\n O2 = H2;\n O3 = H3;\n O4 = H4;\n O5 = H5;\n O6 = H6;\n O7 = H7;\n\n // ipad\n reset();\n _core(\n p0 ^ 0x36363636,\n p1 ^ 0x36363636,\n p2 ^ 0x36363636,\n p3 ^ 0x36363636,\n p4 ^ 0x36363636,\n p5 ^ 0x36363636,\n p6 ^ 0x36363636,\n p7 ^ 0x36363636,\n p8 ^ 0x36363636,\n p9 ^ 0x36363636,\n p10 ^ 0x36363636,\n p11 ^ 0x36363636,\n p12 ^ 0x36363636,\n p13 ^ 0x36363636,\n p14 ^ 0x36363636,\n p15 ^ 0x36363636\n );\n I0 = H0;\n I1 = H1;\n I2 = H2;\n I3 = H3;\n I4 = H4;\n I5 = H5;\n I6 = H6;\n I7 = H7;\n\n TOTAL0 = 64;\n TOTAL1 = 0;\n }\n\n // offset — multiple of 64\n // output — multiple of 32\n function hmac_finish ( offset, length, output ) {\n offset = offset|0;\n length = length|0;\n output = output|0;\n\n var t0 = 0, t1 = 0, t2 = 0, t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0,\n hashed = 0;\n\n if ( offset & 63 )\n return -1;\n\n if ( ~output )\n if ( output & 31 )\n return -1;\n\n hashed = finish( offset, length, -1 )|0;\n t0 = H0, t1 = H1, t2 = H2, t3 = H3, t4 = H4, t5 = H5, t6 = H6, t7 = H7;\n\n _hmac_opad();\n _core( t0, t1, t2, t3, t4, t5, t6, t7, 0x80000000, 0, 0, 0, 0, 0, 0, 768 );\n\n if ( ~output )\n _state_to_heap(output);\n\n return hashed|0;\n }\n\n // salt is assumed to be already processed\n // offset — multiple of 64\n // output — multiple of 32\n function pbkdf2_generate_block ( offset, length, block, count, output ) {\n offset = offset|0;\n length = length|0;\n block = block|0;\n count = count|0;\n output = output|0;\n\n var h0 = 0, h1 = 0, h2 = 0, h3 = 0, h4 = 0, h5 = 0, h6 = 0, h7 = 0,\n t0 = 0, t1 = 0, t2 = 0, t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0;\n\n if ( offset & 63 )\n return -1;\n\n if ( ~output )\n if ( output & 31 )\n return -1;\n\n // pad block number into heap\n // FIXME probable OOB write\n HEAP[(offset+length)|0] = block>>>24;\n HEAP[(offset+length+1)|0] = block>>>16&255;\n HEAP[(offset+length+2)|0] = block>>>8&255;\n HEAP[(offset+length+3)|0] = block&255;\n\n // finish first iteration\n hmac_finish( offset, (length+4)|0, -1 )|0;\n h0 = t0 = H0, h1 = t1 = H1, h2 = t2 = H2, h3 = t3 = H3, h4 = t4 = H4, h5 = t5 = H5, h6 = t6 = H6, h7 = t7 = H7;\n count = (count-1)|0;\n\n // perform the rest iterations\n while ( (count|0) > 0 ) {\n hmac_reset();\n _core( t0, t1, t2, t3, t4, t5, t6, t7, 0x80000000, 0, 0, 0, 0, 0, 0, 768 );\n t0 = H0, t1 = H1, t2 = H2, t3 = H3, t4 = H4, t5 = H5, t6 = H6, t7 = H7;\n\n _hmac_opad();\n _core( t0, t1, t2, t3, t4, t5, t6, t7, 0x80000000, 0, 0, 0, 0, 0, 0, 768 );\n t0 = H0, t1 = H1, t2 = H2, t3 = H3, t4 = H4, t5 = H5, t6 = H6, t7 = H7;\n\n h0 = h0 ^ H0;\n h1 = h1 ^ H1;\n h2 = h2 ^ H2;\n h3 = h3 ^ H3;\n h4 = h4 ^ H4;\n h5 = h5 ^ H5;\n h6 = h6 ^ H6;\n h7 = h7 ^ H7;\n\n count = (count-1)|0;\n }\n\n H0 = h0;\n H1 = h1;\n H2 = h2;\n H3 = h3;\n H4 = h4;\n H5 = h5;\n H6 = h6;\n H7 = h7;\n\n if ( ~output )\n _state_to_heap(output);\n\n return 0;\n }\n\n return {\n // SHA256\n reset: reset,\n init: init,\n process: process,\n finish: finish,\n\n // HMAC-SHA256\n hmac_reset: hmac_reset,\n hmac_init: hmac_init,\n hmac_finish: hmac_finish,\n\n // PBKDF2-HMAC-SHA256\n pbkdf2_generate_block: pbkdf2_generate_block\n }\n}\n","module.exports = assert;\n\nfunction assert(val, msg) {\n if (!val)\n throw new Error(msg || 'Assertion failed');\n}\n\nassert.equal = function assertEqual(l, r, msg) {\n if (l != r)\n throw new Error(msg || ('Assertion failed: ' + l + ' != ' + r));\n};\n","if (typeof Object.create === 'function') {\n // implementation from standard node.js 'util' module\n module.exports = function inherits(ctor, superCtor) {\n ctor.super_ = superCtor\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n };\n} else {\n // old school shim for old browsers\n module.exports = function inherits(ctor, superCtor) {\n ctor.super_ = superCtor\n var TempCtor = function () {}\n TempCtor.prototype = superCtor.prototype\n ctor.prototype = new TempCtor()\n ctor.prototype.constructor = ctor\n }\n}\n","'use strict';\n\nvar assert = require('minimalistic-assert');\nvar inherits = require('inherits');\n\nexports.inherits = inherits;\n\nfunction toArray(msg, enc) {\n if (Array.isArray(msg))\n return msg.slice();\n if (!msg)\n return [];\n var res = [];\n if (typeof msg === 'string') {\n if (!enc) {\n for (var i = 0; i < msg.length; i++) {\n var c = msg.charCodeAt(i);\n var hi = c >> 8;\n var lo = c & 0xff;\n if (hi)\n res.push(hi, lo);\n else\n res.push(lo);\n }\n } else if (enc === 'hex') {\n msg = msg.replace(/[^a-z0-9]+/ig, '');\n if (msg.length % 2 !== 0)\n msg = '0' + msg;\n for (i = 0; i < msg.length; i += 2)\n res.push(parseInt(msg[i] + msg[i + 1], 16));\n }\n } else {\n for (i = 0; i < msg.length; i++)\n res[i] = msg[i] | 0;\n }\n return res;\n}\nexports.toArray = toArray;\n\nfunction toHex(msg) {\n var res = '';\n for (var i = 0; i < msg.length; i++)\n res += zero2(msg[i].toString(16));\n return res;\n}\nexports.toHex = toHex;\n\nfunction htonl(w) {\n var res = (w >>> 24) |\n ((w >>> 8) & 0xff00) |\n ((w << 8) & 0xff0000) |\n ((w & 0xff) << 24);\n return res >>> 0;\n}\nexports.htonl = htonl;\n\nfunction toHex32(msg, endian) {\n var res = '';\n for (var i = 0; i < msg.length; i++) {\n var w = msg[i];\n if (endian === 'little')\n w = htonl(w);\n res += zero8(w.toString(16));\n }\n return res;\n}\nexports.toHex32 = toHex32;\n\nfunction zero2(word) {\n if (word.length === 1)\n return '0' + word;\n else\n return word;\n}\nexports.zero2 = zero2;\n\nfunction zero8(word) {\n if (word.length === 7)\n return '0' + word;\n else if (word.length === 6)\n return '00' + word;\n else if (word.length === 5)\n return '000' + word;\n else if (word.length === 4)\n return '0000' + word;\n else if (word.length === 3)\n return '00000' + word;\n else if (word.length === 2)\n return '000000' + word;\n else if (word.length === 1)\n return '0000000' + word;\n else\n return word;\n}\nexports.zero8 = zero8;\n\nfunction join32(msg, start, end, endian) {\n var len = end - start;\n assert(len % 4 === 0);\n var res = new Array(len / 4);\n for (var i = 0, k = start; i < res.length; i++, k += 4) {\n var w;\n if (endian === 'big')\n w = (msg[k] << 24) | (msg[k + 1] << 16) | (msg[k + 2] << 8) | msg[k + 3];\n else\n w = (msg[k + 3] << 24) | (msg[k + 2] << 16) | (msg[k + 1] << 8) | msg[k];\n res[i] = w >>> 0;\n }\n return res;\n}\nexports.join32 = join32;\n\nfunction split32(msg, endian) {\n var res = new Array(msg.length * 4);\n for (var i = 0, k = 0; i < msg.length; i++, k += 4) {\n var m = msg[i];\n if (endian === 'big') {\n res[k] = m >>> 24;\n res[k + 1] = (m >>> 16) & 0xff;\n res[k + 2] = (m >>> 8) & 0xff;\n res[k + 3] = m & 0xff;\n } else {\n res[k + 3] = m >>> 24;\n res[k + 2] = (m >>> 16) & 0xff;\n res[k + 1] = (m >>> 8) & 0xff;\n res[k] = m & 0xff;\n }\n }\n return res;\n}\nexports.split32 = split32;\n\nfunction rotr32(w, b) {\n return (w >>> b) | (w << (32 - b));\n}\nexports.rotr32 = rotr32;\n\nfunction rotl32(w, b) {\n return (w << b) | (w >>> (32 - b));\n}\nexports.rotl32 = rotl32;\n\nfunction sum32(a, b) {\n return (a + b) >>> 0;\n}\nexports.sum32 = sum32;\n\nfunction sum32_3(a, b, c) {\n return (a + b + c) >>> 0;\n}\nexports.sum32_3 = sum32_3;\n\nfunction sum32_4(a, b, c, d) {\n return (a + b + c + d) >>> 0;\n}\nexports.sum32_4 = sum32_4;\n\nfunction sum32_5(a, b, c, d, e) {\n return (a + b + c + d + e) >>> 0;\n}\nexports.sum32_5 = sum32_5;\n\nfunction sum64(buf, pos, ah, al) {\n var bh = buf[pos];\n var bl = buf[pos + 1];\n\n var lo = (al + bl) >>> 0;\n var hi = (lo < al ? 1 : 0) + ah + bh;\n buf[pos] = hi >>> 0;\n buf[pos + 1] = lo;\n}\nexports.sum64 = sum64;\n\nfunction sum64_hi(ah, al, bh, bl) {\n var lo = (al + bl) >>> 0;\n var hi = (lo < al ? 1 : 0) + ah + bh;\n return hi >>> 0;\n}\nexports.sum64_hi = sum64_hi;\n\nfunction sum64_lo(ah, al, bh, bl) {\n var lo = al + bl;\n return lo >>> 0;\n}\nexports.sum64_lo = sum64_lo;\n\nfunction sum64_4_hi(ah, al, bh, bl, ch, cl, dh, dl) {\n var carry = 0;\n var lo = al;\n lo = (lo + bl) >>> 0;\n carry += lo < al ? 1 : 0;\n lo = (lo + cl) >>> 0;\n carry += lo < cl ? 1 : 0;\n lo = (lo + dl) >>> 0;\n carry += lo < dl ? 1 : 0;\n\n var hi = ah + bh + ch + dh + carry;\n return hi >>> 0;\n}\nexports.sum64_4_hi = sum64_4_hi;\n\nfunction sum64_4_lo(ah, al, bh, bl, ch, cl, dh, dl) {\n var lo = al + bl + cl + dl;\n return lo >>> 0;\n}\nexports.sum64_4_lo = sum64_4_lo;\n\nfunction sum64_5_hi(ah, al, bh, bl, ch, cl, dh, dl, eh, el) {\n var carry = 0;\n var lo = al;\n lo = (lo + bl) >>> 0;\n carry += lo < al ? 1 : 0;\n lo = (lo + cl) >>> 0;\n carry += lo < cl ? 1 : 0;\n lo = (lo + dl) >>> 0;\n carry += lo < dl ? 1 : 0;\n lo = (lo + el) >>> 0;\n carry += lo < el ? 1 : 0;\n\n var hi = ah + bh + ch + dh + eh + carry;\n return hi >>> 0;\n}\nexports.sum64_5_hi = sum64_5_hi;\n\nfunction sum64_5_lo(ah, al, bh, bl, ch, cl, dh, dl, eh, el) {\n var lo = al + bl + cl + dl + el;\n\n return lo >>> 0;\n}\nexports.sum64_5_lo = sum64_5_lo;\n\nfunction rotr64_hi(ah, al, num) {\n var r = (al << (32 - num)) | (ah >>> num);\n return r >>> 0;\n}\nexports.rotr64_hi = rotr64_hi;\n\nfunction rotr64_lo(ah, al, num) {\n var r = (ah << (32 - num)) | (al >>> num);\n return r >>> 0;\n}\nexports.rotr64_lo = rotr64_lo;\n\nfunction shr64_hi(ah, al, num) {\n return ah >>> num;\n}\nexports.shr64_hi = shr64_hi;\n\nfunction shr64_lo(ah, al, num) {\n var r = (ah << (32 - num)) | (al >>> num);\n return r >>> 0;\n}\nexports.shr64_lo = shr64_lo;\n","'use strict';\n\nvar utils = require('./utils');\nvar assert = require('minimalistic-assert');\n\nfunction BlockHash() {\n this.pending = null;\n this.pendingTotal = 0;\n this.blockSize = this.constructor.blockSize;\n this.outSize = this.constructor.outSize;\n this.hmacStrength = this.constructor.hmacStrength;\n this.padLength = this.constructor.padLength / 8;\n this.endian = 'big';\n\n this._delta8 = this.blockSize / 8;\n this._delta32 = this.blockSize / 32;\n}\nexports.BlockHash = BlockHash;\n\nBlockHash.prototype.update = function update(msg, enc) {\n // Convert message to array, pad it, and join into 32bit blocks\n msg = utils.toArray(msg, enc);\n if (!this.pending)\n this.pending = msg;\n else\n this.pending = this.pending.concat(msg);\n this.pendingTotal += msg.length;\n\n // Enough data, try updating\n if (this.pending.length >= this._delta8) {\n msg = this.pending;\n\n // Process pending data in blocks\n var r = msg.length % this._delta8;\n this.pending = msg.slice(msg.length - r, msg.length);\n if (this.pending.length === 0)\n this.pending = null;\n\n msg = utils.join32(msg, 0, msg.length - r, this.endian);\n for (var i = 0; i < msg.length; i += this._delta32)\n this._update(msg, i, i + this._delta32);\n }\n\n return this;\n};\n\nBlockHash.prototype.digest = function digest(enc) {\n this.update(this._pad());\n assert(this.pending === null);\n\n return this._digest(enc);\n};\n\nBlockHash.prototype._pad = function pad() {\n var len = this.pendingTotal;\n var bytes = this._delta8;\n var k = bytes - ((len + this.padLength) % bytes);\n var res = new Array(k + this.padLength);\n res[0] = 0x80;\n for (var i = 1; i < k; i++)\n res[i] = 0;\n\n // Append length\n len <<= 3;\n if (this.endian === 'big') {\n for (var t = 8; t < this.padLength; t++)\n res[i++] = 0;\n\n res[i++] = 0;\n res[i++] = 0;\n res[i++] = 0;\n res[i++] = 0;\n res[i++] = (len >>> 24) & 0xff;\n res[i++] = (len >>> 16) & 0xff;\n res[i++] = (len >>> 8) & 0xff;\n res[i++] = len & 0xff;\n } else {\n res[i++] = len & 0xff;\n res[i++] = (len >>> 8) & 0xff;\n res[i++] = (len >>> 16) & 0xff;\n res[i++] = (len >>> 24) & 0xff;\n res[i++] = 0;\n res[i++] = 0;\n res[i++] = 0;\n res[i++] = 0;\n\n for (t = 8; t < this.padLength; t++)\n res[i++] = 0;\n }\n\n return res;\n};\n","'use strict';\n\nvar utils = require('../utils');\nvar rotr32 = utils.rotr32;\n\nfunction ft_1(s, x, y, z) {\n if (s === 0)\n return ch32(x, y, z);\n if (s === 1 || s === 3)\n return p32(x, y, z);\n if (s === 2)\n return maj32(x, y, z);\n}\nexports.ft_1 = ft_1;\n\nfunction ch32(x, y, z) {\n return (x & y) ^ ((~x) & z);\n}\nexports.ch32 = ch32;\n\nfunction maj32(x, y, z) {\n return (x & y) ^ (x & z) ^ (y & z);\n}\nexports.maj32 = maj32;\n\nfunction p32(x, y, z) {\n return x ^ y ^ z;\n}\nexports.p32 = p32;\n\nfunction s0_256(x) {\n return rotr32(x, 2) ^ rotr32(x, 13) ^ rotr32(x, 22);\n}\nexports.s0_256 = s0_256;\n\nfunction s1_256(x) {\n return rotr32(x, 6) ^ rotr32(x, 11) ^ rotr32(x, 25);\n}\nexports.s1_256 = s1_256;\n\nfunction g0_256(x) {\n return rotr32(x, 7) ^ rotr32(x, 18) ^ (x >>> 3);\n}\nexports.g0_256 = g0_256;\n\nfunction g1_256(x) {\n return rotr32(x, 17) ^ rotr32(x, 19) ^ (x >>> 10);\n}\nexports.g1_256 = g1_256;\n","'use strict';\n\nvar utils = require('../utils');\nvar common = require('../common');\nvar shaCommon = require('./common');\nvar assert = require('minimalistic-assert');\n\nvar sum32 = utils.sum32;\nvar sum32_4 = utils.sum32_4;\nvar sum32_5 = utils.sum32_5;\nvar ch32 = shaCommon.ch32;\nvar maj32 = shaCommon.maj32;\nvar s0_256 = shaCommon.s0_256;\nvar s1_256 = shaCommon.s1_256;\nvar g0_256 = shaCommon.g0_256;\nvar g1_256 = shaCommon.g1_256;\n\nvar BlockHash = common.BlockHash;\n\nvar sha256_K = [\n 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5,\n 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,\n 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3,\n 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,\n 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc,\n 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,\n 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7,\n 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,\n 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13,\n 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,\n 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3,\n 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,\n 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5,\n 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,\n 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208,\n 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2\n];\n\nfunction SHA256() {\n if (!(this instanceof SHA256))\n return new SHA256();\n\n BlockHash.call(this);\n this.h = [\n 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a,\n 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19\n ];\n this.k = sha256_K;\n this.W = new Array(64);\n}\nutils.inherits(SHA256, BlockHash);\nmodule.exports = SHA256;\n\nSHA256.blockSize = 512;\nSHA256.outSize = 256;\nSHA256.hmacStrength = 192;\nSHA256.padLength = 64;\n\nSHA256.prototype._update = function _update(msg, start) {\n var W = this.W;\n\n for (var i = 0; i < 16; i++)\n W[i] = msg[start + i];\n for (; i < W.length; i++)\n W[i] = sum32_4(g1_256(W[i - 2]), W[i - 7], g0_256(W[i - 15]), W[i - 16]);\n\n var a = this.h[0];\n var b = this.h[1];\n var c = this.h[2];\n var d = this.h[3];\n var e = this.h[4];\n var f = this.h[5];\n var g = this.h[6];\n var h = this.h[7];\n\n assert(this.k.length === W.length);\n for (i = 0; i < W.length; i++) {\n var T1 = sum32_5(h, s1_256(e), ch32(e, f, g), this.k[i], W[i]);\n var T2 = sum32(s0_256(a), maj32(a, b, c));\n h = g;\n g = f;\n f = e;\n e = sum32(d, T1);\n d = c;\n c = b;\n b = a;\n a = sum32(T1, T2);\n }\n\n this.h[0] = sum32(this.h[0], a);\n this.h[1] = sum32(this.h[1], b);\n this.h[2] = sum32(this.h[2], c);\n this.h[3] = sum32(this.h[3], d);\n this.h[4] = sum32(this.h[4], e);\n this.h[5] = sum32(this.h[5], f);\n this.h[6] = sum32(this.h[6], g);\n this.h[7] = sum32(this.h[7], h);\n};\n\nSHA256.prototype._digest = function digest(enc) {\n if (enc === 'hex')\n return utils.toHex32(this.h, 'big');\n else\n return utils.split32(this.h, 'big');\n};\n","'use strict';\n\nvar utils = require('../utils');\nvar SHA256 = require('./256');\n\nfunction SHA224() {\n if (!(this instanceof SHA224))\n return new SHA224();\n\n SHA256.call(this);\n this.h = [\n 0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939,\n 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4 ];\n}\nutils.inherits(SHA224, SHA256);\nmodule.exports = SHA224;\n\nSHA224.blockSize = 512;\nSHA224.outSize = 224;\nSHA224.hmacStrength = 192;\nSHA224.padLength = 64;\n\nSHA224.prototype._digest = function digest(enc) {\n // Just truncate output\n if (enc === 'hex')\n return utils.toHex32(this.h.slice(0, 7), 'big');\n else\n return utils.split32(this.h.slice(0, 7), 'big');\n};\n\n","'use strict';\n\nvar utils = require('../utils');\nvar common = require('../common');\nvar assert = require('minimalistic-assert');\n\nvar rotr64_hi = utils.rotr64_hi;\nvar rotr64_lo = utils.rotr64_lo;\nvar shr64_hi = utils.shr64_hi;\nvar shr64_lo = utils.shr64_lo;\nvar sum64 = utils.sum64;\nvar sum64_hi = utils.sum64_hi;\nvar sum64_lo = utils.sum64_lo;\nvar sum64_4_hi = utils.sum64_4_hi;\nvar sum64_4_lo = utils.sum64_4_lo;\nvar sum64_5_hi = utils.sum64_5_hi;\nvar sum64_5_lo = utils.sum64_5_lo;\n\nvar BlockHash = common.BlockHash;\n\nvar sha512_K = [\n 0x428a2f98, 0xd728ae22, 0x71374491, 0x23ef65cd,\n 0xb5c0fbcf, 0xec4d3b2f, 0xe9b5dba5, 0x8189dbbc,\n 0x3956c25b, 0xf348b538, 0x59f111f1, 0xb605d019,\n 0x923f82a4, 0xaf194f9b, 0xab1c5ed5, 0xda6d8118,\n 0xd807aa98, 0xa3030242, 0x12835b01, 0x45706fbe,\n 0x243185be, 0x4ee4b28c, 0x550c7dc3, 0xd5ffb4e2,\n 0x72be5d74, 0xf27b896f, 0x80deb1fe, 0x3b1696b1,\n 0x9bdc06a7, 0x25c71235, 0xc19bf174, 0xcf692694,\n 0xe49b69c1, 0x9ef14ad2, 0xefbe4786, 0x384f25e3,\n 0x0fc19dc6, 0x8b8cd5b5, 0x240ca1cc, 0x77ac9c65,\n 0x2de92c6f, 0x592b0275, 0x4a7484aa, 0x6ea6e483,\n 0x5cb0a9dc, 0xbd41fbd4, 0x76f988da, 0x831153b5,\n 0x983e5152, 0xee66dfab, 0xa831c66d, 0x2db43210,\n 0xb00327c8, 0x98fb213f, 0xbf597fc7, 0xbeef0ee4,\n 0xc6e00bf3, 0x3da88fc2, 0xd5a79147, 0x930aa725,\n 0x06ca6351, 0xe003826f, 0x14292967, 0x0a0e6e70,\n 0x27b70a85, 0x46d22ffc, 0x2e1b2138, 0x5c26c926,\n 0x4d2c6dfc, 0x5ac42aed, 0x53380d13, 0x9d95b3df,\n 0x650a7354, 0x8baf63de, 0x766a0abb, 0x3c77b2a8,\n 0x81c2c92e, 0x47edaee6, 0x92722c85, 0x1482353b,\n 0xa2bfe8a1, 0x4cf10364, 0xa81a664b, 0xbc423001,\n 0xc24b8b70, 0xd0f89791, 0xc76c51a3, 0x0654be30,\n 0xd192e819, 0xd6ef5218, 0xd6990624, 0x5565a910,\n 0xf40e3585, 0x5771202a, 0x106aa070, 0x32bbd1b8,\n 0x19a4c116, 0xb8d2d0c8, 0x1e376c08, 0x5141ab53,\n 0x2748774c, 0xdf8eeb99, 0x34b0bcb5, 0xe19b48a8,\n 0x391c0cb3, 0xc5c95a63, 0x4ed8aa4a, 0xe3418acb,\n 0x5b9cca4f, 0x7763e373, 0x682e6ff3, 0xd6b2b8a3,\n 0x748f82ee, 0x5defb2fc, 0x78a5636f, 0x43172f60,\n 0x84c87814, 0xa1f0ab72, 0x8cc70208, 0x1a6439ec,\n 0x90befffa, 0x23631e28, 0xa4506ceb, 0xde82bde9,\n 0xbef9a3f7, 0xb2c67915, 0xc67178f2, 0xe372532b,\n 0xca273ece, 0xea26619c, 0xd186b8c7, 0x21c0c207,\n 0xeada7dd6, 0xcde0eb1e, 0xf57d4f7f, 0xee6ed178,\n 0x06f067aa, 0x72176fba, 0x0a637dc5, 0xa2c898a6,\n 0x113f9804, 0xbef90dae, 0x1b710b35, 0x131c471b,\n 0x28db77f5, 0x23047d84, 0x32caab7b, 0x40c72493,\n 0x3c9ebe0a, 0x15c9bebc, 0x431d67c4, 0x9c100d4c,\n 0x4cc5d4be, 0xcb3e42b6, 0x597f299c, 0xfc657e2a,\n 0x5fcb6fab, 0x3ad6faec, 0x6c44198c, 0x4a475817\n];\n\nfunction SHA512() {\n if (!(this instanceof SHA512))\n return new SHA512();\n\n BlockHash.call(this);\n this.h = [\n 0x6a09e667, 0xf3bcc908,\n 0xbb67ae85, 0x84caa73b,\n 0x3c6ef372, 0xfe94f82b,\n 0xa54ff53a, 0x5f1d36f1,\n 0x510e527f, 0xade682d1,\n 0x9b05688c, 0x2b3e6c1f,\n 0x1f83d9ab, 0xfb41bd6b,\n 0x5be0cd19, 0x137e2179 ];\n this.k = sha512_K;\n this.W = new Array(160);\n}\nutils.inherits(SHA512, BlockHash);\nmodule.exports = SHA512;\n\nSHA512.blockSize = 1024;\nSHA512.outSize = 512;\nSHA512.hmacStrength = 192;\nSHA512.padLength = 128;\n\nSHA512.prototype._prepareBlock = function _prepareBlock(msg, start) {\n var W = this.W;\n\n // 32 x 32bit words\n for (var i = 0; i < 32; i++)\n W[i] = msg[start + i];\n for (; i < W.length; i += 2) {\n var c0_hi = g1_512_hi(W[i - 4], W[i - 3]); // i - 2\n var c0_lo = g1_512_lo(W[i - 4], W[i - 3]);\n var c1_hi = W[i - 14]; // i - 7\n var c1_lo = W[i - 13];\n var c2_hi = g0_512_hi(W[i - 30], W[i - 29]); // i - 15\n var c2_lo = g0_512_lo(W[i - 30], W[i - 29]);\n var c3_hi = W[i - 32]; // i - 16\n var c3_lo = W[i - 31];\n\n W[i] = sum64_4_hi(\n c0_hi, c0_lo,\n c1_hi, c1_lo,\n c2_hi, c2_lo,\n c3_hi, c3_lo);\n W[i + 1] = sum64_4_lo(\n c0_hi, c0_lo,\n c1_hi, c1_lo,\n c2_hi, c2_lo,\n c3_hi, c3_lo);\n }\n};\n\nSHA512.prototype._update = function _update(msg, start) {\n this._prepareBlock(msg, start);\n\n var W = this.W;\n\n var ah = this.h[0];\n var al = this.h[1];\n var bh = this.h[2];\n var bl = this.h[3];\n var ch = this.h[4];\n var cl = this.h[5];\n var dh = this.h[6];\n var dl = this.h[7];\n var eh = this.h[8];\n var el = this.h[9];\n var fh = this.h[10];\n var fl = this.h[11];\n var gh = this.h[12];\n var gl = this.h[13];\n var hh = this.h[14];\n var hl = this.h[15];\n\n assert(this.k.length === W.length);\n for (var i = 0; i < W.length; i += 2) {\n var c0_hi = hh;\n var c0_lo = hl;\n var c1_hi = s1_512_hi(eh, el);\n var c1_lo = s1_512_lo(eh, el);\n var c2_hi = ch64_hi(eh, el, fh, fl, gh, gl);\n var c2_lo = ch64_lo(eh, el, fh, fl, gh, gl);\n var c3_hi = this.k[i];\n var c3_lo = this.k[i + 1];\n var c4_hi = W[i];\n var c4_lo = W[i + 1];\n\n var T1_hi = sum64_5_hi(\n c0_hi, c0_lo,\n c1_hi, c1_lo,\n c2_hi, c2_lo,\n c3_hi, c3_lo,\n c4_hi, c4_lo);\n var T1_lo = sum64_5_lo(\n c0_hi, c0_lo,\n c1_hi, c1_lo,\n c2_hi, c2_lo,\n c3_hi, c3_lo,\n c4_hi, c4_lo);\n\n c0_hi = s0_512_hi(ah, al);\n c0_lo = s0_512_lo(ah, al);\n c1_hi = maj64_hi(ah, al, bh, bl, ch, cl);\n c1_lo = maj64_lo(ah, al, bh, bl, ch, cl);\n\n var T2_hi = sum64_hi(c0_hi, c0_lo, c1_hi, c1_lo);\n var T2_lo = sum64_lo(c0_hi, c0_lo, c1_hi, c1_lo);\n\n hh = gh;\n hl = gl;\n\n gh = fh;\n gl = fl;\n\n fh = eh;\n fl = el;\n\n eh = sum64_hi(dh, dl, T1_hi, T1_lo);\n el = sum64_lo(dl, dl, T1_hi, T1_lo);\n\n dh = ch;\n dl = cl;\n\n ch = bh;\n cl = bl;\n\n bh = ah;\n bl = al;\n\n ah = sum64_hi(T1_hi, T1_lo, T2_hi, T2_lo);\n al = sum64_lo(T1_hi, T1_lo, T2_hi, T2_lo);\n }\n\n sum64(this.h, 0, ah, al);\n sum64(this.h, 2, bh, bl);\n sum64(this.h, 4, ch, cl);\n sum64(this.h, 6, dh, dl);\n sum64(this.h, 8, eh, el);\n sum64(this.h, 10, fh, fl);\n sum64(this.h, 12, gh, gl);\n sum64(this.h, 14, hh, hl);\n};\n\nSHA512.prototype._digest = function digest(enc) {\n if (enc === 'hex')\n return utils.toHex32(this.h, 'big');\n else\n return utils.split32(this.h, 'big');\n};\n\nfunction ch64_hi(xh, xl, yh, yl, zh) {\n var r = (xh & yh) ^ ((~xh) & zh);\n if (r < 0)\n r += 0x100000000;\n return r;\n}\n\nfunction ch64_lo(xh, xl, yh, yl, zh, zl) {\n var r = (xl & yl) ^ ((~xl) & zl);\n if (r < 0)\n r += 0x100000000;\n return r;\n}\n\nfunction maj64_hi(xh, xl, yh, yl, zh) {\n var r = (xh & yh) ^ (xh & zh) ^ (yh & zh);\n if (r < 0)\n r += 0x100000000;\n return r;\n}\n\nfunction maj64_lo(xh, xl, yh, yl, zh, zl) {\n var r = (xl & yl) ^ (xl & zl) ^ (yl & zl);\n if (r < 0)\n r += 0x100000000;\n return r;\n}\n\nfunction s0_512_hi(xh, xl) {\n var c0_hi = rotr64_hi(xh, xl, 28);\n var c1_hi = rotr64_hi(xl, xh, 2); // 34\n var c2_hi = rotr64_hi(xl, xh, 7); // 39\n\n var r = c0_hi ^ c1_hi ^ c2_hi;\n if (r < 0)\n r += 0x100000000;\n return r;\n}\n\nfunction s0_512_lo(xh, xl) {\n var c0_lo = rotr64_lo(xh, xl, 28);\n var c1_lo = rotr64_lo(xl, xh, 2); // 34\n var c2_lo = rotr64_lo(xl, xh, 7); // 39\n\n var r = c0_lo ^ c1_lo ^ c2_lo;\n if (r < 0)\n r += 0x100000000;\n return r;\n}\n\nfunction s1_512_hi(xh, xl) {\n var c0_hi = rotr64_hi(xh, xl, 14);\n var c1_hi = rotr64_hi(xh, xl, 18);\n var c2_hi = rotr64_hi(xl, xh, 9); // 41\n\n var r = c0_hi ^ c1_hi ^ c2_hi;\n if (r < 0)\n r += 0x100000000;\n return r;\n}\n\nfunction s1_512_lo(xh, xl) {\n var c0_lo = rotr64_lo(xh, xl, 14);\n var c1_lo = rotr64_lo(xh, xl, 18);\n var c2_lo = rotr64_lo(xl, xh, 9); // 41\n\n var r = c0_lo ^ c1_lo ^ c2_lo;\n if (r < 0)\n r += 0x100000000;\n return r;\n}\n\nfunction g0_512_hi(xh, xl) {\n var c0_hi = rotr64_hi(xh, xl, 1);\n var c1_hi = rotr64_hi(xh, xl, 8);\n var c2_hi = shr64_hi(xh, xl, 7);\n\n var r = c0_hi ^ c1_hi ^ c2_hi;\n if (r < 0)\n r += 0x100000000;\n return r;\n}\n\nfunction g0_512_lo(xh, xl) {\n var c0_lo = rotr64_lo(xh, xl, 1);\n var c1_lo = rotr64_lo(xh, xl, 8);\n var c2_lo = shr64_lo(xh, xl, 7);\n\n var r = c0_lo ^ c1_lo ^ c2_lo;\n if (r < 0)\n r += 0x100000000;\n return r;\n}\n\nfunction g1_512_hi(xh, xl) {\n var c0_hi = rotr64_hi(xh, xl, 19);\n var c1_hi = rotr64_hi(xl, xh, 29); // 61\n var c2_hi = shr64_hi(xh, xl, 6);\n\n var r = c0_hi ^ c1_hi ^ c2_hi;\n if (r < 0)\n r += 0x100000000;\n return r;\n}\n\nfunction g1_512_lo(xh, xl) {\n var c0_lo = rotr64_lo(xh, xl, 19);\n var c1_lo = rotr64_lo(xl, xh, 29); // 61\n var c2_lo = shr64_lo(xh, xl, 6);\n\n var r = c0_lo ^ c1_lo ^ c2_lo;\n if (r < 0)\n r += 0x100000000;\n return r;\n}\n","'use strict';\n\nvar utils = require('../utils');\n\nvar SHA512 = require('./512');\n\nfunction SHA384() {\n if (!(this instanceof SHA384))\n return new SHA384();\n\n SHA512.call(this);\n this.h = [\n 0xcbbb9d5d, 0xc1059ed8,\n 0x629a292a, 0x367cd507,\n 0x9159015a, 0x3070dd17,\n 0x152fecd8, 0xf70e5939,\n 0x67332667, 0xffc00b31,\n 0x8eb44a87, 0x68581511,\n 0xdb0c2e0d, 0x64f98fa7,\n 0x47b5481d, 0xbefa4fa4 ];\n}\nutils.inherits(SHA384, SHA512);\nmodule.exports = SHA384;\n\nSHA384.blockSize = 1024;\nSHA384.outSize = 384;\nSHA384.hmacStrength = 192;\nSHA384.padLength = 128;\n\nSHA384.prototype._digest = function digest(enc) {\n if (enc === 'hex')\n return utils.toHex32(this.h.slice(0, 12), 'big');\n else\n return utils.split32(this.h.slice(0, 12), 'big');\n};\n","'use strict';\n\nvar utils = require('./utils');\nvar common = require('./common');\n\nvar rotl32 = utils.rotl32;\nvar sum32 = utils.sum32;\nvar sum32_3 = utils.sum32_3;\nvar sum32_4 = utils.sum32_4;\nvar BlockHash = common.BlockHash;\n\nfunction RIPEMD160() {\n if (!(this instanceof RIPEMD160))\n return new RIPEMD160();\n\n BlockHash.call(this);\n\n this.h = [ 0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0 ];\n this.endian = 'little';\n}\nutils.inherits(RIPEMD160, BlockHash);\nexports.ripemd160 = RIPEMD160;\n\nRIPEMD160.blockSize = 512;\nRIPEMD160.outSize = 160;\nRIPEMD160.hmacStrength = 192;\nRIPEMD160.padLength = 64;\n\nRIPEMD160.prototype._update = function update(msg, start) {\n var A = this.h[0];\n var B = this.h[1];\n var C = this.h[2];\n var D = this.h[3];\n var E = this.h[4];\n var Ah = A;\n var Bh = B;\n var Ch = C;\n var Dh = D;\n var Eh = E;\n for (var j = 0; j < 80; j++) {\n var T = sum32(\n rotl32(\n sum32_4(A, f(j, B, C, D), msg[r[j] + start], K(j)),\n s[j]),\n E);\n A = E;\n E = D;\n D = rotl32(C, 10);\n C = B;\n B = T;\n T = sum32(\n rotl32(\n sum32_4(Ah, f(79 - j, Bh, Ch, Dh), msg[rh[j] + start], Kh(j)),\n sh[j]),\n Eh);\n Ah = Eh;\n Eh = Dh;\n Dh = rotl32(Ch, 10);\n Ch = Bh;\n Bh = T;\n }\n T = sum32_3(this.h[1], C, Dh);\n this.h[1] = sum32_3(this.h[2], D, Eh);\n this.h[2] = sum32_3(this.h[3], E, Ah);\n this.h[3] = sum32_3(this.h[4], A, Bh);\n this.h[4] = sum32_3(this.h[0], B, Ch);\n this.h[0] = T;\n};\n\nRIPEMD160.prototype._digest = function digest(enc) {\n if (enc === 'hex')\n return utils.toHex32(this.h, 'little');\n else\n return utils.split32(this.h, 'little');\n};\n\nfunction f(j, x, y, z) {\n if (j <= 15)\n return x ^ y ^ z;\n else if (j <= 31)\n return (x & y) | ((~x) & z);\n else if (j <= 47)\n return (x | (~y)) ^ z;\n else if (j <= 63)\n return (x & z) | (y & (~z));\n else\n return x ^ (y | (~z));\n}\n\nfunction K(j) {\n if (j <= 15)\n return 0x00000000;\n else if (j <= 31)\n return 0x5a827999;\n else if (j <= 47)\n return 0x6ed9eba1;\n else if (j <= 63)\n return 0x8f1bbcdc;\n else\n return 0xa953fd4e;\n}\n\nfunction Kh(j) {\n if (j <= 15)\n return 0x50a28be6;\n else if (j <= 31)\n return 0x5c4dd124;\n else if (j <= 47)\n return 0x6d703ef3;\n else if (j <= 63)\n return 0x7a6d76e9;\n else\n return 0x00000000;\n}\n\nvar r = [\n 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,\n 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8,\n 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12,\n 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2,\n 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13\n];\n\nvar rh = [\n 5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12,\n 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2,\n 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13,\n 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14,\n 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11\n];\n\nvar s = [\n 11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8,\n 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12,\n 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5,\n 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12,\n 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6\n];\n\nvar sh = [\n 8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6,\n 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11,\n 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5,\n 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8,\n 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11\n];\n","/**\n * A fast MD5 JavaScript implementation\n * Copyright (c) 2012 Joseph Myers\n * http://www.myersdaily.org/joseph/javascript/md5-text.html\n *\n * Permission to use, copy, modify, and distribute this software\n * and its documentation for any purposes and without\n * fee is hereby granted provided that this copyright notice\n * appears in all copies.\n *\n * Of course, this soft is provided \"as is\" without express or implied\n * warranty of any kind.\n */\n\nimport util from '../../util';\n\n// MD5 Digest\nasync function md5(entree) {\n const digest = md51(util.uint8ArrayToString(entree));\n return util.hexToUint8Array(hex(digest));\n}\n\nfunction md5cycle(x, k) {\n let a = x[0];\n let b = x[1];\n let c = x[2];\n let d = x[3];\n\n a = ff(a, b, c, d, k[0], 7, -680876936);\n d = ff(d, a, b, c, k[1], 12, -389564586);\n c = ff(c, d, a, b, k[2], 17, 606105819);\n b = ff(b, c, d, a, k[3], 22, -1044525330);\n a = ff(a, b, c, d, k[4], 7, -176418897);\n d = ff(d, a, b, c, k[5], 12, 1200080426);\n c = ff(c, d, a, b, k[6], 17, -1473231341);\n b = ff(b, c, d, a, k[7], 22, -45705983);\n a = ff(a, b, c, d, k[8], 7, 1770035416);\n d = ff(d, a, b, c, k[9], 12, -1958414417);\n c = ff(c, d, a, b, k[10], 17, -42063);\n b = ff(b, c, d, a, k[11], 22, -1990404162);\n a = ff(a, b, c, d, k[12], 7, 1804603682);\n d = ff(d, a, b, c, k[13], 12, -40341101);\n c = ff(c, d, a, b, k[14], 17, -1502002290);\n b = ff(b, c, d, a, k[15], 22, 1236535329);\n\n a = gg(a, b, c, d, k[1], 5, -165796510);\n d = gg(d, a, b, c, k[6], 9, -1069501632);\n c = gg(c, d, a, b, k[11], 14, 643717713);\n b = gg(b, c, d, a, k[0], 20, -373897302);\n a = gg(a, b, c, d, k[5], 5, -701558691);\n d = gg(d, a, b, c, k[10], 9, 38016083);\n c = gg(c, d, a, b, k[15], 14, -660478335);\n b = gg(b, c, d, a, k[4], 20, -405537848);\n a = gg(a, b, c, d, k[9], 5, 568446438);\n d = gg(d, a, b, c, k[14], 9, -1019803690);\n c = gg(c, d, a, b, k[3], 14, -187363961);\n b = gg(b, c, d, a, k[8], 20, 1163531501);\n a = gg(a, b, c, d, k[13], 5, -1444681467);\n d = gg(d, a, b, c, k[2], 9, -51403784);\n c = gg(c, d, a, b, k[7], 14, 1735328473);\n b = gg(b, c, d, a, k[12], 20, -1926607734);\n\n a = hh(a, b, c, d, k[5], 4, -378558);\n d = hh(d, a, b, c, k[8], 11, -2022574463);\n c = hh(c, d, a, b, k[11], 16, 1839030562);\n b = hh(b, c, d, a, k[14], 23, -35309556);\n a = hh(a, b, c, d, k[1], 4, -1530992060);\n d = hh(d, a, b, c, k[4], 11, 1272893353);\n c = hh(c, d, a, b, k[7], 16, -155497632);\n b = hh(b, c, d, a, k[10], 23, -1094730640);\n a = hh(a, b, c, d, k[13], 4, 681279174);\n d = hh(d, a, b, c, k[0], 11, -358537222);\n c = hh(c, d, a, b, k[3], 16, -722521979);\n b = hh(b, c, d, a, k[6], 23, 76029189);\n a = hh(a, b, c, d, k[9], 4, -640364487);\n d = hh(d, a, b, c, k[12], 11, -421815835);\n c = hh(c, d, a, b, k[15], 16, 530742520);\n b = hh(b, c, d, a, k[2], 23, -995338651);\n\n a = ii(a, b, c, d, k[0], 6, -198630844);\n d = ii(d, a, b, c, k[7], 10, 1126891415);\n c = ii(c, d, a, b, k[14], 15, -1416354905);\n b = ii(b, c, d, a, k[5], 21, -57434055);\n a = ii(a, b, c, d, k[12], 6, 1700485571);\n d = ii(d, a, b, c, k[3], 10, -1894986606);\n c = ii(c, d, a, b, k[10], 15, -1051523);\n b = ii(b, c, d, a, k[1], 21, -2054922799);\n a = ii(a, b, c, d, k[8], 6, 1873313359);\n d = ii(d, a, b, c, k[15], 10, -30611744);\n c = ii(c, d, a, b, k[6], 15, -1560198380);\n b = ii(b, c, d, a, k[13], 21, 1309151649);\n a = ii(a, b, c, d, k[4], 6, -145523070);\n d = ii(d, a, b, c, k[11], 10, -1120210379);\n c = ii(c, d, a, b, k[2], 15, 718787259);\n b = ii(b, c, d, a, k[9], 21, -343485551);\n\n x[0] = add32(a, x[0]);\n x[1] = add32(b, x[1]);\n x[2] = add32(c, x[2]);\n x[3] = add32(d, x[3]);\n}\n\nfunction cmn(q, a, b, x, s, t) {\n a = add32(add32(a, q), add32(x, t));\n return add32((a << s) | (a >>> (32 - s)), b);\n}\n\nfunction ff(a, b, c, d, x, s, t) {\n return cmn((b & c) | ((~b) & d), a, b, x, s, t);\n}\n\nfunction gg(a, b, c, d, x, s, t) {\n return cmn((b & d) | (c & (~d)), a, b, x, s, t);\n}\n\nfunction hh(a, b, c, d, x, s, t) {\n return cmn(b ^ c ^ d, a, b, x, s, t);\n}\n\nfunction ii(a, b, c, d, x, s, t) {\n return cmn(c ^ (b | (~d)), a, b, x, s, t);\n}\n\nfunction md51(s) {\n const n = s.length;\n const state = [1732584193, -271733879, -1732584194, 271733878];\n let i;\n for (i = 64; i <= s.length; i += 64) {\n md5cycle(state, md5blk(s.substring(i - 64, i)));\n }\n s = s.substring(i - 64);\n const tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];\n for (i = 0; i < s.length; i++) {\n tail[i >> 2] |= s.charCodeAt(i) << ((i % 4) << 3);\n }\n tail[i >> 2] |= 0x80 << ((i % 4) << 3);\n if (i > 55) {\n md5cycle(state, tail);\n for (i = 0; i < 16; i++) {\n tail[i] = 0;\n }\n }\n tail[14] = n * 8;\n md5cycle(state, tail);\n return state;\n}\n\n/* there needs to be support for Unicode here,\n * unless we pretend that we can redefine the MD-5\n * algorithm for multi-byte characters (perhaps\n * by adding every four 16-bit characters and\n * shortening the sum to 32 bits). Otherwise\n * I suggest performing MD-5 as if every character\n * was two bytes--e.g., 0040 0025 = @%--but then\n * how will an ordinary MD-5 sum be matched?\n * There is no way to standardize text to something\n * like UTF-8 before transformation; speed cost is\n * utterly prohibitive. The JavaScript standard\n * itself needs to look at this: it should start\n * providing access to strings as preformed UTF-8\n * 8-bit unsigned value arrays.\n */\nfunction md5blk(s) { /* I figured global was faster. */\n const md5blks = [];\n let i; /* Andy King said do it this way. */\n for (i = 0; i < 64; i += 4) {\n md5blks[i >> 2] = s.charCodeAt(i) + (s.charCodeAt(i + 1) << 8) + (s.charCodeAt(i + 2) << 16) + (s.charCodeAt(i + 3) <<\n 24);\n }\n return md5blks;\n}\n\nconst hex_chr = '0123456789abcdef'.split('');\n\nfunction rhex(n) {\n let s = '';\n let j = 0;\n for (; j < 4; j++) {\n s += hex_chr[(n >> (j * 8 + 4)) & 0x0F] + hex_chr[(n >> (j * 8)) & 0x0F];\n }\n return s;\n}\n\nfunction hex(x) {\n for (let i = 0; i < x.length; i++) {\n x[i] = rhex(x[i]);\n }\n return x.join('');\n}\n\n/* this function is much faster,\nso if possible we use it. Some IEs\nare the only ones I know of that\nneed the idiotic second function,\ngenerated by an if clause. */\n\nfunction add32(a, b) {\n return (a + b) & 0xFFFFFFFF;\n}\n\nexport default md5;\n","/**\n * @fileoverview Provides an interface to hashing functions available in Node.js or external libraries.\n * @see {@link https://github.com/asmcrypto/asmcrypto.js|asmCrypto}\n * @see {@link https://github.com/indutny/hash.js|hash.js}\n * @module crypto/hash\n * @private\n */\n\nimport { Sha1 } from '@openpgp/asmcrypto.js/dist_es8/hash/sha1/sha1';\nimport { Sha256 } from '@openpgp/asmcrypto.js/dist_es8/hash/sha256/sha256';\nimport sha224 from 'hash.js/lib/hash/sha/224';\nimport sha384 from 'hash.js/lib/hash/sha/384';\nimport sha512 from 'hash.js/lib/hash/sha/512';\nimport { ripemd160 } from 'hash.js/lib/hash/ripemd';\nimport * as stream from '@openpgp/web-stream-tools';\nimport md5 from './md5';\nimport util from '../../util';\nimport defaultConfig from '../../config';\nimport enums from '../../enums';\n\nconst webCrypto = util.getWebCrypto();\nconst nodeCrypto = util.getNodeCrypto();\nconst nodeCryptoHashes = nodeCrypto && nodeCrypto.getHashes();\n\nfunction nodeHash(type) {\n if (!nodeCrypto || !nodeCryptoHashes.includes(type)) {\n return;\n }\n return async function (data) {\n const shasum = nodeCrypto.createHash(type);\n return stream.transform(data, value => {\n shasum.update(value);\n }, () => new Uint8Array(shasum.digest()));\n };\n}\n\nfunction hashjsHash(hash, webCryptoHash) {\n return async function(data, config = defaultConfig) {\n if (stream.isArrayStream(data)) {\n data = await stream.readToEnd(data);\n }\n if (!util.isStream(data) && webCrypto && webCryptoHash && data.length >= config.minBytesForWebCrypto) {\n return new Uint8Array(await webCrypto.digest(webCryptoHash, data));\n }\n const hashInstance = hash();\n return stream.transform(data, value => {\n hashInstance.update(value);\n }, () => new Uint8Array(hashInstance.digest()));\n };\n}\n\nfunction asmcryptoHash(hash, webCryptoHash) {\n return async function(data, config = defaultConfig) {\n if (stream.isArrayStream(data)) {\n data = await stream.readToEnd(data);\n }\n if (util.isStream(data)) {\n const hashInstance = new hash();\n return stream.transform(data, value => {\n hashInstance.process(value);\n }, () => hashInstance.finish().result);\n } else if (webCrypto && webCryptoHash && data.length >= config.minBytesForWebCrypto) {\n return new Uint8Array(await webCrypto.digest(webCryptoHash, data));\n } else {\n return hash.bytes(data);\n }\n };\n}\n\nconst hashFunctions = {\n md5: nodeHash('md5') || md5,\n sha1: nodeHash('sha1') || asmcryptoHash(Sha1, 'SHA-1'),\n sha224: nodeHash('sha224') || hashjsHash(sha224),\n sha256: nodeHash('sha256') || asmcryptoHash(Sha256, 'SHA-256'),\n sha384: nodeHash('sha384') || hashjsHash(sha384, 'SHA-384'),\n sha512: nodeHash('sha512') || hashjsHash(sha512, 'SHA-512'), // asmcrypto sha512 is huge.\n ripemd: nodeHash('ripemd160') || hashjsHash(ripemd160)\n};\n\nexport default {\n\n /** @see module:md5 */\n md5: hashFunctions.md5,\n /** @see asmCrypto */\n sha1: hashFunctions.sha1,\n /** @see hash.js */\n sha224: hashFunctions.sha224,\n /** @see asmCrypto */\n sha256: hashFunctions.sha256,\n /** @see hash.js */\n sha384: hashFunctions.sha384,\n /** @see asmCrypto */\n sha512: hashFunctions.sha512,\n /** @see hash.js */\n ripemd: hashFunctions.ripemd,\n\n /**\n * Create a hash on the specified data using the specified algorithm\n * @param {module:enums.hash} algo - Hash algorithm type (see {@link https://tools.ietf.org/html/rfc4880#section-9.4|RFC 4880 9.4})\n * @param {Uint8Array} data - Data to be hashed\n * @returns {Promise<Uint8Array>} Hash value.\n */\n digest: function(algo, data) {\n switch (algo) {\n case enums.hash.md5:\n return this.md5(data);\n case enums.hash.sha1:\n return this.sha1(data);\n case enums.hash.ripemd:\n return this.ripemd(data);\n case enums.hash.sha256:\n return this.sha256(data);\n case enums.hash.sha384:\n return this.sha384(data);\n case enums.hash.sha512:\n return this.sha512(data);\n case enums.hash.sha224:\n return this.sha224(data);\n default:\n throw new Error('Invalid hash function.');\n }\n },\n\n /**\n * Returns the hash size in bytes of the specified hash algorithm type\n * @param {module:enums.hash} algo - Hash algorithm type (See {@link https://tools.ietf.org/html/rfc4880#section-9.4|RFC 4880 9.4})\n * @returns {Integer} Size in bytes of the resulting hash.\n */\n getHashByteLength: function(algo) {\n switch (algo) {\n case enums.hash.md5:\n return 16;\n case enums.hash.sha1:\n case enums.hash.ripemd:\n return 20;\n case enums.hash.sha256:\n return 32;\n case enums.hash.sha384:\n return 48;\n case enums.hash.sha512:\n return 64;\n case enums.hash.sha224:\n return 28;\n default:\n throw new Error('Invalid hash algorithm.');\n }\n }\n};\n","import { AES } from './aes';\nimport { joinBytes } from '../other/utils';\nexport class AES_CFB {\n static encrypt(data, key, iv) {\n return new AES_CFB(key, iv).encrypt(data);\n }\n static decrypt(data, key, iv) {\n return new AES_CFB(key, iv).decrypt(data);\n }\n constructor(key, iv, aes) {\n this.aes = aes ? aes : new AES(key, iv, true, 'CFB');\n delete this.aes.padding;\n }\n encrypt(data) {\n const r1 = this.aes.AES_Encrypt_process(data);\n const r2 = this.aes.AES_Encrypt_finish();\n return joinBytes(r1, r2);\n }\n decrypt(data) {\n const r1 = this.aes.AES_Decrypt_process(data);\n const r2 = this.aes.AES_Decrypt_finish();\n return joinBytes(r1, r2);\n }\n}\n","import * as cipher from '.';\nimport enums from '../../enums';\n\n/**\n * Get implementation of the given cipher\n * @param {enums.symmetric} algo\n * @returns {Object}\n * @throws {Error} on invalid algo\n */\nexport default function getCipher(algo) {\n const algoName = enums.read(enums.symmetric, algo);\n return cipher[algoName];\n}\n","// Modified by ProtonTech AG\n\n// Modified by Recurity Labs GmbH\n\n// modified version of https://www.hanewin.net/encrypt/PGdecode.js:\n\n/* OpenPGP encryption using RSA/AES\n * Copyright 2005-2006 Herbert Hanewinkel, www.haneWIN.de\n * version 2.0, check www.haneWIN.de for the latest version\n\n * This software is provided as-is, without express or implied warranty.\n * Permission to use, copy, modify, distribute or sell this software, with or\n * without fee, for any purpose and by any individual or organization, is hereby\n * granted, provided that the above copyright notice and this paragraph appear\n * in all copies. Distribution as a part of an application or binary must\n * include the above copyright notice in the documentation and/or other\n * materials provided with the application or distribution.\n */\n\n/**\n * @module crypto/mode/cfb\n * @private\n */\n\nimport { AES_CFB } from '@openpgp/asmcrypto.js/dist_es8/aes/cfb';\nimport * as stream from '@openpgp/web-stream-tools';\nimport getCipher from '../cipher/getCipher';\nimport util from '../../util';\nimport enums from '../../enums';\n\nconst webCrypto = util.getWebCrypto();\nconst nodeCrypto = util.getNodeCrypto();\n\nconst knownAlgos = nodeCrypto ? nodeCrypto.getCiphers() : [];\nconst nodeAlgos = {\n idea: knownAlgos.includes('idea-cfb') ? 'idea-cfb' : undefined, /* Unused, not implemented */\n tripledes: knownAlgos.includes('des-ede3-cfb') ? 'des-ede3-cfb' : undefined,\n cast5: knownAlgos.includes('cast5-cfb') ? 'cast5-cfb' : undefined,\n blowfish: knownAlgos.includes('bf-cfb') ? 'bf-cfb' : undefined,\n aes128: knownAlgos.includes('aes-128-cfb') ? 'aes-128-cfb' : undefined,\n aes192: knownAlgos.includes('aes-192-cfb') ? 'aes-192-cfb' : undefined,\n aes256: knownAlgos.includes('aes-256-cfb') ? 'aes-256-cfb' : undefined\n /* twofish is not implemented in OpenSSL */\n};\n\n/**\n * CFB encryption\n * @param {enums.symmetric} algo - block cipher algorithm\n * @param {Uint8Array} key\n * @param {MaybeStream<Uint8Array>} plaintext\n * @param {Uint8Array} iv\n * @param {Object} config - full configuration, defaults to openpgp.config\n * @returns MaybeStream<Uint8Array>\n */\nexport async function encrypt(algo, key, plaintext, iv, config) {\n const algoName = enums.read(enums.symmetric, algo);\n if (util.getNodeCrypto() && nodeAlgos[algoName]) { // Node crypto library.\n return nodeEncrypt(algo, key, plaintext, iv);\n }\n if (algoName.substr(0, 3) === 'aes') {\n return aesEncrypt(algo, key, plaintext, iv, config);\n }\n\n const Cipher = getCipher(algo);\n const cipherfn = new Cipher(key);\n const block_size = cipherfn.blockSize;\n\n const blockc = iv.slice();\n let pt = new Uint8Array();\n const process = chunk => {\n if (chunk) {\n pt = util.concatUint8Array([pt, chunk]);\n }\n const ciphertext = new Uint8Array(pt.length);\n let i;\n let j = 0;\n while (chunk ? pt.length >= block_size : pt.length) {\n const encblock = cipherfn.encrypt(blockc);\n for (i = 0; i < block_size; i++) {\n blockc[i] = pt[i] ^ encblock[i];\n ciphertext[j++] = blockc[i];\n }\n pt = pt.subarray(block_size);\n }\n return ciphertext.subarray(0, j);\n };\n return stream.transform(plaintext, process, process);\n}\n\n/**\n * CFB decryption\n * @param {enums.symmetric} algo - block cipher algorithm\n * @param {Uint8Array} key\n * @param {MaybeStream<Uint8Array>} ciphertext\n * @param {Uint8Array} iv\n * @returns MaybeStream<Uint8Array>\n */\nexport async function decrypt(algo, key, ciphertext, iv) {\n const algoName = enums.read(enums.symmetric, algo);\n if (util.getNodeCrypto() && nodeAlgos[algoName]) { // Node crypto library.\n return nodeDecrypt(algo, key, ciphertext, iv);\n }\n if (algoName.substr(0, 3) === 'aes') {\n return aesDecrypt(algo, key, ciphertext, iv);\n }\n\n const Cipher = getCipher(algo);\n const cipherfn = new Cipher(key);\n const block_size = cipherfn.blockSize;\n\n let blockp = iv;\n let ct = new Uint8Array();\n const process = chunk => {\n if (chunk) {\n ct = util.concatUint8Array([ct, chunk]);\n }\n const plaintext = new Uint8Array(ct.length);\n let i;\n let j = 0;\n while (chunk ? ct.length >= block_size : ct.length) {\n const decblock = cipherfn.encrypt(blockp);\n blockp = ct;\n for (i = 0; i < block_size; i++) {\n plaintext[j++] = blockp[i] ^ decblock[i];\n }\n ct = ct.subarray(block_size);\n }\n return plaintext.subarray(0, j);\n };\n return stream.transform(ciphertext, process, process);\n}\n\nfunction aesEncrypt(algo, key, pt, iv, config) {\n if (\n util.getWebCrypto() &&\n key.length !== 24 && // Chrome doesn't support 192 bit keys, see https://www.chromium.org/blink/webcrypto#TOC-AES-support\n !util.isStream(pt) &&\n pt.length >= 3000 * config.minBytesForWebCrypto // Default to a 3MB minimum. Chrome is pretty slow for small messages, see: https://bugs.chromium.org/p/chromium/issues/detail?id=701188#c2\n ) { // Web Crypto\n return webEncrypt(algo, key, pt, iv);\n }\n // asm.js fallback\n const cfb = new AES_CFB(key, iv);\n return stream.transform(pt, value => cfb.aes.AES_Encrypt_process(value), () => cfb.aes.AES_Encrypt_finish());\n}\n\nfunction aesDecrypt(algo, key, ct, iv) {\n if (util.isStream(ct)) {\n const cfb = new AES_CFB(key, iv);\n return stream.transform(ct, value => cfb.aes.AES_Decrypt_process(value), () => cfb.aes.AES_Decrypt_finish());\n }\n return AES_CFB.decrypt(ct, key, iv);\n}\n\nfunction xorMut(a, b) {\n for (let i = 0; i < a.length; i++) {\n a[i] = a[i] ^ b[i];\n }\n}\n\nasync function webEncrypt(algo, key, pt, iv) {\n const ALGO = 'AES-CBC';\n const _key = await webCrypto.importKey('raw', key, { name: ALGO }, false, ['encrypt']);\n const { blockSize } = getCipher(algo);\n const cbc_pt = util.concatUint8Array([new Uint8Array(blockSize), pt]);\n const ct = new Uint8Array(await webCrypto.encrypt({ name: ALGO, iv }, _key, cbc_pt)).subarray(0, pt.length);\n xorMut(ct, pt);\n return ct;\n}\n\nfunction nodeEncrypt(algo, key, pt, iv) {\n const algoName = enums.read(enums.symmetric, algo);\n const cipherObj = new nodeCrypto.createCipheriv(nodeAlgos[algoName], key, iv);\n return stream.transform(pt, value => new Uint8Array(cipherObj.update(value)));\n}\n\nfunction nodeDecrypt(algo, key, ct, iv) {\n const algoName = enums.read(enums.symmetric, algo);\n const decipherObj = new nodeCrypto.createDecipheriv(nodeAlgos[algoName], key, iv);\n return stream.transform(ct, value => new Uint8Array(decipherObj.update(value)));\n}\n","import { AES } from './aes';\nimport { IllegalArgumentError } from '../other/errors';\nimport { joinBytes } from '../other/utils';\nexport class AES_CTR {\n static encrypt(data, key, nonce) {\n return new AES_CTR(key, nonce).encrypt(data);\n }\n static decrypt(data, key, nonce) {\n return new AES_CTR(key, nonce).encrypt(data);\n }\n constructor(key, nonce, aes) {\n this.aes = aes ? aes : new AES(key, undefined, false, 'CTR');\n delete this.aes.padding;\n this.AES_CTR_set_options(nonce);\n }\n encrypt(data) {\n const r1 = this.aes.AES_Encrypt_process(data);\n const r2 = this.aes.AES_Encrypt_finish();\n return joinBytes(r1, r2);\n }\n decrypt(data) {\n const r1 = this.aes.AES_Encrypt_process(data);\n const r2 = this.aes.AES_Encrypt_finish();\n return joinBytes(r1, r2);\n }\n AES_CTR_set_options(nonce, counter, size) {\n let { asm } = this.aes.acquire_asm();\n if (size !== undefined) {\n if (size < 8 || size > 48)\n throw new IllegalArgumentError('illegal counter size');\n let mask = Math.pow(2, size) - 1;\n asm.set_mask(0, 0, (mask / 0x100000000) | 0, mask | 0);\n }\n else {\n size = 48;\n asm.set_mask(0, 0, 0xffff, 0xffffffff);\n }\n if (nonce !== undefined) {\n let len = nonce.length;\n if (!len || len > 16)\n throw new IllegalArgumentError('illegal nonce size');\n let view = new DataView(new ArrayBuffer(16));\n new Uint8Array(view.buffer).set(nonce);\n asm.set_nonce(view.getUint32(0), view.getUint32(4), view.getUint32(8), view.getUint32(12));\n }\n else {\n throw new Error('nonce is required');\n }\n if (counter !== undefined) {\n if (counter < 0 || counter >= Math.pow(2, size))\n throw new IllegalArgumentError('illegal counter value');\n asm.set_counter(0, 0, (counter / 0x100000000) | 0, counter | 0);\n }\n }\n}\n","import { AES } from './aes';\nimport { joinBytes } from '../other/utils';\nexport class AES_CBC {\n static encrypt(data, key, padding = true, iv) {\n return new AES_CBC(key, iv, padding).encrypt(data);\n }\n static decrypt(data, key, padding = true, iv) {\n return new AES_CBC(key, iv, padding).decrypt(data);\n }\n constructor(key, iv, padding = true, aes) {\n this.aes = aes ? aes : new AES(key, iv, padding, 'CBC');\n }\n encrypt(data) {\n const r1 = this.aes.AES_Encrypt_process(data);\n const r2 = this.aes.AES_Encrypt_finish();\n return joinBytes(r1, r2);\n }\n decrypt(data) {\n const r1 = this.aes.AES_Decrypt_process(data);\n const r2 = this.aes.AES_Decrypt_finish();\n return joinBytes(r1, r2);\n }\n}\n","/**\n * @fileoverview This module implements AES-CMAC on top of\n * native AES-CBC using either the WebCrypto API or Node.js' crypto API.\n * @module crypto/cmac\n * @private\n */\n\nimport { AES_CBC } from '@openpgp/asmcrypto.js/dist_es8/aes/cbc';\nimport util from '../util';\n\nconst webCrypto = util.getWebCrypto();\nconst nodeCrypto = util.getNodeCrypto();\n\n\n/**\n * This implementation of CMAC is based on the description of OMAC in\n * http://web.cs.ucdavis.edu/~rogaway/papers/eax.pdf. As per that\n * document:\n *\n * We have made a small modification to the OMAC algorithm as it was\n * originally presented, changing one of its two constants.\n * Specifically, the constant 4 at line 85 was the constant 1/2 (the\n * multiplicative inverse of 2) in the original definition of OMAC [14].\n * The OMAC authors indicate that they will promulgate this modification\n * [15], which slightly simplifies implementations.\n */\n\nconst blockLength = 16;\n\n\n/**\n * xor `padding` into the end of `data`. This function implements \"the\n * operation xor→ [which] xors the shorter string into the end of longer\n * one\". Since data is always as least as long as padding, we can\n * simplify the implementation.\n * @param {Uint8Array} data\n * @param {Uint8Array} padding\n */\nfunction rightXORMut(data, padding) {\n const offset = data.length - blockLength;\n for (let i = 0; i < blockLength; i++) {\n data[i + offset] ^= padding[i];\n }\n return data;\n}\n\nfunction pad(data, padding, padding2) {\n // if |M| in {n, 2n, 3n, ...}\n if (data.length && data.length % blockLength === 0) {\n // then return M xor→ B,\n return rightXORMut(data, padding);\n }\n // else return (M || 10^(n−1−(|M| mod n))) xor→ P\n const padded = new Uint8Array(data.length + (blockLength - (data.length % blockLength)));\n padded.set(data);\n padded[data.length] = 0b10000000;\n return rightXORMut(padded, padding2);\n}\n\nconst zeroBlock = new Uint8Array(blockLength);\n\nexport default async function CMAC(key) {\n const cbc = await CBC(key);\n\n // L ← E_K(0^n); B ← 2L; P ← 4L\n const padding = util.double(await cbc(zeroBlock));\n const padding2 = util.double(padding);\n\n return async function(data) {\n // return CBC_K(pad(M; B, P))\n return (await cbc(pad(data, padding, padding2))).subarray(-blockLength);\n };\n}\n\nasync function CBC(key) {\n if (util.getWebCrypto() && key.length !== 24) { // WebCrypto (no 192 bit support) see: https://www.chromium.org/blink/webcrypto#TOC-AES-support\n key = await webCrypto.importKey('raw', key, { name: 'AES-CBC', length: key.length * 8 }, false, ['encrypt']);\n return async function(pt) {\n const ct = await webCrypto.encrypt({ name: 'AES-CBC', iv: zeroBlock, length: blockLength * 8 }, key, pt);\n return new Uint8Array(ct).subarray(0, ct.byteLength - blockLength);\n };\n }\n if (util.getNodeCrypto()) { // Node crypto library\n return async function(pt) {\n const en = new nodeCrypto.createCipheriv('aes-' + (key.length * 8) + '-cbc', key, zeroBlock);\n const ct = en.update(pt);\n return new Uint8Array(ct);\n };\n }\n // asm.js fallback\n return async function(pt) {\n return AES_CBC.encrypt(pt, key, false, zeroBlock);\n };\n}\n","// OpenPGP.js - An OpenPGP implementation in javascript\n// Copyright (C) 2018 ProtonTech AG\n//\n// This library is free software; you can redistribute it and/or\n// modify it under the terms of the GNU Lesser General Public\n// License as published by the Free Software Foundation; either\n// version 3.0 of the License, or (at your option) any later version.\n//\n// This library is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n// Lesser General Public License for more details.\n//\n// You should have received a copy of the GNU Lesser General Public\n// License along with this library; if not, write to the Free Software\n// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n\n/**\n * @fileoverview This module implements AES-EAX en/decryption on top of\n * native AES-CTR using either the WebCrypto API or Node.js' crypto API.\n * @module crypto/mode/eax\n * @private\n */\n\nimport { AES_CTR } from '@openpgp/asmcrypto.js/dist_es8/aes/ctr';\nimport CMAC from '../cmac';\nimport util from '../../util';\nimport enums from '../../enums';\n\nconst webCrypto = util.getWebCrypto();\nconst nodeCrypto = util.getNodeCrypto();\nconst Buffer = util.getNodeBuffer();\n\n\nconst blockLength = 16;\nconst ivLength = blockLength;\nconst tagLength = blockLength;\n\nconst zero = new Uint8Array(blockLength);\nconst one = new Uint8Array(blockLength); one[blockLength - 1] = 1;\nconst two = new Uint8Array(blockLength); two[blockLength - 1] = 2;\n\nasync function OMAC(key) {\n const cmac = await CMAC(key);\n return function(t, message) {\n return cmac(util.concatUint8Array([t, message]));\n };\n}\n\nasync function CTR(key) {\n if (\n util.getWebCrypto() &&\n key.length !== 24 // WebCrypto (no 192 bit support) see: https://www.chromium.org/blink/webcrypto#TOC-AES-support\n ) {\n key = await webCrypto.importKey('raw', key, { name: 'AES-CTR', length: key.length * 8 }, false, ['encrypt']);\n return async function(pt, iv) {\n const ct = await webCrypto.encrypt({ name: 'AES-CTR', counter: iv, length: blockLength * 8 }, key, pt);\n return new Uint8Array(ct);\n };\n }\n if (util.getNodeCrypto()) { // Node crypto library\n return async function(pt, iv) {\n const en = new nodeCrypto.createCipheriv('aes-' + (key.length * 8) + '-ctr', key, iv);\n const ct = Buffer.concat([en.update(pt), en.final()]);\n return new Uint8Array(ct);\n };\n }\n // asm.js fallback\n return async function(pt, iv) {\n return AES_CTR.encrypt(pt, key, iv);\n };\n}\n\n\n/**\n * Class to en/decrypt using EAX mode.\n * @param {enums.symmetric} cipher - The symmetric cipher algorithm to use\n * @param {Uint8Array} key - The encryption key\n */\nasync function EAX(cipher, key) {\n if (cipher !== enums.symmetric.aes128 &&\n cipher !== enums.symmetric.aes192 &&\n cipher !== enums.symmetric.aes256) {\n throw new Error('EAX mode supports only AES cipher');\n }\n\n const [\n omac,\n ctr\n ] = await Promise.all([\n OMAC(key),\n CTR(key)\n ]);\n\n return {\n /**\n * Encrypt plaintext input.\n * @param {Uint8Array} plaintext - The cleartext input to be encrypted\n * @param {Uint8Array} nonce - The nonce (16 bytes)\n * @param {Uint8Array} adata - Associated data to sign\n * @returns {Promise<Uint8Array>} The ciphertext output.\n */\n encrypt: async function(plaintext, nonce, adata) {\n const [\n omacNonce,\n omacAdata\n ] = await Promise.all([\n omac(zero, nonce),\n omac(one, adata)\n ]);\n const ciphered = await ctr(plaintext, omacNonce);\n const omacCiphered = await omac(two, ciphered);\n const tag = omacCiphered; // Assumes that omac(*).length === tagLength.\n for (let i = 0; i < tagLength; i++) {\n tag[i] ^= omacAdata[i] ^ omacNonce[i];\n }\n return util.concatUint8Array([ciphered, tag]);\n },\n\n /**\n * Decrypt ciphertext input.\n * @param {Uint8Array} ciphertext - The ciphertext input to be decrypted\n * @param {Uint8Array} nonce - The nonce (16 bytes)\n * @param {Uint8Array} adata - Associated data to verify\n * @returns {Promise<Uint8Array>} The plaintext output.\n */\n decrypt: async function(ciphertext, nonce, adata) {\n if (ciphertext.length < tagLength) throw new Error('Invalid EAX ciphertext');\n const ciphered = ciphertext.subarray(0, -tagLength);\n const ctTag = ciphertext.subarray(-tagLength);\n const [\n omacNonce,\n omacAdata,\n omacCiphered\n ] = await Promise.all([\n omac(zero, nonce),\n omac(one, adata),\n omac(two, ciphered)\n ]);\n const tag = omacCiphered; // Assumes that omac(*).length === tagLength.\n for (let i = 0; i < tagLength; i++) {\n tag[i] ^= omacAdata[i] ^ omacNonce[i];\n }\n if (!util.equalsUint8Array(ctTag, tag)) throw new Error('Authentication tag mismatch');\n const plaintext = await ctr(ciphered, omacNonce);\n return plaintext;\n }\n };\n}\n\n\n/**\n * Get EAX nonce as defined by {@link https://tools.ietf.org/html/draft-ietf-openpgp-rfc4880bis-04#section-5.16.1|RFC4880bis-04, section 5.16.1}.\n * @param {Uint8Array} iv - The initialization vector (16 bytes)\n * @param {Uint8Array} chunkIndex - The chunk index (8 bytes)\n */\nEAX.getNonce = function(iv, chunkIndex) {\n const nonce = iv.slice();\n for (let i = 0; i < chunkIndex.length; i++) {\n nonce[8 + i] ^= chunkIndex[i];\n }\n return nonce;\n};\n\nEAX.blockLength = blockLength;\nEAX.ivLength = ivLength;\nEAX.tagLength = tagLength;\n\nexport default EAX;\n","// OpenPGP.js - An OpenPGP implementation in javascript\n// Copyright (C) 2018 ProtonTech AG\n//\n// This library is free software; you can redistribute it and/or\n// modify it under the terms of the GNU Lesser General Public\n// License as published by the Free Software Foundation; either\n// version 3.0 of the License, or (at your option) any later version.\n//\n// This library is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n// Lesser General Public License for more details.\n//\n// You should have received a copy of the GNU Lesser General Public\n// License along with this library; if not, write to the Free Software\n// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n\n/**\n * @fileoverview This module implements AES-OCB en/decryption.\n * @module crypto/mode/ocb\n * @private\n */\n\nimport * as ciphers from '../cipher';\nimport util from '../../util';\nimport enums from '../../enums';\n\nconst blockLength = 16;\nconst ivLength = 15;\n\n// https://tools.ietf.org/html/draft-ietf-openpgp-rfc4880bis-04#section-5.16.2:\n// While OCB [RFC7253] allows the authentication tag length to be of any\n// number up to 128 bits long, this document requires a fixed\n// authentication tag length of 128 bits (16 octets) for simplicity.\nconst tagLength = 16;\n\n\nfunction ntz(n) {\n let ntz = 0;\n for (let i = 1; (n & i) === 0; i <<= 1) {\n ntz++;\n }\n return ntz;\n}\n\nfunction xorMut(S, T) {\n for (let i = 0; i < S.length; i++) {\n S[i] ^= T[i];\n }\n return S;\n}\n\nfunction xor(S, T) {\n return xorMut(S.slice(), T);\n}\n\nconst zeroBlock = new Uint8Array(blockLength);\nconst one = new Uint8Array([1]);\n\n/**\n * Class to en/decrypt using OCB mode.\n * @param {enums.symmetric} cipher - The symmetric cipher algorithm to use\n * @param {Uint8Array} key - The encryption key\n */\nasync function OCB(cipher, key) {\n\n let maxNtz = 0;\n let encipher;\n let decipher;\n let mask;\n\n constructKeyVariables(cipher, key);\n\n function constructKeyVariables(cipher, key) {\n const cipherName = enums.read(enums.symmetric, cipher);\n const aes = new ciphers[cipherName](key);\n encipher = aes.encrypt.bind(aes);\n decipher = aes.decrypt.bind(aes);\n\n const mask_x = encipher(zeroBlock);\n const mask_$ = util.double(mask_x);\n mask = [];\n mask[0] = util.double(mask_$);\n\n\n mask.x = mask_x;\n mask.$ = mask_$;\n }\n\n function extendKeyVariables(text, adata) {\n const newMaxNtz = util.nbits(Math.max(text.length, adata.length) / blockLength | 0) - 1;\n for (let i = maxNtz + 1; i <= newMaxNtz; i++) {\n mask[i] = util.double(mask[i - 1]);\n }\n maxNtz = newMaxNtz;\n }\n\n function hash(adata) {\n if (!adata.length) {\n // Fast path\n return zeroBlock;\n }\n\n //\n // Consider A as a sequence of 128-bit blocks\n //\n const m = adata.length / blockLength | 0;\n\n const offset = new Uint8Array(blockLength);\n const sum = new Uint8Array(blockLength);\n for (let i = 0; i < m; i++) {\n xorMut(offset, mask[ntz(i + 1)]);\n xorMut(sum, encipher(xor(offset, adata)));\n adata = adata.subarray(blockLength);\n }\n\n //\n // Process any final partial block; compute final hash value\n //\n if (adata.length) {\n xorMut(offset, mask.x);\n\n const cipherInput = new Uint8Array(blockLength);\n cipherInput.set(adata, 0);\n cipherInput[adata.length] = 0b10000000;\n xorMut(cipherInput, offset);\n\n xorMut(sum, encipher(cipherInput));\n }\n\n return sum;\n }\n\n /**\n * Encrypt/decrypt data.\n * @param {encipher|decipher} fn - Encryption/decryption block cipher function\n * @param {Uint8Array} text - The cleartext or ciphertext (without tag) input\n * @param {Uint8Array} nonce - The nonce (15 bytes)\n * @param {Uint8Array} adata - Associated data to sign\n * @returns {Promise<Uint8Array>} The ciphertext or plaintext output, with tag appended in both cases.\n */\n function crypt(fn, text, nonce, adata) {\n //\n // Consider P as a sequence of 128-bit blocks\n //\n const m = text.length / blockLength | 0;\n\n //\n // Key-dependent variables\n //\n extendKeyVariables(text, adata);\n\n //\n // Nonce-dependent and per-encryption variables\n //\n // Nonce = num2str(TAGLEN mod 128,7) || zeros(120-bitlen(N)) || 1 || N\n // Note: We assume here that tagLength mod 16 == 0.\n const paddedNonce = util.concatUint8Array([zeroBlock.subarray(0, ivLength - nonce.length), one, nonce]);\n // bottom = str2num(Nonce[123..128])\n const bottom = paddedNonce[blockLength - 1] & 0b111111;\n // Ktop = ENCIPHER(K, Nonce[1..122] || zeros(6))\n paddedNonce[blockLength - 1] &= 0b11000000;\n const kTop = encipher(paddedNonce);\n // Stretch = Ktop || (Ktop[1..64] xor Ktop[9..72])\n const stretched = util.concatUint8Array([kTop, xor(kTop.subarray(0, 8), kTop.subarray(1, 9))]);\n // Offset_0 = Stretch[1+bottom..128+bottom]\n const offset = util.shiftRight(stretched.subarray(0 + (bottom >> 3), 17 + (bottom >> 3)), 8 - (bottom & 7)).subarray(1);\n // Checksum_0 = zeros(128)\n const checksum = new Uint8Array(blockLength);\n\n const ct = new Uint8Array(text.length + tagLength);\n\n //\n // Process any whole blocks\n //\n let i;\n let pos = 0;\n for (i = 0; i < m; i++) {\n // Offset_i = Offset_{i-1} xor L_{ntz(i)}\n xorMut(offset, mask[ntz(i + 1)]);\n // C_i = Offset_i xor ENCIPHER(K, P_i xor Offset_i)\n // P_i = Offset_i xor DECIPHER(K, C_i xor Offset_i)\n ct.set(xorMut(fn(xor(offset, text)), offset), pos);\n // Checksum_i = Checksum_{i-1} xor P_i\n xorMut(checksum, fn === encipher ? text : ct.subarray(pos));\n\n text = text.subarray(blockLength);\n pos += blockLength;\n }\n\n //\n // Process any final partial block and compute raw tag\n //\n if (text.length) {\n // Offset_* = Offset_m xor L_*\n xorMut(offset, mask.x);\n // Pad = ENCIPHER(K, Offset_*)\n const padding = encipher(offset);\n // C_* = P_* xor Pad[1..bitlen(P_*)]\n ct.set(xor(text, padding), pos);\n\n // Checksum_* = Checksum_m xor (P_* || 1 || new Uint8Array(127-bitlen(P_*)))\n const xorInput = new Uint8Array(blockLength);\n xorInput.set(fn === encipher ? text : ct.subarray(pos, -tagLength), 0);\n xorInput[text.length] = 0b10000000;\n xorMut(checksum, xorInput);\n pos += text.length;\n }\n // Tag = ENCIPHER(K, Checksum_* xor Offset_* xor L_$) xor HASH(K,A)\n const tag = xorMut(encipher(xorMut(xorMut(checksum, offset), mask.$)), hash(adata));\n\n //\n // Assemble ciphertext\n //\n // C = C_1 || C_2 || ... || C_m || C_* || Tag[1..TAGLEN]\n ct.set(tag, pos);\n return ct;\n }\n\n\n return {\n /**\n * Encrypt plaintext input.\n * @param {Uint8Array} plaintext - The cleartext input to be encrypted\n * @param {Uint8Array} nonce - The nonce (15 bytes)\n * @param {Uint8Array} adata - Associated data to sign\n * @returns {Promise<Uint8Array>} The ciphertext output.\n */\n encrypt: async function(plaintext, nonce, adata) {\n return crypt(encipher, plaintext, nonce, adata);\n },\n\n /**\n * Decrypt ciphertext input.\n * @param {Uint8Array} ciphertext - The ciphertext input to be decrypted\n * @param {Uint8Array} nonce - The nonce (15 bytes)\n * @param {Uint8Array} adata - Associated data to sign\n * @returns {Promise<Uint8Array>} The ciphertext output.\n */\n decrypt: async function(ciphertext, nonce, adata) {\n if (ciphertext.length < tagLength) throw new Error('Invalid OCB ciphertext');\n\n const tag = ciphertext.subarray(-tagLength);\n ciphertext = ciphertext.subarray(0, -tagLength);\n\n const crypted = crypt(decipher, ciphertext, nonce, adata);\n // if (Tag[1..TAGLEN] == T)\n if (util.equalsUint8Array(tag, crypted.subarray(-tagLength))) {\n return crypted.subarray(0, -tagLength);\n }\n throw new Error('Authentication tag mismatch');\n }\n };\n}\n\n\n/**\n * Get OCB nonce as defined by {@link https://tools.ietf.org/html/draft-ietf-openpgp-rfc4880bis-04#section-5.16.2|RFC4880bis-04, section 5.16.2}.\n * @param {Uint8Array} iv - The initialization vector (15 bytes)\n * @param {Uint8Array} chunkIndex - The chunk index (8 bytes)\n */\nOCB.getNonce = function(iv, chunkIndex) {\n const nonce = iv.slice();\n for (let i = 0; i < chunkIndex.length; i++) {\n nonce[7 + i] ^= chunkIndex[i];\n }\n return nonce;\n};\n\nOCB.blockLength = blockLength;\nOCB.ivLength = ivLength;\nOCB.tagLength = tagLength;\n\nexport default OCB;\n","import { IllegalArgumentError, IllegalStateError, SecurityError } from '../other/errors';\nimport { _heap_write } from '../other/utils';\nimport { AES } from './aes';\nimport { AES_asm } from './aes.asm';\nconst _AES_GCM_data_maxLength = 68719476704; // 2^36 - 2^5\nexport class AES_GCM {\n constructor(key, nonce, adata, tagSize = 16, aes) {\n this.tagSize = tagSize;\n this.gamma0 = 0;\n this.counter = 1;\n this.aes = aes ? aes : new AES(key, undefined, false, 'CTR');\n let { asm, heap } = this.aes.acquire_asm();\n // Init GCM\n asm.gcm_init();\n // Tag size\n if (this.tagSize < 4 || this.tagSize > 16)\n throw new IllegalArgumentError('illegal tagSize value');\n // Nonce\n const noncelen = nonce.length || 0;\n const noncebuf = new Uint8Array(16);\n if (noncelen !== 12) {\n this._gcm_mac_process(nonce);\n heap[0] = 0;\n heap[1] = 0;\n heap[2] = 0;\n heap[3] = 0;\n heap[4] = 0;\n heap[5] = 0;\n heap[6] = 0;\n heap[7] = 0;\n heap[8] = 0;\n heap[9] = 0;\n heap[10] = 0;\n heap[11] = noncelen >>> 29;\n heap[12] = (noncelen >>> 21) & 255;\n heap[13] = (noncelen >>> 13) & 255;\n heap[14] = (noncelen >>> 5) & 255;\n heap[15] = (noncelen << 3) & 255;\n asm.mac(AES_asm.MAC.GCM, AES_asm.HEAP_DATA, 16);\n asm.get_iv(AES_asm.HEAP_DATA);\n asm.set_iv(0, 0, 0, 0);\n noncebuf.set(heap.subarray(0, 16));\n }\n else {\n noncebuf.set(nonce);\n noncebuf[15] = 1;\n }\n const nonceview = new DataView(noncebuf.buffer);\n this.gamma0 = nonceview.getUint32(12);\n asm.set_nonce(nonceview.getUint32(0), nonceview.getUint32(4), nonceview.getUint32(8), 0);\n asm.set_mask(0, 0, 0, 0xffffffff);\n // Associated data\n if (adata !== undefined) {\n if (adata.length > _AES_GCM_data_maxLength)\n throw new IllegalArgumentError('illegal adata length');\n if (adata.length) {\n this.adata = adata;\n this._gcm_mac_process(adata);\n }\n else {\n this.adata = undefined;\n }\n }\n else {\n this.adata = undefined;\n }\n // Counter\n if (this.counter < 1 || this.counter > 0xffffffff)\n throw new RangeError('counter must be a positive 32-bit integer');\n asm.set_counter(0, 0, 0, (this.gamma0 + this.counter) | 0);\n }\n static encrypt(cleartext, key, nonce, adata, tagsize) {\n return new AES_GCM(key, nonce, adata, tagsize).encrypt(cleartext);\n }\n static decrypt(ciphertext, key, nonce, adata, tagsize) {\n return new AES_GCM(key, nonce, adata, tagsize).decrypt(ciphertext);\n }\n encrypt(data) {\n return this.AES_GCM_encrypt(data);\n }\n decrypt(data) {\n return this.AES_GCM_decrypt(data);\n }\n AES_GCM_Encrypt_process(data) {\n let dpos = 0;\n let dlen = data.length || 0;\n let { asm, heap } = this.aes.acquire_asm();\n let counter = this.counter;\n let pos = this.aes.pos;\n let len = this.aes.len;\n let rpos = 0;\n let rlen = (len + dlen) & -16;\n let wlen = 0;\n if (((counter - 1) << 4) + len + dlen > _AES_GCM_data_maxLength)\n throw new RangeError('counter overflow');\n const result = new Uint8Array(rlen);\n while (dlen > 0) {\n wlen = _heap_write(heap, pos + len, data, dpos, dlen);\n len += wlen;\n dpos += wlen;\n dlen -= wlen;\n wlen = asm.cipher(AES_asm.ENC.CTR, AES_asm.HEAP_DATA + pos, len);\n wlen = asm.mac(AES_asm.MAC.GCM, AES_asm.HEAP_DATA + pos, wlen);\n if (wlen)\n result.set(heap.subarray(pos, pos + wlen), rpos);\n counter += wlen >>> 4;\n rpos += wlen;\n if (wlen < len) {\n pos += wlen;\n len -= wlen;\n }\n else {\n pos = 0;\n len = 0;\n }\n }\n this.counter = counter;\n this.aes.pos = pos;\n this.aes.len = len;\n return result;\n }\n AES_GCM_Encrypt_finish() {\n let { asm, heap } = this.aes.acquire_asm();\n let counter = this.counter;\n let tagSize = this.tagSize;\n let adata = this.adata;\n let pos = this.aes.pos;\n let len = this.aes.len;\n const result = new Uint8Array(len + tagSize);\n asm.cipher(AES_asm.ENC.CTR, AES_asm.HEAP_DATA + pos, (len + 15) & -16);\n if (len)\n result.set(heap.subarray(pos, pos + len));\n let i = len;\n for (; i & 15; i++)\n heap[pos + i] = 0;\n asm.mac(AES_asm.MAC.GCM, AES_asm.HEAP_DATA + pos, i);\n const alen = adata !== undefined ? adata.length : 0;\n const clen = ((counter - 1) << 4) + len;\n heap[0] = 0;\n heap[1] = 0;\n heap[2] = 0;\n heap[3] = alen >>> 29;\n heap[4] = alen >>> 21;\n heap[5] = (alen >>> 13) & 255;\n heap[6] = (alen >>> 5) & 255;\n heap[7] = (alen << 3) & 255;\n heap[8] = heap[9] = heap[10] = 0;\n heap[11] = clen >>> 29;\n heap[12] = (clen >>> 21) & 255;\n heap[13] = (clen >>> 13) & 255;\n heap[14] = (clen >>> 5) & 255;\n heap[15] = (clen << 3) & 255;\n asm.mac(AES_asm.MAC.GCM, AES_asm.HEAP_DATA, 16);\n asm.get_iv(AES_asm.HEAP_DATA);\n asm.set_counter(0, 0, 0, this.gamma0);\n asm.cipher(AES_asm.ENC.CTR, AES_asm.HEAP_DATA, 16);\n result.set(heap.subarray(0, tagSize), len);\n this.counter = 1;\n this.aes.pos = 0;\n this.aes.len = 0;\n return result;\n }\n AES_GCM_Decrypt_process(data) {\n let dpos = 0;\n let dlen = data.length || 0;\n let { asm, heap } = this.aes.acquire_asm();\n let counter = this.counter;\n let tagSize = this.tagSize;\n let pos = this.aes.pos;\n let len = this.aes.len;\n let rpos = 0;\n let rlen = len + dlen > tagSize ? (len + dlen - tagSize) & -16 : 0;\n let tlen = len + dlen - rlen;\n let wlen = 0;\n if (((counter - 1) << 4) + len + dlen > _AES_GCM_data_maxLength)\n throw new RangeError('counter overflow');\n const result = new Uint8Array(rlen);\n while (dlen > tlen) {\n wlen = _heap_write(heap, pos + len, data, dpos, dlen - tlen);\n len += wlen;\n dpos += wlen;\n dlen -= wlen;\n wlen = asm.mac(AES_asm.MAC.GCM, AES_asm.HEAP_DATA + pos, wlen);\n wlen = asm.cipher(AES_asm.DEC.CTR, AES_asm.HEAP_DATA + pos, wlen);\n if (wlen)\n result.set(heap.subarray(pos, pos + wlen), rpos);\n counter += wlen >>> 4;\n rpos += wlen;\n pos = 0;\n len = 0;\n }\n if (dlen > 0) {\n len += _heap_write(heap, 0, data, dpos, dlen);\n }\n this.counter = counter;\n this.aes.pos = pos;\n this.aes.len = len;\n return result;\n }\n AES_GCM_Decrypt_finish() {\n let { asm, heap } = this.aes.acquire_asm();\n let tagSize = this.tagSize;\n let adata = this.adata;\n let counter = this.counter;\n let pos = this.aes.pos;\n let len = this.aes.len;\n let rlen = len - tagSize;\n if (len < tagSize)\n throw new IllegalStateError('authentication tag not found');\n const result = new Uint8Array(rlen);\n const atag = new Uint8Array(heap.subarray(pos + rlen, pos + len));\n let i = rlen;\n for (; i & 15; i++)\n heap[pos + i] = 0;\n asm.mac(AES_asm.MAC.GCM, AES_asm.HEAP_DATA + pos, i);\n asm.cipher(AES_asm.DEC.CTR, AES_asm.HEAP_DATA + pos, i);\n if (rlen)\n result.set(heap.subarray(pos, pos + rlen));\n const alen = adata !== undefined ? adata.length : 0;\n const clen = ((counter - 1) << 4) + len - tagSize;\n heap[0] = 0;\n heap[1] = 0;\n heap[2] = 0;\n heap[3] = alen >>> 29;\n heap[4] = alen >>> 21;\n heap[5] = (alen >>> 13) & 255;\n heap[6] = (alen >>> 5) & 255;\n heap[7] = (alen << 3) & 255;\n heap[8] = heap[9] = heap[10] = 0;\n heap[11] = clen >>> 29;\n heap[12] = (clen >>> 21) & 255;\n heap[13] = (clen >>> 13) & 255;\n heap[14] = (clen >>> 5) & 255;\n heap[15] = (clen << 3) & 255;\n asm.mac(AES_asm.MAC.GCM, AES_asm.HEAP_DATA, 16);\n asm.get_iv(AES_asm.HEAP_DATA);\n asm.set_counter(0, 0, 0, this.gamma0);\n asm.cipher(AES_asm.ENC.CTR, AES_asm.HEAP_DATA, 16);\n let acheck = 0;\n for (let i = 0; i < tagSize; ++i)\n acheck |= atag[i] ^ heap[i];\n if (acheck)\n throw new SecurityError('data integrity check failed');\n this.counter = 1;\n this.aes.pos = 0;\n this.aes.len = 0;\n return result;\n }\n AES_GCM_decrypt(data) {\n const result1 = this.AES_GCM_Decrypt_process(data);\n const result2 = this.AES_GCM_Decrypt_finish();\n const result = new Uint8Array(result1.length + result2.length);\n if (result1.length)\n result.set(result1);\n if (result2.length)\n result.set(result2, result1.length);\n return result;\n }\n AES_GCM_encrypt(data) {\n const result1 = this.AES_GCM_Encrypt_process(data);\n const result2 = this.AES_GCM_Encrypt_finish();\n const result = new Uint8Array(result1.length + result2.length);\n if (result1.length)\n result.set(result1);\n if (result2.length)\n result.set(result2, result1.length);\n return result;\n }\n _gcm_mac_process(data) {\n let { asm, heap } = this.aes.acquire_asm();\n let dpos = 0;\n let dlen = data.length || 0;\n let wlen = 0;\n while (dlen > 0) {\n wlen = _heap_write(heap, 0, data, dpos, dlen);\n dpos += wlen;\n dlen -= wlen;\n while (wlen & 15)\n heap[wlen++] = 0;\n asm.mac(AES_asm.MAC.GCM, AES_asm.HEAP_DATA, wlen);\n }\n }\n}\n","// OpenPGP.js - An OpenPGP implementation in javascript\n// Copyright (C) 2016 Tankred Hase\n//\n// This library is free software; you can redistribute it and/or\n// modify it under the terms of the GNU Lesser General Public\n// License as published by the Free Software Foundation; either\n// version 3.0 of the License, or (at your option) any later version.\n//\n// This library is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n// Lesser General Public License for more details.\n//\n// You should have received a copy of the GNU Lesser General Public\n// License along with this library; if not, write to the Free Software\n// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n\n/**\n * @fileoverview This module wraps native AES-GCM en/decryption for both\n * the WebCrypto api as well as node.js' crypto api.\n * @module crypto/mode/gcm\n * @private\n */\n\nimport { AES_GCM } from '@openpgp/asmcrypto.js/dist_es8/aes/gcm';\nimport util from '../../util';\nimport enums from '../../enums';\n\nconst webCrypto = util.getWebCrypto();\nconst nodeCrypto = util.getNodeCrypto();\nconst Buffer = util.getNodeBuffer();\n\nconst blockLength = 16;\nconst ivLength = 12; // size of the IV in bytes\nconst tagLength = 16; // size of the tag in bytes\nconst ALGO = 'AES-GCM';\n\n/**\n * Class to en/decrypt using GCM mode.\n * @param {enums.symmetric} cipher - The symmetric cipher algorithm to use\n * @param {Uint8Array} key - The encryption key\n */\nasync function GCM(cipher, key) {\n if (cipher !== enums.symmetric.aes128 &&\n cipher !== enums.symmetric.aes192 &&\n cipher !== enums.symmetric.aes256) {\n throw new Error('GCM mode supports only AES cipher');\n }\n\n if (util.getWebCrypto() && key.length !== 24) { // WebCrypto (no 192 bit support) see: https://www.chromium.org/blink/webcrypto#TOC-AES-support\n const _key = await webCrypto.importKey('raw', key, { name: ALGO }, false, ['encrypt', 'decrypt']);\n\n return {\n encrypt: async function(pt, iv, adata = new Uint8Array()) {\n if (!pt.length) { // iOS does not support GCM-en/decrypting empty messages\n return AES_GCM.encrypt(pt, key, iv, adata);\n }\n const ct = await webCrypto.encrypt({ name: ALGO, iv, additionalData: adata, tagLength: tagLength * 8 }, _key, pt);\n return new Uint8Array(ct);\n },\n\n decrypt: async function(ct, iv, adata = new Uint8Array()) {\n if (ct.length === tagLength) { // iOS does not support GCM-en/decrypting empty messages\n return AES_GCM.decrypt(ct, key, iv, adata);\n }\n const pt = await webCrypto.decrypt({ name: ALGO, iv, additionalData: adata, tagLength: tagLength * 8 }, _key, ct);\n return new Uint8Array(pt);\n }\n };\n }\n\n 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 * Retrieve secure random byte array of the specified length\n * @param {Integer} length - Length in bytes to generate\n * @returns {Uint8Array} Random byte array.\n */\nexport function getRandomBytes(length) {\n const buf = new Uint8Array(length);\n if (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 {\n throw new Error('No secure random number generator available.');\n }\n return buf;\n}\n\n/**\n * Create a secure random BigInteger that is greater than or equal to min and less than max.\n * @param {module:BigInteger} min - Lower bound, included\n * @param {module:BigInteger} max - Upper bound, excluded\n * @returns {Promise<module:BigInteger>} Random BigInteger.\n * @async\n */\nexport async function getRandomBigInteger(min, max) {\n const BigInteger = await util.getBigInteger();\n\n if (max.lt(min)) {\n throw new Error('Illegal parameter value: max <= min');\n }\n\n const modulus = max.sub(min);\n const bytes = modulus.byteLength();\n\n // Using a while loop is necessary to avoid bias introduced by the mod operation.\n // However, we request 64 extra random bits so that the bias is negligible.\n // Section B.1.1 here: https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.186-4.pdf\n const r = new BigInteger(await getRandomBytes(bytes + 8));\n return r.mod(modulus).add(min);\n}\n","// OpenPGP.js - An OpenPGP implementation in javascript\n// Copyright (C) 2018 Proton Technologies AG\n//\n// This library is free software; you can redistribute it and/or\n// modify it under the terms of the GNU Lesser General Public\n// License as published by the Free Software Foundation; either\n// version 3.0 of the License, or (at your option) any later version.\n//\n// This library is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n// Lesser General Public License for more details.\n//\n// You should have received a copy of the GNU Lesser General Public\n// License along with this library; if not, write to the Free Software\n// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n\n/**\n * @fileoverview Algorithms for probabilistic random prime generation\n * @module crypto/public_key/prime\n * @private\n */\n\nimport util from '../../util';\nimport { getRandomBigInteger } from '../random';\n\n/**\n * Generate a probably prime random number\n * @param {Integer} bits - Bit length of the prime\n * @param {BigInteger} e - Optional RSA exponent to check against the prime\n * @param {Integer} k - Optional number of iterations of Miller-Rabin test\n * @returns BigInteger\n * @async\n */\nexport async function randomProbablePrime(bits, e, k) {\n const BigInteger = await util.getBigInteger();\n const one = new BigInteger(1);\n const min = one.leftShift(new BigInteger(bits - 1));\n const thirty = new BigInteger(30);\n /*\n * We can avoid any multiples of 3 and 5 by looking at n mod 30\n * n mod 30 = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29\n * the next possible prime is mod 30:\n * 1 7 7 7 7 7 7 11 11 11 11 13 13 17 17 17 17 19 19 23 23 23 23 29 29 29 29 29 29 1\n */\n const adds = [1, 6, 5, 4, 3, 2, 1, 4, 3, 2, 1, 2, 1, 4, 3, 2, 1, 2, 1, 4, 3, 2, 1, 6, 5, 4, 3, 2, 1, 2];\n\n const n = await getRandomBigInteger(min, min.leftShift(one));\n let i = n.mod(thirty).toNumber();\n\n do {\n n.iadd(new BigInteger(adds[i]));\n i = (i + adds[i]) % adds.length;\n // If reached the maximum, go back to the minimum.\n if (n.bitLength() > bits) {\n n.imod(min.leftShift(one)).iadd(min);\n i = n.mod(thirty).toNumber();\n }\n } while (!await isProbablePrime(n, e, k));\n return n;\n}\n\n/**\n * Probabilistic primality testing\n * @param {BigInteger} n - Number to test\n * @param {BigInteger} e - Optional RSA exponent to check against the prime\n * @param {Integer} k - Optional number of iterations of Miller-Rabin test\n * @returns {boolean}\n * @async\n */\nexport async function isProbablePrime(n, e, k) {\n if (e && !n.dec().gcd(e).isOne()) {\n return false;\n }\n if (!await divisionTest(n)) {\n return false;\n }\n if (!await fermat(n)) {\n return false;\n }\n if (!await millerRabin(n, k)) {\n return false;\n }\n // TODO implement the Lucas test\n // See Section C.3.3 here: https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.186-4.pdf\n return true;\n}\n\n/**\n * Tests whether n is probably prime or not using Fermat's test with b = 2.\n * Fails if b^(n-1) mod n != 1.\n * @param {BigInteger} n - Number to test\n * @param {BigInteger} b - Optional Fermat test base\n * @returns {boolean}\n */\nexport async function fermat(n, b) {\n const BigInteger = await util.getBigInteger();\n b = b || new BigInteger(2);\n return b.modExp(n.dec(), n).isOne();\n}\n\nexport async function divisionTest(n) {\n const BigInteger = await util.getBigInteger();\n return smallPrimes.every(m => {\n return n.mod(new BigInteger(m)) !== 0;\n });\n}\n\n// https://github.com/gpg/libgcrypt/blob/master/cipher/primegen.c\nconst smallPrimes = [\n 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43,\n 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101,\n 103, 107, 109, 113, 127, 131, 137, 139, 149, 151,\n 157, 163, 167, 173, 179, 181, 191, 193, 197, 199,\n 211, 223, 227, 229, 233, 239, 241, 251, 257, 263,\n 269, 271, 277, 281, 283, 293, 307, 311, 313, 317,\n 331, 337, 347, 349, 353, 359, 367, 373, 379, 383,\n 389, 397, 401, 409, 419, 421, 431, 433, 439, 443,\n 449, 457, 461, 463, 467, 479, 487, 491, 499, 503,\n 509, 521, 523, 541, 547, 557, 563, 569, 571, 577,\n 587, 593, 599, 601, 607, 613, 617, 619, 631, 641,\n 643, 647, 653, 659, 661, 673, 677, 683, 691, 701,\n 709, 719, 727, 733, 739, 743, 751, 757, 761, 769,\n 773, 787, 797, 809, 811, 821, 823, 827, 829, 839,\n 853, 857, 859, 863, 877, 881, 883, 887, 907, 911,\n 919, 929, 937, 941, 947, 953, 967, 971, 977, 983,\n 991, 997, 1009, 1013, 1019, 1021, 1031, 1033,\n 1039, 1049, 1051, 1061, 1063, 1069, 1087, 1091,\n 1093, 1097, 1103, 1109, 1117, 1123, 1129, 1151,\n 1153, 1163, 1171, 1181, 1187, 1193, 1201, 1213,\n 1217, 1223, 1229, 1231, 1237, 1249, 1259, 1277,\n 1279, 1283, 1289, 1291, 1297, 1301, 1303, 1307,\n 1319, 1321, 1327, 1361, 1367, 1373, 1381, 1399,\n 1409, 1423, 1427, 1429, 1433, 1439, 1447, 1451,\n 1453, 1459, 1471, 1481, 1483, 1487, 1489, 1493,\n 1499, 1511, 1523, 1531, 1543, 1549, 1553, 1559,\n 1567, 1571, 1579, 1583, 1597, 1601, 1607, 1609,\n 1613, 1619, 1621, 1627, 1637, 1657, 1663, 1667,\n 1669, 1693, 1697, 1699, 1709, 1721, 1723, 1733,\n 1741, 1747, 1753, 1759, 1777, 1783, 1787, 1789,\n 1801, 1811, 1823, 1831, 1847, 1861, 1867, 1871,\n 1873, 1877, 1879, 1889, 1901, 1907, 1913, 1931,\n 1933, 1949, 1951, 1973, 1979, 1987, 1993, 1997,\n 1999, 2003, 2011, 2017, 2027, 2029, 2039, 2053,\n 2063, 2069, 2081, 2083, 2087, 2089, 2099, 2111,\n 2113, 2129, 2131, 2137, 2141, 2143, 2153, 2161,\n 2179, 2203, 2207, 2213, 2221, 2237, 2239, 2243,\n 2251, 2267, 2269, 2273, 2281, 2287, 2293, 2297,\n 2309, 2311, 2333, 2339, 2341, 2347, 2351, 2357,\n 2371, 2377, 2381, 2383, 2389, 2393, 2399, 2411,\n 2417, 2423, 2437, 2441, 2447, 2459, 2467, 2473,\n 2477, 2503, 2521, 2531, 2539, 2543, 2549, 2551,\n 2557, 2579, 2591, 2593, 2609, 2617, 2621, 2633,\n 2647, 2657, 2659, 2663, 2671, 2677, 2683, 2687,\n 2689, 2693, 2699, 2707, 2711, 2713, 2719, 2729,\n 2731, 2741, 2749, 2753, 2767, 2777, 2789, 2791,\n 2797, 2801, 2803, 2819, 2833, 2837, 2843, 2851,\n 2857, 2861, 2879, 2887, 2897, 2903, 2909, 2917,\n 2927, 2939, 2953, 2957, 2963, 2969, 2971, 2999,\n 3001, 3011, 3019, 3023, 3037, 3041, 3049, 3061,\n 3067, 3079, 3083, 3089, 3109, 3119, 3121, 3137,\n 3163, 3167, 3169, 3181, 3187, 3191, 3203, 3209,\n 3217, 3221, 3229, 3251, 3253, 3257, 3259, 3271,\n 3299, 3301, 3307, 3313, 3319, 3323, 3329, 3331,\n 3343, 3347, 3359, 3361, 3371, 3373, 3389, 3391,\n 3407, 3413, 3433, 3449, 3457, 3461, 3463, 3467,\n 3469, 3491, 3499, 3511, 3517, 3527, 3529, 3533,\n 3539, 3541, 3547, 3557, 3559, 3571, 3581, 3583,\n 3593, 3607, 3613, 3617, 3623, 3631, 3637, 3643,\n 3659, 3671, 3673, 3677, 3691, 3697, 3701, 3709,\n 3719, 3727, 3733, 3739, 3761, 3767, 3769, 3779,\n 3793, 3797, 3803, 3821, 3823, 3833, 3847, 3851,\n 3853, 3863, 3877, 3881, 3889, 3907, 3911, 3917,\n 3919, 3923, 3929, 3931, 3943, 3947, 3967, 3989,\n 4001, 4003, 4007, 4013, 4019, 4021, 4027, 4049,\n 4051, 4057, 4073, 4079, 4091, 4093, 4099, 4111,\n 4127, 4129, 4133, 4139, 4153, 4157, 4159, 4177,\n 4201, 4211, 4217, 4219, 4229, 4231, 4241, 4243,\n 4253, 4259, 4261, 4271, 4273, 4283, 4289, 4297,\n 4327, 4337, 4339, 4349, 4357, 4363, 4373, 4391,\n 4397, 4409, 4421, 4423, 4441, 4447, 4451, 4457,\n 4463, 4481, 4483, 4493, 4507, 4513, 4517, 4519,\n 4523, 4547, 4549, 4561, 4567, 4583, 4591, 4597,\n 4603, 4621, 4637, 4639, 4643, 4649, 4651, 4657,\n 4663, 4673, 4679, 4691, 4703, 4721, 4723, 4729,\n 4733, 4751, 4759, 4783, 4787, 4789, 4793, 4799,\n 4801, 4813, 4817, 4831, 4861, 4871, 4877, 4889,\n 4903, 4909, 4919, 4931, 4933, 4937, 4943, 4951,\n 4957, 4967, 4969, 4973, 4987, 4993, 4999\n];\n\n\n// Miller-Rabin - Miller Rabin algorithm for primality test\n// Copyright Fedor Indutny, 2014.\n//\n// This software is licensed under the MIT License.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// Adapted on Jan 2018 from version 4.0.1 at https://github.com/indutny/miller-rabin\n\n// Sample syntax for Fixed-Base Miller-Rabin:\n// millerRabin(n, k, () => new BN(small_primes[Math.random() * small_primes.length | 0]))\n\n/**\n * Tests whether n is probably prime or not using the Miller-Rabin test.\n * See HAC Remark 4.28.\n * @param {BigInteger} n - Number to test\n * @param {Integer} k - Optional number of iterations of Miller-Rabin test\n * @param {Function} rand - Optional function to generate potential witnesses\n * @returns {boolean}\n * @async\n */\nexport async function millerRabin(n, k, rand) {\n const BigInteger = await util.getBigInteger();\n const len = n.bitLength();\n\n if (!k) {\n k = Math.max(1, (len / 48) | 0);\n }\n\n const n1 = n.dec(); // n - 1\n\n // Find d and s, (n - 1) = (2 ^ s) * d;\n let s = 0;\n while (!n1.getBit(s)) { s++; }\n const d = n.rightShift(new BigInteger(s));\n\n for (; k > 0; k--) {\n const a = rand ? rand() : await getRandomBigInteger(new BigInteger(2), n1);\n\n let x = a.modExp(d, n);\n if (x.isOne() || x.equal(n1)) {\n continue;\n }\n\n let i;\n for (i = 1; i < s; i++) {\n x = x.mul(x).mod(n);\n\n if (x.isOne()) {\n return false;\n }\n if (x.equal(n1)) {\n break;\n }\n }\n\n if (i === s) {\n return false;\n }\n }\n\n return true;\n}\n","// GPG4Browsers - An OpenPGP implementation in javascript\n// Copyright (C) 2011 Recurity Labs GmbH\n//\n// This library is free software; you can redistribute it and/or\n// modify it under the terms of the GNU Lesser General Public\n// License as published by the Free Software Foundation; either\n// version 3.0 of the License, or (at your option) any later version.\n//\n// This library is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n// Lesser General Public License for more details.\n//\n// You should have received a copy of the GNU Lesser General Public\n// License along with this library; if not, write to the Free Software\n// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n\n/**\n * @fileoverview Provides EME-PKCS1-v1_5 encoding and decoding and EMSA-PKCS1-v1_5 encoding function\n * @see module:crypto/public_key/rsa\n * @see module:crypto/public_key/elliptic/ecdh\n * @see PublicKeyEncryptedSessionKeyPacket\n * @module crypto/pkcs1\n * @private\n */\n\nimport { getRandomBytes } from './random';\nimport hash from './hash';\nimport util from '../util';\n\n/**\n * ASN1 object identifiers for hashes\n * @see {@link https://tools.ietf.org/html/rfc4880#section-5.2.2}\n */\nconst hash_headers = [];\nhash_headers[1] = [0x30, 0x20, 0x30, 0x0c, 0x06, 0x08, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x02, 0x05, 0x05, 0x00, 0x04,\n 0x10];\nhash_headers[2] = [0x30, 0x21, 0x30, 0x09, 0x06, 0x05, 0x2b, 0x0e, 0x03, 0x02, 0x1a, 0x05, 0x00, 0x04, 0x14];\nhash_headers[3] = [0x30, 0x21, 0x30, 0x09, 0x06, 0x05, 0x2B, 0x24, 0x03, 0x02, 0x01, 0x05, 0x00, 0x04, 0x14];\nhash_headers[8] = [0x30, 0x31, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01, 0x05, 0x00,\n 0x04, 0x20];\nhash_headers[9] = [0x30, 0x41, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x02, 0x05, 0x00,\n 0x04, 0x30];\nhash_headers[10] = [0x30, 0x51, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x03, 0x05,\n 0x00, 0x04, 0x40];\nhash_headers[11] = [0x30, 0x2d, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x04, 0x05,\n 0x00, 0x04, 0x1C];\n\n/**\n * Create padding with secure random data\n * @private\n * @param {Integer} length - Length of the padding in bytes\n * @returns {Uint8Array} Random padding.\n */\nfunction getPKCS1Padding(length) {\n const result = new Uint8Array(length);\n let count = 0;\n while (count < length) {\n const randomBytes = getRandomBytes(length - count);\n for (let i = 0; i < randomBytes.length; i++) {\n if (randomBytes[i] !== 0) {\n result[count++] = randomBytes[i];\n }\n }\n }\n return result;\n}\n\n/**\n * Create a EME-PKCS1-v1_5 padded message\n * @see {@link https://tools.ietf.org/html/rfc4880#section-13.1.1|RFC 4880 13.1.1}\n * @param {Uint8Array} message - Message to be encoded\n * @param {Integer} keyLength - The length in octets of the key modulus\n * @returns {Uint8Array} EME-PKCS1 padded message.\n */\nexport function emeEncode(message, keyLength) {\n const mLength = message.length;\n // length checking\n if (mLength > keyLength - 11) {\n throw new Error('Message too long');\n }\n // Generate an octet string PS of length k - mLen - 3 consisting of\n // pseudo-randomly generated nonzero octets\n const PS = getPKCS1Padding(keyLength - mLength - 3);\n // Concatenate PS, the message M, and other padding to form an\n // encoded message EM of length k octets as EM = 0x00 || 0x02 || PS || 0x00 || M.\n const encoded = new Uint8Array(keyLength);\n // 0x00 byte\n encoded[1] = 2;\n encoded.set(PS, 2);\n // 0x00 bytes\n encoded.set(message, keyLength - mLength);\n return encoded;\n}\n\n/**\n * Decode a EME-PKCS1-v1_5 padded message\n * @see {@link https://tools.ietf.org/html/rfc4880#section-13.1.2|RFC 4880 13.1.2}\n * @param {Uint8Array} encoded - Encoded message bytes\n * @param {Uint8Array} randomPayload - Data to return in case of decoding error (needed for constant-time processing)\n * @returns {Uint8Array} decoded data or `randomPayload` (on error, if given)\n * @throws {Error} on decoding failure, unless `randomPayload` is provided\n */\nexport function emeDecode(encoded, randomPayload) {\n // encoded format: 0x00 0x02 <PS> 0x00 <payload>\n let offset = 2;\n let separatorNotFound = 1;\n for (let j = offset; j < encoded.length; j++) {\n separatorNotFound &= encoded[j] !== 0;\n offset += separatorNotFound;\n }\n\n const psLen = offset - 2;\n const payload = encoded.subarray(offset + 1); // discard the 0x00 separator\n const isValidPadding = encoded[0] === 0 & encoded[1] === 2 & psLen >= 8 & !separatorNotFound;\n\n if (randomPayload) {\n return util.selectUint8Array(isValidPadding, payload, randomPayload);\n }\n\n if (isValidPadding) {\n return payload;\n }\n\n throw new Error('Decryption error');\n}\n\n/**\n * Create a EMSA-PKCS1-v1_5 padded message\n * @see {@link https://tools.ietf.org/html/rfc4880#section-13.1.3|RFC 4880 13.1.3}\n * @param {Integer} algo - Hash algorithm type used\n * @param {Uint8Array} hashed - Message to be encoded\n * @param {Integer} emLen - Intended length in octets of the encoded message\n * @returns {Uint8Array} Encoded message.\n */\nexport async function emsaEncode(algo, hashed, emLen) {\n let i;\n if (hashed.length !== hash.getHashByteLength(algo)) {\n throw new Error('Invalid hash length');\n }\n // produce an ASN.1 DER value for the hash function used.\n // Let T be the full hash prefix\n const hashPrefix = new Uint8Array(hash_headers[algo].length);\n for (i = 0; i < hash_headers[algo].length; i++) {\n hashPrefix[i] = hash_headers[algo][i];\n }\n // and let tLen be the length in octets prefix and hashed data\n const tLen = hashPrefix.length + hashed.length;\n if (emLen < tLen + 11) {\n throw new Error('Intended encoded message length too short');\n }\n // an octet string PS consisting of emLen - tLen - 3 octets with hexadecimal value 0xFF\n // The length of PS will be at least 8 octets\n const PS = new Uint8Array(emLen - tLen - 3).fill(0xff);\n\n // Concatenate PS, the hash prefix, hashed data, and other padding to form the\n // encoded message EM as EM = 0x00 || 0x01 || PS || 0x00 || prefix || hashed\n const EM = new Uint8Array(emLen);\n EM[1] = 0x01;\n EM.set(PS, 2);\n EM.set(hashPrefix, emLen - tLen);\n EM.set(hashed, emLen - hashed.length);\n return EM;\n}\n","// GPG4Browsers - An OpenPGP implementation in javascript\n// Copyright (C) 2011 Recurity Labs GmbH\n//\n// This library is free software; you can redistribute it and/or\n// modify it under the terms of the GNU Lesser General Public\n// License as published by the Free Software Foundation; either\n// version 3.0 of the License, or (at your option) any later version.\n//\n// This library is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n// Lesser General Public License for more details.\n//\n// You should have received a copy of the GNU Lesser General Public\n// License along with this library; if not, write to the Free Software\n// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n\n/**\n * @fileoverview RSA implementation\n * @module crypto/public_key/rsa\n * @private\n */\n\nimport { randomProbablePrime } from './prime';\nimport { getRandomBigInteger } from '../random';\nimport util from '../../util';\nimport { uint8ArrayToB64, b64ToUint8Array } from '../../encoding/base64';\nimport { emsaEncode, emeEncode, emeDecode } from '../pkcs1';\nimport enums from '../../enums';\n\nconst webCrypto = util.getWebCrypto();\nconst nodeCrypto = util.getNodeCrypto();\nconst asn1 = nodeCrypto ? require('asn1.js') : undefined;\n\n/* eslint-disable no-invalid-this */\nconst RSAPrivateKey = nodeCrypto ? asn1.define('RSAPrivateKey', function () {\n this.seq().obj( // used for native NodeJS crypto\n this.key('version').int(), // 0\n this.key('modulus').int(), // n\n this.key('publicExponent').int(), // e\n this.key('privateExponent').int(), // d\n this.key('prime1').int(), // p\n this.key('prime2').int(), // q\n this.key('exponent1').int(), // dp\n this.key('exponent2').int(), // dq\n this.key('coefficient').int() // u\n );\n}) : undefined;\n\nconst RSAPublicKey = nodeCrypto ? asn1.define('RSAPubliceKey', function () {\n this.seq().obj( // used for native NodeJS crypto\n this.key('modulus').int(), // n\n this.key('publicExponent').int() // e\n );\n}) : undefined;\n/* eslint-enable no-invalid-this */\n\n/** Create signature\n * @param {module:enums.hash} hashAlgo - Hash algorithm\n * @param {Uint8Array} data - Message\n * @param {Uint8Array} n - RSA public modulus\n * @param {Uint8Array} e - RSA public exponent\n * @param {Uint8Array} d - RSA private exponent\n * @param {Uint8Array} p - RSA private prime p\n * @param {Uint8Array} q - RSA private prime q\n * @param {Uint8Array} u - RSA private coefficient\n * @param {Uint8Array} hashed - Hashed message\n * @returns {Promise<Uint8Array>} RSA Signature.\n * @async\n */\nexport async function sign(hashAlgo, data, n, e, d, p, q, u, hashed) {\n if (data && !util.isStream(data)) {\n if (util.getWebCrypto()) {\n try {\n return await webSign(enums.read(enums.webHash, hashAlgo), data, n, e, d, p, q, u);\n } catch (err) {\n util.printDebugError(err);\n }\n } else if (util.getNodeCrypto()) {\n return nodeSign(hashAlgo, data, n, e, d, p, q, u);\n }\n }\n return bnSign(hashAlgo, n, d, hashed);\n}\n\n/**\n * Verify signature\n * @param {module:enums.hash} hashAlgo - Hash algorithm\n * @param {Uint8Array} data - Message\n * @param {Uint8Array} s - Signature\n * @param {Uint8Array} n - RSA public modulus\n * @param {Uint8Array} e - RSA public exponent\n * @param {Uint8Array} hashed - Hashed message\n * @returns {Boolean}\n * @async\n */\nexport async function verify(hashAlgo, data, s, n, e, hashed) {\n if (data && !util.isStream(data)) {\n if (util.getWebCrypto()) {\n try {\n return await webVerify(enums.read(enums.webHash, hashAlgo), data, s, n, e);\n } catch (err) {\n util.printDebugError(err);\n }\n } else if (util.getNodeCrypto()) {\n return nodeVerify(hashAlgo, data, s, n, e);\n }\n }\n return bnVerify(hashAlgo, s, n, e, hashed);\n}\n\n/**\n * Encrypt message\n * @param {Uint8Array} data - Message\n * @param {Uint8Array} n - RSA public modulus\n * @param {Uint8Array} e - RSA public exponent\n * @returns {Promise<Uint8Array>} RSA Ciphertext.\n * @async\n */\nexport async function encrypt(data, n, e) {\n if (util.getNodeCrypto()) {\n return nodeEncrypt(data, n, e);\n }\n return bnEncrypt(data, n, e);\n}\n\n/**\n * Decrypt RSA message\n * @param {Uint8Array} m - Message\n * @param {Uint8Array} n - RSA public modulus\n * @param {Uint8Array} e - RSA public exponent\n * @param {Uint8Array} d - RSA private exponent\n * @param {Uint8Array} p - RSA private prime p\n * @param {Uint8Array} q - RSA private prime q\n * @param {Uint8Array} u - RSA private coefficient\n * @param {Uint8Array} randomPayload - Data to return on decryption error, instead of throwing\n * (needed for constant-time processing)\n * @returns {Promise<String>} RSA Plaintext.\n * @throws {Error} on decryption error, unless `randomPayload` is given\n * @async\n */\nexport async function decrypt(data, n, e, d, p, q, u, randomPayload) {\n if (util.getNodeCrypto()) {\n return nodeDecrypt(data, n, e, d, p, q, u, randomPayload);\n }\n return bnDecrypt(data, n, e, d, p, q, u, randomPayload);\n}\n\n/**\n * Generate a new random private key B bits long with public exponent E.\n *\n * When possible, webCrypto or nodeCrypto is used. Otherwise, primes are generated using\n * 40 rounds of the Miller-Rabin probabilistic random prime generation algorithm.\n * @see module:crypto/public_key/prime\n * @param {Integer} bits - RSA bit length\n * @param {Integer} e - RSA public exponent\n * @returns {{n, e, d,\n * p, q ,u: Uint8Array}} RSA public modulus, RSA public exponent, RSA private exponent,\n * RSA private prime p, RSA private prime q, u = p ** -1 mod q\n * @async\n */\nexport async function generate(bits, e) {\n const BigInteger = await util.getBigInteger();\n\n e = new BigInteger(e);\n\n // Native RSA keygen using Web Crypto\n if (util.getWebCrypto()) {\n const keyGenOpt = {\n name: 'RSASSA-PKCS1-v1_5',\n modulusLength: bits, // the specified keysize in bits\n publicExponent: e.toUint8Array(), // take three bytes (max 65537) for exponent\n hash: {\n name: 'SHA-1' // not required for actual RSA keys, but for crypto api 'sign' and 'verify'\n }\n };\n const keyPair = await webCrypto.generateKey(keyGenOpt, true, ['sign', 'verify']);\n\n // export the generated keys as JsonWebKey (JWK)\n // https://tools.ietf.org/html/draft-ietf-jose-json-web-key-33\n const jwk = await webCrypto.exportKey('jwk', keyPair.privateKey);\n // map JWK parameters to corresponding OpenPGP names\n return {\n n: b64ToUint8Array(jwk.n),\n e: e.toUint8Array(),\n d: b64ToUint8Array(jwk.d),\n // switch p and q\n p: b64ToUint8Array(jwk.q),\n q: b64ToUint8Array(jwk.p),\n // Since p and q are switched in places, u is the inverse of jwk.q\n u: b64ToUint8Array(jwk.qi)\n };\n } else if (util.getNodeCrypto() && nodeCrypto.generateKeyPair && RSAPrivateKey) {\n const opts = {\n modulusLength: bits,\n publicExponent: e.toNumber(),\n publicKeyEncoding: { type: 'pkcs1', format: 'der' },\n privateKeyEncoding: { type: 'pkcs1', format: 'der' }\n };\n const prv = await new Promise((resolve, reject) => {\n nodeCrypto.generateKeyPair('rsa', opts, (err, _, der) => {\n if (err) {\n reject(err);\n } else {\n resolve(RSAPrivateKey.decode(der, 'der'));\n }\n });\n });\n /**\n * OpenPGP spec differs from DER spec, DER: `u = (inverse of q) mod p`, OpenPGP: `u = (inverse of p) mod q`.\n * @link https://tools.ietf.org/html/rfc3447#section-3.2\n * @link https://tools.ietf.org/html/draft-ietf-openpgp-rfc4880bis-08#section-5.6.1\n */\n return {\n n: prv.modulus.toArrayLike(Uint8Array),\n e: prv.publicExponent.toArrayLike(Uint8Array),\n d: prv.privateExponent.toArrayLike(Uint8Array),\n // switch p and q\n p: prv.prime2.toArrayLike(Uint8Array),\n q: prv.prime1.toArrayLike(Uint8Array),\n // Since p and q are switched in places, we can keep u as defined by DER\n u: prv.coefficient.toArrayLike(Uint8Array)\n };\n }\n\n // RSA keygen fallback using 40 iterations of the Miller-Rabin test\n // See https://stackoverflow.com/a/6330138 for justification\n // Also see section C.3 here: https://nvlpubs.nist.gov/nistpubs/FIPS/NIST\n let p;\n let q;\n let n;\n do {\n q = await randomProbablePrime(bits - (bits >> 1), e, 40);\n p = await randomProbablePrime(bits >> 1, e, 40);\n n = p.mul(q);\n } while (n.bitLength() !== bits);\n\n const phi = p.dec().imul(q.dec());\n\n if (q.lt(p)) {\n [p, q] = [q, p];\n }\n\n return {\n n: n.toUint8Array(),\n e: e.toUint8Array(),\n d: e.modInv(phi).toUint8Array(),\n p: p.toUint8Array(),\n q: q.toUint8Array(),\n // dp: d.mod(p.subn(1)),\n // dq: d.mod(q.subn(1)),\n u: p.modInv(q).toUint8Array()\n };\n}\n\n/**\n * Validate RSA parameters\n * @param {Uint8Array} n - RSA public modulus\n * @param {Uint8Array} e - RSA public exponent\n * @param {Uint8Array} d - RSA private exponent\n * @param {Uint8Array} p - RSA private prime p\n * @param {Uint8Array} q - RSA private prime q\n * @param {Uint8Array} u - RSA inverse of p w.r.t. q\n * @returns {Promise<Boolean>} Whether params are valid.\n * @async\n */\nexport async function validateParams(n, e, d, p, q, u) {\n const BigInteger = await util.getBigInteger();\n n = new BigInteger(n);\n p = new BigInteger(p);\n q = new BigInteger(q);\n\n // expect pq = n\n if (!p.mul(q).equal(n)) {\n return false;\n }\n\n const two = new BigInteger(2);\n // expect p*u = 1 mod q\n u = new BigInteger(u);\n if (!p.mul(u).mod(q).isOne()) {\n return false;\n }\n\n e = new BigInteger(e);\n d = new BigInteger(d);\n /**\n * In RSA pkcs#1 the exponents (d, e) are inverses modulo lcm(p-1, q-1)\n * We check that [de = 1 mod (p-1)] and [de = 1 mod (q-1)]\n * By CRT on coprime factors of (p-1, q-1) it follows that [de = 1 mod lcm(p-1, q-1)]\n *\n * We blind the multiplication with r, and check that rde = r mod lcm(p-1, q-1)\n */\n const nSizeOver3 = new BigInteger(Math.floor(n.bitLength() / 3));\n const r = await getRandomBigInteger(two, two.leftShift(nSizeOver3)); // r in [ 2, 2^{|n|/3} ) < p and q\n const rde = r.mul(d).mul(e);\n\n const areInverses = rde.mod(p.dec()).equal(r) && rde.mod(q.dec()).equal(r);\n if (!areInverses) {\n return false;\n }\n\n return true;\n}\n\nasync function bnSign(hashAlgo, n, d, hashed) {\n const BigInteger = await util.getBigInteger();\n n = new BigInteger(n);\n const m = new BigInteger(await emsaEncode(hashAlgo, hashed, n.byteLength()));\n d = new BigInteger(d);\n if (m.gte(n)) {\n throw new Error('Message size cannot exceed modulus size');\n }\n return m.modExp(d, n).toUint8Array('be', n.byteLength());\n}\n\nasync function webSign(hashName, data, n, e, d, p, q, u) {\n /** OpenPGP keys require that p < q, and Safari Web Crypto requires that p > q.\n * We swap them in privateToJWK, so it usually works out, but nevertheless,\n * not all OpenPGP keys are compatible with this requirement.\n * OpenPGP.js used to generate RSA keys the wrong way around (p > q), and still\n * does if the underlying Web Crypto does so (though the tested implementations\n * don't do so).\n */\n const jwk = await privateToJWK(n, e, d, p, q, u);\n const algo = {\n name: 'RSASSA-PKCS1-v1_5',\n hash: { name: hashName }\n };\n const key = await webCrypto.importKey('jwk', jwk, algo, false, ['sign']);\n return new Uint8Array(await webCrypto.sign('RSASSA-PKCS1-v1_5', key, data));\n}\n\nasync function nodeSign(hashAlgo, data, n, e, d, p, q, u) {\n const { default: BN } = await import('bn.js');\n const pBNum = new BN(p);\n const qBNum = new BN(q);\n const dBNum = new BN(d);\n const dq = dBNum.mod(qBNum.subn(1)); // d mod (q-1)\n const dp = dBNum.mod(pBNum.subn(1)); // d mod (p-1)\n const sign = nodeCrypto.createSign(enums.read(enums.hash, hashAlgo));\n sign.write(data);\n sign.end();\n const keyObject = {\n version: 0,\n modulus: new BN(n),\n publicExponent: new BN(e),\n privateExponent: new BN(d),\n // switch p and q\n prime1: new BN(q),\n prime2: new BN(p),\n // switch dp and dq\n exponent1: dq,\n exponent2: dp,\n coefficient: new BN(u)\n };\n if (typeof nodeCrypto.createPrivateKey !== 'undefined') { //from version 11.6.0 Node supports der encoded key objects\n const der = RSAPrivateKey.encode(keyObject, 'der');\n return new Uint8Array(sign.sign({ key: der, format: 'der', type: 'pkcs1' }));\n }\n const pem = RSAPrivateKey.encode(keyObject, 'pem', {\n label: 'RSA PRIVATE KEY'\n });\n return new Uint8Array(sign.sign(pem));\n}\n\nasync function bnVerify(hashAlgo, s, n, e, hashed) {\n const BigInteger = await util.getBigInteger();\n n = new BigInteger(n);\n s = new BigInteger(s);\n e = new BigInteger(e);\n if (s.gte(n)) {\n throw new Error('Signature size cannot exceed modulus size');\n }\n const EM1 = s.modExp(e, n).toUint8Array('be', n.byteLength());\n const EM2 = await emsaEncode(hashAlgo, hashed, n.byteLength());\n return util.equalsUint8Array(EM1, EM2);\n}\n\nasync function webVerify(hashName, data, s, n, e) {\n const jwk = publicToJWK(n, e);\n const key = await webCrypto.importKey('jwk', jwk, {\n name: 'RSASSA-PKCS1-v1_5',\n hash: { name: hashName }\n }, false, ['verify']);\n return webCrypto.verify('RSASSA-PKCS1-v1_5', key, s, data);\n}\n\nasync function nodeVerify(hashAlgo, data, s, n, e) {\n const { default: BN } = await import('bn.js');\n\n const verify = nodeCrypto.createVerify(enums.read(enums.hash, hashAlgo));\n verify.write(data);\n verify.end();\n const keyObject = {\n modulus: new BN(n),\n publicExponent: new BN(e)\n };\n let key;\n if (typeof nodeCrypto.createPrivateKey !== 'undefined') { //from version 11.6.0 Node supports der encoded key objects\n const der = RSAPublicKey.encode(keyObject, 'der');\n key = { key: der, format: 'der', type: 'pkcs1' };\n } else {\n key = RSAPublicKey.encode(keyObject, 'pem', {\n label: 'RSA PUBLIC KEY'\n });\n }\n try {\n return await verify.verify(key, s);\n } catch (err) {\n return false;\n }\n}\n\nasync function nodeEncrypt(data, n, e) {\n const { default: BN } = await import('bn.js');\n\n const keyObject = {\n modulus: new BN(n),\n publicExponent: new BN(e)\n };\n let key;\n if (typeof nodeCrypto.createPrivateKey !== 'undefined') {\n const der = RSAPublicKey.encode(keyObject, 'der');\n key = { key: der, format: 'der', type: 'pkcs1', padding: nodeCrypto.constants.RSA_PKCS1_PADDING };\n } else {\n const pem = RSAPublicKey.encode(keyObject, 'pem', {\n label: 'RSA PUBLIC KEY'\n });\n key = { key: pem, padding: nodeCrypto.constants.RSA_PKCS1_PADDING };\n }\n return new Uint8Array(nodeCrypto.publicEncrypt(key, data));\n}\n\nasync function bnEncrypt(data, n, e) {\n const BigInteger = await util.getBigInteger();\n n = new BigInteger(n);\n data = new BigInteger(emeEncode(data, n.byteLength()));\n e = new BigInteger(e);\n if (data.gte(n)) {\n throw new Error('Message size cannot exceed modulus size');\n }\n return data.modExp(e, n).toUint8Array('be', n.byteLength());\n}\n\nasync function nodeDecrypt(data, n, e, d, p, q, u, randomPayload) {\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 if (randomPayload) {\n return randomPayload;\n }\n throw new Error('Decryption error');\n }\n}\n\nasync function bnDecrypt(data, n, e, d, p, q, u, randomPayload) {\n const BigInteger = await util.getBigInteger();\n data = new BigInteger(data);\n n = new BigInteger(n);\n e = new BigInteger(e);\n d = new BigInteger(d);\n p = new BigInteger(p);\n q = new BigInteger(q);\n u = new BigInteger(u);\n if (data.gte(n)) {\n throw new Error('Data too large.');\n }\n const dq = d.mod(q.dec()); // d mod (q-1)\n const dp = d.mod(p.dec()); // d mod (p-1)\n\n const unblinder = (await getRandomBigInteger(new BigInteger(2), n)).mod(n);\n const blinder = unblinder.modInv(n).modExp(e, n);\n data = data.mul(blinder).mod(n);\n\n\n const mp = data.modExp(dp, p); // data**{d mod (q-1)} mod p\n const mq = data.modExp(dq, q); // data**{d mod (p-1)} mod q\n const h = u.mul(mq.sub(mp)).mod(q); // u * (mq-mp) mod q (operands already < q)\n\n let result = h.mul(p).add(mp); // result < n due to relations above\n\n result = result.mul(unblinder).mod(n);\n\n\n return emeDecode(result.toUint8Array('be', n.byteLength()), randomPayload);\n}\n\n/** Convert Openpgp private key params to jwk key according to\n * @link https://tools.ietf.org/html/rfc7517\n * @param {String} hashAlgo\n * @param {Uint8Array} n\n * @param {Uint8Array} e\n * @param {Uint8Array} d\n * @param {Uint8Array} p\n * @param {Uint8Array} q\n * @param {Uint8Array} u\n */\nasync function privateToJWK(n, e, d, p, q, u) {\n const BigInteger = await util.getBigInteger();\n const pNum = new BigInteger(p);\n const qNum = new BigInteger(q);\n const dNum = new BigInteger(d);\n\n let dq = dNum.mod(qNum.dec()); // d mod (q-1)\n let dp = dNum.mod(pNum.dec()); // d mod (p-1)\n dp = dp.toUint8Array();\n dq = dq.toUint8Array();\n return {\n kty: 'RSA',\n n: uint8ArrayToB64(n, true),\n e: uint8ArrayToB64(e, true),\n d: uint8ArrayToB64(d, true),\n // switch p and q\n p: uint8ArrayToB64(q, true),\n q: uint8ArrayToB64(p, true),\n // switch dp and dq\n dp: uint8ArrayToB64(dq, true),\n dq: uint8ArrayToB64(dp, true),\n qi: uint8ArrayToB64(u, true),\n ext: true\n };\n}\n\n/** Convert Openpgp key public params to jwk key according to\n * @link https://tools.ietf.org/html/rfc7517\n * @param {String} hashAlgo\n * @param {Uint8Array} n\n * @param {Uint8Array} e\n */\nfunction publicToJWK(n, e) {\n return {\n kty: 'RSA',\n n: uint8ArrayToB64(n, true),\n e: uint8ArrayToB64(e, true),\n ext: true\n };\n}\n","// GPG4Browsers - An OpenPGP implementation in javascript\n// Copyright (C) 2011 Recurity Labs GmbH\n//\n// This library is free software; you can redistribute it and/or\n// modify it under the terms of the GNU Lesser General Public\n// License as published by the Free Software Foundation; either\n// version 3.0 of the License, or (at your option) any later version.\n//\n// This library is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n// Lesser General Public License for more details.\n//\n// You should have received a copy of the GNU Lesser General Public\n// License along with this library; if not, write to the Free Software\n// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n\n/**\n * @fileoverview ElGamal implementation\n * @module crypto/public_key/elgamal\n * @private\n */\n\nimport util from '../../util';\nimport { getRandomBigInteger } from '../random';\nimport { emeEncode, emeDecode } from '../pkcs1';\n\n/**\n * ElGamal Encryption function\n * Note that in OpenPGP, the message needs to be padded with PKCS#1 (same as RSA)\n * @param {Uint8Array} data - To be padded and encrypted\n * @param {Uint8Array} p\n * @param {Uint8Array} g\n * @param {Uint8Array} y\n * @returns {Promise<{ c1: Uint8Array, c2: Uint8Array }>}\n * @async\n */\nexport async function encrypt(data, p, g, y) {\n const BigInteger = await util.getBigInteger();\n p = new BigInteger(p);\n g = new BigInteger(g);\n y = new BigInteger(y);\n\n const padded = emeEncode(data, p.byteLength());\n const m = new BigInteger(padded);\n\n // OpenPGP uses a \"special\" version of ElGamal where g is generator of the full group Z/pZ*\n // hence g has order p-1, and to avoid that k = 0 mod p-1, we need to pick k in [1, p-2]\n const k = await getRandomBigInteger(new BigInteger(1), p.dec());\n return {\n c1: g.modExp(k, p).toUint8Array(),\n c2: y.modExp(k, p).imul(m).imod(p).toUint8Array()\n };\n}\n\n/**\n * ElGamal Encryption function\n * @param {Uint8Array} c1\n * @param {Uint8Array} c2\n * @param {Uint8Array} p\n * @param {Uint8Array} x\n * @param {Uint8Array} randomPayload - Data to return on unpadding error, instead of throwing\n * (needed for constant-time processing)\n * @returns {Promise<Uint8Array>} Unpadded message.\n * @throws {Error} on decryption error, unless `randomPayload` is given\n * @async\n */\nexport async function decrypt(c1, c2, p, x, randomPayload) {\n const BigInteger = await util.getBigInteger();\n c1 = new BigInteger(c1);\n c2 = new BigInteger(c2);\n p = new BigInteger(p);\n x = new BigInteger(x);\n\n const padded = c1.modExp(x, p).modInv(p).imul(c2).imod(p);\n return emeDecode(padded.toUint8Array('be', p.byteLength()), randomPayload);\n}\n\n/**\n * Validate ElGamal parameters\n * @param {Uint8Array} p - ElGamal prime\n * @param {Uint8Array} g - ElGamal group generator\n * @param {Uint8Array} y - ElGamal public key\n * @param {Uint8Array} x - ElGamal private exponent\n * @returns {Promise<Boolean>} Whether params are valid.\n * @async\n */\nexport async function validateParams(p, g, y, x) {\n const BigInteger = await util.getBigInteger();\n p = new BigInteger(p);\n g = new BigInteger(g);\n y = new BigInteger(y);\n\n const one = new BigInteger(1);\n // Check that 1 < g < p\n if (g.lte(one) || g.gte(p)) {\n return false;\n }\n\n // Expect p-1 to be large\n const pSize = new BigInteger(p.bitLength());\n const n1023 = new BigInteger(1023);\n if (pSize.lt(n1023)) {\n return false;\n }\n\n /**\n * g should have order p-1\n * Check that g ** (p-1) = 1 mod p\n */\n if (!g.modExp(p.dec(), p).isOne()) {\n return false;\n }\n\n /**\n * Since p-1 is not prime, g might have a smaller order that divides p-1\n * We want to make sure that the order is large enough to hinder a small subgroup attack\n *\n * We just check g**i != 1 for all i up to a threshold\n */\n let res = g;\n const i = new BigInteger(1);\n const threshold = new BigInteger(2).leftShift(new BigInteger(17)); // we want order > threshold\n while (i.lt(threshold)) {\n res = res.mul(g).imod(p);\n if (res.isOne()) {\n return false;\n }\n i.iinc();\n }\n\n /**\n * Re-derive public key y' = g ** x mod p\n * Expect y == y'\n *\n * Blinded exponentiation computes g**{r(p-1) + x} to compare to y\n */\n x = new BigInteger(x);\n const two = new BigInteger(2);\n const r = await getRandomBigInteger(two.leftShift(pSize.dec()), two.leftShift(pSize)); // draw r of same size as p-1\n const rqx = p.dec().imul(r).iadd(x);\n if (!y.equal(g.modExp(rqx, p))) {\n return false;\n }\n\n return true;\n}\n","// OpenPGP.js - An OpenPGP implementation in javascript\n// Copyright (C) 2015-2016 Decentral\n//\n// This library is free software; you can redistribute it and/or\n// modify it under the terms of the GNU Lesser General Public\n// License as published by the Free Software Foundation; either\n// version 3.0 of the License, or (at your option) any later version.\n//\n// This library is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n// Lesser General Public License for more details.\n//\n// You should have received a copy of the GNU Lesser General Public\n// License along with this library; if not, write to the Free Software\n// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n\n/**\n * Wrapper to an OID value\n *\n * {@link https://tools.ietf.org/html/rfc6637#section-11|RFC6637, section 11}:\n * The sequence of octets in the third column is the result of applying\n * the Distinguished Encoding Rules (DER) to the ASN.1 Object Identifier\n * with subsequent truncation. The truncation removes the two fields of\n * encoded Object Identifier. The first omitted field is one octet\n * representing the Object Identifier tag, and the second omitted field\n * is the length of the Object Identifier body. For example, the\n * complete ASN.1 DER encoding for the NIST P-256 curve OID is \"06 08 2A\n * 86 48 CE 3D 03 01 07\", from which the first entry in the table above\n * is constructed by omitting the first two octets. Only the truncated\n * sequence of octets is the valid representation of a curve OID.\n * @module type/oid\n * @private\n */\n\nimport util from '../util';\nimport enums from '../enums';\n\nclass OID {\n constructor(oid) {\n if (oid instanceof OID) {\n this.oid = oid.oid;\n } else if (util.isArray(oid) ||\n util.isUint8Array(oid)) {\n oid = new Uint8Array(oid);\n if (oid[0] === 0x06) { // DER encoded oid byte array\n if (oid[1] !== oid.length - 2) {\n throw new Error('Length mismatch in DER encoded oid');\n }\n oid = oid.subarray(2);\n }\n this.oid = oid;\n } else {\n this.oid = '';\n }\n }\n\n /**\n * Method to read an OID object\n * @param {Uint8Array} input - Where to read the OID from\n * @returns {Number} Number of read bytes.\n */\n read(input) {\n if (input.length >= 1) {\n const length = input[0];\n if (input.length >= 1 + length) {\n this.oid = input.subarray(1, 1 + length);\n return 1 + this.oid.length;\n }\n }\n throw new Error('Invalid oid');\n }\n\n /**\n * Serialize an OID object\n * @returns {Uint8Array} Array with the serialized value the OID.\n */\n write() {\n return util.concatUint8Array([new Uint8Array([this.oid.length]), this.oid]);\n }\n\n /**\n * Serialize an OID object as a hex string\n * @returns {string} String with the hex value of the OID.\n */\n toHex() {\n return util.uint8ArrayToHex(this.oid);\n }\n\n /**\n * If a known curve object identifier, return the canonical name of the curve\n * @returns {string} String with the canonical name of the curve.\n */\n getName() {\n const hex = this.toHex();\n if (enums.curve[hex]) {\n return enums.write(enums.curve, hex);\n } else {\n throw new Error('Unknown curve object identifier.');\n }\n }\n}\n\nexport default OID;\n","// OpenPGP.js - An OpenPGP implementation in javascript\n// Copyright (C) 2015-2016 Decentral\n//\n// This library is free software; you can redistribute it and/or\n// modify it under the terms of the GNU Lesser General Public\n// License as published by the Free Software Foundation; either\n// version 3.0 of the License, or (at your option) any later version.\n//\n// This library is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n// Lesser General Public License for more details.\n//\n// You should have received a copy of the GNU Lesser General Public\n// License along with this library; if not, write to the Free Software\n// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n\n/**\n * @fileoverview Wrapper for a KeyPair of an curve from indutny/elliptic library\n * @module crypto/public_key/elliptic/indutnyKey\n * @private\n */\n\nimport config from '../../../config';\n\nexport function keyFromPrivate(indutnyCurve, priv) {\n const keyPair = indutnyCurve.keyPair({ priv: priv });\n return keyPair;\n}\n\nexport function keyFromPublic(indutnyCurve, pub) {\n const keyPair = indutnyCurve.keyPair({ pub: pub });\n if (keyPair.validate().result !== true) {\n throw new Error('Invalid elliptic public key');\n }\n return keyPair;\n}\n\nexport async function getIndutnyCurve(name) {\n if (!config.useIndutnyElliptic) {\n throw new Error('This curve is only supported in the full build of OpenPGP.js');\n }\n const { default: elliptic } = await import('@openpgp/elliptic');\n return new elliptic.ec(name);\n}\n","// GPG4Browsers - An OpenPGP implementation in javascript\n// Copyright (C) 2011 Recurity Labs GmbH\n//\n// This library is free software; you can redistribute it and/or\n// modify it under the terms of the GNU Lesser General Public\n// License as published by the Free Software Foundation; either\n// version 3.0 of the License, or (at your option) any later version.\n//\n// This library is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n// Lesser General Public License for more details.\n//\n// You should have received a copy of the GNU Lesser General Public\n// License along with this library; if not, write to the Free Software\n// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n\n/**\n * @fileoverview Functions for reading and writing packets\n * @module packet/packet\n * @private\n */\n\nimport * as stream from '@openpgp/web-stream-tools';\nimport enums from '../enums';\nimport util from '../util';\n\nexport function readSimpleLength(bytes) {\n let len = 0;\n let offset;\n const type = bytes[0];\n\n\n if (type < 192) {\n [len] = bytes;\n offset = 1;\n } else if (type < 255) {\n len = ((bytes[0] - 192) << 8) + (bytes[1]) + 192;\n offset = 2;\n } else if (type === 255) {\n len = util.readNumber(bytes.subarray(1, 1 + 4));\n offset = 5;\n }\n\n return {\n len: len,\n offset: offset\n };\n}\n\n/**\n * Encodes a given integer of length to the openpgp length specifier to a\n * string\n *\n * @param {Integer} length - The length to encode\n * @returns {Uint8Array} String with openpgp length representation.\n */\nexport function writeSimpleLength(length) {\n if (length < 192) {\n return new Uint8Array([length]);\n } else if (length > 191 && length < 8384) {\n /*\n * let a = (total data packet length) - 192 let bc = two octet\n * representation of a let d = b + 192\n */\n return new Uint8Array([((length - 192) >> 8) + 192, (length - 192) & 0xFF]);\n }\n return util.concatUint8Array([new Uint8Array([255]), util.writeNumber(length, 4)]);\n}\n\nexport function writePartialLength(power) {\n if (power < 0 || power > 30) {\n throw new Error('Partial Length power must be between 1 and 30');\n }\n return new Uint8Array([224 + power]);\n}\n\nexport function writeTag(tag_type) {\n /* we're only generating v4 packet headers here */\n return new Uint8Array([0xC0 | tag_type]);\n}\n\n/**\n * Writes a packet header version 4 with the given tag_type and length to a\n * string\n *\n * @param {Integer} tag_type - Tag type\n * @param {Integer} length - Length of the payload\n * @returns {String} String of the header.\n */\nexport function writeHeader(tag_type, length) {\n /* we're only generating v4 packet headers here */\n return util.concatUint8Array([writeTag(tag_type), writeSimpleLength(length)]);\n}\n\n/**\n * Whether the packet type supports partial lengths per RFC4880\n * @param {Integer} tag - Tag type\n * @returns {Boolean} String of the header.\n */\nexport function supportsStreaming(tag) {\n return [\n enums.packet.literalData,\n enums.packet.compressedData,\n enums.packet.symmetricallyEncryptedData,\n enums.packet.symEncryptedIntegrityProtectedData,\n enums.packet.aeadEncryptedData\n ].includes(tag);\n}\n\n/**\n * Generic static Packet Parser function\n *\n * @param {Uint8Array | ReadableStream<Uint8Array>} input - Input stream as string\n * @param {Function} callback - Function to call with the parsed packet\n * @returns {Boolean} Returns false if the stream was empty and parsing is done, and true otherwise.\n */\nexport async function readPackets(input, callback) {\n const reader = stream.getReader(input);\n let writer;\n let callbackReturned;\n try {\n const peekedBytes = await reader.peekBytes(2);\n // some sanity checks\n if (!peekedBytes || peekedBytes.length < 2 || (peekedBytes[0] & 0x80) === 0) {\n throw new Error('Error during parsing. This message / key probably does not conform to a valid OpenPGP format.');\n }\n const headerByte = await reader.readByte();\n let tag = -1;\n let format = -1;\n let packetLength;\n\n format = 0; // 0 = old format; 1 = new format\n if ((headerByte & 0x40) !== 0) {\n format = 1;\n }\n\n let packetLengthType;\n if (format) {\n // new format header\n tag = headerByte & 0x3F; // bit 5-0\n } else {\n // old format header\n tag = (headerByte & 0x3F) >> 2; // bit 5-2\n packetLengthType = headerByte & 0x03; // bit 1-0\n }\n\n const packetSupportsStreaming = supportsStreaming(tag);\n let packet = null;\n if (packetSupportsStreaming) {\n if (util.isStream(input) === 'array') {\n const arrayStream = new stream.ArrayStream();\n writer = stream.getWriter(arrayStream);\n packet = arrayStream;\n } else {\n const transform = new stream.TransformStream();\n writer = stream.getWriter(transform.writable);\n packet = transform.readable;\n }\n // eslint-disable-next-line callback-return\n callbackReturned = callback({ tag, packet });\n } else {\n packet = [];\n }\n\n let wasPartialLength;\n do {\n if (!format) {\n // 4.2.1. Old Format Packet Lengths\n switch (packetLengthType) {\n case 0:\n // The packet has a one-octet length. The header is 2 octets\n // long.\n packetLength = await reader.readByte();\n break;\n case 1:\n // The packet has a two-octet length. The header is 3 octets\n // long.\n packetLength = (await reader.readByte() << 8) | await reader.readByte();\n break;\n case 2:\n // The packet has a four-octet length. The header is 5\n // octets long.\n packetLength = (await reader.readByte() << 24) | (await reader.readByte() << 16) | (await reader.readByte() <<\n 8) | await reader.readByte();\n break;\n default:\n // 3 - The packet is of indeterminate length. The header is 1\n // octet long, and the implementation must determine how long\n // the packet is. If the packet is in a file, this means that\n // the packet extends until the end of the file. In general,\n // an implementation SHOULD NOT use indeterminate-length\n // packets except where the end of the data will be clear\n // from the context, and even then it is better to use a\n // definite length, or a new format header. The new format\n // headers described below have a mechanism for precisely\n // encoding data of indeterminate length.\n packetLength = Infinity;\n break;\n }\n } else { // 4.2.2. New Format Packet Lengths\n // 4.2.2.1. One-Octet Lengths\n const lengthByte = await reader.readByte();\n wasPartialLength = false;\n if (lengthByte < 192) {\n packetLength = lengthByte;\n // 4.2.2.2. Two-Octet Lengths\n } else if (lengthByte >= 192 && lengthByte < 224) {\n packetLength = ((lengthByte - 192) << 8) + (await reader.readByte()) + 192;\n // 4.2.2.4. Partial Body Lengths\n } else if (lengthByte > 223 && lengthByte < 255) {\n packetLength = 1 << (lengthByte & 0x1F);\n wasPartialLength = true;\n if (!packetSupportsStreaming) {\n throw new TypeError('This packet type does not support partial lengths.');\n }\n // 4.2.2.3. Five-Octet Lengths\n } else {\n packetLength = (await reader.readByte() << 24) | (await reader.readByte() << 16) | (await reader.readByte() <<\n 8) | await reader.readByte();\n }\n }\n if (packetLength > 0) {\n let bytesRead = 0;\n while (true) {\n if (writer) await writer.ready;\n const { done, value } = await reader.read();\n if (done) {\n if (packetLength === Infinity) break;\n throw new Error('Unexpected end of packet');\n }\n const chunk = packetLength === Infinity ? value : value.subarray(0, packetLength - bytesRead);\n if (writer) await writer.write(chunk);\n else packet.push(chunk);\n bytesRead += value.length;\n if (bytesRead >= packetLength) {\n reader.unshift(value.subarray(packetLength - bytesRead + value.length));\n break;\n }\n }\n }\n } while (wasPartialLength);\n\n // If this was not a packet that \"supports streaming\", we peek to check\n // whether it is the last packet in the message. We peek 2 bytes instead\n // of 1 because the beginning of this function also peeks 2 bytes, and we\n // want to cut a `subarray` of the correct length into `web-stream-tools`'\n // `externalBuffer` as a tiny optimization here.\n //\n // If it *was* a streaming packet (i.e. the data packets), we peek at the\n // entire remainder of the stream, in order to forward errors in the\n // remainder of the stream to the packet data. (Note that this means we\n // read/peek at all signature packets before closing the literal data\n // packet, for example.) This forwards MDC errors to the literal data\n // stream, for example, so that they don't get lost / forgotten on\n // decryptedMessage.packets.stream, which we never look at.\n //\n // An example of what we do when stream-parsing a message containing\n // [ one-pass signature packet, literal data packet, signature packet ]:\n // 1. Read the one-pass signature packet\n // 2. Peek 2 bytes of the literal data packet\n // 3. Parse the one-pass signature packet\n //\n // 4. Read the literal data packet, simultaneously stream-parsing it\n // 5. Peek until the end of the message\n // 6. Finish parsing the literal data packet\n //\n // 7. Read the signature packet again (we already peeked at it in step 5)\n // 8. Peek at the end of the stream again (`peekBytes` returns undefined)\n // 9. Parse the signature packet\n //\n // Note that this means that if there's an error in the very end of the\n // stream, such as an MDC error, we throw in step 5 instead of in step 8\n // (or never), which is the point of this exercise.\n const nextPacket = await reader.peekBytes(packetSupportsStreaming ? Infinity : 2);\n if (writer) {\n await writer.ready;\n await writer.close();\n } else {\n packet = util.concatUint8Array(packet);\n // eslint-disable-next-line callback-return\n await callback({ tag, packet });\n }\n return !nextPacket || !nextPacket.length;\n } catch (e) {\n if (writer) {\n await writer.abort(e);\n return true;\n } else {\n throw e;\n }\n } finally {\n if (writer) {\n await callbackReturned;\n }\n reader.releaseLock();\n }\n}\n\nexport class UnsupportedError extends Error {\n constructor(...params) {\n super(...params);\n\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, UnsupportedError);\n }\n\n this.name = 'UnsupportedError';\n }\n}\n\nexport class UnparseablePacket {\n constructor(tag, rawContent) {\n this.tag = tag;\n this.rawContent = rawContent;\n }\n\n write() {\n return this.rawContent;\n }\n}\n","// OpenPGP.js - An OpenPGP implementation in javascript\n// Copyright (C) 2015-2016 Decentral\n//\n// This library is free software; you can redistribute it and/or\n// modify it under the terms of the GNU Lesser General Public\n// License as published by the Free Software Foundation; either\n// version 3.0 of the License, or (at your option) any later version.\n//\n// This library is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n// Lesser General Public License for more details.\n//\n// You should have received a copy of the GNU Lesser General Public\n// License along with this library; if not, write to the Free Software\n// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n\n/**\n * @fileoverview Wrapper of an instance of an Elliptic Curve\n * @module crypto/public_key/elliptic/curve\n * @private\n */\n\nimport nacl from '@openpgp/tweetnacl/nacl-fast-light';\nimport { getRandomBytes } from '../../random';\nimport enums from '../../../enums';\nimport util from '../../../util';\nimport { uint8ArrayToB64, b64ToUint8Array } from '../../../encoding/base64';\nimport OID from '../../../type/oid';\nimport { keyFromPublic, keyFromPrivate, getIndutnyCurve } from './indutnyKey';\nimport { UnsupportedError } from '../../../packet/packet';\n\nconst webCrypto = util.getWebCrypto();\nconst nodeCrypto = util.getNodeCrypto();\n\nconst webCurves = {\n 'p256': 'P-256',\n 'p384': 'P-384',\n 'p521': 'P-521'\n};\nconst knownCurves = nodeCrypto ? nodeCrypto.getCurves() : [];\nconst nodeCurves = nodeCrypto ? {\n secp256k1: knownCurves.includes('secp256k1') ? 'secp256k1' : undefined,\n p256: knownCurves.includes('prime256v1') ? 'prime256v1' : undefined,\n p384: knownCurves.includes('secp384r1') ? 'secp384r1' : undefined,\n p521: knownCurves.includes('secp521r1') ? 'secp521r1' : undefined,\n ed25519: knownCurves.includes('ED25519') ? 'ED25519' : undefined,\n curve25519: knownCurves.includes('X25519') ? 'X25519' : undefined,\n brainpoolP256r1: knownCurves.includes('brainpoolP256r1') ? 'brainpoolP256r1' : undefined,\n brainpoolP384r1: knownCurves.includes('brainpoolP384r1') ? 'brainpoolP384r1' : undefined,\n brainpoolP512r1: knownCurves.includes('brainpoolP512r1') ? 'brainpoolP512r1' : undefined\n} : {};\n\nconst curves = {\n p256: {\n oid: [0x06, 0x08, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x03, 0x01, 0x07],\n keyType: enums.publicKey.ecdsa,\n hash: enums.hash.sha256,\n cipher: enums.symmetric.aes128,\n node: nodeCurves.p256,\n web: webCurves.p256,\n payloadSize: 32,\n sharedSize: 256\n },\n p384: {\n oid: [0x06, 0x05, 0x2B, 0x81, 0x04, 0x00, 0x22],\n keyType: enums.publicKey.ecdsa,\n hash: enums.hash.sha384,\n cipher: enums.symmetric.aes192,\n node: nodeCurves.p384,\n web: webCurves.p384,\n payloadSize: 48,\n sharedSize: 384\n },\n p521: {\n oid: [0x06, 0x05, 0x2B, 0x81, 0x04, 0x00, 0x23],\n keyType: enums.publicKey.ecdsa,\n hash: enums.hash.sha512,\n cipher: enums.symmetric.aes256,\n node: nodeCurves.p521,\n web: webCurves.p521,\n payloadSize: 66,\n sharedSize: 528\n },\n secp256k1: {\n oid: [0x06, 0x05, 0x2B, 0x81, 0x04, 0x00, 0x0A],\n keyType: enums.publicKey.ecdsa,\n hash: enums.hash.sha256,\n cipher: enums.symmetric.aes128,\n node: nodeCurves.secp256k1,\n payloadSize: 32\n },\n ed25519: {\n oid: [0x06, 0x09, 0x2B, 0x06, 0x01, 0x04, 0x01, 0xDA, 0x47, 0x0F, 0x01],\n keyType: enums.publicKey.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 UnsupportedError('Unknown curve');\n }\n params = params || curves[this.name];\n\n this.keyType = params.keyType;\n\n this.oid = params.oid;\n this.hash = params.hash;\n this.cipher = params.cipher;\n this.node = params.node && curves[this.name];\n this.web = params.web && curves[this.name];\n this.payloadSize = params.payloadSize;\n if (this.web && util.getWebCrypto()) {\n this.type = 'web';\n } else if (this.node && util.getNodeCrypto()) {\n this.type = 'node';\n } else if (this.name === 'curve25519') {\n this.type = 'curve25519';\n } else if (this.name === 'ed25519') {\n this.type = 'ed25519';\n }\n }\n\n async genKeyPair() {\n let keyPair;\n switch (this.type) {\n case 'web':\n try {\n return await webGenKeyPair(this.name);\n } catch (err) {\n util.printDebugError('Browser did not support generating ec key ' + err.message);\n break;\n }\n case 'node':\n return nodeGenKeyPair(this.name);\n case 'curve25519': {\n const privateKey = getRandomBytes(32);\n privateKey[0] = (privateKey[0] & 127) | 64;\n privateKey[31] &= 248;\n const secretKey = privateKey.slice().reverse();\n keyPair = nacl.box.keyPair.fromSecretKey(secretKey);\n const publicKey = util.concatUint8Array([new Uint8Array([0x40]), keyPair.publicKey]);\n return { publicKey, privateKey };\n }\n case 'ed25519': {\n const privateKey = getRandomBytes(32);\n const keyPair = nacl.sign.keyPair.fromSeed(privateKey);\n const publicKey = util.concatUint8Array([new Uint8Array([0x40]), keyPair.publicKey]);\n return { publicKey, privateKey };\n }\n }\n const indutnyCurve = await getIndutnyCurve(this.name);\n keyPair = await indutnyCurve.genKeyPair({\n entropy: util.uint8ArrayToString(getRandomBytes(32))\n });\n return { publicKey: new Uint8Array(keyPair.getPublic('array', false)), privateKey: keyPair.getPrivate().toArrayLike(Uint8Array) };\n }\n}\n\nasync function generate(curve) {\n const BigInteger = await util.getBigInteger();\n\n curve = new 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\n/**\n * Get preferred hash algo to use with the given curve\n * @param {module:type/oid} oid - curve oid\n * @returns {enums.hash} hash algorithm\n */\nfunction getPreferredHashAlgo(oid) {\n return curves[enums.write(enums.curve, oid.toHex())].hash;\n}\n\n/**\n * Validate ECDH and ECDSA parameters\n * Not suitable for EdDSA (different secret key format)\n * @param {module:enums.publicKey} algo - EC algorithm, to filter supported curves\n * @param {module:type/oid} oid - EC object identifier\n * @param {Uint8Array} Q - EC public point\n * @param {Uint8Array} d - EC secret scalar\n * @returns {Promise<Boolean>} Whether params are valid.\n * @async\n */\nasync function validateStandardParams(algo, oid, Q, d) {\n const supportedCurves = {\n p256: true,\n p384: true,\n p521: true,\n secp256k1: true,\n curve25519: algo === enums.publicKey.ecdh,\n brainpoolP256r1: true,\n brainpoolP384r1: true,\n brainpoolP512r1: true\n };\n\n // Check whether the given curve is supported\n const curveName = oid.getName();\n if (!supportedCurves[curveName]) {\n return false;\n }\n\n if (curveName === 'curve25519') {\n d = d.slice().reverse();\n // Re-derive public point Q'\n const { publicKey } = nacl.box.keyPair.fromSecretKey(d);\n\n Q = new Uint8Array(Q);\n const dG = new Uint8Array([0x40, ...publicKey]); // Add public key prefix\n if (!util.equalsUint8Array(dG, Q)) {\n return false;\n }\n\n return true;\n }\n\n const curve = await getIndutnyCurve(curveName);\n try {\n // Parse Q and check that it is on the curve but not at infinity\n Q = keyFromPublic(curve, Q).getPublic();\n } catch (validationErrors) {\n return false;\n }\n\n /**\n * Re-derive public point Q' = dG from private key\n * Expect Q == Q'\n */\n const dG = keyFromPrivate(curve, d).getPublic();\n if (!dG.eq(Q)) {\n return false;\n }\n\n return true;\n}\n\nexport {\n 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 = 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';\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';\nimport { Curve, jwkToRawPublic, rawPublicToJWK, privateToJWK, validateStandardParams } from './curves';\nimport * as aesKW from '../../aes_kw';\nimport { getRandomBytes } from '../../random';\nimport hash from '../../hash';\nimport enums from '../../../enums';\nimport util from '../../../util';\nimport { b64ToUint8Array } from '../../../encoding/base64';\nimport * as pkcs5 from '../../pkcs5';\nimport { keyFromPublic, keyFromPrivate, getIndutnyCurve } from './indutnyKey';\nimport getCipher from '../../cipher/getCipher';\n\nconst webCrypto = util.getWebCrypto();\nconst nodeCrypto = util.getNodeCrypto();\n\n/**\n * Validate ECDH parameters\n * @param {module:type/oid} oid - Elliptic curve object identifier\n * @param {Uint8Array} Q - ECDH public point\n * @param {Uint8Array} d - ECDH secret scalar\n * @returns {Promise<Boolean>} Whether params are valid.\n * @async\n */\nexport async function validateParams(oid, Q, d) {\n return validateStandardParams(enums.publicKey.ecdh, oid, Q, d);\n}\n\n// Build Param for ECDH algorithm (RFC 6637)\nfunction buildEcdhParam(public_algo, oid, kdfParams, fingerprint) {\n return util.concatUint8Array([\n oid.write(),\n new Uint8Array([public_algo]),\n kdfParams.write(),\n util.stringToUint8Array('Anonymous Sender '),\n fingerprint.subarray(0, 20)\n ]);\n}\n\n// Key Derivation Function (RFC 6637)\nasync function kdf(hashAlgo, X, length, param, stripLeading = false, stripTrailing = false) {\n // Note: X is little endian for Curve25519, big-endian for all others.\n // This is not ideal, but the RFC's are unclear\n // https://tools.ietf.org/html/draft-ietf-openpgp-rfc4880bis-02#appendix-B\n let i;\n if (stripLeading) {\n // Work around old go crypto bug\n for (i = 0; i < X.length && X[i] === 0; i++);\n X = X.subarray(i);\n }\n if (stripTrailing) {\n // Work around old OpenPGP.js bug\n for (i = X.length - 1; i >= 0 && X[i] === 0; i--);\n X = X.subarray(0, i + 1);\n }\n const digest = await hash.digest(hashAlgo, util.concatUint8Array([\n new Uint8Array([0, 0, 0, 1]),\n X,\n param\n ]));\n return digest.subarray(0, length);\n}\n\n/**\n * Generate ECDHE ephemeral key and secret from public key\n *\n * @param {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 = 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 { keySize } = getCipher(kdfParams.cipher);\n const Z = await kdf(kdfParams.hash, sharedKey, keySize, param);\n const wrappedKey = aesKW.wrap(Z, m);\n return { publicKey, wrappedKey };\n}\n\n/**\n * Generate ECDHE secret from private key and public part of ephemeral key\n *\n * @param {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 { keySize } = getCipher(kdfParams.cipher);\n let err;\n for (let i = 0; i < 3; i++) {\n try {\n // Work around old go crypto bug and old OpenPGP.js bug, respectively.\n const Z = await kdf(kdfParams.hash, sharedKey, keySize, param, i === 1, i === 2);\n return pkcs5.decode(aesKW.unwrap(Z, C));\n } catch (e) {\n err = e;\n }\n }\n throw err;\n}\n\n/**\n * Generate ECDHE secret from private key and public part of ephemeral key using webCrypto\n *\n * @param {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","// GPG4Browsers - An OpenPGP implementation in javascript\n// Copyright (C) 2011 Recurity Labs GmbH\n//\n// This library is free software; you can redistribute it and/or\n// modify it under the terms of the GNU Lesser General Public\n// License as published by the Free Software Foundation; either\n// version 3.0 of the License, or (at your option) any later version.\n//\n// This library is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n// Lesser General Public License for more details.\n//\n// You should have received a copy of the GNU Lesser General Public\n// License along with this library; if not, write to the Free Software\n// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n\n/**\n * @fileoverview A Digital signature algorithm implementation\n * @module crypto/public_key/dsa\n * @private\n */\nimport { getRandomBigInteger } from '../random';\nimport util from '../../util';\nimport { isProbablePrime } from './prime';\n\n/*\n TODO regarding the hash function, read:\n https://tools.ietf.org/html/rfc4880#section-13.6\n https://tools.ietf.org/html/rfc4880#section-14\n*/\n\n/**\n * DSA Sign function\n * @param {Integer} hashAlgo\n * @param {Uint8Array} hashed\n * @param {Uint8Array} g\n * @param {Uint8Array} p\n * @param {Uint8Array} q\n * @param {Uint8Array} x\n * @returns {Promise<{ r: Uint8Array, s: Uint8Array }>}\n * @async\n */\nexport async function sign(hashAlgo, hashed, g, p, q, x) {\n const BigInteger = await util.getBigInteger();\n const one = new BigInteger(1);\n p = new BigInteger(p);\n q = new BigInteger(q);\n g = new BigInteger(g);\n x = new BigInteger(x);\n\n let k;\n let r;\n let s;\n let t;\n g = g.mod(p);\n x = x.mod(q);\n // If the output size of the chosen hash is larger than the number of\n // bits of q, the hash result is truncated to fit by taking the number\n // of leftmost bits equal to the number of bits of q. This (possibly\n // truncated) hash function result is treated as a number and used\n // directly in the DSA signature algorithm.\n const h = new BigInteger(hashed.subarray(0, q.byteLength())).mod(q);\n // FIPS-186-4, section 4.6:\n // The values of r and s shall be checked to determine if r = 0 or s = 0.\n // If either r = 0 or s = 0, a new value of k shall be generated, and the\n // signature shall be recalculated. It is extremely unlikely that r = 0\n // or s = 0 if signatures are generated properly.\n while (true) {\n // See Appendix B here: https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.186-4.pdf\n k = await getRandomBigInteger(one, q); // returns in [1, q-1]\n r = g.modExp(k, p).imod(q); // (g**k mod p) mod q\n if (r.isZero()) {\n continue;\n }\n const xr = x.mul(r).imod(q);\n t = h.add(xr).imod(q); // H(m) + x*r mod q\n s = k.modInv(q).imul(t).imod(q); // k**-1 * (H(m) + x*r) mod q\n if (s.isZero()) {\n continue;\n }\n break;\n }\n return {\n r: r.toUint8Array('be', q.byteLength()),\n s: s.toUint8Array('be', q.byteLength())\n };\n}\n\n/**\n * DSA Verify function\n * @param {Integer} hashAlgo\n * @param {Uint8Array} r\n * @param {Uint8Array} s\n * @param {Uint8Array} hashed\n * @param {Uint8Array} g\n * @param {Uint8Array} p\n * @param {Uint8Array} q\n * @param {Uint8Array} y\n * @returns {boolean}\n * @async\n */\nexport async function verify(hashAlgo, r, s, hashed, g, p, q, y) {\n const BigInteger = await util.getBigInteger();\n const zero = new BigInteger(0);\n r = new BigInteger(r);\n s = new BigInteger(s);\n\n p = new BigInteger(p);\n q = new BigInteger(q);\n g = new BigInteger(g);\n y = new BigInteger(y);\n\n if (r.lte(zero) || r.gte(q) ||\n s.lte(zero) || s.gte(q)) {\n util.printDebug('invalid DSA Signature');\n return false;\n }\n const h = new BigInteger(hashed.subarray(0, q.byteLength())).imod(q);\n const w = s.modInv(q); // s**-1 mod q\n if (w.isZero()) {\n util.printDebug('invalid DSA Signature');\n return false;\n }\n\n g = g.mod(p);\n y = y.mod(p);\n const u1 = h.mul(w).imod(q); // H(m) * w mod q\n const u2 = r.mul(w).imod(q); // r * w mod q\n const t1 = g.modExp(u1, p); // g**u1 mod p\n const t2 = y.modExp(u2, p); // y**u2 mod p\n const v = t1.mul(t2).imod(p).imod(q); // (g**u1 * y**u2 mod p) mod q\n return v.equal(r);\n}\n\n/**\n * Validate DSA parameters\n * @param {Uint8Array} p - DSA prime\n * @param {Uint8Array} q - DSA group order\n * @param {Uint8Array} g - DSA sub-group generator\n * @param {Uint8Array} y - DSA public key\n * @param {Uint8Array} x - DSA private key\n * @returns {Promise<Boolean>} Whether params are valid.\n * @async\n */\nexport async function validateParams(p, q, g, y, x) {\n const BigInteger = await util.getBigInteger();\n p = new BigInteger(p);\n q = new BigInteger(q);\n g = new BigInteger(g);\n y = new BigInteger(y);\n const one = new BigInteger(1);\n // Check that 1 < g < p\n if (g.lte(one) || g.gte(p)) {\n return false;\n }\n\n /**\n * Check that subgroup order q divides p-1\n */\n if (!p.dec().mod(q).isZero()) {\n return false;\n }\n\n /**\n * g has order q\n * Check that g ** q = 1 mod p\n */\n if (!g.modExp(q, p).isOne()) {\n return false;\n }\n\n /**\n * Check q is large and probably prime (we mainly want to avoid small factors)\n */\n const qSize = new BigInteger(q.bitLength());\n const n150 = new BigInteger(150);\n if (qSize.lt(n150) || !(await isProbablePrime(q, null, 32))) {\n return false;\n }\n\n /**\n * Re-derive public key y' = g ** x mod p\n * Expect y == y'\n *\n * Blinded exponentiation computes g**{rq + x} to compare to y\n */\n x = new BigInteger(x);\n const two = new BigInteger(2);\n const r = await getRandomBigInteger(two.leftShift(qSize.dec()), two.leftShift(qSize)); // draw r of same size as q\n const rqx = q.mul(r).add(x);\n if (!y.equal(g.modExp(rqx, p))) {\n return false;\n }\n\n return true;\n}\n","/**\n * @fileoverview Asymmetric cryptography functions\n * @module crypto/public_key\n * @private\n */\n\nimport nacl from '@openpgp/tweetnacl/nacl-fast-light';\nimport * as rsa from './rsa';\nimport * as elgamal from './elgamal';\nimport * as elliptic from './elliptic';\nimport * as dsa from './dsa';\n\nexport default {\n /** @see module:crypto/public_key/rsa */\n rsa: rsa,\n /** @see module:crypto/public_key/elgamal */\n elgamal: elgamal,\n /** @see module:crypto/public_key/elliptic */\n elliptic: elliptic,\n /** @see module:crypto/public_key/dsa */\n dsa: dsa,\n /** @see tweetnacl */\n nacl: nacl\n};\n","/**\n * @fileoverview Provides functions for asymmetric signing and signature verification\n * @module crypto/signature\n * @private\n */\n\nimport publicKey from './public_key';\nimport enums from '../enums';\nimport util from '../util';\nimport { UnsupportedError } from '../packet/packet';\n\n/**\n * Parse signature in binary form to get the parameters.\n * The returned values are only padded for EdDSA, since in the other cases their expected length\n * depends on the key params, hence we delegate the padding to the signature verification function.\n * See {@link https://tools.ietf.org/html/rfc4880#section-9.1|RFC 4880 9.1}\n * See {@link https://tools.ietf.org/html/rfc4880#section-5.2.2|RFC 4880 5.2.2.}\n * @param {module:enums.publicKey} algo - Public key algorithm\n * @param {Uint8Array} signature - Data for which the signature was created\n * @returns {Promise<Object>} True if signature is valid.\n * @async\n */\nexport function parseSignatureParams(algo, signature) {\n let read = 0;\n switch (algo) {\n // Algorithm-Specific Fields for RSA signatures:\n // - MPI of RSA signature value m**d mod n.\n case enums.publicKey.rsaEncryptSign:\n case enums.publicKey.rsaEncrypt:\n case enums.publicKey.rsaSign: {\n const s = util.readMPI(signature.subarray(read));\n // The signature needs to be the same length as the public key modulo n.\n // We pad s on signature verification, where we have access to n.\n return { s };\n }\n // Algorithm-Specific Fields for DSA or ECDSA signatures:\n // - MPI of DSA or ECDSA value r.\n // - MPI of DSA or ECDSA value s.\n case enums.publicKey.dsa:\n case enums.publicKey.ecdsa:\n {\n const r = util.readMPI(signature.subarray(read)); read += r.length + 2;\n const s = util.readMPI(signature.subarray(read));\n return { r, s };\n }\n // Algorithm-Specific Fields for 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 UnsupportedError('Unknown signature algorithm.');\n }\n}\n\n/**\n * Verifies the signature provided for data using specified algorithms and public key parameters.\n * See {@link https://tools.ietf.org/html/rfc4880#section-9.1|RFC 4880 9.1}\n * and {@link https://tools.ietf.org/html/rfc4880#section-9.4|RFC 4880 9.4}\n * for public key and hash algorithms.\n * @param {module:enums.publicKey} algo - Public key algorithm\n * @param {module:enums.hash} hashAlgo - Hash algorithm\n * @param {Object} signature - Named algorithm-specific signature parameters\n * @param {Object} publicParams - Algorithm-specific public key parameters\n * @param {Uint8Array} data - Data for which the signature was created\n * @param {Uint8Array} hashed - The hashed data\n * @returns {Promise<Boolean>} True if signature is valid.\n * @async\n */\nexport async function verify(algo, hashAlgo, signature, publicParams, data, hashed) {\n switch (algo) {\n case enums.publicKey.rsaEncryptSign:\n case enums.publicKey.rsaEncrypt:\n case enums.publicKey.rsaSign: {\n const { n, e } = publicParams;\n const s = util.leftPad(signature.s, n.length); // padding needed for webcrypto and node crypto\n return publicKey.rsa.verify(hashAlgo, data, s, n, e, hashed);\n }\n case enums.publicKey.dsa: {\n const { g, p, q, y } = publicParams;\n const { r, s } = signature; // no need to pad, since we always handle them as BigIntegers\n return publicKey.dsa.verify(hashAlgo, r, s, hashed, g, p, q, y);\n }\n case enums.publicKey.ecdsa: {\n const { oid, Q } = publicParams;\n const curveSize = new publicKey.elliptic.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('Unknown signature algorithm.');\n }\n}\n\n/**\n * Creates a signature on data using specified algorithms and private key parameters.\n * See {@link https://tools.ietf.org/html/rfc4880#section-9.1|RFC 4880 9.1}\n * and {@link https://tools.ietf.org/html/rfc4880#section-9.4|RFC 4880 9.4}\n * for public key and hash algorithms.\n * @param {module:enums.publicKey} algo - Public key algorithm\n * @param {module:enums.hash} hashAlgo - Hash algorithm\n * @param {Object} publicKeyParams - Algorithm-specific public and private key parameters\n * @param {Object} privateKeyParams - Algorithm-specific public and private key parameters\n * @param {Uint8Array} data - Data to be signed\n * @param {Uint8Array} hashed - The hashed data\n * @returns {Promise<Object>} Signature Object containing named signature parameters.\n * @async\n */\nexport async function sign(algo, hashAlgo, publicKeyParams, privateKeyParams, data, hashed) {\n if (!publicKeyParams || !privateKeyParams) {\n throw new Error('Missing key parameters');\n }\n switch (algo) {\n case enums.publicKey.rsaEncryptSign:\n case enums.publicKey.rsaEncrypt:\n case enums.publicKey.rsaSign: {\n const { n, e } = publicKeyParams;\n const { d, p, q, u } = privateKeyParams;\n const s = await publicKey.rsa.sign(hashAlgo, data, n, e, d, p, q, u, hashed);\n return { s };\n }\n case enums.publicKey.dsa: {\n const { g, p, q } = publicKeyParams;\n const { x } = privateKeyParams;\n return publicKey.dsa.sign(hashAlgo, hashed, g, p, q, x);\n }\n case enums.publicKey.elgamal: {\n throw new Error('Signing with Elgamal is not defined in the OpenPGP standard.');\n }\n case enums.publicKey.ecdsa: {\n const { oid, Q } = publicKeyParams;\n const { d } = privateKeyParams;\n return publicKey.elliptic.ecdsa.sign(oid, hashAlgo, data, Q, d, hashed);\n }\n case enums.publicKey.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('Unknown signature algorithm.');\n }\n}\n","// OpenPGP.js - An OpenPGP implementation in javascript\n// Copyright (C) 2015-2016 Decentral\n//\n// This library is free software; you can redistribute it and/or\n// modify it under the terms of the GNU Lesser General Public\n// License as published by the Free Software Foundation; either\n// version 3.0 of the License, or (at your option) any later version.\n//\n// This library is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n// Lesser General Public License for more details.\n//\n// You should have received a copy of the GNU Lesser General Public\n// License along with this library; if not, write to the Free Software\n// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n\n/**\n * Encoded symmetric key for ECDH\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 mode from './mode';\nimport { getRandomBytes } from './random';\nimport getCipher from './cipher/getCipher';\nimport ECDHSymkey from '../type/ecdh_symkey';\nimport KDFParams from '../type/kdf_params';\nimport enums from '../enums';\nimport util from '../util';\nimport OID from '../type/oid';\nimport { Curve } from './public_key/elliptic/curves';\nimport { UnsupportedError } from '../packet/packet';\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 * @param {Uint8Array} [randomPayload] - Data to return on decryption error, instead of throwing\n * (needed for constant-time processing in RSA and ElGamal)\n * @returns {Promise<Uint8Array>} Decrypted data.\n * @throws {Error} on sensitive decryption error, unless `randomPayload` is given\n * @async\n */\nexport async function publicKeyDecrypt(algo, publicKeyParams, privateKeyParams, sessionKeyParams, fingerprint, randomPayload) {\n switch (algo) {\n case enums.publicKey.rsaEncryptSign:\n case enums.publicKey.rsaEncrypt: {\n const { c } = sessionKeyParams;\n const { n, e } = publicKeyParams;\n const { d, p, q, u } = privateKeyParams;\n return publicKey.rsa.decrypt(c, n, e, d, p, q, u, randomPayload);\n }\n case enums.publicKey.elgamal: {\n const { c1, c2 } = sessionKeyParams;\n const p = publicKeyParams.p;\n const x = privateKeyParams.x;\n return publicKey.elgamal.decrypt(c1, c2, p, x, randomPayload);\n }\n case enums.publicKey.ecdh: {\n const { oid, Q, kdfParams } = publicKeyParams;\n const { d } = privateKeyParams;\n const { V, C } = sessionKeyParams;\n return publicKey.elliptic.ecdh.decrypt(\n oid, kdfParams, V, C.data, Q, d, fingerprint);\n }\n default:\n throw new Error('Unknown public key encryption algorithm.');\n }\n}\n\n/**\n * Parse public key material in binary form to get the key parameters\n * @param {module:enums.publicKey} algo - The key algorithm\n * @param {Uint8Array} bytes - The key material to parse\n * @returns {{ read: Number, publicParams: Object }} Number of read bytes plus key parameters referenced by name.\n */\nexport function parsePublicKeyParams(algo, bytes) {\n let read = 0;\n switch (algo) {\n case enums.publicKey.rsaEncrypt:\n case enums.publicKey.rsaEncryptSign:\n case enums.publicKey.rsaSign: {\n const n = util.readMPI(bytes.subarray(read)); read += n.length + 2;\n const e = util.readMPI(bytes.subarray(read)); read += e.length + 2;\n return { read, publicParams: { n, e } };\n }\n case enums.publicKey.dsa: {\n const p = util.readMPI(bytes.subarray(read)); read += p.length + 2;\n const q = util.readMPI(bytes.subarray(read)); read += q.length + 2;\n const g = util.readMPI(bytes.subarray(read)); read += g.length + 2;\n const y = util.readMPI(bytes.subarray(read)); read += y.length + 2;\n return { read, publicParams: { p, q, g, y } };\n }\n case enums.publicKey.elgamal: {\n const p = util.readMPI(bytes.subarray(read)); read += p.length + 2;\n const g = util.readMPI(bytes.subarray(read)); read += g.length + 2;\n const y = util.readMPI(bytes.subarray(read)); read += y.length + 2;\n return { read, publicParams: { p, g, y } };\n }\n case enums.publicKey.ecdsa: {\n const oid = new OID(); read += oid.read(bytes);\n checkSupportedCurve(oid);\n const Q = util.readMPI(bytes.subarray(read)); read += Q.length + 2;\n return { read: read, publicParams: { oid, Q } };\n }\n case enums.publicKey.eddsa: {\n const oid = new OID(); read += oid.read(bytes);\n checkSupportedCurve(oid);\n let Q = util.readMPI(bytes.subarray(read)); read += Q.length + 2;\n Q = util.leftPad(Q, 33);\n return { read: read, publicParams: { oid, Q } };\n }\n case enums.publicKey.ecdh: {\n const oid = new OID(); read += oid.read(bytes);\n checkSupportedCurve(oid);\n const Q = util.readMPI(bytes.subarray(read)); read += Q.length + 2;\n const kdfParams = new KDFParams(); read += kdfParams.read(bytes.subarray(read));\n return { read: read, publicParams: { oid, Q, kdfParams } };\n }\n default:\n throw new UnsupportedError('Unknown public key encryption algorithm.');\n }\n}\n\n/**\n * Parse private key material in binary form to get the key parameters\n * @param {module:enums.publicKey} algo - The key algorithm\n * @param {Uint8Array} bytes - The key material to parse\n * @param {Object} publicParams - (ECC only) public params, needed to format some private params\n * @returns {{ read: Number, privateParams: Object }} Number of read bytes plus the key parameters referenced by name.\n */\nexport function parsePrivateKeyParams(algo, bytes, publicParams) {\n let read = 0;\n switch (algo) {\n case enums.publicKey.rsaEncrypt:\n case enums.publicKey.rsaEncryptSign:\n case enums.publicKey.rsaSign: {\n const d = util.readMPI(bytes.subarray(read)); read += d.length + 2;\n const p = util.readMPI(bytes.subarray(read)); read += p.length + 2;\n const q = util.readMPI(bytes.subarray(read)); read += q.length + 2;\n const u = util.readMPI(bytes.subarray(read)); read += u.length + 2;\n return { read, privateParams: { d, p, q, u } };\n }\n case enums.publicKey.dsa:\n case enums.publicKey.elgamal: {\n const x = util.readMPI(bytes.subarray(read)); read += x.length + 2;\n return { read, privateParams: { x } };\n }\n case enums.publicKey.ecdsa:\n case enums.publicKey.ecdh: {\n const curve = new 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 const curve = new Curve(publicParams.oid);\n let seed = util.readMPI(bytes.subarray(read)); read += seed.length + 2;\n seed = util.leftPad(seed, curve.payloadSize);\n return { read, privateParams: { seed } };\n }\n default:\n throw new UnsupportedError('Unknown public key encryption algorithm.');\n }\n}\n\n/** Returns the types comprising the encrypted session key of an algorithm\n * @param {module:enums.publicKey} algo - The key algorithm\n * @param {Uint8Array} bytes - The key material to parse\n * @returns {Object} The session key parameters referenced by name.\n */\nexport function parseEncSessionKeyParams(algo, bytes) {\n let read = 0;\n switch (algo) {\n // Algorithm-Specific Fields for RSA encrypted session keys:\n // - MPI of RSA encrypted value m**e mod n.\n case enums.publicKey.rsaEncrypt:\n case enums.publicKey.rsaEncryptSign: {\n const c = util.readMPI(bytes.subarray(read));\n return { c };\n }\n\n // Algorithm-Specific Fields for Elgamal encrypted session keys:\n // - MPI of Elgamal value g**k mod p\n // - MPI of Elgamal value m * y**k mod p\n case enums.publicKey.elgamal: {\n const c1 = util.readMPI(bytes.subarray(read)); read += c1.length + 2;\n const c2 = util.readMPI(bytes.subarray(read));\n return { c1, c2 };\n }\n // Algorithm-Specific Fields for ECDH encrypted session keys:\n // - MPI containing the ephemeral key used to establish the shared secret\n // - ECDH Symmetric Key\n case enums.publicKey.ecdh: {\n const V = util.readMPI(bytes.subarray(read)); read += V.length + 2;\n const C = new ECDHSymkey(); C.read(bytes.subarray(read));\n return { V, C };\n }\n default:\n throw new UnsupportedError('Unknown public key encryption algorithm.');\n }\n}\n\n/**\n * Convert params to MPI and serializes them in the proper order\n * @param {module:enums.publicKey} algo - The public key algorithm\n * @param {Object} params - The key parameters indexed by name\n * @returns {Uint8Array} The array containing the MPIs.\n */\nexport function serializeParams(algo, params) {\n 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('Unknown public key algorithm.');\n }\n}\n\n/**\n * Validate algorithm-specific key parameters\n * @param {module:enums.publicKey} algo - The public key algorithm\n * @param {Object} publicParams - Algorithm-specific public key parameters\n * @param {Object} privateParams - Algorithm-specific private key parameters\n * @returns {Promise<Boolean>} Whether the parameters are valid.\n * @async\n */\nexport async function validateParams(algo, publicParams, privateParams) {\n if (!publicParams || !privateParams) {\n throw new Error('Missing key parameters');\n }\n switch (algo) {\n case enums.publicKey.rsaEncrypt:\n case enums.publicKey.rsaEncryptSign:\n case enums.publicKey.rsaSign: {\n const { n, e } = publicParams;\n const { d, p, q, u } = privateParams;\n return publicKey.rsa.validateParams(n, e, d, p, q, u);\n }\n case enums.publicKey.dsa: {\n const { p, q, g, y } = publicParams;\n const { x } = privateParams;\n return publicKey.dsa.validateParams(p, q, g, y, x);\n }\n case enums.publicKey.elgamal: {\n const { p, g, y } = publicParams;\n const { x } = privateParams;\n return publicKey.elgamal.validateParams(p, g, y, x);\n }\n case enums.publicKey.ecdsa:\n case enums.publicKey.ecdh: {\n const algoModule = publicKey.elliptic[enums.read(enums.publicKey, algo)];\n const { oid, Q } = publicParams;\n const { d } = privateParams;\n return algoModule.validateParams(oid, Q, d);\n }\n case enums.publicKey.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('Unknown public key algorithm.');\n }\n}\n\n/**\n * Generates a random byte prefix for the specified algorithm\n * See {@link https://tools.ietf.org/html/rfc4880#section-9.2|RFC 4880 9.2} for algorithms.\n * @param {module:enums.symmetric} algo - Symmetric encryption algorithm\n * @returns {Promise<Uint8Array>} Random bytes with length equal to the block size of the cipher, plus the last two bytes repeated.\n * @async\n */\nexport async function getPrefixRandom(algo) {\n const { blockSize } = getCipher(algo);\n const prefixrandom = await getRandomBytes(blockSize);\n const repeat = new Uint8Array([prefixrandom[prefixrandom.length - 2], prefixrandom[prefixrandom.length - 1]]);\n return util.concat([prefixrandom, repeat]);\n}\n\n/**\n * Generating a session key for the specified symmetric algorithm\n * See {@link https://tools.ietf.org/html/rfc4880#section-9.2|RFC 4880 9.2} for algorithms.\n * @param {module:enums.symmetric} algo - Symmetric encryption algorithm\n * @returns {Uint8Array} Random bytes as a string to be used as a key.\n */\nexport function generateSessionKey(algo) {\n const { keySize } = getCipher(algo);\n return getRandomBytes(keySize);\n}\n\n/**\n * Get implementation of the given AEAD mode\n * @param {enums.aead} algo\n * @returns {Object}\n * @throws {Error} on invalid algo\n */\nexport function getAEADMode(algo) {\n const algoName = enums.read(enums.aead, algo);\n return mode[algoName];\n}\n\nexport { getCipher };\n\n/**\n * Check whether the given curve OID is supported\n * @param {module:type/oid} oid - EC object identifier\n * @throws {UnsupportedError} if curve is not supported\n */\nfunction checkSupportedCurve(oid) {\n try {\n oid.getName();\n } catch (e) {\n throw new UnsupportedError('Unknown curve OID');\n }\n}\n","/**\n * @fileoverview Provides access to all cryptographic primitives used in OpenPGP.js\n * @see module:crypto/crypto\n * @see module:crypto/signature\n * @see module:crypto/public_key\n * @see module:crypto/cipher\n * @see module:crypto/random\n * @see module:crypto/hash\n * @module crypto\n * @private\n */\n\nimport * as cipher from './cipher';\nimport hash from './hash';\nimport mode from './mode';\nimport publicKey from './public_key';\nimport * as signature from './signature';\nimport * as random from './random';\nimport * as pkcs1 from './pkcs1';\nimport * as pkcs5 from './pkcs5';\nimport * as crypto from './crypto';\nimport * as aesKW from './aes_kw';\n\n// TODO move cfb and gcm to cipher\nconst mod = {\n /** @see module:crypto/cipher */\n cipher: cipher,\n /** @see module:crypto/hash */\n hash: hash,\n /** @see module:crypto/mode */\n mode: mode,\n /** @see module:crypto/public_key */\n publicKey: publicKey,\n /** @see module:crypto/signature */\n signature: signature,\n /** @see module:crypto/random */\n random: random,\n /** @see module:crypto/pkcs1 */\n pkcs1: pkcs1,\n /** @see module:crypto/pkcs5 */\n pkcs5: pkcs5,\n /** @see module:crypto/aes_kw */\n aesKW: aesKW\n};\n\nObject.assign(mod, crypto);\n\nexport default mod;\n","\n\n\nvar TYPED_OK = typeof Uint8Array !== \"undefined\" &&\n typeof Uint16Array !== \"undefined\" &&\n typeof Int32Array !== \"undefined\";\n\nfunction _has(obj, key) {\n return Object.prototype.hasOwnProperty.call(obj, key);\n}\n\nexport function assign(obj /*...args obj, from1, from2, from3, ...*/) {\n var sources = Array.prototype.slice.call(arguments, 1);\n while (sources.length) {\n var source = sources.shift();\n if (!source) {\n continue; \n }\n\n if (typeof source !== \"object\") {\n throw new TypeError(source + \"must be non-object\");\n }\n\n for (var p in source) {\n if (_has(source, p)) {\n obj[p] = source[p];\n }\n }\n }\n\n return obj;\n //return Object.assign(...args);\n}\n\n\n// reduce buffer size, avoiding mem copy\nexport function shrinkBuf(buf, size) {\n if (buf.length === size) {\n return buf; \n }\n if (buf.subarray) {\n return buf.subarray(0, size); \n }\n buf.length = size;\n return buf;\n}\n\n\nconst fnTyped = {\n arraySet: function (dest, src, src_offs, len, dest_offs) {\n if (src.subarray && dest.subarray) {\n dest.set(src.subarray(src_offs, src_offs + len), dest_offs);\n return;\n }\n // Fallback to ordinary array\n for (let i = 0; i < len; i++) {\n dest[dest_offs + i] = src[src_offs + i];\n }\n },\n // Join array of chunks to single array.\n flattenChunks: function (chunks) {\n let i, l, len, pos, chunk;\n\n // calculate data length\n len = 0;\n for (i = 0, l = chunks.length; i < l; i++) {\n len += chunks[i].length;\n }\n\n // join chunks\n const result = new Uint8Array(len);\n pos = 0;\n for (i = 0, l = chunks.length; i < l; i++) {\n chunk = chunks[i];\n result.set(chunk, pos);\n pos += chunk.length;\n }\n\n return result;\n }\n};\n\nconst fnUntyped = {\n arraySet: function (dest, src, src_offs, len, dest_offs) {\n for (let i = 0; i < len; i++) {\n dest[dest_offs + i] = src[src_offs + i];\n }\n },\n // Join array of chunks to single array.\n flattenChunks: function (chunks) {\n return [].concat.apply([], chunks);\n }\n};\n\n\n// Enable/Disable typed arrays use, for testing\n//\n\nexport let Buf8 = TYPED_OK ? Uint8Array : Array;\nexport let Buf16 = TYPED_OK ? Uint16Array : Array;\nexport let Buf32 = TYPED_OK ? Int32Array : Array;\nexport let flattenChunks = TYPED_OK ? fnTyped.flattenChunks : fnUntyped.flattenChunks;\nexport let arraySet = TYPED_OK ? fnTyped.arraySet : fnUntyped.arraySet;\nexport function setTyped(on) {\n if (on) {\n Buf8 = Uint8Array;\n Buf16 = Uint16Array;\n Buf32 = Int32Array;\n ({ flattenChunks, arraySet } = fnTyped);\n } else {\n Buf8 = Array;\n Buf16 = Array;\n Buf32 = Array;\n ({ flattenChunks, arraySet } = fnUntyped);\n }\n}","\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\n/* Allowed flush values; see deflate() and inflate() below for details */\nexport const Z_NO_FLUSH = 0;\nexport const Z_PARTIAL_FLUSH = 1;\nexport const Z_SYNC_FLUSH = 2;\nexport const Z_FULL_FLUSH = 3;\nexport const Z_FINISH = 4;\nexport const Z_BLOCK = 5;\nexport const Z_TREES = 6;\n\n/* Return codes for the compression/decompression functions. Negative values\n * are errors, positive values are used for special but normal events.\n */\nexport const Z_OK = 0;\nexport const Z_STREAM_END = 1;\nexport const Z_NEED_DICT = 2;\nexport const Z_ERRNO = -1;\nexport const Z_STREAM_ERROR = -2;\nexport const Z_DATA_ERROR = -3;\n//export const Z_MEM_ERROR = -4;\nexport const Z_BUF_ERROR = -5;\n//export const Z_VERSION_ERROR = -6;\n\n /* compression levels */\nexport const Z_NO_COMPRESSION = 0;\nexport const Z_BEST_SPEED = 1;\nexport const Z_BEST_COMPRESSION = 9;\nexport const Z_DEFAULT_COMPRESSION = -1;\n\n\nexport const Z_FILTERED = 1;\nexport const Z_HUFFMAN_ONLY = 2;\nexport const Z_RLE = 3;\nexport const Z_FIXED = 4;\nexport const Z_DEFAULT_STRATEGY = 0;\n\n/* Possible values of the data_type field (though see inflate()) */\nexport const Z_BINARY = 0;\nexport const Z_TEXT = 1;\n//export const Z_ASCII = 1; // = Z_TEXT (deprecated)\nexport const Z_UNKNOWN = 2;\n\n/* The deflate compression method */\nexport const Z_DEFLATED = 8;\n//export const Z_NULL = null // Use -1 or null inline, depending on var type\n","\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\n/* eslint-disable space-unary-ops */\n\nimport * as utils from \"../utils/common.js\";\nimport {\n Z_FIXED,\n Z_BINARY,\n Z_TEXT,\n Z_UNKNOWN\n} from \"./constants.js\";\n\n/*============================================================================*/\n\n\nfunction zero(buf) {\n let len = buf.length; while (--len >= 0) {\n buf[len] = 0; \n } \n}\n\n// From zutil.h\n\nconst STORED_BLOCK = 0;\nconst STATIC_TREES = 1;\nconst DYN_TREES = 2;\n/* The three kinds of block type */\n\nconst MIN_MATCH = 3;\nconst MAX_MATCH = 258;\n/* The minimum and maximum match lengths */\n\n// From deflate.h\n/* ===========================================================================\n * Internal compression state.\n */\n\nconst LENGTH_CODES = 29;\n/* number of length codes, not counting the special END_BLOCK code */\n\nconst LITERALS = 256;\n/* number of literal bytes 0..255 */\n\nconst L_CODES = LITERALS + 1 + LENGTH_CODES;\n/* number of Literal or Length codes, including the END_BLOCK code */\n\nconst D_CODES = 30;\n/* number of distance codes */\n\nconst BL_CODES = 19;\n/* number of codes used to transfer the bit lengths */\n\nconst HEAP_SIZE = 2 * L_CODES + 1;\n/* maximum heap size */\n\nconst MAX_BITS = 15;\n/* All codes must not exceed MAX_BITS bits */\n\nconst Buf_size = 16;\n/* size of bit buffer in bi_buf */\n\n\n/* ===========================================================================\n * Constants\n */\n\nconst MAX_BL_BITS = 7;\n/* Bit length codes must not exceed MAX_BL_BITS bits */\n\nconst END_BLOCK = 256;\n/* end of block literal code */\n\nconst REP_3_6 = 16;\n/* repeat previous bit length 3-6 times (2 bits of repeat count) */\n\nconst REPZ_3_10 = 17;\n/* repeat a zero length 3-10 times (3 bits of repeat count) */\n\nconst REPZ_11_138 = 18;\n/* repeat a zero length 11-138 times (7 bits of repeat count) */\n\n/* eslint-disable comma-spacing,array-bracket-spacing */\nconst extra_lbits = /* extra bits for each length code */\n [0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0];\n\nconst extra_dbits = /* extra bits for each distance code */\n [0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13];\n\nconst extra_blbits = /* extra bits for each bit length code */\n [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7];\n\nconst bl_order =\n [16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];\n/* eslint-enable comma-spacing,array-bracket-spacing */\n\n/* The lengths of the bit length codes are sent in order of decreasing\n * probability, to avoid transmitting the lengths for unused bit length codes.\n */\n\n/* ===========================================================================\n * Local data. These are initialized only once.\n */\n\n// We pre-fill arrays with 0 to avoid uninitialized gaps\n\nconst DIST_CODE_LEN = 512; /* see definition of array dist_code below */\n\n// !!!! Use flat array instead of structure, Freq = i*2, Len = i*2+1\nconst static_ltree = new Array((L_CODES + 2) * 2);\nzero(static_ltree);\n/* The static literal tree. Since the bit lengths are imposed, there is no\n * need for the L_CODES extra codes used during heap construction. However\n * The codes 286 and 287 are needed to build a canonical tree (see _tr_init\n * below).\n */\n\nconst static_dtree = new Array(D_CODES * 2);\nzero(static_dtree);\n/* The static distance tree. (Actually a trivial tree since all codes use\n * 5 bits.)\n */\n\nconst _dist_code = new Array(DIST_CODE_LEN);\nzero(_dist_code);\n/* Distance codes. The first 256 values correspond to the distances\n * 3 .. 258, the last 256 values correspond to the top 8 bits of\n * the 15 bit distances.\n */\n\nconst _length_code = new Array(MAX_MATCH - MIN_MATCH + 1);\nzero(_length_code);\n/* length code for each normalized match length (0 == MIN_MATCH) */\n\nconst base_length = new Array(LENGTH_CODES);\nzero(base_length);\n/* First normalized length for each code (0 = MIN_MATCH) */\n\nconst base_dist = new Array(D_CODES);\nzero(base_dist);\n/* First normalized distance for each code (0 = distance of 1) */\n\n\nfunction StaticTreeDesc(static_tree, extra_bits, extra_base, elems, max_length) {\n\n this.static_tree = static_tree; /* static tree or NULL */\n this.extra_bits = extra_bits; /* extra bits for each code or NULL */\n this.extra_base = extra_base; /* base index for extra_bits */\n this.elems = elems; /* max number of elements in the tree */\n this.max_length = max_length; /* max bit length for the codes */\n\n // show if `static_tree` has data or dummy - needed for monomorphic objects\n this.has_stree = static_tree && static_tree.length;\n}\n\n\nlet static_l_desc;\nlet static_d_desc;\nlet static_bl_desc;\n\n\nfunction TreeDesc(dyn_tree, stat_desc) {\n this.dyn_tree = dyn_tree; /* the dynamic tree */\n this.max_code = 0; /* largest code with non zero frequency */\n this.stat_desc = stat_desc; /* the corresponding static tree */\n}\n\n\n\nfunction d_code(dist) {\n return dist < 256 ? _dist_code[dist] : _dist_code[256 + (dist >>> 7)];\n}\n\n\n/* ===========================================================================\n * Output a short LSB first on the stream.\n * IN assertion: there is enough room in pendingBuf.\n */\nfunction put_short(s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = w & 0xff;\n s.pending_buf[s.pending++] = w >>> 8 & 0xff;\n}\n\n\n/* ===========================================================================\n * Send a value on a given number of bits.\n * IN assertion: length <= 16 and value fits in length bits.\n */\nfunction send_bits(s, value, length) {\n if (s.bi_valid > Buf_size - length) {\n s.bi_buf |= value << s.bi_valid & 0xffff;\n put_short(s, s.bi_buf);\n s.bi_buf = value >> Buf_size - s.bi_valid;\n s.bi_valid += length - Buf_size;\n } else {\n s.bi_buf |= value << s.bi_valid & 0xffff;\n s.bi_valid += length;\n }\n}\n\n\nfunction send_code(s, c, tree) {\n send_bits(s, tree[c * 2]/*.Code*/, tree[c * 2 + 1]/*.Len*/);\n}\n\n\n/* ===========================================================================\n * Reverse the first len bits of a code, using straightforward code (a faster\n * method would use a table)\n * IN assertion: 1 <= len <= 15\n */\nfunction bi_reverse(code, len) {\n let res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n}\n\n\n/* ===========================================================================\n * Flush the bit buffer, keeping at most 7 bits in it.\n */\nfunction bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}\n\n\n/* ===========================================================================\n * Compute the optimal bit lengths for a tree and update the total bit length\n * for the current block.\n * IN assertion: the fields freq and dad are set, heap[heap_max] and\n * above are the tree nodes sorted by increasing frequency.\n * OUT assertions: the field len is set to the optimal bit length, the\n * array bl_count contains the frequencies for each bit length.\n * The length opt_len is updated; static_len is also updated if stree is\n * not null.\n */\nfunction gen_bitlen(s, desc)\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n{\n const tree = desc.dyn_tree;\n const max_code = desc.max_code;\n const stree = desc.stat_desc.static_tree;\n const has_stree = desc.stat_desc.has_stree;\n const extra = desc.stat_desc.extra_bits;\n const base = desc.stat_desc.extra_base;\n const max_length = desc.stat_desc.max_length;\n let h; /* heap index */\n let n, m; /* iterate over the tree elements */\n let bits; /* bit length */\n let xbits; /* extra bits */\n let f; /* frequency */\n let overflow = 0; /* number of elements with bit length too large */\n\n for (bits = 0; bits <= MAX_BITS; bits++) {\n s.bl_count[bits] = 0;\n }\n\n /* In a first pass, compute the optimal bit lengths (which may\n * overflow in the case of the bit length tree).\n */\n tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */\n\n for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n n = s.heap[h];\n bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;\n if (bits > max_length) {\n bits = max_length;\n overflow++;\n }\n tree[n * 2 + 1]/*.Len*/ = bits;\n /* We overwrite tree[n].Dad which is no longer needed */\n\n if (n > max_code) {\n continue; \n } /* not a leaf node */\n\n s.bl_count[bits]++;\n xbits = 0;\n if (n >= base) {\n xbits = extra[n - base];\n }\n f = tree[n * 2]/*.Freq*/;\n s.opt_len += f * (bits + xbits);\n if (has_stree) {\n s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);\n }\n }\n if (overflow === 0) {\n return; \n }\n\n // Trace((stderr,\"\\nbit length overflow\\n\"));\n /* This happens for example on obj2 and pic of the Calgary corpus */\n\n /* Find the first bit length which could increase: */\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0) {\n bits--; \n }\n s.bl_count[bits]--; /* move one leaf down the tree */\n s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */\n s.bl_count[max_length]--;\n /* The brother of the overflow item also moves one step up,\n * but this does not affect bl_count[max_length]\n */\n overflow -= 2;\n } while (overflow > 0);\n\n /* Now recompute all bit lengths, scanning in increasing frequency.\n * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n * lengths instead of fixing only the wrong ones. This idea is taken\n * from 'ar' written by Haruhiko Okumura.)\n */\n for (bits = max_length; bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n m = s.heap[--h];\n if (m > max_code) {\n continue; \n }\n if (tree[m * 2 + 1]/*.Len*/ !== bits) {\n // Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;\n tree[m * 2 + 1]/*.Len*/ = bits;\n }\n n--;\n }\n }\n}\n\n\n/* ===========================================================================\n * Generate the codes for a given tree and bit counts (which need not be\n * optimal).\n * IN assertion: the array bl_count contains the bit length statistics for\n * the given tree and the field len is set for all tree elements.\n * OUT assertion: the field code is set for all tree elements of non\n * zero code length.\n */\nfunction gen_codes(tree, max_code, bl_count)\n// ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n{\n const next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n let code = 0; /* running code value */\n let bits; /* bit index */\n let n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS; bits++) {\n next_code[bits] = code = code + bl_count[bits - 1] << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n // \"inconsistent bit counts\");\n //Tracev((stderr,\"\\ngen_codes: max_code %d \", max_code));\n\n for (n = 0; n <= max_code; n++) {\n const len = tree[n * 2 + 1]/*.Len*/;\n if (len === 0) {\n continue; \n }\n /* Now reverse the bits */\n tree[n * 2]/*.Code*/ = bi_reverse(next_code[len]++, len);\n\n //Tracecv(tree != static_ltree, (stderr,\"\\nn %3d %c l %2d c %4x (%x) \",\n // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));\n }\n}\n\n\n/* ===========================================================================\n * Initialize the various 'constant' tables.\n */\nfunction tr_static_init() {\n let n; /* iterates over tree elements */\n let bits; /* bit counter */\n let length; /* length value */\n let code; /* code value */\n let dist; /* distance index */\n const bl_count = new Array(MAX_BITS + 1);\n /* number of codes at each bit length for an optimal tree */\n\n // do check in _tr_init()\n //if (static_init_done) return;\n\n /* For some embedded targets, global variables are not initialized: */\n /*#ifdef NO_INIT_GLOBAL_POINTERS\n static_l_desc.static_tree = static_ltree;\n static_l_desc.extra_bits = extra_lbits;\n static_d_desc.static_tree = static_dtree;\n static_d_desc.extra_bits = extra_dbits;\n static_bl_desc.extra_bits = extra_blbits;\n#endif*/\n\n /* Initialize the mapping length (0..255) -> length code (0..28) */\n length = 0;\n for (code = 0; code < LENGTH_CODES - 1; code++) {\n base_length[code] = length;\n for (n = 0; n < 1 << extra_lbits[code]; n++) {\n _length_code[length++] = code;\n }\n }\n //Assert (length == 256, \"tr_static_init: length != 256\");\n /* Note that the length 255 (match length 258) can be represented\n * in two different ways: code 284 + 5 bits or code 285, so we\n * overwrite length_code[255] to use the best encoding:\n */\n _length_code[length - 1] = code;\n\n /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n dist = 0;\n for (code = 0; code < 16; code++) {\n base_dist[code] = dist;\n for (n = 0; n < 1 << extra_dbits[code]; n++) {\n _dist_code[dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: dist != 256\");\n dist >>= 7; /* from now on, all distances are divided by 128 */\n for (; code < D_CODES; code++) {\n base_dist[code] = dist << 7;\n for (n = 0; n < 1 << extra_dbits[code] - 7; n++) {\n _dist_code[256 + dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n /* Construct the codes of the static literal tree */\n for (bits = 0; bits <= MAX_BITS; bits++) {\n bl_count[bits] = 0;\n }\n\n n = 0;\n while (n <= 143) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n while (n <= 255) {\n static_ltree[n * 2 + 1]/*.Len*/ = 9;\n n++;\n bl_count[9]++;\n }\n while (n <= 279) {\n static_ltree[n * 2 + 1]/*.Len*/ = 7;\n n++;\n bl_count[7]++;\n }\n while (n <= 287) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n /* Codes 286 and 287 do not exist, but we must include them in the\n * tree construction to get a canonical Huffman tree (longest code\n * all ones)\n */\n gen_codes(static_ltree, L_CODES + 1, bl_count);\n\n /* The static distance tree is trivial: */\n for (n = 0; n < D_CODES; n++) {\n static_dtree[n * 2 + 1]/*.Len*/ = 5;\n static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);\n }\n\n // Now data ready and we can init static trees\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);\n static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);\n static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n\n //static_init_done = true;\n}\n\n\n/* ===========================================================================\n * Initialize a new block.\n */\nfunction init_block(s) {\n let n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) {\n s.dyn_ltree[n * 2]/*.Freq*/ = 0; \n }\n for (n = 0; n < D_CODES; n++) {\n s.dyn_dtree[n * 2]/*.Freq*/ = 0; \n }\n for (n = 0; n < BL_CODES; n++) {\n s.bl_tree[n * 2]/*.Freq*/ = 0; \n }\n\n s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.last_lit = s.matches = 0;\n}\n\n\n/* ===========================================================================\n * Flush the bit buffer and align the output on a byte boundary\n */\nfunction bi_windup(s) {\n if (s.bi_valid > 8) {\n put_short(s, s.bi_buf);\n } else if (s.bi_valid > 0) {\n //put_byte(s, (Byte)s->bi_buf);\n s.pending_buf[s.pending++] = s.bi_buf;\n }\n s.bi_buf = 0;\n s.bi_valid = 0;\n}\n\n/* ===========================================================================\n * Copy a stored block, storing first the length and its\n * one's complement if requested.\n */\nfunction copy_block(s, buf, len, header)\n//DeflateState *s;\n//charf *buf; /* the input data */\n//unsigned len; /* its length */\n//int header; /* true if block header must be written */\n{\n bi_windup(s); /* align on byte boundary */\n\n if (header) {\n put_short(s, len);\n put_short(s, ~len);\n }\n // while (len--) {\n // put_byte(s, *buf++);\n // }\n utils.arraySet(s.pending_buf, s.window, buf, len, s.pending);\n s.pending += len;\n}\n\n/* ===========================================================================\n * Compares to subtrees, using the tree depth as tie breaker when\n * the subtrees have equal frequency. This minimizes the worst case length.\n */\nfunction smaller(tree, n, m, depth) {\n const _n2 = n * 2;\n const _m2 = m * 2;\n return tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||\n tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m];\n}\n\n/* ===========================================================================\n * Restore the heap property by moving down the tree starting at node k,\n * exchanging a node with the smallest of its two sons if necessary, stopping\n * when the heap property is re-established (each father smaller than its\n * two sons).\n */\nfunction pqdownheap(s, tree, k)\n// deflate_state *s;\n// ct_data *tree; /* the tree to restore */\n// int k; /* node to move down */\n{\n const v = s.heap[k];\n let j = k << 1; /* left son of k */\n while (j <= s.heap_len) {\n /* Set j to the smallest of the two sons: */\n if (j < s.heap_len &&\n smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n j++;\n }\n /* Exit if v is smaller than both sons */\n if (smaller(tree, v, s.heap[j], s.depth)) {\n break; \n }\n\n /* Exchange v with the smallest son */\n s.heap[k] = s.heap[j];\n k = j;\n\n /* And continue down the tree, setting j to the left son of k */\n j <<= 1;\n }\n s.heap[k] = v;\n}\n\n\n// inlined manually\n// var SMALLEST = 1;\n\n/* ===========================================================================\n * Send the block data compressed using the given Huffman trees\n */\nfunction compress_block(s, ltree, dtree)\n// deflate_state *s;\n// const ct_data *ltree; /* literal tree */\n// const ct_data *dtree; /* distance tree */\n{\n let dist; /* distance of matched string */\n let lc; /* match length or unmatched char (if dist == 0) */\n let lx = 0; /* running index in l_buf */\n let code; /* the code to send */\n let extra; /* number of extra bits to send */\n\n if (s.last_lit !== 0) {\n do {\n dist = s.pending_buf[s.d_buf + lx * 2] << 8 | s.pending_buf[s.d_buf + lx * 2 + 1];\n lc = s.pending_buf[s.l_buf + lx];\n lx++;\n\n if (dist === 0) {\n send_code(s, lc, ltree); /* send a literal byte */\n //Tracecv(isgraph(lc), (stderr,\" '%c' \", lc));\n } else {\n /* Here, lc is the match length - MIN_MATCH */\n code = _length_code[lc];\n send_code(s, code + LITERALS + 1, ltree); /* send the length code */\n extra = extra_lbits[code];\n if (extra !== 0) {\n lc -= base_length[code];\n send_bits(s, lc, extra); /* send the extra length bits */\n }\n dist--; /* dist is now the match distance - 1 */\n code = d_code(dist);\n //Assert (code < D_CODES, \"bad d_code\");\n\n send_code(s, code, dtree); /* send the distance code */\n extra = extra_dbits[code];\n if (extra !== 0) {\n dist -= base_dist[code];\n send_bits(s, dist, extra); /* send the extra distance bits */\n }\n } /* literal or match pair ? */\n\n /* Check that the overlay between pending_buf and d_buf+l_buf is ok: */\n //Assert((uInt)(s->pending) < s->lit_bufsize + 2*lx,\n // \"pendingBuf overflow\");\n\n } while (lx < s.last_lit);\n }\n\n send_code(s, END_BLOCK, ltree);\n}\n\n\n/* ===========================================================================\n * Construct one Huffman tree and assigns the code bit strings and lengths.\n * Update the total bit length for the current block.\n * IN assertion: the field freq is set for all tree elements.\n * OUT assertions: the fields len and code are set to the optimal bit length\n * and corresponding code. The length opt_len is updated; static_len is\n * also updated if stree is not null. The field max_code is set.\n */\nfunction build_tree(s, desc)\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n{\n const tree = desc.dyn_tree;\n const stree = desc.stat_desc.static_tree;\n const has_stree = desc.stat_desc.has_stree;\n const elems = desc.stat_desc.elems;\n let n, m; /* iterate over heap elements */\n let max_code = -1; /* largest code with non zero frequency */\n let node; /* new node being created */\n\n /* Construct the initial heap, with least frequent element in\n * heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n+1].\n * heap[0] is not used.\n */\n s.heap_len = 0;\n s.heap_max = HEAP_SIZE;\n\n for (n = 0; n < elems; n++) {\n if (tree[n * 2]/*.Freq*/ !== 0) {\n s.heap[++s.heap_len] = max_code = n;\n s.depth[n] = 0;\n\n } else {\n tree[n * 2 + 1]/*.Len*/ = 0;\n }\n }\n\n /* The pkzip format requires that at least one distance code exists,\n * and that at least one bit should be sent even if there is only one\n * possible code. So to avoid special checks later on we force at least\n * two codes of non zero frequency.\n */\n while (s.heap_len < 2) {\n node = s.heap[++s.heap_len] = max_code < 2 ? ++max_code : 0;\n tree[node * 2]/*.Freq*/ = 1;\n s.depth[node] = 0;\n s.opt_len--;\n\n if (has_stree) {\n s.static_len -= stree[node * 2 + 1]/*.Len*/;\n }\n /* node is 0 or 1 so it does not have extra bits */\n }\n desc.max_code = max_code;\n\n /* The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree,\n * establish sub-heaps of increasing lengths:\n */\n for (n = s.heap_len >> 1/*int /2*/; n >= 1; n--) {\n pqdownheap(s, tree, n); \n }\n\n /* Construct the Huffman tree by repeatedly combining the least two\n * frequent nodes.\n */\n node = elems; /* next internal node of the tree */\n do {\n //pqremove(s, tree, n); /* n = node of least frequency */\n /*** pqremove ***/\n n = s.heap[1/*SMALLEST*/];\n s.heap[1/*SMALLEST*/] = s.heap[s.heap_len--];\n pqdownheap(s, tree, 1/*SMALLEST*/);\n /***/\n\n m = s.heap[1/*SMALLEST*/]; /* m = node of next least frequency */\n\n s.heap[--s.heap_max] = n; /* keep the nodes sorted by frequency */\n s.heap[--s.heap_max] = m;\n\n /* Create a new node father of n and m */\n tree[node * 2]/*.Freq*/ = tree[n * 2]/*.Freq*/ + tree[m * 2]/*.Freq*/;\n s.depth[node] = (s.depth[n] >= s.depth[m] ? s.depth[n] : s.depth[m]) + 1;\n tree[n * 2 + 1]/*.Dad*/ = tree[m * 2 + 1]/*.Dad*/ = node;\n\n /* and insert the new node in the heap */\n s.heap[1/*SMALLEST*/] = node++;\n pqdownheap(s, tree, 1/*SMALLEST*/);\n\n } while (s.heap_len >= 2);\n\n s.heap[--s.heap_max] = s.heap[1/*SMALLEST*/];\n\n /* At this point, the fields freq and dad are set. We can now\n * generate the bit lengths.\n */\n gen_bitlen(s, desc);\n\n /* The field len is now set, we can generate the bit codes */\n gen_codes(tree, max_code, s.bl_count);\n}\n\n\n/* ===========================================================================\n * Scan a literal or distance tree to determine the frequencies of the codes\n * in the bit length tree.\n */\nfunction scan_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n let n; /* iterates over all tree elements */\n let prevlen = -1; /* last emitted length */\n let curlen; /* length of current code */\n\n let nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n let count = 0; /* repeat count of the current code */\n let max_count = 7; /* max repeat count */\n let min_count = 4; /* min repeat count */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n s.bl_tree[curlen * 2]/*.Freq*/ += count;\n\n } else if (curlen !== 0) {\n\n if (curlen !== prevlen) {\n s.bl_tree[curlen * 2]/*.Freq*/++; \n }\n s.bl_tree[REP_3_6 * 2]/*.Freq*/++;\n\n } else if (count <= 10) {\n s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;\n\n } else {\n s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}\n\n\n/* ===========================================================================\n * Send a literal or distance tree in compressed form, using the codes in\n * bl_tree.\n */\nfunction send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n let n; /* iterates over all tree elements */\n let prevlen = -1; /* last emitted length */\n let curlen; /* length of current code */\n\n let nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n let count = 0; /* repeat count of the current code */\n let max_count = 7; /* max repeat count */\n let min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do {\n send_code(s, curlen, s.bl_tree); \n } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}\n\n\n/* ===========================================================================\n * Construct the Huffman tree for the bit lengths and return the index in\n * bl_order of the last bit length code to send.\n */\nfunction build_bl_tree(s) {\n let max_blindex; /* index of last bit length code of non zero freq */\n\n /* Determine the bit length frequencies for literal and distance trees */\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n\n /* Build the bit length tree: */\n build_tree(s, s.bl_desc);\n /* opt_len now includes the length of the tree representations, except\n * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n */\n\n /* Determine the number of bit length codes to send. The pkzip format\n * requires that at least 4 bit length codes be sent. (appnote.txt says\n * 3 but the actual value used is 4.)\n */\n for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {\n break;\n }\n }\n /* Update opt_len to include the bit length tree and counts */\n s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n // s->opt_len, s->static_len));\n\n return max_blindex;\n}\n\n\n/* ===========================================================================\n * Send the header for a block using dynamic Huffman trees: the counts, the\n * lengths of the bit length codes, the literal tree and the distance tree.\n * IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4.\n */\nfunction send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n let rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes - 1, 5);\n send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}\n\n\n/* ===========================================================================\n * Check if the data type is TEXT or BINARY, using the following algorithm:\n * - TEXT if the two conditions below are satisfied:\n * a) There are no non-portable control characters belonging to the\n * \"black list\" (0..6, 14..25, 28..31).\n * b) There is at least one printable character belonging to the\n * \"white list\" (9 {TAB}, 10 {LF}, 13 {CR}, 32..255).\n * - BINARY otherwise.\n * - The following partially-portable control characters form a\n * \"gray list\" that is ignored in this detection algorithm:\n * (7 {BEL}, 8 {BS}, 11 {VT}, 12 {FF}, 26 {SUB}, 27 {ESC}).\n * IN assertion: the fields Freq of dyn_ltree are set.\n */\nfunction detect_data_type(s) {\n /* black_mask is the bit mask of black-listed bytes\n * set bits 0..6, 14..25, and 28..31\n * 0xf3ffc07f = binary 11110011111111111100000001111111\n */\n let black_mask = 0xf3ffc07f;\n let n;\n\n /* Check for non-textual (\"black-listed\") bytes. */\n for (n = 0; n <= 31; n++, black_mask >>>= 1) {\n if (black_mask & 1 && s.dyn_ltree[n * 2]/*.Freq*/ !== 0) {\n return Z_BINARY;\n }\n }\n\n /* Check for textual (\"white-listed\") bytes. */\n if (s.dyn_ltree[9 * 2]/*.Freq*/ !== 0 || s.dyn_ltree[10 * 2]/*.Freq*/ !== 0 ||\n s.dyn_ltree[13 * 2]/*.Freq*/ !== 0) {\n return Z_TEXT;\n }\n for (n = 32; n < LITERALS; n++) {\n if (s.dyn_ltree[n * 2]/*.Freq*/ !== 0) {\n return Z_TEXT;\n }\n }\n\n /* There are no \"black-listed\" or \"white-listed\" bytes:\n * this stream either is empty or has tolerated (\"gray-listed\") bytes only.\n */\n return Z_BINARY;\n}\n\n\nlet static_init_done = false;\n\n/* ===========================================================================\n * Initialize the tree data structures for a new zlib stream.\n */\nfunction _tr_init(s) {\n\n if (!static_init_done) {\n tr_static_init();\n static_init_done = true;\n }\n\n s.l_desc = new TreeDesc(s.dyn_ltree, static_l_desc);\n s.d_desc = new TreeDesc(s.dyn_dtree, static_d_desc);\n s.bl_desc = new TreeDesc(s.bl_tree, static_bl_desc);\n\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n /* Initialize the first block of the first file: */\n init_block(s);\n}\n\n\n/* ===========================================================================\n * Send a stored block\n */\nfunction _tr_stored_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3); /* send block type */\n copy_block(s, buf, stored_len, true); /* with header */\n}\n\n\n/* ===========================================================================\n * Send one empty static block to give enough lookahead for inflate.\n * This takes 10 bits, of which 7 may remain in the bit buffer.\n */\nfunction _tr_align(s) {\n send_bits(s, STATIC_TREES << 1, 3);\n send_code(s, END_BLOCK, static_ltree);\n bi_flush(s);\n}\n\n\n/* ===========================================================================\n * Determine the best encoding for the current block: dynamic trees, static\n * trees or store, and output the encoded block to the zip file.\n */\nfunction _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n let opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n let max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = s.opt_len + 3 + 7 >>> 3;\n static_lenb = s.static_len + 3 + 7 >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) {\n opt_lenb = static_lenb; \n }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if (stored_len + 4 <= opt_lenb && buf !== -1) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}\n\n/* ===========================================================================\n * Save the match info and tally the frequency counts. Return true if\n * the current block must be flushed.\n */\nfunction _tr_tally(s, dist, lc)\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n //var out_length, in_length, dcode;\n\n s.pending_buf[s.d_buf + s.last_lit * 2] = dist >>> 8 & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc * 2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n // (!) This block is disabled in zlib defaults,\n // don't enable it for binary compatibility\n\n //#ifdef TRUNCATE_BLOCK\n // /* Try to guess if it is profitable to stop the current block here */\n // if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n // /* Compute an upper bound for the compressed length */\n // out_length = s.last_lit*8;\n // in_length = s.strstart - s.block_start;\n //\n // for (dcode = 0; dcode < D_CODES; dcode++) {\n // out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n // }\n // out_length >>>= 3;\n // //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n // // s->last_lit, in_length, out_length,\n // // 100L - out_length*100L/in_length));\n // if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n // return true;\n // }\n // }\n //#endif\n\n return s.last_lit === s.lit_bufsize - 1;\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}\n\nexport {\n _tr_init,\n _tr_stored_block,\n _tr_flush_block,\n _tr_tally,\n _tr_align\n};","\n\n// Note: adler32 takes 12% for level 0 and 2% for level 6.\n// It isn't worth it to make additional optimizations as in original.\n// Small size is preferable.\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nexport default function adler32(adler, buf, len, pos) {\n let s1 = adler & 0xffff |0,\n s2 = adler >>> 16 & 0xffff |0,\n n = 0;\n\n while (len !== 0) {\n // Set limit ~ twice less than 5552, to keep\n // s2 in 31-bits, because we force signed ints.\n // in other case %= will fail.\n n = len > 2000 ? 2000 : len;\n len -= n;\n\n do {\n s1 = s1 + buf[pos++] |0;\n s2 = s2 + s1 |0;\n } while (--n);\n\n s1 %= 65521;\n s2 %= 65521;\n }\n\n return s1 | s2 << 16 |0;\n}\n","\n\n// Note: we can't get significant speed boost here.\n// So write code to minimize size - no pregenerated tables\n// and array tools dependencies.\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\n// Use ordinary array, since untyped makes no boost here\nfunction makeTable() {\n let c;\n const table = [];\n\n for (let n = 0; n < 256; n++) {\n c = n;\n for (let k = 0; k < 8; k++) {\n c = c & 1 ? 0xEDB88320 ^ c >>> 1 : c >>> 1;\n }\n table[n] = c;\n }\n\n return table;\n}\n\n// Create table on load. Just 255 signed longs. Not a problem.\nconst crcTable = makeTable();\n\n\nexport default function crc32(crc, buf, len, pos) {\n const t = crcTable,\n end = pos + len;\n\n crc ^= -1;\n\n for (let i = pos; i < end; i++) {\n crc = crc >>> 8 ^ t[(crc ^ buf[i]) & 0xFF];\n }\n\n return crc ^ -1; // >>> 0;\n}","\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nexport default {\n 2: \"need dictionary\", /* Z_NEED_DICT 2 */\n 1: \"stream end\", /* Z_STREAM_END 1 */\n 0: \"\", /* Z_OK 0 */\n \"-1\": \"file error\", /* Z_ERRNO (-1) */\n \"-2\": \"stream error\", /* Z_STREAM_ERROR (-2) */\n \"-3\": \"data error\", /* Z_DATA_ERROR (-3) */\n \"-4\": \"insufficient memory\", /* Z_MEM_ERROR (-4) */\n \"-5\": \"buffer error\", /* Z_BUF_ERROR (-5) */\n \"-6\": \"incompatible version\" /* Z_VERSION_ERROR (-6) */\n};\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nimport * as utils from \"../utils/common.js\";\nimport * as trees from \"./trees.js\";\nimport adler32 from \"./adler32.js\";\nimport crc32 from \"./crc32.js\";\nimport msg from \"./messages.js\";\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\n\nimport {\n Z_NO_FLUSH,\n Z_PARTIAL_FLUSH,\n Z_FULL_FLUSH,\n Z_FINISH,\n Z_BLOCK,\n Z_OK,\n Z_STREAM_END,\n Z_STREAM_ERROR,\n Z_DATA_ERROR,\n Z_BUF_ERROR,\n Z_DEFAULT_COMPRESSION,\n Z_FILTERED,\n Z_HUFFMAN_ONLY,\n Z_RLE,\n Z_FIXED,\n Z_DEFAULT_STRATEGY,\n Z_UNKNOWN,\n Z_DEFLATED\n} from \"./constants.js\";\n\n/*============================================================================*/\n\n\nconst MAX_MEM_LEVEL = 9;\n/* Maximum value for memLevel in deflateInit2 */\nconst MAX_WBITS = 15;\n/* 32K LZ77 window */\nconst DEF_MEM_LEVEL = 8;\n\n\nconst LENGTH_CODES = 29;\n/* number of length codes, not counting the special END_BLOCK code */\nconst LITERALS = 256;\n/* number of literal bytes 0..255 */\nconst L_CODES = LITERALS + 1 + LENGTH_CODES;\n/* number of Literal or Length codes, including the END_BLOCK code */\nconst D_CODES = 30;\n/* number of distance codes */\nconst BL_CODES = 19;\n/* number of codes used to transfer the bit lengths */\nconst HEAP_SIZE = 2 * L_CODES + 1;\n/* maximum heap size */\nconst MAX_BITS = 15;\n/* All codes must not exceed MAX_BITS bits */\n\nconst MIN_MATCH = 3;\nconst MAX_MATCH = 258;\nconst MIN_LOOKAHEAD = (MAX_MATCH + MIN_MATCH + 1);\n\nconst PRESET_DICT = 0x20;\n\nconst INIT_STATE = 42;\nconst EXTRA_STATE = 69;\nconst NAME_STATE = 73;\nconst COMMENT_STATE = 91;\nconst HCRC_STATE = 103;\nconst BUSY_STATE = 113;\nconst FINISH_STATE = 666;\n\nconst BS_NEED_MORE = 1; /* block not completed, need more input or more output */\nconst BS_BLOCK_DONE = 2; /* block flush performed */\nconst BS_FINISH_STARTED = 3; /* finish started, need only more output at next deflate */\nconst BS_FINISH_DONE = 4; /* finish done, accept no more input or output */\n\nconst OS_CODE = 0x03; // Unix :) . Don't detect, use this default.\n\nfunction err(strm, errorCode) {\n strm.msg = msg[errorCode];\n return errorCode;\n}\n\nfunction rank(f) {\n return ((f) << 1) - ((f) > 4 ? 9 : 0);\n}\n\nfunction zero(buf) { let len = buf.length; while (--len >= 0) { buf[len] = 0; } }\n\n\n/* =========================================================================\n * Flush as much pending output as possible. All deflate() output goes\n * through this function so some applications may wish to modify it\n * to avoid allocating a large strm->output buffer and copying into it.\n * (See also read_buf()).\n */\nfunction flush_pending(strm) {\n const s = strm.state;\n\n //_tr_flush_bits(s);\n let len = s.pending;\n if (len > strm.avail_out) {\n len = strm.avail_out;\n }\n if (len === 0) { return; }\n\n utils.arraySet(strm.output, s.pending_buf, s.pending_out, len, strm.next_out);\n strm.next_out += len;\n s.pending_out += len;\n strm.total_out += len;\n strm.avail_out -= len;\n s.pending -= len;\n if (s.pending === 0) {\n s.pending_out = 0;\n }\n}\n\n\nfunction flush_block_only(s, last) {\n trees._tr_flush_block(s, (s.block_start >= 0 ? s.block_start : -1), s.strstart - s.block_start, last);\n s.block_start = s.strstart;\n flush_pending(s.strm);\n}\n\n\nfunction put_byte(s, b) {\n s.pending_buf[s.pending++] = b;\n}\n\n\n/* =========================================================================\n * Put a short in the pending buffer. The 16-bit value is put in MSB order.\n * IN assertion: the stream state is correct and there is enough room in\n * pending_buf.\n */\nfunction putShortMSB(s, b) {\n // put_byte(s, (Byte)(b >> 8));\n // put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}\n\n\n/* ===========================================================================\n * Read a new buffer from the current input stream, update the adler32\n * and total number of bytes read. All deflate() input goes through\n * this function so some applications may wish to modify it to avoid\n * allocating a large strm->input buffer and copying from it.\n * (See also flush_pending()).\n */\nfunction read_buf(strm, buf, start, size) {\n let len = strm.avail_in;\n\n if (len > size) { len = size; }\n if (len === 0) { return 0; }\n\n strm.avail_in -= len;\n\n // zmemcpy(buf, strm->next_in, len);\n utils.arraySet(buf, strm.input, strm.next_in, len, start);\n if (strm.state.wrap === 1) {\n strm.adler = adler32(strm.adler, buf, len, start);\n }\n\n else if (strm.state.wrap === 2) {\n strm.adler = crc32(strm.adler, buf, len, start);\n }\n\n strm.next_in += len;\n strm.total_in += len;\n\n return len;\n}\n\n\n/* ===========================================================================\n * Set match_start to the longest match starting at the given string and\n * return its length. Matches shorter or equal to prev_length are discarded,\n * in which case the result is equal to prev_length and match_start is\n * garbage.\n * IN assertions: cur_match is the head of the hash chain for the current\n * string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1\n * OUT assertion: the match length is not greater than s->lookahead.\n */\nfunction longest_match(s, cur_match) {\n let chain_length = s.max_chain_length; /* max hash chain length */\n let scan = s.strstart; /* current string */\n let match; /* matched string */\n let len; /* length of current match */\n let best_len = s.prev_length; /* best match length so far */\n let nice_match = s.nice_match; /* stop if match long enough */\n const limit = (s.strstart > (s.w_size - MIN_LOOKAHEAD)) ?\n s.strstart - (s.w_size - MIN_LOOKAHEAD) : 0/*NIL*/;\n\n const _win = s.window; // shortcut\n\n const wmask = s.w_mask;\n const prev = s.prev;\n\n /* Stop when cur_match becomes <= limit. To simplify the code,\n * we prevent matches with the string of window index 0.\n */\n\n const strend = s.strstart + MAX_MATCH;\n let scan_end1 = _win[scan + best_len - 1];\n let scan_end = _win[scan + best_len];\n\n /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.\n * It is easy to get rid of this optimization if necessary.\n */\n // Assert(s->hash_bits >= 8 && MAX_MATCH == 258, \"Code too clever\");\n\n /* Do not waste too much time if we already have a good match: */\n if (s.prev_length >= s.good_match) {\n chain_length >>= 2;\n }\n /* Do not look for matches beyond the end of the input. This is necessary\n * to make deflate deterministic.\n */\n if (nice_match > s.lookahead) { nice_match = s.lookahead; }\n\n // Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, \"need lookahead\");\n\n do {\n // Assert(cur_match < s->strstart, \"no future\");\n match = cur_match;\n\n /* Skip to next match if the match length cannot increase\n * or if the match length is less than 2. Note that the checks below\n * for insufficient lookahead only occur occasionally for performance\n * reasons. Therefore uninitialized memory will be accessed, and\n * conditional jumps will be made that depend on those values.\n * However the length of the match is limited to the lookahead, so\n * the output of deflate is not affected by the uninitialized values.\n */\n\n if (_win[match + best_len] !== scan_end ||\n _win[match + best_len - 1] !== scan_end1 ||\n _win[match] !== _win[scan] ||\n _win[++match] !== _win[scan + 1]) {\n continue;\n }\n\n /* The check at best_len-1 can be removed because it will be made\n * again later. (This heuristic is not always a win.)\n * It is not necessary to compare scan[2] and match[2] since they\n * are always equal when the other bytes match, given that\n * the hash keys are equal and that HASH_BITS >= 8.\n */\n scan += 2;\n match++;\n // Assert(*scan == *match, \"match[2]?\");\n\n /* We check for insufficient lookahead only every 8th comparison;\n * the 256th check will be made at strstart+258.\n */\n do {\n /*jshint noempty:false*/\n } while (_win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n scan < strend);\n\n // Assert(scan <= s->window+(unsigned)(s->window_size-1), \"wild scan\");\n\n len = MAX_MATCH - (strend - scan);\n scan = strend - MAX_MATCH;\n\n if (len > best_len) {\n s.match_start = cur_match;\n best_len = len;\n if (len >= nice_match) {\n break;\n }\n scan_end1 = _win[scan + best_len - 1];\n scan_end = _win[scan + best_len];\n }\n } while ((cur_match = prev[cur_match & wmask]) > limit && --chain_length !== 0);\n\n if (best_len <= s.lookahead) {\n return best_len;\n }\n return s.lookahead;\n}\n\n\n/* ===========================================================================\n * Fill the window when the lookahead becomes insufficient.\n * Updates strstart and lookahead.\n *\n * IN assertion: lookahead < MIN_LOOKAHEAD\n * OUT assertions: strstart <= window_size-MIN_LOOKAHEAD\n * At least one byte has been read, or avail_in == 0; reads are\n * performed for at least two bytes (required for the zip translate_eol\n * option -- not supported here).\n */\nfunction fill_window(s) {\n const _w_size = s.w_size;\n let p, n, m, more, str;\n\n //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n do {\n more = s.window_size - s.lookahead - s.strstart;\n\n // JS ints have 32 bit, block below not needed\n /* Deal with !@#$% 64K limit: */\n //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n\n\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n\n utils.arraySet(s.window, s.window, _w_size, _w_size, 0);\n s.match_start -= _w_size;\n s.strstart -= _w_size;\n /* we now have strstart >= MAX_DIST */\n s.block_start -= _w_size;\n\n /* Slide the hash table (could be avoided with 32 bit values\n at the expense of memory usage). We slide even when level == 0\n to keep the hash table consistent if we switch back to level > 0\n later. (Using level 0 permanently is not an optimal usage of\n zlib, so we don't care about this pathological case.)\n */\n\n n = s.hash_size;\n p = n;\n do {\n m = s.head[--p];\n s.head[p] = (m >= _w_size ? m - _w_size : 0);\n } while (--n);\n\n n = _w_size;\n p = n;\n do {\n m = s.prev[--p];\n s.prev[p] = (m >= _w_size ? m - _w_size : 0);\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n\n more += _w_size;\n }\n if (s.strm.avail_in === 0) {\n break;\n }\n\n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n //Assert(more >= 2, \"more < 2\");\n n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n s.lookahead += n;\n\n /* Initialize the hash value now that we have some input: */\n if (s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;\n //#if MIN_MATCH != 3\n // Call update_hash() MIN_MATCH-3 more times\n //#endif\n while (s.insert) {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n s.insert--;\n if (s.lookahead + s.insert < MIN_MATCH) {\n break;\n }\n }\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n\n /* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */\n // if (s.high_water < s.window_size) {\n // var curr = s.strstart + s.lookahead;\n // var init = 0;\n //\n // if (s.high_water < curr) {\n // /* Previous high water mark below current data -- zero WIN_INIT\n // * bytes or up to end of window, whichever is less.\n // */\n // init = s.window_size - curr;\n // if (init > WIN_INIT)\n // init = WIN_INIT;\n // zmemzero(s->window + curr, (unsigned)init);\n // s->high_water = curr + init;\n // }\n // else if (s->high_water < (ulg)curr + WIN_INIT) {\n // /* High water mark at or above current data, but below current data\n // * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n // * to end of window, whichever is less.\n // */\n // init = (ulg)curr + WIN_INIT - s->high_water;\n // if (init > s->window_size - s->high_water)\n // init = s->window_size - s->high_water;\n // zmemzero(s->window + s->high_water, (unsigned)init);\n // s->high_water += init;\n // }\n // }\n //\n // Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n // \"not enough room for search\");\n}\n\n/* ===========================================================================\n * Copy without compression as much as possible from the input stream, return\n * the current block state.\n * This function does not insert new strings in the dictionary since\n * uncompressible data is probably not useful. This function is used\n * only for the level=0 compression option.\n * NOTE: this function should be optimized to avoid extra copying from\n * window to pending_buf.\n */\nfunction deflate_stored(s, flush) {\n /* Stored blocks are limited to 0xffff bytes, pending_buf is limited\n * to pending_buf_size, and each stored block has a 5 byte header:\n */\n let max_block_size = 0xffff;\n\n if (max_block_size > s.pending_buf_size - 5) {\n max_block_size = s.pending_buf_size - 5;\n }\n\n /* Copy as much as possible from input to output: */\n for (; ;) {\n /* Fill the window as much as possible: */\n if (s.lookahead <= 1) {\n\n //Assert(s->strstart < s->w_size+MAX_DIST(s) ||\n // s->block_start >= (long)s->w_size, \"slide too late\");\n // if (!(s.strstart < s.w_size + (s.w_size - MIN_LOOKAHEAD) ||\n // s.block_start >= s.w_size)) {\n // throw new Error(\"slide too late\");\n // }\n\n fill_window(s);\n if (s.lookahead === 0 && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n\n if (s.lookahead === 0) {\n break;\n }\n /* flush the current block */\n }\n //Assert(s->block_start >= 0L, \"block gone\");\n // if (s.block_start < 0) throw new Error(\"block gone\");\n\n s.strstart += s.lookahead;\n s.lookahead = 0;\n\n /* Emit a stored block if pending_buf will be full: */\n const max_start = s.block_start + max_block_size;\n\n if (s.strstart === 0 || s.strstart >= max_start) {\n /* strstart == 0 is possible when wraparound on 16-bit machine */\n s.lookahead = s.strstart - max_start;\n s.strstart = max_start;\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n\n\n }\n /* Flush if we may have to slide, otherwise block_start may become\n * negative and the data will be gone:\n */\n if (s.strstart - s.block_start >= (s.w_size - MIN_LOOKAHEAD)) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n\n s.insert = 0;\n\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n\n if (s.strstart > s.block_start) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_NEED_MORE;\n}\n\n/* ===========================================================================\n * Compress as much as possible from the input stream, return the current\n * block state.\n * This function does not perform lazy evaluation of matches and inserts\n * new strings in the dictionary only for unmatched strings or for short\n * matches. It is used only for the fast compression options.\n */\nfunction deflate_fast(s, flush) {\n let hash_head; /* head of the hash chain */\n let bflush; /* set if current block must be flushed */\n\n for (; ;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n //#if MIN_MATCH != 3\n // Call UPDATE_HASH() MIN_MATCH-3 more times\n //#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1);\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}\n\n/* ===========================================================================\n * Same as above, but achieves better compression. We use a lazy\n * evaluation for matches: a match is finally adopted only if there is\n * no better match at the next window position.\n */\nfunction deflate_slow(s, flush) {\n let hash_head; /* head of hash chain */\n let bflush; /* set if current block must be flushed */\n\n let max_insert;\n\n /* Process the input block. */\n for (; ;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}\n\n\n/* ===========================================================================\n * For Z_RLE, simply look for runs of bytes, generate matches only of distance\n * one. Do not maintain a hash table. (It will be regenerated if this run of\n * deflate switches away from Z_RLE.)\n */\nfunction deflate_rle(s, flush) {\n let bflush; /* set if current block must be flushed */\n let prev; /* byte at distance one to match */\n let scan, strend; /* scan goes up to strend for length of run */\n\n const _win = s.window;\n\n for (; ;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}\n\n/* ===========================================================================\n * For Z_HUFFMAN_ONLY, do not look for matches. Do not maintain a hash table.\n * (It will be regenerated if this run of deflate switches away from Huffman.)\n */\nfunction deflate_huff(s, flush) {\n let bflush; /* set if current block must be flushed */\n\n for (; ;) {\n /* Make sure that we have a literal to write. */\n if (s.lookahead === 0) {\n fill_window(s);\n if (s.lookahead === 0) {\n if (flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n break; /* flush the current block */\n }\n }\n\n /* Output a literal byte */\n s.match_length = 0;\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n s.lookahead--;\n s.strstart++;\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}\n\n/* Values for max_lazy_match, good_match and max_chain_length, depending on\n * the desired pack level (0..9). The values given below have been tuned to\n * exclude worst case performance for pathological files. Better values may be\n * found for specific files.\n */\nclass Config {\n constructor(good_length, max_lazy, nice_length, max_chain, func) {\n this.good_length = good_length;\n this.max_lazy = max_lazy;\n this.nice_length = nice_length;\n this.max_chain = max_chain;\n this.func = func;\n }\n};\n\nconst configuration_table = [\n /* good lazy nice chain */\n new Config(0, 0, 0, 0, deflate_stored), /* 0 store only */\n new Config(4, 4, 8, 4, deflate_fast), /* 1 max speed, no lazy matches */\n new Config(4, 5, 16, 8, deflate_fast), /* 2 */\n new Config(4, 6, 32, 32, deflate_fast), /* 3 */\n\n new Config(4, 4, 16, 16, deflate_slow), /* 4 lazy matches */\n new Config(8, 16, 32, 32, deflate_slow), /* 5 */\n new Config(8, 16, 128, 128, deflate_slow), /* 6 */\n new Config(8, 32, 128, 256, deflate_slow), /* 7 */\n new Config(32, 128, 258, 1024, deflate_slow), /* 8 */\n new Config(32, 258, 258, 4096, deflate_slow) /* 9 max compression */\n];\n\n\n/* ===========================================================================\n * Initialize the \"longest match\" routines for a new zlib stream\n */\nfunction lm_init(s) {\n s.window_size = 2 * s.w_size;\n\n /*** CLEAR_HASH(s); ***/\n zero(s.head); // Fill with NIL (= 0);\n\n /* Set the default configuration parameters:\n */\n s.max_lazy_match = configuration_table[s.level].max_lazy;\n s.good_match = configuration_table[s.level].good_length;\n s.nice_match = configuration_table[s.level].nice_length;\n s.max_chain_length = configuration_table[s.level].max_chain;\n\n s.strstart = 0;\n s.block_start = 0;\n s.lookahead = 0;\n s.insert = 0;\n s.match_length = s.prev_length = MIN_MATCH - 1;\n s.match_available = 0;\n s.ins_h = 0;\n}\n\nclass DeflateState {\n constructor() {\n this.strm = null; /* pointer back to this zlib stream */\n this.status = 0; /* as the name implies */\n this.pending_buf = null; /* output still pending */\n this.pending_buf_size = 0; /* size of pending_buf */\n this.pending_out = 0; /* next pending byte to output to the stream */\n this.pending = 0; /* nb of bytes in the pending buffer */\n this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip */\n this.gzhead = null; /* gzip header information to write */\n this.gzindex = 0; /* where in extra, name, or comment */\n this.method = Z_DEFLATED; /* can only be DEFLATED */\n this.last_flush = -1; /* value of flush param for previous deflate call */\n\n this.w_size = 0; /* LZ77 window size (32K by default) */\n this.w_bits = 0; /* log2(w_size) (8..16) */\n this.w_mask = 0; /* w_size - 1 */\n\n this.window = null;\n /* Sliding window. Input bytes are read into the second half of the window,\n * and move to the first half later to keep a dictionary of at least wSize\n * bytes. With this organization, matches are limited to a distance of\n * wSize-MAX_MATCH bytes, but this ensures that IO is always\n * performed with a length multiple of the block size.\n */\n\n this.window_size = 0;\n /* Actual size of window: 2*wSize, except when the user input buffer\n * is directly used as sliding window.\n */\n\n this.prev = null;\n /* Link to older string with same hash index. To limit the size of this\n * array to 64K, this link is maintained only for the last 32K strings.\n * An index in this array is thus a window index modulo 32K.\n */\n\n this.head = null; /* Heads of the hash chains or NIL. */\n\n this.ins_h = 0; /* hash index of string to be inserted */\n this.hash_size = 0; /* number of elements in hash table */\n this.hash_bits = 0; /* log2(hash_size) */\n this.hash_mask = 0; /* hash_size-1 */\n\n this.hash_shift = 0;\n /* Number of bits by which ins_h must be shifted at each input\n * step. It must be such that after MIN_MATCH steps, the oldest\n * byte no longer takes part in the hash key, that is:\n * hash_shift * MIN_MATCH >= hash_bits\n */\n\n this.block_start = 0;\n /* Window position at the beginning of the current output block. Gets\n * negative when the window is moved backwards.\n */\n\n this.match_length = 0; /* length of best match */\n this.prev_match = 0; /* previous match */\n this.match_available = 0; /* set if previous match exists */\n this.strstart = 0; /* start of string to insert */\n this.match_start = 0; /* start of matching string */\n this.lookahead = 0; /* number of valid bytes ahead in window */\n\n this.prev_length = 0;\n /* Length of the best match at previous step. Matches not greater than this\n * are discarded. This is used in the lazy match evaluation.\n */\n\n this.max_chain_length = 0;\n /* To speed up deflation, hash chains are never searched beyond this\n * length. A higher limit improves compression ratio but degrades the\n * speed.\n */\n\n this.max_lazy_match = 0;\n /* Attempt to find a better match only when the current match is strictly\n * smaller than this value. This mechanism is used only for compression\n * levels >= 4.\n */\n // That's alias to max_lazy_match, don't use directly\n //this.max_insert_length = 0;\n /* Insert new strings in the hash table only if the match length is not\n * greater than this length. This saves time but degrades compression.\n * max_insert_length is used only for compression levels <= 3.\n */\n\n this.level = 0; /* compression level (1..9) */\n this.strategy = 0; /* favor or force Huffman coding*/\n\n this.good_match = 0;\n /* Use a faster search when the previous match is longer than this */\n\n this.nice_match = 0; /* Stop searching when current match exceeds this */\n\n /* used by trees.c: */\n\n /* Didn't use ct_data typedef below to suppress compiler warning */\n\n // struct ct_data_s dyn_ltree[HEAP_SIZE]; /* literal and length tree */\n // struct ct_data_s dyn_dtree[2*D_CODES+1]; /* distance tree */\n // struct ct_data_s bl_tree[2*BL_CODES+1]; /* Huffman tree for bit lengths */\n\n // Use flat array of DOUBLE size, with interleaved fata,\n // because JS does not support effective\n this.dyn_ltree = new utils.Buf16(HEAP_SIZE * 2);\n this.dyn_dtree = new utils.Buf16((2 * D_CODES + 1) * 2);\n this.bl_tree = new utils.Buf16((2 * BL_CODES + 1) * 2);\n zero(this.dyn_ltree);\n zero(this.dyn_dtree);\n zero(this.bl_tree);\n\n this.l_desc = null; /* desc. for literal tree */\n this.d_desc = null; /* desc. for distance tree */\n this.bl_desc = null; /* desc. for bit length tree */\n\n //ush bl_count[MAX_BITS+1];\n this.bl_count = new utils.Buf16(MAX_BITS + 1);\n /* number of codes at each bit length for an optimal tree */\n\n //int heap[2*L_CODES+1]; /* heap used to build the Huffman trees */\n this.heap = new utils.Buf16(2 * L_CODES + 1); /* heap used to build the Huffman trees */\n zero(this.heap);\n\n this.heap_len = 0; /* number of elements in the heap */\n this.heap_max = 0; /* element of largest frequency */\n /* The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used.\n * The same heap array is used to build all trees.\n */\n\n this.depth = new utils.Buf16(2 * L_CODES + 1); //uch depth[2*L_CODES+1];\n zero(this.depth);\n /* Depth of each subtree used as tie breaker for trees of equal frequency\n */\n\n this.l_buf = 0; /* buffer index for literals or lengths */\n\n this.lit_bufsize = 0;\n /* Size of match buffer for literals/lengths. There are 4 reasons for\n * limiting lit_bufsize to 64K:\n * - frequencies can be kept in 16 bit counters\n * - if compression is not successful for the first block, all input\n * data is still in the window so we can still emit a stored block even\n * when input comes from standard input. (This can also be done for\n * all blocks if lit_bufsize is not greater than 32K.)\n * - if compression is not successful for a file smaller than 64K, we can\n * even emit a stored file instead of a stored block (saving 5 bytes).\n * This is applicable only for zip (not gzip or zlib).\n * - creating new Huffman trees less frequently may not provide fast\n * adaptation to changes in the input data statistics. (Take for\n * example a binary file with poorly compressible code followed by\n * a highly compressible string table.) Smaller buffer sizes give\n * fast adaptation but have of course the overhead of transmitting\n * trees more frequently.\n * - I can't count above 4\n */\n\n this.last_lit = 0; /* running index in l_buf */\n\n this.d_buf = 0;\n /* Buffer index for distances. To simplify the code, d_buf and l_buf have\n * the same number of elements. To use different lengths, an extra flag\n * array would be necessary.\n */\n\n this.opt_len = 0; /* bit length of current block with optimal trees */\n this.static_len = 0; /* bit length of current block with static trees */\n this.matches = 0; /* number of string matches in current block */\n this.insert = 0; /* bytes at end of window left to insert */\n\n\n this.bi_buf = 0;\n /* Output buffer. bits are inserted starting at the bottom (least\n * significant bits).\n */\n this.bi_valid = 0;\n /* Number of valid bits in bi_buf. All bits above the last valid bit\n * are always zero.\n */\n\n // Used for window memory init. We safely ignore it for JS. That makes\n // sense only for pointers and memory check tools.\n //this.high_water = 0;\n /* High water mark offset in window for initialized bytes -- bytes above\n * this are set to zero in order to avoid memory check warnings when\n * longest match routines access bytes past the input. This is then\n * updated to the new high water mark.\n */\n }\n}\n\nfunction deflateResetKeep(strm) {\n let s;\n\n if (!strm || !strm.state) {\n return err(strm, Z_STREAM_ERROR);\n }\n\n strm.total_in = strm.total_out = 0;\n strm.data_type = Z_UNKNOWN;\n\n s = strm.state;\n s.pending = 0;\n s.pending_out = 0;\n\n if (s.wrap < 0) {\n s.wrap = -s.wrap;\n /* was made negative by deflate(..., Z_FINISH); */\n }\n s.status = (s.wrap ? INIT_STATE : BUSY_STATE);\n strm.adler = (s.wrap === 2) ?\n 0 // crc32(0, Z_NULL, 0)\n :\n 1; // adler32(0, Z_NULL, 0)\n s.last_flush = Z_NO_FLUSH;\n trees._tr_init(s);\n return Z_OK;\n}\n\n\nfunction deflateReset(strm) {\n const ret = deflateResetKeep(strm);\n if (ret === Z_OK) {\n lm_init(strm.state);\n }\n return ret;\n}\n\n\nfunction deflateSetHeader(strm, head) {\n if (!strm || !strm.state) { return Z_STREAM_ERROR; }\n if (strm.state.wrap !== 2) { return Z_STREAM_ERROR; }\n strm.state.gzhead = head;\n return Z_OK;\n}\n\n\nfunction deflateInit2(strm, level, method, windowBits, memLevel, strategy) {\n if (!strm) { // === Z_NULL\n return Z_STREAM_ERROR;\n }\n let wrap = 1;\n\n if (level === Z_DEFAULT_COMPRESSION) {\n level = 6;\n }\n\n if (windowBits < 0) { /* suppress zlib wrapper */\n wrap = 0;\n windowBits = -windowBits;\n }\n\n else if (windowBits > 15) {\n wrap = 2; /* write gzip wrapper instead */\n windowBits -= 16;\n }\n\n\n if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method !== Z_DEFLATED ||\n windowBits < 8 || windowBits > 15 || level < 0 || level > 9 ||\n strategy < 0 || strategy > Z_FIXED) {\n return err(strm, Z_STREAM_ERROR);\n }\n\n\n if (windowBits === 8) {\n windowBits = 9;\n }\n /* until 256-byte window bug fixed */\n\n const s = new DeflateState();\n\n strm.state = s;\n s.strm = strm;\n\n s.wrap = wrap;\n s.gzhead = null;\n s.w_bits = windowBits;\n s.w_size = 1 << s.w_bits;\n s.w_mask = s.w_size - 1;\n\n s.hash_bits = memLevel + 7;\n s.hash_size = 1 << s.hash_bits;\n s.hash_mask = s.hash_size - 1;\n s.hash_shift = ~~((s.hash_bits + MIN_MATCH - 1) / MIN_MATCH);\n s.window = new utils.Buf8(s.w_size * 2);\n s.head = new utils.Buf16(s.hash_size);\n s.prev = new utils.Buf16(s.w_size);\n\n // Don't need mem init magic for JS.\n //s.high_water = 0; /* nothing written to s->window yet */\n\n s.lit_bufsize = 1 << (memLevel + 6); /* 16K elements by default */\n\n s.pending_buf_size = s.lit_bufsize * 4;\n\n //overlay = (ushf *) ZALLOC(strm, s->lit_bufsize, sizeof(ush)+2);\n //s->pending_buf = (uchf *) overlay;\n s.pending_buf = new utils.Buf8(s.pending_buf_size);\n\n // It is offset from `s.pending_buf` (size is `s.lit_bufsize * 2`)\n //s->d_buf = overlay + s->lit_bufsize/sizeof(ush);\n s.d_buf = 1 * s.lit_bufsize;\n\n //s->l_buf = s->pending_buf + (1+sizeof(ush))*s->lit_bufsize;\n s.l_buf = (1 + 2) * s.lit_bufsize;\n\n s.level = level;\n s.strategy = strategy;\n s.method = method;\n\n return deflateReset(strm);\n}\n\nfunction deflateInit(strm, level) {\n return deflateInit2(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY);\n}\n\n\nfunction deflate(strm, flush) {\n let old_flush, s;\n let beg, val; // for gzip header write only\n\n if (!strm || !strm.state ||\n flush > Z_BLOCK || flush < 0) {\n return strm ? err(strm, Z_STREAM_ERROR) : Z_STREAM_ERROR;\n }\n\n s = strm.state;\n\n if (!strm.output ||\n (!strm.input && strm.avail_in !== 0) ||\n (s.status === FINISH_STATE && flush !== Z_FINISH)) {\n return err(strm, (strm.avail_out === 0) ? Z_BUF_ERROR : Z_STREAM_ERROR);\n }\n\n s.strm = strm; /* just in case */\n old_flush = s.last_flush;\n s.last_flush = flush;\n\n /* Write the header */\n if (s.status === INIT_STATE) {\n\n if (s.wrap === 2) { // GZIP header\n strm.adler = 0; //crc32(0L, Z_NULL, 0);\n put_byte(s, 31);\n put_byte(s, 139);\n put_byte(s, 8);\n if (!s.gzhead) { // s->gzhead == Z_NULL\n put_byte(s, 0);\n put_byte(s, 0);\n put_byte(s, 0);\n put_byte(s, 0);\n put_byte(s, 0);\n put_byte(s, s.level === 9 ? 2 :\n (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ?\n 4 : 0));\n put_byte(s, OS_CODE);\n s.status = BUSY_STATE;\n }\n else {\n put_byte(s, (s.gzhead.text ? 1 : 0) +\n (s.gzhead.hcrc ? 2 : 0) +\n (!s.gzhead.extra ? 0 : 4) +\n (!s.gzhead.name ? 0 : 8) +\n (!s.gzhead.comment ? 0 : 16)\n );\n put_byte(s, s.gzhead.time & 0xff);\n put_byte(s, (s.gzhead.time >> 8) & 0xff);\n put_byte(s, (s.gzhead.time >> 16) & 0xff);\n put_byte(s, (s.gzhead.time >> 24) & 0xff);\n put_byte(s, s.level === 9 ? 2 :\n (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ?\n 4 : 0));\n put_byte(s, s.gzhead.os & 0xff);\n if (s.gzhead.extra && s.gzhead.extra.length) {\n put_byte(s, s.gzhead.extra.length & 0xff);\n put_byte(s, (s.gzhead.extra.length >> 8) & 0xff);\n }\n if (s.gzhead.hcrc) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending, 0);\n }\n s.gzindex = 0;\n s.status = EXTRA_STATE;\n }\n }\n else // DEFLATE header\n {\n let header = (Z_DEFLATED + ((s.w_bits - 8) << 4)) << 8;\n let level_flags = -1;\n\n if (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2) {\n level_flags = 0;\n } else if (s.level < 6) {\n level_flags = 1;\n } else if (s.level === 6) {\n level_flags = 2;\n } else {\n level_flags = 3;\n }\n header |= (level_flags << 6);\n if (s.strstart !== 0) { header |= PRESET_DICT; }\n header += 31 - (header % 31);\n\n s.status = BUSY_STATE;\n putShortMSB(s, header);\n\n /* Save the adler32 of the preset dictionary: */\n if (s.strstart !== 0) {\n putShortMSB(s, strm.adler >>> 16);\n putShortMSB(s, strm.adler & 0xffff);\n }\n strm.adler = 1; // adler32(0L, Z_NULL, 0);\n }\n }\n\n //#ifdef GZIP\n if (s.status === EXTRA_STATE) {\n if (s.gzhead.extra/* != Z_NULL*/) {\n beg = s.pending; /* start of bytes to update crc */\n\n while (s.gzindex < (s.gzhead.extra.length & 0xffff)) {\n if (s.pending === s.pending_buf_size) {\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n flush_pending(strm);\n beg = s.pending;\n if (s.pending === s.pending_buf_size) {\n break;\n }\n }\n put_byte(s, s.gzhead.extra[s.gzindex] & 0xff);\n s.gzindex++;\n }\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n if (s.gzindex === s.gzhead.extra.length) {\n s.gzindex = 0;\n s.status = NAME_STATE;\n }\n }\n else {\n s.status = NAME_STATE;\n }\n }\n if (s.status === NAME_STATE) {\n if (s.gzhead.name/* != Z_NULL*/) {\n beg = s.pending; /* start of bytes to update crc */\n //int val;\n\n do {\n if (s.pending === s.pending_buf_size) {\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n flush_pending(strm);\n beg = s.pending;\n if (s.pending === s.pending_buf_size) {\n val = 1;\n break;\n }\n }\n // JS specific: little magic to add zero terminator to end of string\n if (s.gzindex < s.gzhead.name.length) {\n val = s.gzhead.name.charCodeAt(s.gzindex++) & 0xff;\n } else {\n val = 0;\n }\n put_byte(s, val);\n } while (val !== 0);\n\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n if (val === 0) {\n s.gzindex = 0;\n s.status = COMMENT_STATE;\n }\n }\n else {\n s.status = COMMENT_STATE;\n }\n }\n if (s.status === COMMENT_STATE) {\n if (s.gzhead.comment/* != Z_NULL*/) {\n beg = s.pending; /* start of bytes to update crc */\n //int val;\n\n do {\n if (s.pending === s.pending_buf_size) {\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n flush_pending(strm);\n beg = s.pending;\n if (s.pending === s.pending_buf_size) {\n val = 1;\n break;\n }\n }\n // JS specific: little magic to add zero terminator to end of string\n if (s.gzindex < s.gzhead.comment.length) {\n val = s.gzhead.comment.charCodeAt(s.gzindex++) & 0xff;\n } else {\n val = 0;\n }\n put_byte(s, val);\n } while (val !== 0);\n\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n if (val === 0) {\n s.status = HCRC_STATE;\n }\n }\n else {\n s.status = HCRC_STATE;\n }\n }\n if (s.status === HCRC_STATE) {\n if (s.gzhead.hcrc) {\n if (s.pending + 2 > s.pending_buf_size) {\n flush_pending(strm);\n }\n if (s.pending + 2 <= s.pending_buf_size) {\n put_byte(s, strm.adler & 0xff);\n put_byte(s, (strm.adler >> 8) & 0xff);\n strm.adler = 0; //crc32(0L, Z_NULL, 0);\n s.status = BUSY_STATE;\n }\n }\n else {\n s.status = BUSY_STATE;\n }\n }\n //#endif\n\n /* Flush as much pending output as possible */\n if (s.pending !== 0) {\n flush_pending(strm);\n if (strm.avail_out === 0) {\n /* Since avail_out is 0, deflate will be called again with\n * more output space, but possibly with both pending and\n * avail_in equal to zero. There won't be anything to do,\n * but this is not an error situation so make sure we\n * return OK instead of BUF_ERROR at next call of deflate:\n */\n s.last_flush = -1;\n return Z_OK;\n }\n\n /* Make sure there is something to do and avoid duplicate consecutive\n * flushes. For repeated and useless calls with Z_FINISH, we keep\n * returning Z_STREAM_END instead of Z_BUF_ERROR.\n */\n } else if (strm.avail_in === 0 && rank(flush) <= rank(old_flush) &&\n flush !== Z_FINISH) {\n return err(strm, Z_BUF_ERROR);\n }\n\n /* User must not provide more input after the first FINISH: */\n if (s.status === FINISH_STATE && strm.avail_in !== 0) {\n return err(strm, Z_BUF_ERROR);\n }\n\n /* Start a new block or continue the current one.\n */\n if (strm.avail_in !== 0 || s.lookahead !== 0 ||\n (flush !== Z_NO_FLUSH && s.status !== FINISH_STATE)) {\n var bstate = (s.strategy === Z_HUFFMAN_ONLY) ? deflate_huff(s, flush) :\n (s.strategy === Z_RLE ? deflate_rle(s, flush) :\n configuration_table[s.level].func(s, flush));\n\n if (bstate === BS_FINISH_STARTED || bstate === BS_FINISH_DONE) {\n s.status = FINISH_STATE;\n }\n if (bstate === BS_NEED_MORE || bstate === BS_FINISH_STARTED) {\n if (strm.avail_out === 0) {\n s.last_flush = -1;\n /* avoid BUF_ERROR next call, see above */\n }\n return Z_OK;\n /* If flush != Z_NO_FLUSH && avail_out == 0, the next call\n * of deflate should use the same flush parameter to make sure\n * that the flush is complete. So we don't have to output an\n * empty block here, this will be done at next call. This also\n * ensures that for a very small output buffer, we emit at most\n * one empty block.\n */\n }\n if (bstate === BS_BLOCK_DONE) {\n if (flush === Z_PARTIAL_FLUSH) {\n trees._tr_align(s);\n }\n else if (flush !== Z_BLOCK) { /* FULL_FLUSH or SYNC_FLUSH */\n\n trees._tr_stored_block(s, 0, 0, false);\n /* For a full flush, this empty block will be recognized\n * as a special marker by inflate_sync().\n */\n if (flush === Z_FULL_FLUSH) {\n /*** CLEAR_HASH(s); ***/ /* forget history */\n zero(s.head); // Fill with NIL (= 0);\n\n if (s.lookahead === 0) {\n s.strstart = 0;\n s.block_start = 0;\n s.insert = 0;\n }\n }\n }\n flush_pending(strm);\n if (strm.avail_out === 0) {\n s.last_flush = -1; /* avoid BUF_ERROR at next call, see above */\n return Z_OK;\n }\n }\n }\n //Assert(strm->avail_out > 0, \"bug2\");\n //if (strm.avail_out <= 0) { throw new Error(\"bug2\");}\n\n if (flush !== Z_FINISH) { return Z_OK; }\n if (s.wrap <= 0) { return Z_STREAM_END; }\n\n /* Write the trailer */\n if (s.wrap === 2) {\n put_byte(s, strm.adler & 0xff);\n put_byte(s, (strm.adler >> 8) & 0xff);\n put_byte(s, (strm.adler >> 16) & 0xff);\n put_byte(s, (strm.adler >> 24) & 0xff);\n put_byte(s, strm.total_in & 0xff);\n put_byte(s, (strm.total_in >> 8) & 0xff);\n put_byte(s, (strm.total_in >> 16) & 0xff);\n put_byte(s, (strm.total_in >> 24) & 0xff);\n }\n else {\n putShortMSB(s, strm.adler >>> 16);\n putShortMSB(s, strm.adler & 0xffff);\n }\n\n flush_pending(strm);\n /* If avail_out is zero, the application will call deflate again\n * to flush the rest.\n */\n if (s.wrap > 0) { s.wrap = -s.wrap; }\n /* write the trailer only once! */\n return s.pending !== 0 ? Z_OK : Z_STREAM_END;\n}\n\nfunction deflateEnd(strm) {\n let status;\n\n if (!strm/*== Z_NULL*/ || !strm.state/*== Z_NULL*/) {\n return Z_STREAM_ERROR;\n }\n\n status = strm.state.status;\n if (status !== INIT_STATE &&\n status !== EXTRA_STATE &&\n status !== NAME_STATE &&\n status !== COMMENT_STATE &&\n status !== HCRC_STATE &&\n status !== BUSY_STATE &&\n status !== FINISH_STATE\n ) {\n return err(strm, Z_STREAM_ERROR);\n }\n\n strm.state = null;\n\n return status === BUSY_STATE ? err(strm, Z_DATA_ERROR) : Z_OK;\n}\n\n\n/* =========================================================================\n * Initializes the compression dictionary from the given byte\n * sequence without producing any compressed output.\n */\nfunction deflateSetDictionary(strm, dictionary) {\n let dictLength = dictionary.length;\n\n let s;\n let str, n;\n let wrap;\n let avail;\n let next;\n let input;\n let tmpDict;\n\n if (!strm/*== Z_NULL*/ || !strm.state/*== Z_NULL*/) {\n return Z_STREAM_ERROR;\n }\n\n s = strm.state;\n wrap = s.wrap;\n\n if (wrap === 2 || (wrap === 1 && s.status !== INIT_STATE) || s.lookahead) {\n return Z_STREAM_ERROR;\n }\n\n /* when using zlib wrappers, compute Adler-32 for provided dictionary */\n if (wrap === 1) {\n /* adler32(strm->adler, dictionary, dictLength); */\n strm.adler = adler32(strm.adler, dictionary, dictLength, 0);\n }\n\n s.wrap = 0; /* avoid computing Adler-32 in read_buf */\n\n /* if dictionary would fill window, just replace the history */\n if (dictLength >= s.w_size) {\n if (wrap === 0) { /* already empty otherwise */\n /*** CLEAR_HASH(s); ***/\n zero(s.head); // Fill with NIL (= 0);\n s.strstart = 0;\n s.block_start = 0;\n s.insert = 0;\n }\n /* use the tail */\n // dictionary = dictionary.slice(dictLength - s.w_size);\n tmpDict = new utils.Buf8(s.w_size);\n utils.arraySet(tmpDict, dictionary, dictLength - s.w_size, s.w_size, 0);\n dictionary = tmpDict;\n dictLength = s.w_size;\n }\n /* insert dictionary into window and hash */\n avail = strm.avail_in;\n next = strm.next_in;\n input = strm.input;\n strm.avail_in = dictLength;\n strm.next_in = 0;\n strm.input = dictionary;\n fill_window(s);\n while (s.lookahead >= MIN_MATCH) {\n str = s.strstart;\n n = s.lookahead - (MIN_MATCH - 1);\n do {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n\n s.head[s.ins_h] = str;\n str++;\n } while (--n);\n s.strstart = str;\n s.lookahead = MIN_MATCH - 1;\n fill_window(s);\n }\n s.strstart += s.lookahead;\n s.block_start = s.strstart;\n s.insert = s.lookahead;\n s.lookahead = 0;\n s.match_length = s.prev_length = MIN_MATCH - 1;\n s.match_available = 0;\n strm.next_in = next;\n strm.input = input;\n strm.avail_in = avail;\n s.wrap = wrap;\n return Z_OK;\n}\n\nconst deflateInfo = 'pako deflate (from Nodeca project)';\nexport {\n deflateInit,\n deflateInit2,\n deflateReset,\n deflateResetKeep,\n deflateSetHeader,\n deflate,\n deflateEnd,\n deflateSetDictionary,\n deflateInfo\n};\n\n/* Not implemented\nexports.deflateBound = deflateBound;\nexports.deflateCopy = deflateCopy;\nexports.deflateParams = deflateParams;\nexports.deflatePending = deflatePending;\nexports.deflatePrime = deflatePrime;\nexports.deflateTune = deflateTune;\n*/\n","// String encode/decode helpers\n\n\n\nimport * as utils from \"./common.js\";\n\n\n// Quick check if we can use fast array to bin string conversion\n//\n// - apply(Array) can fail on Android 2.2\n// - apply(Uint8Array) can fail on iOS 5.1 Safari\n//\nlet STR_APPLY_OK = true;\nlet STR_APPLY_UIA_OK = true;\n\ntry {\n String.fromCharCode.apply(null, [ 0 ]); \n} catch (__) {\n STR_APPLY_OK = false; \n}\ntry {\n String.fromCharCode.apply(null, new Uint8Array(1)); \n} catch (__) {\n STR_APPLY_UIA_OK = false; \n}\n\n\n// Table with utf8 lengths (calculated by first byte of sequence)\n// Note, that 5 & 6-byte values and some 4-byte values can not be represented in JS,\n// because max possible codepoint is 0x10ffff\nconst _utf8len = new utils.Buf8(256);\nfor (let q = 0; q < 256; q++) {\n _utf8len[q] = q >= 252 ? 6 : q >= 248 ? 5 : q >= 240 ? 4 : q >= 224 ? 3 : q >= 192 ? 2 : 1;\n}\n_utf8len[254] = _utf8len[254] = 1; // Invalid sequence start\n\n\n// convert string to array (typed, when possible)\nexport function string2buf (str) {\n let c, c2, m_pos, i, buf_len = 0;\n const str_len = str.length;\n\n // count binary size\n for (m_pos = 0; m_pos < str_len; m_pos++) {\n c = str.charCodeAt(m_pos);\n if ((c & 0xfc00) === 0xd800 && m_pos + 1 < str_len) {\n c2 = str.charCodeAt(m_pos + 1);\n if ((c2 & 0xfc00) === 0xdc00) {\n c = 0x10000 + (c - 0xd800 << 10) + (c2 - 0xdc00);\n m_pos++;\n }\n }\n buf_len += c < 0x80 ? 1 : c < 0x800 ? 2 : c < 0x10000 ? 3 : 4;\n }\n\n // allocate buffer\n const buf = new utils.Buf8(buf_len);\n\n // convert\n for (i = 0, m_pos = 0; i < buf_len; m_pos++) {\n c = str.charCodeAt(m_pos);\n if ((c & 0xfc00) === 0xd800 && m_pos + 1 < str_len) {\n c2 = str.charCodeAt(m_pos + 1);\n if ((c2 & 0xfc00) === 0xdc00) {\n c = 0x10000 + (c - 0xd800 << 10) + (c2 - 0xdc00);\n m_pos++;\n }\n }\n if (c < 0x80) {\n /* one byte */\n buf[i++] = c;\n } else if (c < 0x800) {\n /* two bytes */\n buf[i++] = 0xC0 | c >>> 6;\n buf[i++] = 0x80 | c & 0x3f;\n } else if (c < 0x10000) {\n /* three bytes */\n buf[i++] = 0xE0 | c >>> 12;\n buf[i++] = 0x80 | c >>> 6 & 0x3f;\n buf[i++] = 0x80 | c & 0x3f;\n } else {\n /* four bytes */\n buf[i++] = 0xf0 | c >>> 18;\n buf[i++] = 0x80 | c >>> 12 & 0x3f;\n buf[i++] = 0x80 | c >>> 6 & 0x3f;\n buf[i++] = 0x80 | c & 0x3f;\n }\n }\n\n return buf;\n}\n\n// Helper (used in 2 places)\nfunction _buf2binstring(buf, len) {\n // On Chrome, the arguments in a function call that are allowed is `65534`.\n // If the length of the buffer is smaller than that, we can use this optimization,\n // otherwise we will take a slower path.\n if (len < 65534) {\n if (buf.subarray && STR_APPLY_UIA_OK || !buf.subarray && STR_APPLY_OK) {\n return String.fromCharCode.apply(null, utils.shrinkBuf(buf, len));\n }\n }\n\n let result = \"\";\n for (let i = 0; i < len; i++) {\n result += String.fromCharCode(buf[i]);\n }\n return result;\n}\n\n\n// Convert byte array to binary string\nexport function buf2binstring (buf) {\n return _buf2binstring(buf, buf.length);\n}\n\n\n// Convert binary string (typed, when possible)\nexport function binstring2buf (str) {\n const buf = new utils.Buf8(str.length);\n for (let i = 0, len = buf.length; i < len; i++) {\n buf[i] = str.charCodeAt(i);\n }\n return buf;\n}\n\n\n// convert array to string\nexport function buf2string (buf, max) {\n let i, out, c, c_len;\n const len = max || buf.length;\n\n // Reserve max possible length (2 words per char)\n // NB: by unknown reasons, Array is significantly faster for\n // String.fromCharCode.apply than Uint16Array.\n // var utf16buf = new Array(len * 2);\n // try Uint16Array\n const utf16buf = new Uint16Array(len * 2);\n\n for (out = 0, i = 0; i < len;) {\n c = buf[i++];\n // quick process ascii\n if (c < 0x80) {\n utf16buf[out++] = c; continue; \n }\n\n c_len = _utf8len[c];\n // skip 5 & 6 byte codes\n if (c_len > 4) {\n utf16buf[out++] = 0xfffd; i += c_len - 1; continue; \n }\n\n // apply mask on first byte\n c &= c_len === 2 ? 0x1f : c_len === 3 ? 0x0f : 0x07;\n // join the rest\n while (c_len > 1 && i < len) {\n c = c << 6 | buf[i++] & 0x3f;\n c_len--;\n }\n\n // terminated by end of string?\n if (c_len > 1) {\n utf16buf[out++] = 0xfffd; continue; \n }\n\n if (c < 0x10000) {\n utf16buf[out++] = c;\n } else {\n c -= 0x10000;\n utf16buf[out++] = 0xd800 | c >> 10 & 0x3ff;\n utf16buf[out++] = 0xdc00 | c & 0x3ff;\n }\n }\n\n return _buf2binstring(utf16buf, out);\n}\n\n\n// Calculate max possible position in utf8 buffer,\n// that will not break sequence. If that's not possible\n// - (very small limits) return max size as is.\n//\n// buf[] - utf8 bytes array\n// max - length limit (mandatory);\nexport function utf8border (buf, max) {\n let pos;\n\n max = max || buf.length;\n if (max > buf.length) {\n max = buf.length; \n }\n\n // go back from last position, until start of sequence found\n pos = max - 1;\n while (pos >= 0 && (buf[pos] & 0xC0) === 0x80) {\n pos--; \n }\n\n // Very small and broken sequence,\n // return max, because we should return something anyway.\n if (pos < 0) {\n return max; \n }\n\n // If we came to start of buffer - that means buffer is too small,\n // return max too.\n if (pos === 0) {\n return max; \n }\n\n return pos + _utf8len[buf[pos]] > max ? pos : max;\n}\n","\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nexport default class ZStream {\n constructor() {\n /* next input byte */\n this.input = null; // JS specific, because we have no pointers\n this.next_in = 0;\n /* number of bytes available at input */\n this.avail_in = 0;\n /* total number of input bytes read so far */\n this.total_in = 0;\n /* next output byte should be put there */\n this.output = null; // JS specific, because we have no pointers\n this.next_out = 0;\n /* remaining free space at output */\n this.avail_out = 0;\n /* total number of bytes output so far */\n this.total_out = 0;\n /* last error message, NULL if no error */\n this.msg = ''/*Z_NULL*/;\n /* not visible by applications */\n this.state = null;\n /* best guess about the data type: binary or text */\n this.data_type = 2/*Z_UNKNOWN*/;\n /* adler32 value of the uncompressed data */\n this.adler = 0;\n }\n}","'use strict';\n\nimport * as zlib_deflate from \"./zlib/deflate.js\";\nimport * as utils from \"./utils/common.js\";\nimport * as strings from \"./utils/strings.js\";\nimport msg from \"./zlib/messages.js\";\nimport ZStream from \"./zlib/zstream.js\";\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\nimport { Z_NO_FLUSH, Z_FINISH,\n Z_OK, Z_STREAM_END, Z_SYNC_FLUSH,\n Z_DEFAULT_COMPRESSION,\n Z_DEFAULT_STRATEGY,\n Z_DEFLATED } from \"./zlib/constants.js\"\n\n/* ===========================================================================*/\n\n\n/**\n * class Deflate\n *\n * Generic JS-style wrapper for zlib calls. If you don't need\n * streaming behaviour - use more simple functions: [[deflate]],\n * [[deflateRaw]] and [[gzip]].\n **/\n\n/* internal\n * Deflate.chunks -> Array\n *\n * Chunks of output data, if [[Deflate#onData]] not overridden.\n **/\n\n/**\n * Deflate.result -> Uint8Array|Array\n *\n * Compressed result, generated by default [[Deflate#onData]]\n * and [[Deflate#onEnd]] handlers. Filled after you push last chunk\n * (call [[Deflate#push]] with `Z_FINISH` / `true` param) or if you\n * push a chunk with explicit flush (call [[Deflate#push]] with\n * `Z_SYNC_FLUSH` param).\n **/\n\n/**\n * Deflate.err -> Number\n *\n * Error code after deflate finished. 0 (Z_OK) on success.\n * You will not need it in real life, because deflate errors\n * are possible only on wrong options or bad `onData` / `onEnd`\n * custom handlers.\n **/\n\n/**\n * Deflate.msg -> String\n *\n * Error message, if [[Deflate.err]] != 0\n **/\n\n\n/**\n * new Deflate(options)\n * - options (Object): zlib deflate options.\n *\n * Creates new deflator instance with specified params. Throws exception\n * on bad params. Supported options:\n *\n * - `level`\n * - `windowBits`\n * - `memLevel`\n * - `strategy`\n * - `dictionary`\n *\n * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)\n * for more information on these.\n *\n * Additional options, for internal needs:\n *\n * - `chunkSize` - size of generated data chunks (16K by default)\n * - `raw` (Boolean) - do raw deflate\n * - `gzip` (Boolean) - create gzip wrapper\n * - `to` (String) - if equal to 'string', then result will be \"binary string\"\n * (each char code [0..255])\n * - `header` (Object) - custom header for gzip\n * - `text` (Boolean) - true if compressed data believed to be text\n * - `time` (Number) - modification time, unix timestamp\n * - `os` (Number) - operation system code\n * - `extra` (Array) - array of bytes with extra data (max 65536)\n * - `name` (String) - file name (binary string)\n * - `comment` (String) - comment (binary string)\n * - `hcrc` (Boolean) - true if header crc should be added\n *\n * ##### Example:\n *\n * ```javascript\n * var pako = require('pako')\n * , chunk1 = Uint8Array([1,2,3,4,5,6,7,8,9])\n * , chunk2 = Uint8Array([10,11,12,13,14,15,16,17,18,19]);\n *\n * var deflate = new pako.Deflate({ level: 3});\n *\n * deflate.push(chunk1, false);\n * deflate.push(chunk2, true); // true -> last chunk\n *\n * if (deflate.err) { throw new Error(deflate.err); }\n *\n * console.log(deflate.result);\n * ```\n **/\n\nclass Deflate {\n constructor(options) {\n this.options = {\n level: Z_DEFAULT_COMPRESSION,\n method: Z_DEFLATED,\n chunkSize: 16384,\n windowBits: 15,\n memLevel: 8,\n strategy: Z_DEFAULT_STRATEGY,\n ...(options || {})\n };\n\n const opt = this.options;\n\n if (opt.raw && (opt.windowBits > 0)) {\n opt.windowBits = -opt.windowBits;\n }\n\n else if (opt.gzip && (opt.windowBits > 0) && (opt.windowBits < 16)) {\n opt.windowBits += 16;\n }\n\n this.err = 0; // error code, if happens (0 = Z_OK)\n this.msg = ''; // error message\n this.ended = false; // used to avoid multiple onEnd() calls\n this.chunks = []; // chunks of compressed data\n\n this.strm = new ZStream();\n this.strm.avail_out = 0;\n\n var status = zlib_deflate.deflateInit2(\n this.strm,\n opt.level,\n opt.method,\n opt.windowBits,\n opt.memLevel,\n opt.strategy\n );\n\n if (status !== Z_OK) {\n throw new Error(msg[status]);\n }\n\n if (opt.header) {\n zlib_deflate.deflateSetHeader(this.strm, opt.header);\n }\n\n if (opt.dictionary) {\n let dict;\n // Convert data if needed\n if (typeof opt.dictionary === 'string') {\n // If we need to compress text, change encoding to utf8.\n dict = strings.string2buf(opt.dictionary);\n } else if (opt.dictionary instanceof ArrayBuffer) {\n dict = new Uint8Array(opt.dictionary);\n } else {\n dict = opt.dictionary;\n }\n\n status = zlib_deflate.deflateSetDictionary(this.strm, dict);\n\n if (status !== Z_OK) {\n throw new Error(msg[status]);\n }\n\n this._dict_set = true;\n }\n }\n\n /**\n * Deflate#push(data[, mode]) -> Boolean\n * - data (Uint8Array|Array|ArrayBuffer|String): input data. Strings will be\n * converted to utf8 byte sequence.\n * - mode (Number|Boolean): 0..6 for corresponding Z_NO_FLUSH..Z_TREE modes.\n * See constants. Skipped or `false` means Z_NO_FLUSH, `true` means Z_FINISH.\n *\n * Sends input data to deflate pipe, generating [[Deflate#onData]] calls with\n * new compressed chunks. Returns `true` on success. The last data block must have\n * mode Z_FINISH (or `true`). That will flush internal pending buffers and call\n * [[Deflate#onEnd]]. For interim explicit flushes (without ending the stream) you\n * can use mode Z_SYNC_FLUSH, keeping the compression context.\n *\n * On fail call [[Deflate#onEnd]] with error code and return false.\n *\n * We strongly recommend to use `Uint8Array` on input for best speed (output\n * array format is detected automatically). Also, don't skip last param and always\n * use the same type in your code (boolean or number). That will improve JS speed.\n *\n * For regular `Array`-s make sure all elements are [0..255].\n *\n * ##### Example\n *\n * ```javascript\n * push(chunk, false); // push one of data chunks\n * ...\n * push(chunk, true); // push last chunk\n * ```\n **/\n push(data, mode) {\n const { strm, options: { chunkSize } } = this;\n var status, _mode;\n\n if (this.ended) { return false; }\n\n _mode = (mode === ~~mode) ? mode : ((mode === true) ? Z_FINISH : Z_NO_FLUSH);\n\n // Convert data if needed\n if (typeof data === 'string') {\n // If we need to compress text, change encoding to utf8.\n strm.input = strings.string2buf(data);\n } else if (data instanceof ArrayBuffer) {\n strm.input = new Uint8Array(data);\n } else {\n strm.input = data;\n }\n\n strm.next_in = 0;\n strm.avail_in = strm.input.length;\n\n do {\n if (strm.avail_out === 0) {\n strm.output = new utils.Buf8(chunkSize);\n strm.next_out = 0;\n strm.avail_out = chunkSize;\n }\n status = zlib_deflate.deflate(strm, _mode); /* no bad return value */\n\n if (status !== Z_STREAM_END && status !== Z_OK) {\n this.onEnd(status);\n this.ended = true;\n return false;\n }\n if (strm.avail_out === 0 || (strm.avail_in === 0 && (_mode === Z_FINISH || _mode === Z_SYNC_FLUSH))) {\n this.onData(utils.shrinkBuf(strm.output, strm.next_out));\n }\n } while ((strm.avail_in > 0 || strm.avail_out === 0) && status !== Z_STREAM_END);\n\n // Finalize on the last chunk.\n if (_mode === Z_FINISH) {\n status = zlib_deflate.deflateEnd(this.strm);\n this.onEnd(status);\n this.ended = true;\n return status === Z_OK;\n }\n\n // callback interim results if Z_SYNC_FLUSH.\n if (_mode === Z_SYNC_FLUSH) {\n this.onEnd(Z_OK);\n strm.avail_out = 0;\n return true;\n }\n\n return true;\n };\n /**\n * Deflate#onData(chunk) -> Void\n * - chunk (Uint8Array|Array|String): output data. Type of array depends\n * on js engine support. When string output requested, each chunk\n * will be string.\n *\n * By default, stores data blocks in `chunks[]` property and glue\n * those in `onEnd`. Override this handler, if you need another behaviour.\n **/\n onData(chunk) {\n this.chunks.push(chunk);\n };\n\n /**\n * Deflate#onEnd(status) -> Void\n * - status (Number): deflate status. 0 (Z_OK) on success,\n * other if not.\n *\n * Called once after you tell deflate that the input stream is\n * complete (Z_FINISH) or should be flushed (Z_SYNC_FLUSH)\n * or if an error happened. By default - join collected chunks,\n * free memory and fill `results` / `err` properties.\n **/\n onEnd(status) {\n // On success - join\n if (status === Z_OK) {\n this.result = utils.flattenChunks(this.chunks);\n }\n this.chunks = [];\n this.err = status;\n this.msg = this.strm.msg;\n };\n}\n\n\n\n\n/**\n * deflate(data[, options]) -> Uint8Array|Array|String\n * - data (Uint8Array|Array|String): input data to compress.\n * - options (Object): zlib deflate options.\n *\n * Compress `data` with deflate algorithm and `options`.\n *\n * Supported options are:\n *\n * - level\n * - windowBits\n * - memLevel\n * - strategy\n * - dictionary\n *\n * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)\n * for more information on these.\n *\n * Sugar (options):\n *\n * - `raw` (Boolean) - say that we work with raw stream, if you don't wish to specify\n * negative windowBits implicitly.\n * - `to` (String) - if equal to 'string', then result will be \"binary string\"\n * (each char code [0..255])\n *\n * ##### Example:\n *\n * ```javascript\n * var pako = require('pako')\n * , data = Uint8Array([1,2,3,4,5,6,7,8,9]);\n *\n * console.log(pako.deflate(data));\n * ```\n **/\nfunction deflate(input, options) {\n const deflator = new Deflate(options);\n\n deflator.push(input, true);\n\n // That will never happens, if you don't cheat with options :)\n if (deflator.err) { throw new Error(deflator.msg || msg[deflator.err]); }\n\n return deflator.result;\n}\n\n\n/**\n * deflateRaw(data[, options]) -> Uint8Array|Array|String\n * - data (Uint8Array|Array|String): input data to compress.\n * - options (Object): zlib deflate options.\n *\n * The same as [[deflate]], but creates raw data, without wrapper\n * (header and adler32 crc).\n **/\nfunction deflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return deflate(input, options);\n}\n\n\n/**\n * gzip(data[, options]) -> Uint8Array|Array|String\n * - data (Uint8Array|Array|String): input data to compress.\n * - options (Object): zlib deflate options.\n *\n * The same as [[deflate]], but create gzip wrapper instead of\n * deflate one.\n **/\nfunction gzip(input, options) {\n options = options || {};\n options.gzip = true;\n return deflate(input, options);\n}\n\nexport { Deflate, deflate, deflateRaw, gzip };\n","\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\n// See state defs from inflate.js\nconst BAD = 30; /* got a data error -- remain here until reset */\nconst TYPE = 12; /* i: waiting for type bits, including last-flag bit */\n\n/*\n Decode literal, length, and distance codes and write out the resulting\n literal and match bytes until either not enough input or output is\n available, an end-of-block is encountered, or a data error is encountered.\n When large enough input and output buffers are supplied to inflate(), for\n example, a 16K input buffer and a 64K output buffer, more than 95% of the\n inflate execution time is spent in this routine.\n\n Entry assumptions:\n\n state.mode === LEN\n strm.avail_in >= 6\n strm.avail_out >= 258\n start >= strm.avail_out\n state.bits < 8\n\n On return, state.mode is one of:\n\n LEN -- ran out of enough output space or enough available input\n TYPE -- reached end of block code, inflate() to interpret next block\n BAD -- error in block data\n\n Notes:\n\n - The maximum input bits used by a length/distance pair is 15 bits for the\n length code, 5 bits for the length extra, 15 bits for the distance code,\n and 13 bits for the distance extra. This totals 48 bits, or six bytes.\n Therefore if strm.avail_in >= 6, then there is enough input to avoid\n checking for available input while decoding.\n\n - The maximum bytes that a single length/distance pair can output is 258\n bytes, which is the maximum length that can be coded. inflate_fast()\n requires strm.avail_out >= 258 for each loop to avoid checking for\n output space.\n */\nexport default function inflate_fast(strm, start) {\n let _in; /* local strm.input */\n let _out; /* local strm.output */\n // Use `s_window` instead `window`, avoid conflict with instrumentation tools\n let hold; /* local strm.hold */\n let bits; /* local strm.bits */\n let here; /* retrieved table entry */\n let op; /* code bits, operation, extra bits, or */\n /* window position, window bytes to copy */\n let len; /* match length, unused bytes */\n let dist; /* match distance */\n let from; /* where to copy match from */\n let from_source;\n\n\n\n /* copy state to local variables */\n const state = strm.state;\n //here = state.here;\n _in = strm.next_in;\n const input = strm.input;\n const last = _in + (strm.avail_in - 5);\n _out = strm.next_out;\n const output = strm.output;\n const beg = _out - (start - strm.avail_out);\n const end = _out + (strm.avail_out - 257);\n //#ifdef INFLATE_STRICT\n const dmax = state.dmax;\n //#endif\n const wsize = state.wsize;\n const whave = state.whave;\n const wnext = state.wnext;\n const s_window = state.window;\n hold = state.hold;\n bits = state.bits;\n const lcode = state.lencode;\n const dcode = state.distcode;\n const lmask = (1 << state.lenbits) - 1;\n const dmask = (1 << state.distbits) - 1;\n\n\n /* decode literals and length/distances until end-of-block or not enough\n input data or output space */\n\n top:\n do {\n if (bits < 15) {\n hold += input[_in++] << bits;\n bits += 8;\n hold += input[_in++] << bits;\n bits += 8;\n }\n\n here = lcode[hold & lmask];\n\n dolen:\n for (;;) { // Goto emulation\n op = here >>> 24/*here.bits*/;\n hold >>>= op;\n bits -= op;\n op = here >>> 16 & 0xff/*here.op*/;\n if (op === 0) { /* literal */\n //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?\n // \"inflate: literal '%c'\\n\" :\n // \"inflate: literal 0x%02x\\n\", here.val));\n output[_out++] = here & 0xffff/*here.val*/;\n } else if (op & 16) { /* length base */\n len = here & 0xffff/*here.val*/;\n op &= 15; /* number of extra bits */\n if (op) {\n if (bits < op) {\n hold += input[_in++] << bits;\n bits += 8;\n }\n len += hold & (1 << op) - 1;\n hold >>>= op;\n bits -= op;\n }\n //Tracevv((stderr, \"inflate: length %u\\n\", len));\n if (bits < 15) {\n hold += input[_in++] << bits;\n bits += 8;\n hold += input[_in++] << bits;\n bits += 8;\n }\n here = dcode[hold & dmask];\n\n dodist:\n for (;;) { // goto emulation\n op = here >>> 24/*here.bits*/;\n hold >>>= op;\n bits -= op;\n op = here >>> 16 & 0xff/*here.op*/;\n\n if (op & 16) { /* distance base */\n dist = here & 0xffff/*here.val*/;\n op &= 15; /* number of extra bits */\n if (bits < op) {\n hold += input[_in++] << bits;\n bits += 8;\n if (bits < op) {\n hold += input[_in++] << bits;\n bits += 8;\n }\n }\n dist += hold & (1 << op) - 1;\n //#ifdef INFLATE_STRICT\n if (dist > dmax) {\n strm.msg = \"invalid distance too far back\";\n state.mode = BAD;\n break top;\n }\n //#endif\n hold >>>= op;\n bits -= op;\n //Tracevv((stderr, \"inflate: distance %u\\n\", dist));\n op = _out - beg; /* max distance in output */\n if (dist > op) { /* see if copy from window */\n op = dist - op; /* distance back in window */\n if (op > whave) {\n if (state.sane) {\n strm.msg = \"invalid distance too far back\";\n state.mode = BAD;\n break top;\n }\n\n // (!) This block is disabled in zlib defaults,\n // don't enable it for binary compatibility\n //#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR\n // if (len <= op - whave) {\n // do {\n // output[_out++] = 0;\n // } while (--len);\n // continue top;\n // }\n // len -= op - whave;\n // do {\n // output[_out++] = 0;\n // } while (--op > whave);\n // if (op === 0) {\n // from = _out - dist;\n // do {\n // output[_out++] = output[from++];\n // } while (--len);\n // continue top;\n // }\n //#endif\n }\n from = 0; // window index\n from_source = s_window;\n if (wnext === 0) { /* very common case */\n from += wsize - op;\n if (op < len) { /* some from window */\n len -= op;\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n from = _out - dist; /* rest from output */\n from_source = output;\n }\n } else if (wnext < op) { /* wrap around window */\n from += wsize + wnext - op;\n op -= wnext;\n if (op < len) { /* some from end of window */\n len -= op;\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n from = 0;\n if (wnext < len) { /* some from start of window */\n op = wnext;\n len -= op;\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n from = _out - dist; /* rest from output */\n from_source = output;\n }\n }\n } else { /* contiguous in window */\n from += wnext - op;\n if (op < len) { /* some from window */\n len -= op;\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n from = _out - dist; /* rest from output */\n from_source = output;\n }\n }\n while (len > 2) {\n output[_out++] = from_source[from++];\n output[_out++] = from_source[from++];\n output[_out++] = from_source[from++];\n len -= 3;\n }\n if (len) {\n output[_out++] = from_source[from++];\n if (len > 1) {\n output[_out++] = from_source[from++];\n }\n }\n } else {\n from = _out - dist; /* copy direct from output */\n do { /* minimum length is three */\n output[_out++] = output[from++];\n output[_out++] = output[from++];\n output[_out++] = output[from++];\n len -= 3;\n } while (len > 2);\n if (len) {\n output[_out++] = output[from++];\n if (len > 1) {\n output[_out++] = output[from++];\n }\n }\n }\n } else if ((op & 64) === 0) { /* 2nd level distance code */\n here = dcode[(here & 0xffff)/*here.val*/ + (hold & (1 << op) - 1)];\n continue dodist;\n } else {\n strm.msg = \"invalid distance code\";\n state.mode = BAD;\n break top;\n }\n\n break; // need to emulate goto via \"continue\"\n }\n } else if ((op & 64) === 0) { /* 2nd level length code */\n here = lcode[(here & 0xffff)/*here.val*/ + (hold & (1 << op) - 1)];\n continue dolen;\n } else if (op & 32) { /* end-of-block */\n //Tracevv((stderr, \"inflate: end of block\\n\"));\n state.mode = TYPE;\n break top;\n } else {\n strm.msg = \"invalid literal/length code\";\n state.mode = BAD;\n break top;\n }\n\n break; // need to emulate goto via \"continue\"\n }\n } while (_in < last && _out < end);\n\n /* return unused bytes (on entry, bits < 8, so in won't go too far back) */\n len = bits >> 3;\n _in -= len;\n bits -= len << 3;\n hold &= (1 << bits) - 1;\n\n /* update state and return */\n strm.next_in = _in;\n strm.next_out = _out;\n strm.avail_in = _in < last ? 5 + (last - _in) : 5 - (_in - last);\n strm.avail_out = _out < end ? 257 + (end - _out) : 257 - (_out - end);\n state.hold = hold;\n state.bits = bits;\n return;\n}\n","\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nimport * as utils from \"../utils/common.js\";\n\nconst MAXBITS = 15;\nconst ENOUGH_LENS = 852;\nconst ENOUGH_DISTS = 592;\n//var ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS);\n\nconst CODES = 0;\nconst LENS = 1;\nconst DISTS = 2;\n\nconst lbase = [ /* Length codes 257..285 base */\n 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,\n 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0\n];\n\nconst lext = [ /* Length codes 257..285 extra */\n 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18,\n 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78\n];\n\nconst dbase = [ /* Distance codes 0..29 base */\n 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,\n 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,\n 8193, 12289, 16385, 24577, 0, 0\n];\n\nconst dext = [ /* Distance codes 0..29 extra */\n 16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22,\n 23, 23, 24, 24, 25, 25, 26, 26, 27, 27,\n 28, 28, 29, 29, 64, 64\n];\n\nexport default function inflate_table(type, lens, lens_index, codes, table, table_index, work, opts) {\n const bits = opts.bits;\n //here = opts.here; /* table entry for duplication */\n\n let len = 0; /* a code's length in bits */\n let sym = 0; /* index of code symbols */\n let min = 0, max = 0; /* minimum and maximum code lengths */\n let root = 0; /* number of index bits for root table */\n let curr = 0; /* number of index bits for current table */\n let drop = 0; /* code bits to drop for sub-table */\n let left = 0; /* number of prefix codes available */\n let used = 0; /* code entries in table used */\n let huff = 0; /* Huffman code */\n let incr; /* for incrementing code, index */\n let fill; /* index for replicating entries */\n let low; /* low bits for current root entry */\n let next; /* next available space in table */\n let base = null; /* base value table to use */\n let base_index = 0;\n // var shoextra; /* extra bits table to use */\n let end; /* use base and extra for symbol > end */\n const count = new utils.Buf16(MAXBITS + 1); //[MAXBITS+1]; /* number of codes of each length */\n const offs = new utils.Buf16(MAXBITS + 1); //[MAXBITS+1]; /* offsets in table for each length */\n let extra = null;\n let extra_index = 0;\n\n let here_bits, here_op, here_val;\n\n /*\n Process a set of code lengths to create a canonical Huffman code. The\n code lengths are lens[0..codes-1]. Each length corresponds to the\n symbols 0..codes-1. The Huffman code is generated by first sorting the\n symbols by length from short to long, and retaining the symbol order\n for codes with equal lengths. Then the code starts with all zero bits\n for the first code of the shortest length, and the codes are integer\n increments for the same length, and zeros are appended as the length\n increases. For the deflate format, these bits are stored backwards\n from their more natural integer increment ordering, and so when the\n decoding tables are built in the large loop below, the integer codes\n are incremented backwards.\n\n This routine assumes, but does not check, that all of the entries in\n lens[] are in the range 0..MAXBITS. The caller must assure this.\n 1..MAXBITS is interpreted as that code length. zero means that that\n symbol does not occur in this code.\n\n The codes are sorted by computing a count of codes for each length,\n creating from that a table of starting indices for each length in the\n sorted table, and then entering the symbols in order in the sorted\n table. The sorted table is work[], with that space being provided by\n the caller.\n\n The length counts are used for other purposes as well, i.e. finding\n the minimum and maximum length codes, determining if there are any\n codes at all, checking for a valid set of lengths, and looking ahead\n at length counts to determine sub-table sizes when building the\n decoding tables.\n */\n\n /* accumulate lengths for codes (assumes lens[] all in 0..MAXBITS) */\n for (len = 0; len <= MAXBITS; len++) {\n count[len] = 0;\n }\n for (sym = 0; sym < codes; sym++) {\n count[lens[lens_index + sym]]++;\n }\n\n /* bound code lengths, force root to be within code lengths */\n root = bits;\n for (max = MAXBITS; max >= 1; max--) {\n if (count[max] !== 0) {\n break; \n }\n }\n if (root > max) {\n root = max;\n }\n if (max === 0) { /* no symbols to code at all */\n //table.op[opts.table_index] = 64; //here.op = (var char)64; /* invalid code marker */\n //table.bits[opts.table_index] = 1; //here.bits = (var char)1;\n //table.val[opts.table_index++] = 0; //here.val = (var short)0;\n table[table_index++] = 1 << 24 | 64 << 16 | 0;\n\n\n //table.op[opts.table_index] = 64;\n //table.bits[opts.table_index] = 1;\n //table.val[opts.table_index++] = 0;\n table[table_index++] = 1 << 24 | 64 << 16 | 0;\n\n opts.bits = 1;\n return 0; /* no symbols, but wait for decoding to report error */\n }\n for (min = 1; min < max; min++) {\n if (count[min] !== 0) {\n break; \n }\n }\n if (root < min) {\n root = min;\n }\n\n /* check for an over-subscribed or incomplete set of lengths */\n left = 1;\n for (len = 1; len <= MAXBITS; len++) {\n left <<= 1;\n left -= count[len];\n if (left < 0) {\n return -1;\n } /* over-subscribed */\n }\n if (left > 0 && (type === CODES || max !== 1)) {\n return -1; /* incomplete set */\n }\n\n /* generate offsets into symbol table for each length for sorting */\n offs[1] = 0;\n for (len = 1; len < MAXBITS; len++) {\n offs[len + 1] = offs[len] + count[len];\n }\n\n /* sort symbols by length, by symbol order within each length */\n for (sym = 0; sym < codes; sym++) {\n if (lens[lens_index + sym] !== 0) {\n work[offs[lens[lens_index + sym]]++] = sym;\n }\n }\n\n /*\n Create and fill in decoding tables. In this loop, the table being\n filled is at next and has curr index bits. The code being used is huff\n with length len. That code is converted to an index by dropping drop\n bits off of the bottom. For codes where len is less than drop + curr,\n those top drop + curr - len bits are incremented through all values to\n fill the table with replicated entries.\n\n root is the number of index bits for the root table. When len exceeds\n root, sub-tables are created pointed to by the root entry with an index\n of the low root bits of huff. This is saved in low to check for when a\n new sub-table should be started. drop is zero when the root table is\n being filled, and drop is root when sub-tables are being filled.\n\n When a new sub-table is needed, it is necessary to look ahead in the\n code lengths to determine what size sub-table is needed. The length\n counts are used for this, and so count[] is decremented as codes are\n entered in the tables.\n\n used keeps track of how many table entries have been allocated from the\n provided *table space. It is checked for LENS and DIST tables against\n the constants ENOUGH_LENS and ENOUGH_DISTS to guard against changes in\n the initial root table size constants. See the comments in inftrees.h\n for more information.\n\n sym increments through all symbols, and the loop terminates when\n all codes of length max, i.e. all codes, have been processed. This\n routine permits incomplete codes, so another loop after this one fills\n in the rest of the decoding tables with invalid code markers.\n */\n\n /* set up for code type */\n // poor man optimization - use if-else instead of switch,\n // to avoid deopts in old v8\n if (type === CODES) {\n base = extra = work; /* dummy value--not used */\n end = 19;\n\n } else if (type === LENS) {\n base = lbase;\n base_index -= 257;\n extra = lext;\n extra_index -= 257;\n end = 256;\n\n } else { /* DISTS */\n base = dbase;\n extra = dext;\n end = -1;\n }\n\n /* initialize opts for loop */\n huff = 0; /* starting code */\n sym = 0; /* starting code symbol */\n len = min; /* starting code length */\n next = table_index; /* current table to fill in */\n curr = root; /* current table index bits */\n drop = 0; /* current bits to drop from code for index */\n low = -1; /* trigger new sub-table when len > root */\n used = 1 << root; /* use root table entries */\n const mask = used - 1; /* mask for comparing low */\n\n /* check available table space */\n if (type === LENS && used > ENOUGH_LENS ||\n type === DISTS && used > ENOUGH_DISTS) {\n return 1;\n }\n\n /* process all codes and make table entries */\n for (;;) {\n /* create table entry */\n here_bits = len - drop;\n if (work[sym] < end) {\n here_op = 0;\n here_val = work[sym];\n } else if (work[sym] > end) {\n here_op = extra[extra_index + work[sym]];\n here_val = base[base_index + work[sym]];\n } else {\n here_op = 32 + 64; /* end of block */\n here_val = 0;\n }\n\n /* replicate for those indices with low len bits equal to huff */\n incr = 1 << len - drop;\n fill = 1 << curr;\n min = fill; /* save offset to next table */\n do {\n fill -= incr;\n table[next + (huff >> drop) + fill] = here_bits << 24 | here_op << 16 | here_val |0;\n } while (fill !== 0);\n\n /* backwards increment the len-bit code huff */\n incr = 1 << len - 1;\n while (huff & incr) {\n incr >>= 1;\n }\n if (incr !== 0) {\n huff &= incr - 1;\n huff += incr;\n } else {\n huff = 0;\n }\n\n /* go to next symbol, update count, len */\n sym++;\n if (--count[len] === 0) {\n if (len === max) {\n break; \n }\n len = lens[lens_index + work[sym]];\n }\n\n /* create new sub-table if needed */\n if (len > root && (huff & mask) !== low) {\n /* if first time, transition to sub-tables */\n if (drop === 0) {\n drop = root;\n }\n\n /* increment past last table */\n next += min; /* here min is 1 << curr */\n\n /* determine length of next table */\n curr = len - drop;\n left = 1 << curr;\n while (curr + drop < max) {\n left -= count[curr + drop];\n if (left <= 0) {\n break; \n }\n curr++;\n left <<= 1;\n }\n\n /* check for enough space */\n used += 1 << curr;\n if (type === LENS && used > ENOUGH_LENS ||\n type === DISTS && used > ENOUGH_DISTS) {\n return 1;\n }\n\n /* point entry in root table to sub-table */\n low = huff & mask;\n /*table.op[low] = curr;\n table.bits[low] = root;\n table.val[low] = next - opts.table_index;*/\n table[low] = root << 24 | curr << 16 | next - table_index |0;\n }\n }\n\n /* fill in remaining table entry if code is incomplete (guaranteed to have\n at most one remaining entry, since if the code is incomplete, the\n maximum code length that was allowed to get this far is one bit) */\n if (huff !== 0) {\n //table.op[next + huff] = 64; /* invalid code marker */\n //table.bits[next + huff] = len - drop;\n //table.val[next + huff] = 0;\n table[next + huff] = len - drop << 24 | 64 << 16 |0;\n }\n\n /* set return parameters */\n //opts.table_index += used;\n opts.bits = root;\n return 0;\n}\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nimport * as utils from \"../utils/common.js\";\nimport adler32 from \"./adler32.js\";\nimport crc32 from \"./crc32.js\";\nimport inflate_fast from \"./inffast.js\";\nimport inflate_table from \"./inftrees.js\";\n\nconst CODES = 0;\nconst LENS = 1;\nconst DISTS = 2;\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\n\nimport {\n Z_FINISH,\n Z_BLOCK,\n Z_TREES,\n Z_OK,\n Z_STREAM_END,\n Z_NEED_DICT,\n Z_STREAM_ERROR,\n Z_DATA_ERROR,\n Z_BUF_ERROR,\n Z_DEFLATED\n} from \"./constants.js\";\n\n/* STATES ====================================================================*/\n/* ===========================================================================*/\n\n\nconst HEAD = 1; /* i: waiting for magic header */\nconst FLAGS = 2; /* i: waiting for method and flags (gzip) */\nconst TIME = 3; /* i: waiting for modification time (gzip) */\nconst OS = 4; /* i: waiting for extra flags and operating system (gzip) */\nconst EXLEN = 5; /* i: waiting for extra length (gzip) */\nconst EXTRA = 6; /* i: waiting for extra bytes (gzip) */\nconst NAME = 7; /* i: waiting for end of file name (gzip) */\nconst COMMENT = 8; /* i: waiting for end of comment (gzip) */\nconst HCRC = 9; /* i: waiting for header crc (gzip) */\nconst DICTID = 10; /* i: waiting for dictionary check value */\nconst DICT = 11; /* waiting for inflateSetDictionary() call */\nconst TYPE = 12; /* i: waiting for type bits, including last-flag bit */\nconst TYPEDO = 13; /* i: same, but skip check to exit inflate on new block */\nconst STORED = 14; /* i: waiting for stored size (length and complement) */\nconst COPY_ = 15; /* i/o: same as COPY below, but only first time in */\nconst COPY = 16; /* i/o: waiting for input or output to copy stored block */\nconst TABLE = 17; /* i: waiting for dynamic block table lengths */\nconst LENLENS = 18; /* i: waiting for code length code lengths */\nconst CODELENS = 19; /* i: waiting for length/lit and distance code lengths */\nconst LEN_ = 20; /* i: same as LEN below, but only first time in */\nconst LEN = 21; /* i: waiting for length/lit/eob code */\nconst LENEXT = 22; /* i: waiting for length extra bits */\nconst DIST = 23; /* i: waiting for distance code */\nconst DISTEXT = 24; /* i: waiting for distance extra bits */\nconst MATCH = 25; /* o: waiting for output space to copy string */\nconst LIT = 26; /* o: waiting for output space to write literal */\nconst CHECK = 27; /* i: waiting for 32-bit check value */\nconst LENGTH = 28; /* i: waiting for 32-bit length (gzip) */\nconst DONE = 29; /* finished check, done -- remain here until reset */\nconst BAD = 30; /* got a data error -- remain here until reset */\n//const MEM = 31; /* got an inflate() memory error -- remain here until reset */\nconst SYNC = 32; /* looking for synchronization bytes to restart inflate() */\n\n/* ===========================================================================*/\n\n\n\nconst ENOUGH_LENS = 852;\nconst ENOUGH_DISTS = 592;\n//var ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS);\n\nconst MAX_WBITS = 15;\n/* 32K LZ77 window */\nconst DEF_WBITS = MAX_WBITS;\n\n\nfunction zswap32(q) {\n return (((q >>> 24) & 0xff) +\n ((q >>> 8) & 0xff00) +\n ((q & 0xff00) << 8) +\n ((q & 0xff) << 24));\n}\n\n\nclass InflateState {\n constructor() {\n this.mode = 0; /* current inflate mode */\n this.last = false; /* true if processing last block */\n this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip */\n this.havedict = false; /* true if dictionary provided */\n this.flags = 0; /* gzip header method and flags (0 if zlib) */\n this.dmax = 0; /* zlib header max distance (INFLATE_STRICT) */\n this.check = 0; /* protected copy of check value */\n this.total = 0; /* protected copy of output count */\n // TODO: may be {}\n this.head = null; /* where to save gzip header information */\n\n /* sliding window */\n this.wbits = 0; /* log base 2 of requested window size */\n this.wsize = 0; /* window size or zero if not using window */\n this.whave = 0; /* valid bytes in the window */\n this.wnext = 0; /* window write index */\n this.window = null; /* allocated sliding window, if needed */\n\n /* bit accumulator */\n this.hold = 0; /* input bit accumulator */\n this.bits = 0; /* number of bits in \"in\" */\n\n /* for string and stored block copying */\n this.length = 0; /* literal or length of data to copy */\n this.offset = 0; /* distance back to copy string from */\n\n /* for table and code decoding */\n this.extra = 0; /* extra bits needed */\n\n /* fixed and dynamic code tables */\n this.lencode = null; /* starting table for length/literal codes */\n this.distcode = null; /* starting table for distance codes */\n this.lenbits = 0; /* index bits for lencode */\n this.distbits = 0; /* index bits for distcode */\n\n /* dynamic table building */\n this.ncode = 0; /* number of code length code lengths */\n this.nlen = 0; /* number of length code lengths */\n this.ndist = 0; /* number of distance code lengths */\n this.have = 0; /* number of code lengths in lens[] */\n this.next = null; /* next available space in codes[] */\n\n this.lens = new utils.Buf16(320); /* temporary storage for code lengths */\n this.work = new utils.Buf16(288); /* work area for code table building */\n\n /*\n because we don't have pointers in js, we use lencode and distcode directly\n as buffers so we don't need codes\n */\n //this.codes = new utils.Buf32(ENOUGH); /* space for code tables */\n this.lendyn = null; /* dynamic table for length/literal codes (JS specific) */\n this.distdyn = null; /* dynamic table for distance codes (JS specific) */\n this.sane = 0; /* if false, allow invalid distance too far */\n this.back = 0; /* bits back of last unprocessed length/lit */\n this.was = 0; /* initial length of match */\n }\n}\n\nfunction inflateResetKeep(strm) {\n let state;\n\n if (!strm || !strm.state) { return Z_STREAM_ERROR; }\n state = strm.state;\n strm.total_in = strm.total_out = state.total = 0;\n strm.msg = ''; /*Z_NULL*/\n if (state.wrap) { /* to support ill-conceived Java test suite */\n strm.adler = state.wrap & 1;\n }\n state.mode = HEAD;\n state.last = 0;\n state.havedict = 0;\n state.dmax = 32768;\n state.head = null/*Z_NULL*/;\n state.hold = 0;\n state.bits = 0;\n //state.lencode = state.distcode = state.next = state.codes;\n state.lencode = state.lendyn = new utils.Buf32(ENOUGH_LENS);\n state.distcode = state.distdyn = new utils.Buf32(ENOUGH_DISTS);\n\n state.sane = 1;\n state.back = -1;\n //Tracev((stderr, \"inflate: reset\\n\"));\n return Z_OK;\n}\n\nfunction inflateReset(strm) {\n let state;\n\n if (!strm || !strm.state) { return Z_STREAM_ERROR; }\n state = strm.state;\n state.wsize = 0;\n state.whave = 0;\n state.wnext = 0;\n return inflateResetKeep(strm);\n\n}\n\nfunction inflateReset2(strm, windowBits) {\n let wrap;\n let state;\n\n /* get the state */\n if (!strm || !strm.state) { return Z_STREAM_ERROR; }\n state = strm.state;\n\n /* extract wrap request from windowBits parameter */\n if (windowBits < 0) {\n wrap = 0;\n windowBits = -windowBits;\n }\n else {\n wrap = (windowBits >> 4) + 1;\n if (windowBits < 48) {\n windowBits &= 15;\n }\n }\n\n /* set number of window bits, free window if different */\n if (windowBits && (windowBits < 8 || windowBits > 15)) {\n return Z_STREAM_ERROR;\n }\n if (state.window !== null && state.wbits !== windowBits) {\n state.window = null;\n }\n\n /* update state and reset the rest of it */\n state.wrap = wrap;\n state.wbits = windowBits;\n return inflateReset(strm);\n}\n\nfunction inflateInit2(strm, windowBits) {\n let ret;\n let state;\n\n if (!strm) { return Z_STREAM_ERROR; }\n //strm.msg = Z_NULL; /* in case we return an error */\n\n state = new InflateState();\n\n //if (state === Z_NULL) return Z_MEM_ERROR;\n //Tracev((stderr, \"inflate: allocated\\n\"));\n strm.state = state;\n state.window = null/*Z_NULL*/;\n ret = inflateReset2(strm, windowBits);\n if (ret !== Z_OK) {\n strm.state = null/*Z_NULL*/;\n }\n return ret;\n}\n\nfunction inflateInit(strm) {\n return inflateInit2(strm, DEF_WBITS);\n}\n\n\n/*\n Return state with length and distance decoding tables and index sizes set to\n fixed code decoding. Normally this returns fixed tables from inffixed.h.\n If BUILDFIXED is defined, then instead this routine builds the tables the\n first time it's called, and returns those tables the first time and\n thereafter. This reduces the size of the code by about 2K bytes, in\n exchange for a little execution time. However, BUILDFIXED should not be\n used for threaded applications, since the rewriting of the tables and virgin\n may not be thread-safe.\n */\nlet virgin = true;\n\nlet lenfix, distfix; // We have no pointers in JS, so keep tables separate\n\nfunction fixedtables(state) {\n /* build fixed huffman tables if first call (may not be thread safe) */\n if (virgin) {\n let sym;\n\n lenfix = new utils.Buf32(512);\n distfix = new utils.Buf32(32);\n\n /* literal/length table */\n sym = 0;\n while (sym < 144) { state.lens[sym++] = 8; }\n while (sym < 256) { state.lens[sym++] = 9; }\n while (sym < 280) { state.lens[sym++] = 7; }\n while (sym < 288) { state.lens[sym++] = 8; }\n\n inflate_table(LENS, state.lens, 0, 288, lenfix, 0, state.work, { bits: 9 });\n\n /* distance table */\n sym = 0;\n while (sym < 32) { state.lens[sym++] = 5; }\n\n inflate_table(DISTS, state.lens, 0, 32, distfix, 0, state.work, { bits: 5 });\n\n /* do this just once */\n virgin = false;\n }\n\n state.lencode = lenfix;\n state.lenbits = 9;\n state.distcode = distfix;\n state.distbits = 5;\n}\n\n\n/*\n Update the window with the last wsize (normally 32K) bytes written before\n returning. If window does not exist yet, create it. This is only called\n when a window is already in use, or when output has been written during this\n inflate call, but the end of the deflate stream has not been reached yet.\n It is also called to create a window for dictionary data when a dictionary\n is loaded.\n\n Providing output buffers larger than 32K to inflate() should provide a speed\n advantage, since only the last 32K of output is copied to the sliding window\n upon return from inflate(), and since all distances after the first 32K of\n output will fall in the output data, making match copies simpler and faster.\n The advantage may be dependent on the size of the processor's data caches.\n */\nfunction updatewindow(strm, src, end, copy) {\n let dist;\n const state = strm.state;\n\n /* if it hasn't been done already, allocate space for the window */\n if (state.window === null) {\n state.wsize = 1 << state.wbits;\n state.wnext = 0;\n state.whave = 0;\n\n state.window = new utils.Buf8(state.wsize);\n }\n\n /* copy state->wsize or less output bytes into the circular window */\n if (copy >= state.wsize) {\n utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);\n state.wnext = 0;\n state.whave = state.wsize;\n }\n else {\n dist = state.wsize - state.wnext;\n if (dist > copy) {\n dist = copy;\n }\n //zmemcpy(state->window + state->wnext, end - copy, dist);\n utils.arraySet(state.window, src, end - copy, dist, state.wnext);\n copy -= dist;\n if (copy) {\n //zmemcpy(state->window, end - copy, copy);\n utils.arraySet(state.window, src, end - copy, copy, 0);\n state.wnext = copy;\n state.whave = state.wsize;\n }\n else {\n state.wnext += dist;\n if (state.wnext === state.wsize) { state.wnext = 0; }\n if (state.whave < state.wsize) { state.whave += dist; }\n }\n }\n return 0;\n}\n\nfunction inflate(strm, flush) {\n let state;\n let input, output; // input/output buffers\n let next; /* next input INDEX */\n let put; /* next output INDEX */\n let have, left; /* available input and output */\n let hold; /* bit buffer */\n let bits; /* bits in bit buffer */\n let _in, _out; /* save starting available input and output */\n let copy; /* number of stored or match bytes to copy */\n let from; /* where to copy match bytes from */\n let from_source;\n let here = 0; /* current decoding table entry */\n let here_bits, here_op, here_val; // paked \"here\" denormalized (JS specific)\n //var last; /* parent table entry */\n let last_bits, last_op, last_val; // paked \"last\" denormalized (JS specific)\n let len; /* length to copy for repeats, bits to drop */\n let ret; /* return code */\n let hbuf = new utils.Buf8(4); /* buffer for gzip header crc calculation */\n let opts;\n\n let n; // temporary var for NEED_BITS\n\n const order = /* permutation of code lengths */\n [ 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 ];\n\n\n if (!strm || !strm.state || !strm.output ||\n (!strm.input && strm.avail_in !== 0)) {\n return Z_STREAM_ERROR;\n }\n\n state = strm.state;\n if (state.mode === TYPE) { state.mode = TYPEDO; } /* skip check */\n\n\n //--- LOAD() ---\n put = strm.next_out;\n output = strm.output;\n left = strm.avail_out;\n next = strm.next_in;\n input = strm.input;\n have = strm.avail_in;\n hold = state.hold;\n bits = state.bits;\n //---\n\n _in = have;\n _out = left;\n ret = Z_OK;\n\n inf_leave: // goto emulation\n for (;;) {\n switch (state.mode) {\n case HEAD:\n if (state.wrap === 0) {\n state.mode = TYPEDO;\n break;\n }\n //=== NEEDBITS(16);\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if ((state.wrap & 2) && hold === 0x8b1f) { /* gzip header */\n state.check = 0/*crc32(0L, Z_NULL, 0)*/;\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n state.check = crc32(state.check, hbuf, 2, 0);\n //===//\n\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = FLAGS;\n break;\n }\n state.flags = 0; /* expect zlib header */\n if (state.head) {\n state.head.done = false;\n }\n if (!(state.wrap & 1) || /* check if zlib header allowed */\n (((hold & 0xff)/*BITS(8)*/ << 8) + (hold >> 8)) % 31) {\n strm.msg = 'incorrect header check';\n state.mode = BAD;\n break;\n }\n if ((hold & 0x0f)/*BITS(4)*/ !== Z_DEFLATED) {\n strm.msg = 'unknown compression method';\n state.mode = BAD;\n break;\n }\n //--- DROPBITS(4) ---//\n hold >>>= 4;\n bits -= 4;\n //---//\n len = (hold & 0x0f)/*BITS(4)*/ + 8;\n if (state.wbits === 0) {\n state.wbits = len;\n }\n else if (len > state.wbits) {\n strm.msg = 'invalid window size';\n state.mode = BAD;\n break;\n }\n state.dmax = 1 << len;\n //Tracev((stderr, \"inflate: zlib header ok\\n\"));\n strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/;\n state.mode = hold & 0x200 ? DICTID : TYPE;\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n break;\n case FLAGS:\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.flags = hold;\n if ((state.flags & 0xff) !== Z_DEFLATED) {\n strm.msg = 'unknown compression method';\n state.mode = BAD;\n break;\n }\n if (state.flags & 0xe000) {\n strm.msg = 'unknown header flags set';\n state.mode = BAD;\n break;\n }\n if (state.head) {\n state.head.text = ((hold >> 8) & 1);\n }\n if (state.flags & 0x0200) {\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n state.check = crc32(state.check, hbuf, 2, 0);\n //===//\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = TIME;\n /* falls through */\n case TIME:\n //=== NEEDBITS(32); */\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if (state.head) {\n state.head.time = hold;\n }\n if (state.flags & 0x0200) {\n //=== CRC4(state.check, hold)\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n hbuf[2] = (hold >>> 16) & 0xff;\n hbuf[3] = (hold >>> 24) & 0xff;\n state.check = crc32(state.check, hbuf, 4, 0);\n //===\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = OS;\n /* falls through */\n case OS:\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if (state.head) {\n state.head.xflags = (hold & 0xff);\n state.head.os = (hold >> 8);\n }\n if (state.flags & 0x0200) {\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n state.check = crc32(state.check, hbuf, 2, 0);\n //===//\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = EXLEN;\n /* falls through */\n case EXLEN:\n if (state.flags & 0x0400) {\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.length = hold;\n if (state.head) {\n state.head.extra_len = hold;\n }\n if (state.flags & 0x0200) {\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n state.check = crc32(state.check, hbuf, 2, 0);\n //===//\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n }\n else if (state.head) {\n state.head.extra = null/*Z_NULL*/;\n }\n state.mode = EXTRA;\n /* falls through */\n case EXTRA:\n if (state.flags & 0x0400) {\n copy = state.length;\n if (copy > have) { copy = have; }\n if (copy) {\n if (state.head) {\n len = state.head.extra_len - state.length;\n if (!state.head.extra) {\n // Use untyped array for more convenient processing later\n state.head.extra = new Array(state.head.extra_len);\n }\n utils.arraySet(\n state.head.extra,\n input,\n next,\n // extra field is limited to 65536 bytes\n // - no need for additional size check\n copy,\n /*len + copy > state.head.extra_max - len ? state.head.extra_max : copy,*/\n len\n );\n //zmemcpy(state.head.extra + len, next,\n // len + copy > state.head.extra_max ?\n // state.head.extra_max - len : copy);\n }\n if (state.flags & 0x0200) {\n state.check = crc32(state.check, input, copy, next);\n }\n have -= copy;\n next += copy;\n state.length -= copy;\n }\n if (state.length) { break inf_leave; }\n }\n state.length = 0;\n state.mode = NAME;\n /* falls through */\n case NAME:\n if (state.flags & 0x0800) {\n if (have === 0) { break inf_leave; }\n copy = 0;\n do {\n // TODO: 2 or 1 bytes?\n len = input[next + copy++];\n /* use constant limit because in js we should not preallocate memory */\n if (state.head && len &&\n (state.length < 65536 /*state.head.name_max*/)) {\n state.head.name += String.fromCharCode(len);\n }\n } while (len && copy < have);\n\n if (state.flags & 0x0200) {\n state.check = crc32(state.check, input, copy, next);\n }\n have -= copy;\n next += copy;\n if (len) { break inf_leave; }\n }\n else if (state.head) {\n state.head.name = null;\n }\n state.length = 0;\n state.mode = COMMENT;\n /* falls through */\n case COMMENT:\n if (state.flags & 0x1000) {\n if (have === 0) { break inf_leave; }\n copy = 0;\n do {\n len = input[next + copy++];\n /* use constant limit because in js we should not preallocate memory */\n if (state.head && len &&\n (state.length < 65536 /*state.head.comm_max*/)) {\n state.head.comment += String.fromCharCode(len);\n }\n } while (len && copy < have);\n if (state.flags & 0x0200) {\n state.check = crc32(state.check, input, copy, next);\n }\n have -= copy;\n next += copy;\n if (len) { break inf_leave; }\n }\n else if (state.head) {\n state.head.comment = null;\n }\n state.mode = HCRC;\n /* falls through */\n case HCRC:\n if (state.flags & 0x0200) {\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if (hold !== (state.check & 0xffff)) {\n strm.msg = 'header crc mismatch';\n state.mode = BAD;\n break;\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n }\n if (state.head) {\n state.head.hcrc = ((state.flags >> 9) & 1);\n state.head.done = true;\n }\n strm.adler = state.check = 0;\n state.mode = TYPE;\n break;\n case DICTID:\n //=== NEEDBITS(32); */\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n strm.adler = state.check = zswap32(hold);\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = DICT;\n /* falls through */\n case DICT:\n if (state.havedict === 0) {\n //--- RESTORE() ---\n strm.next_out = put;\n strm.avail_out = left;\n strm.next_in = next;\n strm.avail_in = have;\n state.hold = hold;\n state.bits = bits;\n //---\n return Z_NEED_DICT;\n }\n strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/;\n state.mode = TYPE;\n /* falls through */\n case TYPE:\n if (flush === Z_BLOCK || flush === Z_TREES) { break inf_leave; }\n /* falls through */\n case TYPEDO:\n if (state.last) {\n //--- BYTEBITS() ---//\n hold >>>= bits & 7;\n bits -= bits & 7;\n //---//\n state.mode = CHECK;\n break;\n }\n //=== NEEDBITS(3); */\n while (bits < 3) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.last = (hold & 0x01)/*BITS(1)*/;\n //--- DROPBITS(1) ---//\n hold >>>= 1;\n bits -= 1;\n //---//\n\n switch ((hold & 0x03)/*BITS(2)*/) {\n case 0: /* stored block */\n //Tracev((stderr, \"inflate: stored block%s\\n\",\n // state.last ? \" (last)\" : \"\"));\n state.mode = STORED;\n break;\n case 1: /* fixed block */\n fixedtables(state);\n //Tracev((stderr, \"inflate: fixed codes block%s\\n\",\n // state.last ? \" (last)\" : \"\"));\n state.mode = LEN_; /* decode codes */\n if (flush === Z_TREES) {\n //--- DROPBITS(2) ---//\n hold >>>= 2;\n bits -= 2;\n //---//\n break inf_leave;\n }\n break;\n case 2: /* dynamic block */\n //Tracev((stderr, \"inflate: dynamic codes block%s\\n\",\n // state.last ? \" (last)\" : \"\"));\n state.mode = TABLE;\n break;\n case 3:\n strm.msg = 'invalid block type';\n state.mode = BAD;\n }\n //--- DROPBITS(2) ---//\n hold >>>= 2;\n bits -= 2;\n //---//\n break;\n case STORED:\n //--- BYTEBITS() ---// /* go to byte boundary */\n hold >>>= bits & 7;\n bits -= bits & 7;\n //---//\n //=== NEEDBITS(32); */\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if ((hold & 0xffff) !== ((hold >>> 16) ^ 0xffff)) {\n strm.msg = 'invalid stored block lengths';\n state.mode = BAD;\n break;\n }\n state.length = hold & 0xffff;\n //Tracev((stderr, \"inflate: stored length %u\\n\",\n // state.length));\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = COPY_;\n if (flush === Z_TREES) { break inf_leave; }\n /* falls through */\n case COPY_:\n state.mode = COPY;\n /* falls through */\n case COPY:\n copy = state.length;\n if (copy) {\n if (copy > have) { copy = have; }\n if (copy > left) { copy = left; }\n if (copy === 0) { break inf_leave; }\n //--- zmemcpy(put, next, copy); ---\n utils.arraySet(output, input, next, copy, put);\n //---//\n have -= copy;\n next += copy;\n left -= copy;\n put += copy;\n state.length -= copy;\n break;\n }\n //Tracev((stderr, \"inflate: stored end\\n\"));\n state.mode = TYPE;\n break;\n case TABLE:\n //=== NEEDBITS(14); */\n while (bits < 14) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.nlen = (hold & 0x1f)/*BITS(5)*/ + 257;\n //--- DROPBITS(5) ---//\n hold >>>= 5;\n bits -= 5;\n //---//\n state.ndist = (hold & 0x1f)/*BITS(5)*/ + 1;\n //--- DROPBITS(5) ---//\n hold >>>= 5;\n bits -= 5;\n //---//\n state.ncode = (hold & 0x0f)/*BITS(4)*/ + 4;\n //--- DROPBITS(4) ---//\n hold >>>= 4;\n bits -= 4;\n //---//\n//#ifndef PKZIP_BUG_WORKAROUND\n if (state.nlen > 286 || state.ndist > 30) {\n strm.msg = 'too many length or distance symbols';\n state.mode = BAD;\n break;\n }\n//#endif\n //Tracev((stderr, \"inflate: table sizes ok\\n\"));\n state.have = 0;\n state.mode = LENLENS;\n /* falls through */\n case LENLENS:\n while (state.have < state.ncode) {\n //=== NEEDBITS(3);\n while (bits < 3) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.lens[order[state.have++]] = (hold & 0x07);//BITS(3);\n //--- DROPBITS(3) ---//\n hold >>>= 3;\n bits -= 3;\n //---//\n }\n while (state.have < 19) {\n state.lens[order[state.have++]] = 0;\n }\n // We have separate tables & no pointers. 2 commented lines below not needed.\n //state.next = state.codes;\n //state.lencode = state.next;\n // Switch to use dynamic table\n state.lencode = state.lendyn;\n state.lenbits = 7;\n\n opts = { bits: state.lenbits };\n ret = inflate_table(CODES, state.lens, 0, 19, state.lencode, 0, state.work, opts);\n state.lenbits = opts.bits;\n\n if (ret) {\n strm.msg = 'invalid code lengths set';\n state.mode = BAD;\n break;\n }\n //Tracev((stderr, \"inflate: code lengths ok\\n\"));\n state.have = 0;\n state.mode = CODELENS;\n /* falls through */\n case CODELENS:\n while (state.have < state.nlen + state.ndist) {\n for (;;) {\n here = state.lencode[hold & ((1 << state.lenbits) - 1)];/*BITS(state.lenbits)*/\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if ((here_bits) <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n if (here_val < 16) {\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n state.lens[state.have++] = here_val;\n }\n else {\n if (here_val === 16) {\n //=== NEEDBITS(here.bits + 2);\n n = here_bits + 2;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n if (state.have === 0) {\n strm.msg = 'invalid bit length repeat';\n state.mode = BAD;\n break;\n }\n len = state.lens[state.have - 1];\n copy = 3 + (hold & 0x03);//BITS(2);\n //--- DROPBITS(2) ---//\n hold >>>= 2;\n bits -= 2;\n //---//\n }\n else if (here_val === 17) {\n //=== NEEDBITS(here.bits + 3);\n n = here_bits + 3;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n len = 0;\n copy = 3 + (hold & 0x07);//BITS(3);\n //--- DROPBITS(3) ---//\n hold >>>= 3;\n bits -= 3;\n //---//\n }\n else {\n //=== NEEDBITS(here.bits + 7);\n n = here_bits + 7;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n len = 0;\n copy = 11 + (hold & 0x7f);//BITS(7);\n //--- DROPBITS(7) ---//\n hold >>>= 7;\n bits -= 7;\n //---//\n }\n if (state.have + copy > state.nlen + state.ndist) {\n strm.msg = 'invalid bit length repeat';\n state.mode = BAD;\n break;\n }\n while (copy--) {\n state.lens[state.have++] = len;\n }\n }\n }\n\n /* handle error breaks in while */\n if (state.mode === BAD) { break; }\n\n /* check for end-of-block code (better have one) */\n if (state.lens[256] === 0) {\n strm.msg = 'invalid code -- missing end-of-block';\n state.mode = BAD;\n break;\n }\n\n /* build code tables -- note: do not change the lenbits or distbits\n values here (9 and 6) without reading the comments in inftrees.h\n concerning the ENOUGH constants, which depend on those values */\n state.lenbits = 9;\n\n opts = { bits: state.lenbits };\n ret = inflate_table(LENS, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts);\n // We have separate tables & no pointers. 2 commented lines below not needed.\n // state.next_index = opts.table_index;\n state.lenbits = opts.bits;\n // state.lencode = state.next;\n\n if (ret) {\n strm.msg = 'invalid literal/lengths set';\n state.mode = BAD;\n break;\n }\n\n state.distbits = 6;\n //state.distcode.copy(state.codes);\n // Switch to use dynamic table\n state.distcode = state.distdyn;\n opts = { bits: state.distbits };\n ret = inflate_table(DISTS, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts);\n // We have separate tables & no pointers. 2 commented lines below not needed.\n // state.next_index = opts.table_index;\n state.distbits = opts.bits;\n // state.distcode = state.next;\n\n if (ret) {\n strm.msg = 'invalid distances set';\n state.mode = BAD;\n break;\n }\n //Tracev((stderr, 'inflate: codes ok\\n'));\n state.mode = LEN_;\n if (flush === Z_TREES) { break inf_leave; }\n /* falls through */\n case LEN_:\n state.mode = LEN;\n /* falls through */\n case LEN:\n if (have >= 6 && left >= 258) {\n //--- RESTORE() ---\n strm.next_out = put;\n strm.avail_out = left;\n strm.next_in = next;\n strm.avail_in = have;\n state.hold = hold;\n state.bits = bits;\n //---\n inflate_fast(strm, _out);\n //--- LOAD() ---\n put = strm.next_out;\n output = strm.output;\n left = strm.avail_out;\n next = strm.next_in;\n input = strm.input;\n have = strm.avail_in;\n hold = state.hold;\n bits = state.bits;\n //---\n\n if (state.mode === TYPE) {\n state.back = -1;\n }\n break;\n }\n state.back = 0;\n for (;;) {\n here = state.lencode[hold & ((1 << state.lenbits) - 1)]; /*BITS(state.lenbits)*/\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if (here_bits <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n if (here_op && (here_op & 0xf0) === 0) {\n last_bits = here_bits;\n last_op = here_op;\n last_val = here_val;\n for (;;) {\n here = state.lencode[last_val +\n ((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)];\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if ((last_bits + here_bits) <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n //--- DROPBITS(last.bits) ---//\n hold >>>= last_bits;\n bits -= last_bits;\n //---//\n state.back += last_bits;\n }\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n state.back += here_bits;\n state.length = here_val;\n if (here_op === 0) {\n //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?\n // \"inflate: literal '%c'\\n\" :\n // \"inflate: literal 0x%02x\\n\", here.val));\n state.mode = LIT;\n break;\n }\n if (here_op & 32) {\n //Tracevv((stderr, \"inflate: end of block\\n\"));\n state.back = -1;\n state.mode = TYPE;\n break;\n }\n if (here_op & 64) {\n strm.msg = 'invalid literal/length code';\n state.mode = BAD;\n break;\n }\n state.extra = here_op & 15;\n state.mode = LENEXT;\n /* falls through */\n case LENEXT:\n if (state.extra) {\n //=== NEEDBITS(state.extra);\n n = state.extra;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.length += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/;\n //--- DROPBITS(state.extra) ---//\n hold >>>= state.extra;\n bits -= state.extra;\n //---//\n state.back += state.extra;\n }\n //Tracevv((stderr, \"inflate: length %u\\n\", state.length));\n state.was = state.length;\n state.mode = DIST;\n /* falls through */\n case DIST:\n for (;;) {\n here = state.distcode[hold & ((1 << state.distbits) - 1)];/*BITS(state.distbits)*/\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if ((here_bits) <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n if ((here_op & 0xf0) === 0) {\n last_bits = here_bits;\n last_op = here_op;\n last_val = here_val;\n for (;;) {\n here = state.distcode[last_val +\n ((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)];\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if ((last_bits + here_bits) <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n //--- DROPBITS(last.bits) ---//\n hold >>>= last_bits;\n bits -= last_bits;\n //---//\n state.back += last_bits;\n }\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n state.back += here_bits;\n if (here_op & 64) {\n strm.msg = 'invalid distance code';\n state.mode = BAD;\n break;\n }\n state.offset = here_val;\n state.extra = (here_op) & 15;\n state.mode = DISTEXT;\n /* falls through */\n case DISTEXT:\n if (state.extra) {\n //=== NEEDBITS(state.extra);\n n = state.extra;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.offset += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/;\n //--- DROPBITS(state.extra) ---//\n hold >>>= state.extra;\n bits -= state.extra;\n //---//\n state.back += state.extra;\n }\n//#ifdef INFLATE_STRICT\n if (state.offset > state.dmax) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD;\n break;\n }\n//#endif\n //Tracevv((stderr, \"inflate: distance %u\\n\", state.offset));\n state.mode = MATCH;\n /* falls through */\n case MATCH:\n if (left === 0) { break inf_leave; }\n copy = _out - left;\n if (state.offset > copy) { /* copy from window */\n copy = state.offset - copy;\n if (copy > state.whave) {\n if (state.sane) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD;\n break;\n }\n// (!) This block is disabled in zlib defaults,\n// don't enable it for binary compatibility\n//#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR\n// Trace((stderr, \"inflate.c too far\\n\"));\n// copy -= state.whave;\n// if (copy > state.length) { copy = state.length; }\n// if (copy > left) { copy = left; }\n// left -= copy;\n// state.length -= copy;\n// do {\n// output[put++] = 0;\n// } while (--copy);\n// if (state.length === 0) { state.mode = LEN; }\n// break;\n//#endif\n }\n if (copy > state.wnext) {\n copy -= state.wnext;\n from = state.wsize - copy;\n }\n else {\n from = state.wnext - copy;\n }\n if (copy > state.length) { copy = state.length; }\n from_source = state.window;\n }\n else { /* copy from output */\n from_source = output;\n from = put - state.offset;\n copy = state.length;\n }\n if (copy > left) { copy = left; }\n left -= copy;\n state.length -= copy;\n do {\n output[put++] = from_source[from++];\n } while (--copy);\n if (state.length === 0) { state.mode = LEN; }\n break;\n case LIT:\n if (left === 0) { break inf_leave; }\n output[put++] = state.length;\n left--;\n state.mode = LEN;\n break;\n case CHECK:\n if (state.wrap) {\n //=== NEEDBITS(32);\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n // Use '|' instead of '+' to make sure that result is signed\n hold |= input[next++] << bits;\n bits += 8;\n }\n //===//\n _out -= left;\n strm.total_out += _out;\n state.total += _out;\n if (_out) {\n strm.adler = state.check =\n /*UPDATE(state.check, put - _out, _out);*/\n (state.flags ? crc32(state.check, output, _out, put - _out) : adler32(state.check, output, _out, put - _out));\n\n }\n _out = left;\n // NB: crc32 stored as signed 32-bit int, zswap32 returns signed too\n if ((state.flags ? hold : zswap32(hold)) !== state.check) {\n strm.msg = 'incorrect data check';\n state.mode = BAD;\n break;\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n //Tracev((stderr, \"inflate: check matches trailer\\n\"));\n }\n state.mode = LENGTH;\n /* falls through */\n case LENGTH:\n if (state.wrap && state.flags) {\n //=== NEEDBITS(32);\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if (hold !== (state.total & 0xffffffff)) {\n strm.msg = 'incorrect length check';\n state.mode = BAD;\n break;\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n //Tracev((stderr, \"inflate: length matches trailer\\n\"));\n }\n state.mode = DONE;\n /* falls through */\n case DONE:\n ret = Z_STREAM_END;\n break inf_leave;\n case BAD:\n ret = Z_DATA_ERROR;\n break inf_leave;\n // case MEM:\n // return Z_MEM_ERROR;\n case SYNC:\n /* falls through */\n default:\n return Z_STREAM_ERROR;\n }\n }\n\n // inf_leave <- here is real place for \"goto inf_leave\", emulated via \"break inf_leave\"\n\n /*\n Return from inflate(), updating the total counts and the check value.\n If there was no progress during the inflate() call, return a buffer\n error. Call updatewindow() to create and/or update the window state.\n Note: a memory error from inflate() is non-recoverable.\n */\n\n //--- RESTORE() ---\n strm.next_out = put;\n strm.avail_out = left;\n strm.next_in = next;\n strm.avail_in = have;\n state.hold = hold;\n state.bits = bits;\n //---\n\n if (state.wsize || (_out !== strm.avail_out && state.mode < BAD &&\n (state.mode < CHECK || flush !== Z_FINISH))) {\n if (updatewindow(strm, strm.output, strm.next_out, _out - strm.avail_out)) {\n // state.mode = MEM;\n // return Z_MEM_ERROR;\n }\n }\n _in -= strm.avail_in;\n _out -= strm.avail_out;\n strm.total_in += _in;\n strm.total_out += _out;\n state.total += _out;\n if (state.wrap && _out) {\n strm.adler = state.check = /*UPDATE(state.check, strm.next_out - _out, _out);*/\n (state.flags ? crc32(state.check, output, _out, strm.next_out - _out) : adler32(state.check, output, _out, strm.next_out - _out));\n }\n strm.data_type = state.bits + (state.last ? 64 : 0) +\n (state.mode === TYPE ? 128 : 0) +\n (state.mode === LEN_ || state.mode === COPY_ ? 256 : 0);\n if (((_in === 0 && _out === 0) || flush === Z_FINISH) && ret === Z_OK) {\n ret = Z_BUF_ERROR;\n }\n return ret;\n}\n\nfunction inflateEnd(strm) {\n\n if (!strm || !strm.state /*|| strm->zfree == (free_func)0*/) {\n return Z_STREAM_ERROR;\n }\n\n const state = strm.state;\n if (state.window) {\n state.window = null;\n }\n strm.state = null;\n return Z_OK;\n}\n\nfunction inflateGetHeader(strm, head) {\n let state;\n\n /* check state */\n if (!strm || !strm.state) { return Z_STREAM_ERROR; }\n state = strm.state;\n if ((state.wrap & 2) === 0) { return Z_STREAM_ERROR; }\n\n /* save header structure */\n state.head = head;\n head.done = false;\n return Z_OK;\n}\n\nfunction inflateSetDictionary(strm, dictionary) {\n const dictLength = dictionary.length;\n\n let state;\n let dictid;\n let ret;\n\n /* check state */\n if (!strm /* == Z_NULL */ || !strm.state /* == Z_NULL */) { return Z_STREAM_ERROR; }\n state = strm.state;\n\n if (state.wrap !== 0 && state.mode !== DICT) {\n return Z_STREAM_ERROR;\n }\n\n /* check for correct dictionary identifier */\n if (state.mode === DICT) {\n dictid = 1; /* adler32(0, null, 0)*/\n /* dictid = adler32(dictid, dictionary, dictLength); */\n dictid = adler32(dictid, dictionary, dictLength, 0);\n if (dictid !== state.check) {\n return Z_DATA_ERROR;\n }\n }\n /* copy dictionary to window using updatewindow(), which will amend the\n existing dictionary if appropriate */\n ret = updatewindow(strm, dictionary, dictLength, dictLength);\n // if (ret) {\n // state.mode = MEM;\n // return Z_MEM_ERROR;\n // }\n state.havedict = 1;\n // Tracev((stderr, \"inflate: dictionary set\\n\"));\n return Z_OK;\n}\n\nconst inflateInfo = 'pako inflate (from Nodeca project)';\n\nexport {\n inflateReset,\n inflateReset2,\n inflateResetKeep,\n inflateInit,\n inflateInit2,\n inflate,\n inflateEnd,\n inflateGetHeader,\n inflateSetDictionary,\n inflateInfo\n};\n\n/* Not implemented\nexports.inflateCopy = inflateCopy;\nexports.inflateGetDictionary = inflateGetDictionary;\nexports.inflateMark = inflateMark;\nexports.inflatePrime = inflatePrime;\nexports.inflateSync = inflateSync;\nexports.inflateSyncPoint = inflateSyncPoint;\nexports.inflateUndermine = inflateUndermine;\n*/\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nexport default class GZheader {\n constructor() {\n /* true if compressed data believed to be text */\n this.text = 0;\n /* modification time */\n this.time = 0;\n /* extra flags (not used when writing a gzip file) */\n this.xflags = 0;\n /* operating system */\n this.os = 0;\n /* pointer to extra field or Z_NULL if none */\n this.extra = null;\n /* extra field length (valid if extra != Z_NULL) */\n this.extra_len = 0; // Actually, we don't need it in JS,\n // but leave for few code modifications\n\n //\n // Setup limits is not necessary because in js we should not preallocate memory\n // for inflate use constant limit in 65536 bytes\n //\n\n /* space at extra (only when reading header) */\n // this.extra_max = 0;\n /* pointer to zero-terminated file name or Z_NULL */\n this.name = '';\n /* space at name (only when reading header) */\n // this.name_max = 0;\n /* pointer to zero-terminated 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 = enums.literal.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 {enums.literal} [format] - The format of the string of bytes\n */\n setText(text, format = enums.literal.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 {enums.literal} 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 = await reader.readByte(); // enums.literal\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 let data = reader.remainder();\n if (stream.isArrayStream(data)) data = await stream.readToEnd(data);\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([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\nimport * as stream from '@openpgp/web-stream-tools';\nimport { readSimpleLength, UnsupportedError, writeSimpleLength } from './packet';\nimport KeyID from '../type/keyid';\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 /** @type {enums.signature} */\n this.signatureType = null;\n /** @type {enums.hash} */\n this.hashAlgorithm = null;\n /** @type {enums.publicKey} */\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 if (key.version === 5) {\n this.version = 5;\n } else {\n this.version = 4;\n }\n const arr = [new Uint8Array([this.version, this.signatureType, this.publicKeyAlgorithm, this.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 // Remove unhashed subpackets, in case some allowed unhashed\n // subpackets existed, in order not to duplicate them (in both\n // the hashed and unhashed subpackets) when re-signing.\n this.unhashedSubpackets = [];\n\n this.signatureData = util.concat(arr);\n\n const toHash = this.toHash(this.signatureType, data, detached);\n const hash = await this.hash(this.signatureType, data, toHash, detached);\n\n this.signedHashValue = stream.slice(stream.clone(hash), 0, 2);\n const signed = async () => crypto.signature.sign(\n this.publicKeyAlgorithm, this.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, true, util.writeDate(this.created)));\n if (this.signatureExpirationTime !== null) {\n arr.push(writeSubPacket(sub.signatureExpirationTime, true, util.writeNumber(this.signatureExpirationTime, 4)));\n }\n if (this.exportable !== null) {\n arr.push(writeSubPacket(sub.exportableCertification, true, 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, true, bytes));\n }\n if (this.regularExpression !== null) {\n arr.push(writeSubPacket(sub.regularExpression, true, this.regularExpression));\n }\n if (this.revocable !== null) {\n arr.push(writeSubPacket(sub.revocable, true, new Uint8Array([this.revocable ? 1 : 0])));\n }\n if (this.keyExpirationTime !== null) {\n arr.push(writeSubPacket(sub.keyExpirationTime, true, 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, false, 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, false, bytes));\n }\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, true, this.issuerKeyID.write()));\n }\n this.rawNotations.forEach(({ name, value, humanReadable, critical }) => {\n bytes = [new Uint8Array([humanReadable ? 0x80 : 0, 0, 0, 0])];\n const encodedName = util.encodeUTF8(name);\n // 2 octets of name length\n bytes.push(util.writeNumber(encodedName.length, 2));\n // 2 octets of value length\n bytes.push(util.writeNumber(value.length, 2));\n bytes.push(encodedName);\n bytes.push(value);\n bytes = util.concat(bytes);\n arr.push(writeSubPacket(sub.notationData, critical, bytes));\n });\n if (this.preferredHashAlgorithms !== null) {\n bytes = util.stringToUint8Array(util.uint8ArrayToString(this.preferredHashAlgorithms));\n arr.push(writeSubPacket(sub.preferredHashAlgorithms, false, bytes));\n }\n if (this.preferredCompressionAlgorithms !== null) {\n bytes = util.stringToUint8Array(util.uint8ArrayToString(this.preferredCompressionAlgorithms));\n arr.push(writeSubPacket(sub.preferredCompressionAlgorithms, false, bytes));\n }\n if (this.keyServerPreferences !== null) {\n bytes = util.stringToUint8Array(util.uint8ArrayToString(this.keyServerPreferences));\n arr.push(writeSubPacket(sub.keyServerPreferences, false, bytes));\n }\n if (this.preferredKeyServer !== null) {\n arr.push(writeSubPacket(sub.preferredKeyServer, false, util.encodeUTF8(this.preferredKeyServer)));\n }\n if (this.isPrimaryUserID !== null) {\n arr.push(writeSubPacket(sub.primaryUserID, false, new Uint8Array([this.isPrimaryUserID ? 1 : 0])));\n }\n if (this.policyURI !== null) {\n arr.push(writeSubPacket(sub.policyURI, false, util.encodeUTF8(this.policyURI)));\n }\n if (this.keyFlags !== null) {\n bytes = util.stringToUint8Array(util.uint8ArrayToString(this.keyFlags));\n arr.push(writeSubPacket(sub.keyFlags, true, bytes));\n }\n if (this.signersUserID !== null) {\n arr.push(writeSubPacket(sub.signersUserID, false, util.encodeUTF8(this.signersUserID)));\n }\n if (this.reasonForRevocationFlag !== null) {\n bytes = util.stringToUint8Array(String.fromCharCode(this.reasonForRevocationFlag) + this.reasonForRevocationString);\n arr.push(writeSubPacket(sub.reasonForRevocation, true, bytes));\n }\n if (this.features !== null) {\n bytes = util.stringToUint8Array(util.uint8ArrayToString(this.features));\n arr.push(writeSubPacket(sub.features, false, 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, true, bytes));\n }\n if (this.embeddedSignature !== null) {\n arr.push(writeSubPacket(sub.embeddedSignature, true, 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, this.version === 5, bytes));\n }\n if (this.preferredAEADAlgorithms !== null) {\n bytes = util.stringToUint8Array(util.uint8ArrayToString(this.preferredAEADAlgorithms));\n arr.push(writeSubPacket(sub.preferredAEADAlgorithms, false, 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 an Uint8Array containing the unhashed subpackets\n * @returns {Uint8Array} Subpacket data.\n */\n writeUnhashedSubPackets() {\n const arr = [];\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) {\n this.unhashedSubpackets.push(bytes.subarray(mypos, bytes.length));\n if (!allowedUnhashedSubpackets.has(type)) {\n return;\n }\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.decodeUTF8(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.decodeUTF8(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.decodeUTF8(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.decodeUTF8(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.decodeUTF8(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.decodeUTF8(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 if (!toHash) toHash = this.toHash(signatureType, data, detached);\n return crypto.hash.digest(this.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 {Uint8Array|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 if (!this.issuerKeyID.equals(key.getKeyID())) {\n throw new Error('Signature was not issued by the given public key');\n }\n if (this.publicKeyAlgorithm !== 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 this.publicKeyAlgorithm, this.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(this.hashAlgorithm)) {\n throw new Error('Insecure hash algorithm: ' + enums.read(enums.hash, this.hashAlgorithm).toUpperCase());\n }\n if (config.rejectMessageHashAlgorithms.has(this.hashAlgorithm) &&\n [enums.signature.binary, enums.signature.text].includes(this.signatureType)) {\n throw new Error('Insecure message hash algorithm: ' + enums.read(enums.hash, this.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 Uint8Array 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 {Boolean} critical - Whether the subpacket should be critical.\n * @param {String} data - Data to be included\n * @returns {Uint8Array} The signature subpacket.\n * @private\n */\nfunction writeSubPacket(type, critical, data) {\n const arr = [];\n arr.push(writeSimpleLength(data.length + 1));\n arr.push(new Uint8Array([(critical ? 0x80 : 0) | 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 * @type {enums.signature}\n\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 * @type {enums.hash}\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 * @type {enums.publicKey}\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, this.signatureType, this.hashAlgorithm, 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 UnparseablePacket,\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 if (config.additionalAllowedPackets.length) {\n allowedPackets = { ...allowedPackets, ...util.constructAllowedPackets(config.additionalAllowedPackets) };\n }\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 } else {\n const unparsedPacket = new UnparseablePacket(parsed.tag, parsed.packet);\n await writer.write(unparsedPacket);\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 tag = this[i] instanceof UnparseablePacket ? this[i].tag : this[i].constructor.tag;\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(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(tag, length)));\n } else {\n arr.push(writeHeader(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 {enums.compression}\n */\n this.algorithm = 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 = 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([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 const compressionName = enums.read(enums.compression, this.algorithm);\n const decompressionFn = decompress_fns[compressionName];\n if (!decompressionFn) {\n throw new Error(`${compressionName} decompression not supported`);\n }\n\n this.packets = await PacketList.fromBinary(decompressionFn(this.compressed), allowedPackets, config);\n }\n\n /**\n * Compress the packet data (member decompressedData)\n */\n compress() {\n const compressionName = enums.read(enums.compression, this.algorithm);\n const compressionFn = compress_fns[compressionName];\n if (!compressionFn) {\n throw new Error(`${compressionName} compression not supported`);\n }\n\n this.compressed = compressionFn(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 {enums.symmetric} sessionKeyAlgorithm - The symmetric encryption 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 * @returns {Promise<Boolean>}\n * @throws {Error} on encryption failure\n * @async\n */\n async encrypt(sessionKeyAlgorithm, key, config = defaultConfig) {\n const { blockSize } = crypto.getCipher(sessionKeyAlgorithm);\n\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(blockSize), config);\n return true;\n }\n\n /**\n * Decrypts the encrypted data contained in the packet.\n * @param {enums.symmetric} sessionKeyAlgorithm - The selected symmetric encryption algorithm to be used\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 * @throws {Error} on decryption failure\n * @async\n */\n async decrypt(sessionKeyAlgorithm, key, config = defaultConfig) {\n const { blockSize } = crypto.getCipher(sessionKeyAlgorithm);\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(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, 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 /** @type {enums.symmetric} */\n this.cipherAlgorithm = null;\n /** @type {enums.aead} */\n this.aeadAlgorithm = enums.aead.eax;\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 * @throws {Error} on parsing failure\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.cipherAlgorithm = await reader.readByte();\n this.aeadAlgorithm = await reader.readByte();\n this.chunkSizeByte = await reader.readByte();\n\n const mode = crypto.getAEADMode(this.aeadAlgorithm);\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.cipherAlgorithm, this.aeadAlgorithm, this.chunkSizeByte]), this.iv, this.encrypted]);\n }\n\n /**\n * Decrypt the encrypted payload.\n * @param {enums.symmetric} sessionKeyAlgorithm - The session key's cipher algorithm\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 payload.\n * @param {enums.symmetric} sessionKeyAlgorithm - The session key's cipher algorithm\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.cipherAlgorithm = sessionKeyAlgorithm;\n\n const { ivLength } = crypto.getAEADMode(this.aeadAlgorithm);\n this.iv = crypto.random.getRandomBytes(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 mode = crypto.getAEADMode(this.aeadAlgorithm);\n const modeInstance = await mode(this.cipherAlgorithm, 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.cipherAlgorithm, this.aeadAlgorithm, 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 /**\n * Algorithm to encrypt the message with\n * @type {enums.symmetric}\n */\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 = bytes[9];\n this.encrypted = crypto.parseEncSessionKeyParams(this.publicKeyAlgorithm, 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 arr = [\n new Uint8Array([this.version]),\n this.publicKeyID.write(),\n new Uint8Array([this.publicKeyAlgorithm]),\n crypto.serializeParams(this.publicKeyAlgorithm, 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 packets (tag 1)\n * @param {SecretKeyPacket} key - decrypted private key\n * @param {Object} [randomSessionKey] - Bogus session key to use in case of sensitive decryption error, or if the decrypted session key is of a different type/size.\n * This is needed for constant-time processing. Expected object of the form: { sessionKey: Uint8Array, sessionKeyAlgorithm: enums.symmetric }\n * @throws {Error} if decryption failed, unless `randomSessionKey` is given\n * @async\n */\n async decrypt(key, randomSessionKey) {\n // check that session key algo matches the secret key algo\n if (this.publicKeyAlgorithm !== key.algorithm) {\n throw new Error('Decryption error');\n }\n\n const randomPayload = randomSessionKey ? util.concatUint8Array([\n new Uint8Array([randomSessionKey.sessionKeyAlgorithm]),\n randomSessionKey.sessionKey,\n util.writeChecksum(randomSessionKey.sessionKey)\n ]) : null;\n const decoded = await crypto.publicKeyDecrypt(this.publicKeyAlgorithm, key.publicParams, key.privateParams, this.encrypted, key.getFingerprintBytes(), randomPayload);\n const symmetricAlgoByte = decoded[0];\n const sessionKey = decoded.subarray(1, decoded.length - 2);\n const checksum = decoded.subarray(decoded.length - 2);\n const computedChecksum = util.writeChecksum(sessionKey);\n const isValidChecksum = computedChecksum[0] === checksum[0] & computedChecksum[1] === checksum[1];\n\n if (randomSessionKey) {\n // We must not leak info about the validity of the decrypted checksum or cipher algo.\n // The decrypted session key must be of the same algo and size as the random session key, otherwise we discard it and use the random data.\n const isValidPayload = isValidChecksum & symmetricAlgoByte === randomSessionKey.sessionKeyAlgorithm & sessionKey.length === randomSessionKey.sessionKey.length;\n this.sessionKeyAlgorithm = util.selectUint8(isValidPayload, symmetricAlgoByte, randomSessionKey.sessionKeyAlgorithm);\n this.sessionKey = util.selectUint8Array(isValidPayload, sessionKey, randomSessionKey.sessionKey);\n\n } else {\n const isValidPayload = isValidChecksum && enums.read(enums.symmetric, symmetricAlgoByte);\n if (isValidPayload) {\n this.sessionKey = sessionKey;\n this.sessionKeyAlgorithm = symmetricAlgoByte;\n } else {\n throw new Error('Decryption error');\n }\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';\nimport util from '../util';\n\nclass S2K {\n /**\n * @param {Object} [config] - Full configuration, defaults to openpgp.config\n */\n constructor(config = defaultConfig) {\n /**\n * Hash function identifier, or 0 for gnu-dummy keys\n * @type {module:enums.hash | 0}\n */\n this.algorithm = enums.hash.sha256;\n /**\n * enums.s2k identifier or 'gnu-dummy'\n * @type {String}\n */\n this.type = 'iterated';\n /** @type {Integer} */\n this.c = config.s2kIterationCountByte;\n /** Eight bytes of salt in a binary string.\n * @type {Uint8Array}\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 {Uint8Array} 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\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 const arr = [new Uint8Array([enums.write(enums.s2k, this.type), 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\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(this.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 /**\n * Algorithm to encrypt the session key with\n * @type {enums.symmetric}\n */\n this.sessionKeyEncryptionAlgorithm = null;\n /**\n * Algorithm to encrypt the message with\n * @type {enums.symmetric}\n */\n this.sessionKeyAlgorithm = enums.symmetric.aes256;\n /**\n * AEAD mode to encrypt the session key with (if AEAD protection is enabled)\n * @type {enums.aead}\n */\n this.aeadAlgorithm = enums.write(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 = bytes[offset++];\n\n if (this.version === 5) {\n // A one-octet AEAD algorithm.\n this.aeadAlgorithm = 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.getAEADMode(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, algo, this.aeadAlgorithm]), this.s2k.write(), this.iv, this.encrypted]);\n } else {\n bytes = util.concatUint8Array([new Uint8Array([this.version, 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 with the given passphrase\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 { blockSize, keySize } = crypto.getCipher(algo);\n const key = await this.s2k.produceKey(passphrase, keySize);\n\n if (this.version === 5) {\n const mode = crypto.getAEADMode(this.aeadAlgorithm);\n const adata = new Uint8Array([0xC0 | SymEncryptedSessionKeyPacket.tag, this.version, this.sessionKeyEncryptionAlgorithm, 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(blockSize));\n\n this.sessionKeyAlgorithm = enums.write(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 with the given passphrase\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 = crypto.random.getRandomBytes(8);\n\n const { blockSize, keySize } = crypto.getCipher(algo);\n const encryptionKey = await this.s2k.produceKey(passphrase, keySize);\n\n if (this.sessionKey === null) {\n this.sessionKey = crypto.generateSessionKey(this.sessionKeyAlgorithm);\n }\n\n if (this.version === 5) {\n const mode = crypto.getAEADMode(this.aeadAlgorithm);\n this.iv = crypto.random.getRandomBytes(mode.ivLength); // generate new random IV\n const associatedData = new Uint8Array([0xC0 | SymEncryptedSessionKeyPacket.tag, this.version, this.sessionKeyEncryptionAlgorithm, this.aeadAlgorithm]);\n const modeInstance = await mode(algo, encryptionKey);\n this.encrypted = await modeInstance.encrypt(this.sessionKey, this.iv, associatedData);\n } else {\n const toEncrypt = util.concatUint8Array([\n new Uint8Array([this.sessionKeyAlgorithm]),\n this.sessionKey\n ]);\n this.encrypted = await crypto.mode.cfb.encrypt(algo, encryptionKey, toEncrypt, new Uint8Array(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 {enums.publicKey}\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 = bytes[pos++];\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 const { read, publicParams } = crypto.parsePublicKeyParams(this.algorithm, bytes.subarray(pos));\n this.publicParams = publicParams;\n pos += read;\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 arr.push(new Uint8Array([this.algorithm]));\n\n const params = crypto.serializeParams(this.algorithm, 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 = enums.read(enums.publicKey, 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 { blockSize } = crypto.getCipher(sessionKeyAlgorithm);\n const encrypted = await stream.readToEnd(stream.clone(this.encrypted));\n const decrypted = await crypto.mode.cfb.decrypt(sessionKeyAlgorithm, key,\n encrypted.subarray(blockSize + 2),\n encrypted.subarray(2, 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(sessionKeyAlgorithm, key, config = defaultConfig) {\n const data = this.packets.write();\n const { blockSize } = crypto.getCipher(sessionKeyAlgorithm);\n\n const prefix = await crypto.getPrefixRandom(sessionKeyAlgorithm);\n const FRE = await crypto.mode.cfb.encrypt(sessionKeyAlgorithm, key, prefix, new Uint8Array(blockSize), config);\n const ciphertext = await crypto.mode.cfb.encrypt(sessionKeyAlgorithm, 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 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';\nimport { UnsupportedError } from './packet';\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 {enums.symmetric}\n */\n this.s2kUsage = 0;\n /**\n * S2K object\n * @type {type/s2k}\n */\n this.s2k = null;\n /**\n * Symmetric algorithm to encrypt the key with\n * @type {enums.symmetric}\n */\n this.symmetric = null;\n /**\n * AEAD algorithm to encrypt the key with (if AEAD protection is enabled)\n * @type {enums.aead}\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 {Uint8Array} 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\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 }\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 }\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.getCipher(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 { privateParams } = crypto.parsePrivateKeyParams(this.algorithm, cleartext, this.publicParams);\n this.privateParams = privateParams;\n } catch (err) {\n if (err instanceof UnsupportedError) throw err;\n // avoid throwing potentially sensitive errors\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(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(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 this.keyMaterial = crypto.serializeParams(this.algorithm, 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 = enums.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 (!passphrase) {\n throw new Error('A non-empty passphrase is required for key encryption.');\n }\n\n this.s2k = new S2K(config);\n this.s2k.salt = crypto.random.getRandomBytes(8);\n const cleartext = crypto.serializeParams(this.algorithm, this.privateParams);\n this.symmetric = enums.symmetric.aes256;\n const key = await produceEncryptionKey(this.s2k, passphrase, this.symmetric);\n\n const { blockSize } = crypto.getCipher(this.symmetric);\n this.iv = crypto.random.getRandomBytes(blockSize);\n\n if (config.aeadProtect) {\n this.s2kUsage = 253;\n this.aead = enums.aead.eax;\n const mode = crypto.getAEADMode(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.getAEADMode(this.aead);\n const modeInstance = await mode(this.symmetric, key);\n try {\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 { privateParams } = crypto.parsePrivateKeyParams(this.algorithm, 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 let validParams;\n try {\n // this can throw if some parameters are undefined\n validParams = await crypto.validateParams(this.algorithm, 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 { privateParams, publicParams } = await crypto.generateParams(this.algorithm, 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 const { keySize } = crypto.getCipher(algorithm);\n return s2k.produceKey(passphrase, keySize);\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","// 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.write(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.write(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, 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<enums.hash>}\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 enums.publicKey.ecdh:\n case enums.publicKey.ecdsa:\n case enums.publicKey.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 {Array} [notations] - Notation Data to add to the signature, e.g. [{ name: 'test@example.org', value: new TextEncoder().encode('test'), humanReadable: true, critical: false }]\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, notations = [], 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 signaturePacket.rawNotations = notations;\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('Unknown 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 = 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 = 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 const algoInfo = keyPacket.getAlgorithmInfo();\n if (config.rejectPublicKeyAlgorithms.has(keyAlgo)) {\n throw new Error(`${algoInfo.algorithm} keys are considered too weak.`);\n }\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 ${algoInfo.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';\nimport defaultConfig from '../config';\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, 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 = defaultConfig) {\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 /**\n * Revokes the user\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<User>} New user 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 = {\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.revocationSignatures.push(await createSignaturePacket(dataToSign, null, primaryKey, {\n signatureType: enums.signature.certRevocation,\n reasonForRevocationFlag: enums.write(enums.reasonForRevocation, reasonForRevocationFlag),\n reasonForRevocationString\n }, date, undefined, undefined, false, config));\n await user.update(this);\n return user;\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, 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 { UnparseablePacket } from '../packet/packet';\n\n// A key revocation certificate can contain the following packets\nconst allowedRevocationPackets = /*#__PURE__*/ util.constructAllowedPackets([SignaturePacket]);\nconst mainKeyPacketTags = new Set([enums.packet.publicKey, enums.packet.privateKey]);\nconst keyPacketTags = new Set([\n enums.packet.publicKey, enums.packet.privateKey,\n enums.packet.publicSubkey, enums.packet.privateSubkey\n]);\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 let ignoreUntil;\n\n for (const packet of packetlist) {\n\n if (packet instanceof UnparseablePacket) {\n const isUnparseableKeyPacket = keyPacketTags.has(packet.tag);\n if (isUnparseableKeyPacket && !ignoreUntil) {\n // Since non-key packets apply to the preceding key packet, if a (sub)key is Unparseable we must\n // discard all non-key packets that follow, until another (sub)key packet is found.\n if (mainKeyPacketTags.has(packet.tag)) {\n ignoreUntil = mainKeyPacketTags;\n } else {\n ignoreUntil = keyPacketTags;\n }\n }\n continue;\n }\n\n const tag = packet.constructor.tag;\n if (ignoreUntil) {\n if (!ignoreUntil.has(tag)) continue;\n ignoreUntil = null;\n }\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. The copy is shallow, as it references the same packet objects as the original. However, if the top-level API is used, the two key instances are effectively independent.\n * @param {Boolean} [clonePrivateParams=false] Only relevant for private keys: whether the secret key paramenters should be deeply copied. This is needed if e.g. `encrypt()` is to be called either on the clone or the original key.\n * @returns {Promise<Key>} Clone of the key.\n */\n clone(clonePrivateParams = false) {\n const key = new this.constructor(this.toPacketList());\n if (clonePrivateParams) {\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.selfCertification.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","// 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, 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 helper.checkKeyRequirements(keyPacket, config);\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 PublicKey from './public_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 * 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 */\nfunction 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\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, 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 sessionKeyObjects = 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 throw new Error('No encrypted data found');\n }\n\n const symEncryptedPacket = symEncryptedPacketlist[0];\n let exception = null;\n const decryptedPromise = Promise.all(sessionKeyObjects.map(async ({ algorithm: algorithmName, data }) => {\n if (!util.isUint8Array(data) || !util.isString(algorithmName)) {\n throw new Error('Invalid session key for decryption.');\n }\n\n try {\n const algo = enums.write(enums.symmetric, algorithmName);\n await symEncryptedPacket.decrypt(algo, 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 decryptedSessionKeyPackets = [];\n\n let exception;\n if (passwords) {\n const skeskPackets = this.packets.filterByTag(enums.packet.symEncryptedSessionKey);\n if (skeskPackets.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(skeskPackets.write(), allowedSymSessionKeyPackets, config);\n } else {\n packets = skeskPackets;\n }\n await Promise.all(packets.map(async function(skeskPacket) {\n try {\n await skeskPacket.decrypt(password);\n decryptedSessionKeyPackets.push(skeskPacket);\n } catch (err) {\n util.printDebugError(err);\n }\n }));\n }));\n } else if (decryptionKeys) {\n const pkeskPackets = this.packets.filterByTag(enums.packet.publicKeyEncryptedSessionKey);\n if (pkeskPackets.length === 0) {\n throw new Error('No public key encrypted session key packet found.');\n }\n await Promise.all(pkeskPackets.map(async function(pkeskPacket) {\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(pkeskPacket.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\n // To hinder CCA attacks against PKCS1, we carry out a constant-time decryption flow if the `constantTimePKCS1Decryption` config option is set.\n const doConstantTimeDecryption = config.constantTimePKCS1Decryption && (\n pkeskPacket.publicKeyAlgorithm === enums.publicKey.rsaEncrypt ||\n pkeskPacket.publicKeyAlgorithm === enums.publicKey.rsaEncryptSign ||\n pkeskPacket.publicKeyAlgorithm === enums.publicKey.rsaSign ||\n pkeskPacket.publicKeyAlgorithm === enums.publicKey.elgamal\n );\n\n if (doConstantTimeDecryption) {\n // The goal is to not reveal whether PKESK decryption (specifically the PKCS1 decoding step) failed, hence, we always proceed to decrypt the message,\n // either with the successfully decrypted session key, or with a randomly generated one.\n // Since the SEIP/AEAD's symmetric algorithm and key size are stored in the encrypted portion of the PKESK, and the execution flow cannot depend on\n // the decrypted payload, we always assume the message to be encrypted with one of the symmetric algorithms specified in `config.constantTimePKCS1DecryptionSupportedSymmetricAlgorithms`:\n // - If the PKESK decryption succeeds, and the session key cipher is in the supported set, then we try to decrypt the data with the decrypted session key as well as with the\n // randomly generated keys of the remaining key types.\n // - If the PKESK decryptions fails, or if it succeeds but support for the cipher is not enabled, then we discard the session key and try to decrypt the data using only the randomly\n // generated session keys.\n // NB: as a result, if the data is encrypted with a non-suported cipher, decryption will always fail.\n\n const serialisedPKESK = pkeskPacket.write(); // make copies to be able to decrypt the PKESK packet multiple times\n await Promise.all(Array.from(config.constantTimePKCS1DecryptionSupportedSymmetricAlgorithms).map(async sessionKeyAlgorithm => {\n const pkeskPacketCopy = new PublicKeyEncryptedSessionKeyPacket();\n pkeskPacketCopy.read(serialisedPKESK);\n const randomSessionKey = {\n sessionKeyAlgorithm,\n sessionKey: crypto.generateSessionKey(sessionKeyAlgorithm)\n };\n try {\n await pkeskPacketCopy.decrypt(decryptionKeyPacket, randomSessionKey);\n decryptedSessionKeyPackets.push(pkeskPacketCopy);\n } catch (err) {\n // `decrypt` can still throw some non-security-sensitive errors\n util.printDebugError(err);\n exception = err;\n }\n }));\n\n } else {\n try {\n await pkeskPacket.decrypt(decryptionKeyPacket);\n if (!algos.includes(enums.write(enums.symmetric, pkeskPacket.sessionKeyAlgorithm))) {\n throw new Error('A non-preferred symmetric algorithm was used.');\n }\n decryptedSessionKeyPackets.push(pkeskPacket);\n } catch (err) {\n util.printDebugError(err);\n exception = err;\n }\n }\n }));\n }));\n stream.cancel(pkeskPacket.encrypted); // Don't keep copy of encrypted data in memory.\n pkeskPacket.encrypted = null;\n }));\n } else {\n throw new Error('No key or password specified.');\n }\n\n if (decryptedSessionKeyPackets.length > 0) {\n // Return only unique session keys\n if (decryptedSessionKeyPackets.length > 1) {\n const seen = new Set();\n decryptedSessionKeyPackets = decryptedSessionKeyPackets.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 decryptedSessionKeyPackets.map(packet => ({\n data: packet.sessionKey,\n algorithm: enums.read(enums.symmetric, packet.sessionKeyAlgorithm)\n }));\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 algo = await getPreferredAlgo('symmetric', encryptionKeys, date, userIDs, config);\n const algorithmName = enums.read(enums.symmetric, algo);\n const aeadAlgorithmName = 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 = crypto.generateSessionKey(algo);\n return { data: sessionKeyData, algorithm: algorithmName, aeadAlgorithm: aeadAlgorithmName };\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: algorithmName, aeadAlgorithm: aeadAlgorithmName } = sessionKey;\n\n const msg = await Message.encryptSessionKey(sessionKeyData, algorithmName, aeadAlgorithmName, encryptionKeys, passwords, wildcard, encryptionKeyIDs, date, userIDs, config);\n\n let symEncryptedPacket;\n if (aeadAlgorithmName) {\n symEncryptedPacket = new AEADEncryptedDataPacket();\n symEncryptedPacket.aeadAlgorithm = enums.write(enums.aead, aeadAlgorithmName);\n } else {\n symEncryptedPacket = new SymEncryptedIntegrityProtectedDataPacket();\n }\n symEncryptedPacket.packets = this.packets;\n\n const algorithm = enums.write(enums.symmetric, algorithmName);\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} algorithmName - session key algorithm\n * @param {String} [aeadAlgorithmName] - 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, algorithmName, aeadAlgorithmName, encryptionKeys, passwords, wildcard = false, encryptionKeyIDs = [], date = new Date(), userIDs = [], config = defaultConfig) {\n const packetlist = new PacketList();\n const algorithm = enums.write(enums.symmetric, algorithmName);\n const aeadAlgorithm = aeadAlgorithmName && enums.write(enums.aead, aeadAlgorithmName);\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 {Array} [notations] - Notation Data to add to the signatures, e.g. [{ name: 'test@example.org', value: new TextEncoder().encode('test'), humanReadable: true, critical: false }]\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 = [], notations = [], 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, notations, 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 = 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 {Array} [notations] - Notation Data to add to the signatures, e.g. [{ name: 'test@example.org', value: new TextEncoder().encode('test'), humanReadable: true, critical: false }]\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 = [], notations = [], 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, notations, 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 {Array} [notations] - Notation Data to add to the signatures, e.g. [{ name: 'test@example.org', value: new TextEncoder().encode('test'), humanReadable: true, critical: false }]\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 = [], notations = [], 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, notations, 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 try {\n await primaryKey.getSigningKey(unverifiedSigningKey.getKeyID(), signaturePacket.created, undefined, config);\n } catch (e) {\n // If a key was reformatted then the self-signatures of the signing key might be in the future compared to the message signature,\n // making the key invalid at the time of signing.\n // However, if the key is valid at the given `date`, we still allow using it provided the relevant `config` setting is enabled.\n // Note: we do not support the edge case of a key that was reformatted and it has expired.\n if (config.allowInsecureVerificationWithReformattedKeys && e.message.match(/Signature creation time is in the future/)) {\n await primaryKey.getSigningKey(unverifiedSigningKey.getKeyID(), date, undefined, config);\n } else {\n throw e;\n }\n }\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, enums.write(enums.literal, format));\n } else {\n literalDataPacket.setBytes(input, enums.write(enums.literal, 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 // remove trailing whitespace and 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 {Array} [notations] - Notation Data to add to the signatures, e.g. [{ name: 'test@example.org', value: new TextEncoder().encode('test'), humanReadable: true, critical: false }]\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 = [], notations = [], 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, notations, 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 or empty, 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 or empty, 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. If the key was previously used to sign messages, it is recommended\n * to set the same date as the key creation time to ensure that old message signatures will still be verifiable using the reformatted key.\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`, `passwords` or `sessionKeys`\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|Object[]} [options.signatureNotations=[]] - Array of notations to add to the signatures, e.g. `[{ name: 'test@example.org', value: new TextEncoder().encode('test'), humanReadable: true, critical: false }]`\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 = [], signatureNotations = [], 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); signatureNotations = toArray(signatureNotations);\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, signatureNotations, 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|Object[]} [options.signatureNotations=[]] - Array of notations to add to the signatures, e.g. `[{ name: 'test@example.org', value: new TextEncoder().encode('test'), humanReadable: true, critical: false }]`\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 = [], signatureNotations = [], config, ...rest }) {\n config = { ...defaultConfig, ...config }; checkConfig(config);\n checkCleartextOrMessage(message); checkOutputMessageFormat(format);\n signingKeys = toArray(signingKeys); signingKeyIDs = toArray(signingKeyIDs); signingUserIDs = toArray(signingUserIDs); signatureNotations = toArray(signatureNotations);\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, signatureNotations, config);\n } else {\n signature = await message.sign(signingKeys, undefined, signingKeyIDs, date, signingUserIDs, signatureNotations, 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, if any.\n * @param {Object} options\n * @param {PublicKey|PublicKey[]} [options.encryptionKeys] - Array of public keys or single key used to select algorithm preferences for. If no keys are given, the algorithm will be [config.preferredSymmetricAlgorithm]{@link module:config.preferredSymmetricAlgorithm}\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 if ((!encryptionKeys || encryptionKeys.length === 0) && (!passwords || passwords.length === 0)) {\n throw new Error('No encryption keys or passwords provided.');\n }\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","/**\n * web-streams-polyfill v3.0.3\n */\n/// <reference lib=\"es2015.symbol\" />\nconst SymbolPolyfill = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' ?\n Symbol :\n description => `Symbol(${description})`;\n\n/// <reference lib=\"dom\" />\nfunction noop() {\n return undefined;\n}\nfunction getGlobals() {\n if (typeof self !== 'undefined') {\n return self;\n }\n else if (typeof window !== 'undefined') {\n return window;\n }\n else if (typeof global !== 'undefined') {\n return global;\n }\n return undefined;\n}\nconst globals = getGlobals();\n\nfunction typeIsObject(x) {\n return (typeof x === 'object' && x !== null) || typeof x === 'function';\n}\nconst rethrowAssertionErrorRejection = noop;\n\nconst originalPromise = Promise;\nconst originalPromiseThen = Promise.prototype.then;\nconst originalPromiseResolve = Promise.resolve.bind(originalPromise);\nconst originalPromiseReject = Promise.reject.bind(originalPromise);\nfunction newPromise(executor) {\n return new originalPromise(executor);\n}\nfunction promiseResolvedWith(value) {\n return originalPromiseResolve(value);\n}\nfunction promiseRejectedWith(reason) {\n return originalPromiseReject(reason);\n}\nfunction PerformPromiseThen(promise, onFulfilled, onRejected) {\n // There doesn't appear to be any way to correctly emulate the behaviour from JavaScript, so this is just an\n // approximation.\n return originalPromiseThen.call(promise, onFulfilled, onRejected);\n}\nfunction uponPromise(promise, onFulfilled, onRejected) {\n PerformPromiseThen(PerformPromiseThen(promise, onFulfilled, onRejected), undefined, rethrowAssertionErrorRejection);\n}\nfunction uponFulfillment(promise, onFulfilled) {\n uponPromise(promise, onFulfilled);\n}\nfunction uponRejection(promise, onRejected) {\n uponPromise(promise, undefined, onRejected);\n}\nfunction transformPromiseWith(promise, fulfillmentHandler, rejectionHandler) {\n return PerformPromiseThen(promise, fulfillmentHandler, rejectionHandler);\n}\nfunction setPromiseIsHandledToTrue(promise) {\n PerformPromiseThen(promise, undefined, rethrowAssertionErrorRejection);\n}\nconst queueMicrotask = (() => {\n const globalQueueMicrotask = globals && globals.queueMicrotask;\n if (typeof globalQueueMicrotask === 'function') {\n return globalQueueMicrotask;\n }\n const resolvedPromise = promiseResolvedWith(undefined);\n return (fn) => PerformPromiseThen(resolvedPromise, fn);\n})();\nfunction reflectCall(F, V, args) {\n if (typeof F !== 'function') {\n throw new TypeError('Argument is not a function');\n }\n return Function.prototype.apply.call(F, V, args);\n}\nfunction promiseCall(F, V, args) {\n try {\n return promiseResolvedWith(reflectCall(F, V, args));\n }\n catch (value) {\n return promiseRejectedWith(value);\n }\n}\n\n// Original from Chromium\n// https://chromium.googlesource.com/chromium/src/+/0aee4434a4dba42a42abaea9bfbc0cd196a63bc1/third_party/blink/renderer/core/streams/SimpleQueue.js\nconst QUEUE_MAX_ARRAY_SIZE = 16384;\n/**\n * Simple queue structure.\n *\n * Avoids scalability issues with using a packed array directly by using\n * multiple arrays in a linked list and keeping the array size bounded.\n */\nclass SimpleQueue {\n constructor() {\n this._cursor = 0;\n this._size = 0;\n // _front and _back are always defined.\n this._front = {\n _elements: [],\n _next: undefined\n };\n this._back = this._front;\n // The cursor is used to avoid calling Array.shift().\n // It contains the index of the front element of the array inside the\n // front-most node. It is always in the range [0, QUEUE_MAX_ARRAY_SIZE).\n this._cursor = 0;\n // When there is only one node, size === elements.length - cursor.\n this._size = 0;\n }\n get length() {\n return this._size;\n }\n // For exception safety, this method is structured in order:\n // 1. Read state\n // 2. Calculate required state mutations\n // 3. Perform state mutations\n push(element) {\n const oldBack = this._back;\n let newBack = oldBack;\n if (oldBack._elements.length === QUEUE_MAX_ARRAY_SIZE - 1) {\n newBack = {\n _elements: [],\n _next: undefined\n };\n }\n // push() is the mutation most likely to throw an exception, so it\n // goes first.\n oldBack._elements.push(element);\n if (newBack !== oldBack) {\n this._back = newBack;\n oldBack._next = newBack;\n }\n ++this._size;\n }\n // Like push(), shift() follows the read -> calculate -> mutate pattern for\n // exception safety.\n shift() { // must not be called on an empty queue\n const oldFront = this._front;\n let newFront = oldFront;\n const oldCursor = this._cursor;\n let newCursor = oldCursor + 1;\n const elements = oldFront._elements;\n const element = elements[oldCursor];\n if (newCursor === QUEUE_MAX_ARRAY_SIZE) {\n newFront = oldFront._next;\n newCursor = 0;\n }\n // No mutations before this point.\n --this._size;\n this._cursor = newCursor;\n if (oldFront !== newFront) {\n this._front = newFront;\n }\n // Permit shifted element to be garbage collected.\n elements[oldCursor] = undefined;\n return element;\n }\n // The tricky thing about forEach() is that it can be called\n // re-entrantly. The queue may be mutated inside the callback. It is easy to\n // see that push() within the callback has no negative effects since the end\n // of the queue is checked for on every iteration. If shift() is called\n // repeatedly within the callback then the next iteration may return an\n // element that has been removed. In this case the callback will be called\n // with undefined values until we either \"catch up\" with elements that still\n // exist or reach the back of the queue.\n forEach(callback) {\n let i = this._cursor;\n let node = this._front;\n let elements = node._elements;\n while (i !== elements.length || node._next !== undefined) {\n if (i === elements.length) {\n node = node._next;\n elements = node._elements;\n i = 0;\n if (elements.length === 0) {\n break;\n }\n }\n callback(elements[i]);\n ++i;\n }\n }\n // Return the element that would be returned if shift() was called now,\n // without modifying the queue.\n peek() { // must not be called on an empty queue\n const front = this._front;\n const cursor = this._cursor;\n return front._elements[cursor];\n }\n}\n\nfunction ReadableStreamReaderGenericInitialize(reader, stream) {\n reader._ownerReadableStream = stream;\n stream._reader = reader;\n if (stream._state === 'readable') {\n defaultReaderClosedPromiseInitialize(reader);\n }\n else if (stream._state === 'closed') {\n defaultReaderClosedPromiseInitializeAsResolved(reader);\n }\n else {\n defaultReaderClosedPromiseInitializeAsRejected(reader, stream._storedError);\n }\n}\n// A client of ReadableStreamDefaultReader and ReadableStreamBYOBReader may use these functions directly to bypass state\n// check.\nfunction ReadableStreamReaderGenericCancel(reader, reason) {\n const stream = reader._ownerReadableStream;\n return ReadableStreamCancel(stream, reason);\n}\nfunction ReadableStreamReaderGenericRelease(reader) {\n if (reader._ownerReadableStream._state === 'readable') {\n defaultReaderClosedPromiseReject(reader, new TypeError(`Reader was released and can no longer be used to monitor the stream's closedness`));\n }\n else {\n defaultReaderClosedPromiseResetToRejected(reader, new TypeError(`Reader was released and can no longer be used to monitor the stream's closedness`));\n }\n reader._ownerReadableStream._reader = undefined;\n reader._ownerReadableStream = undefined;\n}\n// Helper functions for the readers.\nfunction readerLockException(name) {\n return new TypeError('Cannot ' + name + ' a stream using a released reader');\n}\n// Helper functions for the ReadableStreamDefaultReader.\nfunction defaultReaderClosedPromiseInitialize(reader) {\n reader._closedPromise = newPromise((resolve, reject) => {\n reader._closedPromise_resolve = resolve;\n reader._closedPromise_reject = reject;\n });\n}\nfunction defaultReaderClosedPromiseInitializeAsRejected(reader, reason) {\n defaultReaderClosedPromiseInitialize(reader);\n defaultReaderClosedPromiseReject(reader, reason);\n}\nfunction defaultReaderClosedPromiseInitializeAsResolved(reader) {\n defaultReaderClosedPromiseInitialize(reader);\n defaultReaderClosedPromiseResolve(reader);\n}\nfunction defaultReaderClosedPromiseReject(reader, reason) {\n if (reader._closedPromise_reject === undefined) {\n return;\n }\n setPromiseIsHandledToTrue(reader._closedPromise);\n reader._closedPromise_reject(reason);\n reader._closedPromise_resolve = undefined;\n reader._closedPromise_reject = undefined;\n}\nfunction defaultReaderClosedPromiseResetToRejected(reader, reason) {\n defaultReaderClosedPromiseInitializeAsRejected(reader, reason);\n}\nfunction defaultReaderClosedPromiseResolve(reader) {\n if (reader._closedPromise_resolve === undefined) {\n return;\n }\n reader._closedPromise_resolve(undefined);\n reader._closedPromise_resolve = undefined;\n reader._closedPromise_reject = undefined;\n}\n\nconst AbortSteps = SymbolPolyfill('[[AbortSteps]]');\nconst ErrorSteps = SymbolPolyfill('[[ErrorSteps]]');\nconst CancelSteps = SymbolPolyfill('[[CancelSteps]]');\nconst PullSteps = SymbolPolyfill('[[PullSteps]]');\n\n/// <reference lib=\"es2015.core\" />\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isFinite#Polyfill\nconst NumberIsFinite = Number.isFinite || function (x) {\n return typeof x === 'number' && isFinite(x);\n};\n\n/// <reference lib=\"es2015.core\" />\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/trunc#Polyfill\nconst MathTrunc = Math.trunc || function (v) {\n return v < 0 ? Math.ceil(v) : Math.floor(v);\n};\n\n// https://heycam.github.io/webidl/#idl-dictionaries\nfunction isDictionary(x) {\n return typeof x === 'object' || typeof x === 'function';\n}\nfunction assertDictionary(obj, context) {\n if (obj !== undefined && !isDictionary(obj)) {\n throw new TypeError(`${context} is not an object.`);\n }\n}\n// https://heycam.github.io/webidl/#idl-callback-functions\nfunction assertFunction(x, context) {\n if (typeof x !== 'function') {\n throw new TypeError(`${context} is not a function.`);\n }\n}\n// https://heycam.github.io/webidl/#idl-object\nfunction isObject(x) {\n return (typeof x === 'object' && x !== null) || typeof x === 'function';\n}\nfunction assertObject(x, context) {\n if (!isObject(x)) {\n throw new TypeError(`${context} is not an object.`);\n }\n}\nfunction assertRequiredArgument(x, position, context) {\n if (x === undefined) {\n throw new TypeError(`Parameter ${position} is required in '${context}'.`);\n }\n}\nfunction assertRequiredField(x, field, context) {\n if (x === undefined) {\n throw new TypeError(`${field} is required in '${context}'.`);\n }\n}\n// https://heycam.github.io/webidl/#idl-unrestricted-double\nfunction convertUnrestrictedDouble(value) {\n return Number(value);\n}\nfunction censorNegativeZero(x) {\n return x === 0 ? 0 : x;\n}\nfunction integerPart(x) {\n return censorNegativeZero(MathTrunc(x));\n}\n// https://heycam.github.io/webidl/#idl-unsigned-long-long\nfunction convertUnsignedLongLongWithEnforceRange(value, context) {\n const lowerBound = 0;\n const upperBound = Number.MAX_SAFE_INTEGER;\n let x = Number(value);\n x = censorNegativeZero(x);\n if (!NumberIsFinite(x)) {\n throw new TypeError(`${context} is not a finite number`);\n }\n x = integerPart(x);\n if (x < lowerBound || x > upperBound) {\n throw new TypeError(`${context} is outside the accepted range of ${lowerBound} to ${upperBound}, inclusive`);\n }\n if (!NumberIsFinite(x) || x === 0) {\n return 0;\n }\n // TODO Use BigInt if supported?\n // let xBigInt = BigInt(integerPart(x));\n // xBigInt = BigInt.asUintN(64, xBigInt);\n // return Number(xBigInt);\n return x;\n}\n\nfunction assertReadableStream(x, context) {\n if (!IsReadableStream(x)) {\n throw new TypeError(`${context} is not a ReadableStream.`);\n }\n}\n\n// Abstract operations for the ReadableStream.\nfunction AcquireReadableStreamDefaultReader(stream) {\n return new ReadableStreamDefaultReader(stream);\n}\n// ReadableStream API exposed for controllers.\nfunction ReadableStreamAddReadRequest(stream, readRequest) {\n stream._reader._readRequests.push(readRequest);\n}\nfunction ReadableStreamFulfillReadRequest(stream, chunk, done) {\n const reader = stream._reader;\n const readRequest = reader._readRequests.shift();\n if (done) {\n readRequest._closeSteps();\n }\n else {\n readRequest._chunkSteps(chunk);\n }\n}\nfunction ReadableStreamGetNumReadRequests(stream) {\n return stream._reader._readRequests.length;\n}\nfunction ReadableStreamHasDefaultReader(stream) {\n const reader = stream._reader;\n if (reader === undefined) {\n return false;\n }\n if (!IsReadableStreamDefaultReader(reader)) {\n return false;\n }\n return true;\n}\n/**\n * A default reader vended by a {@link ReadableStream}.\n *\n * @public\n */\nclass ReadableStreamDefaultReader {\n constructor(stream) {\n assertRequiredArgument(stream, 1, 'ReadableStreamDefaultReader');\n assertReadableStream(stream, 'First parameter');\n if (IsReadableStreamLocked(stream)) {\n throw new TypeError('This stream has already been locked for exclusive reading by another reader');\n }\n ReadableStreamReaderGenericInitialize(this, stream);\n this._readRequests = new SimpleQueue();\n }\n /**\n * Returns a promise that will be fulfilled when the stream becomes closed,\n * or rejected if the stream ever errors or the reader's lock is released before the stream finishes closing.\n */\n get closed() {\n if (!IsReadableStreamDefaultReader(this)) {\n return promiseRejectedWith(defaultReaderBrandCheckException('closed'));\n }\n return this._closedPromise;\n }\n /**\n * If the reader is active, behaves the same as {@link ReadableStream.cancel | stream.cancel(reason)}.\n */\n cancel(reason = undefined) {\n if (!IsReadableStreamDefaultReader(this)) {\n return promiseRejectedWith(defaultReaderBrandCheckException('cancel'));\n }\n if (this._ownerReadableStream === undefined) {\n return promiseRejectedWith(readerLockException('cancel'));\n }\n return ReadableStreamReaderGenericCancel(this, reason);\n }\n /**\n * Returns a promise that allows access to the next chunk from the stream's internal queue, if available.\n *\n * If reading a chunk causes the queue to become empty, more data will be pulled from the underlying source.\n */\n read() {\n if (!IsReadableStreamDefaultReader(this)) {\n return promiseRejectedWith(defaultReaderBrandCheckException('read'));\n }\n if (this._ownerReadableStream === undefined) {\n return promiseRejectedWith(readerLockException('read from'));\n }\n let resolvePromise;\n let rejectPromise;\n const promise = newPromise((resolve, reject) => {\n resolvePromise = resolve;\n rejectPromise = reject;\n });\n const readRequest = {\n _chunkSteps: chunk => resolvePromise({ value: chunk, done: false }),\n _closeSteps: () => resolvePromise({ value: undefined, done: true }),\n _errorSteps: e => rejectPromise(e)\n };\n ReadableStreamDefaultReaderRead(this, readRequest);\n return promise;\n }\n /**\n * Releases the reader's lock on the corresponding stream. After the lock is released, the reader is no longer active.\n * If the associated stream is errored when the lock is released, the reader will appear errored in the same way\n * from now on; otherwise, the reader will appear closed.\n *\n * A reader's lock cannot be released while it still has a pending read request, i.e., if a promise returned by\n * the reader's {@link ReadableStreamDefaultReader.read | read()} method has not yet been settled. Attempting to\n * do so will throw a `TypeError` and leave the reader locked to the stream.\n */\n releaseLock() {\n if (!IsReadableStreamDefaultReader(this)) {\n throw defaultReaderBrandCheckException('releaseLock');\n }\n if (this._ownerReadableStream === undefined) {\n return;\n }\n if (this._readRequests.length > 0) {\n throw new TypeError('Tried to release a reader lock when that reader has pending read() calls un-settled');\n }\n ReadableStreamReaderGenericRelease(this);\n }\n}\nObject.defineProperties(ReadableStreamDefaultReader.prototype, {\n cancel: { enumerable: true },\n read: { enumerable: true },\n releaseLock: { enumerable: true },\n closed: { enumerable: true }\n});\nif (typeof SymbolPolyfill.toStringTag === 'symbol') {\n Object.defineProperty(ReadableStreamDefaultReader.prototype, SymbolPolyfill.toStringTag, {\n value: 'ReadableStreamDefaultReader',\n configurable: true\n });\n}\n// Abstract operations for the readers.\nfunction IsReadableStreamDefaultReader(x) {\n if (!typeIsObject(x)) {\n return false;\n }\n if (!Object.prototype.hasOwnProperty.call(x, '_readRequests')) {\n return false;\n }\n return true;\n}\nfunction ReadableStreamDefaultReaderRead(reader, readRequest) {\n const stream = reader._ownerReadableStream;\n stream._disturbed = true;\n if (stream._state === 'closed') {\n readRequest._closeSteps();\n }\n else if (stream._state === 'errored') {\n readRequest._errorSteps(stream._storedError);\n }\n else {\n stream._readableStreamController[PullSteps](readRequest);\n }\n}\n// Helper functions for the ReadableStreamDefaultReader.\nfunction defaultReaderBrandCheckException(name) {\n return new TypeError(`ReadableStreamDefaultReader.prototype.${name} can only be used on a ReadableStreamDefaultReader`);\n}\n\n/// <reference lib=\"es2018.asynciterable\" />\nlet AsyncIteratorPrototype;\nif (typeof SymbolPolyfill.asyncIterator === 'symbol') {\n // We're running inside a ES2018+ environment, but we're compiling to an older syntax.\n // We cannot access %AsyncIteratorPrototype% without non-ES2018 syntax, but we can re-create it.\n AsyncIteratorPrototype = {\n // 25.1.3.1 %AsyncIteratorPrototype% [ @@asyncIterator ] ( )\n // https://tc39.github.io/ecma262/#sec-asynciteratorprototype-asynciterator\n [SymbolPolyfill.asyncIterator]() {\n return this;\n }\n };\n Object.defineProperty(AsyncIteratorPrototype, SymbolPolyfill.asyncIterator, { enumerable: false });\n}\n\n/// <reference lib=\"es2018.asynciterable\" />\nclass ReadableStreamAsyncIteratorImpl {\n constructor(reader, preventCancel) {\n this._ongoingPromise = undefined;\n this._isFinished = false;\n this._reader = reader;\n this._preventCancel = preventCancel;\n }\n next() {\n const nextSteps = () => this._nextSteps();\n this._ongoingPromise = this._ongoingPromise ?\n transformPromiseWith(this._ongoingPromise, nextSteps, nextSteps) :\n nextSteps();\n return this._ongoingPromise;\n }\n return(value) {\n const returnSteps = () => this._returnSteps(value);\n return this._ongoingPromise ?\n transformPromiseWith(this._ongoingPromise, returnSteps, returnSteps) :\n returnSteps();\n }\n _nextSteps() {\n if (this._isFinished) {\n return Promise.resolve({ value: undefined, done: true });\n }\n const reader = this._reader;\n if (reader._ownerReadableStream === undefined) {\n return promiseRejectedWith(readerLockException('iterate'));\n }\n let resolvePromise;\n let rejectPromise;\n const promise = newPromise((resolve, reject) => {\n resolvePromise = resolve;\n rejectPromise = reject;\n });\n const readRequest = {\n _chunkSteps: chunk => {\n this._ongoingPromise = undefined;\n // This needs to be delayed by one microtask, otherwise we stop pulling too early which breaks a test.\n // FIXME Is this a bug in the specification, or in the test?\n queueMicrotask(() => resolvePromise({ value: chunk, done: false }));\n },\n _closeSteps: () => {\n this._ongoingPromise = undefined;\n this._isFinished = true;\n ReadableStreamReaderGenericRelease(reader);\n resolvePromise({ value: undefined, done: true });\n },\n _errorSteps: reason => {\n this._ongoingPromise = undefined;\n this._isFinished = true;\n ReadableStreamReaderGenericRelease(reader);\n rejectPromise(reason);\n }\n };\n ReadableStreamDefaultReaderRead(reader, readRequest);\n return promise;\n }\n _returnSteps(value) {\n if (this._isFinished) {\n return Promise.resolve({ value, done: true });\n }\n this._isFinished = true;\n const reader = this._reader;\n if (reader._ownerReadableStream === undefined) {\n return promiseRejectedWith(readerLockException('finish iterating'));\n }\n if (!this._preventCancel) {\n const result = ReadableStreamReaderGenericCancel(reader, value);\n ReadableStreamReaderGenericRelease(reader);\n return transformPromiseWith(result, () => ({ value, done: true }));\n }\n ReadableStreamReaderGenericRelease(reader);\n return promiseResolvedWith({ value, done: true });\n }\n}\nconst ReadableStreamAsyncIteratorPrototype = {\n next() {\n if (!IsReadableStreamAsyncIterator(this)) {\n return promiseRejectedWith(streamAsyncIteratorBrandCheckException('next'));\n }\n return this._asyncIteratorImpl.next();\n },\n return(value) {\n if (!IsReadableStreamAsyncIterator(this)) {\n return promiseRejectedWith(streamAsyncIteratorBrandCheckException('return'));\n }\n return this._asyncIteratorImpl.return(value);\n }\n};\nif (AsyncIteratorPrototype !== undefined) {\n Object.setPrototypeOf(ReadableStreamAsyncIteratorPrototype, AsyncIteratorPrototype);\n}\n// Abstract operations for the ReadableStream.\nfunction AcquireReadableStreamAsyncIterator(stream, preventCancel) {\n const reader = AcquireReadableStreamDefaultReader(stream);\n const impl = new ReadableStreamAsyncIteratorImpl(reader, preventCancel);\n const iterator = Object.create(ReadableStreamAsyncIteratorPrototype);\n iterator._asyncIteratorImpl = impl;\n return iterator;\n}\nfunction IsReadableStreamAsyncIterator(x) {\n if (!typeIsObject(x)) {\n return false;\n }\n if (!Object.prototype.hasOwnProperty.call(x, '_asyncIteratorImpl')) {\n return false;\n }\n return true;\n}\n// Helper functions for the ReadableStream.\nfunction streamAsyncIteratorBrandCheckException(name) {\n return new TypeError(`ReadableStreamAsyncIterator.${name} can only be used on a ReadableSteamAsyncIterator`);\n}\n\n/// <reference lib=\"es2015.core\" />\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isNaN#Polyfill\nconst NumberIsNaN = Number.isNaN || function (x) {\n // eslint-disable-next-line no-self-compare\n return x !== x;\n};\n\nfunction IsFiniteNonNegativeNumber(v) {\n if (!IsNonNegativeNumber(v)) {\n return false;\n }\n if (v === Infinity) {\n return false;\n }\n return true;\n}\nfunction IsNonNegativeNumber(v) {\n if (typeof v !== 'number') {\n return false;\n }\n if (NumberIsNaN(v)) {\n return false;\n }\n if (v < 0) {\n return false;\n }\n return true;\n}\n\nfunction DequeueValue(container) {\n const pair = container._queue.shift();\n container._queueTotalSize -= pair.size;\n if (container._queueTotalSize < 0) {\n container._queueTotalSize = 0;\n }\n return pair.value;\n}\nfunction EnqueueValueWithSize(container, value, size) {\n size = Number(size);\n if (!IsFiniteNonNegativeNumber(size)) {\n throw new RangeError('Size must be a finite, non-NaN, non-negative number.');\n }\n container._queue.push({ value, size });\n container._queueTotalSize += size;\n}\nfunction PeekQueueValue(container) {\n const pair = container._queue.peek();\n return pair.value;\n}\nfunction ResetQueue(container) {\n container._queue = new SimpleQueue();\n container._queueTotalSize = 0;\n}\n\nfunction CreateArrayFromList(elements) {\n // We use arrays to represent lists, so this is basically a no-op.\n // Do a slice though just in case we happen to depend on the unique-ness.\n return elements.slice();\n}\nfunction CopyDataBlockBytes(dest, destOffset, src, srcOffset, n) {\n new Uint8Array(dest).set(new Uint8Array(src, srcOffset, n), destOffset);\n}\n// Not implemented correctly\nfunction TransferArrayBuffer(O) {\n return O;\n}\n// Not implemented correctly\nfunction IsDetachedBuffer(O) {\n return false;\n}\n\n/**\n * A pull-into request in a {@link ReadableByteStreamController}.\n *\n * @public\n */\nclass ReadableStreamBYOBRequest {\n constructor() {\n throw new TypeError('Illegal constructor');\n }\n /**\n * Returns the view for writing in to, or `null` if the BYOB request has already been responded to.\n */\n get view() {\n if (!IsReadableStreamBYOBRequest(this)) {\n throw byobRequestBrandCheckException('view');\n }\n return this._view;\n }\n respond(bytesWritten) {\n if (!IsReadableStreamBYOBRequest(this)) {\n throw byobRequestBrandCheckException('respond');\n }\n assertRequiredArgument(bytesWritten, 1, 'respond');\n bytesWritten = convertUnsignedLongLongWithEnforceRange(bytesWritten, 'First parameter');\n if (this._associatedReadableByteStreamController === undefined) {\n throw new TypeError('This BYOB request has been invalidated');\n }\n if (IsDetachedBuffer(this._view.buffer)) ;\n ReadableByteStreamControllerRespond(this._associatedReadableByteStreamController, bytesWritten);\n }\n respondWithNewView(view) {\n if (!IsReadableStreamBYOBRequest(this)) {\n throw byobRequestBrandCheckException('respondWithNewView');\n }\n assertRequiredArgument(view, 1, 'respondWithNewView');\n if (!ArrayBuffer.isView(view)) {\n throw new TypeError('You can only respond with array buffer views');\n }\n if (view.byteLength === 0) {\n throw new TypeError('chunk must have non-zero byteLength');\n }\n if (view.buffer.byteLength === 0) {\n throw new TypeError(`chunk's buffer must have non-zero byteLength`);\n }\n if (this._associatedReadableByteStreamController === undefined) {\n throw new TypeError('This BYOB request has been invalidated');\n }\n ReadableByteStreamControllerRespondWithNewView(this._associatedReadableByteStreamController, view);\n }\n}\nObject.defineProperties(ReadableStreamBYOBRequest.prototype, {\n respond: { enumerable: true },\n respondWithNewView: { enumerable: true },\n view: { enumerable: true }\n});\nif (typeof SymbolPolyfill.toStringTag === 'symbol') {\n Object.defineProperty(ReadableStreamBYOBRequest.prototype, SymbolPolyfill.toStringTag, {\n value: 'ReadableStreamBYOBRequest',\n configurable: true\n });\n}\n/**\n * Allows control of a {@link ReadableStream | readable byte stream}'s state and internal queue.\n *\n * @public\n */\nclass ReadableByteStreamController {\n constructor() {\n throw new TypeError('Illegal constructor');\n }\n /**\n * Returns the current BYOB pull request, or `null` if there isn't one.\n */\n get byobRequest() {\n if (!IsReadableByteStreamController(this)) {\n throw byteStreamControllerBrandCheckException('byobRequest');\n }\n if (this._byobRequest === null && this._pendingPullIntos.length > 0) {\n const firstDescriptor = this._pendingPullIntos.peek();\n const view = new Uint8Array(firstDescriptor.buffer, firstDescriptor.byteOffset + firstDescriptor.bytesFilled, firstDescriptor.byteLength - firstDescriptor.bytesFilled);\n const byobRequest = Object.create(ReadableStreamBYOBRequest.prototype);\n SetUpReadableStreamBYOBRequest(byobRequest, this, view);\n this._byobRequest = byobRequest;\n }\n return this._byobRequest;\n }\n /**\n * Returns the desired size to fill the controlled stream's internal queue. It can be negative, if the queue is\n * over-full. An underlying byte source ought to use this information to determine when and how to apply backpressure.\n */\n get desiredSize() {\n if (!IsReadableByteStreamController(this)) {\n throw byteStreamControllerBrandCheckException('desiredSize');\n }\n return ReadableByteStreamControllerGetDesiredSize(this);\n }\n /**\n * Closes the controlled readable stream. Consumers will still be able to read any previously-enqueued chunks from\n * the stream, but once those are read, the stream will become closed.\n */\n close() {\n if (!IsReadableByteStreamController(this)) {\n throw byteStreamControllerBrandCheckException('close');\n }\n if (this._closeRequested) {\n throw new TypeError('The stream has already been closed; do not close it again!');\n }\n const state = this._controlledReadableByteStream._state;\n if (state !== 'readable') {\n throw new TypeError(`The stream (in ${state} state) is not in the readable state and cannot be closed`);\n }\n ReadableByteStreamControllerClose(this);\n }\n enqueue(chunk) {\n if (!IsReadableByteStreamController(this)) {\n throw byteStreamControllerBrandCheckException('enqueue');\n }\n assertRequiredArgument(chunk, 1, 'enqueue');\n if (!ArrayBuffer.isView(chunk)) {\n throw new TypeError('chunk must be an array buffer view');\n }\n if (chunk.byteLength === 0) {\n throw new TypeError('chunk must have non-zero byteLength');\n }\n if (chunk.buffer.byteLength === 0) {\n throw new TypeError(`chunk's buffer must have non-zero byteLength`);\n }\n if (this._closeRequested) {\n throw new TypeError('stream is closed or draining');\n }\n const state = this._controlledReadableByteStream._state;\n if (state !== 'readable') {\n throw new TypeError(`The stream (in ${state} state) is not in the readable state and cannot be enqueued to`);\n }\n ReadableByteStreamControllerEnqueue(this, chunk);\n }\n /**\n * Errors the controlled readable stream, making all future interactions with it fail with the given error `e`.\n */\n error(e = undefined) {\n if (!IsReadableByteStreamController(this)) {\n throw byteStreamControllerBrandCheckException('error');\n }\n ReadableByteStreamControllerError(this, e);\n }\n /** @internal */\n [CancelSteps](reason) {\n if (this._pendingPullIntos.length > 0) {\n const firstDescriptor = this._pendingPullIntos.peek();\n firstDescriptor.bytesFilled = 0;\n }\n ResetQueue(this);\n const result = this._cancelAlgorithm(reason);\n ReadableByteStreamControllerClearAlgorithms(this);\n return result;\n }\n /** @internal */\n [PullSteps](readRequest) {\n const stream = this._controlledReadableByteStream;\n if (this._queueTotalSize > 0) {\n const entry = this._queue.shift();\n this._queueTotalSize -= entry.byteLength;\n ReadableByteStreamControllerHandleQueueDrain(this);\n const view = new Uint8Array(entry.buffer, entry.byteOffset, entry.byteLength);\n readRequest._chunkSteps(view);\n return;\n }\n const autoAllocateChunkSize = this._autoAllocateChunkSize;\n if (autoAllocateChunkSize !== undefined) {\n let buffer;\n try {\n buffer = new ArrayBuffer(autoAllocateChunkSize);\n }\n catch (bufferE) {\n readRequest._errorSteps(bufferE);\n return;\n }\n const pullIntoDescriptor = {\n buffer,\n byteOffset: 0,\n byteLength: autoAllocateChunkSize,\n bytesFilled: 0,\n elementSize: 1,\n viewConstructor: Uint8Array,\n readerType: 'default'\n };\n this._pendingPullIntos.push(pullIntoDescriptor);\n }\n ReadableStreamAddReadRequest(stream, readRequest);\n ReadableByteStreamControllerCallPullIfNeeded(this);\n }\n}\nObject.defineProperties(ReadableByteStreamController.prototype, {\n close: { enumerable: true },\n enqueue: { enumerable: true },\n error: { enumerable: true },\n byobRequest: { enumerable: true },\n desiredSize: { enumerable: true }\n});\nif (typeof SymbolPolyfill.toStringTag === 'symbol') {\n Object.defineProperty(ReadableByteStreamController.prototype, SymbolPolyfill.toStringTag, {\n value: 'ReadableByteStreamController',\n configurable: true\n });\n}\n// Abstract operations for the ReadableByteStreamController.\nfunction IsReadableByteStreamController(x) {\n if (!typeIsObject(x)) {\n return false;\n }\n if (!Object.prototype.hasOwnProperty.call(x, '_controlledReadableByteStream')) {\n return false;\n }\n return true;\n}\nfunction IsReadableStreamBYOBRequest(x) {\n if (!typeIsObject(x)) {\n return false;\n }\n if (!Object.prototype.hasOwnProperty.call(x, '_associatedReadableByteStreamController')) {\n return false;\n }\n return true;\n}\nfunction ReadableByteStreamControllerCallPullIfNeeded(controller) {\n const shouldPull = ReadableByteStreamControllerShouldCallPull(controller);\n if (!shouldPull) {\n return;\n }\n if (controller._pulling) {\n controller._pullAgain = true;\n return;\n }\n controller._pulling = true;\n // TODO: Test controller argument\n const pullPromise = controller._pullAlgorithm();\n uponPromise(pullPromise, () => {\n controller._pulling = false;\n if (controller._pullAgain) {\n controller._pullAgain = false;\n ReadableByteStreamControllerCallPullIfNeeded(controller);\n }\n }, e => {\n ReadableByteStreamControllerError(controller, e);\n });\n}\nfunction ReadableByteStreamControllerClearPendingPullIntos(controller) {\n ReadableByteStreamControllerInvalidateBYOBRequest(controller);\n controller._pendingPullIntos = new SimpleQueue();\n}\nfunction ReadableByteStreamControllerCommitPullIntoDescriptor(stream, pullIntoDescriptor) {\n let done = false;\n if (stream._state === 'closed') {\n done = true;\n }\n const filledView = ReadableByteStreamControllerConvertPullIntoDescriptor(pullIntoDescriptor);\n if (pullIntoDescriptor.readerType === 'default') {\n ReadableStreamFulfillReadRequest(stream, filledView, done);\n }\n else {\n ReadableStreamFulfillReadIntoRequest(stream, filledView, done);\n }\n}\nfunction ReadableByteStreamControllerConvertPullIntoDescriptor(pullIntoDescriptor) {\n const bytesFilled = pullIntoDescriptor.bytesFilled;\n const elementSize = pullIntoDescriptor.elementSize;\n return new pullIntoDescriptor.viewConstructor(pullIntoDescriptor.buffer, pullIntoDescriptor.byteOffset, bytesFilled / elementSize);\n}\nfunction ReadableByteStreamControllerEnqueueChunkToQueue(controller, buffer, byteOffset, byteLength) {\n controller._queue.push({ buffer, byteOffset, byteLength });\n controller._queueTotalSize += byteLength;\n}\nfunction ReadableByteStreamControllerFillPullIntoDescriptorFromQueue(controller, pullIntoDescriptor) {\n const elementSize = pullIntoDescriptor.elementSize;\n const currentAlignedBytes = pullIntoDescriptor.bytesFilled - pullIntoDescriptor.bytesFilled % elementSize;\n const maxBytesToCopy = Math.min(controller._queueTotalSize, pullIntoDescriptor.byteLength - pullIntoDescriptor.bytesFilled);\n const maxBytesFilled = pullIntoDescriptor.bytesFilled + maxBytesToCopy;\n const maxAlignedBytes = maxBytesFilled - maxBytesFilled % elementSize;\n let totalBytesToCopyRemaining = maxBytesToCopy;\n let ready = false;\n if (maxAlignedBytes > currentAlignedBytes) {\n totalBytesToCopyRemaining = maxAlignedBytes - pullIntoDescriptor.bytesFilled;\n ready = true;\n }\n const queue = controller._queue;\n while (totalBytesToCopyRemaining > 0) {\n const headOfQueue = queue.peek();\n const bytesToCopy = Math.min(totalBytesToCopyRemaining, headOfQueue.byteLength);\n const destStart = pullIntoDescriptor.byteOffset + pullIntoDescriptor.bytesFilled;\n CopyDataBlockBytes(pullIntoDescriptor.buffer, destStart, headOfQueue.buffer, headOfQueue.byteOffset, bytesToCopy);\n if (headOfQueue.byteLength === bytesToCopy) {\n queue.shift();\n }\n else {\n headOfQueue.byteOffset += bytesToCopy;\n headOfQueue.byteLength -= bytesToCopy;\n }\n controller._queueTotalSize -= bytesToCopy;\n ReadableByteStreamControllerFillHeadPullIntoDescriptor(controller, bytesToCopy, pullIntoDescriptor);\n totalBytesToCopyRemaining -= bytesToCopy;\n }\n return ready;\n}\nfunction ReadableByteStreamControllerFillHeadPullIntoDescriptor(controller, size, pullIntoDescriptor) {\n ReadableByteStreamControllerInvalidateBYOBRequest(controller);\n pullIntoDescriptor.bytesFilled += size;\n}\nfunction ReadableByteStreamControllerHandleQueueDrain(controller) {\n if (controller._queueTotalSize === 0 && controller._closeRequested) {\n ReadableByteStreamControllerClearAlgorithms(controller);\n ReadableStreamClose(controller._controlledReadableByteStream);\n }\n else {\n ReadableByteStreamControllerCallPullIfNeeded(controller);\n }\n}\nfunction ReadableByteStreamControllerInvalidateBYOBRequest(controller) {\n if (controller._byobRequest === null) {\n return;\n }\n controller._byobRequest._associatedReadableByteStreamController = undefined;\n controller._byobRequest._view = null;\n controller._byobRequest = null;\n}\nfunction ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(controller) {\n while (controller._pendingPullIntos.length > 0) {\n if (controller._queueTotalSize === 0) {\n return;\n }\n const pullIntoDescriptor = controller._pendingPullIntos.peek();\n if (ReadableByteStreamControllerFillPullIntoDescriptorFromQueue(controller, pullIntoDescriptor)) {\n ReadableByteStreamControllerShiftPendingPullInto(controller);\n ReadableByteStreamControllerCommitPullIntoDescriptor(controller._controlledReadableByteStream, pullIntoDescriptor);\n }\n }\n}\nfunction ReadableByteStreamControllerPullInto(controller, view, readIntoRequest) {\n const stream = controller._controlledReadableByteStream;\n let elementSize = 1;\n if (view.constructor !== DataView) {\n elementSize = view.constructor.BYTES_PER_ELEMENT;\n }\n const ctor = view.constructor;\n const buffer = TransferArrayBuffer(view.buffer);\n const pullIntoDescriptor = {\n buffer,\n byteOffset: view.byteOffset,\n byteLength: view.byteLength,\n bytesFilled: 0,\n elementSize,\n viewConstructor: ctor,\n readerType: 'byob'\n };\n if (controller._pendingPullIntos.length > 0) {\n controller._pendingPullIntos.push(pullIntoDescriptor);\n // No ReadableByteStreamControllerCallPullIfNeeded() call since:\n // - No change happens on desiredSize\n // - The source has already been notified of that there's at least 1 pending read(view)\n ReadableStreamAddReadIntoRequest(stream, readIntoRequest);\n return;\n }\n if (stream._state === 'closed') {\n const emptyView = new ctor(pullIntoDescriptor.buffer, pullIntoDescriptor.byteOffset, 0);\n readIntoRequest._closeSteps(emptyView);\n return;\n }\n if (controller._queueTotalSize > 0) {\n if (ReadableByteStreamControllerFillPullIntoDescriptorFromQueue(controller, pullIntoDescriptor)) {\n const filledView = ReadableByteStreamControllerConvertPullIntoDescriptor(pullIntoDescriptor);\n ReadableByteStreamControllerHandleQueueDrain(controller);\n readIntoRequest._chunkSteps(filledView);\n return;\n }\n if (controller._closeRequested) {\n const e = new TypeError('Insufficient bytes to fill elements in the given buffer');\n ReadableByteStreamControllerError(controller, e);\n readIntoRequest._errorSteps(e);\n return;\n }\n }\n controller._pendingPullIntos.push(pullIntoDescriptor);\n ReadableStreamAddReadIntoRequest(stream, readIntoRequest);\n ReadableByteStreamControllerCallPullIfNeeded(controller);\n}\nfunction ReadableByteStreamControllerRespondInClosedState(controller, firstDescriptor) {\n firstDescriptor.buffer = TransferArrayBuffer(firstDescriptor.buffer);\n const stream = controller._controlledReadableByteStream;\n if (ReadableStreamHasBYOBReader(stream)) {\n while (ReadableStreamGetNumReadIntoRequests(stream) > 0) {\n const pullIntoDescriptor = ReadableByteStreamControllerShiftPendingPullInto(controller);\n ReadableByteStreamControllerCommitPullIntoDescriptor(stream, pullIntoDescriptor);\n }\n }\n}\nfunction ReadableByteStreamControllerRespondInReadableState(controller, bytesWritten, pullIntoDescriptor) {\n if (pullIntoDescriptor.bytesFilled + bytesWritten > pullIntoDescriptor.byteLength) {\n throw new RangeError('bytesWritten out of range');\n }\n ReadableByteStreamControllerFillHeadPullIntoDescriptor(controller, bytesWritten, pullIntoDescriptor);\n if (pullIntoDescriptor.bytesFilled < pullIntoDescriptor.elementSize) {\n // TODO: Figure out whether we should detach the buffer or not here.\n return;\n }\n ReadableByteStreamControllerShiftPendingPullInto(controller);\n const remainderSize = pullIntoDescriptor.bytesFilled % pullIntoDescriptor.elementSize;\n if (remainderSize > 0) {\n const end = pullIntoDescriptor.byteOffset + pullIntoDescriptor.bytesFilled;\n const remainder = pullIntoDescriptor.buffer.slice(end - remainderSize, end);\n ReadableByteStreamControllerEnqueueChunkToQueue(controller, remainder, 0, remainder.byteLength);\n }\n pullIntoDescriptor.buffer = TransferArrayBuffer(pullIntoDescriptor.buffer);\n pullIntoDescriptor.bytesFilled -= remainderSize;\n ReadableByteStreamControllerCommitPullIntoDescriptor(controller._controlledReadableByteStream, pullIntoDescriptor);\n ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(controller);\n}\nfunction ReadableByteStreamControllerRespondInternal(controller, bytesWritten) {\n const firstDescriptor = controller._pendingPullIntos.peek();\n const state = controller._controlledReadableByteStream._state;\n if (state === 'closed') {\n if (bytesWritten !== 0) {\n throw new TypeError('bytesWritten must be 0 when calling respond() on a closed stream');\n }\n ReadableByteStreamControllerRespondInClosedState(controller, firstDescriptor);\n }\n else {\n ReadableByteStreamControllerRespondInReadableState(controller, bytesWritten, firstDescriptor);\n }\n ReadableByteStreamControllerCallPullIfNeeded(controller);\n}\nfunction ReadableByteStreamControllerShiftPendingPullInto(controller) {\n const descriptor = controller._pendingPullIntos.shift();\n ReadableByteStreamControllerInvalidateBYOBRequest(controller);\n return descriptor;\n}\nfunction ReadableByteStreamControllerShouldCallPull(controller) {\n const stream = controller._controlledReadableByteStream;\n if (stream._state !== 'readable') {\n return false;\n }\n if (controller._closeRequested) {\n return false;\n }\n if (!controller._started) {\n return false;\n }\n if (ReadableStreamHasDefaultReader(stream) && ReadableStreamGetNumReadRequests(stream) > 0) {\n return true;\n }\n if (ReadableStreamHasBYOBReader(stream) && ReadableStreamGetNumReadIntoRequests(stream) > 0) {\n return true;\n }\n const desiredSize = ReadableByteStreamControllerGetDesiredSize(controller);\n if (desiredSize > 0) {\n return true;\n }\n return false;\n}\nfunction ReadableByteStreamControllerClearAlgorithms(controller) {\n controller._pullAlgorithm = undefined;\n controller._cancelAlgorithm = undefined;\n}\n// A client of ReadableByteStreamController may use these functions directly to bypass state check.\nfunction ReadableByteStreamControllerClose(controller) {\n const stream = controller._controlledReadableByteStream;\n if (controller._closeRequested || stream._state !== 'readable') {\n return;\n }\n if (controller._queueTotalSize > 0) {\n controller._closeRequested = true;\n return;\n }\n if (controller._pendingPullIntos.length > 0) {\n const firstPendingPullInto = controller._pendingPullIntos.peek();\n if (firstPendingPullInto.bytesFilled > 0) {\n const e = new TypeError('Insufficient bytes to fill elements in the given buffer');\n ReadableByteStreamControllerError(controller, e);\n throw e;\n }\n }\n ReadableByteStreamControllerClearAlgorithms(controller);\n ReadableStreamClose(stream);\n}\nfunction ReadableByteStreamControllerEnqueue(controller, chunk) {\n const stream = controller._controlledReadableByteStream;\n if (controller._closeRequested || stream._state !== 'readable') {\n return;\n }\n const buffer = chunk.buffer;\n const byteOffset = chunk.byteOffset;\n const byteLength = chunk.byteLength;\n const transferredBuffer = TransferArrayBuffer(buffer);\n if (ReadableStreamHasDefaultReader(stream)) {\n if (ReadableStreamGetNumReadRequests(stream) === 0) {\n ReadableByteStreamControllerEnqueueChunkToQueue(controller, transferredBuffer, byteOffset, byteLength);\n }\n else {\n const transferredView = new Uint8Array(transferredBuffer, byteOffset, byteLength);\n ReadableStreamFulfillReadRequest(stream, transferredView, false);\n }\n }\n else if (ReadableStreamHasBYOBReader(stream)) {\n // TODO: Ideally in this branch detaching should happen only if the buffer is not consumed fully.\n ReadableByteStreamControllerEnqueueChunkToQueue(controller, transferredBuffer, byteOffset, byteLength);\n ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(controller);\n }\n else {\n ReadableByteStreamControllerEnqueueChunkToQueue(controller, transferredBuffer, byteOffset, byteLength);\n }\n ReadableByteStreamControllerCallPullIfNeeded(controller);\n}\nfunction ReadableByteStreamControllerError(controller, e) {\n const stream = controller._controlledReadableByteStream;\n if (stream._state !== 'readable') {\n return;\n }\n ReadableByteStreamControllerClearPendingPullIntos(controller);\n ResetQueue(controller);\n ReadableByteStreamControllerClearAlgorithms(controller);\n ReadableStreamError(stream, e);\n}\nfunction ReadableByteStreamControllerGetDesiredSize(controller) {\n const state = controller._controlledReadableByteStream._state;\n if (state === 'errored') {\n return null;\n }\n if (state === 'closed') {\n return 0;\n }\n return controller._strategyHWM - controller._queueTotalSize;\n}\nfunction ReadableByteStreamControllerRespond(controller, bytesWritten) {\n bytesWritten = Number(bytesWritten);\n if (!IsFiniteNonNegativeNumber(bytesWritten)) {\n throw new RangeError('bytesWritten must be a finite');\n }\n ReadableByteStreamControllerRespondInternal(controller, bytesWritten);\n}\nfunction ReadableByteStreamControllerRespondWithNewView(controller, view) {\n const firstDescriptor = controller._pendingPullIntos.peek();\n if (firstDescriptor.byteOffset + firstDescriptor.bytesFilled !== view.byteOffset) {\n throw new RangeError('The region specified by view does not match byobRequest');\n }\n if (firstDescriptor.byteLength !== view.byteLength) {\n throw new RangeError('The buffer of view has different capacity than byobRequest');\n }\n firstDescriptor.buffer = view.buffer;\n ReadableByteStreamControllerRespondInternal(controller, view.byteLength);\n}\nfunction SetUpReadableByteStreamController(stream, controller, startAlgorithm, pullAlgorithm, cancelAlgorithm, highWaterMark, autoAllocateChunkSize) {\n controller._controlledReadableByteStream = stream;\n controller._pullAgain = false;\n controller._pulling = false;\n controller._byobRequest = null;\n // Need to set the slots so that the assert doesn't fire. In the spec the slots already exist implicitly.\n controller._queue = controller._queueTotalSize = undefined;\n ResetQueue(controller);\n controller._closeRequested = false;\n controller._started = false;\n controller._strategyHWM = highWaterMark;\n controller._pullAlgorithm = pullAlgorithm;\n controller._cancelAlgorithm = cancelAlgorithm;\n controller._autoAllocateChunkSize = autoAllocateChunkSize;\n controller._pendingPullIntos = new SimpleQueue();\n stream._readableStreamController = controller;\n const startResult = startAlgorithm();\n uponPromise(promiseResolvedWith(startResult), () => {\n controller._started = true;\n ReadableByteStreamControllerCallPullIfNeeded(controller);\n }, r => {\n ReadableByteStreamControllerError(controller, r);\n });\n}\nfunction SetUpReadableByteStreamControllerFromUnderlyingSource(stream, underlyingByteSource, highWaterMark) {\n const controller = Object.create(ReadableByteStreamController.prototype);\n let startAlgorithm = () => undefined;\n let pullAlgorithm = () => promiseResolvedWith(undefined);\n let cancelAlgorithm = () => promiseResolvedWith(undefined);\n if (underlyingByteSource.start !== undefined) {\n startAlgorithm = () => underlyingByteSource.start(controller);\n }\n if (underlyingByteSource.pull !== undefined) {\n pullAlgorithm = () => underlyingByteSource.pull(controller);\n }\n if (underlyingByteSource.cancel !== undefined) {\n cancelAlgorithm = reason => underlyingByteSource.cancel(reason);\n }\n const autoAllocateChunkSize = underlyingByteSource.autoAllocateChunkSize;\n if (autoAllocateChunkSize === 0) {\n throw new TypeError('autoAllocateChunkSize must be greater than 0');\n }\n SetUpReadableByteStreamController(stream, controller, startAlgorithm, pullAlgorithm, cancelAlgorithm, highWaterMark, autoAllocateChunkSize);\n}\nfunction SetUpReadableStreamBYOBRequest(request, controller, view) {\n request._associatedReadableByteStreamController = controller;\n request._view = view;\n}\n// Helper functions for the ReadableStreamBYOBRequest.\nfunction byobRequestBrandCheckException(name) {\n return new TypeError(`ReadableStreamBYOBRequest.prototype.${name} can only be used on a ReadableStreamBYOBRequest`);\n}\n// Helper functions for the ReadableByteStreamController.\nfunction byteStreamControllerBrandCheckException(name) {\n return new TypeError(`ReadableByteStreamController.prototype.${name} can only be used on a ReadableByteStreamController`);\n}\n\n// Abstract operations for the ReadableStream.\nfunction AcquireReadableStreamBYOBReader(stream) {\n return new ReadableStreamBYOBReader(stream);\n}\n// ReadableStream API exposed for controllers.\nfunction ReadableStreamAddReadIntoRequest(stream, readIntoRequest) {\n stream._reader._readIntoRequests.push(readIntoRequest);\n}\nfunction ReadableStreamFulfillReadIntoRequest(stream, chunk, done) {\n const reader = stream._reader;\n const readIntoRequest = reader._readIntoRequests.shift();\n if (done) {\n readIntoRequest._closeSteps(chunk);\n }\n else {\n readIntoRequest._chunkSteps(chunk);\n }\n}\nfunction ReadableStreamGetNumReadIntoRequests(stream) {\n return stream._reader._readIntoRequests.length;\n}\nfunction ReadableStreamHasBYOBReader(stream) {\n const reader = stream._reader;\n if (reader === undefined) {\n return false;\n }\n if (!IsReadableStreamBYOBReader(reader)) {\n return false;\n }\n return true;\n}\n/**\n * A BYOB reader vended by a {@link ReadableStream}.\n *\n * @public\n */\nclass ReadableStreamBYOBReader {\n constructor(stream) {\n assertRequiredArgument(stream, 1, 'ReadableStreamBYOBReader');\n assertReadableStream(stream, 'First parameter');\n if (IsReadableStreamLocked(stream)) {\n throw new TypeError('This stream has already been locked for exclusive reading by another reader');\n }\n if (!IsReadableByteStreamController(stream._readableStreamController)) {\n throw new TypeError('Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte ' +\n 'source');\n }\n ReadableStreamReaderGenericInitialize(this, stream);\n this._readIntoRequests = new SimpleQueue();\n }\n /**\n * Returns a promise that will be fulfilled when the stream becomes closed, or rejected if the stream ever errors or\n * the reader's lock is released before the stream finishes closing.\n */\n get closed() {\n if (!IsReadableStreamBYOBReader(this)) {\n return promiseRejectedWith(byobReaderBrandCheckException('closed'));\n }\n return this._closedPromise;\n }\n /**\n * If the reader is active, behaves the same as {@link ReadableStream.cancel | stream.cancel(reason)}.\n */\n cancel(reason = undefined) {\n if (!IsReadableStreamBYOBReader(this)) {\n return promiseRejectedWith(byobReaderBrandCheckException('cancel'));\n }\n if (this._ownerReadableStream === undefined) {\n return promiseRejectedWith(readerLockException('cancel'));\n }\n return ReadableStreamReaderGenericCancel(this, reason);\n }\n /**\n * Attempts to reads bytes into view, and returns a promise resolved with the result.\n *\n * If reading a chunk causes the queue to become empty, more data will be pulled from the underlying source.\n */\n read(view) {\n if (!IsReadableStreamBYOBReader(this)) {\n return promiseRejectedWith(byobReaderBrandCheckException('read'));\n }\n if (!ArrayBuffer.isView(view)) {\n return promiseRejectedWith(new TypeError('view must be an array buffer view'));\n }\n if (view.byteLength === 0) {\n return promiseRejectedWith(new TypeError('view must have non-zero byteLength'));\n }\n if (view.buffer.byteLength === 0) {\n return promiseRejectedWith(new TypeError(`view's buffer must have non-zero byteLength`));\n }\n if (this._ownerReadableStream === undefined) {\n return promiseRejectedWith(readerLockException('read from'));\n }\n let resolvePromise;\n let rejectPromise;\n const promise = newPromise((resolve, reject) => {\n resolvePromise = resolve;\n rejectPromise = reject;\n });\n const readIntoRequest = {\n _chunkSteps: chunk => resolvePromise({ value: chunk, done: false }),\n _closeSteps: chunk => resolvePromise({ value: chunk, done: true }),\n _errorSteps: e => rejectPromise(e)\n };\n ReadableStreamBYOBReaderRead(this, view, readIntoRequest);\n return promise;\n }\n /**\n * Releases the reader's lock on the corresponding stream. After the lock is released, the reader is no longer active.\n * If the associated stream is errored when the lock is released, the reader will appear errored in the same way\n * from now on; otherwise, the reader will appear closed.\n *\n * A reader's lock cannot be released while it still has a pending read request, i.e., if a promise returned by\n * the reader's {@link ReadableStreamBYOBReader.read | read()} method has not yet been settled. Attempting to\n * do so will throw a `TypeError` and leave the reader locked to the stream.\n */\n releaseLock() {\n if (!IsReadableStreamBYOBReader(this)) {\n throw byobReaderBrandCheckException('releaseLock');\n }\n if (this._ownerReadableStream === undefined) {\n return;\n }\n if (this._readIntoRequests.length > 0) {\n throw new TypeError('Tried to release a reader lock when that reader has pending read() calls un-settled');\n }\n ReadableStreamReaderGenericRelease(this);\n }\n}\nObject.defineProperties(ReadableStreamBYOBReader.prototype, {\n cancel: { enumerable: true },\n read: { enumerable: true },\n releaseLock: { enumerable: true },\n closed: { enumerable: true }\n});\nif (typeof SymbolPolyfill.toStringTag === 'symbol') {\n Object.defineProperty(ReadableStreamBYOBReader.prototype, SymbolPolyfill.toStringTag, {\n value: 'ReadableStreamBYOBReader',\n configurable: true\n });\n}\n// Abstract operations for the readers.\nfunction IsReadableStreamBYOBReader(x) {\n if (!typeIsObject(x)) {\n return false;\n }\n if (!Object.prototype.hasOwnProperty.call(x, '_readIntoRequests')) {\n return false;\n }\n return true;\n}\nfunction ReadableStreamBYOBReaderRead(reader, view, readIntoRequest) {\n const stream = reader._ownerReadableStream;\n stream._disturbed = true;\n if (stream._state === 'errored') {\n readIntoRequest._errorSteps(stream._storedError);\n }\n else {\n ReadableByteStreamControllerPullInto(stream._readableStreamController, view, readIntoRequest);\n }\n}\n// Helper functions for the ReadableStreamBYOBReader.\nfunction byobReaderBrandCheckException(name) {\n return new TypeError(`ReadableStreamBYOBReader.prototype.${name} can only be used on a ReadableStreamBYOBReader`);\n}\n\nfunction ExtractHighWaterMark(strategy, defaultHWM) {\n const { highWaterMark } = strategy;\n if (highWaterMark === undefined) {\n return defaultHWM;\n }\n if (NumberIsNaN(highWaterMark) || highWaterMark < 0) {\n throw new RangeError('Invalid highWaterMark');\n }\n return highWaterMark;\n}\nfunction ExtractSizeAlgorithm(strategy) {\n const { size } = strategy;\n if (!size) {\n return () => 1;\n }\n return size;\n}\n\nfunction convertQueuingStrategy(init, context) {\n assertDictionary(init, context);\n const highWaterMark = init === null || init === void 0 ? void 0 : init.highWaterMark;\n const size = init === null || init === void 0 ? void 0 : init.size;\n return {\n highWaterMark: highWaterMark === undefined ? undefined : convertUnrestrictedDouble(highWaterMark),\n size: size === undefined ? undefined : convertQueuingStrategySize(size, `${context} has member 'size' that`)\n };\n}\nfunction convertQueuingStrategySize(fn, context) {\n assertFunction(fn, context);\n return chunk => convertUnrestrictedDouble(fn(chunk));\n}\n\nfunction convertUnderlyingSink(original, context) {\n assertDictionary(original, context);\n const abort = original === null || original === void 0 ? void 0 : original.abort;\n const close = original === null || original === void 0 ? void 0 : original.close;\n const start = original === null || original === void 0 ? void 0 : original.start;\n const type = original === null || original === void 0 ? void 0 : original.type;\n const write = original === null || original === void 0 ? void 0 : original.write;\n return {\n abort: abort === undefined ?\n undefined :\n convertUnderlyingSinkAbortCallback(abort, original, `${context} has member 'abort' that`),\n close: close === undefined ?\n undefined :\n convertUnderlyingSinkCloseCallback(close, original, `${context} has member 'close' that`),\n start: start === undefined ?\n undefined :\n convertUnderlyingSinkStartCallback(start, original, `${context} has member 'start' that`),\n write: write === undefined ?\n undefined :\n convertUnderlyingSinkWriteCallback(write, original, `${context} has member 'write' that`),\n type\n };\n}\nfunction convertUnderlyingSinkAbortCallback(fn, original, context) {\n assertFunction(fn, context);\n return (reason) => promiseCall(fn, original, [reason]);\n}\nfunction convertUnderlyingSinkCloseCallback(fn, original, context) {\n assertFunction(fn, context);\n return () => promiseCall(fn, original, []);\n}\nfunction convertUnderlyingSinkStartCallback(fn, original, context) {\n assertFunction(fn, context);\n return (controller) => reflectCall(fn, original, [controller]);\n}\nfunction convertUnderlyingSinkWriteCallback(fn, original, context) {\n assertFunction(fn, context);\n return (chunk, controller) => promiseCall(fn, original, [chunk, controller]);\n}\n\nfunction assertWritableStream(x, context) {\n if (!IsWritableStream(x)) {\n throw new TypeError(`${context} is not a WritableStream.`);\n }\n}\n\n/**\n * A writable stream represents a destination for data, into which you can write.\n *\n * @public\n */\nclass WritableStream {\n constructor(rawUnderlyingSink = {}, rawStrategy = {}) {\n if (rawUnderlyingSink === undefined) {\n rawUnderlyingSink = null;\n }\n else {\n assertObject(rawUnderlyingSink, 'First parameter');\n }\n const strategy = convertQueuingStrategy(rawStrategy, 'Second parameter');\n const underlyingSink = convertUnderlyingSink(rawUnderlyingSink, 'First parameter');\n InitializeWritableStream(this);\n const type = underlyingSink.type;\n if (type !== undefined) {\n throw new RangeError('Invalid type is specified');\n }\n const sizeAlgorithm = ExtractSizeAlgorithm(strategy);\n const highWaterMark = ExtractHighWaterMark(strategy, 1);\n SetUpWritableStreamDefaultControllerFromUnderlyingSink(this, underlyingSink, highWaterMark, sizeAlgorithm);\n }\n /**\n * Returns whether or not the writable stream is locked to a writer.\n */\n get locked() {\n if (!IsWritableStream(this)) {\n throw streamBrandCheckException$2('locked');\n }\n return IsWritableStreamLocked(this);\n }\n /**\n * Aborts the stream, signaling that the producer can no longer successfully write to the stream and it is to be\n * immediately moved to an errored state, with any queued-up writes discarded. This will also execute any abort\n * mechanism of the underlying sink.\n *\n * The returned promise will fulfill if the stream shuts down successfully, or reject if the underlying sink signaled\n * that there was an error doing so. Additionally, it will reject with a `TypeError` (without attempting to cancel\n * the stream) if the stream is currently locked.\n */\n abort(reason = undefined) {\n if (!IsWritableStream(this)) {\n return promiseRejectedWith(streamBrandCheckException$2('abort'));\n }\n if (IsWritableStreamLocked(this)) {\n return promiseRejectedWith(new TypeError('Cannot abort a stream that already has a writer'));\n }\n return WritableStreamAbort(this, reason);\n }\n /**\n * Closes the stream. The underlying sink will finish processing any previously-written chunks, before invoking its\n * close behavior. During this time any further attempts to write will fail (without erroring the stream).\n *\n * The method returns a promise that will fulfill if all remaining chunks are successfully written and the stream\n * successfully closes, or rejects if an error is encountered during this process. Additionally, it will reject with\n * a `TypeError` (without attempting to cancel the stream) if the stream is currently locked.\n */\n close() {\n if (!IsWritableStream(this)) {\n return promiseRejectedWith(streamBrandCheckException$2('close'));\n }\n if (IsWritableStreamLocked(this)) {\n return promiseRejectedWith(new TypeError('Cannot close a stream that already has a writer'));\n }\n if (WritableStreamCloseQueuedOrInFlight(this)) {\n return promiseRejectedWith(new TypeError('Cannot close an already-closing stream'));\n }\n return WritableStreamClose(this);\n }\n /**\n * Creates a {@link WritableStreamDefaultWriter | writer} and locks the stream to the new writer. While the stream\n * is locked, no other writer can be acquired until this one is released.\n *\n * This functionality is especially useful for creating abstractions that desire the ability to write to a stream\n * without interruption or interleaving. By getting a writer for the stream, you can ensure nobody else can write at\n * the same time, which would cause the resulting written data to be unpredictable and probably useless.\n */\n getWriter() {\n if (!IsWritableStream(this)) {\n throw streamBrandCheckException$2('getWriter');\n }\n return AcquireWritableStreamDefaultWriter(this);\n }\n}\nObject.defineProperties(WritableStream.prototype, {\n abort: { enumerable: true },\n close: { enumerable: true },\n getWriter: { enumerable: true },\n locked: { enumerable: true }\n});\nif (typeof SymbolPolyfill.toStringTag === 'symbol') {\n Object.defineProperty(WritableStream.prototype, SymbolPolyfill.toStringTag, {\n value: 'WritableStream',\n configurable: true\n });\n}\n// Abstract operations for the WritableStream.\nfunction AcquireWritableStreamDefaultWriter(stream) {\n return new WritableStreamDefaultWriter(stream);\n}\n// Throws if and only if startAlgorithm throws.\nfunction CreateWritableStream(startAlgorithm, writeAlgorithm, closeAlgorithm, abortAlgorithm, highWaterMark = 1, sizeAlgorithm = () => 1) {\n const stream = Object.create(WritableStream.prototype);\n InitializeWritableStream(stream);\n const controller = Object.create(WritableStreamDefaultController.prototype);\n SetUpWritableStreamDefaultController(stream, controller, startAlgorithm, writeAlgorithm, closeAlgorithm, abortAlgorithm, highWaterMark, sizeAlgorithm);\n return stream;\n}\nfunction InitializeWritableStream(stream) {\n stream._state = 'writable';\n // The error that will be reported by new method calls once the state becomes errored. Only set when [[state]] is\n // 'erroring' or 'errored'. May be set to an undefined value.\n stream._storedError = undefined;\n stream._writer = undefined;\n // Initialize to undefined first because the constructor of the controller checks this\n // variable to validate the caller.\n stream._writableStreamController = undefined;\n // This queue is placed here instead of the writer class in order to allow for passing a writer to the next data\n // producer without waiting for the queued writes to finish.\n stream._writeRequests = new SimpleQueue();\n // Write requests are removed from _writeRequests when write() is called on the underlying sink. This prevents\n // them from being erroneously rejected on error. If a write() call is in-flight, the request is stored here.\n stream._inFlightWriteRequest = undefined;\n // The promise that was returned from writer.close(). Stored here because it may be fulfilled after the writer\n // has been detached.\n stream._closeRequest = undefined;\n // Close request is removed from _closeRequest when close() is called on the underlying sink. This prevents it\n // from being erroneously rejected on error. If a close() call is in-flight, the request is stored here.\n stream._inFlightCloseRequest = undefined;\n // The promise that was returned from writer.abort(). This may also be fulfilled after the writer has detached.\n stream._pendingAbortRequest = undefined;\n // The backpressure signal set by the controller.\n stream._backpressure = false;\n}\nfunction IsWritableStream(x) {\n if (!typeIsObject(x)) {\n return false;\n }\n if (!Object.prototype.hasOwnProperty.call(x, '_writableStreamController')) {\n return false;\n }\n return true;\n}\nfunction IsWritableStreamLocked(stream) {\n if (stream._writer === undefined) {\n return false;\n }\n return true;\n}\nfunction WritableStreamAbort(stream, reason) {\n const state = stream._state;\n if (state === 'closed' || state === 'errored') {\n return promiseResolvedWith(undefined);\n }\n if (stream._pendingAbortRequest !== undefined) {\n return stream._pendingAbortRequest._promise;\n }\n let wasAlreadyErroring = false;\n if (state === 'erroring') {\n wasAlreadyErroring = true;\n // reason will not be used, so don't keep a reference to it.\n reason = undefined;\n }\n const promise = newPromise((resolve, reject) => {\n stream._pendingAbortRequest = {\n _promise: undefined,\n _resolve: resolve,\n _reject: reject,\n _reason: reason,\n _wasAlreadyErroring: wasAlreadyErroring\n };\n });\n stream._pendingAbortRequest._promise = promise;\n if (!wasAlreadyErroring) {\n WritableStreamStartErroring(stream, reason);\n }\n return promise;\n}\nfunction WritableStreamClose(stream) {\n const state = stream._state;\n if (state === 'closed' || state === 'errored') {\n return promiseRejectedWith(new TypeError(`The stream (in ${state} state) is not in the writable state and cannot be closed`));\n }\n const promise = newPromise((resolve, reject) => {\n const closeRequest = {\n _resolve: resolve,\n _reject: reject\n };\n stream._closeRequest = closeRequest;\n });\n const writer = stream._writer;\n if (writer !== undefined && stream._backpressure && state === 'writable') {\n defaultWriterReadyPromiseResolve(writer);\n }\n WritableStreamDefaultControllerClose(stream._writableStreamController);\n return promise;\n}\n// WritableStream API exposed for controllers.\nfunction WritableStreamAddWriteRequest(stream) {\n const promise = newPromise((resolve, reject) => {\n const writeRequest = {\n _resolve: resolve,\n _reject: reject\n };\n stream._writeRequests.push(writeRequest);\n });\n return promise;\n}\nfunction WritableStreamDealWithRejection(stream, error) {\n const state = stream._state;\n if (state === 'writable') {\n WritableStreamStartErroring(stream, error);\n return;\n }\n WritableStreamFinishErroring(stream);\n}\nfunction WritableStreamStartErroring(stream, reason) {\n const controller = stream._writableStreamController;\n stream._state = 'erroring';\n stream._storedError = reason;\n const writer = stream._writer;\n if (writer !== undefined) {\n WritableStreamDefaultWriterEnsureReadyPromiseRejected(writer, reason);\n }\n if (!WritableStreamHasOperationMarkedInFlight(stream) && controller._started) {\n WritableStreamFinishErroring(stream);\n }\n}\nfunction WritableStreamFinishErroring(stream) {\n stream._state = 'errored';\n stream._writableStreamController[ErrorSteps]();\n const storedError = stream._storedError;\n stream._writeRequests.forEach(writeRequest => {\n writeRequest._reject(storedError);\n });\n stream._writeRequests = new SimpleQueue();\n if (stream._pendingAbortRequest === undefined) {\n WritableStreamRejectCloseAndClosedPromiseIfNeeded(stream);\n return;\n }\n const abortRequest = stream._pendingAbortRequest;\n stream._pendingAbortRequest = undefined;\n if (abortRequest._wasAlreadyErroring) {\n abortRequest._reject(storedError);\n WritableStreamRejectCloseAndClosedPromiseIfNeeded(stream);\n return;\n }\n const promise = stream._writableStreamController[AbortSteps](abortRequest._reason);\n uponPromise(promise, () => {\n abortRequest._resolve();\n WritableStreamRejectCloseAndClosedPromiseIfNeeded(stream);\n }, (reason) => {\n abortRequest._reject(reason);\n WritableStreamRejectCloseAndClosedPromiseIfNeeded(stream);\n });\n}\nfunction WritableStreamFinishInFlightWrite(stream) {\n stream._inFlightWriteRequest._resolve(undefined);\n stream._inFlightWriteRequest = undefined;\n}\nfunction WritableStreamFinishInFlightWriteWithError(stream, error) {\n stream._inFlightWriteRequest._reject(error);\n stream._inFlightWriteRequest = undefined;\n WritableStreamDealWithRejection(stream, error);\n}\nfunction WritableStreamFinishInFlightClose(stream) {\n stream._inFlightCloseRequest._resolve(undefined);\n stream._inFlightCloseRequest = undefined;\n const state = stream._state;\n if (state === 'erroring') {\n // The error was too late to do anything, so it is ignored.\n stream._storedError = undefined;\n if (stream._pendingAbortRequest !== undefined) {\n stream._pendingAbortRequest._resolve();\n stream._pendingAbortRequest = undefined;\n }\n }\n stream._state = 'closed';\n const writer = stream._writer;\n if (writer !== undefined) {\n defaultWriterClosedPromiseResolve(writer);\n }\n}\nfunction WritableStreamFinishInFlightCloseWithError(stream, error) {\n stream._inFlightCloseRequest._reject(error);\n stream._inFlightCloseRequest = undefined;\n // Never execute sink abort() after sink close().\n if (stream._pendingAbortRequest !== undefined) {\n stream._pendingAbortRequest._reject(error);\n stream._pendingAbortRequest = undefined;\n }\n WritableStreamDealWithRejection(stream, error);\n}\n// TODO(ricea): Fix alphabetical order.\nfunction WritableStreamCloseQueuedOrInFlight(stream) {\n if (stream._closeRequest === undefined && stream._inFlightCloseRequest === undefined) {\n return false;\n }\n return true;\n}\nfunction WritableStreamHasOperationMarkedInFlight(stream) {\n if (stream._inFlightWriteRequest === undefined && stream._inFlightCloseRequest === undefined) {\n return false;\n }\n return true;\n}\nfunction WritableStreamMarkCloseRequestInFlight(stream) {\n stream._inFlightCloseRequest = stream._closeRequest;\n stream._closeRequest = undefined;\n}\nfunction WritableStreamMarkFirstWriteRequestInFlight(stream) {\n stream._inFlightWriteRequest = stream._writeRequests.shift();\n}\nfunction WritableStreamRejectCloseAndClosedPromiseIfNeeded(stream) {\n if (stream._closeRequest !== undefined) {\n stream._closeRequest._reject(stream._storedError);\n stream._closeRequest = undefined;\n }\n const writer = stream._writer;\n if (writer !== undefined) {\n defaultWriterClosedPromiseReject(writer, stream._storedError);\n }\n}\nfunction WritableStreamUpdateBackpressure(stream, backpressure) {\n const writer = stream._writer;\n if (writer !== undefined && backpressure !== stream._backpressure) {\n if (backpressure) {\n defaultWriterReadyPromiseReset(writer);\n }\n else {\n defaultWriterReadyPromiseResolve(writer);\n }\n }\n stream._backpressure = backpressure;\n}\n/**\n * A default writer vended by a {@link WritableStream}.\n *\n * @public\n */\nclass WritableStreamDefaultWriter {\n constructor(stream) {\n assertRequiredArgument(stream, 1, 'WritableStreamDefaultWriter');\n assertWritableStream(stream, 'First parameter');\n if (IsWritableStreamLocked(stream)) {\n throw new TypeError('This stream has already been locked for exclusive writing by another writer');\n }\n this._ownerWritableStream = stream;\n stream._writer = this;\n const state = stream._state;\n if (state === 'writable') {\n if (!WritableStreamCloseQueuedOrInFlight(stream) && stream._backpressure) {\n defaultWriterReadyPromiseInitialize(this);\n }\n else {\n defaultWriterReadyPromiseInitializeAsResolved(this);\n }\n defaultWriterClosedPromiseInitialize(this);\n }\n else if (state === 'erroring') {\n defaultWriterReadyPromiseInitializeAsRejected(this, stream._storedError);\n defaultWriterClosedPromiseInitialize(this);\n }\n else if (state === 'closed') {\n defaultWriterReadyPromiseInitializeAsResolved(this);\n defaultWriterClosedPromiseInitializeAsResolved(this);\n }\n else {\n const storedError = stream._storedError;\n defaultWriterReadyPromiseInitializeAsRejected(this, storedError);\n defaultWriterClosedPromiseInitializeAsRejected(this, storedError);\n }\n }\n /**\n * Returns a promise that will be fulfilled when the stream becomes closed, or rejected if the stream ever errors or\n * the writer’s lock is released before the stream finishes closing.\n */\n get closed() {\n if (!IsWritableStreamDefaultWriter(this)) {\n return promiseRejectedWith(defaultWriterBrandCheckException('closed'));\n }\n return this._closedPromise;\n }\n /**\n * Returns the desired size to fill the stream’s internal queue. It can be negative, if the queue is over-full.\n * A producer can use this information to determine the right amount of data to write.\n *\n * It will be `null` if the stream cannot be successfully written to (due to either being errored, or having an abort\n * queued up). It will return zero if the stream is closed. And the getter will throw an exception if invoked when\n * the writer’s lock is released.\n */\n get desiredSize() {\n if (!IsWritableStreamDefaultWriter(this)) {\n throw defaultWriterBrandCheckException('desiredSize');\n }\n if (this._ownerWritableStream === undefined) {\n throw defaultWriterLockException('desiredSize');\n }\n return WritableStreamDefaultWriterGetDesiredSize(this);\n }\n /**\n * Returns a promise that will be fulfilled when the desired size to fill the stream’s internal queue transitions\n * from non-positive to positive, signaling that it is no longer applying backpressure. Once the desired size dips\n * back to zero or below, the getter will return a new promise that stays pending until the next transition.\n *\n * If the stream becomes errored or aborted, or the writer’s lock is released, the returned promise will become\n * rejected.\n */\n get ready() {\n if (!IsWritableStreamDefaultWriter(this)) {\n return promiseRejectedWith(defaultWriterBrandCheckException('ready'));\n }\n return this._readyPromise;\n }\n /**\n * If the reader is active, behaves the same as {@link WritableStream.abort | stream.abort(reason)}.\n */\n abort(reason = undefined) {\n if (!IsWritableStreamDefaultWriter(this)) {\n return promiseRejectedWith(defaultWriterBrandCheckException('abort'));\n }\n if (this._ownerWritableStream === undefined) {\n return promiseRejectedWith(defaultWriterLockException('abort'));\n }\n return WritableStreamDefaultWriterAbort(this, reason);\n }\n /**\n * If the reader is active, behaves the same as {@link WritableStream.close | stream.close()}.\n */\n close() {\n if (!IsWritableStreamDefaultWriter(this)) {\n return promiseRejectedWith(defaultWriterBrandCheckException('close'));\n }\n const stream = this._ownerWritableStream;\n if (stream === undefined) {\n return promiseRejectedWith(defaultWriterLockException('close'));\n }\n if (WritableStreamCloseQueuedOrInFlight(stream)) {\n return promiseRejectedWith(new TypeError('Cannot close an already-closing stream'));\n }\n return WritableStreamDefaultWriterClose(this);\n }\n /**\n * Releases the writer’s lock on the corresponding stream. After the lock is released, the writer is no longer active.\n * If the associated stream is errored when the lock is released, the writer will appear errored in the same way from\n * now on; otherwise, the writer will appear closed.\n *\n * Note that the lock can still be released even if some ongoing writes have not yet finished (i.e. even if the\n * promises returned from previous calls to {@link WritableStreamDefaultWriter.write | write()} have not yet settled).\n * It’s not necessary to hold the lock on the writer for the duration of the write; the lock instead simply prevents\n * other producers from writing in an interleaved manner.\n */\n releaseLock() {\n if (!IsWritableStreamDefaultWriter(this)) {\n throw defaultWriterBrandCheckException('releaseLock');\n }\n const stream = this._ownerWritableStream;\n if (stream === undefined) {\n return;\n }\n WritableStreamDefaultWriterRelease(this);\n }\n write(chunk = undefined) {\n if (!IsWritableStreamDefaultWriter(this)) {\n return promiseRejectedWith(defaultWriterBrandCheckException('write'));\n }\n if (this._ownerWritableStream === undefined) {\n return promiseRejectedWith(defaultWriterLockException('write to'));\n }\n return WritableStreamDefaultWriterWrite(this, chunk);\n }\n}\nObject.defineProperties(WritableStreamDefaultWriter.prototype, {\n abort: { enumerable: true },\n close: { enumerable: true },\n releaseLock: { enumerable: true },\n write: { enumerable: true },\n closed: { enumerable: true },\n desiredSize: { enumerable: true },\n ready: { enumerable: true }\n});\nif (typeof SymbolPolyfill.toStringTag === 'symbol') {\n Object.defineProperty(WritableStreamDefaultWriter.prototype, SymbolPolyfill.toStringTag, {\n value: 'WritableStreamDefaultWriter',\n configurable: true\n });\n}\n// Abstract operations for the WritableStreamDefaultWriter.\nfunction IsWritableStreamDefaultWriter(x) {\n if (!typeIsObject(x)) {\n return false;\n }\n if (!Object.prototype.hasOwnProperty.call(x, '_ownerWritableStream')) {\n return false;\n }\n return true;\n}\n// A client of WritableStreamDefaultWriter may use these functions directly to bypass state check.\nfunction WritableStreamDefaultWriterAbort(writer, reason) {\n const stream = writer._ownerWritableStream;\n return WritableStreamAbort(stream, reason);\n}\nfunction WritableStreamDefaultWriterClose(writer) {\n const stream = writer._ownerWritableStream;\n return WritableStreamClose(stream);\n}\nfunction WritableStreamDefaultWriterCloseWithErrorPropagation(writer) {\n const stream = writer._ownerWritableStream;\n const state = stream._state;\n if (WritableStreamCloseQueuedOrInFlight(stream) || state === 'closed') {\n return promiseResolvedWith(undefined);\n }\n if (state === 'errored') {\n return promiseRejectedWith(stream._storedError);\n }\n return WritableStreamDefaultWriterClose(writer);\n}\nfunction WritableStreamDefaultWriterEnsureClosedPromiseRejected(writer, error) {\n if (writer._closedPromiseState === 'pending') {\n defaultWriterClosedPromiseReject(writer, error);\n }\n else {\n defaultWriterClosedPromiseResetToRejected(writer, error);\n }\n}\nfunction WritableStreamDefaultWriterEnsureReadyPromiseRejected(writer, error) {\n if (writer._readyPromiseState === 'pending') {\n defaultWriterReadyPromiseReject(writer, error);\n }\n else {\n defaultWriterReadyPromiseResetToRejected(writer, error);\n }\n}\nfunction WritableStreamDefaultWriterGetDesiredSize(writer) {\n const stream = writer._ownerWritableStream;\n const state = stream._state;\n if (state === 'errored' || state === 'erroring') {\n return null;\n }\n if (state === 'closed') {\n return 0;\n }\n return WritableStreamDefaultControllerGetDesiredSize(stream._writableStreamController);\n}\nfunction WritableStreamDefaultWriterRelease(writer) {\n const stream = writer._ownerWritableStream;\n const releasedError = new TypeError(`Writer was released and can no longer be used to monitor the stream's closedness`);\n WritableStreamDefaultWriterEnsureReadyPromiseRejected(writer, releasedError);\n // The state transitions to \"errored\" before the sink abort() method runs, but the writer.closed promise is not\n // rejected until afterwards. This means that simply testing state will not work.\n WritableStreamDefaultWriterEnsureClosedPromiseRejected(writer, releasedError);\n stream._writer = undefined;\n writer._ownerWritableStream = undefined;\n}\nfunction WritableStreamDefaultWriterWrite(writer, chunk) {\n const stream = writer._ownerWritableStream;\n const controller = stream._writableStreamController;\n const chunkSize = WritableStreamDefaultControllerGetChunkSize(controller, chunk);\n if (stream !== writer._ownerWritableStream) {\n return promiseRejectedWith(defaultWriterLockException('write to'));\n }\n const state = stream._state;\n if (state === 'errored') {\n return promiseRejectedWith(stream._storedError);\n }\n if (WritableStreamCloseQueuedOrInFlight(stream) || state === 'closed') {\n return promiseRejectedWith(new TypeError('The stream is closing or closed and cannot be written to'));\n }\n if (state === 'erroring') {\n return promiseRejectedWith(stream._storedError);\n }\n const promise = WritableStreamAddWriteRequest(stream);\n WritableStreamDefaultControllerWrite(controller, chunk, chunkSize);\n return promise;\n}\nconst closeSentinel = {};\n/**\n * Allows control of a {@link WritableStream | writable stream}'s state and internal queue.\n *\n * @public\n */\nclass WritableStreamDefaultController {\n constructor() {\n throw new TypeError('Illegal constructor');\n }\n /**\n * Closes the controlled writable stream, making all future interactions with it fail with the given error `e`.\n *\n * This method is rarely used, since usually it suffices to return a rejected promise from one of the underlying\n * sink's methods. However, it can be useful for suddenly shutting down a stream in response to an event outside the\n * normal lifecycle of interactions with the underlying sink.\n */\n error(e = undefined) {\n if (!IsWritableStreamDefaultController(this)) {\n throw new TypeError('WritableStreamDefaultController.prototype.error can only be used on a WritableStreamDefaultController');\n }\n const state = this._controlledWritableStream._state;\n if (state !== 'writable') {\n // The stream is closed, errored or will be soon. The sink can't do anything useful if it gets an error here, so\n // just treat it as a no-op.\n return;\n }\n WritableStreamDefaultControllerError(this, e);\n }\n /** @internal */\n [AbortSteps](reason) {\n const result = this._abortAlgorithm(reason);\n WritableStreamDefaultControllerClearAlgorithms(this);\n return result;\n }\n /** @internal */\n [ErrorSteps]() {\n ResetQueue(this);\n }\n}\nObject.defineProperties(WritableStreamDefaultController.prototype, {\n error: { enumerable: true }\n});\nif (typeof SymbolPolyfill.toStringTag === 'symbol') {\n Object.defineProperty(WritableStreamDefaultController.prototype, SymbolPolyfill.toStringTag, {\n value: 'WritableStreamDefaultController',\n configurable: true\n });\n}\n// Abstract operations implementing interface required by the WritableStream.\nfunction IsWritableStreamDefaultController(x) {\n if (!typeIsObject(x)) {\n return false;\n }\n if (!Object.prototype.hasOwnProperty.call(x, '_controlledWritableStream')) {\n return false;\n }\n return true;\n}\nfunction SetUpWritableStreamDefaultController(stream, controller, startAlgorithm, writeAlgorithm, closeAlgorithm, abortAlgorithm, highWaterMark, sizeAlgorithm) {\n controller._controlledWritableStream = stream;\n stream._writableStreamController = controller;\n // Need to set the slots so that the assert doesn't fire. In the spec the slots already exist implicitly.\n controller._queue = undefined;\n controller._queueTotalSize = undefined;\n ResetQueue(controller);\n controller._started = false;\n controller._strategySizeAlgorithm = sizeAlgorithm;\n controller._strategyHWM = highWaterMark;\n controller._writeAlgorithm = writeAlgorithm;\n controller._closeAlgorithm = closeAlgorithm;\n controller._abortAlgorithm = abortAlgorithm;\n const backpressure = WritableStreamDefaultControllerGetBackpressure(controller);\n WritableStreamUpdateBackpressure(stream, backpressure);\n const startResult = startAlgorithm();\n const startPromise = promiseResolvedWith(startResult);\n uponPromise(startPromise, () => {\n controller._started = true;\n WritableStreamDefaultControllerAdvanceQueueIfNeeded(controller);\n }, r => {\n controller._started = true;\n WritableStreamDealWithRejection(stream, r);\n });\n}\nfunction SetUpWritableStreamDefaultControllerFromUnderlyingSink(stream, underlyingSink, highWaterMark, sizeAlgorithm) {\n const controller = Object.create(WritableStreamDefaultController.prototype);\n let startAlgorithm = () => undefined;\n let writeAlgorithm = () => promiseResolvedWith(undefined);\n let closeAlgorithm = () => promiseResolvedWith(undefined);\n let abortAlgorithm = () => promiseResolvedWith(undefined);\n if (underlyingSink.start !== undefined) {\n startAlgorithm = () => underlyingSink.start(controller);\n }\n if (underlyingSink.write !== undefined) {\n writeAlgorithm = chunk => underlyingSink.write(chunk, controller);\n }\n if (underlyingSink.close !== undefined) {\n closeAlgorithm = () => underlyingSink.close();\n }\n if (underlyingSink.abort !== undefined) {\n abortAlgorithm = reason => underlyingSink.abort(reason);\n }\n SetUpWritableStreamDefaultController(stream, controller, startAlgorithm, writeAlgorithm, closeAlgorithm, abortAlgorithm, highWaterMark, sizeAlgorithm);\n}\n// ClearAlgorithms may be called twice. Erroring the same stream in multiple ways will often result in redundant calls.\nfunction WritableStreamDefaultControllerClearAlgorithms(controller) {\n controller._writeAlgorithm = undefined;\n controller._closeAlgorithm = undefined;\n controller._abortAlgorithm = undefined;\n controller._strategySizeAlgorithm = undefined;\n}\nfunction WritableStreamDefaultControllerClose(controller) {\n EnqueueValueWithSize(controller, closeSentinel, 0);\n WritableStreamDefaultControllerAdvanceQueueIfNeeded(controller);\n}\nfunction WritableStreamDefaultControllerGetChunkSize(controller, chunk) {\n try {\n return controller._strategySizeAlgorithm(chunk);\n }\n catch (chunkSizeE) {\n WritableStreamDefaultControllerErrorIfNeeded(controller, chunkSizeE);\n return 1;\n }\n}\nfunction WritableStreamDefaultControllerGetDesiredSize(controller) {\n return controller._strategyHWM - controller._queueTotalSize;\n}\nfunction WritableStreamDefaultControllerWrite(controller, chunk, chunkSize) {\n try {\n EnqueueValueWithSize(controller, chunk, chunkSize);\n }\n catch (enqueueE) {\n WritableStreamDefaultControllerErrorIfNeeded(controller, enqueueE);\n return;\n }\n const stream = controller._controlledWritableStream;\n if (!WritableStreamCloseQueuedOrInFlight(stream) && stream._state === 'writable') {\n const backpressure = WritableStreamDefaultControllerGetBackpressure(controller);\n WritableStreamUpdateBackpressure(stream, backpressure);\n }\n WritableStreamDefaultControllerAdvanceQueueIfNeeded(controller);\n}\n// Abstract operations for the WritableStreamDefaultController.\nfunction WritableStreamDefaultControllerAdvanceQueueIfNeeded(controller) {\n const stream = controller._controlledWritableStream;\n if (!controller._started) {\n return;\n }\n if (stream._inFlightWriteRequest !== undefined) {\n return;\n }\n const state = stream._state;\n if (state === 'erroring') {\n WritableStreamFinishErroring(stream);\n return;\n }\n if (controller._queue.length === 0) {\n return;\n }\n const value = PeekQueueValue(controller);\n if (value === closeSentinel) {\n WritableStreamDefaultControllerProcessClose(controller);\n }\n else {\n WritableStreamDefaultControllerProcessWrite(controller, value);\n }\n}\nfunction WritableStreamDefaultControllerErrorIfNeeded(controller, error) {\n if (controller._controlledWritableStream._state === 'writable') {\n WritableStreamDefaultControllerError(controller, error);\n }\n}\nfunction WritableStreamDefaultControllerProcessClose(controller) {\n const stream = controller._controlledWritableStream;\n WritableStreamMarkCloseRequestInFlight(stream);\n DequeueValue(controller);\n const sinkClosePromise = controller._closeAlgorithm();\n WritableStreamDefaultControllerClearAlgorithms(controller);\n uponPromise(sinkClosePromise, () => {\n WritableStreamFinishInFlightClose(stream);\n }, reason => {\n WritableStreamFinishInFlightCloseWithError(stream, reason);\n });\n}\nfunction WritableStreamDefaultControllerProcessWrite(controller, chunk) {\n const stream = controller._controlledWritableStream;\n WritableStreamMarkFirstWriteRequestInFlight(stream);\n const sinkWritePromise = controller._writeAlgorithm(chunk);\n uponPromise(sinkWritePromise, () => {\n WritableStreamFinishInFlightWrite(stream);\n const state = stream._state;\n DequeueValue(controller);\n if (!WritableStreamCloseQueuedOrInFlight(stream) && state === 'writable') {\n const backpressure = WritableStreamDefaultControllerGetBackpressure(controller);\n WritableStreamUpdateBackpressure(stream, backpressure);\n }\n WritableStreamDefaultControllerAdvanceQueueIfNeeded(controller);\n }, reason => {\n if (stream._state === 'writable') {\n WritableStreamDefaultControllerClearAlgorithms(controller);\n }\n WritableStreamFinishInFlightWriteWithError(stream, reason);\n });\n}\nfunction WritableStreamDefaultControllerGetBackpressure(controller) {\n const desiredSize = WritableStreamDefaultControllerGetDesiredSize(controller);\n return desiredSize <= 0;\n}\n// A client of WritableStreamDefaultController may use these functions directly to bypass state check.\nfunction WritableStreamDefaultControllerError(controller, error) {\n const stream = controller._controlledWritableStream;\n WritableStreamDefaultControllerClearAlgorithms(controller);\n WritableStreamStartErroring(stream, error);\n}\n// Helper functions for the WritableStream.\nfunction streamBrandCheckException$2(name) {\n return new TypeError(`WritableStream.prototype.${name} can only be used on a WritableStream`);\n}\n// Helper functions for the WritableStreamDefaultWriter.\nfunction defaultWriterBrandCheckException(name) {\n return new TypeError(`WritableStreamDefaultWriter.prototype.${name} can only be used on a WritableStreamDefaultWriter`);\n}\nfunction defaultWriterLockException(name) {\n return new TypeError('Cannot ' + name + ' a stream using a released writer');\n}\nfunction defaultWriterClosedPromiseInitialize(writer) {\n writer._closedPromise = newPromise((resolve, reject) => {\n writer._closedPromise_resolve = resolve;\n writer._closedPromise_reject = reject;\n writer._closedPromiseState = 'pending';\n });\n}\nfunction defaultWriterClosedPromiseInitializeAsRejected(writer, reason) {\n defaultWriterClosedPromiseInitialize(writer);\n defaultWriterClosedPromiseReject(writer, reason);\n}\nfunction defaultWriterClosedPromiseInitializeAsResolved(writer) {\n defaultWriterClosedPromiseInitialize(writer);\n defaultWriterClosedPromiseResolve(writer);\n}\nfunction defaultWriterClosedPromiseReject(writer, reason) {\n if (writer._closedPromise_reject === undefined) {\n return;\n }\n setPromiseIsHandledToTrue(writer._closedPromise);\n writer._closedPromise_reject(reason);\n writer._closedPromise_resolve = undefined;\n writer._closedPromise_reject = undefined;\n writer._closedPromiseState = 'rejected';\n}\nfunction defaultWriterClosedPromiseResetToRejected(writer, reason) {\n defaultWriterClosedPromiseInitializeAsRejected(writer, reason);\n}\nfunction defaultWriterClosedPromiseResolve(writer) {\n if (writer._closedPromise_resolve === undefined) {\n return;\n }\n writer._closedPromise_resolve(undefined);\n writer._closedPromise_resolve = undefined;\n writer._closedPromise_reject = undefined;\n writer._closedPromiseState = 'resolved';\n}\nfunction defaultWriterReadyPromiseInitialize(writer) {\n writer._readyPromise = newPromise((resolve, reject) => {\n writer._readyPromise_resolve = resolve;\n writer._readyPromise_reject = reject;\n });\n writer._readyPromiseState = 'pending';\n}\nfunction defaultWriterReadyPromiseInitializeAsRejected(writer, reason) {\n defaultWriterReadyPromiseInitialize(writer);\n defaultWriterReadyPromiseReject(writer, reason);\n}\nfunction defaultWriterReadyPromiseInitializeAsResolved(writer) {\n defaultWriterReadyPromiseInitialize(writer);\n defaultWriterReadyPromiseResolve(writer);\n}\nfunction defaultWriterReadyPromiseReject(writer, reason) {\n if (writer._readyPromise_reject === undefined) {\n return;\n }\n setPromiseIsHandledToTrue(writer._readyPromise);\n writer._readyPromise_reject(reason);\n writer._readyPromise_resolve = undefined;\n writer._readyPromise_reject = undefined;\n writer._readyPromiseState = 'rejected';\n}\nfunction defaultWriterReadyPromiseReset(writer) {\n defaultWriterReadyPromiseInitialize(writer);\n}\nfunction defaultWriterReadyPromiseResetToRejected(writer, reason) {\n defaultWriterReadyPromiseInitializeAsRejected(writer, reason);\n}\nfunction defaultWriterReadyPromiseResolve(writer) {\n if (writer._readyPromise_resolve === undefined) {\n return;\n }\n writer._readyPromise_resolve(undefined);\n writer._readyPromise_resolve = undefined;\n writer._readyPromise_reject = undefined;\n writer._readyPromiseState = 'fulfilled';\n}\n\nfunction isAbortSignal(value) {\n if (typeof value !== 'object' || value === null) {\n return false;\n }\n try {\n return typeof value.aborted === 'boolean';\n }\n catch (_a) {\n // AbortSignal.prototype.aborted throws if its brand check fails\n return false;\n }\n}\n\n/// <reference lib=\"dom\" />\nconst NativeDOMException = typeof DOMException !== 'undefined' ? DOMException : undefined;\n\n/// <reference types=\"node\" />\nfunction isDOMExceptionConstructor(ctor) {\n if (!(typeof ctor === 'function' || typeof ctor === 'object')) {\n return false;\n }\n try {\n new ctor();\n return true;\n }\n catch (_a) {\n return false;\n }\n}\nfunction createDOMExceptionPolyfill() {\n // eslint-disable-next-line no-shadow\n const ctor = function DOMException(message, name) {\n this.message = message || '';\n this.name = name || 'Error';\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n }\n };\n ctor.prototype = Object.create(Error.prototype);\n Object.defineProperty(ctor.prototype, 'constructor', { value: ctor, writable: true, configurable: true });\n return ctor;\n}\n// eslint-disable-next-line no-redeclare\nconst DOMException$1 = isDOMExceptionConstructor(NativeDOMException) ? NativeDOMException : createDOMExceptionPolyfill();\n\nfunction ReadableStreamPipeTo(source, dest, preventClose, preventAbort, preventCancel, signal) {\n const reader = AcquireReadableStreamDefaultReader(source);\n const writer = AcquireWritableStreamDefaultWriter(dest);\n source._disturbed = true;\n let shuttingDown = false;\n // This is used to keep track of the spec's requirement that we wait for ongoing writes during shutdown.\n let currentWrite = promiseResolvedWith(undefined);\n return newPromise((resolve, reject) => {\n let abortAlgorithm;\n if (signal !== undefined) {\n abortAlgorithm = () => {\n const error = new DOMException$1('Aborted', 'AbortError');\n const actions = [];\n if (!preventAbort) {\n actions.push(() => {\n if (dest._state === 'writable') {\n return WritableStreamAbort(dest, error);\n }\n return promiseResolvedWith(undefined);\n });\n }\n if (!preventCancel) {\n actions.push(() => {\n if (source._state === 'readable') {\n return ReadableStreamCancel(source, error);\n }\n return promiseResolvedWith(undefined);\n });\n }\n shutdownWithAction(() => Promise.all(actions.map(action => action())), true, error);\n };\n if (signal.aborted) {\n abortAlgorithm();\n return;\n }\n signal.addEventListener('abort', abortAlgorithm);\n }\n // Using reader and writer, read all chunks from this and write them to dest\n // - Backpressure must be enforced\n // - Shutdown must stop all activity\n function pipeLoop() {\n return newPromise((resolveLoop, rejectLoop) => {\n function next(done) {\n if (done) {\n resolveLoop();\n }\n else {\n // Use `PerformPromiseThen` instead of `uponPromise` to avoid\n // adding unnecessary `.catch(rethrowAssertionErrorRejection)` handlers\n PerformPromiseThen(pipeStep(), next, rejectLoop);\n }\n }\n next(false);\n });\n }\n function pipeStep() {\n if (shuttingDown) {\n return promiseResolvedWith(true);\n }\n return PerformPromiseThen(writer._readyPromise, () => {\n return newPromise((resolveRead, rejectRead) => {\n ReadableStreamDefaultReaderRead(reader, {\n _chunkSteps: chunk => {\n currentWrite = PerformPromiseThen(WritableStreamDefaultWriterWrite(writer, chunk), undefined, noop);\n resolveRead(false);\n },\n _closeSteps: () => resolveRead(true),\n _errorSteps: rejectRead\n });\n });\n });\n }\n // Errors must be propagated forward\n isOrBecomesErrored(source, reader._closedPromise, storedError => {\n if (!preventAbort) {\n shutdownWithAction(() => WritableStreamAbort(dest, storedError), true, storedError);\n }\n else {\n shutdown(true, storedError);\n }\n });\n // Errors must be propagated backward\n isOrBecomesErrored(dest, writer._closedPromise, storedError => {\n if (!preventCancel) {\n shutdownWithAction(() => ReadableStreamCancel(source, storedError), true, storedError);\n }\n else {\n shutdown(true, storedError);\n }\n });\n // Closing must be propagated forward\n isOrBecomesClosed(source, reader._closedPromise, () => {\n if (!preventClose) {\n shutdownWithAction(() => WritableStreamDefaultWriterCloseWithErrorPropagation(writer));\n }\n else {\n shutdown();\n }\n });\n // Closing must be propagated backward\n if (WritableStreamCloseQueuedOrInFlight(dest) || dest._state === 'closed') {\n const destClosed = new TypeError('the destination writable stream closed before all data could be piped to it');\n if (!preventCancel) {\n shutdownWithAction(() => ReadableStreamCancel(source, destClosed), true, destClosed);\n }\n else {\n shutdown(true, destClosed);\n }\n }\n setPromiseIsHandledToTrue(pipeLoop());\n function waitForWritesToFinish() {\n // Another write may have started while we were waiting on this currentWrite, so we have to be sure to wait\n // for that too.\n const oldCurrentWrite = currentWrite;\n return PerformPromiseThen(currentWrite, () => oldCurrentWrite !== currentWrite ? waitForWritesToFinish() : undefined);\n }\n function isOrBecomesErrored(stream, promise, action) {\n if (stream._state === 'errored') {\n action(stream._storedError);\n }\n else {\n uponRejection(promise, action);\n }\n }\n function isOrBecomesClosed(stream, promise, action) {\n if (stream._state === 'closed') {\n action();\n }\n else {\n uponFulfillment(promise, action);\n }\n }\n function shutdownWithAction(action, originalIsError, originalError) {\n if (shuttingDown) {\n return;\n }\n shuttingDown = true;\n if (dest._state === 'writable' && !WritableStreamCloseQueuedOrInFlight(dest)) {\n uponFulfillment(waitForWritesToFinish(), doTheRest);\n }\n else {\n doTheRest();\n }\n function doTheRest() {\n uponPromise(action(), () => finalize(originalIsError, originalError), newError => finalize(true, newError));\n }\n }\n function shutdown(isError, error) {\n if (shuttingDown) {\n return;\n }\n shuttingDown = true;\n if (dest._state === 'writable' && !WritableStreamCloseQueuedOrInFlight(dest)) {\n uponFulfillment(waitForWritesToFinish(), () => finalize(isError, error));\n }\n else {\n finalize(isError, error);\n }\n }\n function finalize(isError, error) {\n WritableStreamDefaultWriterRelease(writer);\n ReadableStreamReaderGenericRelease(reader);\n if (signal !== undefined) {\n signal.removeEventListener('abort', abortAlgorithm);\n }\n if (isError) {\n reject(error);\n }\n else {\n resolve(undefined);\n }\n }\n });\n}\n\n/**\n * Allows control of a {@link ReadableStream | readable stream}'s state and internal queue.\n *\n * @public\n */\nclass ReadableStreamDefaultController {\n constructor() {\n throw new TypeError('Illegal constructor');\n }\n /**\n * Returns the desired size to fill the controlled stream's internal queue. It can be negative, if the queue is\n * over-full. An underlying source ought to use this information to determine when and how to apply backpressure.\n */\n get desiredSize() {\n if (!IsReadableStreamDefaultController(this)) {\n throw defaultControllerBrandCheckException$1('desiredSize');\n }\n return ReadableStreamDefaultControllerGetDesiredSize(this);\n }\n /**\n * Closes the controlled readable stream. Consumers will still be able to read any previously-enqueued chunks from\n * the stream, but once those are read, the stream will become closed.\n */\n close() {\n if (!IsReadableStreamDefaultController(this)) {\n throw defaultControllerBrandCheckException$1('close');\n }\n if (!ReadableStreamDefaultControllerCanCloseOrEnqueue(this)) {\n throw new TypeError('The stream is not in a state that permits close');\n }\n ReadableStreamDefaultControllerClose(this);\n }\n enqueue(chunk = undefined) {\n if (!IsReadableStreamDefaultController(this)) {\n throw defaultControllerBrandCheckException$1('enqueue');\n }\n if (!ReadableStreamDefaultControllerCanCloseOrEnqueue(this)) {\n throw new TypeError('The stream is not in a state that permits enqueue');\n }\n return ReadableStreamDefaultControllerEnqueue(this, chunk);\n }\n /**\n * Errors the controlled readable stream, making all future interactions with it fail with the given error `e`.\n */\n error(e = undefined) {\n if (!IsReadableStreamDefaultController(this)) {\n throw defaultControllerBrandCheckException$1('error');\n }\n ReadableStreamDefaultControllerError(this, e);\n }\n /** @internal */\n [CancelSteps](reason) {\n ResetQueue(this);\n const result = this._cancelAlgorithm(reason);\n ReadableStreamDefaultControllerClearAlgorithms(this);\n return result;\n }\n /** @internal */\n [PullSteps](readRequest) {\n const stream = this._controlledReadableStream;\n if (this._queue.length > 0) {\n const chunk = DequeueValue(this);\n if (this._closeRequested && this._queue.length === 0) {\n ReadableStreamDefaultControllerClearAlgorithms(this);\n ReadableStreamClose(stream);\n }\n else {\n ReadableStreamDefaultControllerCallPullIfNeeded(this);\n }\n readRequest._chunkSteps(chunk);\n }\n else {\n ReadableStreamAddReadRequest(stream, readRequest);\n ReadableStreamDefaultControllerCallPullIfNeeded(this);\n }\n }\n}\nObject.defineProperties(ReadableStreamDefaultController.prototype, {\n close: { enumerable: true },\n enqueue: { enumerable: true },\n error: { enumerable: true },\n desiredSize: { enumerable: true }\n});\nif (typeof SymbolPolyfill.toStringTag === 'symbol') {\n Object.defineProperty(ReadableStreamDefaultController.prototype, SymbolPolyfill.toStringTag, {\n value: 'ReadableStreamDefaultController',\n configurable: true\n });\n}\n// Abstract operations for the ReadableStreamDefaultController.\nfunction IsReadableStreamDefaultController(x) {\n if (!typeIsObject(x)) {\n return false;\n }\n if (!Object.prototype.hasOwnProperty.call(x, '_controlledReadableStream')) {\n return false;\n }\n return true;\n}\nfunction ReadableStreamDefaultControllerCallPullIfNeeded(controller) {\n const shouldPull = ReadableStreamDefaultControllerShouldCallPull(controller);\n if (!shouldPull) {\n return;\n }\n if (controller._pulling) {\n controller._pullAgain = true;\n return;\n }\n controller._pulling = true;\n const pullPromise = controller._pullAlgorithm();\n uponPromise(pullPromise, () => {\n controller._pulling = false;\n if (controller._pullAgain) {\n controller._pullAgain = false;\n ReadableStreamDefaultControllerCallPullIfNeeded(controller);\n }\n }, e => {\n ReadableStreamDefaultControllerError(controller, e);\n });\n}\nfunction ReadableStreamDefaultControllerShouldCallPull(controller) {\n const stream = controller._controlledReadableStream;\n if (!ReadableStreamDefaultControllerCanCloseOrEnqueue(controller)) {\n return false;\n }\n if (!controller._started) {\n return false;\n }\n if (IsReadableStreamLocked(stream) && ReadableStreamGetNumReadRequests(stream) > 0) {\n return true;\n }\n const desiredSize = ReadableStreamDefaultControllerGetDesiredSize(controller);\n if (desiredSize > 0) {\n return true;\n }\n return false;\n}\nfunction ReadableStreamDefaultControllerClearAlgorithms(controller) {\n controller._pullAlgorithm = undefined;\n controller._cancelAlgorithm = undefined;\n controller._strategySizeAlgorithm = undefined;\n}\n// A client of ReadableStreamDefaultController may use these functions directly to bypass state check.\nfunction ReadableStreamDefaultControllerClose(controller) {\n if (!ReadableStreamDefaultControllerCanCloseOrEnqueue(controller)) {\n return;\n }\n const stream = controller._controlledReadableStream;\n controller._closeRequested = true;\n if (controller._queue.length === 0) {\n ReadableStreamDefaultControllerClearAlgorithms(controller);\n ReadableStreamClose(stream);\n }\n}\nfunction ReadableStreamDefaultControllerEnqueue(controller, chunk) {\n if (!ReadableStreamDefaultControllerCanCloseOrEnqueue(controller)) {\n return;\n }\n const stream = controller._controlledReadableStream;\n if (IsReadableStreamLocked(stream) && ReadableStreamGetNumReadRequests(stream) > 0) {\n ReadableStreamFulfillReadRequest(stream, chunk, false);\n }\n else {\n let chunkSize;\n try {\n chunkSize = controller._strategySizeAlgorithm(chunk);\n }\n catch (chunkSizeE) {\n ReadableStreamDefaultControllerError(controller, chunkSizeE);\n throw chunkSizeE;\n }\n try {\n EnqueueValueWithSize(controller, chunk, chunkSize);\n }\n catch (enqueueE) {\n ReadableStreamDefaultControllerError(controller, enqueueE);\n throw enqueueE;\n }\n }\n ReadableStreamDefaultControllerCallPullIfNeeded(controller);\n}\nfunction ReadableStreamDefaultControllerError(controller, e) {\n const stream = controller._controlledReadableStream;\n if (stream._state !== 'readable') {\n return;\n }\n ResetQueue(controller);\n ReadableStreamDefaultControllerClearAlgorithms(controller);\n ReadableStreamError(stream, e);\n}\nfunction ReadableStreamDefaultControllerGetDesiredSize(controller) {\n const state = controller._controlledReadableStream._state;\n if (state === 'errored') {\n return null;\n }\n if (state === 'closed') {\n return 0;\n }\n return controller._strategyHWM - controller._queueTotalSize;\n}\n// This is used in the implementation of TransformStream.\nfunction ReadableStreamDefaultControllerHasBackpressure(controller) {\n if (ReadableStreamDefaultControllerShouldCallPull(controller)) {\n return false;\n }\n return true;\n}\nfunction ReadableStreamDefaultControllerCanCloseOrEnqueue(controller) {\n const state = controller._controlledReadableStream._state;\n if (!controller._closeRequested && state === 'readable') {\n return true;\n }\n return false;\n}\nfunction SetUpReadableStreamDefaultController(stream, controller, startAlgorithm, pullAlgorithm, cancelAlgorithm, highWaterMark, sizeAlgorithm) {\n controller._controlledReadableStream = stream;\n controller._queue = undefined;\n controller._queueTotalSize = undefined;\n ResetQueue(controller);\n controller._started = false;\n controller._closeRequested = false;\n controller._pullAgain = false;\n controller._pulling = false;\n controller._strategySizeAlgorithm = sizeAlgorithm;\n controller._strategyHWM = highWaterMark;\n controller._pullAlgorithm = pullAlgorithm;\n controller._cancelAlgorithm = cancelAlgorithm;\n stream._readableStreamController = controller;\n const startResult = startAlgorithm();\n uponPromise(promiseResolvedWith(startResult), () => {\n controller._started = true;\n ReadableStreamDefaultControllerCallPullIfNeeded(controller);\n }, r => {\n ReadableStreamDefaultControllerError(controller, r);\n });\n}\nfunction SetUpReadableStreamDefaultControllerFromUnderlyingSource(stream, underlyingSource, highWaterMark, sizeAlgorithm) {\n const controller = Object.create(ReadableStreamDefaultController.prototype);\n let startAlgorithm = () => undefined;\n let pullAlgorithm = () => promiseResolvedWith(undefined);\n let cancelAlgorithm = () => promiseResolvedWith(undefined);\n if (underlyingSource.start !== undefined) {\n startAlgorithm = () => underlyingSource.start(controller);\n }\n if (underlyingSource.pull !== undefined) {\n pullAlgorithm = () => underlyingSource.pull(controller);\n }\n if (underlyingSource.cancel !== undefined) {\n cancelAlgorithm = reason => underlyingSource.cancel(reason);\n }\n SetUpReadableStreamDefaultController(stream, controller, startAlgorithm, pullAlgorithm, cancelAlgorithm, highWaterMark, sizeAlgorithm);\n}\n// Helper functions for the ReadableStreamDefaultController.\nfunction defaultControllerBrandCheckException$1(name) {\n return new TypeError(`ReadableStreamDefaultController.prototype.${name} can only be used on a ReadableStreamDefaultController`);\n}\n\nfunction ReadableStreamTee(stream, cloneForBranch2) {\n const reader = AcquireReadableStreamDefaultReader(stream);\n let reading = false;\n let canceled1 = false;\n let canceled2 = false;\n let reason1;\n let reason2;\n let branch1;\n let branch2;\n let resolveCancelPromise;\n const cancelPromise = newPromise(resolve => {\n resolveCancelPromise = resolve;\n });\n function pullAlgorithm() {\n if (reading) {\n return promiseResolvedWith(undefined);\n }\n reading = true;\n const readRequest = {\n _chunkSteps: value => {\n // This needs to be delayed a microtask because it takes at least a microtask to detect errors (using\n // reader._closedPromise below), and we want errors in stream to error both branches immediately. We cannot let\n // successful synchronously-available reads get ahead of asynchronously-available errors.\n queueMicrotask(() => {\n reading = false;\n const value1 = value;\n const value2 = value;\n // There is no way to access the cloning code right now in the reference implementation.\n // If we add one then we'll need an implementation for serializable objects.\n // if (!canceled2 && cloneForBranch2) {\n // value2 = StructuredDeserialize(StructuredSerialize(value2));\n // }\n if (!canceled1) {\n ReadableStreamDefaultControllerEnqueue(branch1._readableStreamController, value1);\n }\n if (!canceled2) {\n ReadableStreamDefaultControllerEnqueue(branch2._readableStreamController, value2);\n }\n });\n },\n _closeSteps: () => {\n reading = false;\n if (!canceled1) {\n ReadableStreamDefaultControllerClose(branch1._readableStreamController);\n }\n if (!canceled2) {\n ReadableStreamDefaultControllerClose(branch2._readableStreamController);\n }\n if (!canceled1 || !canceled2) {\n resolveCancelPromise(undefined);\n }\n },\n _errorSteps: () => {\n reading = false;\n }\n };\n ReadableStreamDefaultReaderRead(reader, readRequest);\n return promiseResolvedWith(undefined);\n }\n function cancel1Algorithm(reason) {\n canceled1 = true;\n reason1 = reason;\n if (canceled2) {\n const compositeReason = CreateArrayFromList([reason1, reason2]);\n const cancelResult = ReadableStreamCancel(stream, compositeReason);\n resolveCancelPromise(cancelResult);\n }\n return cancelPromise;\n }\n function cancel2Algorithm(reason) {\n canceled2 = true;\n reason2 = reason;\n if (canceled1) {\n const compositeReason = CreateArrayFromList([reason1, reason2]);\n const cancelResult = ReadableStreamCancel(stream, compositeReason);\n resolveCancelPromise(cancelResult);\n }\n return cancelPromise;\n }\n function startAlgorithm() {\n // do nothing\n }\n branch1 = CreateReadableStream(startAlgorithm, pullAlgorithm, cancel1Algorithm);\n branch2 = CreateReadableStream(startAlgorithm, pullAlgorithm, cancel2Algorithm);\n uponRejection(reader._closedPromise, (r) => {\n ReadableStreamDefaultControllerError(branch1._readableStreamController, r);\n ReadableStreamDefaultControllerError(branch2._readableStreamController, r);\n if (!canceled1 || !canceled2) {\n resolveCancelPromise(undefined);\n }\n });\n return [branch1, branch2];\n}\n\nfunction convertUnderlyingDefaultOrByteSource(source, context) {\n assertDictionary(source, context);\n const original = source;\n const autoAllocateChunkSize = original === null || original === void 0 ? void 0 : original.autoAllocateChunkSize;\n const cancel = original === null || original === void 0 ? void 0 : original.cancel;\n const pull = original === null || original === void 0 ? void 0 : original.pull;\n const start = original === null || original === void 0 ? void 0 : original.start;\n const type = original === null || original === void 0 ? void 0 : original.type;\n return {\n autoAllocateChunkSize: autoAllocateChunkSize === undefined ?\n undefined :\n convertUnsignedLongLongWithEnforceRange(autoAllocateChunkSize, `${context} has member 'autoAllocateChunkSize' that`),\n cancel: cancel === undefined ?\n undefined :\n convertUnderlyingSourceCancelCallback(cancel, original, `${context} has member 'cancel' that`),\n pull: pull === undefined ?\n undefined :\n convertUnderlyingSourcePullCallback(pull, original, `${context} has member 'pull' that`),\n start: start === undefined ?\n undefined :\n convertUnderlyingSourceStartCallback(start, original, `${context} has member 'start' that`),\n type: type === undefined ? undefined : convertReadableStreamType(type, `${context} has member 'type' that`)\n };\n}\nfunction convertUnderlyingSourceCancelCallback(fn, original, context) {\n assertFunction(fn, context);\n return (reason) => promiseCall(fn, original, [reason]);\n}\nfunction convertUnderlyingSourcePullCallback(fn, original, context) {\n assertFunction(fn, context);\n return (controller) => promiseCall(fn, original, [controller]);\n}\nfunction convertUnderlyingSourceStartCallback(fn, original, context) {\n assertFunction(fn, context);\n return (controller) => reflectCall(fn, original, [controller]);\n}\nfunction convertReadableStreamType(type, context) {\n type = `${type}`;\n if (type !== 'bytes') {\n throw new TypeError(`${context} '${type}' is not a valid enumeration value for ReadableStreamType`);\n }\n return type;\n}\n\nfunction convertReaderOptions(options, context) {\n assertDictionary(options, context);\n const mode = options === null || options === void 0 ? void 0 : options.mode;\n return {\n mode: mode === undefined ? undefined : convertReadableStreamReaderMode(mode, `${context} has member 'mode' that`)\n };\n}\nfunction convertReadableStreamReaderMode(mode, context) {\n mode = `${mode}`;\n if (mode !== 'byob') {\n throw new TypeError(`${context} '${mode}' is not a valid enumeration value for ReadableStreamReaderMode`);\n }\n return mode;\n}\n\nfunction convertIteratorOptions(options, context) {\n assertDictionary(options, context);\n const preventCancel = options === null || options === void 0 ? void 0 : options.preventCancel;\n return { preventCancel: Boolean(preventCancel) };\n}\n\nfunction convertPipeOptions(options, context) {\n assertDictionary(options, context);\n const preventAbort = options === null || options === void 0 ? void 0 : options.preventAbort;\n const preventCancel = options === null || options === void 0 ? void 0 : options.preventCancel;\n const preventClose = options === null || options === void 0 ? void 0 : options.preventClose;\n const signal = options === null || options === void 0 ? void 0 : options.signal;\n if (signal !== undefined) {\n assertAbortSignal(signal, `${context} has member 'signal' that`);\n }\n return {\n preventAbort: Boolean(preventAbort),\n preventCancel: Boolean(preventCancel),\n preventClose: Boolean(preventClose),\n signal\n };\n}\nfunction assertAbortSignal(signal, context) {\n if (!isAbortSignal(signal)) {\n throw new TypeError(`${context} is not an AbortSignal.`);\n }\n}\n\nfunction convertReadableWritablePair(pair, context) {\n assertDictionary(pair, context);\n const readable = pair === null || pair === void 0 ? void 0 : pair.readable;\n assertRequiredField(readable, 'readable', 'ReadableWritablePair');\n assertReadableStream(readable, `${context} has member 'readable' that`);\n const writable = pair === null || pair === void 0 ? void 0 : pair.writable;\n assertRequiredField(writable, 'writable', 'ReadableWritablePair');\n assertWritableStream(writable, `${context} has member 'writable' that`);\n return { readable, writable };\n}\n\n/**\n * A readable stream represents a source of data, from which you can read.\n *\n * @public\n */\nclass ReadableStream {\n constructor(rawUnderlyingSource = {}, rawStrategy = {}) {\n if (rawUnderlyingSource === undefined) {\n rawUnderlyingSource = null;\n }\n else {\n assertObject(rawUnderlyingSource, 'First parameter');\n }\n const strategy = convertQueuingStrategy(rawStrategy, 'Second parameter');\n const underlyingSource = convertUnderlyingDefaultOrByteSource(rawUnderlyingSource, 'First parameter');\n InitializeReadableStream(this);\n if (underlyingSource.type === 'bytes') {\n if (strategy.size !== undefined) {\n throw new RangeError('The strategy for a byte stream cannot have a size function');\n }\n const highWaterMark = ExtractHighWaterMark(strategy, 0);\n SetUpReadableByteStreamControllerFromUnderlyingSource(this, underlyingSource, highWaterMark);\n }\n else {\n const sizeAlgorithm = ExtractSizeAlgorithm(strategy);\n const highWaterMark = ExtractHighWaterMark(strategy, 1);\n SetUpReadableStreamDefaultControllerFromUnderlyingSource(this, underlyingSource, highWaterMark, sizeAlgorithm);\n }\n }\n /**\n * Whether or not the readable stream is locked to a {@link ReadableStreamDefaultReader | reader}.\n */\n get locked() {\n if (!IsReadableStream(this)) {\n throw streamBrandCheckException$1('locked');\n }\n return IsReadableStreamLocked(this);\n }\n /**\n * Cancels the stream, signaling a loss of interest in the stream by a consumer.\n *\n * The supplied `reason` argument will be given to the underlying source's {@link UnderlyingSource.cancel | cancel()}\n * method, which might or might not use it.\n */\n cancel(reason = undefined) {\n if (!IsReadableStream(this)) {\n return promiseRejectedWith(streamBrandCheckException$1('cancel'));\n }\n if (IsReadableStreamLocked(this)) {\n return promiseRejectedWith(new TypeError('Cannot cancel a stream that already has a reader'));\n }\n return ReadableStreamCancel(this, reason);\n }\n getReader(rawOptions = undefined) {\n if (!IsReadableStream(this)) {\n throw streamBrandCheckException$1('getReader');\n }\n const options = convertReaderOptions(rawOptions, 'First parameter');\n if (options.mode === undefined) {\n return AcquireReadableStreamDefaultReader(this);\n }\n return AcquireReadableStreamBYOBReader(this);\n }\n pipeThrough(rawTransform, rawOptions = {}) {\n if (!IsReadableStream(this)) {\n throw streamBrandCheckException$1('pipeThrough');\n }\n assertRequiredArgument(rawTransform, 1, 'pipeThrough');\n const transform = convertReadableWritablePair(rawTransform, 'First parameter');\n const options = convertPipeOptions(rawOptions, 'Second parameter');\n if (IsReadableStreamLocked(this)) {\n throw new TypeError('ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream');\n }\n if (IsWritableStreamLocked(transform.writable)) {\n throw new TypeError('ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream');\n }\n const promise = ReadableStreamPipeTo(this, transform.writable, options.preventClose, options.preventAbort, options.preventCancel, options.signal);\n setPromiseIsHandledToTrue(promise);\n return transform.readable;\n }\n pipeTo(destination, rawOptions = {}) {\n if (!IsReadableStream(this)) {\n return promiseRejectedWith(streamBrandCheckException$1('pipeTo'));\n }\n if (destination === undefined) {\n return promiseRejectedWith(`Parameter 1 is required in 'pipeTo'.`);\n }\n if (!IsWritableStream(destination)) {\n return promiseRejectedWith(new TypeError(`ReadableStream.prototype.pipeTo's first argument must be a WritableStream`));\n }\n let options;\n try {\n options = convertPipeOptions(rawOptions, 'Second parameter');\n }\n catch (e) {\n return promiseRejectedWith(e);\n }\n if (IsReadableStreamLocked(this)) {\n return promiseRejectedWith(new TypeError('ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream'));\n }\n if (IsWritableStreamLocked(destination)) {\n return promiseRejectedWith(new TypeError('ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream'));\n }\n return ReadableStreamPipeTo(this, destination, options.preventClose, options.preventAbort, options.preventCancel, options.signal);\n }\n /**\n * Tees this readable stream, returning a two-element array containing the two resulting branches as\n * new {@link ReadableStream} instances.\n *\n * Teeing a stream will lock it, preventing any other consumer from acquiring a reader.\n * To cancel the stream, cancel both of the resulting branches; a composite cancellation reason will then be\n * propagated to the stream's underlying source.\n *\n * Note that the chunks seen in each branch will be the same object. If the chunks are not immutable,\n * this could allow interference between the two branches.\n */\n tee() {\n if (!IsReadableStream(this)) {\n throw streamBrandCheckException$1('tee');\n }\n const branches = ReadableStreamTee(this);\n return CreateArrayFromList(branches);\n }\n values(rawOptions = undefined) {\n if (!IsReadableStream(this)) {\n throw streamBrandCheckException$1('values');\n }\n const options = convertIteratorOptions(rawOptions, 'First parameter');\n return AcquireReadableStreamAsyncIterator(this, options.preventCancel);\n }\n}\nObject.defineProperties(ReadableStream.prototype, {\n cancel: { enumerable: true },\n getReader: { enumerable: true },\n pipeThrough: { enumerable: true },\n pipeTo: { enumerable: true },\n tee: { enumerable: true },\n values: { enumerable: true },\n locked: { enumerable: true }\n});\nif (typeof SymbolPolyfill.toStringTag === 'symbol') {\n Object.defineProperty(ReadableStream.prototype, SymbolPolyfill.toStringTag, {\n value: 'ReadableStream',\n configurable: true\n });\n}\nif (typeof SymbolPolyfill.asyncIterator === 'symbol') {\n Object.defineProperty(ReadableStream.prototype, SymbolPolyfill.asyncIterator, {\n value: ReadableStream.prototype.values,\n writable: true,\n configurable: true\n });\n}\n// Abstract operations for the ReadableStream.\n// Throws if and only if startAlgorithm throws.\nfunction CreateReadableStream(startAlgorithm, pullAlgorithm, cancelAlgorithm, highWaterMark = 1, sizeAlgorithm = () => 1) {\n const stream = Object.create(ReadableStream.prototype);\n InitializeReadableStream(stream);\n const controller = Object.create(ReadableStreamDefaultController.prototype);\n SetUpReadableStreamDefaultController(stream, controller, startAlgorithm, pullAlgorithm, cancelAlgorithm, highWaterMark, sizeAlgorithm);\n return stream;\n}\nfunction InitializeReadableStream(stream) {\n stream._state = 'readable';\n stream._reader = undefined;\n stream._storedError = undefined;\n stream._disturbed = false;\n}\nfunction IsReadableStream(x) {\n if (!typeIsObject(x)) {\n return false;\n }\n if (!Object.prototype.hasOwnProperty.call(x, '_readableStreamController')) {\n return false;\n }\n return true;\n}\nfunction IsReadableStreamLocked(stream) {\n if (stream._reader === undefined) {\n return false;\n }\n return true;\n}\n// ReadableStream API exposed for controllers.\nfunction ReadableStreamCancel(stream, reason) {\n stream._disturbed = true;\n if (stream._state === 'closed') {\n return promiseResolvedWith(undefined);\n }\n if (stream._state === 'errored') {\n return promiseRejectedWith(stream._storedError);\n }\n ReadableStreamClose(stream);\n const sourceCancelPromise = stream._readableStreamController[CancelSteps](reason);\n return transformPromiseWith(sourceCancelPromise, noop);\n}\nfunction ReadableStreamClose(stream) {\n stream._state = 'closed';\n const reader = stream._reader;\n if (reader === undefined) {\n return;\n }\n defaultReaderClosedPromiseResolve(reader);\n if (IsReadableStreamDefaultReader(reader)) {\n reader._readRequests.forEach(readRequest => {\n readRequest._closeSteps();\n });\n reader._readRequests = new SimpleQueue();\n }\n}\nfunction ReadableStreamError(stream, e) {\n stream._state = 'errored';\n stream._storedError = e;\n const reader = stream._reader;\n if (reader === undefined) {\n return;\n }\n defaultReaderClosedPromiseReject(reader, e);\n if (IsReadableStreamDefaultReader(reader)) {\n reader._readRequests.forEach(readRequest => {\n readRequest._errorSteps(e);\n });\n reader._readRequests = new SimpleQueue();\n }\n else {\n reader._readIntoRequests.forEach(readIntoRequest => {\n readIntoRequest._errorSteps(e);\n });\n reader._readIntoRequests = new SimpleQueue();\n }\n}\n// Helper functions for the ReadableStream.\nfunction streamBrandCheckException$1(name) {\n return new TypeError(`ReadableStream.prototype.${name} can only be used on a ReadableStream`);\n}\n\nfunction convertQueuingStrategyInit(init, context) {\n assertDictionary(init, context);\n const highWaterMark = init === null || init === void 0 ? void 0 : init.highWaterMark;\n assertRequiredField(highWaterMark, 'highWaterMark', 'QueuingStrategyInit');\n return {\n highWaterMark: convertUnrestrictedDouble(highWaterMark)\n };\n}\n\nconst byteLengthSizeFunction = function size(chunk) {\n return chunk.byteLength;\n};\n/**\n * A queuing strategy that counts the number of bytes in each chunk.\n *\n * @public\n */\nclass ByteLengthQueuingStrategy {\n constructor(options) {\n assertRequiredArgument(options, 1, 'ByteLengthQueuingStrategy');\n options = convertQueuingStrategyInit(options, 'First parameter');\n this._byteLengthQueuingStrategyHighWaterMark = options.highWaterMark;\n }\n /**\n * Returns the high water mark provided to the constructor.\n */\n get highWaterMark() {\n if (!IsByteLengthQueuingStrategy(this)) {\n throw byteLengthBrandCheckException('highWaterMark');\n }\n return this._byteLengthQueuingStrategyHighWaterMark;\n }\n /**\n * Measures the size of `chunk` by returning the value of its `byteLength` property.\n */\n get size() {\n if (!IsByteLengthQueuingStrategy(this)) {\n throw byteLengthBrandCheckException('size');\n }\n return byteLengthSizeFunction;\n }\n}\nObject.defineProperties(ByteLengthQueuingStrategy.prototype, {\n highWaterMark: { enumerable: true },\n size: { enumerable: true }\n});\nif (typeof SymbolPolyfill.toStringTag === 'symbol') {\n Object.defineProperty(ByteLengthQueuingStrategy.prototype, SymbolPolyfill.toStringTag, {\n value: 'ByteLengthQueuingStrategy',\n configurable: true\n });\n}\n// Helper functions for the ByteLengthQueuingStrategy.\nfunction byteLengthBrandCheckException(name) {\n return new TypeError(`ByteLengthQueuingStrategy.prototype.${name} can only be used on a ByteLengthQueuingStrategy`);\n}\nfunction IsByteLengthQueuingStrategy(x) {\n if (!typeIsObject(x)) {\n return false;\n }\n if (!Object.prototype.hasOwnProperty.call(x, '_byteLengthQueuingStrategyHighWaterMark')) {\n return false;\n }\n return true;\n}\n\nconst countSizeFunction = function size() {\n return 1;\n};\n/**\n * A queuing strategy that counts the number of chunks.\n *\n * @public\n */\nclass CountQueuingStrategy {\n constructor(options) {\n assertRequiredArgument(options, 1, 'CountQueuingStrategy');\n options = convertQueuingStrategyInit(options, 'First parameter');\n this._countQueuingStrategyHighWaterMark = options.highWaterMark;\n }\n /**\n * Returns the high water mark provided to the constructor.\n */\n get highWaterMark() {\n if (!IsCountQueuingStrategy(this)) {\n throw countBrandCheckException('highWaterMark');\n }\n return this._countQueuingStrategyHighWaterMark;\n }\n /**\n * Measures the size of `chunk` by always returning 1.\n * This ensures that the total queue size is a count of the number of chunks in the queue.\n */\n get size() {\n if (!IsCountQueuingStrategy(this)) {\n throw countBrandCheckException('size');\n }\n return countSizeFunction;\n }\n}\nObject.defineProperties(CountQueuingStrategy.prototype, {\n highWaterMark: { enumerable: true },\n size: { enumerable: true }\n});\nif (typeof SymbolPolyfill.toStringTag === 'symbol') {\n Object.defineProperty(CountQueuingStrategy.prototype, SymbolPolyfill.toStringTag, {\n value: 'CountQueuingStrategy',\n configurable: true\n });\n}\n// Helper functions for the CountQueuingStrategy.\nfunction countBrandCheckException(name) {\n return new TypeError(`CountQueuingStrategy.prototype.${name} can only be used on a CountQueuingStrategy`);\n}\nfunction IsCountQueuingStrategy(x) {\n if (!typeIsObject(x)) {\n return false;\n }\n if (!Object.prototype.hasOwnProperty.call(x, '_countQueuingStrategyHighWaterMark')) {\n return false;\n }\n return true;\n}\n\nfunction convertTransformer(original, context) {\n assertDictionary(original, context);\n const flush = original === null || original === void 0 ? void 0 : original.flush;\n const readableType = original === null || original === void 0 ? void 0 : original.readableType;\n const start = original === null || original === void 0 ? void 0 : original.start;\n const transform = original === null || original === void 0 ? void 0 : original.transform;\n const writableType = original === null || original === void 0 ? void 0 : original.writableType;\n return {\n flush: flush === undefined ?\n undefined :\n convertTransformerFlushCallback(flush, original, `${context} has member 'flush' that`),\n readableType,\n start: start === undefined ?\n undefined :\n convertTransformerStartCallback(start, original, `${context} has member 'start' that`),\n transform: transform === undefined ?\n undefined :\n convertTransformerTransformCallback(transform, original, `${context} has member 'transform' that`),\n writableType\n };\n}\nfunction convertTransformerFlushCallback(fn, original, context) {\n assertFunction(fn, context);\n return (controller) => promiseCall(fn, original, [controller]);\n}\nfunction convertTransformerStartCallback(fn, original, context) {\n assertFunction(fn, context);\n return (controller) => reflectCall(fn, original, [controller]);\n}\nfunction convertTransformerTransformCallback(fn, original, context) {\n assertFunction(fn, context);\n return (chunk, controller) => promiseCall(fn, original, [chunk, controller]);\n}\n\n// Class TransformStream\n/**\n * A transform stream consists of a pair of streams: a {@link WritableStream | writable stream},\n * known as its writable side, and a {@link ReadableStream | readable stream}, known as its readable side.\n * In a manner specific to the transform stream in question, writes to the writable side result in new data being\n * made available for reading from the readable side.\n *\n * @public\n */\nclass TransformStream {\n constructor(rawTransformer = {}, rawWritableStrategy = {}, rawReadableStrategy = {}) {\n if (rawTransformer === undefined) {\n rawTransformer = null;\n }\n const writableStrategy = convertQueuingStrategy(rawWritableStrategy, 'Second parameter');\n const readableStrategy = convertQueuingStrategy(rawReadableStrategy, 'Third parameter');\n const transformer = convertTransformer(rawTransformer, 'First parameter');\n if (transformer.readableType !== undefined) {\n throw new RangeError('Invalid readableType specified');\n }\n if (transformer.writableType !== undefined) {\n throw new RangeError('Invalid writableType specified');\n }\n const readableHighWaterMark = ExtractHighWaterMark(readableStrategy, 0);\n const readableSizeAlgorithm = ExtractSizeAlgorithm(readableStrategy);\n const writableHighWaterMark = ExtractHighWaterMark(writableStrategy, 1);\n const writableSizeAlgorithm = ExtractSizeAlgorithm(writableStrategy);\n let startPromise_resolve;\n const startPromise = newPromise(resolve => {\n startPromise_resolve = resolve;\n });\n InitializeTransformStream(this, startPromise, writableHighWaterMark, writableSizeAlgorithm, readableHighWaterMark, readableSizeAlgorithm);\n SetUpTransformStreamDefaultControllerFromTransformer(this, transformer);\n if (transformer.start !== undefined) {\n startPromise_resolve(transformer.start(this._transformStreamController));\n }\n else {\n startPromise_resolve(undefined);\n }\n }\n /**\n * The readable side of the transform stream.\n */\n get readable() {\n if (!IsTransformStream(this)) {\n throw streamBrandCheckException('readable');\n }\n return this._readable;\n }\n /**\n * The writable side of the transform stream.\n */\n get writable() {\n if (!IsTransformStream(this)) {\n throw streamBrandCheckException('writable');\n }\n return this._writable;\n }\n}\nObject.defineProperties(TransformStream.prototype, {\n readable: { enumerable: true },\n writable: { enumerable: true }\n});\nif (typeof SymbolPolyfill.toStringTag === 'symbol') {\n Object.defineProperty(TransformStream.prototype, SymbolPolyfill.toStringTag, {\n value: 'TransformStream',\n configurable: true\n });\n}\nfunction InitializeTransformStream(stream, startPromise, writableHighWaterMark, writableSizeAlgorithm, readableHighWaterMark, readableSizeAlgorithm) {\n function startAlgorithm() {\n return startPromise;\n }\n function writeAlgorithm(chunk) {\n return TransformStreamDefaultSinkWriteAlgorithm(stream, chunk);\n }\n function abortAlgorithm(reason) {\n return TransformStreamDefaultSinkAbortAlgorithm(stream, reason);\n }\n function closeAlgorithm() {\n return TransformStreamDefaultSinkCloseAlgorithm(stream);\n }\n stream._writable = CreateWritableStream(startAlgorithm, writeAlgorithm, closeAlgorithm, abortAlgorithm, writableHighWaterMark, writableSizeAlgorithm);\n function pullAlgorithm() {\n return TransformStreamDefaultSourcePullAlgorithm(stream);\n }\n function cancelAlgorithm(reason) {\n TransformStreamErrorWritableAndUnblockWrite(stream, reason);\n return promiseResolvedWith(undefined);\n }\n stream._readable = CreateReadableStream(startAlgorithm, pullAlgorithm, cancelAlgorithm, readableHighWaterMark, readableSizeAlgorithm);\n // The [[backpressure]] slot is set to undefined so that it can be initialised by TransformStreamSetBackpressure.\n stream._backpressure = undefined;\n stream._backpressureChangePromise = undefined;\n stream._backpressureChangePromise_resolve = undefined;\n TransformStreamSetBackpressure(stream, true);\n stream._transformStreamController = undefined;\n}\nfunction IsTransformStream(x) {\n if (!typeIsObject(x)) {\n return false;\n }\n if (!Object.prototype.hasOwnProperty.call(x, '_transformStreamController')) {\n return false;\n }\n return true;\n}\n// This is a no-op if both sides are already errored.\nfunction TransformStreamError(stream, e) {\n ReadableStreamDefaultControllerError(stream._readable._readableStreamController, e);\n TransformStreamErrorWritableAndUnblockWrite(stream, e);\n}\nfunction TransformStreamErrorWritableAndUnblockWrite(stream, e) {\n TransformStreamDefaultControllerClearAlgorithms(stream._transformStreamController);\n WritableStreamDefaultControllerErrorIfNeeded(stream._writable._writableStreamController, e);\n if (stream._backpressure) {\n // Pretend that pull() was called to permit any pending write() calls to complete. TransformStreamSetBackpressure()\n // cannot be called from enqueue() or pull() once the ReadableStream is errored, so this will will be the final time\n // _backpressure is set.\n TransformStreamSetBackpressure(stream, false);\n }\n}\nfunction TransformStreamSetBackpressure(stream, backpressure) {\n // Passes also when called during construction.\n if (stream._backpressureChangePromise !== undefined) {\n stream._backpressureChangePromise_resolve();\n }\n stream._backpressureChangePromise = newPromise(resolve => {\n stream._backpressureChangePromise_resolve = resolve;\n });\n stream._backpressure = backpressure;\n}\n// Class TransformStreamDefaultController\n/**\n * Allows control of the {@link ReadableStream} and {@link WritableStream} of the associated {@link TransformStream}.\n *\n * @public\n */\nclass TransformStreamDefaultController {\n constructor() {\n throw new TypeError('Illegal constructor');\n }\n /**\n * Returns the desired size to fill the readable side’s internal queue. It can be negative, if the queue is over-full.\n */\n get desiredSize() {\n if (!IsTransformStreamDefaultController(this)) {\n throw defaultControllerBrandCheckException('desiredSize');\n }\n const readableController = this._controlledTransformStream._readable._readableStreamController;\n return ReadableStreamDefaultControllerGetDesiredSize(readableController);\n }\n enqueue(chunk = undefined) {\n if (!IsTransformStreamDefaultController(this)) {\n throw defaultControllerBrandCheckException('enqueue');\n }\n TransformStreamDefaultControllerEnqueue(this, chunk);\n }\n /**\n * Errors both the readable side and the writable side of the controlled transform stream, making all future\n * interactions with it fail with the given error `e`. Any chunks queued for transformation will be discarded.\n */\n error(reason = undefined) {\n if (!IsTransformStreamDefaultController(this)) {\n throw defaultControllerBrandCheckException('error');\n }\n TransformStreamDefaultControllerError(this, reason);\n }\n /**\n * Closes the readable side and errors the writable side of the controlled transform stream. This is useful when the\n * transformer only needs to consume a portion of the chunks written to the writable side.\n */\n terminate() {\n if (!IsTransformStreamDefaultController(this)) {\n throw defaultControllerBrandCheckException('terminate');\n }\n TransformStreamDefaultControllerTerminate(this);\n }\n}\nObject.defineProperties(TransformStreamDefaultController.prototype, {\n enqueue: { enumerable: true },\n error: { enumerable: true },\n terminate: { enumerable: true },\n desiredSize: { enumerable: true }\n});\nif (typeof SymbolPolyfill.toStringTag === 'symbol') {\n Object.defineProperty(TransformStreamDefaultController.prototype, SymbolPolyfill.toStringTag, {\n value: 'TransformStreamDefaultController',\n configurable: true\n });\n}\n// Transform Stream Default Controller Abstract Operations\nfunction IsTransformStreamDefaultController(x) {\n if (!typeIsObject(x)) {\n return false;\n }\n if (!Object.prototype.hasOwnProperty.call(x, '_controlledTransformStream')) {\n return false;\n }\n return true;\n}\nfunction SetUpTransformStreamDefaultController(stream, controller, transformAlgorithm, flushAlgorithm) {\n controller._controlledTransformStream = stream;\n stream._transformStreamController = controller;\n controller._transformAlgorithm = transformAlgorithm;\n controller._flushAlgorithm = flushAlgorithm;\n}\nfunction SetUpTransformStreamDefaultControllerFromTransformer(stream, transformer) {\n const controller = Object.create(TransformStreamDefaultController.prototype);\n let transformAlgorithm = (chunk) => {\n try {\n TransformStreamDefaultControllerEnqueue(controller, chunk);\n return promiseResolvedWith(undefined);\n }\n catch (transformResultE) {\n return promiseRejectedWith(transformResultE);\n }\n };\n let flushAlgorithm = () => promiseResolvedWith(undefined);\n if (transformer.transform !== undefined) {\n transformAlgorithm = chunk => transformer.transform(chunk, controller);\n }\n if (transformer.flush !== undefined) {\n flushAlgorithm = () => transformer.flush(controller);\n }\n SetUpTransformStreamDefaultController(stream, controller, transformAlgorithm, flushAlgorithm);\n}\nfunction TransformStreamDefaultControllerClearAlgorithms(controller) {\n controller._transformAlgorithm = undefined;\n controller._flushAlgorithm = undefined;\n}\nfunction TransformStreamDefaultControllerEnqueue(controller, chunk) {\n const stream = controller._controlledTransformStream;\n const readableController = stream._readable._readableStreamController;\n if (!ReadableStreamDefaultControllerCanCloseOrEnqueue(readableController)) {\n throw new TypeError('Readable side is not in a state that permits enqueue');\n }\n // We throttle transform invocations based on the backpressure of the ReadableStream, but we still\n // accept TransformStreamDefaultControllerEnqueue() calls.\n try {\n ReadableStreamDefaultControllerEnqueue(readableController, chunk);\n }\n catch (e) {\n // This happens when readableStrategy.size() throws.\n TransformStreamErrorWritableAndUnblockWrite(stream, e);\n throw stream._readable._storedError;\n }\n const backpressure = ReadableStreamDefaultControllerHasBackpressure(readableController);\n if (backpressure !== stream._backpressure) {\n TransformStreamSetBackpressure(stream, true);\n }\n}\nfunction TransformStreamDefaultControllerError(controller, e) {\n TransformStreamError(controller._controlledTransformStream, e);\n}\nfunction TransformStreamDefaultControllerPerformTransform(controller, chunk) {\n const transformPromise = controller._transformAlgorithm(chunk);\n return transformPromiseWith(transformPromise, undefined, r => {\n TransformStreamError(controller._controlledTransformStream, r);\n throw r;\n });\n}\nfunction TransformStreamDefaultControllerTerminate(controller) {\n const stream = controller._controlledTransformStream;\n const readableController = stream._readable._readableStreamController;\n ReadableStreamDefaultControllerClose(readableController);\n const error = new TypeError('TransformStream terminated');\n TransformStreamErrorWritableAndUnblockWrite(stream, error);\n}\n// TransformStreamDefaultSink Algorithms\nfunction TransformStreamDefaultSinkWriteAlgorithm(stream, chunk) {\n const controller = stream._transformStreamController;\n if (stream._backpressure) {\n const backpressureChangePromise = stream._backpressureChangePromise;\n return transformPromiseWith(backpressureChangePromise, () => {\n const writable = stream._writable;\n const state = writable._state;\n if (state === 'erroring') {\n throw writable._storedError;\n }\n return TransformStreamDefaultControllerPerformTransform(controller, chunk);\n });\n }\n return TransformStreamDefaultControllerPerformTransform(controller, chunk);\n}\nfunction TransformStreamDefaultSinkAbortAlgorithm(stream, reason) {\n // abort() is not called synchronously, so it is possible for abort() to be called when the stream is already\n // errored.\n TransformStreamError(stream, reason);\n return promiseResolvedWith(undefined);\n}\nfunction TransformStreamDefaultSinkCloseAlgorithm(stream) {\n // stream._readable cannot change after construction, so caching it across a call to user code is safe.\n const readable = stream._readable;\n const controller = stream._transformStreamController;\n const flushPromise = controller._flushAlgorithm();\n TransformStreamDefaultControllerClearAlgorithms(controller);\n // Return a promise that is fulfilled with undefined on success.\n return transformPromiseWith(flushPromise, () => {\n if (readable._state === 'errored') {\n throw readable._storedError;\n }\n ReadableStreamDefaultControllerClose(readable._readableStreamController);\n }, r => {\n TransformStreamError(stream, r);\n throw readable._storedError;\n });\n}\n// TransformStreamDefaultSource Algorithms\nfunction TransformStreamDefaultSourcePullAlgorithm(stream) {\n // Invariant. Enforced by the promises returned by start() and pull().\n TransformStreamSetBackpressure(stream, false);\n // Prevent the next pull() call until there is backpressure.\n return stream._backpressureChangePromise;\n}\n// Helper functions for the TransformStreamDefaultController.\nfunction defaultControllerBrandCheckException(name) {\n return new TypeError(`TransformStreamDefaultController.prototype.${name} can only be used on a TransformStreamDefaultController`);\n}\n// Helper functions for the TransformStream.\nfunction streamBrandCheckException(name) {\n return new TypeError(`TransformStream.prototype.${name} can only be used on a TransformStream`);\n}\n\nexport { ByteLengthQueuingStrategy, CountQueuingStrategy, ReadableByteStreamController, ReadableStream, ReadableStreamBYOBReader, ReadableStreamBYOBRequest, ReadableStreamDefaultController, ReadableStreamDefaultReader, TransformStream, TransformStreamDefaultController, WritableStream, WritableStreamDefaultController, WritableStreamDefaultWriter };\n//# sourceMappingURL=ponyfill.es6.mjs.map\n","/*! *****************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nfunction __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nfunction assert(test) {\n if (!test) {\n throw new TypeError('Assertion failed');\n }\n}\n\nfunction noop() {\n return;\n}\nfunction typeIsObject(x) {\n return (typeof x === 'object' && x !== null) || typeof x === 'function';\n}\n\nfunction isStreamConstructor(ctor) {\n if (typeof ctor !== 'function') {\n return false;\n }\n var startCalled = false;\n try {\n new ctor({\n start: function () {\n startCalled = true;\n }\n });\n }\n catch (e) {\n // ignore\n }\n return startCalled;\n}\nfunction isReadableStream(readable) {\n if (!typeIsObject(readable)) {\n return false;\n }\n if (typeof readable.getReader !== 'function') {\n return false;\n }\n return true;\n}\nfunction isReadableStreamConstructor(ctor) {\n if (!isStreamConstructor(ctor)) {\n return false;\n }\n if (!isReadableStream(new ctor())) {\n return false;\n }\n return true;\n}\nfunction isWritableStream(writable) {\n if (!typeIsObject(writable)) {\n return false;\n }\n if (typeof writable.getWriter !== 'function') {\n return false;\n }\n return true;\n}\nfunction isWritableStreamConstructor(ctor) {\n if (!isStreamConstructor(ctor)) {\n return false;\n }\n if (!isWritableStream(new ctor())) {\n return false;\n }\n return true;\n}\nfunction isTransformStream(transform) {\n if (!typeIsObject(transform)) {\n return false;\n }\n if (!isReadableStream(transform.readable)) {\n return false;\n }\n if (!isWritableStream(transform.writable)) {\n return false;\n }\n return true;\n}\nfunction isTransformStreamConstructor(ctor) {\n if (!isStreamConstructor(ctor)) {\n return false;\n }\n if (!isTransformStream(new ctor())) {\n return false;\n }\n return true;\n}\nfunction supportsByobReader(readable) {\n try {\n var reader = readable.getReader({ mode: 'byob' });\n reader.releaseLock();\n return true;\n }\n catch (_a) {\n return false;\n }\n}\nfunction supportsByteSource(ctor) {\n try {\n new ctor({ type: 'bytes' });\n return true;\n }\n catch (_a) {\n return false;\n }\n}\n\nfunction createReadableStreamWrapper(ctor) {\n assert(isReadableStreamConstructor(ctor));\n var byteSourceSupported = supportsByteSource(ctor);\n return function (readable, _a) {\n var _b = _a === void 0 ? {} : _a, type = _b.type;\n type = parseReadableType(type);\n if (type === 'bytes' && !byteSourceSupported) {\n type = undefined;\n }\n if (readable.constructor === ctor) {\n if (type !== 'bytes' || supportsByobReader(readable)) {\n return readable;\n }\n }\n if (type === 'bytes') {\n var source = createWrappingReadableSource(readable, { type: type });\n return new ctor(source);\n }\n else {\n var source = createWrappingReadableSource(readable);\n return new ctor(source);\n }\n };\n}\nfunction createWrappingReadableSource(readable, _a) {\n var _b = _a === void 0 ? {} : _a, type = _b.type;\n assert(isReadableStream(readable));\n assert(readable.locked === false);\n type = parseReadableType(type);\n var source;\n if (type === 'bytes') {\n source = new WrappingReadableByteStreamSource(readable);\n }\n else {\n source = new WrappingReadableStreamDefaultSource(readable);\n }\n return source;\n}\nfunction parseReadableType(type) {\n var typeString = String(type);\n if (typeString === 'bytes') {\n return typeString;\n }\n else if (type === undefined) {\n return type;\n }\n else {\n throw new RangeError('Invalid type is specified');\n }\n}\nvar AbstractWrappingReadableStreamSource = /** @class */ (function () {\n function AbstractWrappingReadableStreamSource(underlyingStream) {\n this._underlyingReader = undefined;\n this._readerMode = undefined;\n this._readableStreamController = undefined;\n this._pendingRead = undefined;\n this._underlyingStream = underlyingStream;\n // always keep a reader attached to detect close/error\n this._attachDefaultReader();\n }\n AbstractWrappingReadableStreamSource.prototype.start = function (controller) {\n this._readableStreamController = controller;\n };\n AbstractWrappingReadableStreamSource.prototype.cancel = function (reason) {\n assert(this._underlyingReader !== undefined);\n return this._underlyingReader.cancel(reason);\n };\n AbstractWrappingReadableStreamSource.prototype._attachDefaultReader = function () {\n if (this._readerMode === \"default\" /* DEFAULT */) {\n return;\n }\n this._detachReader();\n var reader = this._underlyingStream.getReader();\n this._readerMode = \"default\" /* DEFAULT */;\n this._attachReader(reader);\n };\n AbstractWrappingReadableStreamSource.prototype._attachReader = function (reader) {\n var _this = this;\n assert(this._underlyingReader === undefined);\n this._underlyingReader = reader;\n var closed = this._underlyingReader.closed;\n if (!closed) {\n return;\n }\n closed\n .then(function () { return _this._finishPendingRead(); })\n .then(function () {\n if (reader === _this._underlyingReader) {\n _this._readableStreamController.close();\n }\n }, function (reason) {\n if (reader === _this._underlyingReader) {\n _this._readableStreamController.error(reason);\n }\n })\n .catch(noop);\n };\n AbstractWrappingReadableStreamSource.prototype._detachReader = function () {\n if (this._underlyingReader === undefined) {\n return;\n }\n this._underlyingReader.releaseLock();\n this._underlyingReader = undefined;\n this._readerMode = undefined;\n };\n AbstractWrappingReadableStreamSource.prototype._pullWithDefaultReader = function () {\n var _this = this;\n this._attachDefaultReader();\n // TODO Backpressure?\n var read = this._underlyingReader.read()\n .then(function (result) {\n var controller = _this._readableStreamController;\n if (result.done) {\n _this._tryClose();\n }\n else {\n controller.enqueue(result.value);\n }\n });\n this._setPendingRead(read);\n return read;\n };\n AbstractWrappingReadableStreamSource.prototype._tryClose = function () {\n try {\n this._readableStreamController.close();\n }\n catch (_a) {\n // already errored or closed\n }\n };\n AbstractWrappingReadableStreamSource.prototype._setPendingRead = function (readPromise) {\n var _this = this;\n var pendingRead;\n var finishRead = function () {\n if (_this._pendingRead === pendingRead) {\n _this._pendingRead = undefined;\n }\n };\n this._pendingRead = pendingRead = readPromise.then(finishRead, finishRead);\n };\n AbstractWrappingReadableStreamSource.prototype._finishPendingRead = function () {\n var _this = this;\n if (!this._pendingRead) {\n return undefined;\n }\n var afterRead = function () { return _this._finishPendingRead(); };\n return this._pendingRead.then(afterRead, afterRead);\n };\n return AbstractWrappingReadableStreamSource;\n}());\nvar WrappingReadableStreamDefaultSource = /** @class */ (function (_super) {\n __extends(WrappingReadableStreamDefaultSource, _super);\n function WrappingReadableStreamDefaultSource() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n WrappingReadableStreamDefaultSource.prototype.pull = function () {\n return this._pullWithDefaultReader();\n };\n return WrappingReadableStreamDefaultSource;\n}(AbstractWrappingReadableStreamSource));\nfunction toUint8Array(view) {\n return new Uint8Array(view.buffer, view.byteOffset, view.byteLength);\n}\nfunction copyArrayBufferView(from, to) {\n var fromArray = toUint8Array(from);\n var toArray = toUint8Array(to);\n toArray.set(fromArray, 0);\n}\nvar WrappingReadableByteStreamSource = /** @class */ (function (_super) {\n __extends(WrappingReadableByteStreamSource, _super);\n function WrappingReadableByteStreamSource(underlyingStream) {\n var _this = this;\n var supportsByob = supportsByobReader(underlyingStream);\n _this = _super.call(this, underlyingStream) || this;\n _this._supportsByob = supportsByob;\n return _this;\n }\n Object.defineProperty(WrappingReadableByteStreamSource.prototype, \"type\", {\n get: function () {\n return 'bytes';\n },\n enumerable: false,\n configurable: true\n });\n WrappingReadableByteStreamSource.prototype._attachByobReader = function () {\n if (this._readerMode === \"byob\" /* BYOB */) {\n return;\n }\n assert(this._supportsByob);\n this._detachReader();\n var reader = this._underlyingStream.getReader({ mode: 'byob' });\n this._readerMode = \"byob\" /* BYOB */;\n this._attachReader(reader);\n };\n WrappingReadableByteStreamSource.prototype.pull = function () {\n if (this._supportsByob) {\n var byobRequest = this._readableStreamController.byobRequest;\n if (byobRequest) {\n return this._pullWithByobRequest(byobRequest);\n }\n }\n return this._pullWithDefaultReader();\n };\n WrappingReadableByteStreamSource.prototype._pullWithByobRequest = function (byobRequest) {\n var _this = this;\n this._attachByobReader();\n // reader.read(view) detaches the input view, therefore we cannot pass byobRequest.view directly\n // create a separate buffer to read into, then copy that to byobRequest.view\n var buffer = new Uint8Array(byobRequest.view.byteLength);\n // TODO Backpressure?\n var read = this._underlyingReader.read(buffer)\n .then(function (result) {\n _this._readableStreamController;\n if (result.done) {\n _this._tryClose();\n byobRequest.respond(0);\n }\n else {\n copyArrayBufferView(result.value, byobRequest.view);\n byobRequest.respond(result.value.byteLength);\n }\n });\n this._setPendingRead(read);\n return read;\n };\n return WrappingReadableByteStreamSource;\n}(AbstractWrappingReadableStreamSource));\n\nfunction createWritableStreamWrapper(ctor) {\n assert(isWritableStreamConstructor(ctor));\n return function (writable) {\n if (writable.constructor === ctor) {\n return writable;\n }\n var sink = createWrappingWritableSink(writable);\n return new ctor(sink);\n };\n}\nfunction createWrappingWritableSink(writable) {\n assert(isWritableStream(writable));\n assert(writable.locked === false);\n var writer = writable.getWriter();\n return new WrappingWritableStreamSink(writer);\n}\nvar WrappingWritableStreamSink = /** @class */ (function () {\n function WrappingWritableStreamSink(underlyingWriter) {\n var _this = this;\n this._writableStreamController = undefined;\n this._pendingWrite = undefined;\n this._state = \"writable\" /* WRITABLE */;\n this._storedError = undefined;\n this._underlyingWriter = underlyingWriter;\n this._errorPromise = new Promise(function (resolve, reject) {\n _this._errorPromiseReject = reject;\n });\n this._errorPromise.catch(noop);\n }\n WrappingWritableStreamSink.prototype.start = function (controller) {\n var _this = this;\n this._writableStreamController = controller;\n this._underlyingWriter.closed\n .then(function () {\n _this._state = \"closed\" /* CLOSED */;\n })\n .catch(function (reason) { return _this._finishErroring(reason); });\n };\n WrappingWritableStreamSink.prototype.write = function (chunk) {\n var _this = this;\n var writer = this._underlyingWriter;\n // Detect past errors\n if (writer.desiredSize === null) {\n return writer.ready;\n }\n var writeRequest = writer.write(chunk);\n // Detect future errors\n writeRequest.catch(function (reason) { return _this._finishErroring(reason); });\n writer.ready.catch(function (reason) { return _this._startErroring(reason); });\n // Reject write when errored\n var write = Promise.race([writeRequest, this._errorPromise]);\n this._setPendingWrite(write);\n return write;\n };\n WrappingWritableStreamSink.prototype.close = function () {\n var _this = this;\n if (this._pendingWrite === undefined) {\n return this._underlyingWriter.close();\n }\n return this._finishPendingWrite().then(function () { return _this.close(); });\n };\n WrappingWritableStreamSink.prototype.abort = function (reason) {\n if (this._state === \"errored\" /* ERRORED */) {\n return undefined;\n }\n var writer = this._underlyingWriter;\n return writer.abort(reason);\n };\n WrappingWritableStreamSink.prototype._setPendingWrite = function (writePromise) {\n var _this = this;\n var pendingWrite;\n var finishWrite = function () {\n if (_this._pendingWrite === pendingWrite) {\n _this._pendingWrite = undefined;\n }\n };\n this._pendingWrite = pendingWrite = writePromise.then(finishWrite, finishWrite);\n };\n WrappingWritableStreamSink.prototype._finishPendingWrite = function () {\n var _this = this;\n if (this._pendingWrite === undefined) {\n return Promise.resolve();\n }\n var afterWrite = function () { return _this._finishPendingWrite(); };\n return this._pendingWrite.then(afterWrite, afterWrite);\n };\n WrappingWritableStreamSink.prototype._startErroring = function (reason) {\n var _this = this;\n if (this._state === \"writable\" /* WRITABLE */) {\n this._state = \"erroring\" /* ERRORING */;\n this._storedError = reason;\n var afterWrite = function () { return _this._finishErroring(reason); };\n if (this._pendingWrite === undefined) {\n afterWrite();\n }\n else {\n this._finishPendingWrite().then(afterWrite, afterWrite);\n }\n this._writableStreamController.error(reason);\n }\n };\n WrappingWritableStreamSink.prototype._finishErroring = function (reason) {\n if (this._state === \"writable\" /* WRITABLE */) {\n this._startErroring(reason);\n }\n if (this._state === \"erroring\" /* ERRORING */) {\n this._state = \"errored\" /* ERRORED */;\n this._errorPromiseReject(this._storedError);\n }\n };\n return WrappingWritableStreamSink;\n}());\n\nfunction createTransformStreamWrapper(ctor) {\n assert(isTransformStreamConstructor(ctor));\n return function (transform) {\n if (transform.constructor === ctor) {\n return transform;\n }\n var transformer = createWrappingTransformer(transform);\n return new ctor(transformer);\n };\n}\nfunction createWrappingTransformer(transform) {\n assert(isTransformStream(transform));\n var readable = transform.readable, writable = transform.writable;\n assert(readable.locked === false);\n assert(writable.locked === false);\n var reader = readable.getReader();\n var writer;\n try {\n writer = writable.getWriter();\n }\n catch (e) {\n reader.releaseLock(); // do not leak reader\n throw e;\n }\n return new WrappingTransformStreamTransformer(reader, writer);\n}\nvar WrappingTransformStreamTransformer = /** @class */ (function () {\n function WrappingTransformStreamTransformer(reader, writer) {\n var _this = this;\n this._transformStreamController = undefined;\n this._onRead = function (result) {\n if (result.done) {\n return;\n }\n _this._transformStreamController.enqueue(result.value);\n return _this._reader.read().then(_this._onRead);\n };\n this._onError = function (reason) {\n _this._flushReject(reason);\n _this._transformStreamController.error(reason);\n _this._reader.cancel(reason).catch(noop);\n _this._writer.abort(reason).catch(noop);\n };\n this._onTerminate = function () {\n _this._flushResolve();\n _this._transformStreamController.terminate();\n var error = new TypeError('TransformStream terminated');\n _this._writer.abort(error).catch(noop);\n };\n this._reader = reader;\n this._writer = writer;\n this._flushPromise = new Promise(function (resolve, reject) {\n _this._flushResolve = resolve;\n _this._flushReject = reject;\n });\n }\n WrappingTransformStreamTransformer.prototype.start = function (controller) {\n this._transformStreamController = controller;\n this._reader.read()\n .then(this._onRead)\n .then(this._onTerminate, this._onError);\n var readerClosed = this._reader.closed;\n if (readerClosed) {\n readerClosed\n .then(this._onTerminate, this._onError);\n }\n };\n WrappingTransformStreamTransformer.prototype.transform = function (chunk) {\n return this._writer.write(chunk);\n };\n WrappingTransformStreamTransformer.prototype.flush = function () {\n var _this = this;\n return this._writer.close()\n .then(function () { return _this._flushPromise; });\n };\n return WrappingTransformStreamTransformer;\n}());\n\nexport { createReadableStreamWrapper, createTransformStreamWrapper, createWrappingReadableSource, createWrappingTransformer, createWrappingWritableSink, createWritableStreamWrapper };\n//# sourceMappingURL=web-streams-adapter.mjs.map\n","(function (module, exports) {\n 'use strict';\n\n // Utils\n function assert (val, msg) {\n if (!val) throw new Error(msg || 'Assertion failed');\n }\n\n // Could use `inherits` module, but don't want to move from single file\n // architecture yet.\n 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 // BN\n\n function BN (number, base, endian) {\n if (BN.isBN(number)) {\n return number;\n }\n\n this.negative = 0;\n this.words = null;\n this.length = 0;\n\n // Reduction context\n this.red = null;\n\n if (number !== null) {\n if (base === 'le' || base === 'be') {\n endian = base;\n base = 10;\n }\n\n this._init(number || 0, base || 10, endian || 'be');\n }\n }\n if (typeof module === 'object') {\n module.exports = BN;\n } else {\n exports.BN = BN;\n }\n\n BN.BN = BN;\n BN.wordSize = 26;\n\n var Buffer;\n try {\n Buffer = require('buffer').Buffer;\n } catch (e) {\n }\n\n BN.isBN = function isBN (num) {\n if (num instanceof BN) {\n return true;\n }\n\n return num !== null && typeof num === 'object' &&\n num.constructor.wordSize === BN.wordSize && Array.isArray(num.words);\n };\n\n BN.max = function max (left, right) {\n if (left.cmp(right) > 0) return left;\n return right;\n };\n\n BN.min = function min (left, right) {\n if (left.cmp(right) < 0) return left;\n return right;\n };\n\n BN.prototype._init = function init (number, base, endian) {\n if (typeof number === 'number') {\n return this._initNumber(number, base, endian);\n }\n\n if (typeof number === 'object') {\n return this._initArray(number, base, endian);\n }\n\n if (base === 'hex') {\n base = 16;\n }\n assert(base === (base | 0) && base >= 2 && base <= 36);\n\n number = number.toString().replace(/\\s+/g, '');\n var start = 0;\n if (number[0] === '-') {\n start++;\n }\n\n if (base === 16) {\n this._parseHex(number, start);\n } else {\n this._parseBase(number, base, start);\n }\n\n if (number[0] === '-') {\n this.negative = 1;\n }\n\n this.strip();\n\n if (endian !== 'le') return;\n\n this._initArray(this.toArray(), base, endian);\n };\n\n BN.prototype._initNumber = function _initNumber (number, base, endian) {\n if (number < 0) {\n this.negative = 1;\n number = -number;\n }\n if (number < 0x4000000) {\n this.words = [ number & 0x3ffffff ];\n this.length = 1;\n } else if (number < 0x10000000000000) {\n this.words = [\n number & 0x3ffffff,\n (number / 0x4000000) & 0x3ffffff\n ];\n this.length = 2;\n } else {\n assert(number < 0x20000000000000); // 2 ^ 53 (unsafe)\n this.words = [\n number & 0x3ffffff,\n (number / 0x4000000) & 0x3ffffff,\n 1\n ];\n this.length = 3;\n }\n\n if (endian !== 'le') return;\n\n // Reverse the bytes\n this._initArray(this.toArray(), base, endian);\n };\n\n BN.prototype._initArray = function _initArray (number, base, endian) {\n // Perhaps a Uint8Array\n assert(typeof number.length === 'number');\n if (number.length <= 0) {\n this.words = [ 0 ];\n this.length = 1;\n return this;\n }\n\n this.length = Math.ceil(number.length / 3);\n this.words = new Array(this.length);\n for (var i = 0; i < this.length; i++) {\n this.words[i] = 0;\n }\n\n var j, w;\n var off = 0;\n if (endian === 'be') {\n for (i = number.length - 1, j = 0; i >= 0; i -= 3) {\n w = number[i] | (number[i - 1] << 8) | (number[i - 2] << 16);\n this.words[j] |= (w << off) & 0x3ffffff;\n this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;\n off += 24;\n if (off >= 26) {\n off -= 26;\n j++;\n }\n }\n } else if (endian === 'le') {\n for (i = 0, j = 0; i < number.length; i += 3) {\n w = number[i] | (number[i + 1] << 8) | (number[i + 2] << 16);\n this.words[j] |= (w << off) & 0x3ffffff;\n this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;\n off += 24;\n if (off >= 26) {\n off -= 26;\n j++;\n }\n }\n }\n return this.strip();\n };\n\n function parseHex (str, start, end) {\n var r = 0;\n var len = Math.min(str.length, end);\n for (var i = start; i < len; i++) {\n var c = str.charCodeAt(i) - 48;\n\n r <<= 4;\n\n // 'a' - 'f'\n if (c >= 49 && c <= 54) {\n r |= c - 49 + 0xa;\n\n // 'A' - 'F'\n } else if (c >= 17 && c <= 22) {\n r |= c - 17 + 0xa;\n\n // '0' - '9'\n } else {\n r |= c & 0xf;\n }\n }\n return r;\n }\n\n BN.prototype._parseHex = function _parseHex (number, start) {\n // Create possibly bigger array to ensure that it fits the number\n this.length = Math.ceil((number.length - start) / 6);\n this.words = new Array(this.length);\n for (var i = 0; i < this.length; i++) {\n this.words[i] = 0;\n }\n\n var j, w;\n // Scan 24-bit chunks and add them to the number\n var off = 0;\n for (i = number.length - 6, j = 0; i >= start; i -= 6) {\n w = parseHex(number, i, i + 6);\n this.words[j] |= (w << off) & 0x3ffffff;\n // NOTE: `0x3fffff` is intentional here, 26bits max shift + 24bit hex limb\n this.words[j + 1] |= w >>> (26 - off) & 0x3fffff;\n off += 24;\n if (off >= 26) {\n off -= 26;\n j++;\n }\n }\n if (i + 6 !== start) {\n w = parseHex(number, start, i + 6);\n this.words[j] |= (w << off) & 0x3ffffff;\n this.words[j + 1] |= w >>> (26 - off) & 0x3fffff;\n }\n this.strip();\n };\n\n function parseBase (str, start, end, mul) {\n var r = 0;\n var len = Math.min(str.length, end);\n for (var i = start; i < len; i++) {\n var c = str.charCodeAt(i) - 48;\n\n r *= mul;\n\n // 'a'\n if (c >= 49) {\n r += c - 49 + 0xa;\n\n // 'A'\n } else if (c >= 17) {\n r += c - 17 + 0xa;\n\n // '0' - '9'\n } else {\n r += c;\n }\n }\n return r;\n }\n\n BN.prototype._parseBase = function _parseBase (number, base, start) {\n // Initialize as zero\n this.words = [ 0 ];\n this.length = 1;\n\n // Find length of limb in base\n for (var limbLen = 0, limbPow = 1; limbPow <= 0x3ffffff; limbPow *= base) {\n limbLen++;\n }\n limbLen--;\n limbPow = (limbPow / base) | 0;\n\n var total = number.length - start;\n var mod = total % limbLen;\n var end = Math.min(total, total - mod) + start;\n\n var word = 0;\n for (var i = start; i < end; i += limbLen) {\n word = parseBase(number, i, i + limbLen, base);\n\n this.imuln(limbPow);\n if (this.words[0] + word < 0x4000000) {\n this.words[0] += word;\n } else {\n this._iaddn(word);\n }\n }\n\n if (mod !== 0) {\n var pow = 1;\n word = parseBase(number, i, number.length, base);\n\n for (i = 0; i < mod; i++) {\n pow *= base;\n }\n\n this.imuln(pow);\n if (this.words[0] + word < 0x4000000) {\n this.words[0] += word;\n } else {\n this._iaddn(word);\n }\n }\n };\n\n BN.prototype.copy = function copy (dest) {\n dest.words = new Array(this.length);\n for (var i = 0; i < this.length; i++) {\n dest.words[i] = this.words[i];\n }\n dest.length = this.length;\n dest.negative = this.negative;\n dest.red = this.red;\n };\n\n BN.prototype.clone = function clone () {\n var r = new BN(null);\n this.copy(r);\n return r;\n };\n\n BN.prototype._expand = function _expand (size) {\n while (this.length < size) {\n this.words[this.length++] = 0;\n }\n return this;\n };\n\n // Remove leading `0` from `this`\n BN.prototype.strip = function strip () {\n while (this.length > 1 && this.words[this.length - 1] === 0) {\n this.length--;\n }\n return this._normSign();\n };\n\n BN.prototype._normSign = function _normSign () {\n // -0 = 0\n if (this.length === 1 && this.words[0] === 0) {\n this.negative = 0;\n }\n return this;\n };\n\n BN.prototype.inspect = function inspect () {\n return (this.red ? '<BN-R: ' : '<BN: ') + this.toString(16) + '>';\n };\n\n /*\n\n var zeros = [];\n var groupSizes = [];\n var groupBases = [];\n\n var s = '';\n var i = -1;\n while (++i < BN.wordSize) {\n zeros[i] = s;\n s += '0';\n }\n groupSizes[0] = 0;\n groupSizes[1] = 0;\n groupBases[0] = 0;\n groupBases[1] = 0;\n var base = 2 - 1;\n while (++base < 36 + 1) {\n var groupSize = 0;\n var groupBase = 1;\n while (groupBase < (1 << BN.wordSize) / base) {\n groupBase *= base;\n groupSize += 1;\n }\n groupSizes[base] = groupSize;\n groupBases[base] = groupBase;\n }\n\n */\n\n var zeros = [\n '',\n '0',\n '00',\n '000',\n '0000',\n '00000',\n '000000',\n '0000000',\n '00000000',\n '000000000',\n '0000000000',\n '00000000000',\n '000000000000',\n '0000000000000',\n '00000000000000',\n '000000000000000',\n '0000000000000000',\n '00000000000000000',\n '000000000000000000',\n '0000000000000000000',\n '00000000000000000000',\n '000000000000000000000',\n '0000000000000000000000',\n '00000000000000000000000',\n '000000000000000000000000',\n '0000000000000000000000000'\n ];\n\n var groupSizes = [\n 0, 0,\n 25, 16, 12, 11, 10, 9, 8,\n 8, 7, 7, 7, 7, 6, 6,\n 6, 6, 6, 6, 6, 5, 5,\n 5, 5, 5, 5, 5, 5, 5,\n 5, 5, 5, 5, 5, 5, 5\n ];\n\n var groupBases = [\n 0, 0,\n 33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216,\n 43046721, 10000000, 19487171, 35831808, 62748517, 7529536, 11390625,\n 16777216, 24137569, 34012224, 47045881, 64000000, 4084101, 5153632,\n 6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149,\n 24300000, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176\n ];\n\n BN.prototype.toString = function toString (base, padding) {\n base = base || 10;\n padding = padding | 0 || 1;\n\n var out;\n if (base === 16 || base === 'hex') {\n out = '';\n var off = 0;\n var carry = 0;\n for (var i = 0; i < this.length; i++) {\n var w = this.words[i];\n var word = (((w << off) | carry) & 0xffffff).toString(16);\n carry = (w >>> (24 - off)) & 0xffffff;\n if (carry !== 0 || i !== this.length - 1) {\n out = zeros[6 - word.length] + word + out;\n } else {\n out = word + out;\n }\n off += 2;\n if (off >= 26) {\n off -= 26;\n i--;\n }\n }\n if (carry !== 0) {\n out = carry.toString(16) + out;\n }\n while (out.length % padding !== 0) {\n out = '0' + out;\n }\n if (this.negative !== 0) {\n out = '-' + out;\n }\n return out;\n }\n\n if (base === (base | 0) && base >= 2 && base <= 36) {\n // var groupSize = Math.floor(BN.wordSize * Math.LN2 / Math.log(base));\n var groupSize = groupSizes[base];\n // var groupBase = Math.pow(base, groupSize);\n var groupBase = groupBases[base];\n out = '';\n var c = this.clone();\n c.negative = 0;\n while (!c.isZero()) {\n var r = c.modn(groupBase).toString(base);\n c = c.idivn(groupBase);\n\n if (!c.isZero()) {\n out = zeros[groupSize - r.length] + r + out;\n } else {\n out = r + out;\n }\n }\n if (this.isZero()) {\n out = '0' + out;\n }\n while (out.length % padding !== 0) {\n out = '0' + out;\n }\n if (this.negative !== 0) {\n out = '-' + out;\n }\n return out;\n }\n\n assert(false, 'Base should be between 2 and 36');\n };\n\n BN.prototype.toNumber = function toNumber () {\n var ret = this.words[0];\n if (this.length === 2) {\n ret += this.words[1] * 0x4000000;\n } else if (this.length === 3 && this.words[2] === 0x01) {\n // NOTE: at this stage it is known that the top bit is set\n ret += 0x10000000000000 + (this.words[1] * 0x4000000);\n } else if (this.length > 2) {\n assert(false, 'Number can only safely store up to 53 bits');\n }\n return (this.negative !== 0) ? -ret : ret;\n };\n\n BN.prototype.toJSON = function toJSON () {\n return this.toString(16);\n };\n\n BN.prototype.toBuffer = function toBuffer (endian, length) {\n assert(typeof Buffer !== 'undefined');\n return this.toArrayLike(Buffer, endian, length);\n };\n\n BN.prototype.toArray = function toArray (endian, length) {\n return this.toArrayLike(Array, endian, length);\n };\n\n BN.prototype.toArrayLike = function toArrayLike (ArrayType, endian, length) {\n var byteLength = this.byteLength();\n var reqLength = length || Math.max(1, byteLength);\n assert(byteLength <= reqLength, 'byte array longer than desired length');\n assert(reqLength > 0, 'Requested array length <= 0');\n\n this.strip();\n var littleEndian = endian === 'le';\n var res = new ArrayType(reqLength);\n\n var b, i;\n var q = this.clone();\n if (!littleEndian) {\n // Assume big-endian\n for (i = 0; i < reqLength - byteLength; i++) {\n res[i] = 0;\n }\n\n for (i = 0; !q.isZero(); i++) {\n b = q.andln(0xff);\n q.iushrn(8);\n\n res[reqLength - i - 1] = b;\n }\n } else {\n for (i = 0; !q.isZero(); i++) {\n b = q.andln(0xff);\n q.iushrn(8);\n\n res[i] = b;\n }\n\n for (; i < reqLength; i++) {\n res[i] = 0;\n }\n }\n\n return res;\n };\n\n if (Math.clz32) {\n BN.prototype._countBits = function _countBits (w) {\n return 32 - Math.clz32(w);\n };\n } else {\n BN.prototype._countBits = function _countBits (w) {\n var t = w;\n var r = 0;\n if (t >= 0x1000) {\n r += 13;\n t >>>= 13;\n }\n if (t >= 0x40) {\n r += 7;\n t >>>= 7;\n }\n if (t >= 0x8) {\n r += 4;\n t >>>= 4;\n }\n if (t >= 0x02) {\n r += 2;\n t >>>= 2;\n }\n return r + t;\n };\n }\n\n BN.prototype._zeroBits = function _zeroBits (w) {\n // Short-cut\n if (w === 0) return 26;\n\n var t = w;\n var r = 0;\n if ((t & 0x1fff) === 0) {\n r += 13;\n t >>>= 13;\n }\n if ((t & 0x7f) === 0) {\n r += 7;\n t >>>= 7;\n }\n if ((t & 0xf) === 0) {\n r += 4;\n t >>>= 4;\n }\n if ((t & 0x3) === 0) {\n r += 2;\n t >>>= 2;\n }\n if ((t & 0x1) === 0) {\n r++;\n }\n return r;\n };\n\n // Return number of used bits in a BN\n BN.prototype.bitLength = function bitLength () {\n var w = this.words[this.length - 1];\n var hi = this._countBits(w);\n return (this.length - 1) * 26 + hi;\n };\n\n function toBitArray (num) {\n var w = new Array(num.bitLength());\n\n for (var bit = 0; bit < w.length; bit++) {\n var off = (bit / 26) | 0;\n var wbit = bit % 26;\n\n w[bit] = (num.words[off] & (1 << wbit)) >>> wbit;\n }\n\n return w;\n }\n\n // Number of trailing zero bits\n BN.prototype.zeroBits = function zeroBits () {\n if (this.isZero()) return 0;\n\n var r = 0;\n for (var i = 0; i < this.length; i++) {\n var b = this._zeroBits(this.words[i]);\n r += b;\n if (b !== 26) break;\n }\n return r;\n };\n\n BN.prototype.byteLength = function byteLength () {\n return Math.ceil(this.bitLength() / 8);\n };\n\n BN.prototype.toTwos = function toTwos (width) {\n if (this.negative !== 0) {\n return this.abs().inotn(width).iaddn(1);\n }\n return this.clone();\n };\n\n BN.prototype.fromTwos = function fromTwos (width) {\n if (this.testn(width - 1)) {\n return this.notn(width).iaddn(1).ineg();\n }\n return this.clone();\n };\n\n BN.prototype.isNeg = function isNeg () {\n return this.negative !== 0;\n };\n\n // Return negative clone of `this`\n BN.prototype.neg = function neg () {\n return this.clone().ineg();\n };\n\n BN.prototype.ineg = function ineg () {\n if (!this.isZero()) {\n this.negative ^= 1;\n }\n\n return this;\n };\n\n // Or `num` with `this` in-place\n BN.prototype.iuor = function iuor (num) {\n while (this.length < num.length) {\n this.words[this.length++] = 0;\n }\n\n for (var i = 0; i < num.length; i++) {\n this.words[i] = this.words[i] | num.words[i];\n }\n\n return this.strip();\n };\n\n BN.prototype.ior = function ior (num) {\n assert((this.negative | num.negative) === 0);\n return this.iuor(num);\n };\n\n // Or `num` with `this`\n BN.prototype.or = function or (num) {\n if (this.length > num.length) return this.clone().ior(num);\n return num.clone().ior(this);\n };\n\n BN.prototype.uor = function uor (num) {\n if (this.length > num.length) return this.clone().iuor(num);\n return num.clone().iuor(this);\n };\n\n // And `num` with `this` in-place\n BN.prototype.iuand = function iuand (num) {\n // b = min-length(num, this)\n var b;\n if (this.length > num.length) {\n b = num;\n } else {\n b = this;\n }\n\n for (var i = 0; i < b.length; i++) {\n this.words[i] = this.words[i] & num.words[i];\n }\n\n this.length = b.length;\n\n return this.strip();\n };\n\n BN.prototype.iand = function iand (num) {\n assert((this.negative | num.negative) === 0);\n return this.iuand(num);\n };\n\n // And `num` with `this`\n BN.prototype.and = function and (num) {\n if (this.length > num.length) return this.clone().iand(num);\n return num.clone().iand(this);\n };\n\n BN.prototype.uand = function uand (num) {\n if (this.length > num.length) return this.clone().iuand(num);\n return num.clone().iuand(this);\n };\n\n // Xor `num` with `this` in-place\n BN.prototype.iuxor = function iuxor (num) {\n // a.length > b.length\n var a;\n var b;\n if (this.length > num.length) {\n a = this;\n b = num;\n } else {\n a = num;\n b = this;\n }\n\n for (var i = 0; i < b.length; i++) {\n this.words[i] = a.words[i] ^ b.words[i];\n }\n\n if (this !== a) {\n for (; i < a.length; i++) {\n this.words[i] = a.words[i];\n }\n }\n\n this.length = a.length;\n\n return this.strip();\n };\n\n BN.prototype.ixor = function ixor (num) {\n assert((this.negative | num.negative) === 0);\n return this.iuxor(num);\n };\n\n // Xor `num` with `this`\n BN.prototype.xor = function xor (num) {\n if (this.length > num.length) return this.clone().ixor(num);\n return num.clone().ixor(this);\n };\n\n BN.prototype.uxor = function uxor (num) {\n if (this.length > num.length) return this.clone().iuxor(num);\n return num.clone().iuxor(this);\n };\n\n // Not ``this`` with ``width`` bitwidth\n BN.prototype.inotn = function inotn (width) {\n assert(typeof width === 'number' && width >= 0);\n\n var bytesNeeded = Math.ceil(width / 26) | 0;\n var bitsLeft = width % 26;\n\n // Extend the buffer with leading zeroes\n this._expand(bytesNeeded);\n\n if (bitsLeft > 0) {\n bytesNeeded--;\n }\n\n // Handle complete words\n for (var i = 0; i < bytesNeeded; i++) {\n this.words[i] = ~this.words[i] & 0x3ffffff;\n }\n\n // Handle the residue\n if (bitsLeft > 0) {\n this.words[i] = ~this.words[i] & (0x3ffffff >> (26 - bitsLeft));\n }\n\n // And remove leading zeroes\n return this.strip();\n };\n\n BN.prototype.notn = function notn (width) {\n return this.clone().inotn(width);\n };\n\n // Set `bit` of `this`\n BN.prototype.setn = function setn (bit, val) {\n assert(typeof bit === 'number' && bit >= 0);\n\n var off = (bit / 26) | 0;\n var wbit = bit % 26;\n\n this._expand(off + 1);\n\n if (val) {\n this.words[off] = this.words[off] | (1 << wbit);\n } else {\n this.words[off] = this.words[off] & ~(1 << wbit);\n }\n\n return this.strip();\n };\n\n // Add `num` to `this` in-place\n BN.prototype.iadd = function iadd (num) {\n var r;\n\n // negative + positive\n if (this.negative !== 0 && num.negative === 0) {\n this.negative = 0;\n r = this.isub(num);\n this.negative ^= 1;\n return this._normSign();\n\n // positive + negative\n } else if (this.negative === 0 && num.negative !== 0) {\n num.negative = 0;\n r = this.isub(num);\n num.negative = 1;\n return r._normSign();\n }\n\n // a.length > b.length\n var a, b;\n if (this.length > num.length) {\n a = this;\n b = num;\n } else {\n a = num;\n b = this;\n }\n\n var carry = 0;\n for (var i = 0; i < b.length; i++) {\n r = (a.words[i] | 0) + (b.words[i] | 0) + carry;\n this.words[i] = r & 0x3ffffff;\n carry = r >>> 26;\n }\n for (; carry !== 0 && i < a.length; i++) {\n r = (a.words[i] | 0) + carry;\n this.words[i] = r & 0x3ffffff;\n carry = r >>> 26;\n }\n\n this.length = a.length;\n if (carry !== 0) {\n this.words[this.length] = carry;\n this.length++;\n // Copy the rest of the words\n } else if (a !== this) {\n for (; i < a.length; i++) {\n this.words[i] = a.words[i];\n }\n }\n\n return this;\n };\n\n // Add `num` to `this`\n BN.prototype.add = function add (num) {\n var res;\n if (num.negative !== 0 && this.negative === 0) {\n num.negative = 0;\n res = this.sub(num);\n num.negative ^= 1;\n return res;\n } else if (num.negative === 0 && this.negative !== 0) {\n this.negative = 0;\n res = num.sub(this);\n this.negative = 1;\n return res;\n }\n\n if (this.length > num.length) return this.clone().iadd(num);\n\n return num.clone().iadd(this);\n };\n\n // Subtract `num` from `this` in-place\n BN.prototype.isub = function isub (num) {\n // this - (-num) = this + num\n if (num.negative !== 0) {\n num.negative = 0;\n var r = this.iadd(num);\n num.negative = 1;\n return r._normSign();\n\n // -this - num = -(this + num)\n } else if (this.negative !== 0) {\n this.negative = 0;\n this.iadd(num);\n this.negative = 1;\n return this._normSign();\n }\n\n // At this point both numbers are positive\n var cmp = this.cmp(num);\n\n // Optimization - zeroify\n if (cmp === 0) {\n this.negative = 0;\n this.length = 1;\n this.words[0] = 0;\n return this;\n }\n\n // a > b\n var a, b;\n if (cmp > 0) {\n a = this;\n b = num;\n } else {\n a = num;\n b = this;\n }\n\n var carry = 0;\n for (var i = 0; i < b.length; i++) {\n r = (a.words[i] | 0) - (b.words[i] | 0) + carry;\n carry = r >> 26;\n this.words[i] = r & 0x3ffffff;\n }\n for (; carry !== 0 && i < a.length; i++) {\n r = (a.words[i] | 0) + carry;\n carry = r >> 26;\n this.words[i] = r & 0x3ffffff;\n }\n\n // Copy rest of the words\n if (carry === 0 && i < a.length && a !== this) {\n for (; i < a.length; i++) {\n this.words[i] = a.words[i];\n }\n }\n\n this.length = Math.max(this.length, i);\n\n if (a !== this) {\n this.negative = 1;\n }\n\n return this.strip();\n };\n\n // Subtract `num` from `this`\n BN.prototype.sub = function sub (num) {\n return this.clone().isub(num);\n };\n\n function smallMulTo (self, num, out) {\n out.negative = num.negative ^ self.negative;\n var len = (self.length + num.length) | 0;\n out.length = len;\n len = (len - 1) | 0;\n\n // Peel one iteration (compiler can't do it, because of code complexity)\n var a = self.words[0] | 0;\n var b = num.words[0] | 0;\n var r = a * b;\n\n var lo = r & 0x3ffffff;\n var carry = (r / 0x4000000) | 0;\n out.words[0] = lo;\n\n for (var k = 1; k < len; k++) {\n // Sum all words with the same `i + j = k` and accumulate `ncarry`,\n // note that ncarry could be >= 0x3ffffff\n var ncarry = carry >>> 26;\n var rword = carry & 0x3ffffff;\n var maxJ = Math.min(k, num.length - 1);\n for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {\n var i = (k - j) | 0;\n a = self.words[i] | 0;\n b = num.words[j] | 0;\n r = a * b + rword;\n ncarry += (r / 0x4000000) | 0;\n rword = r & 0x3ffffff;\n }\n out.words[k] = rword | 0;\n carry = ncarry | 0;\n }\n if (carry !== 0) {\n out.words[k] = carry | 0;\n } else {\n out.length--;\n }\n\n return out.strip();\n }\n\n // TODO(indutny): it may be reasonable to omit it for users who don't need\n // to work with 256-bit numbers, otherwise it gives 20% improvement for 256-bit\n // multiplication (like elliptic secp256k1).\n var comb10MulTo = function comb10MulTo (self, num, out) {\n var a = self.words;\n var b = num.words;\n var o = out.words;\n var c = 0;\n var lo;\n var mid;\n var hi;\n var a0 = a[0] | 0;\n var al0 = a0 & 0x1fff;\n var ah0 = a0 >>> 13;\n var a1 = a[1] | 0;\n var al1 = a1 & 0x1fff;\n var ah1 = a1 >>> 13;\n var a2 = a[2] | 0;\n var al2 = a2 & 0x1fff;\n var ah2 = a2 >>> 13;\n var a3 = a[3] | 0;\n var al3 = a3 & 0x1fff;\n var ah3 = a3 >>> 13;\n var a4 = a[4] | 0;\n var al4 = a4 & 0x1fff;\n var ah4 = a4 >>> 13;\n var a5 = a[5] | 0;\n var al5 = a5 & 0x1fff;\n var ah5 = a5 >>> 13;\n var a6 = a[6] | 0;\n var al6 = a6 & 0x1fff;\n var ah6 = a6 >>> 13;\n var a7 = a[7] | 0;\n var al7 = a7 & 0x1fff;\n var ah7 = a7 >>> 13;\n var a8 = a[8] | 0;\n var al8 = a8 & 0x1fff;\n var ah8 = a8 >>> 13;\n var a9 = a[9] | 0;\n var al9 = a9 & 0x1fff;\n var ah9 = a9 >>> 13;\n var b0 = b[0] | 0;\n var bl0 = b0 & 0x1fff;\n var bh0 = b0 >>> 13;\n var b1 = b[1] | 0;\n var bl1 = b1 & 0x1fff;\n var bh1 = b1 >>> 13;\n var b2 = b[2] | 0;\n var bl2 = b2 & 0x1fff;\n var bh2 = b2 >>> 13;\n var b3 = b[3] | 0;\n var bl3 = b3 & 0x1fff;\n var bh3 = b3 >>> 13;\n var b4 = b[4] | 0;\n var bl4 = b4 & 0x1fff;\n var bh4 = b4 >>> 13;\n var b5 = b[5] | 0;\n var bl5 = b5 & 0x1fff;\n var bh5 = b5 >>> 13;\n var b6 = b[6] | 0;\n var bl6 = b6 & 0x1fff;\n var bh6 = b6 >>> 13;\n var b7 = b[7] | 0;\n var bl7 = b7 & 0x1fff;\n var bh7 = b7 >>> 13;\n var b8 = b[8] | 0;\n var bl8 = b8 & 0x1fff;\n var bh8 = b8 >>> 13;\n var b9 = b[9] | 0;\n var bl9 = b9 & 0x1fff;\n var bh9 = b9 >>> 13;\n\n out.negative = self.negative ^ num.negative;\n out.length = 19;\n /* k = 0 */\n lo = Math.imul(al0, bl0);\n mid = Math.imul(al0, bh0);\n mid = (mid + Math.imul(ah0, bl0)) | 0;\n hi = Math.imul(ah0, bh0);\n var w0 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w0 >>> 26)) | 0;\n w0 &= 0x3ffffff;\n /* k = 1 */\n lo = Math.imul(al1, bl0);\n mid = Math.imul(al1, bh0);\n mid = (mid + Math.imul(ah1, bl0)) | 0;\n hi = Math.imul(ah1, bh0);\n lo = (lo + Math.imul(al0, bl1)) | 0;\n mid = (mid + Math.imul(al0, bh1)) | 0;\n mid = (mid + Math.imul(ah0, bl1)) | 0;\n hi = (hi + Math.imul(ah0, bh1)) | 0;\n var w1 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w1 >>> 26)) | 0;\n w1 &= 0x3ffffff;\n /* k = 2 */\n lo = Math.imul(al2, bl0);\n mid = Math.imul(al2, bh0);\n mid = (mid + Math.imul(ah2, bl0)) | 0;\n hi = Math.imul(ah2, bh0);\n lo = (lo + Math.imul(al1, bl1)) | 0;\n mid = (mid + Math.imul(al1, bh1)) | 0;\n mid = (mid + Math.imul(ah1, bl1)) | 0;\n hi = (hi + Math.imul(ah1, bh1)) | 0;\n lo = (lo + Math.imul(al0, bl2)) | 0;\n mid = (mid + Math.imul(al0, bh2)) | 0;\n mid = (mid + Math.imul(ah0, bl2)) | 0;\n hi = (hi + Math.imul(ah0, bh2)) | 0;\n var w2 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w2 >>> 26)) | 0;\n w2 &= 0x3ffffff;\n /* k = 3 */\n lo = Math.imul(al3, bl0);\n mid = Math.imul(al3, bh0);\n mid = (mid + Math.imul(ah3, bl0)) | 0;\n hi = Math.imul(ah3, bh0);\n lo = (lo + Math.imul(al2, bl1)) | 0;\n mid = (mid + Math.imul(al2, bh1)) | 0;\n mid = (mid + Math.imul(ah2, bl1)) | 0;\n hi = (hi + Math.imul(ah2, bh1)) | 0;\n lo = (lo + Math.imul(al1, bl2)) | 0;\n mid = (mid + Math.imul(al1, bh2)) | 0;\n mid = (mid + Math.imul(ah1, bl2)) | 0;\n hi = (hi + Math.imul(ah1, bh2)) | 0;\n lo = (lo + Math.imul(al0, bl3)) | 0;\n mid = (mid + Math.imul(al0, bh3)) | 0;\n mid = (mid + Math.imul(ah0, bl3)) | 0;\n hi = (hi + Math.imul(ah0, bh3)) | 0;\n var w3 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w3 >>> 26)) | 0;\n w3 &= 0x3ffffff;\n /* k = 4 */\n lo = Math.imul(al4, bl0);\n mid = Math.imul(al4, bh0);\n mid = (mid + Math.imul(ah4, bl0)) | 0;\n hi = Math.imul(ah4, bh0);\n lo = (lo + Math.imul(al3, bl1)) | 0;\n mid = (mid + Math.imul(al3, bh1)) | 0;\n mid = (mid + Math.imul(ah3, bl1)) | 0;\n hi = (hi + Math.imul(ah3, bh1)) | 0;\n lo = (lo + Math.imul(al2, bl2)) | 0;\n mid = (mid + Math.imul(al2, bh2)) | 0;\n mid = (mid + Math.imul(ah2, bl2)) | 0;\n hi = (hi + Math.imul(ah2, bh2)) | 0;\n lo = (lo + Math.imul(al1, bl3)) | 0;\n mid = (mid + Math.imul(al1, bh3)) | 0;\n mid = (mid + Math.imul(ah1, bl3)) | 0;\n hi = (hi + Math.imul(ah1, bh3)) | 0;\n lo = (lo + Math.imul(al0, bl4)) | 0;\n mid = (mid + Math.imul(al0, bh4)) | 0;\n mid = (mid + Math.imul(ah0, bl4)) | 0;\n hi = (hi + Math.imul(ah0, bh4)) | 0;\n var w4 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w4 >>> 26)) | 0;\n w4 &= 0x3ffffff;\n /* k = 5 */\n lo = Math.imul(al5, bl0);\n mid = Math.imul(al5, bh0);\n mid = (mid + Math.imul(ah5, bl0)) | 0;\n hi = Math.imul(ah5, bh0);\n lo = (lo + Math.imul(al4, bl1)) | 0;\n mid = (mid + Math.imul(al4, bh1)) | 0;\n mid = (mid + Math.imul(ah4, bl1)) | 0;\n hi = (hi + Math.imul(ah4, bh1)) | 0;\n lo = (lo + Math.imul(al3, bl2)) | 0;\n mid = (mid + Math.imul(al3, bh2)) | 0;\n mid = (mid + Math.imul(ah3, bl2)) | 0;\n hi = (hi + Math.imul(ah3, bh2)) | 0;\n lo = (lo + Math.imul(al2, bl3)) | 0;\n mid = (mid + Math.imul(al2, bh3)) | 0;\n mid = (mid + Math.imul(ah2, bl3)) | 0;\n hi = (hi + Math.imul(ah2, bh3)) | 0;\n lo = (lo + Math.imul(al1, bl4)) | 0;\n mid = (mid + Math.imul(al1, bh4)) | 0;\n mid = (mid + Math.imul(ah1, bl4)) | 0;\n hi = (hi + Math.imul(ah1, bh4)) | 0;\n lo = (lo + Math.imul(al0, bl5)) | 0;\n mid = (mid + Math.imul(al0, bh5)) | 0;\n mid = (mid + Math.imul(ah0, bl5)) | 0;\n hi = (hi + Math.imul(ah0, bh5)) | 0;\n var w5 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w5 >>> 26)) | 0;\n w5 &= 0x3ffffff;\n /* k = 6 */\n lo = Math.imul(al6, bl0);\n mid = Math.imul(al6, bh0);\n mid = (mid + Math.imul(ah6, bl0)) | 0;\n hi = Math.imul(ah6, bh0);\n lo = (lo + Math.imul(al5, bl1)) | 0;\n mid = (mid + Math.imul(al5, bh1)) | 0;\n mid = (mid + Math.imul(ah5, bl1)) | 0;\n hi = (hi + Math.imul(ah5, bh1)) | 0;\n lo = (lo + Math.imul(al4, bl2)) | 0;\n mid = (mid + Math.imul(al4, bh2)) | 0;\n mid = (mid + Math.imul(ah4, bl2)) | 0;\n hi = (hi + Math.imul(ah4, bh2)) | 0;\n lo = (lo + Math.imul(al3, bl3)) | 0;\n mid = (mid + Math.imul(al3, bh3)) | 0;\n mid = (mid + Math.imul(ah3, bl3)) | 0;\n hi = (hi + Math.imul(ah3, bh3)) | 0;\n lo = (lo + Math.imul(al2, bl4)) | 0;\n mid = (mid + Math.imul(al2, bh4)) | 0;\n mid = (mid + Math.imul(ah2, bl4)) | 0;\n hi = (hi + Math.imul(ah2, bh4)) | 0;\n lo = (lo + Math.imul(al1, bl5)) | 0;\n mid = (mid + Math.imul(al1, bh5)) | 0;\n mid = (mid + Math.imul(ah1, bl5)) | 0;\n hi = (hi + Math.imul(ah1, bh5)) | 0;\n lo = (lo + Math.imul(al0, bl6)) | 0;\n mid = (mid + Math.imul(al0, bh6)) | 0;\n mid = (mid + Math.imul(ah0, bl6)) | 0;\n hi = (hi + Math.imul(ah0, bh6)) | 0;\n var w6 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w6 >>> 26)) | 0;\n w6 &= 0x3ffffff;\n /* k = 7 */\n lo = Math.imul(al7, bl0);\n mid = Math.imul(al7, bh0);\n mid = (mid + Math.imul(ah7, bl0)) | 0;\n hi = Math.imul(ah7, bh0);\n lo = (lo + Math.imul(al6, bl1)) | 0;\n mid = (mid + Math.imul(al6, bh1)) | 0;\n mid = (mid + Math.imul(ah6, bl1)) | 0;\n hi = (hi + Math.imul(ah6, bh1)) | 0;\n lo = (lo + Math.imul(al5, bl2)) | 0;\n mid = (mid + Math.imul(al5, bh2)) | 0;\n mid = (mid + Math.imul(ah5, bl2)) | 0;\n hi = (hi + Math.imul(ah5, bh2)) | 0;\n lo = (lo + Math.imul(al4, bl3)) | 0;\n mid = (mid + Math.imul(al4, bh3)) | 0;\n mid = (mid + Math.imul(ah4, bl3)) | 0;\n hi = (hi + Math.imul(ah4, bh3)) | 0;\n lo = (lo + Math.imul(al3, bl4)) | 0;\n mid = (mid + Math.imul(al3, bh4)) | 0;\n mid = (mid + Math.imul(ah3, bl4)) | 0;\n hi = (hi + Math.imul(ah3, bh4)) | 0;\n lo = (lo + Math.imul(al2, bl5)) | 0;\n mid = (mid + Math.imul(al2, bh5)) | 0;\n mid = (mid + Math.imul(ah2, bl5)) | 0;\n hi = (hi + Math.imul(ah2, bh5)) | 0;\n lo = (lo + Math.imul(al1, bl6)) | 0;\n mid = (mid + Math.imul(al1, bh6)) | 0;\n mid = (mid + Math.imul(ah1, bl6)) | 0;\n hi = (hi + Math.imul(ah1, bh6)) | 0;\n lo = (lo + Math.imul(al0, bl7)) | 0;\n mid = (mid + Math.imul(al0, bh7)) | 0;\n mid = (mid + Math.imul(ah0, bl7)) | 0;\n hi = (hi + Math.imul(ah0, bh7)) | 0;\n var w7 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w7 >>> 26)) | 0;\n w7 &= 0x3ffffff;\n /* k = 8 */\n lo = Math.imul(al8, bl0);\n mid = Math.imul(al8, bh0);\n mid = (mid + Math.imul(ah8, bl0)) | 0;\n hi = Math.imul(ah8, bh0);\n lo = (lo + Math.imul(al7, bl1)) | 0;\n mid = (mid + Math.imul(al7, bh1)) | 0;\n mid = (mid + Math.imul(ah7, bl1)) | 0;\n hi = (hi + Math.imul(ah7, bh1)) | 0;\n lo = (lo + Math.imul(al6, bl2)) | 0;\n mid = (mid + Math.imul(al6, bh2)) | 0;\n mid = (mid + Math.imul(ah6, bl2)) | 0;\n hi = (hi + Math.imul(ah6, bh2)) | 0;\n lo = (lo + Math.imul(al5, bl3)) | 0;\n mid = (mid + Math.imul(al5, bh3)) | 0;\n mid = (mid + Math.imul(ah5, bl3)) | 0;\n hi = (hi + Math.imul(ah5, bh3)) | 0;\n lo = (lo + Math.imul(al4, bl4)) | 0;\n mid = (mid + Math.imul(al4, bh4)) | 0;\n mid = (mid + Math.imul(ah4, bl4)) | 0;\n hi = (hi + Math.imul(ah4, bh4)) | 0;\n lo = (lo + Math.imul(al3, bl5)) | 0;\n mid = (mid + Math.imul(al3, bh5)) | 0;\n mid = (mid + Math.imul(ah3, bl5)) | 0;\n hi = (hi + Math.imul(ah3, bh5)) | 0;\n lo = (lo + Math.imul(al2, bl6)) | 0;\n mid = (mid + Math.imul(al2, bh6)) | 0;\n mid = (mid + Math.imul(ah2, bl6)) | 0;\n hi = (hi + Math.imul(ah2, bh6)) | 0;\n lo = (lo + Math.imul(al1, bl7)) | 0;\n mid = (mid + Math.imul(al1, bh7)) | 0;\n mid = (mid + Math.imul(ah1, bl7)) | 0;\n hi = (hi + Math.imul(ah1, bh7)) | 0;\n lo = (lo + Math.imul(al0, bl8)) | 0;\n mid = (mid + Math.imul(al0, bh8)) | 0;\n mid = (mid + Math.imul(ah0, bl8)) | 0;\n hi = (hi + Math.imul(ah0, bh8)) | 0;\n var w8 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w8 >>> 26)) | 0;\n w8 &= 0x3ffffff;\n /* k = 9 */\n lo = Math.imul(al9, bl0);\n mid = Math.imul(al9, bh0);\n mid = (mid + Math.imul(ah9, bl0)) | 0;\n hi = Math.imul(ah9, bh0);\n lo = (lo + Math.imul(al8, bl1)) | 0;\n mid = (mid + Math.imul(al8, bh1)) | 0;\n mid = (mid + Math.imul(ah8, bl1)) | 0;\n hi = (hi + Math.imul(ah8, bh1)) | 0;\n lo = (lo + Math.imul(al7, bl2)) | 0;\n mid = (mid + Math.imul(al7, bh2)) | 0;\n mid = (mid + Math.imul(ah7, bl2)) | 0;\n hi = (hi + Math.imul(ah7, bh2)) | 0;\n lo = (lo + Math.imul(al6, bl3)) | 0;\n mid = (mid + Math.imul(al6, bh3)) | 0;\n mid = (mid + Math.imul(ah6, bl3)) | 0;\n hi = (hi + Math.imul(ah6, bh3)) | 0;\n lo = (lo + Math.imul(al5, bl4)) | 0;\n mid = (mid + Math.imul(al5, bh4)) | 0;\n mid = (mid + Math.imul(ah5, bl4)) | 0;\n hi = (hi + Math.imul(ah5, bh4)) | 0;\n lo = (lo + Math.imul(al4, bl5)) | 0;\n mid = (mid + Math.imul(al4, bh5)) | 0;\n mid = (mid + Math.imul(ah4, bl5)) | 0;\n hi = (hi + Math.imul(ah4, bh5)) | 0;\n lo = (lo + Math.imul(al3, bl6)) | 0;\n mid = (mid + Math.imul(al3, bh6)) | 0;\n mid = (mid + Math.imul(ah3, bl6)) | 0;\n hi = (hi + Math.imul(ah3, bh6)) | 0;\n lo = (lo + Math.imul(al2, bl7)) | 0;\n mid = (mid + Math.imul(al2, bh7)) | 0;\n mid = (mid + Math.imul(ah2, bl7)) | 0;\n hi = (hi + Math.imul(ah2, bh7)) | 0;\n lo = (lo + Math.imul(al1, bl8)) | 0;\n mid = (mid + Math.imul(al1, bh8)) | 0;\n mid = (mid + Math.imul(ah1, bl8)) | 0;\n hi = (hi + Math.imul(ah1, bh8)) | 0;\n lo = (lo + Math.imul(al0, bl9)) | 0;\n mid = (mid + Math.imul(al0, bh9)) | 0;\n mid = (mid + Math.imul(ah0, bl9)) | 0;\n hi = (hi + Math.imul(ah0, bh9)) | 0;\n var w9 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w9 >>> 26)) | 0;\n w9 &= 0x3ffffff;\n /* k = 10 */\n lo = Math.imul(al9, bl1);\n mid = Math.imul(al9, bh1);\n mid = (mid + Math.imul(ah9, bl1)) | 0;\n hi = Math.imul(ah9, bh1);\n lo = (lo + Math.imul(al8, bl2)) | 0;\n mid = (mid + Math.imul(al8, bh2)) | 0;\n mid = (mid + Math.imul(ah8, bl2)) | 0;\n hi = (hi + Math.imul(ah8, bh2)) | 0;\n lo = (lo + Math.imul(al7, bl3)) | 0;\n mid = (mid + Math.imul(al7, bh3)) | 0;\n mid = (mid + Math.imul(ah7, bl3)) | 0;\n hi = (hi + Math.imul(ah7, bh3)) | 0;\n lo = (lo + Math.imul(al6, bl4)) | 0;\n mid = (mid + Math.imul(al6, bh4)) | 0;\n mid = (mid + Math.imul(ah6, bl4)) | 0;\n hi = (hi + Math.imul(ah6, bh4)) | 0;\n lo = (lo + Math.imul(al5, bl5)) | 0;\n mid = (mid + Math.imul(al5, bh5)) | 0;\n mid = (mid + Math.imul(ah5, bl5)) | 0;\n hi = (hi + Math.imul(ah5, bh5)) | 0;\n lo = (lo + Math.imul(al4, bl6)) | 0;\n mid = (mid + Math.imul(al4, bh6)) | 0;\n mid = (mid + Math.imul(ah4, bl6)) | 0;\n hi = (hi + Math.imul(ah4, bh6)) | 0;\n lo = (lo + Math.imul(al3, bl7)) | 0;\n mid = (mid + Math.imul(al3, bh7)) | 0;\n mid = (mid + Math.imul(ah3, bl7)) | 0;\n hi = (hi + Math.imul(ah3, bh7)) | 0;\n lo = (lo + Math.imul(al2, bl8)) | 0;\n mid = (mid + Math.imul(al2, bh8)) | 0;\n mid = (mid + Math.imul(ah2, bl8)) | 0;\n hi = (hi + Math.imul(ah2, bh8)) | 0;\n lo = (lo + Math.imul(al1, bl9)) | 0;\n mid = (mid + Math.imul(al1, bh9)) | 0;\n mid = (mid + Math.imul(ah1, bl9)) | 0;\n hi = (hi + Math.imul(ah1, bh9)) | 0;\n var w10 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w10 >>> 26)) | 0;\n w10 &= 0x3ffffff;\n /* k = 11 */\n lo = Math.imul(al9, bl2);\n mid = Math.imul(al9, bh2);\n mid = (mid + Math.imul(ah9, bl2)) | 0;\n hi = Math.imul(ah9, bh2);\n lo = (lo + Math.imul(al8, bl3)) | 0;\n mid = (mid + Math.imul(al8, bh3)) | 0;\n mid = (mid + Math.imul(ah8, bl3)) | 0;\n hi = (hi + Math.imul(ah8, bh3)) | 0;\n lo = (lo + Math.imul(al7, bl4)) | 0;\n mid = (mid + Math.imul(al7, bh4)) | 0;\n mid = (mid + Math.imul(ah7, bl4)) | 0;\n hi = (hi + Math.imul(ah7, bh4)) | 0;\n lo = (lo + Math.imul(al6, bl5)) | 0;\n mid = (mid + Math.imul(al6, bh5)) | 0;\n mid = (mid + Math.imul(ah6, bl5)) | 0;\n hi = (hi + Math.imul(ah6, bh5)) | 0;\n lo = (lo + Math.imul(al5, bl6)) | 0;\n mid = (mid + Math.imul(al5, bh6)) | 0;\n mid = (mid + Math.imul(ah5, bl6)) | 0;\n hi = (hi + Math.imul(ah5, bh6)) | 0;\n lo = (lo + Math.imul(al4, bl7)) | 0;\n mid = (mid + Math.imul(al4, bh7)) | 0;\n mid = (mid + Math.imul(ah4, bl7)) | 0;\n hi = (hi + Math.imul(ah4, bh7)) | 0;\n lo = (lo + Math.imul(al3, bl8)) | 0;\n mid = (mid + Math.imul(al3, bh8)) | 0;\n mid = (mid + Math.imul(ah3, bl8)) | 0;\n hi = (hi + Math.imul(ah3, bh8)) | 0;\n lo = (lo + Math.imul(al2, bl9)) | 0;\n mid = (mid + Math.imul(al2, bh9)) | 0;\n mid = (mid + Math.imul(ah2, bl9)) | 0;\n hi = (hi + Math.imul(ah2, bh9)) | 0;\n var w11 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w11 >>> 26)) | 0;\n w11 &= 0x3ffffff;\n /* k = 12 */\n lo = Math.imul(al9, bl3);\n mid = Math.imul(al9, bh3);\n mid = (mid + Math.imul(ah9, bl3)) | 0;\n hi = Math.imul(ah9, bh3);\n lo = (lo + Math.imul(al8, bl4)) | 0;\n mid = (mid + Math.imul(al8, bh4)) | 0;\n mid = (mid + Math.imul(ah8, bl4)) | 0;\n hi = (hi + Math.imul(ah8, bh4)) | 0;\n lo = (lo + Math.imul(al7, bl5)) | 0;\n mid = (mid + Math.imul(al7, bh5)) | 0;\n mid = (mid + Math.imul(ah7, bl5)) | 0;\n hi = (hi + Math.imul(ah7, bh5)) | 0;\n lo = (lo + Math.imul(al6, bl6)) | 0;\n mid = (mid + Math.imul(al6, bh6)) | 0;\n mid = (mid + Math.imul(ah6, bl6)) | 0;\n hi = (hi + Math.imul(ah6, bh6)) | 0;\n lo = (lo + Math.imul(al5, bl7)) | 0;\n mid = (mid + Math.imul(al5, bh7)) | 0;\n mid = (mid + Math.imul(ah5, bl7)) | 0;\n hi = (hi + Math.imul(ah5, bh7)) | 0;\n lo = (lo + Math.imul(al4, bl8)) | 0;\n mid = (mid + Math.imul(al4, bh8)) | 0;\n mid = (mid + Math.imul(ah4, bl8)) | 0;\n hi = (hi + Math.imul(ah4, bh8)) | 0;\n lo = (lo + Math.imul(al3, bl9)) | 0;\n mid = (mid + Math.imul(al3, bh9)) | 0;\n mid = (mid + Math.imul(ah3, bl9)) | 0;\n hi = (hi + Math.imul(ah3, bh9)) | 0;\n var w12 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w12 >>> 26)) | 0;\n w12 &= 0x3ffffff;\n /* k = 13 */\n lo = Math.imul(al9, bl4);\n mid = Math.imul(al9, bh4);\n mid = (mid + Math.imul(ah9, bl4)) | 0;\n hi = Math.imul(ah9, bh4);\n lo = (lo + Math.imul(al8, bl5)) | 0;\n mid = (mid + Math.imul(al8, bh5)) | 0;\n mid = (mid + Math.imul(ah8, bl5)) | 0;\n hi = (hi + Math.imul(ah8, bh5)) | 0;\n lo = (lo + Math.imul(al7, bl6)) | 0;\n mid = (mid + Math.imul(al7, bh6)) | 0;\n mid = (mid + Math.imul(ah7, bl6)) | 0;\n hi = (hi + Math.imul(ah7, bh6)) | 0;\n lo = (lo + Math.imul(al6, bl7)) | 0;\n mid = (mid + Math.imul(al6, bh7)) | 0;\n mid = (mid + Math.imul(ah6, bl7)) | 0;\n hi = (hi + Math.imul(ah6, bh7)) | 0;\n lo = (lo + Math.imul(al5, bl8)) | 0;\n mid = (mid + Math.imul(al5, bh8)) | 0;\n mid = (mid + Math.imul(ah5, bl8)) | 0;\n hi = (hi + Math.imul(ah5, bh8)) | 0;\n lo = (lo + Math.imul(al4, bl9)) | 0;\n mid = (mid + Math.imul(al4, bh9)) | 0;\n mid = (mid + Math.imul(ah4, bl9)) | 0;\n hi = (hi + Math.imul(ah4, bh9)) | 0;\n var w13 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w13 >>> 26)) | 0;\n w13 &= 0x3ffffff;\n /* k = 14 */\n lo = Math.imul(al9, bl5);\n mid = Math.imul(al9, bh5);\n mid = (mid + Math.imul(ah9, bl5)) | 0;\n hi = Math.imul(ah9, bh5);\n lo = (lo + Math.imul(al8, bl6)) | 0;\n mid = (mid + Math.imul(al8, bh6)) | 0;\n mid = (mid + Math.imul(ah8, bl6)) | 0;\n hi = (hi + Math.imul(ah8, bh6)) | 0;\n lo = (lo + Math.imul(al7, bl7)) | 0;\n mid = (mid + Math.imul(al7, bh7)) | 0;\n mid = (mid + Math.imul(ah7, bl7)) | 0;\n hi = (hi + Math.imul(ah7, bh7)) | 0;\n lo = (lo + Math.imul(al6, bl8)) | 0;\n mid = (mid + Math.imul(al6, bh8)) | 0;\n mid = (mid + Math.imul(ah6, bl8)) | 0;\n hi = (hi + Math.imul(ah6, bh8)) | 0;\n lo = (lo + Math.imul(al5, bl9)) | 0;\n mid = (mid + Math.imul(al5, bh9)) | 0;\n mid = (mid + Math.imul(ah5, bl9)) | 0;\n hi = (hi + Math.imul(ah5, bh9)) | 0;\n var w14 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w14 >>> 26)) | 0;\n w14 &= 0x3ffffff;\n /* k = 15 */\n lo = Math.imul(al9, bl6);\n mid = Math.imul(al9, bh6);\n mid = (mid + Math.imul(ah9, bl6)) | 0;\n hi = Math.imul(ah9, bh6);\n lo = (lo + Math.imul(al8, bl7)) | 0;\n mid = (mid + Math.imul(al8, bh7)) | 0;\n mid = (mid + Math.imul(ah8, bl7)) | 0;\n hi = (hi + Math.imul(ah8, bh7)) | 0;\n lo = (lo + Math.imul(al7, bl8)) | 0;\n mid = (mid + Math.imul(al7, bh8)) | 0;\n mid = (mid + Math.imul(ah7, bl8)) | 0;\n hi = (hi + Math.imul(ah7, bh8)) | 0;\n lo = (lo + Math.imul(al6, bl9)) | 0;\n mid = (mid + Math.imul(al6, bh9)) | 0;\n mid = (mid + Math.imul(ah6, bl9)) | 0;\n hi = (hi + Math.imul(ah6, bh9)) | 0;\n var w15 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w15 >>> 26)) | 0;\n w15 &= 0x3ffffff;\n /* k = 16 */\n lo = Math.imul(al9, bl7);\n mid = Math.imul(al9, bh7);\n mid = (mid + Math.imul(ah9, bl7)) | 0;\n hi = Math.imul(ah9, bh7);\n lo = (lo + Math.imul(al8, bl8)) | 0;\n mid = (mid + Math.imul(al8, bh8)) | 0;\n mid = (mid + Math.imul(ah8, bl8)) | 0;\n hi = (hi + Math.imul(ah8, bh8)) | 0;\n lo = (lo + Math.imul(al7, bl9)) | 0;\n mid = (mid + Math.imul(al7, bh9)) | 0;\n mid = (mid + Math.imul(ah7, bl9)) | 0;\n hi = (hi + Math.imul(ah7, bh9)) | 0;\n var w16 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w16 >>> 26)) | 0;\n w16 &= 0x3ffffff;\n /* k = 17 */\n lo = Math.imul(al9, bl8);\n mid = Math.imul(al9, bh8);\n mid = (mid + Math.imul(ah9, bl8)) | 0;\n hi = Math.imul(ah9, bh8);\n lo = (lo + Math.imul(al8, bl9)) | 0;\n mid = (mid + Math.imul(al8, bh9)) | 0;\n mid = (mid + Math.imul(ah8, bl9)) | 0;\n hi = (hi + Math.imul(ah8, bh9)) | 0;\n var w17 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w17 >>> 26)) | 0;\n w17 &= 0x3ffffff;\n /* k = 18 */\n lo = Math.imul(al9, bl9);\n mid = Math.imul(al9, bh9);\n mid = (mid + Math.imul(ah9, bl9)) | 0;\n hi = Math.imul(ah9, bh9);\n var w18 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w18 >>> 26)) | 0;\n w18 &= 0x3ffffff;\n o[0] = w0;\n o[1] = w1;\n o[2] = w2;\n o[3] = w3;\n o[4] = w4;\n o[5] = w5;\n o[6] = w6;\n o[7] = w7;\n o[8] = w8;\n o[9] = w9;\n o[10] = w10;\n o[11] = w11;\n o[12] = w12;\n o[13] = w13;\n o[14] = w14;\n o[15] = w15;\n o[16] = w16;\n o[17] = w17;\n o[18] = w18;\n if (c !== 0) {\n o[19] = c;\n out.length++;\n }\n return out;\n };\n\n // Polyfill comb\n if (!Math.imul) {\n comb10MulTo = smallMulTo;\n }\n\n function bigMulTo (self, num, out) {\n out.negative = num.negative ^ self.negative;\n out.length = self.length + num.length;\n\n var carry = 0;\n var hncarry = 0;\n for (var k = 0; k < out.length - 1; k++) {\n // Sum all words with the same `i + j = k` and accumulate `ncarry`,\n // note that ncarry could be >= 0x3ffffff\n var ncarry = hncarry;\n hncarry = 0;\n var rword = carry & 0x3ffffff;\n var maxJ = Math.min(k, num.length - 1);\n for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {\n var i = k - j;\n var a = self.words[i] | 0;\n var b = num.words[j] | 0;\n var r = a * b;\n\n var lo = r & 0x3ffffff;\n ncarry = (ncarry + ((r / 0x4000000) | 0)) | 0;\n lo = (lo + rword) | 0;\n rword = lo & 0x3ffffff;\n ncarry = (ncarry + (lo >>> 26)) | 0;\n\n hncarry += ncarry >>> 26;\n ncarry &= 0x3ffffff;\n }\n out.words[k] = rword;\n carry = ncarry;\n ncarry = hncarry;\n }\n if (carry !== 0) {\n out.words[k] = carry;\n } else {\n out.length--;\n }\n\n return out.strip();\n }\n\n function jumboMulTo (self, num, out) {\n var fftm = new FFTM();\n return fftm.mulp(self, num, out);\n }\n\n BN.prototype.mulTo = function mulTo (num, out) {\n var res;\n var len = this.length + num.length;\n if (this.length === 10 && num.length === 10) {\n res = comb10MulTo(this, num, out);\n } else if (len < 63) {\n res = smallMulTo(this, num, out);\n } else if (len < 1024) {\n res = bigMulTo(this, num, out);\n } else {\n res = jumboMulTo(this, num, out);\n }\n\n return res;\n };\n\n // Cooley-Tukey algorithm for FFT\n // slightly revisited to rely on looping instead of recursion\n\n function FFTM (x, y) {\n this.x = x;\n this.y = y;\n }\n\n FFTM.prototype.makeRBT = function makeRBT (N) {\n var t = new Array(N);\n var l = BN.prototype._countBits(N) - 1;\n for (var i = 0; i < N; i++) {\n t[i] = this.revBin(i, l, N);\n }\n\n return t;\n };\n\n // Returns binary-reversed representation of `x`\n FFTM.prototype.revBin = function revBin (x, l, N) {\n if (x === 0 || x === N - 1) return x;\n\n var rb = 0;\n for (var i = 0; i < l; i++) {\n rb |= (x & 1) << (l - i - 1);\n x >>= 1;\n }\n\n return rb;\n };\n\n // Performs \"tweedling\" phase, therefore 'emulating'\n // behaviour of the recursive algorithm\n FFTM.prototype.permute = function permute (rbt, rws, iws, rtws, itws, N) {\n for (var i = 0; i < N; i++) {\n rtws[i] = rws[rbt[i]];\n itws[i] = iws[rbt[i]];\n }\n };\n\n FFTM.prototype.transform = function transform (rws, iws, rtws, itws, N, rbt) {\n this.permute(rbt, rws, iws, rtws, itws, N);\n\n for (var s = 1; s < N; s <<= 1) {\n var l = s << 1;\n\n var rtwdf = Math.cos(2 * Math.PI / l);\n var itwdf = Math.sin(2 * Math.PI / l);\n\n for (var p = 0; p < N; p += l) {\n var rtwdf_ = rtwdf;\n var itwdf_ = itwdf;\n\n for (var j = 0; j < s; j++) {\n var re = rtws[p + j];\n var ie = itws[p + j];\n\n var ro = rtws[p + j + s];\n var io = itws[p + j + s];\n\n var rx = rtwdf_ * ro - itwdf_ * io;\n\n io = rtwdf_ * io + itwdf_ * ro;\n ro = rx;\n\n rtws[p + j] = re + ro;\n itws[p + j] = ie + io;\n\n rtws[p + j + s] = re - ro;\n itws[p + j + s] = ie - io;\n\n /* jshint maxdepth : false */\n if (j !== l) {\n rx = rtwdf * rtwdf_ - itwdf * itwdf_;\n\n itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_;\n rtwdf_ = rx;\n }\n }\n }\n }\n };\n\n FFTM.prototype.guessLen13b = function guessLen13b (n, m) {\n var N = Math.max(m, n) | 1;\n var odd = N & 1;\n var i = 0;\n for (N = N / 2 | 0; N; N = N >>> 1) {\n i++;\n }\n\n return 1 << i + 1 + odd;\n };\n\n FFTM.prototype.conjugate = function conjugate (rws, iws, N) {\n if (N <= 1) return;\n\n for (var i = 0; i < N / 2; i++) {\n var t = rws[i];\n\n rws[i] = rws[N - i - 1];\n rws[N - i - 1] = t;\n\n t = iws[i];\n\n iws[i] = -iws[N - i - 1];\n iws[N - i - 1] = -t;\n }\n };\n\n FFTM.prototype.normalize13b = function normalize13b (ws, N) {\n var carry = 0;\n for (var i = 0; i < N / 2; i++) {\n var w = Math.round(ws[2 * i + 1] / N) * 0x2000 +\n Math.round(ws[2 * i] / N) +\n carry;\n\n ws[i] = w & 0x3ffffff;\n\n if (w < 0x4000000) {\n carry = 0;\n } else {\n carry = w / 0x4000000 | 0;\n }\n }\n\n return ws;\n };\n\n FFTM.prototype.convert13b = function convert13b (ws, len, rws, N) {\n var carry = 0;\n for (var i = 0; i < len; i++) {\n carry = carry + (ws[i] | 0);\n\n rws[2 * i] = carry & 0x1fff; carry = carry >>> 13;\n rws[2 * i + 1] = carry & 0x1fff; carry = carry >>> 13;\n }\n\n // Pad with zeroes\n for (i = 2 * len; i < N; ++i) {\n rws[i] = 0;\n }\n\n assert(carry === 0);\n assert((carry & ~0x1fff) === 0);\n };\n\n FFTM.prototype.stub = function stub (N) {\n var ph = new Array(N);\n for (var i = 0; i < N; i++) {\n ph[i] = 0;\n }\n\n return ph;\n };\n\n FFTM.prototype.mulp = function mulp (x, y, out) {\n var N = 2 * this.guessLen13b(x.length, y.length);\n\n var rbt = this.makeRBT(N);\n\n var _ = this.stub(N);\n\n var rws = new Array(N);\n var rwst = new Array(N);\n var iwst = new Array(N);\n\n var nrws = new Array(N);\n var nrwst = new Array(N);\n var niwst = new Array(N);\n\n var rmws = out.words;\n rmws.length = N;\n\n this.convert13b(x.words, x.length, rws, N);\n this.convert13b(y.words, y.length, nrws, N);\n\n this.transform(rws, _, rwst, iwst, N, rbt);\n this.transform(nrws, _, nrwst, niwst, N, rbt);\n\n for (var i = 0; i < N; i++) {\n var rx = rwst[i] * nrwst[i] - iwst[i] * niwst[i];\n iwst[i] = rwst[i] * niwst[i] + iwst[i] * nrwst[i];\n rwst[i] = rx;\n }\n\n this.conjugate(rwst, iwst, N);\n this.transform(rwst, iwst, rmws, _, N, rbt);\n this.conjugate(rmws, _, N);\n this.normalize13b(rmws, N);\n\n out.negative = x.negative ^ y.negative;\n out.length = x.length + y.length;\n return out.strip();\n };\n\n // Multiply `this` by `num`\n BN.prototype.mul = function mul (num) {\n var out = new BN(null);\n out.words = new Array(this.length + num.length);\n return this.mulTo(num, out);\n };\n\n // Multiply employing FFT\n BN.prototype.mulf = function mulf (num) {\n var out = new BN(null);\n out.words = new Array(this.length + num.length);\n return jumboMulTo(this, num, out);\n };\n\n // In-place Multiplication\n BN.prototype.imul = function imul (num) {\n return this.clone().mulTo(num, this);\n };\n\n BN.prototype.imuln = function imuln (num) {\n assert(typeof num === 'number');\n assert(num < 0x4000000);\n\n // Carry\n var carry = 0;\n for (var i = 0; i < this.length; i++) {\n var w = (this.words[i] | 0) * num;\n var lo = (w & 0x3ffffff) + (carry & 0x3ffffff);\n carry >>= 26;\n carry += (w / 0x4000000) | 0;\n // NOTE: lo is 27bit maximum\n carry += lo >>> 26;\n this.words[i] = lo & 0x3ffffff;\n }\n\n if (carry !== 0) {\n this.words[i] = carry;\n this.length++;\n }\n\n return this;\n };\n\n BN.prototype.muln = function muln (num) {\n return this.clone().imuln(num);\n };\n\n // `this` * `this`\n BN.prototype.sqr = function sqr () {\n return this.mul(this);\n };\n\n // `this` * `this` in-place\n BN.prototype.isqr = function isqr () {\n return this.imul(this.clone());\n };\n\n // Math.pow(`this`, `num`)\n BN.prototype.pow = function pow (num) {\n var w = toBitArray(num);\n if (w.length === 0) return new BN(1);\n\n // Skip leading zeroes\n var res = this;\n for (var i = 0; i < w.length; i++, res = res.sqr()) {\n if (w[i] !== 0) break;\n }\n\n if (++i < w.length) {\n for (var q = res.sqr(); i < w.length; i++, q = q.sqr()) {\n if (w[i] === 0) continue;\n\n res = res.mul(q);\n }\n }\n\n return res;\n };\n\n // Shift-left in-place\n BN.prototype.iushln = function iushln (bits) {\n assert(typeof bits === 'number' && bits >= 0);\n var r = bits % 26;\n var s = (bits - r) / 26;\n var carryMask = (0x3ffffff >>> (26 - r)) << (26 - r);\n var i;\n\n if (r !== 0) {\n var carry = 0;\n\n for (i = 0; i < this.length; i++) {\n var newCarry = this.words[i] & carryMask;\n var c = ((this.words[i] | 0) - newCarry) << r;\n this.words[i] = c | carry;\n carry = newCarry >>> (26 - r);\n }\n\n if (carry) {\n this.words[i] = carry;\n this.length++;\n }\n }\n\n if (s !== 0) {\n for (i = this.length - 1; i >= 0; i--) {\n this.words[i + s] = this.words[i];\n }\n\n for (i = 0; i < s; i++) {\n this.words[i] = 0;\n }\n\n this.length += s;\n }\n\n return this.strip();\n };\n\n BN.prototype.ishln = function ishln (bits) {\n // TODO(indutny): implement me\n assert(this.negative === 0);\n return this.iushln(bits);\n };\n\n // Shift-right in-place\n // NOTE: `hint` is a lowest bit before trailing zeroes\n // NOTE: if `extended` is present - it will be filled with destroyed bits\n BN.prototype.iushrn = function iushrn (bits, hint, extended) {\n assert(typeof bits === 'number' && bits >= 0);\n var h;\n if (hint) {\n h = (hint - (hint % 26)) / 26;\n } else {\n h = 0;\n }\n\n var r = bits % 26;\n var s = Math.min((bits - r) / 26, this.length);\n var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r);\n var maskedWords = extended;\n\n h -= s;\n h = Math.max(0, h);\n\n // Extended mode, copy masked part\n if (maskedWords) {\n for (var i = 0; i < s; i++) {\n maskedWords.words[i] = this.words[i];\n }\n maskedWords.length = s;\n }\n\n if (s === 0) {\n // No-op, we should not move anything at all\n } else if (this.length > s) {\n this.length -= s;\n for (i = 0; i < this.length; i++) {\n this.words[i] = this.words[i + s];\n }\n } else {\n this.words[0] = 0;\n this.length = 1;\n }\n\n var carry = 0;\n for (i = this.length - 1; i >= 0 && (carry !== 0 || i >= h); i--) {\n var word = this.words[i] | 0;\n this.words[i] = (carry << (26 - r)) | (word >>> r);\n carry = word & mask;\n }\n\n // Push carried bits as a mask\n if (maskedWords && carry !== 0) {\n maskedWords.words[maskedWords.length++] = carry;\n }\n\n if (this.length === 0) {\n this.words[0] = 0;\n this.length = 1;\n }\n\n return this.strip();\n };\n\n BN.prototype.ishrn = function ishrn (bits, hint, extended) {\n // TODO(indutny): implement me\n assert(this.negative === 0);\n return this.iushrn(bits, hint, extended);\n };\n\n // Shift-left\n BN.prototype.shln = function shln (bits) {\n return this.clone().ishln(bits);\n };\n\n BN.prototype.ushln = function ushln (bits) {\n return this.clone().iushln(bits);\n };\n\n // Shift-right\n BN.prototype.shrn = function shrn (bits) {\n return this.clone().ishrn(bits);\n };\n\n BN.prototype.ushrn = function ushrn (bits) {\n return this.clone().iushrn(bits);\n };\n\n // Test if n bit is set\n BN.prototype.testn = function testn (bit) {\n assert(typeof bit === 'number' && bit >= 0);\n var r = bit % 26;\n var s = (bit - r) / 26;\n var q = 1 << r;\n\n // Fast case: bit is much higher than all existing words\n if (this.length <= s) return false;\n\n // Check bit and return\n var w = this.words[s];\n\n return !!(w & q);\n };\n\n // Return only lowers bits of number (in-place)\n BN.prototype.imaskn = function imaskn (bits) {\n assert(typeof bits === 'number' && bits >= 0);\n var r = bits % 26;\n var s = (bits - r) / 26;\n\n assert(this.negative === 0, 'imaskn works only with positive numbers');\n\n if (this.length <= s) {\n return this;\n }\n\n if (r !== 0) {\n s++;\n }\n this.length = Math.min(s, this.length);\n\n if (r !== 0) {\n var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r);\n this.words[this.length - 1] &= mask;\n }\n\n return this.strip();\n };\n\n // Return only lowers bits of number\n BN.prototype.maskn = function maskn (bits) {\n return this.clone().imaskn(bits);\n };\n\n // Add plain number `num` to `this`\n BN.prototype.iaddn = function iaddn (num) {\n assert(typeof num === 'number');\n assert(num < 0x4000000);\n if (num < 0) return this.isubn(-num);\n\n // Possible sign change\n if (this.negative !== 0) {\n if (this.length === 1 && (this.words[0] | 0) < num) {\n this.words[0] = num - (this.words[0] | 0);\n this.negative = 0;\n return this;\n }\n\n this.negative = 0;\n this.isubn(num);\n this.negative = 1;\n return this;\n }\n\n // Add without checks\n return this._iaddn(num);\n };\n\n BN.prototype._iaddn = function _iaddn (num) {\n this.words[0] += num;\n\n // Carry\n for (var i = 0; i < this.length && this.words[i] >= 0x4000000; i++) {\n this.words[i] -= 0x4000000;\n if (i === this.length - 1) {\n this.words[i + 1] = 1;\n } else {\n this.words[i + 1]++;\n }\n }\n this.length = Math.max(this.length, i + 1);\n\n return this;\n };\n\n // Subtract plain number `num` from `this`\n BN.prototype.isubn = function isubn (num) {\n assert(typeof num === 'number');\n assert(num < 0x4000000);\n if (num < 0) return this.iaddn(-num);\n\n if (this.negative !== 0) {\n this.negative = 0;\n this.iaddn(num);\n this.negative = 1;\n return this;\n }\n\n this.words[0] -= num;\n\n if (this.length === 1 && this.words[0] < 0) {\n this.words[0] = -this.words[0];\n this.negative = 1;\n } else {\n // Carry\n for (var i = 0; i < this.length && this.words[i] < 0; i++) {\n this.words[i] += 0x4000000;\n this.words[i + 1] -= 1;\n }\n }\n\n return this.strip();\n };\n\n BN.prototype.addn = function addn (num) {\n return this.clone().iaddn(num);\n };\n\n BN.prototype.subn = function subn (num) {\n return this.clone().isubn(num);\n };\n\n BN.prototype.iabs = function iabs () {\n this.negative = 0;\n\n return this;\n };\n\n BN.prototype.abs = function abs () {\n return this.clone().iabs();\n };\n\n BN.prototype._ishlnsubmul = function _ishlnsubmul (num, mul, shift) {\n var len = num.length + shift;\n var i;\n\n this._expand(len);\n\n var w;\n var carry = 0;\n for (i = 0; i < num.length; i++) {\n w = (this.words[i + shift] | 0) + carry;\n var right = (num.words[i] | 0) * mul;\n w -= right & 0x3ffffff;\n carry = (w >> 26) - ((right / 0x4000000) | 0);\n this.words[i + shift] = w & 0x3ffffff;\n }\n for (; i < this.length - shift; i++) {\n w = (this.words[i + shift] | 0) + carry;\n carry = w >> 26;\n this.words[i + shift] = w & 0x3ffffff;\n }\n\n if (carry === 0) return this.strip();\n\n // Subtraction overflow\n assert(carry === -1);\n carry = 0;\n for (i = 0; i < this.length; i++) {\n w = -(this.words[i] | 0) + carry;\n carry = w >> 26;\n this.words[i] = w & 0x3ffffff;\n }\n this.negative = 1;\n\n return this.strip();\n };\n\n BN.prototype._wordDiv = function _wordDiv (num, mode) {\n var shift = this.length - num.length;\n\n var a = this.clone();\n var b = num;\n\n // Normalize\n var bhi = b.words[b.length - 1] | 0;\n var bhiBits = this._countBits(bhi);\n shift = 26 - bhiBits;\n if (shift !== 0) {\n b = b.ushln(shift);\n a.iushln(shift);\n bhi = b.words[b.length - 1] | 0;\n }\n\n // Initialize quotient\n var m = a.length - b.length;\n var q;\n\n if (mode !== 'mod') {\n q = new BN(null);\n q.length = m + 1;\n q.words = new Array(q.length);\n for (var i = 0; i < q.length; i++) {\n q.words[i] = 0;\n }\n }\n\n var diff = a.clone()._ishlnsubmul(b, 1, m);\n if (diff.negative === 0) {\n a = diff;\n if (q) {\n q.words[m] = 1;\n }\n }\n\n for (var j = m - 1; j >= 0; j--) {\n var qj = (a.words[b.length + j] | 0) * 0x4000000 +\n (a.words[b.length + j - 1] | 0);\n\n // NOTE: (qj / bhi) is (0x3ffffff * 0x4000000 + 0x3ffffff) / 0x2000000 max\n // (0x7ffffff)\n qj = Math.min((qj / bhi) | 0, 0x3ffffff);\n\n a._ishlnsubmul(b, qj, j);\n while (a.negative !== 0) {\n qj--;\n a.negative = 0;\n a._ishlnsubmul(b, 1, j);\n if (!a.isZero()) {\n a.negative ^= 1;\n }\n }\n if (q) {\n q.words[j] = qj;\n }\n }\n if (q) {\n q.strip();\n }\n a.strip();\n\n // Denormalize\n if (mode !== 'div' && shift !== 0) {\n a.iushrn(shift);\n }\n\n return {\n div: q || null,\n mod: a\n };\n };\n\n // NOTE: 1) `mode` can be set to `mod` to request mod only,\n // to `div` to request div only, or be absent to\n // request both div & mod\n // 2) `positive` is true if unsigned mod is requested\n BN.prototype.divmod = function divmod (num, mode, positive) {\n assert(!num.isZero());\n\n if (this.isZero()) {\n return {\n div: new BN(0),\n mod: new BN(0)\n };\n }\n\n var div, mod, res;\n if (this.negative !== 0 && num.negative === 0) {\n res = this.neg().divmod(num, mode);\n\n if (mode !== 'mod') {\n div = res.div.neg();\n }\n\n if (mode !== 'div') {\n mod = res.mod.neg();\n if (positive && mod.negative !== 0) {\n mod.iadd(num);\n }\n }\n\n return {\n div: div,\n mod: mod\n };\n }\n\n if (this.negative === 0 && num.negative !== 0) {\n res = this.divmod(num.neg(), mode);\n\n if (mode !== 'mod') {\n div = res.div.neg();\n }\n\n return {\n div: div,\n mod: res.mod\n };\n }\n\n if ((this.negative & num.negative) !== 0) {\n res = this.neg().divmod(num.neg(), mode);\n\n if (mode !== 'div') {\n mod = res.mod.neg();\n if (positive && mod.negative !== 0) {\n mod.isub(num);\n }\n }\n\n return {\n div: res.div,\n mod: mod\n };\n }\n\n // Both numbers are positive at this point\n\n // Strip both numbers to approximate shift value\n if (num.length > this.length || this.cmp(num) < 0) {\n return {\n div: new BN(0),\n mod: this\n };\n }\n\n // Very short reduction\n if (num.length === 1) {\n if (mode === 'div') {\n return {\n div: this.divn(num.words[0]),\n mod: null\n };\n }\n\n if (mode === 'mod') {\n return {\n div: null,\n mod: new BN(this.modn(num.words[0]))\n };\n }\n\n return {\n div: this.divn(num.words[0]),\n mod: new BN(this.modn(num.words[0]))\n };\n }\n\n return this._wordDiv(num, mode);\n };\n\n // Find `this` / `num`\n BN.prototype.div = function div (num) {\n return this.divmod(num, 'div', false).div;\n };\n\n // Find `this` % `num`\n BN.prototype.mod = function mod (num) {\n return this.divmod(num, 'mod', false).mod;\n };\n\n BN.prototype.umod = function umod (num) {\n return this.divmod(num, 'mod', true).mod;\n };\n\n // Find Round(`this` / `num`)\n BN.prototype.divRound = function divRound (num) {\n var dm = this.divmod(num);\n\n // Fast case - exact division\n if (dm.mod.isZero()) return dm.div;\n\n var mod = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod;\n\n var half = num.ushrn(1);\n var r2 = num.andln(1);\n var cmp = mod.cmp(half);\n\n // Round down\n if (cmp < 0 || r2 === 1 && cmp === 0) return dm.div;\n\n // Round up\n return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1);\n };\n\n BN.prototype.modn = function modn (num) {\n assert(num <= 0x3ffffff);\n var p = (1 << 26) % num;\n\n var acc = 0;\n for (var i = this.length - 1; i >= 0; i--) {\n acc = (p * acc + (this.words[i] | 0)) % num;\n }\n\n return acc;\n };\n\n // In-place division by number\n BN.prototype.idivn = function idivn (num) {\n assert(num <= 0x3ffffff);\n\n var carry = 0;\n for (var i = this.length - 1; i >= 0; i--) {\n var w = (this.words[i] | 0) + carry * 0x4000000;\n this.words[i] = (w / num) | 0;\n carry = w % num;\n }\n\n return this.strip();\n };\n\n BN.prototype.divn = function divn (num) {\n return this.clone().idivn(num);\n };\n\n BN.prototype.egcd = function egcd (p) {\n assert(p.negative === 0);\n assert(!p.isZero());\n\n var x = this;\n var y = p.clone();\n\n if (x.negative !== 0) {\n x = x.umod(p);\n } else {\n x = x.clone();\n }\n\n // A * x + B * y = x\n var A = new BN(1);\n var B = new BN(0);\n\n // C * x + D * y = y\n var C = new BN(0);\n var D = new BN(1);\n\n var g = 0;\n\n while (x.isEven() && y.isEven()) {\n x.iushrn(1);\n y.iushrn(1);\n ++g;\n }\n\n var yp = y.clone();\n var xp = x.clone();\n\n while (!x.isZero()) {\n for (var i = 0, im = 1; (x.words[0] & im) === 0 && i < 26; ++i, im <<= 1);\n if (i > 0) {\n x.iushrn(i);\n while (i-- > 0) {\n if (A.isOdd() || B.isOdd()) {\n A.iadd(yp);\n B.isub(xp);\n }\n\n A.iushrn(1);\n B.iushrn(1);\n }\n }\n\n for (var j = 0, jm = 1; (y.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);\n if (j > 0) {\n y.iushrn(j);\n while (j-- > 0) {\n if (C.isOdd() || D.isOdd()) {\n C.iadd(yp);\n D.isub(xp);\n }\n\n C.iushrn(1);\n D.iushrn(1);\n }\n }\n\n if (x.cmp(y) >= 0) {\n x.isub(y);\n A.isub(C);\n B.isub(D);\n } else {\n y.isub(x);\n C.isub(A);\n D.isub(B);\n }\n }\n\n return {\n a: C,\n b: D,\n gcd: y.iushln(g)\n };\n };\n\n // This is reduced incarnation of the binary EEA\n // above, designated to invert members of the\n // _prime_ fields F(p) at a maximal speed\n BN.prototype._invmp = function _invmp (p) {\n assert(p.negative === 0);\n assert(!p.isZero());\n\n var a = this;\n var b = p.clone();\n\n if (a.negative !== 0) {\n a = a.umod(p);\n } else {\n a = a.clone();\n }\n\n var x1 = new BN(1);\n var x2 = new BN(0);\n\n var delta = b.clone();\n\n while (a.cmpn(1) > 0 && b.cmpn(1) > 0) {\n for (var i = 0, im = 1; (a.words[0] & im) === 0 && i < 26; ++i, im <<= 1);\n if (i > 0) {\n a.iushrn(i);\n while (i-- > 0) {\n if (x1.isOdd()) {\n x1.iadd(delta);\n }\n\n x1.iushrn(1);\n }\n }\n\n for (var j = 0, jm = 1; (b.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);\n if (j > 0) {\n b.iushrn(j);\n while (j-- > 0) {\n if (x2.isOdd()) {\n x2.iadd(delta);\n }\n\n x2.iushrn(1);\n }\n }\n\n if (a.cmp(b) >= 0) {\n a.isub(b);\n x1.isub(x2);\n } else {\n b.isub(a);\n x2.isub(x1);\n }\n }\n\n var res;\n if (a.cmpn(1) === 0) {\n res = x1;\n } else {\n res = x2;\n }\n\n if (res.cmpn(0) < 0) {\n res.iadd(p);\n }\n\n return res;\n };\n\n BN.prototype.gcd = function gcd (num) {\n if (this.isZero()) return num.abs();\n if (num.isZero()) return this.abs();\n\n var a = this.clone();\n var b = num.clone();\n a.negative = 0;\n b.negative = 0;\n\n // Remove common factor of two\n for (var shift = 0; a.isEven() && b.isEven(); shift++) {\n a.iushrn(1);\n b.iushrn(1);\n }\n\n do {\n while (a.isEven()) {\n a.iushrn(1);\n }\n while (b.isEven()) {\n b.iushrn(1);\n }\n\n var r = a.cmp(b);\n if (r < 0) {\n // Swap `a` and `b` to make `a` always bigger than `b`\n var t = a;\n a = b;\n b = t;\n } else if (r === 0 || b.cmpn(1) === 0) {\n break;\n }\n\n a.isub(b);\n } while (true);\n\n return b.iushln(shift);\n };\n\n // Invert number in the field F(num)\n BN.prototype.invm = function invm (num) {\n return this.egcd(num).a.umod(num);\n };\n\n BN.prototype.isEven = function isEven () {\n return (this.words[0] & 1) === 0;\n };\n\n BN.prototype.isOdd = function isOdd () {\n return (this.words[0] & 1) === 1;\n };\n\n // And first word and num\n BN.prototype.andln = function andln (num) {\n return this.words[0] & num;\n };\n\n // Increment at the bit position in-line\n BN.prototype.bincn = function bincn (bit) {\n assert(typeof bit === 'number');\n var r = bit % 26;\n var s = (bit - r) / 26;\n var q = 1 << r;\n\n // Fast case: bit is much higher than all existing words\n if (this.length <= s) {\n this._expand(s + 1);\n this.words[s] |= q;\n return this;\n }\n\n // Add bit and propagate, if needed\n var carry = q;\n for (var i = s; carry !== 0 && i < this.length; i++) {\n var w = this.words[i] | 0;\n w += carry;\n carry = w >>> 26;\n w &= 0x3ffffff;\n this.words[i] = w;\n }\n if (carry !== 0) {\n this.words[i] = carry;\n this.length++;\n }\n return this;\n };\n\n BN.prototype.isZero = function isZero () {\n return this.length === 1 && this.words[0] === 0;\n };\n\n BN.prototype.cmpn = function cmpn (num) {\n var negative = num < 0;\n\n if (this.negative !== 0 && !negative) return -1;\n if (this.negative === 0 && negative) return 1;\n\n this.strip();\n\n var res;\n if (this.length > 1) {\n res = 1;\n } else {\n if (negative) {\n num = -num;\n }\n\n assert(num <= 0x3ffffff, 'Number is too big');\n\n var w = this.words[0] | 0;\n res = w === num ? 0 : w < num ? -1 : 1;\n }\n if (this.negative !== 0) return -res | 0;\n return res;\n };\n\n // Compare two numbers and return:\n // 1 - if `this` > `num`\n // 0 - if `this` == `num`\n // -1 - if `this` < `num`\n BN.prototype.cmp = function cmp (num) {\n if (this.negative !== 0 && num.negative === 0) return -1;\n if (this.negative === 0 && num.negative !== 0) return 1;\n\n var res = this.ucmp(num);\n if (this.negative !== 0) return -res | 0;\n return res;\n };\n\n // Unsigned comparison\n BN.prototype.ucmp = function ucmp (num) {\n // At this point both numbers have the same sign\n if (this.length > num.length) return 1;\n if (this.length < num.length) return -1;\n\n var res = 0;\n for (var i = this.length - 1; i >= 0; i--) {\n var a = this.words[i] | 0;\n var b = num.words[i] | 0;\n\n if (a === b) continue;\n if (a < b) {\n res = -1;\n } else if (a > b) {\n res = 1;\n }\n break;\n }\n return res;\n };\n\n BN.prototype.gtn = function gtn (num) {\n return this.cmpn(num) === 1;\n };\n\n BN.prototype.gt = function gt (num) {\n return this.cmp(num) === 1;\n };\n\n BN.prototype.gten = function gten (num) {\n return this.cmpn(num) >= 0;\n };\n\n BN.prototype.gte = function gte (num) {\n return this.cmp(num) >= 0;\n };\n\n BN.prototype.ltn = function ltn (num) {\n return this.cmpn(num) === -1;\n };\n\n BN.prototype.lt = function lt (num) {\n return this.cmp(num) === -1;\n };\n\n BN.prototype.lten = function lten (num) {\n return this.cmpn(num) <= 0;\n };\n\n BN.prototype.lte = function lte (num) {\n return this.cmp(num) <= 0;\n };\n\n BN.prototype.eqn = function eqn (num) {\n return this.cmpn(num) === 0;\n };\n\n BN.prototype.eq = function eq (num) {\n return this.cmp(num) === 0;\n };\n\n //\n // A reduce context, could be using montgomery or something better, depending\n // on the `m` itself.\n //\n BN.red = function red (num) {\n return new Red(num);\n };\n\n BN.prototype.toRed = function toRed (ctx) {\n assert(!this.red, 'Already a number in reduction context');\n assert(this.negative === 0, 'red works only with positives');\n return ctx.convertTo(this)._forceRed(ctx);\n };\n\n BN.prototype.fromRed = function fromRed () {\n assert(this.red, 'fromRed works only with numbers in reduction context');\n return this.red.convertFrom(this);\n };\n\n BN.prototype._forceRed = function _forceRed (ctx) {\n this.red = ctx;\n return this;\n };\n\n BN.prototype.forceRed = function forceRed (ctx) {\n assert(!this.red, 'Already a number in reduction context');\n return this._forceRed(ctx);\n };\n\n BN.prototype.redAdd = function redAdd (num) {\n assert(this.red, 'redAdd works only with red numbers');\n return this.red.add(this, num);\n };\n\n BN.prototype.redIAdd = function redIAdd (num) {\n assert(this.red, 'redIAdd works only with red numbers');\n return this.red.iadd(this, num);\n };\n\n BN.prototype.redSub = function redSub (num) {\n assert(this.red, 'redSub works only with red numbers');\n return this.red.sub(this, num);\n };\n\n BN.prototype.redISub = function redISub (num) {\n assert(this.red, 'redISub works only with red numbers');\n return this.red.isub(this, num);\n };\n\n BN.prototype.redShl = function redShl (num) {\n assert(this.red, 'redShl works only with red numbers');\n return this.red.shl(this, num);\n };\n\n BN.prototype.redMul = function redMul (num) {\n assert(this.red, 'redMul works only with red numbers');\n this.red._verify2(this, num);\n return this.red.mul(this, num);\n };\n\n BN.prototype.redIMul = function redIMul (num) {\n assert(this.red, 'redMul works only with red numbers');\n this.red._verify2(this, num);\n return this.red.imul(this, num);\n };\n\n BN.prototype.redSqr = function redSqr () {\n assert(this.red, 'redSqr works only with red numbers');\n this.red._verify1(this);\n return this.red.sqr(this);\n };\n\n BN.prototype.redISqr = function redISqr () {\n assert(this.red, 'redISqr works only with red numbers');\n this.red._verify1(this);\n return this.red.isqr(this);\n };\n\n // Square root over p\n BN.prototype.redSqrt = function redSqrt () {\n assert(this.red, 'redSqrt works only with red numbers');\n this.red._verify1(this);\n return this.red.sqrt(this);\n };\n\n BN.prototype.redInvm = function redInvm () {\n assert(this.red, 'redInvm works only with red numbers');\n this.red._verify1(this);\n return this.red.invm(this);\n };\n\n // Return negative clone of `this` % `red modulo`\n BN.prototype.redNeg = function redNeg () {\n assert(this.red, 'redNeg works only with red numbers');\n this.red._verify1(this);\n return this.red.neg(this);\n };\n\n BN.prototype.redPow = function redPow (num) {\n assert(this.red && !num.red, 'redPow(normalNum)');\n this.red._verify1(this);\n return this.red.pow(this, num);\n };\n\n // Prime numbers with efficient reduction\n var primes = {\n k256: null,\n p224: null,\n p192: null,\n p25519: null\n };\n\n // Pseudo-Mersenne prime\n function MPrime (name, p) {\n // P = 2 ^ N - K\n this.name = name;\n this.p = new BN(p, 16);\n this.n = this.p.bitLength();\n this.k = new BN(1).iushln(this.n).isub(this.p);\n\n this.tmp = this._tmp();\n }\n\n MPrime.prototype._tmp = function _tmp () {\n var tmp = new BN(null);\n tmp.words = new Array(Math.ceil(this.n / 13));\n return tmp;\n };\n\n MPrime.prototype.ireduce = function ireduce (num) {\n // Assumes that `num` is less than `P^2`\n // num = HI * (2 ^ N - K) + HI * K + LO = HI * K + LO (mod P)\n var r = num;\n var rlen;\n\n do {\n this.split(r, this.tmp);\n r = this.imulK(r);\n r = r.iadd(this.tmp);\n rlen = r.bitLength();\n } while (rlen > this.n);\n\n var cmp = rlen < this.n ? -1 : r.ucmp(this.p);\n if (cmp === 0) {\n r.words[0] = 0;\n r.length = 1;\n } else if (cmp > 0) {\n r.isub(this.p);\n } else {\n r.strip();\n }\n\n return r;\n };\n\n MPrime.prototype.split = function split (input, out) {\n input.iushrn(this.n, 0, out);\n };\n\n MPrime.prototype.imulK = function imulK (num) {\n return num.imul(this.k);\n };\n\n function K256 () {\n MPrime.call(\n this,\n 'k256',\n 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f');\n }\n inherits(K256, MPrime);\n\n K256.prototype.split = function split (input, output) {\n // 256 = 9 * 26 + 22\n var mask = 0x3fffff;\n\n var outLen = Math.min(input.length, 9);\n for (var i = 0; i < outLen; i++) {\n output.words[i] = input.words[i];\n }\n output.length = outLen;\n\n if (input.length <= 9) {\n input.words[0] = 0;\n input.length = 1;\n return;\n }\n\n // Shift by 9 limbs\n var prev = input.words[9];\n output.words[output.length++] = prev & mask;\n\n for (i = 10; i < input.length; i++) {\n var next = input.words[i] | 0;\n input.words[i - 10] = ((next & mask) << 4) | (prev >>> 22);\n prev = next;\n }\n prev >>>= 22;\n input.words[i - 10] = prev;\n if (prev === 0 && input.length > 10) {\n input.length -= 10;\n } else {\n input.length -= 9;\n }\n };\n\n K256.prototype.imulK = function imulK (num) {\n // K = 0x1000003d1 = [ 0x40, 0x3d1 ]\n num.words[num.length] = 0;\n num.words[num.length + 1] = 0;\n num.length += 2;\n\n // bounded at: 0x40 * 0x3ffffff + 0x3d0 = 0x100000390\n var lo = 0;\n for (var i = 0; i < num.length; i++) {\n var w = num.words[i] | 0;\n lo += w * 0x3d1;\n num.words[i] = lo & 0x3ffffff;\n lo = w * 0x40 + ((lo / 0x4000000) | 0);\n }\n\n // Fast length reduction\n if (num.words[num.length - 1] === 0) {\n num.length--;\n if (num.words[num.length - 1] === 0) {\n num.length--;\n }\n }\n return num;\n };\n\n function P224 () {\n MPrime.call(\n this,\n 'p224',\n 'ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001');\n }\n inherits(P224, MPrime);\n\n function P192 () {\n MPrime.call(\n this,\n 'p192',\n 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff');\n }\n inherits(P192, MPrime);\n\n function P25519 () {\n // 2 ^ 255 - 19\n MPrime.call(\n this,\n '25519',\n '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed');\n }\n inherits(P25519, MPrime);\n\n P25519.prototype.imulK = function imulK (num) {\n // K = 0x13\n var carry = 0;\n for (var i = 0; i < num.length; i++) {\n var hi = (num.words[i] | 0) * 0x13 + carry;\n var lo = hi & 0x3ffffff;\n hi >>>= 26;\n\n num.words[i] = lo;\n carry = hi;\n }\n if (carry !== 0) {\n num.words[num.length++] = carry;\n }\n return num;\n };\n\n // Exported mostly for testing purposes, use plain name instead\n BN._prime = function prime (name) {\n // Cached version of prime\n if (primes[name]) return primes[name];\n\n var prime;\n if (name === 'k256') {\n prime = new K256();\n } else if (name === 'p224') {\n prime = new P224();\n } else if (name === 'p192') {\n prime = new P192();\n } else if (name === 'p25519') {\n prime = new P25519();\n } else {\n throw new Error('Unknown prime ' + name);\n }\n primes[name] = prime;\n\n return prime;\n };\n\n //\n // Base reduction engine\n //\n function Red (m) {\n if (typeof m === 'string') {\n var prime = BN._prime(m);\n this.m = prime.p;\n this.prime = prime;\n } else {\n assert(m.gtn(1), 'modulus must be greater than 1');\n this.m = m;\n this.prime = null;\n }\n }\n\n Red.prototype._verify1 = function _verify1 (a) {\n assert(a.negative === 0, 'red works only with positives');\n assert(a.red, 'red works only with red numbers');\n };\n\n Red.prototype._verify2 = function _verify2 (a, b) {\n assert((a.negative | b.negative) === 0, 'red works only with positives');\n assert(a.red && a.red === b.red,\n 'red works only with red numbers');\n };\n\n Red.prototype.imod = function imod (a) {\n if (this.prime) return this.prime.ireduce(a)._forceRed(this);\n return a.umod(this.m)._forceRed(this);\n };\n\n Red.prototype.neg = function neg (a) {\n if (a.isZero()) {\n return a.clone();\n }\n\n return this.m.sub(a)._forceRed(this);\n };\n\n Red.prototype.add = function add (a, b) {\n this._verify2(a, b);\n\n var res = a.add(b);\n if (res.cmp(this.m) >= 0) {\n res.isub(this.m);\n }\n return res._forceRed(this);\n };\n\n Red.prototype.iadd = function iadd (a, b) {\n this._verify2(a, b);\n\n var res = a.iadd(b);\n if (res.cmp(this.m) >= 0) {\n res.isub(this.m);\n }\n return res;\n };\n\n Red.prototype.sub = function sub (a, b) {\n this._verify2(a, b);\n\n var res = a.sub(b);\n if (res.cmpn(0) < 0) {\n res.iadd(this.m);\n }\n return res._forceRed(this);\n };\n\n Red.prototype.isub = function isub (a, b) {\n this._verify2(a, b);\n\n var res = a.isub(b);\n if (res.cmpn(0) < 0) {\n res.iadd(this.m);\n }\n return res;\n };\n\n Red.prototype.shl = function shl (a, num) {\n this._verify1(a);\n return this.imod(a.ushln(num));\n };\n\n Red.prototype.imul = function imul (a, b) {\n this._verify2(a, b);\n return this.imod(a.imul(b));\n };\n\n Red.prototype.mul = function mul (a, b) {\n this._verify2(a, b);\n return this.imod(a.mul(b));\n };\n\n Red.prototype.isqr = function isqr (a) {\n return this.imul(a, a.clone());\n };\n\n Red.prototype.sqr = function sqr (a) {\n return this.mul(a, a);\n };\n\n Red.prototype.sqrt = function sqrt (a) {\n if (a.isZero()) return a.clone();\n\n var mod3 = this.m.andln(3);\n assert(mod3 % 2 === 1);\n\n // Fast case\n if (mod3 === 3) {\n var pow = this.m.add(new BN(1)).iushrn(2);\n return this.pow(a, pow);\n }\n\n // Tonelli-Shanks algorithm (Totally unoptimized and slow)\n //\n // Find Q and S, that Q * 2 ^ S = (P - 1)\n var q = this.m.subn(1);\n var s = 0;\n while (!q.isZero() && q.andln(1) === 0) {\n s++;\n q.iushrn(1);\n }\n assert(!q.isZero());\n\n var one = new BN(1).toRed(this);\n var nOne = one.redNeg();\n\n // Find quadratic non-residue\n // NOTE: Max is such because of generalized Riemann hypothesis.\n var lpow = this.m.subn(1).iushrn(1);\n var z = this.m.bitLength();\n z = new BN(2 * z * z).toRed(this);\n\n while (this.pow(z, lpow).cmp(nOne) !== 0) {\n z.redIAdd(nOne);\n }\n\n var c = this.pow(z, q);\n var r = this.pow(a, q.addn(1).iushrn(1));\n var t = this.pow(a, q);\n var m = s;\n while (t.cmp(one) !== 0) {\n var tmp = t;\n for (var i = 0; tmp.cmp(one) !== 0; i++) {\n tmp = tmp.redSqr();\n }\n assert(i < m);\n var b = this.pow(c, new BN(1).iushln(m - i - 1));\n\n r = r.redMul(b);\n c = b.redSqr();\n t = t.redMul(c);\n m = i;\n }\n\n return r;\n };\n\n Red.prototype.invm = function invm (a) {\n var inv = a._invmp(this.m);\n if (inv.negative !== 0) {\n inv.negative = 0;\n return this.imod(inv).redNeg();\n } else {\n return this.imod(inv);\n }\n };\n\n Red.prototype.pow = function pow (a, num) {\n if (num.isZero()) return new BN(1).toRed(this);\n if (num.cmpn(1) === 0) return a.clone();\n\n var windowSize = 4;\n var wnd = new Array(1 << windowSize);\n wnd[0] = new BN(1).toRed(this);\n wnd[1] = a;\n for (var i = 2; i < wnd.length; i++) {\n wnd[i] = this.mul(wnd[i - 1], a);\n }\n\n var res = wnd[0];\n var current = 0;\n var currentLen = 0;\n var start = num.bitLength() % 26;\n if (start === 0) {\n start = 26;\n }\n\n for (i = num.length - 1; i >= 0; i--) {\n var word = num.words[i];\n for (var j = start - 1; j >= 0; j--) {\n var bit = (word >> j) & 1;\n if (res !== wnd[0]) {\n res = this.sqr(res);\n }\n\n if (bit === 0 && current === 0) {\n currentLen = 0;\n continue;\n }\n\n current <<= 1;\n current |= bit;\n currentLen++;\n if (currentLen !== windowSize && (i !== 0 || j !== 0)) continue;\n\n res = this.mul(res, wnd[current]);\n currentLen = 0;\n current = 0;\n }\n start = 26;\n }\n\n return res;\n };\n\n Red.prototype.convertTo = function convertTo (num) {\n var r = num.umod(this.m);\n\n return r === num ? r.clone() : r;\n };\n\n Red.prototype.convertFrom = function convertFrom (num) {\n var res = num.clone();\n res.red = null;\n return res;\n };\n\n //\n // Montgomery method engine\n //\n\n BN.mont = function mont (num) {\n return new Mont(num);\n };\n\n function Mont (m) {\n Red.call(this, m);\n\n this.shift = this.m.bitLength();\n if (this.shift % 26 !== 0) {\n this.shift += 26 - (this.shift % 26);\n }\n\n this.r = new BN(1).iushln(this.shift);\n this.r2 = this.imod(this.r.sqr());\n this.rinv = this.r._invmp(this.m);\n\n this.minv = this.rinv.mul(this.r).isubn(1).div(this.m);\n this.minv = this.minv.umod(this.r);\n this.minv = this.r.sub(this.minv);\n }\n inherits(Mont, Red);\n\n Mont.prototype.convertTo = function convertTo (num) {\n return this.imod(num.ushln(this.shift));\n };\n\n Mont.prototype.convertFrom = function convertFrom (num) {\n var r = this.imod(num.mul(this.rinv));\n r.red = null;\n return r;\n };\n\n Mont.prototype.imul = function imul (a, b) {\n if (a.isZero() || b.isZero()) {\n a.words[0] = 0;\n a.length = 1;\n return a;\n }\n\n var t = a.imul(b);\n var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);\n var u = t.isub(c).iushrn(this.shift);\n var res = u;\n\n if (u.cmp(this.m) >= 0) {\n res = u.isub(this.m);\n } else if (u.cmpn(0) < 0) {\n res = u.iadd(this.m);\n }\n\n return res._forceRed(this);\n };\n\n Mont.prototype.mul = function mul (a, b) {\n if (a.isZero() || b.isZero()) return new BN(0)._forceRed(this);\n\n var t = a.mul(b);\n var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);\n var u = t.isub(c).iushrn(this.shift);\n var res = u;\n if (u.cmp(this.m) >= 0) {\n res = u.isub(this.m);\n } else if (u.cmpn(0) < 0) {\n res = u.iadd(this.m);\n }\n\n return res._forceRed(this);\n };\n\n Mont.prototype.invm = function invm (a) {\n // (AR)^-1 * R^2 = (A^-1 * R^-1) * R^2 = A^-1 * R\n var res = this.imod(a._invmp(this.m).mul(this.r2));\n return res._forceRed(this);\n };\n})(typeof module === 'undefined' || module, this);\n","import BN from 'bn.js';\n\n/**\n * @fileoverview\n * BigInteger implementation of basic operations\n * Wrapper of bn.js library (wwww.github.com/indutny/bn.js)\n * @module biginteger/bn\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 undefined input\n */\n constructor(n) {\n if (n === undefined) {\n throw new Error('Invalid BigInteger input');\n }\n\n this.value = new BN(n);\n }\n\n clone() {\n const clone = new BigInteger(null);\n this.value.copy(clone.value);\n return clone;\n }\n\n /**\n * BigInteger increment in place\n */\n iinc() {\n this.value.iadd(new BN(1));\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.isub(new BN(1));\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 /**\n * BigInteger addition in place\n * @param {BigInteger} x - Value to add\n */\n iadd(x) {\n this.value.iadd(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.isub(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.imul(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 = this.value.umod(m.value);\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\n * Much faster than this.exp(e).mod(n)\n * @param {BigInteger} e - Exponent\n * @param {BigInteger} n - Modulo\n * @returns {BigInteger} this ** e mod n.\n */\n modExp(e, n) {\n // We use either Montgomery or normal reduction context\n // Montgomery requires coprime n and R (montogmery multiplier)\n // bn.js picks R as power of 2, so n must be odd\n const nred = n.isEven() ? BN.red(n.value) : BN.mont(n.value);\n const x = this.clone();\n x.value = x.value.toRed(nred).redPow(e.value).fromRed();\n return x;\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 // invm returns a wrong result if the inverse does not exist\n if (!this.gcd(n).isOne()) {\n throw new Error('Inverse does not exist');\n }\n return new BigInteger(this.value.invm(n.value));\n }\n\n /**\n * Compute greatest common divisor between this and n\n * @param {BigInteger} n - Operand\n * @returns {BigInteger} gcd\n */\n gcd(n) {\n return new BigInteger(this.value.gcd(n.value));\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.ishln(x.value.toNumber());\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.ishrn(x.value.toNumber());\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.eq(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.lt(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.lte(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.gt(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.gte(x.value);\n }\n\n isZero() {\n return this.value.isZero();\n }\n\n isOne() {\n return this.value.eq(new BN(1));\n }\n\n isNegative() {\n return this.value.isNeg();\n }\n\n isEven() {\n return this.value.isEven();\n }\n\n abs() {\n const res = this.clone();\n res.value = res.value.abs();\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 return this.value.toNumber();\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 return this.value.testn(i) ? 1 : 0;\n }\n\n /**\n * Compute bit length\n * @returns {Number} Bit length.\n */\n bitLength() {\n return this.value.bitLength();\n }\n\n /**\n * Compute byte length\n * @returns {Number} Byte length.\n */\n byteLength() {\n return this.value.byteLength();\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 return this.value.toArrayLike(Uint8Array, endian, length);\n }\n}\n","var r;\n\nmodule.exports = function rand(len) {\n if (!r)\n r = new Rand(null);\n\n return r.generate(len);\n};\n\nfunction Rand(rand) {\n this.rand = rand;\n}\nmodule.exports.Rand = Rand;\n\nRand.prototype.generate = function generate(len) {\n return this._rand(len);\n};\n\n// Emulate crypto API using randy\nRand.prototype._rand = function _rand(n) {\n if (this.rand.getBytes)\n return this.rand.getBytes(n);\n\n var res = new Uint8Array(n);\n for (var i = 0; i < res.length; i++)\n res[i] = this.rand.getByte();\n return res;\n};\n\nif (typeof self === 'object') {\n if (self.crypto && self.crypto.getRandomValues) {\n // Modern browsers\n Rand.prototype._rand = function _rand(n) {\n var arr = new Uint8Array(n);\n self.crypto.getRandomValues(arr);\n return arr;\n };\n } else if (self.msCrypto && self.msCrypto.getRandomValues) {\n // IE\n Rand.prototype._rand = function _rand(n) {\n var arr = new Uint8Array(n);\n self.msCrypto.getRandomValues(arr);\n return arr;\n };\n\n // Safari's WebWorkers do not have `crypto`\n } else if (typeof window === 'object') {\n // Old junk\n Rand.prototype._rand = function() {\n throw new Error('Not implemented yet');\n };\n }\n} else {\n // Node.js or Web worker with no crypto support\n try {\n var crypto = require('crypto');\n if (typeof crypto.randomBytes !== 'function')\n throw new Error('Not supported');\n\n Rand.prototype._rand = function _rand(n) {\n return crypto.randomBytes(n);\n };\n } catch (e) {\n }\n}\n","'use strict';\n\nvar utils = exports;\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 for (var i = 0; i < msg.length; i++)\n res[i] = msg[i] | 0;\n return res;\n }\n if (enc === 'hex') {\n msg = msg.replace(/[^a-z0-9]+/ig, '');\n if (msg.length % 2 !== 0)\n msg = '0' + msg;\n for (var i = 0; i < msg.length; i += 2)\n res.push(parseInt(msg[i] + msg[i + 1], 16));\n } else {\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 }\n return res;\n}\nutils.toArray = toArray;\n\nfunction zero2(word) {\n if (word.length === 1)\n return '0' + word;\n else\n return word;\n}\nutils.zero2 = zero2;\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}\nutils.toHex = toHex;\n\nutils.encode = function encode(arr, enc) {\n if (enc === 'hex')\n return toHex(arr);\n else\n return arr;\n};\n","'use strict';\n\nvar utils = exports;\nvar BN = require('bn.js');\nvar minAssert = require('minimalistic-assert');\nvar minUtils = require('minimalistic-crypto-utils');\n\nutils.assert = minAssert;\nutils.toArray = minUtils.toArray;\nutils.zero2 = minUtils.zero2;\nutils.toHex = minUtils.toHex;\nutils.encode = minUtils.encode;\n\n// Represent num in a w-NAF form\nfunction getNAF(num, w) {\n var naf = [];\n var ws = 1 << (w + 1);\n var k = num.clone();\n while (k.cmpn(1) >= 0) {\n var z;\n if (k.isOdd()) {\n var mod = k.andln(ws - 1);\n if (mod > (ws >> 1) - 1)\n z = (ws >> 1) - mod;\n else\n z = mod;\n k.isubn(z);\n } else {\n z = 0;\n }\n naf.push(z);\n\n // Optimization, shift by word if possible\n var shift = (k.cmpn(0) !== 0 && k.andln(ws - 1) === 0) ? (w + 1) : 1;\n for (var i = 1; i < shift; i++)\n naf.push(0);\n k.iushrn(shift);\n }\n\n return naf;\n}\nutils.getNAF = getNAF;\n\n// Represent k1, k2 in a Joint Sparse Form\nfunction getJSF(k1, k2) {\n var jsf = [\n [],\n []\n ];\n\n k1 = k1.clone();\n k2 = k2.clone();\n var d1 = 0;\n var d2 = 0;\n while (k1.cmpn(-d1) > 0 || k2.cmpn(-d2) > 0) {\n\n // First phase\n var m14 = (k1.andln(3) + d1) & 3;\n var m24 = (k2.andln(3) + d2) & 3;\n if (m14 === 3)\n m14 = -1;\n if (m24 === 3)\n m24 = -1;\n var u1;\n if ((m14 & 1) === 0) {\n u1 = 0;\n } else {\n var m8 = (k1.andln(7) + d1) & 7;\n if ((m8 === 3 || m8 === 5) && m24 === 2)\n u1 = -m14;\n else\n u1 = m14;\n }\n jsf[0].push(u1);\n\n var u2;\n if ((m24 & 1) === 0) {\n u2 = 0;\n } else {\n var m8 = (k2.andln(7) + d2) & 7;\n if ((m8 === 3 || m8 === 5) && m14 === 2)\n u2 = -m24;\n else\n u2 = m24;\n }\n jsf[1].push(u2);\n\n // Second phase\n if (2 * d1 === u1 + 1)\n d1 = 1 - d1;\n if (2 * d2 === u2 + 1)\n d2 = 1 - d2;\n k1.iushrn(1);\n k2.iushrn(1);\n }\n\n return jsf;\n}\nutils.getJSF = getJSF;\n\nfunction cachedProperty(obj, name, computer) {\n var key = '_' + name;\n obj.prototype[name] = function cachedProperty() {\n return this[key] !== undefined ? this[key] :\n this[key] = computer.call(this);\n };\n}\nutils.cachedProperty = cachedProperty;\n\nfunction parseBytes(bytes) {\n return typeof bytes === 'string' ? utils.toArray(bytes, 'hex') :\n bytes;\n}\nutils.parseBytes = parseBytes;\n\nfunction intFromLE(bytes) {\n return new BN(bytes, 'hex', 'le');\n}\nutils.intFromLE = intFromLE;\n\n","'use strict';\n\nvar BN = require('bn.js');\nvar utils = require('../utils');\nvar getNAF = utils.getNAF;\nvar getJSF = utils.getJSF;\nvar assert = utils.assert;\n\nfunction BaseCurve(type, conf) {\n this.type = type;\n this.p = new BN(conf.p, 16);\n\n // Use Montgomery, when there is no fast reduction for the prime\n this.red = conf.prime ? BN.red(conf.prime) : BN.mont(this.p);\n\n // Useful for many curves\n this.zero = new BN(0).toRed(this.red);\n this.one = new BN(1).toRed(this.red);\n this.two = new BN(2).toRed(this.red);\n\n // Curve configuration, optional\n this.n = conf.n && new BN(conf.n, 16);\n this.g = conf.g && this.pointFromJSON(conf.g, conf.gRed);\n\n // Temporary arrays\n this._wnafT1 = new Array(4);\n this._wnafT2 = new Array(4);\n this._wnafT3 = new Array(4);\n this._wnafT4 = new Array(4);\n\n // Generalized Greg Maxwell's trick\n var adjustCount = this.n && this.p.div(this.n);\n if (!adjustCount || adjustCount.cmpn(100) > 0) {\n this.redN = null;\n } else {\n this._maxwellTrick = true;\n this.redN = this.n.toRed(this.red);\n }\n}\nmodule.exports = BaseCurve;\n\nBaseCurve.prototype.point = function point() {\n throw new Error('Not implemented');\n};\n\nBaseCurve.prototype.validate = function validate() {\n throw new Error('Not implemented');\n};\n\nBaseCurve.prototype._fixedNafMul = function _fixedNafMul(p, k) {\n assert(p.precomputed);\n var doubles = p._getDoubles();\n\n var naf = getNAF(k, 1);\n var I = (1 << (doubles.step + 1)) - (doubles.step % 2 === 0 ? 2 : 1);\n I /= 3;\n\n // Translate into more windowed form\n var repr = [];\n for (var j = 0; j < naf.length; j += doubles.step) {\n var nafW = 0;\n for (var k = j + doubles.step - 1; k >= j; k--)\n nafW = (nafW << 1) + naf[k];\n repr.push(nafW);\n }\n\n var a = this.jpoint(null, null, null);\n var b = this.jpoint(null, null, null);\n for (var i = I; i > 0; i--) {\n for (var j = 0; j < repr.length; j++) {\n var nafW = repr[j];\n if (nafW === i)\n b = b.mixedAdd(doubles.points[j]);\n else if (nafW === -i)\n b = b.mixedAdd(doubles.points[j].neg());\n }\n a = a.add(b);\n }\n return a.toP();\n};\n\nBaseCurve.prototype._wnafMul = function _wnafMul(p, k) {\n var w = 4;\n\n // Precompute window\n var nafPoints = p._getNAFPoints(w);\n w = nafPoints.wnd;\n var wnd = nafPoints.points;\n\n // Get NAF form\n var naf = getNAF(k, w);\n\n // Add `this`*(N+1) for every w-NAF index\n var acc = this.jpoint(null, null, null);\n for (var i = naf.length - 1; i >= 0; i--) {\n // Count zeroes\n for (var k = 0; i >= 0 && naf[i] === 0; i--)\n k++;\n if (i >= 0)\n k++;\n acc = acc.dblp(k);\n\n if (i < 0)\n break;\n var z = naf[i];\n assert(z !== 0);\n if (p.type === 'affine') {\n // J +- P\n if (z > 0)\n acc = acc.mixedAdd(wnd[(z - 1) >> 1]);\n else\n acc = acc.mixedAdd(wnd[(-z - 1) >> 1].neg());\n } else {\n // J +- J\n if (z > 0)\n acc = acc.add(wnd[(z - 1) >> 1]);\n else\n acc = acc.add(wnd[(-z - 1) >> 1].neg());\n }\n }\n return p.type === 'affine' ? acc.toP() : acc;\n};\n\nBaseCurve.prototype._wnafMulAdd = function _wnafMulAdd(defW,\n points,\n coeffs,\n len,\n jacobianResult) {\n var wndWidth = this._wnafT1;\n var wnd = this._wnafT2;\n var naf = this._wnafT3;\n\n // Fill all arrays\n var max = 0;\n for (var i = 0; i < len; i++) {\n var p = points[i];\n var nafPoints = p._getNAFPoints(defW);\n wndWidth[i] = nafPoints.wnd;\n wnd[i] = nafPoints.points;\n }\n\n // Comb small window NAFs\n for (var i = len - 1; i >= 1; i -= 2) {\n var a = i - 1;\n var b = i;\n if (wndWidth[a] !== 1 || wndWidth[b] !== 1) {\n naf[a] = getNAF(coeffs[a], wndWidth[a]);\n naf[b] = getNAF(coeffs[b], wndWidth[b]);\n max = Math.max(naf[a].length, max);\n max = Math.max(naf[b].length, max);\n continue;\n }\n\n var comb = [\n points[a], /* 1 */\n null, /* 3 */\n null, /* 5 */\n points[b] /* 7 */\n ];\n\n // Try to avoid Projective points, if possible\n if (points[a].y.cmp(points[b].y) === 0) {\n comb[1] = points[a].add(points[b]);\n comb[2] = points[a].toJ().mixedAdd(points[b].neg());\n } else if (points[a].y.cmp(points[b].y.redNeg()) === 0) {\n comb[1] = points[a].toJ().mixedAdd(points[b]);\n comb[2] = points[a].add(points[b].neg());\n } else {\n comb[1] = points[a].toJ().mixedAdd(points[b]);\n comb[2] = points[a].toJ().mixedAdd(points[b].neg());\n }\n\n var index = [\n -3, /* -1 -1 */\n -1, /* -1 0 */\n -5, /* -1 1 */\n -7, /* 0 -1 */\n 0, /* 0 0 */\n 7, /* 0 1 */\n 5, /* 1 -1 */\n 1, /* 1 0 */\n 3 /* 1 1 */\n ];\n\n var jsf = getJSF(coeffs[a], coeffs[b]);\n max = Math.max(jsf[0].length, max);\n naf[a] = new Array(max);\n naf[b] = new Array(max);\n for (var j = 0; j < max; j++) {\n var ja = jsf[0][j] | 0;\n var jb = jsf[1][j] | 0;\n\n naf[a][j] = index[(ja + 1) * 3 + (jb + 1)];\n naf[b][j] = 0;\n wnd[a] = comb;\n }\n }\n\n var acc = this.jpoint(null, null, null);\n var tmp = this._wnafT4;\n for (var i = max; i >= 0; i--) {\n var k = 0;\n\n while (i >= 0) {\n var zero = true;\n for (var j = 0; j < len; j++) {\n tmp[j] = naf[j][i] | 0;\n if (tmp[j] !== 0)\n zero = false;\n }\n if (!zero)\n break;\n k++;\n i--;\n }\n if (i >= 0)\n k++;\n acc = acc.dblp(k);\n if (i < 0)\n break;\n\n for (var j = 0; j < len; j++) {\n var z = tmp[j];\n var p;\n if (z === 0)\n continue;\n else if (z > 0)\n p = wnd[j][(z - 1) >> 1];\n else if (z < 0)\n p = wnd[j][(-z - 1) >> 1].neg();\n\n if (p.type === 'affine')\n acc = acc.mixedAdd(p);\n else\n acc = acc.add(p);\n }\n }\n // Zeroify references\n for (var i = 0; i < len; i++)\n wnd[i] = null;\n\n if (jacobianResult)\n return acc;\n else\n return acc.toP();\n};\n\nfunction BasePoint(curve, type) {\n this.curve = curve;\n this.type = type;\n this.precomputed = null;\n}\nBaseCurve.BasePoint = BasePoint;\n\nBasePoint.prototype.eq = function eq(/*other*/) {\n throw new Error('Not implemented');\n};\n\nBasePoint.prototype.validate = function validate() {\n return this.curve.validate(this);\n};\n\nBaseCurve.prototype.decodePoint = function decodePoint(bytes, enc) {\n bytes = utils.toArray(bytes, enc);\n\n var len = this.p.byteLength();\n\n // uncompressed, hybrid-odd, hybrid-even\n if ((bytes[0] === 0x04 || bytes[0] === 0x06 || bytes[0] === 0x07) &&\n bytes.length - 1 === 2 * len) {\n if (bytes[0] === 0x06)\n assert(bytes[bytes.length - 1] % 2 === 0);\n else if (bytes[0] === 0x07)\n assert(bytes[bytes.length - 1] % 2 === 1);\n\n var res = this.point(bytes.slice(1, 1 + len),\n bytes.slice(1 + len, 1 + 2 * len));\n\n return res;\n } else if ((bytes[0] === 0x02 || bytes[0] === 0x03) &&\n bytes.length - 1 === len) {\n return this.pointFromX(bytes.slice(1, 1 + len), bytes[0] === 0x03);\n }\n throw new Error('Unknown point format');\n};\n\nBasePoint.prototype.encodeCompressed = function encodeCompressed(enc) {\n return this.encode(enc, true);\n};\n\nBasePoint.prototype._encode = function _encode(compact) {\n var len = this.curve.p.byteLength();\n var x = this.getX().toArray('be', len);\n\n if (compact)\n return [ this.getY().isEven() ? 0x02 : 0x03 ].concat(x);\n\n return [ 0x04 ].concat(x, this.getY().toArray('be', len)) ;\n};\n\nBasePoint.prototype.encode = function encode(enc, compact) {\n return utils.encode(this._encode(compact), enc);\n};\n\nBasePoint.prototype.precompute = function precompute(power) {\n if (this.precomputed)\n return this;\n\n var precomputed = {\n doubles: null,\n naf: null,\n beta: null\n };\n precomputed.naf = this._getNAFPoints(8);\n precomputed.doubles = this._getDoubles(4, power);\n precomputed.beta = this._getBeta();\n this.precomputed = precomputed;\n\n return this;\n};\n\nBasePoint.prototype._hasDoubles = function _hasDoubles(k) {\n if (!this.precomputed)\n return false;\n\n var doubles = this.precomputed.doubles;\n if (!doubles)\n return false;\n\n return doubles.points.length >= Math.ceil((k.bitLength() + 1) / doubles.step);\n};\n\nBasePoint.prototype._getDoubles = function _getDoubles(step, power) {\n if (this.precomputed && this.precomputed.doubles)\n return this.precomputed.doubles;\n\n var doubles = [ this ];\n var acc = this;\n for (var i = 0; i < power; i += step) {\n for (var j = 0; j < step; j++)\n acc = acc.dbl();\n doubles.push(acc);\n }\n return {\n step: step,\n points: doubles\n };\n};\n\nBasePoint.prototype._getNAFPoints = function _getNAFPoints(wnd) {\n if (this.precomputed && this.precomputed.naf)\n return this.precomputed.naf;\n\n var res = [ this ];\n var max = (1 << wnd) - 1;\n var dbl = max === 1 ? null : this.dbl();\n for (var i = 1; i < max; i++)\n res[i] = res[i - 1].add(dbl);\n return {\n wnd: wnd,\n points: res\n };\n};\n\nBasePoint.prototype._getBeta = function _getBeta() {\n return null;\n};\n\nBasePoint.prototype.dblp = function dblp(k) {\n var r = this;\n for (var i = 0; i < k; i++)\n r = r.dbl();\n return r;\n};\n","'use strict';\n\nvar utils = require('../utils');\nvar BN = require('bn.js');\nvar inherits = require('inherits');\nvar Base = require('./base');\n\nvar assert = utils.assert;\n\nfunction ShortCurve(conf) {\n Base.call(this, 'short', conf);\n\n this.a = new BN(conf.a, 16).toRed(this.red);\n this.b = new BN(conf.b, 16).toRed(this.red);\n this.tinv = this.two.redInvm();\n\n this.zeroA = this.a.fromRed().cmpn(0) === 0;\n this.threeA = this.a.fromRed().sub(this.p).cmpn(-3) === 0;\n\n // If the curve is endomorphic, precalculate beta and lambda\n this.endo = this._getEndomorphism(conf);\n this._endoWnafT1 = new Array(4);\n this._endoWnafT2 = new Array(4);\n}\ninherits(ShortCurve, Base);\nmodule.exports = ShortCurve;\n\nShortCurve.prototype._getEndomorphism = function _getEndomorphism(conf) {\n // No efficient endomorphism\n if (!this.zeroA || !this.g || !this.n || this.p.modn(3) !== 1)\n return;\n\n // Compute beta and lambda, that lambda * P = (beta * Px; Py)\n var beta;\n var lambda;\n if (conf.beta) {\n beta = new BN(conf.beta, 16).toRed(this.red);\n } else {\n var betas = this._getEndoRoots(this.p);\n // Choose the smallest beta\n beta = betas[0].cmp(betas[1]) < 0 ? betas[0] : betas[1];\n beta = beta.toRed(this.red);\n }\n if (conf.lambda) {\n lambda = new BN(conf.lambda, 16);\n } else {\n // Choose the lambda that is matching selected beta\n var lambdas = this._getEndoRoots(this.n);\n if (this.g.mul(lambdas[0]).x.cmp(this.g.x.redMul(beta)) === 0) {\n lambda = lambdas[0];\n } else {\n lambda = lambdas[1];\n assert(this.g.mul(lambda).x.cmp(this.g.x.redMul(beta)) === 0);\n }\n }\n\n // Get basis vectors, used for balanced length-two representation\n var basis;\n if (conf.basis) {\n basis = conf.basis.map(function(vec) {\n return {\n a: new BN(vec.a, 16),\n b: new BN(vec.b, 16)\n };\n });\n } else {\n basis = this._getEndoBasis(lambda);\n }\n\n return {\n beta: beta,\n lambda: lambda,\n basis: basis\n };\n};\n\nShortCurve.prototype._getEndoRoots = function _getEndoRoots(num) {\n // Find roots of for x^2 + x + 1 in F\n // Root = (-1 +- Sqrt(-3)) / 2\n //\n var red = num === this.p ? this.red : BN.mont(num);\n var tinv = new BN(2).toRed(red).redInvm();\n var ntinv = tinv.redNeg();\n\n var s = new BN(3).toRed(red).redNeg().redSqrt().redMul(tinv);\n\n var l1 = ntinv.redAdd(s).fromRed();\n var l2 = ntinv.redSub(s).fromRed();\n return [ l1, l2 ];\n};\n\nShortCurve.prototype._getEndoBasis = function _getEndoBasis(lambda) {\n // aprxSqrt >= sqrt(this.n)\n var aprxSqrt = this.n.ushrn(Math.floor(this.n.bitLength() / 2));\n\n // 3.74\n // Run EGCD, until r(L + 1) < aprxSqrt\n var u = lambda;\n var v = this.n.clone();\n var x1 = new BN(1);\n var y1 = new BN(0);\n var x2 = new BN(0);\n var y2 = new BN(1);\n\n // NOTE: all vectors are roots of: a + b * lambda = 0 (mod n)\n var a0;\n var b0;\n // First vector\n var a1;\n var b1;\n // Second vector\n var a2;\n var b2;\n\n var prevR;\n var i = 0;\n var r;\n var x;\n while (u.cmpn(0) !== 0) {\n var q = v.div(u);\n r = v.sub(q.mul(u));\n x = x2.sub(q.mul(x1));\n var y = y2.sub(q.mul(y1));\n\n if (!a1 && r.cmp(aprxSqrt) < 0) {\n a0 = prevR.neg();\n b0 = x1;\n a1 = r.neg();\n b1 = x;\n } else if (a1 && ++i === 2) {\n break;\n }\n prevR = r;\n\n v = u;\n u = r;\n x2 = x1;\n x1 = x;\n y2 = y1;\n y1 = y;\n }\n a2 = r.neg();\n b2 = x;\n\n var len1 = a1.sqr().add(b1.sqr());\n var len2 = a2.sqr().add(b2.sqr());\n if (len2.cmp(len1) >= 0) {\n a2 = a0;\n b2 = b0;\n }\n\n // Normalize signs\n if (a1.negative) {\n a1 = a1.neg();\n b1 = b1.neg();\n }\n if (a2.negative) {\n a2 = a2.neg();\n b2 = b2.neg();\n }\n\n return [\n { a: a1, b: b1 },\n { a: a2, b: b2 }\n ];\n};\n\nShortCurve.prototype._endoSplit = function _endoSplit(k) {\n var basis = this.endo.basis;\n var v1 = basis[0];\n var v2 = basis[1];\n\n var c1 = v2.b.mul(k).divRound(this.n);\n var c2 = v1.b.neg().mul(k).divRound(this.n);\n\n var p1 = c1.mul(v1.a);\n var p2 = c2.mul(v2.a);\n var q1 = c1.mul(v1.b);\n var q2 = c2.mul(v2.b);\n\n // Calculate answer\n var k1 = k.sub(p1).sub(p2);\n var k2 = q1.add(q2).neg();\n return { k1: k1, k2: k2 };\n};\n\nShortCurve.prototype.pointFromX = function pointFromX(x, odd) {\n x = new BN(x, 16);\n if (!x.red)\n x = x.toRed(this.red);\n\n var y2 = x.redSqr().redMul(x).redIAdd(x.redMul(this.a)).redIAdd(this.b);\n var y = y2.redSqrt();\n if (y.redSqr().redSub(y2).cmp(this.zero) !== 0)\n throw new Error('invalid point');\n\n // XXX Is there any way to tell if the number is odd without converting it\n // to non-red form?\n var isOdd = y.fromRed().isOdd();\n if (odd && !isOdd || !odd && isOdd)\n y = y.redNeg();\n\n return this.point(x, y);\n};\n\nShortCurve.prototype.validate = function validate(point) {\n if (point.inf)\n return true;\n\n var x = point.x;\n var y = point.y;\n\n var ax = this.a.redMul(x);\n var rhs = x.redSqr().redMul(x).redIAdd(ax).redIAdd(this.b);\n return y.redSqr().redISub(rhs).cmpn(0) === 0;\n};\n\nShortCurve.prototype._endoWnafMulAdd =\n function _endoWnafMulAdd(points, coeffs, jacobianResult) {\n var npoints = this._endoWnafT1;\n var ncoeffs = this._endoWnafT2;\n for (var i = 0; i < points.length; i++) {\n var split = this._endoSplit(coeffs[i]);\n var p = points[i];\n var beta = p._getBeta();\n\n if (split.k1.negative) {\n split.k1.ineg();\n p = p.neg(true);\n }\n if (split.k2.negative) {\n split.k2.ineg();\n beta = beta.neg(true);\n }\n\n npoints[i * 2] = p;\n npoints[i * 2 + 1] = beta;\n ncoeffs[i * 2] = split.k1;\n ncoeffs[i * 2 + 1] = split.k2;\n }\n var res = this._wnafMulAdd(1, npoints, ncoeffs, i * 2, jacobianResult);\n\n // Clean-up references to points and coefficients\n for (var j = 0; j < i * 2; j++) {\n npoints[j] = null;\n ncoeffs[j] = null;\n }\n return res;\n};\n\nfunction Point(curve, x, y, isRed) {\n Base.BasePoint.call(this, curve, 'affine');\n if (x === null && y === null) {\n this.x = null;\n this.y = null;\n this.inf = true;\n } else {\n this.x = new BN(x, 16);\n this.y = new BN(y, 16);\n // Force redgomery representation when loading from JSON\n if (isRed) {\n this.x.forceRed(this.curve.red);\n this.y.forceRed(this.curve.red);\n }\n if (!this.x.red)\n this.x = this.x.toRed(this.curve.red);\n if (!this.y.red)\n this.y = this.y.toRed(this.curve.red);\n this.inf = false;\n }\n}\ninherits(Point, Base.BasePoint);\n\nShortCurve.prototype.point = function point(x, y, isRed) {\n return new Point(this, x, y, isRed);\n};\n\nShortCurve.prototype.pointFromJSON = function pointFromJSON(obj, red) {\n return Point.fromJSON(this, obj, red);\n};\n\nPoint.prototype._getBeta = function _getBeta() {\n if (!this.curve.endo)\n return;\n\n var pre = this.precomputed;\n if (pre && pre.beta)\n return pre.beta;\n\n var beta = this.curve.point(this.x.redMul(this.curve.endo.beta), this.y);\n if (pre) {\n var curve = this.curve;\n var endoMul = function(p) {\n return curve.point(p.x.redMul(curve.endo.beta), p.y);\n };\n pre.beta = beta;\n beta.precomputed = {\n beta: null,\n naf: pre.naf && {\n wnd: pre.naf.wnd,\n points: pre.naf.points.map(endoMul)\n },\n doubles: pre.doubles && {\n step: pre.doubles.step,\n points: pre.doubles.points.map(endoMul)\n }\n };\n }\n return beta;\n};\n\nPoint.prototype.toJSON = function toJSON() {\n if (!this.precomputed)\n return [ this.x, this.y ];\n\n return [ this.x, this.y, this.precomputed && {\n doubles: this.precomputed.doubles && {\n step: this.precomputed.doubles.step,\n points: this.precomputed.doubles.points.slice(1)\n },\n naf: this.precomputed.naf && {\n wnd: this.precomputed.naf.wnd,\n points: this.precomputed.naf.points.slice(1)\n }\n } ];\n};\n\nPoint.fromJSON = function fromJSON(curve, obj, red) {\n if (typeof obj === 'string')\n obj = JSON.parse(obj);\n var res = curve.point(obj[0], obj[1], red);\n if (!obj[2])\n return res;\n\n function obj2point(obj) {\n return curve.point(obj[0], obj[1], red);\n }\n\n var pre = obj[2];\n res.precomputed = {\n beta: null,\n doubles: pre.doubles && {\n step: pre.doubles.step,\n points: [ res ].concat(pre.doubles.points.map(obj2point))\n },\n naf: pre.naf && {\n wnd: pre.naf.wnd,\n points: [ res ].concat(pre.naf.points.map(obj2point))\n }\n };\n return res;\n};\n\nPoint.prototype.inspect = function inspect() {\n if (this.isInfinity())\n return '<EC Point Infinity>';\n return '<EC Point x: ' + this.x.fromRed().toString(16, 2) +\n ' y: ' + this.y.fromRed().toString(16, 2) + '>';\n};\n\nPoint.prototype.isInfinity = function isInfinity() {\n return this.inf;\n};\n\nPoint.prototype.add = function add(p) {\n // O + P = P\n if (this.inf)\n return p;\n\n // P + O = P\n if (p.inf)\n return this;\n\n // P + P = 2P\n if (this.eq(p))\n return this.dbl();\n\n // P + (-P) = O\n if (this.neg().eq(p))\n return this.curve.point(null, null);\n\n // P + Q = O\n if (this.x.cmp(p.x) === 0)\n return this.curve.point(null, null);\n\n var c = this.y.redSub(p.y);\n if (c.cmpn(0) !== 0)\n c = c.redMul(this.x.redSub(p.x).redInvm());\n var nx = c.redSqr().redISub(this.x).redISub(p.x);\n var ny = c.redMul(this.x.redSub(nx)).redISub(this.y);\n return this.curve.point(nx, ny);\n};\n\nPoint.prototype.dbl = function dbl() {\n if (this.inf)\n return this;\n\n // 2P = O\n var ys1 = this.y.redAdd(this.y);\n if (ys1.cmpn(0) === 0)\n return this.curve.point(null, null);\n\n var a = this.curve.a;\n\n var x2 = this.x.redSqr();\n var dyinv = ys1.redInvm();\n var c = x2.redAdd(x2).redIAdd(x2).redIAdd(a).redMul(dyinv);\n\n var nx = c.redSqr().redISub(this.x.redAdd(this.x));\n var ny = c.redMul(this.x.redSub(nx)).redISub(this.y);\n return this.curve.point(nx, ny);\n};\n\nPoint.prototype.getX = function getX() {\n return this.x.fromRed();\n};\n\nPoint.prototype.getY = function getY() {\n return this.y.fromRed();\n};\n\nPoint.prototype.mul = function mul(k) {\n k = new BN(k, 16);\n if (this.isInfinity())\n return this;\n else if (this._hasDoubles(k))\n return this.curve._fixedNafMul(this, k);\n else if (this.curve.endo)\n return this.curve._endoWnafMulAdd([ this ], [ k ]);\n else\n return this.curve._wnafMul(this, k);\n};\n\nPoint.prototype.mulAdd = function mulAdd(k1, p2, k2) {\n var points = [ this, p2 ];\n var coeffs = [ k1, k2 ];\n if (this.curve.endo)\n return this.curve._endoWnafMulAdd(points, coeffs);\n else\n return this.curve._wnafMulAdd(1, points, coeffs, 2);\n};\n\nPoint.prototype.jmulAdd = function jmulAdd(k1, p2, k2) {\n var points = [ this, p2 ];\n var coeffs = [ k1, k2 ];\n if (this.curve.endo)\n return this.curve._endoWnafMulAdd(points, coeffs, true);\n else\n return this.curve._wnafMulAdd(1, points, coeffs, 2, true);\n};\n\nPoint.prototype.eq = function eq(p) {\n return this === p ||\n this.inf === p.inf &&\n (this.inf || this.x.cmp(p.x) === 0 && this.y.cmp(p.y) === 0);\n};\n\nPoint.prototype.neg = function neg(_precompute) {\n if (this.inf)\n return this;\n\n var res = this.curve.point(this.x, this.y.redNeg());\n if (_precompute && this.precomputed) {\n var pre = this.precomputed;\n var negate = function(p) {\n return p.neg();\n };\n res.precomputed = {\n naf: pre.naf && {\n wnd: pre.naf.wnd,\n points: pre.naf.points.map(negate)\n },\n doubles: pre.doubles && {\n step: pre.doubles.step,\n points: pre.doubles.points.map(negate)\n }\n };\n }\n return res;\n};\n\nPoint.prototype.toJ = function toJ() {\n if (this.inf)\n return this.curve.jpoint(null, null, null);\n\n var res = this.curve.jpoint(this.x, this.y, this.curve.one);\n return res;\n};\n\nfunction JPoint(curve, x, y, z) {\n Base.BasePoint.call(this, curve, 'jacobian');\n if (x === null && y === null && z === null) {\n this.x = this.curve.one;\n this.y = this.curve.one;\n this.z = new BN(0);\n } else {\n this.x = new BN(x, 16);\n this.y = new BN(y, 16);\n this.z = new BN(z, 16);\n }\n if (!this.x.red)\n this.x = this.x.toRed(this.curve.red);\n if (!this.y.red)\n this.y = this.y.toRed(this.curve.red);\n if (!this.z.red)\n this.z = this.z.toRed(this.curve.red);\n\n this.zOne = this.z === this.curve.one;\n}\ninherits(JPoint, Base.BasePoint);\n\nShortCurve.prototype.jpoint = function jpoint(x, y, z) {\n return new JPoint(this, x, y, z);\n};\n\nJPoint.prototype.toP = function toP() {\n if (this.isInfinity())\n return this.curve.point(null, null);\n\n var zinv = this.z.redInvm();\n var zinv2 = zinv.redSqr();\n var ax = this.x.redMul(zinv2);\n var ay = this.y.redMul(zinv2).redMul(zinv);\n\n return this.curve.point(ax, ay);\n};\n\nJPoint.prototype.neg = function neg() {\n return this.curve.jpoint(this.x, this.y.redNeg(), this.z);\n};\n\nJPoint.prototype.add = function add(p) {\n // O + P = P\n if (this.isInfinity())\n return p;\n\n // P + O = P\n if (p.isInfinity())\n return this;\n\n // 12M + 4S + 7A\n var pz2 = p.z.redSqr();\n var z2 = this.z.redSqr();\n var u1 = this.x.redMul(pz2);\n var u2 = p.x.redMul(z2);\n var s1 = this.y.redMul(pz2.redMul(p.z));\n var s2 = p.y.redMul(z2.redMul(this.z));\n\n var h = u1.redSub(u2);\n var r = s1.redSub(s2);\n if (h.cmpn(0) === 0) {\n if (r.cmpn(0) !== 0)\n return this.curve.jpoint(null, null, null);\n else\n return this.dbl();\n }\n\n var h2 = h.redSqr();\n var h3 = h2.redMul(h);\n var v = u1.redMul(h2);\n\n var nx = r.redSqr().redIAdd(h3).redISub(v).redISub(v);\n var ny = r.redMul(v.redISub(nx)).redISub(s1.redMul(h3));\n var nz = this.z.redMul(p.z).redMul(h);\n\n return this.curve.jpoint(nx, ny, nz);\n};\n\nJPoint.prototype.mixedAdd = function mixedAdd(p) {\n // O + P = P\n if (this.isInfinity())\n return p.toJ();\n\n // P + O = P\n if (p.isInfinity())\n return this;\n\n // 8M + 3S + 7A\n var z2 = this.z.redSqr();\n var u1 = this.x;\n var u2 = p.x.redMul(z2);\n var s1 = this.y;\n var s2 = p.y.redMul(z2).redMul(this.z);\n\n var h = u1.redSub(u2);\n var r = s1.redSub(s2);\n if (h.cmpn(0) === 0) {\n if (r.cmpn(0) !== 0)\n return this.curve.jpoint(null, null, null);\n else\n return this.dbl();\n }\n\n var h2 = h.redSqr();\n var h3 = h2.redMul(h);\n var v = u1.redMul(h2);\n\n var nx = r.redSqr().redIAdd(h3).redISub(v).redISub(v);\n var ny = r.redMul(v.redISub(nx)).redISub(s1.redMul(h3));\n var nz = this.z.redMul(h);\n\n return this.curve.jpoint(nx, ny, nz);\n};\n\nJPoint.prototype.dblp = function dblp(pow) {\n if (pow === 0)\n return this;\n if (this.isInfinity())\n return this;\n if (!pow)\n return this.dbl();\n\n if (this.curve.zeroA || this.curve.threeA) {\n var r = this;\n for (var i = 0; i < pow; i++)\n r = r.dbl();\n return r;\n }\n\n // 1M + 2S + 1A + N * (4S + 5M + 8A)\n // N = 1 => 6M + 6S + 9A\n var a = this.curve.a;\n var tinv = this.curve.tinv;\n\n var jx = this.x;\n var jy = this.y;\n var jz = this.z;\n var jz4 = jz.redSqr().redSqr();\n\n // Reuse results\n var jyd = jy.redAdd(jy);\n for (var i = 0; i < pow; i++) {\n var jx2 = jx.redSqr();\n var jyd2 = jyd.redSqr();\n var jyd4 = jyd2.redSqr();\n var c = jx2.redAdd(jx2).redIAdd(jx2).redIAdd(a.redMul(jz4));\n\n var t1 = jx.redMul(jyd2);\n var nx = c.redSqr().redISub(t1.redAdd(t1));\n var t2 = t1.redISub(nx);\n var dny = c.redMul(t2);\n dny = dny.redIAdd(dny).redISub(jyd4);\n var nz = jyd.redMul(jz);\n if (i + 1 < pow)\n jz4 = jz4.redMul(jyd4);\n\n jx = nx;\n jz = nz;\n jyd = dny;\n }\n\n return this.curve.jpoint(jx, jyd.redMul(tinv), jz);\n};\n\nJPoint.prototype.dbl = function dbl() {\n if (this.isInfinity())\n return this;\n\n if (this.curve.zeroA)\n return this._zeroDbl();\n else if (this.curve.threeA)\n return this._threeDbl();\n else\n return this._dbl();\n};\n\nJPoint.prototype._zeroDbl = function _zeroDbl() {\n var nx;\n var ny;\n var nz;\n // Z = 1\n if (this.zOne) {\n // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html\n // #doubling-mdbl-2007-bl\n // 1M + 5S + 14A\n\n // XX = X1^2\n var xx = this.x.redSqr();\n // YY = Y1^2\n var yy = this.y.redSqr();\n // YYYY = YY^2\n var yyyy = yy.redSqr();\n // S = 2 * ((X1 + YY)^2 - XX - YYYY)\n var s = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy);\n s = s.redIAdd(s);\n // M = 3 * XX + a; a = 0\n var m = xx.redAdd(xx).redIAdd(xx);\n // T = M ^ 2 - 2*S\n var t = m.redSqr().redISub(s).redISub(s);\n\n // 8 * YYYY\n var yyyy8 = yyyy.redIAdd(yyyy);\n yyyy8 = yyyy8.redIAdd(yyyy8);\n yyyy8 = yyyy8.redIAdd(yyyy8);\n\n // X3 = T\n nx = t;\n // Y3 = M * (S - T) - 8 * YYYY\n ny = m.redMul(s.redISub(t)).redISub(yyyy8);\n // Z3 = 2*Y1\n nz = this.y.redAdd(this.y);\n } else {\n // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html\n // #doubling-dbl-2009-l\n // 2M + 5S + 13A\n\n // A = X1^2\n var a = this.x.redSqr();\n // B = Y1^2\n var b = this.y.redSqr();\n // C = B^2\n var c = b.redSqr();\n // D = 2 * ((X1 + B)^2 - A - C)\n var d = this.x.redAdd(b).redSqr().redISub(a).redISub(c);\n d = d.redIAdd(d);\n // E = 3 * A\n var e = a.redAdd(a).redIAdd(a);\n // F = E^2\n var f = e.redSqr();\n\n // 8 * C\n var c8 = c.redIAdd(c);\n c8 = c8.redIAdd(c8);\n c8 = c8.redIAdd(c8);\n\n // X3 = F - 2 * D\n nx = f.redISub(d).redISub(d);\n // Y3 = E * (D - X3) - 8 * C\n ny = e.redMul(d.redISub(nx)).redISub(c8);\n // Z3 = 2 * Y1 * Z1\n nz = this.y.redMul(this.z);\n nz = nz.redIAdd(nz);\n }\n\n return this.curve.jpoint(nx, ny, nz);\n};\n\nJPoint.prototype._threeDbl = function _threeDbl() {\n var nx;\n var ny;\n var nz;\n // Z = 1\n if (this.zOne) {\n // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html\n // #doubling-mdbl-2007-bl\n // 1M + 5S + 15A\n\n // XX = X1^2\n var xx = this.x.redSqr();\n // YY = Y1^2\n var yy = this.y.redSqr();\n // YYYY = YY^2\n var yyyy = yy.redSqr();\n // S = 2 * ((X1 + YY)^2 - XX - YYYY)\n var s = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy);\n s = s.redIAdd(s);\n // M = 3 * XX + a\n var m = xx.redAdd(xx).redIAdd(xx).redIAdd(this.curve.a);\n // T = M^2 - 2 * S\n var t = m.redSqr().redISub(s).redISub(s);\n // X3 = T\n nx = t;\n // Y3 = M * (S - T) - 8 * YYYY\n var yyyy8 = yyyy.redIAdd(yyyy);\n yyyy8 = yyyy8.redIAdd(yyyy8);\n yyyy8 = yyyy8.redIAdd(yyyy8);\n ny = m.redMul(s.redISub(t)).redISub(yyyy8);\n // Z3 = 2 * Y1\n nz = this.y.redAdd(this.y);\n } else {\n // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2001-b\n // 3M + 5S\n\n // delta = Z1^2\n var delta = this.z.redSqr();\n // gamma = Y1^2\n var gamma = this.y.redSqr();\n // beta = X1 * gamma\n var beta = this.x.redMul(gamma);\n // alpha = 3 * (X1 - delta) * (X1 + delta)\n var alpha = this.x.redSub(delta).redMul(this.x.redAdd(delta));\n alpha = alpha.redAdd(alpha).redIAdd(alpha);\n // X3 = alpha^2 - 8 * beta\n var beta4 = beta.redIAdd(beta);\n beta4 = beta4.redIAdd(beta4);\n var beta8 = beta4.redAdd(beta4);\n nx = alpha.redSqr().redISub(beta8);\n // Z3 = (Y1 + Z1)^2 - gamma - delta\n nz = this.y.redAdd(this.z).redSqr().redISub(gamma).redISub(delta);\n // Y3 = alpha * (4 * beta - X3) - 8 * gamma^2\n var ggamma8 = gamma.redSqr();\n ggamma8 = ggamma8.redIAdd(ggamma8);\n ggamma8 = ggamma8.redIAdd(ggamma8);\n ggamma8 = ggamma8.redIAdd(ggamma8);\n ny = alpha.redMul(beta4.redISub(nx)).redISub(ggamma8);\n }\n\n return this.curve.jpoint(nx, ny, nz);\n};\n\nJPoint.prototype._dbl = function _dbl() {\n var a = this.curve.a;\n\n // 4M + 6S + 10A\n var jx = this.x;\n var jy = this.y;\n var jz = this.z;\n var jz4 = jz.redSqr().redSqr();\n\n var jx2 = jx.redSqr();\n var jy2 = jy.redSqr();\n\n var c = jx2.redAdd(jx2).redIAdd(jx2).redIAdd(a.redMul(jz4));\n\n var jxd4 = jx.redAdd(jx);\n jxd4 = jxd4.redIAdd(jxd4);\n var t1 = jxd4.redMul(jy2);\n var nx = c.redSqr().redISub(t1.redAdd(t1));\n var t2 = t1.redISub(nx);\n\n var jyd8 = jy2.redSqr();\n jyd8 = jyd8.redIAdd(jyd8);\n jyd8 = jyd8.redIAdd(jyd8);\n jyd8 = jyd8.redIAdd(jyd8);\n var ny = c.redMul(t2).redISub(jyd8);\n var nz = jy.redAdd(jy).redMul(jz);\n\n return this.curve.jpoint(nx, ny, nz);\n};\n\nJPoint.prototype.trpl = function trpl() {\n if (!this.curve.zeroA)\n return this.dbl().add(this);\n\n // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#tripling-tpl-2007-bl\n // 5M + 10S + ...\n\n // XX = X1^2\n var xx = this.x.redSqr();\n // YY = Y1^2\n var yy = this.y.redSqr();\n // ZZ = Z1^2\n var zz = this.z.redSqr();\n // YYYY = YY^2\n var yyyy = yy.redSqr();\n // M = 3 * XX + a * ZZ2; a = 0\n var m = xx.redAdd(xx).redIAdd(xx);\n // MM = M^2\n var mm = m.redSqr();\n // E = 6 * ((X1 + YY)^2 - XX - YYYY) - MM\n var e = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy);\n e = e.redIAdd(e);\n e = e.redAdd(e).redIAdd(e);\n e = e.redISub(mm);\n // EE = E^2\n var ee = e.redSqr();\n // T = 16*YYYY\n var t = yyyy.redIAdd(yyyy);\n t = t.redIAdd(t);\n t = t.redIAdd(t);\n t = t.redIAdd(t);\n // U = (M + E)^2 - MM - EE - T\n var u = m.redIAdd(e).redSqr().redISub(mm).redISub(ee).redISub(t);\n // X3 = 4 * (X1 * EE - 4 * YY * U)\n var yyu4 = yy.redMul(u);\n yyu4 = yyu4.redIAdd(yyu4);\n yyu4 = yyu4.redIAdd(yyu4);\n var nx = this.x.redMul(ee).redISub(yyu4);\n nx = nx.redIAdd(nx);\n nx = nx.redIAdd(nx);\n // Y3 = 8 * Y1 * (U * (T - U) - E * EE)\n var ny = this.y.redMul(u.redMul(t.redISub(u)).redISub(e.redMul(ee)));\n ny = ny.redIAdd(ny);\n ny = ny.redIAdd(ny);\n ny = ny.redIAdd(ny);\n // Z3 = (Z1 + E)^2 - ZZ - EE\n var nz = this.z.redAdd(e).redSqr().redISub(zz).redISub(ee);\n\n return this.curve.jpoint(nx, ny, nz);\n};\n\nJPoint.prototype.mul = function mul(k, kbase) {\n k = new BN(k, kbase);\n\n return this.curve._wnafMul(this, k);\n};\n\nJPoint.prototype.eq = function eq(p) {\n if (p.type === 'affine')\n return this.eq(p.toJ());\n\n if (this === p)\n return true;\n\n // x1 * z2^2 == x2 * z1^2\n var z2 = this.z.redSqr();\n var pz2 = p.z.redSqr();\n if (this.x.redMul(pz2).redISub(p.x.redMul(z2)).cmpn(0) !== 0)\n return false;\n\n // y1 * z2^3 == y2 * z1^3\n var z3 = z2.redMul(this.z);\n var pz3 = pz2.redMul(p.z);\n return this.y.redMul(pz3).redISub(p.y.redMul(z3)).cmpn(0) === 0;\n};\n\nJPoint.prototype.eqXToP = function eqXToP(x) {\n var zs = this.z.redSqr();\n var rx = x.toRed(this.curve.red).redMul(zs);\n if (this.x.cmp(rx) === 0)\n return true;\n\n var xc = x.clone();\n var t = this.curve.redN.redMul(zs);\n for (;;) {\n xc.iadd(this.curve.n);\n if (xc.cmp(this.curve.p) >= 0)\n return false;\n\n rx.redIAdd(t);\n if (this.x.cmp(rx) === 0)\n return true;\n }\n};\n\nJPoint.prototype.inspect = function inspect() {\n if (this.isInfinity())\n return '<EC JPoint Infinity>';\n return '<EC JPoint x: ' + this.x.toString(16, 2) +\n ' y: ' + this.y.toString(16, 2) +\n ' z: ' + this.z.toString(16, 2) + '>';\n};\n\nJPoint.prototype.isInfinity = function isInfinity() {\n // XXX This code assumes that zero is always zero in red\n return this.z.cmpn(0) === 0;\n};\n","'use strict';\n\nvar BN = require('bn.js');\nvar inherits = require('inherits');\nvar Base = require('./base');\n\nvar utils = require('../utils');\n\nfunction MontCurve(conf) {\n Base.call(this, 'mont', conf);\n\n this.a = new BN(conf.a, 16).toRed(this.red);\n this.b = new BN(conf.b, 16).toRed(this.red);\n this.i4 = new BN(4).toRed(this.red).redInvm();\n this.two = new BN(2).toRed(this.red);\n // Note: this implementation is according to the original paper\n // by P. Montgomery, NOT the one by D. J. Bernstein.\n this.a24 = this.i4.redMul(this.a.redAdd(this.two));\n}\ninherits(MontCurve, Base);\nmodule.exports = MontCurve;\n\nMontCurve.prototype.validate = function validate(point) {\n var x = point.normalize().x;\n var x2 = x.redSqr();\n var rhs = x2.redMul(x).redAdd(x2.redMul(this.a)).redAdd(x);\n var y = rhs.redSqrt();\n\n return y.redSqr().cmp(rhs) === 0;\n};\n\nfunction Point(curve, x, z) {\n Base.BasePoint.call(this, curve, 'projective');\n if (x === null && z === null) {\n this.x = this.curve.one;\n this.z = this.curve.zero;\n } else {\n this.x = new BN(x, 16);\n this.z = new BN(z, 16);\n if (!this.x.red)\n this.x = this.x.toRed(this.curve.red);\n if (!this.z.red)\n this.z = this.z.toRed(this.curve.red);\n }\n}\ninherits(Point, Base.BasePoint);\n\nMontCurve.prototype.decodePoint = function decodePoint(bytes, enc) {\n var bytes = utils.toArray(bytes, enc);\n\n // TODO Curve448\n // Montgomery curve points must be represented in the compressed format\n // https://tools.ietf.org/html/draft-ietf-openpgp-rfc4880bis-02#appendix-B\n if (bytes.length === 33 && bytes[0] === 0x40)\n bytes = bytes.slice(1, 33).reverse(); // point must be little-endian\n if (bytes.length !== 32)\n throw new Error('Unknown point compression format');\n return this.point(bytes, 1);\n};\n\nMontCurve.prototype.point = function point(x, z) {\n return new Point(this, x, z);\n};\n\nMontCurve.prototype.pointFromJSON = function pointFromJSON(obj) {\n return Point.fromJSON(this, obj);\n};\n\nPoint.prototype.precompute = function precompute() {\n // No-op\n};\n\nPoint.prototype._encode = function _encode(compact) {\n var len = this.curve.p.byteLength();\n\n // Note: the output should always be little-endian\n // https://tools.ietf.org/html/draft-ietf-openpgp-rfc4880bis-02#appendix-B\n if (compact) {\n return [ 0x40 ].concat(this.getX().toArray('le', len));\n } else {\n return this.getX().toArray('be', len);\n }\n};\n\nPoint.fromJSON = function fromJSON(curve, obj) {\n return new Point(curve, obj[0], obj[1] || curve.one);\n};\n\nPoint.prototype.inspect = function inspect() {\n if (this.isInfinity())\n return '<EC Point Infinity>';\n return '<EC Point x: ' + this.x.fromRed().toString(16, 2) +\n ' z: ' + this.z.fromRed().toString(16, 2) + '>';\n};\n\nPoint.prototype.isInfinity = function isInfinity() {\n // XXX This code assumes that zero is always zero in red\n return this.z.cmpn(0) === 0;\n};\n\nPoint.prototype.dbl = function dbl() {\n // http://hyperelliptic.org/EFD/g1p/auto-montgom-xz.html#doubling-dbl-1987-m-3\n // 2M + 2S + 4A\n\n // A = X1 + Z1\n var a = this.x.redAdd(this.z);\n // AA = A^2\n var aa = a.redSqr();\n // B = X1 - Z1\n var b = this.x.redSub(this.z);\n // BB = B^2\n var bb = b.redSqr();\n // C = AA - BB\n var c = aa.redSub(bb);\n // X3 = AA * BB\n var nx = aa.redMul(bb);\n // Z3 = C * (BB + A24 * C)\n var nz = c.redMul(bb.redAdd(this.curve.a24.redMul(c)));\n return this.curve.point(nx, nz);\n};\n\nPoint.prototype.add = function add() {\n throw new Error('Not supported on Montgomery curve');\n};\n\nPoint.prototype.diffAdd = function diffAdd(p, diff) {\n // http://hyperelliptic.org/EFD/g1p/auto-montgom-xz.html#diffadd-dadd-1987-m-3\n // 4M + 2S + 6A\n\n // A = X2 + Z2\n var a = this.x.redAdd(this.z);\n // B = X2 - Z2\n var b = this.x.redSub(this.z);\n // C = X3 + Z3\n var c = p.x.redAdd(p.z);\n // D = X3 - Z3\n var d = p.x.redSub(p.z);\n // DA = D * A\n var da = d.redMul(a);\n // CB = C * B\n var cb = c.redMul(b);\n // X5 = Z1 * (DA + CB)^2\n var nx = diff.z.redMul(da.redAdd(cb).redSqr());\n // Z5 = X1 * (DA - CB)^2\n var nz = diff.x.redMul(da.redISub(cb).redSqr());\n return this.curve.point(nx, nz);\n};\n\nPoint.prototype.mul = function mul(k) {\n k = new BN(k, 16);\n\n var t = k.clone();\n var a = this; // (N / 2) * Q + Q\n var b = this.curve.point(null, null); // (N / 2) * Q\n var c = this; // Q\n\n for (var bits = []; t.cmpn(0) !== 0; t.iushrn(1))\n bits.push(t.andln(1));\n\n for (var i = bits.length - 1; i >= 0; i--) {\n if (bits[i] === 0) {\n // N * Q + Q = ((N / 2) * Q + Q)) + (N / 2) * Q\n a = a.diffAdd(b, c);\n // N * Q = 2 * ((N / 2) * Q + Q))\n b = b.dbl();\n } else {\n // N * Q = ((N / 2) * Q + Q) + ((N / 2) * Q)\n b = a.diffAdd(b, c);\n // N * Q + Q = 2 * ((N / 2) * Q + Q)\n a = a.dbl();\n }\n }\n return b;\n};\n\nPoint.prototype.mulAdd = function mulAdd() {\n throw new Error('Not supported on Montgomery curve');\n};\n\nPoint.prototype.jumlAdd = function jumlAdd() {\n throw new Error('Not supported on Montgomery curve');\n};\n\nPoint.prototype.eq = function eq(other) {\n return this.getX().cmp(other.getX()) === 0;\n};\n\nPoint.prototype.normalize = function normalize() {\n this.x = this.x.redMul(this.z.redInvm());\n this.z = this.curve.one;\n return this;\n};\n\nPoint.prototype.getX = function getX() {\n // Normalize coordinates\n this.normalize();\n\n return this.x.fromRed();\n};\n","'use strict';\n\nvar utils = require('../utils');\nvar BN = require('bn.js');\nvar inherits = require('inherits');\nvar Base = require('./base');\n\nvar assert = utils.assert;\n\nfunction EdwardsCurve(conf) {\n // NOTE: Important as we are creating point in Base.call()\n this.twisted = (conf.a | 0) !== 1;\n this.mOneA = this.twisted && (conf.a | 0) === -1;\n this.extended = this.mOneA;\n\n Base.call(this, 'edwards', conf);\n\n this.a = new BN(conf.a, 16).umod(this.red.m);\n this.a = this.a.toRed(this.red);\n this.c = new BN(conf.c, 16).toRed(this.red);\n this.c2 = this.c.redSqr();\n this.d = new BN(conf.d, 16).toRed(this.red);\n this.dd = this.d.redAdd(this.d);\n\n assert(!this.twisted || this.c.fromRed().cmpn(1) === 0);\n this.oneC = (conf.c | 0) === 1;\n}\ninherits(EdwardsCurve, Base);\nmodule.exports = EdwardsCurve;\n\nEdwardsCurve.prototype._mulA = function _mulA(num) {\n if (this.mOneA)\n return num.redNeg();\n else\n return this.a.redMul(num);\n};\n\nEdwardsCurve.prototype._mulC = function _mulC(num) {\n if (this.oneC)\n return num;\n else\n return this.c.redMul(num);\n};\n\n// Just for compatibility with Short curve\nEdwardsCurve.prototype.jpoint = function jpoint(x, y, z, t) {\n return this.point(x, y, z, t);\n};\n\nEdwardsCurve.prototype.pointFromX = function pointFromX(x, odd) {\n x = new BN(x, 16);\n if (!x.red)\n x = x.toRed(this.red);\n\n var x2 = x.redSqr();\n var rhs = this.c2.redSub(this.a.redMul(x2));\n var lhs = this.one.redSub(this.c2.redMul(this.d).redMul(x2));\n\n var y2 = rhs.redMul(lhs.redInvm());\n var y = y2.redSqrt();\n if (y.redSqr().redSub(y2).cmp(this.zero) !== 0)\n throw new Error('invalid point');\n\n var isOdd = y.fromRed().isOdd();\n if (odd && !isOdd || !odd && isOdd)\n y = y.redNeg();\n\n return this.point(x, y);\n};\n\nEdwardsCurve.prototype.pointFromY = function pointFromY(y, odd) {\n y = new BN(y, 16);\n if (!y.red)\n y = y.toRed(this.red);\n\n // x^2 = (y^2 - c^2) / (c^2 d y^2 - a)\n var y2 = y.redSqr();\n var lhs = y2.redSub(this.c2);\n var rhs = y2.redMul(this.d).redMul(this.c2).redSub(this.a);\n var x2 = lhs.redMul(rhs.redInvm());\n\n if (x2.cmp(this.zero) === 0) {\n if (odd)\n throw new Error('invalid point');\n else\n return this.point(this.zero, y);\n }\n\n var x = x2.redSqrt();\n if (x.redSqr().redSub(x2).cmp(this.zero) !== 0)\n throw new Error('invalid point');\n\n if (x.fromRed().isOdd() !== odd)\n x = x.redNeg();\n\n return this.point(x, y);\n};\n\nEdwardsCurve.prototype.validate = function validate(point) {\n if (point.isInfinity())\n return true;\n\n // Curve: A * X^2 + Y^2 = C^2 * (1 + D * X^2 * Y^2)\n point.normalize();\n\n var x2 = point.x.redSqr();\n var y2 = point.y.redSqr();\n var lhs = x2.redMul(this.a).redAdd(y2);\n var rhs = this.c2.redMul(this.one.redAdd(this.d.redMul(x2).redMul(y2)));\n\n return lhs.cmp(rhs) === 0;\n};\n\nfunction Point(curve, x, y, z, t) {\n Base.BasePoint.call(this, curve, 'projective');\n if (x === null && y === null && z === null) {\n this.x = this.curve.zero;\n this.y = this.curve.one;\n this.z = this.curve.one;\n this.t = this.curve.zero;\n this.zOne = true;\n } else {\n this.x = new BN(x, 16);\n this.y = new BN(y, 16);\n this.z = z ? new BN(z, 16) : this.curve.one;\n this.t = t && new BN(t, 16);\n if (!this.x.red)\n this.x = this.x.toRed(this.curve.red);\n if (!this.y.red)\n this.y = this.y.toRed(this.curve.red);\n if (!this.z.red)\n this.z = this.z.toRed(this.curve.red);\n if (this.t && !this.t.red)\n this.t = this.t.toRed(this.curve.red);\n this.zOne = this.z === this.curve.one;\n\n // Use extended coordinates\n if (this.curve.extended && !this.t) {\n this.t = this.x.redMul(this.y);\n if (!this.zOne)\n this.t = this.t.redMul(this.z.redInvm());\n }\n }\n}\ninherits(Point, Base.BasePoint);\n\nEdwardsCurve.prototype.pointFromJSON = function pointFromJSON(obj) {\n return Point.fromJSON(this, obj);\n};\n\nEdwardsCurve.prototype.point = function point(x, y, z, t) {\n return new Point(this, x, y, z, t);\n};\n\nPoint.fromJSON = function fromJSON(curve, obj) {\n return new Point(curve, obj[0], obj[1], obj[2]);\n};\n\nPoint.prototype.inspect = function inspect() {\n if (this.isInfinity())\n return '<EC Point Infinity>';\n return '<EC Point x: ' + this.x.fromRed().toString(16, 2) +\n ' y: ' + this.y.fromRed().toString(16, 2) +\n ' z: ' + this.z.fromRed().toString(16, 2) + '>';\n};\n\nPoint.prototype.isInfinity = function isInfinity() {\n // XXX This code assumes that zero is always zero in red\n return this.x.cmpn(0) === 0 &&\n (this.y.cmp(this.z) === 0 ||\n (this.zOne && this.y.cmp(this.curve.c) === 0));\n};\n\nPoint.prototype._extDbl = function _extDbl() {\n // hyperelliptic.org/EFD/g1p/auto-twisted-extended-1.html\n // #doubling-dbl-2008-hwcd\n // 4M + 4S\n\n // A = X1^2\n var a = this.x.redSqr();\n // B = Y1^2\n var b = this.y.redSqr();\n // C = 2 * Z1^2\n var c = this.z.redSqr();\n c = c.redIAdd(c);\n // D = a * A\n var d = this.curve._mulA(a);\n // E = (X1 + Y1)^2 - A - B\n var e = this.x.redAdd(this.y).redSqr().redISub(a).redISub(b);\n // G = D + B\n var g = d.redAdd(b);\n // F = G - C\n var f = g.redSub(c);\n // H = D - B\n var h = d.redSub(b);\n // X3 = E * F\n var nx = e.redMul(f);\n // Y3 = G * H\n var ny = g.redMul(h);\n // T3 = E * H\n var nt = e.redMul(h);\n // Z3 = F * G\n var nz = f.redMul(g);\n return this.curve.point(nx, ny, nz, nt);\n};\n\nPoint.prototype._projDbl = function _projDbl() {\n // hyperelliptic.org/EFD/g1p/auto-twisted-projective.html\n // #doubling-dbl-2008-bbjlp\n // #doubling-dbl-2007-bl\n // and others\n // Generally 3M + 4S or 2M + 4S\n\n // B = (X1 + Y1)^2\n var b = this.x.redAdd(this.y).redSqr();\n // C = X1^2\n var c = this.x.redSqr();\n // D = Y1^2\n var d = this.y.redSqr();\n\n var nx;\n var ny;\n var nz;\n if (this.curve.twisted) {\n // E = a * C\n var e = this.curve._mulA(c);\n // F = E + D\n var f = e.redAdd(d);\n if (this.zOne) {\n // X3 = (B - C - D) * (F - 2)\n nx = b.redSub(c).redSub(d).redMul(f.redSub(this.curve.two));\n // Y3 = F * (E - D)\n ny = f.redMul(e.redSub(d));\n // Z3 = F^2 - 2 * F\n nz = f.redSqr().redSub(f).redSub(f);\n } else {\n // H = Z1^2\n var h = this.z.redSqr();\n // J = F - 2 * H\n var j = f.redSub(h).redISub(h);\n // X3 = (B-C-D)*J\n nx = b.redSub(c).redISub(d).redMul(j);\n // Y3 = F * (E - D)\n ny = f.redMul(e.redSub(d));\n // Z3 = F * J\n nz = f.redMul(j);\n }\n } else {\n // E = C + D\n var e = c.redAdd(d);\n // H = (c * Z1)^2\n var h = this.curve._mulC(this.z).redSqr();\n // J = E - 2 * H\n var j = e.redSub(h).redSub(h);\n // X3 = c * (B - E) * J\n nx = this.curve._mulC(b.redISub(e)).redMul(j);\n // Y3 = c * E * (C - D)\n ny = this.curve._mulC(e).redMul(c.redISub(d));\n // Z3 = E * J\n nz = e.redMul(j);\n }\n return this.curve.point(nx, ny, nz);\n};\n\nPoint.prototype.dbl = function dbl() {\n if (this.isInfinity())\n return this;\n\n // Double in extended coordinates\n if (this.curve.extended)\n return this._extDbl();\n else\n return this._projDbl();\n};\n\nPoint.prototype._extAdd = function _extAdd(p) {\n // hyperelliptic.org/EFD/g1p/auto-twisted-extended-1.html\n // #addition-add-2008-hwcd-3\n // 8M\n\n // A = (Y1 - X1) * (Y2 - X2)\n var a = this.y.redSub(this.x).redMul(p.y.redSub(p.x));\n // B = (Y1 + X1) * (Y2 + X2)\n var b = this.y.redAdd(this.x).redMul(p.y.redAdd(p.x));\n // C = T1 * k * T2\n var c = this.t.redMul(this.curve.dd).redMul(p.t);\n // D = Z1 * 2 * Z2\n var d = this.z.redMul(p.z.redAdd(p.z));\n // E = B - A\n var e = b.redSub(a);\n // F = D - C\n var f = d.redSub(c);\n // G = D + C\n var g = d.redAdd(c);\n // H = B + A\n var h = b.redAdd(a);\n // X3 = E * F\n var nx = e.redMul(f);\n // Y3 = G * H\n var ny = g.redMul(h);\n // T3 = E * H\n var nt = e.redMul(h);\n // Z3 = F * G\n var nz = f.redMul(g);\n return this.curve.point(nx, ny, nz, nt);\n};\n\nPoint.prototype._projAdd = function _projAdd(p) {\n // hyperelliptic.org/EFD/g1p/auto-twisted-projective.html\n // #addition-add-2008-bbjlp\n // #addition-add-2007-bl\n // 10M + 1S\n\n // A = Z1 * Z2\n var a = this.z.redMul(p.z);\n // B = A^2\n var b = a.redSqr();\n // C = X1 * X2\n var c = this.x.redMul(p.x);\n // D = Y1 * Y2\n var d = this.y.redMul(p.y);\n // E = d * C * D\n var e = this.curve.d.redMul(c).redMul(d);\n // F = B - E\n var f = b.redSub(e);\n // G = B + E\n var g = b.redAdd(e);\n // X3 = A * F * ((X1 + Y1) * (X2 + Y2) - C - D)\n var tmp = this.x.redAdd(this.y).redMul(p.x.redAdd(p.y)).redISub(c).redISub(d);\n var nx = a.redMul(f).redMul(tmp);\n var ny;\n var nz;\n if (this.curve.twisted) {\n // Y3 = A * G * (D - a * C)\n ny = a.redMul(g).redMul(d.redSub(this.curve._mulA(c)));\n // Z3 = F * G\n nz = f.redMul(g);\n } else {\n // Y3 = A * G * (D - C)\n ny = a.redMul(g).redMul(d.redSub(c));\n // Z3 = c * F * G\n nz = this.curve._mulC(f).redMul(g);\n }\n return this.curve.point(nx, ny, nz);\n};\n\nPoint.prototype.add = function add(p) {\n if (this.isInfinity())\n return p;\n if (p.isInfinity())\n return this;\n\n if (this.curve.extended)\n return this._extAdd(p);\n else\n return this._projAdd(p);\n};\n\nPoint.prototype.mul = function mul(k) {\n if (this._hasDoubles(k))\n return this.curve._fixedNafMul(this, k);\n else\n return this.curve._wnafMul(this, k);\n};\n\nPoint.prototype.mulAdd = function mulAdd(k1, p, k2) {\n return this.curve._wnafMulAdd(1, [ this, p ], [ k1, k2 ], 2, false);\n};\n\nPoint.prototype.jmulAdd = function jmulAdd(k1, p, k2) {\n return this.curve._wnafMulAdd(1, [ this, p ], [ k1, k2 ], 2, true);\n};\n\nPoint.prototype.normalize = function normalize() {\n if (this.zOne)\n return this;\n\n // Normalize coordinates\n var zi = this.z.redInvm();\n this.x = this.x.redMul(zi);\n this.y = this.y.redMul(zi);\n if (this.t)\n this.t = this.t.redMul(zi);\n this.z = this.curve.one;\n this.zOne = true;\n return this;\n};\n\nPoint.prototype.neg = function neg() {\n return this.curve.point(this.x.redNeg(),\n this.y,\n this.z,\n this.t && this.t.redNeg());\n};\n\nPoint.prototype.getX = function getX() {\n this.normalize();\n return this.x.fromRed();\n};\n\nPoint.prototype.getY = function getY() {\n this.normalize();\n return this.y.fromRed();\n};\n\nPoint.prototype.eq = function eq(other) {\n return this === other ||\n this.getX().cmp(other.getX()) === 0 &&\n this.getY().cmp(other.getY()) === 0;\n};\n\nPoint.prototype.eqXToP = function eqXToP(x) {\n var rx = x.toRed(this.curve.red).redMul(this.z);\n if (this.x.cmp(rx) === 0)\n return true;\n\n var xc = x.clone();\n var t = this.curve.redN.redMul(this.z);\n for (;;) {\n xc.iadd(this.curve.n);\n if (xc.cmp(this.curve.p) >= 0)\n return false;\n\n rx.redIAdd(t);\n if (this.x.cmp(rx) === 0)\n return true;\n }\n};\n\n// Compatibility with BaseCurve\nPoint.prototype.toP = Point.prototype.normalize;\nPoint.prototype.mixedAdd = Point.prototype.add;\n","'use strict';\n\nvar curve = exports;\n\ncurve.base = require('./base');\ncurve.short = require('./short');\ncurve.mont = require('./mont');\ncurve.edwards = require('./edwards');\n","'use strict';\n\nvar utils = require('../utils');\nvar common = require('../common');\nvar shaCommon = require('./common');\n\nvar rotl32 = utils.rotl32;\nvar sum32 = utils.sum32;\nvar sum32_5 = utils.sum32_5;\nvar ft_1 = shaCommon.ft_1;\nvar BlockHash = common.BlockHash;\n\nvar sha1_K = [\n 0x5A827999, 0x6ED9EBA1,\n 0x8F1BBCDC, 0xCA62C1D6\n];\n\nfunction SHA1() {\n if (!(this instanceof SHA1))\n return new SHA1();\n\n BlockHash.call(this);\n this.h = [\n 0x67452301, 0xefcdab89, 0x98badcfe,\n 0x10325476, 0xc3d2e1f0 ];\n this.W = new Array(80);\n}\n\nutils.inherits(SHA1, BlockHash);\nmodule.exports = SHA1;\n\nSHA1.blockSize = 512;\nSHA1.outSize = 160;\nSHA1.hmacStrength = 80;\nSHA1.padLength = 64;\n\nSHA1.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\n for(; i < W.length; i++)\n W[i] = rotl32(W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16], 1);\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\n for (i = 0; i < W.length; i++) {\n var s = ~~(i / 20);\n var t = sum32_5(rotl32(a, 5), ft_1(s, b, c, d), e, W[i], sha1_K[s]);\n e = d;\n d = c;\n c = rotl32(b, 30);\n b = a;\n a = t;\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};\n\nSHA1.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\nexports.sha1 = require('./sha/1');\nexports.sha224 = require('./sha/224');\nexports.sha256 = require('./sha/256');\nexports.sha384 = require('./sha/384');\nexports.sha512 = require('./sha/512');\n","'use strict';\n\nvar utils = require('./utils');\nvar assert = require('minimalistic-assert');\n\nfunction Hmac(hash, key, enc) {\n if (!(this instanceof Hmac))\n return new Hmac(hash, key, enc);\n this.Hash = hash;\n this.blockSize = hash.blockSize / 8;\n this.outSize = hash.outSize / 8;\n this.inner = null;\n this.outer = null;\n\n this._init(utils.toArray(key, enc));\n}\nmodule.exports = Hmac;\n\nHmac.prototype._init = function init(key) {\n // Shorten key, if needed\n if (key.length > this.blockSize)\n key = new this.Hash().update(key).digest();\n assert(key.length <= this.blockSize);\n\n // Add padding to key\n for (var i = key.length; i < this.blockSize; i++)\n key.push(0);\n\n for (i = 0; i < key.length; i++)\n key[i] ^= 0x36;\n this.inner = new this.Hash().update(key);\n\n // 0x36 ^ 0x5c = 0x6a\n for (i = 0; i < key.length; i++)\n key[i] ^= 0x6a;\n this.outer = new this.Hash().update(key);\n};\n\nHmac.prototype.update = function update(msg, enc) {\n this.inner.update(msg, enc);\n return this;\n};\n\nHmac.prototype.digest = function digest(enc) {\n this.outer.update(this.inner.digest());\n return this.outer.digest(enc);\n};\n","var hash = exports;\n\nhash.utils = require('./hash/utils');\nhash.common = require('./hash/common');\nhash.sha = require('./hash/sha');\nhash.ripemd = require('./hash/ripemd');\nhash.hmac = require('./hash/hmac');\n\n// Proxy hash functions to the main object\nhash.sha1 = hash.sha.sha1;\nhash.sha256 = hash.sha.sha256;\nhash.sha224 = hash.sha.sha224;\nhash.sha384 = hash.sha.sha384;\nhash.sha512 = hash.sha.sha512;\nhash.ripemd160 = hash.ripemd.ripemd160;\n","module.exports = {\n doubles: {\n step: 4,\n points: [\n [\n 'e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a',\n 'f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821'\n ],\n [\n '8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508',\n '11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf'\n ],\n [\n '175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739',\n 'd3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695'\n ],\n [\n '363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640',\n '4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9'\n ],\n [\n '8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c',\n '4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36'\n ],\n [\n '723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda',\n '96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f'\n ],\n [\n 'eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa',\n '5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999'\n ],\n [\n '100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0',\n 'cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09'\n ],\n [\n 'e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d',\n '9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d'\n ],\n [\n 'feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d',\n 'e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088'\n ],\n [\n 'da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1',\n '9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d'\n ],\n [\n '53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0',\n '5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8'\n ],\n [\n '8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047',\n '10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a'\n ],\n [\n '385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862',\n '283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453'\n ],\n [\n '6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7',\n '7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160'\n ],\n [\n '3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd',\n '56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0'\n ],\n [\n '85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83',\n '7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6'\n ],\n [\n '948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a',\n '53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589'\n ],\n [\n '6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8',\n 'bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17'\n ],\n [\n 'e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d',\n '4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda'\n ],\n [\n 'e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725',\n '7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd'\n ],\n [\n '213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754',\n '4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2'\n ],\n [\n '4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c',\n '17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6'\n ],\n [\n 'fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6',\n '6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f'\n ],\n [\n '76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39',\n 'c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01'\n ],\n [\n 'c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891',\n '893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3'\n ],\n [\n 'd895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b',\n 'febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f'\n ],\n [\n 'b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03',\n '2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7'\n ],\n [\n 'e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d',\n 'eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78'\n ],\n [\n 'a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070',\n '7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1'\n ],\n [\n '90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4',\n 'e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150'\n ],\n [\n '8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da',\n '662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82'\n ],\n [\n 'e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11',\n '1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc'\n ],\n [\n '8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e',\n 'efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b'\n ],\n [\n 'e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41',\n '2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51'\n ],\n [\n 'b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef',\n '67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45'\n ],\n [\n 'd68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8',\n 'db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120'\n ],\n [\n '324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d',\n '648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84'\n ],\n [\n '4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96',\n '35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d'\n ],\n [\n '9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd',\n 'ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d'\n ],\n [\n '6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5',\n '9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8'\n ],\n [\n 'a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266',\n '40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8'\n ],\n [\n '7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71',\n '34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac'\n ],\n [\n '928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac',\n 'c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f'\n ],\n [\n '85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751',\n '1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962'\n ],\n [\n 'ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e',\n '493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907'\n ],\n [\n '827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241',\n 'c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec'\n ],\n [\n 'eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3',\n 'be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d'\n ],\n [\n 'e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f',\n '4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414'\n ],\n [\n '1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19',\n 'aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd'\n ],\n [\n '146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be',\n 'b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0'\n ],\n [\n 'fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9',\n '6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811'\n ],\n [\n 'da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2',\n '8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1'\n ],\n [\n 'a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13',\n '7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c'\n ],\n [\n '174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c',\n 'ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73'\n ],\n [\n '959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba',\n '2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd'\n ],\n [\n 'd2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151',\n 'e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405'\n ],\n [\n '64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073',\n 'd99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589'\n ],\n [\n '8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458',\n '38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e'\n ],\n [\n '13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b',\n '69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27'\n ],\n [\n 'bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366',\n 'd3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1'\n ],\n [\n '8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa',\n '40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482'\n ],\n [\n '8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0',\n '620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945'\n ],\n [\n 'dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787',\n '7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573'\n ],\n [\n 'f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e',\n 'ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82'\n ]\n ]\n },\n naf: {\n wnd: 7,\n points: [\n [\n 'f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9',\n '388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672'\n ],\n [\n '2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4',\n 'd8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6'\n ],\n [\n '5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc',\n '6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da'\n ],\n [\n 'acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe',\n 'cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37'\n ],\n [\n '774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb',\n 'd984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b'\n ],\n [\n 'f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8',\n 'ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81'\n ],\n [\n 'd7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e',\n '581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58'\n ],\n [\n 'defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34',\n '4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77'\n ],\n [\n '2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c',\n '85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a'\n ],\n [\n '352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5',\n '321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c'\n ],\n [\n '2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f',\n '2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67'\n ],\n [\n '9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714',\n '73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402'\n ],\n [\n 'daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729',\n 'a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55'\n ],\n [\n 'c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db',\n '2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482'\n ],\n [\n '6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4',\n 'e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82'\n ],\n [\n '1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5',\n 'b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396'\n ],\n [\n '605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479',\n '2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49'\n ],\n [\n '62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d',\n '80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf'\n ],\n [\n '80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f',\n '1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a'\n ],\n [\n '7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb',\n 'd0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7'\n ],\n [\n 'd528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9',\n 'eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933'\n ],\n [\n '49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963',\n '758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a'\n ],\n [\n '77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74',\n '958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6'\n ],\n [\n 'f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530',\n 'e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37'\n ],\n [\n '463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b',\n '5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e'\n ],\n [\n 'f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247',\n 'cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6'\n ],\n [\n 'caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1',\n 'cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476'\n ],\n [\n '2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120',\n '4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40'\n ],\n [\n '7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435',\n '91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61'\n ],\n [\n '754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18',\n '673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683'\n ],\n [\n 'e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8',\n '59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5'\n ],\n [\n '186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb',\n '3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b'\n ],\n [\n 'df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f',\n '55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417'\n ],\n [\n '5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143',\n 'efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868'\n ],\n [\n '290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba',\n 'e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a'\n ],\n [\n 'af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45',\n 'f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6'\n ],\n [\n '766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a',\n '744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996'\n ],\n [\n '59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e',\n 'c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e'\n ],\n [\n 'f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8',\n 'e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d'\n ],\n [\n '7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c',\n '30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2'\n ],\n [\n '948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519',\n 'e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e'\n ],\n [\n '7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab',\n '100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437'\n ],\n [\n '3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca',\n 'ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311'\n ],\n [\n 'd3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf',\n '8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4'\n ],\n [\n '1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610',\n '68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575'\n ],\n [\n '733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4',\n 'f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d'\n ],\n [\n '15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c',\n 'd56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d'\n ],\n [\n 'a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940',\n 'edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629'\n ],\n [\n 'e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980',\n 'a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06'\n ],\n [\n '311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3',\n '66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374'\n ],\n [\n '34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf',\n '9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee'\n ],\n [\n 'f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63',\n '4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1'\n ],\n [\n 'd7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448',\n 'fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b'\n ],\n [\n '32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf',\n '5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661'\n ],\n [\n '7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5',\n '8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6'\n ],\n [\n 'ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6',\n '8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e'\n ],\n [\n '16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5',\n '5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d'\n ],\n [\n 'eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99',\n 'f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc'\n ],\n [\n '78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51',\n 'f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4'\n ],\n [\n '494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5',\n '42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c'\n ],\n [\n 'a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5',\n '204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b'\n ],\n [\n 'c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997',\n '4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913'\n ],\n [\n '841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881',\n '73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154'\n ],\n [\n '5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5',\n '39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865'\n ],\n [\n '36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66',\n 'd2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc'\n ],\n [\n '336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726',\n 'ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224'\n ],\n [\n '8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede',\n '6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e'\n ],\n [\n '1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94',\n '60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6'\n ],\n [\n '85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31',\n '3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511'\n ],\n [\n '29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51',\n 'b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b'\n ],\n [\n 'a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252',\n 'ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2'\n ],\n [\n '4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5',\n 'cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c'\n ],\n [\n 'd24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b',\n '6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3'\n ],\n [\n 'ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4',\n '322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d'\n ],\n [\n 'af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f',\n '6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700'\n ],\n [\n 'e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889',\n '2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4'\n ],\n [\n '591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246',\n 'b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196'\n ],\n [\n '11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984',\n '998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4'\n ],\n [\n '3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a',\n 'b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257'\n ],\n [\n 'cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030',\n 'bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13'\n ],\n [\n 'c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197',\n '6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096'\n ],\n [\n 'c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593',\n 'c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38'\n ],\n [\n 'a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef',\n '21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f'\n ],\n [\n '347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38',\n '60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448'\n ],\n [\n 'da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a',\n '49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a'\n ],\n [\n 'c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111',\n '5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4'\n ],\n [\n '4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502',\n '7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437'\n ],\n [\n '3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea',\n 'be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7'\n ],\n [\n 'cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26',\n '8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d'\n ],\n [\n 'b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986',\n '39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a'\n ],\n [\n 'd4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e',\n '62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54'\n ],\n [\n '48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4',\n '25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77'\n ],\n [\n 'dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda',\n 'ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517'\n ],\n [\n '6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859',\n 'cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10'\n ],\n [\n 'e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f',\n 'f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125'\n ],\n [\n 'eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c',\n '6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e'\n ],\n [\n '13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942',\n 'fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1'\n ],\n [\n 'ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a',\n '1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2'\n ],\n [\n 'b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80',\n '5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423'\n ],\n [\n 'ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d',\n '438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8'\n ],\n [\n '8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1',\n 'cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758'\n ],\n [\n '52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63',\n 'c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375'\n ],\n [\n 'e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352',\n '6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d'\n ],\n [\n '7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193',\n 'ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec'\n ],\n [\n '5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00',\n '9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0'\n ],\n [\n '32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58',\n 'ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c'\n ],\n [\n 'e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7',\n 'd3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4'\n ],\n [\n '8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8',\n 'c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f'\n ],\n [\n '4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e',\n '67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649'\n ],\n [\n '3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d',\n 'cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826'\n ],\n [\n '674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b',\n '299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5'\n ],\n [\n 'd32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f',\n 'f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87'\n ],\n [\n '30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6',\n '462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b'\n ],\n [\n 'be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297',\n '62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc'\n ],\n [\n '93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a',\n '7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c'\n ],\n [\n 'b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c',\n 'ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f'\n ],\n [\n 'd5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52',\n '4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a'\n ],\n [\n 'd3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb',\n 'bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46'\n ],\n [\n '463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065',\n 'bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f'\n ],\n [\n '7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917',\n '603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03'\n ],\n [\n '74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9',\n 'cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08'\n ],\n [\n '30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3',\n '553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8'\n ],\n [\n '9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57',\n '712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373'\n ],\n [\n '176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66',\n 'ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3'\n ],\n [\n '75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8',\n '9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8'\n ],\n [\n '809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721',\n '9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1'\n ],\n [\n '1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180',\n '4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9'\n ]\n ]\n }\n};\n","'use strict';\n\nvar curves = exports;\n\nvar hash = require('hash.js');\nvar curve = require('./curve');\nvar utils = require('./utils');\n\nvar assert = utils.assert;\n\nfunction PresetCurve(options) {\n if (options.type === 'short')\n this.curve = new curve.short(options);\n else if (options.type === 'edwards')\n this.curve = new curve.edwards(options);\n else if (options.type === 'mont')\n this.curve = new curve.mont(options);\n else throw new Error('Unknown curve type.');\n this.g = this.curve.g;\n this.n = this.curve.n;\n this.hash = options.hash;\n\n assert(this.g.validate(), 'Invalid curve');\n assert(this.g.mul(this.n).isInfinity(), 'Invalid curve, n*G != O');\n}\ncurves.PresetCurve = PresetCurve;\n\nfunction defineCurve(name, options) {\n Object.defineProperty(curves, name, {\n configurable: true,\n enumerable: true,\n get: function() {\n var curve = new PresetCurve(options);\n Object.defineProperty(curves, name, {\n configurable: true,\n enumerable: true,\n value: curve\n });\n return curve;\n }\n });\n}\n\ndefineCurve('p192', {\n type: 'short',\n prime: 'p192',\n p: 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff',\n a: 'ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc',\n b: '64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1',\n n: 'ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831',\n hash: hash.sha256,\n gRed: false,\n g: [\n '188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012',\n '07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811'\n ]\n});\n\ndefineCurve('p224', {\n type: 'short',\n prime: 'p224',\n p: 'ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001',\n a: 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe',\n b: 'b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4',\n n: 'ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d',\n hash: hash.sha256,\n gRed: false,\n g: [\n 'b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21',\n 'bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34'\n ]\n});\n\ndefineCurve('p256', {\n type: 'short',\n prime: null,\n p: 'ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff',\n a: 'ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc',\n b: '5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b',\n n: 'ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551',\n hash: hash.sha256,\n gRed: false,\n g: [\n '6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296',\n '4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5'\n ]\n});\n\ndefineCurve('p384', {\n type: 'short',\n prime: null,\n p: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' +\n 'fffffffe ffffffff 00000000 00000000 ffffffff',\n a: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' +\n 'fffffffe ffffffff 00000000 00000000 fffffffc',\n b: 'b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f ' +\n '5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef',\n n: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 ' +\n 'f4372ddf 581a0db2 48b0a77a ecec196a ccc52973',\n hash: hash.sha384,\n gRed: false,\n g: [\n 'aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 ' +\n '5502f25d bf55296c 3a545e38 72760ab7',\n '3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 ' +\n '0a60b1ce 1d7e819d 7a431d7c 90ea0e5f'\n ]\n});\n\ndefineCurve('p521', {\n type: 'short',\n prime: null,\n p: '000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ' +\n 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' +\n 'ffffffff ffffffff ffffffff ffffffff ffffffff',\n a: '000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ' +\n 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' +\n 'ffffffff ffffffff ffffffff ffffffff fffffffc',\n b: '00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b ' +\n '99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd ' +\n '3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00',\n n: '000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ' +\n 'ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 ' +\n 'f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409',\n hash: hash.sha512,\n gRed: false,\n g: [\n '000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 ' +\n '053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 ' +\n 'a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66',\n '00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 ' +\n '579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 ' +\n '3fad0761 353c7086 a272c240 88be9476 9fd16650'\n ]\n});\n\n// https://tools.ietf.org/html/rfc7748#section-4.1\ndefineCurve('curve25519', {\n type: 'mont',\n prime: 'p25519',\n p: '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed',\n a: '76d06',\n b: '1',\n n: '1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed',\n cofactor: '8',\n hash: hash.sha256,\n gRed: false,\n g: [\n '9'\n ]\n});\n\ndefineCurve('ed25519', {\n type: 'edwards',\n prime: 'p25519',\n p: '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed',\n a: '-1',\n c: '1',\n // -121665 * (121666^(-1)) (mod P)\n d: '52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3',\n n: '1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed',\n cofactor: '8',\n hash: hash.sha256,\n gRed: false,\n g: [\n '216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a',\n // 4/5\n '6666666666666666666666666666666666666666666666666666666666666658'\n ]\n});\n\n// https://tools.ietf.org/html/rfc5639#section-3.4\ndefineCurve('brainpoolP256r1', {\n type: 'short',\n prime: null,\n p: 'A9FB57DB A1EEA9BC 3E660A90 9D838D72 6E3BF623 D5262028 2013481D 1F6E5377',\n a: '7D5A0975 FC2C3057 EEF67530 417AFFE7 FB8055C1 26DC5C6C E94A4B44 F330B5D9',\n b: '26DC5C6C E94A4B44 F330B5D9 BBD77CBF 95841629 5CF7E1CE 6BCCDC18 FF8C07B6',\n n: 'A9FB57DB A1EEA9BC 3E660A90 9D838D71 8C397AA3 B561A6F7 901E0E82 974856A7',\n hash: hash.sha256, // or 384, or 512\n gRed: false,\n g: [\n '8BD2AEB9CB7E57CB2C4B482FFC81B7AFB9DE27E1E3BD23C23A4453BD9ACE3262',\n '547EF835C3DAC4FD97F8461A14611DC9C27745132DED8E545C1D54C72F046997'\n ]\n});\n\n// https://tools.ietf.org/html/rfc5639#section-3.6\ndefineCurve('brainpoolP384r1', {\n type: 'short',\n prime: null,\n p: '8CB91E82 A3386D28 0F5D6F7E 50E641DF 152F7109 ED5456B4 12B1DA19 7FB71123' +\n 'ACD3A729 901D1A71 87470013 3107EC53',\n a: '7BC382C6 3D8C150C 3C72080A CE05AFA0 C2BEA28E 4FB22787 139165EF BA91F90F' +\n '8AA5814A 503AD4EB 04A8C7DD 22CE2826',\n b: '04A8C7DD 22CE2826 8B39B554 16F0447C 2FB77DE1 07DCD2A6 2E880EA5 3EEB62D5' +\n '7CB43902 95DBC994 3AB78696 FA504C11',\n n: '8CB91E82 A3386D28 0F5D6F7E 50E641DF 152F7109 ED5456B3 1F166E6C AC0425A7' +\n 'CF3AB6AF 6B7FC310 3B883202 E9046565',\n hash: hash.sha384, // or 512\n gRed: false,\n g: [\n '1D1C64F068CF45FFA2A63A81B7C13F6B8847A3E77EF14FE3DB7FCAFE0CBD10' +\n 'E8E826E03436D646AAEF87B2E247D4AF1E',\n '8ABE1D7520F9C2A45CB1EB8E95CFD55262B70B29FEEC5864E19C054FF99129' +\n '280E4646217791811142820341263C5315'\n ]\n});\n\n// https://tools.ietf.org/html/rfc5639#section-3.7\ndefineCurve('brainpoolP512r1', {\n type: 'short',\n prime: null,\n p: 'AADD9DB8 DBE9C48B 3FD4E6AE 33C9FC07 CB308DB3 B3C9D20E D6639CCA 70330871' +\n '7D4D9B00 9BC66842 AECDA12A E6A380E6 2881FF2F 2D82C685 28AA6056 583A48F3',\n a: '7830A331 8B603B89 E2327145 AC234CC5 94CBDD8D 3DF91610 A83441CA EA9863BC' +\n '2DED5D5A A8253AA1 0A2EF1C9 8B9AC8B5 7F1117A7 2BF2C7B9 E7C1AC4D 77FC94CA',\n b: '3DF91610 A83441CA EA9863BC 2DED5D5A A8253AA1 0A2EF1C9 8B9AC8B5 7F1117A7' +\n '2BF2C7B9 E7C1AC4D 77FC94CA DC083E67 984050B7 5EBAE5DD 2809BD63 8016F723',\n n: 'AADD9DB8 DBE9C48B 3FD4E6AE 33C9FC07 CB308DB3 B3C9D20E D6639CCA 70330870' +\n '553E5C41 4CA92619 41866119 7FAC1047 1DB1D381 085DDADD B5879682 9CA90069',\n hash: hash.sha512,\n gRed: false,\n g: [\n '81AEE4BDD82ED9645A21322E9C4C6A9385ED9F70B5D916C1B43B62EEF4D009' +\n '8EFF3B1F78E2D0D48D50D1687B93B97D5F7C6D5047406A5E688B352209BCB9F822',\n '7DDE385D566332ECC0EABFA9CF7822FDF209F70024A57B1AA000C55B881F81' +\n '11B2DCDE494A5F485E5BCA4BD88A2763AED1CA2B2FA8F0540678CD1E0F3AD80892'\n ]\n});\n\n// https://en.bitcoin.it/wiki/Secp256k1\nvar pre;\ntry {\n pre = require('./precomputed/secp256k1');\n} catch (e) {\n pre = undefined;\n}\n\ndefineCurve('secp256k1', {\n type: 'short',\n prime: 'k256',\n p: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f',\n a: '0',\n b: '7',\n n: 'ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141',\n h: '1',\n hash: hash.sha256,\n\n // Precomputed endomorphism\n beta: '7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee',\n lambda: '5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72',\n basis: [\n {\n a: '3086d221a7d46bcde86c90e49284eb15',\n b: '-e4437ed6010e88286f547fa90abfe4c3'\n },\n {\n a: '114ca50f7a8e2f3f657c1108d9d44cfd8',\n b: '3086d221a7d46bcde86c90e49284eb15'\n }\n ],\n\n gRed: false,\n g: [\n '79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798',\n '483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8',\n pre\n ]\n});\n","'use strict';\n\nvar hash = require('hash.js');\nvar utils = require('minimalistic-crypto-utils');\nvar assert = require('minimalistic-assert');\n\nfunction HmacDRBG(options) {\n if (!(this instanceof HmacDRBG))\n return new HmacDRBG(options);\n this.hash = options.hash;\n this.predResist = !!options.predResist;\n\n this.outLen = this.hash.outSize;\n this.minEntropy = options.minEntropy || this.hash.hmacStrength;\n\n this._reseed = null;\n this.reseedInterval = null;\n this.K = null;\n this.V = null;\n\n var entropy = utils.toArray(options.entropy, options.entropyEnc || 'hex');\n var nonce = utils.toArray(options.nonce, options.nonceEnc || 'hex');\n var pers = utils.toArray(options.pers, options.persEnc || 'hex');\n assert(entropy.length >= (this.minEntropy / 8),\n 'Not enough entropy. Minimum is: ' + this.minEntropy + ' bits');\n this._init(entropy, nonce, pers);\n}\nmodule.exports = HmacDRBG;\n\nHmacDRBG.prototype._init = function init(entropy, nonce, pers) {\n var seed = entropy.concat(nonce).concat(pers);\n\n this.K = new Array(this.outLen / 8);\n this.V = new Array(this.outLen / 8);\n for (var i = 0; i < this.V.length; i++) {\n this.K[i] = 0x00;\n this.V[i] = 0x01;\n }\n\n this._update(seed);\n this._reseed = 1;\n this.reseedInterval = 0x1000000000000; // 2^48\n};\n\nHmacDRBG.prototype._hmac = function hmac() {\n return new hash.hmac(this.hash, this.K);\n};\n\nHmacDRBG.prototype._update = function update(seed) {\n var kmac = this._hmac()\n .update(this.V)\n .update([ 0x00 ]);\n if (seed)\n kmac = kmac.update(seed);\n this.K = kmac.digest();\n this.V = this._hmac().update(this.V).digest();\n if (!seed)\n return;\n\n this.K = this._hmac()\n .update(this.V)\n .update([ 0x01 ])\n .update(seed)\n .digest();\n this.V = this._hmac().update(this.V).digest();\n};\n\nHmacDRBG.prototype.reseed = function reseed(entropy, entropyEnc, add, addEnc) {\n // Optional entropy enc\n if (typeof entropyEnc !== 'string') {\n addEnc = add;\n add = entropyEnc;\n entropyEnc = null;\n }\n\n entropy = utils.toArray(entropy, entropyEnc);\n add = utils.toArray(add, addEnc);\n\n assert(entropy.length >= (this.minEntropy / 8),\n 'Not enough entropy. Minimum is: ' + this.minEntropy + ' bits');\n\n this._update(entropy.concat(add || []));\n this._reseed = 1;\n};\n\nHmacDRBG.prototype.generate = function generate(len, enc, add, addEnc) {\n if (this._reseed > this.reseedInterval)\n throw new Error('Reseed is required');\n\n // Optional encoding\n if (typeof enc !== 'string') {\n addEnc = add;\n add = enc;\n enc = null;\n }\n\n // Optional additional data\n if (add) {\n add = utils.toArray(add, addEnc || 'hex');\n this._update(add);\n }\n\n var temp = [];\n while (temp.length < len) {\n this.V = this._hmac().update(this.V).digest();\n temp = temp.concat(this.V);\n }\n\n var res = temp.slice(0, len);\n this._update(add);\n this._reseed++;\n return utils.encode(res, enc);\n};\n","'use strict';\n\nvar BN = require('bn.js');\nvar utils = require('../utils');\nvar assert = utils.assert;\n\nfunction KeyPair(ec, options) {\n this.ec = ec;\n this.priv = null;\n this.pub = null;\n\n // KeyPair(ec, { priv: ..., pub: ... })\n if (options.priv)\n this._importPrivate(options.priv, options.privEnc);\n if (options.pub)\n this._importPublic(options.pub, options.pubEnc);\n}\nmodule.exports = KeyPair;\n\nKeyPair.fromPublic = function fromPublic(ec, pub, enc) {\n if (pub instanceof KeyPair)\n return pub;\n\n return new KeyPair(ec, {\n pub: pub,\n pubEnc: enc\n });\n};\n\nKeyPair.fromPrivate = function fromPrivate(ec, priv, enc) {\n if (priv instanceof KeyPair)\n return priv;\n\n return new KeyPair(ec, {\n priv: priv,\n privEnc: enc\n });\n};\n\n// TODO: should not validate for X25519\nKeyPair.prototype.validate = function validate() {\n var pub = this.getPublic();\n\n if (pub.isInfinity())\n return { result: false, reason: 'Invalid public key' };\n if (!pub.validate())\n return { result: false, reason: 'Public key is not a point' };\n if (!pub.mul(this.ec.curve.n).isInfinity())\n return { result: false, reason: 'Public key * N != O' };\n\n return { result: true, reason: null };\n};\n\nKeyPair.prototype.getPublic = function getPublic(enc, compact) {\n if (!this.pub)\n this.pub = this.ec.g.mul(this.priv);\n\n if (!enc)\n return this.pub;\n\n return this.pub.encode(enc, compact);\n};\n\nKeyPair.prototype.getPrivate = function getPrivate(enc) {\n if (enc === 'hex')\n return this.priv.toString(16, 2);\n else\n return this.priv;\n};\n\nKeyPair.prototype._importPrivate = function _importPrivate(key, enc) {\n this.priv = new BN(key, enc || 16);\n\n // For Curve25519/Curve448 we have a specific procedure.\n // TODO Curve448\n if (this.ec.curve.type === 'mont') {\n var one = this.ec.curve.one;\n var mask = one.ushln(255 - 3).sub(one).ushln(3);\n this.priv = this.priv.or(one.ushln(255 - 1));\n this.priv = this.priv.and(mask);\n } else\n // Ensure that the priv won't be bigger than n, otherwise we may fail\n // in fixed multiplication method\n this.priv = this.priv.umod(this.ec.curve.n);\n};\n\nKeyPair.prototype._importPublic = function _importPublic(key, enc) {\n if (key.x || key.y) {\n // Montgomery points only have an `x` coordinate.\n // Weierstrass/Edwards points on the other hand have both `x` and\n // `y` coordinates.\n if (this.ec.curve.type === 'mont') {\n assert(key.x, 'Need x coordinate');\n } else if (this.ec.curve.type === 'short' ||\n this.ec.curve.type === 'edwards') {\n assert(key.x && key.y, 'Need both x and y coordinate');\n }\n this.pub = this.ec.curve.point(key.x, key.y);\n return;\n }\n this.pub = this.ec.curve.decodePoint(key, enc);\n};\n\n// ECDH\nKeyPair.prototype.derive = function derive(pub) {\n return pub.mul(this.priv).getX();\n};\n\n// ECDSA\nKeyPair.prototype.sign = function sign(msg, enc, options) {\n return this.ec.sign(msg, this, enc, options);\n};\n\nKeyPair.prototype.verify = function verify(msg, signature) {\n return this.ec.verify(msg, signature, this);\n};\n\nKeyPair.prototype.inspect = function inspect() {\n return '<Key priv: ' + (this.priv && this.priv.toString(16, 2)) +\n ' pub: ' + (this.pub && this.pub.inspect()) + ' >';\n};\n","'use strict';\n\nvar BN = require('bn.js');\n\nvar utils = require('../utils');\nvar assert = utils.assert;\n\nfunction Signature(options, enc) {\n if (options instanceof Signature)\n return options;\n\n if (this._importDER(options, enc))\n return;\n\n assert(options.r && options.s, 'Signature without r or s');\n this.r = new BN(options.r, 16);\n this.s = new BN(options.s, 16);\n if (options.recoveryParam === undefined)\n this.recoveryParam = null;\n else\n this.recoveryParam = options.recoveryParam;\n}\nmodule.exports = Signature;\n\nfunction Position() {\n this.place = 0;\n}\n\nfunction getLength(buf, p) {\n var initial = buf[p.place++];\n if (!(initial & 0x80)) {\n return initial;\n }\n var octetLen = initial & 0xf;\n var val = 0;\n for (var i = 0, off = p.place; i < octetLen; i++, off++) {\n val <<= 8;\n val |= buf[off];\n }\n p.place = off;\n return val;\n}\n\nfunction rmPadding(buf) {\n var i = 0;\n var len = buf.length - 1;\n while (!buf[i] && !(buf[i + 1] & 0x80) && i < len) {\n i++;\n }\n if (i === 0) {\n return buf;\n }\n return buf.slice(i);\n}\n\nSignature.prototype._importDER = function _importDER(data, enc) {\n data = utils.toArray(data, enc);\n var p = new Position();\n if (data[p.place++] !== 0x30) {\n return false;\n }\n var len = getLength(data, p);\n if ((len + p.place) !== data.length) {\n return false;\n }\n if (data[p.place++] !== 0x02) {\n return false;\n }\n var rlen = getLength(data, p);\n var r = data.slice(p.place, rlen + p.place);\n p.place += rlen;\n if (data[p.place++] !== 0x02) {\n return false;\n }\n var slen = getLength(data, p);\n if (data.length !== slen + p.place) {\n return false;\n }\n var s = data.slice(p.place, slen + p.place);\n if (r[0] === 0 && (r[1] & 0x80)) {\n r = r.slice(1);\n }\n if (s[0] === 0 && (s[1] & 0x80)) {\n s = s.slice(1);\n }\n\n this.r = new BN(r);\n this.s = new BN(s);\n this.recoveryParam = null;\n\n return true;\n};\n\nfunction constructLength(arr, len) {\n if (len < 0x80) {\n arr.push(len);\n return;\n }\n var octets = 1 + (Math.log(len) / Math.LN2 >>> 3);\n arr.push(octets | 0x80);\n while (--octets) {\n arr.push((len >>> (octets << 3)) & 0xff);\n }\n arr.push(len);\n}\n\nSignature.prototype.toDER = function toDER(enc) {\n var r = this.r.toArray();\n var s = this.s.toArray();\n\n // Pad values\n if (r[0] & 0x80)\n r = [ 0 ].concat(r);\n // Pad values\n if (s[0] & 0x80)\n s = [ 0 ].concat(s);\n\n r = rmPadding(r);\n s = rmPadding(s);\n\n while (!s[0] && !(s[1] & 0x80)) {\n s = s.slice(1);\n }\n var arr = [ 0x02 ];\n constructLength(arr, r.length);\n arr = arr.concat(r);\n arr.push(0x02);\n constructLength(arr, s.length);\n var backHalf = arr.concat(s);\n var res = [ 0x30 ];\n constructLength(res, backHalf.length);\n res = res.concat(backHalf);\n return utils.encode(res, enc);\n};\n","'use strict';\n\nvar BN = require('bn.js');\nvar HmacDRBG = require('hmac-drbg');\nvar utils = require('../utils');\nvar curves = require('../curves');\nvar rand = require('brorand');\nvar assert = utils.assert;\n\nvar KeyPair = require('./key');\nvar Signature = require('./signature');\n\nfunction EC(options) {\n if (!(this instanceof EC))\n return new EC(options);\n\n // Shortcut `elliptic.ec(curve-name)`\n if (typeof options === 'string') {\n assert(curves.hasOwnProperty(options), 'Unknown curve ' + options);\n\n options = curves[options];\n }\n\n // Shortcut for `elliptic.ec(elliptic.curves.curveName)`\n if (options instanceof curves.PresetCurve)\n options = { curve: options };\n\n this.curve = options.curve.curve;\n this.n = this.curve.n;\n this.nh = this.n.ushrn(1);\n this.g = this.curve.g;\n\n // Point on curve\n this.g = options.curve.g;\n this.g.precompute(options.curve.n.bitLength() + 1);\n\n // Hash function for DRBG\n this.hash = options.hash || options.curve.hash;\n}\nmodule.exports = EC;\n\nEC.prototype.keyPair = function keyPair(options) {\n return new KeyPair(this, options);\n};\n\nEC.prototype.keyFromPrivate = function keyFromPrivate(priv, enc) {\n return KeyPair.fromPrivate(this, priv, enc);\n};\n\nEC.prototype.keyFromPublic = function keyFromPublic(pub, enc) {\n return KeyPair.fromPublic(this, pub, enc);\n};\n\nEC.prototype.genKeyPair = function genKeyPair(options) {\n if (!options)\n options = {};\n\n // Instantiate Hmac_DRBG\n var drbg = new HmacDRBG({\n hash: this.hash,\n pers: options.pers,\n persEnc: options.persEnc || 'utf8',\n entropy: options.entropy || rand(this.hash.hmacStrength),\n entropyEnc: options.entropy && options.entropyEnc || 'utf8',\n nonce: this.n.toArray()\n });\n\n // Key generation for curve25519 is simpler\n if (this.curve.type === 'mont') {\n var priv = new BN(drbg.generate(32));\n return this.keyFromPrivate(priv);\n }\n\n var bytes = this.n.byteLength();\n var ns2 = this.n.sub(new BN(2));\n do {\n var priv = new BN(drbg.generate(bytes));\n if (priv.cmp(ns2) > 0)\n continue;\n\n priv.iaddn(1);\n return this.keyFromPrivate(priv);\n } while (true);\n};\n\nEC.prototype._truncateToN = function truncateToN(msg, truncOnly, bitSize) {\n bitSize = bitSize || msg.byteLength() * 8;\n var delta = bitSize - this.n.bitLength();\n if (delta > 0)\n msg = msg.ushrn(delta);\n if (!truncOnly && msg.cmp(this.n) >= 0)\n return msg.sub(this.n);\n else\n return msg;\n};\n\nEC.prototype.truncateMsg = function truncateMSG(msg) {\n // Bit size is only determined correctly for Uint8Arrays and hex strings\n var bitSize;\n if (msg instanceof Uint8Array) {\n bitSize = msg.byteLength * 8;\n msg = this._truncateToN(new BN(msg, 16), false, bitSize);\n } else if (typeof msg === 'string') {\n bitSize = msg.length * 4;\n msg = this._truncateToN(new BN(msg, 16), false, bitSize);\n } else {\n msg = this._truncateToN(new BN(msg, 16));\n }\n return msg;\n}\n\nEC.prototype.sign = function sign(msg, key, enc, options) {\n if (typeof enc === 'object') {\n options = enc;\n enc = null;\n }\n if (!options)\n options = {};\n\n key = this.keyFromPrivate(key, enc);\n msg = this.truncateMsg(msg);\n\n // Zero-extend key to provide enough entropy\n var bytes = this.n.byteLength();\n var bkey = key.getPrivate().toArray('be', bytes);\n\n // Zero-extend nonce to have the same byte size as N\n var nonce = msg.toArray('be', bytes);\n\n // Instantiate Hmac_DRBG\n var drbg = new HmacDRBG({\n hash: this.hash,\n entropy: bkey,\n nonce: nonce,\n pers: options.pers,\n persEnc: options.persEnc || 'utf8'\n });\n\n // Number of bytes to generate\n var ns1 = this.n.sub(new BN(1));\n\n for (var iter = 0; true; iter++) {\n var k = options.k ?\n options.k(iter) :\n new BN(drbg.generate(this.n.byteLength()));\n k = this._truncateToN(k, true);\n if (k.cmpn(1) <= 0 || k.cmp(ns1) >= 0)\n continue;\n\n var kp = this.g.mul(k);\n if (kp.isInfinity())\n continue;\n\n var kpX = kp.getX();\n var r = kpX.umod(this.n);\n if (r.cmpn(0) === 0)\n continue;\n\n var s = k.invm(this.n).mul(r.mul(key.getPrivate()).iadd(msg));\n s = s.umod(this.n);\n if (s.cmpn(0) === 0)\n continue;\n\n var recoveryParam = (kp.getY().isOdd() ? 1 : 0) |\n (kpX.cmp(r) !== 0 ? 2 : 0);\n\n // Use complement of `s`, if it is > `n / 2`\n if (options.canonical && s.cmp(this.nh) > 0) {\n s = this.n.sub(s);\n recoveryParam ^= 1;\n }\n\n return new Signature({ r: r, s: s, recoveryParam: recoveryParam });\n }\n};\n\nEC.prototype.verify = function verify(msg, signature, key, enc) {\n key = this.keyFromPublic(key, enc);\n signature = new Signature(signature, 'hex');\n // Fallback to the old code\n var ret = this._verify(this.truncateMsg(msg), signature, key) ||\n this._verify(this._truncateToN(new BN(msg, 16)), signature, key);\n return ret;\n};\n\nEC.prototype._verify = function _verify(msg, signature, key) {\n // Perform primitive values validation\n var r = signature.r;\n var s = signature.s;\n if (r.cmpn(1) < 0 || r.cmp(this.n) >= 0)\n return false;\n if (s.cmpn(1) < 0 || s.cmp(this.n) >= 0)\n return false;\n\n // Validate signature\n var sinv = s.invm(this.n);\n var u1 = sinv.mul(msg).umod(this.n);\n var u2 = sinv.mul(r).umod(this.n);\n\n if (!this.curve._maxwellTrick) {\n var p = this.g.mulAdd(u1, key.getPublic(), u2);\n if (p.isInfinity())\n return false;\n\n return p.getX().umod(this.n).cmp(r) === 0;\n }\n\n // NOTE: Greg Maxwell's trick, inspired by:\n // https://git.io/vad3K\n\n var p = this.g.jmulAdd(u1, key.getPublic(), u2);\n if (p.isInfinity())\n return false;\n\n // Compare `p.x` of Jacobian point with `r`,\n // this will do `p.x == r * p.z^2` instead of multiplying `p.x` by the\n // inverse of `p.z^2`\n return p.eqXToP(r);\n};\n\nEC.prototype.recoverPubKey = function(msg, signature, j, enc) {\n assert((3 & j) === j, 'The recovery param is more than two bits');\n signature = new Signature(signature, enc);\n\n var n = this.n;\n var e = new BN(msg);\n var r = signature.r;\n var s = signature.s;\n\n // A set LSB signifies that the y-coordinate is odd\n var isYOdd = j & 1;\n var isSecondKey = j >> 1;\n if (r.cmp(this.curve.p.umod(this.curve.n)) >= 0 && isSecondKey)\n throw new Error('Unable to find sencond key candinate');\n\n // 1.1. Let x = r + jn.\n if (isSecondKey)\n r = this.curve.pointFromX(r.add(this.curve.n), isYOdd);\n else\n r = this.curve.pointFromX(r, isYOdd);\n\n var rInv = signature.r.invm(n);\n var s1 = n.sub(e).mul(rInv).umod(n);\n var s2 = s.mul(rInv).umod(n);\n\n // 1.6.1 Compute Q = r^-1 (sR - eG)\n // Q = r^-1 (sR + -eG)\n return this.g.mulAdd(s1, r, s2);\n};\n\nEC.prototype.getKeyRecoveryParam = function(e, signature, Q, enc) {\n signature = new Signature(signature, enc);\n if (signature.recoveryParam !== null)\n return signature.recoveryParam;\n\n for (var i = 0; i < 4; i++) {\n var Qprime;\n try {\n Qprime = this.recoverPubKey(e, signature, i);\n } catch (e) {\n continue;\n }\n\n if (Qprime.eq(Q))\n return i;\n }\n throw new Error('Unable to find valid recovery factor');\n};\n","'use strict';\n\nvar utils = require('../utils');\nvar assert = utils.assert;\nvar parseBytes = utils.parseBytes;\nvar cachedProperty = utils.cachedProperty;\n\n/**\n* @param {EDDSA} eddsa - instance\n* @param {Object} params - public/private key parameters\n*\n* @param {Array<Byte>} [params.secret] - secret seed bytes\n* @param {Point} [params.pub] - public key point (aka `A` in eddsa terms)\n* @param {Array<Byte>} [params.pub] - public key point encoded as bytes\n*\n*/\nfunction KeyPair(eddsa, params) {\n this.eddsa = eddsa;\n if (params.hasOwnProperty('secret'))\n this._secret = parseBytes(params.secret);\n if (eddsa.isPoint(params.pub))\n this._pub = params.pub;\n else {\n this._pubBytes = parseBytes(params.pub);\n if (this._pubBytes && this._pubBytes.length === 33 &&\n this._pubBytes[0] === 0x40)\n this._pubBytes = this._pubBytes.slice(1, 33);\n if (this._pubBytes && this._pubBytes.length !== 32)\n throw new Error('Unknown point compression format');\n }\n}\n\nKeyPair.fromPublic = function fromPublic(eddsa, pub) {\n if (pub instanceof KeyPair)\n return pub;\n return new KeyPair(eddsa, { pub: pub });\n};\n\nKeyPair.fromSecret = function fromSecret(eddsa, secret) {\n if (secret instanceof KeyPair)\n return secret;\n return new KeyPair(eddsa, { secret: secret });\n};\n\nKeyPair.prototype.secret = function secret() {\n return this._secret;\n};\n\ncachedProperty(KeyPair, 'pubBytes', function pubBytes() {\n return this.eddsa.encodePoint(this.pub());\n});\n\ncachedProperty(KeyPair, 'pub', function pub() {\n if (this._pubBytes)\n return this.eddsa.decodePoint(this._pubBytes);\n return this.eddsa.g.mul(this.priv());\n});\n\ncachedProperty(KeyPair, 'privBytes', function privBytes() {\n var eddsa = this.eddsa;\n var hash = this.hash();\n var lastIx = eddsa.encodingLength - 1;\n\n // https://tools.ietf.org/html/rfc8032#section-5.1.5\n var a = hash.slice(0, eddsa.encodingLength);\n a[0] &= 248;\n a[lastIx] &= 127;\n a[lastIx] |= 64;\n\n return a;\n});\n\ncachedProperty(KeyPair, 'priv', function priv() {\n return this.eddsa.decodeInt(this.privBytes());\n});\n\ncachedProperty(KeyPair, 'hash', function hash() {\n return this.eddsa.hash().update(this.secret()).digest();\n});\n\ncachedProperty(KeyPair, 'messagePrefix', function messagePrefix() {\n return this.hash().slice(this.eddsa.encodingLength);\n});\n\nKeyPair.prototype.sign = function sign(message) {\n assert(this._secret, 'KeyPair can only verify');\n return this.eddsa.sign(message, this);\n};\n\nKeyPair.prototype.verify = function verify(message, sig) {\n return this.eddsa.verify(message, sig, this);\n};\n\nKeyPair.prototype.getSecret = function getSecret(enc) {\n assert(this._secret, 'KeyPair is public only');\n return utils.encode(this.secret(), enc);\n};\n\nKeyPair.prototype.getPublic = function getPublic(enc, compact) {\n return utils.encode((compact ? [ 0x40 ] : []).concat(this.pubBytes()), enc);\n};\n\nmodule.exports = KeyPair;\n","'use strict';\n\nvar BN = require('bn.js');\nvar utils = require('../utils');\nvar assert = utils.assert;\nvar cachedProperty = utils.cachedProperty;\nvar parseBytes = utils.parseBytes;\n\n/**\n* @param {EDDSA} eddsa - eddsa instance\n* @param {Array<Bytes>|Object} sig -\n* @param {Array<Bytes>|Point} [sig.R] - R point as Point or bytes\n* @param {Array<Bytes>|bn} [sig.S] - S scalar as bn or bytes\n* @param {Array<Bytes>} [sig.Rencoded] - R point encoded\n* @param {Array<Bytes>} [sig.Sencoded] - S scalar encoded\n*/\nfunction Signature(eddsa, sig) {\n this.eddsa = eddsa;\n\n if (typeof sig !== 'object')\n sig = parseBytes(sig);\n\n if (Array.isArray(sig)) {\n sig = {\n R: sig.slice(0, eddsa.encodingLength),\n S: sig.slice(eddsa.encodingLength)\n };\n }\n\n assert(sig.R && sig.S, 'Signature without R or S');\n\n if (eddsa.isPoint(sig.R))\n this._R = sig.R;\n if (sig.S instanceof BN)\n this._S = sig.S;\n\n this._Rencoded = Array.isArray(sig.R) ? sig.R : sig.Rencoded;\n this._Sencoded = Array.isArray(sig.S) ? sig.S : sig.Sencoded;\n}\n\ncachedProperty(Signature, 'S', function S() {\n return this.eddsa.decodeInt(this.Sencoded());\n});\n\ncachedProperty(Signature, 'R', function R() {\n return this.eddsa.decodePoint(this.Rencoded());\n});\n\ncachedProperty(Signature, 'Rencoded', function Rencoded() {\n return this.eddsa.encodePoint(this.R());\n});\n\ncachedProperty(Signature, 'Sencoded', function Sencoded() {\n return this.eddsa.encodeInt(this.S());\n});\n\nSignature.prototype.toBytes = function toBytes() {\n return this.Rencoded().concat(this.Sencoded());\n};\n\nSignature.prototype.toHex = function toHex() {\n return utils.encode(this.toBytes(), 'hex').toUpperCase();\n};\n\nmodule.exports = Signature;\n","'use strict';\n\nvar hash = require('hash.js');\nvar HmacDRBG = require('hmac-drbg');\nvar rand = require('brorand');\nvar curves = require('../curves');\nvar utils = require('../utils');\nvar assert = utils.assert;\nvar parseBytes = utils.parseBytes;\nvar KeyPair = require('./key');\nvar Signature = require('./signature');\n\nfunction EDDSA(curve) {\n assert(curve === 'ed25519', 'only tested with ed25519 so far');\n\n if (!(this instanceof EDDSA))\n return new EDDSA(curve);\n\n var curve = curves[curve].curve;\n this.curve = curve;\n this.g = curve.g;\n this.g.precompute(curve.n.bitLength() + 1);\n\n this.pointClass = curve.point().constructor;\n this.encodingLength = Math.ceil(curve.n.bitLength() / 8);\n this.hash = hash.sha512;\n}\n\nmodule.exports = EDDSA;\n\n/**\n* @param {Array|String} message - message bytes\n* @param {Array|String|KeyPair} secret - secret bytes or a keypair\n* @returns {Signature} - signature\n*/\nEDDSA.prototype.sign = function sign(message, secret) {\n message = parseBytes(message);\n var key = this.keyFromSecret(secret);\n var r = this.hashInt(key.messagePrefix(), message);\n var R = this.g.mul(r);\n var Rencoded = this.encodePoint(R);\n var s_ = this.hashInt(Rencoded, key.pubBytes(), message)\n .mul(key.priv());\n var S = r.add(s_).umod(this.curve.n);\n return this.makeSignature({ R: R, S: S, Rencoded: Rencoded });\n};\n\n/**\n* @param {Array} message - message bytes\n* @param {Array|String|Signature} sig - sig bytes\n* @param {Array|String|Point|KeyPair} pub - public key\n* @returns {Boolean} - true if public key matches sig of message\n*/\nEDDSA.prototype.verify = function verify(message, sig, pub) {\n message = parseBytes(message);\n sig = this.makeSignature(sig);\n var key = this.keyFromPublic(pub);\n var h = this.hashInt(sig.Rencoded(), key.pubBytes(), message);\n var SG = this.g.mul(sig.S());\n var RplusAh = sig.R().add(key.pub().mul(h));\n return RplusAh.eq(SG);\n};\n\nEDDSA.prototype.hashInt = function hashInt() {\n var hash = this.hash();\n for (var i = 0; i < arguments.length; i++)\n hash.update(arguments[i]);\n return utils.intFromLE(hash.digest()).umod(this.curve.n);\n};\n\nEDDSA.prototype.keyPair = function keyPair(options) {\n return new KeyPair(this, options);\n};\n\nEDDSA.prototype.keyFromPublic = function keyFromPublic(pub) {\n return KeyPair.fromPublic(this, pub);\n};\n\nEDDSA.prototype.keyFromSecret = function keyFromSecret(secret) {\n return KeyPair.fromSecret(this, secret);\n};\n\nEDDSA.prototype.genKeyPair = function genKeyPair(options) {\n if (!options)\n options = {};\n\n // Instantiate Hmac_DRBG\n var drbg = new HmacDRBG({\n hash: this.hash,\n pers: options.pers,\n persEnc: options.persEnc || 'utf8',\n entropy: options.entropy || rand(this.hash.hmacStrength),\n entropyEnc: options.entropy && options.entropyEnc || 'utf8',\n nonce: this.curve.n.toArray()\n });\n\n return this.keyFromSecret(drbg.generate(32));\n};\n\nEDDSA.prototype.makeSignature = function makeSignature(sig) {\n if (sig instanceof Signature)\n return sig;\n return new Signature(this, sig);\n};\n\n/**\n* * https://tools.ietf.org/html/draft-josefsson-eddsa-ed25519-03#section-5.2\n*\n* EDDSA defines methods for encoding and decoding points and integers. These are\n* helper convenience methods, that pass along to utility functions implied\n* parameters.\n*\n*/\nEDDSA.prototype.encodePoint = function encodePoint(point) {\n var enc = point.getY().toArray('le', this.encodingLength);\n enc[this.encodingLength - 1] |= point.getX().isOdd() ? 0x80 : 0;\n return enc;\n};\n\nEDDSA.prototype.decodePoint = function decodePoint(bytes) {\n bytes = utils.parseBytes(bytes);\n\n var lastIx = bytes.length - 1;\n var normed = bytes.slice(0, lastIx).concat(bytes[lastIx] & ~0x80);\n var xIsOdd = (bytes[lastIx] & 0x80) !== 0;\n\n var y = utils.intFromLE(normed);\n return this.curve.pointFromY(y, xIsOdd);\n};\n\nEDDSA.prototype.encodeInt = function encodeInt(num) {\n return num.toArray('le', this.encodingLength);\n};\n\nEDDSA.prototype.decodeInt = function decodeInt(bytes) {\n return utils.intFromLE(bytes);\n};\n\nEDDSA.prototype.isPoint = function isPoint(val) {\n return val instanceof this.pointClass;\n};\n","'use strict';\n\nvar elliptic = exports;\n\nelliptic.utils = require('./elliptic/utils');\nelliptic.rand = require('brorand');\nelliptic.curve = require('./elliptic/curve');\nelliptic.curves = require('./elliptic/curves');\n\n// Protocols\nelliptic.ec = require('./elliptic/ec');\nelliptic.eddsa = require('./elliptic/eddsa');\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","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"],"names":["doneWritingPromise","Symbol","doneWritingResolve","doneWritingReject","readingIndex","ArrayStream","Array","constructor","super","this","Promise","resolve","reject","catch","isArrayStream","input","getReader","isArray","Writer","writer","getWriter","releaseLock","closed","call","stream","prototype","undefined","read","async","length","value","done","readToEnd","join","result","slice","clone","then","push","write","chunk","close","abort","reason","isNode","globalThis","process","versions","NodeReadableStream","isStream","ReadableStream","isPrototypeOf","streams.ReadableStream","isUint8Array","Uint8Array","concatUint8Array","arrays","totalLength","i","Error","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","size","_cancelling","_reading","emit","_destroy","doneReadingSet","WeakSet","externalBuffer","Reader","streams.isArrayStream","reader","_read","bind","_releaseLock","_cancel","streamType","streams.isStream","streams.nodeToWeb","doneReading","has","add","shift","readLine","returnVal","streams.concat","lineEndIndex","indexOf","concat","substr","unshift","readByte","byte","streams.slice","readBytes","bufferLength","bufferConcat","peekBytes","bytes","values","filter","toPonyfillReadable","toNativeReadable","WritableStream","TransformStream","loadStreamsPonyfill","ponyfill","adapter","all","createReadableStreamWrapper","toStream","toArrayStream","list","some","map","transform","transformWithCancel","transforms","prev","transformPair","readable","writable","pipe","preventClose","concatStream","concatArrayStream","target","preventAbort","preventCancel","ready","pipeTo","transformRaw","transformStream","backpressureChangePromiseResolve","outputController","pulled","highWaterMark","finish","output","data","result1","result2","fn","incomingTransformController","incoming","pipeDonePromise","outgoing","setTimeout","parse","returnValue","transformed","remainder","teed","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","detectBigInt","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","getBigInteger","default","getNodeCrypto","getNodeZlib","getNodeBuffer","Buffer","getHardwareConcurrency","navigator","hardwareConcurrency","cpus","isEmailAddress","test","canonicalizeEOL","carryOverCR","index","indices","normalized","nativeEOL","copyWithin","removeTrailingSpaces","split","line","wrapError","message","constructAllowedPackets","allowedClasses","PacketClass","tag","anyPromise","promises","exception","promise","selectUint8Array","cond","selectUint8","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","allowInsecureVerificationWithReformattedKeys","constantTimePKCS1Decryption","constantTimePKCS1DecryptionSupportedSymmetricAlgorithms","Set","minBytesForWebCrypto","ignoreUnsupportedPackets","ignoreMalformedPackets","additionalAllowedPackets","showVersion","showComment","versionString","commentString","maxUserIDLength","knownNotations","useIndutnyElliptic","rejectHashAlgorithms","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","static","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","enc","hi","lo","zero2","htonl","zero8","word","inherits","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","z","ch32","p32","maj32","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","nodeCryptoHashes","getHashes","nodeHash","shasum","createHash","hashjsHash","webCryptoHash","hashInstance","asmcryptoHash","hashFunctions","entree","state","substring","tail","md51","ripemd160","algo","getHashByteLength","AES_CFB","getCipher","algoName","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","blockLength","rightXORMut","zeroBlock","CMAC","cbc","padding2","ivLength","tagLength","two","OMAC","cmac","en","final","EAX","omac","ctr","adata","omacNonce","omacAdata","ciphered","ctTag","omacCiphered","getNonce","chunkIndex","ntz","S","xor","OCB","encipher","decipher","maxNtz","crypt","newMaxNtz","extendKeyVariables","paddedNonce","bottom","kTop","stretched","xorInput","$","cipherInput","cipherName","ciphers","mask_x","mask_$","constructKeyVariables","crypted","_AES_GCM_data_maxLength","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","require","randomBytes","exports","getRandomBytes","getRandomBigInteger","modulus","randomProbablePrime","thirty","adds","isProbablePrime","smallPrimes","every","divisionTest","fermat","rand","millerRabin","hash_headers","emeEncode","keyLength","mLength","PS","getPKCS1Padding","emeDecode","randomPayload","separatorNotFound","psLen","payload","isValidPadding","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","readSimpleLength","writeSimpleLength","writePartialLength","power","writeTag","tag_type","writeHeader","supportsStreaming","readPackets","callback","callbackReturned","peekedBytes","headerByte","packetLength","packetLengthType","packetSupportsStreaming","wasPartialLength","stream.ArrayStream","stream.TransformStream","lengthByte","nextPacket","UnsupportedError","params","captureStackTrace","UnparseablePacket","rawContent","webCurves","knownCurves","getCurves","nodeCurves","curves","keyType","node","web","payloadSize","sharedSize","Curve","oidOrName","webCryptoKey","namedCurve","jwkToRawPublic","webGenKeyPair","createECDH","generateKeys","getPublicKey","getPrivateKey","nodeGenKeyPair","genKeyPair","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","wrappedKey","aesKW.wrap","pkcs5.decode","aesKW.unwrap","xr","u1","u2","qSize","n150","rsa","publicParams","curveSize","publicKeyParams","privateKeyParams","ECDHSymmetricKey","KDFParams","checkSupportedCurve","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","Z_NO_FLUSH","Z_PARTIAL_FLUSH","Z_SYNC_FLUSH","Z_FULL_FLUSH","Z_FINISH","Z_BLOCK","Z_TREES","Z_OK","Z_STREAM_END","Z_NEED_DICT","Z_STREAM_ERROR","Z_DATA_ERROR","Z_BUF_ERROR","Z_DEFAULT_COMPRESSION","Z_FILTERED","Z_HUFFMAN_ONLY","Z_RLE","Z_FIXED","Z_BINARY","Z_TEXT","Z_UNKNOWN","Z_DEFLATED","STORED_BLOCK","STATIC_TREES","DYN_TREES","LENGTH_CODES","LITERALS","L_CODES","D_CODES","BL_CODES","HEAP_SIZE","MAX_BITS","Buf_size","MAX_BL_BITS","END_BLOCK","REP_3_6","REPZ_3_10","REPZ_11_138","extra_lbits","extra_dbits","extra_blbits","bl_order","static_ltree","static_dtree","_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","init_block","dyn_ltree","dyn_dtree","bl_tree","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","send_tree","static_init_done","_tr_init","tr_static_init","l_desc","d_desc","bl_desc","_tr_stored_block","stored_len","utils.arraySet","window","copy_block","_tr_align","bi_flush","_tr_flush_block","opt_lenb","static_lenb","max_blindex","level","strm","data_type","black_mask","detect_data_type","build_bl_tree","strategy","lcodes","dcodes","blcodes","rank","send_all_trees","_tr_tally","lit_bufsize","adler32","adler","crcTable","table","makeTable","crc32","MAX_MEM_LEVEL","MIN_MATCH","MIN_LOOKAHEAD","PRESET_DICT","INIT_STATE","EXTRA_STATE","NAME_STATE","COMMENT_STATE","HCRC_STATE","BUSY_STATE","FINISH_STATE","BS_NEED_MORE","BS_BLOCK_DONE","BS_FINISH_STARTED","BS_FINISH_DONE","OS_CODE","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","flush","hash_head","bflush","match_length","trees._tr_tally","max_lazy_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","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","BAD","TYPE","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","MAXBITS","ENOUGH_LENS","ENOUGH_DISTS","CODES","LENS","DISTS","lbase","lext","dbase","dext","inflate_table","lens","lens_index","codes","table_index","work","incr","low","sym","root","drop","used","huff","base_index","offs","here_bits","here_op","here_val","extra_index","HEAD","FLAGS","TIME","OS","EXLEN","EXTRA","COMMENT","HCRC","DICTID","DICT","TYPEDO","STORED","COPY_","COPY","TABLE","LENLENS","CODELENS","LEN_","LEN","LENEXT","DIST","DISTEXT","MATCH","LIT","CHECK","LENGTH","DONE","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","c.Z_OK","zlib_inflate.inflateGetHeader","zlib_inflate.inflateSetDictionary","allowBufError","c.Z_FINISH","c.Z_NO_FLUSH","strings.binstring2buf","zlib_inflate.inflate","c.Z_NEED_DICT","c.Z_BUF_ERROR","c.Z_STREAM_END","c.Z_SYNC_FLUSH","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","filename_length","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","critical","encodedName","readSubPacket","mypos","seconds","trusted","subpacketLength","toSign","writeForHash","calculateTrailer","isMessageSignature","normDate","getExpirationTime","toUpperCase","isExpired","OnePassSignaturePacket","correspondingSig","newPacketFromTag","allowedPackets","packetType","PacketList","packets","parsed","fromStream","throwUnsupportedError","throwMalformedError","unparsedPacket","packetbytes","minLength","powerOf2","LN2","filterByTag","tags","filtered","handle","findPacket","find","indexOfTag","tagIndex","that","CompressedDataPacket","compressed","decompress","compress","compressionName","decompressionFn","decompress_fns","fromBinary","compressionFn","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","cipherAlgorithm","aeadAlgorithm","chunkSizeByte","getAEADMode","modeInstance","tagLengthIfDecrypting","tagLengthIfEncrypting","adataBuffer","adataArray","adataTagArray","adataView","chunkIndexArray","latestPromise","cryptedBytes","queuedBytes","finalChunk","cryptedPromise","setInt32","desiredSize","PublicKeyEncryptedSessionKeyPacket","publicKeyID","sessionKey","parseEncSessionKeyParams","publicKeyEncrypt","randomSessionKey","publicKeyDecrypt","symmetricAlgoByte","computedChecksum","isValidChecksum","isValidPayload","S2K","salt","getCount","passphrase","numBytes","rlength","prefixlen","datalen","SymEncryptedSessionKeyPacket","sessionKeyEncryptionAlgorithm","produceKey","encryptionKey","generateSessionKey","associatedData","toEncrypt","PublicKeyPacket","expirationTimeV3","secretKeyPacket","keyPacket","parsePublicKeyParams","computeFingerprintAndKeyID","writePublicKey","isDecrypted","getCreationTime","computeFingerprint","getFingerprint","hasSameFingerprintAs","other","getAlgorithmInfo","modulo","readPublicKey","SymmetricallyEncryptedDataPacket","FRE","PublicSubkeyPacket","secretSubkeyPacket","UserAttributePacket","attributes","usrAttr","attr","SecretKeyPacket","keyMaterial","isEncrypted","s2kUsage","parsePrivateKeyParams","optionalFieldsArr","isDummy","makeDummy","clearPrivateParams","produceEncryptionKey","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","components","emailAddresses","otherUserID","SecretSubkeyPacket","Signature","packetlist","getSigningKeyIDs","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","senderAlgoSupport","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","signingKeys","isPrivate","signingKey","getSigningKey","certificate","verificationKeys","issuerKeys","getKeys","isRevoked","certifications","certification","valid","verifyCertificate","sourceUser","srcSelfSig","srcRevSig","flag","string","Subkey","subkeyPacket","bindingSignatures","helper.isDataRevoked","bindingSignature","helper.getLatestValidSignature","helper.isDataExpired","keyExpiry","helper.getKeyExpirationTime","sigExpiry","helper.mergeSignatures","srcBindSig","helper.createSignaturePacket","allowedRevocationPackets","mainKeyPacketTags","keyPacketTags","privateSubkey","Key","packetListToStructure","disallowedPackets","primaryKeyID","ignoreUntil","users","subkeys","directSignatures","clonePrivateParams","getSubkeys","getKeyIDs","getUserIDs","verifyPrimaryKey","sort","helper.isValidSigningKeyPacket","helper.checkKeyRequirements","helper.isValidEncryptionKeyPacket","directSignature","primaryKeyExpiry","selfSigKeyExpiry","selfSigExpiry","directSigKeyExpiry","cert","sourceKey","destSubkey","srcSubkey","updatedKey","usersToUpdate","dstUser","srcUser","userToUpdate","newUser","subkeysToUpdate","dstSubkey","subkeyToUpdate","newSubkey","revocationCertificate","privateKeys","userSign","certify","verifyAllCertifications","results","PublicKey","toPublic","PrivateKey","keyPackets","pubKeyPacket","fromSecretKeyPacket","pubSubkeyPacket","fromSecretSubkeyPacket","helper.isValidDecryptionKeyPacket","allDummies","defaultOptions","helper.sanitizeKeyOptions","helper.generateSecretSubkey","helper.createBindingSignature","packetList","allowedKeyPackets","createKey","wrapKeyObject","secretSubkeyPackets","subkeyPassphrase","createPreferredAlgos","algos","preferredAlgo","userIDPacket","fromObject","helper.getPreferredHashAlgo","subkeyOptions","allowedMessagePackets","allowedSymSessionKeyPackets","allowedDetachedSignaturePackets","Message","getEncryptionKeyIDs","keyIDs","unwrapCompressed","onePassSigList","decryptionKeys","passwords","sessionKeys","sessionKeyObjects","decryptSessionKeys","symEncryptedPacketlist","symEncryptedPacket","decryptedPromise","algorithmName","stream.cancel","resultMsg","decryptedSessionKeyPackets","skeskPackets","password","skeskPacket","pkeskPackets","pkeskPacket","decryptionKey","decryptionKeyPackets","getDecryptionKeys","decryptionKeyPacket","serialisedPKESK","pkeskPacketCopy","seen","item","getLiteralData","encryptionKeys","aeadAlgorithmName","supported","isAEADSupported","wildcard","encryptionKeyIDs","sessionKeyData","encryptSessionKey","getEncryptionKey","pkESKeyPacket","testDecrypt","accumulator","currentValue","encryptPassword","symEncryptedSessionKeyPacket","pwd","signingKeyIDs","literalDataPacket","existingSigPacketlist","onePassSig","signingKeyID","onePassSignatureList","createSignaturePackets","literalDataList","signatureList","correspondingSigResolve","correspondingSigReject","createVerificationObjects","verifyDetached","detachedSignature","unverifiedSigningKey","signaturePacketPromise","verifiedSig","createVerificationObject","CleartextMessage","newSignature","hashes","ar","checkMessage","checkCleartextOrMessage","checkOutputMessageFormat","defaultConfigPropsCount","checkConfig","inputConfigProps","inputProp","convertStream","streaming","encoding","setEncoding","stream.toNativeReadable","linkStreams","formatObject","object","SymbolPolyfill","iterator","description","noop","globals","typeIsObject","rethrowAssertionErrorRejection","originalPromise","originalPromiseThen","originalPromiseResolve","originalPromiseReject","newPromise","executor","promiseResolvedWith","promiseRejectedWith","PerformPromiseThen","onFulfilled","onRejected","uponPromise","uponFulfillment","uponRejection","transformPromiseWith","fulfillmentHandler","rejectionHandler","setPromiseIsHandledToTrue","queueMicrotask","globalQueueMicrotask","resolvedPromise","reflectCall","F","Function","promiseCall","SimpleQueue","_cursor","_size","_front","_elements","_next","_back","oldBack","newBack","QUEUE_MAX_ARRAY_SIZE","oldFront","newFront","oldCursor","newCursor","elements","peek","front","ReadableStreamReaderGenericInitialize","_ownerReadableStream","_state","defaultReaderClosedPromiseInitialize","defaultReaderClosedPromiseResolve","defaultReaderClosedPromiseInitializeAsResolved","defaultReaderClosedPromiseInitializeAsRejected","_storedError","ReadableStreamReaderGenericCancel","ReadableStreamCancel","ReadableStreamReaderGenericRelease","defaultReaderClosedPromiseReject","defaultReaderClosedPromiseResetToRejected","readerLockException","_closedPromise","_closedPromise_resolve","_closedPromise_reject","AbortSteps","ErrorSteps","CancelSteps","PullSteps","NumberIsFinite","isFinite","MathTrunc","trunc","assertDictionary","context","assertFunction","assertObject","assertRequiredArgument","position","assertRequiredField","field","convertUnrestrictedDouble","censorNegativeZero","convertUnsignedLongLongWithEnforceRange","upperBound","integerPart","assertReadableStream","IsReadableStream","AcquireReadableStreamDefaultReader","ReadableStreamDefaultReader","ReadableStreamAddReadRequest","readRequest","_readRequests","ReadableStreamFulfillReadRequest","_closeSteps","_chunkSteps","ReadableStreamGetNumReadRequests","ReadableStreamHasDefaultReader","IsReadableStreamDefaultReader","IsReadableStreamLocked","defaultReaderBrandCheckException","resolvePromise","rejectPromise","ReadableStreamDefaultReaderRead","_errorSteps","_disturbed","_readableStreamController","AsyncIteratorPrototype","defineProperties","toStringTag","asyncIterator","ReadableStreamAsyncIteratorImpl","_ongoingPromise","_isFinished","_preventCancel","nextSteps","_nextSteps","return","returnSteps","_returnSteps","ReadableStreamAsyncIteratorPrototype","IsReadableStreamAsyncIterator","_asyncIteratorImpl","streamAsyncIteratorBrandCheckException","setPrototypeOf","NumberIsNaN","isNaN","IsFiniteNonNegativeNumber","IsNonNegativeNumber","DequeueValue","container","pair","_queue","_queueTotalSize","EnqueueValueWithSize","ResetQueue","CreateArrayFromList","ReadableStreamBYOBRequest","IsReadableStreamBYOBRequest","byobRequestBrandCheckException","_view","respond","bytesWritten","_associatedReadableByteStreamController","ReadableByteStreamControllerRespondInternal","ReadableByteStreamControllerRespond","respondWithNewView","isView","firstDescriptor","_pendingPullIntos","bytesFilled","ReadableByteStreamControllerRespondWithNewView","ReadableByteStreamController","byobRequest","IsReadableByteStreamController","byteStreamControllerBrandCheckException","_byobRequest","request","SetUpReadableStreamBYOBRequest","ReadableByteStreamControllerGetDesiredSize","_closeRequested","_controlledReadableByteStream","ReadableByteStreamControllerError","ReadableByteStreamControllerClearAlgorithms","ReadableStreamClose","ReadableByteStreamControllerClose","transferredBuffer","ReadableByteStreamControllerEnqueueChunkToQueue","ReadableStreamHasBYOBReader","ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue","ReadableByteStreamControllerCallPullIfNeeded","ReadableByteStreamControllerEnqueue","_cancelAlgorithm","entry","ReadableByteStreamControllerHandleQueueDrain","autoAllocateChunkSize","_autoAllocateChunkSize","bufferE","pullIntoDescriptor","elementSize","viewConstructor","readerType","shouldPull","_started","ReadableStreamGetNumReadIntoRequests","ReadableByteStreamControllerShouldCallPull","_pulling","_pullAgain","_pullAlgorithm","ReadableByteStreamControllerCommitPullIntoDescriptor","filledView","ReadableByteStreamControllerConvertPullIntoDescriptor","readIntoRequest","_readIntoRequests","ReadableStreamFulfillReadIntoRequest","ReadableByteStreamControllerFillPullIntoDescriptorFromQueue","currentAlignedBytes","maxBytesToCopy","maxBytesFilled","maxAlignedBytes","totalBytesToCopyRemaining","queue","headOfQueue","bytesToCopy","destStart","destOffset","srcOffset","ReadableByteStreamControllerFillHeadPullIntoDescriptor","ReadableByteStreamControllerInvalidateBYOBRequest","ReadableByteStreamControllerShiftPendingPullInto","ReadableByteStreamControllerRespondInClosedState","remainderSize","ReadableByteStreamControllerRespondInReadableState","ReadableByteStreamControllerClearPendingPullIntos","ReadableStreamError","_strategyHWM","SetUpReadableByteStreamControllerFromUnderlyingSource","underlyingByteSource","startAlgorithm","pullAlgorithm","cancelAlgorithm","SetUpReadableByteStreamController","ReadableStreamAddReadIntoRequest","IsReadableStreamBYOBReader","ReadableStreamBYOBReader","byobReaderBrandCheckException","BYTES_PER_ELEMENT","emptyView","ReadableByteStreamControllerPullInto","ReadableStreamBYOBReaderRead","ExtractHighWaterMark","defaultHWM","ExtractSizeAlgorithm","convertQueuingStrategy","convertQueuingStrategySize","convertUnderlyingSinkAbortCallback","original","convertUnderlyingSinkCloseCallback","convertUnderlyingSinkStartCallback","convertUnderlyingSinkWriteCallback","assertWritableStream","IsWritableStream","rawUnderlyingSink","rawStrategy","underlyingSink","convertUnderlyingSink","InitializeWritableStream","sizeAlgorithm","WritableStreamDefaultController","writeAlgorithm","closeAlgorithm","abortAlgorithm","SetUpWritableStreamDefaultController","SetUpWritableStreamDefaultControllerFromUnderlyingSink","locked","streamBrandCheckException$2","IsWritableStreamLocked","WritableStreamAbort","WritableStreamCloseQueuedOrInFlight","WritableStreamClose","AcquireWritableStreamDefaultWriter","WritableStreamDefaultWriter","_writer","_writableStreamController","_writeRequests","_inFlightWriteRequest","_closeRequest","_inFlightCloseRequest","_pendingAbortRequest","_backpressure","_promise","wasAlreadyErroring","_resolve","_reject","_reason","_wasAlreadyErroring","WritableStreamStartErroring","closeRequest","defaultWriterReadyPromiseResolve","closeSentinel","WritableStreamDefaultControllerAdvanceQueueIfNeeded","WritableStreamDealWithRejection","WritableStreamFinishErroring","WritableStreamDefaultWriterEnsureReadyPromiseRejected","WritableStreamHasOperationMarkedInFlight","storedError","writeRequest","WritableStreamRejectCloseAndClosedPromiseIfNeeded","abortRequest","defaultWriterClosedPromiseReject","WritableStreamUpdateBackpressure","backpressure","defaultWriterReadyPromiseInitialize","defaultWriterReadyPromiseReset","_ownerWritableStream","defaultWriterReadyPromiseInitializeAsResolved","defaultWriterClosedPromiseInitialize","defaultWriterReadyPromiseInitializeAsRejected","defaultWriterClosedPromiseResolve","defaultWriterClosedPromiseInitializeAsRejected","IsWritableStreamDefaultWriter","defaultWriterBrandCheckException","defaultWriterLockException","WritableStreamDefaultControllerGetDesiredSize","WritableStreamDefaultWriterGetDesiredSize","_readyPromise","WritableStreamDefaultWriterAbort","WritableStreamDefaultWriterClose","WritableStreamDefaultWriterRelease","WritableStreamDefaultWriterWrite","WritableStreamDefaultWriterEnsureClosedPromiseRejected","_closedPromiseState","defaultWriterClosedPromiseResetToRejected","_readyPromiseState","defaultWriterReadyPromiseReject","defaultWriterReadyPromiseResetToRejected","releasedError","_strategySizeAlgorithm","chunkSizeE","WritableStreamDefaultControllerErrorIfNeeded","WritableStreamDefaultControllerGetChunkSize","WritableStreamAddWriteRequest","enqueueE","_controlledWritableStream","WritableStreamDefaultControllerGetBackpressure","WritableStreamDefaultControllerWrite","IsWritableStreamDefaultController","WritableStreamDefaultControllerError","_abortAlgorithm","WritableStreamDefaultControllerClearAlgorithms","_writeAlgorithm","_closeAlgorithm","WritableStreamMarkCloseRequestInFlight","sinkClosePromise","WritableStreamFinishInFlightClose","WritableStreamFinishInFlightCloseWithError","WritableStreamDefaultControllerProcessClose","WritableStreamMarkFirstWriteRequestInFlight","sinkWritePromise","WritableStreamFinishInFlightWrite","WritableStreamFinishInFlightWriteWithError","WritableStreamDefaultControllerProcessWrite","_readyPromise_resolve","_readyPromise_reject","NativeDOMException","DOMException","DOMException$1","_a","isDOMExceptionConstructor","createDOMExceptionPolyfill","ReadableStreamPipeTo","signal","shuttingDown","currentWrite","actions","shutdownWithAction","action","aborted","addEventListener","isOrBecomesErrored","shutdown","isOrBecomesClosed","WritableStreamDefaultWriterCloseWithErrorPropagation","destClosed","waitForWritesToFinish","oldCurrentWrite","originalIsError","originalError","doTheRest","newError","isError","removeEventListener","resolveLoop","rejectLoop","resolveRead","rejectRead","ReadableStreamDefaultController","IsReadableStreamDefaultController","defaultControllerBrandCheckException$1","ReadableStreamDefaultControllerGetDesiredSize","ReadableStreamDefaultControllerCanCloseOrEnqueue","ReadableStreamDefaultControllerClose","ReadableStreamDefaultControllerEnqueue","ReadableStreamDefaultControllerError","ReadableStreamDefaultControllerClearAlgorithms","_controlledReadableStream","ReadableStreamDefaultControllerCallPullIfNeeded","ReadableStreamDefaultControllerShouldCallPull","SetUpReadableStreamDefaultController","convertUnderlyingSourceCancelCallback","convertUnderlyingSourcePullCallback","convertUnderlyingSourceStartCallback","convertReadableStreamType","convertReadableStreamReaderMode","convertPipeOptions","isAbortSignal","assertAbortSignal","rawUnderlyingSource","underlyingSource","convertUnderlyingDefaultOrByteSource","InitializeReadableStream","SetUpReadableStreamDefaultControllerFromUnderlyingSource","streamBrandCheckException$1","rawOptions","convertReaderOptions","AcquireReadableStreamBYOBReader","pipeThrough","rawTransform","convertReadableWritablePair","destination","branches","cloneForBranch2","reason1","reason2","branch1","branch2","resolveCancelPromise","reading","canceled1","canceled2","cancelPromise","value1","value2","CreateReadableStream","compositeReason","cancelResult","ReadableStreamTee","impl","AcquireReadableStreamAsyncIterator","convertIteratorOptions","convertQueuingStrategyInit","byteLengthSizeFunction","ByteLengthQueuingStrategy","_byteLengthQueuingStrategyHighWaterMark","IsByteLengthQueuingStrategy","byteLengthBrandCheckException","countSizeFunction","CountQueuingStrategy","_countQueuingStrategyHighWaterMark","IsCountQueuingStrategy","countBrandCheckException","convertTransformerFlushCallback","convertTransformerStartCallback","convertTransformerTransformCallback","rawTransformer","rawWritableStrategy","rawReadableStrategy","writableStrategy","readableStrategy","transformer","readableType","writableType","convertTransformer","readableHighWaterMark","readableSizeAlgorithm","writableHighWaterMark","writableSizeAlgorithm","startPromise_resolve","startPromise","_transformStreamController","_backpressureChangePromise","_writable","TransformStreamDefaultControllerPerformTransform","TransformStreamDefaultSinkWriteAlgorithm","TransformStreamError","TransformStreamDefaultSinkAbortAlgorithm","_readable","flushPromise","_flushAlgorithm","TransformStreamDefaultControllerClearAlgorithms","TransformStreamDefaultSinkCloseAlgorithm","TransformStreamSetBackpressure","TransformStreamDefaultSourcePullAlgorithm","TransformStreamErrorWritableAndUnblockWrite","CreateWritableStream","_backpressureChangePromise_resolve","InitializeTransformStream","TransformStreamDefaultController","transformAlgorithm","TransformStreamDefaultControllerEnqueue","transformResultE","flushAlgorithm","_controlledTransformStream","_transformAlgorithm","SetUpTransformStreamDefaultController","SetUpTransformStreamDefaultControllerFromTransformer","IsTransformStream","streamBrandCheckException","IsTransformStreamDefaultController","defaultControllerBrandCheckException","readableController","TransformStreamDefaultControllerTerminate","ReadableStreamDefaultControllerHasBackpressure","extendStatics","__proto__","__extends","isStreamConstructor","startCalled","isReadableStream","isWritableStream","isTransformStream","supportsByobReader","createWrappingReadableSource","parseReadableType","WrappingReadableByteStreamSource","WrappingReadableStreamDefaultSource","typeString","AbstractWrappingReadableStreamSource","underlyingStream","_underlyingReader","_readerMode","_pendingRead","_underlyingStream","_attachDefaultReader","_detachReader","_attachReader","_this","_finishPendingRead","_pullWithDefaultReader","_tryClose","_setPendingRead","readPromise","pendingRead","finishRead","afterRead","_super","supportsByob","_supportsByob","_attachByobReader","_pullWithByobRequest","to","fromArray","createWrappingWritableSink","WrappingWritableStreamSink","underlyingWriter","_pendingWrite","_underlyingWriter","_errorPromise","_errorPromiseReject","_finishErroring","_startErroring","race","_setPendingWrite","_finishPendingWrite","writePromise","pendingWrite","finishWrite","afterWrite","createWrappingTransformer","WrappingTransformStreamTransformer","_onRead","_onError","_flushReject","_onTerminate","_flushResolve","_flushPromise","readerClosed","isReadableStreamConstructor","byteSourceSupported","supportsByteSource","isTransformStreamConstructor","isWritableStreamConstructor","sink","isBN","negative","words","red","_init","wordSize","parseHex","parseBase","cmp","_initNumber","_initArray","_parseHex","_parseBase","strip","limbLen","limbPow","imuln","_iaddn","_expand","_normSign","inspect","zeros","groupSizes","groupBases","smallMulTo","out","ncarry","rword","maxJ","groupSize","groupBase","modn","idivn","toJSON","toBuffer","ArrayType","reqLength","littleEndian","andln","iushrn","_countBits","clz32","_zeroBits","zeroBits","toTwos","width","inotn","iaddn","fromTwos","testn","notn","ineg","isNeg","neg","iuor","ior","uor","iuand","iand","uand","iuxor","ixor","uxor","bytesNeeded","bitsLeft","setn","bit","wbit","comb10MulTo","mid","a0","al0","ah0","a1","al1","ah1","a2","al2","ah2","a3","al3","ah3","a4","al4","ah4","a5","al5","ah5","a6","al6","ah6","a7","al7","ah7","a8","al8","ah8","a9","al9","ah9","bl0","bh0","bl1","bh1","bl2","bh2","bl3","bh3","bl4","bh4","bl5","bh5","bl6","bh6","bl7","bh7","bl8","bh8","bl9","bh9","jumboMulTo","FFTM","mulp","mulTo","hncarry","bigMulTo","makeRBT","N","revBin","rb","rbt","rws","iws","rtws","itws","rtwdf","cos","PI","itwdf","sin","rtwdf_","itwdf_","re","ie","ro","io","guessLen13b","odd","conjugate","normalize13b","ws","convert13b","stub","ph","rwst","iwst","nrws","nrwst","niwst","rmws","mulf","muln","sqr","isqr","toBitArray","iushln","carryMask","newCarry","ishln","hint","extended","maskedWords","ishrn","shln","ushln","shrn","ushrn","imaskn","maskn","isubn","addn","iabs","_ishlnsubmul","_wordDiv","bhi","diff","qj","div","divmod","positive","divn","umod","divRound","dm","r2","acc","egcd","yp","xp","im","isOdd","jm","_invmp","delta","cmpn","invm","bincn","ucmp","gtn","gten","ltn","lten","eqn","Red","toRed","ctx","convertTo","_forceRed","fromRed","convertFrom","forceRed","redAdd","redIAdd","redSub","redISub","redShl","shl","redMul","_verify2","redIMul","redSqr","_verify1","redISqr","redSqrt","sqrt","redInvm","redNeg","redPow","primes","k256","p224","p192","p25519","MPrime","_tmp","K256","P224","P192","P25519","prime","_prime","Mont","rinv","minv","ireduce","imulK","outLen","mod3","nOne","lpow","inv","wnd","currentLen","mont","nred","minAssert","minUtils","getNAF","naf","getJSF","jsf","d1","d2","m8","m14","m24","cachedProperty","computer","parseBytes","intFromLE","Rand","_rand","getByte","BaseCurve","conf","pointFromJSON","gRed","_wnafT1","_wnafT2","_wnafT3","_wnafT4","adjustCount","redN","_maxwellTrick","BasePoint","precomputed","point","_fixedNafMul","doubles","_getDoubles","step","repr","nafW","jpoint","mixedAdd","points","toP","_wnafMul","nafPoints","_getNAFPoints","dblp","_wnafMulAdd","defW","coeffs","jacobianResult","wndWidth","comb","toJ","ja","jb","decodePoint","pointFromX","encodeCompressed","_encode","compact","getX","getY","precompute","beta","_getBeta","_hasDoubles","dbl","ShortCurve","Base","tinv","zeroA","threeA","endo","_getEndomorphism","_endoWnafT1","_endoWnafT2","Point","isRed","inf","JPoint","zOne","MontCurve","i4","a24","lambda","betas","_getEndoRoots","lambdas","basis","vec","_getEndoBasis","ntinv","prevR","aprxSqrt","len1","_endoSplit","v1","v2","ax","rhs","_endoWnafMulAdd","npoints","ncoeffs","fromJSON","pre","endoMul","JSON","obj2point","isInfinity","nx","ny","ys1","dyinv","mulAdd","jmulAdd","_precompute","negate","zinv","zinv2","ay","pz2","nz","jx","jy","jz","jz4","jyd","jx2","jyd2","jyd4","dny","_zeroDbl","_threeDbl","_dbl","yyyy","yyyy8","c8","gamma","alpha","beta4","beta8","ggamma8","jy2","jxd4","jyd8","trpl","zz","mm","ee","yyu4","kbase","pz3","eqXToP","zs","xc","normalize","diffAdd","da","cb","jumlAdd","EdwardsCurve","twisted","mOneA","oneC","_mulA","_mulC","lhs","pointFromY","_extDbl","nt","_projDbl","_extAdd","_projAdd","require$$0","short","require$$1","require$$2","edwards","require$$3","ft_1","sha1_K","SHA1","require$$4","Hmac","inner","outer","sha","hmac","PresetCurve","defineCurve","cofactor","HmacDRBG","predResist","minEntropy","_reseed","reseedInterval","entropyEnc","nonceEnc","pers","persEnc","_hmac","kmac","reseed","addEnc","KeyPair","_importPrivate","privEnc","_importPublic","pubEnc","fromPublic","fromPrivate","_importDER","recoveryParam","Position","place","getLength","initial","octetLen","rmPadding","constructLength","octets","slen","toDER","backHalf","EC","nh","drbg","ns2","_truncateToN","truncOnly","truncateMsg","bkey","ns1","iter","kp","kpX","canonical","_verify","sinv","recoverPubKey","isYOdd","isSecondKey","rInv","getKeyRecoveryParam","Qprime","_secret","isPoint","_pub","_pubBytes","fromSecret","encodePoint","lastIx","encodingLength","decodeInt","privBytes","getSecret","pubBytes","_R","_S","_Rencoded","Rencoded","_Sencoded","Sencoded","encodeInt","toBytes","EDDSA","pointClass","keyFromSecret","hashInt","messagePrefix","s_","makeSignature","SG","normed","xIsOdd","require$$5","rest","unknownOptions","stream.loadStreamsPonyfill","stream.toStream","literalDataPacketlist","expectSigned","publicKeys","clonedPrivateKey","passphrases","signingUserIDs","encryptionUserIDs","signatureNotations","checkBinary","checkString","helper.generateSecretKey","getRevocationCertificate","cleartextMessage","checkHashAlgos","hashAlgos","oneHeader","armoredKey","binaryKey","armoredKeys","binaryKeys","keyIndex","newKey","armoredMessage","binaryMessage","oneKeyList","armoredSignature","binarySignature","reformattedKey","sanitize","reformat","revokedKey","applyRevocationCertificate","revoke","signDetached"],"mappings":";kJAAMA,EAAqBC,OAAO,sBAC5BC,EAAqBD,OAAO,sBAC5BE,EAAoBF,OAAO,qBAE3BG,EAAeH,OAAO,gBAE5B,MAAMI,UAAoBC,MACxBC,cACEC,QACAC,KAAKT,GAAsB,IAAIU,SAAQ,CAACC,EAASC,KAC/CH,KAAKP,GAAsBS,EAC3BF,KAAKN,GAAqBS,CAAM,IAElCH,KAAKT,GAAoBa,OAAM,UAuCnC,SA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A,oEAEF,CACE,mEACA,oEAEF,CACE,mEACA,kEAEF,CACE,mEACA,oEAEF,CACE,mEACA,oEAEF,CACE,mEACA,oEAEF,CACE,mEACA,oEAEF,CACE,kEACA,oEAEF,CACE,mEACA,oEAEF,CACE,mEACA,oEAEF,CACE,mEACA,oEAEF,CACE,mEACA,oEAEF,CACE,mEACA,oEAEF,CACE,mEACA,oEAEF,CACE,mEACA,oEAEF,CACE,mEACA,oEAEF,CACE,mEACA,oEAEF,CACE,mEACA,oEAEF,CACE,mEACA,oEAEF,CACE,mEACA,oEAEF,CACE,mEACA,oEAEF,CACE,mEACA,oEAEF,CACE,mEACA,oEAEF,CACE,mEACA,oEAEF,CACE,mEACA,mEAEF,CACE,mEACA,oEAEF,CACE,kEACA,oEAEF,CACE,mEACA,oEAEF,CACE,mEACA,sEAINrC,IAAK,CACHP,IAAK,EACL4C,OAAQ,CACN,CACE,mEACA,oEAEF,CACE,mEACA,oEAEF,CACE,mEACA,oEAEF,CACE,mEACA,oEAEF,CACE,mEACA,oEAEF,CACE,mEACA,mEAEF,CACE,mEACA,oEAEF,CACE,mEACA,oEAEF,CACE,mEACA,oEAEF,CACE,mEACA,oEAEF,CACE,mEACA,mEAEF,CACE,mEACA,oEAEF,CACE,mEACA,oEAEF,CACE,mEACA,oEAEF,CACE,mEACA,oEAEF,CACE,mEACA,oEAEF,CACE,mEACA,mEAEF,CACE,mEACA,oEAEF,CACE,mEACA,oEAEF,CACE,mEACA,mEAEF,CACE,mEACA,oEAEF,CACE,kEACA,oEAEF,CACE,mEACA,oEAEF,CACE,mEACA,oEAEF,CACE,mEACA,oEAEF,CACE,mEACA,oEAEF,CACE,mEACA,oEAEF,CACE,mEACA,oEAEF,CACE,mEACA,mEAEF,CACE,mEACA,mEAEF,CACE,mEACA,oEAEF,CACE,mEACA,oEAEF,CACE,mEACA,oEAEF,CACE,mEACA,oEAEF,CACE,mEACA,oEAEF,CACE,mEACA,oEAEF,CACE,mEACA,oEAEF,CACE,mEACA,oEAEF,CACE,mEACA,oEAEF,CACE,mEACA,oEAEF,CACE,mEACA,oEAEF,CACE,mEACA,oEAEF,CACE,mEACA,oEAEF,CACE,mEACA,oEAEF,CACE,mEACA,oEAEF,CACE,mEACA,oEAEF,CACE,mEACA,oEAEF,CACE,mEACA,oEAEF,CACE,mEACA,mEAEF,CACE,mEACA,oEAEF,CACE,mEACA,mEAEF,CACE,mEACA,oEAEF,CACE,mEACA,oEAEF,CACE,mEACA,oEAEF,CACE,mEACA,oEAEF,CACE,mEACA,oEAEF,CACE,mEACA,oEAEF,CACE,mEACA,oEAEF,CACE,kEACA,oEAEF,CACE,mEACA,oEAEF,CACE,mEACA,oEAEF,CACE,mEACA,mEAEF,CACE,mEACA,mEAEF,CACE,mEACA,oEAEF,CACE,mEACA,oEAEF,CACE,kEACA,oEAEF,CACE,mEACA,oEAEF,CACE,mEACA,mEAEF,CACE,mEACA,oEAEF,CACE,mEACA,mEAEF,CACE,mEACA,oEAEF,CACE,kEACA,oEAEF,CACE,mEACA,oEAEF,CACE,mEACA,oEAEF,CACE,mEACA,oEAEF,CACE,iEACA,oEAEF,CACE,mEACA,oEAEF,CACE,mEACA,oEAEF,CACE,mEACA,oEAEF,CACE,mEACA,oEAEF,CACE,mEACA,oEAEF,CACE,kEACA,oEAEF,CACE,mEACA,mEAEF,CACE,mEACA,oEAEF,CACE,mEACA,oEAEF,CACE,mEACA,oEAEF,CACE,mEACA,oEAEF,CACE,mEACA,oEAEF,CACE,mEACA,oEAEF,CACE,mEACA,oEAEF,CACE,mEACA,oEAEF,CACE,mEACA,oEAEF,CACE,mEACA,oEAEF,CACE,mEACA,oEAEF,CACE,mEACA,oEAEF,CACE,mEACA,oEAEF,CACE,mEACA,oEAEF,CACE,mEACA,oEAEF,CACE,mEACA,oEAEF,CACE,mEACA,oEAEF,CACE,mEACA,oEAEF,CACE,mEACA,mEAEF,CACE,mEACA,oEAEF,CACE,mEACA,oEAEF,CACE,mEACA,mEAEF,CACE,mEACA,oEAE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