diff --git a/bower.json b/bower.json index 867d8ee3e..607073da4 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "openpgp", - "version": "4.6.0", + "version": "4.6.1", "license": "LGPL-3.0+", "homepage": "https://openpgpjs.org/", "authors": [ diff --git a/dist/compat/openpgp.js b/dist/compat/openpgp.js index 2ba175546..f234d5b33 100644 --- a/dist/compat/openpgp.js +++ b/dist/compat/openpgp.js @@ -12602,8 +12602,7 @@ elliptic.eddsa = _dereq_('./elliptic/eddsa'); 'use strict'; var BN = _dereq_('bn.js'); -var elliptic = _dereq_('../../elliptic'); -var utils = elliptic.utils; +var utils = _dereq_('../utils'); var getNAF = utils.getNAF; var getJSF = utils.getJSF; var assert = utils.assert; @@ -12975,16 +12974,15 @@ BasePoint.prototype.dblp = function dblp(k) { return r; }; -},{"../../elliptic":287,"bn.js":44}],289:[function(_dereq_,module,exports){ +},{"../utils":301,"bn.js":44}],289:[function(_dereq_,module,exports){ 'use strict'; -var curve = _dereq_('../curve'); -var elliptic = _dereq_('../../elliptic'); +var utils = _dereq_('../utils'); var BN = _dereq_('bn.js'); var inherits = _dereq_('inherits'); -var Base = curve.base; +var Base = _dereq_('./base'); -var assert = elliptic.utils.assert; +var assert = utils.assert; function EdwardsCurve(conf) { // NOTE: Important as we are creating point in Base.call() @@ -13410,7 +13408,7 @@ Point.prototype.eqXToP = function eqXToP(x) { Point.prototype.toP = Point.prototype.normalize; Point.prototype.mixedAdd = Point.prototype.add; -},{"../../elliptic":287,"../curve":290,"bn.js":44,"inherits":316}],290:[function(_dereq_,module,exports){ +},{"../utils":301,"./base":288,"bn.js":44,"inherits":316}],290:[function(_dereq_,module,exports){ 'use strict'; var curve = exports; @@ -13423,13 +13421,11 @@ curve.edwards = _dereq_('./edwards'); },{"./base":288,"./edwards":289,"./mont":291,"./short":292}],291:[function(_dereq_,module,exports){ 'use strict'; -var curve = _dereq_('../curve'); var BN = _dereq_('bn.js'); var inherits = _dereq_('inherits'); -var Base = curve.base; +var Base = _dereq_('./base'); -var elliptic = _dereq_('../../elliptic'); -var utils = elliptic.utils; +var utils = _dereq_('../utils'); function MontCurve(conf) { Base.call(this, 'mont', conf); @@ -13623,16 +13619,15 @@ Point.prototype.getX = function getX() { return this.x.fromRed(); }; -},{"../../elliptic":287,"../curve":290,"bn.js":44,"inherits":316}],292:[function(_dereq_,module,exports){ +},{"../utils":301,"./base":288,"bn.js":44,"inherits":316}],292:[function(_dereq_,module,exports){ 'use strict'; -var curve = _dereq_('../curve'); -var elliptic = _dereq_('../../elliptic'); +var utils = _dereq_('../utils'); var BN = _dereq_('bn.js'); var inherits = _dereq_('inherits'); -var Base = curve.base; +var Base = _dereq_('./base'); -var assert = elliptic.utils.assert; +var assert = utils.assert; function ShortCurve(conf) { Base.call(this, 'short', conf); @@ -14562,23 +14557,24 @@ JPoint.prototype.isInfinity = function isInfinity() { return this.z.cmpn(0) === 0; }; -},{"../../elliptic":287,"../curve":290,"bn.js":44,"inherits":316}],293:[function(_dereq_,module,exports){ +},{"../utils":301,"./base":288,"bn.js":44,"inherits":316}],293:[function(_dereq_,module,exports){ 'use strict'; var curves = exports; var hash = _dereq_('hash.js'); -var elliptic = _dereq_('../elliptic'); +var curve = _dereq_('./curve'); +var utils = _dereq_('./utils'); -var assert = elliptic.utils.assert; +var assert = utils.assert; function PresetCurve(options) { if (options.type === 'short') - this.curve = new elliptic.curve.short(options); + this.curve = new curve.short(options); else if (options.type === 'edwards') - this.curve = new elliptic.curve.edwards(options); + this.curve = new curve.edwards(options); else if (options.type === 'mont') - this.curve = new elliptic.curve.mont(options); + this.curve = new curve.mont(options); else throw new Error('Unknown curve type.'); this.g = this.curve.g; this.n = this.curve.n; @@ -14833,13 +14829,14 @@ defineCurve('secp256k1', { ] }); -},{"../elliptic":287,"./precomputed/secp256k1":300,"hash.js":303}],294:[function(_dereq_,module,exports){ +},{"./curve":290,"./precomputed/secp256k1":300,"./utils":301,"hash.js":303}],294:[function(_dereq_,module,exports){ 'use strict'; var BN = _dereq_('bn.js'); var HmacDRBG = _dereq_('hmac-drbg'); -var elliptic = _dereq_('../../elliptic'); -var utils = elliptic.utils; +var utils = _dereq_('../utils'); +var curves = _dereq_('../curves'); +var rand = _dereq_('brorand'); var assert = utils.assert; var KeyPair = _dereq_('./key'); @@ -14851,13 +14848,13 @@ function EC(options) { // Shortcut `elliptic.ec(curve-name)` if (typeof options === 'string') { - assert(elliptic.curves.hasOwnProperty(options), 'Unknown curve ' + options); + assert(curves.hasOwnProperty(options), 'Unknown curve ' + options); - options = elliptic.curves[options]; + options = curves[options]; } // Shortcut for `elliptic.ec(elliptic.curves.curveName)` - if (options instanceof elliptic.curves.PresetCurve) + if (options instanceof curves.PresetCurve) options = { curve: options }; this.curve = options.curve.curve; @@ -14895,7 +14892,7 @@ EC.prototype.genKeyPair = function genKeyPair(options) { hash: this.hash, pers: options.pers, persEnc: options.persEnc || 'utf8', - entropy: options.entropy || elliptic.rand(this.hash.hmacStrength), + entropy: options.entropy || rand(this.hash.hmacStrength), entropyEnc: options.entropy && options.entropyEnc || 'utf8', nonce: this.n.toArray() }); @@ -14918,8 +14915,9 @@ EC.prototype.genKeyPair = function genKeyPair(options) { } while (true); }; -EC.prototype._truncateToN = function truncateToN(msg, truncOnly) { - var delta = msg.byteLength() * 8 - this.n.bitLength(); +EC.prototype._truncateToN = function truncateToN(msg, truncOnly, bitSize) { + bitSize = bitSize || msg.byteLength() * 8; + var delta = bitSize - this.n.bitLength(); if (delta > 0) msg = msg.ushrn(delta); if (!truncOnly && msg.cmp(this.n) >= 0) @@ -14928,6 +14926,21 @@ EC.prototype._truncateToN = function truncateToN(msg, truncOnly) { return msg; }; +EC.prototype.truncateMsg = function truncateMSG(msg) { + // Bit size is only determined correctly for Uint8Arrays and hex strings + var bitSize; + if (msg instanceof Uint8Array) { + bitSize = msg.byteLength * 8; + msg = this._truncateToN(new BN(msg, 16), false, bitSize); + } else if (typeof msg === 'string') { + bitSize = msg.length * 4; + msg = this._truncateToN(new BN(msg, 16), false, bitSize); + } else { + msg = this._truncateToN(new BN(msg, 16)); + } + return msg; +} + EC.prototype.sign = function sign(msg, key, enc, options) { if (typeof enc === 'object') { options = enc; @@ -14937,7 +14950,7 @@ EC.prototype.sign = function sign(msg, key, enc, options) { options = {}; key = this.keyFromPrivate(key, enc); - msg = this._truncateToN(new BN(msg, 16)); + msg = this.truncateMsg(msg); // Zero-extend key to provide enough entropy var bytes = this.n.byteLength(); @@ -14994,10 +15007,15 @@ EC.prototype.sign = function sign(msg, key, enc, options) { }; EC.prototype.verify = function verify(msg, signature, key, enc) { - msg = this._truncateToN(new BN(msg, 16)); key = this.keyFromPublic(key, enc); signature = new Signature(signature, 'hex'); + // Fallback to the old code + var ret = this._verify(this.truncateMsg(msg), signature, key) || + this._verify(this._truncateToN(new BN(msg, 16)), signature, key); + return ret; +}; +EC.prototype._verify = function _verify(msg, signature, key) { // Perform primitive values validation var r = signature.r; var s = signature.s; @@ -15081,12 +15099,11 @@ EC.prototype.getKeyRecoveryParam = function(e, signature, Q, enc) { throw new Error('Unable to find valid recovery factor'); }; -},{"../../elliptic":287,"./key":295,"./signature":296,"bn.js":44,"hmac-drbg":315}],295:[function(_dereq_,module,exports){ +},{"../curves":293,"../utils":301,"./key":295,"./signature":296,"bn.js":44,"brorand":45,"hmac-drbg":315}],295:[function(_dereq_,module,exports){ 'use strict'; var BN = _dereq_('bn.js'); -var elliptic = _dereq_('../../elliptic'); -var utils = elliptic.utils; +var utils = _dereq_('../utils'); var assert = utils.assert; function KeyPair(ec, options) { @@ -15205,13 +15222,12 @@ KeyPair.prototype.inspect = function inspect() { ' pub: ' + (this.pub && this.pub.inspect()) + ' >'; }; -},{"../../elliptic":287,"bn.js":44}],296:[function(_dereq_,module,exports){ +},{"../utils":301,"bn.js":44}],296:[function(_dereq_,module,exports){ 'use strict'; var BN = _dereq_('bn.js'); -var elliptic = _dereq_('../../elliptic'); -var utils = elliptic.utils; +var utils = _dereq_('../utils'); var assert = utils.assert; function Signature(options, enc) { @@ -15342,13 +15358,14 @@ Signature.prototype.toDER = function toDER(enc) { return utils.encode(res, enc); }; -},{"../../elliptic":287,"bn.js":44}],297:[function(_dereq_,module,exports){ +},{"../utils":301,"bn.js":44}],297:[function(_dereq_,module,exports){ 'use strict'; var hash = _dereq_('hash.js'); var HmacDRBG = _dereq_('hmac-drbg'); -var elliptic = _dereq_('../../elliptic'); -var utils = elliptic.utils; +var rand = _dereq_('brorand'); +var curves = _dereq_('../curves'); +var utils = _dereq_('../utils'); var assert = utils.assert; var parseBytes = utils.parseBytes; var KeyPair = _dereq_('./key'); @@ -15360,7 +15377,7 @@ function EDDSA(curve) { if (!(this instanceof EDDSA)) return new EDDSA(curve); - var curve = elliptic.curves[curve].curve; + var curve = curves[curve].curve; this.curve = curve; this.g = curve.g; this.g.precompute(curve.n.bitLength() + 1); @@ -15433,7 +15450,7 @@ EDDSA.prototype.genKeyPair = function genKeyPair(options) { hash: this.hash, pers: options.pers, persEnc: options.persEnc || 'utf8', - entropy: options.entropy || elliptic.rand(this.hash.hmacStrength), + entropy: options.entropy || rand(this.hash.hmacStrength), entropyEnc: options.entropy && options.entropyEnc || 'utf8', nonce: this.curve.n.toArray() }); @@ -15484,11 +15501,10 @@ EDDSA.prototype.isPoint = function isPoint(val) { return val instanceof this.pointClass; }; -},{"../../elliptic":287,"./key":298,"./signature":299,"hash.js":303,"hmac-drbg":315}],298:[function(_dereq_,module,exports){ +},{"../curves":293,"../utils":301,"./key":298,"./signature":299,"brorand":45,"hash.js":303,"hmac-drbg":315}],298:[function(_dereq_,module,exports){ 'use strict'; -var elliptic = _dereq_('../../elliptic'); -var utils = elliptic.utils; +var utils = _dereq_('../utils'); var assert = utils.assert; var parseBytes = utils.parseBytes; var cachedProperty = utils.cachedProperty; @@ -15590,12 +15606,11 @@ KeyPair.prototype.getPublic = function getPublic(enc, compact) { module.exports = KeyPair; -},{"../../elliptic":287}],299:[function(_dereq_,module,exports){ +},{"../utils":301}],299:[function(_dereq_,module,exports){ 'use strict'; var BN = _dereq_('bn.js'); -var elliptic = _dereq_('../../elliptic'); -var utils = elliptic.utils; +var utils = _dereq_('../utils'); var assert = utils.assert; var cachedProperty = utils.cachedProperty; var parseBytes = utils.parseBytes; @@ -15658,7 +15673,7 @@ Signature.prototype.toHex = function toHex() { module.exports = Signature; -},{"../../elliptic":287,"bn.js":44}],300:[function(_dereq_,module,exports){ +},{"../utils":301,"bn.js":44}],300:[function(_dereq_,module,exports){ module.exports = { doubles: { step: 4, @@ -28970,13 +28985,15 @@ var _inherits2 = _dereq_('babel-runtime/helpers/inherits'); var _inherits3 = _interopRequireDefault(_inherits2); +var _util = _dereq_('./util'); + var _streams = _dereq_('./streams'); var _streams2 = _interopRequireDefault(_streams); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -var NodeReadableStream = typeof window === 'undefined' && _dereq_('stream').Readable; +var NodeReadableStream = _util.isNode && _dereq_('stream').Readable; /** * Web / node stream conversion functions @@ -29163,7 +29180,7 @@ if (NodeReadableStream) { exports.nodeToWeb = nodeToWeb; exports.webToNode = webToNode; -},{"./streams":345,"babel-runtime/core-js/object/get-prototype-of":28,"babel-runtime/core-js/promise":31,"babel-runtime/helpers/asyncToGenerator":35,"babel-runtime/helpers/classCallCheck":36,"babel-runtime/helpers/createClass":37,"babel-runtime/helpers/inherits":38,"babel-runtime/helpers/possibleConstructorReturn":39,"babel-runtime/regenerator":43,"stream":"stream"}],344:[function(_dereq_,module,exports){ +},{"./streams":345,"./util":346,"babel-runtime/core-js/object/get-prototype-of":28,"babel-runtime/core-js/promise":31,"babel-runtime/helpers/asyncToGenerator":35,"babel-runtime/helpers/classCallCheck":36,"babel-runtime/helpers/createClass":37,"babel-runtime/helpers/inherits":38,"babel-runtime/helpers/possibleConstructorReturn":39,"babel-runtime/regenerator":43,"stream":"stream"}],344:[function(_dereq_,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -29805,7 +29822,7 @@ var _reader = _dereq_('./reader'); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -var NodeBuffer = typeof window === 'undefined' && _dereq_('buffer').Buffer; +var NodeBuffer = _util.isNode && _dereq_('buffer').Buffer; /** * Convert data to Stream @@ -30432,12 +30449,23 @@ function slice(input) { exports.default = { isStream: _util.isStream, isUint8Array: _util.isUint8Array, toStream: toStream, concatUint8Array: _util.concatUint8Array, concatStream: concatStream, concat: concat, getReader: getReader, getWriter: getWriter, pipe: pipe, transformRaw: transformRaw, transform: transform, transformPair: transformPair, parse: parse, clone: clone, passiveClone: passiveClone, slice: slice, readToEnd: readToEnd, cancel: cancel, fromAsync: fromAsync, nodeToWeb: _nodeConversions.nodeToWeb, webToNode: _nodeConversions.webToNode }; },{"./node-conversions":343,"./reader":344,"./util":346,"babel-runtime/core-js/object/define-property":24,"babel-runtime/core-js/object/entries":25,"babel-runtime/core-js/object/get-own-property-descriptors":27,"babel-runtime/core-js/promise":31,"babel-runtime/helpers/asyncToGenerator":35,"babel-runtime/helpers/slicedToArray":40,"babel-runtime/regenerator":43,"buffer":"buffer"}],346:[function(_dereq_,module,exports){ +(function (global){ 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); -var NodeReadableStream = typeof window === 'undefined' && _dereq_('stream').Readable; +exports.concatUint8Array = exports.isUint8Array = exports.isStream = exports.isNode = undefined; + +var _typeof2 = _dereq_('babel-runtime/helpers/typeof'); + +var _typeof3 = _interopRequireDefault(_typeof2); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var isNode = (0, _typeof3.default)(global.process) === 'object' && (0, _typeof3.default)(global.process.versions) === 'object'; + +var NodeReadableStream = isNode && _dereq_('stream').Readable; /** * Check whether data is a Stream, and if so of which type @@ -30490,11 +30518,13 @@ function concatUint8Array(arrays) { return result; } +exports.isNode = isNode; exports.isStream = isStream; exports.isUint8Array = isUint8Array; exports.concatUint8Array = concatUint8Array; -},{"stream":"stream"}],347:[function(_dereq_,module,exports){ +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"babel-runtime/helpers/typeof":42,"stream":"stream"}],347:[function(_dereq_,module,exports){ (function(self) { 'use strict'; @@ -31459,7 +31489,7 @@ exports.default = { * @memberof module:config * @property {String} versionstring A version string to be included in armored messages */ - versionstring: "OpenPGP.js v4.6.0", + versionstring: "OpenPGP.js v4.6.1", /** * @memberof module:config * @property {String} commentstring A comment string to be included in armored messages @@ -31933,20 +31963,20 @@ function xorMut(a, b) { } function nodeEncrypt(algo, key, pt, iv) { - key = new Buffer(key); - iv = new Buffer(iv); + key = Buffer.from(key); + iv = Buffer.from(iv); var cipherObj = new nodeCrypto.createCipheriv('aes-' + algo.substr(3, 3) + '-cfb', key, iv); return _webStreamTools2.default.transform(pt, function (value) { - return new Uint8Array(cipherObj.update(new Buffer(value))); + return new Uint8Array(cipherObj.update(Buffer.from(value))); }); } function nodeDecrypt(algo, key, ct, iv) { - key = new Buffer(key); - iv = new Buffer(iv); + key = Buffer.from(key); + iv = Buffer.from(iv); var decipherObj = new nodeCrypto.createDecipheriv('aes-' + algo.substr(3, 3) + '-cfb', key, iv); return _webStreamTools2.default.transform(ct, function (value) { - return new Uint8Array(decipherObj.update(new Buffer(value))); + return new Uint8Array(decipherObj.update(Buffer.from(value))); }); } @@ -33434,7 +33464,7 @@ var CBC = function () { } // Node crypto library - key = new Buffer(key); + key = Buffer.from(key); return _context6.abrupt('return', function () { var _ref5 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee4(pt) { var en, ct; @@ -33442,7 +33472,7 @@ var CBC = function () { while (1) { switch (_context4.prev = _context4.next) { case 0: - pt = new Buffer(pt); + pt = Buffer.from(pt); en = new nodeCrypto.createCipheriv('aes-' + key.length * 8 + '-cbc', key, zeroBlock); ct = en.update(pt); return _context4.abrupt('return', new Uint8Array(ct)); @@ -34170,7 +34200,7 @@ var CTR = function () { } // Node crypto library - key = new Buffer(key); + key = Buffer.from(key); return _context5.abrupt('return', function () { var _ref4 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee3(pt, iv) { var en, ct; @@ -34178,8 +34208,8 @@ var CTR = function () { while (1) { switch (_context3.prev = _context3.next) { case 0: - pt = new Buffer(pt); - iv = new Buffer(iv); + pt = Buffer.from(pt); + iv = Buffer.from(iv); en = new nodeCrypto.createCipheriv('aes-' + key.length * 8 + '-ctr', key, iv); ct = Buffer.concat([en.update(pt), en.final()]); return _context3.abrupt('return', new Uint8Array(ct)); @@ -34614,7 +34644,7 @@ var GCM = function () { } // Node crypto library - key = new Buffer(key); + key = Buffer.from(key); return _context7.abrupt('return', { encrypt: function () { @@ -34625,9 +34655,9 @@ var GCM = function () { while (1) { switch (_context3.prev = _context3.next) { case 0: - pt = new Buffer(pt); - iv = new Buffer(iv); - adata = new Buffer(adata); + pt = Buffer.from(pt); + iv = Buffer.from(iv); + adata = Buffer.from(adata); en = new nodeCrypto.createCipheriv('aes-' + key.length * 8 + '-gcm', key, iv); en.setAAD(adata); @@ -34658,9 +34688,9 @@ var GCM = function () { while (1) { switch (_context4.prev = _context4.next) { case 0: - ct = new Buffer(ct); - iv = new Buffer(iv); - adata = new Buffer(adata); + ct = Buffer.from(ct); + iv = Buffer.from(iv); + adata = Buffer.from(adata); de = new nodeCrypto.createDecipheriv('aes-' + key.length * 8 + '-gcm', key, iv); de.setAAD(adata); @@ -34888,7 +34918,7 @@ function node_hash(type) { case 0: shasum = nodeCrypto.createHash(type); return _context.abrupt('return', _webStreamTools2.default.transform(data, function (value) { - shasum.update(new Buffer(value)); + shasum.update(Buffer.from(value)); }, function () { return new Uint8Array(shasum.digest()); })); @@ -38954,7 +38984,10 @@ function promisifyIE11Op(keyObj, err) { }); } return keyObj; -} // GPG4Browsers - An OpenPGP implementation in javascript +} + +/* eslint-disable no-invalid-this */ +// GPG4Browsers - An OpenPGP implementation in javascript // Copyright (C) 2011 Recurity Labs GmbH // // This library is free software; you can redistribute it and/or @@ -38981,6 +39014,21 @@ function promisifyIE11Op(keyObj, err) { * @module crypto/public_key/rsa */ +var RSAPrivateKey = _util2.default.detectNode() ? _dereq_('asn1.js').define('RSAPrivateKey', function () { + this.seq().obj( // used for native NodeJS keygen + this.key('version').int(), // 0 + this.key('modulus').int(), // n + this.key('publicExponent').int(), // e + this.key('privateExponent').int(), // d + this.key('prime1').int(), // p + this.key('prime2').int(), // q + this.key('exponent1').int(), // dp + this.key('exponent2').int(), // dq + this.key('coefficient').int() // u + ); +}) : undefined; +/* eslint-enable no-invalid-this */ + exports.default = { /** Create signature * @param {BN} m message @@ -39189,7 +39237,7 @@ exports.default = { /** * Generate a new random private key B bits long with public exponent E. * - * When possible, webCrypto is used. Otherwise, primes are generated using + * When possible, webCrypto or nodeCrypto is used. Otherwise, primes are generated using * 40 rounds of the Miller-Rabin probabilistic random prime generation algorithm. * @see module:crypto/public_key/prime * @param {Integer} B RSA bit length @@ -39201,7 +39249,7 @@ exports.default = { */ generate: function () { var _ref5 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee5(B, E) { - var key, webCrypto, keyPair, keyGenOpt, jwk, p, q, _ref6, phi; + var key, webCrypto, nodeCrypto, keyPair, keyGenOpt, jwk, opts, prv, p, q, _ref6, phi; return _regenerator2.default.wrap(function _callee5$(_context5) { while (1) { @@ -39211,11 +39259,12 @@ exports.default = { E = new _bn2.default(E, 16); webCrypto = _util2.default.getWebCryptoAll(); + nodeCrypto = _util2.default.getNodeCrypto(); // Native RSA keygen using Web Crypto if (!webCrypto) { - _context5.next = 35; + _context5.next = 38; break; } @@ -39223,7 +39272,7 @@ exports.default = { keyGenOpt = void 0; if (!(window.crypto && window.crypto.subtle || window.msCrypto)) { - _context5.next = 14; + _context5.next = 15; break; } @@ -39237,17 +39286,17 @@ exports.default = { } }; keyPair = webCrypto.generateKey(keyGenOpt, true, ['sign', 'verify']); - _context5.next = 11; + _context5.next = 12; return promisifyIE11Op(keyPair, 'Error generating RSA key pair.'); - case 11: + case 12: keyPair = _context5.sent; - _context5.next = 22; + _context5.next = 23; break; - case 14: + case 15: if (!(window.crypto && window.crypto.webkitSubtle)) { - _context5.next = 21; + _context5.next = 22; break; } @@ -39260,26 +39309,26 @@ exports.default = { name: 'SHA-1' // not required for actual RSA keys, but for crypto api 'sign' and 'verify' } }; - _context5.next = 18; + _context5.next = 19; return webCrypto.generateKey(keyGenOpt, true, ['encrypt', 'decrypt']); - case 18: + case 19: keyPair = _context5.sent; - _context5.next = 22; + _context5.next = 23; break; - case 21: + case 22: throw new Error('Unknown WebCrypto implementation'); - case 22: + case 23: // export the generated keys as JsonWebKey (JWK) // https://tools.ietf.org/html/draft-ietf-jose-json-web-key-33 jwk = webCrypto.exportKey('jwk', keyPair.privateKey); - _context5.next = 25; + _context5.next = 26; return promisifyIE11Op(jwk, 'Error exporting RSA key pair.'); - case 25: + case 26: jwk = _context5.sent; @@ -39298,16 +39347,53 @@ exports.default = { key.u = key.p.invm(key.q); return _context5.abrupt('return', key); - case 35: - _context5.next = 37; + case 38: + if (!(nodeCrypto && nodeCrypto.generateKeyPair && RSAPrivateKey)) { + _context5.next = 44; + break; + } + + opts = { + modulusLength: Number(B.toString(10)), + publicExponent: Number(E.toString(10)), + publicKeyEncoding: { type: 'pkcs1', format: 'der' }, + privateKeyEncoding: { type: 'pkcs1', format: 'der' } + }; + _context5.next = 42; + return new _promise2.default(function (resolve, reject) { + return nodeCrypto.generateKeyPair('rsa', opts, function (err, _, der) { + if (err) { + reject(err); + } else { + resolve(RSAPrivateKey.decode(der, 'der')); + } + }); + }); + + case 42: + prv = _context5.sent; + return _context5.abrupt('return', { + n: prv.modulus, + e: prv.publicExponent, + d: prv.privateExponent, + p: prv.prime1, + q: prv.prime2, + dp: prv.exponent1, + dq: prv.exponent2, + // re-compute `u` because PGP spec differs from DER spec, DER: `(inverse of q) mod p`, PGP: `(inverse of p) mod q` + u: prv.prime1.invm(prv.prime2) // PGP type of u + }); + + case 44: + _context5.next = 46; return _prime2.default.randomProbablePrime(B - (B >> 1), E, 40); - case 37: + case 46: p = _context5.sent; - _context5.next = 40; + _context5.next = 49; return _prime2.default.randomProbablePrime(B >> 1, E, 40); - case 40: + case 49: q = _context5.sent; @@ -39329,7 +39415,7 @@ exports.default = { u: p.invm(q) }); - case 44: + case 53: case 'end': return _context5.stop(); } @@ -39347,7 +39433,7 @@ exports.default = { prime: _prime2.default }; -},{"../../config":350,"../../util":423,"../random":380,"./prime":378,"babel-runtime/core-js/promise":31,"babel-runtime/helpers/asyncToGenerator":35,"babel-runtime/regenerator":43,"bn.js":44}],380:[function(_dereq_,module,exports){ +},{"../../config":350,"../../util":423,"../random":380,"./prime":378,"asn1.js":"asn1.js","babel-runtime/core-js/promise":31,"babel-runtime/helpers/asyncToGenerator":35,"babel-runtime/regenerator":43,"bn.js":44}],380:[function(_dereq_,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -40642,11 +40728,10 @@ function s2r(t) { /** * Convert radix-64 to binary array * @param {String | ReadableStream} t radix-64 string to convert - * @param {bool} u if true, input is interpreted as URL-safe * @returns {Uint8Array | ReadableStream} binary array version of input string * @static */ -function r2s(t, u) { +function r2s(t) { // TODO check atob alternative var c = void 0; @@ -41860,11 +41945,13 @@ var mergeSignatures = function () { * @param {Date} date (optional) override the creationtime of the signature * @param {Object} userId (optional) user ID * @param {Object} detached (optional) whether to create a detached signature packet + * @param {Boolean} streaming (optional) whether to process data as a stream * @returns {module:packet/signature} signature packet */ var createSignaturePacket = exports.createSignaturePacket = function () { var _ref36 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee32(dataToSign, privateKey, signingKeyPacket, signatureProperties, date, userId) { var detached = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : false; + var streaming = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : false; var signaturePacket; return _regenerator2.default.wrap(function _callee32$(_context32) { while (1) { @@ -41888,7 +41975,7 @@ var createSignaturePacket = exports.createSignaturePacket = function () { case 7: signaturePacket.hashAlgorithm = _context32.sent; _context32.next = 10; - return signaturePacket.sign(signingKeyPacket, dataToSign, detached); + return signaturePacket.sign(signingKeyPacket, dataToSign, detached, streaming); case 10: return _context32.abrupt('return', signaturePacket); @@ -41987,7 +42074,7 @@ var read = exports.read = function () { }, _callee47, this, [[3, 13]]); })); - return function read(_x98) { + return function read(_x99) { return _ref52.apply(this, arguments); }; }(); @@ -42042,7 +42129,7 @@ var readArmored = exports.readArmored = function () { }, _callee48, this, [[0, 9]]); })); - return function readArmored(_x99) { + return function readArmored(_x100) { return _ref53.apply(this, arguments); }; }(); @@ -42097,7 +42184,7 @@ var generate = exports.generate = function () { }, _callee49, this); })); - return function generateSecretKey(_x102) { + return function generateSecretKey(_x103) { return _ref55.apply(this, arguments); }; }(); @@ -42127,7 +42214,7 @@ var generate = exports.generate = function () { }, _callee50, this); })); - return function generateSecretSubkey(_x103) { + return function generateSecretSubkey(_x104) { return _ref56.apply(this, arguments); }; }(); @@ -42155,19 +42242,12 @@ var generate = exports.generate = function () { throw new Error('Not valid curve.'); } if (options.curve === _enums2.default.curve.ed25519 || options.curve === _enums2.default.curve.curve25519) { - if (options.sign) { - options.algorithm = _enums2.default.publicKey.eddsa; - options.curve = _enums2.default.curve.ed25519; - } else { - options.algorithm = _enums2.default.publicKey.ecdh; - options.curve = _enums2.default.curve.curve25519; - } + options.curve = options.sign ? _enums2.default.curve.ed25519 : _enums2.default.curve.curve25519; + } + if (options.sign) { + options.algorithm = options.curve === _enums2.default.curve.ed25519 ? _enums2.default.publicKey.eddsa : _enums2.default.publicKey.ecdsa; } else { - if (options.sign) { - options.algorithm = _enums2.default.publicKey.ecdsa; - } else { - options.algorithm = _enums2.default.publicKey.ecdh; - } + options.algorithm = _enums2.default.publicKey.ecdh; } } else if (options.numBits) { options.algorithm = _enums2.default.publicKey.rsa_encrypt_sign; @@ -42198,7 +42278,7 @@ var generate = exports.generate = function () { }, _callee51, this); })); - return function generate(_x100) { + return function generate(_x101) { return _ref54.apply(this, arguments); }; }(); @@ -42329,7 +42409,7 @@ var reformat = exports.reformat = function () { }, _callee52, _this2); })); - return function (_x105) { + return function (_x106) { return _ref58.apply(this, arguments); }; }())); @@ -42361,7 +42441,7 @@ var reformat = exports.reformat = function () { }, _callee53, this, [[2, 9]]); })); - return function reformat(_x104) { + return function reformat(_x105) { return _ref57.apply(this, arguments); }; }(); @@ -42408,7 +42488,7 @@ var wrapKeyObject = function () { }, _callee54, this); })); - return function (_x110, _x111) { + return function (_x111, _x112) { return _ref60.apply(this, arguments); }; }())); @@ -42505,7 +42585,7 @@ var wrapKeyObject = function () { }, _callee55, this); })); - return function (_x112, _x113) { + return function (_x113, _x114) { return _ref61.apply(this, arguments); }; }())).then(function (list) { @@ -42580,7 +42660,7 @@ var wrapKeyObject = function () { }, _callee56, this); })); - return function (_x114, _x115) { + return function (_x115, _x116) { return _ref63.apply(this, arguments); }; }())).then(function (packets) { @@ -42638,7 +42718,7 @@ var wrapKeyObject = function () { }, _callee57, this); })); - return function (_x116, _x117) { + return function (_x117, _x118) { return _ref65.apply(this, arguments); }; }())); @@ -42654,7 +42734,7 @@ var wrapKeyObject = function () { }, _callee58, this); })); - return function wrapKeyObject(_x107, _x108, _x109) { + return function wrapKeyObject(_x108, _x109, _x110) { return _ref59.apply(this, arguments); }; }(); @@ -42738,7 +42818,7 @@ var isDataRevoked = function () { }, _callee59, this); })); - return function (_x125) { + return function (_x126) { return _ref67.apply(this, arguments); }; }())); @@ -42765,7 +42845,7 @@ var isDataRevoked = function () { }, _callee60, this); })); - return function isDataRevoked(_x118, _x119, _x120, _x121, _x122, _x123) { + return function isDataRevoked(_x119, _x120, _x121, _x122, _x123, _x124) { return _ref66.apply(this, arguments); }; }(); @@ -42834,7 +42914,7 @@ var getPreferredHashAlgo = exports.getPreferredHashAlgo = function () { }, _callee61, this); })); - return function getPreferredHashAlgo(_x127, _x128) { + return function getPreferredHashAlgo(_x128, _x129) { return _ref68.apply(this, arguments); }; }(); @@ -42898,7 +42978,7 @@ var getPreferredAlgo = exports.getPreferredAlgo = function () { }, _callee62, this); })); - return function (_x135, _x136) { + return function (_x136, _x137) { return _ref70.apply(this, arguments); }; }())); @@ -42930,7 +43010,7 @@ var getPreferredAlgo = exports.getPreferredAlgo = function () { }, _callee63, this); })); - return function getPreferredAlgo(_x131, _x132) { + return function getPreferredAlgo(_x132, _x133) { return _ref69.apply(this, arguments); }; }(); @@ -42983,7 +43063,7 @@ var isAeadSupported = exports.isAeadSupported = function () { }, _callee64, this); })); - return function (_x140, _x141) { + return function (_x141, _x142) { return _ref73.apply(this, arguments); }; }())); @@ -42999,7 +43079,7 @@ var isAeadSupported = exports.isAeadSupported = function () { }, _callee65, this); })); - return function isAeadSupported(_x137) { + return function isAeadSupported(_x138) { return _ref72.apply(this, arguments); }; }(); @@ -45063,7 +45143,7 @@ User.prototype.isRevoked = function () { }, _callee33, this); })); - return function (_x73) { + return function (_x74) { return _ref38.apply(this, arguments); }; }())); @@ -45082,7 +45162,7 @@ User.prototype.isRevoked = function () { }, _callee34, this); })); - return function (_x69, _x70, _x71) { + return function (_x70, _x71, _x72) { return _ref37.apply(this, arguments); }; }(); @@ -45132,7 +45212,7 @@ User.prototype.verifyAllCertifications = function () { }, _callee35, this); })); - return function (_x77) { + return function (_x78) { return _ref40.apply(this, arguments); }; }()))); @@ -45145,7 +45225,7 @@ User.prototype.verifyAllCertifications = function () { }, _callee36, this); })); - return function (_x74, _x75) { + return function (_x75, _x76) { return _ref39.apply(this, arguments); }; }(); @@ -45253,7 +45333,7 @@ User.prototype.verify = function () { }, _callee37, this); })); - return function (_x80) { + return function (_x81) { return _ref42.apply(this, arguments); }; }())); @@ -45273,7 +45353,7 @@ User.prototype.verify = function () { }, _callee38, this); })); - return function (_x78) { + return function (_x79) { return _ref41.apply(this, arguments); }; }(); @@ -45317,7 +45397,7 @@ User.prototype.update = function () { }, _callee39, this); })); - return function (_x83) { + return function (_x84) { return _ref44.apply(this, arguments); }; }()); @@ -45340,7 +45420,7 @@ User.prototype.update = function () { }, _callee40, this); })); - return function (_x81, _x82) { + return function (_x82, _x83) { return _ref43.apply(this, arguments); }; }(); @@ -45409,7 +45489,7 @@ SubKey.prototype.isRevoked = function () { }, _callee41, this); })); - return function (_x84, _x85, _x86) { + return function (_x85, _x86, _x87) { return _ref45.apply(this, arguments); }; }(); @@ -45489,7 +45569,7 @@ SubKey.prototype.verify = function () { }, _callee42, this); })); - return function (_x88) { + return function (_x89) { return _ref46.apply(this, arguments); }; }(); @@ -45538,7 +45618,7 @@ SubKey.prototype.getExpirationTime = function () { }, _callee43, this); })); - return function (_x90) { + return function (_x91) { return _ref47.apply(this, arguments); }; }(); @@ -45652,7 +45732,7 @@ SubKey.prototype.update = function () { }, _callee44, this); })); - return function (_x94) { + return function (_x95) { return _ref49.apply(this, arguments); }; }()); @@ -45671,7 +45751,7 @@ SubKey.prototype.update = function () { }, _callee45, this); })); - return function (_x92, _x93) { + return function (_x93, _x94) { return _ref48.apply(this, arguments); }; }(); @@ -45729,7 +45809,7 @@ SubKey.prototype.revoke = function () { }, _callee46, this); })); - return function (_x95) { + return function (_x96) { return _ref50.apply(this, arguments); }; }(); @@ -46659,6 +46739,7 @@ var encryptSessionKey = exports.encryptSessionKey = function () { * @param {Signature} signature (optional) any existing detached signature to add to the message * @param {Date} date (optional) override the creation time of the signature * @param {Array} userIds (optional) user IDs to sign with, e.g. [{ name:'Steve Sender', email:'steve@openpgp.org' }] + * @param {Boolean} streaming (optional) whether to process data as a stream * @returns {Promise} new message with signed content * @async */ @@ -46672,6 +46753,7 @@ var encryptSessionKey = exports.encryptSessionKey = function () { * @param {Date} date (optional) override the creationtime of the signature * @param {Array} userIds (optional) user IDs to sign with, e.g. [{ name:'Steve Sender', email:'steve@openpgp.org' }] * @param {Boolean} detached (optional) whether to create detached signature packets + * @param {Boolean} streaming (optional) whether to process data as a stream * @returns {Promise} list of signature packets * @async */ @@ -46679,11 +46761,12 @@ var createSignaturePackets = exports.createSignaturePackets = function () { var _ref17 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee18(literalDataPacket, privateKeys) { var signature = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; var date = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : new Date(); + var userIds = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : []; var _this2 = this; - var userIds = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : []; var detached = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false; + var streaming = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : false; var packetlist, signatureType, existingSigPacketlist; return _regenerator2.default.wrap(function _callee18$(_context18) { while (1) { @@ -46726,7 +46809,7 @@ var createSignaturePackets = exports.createSignaturePackets = function () { throw new Error('Could not find valid signing key packet in key ' + privateKey.getKeyId().toHex()); case 8: - return _context17.abrupt('return', (0, _key.createSignaturePacket)(literalDataPacket, privateKey, signingKey.keyPacket, { signatureType: signatureType }, date, userId, detached)); + return _context17.abrupt('return', (0, _key.createSignaturePacket)(literalDataPacket, privateKey, signingKey.keyPacket, { signatureType: signatureType }, date, userId, detached, streaming)); case 9: case 'end': @@ -46736,7 +46819,7 @@ var createSignaturePackets = exports.createSignaturePackets = function () { }, _callee17, _this2); })); - return function (_x51, _x52) { + return function (_x54, _x55) { return _ref18.apply(this, arguments); }; }())).then(function (signatureList) { @@ -46762,7 +46845,7 @@ var createSignaturePackets = exports.createSignaturePackets = function () { }, _callee18, this); })); - return function createSignaturePackets(_x45, _x46) { + return function createSignaturePackets(_x47, _x48) { return _ref17.apply(this, arguments); }; }(); @@ -46829,7 +46912,7 @@ var createVerificationObject = function () { }, _callee23, this); })); - return function (_x64) { + return function (_x67) { return _ref25.apply(this, arguments); }; }())); @@ -46948,7 +47031,7 @@ var createVerificationObject = function () { }, _callee26, this); })); - return function createVerificationObject(_x59, _x60, _x61) { + return function createVerificationObject(_x62, _x63, _x64) { return _ref24.apply(this, arguments); }; }(); @@ -46993,7 +47076,7 @@ var createVerificationObjects = exports.createVerificationObjects = function () }, _callee27, this); })); - return function (_x70) { + return function (_x73) { return _ref29.apply(this, arguments); }; }()))); @@ -47006,7 +47089,7 @@ var createVerificationObjects = exports.createVerificationObjects = function () }, _callee28, this); })); - return function createVerificationObjects(_x65, _x66, _x67) { + return function createVerificationObjects(_x68, _x69, _x70) { return _ref28.apply(this, arguments); }; }(); @@ -47053,7 +47136,7 @@ var readArmored = exports.readArmored = function () { }, _callee30, this); })); - return function readArmored(_x72) { + return function readArmored(_x75) { return _ref31.apply(this, arguments); }; }(); @@ -47099,7 +47182,7 @@ var read = exports.read = function () { }, _callee31, this); })); - return function read(_x73) { + return function read(_x76) { return _ref32.apply(this, arguments); }; }(); @@ -47860,6 +47943,7 @@ Message.prototype.encrypt = function () { var signature = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; var date = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : new Date(); var userIds = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : []; + var streaming = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false; var packetlist, literalDataPacket, i, existingSigPacketlist, signatureType, signaturePacket, onePassSig; return _regenerator2.default.wrap(function _callee15$(_context15) { while (1) { @@ -47954,7 +48038,7 @@ Message.prototype.encrypt = function () { }, _callee14, this); })); - return function (_x39, _x40) { + return function (_x40, _x41) { return _ref15.apply(this, arguments); }; }())).then(function (onePassSignatureList) { @@ -47968,7 +48052,7 @@ Message.prototype.encrypt = function () { packetlist.push(literalDataPacket); _context15.t0 = packetlist; _context15.next = 14; - return createSignaturePackets(literalDataPacket, privateKeys, signature, date, false); + return createSignaturePackets(literalDataPacket, privateKeys, signature, date, userIds, false, streaming); case 14: _context15.t1 = _context15.sent; @@ -48016,6 +48100,7 @@ Message.prototype.compress = function (compression) { * @param {Signature} signature (optional) any existing detached signature * @param {Date} date (optional) override the creation time of the signature * @param {Array} userIds (optional) user IDs to sign with, e.g. [{ name:'Steve Sender', email:'steve@openpgp.org' }] + * @param {Boolean} streaming (optional) whether to process data as a stream * @returns {Promise} new detached signature of message content * @async */ @@ -48025,6 +48110,7 @@ Message.prototype.signDetached = function () { var signature = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; var date = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : new Date(); var userIds = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : []; + var streaming = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false; var literalDataPacket; return _regenerator2.default.wrap(function _callee16$(_context16) { while (1) { @@ -48042,7 +48128,7 @@ Message.prototype.signDetached = function () { case 3: _context16.t0 = _signature.Signature; _context16.next = 6; - return createSignaturePackets(literalDataPacket, privateKeys, signature, date, userIds, true); + return createSignaturePackets(literalDataPacket, privateKeys, signature, date, userIds, true, streaming); case 6: _context16.t1 = _context16.sent; @@ -48132,7 +48218,7 @@ Message.prototype.signDetached = function () { }, _callee20, _this3); })); - return function (_x55) { + return function (_x58) { return _ref20.apply(this, arguments); }; }())); @@ -48205,7 +48291,7 @@ Message.prototype.signDetached = function () { }, _callee21, _this3, [[2, 21]]); })); - return function (_x56, _x57) { + return function (_x59, _x60) { return _ref22.apply(this, arguments); }; }()); @@ -48222,7 +48308,7 @@ Message.prototype.signDetached = function () { }, _callee22, this); })); - return function (_x53) { + return function (_x56) { return _ref19.apply(this, arguments); }; }(); @@ -48294,7 +48380,7 @@ Message.prototype.appendSignature = function () { }, _callee29, this); })); - return function (_x71) { + return function (_x74) { return _ref30.apply(this, arguments); }; }(); @@ -49183,7 +49269,7 @@ function encrypt(_ref13) { } _context7.next = 5; - return message.signDetached(privateKeys, signature, date, fromUserIds); + return message.signDetached(privateKeys, signature, date, fromUserIds, message.fromStream); case 5: detachedSignature = _context7.sent; @@ -49194,7 +49280,7 @@ function encrypt(_ref13) { case 9: _context7.next = 11; - return message.sign(privateKeys, signature, date, fromUserIds); + return message.sign(privateKeys, signature, date, fromUserIds, message.fromStream); case 11: message = _context7.sent; @@ -49431,7 +49517,7 @@ function sign(_ref18) { } _context11.next = 3; - return message.signDetached(privateKeys, undefined, date, fromUserIds); + return message.signDetached(privateKeys, undefined, date, fromUserIds, message.fromStream); case 3: signature = _context11.sent; @@ -49465,7 +49551,7 @@ function sign(_ref18) { case 8: _context11.next = 10; - return message.sign(privateKeys, undefined, date, fromUserIds); + return message.sign(privateKeys, undefined, date, fromUserIds, message.fromStream); case 10: message = _context11.sent; @@ -53147,84 +53233,92 @@ SecretKey.prototype.encrypt = function () { return _context.abrupt('return', false); case 2: + if (this.isDecrypted()) { + _context.next = 4; + break; + } + + throw new Error('Key packet is already encrypted'); + + case 4: if (!(this.isDecrypted() && !passphrase)) { - _context.next = 7; + _context.next = 9; break; } this.s2k_usage = 0; return _context.abrupt('return', false); - case 7: + case 9: if (passphrase) { - _context.next = 9; + _context.next = 11; break; } throw new Error('The key must be decrypted before removing passphrase protection.'); - case 9: + case 11: this.s2k = new _s2k2.default(); - _context.next = 12; + _context.next = 14; return _crypto2.default.random.getRandomBytes(8); - case 12: + case 14: this.s2k.salt = _context.sent; cleartext = write_cleartext_params(this.params, this.algorithm); - _context.next = 16; + _context.next = 18; return produceEncryptionKey(this.s2k, passphrase, this.symmetric); - case 16: + case 18: key = _context.sent; blockLen = _crypto2.default.cipher[this.symmetric].blockSize; - _context.next = 20; + _context.next = 22; return _crypto2.default.random.getRandomBytes(blockLen); - case 20: + case 22: this.iv = _context.sent; if (!(this.version === 5)) { - _context.next = 32; + _context.next = 34; break; } this.s2k_usage = 253; mode = _crypto2.default[this.aead]; - _context.next = 26; + _context.next = 28; return mode(this.symmetric, key); - case 26: + case 28: modeInstance = _context.sent; - _context.next = 29; + _context.next = 31; return modeInstance.encrypt(cleartext, this.iv.subarray(0, mode.ivLength), new Uint8Array()); - case 29: + case 31: this.keyMaterial = _context.sent; - _context.next = 45; + _context.next = 47; break; - case 32: + case 34: this.s2k_usage = 254; _context.t0 = _crypto2.default.cfb; _context.t1 = this.symmetric; _context.t2 = key; _context.t3 = _util2.default; _context.t4 = cleartext; - _context.next = 40; + _context.next = 42; return _crypto2.default.hash.sha1(cleartext); - case 40: + case 42: _context.t5 = _context.sent; _context.t6 = [_context.t4, _context.t5]; _context.t7 = _context.t3.concatUint8Array.call(_context.t3, _context.t6); _context.t8 = this.iv; this.keyMaterial = _context.t0.encrypt.call(_context.t0, _context.t1, _context.t2, _context.t7, _context.t8); - case 45: + case 47: return _context.abrupt('return', true); - case 46: + case 48: case 'end': return _context.stop(); } @@ -53443,6 +53537,9 @@ SecretKey.prototype.postCloneTypeFix = function () { if (this.keyid) { this.keyid = _keyid2.default.fromClone(this.keyid); } + if (this.s2k) { + this.s2k = _s2k2.default.fromClone(this.s2k); + } }; exports.default = SecretKey; @@ -53702,6 +53799,7 @@ Signature.prototype.write = function () { * @param {module:packet.SecretKey} key private key used to sign the message. * @param {Object} data Contains packets to be signed. * @param {Boolean} detached (optional) whether to create a detached signature + * @param {Boolean} streaming (optional) whether to process data as a stream * @returns {Promise} * @async */ @@ -53710,7 +53808,8 @@ Signature.prototype.sign = function () { var _this = this; var detached = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; - var signatureType, publicKeyAlgorithm, hashAlgorithm, arr, toHash, hash, params; + var streaming = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false; + var signatureType, publicKeyAlgorithm, hashAlgorithm, arr, toHash, hash, params, signed; return _regenerator2.default.wrap(function _callee2$(_context2) { while (1) { switch (_context2.prev = _context2.next) { @@ -53752,30 +53851,54 @@ Signature.prototype.sign = function () { params = key.params; - this.signature = _webStreamTools2.default.fromAsync((0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee() { - return _regenerator2.default.wrap(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - _context.t0 = _crypto2.default.signature; - _context.t1 = publicKeyAlgorithm; - _context.t2 = hashAlgorithm; - _context.t3 = params; - _context.t4 = toHash; - _context.next = 7; - return _webStreamTools2.default.readToEnd(hash); - - case 7: - _context.t5 = _context.sent; - return _context.abrupt('return', _context.t0.sign.call(_context.t0, _context.t1, _context.t2, _context.t3, _context.t4, _context.t5)); - - case 9: - case 'end': - return _context.stop(); + signed = function () { + var _ref2 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee() { + return _regenerator2.default.wrap(function _callee$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + _context.t0 = _crypto2.default.signature; + _context.t1 = publicKeyAlgorithm; + _context.t2 = hashAlgorithm; + _context.t3 = params; + _context.t4 = toHash; + _context.next = 7; + return _webStreamTools2.default.readToEnd(hash); + + case 7: + _context.t5 = _context.sent; + return _context.abrupt('return', _context.t0.sign.call(_context.t0, _context.t1, _context.t2, _context.t3, _context.t4, _context.t5)); + + case 9: + case 'end': + return _context.stop(); + } } - } - }, _callee, _this); - }))); + }, _callee, _this); + })); + + return function signed() { + return _ref2.apply(this, arguments); + }; + }(); + + if (!streaming) { + _context2.next = 20; + break; + } + + this.signature = _webStreamTools2.default.fromAsync(signed); + _context2.next = 23; + break; + + case 20: + _context2.next = 22; + return signed(); + + case 22: + this.signature = _context2.sent; + + case 23: // Store the fact that this signature is valid, e.g. for when we call `await // getLatestValidSignature(this.revocationSignatures, key, data)` later. Note @@ -53784,7 +53907,7 @@ Signature.prototype.sign = function () { this.verified = true; return _context2.abrupt('return', true); - case 18: + case 25: case 'end': return _context2.stop(); } @@ -54331,7 +54454,7 @@ Signature.prototype.hash = function () { }, _callee4, this); })); - return function (_x8, _x9, _x10) { + return function (_x9, _x10, _x11) { return _ref5.apply(this, arguments); }; }(); @@ -54449,7 +54572,7 @@ Signature.prototype.verify = function () { }, _callee5, this); })); - return function (_x13, _x14, _x15) { + return function (_x14, _x15, _x16) { return _ref7.apply(this, arguments); }; }(); diff --git a/dist/compat/openpgp.min.js b/dist/compat/openpgp.min.js index 4b37e5fca..fe45412b0 100644 --- a/dist/compat/openpgp.min.js +++ b/dist/compat/openpgp.min.js @@ -1,2 +1,2 @@ -/*! OpenPGP.js v4.6.0 - 2019-08-12 - this is LGPL licensed code, see LICENSE/our website https://openpgpjs.org/ for more information. */ -!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).openpgp=e()}}(function(){return function(){return function e(t,r,n){function a(s,o){if(!r[s]){if(!t[s]){var u="function"==typeof require&&require;if(!o&&u)return u(s,!0);if(i)return i(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var f=r[s]={exports:{}};t[s][0].call(f.exports,function(e){return a(t[s][1][e]||e)},f,f.exports,e,t,r,n)}return r[s].exports}for(var i="function"==typeof require&&require,s=0;s0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,f.default)(this,e),F(this);var n=r.size,a=r.highWaterMark;if(void 0!==t.type)throw new RangeError("Invalid type is specified");var i=P(n);void 0===a&&(a=1),function(e,t,r,n){var a=(0,c.default)(re.prototype),i=A(t,"write",1,[a]),s=A(t,"close",0,[]),o=A(t,"abort",1,[]);ne(e,a,function(){return S(t,"start",[a])},i,s,o,r,n)}(this,t,a=M(a),i)}return(0,d.default)(e,[{key:"abort",value:function(e){return!1===L(this)?h.default.reject(fe("abort")):!0===N(this)?h.default.reject(new TypeError("Cannot abort a stream that already has a writer")):q(this,e)}},{key:"getWriter",value:function(){if(!1===L(this))throw fe("getWriter");return D(this)}},{key:"locked",get:function(){if(!1===L(this))throw fe("locked");return N(this)}}]),e}();function D(e){return new X(e)}function F(e){e._state="writable",e._storedError=void 0,e._writer=void 0,e._writableStreamController=void 0,e._writeRequests=[],e._inFlightWriteRequest=void 0,e._closeRequest=void 0,e._inFlightCloseRequest=void 0,e._pendingAbortRequest=void 0,e._backpressure=!1}function L(e){return!!i(e)&&!!Object.prototype.hasOwnProperty.call(e,"_writableStreamController")}function N(e){return void 0!==e._writer}function q(e,t){var r=e._state;if("closed"===r||"errored"===r)return h.default.resolve(void 0);if(void 0!==e._pendingAbortRequest)return e._pendingAbortRequest._promise;var n=!1;"erroring"===r&&(n=!0,t=void 0);var a=new h.default(function(r,a){e._pendingAbortRequest={_promise:void 0,_resolve:r,_reject:a,_reason:t,_wasAlreadyErroring:n}});return e._pendingAbortRequest._promise=a,!1===n&&H(e,t),a}function G(e,t){"writable"!==e._state?W(e):H(e,t)}function H(e,t){var r=e._writableStreamController;e._state="erroring",e._storedError=t;var n=e._writer;void 0!==n&&Q(n,t),!1===function(e){return void 0!==e._inFlightWriteRequest||void 0!==e._inFlightCloseRequest}(e)&&!0===r._started&&W(e)}function W(e){e._state="errored",e._writableStreamController[O]();var t=e._storedError,r=!0,n=!1,a=void 0;try{for(var i,s=(0,l.default)(e._writeRequests);!(r=(i=s.next()).done);r=!0){i.value._reject(t)}}catch(u){n=!0,a=u}finally{try{!r&&s.return&&s.return()}finally{if(n)throw a}}if(e._writeRequests=[],void 0!==e._pendingAbortRequest){var o=e._pendingAbortRequest;if(e._pendingAbortRequest=void 0,!0===o._wasAlreadyErroring)return o._reject(t),void V(e);e._writableStreamController[I](o._reason).then(function(){o._resolve(),V(e)},function(t){o._reject(t),V(e)})}else V(e)}function Z(e){return void 0!==e._closeRequest||void 0!==e._inFlightCloseRequest}function V(e){void 0!==e._closeRequest&&(e._closeRequest._reject(e._storedError),e._closeRequest=void 0);var t=e._writer;void 0!==t&&be(t,e._storedError)}function Y(e,t){var r=e._writer;void 0!==r&&t!==e._backpressure&&(!0===t?me(r):we(r)),e._backpressure=t}var X=function(){function e(t){if((0,f.default)(this,e),!1===L(t))throw new TypeError("WritableStreamDefaultWriter can only be constructed with a WritableStream instance");if(!0===N(t))throw new TypeError("This stream has already been locked for exclusive writing by another writer");this._ownerWritableStream=t,t._writer=this;var r=t._state;if("writable"===r)!1===Z(t)&&!0===t._backpressure?me(this):ge(this),he(this);else if("erroring"===r)ve(this,t._storedError),he(this);else if("closed"===r)ge(this),function(e){he(e),ye(e)}(this);else{var n=t._storedError;ve(this,n),pe(this,n)}}return(0,d.default)(e,[{key:"abort",value:function(e){return!1===J(this)?h.default.reject(de("abort")):void 0===this._ownerWritableStream?h.default.reject(le("abort")):function(e,t){return q(e._ownerWritableStream,t)}(this,e)}},{key:"close",value:function(){if(!1===J(this))return h.default.reject(de("close"));var e=this._ownerWritableStream;return void 0===e?h.default.reject(le("close")):!0===Z(e)?h.default.reject(new TypeError("cannot close an already-closing stream")):$(this)}},{key:"releaseLock",value:function(){if(!1===J(this))throw de("releaseLock");void 0!==this._ownerWritableStream&&ee(this)}},{key:"write",value:function(e){return!1===J(this)?h.default.reject(de("write")):void 0===this._ownerWritableStream?h.default.reject(le("write to")):te(this,e)}},{key:"closed",get:function(){return!1===J(this)?h.default.reject(de("closed")):this._closedPromise}},{key:"desiredSize",get:function(){if(!1===J(this))throw de("desiredSize");if(void 0===this._ownerWritableStream)throw le("desiredSize");return e=this._ownerWritableStream,"errored"===(t=e._state)||"erroring"===t?null:"closed"===t?0:ie(e._writableStreamController);var e,t}},{key:"ready",get:function(){return!1===J(this)?h.default.reject(de("ready")):this._readyPromise}}]),e}();function J(e){return!!i(e)&&!!Object.prototype.hasOwnProperty.call(e,"_ownerWritableStream")}function $(e){var t=e._ownerWritableStream,r=t._state;if("closed"===r||"errored"===r)return h.default.reject(new TypeError("The stream (in "+r+" state) is not in the writable state and cannot be closed"));var n=new h.default(function(e,r){var n={_resolve:e,_reject:r};t._closeRequest=n});return!0===t._backpressure&&"writable"===r&&we(e),function(e){B(e,"close",0),se(e)}(t._writableStreamController),n}function Q(e,t){"pending"===e._readyPromiseState?_e(e,t):function(e,t){ve(e,t)}(e,t)}function ee(e){var t=e._ownerWritableStream,r=new TypeError("Writer was released and can no longer be used to monitor the stream's closedness");Q(e,r),function(e,t){"pending"===e._closedPromiseState?be(e,t):function(e,t){pe(e,t)}(e,t)}(e,r),t._writer=void 0,e._ownerWritableStream=void 0}function te(e,t){var r=e._ownerWritableStream,n=r._writableStreamController,a=function(e,t){try{return e._strategySizeAlgorithm(t)}catch(t){return oe(e,t),1}}(n,t);if(r!==e._ownerWritableStream)return h.default.reject(le("write to"));var i=r._state;if("errored"===i)return h.default.reject(r._storedError);if(!0===Z(r)||"closed"===i)return h.default.reject(new TypeError("The stream is closing or closed and cannot be written to"));if("erroring"===i)return h.default.reject(r._storedError);var s=function(e){return new h.default(function(t,r){var n={_resolve:t,_reject:r};e._writeRequests.push(n)})}(r);return function(e,t,r){var n={chunk:t};try{B(e,n,r)}catch(t){return void oe(e,t)}var a=e._controlledWritableStream;!1===Z(a)&&"writable"===a._state&&Y(a,ue(e));se(e)}(n,t,a),s}var re=function(){function e(){throw(0,f.default)(this,e),new TypeError("WritableStreamDefaultController cannot be constructed explicitly")}return(0,d.default)(e,[{key:"error",value:function(e){if(!1===function(e){return!!i(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledWritableStream")}(this))throw new TypeError("WritableStreamDefaultController.prototype.error can only be used on a WritableStreamDefaultController");"writable"===this._controlledWritableStream._state&&ce(this,e)}},{key:I,value:function(e){var t=this._abortAlgorithm(e);return ae(this),t}},{key:O,value:function(){U(this)}}]),e}();function ne(e,t,r,n,a,i,s,o){t._controlledWritableStream=e,e._writableStreamController=t,t._queue=void 0,t._queueTotalSize=void 0,U(t),t._started=!1,t._strategySizeAlgorithm=o,t._strategyHWM=s,t._writeAlgorithm=n,t._closeAlgorithm=a,t._abortAlgorithm=i;var u=ue(t);Y(e,u);var c=r();h.default.resolve(c).then(function(){t._started=!0,se(t)},function(r){t._started=!0,G(e,r)}).catch(K)}function ae(e){e._writeAlgorithm=void 0,e._closeAlgorithm=void 0,e._abortAlgorithm=void 0,e._strategySizeAlgorithm=void 0}function ie(e){return e._strategyHWM-e._queueTotalSize}function se(e){var t=e._controlledWritableStream;if(!1!==e._started&&void 0===t._inFlightWriteRequest){var r=t._state;if("closed"!==r&&"errored"!==r)if("erroring"!==r){if(0!==e._queue.length){var n=function(e){return e._queue[0].value}(e);"close"===n?function(e){var t=e._controlledWritableStream;(function(e){e._inFlightCloseRequest=e._closeRequest,e._closeRequest=void 0})(t),R(e);var r=e._closeAlgorithm();ae(e),r.then(function(){!function(e){e._inFlightCloseRequest._resolve(void 0),e._inFlightCloseRequest=void 0,"erroring"===e._state&&(e._storedError=void 0,void 0!==e._pendingAbortRequest&&(e._pendingAbortRequest._resolve(),e._pendingAbortRequest=void 0)),e._state="closed";var t=e._writer;void 0!==t&&ye(t)}(t)},function(e){!function(e,t){e._inFlightCloseRequest._reject(t),e._inFlightCloseRequest=void 0,void 0!==e._pendingAbortRequest&&(e._pendingAbortRequest._reject(t),e._pendingAbortRequest=void 0),G(e,t)}(t,e)}).catch(K)}(e):function(e,t){var r=e._controlledWritableStream;(function(e){e._inFlightWriteRequest=e._writeRequests.shift()})(r),e._writeAlgorithm(t).then(function(){!function(e){e._inFlightWriteRequest._resolve(void 0),e._inFlightWriteRequest=void 0}(r);var t=r._state;if(R(e),!1===Z(r)&&"writable"===t){var n=ue(e);Y(r,n)}se(e)},function(t){"writable"===r._state&&ae(e),function(e,t){e._inFlightWriteRequest._reject(t),e._inFlightWriteRequest=void 0,G(e,t)}(r,t)}).catch(K)}(e,n.chunk)}}else W(t)}}function oe(e,t){"writable"===e._controlledWritableStream._state&&ce(e,t)}function ue(e){return ie(e)<=0}function ce(e,t){var r=e._controlledWritableStream;ae(e),H(r,t)}function fe(e){return new TypeError("WritableStream.prototype."+e+" can only be used on a WritableStream")}function de(e){return new TypeError("WritableStreamDefaultWriter.prototype."+e+" can only be used on a WritableStreamDefaultWriter")}function le(e){return new TypeError("Cannot "+e+" a stream using a released writer")}function he(e){e._closedPromise=new h.default(function(t,r){e._closedPromise_resolve=t,e._closedPromise_reject=r,e._closedPromiseState="pending"})}function pe(e,t){he(e),be(e,t)}function be(e,t){e._closedPromise.catch(function(){}),e._closedPromise_reject(t),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0,e._closedPromiseState="rejected"}function ye(e){e._closedPromise_resolve(void 0),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0,e._closedPromiseState="resolved"}function me(e){e._readyPromise=new h.default(function(t,r){e._readyPromise_resolve=t,e._readyPromise_reject=r}),e._readyPromiseState="pending"}function ve(e,t){me(e),_e(e,t)}function ge(e){me(e),we(e)}function _e(e,t){e._readyPromise.catch(function(){}),e._readyPromise_reject(t),e._readyPromise_resolve=void 0,e._readyPromise_reject=void 0,e._readyPromiseState="rejected"}function we(e){e._readyPromise_resolve(void 0),e._readyPromise_resolve=void 0,e._readyPromise_reject=void 0,e._readyPromiseState="fulfilled"}var ke=u.default||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},xe=t("[[CancelSteps]]"),Ae=t("[[PullSteps]]"),Se=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,f.default)(this,e),Me(this);var n=r.size,a=r.highWaterMark,i=t.type;if("bytes"===String(i)){if(void 0!==n)throw new RangeError("The strategy for a byte stream cannot have a size function");void 0===a&&(a=0),function(e,t,r){var n=(0,c.default)(ct.prototype),a=A(t,"pull",0,[n]),i=A(t,"cancel",1,[]),s=t.autoAllocateChunkSize;if(void 0!==s&&(s=Number(s),!1===ke(s)||s<=0))throw new RangeError("autoAllocateChunkSize must be a positive integer");!function(e,t,r,n,a,i,s){t._controlledReadableByteStream=e,t._pullAgain=!1,t._pulling=!1,ht(t),t._queue=t._queueTotalSize=void 0,U(t),t._closeRequested=!1,t._started=!1,t._strategyHWM=M(i),t._pullAlgorithm=n,t._cancelAlgorithm=a,t._autoAllocateChunkSize=s,t._pendingPullIntos=[],e._readableStreamController=t;var o=r();h.default.resolve(o).then(function(){t._started=!0,lt(t)},function(e){St(t,e)}).catch(K)}(e,n,function(){return S(t,"start",[n])},a,i,r,s)}(this,t,a=M(a))}else{if(void 0!==i)throw new RangeError("Invalid type is specified");var s=P(n);void 0===a&&(a=1),function(e,t,r,n){var a=(0,c.default)(Je.prototype),i=A(t,"pull",0,[a]),s=A(t,"cancel",1,[]);ot(e,a,function(){return S(t,"start",[a])},i,s,r,n)}(this,t,a=M(a),s)}}return(0,d.default)(e,[{key:"cancel",value:function(e){return!1===Pe(this)?h.default.reject(Mt("cancel")):!0===Ce(this)?h.default.reject(new TypeError("Cannot cancel a stream that already has a reader")):Be(this,e)}},{key:"getReader",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).mode;if(!1===Pe(this))throw Mt("getReader");if(void 0===e)return Ee(this);if("byob"===(e=String(e)))return function(e){return new Ge(e)}(this);throw new RangeError("Invalid mode is specified")}},{key:"pipeThrough",value:function(e){var t=e.writable,r=e.readable,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=n.preventClose,i=n.preventAbort,s=n.preventCancel,o=n.signal;if(!1===Pe(this))throw Mt("pipeThrough");if(!1===L(t))throw new TypeError("writable argument to pipeThrough must be a WritableStream");if(!1===Pe(r))throw new TypeError("readable argument to pipeThrough must be a ReadableStream");if(a=Boolean(a),i=Boolean(i),s=Boolean(s),void 0!==o&&!jt(o))throw new TypeError("ReadableStream.prototype.pipeThrough's signal option must be an AbortSignal");if(!0===Ce(this))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");if(!0===N(t))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream");return Te(this,t,a,i,s,o).catch(function(){}),r}},{key:"pipeTo",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.preventClose,n=t.preventAbort,a=t.preventCancel,i=t.signal;return!1===Pe(this)?h.default.reject(Mt("pipeTo")):!1===L(e)?h.default.reject(new TypeError("ReadableStream.prototype.pipeTo's first argument must be a WritableStream")):(r=Boolean(r),n=Boolean(n),a=Boolean(a),void 0===i||jt(i)?!0===Ce(this)?h.default.reject(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")):!0===N(e)?h.default.reject(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")):Te(this,e,r,n,a,i):h.default.reject(new TypeError("ReadableStream.prototype.pipeTo's signal option must be an AbortSignal")))}},{key:"tee",value:function(){if(!1===Pe(this))throw Mt("tee");var e=function(e,t){var r=Ee(e),n=void 0,a=void 0,i=void 0,s=void 0,o=void 0,u=!1,c=!1,f=!1,d=new h.default(function(e){o=e});function l(){return Xe(r).then(function(e){var t=e.value;if(!0===e.done&&!1===u&&(!1===c&&rt(i._readableStreamController),!1===f&&rt(s._readableStreamController),u=!0),!0!==u){var r=t,n=t;!1===c&&nt(i._readableStreamController,r),!1===f&&nt(s._readableStreamController,n)}})}function p(){}return i=je(p,l,function(t){if(c=!0,n=t,!0===f){var r=_([n,a]),i=Be(e,r);o(i)}return d}),s=je(p,l,function(t){if(f=!0,a=t,!0===c){var r=_([n,a]),i=Be(e,r);o(i)}return d}),r._closedPromise.catch(function(e){!0!==u&&(at(i._readableStreamController,e),at(s._readableStreamController,e),u=!0)}),[i,s]}(this);return _(e)}},{key:"locked",get:function(){if(!1===Pe(this))throw Mt("locked");return Ce(this)}}]),e}();function Ee(e){return new qe(e)}function je(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:function(){return 1},i=(0,c.default)(Se.prototype);return Me(i),ot(i,(0,c.default)(Je.prototype),e,t,r,n,a),i}function Me(e){e._state="readable",e._reader=void 0,e._storedError=void 0,e._disturbed=!1}function Pe(e){return!!i(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readableStreamController")}function Ce(e){return void 0!==e._reader}function Te(e,t,r,n,a,i){var s=Ee(e),o=D(t),u=!1,c=h.default.resolve();return new h.default(function(f,d){var l=void 0;if(void 0!==i){if(l=function(){var r=new DOMException("Aborted","AbortError"),i=[];!1===n&&i.push(function(){return"writable"===t._state?q(t,r):h.default.resolve()}),!1===a&&i.push(function(){return"readable"===e._state?Be(e,r):h.default.resolve()}),m(function(){return C(i.map(function(e){return e()}),function(e){return e})},!0,r)},!0===i.aborted)return void l();i.addEventListener("abort",l)}if(y(e,s._closedPromise,function(e){!1===n?m(function(){return q(t,e)},!0,e):v(!0,e)}),y(t,o._closedPromise,function(t){!1===a?m(function(){return Be(e,t)},!0,t):v(!0,t)}),function(e,t,r){"closed"===e._state?r():t.then(r).catch(K)}(e,s._closedPromise,function(){!1===r?m(function(){return t=(e=o)._ownerWritableStream,r=t._state,!0===Z(t)||"closed"===r?h.default.resolve():"errored"===r?h.default.reject(t._storedError):$(e);var e,t,r}):v()}),!0===Z(t)||"closed"===t._state){var p=new TypeError("the destination writable stream closed before all data could be piped to it");!1===a?m(function(){return Be(e,p)},!0,p):v(!0,p)}function b(){var e=c;return c.then(function(){return e!==c?b():void 0})}function y(e,t,r){"errored"===e._state?r(e._storedError):t.catch(r).catch(K)}function m(e,r,n){function a(){e().then(function(){return g(r,n)},function(e){return g(!0,e)}).catch(K)}!0!==u&&(u=!0,"writable"===t._state&&!1===Z(t)?b().then(a):a())}function v(e,r){!0!==u&&(u=!0,"writable"===t._state&&!1===Z(t)?b().then(function(){return g(e,r)}).catch(K):g(e,r))}function g(e,t){ee(o),Ye(s),void 0!==i&&i.removeEventListener("abort",l),e?d(t):f(void 0)}new h.default(function(e,t){!function r(n){n?e():(!0===u?h.default.resolve(!0):o._readyPromise.then(function(){return Xe(s).then(function(e){var t=e.value;return!0===e.done||(c=te(o,t).catch(function(){}),!1)})})).then(r,t)}(!1)}).catch(function(e){c=h.default.resolve(),K(e)})})}function Ke(e,t){return new h.default(function(r,n){var a={_resolve:r,_reject:n,_forAuthorCode:t};e._reader._readIntoRequests.push(a)})}function Re(e,t){return new h.default(function(r,n){var a={_resolve:r,_reject:n,_forAuthorCode:t};e._reader._readRequests.push(a)})}function Be(e,t){return e._disturbed=!0,"closed"===e._state?h.default.resolve(void 0):"errored"===e._state?h.default.reject(e._storedError):(Ue(e),e._readableStreamController[xe](t).then(function(){}))}function Ue(e){e._state="closed";var t=e._reader;if(void 0!==t){if(We(t)){var r=!0,n=!1,a=void 0;try{for(var i,s=(0,l.default)(t._readRequests);!(r=(i=s.next()).done);r=!0){var o=i.value;(0,o._resolve)(Ie(void 0,!0,o._forAuthorCode))}}catch(u){n=!0,a=u}finally{try{!r&&s.return&&s.return()}finally{if(n)throw a}}t._readRequests=[]}Bt(t)}}function Ie(e,t,r){var n=null;!0===r&&(n=Object.prototype);var a=(0,c.default)(n);return Object.defineProperty(a,"value",{value:e,enumerable:!0,writable:!0,configurable:!0}),Object.defineProperty(a,"done",{value:t,enumerable:!0,writable:!0,configurable:!0}),a}function Oe(e,t){e._state="errored",e._storedError=t;var r=e._reader;if(void 0!==r){if(We(r)){var n=!0,a=!1,i=void 0;try{for(var s,o=(0,l.default)(r._readRequests);!(n=(s=o.next()).done);n=!0){s.value._reject(t)}}catch(p){a=!0,i=p}finally{try{!n&&o.return&&o.return()}finally{if(a)throw i}}r._readRequests=[]}else{var u=!0,c=!1,f=void 0;try{for(var d,h=(0,l.default)(r._readIntoRequests);!(u=(d=h.next()).done);u=!0){d.value._reject(t)}}catch(p){c=!0,f=p}finally{try{!u&&h.return&&h.return()}finally{if(c)throw f}}r._readIntoRequests=[]}Rt(r,t)}}function ze(e,t,r){var n=e._reader._readRequests.shift();n._resolve(Ie(t,r,n._forAuthorCode))}function De(e){return e._reader._readIntoRequests.length}function Fe(e){return e._reader._readRequests.length}function Le(e){var t=e._reader;return void 0!==t&&!!He(t)}function Ne(e){var t=e._reader;return void 0!==t&&!!We(t)}var qe=function(){function e(t){if((0,f.default)(this,e),!1===Pe(t))throw new TypeError("ReadableStreamDefaultReader can only be constructed with a ReadableStream instance");if(!0===Ce(t))throw new TypeError("This stream has already been locked for exclusive reading by another reader");Ze(this,t),this._readRequests=[]}return(0,d.default)(e,[{key:"cancel",value:function(e){return We(this)?void 0===this._ownerReadableStream?h.default.reject(Pt("cancel")):Ve(this,e):h.default.reject(Ct("cancel"))}},{key:"read",value:function(){return We(this)?void 0===this._ownerReadableStream?h.default.reject(Pt("read from")):Xe(this,!0):h.default.reject(Ct("read"))}},{key:"releaseLock",value:function(){if(!We(this))throw Ct("releaseLock");if(void 0!==this._ownerReadableStream){if(this._readRequests.length>0)throw new TypeError("Tried to release a reader lock when that reader has pending read() calls un-settled");Ye(this)}}},{key:"closed",get:function(){return We(this)?this._closedPromise:h.default.reject(Ct("closed"))}}]),e}(),Ge=function(){function e(t){if((0,f.default)(this,e),!Pe(t))throw new TypeError("ReadableStreamBYOBReader can only be constructed with a ReadableStream instance given a byte source");if(!1===ft(t._readableStreamController))throw new TypeError("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source");if(Ce(t))throw new TypeError("This stream has already been locked for exclusive reading by another reader");Ze(this,t),this._readIntoRequests=[]}return(0,d.default)(e,[{key:"cancel",value:function(e){return He(this)?void 0===this._ownerReadableStream?h.default.reject(Pt("cancel")):Ve(this,e):h.default.reject(Ut("cancel"))}},{key:"read",value:function(e){return He(this)?void 0===this._ownerReadableStream?h.default.reject(Pt("read from")):ArrayBuffer.isView(e)?(e.buffer,0===e.byteLength?h.default.reject(new TypeError("view must have non-zero byteLength")):function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=e._ownerReadableStream;return n._disturbed=!0,"errored"===n._state?h.default.reject(n._storedError):function(e,t,r){var n=e._controlledReadableByteStream,a=1;t.constructor!==DataView&&(a=t.constructor.BYTES_PER_ELEMENT);var i=t.constructor,s={buffer:j(t.buffer),byteOffset:t.byteOffset,byteLength:t.byteLength,bytesFilled:0,elementSize:a,ctor:i,readerType:"byob"};if(e._pendingPullIntos.length>0)return e._pendingPullIntos.push(s),Ke(n,r);if("closed"===n._state){var o=new i(s.buffer,s.byteOffset,0);return h.default.resolve(Ie(o,!0,r))}if(e._queueTotalSize>0){if(!0===mt(e,s)){var u=bt(s);return gt(e),h.default.resolve(Ie(u,!1,r))}if(!0===e._closeRequested){var c=new TypeError("Insufficient bytes to fill elements in the given buffer");return St(e,c),h.default.reject(c)}}e._pendingPullIntos.push(s);var f=Ke(n,r);return lt(e),f}(n._readableStreamController,t,r)}(this,e,!0)):h.default.reject(new TypeError("view must be an array buffer view")):h.default.reject(Ut("read"))}},{key:"releaseLock",value:function(){if(!He(this))throw Ut("releaseLock");if(void 0!==this._ownerReadableStream){if(this._readIntoRequests.length>0)throw new TypeError("Tried to release a reader lock when that reader has pending read() calls un-settled");Ye(this)}}},{key:"closed",get:function(){return He(this)?this._closedPromise:h.default.reject(Ut("closed"))}}]),e}();function He(e){return!!i(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readIntoRequests")}function We(e){return!!i(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readRequests")}function Ze(e,t){e._ownerReadableStream=t,t._reader=e,"readable"===t._state?Tt(e):"closed"===t._state?function(e){Tt(e),Bt(e)}(e):Kt(e,t._storedError)}function Ve(e,t){return Be(e._ownerReadableStream,t)}function Ye(e){"readable"===e._ownerReadableStream._state?Rt(e,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")):function(e,t){Kt(e,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness"))}(e),e._ownerReadableStream._reader=void 0,e._ownerReadableStream=void 0}function Xe(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=e._ownerReadableStream;return r._disturbed=!0,"closed"===r._state?h.default.resolve(Ie(void 0,!0,t)):"errored"===r._state?h.default.reject(r._storedError):r._readableStreamController[Ae](t)}var Je=function(){function e(){throw(0,f.default)(this,e),new TypeError}return(0,d.default)(e,[{key:"close",value:function(){if(!1===$e(this))throw It("close");if(!1===st(this))throw new TypeError("The stream is not in a state that permits close");rt(this)}},{key:"enqueue",value:function(e){if(!1===$e(this))throw It("enqueue");if(!1===st(this))throw new TypeError("The stream is not in a state that permits enqueue");return nt(this,e)}},{key:"error",value:function(e){if(!1===$e(this))throw It("error");at(this,e)}},{key:xe,value:function(e){U(this);var t=this._cancelAlgorithm(e);return tt(this),t}},{key:Ae,value:function(e){var t=this._controlledReadableStream;if(this._queue.length>0){var r=R(this);return!0===this._closeRequested&&0===this._queue.length?(tt(this),Ue(t)):Qe(this),h.default.resolve(Ie(r,!1,e))}var n=Re(t,e);return Qe(this),n}},{key:"desiredSize",get:function(){if(!1===$e(this))throw It("desiredSize");return it(this)}}]),e}();function $e(e){return!!i(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledReadableStream")}function Qe(e){!1!==et(e)&&(!0!==e._pulling?(e._pulling=!0,e._pullAlgorithm().then(function(){if(e._pulling=!1,!0===e._pullAgain)return e._pullAgain=!1,Qe(e)},function(t){at(e,t)}).catch(K)):e._pullAgain=!0)}function et(e){var t=e._controlledReadableStream;return!1!==st(e)&&!1!==e._started&&(!0===Ce(t)&&Fe(t)>0||it(e)>0)}function tt(e){e._pullAlgorithm=void 0,e._cancelAlgorithm=void 0,e._strategySizeAlgorithm=void 0}function rt(e){var t=e._controlledReadableStream;e._closeRequested=!0,0===e._queue.length&&(tt(e),Ue(t))}function nt(e,t){var r=e._controlledReadableStream;if(!0===Ce(r)&&Fe(r)>0)ze(r,t,!1);else{var n=void 0;try{n=e._strategySizeAlgorithm(t)}catch(t){throw at(e,t),t}try{B(e,t,n)}catch(t){throw at(e,t),t}}Qe(e)}function at(e,t){var r=e._controlledReadableStream;"readable"===r._state&&(U(e),tt(e),Oe(r,t))}function it(e){var t=e._controlledReadableStream._state;return"errored"===t?null:"closed"===t?0:e._strategyHWM-e._queueTotalSize}function st(e){var t=e._controlledReadableStream._state;return!1===e._closeRequested&&"readable"===t}function ot(e,t,r,n,a,i,s){t._controlledReadableStream=e,t._queue=void 0,t._queueTotalSize=void 0,U(t),t._started=!1,t._closeRequested=!1,t._pullAgain=!1,t._pulling=!1,t._strategySizeAlgorithm=s,t._strategyHWM=i,t._pullAlgorithm=n,t._cancelAlgorithm=a,e._readableStreamController=t;var o=r();h.default.resolve(o).then(function(){t._started=!0,Qe(t)},function(e){at(t,e)}).catch(K)}var ut=function(){function e(){throw(0,f.default)(this,e),new TypeError("ReadableStreamBYOBRequest cannot be used directly")}return(0,d.default)(e,[{key:"respond",value:function(e){if(!1===dt(this))throw Ot("respond");if(void 0===this._associatedReadableByteStreamController)throw new TypeError("This BYOB request has been invalidated");this._view.buffer,function(e,t){if(!1===k(t=Number(t)))throw new RangeError("bytesWritten must be a finite");kt(e,t)}(this._associatedReadableByteStreamController,e)}},{key:"respondWithNewView",value:function(e){if(!1===dt(this))throw Ot("respond");if(void 0===this._associatedReadableByteStreamController)throw new TypeError("This BYOB request has been invalidated");if(!ArrayBuffer.isView(e))throw new TypeError("You can only respond with array buffer views");e.buffer,function(e,t){var r=e._pendingPullIntos[0];if(r.byteOffset+r.bytesFilled!==t.byteOffset)throw new RangeError("The region specified by view does not match byobRequest");if(r.byteLength!==t.byteLength)throw new RangeError("The buffer of view has different capacity than byobRequest");r.buffer=t.buffer,kt(e,t.byteLength)}(this._associatedReadableByteStreamController,e)}},{key:"view",get:function(){if(!1===dt(this))throw Ot("view");return this._view}}]),e}(),ct=function(){function e(){throw(0,f.default)(this,e),new TypeError("ReadableByteStreamController constructor cannot be used directly")}return(0,d.default)(e,[{key:"close",value:function(){if(!1===ft(this))throw zt("close");if(!0===this._closeRequested)throw new TypeError("The stream has already been closed; do not close it again!");var e=this._controlledReadableByteStream._state;if("readable"!==e)throw new TypeError("The stream (in "+e+" state) is not in the readable state and cannot be closed");!function(e){var t=e._controlledReadableByteStream;if(e._queueTotalSize>0)e._closeRequested=!0;else{if(e._pendingPullIntos.length>0)if(e._pendingPullIntos[0].bytesFilled>0){var r=new TypeError("Insufficient bytes to fill elements in the given buffer");throw St(e,r),r}At(e),Ue(t)}}(this)}},{key:"enqueue",value:function(e){if(!1===ft(this))throw zt("enqueue");if(!0===this._closeRequested)throw new TypeError("stream is closed or draining");var t=this._controlledReadableByteStream._state;if("readable"!==t)throw new TypeError("The stream (in "+t+" state) is not in the readable state and cannot be enqueued to");if(!ArrayBuffer.isView(e))throw new TypeError("You can only enqueue array buffer views when using a ReadableByteStreamController");e.buffer,function(e,t){var r=e._controlledReadableByteStream,n=t.buffer,a=t.byteOffset,i=t.byteLength,s=j(n);!0===Ne(r)?0===Fe(r)?yt(e,s,a,i):ze(r,new Uint8Array(s,a,i),!1):!0===Le(r)?(yt(e,s,a,i),wt(e)):yt(e,s,a,i);lt(e)}(this,e)}},{key:"error",value:function(e){if(!1===ft(this))throw zt("error");St(this,e)}},{key:xe,value:function(e){this._pendingPullIntos.length>0&&(this._pendingPullIntos[0].bytesFilled=0),U(this);var t=this._cancelAlgorithm(e);return At(this),t}},{key:Ae,value:function(e){var t=this._controlledReadableByteStream;if(this._queueTotalSize>0){var r=this._queue.shift(),n=void 0;this._queueTotalSize-=r.byteLength,gt(this);try{n=new Uint8Array(r.buffer,r.byteOffset,r.byteLength)}catch(e){return h.default.reject(e)}return h.default.resolve(Ie(n,!1,e))}var a=this._autoAllocateChunkSize;if(void 0!==a){var i=void 0;try{i=new ArrayBuffer(a)}catch(e){return h.default.reject(e)}var s={buffer:i,byteOffset:0,byteLength:a,bytesFilled:0,elementSize:1,ctor:Uint8Array,readerType:"default"};this._pendingPullIntos.push(s)}var o=Re(t,e);return lt(this),o}},{key:"byobRequest",get:function(){if(!1===ft(this))throw zt("byobRequest");if(void 0===this._byobRequest&&this._pendingPullIntos.length>0){var e=this._pendingPullIntos[0],t=new Uint8Array(e.buffer,e.byteOffset+e.bytesFilled,e.byteLength-e.bytesFilled),r=(0,c.default)(ut.prototype);!function(e,t,r){e._associatedReadableByteStreamController=t,e._view=r}(r,this,t),this._byobRequest=r}return this._byobRequest}},{key:"desiredSize",get:function(){if(!1===ft(this))throw zt("desiredSize");return Et(this)}}]),e}();function ft(e){return!!i(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledReadableByteStream")}function dt(e){return!!i(e)&&!!Object.prototype.hasOwnProperty.call(e,"_associatedReadableByteStreamController")}function lt(e){!1!==function(e){var t=e._controlledReadableByteStream;return"readable"===t._state&&(!0!==e._closeRequested&&(!1!==e._started&&(!0===Ne(t)&&Fe(t)>0||(!0===Le(t)&&De(t)>0||Et(e)>0))))}(e)&&(!0!==e._pulling?(e._pulling=!0,e._pullAlgorithm().then(function(){e._pulling=!1,!0===e._pullAgain&&(e._pullAgain=!1,lt(e))},function(t){St(e,t)}).catch(K)):e._pullAgain=!0)}function ht(e){_t(e),e._pendingPullIntos=[]}function pt(e,t){var r=!1;"closed"===e._state&&(r=!0);var n=bt(t);"default"===t.readerType?ze(e,n,r):function(e,t,r){var n=e._reader._readIntoRequests.shift();n._resolve(Ie(t,r,n._forAuthorCode))}(e,n,r)}function bt(e){var t=e.bytesFilled,r=e.elementSize;return new e.ctor(e.buffer,e.byteOffset,t/r)}function yt(e,t,r,n){e._queue.push({buffer:t,byteOffset:r,byteLength:n}),e._queueTotalSize+=n}function mt(e,t){var r=t.elementSize,n=t.bytesFilled-t.bytesFilled%r,a=Math.min(e._queueTotalSize,t.byteLength-t.bytesFilled),i=t.bytesFilled+a,s=i-i%r,o=a,u=!1;s>n&&(o=s-t.bytesFilled,u=!0);for(var c=e._queue;o>0;){var f=c[0],d=Math.min(o,f.byteLength),l=t.byteOffset+t.bytesFilled;w(t.buffer,l,f.buffer,f.byteOffset,d),f.byteLength===d?c.shift():(f.byteOffset+=d,f.byteLength-=d),e._queueTotalSize-=d,vt(e,d,t),o-=d}return u}function vt(e,t,r){_t(e),r.bytesFilled+=t}function gt(e){0===e._queueTotalSize&&!0===e._closeRequested?(At(e),Ue(e._controlledReadableByteStream)):lt(e)}function _t(e){void 0!==e._byobRequest&&(e._byobRequest._associatedReadableByteStreamController=void 0,e._byobRequest._view=void 0,e._byobRequest=void 0)}function wt(e){for(;e._pendingPullIntos.length>0;){if(0===e._queueTotalSize)return;var t=e._pendingPullIntos[0];!0===mt(e,t)&&(xt(e),pt(e._controlledReadableByteStream,t))}}function kt(e,t){var r=e._pendingPullIntos[0];if("closed"===e._controlledReadableByteStream._state){if(0!==t)throw new TypeError("bytesWritten must be 0 when calling respond() on a closed stream");!function(e,t){t.buffer=j(t.buffer);var r=e._controlledReadableByteStream;if(!0===Le(r))for(;De(r)>0;)pt(r,xt(e))}(e,r)}else!function(e,t,r){if(r.bytesFilled+t>r.byteLength)throw new RangeError("bytesWritten out of range");if(vt(e,t,r),!(r.bytesFilled0){var a=r.byteOffset+r.bytesFilled,i=r.buffer.slice(a-n,a);yt(e,i,0,i.byteLength)}r.buffer=j(r.buffer),r.bytesFilled-=n,pt(e._controlledReadableByteStream,r),wt(e)}}(e,t,r);lt(e)}function xt(e){var t=e._pendingPullIntos.shift();return _t(e),t}function At(e){e._pullAlgorithm=void 0,e._cancelAlgorithm=void 0}function St(e,t){var r=e._controlledReadableByteStream;"readable"===r._state&&(ht(e),U(e),At(e),Oe(r,t))}function Et(e){var t=e._controlledReadableByteStream._state;return"errored"===t?null:"closed"===t?0:e._strategyHWM-e._queueTotalSize}function jt(e){if("object"!=(void 0===e?"undefined":(0,v.default)(e))||null===e)return!1;var t=(0,o.default)(AbortSignal.prototype,"aborted").get;try{return t.call(e),!0}catch(e){return!1}}function Mt(e){return new TypeError("ReadableStream.prototype."+e+" can only be used on a ReadableStream")}function Pt(e){return new TypeError("Cannot "+e+" a stream using a released reader")}function Ct(e){return new TypeError("ReadableStreamDefaultReader.prototype."+e+" can only be used on a ReadableStreamDefaultReader")}function Tt(e){e._closedPromise=new h.default(function(t,r){e._closedPromise_resolve=t,e._closedPromise_reject=r})}function Kt(e,t){Tt(e),Rt(e,t)}function Rt(e,t){e._closedPromise.catch(function(){}),e._closedPromise_reject(t),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0}function Bt(e){e._closedPromise_resolve(void 0),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0}function Ut(e){return new TypeError("ReadableStreamBYOBReader.prototype."+e+" can only be used on a ReadableStreamBYOBReader")}function It(e){return new TypeError("ReadableStreamDefaultController.prototype."+e+" can only be used on a ReadableStreamDefaultController")}function Ot(e){return new TypeError("ReadableStreamBYOBRequest.prototype."+e+" can only be used on a ReadableStreamBYOBRequest")}function zt(e){return new TypeError("ReadableByteStreamController.prototype."+e+" can only be used on a ReadableByteStreamController")}var Dt=function(){function e(t){var r=t.highWaterMark;(0,f.default)(this,e),g(this,"highWaterMark",r)}return(0,d.default)(e,[{key:"size",value:function(e){return e.byteLength}}]),e}(),Ft=function(){function e(t){var r=t.highWaterMark;(0,f.default)(this,e),g(this,"highWaterMark",r)}return(0,d.default)(e,[{key:"size",value:function(){return 1}}]),e}(),Lt=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};(0,f.default)(this,e);var a=r.size,i=r.highWaterMark,s=n.size,o=n.highWaterMark;if(void 0!==t.writableType)throw new RangeError("Invalid writable type specified");var u=P(a);if(void 0===i&&(i=1),i=M(i),void 0!==t.readableType)throw new RangeError("Invalid readable type specified");var d=P(s),l=void 0;void 0===o&&(o=0),o=M(o),function(e,t,r,n,a,i){function s(){return t}e._writable=function(e,t,r,n){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:function(){return 1},s=(0,c.default)(z.prototype);return F(s),ne(s,(0,c.default)(re.prototype),e,t,r,n,a,i),s}(s,function(t){return function(e,t){var r=e._transformStreamController;return!0===e._backpressure?e._backpressureChangePromise.then(function(){var n=e._writable;if("erroring"===n._state)throw n._storedError;return Xt(r,t)}):Xt(r,t)}(e,t)},function(){return function(e){var t=e._readable,r=e._transformStreamController,n=r._flushAlgorithm();return Vt(r),n.then(function(){if("errored"===t._state)throw t._storedError;var e=t._readableStreamController;!0===st(e)&&rt(e)}).catch(function(r){throw qt(e,r),t._storedError})}(e)},function(t){return function(e,t){return qt(e,t),h.default.resolve()}(e,t)},r,n),e._readable=je(s,function(){return function(e){return Ht(e,!1),e._backpressureChangePromise}(e)},function(t){return Gt(e,t),h.default.resolve()},a,i),e._backpressure=void 0,e._backpressureChangePromise=void 0,e._backpressureChangePromise_resolve=void 0,Ht(e,!0),e._transformStreamController=void 0}(this,new h.default(function(e){l=e}),i,u,o,d),function(e,t){var r=(0,c.default)(Wt.prototype),n=function(e){try{return Yt(r,e),h.default.resolve()}catch(e){return h.default.reject(e)}},a=t.transform;if(void 0!==a){if("function"!=typeof a)throw new TypeError("transform is not a method");n=function(e){return E(a,t,[e,r])}}var i=A(t,"flush",0,[r]);!function(e,t,r,n){t._controlledTransformStream=e,e._transformStreamController=t,t._transformAlgorithm=r,t._flushAlgorithm=n}(e,r,n,i)}(this,t);var p=S(t,"start",[this._transformStreamController]);l(p)}return(0,d.default)(e,[{key:"readable",get:function(){if(!1===Nt(this))throw $t("readable");return this._readable}},{key:"writable",get:function(){if(!1===Nt(this))throw $t("writable");return this._writable}}]),e}();function Nt(e){return!!i(e)&&!!Object.prototype.hasOwnProperty.call(e,"_transformStreamController")}function qt(e,t){at(e._readable._readableStreamController,t),Gt(e,t)}function Gt(e,t){Vt(e._transformStreamController),oe(e._writable._writableStreamController,t),!0===e._backpressure&&Ht(e,!1)}function Ht(e,t){void 0!==e._backpressureChangePromise&&e._backpressureChangePromise_resolve(),e._backpressureChangePromise=new h.default(function(t){e._backpressureChangePromise_resolve=t}),e._backpressure=t}var Wt=function(){function e(){throw(0,f.default)(this,e),new TypeError("TransformStreamDefaultController instances cannot be created directly")}return(0,d.default)(e,[{key:"enqueue",value:function(e){if(!1===Zt(this))throw Jt("enqueue");Yt(this,e)}},{key:"error",value:function(e){if(!1===Zt(this))throw Jt("error");!function(e,t){qt(e._controlledTransformStream,t)}(this,e)}},{key:"terminate",value:function(){if(!1===Zt(this))throw Jt("terminate");var e,t;e=this._controlledTransformStream,!0===st(t=e._readable._readableStreamController)&&rt(t),Gt(e,new TypeError("TransformStream terminated"))}},{key:"desiredSize",get:function(){if(!1===Zt(this))throw Jt("desiredSize");return it(this._controlledTransformStream._readable._readableStreamController)}}]),e}();function Zt(e){return!!i(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledTransformStream")}function Vt(e){e._transformAlgorithm=void 0,e._flushAlgorithm=void 0}function Yt(e,t){var r=e._controlledTransformStream,n=r._readable._readableStreamController;if(!1===st(n))throw new TypeError("Readable side is not in a state that permits enqueue");try{nt(n,t)}catch(e){throw Gt(r,e),r._readable._storedError}!0!==et(n)!==r._backpressure&&Ht(r,!0)}function Xt(e,t){return e._transformAlgorithm(t).catch(function(t){throw qt(e._controlledTransformStream,t),t})}function Jt(e){return new TypeError("TransformStreamDefaultController.prototype."+e+" can only be used on a TransformStreamDefaultController")}function $t(e){return new TypeError("TransformStream.prototype."+e+" can only be used on a TransformStream")}var Qt={ReadableStream:Se,WritableStream:z,ByteLengthQueuingStrategy:Dt,CountQueuingStrategy:Ft,TransformStream:Lt};void 0!==r&&(0,s.default)(r,Qt),e.ReadableStream=Se,e.WritableStream=z,e.ByteLengthQueuingStrategy=Dt,e.CountQueuingStrategy=Ft,e.TransformStream=Lt,Object.defineProperty(e,"__esModule",{value:!0})},"object"==(void 0===r?"undefined":(0,v.default)(r))&&void 0!==t?i(r):i((a=a||self).WebStreamsPolyfill={})}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"babel-runtime/core-js/get-iterator":17,"babel-runtime/core-js/number/is-integer":20,"babel-runtime/core-js/number/is-nan":21,"babel-runtime/core-js/object/assign":22,"babel-runtime/core-js/object/create":23,"babel-runtime/core-js/object/define-property":24,"babel-runtime/core-js/object/get-own-property-descriptor":26,"babel-runtime/core-js/promise":31,"babel-runtime/core-js/symbol":32,"babel-runtime/core-js/symbol/iterator":33,"babel-runtime/helpers/classCallCheck":36,"babel-runtime/helpers/createClass":37,"babel-runtime/helpers/typeof":42}],2:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.AES_asm=function(){var e,t,r=!1;function n(r,n){var a=e[(t[r]+t[n])%255];return 0!==r&&0!==n||(a=0),a}var a,i,s,o,u=!1;function c(){function c(r){var n,a,i;for(a=i=function(r){var n=e[255-t[r]];return 0===r&&(n=0),n}(r),n=0;n<4;n++)i^=a=255&(a<<1|a>>>7);return i^=99}r||function(){e=[],t=[];var n,a,i=1;for(n=0;n<255;n++)e[n]=i,a=128&i,i<<=1,i&=255,128===a&&(i^=27),i^=e[n],t[e[n]]=n;e[255]=e[0],t[0]=0,r=!0}(),a=[],i=[],s=[[],[],[],[]],o=[[],[],[],[]];for(var f=0;f<256;f++){var d=c(f);a[f]=d,i[d]=f,s[0][f]=n(2,d)<<24|d<<16|d<<8|n(3,d),o[0][d]=n(14,f)<<24|n(9,f)<<16|n(13,f)<<8|n(11,f);for(var l=1;l<4;l++)s[l][f]=s[l-1][f]>>>8|s[l-1][f]<<24,o[l][d]=o[l-1][d]>>>8|o[l-1][d]<<24}u=!0}var f=function(e,t){u||c();var r=new Uint32Array(t);r.set(a,512),r.set(i,768);for(var n=0;n<4;n++)r.set(s[n],4096+1024*n>>2),r.set(o[n],8192+1024*n>>2);var f=function(e,t,r){"use asm";var n=0,a=0,i=0,s=0,o=0,u=0,c=0,f=0,d=0,l=0,h=0,p=0,b=0,y=0,m=0,v=0,g=0,_=0,w=0,k=0,x=0;var A=new e.Uint32Array(r),S=new e.Uint8Array(r);function E(e,t,r,o,u,c,f,d){e=e|0;t=t|0;r=r|0;o=o|0;u=u|0;c=c|0;f=f|0;d=d|0;var l=0,h=0,p=0,b=0,y=0,m=0,v=0,g=0;l=r|0x400,h=r|0x800,p=r|0xc00;u=u^A[(e|0)>>2],c=c^A[(e|4)>>2],f=f^A[(e|8)>>2],d=d^A[(e|12)>>2];for(g=16;(g|0)<=o<<4;g=g+16|0){b=A[(r|u>>22&1020)>>2]^A[(l|c>>14&1020)>>2]^A[(h|f>>6&1020)>>2]^A[(p|d<<2&1020)>>2]^A[(e|g|0)>>2],y=A[(r|c>>22&1020)>>2]^A[(l|f>>14&1020)>>2]^A[(h|d>>6&1020)>>2]^A[(p|u<<2&1020)>>2]^A[(e|g|4)>>2],m=A[(r|f>>22&1020)>>2]^A[(l|d>>14&1020)>>2]^A[(h|u>>6&1020)>>2]^A[(p|c<<2&1020)>>2]^A[(e|g|8)>>2],v=A[(r|d>>22&1020)>>2]^A[(l|u>>14&1020)>>2]^A[(h|c>>6&1020)>>2]^A[(p|f<<2&1020)>>2]^A[(e|g|12)>>2];u=b,c=y,f=m,d=v}n=A[(t|u>>22&1020)>>2]<<24^A[(t|c>>14&1020)>>2]<<16^A[(t|f>>6&1020)>>2]<<8^A[(t|d<<2&1020)>>2]^A[(e|g|0)>>2],a=A[(t|c>>22&1020)>>2]<<24^A[(t|f>>14&1020)>>2]<<16^A[(t|d>>6&1020)>>2]<<8^A[(t|u<<2&1020)>>2]^A[(e|g|4)>>2],i=A[(t|f>>22&1020)>>2]<<24^A[(t|d>>14&1020)>>2]<<16^A[(t|u>>6&1020)>>2]<<8^A[(t|c<<2&1020)>>2]^A[(e|g|8)>>2],s=A[(t|d>>22&1020)>>2]<<24^A[(t|u>>14&1020)>>2]<<16^A[(t|c>>6&1020)>>2]<<8^A[(t|f<<2&1020)>>2]^A[(e|g|12)>>2]}function j(e,t,r,n){e=e|0;t=t|0;r=r|0;n=n|0;E(0x0000,0x0800,0x1000,x,e,t,r,n)}function M(e,t,r,n){e=e|0;t=t|0;r=r|0;n=n|0;var i=0;E(0x0400,0x0c00,0x2000,x,e,n,r,t);i=a,a=s,s=i}function P(e,t,r,d){e=e|0;t=t|0;r=r|0;d=d|0;E(0x0000,0x0800,0x1000,x,o^e,u^t,c^r,f^d);o=n,u=a,c=i,f=s}function C(e,t,r,d){e=e|0;t=t|0;r=r|0;d=d|0;var l=0;E(0x0400,0x0c00,0x2000,x,e,d,r,t);l=a,a=s,s=l;n=n^o,a=a^u,i=i^c,s=s^f;o=e,u=t,c=r,f=d}function T(e,t,r,d){e=e|0;t=t|0;r=r|0;d=d|0;E(0x0000,0x0800,0x1000,x,o,u,c,f);o=n=n^e,u=a=a^t,c=i=i^r,f=s=s^d}function K(e,t,r,d){e=e|0;t=t|0;r=r|0;d=d|0;E(0x0000,0x0800,0x1000,x,o,u,c,f);n=n^e,a=a^t,i=i^r,s=s^d;o=e,u=t,c=r,f=d}function R(e,t,r,d){e=e|0;t=t|0;r=r|0;d=d|0;E(0x0000,0x0800,0x1000,x,o,u,c,f);o=n,u=a,c=i,f=s;n=n^e,a=a^t,i=i^r,s=s^d}function B(e,t,r,o){e=e|0;t=t|0;r=r|0;o=o|0;E(0x0000,0x0800,0x1000,x,d,l,h,p);p=~v&p|v&p+1;h=~m&h|m&h+((p|0)==0);l=~y&l|y&l+((h|0)==0);d=~b&d|b&d+((l|0)==0);n=n^e;a=a^t;i=i^r;s=s^o}function U(e,t,r,n){e=e|0;t=t|0;r=r|0;n=n|0;var a=0,i=0,s=0,d=0,l=0,h=0,p=0,b=0,y=0,m=0;e=e^o,t=t^u,r=r^c,n=n^f;a=g|0,i=_|0,s=w|0,d=k|0;for(;(y|0)<128;y=y+1|0){if(a>>>31){l=l^e,h=h^t,p=p^r,b=b^n}a=a<<1|i>>>31,i=i<<1|s>>>31,s=s<<1|d>>>31,d=d<<1;m=n&1;n=n>>>1|r<<31,r=r>>>1|t<<31,t=t>>>1|e<<31,e=e>>>1;if(m)e=e^0xe1000000}o=l,u=h,c=p,f=b}function I(e){e=e|0;x=e}function O(e,t,r,o){e=e|0;t=t|0;r=r|0;o=o|0;n=e,a=t,i=r,s=o}function z(e,t,r,n){e=e|0;t=t|0;r=r|0;n=n|0;o=e,u=t,c=r,f=n}function D(e,t,r,n){e=e|0;t=t|0;r=r|0;n=n|0;d=e,l=t,h=r,p=n}function F(e,t,r,n){e=e|0;t=t|0;r=r|0;n=n|0;b=e,y=t,m=r,v=n}function L(e,t,r,n){e=e|0;t=t|0;r=r|0;n=n|0;p=~v&p|v&n,h=~m&h|m&r,l=~y&l|y&t,d=~b&d|b&e}function N(e){e=e|0;if(e&15)return-1;S[e|0]=n>>>24,S[e|1]=n>>>16&255,S[e|2]=n>>>8&255,S[e|3]=n&255,S[e|4]=a>>>24,S[e|5]=a>>>16&255,S[e|6]=a>>>8&255,S[e|7]=a&255,S[e|8]=i>>>24,S[e|9]=i>>>16&255,S[e|10]=i>>>8&255,S[e|11]=i&255,S[e|12]=s>>>24,S[e|13]=s>>>16&255,S[e|14]=s>>>8&255,S[e|15]=s&255;return 16}function q(e){e=e|0;if(e&15)return-1;S[e|0]=o>>>24,S[e|1]=o>>>16&255,S[e|2]=o>>>8&255,S[e|3]=o&255,S[e|4]=u>>>24,S[e|5]=u>>>16&255,S[e|6]=u>>>8&255,S[e|7]=u&255,S[e|8]=c>>>24,S[e|9]=c>>>16&255,S[e|10]=c>>>8&255,S[e|11]=c&255,S[e|12]=f>>>24,S[e|13]=f>>>16&255,S[e|14]=f>>>8&255,S[e|15]=f&255;return 16}function G(){j(0,0,0,0);g=n,_=a,w=i,k=s}function H(e,t,r){e=e|0;t=t|0;r=r|0;var o=0;if(t&15)return-1;while((r|0)>=16){Z[e&7](S[t|0]<<24|S[t|1]<<16|S[t|2]<<8|S[t|3],S[t|4]<<24|S[t|5]<<16|S[t|6]<<8|S[t|7],S[t|8]<<24|S[t|9]<<16|S[t|10]<<8|S[t|11],S[t|12]<<24|S[t|13]<<16|S[t|14]<<8|S[t|15]);S[t|0]=n>>>24,S[t|1]=n>>>16&255,S[t|2]=n>>>8&255,S[t|3]=n&255,S[t|4]=a>>>24,S[t|5]=a>>>16&255,S[t|6]=a>>>8&255,S[t|7]=a&255,S[t|8]=i>>>24,S[t|9]=i>>>16&255,S[t|10]=i>>>8&255,S[t|11]=i&255,S[t|12]=s>>>24,S[t|13]=s>>>16&255,S[t|14]=s>>>8&255,S[t|15]=s&255;o=o+16|0,t=t+16|0,r=r-16|0}return o|0}function W(e,t,r){e=e|0;t=t|0;r=r|0;var n=0;if(t&15)return-1;while((r|0)>=16){V[e&1](S[t|0]<<24|S[t|1]<<16|S[t|2]<<8|S[t|3],S[t|4]<<24|S[t|5]<<16|S[t|6]<<8|S[t|7],S[t|8]<<24|S[t|9]<<16|S[t|10]<<8|S[t|11],S[t|12]<<24|S[t|13]<<16|S[t|14]<<8|S[t|15]);n=n+16|0,t=t+16|0,r=r-16|0}return n|0}var Z=[j,M,P,C,T,K,R,B];var V=[P,U];return{set_rounds:I,set_state:O,set_iv:z,set_nonce:D,set_mask:F,set_counter:L,get_state:N,get_iv:q,gcm_init:G,cipher:H,mac:W}}({Uint8Array:Uint8Array,Uint32Array:Uint32Array},e,t);return f.set_key=function(e,t,n,i,s,u,c,d,l){var h=r.subarray(0,60),p=r.subarray(256,316);h.set([t,n,i,s,u,c,d,l]);for(var b=e,y=1;b<4*e+28;b++){var m=h[b-1];(b%e==0||8===e&&b%e==4)&&(m=a[m>>>24]<<24^a[m>>>16&255]<<16^a[m>>>8&255]<<8^a[255&m]),b%e==0&&(m=m<<8^m>>>24^y<<24,y=y<<1^(128&y?27:0)),h[b]=h[b-e]^m}for(var v=0;v=b-4?m:o[0][a[m>>>24]]^o[1][a[m>>>16&255]]^o[2][a[m>>>8&255]]^o[3][a[255&m]];f.set_rounds(e+5)},f};return f.ENC={ECB:0,CBC:2,CFB:4,OFB:6,CTR:7},f.DEC={ECB:1,CBC:3,CFB:5,OFB:6,CTR:7},f.MAC={CBC:0,GCM:1},f.HEAP_DATA=16384,f}()},{}],3:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.AES=void 0;var n=e("./aes.asm"),a=e("../other/utils"),i=e("../other/errors"),s=[],o=[],u=function(){function e(e,t,r,n){void 0===r&&(r=!0),this.pos=0,this.len=0,this.mode=n,this.pos=0,this.len=0,this.key=e,this.iv=t,this.padding=r,this.acquire_asm()}return e.prototype.acquire_asm=function(){void 0===this.heap&&void 0===this.asm&&(this.heap=s.pop()||(0,a._heap_init)().subarray(n.AES_asm.HEAP_DATA),this.asm=o.pop()||(0,n.AES_asm)(null,this.heap.buffer),this.reset(this.key,this.iv))},e.prototype.release_asm=function(){s.push(this.heap),o.push(this.asm),this.heap=void 0,this.asm=void 0},e.prototype.reset=function(e,t){var r=e.length;if(16!==r&&24!==r&&32!==r)throw new i.IllegalArgumentError("illegal key size");var n=new DataView(e.buffer,e.byteOffset,e.byteLength);if(this.asm.set_key(r>>2,n.getUint32(0),n.getUint32(4),n.getUint32(8),n.getUint32(12),r>16?n.getUint32(16):0,r>16?n.getUint32(20):0,r>24?n.getUint32(24):0,r>24?n.getUint32(28):0),void 0!==t){if(16!==t.length)throw new i.IllegalArgumentError("illegal iv size");var a=new DataView(t.buffer,t.byteOffset,t.byteLength);this.asm.set_iv(a.getUint32(0),a.getUint32(4),a.getUint32(8),a.getUint32(12))}else this.asm.set_iv(0,0,0,0)},e.prototype.AES_Encrypt_process=function(e){if(!(0,a.is_bytes)(e))throw new TypeError("data isn't of expected type");this.acquire_asm();for(var t=this.asm,r=this.heap,i=n.AES_asm.ENC[this.mode],s=n.AES_asm.HEAP_DATA,o=this.pos,u=this.len,c=0,f=e.length||0,d=0,l=0,h=new Uint8Array(u+f&-16);f>0;)u+=l=(0,a._heap_write)(r,o+u,e,c,f),c+=l,f-=l,(l=t.cipher(i,s+o,u))&&h.set(r.subarray(o,o+l),d),d+=l,l0;)u+=p=(0,a._heap_write)(r,o+u,e,c,f),c+=p,f-=p,(p=t.cipher(i,s+o,u-(f?0:h)))&&b.set(r.subarray(o,o+p),d),d+=p,p0){if(o%16){if(this.hasOwnProperty("padding"))throw new i.IllegalArgumentError("data length must be a multiple of the block size");o+=16-o%16}if(e.cipher(r,a+s,o),this.hasOwnProperty("padding")&&this.padding){var c=t[s+u-1];if(c<1||c>16||c>u)throw new i.SecurityError("bad padding");for(var f=0,d=c;d>1;d--)f|=c^t[s+u-d];if(f)throw new i.SecurityError("bad padding");u-=c}}var l=new Uint8Array(u);return u>0&&l.set(t.subarray(s,s+u)),this.pos=0,this.len=0,this.release_asm(),l},e}();r.AES=u},{"../other/errors":14,"../other/utils":15,"./aes.asm":2}],4:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.AES_CBC=void 0;var n=o(e("babel-runtime/core-js/object/create")),a=o(e("babel-runtime/core-js/object/set-prototype-of")),i=e("./aes"),s=e("../other/utils");function o(e){return e&&e.__esModule?e:{default:e}}var u,c=(u=a.default||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},function(e,t){function r(){this.constructor=e}u(e,t),e.prototype=null===t?(0,n.default)(t):(r.prototype=t.prototype,new r)}),f=function(e){function t(t,r,n){return void 0===n&&(n=!0),e.call(this,t,r,n,"CBC")||this}return c(t,e),t.encrypt=function(e,r,n,a){return void 0===n&&(n=!0),new t(r,a,n).encrypt(e)},t.decrypt=function(e,r,n,a){return void 0===n&&(n=!0),new t(r,a,n).decrypt(e)},t.prototype.encrypt=function(e){var t=this.AES_Encrypt_process(e),r=this.AES_Encrypt_finish();return(0,s.joinBytes)(t,r)},t.prototype.decrypt=function(e){var t=this.AES_Decrypt_process(e),r=this.AES_Decrypt_finish();return(0,s.joinBytes)(t,r)},t}(i.AES);r.AES_CBC=f},{"../other/utils":15,"./aes":3,"babel-runtime/core-js/object/create":23,"babel-runtime/core-js/object/set-prototype-of":29}],5:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.AES_CFB=void 0;var n=o(e("babel-runtime/core-js/object/create")),a=o(e("babel-runtime/core-js/object/set-prototype-of")),i=e("./aes"),s=e("../other/utils");function o(e){return e&&e.__esModule?e:{default:e}}var u,c=(u=a.default||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},function(e,t){function r(){this.constructor=e}u(e,t),e.prototype=null===t?(0,n.default)(t):(r.prototype=t.prototype,new r)}),f=function(e){function t(t,r){var n=e.call(this,t,r,!0,"CFB")||this;return delete n.padding,n}return c(t,e),t.encrypt=function(e,r,n){return new t(r,n).encrypt(e)},t.decrypt=function(e,r,n){return new t(r,n).decrypt(e)},t.prototype.encrypt=function(e){var t=this.AES_Encrypt_process(e),r=this.AES_Encrypt_finish();return(0,s.joinBytes)(t,r)},t.prototype.decrypt=function(e){var t=this.AES_Decrypt_process(e),r=this.AES_Decrypt_finish();return(0,s.joinBytes)(t,r)},t}(i.AES);r.AES_CFB=f},{"../other/utils":15,"./aes":3,"babel-runtime/core-js/object/create":23,"babel-runtime/core-js/object/set-prototype-of":29}],6:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.AES_CTR=void 0;var n=u(e("babel-runtime/core-js/object/create")),a=u(e("babel-runtime/core-js/object/set-prototype-of")),i=e("./aes"),s=e("../other/errors"),o=e("../other/utils");function u(e){return e&&e.__esModule?e:{default:e}}var c,f=(c=a.default||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},function(e,t){function r(){this.constructor=e}c(e,t),e.prototype=null===t?(0,n.default)(t):(r.prototype=t.prototype,new r)}),d=function(e){function t(t,r){var n=e.call(this,t,void 0,!1,"CTR")||this;return delete n.padding,n.AES_CTR_set_options(r),n}return f(t,e),t.encrypt=function(e,r,n){return new t(r,n).encrypt(e)},t.decrypt=function(e,r,n){return new t(r,n).encrypt(e)},t.prototype.encrypt=function(e){var t=this.AES_Encrypt_process(e),r=this.AES_Encrypt_finish();return(0,o.joinBytes)(t,r)},t.prototype.decrypt=function(e){var t=this.AES_Encrypt_process(e),r=this.AES_Encrypt_finish();return(0,o.joinBytes)(t,r)},t.prototype.AES_CTR_set_options=function(e,t,r){if(void 0!==r){if(r<8||r>48)throw new s.IllegalArgumentError("illegal counter size");var n=Math.pow(2,r)-1;this.asm.set_mask(0,0,n/4294967296|0,0|n)}else r=48,this.asm.set_mask(0,0,65535,4294967295);if(void 0===e)throw new Error("nonce is required");var a=e.length;if(!a||a>16)throw new s.IllegalArgumentError("illegal nonce size");var i=new DataView(new ArrayBuffer(16));if(new Uint8Array(i.buffer).set(e),this.asm.set_nonce(i.getUint32(0),i.getUint32(4),i.getUint32(8),i.getUint32(12)),void 0!==t){if(t<0||t>=Math.pow(2,r))throw new s.IllegalArgumentError("illegal counter value");this.asm.set_counter(0,0,t/4294967296|0,0|t)}},t}(i.AES);r.AES_CTR=d},{"../other/errors":14,"../other/utils":15,"./aes":3,"babel-runtime/core-js/object/create":23,"babel-runtime/core-js/object/set-prototype-of":29}],7:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.AES_ECB=void 0;var n=o(e("babel-runtime/core-js/object/create")),a=o(e("babel-runtime/core-js/object/set-prototype-of")),i=e("./aes"),s=e("../other/utils");function o(e){return e&&e.__esModule?e:{default:e}}var u,c=(u=a.default||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},function(e,t){function r(){this.constructor=e}u(e,t),e.prototype=null===t?(0,n.default)(t):(r.prototype=t.prototype,new r)}),f=function(e){function t(t,r){return void 0===r&&(r=!1),e.call(this,t,void 0,r,"ECB")||this}return c(t,e),t.encrypt=function(e,r,n){return void 0===n&&(n=!1),new t(r,n).encrypt(e)},t.decrypt=function(e,r,n){return void 0===n&&(n=!1),new t(r,n).decrypt(e)},t.prototype.encrypt=function(e){var t=this.AES_Encrypt_process(e),r=this.AES_Encrypt_finish();return(0,s.joinBytes)(t,r)},t.prototype.decrypt=function(e){var t=this.AES_Decrypt_process(e),r=this.AES_Decrypt_finish();return(0,s.joinBytes)(t,r)},t}(i.AES);r.AES_ECB=f},{"../other/utils":15,"./aes":3,"babel-runtime/core-js/object/create":23,"babel-runtime/core-js/object/set-prototype-of":29}],8:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.AES_GCM=void 0;var n=c(e("babel-runtime/core-js/object/create")),a=c(e("babel-runtime/core-js/object/set-prototype-of")),i=e("../other/errors"),s=e("../other/utils"),o=e("./aes"),u=e("./aes.asm");function c(e){return e&&e.__esModule?e:{default:e}}var f,d=(f=a.default||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},function(e,t){function r(){this.constructor=e}f(e,t),e.prototype=null===t?(0,n.default)(t):(r.prototype=t.prototype,new r)}),l=68719476704,h=function(e){function t(t,r,n,a){void 0===a&&(a=16);var s=e.call(this,t,void 0,!1,"CTR")||this;if(s.tagSize=a,s.gamma0=0,s.counter=1,s.asm.gcm_init(),s.tagSize<4||s.tagSize>16)throw new i.IllegalArgumentError("illegal tagSize value");var o=r.length||0,c=new Uint8Array(16);12!==o?(s._gcm_mac_process(r),s.heap[0]=0,s.heap[1]=0,s.heap[2]=0,s.heap[3]=0,s.heap[4]=0,s.heap[5]=0,s.heap[6]=0,s.heap[7]=0,s.heap[8]=0,s.heap[9]=0,s.heap[10]=0,s.heap[11]=o>>>29,s.heap[12]=o>>>21&255,s.heap[13]=o>>>13&255,s.heap[14]=o>>>5&255,s.heap[15]=o<<3&255,s.asm.mac(u.AES_asm.MAC.GCM,u.AES_asm.HEAP_DATA,16),s.asm.get_iv(u.AES_asm.HEAP_DATA),s.asm.set_iv(0,0,0,0),c.set(s.heap.subarray(0,16))):(c.set(r),c[15]=1);var f=new DataView(c.buffer);if(s.gamma0=f.getUint32(12),s.asm.set_nonce(f.getUint32(0),f.getUint32(4),f.getUint32(8),0),s.asm.set_mask(0,0,0,4294967295),void 0!==n){if(n.length>l)throw new i.IllegalArgumentError("illegal adata length");n.length?(s.adata=n,s._gcm_mac_process(n)):s.adata=void 0}else s.adata=void 0;if(s.counter<1||s.counter>4294967295)throw new RangeError("counter must be a positive 32-bit integer");return s.asm.set_counter(0,0,0,s.gamma0+s.counter|0),s}return d(t,e),t.encrypt=function(e,r,n,a,i){return new t(r,n,a,i).encrypt(e)},t.decrypt=function(e,r,n,a,i){return new t(r,n,a,i).decrypt(e)},t.prototype.encrypt=function(e){return this.AES_GCM_encrypt(e)},t.prototype.decrypt=function(e){return this.AES_GCM_decrypt(e)},t.prototype.AES_GCM_Encrypt_process=function(e){var t=0,r=e.length||0,n=this.asm,a=this.heap,i=this.counter,o=this.pos,c=this.len,f=0,d=c+r&-16,h=0;if((i-1<<4)+c+r>l)throw new RangeError("counter overflow");for(var p=new Uint8Array(d);r>0;)c+=h=(0,s._heap_write)(a,o+c,e,t,r),t+=h,r-=h,h=n.cipher(u.AES_asm.ENC.CTR,u.AES_asm.HEAP_DATA+o,c),(h=n.mac(u.AES_asm.MAC.GCM,u.AES_asm.HEAP_DATA+o,h))&&p.set(a.subarray(o,o+h),f),i+=h>>>4,f+=h,h>>29,t[4]=f>>>21,t[5]=f>>>13&255,t[6]=f>>>5&255,t[7]=f<<3&255,t[8]=t[9]=t[10]=0,t[11]=d>>>29,t[12]=d>>>21&255,t[13]=d>>>13&255,t[14]=d>>>5&255,t[15]=d<<3&255,e.mac(u.AES_asm.MAC.GCM,u.AES_asm.HEAP_DATA,16),e.get_iv(u.AES_asm.HEAP_DATA),e.set_counter(0,0,0,this.gamma0),e.cipher(u.AES_asm.ENC.CTR,u.AES_asm.HEAP_DATA,16),o.set(t.subarray(0,n),s),this.counter=1,this.pos=0,this.len=0,o},t.prototype.AES_GCM_Decrypt_process=function(e){var t=0,r=e.length||0,n=this.asm,a=this.heap,i=this.counter,o=this.tagSize,c=this.pos,f=this.len,d=0,h=f+r>o?f+r-o&-16:0,p=f+r-h,b=0;if((i-1<<4)+f+r>l)throw new RangeError("counter overflow");for(var y=new Uint8Array(h);r>p;)f+=b=(0,s._heap_write)(a,c+f,e,t,r-p),t+=b,r-=b,b=n.mac(u.AES_asm.MAC.GCM,u.AES_asm.HEAP_DATA+c,b),(b=n.cipher(u.AES_asm.DEC.CTR,u.AES_asm.HEAP_DATA+c,b))&&y.set(a.subarray(c,c+b),d),i+=b>>>4,d+=b,c=0,f=0;return r>0&&(f+=(0,s._heap_write)(a,0,e,t,r)),this.counter=i,this.pos=c,this.len=f,y},t.prototype.AES_GCM_Decrypt_finish=function(){var e=this.asm,t=this.heap,r=this.tagSize,n=this.adata,a=this.counter,s=this.pos,o=this.len,c=o-r;if(o>>29,t[4]=h>>>21,t[5]=h>>>13&255,t[6]=h>>>5&255,t[7]=h<<3&255,t[8]=t[9]=t[10]=0,t[11]=p>>>29,t[12]=p>>>21&255,t[13]=p>>>13&255,t[14]=p>>>5&255,t[15]=p<<3&255,e.mac(u.AES_asm.MAC.GCM,u.AES_asm.HEAP_DATA,16),e.get_iv(u.AES_asm.HEAP_DATA),e.set_counter(0,0,0,this.gamma0),e.cipher(u.AES_asm.ENC.CTR,u.AES_asm.HEAP_DATA,16);for(var b=0,y=0;y0;){for(n+=i=(0,s._heap_write)(t,0,e,n,a),a-=i;15&i;)t[i++]=0;r.mac(u.AES_asm.MAC.GCM,u.AES_asm.HEAP_DATA,i)}},t}(o.AES);r.AES_GCM=h},{"../other/errors":14,"../other/utils":15,"./aes":3,"./aes.asm":2,"babel-runtime/core-js/object/create":23,"babel-runtime/core-js/object/set-prototype-of":29}],9:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.Hash=void 0;var n=e("../other/utils"),a=e("../other/errors"),i=function(){function e(){this.pos=0,this.len=0,this.acquire_asm()}return e.prototype.acquire_asm=function(){void 0===this.heap&&void 0===this.asm&&(this.heap=this.constructor.heap_pool.pop()||(0,n._heap_init)(),this.asm=this.constructor.asm_pool.pop()||this.constructor.asm_function({Uint8Array:Uint8Array},null,this.heap.buffer),this.reset())},e.prototype.release_asm=function(){this.constructor.heap_pool.push(this.heap),this.constructor.asm_pool.push(this.asm),this.heap=void 0,this.asm=void 0},e.prototype.reset=function(){return this.acquire_asm(),this.result=null,this.pos=0,this.len=0,this.asm.reset(),this},e.prototype.process=function(e){if(null!==this.result)throw new a.IllegalStateError("state must be reset before processing new data");this.acquire_asm();for(var t=this.asm,r=this.heap,i=this.pos,s=this.len,o=0,u=e.length,c=0;u>0;)s+=c=(0,n._heap_write)(r,i+s,e,o,u),o+=c,u-=c,i+=c=t.process(i,s),(s-=c)||(i=0);return this.pos=i,this.len=s,this},e.prototype.finish=function(){if(null!==this.result)throw new a.IllegalStateError("state must be reset before processing new data");return this.acquire_asm(),this.asm.finish(this.pos,this.len,0),this.result=new Uint8Array(this.HASH_SIZE),this.result.set(this.heap.subarray(0,this.HASH_SIZE)),this.pos=0,this.len=0,this.release_asm(),this},e}();r.Hash=i},{"../other/errors":14,"../other/utils":15}],10:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.sha1_asm=function(e,t,r){"use asm";var n=0,a=0,i=0,s=0,o=0,u=0,c=0,f=0,d=0,l=0,h=0,p=0,b=0,y=0,m=0,v=0,g=0,_=new e.Uint8Array(r);function w(e,t,r,u,c,f,d,l,h,p,b,y,m,v,g,_){e=e|0;t=t|0;r=r|0;u=u|0;c=c|0;f=f|0;d=d|0;l=l|0;h=h|0;p=p|0;b=b|0;y=y|0;m=m|0;v=v|0;g=g|0;_=_|0;var w=0,k=0,x=0,A=0,S=0,E=0,j=0,M=0,P=0,C=0,T=0,K=0,R=0,B=0,U=0,I=0,O=0,z=0,D=0,F=0,L=0,N=0,q=0,G=0,H=0,W=0,Z=0,V=0,Y=0,X=0,J=0,$=0,Q=0,ee=0,te=0,re=0,ne=0,ae=0,ie=0,se=0,oe=0,ue=0,ce=0,fe=0,de=0,le=0,he=0,pe=0,be=0,ye=0,me=0,ve=0,ge=0,_e=0,we=0,ke=0,xe=0,Ae=0,Se=0,Ee=0,je=0,Me=0,Pe=0,Ce=0,Te=0,Ke=0,Re=0,Be=0,Ue=0,Ie=0,Oe=0;w=n;k=a;x=i;A=s;S=o;j=e+(w<<5|w>>>27)+S+(k&x|~k&A)+0x5a827999|0;S=A;A=x;x=k<<30|k>>>2;k=w;w=j;j=t+(w<<5|w>>>27)+S+(k&x|~k&A)+0x5a827999|0;S=A;A=x;x=k<<30|k>>>2;k=w;w=j;j=r+(w<<5|w>>>27)+S+(k&x|~k&A)+0x5a827999|0;S=A;A=x;x=k<<30|k>>>2;k=w;w=j;j=u+(w<<5|w>>>27)+S+(k&x|~k&A)+0x5a827999|0;S=A;A=x;x=k<<30|k>>>2;k=w;w=j;j=c+(w<<5|w>>>27)+S+(k&x|~k&A)+0x5a827999|0;S=A;A=x;x=k<<30|k>>>2;k=w;w=j;j=f+(w<<5|w>>>27)+S+(k&x|~k&A)+0x5a827999|0;S=A;A=x;x=k<<30|k>>>2;k=w;w=j;j=d+(w<<5|w>>>27)+S+(k&x|~k&A)+0x5a827999|0;S=A;A=x;x=k<<30|k>>>2;k=w;w=j;j=l+(w<<5|w>>>27)+S+(k&x|~k&A)+0x5a827999|0;S=A;A=x;x=k<<30|k>>>2;k=w;w=j;j=h+(w<<5|w>>>27)+S+(k&x|~k&A)+0x5a827999|0;S=A;A=x;x=k<<30|k>>>2;k=w;w=j;j=p+(w<<5|w>>>27)+S+(k&x|~k&A)+0x5a827999|0;S=A;A=x;x=k<<30|k>>>2;k=w;w=j;j=b+(w<<5|w>>>27)+S+(k&x|~k&A)+0x5a827999|0;S=A;A=x;x=k<<30|k>>>2;k=w;w=j;j=y+(w<<5|w>>>27)+S+(k&x|~k&A)+0x5a827999|0;S=A;A=x;x=k<<30|k>>>2;k=w;w=j;j=m+(w<<5|w>>>27)+S+(k&x|~k&A)+0x5a827999|0;S=A;A=x;x=k<<30|k>>>2;k=w;w=j;j=v+(w<<5|w>>>27)+S+(k&x|~k&A)+0x5a827999|0;S=A;A=x;x=k<<30|k>>>2;k=w;w=j;j=g+(w<<5|w>>>27)+S+(k&x|~k&A)+0x5a827999|0;S=A;A=x;x=k<<30|k>>>2;k=w;w=j;j=_+(w<<5|w>>>27)+S+(k&x|~k&A)+0x5a827999|0;S=A;A=x;x=k<<30|k>>>2;k=w;w=j;E=v^h^r^e;M=E<<1|E>>>31;j=M+(w<<5|w>>>27)+S+(k&x|~k&A)+0x5a827999|0;S=A;A=x;x=k<<30|k>>>2;k=w;w=j;E=g^p^u^t;P=E<<1|E>>>31;j=P+(w<<5|w>>>27)+S+(k&x|~k&A)+0x5a827999|0;S=A;A=x;x=k<<30|k>>>2;k=w;w=j;E=_^b^c^r;C=E<<1|E>>>31;j=C+(w<<5|w>>>27)+S+(k&x|~k&A)+0x5a827999|0;S=A;A=x;x=k<<30|k>>>2;k=w;w=j;E=M^y^f^u;T=E<<1|E>>>31;j=T+(w<<5|w>>>27)+S+(k&x|~k&A)+0x5a827999|0;S=A;A=x;x=k<<30|k>>>2;k=w;w=j;E=P^m^d^c;K=E<<1|E>>>31;j=K+(w<<5|w>>>27)+S+(k^x^A)+0x6ed9eba1|0;S=A;A=x;x=k<<30|k>>>2;k=w;w=j;E=C^v^l^f;R=E<<1|E>>>31;j=R+(w<<5|w>>>27)+S+(k^x^A)+0x6ed9eba1|0;S=A;A=x;x=k<<30|k>>>2;k=w;w=j;E=T^g^h^d;B=E<<1|E>>>31;j=B+(w<<5|w>>>27)+S+(k^x^A)+0x6ed9eba1|0;S=A;A=x;x=k<<30|k>>>2;k=w;w=j;E=K^_^p^l;U=E<<1|E>>>31;j=U+(w<<5|w>>>27)+S+(k^x^A)+0x6ed9eba1|0;S=A;A=x;x=k<<30|k>>>2;k=w;w=j;E=R^M^b^h;I=E<<1|E>>>31;j=I+(w<<5|w>>>27)+S+(k^x^A)+0x6ed9eba1|0;S=A;A=x;x=k<<30|k>>>2;k=w;w=j;E=B^P^y^p;O=E<<1|E>>>31;j=O+(w<<5|w>>>27)+S+(k^x^A)+0x6ed9eba1|0;S=A;A=x;x=k<<30|k>>>2;k=w;w=j;E=U^C^m^b;z=E<<1|E>>>31;j=z+(w<<5|w>>>27)+S+(k^x^A)+0x6ed9eba1|0;S=A;A=x;x=k<<30|k>>>2;k=w;w=j;E=I^T^v^y;D=E<<1|E>>>31;j=D+(w<<5|w>>>27)+S+(k^x^A)+0x6ed9eba1|0;S=A;A=x;x=k<<30|k>>>2;k=w;w=j;E=O^K^g^m;F=E<<1|E>>>31;j=F+(w<<5|w>>>27)+S+(k^x^A)+0x6ed9eba1|0;S=A;A=x;x=k<<30|k>>>2;k=w;w=j;E=z^R^_^v;L=E<<1|E>>>31;j=L+(w<<5|w>>>27)+S+(k^x^A)+0x6ed9eba1|0;S=A;A=x;x=k<<30|k>>>2;k=w;w=j;E=D^B^M^g;N=E<<1|E>>>31;j=N+(w<<5|w>>>27)+S+(k^x^A)+0x6ed9eba1|0;S=A;A=x;x=k<<30|k>>>2;k=w;w=j;E=F^U^P^_;q=E<<1|E>>>31;j=q+(w<<5|w>>>27)+S+(k^x^A)+0x6ed9eba1|0;S=A;A=x;x=k<<30|k>>>2;k=w;w=j;E=L^I^C^M;G=E<<1|E>>>31;j=G+(w<<5|w>>>27)+S+(k^x^A)+0x6ed9eba1|0;S=A;A=x;x=k<<30|k>>>2;k=w;w=j;E=N^O^T^P;H=E<<1|E>>>31;j=H+(w<<5|w>>>27)+S+(k^x^A)+0x6ed9eba1|0;S=A;A=x;x=k<<30|k>>>2;k=w;w=j;E=q^z^K^C;W=E<<1|E>>>31;j=W+(w<<5|w>>>27)+S+(k^x^A)+0x6ed9eba1|0;S=A;A=x;x=k<<30|k>>>2;k=w;w=j;E=G^D^R^T;Z=E<<1|E>>>31;j=Z+(w<<5|w>>>27)+S+(k^x^A)+0x6ed9eba1|0;S=A;A=x;x=k<<30|k>>>2;k=w;w=j;E=H^F^B^K;V=E<<1|E>>>31;j=V+(w<<5|w>>>27)+S+(k^x^A)+0x6ed9eba1|0;S=A;A=x;x=k<<30|k>>>2;k=w;w=j;E=W^L^U^R;Y=E<<1|E>>>31;j=Y+(w<<5|w>>>27)+S+(k^x^A)+0x6ed9eba1|0;S=A;A=x;x=k<<30|k>>>2;k=w;w=j;E=Z^N^I^B;X=E<<1|E>>>31;j=X+(w<<5|w>>>27)+S+(k^x^A)+0x6ed9eba1|0;S=A;A=x;x=k<<30|k>>>2;k=w;w=j;E=V^q^O^U;J=E<<1|E>>>31;j=J+(w<<5|w>>>27)+S+(k^x^A)+0x6ed9eba1|0;S=A;A=x;x=k<<30|k>>>2;k=w;w=j;E=Y^G^z^I;$=E<<1|E>>>31;j=$+(w<<5|w>>>27)+S+(k&x|k&A|x&A)-0x70e44324|0;S=A;A=x;x=k<<30|k>>>2;k=w;w=j;E=X^H^D^O;Q=E<<1|E>>>31;j=Q+(w<<5|w>>>27)+S+(k&x|k&A|x&A)-0x70e44324|0;S=A;A=x;x=k<<30|k>>>2;k=w;w=j;E=J^W^F^z;ee=E<<1|E>>>31;j=ee+(w<<5|w>>>27)+S+(k&x|k&A|x&A)-0x70e44324|0;S=A;A=x;x=k<<30|k>>>2;k=w;w=j;E=$^Z^L^D;te=E<<1|E>>>31;j=te+(w<<5|w>>>27)+S+(k&x|k&A|x&A)-0x70e44324|0;S=A;A=x;x=k<<30|k>>>2;k=w;w=j;E=Q^V^N^F;re=E<<1|E>>>31;j=re+(w<<5|w>>>27)+S+(k&x|k&A|x&A)-0x70e44324|0;S=A;A=x;x=k<<30|k>>>2;k=w;w=j;E=ee^Y^q^L;ne=E<<1|E>>>31;j=ne+(w<<5|w>>>27)+S+(k&x|k&A|x&A)-0x70e44324|0;S=A;A=x;x=k<<30|k>>>2;k=w;w=j;E=te^X^G^N;ae=E<<1|E>>>31;j=ae+(w<<5|w>>>27)+S+(k&x|k&A|x&A)-0x70e44324|0;S=A;A=x;x=k<<30|k>>>2;k=w;w=j;E=re^J^H^q;ie=E<<1|E>>>31;j=ie+(w<<5|w>>>27)+S+(k&x|k&A|x&A)-0x70e44324|0;S=A;A=x;x=k<<30|k>>>2;k=w;w=j;E=ne^$^W^G;se=E<<1|E>>>31;j=se+(w<<5|w>>>27)+S+(k&x|k&A|x&A)-0x70e44324|0;S=A;A=x;x=k<<30|k>>>2;k=w;w=j;E=ae^Q^Z^H;oe=E<<1|E>>>31;j=oe+(w<<5|w>>>27)+S+(k&x|k&A|x&A)-0x70e44324|0;S=A;A=x;x=k<<30|k>>>2;k=w;w=j;E=ie^ee^V^W;ue=E<<1|E>>>31;j=ue+(w<<5|w>>>27)+S+(k&x|k&A|x&A)-0x70e44324|0;S=A;A=x;x=k<<30|k>>>2;k=w;w=j;E=se^te^Y^Z;ce=E<<1|E>>>31;j=ce+(w<<5|w>>>27)+S+(k&x|k&A|x&A)-0x70e44324|0;S=A;A=x;x=k<<30|k>>>2;k=w;w=j;E=oe^re^X^V;fe=E<<1|E>>>31;j=fe+(w<<5|w>>>27)+S+(k&x|k&A|x&A)-0x70e44324|0;S=A;A=x;x=k<<30|k>>>2;k=w;w=j;E=ue^ne^J^Y;de=E<<1|E>>>31;j=de+(w<<5|w>>>27)+S+(k&x|k&A|x&A)-0x70e44324|0;S=A;A=x;x=k<<30|k>>>2;k=w;w=j;E=ce^ae^$^X;le=E<<1|E>>>31;j=le+(w<<5|w>>>27)+S+(k&x|k&A|x&A)-0x70e44324|0;S=A;A=x;x=k<<30|k>>>2;k=w;w=j;E=fe^ie^Q^J;he=E<<1|E>>>31;j=he+(w<<5|w>>>27)+S+(k&x|k&A|x&A)-0x70e44324|0;S=A;A=x;x=k<<30|k>>>2;k=w;w=j;E=de^se^ee^$;pe=E<<1|E>>>31;j=pe+(w<<5|w>>>27)+S+(k&x|k&A|x&A)-0x70e44324|0;S=A;A=x;x=k<<30|k>>>2;k=w;w=j;E=le^oe^te^Q;be=E<<1|E>>>31;j=be+(w<<5|w>>>27)+S+(k&x|k&A|x&A)-0x70e44324|0;S=A;A=x;x=k<<30|k>>>2;k=w;w=j;E=he^ue^re^ee;ye=E<<1|E>>>31;j=ye+(w<<5|w>>>27)+S+(k&x|k&A|x&A)-0x70e44324|0;S=A;A=x;x=k<<30|k>>>2;k=w;w=j;E=pe^ce^ne^te;me=E<<1|E>>>31;j=me+(w<<5|w>>>27)+S+(k&x|k&A|x&A)-0x70e44324|0;S=A;A=x;x=k<<30|k>>>2;k=w;w=j;E=be^fe^ae^re;ve=E<<1|E>>>31;j=ve+(w<<5|w>>>27)+S+(k^x^A)-0x359d3e2a|0;S=A;A=x;x=k<<30|k>>>2;k=w;w=j;E=ye^de^ie^ne;ge=E<<1|E>>>31;j=ge+(w<<5|w>>>27)+S+(k^x^A)-0x359d3e2a|0;S=A;A=x;x=k<<30|k>>>2;k=w;w=j;E=me^le^se^ae;_e=E<<1|E>>>31;j=_e+(w<<5|w>>>27)+S+(k^x^A)-0x359d3e2a|0;S=A;A=x;x=k<<30|k>>>2;k=w;w=j;E=ve^he^oe^ie;we=E<<1|E>>>31;j=we+(w<<5|w>>>27)+S+(k^x^A)-0x359d3e2a|0;S=A;A=x;x=k<<30|k>>>2;k=w;w=j;E=ge^pe^ue^se;ke=E<<1|E>>>31;j=ke+(w<<5|w>>>27)+S+(k^x^A)-0x359d3e2a|0;S=A;A=x;x=k<<30|k>>>2;k=w;w=j;E=_e^be^ce^oe;xe=E<<1|E>>>31;j=xe+(w<<5|w>>>27)+S+(k^x^A)-0x359d3e2a|0;S=A;A=x;x=k<<30|k>>>2;k=w;w=j;E=we^ye^fe^ue;Ae=E<<1|E>>>31;j=Ae+(w<<5|w>>>27)+S+(k^x^A)-0x359d3e2a|0;S=A;A=x;x=k<<30|k>>>2;k=w;w=j;E=ke^me^de^ce;Se=E<<1|E>>>31;j=Se+(w<<5|w>>>27)+S+(k^x^A)-0x359d3e2a|0;S=A;A=x;x=k<<30|k>>>2;k=w;w=j;E=xe^ve^le^fe;Ee=E<<1|E>>>31;j=Ee+(w<<5|w>>>27)+S+(k^x^A)-0x359d3e2a|0;S=A;A=x;x=k<<30|k>>>2;k=w;w=j;E=Ae^ge^he^de;je=E<<1|E>>>31;j=je+(w<<5|w>>>27)+S+(k^x^A)-0x359d3e2a|0;S=A;A=x;x=k<<30|k>>>2;k=w;w=j;E=Se^_e^pe^le;Me=E<<1|E>>>31;j=Me+(w<<5|w>>>27)+S+(k^x^A)-0x359d3e2a|0;S=A;A=x;x=k<<30|k>>>2;k=w;w=j;E=Ee^we^be^he;Pe=E<<1|E>>>31;j=Pe+(w<<5|w>>>27)+S+(k^x^A)-0x359d3e2a|0;S=A;A=x;x=k<<30|k>>>2;k=w;w=j;E=je^ke^ye^pe;Ce=E<<1|E>>>31;j=Ce+(w<<5|w>>>27)+S+(k^x^A)-0x359d3e2a|0;S=A;A=x;x=k<<30|k>>>2;k=w;w=j;E=Me^xe^me^be;Te=E<<1|E>>>31;j=Te+(w<<5|w>>>27)+S+(k^x^A)-0x359d3e2a|0;S=A;A=x;x=k<<30|k>>>2;k=w;w=j;E=Pe^Ae^ve^ye;Ke=E<<1|E>>>31;j=Ke+(w<<5|w>>>27)+S+(k^x^A)-0x359d3e2a|0;S=A;A=x;x=k<<30|k>>>2;k=w;w=j;E=Ce^Se^ge^me;Re=E<<1|E>>>31;j=Re+(w<<5|w>>>27)+S+(k^x^A)-0x359d3e2a|0;S=A;A=x;x=k<<30|k>>>2;k=w;w=j;E=Te^Ee^_e^ve;Be=E<<1|E>>>31;j=Be+(w<<5|w>>>27)+S+(k^x^A)-0x359d3e2a|0;S=A;A=x;x=k<<30|k>>>2;k=w;w=j;E=Ke^je^we^ge;Ue=E<<1|E>>>31;j=Ue+(w<<5|w>>>27)+S+(k^x^A)-0x359d3e2a|0;S=A;A=x;x=k<<30|k>>>2;k=w;w=j;E=Re^Me^ke^_e;Ie=E<<1|E>>>31;j=Ie+(w<<5|w>>>27)+S+(k^x^A)-0x359d3e2a|0;S=A;A=x;x=k<<30|k>>>2;k=w;w=j;E=Be^Pe^xe^we;Oe=E<<1|E>>>31;j=Oe+(w<<5|w>>>27)+S+(k^x^A)-0x359d3e2a|0;S=A;A=x;x=k<<30|k>>>2;k=w;w=j;n=n+w|0;a=a+k|0;i=i+x|0;s=s+A|0;o=o+S|0}function k(e){e=e|0;w(_[e|0]<<24|_[e|1]<<16|_[e|2]<<8|_[e|3],_[e|4]<<24|_[e|5]<<16|_[e|6]<<8|_[e|7],_[e|8]<<24|_[e|9]<<16|_[e|10]<<8|_[e|11],_[e|12]<<24|_[e|13]<<16|_[e|14]<<8|_[e|15],_[e|16]<<24|_[e|17]<<16|_[e|18]<<8|_[e|19],_[e|20]<<24|_[e|21]<<16|_[e|22]<<8|_[e|23],_[e|24]<<24|_[e|25]<<16|_[e|26]<<8|_[e|27],_[e|28]<<24|_[e|29]<<16|_[e|30]<<8|_[e|31],_[e|32]<<24|_[e|33]<<16|_[e|34]<<8|_[e|35],_[e|36]<<24|_[e|37]<<16|_[e|38]<<8|_[e|39],_[e|40]<<24|_[e|41]<<16|_[e|42]<<8|_[e|43],_[e|44]<<24|_[e|45]<<16|_[e|46]<<8|_[e|47],_[e|48]<<24|_[e|49]<<16|_[e|50]<<8|_[e|51],_[e|52]<<24|_[e|53]<<16|_[e|54]<<8|_[e|55],_[e|56]<<24|_[e|57]<<16|_[e|58]<<8|_[e|59],_[e|60]<<24|_[e|61]<<16|_[e|62]<<8|_[e|63])}function x(e){e=e|0;_[e|0]=n>>>24;_[e|1]=n>>>16&255;_[e|2]=n>>>8&255;_[e|3]=n&255;_[e|4]=a>>>24;_[e|5]=a>>>16&255;_[e|6]=a>>>8&255;_[e|7]=a&255;_[e|8]=i>>>24;_[e|9]=i>>>16&255;_[e|10]=i>>>8&255;_[e|11]=i&255;_[e|12]=s>>>24;_[e|13]=s>>>16&255;_[e|14]=s>>>8&255;_[e|15]=s&255;_[e|16]=o>>>24;_[e|17]=o>>>16&255;_[e|18]=o>>>8&255;_[e|19]=o&255}function A(){n=0x67452301;a=0xefcdab89;i=0x98badcfe;s=0x10325476;o=0xc3d2e1f0;u=c=0}function S(e,t,r,f,d,l,h){e=e|0;t=t|0;r=r|0;f=f|0;d=d|0;l=l|0;h=h|0;n=e;a=t;i=r;s=f;o=d;u=l;c=h}function E(e,t){e=e|0;t=t|0;var r=0;if(e&63)return-1;while((t|0)>=64){k(e);e=e+64|0;t=t-64|0;r=r+64|0}u=u+r|0;if(u>>>0>>0)c=c+1|0;return r|0}function j(e,t,r){e=e|0;t=t|0;r=r|0;var n=0,a=0;if(e&63)return-1;if(~r)if(r&31)return-1;if((t|0)>=64){n=E(e,t)|0;if((n|0)==-1)return-1;e=e+n|0;t=t-n|0}n=n+t|0;u=u+t|0;if(u>>>0>>0)c=c+1|0;_[e|t]=0x80;if((t|0)>=56){for(a=t+1|0;(a|0)<64;a=a+1|0){_[e|a]=0x00}k(e);t=0;_[e|0]=0}for(a=t+1|0;(a|0)<59;a=a+1|0){_[e|a]=0}_[e|56]=c>>>21&255;_[e|57]=c>>>13&255;_[e|58]=c>>>5&255;_[e|59]=c<<3&255|u>>>29;_[e|60]=u>>>21&255;_[e|61]=u>>>13&255;_[e|62]=u>>>5&255;_[e|63]=u<<3&255;k(e);if(~r)x(r);return n|0}function M(){n=f;a=d;i=l;s=h;o=p;u=64;c=0}function P(){n=b;a=y;i=m;s=v;o=g;u=64;c=0}function C(e,t,r,_,k,x,S,E,j,M,P,C,T,K,R,B){e=e|0;t=t|0;r=r|0;_=_|0;k=k|0;x=x|0;S=S|0;E=E|0;j=j|0;M=M|0;P=P|0;C=C|0;T=T|0;K=K|0;R=R|0;B=B|0;A();w(e^0x5c5c5c5c,t^0x5c5c5c5c,r^0x5c5c5c5c,_^0x5c5c5c5c,k^0x5c5c5c5c,x^0x5c5c5c5c,S^0x5c5c5c5c,E^0x5c5c5c5c,j^0x5c5c5c5c,M^0x5c5c5c5c,P^0x5c5c5c5c,C^0x5c5c5c5c,T^0x5c5c5c5c,K^0x5c5c5c5c,R^0x5c5c5c5c,B^0x5c5c5c5c);b=n;y=a;m=i;v=s;g=o;A();w(e^0x36363636,t^0x36363636,r^0x36363636,_^0x36363636,k^0x36363636,x^0x36363636,S^0x36363636,E^0x36363636,j^0x36363636,M^0x36363636,P^0x36363636,C^0x36363636,T^0x36363636,K^0x36363636,R^0x36363636,B^0x36363636);f=n;d=a;l=i;h=s;p=o;u=64;c=0}function T(e,t,r){e=e|0;t=t|0;r=r|0;var u=0,c=0,f=0,d=0,l=0,h=0;if(e&63)return-1;if(~r)if(r&31)return-1;h=j(e,t,-1)|0;u=n,c=a,f=i,d=s,l=o;P();w(u,c,f,d,l,0x80000000,0,0,0,0,0,0,0,0,0,672);if(~r)x(r);return h|0}function K(e,t,r,u,c){e=e|0;t=t|0;r=r|0;u=u|0;c=c|0;var f=0,d=0,l=0,h=0,p=0,b=0,y=0,m=0,v=0,g=0;if(e&63)return-1;if(~c)if(c&31)return-1;_[e+t|0]=r>>>24;_[e+t+1|0]=r>>>16&255;_[e+t+2|0]=r>>>8&255;_[e+t+3|0]=r&255;T(e,t+4|0,-1)|0;f=b=n,d=y=a,l=m=i,h=v=s,p=g=o;u=u-1|0;while((u|0)>0){M();w(b,y,m,v,g,0x80000000,0,0,0,0,0,0,0,0,0,672);b=n,y=a,m=i,v=s,g=o;P();w(b,y,m,v,g,0x80000000,0,0,0,0,0,0,0,0,0,672);b=n,y=a,m=i,v=s,g=o;f=f^n;d=d^a;l=l^i;h=h^s;p=p^o;u=u-1|0}n=f;a=d;i=l;s=h;o=p;if(~c)x(c);return 0}return{reset:A,init:S,process:E,finish:j,hmac_reset:M,hmac_init:C,hmac_finish:T,pbkdf2_generate_block:K}}},{}],11:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.Sha1=r._sha1_hash_size=r._sha1_block_size=void 0;var n=o(e("babel-runtime/core-js/object/create")),a=o(e("babel-runtime/core-js/object/set-prototype-of")),i=e("./sha1.asm"),s=e("../hash");function o(e){return e&&e.__esModule?e:{default:e}}var u,c=(u=a.default||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},function(e,t){function r(){this.constructor=e}u(e,t),e.prototype=null===t?(0,n.default)(t):(r.prototype=t.prototype,new r)}),f=r._sha1_block_size=64,d=r._sha1_hash_size=20,l=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.NAME="sha1",t.BLOCK_SIZE=f,t.HASH_SIZE=d,t}return c(t,e),t.bytes=function(e){return(new t).process(e).finish().result},t.NAME="sha1",t.heap_pool=[],t.asm_pool=[],t.asm_function=i.sha1_asm,t}(s.Hash);r.Sha1=l},{"../hash":9,"./sha1.asm":10,"babel-runtime/core-js/object/create":23,"babel-runtime/core-js/object/set-prototype-of":29}],12:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.sha256_asm=function(e,t,r){"use asm";var n=0,a=0,i=0,s=0,o=0,u=0,c=0,f=0,d=0,l=0,h=0,p=0,b=0,y=0,m=0,v=0,g=0,_=0,w=0,k=0,x=0,A=0,S=0,E=0,j=0,M=0,P=new e.Uint8Array(r);function C(e,t,r,d,l,h,p,b,y,m,v,g,_,w,k,x){e=e|0;t=t|0;r=r|0;d=d|0;l=l|0;h=h|0;p=p|0;b=b|0;y=y|0;m=m|0;v=v|0;g=g|0;_=_|0;w=w|0;k=k|0;x=x|0;var A=0,S=0,E=0,j=0,M=0,P=0,C=0,T=0;A=n;S=a;E=i;j=s;M=o;P=u;C=c;T=f;T=e+T+(M>>>6^M>>>11^M>>>25^M<<26^M<<21^M<<7)+(C^M&(P^C))+0x428a2f98|0;j=j+T|0;T=T+(A&S^E&(A^S))+(A>>>2^A>>>13^A>>>22^A<<30^A<<19^A<<10)|0;C=t+C+(j>>>6^j>>>11^j>>>25^j<<26^j<<21^j<<7)+(P^j&(M^P))+0x71374491|0;E=E+C|0;C=C+(T&A^S&(T^A))+(T>>>2^T>>>13^T>>>22^T<<30^T<<19^T<<10)|0;P=r+P+(E>>>6^E>>>11^E>>>25^E<<26^E<<21^E<<7)+(M^E&(j^M))+0xb5c0fbcf|0;S=S+P|0;P=P+(C&T^A&(C^T))+(C>>>2^C>>>13^C>>>22^C<<30^C<<19^C<<10)|0;M=d+M+(S>>>6^S>>>11^S>>>25^S<<26^S<<21^S<<7)+(j^S&(E^j))+0xe9b5dba5|0;A=A+M|0;M=M+(P&C^T&(P^C))+(P>>>2^P>>>13^P>>>22^P<<30^P<<19^P<<10)|0;j=l+j+(A>>>6^A>>>11^A>>>25^A<<26^A<<21^A<<7)+(E^A&(S^E))+0x3956c25b|0;T=T+j|0;j=j+(M&P^C&(M^P))+(M>>>2^M>>>13^M>>>22^M<<30^M<<19^M<<10)|0;E=h+E+(T>>>6^T>>>11^T>>>25^T<<26^T<<21^T<<7)+(S^T&(A^S))+0x59f111f1|0;C=C+E|0;E=E+(j&M^P&(j^M))+(j>>>2^j>>>13^j>>>22^j<<30^j<<19^j<<10)|0;S=p+S+(C>>>6^C>>>11^C>>>25^C<<26^C<<21^C<<7)+(A^C&(T^A))+0x923f82a4|0;P=P+S|0;S=S+(E&j^M&(E^j))+(E>>>2^E>>>13^E>>>22^E<<30^E<<19^E<<10)|0;A=b+A+(P>>>6^P>>>11^P>>>25^P<<26^P<<21^P<<7)+(T^P&(C^T))+0xab1c5ed5|0;M=M+A|0;A=A+(S&E^j&(S^E))+(S>>>2^S>>>13^S>>>22^S<<30^S<<19^S<<10)|0;T=y+T+(M>>>6^M>>>11^M>>>25^M<<26^M<<21^M<<7)+(C^M&(P^C))+0xd807aa98|0;j=j+T|0;T=T+(A&S^E&(A^S))+(A>>>2^A>>>13^A>>>22^A<<30^A<<19^A<<10)|0;C=m+C+(j>>>6^j>>>11^j>>>25^j<<26^j<<21^j<<7)+(P^j&(M^P))+0x12835b01|0;E=E+C|0;C=C+(T&A^S&(T^A))+(T>>>2^T>>>13^T>>>22^T<<30^T<<19^T<<10)|0;P=v+P+(E>>>6^E>>>11^E>>>25^E<<26^E<<21^E<<7)+(M^E&(j^M))+0x243185be|0;S=S+P|0;P=P+(C&T^A&(C^T))+(C>>>2^C>>>13^C>>>22^C<<30^C<<19^C<<10)|0;M=g+M+(S>>>6^S>>>11^S>>>25^S<<26^S<<21^S<<7)+(j^S&(E^j))+0x550c7dc3|0;A=A+M|0;M=M+(P&C^T&(P^C))+(P>>>2^P>>>13^P>>>22^P<<30^P<<19^P<<10)|0;j=_+j+(A>>>6^A>>>11^A>>>25^A<<26^A<<21^A<<7)+(E^A&(S^E))+0x72be5d74|0;T=T+j|0;j=j+(M&P^C&(M^P))+(M>>>2^M>>>13^M>>>22^M<<30^M<<19^M<<10)|0;E=w+E+(T>>>6^T>>>11^T>>>25^T<<26^T<<21^T<<7)+(S^T&(A^S))+0x80deb1fe|0;C=C+E|0;E=E+(j&M^P&(j^M))+(j>>>2^j>>>13^j>>>22^j<<30^j<<19^j<<10)|0;S=k+S+(C>>>6^C>>>11^C>>>25^C<<26^C<<21^C<<7)+(A^C&(T^A))+0x9bdc06a7|0;P=P+S|0;S=S+(E&j^M&(E^j))+(E>>>2^E>>>13^E>>>22^E<<30^E<<19^E<<10)|0;A=x+A+(P>>>6^P>>>11^P>>>25^P<<26^P<<21^P<<7)+(T^P&(C^T))+0xc19bf174|0;M=M+A|0;A=A+(S&E^j&(S^E))+(S>>>2^S>>>13^S>>>22^S<<30^S<<19^S<<10)|0;e=(t>>>7^t>>>18^t>>>3^t<<25^t<<14)+(k>>>17^k>>>19^k>>>10^k<<15^k<<13)+e+m|0;T=e+T+(M>>>6^M>>>11^M>>>25^M<<26^M<<21^M<<7)+(C^M&(P^C))+0xe49b69c1|0;j=j+T|0;T=T+(A&S^E&(A^S))+(A>>>2^A>>>13^A>>>22^A<<30^A<<19^A<<10)|0;t=(r>>>7^r>>>18^r>>>3^r<<25^r<<14)+(x>>>17^x>>>19^x>>>10^x<<15^x<<13)+t+v|0;C=t+C+(j>>>6^j>>>11^j>>>25^j<<26^j<<21^j<<7)+(P^j&(M^P))+0xefbe4786|0;E=E+C|0;C=C+(T&A^S&(T^A))+(T>>>2^T>>>13^T>>>22^T<<30^T<<19^T<<10)|0;r=(d>>>7^d>>>18^d>>>3^d<<25^d<<14)+(e>>>17^e>>>19^e>>>10^e<<15^e<<13)+r+g|0;P=r+P+(E>>>6^E>>>11^E>>>25^E<<26^E<<21^E<<7)+(M^E&(j^M))+0x0fc19dc6|0;S=S+P|0;P=P+(C&T^A&(C^T))+(C>>>2^C>>>13^C>>>22^C<<30^C<<19^C<<10)|0;d=(l>>>7^l>>>18^l>>>3^l<<25^l<<14)+(t>>>17^t>>>19^t>>>10^t<<15^t<<13)+d+_|0;M=d+M+(S>>>6^S>>>11^S>>>25^S<<26^S<<21^S<<7)+(j^S&(E^j))+0x240ca1cc|0;A=A+M|0;M=M+(P&C^T&(P^C))+(P>>>2^P>>>13^P>>>22^P<<30^P<<19^P<<10)|0;l=(h>>>7^h>>>18^h>>>3^h<<25^h<<14)+(r>>>17^r>>>19^r>>>10^r<<15^r<<13)+l+w|0;j=l+j+(A>>>6^A>>>11^A>>>25^A<<26^A<<21^A<<7)+(E^A&(S^E))+0x2de92c6f|0;T=T+j|0;j=j+(M&P^C&(M^P))+(M>>>2^M>>>13^M>>>22^M<<30^M<<19^M<<10)|0;h=(p>>>7^p>>>18^p>>>3^p<<25^p<<14)+(d>>>17^d>>>19^d>>>10^d<<15^d<<13)+h+k|0;E=h+E+(T>>>6^T>>>11^T>>>25^T<<26^T<<21^T<<7)+(S^T&(A^S))+0x4a7484aa|0;C=C+E|0;E=E+(j&M^P&(j^M))+(j>>>2^j>>>13^j>>>22^j<<30^j<<19^j<<10)|0;p=(b>>>7^b>>>18^b>>>3^b<<25^b<<14)+(l>>>17^l>>>19^l>>>10^l<<15^l<<13)+p+x|0;S=p+S+(C>>>6^C>>>11^C>>>25^C<<26^C<<21^C<<7)+(A^C&(T^A))+0x5cb0a9dc|0;P=P+S|0;S=S+(E&j^M&(E^j))+(E>>>2^E>>>13^E>>>22^E<<30^E<<19^E<<10)|0;b=(y>>>7^y>>>18^y>>>3^y<<25^y<<14)+(h>>>17^h>>>19^h>>>10^h<<15^h<<13)+b+e|0;A=b+A+(P>>>6^P>>>11^P>>>25^P<<26^P<<21^P<<7)+(T^P&(C^T))+0x76f988da|0;M=M+A|0;A=A+(S&E^j&(S^E))+(S>>>2^S>>>13^S>>>22^S<<30^S<<19^S<<10)|0;y=(m>>>7^m>>>18^m>>>3^m<<25^m<<14)+(p>>>17^p>>>19^p>>>10^p<<15^p<<13)+y+t|0;T=y+T+(M>>>6^M>>>11^M>>>25^M<<26^M<<21^M<<7)+(C^M&(P^C))+0x983e5152|0;j=j+T|0;T=T+(A&S^E&(A^S))+(A>>>2^A>>>13^A>>>22^A<<30^A<<19^A<<10)|0;m=(v>>>7^v>>>18^v>>>3^v<<25^v<<14)+(b>>>17^b>>>19^b>>>10^b<<15^b<<13)+m+r|0;C=m+C+(j>>>6^j>>>11^j>>>25^j<<26^j<<21^j<<7)+(P^j&(M^P))+0xa831c66d|0;E=E+C|0;C=C+(T&A^S&(T^A))+(T>>>2^T>>>13^T>>>22^T<<30^T<<19^T<<10)|0;v=(g>>>7^g>>>18^g>>>3^g<<25^g<<14)+(y>>>17^y>>>19^y>>>10^y<<15^y<<13)+v+d|0;P=v+P+(E>>>6^E>>>11^E>>>25^E<<26^E<<21^E<<7)+(M^E&(j^M))+0xb00327c8|0;S=S+P|0;P=P+(C&T^A&(C^T))+(C>>>2^C>>>13^C>>>22^C<<30^C<<19^C<<10)|0;g=(_>>>7^_>>>18^_>>>3^_<<25^_<<14)+(m>>>17^m>>>19^m>>>10^m<<15^m<<13)+g+l|0;M=g+M+(S>>>6^S>>>11^S>>>25^S<<26^S<<21^S<<7)+(j^S&(E^j))+0xbf597fc7|0;A=A+M|0;M=M+(P&C^T&(P^C))+(P>>>2^P>>>13^P>>>22^P<<30^P<<19^P<<10)|0;_=(w>>>7^w>>>18^w>>>3^w<<25^w<<14)+(v>>>17^v>>>19^v>>>10^v<<15^v<<13)+_+h|0;j=_+j+(A>>>6^A>>>11^A>>>25^A<<26^A<<21^A<<7)+(E^A&(S^E))+0xc6e00bf3|0;T=T+j|0;j=j+(M&P^C&(M^P))+(M>>>2^M>>>13^M>>>22^M<<30^M<<19^M<<10)|0;w=(k>>>7^k>>>18^k>>>3^k<<25^k<<14)+(g>>>17^g>>>19^g>>>10^g<<15^g<<13)+w+p|0;E=w+E+(T>>>6^T>>>11^T>>>25^T<<26^T<<21^T<<7)+(S^T&(A^S))+0xd5a79147|0;C=C+E|0;E=E+(j&M^P&(j^M))+(j>>>2^j>>>13^j>>>22^j<<30^j<<19^j<<10)|0;k=(x>>>7^x>>>18^x>>>3^x<<25^x<<14)+(_>>>17^_>>>19^_>>>10^_<<15^_<<13)+k+b|0;S=k+S+(C>>>6^C>>>11^C>>>25^C<<26^C<<21^C<<7)+(A^C&(T^A))+0x06ca6351|0;P=P+S|0;S=S+(E&j^M&(E^j))+(E>>>2^E>>>13^E>>>22^E<<30^E<<19^E<<10)|0;x=(e>>>7^e>>>18^e>>>3^e<<25^e<<14)+(w>>>17^w>>>19^w>>>10^w<<15^w<<13)+x+y|0;A=x+A+(P>>>6^P>>>11^P>>>25^P<<26^P<<21^P<<7)+(T^P&(C^T))+0x14292967|0;M=M+A|0;A=A+(S&E^j&(S^E))+(S>>>2^S>>>13^S>>>22^S<<30^S<<19^S<<10)|0;e=(t>>>7^t>>>18^t>>>3^t<<25^t<<14)+(k>>>17^k>>>19^k>>>10^k<<15^k<<13)+e+m|0;T=e+T+(M>>>6^M>>>11^M>>>25^M<<26^M<<21^M<<7)+(C^M&(P^C))+0x27b70a85|0;j=j+T|0;T=T+(A&S^E&(A^S))+(A>>>2^A>>>13^A>>>22^A<<30^A<<19^A<<10)|0;t=(r>>>7^r>>>18^r>>>3^r<<25^r<<14)+(x>>>17^x>>>19^x>>>10^x<<15^x<<13)+t+v|0;C=t+C+(j>>>6^j>>>11^j>>>25^j<<26^j<<21^j<<7)+(P^j&(M^P))+0x2e1b2138|0;E=E+C|0;C=C+(T&A^S&(T^A))+(T>>>2^T>>>13^T>>>22^T<<30^T<<19^T<<10)|0;r=(d>>>7^d>>>18^d>>>3^d<<25^d<<14)+(e>>>17^e>>>19^e>>>10^e<<15^e<<13)+r+g|0;P=r+P+(E>>>6^E>>>11^E>>>25^E<<26^E<<21^E<<7)+(M^E&(j^M))+0x4d2c6dfc|0;S=S+P|0;P=P+(C&T^A&(C^T))+(C>>>2^C>>>13^C>>>22^C<<30^C<<19^C<<10)|0;d=(l>>>7^l>>>18^l>>>3^l<<25^l<<14)+(t>>>17^t>>>19^t>>>10^t<<15^t<<13)+d+_|0;M=d+M+(S>>>6^S>>>11^S>>>25^S<<26^S<<21^S<<7)+(j^S&(E^j))+0x53380d13|0;A=A+M|0;M=M+(P&C^T&(P^C))+(P>>>2^P>>>13^P>>>22^P<<30^P<<19^P<<10)|0;l=(h>>>7^h>>>18^h>>>3^h<<25^h<<14)+(r>>>17^r>>>19^r>>>10^r<<15^r<<13)+l+w|0;j=l+j+(A>>>6^A>>>11^A>>>25^A<<26^A<<21^A<<7)+(E^A&(S^E))+0x650a7354|0;T=T+j|0;j=j+(M&P^C&(M^P))+(M>>>2^M>>>13^M>>>22^M<<30^M<<19^M<<10)|0;h=(p>>>7^p>>>18^p>>>3^p<<25^p<<14)+(d>>>17^d>>>19^d>>>10^d<<15^d<<13)+h+k|0;E=h+E+(T>>>6^T>>>11^T>>>25^T<<26^T<<21^T<<7)+(S^T&(A^S))+0x766a0abb|0;C=C+E|0;E=E+(j&M^P&(j^M))+(j>>>2^j>>>13^j>>>22^j<<30^j<<19^j<<10)|0;p=(b>>>7^b>>>18^b>>>3^b<<25^b<<14)+(l>>>17^l>>>19^l>>>10^l<<15^l<<13)+p+x|0;S=p+S+(C>>>6^C>>>11^C>>>25^C<<26^C<<21^C<<7)+(A^C&(T^A))+0x81c2c92e|0;P=P+S|0;S=S+(E&j^M&(E^j))+(E>>>2^E>>>13^E>>>22^E<<30^E<<19^E<<10)|0;b=(y>>>7^y>>>18^y>>>3^y<<25^y<<14)+(h>>>17^h>>>19^h>>>10^h<<15^h<<13)+b+e|0;A=b+A+(P>>>6^P>>>11^P>>>25^P<<26^P<<21^P<<7)+(T^P&(C^T))+0x92722c85|0;M=M+A|0;A=A+(S&E^j&(S^E))+(S>>>2^S>>>13^S>>>22^S<<30^S<<19^S<<10)|0;y=(m>>>7^m>>>18^m>>>3^m<<25^m<<14)+(p>>>17^p>>>19^p>>>10^p<<15^p<<13)+y+t|0;T=y+T+(M>>>6^M>>>11^M>>>25^M<<26^M<<21^M<<7)+(C^M&(P^C))+0xa2bfe8a1|0;j=j+T|0;T=T+(A&S^E&(A^S))+(A>>>2^A>>>13^A>>>22^A<<30^A<<19^A<<10)|0;m=(v>>>7^v>>>18^v>>>3^v<<25^v<<14)+(b>>>17^b>>>19^b>>>10^b<<15^b<<13)+m+r|0;C=m+C+(j>>>6^j>>>11^j>>>25^j<<26^j<<21^j<<7)+(P^j&(M^P))+0xa81a664b|0;E=E+C|0;C=C+(T&A^S&(T^A))+(T>>>2^T>>>13^T>>>22^T<<30^T<<19^T<<10)|0;v=(g>>>7^g>>>18^g>>>3^g<<25^g<<14)+(y>>>17^y>>>19^y>>>10^y<<15^y<<13)+v+d|0;P=v+P+(E>>>6^E>>>11^E>>>25^E<<26^E<<21^E<<7)+(M^E&(j^M))+0xc24b8b70|0;S=S+P|0;P=P+(C&T^A&(C^T))+(C>>>2^C>>>13^C>>>22^C<<30^C<<19^C<<10)|0;g=(_>>>7^_>>>18^_>>>3^_<<25^_<<14)+(m>>>17^m>>>19^m>>>10^m<<15^m<<13)+g+l|0;M=g+M+(S>>>6^S>>>11^S>>>25^S<<26^S<<21^S<<7)+(j^S&(E^j))+0xc76c51a3|0;A=A+M|0;M=M+(P&C^T&(P^C))+(P>>>2^P>>>13^P>>>22^P<<30^P<<19^P<<10)|0;_=(w>>>7^w>>>18^w>>>3^w<<25^w<<14)+(v>>>17^v>>>19^v>>>10^v<<15^v<<13)+_+h|0;j=_+j+(A>>>6^A>>>11^A>>>25^A<<26^A<<21^A<<7)+(E^A&(S^E))+0xd192e819|0;T=T+j|0;j=j+(M&P^C&(M^P))+(M>>>2^M>>>13^M>>>22^M<<30^M<<19^M<<10)|0;w=(k>>>7^k>>>18^k>>>3^k<<25^k<<14)+(g>>>17^g>>>19^g>>>10^g<<15^g<<13)+w+p|0;E=w+E+(T>>>6^T>>>11^T>>>25^T<<26^T<<21^T<<7)+(S^T&(A^S))+0xd6990624|0;C=C+E|0;E=E+(j&M^P&(j^M))+(j>>>2^j>>>13^j>>>22^j<<30^j<<19^j<<10)|0;k=(x>>>7^x>>>18^x>>>3^x<<25^x<<14)+(_>>>17^_>>>19^_>>>10^_<<15^_<<13)+k+b|0;S=k+S+(C>>>6^C>>>11^C>>>25^C<<26^C<<21^C<<7)+(A^C&(T^A))+0xf40e3585|0;P=P+S|0;S=S+(E&j^M&(E^j))+(E>>>2^E>>>13^E>>>22^E<<30^E<<19^E<<10)|0;x=(e>>>7^e>>>18^e>>>3^e<<25^e<<14)+(w>>>17^w>>>19^w>>>10^w<<15^w<<13)+x+y|0;A=x+A+(P>>>6^P>>>11^P>>>25^P<<26^P<<21^P<<7)+(T^P&(C^T))+0x106aa070|0;M=M+A|0;A=A+(S&E^j&(S^E))+(S>>>2^S>>>13^S>>>22^S<<30^S<<19^S<<10)|0;e=(t>>>7^t>>>18^t>>>3^t<<25^t<<14)+(k>>>17^k>>>19^k>>>10^k<<15^k<<13)+e+m|0;T=e+T+(M>>>6^M>>>11^M>>>25^M<<26^M<<21^M<<7)+(C^M&(P^C))+0x19a4c116|0;j=j+T|0;T=T+(A&S^E&(A^S))+(A>>>2^A>>>13^A>>>22^A<<30^A<<19^A<<10)|0;t=(r>>>7^r>>>18^r>>>3^r<<25^r<<14)+(x>>>17^x>>>19^x>>>10^x<<15^x<<13)+t+v|0;C=t+C+(j>>>6^j>>>11^j>>>25^j<<26^j<<21^j<<7)+(P^j&(M^P))+0x1e376c08|0;E=E+C|0;C=C+(T&A^S&(T^A))+(T>>>2^T>>>13^T>>>22^T<<30^T<<19^T<<10)|0;r=(d>>>7^d>>>18^d>>>3^d<<25^d<<14)+(e>>>17^e>>>19^e>>>10^e<<15^e<<13)+r+g|0;P=r+P+(E>>>6^E>>>11^E>>>25^E<<26^E<<21^E<<7)+(M^E&(j^M))+0x2748774c|0;S=S+P|0;P=P+(C&T^A&(C^T))+(C>>>2^C>>>13^C>>>22^C<<30^C<<19^C<<10)|0;d=(l>>>7^l>>>18^l>>>3^l<<25^l<<14)+(t>>>17^t>>>19^t>>>10^t<<15^t<<13)+d+_|0;M=d+M+(S>>>6^S>>>11^S>>>25^S<<26^S<<21^S<<7)+(j^S&(E^j))+0x34b0bcb5|0;A=A+M|0;M=M+(P&C^T&(P^C))+(P>>>2^P>>>13^P>>>22^P<<30^P<<19^P<<10)|0;l=(h>>>7^h>>>18^h>>>3^h<<25^h<<14)+(r>>>17^r>>>19^r>>>10^r<<15^r<<13)+l+w|0;j=l+j+(A>>>6^A>>>11^A>>>25^A<<26^A<<21^A<<7)+(E^A&(S^E))+0x391c0cb3|0;T=T+j|0;j=j+(M&P^C&(M^P))+(M>>>2^M>>>13^M>>>22^M<<30^M<<19^M<<10)|0;h=(p>>>7^p>>>18^p>>>3^p<<25^p<<14)+(d>>>17^d>>>19^d>>>10^d<<15^d<<13)+h+k|0;E=h+E+(T>>>6^T>>>11^T>>>25^T<<26^T<<21^T<<7)+(S^T&(A^S))+0x4ed8aa4a|0;C=C+E|0;E=E+(j&M^P&(j^M))+(j>>>2^j>>>13^j>>>22^j<<30^j<<19^j<<10)|0;p=(b>>>7^b>>>18^b>>>3^b<<25^b<<14)+(l>>>17^l>>>19^l>>>10^l<<15^l<<13)+p+x|0;S=p+S+(C>>>6^C>>>11^C>>>25^C<<26^C<<21^C<<7)+(A^C&(T^A))+0x5b9cca4f|0;P=P+S|0;S=S+(E&j^M&(E^j))+(E>>>2^E>>>13^E>>>22^E<<30^E<<19^E<<10)|0;b=(y>>>7^y>>>18^y>>>3^y<<25^y<<14)+(h>>>17^h>>>19^h>>>10^h<<15^h<<13)+b+e|0;A=b+A+(P>>>6^P>>>11^P>>>25^P<<26^P<<21^P<<7)+(T^P&(C^T))+0x682e6ff3|0;M=M+A|0;A=A+(S&E^j&(S^E))+(S>>>2^S>>>13^S>>>22^S<<30^S<<19^S<<10)|0;y=(m>>>7^m>>>18^m>>>3^m<<25^m<<14)+(p>>>17^p>>>19^p>>>10^p<<15^p<<13)+y+t|0;T=y+T+(M>>>6^M>>>11^M>>>25^M<<26^M<<21^M<<7)+(C^M&(P^C))+0x748f82ee|0;j=j+T|0;T=T+(A&S^E&(A^S))+(A>>>2^A>>>13^A>>>22^A<<30^A<<19^A<<10)|0;m=(v>>>7^v>>>18^v>>>3^v<<25^v<<14)+(b>>>17^b>>>19^b>>>10^b<<15^b<<13)+m+r|0;C=m+C+(j>>>6^j>>>11^j>>>25^j<<26^j<<21^j<<7)+(P^j&(M^P))+0x78a5636f|0;E=E+C|0;C=C+(T&A^S&(T^A))+(T>>>2^T>>>13^T>>>22^T<<30^T<<19^T<<10)|0;v=(g>>>7^g>>>18^g>>>3^g<<25^g<<14)+(y>>>17^y>>>19^y>>>10^y<<15^y<<13)+v+d|0;P=v+P+(E>>>6^E>>>11^E>>>25^E<<26^E<<21^E<<7)+(M^E&(j^M))+0x84c87814|0;S=S+P|0;P=P+(C&T^A&(C^T))+(C>>>2^C>>>13^C>>>22^C<<30^C<<19^C<<10)|0;g=(_>>>7^_>>>18^_>>>3^_<<25^_<<14)+(m>>>17^m>>>19^m>>>10^m<<15^m<<13)+g+l|0;M=g+M+(S>>>6^S>>>11^S>>>25^S<<26^S<<21^S<<7)+(j^S&(E^j))+0x8cc70208|0;A=A+M|0;M=M+(P&C^T&(P^C))+(P>>>2^P>>>13^P>>>22^P<<30^P<<19^P<<10)|0;_=(w>>>7^w>>>18^w>>>3^w<<25^w<<14)+(v>>>17^v>>>19^v>>>10^v<<15^v<<13)+_+h|0;j=_+j+(A>>>6^A>>>11^A>>>25^A<<26^A<<21^A<<7)+(E^A&(S^E))+0x90befffa|0;T=T+j|0;j=j+(M&P^C&(M^P))+(M>>>2^M>>>13^M>>>22^M<<30^M<<19^M<<10)|0;w=(k>>>7^k>>>18^k>>>3^k<<25^k<<14)+(g>>>17^g>>>19^g>>>10^g<<15^g<<13)+w+p|0;E=w+E+(T>>>6^T>>>11^T>>>25^T<<26^T<<21^T<<7)+(S^T&(A^S))+0xa4506ceb|0;C=C+E|0;E=E+(j&M^P&(j^M))+(j>>>2^j>>>13^j>>>22^j<<30^j<<19^j<<10)|0;k=(x>>>7^x>>>18^x>>>3^x<<25^x<<14)+(_>>>17^_>>>19^_>>>10^_<<15^_<<13)+k+b|0;S=k+S+(C>>>6^C>>>11^C>>>25^C<<26^C<<21^C<<7)+(A^C&(T^A))+0xbef9a3f7|0;P=P+S|0;S=S+(E&j^M&(E^j))+(E>>>2^E>>>13^E>>>22^E<<30^E<<19^E<<10)|0;x=(e>>>7^e>>>18^e>>>3^e<<25^e<<14)+(w>>>17^w>>>19^w>>>10^w<<15^w<<13)+x+y|0;A=x+A+(P>>>6^P>>>11^P>>>25^P<<26^P<<21^P<<7)+(T^P&(C^T))+0xc67178f2|0;M=M+A|0;A=A+(S&E^j&(S^E))+(S>>>2^S>>>13^S>>>22^S<<30^S<<19^S<<10)|0;n=n+A|0;a=a+S|0;i=i+E|0;s=s+j|0;o=o+M|0;u=u+P|0;c=c+C|0;f=f+T|0}function T(e){e=e|0;C(P[e|0]<<24|P[e|1]<<16|P[e|2]<<8|P[e|3],P[e|4]<<24|P[e|5]<<16|P[e|6]<<8|P[e|7],P[e|8]<<24|P[e|9]<<16|P[e|10]<<8|P[e|11],P[e|12]<<24|P[e|13]<<16|P[e|14]<<8|P[e|15],P[e|16]<<24|P[e|17]<<16|P[e|18]<<8|P[e|19],P[e|20]<<24|P[e|21]<<16|P[e|22]<<8|P[e|23],P[e|24]<<24|P[e|25]<<16|P[e|26]<<8|P[e|27],P[e|28]<<24|P[e|29]<<16|P[e|30]<<8|P[e|31],P[e|32]<<24|P[e|33]<<16|P[e|34]<<8|P[e|35],P[e|36]<<24|P[e|37]<<16|P[e|38]<<8|P[e|39],P[e|40]<<24|P[e|41]<<16|P[e|42]<<8|P[e|43],P[e|44]<<24|P[e|45]<<16|P[e|46]<<8|P[e|47],P[e|48]<<24|P[e|49]<<16|P[e|50]<<8|P[e|51],P[e|52]<<24|P[e|53]<<16|P[e|54]<<8|P[e|55],P[e|56]<<24|P[e|57]<<16|P[e|58]<<8|P[e|59],P[e|60]<<24|P[e|61]<<16|P[e|62]<<8|P[e|63])}function K(e){e=e|0;P[e|0]=n>>>24;P[e|1]=n>>>16&255;P[e|2]=n>>>8&255;P[e|3]=n&255;P[e|4]=a>>>24;P[e|5]=a>>>16&255;P[e|6]=a>>>8&255;P[e|7]=a&255;P[e|8]=i>>>24;P[e|9]=i>>>16&255;P[e|10]=i>>>8&255;P[e|11]=i&255;P[e|12]=s>>>24;P[e|13]=s>>>16&255;P[e|14]=s>>>8&255;P[e|15]=s&255;P[e|16]=o>>>24;P[e|17]=o>>>16&255;P[e|18]=o>>>8&255;P[e|19]=o&255;P[e|20]=u>>>24;P[e|21]=u>>>16&255;P[e|22]=u>>>8&255;P[e|23]=u&255;P[e|24]=c>>>24;P[e|25]=c>>>16&255;P[e|26]=c>>>8&255;P[e|27]=c&255;P[e|28]=f>>>24;P[e|29]=f>>>16&255;P[e|30]=f>>>8&255;P[e|31]=f&255}function R(){n=0x6a09e667;a=0xbb67ae85;i=0x3c6ef372;s=0xa54ff53a;o=0x510e527f;u=0x9b05688c;c=0x1f83d9ab;f=0x5be0cd19;d=l=0}function B(e,t,r,h,p,b,y,m,v,g){e=e|0;t=t|0;r=r|0;h=h|0;p=p|0;b=b|0;y=y|0;m=m|0;v=v|0;g=g|0;n=e;a=t;i=r;s=h;o=p;u=b;c=y;f=m;d=v;l=g}function U(e,t){e=e|0;t=t|0;var r=0;if(e&63)return-1;while((t|0)>=64){T(e);e=e+64|0;t=t-64|0;r=r+64|0}d=d+r|0;if(d>>>0>>0)l=l+1|0;return r|0}function I(e,t,r){e=e|0;t=t|0;r=r|0;var n=0,a=0;if(e&63)return-1;if(~r)if(r&31)return-1;if((t|0)>=64){n=U(e,t)|0;if((n|0)==-1)return-1;e=e+n|0;t=t-n|0}n=n+t|0;d=d+t|0;if(d>>>0>>0)l=l+1|0;P[e|t]=0x80;if((t|0)>=56){for(a=t+1|0;(a|0)<64;a=a+1|0){P[e|a]=0x00}T(e);t=0;P[e|0]=0}for(a=t+1|0;(a|0)<59;a=a+1|0){P[e|a]=0}P[e|56]=l>>>21&255;P[e|57]=l>>>13&255;P[e|58]=l>>>5&255;P[e|59]=l<<3&255|d>>>29;P[e|60]=d>>>21&255;P[e|61]=d>>>13&255;P[e|62]=d>>>5&255;P[e|63]=d<<3&255;T(e);if(~r)K(r);return n|0}function O(){n=h;a=p;i=b;s=y;o=m;u=v;c=g;f=_;d=64;l=0}function z(){n=w;a=k;i=x;s=A;o=S;u=E;c=j;f=M;d=64;l=0}function D(e,t,r,P,T,K,B,U,I,O,z,D,F,L,N,q){e=e|0;t=t|0;r=r|0;P=P|0;T=T|0;K=K|0;B=B|0;U=U|0;I=I|0;O=O|0;z=z|0;D=D|0;F=F|0;L=L|0;N=N|0;q=q|0;R();C(e^0x5c5c5c5c,t^0x5c5c5c5c,r^0x5c5c5c5c,P^0x5c5c5c5c,T^0x5c5c5c5c,K^0x5c5c5c5c,B^0x5c5c5c5c,U^0x5c5c5c5c,I^0x5c5c5c5c,O^0x5c5c5c5c,z^0x5c5c5c5c,D^0x5c5c5c5c,F^0x5c5c5c5c,L^0x5c5c5c5c,N^0x5c5c5c5c,q^0x5c5c5c5c);w=n;k=a;x=i;A=s;S=o;E=u;j=c;M=f;R();C(e^0x36363636,t^0x36363636,r^0x36363636,P^0x36363636,T^0x36363636,K^0x36363636,B^0x36363636,U^0x36363636,I^0x36363636,O^0x36363636,z^0x36363636,D^0x36363636,F^0x36363636,L^0x36363636,N^0x36363636,q^0x36363636);h=n;p=a;b=i;y=s;m=o;v=u;g=c;_=f;d=64;l=0}function F(e,t,r){e=e|0;t=t|0;r=r|0;var d=0,l=0,h=0,p=0,b=0,y=0,m=0,v=0,g=0;if(e&63)return-1;if(~r)if(r&31)return-1;g=I(e,t,-1)|0;d=n,l=a,h=i,p=s,b=o,y=u,m=c,v=f;z();C(d,l,h,p,b,y,m,v,0x80000000,0,0,0,0,0,0,768);if(~r)K(r);return g|0}function L(e,t,r,d,l){e=e|0;t=t|0;r=r|0;d=d|0;l=l|0;var h=0,p=0,b=0,y=0,m=0,v=0,g=0,_=0,w=0,k=0,x=0,A=0,S=0,E=0,j=0,M=0;if(e&63)return-1;if(~l)if(l&31)return-1;P[e+t|0]=r>>>24;P[e+t+1|0]=r>>>16&255;P[e+t+2|0]=r>>>8&255;P[e+t+3|0]=r&255;F(e,t+4|0,-1)|0;h=w=n,p=k=a,b=x=i,y=A=s,m=S=o,v=E=u,g=j=c,_=M=f;d=d-1|0;while((d|0)>0){O();C(w,k,x,A,S,E,j,M,0x80000000,0,0,0,0,0,0,768);w=n,k=a,x=i,A=s,S=o,E=u,j=c,M=f;z();C(w,k,x,A,S,E,j,M,0x80000000,0,0,0,0,0,0,768);w=n,k=a,x=i,A=s,S=o,E=u,j=c,M=f;h=h^n;p=p^a;b=b^i;y=y^s;m=m^o;v=v^u;g=g^c;_=_^f;d=d-1|0}n=h;a=p;i=b;s=y;o=m;u=v;c=g;f=_;if(~l)K(l);return 0}return{reset:R,init:B,process:U,finish:I,hmac_reset:O,hmac_init:D,hmac_finish:F,pbkdf2_generate_block:L}}},{}],13:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.Sha256=r._sha256_hash_size=r._sha256_block_size=void 0;var n=o(e("babel-runtime/core-js/object/create")),a=o(e("babel-runtime/core-js/object/set-prototype-of")),i=e("./sha256.asm"),s=e("../hash");function o(e){return e&&e.__esModule?e:{default:e}}var u,c=(u=a.default||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},function(e,t){function r(){this.constructor=e}u(e,t),e.prototype=null===t?(0,n.default)(t):(r.prototype=t.prototype,new r)}),f=r._sha256_block_size=64,d=r._sha256_hash_size=32,l=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.NAME="sha256",t.BLOCK_SIZE=f,t.HASH_SIZE=d,t}return c(t,e),t.bytes=function(e){return(new t).process(e).finish().result},t.NAME="sha256",t.heap_pool=[],t.asm_pool=[],t.asm_function=i.sha256_asm,t}(s.Hash);r.Sha256=l},{"../hash":9,"./sha256.asm":12,"babel-runtime/core-js/object/create":23,"babel-runtime/core-js/object/set-prototype-of":29}],14:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.SecurityError=r.IllegalArgumentError=r.IllegalStateError=void 0;var n=i(e("babel-runtime/core-js/object/create")),a=i(e("babel-runtime/core-js/object/set-prototype-of"));function i(e){return e&&e.__esModule?e:{default:e}}var s,o=(s=a.default||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},function(e,t){function r(){this.constructor=e}s(e,t),e.prototype=null===t?(0,n.default)(t):(r.prototype=t.prototype,new r)}),u=function(e){function t(){for(var t=[],r=0;r>1),n=0;n>1]=parseInt(e.substr(n,2),16);return r},r.base64_to_bytes=function(e){return i(n(e))},r.bytes_to_string=s,r.bytes_to_hex=function(e){for(var t="",r=0;r>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e+=1},r.is_number=function(e){return"number"==typeof e},r.is_string=function(e){return"string"==typeof e},r.is_buffer=function(e){return e instanceof ArrayBuffer},r.is_bytes=function(e){return e instanceof Uint8Array},r.is_typed_array=function(e){return e instanceof Int8Array||e instanceof Uint8Array||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array},r._heap_init=function(e,t){var r=e?e.byteLength:t||65536;if(4095&r||r<=0)throw new Error("heap size must be a positive integer and a multiple of 4096");return e=e||new Uint8Array(new ArrayBuffer(r))},r._heap_write=function(e,t,r,n,a){var i=e.length-t,s=i=r)throw new Error("Malformed string, low surrogate expected at position "+a);s=(55296^s)<<10|65536|56320^e.charCodeAt(a)}else if(!t&&s>>>8)throw new Error("Wide characters are not allowed.");!t||s<=127?n[i++]=s:s<=2047?(n[i++]=192|s>>6,n[i++]=128|63&s):s<=65535?(n[i++]=224|s>>12,n[i++]=128|s>>6&63,n[i++]=128|63&s):(n[i++]=240|s>>18,n[i++]=128|s>>12&63,n[i++]=128|s>>6&63,n[i++]=128|63&s)}return n.subarray(0,i)}function s(e,t){void 0===t&&(t=!1);for(var r=e.length,n=new Array(r),a=0,i=0;a=192&&s<224&&a+1=224&&s<240&&a+2=240&&s<248&&a+3>10,n[i++]=56320|1023&o)}}var u="";for(a=0;a=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return n}function u(e,t,r,n){for(var a=0,i=Math.min(e.length,r),s=t;s=49?o-49+10:o>=17?o-17+10:o}return a}i.isBN=function(e){return e instanceof i||null!==e&&"object"==typeof e&&e.constructor.wordSize===i.wordSize&&Array.isArray(e.words)},i.max=function(e,t){return e.cmp(t)>0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var a=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&a++,16===t?this._parseHex(e,a):this._parseBase(e,t,a),"-"===e[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),t,r)},i.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},i.prototype._initArray=function(e,t,r){if(n("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var a=0;a=0;a-=3)s=e[a]|e[a-1]<<8|e[a-2]<<16,this.words[i]|=s<>>26-o&67108863,(o+=24)>=26&&(o-=26,i++);else if("le"===r)for(a=0,i=0;a>>26-o&67108863,(o+=24)>=26&&(o-=26,i++);return this.strip()},i.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=6)a=o(e,r,r+6),this.words[n]|=a<>>26-i&4194303,(i+=24)>=26&&(i-=26,n++);r+6!==t&&(a=o(e,t,r+6),this.words[n]|=a<>>26-i&4194303),this.strip()},i.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,a=1;a<=67108863;a*=t)n++;n--,a=a/t|0;for(var i=e.length-r,s=i%n,o=Math.min(i,i-s)+r,c=0,f=r;f1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?""};var c=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],f=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function l(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var a=0|e.words[0],i=0|t.words[0],s=a*i,o=67108863&s,u=s/67108864|0;r.words[0]=o;for(var c=1;c>>26,d=67108863&u,l=Math.min(c,t.length-1),h=Math.max(0,c-e.length+1);h<=l;h++){var p=c-h|0;f+=(s=(a=0|e.words[p])*(i=0|t.words[h])+d)/67108864|0,d=67108863&s}r.words[c]=0|d,u=0|f}return 0!==u?r.words[c]=0|u:r.length--,r.strip()}i.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var a=0,i=0,s=0;s>>24-a&16777215)||s!==this.length-1?c[6-u.length]+u+r:u+r,(a+=2)>=26&&(a-=26,s--)}for(0!==i&&(r=i.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var l=f[e],h=d[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var b=p.modn(h).toString(e);r=(p=p.idivn(h)).isZero()?b+r:c[l-b.length]+b+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(e,t){return n(void 0!==s),this.toArrayLike(s,e,t)},i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},i.prototype.toArrayLike=function(e,t,r){var a=this.byteLength(),i=r||Math.max(1,a);n(a<=i,"byte array longer than desired length"),n(i>0,"Requested array length <= 0"),this.strip();var s,o,u="le"===t,c=new e(i),f=this.clone();if(u){for(o=0;!f.isZero();o++)s=f.andln(255),f.iushrn(8),c[o]=s;for(;o=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var a=0;a0&&(this.words[a]=~this.words[a]&67108863>>26-r),this.strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,a=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,n=e):(r=e,n=this);for(var a=0,i=0;i>>26;for(;0!==a&&i>>26;if(this.length=r.length,0!==a)this.words[this.length]=a,this.length++;else if(r!==this)for(;ie.length?this.clone().iadd(e):e.clone().iadd(this)},i.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,a=this.cmp(e);if(0===a)return this.negative=0,this.length=1,this.words[0]=0,this;a>0?(r=this,n=e):(r=e,n=this);for(var i=0,s=0;s>26,this.words[s]=67108863&t;for(;0!==i&&s>26,this.words[s]=67108863&t;if(0===i&&s>>13,h=0|s[1],p=8191&h,b=h>>>13,y=0|s[2],m=8191&y,v=y>>>13,g=0|s[3],_=8191&g,w=g>>>13,k=0|s[4],x=8191&k,A=k>>>13,S=0|s[5],E=8191&S,j=S>>>13,M=0|s[6],P=8191&M,C=M>>>13,T=0|s[7],K=8191&T,R=T>>>13,B=0|s[8],U=8191&B,I=B>>>13,O=0|s[9],z=8191&O,D=O>>>13,F=0|o[0],L=8191&F,N=F>>>13,q=0|o[1],G=8191&q,H=q>>>13,W=0|o[2],Z=8191&W,V=W>>>13,Y=0|o[3],X=8191&Y,J=Y>>>13,$=0|o[4],Q=8191&$,ee=$>>>13,te=0|o[5],re=8191&te,ne=te>>>13,ae=0|o[6],ie=8191&ae,se=ae>>>13,oe=0|o[7],ue=8191&oe,ce=oe>>>13,fe=0|o[8],de=8191&fe,le=fe>>>13,he=0|o[9],pe=8191&he,be=he>>>13;r.negative=e.negative^t.negative,r.length=19;var ye=(c+(n=Math.imul(d,L))|0)+((8191&(a=(a=Math.imul(d,N))+Math.imul(l,L)|0))<<13)|0;c=((i=Math.imul(l,N))+(a>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(p,L),a=(a=Math.imul(p,N))+Math.imul(b,L)|0,i=Math.imul(b,N);var me=(c+(n=n+Math.imul(d,G)|0)|0)+((8191&(a=(a=a+Math.imul(d,H)|0)+Math.imul(l,G)|0))<<13)|0;c=((i=i+Math.imul(l,H)|0)+(a>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(m,L),a=(a=Math.imul(m,N))+Math.imul(v,L)|0,i=Math.imul(v,N),n=n+Math.imul(p,G)|0,a=(a=a+Math.imul(p,H)|0)+Math.imul(b,G)|0,i=i+Math.imul(b,H)|0;var ve=(c+(n=n+Math.imul(d,Z)|0)|0)+((8191&(a=(a=a+Math.imul(d,V)|0)+Math.imul(l,Z)|0))<<13)|0;c=((i=i+Math.imul(l,V)|0)+(a>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(_,L),a=(a=Math.imul(_,N))+Math.imul(w,L)|0,i=Math.imul(w,N),n=n+Math.imul(m,G)|0,a=(a=a+Math.imul(m,H)|0)+Math.imul(v,G)|0,i=i+Math.imul(v,H)|0,n=n+Math.imul(p,Z)|0,a=(a=a+Math.imul(p,V)|0)+Math.imul(b,Z)|0,i=i+Math.imul(b,V)|0;var ge=(c+(n=n+Math.imul(d,X)|0)|0)+((8191&(a=(a=a+Math.imul(d,J)|0)+Math.imul(l,X)|0))<<13)|0;c=((i=i+Math.imul(l,J)|0)+(a>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(x,L),a=(a=Math.imul(x,N))+Math.imul(A,L)|0,i=Math.imul(A,N),n=n+Math.imul(_,G)|0,a=(a=a+Math.imul(_,H)|0)+Math.imul(w,G)|0,i=i+Math.imul(w,H)|0,n=n+Math.imul(m,Z)|0,a=(a=a+Math.imul(m,V)|0)+Math.imul(v,Z)|0,i=i+Math.imul(v,V)|0,n=n+Math.imul(p,X)|0,a=(a=a+Math.imul(p,J)|0)+Math.imul(b,X)|0,i=i+Math.imul(b,J)|0;var _e=(c+(n=n+Math.imul(d,Q)|0)|0)+((8191&(a=(a=a+Math.imul(d,ee)|0)+Math.imul(l,Q)|0))<<13)|0;c=((i=i+Math.imul(l,ee)|0)+(a>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(E,L),a=(a=Math.imul(E,N))+Math.imul(j,L)|0,i=Math.imul(j,N),n=n+Math.imul(x,G)|0,a=(a=a+Math.imul(x,H)|0)+Math.imul(A,G)|0,i=i+Math.imul(A,H)|0,n=n+Math.imul(_,Z)|0,a=(a=a+Math.imul(_,V)|0)+Math.imul(w,Z)|0,i=i+Math.imul(w,V)|0,n=n+Math.imul(m,X)|0,a=(a=a+Math.imul(m,J)|0)+Math.imul(v,X)|0,i=i+Math.imul(v,J)|0,n=n+Math.imul(p,Q)|0,a=(a=a+Math.imul(p,ee)|0)+Math.imul(b,Q)|0,i=i+Math.imul(b,ee)|0;var we=(c+(n=n+Math.imul(d,re)|0)|0)+((8191&(a=(a=a+Math.imul(d,ne)|0)+Math.imul(l,re)|0))<<13)|0;c=((i=i+Math.imul(l,ne)|0)+(a>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(P,L),a=(a=Math.imul(P,N))+Math.imul(C,L)|0,i=Math.imul(C,N),n=n+Math.imul(E,G)|0,a=(a=a+Math.imul(E,H)|0)+Math.imul(j,G)|0,i=i+Math.imul(j,H)|0,n=n+Math.imul(x,Z)|0,a=(a=a+Math.imul(x,V)|0)+Math.imul(A,Z)|0,i=i+Math.imul(A,V)|0,n=n+Math.imul(_,X)|0,a=(a=a+Math.imul(_,J)|0)+Math.imul(w,X)|0,i=i+Math.imul(w,J)|0,n=n+Math.imul(m,Q)|0,a=(a=a+Math.imul(m,ee)|0)+Math.imul(v,Q)|0,i=i+Math.imul(v,ee)|0,n=n+Math.imul(p,re)|0,a=(a=a+Math.imul(p,ne)|0)+Math.imul(b,re)|0,i=i+Math.imul(b,ne)|0;var ke=(c+(n=n+Math.imul(d,ie)|0)|0)+((8191&(a=(a=a+Math.imul(d,se)|0)+Math.imul(l,ie)|0))<<13)|0;c=((i=i+Math.imul(l,se)|0)+(a>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(K,L),a=(a=Math.imul(K,N))+Math.imul(R,L)|0,i=Math.imul(R,N),n=n+Math.imul(P,G)|0,a=(a=a+Math.imul(P,H)|0)+Math.imul(C,G)|0,i=i+Math.imul(C,H)|0,n=n+Math.imul(E,Z)|0,a=(a=a+Math.imul(E,V)|0)+Math.imul(j,Z)|0,i=i+Math.imul(j,V)|0,n=n+Math.imul(x,X)|0,a=(a=a+Math.imul(x,J)|0)+Math.imul(A,X)|0,i=i+Math.imul(A,J)|0,n=n+Math.imul(_,Q)|0,a=(a=a+Math.imul(_,ee)|0)+Math.imul(w,Q)|0,i=i+Math.imul(w,ee)|0,n=n+Math.imul(m,re)|0,a=(a=a+Math.imul(m,ne)|0)+Math.imul(v,re)|0,i=i+Math.imul(v,ne)|0,n=n+Math.imul(p,ie)|0,a=(a=a+Math.imul(p,se)|0)+Math.imul(b,ie)|0,i=i+Math.imul(b,se)|0;var xe=(c+(n=n+Math.imul(d,ue)|0)|0)+((8191&(a=(a=a+Math.imul(d,ce)|0)+Math.imul(l,ue)|0))<<13)|0;c=((i=i+Math.imul(l,ce)|0)+(a>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(U,L),a=(a=Math.imul(U,N))+Math.imul(I,L)|0,i=Math.imul(I,N),n=n+Math.imul(K,G)|0,a=(a=a+Math.imul(K,H)|0)+Math.imul(R,G)|0,i=i+Math.imul(R,H)|0,n=n+Math.imul(P,Z)|0,a=(a=a+Math.imul(P,V)|0)+Math.imul(C,Z)|0,i=i+Math.imul(C,V)|0,n=n+Math.imul(E,X)|0,a=(a=a+Math.imul(E,J)|0)+Math.imul(j,X)|0,i=i+Math.imul(j,J)|0,n=n+Math.imul(x,Q)|0,a=(a=a+Math.imul(x,ee)|0)+Math.imul(A,Q)|0,i=i+Math.imul(A,ee)|0,n=n+Math.imul(_,re)|0,a=(a=a+Math.imul(_,ne)|0)+Math.imul(w,re)|0,i=i+Math.imul(w,ne)|0,n=n+Math.imul(m,ie)|0,a=(a=a+Math.imul(m,se)|0)+Math.imul(v,ie)|0,i=i+Math.imul(v,se)|0,n=n+Math.imul(p,ue)|0,a=(a=a+Math.imul(p,ce)|0)+Math.imul(b,ue)|0,i=i+Math.imul(b,ce)|0;var Ae=(c+(n=n+Math.imul(d,de)|0)|0)+((8191&(a=(a=a+Math.imul(d,le)|0)+Math.imul(l,de)|0))<<13)|0;c=((i=i+Math.imul(l,le)|0)+(a>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(z,L),a=(a=Math.imul(z,N))+Math.imul(D,L)|0,i=Math.imul(D,N),n=n+Math.imul(U,G)|0,a=(a=a+Math.imul(U,H)|0)+Math.imul(I,G)|0,i=i+Math.imul(I,H)|0,n=n+Math.imul(K,Z)|0,a=(a=a+Math.imul(K,V)|0)+Math.imul(R,Z)|0,i=i+Math.imul(R,V)|0,n=n+Math.imul(P,X)|0,a=(a=a+Math.imul(P,J)|0)+Math.imul(C,X)|0,i=i+Math.imul(C,J)|0,n=n+Math.imul(E,Q)|0,a=(a=a+Math.imul(E,ee)|0)+Math.imul(j,Q)|0,i=i+Math.imul(j,ee)|0,n=n+Math.imul(x,re)|0,a=(a=a+Math.imul(x,ne)|0)+Math.imul(A,re)|0,i=i+Math.imul(A,ne)|0,n=n+Math.imul(_,ie)|0,a=(a=a+Math.imul(_,se)|0)+Math.imul(w,ie)|0,i=i+Math.imul(w,se)|0,n=n+Math.imul(m,ue)|0,a=(a=a+Math.imul(m,ce)|0)+Math.imul(v,ue)|0,i=i+Math.imul(v,ce)|0,n=n+Math.imul(p,de)|0,a=(a=a+Math.imul(p,le)|0)+Math.imul(b,de)|0,i=i+Math.imul(b,le)|0;var Se=(c+(n=n+Math.imul(d,pe)|0)|0)+((8191&(a=(a=a+Math.imul(d,be)|0)+Math.imul(l,pe)|0))<<13)|0;c=((i=i+Math.imul(l,be)|0)+(a>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(z,G),a=(a=Math.imul(z,H))+Math.imul(D,G)|0,i=Math.imul(D,H),n=n+Math.imul(U,Z)|0,a=(a=a+Math.imul(U,V)|0)+Math.imul(I,Z)|0,i=i+Math.imul(I,V)|0,n=n+Math.imul(K,X)|0,a=(a=a+Math.imul(K,J)|0)+Math.imul(R,X)|0,i=i+Math.imul(R,J)|0,n=n+Math.imul(P,Q)|0,a=(a=a+Math.imul(P,ee)|0)+Math.imul(C,Q)|0,i=i+Math.imul(C,ee)|0,n=n+Math.imul(E,re)|0,a=(a=a+Math.imul(E,ne)|0)+Math.imul(j,re)|0,i=i+Math.imul(j,ne)|0,n=n+Math.imul(x,ie)|0,a=(a=a+Math.imul(x,se)|0)+Math.imul(A,ie)|0,i=i+Math.imul(A,se)|0,n=n+Math.imul(_,ue)|0,a=(a=a+Math.imul(_,ce)|0)+Math.imul(w,ue)|0,i=i+Math.imul(w,ce)|0,n=n+Math.imul(m,de)|0,a=(a=a+Math.imul(m,le)|0)+Math.imul(v,de)|0,i=i+Math.imul(v,le)|0;var Ee=(c+(n=n+Math.imul(p,pe)|0)|0)+((8191&(a=(a=a+Math.imul(p,be)|0)+Math.imul(b,pe)|0))<<13)|0;c=((i=i+Math.imul(b,be)|0)+(a>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(z,Z),a=(a=Math.imul(z,V))+Math.imul(D,Z)|0,i=Math.imul(D,V),n=n+Math.imul(U,X)|0,a=(a=a+Math.imul(U,J)|0)+Math.imul(I,X)|0,i=i+Math.imul(I,J)|0,n=n+Math.imul(K,Q)|0,a=(a=a+Math.imul(K,ee)|0)+Math.imul(R,Q)|0,i=i+Math.imul(R,ee)|0,n=n+Math.imul(P,re)|0,a=(a=a+Math.imul(P,ne)|0)+Math.imul(C,re)|0,i=i+Math.imul(C,ne)|0,n=n+Math.imul(E,ie)|0,a=(a=a+Math.imul(E,se)|0)+Math.imul(j,ie)|0,i=i+Math.imul(j,se)|0,n=n+Math.imul(x,ue)|0,a=(a=a+Math.imul(x,ce)|0)+Math.imul(A,ue)|0,i=i+Math.imul(A,ce)|0,n=n+Math.imul(_,de)|0,a=(a=a+Math.imul(_,le)|0)+Math.imul(w,de)|0,i=i+Math.imul(w,le)|0;var je=(c+(n=n+Math.imul(m,pe)|0)|0)+((8191&(a=(a=a+Math.imul(m,be)|0)+Math.imul(v,pe)|0))<<13)|0;c=((i=i+Math.imul(v,be)|0)+(a>>>13)|0)+(je>>>26)|0,je&=67108863,n=Math.imul(z,X),a=(a=Math.imul(z,J))+Math.imul(D,X)|0,i=Math.imul(D,J),n=n+Math.imul(U,Q)|0,a=(a=a+Math.imul(U,ee)|0)+Math.imul(I,Q)|0,i=i+Math.imul(I,ee)|0,n=n+Math.imul(K,re)|0,a=(a=a+Math.imul(K,ne)|0)+Math.imul(R,re)|0,i=i+Math.imul(R,ne)|0,n=n+Math.imul(P,ie)|0,a=(a=a+Math.imul(P,se)|0)+Math.imul(C,ie)|0,i=i+Math.imul(C,se)|0,n=n+Math.imul(E,ue)|0,a=(a=a+Math.imul(E,ce)|0)+Math.imul(j,ue)|0,i=i+Math.imul(j,ce)|0,n=n+Math.imul(x,de)|0,a=(a=a+Math.imul(x,le)|0)+Math.imul(A,de)|0,i=i+Math.imul(A,le)|0;var Me=(c+(n=n+Math.imul(_,pe)|0)|0)+((8191&(a=(a=a+Math.imul(_,be)|0)+Math.imul(w,pe)|0))<<13)|0;c=((i=i+Math.imul(w,be)|0)+(a>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(z,Q),a=(a=Math.imul(z,ee))+Math.imul(D,Q)|0,i=Math.imul(D,ee),n=n+Math.imul(U,re)|0,a=(a=a+Math.imul(U,ne)|0)+Math.imul(I,re)|0,i=i+Math.imul(I,ne)|0,n=n+Math.imul(K,ie)|0,a=(a=a+Math.imul(K,se)|0)+Math.imul(R,ie)|0,i=i+Math.imul(R,se)|0,n=n+Math.imul(P,ue)|0,a=(a=a+Math.imul(P,ce)|0)+Math.imul(C,ue)|0,i=i+Math.imul(C,ce)|0,n=n+Math.imul(E,de)|0,a=(a=a+Math.imul(E,le)|0)+Math.imul(j,de)|0,i=i+Math.imul(j,le)|0;var Pe=(c+(n=n+Math.imul(x,pe)|0)|0)+((8191&(a=(a=a+Math.imul(x,be)|0)+Math.imul(A,pe)|0))<<13)|0;c=((i=i+Math.imul(A,be)|0)+(a>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(z,re),a=(a=Math.imul(z,ne))+Math.imul(D,re)|0,i=Math.imul(D,ne),n=n+Math.imul(U,ie)|0,a=(a=a+Math.imul(U,se)|0)+Math.imul(I,ie)|0,i=i+Math.imul(I,se)|0,n=n+Math.imul(K,ue)|0,a=(a=a+Math.imul(K,ce)|0)+Math.imul(R,ue)|0,i=i+Math.imul(R,ce)|0,n=n+Math.imul(P,de)|0,a=(a=a+Math.imul(P,le)|0)+Math.imul(C,de)|0,i=i+Math.imul(C,le)|0;var Ce=(c+(n=n+Math.imul(E,pe)|0)|0)+((8191&(a=(a=a+Math.imul(E,be)|0)+Math.imul(j,pe)|0))<<13)|0;c=((i=i+Math.imul(j,be)|0)+(a>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(z,ie),a=(a=Math.imul(z,se))+Math.imul(D,ie)|0,i=Math.imul(D,se),n=n+Math.imul(U,ue)|0,a=(a=a+Math.imul(U,ce)|0)+Math.imul(I,ue)|0,i=i+Math.imul(I,ce)|0,n=n+Math.imul(K,de)|0,a=(a=a+Math.imul(K,le)|0)+Math.imul(R,de)|0,i=i+Math.imul(R,le)|0;var Te=(c+(n=n+Math.imul(P,pe)|0)|0)+((8191&(a=(a=a+Math.imul(P,be)|0)+Math.imul(C,pe)|0))<<13)|0;c=((i=i+Math.imul(C,be)|0)+(a>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(z,ue),a=(a=Math.imul(z,ce))+Math.imul(D,ue)|0,i=Math.imul(D,ce),n=n+Math.imul(U,de)|0,a=(a=a+Math.imul(U,le)|0)+Math.imul(I,de)|0,i=i+Math.imul(I,le)|0;var Ke=(c+(n=n+Math.imul(K,pe)|0)|0)+((8191&(a=(a=a+Math.imul(K,be)|0)+Math.imul(R,pe)|0))<<13)|0;c=((i=i+Math.imul(R,be)|0)+(a>>>13)|0)+(Ke>>>26)|0,Ke&=67108863,n=Math.imul(z,de),a=(a=Math.imul(z,le))+Math.imul(D,de)|0,i=Math.imul(D,le);var Re=(c+(n=n+Math.imul(U,pe)|0)|0)+((8191&(a=(a=a+Math.imul(U,be)|0)+Math.imul(I,pe)|0))<<13)|0;c=((i=i+Math.imul(I,be)|0)+(a>>>13)|0)+(Re>>>26)|0,Re&=67108863;var Be=(c+(n=Math.imul(z,pe))|0)+((8191&(a=(a=Math.imul(z,be))+Math.imul(D,pe)|0))<<13)|0;return c=((i=Math.imul(D,be))+(a>>>13)|0)+(Be>>>26)|0,Be&=67108863,u[0]=ye,u[1]=me,u[2]=ve,u[3]=ge,u[4]=_e,u[5]=we,u[6]=ke,u[7]=xe,u[8]=Ae,u[9]=Se,u[10]=Ee,u[11]=je,u[12]=Me,u[13]=Pe,u[14]=Ce,u[15]=Te,u[16]=Ke,u[17]=Re,u[18]=Be,0!==c&&(u[19]=c,r.length++),r};function p(e,t,r){return(new b).mulp(e,t,r)}function b(e,t){this.x=e,this.y=t}Math.imul||(h=l),i.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?h(this,e,t):r<63?l(this,e,t):r<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,a=0,i=0;i>>26)|0)>>>26,s&=67108863}r.words[i]=o,n=s,s=a}return 0!==n?r.words[i]=n:r.length--,r.strip()}(this,e,t):p(this,e,t)},b.prototype.makeRBT=function(e){for(var t=new Array(e),r=i.prototype._countBits(e)-1,n=0;n>=1;return n},b.prototype.permute=function(e,t,r,n,a,i){for(var s=0;s>>=1)a++;return 1<>>=13,r[2*s+1]=8191&i,i>>>=13;for(s=2*t;s>=26,t+=a/67108864|0,t+=i>>>26,this.words[r]=67108863&i}return 0!==t&&(this.words[r]=t,this.length++),this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>a}return t}(e);if(0===t.length)return new i(1);for(var r=this,n=0;n=0);var t,r=e%26,a=(e-r)/26,i=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(t=0;t>>26-r}s&&(this.words[t]=s,this.length++)}if(0!==a){for(t=this.length-1;t>=0;t--)this.words[t+a]=this.words[t];for(t=0;t=0),a=t?(t-t%26)/26:0;var i=e%26,s=Math.min((e-i)/26,this.length),o=67108863^67108863>>>i<s)for(this.length-=s,c=0;c=0&&(0!==f||c>=a);c--){var d=0|this.words[c];this.words[c]=f<<26-i|d>>>i,f=d&o}return u&&0!==f&&(u.words[u.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,a=1<=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var a=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},i.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(u/67108864|0),this.words[a+r]=67108863&i}for(;a>26,this.words[a+r]=67108863&i;if(0===o)return this.strip();for(n(-1===o),o=0,a=0;a>26,this.words[a]=67108863&i;return this.negative=1,this.strip()},i.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),a=e,s=0|a.words[a.length-1];0!==(r=26-this._countBits(s))&&(a=a.ushln(r),n.iushln(r),s=0|a.words[a.length-1]);var o,u=n.length-a.length;if("mod"!==t){(o=new i(null)).length=u+1,o.words=new Array(o.length);for(var c=0;c=0;d--){var l=67108864*(0|n.words[a.length+d])+(0|n.words[a.length+d-1]);for(l=Math.min(l/s|0,67108863),n._ishlnsubmul(a,l,d);0!==n.negative;)l--,n.negative=0,n._ishlnsubmul(a,1,d),n.isZero()||(n.negative^=1);o&&(o.words[d]=l)}return o&&o.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:o||null,mod:n}},i.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(o=this.neg().divmod(e,t),"mod"!==t&&(a=o.div.neg()),"div"!==t&&(s=o.mod.neg(),r&&0!==s.negative&&s.iadd(e)),{div:a,mod:s}):0===this.negative&&0!==e.negative?(o=this.divmod(e.neg(),t),"mod"!==t&&(a=o.div.neg()),{div:a,mod:o.mod}):0!=(this.negative&e.negative)?(o=this.neg().divmod(e.neg(),t),"div"!==t&&(s=o.mod.neg(),r&&0!==s.negative&&s.isub(e)),{div:o.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modn(e.words[0]))}:this._wordDiv(e,t);var a,s,o},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),a=e.andln(1),i=r.cmp(n);return i<0||1===a&&0===i?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,a=this.length-1;a>=0;a--)r=(t*r+(0|this.words[a]))%e;return r},i.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var a=(0|this.words[r])+67108864*t;this.words[r]=a/e|0,t=a%e}return this.strip()},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var a=new i(1),s=new i(0),o=new i(0),u=new i(1),c=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++c;for(var f=r.clone(),d=t.clone();!t.isZero();){for(var l=0,h=1;0==(t.words[0]&h)&&l<26;++l,h<<=1);if(l>0)for(t.iushrn(l);l-- >0;)(a.isOdd()||s.isOdd())&&(a.iadd(f),s.isub(d)),a.iushrn(1),s.iushrn(1);for(var p=0,b=1;0==(r.words[0]&b)&&p<26;++p,b<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(o.isOdd()||u.isOdd())&&(o.iadd(f),u.isub(d)),o.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),a.isub(o),s.isub(u)):(r.isub(t),o.isub(a),u.isub(s))}return{a:o,b:u,gcd:r.iushln(c)}},i.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var a,s=new i(1),o=new i(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,f=1;0==(t.words[0]&f)&&c<26;++c,f<<=1);if(c>0)for(t.iushrn(c);c-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var d=0,l=1;0==(r.words[0]&l)&&d<26;++d,l<<=1);if(d>0)for(r.iushrn(d);d-- >0;)o.isOdd()&&o.iadd(u),o.iushrn(1);t.cmp(r)>=0?(t.isub(r),s.isub(o)):(r.isub(t),o.isub(s))}return(a=0===t.cmpn(1)?s:o).cmpn(0)<0&&a.iadd(e),a},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var a=t.cmp(r);if(a<0){var i=t;t=r,r=i}else if(0===a||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return 0==(1&this.words[0])},i.prototype.isOdd=function(){return 1==(1&this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,a=1<>>26,o&=67108863,this.words[s]=o}return 0!==i&&(this.words[s]=i,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var a=0|this.words[0];t=a===e?0:ae.length)return 1;if(this.length=0;r--){var n=0|this.words[r],a=0|e.words[r];if(n!==a){na&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new k(e)},i.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var y={k256:null,p224:null,p192:null,p25519:null};function m(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){m.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function g(){m.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){m.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){m.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function k(e){if("string"==typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function x(e){k.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}m.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},m.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t0?r.isub(this.p):r.strip(),r},m.prototype.split=function(e,t){e.iushrn(this.n,0,t)},m.prototype.imulK=function(e){return e.imul(this.k)},a(v,m),v.prototype.split=function(e,t){for(var r=Math.min(e.length,9),n=0;n>>22,a=i}a>>>=22,e.words[n-10]=a,0===a&&e.length>10?e.length-=10:e.length-=9},v.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=a,t=n}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(y[e])return y[e];var t;if("k256"===e)t=new v;else if("p224"===e)t=new g;else if("p192"===e)t=new _;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new w}return y[e]=t,t},k.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},k.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},k.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},k.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},k.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},k.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},k.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},k.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},k.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},k.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},k.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},k.prototype.isqr=function(e){return this.imul(e,e.clone())},k.prototype.sqr=function(e){return this.mul(e,e)},k.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new i(1)).iushrn(2);return this.pow(e,r)}for(var a=this.m.subn(1),s=0;!a.isZero()&&0===a.andln(1);)s++,a.iushrn(1);n(!a.isZero());var o=new i(1).toRed(this),u=o.redNeg(),c=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new i(2*f*f).toRed(this);0!==this.pow(f,c).cmp(u);)f.redIAdd(u);for(var d=this.pow(f,a),l=this.pow(e,a.addn(1).iushrn(1)),h=this.pow(e,a),p=s;0!==h.cmp(o);){for(var b=h,y=0;0!==b.cmp(o);y++)b=b.redSqr();n(y=0;n--){for(var c=t.words[n],f=u-1;f>=0;f--){var d=c>>f&1;a!==r[0]&&(a=this.sqr(a)),0!==d||0!==s?(s<<=1,s|=d,(4===++o||0===n&&0===f)&&(a=this.mul(a,r[s]),o=0,s=0)):o=0}u=26}return a},k.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},k.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new x(e)},a(x,k),x.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},x.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},x.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=r.isub(n).iushrn(this.shift),i=a;return a.cmp(this.m)>=0?i=a.isub(this.m):a.cmpn(0)<0&&(i=a.iadd(this.m)),i._forceRed(this)},x.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=r.isub(n).iushrn(this.shift),s=a;return a.cmp(this.m)>=0?s=a.isub(this.m):a.cmpn(0)<0&&(s=a.iadd(this.m)),s._forceRed(this)},x.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===t||t,this)},{buffer:"buffer"}],45:[function(e,t,r){var n;function a(e){this.rand=e}if(t.exports=function(e){return n||(n=new a(null)),n.generate(e)},t.exports.Rand=a,a.prototype.generate=function(e){return this._rand(e)},a.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),r=0;rf;)if((o=u[f++])!=o)return!0}else for(;c>f;f++)if((e||f in u)&&u[f]===r)return e||f||0;return!e&&-1}}},{"./_to-absolute-index":148,"./_to-iobject":150,"./_to-length":151}],79:[function(e,t,r){var n=e("./_ctx"),a=e("./_iobject"),i=e("./_to-object"),s=e("./_to-length"),o=e("./_array-species-create");t.exports=function(e,t){var r=1==e,u=2==e,c=3==e,f=4==e,d=6==e,l=5==e||d,h=t||o;return function(t,o,p){for(var b,y,m=i(t),v=a(m),g=n(o,p,3),_=s(v.length),w=0,k=r?h(t,_):u?h(t,0):void 0;_>w;w++)if((l||w in v)&&(y=g(b=v[w],w,m),e))if(r)k[w]=y;else if(y)switch(e){case 3:return!0;case 5:return b;case 6:return w;case 2:k.push(b)}else if(f)return!1;return d?-1:c||f?f:k}}},{"./_array-species-create":81,"./_ctx":88,"./_iobject":103,"./_to-length":151,"./_to-object":152}],80:[function(e,t,r){var n=e("./_is-object"),a=e("./_is-array"),i=e("./_wks")("species");t.exports=function(e){var t;return a(e)&&("function"!=typeof(t=e.constructor)||t!==Array&&!a(t.prototype)||(t=void 0),n(t)&&null===(t=t[i])&&(t=void 0)),void 0===t?Array:t}},{"./_is-array":105,"./_is-object":107,"./_wks":158}],81:[function(e,t,r){var n=e("./_array-species-constructor");t.exports=function(e,t){return new(n(e))(t)}},{"./_array-species-constructor":80}],82:[function(e,t,r){var n=e("./_cof"),a=e("./_wks")("toStringTag"),i="Arguments"==n(function(){return arguments}());t.exports=function(e){var t,r,s;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=function(e,t){try{return e[t]}catch(r){}}(t=Object(e),a))?r:i?n(t):"Object"==(s=n(t))&&"function"==typeof t.callee?"Arguments":s}},{"./_cof":83,"./_wks":158}],83:[function(e,t,r){var n={}.toString;t.exports=function(e){return n.call(e).slice(8,-1)}},{}],84:[function(e,t,r){"use strict";var n=e("./_redefine-all"),a=e("./_meta").getWeak,i=e("./_an-object"),s=e("./_is-object"),o=e("./_an-instance"),u=e("./_for-of"),c=e("./_array-methods"),f=e("./_has"),d=e("./_validate-collection"),l=c(5),h=c(6),p=0,b=function(e){return e._l||(e._l=new y)},y=function(){this.a=[]},m=function(e,t){return l(e.a,function(e){return e[0]===t})};y.prototype={get:function(e){var t=m(this,e);if(t)return t[1]},has:function(e){return!!m(this,e)},set:function(e,t){var r=m(this,e);r?r[1]=t:this.a.push([e,t])},delete:function(e){var t=h(this.a,function(t){return t[0]===e});return~t&&this.a.splice(t,1),!!~t}},t.exports={getConstructor:function(e,t,r,i){var c=e(function(e,n){o(e,c,t,"_i"),e._t=t,e._i=p++,e._l=void 0,null!=n&&u(n,r,e[i],e)});return n(c.prototype,{delete:function(e){if(!s(e))return!1;var r=a(e);return!0===r?b(d(this,t)).delete(e):r&&f(r,this._i)&&delete r[this._i]},has:function(e){if(!s(e))return!1;var r=a(e);return!0===r?b(d(this,t)).has(e):r&&f(r,this._i)}}),c},def:function(e,t,r){var n=a(i(t),!0);return!0===n?b(e).set(t,r):n[e._i]=r,e},ufstore:b}},{"./_an-instance":76,"./_an-object":77,"./_array-methods":79,"./_for-of":96,"./_has":98,"./_is-object":107,"./_meta":115,"./_redefine-all":136,"./_validate-collection":155}],85:[function(e,t,r){"use strict";var n=e("./_global"),a=e("./_export"),i=e("./_meta"),s=e("./_fails"),o=e("./_hide"),u=e("./_redefine-all"),c=e("./_for-of"),f=e("./_an-instance"),d=e("./_is-object"),l=e("./_set-to-string-tag"),h=e("./_object-dp").f,p=e("./_array-methods")(0),b=e("./_descriptors");t.exports=function(e,t,r,y,m,v){var g=n[e],_=g,w=m?"set":"add",k=_&&_.prototype,x={};return b&&"function"==typeof _&&(v||k.forEach&&!s(function(){(new _).entries().next()}))?(_=t(function(t,r){f(t,_,e,"_c"),t._c=new g,null!=r&&c(r,m,t[w],t)}),p("add,clear,delete,forEach,get,has,set,keys,values,entries,toJSON".split(","),function(e){var t="add"==e||"set"==e;e in k&&(!v||"clear"!=e)&&o(_.prototype,e,function(r,n){if(f(this,_,e),!t&&v&&!d(r))return"get"==e&&void 0;var a=this._c[e](0===r?0:r,n);return t?this:a})}),v||h(_.prototype,"size",{get:function(){return this._c.size}})):(_=y.getConstructor(t,e,m,w),u(_.prototype,r),i.NEED=!0),l(_,e),x[e]=_,a(a.G+a.W+a.F,x),v||y.setStrong(_,e,m),_}},{"./_an-instance":76,"./_array-methods":79,"./_descriptors":90,"./_export":94,"./_fails":95,"./_for-of":96,"./_global":97,"./_hide":99,"./_is-object":107,"./_meta":115,"./_object-dp":120,"./_redefine-all":136,"./_set-to-string-tag":142}],86:[function(e,t,r){var n=t.exports={version:"2.5.3"};"number"==typeof __e&&(__e=n)},{}],87:[function(e,t,r){"use strict";var n=e("./_object-dp"),a=e("./_property-desc");t.exports=function(e,t,r){t in e?n.f(e,t,a(0,r)):e[t]=r}},{"./_object-dp":120,"./_property-desc":135}],88:[function(e,t,r){var n=e("./_a-function");t.exports=function(e,t,r){if(n(e),void 0===t)return e;switch(r){case 1:return function(r){return e.call(t,r)};case 2:return function(r,n){return e.call(t,r,n)};case 3:return function(r,n,a){return e.call(t,r,n,a)}}return function(){return e.apply(t,arguments)}}},{"./_a-function":74}],89:[function(e,t,r){t.exports=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e}},{}],90:[function(e,t,r){t.exports=!e("./_fails")(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},{"./_fails":95}],91:[function(e,t,r){var n=e("./_is-object"),a=e("./_global").document,i=n(a)&&n(a.createElement);t.exports=function(e){return i?a.createElement(e):{}}},{"./_global":97,"./_is-object":107}],92:[function(e,t,r){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},{}],93:[function(e,t,r){var n=e("./_object-keys"),a=e("./_object-gops"),i=e("./_object-pie");t.exports=function(e){var t=n(e),r=a.f;if(r)for(var s,o=r(e),u=i.f,c=0;o.length>c;)u.call(e,s=o[c++])&&t.push(s);return t}},{"./_object-gops":125,"./_object-keys":128,"./_object-pie":129}],94:[function(e,t,r){var n=e("./_global"),a=e("./_core"),i=e("./_ctx"),s=e("./_hide"),o=function(e,t,r){var u,c,f,d=e&o.F,l=e&o.G,h=e&o.S,p=e&o.P,b=e&o.B,y=e&o.W,m=l?a:a[t]||(a[t]={}),v=m.prototype,g=l?n:h?n[t]:(n[t]||{}).prototype;for(u in l&&(r=t),r)(c=!d&&g&&void 0!==g[u])&&u in m||(f=c?g[u]:r[u],m[u]=l&&"function"!=typeof g[u]?r[u]:b&&c?i(f,n):y&&g[u]==f?function(e){var t=function(t,r,n){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,r)}return new e(t,r,n)}return e.apply(this,arguments)};return t.prototype=e.prototype,t}(f):p&&"function"==typeof f?i(Function.call,f):f,p&&((m.virtual||(m.virtual={}))[u]=f,e&o.R&&v&&!v[u]&&s(v,u,f)))};o.F=1,o.G=2,o.S=4,o.P=8,o.B=16,o.W=32,o.U=64,o.R=128,t.exports=o},{"./_core":86,"./_ctx":88,"./_global":97,"./_hide":99}],95:[function(e,t,r){t.exports=function(e){try{return!!e()}catch(t){return!0}}},{}],96:[function(e,t,r){var n=e("./_ctx"),a=e("./_iter-call"),i=e("./_is-array-iter"),s=e("./_an-object"),o=e("./_to-length"),u=e("./core.get-iterator-method"),c={},f={};(r=t.exports=function(e,t,r,d,l){var h,p,b,y,m=l?function(){return e}:u(e),v=n(r,d,t?2:1),g=0;if("function"!=typeof m)throw TypeError(e+" is not iterable!");if(i(m)){for(h=o(e.length);h>g;g++)if((y=t?v(s(p=e[g])[0],p[1]):v(e[g]))===c||y===f)return y}else for(b=m.call(e);!(p=b.next()).done;)if((y=a(b,v,p.value,t))===c||y===f)return y}).BREAK=c,r.RETURN=f},{"./_an-object":77,"./_ctx":88,"./_is-array-iter":104,"./_iter-call":108,"./_to-length":151,"./core.get-iterator-method":159}],97:[function(e,t,r){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},{}],98:[function(e,t,r){var n={}.hasOwnProperty;t.exports=function(e,t){return n.call(e,t)}},{}],99:[function(e,t,r){var n=e("./_object-dp"),a=e("./_property-desc");t.exports=e("./_descriptors")?function(e,t,r){return n.f(e,t,a(1,r))}:function(e,t,r){return e[t]=r,e}},{"./_descriptors":90,"./_object-dp":120,"./_property-desc":135}],100:[function(e,t,r){var n=e("./_global").document;t.exports=n&&n.documentElement},{"./_global":97}],101:[function(e,t,r){t.exports=!e("./_descriptors")&&!e("./_fails")(function(){return 7!=Object.defineProperty(e("./_dom-create")("div"),"a",{get:function(){return 7}}).a})},{"./_descriptors":90,"./_dom-create":91,"./_fails":95}],102:[function(e,t,r){t.exports=function(e,t,r){var n=void 0===r;switch(t.length){case 0:return n?e():e.call(r);case 1:return n?e(t[0]):e.call(r,t[0]);case 2:return n?e(t[0],t[1]):e.call(r,t[0],t[1]);case 3:return n?e(t[0],t[1],t[2]):e.call(r,t[0],t[1],t[2]);case 4:return n?e(t[0],t[1],t[2],t[3]):e.call(r,t[0],t[1],t[2],t[3])}return e.apply(r,t)}},{}],103:[function(e,t,r){var n=e("./_cof");t.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==n(e)?e.split(""):Object(e)}},{"./_cof":83}],104:[function(e,t,r){var n=e("./_iterators"),a=e("./_wks")("iterator"),i=Array.prototype;t.exports=function(e){return void 0!==e&&(n.Array===e||i[a]===e)}},{"./_iterators":113,"./_wks":158}],105:[function(e,t,r){var n=e("./_cof");t.exports=Array.isArray||function(e){return"Array"==n(e)}},{"./_cof":83}],106:[function(e,t,r){var n=e("./_is-object"),a=Math.floor;t.exports=function(e){return!n(e)&&isFinite(e)&&a(e)===e}},{"./_is-object":107}],107:[function(e,t,r){t.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},{}],108:[function(e,t,r){var n=e("./_an-object");t.exports=function(e,t,r,a){try{return a?t(n(r)[0],r[1]):t(r)}catch(s){var i=e.return;throw void 0!==i&&n(i.call(e)),s}}},{"./_an-object":77}],109:[function(e,t,r){"use strict";var n=e("./_object-create"),a=e("./_property-desc"),i=e("./_set-to-string-tag"),s={};e("./_hide")(s,e("./_wks")("iterator"),function(){return this}),t.exports=function(e,t,r){e.prototype=n(s,{next:a(1,r)}),i(e,t+" Iterator")}},{"./_hide":99,"./_object-create":119,"./_property-desc":135,"./_set-to-string-tag":142,"./_wks":158}],110:[function(e,t,r){"use strict";var n=e("./_library"),a=e("./_export"),i=e("./_redefine"),s=e("./_hide"),o=e("./_has"),u=e("./_iterators"),c=e("./_iter-create"),f=e("./_set-to-string-tag"),d=e("./_object-gpo"),l=e("./_wks")("iterator"),h=!([].keys&&"next"in[].keys()),p=function(){return this};t.exports=function(e,t,r,b,y,m,v){c(r,t,b);var g,_,w,k=function(e){if(!h&&e in E)return E[e];switch(e){case"keys":case"values":return function(){return new r(this,e)}}return function(){return new r(this,e)}},x=t+" Iterator",A="values"==y,S=!1,E=e.prototype,j=E[l]||E["@@iterator"]||y&&E[y],M=!h&&j||k(y),P=y?A?k("entries"):M:void 0,C="Array"==t&&E.entries||j;if(C&&(w=d(C.call(new e)))!==Object.prototype&&w.next&&(f(w,x,!0),n||o(w,l)||s(w,l,p)),A&&j&&"values"!==j.name&&(S=!0,M=function(){return j.call(this)}),n&&!v||!h&&!S&&E[l]||s(E,l,M),u[t]=M,u[x]=p,y)if(g={values:A?M:k("values"),keys:m?M:k("keys"),entries:P},v)for(_ in g)_ in E||i(E,_,g[_]);else a(a.P+a.F*(h||S),t,g);return g}},{"./_export":94,"./_has":98,"./_hide":99,"./_iter-create":109,"./_iterators":113,"./_library":114,"./_object-gpo":126,"./_redefine":137,"./_set-to-string-tag":142,"./_wks":158}],111:[function(e,t,r){var n=e("./_wks")("iterator"),a=!1;try{var i=[7][n]();i.return=function(){a=!0},Array.from(i,function(){throw 2})}catch(s){}t.exports=function(e,t){if(!t&&!a)return!1;var r=!1;try{var i=[7],o=i[n]();o.next=function(){return{done:r=!0}},i[n]=function(){return o},e(i)}catch(s){}return r}},{"./_wks":158}],112:[function(e,t,r){t.exports=function(e,t){return{value:t,done:!!e}}},{}],113:[function(e,t,r){t.exports={}},{}],114:[function(e,t,r){t.exports=!0},{}],115:[function(e,t,r){var n=e("./_uid")("meta"),a=e("./_is-object"),i=e("./_has"),s=e("./_object-dp").f,o=0,u=Object.isExtensible||function(){return!0},c=!e("./_fails")(function(){return u(Object.preventExtensions({}))}),f=function(e){s(e,n,{value:{i:"O"+ ++o,w:{}}})},d=t.exports={KEY:n,NEED:!1,fastKey:function(e,t){if(!a(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!i(e,n)){if(!u(e))return"F";if(!t)return"E";f(e)}return e[n].i},getWeak:function(e,t){if(!i(e,n)){if(!u(e))return!0;if(!t)return!1;f(e)}return e[n].w},onFreeze:function(e){return c&&d.NEED&&u(e)&&!i(e,n)&&f(e),e}}},{"./_fails":95,"./_has":98,"./_is-object":107,"./_object-dp":120,"./_uid":154}],116:[function(e,t,r){var n=e("./_global"),a=e("./_task").set,i=n.MutationObserver||n.WebKitMutationObserver,s=n.process,o=n.Promise,u="process"==e("./_cof")(s);t.exports=function(){var e,t,r,c=function(){var n,a;for(u&&(n=s.domain)&&n.exit();e;){a=e.fn,e=e.next;try{a()}catch(i){throw e?r():t=void 0,i}}t=void 0,n&&n.enter()};if(u)r=function(){s.nextTick(c)};else if(!i||n.navigator&&n.navigator.standalone)if(o&&o.resolve){var f=o.resolve();r=function(){f.then(c)}}else r=function(){a.call(n,c)};else{var d=!0,l=document.createTextNode("");new i(c).observe(l,{characterData:!0}),r=function(){l.data=d=!d}}return function(n){var a={fn:n,next:void 0};t&&(t.next=a),e||(e=a,r()),t=a}}},{"./_cof":83,"./_global":97,"./_task":147}],117:[function(e,t,r){"use strict";var n=e("./_a-function");function a(e){var t,r;this.promise=new e(function(e,n){if(void 0!==t||void 0!==r)throw TypeError("Bad Promise constructor");t=e,r=n}),this.resolve=n(t),this.reject=n(r)}t.exports.f=function(e){return new a(e)}},{"./_a-function":74}],118:[function(e,t,r){"use strict";var n=e("./_object-keys"),a=e("./_object-gops"),i=e("./_object-pie"),s=e("./_to-object"),o=e("./_iobject"),u=Object.assign;t.exports=!u||e("./_fails")(function(){var e={},t={},r=Symbol(),n="abcdefghijklmnopqrst";return e[r]=7,n.split("").forEach(function(e){t[e]=e}),7!=u({},e)[r]||Object.keys(u({},t)).join("")!=n})?function(e,t){for(var r=s(e),u=arguments.length,c=1,f=a.f,d=i.f;u>c;)for(var l,h=o(arguments[c++]),p=f?n(h).concat(f(h)):n(h),b=p.length,y=0;b>y;)d.call(h,l=p[y++])&&(r[l]=h[l]);return r}:u},{"./_fails":95,"./_iobject":103,"./_object-gops":125,"./_object-keys":128,"./_object-pie":129,"./_to-object":152}],119:[function(e,t,r){var n=e("./_an-object"),a=e("./_object-dps"),i=e("./_enum-bug-keys"),s=e("./_shared-key")("IE_PROTO"),o=function(){},u=function(){var t,r=e("./_dom-create")("iframe"),n=i.length;for(r.style.display="none",e("./_html").appendChild(r),r.src="javascript:",(t=r.contentWindow.document).open(),t.write("