UNPKG

openpgp

Version:

OpenPGP.js is a Javascript implementation of the OpenPGP protocol. This is defined in RFC 4880.

2 lines 391 kB
/*! OpenPGP.js v6.2.0 - 2025-07-17 - this is LGPL licensed code, see LICENSE/our website https://openpgpjs.org/ for more information. */ const t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};import{createRequire as e}from"module";import*as r from"node:crypto";function i(t,e){return e.forEach((function(e){e&&"string"!=typeof e&&!Array.isArray(e)&&Object.keys(e).forEach((function(r){if("default"!==r&&!(r in t)){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}}))})),Object.freeze(t)}const n=Symbol("doneWritingPromise"),s=Symbol("doneWritingResolve"),a=Symbol("doneWritingReject"),o=Symbol("readingIndex");class c extends Array{constructor(){super(),Object.setPrototypeOf(this,c.prototype),this[n]=new Promise(((t,e)=>{this[s]=t,this[a]=e})),this[n].catch((()=>{}))}}function h(t){return t&&t.getReader&&Array.isArray(t)}function u(t){if(!h(t)){const e=t.getWriter(),r=e.releaseLock;return e.releaseLock=()=>{e.closed.catch((function(){})),r.call(e)},e}this.stream=t}function f(e){if(h(e))return"array";if(t.ReadableStream&&t.ReadableStream.prototype.isPrototypeOf(e))return"web";if(e&&!(t.ReadableStream&&e instanceof t.ReadableStream)&&"function"==typeof e._read&&"object"==typeof e._readableState)throw Error("Native Node streams are no longer supported: please manually convert the stream to a WebStream, using e.g. `stream.Readable.toWeb`");return!(!e||!e.getReader)&&"web-like"}function l(t){return Uint8Array.prototype.isPrototypeOf(t)}function y(t){if(1===t.length)return t[0];let e=0;for(let r=0;r<t.length;r++){if(!l(t[r]))throw Error("concatUint8Array: Data must be in the form of a Uint8Array");e+=t[r].length}const r=new Uint8Array(e);let i=0;return t.forEach((function(t){r.set(t,i),i+=t.length})),r}c.prototype.getReader=function(){return void 0===this[o]&&(this[o]=0),{read:async()=>(await this[n],this[o]===this.length?{value:void 0,done:!0}:{value:this[this[o]++],done:!1})}},c.prototype.readToEnd=async function(t){await this[n];const e=t(this.slice(this[o]));return this.length=0,e},c.prototype.clone=function(){const t=new c;return t[n]=this[n].then((()=>{t.push(...this)})),t},u.prototype.write=async function(t){this.stream.push(t)},u.prototype.close=async function(){this.stream[s]()},u.prototype.abort=async function(t){return this.stream[a](t),t},u.prototype.releaseLock=function(){},"object"==typeof t.process&&t.process.versions;const g=new WeakSet,p=Symbol("externalBuffer");function d(t){if(this.stream=t,t[p]&&(this[p]=t[p].slice()),h(t)){const e=t.getReader();return this._read=e.read.bind(e),this._releaseLock=()=>{},void(this._cancel=()=>{})}if(f(t)){const e=t.getReader();return this._read=e.read.bind(e),this._releaseLock=()=>{e.closed.catch((function(){})),e.releaseLock()},void(this._cancel=e.cancel.bind(e))}let e=!1;this._read=async()=>e||g.has(t)?{value:void 0,done:!0}:(e=!0,{value:t,done:!1}),this._releaseLock=()=>{if(e)try{g.add(t)}catch(t){}}}function A(t){return f(t)?t:new ReadableStream({start(e){e.enqueue(t),e.close()}})}function w(t){if(f(t))return t;const e=new c;return(async()=>{const r=R(e);await r.write(t),await r.close()})(),e}function m(t){return t.some((t=>f(t)&&!h(t)))?function(t){t=t.map(A);const e=E((async function(t){await Promise.all(i.map((e=>P(e,t))))}));let r=Promise.resolve();const i=t.map(((i,n)=>I(i,((i,s)=>(r=r.then((()=>b(i,e.writable,{preventClose:n!==t.length-1}))),r)))));return e.readable}(t):t.some((t=>h(t)))?function(t){const e=new c;let r=Promise.resolve();return t.forEach(((i,n)=>(r=r.then((()=>b(i,e,{preventClose:n!==t.length-1}))),r))),e}(t):"string"==typeof t[0]?t.join(""):y(t)}async function b(t,e,{preventClose:r=!1,preventAbort:i=!1,preventCancel:n=!1}={}){if(f(t)&&!h(t)){t=A(t);try{if(t[p]){const r=R(e);for(let e=0;e<t[p].length;e++)await r.ready,await r.write(t[p][e]);r.releaseLock()}await t.pipeTo(e,{preventClose:r,preventAbort:i,preventCancel:n})}catch(t){}return}const s=Q(t=w(t)),a=R(e);try{for(;;){await a.ready;const{done:t,value:e}=await s.read();if(t){r||await a.close();break}await a.write(e)}}catch(t){i||await a.abort(t)}finally{s.releaseLock(),a.releaseLock()}}function k(t,e){const r=new TransformStream(e);return b(t,r.writable),r.readable}function E(t){let e,r,i,n=!1,s=!1;return{readable:new ReadableStream({start(t){i=t},pull(){e?e():n=!0},async cancel(e){s=!0,t&&await t(e),r&&r(e)}},{highWaterMark:0}),writable:new WritableStream({write:async function(t){if(s)throw Error("Stream is cancelled");i.enqueue(t),n?n=!1:(await new Promise(((t,i)=>{e=t,r=i})),e=null,r=null)},close:i.close.bind(i),abort:i.error.bind(i)})}}function v(t,e=()=>{},r=()=>{}){if(h(t)){const i=new c;return(async()=>{const n=R(i);try{const i=await U(t),s=e(i),a=r();let o;o=void 0!==s&&void 0!==a?m([s,a]):void 0!==s?s:a,await n.write(o),await n.close()}catch(t){await n.abort(t)}})(),i}if(f(t))return k(t,{async transform(t,r){try{const i=await e(t);void 0!==i&&r.enqueue(i)}catch(t){r.error(t)}},async flush(t){try{const e=await r();void 0!==e&&t.enqueue(e)}catch(e){t.error(e)}}});const i=e(t),n=r();return void 0!==i&&void 0!==n?m([i,n]):void 0!==i?i:n}function I(t,e){if(f(t)&&!h(t)){let r;const i=new TransformStream({start(t){r=t}}),n=b(t,i.writable),s=E((async function(t){r.error(t),await n,await new Promise(setTimeout)}));return e(i.readable,s.writable),s.readable}t=w(t);const r=new c;return e(t,r),r}function B(t,e){let r;const i=I(t,((t,n)=>{const s=Q(t);s.remainder=()=>(s.releaseLock(),b(t,n),i),r=e(s)}));return r}function S(t){if(h(t))return t.clone();if(f(t)){const e=function(t){if(h(t))throw Error("ArrayStream cannot be tee()d, use clone() instead");if(f(t)){const e=A(t).tee();return e[0][p]=e[1][p]=t[p],e}return[D(t),D(t)]}(t);return C(t,e[0]),e[1]}return D(t)}function K(t){return h(t)?S(t):f(t)?new ReadableStream({start(e){const r=I(t,(async(t,r)=>{const i=Q(t),n=R(r);try{for(;;){await n.ready;const{done:t,value:r}=await i.read();if(t){try{e.close()}catch(t){}return void await n.close()}try{e.enqueue(r)}catch(t){}await n.write(r)}}catch(t){e.error(t),await n.abort(t)}}));C(t,r)}}):D(t)}function C(t,e){Object.entries(Object.getOwnPropertyDescriptors(t.constructor.prototype)).forEach((([r,i])=>{"constructor"!==r&&(i.value?i.value=i.value.bind(e):i.get=i.get.bind(e),Object.defineProperty(t,r,i))}))}function D(t,e=0,r=1/0){if(h(t))throw Error("Not implemented");if(f(t)){if(e>=0&&r>=0){let i=0;return k(t,{transform(t,n){i<r?(i+t.length>=e&&n.enqueue(D(t,Math.max(e-i,0),r-i)),i+=t.length):n.terminate()}})}if(e<0&&(r<0||r===1/0)){let i=[];return v(t,(t=>{t.length>=-e?i=[t]:i.push(t)}),(()=>D(m(i),e,r)))}if(0===e&&r<0){let i;return v(t,(t=>{const n=i?m([i,t]):t;if(n.length>=-r)return i=D(n,r),D(n,e,r);i=n}))}return console.warn(`stream.slice(input, ${e}, ${r}) not implemented efficiently.`),x((async()=>D(await U(t),e,r)))}return t[p]&&(t=m(t[p].concat([t]))),l(t)?t.subarray(e,r===1/0?t.length:r):t.slice(e,r)}async function U(t,e=m){return h(t)?t.readToEnd(e):f(t)?Q(t).readToEnd(e):t}async function P(t,e){if(f(t)){if(t.cancel){const r=await t.cancel(e);return await new Promise(setTimeout),r}if(t.destroy)return t.destroy(e),await new Promise(setTimeout),e}}function x(t){const e=new c;return(async()=>{const r=R(e);try{await r.write(await t()),await r.close()}catch(t){await r.abort(t)}})(),e}function Q(t){return new d(t)}function R(t){return new u(t)}d.prototype.read=async function(){if(this[p]&&this[p].length){return{done:!1,value:this[p].shift()}}return this._read()},d.prototype.releaseLock=function(){this[p]&&(this.stream[p]=this[p]),this._releaseLock()},d.prototype.cancel=function(t){return this._cancel(t)},d.prototype.readLine=async function(){let t,e=[];for(;!t;){let{done:r,value:i}=await this.read();if(i+="",r)return e.length?m(e):void 0;const n=i.indexOf("\n")+1;n&&(t=m(e.concat(i.substr(0,n))),e=[]),n!==i.length&&e.push(i.substr(n))}return this.unshift(...e),t},d.prototype.readByte=async function(){const{done:t,value:e}=await this.read();if(t)return;const r=e[0];return this.unshift(D(e,1)),r},d.prototype.readBytes=async function(t){const e=[];let r=0;for(;;){const{done:i,value:n}=await this.read();if(i)return e.length?m(e):void 0;if(e.push(n),r+=n.length,r>=t){const r=m(e);return this.unshift(D(r,t)),D(r,0,t)}}},d.prototype.peekBytes=async function(t){const e=await this.readBytes(t);return this.unshift(e),e},d.prototype.unshift=function(...t){this[p]||(this[p]=[]),1===t.length&&l(t[0])&&this[p].length&&t[0].length&&this[p][0].byteOffset>=t[0].length?this[p][0]=new Uint8Array(this[p][0].buffer,this[p][0].byteOffset-t[0].length,this[p][0].byteLength+t[0].length):this[p].unshift(...t.filter((t=>t&&t.length)))},d.prototype.readToEnd=async function(t=m){const e=[];for(;;){const{done:t,value:r}=await this.read();if(t)break;e.push(r)}return t(e)};const T=Symbol("byValue");var M={curve:{nistP256:"nistP256",p256:"nistP256",nistP384:"nistP384",p384:"nistP384",nistP521:"nistP521",p521:"nistP521",secp256k1:"secp256k1",ed25519Legacy:"ed25519Legacy",ed25519:"ed25519Legacy",curve25519Legacy:"curve25519Legacy",curve25519:"curve25519Legacy",brainpoolP256r1:"brainpoolP256r1",brainpoolP384r1:"brainpoolP384r1",brainpoolP512r1:"brainpoolP512r1"},s2k:{simple:0,salted:1,iterated:3,argon2:4,gnu:101},publicKey:{rsaEncryptSign:1,rsaEncrypt:2,rsaSign:3,elgamal:16,dsa:17,ecdh:18,ecdsa:19,eddsaLegacy:22,aedh:23,aedsa:24,x25519:25,x448:26,ed25519:27,ed448:28},symmetric:{idea:1,tripledes:2,cast5:3,blowfish:4,aes128:7,aes192:8,aes256:9,twofish:10},compression:{uncompressed:0,zip:1,zlib:2,bzip2:3},hash:{md5:1,sha1:2,ripemd:3,sha256:8,sha384:9,sha512:10,sha224:11,sha3_256:12,sha3_512:14},webHash:{"SHA-1":2,"SHA-256":8,"SHA-384":9,"SHA-512":10},aead:{eax:1,ocb:2,gcm:3,experimentalGCM:100},packet:{publicKeyEncryptedSessionKey:1,signature:2,symEncryptedSessionKey:3,onePassSignature:4,secretKey:5,publicKey:6,secretSubkey:7,compressedData:8,symmetricallyEncryptedData:9,marker:10,literalData:11,trust:12,userID:13,publicSubkey:14,userAttribute:17,symEncryptedIntegrityProtectedData:18,modificationDetectionCode:19,aeadEncryptedData:20,padding:21},literal:{binary:98,text:116,utf8:117,mime:109},signature:{binary:0,text:1,standalone:2,certGeneric:16,certPersona:17,certCasual:18,certPositive:19,certRevocation:48,subkeyBinding:24,keyBinding:25,key:31,keyRevocation:32,subkeyRevocation:40,timestamp:64,thirdParty:80},signatureSubpacket:{signatureCreationTime:2,signatureExpirationTime:3,exportableCertification:4,trustSignature:5,regularExpression:6,revocable:7,keyExpirationTime:9,placeholderBackwardsCompatibility:10,preferredSymmetricAlgorithms:11,revocationKey:12,issuerKeyID:16,notationData:20,preferredHashAlgorithms:21,preferredCompressionAlgorithms:22,keyServerPreferences:23,preferredKeyServer:24,primaryUserID:25,policyURI:26,keyFlags:27,signersUserID:28,reasonForRevocation:29,features:30,signatureTarget:31,embeddedSignature:32,issuerFingerprint:33,preferredAEADAlgorithms:34,preferredCipherSuites:39},keyFlags:{certifyKeys:1,signData:2,encryptCommunication:4,encryptStorage:8,splitPrivateKey:16,authentication:32,sharedPrivateKey:128},armor:{multipartSection:0,multipartLast:1,signed:2,message:3,publicKey:4,privateKey:5,signature:6},reasonForRevocation:{noReason:0,keySuperseded:1,keyCompromised:2,keyRetired:3,userIDInvalid:32},features:{modificationDetection:1,aead:2,v5Keys:4,seipdv2:8},write:function(t,e){if("number"==typeof e&&(e=this.read(t,e)),void 0!==t[e])return t[e];throw Error("Invalid enum value.")},read:function(t,e){if(t[T]||(t[T]=[],Object.entries(t).forEach((([e,r])=>{t[T][r]=e}))),void 0!==t[T][e])return t[T][e];throw Error("Invalid enum value.")}},N={preferredHashAlgorithm:M.hash.sha512,preferredSymmetricAlgorithm:M.symmetric.aes256,preferredCompressionAlgorithm:M.compression.uncompressed,aeadProtect:!1,parseAEADEncryptedV4KeysAsLegacy:!1,preferredAEADAlgorithm:M.aead.gcm,aeadChunkSizeByte:12,v6Keys:!1,enableParsingV5Entities:!1,s2kType:M.s2k.iterated,s2kIterationCountByte:224,s2kArgon2Params:{passes:3,parallelism:4,memoryExponent:16},allowUnauthenticatedMessages:!1,allowUnauthenticatedStream:!1,minRSABits:2047,passwordCollisionCheck:!1,allowInsecureDecryptionWithSigningKeys:!1,allowInsecureVerificationWithReformattedKeys:!1,allowMissingKeyFlags:!1,constantTimePKCS1Decryption:!1,constantTimePKCS1DecryptionSupportedSymmetricAlgorithms:new Set([M.symmetric.aes128,M.symmetric.aes192,M.symmetric.aes256]),ignoreUnsupportedPackets:!0,ignoreMalformedPackets:!1,enforceGrammar:!0,additionalAllowedPackets:[],showVersion:!1,showComment:!1,versionString:"OpenPGP.js 6.2.0",commentString:"https://openpgpjs.org",maxUserIDLength:5120,knownNotations:[],nonDeterministicSignaturesViaNotation:!0,useEllipticFallback:!0,rejectHashAlgorithms:new Set([M.hash.md5,M.hash.ripemd]),rejectMessageHashAlgorithms:new Set([M.hash.md5,M.hash.ripemd,M.hash.sha1]),rejectPublicKeyAlgorithms:new Set([M.publicKey.elgamal,M.publicKey.dsa]),rejectCurves:new Set([M.curve.secp256k1])};const F=(()=>{try{return"development"===process.env.NODE_ENV}catch(t){}return!1})(),L={isString:function(t){return"string"==typeof t||t instanceof String},nodeRequire:e(import.meta.url),isArray:function(t){return t instanceof Array},isUint8Array:l,isStream:f,getNobleCurve:async(t,e)=>{if(!N.useEllipticFallback)throw Error("This curve is only supported in the full build of OpenPGP.js");const{nobleCurves:r}=await Promise.resolve().then((function(){return dl}));switch(t){case M.publicKey.ecdh:case M.publicKey.ecdsa:{const t=r.get(e);if(!t)throw Error("Unsupported curve");return t}case M.publicKey.x448:return r.get("x448");case M.publicKey.ed448:return r.get("ed448");default:throw Error("Unsupported curve")}},readNumber:function(t){let e=0;for(let r=0;r<t.length;r++)e+=256**r*t[t.length-1-r];return e},writeNumber:function(t,e){const r=new Uint8Array(e);for(let i=0;i<e;i++)r[i]=t>>8*(e-i-1)&255;return r},readDate:function(t){const e=L.readNumber(t);return new Date(1e3*e)},writeDate:function(t){const e=Math.floor(t.getTime()/1e3);return L.writeNumber(e,4)},normalizeDate:function(t=Date.now()){return null===t||t===1/0?t:new Date(1e3*Math.floor(+t/1e3))},readMPI:function(t){const e=(t[0]<<8|t[1])+7>>>3;return L.readExactSubarray(t,2,2+e)},readExactSubarray:function(t,e,r){if(t.length<r-e)throw Error("Input array too short");return t.subarray(e,r)},leftPad(t,e){if(t.length>e)throw Error("Input array too long");const r=new Uint8Array(e),i=e-t.length;return r.set(t,i),r},uint8ArrayToMPI:function(t){const e=L.uint8ArrayBitLength(t);if(0===e)throw Error("Zero MPI");const r=t.subarray(t.length-Math.ceil(e/8)),i=new Uint8Array([(65280&e)>>8,255&e]);return L.concatUint8Array([i,r])},uint8ArrayBitLength:function(t){let e;for(e=0;e<t.length&&0===t[e];e++);if(e===t.length)return 0;const r=t.subarray(e);return 8*(r.length-1)+L.nbits(r[0])},hexToUint8Array:function(t){const e=new Uint8Array(t.length>>1);for(let r=0;r<t.length>>1;r++)e[r]=parseInt(t.substr(r<<1,2),16);return e},uint8ArrayToHex:function(t){const e="0123456789abcdef";let r="";return t.forEach((t=>{r+=e[t>>4]+e[15&t]})),r},stringToUint8Array:function(t){return v(t,(t=>{if(!L.isString(t))throw Error("stringToUint8Array: Data must be in the form of a string");const e=new Uint8Array(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}))},uint8ArrayToString:function(t){const e=[],r=16384,i=(t=new Uint8Array(t)).length;for(let n=0;n<i;n+=r)e.push(String.fromCharCode.apply(String,t.subarray(n,n+r<i?n+r:i)));return e.join("")},encodeUTF8:function(t){const e=new TextEncoder("utf-8");function r(t,r=!1){return e.encode(t,{stream:!r})}return v(t,r,(()=>r("",!0)))},decodeUTF8:function(t){const e=new TextDecoder("utf-8");function r(t,r=!1){return e.decode(t,{stream:!r})}return v(t,r,(()=>r(new Uint8Array,!0)))},concat:m,concatUint8Array:y,equalsUint8Array:function(t,e){if(!L.isUint8Array(t)||!L.isUint8Array(e))throw Error("Data must be in the form of a Uint8Array");if(t.length!==e.length)return!1;for(let r=0;r<t.length;r++)if(t[r]!==e[r])return!1;return!0},findLastIndex:function(t,e){for(let r=t.length;r>=0;r--)if(e(t[r],r,t))return r;return-1},writeChecksum:function(t){let e=0;for(let r=0;r<t.length;r++)e=e+t[r]&65535;return L.writeNumber(e,2)},printDebug:function(t){F&&console.log("[OpenPGP.js debug]",t)},printDebugError:function(t){F&&console.error("[OpenPGP.js debug]",t)},nbits:function(t){let e=1,r=t>>>16;return 0!==r&&(t=r,e+=16),r=t>>8,0!==r&&(t=r,e+=8),r=t>>4,0!==r&&(t=r,e+=4),r=t>>2,0!==r&&(t=r,e+=2),r=t>>1,0!==r&&(t=r,e+=1),e},double:function(t){const e=new Uint8Array(t.length),r=t.length-1;for(let i=0;i<r;i++)e[i]=t[i]<<1^t[i+1]>>7;return e[r]=t[r]<<1^135*(t[0]>>7),e},shiftRight:function(t,e){if(e)for(let r=t.length-1;r>=0;r--)t[r]>>=e,r>0&&(t[r]|=t[r-1]<<8-e);return t},getWebCrypto:function(){const e=void 0!==t&&t.crypto&&t.crypto.subtle||this.getNodeCrypto()?.webcrypto.subtle;if(!e)throw Error("The WebCrypto API is not available");return e},getNodeCrypto:function(){return this.nodeRequire("crypto")},getNodeZlib:function(){return this.nodeRequire("zlib")},getNodeBuffer:function(){return(this.nodeRequire("buffer")||{}).Buffer},getHardwareConcurrency:function(){if("undefined"!=typeof navigator)return navigator.hardwareConcurrency||1;return this.nodeRequire("os").cpus().length},isEmailAddress:function(t){if(!L.isString(t))return!1;return/^[^\p{C}\p{Z}@<>\\]+@[^\p{C}\p{Z}@<>\\]+[^\p{C}\p{Z}\p{P}]$/u.test(t)},canonicalizeEOL:function(t){let e=!1;return v(t,(t=>{let r;e&&(t=L.concatUint8Array([new Uint8Array([13]),t])),13===t[t.length-1]?(e=!0,t=t.subarray(0,-1)):e=!1;const i=[];for(let e=0;r=t.indexOf(10,e)+1,r;e=r)13!==t[r-2]&&i.push(r);if(!i.length)return t;const n=new Uint8Array(t.length+i.length);let s=0;for(let e=0;e<i.length;e++){const r=t.subarray(i[e-1]||0,i[e]);n.set(r,s),s+=r.length,n[s-1]=13,n[s]=10,s++}return n.set(t.subarray(i[i.length-1]||0),s),n}),(()=>e?new Uint8Array([13]):void 0))},nativeEOL:function(t){let e=!1;return v(t,(t=>{let r;13===(t=e&&10!==t[0]?L.concatUint8Array([new Uint8Array([13]),t]):new Uint8Array(t))[t.length-1]?(e=!0,t=t.subarray(0,-1)):e=!1;let i=0;for(let e=0;e!==t.length;e=r){r=t.indexOf(13,e)+1,r||(r=t.length);const n=r-(10===t[r]?1:0);e&&t.copyWithin(i,e,n),i+=n-e}return t.subarray(0,i)}),(()=>e?new Uint8Array([13]):void 0))},removeTrailingSpaces:function(t){return t.split("\n").map((t=>{let e=t.length-1;for(;e>=0&&(" "===t[e]||"\t"===t[e]||"\r"===t[e]);e--);return t.substr(0,e+1)})).join("\n")},wrapError:function(t,e){if(!e)return t instanceof Error?t:Error(t);if(t instanceof Error){try{t.message+=": "+e.message,t.cause=e}catch(t){}return t}return Error(t+": "+e.message,{cause:e})},constructAllowedPackets:function(t){const e={};return t.forEach((t=>{if(!t.tag)throw Error("Invalid input: expected a packet class");e[t.tag]=t})),e},anyPromise:function(t){return new Promise((async(e,r)=>{let i;await Promise.all(t.map((async t=>{try{e(await t)}catch(t){i=t}}))),r(i)}))},selectUint8Array:function(t,e,r){const i=Math.max(e.length,r.length),n=new Uint8Array(i);let s=0;for(let i=0;i<n.length;i++)n[i]=e[i]&256-t|r[i]&255+t,s+=t&i<e.length|1-t&i<r.length;return n.subarray(0,s)},selectUint8:function(t,e,r){return e&256-t|r&255+t},isAES:function(t){return t===M.symmetric.aes128||t===M.symmetric.aes192||t===M.symmetric.aes256}},O=L.getNodeBuffer();let H,z;function G(t){let e=new Uint8Array;return v(t,(t=>{e=L.concatUint8Array([e,t]);const r=[],i=Math.floor(e.length/45),n=45*i,s=H(e.subarray(0,n));for(let t=0;t<i;t++)r.push(s.substr(60*t,60)),r.push("\n");return e=e.subarray(n),r.join("")}),(()=>e.length?H(e)+"\n":""))}function _(t){let e="";return v(t,(t=>{e+=t;let r=0;const i=[" ","\t","\r","\n"];for(let t=0;t<i.length;t++){const n=i[t];for(let t=e.indexOf(n);-1!==t;t=e.indexOf(n,t+1))r++}let n=e.length;for(;n>0&&(n-r)%4!=0;n--)i.includes(e[n])&&r--;const s=z(e.substr(0,n));return e=e.substr(n),s}),(()=>z(e)))}function j(t){return _(t.replace(/-/g,"+").replace(/_/g,"/"))}function q(t,e){let r=G(t).replace(/[\r\n]/g,"");return r=r.replace(/[+]/g,"-").replace(/[/]/g,"_").replace(/[=]/g,""),r}function V(t){const e=t.match(/^-----BEGIN PGP (MESSAGE, PART \d+\/\d+|MESSAGE, PART \d+|SIGNED MESSAGE|MESSAGE|PUBLIC KEY BLOCK|PRIVATE KEY BLOCK|SIGNATURE)-----$/m);if(!e)throw Error("Unknown ASCII armor type");return/MESSAGE, PART \d+\/\d+/.test(e[1])?M.armor.multipartSection:/MESSAGE, PART \d+/.test(e[1])?M.armor.multipartLast:/SIGNED MESSAGE/.test(e[1])?M.armor.signed:/MESSAGE/.test(e[1])?M.armor.message:/PUBLIC KEY BLOCK/.test(e[1])?M.armor.publicKey:/PRIVATE KEY BLOCK/.test(e[1])?M.armor.privateKey:/SIGNATURE/.test(e[1])?M.armor.signature:void 0}function J(t,e){let r="";return e.showVersion&&(r+="Version: "+e.versionString+"\n"),e.showComment&&(r+="Comment: "+e.commentString+"\n"),t&&(r+="Comment: "+t+"\n"),r+="\n",r}function Y(t){const e=function(t){let e=13501623;return v(t,(t=>{const r=W?Math.floor(t.length/4):0,i=new Uint32Array(t.buffer,t.byteOffset,r);for(let t=0;t<r;t++)e^=i[t],e=Z[0][e>>24&255]^Z[1][e>>16&255]^Z[2][e>>8&255]^Z[3][255&e];for(let i=4*r;i<t.length;i++)e=e>>8^Z[0][255&e^t[i]]}),(()=>new Uint8Array([e,e>>8,e>>16])))}(t);return G(e)}O?(H=t=>O.from(t).toString("base64"),z=t=>{const e=O.from(t,"base64");return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}):(H=t=>btoa(L.uint8ArrayToString(t)),z=t=>L.stringToUint8Array(atob(t)));const Z=[Array(255),Array(255),Array(255),Array(255)];for(let t=0;t<=255;t++){let e=t<<16;for(let t=0;t<8;t++)e=e<<1^(8388608&e?8801531:0);Z[0][t]=(16711680&e)>>16|65280&e|(255&e)<<16}for(let t=0;t<=255;t++)Z[1][t]=Z[0][t]>>8^Z[0][255&Z[0][t]];for(let t=0;t<=255;t++)Z[2][t]=Z[1][t]>>8^Z[0][255&Z[1][t]];for(let t=0;t<=255;t++)Z[3][t]=Z[2][t]>>8^Z[0][255&Z[2][t]];const W=function(){const t=new ArrayBuffer(2);return new DataView(t).setInt16(0,255,!0),255===new Int16Array(t)[0]}();function X(t){for(let e=0;e<t.length;e++)/^([^\s:]|[^\s:][^:]*[^\s:]): .+$/.test(t[e])||L.printDebugError(Error("Improperly formatted armor header: "+t[e])),/^(Version|Comment|MessageID|Hash|Charset): .+$/.test(t[e])||L.printDebugError(Error("Unknown header: "+t[e]))}function $(t){let e=t;const r=t.lastIndexOf("=");return r>=0&&r!==t.length-1&&(e=t.slice(0,r)),e}function tt(t){return new Promise((async(e,r)=>{try{const i=/^-----[^-]+-----$/m,n=/^[ \f\r\t\u00a0\u2000-\u200a\u202f\u205f\u3000]*$/;let s;const a=[];let o,c,h=a,u=[];const f=_(I(t,(async(t,l)=>{const y=Q(t);try{for(;;){let t=await y.readLine();if(void 0===t)throw Error("Misformed armored text");if(t=L.removeTrailingSpaces(t.replace(/[\r\n]/g,"")),s)if(o)c||s!==M.armor.signed||(i.test(t)?(u=u.join("\r\n"),c=!0,X(h),h=[],o=!1):u.push(t.replace(/^- /,"")));else if(i.test(t)&&r(Error("Mandatory blank line missing between armor headers and armor data")),n.test(t)){if(X(h),o=!0,c||s!==M.armor.signed){e({text:u,data:f,headers:a,type:s});break}}else h.push(t);else i.test(t)&&(s=V(t))}}catch(t){return void r(t)}const g=R(l);try{for(;;){await g.ready;const{done:t,value:e}=await y.read();if(t)throw Error("Misformed armored text");const r=e+"";if(-1!==r.indexOf("=")||-1!==r.indexOf("-")){let t=await y.readToEnd();t.length||(t=""),t=r+t,t=L.removeTrailingSpaces(t.replace(/\r/g,""));const e=t.split(i);if(1===e.length)throw Error("Misformed armored text");const n=$(e[0].slice(0,-1));await g.write(n);break}await g.write(r)}await g.ready,await g.close()}catch(t){await g.abort(t)}})))}catch(t){r(t)}})).then((async t=>(h(t.data)&&(t.data=await U(t.data)),t)))}function et(t,e,r,i,n,s=!1,a=N){let o,c;t===M.armor.signed&&(o=e.text,c=e.hash,e=e.data);const h=s&&K(e),u=[];switch(t){case M.armor.multipartSection:u.push("-----BEGIN PGP MESSAGE, PART "+r+"/"+i+"-----\n"),u.push(J(n,a)),u.push(G(e)),h&&u.push("=",Y(h)),u.push("-----END PGP MESSAGE, PART "+r+"/"+i+"-----\n");break;case M.armor.multipartLast:u.push("-----BEGIN PGP MESSAGE, PART "+r+"-----\n"),u.push(J(n,a)),u.push(G(e)),h&&u.push("=",Y(h)),u.push("-----END PGP MESSAGE, PART "+r+"-----\n");break;case M.armor.signed:u.push("-----BEGIN PGP SIGNED MESSAGE-----\n"),u.push(c?`Hash: ${c}\n\n`:"\n"),u.push(o.replace(/^-/gm,"- -")),u.push("\n-----BEGIN PGP SIGNATURE-----\n"),u.push(J(n,a)),u.push(G(e)),h&&u.push("=",Y(h)),u.push("-----END PGP SIGNATURE-----\n");break;case M.armor.message:u.push("-----BEGIN PGP MESSAGE-----\n"),u.push(J(n,a)),u.push(G(e)),h&&u.push("=",Y(h)),u.push("-----END PGP MESSAGE-----\n");break;case M.armor.publicKey:u.push("-----BEGIN PGP PUBLIC KEY BLOCK-----\n"),u.push(J(n,a)),u.push(G(e)),h&&u.push("=",Y(h)),u.push("-----END PGP PUBLIC KEY BLOCK-----\n");break;case M.armor.privateKey:u.push("-----BEGIN PGP PRIVATE KEY BLOCK-----\n"),u.push(J(n,a)),u.push(G(e)),h&&u.push("=",Y(h)),u.push("-----END PGP PRIVATE KEY BLOCK-----\n");break;case M.armor.signature:u.push("-----BEGIN PGP SIGNATURE-----\n"),u.push(J(n,a)),u.push(G(e)),h&&u.push("=",Y(h)),u.push("-----END PGP SIGNATURE-----\n")}return L.concat(u)}const rt=BigInt(0),it=BigInt(1);function nt(t){const e="0123456789ABCDEF";let r="";return t.forEach((t=>{r+=e[t>>4]+e[15&t]})),BigInt("0x0"+r)}function st(t,e){const r=t%e;return r<rt?r+e:r}function at(t,e,r){if(r===rt)throw Error("Modulo cannot be zero");if(r===it)return BigInt(0);if(e<rt)throw Error("Unsopported negative exponent");let i=e,n=t;n%=r;let s=BigInt(1);for(;i>rt;){const t=i&it;i>>=it;s=t?s*n%r:s,n=n*n%r}return s}function ot(t){return t>=rt?t:-t}function ct(t,e){const{gcd:r,x:i}=function(t,e){let r=BigInt(0),i=BigInt(1),n=BigInt(1),s=BigInt(0),a=ot(t),o=ot(e);const c=t<rt,h=e<rt;for(;o!==rt;){const t=a/o;let e=r;r=n-t*r,n=e,e=i,i=s-t*i,s=e,e=o,o=a%o,a=e}return{x:c?-n:n,y:h?-s:s,gcd:a}}(t,e);if(r!==it)throw Error("Inverse does not exist");return st(i+e,e)}function ht(t){const e=Number(t);if(e>Number.MAX_SAFE_INTEGER)throw Error("Number can only safely store up to 53 bits");return e}function ut(t,e){return(t>>BigInt(e)&it)===rt?0:1}function ft(t){const e=t<rt?BigInt(-1):rt;let r=1,i=t;for(;(i>>=it)!==e;)r++;return r}function lt(t){const e=t<rt?BigInt(-1):rt,r=BigInt(8);let i=1,n=t;for(;(n>>=r)!==e;)i++;return i}function yt(t,e="be",r){let i=t.toString(16);i.length%2==1&&(i="0"+i);const n=i.length/2,s=new Uint8Array(r||n),a=r?r-n:0;let o=0;for(;o<n;)s[o+a]=parseInt(i.slice(2*o,2*o+2),16),o++;return"be"!==e&&s.reverse(),s}const gt=L.getNodeCrypto();function pt(t){const e="undefined"!=typeof crypto?crypto:gt?.webcrypto;if(e?.getRandomValues){const r=new Uint8Array(t);return e.getRandomValues(r)}throw Error("No secure random number generator available.")}function dt(t,e){if(e<t)throw Error("Illegal parameter value: max <= min");const r=e-t;return st(nt(pt(lt(r)+8)),r)+t}const At=BigInt(1);function wt(t,e,r){const i=BigInt(30),n=At<<BigInt(t-1),s=[1,6,5,4,3,2,1,4,3,2,1,2,1,4,3,2,1,2,1,4,3,2,1,6,5,4,3,2,1,2];let a=dt(n,n<<At),o=ht(st(a,i));do{a+=BigInt(s[o]),o=(o+s[o])%s.length,ft(a)>t&&(a=st(a,n<<At),a+=n,o=ht(st(a,i)))}while(!mt(a,e,r));return a}function mt(t,e,r){return(!e||function(t,e){let r=t,i=e;for(;i!==rt;){const t=i;i=r%i,r=t}return r}(t-At,e)===At)&&(!!function(t){const e=BigInt(0);return bt.every((r=>st(t,r)!==e))}(t)&&(!!function(t,e=BigInt(2)){return at(e,t-At,t)===At}(t)&&!!function(t,e){const r=ft(t);e||(e=Math.max(1,r/48|0));const i=t-At;let n=0;for(;!ut(i,n);)n++;const s=t>>BigInt(n);for(;e>0;e--){let e,r=at(dt(BigInt(2),i),s,t);if(r!==At&&r!==i){for(e=1;e<n;e++){if(r=st(r*r,t),r===At)return!1;if(r===i)break}if(e===n)return!1}}return!0}(t,r)))}const bt=[7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997,1009,1013,1019,1021,1031,1033,1039,1049,1051,1061,1063,1069,1087,1091,1093,1097,1103,1109,1117,1123,1129,1151,1153,1163,1171,1181,1187,1193,1201,1213,1217,1223,1229,1231,1237,1249,1259,1277,1279,1283,1289,1291,1297,1301,1303,1307,1319,1321,1327,1361,1367,1373,1381,1399,1409,1423,1427,1429,1433,1439,1447,1451,1453,1459,1471,1481,1483,1487,1489,1493,1499,1511,1523,1531,1543,1549,1553,1559,1567,1571,1579,1583,1597,1601,1607,1609,1613,1619,1621,1627,1637,1657,1663,1667,1669,1693,1697,1699,1709,1721,1723,1733,1741,1747,1753,1759,1777,1783,1787,1789,1801,1811,1823,1831,1847,1861,1867,1871,1873,1877,1879,1889,1901,1907,1913,1931,1933,1949,1951,1973,1979,1987,1993,1997,1999,2003,2011,2017,2027,2029,2039,2053,2063,2069,2081,2083,2087,2089,2099,2111,2113,2129,2131,2137,2141,2143,2153,2161,2179,2203,2207,2213,2221,2237,2239,2243,2251,2267,2269,2273,2281,2287,2293,2297,2309,2311,2333,2339,2341,2347,2351,2357,2371,2377,2381,2383,2389,2393,2399,2411,2417,2423,2437,2441,2447,2459,2467,2473,2477,2503,2521,2531,2539,2543,2549,2551,2557,2579,2591,2593,2609,2617,2621,2633,2647,2657,2659,2663,2671,2677,2683,2687,2689,2693,2699,2707,2711,2713,2719,2729,2731,2741,2749,2753,2767,2777,2789,2791,2797,2801,2803,2819,2833,2837,2843,2851,2857,2861,2879,2887,2897,2903,2909,2917,2927,2939,2953,2957,2963,2969,2971,2999,3001,3011,3019,3023,3037,3041,3049,3061,3067,3079,3083,3089,3109,3119,3121,3137,3163,3167,3169,3181,3187,3191,3203,3209,3217,3221,3229,3251,3253,3257,3259,3271,3299,3301,3307,3313,3319,3323,3329,3331,3343,3347,3359,3361,3371,3373,3389,3391,3407,3413,3433,3449,3457,3461,3463,3467,3469,3491,3499,3511,3517,3527,3529,3533,3539,3541,3547,3557,3559,3571,3581,3583,3593,3607,3613,3617,3623,3631,3637,3643,3659,3671,3673,3677,3691,3697,3701,3709,3719,3727,3733,3739,3761,3767,3769,3779,3793,3797,3803,3821,3823,3833,3847,3851,3853,3863,3877,3881,3889,3907,3911,3917,3919,3923,3929,3931,3943,3947,3967,3989,4001,4003,4007,4013,4019,4021,4027,4049,4051,4057,4073,4079,4091,4093,4099,4111,4127,4129,4133,4139,4153,4157,4159,4177,4201,4211,4217,4219,4229,4231,4241,4243,4253,4259,4261,4271,4273,4283,4289,4297,4327,4337,4339,4349,4357,4363,4373,4391,4397,4409,4421,4423,4441,4447,4451,4457,4463,4481,4483,4493,4507,4513,4517,4519,4523,4547,4549,4561,4567,4583,4591,4597,4603,4621,4637,4639,4643,4649,4651,4657,4663,4673,4679,4691,4703,4721,4723,4729,4733,4751,4759,4783,4787,4789,4793,4799,4801,4813,4817,4831,4861,4871,4877,4889,4903,4909,4919,4931,4933,4937,4943,4951,4957,4967,4969,4973,4987,4993,4999].map((t=>BigInt(t)));const kt=L.getWebCrypto(),Et=L.getNodeCrypto(),vt=Et&&Et.getHashes();function It(t){if(Et&&vt.includes(t))return async function(e){const r=Et.createHash(t);return v(e,(t=>{r.update(t)}),(()=>new Uint8Array(r.digest())))}}function Bt(t,e){const r=async()=>{const{nobleHashes:e}=await Promise.resolve().then((function(){return Gl})),r=e.get(t);if(!r)throw Error("Unsupported hash");return r};return async function(t){if(h(t)&&(t=await U(t)),L.isStream(t)){const e=(await r()).create();return v(t,(t=>{e.update(t)}),(()=>e.digest()))}if(kt&&e)return new Uint8Array(await kt.digest(e,t));return(await r())(t)}}const St=It("md5")||Bt("md5"),Kt=It("sha1")||Bt("sha1","SHA-1"),Ct=It("sha224")||Bt("sha224"),Dt=It("sha256")||Bt("sha256","SHA-256"),Ut=It("sha384")||Bt("sha384","SHA-384"),Pt=It("sha512")||Bt("sha512","SHA-512"),xt=It("ripemd160")||Bt("ripemd160"),Qt=It("sha3-256")||Bt("sha3_256"),Rt=It("sha3-512")||Bt("sha3_512");function Tt(t,e){switch(t){case M.hash.md5:return St(e);case M.hash.sha1:return Kt(e);case M.hash.ripemd:return xt(e);case M.hash.sha256:return Dt(e);case M.hash.sha384:return Ut(e);case M.hash.sha512:return Pt(e);case M.hash.sha224:return Ct(e);case M.hash.sha3_256:return Qt(e);case M.hash.sha3_512:return Rt(e);default:throw Error("Unsupported hash function")}}function Mt(t){switch(t){case M.hash.md5:return 16;case M.hash.sha1:case M.hash.ripemd:return 20;case M.hash.sha256:return 32;case M.hash.sha384:return 48;case M.hash.sha512:return 64;case M.hash.sha224:return 28;case M.hash.sha3_256:return 32;case M.hash.sha3_512:return 64;default:throw Error("Invalid hash algorithm.")}}const Nt=[];function Ft(t,e){const r=t.length;if(r>e-11)throw Error("Message too long");const i=function(t){const e=new Uint8Array(t);let r=0;for(;r<t;){const i=pt(t-r);for(let t=0;t<i.length;t++)0!==i[t]&&(e[r++]=i[t])}return e}(e-r-3),n=new Uint8Array(e);return n[1]=2,n.set(i,2),n.set(t,e-r),n}function Lt(t,e){let r=2,i=1;for(let e=r;e<t.length;e++)i&=0!==t[e],r+=i;const n=r-2,s=t.subarray(r+1),a=0===t[0]&2===t[1]&n>=8&!i;if(e)return L.selectUint8Array(a,s,e);if(a)return s;throw Error("Decryption error")}function Ot(t,e,r){let i;if(e.length!==Mt(t))throw Error("Invalid hash length");const n=new Uint8Array(Nt[t].length);for(i=0;i<Nt[t].length;i++)n[i]=Nt[t][i];const s=n.length+e.length;if(r<s+11)throw Error("Intended encoded message length too short");const a=new Uint8Array(r-s-3).fill(255),o=new Uint8Array(r);return o[1]=1,o.set(a,2),o.set(n,r-s),o.set(e,r-e.length),o}Nt[1]=[48,32,48,12,6,8,42,134,72,134,247,13,2,5,5,0,4,16],Nt[2]=[48,33,48,9,6,5,43,14,3,2,26,5,0,4,20],Nt[3]=[48,33,48,9,6,5,43,36,3,2,1,5,0,4,20],Nt[8]=[48,49,48,13,6,9,96,134,72,1,101,3,4,2,1,5,0,4,32],Nt[9]=[48,65,48,13,6,9,96,134,72,1,101,3,4,2,2,5,0,4,48],Nt[10]=[48,81,48,13,6,9,96,134,72,1,101,3,4,2,3,5,0,4,64],Nt[11]=[48,45,48,13,6,9,96,134,72,1,101,3,4,2,4,5,0,4,28];const Ht=L.getWebCrypto(),zt=L.getNodeCrypto(),Gt=BigInt(1);async function _t(t,e,r,i,n,s,a,o,c){if(Mt(t)>=r.length)throw Error("Digest size cannot exceed key modulus size");if(e&&!L.isStream(e))if(L.getWebCrypto())try{return await async function(t,e,r,i,n,s,a,o){const c=await Jt(r,i,n,s,a,o),h={name:"RSASSA-PKCS1-v1_5",hash:{name:t}},u=await Ht.importKey("jwk",c,h,!1,["sign"]);return new Uint8Array(await Ht.sign("RSASSA-PKCS1-v1_5",u,e))}(M.read(M.webHash,t),e,r,i,n,s,a,o)}catch(t){L.printDebugError(t)}else if(L.getNodeCrypto())return async function(t,e,r,i,n,s,a,o){const c=zt.createSign(M.read(M.hash,t));c.write(e),c.end();const h=await Jt(r,i,n,s,a,o);return new Uint8Array(c.sign({key:h,format:"jwk",type:"pkcs1"}))}(t,e,r,i,n,s,a,o);return async function(t,e,r,i){e=nt(e);const n=nt(Ot(t,i,lt(e)));return r=nt(r),yt(at(n,r,e),"be",lt(e))}(t,r,n,c)}async function jt(t,e,r,i,n,s){if(e&&!L.isStream(e))if(L.getWebCrypto())try{return await async function(t,e,r,i,n){const s=Yt(i,n),a=await Ht.importKey("jwk",s,{name:"RSASSA-PKCS1-v1_5",hash:{name:t}},!1,["verify"]);return Ht.verify("RSASSA-PKCS1-v1_5",a,r,e)}(M.read(M.webHash,t),e,r,i,n)}catch(t){L.printDebugError(t)}else if(L.getNodeCrypto())return async function(t,e,r,i,n){const s=Yt(i,n),a={key:s,format:"jwk",type:"pkcs1"},o=zt.createVerify(M.read(M.hash,t));o.write(e),o.end();try{return o.verify(a,r)}catch(t){return!1}}(t,e,r,i,n);return async function(t,e,r,i,n){if(r=nt(r),e=nt(e),i=nt(i),e>=r)throw Error("Signature size cannot exceed modulus size");const s=yt(at(e,i,r),"be",lt(r)),a=Ot(t,n,lt(r));return L.equalsUint8Array(s,a)}(t,r,i,n,s)}async function qt(t,e,r){return L.getNodeCrypto()?async function(t,e,r){const i=Yt(e,r),n={key:i,format:"jwk",type:"pkcs1",padding:zt.constants.RSA_PKCS1_PADDING};return new Uint8Array(zt.publicEncrypt(n,t))}(t,e,r):async function(t,e,r){if(e=nt(e),t=nt(Ft(t,lt(e))),r=nt(r),t>=e)throw Error("Message size cannot exceed modulus size");return yt(at(t,r,e),"be",lt(e))}(t,e,r)}async function Vt(t,e,r,i,n,s,a,o){if(L.getNodeCrypto()&&!o)try{return await async function(t,e,r,i,n,s,a){const o=await Jt(e,r,i,n,s,a),c={key:o,format:"jwk",type:"pkcs1",padding:zt.constants.RSA_PKCS1_PADDING};try{return new Uint8Array(zt.privateDecrypt(c,t))}catch(t){throw Error("Decryption error")}}(t,e,r,i,n,s,a)}catch(t){L.printDebugError(t)}return async function(t,e,r,i,n,s,a,o){if(t=nt(t),e=nt(e),r=nt(r),i=nt(i),n=nt(n),s=nt(s),a=nt(a),t>=e)throw Error("Data too large.");const c=st(i,s-Gt),h=st(i,n-Gt),u=dt(BigInt(2),e),f=at(ct(u,e),r,e);t=st(t*f,e);const l=at(t,h,n),y=at(t,c,s),g=st(a*(y-l),s);let p=g*n+l;return p=st(p*u,e),Lt(yt(p,"be",lt(e)),o)}(t,e,r,i,n,s,a,o)}async function Jt(t,e,r,i,n,s){const a=nt(i),o=nt(n),c=nt(r);let h=st(c,o-Gt),u=st(c,a-Gt);return u=yt(u),h=yt(h),{kty:"RSA",n:q(t),e:q(e),d:q(r),p:q(n),q:q(i),dp:q(h),dq:q(u),qi:q(s),ext:!0}}function Yt(t,e){return{kty:"RSA",n:q(t),e:q(e),ext:!0}}function Zt(t,e){return{n:j(t.n),e:yt(e),d:j(t.d),p:j(t.q),q:j(t.p),u:j(t.qi)}}const Wt=BigInt(1);const Xt=r&&"object"==typeof r&&"webcrypto"in r?r.webcrypto:void 0,$t={};var te=function(t){var e,r=new Float64Array(16);if(t)for(e=0;e<t.length;e++)r[e]=t[e];return r},ee=function(){throw Error("no PRNG")},re=new Uint8Array(32);re[0]=9;var ie=te(),ne=te([1]),se=te([56129,1]),ae=te([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),oe=te([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),ce=te([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),he=te([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),ue=te([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function fe(t,e,r,i){t[e]=r>>24&255,t[e+1]=r>>16&255,t[e+2]=r>>8&255,t[e+3]=255&r,t[e+4]=i>>24&255,t[e+5]=i>>16&255,t[e+6]=i>>8&255,t[e+7]=255&i}function le(t,e,r,i){return function(t,e,r,i,n){var s,a=0;for(s=0;s<n;s++)a|=t[e+s]^r[i+s];return(1&a-1>>>8)-1}(t,e,r,i,32)}function ye(t,e){var r;for(r=0;r<16;r++)t[r]=0|e[r]}function ge(t){var e,r,i=1;for(e=0;e<16;e++)r=t[e]+i+65535,i=Math.floor(r/65536),t[e]=r-65536*i;t[0]+=i-1+37*(i-1)}function pe(t,e,r){for(var i,n=~(r-1),s=0;s<16;s++)i=n&(t[s]^e[s]),t[s]^=i,e[s]^=i}function de(t,e){var r,i,n,s=te(),a=te();for(r=0;r<16;r++)a[r]=e[r];for(ge(a),ge(a),ge(a),i=0;i<2;i++){for(s[0]=a[0]-65517,r=1;r<15;r++)s[r]=a[r]-65535-(s[r-1]>>16&1),s[r-1]&=65535;s[15]=a[15]-32767-(s[14]>>16&1),n=s[15]>>16&1,s[14]&=65535,pe(a,s,1-n)}for(r=0;r<16;r++)t[2*r]=255&a[r],t[2*r+1]=a[r]>>8}function Ae(t,e){var r=new Uint8Array(32),i=new Uint8Array(32);return de(r,t),de(i,e),le(r,0,i,0)}function we(t){var e=new Uint8Array(32);return de(e,t),1&e[0]}function me(t,e){var r;for(r=0;r<16;r++)t[r]=e[2*r]+(e[2*r+1]<<8);t[15]&=32767}function be(t,e,r){for(var i=0;i<16;i++)t[i]=e[i]+r[i]}function ke(t,e,r){for(var i=0;i<16;i++)t[i]=e[i]-r[i]}function Ee(t,e,r){var i,n,s=0,a=0,o=0,c=0,h=0,u=0,f=0,l=0,y=0,g=0,p=0,d=0,A=0,w=0,m=0,b=0,k=0,E=0,v=0,I=0,B=0,S=0,K=0,C=0,D=0,U=0,P=0,x=0,Q=0,R=0,T=0,M=r[0],N=r[1],F=r[2],L=r[3],O=r[4],H=r[5],z=r[6],G=r[7],_=r[8],j=r[9],q=r[10],V=r[11],J=r[12],Y=r[13],Z=r[14],W=r[15];s+=(i=e[0])*M,a+=i*N,o+=i*F,c+=i*L,h+=i*O,u+=i*H,f+=i*z,l+=i*G,y+=i*_,g+=i*j,p+=i*q,d+=i*V,A+=i*J,w+=i*Y,m+=i*Z,b+=i*W,a+=(i=e[1])*M,o+=i*N,c+=i*F,h+=i*L,u+=i*O,f+=i*H,l+=i*z,y+=i*G,g+=i*_,p+=i*j,d+=i*q,A+=i*V,w+=i*J,m+=i*Y,b+=i*Z,k+=i*W,o+=(i=e[2])*M,c+=i*N,h+=i*F,u+=i*L,f+=i*O,l+=i*H,y+=i*z,g+=i*G,p+=i*_,d+=i*j,A+=i*q,w+=i*V,m+=i*J,b+=i*Y,k+=i*Z,E+=i*W,c+=(i=e[3])*M,h+=i*N,u+=i*F,f+=i*L,l+=i*O,y+=i*H,g+=i*z,p+=i*G,d+=i*_,A+=i*j,w+=i*q,m+=i*V,b+=i*J,k+=i*Y,E+=i*Z,v+=i*W,h+=(i=e[4])*M,u+=i*N,f+=i*F,l+=i*L,y+=i*O,g+=i*H,p+=i*z,d+=i*G,A+=i*_,w+=i*j,m+=i*q,b+=i*V,k+=i*J,E+=i*Y,v+=i*Z,I+=i*W,u+=(i=e[5])*M,f+=i*N,l+=i*F,y+=i*L,g+=i*O,p+=i*H,d+=i*z,A+=i*G,w+=i*_,m+=i*j,b+=i*q,k+=i*V,E+=i*J,v+=i*Y,I+=i*Z,B+=i*W,f+=(i=e[6])*M,l+=i*N,y+=i*F,g+=i*L,p+=i*O,d+=i*H,A+=i*z,w+=i*G,m+=i*_,b+=i*j,k+=i*q,E+=i*V,v+=i*J,I+=i*Y,B+=i*Z,S+=i*W,l+=(i=e[7])*M,y+=i*N,g+=i*F,p+=i*L,d+=i*O,A+=i*H,w+=i*z,m+=i*G,b+=i*_,k+=i*j,E+=i*q,v+=i*V,I+=i*J,B+=i*Y,S+=i*Z,K+=i*W,y+=(i=e[8])*M,g+=i*N,p+=i*F,d+=i*L,A+=i*O,w+=i*H,m+=i*z,b+=i*G,k+=i*_,E+=i*j,v+=i*q,I+=i*V,B+=i*J,S+=i*Y,K+=i*Z,C+=i*W,g+=(i=e[9])*M,p+=i*N,d+=i*F,A+=i*L,w+=i*O,m+=i*H,b+=i*z,k+=i*G,E+=i*_,v+=i*j,I+=i*q,B+=i*V,S+=i*J,K+=i*Y,C+=i*Z,D+=i*W,p+=(i=e[10])*M,d+=i*N,A+=i*F,w+=i*L,m+=i*O,b+=i*H,k+=i*z,E+=i*G,v+=i*_,I+=i*j,B+=i*q,S+=i*V,K+=i*J,C+=i*Y,D+=i*Z,U+=i*W,d+=(i=e[11])*M,A+=i*N,w+=i*F,m+=i*L,b+=i*O,k+=i*H,E+=i*z,v+=i*G,I+=i*_,B+=i*j,S+=i*q,K+=i*V,C+=i*J,D+=i*Y,U+=i*Z,P+=i*W,A+=(i=e[12])*M,w+=i*N,m+=i*F,b+=i*L,k+=i*O,E+=i*H,v+=i*z,I+=i*G,B+=i*_,S+=i*j,K+=i*q,C+=i*V,D+=i*J,U+=i*Y,P+=i*Z,x+=i*W,w+=(i=e[13])*M,m+=i*N,b+=i*F,k+=i*L,E+=i*O,v+=i*H,I+=i*z,B+=i*G,S+=i*_,K+=i*j,C+=i*q,D+=i*V,U+=i*J,P+=i*Y,x+=i*Z,Q+=i*W,m+=(i=e[14])*M,b+=i*N,k+=i*F,E+=i*L,v+=i*O,I+=i*H,B+=i*z,S+=i*G,K+=i*_,C+=i*j,D+=i*q,U+=i*V,P+=i*J,x+=i*Y,Q+=i*Z,R+=i*W,b+=(i=e[15])*M,a+=38*(E+=i*F),o+=38*(v+=i*L),c+=38*(I+=i*O),h+=38*(B+=i*H),u+=38*(S+=i*z),f+=38*(K+=i*G),l+=38*(C+=i*_),y+=38*(D+=i*j),g+=38*(U+=i*q),p+=38*(P+=i*V),d+=38*(x+=i*J),A+=38*(Q+=i*Y),w+=38*(R+=i*Z),m+=38*(T+=i*W),s=(i=(s+=38*(k+=i*N))+(n=1)+65535)-65536*(n=Math.floor(i/65536)),a=(i=a+n+65535)-65536*(n=Math.floor(i/65536)),o=(i=o+n+65535)-65536*(n=Math.floor(i/65536)),c=(i=c+n+65535)-65536*(n=Math.floor(i/65536)),h=(i=h+n+65535)-65536*(n=Math.floor(i/65536)),u=(i=u+n+65535)-65536*(n=Math.floor(i/65536)),f=(i=f+n+65535)-65536*(n=Math.floor(i/65536)),l=(i=l+n+65535)-65536*(n=Math.floor(i/65536)),y=(i=y+n+65535)-65536*(n=Math.floor(i/65536)),g=(i=g+n+65535)-65536*(n=Math.floor(i/65536)),p=(i=p+n+65535)-65536*(n=Math.floor(i/65536)),d=(i=d+n+65535)-65536*(n=Math.floor(i/65536)),A=(i=A+n+65535)-65536*(n=Math.floor(i/65536)),w=(i=w+n+65535)-65536*(n=Math.floor(i/65536)),m=(i=m+n+65535)-65536*(n=Math.floor(i/65536)),b=(i=b+n+65535)-65536*(n=Math.floor(i/65536)),s=(i=(s+=n-1+37*(n-1))+(n=1)+65535)-65536*(n=Math.floor(i/65536)),a=(i=a+n+65535)-65536*(n=Math.floor(i/65536)),o=(i=o+n+65535)-65536*(n=Math.floor(i/65536)),c=(i=c+n+65535)-65536*(n=Math.floor(i/65536)),h=(i=h+n+65535)-65536*(n=Math.floor(i/65536)),u=(i=u+n+65535)-65536*(n=Math.floor(i/65536)),f=(i=f+n+65535)-65536*(n=Math.floor(i/65536)),l=(i=l+n+65535)-65536*(n=Math.floor(i/65536)),y=(i=y+n+65535)-65536*(n=Math.floor(i/65536)),g=(i=g+n+65535)-65536*(n=Math.floor(i/65536)),p=(i=p+n+65535)-65536*(n=Math.floor(i/65536)),d=(i=d+n+65535)-65536*(n=Math.floor(i/65536)),A=(i=A+n+65535)-65536*(n=Math.floor(i/65536)),w=(i=w+n+65535)-65536*(n=Math.floor(i/65536)),m=(i=m+n+65535)-65536*(n=Math.floor(i/65536)),b=(i=b+n+65535)-65536*(n=Math.floor(i/65536)),s+=n-1+37*(n-1),t[0]=s,t[1]=a,t[2]=o,t[3]=c,t[4]=h,t[5]=u,t[6]=f,t[7]=l,t[8]=y,t[9]=g,t[10]=p,t[11]=d,t[12]=A,t[13]=w,t[14]=m,t[15]=b}function ve(t,e){Ee(t,e,e)}function Ie(t,e){var r,i=te();for(r=0;r<16;r++)i[r]=e[r];for(r=253;r>=0;r--)ve(i,i),2!==r&&4!==r&&Ee(i,i,e);for(r=0;r<16;r++)t[r]=i[r]}function Be(t,e,r){var i,n,s=new Uint8Array(32),a=new Float64Array(80),o=te(),c=te(),h=te(),u=te(),f=te(),l=te();for(n=0;n<31;n++)s[n]=e[n];for(s[31]=127&e[31]|64,s[0]&=248,me(a,r),n=0;n<16;n++)c[n]=a[n],u[n]=o[n]=h[n]=0;for(o[0]=u[0]=1,n=254;n>=0;--n)pe(o,c,i=s[n>>>3]>>>(7&n)&1),pe(h,u,i),be(f,o,h),ke(o,o,h),be(h,c,u),ke(c,c,u),ve(u,f),ve(l,o),Ee(o,h,o),Ee(h,c,f),be(f,o,h),ke(o,o,h),ve(c,o),ke(h,u,l),Ee(o,h,se),be(o,o,u),Ee(h,h,o),Ee(o,u,l),Ee(u,c,a),ve(c,f),pe(o,c,i),pe(h,u,i);for(n=0;n<16;n++)a[n+16]=o[n],a[n+32]=h[n],a[n+48]=c[n],a[n+64]=u[n];var y=a.subarray(32),g=a.subarray(16);return Ie(y,y),Ee(g,g,y),de(t,g),0}function Se(t,e){return Be(t,e,re)}var Ke=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function Ce(t,e,r,i){for(var n,s,a,o,c,h,u,f,l,y,g,p,d,A,w,m,b,k,E,v,I,B,S,K,C,D,U=new Int32Array(16),P=new Int32Array(16),x=t[0],Q=t[1],R=t[2],T=t[3],M=t[4],N=t[5],F=t[6],L=t[7],O=e[0],H=e[1],z=e[2],G=e[3],_=e[4],j=e[5],q=e[6],V=e[7],J=0;i>=128;){for(E=0;E<16;E++)v=8*E+J,U[E]=r[v+0]<<24|r[v+1]<<16|r[v+2]<<8|r[v+3],P[E]=r[v+4]<<24|r[v+5]<<16|r[v+6]<<8|r[v+7];for(E=0;E<80;E++)if(n=x,s=Q,a=R,o=T,c=M,h=N,u=F,L,l=O,y=H,g=z,p=G,d=_,A=j,w=q,V,S=65535&(B=V),K=B>>>16,C=65535&(I=L),D=I>>>16,S+=65535&(B=(_>>>14|M<<18)^(_>>>18|M<<14)^(M>>>9|_<<23)),K+=B>>>16,C+=65535&(I=(M>>>14|_<<18)^(M>>>18|_<<14)^(_>>>9|M<<23)),D+=I>>>16,S+=65535&(B=_&j^~_&q),K+=B>>>16,C+=65535&(I=M&N^~M&F),D+=I>>>16,S+=65535&(B=Ke[2*E+1]),K+=B>>>16,C+=65535&(I=Ke[2*E]),D+=I>>>16,I=U[E%16],K+=(B=P[E%16])>>>16,C+=65535&I,D+=I>>>16,C+=(K+=(S+=65535&B)>>>16)>>>16,S=65535&(B=k=65535&S|K<<16),K=B>>>16,C=65535&(I=b=65535&C|(D+=C>>>16)<<16),D=I>>>16,S+=65535&(B=(O>>>28|x<<4)^(x>>>2|O<<30)^(x>>>7|O<<25)),K+=B>>>16,C+=65535&(I=(x>>>28|O<<4)^(O>>>2|x<<30)^(O>>>7|x<<25)),D+=I>>>16,K+=(B=O&H^O&z^H&z)>>>16,C+=65535&(I=x&Q^x&R^Q&R),D+=I>>>16,f=65535&(C+=(K+=(S+=65535&B)>>>16)>>>16)|(D+=C>>>16)<<16,m=65535&S|K<<16,S=65535&(B=p),K=B>>>16,C=65535&(I=o),D=I>>>16,K+=(B=k)>>>16,C+=65535&(I=b),D+=I>>>16,Q=n,R=s,T=a,M=o=65535&(C+=(K+=(S+=65535&B)>>>16)>>>16)|(D+=C>>>16)<<16,N=c,F=h,L=u,x=f,H=l,z=y,G=g,_=p=65535&S|K<<16,j=d,q=A,V=w,O=m,E%16==15)for(v=0;v<16;v++)I=U[v],S=65535&(B=P[v]),K=B>>>16,C=65535&I,D=I>>>16,I=U[(v+9)%16],S+=65535&(B=P[(v+9)%16]),K+=B>>>16,C+=65535&I,D+=I>>>16,b=U[(v+1)%16],S+=65535&(B=((k=P[(v+1)%16])>>>1|b<<31)^(k>>>8|b<<24)^(k>>>7|b<<25)),K+=B>>>16,C+=65535&(I=(b>>>1|k<<31)^(b>>>8|k<<24)^b>>>7),D+=I>>>16,b=U[(v+14)%16],K+=(B=((k=P[(v+14)%16])>>>19|b<<13)^(b>>>29|k<<3)^(k>>>6|b<<26))>>>16,C+=65535&(I=(b>>>19|k<<13)^(k>>>29|b<<3)^b>>>6),D+=I>>>16,D+=(C+=(K+=(S+=65535&B)>>>16)>>>16)>>>16,U[v]=65535&C|D<<16,P[v]=65535&S|K<<16;S=65535&(B=O),K=B>>>16,C=65535&(I=x),D=I>>>16,I=t[0],K+=(B=e[0])>>>16,C+=65535&I,D+=I>>>16,D+=(C+=(K+=(S+=65535&B)>>>16)>>>16)>>>16,t[0]=x=65535&C|D<<16,e[0]=O=65535&S|K<<16,S=65535&(B=H),K=B>>>16,C=65535&(I=Q),D=I>>>16,I=t[1],K+=(B=e[1])>>>16,C+=65535&I,D+=I>>>16,D+=(C+=(K+=(S+=65535&B)>>>16)>>>16)>>>16,t[1]=Q=65535&C|D<<16,e[1]=H=65535&S|K<<16,S=65535&(B=z),K=B>>>16,C=65535&(I=R),D=I>>>16,I=t[2],K+=(B=e[2])>>>16,C+=65535&I,D+=I>>>16,D+=(C+=(K+=(S+=65535&B)>>>16)>>>16)>>>16,t[2]=R=65535&C|D<<16,e[2]=z=65535&S|K<<16,S=65535&(B=G),K=B>>>16,C=65535&(I=T),D=I>>>16,I=t[3],K+=(B=e[3])>>>16,C+=65535&I,D+=I>>>16,D+=(C+=(K+=(S+=65535&B)>>>16)>>>16)>>>16,t[3]=T=65535&C|D<<16,e[3]=G=65535&S|K<<16,S=65535&(B=_),K=B>>>16,C=65535&(I=M),D=I>>>16,I=t[4],K+=(B=e[4])>>>16,C+=65535&I,D+=I>>>16,D+=(C+=(K+=(S+=65535&B)>>>16)>>>16)>>>16,t[4]=M=65535&C|D<<16,e[4]=_=65535&S|K<<16,S=65535&(B=j),K=B>>>16,C=65535&(I=N),D=I>>>16,I=t[5],K+=(B=e[5])>>>16,C+=65535&I,D+=I>>>16,D+=(C+=(K+=(S+=65535&B)>>>16)>>>16)>>>16,t[5]=N=65535&C|D<<16,e[5]=j=65535&S|K<<16,S=65535&(B=q),K=B>>>16,C=65535&(I=F),D=I>>>16,I=t[6],K+=(B=e[6])>>>16,C+=65535&I,D+=I>>>16,D+=(C+=(K+=(S+=65535&B)>>>16)>>>16)>>>16,t[6]=F=65535&C|D<<16,e[6]=q=65535&S|K<<16,S=65535&(B=V),K=B>>>16,C=65535&(I=L),D=I>>>16,I=t[7],K+=(B=e[7])>>>16,C+=65535&I,D+=I>>>16,D+=(C+=(K+=(S+=65535&B)>>>16)>>>16)>>>16,t[7]=L=65535&C|D<<16,e[7]=V=65535&S|K<<16,J+=128,i-=128}return i}function De(t,e,r){var i,n=new Int32Array(8),s=new Int32Array(8),a=new Uint8Array(256),o=r;for(n[0]=1779033703,n[1]=3144134277,n[2]=1013904242,n[3]=2773480762,n[4]=1359893119,n[5]=2600822924,n[6]=528734635,n[7]=1541459225,s[0]=4089235720,s[1]=2227873595,s[2]=4271175723,s[3]=1595750129,s[4]=2917565137,s[5]=725511199,s[6]=4215389547,s[7]=327033209,Ce(n,s,e,r),r%=128,i=0;i<r;i++)a[i]=e[o-r+i];for(a[r]=128,a[(r=256-128*(r<112?1:0))-9]=0,fe(a,r-8,o/536870912|0,o<<3),Ce(n,s,a,r),i=0;i<8;i++)fe(t,8*i,n[i],s[i]);return 0}function Ue(t,e){var r=te(),i=te(),n=te(),s=te(),a=te(),o=te(),c=te(),h=te(),u=te();ke(r,t[1],t[0]),ke(u,e[1],e[0]),Ee(r,r,u),be(i,t[0],t[1]),be(u,e[0],e[1]),Ee(i,i,u),Ee(n,t[3],e[3]),Ee(n,n,oe),Ee(s,t[2],e[2]),be(s,s,s),ke(a,i,r),ke(o,s,n),be(c,s,n),be(h,i,r),Ee(t[0],a,o),Ee(t[1],h,c),Ee(t[2],c,o),Ee(t[3],a,h)}function Pe(t,e,r){var i;for(i=0;i<4;i++)pe(t[i],e[i],r)}function xe(t,e){var r=te(),i=te(),n=te();Ie(n,e[2]),Ee(r,e[0],n),Ee(i,e[1],n),de(t,i),t[31]^=we(r)<<7}function Qe(t,e,r){var i,n;for(ye(t[0],ie),ye(t[1],ne),ye(t[2],ne),ye(t[3],ie),n=255;n>=0;--n)Pe(t,e,i=r[n/8|0]>>(7&n)&1),Ue(e,t),Ue(t,t),Pe(t,e,i)}function Re(t,e){var r=[te(),te(),te(),te()];ye(r[0],ce),ye(r[1],he),ye(r[2],ne),Ee(r[3],ce,he),Qe(t,r,e)}function Te(t,e,r){var i,n=new Uint8Array(64),s=[te(),te(),te(),te()];for(r||ee(e,32),De(n,e,32),n[0]&=248,n[31]&=127,n[31]|=64,Re(s,n),xe(t,s),i=0;i<32;i++)e[i+32]=t[i];return 0}var Me=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function Ne(t,e){var r,i,n,s;for(i=63;i>=32;--i){for(r=0,n=i-32,s=i-12;n<s;++n)e[n]+=r-16*e[i]*Me[n-(i-32)],r=Math.floor((e[n]+128)/256),e[n]-=256*r;e[n]+=r,e[i]=0}for(r=0,n=0;n<32;n+