UNPKG

@protontech/openpgp

Version:

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

2 lines 272 kB
/*! OpenPGP.js v6.1.1-patch.4 - 2025-07-14 - this is LGPL licensed code, see LICENSE/our website https://openpgpjs.org/ for more information. */ const e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=Symbol("doneWritingPromise"),r=Symbol("doneWritingResolve"),i=Symbol("doneWritingReject"),n=Symbol("readingIndex");class ArrayStream extends Array{constructor(){super(),Object.setPrototypeOf(this,ArrayStream.prototype),this[t]=new Promise(((e,t)=>{this[r]=e,this[i]=t})),this[t].catch((()=>{}))}}function a(e){return e&&e.getReader&&Array.isArray(e)}function s(e){if(!a(e)){const t=e.getWriter(),r=t.releaseLock;return t.releaseLock=()=>{t.closed.catch((function(){})),r.call(t)},t}this.stream=e}function o(t){if(a(t))return"array";if(e.ReadableStream&&e.ReadableStream.prototype.isPrototypeOf(t))return"web";if(t&&!(e.ReadableStream&&t instanceof e.ReadableStream)&&"function"==typeof t._read&&"object"==typeof t._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!(!t||!t.getReader)&&"web-like"}function c(e){return Uint8Array.prototype.isPrototypeOf(e)}function u(e){if(1===e.length)return e[0];let t=0;for(let r=0;r<e.length;r++){if(!c(e[r]))throw Error("concatUint8Array: Data must be in the form of a Uint8Array");t+=e[r].length}const r=new Uint8Array(t);let i=0;return e.forEach((function(e){r.set(e,i),i+=e.length})),r}ArrayStream.prototype.getReader=function(){return void 0===this[n]&&(this[n]=0),{read:async()=>(await this[t],this[n]===this.length?{value:void 0,done:!0}:{value:this[this[n]++],done:!1})}},ArrayStream.prototype.readToEnd=async function(e){await this[t];const r=e(this.slice(this[n]));return this.length=0,r},ArrayStream.prototype.clone=function(){const e=new ArrayStream;return e[t]=this[t].then((()=>{e.push(...this)})),e},s.prototype.write=async function(e){this.stream.push(e)},s.prototype.close=async function(){this.stream[r]()},s.prototype.abort=async function(e){return this.stream[i](e),e},s.prototype.releaseLock=function(){},"object"==typeof e.process&&e.process.versions;const h=new WeakSet,l=Symbol("externalBuffer");function y(e){if(this.stream=e,e[l]&&(this[l]=e[l].slice()),a(e)){const t=e.getReader();return this._read=t.read.bind(t),this._releaseLock=()=>{},void(this._cancel=()=>{})}if(o(e)){const t=e.getReader();return this._read=t.read.bind(t),this._releaseLock=()=>{t.closed.catch((function(){})),t.releaseLock()},void(this._cancel=t.cancel.bind(t))}let t=!1;this._read=async()=>t||h.has(e)?{value:void 0,done:!0}:(t=!0,{value:e,done:!1}),this._releaseLock=()=>{if(t)try{h.add(e)}catch(e){}}}function p(e){return o(e)?e:new ReadableStream({start(t){t.enqueue(e),t.close()}})}function d(e){if(o(e))return e;const t=new ArrayStream;return(async()=>{const r=I(t);await r.write(e),await r.close()})(),t}function g(e){return e.some((e=>o(e)&&!a(e)))?function(e){e=e.map(p);const t=w((async function(e){await Promise.all(i.map((t=>U(t,e))))}));let r=Promise.resolve();const i=e.map(((i,n)=>k(i,((i,a)=>(r=r.then((()=>f(i,t.writable,{preventClose:n!==e.length-1}))),r)))));return t.readable}(e):e.some((e=>a(e)))?function(e){const t=new ArrayStream;let r=Promise.resolve();return e.forEach(((i,n)=>(r=r.then((()=>f(i,t,{preventClose:n!==e.length-1}))),r))),t}(e):"string"==typeof e[0]?e.join(""):u(e)}async function f(e,t,{preventClose:r=!1,preventAbort:i=!1,preventCancel:n=!1}={}){if(o(e)&&!a(e)){e=p(e);try{if(e[l]){const r=I(t);for(let t=0;t<e[l].length;t++)await r.ready,await r.write(e[l][t]);r.releaseLock()}await e.pipeTo(t,{preventClose:r,preventAbort:i,preventCancel:n})}catch(e){}return}const s=x(e=d(e)),c=I(t);try{for(;;){await c.ready;const{done:e,value:t}=await s.read();if(e){r||await c.close();break}await c.write(t)}}catch(e){i||await c.abort(e)}finally{s.releaseLock(),c.releaseLock()}}function m(e,t){const r=new TransformStream(t);return f(e,r.writable),r.readable}function w(e){let t,r,i,n=!1,a=!1;return{readable:new ReadableStream({start(e){i=e},pull(){t?t():n=!0},async cancel(t){a=!0,e&&await e(t),r&&r(t)}},{highWaterMark:0}),writable:new WritableStream({write:async function(e){if(a)throw Error("Stream is cancelled");i.enqueue(e),n?n=!1:(await new Promise(((e,i)=>{t=e,r=i})),t=null,r=null)},close:i.close.bind(i),abort:i.error.bind(i)})}}function b(e,t=()=>{},r=()=>{}){if(a(e)){const i=new ArrayStream;return(async()=>{const n=I(i);try{const i=await P(e),a=t(i),s=r();let o;o=void 0!==a&&void 0!==s?g([a,s]):void 0!==a?a:s,await n.write(o),await n.close()}catch(e){await n.abort(e)}})(),i}if(o(e))return m(e,{async transform(e,r){try{const i=await t(e);void 0!==i&&r.enqueue(i)}catch(e){r.error(e)}},async flush(e){try{const t=await r();void 0!==t&&e.enqueue(t)}catch(t){e.error(t)}}});const i=t(e),n=r();return void 0!==i&&void 0!==n?g([i,n]):void 0!==i?i:n}function k(e,t){if(o(e)&&!a(e)){let r;const i=new TransformStream({start(e){r=e}}),n=f(e,i.writable),a=w((async function(e){r.error(e),await n,await new Promise(setTimeout)}));return t(i.readable,a.writable),a.readable}e=d(e);const r=new ArrayStream;return t(e,r),r}function v(e,t){let r;const i=k(e,((e,n)=>{const a=x(e);a.remainder=()=>(a.releaseLock(),f(e,n),i),r=t(a)}));return r}function K(e){if(a(e))return e.clone();if(o(e)){const t=function(e){if(a(e))throw Error("ArrayStream cannot be tee()d, use clone() instead");if(o(e)){const t=p(e).tee();return t[0][l]=t[1][l]=e[l],t}return[S(e),S(e)]}(e);return E(e,t[0]),t[1]}return S(e)}function A(e){return a(e)?K(e):o(e)?new ReadableStream({start(t){const r=k(e,(async(e,r)=>{const i=x(e),n=I(r);try{for(;;){await n.ready;const{done:e,value:r}=await i.read();if(e){try{t.close()}catch(e){}return void await n.close()}try{t.enqueue(r)}catch(e){}await n.write(r)}}catch(e){t.error(e),await n.abort(e)}}));E(e,r)}}):S(e)}function E(e,t){Object.entries(Object.getOwnPropertyDescriptors(e.constructor.prototype)).forEach((([r,i])=>{"constructor"!==r&&(i.value?i.value=i.value.bind(t):i.get=i.get.bind(t),Object.defineProperty(e,r,i))}))}function S(e,t=0,r=1/0){if(a(e))throw Error("Not implemented");if(o(e)){if(t>=0&&r>=0){let i=0;return m(e,{transform(e,n){i<r?(i+e.length>=t&&n.enqueue(S(e,Math.max(t-i,0),r-i)),i+=e.length):n.terminate()}})}if(t<0&&(r<0||r===1/0)){let i=[];return b(e,(e=>{e.length>=-t?i=[e]:i.push(e)}),(()=>S(g(i),t,r)))}if(0===t&&r<0){let i;return b(e,(e=>{const n=i?g([i,e]):e;if(n.length>=-r)return i=S(n,r),S(n,t,r);i=n}))}return console.warn(`stream.slice(input, ${t}, ${r}) not implemented efficiently.`),D((async()=>S(await P(e),t,r)))}return e[l]&&(e=g(e[l].concat([e]))),c(e)?e.subarray(t,r===1/0?e.length:r):e.slice(t,r)}async function P(e,t=g){return a(e)?e.readToEnd(t):o(e)?x(e).readToEnd(t):e}async function U(e,t){if(o(e)){if(e.cancel){const r=await e.cancel(t);return await new Promise(setTimeout),r}if(e.destroy)return e.destroy(t),await new Promise(setTimeout),t}}function D(e){const t=new ArrayStream;return(async()=>{const r=I(t);try{await r.write(await e()),await r.close()}catch(e){await r.abort(e)}})(),t}function x(e){return new y(e)}function I(e){return new s(e)}y.prototype.read=async function(){if(this[l]&&this[l].length){return{done:!1,value:this[l].shift()}}return this._read()},y.prototype.releaseLock=function(){this[l]&&(this.stream[l]=this[l]),this._releaseLock()},y.prototype.cancel=function(e){return this._cancel(e)},y.prototype.readLine=async function(){let e,t=[];for(;!e;){let{done:r,value:i}=await this.read();if(i+="",r)return t.length?g(t):void 0;const n=i.indexOf("\n")+1;n&&(e=g(t.concat(i.substr(0,n))),t=[]),n!==i.length&&t.push(i.substr(n))}return this.unshift(...t),e},y.prototype.readByte=async function(){const{done:e,value:t}=await this.read();if(e)return;const r=t[0];return this.unshift(S(t,1)),r},y.prototype.readBytes=async function(e){const t=[];let r=0;for(;;){const{done:i,value:n}=await this.read();if(i)return t.length?g(t):void 0;if(t.push(n),r+=n.length,r>=e){const r=g(t);return this.unshift(S(r,e)),S(r,0,e)}}},y.prototype.peekBytes=async function(e){const t=await this.readBytes(e);return this.unshift(t),t},y.prototype.unshift=function(...e){this[l]||(this[l]=[]),1===e.length&&c(e[0])&&this[l].length&&e[0].length&&this[l][0].byteOffset>=e[0].length?this[l][0]=new Uint8Array(this[l][0].buffer,this[l][0].byteOffset-e[0].length,this[l][0].byteLength+e[0].length):this[l].unshift(...e.filter((e=>e&&e.length)))},y.prototype.readToEnd=async function(e=g){const t=[];for(;;){const{done:e,value:r}=await this.read();if(e)break;t.push(r)}return e(t)};const C=Symbol("byValue");var B={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"},kdfFlags:{replace_fingerprint:1,replace_kdf_params:2},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,pqc_mldsa_ed25519:30,pqc_mlkem_x25519:35,aead:100,hmac:101},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,forwardedCommunication:64,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(e,t){if("number"==typeof t&&(t=this.read(e,t)),void 0!==e[t])return e[t];throw Error("Invalid enum value.")},read:function(e,t){if(e[C]||(e[C]=[],Object.entries(e).forEach((([t,r])=>{e[C][r]=t}))),void 0!==e[C][t])return e[C][t];throw Error("Invalid enum value.")}},T={preferredHashAlgorithm:B.hash.sha512,preferredSymmetricAlgorithm:B.symmetric.aes256,preferredCompressionAlgorithm:B.compression.uncompressed,aeadProtect:!1,ignoreSEIPDv2FeatureFlag:!1,parseAEADEncryptedV4KeysAsLegacy:!1,preferredAEADAlgorithm:B.aead.gcm,aeadChunkSizeByte:12,v6Keys:!1,enableParsingV5Entities:!1,s2kType:B.s2k.iterated,s2kIterationCountByte:224,s2kArgon2Params:{passes:3,parallelism:4,memoryExponent:16},allowUnauthenticatedMessages:!1,allowUnauthenticatedStream:!1,allowForwardedMessages:!1,minRSABits:2047,passwordCollisionCheck:!1,allowInsecureDecryptionWithSigningKeys:!1,allowInsecureVerificationWithReformattedKeys:!1,allowMissingKeyFlags:!1,constantTimePKCS1Decryption:!1,constantTimePKCS1DecryptionSupportedSymmetricAlgorithms:new Set([B.symmetric.aes128,B.symmetric.aes192,B.symmetric.aes256]),ignoreUnsupportedPackets:!0,ignoreMalformedPackets:!1,enforceGrammar:!0,pluggableGrammarErrorReporter:null,additionalAllowedPackets:[],showVersion:!1,showComment:!1,versionString:"OpenPGP.js 6.1.1-patch.4",commentString:"https://openpgpjs.org",maxUserIDLength:5120,knownNotations:[],nonDeterministicSignaturesViaNotation:!0,useEllipticFallback:!0,rejectHashAlgorithms:new Set([B.hash.md5,B.hash.ripemd]),rejectMessageHashAlgorithms:new Set([B.hash.md5,B.hash.ripemd,B.hash.sha1]),rejectPublicKeyAlgorithms:new Set([B.publicKey.elgamal,B.publicKey.dsa]),rejectCurves:new Set([B.curve.secp256k1])};const M=(()=>{try{return"development"===process.env.NODE_ENV}catch(e){}return!1})(),F={isString:function(e){return"string"==typeof e||e instanceof String},nodeRequire:()=>{},isArray:function(e){return e instanceof Array},isUint8Array:c,isStream:o,getNobleCurve:async(e,t)=>{if(!T.useEllipticFallback)throw Error("This curve is only supported in the full build of OpenPGP.js");const{nobleCurves:r}=await import("./noble_curves.min.mjs");switch(e){case B.publicKey.ecdh:case B.publicKey.ecdsa:{const e=r.get(t);if(!e)throw Error("Unsupported curve");return e}case B.publicKey.x448:return r.get("x448");case B.publicKey.ed448:return r.get("ed448");default:throw Error("Unsupported curve")}},readNumber:function(e){let t=0;for(let r=0;r<e.length;r++)t+=256**r*e[e.length-1-r];return t},writeNumber:function(e,t){const r=new Uint8Array(t);for(let i=0;i<t;i++)r[i]=e>>8*(t-i-1)&255;return r},readDate:function(e){const t=F.readNumber(e);return new Date(1e3*t)},writeDate:function(e){const t=Math.floor(e.getTime()/1e3);return F.writeNumber(t,4)},normalizeDate:function(e=Date.now()){return null===e||e===1/0?e:new Date(1e3*Math.floor(+e/1e3))},readMPI:function(e){const t=(e[0]<<8|e[1])+7>>>3;return F.readExactSubarray(e,2,2+t)},readExactSubarray:function(e,t,r){if(e.length<r-t)throw Error("Input array too short");return e.subarray(t,r)},leftPad(e,t){if(e.length>t)throw Error("Input array too long");const r=new Uint8Array(t),i=t-e.length;return r.set(e,i),r},uint8ArrayToMPI:function(e){const t=F.uint8ArrayBitLength(e);if(0===t)throw Error("Zero MPI");const r=e.subarray(e.length-Math.ceil(t/8)),i=new Uint8Array([(65280&t)>>8,255&t]);return F.concatUint8Array([i,r])},uint8ArrayBitLength:function(e){let t;for(t=0;t<e.length&&0===e[t];t++);if(t===e.length)return 0;const r=e.subarray(t);return 8*(r.length-1)+F.nbits(r[0])},hexToUint8Array:function(e){const t=new Uint8Array(e.length>>1);for(let r=0;r<e.length>>1;r++)t[r]=parseInt(e.substr(r<<1,2),16);return t},uint8ArrayToHex:function(e){const t="0123456789abcdef";let r="";return e.forEach((e=>{r+=t[e>>4]+t[15&e]})),r},stringToUint8Array:function(e){return b(e,(e=>{if(!F.isString(e))throw Error("stringToUint8Array: Data must be in the form of a string");const t=new Uint8Array(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}))},uint8ArrayToString:function(e){const t=[],r=16384,i=(e=new Uint8Array(e)).length;for(let n=0;n<i;n+=r)t.push(String.fromCharCode.apply(String,e.subarray(n,n+r<i?n+r:i)));return t.join("")},encodeUTF8:function(e){const t=new TextEncoder("utf-8");function r(e,r=!1){return t.encode(e,{stream:!r})}return b(e,r,(()=>r("",!0)))},decodeUTF8:function(e){const t=new TextDecoder("utf-8");function r(e,r=!1){return t.decode(e,{stream:!r})}return b(e,r,(()=>r(new Uint8Array,!0)))},concat:g,concatUint8Array:u,equalsUint8Array:function(e,t){if(!F.isUint8Array(e)||!F.isUint8Array(t))throw Error("Data must be in the form of a Uint8Array");if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0},findLastIndex:function(e,t){for(let r=e.length;r>=0;r--)if(t(e[r],r,e))return r;return-1},writeChecksum:function(e){let t=0;for(let r=0;r<e.length;r++)t=t+e[r]&65535;return F.writeNumber(t,2)},printDebug:function(e){M&&console.log("[OpenPGP.js debug]",e)},printDebugError:function(e){M&&console.error("[OpenPGP.js debug]",e)},nbits:function(e){let t=1,r=e>>>16;return 0!==r&&(e=r,t+=16),r=e>>8,0!==r&&(e=r,t+=8),r=e>>4,0!==r&&(e=r,t+=4),r=e>>2,0!==r&&(e=r,t+=2),r=e>>1,0!==r&&(e=r,t+=1),t},double:function(e){const t=new Uint8Array(e.length),r=e.length-1;for(let i=0;i<r;i++)t[i]=e[i]<<1^e[i+1]>>7;return t[r]=e[r]<<1^135*(e[0]>>7),t},shiftRight:function(e,t){if(t)for(let r=e.length-1;r>=0;r--)e[r]>>=t,r>0&&(e[r]|=e[r-1]<<8-t);return e},getWebCrypto:function(){const t=void 0!==e&&e.crypto&&e.crypto.subtle||this.getNodeCrypto()?.webcrypto.subtle;if(!t)throw Error("The WebCrypto API is not available");return t},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(e){if(!F.isString(e))return!1;return/^[^\p{C}\p{Z}@<>\\]+@[^\p{C}\p{Z}@<>\\]+[^\p{C}\p{Z}\p{P}]$/u.test(e)},canonicalizeEOL:function(e){let t=!1;return b(e,(e=>{let r;t&&(e=F.concatUint8Array([new Uint8Array([13]),e])),13===e[e.length-1]?(t=!0,e=e.subarray(0,-1)):t=!1;const i=[];for(let t=0;r=e.indexOf(10,t)+1,r;t=r)13!==e[r-2]&&i.push(r);if(!i.length)return e;const n=new Uint8Array(e.length+i.length);let a=0;for(let t=0;t<i.length;t++){const r=e.subarray(i[t-1]||0,i[t]);n.set(r,a),a+=r.length,n[a-1]=13,n[a]=10,a++}return n.set(e.subarray(i[i.length-1]||0),a),n}),(()=>t?new Uint8Array([13]):void 0))},nativeEOL:function(e){let t=!1;return b(e,(e=>{let r;13===(e=t&&10!==e[0]?F.concatUint8Array([new Uint8Array([13]),e]):new Uint8Array(e))[e.length-1]?(t=!0,e=e.subarray(0,-1)):t=!1;let i=0;for(let t=0;t!==e.length;t=r){r=e.indexOf(13,t)+1,r||(r=e.length);const n=r-(10===e[r]?1:0);t&&e.copyWithin(i,t,n),i+=n-t}return e.subarray(0,i)}),(()=>t?new Uint8Array([13]):void 0))},removeTrailingSpaces:function(e){return e.split("\n").map((e=>{let t=e.length-1;for(;t>=0&&(" "===e[t]||"\t"===e[t]||"\r"===e[t]);t--);return e.substr(0,t+1)})).join("\n")},wrapError:function(e,t){if(!t)return Error(e);try{t.message=e+": "+t.message}catch(e){}return t},constructAllowedPackets:function(e){const t={};return e.forEach((e=>{if(!e.tag)throw Error("Invalid input: expected a packet class");t[e.tag]=e})),t},anyPromise:function(e){return new Promise((async(t,r)=>{let i;await Promise.all(e.map((async e=>{try{t(await e)}catch(e){i=e}}))),r(i)}))},selectUint8Array:function(e,t,r){const i=Math.max(t.length,r.length),n=new Uint8Array(i);let a=0;for(let i=0;i<n.length;i++)n[i]=t[i]&256-e|r[i]&255+e,a+=e&i<t.length|1-e&i<r.length;return n.subarray(0,a)},selectUint8:function(e,t,r){return t&256-e|r&255+e},isAES:function(e){return e===B.symmetric.aes128||e===B.symmetric.aes192||e===B.symmetric.aes256}},_=F.getNodeBuffer();let R,L;function N(e){let t=new Uint8Array;return b(e,(e=>{t=F.concatUint8Array([t,e]);const r=[],i=Math.floor(t.length/45),n=45*i,a=R(t.subarray(0,n));for(let e=0;e<i;e++)r.push(a.substr(60*e,60)),r.push("\n");return t=t.subarray(n),r.join("")}),(()=>t.length?R(t)+"\n":""))}function z(e){let t="";return b(e,(e=>{t+=e;let r=0;const i=[" ","\t","\r","\n"];for(let e=0;e<i.length;e++){const n=i[e];for(let e=t.indexOf(n);-1!==e;e=t.indexOf(n,e+1))r++}let n=t.length;for(;n>0&&(n-r)%4!=0;n--)i.includes(t[n])&&r--;const a=L(t.substr(0,n));return t=t.substr(n),a}),(()=>L(t)))}function O(e){return z(e.replace(/-/g,"+").replace(/_/g,"/"))}function j(e,t){let r=N(e).replace(/[\r\n]/g,"");return r=r.replace(/[+]/g,"-").replace(/[/]/g,"_").replace(/[=]/g,""),r}function q(e){const t=e.match(/^-----BEGIN PGP (MESSAGE, PART \d+\/\d+|MESSAGE, PART \d+|SIGNED MESSAGE|MESSAGE|PUBLIC KEY BLOCK|PRIVATE KEY BLOCK|SIGNATURE)-----$/m);if(!t)throw Error("Unknown ASCII armor type");return/MESSAGE, PART \d+\/\d+/.test(t[1])?B.armor.multipartSection:/MESSAGE, PART \d+/.test(t[1])?B.armor.multipartLast:/SIGNED MESSAGE/.test(t[1])?B.armor.signed:/MESSAGE/.test(t[1])?B.armor.message:/PUBLIC KEY BLOCK/.test(t[1])?B.armor.publicKey:/PRIVATE KEY BLOCK/.test(t[1])?B.armor.privateKey:/SIGNATURE/.test(t[1])?B.armor.signature:void 0}function H(e,t){let r="";return t.showVersion&&(r+="Version: "+t.versionString+"\n"),t.showComment&&(r+="Comment: "+t.commentString+"\n"),e&&(r+="Comment: "+e+"\n"),r+="\n",r}function G(e){const t=function(e){let t=13501623;return b(e,(e=>{const r=W?Math.floor(e.length/4):0,i=new Uint32Array(e.buffer,e.byteOffset,r);for(let e=0;e<r;e++)t^=i[e],t=V[0][t>>24&255]^V[1][t>>16&255]^V[2][t>>8&255]^V[3][255&t];for(let i=4*r;i<e.length;i++)t=t>>8^V[0][255&t^e[i]]}),(()=>new Uint8Array([t,t>>8,t>>16])))}(e);return N(t)}_?(R=e=>_.from(e).toString("base64"),L=e=>{const t=_.from(e,"base64");return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}):(R=e=>btoa(F.uint8ArrayToString(e)),L=e=>F.stringToUint8Array(atob(e)));const V=[Array(255),Array(255),Array(255),Array(255)];for(let e=0;e<=255;e++){let t=e<<16;for(let e=0;e<8;e++)t=t<<1^(8388608&t?8801531:0);V[0][e]=(16711680&t)>>16|65280&t|(255&t)<<16}for(let e=0;e<=255;e++)V[1][e]=V[0][e]>>8^V[0][255&V[0][e]];for(let e=0;e<=255;e++)V[2][e]=V[1][e]>>8^V[0][255&V[1][e]];for(let e=0;e<=255;e++)V[3][e]=V[2][e]>>8^V[0][255&V[2][e]];const W=function(){const e=new ArrayBuffer(2);return new DataView(e).setInt16(0,255,!0),255===new Int16Array(e)[0]}();function $(e){for(let t=0;t<e.length;t++)/^([^\s:]|[^\s:][^:]*[^\s:]): .+$/.test(e[t])||F.printDebugError(Error("Improperly formatted armor header: "+e[t])),/^(Version|Comment|MessageID|Hash|Charset): .+$/.test(e[t])||F.printDebugError(Error("Unknown header: "+e[t]))}function Z(e){let t=e;const r=e.lastIndexOf("=");return r>=0&&r!==e.length-1&&(t=e.slice(0,r)),t}function X(e){return new Promise((async(t,r)=>{try{const i=/^-----[^-]+-----$/m,n=/^[ \f\r\t\u00a0\u2000-\u200a\u202f\u205f\u3000]*$/;let a;const s=[];let o,c,u=s,h=[];const l=z(k(e,(async(e,y)=>{const p=x(e);try{for(;;){let e=await p.readLine();if(void 0===e)throw Error("Misformed armored text");if(e=F.removeTrailingSpaces(e.replace(/[\r\n]/g,"")),a)if(o)c||a!==B.armor.signed||(i.test(e)?(h=h.join("\r\n"),c=!0,$(u),u=[],o=!1):h.push(e.replace(/^- /,"")));else if(i.test(e)&&r(Error("Mandatory blank line missing between armor headers and armor data")),n.test(e)){if($(u),o=!0,c||a!==B.armor.signed){t({text:h,data:l,headers:s,type:a});break}}else u.push(e);else i.test(e)&&(a=q(e))}}catch(e){return void r(e)}const d=I(y);try{for(;;){await d.ready;const{done:e,value:t}=await p.read();if(e)throw Error("Misformed armored text");const r=t+"";if(-1!==r.indexOf("=")||-1!==r.indexOf("-")){let e=await p.readToEnd();e.length||(e=""),e=r+e,e=F.removeTrailingSpaces(e.replace(/\r/g,""));const t=e.split(i);if(1===t.length)throw Error("Misformed armored text");const n=Z(t[0].slice(0,-1));await d.write(n);break}await d.write(r)}await d.ready,await d.close()}catch(e){await d.abort(e)}})))}catch(e){r(e)}})).then((async e=>(a(e.data)&&(e.data=await P(e.data)),e)))}function Q(e,t,r,i,n,a=!1,s=T){let o,c;e===B.armor.signed&&(o=t.text,c=t.hash,t=t.data);const u=a&&A(t),h=[];switch(e){case B.armor.multipartSection:h.push("-----BEGIN PGP MESSAGE, PART "+r+"/"+i+"-----\n"),h.push(H(n,s)),h.push(N(t)),u&&h.push("=",G(u)),h.push("-----END PGP MESSAGE, PART "+r+"/"+i+"-----\n");break;case B.armor.multipartLast:h.push("-----BEGIN PGP MESSAGE, PART "+r+"-----\n"),h.push(H(n,s)),h.push(N(t)),u&&h.push("=",G(u)),h.push("-----END PGP MESSAGE, PART "+r+"-----\n");break;case B.armor.signed:h.push("-----BEGIN PGP SIGNED MESSAGE-----\n"),h.push(c?`Hash: ${c}\n\n`:"\n"),h.push(o.replace(/^-/gm,"- -")),h.push("\n-----BEGIN PGP SIGNATURE-----\n"),h.push(H(n,s)),h.push(N(t)),u&&h.push("=",G(u)),h.push("-----END PGP SIGNATURE-----\n");break;case B.armor.message:h.push("-----BEGIN PGP MESSAGE-----\n"),h.push(H(n,s)),h.push(N(t)),u&&h.push("=",G(u)),h.push("-----END PGP MESSAGE-----\n");break;case B.armor.publicKey:h.push("-----BEGIN PGP PUBLIC KEY BLOCK-----\n"),h.push(H(n,s)),h.push(N(t)),u&&h.push("=",G(u)),h.push("-----END PGP PUBLIC KEY BLOCK-----\n");break;case B.armor.privateKey:h.push("-----BEGIN PGP PRIVATE KEY BLOCK-----\n"),h.push(H(n,s)),h.push(N(t)),u&&h.push("=",G(u)),h.push("-----END PGP PRIVATE KEY BLOCK-----\n");break;case B.armor.signature:h.push("-----BEGIN PGP SIGNATURE-----\n"),h.push(H(n,s)),h.push(N(t)),u&&h.push("=",G(u)),h.push("-----END PGP SIGNATURE-----\n")}return F.concat(h)}const Y=BigInt(0),J=BigInt(1);function ee(e){const t="0123456789ABCDEF";let r="";return e.forEach((e=>{r+=t[e>>4]+t[15&e]})),BigInt("0x0"+r)}function te(e,t){const r=e%t;return r<Y?r+t:r}function re(e,t,r){if(r===Y)throw Error("Modulo cannot be zero");if(r===J)return BigInt(0);if(t<Y)throw Error("Unsopported negative exponent");let i=t,n=e;n%=r;let a=BigInt(1);for(;i>Y;){const e=i&J;i>>=J;a=e?a*n%r:a,n=n*n%r}return a}function ie(e){return e>=Y?e:-e}function ne(e,t){const{gcd:r,x:i}=function(e,t){let r=BigInt(0),i=BigInt(1),n=BigInt(1),a=BigInt(0),s=ie(e),o=ie(t);const c=e<Y,u=t<Y;for(;o!==Y;){const e=s/o;let t=r;r=n-e*r,n=t,t=i,i=a-e*i,a=t,t=o,o=s%o,s=t}return{x:c?-n:n,y:u?-a:a,gcd:s}}(e,t);if(r!==J)throw Error("Inverse does not exist");return te(i+t,t)}function ae(e){const t=Number(e);if(t>Number.MAX_SAFE_INTEGER)throw Error("Number can only safely store up to 53 bits");return t}function se(e,t){return(e>>BigInt(t)&J)===Y?0:1}function oe(e){const t=e<Y?BigInt(-1):Y;let r=1,i=e;for(;(i>>=J)!==t;)r++;return r}function ce(e){const t=e<Y?BigInt(-1):Y,r=BigInt(8);let i=1,n=e;for(;(n>>=r)!==t;)i++;return i}function ue(e,t="be",r){let i=e.toString(16);i.length%2==1&&(i="0"+i);const n=i.length/2,a=new Uint8Array(r||n),s=r?r-n:0;let o=0;for(;o<n;)a[o+s]=parseInt(i.slice(2*o,2*o+2),16),o++;return"be"!==t&&a.reverse(),a}const he=F.getNodeCrypto();function le(e){const t="undefined"!=typeof crypto?crypto:he?.webcrypto;if(t?.getRandomValues){const r=new Uint8Array(e);return t.getRandomValues(r)}throw Error("No secure random number generator available.")}function ye(e,t){if(t<e)throw Error("Illegal parameter value: max <= min");const r=t-e;return te(ee(le(ce(r)+8)),r)+e}const pe=BigInt(1);function de(e,t,r){const i=BigInt(30),n=pe<<BigInt(e-1),a=[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 s=ye(n,n<<pe),o=ae(te(s,i));do{s+=BigInt(a[o]),o=(o+a[o])%a.length,oe(s)>e&&(s=te(s,n<<pe),s+=n,o=ae(te(s,i)))}while(!ge(s,t,r));return s}function ge(e,t,r){return(!t||function(e,t){let r=e,i=t;for(;i!==Y;){const e=i;i=r%i,r=e}return r}(e-pe,t)===pe)&&(!!function(e){const t=BigInt(0);return fe.every((r=>te(e,r)!==t))}(e)&&(!!function(e,t=BigInt(2)){return re(t,e-pe,e)===pe}(e)&&!!function(e,t){const r=oe(e);t||(t=Math.max(1,r/48|0));const i=e-pe;let n=0;for(;!se(i,n);)n++;const a=e>>BigInt(n);for(;t>0;t--){let t,r=re(ye(BigInt(2),i),a,e);if(r!==pe&&r!==i){for(t=1;t<n;t++){if(r=te(r*r,e),r===pe)return!1;if(r===i)break}if(t===n)return!1}}return!0}(e,r)))}const fe=[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((e=>BigInt(e)));const me=F.getWebCrypto(),we=F.getNodeCrypto(),be=we&&we.getHashes();function ke(e){if(we&&be.includes(e))return async function(t){const r=we.createHash(e);return b(t,(e=>{r.update(e)}),(()=>new Uint8Array(r.digest())))}}function ve(e,t){const r=async()=>{const{nobleHashes:t}=await import("./noble_hashes.min.mjs"),r=t.get(e);if(!r)throw Error("Unsupported hash");return r};return async function(e){if(a(e)&&(e=await P(e)),F.isStream(e)){const t=(await r()).create();return b(e,(e=>{t.update(e)}),(()=>t.digest()))}if(me&&t)return new Uint8Array(await me.digest(t,e));return(await r())(e)}}const Ke=ke("md5")||ve("md5"),Ae=ke("sha1")||ve("sha1","SHA-1"),Ee=ke("sha224")||ve("sha224"),Se=ke("sha256")||ve("sha256","SHA-256"),Pe=ke("sha384")||ve("sha384","SHA-384"),Ue=ke("sha512")||ve("sha512","SHA-512"),De=ke("ripemd160")||ve("ripemd160"),xe=ke("sha3-256")||ve("sha3_256"),Ie=ke("sha3-512")||ve("sha3_512");function Ce(e,t){switch(e){case B.hash.md5:return Ke(t);case B.hash.sha1:return Ae(t);case B.hash.ripemd:return De(t);case B.hash.sha256:return Se(t);case B.hash.sha384:return Pe(t);case B.hash.sha512:return Ue(t);case B.hash.sha224:return Ee(t);case B.hash.sha3_256:return xe(t);case B.hash.sha3_512:return Ie(t);default:throw Error("Unsupported hash function")}}function Be(e){switch(e){case B.hash.md5:return 16;case B.hash.sha1:case B.hash.ripemd:return 20;case B.hash.sha256:return 32;case B.hash.sha384:return 48;case B.hash.sha512:return 64;case B.hash.sha224:return 28;case B.hash.sha3_256:return 32;case B.hash.sha3_512:return 64;default:throw Error("Invalid hash algorithm.")}}const Te=[];function Me(e,t){const r=e.length;if(r>t-11)throw Error("Message too long");const i=function(e){const t=new Uint8Array(e);let r=0;for(;r<e;){const i=le(e-r);for(let e=0;e<i.length;e++)0!==i[e]&&(t[r++]=i[e])}return t}(t-r-3),n=new Uint8Array(t);return n[1]=2,n.set(i,2),n.set(e,t-r),n}function Fe(e,t){let r=2,i=1;for(let t=r;t<e.length;t++)i&=0!==e[t],r+=i;const n=r-2,a=e.subarray(r+1),s=0===e[0]&2===e[1]&n>=8&!i;if(t)return F.selectUint8Array(s,a,t);if(s)return a;throw Error("Decryption error")}function _e(e,t,r){let i;if(t.length!==Be(e))throw Error("Invalid hash length");const n=new Uint8Array(Te[e].length);for(i=0;i<Te[e].length;i++)n[i]=Te[e][i];const a=n.length+t.length;if(r<a+11)throw Error("Intended encoded message length too short");const s=new Uint8Array(r-a-3).fill(255),o=new Uint8Array(r);return o[1]=1,o.set(s,2),o.set(n,r-a),o.set(t,r-t.length),o}Te[1]=[48,32,48,12,6,8,42,134,72,134,247,13,2,5,5,0,4,16],Te[2]=[48,33,48,9,6,5,43,14,3,2,26,5,0,4,20],Te[3]=[48,33,48,9,6,5,43,36,3,2,1,5,0,4,20],Te[8]=[48,49,48,13,6,9,96,134,72,1,101,3,4,2,1,5,0,4,32],Te[9]=[48,65,48,13,6,9,96,134,72,1,101,3,4,2,2,5,0,4,48],Te[10]=[48,81,48,13,6,9,96,134,72,1,101,3,4,2,3,5,0,4,64],Te[11]=[48,45,48,13,6,9,96,134,72,1,101,3,4,2,4,5,0,4,28];const Re=F.getWebCrypto(),Le=F.getNodeCrypto(),Ne=BigInt(1);async function ze(e,t,r,i,n,a,s,o,c){if(Be(e)>=r.length)throw Error("Digest size cannot exceed key modulus size");if(t&&!F.isStream(t))if(F.getWebCrypto())try{return await async function(e,t,r,i,n,a,s,o){const c=await He(r,i,n,a,s,o),u={name:"RSASSA-PKCS1-v1_5",hash:{name:e}},h=await Re.importKey("jwk",c,u,!1,["sign"]);return new Uint8Array(await Re.sign("RSASSA-PKCS1-v1_5",h,t))}(B.read(B.webHash,e),t,r,i,n,a,s,o)}catch(e){F.printDebugError(e)}else if(F.getNodeCrypto())return async function(e,t,r,i,n,a,s,o){const c=Le.createSign(B.read(B.hash,e));c.write(t),c.end();const u=await He(r,i,n,a,s,o);return new Uint8Array(c.sign({key:u,format:"jwk",type:"pkcs1"}))}(e,t,r,i,n,a,s,o);return async function(e,t,r,i){t=ee(t);const n=ee(_e(e,i,ce(t)));return r=ee(r),ue(re(n,r,t),"be",ce(t))}(e,r,n,c)}async function Oe(e,t,r,i,n,a){if(t&&!F.isStream(t))if(F.getWebCrypto())try{return await async function(e,t,r,i,n){const a=Ge(i,n),s=await Re.importKey("jwk",a,{name:"RSASSA-PKCS1-v1_5",hash:{name:e}},!1,["verify"]);return Re.verify("RSASSA-PKCS1-v1_5",s,r,t)}(B.read(B.webHash,e),t,r,i,n)}catch(e){F.printDebugError(e)}else if(F.getNodeCrypto())return async function(e,t,r,i,n){const a=Ge(i,n),s={key:a,format:"jwk",type:"pkcs1"},o=Le.createVerify(B.read(B.hash,e));o.write(t),o.end();try{return o.verify(s,r)}catch(e){return!1}}(e,t,r,i,n);return async function(e,t,r,i,n){if(r=ee(r),t=ee(t),i=ee(i),t>=r)throw Error("Signature size cannot exceed modulus size");const a=ue(re(t,i,r),"be",ce(r)),s=_e(e,n,ce(r));return F.equalsUint8Array(a,s)}(e,r,i,n,a)}async function je(e,t,r){return F.getNodeCrypto()?async function(e,t,r){const i=Ge(t,r),n={key:i,format:"jwk",type:"pkcs1",padding:Le.constants.RSA_PKCS1_PADDING};return new Uint8Array(Le.publicEncrypt(n,e))}(e,t,r):async function(e,t,r){if(t=ee(t),e=ee(Me(e,ce(t))),r=ee(r),e>=t)throw Error("Message size cannot exceed modulus size");return ue(re(e,r,t),"be",ce(t))}(e,t,r)}async function qe(e,t,r,i,n,a,s,o){if(F.getNodeCrypto()&&!o)try{return await async function(e,t,r,i,n,a,s){const o=await He(t,r,i,n,a,s),c={key:o,format:"jwk",type:"pkcs1",padding:Le.constants.RSA_PKCS1_PADDING};try{return new Uint8Array(Le.privateDecrypt(c,e))}catch(e){throw Error("Decryption error")}}(e,t,r,i,n,a,s)}catch(e){F.printDebugError(e)}return async function(e,t,r,i,n,a,s,o){if(e=ee(e),t=ee(t),r=ee(r),i=ee(i),n=ee(n),a=ee(a),s=ee(s),e>=t)throw Error("Data too large.");const c=te(i,a-Ne),u=te(i,n-Ne),h=ye(BigInt(2),t),l=re(ne(h,t),r,t);e=te(e*l,t);const y=re(e,u,n),p=re(e,c,a),d=te(s*(p-y),a);let g=d*n+y;return g=te(g*h,t),Fe(ue(g,"be",ce(t)),o)}(e,t,r,i,n,a,s,o)}async function He(e,t,r,i,n,a){const s=ee(i),o=ee(n),c=ee(r);let u=te(c,o-Ne),h=te(c,s-Ne);return h=ue(h),u=ue(u),{kty:"RSA",n:j(e),e:j(t),d:j(r),p:j(n),q:j(i),dp:j(u),dq:j(h),qi:j(a),ext:!0}}function Ge(e,t){return{kty:"RSA",n:j(e),e:j(t),ext:!0}}function Ve(e,t){return{n:O(e.n),e:ue(t),d:O(e.d),p:O(e.q),q:O(e.p),u:O(e.qi)}}const We=BigInt(1);const $e="object"==typeof e&&"crypto"in e?e.crypto:void 0,Ze={};var Xe=function(e){var t,r=new Float64Array(16);if(e)for(t=0;t<e.length;t++)r[t]=e[t];return r},Qe=function(){throw Error("no PRNG")},Ye=new Uint8Array(32);Ye[0]=9;var Je=Xe(),et=Xe([1]),tt=Xe([56129,1]),rt=Xe([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),it=Xe([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),nt=Xe([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),at=Xe([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),st=Xe([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function ot(e,t,r,i){e[t]=r>>24&255,e[t+1]=r>>16&255,e[t+2]=r>>8&255,e[t+3]=255&r,e[t+4]=i>>24&255,e[t+5]=i>>16&255,e[t+6]=i>>8&255,e[t+7]=255&i}function ct(e,t,r,i){return function(e,t,r,i,n){var a,s=0;for(a=0;a<n;a++)s|=e[t+a]^r[i+a];return(1&s-1>>>8)-1}(e,t,r,i,32)}function ut(e,t){var r;for(r=0;r<16;r++)e[r]=0|t[r]}function ht(e){var t,r,i=1;for(t=0;t<16;t++)r=e[t]+i+65535,i=Math.floor(r/65536),e[t]=r-65536*i;e[0]+=i-1+37*(i-1)}function lt(e,t,r){for(var i,n=~(r-1),a=0;a<16;a++)i=n&(e[a]^t[a]),e[a]^=i,t[a]^=i}function yt(e,t){var r,i,n,a=Xe(),s=Xe();for(r=0;r<16;r++)s[r]=t[r];for(ht(s),ht(s),ht(s),i=0;i<2;i++){for(a[0]=s[0]-65517,r=1;r<15;r++)a[r]=s[r]-65535-(a[r-1]>>16&1),a[r-1]&=65535;a[15]=s[15]-32767-(a[14]>>16&1),n=a[15]>>16&1,a[14]&=65535,lt(s,a,1-n)}for(r=0;r<16;r++)e[2*r]=255&s[r],e[2*r+1]=s[r]>>8}function pt(e,t){var r=new Uint8Array(32),i=new Uint8Array(32);return yt(r,e),yt(i,t),ct(r,0,i,0)}function dt(e){var t=new Uint8Array(32);return yt(t,e),1&t[0]}function gt(e,t){var r;for(r=0;r<16;r++)e[r]=t[2*r]+(t[2*r+1]<<8);e[15]&=32767}function ft(e,t,r){for(var i=0;i<16;i++)e[i]=t[i]+r[i]}function mt(e,t,r){for(var i=0;i<16;i++)e[i]=t[i]-r[i]}function wt(e,t,r){var i,n,a=0,s=0,o=0,c=0,u=0,h=0,l=0,y=0,p=0,d=0,g=0,f=0,m=0,w=0,b=0,k=0,v=0,K=0,A=0,E=0,S=0,P=0,U=0,D=0,x=0,I=0,C=0,B=0,T=0,M=0,F=0,_=r[0],R=r[1],L=r[2],N=r[3],z=r[4],O=r[5],j=r[6],q=r[7],H=r[8],G=r[9],V=r[10],W=r[11],$=r[12],Z=r[13],X=r[14],Q=r[15];a+=(i=t[0])*_,s+=i*R,o+=i*L,c+=i*N,u+=i*z,h+=i*O,l+=i*j,y+=i*q,p+=i*H,d+=i*G,g+=i*V,f+=i*W,m+=i*$,w+=i*Z,b+=i*X,k+=i*Q,s+=(i=t[1])*_,o+=i*R,c+=i*L,u+=i*N,h+=i*z,l+=i*O,y+=i*j,p+=i*q,d+=i*H,g+=i*G,f+=i*V,m+=i*W,w+=i*$,b+=i*Z,k+=i*X,v+=i*Q,o+=(i=t[2])*_,c+=i*R,u+=i*L,h+=i*N,l+=i*z,y+=i*O,p+=i*j,d+=i*q,g+=i*H,f+=i*G,m+=i*V,w+=i*W,b+=i*$,k+=i*Z,v+=i*X,K+=i*Q,c+=(i=t[3])*_,u+=i*R,h+=i*L,l+=i*N,y+=i*z,p+=i*O,d+=i*j,g+=i*q,f+=i*H,m+=i*G,w+=i*V,b+=i*W,k+=i*$,v+=i*Z,K+=i*X,A+=i*Q,u+=(i=t[4])*_,h+=i*R,l+=i*L,y+=i*N,p+=i*z,d+=i*O,g+=i*j,f+=i*q,m+=i*H,w+=i*G,b+=i*V,k+=i*W,v+=i*$,K+=i*Z,A+=i*X,E+=i*Q,h+=(i=t[5])*_,l+=i*R,y+=i*L,p+=i*N,d+=i*z,g+=i*O,f+=i*j,m+=i*q,w+=i*H,b+=i*G,k+=i*V,v+=i*W,K+=i*$,A+=i*Z,E+=i*X,S+=i*Q,l+=(i=t[6])*_,y+=i*R,p+=i*L,d+=i*N,g+=i*z,f+=i*O,m+=i*j,w+=i*q,b+=i*H,k+=i*G,v+=i*V,K+=i*W,A+=i*$,E+=i*Z,S+=i*X,P+=i*Q,y+=(i=t[7])*_,p+=i*R,d+=i*L,g+=i*N,f+=i*z,m+=i*O,w+=i*j,b+=i*q,k+=i*H,v+=i*G,K+=i*V,A+=i*W,E+=i*$,S+=i*Z,P+=i*X,U+=i*Q,p+=(i=t[8])*_,d+=i*R,g+=i*L,f+=i*N,m+=i*z,w+=i*O,b+=i*j,k+=i*q,v+=i*H,K+=i*G,A+=i*V,E+=i*W,S+=i*$,P+=i*Z,U+=i*X,D+=i*Q,d+=(i=t[9])*_,g+=i*R,f+=i*L,m+=i*N,w+=i*z,b+=i*O,k+=i*j,v+=i*q,K+=i*H,A+=i*G,E+=i*V,S+=i*W,P+=i*$,U+=i*Z,D+=i*X,x+=i*Q,g+=(i=t[10])*_,f+=i*R,m+=i*L,w+=i*N,b+=i*z,k+=i*O,v+=i*j,K+=i*q,A+=i*H,E+=i*G,S+=i*V,P+=i*W,U+=i*$,D+=i*Z,x+=i*X,I+=i*Q,f+=(i=t[11])*_,m+=i*R,w+=i*L,b+=i*N,k+=i*z,v+=i*O,K+=i*j,A+=i*q,E+=i*H,S+=i*G,P+=i*V,U+=i*W,D+=i*$,x+=i*Z,I+=i*X,C+=i*Q,m+=(i=t[12])*_,w+=i*R,b+=i*L,k+=i*N,v+=i*z,K+=i*O,A+=i*j,E+=i*q,S+=i*H,P+=i*G,U+=i*V,D+=i*W,x+=i*$,I+=i*Z,C+=i*X,B+=i*Q,w+=(i=t[13])*_,b+=i*R,k+=i*L,v+=i*N,K+=i*z,A+=i*O,E+=i*j,S+=i*q,P+=i*H,U+=i*G,D+=i*V,x+=i*W,I+=i*$,C+=i*Z,B+=i*X,T+=i*Q,b+=(i=t[14])*_,k+=i*R,v+=i*L,K+=i*N,A+=i*z,E+=i*O,S+=i*j,P+=i*q,U+=i*H,D+=i*G,x+=i*V,I+=i*W,C+=i*$,B+=i*Z,T+=i*X,M+=i*Q,k+=(i=t[15])*_,s+=38*(K+=i*L),o+=38*(A+=i*N),c+=38*(E+=i*z),u+=38*(S+=i*O),h+=38*(P+=i*j),l+=38*(U+=i*q),y+=38*(D+=i*H),p+=38*(x+=i*G),d+=38*(I+=i*V),g+=38*(C+=i*W),f+=38*(B+=i*$),m+=38*(T+=i*Z),w+=38*(M+=i*X),b+=38*(F+=i*Q),a=(i=(a+=38*(v+=i*R))+(n=1)+65535)-65536*(n=Math.floor(i/65536)),s=(i=s+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)),u=(i=u+n+65535)-65536*(n=Math.floor(i/65536)),h=(i=h+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)),p=(i=p+n+65535)-65536*(n=Math.floor(i/65536)),d=(i=d+n+65535)-65536*(n=Math.floor(i/65536)),g=(i=g+n+65535)-65536*(n=Math.floor(i/65536)),f=(i=f+n+65535)-65536*(n=Math.floor(i/65536)),m=(i=m+n+65535)-65536*(n=Math.floor(i/65536)),w=(i=w+n+65535)-65536*(n=Math.floor(i/65536)),b=(i=b+n+65535)-65536*(n=Math.floor(i/65536)),k=(i=k+n+65535)-65536*(n=Math.floor(i/65536)),a=(i=(a+=n-1+37*(n-1))+(n=1)+65535)-65536*(n=Math.floor(i/65536)),s=(i=s+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)),u=(i=u+n+65535)-65536*(n=Math.floor(i/65536)),h=(i=h+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)),p=(i=p+n+65535)-65536*(n=Math.floor(i/65536)),d=(i=d+n+65535)-65536*(n=Math.floor(i/65536)),g=(i=g+n+65535)-65536*(n=Math.floor(i/65536)),f=(i=f+n+65535)-65536*(n=Math.floor(i/65536)),m=(i=m+n+65535)-65536*(n=Math.floor(i/65536)),w=(i=w+n+65535)-65536*(n=Math.floor(i/65536)),b=(i=b+n+65535)-65536*(n=Math.floor(i/65536)),k=(i=k+n+65535)-65536*(n=Math.floor(i/65536)),a+=n-1+37*(n-1),e[0]=a,e[1]=s,e[2]=o,e[3]=c,e[4]=u,e[5]=h,e[6]=l,e[7]=y,e[8]=p,e[9]=d,e[10]=g,e[11]=f,e[12]=m,e[13]=w,e[14]=b,e[15]=k}function bt(e,t){wt(e,t,t)}function kt(e,t){var r,i=Xe();for(r=0;r<16;r++)i[r]=t[r];for(r=253;r>=0;r--)bt(i,i),2!==r&&4!==r&&wt(i,i,t);for(r=0;r<16;r++)e[r]=i[r]}function vt(e,t,r){var i,n,a=new Uint8Array(32),s=new Float64Array(80),o=Xe(),c=Xe(),u=Xe(),h=Xe(),l=Xe(),y=Xe();for(n=0;n<31;n++)a[n]=t[n];for(a[31]=127&t[31]|64,a[0]&=248,gt(s,r),n=0;n<16;n++)c[n]=s[n],h[n]=o[n]=u[n]=0;for(o[0]=h[0]=1,n=254;n>=0;--n)lt(o,c,i=a[n>>>3]>>>(7&n)&1),lt(u,h,i),ft(l,o,u),mt(o,o,u),ft(u,c,h),mt(c,c,h),bt(h,l),bt(y,o),wt(o,u,o),wt(u,c,l),ft(l,o,u),mt(o,o,u),bt(c,o),mt(u,h,y),wt(o,u,tt),ft(o,o,h),wt(u,u,o),wt(o,h,y),wt(h,c,s),bt(c,l),lt(o,c,i),lt(u,h,i);for(n=0;n<16;n++)s[n+16]=o[n],s[n+32]=u[n],s[n+48]=c[n],s[n+64]=h[n];var p=s.subarray(32),d=s.subarray(16);return kt(p,p),wt(d,d,p),yt(e,d),0}function Kt(e,t){return vt(e,t,Ye)}var At=[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 Et(e,t,r,i){for(var n,a,s,o,c,u,h,l,y,p,d,g,f,m,w,b,k,v,K,A,E,S,P,U,D,x,I=new Int32Array(16),C=new Int32Array(16),B=e[0],T=e[1],M=e[2],F=e[3],_=e[4],R=e[5],L=e[6],N=e[7],z=t[0],O=t[1],j=t[2],q=t[3],H=t[4],G=t[5],V=t[6],W=t[7],$=0;i>=128;){for(K=0;K<16;K++)A=8*K+$,I[K]=r[A+0]<<24|r[A+1]<<16|r[A+2]<<8|r[A+3],C[K]=r[A+4]<<24|r[A+5]<<16|r[A+6]<<8|r[A+7];for(K=0;K<80;K++)if(n=B,a=T,s=M,o=F,c=_,u=R,h=L,N,y=z,p=O,d=j,g=q,f=H,m=G,w=V,W,P=65535&(S=W),U=S>>>16,D=65535&(E=N),x=E>>>16,P+=65535&(S=(H>>>14|_<<18)^(H>>>18|_<<14)^(_>>>9|H<<23)),U+=S>>>16,D+=65535&(E=(_>>>14|H<<18)^(_>>>18|H<<14)^(H>>>9|_<<23)),x+=E>>>16,P+=65535&(S=H&G^~H&V),U+=S>>>16,D+=65535&(E=_&R^~_&L),x+=E>>>16,E=At[2*K],P+=65535&(S=At[2*K+1]),U+=S>>>16,D+=65535&E,x+=E>>>16,E=I[K%16],U+=(S=C[K%16])>>>16,D+=65535&E,x+=E>>>16,D+=(U+=(P+=65535&S)>>>16)>>>16,P=65535&(S=v=65535&P|U<<16),U=S>>>16,D=65535&(E=k=65535&D|(x+=D>>>16)<<16),x=E>>>16,P+=65535&(S=(z>>>28|B<<4)^(B>>>2|z<<30)^(B>>>7|z<<25)),U+=S>>>16,D+=65535&(E=(B>>>28|z<<4)^(z>>>2|B<<30)^(z>>>7|B<<25)),x+=E>>>16,U+=(S=z&O^z&j^O&j)>>>16,D+=65535&(E=B&T^B&M^T&M),x+=E>>>16,l=65535&(D+=(U+=(P+=65535&S)>>>16)>>>16)|(x+=D>>>16)<<16,b=65535&P|U<<16,P=65535&(S=g),U=S>>>16,D=65535&(E=o),x=E>>>16,U+=(S=v)>>>16,D+=65535&(E=k),x+=E>>>16,T=n,M=a,F=s,_=o=65535&(D+=(U+=(P+=65535&S)>>>16)>>>16)|(x+=D>>>16)<<16,R=c,L=u,N=h,B=l,O=y,j=p,q=d,H=g=65535&P|U<<16,G=f,V=m,W=w,z=b,K%16==15)for(A=0;A<16;A++)E=I[A],P=65535&(S=C[A]),U=S>>>16,D=65535&E,x=E>>>16,E=I[(A+9)%16],P+=65535&(S=C[(A+9)%16]),U+=S>>>16,D+=65535&E,x+=E>>>16,k=I[(A+1)%16],P+=65535&(S=((v=C[(A+1)%16])>>>1|k<<31)^(v>>>8|k<<24)^(v>>>7|k<<25)),U+=S>>>16,D+=65535&(E=(k>>>1|v<<31)^(k>>>8|v<<24)^k>>>7),x+=E>>>16,k=I[(A+14)%16],U+=(S=((v=C[(A+14)%16])>>>19|k<<13)^(k>>>29|v<<3)^(v>>>6|k<<26))>>>16,D+=65535&(E=(k>>>19|v<<13)^(v>>>29|k<<3)^k>>>6),x+=E>>>16,x+=(D+=(U+=(P+=65535&S)>>>16)>>>16)>>>16,I[A]=65535&D|x<<16,C[A]=65535&P|U<<16;P=65535&(S=z),U=S>>>16,D=65535&(E=B),x=E>>>16,E=e[0],U+=(S=t[0])>>>16,D+=65535&E,x+=E>>>16,x+=(D+=(U+=(P+=65535&S)>>>16)>>>16)>>>16,e[0]=B=65535&D|x<<16,t[0]=z=65535&P|U<<16,P=65535&(S=O),U=S>>>16,D=65535&(E=T),x=E>>>16,E=e[1],U+=(S=t[1])>>>16,D+=65535&E,x+=E>>>16,x+=(D+=(U+=(P+=65535&S)>>>16)>>>16)>>>16,e[1]=T=65535&D|x<<16,t[1]=O=65535&P|U<<16,P=65535&(S=j),U=S>>>16,D=65535&(E=M),x=E>>>16,E=e[2],U+=(S=t[2])>>>16,D+=65535&E,x+=E>>>16,x+=(D+=(U+=(P+=65535&S)>>>16)>>>16)>>>16,e[2]=M=65535&D|x<<16,t[2]=j=65535&P|U<<16,P=65535&(S=q),U=S>>>16,D=65535&(E=F),x=E>>>16,E=e[3],U+=(S=t[3])>>>16,D+=65535&E,x+=E>>>16,x+=(D+=(U+=(P+=65535&S)>>>16)>>>16)>>>16,e[3]=F=65535&D|x<<16,t[3]=q=65535&P|U<<16,P=65535&(S=H),U=S>>>16,D=65535&(E=_),x=E>>>16,E=e[4],U+=(S=t[4])>>>16,D+=65535&E,x+=E>>>16,x+=(D+=(U+=(P+=65535&S)>>>16)>>>16)>>>16,e[4]=_=65535&D|x<<16,t[4]=H=65535&P|U<<16,P=65535&(S=G),U=S>>>16,D=65535&(E=R),x=E>>>16,E=e[5],U+=(S=t[5])>>>16,D+=65535&E,x+=E>>>16,x+=(D+=(U+=(P+=65535&S)>>>16)>>>16)>>>16,e[5]=R=65535&D|x<<16,t[5]=G=65535&P|U<<16,P=65535&(S=V),U=S>>>16,D=65535&(E=L),x=E>>>16,E=e[6],U+=(S=t[6])>>>16,D+=65535&E,x+=E>>>16,x+=(D+=(U+=(P+=65535&S)>>>16)>>>16)>>>16,e[6]=L=65535&D|x<<16,t[6]=V=65535&P|U<<16,P=65535&(S=W),U=S>>>16,D=65535&(E=N),x=E>>>16,E=e[7],U+=(S=t[7])>>>16,D+=65535&E,x+=E>>>16,x+=(D+=(U+=(P+=65535&S)>>>16)>>>16)>>>16,e[7]=N=65535&D|x<<16,t[7]=W=65535&P|U<<16,$+=128,i-=128}return i}function St(e,t,r){var i,n=new Int32Array(8),a=new Int32Array(8),s=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,a[0]=4089235720,a[1]=2227873595,a[2]=4271175723,a[3]=1595750129,a[4]=2917565137,a[5]=725511199,a[6]=4215389547,a[7]=327033209,Et(n,a,t,r),r%=128,i=0;i<r;i++)s[i]=t[o-r+i];for(s[r]=128,s[(r=256-128*(r<112?1:0))-9]=0,ot(s,r-8,o/536870912|0,o<<3),Et(n,a,s,r),i=0;i<8;i++)ot(e,8*i,n[i],a[i]);return 0}function Pt(e,t){var r=Xe(),i=Xe(),n=Xe(),a=Xe(),s=Xe(),o=Xe(),c=Xe(),u=Xe(),h=Xe();mt(r,e[1],e[0]),mt(h,t[1],t[0]),wt(r,r,h),ft(i,e[0],e[1]),ft(h,t[0],t[1]),wt(i,i,h),wt(n,e[3],t[3]),wt(n,n,it),wt(a,e[2],t[2]),ft(a,a,a),mt(s,i,r),mt(o,a,n),ft(c,a,n),ft(u,i,r),wt(e[0],s,o),wt(e[1],u,c),wt(e[2],c,o),wt(e[3],s,u)}function Ut(e,t,r){var i;for(i=0;i<4;i++)lt(e[i],t[i],r)}function Dt(e,t){var r=Xe(),i=Xe(),n=Xe();kt(n,t[2]),wt(r,t[0],n),wt(i,t[1],n),yt(e,i),e[31]^=dt(r)<<7}function xt(e,t,r){var i,n;for(ut(e[0],Je),ut(e[1],et),ut(e[2],et),ut(e[3],Je),n=255;n>=0;--n)Ut(e,t,i=r[n/8|0]>>(7&n)&1),Pt(t,e),Pt(e,e),Ut(e,t,i)}function It(e,t){var r=[Xe(),Xe(),Xe(),Xe()];ut(r[0],nt),ut(r[1],at),ut(r[2],et),wt(r[3],nt,at),xt(e,r,t)}function Ct(e,t,r){var i,n=new Uint8Array(64),a=[Xe(),Xe(),Xe(),Xe()];for(r||Qe(t,32),St(n,t,32),n[0]&=248,n[31]&=127,n[31]|=64,It(a,n),Dt(e,a),i=0;i<32;i++)t[i+32]=e[i];return 0}var Bt=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 Tt(e,t){var r,i,n,a;for(i=63;i>=32;--i){for(r=0,n=i-32,a=i-12;n<a;++n)t[n]+=r-16*t[i]*Bt[n-(i-32)],r=Math.floor((t[n]+128)/256),t[n]-=256*r;t[n]+=r,t[i]=0}for(r=0,n=0;n<32;n++)t[n]+=r-(t[31]>>4)*Bt[n],r=t[n]>>8,t[n]&=255;for(n=0;n<32;n++)t[n]-=r*Bt[n];for(i=0;i<32;i++)t[i+1]+=t[i]>>8,e[i]=255&t[i]}function Mt(e){var t,r=new Float64Array(64);for(t=0;t<64;t++)r[t