From 25aef1a4bfca2d87461e8e933b198a5d45640303 Mon Sep 17 00:00:00 2001 From: dajiaji Date: Fri, 8 Sep 2023 14:18:09 +0000 Subject: [PATCH] deploy: 584f4273825ea2f80dfdf2d2fb60ca793358cf6c --- chacha20poly1305/docs/assets/main.js | 7 +- chacha20poly1305/docs/assets/navigation.js | 1 + chacha20poly1305/docs/assets/search.js | 2 +- chacha20poly1305/docs/assets/style.css | 10 +- .../docs/classes/Chacha20Poly1305.html | 46 ++--- chacha20poly1305/docs/index.html | 24 +-- chacha20poly1305/docs/modules.html | 26 +-- core/docs/assets/main.js | 7 +- core/docs/assets/navigation.js | 1 + core/docs/assets/search.js | 2 +- core/docs/assets/style.css | 10 +- core/docs/classes/Aes128Gcm.html | 111 +++++------ core/docs/classes/Aes256Gcm.html | 111 +++++------ core/docs/classes/BaseError.html | 98 ++++------ core/docs/classes/CipherSuite.html | 149 +++++++-------- core/docs/classes/DecapError.html | 98 ++++------ core/docs/classes/DeriveKeyPairError.html | 98 ++++------ core/docs/classes/DeserializeError.html | 98 ++++------ core/docs/classes/DhkemP256HkdfSha256.html | 132 ++++++------- core/docs/classes/DhkemP384HkdfSha384.html | 132 ++++++------- core/docs/classes/DhkemP521HkdfSha512.html | 132 ++++++------- core/docs/classes/EncapError.html | 98 ++++------ core/docs/classes/ExportError.html | 98 ++++------ core/docs/classes/ExportOnly.html | 111 +++++------ core/docs/classes/HkdfSha256.html | 130 ++++++------- core/docs/classes/HkdfSha384.html | 130 ++++++------- core/docs/classes/HkdfSha512.html | 130 ++++++------- core/docs/classes/HpkeError.html | 98 ++++------ core/docs/classes/InvalidParamError.html | 98 ++++------ .../classes/MessageLimitReachedError.html | 98 ++++------ core/docs/classes/NotSupportedError.html | 98 ++++------ core/docs/classes/OpenError.html | 98 ++++------ core/docs/classes/SealError.html | 98 ++++------ core/docs/classes/SerializeError.html | 98 ++++------ core/docs/classes/ValidationError.html | 98 ++++------ core/docs/index.html | 86 ++++----- .../interfaces/AeadEncryptionContext.html | 116 +++++------- core/docs/interfaces/AeadInterface.html | 109 +++++------ core/docs/interfaces/CipherSuiteParams.html | 100 ++++------ .../interfaces/CipherSuiteSealResponse.html | 98 ++++------ core/docs/interfaces/EncryptionContext.html | 118 +++++------- core/docs/interfaces/KdfInterface.html | 179 +++++++++--------- core/docs/interfaces/KemInterface.html | 154 +++++++-------- core/docs/interfaces/PreSharedKey.html | 98 ++++------ .../interfaces/RecipientContextParams.html | 104 ++++------ core/docs/interfaces/SenderContext.html | 122 ++++++------ core/docs/interfaces/SenderContextParams.html | 104 ++++------ core/docs/modules.html | 94 ++++----- core/docs/types/AeadId.html | 90 ++++----- core/docs/types/KdfId.html | 90 ++++----- core/docs/types/KemId.html | 90 ++++----- core/docs/types/RecipientContext.html | 88 ++++----- core/docs/variables/AeadId-1.html | 90 ++++----- core/docs/variables/KdfId-1.html | 90 ++++----- core/docs/variables/KemId-1.html | 90 ++++----- dhkem-secp256k1/docs/assets/main.js | 7 +- dhkem-secp256k1/docs/assets/navigation.js | 1 + dhkem-secp256k1/docs/assets/search.js | 2 +- dhkem-secp256k1/docs/assets/style.css | 10 +- .../classes/DhkemSecp256k1HkdfSha256.html | 70 +++---- dhkem-secp256k1/docs/index.html | 24 +-- dhkem-secp256k1/docs/modules.html | 26 +-- dhkem-secp256k1/src/hpke-dhkem-secp256k1.js | 5 +- dhkem-x25519/docs/assets/main.js | 7 +- dhkem-x25519/docs/assets/navigation.js | 1 + dhkem-x25519/docs/assets/search.js | 2 +- dhkem-x25519/docs/assets/style.css | 10 +- .../docs/classes/DhkemX25519HkdfSha256.html | 70 +++---- dhkem-x25519/docs/index.html | 24 +-- dhkem-x25519/docs/modules.html | 26 +-- dhkem-x25519/src/hpke-dhkem-x25519.js | 5 +- dhkem-x448/docs/assets/main.js | 7 +- dhkem-x448/docs/assets/navigation.js | 1 + dhkem-x448/docs/assets/search.js | 2 +- dhkem-x448/docs/assets/style.css | 10 +- .../docs/classes/DhkemX448HkdfSha512.html | 70 +++---- dhkem-x448/docs/index.html | 24 +-- dhkem-x448/docs/modules.html | 26 +-- dhkem-x448/src/hpke-dhkem-x448.js | 5 +- docs/assets/main.js | 7 +- docs/assets/navigation.js | 1 + docs/assets/search.js | 2 +- docs/assets/style.css | 10 +- docs/classes/BaseError.html | 95 ++++------ docs/classes/CipherSuite.html | 176 +++++++++-------- docs/classes/DecapError.html | 95 ++++------ docs/classes/DeriveKeyPairError.html | 95 ++++------ docs/classes/DeserializeError.html | 95 ++++------ docs/classes/EncapError.html | 95 ++++------ docs/classes/ExportError.html | 95 ++++------ docs/classes/HpkeError.html | 95 ++++------ docs/classes/InvalidParamError.html | 95 ++++------ docs/classes/MessageLimitReachedError.html | 95 ++++------ docs/classes/NotSupportedError.html | 95 ++++------ docs/classes/OpenError.html | 95 ++++------ docs/classes/SealError.html | 95 ++++------ docs/classes/SerializeError.html | 95 ++++------ docs/classes/ValidationError.html | 95 ++++------ docs/index.html | 83 ++++---- docs/interfaces/AeadEncryptionContext.html | 113 +++++------ docs/interfaces/AeadInterface.html | 106 +++++------ docs/interfaces/CipherSuiteParams.html | 97 ++++------ docs/interfaces/CipherSuiteSealResponse.html | 95 ++++------ docs/interfaces/EncryptionContext.html | 115 +++++------ docs/interfaces/KdfInterface.html | 176 ++++++++--------- docs/interfaces/KemInterface.html | 151 +++++++-------- docs/interfaces/PreSharedKey.html | 95 ++++------ docs/interfaces/RecipientContextParams.html | 101 ++++------ docs/interfaces/SenderContext.html | 119 ++++++------ docs/interfaces/SenderContextParams.html | 101 ++++------ docs/modules.html | 91 ++++----- docs/types/Aead.html | 89 ++++----- docs/types/AeadId.html | 87 ++++----- docs/types/Kdf.html | 89 ++++----- docs/types/KdfId.html | 87 ++++----- docs/types/Kem.html | 89 ++++----- docs/types/KemId.html | 87 ++++----- docs/types/RecipientContext.html | 85 ++++----- docs/variables/Aead-1.html | 89 ++++----- docs/variables/AeadId-1.html | 87 ++++----- docs/variables/Kdf-1.html | 89 ++++----- docs/variables/KdfId-1.html | 87 ++++----- docs/variables/Kem-1.html | 89 ++++----- docs/variables/KemId-1.html | 87 ++++----- hybridkem-x25519-kyber768/docs/assets/main.js | 7 +- .../docs/assets/navigation.js | 1 + .../docs/assets/search.js | 2 +- .../docs/assets/style.css | 10 +- .../docs/classes/HybridkemX25519Kyber768.html | 76 ++++---- hybridkem-x25519-kyber768/docs/index.html | 24 +-- hybridkem-x25519-kyber768/docs/modules.html | 26 +-- .../src/hpke-hybridkem-x25519-kyber768.js | 5 +- src/hpke.js | 5 +- 133 files changed, 4096 insertions(+), 5491 deletions(-) create mode 100644 chacha20poly1305/docs/assets/navigation.js create mode 100644 core/docs/assets/navigation.js create mode 100644 dhkem-secp256k1/docs/assets/navigation.js create mode 100644 dhkem-x25519/docs/assets/navigation.js create mode 100644 dhkem-x448/docs/assets/navigation.js create mode 100644 docs/assets/navigation.js create mode 100644 hybridkem-x25519-kyber768/docs/assets/navigation.js diff --git a/chacha20poly1305/docs/assets/main.js b/chacha20poly1305/docs/assets/main.js index 3cee05e61..01bcad55f 100644 --- a/chacha20poly1305/docs/assets/main.js +++ b/chacha20poly1305/docs/assets/main.js @@ -1,7 +1,8 @@ "use strict"; -"use strict";(()=>{var Se=Object.create;var re=Object.defineProperty;var we=Object.getOwnPropertyDescriptor;var Te=Object.getOwnPropertyNames;var ke=Object.getPrototypeOf,Qe=Object.prototype.hasOwnProperty;var Pe=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Ie=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Te(e))!Qe.call(t,i)&&i!==r&&re(t,i,{get:()=>e[i],enumerable:!(n=we(e,i))||n.enumerable});return t};var Ce=(t,e,r)=>(r=t!=null?Se(ke(t)):{},Ie(e||!t||!t.__esModule?re(r,"default",{value:t,enumerable:!0}):r,t));var ae=Pe((se,oe)=>{(function(){var t=function(e){var r=new t.Builder;return r.pipeline.add(t.trimmer,t.stopWordFilter,t.stemmer),r.searchPipeline.add(t.stemmer),e.call(r,r),r.build()};t.version="2.3.9";t.utils={},t.utils.warn=function(e){return function(r){e.console&&console.warn&&console.warn(r)}}(this),t.utils.asString=function(e){return e==null?"":e.toString()},t.utils.clone=function(e){if(e==null)return e;for(var r=Object.create(null),n=Object.keys(e),i=0;i0){var d=t.utils.clone(r)||{};d.position=[a,u],d.index=s.length,s.push(new t.Token(n.slice(a,o),d))}a=o+1}}return s},t.tokenizer.separator=/[\s\-]+/;t.Pipeline=function(){this._stack=[]},t.Pipeline.registeredFunctions=Object.create(null),t.Pipeline.registerFunction=function(e,r){r in this.registeredFunctions&&t.utils.warn("Overwriting existing registered function: "+r),e.label=r,t.Pipeline.registeredFunctions[e.label]=e},t.Pipeline.warnIfFunctionNotRegistered=function(e){var r=e.label&&e.label in this.registeredFunctions;r||t.utils.warn(`Function is not registered with pipeline. This may cause problems when serialising the index. -`,e)},t.Pipeline.load=function(e){var r=new t.Pipeline;return e.forEach(function(n){var i=t.Pipeline.registeredFunctions[n];if(i)r.add(i);else throw new Error("Cannot load unregistered function: "+n)}),r},t.Pipeline.prototype.add=function(){var e=Array.prototype.slice.call(arguments);e.forEach(function(r){t.Pipeline.warnIfFunctionNotRegistered(r),this._stack.push(r)},this)},t.Pipeline.prototype.after=function(e,r){t.Pipeline.warnIfFunctionNotRegistered(r);var n=this._stack.indexOf(e);if(n==-1)throw new Error("Cannot find existingFn");n=n+1,this._stack.splice(n,0,r)},t.Pipeline.prototype.before=function(e,r){t.Pipeline.warnIfFunctionNotRegistered(r);var n=this._stack.indexOf(e);if(n==-1)throw new Error("Cannot find existingFn");this._stack.splice(n,0,r)},t.Pipeline.prototype.remove=function(e){var r=this._stack.indexOf(e);r!=-1&&this._stack.splice(r,1)},t.Pipeline.prototype.run=function(e){for(var r=this._stack.length,n=0;n1&&(oe&&(n=s),o!=e);)i=n-r,s=r+Math.floor(i/2),o=this.elements[s*2];if(o==e||o>e)return s*2;if(ol?d+=2:a==l&&(r+=n[u+1]*i[d+1],u+=2,d+=2);return r},t.Vector.prototype.similarity=function(e){return this.dot(e)/this.magnitude()||0},t.Vector.prototype.toArray=function(){for(var e=new Array(this.elements.length/2),r=1,n=0;r0){var o=s.str.charAt(0),a;o in s.node.edges?a=s.node.edges[o]:(a=new t.TokenSet,s.node.edges[o]=a),s.str.length==1&&(a.final=!0),i.push({node:a,editsRemaining:s.editsRemaining,str:s.str.slice(1)})}if(s.editsRemaining!=0){if("*"in s.node.edges)var l=s.node.edges["*"];else{var l=new t.TokenSet;s.node.edges["*"]=l}if(s.str.length==0&&(l.final=!0),i.push({node:l,editsRemaining:s.editsRemaining-1,str:s.str}),s.str.length>1&&i.push({node:s.node,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)}),s.str.length==1&&(s.node.final=!0),s.str.length>=1){if("*"in s.node.edges)var u=s.node.edges["*"];else{var u=new t.TokenSet;s.node.edges["*"]=u}s.str.length==1&&(u.final=!0),i.push({node:u,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)})}if(s.str.length>1){var d=s.str.charAt(0),m=s.str.charAt(1),y;m in s.node.edges?y=s.node.edges[m]:(y=new t.TokenSet,s.node.edges[m]=y),s.str.length==1&&(y.final=!0),i.push({node:y,editsRemaining:s.editsRemaining-1,str:d+s.str.slice(2)})}}}return n},t.TokenSet.fromString=function(e){for(var r=new t.TokenSet,n=r,i=0,s=e.length;i=e;r--){var n=this.uncheckedNodes[r],i=n.child.toString();i in this.minimizedNodes?n.parent.edges[n.char]=this.minimizedNodes[i]:(n.child._str=i,this.minimizedNodes[i]=n.child),this.uncheckedNodes.pop()}};t.Index=function(e){this.invertedIndex=e.invertedIndex,this.fieldVectors=e.fieldVectors,this.tokenSet=e.tokenSet,this.fields=e.fields,this.pipeline=e.pipeline},t.Index.prototype.search=function(e){return this.query(function(r){var n=new t.QueryParser(e,r);n.parse()})},t.Index.prototype.query=function(e){for(var r=new t.Query(this.fields),n=Object.create(null),i=Object.create(null),s=Object.create(null),o=Object.create(null),a=Object.create(null),l=0;l1?this._b=1:this._b=e},t.Builder.prototype.k1=function(e){this._k1=e},t.Builder.prototype.add=function(e,r){var n=e[this._ref],i=Object.keys(this._fields);this._documents[n]=r||{},this.documentCount+=1;for(var s=0;s=this.length)return t.QueryLexer.EOS;var e=this.str.charAt(this.pos);return this.pos+=1,e},t.QueryLexer.prototype.width=function(){return this.pos-this.start},t.QueryLexer.prototype.ignore=function(){this.start==this.pos&&(this.pos+=1),this.start=this.pos},t.QueryLexer.prototype.backup=function(){this.pos-=1},t.QueryLexer.prototype.acceptDigitRun=function(){var e,r;do e=this.next(),r=e.charCodeAt(0);while(r>47&&r<58);e!=t.QueryLexer.EOS&&this.backup()},t.QueryLexer.prototype.more=function(){return this.pos1&&(e.backup(),e.emit(t.QueryLexer.TERM)),e.ignore(),e.more())return t.QueryLexer.lexText},t.QueryLexer.lexEditDistance=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(t.QueryLexer.EDIT_DISTANCE),t.QueryLexer.lexText},t.QueryLexer.lexBoost=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(t.QueryLexer.BOOST),t.QueryLexer.lexText},t.QueryLexer.lexEOS=function(e){e.width()>0&&e.emit(t.QueryLexer.TERM)},t.QueryLexer.termSeparator=t.tokenizer.separator,t.QueryLexer.lexText=function(e){for(;;){var r=e.next();if(r==t.QueryLexer.EOS)return t.QueryLexer.lexEOS;if(r.charCodeAt(0)==92){e.escapeCharacter();continue}if(r==":")return t.QueryLexer.lexField;if(r=="~")return e.backup(),e.width()>0&&e.emit(t.QueryLexer.TERM),t.QueryLexer.lexEditDistance;if(r=="^")return e.backup(),e.width()>0&&e.emit(t.QueryLexer.TERM),t.QueryLexer.lexBoost;if(r=="+"&&e.width()===1||r=="-"&&e.width()===1)return e.emit(t.QueryLexer.PRESENCE),t.QueryLexer.lexText;if(r.match(t.QueryLexer.termSeparator))return t.QueryLexer.lexTerm}},t.QueryParser=function(e,r){this.lexer=new t.QueryLexer(e),this.query=r,this.currentClause={},this.lexemeIdx=0},t.QueryParser.prototype.parse=function(){this.lexer.run(),this.lexemes=this.lexer.lexemes;for(var e=t.QueryParser.parseClause;e;)e=e(this);return this.query},t.QueryParser.prototype.peekLexeme=function(){return this.lexemes[this.lexemeIdx]},t.QueryParser.prototype.consumeLexeme=function(){var e=this.peekLexeme();return this.lexemeIdx+=1,e},t.QueryParser.prototype.nextClause=function(){var e=this.currentClause;this.query.clause(e),this.currentClause={}},t.QueryParser.parseClause=function(e){var r=e.peekLexeme();if(r!=null)switch(r.type){case t.QueryLexer.PRESENCE:return t.QueryParser.parsePresence;case t.QueryLexer.FIELD:return t.QueryParser.parseField;case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var n="expected either a field or a term, found "+r.type;throw r.str.length>=1&&(n+=" with value '"+r.str+"'"),new t.QueryParseError(n,r.start,r.end)}},t.QueryParser.parsePresence=function(e){var r=e.consumeLexeme();if(r!=null){switch(r.str){case"-":e.currentClause.presence=t.Query.presence.PROHIBITED;break;case"+":e.currentClause.presence=t.Query.presence.REQUIRED;break;default:var n="unrecognised presence operator'"+r.str+"'";throw new t.QueryParseError(n,r.start,r.end)}var i=e.peekLexeme();if(i==null){var n="expecting term or field, found nothing";throw new t.QueryParseError(n,r.start,r.end)}switch(i.type){case t.QueryLexer.FIELD:return t.QueryParser.parseField;case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var n="expecting term or field, found '"+i.type+"'";throw new t.QueryParseError(n,i.start,i.end)}}},t.QueryParser.parseField=function(e){var r=e.consumeLexeme();if(r!=null){if(e.query.allFields.indexOf(r.str)==-1){var n=e.query.allFields.map(function(o){return"'"+o+"'"}).join(", "),i="unrecognised field '"+r.str+"', possible fields: "+n;throw new t.QueryParseError(i,r.start,r.end)}e.currentClause.fields=[r.str];var s=e.peekLexeme();if(s==null){var i="expecting term, found nothing";throw new t.QueryParseError(i,r.start,r.end)}switch(s.type){case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var i="expecting term, found '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},t.QueryParser.parseTerm=function(e){var r=e.consumeLexeme();if(r!=null){e.currentClause.term=r.str.toLowerCase(),r.str.indexOf("*")!=-1&&(e.currentClause.usePipeline=!1);var n=e.peekLexeme();if(n==null){e.nextClause();return}switch(n.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+n.type+"'";throw new t.QueryParseError(i,n.start,n.end)}}},t.QueryParser.parseEditDistance=function(e){var r=e.consumeLexeme();if(r!=null){var n=parseInt(r.str,10);if(isNaN(n)){var i="edit distance must be numeric";throw new t.QueryParseError(i,r.start,r.end)}e.currentClause.editDistance=n;var s=e.peekLexeme();if(s==null){e.nextClause();return}switch(s.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},t.QueryParser.parseBoost=function(e){var r=e.consumeLexeme();if(r!=null){var n=parseInt(r.str,10);if(isNaN(n)){var i="boost must be numeric";throw new t.QueryParseError(i,r.start,r.end)}e.currentClause.boost=n;var s=e.peekLexeme();if(s==null){e.nextClause();return}switch(s.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},function(e,r){typeof define=="function"&&define.amd?define(r):typeof se=="object"?oe.exports=r():e.lunr=r()}(this,function(){return t})})()});var ne=[];function G(t,e){ne.push({selector:e,constructor:t})}var U=class{constructor(){this.alwaysVisibleMember=null;this.createComponents(document.body),this.ensureActivePageVisible(),this.ensureFocusedElementVisible(),this.listenForCodeCopies(),window.addEventListener("hashchange",()=>this.ensureFocusedElementVisible())}createComponents(e){ne.forEach(r=>{e.querySelectorAll(r.selector).forEach(n=>{n.dataset.hasInstance||(new r.constructor({el:n,app:this}),n.dataset.hasInstance=String(!0))})})}filterChanged(){this.ensureFocusedElementVisible()}ensureActivePageVisible(){let e=document.querySelector(".tsd-navigation .current"),r=e?.parentElement;for(;r&&!r.classList.contains(".tsd-navigation");)r instanceof HTMLDetailsElement&&(r.open=!0),r=r.parentElement;if(e){let n=e.getBoundingClientRect().top-document.documentElement.clientHeight/4;document.querySelector(".site-menu").scrollTop=n}}ensureFocusedElementVisible(){if(this.alwaysVisibleMember&&(this.alwaysVisibleMember.classList.remove("always-visible"),this.alwaysVisibleMember.firstElementChild.remove(),this.alwaysVisibleMember=null),!location.hash)return;let e=document.getElementById(location.hash.substring(1));if(!e)return;let r=e.parentElement;for(;r&&r.tagName!=="SECTION";)r=r.parentElement;if(r&&r.offsetParent==null){this.alwaysVisibleMember=r,r.classList.add("always-visible");let n=document.createElement("p");n.classList.add("warning"),n.textContent="This member is normally hidden due to your filter settings.",r.prepend(n)}}listenForCodeCopies(){document.querySelectorAll("pre > button").forEach(e=>{let r;e.addEventListener("click",()=>{e.previousElementSibling instanceof HTMLElement&&navigator.clipboard.writeText(e.previousElementSibling.innerText.trim()),e.textContent="Copied!",e.classList.add("visible"),clearTimeout(r),r=setTimeout(()=>{e.classList.remove("visible"),r=setTimeout(()=>{e.textContent="Copy"},100)},1e3)})})}};var ie=(t,e=100)=>{let r;return()=>{clearTimeout(r),r=setTimeout(()=>t(),e)}};var ce=Ce(ae());function de(){let t=document.getElementById("tsd-search");if(!t)return;let e=document.getElementById("tsd-search-script");t.classList.add("loading"),e&&(e.addEventListener("error",()=>{t.classList.remove("loading"),t.classList.add("failure")}),e.addEventListener("load",()=>{t.classList.remove("loading"),t.classList.add("ready")}),window.searchData&&t.classList.remove("loading"));let r=document.querySelector("#tsd-search input"),n=document.querySelector("#tsd-search .results");if(!r||!n)throw new Error("The input field or the result list wrapper was not found");let i=!1;n.addEventListener("mousedown",()=>i=!0),n.addEventListener("mouseup",()=>{i=!1,t.classList.remove("has-focus")}),r.addEventListener("focus",()=>t.classList.add("has-focus")),r.addEventListener("blur",()=>{i||(i=!1,t.classList.remove("has-focus"))});let s={base:t.dataset.base+"/"};Oe(t,n,r,s)}function Oe(t,e,r,n){r.addEventListener("input",ie(()=>{Re(t,e,r,n)},200));let i=!1;r.addEventListener("keydown",s=>{i=!0,s.key=="Enter"?Fe(e,r):s.key=="Escape"?r.blur():s.key=="ArrowUp"?ue(e,-1):s.key==="ArrowDown"?ue(e,1):i=!1}),r.addEventListener("keypress",s=>{i&&s.preventDefault()}),document.body.addEventListener("keydown",s=>{s.altKey||s.ctrlKey||s.metaKey||!r.matches(":focus")&&s.key==="/"&&(r.focus(),s.preventDefault())})}function _e(t,e){t.index||window.searchData&&(e.classList.remove("loading"),e.classList.add("ready"),t.data=window.searchData,t.index=ce.Index.load(window.searchData.index))}function Re(t,e,r,n){if(_e(n,t),!n.index||!n.data)return;e.textContent="";let i=r.value.trim(),s=i?n.index.search(`*${i}*`):[];for(let o=0;oa.score-o.score);for(let o=0,a=Math.min(10,s.length);o${le(l.parent,i)}.${u}`);let d=document.createElement("li");d.classList.value=l.classes??"";let m=document.createElement("a");m.href=n.base+l.url,m.innerHTML=u,d.append(m),e.appendChild(d)}}function ue(t,e){let r=t.querySelector(".current");if(!r)r=t.querySelector(e==1?"li:first-child":"li:last-child"),r&&r.classList.add("current");else{let n=r;if(e===1)do n=n.nextElementSibling??void 0;while(n instanceof HTMLElement&&n.offsetParent==null);else do n=n.previousElementSibling??void 0;while(n instanceof HTMLElement&&n.offsetParent==null);n&&(r.classList.remove("current"),n.classList.add("current"))}}function Fe(t,e){let r=t.querySelector(".current");if(r||(r=t.querySelector("li:first-child")),r){let n=r.querySelector("a");n&&(window.location.href=n.href),e.blur()}}function le(t,e){if(e==="")return t;let r=t.toLocaleLowerCase(),n=e.toLocaleLowerCase(),i=[],s=0,o=r.indexOf(n);for(;o!=-1;)i.push(K(t.substring(s,o)),`${K(t.substring(o,o+n.length))}`),s=o+n.length,o=r.indexOf(n,s);return i.push(K(t.substring(s))),i.join("")}var Me={"&":"&","<":"<",">":">","'":"'",'"':"""};function K(t){return t.replace(/[&<>"'"]/g,e=>Me[e])}var P=class{constructor(e){this.el=e.el,this.app=e.app}};var M="mousedown",fe="mousemove",N="mouseup",J={x:0,y:0},he=!1,ee=!1,De=!1,D=!1,pe=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);document.documentElement.classList.add(pe?"is-mobile":"not-mobile");pe&&"ontouchstart"in document.documentElement&&(De=!0,M="touchstart",fe="touchmove",N="touchend");document.addEventListener(M,t=>{ee=!0,D=!1;let e=M=="touchstart"?t.targetTouches[0]:t;J.y=e.pageY||0,J.x=e.pageX||0});document.addEventListener(fe,t=>{if(ee&&!D){let e=M=="touchstart"?t.targetTouches[0]:t,r=J.x-(e.pageX||0),n=J.y-(e.pageY||0);D=Math.sqrt(r*r+n*n)>10}});document.addEventListener(N,()=>{ee=!1});document.addEventListener("click",t=>{he&&(t.preventDefault(),t.stopImmediatePropagation(),he=!1)});var X=class extends P{constructor(r){super(r);this.className=this.el.dataset.toggle||"",this.el.addEventListener(N,n=>this.onPointerUp(n)),this.el.addEventListener("click",n=>n.preventDefault()),document.addEventListener(M,n=>this.onDocumentPointerDown(n)),document.addEventListener(N,n=>this.onDocumentPointerUp(n))}setActive(r){if(this.active==r)return;this.active=r,document.documentElement.classList.toggle("has-"+this.className,r),this.el.classList.toggle("active",r);let n=(this.active?"to-has-":"from-has-")+this.className;document.documentElement.classList.add(n),setTimeout(()=>document.documentElement.classList.remove(n),500)}onPointerUp(r){D||(this.setActive(!0),r.preventDefault())}onDocumentPointerDown(r){if(this.active){if(r.target.closest(".col-sidebar, .tsd-filter-group"))return;this.setActive(!1)}}onDocumentPointerUp(r){if(!D&&this.active&&r.target.closest(".col-sidebar")){let n=r.target.closest("a");if(n){let i=window.location.href;i.indexOf("#")!=-1&&(i=i.substring(0,i.indexOf("#"))),n.href.substring(0,i.length)==i&&setTimeout(()=>this.setActive(!1),250)}}}};var te;try{te=localStorage}catch{te={getItem(){return null},setItem(){}}}var Q=te;var me=document.head.appendChild(document.createElement("style"));me.dataset.for="filters";var Y=class extends P{constructor(r){super(r);this.key=`filter-${this.el.name}`,this.value=this.el.checked,this.el.addEventListener("change",()=>{this.setLocalStorage(this.el.checked)}),this.setLocalStorage(this.fromLocalStorage()),me.innerHTML+=`html:not(.${this.key}) .tsd-is-${this.el.name} { display: none; } -`}fromLocalStorage(){let r=Q.getItem(this.key);return r?r==="true":this.el.checked}setLocalStorage(r){Q.setItem(this.key,r.toString()),this.value=r,this.handleValueChange()}handleValueChange(){this.el.checked=this.value,document.documentElement.classList.toggle(this.key,this.value),this.app.filterChanged(),document.querySelectorAll(".tsd-index-section").forEach(r=>{r.style.display="block";let n=Array.from(r.querySelectorAll(".tsd-index-link")).every(i=>i.offsetParent==null);r.style.display=n?"none":"block"})}};var Z=class extends P{constructor(r){super(r);this.summary=this.el.querySelector(".tsd-accordion-summary"),this.icon=this.summary.querySelector("svg"),this.key=`tsd-accordion-${this.summary.dataset.key??this.summary.textContent.trim().replace(/\s+/g,"-").toLowerCase()}`;let n=Q.getItem(this.key);this.el.open=n?n==="true":this.el.open,this.el.addEventListener("toggle",()=>this.update()),this.update()}update(){this.icon.style.transform=`rotate(${this.el.open?0:-90}deg)`,Q.setItem(this.key,this.el.open.toString())}};function ve(t){let e=Q.getItem("tsd-theme")||"os";t.value=e,ye(e),t.addEventListener("change",()=>{Q.setItem("tsd-theme",t.value),ye(t.value)})}function ye(t){document.documentElement.dataset.theme=t}de();G(X,"a[data-toggle]");G(Z,".tsd-index-accordion");G(Y,".tsd-filter-item input[type=checkbox]");var ge=document.getElementById("tsd-theme");ge&&ve(ge);var Ae=new U;Object.defineProperty(window,"app",{value:Ae});document.querySelectorAll("summary a").forEach(t=>{t.addEventListener("click",()=>{location.assign(t.href)})});})(); +"use strict";(()=>{var Pe=Object.create;var ne=Object.defineProperty;var Ie=Object.getOwnPropertyDescriptor;var Oe=Object.getOwnPropertyNames;var _e=Object.getPrototypeOf,Re=Object.prototype.hasOwnProperty;var Me=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Fe=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Oe(e))!Re.call(t,i)&&i!==n&&ne(t,i,{get:()=>e[i],enumerable:!(r=Ie(e,i))||r.enumerable});return t};var De=(t,e,n)=>(n=t!=null?Pe(_e(t)):{},Fe(e||!t||!t.__esModule?ne(n,"default",{value:t,enumerable:!0}):n,t));var ae=Me((se,oe)=>{(function(){var t=function(e){var n=new t.Builder;return n.pipeline.add(t.trimmer,t.stopWordFilter,t.stemmer),n.searchPipeline.add(t.stemmer),e.call(n,n),n.build()};t.version="2.3.9";t.utils={},t.utils.warn=function(e){return function(n){e.console&&console.warn&&console.warn(n)}}(this),t.utils.asString=function(e){return e==null?"":e.toString()},t.utils.clone=function(e){if(e==null)return e;for(var n=Object.create(null),r=Object.keys(e),i=0;i0){var d=t.utils.clone(n)||{};d.position=[a,u],d.index=s.length,s.push(new t.Token(r.slice(a,o),d))}a=o+1}}return s},t.tokenizer.separator=/[\s\-]+/;t.Pipeline=function(){this._stack=[]},t.Pipeline.registeredFunctions=Object.create(null),t.Pipeline.registerFunction=function(e,n){n in this.registeredFunctions&&t.utils.warn("Overwriting existing registered function: "+n),e.label=n,t.Pipeline.registeredFunctions[e.label]=e},t.Pipeline.warnIfFunctionNotRegistered=function(e){var n=e.label&&e.label in this.registeredFunctions;n||t.utils.warn(`Function is not registered with pipeline. This may cause problems when serialising the index. +`,e)},t.Pipeline.load=function(e){var n=new t.Pipeline;return e.forEach(function(r){var i=t.Pipeline.registeredFunctions[r];if(i)n.add(i);else throw new Error("Cannot load unregistered function: "+r)}),n},t.Pipeline.prototype.add=function(){var e=Array.prototype.slice.call(arguments);e.forEach(function(n){t.Pipeline.warnIfFunctionNotRegistered(n),this._stack.push(n)},this)},t.Pipeline.prototype.after=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var r=this._stack.indexOf(e);if(r==-1)throw new Error("Cannot find existingFn");r=r+1,this._stack.splice(r,0,n)},t.Pipeline.prototype.before=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var r=this._stack.indexOf(e);if(r==-1)throw new Error("Cannot find existingFn");this._stack.splice(r,0,n)},t.Pipeline.prototype.remove=function(e){var n=this._stack.indexOf(e);n!=-1&&this._stack.splice(n,1)},t.Pipeline.prototype.run=function(e){for(var n=this._stack.length,r=0;r1&&(oe&&(r=s),o!=e);)i=r-n,s=n+Math.floor(i/2),o=this.elements[s*2];if(o==e||o>e)return s*2;if(ol?d+=2:a==l&&(n+=r[u+1]*i[d+1],u+=2,d+=2);return n},t.Vector.prototype.similarity=function(e){return this.dot(e)/this.magnitude()||0},t.Vector.prototype.toArray=function(){for(var e=new Array(this.elements.length/2),n=1,r=0;n0){var o=s.str.charAt(0),a;o in s.node.edges?a=s.node.edges[o]:(a=new t.TokenSet,s.node.edges[o]=a),s.str.length==1&&(a.final=!0),i.push({node:a,editsRemaining:s.editsRemaining,str:s.str.slice(1)})}if(s.editsRemaining!=0){if("*"in s.node.edges)var l=s.node.edges["*"];else{var l=new t.TokenSet;s.node.edges["*"]=l}if(s.str.length==0&&(l.final=!0),i.push({node:l,editsRemaining:s.editsRemaining-1,str:s.str}),s.str.length>1&&i.push({node:s.node,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)}),s.str.length==1&&(s.node.final=!0),s.str.length>=1){if("*"in s.node.edges)var u=s.node.edges["*"];else{var u=new t.TokenSet;s.node.edges["*"]=u}s.str.length==1&&(u.final=!0),i.push({node:u,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)})}if(s.str.length>1){var d=s.str.charAt(0),v=s.str.charAt(1),f;v in s.node.edges?f=s.node.edges[v]:(f=new t.TokenSet,s.node.edges[v]=f),s.str.length==1&&(f.final=!0),i.push({node:f,editsRemaining:s.editsRemaining-1,str:d+s.str.slice(2)})}}}return r},t.TokenSet.fromString=function(e){for(var n=new t.TokenSet,r=n,i=0,s=e.length;i=e;n--){var r=this.uncheckedNodes[n],i=r.child.toString();i in this.minimizedNodes?r.parent.edges[r.char]=this.minimizedNodes[i]:(r.child._str=i,this.minimizedNodes[i]=r.child),this.uncheckedNodes.pop()}};t.Index=function(e){this.invertedIndex=e.invertedIndex,this.fieldVectors=e.fieldVectors,this.tokenSet=e.tokenSet,this.fields=e.fields,this.pipeline=e.pipeline},t.Index.prototype.search=function(e){return this.query(function(n){var r=new t.QueryParser(e,n);r.parse()})},t.Index.prototype.query=function(e){for(var n=new t.Query(this.fields),r=Object.create(null),i=Object.create(null),s=Object.create(null),o=Object.create(null),a=Object.create(null),l=0;l1?this._b=1:this._b=e},t.Builder.prototype.k1=function(e){this._k1=e},t.Builder.prototype.add=function(e,n){var r=e[this._ref],i=Object.keys(this._fields);this._documents[r]=n||{},this.documentCount+=1;for(var s=0;s=this.length)return t.QueryLexer.EOS;var e=this.str.charAt(this.pos);return this.pos+=1,e},t.QueryLexer.prototype.width=function(){return this.pos-this.start},t.QueryLexer.prototype.ignore=function(){this.start==this.pos&&(this.pos+=1),this.start=this.pos},t.QueryLexer.prototype.backup=function(){this.pos-=1},t.QueryLexer.prototype.acceptDigitRun=function(){var e,n;do e=this.next(),n=e.charCodeAt(0);while(n>47&&n<58);e!=t.QueryLexer.EOS&&this.backup()},t.QueryLexer.prototype.more=function(){return this.pos1&&(e.backup(),e.emit(t.QueryLexer.TERM)),e.ignore(),e.more())return t.QueryLexer.lexText},t.QueryLexer.lexEditDistance=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(t.QueryLexer.EDIT_DISTANCE),t.QueryLexer.lexText},t.QueryLexer.lexBoost=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(t.QueryLexer.BOOST),t.QueryLexer.lexText},t.QueryLexer.lexEOS=function(e){e.width()>0&&e.emit(t.QueryLexer.TERM)},t.QueryLexer.termSeparator=t.tokenizer.separator,t.QueryLexer.lexText=function(e){for(;;){var n=e.next();if(n==t.QueryLexer.EOS)return t.QueryLexer.lexEOS;if(n.charCodeAt(0)==92){e.escapeCharacter();continue}if(n==":")return t.QueryLexer.lexField;if(n=="~")return e.backup(),e.width()>0&&e.emit(t.QueryLexer.TERM),t.QueryLexer.lexEditDistance;if(n=="^")return e.backup(),e.width()>0&&e.emit(t.QueryLexer.TERM),t.QueryLexer.lexBoost;if(n=="+"&&e.width()===1||n=="-"&&e.width()===1)return e.emit(t.QueryLexer.PRESENCE),t.QueryLexer.lexText;if(n.match(t.QueryLexer.termSeparator))return t.QueryLexer.lexTerm}},t.QueryParser=function(e,n){this.lexer=new t.QueryLexer(e),this.query=n,this.currentClause={},this.lexemeIdx=0},t.QueryParser.prototype.parse=function(){this.lexer.run(),this.lexemes=this.lexer.lexemes;for(var e=t.QueryParser.parseClause;e;)e=e(this);return this.query},t.QueryParser.prototype.peekLexeme=function(){return this.lexemes[this.lexemeIdx]},t.QueryParser.prototype.consumeLexeme=function(){var e=this.peekLexeme();return this.lexemeIdx+=1,e},t.QueryParser.prototype.nextClause=function(){var e=this.currentClause;this.query.clause(e),this.currentClause={}},t.QueryParser.parseClause=function(e){var n=e.peekLexeme();if(n!=null)switch(n.type){case t.QueryLexer.PRESENCE:return t.QueryParser.parsePresence;case t.QueryLexer.FIELD:return t.QueryParser.parseField;case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var r="expected either a field or a term, found "+n.type;throw n.str.length>=1&&(r+=" with value '"+n.str+"'"),new t.QueryParseError(r,n.start,n.end)}},t.QueryParser.parsePresence=function(e){var n=e.consumeLexeme();if(n!=null){switch(n.str){case"-":e.currentClause.presence=t.Query.presence.PROHIBITED;break;case"+":e.currentClause.presence=t.Query.presence.REQUIRED;break;default:var r="unrecognised presence operator'"+n.str+"'";throw new t.QueryParseError(r,n.start,n.end)}var i=e.peekLexeme();if(i==null){var r="expecting term or field, found nothing";throw new t.QueryParseError(r,n.start,n.end)}switch(i.type){case t.QueryLexer.FIELD:return t.QueryParser.parseField;case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var r="expecting term or field, found '"+i.type+"'";throw new t.QueryParseError(r,i.start,i.end)}}},t.QueryParser.parseField=function(e){var n=e.consumeLexeme();if(n!=null){if(e.query.allFields.indexOf(n.str)==-1){var r=e.query.allFields.map(function(o){return"'"+o+"'"}).join(", "),i="unrecognised field '"+n.str+"', possible fields: "+r;throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.fields=[n.str];var s=e.peekLexeme();if(s==null){var i="expecting term, found nothing";throw new t.QueryParseError(i,n.start,n.end)}switch(s.type){case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var i="expecting term, found '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},t.QueryParser.parseTerm=function(e){var n=e.consumeLexeme();if(n!=null){e.currentClause.term=n.str.toLowerCase(),n.str.indexOf("*")!=-1&&(e.currentClause.usePipeline=!1);var r=e.peekLexeme();if(r==null){e.nextClause();return}switch(r.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+r.type+"'";throw new t.QueryParseError(i,r.start,r.end)}}},t.QueryParser.parseEditDistance=function(e){var n=e.consumeLexeme();if(n!=null){var r=parseInt(n.str,10);if(isNaN(r)){var i="edit distance must be numeric";throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.editDistance=r;var s=e.peekLexeme();if(s==null){e.nextClause();return}switch(s.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},t.QueryParser.parseBoost=function(e){var n=e.consumeLexeme();if(n!=null){var r=parseInt(n.str,10);if(isNaN(r)){var i="boost must be numeric";throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.boost=r;var s=e.peekLexeme();if(s==null){e.nextClause();return}switch(s.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},function(e,n){typeof define=="function"&&define.amd?define(n):typeof se=="object"?oe.exports=n():e.lunr=n()}(this,function(){return t})})()});var re=[];function G(t,e){re.push({selector:e,constructor:t})}var U=class{constructor(){this.alwaysVisibleMember=null;this.createComponents(document.body),this.ensureActivePageVisible(),this.ensureFocusedElementVisible(),this.listenForCodeCopies(),window.addEventListener("hashchange",()=>this.ensureFocusedElementVisible())}createComponents(e){re.forEach(n=>{e.querySelectorAll(n.selector).forEach(r=>{r.dataset.hasInstance||(new n.constructor({el:r,app:this}),r.dataset.hasInstance=String(!0))})})}filterChanged(){this.ensureFocusedElementVisible()}ensureActivePageVisible(){let e=document.querySelector(".tsd-navigation .current"),n=e?.parentElement;for(;n&&!n.classList.contains(".tsd-navigation");)n instanceof HTMLDetailsElement&&(n.open=!0),n=n.parentElement;if(e){let r=e.getBoundingClientRect().top-document.documentElement.clientHeight/4;document.querySelector(".site-menu").scrollTop=r}}ensureFocusedElementVisible(){if(this.alwaysVisibleMember&&(this.alwaysVisibleMember.classList.remove("always-visible"),this.alwaysVisibleMember.firstElementChild.remove(),this.alwaysVisibleMember=null),!location.hash)return;let e=document.getElementById(location.hash.substring(1));if(!e)return;let n=e.parentElement;for(;n&&n.tagName!=="SECTION";)n=n.parentElement;if(n&&n.offsetParent==null){this.alwaysVisibleMember=n,n.classList.add("always-visible");let r=document.createElement("p");r.classList.add("warning"),r.textContent="This member is normally hidden due to your filter settings.",n.prepend(r)}}listenForCodeCopies(){document.querySelectorAll("pre > button").forEach(e=>{let n;e.addEventListener("click",()=>{e.previousElementSibling instanceof HTMLElement&&navigator.clipboard.writeText(e.previousElementSibling.innerText.trim()),e.textContent="Copied!",e.classList.add("visible"),clearTimeout(n),n=setTimeout(()=>{e.classList.remove("visible"),n=setTimeout(()=>{e.textContent="Copy"},100)},1e3)})})}};var ie=(t,e=100)=>{let n;return()=>{clearTimeout(n),n=setTimeout(()=>t(),e)}};var de=De(ae());async function le(t,e){if(!window.searchData)return;let n=await fetch(window.searchData),r=new Blob([await n.arrayBuffer()]).stream().pipeThrough(new DecompressionStream("gzip")),i=await new Response(r).json();t.data=i,t.index=de.Index.load(i.index),e.classList.remove("loading"),e.classList.add("ready")}function he(){let t=document.getElementById("tsd-search");if(!t)return;let e={base:t.dataset.base+"/"},n=document.getElementById("tsd-search-script");t.classList.add("loading"),n&&(n.addEventListener("error",()=>{t.classList.remove("loading"),t.classList.add("failure")}),n.addEventListener("load",()=>{le(e,t)}),le(e,t));let r=document.querySelector("#tsd-search input"),i=document.querySelector("#tsd-search .results");if(!r||!i)throw new Error("The input field or the result list wrapper was not found");let s=!1;i.addEventListener("mousedown",()=>s=!0),i.addEventListener("mouseup",()=>{s=!1,t.classList.remove("has-focus")}),r.addEventListener("focus",()=>t.classList.add("has-focus")),r.addEventListener("blur",()=>{s||(s=!1,t.classList.remove("has-focus"))}),Ae(t,i,r,e)}function Ae(t,e,n,r){n.addEventListener("input",ie(()=>{Ne(t,e,n,r)},200));let i=!1;n.addEventListener("keydown",s=>{i=!0,s.key=="Enter"?Ve(e,n):s.key=="Escape"?n.blur():s.key=="ArrowUp"?ue(e,-1):s.key==="ArrowDown"?ue(e,1):i=!1}),n.addEventListener("keypress",s=>{i&&s.preventDefault()}),document.body.addEventListener("keydown",s=>{s.altKey||s.ctrlKey||s.metaKey||!n.matches(":focus")&&s.key==="/"&&(n.focus(),s.preventDefault())})}function Ne(t,e,n,r){if(!r.index||!r.data)return;e.textContent="";let i=n.value.trim(),s=i?r.index.search(`*${i}*`):[];for(let o=0;oa.score-o.score);for(let o=0,a=Math.min(10,s.length);o`,d=ce(l.name,i);globalThis.DEBUG_SEARCH_WEIGHTS&&(d+=` (score: ${s[o].score.toFixed(2)})`),l.parent&&(d=` + ${ce(l.parent,i)}.${d}`);let v=document.createElement("li");v.classList.value=l.classes??"";let f=document.createElement("a");f.href=r.base+l.url,f.innerHTML=u+d,v.append(f),e.appendChild(v)}}function ue(t,e){let n=t.querySelector(".current");if(!n)n=t.querySelector(e==1?"li:first-child":"li:last-child"),n&&n.classList.add("current");else{let r=n;if(e===1)do r=r.nextElementSibling??void 0;while(r instanceof HTMLElement&&r.offsetParent==null);else do r=r.previousElementSibling??void 0;while(r instanceof HTMLElement&&r.offsetParent==null);r&&(n.classList.remove("current"),r.classList.add("current"))}}function Ve(t,e){let n=t.querySelector(".current");if(n||(n=t.querySelector("li:first-child")),n){let r=n.querySelector("a");r&&(window.location.href=r.href),e.blur()}}function ce(t,e){if(e==="")return t;let n=t.toLocaleLowerCase(),r=e.toLocaleLowerCase(),i=[],s=0,o=n.indexOf(r);for(;o!=-1;)i.push(K(t.substring(s,o)),`${K(t.substring(o,o+r.length))}`),s=o+r.length,o=n.indexOf(r,s);return i.push(K(t.substring(s))),i.join("")}var Be={"&":"&","<":"<",">":">","'":"'",'"':"""};function K(t){return t.replace(/[&<>"'"]/g,e=>Be[e])}var C=class{constructor(e){this.el=e.el,this.app=e.app}};var F="mousedown",pe="mousemove",B="mouseup",J={x:0,y:0},fe=!1,ee=!1,He=!1,D=!1,me=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);document.documentElement.classList.add(me?"is-mobile":"not-mobile");me&&"ontouchstart"in document.documentElement&&(He=!0,F="touchstart",pe="touchmove",B="touchend");document.addEventListener(F,t=>{ee=!0,D=!1;let e=F=="touchstart"?t.targetTouches[0]:t;J.y=e.pageY||0,J.x=e.pageX||0});document.addEventListener(pe,t=>{if(ee&&!D){let e=F=="touchstart"?t.targetTouches[0]:t,n=J.x-(e.pageX||0),r=J.y-(e.pageY||0);D=Math.sqrt(n*n+r*r)>10}});document.addEventListener(B,()=>{ee=!1});document.addEventListener("click",t=>{fe&&(t.preventDefault(),t.stopImmediatePropagation(),fe=!1)});var X=class extends C{constructor(n){super(n);this.className=this.el.dataset.toggle||"",this.el.addEventListener(B,r=>this.onPointerUp(r)),this.el.addEventListener("click",r=>r.preventDefault()),document.addEventListener(F,r=>this.onDocumentPointerDown(r)),document.addEventListener(B,r=>this.onDocumentPointerUp(r))}setActive(n){if(this.active==n)return;this.active=n,document.documentElement.classList.toggle("has-"+this.className,n),this.el.classList.toggle("active",n);let r=(this.active?"to-has-":"from-has-")+this.className;document.documentElement.classList.add(r),setTimeout(()=>document.documentElement.classList.remove(r),500)}onPointerUp(n){D||(this.setActive(!0),n.preventDefault())}onDocumentPointerDown(n){if(this.active){if(n.target.closest(".col-sidebar, .tsd-filter-group"))return;this.setActive(!1)}}onDocumentPointerUp(n){if(!D&&this.active&&n.target.closest(".col-sidebar")){let r=n.target.closest("a");if(r){let i=window.location.href;i.indexOf("#")!=-1&&(i=i.substring(0,i.indexOf("#"))),r.href.substring(0,i.length)==i&&setTimeout(()=>this.setActive(!1),250)}}}};var te;try{te=localStorage}catch{te={getItem(){return null},setItem(){}}}var Q=te;var ve=document.head.appendChild(document.createElement("style"));ve.dataset.for="filters";var Y=class extends C{constructor(n){super(n);this.key=`filter-${this.el.name}`,this.value=this.el.checked,this.el.addEventListener("change",()=>{this.setLocalStorage(this.el.checked)}),this.setLocalStorage(this.fromLocalStorage()),ve.innerHTML+=`html:not(.${this.key}) .tsd-is-${this.el.name} { display: none; } +`}fromLocalStorage(){let n=Q.getItem(this.key);return n?n==="true":this.el.checked}setLocalStorage(n){Q.setItem(this.key,n.toString()),this.value=n,this.handleValueChange()}handleValueChange(){this.el.checked=this.value,document.documentElement.classList.toggle(this.key,this.value),this.app.filterChanged(),document.querySelectorAll(".tsd-index-section").forEach(n=>{n.style.display="block";let r=Array.from(n.querySelectorAll(".tsd-index-link")).every(i=>i.offsetParent==null);n.style.display=r?"none":"block"})}};var Z=class extends C{constructor(n){super(n);this.summary=this.el.querySelector(".tsd-accordion-summary"),this.icon=this.summary.querySelector("svg"),this.key=`tsd-accordion-${this.summary.dataset.key??this.summary.textContent.trim().replace(/\s+/g,"-").toLowerCase()}`;let r=Q.getItem(this.key);this.el.open=r?r==="true":this.el.open,this.el.addEventListener("toggle",()=>this.update());let i=this.summary.querySelector("a");i&&i.addEventListener("click",()=>{location.assign(i.href)}),this.update()}update(){this.icon.style.transform=`rotate(${this.el.open?0:-90}deg)`,Q.setItem(this.key,this.el.open.toString())}};function ge(t){let e=Q.getItem("tsd-theme")||"os";t.value=e,ye(e),t.addEventListener("change",()=>{Q.setItem("tsd-theme",t.value),ye(t.value)})}function ye(t){document.documentElement.dataset.theme=t}var Le;function be(){let t=document.getElementById("tsd-nav-script");t&&(t.addEventListener("load",xe),xe())}async function xe(){let t=document.getElementById("tsd-nav-container");if(!t||!window.navigationData)return;let n=await(await fetch(window.navigationData)).arrayBuffer(),r=new Blob([n]).stream().pipeThrough(new DecompressionStream("gzip")),i=await new Response(r).json();Le=t.dataset.base+"/",t.innerHTML="";for(let s of i)we(s,t,[]);window.app.createComponents(t),window.app.ensureActivePageVisible()}function we(t,e,n){let r=e.appendChild(document.createElement("li"));if(t.children){let i=[...n,t.text],s=r.appendChild(document.createElement("details"));s.className=t.class?`${t.class} tsd-index-accordion`:"tsd-index-accordion",s.dataset.key=i.join("$");let o=s.appendChild(document.createElement("summary"));o.className="tsd-accordion-summary",o.innerHTML='',Ee(t,o);let a=s.appendChild(document.createElement("div"));a.className="tsd-accordion-details";let l=a.appendChild(document.createElement("ul"));l.className="tsd-nested-navigation";for(let u of t.children)we(u,l,i)}else Ee(t,r,t.class)}function Ee(t,e,n){if(t.path){let r=e.appendChild(document.createElement("a"));r.href=Le+t.path,n&&(r.className=n),location.href===r.href&&r.classList.add("current"),t.kind&&(r.innerHTML=``),r.appendChild(document.createElement("span")).textContent=t.text}else e.appendChild(document.createElement("span")).textContent=t.text}G(X,"a[data-toggle]");G(Z,".tsd-index-accordion");G(Y,".tsd-filter-item input[type=checkbox]");var Se=document.getElementById("tsd-theme");Se&&ge(Se);var je=new U;Object.defineProperty(window,"app",{value:je});he();be();})(); /*! Bundled license information: lunr/lunr.js: diff --git a/chacha20poly1305/docs/assets/navigation.js b/chacha20poly1305/docs/assets/navigation.js new file mode 100644 index 000000000..1bdc01522 --- /dev/null +++ b/chacha20poly1305/docs/assets/navigation.js @@ -0,0 +1 @@ +window.navigationData = "data:application/octet-stream;base64,H4sIAAAAAAAAA4uuVipJrShRslJyzkhMzkg0MgjIz6k0NDYwVdJRKkgsyQDKJOckFhenFuujq9DLKMnNASrLzsxLUbIyNLKojQUAyr/DOk8AAAA=" \ No newline at end of file diff --git a/chacha20poly1305/docs/assets/search.js b/chacha20poly1305/docs/assets/search.js index bfdc29ba2..1560c5a83 100644 --- a/chacha20poly1305/docs/assets/search.js +++ b/chacha20poly1305/docs/assets/search.js @@ -1 +1 @@ -window.searchData = JSON.parse("{\"rows\":[{\"kind\":128,\"name\":\"Chacha20Poly1305\",\"url\":\"classes/Chacha20Poly1305.html\",\"classes\":\"\"},{\"kind\":512,\"name\":\"constructor\",\"url\":\"classes/Chacha20Poly1305.html#constructor\",\"classes\":\"\",\"parent\":\"Chacha20Poly1305\"},{\"kind\":1024,\"name\":\"id\",\"url\":\"classes/Chacha20Poly1305.html#id\",\"classes\":\"\",\"parent\":\"Chacha20Poly1305\"},{\"kind\":1024,\"name\":\"keySize\",\"url\":\"classes/Chacha20Poly1305.html#keySize\",\"classes\":\"\",\"parent\":\"Chacha20Poly1305\"},{\"kind\":1024,\"name\":\"nonceSize\",\"url\":\"classes/Chacha20Poly1305.html#nonceSize\",\"classes\":\"\",\"parent\":\"Chacha20Poly1305\"},{\"kind\":1024,\"name\":\"tagSize\",\"url\":\"classes/Chacha20Poly1305.html#tagSize\",\"classes\":\"\",\"parent\":\"Chacha20Poly1305\"},{\"kind\":2048,\"name\":\"createEncryptionContext\",\"url\":\"classes/Chacha20Poly1305.html#createEncryptionContext\",\"classes\":\"\",\"parent\":\"Chacha20Poly1305\"}],\"index\":{\"version\":\"2.3.9\",\"fields\":[\"name\",\"comment\"],\"fieldVectors\":[[\"name/0\",[0,16.74]],[\"comment/0\",[]],[\"name/1\",[1,16.74]],[\"comment/1\",[]],[\"name/2\",[2,16.74]],[\"comment/2\",[]],[\"name/3\",[3,16.74]],[\"comment/3\",[]],[\"name/4\",[4,16.74]],[\"comment/4\",[]],[\"name/5\",[5,16.74]],[\"comment/5\",[]],[\"name/6\",[6,16.74]],[\"comment/6\",[]]],\"invertedIndex\":[[\"chacha20poly1305\",{\"_index\":0,\"name\":{\"0\":{}},\"comment\":{}}],[\"constructor\",{\"_index\":1,\"name\":{\"1\":{}},\"comment\":{}}],[\"createencryptioncontext\",{\"_index\":6,\"name\":{\"6\":{}},\"comment\":{}}],[\"id\",{\"_index\":2,\"name\":{\"2\":{}},\"comment\":{}}],[\"keysize\",{\"_index\":3,\"name\":{\"3\":{}},\"comment\":{}}],[\"noncesize\",{\"_index\":4,\"name\":{\"4\":{}},\"comment\":{}}],[\"tagsize\",{\"_index\":5,\"name\":{\"5\":{}},\"comment\":{}}]],\"pipeline\":[]}}"); \ No newline at end of file +window.searchData = "data:application/octet-stream;base64,H4sIAAAAAAAAA6WUT2uDQBDFv8v0KsZd/7T1GnrorVDoRaTIum0kuiu6aZOK373jGt0YFAy5BMb9vfeWyew0UMnfGsKogX0mUggJfbJAJAWHELa7hO0S6rzJ/ERcxwcLDlWOByxP6prXm2vA3qkiR+p8jiS01uDsEzo6MylqVR2YktU604ep4iLAgjKpuFBz9zXhxKHemJ6lK0M1eF/Wnp/esz++MtDQ96UKKRi/IfeSvy9ZJd835Br65lTqeGZSWcUTxV8Eq06lyqTYSqH4Ua2drUX12lvFFuCl+BHCBn54VaMJctR27WcUfmU8T7tH1l8XbWVRdFbx+eyDd3PdET2yccCKHIsE9qMXx1Y0CPR3/UFTBCsyQ5EJRbGiMxSdUC5W7gzlTigPK2+G8iYULorIn6H8CRVgFcxQgaZ0R7GViqevfWexN+zc+HJcSA18nhvvDMPQgIM/bWva3FV9wsUOMUpilGRJqSeEjxPChgkxLoFxCRZcunViBNQI6IIA10Gtn4dRuUblLqj0Y77WeUbnLejwMV6rfKPy51T4L5VZyfNMIBPFbfsPveqxl1AGAAA="; \ No newline at end of file diff --git a/chacha20poly1305/docs/assets/style.css b/chacha20poly1305/docs/assets/style.css index 258146fc0..108428c3f 100644 --- a/chacha20poly1305/docs/assets/style.css +++ b/chacha20poly1305/docs/assets/style.css @@ -910,8 +910,9 @@ a.tsd-index-link { box-shadow: 0 0 4px rgba(0, 0, 0, 0.25); } #tsd-search .results li { - padding: 0 10px; background-color: var(--color-background); + line-height: initial; + padding: 4px; } #tsd-search .results li:nth-child(even) { background-color: var(--color-background-secondary); @@ -924,7 +925,10 @@ a.tsd-index-link { background-color: var(--color-accent); } #tsd-search .results a { - display: block; + display: flex; + align-items: center; + padding: 0.25rem; + box-sizing: border-box; } #tsd-search .results a:before { top: 10px; @@ -1134,7 +1138,7 @@ img { } .deprecated { - text-decoration: line-through; + text-decoration: line-through !important; } .warning { diff --git a/chacha20poly1305/docs/classes/Chacha20Poly1305.html b/chacha20poly1305/docs/classes/Chacha20Poly1305.html index 4f73e898b..c3c8b1a34 100644 --- a/chacha20poly1305/docs/classes/Chacha20Poly1305.html +++ b/chacha20poly1305/docs/classes/Chacha20Poly1305.html @@ -1,13 +1,13 @@ -Chacha20Poly1305 | @hpke/chacha20poly1305
+Chacha20Poly1305 | @hpke/chacha20poly1305
-
+
@@ -36,31 +36,31 @@

Implements

  • AeadInterface
+
  • Defined in src/aeads/chacha20Poly1305.ts:92
  • - +

    Constructors

    - +
    +
  • Defined in src/aeads/chacha20Poly1305.ts:94
  • keySize: number = 32
    @@ -84,7 +84,7 @@
    +
  • Defined in src/aeads/chacha20Poly1305.ts:96
  • nonceSize: number = 12
    @@ -93,7 +93,7 @@
    +
  • Defined in src/aeads/chacha20Poly1305.ts:98
  • tagSize: number = 16
    @@ -102,7 +102,7 @@
    +
  • Defined in src/aeads/chacha20Poly1305.ts:100
  • Methods

    @@ -118,20 +118,20 @@
    key: Returns AeadEncryptionContext
    +
  • Defined in src/aeads/chacha20Poly1305.ts:102
  • @@ -145,9 +145,9 @@

    tagSize
  • createEncryptionContext
  • +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/chacha20poly1305/docs/index.html b/chacha20poly1305/docs/index.html index c7b3d36e9..18d4476aa 100644 --- a/chacha20poly1305/docs/index.html +++ b/chacha20poly1305/docs/index.html @@ -1,13 +1,13 @@ -@hpke/chacha20poly1305
    +@hpke/chacha20poly1305
    -
    +
    @@ -70,15 +70,15 @@

    @hpke/chacha20poly1305

    @@ -105,9 +105,9 @@

    Browsers
  • Contributing
  • +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/chacha20poly1305/docs/modules.html b/chacha20poly1305/docs/modules.html index d519dcfdb..455b2f40f 100644 --- a/chacha20poly1305/docs/modules.html +++ b/chacha20poly1305/docs/modules.html @@ -1,13 +1,13 @@ -@hpke/chacha20poly1305
    +@hpke/chacha20poly1305
    -
    +
    @@ -17,27 +17,27 @@

    @hpke/chacha20poly1305

    Index

    Classes

    -
    +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/core/docs/assets/main.js b/core/docs/assets/main.js index 3cee05e61..01bcad55f 100644 --- a/core/docs/assets/main.js +++ b/core/docs/assets/main.js @@ -1,7 +1,8 @@ "use strict"; -"use strict";(()=>{var Se=Object.create;var re=Object.defineProperty;var we=Object.getOwnPropertyDescriptor;var Te=Object.getOwnPropertyNames;var ke=Object.getPrototypeOf,Qe=Object.prototype.hasOwnProperty;var Pe=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Ie=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Te(e))!Qe.call(t,i)&&i!==r&&re(t,i,{get:()=>e[i],enumerable:!(n=we(e,i))||n.enumerable});return t};var Ce=(t,e,r)=>(r=t!=null?Se(ke(t)):{},Ie(e||!t||!t.__esModule?re(r,"default",{value:t,enumerable:!0}):r,t));var ae=Pe((se,oe)=>{(function(){var t=function(e){var r=new t.Builder;return r.pipeline.add(t.trimmer,t.stopWordFilter,t.stemmer),r.searchPipeline.add(t.stemmer),e.call(r,r),r.build()};t.version="2.3.9";t.utils={},t.utils.warn=function(e){return function(r){e.console&&console.warn&&console.warn(r)}}(this),t.utils.asString=function(e){return e==null?"":e.toString()},t.utils.clone=function(e){if(e==null)return e;for(var r=Object.create(null),n=Object.keys(e),i=0;i0){var d=t.utils.clone(r)||{};d.position=[a,u],d.index=s.length,s.push(new t.Token(n.slice(a,o),d))}a=o+1}}return s},t.tokenizer.separator=/[\s\-]+/;t.Pipeline=function(){this._stack=[]},t.Pipeline.registeredFunctions=Object.create(null),t.Pipeline.registerFunction=function(e,r){r in this.registeredFunctions&&t.utils.warn("Overwriting existing registered function: "+r),e.label=r,t.Pipeline.registeredFunctions[e.label]=e},t.Pipeline.warnIfFunctionNotRegistered=function(e){var r=e.label&&e.label in this.registeredFunctions;r||t.utils.warn(`Function is not registered with pipeline. This may cause problems when serialising the index. -`,e)},t.Pipeline.load=function(e){var r=new t.Pipeline;return e.forEach(function(n){var i=t.Pipeline.registeredFunctions[n];if(i)r.add(i);else throw new Error("Cannot load unregistered function: "+n)}),r},t.Pipeline.prototype.add=function(){var e=Array.prototype.slice.call(arguments);e.forEach(function(r){t.Pipeline.warnIfFunctionNotRegistered(r),this._stack.push(r)},this)},t.Pipeline.prototype.after=function(e,r){t.Pipeline.warnIfFunctionNotRegistered(r);var n=this._stack.indexOf(e);if(n==-1)throw new Error("Cannot find existingFn");n=n+1,this._stack.splice(n,0,r)},t.Pipeline.prototype.before=function(e,r){t.Pipeline.warnIfFunctionNotRegistered(r);var n=this._stack.indexOf(e);if(n==-1)throw new Error("Cannot find existingFn");this._stack.splice(n,0,r)},t.Pipeline.prototype.remove=function(e){var r=this._stack.indexOf(e);r!=-1&&this._stack.splice(r,1)},t.Pipeline.prototype.run=function(e){for(var r=this._stack.length,n=0;n1&&(oe&&(n=s),o!=e);)i=n-r,s=r+Math.floor(i/2),o=this.elements[s*2];if(o==e||o>e)return s*2;if(ol?d+=2:a==l&&(r+=n[u+1]*i[d+1],u+=2,d+=2);return r},t.Vector.prototype.similarity=function(e){return this.dot(e)/this.magnitude()||0},t.Vector.prototype.toArray=function(){for(var e=new Array(this.elements.length/2),r=1,n=0;r0){var o=s.str.charAt(0),a;o in s.node.edges?a=s.node.edges[o]:(a=new t.TokenSet,s.node.edges[o]=a),s.str.length==1&&(a.final=!0),i.push({node:a,editsRemaining:s.editsRemaining,str:s.str.slice(1)})}if(s.editsRemaining!=0){if("*"in s.node.edges)var l=s.node.edges["*"];else{var l=new t.TokenSet;s.node.edges["*"]=l}if(s.str.length==0&&(l.final=!0),i.push({node:l,editsRemaining:s.editsRemaining-1,str:s.str}),s.str.length>1&&i.push({node:s.node,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)}),s.str.length==1&&(s.node.final=!0),s.str.length>=1){if("*"in s.node.edges)var u=s.node.edges["*"];else{var u=new t.TokenSet;s.node.edges["*"]=u}s.str.length==1&&(u.final=!0),i.push({node:u,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)})}if(s.str.length>1){var d=s.str.charAt(0),m=s.str.charAt(1),y;m in s.node.edges?y=s.node.edges[m]:(y=new t.TokenSet,s.node.edges[m]=y),s.str.length==1&&(y.final=!0),i.push({node:y,editsRemaining:s.editsRemaining-1,str:d+s.str.slice(2)})}}}return n},t.TokenSet.fromString=function(e){for(var r=new t.TokenSet,n=r,i=0,s=e.length;i=e;r--){var n=this.uncheckedNodes[r],i=n.child.toString();i in this.minimizedNodes?n.parent.edges[n.char]=this.minimizedNodes[i]:(n.child._str=i,this.minimizedNodes[i]=n.child),this.uncheckedNodes.pop()}};t.Index=function(e){this.invertedIndex=e.invertedIndex,this.fieldVectors=e.fieldVectors,this.tokenSet=e.tokenSet,this.fields=e.fields,this.pipeline=e.pipeline},t.Index.prototype.search=function(e){return this.query(function(r){var n=new t.QueryParser(e,r);n.parse()})},t.Index.prototype.query=function(e){for(var r=new t.Query(this.fields),n=Object.create(null),i=Object.create(null),s=Object.create(null),o=Object.create(null),a=Object.create(null),l=0;l1?this._b=1:this._b=e},t.Builder.prototype.k1=function(e){this._k1=e},t.Builder.prototype.add=function(e,r){var n=e[this._ref],i=Object.keys(this._fields);this._documents[n]=r||{},this.documentCount+=1;for(var s=0;s=this.length)return t.QueryLexer.EOS;var e=this.str.charAt(this.pos);return this.pos+=1,e},t.QueryLexer.prototype.width=function(){return this.pos-this.start},t.QueryLexer.prototype.ignore=function(){this.start==this.pos&&(this.pos+=1),this.start=this.pos},t.QueryLexer.prototype.backup=function(){this.pos-=1},t.QueryLexer.prototype.acceptDigitRun=function(){var e,r;do e=this.next(),r=e.charCodeAt(0);while(r>47&&r<58);e!=t.QueryLexer.EOS&&this.backup()},t.QueryLexer.prototype.more=function(){return this.pos1&&(e.backup(),e.emit(t.QueryLexer.TERM)),e.ignore(),e.more())return t.QueryLexer.lexText},t.QueryLexer.lexEditDistance=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(t.QueryLexer.EDIT_DISTANCE),t.QueryLexer.lexText},t.QueryLexer.lexBoost=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(t.QueryLexer.BOOST),t.QueryLexer.lexText},t.QueryLexer.lexEOS=function(e){e.width()>0&&e.emit(t.QueryLexer.TERM)},t.QueryLexer.termSeparator=t.tokenizer.separator,t.QueryLexer.lexText=function(e){for(;;){var r=e.next();if(r==t.QueryLexer.EOS)return t.QueryLexer.lexEOS;if(r.charCodeAt(0)==92){e.escapeCharacter();continue}if(r==":")return t.QueryLexer.lexField;if(r=="~")return e.backup(),e.width()>0&&e.emit(t.QueryLexer.TERM),t.QueryLexer.lexEditDistance;if(r=="^")return e.backup(),e.width()>0&&e.emit(t.QueryLexer.TERM),t.QueryLexer.lexBoost;if(r=="+"&&e.width()===1||r=="-"&&e.width()===1)return e.emit(t.QueryLexer.PRESENCE),t.QueryLexer.lexText;if(r.match(t.QueryLexer.termSeparator))return t.QueryLexer.lexTerm}},t.QueryParser=function(e,r){this.lexer=new t.QueryLexer(e),this.query=r,this.currentClause={},this.lexemeIdx=0},t.QueryParser.prototype.parse=function(){this.lexer.run(),this.lexemes=this.lexer.lexemes;for(var e=t.QueryParser.parseClause;e;)e=e(this);return this.query},t.QueryParser.prototype.peekLexeme=function(){return this.lexemes[this.lexemeIdx]},t.QueryParser.prototype.consumeLexeme=function(){var e=this.peekLexeme();return this.lexemeIdx+=1,e},t.QueryParser.prototype.nextClause=function(){var e=this.currentClause;this.query.clause(e),this.currentClause={}},t.QueryParser.parseClause=function(e){var r=e.peekLexeme();if(r!=null)switch(r.type){case t.QueryLexer.PRESENCE:return t.QueryParser.parsePresence;case t.QueryLexer.FIELD:return t.QueryParser.parseField;case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var n="expected either a field or a term, found "+r.type;throw r.str.length>=1&&(n+=" with value '"+r.str+"'"),new t.QueryParseError(n,r.start,r.end)}},t.QueryParser.parsePresence=function(e){var r=e.consumeLexeme();if(r!=null){switch(r.str){case"-":e.currentClause.presence=t.Query.presence.PROHIBITED;break;case"+":e.currentClause.presence=t.Query.presence.REQUIRED;break;default:var n="unrecognised presence operator'"+r.str+"'";throw new t.QueryParseError(n,r.start,r.end)}var i=e.peekLexeme();if(i==null){var n="expecting term or field, found nothing";throw new t.QueryParseError(n,r.start,r.end)}switch(i.type){case t.QueryLexer.FIELD:return t.QueryParser.parseField;case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var n="expecting term or field, found '"+i.type+"'";throw new t.QueryParseError(n,i.start,i.end)}}},t.QueryParser.parseField=function(e){var r=e.consumeLexeme();if(r!=null){if(e.query.allFields.indexOf(r.str)==-1){var n=e.query.allFields.map(function(o){return"'"+o+"'"}).join(", "),i="unrecognised field '"+r.str+"', possible fields: "+n;throw new t.QueryParseError(i,r.start,r.end)}e.currentClause.fields=[r.str];var s=e.peekLexeme();if(s==null){var i="expecting term, found nothing";throw new t.QueryParseError(i,r.start,r.end)}switch(s.type){case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var i="expecting term, found '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},t.QueryParser.parseTerm=function(e){var r=e.consumeLexeme();if(r!=null){e.currentClause.term=r.str.toLowerCase(),r.str.indexOf("*")!=-1&&(e.currentClause.usePipeline=!1);var n=e.peekLexeme();if(n==null){e.nextClause();return}switch(n.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+n.type+"'";throw new t.QueryParseError(i,n.start,n.end)}}},t.QueryParser.parseEditDistance=function(e){var r=e.consumeLexeme();if(r!=null){var n=parseInt(r.str,10);if(isNaN(n)){var i="edit distance must be numeric";throw new t.QueryParseError(i,r.start,r.end)}e.currentClause.editDistance=n;var s=e.peekLexeme();if(s==null){e.nextClause();return}switch(s.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},t.QueryParser.parseBoost=function(e){var r=e.consumeLexeme();if(r!=null){var n=parseInt(r.str,10);if(isNaN(n)){var i="boost must be numeric";throw new t.QueryParseError(i,r.start,r.end)}e.currentClause.boost=n;var s=e.peekLexeme();if(s==null){e.nextClause();return}switch(s.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},function(e,r){typeof define=="function"&&define.amd?define(r):typeof se=="object"?oe.exports=r():e.lunr=r()}(this,function(){return t})})()});var ne=[];function G(t,e){ne.push({selector:e,constructor:t})}var U=class{constructor(){this.alwaysVisibleMember=null;this.createComponents(document.body),this.ensureActivePageVisible(),this.ensureFocusedElementVisible(),this.listenForCodeCopies(),window.addEventListener("hashchange",()=>this.ensureFocusedElementVisible())}createComponents(e){ne.forEach(r=>{e.querySelectorAll(r.selector).forEach(n=>{n.dataset.hasInstance||(new r.constructor({el:n,app:this}),n.dataset.hasInstance=String(!0))})})}filterChanged(){this.ensureFocusedElementVisible()}ensureActivePageVisible(){let e=document.querySelector(".tsd-navigation .current"),r=e?.parentElement;for(;r&&!r.classList.contains(".tsd-navigation");)r instanceof HTMLDetailsElement&&(r.open=!0),r=r.parentElement;if(e){let n=e.getBoundingClientRect().top-document.documentElement.clientHeight/4;document.querySelector(".site-menu").scrollTop=n}}ensureFocusedElementVisible(){if(this.alwaysVisibleMember&&(this.alwaysVisibleMember.classList.remove("always-visible"),this.alwaysVisibleMember.firstElementChild.remove(),this.alwaysVisibleMember=null),!location.hash)return;let e=document.getElementById(location.hash.substring(1));if(!e)return;let r=e.parentElement;for(;r&&r.tagName!=="SECTION";)r=r.parentElement;if(r&&r.offsetParent==null){this.alwaysVisibleMember=r,r.classList.add("always-visible");let n=document.createElement("p");n.classList.add("warning"),n.textContent="This member is normally hidden due to your filter settings.",r.prepend(n)}}listenForCodeCopies(){document.querySelectorAll("pre > button").forEach(e=>{let r;e.addEventListener("click",()=>{e.previousElementSibling instanceof HTMLElement&&navigator.clipboard.writeText(e.previousElementSibling.innerText.trim()),e.textContent="Copied!",e.classList.add("visible"),clearTimeout(r),r=setTimeout(()=>{e.classList.remove("visible"),r=setTimeout(()=>{e.textContent="Copy"},100)},1e3)})})}};var ie=(t,e=100)=>{let r;return()=>{clearTimeout(r),r=setTimeout(()=>t(),e)}};var ce=Ce(ae());function de(){let t=document.getElementById("tsd-search");if(!t)return;let e=document.getElementById("tsd-search-script");t.classList.add("loading"),e&&(e.addEventListener("error",()=>{t.classList.remove("loading"),t.classList.add("failure")}),e.addEventListener("load",()=>{t.classList.remove("loading"),t.classList.add("ready")}),window.searchData&&t.classList.remove("loading"));let r=document.querySelector("#tsd-search input"),n=document.querySelector("#tsd-search .results");if(!r||!n)throw new Error("The input field or the result list wrapper was not found");let i=!1;n.addEventListener("mousedown",()=>i=!0),n.addEventListener("mouseup",()=>{i=!1,t.classList.remove("has-focus")}),r.addEventListener("focus",()=>t.classList.add("has-focus")),r.addEventListener("blur",()=>{i||(i=!1,t.classList.remove("has-focus"))});let s={base:t.dataset.base+"/"};Oe(t,n,r,s)}function Oe(t,e,r,n){r.addEventListener("input",ie(()=>{Re(t,e,r,n)},200));let i=!1;r.addEventListener("keydown",s=>{i=!0,s.key=="Enter"?Fe(e,r):s.key=="Escape"?r.blur():s.key=="ArrowUp"?ue(e,-1):s.key==="ArrowDown"?ue(e,1):i=!1}),r.addEventListener("keypress",s=>{i&&s.preventDefault()}),document.body.addEventListener("keydown",s=>{s.altKey||s.ctrlKey||s.metaKey||!r.matches(":focus")&&s.key==="/"&&(r.focus(),s.preventDefault())})}function _e(t,e){t.index||window.searchData&&(e.classList.remove("loading"),e.classList.add("ready"),t.data=window.searchData,t.index=ce.Index.load(window.searchData.index))}function Re(t,e,r,n){if(_e(n,t),!n.index||!n.data)return;e.textContent="";let i=r.value.trim(),s=i?n.index.search(`*${i}*`):[];for(let o=0;oa.score-o.score);for(let o=0,a=Math.min(10,s.length);o${le(l.parent,i)}.${u}`);let d=document.createElement("li");d.classList.value=l.classes??"";let m=document.createElement("a");m.href=n.base+l.url,m.innerHTML=u,d.append(m),e.appendChild(d)}}function ue(t,e){let r=t.querySelector(".current");if(!r)r=t.querySelector(e==1?"li:first-child":"li:last-child"),r&&r.classList.add("current");else{let n=r;if(e===1)do n=n.nextElementSibling??void 0;while(n instanceof HTMLElement&&n.offsetParent==null);else do n=n.previousElementSibling??void 0;while(n instanceof HTMLElement&&n.offsetParent==null);n&&(r.classList.remove("current"),n.classList.add("current"))}}function Fe(t,e){let r=t.querySelector(".current");if(r||(r=t.querySelector("li:first-child")),r){let n=r.querySelector("a");n&&(window.location.href=n.href),e.blur()}}function le(t,e){if(e==="")return t;let r=t.toLocaleLowerCase(),n=e.toLocaleLowerCase(),i=[],s=0,o=r.indexOf(n);for(;o!=-1;)i.push(K(t.substring(s,o)),`${K(t.substring(o,o+n.length))}`),s=o+n.length,o=r.indexOf(n,s);return i.push(K(t.substring(s))),i.join("")}var Me={"&":"&","<":"<",">":">","'":"'",'"':"""};function K(t){return t.replace(/[&<>"'"]/g,e=>Me[e])}var P=class{constructor(e){this.el=e.el,this.app=e.app}};var M="mousedown",fe="mousemove",N="mouseup",J={x:0,y:0},he=!1,ee=!1,De=!1,D=!1,pe=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);document.documentElement.classList.add(pe?"is-mobile":"not-mobile");pe&&"ontouchstart"in document.documentElement&&(De=!0,M="touchstart",fe="touchmove",N="touchend");document.addEventListener(M,t=>{ee=!0,D=!1;let e=M=="touchstart"?t.targetTouches[0]:t;J.y=e.pageY||0,J.x=e.pageX||0});document.addEventListener(fe,t=>{if(ee&&!D){let e=M=="touchstart"?t.targetTouches[0]:t,r=J.x-(e.pageX||0),n=J.y-(e.pageY||0);D=Math.sqrt(r*r+n*n)>10}});document.addEventListener(N,()=>{ee=!1});document.addEventListener("click",t=>{he&&(t.preventDefault(),t.stopImmediatePropagation(),he=!1)});var X=class extends P{constructor(r){super(r);this.className=this.el.dataset.toggle||"",this.el.addEventListener(N,n=>this.onPointerUp(n)),this.el.addEventListener("click",n=>n.preventDefault()),document.addEventListener(M,n=>this.onDocumentPointerDown(n)),document.addEventListener(N,n=>this.onDocumentPointerUp(n))}setActive(r){if(this.active==r)return;this.active=r,document.documentElement.classList.toggle("has-"+this.className,r),this.el.classList.toggle("active",r);let n=(this.active?"to-has-":"from-has-")+this.className;document.documentElement.classList.add(n),setTimeout(()=>document.documentElement.classList.remove(n),500)}onPointerUp(r){D||(this.setActive(!0),r.preventDefault())}onDocumentPointerDown(r){if(this.active){if(r.target.closest(".col-sidebar, .tsd-filter-group"))return;this.setActive(!1)}}onDocumentPointerUp(r){if(!D&&this.active&&r.target.closest(".col-sidebar")){let n=r.target.closest("a");if(n){let i=window.location.href;i.indexOf("#")!=-1&&(i=i.substring(0,i.indexOf("#"))),n.href.substring(0,i.length)==i&&setTimeout(()=>this.setActive(!1),250)}}}};var te;try{te=localStorage}catch{te={getItem(){return null},setItem(){}}}var Q=te;var me=document.head.appendChild(document.createElement("style"));me.dataset.for="filters";var Y=class extends P{constructor(r){super(r);this.key=`filter-${this.el.name}`,this.value=this.el.checked,this.el.addEventListener("change",()=>{this.setLocalStorage(this.el.checked)}),this.setLocalStorage(this.fromLocalStorage()),me.innerHTML+=`html:not(.${this.key}) .tsd-is-${this.el.name} { display: none; } -`}fromLocalStorage(){let r=Q.getItem(this.key);return r?r==="true":this.el.checked}setLocalStorage(r){Q.setItem(this.key,r.toString()),this.value=r,this.handleValueChange()}handleValueChange(){this.el.checked=this.value,document.documentElement.classList.toggle(this.key,this.value),this.app.filterChanged(),document.querySelectorAll(".tsd-index-section").forEach(r=>{r.style.display="block";let n=Array.from(r.querySelectorAll(".tsd-index-link")).every(i=>i.offsetParent==null);r.style.display=n?"none":"block"})}};var Z=class extends P{constructor(r){super(r);this.summary=this.el.querySelector(".tsd-accordion-summary"),this.icon=this.summary.querySelector("svg"),this.key=`tsd-accordion-${this.summary.dataset.key??this.summary.textContent.trim().replace(/\s+/g,"-").toLowerCase()}`;let n=Q.getItem(this.key);this.el.open=n?n==="true":this.el.open,this.el.addEventListener("toggle",()=>this.update()),this.update()}update(){this.icon.style.transform=`rotate(${this.el.open?0:-90}deg)`,Q.setItem(this.key,this.el.open.toString())}};function ve(t){let e=Q.getItem("tsd-theme")||"os";t.value=e,ye(e),t.addEventListener("change",()=>{Q.setItem("tsd-theme",t.value),ye(t.value)})}function ye(t){document.documentElement.dataset.theme=t}de();G(X,"a[data-toggle]");G(Z,".tsd-index-accordion");G(Y,".tsd-filter-item input[type=checkbox]");var ge=document.getElementById("tsd-theme");ge&&ve(ge);var Ae=new U;Object.defineProperty(window,"app",{value:Ae});document.querySelectorAll("summary a").forEach(t=>{t.addEventListener("click",()=>{location.assign(t.href)})});})(); +"use strict";(()=>{var Pe=Object.create;var ne=Object.defineProperty;var Ie=Object.getOwnPropertyDescriptor;var Oe=Object.getOwnPropertyNames;var _e=Object.getPrototypeOf,Re=Object.prototype.hasOwnProperty;var Me=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Fe=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Oe(e))!Re.call(t,i)&&i!==n&&ne(t,i,{get:()=>e[i],enumerable:!(r=Ie(e,i))||r.enumerable});return t};var De=(t,e,n)=>(n=t!=null?Pe(_e(t)):{},Fe(e||!t||!t.__esModule?ne(n,"default",{value:t,enumerable:!0}):n,t));var ae=Me((se,oe)=>{(function(){var t=function(e){var n=new t.Builder;return n.pipeline.add(t.trimmer,t.stopWordFilter,t.stemmer),n.searchPipeline.add(t.stemmer),e.call(n,n),n.build()};t.version="2.3.9";t.utils={},t.utils.warn=function(e){return function(n){e.console&&console.warn&&console.warn(n)}}(this),t.utils.asString=function(e){return e==null?"":e.toString()},t.utils.clone=function(e){if(e==null)return e;for(var n=Object.create(null),r=Object.keys(e),i=0;i0){var d=t.utils.clone(n)||{};d.position=[a,u],d.index=s.length,s.push(new t.Token(r.slice(a,o),d))}a=o+1}}return s},t.tokenizer.separator=/[\s\-]+/;t.Pipeline=function(){this._stack=[]},t.Pipeline.registeredFunctions=Object.create(null),t.Pipeline.registerFunction=function(e,n){n in this.registeredFunctions&&t.utils.warn("Overwriting existing registered function: "+n),e.label=n,t.Pipeline.registeredFunctions[e.label]=e},t.Pipeline.warnIfFunctionNotRegistered=function(e){var n=e.label&&e.label in this.registeredFunctions;n||t.utils.warn(`Function is not registered with pipeline. This may cause problems when serialising the index. +`,e)},t.Pipeline.load=function(e){var n=new t.Pipeline;return e.forEach(function(r){var i=t.Pipeline.registeredFunctions[r];if(i)n.add(i);else throw new Error("Cannot load unregistered function: "+r)}),n},t.Pipeline.prototype.add=function(){var e=Array.prototype.slice.call(arguments);e.forEach(function(n){t.Pipeline.warnIfFunctionNotRegistered(n),this._stack.push(n)},this)},t.Pipeline.prototype.after=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var r=this._stack.indexOf(e);if(r==-1)throw new Error("Cannot find existingFn");r=r+1,this._stack.splice(r,0,n)},t.Pipeline.prototype.before=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var r=this._stack.indexOf(e);if(r==-1)throw new Error("Cannot find existingFn");this._stack.splice(r,0,n)},t.Pipeline.prototype.remove=function(e){var n=this._stack.indexOf(e);n!=-1&&this._stack.splice(n,1)},t.Pipeline.prototype.run=function(e){for(var n=this._stack.length,r=0;r1&&(oe&&(r=s),o!=e);)i=r-n,s=n+Math.floor(i/2),o=this.elements[s*2];if(o==e||o>e)return s*2;if(ol?d+=2:a==l&&(n+=r[u+1]*i[d+1],u+=2,d+=2);return n},t.Vector.prototype.similarity=function(e){return this.dot(e)/this.magnitude()||0},t.Vector.prototype.toArray=function(){for(var e=new Array(this.elements.length/2),n=1,r=0;n0){var o=s.str.charAt(0),a;o in s.node.edges?a=s.node.edges[o]:(a=new t.TokenSet,s.node.edges[o]=a),s.str.length==1&&(a.final=!0),i.push({node:a,editsRemaining:s.editsRemaining,str:s.str.slice(1)})}if(s.editsRemaining!=0){if("*"in s.node.edges)var l=s.node.edges["*"];else{var l=new t.TokenSet;s.node.edges["*"]=l}if(s.str.length==0&&(l.final=!0),i.push({node:l,editsRemaining:s.editsRemaining-1,str:s.str}),s.str.length>1&&i.push({node:s.node,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)}),s.str.length==1&&(s.node.final=!0),s.str.length>=1){if("*"in s.node.edges)var u=s.node.edges["*"];else{var u=new t.TokenSet;s.node.edges["*"]=u}s.str.length==1&&(u.final=!0),i.push({node:u,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)})}if(s.str.length>1){var d=s.str.charAt(0),v=s.str.charAt(1),f;v in s.node.edges?f=s.node.edges[v]:(f=new t.TokenSet,s.node.edges[v]=f),s.str.length==1&&(f.final=!0),i.push({node:f,editsRemaining:s.editsRemaining-1,str:d+s.str.slice(2)})}}}return r},t.TokenSet.fromString=function(e){for(var n=new t.TokenSet,r=n,i=0,s=e.length;i=e;n--){var r=this.uncheckedNodes[n],i=r.child.toString();i in this.minimizedNodes?r.parent.edges[r.char]=this.minimizedNodes[i]:(r.child._str=i,this.minimizedNodes[i]=r.child),this.uncheckedNodes.pop()}};t.Index=function(e){this.invertedIndex=e.invertedIndex,this.fieldVectors=e.fieldVectors,this.tokenSet=e.tokenSet,this.fields=e.fields,this.pipeline=e.pipeline},t.Index.prototype.search=function(e){return this.query(function(n){var r=new t.QueryParser(e,n);r.parse()})},t.Index.prototype.query=function(e){for(var n=new t.Query(this.fields),r=Object.create(null),i=Object.create(null),s=Object.create(null),o=Object.create(null),a=Object.create(null),l=0;l1?this._b=1:this._b=e},t.Builder.prototype.k1=function(e){this._k1=e},t.Builder.prototype.add=function(e,n){var r=e[this._ref],i=Object.keys(this._fields);this._documents[r]=n||{},this.documentCount+=1;for(var s=0;s=this.length)return t.QueryLexer.EOS;var e=this.str.charAt(this.pos);return this.pos+=1,e},t.QueryLexer.prototype.width=function(){return this.pos-this.start},t.QueryLexer.prototype.ignore=function(){this.start==this.pos&&(this.pos+=1),this.start=this.pos},t.QueryLexer.prototype.backup=function(){this.pos-=1},t.QueryLexer.prototype.acceptDigitRun=function(){var e,n;do e=this.next(),n=e.charCodeAt(0);while(n>47&&n<58);e!=t.QueryLexer.EOS&&this.backup()},t.QueryLexer.prototype.more=function(){return this.pos1&&(e.backup(),e.emit(t.QueryLexer.TERM)),e.ignore(),e.more())return t.QueryLexer.lexText},t.QueryLexer.lexEditDistance=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(t.QueryLexer.EDIT_DISTANCE),t.QueryLexer.lexText},t.QueryLexer.lexBoost=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(t.QueryLexer.BOOST),t.QueryLexer.lexText},t.QueryLexer.lexEOS=function(e){e.width()>0&&e.emit(t.QueryLexer.TERM)},t.QueryLexer.termSeparator=t.tokenizer.separator,t.QueryLexer.lexText=function(e){for(;;){var n=e.next();if(n==t.QueryLexer.EOS)return t.QueryLexer.lexEOS;if(n.charCodeAt(0)==92){e.escapeCharacter();continue}if(n==":")return t.QueryLexer.lexField;if(n=="~")return e.backup(),e.width()>0&&e.emit(t.QueryLexer.TERM),t.QueryLexer.lexEditDistance;if(n=="^")return e.backup(),e.width()>0&&e.emit(t.QueryLexer.TERM),t.QueryLexer.lexBoost;if(n=="+"&&e.width()===1||n=="-"&&e.width()===1)return e.emit(t.QueryLexer.PRESENCE),t.QueryLexer.lexText;if(n.match(t.QueryLexer.termSeparator))return t.QueryLexer.lexTerm}},t.QueryParser=function(e,n){this.lexer=new t.QueryLexer(e),this.query=n,this.currentClause={},this.lexemeIdx=0},t.QueryParser.prototype.parse=function(){this.lexer.run(),this.lexemes=this.lexer.lexemes;for(var e=t.QueryParser.parseClause;e;)e=e(this);return this.query},t.QueryParser.prototype.peekLexeme=function(){return this.lexemes[this.lexemeIdx]},t.QueryParser.prototype.consumeLexeme=function(){var e=this.peekLexeme();return this.lexemeIdx+=1,e},t.QueryParser.prototype.nextClause=function(){var e=this.currentClause;this.query.clause(e),this.currentClause={}},t.QueryParser.parseClause=function(e){var n=e.peekLexeme();if(n!=null)switch(n.type){case t.QueryLexer.PRESENCE:return t.QueryParser.parsePresence;case t.QueryLexer.FIELD:return t.QueryParser.parseField;case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var r="expected either a field or a term, found "+n.type;throw n.str.length>=1&&(r+=" with value '"+n.str+"'"),new t.QueryParseError(r,n.start,n.end)}},t.QueryParser.parsePresence=function(e){var n=e.consumeLexeme();if(n!=null){switch(n.str){case"-":e.currentClause.presence=t.Query.presence.PROHIBITED;break;case"+":e.currentClause.presence=t.Query.presence.REQUIRED;break;default:var r="unrecognised presence operator'"+n.str+"'";throw new t.QueryParseError(r,n.start,n.end)}var i=e.peekLexeme();if(i==null){var r="expecting term or field, found nothing";throw new t.QueryParseError(r,n.start,n.end)}switch(i.type){case t.QueryLexer.FIELD:return t.QueryParser.parseField;case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var r="expecting term or field, found '"+i.type+"'";throw new t.QueryParseError(r,i.start,i.end)}}},t.QueryParser.parseField=function(e){var n=e.consumeLexeme();if(n!=null){if(e.query.allFields.indexOf(n.str)==-1){var r=e.query.allFields.map(function(o){return"'"+o+"'"}).join(", "),i="unrecognised field '"+n.str+"', possible fields: "+r;throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.fields=[n.str];var s=e.peekLexeme();if(s==null){var i="expecting term, found nothing";throw new t.QueryParseError(i,n.start,n.end)}switch(s.type){case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var i="expecting term, found '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},t.QueryParser.parseTerm=function(e){var n=e.consumeLexeme();if(n!=null){e.currentClause.term=n.str.toLowerCase(),n.str.indexOf("*")!=-1&&(e.currentClause.usePipeline=!1);var r=e.peekLexeme();if(r==null){e.nextClause();return}switch(r.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+r.type+"'";throw new t.QueryParseError(i,r.start,r.end)}}},t.QueryParser.parseEditDistance=function(e){var n=e.consumeLexeme();if(n!=null){var r=parseInt(n.str,10);if(isNaN(r)){var i="edit distance must be numeric";throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.editDistance=r;var s=e.peekLexeme();if(s==null){e.nextClause();return}switch(s.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},t.QueryParser.parseBoost=function(e){var n=e.consumeLexeme();if(n!=null){var r=parseInt(n.str,10);if(isNaN(r)){var i="boost must be numeric";throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.boost=r;var s=e.peekLexeme();if(s==null){e.nextClause();return}switch(s.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},function(e,n){typeof define=="function"&&define.amd?define(n):typeof se=="object"?oe.exports=n():e.lunr=n()}(this,function(){return t})})()});var re=[];function G(t,e){re.push({selector:e,constructor:t})}var U=class{constructor(){this.alwaysVisibleMember=null;this.createComponents(document.body),this.ensureActivePageVisible(),this.ensureFocusedElementVisible(),this.listenForCodeCopies(),window.addEventListener("hashchange",()=>this.ensureFocusedElementVisible())}createComponents(e){re.forEach(n=>{e.querySelectorAll(n.selector).forEach(r=>{r.dataset.hasInstance||(new n.constructor({el:r,app:this}),r.dataset.hasInstance=String(!0))})})}filterChanged(){this.ensureFocusedElementVisible()}ensureActivePageVisible(){let e=document.querySelector(".tsd-navigation .current"),n=e?.parentElement;for(;n&&!n.classList.contains(".tsd-navigation");)n instanceof HTMLDetailsElement&&(n.open=!0),n=n.parentElement;if(e){let r=e.getBoundingClientRect().top-document.documentElement.clientHeight/4;document.querySelector(".site-menu").scrollTop=r}}ensureFocusedElementVisible(){if(this.alwaysVisibleMember&&(this.alwaysVisibleMember.classList.remove("always-visible"),this.alwaysVisibleMember.firstElementChild.remove(),this.alwaysVisibleMember=null),!location.hash)return;let e=document.getElementById(location.hash.substring(1));if(!e)return;let n=e.parentElement;for(;n&&n.tagName!=="SECTION";)n=n.parentElement;if(n&&n.offsetParent==null){this.alwaysVisibleMember=n,n.classList.add("always-visible");let r=document.createElement("p");r.classList.add("warning"),r.textContent="This member is normally hidden due to your filter settings.",n.prepend(r)}}listenForCodeCopies(){document.querySelectorAll("pre > button").forEach(e=>{let n;e.addEventListener("click",()=>{e.previousElementSibling instanceof HTMLElement&&navigator.clipboard.writeText(e.previousElementSibling.innerText.trim()),e.textContent="Copied!",e.classList.add("visible"),clearTimeout(n),n=setTimeout(()=>{e.classList.remove("visible"),n=setTimeout(()=>{e.textContent="Copy"},100)},1e3)})})}};var ie=(t,e=100)=>{let n;return()=>{clearTimeout(n),n=setTimeout(()=>t(),e)}};var de=De(ae());async function le(t,e){if(!window.searchData)return;let n=await fetch(window.searchData),r=new Blob([await n.arrayBuffer()]).stream().pipeThrough(new DecompressionStream("gzip")),i=await new Response(r).json();t.data=i,t.index=de.Index.load(i.index),e.classList.remove("loading"),e.classList.add("ready")}function he(){let t=document.getElementById("tsd-search");if(!t)return;let e={base:t.dataset.base+"/"},n=document.getElementById("tsd-search-script");t.classList.add("loading"),n&&(n.addEventListener("error",()=>{t.classList.remove("loading"),t.classList.add("failure")}),n.addEventListener("load",()=>{le(e,t)}),le(e,t));let r=document.querySelector("#tsd-search input"),i=document.querySelector("#tsd-search .results");if(!r||!i)throw new Error("The input field or the result list wrapper was not found");let s=!1;i.addEventListener("mousedown",()=>s=!0),i.addEventListener("mouseup",()=>{s=!1,t.classList.remove("has-focus")}),r.addEventListener("focus",()=>t.classList.add("has-focus")),r.addEventListener("blur",()=>{s||(s=!1,t.classList.remove("has-focus"))}),Ae(t,i,r,e)}function Ae(t,e,n,r){n.addEventListener("input",ie(()=>{Ne(t,e,n,r)},200));let i=!1;n.addEventListener("keydown",s=>{i=!0,s.key=="Enter"?Ve(e,n):s.key=="Escape"?n.blur():s.key=="ArrowUp"?ue(e,-1):s.key==="ArrowDown"?ue(e,1):i=!1}),n.addEventListener("keypress",s=>{i&&s.preventDefault()}),document.body.addEventListener("keydown",s=>{s.altKey||s.ctrlKey||s.metaKey||!n.matches(":focus")&&s.key==="/"&&(n.focus(),s.preventDefault())})}function Ne(t,e,n,r){if(!r.index||!r.data)return;e.textContent="";let i=n.value.trim(),s=i?r.index.search(`*${i}*`):[];for(let o=0;oa.score-o.score);for(let o=0,a=Math.min(10,s.length);o`,d=ce(l.name,i);globalThis.DEBUG_SEARCH_WEIGHTS&&(d+=` (score: ${s[o].score.toFixed(2)})`),l.parent&&(d=` + ${ce(l.parent,i)}.${d}`);let v=document.createElement("li");v.classList.value=l.classes??"";let f=document.createElement("a");f.href=r.base+l.url,f.innerHTML=u+d,v.append(f),e.appendChild(v)}}function ue(t,e){let n=t.querySelector(".current");if(!n)n=t.querySelector(e==1?"li:first-child":"li:last-child"),n&&n.classList.add("current");else{let r=n;if(e===1)do r=r.nextElementSibling??void 0;while(r instanceof HTMLElement&&r.offsetParent==null);else do r=r.previousElementSibling??void 0;while(r instanceof HTMLElement&&r.offsetParent==null);r&&(n.classList.remove("current"),r.classList.add("current"))}}function Ve(t,e){let n=t.querySelector(".current");if(n||(n=t.querySelector("li:first-child")),n){let r=n.querySelector("a");r&&(window.location.href=r.href),e.blur()}}function ce(t,e){if(e==="")return t;let n=t.toLocaleLowerCase(),r=e.toLocaleLowerCase(),i=[],s=0,o=n.indexOf(r);for(;o!=-1;)i.push(K(t.substring(s,o)),`${K(t.substring(o,o+r.length))}`),s=o+r.length,o=n.indexOf(r,s);return i.push(K(t.substring(s))),i.join("")}var Be={"&":"&","<":"<",">":">","'":"'",'"':"""};function K(t){return t.replace(/[&<>"'"]/g,e=>Be[e])}var C=class{constructor(e){this.el=e.el,this.app=e.app}};var F="mousedown",pe="mousemove",B="mouseup",J={x:0,y:0},fe=!1,ee=!1,He=!1,D=!1,me=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);document.documentElement.classList.add(me?"is-mobile":"not-mobile");me&&"ontouchstart"in document.documentElement&&(He=!0,F="touchstart",pe="touchmove",B="touchend");document.addEventListener(F,t=>{ee=!0,D=!1;let e=F=="touchstart"?t.targetTouches[0]:t;J.y=e.pageY||0,J.x=e.pageX||0});document.addEventListener(pe,t=>{if(ee&&!D){let e=F=="touchstart"?t.targetTouches[0]:t,n=J.x-(e.pageX||0),r=J.y-(e.pageY||0);D=Math.sqrt(n*n+r*r)>10}});document.addEventListener(B,()=>{ee=!1});document.addEventListener("click",t=>{fe&&(t.preventDefault(),t.stopImmediatePropagation(),fe=!1)});var X=class extends C{constructor(n){super(n);this.className=this.el.dataset.toggle||"",this.el.addEventListener(B,r=>this.onPointerUp(r)),this.el.addEventListener("click",r=>r.preventDefault()),document.addEventListener(F,r=>this.onDocumentPointerDown(r)),document.addEventListener(B,r=>this.onDocumentPointerUp(r))}setActive(n){if(this.active==n)return;this.active=n,document.documentElement.classList.toggle("has-"+this.className,n),this.el.classList.toggle("active",n);let r=(this.active?"to-has-":"from-has-")+this.className;document.documentElement.classList.add(r),setTimeout(()=>document.documentElement.classList.remove(r),500)}onPointerUp(n){D||(this.setActive(!0),n.preventDefault())}onDocumentPointerDown(n){if(this.active){if(n.target.closest(".col-sidebar, .tsd-filter-group"))return;this.setActive(!1)}}onDocumentPointerUp(n){if(!D&&this.active&&n.target.closest(".col-sidebar")){let r=n.target.closest("a");if(r){let i=window.location.href;i.indexOf("#")!=-1&&(i=i.substring(0,i.indexOf("#"))),r.href.substring(0,i.length)==i&&setTimeout(()=>this.setActive(!1),250)}}}};var te;try{te=localStorage}catch{te={getItem(){return null},setItem(){}}}var Q=te;var ve=document.head.appendChild(document.createElement("style"));ve.dataset.for="filters";var Y=class extends C{constructor(n){super(n);this.key=`filter-${this.el.name}`,this.value=this.el.checked,this.el.addEventListener("change",()=>{this.setLocalStorage(this.el.checked)}),this.setLocalStorage(this.fromLocalStorage()),ve.innerHTML+=`html:not(.${this.key}) .tsd-is-${this.el.name} { display: none; } +`}fromLocalStorage(){let n=Q.getItem(this.key);return n?n==="true":this.el.checked}setLocalStorage(n){Q.setItem(this.key,n.toString()),this.value=n,this.handleValueChange()}handleValueChange(){this.el.checked=this.value,document.documentElement.classList.toggle(this.key,this.value),this.app.filterChanged(),document.querySelectorAll(".tsd-index-section").forEach(n=>{n.style.display="block";let r=Array.from(n.querySelectorAll(".tsd-index-link")).every(i=>i.offsetParent==null);n.style.display=r?"none":"block"})}};var Z=class extends C{constructor(n){super(n);this.summary=this.el.querySelector(".tsd-accordion-summary"),this.icon=this.summary.querySelector("svg"),this.key=`tsd-accordion-${this.summary.dataset.key??this.summary.textContent.trim().replace(/\s+/g,"-").toLowerCase()}`;let r=Q.getItem(this.key);this.el.open=r?r==="true":this.el.open,this.el.addEventListener("toggle",()=>this.update());let i=this.summary.querySelector("a");i&&i.addEventListener("click",()=>{location.assign(i.href)}),this.update()}update(){this.icon.style.transform=`rotate(${this.el.open?0:-90}deg)`,Q.setItem(this.key,this.el.open.toString())}};function ge(t){let e=Q.getItem("tsd-theme")||"os";t.value=e,ye(e),t.addEventListener("change",()=>{Q.setItem("tsd-theme",t.value),ye(t.value)})}function ye(t){document.documentElement.dataset.theme=t}var Le;function be(){let t=document.getElementById("tsd-nav-script");t&&(t.addEventListener("load",xe),xe())}async function xe(){let t=document.getElementById("tsd-nav-container");if(!t||!window.navigationData)return;let n=await(await fetch(window.navigationData)).arrayBuffer(),r=new Blob([n]).stream().pipeThrough(new DecompressionStream("gzip")),i=await new Response(r).json();Le=t.dataset.base+"/",t.innerHTML="";for(let s of i)we(s,t,[]);window.app.createComponents(t),window.app.ensureActivePageVisible()}function we(t,e,n){let r=e.appendChild(document.createElement("li"));if(t.children){let i=[...n,t.text],s=r.appendChild(document.createElement("details"));s.className=t.class?`${t.class} tsd-index-accordion`:"tsd-index-accordion",s.dataset.key=i.join("$");let o=s.appendChild(document.createElement("summary"));o.className="tsd-accordion-summary",o.innerHTML='',Ee(t,o);let a=s.appendChild(document.createElement("div"));a.className="tsd-accordion-details";let l=a.appendChild(document.createElement("ul"));l.className="tsd-nested-navigation";for(let u of t.children)we(u,l,i)}else Ee(t,r,t.class)}function Ee(t,e,n){if(t.path){let r=e.appendChild(document.createElement("a"));r.href=Le+t.path,n&&(r.className=n),location.href===r.href&&r.classList.add("current"),t.kind&&(r.innerHTML=``),r.appendChild(document.createElement("span")).textContent=t.text}else e.appendChild(document.createElement("span")).textContent=t.text}G(X,"a[data-toggle]");G(Z,".tsd-index-accordion");G(Y,".tsd-filter-item input[type=checkbox]");var Se=document.getElementById("tsd-theme");Se&&ge(Se);var je=new U;Object.defineProperty(window,"app",{value:je});he();be();})(); /*! Bundled license information: lunr/lunr.js: diff --git a/core/docs/assets/navigation.js b/core/docs/assets/navigation.js new file mode 100644 index 000000000..75712abd3 --- /dev/null +++ b/core/docs/assets/navigation.js @@ -0,0 +1 @@ +window.navigationData = "data:application/octet-stream;base64,H4sIAAAAAAAAA5WV3W+bMBTF/xeeuw/o0nV5a7NqjdKtUZD6UvXBxTfDChjLdqNm0/73GZrwYbgX+pb4nPMT3GObx7+BhVcbzIMrMGF0+SPJg7NAMZu6pSRjxoD5VEsfU5tnTt8JyYO5W/t31s5Hswss/yZR+Wtm4EbrQvfztUTlF0KloOMXYaFPaIkU4zskTCEP0Wg0QYs9rOCwZkKjJN9DE43zs0z8wcbjO0hauoN87dq43fFtnDL3awDYN40zzy+/HO3uF8bsmMaZsyg82mdhhDE7Jop5I/F2G40kvKpCWwzRiOOMe5kdMESpUQSqummNUUVN64eqZVobt2qHbehaovJLuXdbnq+ZZjnC6Vko3k8whv2GO5ELuwGWpMARLOak6L8KG7+osl0U27NQvHsFEuHUEpWPgWVIvpboPH0nxZNvpIeyImZFgb2PZ6C/QYy7k6wPqrQvClmt10Th/ustS6pP0oCzi3ZnyEMvT3kUWTsoVOtjVG1NM4jruSYiy/o2YFQhzfBzIl4KP22m75rnim/pcbYNJAjyEVDLQIHWGtytpYG7L/MgqG2gQBtIhBIg7XEMRMnDVgoeg+SgqRo6jsko4iEHfKMnhTcke1Cn08G93OdvX8NZ5O2KXrRaHE26lvvJcnEs6XfgQ3x9jOe//565q/A5q2fwIewSzokBNNlKoKPdCbSipTAQffoPGAwqjP0LAAA=" \ No newline at end of file diff --git a/core/docs/assets/search.js b/core/docs/assets/search.js index 77c628636..f0982db39 100644 --- a/core/docs/assets/search.js +++ b/core/docs/assets/search.js @@ -1 +1 @@ -window.searchData = JSON.parse("{\"rows\":[{\"kind\":256,\"name\":\"AeadEncryptionContext\",\"url\":\"interfaces/AeadEncryptionContext.html\",\"classes\":\"\"},{\"kind\":2048,\"name\":\"seal\",\"url\":\"interfaces/AeadEncryptionContext.html#seal\",\"classes\":\"\",\"parent\":\"AeadEncryptionContext\"},{\"kind\":2048,\"name\":\"open\",\"url\":\"interfaces/AeadEncryptionContext.html#open\",\"classes\":\"\",\"parent\":\"AeadEncryptionContext\"},{\"kind\":256,\"name\":\"AeadInterface\",\"url\":\"interfaces/AeadInterface.html\",\"classes\":\"\"},{\"kind\":1024,\"name\":\"id\",\"url\":\"interfaces/AeadInterface.html#id\",\"classes\":\"\",\"parent\":\"AeadInterface\"},{\"kind\":1024,\"name\":\"keySize\",\"url\":\"interfaces/AeadInterface.html#keySize\",\"classes\":\"\",\"parent\":\"AeadInterface\"},{\"kind\":1024,\"name\":\"nonceSize\",\"url\":\"interfaces/AeadInterface.html#nonceSize\",\"classes\":\"\",\"parent\":\"AeadInterface\"},{\"kind\":1024,\"name\":\"tagSize\",\"url\":\"interfaces/AeadInterface.html#tagSize\",\"classes\":\"\",\"parent\":\"AeadInterface\"},{\"kind\":2048,\"name\":\"createEncryptionContext\",\"url\":\"interfaces/AeadInterface.html#createEncryptionContext\",\"classes\":\"\",\"parent\":\"AeadInterface\"},{\"kind\":256,\"name\":\"CipherSuiteParams\",\"url\":\"interfaces/CipherSuiteParams.html\",\"classes\":\"\"},{\"kind\":1024,\"name\":\"kem\",\"url\":\"interfaces/CipherSuiteParams.html#kem\",\"classes\":\"\",\"parent\":\"CipherSuiteParams\"},{\"kind\":1024,\"name\":\"kdf\",\"url\":\"interfaces/CipherSuiteParams.html#kdf\",\"classes\":\"\",\"parent\":\"CipherSuiteParams\"},{\"kind\":1024,\"name\":\"aead\",\"url\":\"interfaces/CipherSuiteParams.html#aead\",\"classes\":\"\",\"parent\":\"CipherSuiteParams\"},{\"kind\":256,\"name\":\"EncryptionContext\",\"url\":\"interfaces/EncryptionContext.html\",\"classes\":\"\"},{\"kind\":2048,\"name\":\"seal\",\"url\":\"interfaces/EncryptionContext.html#seal\",\"classes\":\"\",\"parent\":\"EncryptionContext\"},{\"kind\":2048,\"name\":\"open\",\"url\":\"interfaces/EncryptionContext.html#open\",\"classes\":\"\",\"parent\":\"EncryptionContext\"},{\"kind\":2048,\"name\":\"export\",\"url\":\"interfaces/EncryptionContext.html#export\",\"classes\":\"tsd-is-inherited\",\"parent\":\"EncryptionContext\"},{\"kind\":2097152,\"name\":\"RecipientContext\",\"url\":\"types/RecipientContext.html\",\"classes\":\"\"},{\"kind\":256,\"name\":\"SenderContext\",\"url\":\"interfaces/SenderContext.html\",\"classes\":\"\"},{\"kind\":1024,\"name\":\"enc\",\"url\":\"interfaces/SenderContext.html#enc\",\"classes\":\"\",\"parent\":\"SenderContext\"},{\"kind\":2048,\"name\":\"seal\",\"url\":\"interfaces/SenderContext.html#seal\",\"classes\":\"tsd-is-inherited\",\"parent\":\"SenderContext\"},{\"kind\":2048,\"name\":\"open\",\"url\":\"interfaces/SenderContext.html#open\",\"classes\":\"tsd-is-inherited\",\"parent\":\"SenderContext\"},{\"kind\":2048,\"name\":\"export\",\"url\":\"interfaces/SenderContext.html#export\",\"classes\":\"tsd-is-inherited\",\"parent\":\"SenderContext\"},{\"kind\":256,\"name\":\"KdfInterface\",\"url\":\"interfaces/KdfInterface.html\",\"classes\":\"\"},{\"kind\":1024,\"name\":\"id\",\"url\":\"interfaces/KdfInterface.html#id\",\"classes\":\"\",\"parent\":\"KdfInterface\"},{\"kind\":1024,\"name\":\"hashSize\",\"url\":\"interfaces/KdfInterface.html#hashSize\",\"classes\":\"\",\"parent\":\"KdfInterface\"},{\"kind\":2048,\"name\":\"init\",\"url\":\"interfaces/KdfInterface.html#init\",\"classes\":\"\",\"parent\":\"KdfInterface\"},{\"kind\":2048,\"name\":\"buildLabeledIkm\",\"url\":\"interfaces/KdfInterface.html#buildLabeledIkm\",\"classes\":\"\",\"parent\":\"KdfInterface\"},{\"kind\":2048,\"name\":\"buildLabeledInfo\",\"url\":\"interfaces/KdfInterface.html#buildLabeledInfo\",\"classes\":\"\",\"parent\":\"KdfInterface\"},{\"kind\":2048,\"name\":\"extract\",\"url\":\"interfaces/KdfInterface.html#extract\",\"classes\":\"\",\"parent\":\"KdfInterface\"},{\"kind\":2048,\"name\":\"expand\",\"url\":\"interfaces/KdfInterface.html#expand\",\"classes\":\"\",\"parent\":\"KdfInterface\"},{\"kind\":2048,\"name\":\"extractAndExpand\",\"url\":\"interfaces/KdfInterface.html#extractAndExpand\",\"classes\":\"\",\"parent\":\"KdfInterface\"},{\"kind\":2048,\"name\":\"labeledExtract\",\"url\":\"interfaces/KdfInterface.html#labeledExtract\",\"classes\":\"\",\"parent\":\"KdfInterface\"},{\"kind\":2048,\"name\":\"labeledExpand\",\"url\":\"interfaces/KdfInterface.html#labeledExpand\",\"classes\":\"\",\"parent\":\"KdfInterface\"},{\"kind\":256,\"name\":\"KemInterface\",\"url\":\"interfaces/KemInterface.html\",\"classes\":\"\"},{\"kind\":1024,\"name\":\"id\",\"url\":\"interfaces/KemInterface.html#id\",\"classes\":\"\",\"parent\":\"KemInterface\"},{\"kind\":1024,\"name\":\"secretSize\",\"url\":\"interfaces/KemInterface.html#secretSize\",\"classes\":\"\",\"parent\":\"KemInterface\"},{\"kind\":1024,\"name\":\"encSize\",\"url\":\"interfaces/KemInterface.html#encSize\",\"classes\":\"\",\"parent\":\"KemInterface\"},{\"kind\":1024,\"name\":\"publicKeySize\",\"url\":\"interfaces/KemInterface.html#publicKeySize\",\"classes\":\"\",\"parent\":\"KemInterface\"},{\"kind\":1024,\"name\":\"privateKeySize\",\"url\":\"interfaces/KemInterface.html#privateKeySize\",\"classes\":\"\",\"parent\":\"KemInterface\"},{\"kind\":2048,\"name\":\"serializePublicKey\",\"url\":\"interfaces/KemInterface.html#serializePublicKey\",\"classes\":\"\",\"parent\":\"KemInterface\"},{\"kind\":2048,\"name\":\"deserializePublicKey\",\"url\":\"interfaces/KemInterface.html#deserializePublicKey\",\"classes\":\"\",\"parent\":\"KemInterface\"},{\"kind\":2048,\"name\":\"serializePrivateKey\",\"url\":\"interfaces/KemInterface.html#serializePrivateKey\",\"classes\":\"\",\"parent\":\"KemInterface\"},{\"kind\":2048,\"name\":\"deserializePrivateKey\",\"url\":\"interfaces/KemInterface.html#deserializePrivateKey\",\"classes\":\"\",\"parent\":\"KemInterface\"},{\"kind\":2048,\"name\":\"importKey\",\"url\":\"interfaces/KemInterface.html#importKey\",\"classes\":\"\",\"parent\":\"KemInterface\"},{\"kind\":2048,\"name\":\"generateKeyPair\",\"url\":\"interfaces/KemInterface.html#generateKeyPair\",\"classes\":\"\",\"parent\":\"KemInterface\"},{\"kind\":2048,\"name\":\"deriveKeyPair\",\"url\":\"interfaces/KemInterface.html#deriveKeyPair\",\"classes\":\"\",\"parent\":\"KemInterface\"},{\"kind\":2048,\"name\":\"encap\",\"url\":\"interfaces/KemInterface.html#encap\",\"classes\":\"\",\"parent\":\"KemInterface\"},{\"kind\":2048,\"name\":\"decap\",\"url\":\"interfaces/KemInterface.html#decap\",\"classes\":\"\",\"parent\":\"KemInterface\"},{\"kind\":256,\"name\":\"PreSharedKey\",\"url\":\"interfaces/PreSharedKey.html\",\"classes\":\"\"},{\"kind\":1024,\"name\":\"id\",\"url\":\"interfaces/PreSharedKey.html#id\",\"classes\":\"\",\"parent\":\"PreSharedKey\"},{\"kind\":1024,\"name\":\"key\",\"url\":\"interfaces/PreSharedKey.html#key\",\"classes\":\"\",\"parent\":\"PreSharedKey\"},{\"kind\":256,\"name\":\"RecipientContextParams\",\"url\":\"interfaces/RecipientContextParams.html\",\"classes\":\"\"},{\"kind\":1024,\"name\":\"recipientKey\",\"url\":\"interfaces/RecipientContextParams.html#recipientKey\",\"classes\":\"\",\"parent\":\"RecipientContextParams\"},{\"kind\":1024,\"name\":\"enc\",\"url\":\"interfaces/RecipientContextParams.html#enc\",\"classes\":\"\",\"parent\":\"RecipientContextParams\"},{\"kind\":1024,\"name\":\"senderPublicKey\",\"url\":\"interfaces/RecipientContextParams.html#senderPublicKey\",\"classes\":\"\",\"parent\":\"RecipientContextParams\"},{\"kind\":1024,\"name\":\"info\",\"url\":\"interfaces/RecipientContextParams.html#info\",\"classes\":\"tsd-is-inherited\",\"parent\":\"RecipientContextParams\"},{\"kind\":1024,\"name\":\"psk\",\"url\":\"interfaces/RecipientContextParams.html#psk\",\"classes\":\"tsd-is-inherited\",\"parent\":\"RecipientContextParams\"},{\"kind\":256,\"name\":\"CipherSuiteSealResponse\",\"url\":\"interfaces/CipherSuiteSealResponse.html\",\"classes\":\"\"},{\"kind\":1024,\"name\":\"ct\",\"url\":\"interfaces/CipherSuiteSealResponse.html#ct\",\"classes\":\"\",\"parent\":\"CipherSuiteSealResponse\"},{\"kind\":1024,\"name\":\"enc\",\"url\":\"interfaces/CipherSuiteSealResponse.html#enc\",\"classes\":\"\",\"parent\":\"CipherSuiteSealResponse\"},{\"kind\":256,\"name\":\"SenderContextParams\",\"url\":\"interfaces/SenderContextParams.html\",\"classes\":\"\"},{\"kind\":1024,\"name\":\"recipientPublicKey\",\"url\":\"interfaces/SenderContextParams.html#recipientPublicKey\",\"classes\":\"\",\"parent\":\"SenderContextParams\"},{\"kind\":1024,\"name\":\"senderKey\",\"url\":\"interfaces/SenderContextParams.html#senderKey\",\"classes\":\"\",\"parent\":\"SenderContextParams\"},{\"kind\":1024,\"name\":\"ekm\",\"url\":\"interfaces/SenderContextParams.html#ekm\",\"classes\":\"\",\"parent\":\"SenderContextParams\"},{\"kind\":1024,\"name\":\"info\",\"url\":\"interfaces/SenderContextParams.html#info\",\"classes\":\"tsd-is-inherited\",\"parent\":\"SenderContextParams\"},{\"kind\":1024,\"name\":\"psk\",\"url\":\"interfaces/SenderContextParams.html#psk\",\"classes\":\"tsd-is-inherited\",\"parent\":\"SenderContextParams\"},{\"kind\":128,\"name\":\"Aes128Gcm\",\"url\":\"classes/Aes128Gcm.html\",\"classes\":\"\"},{\"kind\":512,\"name\":\"constructor\",\"url\":\"classes/Aes128Gcm.html#constructor\",\"classes\":\"\",\"parent\":\"Aes128Gcm\"},{\"kind\":1024,\"name\":\"id\",\"url\":\"classes/Aes128Gcm.html#id\",\"classes\":\"\",\"parent\":\"Aes128Gcm\"},{\"kind\":1024,\"name\":\"keySize\",\"url\":\"classes/Aes128Gcm.html#keySize\",\"classes\":\"\",\"parent\":\"Aes128Gcm\"},{\"kind\":1024,\"name\":\"nonceSize\",\"url\":\"classes/Aes128Gcm.html#nonceSize\",\"classes\":\"\",\"parent\":\"Aes128Gcm\"},{\"kind\":1024,\"name\":\"tagSize\",\"url\":\"classes/Aes128Gcm.html#tagSize\",\"classes\":\"\",\"parent\":\"Aes128Gcm\"},{\"kind\":2048,\"name\":\"createEncryptionContext\",\"url\":\"classes/Aes128Gcm.html#createEncryptionContext\",\"classes\":\"\",\"parent\":\"Aes128Gcm\"},{\"kind\":128,\"name\":\"Aes256Gcm\",\"url\":\"classes/Aes256Gcm.html\",\"classes\":\"\"},{\"kind\":512,\"name\":\"constructor\",\"url\":\"classes/Aes256Gcm.html#constructor\",\"classes\":\"tsd-is-inherited\",\"parent\":\"Aes256Gcm\"},{\"kind\":1024,\"name\":\"id\",\"url\":\"classes/Aes256Gcm.html#id\",\"classes\":\"\",\"parent\":\"Aes256Gcm\"},{\"kind\":1024,\"name\":\"keySize\",\"url\":\"classes/Aes256Gcm.html#keySize\",\"classes\":\"\",\"parent\":\"Aes256Gcm\"},{\"kind\":1024,\"name\":\"nonceSize\",\"url\":\"classes/Aes256Gcm.html#nonceSize\",\"classes\":\"\",\"parent\":\"Aes256Gcm\"},{\"kind\":1024,\"name\":\"tagSize\",\"url\":\"classes/Aes256Gcm.html#tagSize\",\"classes\":\"\",\"parent\":\"Aes256Gcm\"},{\"kind\":2048,\"name\":\"createEncryptionContext\",\"url\":\"classes/Aes256Gcm.html#createEncryptionContext\",\"classes\":\"tsd-is-inherited\",\"parent\":\"Aes256Gcm\"},{\"kind\":128,\"name\":\"ExportOnly\",\"url\":\"classes/ExportOnly.html\",\"classes\":\"\"},{\"kind\":512,\"name\":\"constructor\",\"url\":\"classes/ExportOnly.html#constructor\",\"classes\":\"\",\"parent\":\"ExportOnly\"},{\"kind\":1024,\"name\":\"id\",\"url\":\"classes/ExportOnly.html#id\",\"classes\":\"\",\"parent\":\"ExportOnly\"},{\"kind\":1024,\"name\":\"keySize\",\"url\":\"classes/ExportOnly.html#keySize\",\"classes\":\"\",\"parent\":\"ExportOnly\"},{\"kind\":1024,\"name\":\"nonceSize\",\"url\":\"classes/ExportOnly.html#nonceSize\",\"classes\":\"\",\"parent\":\"ExportOnly\"},{\"kind\":1024,\"name\":\"tagSize\",\"url\":\"classes/ExportOnly.html#tagSize\",\"classes\":\"\",\"parent\":\"ExportOnly\"},{\"kind\":2048,\"name\":\"createEncryptionContext\",\"url\":\"classes/ExportOnly.html#createEncryptionContext\",\"classes\":\"\",\"parent\":\"ExportOnly\"},{\"kind\":32,\"name\":\"AeadId\",\"url\":\"variables/AeadId-1.html\",\"classes\":\"\"},{\"kind\":65536,\"name\":\"__type\",\"url\":\"variables/AeadId-1.html#__type\",\"classes\":\"\",\"parent\":\"AeadId\"},{\"kind\":1024,\"name\":\"Aes128Gcm\",\"url\":\"variables/AeadId-1.html#__type.Aes128Gcm\",\"classes\":\"\",\"parent\":\"AeadId.__type\"},{\"kind\":1024,\"name\":\"Aes256Gcm\",\"url\":\"variables/AeadId-1.html#__type.Aes256Gcm\",\"classes\":\"\",\"parent\":\"AeadId.__type\"},{\"kind\":1024,\"name\":\"Chacha20Poly1305\",\"url\":\"variables/AeadId-1.html#__type.Chacha20Poly1305\",\"classes\":\"\",\"parent\":\"AeadId.__type\"},{\"kind\":1024,\"name\":\"ExportOnly\",\"url\":\"variables/AeadId-1.html#__type.ExportOnly\",\"classes\":\"\",\"parent\":\"AeadId.__type\"},{\"kind\":2097152,\"name\":\"AeadId\",\"url\":\"types/AeadId.html\",\"classes\":\"\"},{\"kind\":32,\"name\":\"KdfId\",\"url\":\"variables/KdfId-1.html\",\"classes\":\"\"},{\"kind\":65536,\"name\":\"__type\",\"url\":\"variables/KdfId-1.html#__type\",\"classes\":\"\",\"parent\":\"KdfId\"},{\"kind\":1024,\"name\":\"HkdfSha256\",\"url\":\"variables/KdfId-1.html#__type.HkdfSha256\",\"classes\":\"\",\"parent\":\"KdfId.__type\"},{\"kind\":1024,\"name\":\"HkdfSha384\",\"url\":\"variables/KdfId-1.html#__type.HkdfSha384\",\"classes\":\"\",\"parent\":\"KdfId.__type\"},{\"kind\":1024,\"name\":\"HkdfSha512\",\"url\":\"variables/KdfId-1.html#__type.HkdfSha512\",\"classes\":\"\",\"parent\":\"KdfId.__type\"},{\"kind\":2097152,\"name\":\"KdfId\",\"url\":\"types/KdfId.html\",\"classes\":\"\"},{\"kind\":32,\"name\":\"KemId\",\"url\":\"variables/KemId-1.html\",\"classes\":\"\"},{\"kind\":65536,\"name\":\"__type\",\"url\":\"variables/KemId-1.html#__type\",\"classes\":\"\",\"parent\":\"KemId\"},{\"kind\":1024,\"name\":\"NotAssigned\",\"url\":\"variables/KemId-1.html#__type.NotAssigned\",\"classes\":\"\",\"parent\":\"KemId.__type\"},{\"kind\":1024,\"name\":\"DhkemP256HkdfSha256\",\"url\":\"variables/KemId-1.html#__type.DhkemP256HkdfSha256\",\"classes\":\"\",\"parent\":\"KemId.__type\"},{\"kind\":1024,\"name\":\"DhkemP384HkdfSha384\",\"url\":\"variables/KemId-1.html#__type.DhkemP384HkdfSha384\",\"classes\":\"\",\"parent\":\"KemId.__type\"},{\"kind\":1024,\"name\":\"DhkemP521HkdfSha512\",\"url\":\"variables/KemId-1.html#__type.DhkemP521HkdfSha512\",\"classes\":\"\",\"parent\":\"KemId.__type\"},{\"kind\":1024,\"name\":\"DhkemSecp256k1HkdfSha256\",\"url\":\"variables/KemId-1.html#__type.DhkemSecp256k1HkdfSha256\",\"classes\":\"\",\"parent\":\"KemId.__type\"},{\"kind\":1024,\"name\":\"DhkemX25519HkdfSha256\",\"url\":\"variables/KemId-1.html#__type.DhkemX25519HkdfSha256\",\"classes\":\"\",\"parent\":\"KemId.__type\"},{\"kind\":1024,\"name\":\"DhkemX448HkdfSha512\",\"url\":\"variables/KemId-1.html#__type.DhkemX448HkdfSha512\",\"classes\":\"\",\"parent\":\"KemId.__type\"},{\"kind\":1024,\"name\":\"HybridkemX25519Kyber768\",\"url\":\"variables/KemId-1.html#__type.HybridkemX25519Kyber768\",\"classes\":\"\",\"parent\":\"KemId.__type\"},{\"kind\":2097152,\"name\":\"KemId\",\"url\":\"types/KemId.html\",\"classes\":\"\"},{\"kind\":128,\"name\":\"CipherSuite\",\"url\":\"classes/CipherSuite.html\",\"classes\":\"\"},{\"kind\":512,\"name\":\"constructor\",\"url\":\"classes/CipherSuite.html#constructor\",\"classes\":\"tsd-is-inherited\",\"parent\":\"CipherSuite\"},{\"kind\":1024,\"name\":\"_kem\",\"url\":\"classes/CipherSuite.html#_kem\",\"classes\":\"tsd-is-protected tsd-is-inherited\",\"parent\":\"CipherSuite\"},{\"kind\":262144,\"name\":\"kem\",\"url\":\"classes/CipherSuite.html#kem\",\"classes\":\"tsd-is-inherited\",\"parent\":\"CipherSuite\"},{\"kind\":262144,\"name\":\"kdf\",\"url\":\"classes/CipherSuite.html#kdf\",\"classes\":\"tsd-is-inherited\",\"parent\":\"CipherSuite\"},{\"kind\":262144,\"name\":\"aead\",\"url\":\"classes/CipherSuite.html#aead\",\"classes\":\"tsd-is-inherited\",\"parent\":\"CipherSuite\"},{\"kind\":2048,\"name\":\"createSenderContext\",\"url\":\"classes/CipherSuite.html#createSenderContext\",\"classes\":\"tsd-is-inherited\",\"parent\":\"CipherSuite\"},{\"kind\":2048,\"name\":\"createRecipientContext\",\"url\":\"classes/CipherSuite.html#createRecipientContext\",\"classes\":\"tsd-is-inherited\",\"parent\":\"CipherSuite\"},{\"kind\":2048,\"name\":\"seal\",\"url\":\"classes/CipherSuite.html#seal\",\"classes\":\"tsd-is-inherited\",\"parent\":\"CipherSuite\"},{\"kind\":2048,\"name\":\"open\",\"url\":\"classes/CipherSuite.html#open\",\"classes\":\"tsd-is-inherited\",\"parent\":\"CipherSuite\"},{\"kind\":1024,\"name\":\"_api\",\"url\":\"classes/CipherSuite.html#_api\",\"classes\":\"tsd-is-protected tsd-is-inherited\",\"parent\":\"CipherSuite\"},{\"kind\":2048,\"name\":\"_setup\",\"url\":\"classes/CipherSuite.html#_setup\",\"classes\":\"tsd-is-protected tsd-is-inherited\",\"parent\":\"CipherSuite\"},{\"kind\":128,\"name\":\"DhkemP256HkdfSha256\",\"url\":\"classes/DhkemP256HkdfSha256.html\",\"classes\":\"\"},{\"kind\":512,\"name\":\"constructor\",\"url\":\"classes/DhkemP256HkdfSha256.html#constructor\",\"classes\":\"tsd-is-inherited\",\"parent\":\"DhkemP256HkdfSha256\"},{\"kind\":1024,\"name\":\"id\",\"url\":\"classes/DhkemP256HkdfSha256.html#id\",\"classes\":\"tsd-is-inherited\",\"parent\":\"DhkemP256HkdfSha256\"},{\"kind\":1024,\"name\":\"secretSize\",\"url\":\"classes/DhkemP256HkdfSha256.html#secretSize\",\"classes\":\"tsd-is-inherited\",\"parent\":\"DhkemP256HkdfSha256\"},{\"kind\":1024,\"name\":\"encSize\",\"url\":\"classes/DhkemP256HkdfSha256.html#encSize\",\"classes\":\"tsd-is-inherited\",\"parent\":\"DhkemP256HkdfSha256\"},{\"kind\":1024,\"name\":\"publicKeySize\",\"url\":\"classes/DhkemP256HkdfSha256.html#publicKeySize\",\"classes\":\"tsd-is-inherited\",\"parent\":\"DhkemP256HkdfSha256\"},{\"kind\":1024,\"name\":\"privateKeySize\",\"url\":\"classes/DhkemP256HkdfSha256.html#privateKeySize\",\"classes\":\"tsd-is-inherited\",\"parent\":\"DhkemP256HkdfSha256\"},{\"kind\":1024,\"name\":\"_prim\",\"url\":\"classes/DhkemP256HkdfSha256.html#_prim\",\"classes\":\"tsd-is-protected tsd-is-inherited\",\"parent\":\"DhkemP256HkdfSha256\"},{\"kind\":1024,\"name\":\"_kdf\",\"url\":\"classes/DhkemP256HkdfSha256.html#_kdf\",\"classes\":\"tsd-is-protected tsd-is-inherited\",\"parent\":\"DhkemP256HkdfSha256\"},{\"kind\":2048,\"name\":\"serializePublicKey\",\"url\":\"classes/DhkemP256HkdfSha256.html#serializePublicKey\",\"classes\":\"tsd-is-inherited\",\"parent\":\"DhkemP256HkdfSha256\"},{\"kind\":2048,\"name\":\"deserializePublicKey\",\"url\":\"classes/DhkemP256HkdfSha256.html#deserializePublicKey\",\"classes\":\"tsd-is-inherited\",\"parent\":\"DhkemP256HkdfSha256\"},{\"kind\":2048,\"name\":\"serializePrivateKey\",\"url\":\"classes/DhkemP256HkdfSha256.html#serializePrivateKey\",\"classes\":\"tsd-is-inherited\",\"parent\":\"DhkemP256HkdfSha256\"},{\"kind\":2048,\"name\":\"deserializePrivateKey\",\"url\":\"classes/DhkemP256HkdfSha256.html#deserializePrivateKey\",\"classes\":\"tsd-is-inherited\",\"parent\":\"DhkemP256HkdfSha256\"},{\"kind\":2048,\"name\":\"importKey\",\"url\":\"classes/DhkemP256HkdfSha256.html#importKey\",\"classes\":\"tsd-is-inherited\",\"parent\":\"DhkemP256HkdfSha256\"},{\"kind\":2048,\"name\":\"generateKeyPair\",\"url\":\"classes/DhkemP256HkdfSha256.html#generateKeyPair\",\"classes\":\"tsd-is-inherited\",\"parent\":\"DhkemP256HkdfSha256\"},{\"kind\":2048,\"name\":\"deriveKeyPair\",\"url\":\"classes/DhkemP256HkdfSha256.html#deriveKeyPair\",\"classes\":\"tsd-is-inherited\",\"parent\":\"DhkemP256HkdfSha256\"},{\"kind\":2048,\"name\":\"encap\",\"url\":\"classes/DhkemP256HkdfSha256.html#encap\",\"classes\":\"tsd-is-inherited\",\"parent\":\"DhkemP256HkdfSha256\"},{\"kind\":2048,\"name\":\"decap\",\"url\":\"classes/DhkemP256HkdfSha256.html#decap\",\"classes\":\"tsd-is-inherited\",\"parent\":\"DhkemP256HkdfSha256\"},{\"kind\":128,\"name\":\"DhkemP384HkdfSha384\",\"url\":\"classes/DhkemP384HkdfSha384.html\",\"classes\":\"\"},{\"kind\":512,\"name\":\"constructor\",\"url\":\"classes/DhkemP384HkdfSha384.html#constructor\",\"classes\":\"tsd-is-inherited\",\"parent\":\"DhkemP384HkdfSha384\"},{\"kind\":1024,\"name\":\"id\",\"url\":\"classes/DhkemP384HkdfSha384.html#id\",\"classes\":\"tsd-is-inherited\",\"parent\":\"DhkemP384HkdfSha384\"},{\"kind\":1024,\"name\":\"secretSize\",\"url\":\"classes/DhkemP384HkdfSha384.html#secretSize\",\"classes\":\"tsd-is-inherited\",\"parent\":\"DhkemP384HkdfSha384\"},{\"kind\":1024,\"name\":\"encSize\",\"url\":\"classes/DhkemP384HkdfSha384.html#encSize\",\"classes\":\"tsd-is-inherited\",\"parent\":\"DhkemP384HkdfSha384\"},{\"kind\":1024,\"name\":\"publicKeySize\",\"url\":\"classes/DhkemP384HkdfSha384.html#publicKeySize\",\"classes\":\"tsd-is-inherited\",\"parent\":\"DhkemP384HkdfSha384\"},{\"kind\":1024,\"name\":\"privateKeySize\",\"url\":\"classes/DhkemP384HkdfSha384.html#privateKeySize\",\"classes\":\"tsd-is-inherited\",\"parent\":\"DhkemP384HkdfSha384\"},{\"kind\":1024,\"name\":\"_prim\",\"url\":\"classes/DhkemP384HkdfSha384.html#_prim\",\"classes\":\"tsd-is-protected tsd-is-inherited\",\"parent\":\"DhkemP384HkdfSha384\"},{\"kind\":1024,\"name\":\"_kdf\",\"url\":\"classes/DhkemP384HkdfSha384.html#_kdf\",\"classes\":\"tsd-is-protected tsd-is-inherited\",\"parent\":\"DhkemP384HkdfSha384\"},{\"kind\":2048,\"name\":\"serializePublicKey\",\"url\":\"classes/DhkemP384HkdfSha384.html#serializePublicKey\",\"classes\":\"tsd-is-inherited\",\"parent\":\"DhkemP384HkdfSha384\"},{\"kind\":2048,\"name\":\"deserializePublicKey\",\"url\":\"classes/DhkemP384HkdfSha384.html#deserializePublicKey\",\"classes\":\"tsd-is-inherited\",\"parent\":\"DhkemP384HkdfSha384\"},{\"kind\":2048,\"name\":\"serializePrivateKey\",\"url\":\"classes/DhkemP384HkdfSha384.html#serializePrivateKey\",\"classes\":\"tsd-is-inherited\",\"parent\":\"DhkemP384HkdfSha384\"},{\"kind\":2048,\"name\":\"deserializePrivateKey\",\"url\":\"classes/DhkemP384HkdfSha384.html#deserializePrivateKey\",\"classes\":\"tsd-is-inherited\",\"parent\":\"DhkemP384HkdfSha384\"},{\"kind\":2048,\"name\":\"importKey\",\"url\":\"classes/DhkemP384HkdfSha384.html#importKey\",\"classes\":\"tsd-is-inherited\",\"parent\":\"DhkemP384HkdfSha384\"},{\"kind\":2048,\"name\":\"generateKeyPair\",\"url\":\"classes/DhkemP384HkdfSha384.html#generateKeyPair\",\"classes\":\"tsd-is-inherited\",\"parent\":\"DhkemP384HkdfSha384\"},{\"kind\":2048,\"name\":\"deriveKeyPair\",\"url\":\"classes/DhkemP384HkdfSha384.html#deriveKeyPair\",\"classes\":\"tsd-is-inherited\",\"parent\":\"DhkemP384HkdfSha384\"},{\"kind\":2048,\"name\":\"encap\",\"url\":\"classes/DhkemP384HkdfSha384.html#encap\",\"classes\":\"tsd-is-inherited\",\"parent\":\"DhkemP384HkdfSha384\"},{\"kind\":2048,\"name\":\"decap\",\"url\":\"classes/DhkemP384HkdfSha384.html#decap\",\"classes\":\"tsd-is-inherited\",\"parent\":\"DhkemP384HkdfSha384\"},{\"kind\":128,\"name\":\"DhkemP521HkdfSha512\",\"url\":\"classes/DhkemP521HkdfSha512.html\",\"classes\":\"\"},{\"kind\":512,\"name\":\"constructor\",\"url\":\"classes/DhkemP521HkdfSha512.html#constructor\",\"classes\":\"tsd-is-inherited\",\"parent\":\"DhkemP521HkdfSha512\"},{\"kind\":1024,\"name\":\"id\",\"url\":\"classes/DhkemP521HkdfSha512.html#id\",\"classes\":\"tsd-is-inherited\",\"parent\":\"DhkemP521HkdfSha512\"},{\"kind\":1024,\"name\":\"secretSize\",\"url\":\"classes/DhkemP521HkdfSha512.html#secretSize\",\"classes\":\"tsd-is-inherited\",\"parent\":\"DhkemP521HkdfSha512\"},{\"kind\":1024,\"name\":\"encSize\",\"url\":\"classes/DhkemP521HkdfSha512.html#encSize\",\"classes\":\"tsd-is-inherited\",\"parent\":\"DhkemP521HkdfSha512\"},{\"kind\":1024,\"name\":\"publicKeySize\",\"url\":\"classes/DhkemP521HkdfSha512.html#publicKeySize\",\"classes\":\"tsd-is-inherited\",\"parent\":\"DhkemP521HkdfSha512\"},{\"kind\":1024,\"name\":\"privateKeySize\",\"url\":\"classes/DhkemP521HkdfSha512.html#privateKeySize\",\"classes\":\"tsd-is-inherited\",\"parent\":\"DhkemP521HkdfSha512\"},{\"kind\":1024,\"name\":\"_prim\",\"url\":\"classes/DhkemP521HkdfSha512.html#_prim\",\"classes\":\"tsd-is-protected tsd-is-inherited\",\"parent\":\"DhkemP521HkdfSha512\"},{\"kind\":1024,\"name\":\"_kdf\",\"url\":\"classes/DhkemP521HkdfSha512.html#_kdf\",\"classes\":\"tsd-is-protected tsd-is-inherited\",\"parent\":\"DhkemP521HkdfSha512\"},{\"kind\":2048,\"name\":\"serializePublicKey\",\"url\":\"classes/DhkemP521HkdfSha512.html#serializePublicKey\",\"classes\":\"tsd-is-inherited\",\"parent\":\"DhkemP521HkdfSha512\"},{\"kind\":2048,\"name\":\"deserializePublicKey\",\"url\":\"classes/DhkemP521HkdfSha512.html#deserializePublicKey\",\"classes\":\"tsd-is-inherited\",\"parent\":\"DhkemP521HkdfSha512\"},{\"kind\":2048,\"name\":\"serializePrivateKey\",\"url\":\"classes/DhkemP521HkdfSha512.html#serializePrivateKey\",\"classes\":\"tsd-is-inherited\",\"parent\":\"DhkemP521HkdfSha512\"},{\"kind\":2048,\"name\":\"deserializePrivateKey\",\"url\":\"classes/DhkemP521HkdfSha512.html#deserializePrivateKey\",\"classes\":\"tsd-is-inherited\",\"parent\":\"DhkemP521HkdfSha512\"},{\"kind\":2048,\"name\":\"importKey\",\"url\":\"classes/DhkemP521HkdfSha512.html#importKey\",\"classes\":\"tsd-is-inherited\",\"parent\":\"DhkemP521HkdfSha512\"},{\"kind\":2048,\"name\":\"generateKeyPair\",\"url\":\"classes/DhkemP521HkdfSha512.html#generateKeyPair\",\"classes\":\"tsd-is-inherited\",\"parent\":\"DhkemP521HkdfSha512\"},{\"kind\":2048,\"name\":\"deriveKeyPair\",\"url\":\"classes/DhkemP521HkdfSha512.html#deriveKeyPair\",\"classes\":\"tsd-is-inherited\",\"parent\":\"DhkemP521HkdfSha512\"},{\"kind\":2048,\"name\":\"encap\",\"url\":\"classes/DhkemP521HkdfSha512.html#encap\",\"classes\":\"tsd-is-inherited\",\"parent\":\"DhkemP521HkdfSha512\"},{\"kind\":2048,\"name\":\"decap\",\"url\":\"classes/DhkemP521HkdfSha512.html#decap\",\"classes\":\"tsd-is-inherited\",\"parent\":\"DhkemP521HkdfSha512\"},{\"kind\":128,\"name\":\"HkdfSha256\",\"url\":\"classes/HkdfSha256.html\",\"classes\":\"\"},{\"kind\":512,\"name\":\"constructor\",\"url\":\"classes/HkdfSha256.html#constructor\",\"classes\":\"tsd-is-inherited\",\"parent\":\"HkdfSha256\"},{\"kind\":1024,\"name\":\"id\",\"url\":\"classes/HkdfSha256.html#id\",\"classes\":\"tsd-is-inherited\",\"parent\":\"HkdfSha256\"},{\"kind\":1024,\"name\":\"hashSize\",\"url\":\"classes/HkdfSha256.html#hashSize\",\"classes\":\"tsd-is-inherited\",\"parent\":\"HkdfSha256\"},{\"kind\":1024,\"name\":\"algHash\",\"url\":\"classes/HkdfSha256.html#algHash\",\"classes\":\"tsd-is-protected tsd-is-inherited\",\"parent\":\"HkdfSha256\"},{\"kind\":1024,\"name\":\"_suiteId\",\"url\":\"classes/HkdfSha256.html#_suiteId\",\"classes\":\"tsd-is-protected tsd-is-inherited\",\"parent\":\"HkdfSha256\"},{\"kind\":2048,\"name\":\"init\",\"url\":\"classes/HkdfSha256.html#init\",\"classes\":\"tsd-is-inherited\",\"parent\":\"HkdfSha256\"},{\"kind\":2048,\"name\":\"buildLabeledIkm\",\"url\":\"classes/HkdfSha256.html#buildLabeledIkm\",\"classes\":\"tsd-is-inherited\",\"parent\":\"HkdfSha256\"},{\"kind\":2048,\"name\":\"buildLabeledInfo\",\"url\":\"classes/HkdfSha256.html#buildLabeledInfo\",\"classes\":\"tsd-is-inherited\",\"parent\":\"HkdfSha256\"},{\"kind\":2048,\"name\":\"extract\",\"url\":\"classes/HkdfSha256.html#extract\",\"classes\":\"tsd-is-inherited\",\"parent\":\"HkdfSha256\"},{\"kind\":2048,\"name\":\"expand\",\"url\":\"classes/HkdfSha256.html#expand\",\"classes\":\"tsd-is-inherited\",\"parent\":\"HkdfSha256\"},{\"kind\":2048,\"name\":\"extractAndExpand\",\"url\":\"classes/HkdfSha256.html#extractAndExpand\",\"classes\":\"tsd-is-inherited\",\"parent\":\"HkdfSha256\"},{\"kind\":2048,\"name\":\"labeledExtract\",\"url\":\"classes/HkdfSha256.html#labeledExtract\",\"classes\":\"tsd-is-inherited\",\"parent\":\"HkdfSha256\"},{\"kind\":2048,\"name\":\"labeledExpand\",\"url\":\"classes/HkdfSha256.html#labeledExpand\",\"classes\":\"tsd-is-inherited\",\"parent\":\"HkdfSha256\"},{\"kind\":2048,\"name\":\"_checkInit\",\"url\":\"classes/HkdfSha256.html#_checkInit\",\"classes\":\"tsd-is-protected tsd-is-inherited\",\"parent\":\"HkdfSha256\"},{\"kind\":1024,\"name\":\"_api\",\"url\":\"classes/HkdfSha256.html#_api\",\"classes\":\"tsd-is-protected tsd-is-inherited\",\"parent\":\"HkdfSha256\"},{\"kind\":2048,\"name\":\"_setup\",\"url\":\"classes/HkdfSha256.html#_setup\",\"classes\":\"tsd-is-protected tsd-is-inherited\",\"parent\":\"HkdfSha256\"},{\"kind\":128,\"name\":\"HkdfSha384\",\"url\":\"classes/HkdfSha384.html\",\"classes\":\"\"},{\"kind\":512,\"name\":\"constructor\",\"url\":\"classes/HkdfSha384.html#constructor\",\"classes\":\"tsd-is-inherited\",\"parent\":\"HkdfSha384\"},{\"kind\":1024,\"name\":\"id\",\"url\":\"classes/HkdfSha384.html#id\",\"classes\":\"tsd-is-inherited\",\"parent\":\"HkdfSha384\"},{\"kind\":1024,\"name\":\"hashSize\",\"url\":\"classes/HkdfSha384.html#hashSize\",\"classes\":\"tsd-is-inherited\",\"parent\":\"HkdfSha384\"},{\"kind\":1024,\"name\":\"algHash\",\"url\":\"classes/HkdfSha384.html#algHash\",\"classes\":\"tsd-is-protected tsd-is-inherited\",\"parent\":\"HkdfSha384\"},{\"kind\":1024,\"name\":\"_suiteId\",\"url\":\"classes/HkdfSha384.html#_suiteId\",\"classes\":\"tsd-is-protected tsd-is-inherited\",\"parent\":\"HkdfSha384\"},{\"kind\":2048,\"name\":\"init\",\"url\":\"classes/HkdfSha384.html#init\",\"classes\":\"tsd-is-inherited\",\"parent\":\"HkdfSha384\"},{\"kind\":2048,\"name\":\"buildLabeledIkm\",\"url\":\"classes/HkdfSha384.html#buildLabeledIkm\",\"classes\":\"tsd-is-inherited\",\"parent\":\"HkdfSha384\"},{\"kind\":2048,\"name\":\"buildLabeledInfo\",\"url\":\"classes/HkdfSha384.html#buildLabeledInfo\",\"classes\":\"tsd-is-inherited\",\"parent\":\"HkdfSha384\"},{\"kind\":2048,\"name\":\"extract\",\"url\":\"classes/HkdfSha384.html#extract\",\"classes\":\"tsd-is-inherited\",\"parent\":\"HkdfSha384\"},{\"kind\":2048,\"name\":\"expand\",\"url\":\"classes/HkdfSha384.html#expand\",\"classes\":\"tsd-is-inherited\",\"parent\":\"HkdfSha384\"},{\"kind\":2048,\"name\":\"extractAndExpand\",\"url\":\"classes/HkdfSha384.html#extractAndExpand\",\"classes\":\"tsd-is-inherited\",\"parent\":\"HkdfSha384\"},{\"kind\":2048,\"name\":\"labeledExtract\",\"url\":\"classes/HkdfSha384.html#labeledExtract\",\"classes\":\"tsd-is-inherited\",\"parent\":\"HkdfSha384\"},{\"kind\":2048,\"name\":\"labeledExpand\",\"url\":\"classes/HkdfSha384.html#labeledExpand\",\"classes\":\"tsd-is-inherited\",\"parent\":\"HkdfSha384\"},{\"kind\":2048,\"name\":\"_checkInit\",\"url\":\"classes/HkdfSha384.html#_checkInit\",\"classes\":\"tsd-is-protected tsd-is-inherited\",\"parent\":\"HkdfSha384\"},{\"kind\":1024,\"name\":\"_api\",\"url\":\"classes/HkdfSha384.html#_api\",\"classes\":\"tsd-is-protected tsd-is-inherited\",\"parent\":\"HkdfSha384\"},{\"kind\":2048,\"name\":\"_setup\",\"url\":\"classes/HkdfSha384.html#_setup\",\"classes\":\"tsd-is-protected tsd-is-inherited\",\"parent\":\"HkdfSha384\"},{\"kind\":128,\"name\":\"HkdfSha512\",\"url\":\"classes/HkdfSha512.html\",\"classes\":\"\"},{\"kind\":512,\"name\":\"constructor\",\"url\":\"classes/HkdfSha512.html#constructor\",\"classes\":\"tsd-is-inherited\",\"parent\":\"HkdfSha512\"},{\"kind\":1024,\"name\":\"id\",\"url\":\"classes/HkdfSha512.html#id\",\"classes\":\"tsd-is-inherited\",\"parent\":\"HkdfSha512\"},{\"kind\":1024,\"name\":\"hashSize\",\"url\":\"classes/HkdfSha512.html#hashSize\",\"classes\":\"tsd-is-inherited\",\"parent\":\"HkdfSha512\"},{\"kind\":1024,\"name\":\"algHash\",\"url\":\"classes/HkdfSha512.html#algHash\",\"classes\":\"tsd-is-protected tsd-is-inherited\",\"parent\":\"HkdfSha512\"},{\"kind\":1024,\"name\":\"_suiteId\",\"url\":\"classes/HkdfSha512.html#_suiteId\",\"classes\":\"tsd-is-protected tsd-is-inherited\",\"parent\":\"HkdfSha512\"},{\"kind\":2048,\"name\":\"init\",\"url\":\"classes/HkdfSha512.html#init\",\"classes\":\"tsd-is-inherited\",\"parent\":\"HkdfSha512\"},{\"kind\":2048,\"name\":\"buildLabeledIkm\",\"url\":\"classes/HkdfSha512.html#buildLabeledIkm\",\"classes\":\"tsd-is-inherited\",\"parent\":\"HkdfSha512\"},{\"kind\":2048,\"name\":\"buildLabeledInfo\",\"url\":\"classes/HkdfSha512.html#buildLabeledInfo\",\"classes\":\"tsd-is-inherited\",\"parent\":\"HkdfSha512\"},{\"kind\":2048,\"name\":\"extract\",\"url\":\"classes/HkdfSha512.html#extract\",\"classes\":\"tsd-is-inherited\",\"parent\":\"HkdfSha512\"},{\"kind\":2048,\"name\":\"expand\",\"url\":\"classes/HkdfSha512.html#expand\",\"classes\":\"tsd-is-inherited\",\"parent\":\"HkdfSha512\"},{\"kind\":2048,\"name\":\"extractAndExpand\",\"url\":\"classes/HkdfSha512.html#extractAndExpand\",\"classes\":\"tsd-is-inherited\",\"parent\":\"HkdfSha512\"},{\"kind\":2048,\"name\":\"labeledExtract\",\"url\":\"classes/HkdfSha512.html#labeledExtract\",\"classes\":\"tsd-is-inherited\",\"parent\":\"HkdfSha512\"},{\"kind\":2048,\"name\":\"labeledExpand\",\"url\":\"classes/HkdfSha512.html#labeledExpand\",\"classes\":\"tsd-is-inherited\",\"parent\":\"HkdfSha512\"},{\"kind\":2048,\"name\":\"_checkInit\",\"url\":\"classes/HkdfSha512.html#_checkInit\",\"classes\":\"tsd-is-protected tsd-is-inherited\",\"parent\":\"HkdfSha512\"},{\"kind\":1024,\"name\":\"_api\",\"url\":\"classes/HkdfSha512.html#_api\",\"classes\":\"tsd-is-protected tsd-is-inherited\",\"parent\":\"HkdfSha512\"},{\"kind\":2048,\"name\":\"_setup\",\"url\":\"classes/HkdfSha512.html#_setup\",\"classes\":\"tsd-is-protected tsd-is-inherited\",\"parent\":\"HkdfSha512\"},{\"kind\":128,\"name\":\"BaseError\",\"url\":\"classes/BaseError.html\",\"classes\":\"\"},{\"kind\":512,\"name\":\"constructor\",\"url\":\"classes/BaseError.html#constructor\",\"classes\":\"\",\"parent\":\"BaseError\"},{\"kind\":128,\"name\":\"HpkeError\",\"url\":\"classes/HpkeError.html\",\"classes\":\"\"},{\"kind\":512,\"name\":\"constructor\",\"url\":\"classes/HpkeError.html#constructor\",\"classes\":\"tsd-is-inherited\",\"parent\":\"HpkeError\"},{\"kind\":128,\"name\":\"InvalidParamError\",\"url\":\"classes/InvalidParamError.html\",\"classes\":\"\"},{\"kind\":512,\"name\":\"constructor\",\"url\":\"classes/InvalidParamError.html#constructor\",\"classes\":\"tsd-is-inherited\",\"parent\":\"InvalidParamError\"},{\"kind\":128,\"name\":\"ValidationError\",\"url\":\"classes/ValidationError.html\",\"classes\":\"\"},{\"kind\":512,\"name\":\"constructor\",\"url\":\"classes/ValidationError.html#constructor\",\"classes\":\"tsd-is-inherited\",\"parent\":\"ValidationError\"},{\"kind\":128,\"name\":\"SerializeError\",\"url\":\"classes/SerializeError.html\",\"classes\":\"\"},{\"kind\":512,\"name\":\"constructor\",\"url\":\"classes/SerializeError.html#constructor\",\"classes\":\"tsd-is-inherited\",\"parent\":\"SerializeError\"},{\"kind\":128,\"name\":\"DeserializeError\",\"url\":\"classes/DeserializeError.html\",\"classes\":\"\"},{\"kind\":512,\"name\":\"constructor\",\"url\":\"classes/DeserializeError.html#constructor\",\"classes\":\"tsd-is-inherited\",\"parent\":\"DeserializeError\"},{\"kind\":128,\"name\":\"EncapError\",\"url\":\"classes/EncapError.html\",\"classes\":\"\"},{\"kind\":512,\"name\":\"constructor\",\"url\":\"classes/EncapError.html#constructor\",\"classes\":\"tsd-is-inherited\",\"parent\":\"EncapError\"},{\"kind\":128,\"name\":\"DecapError\",\"url\":\"classes/DecapError.html\",\"classes\":\"\"},{\"kind\":512,\"name\":\"constructor\",\"url\":\"classes/DecapError.html#constructor\",\"classes\":\"tsd-is-inherited\",\"parent\":\"DecapError\"},{\"kind\":128,\"name\":\"ExportError\",\"url\":\"classes/ExportError.html\",\"classes\":\"\"},{\"kind\":512,\"name\":\"constructor\",\"url\":\"classes/ExportError.html#constructor\",\"classes\":\"tsd-is-inherited\",\"parent\":\"ExportError\"},{\"kind\":128,\"name\":\"SealError\",\"url\":\"classes/SealError.html\",\"classes\":\"\"},{\"kind\":512,\"name\":\"constructor\",\"url\":\"classes/SealError.html#constructor\",\"classes\":\"tsd-is-inherited\",\"parent\":\"SealError\"},{\"kind\":128,\"name\":\"OpenError\",\"url\":\"classes/OpenError.html\",\"classes\":\"\"},{\"kind\":512,\"name\":\"constructor\",\"url\":\"classes/OpenError.html#constructor\",\"classes\":\"tsd-is-inherited\",\"parent\":\"OpenError\"},{\"kind\":128,\"name\":\"MessageLimitReachedError\",\"url\":\"classes/MessageLimitReachedError.html\",\"classes\":\"\"},{\"kind\":512,\"name\":\"constructor\",\"url\":\"classes/MessageLimitReachedError.html#constructor\",\"classes\":\"tsd-is-inherited\",\"parent\":\"MessageLimitReachedError\"},{\"kind\":128,\"name\":\"DeriveKeyPairError\",\"url\":\"classes/DeriveKeyPairError.html\",\"classes\":\"\"},{\"kind\":512,\"name\":\"constructor\",\"url\":\"classes/DeriveKeyPairError.html#constructor\",\"classes\":\"tsd-is-inherited\",\"parent\":\"DeriveKeyPairError\"},{\"kind\":128,\"name\":\"NotSupportedError\",\"url\":\"classes/NotSupportedError.html\",\"classes\":\"\"},{\"kind\":512,\"name\":\"constructor\",\"url\":\"classes/NotSupportedError.html#constructor\",\"classes\":\"tsd-is-inherited\",\"parent\":\"NotSupportedError\"}],\"index\":{\"version\":\"2.3.9\",\"fields\":[\"name\",\"comment\"],\"fieldVectors\":[[\"name/0\",[0,51.475]],[\"comment/0\",[]],[\"name/1\",[1,40.489]],[\"comment/1\",[]],[\"name/2\",[2,40.489]],[\"comment/2\",[]],[\"name/3\",[3,51.475]],[\"comment/3\",[]],[\"name/4\",[4,29.503]],[\"comment/4\",[]],[\"name/5\",[5,40.489]],[\"comment/5\",[]],[\"name/6\",[6,40.489]],[\"comment/6\",[]],[\"name/7\",[7,40.489]],[\"comment/7\",[]],[\"name/8\",[8,40.489]],[\"comment/8\",[]],[\"name/9\",[9,51.475]],[\"comment/9\",[]],[\"name/10\",[10,46.367]],[\"comment/10\",[]],[\"name/11\",[11,46.367]],[\"comment/11\",[]],[\"name/12\",[12,46.367]],[\"comment/12\",[]],[\"name/13\",[13,51.475]],[\"comment/13\",[]],[\"name/14\",[1,40.489]],[\"comment/14\",[]],[\"name/15\",[2,40.489]],[\"comment/15\",[]],[\"name/16\",[14,46.367]],[\"comment/16\",[]],[\"name/17\",[15,51.475]],[\"comment/17\",[]],[\"name/18\",[16,51.475]],[\"comment/18\",[]],[\"name/19\",[17,43.002]],[\"comment/19\",[]],[\"name/20\",[1,40.489]],[\"comment/20\",[]],[\"name/21\",[2,40.489]],[\"comment/21\",[]],[\"name/22\",[14,46.367]],[\"comment/22\",[]],[\"name/23\",[18,51.475]],[\"comment/23\",[]],[\"name/24\",[4,29.503]],[\"comment/24\",[]],[\"name/25\",[19,40.489]],[\"comment/25\",[]],[\"name/26\",[20,40.489]],[\"comment/26\",[]],[\"name/27\",[21,40.489]],[\"comment/27\",[]],[\"name/28\",[22,40.489]],[\"comment/28\",[]],[\"name/29\",[23,40.489]],[\"comment/29\",[]],[\"name/30\",[24,40.489]],[\"comment/30\",[]],[\"name/31\",[25,40.489]],[\"comment/31\",[]],[\"name/32\",[26,40.489]],[\"comment/32\",[]],[\"name/33\",[27,40.489]],[\"comment/33\",[]],[\"name/34\",[28,51.475]],[\"comment/34\",[]],[\"name/35\",[4,29.503]],[\"comment/35\",[]],[\"name/36\",[29,40.489]],[\"comment/36\",[]],[\"name/37\",[30,40.489]],[\"comment/37\",[]],[\"name/38\",[31,40.489]],[\"comment/38\",[]],[\"name/39\",[32,40.489]],[\"comment/39\",[]],[\"name/40\",[33,40.489]],[\"comment/40\",[]],[\"name/41\",[34,40.489]],[\"comment/41\",[]],[\"name/42\",[35,40.489]],[\"comment/42\",[]],[\"name/43\",[36,40.489]],[\"comment/43\",[]],[\"name/44\",[37,40.489]],[\"comment/44\",[]],[\"name/45\",[38,40.489]],[\"comment/45\",[]],[\"name/46\",[39,40.489]],[\"comment/46\",[]],[\"name/47\",[40,40.489]],[\"comment/47\",[]],[\"name/48\",[41,40.489]],[\"comment/48\",[]],[\"name/49\",[42,51.475]],[\"comment/49\",[]],[\"name/50\",[4,29.503]],[\"comment/50\",[]],[\"name/51\",[43,51.475]],[\"comment/51\",[]],[\"name/52\",[44,51.475]],[\"comment/52\",[]],[\"name/53\",[45,51.475]],[\"comment/53\",[]],[\"name/54\",[17,43.002]],[\"comment/54\",[]],[\"name/55\",[46,51.475]],[\"comment/55\",[]],[\"name/56\",[47,46.367]],[\"comment/56\",[]],[\"name/57\",[48,46.367]],[\"comment/57\",[]],[\"name/58\",[49,51.475]],[\"comment/58\",[]],[\"name/59\",[50,51.475]],[\"comment/59\",[]],[\"name/60\",[17,43.002]],[\"comment/60\",[]],[\"name/61\",[51,51.475]],[\"comment/61\",[]],[\"name/62\",[52,51.475]],[\"comment/62\",[]],[\"name/63\",[53,51.475]],[\"comment/63\",[]],[\"name/64\",[54,51.475]],[\"comment/64\",[]],[\"name/65\",[47,46.367]],[\"comment/65\",[]],[\"name/66\",[48,46.367]],[\"comment/66\",[]],[\"name/67\",[55,46.367]],[\"comment/67\",[]],[\"name/68\",[56,23.543]],[\"comment/68\",[]],[\"name/69\",[4,29.503]],[\"comment/69\",[]],[\"name/70\",[5,40.489]],[\"comment/70\",[]],[\"name/71\",[6,40.489]],[\"comment/71\",[]],[\"name/72\",[7,40.489]],[\"comment/72\",[]],[\"name/73\",[8,40.489]],[\"comment/73\",[]],[\"name/74\",[57,46.367]],[\"comment/74\",[]],[\"name/75\",[56,23.543]],[\"comment/75\",[]],[\"name/76\",[4,29.503]],[\"comment/76\",[]],[\"name/77\",[5,40.489]],[\"comment/77\",[]],[\"name/78\",[6,40.489]],[\"comment/78\",[]],[\"name/79\",[7,40.489]],[\"comment/79\",[]],[\"name/80\",[8,40.489]],[\"comment/80\",[]],[\"name/81\",[58,46.367]],[\"comment/81\",[]],[\"name/82\",[56,23.543]],[\"comment/82\",[]],[\"name/83\",[4,29.503]],[\"comment/83\",[]],[\"name/84\",[5,40.489]],[\"comment/84\",[]],[\"name/85\",[6,40.489]],[\"comment/85\",[]],[\"name/86\",[7,40.489]],[\"comment/86\",[]],[\"name/87\",[8,40.489]],[\"comment/87\",[]],[\"name/88\",[59,46.367]],[\"comment/88\",[]],[\"name/89\",[60,43.002]],[\"comment/89\",[]],[\"name/90\",[55,46.367]],[\"comment/90\",[]],[\"name/91\",[57,46.367]],[\"comment/91\",[]],[\"name/92\",[61,51.475]],[\"comment/92\",[]],[\"name/93\",[58,46.367]],[\"comment/93\",[]],[\"name/94\",[59,46.367]],[\"comment/94\",[]],[\"name/95\",[62,46.367]],[\"comment/95\",[]],[\"name/96\",[60,43.002]],[\"comment/96\",[]],[\"name/97\",[63,46.367]],[\"comment/97\",[]],[\"name/98\",[64,46.367]],[\"comment/98\",[]],[\"name/99\",[65,46.367]],[\"comment/99\",[]],[\"name/100\",[62,46.367]],[\"comment/100\",[]],[\"name/101\",[66,46.367]],[\"comment/101\",[]],[\"name/102\",[60,43.002]],[\"comment/102\",[]],[\"name/103\",[67,51.475]],[\"comment/103\",[]],[\"name/104\",[68,46.367]],[\"comment/104\",[]],[\"name/105\",[69,46.367]],[\"comment/105\",[]],[\"name/106\",[70,46.367]],[\"comment/106\",[]],[\"name/107\",[71,51.475]],[\"comment/107\",[]],[\"name/108\",[72,51.475]],[\"comment/108\",[]],[\"name/109\",[73,51.475]],[\"comment/109\",[]],[\"name/110\",[74,51.475]],[\"comment/110\",[]],[\"name/111\",[66,46.367]],[\"comment/111\",[]],[\"name/112\",[75,51.475]],[\"comment/112\",[]],[\"name/113\",[56,23.543]],[\"comment/113\",[]],[\"name/114\",[76,51.475]],[\"comment/114\",[]],[\"name/115\",[10,46.367]],[\"comment/115\",[]],[\"name/116\",[11,46.367]],[\"comment/116\",[]],[\"name/117\",[12,46.367]],[\"comment/117\",[]],[\"name/118\",[77,51.475]],[\"comment/118\",[]],[\"name/119\",[78,51.475]],[\"comment/119\",[]],[\"name/120\",[1,40.489]],[\"comment/120\",[]],[\"name/121\",[2,40.489]],[\"comment/121\",[]],[\"name/122\",[79,40.489]],[\"comment/122\",[]],[\"name/123\",[80,40.489]],[\"comment/123\",[]],[\"name/124\",[68,46.367]],[\"comment/124\",[]],[\"name/125\",[56,23.543]],[\"comment/125\",[]],[\"name/126\",[4,29.503]],[\"comment/126\",[]],[\"name/127\",[29,40.489]],[\"comment/127\",[]],[\"name/128\",[30,40.489]],[\"comment/128\",[]],[\"name/129\",[31,40.489]],[\"comment/129\",[]],[\"name/130\",[32,40.489]],[\"comment/130\",[]],[\"name/131\",[81,43.002]],[\"comment/131\",[]],[\"name/132\",[82,43.002]],[\"comment/132\",[]],[\"name/133\",[33,40.489]],[\"comment/133\",[]],[\"name/134\",[34,40.489]],[\"comment/134\",[]],[\"name/135\",[35,40.489]],[\"comment/135\",[]],[\"name/136\",[36,40.489]],[\"comment/136\",[]],[\"name/137\",[37,40.489]],[\"comment/137\",[]],[\"name/138\",[38,40.489]],[\"comment/138\",[]],[\"name/139\",[39,40.489]],[\"comment/139\",[]],[\"name/140\",[40,40.489]],[\"comment/140\",[]],[\"name/141\",[41,40.489]],[\"comment/141\",[]],[\"name/142\",[69,46.367]],[\"comment/142\",[]],[\"name/143\",[56,23.543]],[\"comment/143\",[]],[\"name/144\",[4,29.503]],[\"comment/144\",[]],[\"name/145\",[29,40.489]],[\"comment/145\",[]],[\"name/146\",[30,40.489]],[\"comment/146\",[]],[\"name/147\",[31,40.489]],[\"comment/147\",[]],[\"name/148\",[32,40.489]],[\"comment/148\",[]],[\"name/149\",[81,43.002]],[\"comment/149\",[]],[\"name/150\",[82,43.002]],[\"comment/150\",[]],[\"name/151\",[33,40.489]],[\"comment/151\",[]],[\"name/152\",[34,40.489]],[\"comment/152\",[]],[\"name/153\",[35,40.489]],[\"comment/153\",[]],[\"name/154\",[36,40.489]],[\"comment/154\",[]],[\"name/155\",[37,40.489]],[\"comment/155\",[]],[\"name/156\",[38,40.489]],[\"comment/156\",[]],[\"name/157\",[39,40.489]],[\"comment/157\",[]],[\"name/158\",[40,40.489]],[\"comment/158\",[]],[\"name/159\",[41,40.489]],[\"comment/159\",[]],[\"name/160\",[70,46.367]],[\"comment/160\",[]],[\"name/161\",[56,23.543]],[\"comment/161\",[]],[\"name/162\",[4,29.503]],[\"comment/162\",[]],[\"name/163\",[29,40.489]],[\"comment/163\",[]],[\"name/164\",[30,40.489]],[\"comment/164\",[]],[\"name/165\",[31,40.489]],[\"comment/165\",[]],[\"name/166\",[32,40.489]],[\"comment/166\",[]],[\"name/167\",[81,43.002]],[\"comment/167\",[]],[\"name/168\",[82,43.002]],[\"comment/168\",[]],[\"name/169\",[33,40.489]],[\"comment/169\",[]],[\"name/170\",[34,40.489]],[\"comment/170\",[]],[\"name/171\",[35,40.489]],[\"comment/171\",[]],[\"name/172\",[36,40.489]],[\"comment/172\",[]],[\"name/173\",[37,40.489]],[\"comment/173\",[]],[\"name/174\",[38,40.489]],[\"comment/174\",[]],[\"name/175\",[39,40.489]],[\"comment/175\",[]],[\"name/176\",[40,40.489]],[\"comment/176\",[]],[\"name/177\",[41,40.489]],[\"comment/177\",[]],[\"name/178\",[63,46.367]],[\"comment/178\",[]],[\"name/179\",[56,23.543]],[\"comment/179\",[]],[\"name/180\",[4,29.503]],[\"comment/180\",[]],[\"name/181\",[19,40.489]],[\"comment/181\",[]],[\"name/182\",[83,43.002]],[\"comment/182\",[]],[\"name/183\",[84,43.002]],[\"comment/183\",[]],[\"name/184\",[20,40.489]],[\"comment/184\",[]],[\"name/185\",[21,40.489]],[\"comment/185\",[]],[\"name/186\",[22,40.489]],[\"comment/186\",[]],[\"name/187\",[23,40.489]],[\"comment/187\",[]],[\"name/188\",[24,40.489]],[\"comment/188\",[]],[\"name/189\",[25,40.489]],[\"comment/189\",[]],[\"name/190\",[26,40.489]],[\"comment/190\",[]],[\"name/191\",[27,40.489]],[\"comment/191\",[]],[\"name/192\",[85,43.002]],[\"comment/192\",[]],[\"name/193\",[79,40.489]],[\"comment/193\",[]],[\"name/194\",[80,40.489]],[\"comment/194\",[]],[\"name/195\",[64,46.367]],[\"comment/195\",[]],[\"name/196\",[56,23.543]],[\"comment/196\",[]],[\"name/197\",[4,29.503]],[\"comment/197\",[]],[\"name/198\",[19,40.489]],[\"comment/198\",[]],[\"name/199\",[83,43.002]],[\"comment/199\",[]],[\"name/200\",[84,43.002]],[\"comment/200\",[]],[\"name/201\",[20,40.489]],[\"comment/201\",[]],[\"name/202\",[21,40.489]],[\"comment/202\",[]],[\"name/203\",[22,40.489]],[\"comment/203\",[]],[\"name/204\",[23,40.489]],[\"comment/204\",[]],[\"name/205\",[24,40.489]],[\"comment/205\",[]],[\"name/206\",[25,40.489]],[\"comment/206\",[]],[\"name/207\",[26,40.489]],[\"comment/207\",[]],[\"name/208\",[27,40.489]],[\"comment/208\",[]],[\"name/209\",[85,43.002]],[\"comment/209\",[]],[\"name/210\",[79,40.489]],[\"comment/210\",[]],[\"name/211\",[80,40.489]],[\"comment/211\",[]],[\"name/212\",[65,46.367]],[\"comment/212\",[]],[\"name/213\",[56,23.543]],[\"comment/213\",[]],[\"name/214\",[4,29.503]],[\"comment/214\",[]],[\"name/215\",[19,40.489]],[\"comment/215\",[]],[\"name/216\",[83,43.002]],[\"comment/216\",[]],[\"name/217\",[84,43.002]],[\"comment/217\",[]],[\"name/218\",[20,40.489]],[\"comment/218\",[]],[\"name/219\",[21,40.489]],[\"comment/219\",[]],[\"name/220\",[22,40.489]],[\"comment/220\",[]],[\"name/221\",[23,40.489]],[\"comment/221\",[]],[\"name/222\",[24,40.489]],[\"comment/222\",[]],[\"name/223\",[25,40.489]],[\"comment/223\",[]],[\"name/224\",[26,40.489]],[\"comment/224\",[]],[\"name/225\",[27,40.489]],[\"comment/225\",[]],[\"name/226\",[85,43.002]],[\"comment/226\",[]],[\"name/227\",[79,40.489]],[\"comment/227\",[]],[\"name/228\",[80,40.489]],[\"comment/228\",[]],[\"name/229\",[86,51.475]],[\"comment/229\",[]],[\"name/230\",[56,23.543]],[\"comment/230\",[]],[\"name/231\",[87,51.475]],[\"comment/231\",[]],[\"name/232\",[56,23.543]],[\"comment/232\",[]],[\"name/233\",[88,51.475]],[\"comment/233\",[]],[\"name/234\",[56,23.543]],[\"comment/234\",[]],[\"name/235\",[89,51.475]],[\"comment/235\",[]],[\"name/236\",[56,23.543]],[\"comment/236\",[]],[\"name/237\",[90,51.475]],[\"comment/237\",[]],[\"name/238\",[56,23.543]],[\"comment/238\",[]],[\"name/239\",[91,51.475]],[\"comment/239\",[]],[\"name/240\",[56,23.543]],[\"comment/240\",[]],[\"name/241\",[92,51.475]],[\"comment/241\",[]],[\"name/242\",[56,23.543]],[\"comment/242\",[]],[\"name/243\",[93,51.475]],[\"comment/243\",[]],[\"name/244\",[56,23.543]],[\"comment/244\",[]],[\"name/245\",[94,51.475]],[\"comment/245\",[]],[\"name/246\",[56,23.543]],[\"comment/246\",[]],[\"name/247\",[95,51.475]],[\"comment/247\",[]],[\"name/248\",[56,23.543]],[\"comment/248\",[]],[\"name/249\",[96,51.475]],[\"comment/249\",[]],[\"name/250\",[56,23.543]],[\"comment/250\",[]],[\"name/251\",[97,51.475]],[\"comment/251\",[]],[\"name/252\",[56,23.543]],[\"comment/252\",[]],[\"name/253\",[98,51.475]],[\"comment/253\",[]],[\"name/254\",[56,23.543]],[\"comment/254\",[]],[\"name/255\",[99,51.475]],[\"comment/255\",[]],[\"name/256\",[56,23.543]],[\"comment/256\",[]]],\"invertedIndex\":[[\"__type\",{\"_index\":60,\"name\":{\"89\":{},\"96\":{},\"102\":{}},\"comment\":{}}],[\"_api\",{\"_index\":79,\"name\":{\"122\":{},\"193\":{},\"210\":{},\"227\":{}},\"comment\":{}}],[\"_checkinit\",{\"_index\":85,\"name\":{\"192\":{},\"209\":{},\"226\":{}},\"comment\":{}}],[\"_kdf\",{\"_index\":82,\"name\":{\"132\":{},\"150\":{},\"168\":{}},\"comment\":{}}],[\"_kem\",{\"_index\":76,\"name\":{\"114\":{}},\"comment\":{}}],[\"_prim\",{\"_index\":81,\"name\":{\"131\":{},\"149\":{},\"167\":{}},\"comment\":{}}],[\"_setup\",{\"_index\":80,\"name\":{\"123\":{},\"194\":{},\"211\":{},\"228\":{}},\"comment\":{}}],[\"_suiteid\",{\"_index\":84,\"name\":{\"183\":{},\"200\":{},\"217\":{}},\"comment\":{}}],[\"aead\",{\"_index\":12,\"name\":{\"12\":{},\"117\":{}},\"comment\":{}}],[\"aeadencryptioncontext\",{\"_index\":0,\"name\":{\"0\":{}},\"comment\":{}}],[\"aeadid\",{\"_index\":59,\"name\":{\"88\":{},\"94\":{}},\"comment\":{}}],[\"aeadinterface\",{\"_index\":3,\"name\":{\"3\":{}},\"comment\":{}}],[\"aes128gcm\",{\"_index\":55,\"name\":{\"67\":{},\"90\":{}},\"comment\":{}}],[\"aes256gcm\",{\"_index\":57,\"name\":{\"74\":{},\"91\":{}},\"comment\":{}}],[\"alghash\",{\"_index\":83,\"name\":{\"182\":{},\"199\":{},\"216\":{}},\"comment\":{}}],[\"baseerror\",{\"_index\":86,\"name\":{\"229\":{}},\"comment\":{}}],[\"buildlabeledikm\",{\"_index\":21,\"name\":{\"27\":{},\"185\":{},\"202\":{},\"219\":{}},\"comment\":{}}],[\"buildlabeledinfo\",{\"_index\":22,\"name\":{\"28\":{},\"186\":{},\"203\":{},\"220\":{}},\"comment\":{}}],[\"chacha20poly1305\",{\"_index\":61,\"name\":{\"92\":{}},\"comment\":{}}],[\"ciphersuite\",{\"_index\":75,\"name\":{\"112\":{}},\"comment\":{}}],[\"ciphersuiteparams\",{\"_index\":9,\"name\":{\"9\":{}},\"comment\":{}}],[\"ciphersuitesealresponse\",{\"_index\":49,\"name\":{\"58\":{}},\"comment\":{}}],[\"constructor\",{\"_index\":56,\"name\":{\"68\":{},\"75\":{},\"82\":{},\"113\":{},\"125\":{},\"143\":{},\"161\":{},\"179\":{},\"196\":{},\"213\":{},\"230\":{},\"232\":{},\"234\":{},\"236\":{},\"238\":{},\"240\":{},\"242\":{},\"244\":{},\"246\":{},\"248\":{},\"250\":{},\"252\":{},\"254\":{},\"256\":{}},\"comment\":{}}],[\"createencryptioncontext\",{\"_index\":8,\"name\":{\"8\":{},\"73\":{},\"80\":{},\"87\":{}},\"comment\":{}}],[\"createrecipientcontext\",{\"_index\":78,\"name\":{\"119\":{}},\"comment\":{}}],[\"createsendercontext\",{\"_index\":77,\"name\":{\"118\":{}},\"comment\":{}}],[\"ct\",{\"_index\":50,\"name\":{\"59\":{}},\"comment\":{}}],[\"decap\",{\"_index\":41,\"name\":{\"48\":{},\"141\":{},\"159\":{},\"177\":{}},\"comment\":{}}],[\"decaperror\",{\"_index\":93,\"name\":{\"243\":{}},\"comment\":{}}],[\"derivekeypair\",{\"_index\":39,\"name\":{\"46\":{},\"139\":{},\"157\":{},\"175\":{}},\"comment\":{}}],[\"derivekeypairerror\",{\"_index\":98,\"name\":{\"253\":{}},\"comment\":{}}],[\"deserializeerror\",{\"_index\":91,\"name\":{\"239\":{}},\"comment\":{}}],[\"deserializeprivatekey\",{\"_index\":36,\"name\":{\"43\":{},\"136\":{},\"154\":{},\"172\":{}},\"comment\":{}}],[\"deserializepublickey\",{\"_index\":34,\"name\":{\"41\":{},\"134\":{},\"152\":{},\"170\":{}},\"comment\":{}}],[\"dhkemp256hkdfsha256\",{\"_index\":68,\"name\":{\"104\":{},\"124\":{}},\"comment\":{}}],[\"dhkemp384hkdfsha384\",{\"_index\":69,\"name\":{\"105\":{},\"142\":{}},\"comment\":{}}],[\"dhkemp521hkdfsha512\",{\"_index\":70,\"name\":{\"106\":{},\"160\":{}},\"comment\":{}}],[\"dhkemsecp256k1hkdfsha256\",{\"_index\":71,\"name\":{\"107\":{}},\"comment\":{}}],[\"dhkemx25519hkdfsha256\",{\"_index\":72,\"name\":{\"108\":{}},\"comment\":{}}],[\"dhkemx448hkdfsha512\",{\"_index\":73,\"name\":{\"109\":{}},\"comment\":{}}],[\"ekm\",{\"_index\":54,\"name\":{\"64\":{}},\"comment\":{}}],[\"enc\",{\"_index\":17,\"name\":{\"19\":{},\"54\":{},\"60\":{}},\"comment\":{}}],[\"encap\",{\"_index\":40,\"name\":{\"47\":{},\"140\":{},\"158\":{},\"176\":{}},\"comment\":{}}],[\"encaperror\",{\"_index\":92,\"name\":{\"241\":{}},\"comment\":{}}],[\"encryptioncontext\",{\"_index\":13,\"name\":{\"13\":{}},\"comment\":{}}],[\"encsize\",{\"_index\":30,\"name\":{\"37\":{},\"128\":{},\"146\":{},\"164\":{}},\"comment\":{}}],[\"expand\",{\"_index\":24,\"name\":{\"30\":{},\"188\":{},\"205\":{},\"222\":{}},\"comment\":{}}],[\"export\",{\"_index\":14,\"name\":{\"16\":{},\"22\":{}},\"comment\":{}}],[\"exporterror\",{\"_index\":94,\"name\":{\"245\":{}},\"comment\":{}}],[\"exportonly\",{\"_index\":58,\"name\":{\"81\":{},\"93\":{}},\"comment\":{}}],[\"extract\",{\"_index\":23,\"name\":{\"29\":{},\"187\":{},\"204\":{},\"221\":{}},\"comment\":{}}],[\"extractandexpand\",{\"_index\":25,\"name\":{\"31\":{},\"189\":{},\"206\":{},\"223\":{}},\"comment\":{}}],[\"generatekeypair\",{\"_index\":38,\"name\":{\"45\":{},\"138\":{},\"156\":{},\"174\":{}},\"comment\":{}}],[\"hashsize\",{\"_index\":19,\"name\":{\"25\":{},\"181\":{},\"198\":{},\"215\":{}},\"comment\":{}}],[\"hkdfsha256\",{\"_index\":63,\"name\":{\"97\":{},\"178\":{}},\"comment\":{}}],[\"hkdfsha384\",{\"_index\":64,\"name\":{\"98\":{},\"195\":{}},\"comment\":{}}],[\"hkdfsha512\",{\"_index\":65,\"name\":{\"99\":{},\"212\":{}},\"comment\":{}}],[\"hpkeerror\",{\"_index\":87,\"name\":{\"231\":{}},\"comment\":{}}],[\"hybridkemx25519kyber768\",{\"_index\":74,\"name\":{\"110\":{}},\"comment\":{}}],[\"id\",{\"_index\":4,\"name\":{\"4\":{},\"24\":{},\"35\":{},\"50\":{},\"69\":{},\"76\":{},\"83\":{},\"126\":{},\"144\":{},\"162\":{},\"180\":{},\"197\":{},\"214\":{}},\"comment\":{}}],[\"importkey\",{\"_index\":37,\"name\":{\"44\":{},\"137\":{},\"155\":{},\"173\":{}},\"comment\":{}}],[\"info\",{\"_index\":47,\"name\":{\"56\":{},\"65\":{}},\"comment\":{}}],[\"init\",{\"_index\":20,\"name\":{\"26\":{},\"184\":{},\"201\":{},\"218\":{}},\"comment\":{}}],[\"invalidparamerror\",{\"_index\":88,\"name\":{\"233\":{}},\"comment\":{}}],[\"kdf\",{\"_index\":11,\"name\":{\"11\":{},\"116\":{}},\"comment\":{}}],[\"kdfid\",{\"_index\":62,\"name\":{\"95\":{},\"100\":{}},\"comment\":{}}],[\"kdfinterface\",{\"_index\":18,\"name\":{\"23\":{}},\"comment\":{}}],[\"kem\",{\"_index\":10,\"name\":{\"10\":{},\"115\":{}},\"comment\":{}}],[\"kemid\",{\"_index\":66,\"name\":{\"101\":{},\"111\":{}},\"comment\":{}}],[\"keminterface\",{\"_index\":28,\"name\":{\"34\":{}},\"comment\":{}}],[\"key\",{\"_index\":43,\"name\":{\"51\":{}},\"comment\":{}}],[\"keysize\",{\"_index\":5,\"name\":{\"5\":{},\"70\":{},\"77\":{},\"84\":{}},\"comment\":{}}],[\"labeledexpand\",{\"_index\":27,\"name\":{\"33\":{},\"191\":{},\"208\":{},\"225\":{}},\"comment\":{}}],[\"labeledextract\",{\"_index\":26,\"name\":{\"32\":{},\"190\":{},\"207\":{},\"224\":{}},\"comment\":{}}],[\"messagelimitreachederror\",{\"_index\":97,\"name\":{\"251\":{}},\"comment\":{}}],[\"noncesize\",{\"_index\":6,\"name\":{\"6\":{},\"71\":{},\"78\":{},\"85\":{}},\"comment\":{}}],[\"notassigned\",{\"_index\":67,\"name\":{\"103\":{}},\"comment\":{}}],[\"notsupportederror\",{\"_index\":99,\"name\":{\"255\":{}},\"comment\":{}}],[\"open\",{\"_index\":2,\"name\":{\"2\":{},\"15\":{},\"21\":{},\"121\":{}},\"comment\":{}}],[\"openerror\",{\"_index\":96,\"name\":{\"249\":{}},\"comment\":{}}],[\"presharedkey\",{\"_index\":42,\"name\":{\"49\":{}},\"comment\":{}}],[\"privatekeysize\",{\"_index\":32,\"name\":{\"39\":{},\"130\":{},\"148\":{},\"166\":{}},\"comment\":{}}],[\"psk\",{\"_index\":48,\"name\":{\"57\":{},\"66\":{}},\"comment\":{}}],[\"publickeysize\",{\"_index\":31,\"name\":{\"38\":{},\"129\":{},\"147\":{},\"165\":{}},\"comment\":{}}],[\"recipientcontext\",{\"_index\":15,\"name\":{\"17\":{}},\"comment\":{}}],[\"recipientcontextparams\",{\"_index\":44,\"name\":{\"52\":{}},\"comment\":{}}],[\"recipientkey\",{\"_index\":45,\"name\":{\"53\":{}},\"comment\":{}}],[\"recipientpublickey\",{\"_index\":52,\"name\":{\"62\":{}},\"comment\":{}}],[\"seal\",{\"_index\":1,\"name\":{\"1\":{},\"14\":{},\"20\":{},\"120\":{}},\"comment\":{}}],[\"sealerror\",{\"_index\":95,\"name\":{\"247\":{}},\"comment\":{}}],[\"secretsize\",{\"_index\":29,\"name\":{\"36\":{},\"127\":{},\"145\":{},\"163\":{}},\"comment\":{}}],[\"sendercontext\",{\"_index\":16,\"name\":{\"18\":{}},\"comment\":{}}],[\"sendercontextparams\",{\"_index\":51,\"name\":{\"61\":{}},\"comment\":{}}],[\"senderkey\",{\"_index\":53,\"name\":{\"63\":{}},\"comment\":{}}],[\"senderpublickey\",{\"_index\":46,\"name\":{\"55\":{}},\"comment\":{}}],[\"serializeerror\",{\"_index\":90,\"name\":{\"237\":{}},\"comment\":{}}],[\"serializeprivatekey\",{\"_index\":35,\"name\":{\"42\":{},\"135\":{},\"153\":{},\"171\":{}},\"comment\":{}}],[\"serializepublickey\",{\"_index\":33,\"name\":{\"40\":{},\"133\":{},\"151\":{},\"169\":{}},\"comment\":{}}],[\"tagsize\",{\"_index\":7,\"name\":{\"7\":{},\"72\":{},\"79\":{},\"86\":{}},\"comment\":{}}],[\"validationerror\",{\"_index\":89,\"name\":{\"235\":{}},\"comment\":{}}]],\"pipeline\":[]}}"); \ No newline at end of file +window.searchData = "data:application/octet-stream;base64,H4sIAAAAAAAAA7VdbY/bOJL+Kwf3154eFfWeb3OzwU4we7vBNLA4oBEEjq2kjXa7DdvJTV+Q/74iJcrFUhVFvQwwwLQjsqpYT7FYfEjL31enl/87r948fF897Q7b1RuVZrerw/q5Wr1Z/VKtt28Pm9Pr8bJ7Ofz6crhUf15Wt6uvp339dFd/PH1eb6rzz2zDu8fL875uvdmvz+eq1rFa/bjt1ERJ0ek5V+v9OLE3bRck+3Z1XJ+qw0W0W1D+cqwOI5W3XSYqJw5+Z1VKRnQNvA6FSCWd3N02TNiNaSiP42qboOiper3f/X+g6TfX1jNUHl4Om2qEUtx+htrL+ssIpdfW41Q6kbk5VetLFTwBiQly75EmoXj9dXd8rE73X3eX6v36tH4+c7b0GoXH7VP1HC7xpmnNj6ZvqaRy+3mMStN6psp17ekROtvm45Vi5IKi6C9I4VPS9+zUPSVtByut/jy+nEa476brcFV8OW9/2p1/2h1q7GrktuGGlDmkqrPlj2qzO+7qfhTUy+uxNog+9sOJouW+OmyrkydSnAbh87s6bMKk3TQteahc60YGJKOrF4w+eIKUS4HJKO8F5WzlcoByfh4XnKIBKHh+33721jT4+dySpifLV9E4hglqHtfnR2md7ytDrUepdPDaHXYsWszYmpbTVX36uttv/7H+VO2r7bsndq3ta+13WsiAw+eXCRY0vaabUAfuab0J9Pi18RyFx/UhMHq7trPH98th+3aU4l6v6SbsG6jejvF0r88C6sOHT7uMU46TX/XsT37o+ezkR2V5kx82TFBzrupNw0VMfz11Tvvpauu1PlzntfF0hcevn/a7ze/y3rWvlnaZofy0+1ZvzMZpp31GqSd10Wm33tdS3tsRhWLN9JtuxraaaojQcwmPdF4e6xLccRmfjDRF6jrdmN2zLgyDDcDNpyv9Uh2qU2P8+/XuFKa632kOBLX3xqmnXaYrr1Pb+hicBU3TOSMNVmabjlOGFsX3p+r+sW6/FcIJP5+7KPZk+RZFxzCZ4gzT8+QJfkERdhLdrMsEG98y3HEn21+AwyP/hvTlRysMZRwp4LPCxw6MU342G1rvEuQzpN99CaN2ws7IZ8mO7ot82/hx5hzPT2OtabosZIzAQN9X6/0f1fn4cjizZZTQNHye8FsXn9gbz85FsnzcrPBq902LYfUiAShnIqbZhDTknX2Sihu2ewBhGJIPxtqCe802oeKJGVF55eFkRqiVko6od1TGGWGIkG5EO8bkmgEz1LU++qU61x//vrli0Wr4uXviDfUUrjT9pp5pl9PXzeXlNCDtxm0qndRZ04YrI0GN99x3QDo98xVUDB/2DujpH/QKmkJOeAd00dNdQdPwsW5fz6gjXSkqRp/lMuN1g7vO9kJwN0+WCm4kTQxu34y9mjoq2LFaf7D7pXuCHasICHa/Hm+wY01Bwe7X5Ql2rCkg2Ht6pga7EyUBwT46YlDwvzVHXv867F97llwfLRL+RFxQckfWhQc8VeSJ+GH5UshTJUMxP6xJDnqqazjqh7VJYU91DcU9q2lS4PfiY2SaZy2JFUrz6+27a7R8W5926097e11o+xN4ozxL0/i6I/j4Ud8pGJJ10zXzXDLaSgj1ay6/mjvcwafwrjVL1kuWw2G9XYcZen99XG8e1yp6/7J/hThKQ9Uz/WZYweTDAf1Oj3Ga6Q0WEqLNvZW2sy84UZTrUzkuyM2/LxPjWNRQiDfmCL7+7Wn7+b6GLs3CtNw5HTwKBzBuxcRFMk5v02G23nrBHKe36TBKL40sNyyawGq6hsZV9czHlf73heIKiRqMK2OO4Od/vlx+OZ93Xw7VkMXW0W4Pj8oBhP/2+FQ9v6/j0x/ajAV8z7mW1BHrD3bREtpzriWpAn/4i5bQnjMtua82x9q5TzANIr77TJv+V6UplNMMYvrOtSZJimlY9XpOt+S310+n3bYb3++vn6pTnhWB1si9R1nUy6JOEmyzqOnq5XnRdgsRz70CGD1bZMNF5U1iHLDBAlQf8UV1UflHekG91Xo8vVyqTa31v8aboTIFCX9hXrRDMGOGVnRnXtZKrsrP1upcmxfV9m7LT9Db38vxF6LlsGM7LWyTePl7wCym32KWObeuRTtGXbgO0Opctxa1jrppHZIE1sddQBJoWi2bBPDgP56ry9djgCG23aKm4EzvKwWtWUybRTK/JHfSCsANJJyME03ZhSemERYwlzYHLREubi5kEb3POWgOd6dzIVv4q56DFsnXPZeyi78FOmyYfBN0Ics+1ir6RYVokG0+MauMMYwrO2S7hPpjCbNCL9QGzEPvTdaFLPTetR20cfC+7eJ+7N99HeFI/vbrX+DJCVYO39JdyM7+5d3hxYm9wLuQPdK93kGrfHd7F8OUu/IbgKV07Xchu9zbwCFr6Jqt7ub7Z5Qd/cvCM9J/r7jk2T3XKKfNgsVlX+6M4tIdyNjikjFldHEZZMFgcclYMrm4DLLIX1wy5kwrLoNsCSkuGYvmFJdhdoUUl5xhc4rLIMt8xSVj0CLFZZhhcnHJ2bVAcSmZNa24ZOfhzLItyMIRxSVj4wLF5Ug/DpVtXkdOLdpGe3KClUsUl0F2DhWX3OI0sbgMsiesuGSsmldcBmI6XFyyWE4vLoPs8hWX/Bo6uqgL9M8oO6YUl2L67xWX/IGta5TTZsHisi93RnHpDmRsccmYMrq4DLJgsLhkLJlcXAZZ5C8uGXOmFZdBtoQUl4xFc4rLMLtCikvOsDnFZZBlvuKSMWiR4jLMMLm45OxaoLiUzJpWXLLzcGbZFmThiOKSsXGB4nKkH4fKNq8jpxZtoz05wcolissgO4eKS25xmlhcBtkTVlwyVs0rLgMxHS4uWSynF5dBdvmKS34NHV3UBfpnlB1Tiksx/aPi0nMavvAh+BJn35OOvGecdA/r672STdLKvo1tnu71/stvtdRB1dd2E5ftgOPPs7568W7Y+ajhksbI76wTo4C+rm6eTunldZJ633vrFrQEf206yJQxX5sOOCYiL1mTTODeZDdXs/N+NVlx751qi4y4/4K7gaHz77abZ4vwpjvJEs9L7hayI8gh8tvu5lnxcfNYbZ7eheQGp+lflzO5K3o9U2bd0AvwCn9Br5+2593PGzxB9RycLnxeusQx6aTT0RmHosP6huqQTuvUOsSje6AO6VQvVYf4TsoG6pDrIdlSdYjvLMKTa65RMKEO8egMrEM69TPrkFBLPHUIb8qEOsR3ouBfAq9HCdPWPq9m36KHFE9Z7YZHPFiH0KFPrkM8toTVIZ0l8+qQEDuCHDKrDvFYMVyHXJPUcnWIL2d66pCrKUvUIT6veOsQlLYXqUPkwzbPGdvCR2tLnKhNOkibcX42rG+oDum0Tq1DPLoH6pBO9VJ1iO9QZaAOuZ6nLFWH+GhrT665RsGEOsSjM7AO6dTPrENCLfHUIbwpE+oQH/nsXwKvrPO0tc+r2bfoIcVTVrvhEQ/WIXTok+sQjy1hdUhnybw6JMSOIIfMqkM8VgzXIdcktVwd4suZnjrkasoSdYjPK946BKXtReoQ+Vzmv9fn6u3pxNQN3ZNFqhBXWtBLwK6mCSXU8UkwvXuyTAHlSJtWP3Wm8kN5d/i23u+25l2c/JB6LRYZGi910hD7Q+CH+m/daq1f7MUPlDxfZJiczEmDpMbzQ7y3twT4EbqPFxkgI3LS+Ijlwj3B6zUIfoC0wTI3BDmh064HUvv5Yb7VJ/L8AK+PFhkaETdpUMhaCTVxONdHCyE1fzjIWgEd8/Y1AZ7rs2XwIfKmAYQMltLGei9ljPbJQskCS5uYJ6yp/FD+dayE9N49WWQorrRJQ7mayg/lf6rzef2l+sfueXf5o1rXFeqWH5nUcJGBeoVPGrc4Lil9oPtSUhqhTRZKJ6zYiWmlNwp+uP98udx/PeoZK8Hda7HIYHmpk8baH8KPD7er2prqz9Wb76tv1elc1zF1Q3UX35V1z8+7ar+tpT40htZ6Xp6ftawP7bN/V9oA3aJp8nO0un2IblO4S/L0w4fbB9vDPDD/YJpB/Qluk+guKUqnGTjNVP1Jcc2U0yyuP8Wc0thpltSfkltV3qVR7DRLnGZp/SnllKZOs6z+lHHNMqdZXn/KuWa506yoPxVcs8JpVoPyUHIjLV33am9DdJtkd3GWuw4mQBgkgG3pYqFp6Yc6ZrmWLhyg3Q4sIOAiAokYBy4mkEqRAC4qoL0PCWulCwxoACBlrXSxAY0BZGxLFx7QMEANd3wXRcpt6SKkImnkygVIgTgHyFxR4siVi48y+BTceJSLjxKnjHLxURoFKFkzXYCURkFFbEsXIKVRULyPXICURkHxTnIBUhoFFbMtXYBiDYNKuJaxi1BsEGIzRuxCFJt8xiaNmGQ0jYNi80bsQhRrIBQLZuxiFKcSmLELUWwgYsGMXYhijUPMghm7EMUah5gFM3YhijUOMQtm7EKUaBxiFszEhSjROMQsmIkLUaJxiFkwExeixKw6LJgJWXc0DjELZuJClGggYnYdSFyMEg1EzGKUuBglGoiExShxMUo0EAmLUeJilGggEsUFXeJilEZS0KUuRKnGIWEXjdSFKNU4JAnb0oUo1TgkbIpPXYjSREzcKakOzCxiF4PUhUjfa39Ici4hpy5EqYGoYFu6EKUGIrYCSF2IUo1DypZiqQtRFoljz1yMMg1ECpzMzMUo00CkbIBkLkaZBiJlcc9cjDINRMrinrkYZano+YwUcZno+czFKNNApCnb0sVIv1z2Ic1uVXyXJm7MZy5GWSlNjsyFKNc4sEkpdxHKNQxsTspdgHKNAl+XuvjkGgQ2I+UuPLmBh3V67sKTp6KDcheePJMclJMqOxcd5IKTF6KDXGzyUnSQi00RSQ4qXGwKM3vYWCtccAolOqhw0SliyUGFi06RSA4qXHCKVHJQ4WJTZJKDChebIhcdRPZAZuKUrINccAoNQRZxKatw0SkjcdqWLjwliPFbuvCUGoOMTYOlC08Zi5CXLj5lIo69dAEqDUDsPqx0ESoz0UulC1GpgchiVqaLUWnmD7vLKMlW1WDEe57uViNxSM0z3NZkuIxvS3askRId0DzDbTUeWc5u8iKya400IhkLa/MMtzVwscA2z3BbM6WEbTvZvUaGWGCDsHmG22pkcnY1bp7htibv8Zv3iOBmuIScXZGhxzN4cKNMg+ETcn5rTrkGwyjwuRIo22BIhZzfyFPCwfAKAoVCOYeGdBBIFIJbQzvwsU55B8Mu5HxMUubB8As5uw8Ewj2ATD4AYR9Aph9AUX7IoMZuSYAwEGB4hoLdlADhIEB5ZhuhIUDJpQUQIgKUWFwAYSKgoSKEoRHQDOPA74mBsBFgOAd+VwyEjwDDOvD7YiCMBBjeoQA28RFOAgzzUCi+LSX2zJ6X3XED4SXAsA/8nhsIMwGGgOB33UDICTAUBL/vBkJPQMNPsEUKEIICGoaCrVOAUBTQcBR8PBCSAgwVwe+/gdAUYMgIfgcOhKgAQ0cICwuhKiDxJMmEUrIi5weErQDDSQjTgvAV0BAWghsIbIaXEKYF4SzAMBPCtCCsBRhuQpgWhLcAQ08I04JQF2AICmFaEPICDEUhTAtCX4AhKYRpQQgMMDSFMC1SSqan8rQgJAYYqkKYFoTGAENWCNOCEBnQMBl8PBAqAwxhIUwLQmaAoSyEGorQGdDwGfy0IIQGGNqCnxaE0QDDWwjTgnAaYJgLYVoQVgMMdyFMi4weg2TytCDMBhj+QpgWhNsAw2AI04KwG2BIDGFaEIIDDI8hTAvCcYChMoRpQWgOMGyGMC0I0wGG0BCmBSE7wFAawrQgdAcYUkOYFoTwgIbx4OMhpwdYuTwtCO0BDe/B7vCAMB9gCA5hWhDyAwqR3wVCf4AhOfgzIiAECBiao4jZMCMUCBimo0j4tgQ2Q3bwp09AiBAwfAd//gSECwFDefAnUEDoEDCsB38GBYQRAcN78KdQQDgRMMwHfw4FhBUBw33wJ1FAeBEw7Ad/FgWEGQHDfxQpfwBKcDMMiLBfIOwIGA5E2C8QfgQagoQ/AiYMCRgeRAh1wpGAYUL4UCckCRgqRAh1QpOAIUOEUCdEiTJkCB/qihAlypAhwkErIUqUIUOEo1ZClChDhgiHrYQoUYYMEY5bCVGiDBnCh7oiRIkyZAgf6ooQJcqQIXyoK0KUKEOG8KGuCFGiDBnCh7oiRIlqiBL+eJwQJcqQIXyoK0KUKEOG8BybIkSJ8hAlihAlCuRzf8KTKPCc/BOeRBkuhA91RXgSZbgQIdQJT6IMFyKEOuFJlOFChFCndzQMGSKEOr2m0RAlfKj3bmooOdTpXQ3DhgihTm9rGDZECHV6YcOwIUKo0ysbhg4RQp1e2jB0iBDq9NqGoUOEUKcXNwwdUrDcnSJUiTJ0iBDqhCpRDVXCcmyKUCUqls9lFKFKlKFDCuGSDcHN0CGSXIKboUMK9gRYEapExfLqpghVogwdUrLnxYpQJSqWTzgVoUqUoUNKlqdWhCpRiQc3QpUoQ4eULKetCFWiEg9uhCpRhg4pWf5bEapEJR7cCFeiDB9Ssly5IlyJSjy4Ea5EGT6kZLlyRbgSlXhwI1yJMnxIyc83wpWo1IMb4UqU4UNKfr4RrkSlHtwIV6IMH1Ly841wJSr14Ea4EmX4kJKfb4QrMW8yFOU2uJn7tt8qfQP3XXPv9uGh+x3s76uP7WXcLLJ3g7+v6tr9zfcft6u6HjX/10dX9R8/rrdx9SetrPmG4lVKnYY7KZqCb7rXtbX5Q1cezR91XhYEmm9fNt/PvoqtV4Kr2LIVq2ueVlomSTMv8EVyFJITW/PS1ipNJ0hy9A+3omFmSE5dnwi9mtcaI/WA1UOrNSmtetEp7RcwkaQI+zm2fk6sn8F6RhyR+Sq+fhsCEpogoYXFLLKYgWRe80OvVzmAvWyd7O1dHTan16P+StvG/hLqVRwaauSR4Y4lRYFYFG04S0CZ7rXe0+f1xpkU8VVILPY9gyq+bBygUxSvDaq1dtn4cz1XqYT8KiFvYS1BkrD/8mje8YCwjDGW3US0MwakGfNpfa6q5rsGSBgKd136CF31qwTaL3DvnpzRKBT4qvWHZjTaCLMTGoJEm7cUINko2lRhZWdWtg1jJbl/87iu/1PR8WX/CrHe96GkiOwupRy4MT/Hem5+VhvlCJyzIKDzUX9r9YxFoBiWPIP669/yPVXn48vh7BiSIDGplA+cL3egMETIZ61z8xa3LqrA5h+V2pRm/yWzSS63Sc6uKcr20vVx+4eNg9jmsdg2jlvduihr/7CNE9s4sY0T29gmdr10t3/Yxqk0AZpfZvYmpAKlltYl7ViKVmEhJbtG+sn+7jMjPC9w2IiwGzln87PWnJAcCxExd/qkKM+mkt72zcwouNAMsX7XB4ftympRzyWHGIG9hFOi7KUSKfU2r89+ql6P5vXZKG2jiLdRoU9JW6NsAmoCeUhw3ziEkC70JBndF3z7EnA6jGVfdxLaX2x40m9WR8NEk7ObcXbKgA11fegwrMC8lZ/KR/VAB6mdm2DnlD4sEeTrF3Mf66n2WJdh5/a92yi54kiPrFglLdKNtLhIWmnm7ZlIGq48oy4RiWM30lIFrTTzDiw0gXB9FVmXZt6RnquNHuwT8MPNcfEXifNBS/qzrvOhFMTg4iqSpnYjJkkKYXi4OoikAKzcRTxF4ZBJKNWJ0ykFcSJqJ6ANTNGb7WvoUZJBaCR29tqVAFKbdnIppxuB/VmIC4dEqq28KwFgP0qZoJZwNu/+QjMLDSi2A+qKly5lyV5u34+DqiAEjl1QwRa+ys4HpaT5UJlvhjtjw7sBu7T6u/ddnGAXS+m26fxy2DvZJ8XLbJt9StHH9r1FyCN4DbG5v8itR2whoETgG5FrLa3nbVTbdfs4u2tWUectyVz7kxTc2oWGndg0ZssfSG1o5FJo6I0ADTco8YplzbV2lzZKQAJIyN/IwWW3pkoZScjaKECsHfrIzCuDJLMMgXHd4EiR+nh8YjY4OV6QpYh4fP102m27/Pz0+qk65foKAkqseNKAlODcrSpeZVvr2//HLVa2js3a0eVtFBRd4W3DwhbD+oZIC7NNBhYiJfIVzc+30CIAuaaT3uWs1EZTLoU63a4lSJ6N5kwCnPJACuXNbsyF9VpkWQ+x4t017wcyO61+EOC6LpbGQxglwKu6nVHi7rru7GKfoTWotL6MpLjR3TmaAhzLpc4uhQVOhWMNl4CoOxPDMQMWdQOXpo7uz1mukOWxFJckIhOUd1JZ4SvNgihNtJ7O23HnbTgXkgUt9cAsBCia446Gs3EY2cyqJL92gvvLF3Jwx1SWdkMb2ckslsvPzas19vrVGqfm1Rr95RmnPdGVh7r0qagzMS/QOrEddd4OupDGfHi5rM/n3ZdD5UYULhUjKYrrzmf7Qon+eJx1TtL/cqwOjqdRJ5vWbCKx+VXyjZbVNwPTZYlUXR9PVb2WnaotDW9kj6ez3RD2SkvUvdvydhVht0XPpBR1PD851qAJajfOcl+7i+wZhbJkV8t0RVlX0ovrgI8wAcyzSdsqKqDPtSVoGU6l4qETQzHDuUUK3a4zu9lOEW6ZpF9TfM7Y0dCtM22GsF6WFhMtqx+6KQ5dyZvNT39SkBWafR0L0bG9XS2bSf4R2SzAa420tDu9+/CmyFWZNJsbGRQYtNwM2M4CmyDrxZzk4YpwyRPLiPiZIgSrJU7BVpeQ2oUrlx3j5YmQh7pdebcapjYyMymZXdZfaCzh0492WWnNtkRyISWhb93rEfsVHl4fYhaLD7er4+5YL5uHutXDhx8//gNB5Od3l8UAAA=="; \ No newline at end of file diff --git a/core/docs/assets/style.css b/core/docs/assets/style.css index 258146fc0..108428c3f 100644 --- a/core/docs/assets/style.css +++ b/core/docs/assets/style.css @@ -910,8 +910,9 @@ a.tsd-index-link { box-shadow: 0 0 4px rgba(0, 0, 0, 0.25); } #tsd-search .results li { - padding: 0 10px; background-color: var(--color-background); + line-height: initial; + padding: 4px; } #tsd-search .results li:nth-child(even) { background-color: var(--color-background-secondary); @@ -924,7 +925,10 @@ a.tsd-index-link { background-color: var(--color-accent); } #tsd-search .results a { - display: block; + display: flex; + align-items: center; + padding: 0.25rem; + box-sizing: border-box; } #tsd-search .results a:before { top: 10px; @@ -1134,7 +1138,7 @@ img { } .deprecated { - text-decoration: line-through; + text-decoration: line-through !important; } .warning { diff --git a/core/docs/classes/Aes128Gcm.html b/core/docs/classes/Aes128Gcm.html index 891b8f3f7..66fc2c038 100644 --- a/core/docs/classes/Aes128Gcm.html +++ b/core/docs/classes/Aes128Gcm.html @@ -1,13 +1,13 @@ -Aes128Gcm | @hpke/core
    +Aes128Gcm | @hpke/core
    -
    +
    @@ -35,31 +35,31 @@

    Implements

    +
  • Defined in ../src/aeads/aesGcm.ts:101
  • - +

    Constructors

    - +
    • @@ -74,7 +74,7 @@
    +
  • Defined in ../src/aeads/aesGcm.ts:103
  • keySize: number = 16
    @@ -83,7 +83,7 @@
    +
  • Defined in ../src/aeads/aesGcm.ts:105
  • nonceSize: number = 12
    @@ -92,7 +92,7 @@
    +
  • Defined in ../src/aeads/aesGcm.ts:107
  • tagSize: number = 16
    @@ -101,7 +101,7 @@
    +
  • Defined in ../src/aeads/aesGcm.ts:109
  • Methods

    @@ -117,26 +117,27 @@

    Parameters

  • key: ArrayBuffer

    A byte string of the raw key.

    -
  • + +

    Returns AeadEncryptionContext

    An AEAD encryption context.

    +
  • Defined in ../src/aeads/aesGcm.ts:111
  • @@ -150,50 +151,30 @@

    tagSize
  • createEncryptionContext
  • +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/core/docs/classes/Aes256Gcm.html b/core/docs/classes/Aes256Gcm.html index c9a2f79ac..035b8e129 100644 --- a/core/docs/classes/Aes256Gcm.html +++ b/core/docs/classes/Aes256Gcm.html @@ -1,13 +1,13 @@ -Aes256Gcm | @hpke/core
    +Aes256Gcm | @hpke/core
    -
    +
    @@ -32,31 +32,31 @@

    Hierarchy

    • Aes256Gcm
    +
  • Defined in ../src/aeads/aesGcm.ts:140
  • - +

    Constructors

    - +
    • @@ -72,7 +72,7 @@
    +
  • Defined in ../src/aeads/aesGcm.ts:142
  • keySize: number = 32
    @@ -81,7 +81,7 @@
    +
  • Defined in ../src/aeads/aesGcm.ts:144
  • nonceSize: number = 12
    @@ -90,7 +90,7 @@
    +
  • Defined in ../src/aeads/aesGcm.ts:146
  • tagSize: number = 16
    @@ -99,7 +99,7 @@
    +
  • Defined in ../src/aeads/aesGcm.ts:148
  • Methods

    @@ -115,26 +115,27 @@

    Parameters

  • key: ArrayBuffer

    A byte string of the raw key.

    -
  • + +

    Returns AeadEncryptionContext

    An AEAD encryption context.

    +
  • Defined in ../src/aeads/aesGcm.ts:111
  • @@ -148,50 +149,30 @@

    tagSize
  • createEncryptionContext
  • +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/core/docs/classes/BaseError.html b/core/docs/classes/BaseError.html index 7bbccdc33..878b25a76 100644 --- a/core/docs/classes/BaseError.html +++ b/core/docs/classes/BaseError.html @@ -1,13 +1,13 @@ -BaseError | @hpke/core
    +BaseError | @hpke/core
    -
    +
    @@ -28,19 +28,19 @@

    Hierarchy

    +
  • Defined in ../src/errors.ts:4
  • - +

    Constructors

    -

    Properties

    -
    cause? +
    cause? message name stack? @@ -48,7 +48,7 @@

    Properties

    Constructors

    - +
    +
  • Defined in ../src/errors.ts:5
  • Properties

    @@ -91,15 +91,15 @@
    @@ -112,50 +112,30 @@

    name
  • stack
  • +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/core/docs/classes/CipherSuite.html b/core/docs/classes/CipherSuite.html index 2012372cb..92f681e30 100644 --- a/core/docs/classes/CipherSuite.html +++ b/core/docs/classes/CipherSuite.html @@ -1,13 +1,13 @@ -CipherSuite | @hpke/core
    +CipherSuite | @hpke/core
    -
    +
    @@ -66,30 +66,30 @@

    Hierarchy

    • CipherSuite
    +
  • Defined in src/native.ts:75
  • - +

    Constructors

    -

    Properties

    -

    Accessors

    -

    Methods

    -
    _setup +
    _setup createRecipientContext createSenderContext open @@ -98,7 +98,7 @@

    Methods

    Constructors

    - +
    +
    +

    Returns CipherSuite

    +
  • Defined in ../src/cipherSuiteNative.ts:131
  • Properties

    @@ -124,13 +125,13 @@
    +
  • Defined in ../src/algorithm.ts:19
  • +
  • Defined in ../src/cipherSuiteNative.ts:119
  • Accessors

    @@ -144,7 +145,7 @@

    Returns

    +
  • Defined in ../src/cipherSuiteNative.ts:176
    • @@ -156,7 +157,7 @@

      Returns

    +
  • Defined in ../src/cipherSuiteNative.ts:169
  • +
  • Defined in ../src/cipherSuiteNative.ts:162
  • Methods

    @@ -179,7 +180,7 @@
    +
  • Defined in ../src/algorithm.ts:23
    • @@ -195,7 +196,8 @@

      Parameters

    • params: RecipientContextParams

      A set of parameters for the recipient encryption context.

      -
    + +

    Returns Promise<EncryptionContext>

    A recipient encryption context.

    @@ -203,7 +205,7 @@

    Throws

    DecapError

    +
  • Defined in ../src/cipherSuiteNative.ts:217
    • @@ -218,7 +220,8 @@

      Parameters

    • params: SenderContextParams

      A set of parameters for the sender encryption context.

      -
    + +

    Returns Promise<SenderContext>

    A sender encryption context.

    @@ -226,7 +229,7 @@

    Throws

    EncapError

    +
  • Defined in ../src/cipherSuiteNative.ts:189
    • @@ -241,15 +244,18 @@

      Parameters

    • params: RecipientContextParams

      A set of parameters for building a recipient encryption context.

      -
    • + +
    • ct: ArrayBuffer

      An encrypted text as bytes to be decrypted.

      -
    • + +
    • aad: ArrayBuffer = EMPTY

      Additional authenticated data as bytes fed by an application.

      -
    + +

    Returns Promise<ArrayBuffer>

    A decrypted plain text as bytes.

    @@ -257,7 +263,7 @@

    Throws

    DecapError

    +
  • Defined in ../src/cipherSuiteNative.ts:269
    • @@ -272,15 +278,18 @@

      Parameters

    • params: SenderContextParams

      A set of parameters for building a sender encryption context.

      -
    • + +
    • pt: ArrayBuffer

      A plain text as bytes to be encrypted.

      -
    • + +
    • aad: ArrayBuffer = EMPTY

      Additional authenticated data as bytes fed by an application.

      -
    + +

    Returns Promise<CipherSuiteSealResponse>

    A cipher text and an encapsulated key as bytes.

    @@ -288,20 +297,20 @@

    Throws

    EncapError

    +
  • Defined in ../src/cipherSuiteNative.ts:246
  • @@ -320,50 +329,30 @@

    open
  • seal
  • +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/core/docs/classes/DecapError.html b/core/docs/classes/DecapError.html index 36843663c..053d512c1 100644 --- a/core/docs/classes/DecapError.html +++ b/core/docs/classes/DecapError.html @@ -1,13 +1,13 @@ -DecapError | @hpke/core
    +DecapError | @hpke/core
    -
    +
    @@ -26,19 +26,19 @@

    Hierarchy

    • DecapError
    +
  • Defined in ../src/errors.ts:54
  • - +

    Constructors

    -

    Properties

    -
    cause? +
    cause? message name stack? @@ -46,7 +46,7 @@

    Properties

    Constructors

    - +
    +
  • Defined in ../src/errors.ts:5
  • Properties

    @@ -89,15 +89,15 @@
    @@ -110,50 +110,30 @@

    name
  • stack
  • +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/core/docs/classes/DeriveKeyPairError.html b/core/docs/classes/DeriveKeyPairError.html index 1899912f5..a7f919660 100644 --- a/core/docs/classes/DeriveKeyPairError.html +++ b/core/docs/classes/DeriveKeyPairError.html @@ -1,13 +1,13 @@ -DeriveKeyPairError | @hpke/core
    +DeriveKeyPairError | @hpke/core
    -
    +
    @@ -26,19 +26,19 @@

    Hierarchy

    • DeriveKeyPairError
    +
  • Defined in ../src/errors.ts:79
  • - +

    Constructors

    -

    Properties

    -
    cause? +
    cause? message name stack? @@ -46,7 +46,7 @@

    Properties

    Constructors

    - +
    +
  • Defined in ../src/errors.ts:5
  • Properties

    @@ -89,15 +89,15 @@
    @@ -110,50 +110,30 @@

    name
  • stack
  • +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/core/docs/classes/DeserializeError.html b/core/docs/classes/DeserializeError.html index d19fa19d6..a53abd4c9 100644 --- a/core/docs/classes/DeserializeError.html +++ b/core/docs/classes/DeserializeError.html @@ -1,13 +1,13 @@ -DeserializeError | @hpke/core
    +DeserializeError | @hpke/core
    -
    +
    @@ -26,19 +26,19 @@

    Hierarchy

    • DeserializeError
    +
  • Defined in ../src/errors.ts:44
  • - +

    Constructors

    -

    Properties

    -
    cause? +
    cause? message name stack? @@ -46,7 +46,7 @@

    Properties

    Constructors

    - +
    +
  • Defined in ../src/errors.ts:5
  • Properties

    @@ -89,15 +89,15 @@
    @@ -110,50 +110,30 @@

    name
  • stack
  • +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/core/docs/classes/DhkemP256HkdfSha256.html b/core/docs/classes/DhkemP256HkdfSha256.html index dd7ec8477..7a311e1b9 100644 --- a/core/docs/classes/DhkemP256HkdfSha256.html +++ b/core/docs/classes/DhkemP256HkdfSha256.html @@ -1,13 +1,13 @@ -DhkemP256HkdfSha256 | @hpke/core
    +DhkemP256HkdfSha256 | @hpke/core
    -
    +
    @@ -32,19 +32,19 @@

    Hierarchy

    • DhkemP256HkdfSha256
    +
  • Defined in src/native.ts:101
  • - +

    Constructors

    -

    Properties

    -
    _kdf +
    _kdf _prim encSize id @@ -54,7 +54,7 @@

    Properties

    Methods

    -
    decap +
    decap deriveKeyPair deserializePrivateKey deserializePublicKey @@ -67,14 +67,14 @@

    Methods

    Constructors

    - +
    +
  • Defined in ../src/kems/dhkemNative.ts:17
  • Properties

    @@ -82,43 +82,43 @@
    +
  • Defined in ../src/kems/dhkem.ts:41
  • _prim: DhkemPrimitives
    +
  • Defined in ../src/kems/dhkem.ts:40
  • encSize: number = 65
    +
  • Defined in ../src/kems/dhkemNative.ts:13
  • id: KemId = KemId.DhkemP256HkdfSha256
    +
  • Defined in ../src/kems/dhkemNative.ts:11
  • privateKeySize: number = 32
    +
  • Defined in ../src/kems/dhkemNative.ts:15
  • publicKeySize: number = 65
    +
  • Defined in ../src/kems/dhkemNative.ts:14
  • secretSize: number = 32
    +
  • Defined in ../src/kems/dhkemNative.ts:12
  • Methods

    @@ -134,7 +134,7 @@
    params: Returns Promise<ArrayBuffer>
    +
  • Defined in ../src/kems/dhkem.ts:148
    • @@ -148,7 +148,7 @@
      ikm: Returns Promise<CryptoKeyPair>
    +
  • Defined in ../src/kems/dhkem.ts:80
    • @@ -162,7 +162,7 @@
      key: Returns Promise<CryptoKey>
    +
  • Defined in ../src/kems/dhkem.ts:64
    • @@ -176,7 +176,7 @@
      key: Returns Promise<CryptoKey>
    +
  • Defined in ../src/kems/dhkem.ts:56
  • +
  • Defined in ../src/kems/dhkem.ts:87
  • +
  • Defined in ../src/kems/dhkem.ts:76
    • @@ -217,7 +217,7 @@
      isPublic: Returns Promise<CryptoKey>
    +
  • Defined in ../src/kems/dhkem.ts:68
    • @@ -231,7 +231,7 @@
      key: Returns Promise<ArrayBuffer>
    +
  • Defined in ../src/kems/dhkem.ts:60
    • @@ -245,20 +245,20 @@
      key: Returns Promise<ArrayBuffer>
    +
  • Defined in ../src/kems/dhkem.ts:52
  • @@ -283,50 +283,30 @@

    serializePrivateKey
  • serializePublicKey
  • +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/core/docs/classes/DhkemP384HkdfSha384.html b/core/docs/classes/DhkemP384HkdfSha384.html index bef175c15..735e96111 100644 --- a/core/docs/classes/DhkemP384HkdfSha384.html +++ b/core/docs/classes/DhkemP384HkdfSha384.html @@ -1,13 +1,13 @@ -DhkemP384HkdfSha384 | @hpke/core
    +DhkemP384HkdfSha384 | @hpke/core
    -
    +
    @@ -32,19 +32,19 @@

    Hierarchy

    • DhkemP384HkdfSha384
    +
  • Defined in src/native.ts:127
  • - +

    Constructors

    -

    Properties

    -
    _kdf +
    _kdf _prim encSize id @@ -54,7 +54,7 @@

    Properties

    Methods

    -
    decap +
    decap deriveKeyPair deserializePrivateKey deserializePublicKey @@ -67,14 +67,14 @@

    Methods

    Constructors

    - +
    +
  • Defined in ../src/kems/dhkemNative.ts:31
  • Properties

    @@ -82,43 +82,43 @@
    +
  • Defined in ../src/kems/dhkem.ts:41
  • _prim: DhkemPrimitives
    +
  • Defined in ../src/kems/dhkem.ts:40
  • encSize: number = 97
    +
  • Defined in ../src/kems/dhkemNative.ts:27
  • id: KemId = KemId.DhkemP384HkdfSha384
    +
  • Defined in ../src/kems/dhkemNative.ts:25
  • privateKeySize: number = 48
    +
  • Defined in ../src/kems/dhkemNative.ts:29
  • publicKeySize: number = 97
    +
  • Defined in ../src/kems/dhkemNative.ts:28
  • secretSize: number = 48
    +
  • Defined in ../src/kems/dhkemNative.ts:26
  • Methods

    @@ -134,7 +134,7 @@
    params: Returns Promise<ArrayBuffer>
    +
  • Defined in ../src/kems/dhkem.ts:148
    • @@ -148,7 +148,7 @@
      ikm: Returns Promise<CryptoKeyPair>
    +
  • Defined in ../src/kems/dhkem.ts:80
    • @@ -162,7 +162,7 @@
      key: Returns Promise<CryptoKey>
    +
  • Defined in ../src/kems/dhkem.ts:64
    • @@ -176,7 +176,7 @@
      key: Returns Promise<CryptoKey>
    +
  • Defined in ../src/kems/dhkem.ts:56
  • +
  • Defined in ../src/kems/dhkem.ts:87
  • +
  • Defined in ../src/kems/dhkem.ts:76
    • @@ -217,7 +217,7 @@
      isPublic: Returns Promise<CryptoKey>
    +
  • Defined in ../src/kems/dhkem.ts:68
    • @@ -231,7 +231,7 @@
      key: Returns Promise<ArrayBuffer>
    +
  • Defined in ../src/kems/dhkem.ts:60
    • @@ -245,20 +245,20 @@
      key: Returns Promise<ArrayBuffer>
    +
  • Defined in ../src/kems/dhkem.ts:52
  • @@ -283,50 +283,30 @@

    serializePrivateKey
  • serializePublicKey
  • +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/core/docs/classes/DhkemP521HkdfSha512.html b/core/docs/classes/DhkemP521HkdfSha512.html index 5c80fe471..90a048ffb 100644 --- a/core/docs/classes/DhkemP521HkdfSha512.html +++ b/core/docs/classes/DhkemP521HkdfSha512.html @@ -1,13 +1,13 @@ -DhkemP521HkdfSha512 | @hpke/core
    +DhkemP521HkdfSha512 | @hpke/core
    -
    +
    @@ -32,19 +32,19 @@

    Hierarchy

    • DhkemP521HkdfSha512
    +
  • Defined in src/native.ts:153
  • - +

    Constructors

    -

    Properties

    -
    _kdf +
    _kdf _prim encSize id @@ -54,7 +54,7 @@

    Properties

    Methods

    -
    decap +
    decap deriveKeyPair deserializePrivateKey deserializePublicKey @@ -67,14 +67,14 @@

    Methods

    Constructors

    - +
    +
  • Defined in ../src/kems/dhkemNative.ts:45
  • Properties

    @@ -82,43 +82,43 @@
    +
  • Defined in ../src/kems/dhkem.ts:41
  • _prim: DhkemPrimitives
    +
  • Defined in ../src/kems/dhkem.ts:40
  • encSize: number = 133
    +
  • Defined in ../src/kems/dhkemNative.ts:41
  • id: KemId = KemId.DhkemP521HkdfSha512
    +
  • Defined in ../src/kems/dhkemNative.ts:39
  • privateKeySize: number = 64
    +
  • Defined in ../src/kems/dhkemNative.ts:43
  • publicKeySize: number = 133
    +
  • Defined in ../src/kems/dhkemNative.ts:42
  • secretSize: number = 64
    +
  • Defined in ../src/kems/dhkemNative.ts:40
  • Methods

    @@ -134,7 +134,7 @@
    params: Returns Promise<ArrayBuffer>
    +
  • Defined in ../src/kems/dhkem.ts:148
    • @@ -148,7 +148,7 @@
      ikm: Returns Promise<CryptoKeyPair>
    +
  • Defined in ../src/kems/dhkem.ts:80
    • @@ -162,7 +162,7 @@
      key: Returns Promise<CryptoKey>
    +
  • Defined in ../src/kems/dhkem.ts:64
    • @@ -176,7 +176,7 @@
      key: Returns Promise<CryptoKey>
    +
  • Defined in ../src/kems/dhkem.ts:56
  • +
  • Defined in ../src/kems/dhkem.ts:87
  • +
  • Defined in ../src/kems/dhkem.ts:76
    • @@ -217,7 +217,7 @@
      isPublic: Returns Promise<CryptoKey>
    +
  • Defined in ../src/kems/dhkem.ts:68
    • @@ -231,7 +231,7 @@
      key: Returns Promise<ArrayBuffer>
    +
  • Defined in ../src/kems/dhkem.ts:60
    • @@ -245,20 +245,20 @@
      key: Returns Promise<ArrayBuffer>
    +
  • Defined in ../src/kems/dhkem.ts:52
  • @@ -283,50 +283,30 @@

    serializePrivateKey
  • serializePublicKey
  • +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/core/docs/classes/EncapError.html b/core/docs/classes/EncapError.html index f4dfd1e63..88ac8fe60 100644 --- a/core/docs/classes/EncapError.html +++ b/core/docs/classes/EncapError.html @@ -1,13 +1,13 @@ -EncapError | @hpke/core
    +EncapError | @hpke/core
    -
    +
    @@ -26,19 +26,19 @@

    Hierarchy

    • EncapError
    +
  • Defined in ../src/errors.ts:49
  • - +

    Constructors

    -

    Properties

    -
    cause? +
    cause? message name stack? @@ -46,7 +46,7 @@

    Properties

    Constructors

    - +
    +
  • Defined in ../src/errors.ts:5
  • Properties

    @@ -89,15 +89,15 @@
    @@ -110,50 +110,30 @@

    name
  • stack
  • +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/core/docs/classes/ExportError.html b/core/docs/classes/ExportError.html index 8f1766aea..ca63ba373 100644 --- a/core/docs/classes/ExportError.html +++ b/core/docs/classes/ExportError.html @@ -1,13 +1,13 @@ -ExportError | @hpke/core
    +ExportError | @hpke/core
    -
    +
    @@ -26,19 +26,19 @@

    Hierarchy

    • ExportError
    +
  • Defined in ../src/errors.ts:59
  • - +

    Constructors

    -

    Properties

    -
    cause? +
    cause? message name stack? @@ -46,7 +46,7 @@

    Properties

    Constructors

    - +
    +
  • Defined in ../src/errors.ts:5
  • Properties

    @@ -89,15 +89,15 @@
    @@ -110,50 +110,30 @@

    name
  • stack
  • +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/core/docs/classes/ExportOnly.html b/core/docs/classes/ExportOnly.html index e0f9568f5..14ffcdfe1 100644 --- a/core/docs/classes/ExportOnly.html +++ b/core/docs/classes/ExportOnly.html @@ -1,13 +1,13 @@ -ExportOnly | @hpke/core
    +ExportOnly | @hpke/core
    -
    +
    @@ -34,31 +34,31 @@

    Implements

    +
  • Defined in ../src/aeads/exportOnly.ts:32
  • - +

    Constructors

    - +
    • @@ -73,7 +73,7 @@
    +
  • Defined in ../src/aeads/exportOnly.ts:33
  • keySize: number = 0
    @@ -82,7 +82,7 @@
    +
  • Defined in ../src/aeads/exportOnly.ts:34
  • nonceSize: number = 0
    @@ -91,7 +91,7 @@
    +
  • Defined in ../src/aeads/exportOnly.ts:35
  • tagSize: number = 0
    @@ -100,7 +100,7 @@
    +
  • Defined in ../src/aeads/exportOnly.ts:36
  • Methods

    @@ -116,26 +116,27 @@

    Parameters

  • _key: ArrayBuffer

    A byte string of the raw key.

    -
  • + +

    Returns AeadEncryptionContext

    An AEAD encryption context.

    +
  • Defined in ../src/aeads/exportOnly.ts:38
  • @@ -149,50 +150,30 @@

    tagSize
  • createEncryptionContext
  • +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/core/docs/classes/HkdfSha256.html b/core/docs/classes/HkdfSha256.html index f8d8196a8..9324788be 100644 --- a/core/docs/classes/HkdfSha256.html +++ b/core/docs/classes/HkdfSha256.html @@ -1,13 +1,13 @@ -HkdfSha256 | @hpke/core
    +HkdfSha256 | @hpke/core
    -
    +
    @@ -34,19 +34,19 @@

    Hierarchy

    • HkdfSha256
    +
  • Defined in src/native.ts:182
  • - +

    Constructors

    -

    Properties

    -
    _api +
    _api _suiteId algHash hashSize @@ -54,7 +54,7 @@

    Properties

    Methods

    -
    _checkInit +
    _checkInit _setup buildLabeledIkm buildLabeledInfo @@ -68,14 +68,14 @@

    Methods

    Constructors

    - +
    +
  • Defined in ../src/kdfs/hkdf.ts:21
  • Properties

    @@ -83,13 +83,13 @@
    +
  • Defined in ../src/algorithm.ts:19
  • _suiteId: Uint8Array = EMPTY
    +
  • Defined in ../src/kdfs/hkdf.ts:14
  • algHash: HmacKeyGenParams = ...
    @@ -98,7 +98,7 @@
    +
  • Defined in ../src/kdfs/hkdf.ts:189
  • hashSize: number = 32
    @@ -107,7 +107,7 @@
    +
  • Defined in ../src/kdfs/hkdf.ts:187
  • id: KdfId = KdfId.HkdfSha256
    @@ -116,7 +116,7 @@
    +
  • Defined in ../src/kdfs/hkdf.ts:185
  • Methods

    @@ -127,7 +127,7 @@
    +
  • Defined in ../src/kdfs/hkdf.ts:176
    • @@ -136,7 +136,7 @@
    +
  • Defined in ../src/algorithm.ts:23
    • @@ -152,7 +152,7 @@
      ikm: Returns Uint8Array
    +
  • Defined in ../src/kdfs/hkdf.ts:29
    • @@ -170,7 +170,7 @@
      len: Returns Uint8Array
    +
  • Defined in ../src/kdfs/hkdf.ts:41
    • @@ -188,7 +188,7 @@
      len: Returns Promise<ArrayBuffer>
    +
  • Defined in ../src/kdfs/hkdf.ts:83
    • @@ -204,7 +204,7 @@
      ikm: Returns Promise<ArrayBuffer>
    +
  • Defined in ../src/kdfs/hkdf.ts:58
    • @@ -224,7 +224,7 @@
      len: Returns Promise<ArrayBuffer>
    +
  • Defined in ../src/kdfs/hkdf.ts:133
    • @@ -238,7 +238,7 @@
      suiteId: Returns void
    +
  • Defined in ../src/kdfs/hkdf.ts:25
    • @@ -258,7 +258,7 @@
      len: Returns Promise<ArrayBuffer>
    +
  • Defined in ../src/kdfs/hkdf.ts:167
    • @@ -276,20 +276,20 @@
      ikm: Returns Promise<ArrayBuffer>
    +
  • Defined in ../src/kdfs/hkdf.ts:159
  • @@ -313,50 +313,30 @@

    labeledExpand
  • labeledExtract
  • +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/core/docs/classes/HkdfSha384.html b/core/docs/classes/HkdfSha384.html index de4ac2e8a..276b122cc 100644 --- a/core/docs/classes/HkdfSha384.html +++ b/core/docs/classes/HkdfSha384.html @@ -1,13 +1,13 @@ -HkdfSha384 | @hpke/core
    +HkdfSha384 | @hpke/core
    -
    +
    @@ -34,19 +34,19 @@

    Hierarchy

    • HkdfSha384
    +
  • Defined in src/native.ts:211
  • - +

    Constructors

    -

    Properties

    -
    _api +
    _api _suiteId algHash hashSize @@ -54,7 +54,7 @@

    Properties

    Methods

    -
    _checkInit +
    _checkInit _setup buildLabeledIkm buildLabeledInfo @@ -68,14 +68,14 @@

    Methods

    Constructors

    - +
    +
  • Defined in ../src/kdfs/hkdf.ts:21
  • Properties

    @@ -83,13 +83,13 @@
    +
  • Defined in ../src/algorithm.ts:19
  • _suiteId: Uint8Array = EMPTY
    +
  • Defined in ../src/kdfs/hkdf.ts:14
  • algHash: HmacKeyGenParams = ...
    @@ -98,7 +98,7 @@
    +
  • Defined in ../src/kdfs/hkdf.ts:202
  • hashSize: number = 48
    @@ -107,7 +107,7 @@
    +
  • Defined in ../src/kdfs/hkdf.ts:200
  • id: KdfId = KdfId.HkdfSha384
    @@ -116,7 +116,7 @@
    +
  • Defined in ../src/kdfs/hkdf.ts:198
  • Methods

    @@ -127,7 +127,7 @@
    +
  • Defined in ../src/kdfs/hkdf.ts:176
    • @@ -136,7 +136,7 @@
    +
  • Defined in ../src/algorithm.ts:23
    • @@ -152,7 +152,7 @@
      ikm: Returns Uint8Array
    +
  • Defined in ../src/kdfs/hkdf.ts:29
    • @@ -170,7 +170,7 @@
      len: Returns Uint8Array
    +
  • Defined in ../src/kdfs/hkdf.ts:41
    • @@ -188,7 +188,7 @@
      len: Returns Promise<ArrayBuffer>
    +
  • Defined in ../src/kdfs/hkdf.ts:83
    • @@ -204,7 +204,7 @@
      ikm: Returns Promise<ArrayBuffer>
    +
  • Defined in ../src/kdfs/hkdf.ts:58
    • @@ -224,7 +224,7 @@
      len: Returns Promise<ArrayBuffer>
    +
  • Defined in ../src/kdfs/hkdf.ts:133
    • @@ -238,7 +238,7 @@
      suiteId: Returns void
    +
  • Defined in ../src/kdfs/hkdf.ts:25
    • @@ -258,7 +258,7 @@
      len: Returns Promise<ArrayBuffer>
    +
  • Defined in ../src/kdfs/hkdf.ts:167
    • @@ -276,20 +276,20 @@
      ikm: Returns Promise<ArrayBuffer>
    +
  • Defined in ../src/kdfs/hkdf.ts:159
  • @@ -313,50 +313,30 @@

    labeledExpand
  • labeledExtract
  • +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/core/docs/classes/HkdfSha512.html b/core/docs/classes/HkdfSha512.html index 82f3f4d53..c22304513 100644 --- a/core/docs/classes/HkdfSha512.html +++ b/core/docs/classes/HkdfSha512.html @@ -1,13 +1,13 @@ -HkdfSha512 | @hpke/core
    +HkdfSha512 | @hpke/core
    -
    +
    @@ -34,19 +34,19 @@

    Hierarchy

    • HkdfSha512
    +
  • Defined in src/native.ts:240
  • - +

    Constructors

    -

    Properties

    -
    _api +
    _api _suiteId algHash hashSize @@ -54,7 +54,7 @@

    Properties

    Methods

    -
    _checkInit +
    _checkInit _setup buildLabeledIkm buildLabeledInfo @@ -68,14 +68,14 @@

    Methods

    Constructors

    - +
    +
  • Defined in ../src/kdfs/hkdf.ts:21
  • Properties

    @@ -83,13 +83,13 @@
    +
  • Defined in ../src/algorithm.ts:19
  • _suiteId: Uint8Array = EMPTY
    +
  • Defined in ../src/kdfs/hkdf.ts:14
  • algHash: HmacKeyGenParams = ...
    @@ -98,7 +98,7 @@
    +
  • Defined in ../src/kdfs/hkdf.ts:215
  • hashSize: number = 64
    @@ -107,7 +107,7 @@
    +
  • Defined in ../src/kdfs/hkdf.ts:213
  • id: KdfId = KdfId.HkdfSha512
    @@ -116,7 +116,7 @@
    +
  • Defined in ../src/kdfs/hkdf.ts:211
  • Methods

    @@ -127,7 +127,7 @@
    +
  • Defined in ../src/kdfs/hkdf.ts:176
    • @@ -136,7 +136,7 @@
    +
  • Defined in ../src/algorithm.ts:23
    • @@ -152,7 +152,7 @@
      ikm: Returns Uint8Array
    +
  • Defined in ../src/kdfs/hkdf.ts:29
    • @@ -170,7 +170,7 @@
      len: Returns Uint8Array
    +
  • Defined in ../src/kdfs/hkdf.ts:41
    • @@ -188,7 +188,7 @@
      len: Returns Promise<ArrayBuffer>
    +
  • Defined in ../src/kdfs/hkdf.ts:83
    • @@ -204,7 +204,7 @@
      ikm: Returns Promise<ArrayBuffer>
    +
  • Defined in ../src/kdfs/hkdf.ts:58
    • @@ -224,7 +224,7 @@
      len: Returns Promise<ArrayBuffer>
    +
  • Defined in ../src/kdfs/hkdf.ts:133
    • @@ -238,7 +238,7 @@
      suiteId: Returns void
    +
  • Defined in ../src/kdfs/hkdf.ts:25
    • @@ -258,7 +258,7 @@
      len: Returns Promise<ArrayBuffer>
    +
  • Defined in ../src/kdfs/hkdf.ts:167
    • @@ -276,20 +276,20 @@
      ikm: Returns Promise<ArrayBuffer>
    +
  • Defined in ../src/kdfs/hkdf.ts:159
  • @@ -313,50 +313,30 @@

    labeledExpand
  • labeledExtract
  • +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/core/docs/classes/HpkeError.html b/core/docs/classes/HpkeError.html index 42346d469..f3ba69068 100644 --- a/core/docs/classes/HpkeError.html +++ b/core/docs/classes/HpkeError.html @@ -1,13 +1,13 @@ -HpkeError | @hpke/core
    +HpkeError | @hpke/core
    -
    +
    @@ -39,19 +39,19 @@

    Hierarchy

  • DeriveKeyPairError
  • NotSupportedError
  • +
  • Defined in ../src/errors.ts:24
  • - +

    Constructors

    -

    Properties

    -
    cause? +
    cause? message name stack? @@ -59,7 +59,7 @@

    Properties

    Constructors

    - +
    +
  • Defined in ../src/errors.ts:5
  • Properties

    @@ -102,15 +102,15 @@
    @@ -123,50 +123,30 @@

    name
  • stack
  • +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/core/docs/classes/InvalidParamError.html b/core/docs/classes/InvalidParamError.html index 3360f51b8..b06ce2130 100644 --- a/core/docs/classes/InvalidParamError.html +++ b/core/docs/classes/InvalidParamError.html @@ -1,13 +1,13 @@ -InvalidParamError | @hpke/core
    +InvalidParamError | @hpke/core
    -
    +
    @@ -26,19 +26,19 @@

    Hierarchy

    • InvalidParamError
    +
  • Defined in ../src/errors.ts:29
  • - +

    Constructors

    -

    Properties

    -
    cause? +
    cause? message name stack? @@ -46,7 +46,7 @@

    Properties

    Constructors

    - +
    +
  • Defined in ../src/errors.ts:5
  • Properties

    @@ -89,15 +89,15 @@
    @@ -110,50 +110,30 @@

    name
  • stack
  • +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/core/docs/classes/MessageLimitReachedError.html b/core/docs/classes/MessageLimitReachedError.html index 2a8893105..d01b721a1 100644 --- a/core/docs/classes/MessageLimitReachedError.html +++ b/core/docs/classes/MessageLimitReachedError.html @@ -1,13 +1,13 @@ -MessageLimitReachedError | @hpke/core
    +MessageLimitReachedError | @hpke/core
    -
    +
    @@ -26,19 +26,19 @@

    Hierarchy

    • MessageLimitReachedError
    +
  • Defined in ../src/errors.ts:74
  • - +

    Constructors

    -

    Properties

    -
    cause? +
    cause? message name stack? @@ -46,7 +46,7 @@

    Properties

    Constructors

    - +
    +
  • Defined in ../src/errors.ts:5
  • Properties

    @@ -89,15 +89,15 @@
    @@ -110,50 +110,30 @@

    name
  • stack
  • +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/core/docs/classes/NotSupportedError.html b/core/docs/classes/NotSupportedError.html index d2bd21567..2040eb09b 100644 --- a/core/docs/classes/NotSupportedError.html +++ b/core/docs/classes/NotSupportedError.html @@ -1,13 +1,13 @@ -NotSupportedError | @hpke/core
    +NotSupportedError | @hpke/core
    -
    +
    @@ -26,19 +26,19 @@

    Hierarchy

    • NotSupportedError
    +
  • Defined in ../src/errors.ts:84
  • - +

    Constructors

    -

    Properties

    -
    cause? +
    cause? message name stack? @@ -46,7 +46,7 @@

    Properties

    Constructors

    - +
    +
  • Defined in ../src/errors.ts:5
  • Properties

    @@ -89,15 +89,15 @@
    @@ -110,50 +110,30 @@

    name
  • stack
  • +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/core/docs/classes/OpenError.html b/core/docs/classes/OpenError.html index 91cc90753..bb8c086c0 100644 --- a/core/docs/classes/OpenError.html +++ b/core/docs/classes/OpenError.html @@ -1,13 +1,13 @@ -OpenError | @hpke/core
    +OpenError | @hpke/core
    -
    +
    @@ -26,19 +26,19 @@

    Hierarchy

    • OpenError
    +
  • Defined in ../src/errors.ts:69
  • - +

    Constructors

    -

    Properties

    -
    cause? +
    cause? message name stack? @@ -46,7 +46,7 @@

    Properties

    Constructors

    - +
    +
  • Defined in ../src/errors.ts:5
  • Properties

    @@ -89,15 +89,15 @@
    @@ -110,50 +110,30 @@

    name
  • stack
  • +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/core/docs/classes/SealError.html b/core/docs/classes/SealError.html index 81fc4e719..9de1fb5b4 100644 --- a/core/docs/classes/SealError.html +++ b/core/docs/classes/SealError.html @@ -1,13 +1,13 @@ -SealError | @hpke/core
    +SealError | @hpke/core
    -
    +
    @@ -26,19 +26,19 @@

    Hierarchy

    • SealError
    +
  • Defined in ../src/errors.ts:64
  • - +

    Constructors

    -

    Properties

    -
    cause? +
    cause? message name stack? @@ -46,7 +46,7 @@

    Properties

    Constructors

    - +
    +
  • Defined in ../src/errors.ts:5
  • Properties

    @@ -89,15 +89,15 @@
    @@ -110,50 +110,30 @@

    name
  • stack
  • +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/core/docs/classes/SerializeError.html b/core/docs/classes/SerializeError.html index 883280eab..f8e971998 100644 --- a/core/docs/classes/SerializeError.html +++ b/core/docs/classes/SerializeError.html @@ -1,13 +1,13 @@ -SerializeError | @hpke/core
    +SerializeError | @hpke/core
    -
    +
    @@ -26,19 +26,19 @@

    Hierarchy

    • SerializeError
    +
  • Defined in ../src/errors.ts:39
  • - +

    Constructors

    -

    Properties

    -
    cause? +
    cause? message name stack? @@ -46,7 +46,7 @@

    Properties

    Constructors

    - +
    +
  • Defined in ../src/errors.ts:5
  • Properties

    @@ -89,15 +89,15 @@
    @@ -110,50 +110,30 @@

    name
  • stack
  • +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/core/docs/classes/ValidationError.html b/core/docs/classes/ValidationError.html index 8b68a30c8..4d8f69757 100644 --- a/core/docs/classes/ValidationError.html +++ b/core/docs/classes/ValidationError.html @@ -1,13 +1,13 @@ -ValidationError | @hpke/core
    +ValidationError | @hpke/core
    -
    +
    @@ -26,19 +26,19 @@

    Hierarchy

    • ValidationError
    +
  • Defined in ../src/errors.ts:34
  • - +

    Constructors

    -

    Properties

    -
    cause? +
    cause? message name stack? @@ -46,7 +46,7 @@

    Properties

    Constructors

    - +
    +
  • Defined in ../src/errors.ts:5
  • Properties

    @@ -89,15 +89,15 @@
    @@ -110,50 +110,30 @@

    name
  • stack
  • +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/core/docs/index.html b/core/docs/index.html index c249e0078..62d973e50 100644 --- a/core/docs/index.html +++ b/core/docs/index.html @@ -1,13 +1,13 @@ -@hpke/core
    +@hpke/core
    -
    +
    @@ -69,15 +69,15 @@

    @hpke/core

    @@ -104,50 +104,30 @@

    Browsers
  • Contributing
  • +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/core/docs/interfaces/AeadEncryptionContext.html b/core/docs/interfaces/AeadEncryptionContext.html index 653499a73..40a3a4aa2 100644 --- a/core/docs/interfaces/AeadEncryptionContext.html +++ b/core/docs/interfaces/AeadEncryptionContext.html @@ -1,13 +1,13 @@ -AeadEncryptionContext | @hpke/core
    +AeadEncryptionContext | @hpke/core
    -
    +
    @@ -24,21 +24,21 @@

    Hierarchy

    • AeadEncryptionContext
    +
  • Defined in ../src/interfaces/aeadEncryptionContext.ts:7
  • - +

    Methods

    -

    Methods

    - +
    • @@ -50,20 +50,23 @@

      Parameters

    • iv: ArrayBuffer

      An initialization vector.

      -
    • +
    +
  • data: ArrayBuffer

    A plain text as bytes to be encrypted.

    -
  • +
    +
  • aad: ArrayBuffer

    Additional authenticated data as bytes fed by an application.

    -
  • + +

    Returns Promise<ArrayBuffer>

    A decrypted plain text as bytes.

    +
  • Defined in ../src/interfaces/aeadEncryptionContext.ts:30
    • @@ -77,33 +80,36 @@

      Parameters

    • iv: ArrayBuffer

      An initialization vector.

      -
    • + +
    • data: ArrayBuffer

      A plain text as bytes to be encrypted.

      -
    • + +
    • aad: ArrayBuffer

      Additional authenticated data as bytes fed by an application.

      -
    + +

    Returns Promise<ArrayBuffer>

    A cipher text as bytes.

    +
  • Defined in ../src/interfaces/aeadEncryptionContext.ts:16
  • @@ -113,50 +119,30 @@

    open
  • seal
  • +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/core/docs/interfaces/AeadInterface.html b/core/docs/interfaces/AeadInterface.html index dbd3f9614..4d10e844c 100644 --- a/core/docs/interfaces/AeadInterface.html +++ b/core/docs/interfaces/AeadInterface.html @@ -1,13 +1,13 @@ -AeadInterface | @hpke/core
    +AeadInterface | @hpke/core
    -
    +
    @@ -29,33 +29,33 @@

    Implemented by

  • Aes128Gcm
  • ExportOnly
  • +
  • Defined in ../src/interfaces/aeadInterface.ts:8
  • - +

    Properties

    - +
    id: AeadId

    The KDF identifier.

    +
  • Defined in ../src/interfaces/aeadInterface.ts:10
  • keySize: number
    @@ -63,7 +63,7 @@
    +
  • Defined in ../src/interfaces/aeadInterface.ts:12
  • nonceSize: number
    @@ -71,7 +71,7 @@
    +
  • Defined in ../src/interfaces/aeadInterface.ts:14
  • tagSize: number
    @@ -79,7 +79,7 @@
    +
  • Defined in ../src/interfaces/aeadInterface.ts:16
  • Methods

    @@ -95,25 +95,26 @@

    Parameters

  • key: ArrayBuffer

    A byte string of the raw key.

    -
  • +
    +

    Returns AeadEncryptionContext

    An AEAD encryption context.

    +
  • Defined in ../src/interfaces/aeadInterface.ts:24
  • @@ -126,50 +127,30 @@

    tagSize
  • createEncryptionContext
  • +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/core/docs/interfaces/CipherSuiteParams.html b/core/docs/interfaces/CipherSuiteParams.html index abe8044b6..511d02148 100644 --- a/core/docs/interfaces/CipherSuiteParams.html +++ b/core/docs/interfaces/CipherSuiteParams.html @@ -1,13 +1,13 @@ -CipherSuiteParams | @hpke/core
    +CipherSuiteParams | @hpke/core
    -
    +
    @@ -24,28 +24,28 @@

    Hierarchy

    • CipherSuiteParams
    +
  • Defined in ../src/interfaces/cipherSuiteParams.ts:9
  • - +

    Properties

    -

    Properties

    - +

    The AEAD (Authenticated Encryption with Addtional Data) identifier or the AEAD object.

    +
  • Defined in ../src/interfaces/cipherSuiteParams.ts:17
  • @@ -53,7 +53,7 @@
    +
  • Defined in ../src/interfaces/cipherSuiteParams.ts:14
  • @@ -61,20 +61,20 @@
    +
  • Defined in ../src/interfaces/cipherSuiteParams.ts:11
  • @@ -85,50 +85,30 @@

    kdf
  • kem
  • +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/core/docs/interfaces/CipherSuiteSealResponse.html b/core/docs/interfaces/CipherSuiteSealResponse.html index d94ca5077..2ae6e7106 100644 --- a/core/docs/interfaces/CipherSuiteSealResponse.html +++ b/core/docs/interfaces/CipherSuiteSealResponse.html @@ -1,13 +1,13 @@ -CipherSuiteSealResponse | @hpke/core
    +CipherSuiteSealResponse | @hpke/core
    -
    +
    @@ -24,27 +24,27 @@

    Hierarchy

    • CipherSuiteSealResponse
    +
  • Defined in ../src/interfaces/responses.ts:4
  • - +

    Properties

    -

    Properties

    - +
    ct: ArrayBuffer

    The ciphertext as bytes.

    +
  • Defined in ../src/interfaces/responses.ts:6
  • enc: ArrayBuffer
    @@ -52,20 +52,20 @@
    +
  • Defined in ../src/interfaces/responses.ts:8
  • @@ -75,50 +75,30 @@

    ct
  • enc
  • +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/core/docs/interfaces/EncryptionContext.html b/core/docs/interfaces/EncryptionContext.html index fa4d5cb49..87b5df532 100644 --- a/core/docs/interfaces/EncryptionContext.html +++ b/core/docs/interfaces/EncryptionContext.html @@ -1,13 +1,13 @@ -EncryptionContext | @hpke/core
    +EncryptionContext | @hpke/core
    -
    +
    @@ -28,22 +28,22 @@

    Hierarchy

    +
  • Defined in ../src/interfaces/encryptionContext.ts:6
  • - +

    Methods

    -

    Methods

    - +
    • @@ -56,11 +56,13 @@

      Parameters

    • exporterContext: ArrayBuffer

      An exporter context string as bytes. The maximum length is 128 bytes.

      -
    • +
    +
  • len: number

    A desired length in bytes of the output secret.

    -
  • +
    +

    Returns Promise<ArrayBuffer>

    A secret string as bytes.

    @@ -68,7 +70,7 @@

    Throws

    E

    +
  • Defined in ../src/interfaces/exporter.ts:15
    • @@ -83,18 +85,20 @@

      Parameters

    • data: ArrayBuffer

      An encrypted text as bytes to be decrypted.

      -
    • + +
    • Optional aad: ArrayBuffer

      Additional authenticated data as bytes fed by an application.

      -
      Optional
    + +

    Returns Promise<ArrayBuffer>

    A decrypted plain text as bytes.

    Throws

    OpenError

    +
  • Defined in ../src/interfaces/encryptionContext.ts:29
    • @@ -109,31 +113,33 @@

      Parameters

    • data: ArrayBuffer

      A plain text as bytes to be encrypted.

      -
    • + +
    • Optional aad: ArrayBuffer

      Additional authenticated data as bytes fed by an application.

      -
      Optional
    + +

    Returns Promise<ArrayBuffer>

    A cipher text as bytes.

    +
  • Defined in ../src/interfaces/encryptionContext.ts:17
  • @@ -144,50 +150,30 @@

    open
  • seal
  • +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/core/docs/interfaces/KdfInterface.html b/core/docs/interfaces/KdfInterface.html index 31f874440..523c517b6 100644 --- a/core/docs/interfaces/KdfInterface.html +++ b/core/docs/interfaces/KdfInterface.html @@ -1,13 +1,13 @@ -KdfInterface | @hpke/core
    +KdfInterface | @hpke/core
    -
    +
    @@ -24,20 +24,20 @@

    Hierarchy

    • KdfInterface
    +
  • Defined in ../src/interfaces/kdfInterface.ts:6
  • - +

    Properties

    -

    Methods

    -
    buildLabeledIkm +
    buildLabeledIkm buildLabeledInfo expand extract @@ -49,13 +49,13 @@

    Methods

    Properties

    - +
    hashSize: number

    The output size of the extract() function in bytes (Nh).

    +
  • Defined in ../src/interfaces/kdfInterface.ts:10
  • id: KdfId
    @@ -63,7 +63,7 @@
    +
  • Defined in ../src/interfaces/kdfInterface.ts:8
  • Methods

    @@ -79,14 +79,15 @@

    Parameters

  • label: Uint8Array

    A byte string indicating the cryptographic context/operation.

    -
  • +
    +
  • ikm: Uint8Array
  • Returns Uint8Array

    An input keying material as bytes.

    +
  • Defined in ../src/interfaces/kdfInterface.ts:26
    • @@ -100,20 +101,23 @@

      Parameters

    • label: Uint8Array

      A byte string indicating the cryptographic context/operation.

      -
    • +
    +
  • info: Uint8Array

    An additional byte string.

    -
  • + +
  • len: number

    The length of the output byte string.

    -
  • + +

    Returns Uint8Array

    An info string as bytes.

    +
  • Defined in ../src/interfaces/kdfInterface.ts:36
    • @@ -127,20 +131,23 @@

      Parameters

    • prk: ArrayBuffer

      A pseudorandom key.

      -
    • + +
    • info: ArrayBuffer

      An additional byte string.

      -
    • + +
    • len: number

      The length in bytes of the output keying material.

      -
    + +

    Returns Promise<ArrayBuffer>

    An output keying material as bytes.

    +
  • Defined in ../src/interfaces/kdfInterface.ts:62
    • @@ -154,16 +161,18 @@

      Parameters

    • salt: ArrayBuffer

      An additional random byte string.

      -
    • + +
    • ikm: ArrayBuffer

      An input keying material

      -
    + +

    Returns Promise<ArrayBuffer>

    A pseudorandom key as bytes.

    +
  • Defined in ../src/interfaces/kdfInterface.ts:49
    • @@ -177,24 +186,28 @@

      Parameters

    • salt: ArrayBuffer

      An additional random byte string.

      -
    • + +
    • ikm: ArrayBuffer

      An input keying material

      -
    • + +
    • info: ArrayBuffer

      An additional byte string.

      -
    • + +
    • len: number

      The length in bytes of the output keying material.

      -
    + +

    Returns Promise<ArrayBuffer>

    An output keying material as bytes.

    +
  • Defined in ../src/interfaces/kdfInterface.ts:77
    • @@ -208,11 +221,12 @@

      Parameters

    • suiteId: Uint8Array

      A suite_id defined in RFC9180.

      -
    + +

    Returns void

    +
  • Defined in ../src/interfaces/kdfInterface.ts:17
    • @@ -226,24 +240,28 @@

      Parameters

    • prk: ArrayBuffer

      A pseudorandom key.

      -
    • + +
    • label: Uint8Array

      A byte string indicating the cryptographic context/operation.

      -
    • + +
    • info: Uint8Array

      An additional byte string.

      -
    • + +
    • len: number

      The length in bytes of the output keying material.

      -
    + +

    Returns Promise<ArrayBuffer>

    An output keying material as bytes.

    +
  • Defined in ../src/interfaces/kdfInterface.ts:107
    • @@ -257,33 +275,36 @@

      Parameters

    • salt: ArrayBuffer

      An additional random byte string.

      -
    • + +
    • label: Uint8Array

      A byte string indicating the cryptographic context/operation.

      -
    • + +
    • ikm: Uint8Array

      An input keying material

      -
    + +

    Returns Promise<ArrayBuffer>

    A pseudorandom key as bytes.

    +
  • Defined in ../src/interfaces/kdfInterface.ts:92
  • @@ -301,50 +322,30 @@

    labeledExpand
  • labeledExtract
  • +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/core/docs/interfaces/KemInterface.html b/core/docs/interfaces/KemInterface.html index 98aa64c19..0d2fe72d0 100644 --- a/core/docs/interfaces/KemInterface.html +++ b/core/docs/interfaces/KemInterface.html @@ -1,13 +1,13 @@ -KemInterface | @hpke/core
    +KemInterface | @hpke/core
    -
    +
    @@ -24,15 +24,15 @@

    Hierarchy

    • KemInterface
    +
  • Defined in ../src/interfaces/kemInterface.ts:12
  • - +

    Properties

    -
    encSize +
    encSize id privateKeySize publicKeySize @@ -40,7 +40,7 @@

    Properties

    Methods

    -
    decap +
    decap deriveKeyPair deserializePrivateKey deserializePublicKey @@ -53,13 +53,13 @@

    Methods

    Properties

    - +
    encSize: number

    The length in bytes of an encapsulated key produced by this KEM (Nenc).

    +
  • Defined in ../src/interfaces/kemInterface.ts:18
  • id: KemId
    @@ -67,7 +67,7 @@
    +
  • Defined in ../src/interfaces/kemInterface.ts:14
  • privateKeySize: number
    @@ -75,7 +75,7 @@
    +
  • Defined in ../src/interfaces/kemInterface.ts:22
  • publicKeySize: number
    @@ -83,7 +83,7 @@
    +
  • Defined in ../src/interfaces/kemInterface.ts:20
  • secretSize: number
    @@ -91,7 +91,7 @@
    +
  • Defined in ../src/interfaces/kemInterface.ts:16
  • Methods

    @@ -108,14 +108,15 @@

    Parameters

  • params: RecipientContextParams

    A set of parameters for the recipient context.

    -
  • +
    +

    Returns Promise<ArrayBuffer>

    A shared secret as the output of the decapsulation step.

    Throws

    DecapError

    +
  • Defined in ../src/interfaces/kemInterface.ts:137
    • @@ -130,14 +131,15 @@

      Parameters

    • ikm: ArrayBuffer

      An input keying material.

      -
    + +

    Returns Promise<CryptoKeyPair>

    A key pair derived.

    +
  • Defined in ../src/interfaces/kemInterface.ts:111
    • @@ -152,14 +154,15 @@

      Parameters

    • key: ArrayBuffer

      A key as bytes.

      -
    + +

    Returns Promise<CryptoKey>

    A CryptoKey.

    +
  • Defined in ../src/interfaces/kemInterface.ts:66
    • @@ -174,14 +177,15 @@

      Parameters

    • key: ArrayBuffer

      A key as bytes.

      -
    + +

    Returns Promise<CryptoKey>

    A CryptoKey.

    +
  • Defined in ../src/interfaces/kemInterface.ts:44
    • @@ -198,14 +202,15 @@

      Parameters

    • params: SenderContextParams

      A set of parameters for the sender context.

      -
    + +

    Returns Promise<{
        enc: ArrayBuffer;
        sharedSecret: ArrayBuffer;
    }>

    A shared secret and an encapsulated key as the output of the encapsulation step.

    Throws

    EncapError

    +
  • Defined in ../src/interfaces/kemInterface.ts:124
  • +
  • Defined in ../src/interfaces/kemInterface.ts:100
    • @@ -240,22 +245,25 @@

      Parameters

    • format: "raw" | "jwk"

      For now, 'raw' and 'jwk' are supported.

      -
    • + +
    • key: ArrayBuffer | JsonWebKey

      A byte string of a raw key or A JsonWebKey object.

      -
    • + +
    • Optional isPublic: boolean

      The indicator whether the provided key is a public key or not, which is used only for 'raw' format.

      -
      Optional
    + +

    Returns Promise<CryptoKey>

    A public or private CryptoKey.

    +
  • Defined in ../src/interfaces/kemInterface.ts:86
    • @@ -270,14 +278,15 @@

      Parameters

    • key: CryptoKey

      A CryptoKey.

      -
    + +

    Returns Promise<ArrayBuffer>

    A key as bytes.

    +
  • Defined in ../src/interfaces/kemInterface.ts:55
    • @@ -292,27 +301,28 @@

      Parameters

    • key: CryptoKey

      A CryptoKey.

      -
    + +

    Returns Promise<ArrayBuffer>

    A key as bytes.

    +
  • Defined in ../src/interfaces/kemInterface.ts:33
  • @@ -334,50 +344,30 @@

    serializePrivateKey
  • serializePublicKey
  • +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/core/docs/interfaces/PreSharedKey.html b/core/docs/interfaces/PreSharedKey.html index 849671be9..3cb64f405 100644 --- a/core/docs/interfaces/PreSharedKey.html +++ b/core/docs/interfaces/PreSharedKey.html @@ -1,13 +1,13 @@ -PreSharedKey | @hpke/core
    +PreSharedKey | @hpke/core
    -
    +
    @@ -24,27 +24,27 @@

    Hierarchy

    • PreSharedKey
    +
  • Defined in ../src/interfaces/preSharedKey.ts:4
  • - +

    Properties

    -

    Properties

    - +
    id: ArrayBuffer

    The key identifier.

    +
  • Defined in ../src/interfaces/preSharedKey.ts:6
  • key: ArrayBuffer
    @@ -52,20 +52,20 @@
    +
  • Defined in ../src/interfaces/preSharedKey.ts:9
  • @@ -75,50 +75,30 @@

    id
  • key
  • +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/core/docs/interfaces/RecipientContextParams.html b/core/docs/interfaces/RecipientContextParams.html index 4b653565d..70d044d3c 100644 --- a/core/docs/interfaces/RecipientContextParams.html +++ b/core/docs/interfaces/RecipientContextParams.html @@ -1,13 +1,13 @@ -RecipientContextParams | @hpke/core
    +RecipientContextParams | @hpke/core
    -
    +
    @@ -26,15 +26,15 @@

    Hierarchy

    • RecipientContextParams
    +
  • Defined in ../src/interfaces/recipientContextParams.ts:6
  • - +

    Properties

    -
    enc +
    enc info? psk? recipientKey @@ -43,13 +43,13 @@

    Properties

    Properties

    - +
    enc: ArrayBuffer

    A byte string of the encapsulated key received from a sender.

    +
  • Defined in ../src/interfaces/recipientContextParams.ts:11
  • info?: ArrayBuffer
    @@ -58,7 +58,7 @@
    +
  • Defined in ../src/interfaces/keyScheduleParams.ts:8
  • @@ -68,7 +68,7 @@
    +
  • Defined in ../src/interfaces/keyScheduleParams.ts:14
  • recipientKey: CryptoKeyPair | CryptoKey
    @@ -76,7 +76,7 @@
    +
  • Defined in ../src/interfaces/recipientContextParams.ts:8
  • senderPublicKey?: CryptoKey
    @@ -84,20 +84,20 @@
    +
  • Defined in ../src/interfaces/recipientContextParams.ts:14
  • @@ -110,50 +110,30 @@

    recipientKey
  • senderPublicKey
  • +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/core/docs/interfaces/SenderContext.html b/core/docs/interfaces/SenderContext.html index c9ad9500e..72dbff8c8 100644 --- a/core/docs/interfaces/SenderContext.html +++ b/core/docs/interfaces/SenderContext.html @@ -1,13 +1,13 @@ -SenderContext | @hpke/core
    +SenderContext | @hpke/core
    -
    +
    @@ -26,32 +26,32 @@

    Hierarchy

    • SenderContext
    +
  • Defined in ../src/interfaces/encryptionContext.ts:40
  • - +

    Properties

    -

    Methods

    -

    Properties

    - +
    enc: ArrayBuffer

    The encapsulated key generated by the sender.

    +
  • Defined in ../src/interfaces/encryptionContext.ts:42
  • Methods

    @@ -68,11 +68,13 @@

    Parameters

  • exporterContext: ArrayBuffer

    An exporter context string as bytes. The maximum length is 128 bytes.

    -
  • +
    +
  • len: number

    A desired length in bytes of the output secret.

    -
  • +
    +

    Returns Promise<ArrayBuffer>

    A secret string as bytes.

    @@ -80,7 +82,7 @@

    Throws

    E

    +
  • Defined in ../src/interfaces/exporter.ts:15
    • @@ -95,11 +97,13 @@

      Parameters

    • data: ArrayBuffer

      An encrypted text as bytes to be decrypted.

      -
    • + +
    • Optional aad: ArrayBuffer

      Additional authenticated data as bytes fed by an application.

      -
      Optional
    + +

    Returns Promise<ArrayBuffer>

    A decrypted plain text as bytes.

    @@ -107,7 +111,7 @@

    Throws

    Ope

    +
  • Defined in ../src/interfaces/encryptionContext.ts:29
    • @@ -122,11 +126,13 @@

      Parameters

    • data: ArrayBuffer

      A plain text as bytes to be encrypted.

      -
    • + +
    • Optional aad: ArrayBuffer

      Additional authenticated data as bytes fed by an application.

      -
      Optional
    + +

    Returns Promise<ArrayBuffer>

    A cipher text as bytes.

    +
  • Defined in ../src/interfaces/encryptionContext.ts:17
  • @@ -159,50 +165,30 @@

    open
  • seal
  • +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/core/docs/interfaces/SenderContextParams.html b/core/docs/interfaces/SenderContextParams.html index 7ea1c704e..42c6d3255 100644 --- a/core/docs/interfaces/SenderContextParams.html +++ b/core/docs/interfaces/SenderContextParams.html @@ -1,13 +1,13 @@ -SenderContextParams | @hpke/core
    +SenderContextParams | @hpke/core
    -
    +
    @@ -26,15 +26,15 @@

    Hierarchy

    • SenderContextParams
    +
  • Defined in ../src/interfaces/senderContextParams.ts:6
  • - +

    Properties

    -
    ekm? +
    ekm? info? psk? recipientPublicKey @@ -43,13 +43,13 @@

    Properties

    Properties

    - +
    ekm?: ArrayBuffer | CryptoKeyPair

    DO NOT USE. FOR DEBUGGING/TESTING PURPOSES ONLY.

    +
  • Defined in ../src/interfaces/senderContextParams.ts:14
  • info?: ArrayBuffer
    @@ -58,7 +58,7 @@
    +
  • Defined in ../src/interfaces/keyScheduleParams.ts:8
  • @@ -68,7 +68,7 @@
    +
  • Defined in ../src/interfaces/keyScheduleParams.ts:14
  • recipientPublicKey: CryptoKey
    @@ -76,7 +76,7 @@
    +
  • Defined in ../src/interfaces/senderContextParams.ts:8
  • senderKey?: CryptoKeyPair | CryptoKey
    @@ -84,20 +84,20 @@
    +
  • Defined in ../src/interfaces/senderContextParams.ts:11
  • @@ -110,50 +110,30 @@

    recipientPublicKey
  • senderKey
  • +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/core/docs/modules.html b/core/docs/modules.html index e582b3d55..f1afcb09e 100644 --- a/core/docs/modules.html +++ b/core/docs/modules.html @@ -1,13 +1,13 @@ -@hpke/core
    +@hpke/core
    -
    +
    @@ -17,7 +17,7 @@

    @hpke/core

    Index

    Classes

    -
    Aes128Gcm +
    Aes128Gcm Aes256Gcm BaseError CipherSuite @@ -44,7 +44,7 @@

    Classes

    Interfaces

    -

    Type Aliases

    -

    Variables

    -
    @@ -73,62 +73,42 @@

    Variables

    +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/core/docs/types/AeadId.html b/core/docs/types/AeadId.html index 6a9bb1c82..732376b48 100644 --- a/core/docs/types/AeadId.html +++ b/core/docs/types/AeadId.html @@ -1,13 +1,13 @@ -AeadId | @hpke/core
    +AeadId | @hpke/core
    -
    +
    @@ -20,68 +20,48 @@

    Type alias AeadId

    +
  • Defined in ../src/identifiers.ts:99
  • +
  • Defined in ../src/identifiers.ts:104
  • +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/core/docs/types/KdfId.html b/core/docs/types/KdfId.html index 4b567e37f..97e7164dc 100644 --- a/core/docs/types/KdfId.html +++ b/core/docs/types/KdfId.html @@ -1,13 +1,13 @@ -KdfId | @hpke/core
    +KdfId | @hpke/core
    -
    +
    @@ -20,68 +20,48 @@

    Type alias KdfId

    +
  • Defined in ../src/identifiers.ts:70
  • +
  • Defined in ../src/identifiers.ts:75
  • +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/core/docs/types/KemId.html b/core/docs/types/KemId.html index 92ab19c7c..163c783b1 100644 --- a/core/docs/types/KemId.html +++ b/core/docs/types/KemId.html @@ -1,13 +1,13 @@ -KemId | @hpke/core
    +KemId | @hpke/core
    -
    +
    @@ -20,68 +20,48 @@

    Type alias KemId

    +
  • Defined in ../src/identifiers.ts:42
  • +
  • Defined in ../src/identifiers.ts:47
  • +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/core/docs/types/RecipientContext.html b/core/docs/types/RecipientContext.html index ee361817d..d3405a2af 100644 --- a/core/docs/types/RecipientContext.html +++ b/core/docs/types/RecipientContext.html @@ -1,13 +1,13 @@ -RecipientContext | @hpke/core
    +RecipientContext | @hpke/core
    -
    +
    @@ -20,67 +20,47 @@

    Type alias RecipientContext

    +
  • Defined in ../src/interfaces/encryptionContext.ts:35
  • +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/core/docs/variables/AeadId-1.html b/core/docs/variables/AeadId-1.html index 38b7cb53e..45958910e 100644 --- a/core/docs/variables/AeadId-1.html +++ b/core/docs/variables/AeadId-1.html @@ -1,13 +1,13 @@ -AeadId | @hpke/core
    +AeadId | @hpke/core
    -
    +
    @@ -31,68 +31,48 @@
    Readonly Readonly ExportOnly: 65535
    +
  • Defined in ../src/identifiers.ts:99
  • +
  • Defined in ../src/identifiers.ts:104
  • +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/core/docs/variables/KdfId-1.html b/core/docs/variables/KdfId-1.html index b3ddc4236..7e69d288f 100644 --- a/core/docs/variables/KdfId-1.html +++ b/core/docs/variables/KdfId-1.html @@ -1,13 +1,13 @@ -KdfId | @hpke/core
    +KdfId | @hpke/core
    -
    +
    @@ -29,68 +29,48 @@
    Readonly Readonly HkdfSha512: 3
    +
  • Defined in ../src/identifiers.ts:70
  • +
  • Defined in ../src/identifiers.ts:75
  • +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/core/docs/variables/KemId-1.html b/core/docs/variables/KemId-1.html index 05786d36b..4f361a444 100644 --- a/core/docs/variables/KemId-1.html +++ b/core/docs/variables/KemId-1.html @@ -1,13 +1,13 @@ -KemId | @hpke/core
    +KemId | @hpke/core
    -
    +
    @@ -39,68 +39,48 @@
    Readonly Readonly NotAssigned: 0
    +
  • Defined in ../src/identifiers.ts:42
  • +
  • Defined in ../src/identifiers.ts:47
  • +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/dhkem-secp256k1/docs/assets/main.js b/dhkem-secp256k1/docs/assets/main.js index 3cee05e61..01bcad55f 100644 --- a/dhkem-secp256k1/docs/assets/main.js +++ b/dhkem-secp256k1/docs/assets/main.js @@ -1,7 +1,8 @@ "use strict"; -"use strict";(()=>{var Se=Object.create;var re=Object.defineProperty;var we=Object.getOwnPropertyDescriptor;var Te=Object.getOwnPropertyNames;var ke=Object.getPrototypeOf,Qe=Object.prototype.hasOwnProperty;var Pe=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Ie=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Te(e))!Qe.call(t,i)&&i!==r&&re(t,i,{get:()=>e[i],enumerable:!(n=we(e,i))||n.enumerable});return t};var Ce=(t,e,r)=>(r=t!=null?Se(ke(t)):{},Ie(e||!t||!t.__esModule?re(r,"default",{value:t,enumerable:!0}):r,t));var ae=Pe((se,oe)=>{(function(){var t=function(e){var r=new t.Builder;return r.pipeline.add(t.trimmer,t.stopWordFilter,t.stemmer),r.searchPipeline.add(t.stemmer),e.call(r,r),r.build()};t.version="2.3.9";t.utils={},t.utils.warn=function(e){return function(r){e.console&&console.warn&&console.warn(r)}}(this),t.utils.asString=function(e){return e==null?"":e.toString()},t.utils.clone=function(e){if(e==null)return e;for(var r=Object.create(null),n=Object.keys(e),i=0;i0){var d=t.utils.clone(r)||{};d.position=[a,u],d.index=s.length,s.push(new t.Token(n.slice(a,o),d))}a=o+1}}return s},t.tokenizer.separator=/[\s\-]+/;t.Pipeline=function(){this._stack=[]},t.Pipeline.registeredFunctions=Object.create(null),t.Pipeline.registerFunction=function(e,r){r in this.registeredFunctions&&t.utils.warn("Overwriting existing registered function: "+r),e.label=r,t.Pipeline.registeredFunctions[e.label]=e},t.Pipeline.warnIfFunctionNotRegistered=function(e){var r=e.label&&e.label in this.registeredFunctions;r||t.utils.warn(`Function is not registered with pipeline. This may cause problems when serialising the index. -`,e)},t.Pipeline.load=function(e){var r=new t.Pipeline;return e.forEach(function(n){var i=t.Pipeline.registeredFunctions[n];if(i)r.add(i);else throw new Error("Cannot load unregistered function: "+n)}),r},t.Pipeline.prototype.add=function(){var e=Array.prototype.slice.call(arguments);e.forEach(function(r){t.Pipeline.warnIfFunctionNotRegistered(r),this._stack.push(r)},this)},t.Pipeline.prototype.after=function(e,r){t.Pipeline.warnIfFunctionNotRegistered(r);var n=this._stack.indexOf(e);if(n==-1)throw new Error("Cannot find existingFn");n=n+1,this._stack.splice(n,0,r)},t.Pipeline.prototype.before=function(e,r){t.Pipeline.warnIfFunctionNotRegistered(r);var n=this._stack.indexOf(e);if(n==-1)throw new Error("Cannot find existingFn");this._stack.splice(n,0,r)},t.Pipeline.prototype.remove=function(e){var r=this._stack.indexOf(e);r!=-1&&this._stack.splice(r,1)},t.Pipeline.prototype.run=function(e){for(var r=this._stack.length,n=0;n1&&(oe&&(n=s),o!=e);)i=n-r,s=r+Math.floor(i/2),o=this.elements[s*2];if(o==e||o>e)return s*2;if(ol?d+=2:a==l&&(r+=n[u+1]*i[d+1],u+=2,d+=2);return r},t.Vector.prototype.similarity=function(e){return this.dot(e)/this.magnitude()||0},t.Vector.prototype.toArray=function(){for(var e=new Array(this.elements.length/2),r=1,n=0;r0){var o=s.str.charAt(0),a;o in s.node.edges?a=s.node.edges[o]:(a=new t.TokenSet,s.node.edges[o]=a),s.str.length==1&&(a.final=!0),i.push({node:a,editsRemaining:s.editsRemaining,str:s.str.slice(1)})}if(s.editsRemaining!=0){if("*"in s.node.edges)var l=s.node.edges["*"];else{var l=new t.TokenSet;s.node.edges["*"]=l}if(s.str.length==0&&(l.final=!0),i.push({node:l,editsRemaining:s.editsRemaining-1,str:s.str}),s.str.length>1&&i.push({node:s.node,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)}),s.str.length==1&&(s.node.final=!0),s.str.length>=1){if("*"in s.node.edges)var u=s.node.edges["*"];else{var u=new t.TokenSet;s.node.edges["*"]=u}s.str.length==1&&(u.final=!0),i.push({node:u,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)})}if(s.str.length>1){var d=s.str.charAt(0),m=s.str.charAt(1),y;m in s.node.edges?y=s.node.edges[m]:(y=new t.TokenSet,s.node.edges[m]=y),s.str.length==1&&(y.final=!0),i.push({node:y,editsRemaining:s.editsRemaining-1,str:d+s.str.slice(2)})}}}return n},t.TokenSet.fromString=function(e){for(var r=new t.TokenSet,n=r,i=0,s=e.length;i=e;r--){var n=this.uncheckedNodes[r],i=n.child.toString();i in this.minimizedNodes?n.parent.edges[n.char]=this.minimizedNodes[i]:(n.child._str=i,this.minimizedNodes[i]=n.child),this.uncheckedNodes.pop()}};t.Index=function(e){this.invertedIndex=e.invertedIndex,this.fieldVectors=e.fieldVectors,this.tokenSet=e.tokenSet,this.fields=e.fields,this.pipeline=e.pipeline},t.Index.prototype.search=function(e){return this.query(function(r){var n=new t.QueryParser(e,r);n.parse()})},t.Index.prototype.query=function(e){for(var r=new t.Query(this.fields),n=Object.create(null),i=Object.create(null),s=Object.create(null),o=Object.create(null),a=Object.create(null),l=0;l1?this._b=1:this._b=e},t.Builder.prototype.k1=function(e){this._k1=e},t.Builder.prototype.add=function(e,r){var n=e[this._ref],i=Object.keys(this._fields);this._documents[n]=r||{},this.documentCount+=1;for(var s=0;s=this.length)return t.QueryLexer.EOS;var e=this.str.charAt(this.pos);return this.pos+=1,e},t.QueryLexer.prototype.width=function(){return this.pos-this.start},t.QueryLexer.prototype.ignore=function(){this.start==this.pos&&(this.pos+=1),this.start=this.pos},t.QueryLexer.prototype.backup=function(){this.pos-=1},t.QueryLexer.prototype.acceptDigitRun=function(){var e,r;do e=this.next(),r=e.charCodeAt(0);while(r>47&&r<58);e!=t.QueryLexer.EOS&&this.backup()},t.QueryLexer.prototype.more=function(){return this.pos1&&(e.backup(),e.emit(t.QueryLexer.TERM)),e.ignore(),e.more())return t.QueryLexer.lexText},t.QueryLexer.lexEditDistance=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(t.QueryLexer.EDIT_DISTANCE),t.QueryLexer.lexText},t.QueryLexer.lexBoost=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(t.QueryLexer.BOOST),t.QueryLexer.lexText},t.QueryLexer.lexEOS=function(e){e.width()>0&&e.emit(t.QueryLexer.TERM)},t.QueryLexer.termSeparator=t.tokenizer.separator,t.QueryLexer.lexText=function(e){for(;;){var r=e.next();if(r==t.QueryLexer.EOS)return t.QueryLexer.lexEOS;if(r.charCodeAt(0)==92){e.escapeCharacter();continue}if(r==":")return t.QueryLexer.lexField;if(r=="~")return e.backup(),e.width()>0&&e.emit(t.QueryLexer.TERM),t.QueryLexer.lexEditDistance;if(r=="^")return e.backup(),e.width()>0&&e.emit(t.QueryLexer.TERM),t.QueryLexer.lexBoost;if(r=="+"&&e.width()===1||r=="-"&&e.width()===1)return e.emit(t.QueryLexer.PRESENCE),t.QueryLexer.lexText;if(r.match(t.QueryLexer.termSeparator))return t.QueryLexer.lexTerm}},t.QueryParser=function(e,r){this.lexer=new t.QueryLexer(e),this.query=r,this.currentClause={},this.lexemeIdx=0},t.QueryParser.prototype.parse=function(){this.lexer.run(),this.lexemes=this.lexer.lexemes;for(var e=t.QueryParser.parseClause;e;)e=e(this);return this.query},t.QueryParser.prototype.peekLexeme=function(){return this.lexemes[this.lexemeIdx]},t.QueryParser.prototype.consumeLexeme=function(){var e=this.peekLexeme();return this.lexemeIdx+=1,e},t.QueryParser.prototype.nextClause=function(){var e=this.currentClause;this.query.clause(e),this.currentClause={}},t.QueryParser.parseClause=function(e){var r=e.peekLexeme();if(r!=null)switch(r.type){case t.QueryLexer.PRESENCE:return t.QueryParser.parsePresence;case t.QueryLexer.FIELD:return t.QueryParser.parseField;case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var n="expected either a field or a term, found "+r.type;throw r.str.length>=1&&(n+=" with value '"+r.str+"'"),new t.QueryParseError(n,r.start,r.end)}},t.QueryParser.parsePresence=function(e){var r=e.consumeLexeme();if(r!=null){switch(r.str){case"-":e.currentClause.presence=t.Query.presence.PROHIBITED;break;case"+":e.currentClause.presence=t.Query.presence.REQUIRED;break;default:var n="unrecognised presence operator'"+r.str+"'";throw new t.QueryParseError(n,r.start,r.end)}var i=e.peekLexeme();if(i==null){var n="expecting term or field, found nothing";throw new t.QueryParseError(n,r.start,r.end)}switch(i.type){case t.QueryLexer.FIELD:return t.QueryParser.parseField;case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var n="expecting term or field, found '"+i.type+"'";throw new t.QueryParseError(n,i.start,i.end)}}},t.QueryParser.parseField=function(e){var r=e.consumeLexeme();if(r!=null){if(e.query.allFields.indexOf(r.str)==-1){var n=e.query.allFields.map(function(o){return"'"+o+"'"}).join(", "),i="unrecognised field '"+r.str+"', possible fields: "+n;throw new t.QueryParseError(i,r.start,r.end)}e.currentClause.fields=[r.str];var s=e.peekLexeme();if(s==null){var i="expecting term, found nothing";throw new t.QueryParseError(i,r.start,r.end)}switch(s.type){case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var i="expecting term, found '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},t.QueryParser.parseTerm=function(e){var r=e.consumeLexeme();if(r!=null){e.currentClause.term=r.str.toLowerCase(),r.str.indexOf("*")!=-1&&(e.currentClause.usePipeline=!1);var n=e.peekLexeme();if(n==null){e.nextClause();return}switch(n.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+n.type+"'";throw new t.QueryParseError(i,n.start,n.end)}}},t.QueryParser.parseEditDistance=function(e){var r=e.consumeLexeme();if(r!=null){var n=parseInt(r.str,10);if(isNaN(n)){var i="edit distance must be numeric";throw new t.QueryParseError(i,r.start,r.end)}e.currentClause.editDistance=n;var s=e.peekLexeme();if(s==null){e.nextClause();return}switch(s.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},t.QueryParser.parseBoost=function(e){var r=e.consumeLexeme();if(r!=null){var n=parseInt(r.str,10);if(isNaN(n)){var i="boost must be numeric";throw new t.QueryParseError(i,r.start,r.end)}e.currentClause.boost=n;var s=e.peekLexeme();if(s==null){e.nextClause();return}switch(s.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},function(e,r){typeof define=="function"&&define.amd?define(r):typeof se=="object"?oe.exports=r():e.lunr=r()}(this,function(){return t})})()});var ne=[];function G(t,e){ne.push({selector:e,constructor:t})}var U=class{constructor(){this.alwaysVisibleMember=null;this.createComponents(document.body),this.ensureActivePageVisible(),this.ensureFocusedElementVisible(),this.listenForCodeCopies(),window.addEventListener("hashchange",()=>this.ensureFocusedElementVisible())}createComponents(e){ne.forEach(r=>{e.querySelectorAll(r.selector).forEach(n=>{n.dataset.hasInstance||(new r.constructor({el:n,app:this}),n.dataset.hasInstance=String(!0))})})}filterChanged(){this.ensureFocusedElementVisible()}ensureActivePageVisible(){let e=document.querySelector(".tsd-navigation .current"),r=e?.parentElement;for(;r&&!r.classList.contains(".tsd-navigation");)r instanceof HTMLDetailsElement&&(r.open=!0),r=r.parentElement;if(e){let n=e.getBoundingClientRect().top-document.documentElement.clientHeight/4;document.querySelector(".site-menu").scrollTop=n}}ensureFocusedElementVisible(){if(this.alwaysVisibleMember&&(this.alwaysVisibleMember.classList.remove("always-visible"),this.alwaysVisibleMember.firstElementChild.remove(),this.alwaysVisibleMember=null),!location.hash)return;let e=document.getElementById(location.hash.substring(1));if(!e)return;let r=e.parentElement;for(;r&&r.tagName!=="SECTION";)r=r.parentElement;if(r&&r.offsetParent==null){this.alwaysVisibleMember=r,r.classList.add("always-visible");let n=document.createElement("p");n.classList.add("warning"),n.textContent="This member is normally hidden due to your filter settings.",r.prepend(n)}}listenForCodeCopies(){document.querySelectorAll("pre > button").forEach(e=>{let r;e.addEventListener("click",()=>{e.previousElementSibling instanceof HTMLElement&&navigator.clipboard.writeText(e.previousElementSibling.innerText.trim()),e.textContent="Copied!",e.classList.add("visible"),clearTimeout(r),r=setTimeout(()=>{e.classList.remove("visible"),r=setTimeout(()=>{e.textContent="Copy"},100)},1e3)})})}};var ie=(t,e=100)=>{let r;return()=>{clearTimeout(r),r=setTimeout(()=>t(),e)}};var ce=Ce(ae());function de(){let t=document.getElementById("tsd-search");if(!t)return;let e=document.getElementById("tsd-search-script");t.classList.add("loading"),e&&(e.addEventListener("error",()=>{t.classList.remove("loading"),t.classList.add("failure")}),e.addEventListener("load",()=>{t.classList.remove("loading"),t.classList.add("ready")}),window.searchData&&t.classList.remove("loading"));let r=document.querySelector("#tsd-search input"),n=document.querySelector("#tsd-search .results");if(!r||!n)throw new Error("The input field or the result list wrapper was not found");let i=!1;n.addEventListener("mousedown",()=>i=!0),n.addEventListener("mouseup",()=>{i=!1,t.classList.remove("has-focus")}),r.addEventListener("focus",()=>t.classList.add("has-focus")),r.addEventListener("blur",()=>{i||(i=!1,t.classList.remove("has-focus"))});let s={base:t.dataset.base+"/"};Oe(t,n,r,s)}function Oe(t,e,r,n){r.addEventListener("input",ie(()=>{Re(t,e,r,n)},200));let i=!1;r.addEventListener("keydown",s=>{i=!0,s.key=="Enter"?Fe(e,r):s.key=="Escape"?r.blur():s.key=="ArrowUp"?ue(e,-1):s.key==="ArrowDown"?ue(e,1):i=!1}),r.addEventListener("keypress",s=>{i&&s.preventDefault()}),document.body.addEventListener("keydown",s=>{s.altKey||s.ctrlKey||s.metaKey||!r.matches(":focus")&&s.key==="/"&&(r.focus(),s.preventDefault())})}function _e(t,e){t.index||window.searchData&&(e.classList.remove("loading"),e.classList.add("ready"),t.data=window.searchData,t.index=ce.Index.load(window.searchData.index))}function Re(t,e,r,n){if(_e(n,t),!n.index||!n.data)return;e.textContent="";let i=r.value.trim(),s=i?n.index.search(`*${i}*`):[];for(let o=0;oa.score-o.score);for(let o=0,a=Math.min(10,s.length);o${le(l.parent,i)}.${u}`);let d=document.createElement("li");d.classList.value=l.classes??"";let m=document.createElement("a");m.href=n.base+l.url,m.innerHTML=u,d.append(m),e.appendChild(d)}}function ue(t,e){let r=t.querySelector(".current");if(!r)r=t.querySelector(e==1?"li:first-child":"li:last-child"),r&&r.classList.add("current");else{let n=r;if(e===1)do n=n.nextElementSibling??void 0;while(n instanceof HTMLElement&&n.offsetParent==null);else do n=n.previousElementSibling??void 0;while(n instanceof HTMLElement&&n.offsetParent==null);n&&(r.classList.remove("current"),n.classList.add("current"))}}function Fe(t,e){let r=t.querySelector(".current");if(r||(r=t.querySelector("li:first-child")),r){let n=r.querySelector("a");n&&(window.location.href=n.href),e.blur()}}function le(t,e){if(e==="")return t;let r=t.toLocaleLowerCase(),n=e.toLocaleLowerCase(),i=[],s=0,o=r.indexOf(n);for(;o!=-1;)i.push(K(t.substring(s,o)),`${K(t.substring(o,o+n.length))}`),s=o+n.length,o=r.indexOf(n,s);return i.push(K(t.substring(s))),i.join("")}var Me={"&":"&","<":"<",">":">","'":"'",'"':"""};function K(t){return t.replace(/[&<>"'"]/g,e=>Me[e])}var P=class{constructor(e){this.el=e.el,this.app=e.app}};var M="mousedown",fe="mousemove",N="mouseup",J={x:0,y:0},he=!1,ee=!1,De=!1,D=!1,pe=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);document.documentElement.classList.add(pe?"is-mobile":"not-mobile");pe&&"ontouchstart"in document.documentElement&&(De=!0,M="touchstart",fe="touchmove",N="touchend");document.addEventListener(M,t=>{ee=!0,D=!1;let e=M=="touchstart"?t.targetTouches[0]:t;J.y=e.pageY||0,J.x=e.pageX||0});document.addEventListener(fe,t=>{if(ee&&!D){let e=M=="touchstart"?t.targetTouches[0]:t,r=J.x-(e.pageX||0),n=J.y-(e.pageY||0);D=Math.sqrt(r*r+n*n)>10}});document.addEventListener(N,()=>{ee=!1});document.addEventListener("click",t=>{he&&(t.preventDefault(),t.stopImmediatePropagation(),he=!1)});var X=class extends P{constructor(r){super(r);this.className=this.el.dataset.toggle||"",this.el.addEventListener(N,n=>this.onPointerUp(n)),this.el.addEventListener("click",n=>n.preventDefault()),document.addEventListener(M,n=>this.onDocumentPointerDown(n)),document.addEventListener(N,n=>this.onDocumentPointerUp(n))}setActive(r){if(this.active==r)return;this.active=r,document.documentElement.classList.toggle("has-"+this.className,r),this.el.classList.toggle("active",r);let n=(this.active?"to-has-":"from-has-")+this.className;document.documentElement.classList.add(n),setTimeout(()=>document.documentElement.classList.remove(n),500)}onPointerUp(r){D||(this.setActive(!0),r.preventDefault())}onDocumentPointerDown(r){if(this.active){if(r.target.closest(".col-sidebar, .tsd-filter-group"))return;this.setActive(!1)}}onDocumentPointerUp(r){if(!D&&this.active&&r.target.closest(".col-sidebar")){let n=r.target.closest("a");if(n){let i=window.location.href;i.indexOf("#")!=-1&&(i=i.substring(0,i.indexOf("#"))),n.href.substring(0,i.length)==i&&setTimeout(()=>this.setActive(!1),250)}}}};var te;try{te=localStorage}catch{te={getItem(){return null},setItem(){}}}var Q=te;var me=document.head.appendChild(document.createElement("style"));me.dataset.for="filters";var Y=class extends P{constructor(r){super(r);this.key=`filter-${this.el.name}`,this.value=this.el.checked,this.el.addEventListener("change",()=>{this.setLocalStorage(this.el.checked)}),this.setLocalStorage(this.fromLocalStorage()),me.innerHTML+=`html:not(.${this.key}) .tsd-is-${this.el.name} { display: none; } -`}fromLocalStorage(){let r=Q.getItem(this.key);return r?r==="true":this.el.checked}setLocalStorage(r){Q.setItem(this.key,r.toString()),this.value=r,this.handleValueChange()}handleValueChange(){this.el.checked=this.value,document.documentElement.classList.toggle(this.key,this.value),this.app.filterChanged(),document.querySelectorAll(".tsd-index-section").forEach(r=>{r.style.display="block";let n=Array.from(r.querySelectorAll(".tsd-index-link")).every(i=>i.offsetParent==null);r.style.display=n?"none":"block"})}};var Z=class extends P{constructor(r){super(r);this.summary=this.el.querySelector(".tsd-accordion-summary"),this.icon=this.summary.querySelector("svg"),this.key=`tsd-accordion-${this.summary.dataset.key??this.summary.textContent.trim().replace(/\s+/g,"-").toLowerCase()}`;let n=Q.getItem(this.key);this.el.open=n?n==="true":this.el.open,this.el.addEventListener("toggle",()=>this.update()),this.update()}update(){this.icon.style.transform=`rotate(${this.el.open?0:-90}deg)`,Q.setItem(this.key,this.el.open.toString())}};function ve(t){let e=Q.getItem("tsd-theme")||"os";t.value=e,ye(e),t.addEventListener("change",()=>{Q.setItem("tsd-theme",t.value),ye(t.value)})}function ye(t){document.documentElement.dataset.theme=t}de();G(X,"a[data-toggle]");G(Z,".tsd-index-accordion");G(Y,".tsd-filter-item input[type=checkbox]");var ge=document.getElementById("tsd-theme");ge&&ve(ge);var Ae=new U;Object.defineProperty(window,"app",{value:Ae});document.querySelectorAll("summary a").forEach(t=>{t.addEventListener("click",()=>{location.assign(t.href)})});})(); +"use strict";(()=>{var Pe=Object.create;var ne=Object.defineProperty;var Ie=Object.getOwnPropertyDescriptor;var Oe=Object.getOwnPropertyNames;var _e=Object.getPrototypeOf,Re=Object.prototype.hasOwnProperty;var Me=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Fe=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Oe(e))!Re.call(t,i)&&i!==n&&ne(t,i,{get:()=>e[i],enumerable:!(r=Ie(e,i))||r.enumerable});return t};var De=(t,e,n)=>(n=t!=null?Pe(_e(t)):{},Fe(e||!t||!t.__esModule?ne(n,"default",{value:t,enumerable:!0}):n,t));var ae=Me((se,oe)=>{(function(){var t=function(e){var n=new t.Builder;return n.pipeline.add(t.trimmer,t.stopWordFilter,t.stemmer),n.searchPipeline.add(t.stemmer),e.call(n,n),n.build()};t.version="2.3.9";t.utils={},t.utils.warn=function(e){return function(n){e.console&&console.warn&&console.warn(n)}}(this),t.utils.asString=function(e){return e==null?"":e.toString()},t.utils.clone=function(e){if(e==null)return e;for(var n=Object.create(null),r=Object.keys(e),i=0;i0){var d=t.utils.clone(n)||{};d.position=[a,u],d.index=s.length,s.push(new t.Token(r.slice(a,o),d))}a=o+1}}return s},t.tokenizer.separator=/[\s\-]+/;t.Pipeline=function(){this._stack=[]},t.Pipeline.registeredFunctions=Object.create(null),t.Pipeline.registerFunction=function(e,n){n in this.registeredFunctions&&t.utils.warn("Overwriting existing registered function: "+n),e.label=n,t.Pipeline.registeredFunctions[e.label]=e},t.Pipeline.warnIfFunctionNotRegistered=function(e){var n=e.label&&e.label in this.registeredFunctions;n||t.utils.warn(`Function is not registered with pipeline. This may cause problems when serialising the index. +`,e)},t.Pipeline.load=function(e){var n=new t.Pipeline;return e.forEach(function(r){var i=t.Pipeline.registeredFunctions[r];if(i)n.add(i);else throw new Error("Cannot load unregistered function: "+r)}),n},t.Pipeline.prototype.add=function(){var e=Array.prototype.slice.call(arguments);e.forEach(function(n){t.Pipeline.warnIfFunctionNotRegistered(n),this._stack.push(n)},this)},t.Pipeline.prototype.after=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var r=this._stack.indexOf(e);if(r==-1)throw new Error("Cannot find existingFn");r=r+1,this._stack.splice(r,0,n)},t.Pipeline.prototype.before=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var r=this._stack.indexOf(e);if(r==-1)throw new Error("Cannot find existingFn");this._stack.splice(r,0,n)},t.Pipeline.prototype.remove=function(e){var n=this._stack.indexOf(e);n!=-1&&this._stack.splice(n,1)},t.Pipeline.prototype.run=function(e){for(var n=this._stack.length,r=0;r1&&(oe&&(r=s),o!=e);)i=r-n,s=n+Math.floor(i/2),o=this.elements[s*2];if(o==e||o>e)return s*2;if(ol?d+=2:a==l&&(n+=r[u+1]*i[d+1],u+=2,d+=2);return n},t.Vector.prototype.similarity=function(e){return this.dot(e)/this.magnitude()||0},t.Vector.prototype.toArray=function(){for(var e=new Array(this.elements.length/2),n=1,r=0;n0){var o=s.str.charAt(0),a;o in s.node.edges?a=s.node.edges[o]:(a=new t.TokenSet,s.node.edges[o]=a),s.str.length==1&&(a.final=!0),i.push({node:a,editsRemaining:s.editsRemaining,str:s.str.slice(1)})}if(s.editsRemaining!=0){if("*"in s.node.edges)var l=s.node.edges["*"];else{var l=new t.TokenSet;s.node.edges["*"]=l}if(s.str.length==0&&(l.final=!0),i.push({node:l,editsRemaining:s.editsRemaining-1,str:s.str}),s.str.length>1&&i.push({node:s.node,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)}),s.str.length==1&&(s.node.final=!0),s.str.length>=1){if("*"in s.node.edges)var u=s.node.edges["*"];else{var u=new t.TokenSet;s.node.edges["*"]=u}s.str.length==1&&(u.final=!0),i.push({node:u,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)})}if(s.str.length>1){var d=s.str.charAt(0),v=s.str.charAt(1),f;v in s.node.edges?f=s.node.edges[v]:(f=new t.TokenSet,s.node.edges[v]=f),s.str.length==1&&(f.final=!0),i.push({node:f,editsRemaining:s.editsRemaining-1,str:d+s.str.slice(2)})}}}return r},t.TokenSet.fromString=function(e){for(var n=new t.TokenSet,r=n,i=0,s=e.length;i=e;n--){var r=this.uncheckedNodes[n],i=r.child.toString();i in this.minimizedNodes?r.parent.edges[r.char]=this.minimizedNodes[i]:(r.child._str=i,this.minimizedNodes[i]=r.child),this.uncheckedNodes.pop()}};t.Index=function(e){this.invertedIndex=e.invertedIndex,this.fieldVectors=e.fieldVectors,this.tokenSet=e.tokenSet,this.fields=e.fields,this.pipeline=e.pipeline},t.Index.prototype.search=function(e){return this.query(function(n){var r=new t.QueryParser(e,n);r.parse()})},t.Index.prototype.query=function(e){for(var n=new t.Query(this.fields),r=Object.create(null),i=Object.create(null),s=Object.create(null),o=Object.create(null),a=Object.create(null),l=0;l1?this._b=1:this._b=e},t.Builder.prototype.k1=function(e){this._k1=e},t.Builder.prototype.add=function(e,n){var r=e[this._ref],i=Object.keys(this._fields);this._documents[r]=n||{},this.documentCount+=1;for(var s=0;s=this.length)return t.QueryLexer.EOS;var e=this.str.charAt(this.pos);return this.pos+=1,e},t.QueryLexer.prototype.width=function(){return this.pos-this.start},t.QueryLexer.prototype.ignore=function(){this.start==this.pos&&(this.pos+=1),this.start=this.pos},t.QueryLexer.prototype.backup=function(){this.pos-=1},t.QueryLexer.prototype.acceptDigitRun=function(){var e,n;do e=this.next(),n=e.charCodeAt(0);while(n>47&&n<58);e!=t.QueryLexer.EOS&&this.backup()},t.QueryLexer.prototype.more=function(){return this.pos1&&(e.backup(),e.emit(t.QueryLexer.TERM)),e.ignore(),e.more())return t.QueryLexer.lexText},t.QueryLexer.lexEditDistance=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(t.QueryLexer.EDIT_DISTANCE),t.QueryLexer.lexText},t.QueryLexer.lexBoost=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(t.QueryLexer.BOOST),t.QueryLexer.lexText},t.QueryLexer.lexEOS=function(e){e.width()>0&&e.emit(t.QueryLexer.TERM)},t.QueryLexer.termSeparator=t.tokenizer.separator,t.QueryLexer.lexText=function(e){for(;;){var n=e.next();if(n==t.QueryLexer.EOS)return t.QueryLexer.lexEOS;if(n.charCodeAt(0)==92){e.escapeCharacter();continue}if(n==":")return t.QueryLexer.lexField;if(n=="~")return e.backup(),e.width()>0&&e.emit(t.QueryLexer.TERM),t.QueryLexer.lexEditDistance;if(n=="^")return e.backup(),e.width()>0&&e.emit(t.QueryLexer.TERM),t.QueryLexer.lexBoost;if(n=="+"&&e.width()===1||n=="-"&&e.width()===1)return e.emit(t.QueryLexer.PRESENCE),t.QueryLexer.lexText;if(n.match(t.QueryLexer.termSeparator))return t.QueryLexer.lexTerm}},t.QueryParser=function(e,n){this.lexer=new t.QueryLexer(e),this.query=n,this.currentClause={},this.lexemeIdx=0},t.QueryParser.prototype.parse=function(){this.lexer.run(),this.lexemes=this.lexer.lexemes;for(var e=t.QueryParser.parseClause;e;)e=e(this);return this.query},t.QueryParser.prototype.peekLexeme=function(){return this.lexemes[this.lexemeIdx]},t.QueryParser.prototype.consumeLexeme=function(){var e=this.peekLexeme();return this.lexemeIdx+=1,e},t.QueryParser.prototype.nextClause=function(){var e=this.currentClause;this.query.clause(e),this.currentClause={}},t.QueryParser.parseClause=function(e){var n=e.peekLexeme();if(n!=null)switch(n.type){case t.QueryLexer.PRESENCE:return t.QueryParser.parsePresence;case t.QueryLexer.FIELD:return t.QueryParser.parseField;case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var r="expected either a field or a term, found "+n.type;throw n.str.length>=1&&(r+=" with value '"+n.str+"'"),new t.QueryParseError(r,n.start,n.end)}},t.QueryParser.parsePresence=function(e){var n=e.consumeLexeme();if(n!=null){switch(n.str){case"-":e.currentClause.presence=t.Query.presence.PROHIBITED;break;case"+":e.currentClause.presence=t.Query.presence.REQUIRED;break;default:var r="unrecognised presence operator'"+n.str+"'";throw new t.QueryParseError(r,n.start,n.end)}var i=e.peekLexeme();if(i==null){var r="expecting term or field, found nothing";throw new t.QueryParseError(r,n.start,n.end)}switch(i.type){case t.QueryLexer.FIELD:return t.QueryParser.parseField;case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var r="expecting term or field, found '"+i.type+"'";throw new t.QueryParseError(r,i.start,i.end)}}},t.QueryParser.parseField=function(e){var n=e.consumeLexeme();if(n!=null){if(e.query.allFields.indexOf(n.str)==-1){var r=e.query.allFields.map(function(o){return"'"+o+"'"}).join(", "),i="unrecognised field '"+n.str+"', possible fields: "+r;throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.fields=[n.str];var s=e.peekLexeme();if(s==null){var i="expecting term, found nothing";throw new t.QueryParseError(i,n.start,n.end)}switch(s.type){case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var i="expecting term, found '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},t.QueryParser.parseTerm=function(e){var n=e.consumeLexeme();if(n!=null){e.currentClause.term=n.str.toLowerCase(),n.str.indexOf("*")!=-1&&(e.currentClause.usePipeline=!1);var r=e.peekLexeme();if(r==null){e.nextClause();return}switch(r.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+r.type+"'";throw new t.QueryParseError(i,r.start,r.end)}}},t.QueryParser.parseEditDistance=function(e){var n=e.consumeLexeme();if(n!=null){var r=parseInt(n.str,10);if(isNaN(r)){var i="edit distance must be numeric";throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.editDistance=r;var s=e.peekLexeme();if(s==null){e.nextClause();return}switch(s.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},t.QueryParser.parseBoost=function(e){var n=e.consumeLexeme();if(n!=null){var r=parseInt(n.str,10);if(isNaN(r)){var i="boost must be numeric";throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.boost=r;var s=e.peekLexeme();if(s==null){e.nextClause();return}switch(s.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},function(e,n){typeof define=="function"&&define.amd?define(n):typeof se=="object"?oe.exports=n():e.lunr=n()}(this,function(){return t})})()});var re=[];function G(t,e){re.push({selector:e,constructor:t})}var U=class{constructor(){this.alwaysVisibleMember=null;this.createComponents(document.body),this.ensureActivePageVisible(),this.ensureFocusedElementVisible(),this.listenForCodeCopies(),window.addEventListener("hashchange",()=>this.ensureFocusedElementVisible())}createComponents(e){re.forEach(n=>{e.querySelectorAll(n.selector).forEach(r=>{r.dataset.hasInstance||(new n.constructor({el:r,app:this}),r.dataset.hasInstance=String(!0))})})}filterChanged(){this.ensureFocusedElementVisible()}ensureActivePageVisible(){let e=document.querySelector(".tsd-navigation .current"),n=e?.parentElement;for(;n&&!n.classList.contains(".tsd-navigation");)n instanceof HTMLDetailsElement&&(n.open=!0),n=n.parentElement;if(e){let r=e.getBoundingClientRect().top-document.documentElement.clientHeight/4;document.querySelector(".site-menu").scrollTop=r}}ensureFocusedElementVisible(){if(this.alwaysVisibleMember&&(this.alwaysVisibleMember.classList.remove("always-visible"),this.alwaysVisibleMember.firstElementChild.remove(),this.alwaysVisibleMember=null),!location.hash)return;let e=document.getElementById(location.hash.substring(1));if(!e)return;let n=e.parentElement;for(;n&&n.tagName!=="SECTION";)n=n.parentElement;if(n&&n.offsetParent==null){this.alwaysVisibleMember=n,n.classList.add("always-visible");let r=document.createElement("p");r.classList.add("warning"),r.textContent="This member is normally hidden due to your filter settings.",n.prepend(r)}}listenForCodeCopies(){document.querySelectorAll("pre > button").forEach(e=>{let n;e.addEventListener("click",()=>{e.previousElementSibling instanceof HTMLElement&&navigator.clipboard.writeText(e.previousElementSibling.innerText.trim()),e.textContent="Copied!",e.classList.add("visible"),clearTimeout(n),n=setTimeout(()=>{e.classList.remove("visible"),n=setTimeout(()=>{e.textContent="Copy"},100)},1e3)})})}};var ie=(t,e=100)=>{let n;return()=>{clearTimeout(n),n=setTimeout(()=>t(),e)}};var de=De(ae());async function le(t,e){if(!window.searchData)return;let n=await fetch(window.searchData),r=new Blob([await n.arrayBuffer()]).stream().pipeThrough(new DecompressionStream("gzip")),i=await new Response(r).json();t.data=i,t.index=de.Index.load(i.index),e.classList.remove("loading"),e.classList.add("ready")}function he(){let t=document.getElementById("tsd-search");if(!t)return;let e={base:t.dataset.base+"/"},n=document.getElementById("tsd-search-script");t.classList.add("loading"),n&&(n.addEventListener("error",()=>{t.classList.remove("loading"),t.classList.add("failure")}),n.addEventListener("load",()=>{le(e,t)}),le(e,t));let r=document.querySelector("#tsd-search input"),i=document.querySelector("#tsd-search .results");if(!r||!i)throw new Error("The input field or the result list wrapper was not found");let s=!1;i.addEventListener("mousedown",()=>s=!0),i.addEventListener("mouseup",()=>{s=!1,t.classList.remove("has-focus")}),r.addEventListener("focus",()=>t.classList.add("has-focus")),r.addEventListener("blur",()=>{s||(s=!1,t.classList.remove("has-focus"))}),Ae(t,i,r,e)}function Ae(t,e,n,r){n.addEventListener("input",ie(()=>{Ne(t,e,n,r)},200));let i=!1;n.addEventListener("keydown",s=>{i=!0,s.key=="Enter"?Ve(e,n):s.key=="Escape"?n.blur():s.key=="ArrowUp"?ue(e,-1):s.key==="ArrowDown"?ue(e,1):i=!1}),n.addEventListener("keypress",s=>{i&&s.preventDefault()}),document.body.addEventListener("keydown",s=>{s.altKey||s.ctrlKey||s.metaKey||!n.matches(":focus")&&s.key==="/"&&(n.focus(),s.preventDefault())})}function Ne(t,e,n,r){if(!r.index||!r.data)return;e.textContent="";let i=n.value.trim(),s=i?r.index.search(`*${i}*`):[];for(let o=0;oa.score-o.score);for(let o=0,a=Math.min(10,s.length);o`,d=ce(l.name,i);globalThis.DEBUG_SEARCH_WEIGHTS&&(d+=` (score: ${s[o].score.toFixed(2)})`),l.parent&&(d=` + ${ce(l.parent,i)}.${d}`);let v=document.createElement("li");v.classList.value=l.classes??"";let f=document.createElement("a");f.href=r.base+l.url,f.innerHTML=u+d,v.append(f),e.appendChild(v)}}function ue(t,e){let n=t.querySelector(".current");if(!n)n=t.querySelector(e==1?"li:first-child":"li:last-child"),n&&n.classList.add("current");else{let r=n;if(e===1)do r=r.nextElementSibling??void 0;while(r instanceof HTMLElement&&r.offsetParent==null);else do r=r.previousElementSibling??void 0;while(r instanceof HTMLElement&&r.offsetParent==null);r&&(n.classList.remove("current"),r.classList.add("current"))}}function Ve(t,e){let n=t.querySelector(".current");if(n||(n=t.querySelector("li:first-child")),n){let r=n.querySelector("a");r&&(window.location.href=r.href),e.blur()}}function ce(t,e){if(e==="")return t;let n=t.toLocaleLowerCase(),r=e.toLocaleLowerCase(),i=[],s=0,o=n.indexOf(r);for(;o!=-1;)i.push(K(t.substring(s,o)),`${K(t.substring(o,o+r.length))}`),s=o+r.length,o=n.indexOf(r,s);return i.push(K(t.substring(s))),i.join("")}var Be={"&":"&","<":"<",">":">","'":"'",'"':"""};function K(t){return t.replace(/[&<>"'"]/g,e=>Be[e])}var C=class{constructor(e){this.el=e.el,this.app=e.app}};var F="mousedown",pe="mousemove",B="mouseup",J={x:0,y:0},fe=!1,ee=!1,He=!1,D=!1,me=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);document.documentElement.classList.add(me?"is-mobile":"not-mobile");me&&"ontouchstart"in document.documentElement&&(He=!0,F="touchstart",pe="touchmove",B="touchend");document.addEventListener(F,t=>{ee=!0,D=!1;let e=F=="touchstart"?t.targetTouches[0]:t;J.y=e.pageY||0,J.x=e.pageX||0});document.addEventListener(pe,t=>{if(ee&&!D){let e=F=="touchstart"?t.targetTouches[0]:t,n=J.x-(e.pageX||0),r=J.y-(e.pageY||0);D=Math.sqrt(n*n+r*r)>10}});document.addEventListener(B,()=>{ee=!1});document.addEventListener("click",t=>{fe&&(t.preventDefault(),t.stopImmediatePropagation(),fe=!1)});var X=class extends C{constructor(n){super(n);this.className=this.el.dataset.toggle||"",this.el.addEventListener(B,r=>this.onPointerUp(r)),this.el.addEventListener("click",r=>r.preventDefault()),document.addEventListener(F,r=>this.onDocumentPointerDown(r)),document.addEventListener(B,r=>this.onDocumentPointerUp(r))}setActive(n){if(this.active==n)return;this.active=n,document.documentElement.classList.toggle("has-"+this.className,n),this.el.classList.toggle("active",n);let r=(this.active?"to-has-":"from-has-")+this.className;document.documentElement.classList.add(r),setTimeout(()=>document.documentElement.classList.remove(r),500)}onPointerUp(n){D||(this.setActive(!0),n.preventDefault())}onDocumentPointerDown(n){if(this.active){if(n.target.closest(".col-sidebar, .tsd-filter-group"))return;this.setActive(!1)}}onDocumentPointerUp(n){if(!D&&this.active&&n.target.closest(".col-sidebar")){let r=n.target.closest("a");if(r){let i=window.location.href;i.indexOf("#")!=-1&&(i=i.substring(0,i.indexOf("#"))),r.href.substring(0,i.length)==i&&setTimeout(()=>this.setActive(!1),250)}}}};var te;try{te=localStorage}catch{te={getItem(){return null},setItem(){}}}var Q=te;var ve=document.head.appendChild(document.createElement("style"));ve.dataset.for="filters";var Y=class extends C{constructor(n){super(n);this.key=`filter-${this.el.name}`,this.value=this.el.checked,this.el.addEventListener("change",()=>{this.setLocalStorage(this.el.checked)}),this.setLocalStorage(this.fromLocalStorage()),ve.innerHTML+=`html:not(.${this.key}) .tsd-is-${this.el.name} { display: none; } +`}fromLocalStorage(){let n=Q.getItem(this.key);return n?n==="true":this.el.checked}setLocalStorage(n){Q.setItem(this.key,n.toString()),this.value=n,this.handleValueChange()}handleValueChange(){this.el.checked=this.value,document.documentElement.classList.toggle(this.key,this.value),this.app.filterChanged(),document.querySelectorAll(".tsd-index-section").forEach(n=>{n.style.display="block";let r=Array.from(n.querySelectorAll(".tsd-index-link")).every(i=>i.offsetParent==null);n.style.display=r?"none":"block"})}};var Z=class extends C{constructor(n){super(n);this.summary=this.el.querySelector(".tsd-accordion-summary"),this.icon=this.summary.querySelector("svg"),this.key=`tsd-accordion-${this.summary.dataset.key??this.summary.textContent.trim().replace(/\s+/g,"-").toLowerCase()}`;let r=Q.getItem(this.key);this.el.open=r?r==="true":this.el.open,this.el.addEventListener("toggle",()=>this.update());let i=this.summary.querySelector("a");i&&i.addEventListener("click",()=>{location.assign(i.href)}),this.update()}update(){this.icon.style.transform=`rotate(${this.el.open?0:-90}deg)`,Q.setItem(this.key,this.el.open.toString())}};function ge(t){let e=Q.getItem("tsd-theme")||"os";t.value=e,ye(e),t.addEventListener("change",()=>{Q.setItem("tsd-theme",t.value),ye(t.value)})}function ye(t){document.documentElement.dataset.theme=t}var Le;function be(){let t=document.getElementById("tsd-nav-script");t&&(t.addEventListener("load",xe),xe())}async function xe(){let t=document.getElementById("tsd-nav-container");if(!t||!window.navigationData)return;let n=await(await fetch(window.navigationData)).arrayBuffer(),r=new Blob([n]).stream().pipeThrough(new DecompressionStream("gzip")),i=await new Response(r).json();Le=t.dataset.base+"/",t.innerHTML="";for(let s of i)we(s,t,[]);window.app.createComponents(t),window.app.ensureActivePageVisible()}function we(t,e,n){let r=e.appendChild(document.createElement("li"));if(t.children){let i=[...n,t.text],s=r.appendChild(document.createElement("details"));s.className=t.class?`${t.class} tsd-index-accordion`:"tsd-index-accordion",s.dataset.key=i.join("$");let o=s.appendChild(document.createElement("summary"));o.className="tsd-accordion-summary",o.innerHTML='',Ee(t,o);let a=s.appendChild(document.createElement("div"));a.className="tsd-accordion-details";let l=a.appendChild(document.createElement("ul"));l.className="tsd-nested-navigation";for(let u of t.children)we(u,l,i)}else Ee(t,r,t.class)}function Ee(t,e,n){if(t.path){let r=e.appendChild(document.createElement("a"));r.href=Le+t.path,n&&(r.className=n),location.href===r.href&&r.classList.add("current"),t.kind&&(r.innerHTML=``),r.appendChild(document.createElement("span")).textContent=t.text}else e.appendChild(document.createElement("span")).textContent=t.text}G(X,"a[data-toggle]");G(Z,".tsd-index-accordion");G(Y,".tsd-filter-item input[type=checkbox]");var Se=document.getElementById("tsd-theme");Se&&ge(Se);var je=new U;Object.defineProperty(window,"app",{value:je});he();be();})(); /*! Bundled license information: lunr/lunr.js: diff --git a/dhkem-secp256k1/docs/assets/navigation.js b/dhkem-secp256k1/docs/assets/navigation.js new file mode 100644 index 000000000..9ea89febe --- /dev/null +++ b/dhkem-secp256k1/docs/assets/navigation.js @@ -0,0 +1 @@ +window.navigationData = "data:application/octet-stream;base64,H4sIAAAAAAAAA4uuVipJrShRslJyychOzQ1OTS4wMjXLNvTITkkLzkgEspV0lAoSSzKAKpJzEouLU4v1canUyyjJzQEqz87MS1GyMjSyqI0FAHjzGxZfAAAA" \ No newline at end of file diff --git a/dhkem-secp256k1/docs/assets/search.js b/dhkem-secp256k1/docs/assets/search.js index 73069d1a2..7b5a8d141 100644 --- a/dhkem-secp256k1/docs/assets/search.js +++ b/dhkem-secp256k1/docs/assets/search.js @@ -1 +1 @@ -window.searchData = JSON.parse("{\"rows\":[{\"kind\":128,\"name\":\"DhkemSecp256k1HkdfSha256\",\"url\":\"classes/DhkemSecp256k1HkdfSha256.html\",\"classes\":\"\"},{\"kind\":512,\"name\":\"constructor\",\"url\":\"classes/DhkemSecp256k1HkdfSha256.html#constructor\",\"classes\":\"\",\"parent\":\"DhkemSecp256k1HkdfSha256\"},{\"kind\":1024,\"name\":\"id\",\"url\":\"classes/DhkemSecp256k1HkdfSha256.html#id\",\"classes\":\"\",\"parent\":\"DhkemSecp256k1HkdfSha256\"},{\"kind\":1024,\"name\":\"secretSize\",\"url\":\"classes/DhkemSecp256k1HkdfSha256.html#secretSize\",\"classes\":\"\",\"parent\":\"DhkemSecp256k1HkdfSha256\"},{\"kind\":1024,\"name\":\"encSize\",\"url\":\"classes/DhkemSecp256k1HkdfSha256.html#encSize\",\"classes\":\"\",\"parent\":\"DhkemSecp256k1HkdfSha256\"},{\"kind\":1024,\"name\":\"publicKeySize\",\"url\":\"classes/DhkemSecp256k1HkdfSha256.html#publicKeySize\",\"classes\":\"\",\"parent\":\"DhkemSecp256k1HkdfSha256\"},{\"kind\":1024,\"name\":\"privateKeySize\",\"url\":\"classes/DhkemSecp256k1HkdfSha256.html#privateKeySize\",\"classes\":\"\",\"parent\":\"DhkemSecp256k1HkdfSha256\"},{\"kind\":1024,\"name\":\"_prim\",\"url\":\"classes/DhkemSecp256k1HkdfSha256.html#_prim\",\"classes\":\"tsd-is-protected tsd-is-inherited\",\"parent\":\"DhkemSecp256k1HkdfSha256\"},{\"kind\":1024,\"name\":\"_kdf\",\"url\":\"classes/DhkemSecp256k1HkdfSha256.html#_kdf\",\"classes\":\"tsd-is-protected tsd-is-inherited\",\"parent\":\"DhkemSecp256k1HkdfSha256\"},{\"kind\":2048,\"name\":\"serializePublicKey\",\"url\":\"classes/DhkemSecp256k1HkdfSha256.html#serializePublicKey\",\"classes\":\"tsd-is-inherited\",\"parent\":\"DhkemSecp256k1HkdfSha256\"},{\"kind\":2048,\"name\":\"deserializePublicKey\",\"url\":\"classes/DhkemSecp256k1HkdfSha256.html#deserializePublicKey\",\"classes\":\"tsd-is-inherited\",\"parent\":\"DhkemSecp256k1HkdfSha256\"},{\"kind\":2048,\"name\":\"serializePrivateKey\",\"url\":\"classes/DhkemSecp256k1HkdfSha256.html#serializePrivateKey\",\"classes\":\"tsd-is-inherited\",\"parent\":\"DhkemSecp256k1HkdfSha256\"},{\"kind\":2048,\"name\":\"deserializePrivateKey\",\"url\":\"classes/DhkemSecp256k1HkdfSha256.html#deserializePrivateKey\",\"classes\":\"tsd-is-inherited\",\"parent\":\"DhkemSecp256k1HkdfSha256\"},{\"kind\":2048,\"name\":\"importKey\",\"url\":\"classes/DhkemSecp256k1HkdfSha256.html#importKey\",\"classes\":\"tsd-is-inherited\",\"parent\":\"DhkemSecp256k1HkdfSha256\"},{\"kind\":2048,\"name\":\"generateKeyPair\",\"url\":\"classes/DhkemSecp256k1HkdfSha256.html#generateKeyPair\",\"classes\":\"tsd-is-inherited\",\"parent\":\"DhkemSecp256k1HkdfSha256\"},{\"kind\":2048,\"name\":\"deriveKeyPair\",\"url\":\"classes/DhkemSecp256k1HkdfSha256.html#deriveKeyPair\",\"classes\":\"tsd-is-inherited\",\"parent\":\"DhkemSecp256k1HkdfSha256\"},{\"kind\":2048,\"name\":\"encap\",\"url\":\"classes/DhkemSecp256k1HkdfSha256.html#encap\",\"classes\":\"tsd-is-inherited\",\"parent\":\"DhkemSecp256k1HkdfSha256\"},{\"kind\":2048,\"name\":\"decap\",\"url\":\"classes/DhkemSecp256k1HkdfSha256.html#decap\",\"classes\":\"tsd-is-inherited\",\"parent\":\"DhkemSecp256k1HkdfSha256\"}],\"index\":{\"version\":\"2.3.9\",\"fields\":[\"name\",\"comment\"],\"fieldVectors\":[[\"name/0\",[0,25.39]],[\"comment/0\",[]],[\"name/1\",[1,25.39]],[\"comment/1\",[]],[\"name/2\",[2,25.39]],[\"comment/2\",[]],[\"name/3\",[3,25.39]],[\"comment/3\",[]],[\"name/4\",[4,25.39]],[\"comment/4\",[]],[\"name/5\",[5,25.39]],[\"comment/5\",[]],[\"name/6\",[6,25.39]],[\"comment/6\",[]],[\"name/7\",[7,25.39]],[\"comment/7\",[]],[\"name/8\",[8,25.39]],[\"comment/8\",[]],[\"name/9\",[9,25.39]],[\"comment/9\",[]],[\"name/10\",[10,25.39]],[\"comment/10\",[]],[\"name/11\",[11,25.39]],[\"comment/11\",[]],[\"name/12\",[12,25.39]],[\"comment/12\",[]],[\"name/13\",[13,25.39]],[\"comment/13\",[]],[\"name/14\",[14,25.39]],[\"comment/14\",[]],[\"name/15\",[15,25.39]],[\"comment/15\",[]],[\"name/16\",[16,25.39]],[\"comment/16\",[]],[\"name/17\",[17,25.39]],[\"comment/17\",[]]],\"invertedIndex\":[[\"_kdf\",{\"_index\":8,\"name\":{\"8\":{}},\"comment\":{}}],[\"_prim\",{\"_index\":7,\"name\":{\"7\":{}},\"comment\":{}}],[\"constructor\",{\"_index\":1,\"name\":{\"1\":{}},\"comment\":{}}],[\"decap\",{\"_index\":17,\"name\":{\"17\":{}},\"comment\":{}}],[\"derivekeypair\",{\"_index\":15,\"name\":{\"15\":{}},\"comment\":{}}],[\"deserializeprivatekey\",{\"_index\":12,\"name\":{\"12\":{}},\"comment\":{}}],[\"deserializepublickey\",{\"_index\":10,\"name\":{\"10\":{}},\"comment\":{}}],[\"dhkemsecp256k1hkdfsha256\",{\"_index\":0,\"name\":{\"0\":{}},\"comment\":{}}],[\"encap\",{\"_index\":16,\"name\":{\"16\":{}},\"comment\":{}}],[\"encsize\",{\"_index\":4,\"name\":{\"4\":{}},\"comment\":{}}],[\"generatekeypair\",{\"_index\":14,\"name\":{\"14\":{}},\"comment\":{}}],[\"id\",{\"_index\":2,\"name\":{\"2\":{}},\"comment\":{}}],[\"importkey\",{\"_index\":13,\"name\":{\"13\":{}},\"comment\":{}}],[\"privatekeysize\",{\"_index\":6,\"name\":{\"6\":{}},\"comment\":{}}],[\"publickeysize\",{\"_index\":5,\"name\":{\"5\":{}},\"comment\":{}}],[\"secretsize\",{\"_index\":3,\"name\":{\"3\":{}},\"comment\":{}}],[\"serializeprivatekey\",{\"_index\":11,\"name\":{\"11\":{}},\"comment\":{}}],[\"serializepublickey\",{\"_index\":9,\"name\":{\"9\":{}},\"comment\":{}}]],\"pipeline\":[]}}"); \ No newline at end of file +window.searchData = "data:application/octet-stream;base64,H4sIAAAAAAAAA7VXyW7bMBD9lYK9Ko5Hiy373EOLXgIE6MUwAlViasLaQMlpU8P/3qEWk1TIpLKtSxDS7808zeNwORJe/K7IenMke5YnZA1u6JA8yihZky+7Pc0eaVy6wWIPX/fJ8+Muwv+JQw48RUCcRlVFq3sbcLarsxTRHQ4Z5OT0mQJwz5niIq9qfojrgo8L/llnKokcUkac5vV73yHFwNz1z2pYMlJEQ7hN7orGnNaP7C8dqUEj3kYLzeMLhEjWbVSUh58pi7/T1wu0DLk3UsTZS1TTCyUNybfR9IRxs5FSeo5UUFfJHavuSl7UNK5p8qmbYPmOcoYTV0lExFiFLWU6ge7cD5Xe4yxK0ZWHftmM7kFDgDfib6I1oVertYSYRq9MdV7/FxdXjTB9dS/Va4sxjWKWlQWvx6tUedMo+0Vzytuvf4jY2PP9LXsqx9GjCzUOudMoxHM1KsefxQ1nqpqNV9RzrlW0dQgKon/I+kheKK9YkSPenXmzFQZ4ZjRNxLW2lYrpiiwTIbfdbz+ouDEKRAu5nxNnM3fcYOattltn0xOa+WaiQQGOwIACDeXiyDWgXA3l4cgzoDwN5ePIN6B8DRXgKDCgAg2FF/fNwoBaaKgljpYG1FJDhTgKDahQQ6EXm5UBtdKrKooMpurDoPxN/Y0G6A6AKDWYPADdBBDVBpMNoPsAouBgcgJ0K0DUHExmgO4GiLKDyQ/QDQFReTBZAq0nTS9gE2DzfGt7Ald1e3U6kqeuTc5teyQh/jmdZFOIkQjb3QclZyk5SwtHe39JJkgmWJjdTqBwlHRgy9futXv6WjZ7rcIOFHZgZZ/P5O4evhcnnxLFVaK4/xGluTgNg8yVIHNbELG1Vf3WtkO3qu5xLQMpcWxhuh1eSb5Qki/srKp5fUieL2m+hdWfxabqK3Sw8cUzWVKUStsK3V5OhtX1lFSehSndHX6nUh5bdc6mDrnKErOtsPYZPiQqkm2KP1qYakfZWur9ZbmSEVamALiNlKykKcsRs9meTv8AOHXCeB0SAAA="; \ No newline at end of file diff --git a/dhkem-secp256k1/docs/assets/style.css b/dhkem-secp256k1/docs/assets/style.css index 258146fc0..108428c3f 100644 --- a/dhkem-secp256k1/docs/assets/style.css +++ b/dhkem-secp256k1/docs/assets/style.css @@ -910,8 +910,9 @@ a.tsd-index-link { box-shadow: 0 0 4px rgba(0, 0, 0, 0.25); } #tsd-search .results li { - padding: 0 10px; background-color: var(--color-background); + line-height: initial; + padding: 4px; } #tsd-search .results li:nth-child(even) { background-color: var(--color-background-secondary); @@ -924,7 +925,10 @@ a.tsd-index-link { background-color: var(--color-accent); } #tsd-search .results a { - display: block; + display: flex; + align-items: center; + padding: 0.25rem; + box-sizing: border-box; } #tsd-search .results a:before { top: 10px; @@ -1134,7 +1138,7 @@ img { } .deprecated { - text-decoration: line-through; + text-decoration: line-through !important; } .warning { diff --git a/dhkem-secp256k1/docs/classes/DhkemSecp256k1HkdfSha256.html b/dhkem-secp256k1/docs/classes/DhkemSecp256k1HkdfSha256.html index 373cd5435..9a0752de5 100644 --- a/dhkem-secp256k1/docs/classes/DhkemSecp256k1HkdfSha256.html +++ b/dhkem-secp256k1/docs/classes/DhkemSecp256k1HkdfSha256.html @@ -1,13 +1,13 @@ -DhkemSecp256k1HkdfSha256 | @hpke/dhkem-secp256k1
    +DhkemSecp256k1HkdfSha256 | @hpke/dhkem-secp256k1
    -
    +
    @@ -42,19 +42,19 @@

    Hierarchy

    • DhkemSecp256k1HkdfSha256
    +
  • Defined in src/kems/dhkemSecp256k1.ts:52
  • - +

    Constructors

    -

    Properties

    -
    _kdf +
    _kdf _prim encSize id @@ -64,7 +64,7 @@

    Properties

    Methods

    -
    decap +
    decap deriveKeyPair deserializePrivateKey deserializePublicKey @@ -77,14 +77,14 @@

    Methods

    Constructors

    - +
    +
  • Defined in src/kems/dhkemSecp256k1.ts:64
  • Properties

    @@ -92,13 +92,13 @@
    +
  • Defined in src/kems/dhkem.ts:41
  • _prim: DhkemPrimitives
    +
  • Defined in src/kems/dhkem.ts:40
  • encSize: number = 33
    @@ -107,7 +107,7 @@
    +
  • Defined in src/kems/dhkemSecp256k1.ts:58
  • id: KemId = KemId.DhkemSecp256k1HkdfSha256
    @@ -116,7 +116,7 @@
    +
  • Defined in src/kems/dhkemSecp256k1.ts:54
  • privateKeySize: number = 32
    @@ -125,7 +125,7 @@
    +
  • Defined in src/kems/dhkemSecp256k1.ts:62
  • publicKeySize: number = 33
    @@ -134,7 +134,7 @@
    +
  • Defined in src/kems/dhkemSecp256k1.ts:60
  • secretSize: number = 32
    @@ -143,7 +143,7 @@
    +
  • Defined in src/kems/dhkemSecp256k1.ts:56
  • Methods

    @@ -159,7 +159,7 @@
    params: Returns Promise<ArrayBuffer>
    +
  • Defined in src/kems/dhkem.ts:148
    • @@ -173,7 +173,7 @@
      ikm: Returns Promise<CryptoKeyPair>
    +
  • Defined in src/kems/dhkem.ts:80
    • @@ -187,7 +187,7 @@
      key: Returns Promise<CryptoKey>
    +
  • Defined in src/kems/dhkem.ts:64
    • @@ -201,7 +201,7 @@
      key: Returns Promise<CryptoKey>
    +
  • Defined in src/kems/dhkem.ts:56
    • @@ -215,7 +215,7 @@
      params: Returns Promise<{
          enc: ArrayBuffer;
          sharedSecret: ArrayBuffer;
      }>
    +
  • Defined in src/kems/dhkem.ts:87
  • +
  • Defined in src/kems/dhkem.ts:76
    • @@ -242,7 +242,7 @@
      isPublic: Returns Promise<CryptoKey>
    +
  • Defined in src/kems/dhkem.ts:68
    • @@ -256,7 +256,7 @@
      key: Returns Promise<ArrayBuffer>
    +
  • Defined in src/kems/dhkem.ts:60
    • @@ -270,20 +270,20 @@
      key: Returns Promise<ArrayBuffer>
    +
  • Defined in src/kems/dhkem.ts:52
  • @@ -308,9 +308,9 @@

    serializePrivateKey
  • serializePublicKey
  • +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/dhkem-secp256k1/docs/index.html b/dhkem-secp256k1/docs/index.html index da9053142..3e7eb2c3a 100644 --- a/dhkem-secp256k1/docs/index.html +++ b/dhkem-secp256k1/docs/index.html @@ -1,13 +1,13 @@ -@hpke/dhkem-secp256k1
    +@hpke/dhkem-secp256k1
    -
    +
    @@ -70,15 +70,15 @@

    @hpke/dhkem-secp256k1

    @@ -105,9 +105,9 @@

    Browsers
  • Contributing
  • +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/dhkem-secp256k1/docs/modules.html b/dhkem-secp256k1/docs/modules.html index 0bfc286f8..e611a6eeb 100644 --- a/dhkem-secp256k1/docs/modules.html +++ b/dhkem-secp256k1/docs/modules.html @@ -1,13 +1,13 @@ -@hpke/dhkem-secp256k1
    +@hpke/dhkem-secp256k1
    -
    +
    @@ -17,27 +17,27 @@

    @hpke/dhkem-secp256k1

    Index

    Classes

    -
    +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/dhkem-secp256k1/src/hpke-dhkem-secp256k1.js b/dhkem-secp256k1/src/hpke-dhkem-secp256k1.js index 43ca8409c..7661a8af6 100644 --- a/dhkem-secp256k1/src/hpke-dhkem-secp256k1.js +++ b/dhkem-secp256k1/src/hpke-dhkem-secp256k1.js @@ -1,6 +1,9 @@ -var Vt=Object.defineProperty;var Mt=(r,e)=>{for(var t in e)Vt(r,t,{get:e[t],enumerable:!0})};var $t={NotAssigned:0,DhkemP256HkdfSha256:16,DhkemP384HkdfSha384:17,DhkemP521HkdfSha512:18,DhkemSecp256k1HkdfSha256:19,DhkemX25519HkdfSha256:32,DhkemX448HkdfSha512:33,HybridkemX25519Kyber768:48},Xe=$t,Zt={HkdfSha256:1,HkdfSha384:2,HkdfSha512:3},Qe=Zt;function Je(r){if(!Number.isSafeInteger(r)||r<0)throw new Error(`Wrong positive integer: ${r}`)}function Gt(r){if(typeof r!="boolean")throw new Error(`Expected boolean, not ${r}`)}function mt(r,...e){if(!(r instanceof Uint8Array))throw new Error("Expected Uint8Array");if(e.length>0&&!e.includes(r.length))throw new Error(`Expected Uint8Array of length ${e}, not of length=${r.length}`)}function Yt(r){if(typeof r!="function"||typeof r.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Je(r.outputLen),Je(r.blockLen)}function Wt(r,e=!0){if(r.destroyed)throw new Error("Hash instance has been destroyed");if(e&&r.finished)throw new Error("Hash#digest() has already been called")}function Xt(r,e){mt(r);let t=e.outputLen;if(r.lengthr instanceof Uint8Array;var Ke=r=>new DataView(r.buffer,r.byteOffset,r.byteLength),M=(r,e)=>r<<32-e|r>>>e,Jt=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!Jt)throw new Error("Non little-endian hardware is not supported");var Mr=Array.from({length:256},(r,e)=>e.toString(16).padStart(2,"0"));function Ft(r){if(typeof r!="string")throw new Error(`utf8ToBytes expected string, got ${typeof r}`);return new Uint8Array(new TextEncoder().encode(r))}function ve(r){if(typeof r=="string"&&(r=Ft(r)),!xt(r))throw new Error(`expected Uint8Array, got ${typeof r}`);return r}function Et(...r){let e=new Uint8Array(r.reduce((n,i)=>n+i.length,0)),t=0;return r.forEach(n=>{if(!xt(n))throw new Error("Uint8Array expected");e.set(n,t),t+=n.length}),e}var pe=class{clone(){return this._cloneInto()}};function Fe(r){let e=n=>r().update(ve(n)).digest(),t=r();return e.outputLen=t.outputLen,e.blockLen=t.blockLen,e.create=()=>r(),e}function et(r=32){if(Pe&&typeof Pe.getRandomValues=="function")return Pe.getRandomValues(new Uint8Array(r));throw new Error("crypto.getRandomValues must be defined")}var ke=class extends pe{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,G.hash(e);let n=ve(t);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let i=this.blockLen,o=new Uint8Array(i);o.set(n.length>i?e.create().update(n).digest():n);for(let a=0;anew ke(r,e).update(t).digest();Be.create=(r,e)=>new ke(r,e);function er(r,e,t,n){if(typeof r.setBigUint64=="function")return r.setBigUint64(e,t,n);let i=BigInt(32),o=BigInt(4294967295),a=Number(t>>i&o),s=Number(t&o),c=n?4:0,u=n?0:4;r.setUint32(e+c,a,n),r.setUint32(e+u,s,n)}var Ue=class extends pe{constructor(e,t,n,i){super(),this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=Ke(this.buffer)}update(e){G.exists(this);let{view:t,buffer:n,blockLen:i}=this;e=ve(e);let o=e.length;for(let a=0;ai-a&&(this.process(n,0),a=0);for(let l=a;lb.length)throw new Error("_sha2: outputLen bigger than state");for(let l=0;lr&e^~r&t,rr=(r,e,t)=>r&e^r&t^e&t,nr=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),ne=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),ie=new Uint32Array(64),Le=class extends Ue{constructor(){super(64,32,8,!1),this.A=ne[0]|0,this.B=ne[1]|0,this.C=ne[2]|0,this.D=ne[3]|0,this.E=ne[4]|0,this.F=ne[5]|0,this.G=ne[6]|0,this.H=ne[7]|0}get(){let{A:e,B:t,C:n,D:i,E:o,F:a,G:s,H:c}=this;return[e,t,n,i,o,a,s,c]}set(e,t,n,i,o,a,s,c){this.A=e|0,this.B=t|0,this.C=n|0,this.D=i|0,this.E=o|0,this.F=a|0,this.G=s|0,this.H=c|0}process(e,t){for(let l=0;l<16;l++,t+=4)ie[l]=e.getUint32(t,!1);for(let l=16;l<64;l++){let m=ie[l-15],_=ie[l-2],g=M(m,7)^M(m,18)^m>>>3,f=M(_,17)^M(_,19)^_>>>10;ie[l]=f+ie[l-7]+g+ie[l-16]|0}let{A:n,B:i,C:o,D:a,E:s,F:c,G:u,H:b}=this;for(let l=0;l<64;l++){let m=M(s,6)^M(s,11)^M(s,25),_=b+m+tr(s,c,u)+nr[l]+ie[l]|0,f=(M(n,2)^M(n,13)^M(n,22))+rr(n,i,o)|0;b=u,u=c,c=s,s=a+_|0,a=o,o=i,i=n,n=_+f|0}n=n+this.A|0,i=i+this.B|0,o=o+this.C|0,a=a+this.D|0,s=s+this.E|0,c=c+this.F|0,u=u+this.G|0,b=b+this.H|0,this.set(n,i,o,a,s,c,u,b)}roundClean(){ie.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}},tt=class extends Le{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}},Oe=Fe(()=>new Le),en=Fe(()=>new tt);var ir={},vt=or(globalThis,ir);function or(r,e){return new Proxy(r,{get(t,n,i){return n in e?e[n]:r[n]},set(t,n,i){return n in e&&delete e[n],r[n]=i,!0},deleteProperty(t,n){let i=!1;return n in e&&(delete e[n],i=!0),n in r&&(delete r[n],i=!0),i},ownKeys(t){let n=Reflect.ownKeys(r),i=Reflect.ownKeys(e),o=new Set(i);return[...n.filter(a=>!o.has(a)),...i]},defineProperty(t,n,i){return n in e&&delete e[n],Reflect.defineProperty(r,n,i),!0},getOwnPropertyDescriptor(t,n){return n in e?Reflect.getOwnPropertyDescriptor(e,n):Reflect.getOwnPropertyDescriptor(r,n)},has(t,n){return n in e||n in r}})}var rt=class extends Error{constructor(e){let t;e instanceof Error?t=e.message:typeof e=="string"?t=e:t="",super(t),this.name=this.constructor.name}},Y=class extends rt{},we=class extends Y{};var ge=class extends Y{},ce=class extends Y{},Te=class extends Y{},He=class extends Y{};var Ne=class extends Y{},me=class extends Y{};async function cr(){if(vt!==void 0&&globalThis.crypto!==void 0)return globalThis.crypto.subtle;try{let{webcrypto:r}=await import("crypto");return r.subtle}catch(r){throw new me(r)}}var qe=class{constructor(){Object.defineProperty(this,"_api",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}async _setup(){this._api===void 0&&(this._api=await cr())}};var W=new Uint8Array(0);var Bt=new Uint8Array([72,80,75,69,45,118,49]),nt=class extends qe{constructor(){super(),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:Qe.HkdfSha256}),Object.defineProperty(this,"hashSize",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_suiteId",{enumerable:!0,configurable:!0,writable:!0,value:W}),Object.defineProperty(this,"algHash",{enumerable:!0,configurable:!0,writable:!0,value:{name:"HMAC",hash:"SHA-256",length:256}})}init(e){this._suiteId=e}buildLabeledIkm(e,t){this._checkInit();let n=new Uint8Array(7+this._suiteId.byteLength+e.byteLength+t.byteLength);return n.set(Bt,0),n.set(this._suiteId,7),n.set(e,7+this._suiteId.byteLength),n.set(t,7+this._suiteId.byteLength+e.byteLength),n}buildLabeledInfo(e,t,n){this._checkInit();let i=new Uint8Array(9+this._suiteId.byteLength+e.byteLength+t.byteLength);return i.set(new Uint8Array([0,n]),0),i.set(Bt,2),i.set(this._suiteId,9),i.set(e,9+this._suiteId.byteLength),i.set(t,9+this._suiteId.byteLength+e.byteLength),i}async extract(e,t){if(await this._setup(),e.byteLength===0&&(e=new ArrayBuffer(this.hashSize)),e.byteLength!==this.hashSize)throw new we("The salt length must be the same as the hashSize");let n=await this._api.importKey("raw",e,this.algHash,!1,["sign"]);return await this._api.sign("HMAC",n,t)}async expand(e,t,n){await this._setup();let i=await this._api.importKey("raw",e,this.algHash,!1,["sign"]),o=new ArrayBuffer(n),a=new Uint8Array(o),s=W,c=new Uint8Array(t),u=new Uint8Array(1);if(n>255*this.hashSize)throw new Error("Entropy limit reached");let b=new Uint8Array(this.hashSize+c.length+1);for(let l=1,m=0;m=s.length?(a.set(s,m),m+=s.length):(a.set(s.slice(0,a.length-m),m),m+=a.length-m);return o}async extractAndExpand(e,t,n,i){await this._setup();let o=await this._api.importKey("raw",t,"HKDF",!1,["deriveBits"]);return await this._api.deriveBits({name:"HKDF",hash:this.algHash.hash,salt:e,info:n},o,i*8)}async labeledExtract(e,t,n){return await this.extract(e,this.buildLabeledIkm(t,n))}async labeledExpand(e,t,n,i){return await this.expand(e,this.buildLabeledInfo(t,n,i),i)}_checkInit(){if(this._suiteId===W)throw new Error("Not initialized. Call init()")}},Re=class extends nt{constructor(){super(...arguments),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:Qe.HkdfSha256}),Object.defineProperty(this,"hashSize",{enumerable:!0,configurable:!0,writable:!0,value:32}),Object.defineProperty(this,"algHash",{enumerable:!0,configurable:!0,writable:!0,value:{name:"HMAC",hash:"SHA-256",length:256}})}};var ze=class extends Re{async extract(e,t){if(await this._setup(),e.byteLength===0&&(e=new ArrayBuffer(this.hashSize)),e.byteLength!==this.hashSize)return Be(Oe,new Uint8Array(e),new Uint8Array(t));let n=await this._api.importKey("raw",e,this.algHash,!1,["sign"]);return await this._api.sign("HMAC",n,t)}};var St=new Uint8Array([75,69,77,0,0]);var xe=r=>typeof r=="object"&&r!==null&&typeof r.privateKey=="object"&&typeof r.publicKey=="object";function At(r,e){if(e<=0)throw new Error("i2Osp: too small size");if(r>=256**e)throw new Error("i2Osp: too large integer");let t=new Uint8Array(e);for(let n=0;n>8;return t}function Se(r,e){let t=new Uint8Array(r.length+e.length);return t.set(r,0),t.set(e,r.length),t}var ur=new Uint8Array([101,97,101,95,112,114,107]),fr=new Uint8Array([115,104,97,114,101,100,95,115,101,99,114,101,116]);function lr(r,e,t){let n=new Uint8Array(r.length+e.length+t.length);return n.set(r,0),n.set(e,r.length),n.set(t,r.length+e.length),n}var Ce=class{constructor(e,t,n){Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"secretSize",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"encSize",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"publicKeySize",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"privateKeySize",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_prim",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_kdf",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.id=e,this._prim=t,this._kdf=n;let i=new Uint8Array(St);i.set(At(this.id,2),3),this._kdf.init(i)}async serializePublicKey(e){return await this._prim.serializePublicKey(e)}async deserializePublicKey(e){return await this._prim.deserializePublicKey(e)}async serializePrivateKey(e){return await this._prim.serializePrivateKey(e)}async deserializePrivateKey(e){return await this._prim.deserializePrivateKey(e)}async importKey(e,t,n=!0){return await this._prim.importKey(e,t,n)}async generateKeyPair(){return await this._prim.generateKeyPair()}async deriveKeyPair(e){if(e.byteLength>8192)throw new we("Too long ikm");return await this._prim.deriveKeyPair(e)}async encap(e){let t;e.ekm===void 0?t=await this.generateKeyPair():xe(e.ekm)?t=e.ekm:t=await this.deriveKeyPair(e.ekm);let n=await this._prim.serializePublicKey(t.publicKey),i=await this._prim.serializePublicKey(e.recipientPublicKey);try{let o;if(e.senderKey===void 0)o=new Uint8Array(await this._prim.dh(t.privateKey,e.recipientPublicKey));else{let c=xe(e.senderKey)?e.senderKey.privateKey:e.senderKey,u=new Uint8Array(await this._prim.dh(t.privateKey,e.recipientPublicKey)),b=new Uint8Array(await this._prim.dh(c,e.recipientPublicKey));o=Se(u,b)}let a;if(e.senderKey===void 0)a=Se(new Uint8Array(n),new Uint8Array(i));else{let c=xe(e.senderKey)?e.senderKey.publicKey:await this._prim.derivePublicKey(e.senderKey),u=await this._prim.serializePublicKey(c);a=lr(new Uint8Array(n),new Uint8Array(i),new Uint8Array(u))}let s=await this._generateSharedSecret(o,a);return{enc:n,sharedSecret:s}}catch(o){throw new Te(o)}}async decap(e){let t=await this._prim.deserializePublicKey(e.enc),n=xe(e.recipientKey)?e.recipientKey.privateKey:e.recipientKey,i=xe(e.recipientKey)?e.recipientKey.publicKey:await this._prim.derivePublicKey(e.recipientKey),o=await this._prim.serializePublicKey(i);try{let a;if(e.senderPublicKey===void 0)a=new Uint8Array(await this._prim.dh(n,t));else{let c=new Uint8Array(await this._prim.dh(n,t)),u=new Uint8Array(await this._prim.dh(n,e.senderPublicKey));a=Se(c,u)}let s;if(e.senderPublicKey===void 0)s=Se(new Uint8Array(e.enc),new Uint8Array(o));else{let c=await this._prim.serializePublicKey(e.senderPublicKey);s=new Uint8Array(e.enc.byteLength+o.byteLength+c.byteLength),s.set(new Uint8Array(e.enc),0),s.set(new Uint8Array(o),e.enc.byteLength),s.set(new Uint8Array(c),e.enc.byteLength+o.byteLength)}return await this._generateSharedSecret(a,s)}catch(a){throw new He(a)}}async _generateSharedSecret(e,t){let n=this._kdf.buildLabeledIkm(ur,e),i=this._kdf.buildLabeledInfo(fr,t,this.secretSize);return await this._kdf.extractAndExpand(W,n,i,this.secretSize)}};var at={};Mt(at,{bitGet:()=>wr,bitLen:()=>pr,bitMask:()=>Ae,bitSet:()=>gr,bytesToHex:()=>ae,bytesToNumberBE:()=>$,bytesToNumberLE:()=>Ve,concatBytes:()=>oe,createHmacDrbg:()=>ct,ensureBytes:()=>N,equalBytes:()=>br,hexToBytes:()=>ue,hexToNumber:()=>ot,numberToBytesBE:()=>X,numberToBytesLE:()=>st,numberToHexUnpadded:()=>Pt,numberToVarBytesBE:()=>yr,utf8ToBytes:()=>Kt,validateObject:()=>Q});var It=BigInt(0),De=BigInt(1),dr=BigInt(2),je=r=>r instanceof Uint8Array,hr=Array.from({length:256},(r,e)=>e.toString(16).padStart(2,"0"));function ae(r){if(!je(r))throw new Error("Uint8Array expected");let e="";for(let t=0;tn+i.length,0)),t=0;return r.forEach(n=>{if(!je(n))throw new Error("Uint8Array expected");e.set(n,t),t+=n.length}),e}function br(r,e){if(r.length!==e.length)return!1;for(let t=0;tIt;r>>=De,e+=1);return e}function wr(r,e){return r>>BigInt(e)&De}var gr=(r,e,t)=>r|(t?De:It)<(dr<new Uint8Array(r),_t=r=>Uint8Array.from(r);function ct(r,e,t){if(typeof r!="number"||r<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof t!="function")throw new Error("hmacFn must be a function");let n=it(r),i=it(r),o=0,a=()=>{n.fill(1),i.fill(0),o=0},s=(...l)=>t(i,n,...l),c=(l=it())=>{i=s(_t([0]),l),n=s(),l.length!==0&&(i=s(_t([1]),l),n=s())},u=()=>{if(o++>=1e3)throw new Error("drbg: tried 1000 values");let l=0,m=[];for(;l{a(),c(l);let _;for(;!(_=m(u()));)c();return a(),_}}var mr={bigint:r=>typeof r=="bigint",function:r=>typeof r=="function",boolean:r=>typeof r=="boolean",string:r=>typeof r=="string",isSafeInteger:r=>Number.isSafeInteger(r),array:r=>Array.isArray(r),field:(r,e)=>e.Fp.isValid(r),hash:r=>typeof r=="function"&&Number.isSafeInteger(r.outputLen)};function Q(r,e,t={}){let n=(i,o,a)=>{let s=mr[o];if(typeof s!="function")throw new Error(`Invalid validator "${o}", expected function`);let c=r[i];if(!(a&&c===void 0)&&!s(c,r))throw new Error(`Invalid param ${String(i)}=${c} (${typeof c}), expected ${o}`)};for(let[i,o]of Object.entries(e))n(i,o,!1);for(let[i,o]of Object.entries(t))n(i,o,!0);return r}var O=BigInt(0),L=BigInt(1),fe=BigInt(2),xr=BigInt(3),ut=BigInt(4),kt=BigInt(5),Ut=BigInt(8),Er=BigInt(9),vr=BigInt(16);function H(r,e){let t=r%e;return t>=O?t:e+t}function Br(r,e,t){if(t<=O||e 0");if(t===L)return O;let n=L;for(;e>O;)e&L&&(n=n*r%t),r=r*r%t,e>>=L;return n}function D(r,e,t){let n=r;for(;e-- >O;)n*=n,n%=t;return n}function Me(r,e){if(r===O||e<=O)throw new Error(`invert: expected positive integers, got n=${r} mod=${e}`);let t=H(r,e),n=e,i=O,o=L,a=L,s=O;for(;t!==O;){let u=n/t,b=n%t,l=i-a*u,m=o-s*u;n=t,t=b,i=a,o=s,a=l,s=m}if(n!==L)throw new Error("invert: does not exist");return H(i,e)}function Sr(r){let e=(r-L)/fe,t,n,i;for(t=r-L,n=0;t%fe===O;t/=fe,n++);for(i=fe;i(n[i]="function",n),e);return Q(r,t)}function Ir(r,e,t){if(t 0");if(t===O)return r.ONE;if(t===L)return e;let n=r.ONE,i=e;for(;t>O;)t&L&&(n=r.mul(n,i)),i=r.sqr(i),t>>=L;return n}function Pr(r,e){let t=new Array(e.length),n=e.reduce((o,a,s)=>r.is0(a)?o:(t[s]=o,r.mul(o,a)),r.ONE),i=r.inv(n);return e.reduceRight((o,a,s)=>r.is0(a)?o:(t[s]=r.mul(o,t[s]),r.mul(o,a)),i),t}function $e(r,e){let t=e!==void 0?e:r.toString(2).length,n=Math.ceil(t/8);return{nBitLength:t,nByteLength:n}}function Lt(r,e,t=!1,n={}){if(r<=O)throw new Error(`Expected Fp ORDER > 0, got ${r}`);let{nBitLength:i,nByteLength:o}=$e(r,e);if(o>2048)throw new Error("Field lengths over 2048 bytes are not supported");let a=Ar(r),s=Object.freeze({ORDER:r,BITS:i,BYTES:o,MASK:Ae(i),ZERO:O,ONE:L,create:c=>H(c,r),isValid:c=>{if(typeof c!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof c}`);return O<=c&&cc===O,isOdd:c=>(c&L)===L,neg:c=>H(-c,r),eql:(c,u)=>c===u,sqr:c=>H(c*c,r),add:(c,u)=>H(c+u,r),sub:(c,u)=>H(c-u,r),mul:(c,u)=>H(c*u,r),pow:(c,u)=>Ir(s,c,u),div:(c,u)=>H(c*Me(u,r),r),sqrN:c=>c*c,addN:(c,u)=>c+u,subN:(c,u)=>c-u,mulN:(c,u)=>c*u,inv:c=>Me(c,r),sqrt:n.sqrt||(c=>a(s,c)),invertBatch:c=>Pr(s,c),cmov:(c,u,b)=>b?u:c,toBytes:c=>t?st(c,o):X(c,o),fromBytes:c=>{if(c.length!==o)throw new Error(`Fp.fromBytes: expected ${o}, got ${c.length}`);return t?Ve(c):$(c)}});return Object.freeze(s)}function Ot(r,e,t=!1){r=N("privateHash",r);let n=r.length,i=$e(e).nByteLength+8;if(i<24||n1024)throw new Error(`hashToPrivateScalar: expected ${i}-1024 bytes of input, got ${n}`);let o=t?Ve(r):$(r);return H(o,e-L)+L}var kr=BigInt(0),lt=BigInt(1);function Tt(r,e){let t=(i,o)=>{let a=o.negate();return i?a:o},n=i=>{let o=Math.ceil(e/i)+1,a=2**(i-1);return{windows:o,windowSize:a}};return{constTimeNegate:t,unsafeLadder(i,o){let a=r.ZERO,s=i;for(;o>kr;)o<&&(a=a.add(s)),s=s.double(),o>>=lt;return a},precomputeWindow(i,o){let{windows:a,windowSize:s}=n(o),c=[],u=i,b=u;for(let l=0;l>=_,h>c&&(h-=m,a+=lt);let p=f,x=f+Math.abs(h)-1,v=g%2!==0,I=h<0;h===0?b=b.add(t(v,o[p])):u=u.add(t(I,o[x]))}return{p:u,f:b}},wNAFCached(i,o,a,s){let c=i._WINDOW_SIZE||1,u=o.get(i);return u||(u=this.precomputeWindow(i,c),c!==1&&o.set(i,s(u))),this.wNAF(c,u,a)}}}function dt(r){return ft(r.Fp),Q(r,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...$e(r.n,r.nBitLength),...r,p:r.Fp.ORDER})}function Ur(r){let e=dt(r);Q(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});let{endo:t,Fp:n,a:i}=e;if(t){if(!n.eql(i,n.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof t!="object"||typeof t.beta!="bigint"||typeof t.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...e})}var{bytesToNumberBE:Lr,hexToBytes:Or}=at,le={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(r){let{Err:e}=le;if(r.length<2||r[0]!==2)throw new e("Invalid signature integer tag");let t=r[1],n=r.subarray(2,t+2);if(!t||n.length!==t)throw new e("Invalid signature integer: wrong length");if(n[0]&128)throw new e("Invalid signature integer: negative");if(n[0]===0&&!(n[1]&128))throw new e("Invalid signature integer: unnecessary leading zero");return{d:Lr(n),l:r.subarray(t+2)}},toSig(r){let{Err:e}=le,t=typeof r=="string"?Or(r):r;if(!(t instanceof Uint8Array))throw new Error("ui8a expected");let n=t.length;if(n<2||t[0]!=48)throw new e("Invalid signature tag");if(t[1]!==n-2)throw new e("Invalid signature: incorrect length");let{d:i,l:o}=le._parseInt(t.subarray(2)),{d:a,l:s}=le._parseInt(o);if(s.length)throw new e("Invalid signature: left bytes after parsing");return{r:i,s:a}},hexFromSig(r){let e=u=>Number.parseInt(u[0],16)&8?"00"+u:u,t=u=>{let b=u.toString(16);return b.length&1?`0${b}`:b},n=e(t(r.s)),i=e(t(r.r)),o=n.length/2,a=i.length/2,s=t(o),c=t(a);return`30${t(a+o+4)}02${c}${i}02${s}${n}`}},J=BigInt(0),V=BigInt(1),kn=BigInt(2),Ht=BigInt(3),Un=BigInt(4);function Tr(r){let e=Ur(r),{Fp:t}=e,n=e.toBytes||((g,f,h)=>{let p=f.toAffine();return oe(Uint8Array.from([4]),t.toBytes(p.x),t.toBytes(p.y))}),i=e.fromBytes||(g=>{let f=g.subarray(1),h=t.fromBytes(f.subarray(0,t.BYTES)),p=t.fromBytes(f.subarray(t.BYTES,2*t.BYTES));return{x:h,y:p}});function o(g){let{a:f,b:h}=e,p=t.sqr(g),x=t.mul(p,g);return t.add(t.add(x,t.mul(g,f)),h)}if(!t.eql(t.sqr(e.Gy),o(e.Gx)))throw new Error("bad generator point: equation left != right");function a(g){return typeof g=="bigint"&&Jt.eql(v,t.ZERO);return x(h)&&x(p)?l.ZERO:new l(h,p,t.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(f){let h=t.invertBatch(f.map(p=>p.pz));return f.map((p,x)=>p.toAffine(h[x])).map(l.fromAffine)}static fromHex(f){let h=l.fromAffine(i(N("pointHex",f)));return h.assertValidity(),h}static fromPrivateKey(f){return l.BASE.multiply(c(f))}_setWindowSize(f){this._WINDOW_SIZE=f,u.delete(this)}assertValidity(){if(this.is0()){if(e.allowInfinityPoint)return;throw new Error("bad point: ZERO")}let{x:f,y:h}=this.toAffine();if(!t.isValid(f)||!t.isValid(h))throw new Error("bad point: x or y not FE");let p=t.sqr(h),x=o(f);if(!t.eql(p,x))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){let{y:f}=this.toAffine();if(t.isOdd)return!t.isOdd(f);throw new Error("Field doesn't support isOdd")}equals(f){b(f);let{px:h,py:p,pz:x}=this,{px:v,py:I,pz:A}=f,w=t.eql(t.mul(h,A),t.mul(v,x)),E=t.eql(t.mul(p,A),t.mul(I,x));return w&&E}negate(){return new l(this.px,t.neg(this.py),this.pz)}double(){let{a:f,b:h}=e,p=t.mul(h,Ht),{px:x,py:v,pz:I}=this,A=t.ZERO,w=t.ZERO,E=t.ZERO,S=t.mul(x,x),j=t.mul(v,v),U=t.mul(I,I),P=t.mul(x,v);return P=t.add(P,P),E=t.mul(x,I),E=t.add(E,E),A=t.mul(f,E),w=t.mul(p,U),w=t.add(A,w),A=t.sub(j,w),w=t.add(j,w),w=t.mul(A,w),A=t.mul(P,A),E=t.mul(p,E),U=t.mul(f,U),P=t.sub(S,U),P=t.mul(f,P),P=t.add(P,E),E=t.add(S,S),S=t.add(E,S),S=t.add(S,U),S=t.mul(S,P),w=t.add(w,S),U=t.mul(v,I),U=t.add(U,U),S=t.mul(U,P),A=t.sub(A,S),E=t.mul(U,j),E=t.add(E,E),E=t.add(E,E),new l(A,w,E)}add(f){b(f);let{px:h,py:p,pz:x}=this,{px:v,py:I,pz:A}=f,w=t.ZERO,E=t.ZERO,S=t.ZERO,j=e.a,U=t.mul(e.b,Ht),P=t.mul(h,v),q=t.mul(p,I),R=t.mul(x,A),F=t.add(h,p),d=t.add(v,I);F=t.mul(F,d),d=t.add(P,q),F=t.sub(F,d),d=t.add(h,x);let y=t.add(v,A);return d=t.mul(d,y),y=t.add(P,R),d=t.sub(d,y),y=t.add(p,x),w=t.add(I,A),y=t.mul(y,w),w=t.add(q,R),y=t.sub(y,w),S=t.mul(j,d),w=t.mul(U,R),S=t.add(w,S),w=t.sub(q,S),S=t.add(q,S),E=t.mul(w,S),q=t.add(P,P),q=t.add(q,P),R=t.mul(j,R),d=t.mul(U,d),q=t.add(q,R),R=t.sub(P,R),R=t.mul(j,R),d=t.add(d,R),P=t.mul(q,d),E=t.add(E,P),P=t.mul(y,d),w=t.mul(F,w),w=t.sub(w,P),P=t.mul(F,q),S=t.mul(y,S),S=t.add(S,P),new l(w,E,S)}subtract(f){return this.add(f.negate())}is0(){return this.equals(l.ZERO)}wNAF(f){return _.wNAFCached(this,u,f,h=>{let p=t.invertBatch(h.map(x=>x.pz));return h.map((x,v)=>x.toAffine(p[v])).map(l.fromAffine)})}multiplyUnsafe(f){let h=l.ZERO;if(f===J)return h;if(s(f),f===V)return this;let{endo:p}=e;if(!p)return _.unsafeLadder(this,f);let{k1neg:x,k1:v,k2neg:I,k2:A}=p.splitScalar(f),w=h,E=h,S=this;for(;v>J||A>J;)v&V&&(w=w.add(S)),A&V&&(E=E.add(S)),S=S.double(),v>>=V,A>>=V;return x&&(w=w.negate()),I&&(E=E.negate()),E=new l(t.mul(E.px,p.beta),E.py,E.pz),w.add(E)}multiply(f){s(f);let h=f,p,x,{endo:v}=e;if(v){let{k1neg:I,k1:A,k2neg:w,k2:E}=v.splitScalar(h),{p:S,f:j}=this.wNAF(A),{p:U,f:P}=this.wNAF(E);S=_.constTimeNegate(I,S),U=_.constTimeNegate(w,U),U=new l(t.mul(U.px,v.beta),U.py,U.pz),p=S.add(U),x=j.add(P)}else{let{p:I,f:A}=this.wNAF(h);p=I,x=A}return l.normalizeZ([p,x])[0]}multiplyAndAddUnsafe(f,h,p){let x=l.BASE,v=(A,w)=>w===J||w===V||!A.equals(x)?A.multiplyUnsafe(w):A.multiply(w),I=v(this,h).add(v(f,p));return I.is0()?void 0:I}toAffine(f){let{px:h,py:p,pz:x}=this,v=this.is0();f==null&&(f=v?t.ONE:t.inv(x));let I=t.mul(h,f),A=t.mul(p,f),w=t.mul(x,f);if(v)return{x:t.ZERO,y:t.ZERO};if(!t.eql(w,t.ONE))throw new Error("invZ was invalid");return{x:I,y:A}}isTorsionFree(){let{h:f,isTorsionFree:h}=e;if(f===V)return!0;if(h)return h(l,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){let{h:f,clearCofactor:h}=e;return f===V?this:h?h(l,this):this.multiplyUnsafe(e.h)}toRawBytes(f=!0){return this.assertValidity(),n(l,this,f)}toHex(f=!0){return ae(this.toRawBytes(f))}}l.BASE=new l(e.Gx,e.Gy,t.ONE),l.ZERO=new l(t.ZERO,t.ONE,t.ZERO);let m=e.nBitLength,_=Tt(l,e.endo?Math.ceil(m/2):m);return{CURVE:e,ProjectivePoint:l,normPrivateKeyToScalar:c,weierstrassEquation:o,isWithinCurveOrder:a}}function Hr(r){let e=dt(r);return Q(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function Nt(r){let e=Hr(r),{Fp:t,n}=e,i=t.BYTES+1,o=2*t.BYTES+1;function a(d){return Jae(X(d,e.nByteLength));function g(d){let y=n>>V;return d>y}function f(d){return g(d)?s(-d):d}let h=(d,y,B)=>$(d.slice(y,B));class p{constructor(y,B,k){this.r=y,this.s=B,this.recovery=k,this.assertValidity()}static fromCompact(y){let B=e.nByteLength;return y=N("compactSignature",y,B*2),new p(h(y,0,B),h(y,B,2*B))}static fromDER(y){let{r:B,s:k}=le.toSig(N("DER",y));return new p(B,k)}assertValidity(){if(!m(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!m(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(y){return new p(this.r,this.s,y)}recoverPublicKey(y){let{r:B,s:k,recovery:K}=this,T=E(N("msgHash",y));if(K==null||![0,1,2,3].includes(K))throw new Error("recovery id invalid");let z=K===2||K===3?B+e.n:B;if(z>=t.ORDER)throw new Error("recovery id 2 or 3 invalid");let C=K&1?"03":"02",ee=u.fromHex(C+_(z)),te=c(z),he=s(-T*te),Ee=s(k*te),re=u.BASE.multiplyAndAddUnsafe(ee,he,Ee);if(!re)throw new Error("point at infinify");return re.assertValidity(),re}hasHighS(){return g(this.s)}normalizeS(){return this.hasHighS()?new p(this.r,s(-this.s),this.recovery):this}toDERRawBytes(){return ue(this.toDERHex())}toDERHex(){return le.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return ue(this.toCompactHex())}toCompactHex(){return _(this.r)+_(this.s)}}let x={isValidPrivateKey(d){try{return b(d),!0}catch{return!1}},normPrivateKeyToScalar:b,randomPrivateKey:()=>{let d=e.randomBytes(t.BYTES+8),y=Ot(d,n);return X(y,e.nByteLength)},precompute(d=8,y=u.BASE){return y._setWindowSize(d),y.multiply(BigInt(3)),y}};function v(d,y=!0){return u.fromPrivateKey(d).toRawBytes(y)}function I(d){let y=d instanceof Uint8Array,B=typeof d=="string",k=(y||B)&&d.length;return y?k===i||k===o:B?k===2*i||k===2*o:d instanceof u}function A(d,y,B=!0){if(I(d))throw new Error("first arg must be private key");if(!I(y))throw new Error("second arg must be public key");return u.fromHex(y).multiply(b(d)).toRawBytes(B)}let w=e.bits2int||function(d){let y=$(d),B=d.length*8-e.nBitLength;return B>0?y>>BigInt(B):y},E=e.bits2int_modN||function(d){return s(w(d))},S=Ae(e.nBitLength);function j(d){if(typeof d!="bigint")throw new Error("bigint expected");if(!(J<=d&&dse in B))throw new Error("sign() legacy options not supported");let{hash:k,randomBytes:K}=e,{lowS:T,prehash:z,extraEntropy:C}=B;T==null&&(T=!0),d=N("msgHash",d),z&&(d=N("prehashed msgHash",k(d)));let ee=E(d),te=b(y),he=[j(te),j(ee)];if(C!=null){let se=C===!0?K(t.BYTES):C;he.push(N("extraEntropy",se,t.BYTES))}let Ee=oe(...he),re=ee;function We(se){let ye=w(se);if(!m(ye))return;let pt=c(ye),Z=u.BASE.multiply(ye).toAffine(),be=s(Z.x);if(be===J)return;let Ie=s(pt*s(re+be*te));if(Ie===J)return;let wt=(Z.x===be?0:2)|Number(Z.y&V),gt=Ie;return T&&g(Ie)&&(gt=f(Ie),wt^=1),new p(be,gt,wt)}return{seed:Ee,k2sig:We}}let P={lowS:e.lowS,prehash:!1},q={lowS:e.lowS,prehash:!1};function R(d,y,B=P){let{seed:k,k2sig:K}=U(d,y,B),T=e;return ct(T.hash.outputLen,T.nByteLength,T.hmac)(k,K)}u.BASE._setWindowSize(8);function F(d,y,B,k=q){let K=d;if(y=N("msgHash",y),B=N("publicKey",B),"strict"in k)throw new Error("options.strict was renamed to lowS");let{lowS:T,prehash:z}=k,C,ee;try{if(typeof K=="string"||K instanceof Uint8Array)try{C=p.fromDER(K)}catch(Z){if(!(Z instanceof le.Err))throw Z;C=p.fromCompact(K)}else if(typeof K=="object"&&typeof K.r=="bigint"&&typeof K.s=="bigint"){let{r:Z,s:be}=K;C=new p(Z,be)}else throw new Error("PARSE");ee=u.fromHex(B)}catch(Z){if(Z.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(T&&C.hasHighS())return!1;z&&(y=e.hash(y));let{r:te,s:he}=C,Ee=E(y),re=c(he),We=s(Ee*re),se=s(te*re),ye=u.BASE.multiplyAndAddUnsafe(ee,We,se)?.toAffine();return ye?s(ye.x)===te:!1}return{CURVE:e,getPublicKey:v,getSharedSecret:A,sign:R,verify:F,ProjectivePoint:u,Signature:p,utils:x}}function Nr(r){return{hash:r,hmac:(e,...t)=>Be(r,e,Et(...t)),randomBytes:et}}function qt(r,e){let t=n=>Nt({...r,...Nr(n)});return Object.freeze({...t(e),create:t})}var Ct=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),Rt=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),qr=BigInt(1),ht=BigInt(2),zt=(r,e)=>(r+e/ht)/e;function Rr(r){let e=Ct,t=BigInt(3),n=BigInt(6),i=BigInt(11),o=BigInt(22),a=BigInt(23),s=BigInt(44),c=BigInt(88),u=r*r*r%e,b=u*u*r%e,l=D(b,t,e)*b%e,m=D(l,t,e)*b%e,_=D(m,ht,e)*u%e,g=D(_,i,e)*_%e,f=D(g,o,e)*g%e,h=D(f,s,e)*f%e,p=D(h,c,e)*h%e,x=D(p,s,e)*f%e,v=D(x,t,e)*b%e,I=D(v,a,e)*g%e,A=D(I,n,e)*u%e,w=D(A,ht,e);if(!yt.eql(yt.sqr(w),r))throw new Error("Cannot find square root");return w}var yt=Lt(Ct,void 0,void 0,{sqrt:Rr}),_e=qt({a:BigInt(0),b:BigInt(7),Fp:yt,n:Rt,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:r=>{let e=Rt,t=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-qr*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),o=t,a=BigInt("0x100000000000000000000000000000000"),s=zt(o*r,e),c=zt(-n*r,e),u=H(r-s*t-c*i,e),b=H(-s*n-c*o,e),l=u>a,m=b>a;if(l&&(u=e-u),m&&(b=e-b),u>a||b>a)throw new Error("splitScalar: Endomorphism failed, k="+r);return{k1neg:l,k1:u,k2neg:m,k2:b}}}},Oe),Xn=BigInt(0);var Qn=_e.ProjectivePoint;var Ze=["deriveBits"],Dt=new Uint8Array([100,107,112,95,112,114,107]),jt=new Uint8Array([115,107]);var de=class{constructor(e,t,n,i=[]){Object.defineProperty(this,"key",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"type",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"extractable",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"algorithm",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"usages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.key=t,this.type=n,this.algorithm={name:e},this.usages=i,n==="public"&&(this.usages=[])}};var Ge="ECDH",Ye=class{constructor(e){Object.defineProperty(this,"_hkdf",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_nPk",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_nSk",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._hkdf=e,this._nPk=33,this._nSk=32}async serializePublicKey(e){try{return await this._serializePublicKey(e)}catch(t){throw new ge(t)}}async deserializePublicKey(e){try{return await this._importRawKey(e,!0)}catch(t){throw new ce(t)}}async serializePrivateKey(e){try{return await this._serializePrivateKey(e)}catch(t){throw new ge(t)}}async deserializePrivateKey(e){try{return await this._importRawKey(e,!1)}catch(t){throw new ce(t)}}async importKey(e,t,n){try{if(e!=="raw")throw new Error("Unsupported format");return await this._importRawKey(t,n)}catch(i){throw new ce(i)}}async generateKeyPair(){try{let e=_e.utils.randomPrivateKey(),t=new de(Ge,e,"private",Ze);return{publicKey:await this.derivePublicKey(t),privateKey:t}}catch(e){throw new me(e)}}async deriveKeyPair(e){try{let t=await this._hkdf.labeledExtract(W,Dt,new Uint8Array(e)),n=await this._hkdf.labeledExpand(t,jt,W,this._nSk),i=new de(Ge,new Uint8Array(n),"private",Ze);return{privateKey:i,publicKey:await this.derivePublicKey(i)}}catch(t){throw new Ne(t)}}async derivePublicKey(e){try{return await this._derivePublicKey(e)}catch(t){throw new ce(t)}}async dh(e,t){try{return await this._dh(e,t)}catch(n){throw new ge(n)}}_serializePublicKey(e){return new Promise(t=>{t(e.key.buffer)})}_serializePrivateKey(e){return new Promise(t=>{t(e.key.buffer)})}_importRawKey(e,t){return new Promise((n,i)=>{t&&e.byteLength!==this._nPk&&i(new Error("Invalid length of the key")),!t&&e.byteLength!==this._nSk&&i(new Error("Invalid length of the key")),n(new de(Ge,new Uint8Array(e),t?"public":"private",t?[]:Ze))})}_derivePublicKey(e){return new Promise((t,n)=>{try{let i=_e.getPublicKey(e.key);t(new de(Ge,i,"public"))}catch(i){n(i)}})}_dh(e,t){return new Promise((n,i)=>{try{n(_e.getSharedSecret(e.key,t.key).buffer)}catch(o){i(o)}})}};var bt=class extends Ce{constructor(){let e=new ze;super(Xe.DhkemSecp256k1HkdfSha256,new Ye(e),e),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:Xe.DhkemSecp256k1HkdfSha256}),Object.defineProperty(this,"secretSize",{enumerable:!0,configurable:!0,writable:!0,value:32}),Object.defineProperty(this,"encSize",{enumerable:!0,configurable:!0,writable:!0,value:33}),Object.defineProperty(this,"publicKeySize",{enumerable:!0,configurable:!0,writable:!0,value:33}),Object.defineProperty(this,"privateKeySize",{enumerable:!0,configurable:!0,writable:!0,value:32})}};export{bt as DhkemSecp256k1HkdfSha256}; +var sr=Object.defineProperty;var cr=(r,t)=>{for(var e in t)sr(r,e,{get:t[e],enumerable:!0})};var ar={NotAssigned:0,DhkemP256HkdfSha256:16,DhkemP384HkdfSha384:17,DhkemP521HkdfSha512:18,DhkemSecp256k1HkdfSha256:19,DhkemX25519HkdfSha256:32,DhkemX448HkdfSha512:33,HybridkemX25519Kyber768:48},ne=ar,fr={HkdfSha256:1,HkdfSha384:2,HkdfSha512:3},ie=fr;function Ue(r){if(!Number.isSafeInteger(r)||r<0)throw new Error(`Wrong positive integer: ${r}`)}function oe(r,...t){if(!(r instanceof Uint8Array))throw new Error("Expected Uint8Array");if(t.length>0&&!t.includes(r.length))throw new Error(`Expected Uint8Array of length ${t}, not of length=${r.length}`)}function Pe(r){if(typeof r!="function"||typeof r.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Ue(r.outputLen),Ue(r.blockLen)}function xt(r,t=!0){if(r.destroyed)throw new Error("Hash instance has been destroyed");if(t&&r.finished)throw new Error("Hash#digest() has already been called")}function Ke(r,t){oe(r);let e=t.outputLen;if(r.lengthr instanceof Uint8Array;var Ot=r=>new DataView(r.buffer,r.byteOffset,r.byteLength),$=(r,t)=>r<<32-t|r>>>t,lr=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!lr)throw new Error("Non little-endian hardware is not supported");function hr(r){if(typeof r!="string")throw new Error(`utf8ToBytes expected string, got ${typeof r}`);return new Uint8Array(new TextEncoder().encode(r))}function It(r){if(typeof r=="string"&&(r=hr(r)),!ur(r))throw new Error(`expected Uint8Array, got ${typeof r}`);return r}var mt=class{clone(){return this._cloneInto()}},dn={}.toString;function Oe(r){let t=n=>r().update(It(n)).digest(),e=r();return t.outputLen=e.outputLen,t.blockLen=e.blockLen,t.create=()=>r(),t}var Ht=class extends mt{constructor(t,e){super(),this.finished=!1,this.destroyed=!1,Pe(t);let n=It(e);if(this.iHash=t.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let i=this.blockLen,o=new Uint8Array(i);o.set(n.length>i?t.create().update(n).digest():n);for(let c=0;cnew Ht(r,t).update(e).digest();se.create=(r,t)=>new Ht(r,t);function dr(r,t,e,n){if(typeof r.setBigUint64=="function")return r.setBigUint64(t,e,n);let i=BigInt(32),o=BigInt(4294967295),c=Number(e>>i&o),s=Number(e&o),a=n?4:0,f=n?0:4;r.setUint32(t+a,c,n),r.setUint32(t+f,s,n)}var Tt=class extends mt{constructor(t,e,n,i){super(),this.blockLen=t,this.outputLen=e,this.padOffset=n,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=Ot(this.buffer)}update(t){xt(this);let{view:e,buffer:n,blockLen:i}=this;t=It(t);let o=t.length;for(let c=0;ci-c&&(this.process(n,0),c=0);for(let u=c;ud.length)throw new Error("_sha2: outputLen bigger than state");for(let u=0;ur&t^~r&e,yr=(r,t,e)=>r&t^r&e^t&e,br=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),it=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),ot=new Uint32Array(64),ce=class extends Tt{constructor(){super(64,32,8,!1),this.A=it[0]|0,this.B=it[1]|0,this.C=it[2]|0,this.D=it[3]|0,this.E=it[4]|0,this.F=it[5]|0,this.G=it[6]|0,this.H=it[7]|0}get(){let{A:t,B:e,C:n,D:i,E:o,F:c,G:s,H:a}=this;return[t,e,n,i,o,c,s,a]}set(t,e,n,i,o,c,s,a){this.A=t|0,this.B=e|0,this.C=n|0,this.D=i|0,this.E=o|0,this.F=c|0,this.G=s|0,this.H=a|0}process(t,e){for(let u=0;u<16;u++,e+=4)ot[u]=t.getUint32(e,!1);for(let u=16;u<64;u++){let w=ot[u-15],B=ot[u-2],g=$(w,7)^$(w,18)^w>>>3,l=$(B,17)^$(B,19)^B>>>10;ot[u]=l+ot[u-7]+g+ot[u-16]|0}let{A:n,B:i,C:o,D:c,E:s,F:a,G:f,H:d}=this;for(let u=0;u<64;u++){let w=$(s,6)^$(s,11)^$(s,25),B=d+w+pr(s,a,f)+br[u]+ot[u]|0,l=($(n,2)^$(n,13)^$(n,22))+yr(n,i,o)|0;d=f,f=a,a=s,s=c+B|0,c=o,o=i,i=n,n=B+l|0}n=n+this.A|0,i=i+this.B|0,o=o+this.C|0,c=c+this.D|0,s=s+this.E|0,a=a+this.F|0,f=f+this.G|0,d=d+this.H|0,this.set(n,i,o,c,s,a,f,d)}roundClean(){ot.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}};var He=Oe(()=>new ce);var wr={},Te=gr(globalThis,wr);function gr(r,t){return new Proxy(r,{get(e,n,i){return n in t?t[n]:r[n]},set(e,n,i){return n in t&&delete t[n],r[n]=i,!0},deleteProperty(e,n){let i=!1;return n in t&&(delete t[n],i=!0),n in r&&(delete r[n],i=!0),i},ownKeys(e){let n=Reflect.ownKeys(r),i=Reflect.ownKeys(t),o=new Set(i);return[...n.filter(c=>!o.has(c)),...i]},defineProperty(e,n,i){return n in t&&delete t[n],Reflect.defineProperty(r,n,i),!0},getOwnPropertyDescriptor(e,n){return n in t?Reflect.getOwnPropertyDescriptor(t,n):Reflect.getOwnPropertyDescriptor(r,n)},has(e,n){return n in t||n in r}})}var ae=class extends Error{constructor(t){let e;t instanceof Error?e=t.message:typeof t=="string"?e=t:e="",super(e),this.name=this.constructor.name}},Y=class extends ae{},Et=class extends Y{};var vt=class extends Y{},ut=class extends Y{},Nt=class extends Y{},qt=class extends Y{};var Rt=class extends Y{},Bt=class extends Y{};async function mr(){if(Te!==void 0&&globalThis.crypto!==void 0)return globalThis.crypto.subtle;try{let{webcrypto:r}=await import("crypto");return r.subtle}catch(r){throw new Bt(r)}}var Ct=class{constructor(){Object.defineProperty(this,"_api",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}async _setup(){this._api===void 0&&(this._api=await mr())}};var W=new Uint8Array(0);var Ne=new Uint8Array([72,80,75,69,45,118,49]),fe=class extends Ct{constructor(){super(),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:ie.HkdfSha256}),Object.defineProperty(this,"hashSize",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_suiteId",{enumerable:!0,configurable:!0,writable:!0,value:W}),Object.defineProperty(this,"algHash",{enumerable:!0,configurable:!0,writable:!0,value:{name:"HMAC",hash:"SHA-256",length:256}})}init(t){this._suiteId=t}buildLabeledIkm(t,e){this._checkInit();let n=new Uint8Array(7+this._suiteId.byteLength+t.byteLength+e.byteLength);return n.set(Ne,0),n.set(this._suiteId,7),n.set(t,7+this._suiteId.byteLength),n.set(e,7+this._suiteId.byteLength+t.byteLength),n}buildLabeledInfo(t,e,n){this._checkInit();let i=new Uint8Array(9+this._suiteId.byteLength+t.byteLength+e.byteLength);return i.set(new Uint8Array([0,n]),0),i.set(Ne,2),i.set(this._suiteId,9),i.set(t,9+this._suiteId.byteLength),i.set(e,9+this._suiteId.byteLength+t.byteLength),i}async extract(t,e){if(await this._setup(),t.byteLength===0&&(t=new ArrayBuffer(this.hashSize)),t.byteLength!==this.hashSize)throw new Et("The salt length must be the same as the hashSize");let n=await this._api.importKey("raw",t,this.algHash,!1,["sign"]);return await this._api.sign("HMAC",n,e)}async expand(t,e,n){await this._setup();let i=await this._api.importKey("raw",t,this.algHash,!1,["sign"]),o=new ArrayBuffer(n),c=new Uint8Array(o),s=W,a=new Uint8Array(e),f=new Uint8Array(1);if(n>255*this.hashSize)throw new Error("Entropy limit reached");let d=new Uint8Array(this.hashSize+a.length+1);for(let u=1,w=0;w=s.length?(c.set(s,w),w+=s.length):(c.set(s.slice(0,c.length-w),w),w+=c.length-w);return o}async extractAndExpand(t,e,n,i){await this._setup();let o=await this._api.importKey("raw",e,"HKDF",!1,["deriveBits"]);return await this._api.deriveBits({name:"HKDF",hash:this.algHash.hash,salt:t,info:n},o,i*8)}async labeledExtract(t,e,n){return await this.extract(t,this.buildLabeledIkm(e,n))}async labeledExpand(t,e,n,i){return await this.expand(t,this.buildLabeledInfo(e,n,i),i)}_checkInit(){if(this._suiteId===W)throw new Error("Not initialized. Call init()")}},zt=class extends fe{constructor(){super(...arguments),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:ie.HkdfSha256}),Object.defineProperty(this,"hashSize",{enumerable:!0,configurable:!0,writable:!0,value:32}),Object.defineProperty(this,"algHash",{enumerable:!0,configurable:!0,writable:!0,value:{name:"HMAC",hash:"SHA-256",length:256}})}};var Dt=class extends zt{async extract(t,e){if(await this._setup(),t.byteLength===0&&(t=new ArrayBuffer(this.hashSize)),t.byteLength!==this.hashSize)return se(He,new Uint8Array(t),new Uint8Array(e));let n=await this._api.importKey("raw",t,this.algHash,!1,["sign"]);return await this._api.sign("HMAC",n,e)}};var qe=new Uint8Array([75,69,77,0,0]);var At=r=>typeof r=="object"&&r!==null&&typeof r.privateKey=="object"&&typeof r.publicKey=="object";function Re(r,t){if(t<=0)throw new Error("i2Osp: too small size");if(r>=256**t)throw new Error("i2Osp: too large integer");let e=new Uint8Array(t);for(let n=0;n>8;return e}function Lt(r,t){let e=new Uint8Array(r.length+t.length);return e.set(r,0),e.set(t,r.length),e}var vr=new Uint8Array([101,97,101,95,112,114,107]),Br=new Uint8Array([115,104,97,114,101,100,95,115,101,99,114,101,116]);function Ar(r,t,e){let n=new Uint8Array(r.length+t.length+e.length);return n.set(r,0),n.set(t,r.length),n.set(e,r.length+t.length),n}var jt=class{constructor(t,e,n){Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"secretSize",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"encSize",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"publicKeySize",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"privateKeySize",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_prim",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_kdf",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.id=t,this._prim=e,this._kdf=n;let i=new Uint8Array(qe);i.set(Re(this.id,2),3),this._kdf.init(i)}async serializePublicKey(t){return await this._prim.serializePublicKey(t)}async deserializePublicKey(t){return await this._prim.deserializePublicKey(t)}async serializePrivateKey(t){return await this._prim.serializePrivateKey(t)}async deserializePrivateKey(t){return await this._prim.deserializePrivateKey(t)}async importKey(t,e,n=!0){return await this._prim.importKey(t,e,n)}async generateKeyPair(){return await this._prim.generateKeyPair()}async deriveKeyPair(t){if(t.byteLength>8192)throw new Et("Too long ikm");return await this._prim.deriveKeyPair(t)}async encap(t){let e;t.ekm===void 0?e=await this.generateKeyPair():At(t.ekm)?e=t.ekm:e=await this.deriveKeyPair(t.ekm);let n=await this._prim.serializePublicKey(e.publicKey),i=await this._prim.serializePublicKey(t.recipientPublicKey);try{let o;if(t.senderKey===void 0)o=new Uint8Array(await this._prim.dh(e.privateKey,t.recipientPublicKey));else{let a=At(t.senderKey)?t.senderKey.privateKey:t.senderKey,f=new Uint8Array(await this._prim.dh(e.privateKey,t.recipientPublicKey)),d=new Uint8Array(await this._prim.dh(a,t.recipientPublicKey));o=Lt(f,d)}let c;if(t.senderKey===void 0)c=Lt(new Uint8Array(n),new Uint8Array(i));else{let a=At(t.senderKey)?t.senderKey.publicKey:await this._prim.derivePublicKey(t.senderKey),f=await this._prim.serializePublicKey(a);c=Ar(new Uint8Array(n),new Uint8Array(i),new Uint8Array(f))}let s=await this._generateSharedSecret(o,c);return{enc:n,sharedSecret:s}}catch(o){throw new Nt(o)}}async decap(t){let e=await this._prim.deserializePublicKey(t.enc),n=At(t.recipientKey)?t.recipientKey.privateKey:t.recipientKey,i=At(t.recipientKey)?t.recipientKey.publicKey:await this._prim.derivePublicKey(t.recipientKey),o=await this._prim.serializePublicKey(i);try{let c;if(t.senderPublicKey===void 0)c=new Uint8Array(await this._prim.dh(n,e));else{let a=new Uint8Array(await this._prim.dh(n,e)),f=new Uint8Array(await this._prim.dh(n,t.senderPublicKey));c=Lt(a,f)}let s;if(t.senderPublicKey===void 0)s=Lt(new Uint8Array(t.enc),new Uint8Array(o));else{let a=await this._prim.serializePublicKey(t.senderPublicKey);s=new Uint8Array(t.enc.byteLength+o.byteLength+a.byteLength),s.set(new Uint8Array(t.enc),0),s.set(new Uint8Array(o),t.enc.byteLength),s.set(new Uint8Array(a),t.enc.byteLength+o.byteLength)}return await this._generateSharedSecret(c,s)}catch(c){throw new qt(c)}}async _generateSharedSecret(t,e){let n=this._kdf.buildLabeledIkm(vr,t),i=this._kdf.buildLabeledInfo(Br,e,this.secretSize);return await this._kdf.extractAndExpand(W,n,i,this.secretSize)}};function ue(r){if(!Number.isSafeInteger(r)||r<0)throw new Error(`Wrong positive integer: ${r}`)}function _r(r){if(typeof r!="boolean")throw new Error(`Expected boolean, not ${r}`)}function Ce(r,...t){if(!(r instanceof Uint8Array))throw new Error("Expected Uint8Array");if(t.length>0&&!t.includes(r.length))throw new Error(`Expected Uint8Array of length ${t}, not of length=${r.length}`)}function Sr(r){if(typeof r!="function"||typeof r.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");ue(r.outputLen),ue(r.blockLen)}function Ir(r,t=!0){if(r.destroyed)throw new Error("Hash instance has been destroyed");if(t&&r.finished)throw new Error("Hash#digest() has already been called")}function Lr(r,t){Ce(r);let e=t.outputLen;if(r.lengthr instanceof Uint8Array;var $t=r=>new DataView(r.buffer,r.byteOffset,r.byteLength),M=(r,t)=>r<<32-t|r>>>t,Ur=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!Ur)throw new Error("Non little-endian hardware is not supported");var Gn=Array.from({length:256},(r,t)=>t.toString(16).padStart(2,"0"));function Pr(r){if(typeof r!="string")throw new Error(`utf8ToBytes expected string, got ${typeof r}`);return new Uint8Array(new TextEncoder().encode(r))}function kt(r){if(typeof r=="string"&&(r=Pr(r)),!ze(r))throw new Error(`expected Uint8Array, got ${typeof r}`);return r}function De(...r){let t=new Uint8Array(r.reduce((n,i)=>n+i.length,0)),e=0;return r.forEach(n=>{if(!ze(n))throw new Error("Uint8Array expected");t.set(n,e),e+=n.length}),t}var _t=class{clone(){return this._cloneInto()}};function le(r){let t=n=>r().update(kt(n)).digest(),e=r();return t.outputLen=e.outputLen,t.blockLen=e.blockLen,t.create=()=>r(),t}function he(r=32){if(Vt&&typeof Vt.getRandomValues=="function")return Vt.getRandomValues(new Uint8Array(r));throw new Error("crypto.getRandomValues must be defined")}function Kr(r,t,e,n){if(typeof r.setBigUint64=="function")return r.setBigUint64(t,e,n);let i=BigInt(32),o=BigInt(4294967295),c=Number(e>>i&o),s=Number(e&o),a=n?4:0,f=n?0:4;r.setUint32(t+a,c,n),r.setUint32(t+f,s,n)}var Mt=class extends _t{constructor(t,e,n,i){super(),this.blockLen=t,this.outputLen=e,this.padOffset=n,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=$t(this.buffer)}update(t){X.exists(this);let{view:e,buffer:n,blockLen:i}=this;t=kt(t);let o=t.length;for(let c=0;ci-c&&(this.process(n,0),c=0);for(let u=c;ud.length)throw new Error("_sha2: outputLen bigger than state");for(let u=0;ur&t^~r&e,Hr=(r,t,e)=>r&t^r&e^t&e,Tr=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),st=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),ct=new Uint32Array(64),Zt=class extends Mt{constructor(){super(64,32,8,!1),this.A=st[0]|0,this.B=st[1]|0,this.C=st[2]|0,this.D=st[3]|0,this.E=st[4]|0,this.F=st[5]|0,this.G=st[6]|0,this.H=st[7]|0}get(){let{A:t,B:e,C:n,D:i,E:o,F:c,G:s,H:a}=this;return[t,e,n,i,o,c,s,a]}set(t,e,n,i,o,c,s,a){this.A=t|0,this.B=e|0,this.C=n|0,this.D=i|0,this.E=o|0,this.F=c|0,this.G=s|0,this.H=a|0}process(t,e){for(let u=0;u<16;u++,e+=4)ct[u]=t.getUint32(e,!1);for(let u=16;u<64;u++){let w=ct[u-15],B=ct[u-2],g=M(w,7)^M(w,18)^w>>>3,l=M(B,17)^M(B,19)^B>>>10;ct[u]=l+ct[u-7]+g+ct[u-16]|0}let{A:n,B:i,C:o,D:c,E:s,F:a,G:f,H:d}=this;for(let u=0;u<64;u++){let w=M(s,6)^M(s,11)^M(s,25),B=d+w+Or(s,a,f)+Tr[u]+ct[u]|0,l=(M(n,2)^M(n,13)^M(n,22))+Hr(n,i,o)|0;d=f,f=a,a=s,s=c+B|0,c=o,o=i,i=n,n=B+l|0}n=n+this.A|0,i=i+this.B|0,o=o+this.C|0,c=c+this.D|0,s=s+this.E|0,a=a+this.F|0,f=f+this.G|0,d=d+this.H|0,this.set(n,i,o,c,s,a,f,d)}roundClean(){ct.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}},de=class extends Zt{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}},je=le(()=>new Zt),ti=le(()=>new de);var ge={};cr(ge,{bitGet:()=>Dr,bitLen:()=>zr,bitMask:()=>Ut,bitSet:()=>jr,bytesToHex:()=>lt,bytesToNumberBE:()=>Z,bytesToNumberLE:()=>Wt,concatBytes:()=>at,createHmacDrbg:()=>we,ensureBytes:()=>N,equalBytes:()=>Cr,hexToBytes:()=>ht,hexToNumber:()=>ye,numberToBytesBE:()=>Q,numberToBytesLE:()=>be,numberToHexUnpadded:()=>Me,numberToVarBytesBE:()=>Rr,utf8ToBytes:()=>Ze,validateObject:()=>J});var $e=BigInt(0),Gt=BigInt(1),Nr=BigInt(2),Yt=r=>r instanceof Uint8Array,qr=Array.from({length:256},(r,t)=>t.toString(16).padStart(2,"0"));function lt(r){if(!Yt(r))throw new Error("Uint8Array expected");let t="";for(let e=0;en+i.length,0)),e=0;return r.forEach(n=>{if(!Yt(n))throw new Error("Uint8Array expected");t.set(n,e),e+=n.length}),t}function Cr(r,t){if(r.length!==t.length)return!1;for(let e=0;e$e;r>>=Gt,t+=1);return t}function Dr(r,t){return r>>BigInt(t)&Gt}var jr=(r,t,e)=>r|(e?Gt:$e)<(Nr<new Uint8Array(r),Ve=r=>Uint8Array.from(r);function we(r,t,e){if(typeof r!="number"||r<2)throw new Error("hashLen must be a number");if(typeof t!="number"||t<2)throw new Error("qByteLen must be a number");if(typeof e!="function")throw new Error("hmacFn must be a function");let n=pe(r),i=pe(r),o=0,c=()=>{n.fill(1),i.fill(0),o=0},s=(...u)=>e(i,n,...u),a=(u=pe())=>{i=s(Ve([0]),u),n=s(),u.length!==0&&(i=s(Ve([1]),u),n=s())},f=()=>{if(o++>=1e3)throw new Error("drbg: tried 1000 values");let u=0,w=[];for(;u{c(),a(u);let B;for(;!(B=w(f()));)a();return c(),B}}var Vr={bigint:r=>typeof r=="bigint",function:r=>typeof r=="function",boolean:r=>typeof r=="boolean",string:r=>typeof r=="string",isSafeInteger:r=>Number.isSafeInteger(r),array:r=>Array.isArray(r),field:(r,t)=>t.Fp.isValid(r),hash:r=>typeof r=="function"&&Number.isSafeInteger(r.outputLen)};function J(r,t,e={}){let n=(i,o,c)=>{let s=Vr[o];if(typeof s!="function")throw new Error(`Invalid validator "${o}", expected function`);let a=r[i];if(!(c&&a===void 0)&&!s(a,r))throw new Error(`Invalid param ${String(i)}=${a} (${typeof a}), expected ${o}`)};for(let[i,o]of Object.entries(t))n(i,o,!1);for(let[i,o]of Object.entries(e))n(i,o,!0);return r}var O=BigInt(0),K=BigInt(1),dt=BigInt(2),$r=BigInt(3),xe=BigInt(4),Ge=BigInt(5),Ye=BigInt(8),Mr=BigInt(9),Zr=BigInt(16);function T(r,t){let e=r%t;return e>=O?e:t+e}function Gr(r,t,e){if(e<=O||t 0");if(e===K)return O;let n=K;for(;t>O;)t&K&&(n=n*r%e),r=r*r%e,t>>=K;return n}function D(r,t,e){let n=r;for(;t-- >O;)n*=n,n%=e;return n}function Xt(r,t){if(r===O||t<=O)throw new Error(`invert: expected positive integers, got n=${r} mod=${t}`);let e=T(r,t),n=t,i=O,o=K,c=K,s=O;for(;e!==O;){let f=n/e,d=n%e,u=i-c*f,w=o-s*f;n=e,e=d,i=c,o=s,c=u,s=w}if(n!==K)throw new Error("invert: does not exist");return T(i,t)}function Yr(r){let t=(r-K)/dt,e,n,i;for(e=r-K,n=0;e%dt===O;e/=dt,n++);for(i=dt;i(n[i]="function",n),t);return J(r,e)}function Qr(r,t,e){if(e 0");if(e===O)return r.ONE;if(e===K)return t;let n=r.ONE,i=t;for(;e>O;)e&K&&(n=r.mul(n,i)),i=r.sqr(i),e>>=K;return n}function Jr(r,t){let e=new Array(t.length),n=t.reduce((o,c,s)=>r.is0(c)?o:(e[s]=o,r.mul(o,c)),r.ONE),i=r.inv(n);return t.reduceRight((o,c,s)=>r.is0(c)?o:(e[s]=r.mul(o,e[s]),r.mul(o,c)),i),e}function Qt(r,t){let e=t!==void 0?t:r.toString(2).length,n=Math.ceil(e/8);return{nBitLength:e,nByteLength:n}}function We(r,t,e=!1,n={}){if(r<=O)throw new Error(`Expected Fp ORDER > 0, got ${r}`);let{nBitLength:i,nByteLength:o}=Qt(r,t);if(o>2048)throw new Error("Field lengths over 2048 bytes are not supported");let c=Wr(r),s=Object.freeze({ORDER:r,BITS:i,BYTES:o,MASK:Ut(i),ZERO:O,ONE:K,create:a=>T(a,r),isValid:a=>{if(typeof a!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof a}`);return O<=a&&aa===O,isOdd:a=>(a&K)===K,neg:a=>T(-a,r),eql:(a,f)=>a===f,sqr:a=>T(a*a,r),add:(a,f)=>T(a+f,r),sub:(a,f)=>T(a-f,r),mul:(a,f)=>T(a*f,r),pow:(a,f)=>Qr(s,a,f),div:(a,f)=>T(a*Xt(f,r),r),sqrN:a=>a*a,addN:(a,f)=>a+f,subN:(a,f)=>a-f,mulN:(a,f)=>a*f,inv:a=>Xt(a,r),sqrt:n.sqrt||(a=>c(s,a)),invertBatch:a=>Jr(s,a),cmov:(a,f,d)=>d?f:a,toBytes:a=>e?be(a,o):Q(a,o),fromBytes:a=>{if(a.length!==o)throw new Error(`Fp.fromBytes: expected ${o}, got ${a.length}`);return e?Wt(a):Z(a)}});return Object.freeze(s)}function Xe(r,t,e=!1){r=N("privateHash",r);let n=r.length,i=Qt(t).nByteLength+8;if(i<24||n1024)throw new Error(`hashToPrivateScalar: expected ${i}-1024 bytes of input, got ${n}`);let o=e?Wt(r):Z(r);return T(o,t-K)+K}var tn=BigInt(0),Ee=BigInt(1);function Qe(r,t){let e=(i,o)=>{let c=o.negate();return i?c:o},n=i=>{let o=Math.ceil(t/i)+1,c=2**(i-1);return{windows:o,windowSize:c}};return{constTimeNegate:e,unsafeLadder(i,o){let c=r.ZERO,s=i;for(;o>tn;)o&Ee&&(c=c.add(s)),s=s.double(),o>>=Ee;return c},precomputeWindow(i,o){let{windows:c,windowSize:s}=n(o),a=[],f=i,d=f;for(let u=0;u>=B,p>a&&(p-=w,c+=Ee);let b=l,m=l+Math.abs(p)-1,v=g%2!==0,I=p<0;p===0?d=d.add(e(v,o[b])):f=f.add(e(I,o[m]))}return{p:f,f:d}},wNAFCached(i,o,c,s){let a=i._WINDOW_SIZE||1,f=o.get(i);return f||(f=this.precomputeWindow(i,a),a!==1&&o.set(i,s(f))),this.wNAF(a,f,c)}}}function ve(r){return me(r.Fp),J(r,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...Qt(r.n,r.nBitLength),...r,p:r.Fp.ORDER})}function en(r){let t=ve(r);J(t,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});let{endo:e,Fp:n,a:i}=t;if(e){if(!n.eql(i,n.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof e!="object"||typeof e.beta!="bigint"||typeof e.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...t})}var{bytesToNumberBE:rn,hexToBytes:nn}=ge,pt={Err:class extends Error{constructor(t=""){super(t)}},_parseInt(r){let{Err:t}=pt;if(r.length<2||r[0]!==2)throw new t("Invalid signature integer tag");let e=r[1],n=r.subarray(2,e+2);if(!e||n.length!==e)throw new t("Invalid signature integer: wrong length");if(n[0]&128)throw new t("Invalid signature integer: negative");if(n[0]===0&&!(n[1]&128))throw new t("Invalid signature integer: unnecessary leading zero");return{d:rn(n),l:r.subarray(e+2)}},toSig(r){let{Err:t}=pt,e=typeof r=="string"?nn(r):r;if(!(e instanceof Uint8Array))throw new Error("ui8a expected");let n=e.length;if(n<2||e[0]!=48)throw new t("Invalid signature tag");if(e[1]!==n-2)throw new t("Invalid signature: incorrect length");let{d:i,l:o}=pt._parseInt(e.subarray(2)),{d:c,l:s}=pt._parseInt(o);if(s.length)throw new t("Invalid signature: left bytes after parsing");return{r:i,s:c}},hexFromSig(r){let t=f=>Number.parseInt(f[0],16)&8?"00"+f:f,e=f=>{let d=f.toString(16);return d.length&1?`0${d}`:d},n=t(e(r.s)),i=t(e(r.r)),o=n.length/2,c=i.length/2,s=e(o),a=e(c);return`30${e(c+o+4)}02${a}${i}02${s}${n}`}},F=BigInt(0),V=BigInt(1),fi=BigInt(2),Je=BigInt(3),ui=BigInt(4);function on(r){let t=en(r),{Fp:e}=t,n=t.toBytes||((g,l,p)=>{let b=l.toAffine();return at(Uint8Array.from([4]),e.toBytes(b.x),e.toBytes(b.y))}),i=t.fromBytes||(g=>{let l=g.subarray(1),p=e.fromBytes(l.subarray(0,e.BYTES)),b=e.fromBytes(l.subarray(e.BYTES,2*e.BYTES));return{x:p,y:b}});function o(g){let{a:l,b:p}=t,b=e.sqr(g),m=e.mul(b,g);return e.add(e.add(m,e.mul(g,l)),p)}if(!e.eql(e.sqr(t.Gy),o(t.Gx)))throw new Error("bad generator point: equation left != right");function c(g){return typeof g=="bigint"&&Fe.eql(v,e.ZERO);return m(p)&&m(b)?u.ZERO:new u(p,b,e.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(l){let p=e.invertBatch(l.map(b=>b.pz));return l.map((b,m)=>b.toAffine(p[m])).map(u.fromAffine)}static fromHex(l){let p=u.fromAffine(i(N("pointHex",l)));return p.assertValidity(),p}static fromPrivateKey(l){return u.BASE.multiply(a(l))}_setWindowSize(l){this._WINDOW_SIZE=l,f.delete(this)}assertValidity(){if(this.is0()){if(t.allowInfinityPoint)return;throw new Error("bad point: ZERO")}let{x:l,y:p}=this.toAffine();if(!e.isValid(l)||!e.isValid(p))throw new Error("bad point: x or y not FE");let b=e.sqr(p),m=o(l);if(!e.eql(b,m))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){let{y:l}=this.toAffine();if(e.isOdd)return!e.isOdd(l);throw new Error("Field doesn't support isOdd")}equals(l){d(l);let{px:p,py:b,pz:m}=this,{px:v,py:I,pz:S}=l,x=e.eql(e.mul(p,S),e.mul(v,m)),E=e.eql(e.mul(b,S),e.mul(I,m));return x&&E}negate(){return new u(this.px,e.neg(this.py),this.pz)}double(){let{a:l,b:p}=t,b=e.mul(p,Je),{px:m,py:v,pz:I}=this,S=e.ZERO,x=e.ZERO,E=e.ZERO,_=e.mul(m,m),j=e.mul(v,v),P=e.mul(I,I),L=e.mul(m,v);return L=e.add(L,L),E=e.mul(m,I),E=e.add(E,E),S=e.mul(l,E),x=e.mul(b,P),x=e.add(S,x),S=e.sub(j,x),x=e.add(j,x),x=e.mul(S,x),S=e.mul(L,S),E=e.mul(b,E),P=e.mul(l,P),L=e.sub(_,P),L=e.mul(l,L),L=e.add(L,E),E=e.add(_,_),_=e.add(E,_),_=e.add(_,P),_=e.mul(_,L),x=e.add(x,_),P=e.mul(v,I),P=e.add(P,P),_=e.mul(P,L),S=e.sub(S,_),E=e.mul(P,j),E=e.add(E,E),E=e.add(E,E),new u(S,x,E)}add(l){d(l);let{px:p,py:b,pz:m}=this,{px:v,py:I,pz:S}=l,x=e.ZERO,E=e.ZERO,_=e.ZERO,j=t.a,P=e.mul(t.b,Je),L=e.mul(p,v),q=e.mul(b,I),R=e.mul(m,S),tt=e.add(p,b),h=e.add(v,I);tt=e.mul(tt,h),h=e.add(L,q),tt=e.sub(tt,h),h=e.add(p,m);let y=e.add(v,S);return h=e.mul(h,y),y=e.add(L,R),h=e.sub(h,y),y=e.add(b,m),x=e.add(I,S),y=e.mul(y,x),x=e.add(q,R),y=e.sub(y,x),_=e.mul(j,h),x=e.mul(P,R),_=e.add(x,_),x=e.sub(q,_),_=e.add(q,_),E=e.mul(x,_),q=e.add(L,L),q=e.add(q,L),R=e.mul(j,R),h=e.mul(P,h),q=e.add(q,R),R=e.sub(L,R),R=e.mul(j,R),h=e.add(h,R),L=e.mul(q,h),E=e.add(E,L),L=e.mul(y,h),x=e.mul(tt,x),x=e.sub(x,L),L=e.mul(tt,q),_=e.mul(y,_),_=e.add(_,L),new u(x,E,_)}subtract(l){return this.add(l.negate())}is0(){return this.equals(u.ZERO)}wNAF(l){return B.wNAFCached(this,f,l,p=>{let b=e.invertBatch(p.map(m=>m.pz));return p.map((m,v)=>m.toAffine(b[v])).map(u.fromAffine)})}multiplyUnsafe(l){let p=u.ZERO;if(l===F)return p;if(s(l),l===V)return this;let{endo:b}=t;if(!b)return B.unsafeLadder(this,l);let{k1neg:m,k1:v,k2neg:I,k2:S}=b.splitScalar(l),x=p,E=p,_=this;for(;v>F||S>F;)v&V&&(x=x.add(_)),S&V&&(E=E.add(_)),_=_.double(),v>>=V,S>>=V;return m&&(x=x.negate()),I&&(E=E.negate()),E=new u(e.mul(E.px,b.beta),E.py,E.pz),x.add(E)}multiply(l){s(l);let p=l,b,m,{endo:v}=t;if(v){let{k1neg:I,k1:S,k2neg:x,k2:E}=v.splitScalar(p),{p:_,f:j}=this.wNAF(S),{p:P,f:L}=this.wNAF(E);_=B.constTimeNegate(I,_),P=B.constTimeNegate(x,P),P=new u(e.mul(P.px,v.beta),P.py,P.pz),b=_.add(P),m=j.add(L)}else{let{p:I,f:S}=this.wNAF(p);b=I,m=S}return u.normalizeZ([b,m])[0]}multiplyAndAddUnsafe(l,p,b){let m=u.BASE,v=(S,x)=>x===F||x===V||!S.equals(m)?S.multiplyUnsafe(x):S.multiply(x),I=v(this,p).add(v(l,b));return I.is0()?void 0:I}toAffine(l){let{px:p,py:b,pz:m}=this,v=this.is0();l==null&&(l=v?e.ONE:e.inv(m));let I=e.mul(p,l),S=e.mul(b,l),x=e.mul(m,l);if(v)return{x:e.ZERO,y:e.ZERO};if(!e.eql(x,e.ONE))throw new Error("invZ was invalid");return{x:I,y:S}}isTorsionFree(){let{h:l,isTorsionFree:p}=t;if(l===V)return!0;if(p)return p(u,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){let{h:l,clearCofactor:p}=t;return l===V?this:p?p(u,this):this.multiplyUnsafe(t.h)}toRawBytes(l=!0){return this.assertValidity(),n(u,this,l)}toHex(l=!0){return lt(this.toRawBytes(l))}}u.BASE=new u(t.Gx,t.Gy,e.ONE),u.ZERO=new u(e.ZERO,e.ONE,e.ZERO);let w=t.nBitLength,B=Qe(u,t.endo?Math.ceil(w/2):w);return{CURVE:t,ProjectivePoint:u,normPrivateKeyToScalar:a,weierstrassEquation:o,isWithinCurveOrder:c}}function sn(r){let t=ve(r);return J(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}function Fe(r){let t=sn(r),{Fp:e,n}=t,i=e.BYTES+1,o=2*e.BYTES+1;function c(h){return Flt(Q(h,t.nByteLength));function g(h){let y=n>>V;return h>y}function l(h){return g(h)?s(-h):h}let p=(h,y,A)=>Z(h.slice(y,A));class b{constructor(y,A,U){this.r=y,this.s=A,this.recovery=U,this.assertValidity()}static fromCompact(y){let A=t.nByteLength;return y=N("compactSignature",y,A*2),new b(p(y,0,A),p(y,A,2*A))}static fromDER(y){let{r:A,s:U}=pt.toSig(N("DER",y));return new b(A,U)}assertValidity(){if(!w(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!w(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(y){return new b(this.r,this.s,y)}recoverPublicKey(y){let{r:A,s:U,recovery:k}=this,H=E(N("msgHash",y));if(k==null||![0,1,2,3].includes(k))throw new Error("recovery id invalid");let C=k===2||k===3?A+t.n:A;if(C>=e.ORDER)throw new Error("recovery id 2 or 3 invalid");let z=k&1?"03":"02",et=f.fromHex(z+B(C)),rt=a(C),bt=s(-H*rt),St=s(U*rt),nt=f.BASE.multiplyAndAddUnsafe(et,bt,St);if(!nt)throw new Error("point at infinify");return nt.assertValidity(),nt}hasHighS(){return g(this.s)}normalizeS(){return this.hasHighS()?new b(this.r,s(-this.s),this.recovery):this}toDERRawBytes(){return ht(this.toDERHex())}toDERHex(){return pt.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return ht(this.toCompactHex())}toCompactHex(){return B(this.r)+B(this.s)}}let m={isValidPrivateKey(h){try{return d(h),!0}catch{return!1}},normPrivateKeyToScalar:d,randomPrivateKey:()=>{let h=t.randomBytes(e.BYTES+8),y=Xe(h,n);return Q(y,t.nByteLength)},precompute(h=8,y=f.BASE){return y._setWindowSize(h),y.multiply(BigInt(3)),y}};function v(h,y=!0){return f.fromPrivateKey(h).toRawBytes(y)}function I(h){let y=h instanceof Uint8Array,A=typeof h=="string",U=(y||A)&&h.length;return y?U===i||U===o:A?U===2*i||U===2*o:h instanceof f}function S(h,y,A=!0){if(I(h))throw new Error("first arg must be private key");if(!I(y))throw new Error("second arg must be public key");return f.fromHex(y).multiply(d(h)).toRawBytes(A)}let x=t.bits2int||function(h){let y=Z(h),A=h.length*8-t.nBitLength;return A>0?y>>BigInt(A):y},E=t.bits2int_modN||function(h){return s(x(h))},_=Ut(t.nBitLength);function j(h){if(typeof h!="bigint")throw new Error("bigint expected");if(!(F<=h&&h<_))throw new Error(`bigint expected < 2^${t.nBitLength}`);return Q(h,t.nByteLength)}function P(h,y,A=L){if(["recovered","canonical"].some(ft=>ft in A))throw new Error("sign() legacy options not supported");let{hash:U,randomBytes:k}=t,{lowS:H,prehash:C,extraEntropy:z}=A;H==null&&(H=!0),h=N("msgHash",h),C&&(h=N("prehashed msgHash",U(h)));let et=E(h),rt=d(y),bt=[j(rt),j(et)];if(z!=null){let ft=z===!0?k(e.BYTES):z;bt.push(N("extraEntropy",ft,e.BYTES))}let St=at(...bt),nt=et;function re(ft){let wt=x(ft);if(!w(wt))return;let Ie=a(wt),G=f.BASE.multiply(wt).toAffine(),gt=s(G.x);if(gt===F)return;let Kt=s(Ie*s(nt+gt*rt));if(Kt===F)return;let Le=(G.x===gt?0:2)|Number(G.y&V),ke=Kt;return H&&g(Kt)&&(ke=l(Kt),Le^=1),new b(gt,ke,Le)}return{seed:St,k2sig:re}}let L={lowS:t.lowS,prehash:!1},q={lowS:t.lowS,prehash:!1};function R(h,y,A=L){let{seed:U,k2sig:k}=P(h,y,A),H=t;return we(H.hash.outputLen,H.nByteLength,H.hmac)(U,k)}f.BASE._setWindowSize(8);function tt(h,y,A,U=q){let k=h;if(y=N("msgHash",y),A=N("publicKey",A),"strict"in U)throw new Error("options.strict was renamed to lowS");let{lowS:H,prehash:C}=U,z,et;try{if(typeof k=="string"||k instanceof Uint8Array)try{z=b.fromDER(k)}catch(G){if(!(G instanceof pt.Err))throw G;z=b.fromCompact(k)}else if(typeof k=="object"&&typeof k.r=="bigint"&&typeof k.s=="bigint"){let{r:G,s:gt}=k;z=new b(G,gt)}else throw new Error("PARSE");et=f.fromHex(A)}catch(G){if(G.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(H&&z.hasHighS())return!1;C&&(y=t.hash(y));let{r:rt,s:bt}=z,St=E(y),nt=a(bt),re=s(St*nt),ft=s(rt*nt),wt=f.BASE.multiplyAndAddUnsafe(et,re,ft)?.toAffine();return wt?s(wt.x)===rt:!1}return{CURVE:t,getPublicKey:v,getSharedSecret:S,sign:R,verify:tt,ProjectivePoint:f,Signature:b,utils:m}}var Jt=class extends _t{constructor(t,e){super(),this.finished=!1,this.destroyed=!1,X.hash(t);let n=kt(e);if(this.iHash=t.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let i=this.blockLen,o=new Uint8Array(i);o.set(n.length>i?t.create().update(n).digest():n);for(let c=0;cnew Jt(r,t).update(e).digest();Be.create=(r,t)=>new Jt(r,t);function cn(r){return{hash:r,hmac:(t,...e)=>Be(r,t,De(...e)),randomBytes:he}}function tr(r,t){let e=n=>Fe({...r,...cn(n)});return Object.freeze({...e(t),create:e})}var nr=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),er=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),an=BigInt(1),Ae=BigInt(2),rr=(r,t)=>(r+t/Ae)/t;function fn(r){let t=nr,e=BigInt(3),n=BigInt(6),i=BigInt(11),o=BigInt(22),c=BigInt(23),s=BigInt(44),a=BigInt(88),f=r*r*r%t,d=f*f*r%t,u=D(d,e,t)*d%t,w=D(u,e,t)*d%t,B=D(w,Ae,t)*f%t,g=D(B,i,t)*B%t,l=D(g,o,t)*g%t,p=D(l,s,t)*l%t,b=D(p,a,t)*p%t,m=D(b,s,t)*l%t,v=D(m,e,t)*d%t,I=D(v,c,t)*g%t,S=D(I,n,t)*f%t,x=D(S,Ae,t);if(!_e.eql(_e.sqr(x),r))throw new Error("Cannot find square root");return x}var _e=We(nr,void 0,void 0,{sqrt:fn}),Pt=tr({a:BigInt(0),b:BigInt(7),Fp:_e,n:er,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:r=>{let t=er,e=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-an*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),o=e,c=BigInt("0x100000000000000000000000000000000"),s=rr(o*r,t),a=rr(-n*r,t),f=T(r-s*e-a*i,t),d=T(-s*n-a*o,t),u=f>c,w=d>c;if(u&&(f=t-f),w&&(d=t-d),f>c||d>c)throw new Error("splitScalar: Endomorphism failed, k="+r);return{k1neg:u,k1:f,k2neg:w,k2:d}}}},je),Ki=BigInt(0);var Oi=Pt.ProjectivePoint;var Ft=["deriveBits"],ir=new Uint8Array([100,107,112,95,112,114,107]),or=new Uint8Array([115,107]);var yt=class{constructor(t,e,n,i=[]){Object.defineProperty(this,"key",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"type",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"extractable",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"algorithm",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"usages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.key=e,this.type=n,this.algorithm={name:t},this.usages=i,n==="public"&&(this.usages=[])}};var te="ECDH",ee=class{constructor(t){Object.defineProperty(this,"_hkdf",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_nPk",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_nSk",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._hkdf=t,this._nPk=33,this._nSk=32}async serializePublicKey(t){try{return await this._serializePublicKey(t)}catch(e){throw new vt(e)}}async deserializePublicKey(t){try{return await this._importRawKey(t,!0)}catch(e){throw new ut(e)}}async serializePrivateKey(t){try{return await this._serializePrivateKey(t)}catch(e){throw new vt(e)}}async deserializePrivateKey(t){try{return await this._importRawKey(t,!1)}catch(e){throw new ut(e)}}async importKey(t,e,n){try{if(t!=="raw")throw new Error("Unsupported format");return await this._importRawKey(e,n)}catch(i){throw new ut(i)}}async generateKeyPair(){try{let t=Pt.utils.randomPrivateKey(),e=new yt(te,t,"private",Ft);return{publicKey:await this.derivePublicKey(e),privateKey:e}}catch(t){throw new Bt(t)}}async deriveKeyPair(t){try{let e=await this._hkdf.labeledExtract(W,ir,new Uint8Array(t)),n=await this._hkdf.labeledExpand(e,or,W,this._nSk),i=new yt(te,new Uint8Array(n),"private",Ft);return{privateKey:i,publicKey:await this.derivePublicKey(i)}}catch(e){throw new Rt(e)}}async derivePublicKey(t){try{return await this._derivePublicKey(t)}catch(e){throw new ut(e)}}async dh(t,e){try{return await this._dh(t,e)}catch(n){throw new vt(n)}}_serializePublicKey(t){return new Promise(e=>{e(t.key.buffer)})}_serializePrivateKey(t){return new Promise(e=>{e(t.key.buffer)})}_importRawKey(t,e){return new Promise((n,i)=>{e&&t.byteLength!==this._nPk&&i(new Error("Invalid length of the key")),!e&&t.byteLength!==this._nSk&&i(new Error("Invalid length of the key")),n(new yt(te,new Uint8Array(t),e?"public":"private",e?[]:Ft))})}_derivePublicKey(t){return new Promise((e,n)=>{try{let i=Pt.getPublicKey(t.key);e(new yt(te,i,"public"))}catch(i){n(i)}})}_dh(t,e){return new Promise((n,i)=>{try{n(Pt.getSharedSecret(t.key,e.key).buffer)}catch(o){i(o)}})}};var Se=class extends jt{constructor(){let t=new Dt;super(ne.DhkemSecp256k1HkdfSha256,new ee(t),t),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:ne.DhkemSecp256k1HkdfSha256}),Object.defineProperty(this,"secretSize",{enumerable:!0,configurable:!0,writable:!0,value:32}),Object.defineProperty(this,"encSize",{enumerable:!0,configurable:!0,writable:!0,value:33}),Object.defineProperty(this,"publicKeySize",{enumerable:!0,configurable:!0,writable:!0,value:33}),Object.defineProperty(this,"privateKeySize",{enumerable:!0,configurable:!0,writable:!0,value:32})}};export{Se as DhkemSecp256k1HkdfSha256}; /*! Bundled license information: +@noble/hashes/esm/utils.js: + (*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *) + @noble/hashes/esm/utils.js: (*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *) diff --git a/dhkem-x25519/docs/assets/main.js b/dhkem-x25519/docs/assets/main.js index 3cee05e61..01bcad55f 100644 --- a/dhkem-x25519/docs/assets/main.js +++ b/dhkem-x25519/docs/assets/main.js @@ -1,7 +1,8 @@ "use strict"; -"use strict";(()=>{var Se=Object.create;var re=Object.defineProperty;var we=Object.getOwnPropertyDescriptor;var Te=Object.getOwnPropertyNames;var ke=Object.getPrototypeOf,Qe=Object.prototype.hasOwnProperty;var Pe=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Ie=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Te(e))!Qe.call(t,i)&&i!==r&&re(t,i,{get:()=>e[i],enumerable:!(n=we(e,i))||n.enumerable});return t};var Ce=(t,e,r)=>(r=t!=null?Se(ke(t)):{},Ie(e||!t||!t.__esModule?re(r,"default",{value:t,enumerable:!0}):r,t));var ae=Pe((se,oe)=>{(function(){var t=function(e){var r=new t.Builder;return r.pipeline.add(t.trimmer,t.stopWordFilter,t.stemmer),r.searchPipeline.add(t.stemmer),e.call(r,r),r.build()};t.version="2.3.9";t.utils={},t.utils.warn=function(e){return function(r){e.console&&console.warn&&console.warn(r)}}(this),t.utils.asString=function(e){return e==null?"":e.toString()},t.utils.clone=function(e){if(e==null)return e;for(var r=Object.create(null),n=Object.keys(e),i=0;i0){var d=t.utils.clone(r)||{};d.position=[a,u],d.index=s.length,s.push(new t.Token(n.slice(a,o),d))}a=o+1}}return s},t.tokenizer.separator=/[\s\-]+/;t.Pipeline=function(){this._stack=[]},t.Pipeline.registeredFunctions=Object.create(null),t.Pipeline.registerFunction=function(e,r){r in this.registeredFunctions&&t.utils.warn("Overwriting existing registered function: "+r),e.label=r,t.Pipeline.registeredFunctions[e.label]=e},t.Pipeline.warnIfFunctionNotRegistered=function(e){var r=e.label&&e.label in this.registeredFunctions;r||t.utils.warn(`Function is not registered with pipeline. This may cause problems when serialising the index. -`,e)},t.Pipeline.load=function(e){var r=new t.Pipeline;return e.forEach(function(n){var i=t.Pipeline.registeredFunctions[n];if(i)r.add(i);else throw new Error("Cannot load unregistered function: "+n)}),r},t.Pipeline.prototype.add=function(){var e=Array.prototype.slice.call(arguments);e.forEach(function(r){t.Pipeline.warnIfFunctionNotRegistered(r),this._stack.push(r)},this)},t.Pipeline.prototype.after=function(e,r){t.Pipeline.warnIfFunctionNotRegistered(r);var n=this._stack.indexOf(e);if(n==-1)throw new Error("Cannot find existingFn");n=n+1,this._stack.splice(n,0,r)},t.Pipeline.prototype.before=function(e,r){t.Pipeline.warnIfFunctionNotRegistered(r);var n=this._stack.indexOf(e);if(n==-1)throw new Error("Cannot find existingFn");this._stack.splice(n,0,r)},t.Pipeline.prototype.remove=function(e){var r=this._stack.indexOf(e);r!=-1&&this._stack.splice(r,1)},t.Pipeline.prototype.run=function(e){for(var r=this._stack.length,n=0;n1&&(oe&&(n=s),o!=e);)i=n-r,s=r+Math.floor(i/2),o=this.elements[s*2];if(o==e||o>e)return s*2;if(ol?d+=2:a==l&&(r+=n[u+1]*i[d+1],u+=2,d+=2);return r},t.Vector.prototype.similarity=function(e){return this.dot(e)/this.magnitude()||0},t.Vector.prototype.toArray=function(){for(var e=new Array(this.elements.length/2),r=1,n=0;r0){var o=s.str.charAt(0),a;o in s.node.edges?a=s.node.edges[o]:(a=new t.TokenSet,s.node.edges[o]=a),s.str.length==1&&(a.final=!0),i.push({node:a,editsRemaining:s.editsRemaining,str:s.str.slice(1)})}if(s.editsRemaining!=0){if("*"in s.node.edges)var l=s.node.edges["*"];else{var l=new t.TokenSet;s.node.edges["*"]=l}if(s.str.length==0&&(l.final=!0),i.push({node:l,editsRemaining:s.editsRemaining-1,str:s.str}),s.str.length>1&&i.push({node:s.node,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)}),s.str.length==1&&(s.node.final=!0),s.str.length>=1){if("*"in s.node.edges)var u=s.node.edges["*"];else{var u=new t.TokenSet;s.node.edges["*"]=u}s.str.length==1&&(u.final=!0),i.push({node:u,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)})}if(s.str.length>1){var d=s.str.charAt(0),m=s.str.charAt(1),y;m in s.node.edges?y=s.node.edges[m]:(y=new t.TokenSet,s.node.edges[m]=y),s.str.length==1&&(y.final=!0),i.push({node:y,editsRemaining:s.editsRemaining-1,str:d+s.str.slice(2)})}}}return n},t.TokenSet.fromString=function(e){for(var r=new t.TokenSet,n=r,i=0,s=e.length;i=e;r--){var n=this.uncheckedNodes[r],i=n.child.toString();i in this.minimizedNodes?n.parent.edges[n.char]=this.minimizedNodes[i]:(n.child._str=i,this.minimizedNodes[i]=n.child),this.uncheckedNodes.pop()}};t.Index=function(e){this.invertedIndex=e.invertedIndex,this.fieldVectors=e.fieldVectors,this.tokenSet=e.tokenSet,this.fields=e.fields,this.pipeline=e.pipeline},t.Index.prototype.search=function(e){return this.query(function(r){var n=new t.QueryParser(e,r);n.parse()})},t.Index.prototype.query=function(e){for(var r=new t.Query(this.fields),n=Object.create(null),i=Object.create(null),s=Object.create(null),o=Object.create(null),a=Object.create(null),l=0;l1?this._b=1:this._b=e},t.Builder.prototype.k1=function(e){this._k1=e},t.Builder.prototype.add=function(e,r){var n=e[this._ref],i=Object.keys(this._fields);this._documents[n]=r||{},this.documentCount+=1;for(var s=0;s=this.length)return t.QueryLexer.EOS;var e=this.str.charAt(this.pos);return this.pos+=1,e},t.QueryLexer.prototype.width=function(){return this.pos-this.start},t.QueryLexer.prototype.ignore=function(){this.start==this.pos&&(this.pos+=1),this.start=this.pos},t.QueryLexer.prototype.backup=function(){this.pos-=1},t.QueryLexer.prototype.acceptDigitRun=function(){var e,r;do e=this.next(),r=e.charCodeAt(0);while(r>47&&r<58);e!=t.QueryLexer.EOS&&this.backup()},t.QueryLexer.prototype.more=function(){return this.pos1&&(e.backup(),e.emit(t.QueryLexer.TERM)),e.ignore(),e.more())return t.QueryLexer.lexText},t.QueryLexer.lexEditDistance=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(t.QueryLexer.EDIT_DISTANCE),t.QueryLexer.lexText},t.QueryLexer.lexBoost=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(t.QueryLexer.BOOST),t.QueryLexer.lexText},t.QueryLexer.lexEOS=function(e){e.width()>0&&e.emit(t.QueryLexer.TERM)},t.QueryLexer.termSeparator=t.tokenizer.separator,t.QueryLexer.lexText=function(e){for(;;){var r=e.next();if(r==t.QueryLexer.EOS)return t.QueryLexer.lexEOS;if(r.charCodeAt(0)==92){e.escapeCharacter();continue}if(r==":")return t.QueryLexer.lexField;if(r=="~")return e.backup(),e.width()>0&&e.emit(t.QueryLexer.TERM),t.QueryLexer.lexEditDistance;if(r=="^")return e.backup(),e.width()>0&&e.emit(t.QueryLexer.TERM),t.QueryLexer.lexBoost;if(r=="+"&&e.width()===1||r=="-"&&e.width()===1)return e.emit(t.QueryLexer.PRESENCE),t.QueryLexer.lexText;if(r.match(t.QueryLexer.termSeparator))return t.QueryLexer.lexTerm}},t.QueryParser=function(e,r){this.lexer=new t.QueryLexer(e),this.query=r,this.currentClause={},this.lexemeIdx=0},t.QueryParser.prototype.parse=function(){this.lexer.run(),this.lexemes=this.lexer.lexemes;for(var e=t.QueryParser.parseClause;e;)e=e(this);return this.query},t.QueryParser.prototype.peekLexeme=function(){return this.lexemes[this.lexemeIdx]},t.QueryParser.prototype.consumeLexeme=function(){var e=this.peekLexeme();return this.lexemeIdx+=1,e},t.QueryParser.prototype.nextClause=function(){var e=this.currentClause;this.query.clause(e),this.currentClause={}},t.QueryParser.parseClause=function(e){var r=e.peekLexeme();if(r!=null)switch(r.type){case t.QueryLexer.PRESENCE:return t.QueryParser.parsePresence;case t.QueryLexer.FIELD:return t.QueryParser.parseField;case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var n="expected either a field or a term, found "+r.type;throw r.str.length>=1&&(n+=" with value '"+r.str+"'"),new t.QueryParseError(n,r.start,r.end)}},t.QueryParser.parsePresence=function(e){var r=e.consumeLexeme();if(r!=null){switch(r.str){case"-":e.currentClause.presence=t.Query.presence.PROHIBITED;break;case"+":e.currentClause.presence=t.Query.presence.REQUIRED;break;default:var n="unrecognised presence operator'"+r.str+"'";throw new t.QueryParseError(n,r.start,r.end)}var i=e.peekLexeme();if(i==null){var n="expecting term or field, found nothing";throw new t.QueryParseError(n,r.start,r.end)}switch(i.type){case t.QueryLexer.FIELD:return t.QueryParser.parseField;case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var n="expecting term or field, found '"+i.type+"'";throw new t.QueryParseError(n,i.start,i.end)}}},t.QueryParser.parseField=function(e){var r=e.consumeLexeme();if(r!=null){if(e.query.allFields.indexOf(r.str)==-1){var n=e.query.allFields.map(function(o){return"'"+o+"'"}).join(", "),i="unrecognised field '"+r.str+"', possible fields: "+n;throw new t.QueryParseError(i,r.start,r.end)}e.currentClause.fields=[r.str];var s=e.peekLexeme();if(s==null){var i="expecting term, found nothing";throw new t.QueryParseError(i,r.start,r.end)}switch(s.type){case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var i="expecting term, found '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},t.QueryParser.parseTerm=function(e){var r=e.consumeLexeme();if(r!=null){e.currentClause.term=r.str.toLowerCase(),r.str.indexOf("*")!=-1&&(e.currentClause.usePipeline=!1);var n=e.peekLexeme();if(n==null){e.nextClause();return}switch(n.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+n.type+"'";throw new t.QueryParseError(i,n.start,n.end)}}},t.QueryParser.parseEditDistance=function(e){var r=e.consumeLexeme();if(r!=null){var n=parseInt(r.str,10);if(isNaN(n)){var i="edit distance must be numeric";throw new t.QueryParseError(i,r.start,r.end)}e.currentClause.editDistance=n;var s=e.peekLexeme();if(s==null){e.nextClause();return}switch(s.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},t.QueryParser.parseBoost=function(e){var r=e.consumeLexeme();if(r!=null){var n=parseInt(r.str,10);if(isNaN(n)){var i="boost must be numeric";throw new t.QueryParseError(i,r.start,r.end)}e.currentClause.boost=n;var s=e.peekLexeme();if(s==null){e.nextClause();return}switch(s.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},function(e,r){typeof define=="function"&&define.amd?define(r):typeof se=="object"?oe.exports=r():e.lunr=r()}(this,function(){return t})})()});var ne=[];function G(t,e){ne.push({selector:e,constructor:t})}var U=class{constructor(){this.alwaysVisibleMember=null;this.createComponents(document.body),this.ensureActivePageVisible(),this.ensureFocusedElementVisible(),this.listenForCodeCopies(),window.addEventListener("hashchange",()=>this.ensureFocusedElementVisible())}createComponents(e){ne.forEach(r=>{e.querySelectorAll(r.selector).forEach(n=>{n.dataset.hasInstance||(new r.constructor({el:n,app:this}),n.dataset.hasInstance=String(!0))})})}filterChanged(){this.ensureFocusedElementVisible()}ensureActivePageVisible(){let e=document.querySelector(".tsd-navigation .current"),r=e?.parentElement;for(;r&&!r.classList.contains(".tsd-navigation");)r instanceof HTMLDetailsElement&&(r.open=!0),r=r.parentElement;if(e){let n=e.getBoundingClientRect().top-document.documentElement.clientHeight/4;document.querySelector(".site-menu").scrollTop=n}}ensureFocusedElementVisible(){if(this.alwaysVisibleMember&&(this.alwaysVisibleMember.classList.remove("always-visible"),this.alwaysVisibleMember.firstElementChild.remove(),this.alwaysVisibleMember=null),!location.hash)return;let e=document.getElementById(location.hash.substring(1));if(!e)return;let r=e.parentElement;for(;r&&r.tagName!=="SECTION";)r=r.parentElement;if(r&&r.offsetParent==null){this.alwaysVisibleMember=r,r.classList.add("always-visible");let n=document.createElement("p");n.classList.add("warning"),n.textContent="This member is normally hidden due to your filter settings.",r.prepend(n)}}listenForCodeCopies(){document.querySelectorAll("pre > button").forEach(e=>{let r;e.addEventListener("click",()=>{e.previousElementSibling instanceof HTMLElement&&navigator.clipboard.writeText(e.previousElementSibling.innerText.trim()),e.textContent="Copied!",e.classList.add("visible"),clearTimeout(r),r=setTimeout(()=>{e.classList.remove("visible"),r=setTimeout(()=>{e.textContent="Copy"},100)},1e3)})})}};var ie=(t,e=100)=>{let r;return()=>{clearTimeout(r),r=setTimeout(()=>t(),e)}};var ce=Ce(ae());function de(){let t=document.getElementById("tsd-search");if(!t)return;let e=document.getElementById("tsd-search-script");t.classList.add("loading"),e&&(e.addEventListener("error",()=>{t.classList.remove("loading"),t.classList.add("failure")}),e.addEventListener("load",()=>{t.classList.remove("loading"),t.classList.add("ready")}),window.searchData&&t.classList.remove("loading"));let r=document.querySelector("#tsd-search input"),n=document.querySelector("#tsd-search .results");if(!r||!n)throw new Error("The input field or the result list wrapper was not found");let i=!1;n.addEventListener("mousedown",()=>i=!0),n.addEventListener("mouseup",()=>{i=!1,t.classList.remove("has-focus")}),r.addEventListener("focus",()=>t.classList.add("has-focus")),r.addEventListener("blur",()=>{i||(i=!1,t.classList.remove("has-focus"))});let s={base:t.dataset.base+"/"};Oe(t,n,r,s)}function Oe(t,e,r,n){r.addEventListener("input",ie(()=>{Re(t,e,r,n)},200));let i=!1;r.addEventListener("keydown",s=>{i=!0,s.key=="Enter"?Fe(e,r):s.key=="Escape"?r.blur():s.key=="ArrowUp"?ue(e,-1):s.key==="ArrowDown"?ue(e,1):i=!1}),r.addEventListener("keypress",s=>{i&&s.preventDefault()}),document.body.addEventListener("keydown",s=>{s.altKey||s.ctrlKey||s.metaKey||!r.matches(":focus")&&s.key==="/"&&(r.focus(),s.preventDefault())})}function _e(t,e){t.index||window.searchData&&(e.classList.remove("loading"),e.classList.add("ready"),t.data=window.searchData,t.index=ce.Index.load(window.searchData.index))}function Re(t,e,r,n){if(_e(n,t),!n.index||!n.data)return;e.textContent="";let i=r.value.trim(),s=i?n.index.search(`*${i}*`):[];for(let o=0;oa.score-o.score);for(let o=0,a=Math.min(10,s.length);o${le(l.parent,i)}.${u}`);let d=document.createElement("li");d.classList.value=l.classes??"";let m=document.createElement("a");m.href=n.base+l.url,m.innerHTML=u,d.append(m),e.appendChild(d)}}function ue(t,e){let r=t.querySelector(".current");if(!r)r=t.querySelector(e==1?"li:first-child":"li:last-child"),r&&r.classList.add("current");else{let n=r;if(e===1)do n=n.nextElementSibling??void 0;while(n instanceof HTMLElement&&n.offsetParent==null);else do n=n.previousElementSibling??void 0;while(n instanceof HTMLElement&&n.offsetParent==null);n&&(r.classList.remove("current"),n.classList.add("current"))}}function Fe(t,e){let r=t.querySelector(".current");if(r||(r=t.querySelector("li:first-child")),r){let n=r.querySelector("a");n&&(window.location.href=n.href),e.blur()}}function le(t,e){if(e==="")return t;let r=t.toLocaleLowerCase(),n=e.toLocaleLowerCase(),i=[],s=0,o=r.indexOf(n);for(;o!=-1;)i.push(K(t.substring(s,o)),`${K(t.substring(o,o+n.length))}`),s=o+n.length,o=r.indexOf(n,s);return i.push(K(t.substring(s))),i.join("")}var Me={"&":"&","<":"<",">":">","'":"'",'"':"""};function K(t){return t.replace(/[&<>"'"]/g,e=>Me[e])}var P=class{constructor(e){this.el=e.el,this.app=e.app}};var M="mousedown",fe="mousemove",N="mouseup",J={x:0,y:0},he=!1,ee=!1,De=!1,D=!1,pe=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);document.documentElement.classList.add(pe?"is-mobile":"not-mobile");pe&&"ontouchstart"in document.documentElement&&(De=!0,M="touchstart",fe="touchmove",N="touchend");document.addEventListener(M,t=>{ee=!0,D=!1;let e=M=="touchstart"?t.targetTouches[0]:t;J.y=e.pageY||0,J.x=e.pageX||0});document.addEventListener(fe,t=>{if(ee&&!D){let e=M=="touchstart"?t.targetTouches[0]:t,r=J.x-(e.pageX||0),n=J.y-(e.pageY||0);D=Math.sqrt(r*r+n*n)>10}});document.addEventListener(N,()=>{ee=!1});document.addEventListener("click",t=>{he&&(t.preventDefault(),t.stopImmediatePropagation(),he=!1)});var X=class extends P{constructor(r){super(r);this.className=this.el.dataset.toggle||"",this.el.addEventListener(N,n=>this.onPointerUp(n)),this.el.addEventListener("click",n=>n.preventDefault()),document.addEventListener(M,n=>this.onDocumentPointerDown(n)),document.addEventListener(N,n=>this.onDocumentPointerUp(n))}setActive(r){if(this.active==r)return;this.active=r,document.documentElement.classList.toggle("has-"+this.className,r),this.el.classList.toggle("active",r);let n=(this.active?"to-has-":"from-has-")+this.className;document.documentElement.classList.add(n),setTimeout(()=>document.documentElement.classList.remove(n),500)}onPointerUp(r){D||(this.setActive(!0),r.preventDefault())}onDocumentPointerDown(r){if(this.active){if(r.target.closest(".col-sidebar, .tsd-filter-group"))return;this.setActive(!1)}}onDocumentPointerUp(r){if(!D&&this.active&&r.target.closest(".col-sidebar")){let n=r.target.closest("a");if(n){let i=window.location.href;i.indexOf("#")!=-1&&(i=i.substring(0,i.indexOf("#"))),n.href.substring(0,i.length)==i&&setTimeout(()=>this.setActive(!1),250)}}}};var te;try{te=localStorage}catch{te={getItem(){return null},setItem(){}}}var Q=te;var me=document.head.appendChild(document.createElement("style"));me.dataset.for="filters";var Y=class extends P{constructor(r){super(r);this.key=`filter-${this.el.name}`,this.value=this.el.checked,this.el.addEventListener("change",()=>{this.setLocalStorage(this.el.checked)}),this.setLocalStorage(this.fromLocalStorage()),me.innerHTML+=`html:not(.${this.key}) .tsd-is-${this.el.name} { display: none; } -`}fromLocalStorage(){let r=Q.getItem(this.key);return r?r==="true":this.el.checked}setLocalStorage(r){Q.setItem(this.key,r.toString()),this.value=r,this.handleValueChange()}handleValueChange(){this.el.checked=this.value,document.documentElement.classList.toggle(this.key,this.value),this.app.filterChanged(),document.querySelectorAll(".tsd-index-section").forEach(r=>{r.style.display="block";let n=Array.from(r.querySelectorAll(".tsd-index-link")).every(i=>i.offsetParent==null);r.style.display=n?"none":"block"})}};var Z=class extends P{constructor(r){super(r);this.summary=this.el.querySelector(".tsd-accordion-summary"),this.icon=this.summary.querySelector("svg"),this.key=`tsd-accordion-${this.summary.dataset.key??this.summary.textContent.trim().replace(/\s+/g,"-").toLowerCase()}`;let n=Q.getItem(this.key);this.el.open=n?n==="true":this.el.open,this.el.addEventListener("toggle",()=>this.update()),this.update()}update(){this.icon.style.transform=`rotate(${this.el.open?0:-90}deg)`,Q.setItem(this.key,this.el.open.toString())}};function ve(t){let e=Q.getItem("tsd-theme")||"os";t.value=e,ye(e),t.addEventListener("change",()=>{Q.setItem("tsd-theme",t.value),ye(t.value)})}function ye(t){document.documentElement.dataset.theme=t}de();G(X,"a[data-toggle]");G(Z,".tsd-index-accordion");G(Y,".tsd-filter-item input[type=checkbox]");var ge=document.getElementById("tsd-theme");ge&&ve(ge);var Ae=new U;Object.defineProperty(window,"app",{value:Ae});document.querySelectorAll("summary a").forEach(t=>{t.addEventListener("click",()=>{location.assign(t.href)})});})(); +"use strict";(()=>{var Pe=Object.create;var ne=Object.defineProperty;var Ie=Object.getOwnPropertyDescriptor;var Oe=Object.getOwnPropertyNames;var _e=Object.getPrototypeOf,Re=Object.prototype.hasOwnProperty;var Me=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Fe=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Oe(e))!Re.call(t,i)&&i!==n&&ne(t,i,{get:()=>e[i],enumerable:!(r=Ie(e,i))||r.enumerable});return t};var De=(t,e,n)=>(n=t!=null?Pe(_e(t)):{},Fe(e||!t||!t.__esModule?ne(n,"default",{value:t,enumerable:!0}):n,t));var ae=Me((se,oe)=>{(function(){var t=function(e){var n=new t.Builder;return n.pipeline.add(t.trimmer,t.stopWordFilter,t.stemmer),n.searchPipeline.add(t.stemmer),e.call(n,n),n.build()};t.version="2.3.9";t.utils={},t.utils.warn=function(e){return function(n){e.console&&console.warn&&console.warn(n)}}(this),t.utils.asString=function(e){return e==null?"":e.toString()},t.utils.clone=function(e){if(e==null)return e;for(var n=Object.create(null),r=Object.keys(e),i=0;i0){var d=t.utils.clone(n)||{};d.position=[a,u],d.index=s.length,s.push(new t.Token(r.slice(a,o),d))}a=o+1}}return s},t.tokenizer.separator=/[\s\-]+/;t.Pipeline=function(){this._stack=[]},t.Pipeline.registeredFunctions=Object.create(null),t.Pipeline.registerFunction=function(e,n){n in this.registeredFunctions&&t.utils.warn("Overwriting existing registered function: "+n),e.label=n,t.Pipeline.registeredFunctions[e.label]=e},t.Pipeline.warnIfFunctionNotRegistered=function(e){var n=e.label&&e.label in this.registeredFunctions;n||t.utils.warn(`Function is not registered with pipeline. This may cause problems when serialising the index. +`,e)},t.Pipeline.load=function(e){var n=new t.Pipeline;return e.forEach(function(r){var i=t.Pipeline.registeredFunctions[r];if(i)n.add(i);else throw new Error("Cannot load unregistered function: "+r)}),n},t.Pipeline.prototype.add=function(){var e=Array.prototype.slice.call(arguments);e.forEach(function(n){t.Pipeline.warnIfFunctionNotRegistered(n),this._stack.push(n)},this)},t.Pipeline.prototype.after=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var r=this._stack.indexOf(e);if(r==-1)throw new Error("Cannot find existingFn");r=r+1,this._stack.splice(r,0,n)},t.Pipeline.prototype.before=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var r=this._stack.indexOf(e);if(r==-1)throw new Error("Cannot find existingFn");this._stack.splice(r,0,n)},t.Pipeline.prototype.remove=function(e){var n=this._stack.indexOf(e);n!=-1&&this._stack.splice(n,1)},t.Pipeline.prototype.run=function(e){for(var n=this._stack.length,r=0;r1&&(oe&&(r=s),o!=e);)i=r-n,s=n+Math.floor(i/2),o=this.elements[s*2];if(o==e||o>e)return s*2;if(ol?d+=2:a==l&&(n+=r[u+1]*i[d+1],u+=2,d+=2);return n},t.Vector.prototype.similarity=function(e){return this.dot(e)/this.magnitude()||0},t.Vector.prototype.toArray=function(){for(var e=new Array(this.elements.length/2),n=1,r=0;n0){var o=s.str.charAt(0),a;o in s.node.edges?a=s.node.edges[o]:(a=new t.TokenSet,s.node.edges[o]=a),s.str.length==1&&(a.final=!0),i.push({node:a,editsRemaining:s.editsRemaining,str:s.str.slice(1)})}if(s.editsRemaining!=0){if("*"in s.node.edges)var l=s.node.edges["*"];else{var l=new t.TokenSet;s.node.edges["*"]=l}if(s.str.length==0&&(l.final=!0),i.push({node:l,editsRemaining:s.editsRemaining-1,str:s.str}),s.str.length>1&&i.push({node:s.node,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)}),s.str.length==1&&(s.node.final=!0),s.str.length>=1){if("*"in s.node.edges)var u=s.node.edges["*"];else{var u=new t.TokenSet;s.node.edges["*"]=u}s.str.length==1&&(u.final=!0),i.push({node:u,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)})}if(s.str.length>1){var d=s.str.charAt(0),v=s.str.charAt(1),f;v in s.node.edges?f=s.node.edges[v]:(f=new t.TokenSet,s.node.edges[v]=f),s.str.length==1&&(f.final=!0),i.push({node:f,editsRemaining:s.editsRemaining-1,str:d+s.str.slice(2)})}}}return r},t.TokenSet.fromString=function(e){for(var n=new t.TokenSet,r=n,i=0,s=e.length;i=e;n--){var r=this.uncheckedNodes[n],i=r.child.toString();i in this.minimizedNodes?r.parent.edges[r.char]=this.minimizedNodes[i]:(r.child._str=i,this.minimizedNodes[i]=r.child),this.uncheckedNodes.pop()}};t.Index=function(e){this.invertedIndex=e.invertedIndex,this.fieldVectors=e.fieldVectors,this.tokenSet=e.tokenSet,this.fields=e.fields,this.pipeline=e.pipeline},t.Index.prototype.search=function(e){return this.query(function(n){var r=new t.QueryParser(e,n);r.parse()})},t.Index.prototype.query=function(e){for(var n=new t.Query(this.fields),r=Object.create(null),i=Object.create(null),s=Object.create(null),o=Object.create(null),a=Object.create(null),l=0;l1?this._b=1:this._b=e},t.Builder.prototype.k1=function(e){this._k1=e},t.Builder.prototype.add=function(e,n){var r=e[this._ref],i=Object.keys(this._fields);this._documents[r]=n||{},this.documentCount+=1;for(var s=0;s=this.length)return t.QueryLexer.EOS;var e=this.str.charAt(this.pos);return this.pos+=1,e},t.QueryLexer.prototype.width=function(){return this.pos-this.start},t.QueryLexer.prototype.ignore=function(){this.start==this.pos&&(this.pos+=1),this.start=this.pos},t.QueryLexer.prototype.backup=function(){this.pos-=1},t.QueryLexer.prototype.acceptDigitRun=function(){var e,n;do e=this.next(),n=e.charCodeAt(0);while(n>47&&n<58);e!=t.QueryLexer.EOS&&this.backup()},t.QueryLexer.prototype.more=function(){return this.pos1&&(e.backup(),e.emit(t.QueryLexer.TERM)),e.ignore(),e.more())return t.QueryLexer.lexText},t.QueryLexer.lexEditDistance=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(t.QueryLexer.EDIT_DISTANCE),t.QueryLexer.lexText},t.QueryLexer.lexBoost=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(t.QueryLexer.BOOST),t.QueryLexer.lexText},t.QueryLexer.lexEOS=function(e){e.width()>0&&e.emit(t.QueryLexer.TERM)},t.QueryLexer.termSeparator=t.tokenizer.separator,t.QueryLexer.lexText=function(e){for(;;){var n=e.next();if(n==t.QueryLexer.EOS)return t.QueryLexer.lexEOS;if(n.charCodeAt(0)==92){e.escapeCharacter();continue}if(n==":")return t.QueryLexer.lexField;if(n=="~")return e.backup(),e.width()>0&&e.emit(t.QueryLexer.TERM),t.QueryLexer.lexEditDistance;if(n=="^")return e.backup(),e.width()>0&&e.emit(t.QueryLexer.TERM),t.QueryLexer.lexBoost;if(n=="+"&&e.width()===1||n=="-"&&e.width()===1)return e.emit(t.QueryLexer.PRESENCE),t.QueryLexer.lexText;if(n.match(t.QueryLexer.termSeparator))return t.QueryLexer.lexTerm}},t.QueryParser=function(e,n){this.lexer=new t.QueryLexer(e),this.query=n,this.currentClause={},this.lexemeIdx=0},t.QueryParser.prototype.parse=function(){this.lexer.run(),this.lexemes=this.lexer.lexemes;for(var e=t.QueryParser.parseClause;e;)e=e(this);return this.query},t.QueryParser.prototype.peekLexeme=function(){return this.lexemes[this.lexemeIdx]},t.QueryParser.prototype.consumeLexeme=function(){var e=this.peekLexeme();return this.lexemeIdx+=1,e},t.QueryParser.prototype.nextClause=function(){var e=this.currentClause;this.query.clause(e),this.currentClause={}},t.QueryParser.parseClause=function(e){var n=e.peekLexeme();if(n!=null)switch(n.type){case t.QueryLexer.PRESENCE:return t.QueryParser.parsePresence;case t.QueryLexer.FIELD:return t.QueryParser.parseField;case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var r="expected either a field or a term, found "+n.type;throw n.str.length>=1&&(r+=" with value '"+n.str+"'"),new t.QueryParseError(r,n.start,n.end)}},t.QueryParser.parsePresence=function(e){var n=e.consumeLexeme();if(n!=null){switch(n.str){case"-":e.currentClause.presence=t.Query.presence.PROHIBITED;break;case"+":e.currentClause.presence=t.Query.presence.REQUIRED;break;default:var r="unrecognised presence operator'"+n.str+"'";throw new t.QueryParseError(r,n.start,n.end)}var i=e.peekLexeme();if(i==null){var r="expecting term or field, found nothing";throw new t.QueryParseError(r,n.start,n.end)}switch(i.type){case t.QueryLexer.FIELD:return t.QueryParser.parseField;case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var r="expecting term or field, found '"+i.type+"'";throw new t.QueryParseError(r,i.start,i.end)}}},t.QueryParser.parseField=function(e){var n=e.consumeLexeme();if(n!=null){if(e.query.allFields.indexOf(n.str)==-1){var r=e.query.allFields.map(function(o){return"'"+o+"'"}).join(", "),i="unrecognised field '"+n.str+"', possible fields: "+r;throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.fields=[n.str];var s=e.peekLexeme();if(s==null){var i="expecting term, found nothing";throw new t.QueryParseError(i,n.start,n.end)}switch(s.type){case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var i="expecting term, found '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},t.QueryParser.parseTerm=function(e){var n=e.consumeLexeme();if(n!=null){e.currentClause.term=n.str.toLowerCase(),n.str.indexOf("*")!=-1&&(e.currentClause.usePipeline=!1);var r=e.peekLexeme();if(r==null){e.nextClause();return}switch(r.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+r.type+"'";throw new t.QueryParseError(i,r.start,r.end)}}},t.QueryParser.parseEditDistance=function(e){var n=e.consumeLexeme();if(n!=null){var r=parseInt(n.str,10);if(isNaN(r)){var i="edit distance must be numeric";throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.editDistance=r;var s=e.peekLexeme();if(s==null){e.nextClause();return}switch(s.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},t.QueryParser.parseBoost=function(e){var n=e.consumeLexeme();if(n!=null){var r=parseInt(n.str,10);if(isNaN(r)){var i="boost must be numeric";throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.boost=r;var s=e.peekLexeme();if(s==null){e.nextClause();return}switch(s.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},function(e,n){typeof define=="function"&&define.amd?define(n):typeof se=="object"?oe.exports=n():e.lunr=n()}(this,function(){return t})})()});var re=[];function G(t,e){re.push({selector:e,constructor:t})}var U=class{constructor(){this.alwaysVisibleMember=null;this.createComponents(document.body),this.ensureActivePageVisible(),this.ensureFocusedElementVisible(),this.listenForCodeCopies(),window.addEventListener("hashchange",()=>this.ensureFocusedElementVisible())}createComponents(e){re.forEach(n=>{e.querySelectorAll(n.selector).forEach(r=>{r.dataset.hasInstance||(new n.constructor({el:r,app:this}),r.dataset.hasInstance=String(!0))})})}filterChanged(){this.ensureFocusedElementVisible()}ensureActivePageVisible(){let e=document.querySelector(".tsd-navigation .current"),n=e?.parentElement;for(;n&&!n.classList.contains(".tsd-navigation");)n instanceof HTMLDetailsElement&&(n.open=!0),n=n.parentElement;if(e){let r=e.getBoundingClientRect().top-document.documentElement.clientHeight/4;document.querySelector(".site-menu").scrollTop=r}}ensureFocusedElementVisible(){if(this.alwaysVisibleMember&&(this.alwaysVisibleMember.classList.remove("always-visible"),this.alwaysVisibleMember.firstElementChild.remove(),this.alwaysVisibleMember=null),!location.hash)return;let e=document.getElementById(location.hash.substring(1));if(!e)return;let n=e.parentElement;for(;n&&n.tagName!=="SECTION";)n=n.parentElement;if(n&&n.offsetParent==null){this.alwaysVisibleMember=n,n.classList.add("always-visible");let r=document.createElement("p");r.classList.add("warning"),r.textContent="This member is normally hidden due to your filter settings.",n.prepend(r)}}listenForCodeCopies(){document.querySelectorAll("pre > button").forEach(e=>{let n;e.addEventListener("click",()=>{e.previousElementSibling instanceof HTMLElement&&navigator.clipboard.writeText(e.previousElementSibling.innerText.trim()),e.textContent="Copied!",e.classList.add("visible"),clearTimeout(n),n=setTimeout(()=>{e.classList.remove("visible"),n=setTimeout(()=>{e.textContent="Copy"},100)},1e3)})})}};var ie=(t,e=100)=>{let n;return()=>{clearTimeout(n),n=setTimeout(()=>t(),e)}};var de=De(ae());async function le(t,e){if(!window.searchData)return;let n=await fetch(window.searchData),r=new Blob([await n.arrayBuffer()]).stream().pipeThrough(new DecompressionStream("gzip")),i=await new Response(r).json();t.data=i,t.index=de.Index.load(i.index),e.classList.remove("loading"),e.classList.add("ready")}function he(){let t=document.getElementById("tsd-search");if(!t)return;let e={base:t.dataset.base+"/"},n=document.getElementById("tsd-search-script");t.classList.add("loading"),n&&(n.addEventListener("error",()=>{t.classList.remove("loading"),t.classList.add("failure")}),n.addEventListener("load",()=>{le(e,t)}),le(e,t));let r=document.querySelector("#tsd-search input"),i=document.querySelector("#tsd-search .results");if(!r||!i)throw new Error("The input field or the result list wrapper was not found");let s=!1;i.addEventListener("mousedown",()=>s=!0),i.addEventListener("mouseup",()=>{s=!1,t.classList.remove("has-focus")}),r.addEventListener("focus",()=>t.classList.add("has-focus")),r.addEventListener("blur",()=>{s||(s=!1,t.classList.remove("has-focus"))}),Ae(t,i,r,e)}function Ae(t,e,n,r){n.addEventListener("input",ie(()=>{Ne(t,e,n,r)},200));let i=!1;n.addEventListener("keydown",s=>{i=!0,s.key=="Enter"?Ve(e,n):s.key=="Escape"?n.blur():s.key=="ArrowUp"?ue(e,-1):s.key==="ArrowDown"?ue(e,1):i=!1}),n.addEventListener("keypress",s=>{i&&s.preventDefault()}),document.body.addEventListener("keydown",s=>{s.altKey||s.ctrlKey||s.metaKey||!n.matches(":focus")&&s.key==="/"&&(n.focus(),s.preventDefault())})}function Ne(t,e,n,r){if(!r.index||!r.data)return;e.textContent="";let i=n.value.trim(),s=i?r.index.search(`*${i}*`):[];for(let o=0;oa.score-o.score);for(let o=0,a=Math.min(10,s.length);o`,d=ce(l.name,i);globalThis.DEBUG_SEARCH_WEIGHTS&&(d+=` (score: ${s[o].score.toFixed(2)})`),l.parent&&(d=` + ${ce(l.parent,i)}.${d}`);let v=document.createElement("li");v.classList.value=l.classes??"";let f=document.createElement("a");f.href=r.base+l.url,f.innerHTML=u+d,v.append(f),e.appendChild(v)}}function ue(t,e){let n=t.querySelector(".current");if(!n)n=t.querySelector(e==1?"li:first-child":"li:last-child"),n&&n.classList.add("current");else{let r=n;if(e===1)do r=r.nextElementSibling??void 0;while(r instanceof HTMLElement&&r.offsetParent==null);else do r=r.previousElementSibling??void 0;while(r instanceof HTMLElement&&r.offsetParent==null);r&&(n.classList.remove("current"),r.classList.add("current"))}}function Ve(t,e){let n=t.querySelector(".current");if(n||(n=t.querySelector("li:first-child")),n){let r=n.querySelector("a");r&&(window.location.href=r.href),e.blur()}}function ce(t,e){if(e==="")return t;let n=t.toLocaleLowerCase(),r=e.toLocaleLowerCase(),i=[],s=0,o=n.indexOf(r);for(;o!=-1;)i.push(K(t.substring(s,o)),`${K(t.substring(o,o+r.length))}`),s=o+r.length,o=n.indexOf(r,s);return i.push(K(t.substring(s))),i.join("")}var Be={"&":"&","<":"<",">":">","'":"'",'"':"""};function K(t){return t.replace(/[&<>"'"]/g,e=>Be[e])}var C=class{constructor(e){this.el=e.el,this.app=e.app}};var F="mousedown",pe="mousemove",B="mouseup",J={x:0,y:0},fe=!1,ee=!1,He=!1,D=!1,me=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);document.documentElement.classList.add(me?"is-mobile":"not-mobile");me&&"ontouchstart"in document.documentElement&&(He=!0,F="touchstart",pe="touchmove",B="touchend");document.addEventListener(F,t=>{ee=!0,D=!1;let e=F=="touchstart"?t.targetTouches[0]:t;J.y=e.pageY||0,J.x=e.pageX||0});document.addEventListener(pe,t=>{if(ee&&!D){let e=F=="touchstart"?t.targetTouches[0]:t,n=J.x-(e.pageX||0),r=J.y-(e.pageY||0);D=Math.sqrt(n*n+r*r)>10}});document.addEventListener(B,()=>{ee=!1});document.addEventListener("click",t=>{fe&&(t.preventDefault(),t.stopImmediatePropagation(),fe=!1)});var X=class extends C{constructor(n){super(n);this.className=this.el.dataset.toggle||"",this.el.addEventListener(B,r=>this.onPointerUp(r)),this.el.addEventListener("click",r=>r.preventDefault()),document.addEventListener(F,r=>this.onDocumentPointerDown(r)),document.addEventListener(B,r=>this.onDocumentPointerUp(r))}setActive(n){if(this.active==n)return;this.active=n,document.documentElement.classList.toggle("has-"+this.className,n),this.el.classList.toggle("active",n);let r=(this.active?"to-has-":"from-has-")+this.className;document.documentElement.classList.add(r),setTimeout(()=>document.documentElement.classList.remove(r),500)}onPointerUp(n){D||(this.setActive(!0),n.preventDefault())}onDocumentPointerDown(n){if(this.active){if(n.target.closest(".col-sidebar, .tsd-filter-group"))return;this.setActive(!1)}}onDocumentPointerUp(n){if(!D&&this.active&&n.target.closest(".col-sidebar")){let r=n.target.closest("a");if(r){let i=window.location.href;i.indexOf("#")!=-1&&(i=i.substring(0,i.indexOf("#"))),r.href.substring(0,i.length)==i&&setTimeout(()=>this.setActive(!1),250)}}}};var te;try{te=localStorage}catch{te={getItem(){return null},setItem(){}}}var Q=te;var ve=document.head.appendChild(document.createElement("style"));ve.dataset.for="filters";var Y=class extends C{constructor(n){super(n);this.key=`filter-${this.el.name}`,this.value=this.el.checked,this.el.addEventListener("change",()=>{this.setLocalStorage(this.el.checked)}),this.setLocalStorage(this.fromLocalStorage()),ve.innerHTML+=`html:not(.${this.key}) .tsd-is-${this.el.name} { display: none; } +`}fromLocalStorage(){let n=Q.getItem(this.key);return n?n==="true":this.el.checked}setLocalStorage(n){Q.setItem(this.key,n.toString()),this.value=n,this.handleValueChange()}handleValueChange(){this.el.checked=this.value,document.documentElement.classList.toggle(this.key,this.value),this.app.filterChanged(),document.querySelectorAll(".tsd-index-section").forEach(n=>{n.style.display="block";let r=Array.from(n.querySelectorAll(".tsd-index-link")).every(i=>i.offsetParent==null);n.style.display=r?"none":"block"})}};var Z=class extends C{constructor(n){super(n);this.summary=this.el.querySelector(".tsd-accordion-summary"),this.icon=this.summary.querySelector("svg"),this.key=`tsd-accordion-${this.summary.dataset.key??this.summary.textContent.trim().replace(/\s+/g,"-").toLowerCase()}`;let r=Q.getItem(this.key);this.el.open=r?r==="true":this.el.open,this.el.addEventListener("toggle",()=>this.update());let i=this.summary.querySelector("a");i&&i.addEventListener("click",()=>{location.assign(i.href)}),this.update()}update(){this.icon.style.transform=`rotate(${this.el.open?0:-90}deg)`,Q.setItem(this.key,this.el.open.toString())}};function ge(t){let e=Q.getItem("tsd-theme")||"os";t.value=e,ye(e),t.addEventListener("change",()=>{Q.setItem("tsd-theme",t.value),ye(t.value)})}function ye(t){document.documentElement.dataset.theme=t}var Le;function be(){let t=document.getElementById("tsd-nav-script");t&&(t.addEventListener("load",xe),xe())}async function xe(){let t=document.getElementById("tsd-nav-container");if(!t||!window.navigationData)return;let n=await(await fetch(window.navigationData)).arrayBuffer(),r=new Blob([n]).stream().pipeThrough(new DecompressionStream("gzip")),i=await new Response(r).json();Le=t.dataset.base+"/",t.innerHTML="";for(let s of i)we(s,t,[]);window.app.createComponents(t),window.app.ensureActivePageVisible()}function we(t,e,n){let r=e.appendChild(document.createElement("li"));if(t.children){let i=[...n,t.text],s=r.appendChild(document.createElement("details"));s.className=t.class?`${t.class} tsd-index-accordion`:"tsd-index-accordion",s.dataset.key=i.join("$");let o=s.appendChild(document.createElement("summary"));o.className="tsd-accordion-summary",o.innerHTML='',Ee(t,o);let a=s.appendChild(document.createElement("div"));a.className="tsd-accordion-details";let l=a.appendChild(document.createElement("ul"));l.className="tsd-nested-navigation";for(let u of t.children)we(u,l,i)}else Ee(t,r,t.class)}function Ee(t,e,n){if(t.path){let r=e.appendChild(document.createElement("a"));r.href=Le+t.path,n&&(r.className=n),location.href===r.href&&r.classList.add("current"),t.kind&&(r.innerHTML=``),r.appendChild(document.createElement("span")).textContent=t.text}else e.appendChild(document.createElement("span")).textContent=t.text}G(X,"a[data-toggle]");G(Z,".tsd-index-accordion");G(Y,".tsd-filter-item input[type=checkbox]");var Se=document.getElementById("tsd-theme");Se&&ge(Se);var je=new U;Object.defineProperty(window,"app",{value:je});he();be();})(); /*! Bundled license information: lunr/lunr.js: diff --git a/dhkem-x25519/docs/assets/navigation.js b/dhkem-x25519/docs/assets/navigation.js new file mode 100644 index 000000000..218c9b53d --- /dev/null +++ b/dhkem-x25519/docs/assets/navigation.js @@ -0,0 +1 @@ +window.navigationData = "data:application/octet-stream;base64,H4sIAAAAAAAAA4uuVipJrShRslJyychOzY0wMjU1tPTITkkLzkg0MjVT0lEqSCzJAEon5yQWF6cW62NVppdRkpsDVJudmZeiZGVoZFEbCwBiI73yWQAAAA==" \ No newline at end of file diff --git a/dhkem-x25519/docs/assets/search.js b/dhkem-x25519/docs/assets/search.js index 1402a230d..cd93ea657 100644 --- a/dhkem-x25519/docs/assets/search.js +++ b/dhkem-x25519/docs/assets/search.js @@ -1 +1 @@ -window.searchData = JSON.parse("{\"rows\":[{\"kind\":128,\"name\":\"DhkemX25519HkdfSha256\",\"url\":\"classes/DhkemX25519HkdfSha256.html\",\"classes\":\"\"},{\"kind\":512,\"name\":\"constructor\",\"url\":\"classes/DhkemX25519HkdfSha256.html#constructor\",\"classes\":\"\",\"parent\":\"DhkemX25519HkdfSha256\"},{\"kind\":1024,\"name\":\"id\",\"url\":\"classes/DhkemX25519HkdfSha256.html#id\",\"classes\":\"\",\"parent\":\"DhkemX25519HkdfSha256\"},{\"kind\":1024,\"name\":\"secretSize\",\"url\":\"classes/DhkemX25519HkdfSha256.html#secretSize\",\"classes\":\"\",\"parent\":\"DhkemX25519HkdfSha256\"},{\"kind\":1024,\"name\":\"encSize\",\"url\":\"classes/DhkemX25519HkdfSha256.html#encSize\",\"classes\":\"\",\"parent\":\"DhkemX25519HkdfSha256\"},{\"kind\":1024,\"name\":\"publicKeySize\",\"url\":\"classes/DhkemX25519HkdfSha256.html#publicKeySize\",\"classes\":\"\",\"parent\":\"DhkemX25519HkdfSha256\"},{\"kind\":1024,\"name\":\"privateKeySize\",\"url\":\"classes/DhkemX25519HkdfSha256.html#privateKeySize\",\"classes\":\"\",\"parent\":\"DhkemX25519HkdfSha256\"},{\"kind\":1024,\"name\":\"_prim\",\"url\":\"classes/DhkemX25519HkdfSha256.html#_prim\",\"classes\":\"tsd-is-protected tsd-is-inherited\",\"parent\":\"DhkemX25519HkdfSha256\"},{\"kind\":1024,\"name\":\"_kdf\",\"url\":\"classes/DhkemX25519HkdfSha256.html#_kdf\",\"classes\":\"tsd-is-protected tsd-is-inherited\",\"parent\":\"DhkemX25519HkdfSha256\"},{\"kind\":2048,\"name\":\"serializePublicKey\",\"url\":\"classes/DhkemX25519HkdfSha256.html#serializePublicKey\",\"classes\":\"tsd-is-inherited\",\"parent\":\"DhkemX25519HkdfSha256\"},{\"kind\":2048,\"name\":\"deserializePublicKey\",\"url\":\"classes/DhkemX25519HkdfSha256.html#deserializePublicKey\",\"classes\":\"tsd-is-inherited\",\"parent\":\"DhkemX25519HkdfSha256\"},{\"kind\":2048,\"name\":\"serializePrivateKey\",\"url\":\"classes/DhkemX25519HkdfSha256.html#serializePrivateKey\",\"classes\":\"tsd-is-inherited\",\"parent\":\"DhkemX25519HkdfSha256\"},{\"kind\":2048,\"name\":\"deserializePrivateKey\",\"url\":\"classes/DhkemX25519HkdfSha256.html#deserializePrivateKey\",\"classes\":\"tsd-is-inherited\",\"parent\":\"DhkemX25519HkdfSha256\"},{\"kind\":2048,\"name\":\"importKey\",\"url\":\"classes/DhkemX25519HkdfSha256.html#importKey\",\"classes\":\"tsd-is-inherited\",\"parent\":\"DhkemX25519HkdfSha256\"},{\"kind\":2048,\"name\":\"generateKeyPair\",\"url\":\"classes/DhkemX25519HkdfSha256.html#generateKeyPair\",\"classes\":\"tsd-is-inherited\",\"parent\":\"DhkemX25519HkdfSha256\"},{\"kind\":2048,\"name\":\"deriveKeyPair\",\"url\":\"classes/DhkemX25519HkdfSha256.html#deriveKeyPair\",\"classes\":\"tsd-is-inherited\",\"parent\":\"DhkemX25519HkdfSha256\"},{\"kind\":2048,\"name\":\"encap\",\"url\":\"classes/DhkemX25519HkdfSha256.html#encap\",\"classes\":\"tsd-is-inherited\",\"parent\":\"DhkemX25519HkdfSha256\"},{\"kind\":2048,\"name\":\"decap\",\"url\":\"classes/DhkemX25519HkdfSha256.html#decap\",\"classes\":\"tsd-is-inherited\",\"parent\":\"DhkemX25519HkdfSha256\"}],\"index\":{\"version\":\"2.3.9\",\"fields\":[\"name\",\"comment\"],\"fieldVectors\":[[\"name/0\",[0,25.39]],[\"comment/0\",[]],[\"name/1\",[1,25.39]],[\"comment/1\",[]],[\"name/2\",[2,25.39]],[\"comment/2\",[]],[\"name/3\",[3,25.39]],[\"comment/3\",[]],[\"name/4\",[4,25.39]],[\"comment/4\",[]],[\"name/5\",[5,25.39]],[\"comment/5\",[]],[\"name/6\",[6,25.39]],[\"comment/6\",[]],[\"name/7\",[7,25.39]],[\"comment/7\",[]],[\"name/8\",[8,25.39]],[\"comment/8\",[]],[\"name/9\",[9,25.39]],[\"comment/9\",[]],[\"name/10\",[10,25.39]],[\"comment/10\",[]],[\"name/11\",[11,25.39]],[\"comment/11\",[]],[\"name/12\",[12,25.39]],[\"comment/12\",[]],[\"name/13\",[13,25.39]],[\"comment/13\",[]],[\"name/14\",[14,25.39]],[\"comment/14\",[]],[\"name/15\",[15,25.39]],[\"comment/15\",[]],[\"name/16\",[16,25.39]],[\"comment/16\",[]],[\"name/17\",[17,25.39]],[\"comment/17\",[]]],\"invertedIndex\":[[\"_kdf\",{\"_index\":8,\"name\":{\"8\":{}},\"comment\":{}}],[\"_prim\",{\"_index\":7,\"name\":{\"7\":{}},\"comment\":{}}],[\"constructor\",{\"_index\":1,\"name\":{\"1\":{}},\"comment\":{}}],[\"decap\",{\"_index\":17,\"name\":{\"17\":{}},\"comment\":{}}],[\"derivekeypair\",{\"_index\":15,\"name\":{\"15\":{}},\"comment\":{}}],[\"deserializeprivatekey\",{\"_index\":12,\"name\":{\"12\":{}},\"comment\":{}}],[\"deserializepublickey\",{\"_index\":10,\"name\":{\"10\":{}},\"comment\":{}}],[\"dhkemx25519hkdfsha256\",{\"_index\":0,\"name\":{\"0\":{}},\"comment\":{}}],[\"encap\",{\"_index\":16,\"name\":{\"16\":{}},\"comment\":{}}],[\"encsize\",{\"_index\":4,\"name\":{\"4\":{}},\"comment\":{}}],[\"generatekeypair\",{\"_index\":14,\"name\":{\"14\":{}},\"comment\":{}}],[\"id\",{\"_index\":2,\"name\":{\"2\":{}},\"comment\":{}}],[\"importkey\",{\"_index\":13,\"name\":{\"13\":{}},\"comment\":{}}],[\"privatekeysize\",{\"_index\":6,\"name\":{\"6\":{}},\"comment\":{}}],[\"publickeysize\",{\"_index\":5,\"name\":{\"5\":{}},\"comment\":{}}],[\"secretsize\",{\"_index\":3,\"name\":{\"3\":{}},\"comment\":{}}],[\"serializeprivatekey\",{\"_index\":11,\"name\":{\"11\":{}},\"comment\":{}}],[\"serializepublickey\",{\"_index\":9,\"name\":{\"9\":{}},\"comment\":{}}]],\"pipeline\":[]}}"); \ No newline at end of file +window.searchData = "data:application/octet-stream;base64,H4sIAAAAAAAAA7VXy27bMBD8lYK9Ko6XkmzL5x5a9BIgQFHAMAJVYmrCeoFS0qSG/71LSTZJhWwrx7oYIDWzO97h8nEgovxVk/XmQPa8SMka6MojRZwzsiafdnuWf6dhCNHnffp4v4tpuCAeeRIZfk2yuK5ZfWtFzXZNniG0ByGcHL1TjhDoOUdSFnUjnpKmFCMifzRpWhaPVLFgReOUr2TAnAZnHTwdk75FXyFrzRLBmnv+m43JbrCuoIIVyVgJinKF/NXTj4wnX9nrWBVD4jW0CP4cN+wSMUPmFdQ8YNB8jIgTQeVu6vSG1zeVKBuWNCz90E/wYscEx4nLxSFilLYOP5E0Og9WWl8JHmdow91phYzrLwv7jez3q0zZ+3Q6+BMoVXnOi/yygur0iSt6kVJXgAm08rwqRTNSn06aQNNPVjDR/em7mI86kd9SJ/EXTblE3ZA4gTY8EuNq5BnaEiap00gtJ8K7tGw9glLYC1kfyDMTNS8LBNOZP4uQ/chZlsqrZicSc5V5LuNt+2/fmLzOSUQHuZ0TbzP3aDjzo+3W25wI7Xw70aIAR2BBgYGiOKIWFDVQPo58C8o3UAGOAgsqMFAhjkILKjRQeJ/eLCyohYFa4mhpQS0N1ApHKwtqZaDQi01kQUVmVWWRwVZ9GJS/rb/VANMBkKUGmwdgmgCy2mCzAUwfQBYcbE6AaQXImoPNDDDdAFl2sPkBpiEgKw82S6DzpO0FbALsnC9dT+Cq7m5AB/LQt8m5YQ9khT/Ho2oKOZJh+wud4iwVZ+ngGI8jxQTFBAez3wY0jpYOXPm6zXXPXqt2c9XYocYOnezzkdtfoffyeNOiUC0K/Y8o7V1oGGSuBZm7gsh97aXd13ZoVd0/eFUULYgrRr+ra5kXWuaFm1W3rwbFCxQtcLBOZ66t9BodXHz5jFUUrcyuKnfXj2FpfS2V72Aqa4f/UyuPqzpnR4dcbX25llf3WB4SNckuxf9alXo7ufrp72syUhEiWwDcQypesYwXiNlsj8c/xUjW9a4RAAA="; \ No newline at end of file diff --git a/dhkem-x25519/docs/assets/style.css b/dhkem-x25519/docs/assets/style.css index 258146fc0..108428c3f 100644 --- a/dhkem-x25519/docs/assets/style.css +++ b/dhkem-x25519/docs/assets/style.css @@ -910,8 +910,9 @@ a.tsd-index-link { box-shadow: 0 0 4px rgba(0, 0, 0, 0.25); } #tsd-search .results li { - padding: 0 10px; background-color: var(--color-background); + line-height: initial; + padding: 4px; } #tsd-search .results li:nth-child(even) { background-color: var(--color-background-secondary); @@ -924,7 +925,10 @@ a.tsd-index-link { background-color: var(--color-accent); } #tsd-search .results a { - display: block; + display: flex; + align-items: center; + padding: 0.25rem; + box-sizing: border-box; } #tsd-search .results a:before { top: 10px; @@ -1134,7 +1138,7 @@ img { } .deprecated { - text-decoration: line-through; + text-decoration: line-through !important; } .warning { diff --git a/dhkem-x25519/docs/classes/DhkemX25519HkdfSha256.html b/dhkem-x25519/docs/classes/DhkemX25519HkdfSha256.html index bd58ec0be..2bdf87b66 100644 --- a/dhkem-x25519/docs/classes/DhkemX25519HkdfSha256.html +++ b/dhkem-x25519/docs/classes/DhkemX25519HkdfSha256.html @@ -1,13 +1,13 @@ -DhkemX25519HkdfSha256 | @hpke/dhkem-x25519
    +DhkemX25519HkdfSha256 | @hpke/dhkem-x25519
    -
    +
    @@ -39,19 +39,19 @@

    Hierarchy

    • DhkemX25519HkdfSha256
    +
  • Defined in src/kems/dhkemX25519.ts:47
  • - +

    Constructors

    -

    Properties

    -
    _kdf +
    _kdf _prim encSize id @@ -61,7 +61,7 @@

    Properties

    Methods

    -
    decap +
    decap deriveKeyPair deserializePrivateKey deserializePublicKey @@ -74,14 +74,14 @@

    Methods

    Constructors

    - +
    +
  • Defined in src/kems/dhkemX25519.ts:59
  • Properties

    @@ -89,13 +89,13 @@
    +
  • Defined in src/kems/dhkem.ts:41
  • _prim: DhkemPrimitives
    +
  • Defined in src/kems/dhkem.ts:40
  • encSize: number = 32
    @@ -104,7 +104,7 @@
    +
  • Defined in src/kems/dhkemX25519.ts:53
  • id: KemId = KemId.DhkemX25519HkdfSha256
    @@ -113,7 +113,7 @@
    +
  • Defined in src/kems/dhkemX25519.ts:49
  • privateKeySize: number = 32
    @@ -122,7 +122,7 @@
    +
  • Defined in src/kems/dhkemX25519.ts:57
  • publicKeySize: number = 32
    @@ -131,7 +131,7 @@
    +
  • Defined in src/kems/dhkemX25519.ts:55
  • secretSize: number = 32
    @@ -140,7 +140,7 @@
    +
  • Defined in src/kems/dhkemX25519.ts:51
  • Methods

    @@ -156,7 +156,7 @@
    params: Returns Promise<ArrayBuffer>
    +
  • Defined in src/kems/dhkem.ts:148
    • @@ -170,7 +170,7 @@
      ikm: Returns Promise<CryptoKeyPair>
    +
  • Defined in src/kems/dhkem.ts:80
    • @@ -184,7 +184,7 @@
      key: Returns Promise<CryptoKey>
    +
  • Defined in src/kems/dhkem.ts:64
    • @@ -198,7 +198,7 @@
      key: Returns Promise<CryptoKey>
    +
  • Defined in src/kems/dhkem.ts:56
    • @@ -212,7 +212,7 @@
      params: Returns Promise<{
          enc: ArrayBuffer;
          sharedSecret: ArrayBuffer;
      }>
    +
  • Defined in src/kems/dhkem.ts:87
  • +
  • Defined in src/kems/dhkem.ts:76
    • @@ -239,7 +239,7 @@
      isPublic: Returns Promise<CryptoKey>
    +
  • Defined in src/kems/dhkem.ts:68
    • @@ -253,7 +253,7 @@
      key: Returns Promise<ArrayBuffer>
    +
  • Defined in src/kems/dhkem.ts:60
    • @@ -267,20 +267,20 @@
      key: Returns Promise<ArrayBuffer>
    +
  • Defined in src/kems/dhkem.ts:52
  • @@ -305,9 +305,9 @@

    serializePrivateKey
  • serializePublicKey
  • +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/dhkem-x25519/docs/index.html b/dhkem-x25519/docs/index.html index 4cf5954ef..40626064c 100644 --- a/dhkem-x25519/docs/index.html +++ b/dhkem-x25519/docs/index.html @@ -1,13 +1,13 @@ -@hpke/dhkem-x25519
    +@hpke/dhkem-x25519
    -
    +
    @@ -70,15 +70,15 @@

    @hpke/dhkem-x25519

    @@ -105,9 +105,9 @@

    Browsers
  • Contributing
  • +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/dhkem-x25519/docs/modules.html b/dhkem-x25519/docs/modules.html index 09a00d0b4..da14a4cad 100644 --- a/dhkem-x25519/docs/modules.html +++ b/dhkem-x25519/docs/modules.html @@ -1,13 +1,13 @@ -@hpke/dhkem-x25519
    +@hpke/dhkem-x25519
    -
    +
    @@ -17,27 +17,27 @@

    @hpke/dhkem-x25519

    Index

    Classes

    -
    +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/dhkem-x25519/src/hpke-dhkem-x25519.js b/dhkem-x25519/src/hpke-dhkem-x25519.js index 44c8f1565..0c6fd7f28 100644 --- a/dhkem-x25519/src/hpke-dhkem-x25519.js +++ b/dhkem-x25519/src/hpke-dhkem-x25519.js @@ -1,6 +1,9 @@ -var mr={NotAssigned:0,DhkemP256HkdfSha256:16,DhkemP384HkdfSha384:17,DhkemP521HkdfSha512:18,DhkemSecp256k1HkdfSha256:19,DhkemX25519HkdfSha256:32,DhkemX448HkdfSha512:33,HybridkemX25519Kyber768:48},te=mr,Er={HkdfSha256:1,HkdfSha384:2,HkdfSha512:3},ee=Er;function re(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function _r(e){if(typeof e!="boolean")throw new Error(`Expected boolean, not ${e}`)}function Te(e,...t){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw new Error(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function Br(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");re(e.outputLen),re(e.blockLen)}function Ar(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function vr(e,t){Te(e);let r=t.outputLen;if(e.lengthe instanceof Uint8Array;var Nt=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),Y=(e,t)=>e<<32-t|e>>>t,Ir=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!Ir)throw new Error("Non little-endian hardware is not supported");var Dn=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function ne(e){if(typeof e!="string")throw new Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function St(e){if(typeof e=="string"&&(e=ne(e)),!Ce(e))throw new Error(`expected Uint8Array, got ${typeof e}`);return e}function Ne(...e){let t=new Uint8Array(e.reduce((n,o)=>n+o.length,0)),r=0;return e.forEach(n=>{if(!Ce(n))throw new Error("Uint8Array expected");t.set(n,r),r+=n.length}),t}var xt=class{clone(){return this._cloneInto()}};function ft(e){let t=n=>e().update(St(n)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function oe(e=32){if(Ct&&typeof Ct.getRandomValues=="function")return Ct.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}var Rt=class extends xt{constructor(t,r){super(),this.finished=!1,this.destroyed=!1,et.hash(t);let n=St(r);if(this.iHash=t.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let o=this.blockLen,i=new Uint8Array(o);i.set(n.length>o?t.create().update(n).digest():n);for(let s=0;snew Rt(e,t).update(r).digest();ie.create=(e,t)=>new Rt(e,t);function Lr(e,t,r,n){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,r,n);let o=BigInt(32),i=BigInt(4294967295),s=Number(r>>o&i),a=Number(r&i),c=n?4:0,u=n?0:4;e.setUint32(t+c,s,n),e.setUint32(t+u,a,n)}var wt=class extends xt{constructor(t,r,n,o){super(),this.blockLen=t,this.outputLen=r,this.padOffset=n,this.isLE=o,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=Nt(this.buffer)}update(t){et.exists(this);let{view:r,buffer:n,blockLen:o}=this;t=St(t);let i=t.length;for(let s=0;so-s&&(this.process(n,0),s=0);for(let h=s;hf.length)throw new Error("_sha2: outputLen bigger than state");for(let h=0;he&t^~e&r,Ur=(e,t,r)=>e&t^e&r^t&r,Hr=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),ut=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),lt=new Uint32Array(64),Dt=class extends wt{constructor(){super(64,32,8,!1),this.A=ut[0]|0,this.B=ut[1]|0,this.C=ut[2]|0,this.D=ut[3]|0,this.E=ut[4]|0,this.F=ut[5]|0,this.G=ut[6]|0,this.H=ut[7]|0}get(){let{A:t,B:r,C:n,D:o,E:i,F:s,G:a,H:c}=this;return[t,r,n,o,i,s,a,c]}set(t,r,n,o,i,s,a,c){this.A=t|0,this.B=r|0,this.C=n|0,this.D=o|0,this.E=i|0,this.F=s|0,this.G=a|0,this.H=c|0}process(t,r){for(let h=0;h<16;h++,r+=4)lt[h]=t.getUint32(r,!1);for(let h=16;h<64;h++){let b=lt[h-15],A=lt[h-2],I=Y(b,7)^Y(b,18)^b>>>3,L=Y(A,17)^Y(A,19)^A>>>10;lt[h]=L+lt[h-7]+I+lt[h-16]|0}let{A:n,B:o,C:i,D:s,E:a,F:c,G:u,H:f}=this;for(let h=0;h<64;h++){let b=Y(a,6)^Y(a,11)^Y(a,25),A=f+b+Pr(a,c,u)+Hr[h]+lt[h]|0,L=(Y(n,2)^Y(n,13)^Y(n,22))+Ur(n,o,i)|0;f=u,u=c,c=a,a=s+A|0,s=i,i=o,o=n,n=A+L|0}n=n+this.A|0,o=o+this.B|0,i=i+this.C|0,s=s+this.D|0,a=a+this.E|0,c=c+this.F|0,u=u+this.G|0,f=f+this.H|0,this.set(n,o,i,s,a,c,u,f)}roundClean(){lt.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}},se=class extends Dt{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}},Re=ft(()=>new Dt),Xn=ft(()=>new se);var Kr={},De=kr(globalThis,Kr);function kr(e,t){return new Proxy(e,{get(r,n,o){return n in t?t[n]:e[n]},set(r,n,o){return n in t&&delete t[n],e[n]=o,!0},deleteProperty(r,n){let o=!1;return n in t&&(delete t[n],o=!0),n in e&&(delete e[n],o=!0),o},ownKeys(r){let n=Reflect.ownKeys(e),o=Reflect.ownKeys(t),i=new Set(o);return[...n.filter(s=>!i.has(s)),...o]},defineProperty(r,n,o){return n in t&&delete t[n],Reflect.defineProperty(e,n,o),!0},getOwnPropertyDescriptor(r,n){return n in t?Reflect.getOwnPropertyDescriptor(t,n):Reflect.getOwnPropertyDescriptor(e,n)},has(r,n){return n in t||n in e}})}var ce=class extends Error{constructor(t){let r;t instanceof Error?r=t.message:typeof t=="string"?r=t:r="",super(r),this.name=this.constructor.name}},rt=class extends ce{},gt=class extends rt{};var mt=class extends rt{},bt=class extends rt{},zt=class extends rt{},qt=class extends rt{};var Mt=class extends rt{},Et=class extends rt{};async function Tr(){if(De!==void 0&&globalThis.crypto!==void 0)return globalThis.crypto.subtle;try{let{webcrypto:e}=await import("crypto");return e.subtle}catch(e){throw new Et(e)}}var Gt=class{constructor(){Object.defineProperty(this,"_api",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}async _setup(){this._api===void 0&&(this._api=await Tr())}};var nt=new Uint8Array(0);var ze=new Uint8Array([72,80,75,69,45,118,49]),ae=class extends Gt{constructor(){super(),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:ee.HkdfSha256}),Object.defineProperty(this,"hashSize",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_suiteId",{enumerable:!0,configurable:!0,writable:!0,value:nt}),Object.defineProperty(this,"algHash",{enumerable:!0,configurable:!0,writable:!0,value:{name:"HMAC",hash:"SHA-256",length:256}})}init(t){this._suiteId=t}buildLabeledIkm(t,r){this._checkInit();let n=new Uint8Array(7+this._suiteId.byteLength+t.byteLength+r.byteLength);return n.set(ze,0),n.set(this._suiteId,7),n.set(t,7+this._suiteId.byteLength),n.set(r,7+this._suiteId.byteLength+t.byteLength),n}buildLabeledInfo(t,r,n){this._checkInit();let o=new Uint8Array(9+this._suiteId.byteLength+t.byteLength+r.byteLength);return o.set(new Uint8Array([0,n]),0),o.set(ze,2),o.set(this._suiteId,9),o.set(t,9+this._suiteId.byteLength),o.set(r,9+this._suiteId.byteLength+t.byteLength),o}async extract(t,r){if(await this._setup(),t.byteLength===0&&(t=new ArrayBuffer(this.hashSize)),t.byteLength!==this.hashSize)throw new gt("The salt length must be the same as the hashSize");let n=await this._api.importKey("raw",t,this.algHash,!1,["sign"]);return await this._api.sign("HMAC",n,r)}async expand(t,r,n){await this._setup();let o=await this._api.importKey("raw",t,this.algHash,!1,["sign"]),i=new ArrayBuffer(n),s=new Uint8Array(i),a=nt,c=new Uint8Array(r),u=new Uint8Array(1);if(n>255*this.hashSize)throw new Error("Entropy limit reached");let f=new Uint8Array(this.hashSize+c.length+1);for(let h=1,b=0;b=a.length?(s.set(a,b),b+=a.length):(s.set(a.slice(0,s.length-b),b),b+=s.length-b);return i}async extractAndExpand(t,r,n,o){await this._setup();let i=await this._api.importKey("raw",r,"HKDF",!1,["deriveBits"]);return await this._api.deriveBits({name:"HKDF",hash:this.algHash.hash,salt:t,info:n},i,o*8)}async labeledExtract(t,r,n){return await this.extract(t,this.buildLabeledIkm(r,n))}async labeledExpand(t,r,n,o){return await this.expand(t,this.buildLabeledInfo(r,n,o),o)}_checkInit(){if(this._suiteId===nt)throw new Error("Not initialized. Call init()")}},jt=class extends ae{constructor(){super(...arguments),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:ee.HkdfSha256}),Object.defineProperty(this,"hashSize",{enumerable:!0,configurable:!0,writable:!0,value:32}),Object.defineProperty(this,"algHash",{enumerable:!0,configurable:!0,writable:!0,value:{name:"HMAC",hash:"SHA-256",length:256}})}};var Ft=class extends jt{async extract(t,r){if(await this._setup(),t.byteLength===0&&(t=new ArrayBuffer(this.hashSize)),t.byteLength!==this.hashSize)return ie(Re,new Uint8Array(t),new Uint8Array(r));let n=await this._api.importKey("raw",t,this.algHash,!1,["sign"]);return await this._api.sign("HMAC",n,r)}};var qe=new Uint8Array([75,69,77,0,0]);var _t=e=>typeof e=="object"&&e!==null&&typeof e.privateKey=="object"&&typeof e.publicKey=="object";function Me(e,t){if(t<=0)throw new Error("i2Osp: too small size");if(e>=256**t)throw new Error("i2Osp: too large integer");let r=new Uint8Array(t);for(let n=0;n>8;return r}function It(e,t){let r=new Uint8Array(e.length+t.length);return r.set(e,0),r.set(t,e.length),r}function fe(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r=atob(t),n=new Uint8Array(r.length);for(let o=0;o8192)throw new gt("Too long ikm");return await this._prim.deriveKeyPair(t)}async encap(t){let r;t.ekm===void 0?r=await this.generateKeyPair():_t(t.ekm)?r=t.ekm:r=await this.deriveKeyPair(t.ekm);let n=await this._prim.serializePublicKey(r.publicKey),o=await this._prim.serializePublicKey(t.recipientPublicKey);try{let i;if(t.senderKey===void 0)i=new Uint8Array(await this._prim.dh(r.privateKey,t.recipientPublicKey));else{let c=_t(t.senderKey)?t.senderKey.privateKey:t.senderKey,u=new Uint8Array(await this._prim.dh(r.privateKey,t.recipientPublicKey)),f=new Uint8Array(await this._prim.dh(c,t.recipientPublicKey));i=It(u,f)}let s;if(t.senderKey===void 0)s=It(new Uint8Array(n),new Uint8Array(o));else{let c=_t(t.senderKey)?t.senderKey.publicKey:await this._prim.derivePublicKey(t.senderKey),u=await this._prim.serializePublicKey(c);s=Dr(new Uint8Array(n),new Uint8Array(o),new Uint8Array(u))}let a=await this._generateSharedSecret(i,s);return{enc:n,sharedSecret:a}}catch(i){throw new zt(i)}}async decap(t){let r=await this._prim.deserializePublicKey(t.enc),n=_t(t.recipientKey)?t.recipientKey.privateKey:t.recipientKey,o=_t(t.recipientKey)?t.recipientKey.publicKey:await this._prim.derivePublicKey(t.recipientKey),i=await this._prim.serializePublicKey(o);try{let s;if(t.senderPublicKey===void 0)s=new Uint8Array(await this._prim.dh(n,r));else{let c=new Uint8Array(await this._prim.dh(n,r)),u=new Uint8Array(await this._prim.dh(n,t.senderPublicKey));s=It(c,u)}let a;if(t.senderPublicKey===void 0)a=It(new Uint8Array(t.enc),new Uint8Array(i));else{let c=await this._prim.serializePublicKey(t.senderPublicKey);a=new Uint8Array(t.enc.byteLength+i.byteLength+c.byteLength),a.set(new Uint8Array(t.enc),0),a.set(new Uint8Array(i),t.enc.byteLength),a.set(new Uint8Array(c),t.enc.byteLength+i.byteLength)}return await this._generateSharedSecret(s,a)}catch(s){throw new qt(s)}}async _generateSharedSecret(t,r){let n=this._kdf.buildLabeledIkm(Nr,t),o=this._kdf.buildLabeledInfo(Rr,r,this.secretSize);return await this._kdf.extractAndExpand(nt,n,o,this.secretSize)}};var Vt=BigInt(4294967295),ue=BigInt(32);function Ge(e,t=!1){return t?{h:Number(e&Vt),l:Number(e>>ue&Vt)}:{h:Number(e>>ue&Vt)|0,l:Number(e&Vt)|0}}function zr(e,t=!1){let r=new Uint32Array(e.length),n=new Uint32Array(e.length);for(let o=0;oBigInt(e>>>0)<>>0),Mr=(e,t,r)=>e>>>r,Gr=(e,t,r)=>e<<32-r|t>>>r,jr=(e,t,r)=>e>>>r|t<<32-r,Fr=(e,t,r)=>e<<32-r|t>>>r,Zr=(e,t,r)=>e<<64-r|t>>>r-32,Vr=(e,t,r)=>e>>>r-32|t<<64-r,$r=(e,t)=>t,Xr=(e,t)=>e,Yr=(e,t,r)=>e<>>32-r,Wr=(e,t,r)=>t<>>32-r,Qr=(e,t,r)=>t<>>64-r,Jr=(e,t,r)=>e<>>64-r;function tn(e,t,r,n){let o=(t>>>0)+(n>>>0);return{h:e+r+(o/2**32|0)|0,l:o|0}}var en=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0),rn=(e,t,r,n)=>t+r+n+(e/2**32|0)|0,nn=(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0),on=(e,t,r,n,o)=>t+r+n+o+(e/2**32|0)|0,sn=(e,t,r,n,o)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(o>>>0),cn=(e,t,r,n,o,i)=>t+r+n+o+i+(e/2**32|0)|0,an={fromBig:Ge,split:zr,toBig:qr,shrSH:Mr,shrSL:Gr,rotrSH:jr,rotrSL:Fr,rotrBH:Zr,rotrBL:Vr,rotr32H:$r,rotr32L:Xr,rotlSH:Yr,rotlSL:Wr,rotlBH:Qr,rotlBL:Jr,add:tn,add3L:en,add3H:rn,add4L:nn,add4H:on,add5H:cn,add5L:sn},g=an;var[fn,un]=g.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e))),ht=new Uint32Array(80),dt=new Uint32Array(80),Bt=class extends wt{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){let{Ah:t,Al:r,Bh:n,Bl:o,Ch:i,Cl:s,Dh:a,Dl:c,Eh:u,El:f,Fh:h,Fl:b,Gh:A,Gl:I,Hh:L,Hl:S}=this;return[t,r,n,o,i,s,a,c,u,f,h,b,A,I,L,S]}set(t,r,n,o,i,s,a,c,u,f,h,b,A,I,L,S){this.Ah=t|0,this.Al=r|0,this.Bh=n|0,this.Bl=o|0,this.Ch=i|0,this.Cl=s|0,this.Dh=a|0,this.Dl=c|0,this.Eh=u|0,this.El=f|0,this.Fh=h|0,this.Fl=b|0,this.Gh=A|0,this.Gl=I|0,this.Hh=L|0,this.Hl=S|0}process(t,r){for(let d=0;d<16;d++,r+=4)ht[d]=t.getUint32(r),dt[d]=t.getUint32(r+=4);for(let d=16;d<80;d++){let m=ht[d-15]|0,x=dt[d-15]|0,N=g.rotrSH(m,x,1)^g.rotrSH(m,x,8)^g.shrSH(m,x,7),X=g.rotrSL(m,x,1)^g.rotrSL(m,x,8)^g.shrSL(m,x,7),K=ht[d-2]|0,O=dt[d-2]|0,q=g.rotrSH(K,O,19)^g.rotrBH(K,O,61)^g.shrSH(K,O,6),R=g.rotrSL(K,O,19)^g.rotrBL(K,O,61)^g.shrSL(K,O,6),Z=g.add4L(X,R,dt[d-7],dt[d-16]),T=g.add4H(Z,N,q,ht[d-7],ht[d-16]);ht[d]=T|0,dt[d]=Z|0}let{Ah:n,Al:o,Bh:i,Bl:s,Ch:a,Cl:c,Dh:u,Dl:f,Eh:h,El:b,Fh:A,Fl:I,Gh:L,Gl:S,Hh:z,Hl:F}=this;for(let d=0;d<80;d++){let m=g.rotrSH(h,b,14)^g.rotrSH(h,b,18)^g.rotrBH(h,b,41),x=g.rotrSL(h,b,14)^g.rotrSL(h,b,18)^g.rotrBL(h,b,41),N=h&A^~h&L,X=b&I^~b&S,K=g.add5L(F,x,X,un[d],dt[d]),O=g.add5H(K,z,m,N,fn[d],ht[d]),q=K|0,R=g.rotrSH(n,o,28)^g.rotrBH(n,o,34)^g.rotrBH(n,o,39),Z=g.rotrSL(n,o,28)^g.rotrBL(n,o,34)^g.rotrBL(n,o,39),T=n&i^n&a^i&a,vt=o&s^o&c^s&c;z=L|0,F=S|0,L=A|0,S=I|0,A=h|0,I=b|0,{h,l:b}=g.add(u|0,f|0,O|0,q|0),u=a|0,f=c|0,a=i|0,c=s|0,i=n|0,s=o|0;let ct=g.add3L(q,Z,vt);n=g.add3H(ct,O,R,T),o=ct|0}({h:n,l:o}=g.add(this.Ah|0,this.Al|0,n|0,o|0)),{h:i,l:s}=g.add(this.Bh|0,this.Bl|0,i|0,s|0),{h:a,l:c}=g.add(this.Ch|0,this.Cl|0,a|0,c|0),{h:u,l:f}=g.add(this.Dh|0,this.Dl|0,u|0,f|0),{h,l:b}=g.add(this.Eh|0,this.El|0,h|0,b|0),{h:A,l:I}=g.add(this.Fh|0,this.Fl|0,A|0,I|0),{h:L,l:S}=g.add(this.Gh|0,this.Gl|0,L|0,S|0),{h:z,l:F}=g.add(this.Hh|0,this.Hl|0,z|0,F|0),this.set(n,o,i,s,a,c,u,f,h,b,A,I,L,S,z,F)}roundClean(){ht.fill(0),dt.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}},le=class extends Bt{constructor(){super(),this.Ah=-1942145080,this.Al=424955298,this.Bh=1944164710,this.Bl=-1982016298,this.Ch=502970286,this.Cl=855612546,this.Dh=1738396948,this.Dl=1479516111,this.Eh=258812777,this.El=2077511080,this.Fh=2011393907,this.Fl=79989058,this.Gh=1067287976,this.Gl=1780299464,this.Hh=286451373,this.Hl=-1848208735,this.outputLen=28}},he=class extends Bt{constructor(){super(),this.Ah=573645204,this.Al=-64227540,this.Bh=-1621794909,this.Bl=-934517566,this.Ch=596883563,this.Cl=1867755857,this.Dh=-1774684391,this.Dl=1497426621,this.Eh=-1775747358,this.El=-1467023389,this.Fh=-1101128155,this.Fl=1401305490,this.Gh=721525244,this.Gl=746961066,this.Hh=246885852,this.Hl=-2117784414,this.outputLen=32}},de=class extends Bt{constructor(){super(),this.Ah=-876896931,this.Al=-1056596264,this.Bh=1654270250,this.Bl=914150663,this.Ch=-1856437926,this.Cl=812702999,this.Dh=355462360,this.Dl=-150054599,this.Eh=1731405415,this.El=-4191439,this.Fh=-1900787065,this.Fl=1750603025,this.Gh=-619958771,this.Gl=1694076839,this.Hh=1203062813,this.Hl=-1090891868,this.outputLen=48}},pe=ft(()=>new Bt),_o=ft(()=>new le),Bo=ft(()=>new he),Ao=ft(()=>new de);var So=BigInt(0),ln=BigInt(1),hn=BigInt(2),$t=e=>e instanceof Uint8Array,dn=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Lt(e){if(!$t(e))throw new Error("Uint8Array expected");let t="";for(let r=0;rn+o.length,0)),r=0;return e.forEach(n=>{if(!$t(n))throw new Error("Uint8Array expected");t.set(n,r),r+=n.length}),t}var Ze=e=>(hn<typeof e=="bigint",function:e=>typeof e=="function",boolean:e=>typeof e=="boolean",string:e=>typeof e=="string",isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>typeof e=="function"&&Number.isSafeInteger(e.outputLen)};function ot(e,t,r={}){let n=(o,i,s)=>{let a=pn[i];if(typeof a!="function")throw new Error(`Invalid validator "${i}", expected function`);let c=e[o];if(!(s&&c===void 0)&&!a(c,e))throw new Error(`Invalid param ${String(o)}=${c} (${typeof c}), expected ${i}`)};for(let[o,i]of Object.entries(t))n(o,i,!1);for(let[o,i]of Object.entries(r))n(o,i,!0);return e}var C=BigInt(0),k=BigInt(1),yt=BigInt(2),yn=BigInt(3),xe=BigInt(4),Ve=BigInt(5),$e=BigInt(8),xn=BigInt(9),wn=BigInt(16);function H(e,t){let r=e%t;return r>=C?r:t+r}function we(e,t,r){if(r<=C||t 0");if(r===k)return C;let n=k;for(;t>C;)t&k&&(n=n*e%r),e=e*e%r,t>>=k;return n}function $(e,t,r){let n=e;for(;t-- >C;)n*=n,n%=r;return n}function Xe(e,t){if(e===C||t<=C)throw new Error(`invert: expected positive integers, got n=${e} mod=${t}`);let r=H(e,t),n=t,o=C,i=k,s=k,a=C;for(;r!==C;){let u=n/r,f=n%r,h=o-s*u,b=i-a*u;n=r,r=f,o=s,i=a,s=h,a=b}if(n!==k)throw new Error("invert: does not exist");return H(o,t)}function gn(e){let t=(e-k)/yt,r,n,o;for(r=e-k,n=0;r%yt===C;r/=yt,n++);for(o=yt;o(H(e,t)&k)===k,En=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function We(e){let t={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},r=En.reduce((n,o)=>(n[o]="function",n),t);return ot(e,r)}function _n(e,t,r){if(r 0");if(r===C)return e.ONE;if(r===k)return t;let n=e.ONE,o=t;for(;r>C;)r&k&&(n=e.mul(n,o)),o=e.sqr(o),r>>=k;return n}function Bn(e,t){let r=new Array(t.length),n=t.reduce((i,s,a)=>e.is0(s)?i:(r[a]=i,e.mul(i,s)),e.ONE),o=e.inv(n);return t.reduceRight((i,s,a)=>e.is0(s)?i:(r[a]=e.mul(i,r[a]),e.mul(i,s)),o),r}function ge(e,t){let r=t!==void 0?t:e.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function Qe(e,t,r=!1,n={}){if(e<=C)throw new Error(`Expected Fp ORDER > 0, got ${e}`);let{nBitLength:o,nByteLength:i}=ge(e,t);if(i>2048)throw new Error("Field lengths over 2048 bytes are not supported");let s=mn(e),a=Object.freeze({ORDER:e,BITS:o,BYTES:i,MASK:Ze(o),ZERO:C,ONE:k,create:c=>H(c,e),isValid:c=>{if(typeof c!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof c}`);return C<=c&&cc===C,isOdd:c=>(c&k)===k,neg:c=>H(-c,e),eql:(c,u)=>c===u,sqr:c=>H(c*c,e),add:(c,u)=>H(c+u,e),sub:(c,u)=>H(c-u,e),mul:(c,u)=>H(c*u,e),pow:(c,u)=>_n(a,c,u),div:(c,u)=>H(c*Xe(u,e),e),sqrN:c=>c*c,addN:(c,u)=>c+u,subN:(c,u)=>c-u,mulN:(c,u)=>c*u,inv:c=>Xe(c,e),sqrt:n.sqrt||(c=>s(a,c)),invertBatch:c=>Bn(a,c),cmov:(c,u,f)=>f?u:c,toBytes:c=>r?pt(c,i):ye(c,i),fromBytes:c=>{if(c.length!==i)throw new Error(`Fp.fromBytes: expected ${i}, got ${c.length}`);return r?J(c):be(c)}});return Object.freeze(a)}function Je(e,t){if(!e.isOdd)throw new Error("Field doesn't have isOdd");let r=e.sqrt(t);return e.isOdd(r)?e.neg(r):r}var An=BigInt(0),me=BigInt(1);function tr(e,t){let r=(o,i)=>{let s=i.negate();return o?s:i},n=o=>{let i=Math.ceil(t/o)+1,s=2**(o-1);return{windows:i,windowSize:s}};return{constTimeNegate:r,unsafeLadder(o,i){let s=e.ZERO,a=o;for(;i>An;)i&me&&(s=s.add(a)),a=a.double(),i>>=me;return s},precomputeWindow(o,i){let{windows:s,windowSize:a}=n(i),c=[],u=o,f=u;for(let h=0;h>=A,S>c&&(S-=b,s+=me);let z=L,F=L+Math.abs(S)-1,d=I%2!==0,m=S<0;S===0?f=f.add(r(d,i[z])):u=u.add(r(m,i[F]))}return{p:u,f}},wNAFCached(o,i,s,a){let c=o._WINDOW_SIZE||1,u=i.get(o);return u||(u=this.precomputeWindow(o,c),c!==1&&i.set(o,a(u))),this.wNAF(c,u,s)}}}function er(e){return We(e.Fp),ot(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...ge(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}var W=BigInt(0),V=BigInt(1),Yt=BigInt(2),vn=BigInt(8),Sn={zip215:!0};function In(e){let t=er(e);return ot(e,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...t})}function Wt(e){let t=In(e),{Fp:r,n,prehash:o,hash:i,randomBytes:s,nByteLength:a,h:c}=t,u=Yt<{try{return{isValid:!0,value:r.sqrt(p*r.inv(l))}}catch{return{isValid:!1,value:W}}}),b=t.adjustScalarBytes||(p=>p),A=t.domain||((p,l,y)=>{if(l.length||y)throw new Error("Contexts/pre-hash are not supported");return p}),I=p=>typeof p=="bigint"&&WI(p)&&I(l)&&pp===W||L(p,u);function z(p,l){if(L(p,l))return p;throw new Error(`Expected valid scalar < ${l}, got ${typeof p} ${p}`)}function F(p){return p===W?p:z(p,n)}let d=new Map;function m(p){if(!(p instanceof x))throw new Error("ExtendedPoint expected")}class x{constructor(l,y,w,E){if(this.ex=l,this.ey=y,this.ez=w,this.et=E,!S(l))throw new Error("x required");if(!S(y))throw new Error("y required");if(!S(w))throw new Error("z required");if(!S(E))throw new Error("t required")}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(l){if(l instanceof x)throw new Error("extended point not allowed");let{x:y,y:w}=l||{};if(!S(y)||!S(w))throw new Error("invalid affine point");return new x(y,w,V,f(y*w))}static normalizeZ(l){let y=r.invertBatch(l.map(w=>w.ez));return l.map((w,E)=>w.toAffine(y[E])).map(x.fromAffine)}_setWindowSize(l){this._WINDOW_SIZE=l,d.delete(this)}assertValidity(){let{a:l,d:y}=t;if(this.is0())throw new Error("bad point: ZERO");let{ex:w,ey:E,ez:_,et:v}=this,U=f(w*w),B=f(E*E),P=f(_*_),D=f(P*P),M=f(U*l),Q=f(P*f(M+B)),G=f(D+f(y*f(U*B)));if(Q!==G)throw new Error("bad point: equation left != right (1)");let at=f(w*E),tt=f(_*v);if(at!==tt)throw new Error("bad point: equation left != right (2)")}equals(l){m(l);let{ex:y,ey:w,ez:E}=this,{ex:_,ey:v,ez:U}=l,B=f(y*U),P=f(_*E),D=f(w*U),M=f(v*E);return B===P&&D===M}is0(){return this.equals(x.ZERO)}negate(){return new x(f(-this.ex),this.ey,this.ez,f(-this.et))}double(){let{a:l}=t,{ex:y,ey:w,ez:E}=this,_=f(y*y),v=f(w*w),U=f(Yt*f(E*E)),B=f(l*_),P=y+w,D=f(f(P*P)-_-v),M=B+v,Q=M-U,G=B-v,at=f(D*Q),tt=f(M*G),Ot=f(D*G),Tt=f(Q*M);return new x(at,tt,Tt,Ot)}add(l){m(l);let{a:y,d:w}=t,{ex:E,ey:_,ez:v,et:U}=this,{ex:B,ey:P,ez:D,et:M}=l;if(y===BigInt(-1)){let Le=f((_-E)*(P+B)),Pe=f((_+E)*(P-B)),Jt=f(Pe-Le);if(Jt===W)return this.double();let Ue=f(v*Yt*M),He=f(U*Yt*D),Ke=He+Ue,ke=Pe+Le,Oe=He-Ue,yr=f(Ke*Jt),xr=f(ke*Oe),wr=f(Ke*Oe),gr=f(Jt*ke);return new x(yr,xr,gr,wr)}let Q=f(E*B),G=f(_*P),at=f(U*w*M),tt=f(v*D),Ot=f((E+_)*(B+P)-Q-G),Tt=tt-at,Se=tt+at,Ie=f(G-y*Q),hr=f(Ot*Tt),dr=f(Se*Ie),pr=f(Ot*Ie),br=f(Tt*Se);return new x(hr,dr,br,pr)}subtract(l){return this.add(l.negate())}wNAF(l){return K.wNAFCached(this,d,l,x.normalizeZ)}multiply(l){let{p:y,f:w}=this.wNAF(z(l,n));return x.normalizeZ([y,w])[0]}multiplyUnsafe(l){let y=F(l);return y===W?X:this.equals(X)||y===V?this:this.equals(N)?this.wNAF(y).p:K.unsafeLadder(this,y)}isSmallOrder(){return this.multiplyUnsafe(c).is0()}isTorsionFree(){return K.unsafeLadder(this,n).is0()}toAffine(l){let{ex:y,ey:w,ez:E}=this,_=this.is0();l==null&&(l=_?vn:r.inv(E));let v=f(y*l),U=f(w*l),B=f(E*l);if(_)return{x:W,y:V};if(B!==V)throw new Error("invZ was invalid");return{x:v,y:U}}clearCofactor(){let{h:l}=t;return l===V?this:this.multiplyUnsafe(l)}static fromHex(l,y=!1){let{d:w,a:E}=t,_=r.BYTES;l=j("pointHex",l,_);let v=l.slice(),U=l[_-1];v[_-1]=U&-129;let B=J(v);B===W||(y?z(B,u):z(B,r.ORDER));let P=f(B*B),D=f(P-V),M=f(w*P-E),{isValid:Q,value:G}=h(D,M);if(!Q)throw new Error("Point.fromHex: invalid y coordinate");let at=(G&V)===V,tt=(U&128)!==0;if(!y&&G===W&&tt)throw new Error("Point.fromHex: x=0 and x_0=1");return tt!==at&&(G=f(-G)),x.fromAffine({x:G,y:B})}static fromPrivateKey(l){return R(l).point}toRawBytes(){let{x:l,y}=this.toAffine(),w=pt(y,r.BYTES);return w[w.length-1]|=l&V?128:0,w}toHex(){return Lt(this.toRawBytes())}}x.BASE=new x(t.Gx,t.Gy,V,f(t.Gx*t.Gy)),x.ZERO=new x(W,V,V,W);let{BASE:N,ZERO:X}=x,K=tr(x,a*8);function O(p){return H(p,n)}function q(p){return O(J(p))}function R(p){let l=a;p=j("private key",p,l);let y=j("hashed private key",i(p),2*l),w=b(y.slice(0,l)),E=y.slice(l,2*l),_=q(w),v=N.multiply(_),U=v.toRawBytes();return{head:w,prefix:E,scalar:_,point:v,pointBytes:U}}function Z(p){return R(p).pointBytes}function T(p=new Uint8Array,...l){let y=Xt(...l);return q(i(A(y,j("context",p),!!o)))}function vt(p,l,y={}){p=j("message",p),o&&(p=o(p));let{prefix:w,scalar:E,pointBytes:_}=R(l),v=T(y.context,w,p),U=N.multiply(v).toRawBytes(),B=T(y.context,U,_,p),P=O(v+B*E);F(P);let D=Xt(U,pt(P,r.BYTES));return j("result",D,a*2)}let ct=Sn;function Kt(p,l,y,w=ct){let{context:E,zip215:_}=w,v=r.BYTES;p=j("signature",p,2*v),l=j("message",l),o&&(l=o(l));let U=J(p.slice(v,2*v)),B,P,D;try{B=x.fromHex(y,_),P=x.fromHex(p.slice(0,v),_),D=N.multiplyUnsafe(U)}catch{return!1}if(!_&&B.isSmallOrder())return!1;let M=T(E,P.toRawBytes(),B.toRawBytes(),l);return P.add(B.multiplyUnsafe(M)).subtract(D).clearCofactor().equals(x.ZERO)}return N._setWindowSize(8),{CURVE:t,getPublicKey:Z,sign:vt,verify:Kt,ExtendedPoint:x,utils:{getExtendedPublicKey:R,randomPrivateKey:()=>s(r.BYTES),precompute(p=8,l=x.BASE){return l._setWindowSize(p),l.multiply(BigInt(3)),l}}}}var Pt=BigInt(0),Ee=BigInt(1);function Ln(e){return ot(e,{a:"bigint"},{montgomeryBits:"isSafeInteger",nByteLength:"isSafeInteger",adjustScalarBytes:"function",domain:"function",powPminus2:"function",Gu:"bigint"}),Object.freeze({...e})}function rr(e){let t=Ln(e),{P:r}=t,n=d=>H(d,r),o=t.montgomeryBits,i=Math.ceil(o/8),s=t.nByteLength,a=t.adjustScalarBytes||(d=>d),c=t.powPminus2||(d=>we(d,r-BigInt(2),r));function u(d,m,x){let N=n(d*(m-x));return m=n(m-N),x=n(x+N),[m,x]}function f(d){if(typeof d=="bigint"&&Pt<=d&&d=Pt;ct--){let Kt=N>>ct&Ee;Z^=Kt,T=u(Z,K,q),K=T[0],q=T[1],T=u(Z,O,R),O=T[0],R=T[1],Z=Kt;let kt=K+O,p=n(kt*kt),l=K-O,y=n(l*l),w=p-y,E=q+R,_=q-R,v=n(_*kt),U=n(E*l),B=v+U,P=v-U;q=n(B*B),R=n(X*n(P*P)),K=n(p*y),O=n(w*(p+n(h*w)))}T=u(Z,K,q),K=T[0],q=T[1],T=u(Z,O,R),O=T[0],R=T[1];let vt=c(O);return n(K*vt)}function A(d){return pt(n(d),i)}function I(d){let m=j("u coordinate",d,i);return s===i&&(m[s-1]&=127),J(m)}function L(d){let m=j("scalar",d);if(m.length!==i&&m.length!==s)throw new Error(`Expected ${i} or ${s} bytes, got ${m.length}`);return J(a(m))}function S(d,m){let x=I(m),N=L(d),X=b(x,N);if(X===Pt)throw new Error("Invalid private or public key received");return A(X)}let z=A(t.Gu);function F(d){return S(d,z)}return{scalarMult:S,scalarMultBase:F,getSharedSecret:(d,m)=>S(d,m),getPublicKey:d=>F(d),utils:{randomPrivateKey:()=>t.randomBytes(t.nByteLength)},GuBytes:z}}var Ut=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),nr=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752"),Jo=BigInt(0),Pn=BigInt(1),_e=BigInt(2),Un=BigInt(5),or=BigInt(10),Hn=BigInt(20),Kn=BigInt(40),ir=BigInt(80);function sr(e){let t=Ut,n=e*e%t*e%t,o=$(n,_e,t)*n%t,i=$(o,Pn,t)*e%t,s=$(i,Un,t)*i%t,a=$(s,or,t)*s%t,c=$(a,Hn,t)*a%t,u=$(c,Kn,t)*c%t,f=$(u,ir,t)*u%t,h=$(f,ir,t)*u%t,b=$(h,or,t)*s%t;return{pow_p_5_8:$(b,_e,t)*e%t,b2:n}}function cr(e){return e[0]&=248,e[31]&=127,e[31]|=64,e}function kn(e,t){let r=Ut,n=H(t*t*t,r),o=H(n*n*t,r),i=sr(e*o).pow_p_5_8,s=H(e*n*i,r),a=H(t*s*s,r),c=s,u=H(s*nr,r),f=a===e,h=a===H(-e,r),b=a===H(-e*nr,r);return f&&(s=c),(h||b)&&(s=u),Ye(s,r)&&(s=H(-s,r)),{isValid:f||h,value:s}}var it=Qe(Ut,void 0,!0),Be={a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:it,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:BigInt(8),Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:pe,randomBytes:oe,adjustScalarBytes:cr,uvRatio:kn},ar=Wt(Be);function fr(e,t,r){if(t.length>255)throw new Error("Context is too big");return Ne(ne("SigEd25519 no Ed25519 collisions"),new Uint8Array([r?1:0,t.length]),t,e)}var ti=Wt({...Be,domain:fr}),ei=Wt({...Be,domain:fr,prehash:pe}),Ae=(()=>rr({P:Ut,a:BigInt(486662),montgomeryBits:255,nByteLength:32,Gu:BigInt(9),powPminus2:e=>{let t=Ut,{pow_p_5_8:r,b2:n}=sr(e);return H($(r,BigInt(3),t)*n,t)},adjustScalarBytes:cr,randomBytes:oe}))();var On=(it.ORDER+BigInt(3))/BigInt(8),ri=it.pow(_e,On),ni=it.sqrt(it.neg(it.ONE)),oi=(it.ORDER-BigInt(5))/BigInt(8),ii=BigInt(486662);var si=Je(it,it.neg(BigInt(486664)));var ci=BigInt("25063068953384623474111414158702152701244531502492656460079210482610430750235"),ai=BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"),fi=BigInt("1159843021668779879193775521855586647937357759715417654439879720876111806838"),ui=BigInt("40440834346308536858101042469323190826248399146238708352240133220865137265952");var li=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");var Ht=["deriveBits"],ur=new Uint8Array([100,107,112,95,112,114,107]),lr=new Uint8Array([115,107]);var st=class{constructor(t,r,n,o=[]){Object.defineProperty(this,"key",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"type",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"extractable",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"algorithm",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"usages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.key=r,this.type=n,this.algorithm={name:t},this.usages=o,n==="public"&&(this.usages=[])}};var At="X25519",Qt=class{constructor(t){Object.defineProperty(this,"_hkdf",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_nPk",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_nSk",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._hkdf=t,this._nPk=32,this._nSk=32}async serializePublicKey(t){try{return await this._serializePublicKey(t)}catch(r){throw new mt(r)}}async deserializePublicKey(t){try{return await this._importRawKey(t,!0)}catch(r){throw new bt(r)}}async serializePrivateKey(t){try{return await this._serializePrivateKey(t)}catch(r){throw new mt(r)}}async deserializePrivateKey(t){try{return await this._importRawKey(t,!1)}catch(r){throw new bt(r)}}async importKey(t,r,n){try{if(t==="raw")return await this._importRawKey(r,n);if(r instanceof ArrayBuffer)throw new Error("Invalid jwk key format");return await this._importJWK(r,n)}catch(o){throw new bt(o)}}async generateKeyPair(){try{let t=ar.utils.randomPrivateKey(),r=new st(At,t,"private",Ht);return{publicKey:await this.derivePublicKey(r),privateKey:r}}catch(t){throw new Et(t)}}async deriveKeyPair(t){try{let r=await this._hkdf.labeledExtract(nt,ur,new Uint8Array(t)),n=await this._hkdf.labeledExpand(r,lr,nt,this._nSk),o=new st(At,new Uint8Array(n),"private",Ht);return{privateKey:o,publicKey:await this.derivePublicKey(o)}}catch(r){throw new Mt(r)}}async derivePublicKey(t){try{return await this._derivePublicKey(t)}catch(r){throw new bt(r)}}async dh(t,r){try{return await this._dh(t,r)}catch(n){throw new mt(n)}}_serializePublicKey(t){return new Promise(r=>{r(t.key.buffer)})}_serializePrivateKey(t){return new Promise(r=>{r(t.key.buffer)})}_importRawKey(t,r){return new Promise((n,o)=>{r&&t.byteLength!==this._nPk&&o(new Error("Invalid length of the key")),!r&&t.byteLength!==this._nSk&&o(new Error("Invalid length of the key")),n(new st(At,new Uint8Array(t),r?"public":"private",r?[]:Ht))})}_importJWK(t,r){return new Promise((n,o)=>{(typeof t.kty>"u"||t.kty!=="OKP")&&o(new Error(`Invalid kty: ${t.kty}`)),(typeof t.crv>"u"||t.crv!=="X25519")&&o(new Error(`Invalid crv: ${t.crv}`)),r?(typeof t.d<"u"&&o(new Error("Invalid key: `d` should not be set")),typeof t.x>"u"&&o(new Error("Invalid key: `x` not found")),n(new st(At,fe(t.x),"public"))):(typeof t.d!="string"&&o(new Error("Invalid key: `d` not found")),n(new st(At,fe(t.d),"private",Ht)))})}_derivePublicKey(t){return new Promise((r,n)=>{try{let o=Ae.getPublicKey(t.key);r(new st(At,o,"public"))}catch(o){n(o)}})}_dh(t,r){return new Promise((n,o)=>{try{n(Ae.getSharedSecret(t.key,r.key).buffer)}catch(i){o(i)}})}};var ve=class extends Zt{constructor(){let t=new Ft;super(te.DhkemX25519HkdfSha256,new Qt(t),t),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:te.DhkemX25519HkdfSha256}),Object.defineProperty(this,"secretSize",{enumerable:!0,configurable:!0,writable:!0,value:32}),Object.defineProperty(this,"encSize",{enumerable:!0,configurable:!0,writable:!0,value:32}),Object.defineProperty(this,"publicKeySize",{enumerable:!0,configurable:!0,writable:!0,value:32}),Object.defineProperty(this,"privateKeySize",{enumerable:!0,configurable:!0,writable:!0,value:32})}};export{ve as DhkemX25519HkdfSha256}; +var Pn={NotAssigned:0,DhkemP256HkdfSha256:16,DhkemP384HkdfSha384:17,DhkemP521HkdfSha512:18,DhkemSecp256k1HkdfSha256:19,DhkemX25519HkdfSha256:32,DhkemX448HkdfSha512:33,HybridkemX25519Kyber768:48},re=Pn,Hn={HkdfSha256:1,HkdfSha384:2,HkdfSha512:3},oe=Hn;function ze(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function ie(e,...t){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw new Error(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function qe(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");ze(e.outputLen),ze(e.blockLen)}function yt(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function Me(e,t){ie(e);let n=t.outputLen;if(e.lengthe instanceof Uint8Array;var Tt=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),W=(e,t)=>e<<32-t|e>>>t,kn=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!kn)throw new Error("Non little-endian hardware is not supported");function On(e){if(typeof e!="string")throw new Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function At(e){if(typeof e=="string"&&(e=On(e)),!Kn(e))throw new Error(`expected Uint8Array, got ${typeof e}`);return e}var bt=class{clone(){return this._cloneInto()}},Wr={}.toString;function Ge(e){let t=r=>e().update(At(r)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}var Nt=class extends bt{constructor(t,n){super(),this.finished=!1,this.destroyed=!1,qe(t);let r=At(n);if(this.iHash=t.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let o=this.blockLen,s=new Uint8Array(o);s.set(r.length>o?t.create().update(r).digest():r);for(let i=0;inew Nt(e,t).update(n).digest();se.create=(e,t)=>new Nt(e,t);function Tn(e,t,n,r){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,n,r);let o=BigInt(32),s=BigInt(4294967295),i=Number(n>>o&s),a=Number(n&s),c=r?4:0,u=r?0:4;e.setUint32(t+c,i,r),e.setUint32(t+u,a,r)}var Ct=class extends bt{constructor(t,n,r,o){super(),this.blockLen=t,this.outputLen=n,this.padOffset=r,this.isLE=o,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=Tt(this.buffer)}update(t){yt(this);let{view:n,buffer:r,blockLen:o}=this;t=At(t);let s=t.length;for(let i=0;io-i&&(this.process(r,0),i=0);for(let l=i;lf.length)throw new Error("_sha2: outputLen bigger than state");for(let l=0;le&t^~e&n,Cn=(e,t,n)=>e&t^e&n^t&n,Rn=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),at=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),ft=new Uint32Array(64),ce=class extends Ct{constructor(){super(64,32,8,!1),this.A=at[0]|0,this.B=at[1]|0,this.C=at[2]|0,this.D=at[3]|0,this.E=at[4]|0,this.F=at[5]|0,this.G=at[6]|0,this.H=at[7]|0}get(){let{A:t,B:n,C:r,D:o,E:s,F:i,G:a,H:c}=this;return[t,n,r,o,s,i,a,c]}set(t,n,r,o,s,i,a,c){this.A=t|0,this.B=n|0,this.C=r|0,this.D=o|0,this.E=s|0,this.F=i|0,this.G=a|0,this.H=c|0}process(t,n){for(let l=0;l<16;l++,n+=4)ft[l]=t.getUint32(n,!1);for(let l=16;l<64;l++){let y=ft[l-15],A=ft[l-2],L=W(y,7)^W(y,18)^y>>>3,I=W(A,17)^W(A,19)^A>>>10;ft[l]=I+ft[l-7]+L+ft[l-16]|0}let{A:r,B:o,C:s,D:i,E:a,F:c,G:u,H:f}=this;for(let l=0;l<64;l++){let y=W(a,6)^W(a,11)^W(a,25),A=f+y+Nn(a,c,u)+Rn[l]+ft[l]|0,I=(W(r,2)^W(r,13)^W(r,22))+Cn(r,o,s)|0;f=u,u=c,c=a,a=i+A|0,i=s,s=o,o=r,r=A+I|0}r=r+this.A|0,o=o+this.B|0,s=s+this.C|0,i=i+this.D|0,a=a+this.E|0,c=c+this.F|0,u=u+this.G|0,f=f+this.H|0,this.set(r,o,s,i,a,c,u,f)}roundClean(){ft.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}};var je=Ge(()=>new ce);var Dn={},Ve=zn(globalThis,Dn);function zn(e,t){return new Proxy(e,{get(n,r,o){return r in t?t[r]:e[r]},set(n,r,o){return r in t&&delete t[r],e[r]=o,!0},deleteProperty(n,r){let o=!1;return r in t&&(delete t[r],o=!0),r in e&&(delete e[r],o=!0),o},ownKeys(n){let r=Reflect.ownKeys(e),o=Reflect.ownKeys(t),s=new Set(o);return[...r.filter(i=>!s.has(i)),...o]},defineProperty(n,r,o){return r in t&&delete t[r],Reflect.defineProperty(e,r,o),!0},getOwnPropertyDescriptor(n,r){return r in t?Reflect.getOwnPropertyDescriptor(t,r):Reflect.getOwnPropertyDescriptor(e,r)},has(n,r){return r in t||r in e}})}var ae=class extends Error{constructor(t){let n;t instanceof Error?n=t.message:typeof t=="string"?n=t:n="",super(n),this.name=this.constructor.name}},et=class extends ae{},xt=class extends et{};var wt=class extends et{},dt=class extends et{},Rt=class extends et{},Dt=class extends et{};var zt=class extends et{},gt=class extends et{};async function Mn(){if(Ve!==void 0&&globalThis.crypto!==void 0)return globalThis.crypto.subtle;try{let{webcrypto:e}=await import("crypto");return e.subtle}catch(e){throw new gt(e)}}var qt=class{constructor(){Object.defineProperty(this,"_api",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}async _setup(){this._api===void 0&&(this._api=await Mn())}};var nt=new Uint8Array(0);var $e=new Uint8Array([72,80,75,69,45,118,49]),fe=class extends qt{constructor(){super(),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:oe.HkdfSha256}),Object.defineProperty(this,"hashSize",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_suiteId",{enumerable:!0,configurable:!0,writable:!0,value:nt}),Object.defineProperty(this,"algHash",{enumerable:!0,configurable:!0,writable:!0,value:{name:"HMAC",hash:"SHA-256",length:256}})}init(t){this._suiteId=t}buildLabeledIkm(t,n){this._checkInit();let r=new Uint8Array(7+this._suiteId.byteLength+t.byteLength+n.byteLength);return r.set($e,0),r.set(this._suiteId,7),r.set(t,7+this._suiteId.byteLength),r.set(n,7+this._suiteId.byteLength+t.byteLength),r}buildLabeledInfo(t,n,r){this._checkInit();let o=new Uint8Array(9+this._suiteId.byteLength+t.byteLength+n.byteLength);return o.set(new Uint8Array([0,r]),0),o.set($e,2),o.set(this._suiteId,9),o.set(t,9+this._suiteId.byteLength),o.set(n,9+this._suiteId.byteLength+t.byteLength),o}async extract(t,n){if(await this._setup(),t.byteLength===0&&(t=new ArrayBuffer(this.hashSize)),t.byteLength!==this.hashSize)throw new xt("The salt length must be the same as the hashSize");let r=await this._api.importKey("raw",t,this.algHash,!1,["sign"]);return await this._api.sign("HMAC",r,n)}async expand(t,n,r){await this._setup();let o=await this._api.importKey("raw",t,this.algHash,!1,["sign"]),s=new ArrayBuffer(r),i=new Uint8Array(s),a=nt,c=new Uint8Array(n),u=new Uint8Array(1);if(r>255*this.hashSize)throw new Error("Entropy limit reached");let f=new Uint8Array(this.hashSize+c.length+1);for(let l=1,y=0;y=a.length?(i.set(a,y),y+=a.length):(i.set(a.slice(0,i.length-y),y),y+=i.length-y);return s}async extractAndExpand(t,n,r,o){await this._setup();let s=await this._api.importKey("raw",n,"HKDF",!1,["deriveBits"]);return await this._api.deriveBits({name:"HKDF",hash:this.algHash.hash,salt:t,info:r},s,o*8)}async labeledExtract(t,n,r){return await this.extract(t,this.buildLabeledIkm(n,r))}async labeledExpand(t,n,r,o){return await this.expand(t,this.buildLabeledInfo(n,r,o),o)}_checkInit(){if(this._suiteId===nt)throw new Error("Not initialized. Call init()")}},Mt=class extends fe{constructor(){super(...arguments),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:oe.HkdfSha256}),Object.defineProperty(this,"hashSize",{enumerable:!0,configurable:!0,writable:!0,value:32}),Object.defineProperty(this,"algHash",{enumerable:!0,configurable:!0,writable:!0,value:{name:"HMAC",hash:"SHA-256",length:256}})}};var Gt=class extends Mt{async extract(t,n){if(await this._setup(),t.byteLength===0&&(t=new ArrayBuffer(this.hashSize)),t.byteLength!==this.hashSize)return se(je,new Uint8Array(t),new Uint8Array(n));let r=await this._api.importKey("raw",t,this.algHash,!1,["sign"]);return await this._api.sign("HMAC",r,n)}};var Fe=new Uint8Array([75,69,77,0,0]);var mt=e=>typeof e=="object"&&e!==null&&typeof e.privateKey=="object"&&typeof e.publicKey=="object";function Ze(e,t){if(t<=0)throw new Error("i2Osp: too small size");if(e>=256**t)throw new Error("i2Osp: too large integer");let n=new Uint8Array(t);for(let r=0;r>8;return n}function vt(e,t){let n=new Uint8Array(e.length+t.length);return n.set(e,0),n.set(t,e.length),n}function ue(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),n=atob(t),r=new Uint8Array(n.length);for(let o=0;o8192)throw new xt("Too long ikm");return await this._prim.deriveKeyPair(t)}async encap(t){let n;t.ekm===void 0?n=await this.generateKeyPair():mt(t.ekm)?n=t.ekm:n=await this.deriveKeyPair(t.ekm);let r=await this._prim.serializePublicKey(n.publicKey),o=await this._prim.serializePublicKey(t.recipientPublicKey);try{let s;if(t.senderKey===void 0)s=new Uint8Array(await this._prim.dh(n.privateKey,t.recipientPublicKey));else{let c=mt(t.senderKey)?t.senderKey.privateKey:t.senderKey,u=new Uint8Array(await this._prim.dh(n.privateKey,t.recipientPublicKey)),f=new Uint8Array(await this._prim.dh(c,t.recipientPublicKey));s=vt(u,f)}let i;if(t.senderKey===void 0)i=vt(new Uint8Array(r),new Uint8Array(o));else{let c=mt(t.senderKey)?t.senderKey.publicKey:await this._prim.derivePublicKey(t.senderKey),u=await this._prim.serializePublicKey(c);i=$n(new Uint8Array(r),new Uint8Array(o),new Uint8Array(u))}let a=await this._generateSharedSecret(s,i);return{enc:r,sharedSecret:a}}catch(s){throw new Rt(s)}}async decap(t){let n=await this._prim.deserializePublicKey(t.enc),r=mt(t.recipientKey)?t.recipientKey.privateKey:t.recipientKey,o=mt(t.recipientKey)?t.recipientKey.publicKey:await this._prim.derivePublicKey(t.recipientKey),s=await this._prim.serializePublicKey(o);try{let i;if(t.senderPublicKey===void 0)i=new Uint8Array(await this._prim.dh(r,n));else{let c=new Uint8Array(await this._prim.dh(r,n)),u=new Uint8Array(await this._prim.dh(r,t.senderPublicKey));i=vt(c,u)}let a;if(t.senderPublicKey===void 0)a=vt(new Uint8Array(t.enc),new Uint8Array(s));else{let c=await this._prim.serializePublicKey(t.senderPublicKey);a=new Uint8Array(t.enc.byteLength+s.byteLength+c.byteLength),a.set(new Uint8Array(t.enc),0),a.set(new Uint8Array(s),t.enc.byteLength),a.set(new Uint8Array(c),t.enc.byteLength+s.byteLength)}return await this._generateSharedSecret(i,a)}catch(i){throw new Dt(i)}}async _generateSharedSecret(t,n){let r=this._kdf.buildLabeledIkm(jn,t),o=this._kdf.buildLabeledInfo(Vn,n,this.secretSize);return await this._kdf.extractAndExpand(nt,r,o,this.secretSize)}};function he(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function Fn(e){if(typeof e!="boolean")throw new Error(`Expected boolean, not ${e}`)}function Xe(e,...t){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw new Error(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function Zn(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");he(e.outputLen),he(e.blockLen)}function Xn(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function Wn(e,t){Xe(e);let n=t.outputLen;if(e.lengthe instanceof Uint8Array;var Zt=e=>new DataView(e.buffer,e.byteOffset,e.byteLength);var Qn=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!Qn)throw new Error("Non little-endian hardware is not supported");var Ho=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function le(e){if(typeof e!="string")throw new Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function de(e){if(typeof e=="string"&&(e=le(e)),!We(e))throw new Error(`expected Uint8Array, got ${typeof e}`);return e}function Ye(...e){let t=new Uint8Array(e.reduce((r,o)=>r+o.length,0)),n=0;return e.forEach(r=>{if(!We(r))throw new Error("Uint8Array expected");t.set(r,n),n+=r.length}),t}var Ft=class{clone(){return this._cloneInto()}};function St(e){let t=r=>e().update(de(r)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function pe(e=32){if($t&&typeof $t.getRandomValues=="function")return $t.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}function Jn(e,t,n,r){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,n,r);let o=BigInt(32),s=BigInt(4294967295),i=Number(n>>o&s),a=Number(n&s),c=r?4:0,u=r?0:4;e.setUint32(t+c,i,r),e.setUint32(t+u,a,r)}var Xt=class extends Ft{constructor(t,n,r,o){super(),this.blockLen=t,this.outputLen=n,this.padOffset=r,this.isLE=o,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=Zt(this.buffer)}update(t){Vt.exists(this);let{view:n,buffer:r,blockLen:o}=this;t=de(t);let s=t.length;for(let i=0;io-i&&(this.process(r,0),i=0);for(let l=i;lf.length)throw new Error("_sha2: outputLen bigger than state");for(let l=0;l>ye&Wt)}:{h:Number(e>>ye&Wt)|0,l:Number(e&Wt)|0}}function tr(e,t=!1){let n=new Uint32Array(e.length),r=new Uint32Array(e.length);for(let o=0;oBigInt(e>>>0)<>>0),nr=(e,t,n)=>e>>>n,rr=(e,t,n)=>e<<32-n|t>>>n,or=(e,t,n)=>e>>>n|t<<32-n,ir=(e,t,n)=>e<<32-n|t>>>n,sr=(e,t,n)=>e<<64-n|t>>>n-32,cr=(e,t,n)=>e>>>n-32|t<<64-n,ar=(e,t)=>t,fr=(e,t)=>e,ur=(e,t,n)=>e<>>32-n,hr=(e,t,n)=>t<>>32-n,lr=(e,t,n)=>t<>>64-n,dr=(e,t,n)=>e<>>64-n;function pr(e,t,n,r){let o=(t>>>0)+(r>>>0);return{h:e+n+(o/2**32|0)|0,l:o|0}}var yr=(e,t,n)=>(e>>>0)+(t>>>0)+(n>>>0),br=(e,t,n,r)=>t+n+r+(e/2**32|0)|0,xr=(e,t,n,r)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0),wr=(e,t,n,r,o)=>t+n+r+o+(e/2**32|0)|0,gr=(e,t,n,r,o)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0)+(o>>>0),mr=(e,t,n,r,o,s)=>t+n+r+o+s+(e/2**32|0)|0,Er={fromBig:Qe,split:tr,toBig:er,shrSH:nr,shrSL:rr,rotrSH:or,rotrSL:ir,rotrBH:sr,rotrBL:cr,rotr32H:ar,rotr32L:fr,rotlSH:ur,rotlSL:hr,rotlBH:lr,rotlBL:dr,add:pr,add3L:yr,add3H:br,add4L:xr,add4H:wr,add5H:mr,add5L:gr},g=Er;var[_r,Br]=g.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e))),ut=new Uint32Array(80),ht=new Uint32Array(80),Et=class extends Xt{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){let{Ah:t,Al:n,Bh:r,Bl:o,Ch:s,Cl:i,Dh:a,Dl:c,Eh:u,El:f,Fh:l,Fl:y,Gh:A,Gl:L,Hh:I,Hl:S}=this;return[t,n,r,o,s,i,a,c,u,f,l,y,A,L,I,S]}set(t,n,r,o,s,i,a,c,u,f,l,y,A,L,I,S){this.Ah=t|0,this.Al=n|0,this.Bh=r|0,this.Bl=o|0,this.Ch=s|0,this.Cl=i|0,this.Dh=a|0,this.Dl=c|0,this.Eh=u|0,this.El=f|0,this.Fh=l|0,this.Fl=y|0,this.Gh=A|0,this.Gl=L|0,this.Hh=I|0,this.Hl=S|0}process(t,n){for(let d=0;d<16;d++,n+=4)ut[d]=t.getUint32(n),ht[d]=t.getUint32(n+=4);for(let d=16;d<80;d++){let m=ut[d-15]|0,x=ht[d-15]|0,C=g.rotrSH(m,x,1)^g.rotrSH(m,x,8)^g.shrSH(m,x,7),X=g.rotrSL(m,x,1)^g.rotrSL(m,x,8)^g.shrSL(m,x,7),K=ut[d-2]|0,O=ht[d-2]|0,q=g.rotrSH(K,O,19)^g.rotrBH(K,O,61)^g.shrSH(K,O,6),R=g.rotrSL(K,O,19)^g.rotrBL(K,O,61)^g.shrSL(K,O,6),$=g.add4L(X,R,ht[d-7],ht[d-16]),T=g.add4H($,C,q,ut[d-7],ut[d-16]);ut[d]=T|0,ht[d]=$|0}let{Ah:r,Al:o,Bh:s,Bl:i,Ch:a,Cl:c,Dh:u,Dl:f,Eh:l,El:y,Fh:A,Fl:L,Gh:I,Gl:S,Hh:z,Hl:V}=this;for(let d=0;d<80;d++){let m=g.rotrSH(l,y,14)^g.rotrSH(l,y,18)^g.rotrBH(l,y,41),x=g.rotrSL(l,y,14)^g.rotrSL(l,y,18)^g.rotrBL(l,y,41),C=l&A^~l&I,X=y&L^~y&S,K=g.add5L(V,x,X,Br[d],ht[d]),O=g.add5H(K,z,m,C,_r[d],ut[d]),q=K|0,R=g.rotrSH(r,o,28)^g.rotrBH(r,o,34)^g.rotrBH(r,o,39),$=g.rotrSL(r,o,28)^g.rotrBL(r,o,34)^g.rotrBL(r,o,39),T=r&s^r&a^s&a,Bt=o&i^o&c^i&c;z=I|0,V=S|0,I=A|0,S=L|0,A=l|0,L=y|0,{h:l,l:y}=g.add(u|0,f|0,O|0,q|0),u=a|0,f=c|0,a=s|0,c=i|0,s=r|0,i=o|0;let st=g.add3L(q,$,Bt);r=g.add3H(st,O,R,T),o=st|0}({h:r,l:o}=g.add(this.Ah|0,this.Al|0,r|0,o|0)),{h:s,l:i}=g.add(this.Bh|0,this.Bl|0,s|0,i|0),{h:a,l:c}=g.add(this.Ch|0,this.Cl|0,a|0,c|0),{h:u,l:f}=g.add(this.Dh|0,this.Dl|0,u|0,f|0),{h:l,l:y}=g.add(this.Eh|0,this.El|0,l|0,y|0),{h:A,l:L}=g.add(this.Fh|0,this.Fl|0,A|0,L|0),{h:I,l:S}=g.add(this.Gh|0,this.Gl|0,I|0,S|0),{h:z,l:V}=g.add(this.Hh|0,this.Hl|0,z|0,V|0),this.set(r,o,s,i,a,c,u,f,l,y,A,L,I,S,z,V)}roundClean(){ut.fill(0),ht.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}},be=class extends Et{constructor(){super(),this.Ah=-1942145080,this.Al=424955298,this.Bh=1944164710,this.Bl=-1982016298,this.Ch=502970286,this.Cl=855612546,this.Dh=1738396948,this.Dl=1479516111,this.Eh=258812777,this.El=2077511080,this.Fh=2011393907,this.Fl=79989058,this.Gh=1067287976,this.Gl=1780299464,this.Hh=286451373,this.Hl=-1848208735,this.outputLen=28}},xe=class extends Et{constructor(){super(),this.Ah=573645204,this.Al=-64227540,this.Bh=-1621794909,this.Bl=-934517566,this.Ch=596883563,this.Cl=1867755857,this.Dh=-1774684391,this.Dl=1497426621,this.Eh=-1775747358,this.El=-1467023389,this.Fh=-1101128155,this.Fl=1401305490,this.Gh=721525244,this.Gl=746961066,this.Hh=246885852,this.Hl=-2117784414,this.outputLen=32}},we=class extends Et{constructor(){super(),this.Ah=-876896931,this.Al=-1056596264,this.Bh=1654270250,this.Bl=914150663,this.Ch=-1856437926,this.Cl=812702999,this.Dh=355462360,this.Dl=-150054599,this.Eh=1731405415,this.El=-4191439,this.Fh=-1900787065,this.Fl=1750603025,this.Gh=-619958771,this.Gl=1694076839,this.Hh=1203062813,this.Hl=-1090891868,this.outputLen=48}},ge=St(()=>new Et),zo=St(()=>new be),qo=St(()=>new xe),Mo=St(()=>new we);var jo=BigInt(0),Ar=BigInt(1),vr=BigInt(2),Yt=e=>e instanceof Uint8Array,Sr=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Lt(e){if(!Yt(e))throw new Error("Uint8Array expected");let t="";for(let n=0;nr+o.length,0)),n=0;return e.forEach(r=>{if(!Yt(r))throw new Error("Uint8Array expected");t.set(r,n),n+=r.length}),t}var en=e=>(vr<typeof e=="bigint",function:e=>typeof e=="function",boolean:e=>typeof e=="boolean",string:e=>typeof e=="string",isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>typeof e=="function"&&Number.isSafeInteger(e.outputLen)};function rt(e,t,n={}){let r=(o,s,i)=>{let a=Lr[s];if(typeof a!="function")throw new Error(`Invalid validator "${s}", expected function`);let c=e[o];if(!(i&&c===void 0)&&!a(c,e))throw new Error(`Invalid param ${String(o)}=${c} (${typeof c}), expected ${s}`)};for(let[o,s]of Object.entries(t))r(o,s,!1);for(let[o,s]of Object.entries(n))r(o,s,!0);return e}var N=BigInt(0),k=BigInt(1),pt=BigInt(2),Ur=BigInt(3),_e=BigInt(4),nn=BigInt(5),rn=BigInt(8),Pr=BigInt(9),Hr=BigInt(16);function H(e,t){let n=e%t;return n>=N?n:t+n}function Be(e,t,n){if(n<=N||t 0");if(n===k)return N;let r=k;for(;t>N;)t&k&&(r=r*e%n),e=e*e%n,t>>=k;return r}function Z(e,t,n){let r=e;for(;t-- >N;)r*=r,r%=n;return r}function on(e,t){if(e===N||t<=N)throw new Error(`invert: expected positive integers, got n=${e} mod=${t}`);let n=H(e,t),r=t,o=N,s=k,i=k,a=N;for(;n!==N;){let u=r/n,f=r%n,l=o-i*u,y=s-a*u;r=n,n=f,o=i,s=a,i=l,a=y}if(r!==k)throw new Error("invert: does not exist");return H(o,t)}function Kr(e){let t=(e-k)/pt,n,r,o;for(n=e-k,r=0;n%pt===N;n/=pt,r++);for(o=pt;o(H(e,t)&k)===k,Or=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function cn(e){let t={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},n=Or.reduce((r,o)=>(r[o]="function",r),t);return rt(e,n)}function Tr(e,t,n){if(n 0");if(n===N)return e.ONE;if(n===k)return t;let r=e.ONE,o=t;for(;n>N;)n&k&&(r=e.mul(r,o)),o=e.sqr(o),n>>=k;return r}function Nr(e,t){let n=new Array(t.length),r=t.reduce((s,i,a)=>e.is0(i)?s:(n[a]=s,e.mul(s,i)),e.ONE),o=e.inv(r);return t.reduceRight((s,i,a)=>e.is0(i)?s:(n[a]=e.mul(s,n[a]),e.mul(s,i)),o),n}function Ae(e,t){let n=t!==void 0?t:e.toString(2).length,r=Math.ceil(n/8);return{nBitLength:n,nByteLength:r}}function an(e,t,n=!1,r={}){if(e<=N)throw new Error(`Expected Fp ORDER > 0, got ${e}`);let{nBitLength:o,nByteLength:s}=Ae(e,t);if(s>2048)throw new Error("Field lengths over 2048 bytes are not supported");let i=kr(e),a=Object.freeze({ORDER:e,BITS:o,BYTES:s,MASK:en(o),ZERO:N,ONE:k,create:c=>H(c,e),isValid:c=>{if(typeof c!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof c}`);return N<=c&&cc===N,isOdd:c=>(c&k)===k,neg:c=>H(-c,e),eql:(c,u)=>c===u,sqr:c=>H(c*c,e),add:(c,u)=>H(c+u,e),sub:(c,u)=>H(c-u,e),mul:(c,u)=>H(c*u,e),pow:(c,u)=>Tr(a,c,u),div:(c,u)=>H(c*on(u,e),e),sqrN:c=>c*c,addN:(c,u)=>c+u,subN:(c,u)=>c-u,mulN:(c,u)=>c*u,inv:c=>on(c,e),sqrt:r.sqrt||(c=>i(a,c)),invertBatch:c=>Nr(a,c),cmov:(c,u,f)=>f?u:c,toBytes:c=>n?lt(c,s):Ee(c,s),fromBytes:c=>{if(c.length!==s)throw new Error(`Fp.fromBytes: expected ${s}, got ${c.length}`);return n?J(c):me(c)}});return Object.freeze(a)}function fn(e,t){if(!e.isOdd)throw new Error("Field doesn't have isOdd");let n=e.sqrt(t);return e.isOdd(n)?e.neg(n):n}var Cr=BigInt(0),ve=BigInt(1);function un(e,t){let n=(o,s)=>{let i=s.negate();return o?i:s},r=o=>{let s=Math.ceil(t/o)+1,i=2**(o-1);return{windows:s,windowSize:i}};return{constTimeNegate:n,unsafeLadder(o,s){let i=e.ZERO,a=o;for(;s>Cr;)s&ve&&(i=i.add(a)),a=a.double(),s>>=ve;return i},precomputeWindow(o,s){let{windows:i,windowSize:a}=r(s),c=[],u=o,f=u;for(let l=0;l>=A,S>c&&(S-=y,i+=ve);let z=I,V=I+Math.abs(S)-1,d=L%2!==0,m=S<0;S===0?f=f.add(n(d,s[z])):u=u.add(n(m,s[V]))}return{p:u,f}},wNAFCached(o,s,i,a){let c=o._WINDOW_SIZE||1,u=s.get(o);return u||(u=this.precomputeWindow(o,c),c!==1&&s.set(o,a(u))),this.wNAF(c,u,i)}}}function hn(e){return cn(e.Fp),rt(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...Ae(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}var Y=BigInt(0),F=BigInt(1),Jt=BigInt(2),Rr=BigInt(8),Dr={zip215:!0};function zr(e){let t=hn(e);return rt(e,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...t})}function te(e){let t=zr(e),{Fp:n,n:r,prehash:o,hash:s,randomBytes:i,nByteLength:a,h:c}=t,u=Jt<{try{return{isValid:!0,value:n.sqrt(p*n.inv(h))}}catch{return{isValid:!1,value:Y}}}),y=t.adjustScalarBytes||(p=>p),A=t.domain||((p,h,b)=>{if(h.length||b)throw new Error("Contexts/pre-hash are not supported");return p}),L=p=>typeof p=="bigint"&&YL(p)&&L(h)&&pp===Y||I(p,u);function z(p,h){if(I(p,h))return p;throw new Error(`Expected valid scalar < ${h}, got ${typeof p} ${p}`)}function V(p){return p===Y?p:z(p,r)}let d=new Map;function m(p){if(!(p instanceof x))throw new Error("ExtendedPoint expected")}class x{constructor(h,b,w,E){if(this.ex=h,this.ey=b,this.ez=w,this.et=E,!S(h))throw new Error("x required");if(!S(b))throw new Error("y required");if(!S(w))throw new Error("z required");if(!S(E))throw new Error("t required")}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(h){if(h instanceof x)throw new Error("extended point not allowed");let{x:b,y:w}=h||{};if(!S(b)||!S(w))throw new Error("invalid affine point");return new x(b,w,F,f(b*w))}static normalizeZ(h){let b=n.invertBatch(h.map(w=>w.ez));return h.map((w,E)=>w.toAffine(b[E])).map(x.fromAffine)}_setWindowSize(h){this._WINDOW_SIZE=h,d.delete(this)}assertValidity(){let{a:h,d:b}=t;if(this.is0())throw new Error("bad point: ZERO");let{ex:w,ey:E,ez:_,et:v}=this,P=f(w*w),B=f(E*E),U=f(_*_),D=f(U*U),M=f(P*h),Q=f(U*f(M+B)),G=f(D+f(b*f(P*B)));if(Q!==G)throw new Error("bad point: equation left != right (1)");let ct=f(w*E),tt=f(_*v);if(ct!==tt)throw new Error("bad point: equation left != right (2)")}equals(h){m(h);let{ex:b,ey:w,ez:E}=this,{ex:_,ey:v,ez:P}=h,B=f(b*P),U=f(_*E),D=f(w*P),M=f(v*E);return B===U&&D===M}is0(){return this.equals(x.ZERO)}negate(){return new x(f(-this.ex),this.ey,this.ez,f(-this.et))}double(){let{a:h}=t,{ex:b,ey:w,ez:E}=this,_=f(b*b),v=f(w*w),P=f(Jt*f(E*E)),B=f(h*_),U=b+w,D=f(f(U*U)-_-v),M=B+v,Q=M-P,G=B-v,ct=f(D*Q),tt=f(M*G),kt=f(D*G),Ot=f(Q*M);return new x(ct,tt,Ot,kt)}add(h){m(h);let{a:b,d:w}=t,{ex:E,ey:_,ez:v,et:P}=this,{ex:B,ey:U,ez:D,et:M}=h;if(b===BigInt(-1)){let ke=f((_-E)*(U+B)),Oe=f((_+E)*(U-B)),ne=f(Oe-ke);if(ne===Y)return this.double();let Te=f(v*Jt*M),Ne=f(P*Jt*D),Ce=Ne+Te,Re=Oe+ke,De=Ne-Te,Sn=f(Ce*ne),Ln=f(Re*De),In=f(Ce*De),Un=f(ne*Re);return new x(Sn,Ln,Un,In)}let Q=f(E*B),G=f(_*U),ct=f(P*w*M),tt=f(v*D),kt=f((E+_)*(B+U)-Q-G),Ot=tt-ct,He=tt+ct,Ke=f(G-b*Q),_n=f(kt*Ot),Bn=f(He*Ke),An=f(kt*Ke),vn=f(Ot*He);return new x(_n,Bn,vn,An)}subtract(h){return this.add(h.negate())}wNAF(h){return K.wNAFCached(this,d,h,x.normalizeZ)}multiply(h){let{p:b,f:w}=this.wNAF(z(h,r));return x.normalizeZ([b,w])[0]}multiplyUnsafe(h){let b=V(h);return b===Y?X:this.equals(X)||b===F?this:this.equals(C)?this.wNAF(b).p:K.unsafeLadder(this,b)}isSmallOrder(){return this.multiplyUnsafe(c).is0()}isTorsionFree(){return K.unsafeLadder(this,r).is0()}toAffine(h){let{ex:b,ey:w,ez:E}=this,_=this.is0();h==null&&(h=_?Rr:n.inv(E));let v=f(b*h),P=f(w*h),B=f(E*h);if(_)return{x:Y,y:F};if(B!==F)throw new Error("invZ was invalid");return{x:v,y:P}}clearCofactor(){let{h}=t;return h===F?this:this.multiplyUnsafe(h)}static fromHex(h,b=!1){let{d:w,a:E}=t,_=n.BYTES;h=j("pointHex",h,_);let v=h.slice(),P=h[_-1];v[_-1]=P&-129;let B=J(v);B===Y||(b?z(B,u):z(B,n.ORDER));let U=f(B*B),D=f(U-F),M=f(w*U-E),{isValid:Q,value:G}=l(D,M);if(!Q)throw new Error("Point.fromHex: invalid y coordinate");let ct=(G&F)===F,tt=(P&128)!==0;if(!b&&G===Y&&tt)throw new Error("Point.fromHex: x=0 and x_0=1");return tt!==ct&&(G=f(-G)),x.fromAffine({x:G,y:B})}static fromPrivateKey(h){return R(h).point}toRawBytes(){let{x:h,y:b}=this.toAffine(),w=lt(b,n.BYTES);return w[w.length-1]|=h&F?128:0,w}toHex(){return Lt(this.toRawBytes())}}x.BASE=new x(t.Gx,t.Gy,F,f(t.Gx*t.Gy)),x.ZERO=new x(Y,F,F,Y);let{BASE:C,ZERO:X}=x,K=un(x,a*8);function O(p){return H(p,r)}function q(p){return O(J(p))}function R(p){let h=a;p=j("private key",p,h);let b=j("hashed private key",s(p),2*h),w=y(b.slice(0,h)),E=b.slice(h,2*h),_=q(w),v=C.multiply(_),P=v.toRawBytes();return{head:w,prefix:E,scalar:_,point:v,pointBytes:P}}function $(p){return R(p).pointBytes}function T(p=new Uint8Array,...h){let b=Qt(...h);return q(s(A(b,j("context",p),!!o)))}function Bt(p,h,b={}){p=j("message",p),o&&(p=o(p));let{prefix:w,scalar:E,pointBytes:_}=R(h),v=T(b.context,w,p),P=C.multiply(v).toRawBytes(),B=T(b.context,P,_,p),U=O(v+B*E);V(U);let D=Qt(P,lt(U,n.BYTES));return j("result",D,a*2)}let st=Dr;function Ht(p,h,b,w=st){let{context:E,zip215:_}=w,v=n.BYTES;p=j("signature",p,2*v),h=j("message",h),o&&(h=o(h));let P=J(p.slice(v,2*v)),B,U,D;try{B=x.fromHex(b,_),U=x.fromHex(p.slice(0,v),_),D=C.multiplyUnsafe(P)}catch{return!1}if(!_&&B.isSmallOrder())return!1;let M=T(E,U.toRawBytes(),B.toRawBytes(),h);return U.add(B.multiplyUnsafe(M)).subtract(D).clearCofactor().equals(x.ZERO)}return C._setWindowSize(8),{CURVE:t,getPublicKey:$,sign:Bt,verify:Ht,ExtendedPoint:x,utils:{getExtendedPublicKey:R,randomPrivateKey:()=>i(n.BYTES),precompute(p=8,h=x.BASE){return h._setWindowSize(p),h.multiply(BigInt(3)),h}}}}var It=BigInt(0),Se=BigInt(1);function qr(e){return rt(e,{a:"bigint"},{montgomeryBits:"isSafeInteger",nByteLength:"isSafeInteger",adjustScalarBytes:"function",domain:"function",powPminus2:"function",Gu:"bigint"}),Object.freeze({...e})}function ln(e){let t=qr(e),{P:n}=t,r=d=>H(d,n),o=t.montgomeryBits,s=Math.ceil(o/8),i=t.nByteLength,a=t.adjustScalarBytes||(d=>d),c=t.powPminus2||(d=>Be(d,n-BigInt(2),n));function u(d,m,x){let C=r(d*(m-x));return m=r(m-C),x=r(x+C),[m,x]}function f(d){if(typeof d=="bigint"&&It<=d&&d=It;st--){let Ht=C>>st&Se;$^=Ht,T=u($,K,q),K=T[0],q=T[1],T=u($,O,R),O=T[0],R=T[1],$=Ht;let Kt=K+O,p=r(Kt*Kt),h=K-O,b=r(h*h),w=p-b,E=q+R,_=q-R,v=r(_*Kt),P=r(E*h),B=v+P,U=v-P;q=r(B*B),R=r(X*r(U*U)),K=r(p*b),O=r(w*(p+r(l*w)))}T=u($,K,q),K=T[0],q=T[1],T=u($,O,R),O=T[0],R=T[1];let Bt=c(O);return r(K*Bt)}function A(d){return lt(r(d),s)}function L(d){let m=j("u coordinate",d,s);return i===s&&(m[i-1]&=127),J(m)}function I(d){let m=j("scalar",d);if(m.length!==s&&m.length!==i)throw new Error(`Expected ${s} or ${i} bytes, got ${m.length}`);return J(a(m))}function S(d,m){let x=L(m),C=I(d),X=y(x,C);if(X===It)throw new Error("Invalid private or public key received");return A(X)}let z=A(t.Gu);function V(d){return S(d,z)}return{scalarMult:S,scalarMultBase:V,getSharedSecret:(d,m)=>S(d,m),getPublicKey:d=>V(d),utils:{randomPrivateKey:()=>t.randomBytes(t.nByteLength)},GuBytes:z}}var Ut=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),dn=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752"),xi=BigInt(0),Mr=BigInt(1),Le=BigInt(2),Gr=BigInt(5),pn=BigInt(10),jr=BigInt(20),Vr=BigInt(40),yn=BigInt(80);function bn(e){let t=Ut,r=e*e%t*e%t,o=Z(r,Le,t)*r%t,s=Z(o,Mr,t)*e%t,i=Z(s,Gr,t)*s%t,a=Z(i,pn,t)*i%t,c=Z(a,jr,t)*a%t,u=Z(c,Vr,t)*c%t,f=Z(u,yn,t)*u%t,l=Z(f,yn,t)*u%t,y=Z(l,pn,t)*i%t;return{pow_p_5_8:Z(y,Le,t)*e%t,b2:r}}function xn(e){return e[0]&=248,e[31]&=127,e[31]|=64,e}function $r(e,t){let n=Ut,r=H(t*t*t,n),o=H(r*r*t,n),s=bn(e*o).pow_p_5_8,i=H(e*r*s,n),a=H(t*i*i,n),c=i,u=H(i*dn,n),f=a===e,l=a===H(-e,n),y=a===H(-e*dn,n);return f&&(i=c),(l||y)&&(i=u),sn(i,n)&&(i=H(-i,n)),{isValid:f||l,value:i}}var ot=an(Ut,void 0,!0),Ie={a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:ot,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:BigInt(8),Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:ge,randomBytes:pe,adjustScalarBytes:xn,uvRatio:$r},wn=te(Ie);function gn(e,t,n){if(t.length>255)throw new Error("Context is too big");return Ye(le("SigEd25519 no Ed25519 collisions"),new Uint8Array([n?1:0,t.length]),t,e)}var wi=te({...Ie,domain:gn}),gi=te({...Ie,domain:gn,prehash:ge}),Ue=(()=>ln({P:Ut,a:BigInt(486662),montgomeryBits:255,nByteLength:32,Gu:BigInt(9),powPminus2:e=>{let t=Ut,{pow_p_5_8:n,b2:r}=bn(e);return H(Z(n,BigInt(3),t)*r,t)},adjustScalarBytes:xn,randomBytes:pe}))();var Fr=(ot.ORDER+BigInt(3))/BigInt(8),mi=ot.pow(Le,Fr),Ei=ot.sqrt(ot.neg(ot.ONE)),_i=(ot.ORDER-BigInt(5))/BigInt(8),Bi=BigInt(486662);var Ai=fn(ot,ot.neg(BigInt(486664)));var vi=BigInt("25063068953384623474111414158702152701244531502492656460079210482610430750235"),Si=BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"),Li=BigInt("1159843021668779879193775521855586647937357759715417654439879720876111806838"),Ii=BigInt("40440834346308536858101042469323190826248399146238708352240133220865137265952");var Ui=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");var Pt=["deriveBits"],mn=new Uint8Array([100,107,112,95,112,114,107]),En=new Uint8Array([115,107]);var it=class{constructor(t,n,r,o=[]){Object.defineProperty(this,"key",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"type",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"extractable",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"algorithm",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"usages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.key=n,this.type=r,this.algorithm={name:t},this.usages=o,r==="public"&&(this.usages=[])}};var _t="X25519",ee=class{constructor(t){Object.defineProperty(this,"_hkdf",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_nPk",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_nSk",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._hkdf=t,this._nPk=32,this._nSk=32}async serializePublicKey(t){try{return await this._serializePublicKey(t)}catch(n){throw new wt(n)}}async deserializePublicKey(t){try{return await this._importRawKey(t,!0)}catch(n){throw new dt(n)}}async serializePrivateKey(t){try{return await this._serializePrivateKey(t)}catch(n){throw new wt(n)}}async deserializePrivateKey(t){try{return await this._importRawKey(t,!1)}catch(n){throw new dt(n)}}async importKey(t,n,r){try{if(t==="raw")return await this._importRawKey(n,r);if(n instanceof ArrayBuffer)throw new Error("Invalid jwk key format");return await this._importJWK(n,r)}catch(o){throw new dt(o)}}async generateKeyPair(){try{let t=wn.utils.randomPrivateKey(),n=new it(_t,t,"private",Pt);return{publicKey:await this.derivePublicKey(n),privateKey:n}}catch(t){throw new gt(t)}}async deriveKeyPair(t){try{let n=await this._hkdf.labeledExtract(nt,mn,new Uint8Array(t)),r=await this._hkdf.labeledExpand(n,En,nt,this._nSk),o=new it(_t,new Uint8Array(r),"private",Pt);return{privateKey:o,publicKey:await this.derivePublicKey(o)}}catch(n){throw new zt(n)}}async derivePublicKey(t){try{return await this._derivePublicKey(t)}catch(n){throw new dt(n)}}async dh(t,n){try{return await this._dh(t,n)}catch(r){throw new wt(r)}}_serializePublicKey(t){return new Promise(n=>{n(t.key.buffer)})}_serializePrivateKey(t){return new Promise(n=>{n(t.key.buffer)})}_importRawKey(t,n){return new Promise((r,o)=>{n&&t.byteLength!==this._nPk&&o(new Error("Invalid length of the key")),!n&&t.byteLength!==this._nSk&&o(new Error("Invalid length of the key")),r(new it(_t,new Uint8Array(t),n?"public":"private",n?[]:Pt))})}_importJWK(t,n){return new Promise((r,o)=>{(typeof t.kty>"u"||t.kty!=="OKP")&&o(new Error(`Invalid kty: ${t.kty}`)),(typeof t.crv>"u"||t.crv!=="X25519")&&o(new Error(`Invalid crv: ${t.crv}`)),n?(typeof t.d<"u"&&o(new Error("Invalid key: `d` should not be set")),typeof t.x>"u"&&o(new Error("Invalid key: `x` not found")),r(new it(_t,ue(t.x),"public"))):(typeof t.d!="string"&&o(new Error("Invalid key: `d` not found")),r(new it(_t,ue(t.d),"private",Pt)))})}_derivePublicKey(t){return new Promise((n,r)=>{try{let o=Ue.getPublicKey(t.key);n(new it(_t,o,"public"))}catch(o){r(o)}})}_dh(t,n){return new Promise((r,o)=>{try{r(Ue.getSharedSecret(t.key,n.key).buffer)}catch(s){o(s)}})}};var Pe=class extends jt{constructor(){let t=new Gt;super(re.DhkemX25519HkdfSha256,new ee(t),t),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:re.DhkemX25519HkdfSha256}),Object.defineProperty(this,"secretSize",{enumerable:!0,configurable:!0,writable:!0,value:32}),Object.defineProperty(this,"encSize",{enumerable:!0,configurable:!0,writable:!0,value:32}),Object.defineProperty(this,"publicKeySize",{enumerable:!0,configurable:!0,writable:!0,value:32}),Object.defineProperty(this,"privateKeySize",{enumerable:!0,configurable:!0,writable:!0,value:32})}};export{Pe as DhkemX25519HkdfSha256}; /*! Bundled license information: +@noble/hashes/esm/utils.js: + (*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *) + @noble/hashes/esm/utils.js: (*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *) diff --git a/dhkem-x448/docs/assets/main.js b/dhkem-x448/docs/assets/main.js index 3cee05e61..01bcad55f 100644 --- a/dhkem-x448/docs/assets/main.js +++ b/dhkem-x448/docs/assets/main.js @@ -1,7 +1,8 @@ "use strict"; -"use strict";(()=>{var Se=Object.create;var re=Object.defineProperty;var we=Object.getOwnPropertyDescriptor;var Te=Object.getOwnPropertyNames;var ke=Object.getPrototypeOf,Qe=Object.prototype.hasOwnProperty;var Pe=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Ie=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Te(e))!Qe.call(t,i)&&i!==r&&re(t,i,{get:()=>e[i],enumerable:!(n=we(e,i))||n.enumerable});return t};var Ce=(t,e,r)=>(r=t!=null?Se(ke(t)):{},Ie(e||!t||!t.__esModule?re(r,"default",{value:t,enumerable:!0}):r,t));var ae=Pe((se,oe)=>{(function(){var t=function(e){var r=new t.Builder;return r.pipeline.add(t.trimmer,t.stopWordFilter,t.stemmer),r.searchPipeline.add(t.stemmer),e.call(r,r),r.build()};t.version="2.3.9";t.utils={},t.utils.warn=function(e){return function(r){e.console&&console.warn&&console.warn(r)}}(this),t.utils.asString=function(e){return e==null?"":e.toString()},t.utils.clone=function(e){if(e==null)return e;for(var r=Object.create(null),n=Object.keys(e),i=0;i0){var d=t.utils.clone(r)||{};d.position=[a,u],d.index=s.length,s.push(new t.Token(n.slice(a,o),d))}a=o+1}}return s},t.tokenizer.separator=/[\s\-]+/;t.Pipeline=function(){this._stack=[]},t.Pipeline.registeredFunctions=Object.create(null),t.Pipeline.registerFunction=function(e,r){r in this.registeredFunctions&&t.utils.warn("Overwriting existing registered function: "+r),e.label=r,t.Pipeline.registeredFunctions[e.label]=e},t.Pipeline.warnIfFunctionNotRegistered=function(e){var r=e.label&&e.label in this.registeredFunctions;r||t.utils.warn(`Function is not registered with pipeline. This may cause problems when serialising the index. -`,e)},t.Pipeline.load=function(e){var r=new t.Pipeline;return e.forEach(function(n){var i=t.Pipeline.registeredFunctions[n];if(i)r.add(i);else throw new Error("Cannot load unregistered function: "+n)}),r},t.Pipeline.prototype.add=function(){var e=Array.prototype.slice.call(arguments);e.forEach(function(r){t.Pipeline.warnIfFunctionNotRegistered(r),this._stack.push(r)},this)},t.Pipeline.prototype.after=function(e,r){t.Pipeline.warnIfFunctionNotRegistered(r);var n=this._stack.indexOf(e);if(n==-1)throw new Error("Cannot find existingFn");n=n+1,this._stack.splice(n,0,r)},t.Pipeline.prototype.before=function(e,r){t.Pipeline.warnIfFunctionNotRegistered(r);var n=this._stack.indexOf(e);if(n==-1)throw new Error("Cannot find existingFn");this._stack.splice(n,0,r)},t.Pipeline.prototype.remove=function(e){var r=this._stack.indexOf(e);r!=-1&&this._stack.splice(r,1)},t.Pipeline.prototype.run=function(e){for(var r=this._stack.length,n=0;n1&&(oe&&(n=s),o!=e);)i=n-r,s=r+Math.floor(i/2),o=this.elements[s*2];if(o==e||o>e)return s*2;if(ol?d+=2:a==l&&(r+=n[u+1]*i[d+1],u+=2,d+=2);return r},t.Vector.prototype.similarity=function(e){return this.dot(e)/this.magnitude()||0},t.Vector.prototype.toArray=function(){for(var e=new Array(this.elements.length/2),r=1,n=0;r0){var o=s.str.charAt(0),a;o in s.node.edges?a=s.node.edges[o]:(a=new t.TokenSet,s.node.edges[o]=a),s.str.length==1&&(a.final=!0),i.push({node:a,editsRemaining:s.editsRemaining,str:s.str.slice(1)})}if(s.editsRemaining!=0){if("*"in s.node.edges)var l=s.node.edges["*"];else{var l=new t.TokenSet;s.node.edges["*"]=l}if(s.str.length==0&&(l.final=!0),i.push({node:l,editsRemaining:s.editsRemaining-1,str:s.str}),s.str.length>1&&i.push({node:s.node,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)}),s.str.length==1&&(s.node.final=!0),s.str.length>=1){if("*"in s.node.edges)var u=s.node.edges["*"];else{var u=new t.TokenSet;s.node.edges["*"]=u}s.str.length==1&&(u.final=!0),i.push({node:u,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)})}if(s.str.length>1){var d=s.str.charAt(0),m=s.str.charAt(1),y;m in s.node.edges?y=s.node.edges[m]:(y=new t.TokenSet,s.node.edges[m]=y),s.str.length==1&&(y.final=!0),i.push({node:y,editsRemaining:s.editsRemaining-1,str:d+s.str.slice(2)})}}}return n},t.TokenSet.fromString=function(e){for(var r=new t.TokenSet,n=r,i=0,s=e.length;i=e;r--){var n=this.uncheckedNodes[r],i=n.child.toString();i in this.minimizedNodes?n.parent.edges[n.char]=this.minimizedNodes[i]:(n.child._str=i,this.minimizedNodes[i]=n.child),this.uncheckedNodes.pop()}};t.Index=function(e){this.invertedIndex=e.invertedIndex,this.fieldVectors=e.fieldVectors,this.tokenSet=e.tokenSet,this.fields=e.fields,this.pipeline=e.pipeline},t.Index.prototype.search=function(e){return this.query(function(r){var n=new t.QueryParser(e,r);n.parse()})},t.Index.prototype.query=function(e){for(var r=new t.Query(this.fields),n=Object.create(null),i=Object.create(null),s=Object.create(null),o=Object.create(null),a=Object.create(null),l=0;l1?this._b=1:this._b=e},t.Builder.prototype.k1=function(e){this._k1=e},t.Builder.prototype.add=function(e,r){var n=e[this._ref],i=Object.keys(this._fields);this._documents[n]=r||{},this.documentCount+=1;for(var s=0;s=this.length)return t.QueryLexer.EOS;var e=this.str.charAt(this.pos);return this.pos+=1,e},t.QueryLexer.prototype.width=function(){return this.pos-this.start},t.QueryLexer.prototype.ignore=function(){this.start==this.pos&&(this.pos+=1),this.start=this.pos},t.QueryLexer.prototype.backup=function(){this.pos-=1},t.QueryLexer.prototype.acceptDigitRun=function(){var e,r;do e=this.next(),r=e.charCodeAt(0);while(r>47&&r<58);e!=t.QueryLexer.EOS&&this.backup()},t.QueryLexer.prototype.more=function(){return this.pos1&&(e.backup(),e.emit(t.QueryLexer.TERM)),e.ignore(),e.more())return t.QueryLexer.lexText},t.QueryLexer.lexEditDistance=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(t.QueryLexer.EDIT_DISTANCE),t.QueryLexer.lexText},t.QueryLexer.lexBoost=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(t.QueryLexer.BOOST),t.QueryLexer.lexText},t.QueryLexer.lexEOS=function(e){e.width()>0&&e.emit(t.QueryLexer.TERM)},t.QueryLexer.termSeparator=t.tokenizer.separator,t.QueryLexer.lexText=function(e){for(;;){var r=e.next();if(r==t.QueryLexer.EOS)return t.QueryLexer.lexEOS;if(r.charCodeAt(0)==92){e.escapeCharacter();continue}if(r==":")return t.QueryLexer.lexField;if(r=="~")return e.backup(),e.width()>0&&e.emit(t.QueryLexer.TERM),t.QueryLexer.lexEditDistance;if(r=="^")return e.backup(),e.width()>0&&e.emit(t.QueryLexer.TERM),t.QueryLexer.lexBoost;if(r=="+"&&e.width()===1||r=="-"&&e.width()===1)return e.emit(t.QueryLexer.PRESENCE),t.QueryLexer.lexText;if(r.match(t.QueryLexer.termSeparator))return t.QueryLexer.lexTerm}},t.QueryParser=function(e,r){this.lexer=new t.QueryLexer(e),this.query=r,this.currentClause={},this.lexemeIdx=0},t.QueryParser.prototype.parse=function(){this.lexer.run(),this.lexemes=this.lexer.lexemes;for(var e=t.QueryParser.parseClause;e;)e=e(this);return this.query},t.QueryParser.prototype.peekLexeme=function(){return this.lexemes[this.lexemeIdx]},t.QueryParser.prototype.consumeLexeme=function(){var e=this.peekLexeme();return this.lexemeIdx+=1,e},t.QueryParser.prototype.nextClause=function(){var e=this.currentClause;this.query.clause(e),this.currentClause={}},t.QueryParser.parseClause=function(e){var r=e.peekLexeme();if(r!=null)switch(r.type){case t.QueryLexer.PRESENCE:return t.QueryParser.parsePresence;case t.QueryLexer.FIELD:return t.QueryParser.parseField;case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var n="expected either a field or a term, found "+r.type;throw r.str.length>=1&&(n+=" with value '"+r.str+"'"),new t.QueryParseError(n,r.start,r.end)}},t.QueryParser.parsePresence=function(e){var r=e.consumeLexeme();if(r!=null){switch(r.str){case"-":e.currentClause.presence=t.Query.presence.PROHIBITED;break;case"+":e.currentClause.presence=t.Query.presence.REQUIRED;break;default:var n="unrecognised presence operator'"+r.str+"'";throw new t.QueryParseError(n,r.start,r.end)}var i=e.peekLexeme();if(i==null){var n="expecting term or field, found nothing";throw new t.QueryParseError(n,r.start,r.end)}switch(i.type){case t.QueryLexer.FIELD:return t.QueryParser.parseField;case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var n="expecting term or field, found '"+i.type+"'";throw new t.QueryParseError(n,i.start,i.end)}}},t.QueryParser.parseField=function(e){var r=e.consumeLexeme();if(r!=null){if(e.query.allFields.indexOf(r.str)==-1){var n=e.query.allFields.map(function(o){return"'"+o+"'"}).join(", "),i="unrecognised field '"+r.str+"', possible fields: "+n;throw new t.QueryParseError(i,r.start,r.end)}e.currentClause.fields=[r.str];var s=e.peekLexeme();if(s==null){var i="expecting term, found nothing";throw new t.QueryParseError(i,r.start,r.end)}switch(s.type){case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var i="expecting term, found '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},t.QueryParser.parseTerm=function(e){var r=e.consumeLexeme();if(r!=null){e.currentClause.term=r.str.toLowerCase(),r.str.indexOf("*")!=-1&&(e.currentClause.usePipeline=!1);var n=e.peekLexeme();if(n==null){e.nextClause();return}switch(n.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+n.type+"'";throw new t.QueryParseError(i,n.start,n.end)}}},t.QueryParser.parseEditDistance=function(e){var r=e.consumeLexeme();if(r!=null){var n=parseInt(r.str,10);if(isNaN(n)){var i="edit distance must be numeric";throw new t.QueryParseError(i,r.start,r.end)}e.currentClause.editDistance=n;var s=e.peekLexeme();if(s==null){e.nextClause();return}switch(s.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},t.QueryParser.parseBoost=function(e){var r=e.consumeLexeme();if(r!=null){var n=parseInt(r.str,10);if(isNaN(n)){var i="boost must be numeric";throw new t.QueryParseError(i,r.start,r.end)}e.currentClause.boost=n;var s=e.peekLexeme();if(s==null){e.nextClause();return}switch(s.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},function(e,r){typeof define=="function"&&define.amd?define(r):typeof se=="object"?oe.exports=r():e.lunr=r()}(this,function(){return t})})()});var ne=[];function G(t,e){ne.push({selector:e,constructor:t})}var U=class{constructor(){this.alwaysVisibleMember=null;this.createComponents(document.body),this.ensureActivePageVisible(),this.ensureFocusedElementVisible(),this.listenForCodeCopies(),window.addEventListener("hashchange",()=>this.ensureFocusedElementVisible())}createComponents(e){ne.forEach(r=>{e.querySelectorAll(r.selector).forEach(n=>{n.dataset.hasInstance||(new r.constructor({el:n,app:this}),n.dataset.hasInstance=String(!0))})})}filterChanged(){this.ensureFocusedElementVisible()}ensureActivePageVisible(){let e=document.querySelector(".tsd-navigation .current"),r=e?.parentElement;for(;r&&!r.classList.contains(".tsd-navigation");)r instanceof HTMLDetailsElement&&(r.open=!0),r=r.parentElement;if(e){let n=e.getBoundingClientRect().top-document.documentElement.clientHeight/4;document.querySelector(".site-menu").scrollTop=n}}ensureFocusedElementVisible(){if(this.alwaysVisibleMember&&(this.alwaysVisibleMember.classList.remove("always-visible"),this.alwaysVisibleMember.firstElementChild.remove(),this.alwaysVisibleMember=null),!location.hash)return;let e=document.getElementById(location.hash.substring(1));if(!e)return;let r=e.parentElement;for(;r&&r.tagName!=="SECTION";)r=r.parentElement;if(r&&r.offsetParent==null){this.alwaysVisibleMember=r,r.classList.add("always-visible");let n=document.createElement("p");n.classList.add("warning"),n.textContent="This member is normally hidden due to your filter settings.",r.prepend(n)}}listenForCodeCopies(){document.querySelectorAll("pre > button").forEach(e=>{let r;e.addEventListener("click",()=>{e.previousElementSibling instanceof HTMLElement&&navigator.clipboard.writeText(e.previousElementSibling.innerText.trim()),e.textContent="Copied!",e.classList.add("visible"),clearTimeout(r),r=setTimeout(()=>{e.classList.remove("visible"),r=setTimeout(()=>{e.textContent="Copy"},100)},1e3)})})}};var ie=(t,e=100)=>{let r;return()=>{clearTimeout(r),r=setTimeout(()=>t(),e)}};var ce=Ce(ae());function de(){let t=document.getElementById("tsd-search");if(!t)return;let e=document.getElementById("tsd-search-script");t.classList.add("loading"),e&&(e.addEventListener("error",()=>{t.classList.remove("loading"),t.classList.add("failure")}),e.addEventListener("load",()=>{t.classList.remove("loading"),t.classList.add("ready")}),window.searchData&&t.classList.remove("loading"));let r=document.querySelector("#tsd-search input"),n=document.querySelector("#tsd-search .results");if(!r||!n)throw new Error("The input field or the result list wrapper was not found");let i=!1;n.addEventListener("mousedown",()=>i=!0),n.addEventListener("mouseup",()=>{i=!1,t.classList.remove("has-focus")}),r.addEventListener("focus",()=>t.classList.add("has-focus")),r.addEventListener("blur",()=>{i||(i=!1,t.classList.remove("has-focus"))});let s={base:t.dataset.base+"/"};Oe(t,n,r,s)}function Oe(t,e,r,n){r.addEventListener("input",ie(()=>{Re(t,e,r,n)},200));let i=!1;r.addEventListener("keydown",s=>{i=!0,s.key=="Enter"?Fe(e,r):s.key=="Escape"?r.blur():s.key=="ArrowUp"?ue(e,-1):s.key==="ArrowDown"?ue(e,1):i=!1}),r.addEventListener("keypress",s=>{i&&s.preventDefault()}),document.body.addEventListener("keydown",s=>{s.altKey||s.ctrlKey||s.metaKey||!r.matches(":focus")&&s.key==="/"&&(r.focus(),s.preventDefault())})}function _e(t,e){t.index||window.searchData&&(e.classList.remove("loading"),e.classList.add("ready"),t.data=window.searchData,t.index=ce.Index.load(window.searchData.index))}function Re(t,e,r,n){if(_e(n,t),!n.index||!n.data)return;e.textContent="";let i=r.value.trim(),s=i?n.index.search(`*${i}*`):[];for(let o=0;oa.score-o.score);for(let o=0,a=Math.min(10,s.length);o${le(l.parent,i)}.${u}`);let d=document.createElement("li");d.classList.value=l.classes??"";let m=document.createElement("a");m.href=n.base+l.url,m.innerHTML=u,d.append(m),e.appendChild(d)}}function ue(t,e){let r=t.querySelector(".current");if(!r)r=t.querySelector(e==1?"li:first-child":"li:last-child"),r&&r.classList.add("current");else{let n=r;if(e===1)do n=n.nextElementSibling??void 0;while(n instanceof HTMLElement&&n.offsetParent==null);else do n=n.previousElementSibling??void 0;while(n instanceof HTMLElement&&n.offsetParent==null);n&&(r.classList.remove("current"),n.classList.add("current"))}}function Fe(t,e){let r=t.querySelector(".current");if(r||(r=t.querySelector("li:first-child")),r){let n=r.querySelector("a");n&&(window.location.href=n.href),e.blur()}}function le(t,e){if(e==="")return t;let r=t.toLocaleLowerCase(),n=e.toLocaleLowerCase(),i=[],s=0,o=r.indexOf(n);for(;o!=-1;)i.push(K(t.substring(s,o)),`${K(t.substring(o,o+n.length))}`),s=o+n.length,o=r.indexOf(n,s);return i.push(K(t.substring(s))),i.join("")}var Me={"&":"&","<":"<",">":">","'":"'",'"':"""};function K(t){return t.replace(/[&<>"'"]/g,e=>Me[e])}var P=class{constructor(e){this.el=e.el,this.app=e.app}};var M="mousedown",fe="mousemove",N="mouseup",J={x:0,y:0},he=!1,ee=!1,De=!1,D=!1,pe=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);document.documentElement.classList.add(pe?"is-mobile":"not-mobile");pe&&"ontouchstart"in document.documentElement&&(De=!0,M="touchstart",fe="touchmove",N="touchend");document.addEventListener(M,t=>{ee=!0,D=!1;let e=M=="touchstart"?t.targetTouches[0]:t;J.y=e.pageY||0,J.x=e.pageX||0});document.addEventListener(fe,t=>{if(ee&&!D){let e=M=="touchstart"?t.targetTouches[0]:t,r=J.x-(e.pageX||0),n=J.y-(e.pageY||0);D=Math.sqrt(r*r+n*n)>10}});document.addEventListener(N,()=>{ee=!1});document.addEventListener("click",t=>{he&&(t.preventDefault(),t.stopImmediatePropagation(),he=!1)});var X=class extends P{constructor(r){super(r);this.className=this.el.dataset.toggle||"",this.el.addEventListener(N,n=>this.onPointerUp(n)),this.el.addEventListener("click",n=>n.preventDefault()),document.addEventListener(M,n=>this.onDocumentPointerDown(n)),document.addEventListener(N,n=>this.onDocumentPointerUp(n))}setActive(r){if(this.active==r)return;this.active=r,document.documentElement.classList.toggle("has-"+this.className,r),this.el.classList.toggle("active",r);let n=(this.active?"to-has-":"from-has-")+this.className;document.documentElement.classList.add(n),setTimeout(()=>document.documentElement.classList.remove(n),500)}onPointerUp(r){D||(this.setActive(!0),r.preventDefault())}onDocumentPointerDown(r){if(this.active){if(r.target.closest(".col-sidebar, .tsd-filter-group"))return;this.setActive(!1)}}onDocumentPointerUp(r){if(!D&&this.active&&r.target.closest(".col-sidebar")){let n=r.target.closest("a");if(n){let i=window.location.href;i.indexOf("#")!=-1&&(i=i.substring(0,i.indexOf("#"))),n.href.substring(0,i.length)==i&&setTimeout(()=>this.setActive(!1),250)}}}};var te;try{te=localStorage}catch{te={getItem(){return null},setItem(){}}}var Q=te;var me=document.head.appendChild(document.createElement("style"));me.dataset.for="filters";var Y=class extends P{constructor(r){super(r);this.key=`filter-${this.el.name}`,this.value=this.el.checked,this.el.addEventListener("change",()=>{this.setLocalStorage(this.el.checked)}),this.setLocalStorage(this.fromLocalStorage()),me.innerHTML+=`html:not(.${this.key}) .tsd-is-${this.el.name} { display: none; } -`}fromLocalStorage(){let r=Q.getItem(this.key);return r?r==="true":this.el.checked}setLocalStorage(r){Q.setItem(this.key,r.toString()),this.value=r,this.handleValueChange()}handleValueChange(){this.el.checked=this.value,document.documentElement.classList.toggle(this.key,this.value),this.app.filterChanged(),document.querySelectorAll(".tsd-index-section").forEach(r=>{r.style.display="block";let n=Array.from(r.querySelectorAll(".tsd-index-link")).every(i=>i.offsetParent==null);r.style.display=n?"none":"block"})}};var Z=class extends P{constructor(r){super(r);this.summary=this.el.querySelector(".tsd-accordion-summary"),this.icon=this.summary.querySelector("svg"),this.key=`tsd-accordion-${this.summary.dataset.key??this.summary.textContent.trim().replace(/\s+/g,"-").toLowerCase()}`;let n=Q.getItem(this.key);this.el.open=n?n==="true":this.el.open,this.el.addEventListener("toggle",()=>this.update()),this.update()}update(){this.icon.style.transform=`rotate(${this.el.open?0:-90}deg)`,Q.setItem(this.key,this.el.open.toString())}};function ve(t){let e=Q.getItem("tsd-theme")||"os";t.value=e,ye(e),t.addEventListener("change",()=>{Q.setItem("tsd-theme",t.value),ye(t.value)})}function ye(t){document.documentElement.dataset.theme=t}de();G(X,"a[data-toggle]");G(Z,".tsd-index-accordion");G(Y,".tsd-filter-item input[type=checkbox]");var ge=document.getElementById("tsd-theme");ge&&ve(ge);var Ae=new U;Object.defineProperty(window,"app",{value:Ae});document.querySelectorAll("summary a").forEach(t=>{t.addEventListener("click",()=>{location.assign(t.href)})});})(); +"use strict";(()=>{var Pe=Object.create;var ne=Object.defineProperty;var Ie=Object.getOwnPropertyDescriptor;var Oe=Object.getOwnPropertyNames;var _e=Object.getPrototypeOf,Re=Object.prototype.hasOwnProperty;var Me=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Fe=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Oe(e))!Re.call(t,i)&&i!==n&&ne(t,i,{get:()=>e[i],enumerable:!(r=Ie(e,i))||r.enumerable});return t};var De=(t,e,n)=>(n=t!=null?Pe(_e(t)):{},Fe(e||!t||!t.__esModule?ne(n,"default",{value:t,enumerable:!0}):n,t));var ae=Me((se,oe)=>{(function(){var t=function(e){var n=new t.Builder;return n.pipeline.add(t.trimmer,t.stopWordFilter,t.stemmer),n.searchPipeline.add(t.stemmer),e.call(n,n),n.build()};t.version="2.3.9";t.utils={},t.utils.warn=function(e){return function(n){e.console&&console.warn&&console.warn(n)}}(this),t.utils.asString=function(e){return e==null?"":e.toString()},t.utils.clone=function(e){if(e==null)return e;for(var n=Object.create(null),r=Object.keys(e),i=0;i0){var d=t.utils.clone(n)||{};d.position=[a,u],d.index=s.length,s.push(new t.Token(r.slice(a,o),d))}a=o+1}}return s},t.tokenizer.separator=/[\s\-]+/;t.Pipeline=function(){this._stack=[]},t.Pipeline.registeredFunctions=Object.create(null),t.Pipeline.registerFunction=function(e,n){n in this.registeredFunctions&&t.utils.warn("Overwriting existing registered function: "+n),e.label=n,t.Pipeline.registeredFunctions[e.label]=e},t.Pipeline.warnIfFunctionNotRegistered=function(e){var n=e.label&&e.label in this.registeredFunctions;n||t.utils.warn(`Function is not registered with pipeline. This may cause problems when serialising the index. +`,e)},t.Pipeline.load=function(e){var n=new t.Pipeline;return e.forEach(function(r){var i=t.Pipeline.registeredFunctions[r];if(i)n.add(i);else throw new Error("Cannot load unregistered function: "+r)}),n},t.Pipeline.prototype.add=function(){var e=Array.prototype.slice.call(arguments);e.forEach(function(n){t.Pipeline.warnIfFunctionNotRegistered(n),this._stack.push(n)},this)},t.Pipeline.prototype.after=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var r=this._stack.indexOf(e);if(r==-1)throw new Error("Cannot find existingFn");r=r+1,this._stack.splice(r,0,n)},t.Pipeline.prototype.before=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var r=this._stack.indexOf(e);if(r==-1)throw new Error("Cannot find existingFn");this._stack.splice(r,0,n)},t.Pipeline.prototype.remove=function(e){var n=this._stack.indexOf(e);n!=-1&&this._stack.splice(n,1)},t.Pipeline.prototype.run=function(e){for(var n=this._stack.length,r=0;r1&&(oe&&(r=s),o!=e);)i=r-n,s=n+Math.floor(i/2),o=this.elements[s*2];if(o==e||o>e)return s*2;if(ol?d+=2:a==l&&(n+=r[u+1]*i[d+1],u+=2,d+=2);return n},t.Vector.prototype.similarity=function(e){return this.dot(e)/this.magnitude()||0},t.Vector.prototype.toArray=function(){for(var e=new Array(this.elements.length/2),n=1,r=0;n0){var o=s.str.charAt(0),a;o in s.node.edges?a=s.node.edges[o]:(a=new t.TokenSet,s.node.edges[o]=a),s.str.length==1&&(a.final=!0),i.push({node:a,editsRemaining:s.editsRemaining,str:s.str.slice(1)})}if(s.editsRemaining!=0){if("*"in s.node.edges)var l=s.node.edges["*"];else{var l=new t.TokenSet;s.node.edges["*"]=l}if(s.str.length==0&&(l.final=!0),i.push({node:l,editsRemaining:s.editsRemaining-1,str:s.str}),s.str.length>1&&i.push({node:s.node,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)}),s.str.length==1&&(s.node.final=!0),s.str.length>=1){if("*"in s.node.edges)var u=s.node.edges["*"];else{var u=new t.TokenSet;s.node.edges["*"]=u}s.str.length==1&&(u.final=!0),i.push({node:u,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)})}if(s.str.length>1){var d=s.str.charAt(0),v=s.str.charAt(1),f;v in s.node.edges?f=s.node.edges[v]:(f=new t.TokenSet,s.node.edges[v]=f),s.str.length==1&&(f.final=!0),i.push({node:f,editsRemaining:s.editsRemaining-1,str:d+s.str.slice(2)})}}}return r},t.TokenSet.fromString=function(e){for(var n=new t.TokenSet,r=n,i=0,s=e.length;i=e;n--){var r=this.uncheckedNodes[n],i=r.child.toString();i in this.minimizedNodes?r.parent.edges[r.char]=this.minimizedNodes[i]:(r.child._str=i,this.minimizedNodes[i]=r.child),this.uncheckedNodes.pop()}};t.Index=function(e){this.invertedIndex=e.invertedIndex,this.fieldVectors=e.fieldVectors,this.tokenSet=e.tokenSet,this.fields=e.fields,this.pipeline=e.pipeline},t.Index.prototype.search=function(e){return this.query(function(n){var r=new t.QueryParser(e,n);r.parse()})},t.Index.prototype.query=function(e){for(var n=new t.Query(this.fields),r=Object.create(null),i=Object.create(null),s=Object.create(null),o=Object.create(null),a=Object.create(null),l=0;l1?this._b=1:this._b=e},t.Builder.prototype.k1=function(e){this._k1=e},t.Builder.prototype.add=function(e,n){var r=e[this._ref],i=Object.keys(this._fields);this._documents[r]=n||{},this.documentCount+=1;for(var s=0;s=this.length)return t.QueryLexer.EOS;var e=this.str.charAt(this.pos);return this.pos+=1,e},t.QueryLexer.prototype.width=function(){return this.pos-this.start},t.QueryLexer.prototype.ignore=function(){this.start==this.pos&&(this.pos+=1),this.start=this.pos},t.QueryLexer.prototype.backup=function(){this.pos-=1},t.QueryLexer.prototype.acceptDigitRun=function(){var e,n;do e=this.next(),n=e.charCodeAt(0);while(n>47&&n<58);e!=t.QueryLexer.EOS&&this.backup()},t.QueryLexer.prototype.more=function(){return this.pos1&&(e.backup(),e.emit(t.QueryLexer.TERM)),e.ignore(),e.more())return t.QueryLexer.lexText},t.QueryLexer.lexEditDistance=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(t.QueryLexer.EDIT_DISTANCE),t.QueryLexer.lexText},t.QueryLexer.lexBoost=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(t.QueryLexer.BOOST),t.QueryLexer.lexText},t.QueryLexer.lexEOS=function(e){e.width()>0&&e.emit(t.QueryLexer.TERM)},t.QueryLexer.termSeparator=t.tokenizer.separator,t.QueryLexer.lexText=function(e){for(;;){var n=e.next();if(n==t.QueryLexer.EOS)return t.QueryLexer.lexEOS;if(n.charCodeAt(0)==92){e.escapeCharacter();continue}if(n==":")return t.QueryLexer.lexField;if(n=="~")return e.backup(),e.width()>0&&e.emit(t.QueryLexer.TERM),t.QueryLexer.lexEditDistance;if(n=="^")return e.backup(),e.width()>0&&e.emit(t.QueryLexer.TERM),t.QueryLexer.lexBoost;if(n=="+"&&e.width()===1||n=="-"&&e.width()===1)return e.emit(t.QueryLexer.PRESENCE),t.QueryLexer.lexText;if(n.match(t.QueryLexer.termSeparator))return t.QueryLexer.lexTerm}},t.QueryParser=function(e,n){this.lexer=new t.QueryLexer(e),this.query=n,this.currentClause={},this.lexemeIdx=0},t.QueryParser.prototype.parse=function(){this.lexer.run(),this.lexemes=this.lexer.lexemes;for(var e=t.QueryParser.parseClause;e;)e=e(this);return this.query},t.QueryParser.prototype.peekLexeme=function(){return this.lexemes[this.lexemeIdx]},t.QueryParser.prototype.consumeLexeme=function(){var e=this.peekLexeme();return this.lexemeIdx+=1,e},t.QueryParser.prototype.nextClause=function(){var e=this.currentClause;this.query.clause(e),this.currentClause={}},t.QueryParser.parseClause=function(e){var n=e.peekLexeme();if(n!=null)switch(n.type){case t.QueryLexer.PRESENCE:return t.QueryParser.parsePresence;case t.QueryLexer.FIELD:return t.QueryParser.parseField;case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var r="expected either a field or a term, found "+n.type;throw n.str.length>=1&&(r+=" with value '"+n.str+"'"),new t.QueryParseError(r,n.start,n.end)}},t.QueryParser.parsePresence=function(e){var n=e.consumeLexeme();if(n!=null){switch(n.str){case"-":e.currentClause.presence=t.Query.presence.PROHIBITED;break;case"+":e.currentClause.presence=t.Query.presence.REQUIRED;break;default:var r="unrecognised presence operator'"+n.str+"'";throw new t.QueryParseError(r,n.start,n.end)}var i=e.peekLexeme();if(i==null){var r="expecting term or field, found nothing";throw new t.QueryParseError(r,n.start,n.end)}switch(i.type){case t.QueryLexer.FIELD:return t.QueryParser.parseField;case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var r="expecting term or field, found '"+i.type+"'";throw new t.QueryParseError(r,i.start,i.end)}}},t.QueryParser.parseField=function(e){var n=e.consumeLexeme();if(n!=null){if(e.query.allFields.indexOf(n.str)==-1){var r=e.query.allFields.map(function(o){return"'"+o+"'"}).join(", "),i="unrecognised field '"+n.str+"', possible fields: "+r;throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.fields=[n.str];var s=e.peekLexeme();if(s==null){var i="expecting term, found nothing";throw new t.QueryParseError(i,n.start,n.end)}switch(s.type){case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var i="expecting term, found '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},t.QueryParser.parseTerm=function(e){var n=e.consumeLexeme();if(n!=null){e.currentClause.term=n.str.toLowerCase(),n.str.indexOf("*")!=-1&&(e.currentClause.usePipeline=!1);var r=e.peekLexeme();if(r==null){e.nextClause();return}switch(r.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+r.type+"'";throw new t.QueryParseError(i,r.start,r.end)}}},t.QueryParser.parseEditDistance=function(e){var n=e.consumeLexeme();if(n!=null){var r=parseInt(n.str,10);if(isNaN(r)){var i="edit distance must be numeric";throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.editDistance=r;var s=e.peekLexeme();if(s==null){e.nextClause();return}switch(s.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},t.QueryParser.parseBoost=function(e){var n=e.consumeLexeme();if(n!=null){var r=parseInt(n.str,10);if(isNaN(r)){var i="boost must be numeric";throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.boost=r;var s=e.peekLexeme();if(s==null){e.nextClause();return}switch(s.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},function(e,n){typeof define=="function"&&define.amd?define(n):typeof se=="object"?oe.exports=n():e.lunr=n()}(this,function(){return t})})()});var re=[];function G(t,e){re.push({selector:e,constructor:t})}var U=class{constructor(){this.alwaysVisibleMember=null;this.createComponents(document.body),this.ensureActivePageVisible(),this.ensureFocusedElementVisible(),this.listenForCodeCopies(),window.addEventListener("hashchange",()=>this.ensureFocusedElementVisible())}createComponents(e){re.forEach(n=>{e.querySelectorAll(n.selector).forEach(r=>{r.dataset.hasInstance||(new n.constructor({el:r,app:this}),r.dataset.hasInstance=String(!0))})})}filterChanged(){this.ensureFocusedElementVisible()}ensureActivePageVisible(){let e=document.querySelector(".tsd-navigation .current"),n=e?.parentElement;for(;n&&!n.classList.contains(".tsd-navigation");)n instanceof HTMLDetailsElement&&(n.open=!0),n=n.parentElement;if(e){let r=e.getBoundingClientRect().top-document.documentElement.clientHeight/4;document.querySelector(".site-menu").scrollTop=r}}ensureFocusedElementVisible(){if(this.alwaysVisibleMember&&(this.alwaysVisibleMember.classList.remove("always-visible"),this.alwaysVisibleMember.firstElementChild.remove(),this.alwaysVisibleMember=null),!location.hash)return;let e=document.getElementById(location.hash.substring(1));if(!e)return;let n=e.parentElement;for(;n&&n.tagName!=="SECTION";)n=n.parentElement;if(n&&n.offsetParent==null){this.alwaysVisibleMember=n,n.classList.add("always-visible");let r=document.createElement("p");r.classList.add("warning"),r.textContent="This member is normally hidden due to your filter settings.",n.prepend(r)}}listenForCodeCopies(){document.querySelectorAll("pre > button").forEach(e=>{let n;e.addEventListener("click",()=>{e.previousElementSibling instanceof HTMLElement&&navigator.clipboard.writeText(e.previousElementSibling.innerText.trim()),e.textContent="Copied!",e.classList.add("visible"),clearTimeout(n),n=setTimeout(()=>{e.classList.remove("visible"),n=setTimeout(()=>{e.textContent="Copy"},100)},1e3)})})}};var ie=(t,e=100)=>{let n;return()=>{clearTimeout(n),n=setTimeout(()=>t(),e)}};var de=De(ae());async function le(t,e){if(!window.searchData)return;let n=await fetch(window.searchData),r=new Blob([await n.arrayBuffer()]).stream().pipeThrough(new DecompressionStream("gzip")),i=await new Response(r).json();t.data=i,t.index=de.Index.load(i.index),e.classList.remove("loading"),e.classList.add("ready")}function he(){let t=document.getElementById("tsd-search");if(!t)return;let e={base:t.dataset.base+"/"},n=document.getElementById("tsd-search-script");t.classList.add("loading"),n&&(n.addEventListener("error",()=>{t.classList.remove("loading"),t.classList.add("failure")}),n.addEventListener("load",()=>{le(e,t)}),le(e,t));let r=document.querySelector("#tsd-search input"),i=document.querySelector("#tsd-search .results");if(!r||!i)throw new Error("The input field or the result list wrapper was not found");let s=!1;i.addEventListener("mousedown",()=>s=!0),i.addEventListener("mouseup",()=>{s=!1,t.classList.remove("has-focus")}),r.addEventListener("focus",()=>t.classList.add("has-focus")),r.addEventListener("blur",()=>{s||(s=!1,t.classList.remove("has-focus"))}),Ae(t,i,r,e)}function Ae(t,e,n,r){n.addEventListener("input",ie(()=>{Ne(t,e,n,r)},200));let i=!1;n.addEventListener("keydown",s=>{i=!0,s.key=="Enter"?Ve(e,n):s.key=="Escape"?n.blur():s.key=="ArrowUp"?ue(e,-1):s.key==="ArrowDown"?ue(e,1):i=!1}),n.addEventListener("keypress",s=>{i&&s.preventDefault()}),document.body.addEventListener("keydown",s=>{s.altKey||s.ctrlKey||s.metaKey||!n.matches(":focus")&&s.key==="/"&&(n.focus(),s.preventDefault())})}function Ne(t,e,n,r){if(!r.index||!r.data)return;e.textContent="";let i=n.value.trim(),s=i?r.index.search(`*${i}*`):[];for(let o=0;oa.score-o.score);for(let o=0,a=Math.min(10,s.length);o`,d=ce(l.name,i);globalThis.DEBUG_SEARCH_WEIGHTS&&(d+=` (score: ${s[o].score.toFixed(2)})`),l.parent&&(d=` + ${ce(l.parent,i)}.${d}`);let v=document.createElement("li");v.classList.value=l.classes??"";let f=document.createElement("a");f.href=r.base+l.url,f.innerHTML=u+d,v.append(f),e.appendChild(v)}}function ue(t,e){let n=t.querySelector(".current");if(!n)n=t.querySelector(e==1?"li:first-child":"li:last-child"),n&&n.classList.add("current");else{let r=n;if(e===1)do r=r.nextElementSibling??void 0;while(r instanceof HTMLElement&&r.offsetParent==null);else do r=r.previousElementSibling??void 0;while(r instanceof HTMLElement&&r.offsetParent==null);r&&(n.classList.remove("current"),r.classList.add("current"))}}function Ve(t,e){let n=t.querySelector(".current");if(n||(n=t.querySelector("li:first-child")),n){let r=n.querySelector("a");r&&(window.location.href=r.href),e.blur()}}function ce(t,e){if(e==="")return t;let n=t.toLocaleLowerCase(),r=e.toLocaleLowerCase(),i=[],s=0,o=n.indexOf(r);for(;o!=-1;)i.push(K(t.substring(s,o)),`${K(t.substring(o,o+r.length))}`),s=o+r.length,o=n.indexOf(r,s);return i.push(K(t.substring(s))),i.join("")}var Be={"&":"&","<":"<",">":">","'":"'",'"':"""};function K(t){return t.replace(/[&<>"'"]/g,e=>Be[e])}var C=class{constructor(e){this.el=e.el,this.app=e.app}};var F="mousedown",pe="mousemove",B="mouseup",J={x:0,y:0},fe=!1,ee=!1,He=!1,D=!1,me=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);document.documentElement.classList.add(me?"is-mobile":"not-mobile");me&&"ontouchstart"in document.documentElement&&(He=!0,F="touchstart",pe="touchmove",B="touchend");document.addEventListener(F,t=>{ee=!0,D=!1;let e=F=="touchstart"?t.targetTouches[0]:t;J.y=e.pageY||0,J.x=e.pageX||0});document.addEventListener(pe,t=>{if(ee&&!D){let e=F=="touchstart"?t.targetTouches[0]:t,n=J.x-(e.pageX||0),r=J.y-(e.pageY||0);D=Math.sqrt(n*n+r*r)>10}});document.addEventListener(B,()=>{ee=!1});document.addEventListener("click",t=>{fe&&(t.preventDefault(),t.stopImmediatePropagation(),fe=!1)});var X=class extends C{constructor(n){super(n);this.className=this.el.dataset.toggle||"",this.el.addEventListener(B,r=>this.onPointerUp(r)),this.el.addEventListener("click",r=>r.preventDefault()),document.addEventListener(F,r=>this.onDocumentPointerDown(r)),document.addEventListener(B,r=>this.onDocumentPointerUp(r))}setActive(n){if(this.active==n)return;this.active=n,document.documentElement.classList.toggle("has-"+this.className,n),this.el.classList.toggle("active",n);let r=(this.active?"to-has-":"from-has-")+this.className;document.documentElement.classList.add(r),setTimeout(()=>document.documentElement.classList.remove(r),500)}onPointerUp(n){D||(this.setActive(!0),n.preventDefault())}onDocumentPointerDown(n){if(this.active){if(n.target.closest(".col-sidebar, .tsd-filter-group"))return;this.setActive(!1)}}onDocumentPointerUp(n){if(!D&&this.active&&n.target.closest(".col-sidebar")){let r=n.target.closest("a");if(r){let i=window.location.href;i.indexOf("#")!=-1&&(i=i.substring(0,i.indexOf("#"))),r.href.substring(0,i.length)==i&&setTimeout(()=>this.setActive(!1),250)}}}};var te;try{te=localStorage}catch{te={getItem(){return null},setItem(){}}}var Q=te;var ve=document.head.appendChild(document.createElement("style"));ve.dataset.for="filters";var Y=class extends C{constructor(n){super(n);this.key=`filter-${this.el.name}`,this.value=this.el.checked,this.el.addEventListener("change",()=>{this.setLocalStorage(this.el.checked)}),this.setLocalStorage(this.fromLocalStorage()),ve.innerHTML+=`html:not(.${this.key}) .tsd-is-${this.el.name} { display: none; } +`}fromLocalStorage(){let n=Q.getItem(this.key);return n?n==="true":this.el.checked}setLocalStorage(n){Q.setItem(this.key,n.toString()),this.value=n,this.handleValueChange()}handleValueChange(){this.el.checked=this.value,document.documentElement.classList.toggle(this.key,this.value),this.app.filterChanged(),document.querySelectorAll(".tsd-index-section").forEach(n=>{n.style.display="block";let r=Array.from(n.querySelectorAll(".tsd-index-link")).every(i=>i.offsetParent==null);n.style.display=r?"none":"block"})}};var Z=class extends C{constructor(n){super(n);this.summary=this.el.querySelector(".tsd-accordion-summary"),this.icon=this.summary.querySelector("svg"),this.key=`tsd-accordion-${this.summary.dataset.key??this.summary.textContent.trim().replace(/\s+/g,"-").toLowerCase()}`;let r=Q.getItem(this.key);this.el.open=r?r==="true":this.el.open,this.el.addEventListener("toggle",()=>this.update());let i=this.summary.querySelector("a");i&&i.addEventListener("click",()=>{location.assign(i.href)}),this.update()}update(){this.icon.style.transform=`rotate(${this.el.open?0:-90}deg)`,Q.setItem(this.key,this.el.open.toString())}};function ge(t){let e=Q.getItem("tsd-theme")||"os";t.value=e,ye(e),t.addEventListener("change",()=>{Q.setItem("tsd-theme",t.value),ye(t.value)})}function ye(t){document.documentElement.dataset.theme=t}var Le;function be(){let t=document.getElementById("tsd-nav-script");t&&(t.addEventListener("load",xe),xe())}async function xe(){let t=document.getElementById("tsd-nav-container");if(!t||!window.navigationData)return;let n=await(await fetch(window.navigationData)).arrayBuffer(),r=new Blob([n]).stream().pipeThrough(new DecompressionStream("gzip")),i=await new Response(r).json();Le=t.dataset.base+"/",t.innerHTML="";for(let s of i)we(s,t,[]);window.app.createComponents(t),window.app.ensureActivePageVisible()}function we(t,e,n){let r=e.appendChild(document.createElement("li"));if(t.children){let i=[...n,t.text],s=r.appendChild(document.createElement("details"));s.className=t.class?`${t.class} tsd-index-accordion`:"tsd-index-accordion",s.dataset.key=i.join("$");let o=s.appendChild(document.createElement("summary"));o.className="tsd-accordion-summary",o.innerHTML='',Ee(t,o);let a=s.appendChild(document.createElement("div"));a.className="tsd-accordion-details";let l=a.appendChild(document.createElement("ul"));l.className="tsd-nested-navigation";for(let u of t.children)we(u,l,i)}else Ee(t,r,t.class)}function Ee(t,e,n){if(t.path){let r=e.appendChild(document.createElement("a"));r.href=Le+t.path,n&&(r.className=n),location.href===r.href&&r.classList.add("current"),t.kind&&(r.innerHTML=``),r.appendChild(document.createElement("span")).textContent=t.text}else e.appendChild(document.createElement("span")).textContent=t.text}G(X,"a[data-toggle]");G(Z,".tsd-index-accordion");G(Y,".tsd-filter-item input[type=checkbox]");var Se=document.getElementById("tsd-theme");Se&&ge(Se);var je=new U;Object.defineProperty(window,"app",{value:je});he();be();})(); /*! Bundled license information: lunr/lunr.js: diff --git a/dhkem-x448/docs/assets/navigation.js b/dhkem-x448/docs/assets/navigation.js new file mode 100644 index 000000000..a93240372 --- /dev/null +++ b/dhkem-x448/docs/assets/navigation.js @@ -0,0 +1 @@ +window.navigationData = "data:application/octet-stream;base64,H4sIAAAAAAAAA4uuVipJrShRslJyychOzY0wMbHwyE5JC85INDU0UtJRKkgsyQBKJuckFhenFutjUaSXUZKbA1SZnZmXomRlaGRRGwsAR1aiYFUAAAA=" \ No newline at end of file diff --git a/dhkem-x448/docs/assets/search.js b/dhkem-x448/docs/assets/search.js index c741ce2b9..0b9457579 100644 --- a/dhkem-x448/docs/assets/search.js +++ b/dhkem-x448/docs/assets/search.js @@ -1 +1 @@ -window.searchData = JSON.parse("{\"rows\":[{\"kind\":128,\"name\":\"DhkemX448HkdfSha512\",\"url\":\"classes/DhkemX448HkdfSha512.html\",\"classes\":\"\"},{\"kind\":512,\"name\":\"constructor\",\"url\":\"classes/DhkemX448HkdfSha512.html#constructor\",\"classes\":\"\",\"parent\":\"DhkemX448HkdfSha512\"},{\"kind\":1024,\"name\":\"id\",\"url\":\"classes/DhkemX448HkdfSha512.html#id\",\"classes\":\"\",\"parent\":\"DhkemX448HkdfSha512\"},{\"kind\":1024,\"name\":\"secretSize\",\"url\":\"classes/DhkemX448HkdfSha512.html#secretSize\",\"classes\":\"\",\"parent\":\"DhkemX448HkdfSha512\"},{\"kind\":1024,\"name\":\"encSize\",\"url\":\"classes/DhkemX448HkdfSha512.html#encSize\",\"classes\":\"\",\"parent\":\"DhkemX448HkdfSha512\"},{\"kind\":1024,\"name\":\"publicKeySize\",\"url\":\"classes/DhkemX448HkdfSha512.html#publicKeySize\",\"classes\":\"\",\"parent\":\"DhkemX448HkdfSha512\"},{\"kind\":1024,\"name\":\"privateKeySize\",\"url\":\"classes/DhkemX448HkdfSha512.html#privateKeySize\",\"classes\":\"\",\"parent\":\"DhkemX448HkdfSha512\"},{\"kind\":1024,\"name\":\"_prim\",\"url\":\"classes/DhkemX448HkdfSha512.html#_prim\",\"classes\":\"tsd-is-protected tsd-is-inherited\",\"parent\":\"DhkemX448HkdfSha512\"},{\"kind\":1024,\"name\":\"_kdf\",\"url\":\"classes/DhkemX448HkdfSha512.html#_kdf\",\"classes\":\"tsd-is-protected tsd-is-inherited\",\"parent\":\"DhkemX448HkdfSha512\"},{\"kind\":2048,\"name\":\"serializePublicKey\",\"url\":\"classes/DhkemX448HkdfSha512.html#serializePublicKey\",\"classes\":\"tsd-is-inherited\",\"parent\":\"DhkemX448HkdfSha512\"},{\"kind\":2048,\"name\":\"deserializePublicKey\",\"url\":\"classes/DhkemX448HkdfSha512.html#deserializePublicKey\",\"classes\":\"tsd-is-inherited\",\"parent\":\"DhkemX448HkdfSha512\"},{\"kind\":2048,\"name\":\"serializePrivateKey\",\"url\":\"classes/DhkemX448HkdfSha512.html#serializePrivateKey\",\"classes\":\"tsd-is-inherited\",\"parent\":\"DhkemX448HkdfSha512\"},{\"kind\":2048,\"name\":\"deserializePrivateKey\",\"url\":\"classes/DhkemX448HkdfSha512.html#deserializePrivateKey\",\"classes\":\"tsd-is-inherited\",\"parent\":\"DhkemX448HkdfSha512\"},{\"kind\":2048,\"name\":\"importKey\",\"url\":\"classes/DhkemX448HkdfSha512.html#importKey\",\"classes\":\"tsd-is-inherited\",\"parent\":\"DhkemX448HkdfSha512\"},{\"kind\":2048,\"name\":\"generateKeyPair\",\"url\":\"classes/DhkemX448HkdfSha512.html#generateKeyPair\",\"classes\":\"tsd-is-inherited\",\"parent\":\"DhkemX448HkdfSha512\"},{\"kind\":2048,\"name\":\"deriveKeyPair\",\"url\":\"classes/DhkemX448HkdfSha512.html#deriveKeyPair\",\"classes\":\"tsd-is-inherited\",\"parent\":\"DhkemX448HkdfSha512\"},{\"kind\":2048,\"name\":\"encap\",\"url\":\"classes/DhkemX448HkdfSha512.html#encap\",\"classes\":\"tsd-is-inherited\",\"parent\":\"DhkemX448HkdfSha512\"},{\"kind\":2048,\"name\":\"decap\",\"url\":\"classes/DhkemX448HkdfSha512.html#decap\",\"classes\":\"tsd-is-inherited\",\"parent\":\"DhkemX448HkdfSha512\"}],\"index\":{\"version\":\"2.3.9\",\"fields\":[\"name\",\"comment\"],\"fieldVectors\":[[\"name/0\",[0,25.39]],[\"comment/0\",[]],[\"name/1\",[1,25.39]],[\"comment/1\",[]],[\"name/2\",[2,25.39]],[\"comment/2\",[]],[\"name/3\",[3,25.39]],[\"comment/3\",[]],[\"name/4\",[4,25.39]],[\"comment/4\",[]],[\"name/5\",[5,25.39]],[\"comment/5\",[]],[\"name/6\",[6,25.39]],[\"comment/6\",[]],[\"name/7\",[7,25.39]],[\"comment/7\",[]],[\"name/8\",[8,25.39]],[\"comment/8\",[]],[\"name/9\",[9,25.39]],[\"comment/9\",[]],[\"name/10\",[10,25.39]],[\"comment/10\",[]],[\"name/11\",[11,25.39]],[\"comment/11\",[]],[\"name/12\",[12,25.39]],[\"comment/12\",[]],[\"name/13\",[13,25.39]],[\"comment/13\",[]],[\"name/14\",[14,25.39]],[\"comment/14\",[]],[\"name/15\",[15,25.39]],[\"comment/15\",[]],[\"name/16\",[16,25.39]],[\"comment/16\",[]],[\"name/17\",[17,25.39]],[\"comment/17\",[]]],\"invertedIndex\":[[\"_kdf\",{\"_index\":8,\"name\":{\"8\":{}},\"comment\":{}}],[\"_prim\",{\"_index\":7,\"name\":{\"7\":{}},\"comment\":{}}],[\"constructor\",{\"_index\":1,\"name\":{\"1\":{}},\"comment\":{}}],[\"decap\",{\"_index\":17,\"name\":{\"17\":{}},\"comment\":{}}],[\"derivekeypair\",{\"_index\":15,\"name\":{\"15\":{}},\"comment\":{}}],[\"deserializeprivatekey\",{\"_index\":12,\"name\":{\"12\":{}},\"comment\":{}}],[\"deserializepublickey\",{\"_index\":10,\"name\":{\"10\":{}},\"comment\":{}}],[\"dhkemx448hkdfsha512\",{\"_index\":0,\"name\":{\"0\":{}},\"comment\":{}}],[\"encap\",{\"_index\":16,\"name\":{\"16\":{}},\"comment\":{}}],[\"encsize\",{\"_index\":4,\"name\":{\"4\":{}},\"comment\":{}}],[\"generatekeypair\",{\"_index\":14,\"name\":{\"14\":{}},\"comment\":{}}],[\"id\",{\"_index\":2,\"name\":{\"2\":{}},\"comment\":{}}],[\"importkey\",{\"_index\":13,\"name\":{\"13\":{}},\"comment\":{}}],[\"privatekeysize\",{\"_index\":6,\"name\":{\"6\":{}},\"comment\":{}}],[\"publickeysize\",{\"_index\":5,\"name\":{\"5\":{}},\"comment\":{}}],[\"secretsize\",{\"_index\":3,\"name\":{\"3\":{}},\"comment\":{}}],[\"serializeprivatekey\",{\"_index\":11,\"name\":{\"11\":{}},\"comment\":{}}],[\"serializepublickey\",{\"_index\":9,\"name\":{\"9\":{}},\"comment\":{}}]],\"pipeline\":[]}}"); \ No newline at end of file +window.searchData = "data:application/octet-stream;base64,H4sIAAAAAAAAA7VXy27bMBD8lYK9Ko5XD1v2uYcWvQQIUBQQjECVmJqwXqCUNKnhf+9Skk1SIVMrsi8GSM3sjme5fOwJL//UZB3tyY4VKVmDGzqkiHNK1uTLdkfzn74fft2lj/fbOACXOOSJZ/gtyeK6pvWtATPbNnmGwB6CYHJwjvHx+yl+UhZ1w5+SpuRnx/2sk5QcDqliTovGIlxKgLnrnzSw9PzULXZyxpomnDb37C89P7PGmayAFsm49JIwOXf19CtjyXf6Ok7BkDZdB2fPcUPHCxnyJit5wJD5+QKOcJm3qdMbVt9UvGxo0tD0Uz/Bii3lDCc+KgwRI3R16KvIcud+qPQPZ3GG5t8d18SYPjJw30ieqjClUzRa2BdXKbOclvRHjFTJV3XyAypt9IvrZHlV8maUNpVycT2/aUF593fvYjbidH1LvEJNsRTjlQ1pF9eFh1xcjToTW/gV/Bml4wifoGPjEJRBX8h6T54pr1lZINSdebMVch8ZzVJxRewEYqYyz0W0Tf/tBxWXMYHoILdz4kRzxw1m3mqzcaIjoZ1vJ1oU4AgMKNBQeOOMXAPK1VAejjwDytNQPo58A8rXUAGOAgMq0FALHC0MqIWGWuJoaUAtNVSIo9CACjUU1iJaGVAr3VVhMpjch4H9rf/GAugVEJf+CEw1AL0IINwGUxlArwMIw8FUCdBLAcJzMBUD9GqAsB1M9QC9ICCcB1NJoKtJ2wvYBNg337qewFXd3W325KFvk1Oz7kmIP4eDbAoxEmH7a5rkLCVnaeFoTxvJBMkEC7PfBBSOkg5s+botdUdfq3ZLVdiBwg6s7NPh2l+Kd+IwU6K4ShT3jCjtbWcYZK4EmduCiF3tBXe1LRaq7h+qMoYSwhah382VvAsl78LOqttXgOT5kuZbWMcz1mS8QgcbXzxDJUUx2eZxd9UYGuspqTwLUxZ2+D8Ve2zunOo55Cqry7a4ugfvkKhItin+35pUm8nWTe+vyJWMsDIFwB2kYhXNWIGYaHM4/AM2NqKQZBEAAA=="; \ No newline at end of file diff --git a/dhkem-x448/docs/assets/style.css b/dhkem-x448/docs/assets/style.css index 258146fc0..108428c3f 100644 --- a/dhkem-x448/docs/assets/style.css +++ b/dhkem-x448/docs/assets/style.css @@ -910,8 +910,9 @@ a.tsd-index-link { box-shadow: 0 0 4px rgba(0, 0, 0, 0.25); } #tsd-search .results li { - padding: 0 10px; background-color: var(--color-background); + line-height: initial; + padding: 4px; } #tsd-search .results li:nth-child(even) { background-color: var(--color-background-secondary); @@ -924,7 +925,10 @@ a.tsd-index-link { background-color: var(--color-accent); } #tsd-search .results a { - display: block; + display: flex; + align-items: center; + padding: 0.25rem; + box-sizing: border-box; } #tsd-search .results a:before { top: 10px; @@ -1134,7 +1138,7 @@ img { } .deprecated { - text-decoration: line-through; + text-decoration: line-through !important; } .warning { diff --git a/dhkem-x448/docs/classes/DhkemX448HkdfSha512.html b/dhkem-x448/docs/classes/DhkemX448HkdfSha512.html index e987168f0..500b3ff68 100644 --- a/dhkem-x448/docs/classes/DhkemX448HkdfSha512.html +++ b/dhkem-x448/docs/classes/DhkemX448HkdfSha512.html @@ -1,13 +1,13 @@ -DhkemX448HkdfSha512 | @hpke/dhkem-x448
    +DhkemX448HkdfSha512 | @hpke/dhkem-x448
    -
    +
    @@ -38,19 +38,19 @@

    Hierarchy

    • DhkemX448HkdfSha512
    +
  • Defined in src/kems/dhkemX448.ts:45
  • - +

    Constructors

    -

    Properties

    -
    _kdf +
    _kdf _prim encSize id @@ -60,7 +60,7 @@

    Properties

    Methods

    -
    decap +
    decap deriveKeyPair deserializePrivateKey deserializePublicKey @@ -73,14 +73,14 @@

    Methods

    Constructors

    - +
    +
  • Defined in src/kems/dhkemX448.ts:57
  • Properties

    @@ -88,13 +88,13 @@
    +
  • Defined in src/kems/dhkem.ts:41
  • _prim: DhkemPrimitives
    +
  • Defined in src/kems/dhkem.ts:40
  • encSize: number = 56
    @@ -103,7 +103,7 @@
    +
  • Defined in src/kems/dhkemX448.ts:51
  • id: KemId = KemId.DhkemX448HkdfSha512
    @@ -112,7 +112,7 @@
    +
  • Defined in src/kems/dhkemX448.ts:47
  • privateKeySize: number = 56
    @@ -121,7 +121,7 @@
    +
  • Defined in src/kems/dhkemX448.ts:55
  • publicKeySize: number = 56
    @@ -130,7 +130,7 @@
    +
  • Defined in src/kems/dhkemX448.ts:53
  • secretSize: number = 64
    @@ -139,7 +139,7 @@
    +
  • Defined in src/kems/dhkemX448.ts:49
  • Methods

    @@ -155,7 +155,7 @@
    params: Returns Promise<ArrayBuffer>
    +
  • Defined in src/kems/dhkem.ts:148
    • @@ -169,7 +169,7 @@
      ikm: Returns Promise<CryptoKeyPair>
    +
  • Defined in src/kems/dhkem.ts:80
    • @@ -183,7 +183,7 @@
      key: Returns Promise<CryptoKey>
    +
  • Defined in src/kems/dhkem.ts:64
    • @@ -197,7 +197,7 @@
      key: Returns Promise<CryptoKey>
    +
  • Defined in src/kems/dhkem.ts:56
    • @@ -211,7 +211,7 @@
      params: Returns Promise<{
          enc: ArrayBuffer;
          sharedSecret: ArrayBuffer;
      }>
    +
  • Defined in src/kems/dhkem.ts:87
  • +
  • Defined in src/kems/dhkem.ts:76
    • @@ -238,7 +238,7 @@
      isPublic: Returns Promise<CryptoKey>
    +
  • Defined in src/kems/dhkem.ts:68
    • @@ -252,7 +252,7 @@
      key: Returns Promise<ArrayBuffer>
    +
  • Defined in src/kems/dhkem.ts:60
    • @@ -266,20 +266,20 @@
      key: Returns Promise<ArrayBuffer>
    +
  • Defined in src/kems/dhkem.ts:52
  • @@ -304,9 +304,9 @@

    serializePrivateKey
  • serializePublicKey
  • +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/dhkem-x448/docs/index.html b/dhkem-x448/docs/index.html index 75a252296..121c998eb 100644 --- a/dhkem-x448/docs/index.html +++ b/dhkem-x448/docs/index.html @@ -1,13 +1,13 @@ -@hpke/dhkem-x448
    +@hpke/dhkem-x448
    -
    +
    @@ -70,15 +70,15 @@

    @hpke/dhkem-x448

    @@ -105,9 +105,9 @@

    Browsers
  • Contributing
  • +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/dhkem-x448/docs/modules.html b/dhkem-x448/docs/modules.html index 1afac54ad..81ee590e7 100644 --- a/dhkem-x448/docs/modules.html +++ b/dhkem-x448/docs/modules.html @@ -1,13 +1,13 @@ -@hpke/dhkem-x448
    +@hpke/dhkem-x448
    -
    +
    @@ -17,27 +17,27 @@

    @hpke/dhkem-x448

    Index

    Classes

    -
    +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/dhkem-x448/src/hpke-dhkem-x448.js b/dhkem-x448/src/hpke-dhkem-x448.js index ccd2c2c01..87b4b063c 100644 --- a/dhkem-x448/src/hpke-dhkem-x448.js +++ b/dhkem-x448/src/hpke-dhkem-x448.js @@ -1,6 +1,9 @@ -var gr={NotAssigned:0,DhkemP256HkdfSha256:16,DhkemP384HkdfSha384:17,DhkemP521HkdfSha512:18,DhkemSecp256k1HkdfSha256:19,DhkemX25519HkdfSha256:32,DhkemX448HkdfSha512:33,HybridkemX25519Kyber768:48},Wt=gr,mr={HkdfSha256:1,HkdfSha384:2,HkdfSha512:3},Jt=mr;function Qt(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function Er(e){if(typeof e!="boolean")throw new Error(`Expected boolean, not ${e}`)}function He(e,...t){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw new Error(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function _r(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Qt(e.outputLen),Qt(e.blockLen)}function Br(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function Ar(e,t){He(e);let r=t.outputLen;if(e.lengthe instanceof Uint8Array;var Pe=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),Ut=e=>new DataView(e.buffer,e.byteOffset,e.byteLength);var Sr=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!Sr)throw new Error("Non little-endian hardware is not supported");var qn=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function te(e){if(typeof e!="string")throw new Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function ut(e){if(typeof e=="string"&&(e=te(e)),!Ke(e))throw new Error(`expected Uint8Array, got ${typeof e}`);return e}function Ue(...e){let t=new Uint8Array(e.reduce((n,i)=>n+i.length,0)),r=0;return e.forEach(n=>{if(!Ke(n))throw new Error("Uint8Array expected");t.set(n,r),r+=n.length}),t}var at=class{clone(){return this._cloneInto()}};function Q(e){let t=n=>e().update(ut(n)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function Oe(e){let t=(n,i)=>e(i).update(ut(n)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=n=>e(n),t}function ee(e=32){if(Pt&&typeof Pt.getRandomValues=="function")return Pt.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}var Ot=class extends at{constructor(t,r){super(),this.finished=!1,this.destroyed=!1,R.hash(t);let n=ut(r);if(this.iHash=t.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let i=this.blockLen,s=new Uint8Array(i);s.set(n.length>i?t.create().update(n).digest():n);for(let o=0;onew Ot(e,t).update(r).digest();re.create=(e,t)=>new Ot(e,t);function Lr(e,t,r,n){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,r,n);let i=BigInt(32),s=BigInt(4294967295),o=Number(r>>i&s),c=Number(r&s),a=n?4:0,h=n?0:4;e.setUint32(t+a,o,n),e.setUint32(t+h,c,n)}var Tt=class extends at{constructor(t,r,n,i){super(),this.blockLen=t,this.outputLen=r,this.padOffset=n,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=Ut(this.buffer)}update(t){R.exists(this);let{view:r,buffer:n,blockLen:i}=this;t=ut(t);let s=t.length;for(let o=0;oi-o&&(this.process(n,0),o=0);for(let p=o;pu.length)throw new Error("_sha2: outputLen bigger than state");for(let p=0;p>ne&Nt)}:{h:Number(e>>ne&Nt)|0,l:Number(e&Nt)|0}}function Ir(e,t=!1){let r=new Uint32Array(e.length),n=new Uint32Array(e.length);for(let i=0;iBigInt(e>>>0)<>>0),Hr=(e,t,r)=>e>>>r,Kr=(e,t,r)=>e<<32-r|t>>>r,Pr=(e,t,r)=>e>>>r|t<<32-r,Ur=(e,t,r)=>e<<32-r|t>>>r,Or=(e,t,r)=>e<<64-r|t>>>r-32,Tr=(e,t,r)=>e>>>r-32|t<<64-r,Nr=(e,t)=>t,Cr=(e,t)=>e,zr=(e,t,r)=>e<>>32-r,qr=(e,t,r)=>t<>>32-r,Dr=(e,t,r)=>t<>>64-r,Rr=(e,t,r)=>e<>>64-r;function Mr(e,t,r,n){let i=(t>>>0)+(n>>>0);return{h:e+r+(i/2**32|0)|0,l:i|0}}var jr=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0),Gr=(e,t,r,n)=>t+r+n+(e/2**32|0)|0,Zr=(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0),$r=(e,t,r,n,i)=>t+r+n+i+(e/2**32|0)|0,Fr=(e,t,r,n,i)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(i>>>0),Xr=(e,t,r,n,i,s)=>t+r+n+i+s+(e/2**32|0)|0,Vr={fromBig:Te,split:Ir,toBig:kr,shrSH:Hr,shrSL:Kr,rotrSH:Pr,rotrSL:Ur,rotrBH:Or,rotrBL:Tr,rotr32H:Nr,rotr32L:Cr,rotlSH:zr,rotlSL:qr,rotlBH:Dr,rotlBL:Rr,add:Mr,add3L:jr,add3H:Gr,add4L:Zr,add4H:$r,add5H:Xr,add5L:Fr},w=Vr;var[Yr,Wr]=w.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e))),ht=new Uint32Array(80),lt=new Uint32Array(80),bt=class extends Tt{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){let{Ah:t,Al:r,Bh:n,Bl:i,Ch:s,Cl:o,Dh:c,Dl:a,Eh:h,El:u,Fh:p,Fl:b,Gh:v,Gl:L,Hh:k,Hl:_}=this;return[t,r,n,i,s,o,c,a,h,u,p,b,v,L,k,_]}set(t,r,n,i,s,o,c,a,h,u,p,b,v,L,k,_){this.Ah=t|0,this.Al=r|0,this.Bh=n|0,this.Bl=i|0,this.Ch=s|0,this.Cl=o|0,this.Dh=c|0,this.Dl=a|0,this.Eh=h|0,this.El=u|0,this.Fh=p|0,this.Fl=b|0,this.Gh=v|0,this.Gl=L|0,this.Hh=k|0,this.Hl=_|0}process(t,r){for(let f=0;f<16;f++,r+=4)ht[f]=t.getUint32(r),lt[f]=t.getUint32(r+=4);for(let f=16;f<80;f++){let m=ht[f-15]|0,x=lt[f-15]|0,z=w.rotrSH(m,x,1)^w.rotrSH(m,x,8)^w.shrSH(m,x,7),Y=w.rotrSL(m,x,1)^w.rotrSL(m,x,8)^w.shrSL(m,x,7),K=ht[f-2]|0,U=lt[f-2]|0,j=w.rotrSH(K,U,19)^w.rotrBH(K,U,61)^w.shrSH(K,U,6),q=w.rotrSL(K,U,19)^w.rotrBL(K,U,61)^w.shrSL(K,U,6),$=w.add4L(Y,q,lt[f-7],lt[f-16]),O=w.add4H($,z,j,ht[f-7],ht[f-16]);ht[f]=O|0,lt[f]=$|0}let{Ah:n,Al:i,Bh:s,Bl:o,Ch:c,Cl:a,Dh:h,Dl:u,Eh:p,El:b,Fh:v,Fl:L,Gh:k,Gl:_,Hh:C,Hl:M}=this;for(let f=0;f<80;f++){let m=w.rotrSH(p,b,14)^w.rotrSH(p,b,18)^w.rotrBH(p,b,41),x=w.rotrSL(p,b,14)^w.rotrSL(p,b,18)^w.rotrBL(p,b,41),z=p&v^~p&k,Y=b&L^~b&_,K=w.add5L(M,x,Y,Wr[f],lt[f]),U=w.add5H(K,C,m,z,Yr[f],ht[f]),j=K|0,q=w.rotrSH(n,i,28)^w.rotrBH(n,i,34)^w.rotrBH(n,i,39),$=w.rotrSL(n,i,28)^w.rotrBL(n,i,34)^w.rotrBL(n,i,39),O=n&s^n&c^s&c,_t=i&o^i&a^o&a;C=k|0,M=_|0,k=v|0,_=L|0,v=p|0,L=b|0,{h:p,l:b}=w.add(h|0,u|0,U|0,j|0),h=c|0,u=a|0,c=s|0,a=o|0,s=n|0,o=i|0;let st=w.add3L(j,$,_t);n=w.add3H(st,U,q,O),i=st|0}({h:n,l:i}=w.add(this.Ah|0,this.Al|0,n|0,i|0)),{h:s,l:o}=w.add(this.Bh|0,this.Bl|0,s|0,o|0),{h:c,l:a}=w.add(this.Ch|0,this.Cl|0,c|0,a|0),{h,l:u}=w.add(this.Dh|0,this.Dl|0,h|0,u|0),{h:p,l:b}=w.add(this.Eh|0,this.El|0,p|0,b|0),{h:v,l:L}=w.add(this.Fh|0,this.Fl|0,v|0,L|0),{h:k,l:_}=w.add(this.Gh|0,this.Gl|0,k|0,_|0),{h:C,l:M}=w.add(this.Hh|0,this.Hl|0,C|0,M|0),this.set(n,i,s,o,c,a,h,u,p,b,v,L,k,_,C,M)}roundClean(){ht.fill(0),lt.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}},ie=class extends bt{constructor(){super(),this.Ah=-1942145080,this.Al=424955298,this.Bh=1944164710,this.Bl=-1982016298,this.Ch=502970286,this.Cl=855612546,this.Dh=1738396948,this.Dl=1479516111,this.Eh=258812777,this.El=2077511080,this.Fh=2011393907,this.Fl=79989058,this.Gh=1067287976,this.Gl=1780299464,this.Hh=286451373,this.Hl=-1848208735,this.outputLen=28}},oe=class extends bt{constructor(){super(),this.Ah=573645204,this.Al=-64227540,this.Bh=-1621794909,this.Bl=-934517566,this.Ch=596883563,this.Cl=1867755857,this.Dh=-1774684391,this.Dl=1497426621,this.Eh=-1775747358,this.El=-1467023389,this.Fh=-1101128155,this.Fl=1401305490,this.Gh=721525244,this.Gl=746961066,this.Hh=246885852,this.Hl=-2117784414,this.outputLen=32}},se=class extends bt{constructor(){super(),this.Ah=-876896931,this.Al=-1056596264,this.Bh=1654270250,this.Bl=914150663,this.Ch=-1856437926,this.Cl=812702999,this.Dh=355462360,this.Dl=-150054599,this.Eh=1731405415,this.El=-4191439,this.Fh=-1900787065,this.Fl=1750603025,this.Gh=-619958771,this.Gl=1694076839,this.Hh=1203062813,this.Hl=-1090891868,this.outputLen=48}},Ne=Q(()=>new bt),Wn=Q(()=>new ie),Jn=Q(()=>new oe),Qn=Q(()=>new se);var Jr={},Ce=Qr(globalThis,Jr);function Qr(e,t){return new Proxy(e,{get(r,n,i){return n in t?t[n]:e[n]},set(r,n,i){return n in t&&delete t[n],e[n]=i,!0},deleteProperty(r,n){let i=!1;return n in t&&(delete t[n],i=!0),n in e&&(delete e[n],i=!0),i},ownKeys(r){let n=Reflect.ownKeys(e),i=Reflect.ownKeys(t),s=new Set(i);return[...n.filter(o=>!s.has(o)),...i]},defineProperty(r,n,i){return n in t&&delete t[n],Reflect.defineProperty(e,n,i),!0},getOwnPropertyDescriptor(r,n){return n in t?Reflect.getOwnPropertyDescriptor(t,n):Reflect.getOwnPropertyDescriptor(e,n)},has(r,n){return n in t||n in e}})}var ce=class extends Error{constructor(t){let r;t instanceof Error?r=t.message:typeof t=="string"?r=t:r="",super(r),this.name=this.constructor.name}},et=class extends ce{},wt=class extends et{};var xt=class extends et{},dt=class extends et{},Ct=class extends et{},zt=class extends et{};var qt=class extends et{},gt=class extends et{};async function en(){if(Ce!==void 0&&globalThis.crypto!==void 0)return globalThis.crypto.subtle;try{let{webcrypto:e}=await import("crypto");return e.subtle}catch(e){throw new gt(e)}}var Dt=class{constructor(){Object.defineProperty(this,"_api",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}async _setup(){this._api===void 0&&(this._api=await en())}};var rt=new Uint8Array(0);var ze=new Uint8Array([72,80,75,69,45,118,49]),ae=class extends Dt{constructor(){super(),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:Jt.HkdfSha256}),Object.defineProperty(this,"hashSize",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_suiteId",{enumerable:!0,configurable:!0,writable:!0,value:rt}),Object.defineProperty(this,"algHash",{enumerable:!0,configurable:!0,writable:!0,value:{name:"HMAC",hash:"SHA-256",length:256}})}init(t){this._suiteId=t}buildLabeledIkm(t,r){this._checkInit();let n=new Uint8Array(7+this._suiteId.byteLength+t.byteLength+r.byteLength);return n.set(ze,0),n.set(this._suiteId,7),n.set(t,7+this._suiteId.byteLength),n.set(r,7+this._suiteId.byteLength+t.byteLength),n}buildLabeledInfo(t,r,n){this._checkInit();let i=new Uint8Array(9+this._suiteId.byteLength+t.byteLength+r.byteLength);return i.set(new Uint8Array([0,n]),0),i.set(ze,2),i.set(this._suiteId,9),i.set(t,9+this._suiteId.byteLength),i.set(r,9+this._suiteId.byteLength+t.byteLength),i}async extract(t,r){if(await this._setup(),t.byteLength===0&&(t=new ArrayBuffer(this.hashSize)),t.byteLength!==this.hashSize)throw new wt("The salt length must be the same as the hashSize");let n=await this._api.importKey("raw",t,this.algHash,!1,["sign"]);return await this._api.sign("HMAC",n,r)}async expand(t,r,n){await this._setup();let i=await this._api.importKey("raw",t,this.algHash,!1,["sign"]),s=new ArrayBuffer(n),o=new Uint8Array(s),c=rt,a=new Uint8Array(r),h=new Uint8Array(1);if(n>255*this.hashSize)throw new Error("Entropy limit reached");let u=new Uint8Array(this.hashSize+a.length+1);for(let p=1,b=0;b=c.length?(o.set(c,b),b+=c.length):(o.set(c.slice(0,o.length-b),b),b+=o.length-b);return s}async extractAndExpand(t,r,n,i){await this._setup();let s=await this._api.importKey("raw",r,"HKDF",!1,["deriveBits"]);return await this._api.deriveBits({name:"HKDF",hash:this.algHash.hash,salt:t,info:n},s,i*8)}async labeledExtract(t,r,n){return await this.extract(t,this.buildLabeledIkm(r,n))}async labeledExpand(t,r,n,i){return await this.expand(t,this.buildLabeledInfo(r,n,i),i)}_checkInit(){if(this._suiteId===rt)throw new Error("Not initialized. Call init()")}};var Rt=class extends ae{constructor(){super(...arguments),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:Jt.HkdfSha512}),Object.defineProperty(this,"hashSize",{enumerable:!0,configurable:!0,writable:!0,value:64}),Object.defineProperty(this,"algHash",{enumerable:!0,configurable:!0,writable:!0,value:{name:"HMAC",hash:"SHA-512",length:512}})}};var Mt=class extends Rt{async extract(t,r){if(await this._setup(),t.byteLength===0&&(t=new ArrayBuffer(this.hashSize)),t.byteLength!==this.hashSize)return re(Ne,new Uint8Array(t),new Uint8Array(r));let n=await this._api.importKey("raw",t,this.algHash,!1,["sign"]);return await this._api.sign("HMAC",n,r)}};var qe=new Uint8Array([75,69,77,0,0]);var mt=e=>typeof e=="object"&&e!==null&&typeof e.privateKey=="object"&&typeof e.publicKey=="object";function De(e,t){if(t<=0)throw new Error("i2Osp: too small size");if(e>=256**t)throw new Error("i2Osp: too large integer");let r=new Uint8Array(t);for(let n=0;n>8;return r}function Bt(e,t){let r=new Uint8Array(e.length+t.length);return r.set(e,0),r.set(t,e.length),r}function ue(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r=atob(t),n=new Uint8Array(r.length);for(let i=0;i8192)throw new wt("Too long ikm");return await this._prim.deriveKeyPair(t)}async encap(t){let r;t.ekm===void 0?r=await this.generateKeyPair():mt(t.ekm)?r=t.ekm:r=await this.deriveKeyPair(t.ekm);let n=await this._prim.serializePublicKey(r.publicKey),i=await this._prim.serializePublicKey(t.recipientPublicKey);try{let s;if(t.senderKey===void 0)s=new Uint8Array(await this._prim.dh(r.privateKey,t.recipientPublicKey));else{let a=mt(t.senderKey)?t.senderKey.privateKey:t.senderKey,h=new Uint8Array(await this._prim.dh(r.privateKey,t.recipientPublicKey)),u=new Uint8Array(await this._prim.dh(a,t.recipientPublicKey));s=Bt(h,u)}let o;if(t.senderKey===void 0)o=Bt(new Uint8Array(n),new Uint8Array(i));else{let a=mt(t.senderKey)?t.senderKey.publicKey:await this._prim.derivePublicKey(t.senderKey),h=await this._prim.serializePublicKey(a);o=sn(new Uint8Array(n),new Uint8Array(i),new Uint8Array(h))}let c=await this._generateSharedSecret(s,o);return{enc:n,sharedSecret:c}}catch(s){throw new Ct(s)}}async decap(t){let r=await this._prim.deserializePublicKey(t.enc),n=mt(t.recipientKey)?t.recipientKey.privateKey:t.recipientKey,i=mt(t.recipientKey)?t.recipientKey.publicKey:await this._prim.derivePublicKey(t.recipientKey),s=await this._prim.serializePublicKey(i);try{let o;if(t.senderPublicKey===void 0)o=new Uint8Array(await this._prim.dh(n,r));else{let a=new Uint8Array(await this._prim.dh(n,r)),h=new Uint8Array(await this._prim.dh(n,t.senderPublicKey));o=Bt(a,h)}let c;if(t.senderPublicKey===void 0)c=Bt(new Uint8Array(t.enc),new Uint8Array(s));else{let a=await this._prim.serializePublicKey(t.senderPublicKey);c=new Uint8Array(t.enc.byteLength+s.byteLength+a.byteLength),c.set(new Uint8Array(t.enc),0),c.set(new Uint8Array(s),t.enc.byteLength),c.set(new Uint8Array(a),t.enc.byteLength+s.byteLength)}return await this._generateSharedSecret(o,c)}catch(o){throw new zt(o)}}async _generateSharedSecret(t,r){let n=this._kdf.buildLabeledIkm(nn,t),i=this._kdf.buildLabeledInfo(on,r,this.secretSize);return await this._kdf.extractAndExpand(rt,n,i,this.secretSize)}};var[je,Ge,Ze]=[[],[],[]],cn=BigInt(0),At=BigInt(1),an=BigInt(2),un=BigInt(7),hn=BigInt(256),ln=BigInt(113);for(let e=0,t=At,r=1,n=0;e<24;e++){[r,n]=[n,(2*r+3*n)%5],je.push(2*(5*n+r)),Ge.push((e+1)*(e+2)/2%64);let i=cn;for(let s=0;s<7;s++)t=(t<>un)*ln)%hn,t&an&&(i^=At<<(At<r>32?w.rotlBH(e,t,r):w.rotlSH(e,t,r),Me=(e,t,r)=>r>32?w.rotlBL(e,t,r):w.rotlSL(e,t,r);function pn(e,t=24){let r=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let o=0;o<10;o++)r[o]=e[o]^e[o+10]^e[o+20]^e[o+30]^e[o+40];for(let o=0;o<10;o+=2){let c=(o+8)%10,a=(o+2)%10,h=r[a],u=r[a+1],p=Re(h,u,1)^r[c],b=Me(h,u,1)^r[c+1];for(let v=0;v<50;v+=10)e[o+v]^=p,e[o+v+1]^=b}let i=e[2],s=e[3];for(let o=0;o<24;o++){let c=Ge[o],a=Re(i,s,c),h=Me(i,s,c),u=je[o];i=e[u],s=e[u+1],e[u]=a,e[u+1]=h}for(let o=0;o<50;o+=10){for(let c=0;c<10;c++)r[c]=e[o+c];for(let c=0;c<10;c++)e[o+c]^=~r[(c+2)%10]&r[(c+4)%10]}e[0]^=fn[n],e[1]^=dn[n]}r.fill(0)}var Gt=class e extends at{constructor(t,r,n,i=!1,s=24){if(super(),this.blockLen=t,this.suffix=r,this.outputLen=n,this.enableXOF=i,this.rounds=s,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,R.number(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=Pe(this.state)}keccak(){pn(this.state32,this.rounds),this.posOut=0,this.pos=0}update(t){R.exists(this);let{blockLen:r,state:n}=this;t=ut(t);let i=t.length;for(let s=0;s=n&&this.keccak();let o=Math.min(n-this.posOut,s-i);t.set(r.subarray(this.posOut,this.posOut+o),i),this.posOut+=o,i+=o}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return R.number(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(R.output(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){let{blockLen:r,suffix:n,outputLen:i,rounds:s,enableXOF:o}=this;return t||(t=new e(r,n,i,o,s)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=s,t.suffix=n,t.outputLen=i,t.enableXOF=o,t.destroyed=this.destroyed,t}},ft=(e,t,r)=>Q(()=>new Gt(t,e,r)),Ai=ft(6,144,224/8),vi=ft(6,136,256/8),Si=ft(6,104,384/8),Li=ft(6,72,512/8),Ii=ft(1,144,224/8),ki=ft(1,136,256/8),Hi=ft(1,104,384/8),Ki=ft(1,72,512/8),$e=(e,t,r)=>Oe((n={})=>new Gt(t,e,n.dkLen===void 0?r:n.dkLen,!0)),Pi=$e(31,168,128/8),he=$e(31,136,256/8);var Oi=BigInt(0),yn=BigInt(1),bn=BigInt(2),Zt=e=>e instanceof Uint8Array,wn=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function $t(e){if(!Zt(e))throw new Error("Uint8Array expected");let t="";for(let r=0;rn+i.length,0)),r=0;return e.forEach(n=>{if(!Zt(n))throw new Error("Uint8Array expected");t.set(n,r),r+=n.length}),t}var Ve=e=>(bn<typeof e=="bigint",function:e=>typeof e=="function",boolean:e=>typeof e=="boolean",string:e=>typeof e=="string",isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>typeof e=="function"&&Number.isSafeInteger(e.outputLen)};function it(e,t,r={}){let n=(i,s,o)=>{let c=xn[s];if(typeof c!="function")throw new Error(`Invalid validator "${s}", expected function`);let a=e[i];if(!(o&&a===void 0)&&!c(a,e))throw new Error(`Invalid param ${String(i)}=${a} (${typeof a}), expected ${s}`)};for(let[i,s]of Object.entries(t))n(i,s,!1);for(let[i,s]of Object.entries(r))n(i,s,!0);return e}var N=BigInt(0),T=BigInt(1),yt=BigInt(2),mn=BigInt(3),de=BigInt(4),Ye=BigInt(5),We=BigInt(8),En=BigInt(9),_n=BigInt(16);function P(e,t){let r=e%t;return r>=N?r:t+r}function pe(e,t,r){if(r<=N||t 0");if(r===T)return N;let n=T;for(;t>N;)t&T&&(n=n*e%r),e=e*e%r,t>>=T;return n}function X(e,t,r){let n=e;for(;t-- >N;)n*=n,n%=r;return n}function Je(e,t){if(e===N||t<=N)throw new Error(`invert: expected positive integers, got n=${e} mod=${t}`);let r=P(e,t),n=t,i=N,s=T,o=T,c=N;for(;r!==N;){let h=n/r,u=n%r,p=i-o*h,b=s-c*h;n=r,r=u,i=o,s=c,o=p,c=b}if(n!==T)throw new Error("invert: does not exist");return P(i,t)}function Bn(e){let t=(e-T)/yt,r,n,i;for(r=e-T,n=0;r%yt===N;r/=yt,n++);for(i=yt;i(n[i]="function",n),t);return it(e,r)}function Sn(e,t,r){if(r 0");if(r===N)return e.ONE;if(r===T)return t;let n=e.ONE,i=t;for(;r>N;)r&T&&(n=e.mul(n,i)),i=e.sqr(i),r>>=T;return n}function Ln(e,t){let r=new Array(t.length),n=t.reduce((s,o,c)=>e.is0(o)?s:(r[c]=s,e.mul(s,o)),e.ONE),i=e.inv(n);return t.reduceRight((s,o,c)=>e.is0(o)?s:(r[c]=e.mul(s,r[c]),e.mul(s,o)),i),r}function ye(e,t){let r=t!==void 0?t:e.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function tr(e,t,r=!1,n={}){if(e<=N)throw new Error(`Expected Fp ORDER > 0, got ${e}`);let{nBitLength:i,nByteLength:s}=ye(e,t);if(s>2048)throw new Error("Field lengths over 2048 bytes are not supported");let o=An(e),c=Object.freeze({ORDER:e,BITS:i,BYTES:s,MASK:Ve(i),ZERO:N,ONE:T,create:a=>P(a,e),isValid:a=>{if(typeof a!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof a}`);return N<=a&&aa===N,isOdd:a=>(a&T)===T,neg:a=>P(-a,e),eql:(a,h)=>a===h,sqr:a=>P(a*a,e),add:(a,h)=>P(a+h,e),sub:(a,h)=>P(a-h,e),mul:(a,h)=>P(a*h,e),pow:(a,h)=>Sn(c,a,h),div:(a,h)=>P(a*Je(h,e),e),sqrN:a=>a*a,addN:(a,h)=>a+h,subN:(a,h)=>a-h,mulN:(a,h)=>a*h,inv:a=>Je(a,e),sqrt:n.sqrt||(a=>o(c,a)),invertBatch:a=>Ln(c,a),cmov:(a,h,u)=>u?h:a,toBytes:a=>r?pt(a,s):fe(a,s),fromBytes:a=>{if(a.length!==s)throw new Error(`Fp.fromBytes: expected ${s}, got ${a.length}`);return r?nt(a):le(a)}});return Object.freeze(c)}var In=BigInt(0),be=BigInt(1);function er(e,t){let r=(i,s)=>{let o=s.negate();return i?o:s},n=i=>{let s=Math.ceil(t/i)+1,o=2**(i-1);return{windows:s,windowSize:o}};return{constTimeNegate:r,unsafeLadder(i,s){let o=e.ZERO,c=i;for(;s>In;)s&be&&(o=o.add(c)),c=c.double(),s>>=be;return o},precomputeWindow(i,s){let{windows:o,windowSize:c}=n(s),a=[],h=i,u=h;for(let p=0;p>=v,_>a&&(_-=b,o+=be);let C=k,M=k+Math.abs(_)-1,f=L%2!==0,m=_<0;_===0?u=u.add(r(f,s[C])):h=h.add(r(m,s[M]))}return{p:h,f:u}},wNAFCached(i,s,o,c){let a=i._WINDOW_SIZE||1,h=s.get(i);return h||(h=this.precomputeWindow(i,a),a!==1&&s.set(i,c(h))),this.wNAF(a,h,o)}}}function rr(e){return Qe(e.Fp),it(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...ye(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}var W=BigInt(0),V=BigInt(1),Xt=BigInt(2),kn=BigInt(8),Hn={zip215:!0};function Kn(e){let t=rr(e);return it(e,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...t})}function we(e){let t=Kn(e),{Fp:r,n,prehash:i,hash:s,randomBytes:o,nByteLength:c,h:a}=t,h=Xt<{try{return{isValid:!0,value:r.sqrt(d*r.inv(l))}}catch{return{isValid:!1,value:W}}}),b=t.adjustScalarBytes||(d=>d),v=t.domain||((d,l,y)=>{if(l.length||y)throw new Error("Contexts/pre-hash are not supported");return d}),L=d=>typeof d=="bigint"&&WL(d)&&L(l)&&dd===W||k(d,h);function C(d,l){if(k(d,l))return d;throw new Error(`Expected valid scalar < ${l}, got ${typeof d} ${d}`)}function M(d){return d===W?d:C(d,n)}let f=new Map;function m(d){if(!(d instanceof x))throw new Error("ExtendedPoint expected")}class x{constructor(l,y,g,E){if(this.ex=l,this.ey=y,this.ez=g,this.et=E,!_(l))throw new Error("x required");if(!_(y))throw new Error("y required");if(!_(g))throw new Error("z required");if(!_(E))throw new Error("t required")}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(l){if(l instanceof x)throw new Error("extended point not allowed");let{x:y,y:g}=l||{};if(!_(y)||!_(g))throw new Error("invalid affine point");return new x(y,g,V,u(y*g))}static normalizeZ(l){let y=r.invertBatch(l.map(g=>g.ez));return l.map((g,E)=>g.toAffine(y[E])).map(x.fromAffine)}_setWindowSize(l){this._WINDOW_SIZE=l,f.delete(this)}assertValidity(){let{a:l,d:y}=t;if(this.is0())throw new Error("bad point: ZERO");let{ex:g,ey:E,ez:B,et:S}=this,H=u(g*g),A=u(E*E),I=u(B*B),D=u(I*I),G=u(H*l),J=u(I*u(G+A)),Z=u(D+u(y*u(H*A)));if(J!==Z)throw new Error("bad point: equation left != right (1)");let ct=u(g*E),tt=u(B*S);if(ct!==tt)throw new Error("bad point: equation left != right (2)")}equals(l){m(l);let{ex:y,ey:g,ez:E}=this,{ex:B,ey:S,ez:H}=l,A=u(y*H),I=u(B*E),D=u(g*H),G=u(S*E);return A===I&&D===G}is0(){return this.equals(x.ZERO)}negate(){return new x(u(-this.ex),this.ey,this.ez,u(-this.et))}double(){let{a:l}=t,{ex:y,ey:g,ez:E}=this,B=u(y*y),S=u(g*g),H=u(Xt*u(E*E)),A=u(l*B),I=y+g,D=u(u(I*I)-B-S),G=A+S,J=G-H,Z=A-S,ct=u(D*J),tt=u(G*Z),Ht=u(D*Z),Kt=u(J*G);return new x(ct,tt,Kt,Ht)}add(l){m(l);let{a:y,d:g}=t,{ex:E,ey:B,ez:S,et:H}=this,{ex:A,ey:I,ez:D,et:G}=l;if(y===BigInt(-1)){let Be=u((B-E)*(I+A)),Ae=u((B+E)*(I-A)),Yt=u(Ae-Be);if(Yt===W)return this.double();let ve=u(S*Xt*G),Se=u(H*Xt*D),Le=Se+ve,Ie=Ae+Be,ke=Se-ve,yr=u(Le*Yt),br=u(Ie*ke),wr=u(Le*ke),xr=u(Yt*Ie);return new x(yr,br,xr,wr)}let J=u(E*A),Z=u(B*I),ct=u(H*g*G),tt=u(S*D),Ht=u((E+B)*(A+I)-J-Z),Kt=tt-ct,Ee=tt+ct,_e=u(Z-y*J),lr=u(Ht*Kt),fr=u(Ee*_e),dr=u(Ht*_e),pr=u(Kt*Ee);return new x(lr,fr,pr,dr)}subtract(l){return this.add(l.negate())}wNAF(l){return K.wNAFCached(this,f,l,x.normalizeZ)}multiply(l){let{p:y,f:g}=this.wNAF(C(l,n));return x.normalizeZ([y,g])[0]}multiplyUnsafe(l){let y=M(l);return y===W?Y:this.equals(Y)||y===V?this:this.equals(z)?this.wNAF(y).p:K.unsafeLadder(this,y)}isSmallOrder(){return this.multiplyUnsafe(a).is0()}isTorsionFree(){return K.unsafeLadder(this,n).is0()}toAffine(l){let{ex:y,ey:g,ez:E}=this,B=this.is0();l==null&&(l=B?kn:r.inv(E));let S=u(y*l),H=u(g*l),A=u(E*l);if(B)return{x:W,y:V};if(A!==V)throw new Error("invZ was invalid");return{x:S,y:H}}clearCofactor(){let{h:l}=t;return l===V?this:this.multiplyUnsafe(l)}static fromHex(l,y=!1){let{d:g,a:E}=t,B=r.BYTES;l=F("pointHex",l,B);let S=l.slice(),H=l[B-1];S[B-1]=H&-129;let A=nt(S);A===W||(y?C(A,h):C(A,r.ORDER));let I=u(A*A),D=u(I-V),G=u(g*I-E),{isValid:J,value:Z}=p(D,G);if(!J)throw new Error("Point.fromHex: invalid y coordinate");let ct=(Z&V)===V,tt=(H&128)!==0;if(!y&&Z===W&&tt)throw new Error("Point.fromHex: x=0 and x_0=1");return tt!==ct&&(Z=u(-Z)),x.fromAffine({x:Z,y:A})}static fromPrivateKey(l){return q(l).point}toRawBytes(){let{x:l,y}=this.toAffine(),g=pt(y,r.BYTES);return g[g.length-1]|=l&V?128:0,g}toHex(){return $t(this.toRawBytes())}}x.BASE=new x(t.Gx,t.Gy,V,u(t.Gx*t.Gy)),x.ZERO=new x(W,V,V,W);let{BASE:z,ZERO:Y}=x,K=er(x,c*8);function U(d){return P(d,n)}function j(d){return U(nt(d))}function q(d){let l=c;d=F("private key",d,l);let y=F("hashed private key",s(d),2*l),g=b(y.slice(0,l)),E=y.slice(l,2*l),B=j(g),S=z.multiply(B),H=S.toRawBytes();return{head:g,prefix:E,scalar:B,point:S,pointBytes:H}}function $(d){return q(d).pointBytes}function O(d=new Uint8Array,...l){let y=Ft(...l);return j(s(v(y,F("context",d),!!i)))}function _t(d,l,y={}){d=F("message",d),i&&(d=i(d));let{prefix:g,scalar:E,pointBytes:B}=q(l),S=O(y.context,g,d),H=z.multiply(S).toRawBytes(),A=O(y.context,H,B,d),I=U(S+A*E);M(I);let D=Ft(H,pt(I,r.BYTES));return F("result",D,c*2)}let st=Hn;function It(d,l,y,g=st){let{context:E,zip215:B}=g,S=r.BYTES;d=F("signature",d,2*S),l=F("message",l),i&&(l=i(l));let H=nt(d.slice(S,2*S)),A,I,D;try{A=x.fromHex(y,B),I=x.fromHex(d.slice(0,S),B),D=z.multiplyUnsafe(H)}catch{return!1}if(!B&&A.isSmallOrder())return!1;let G=O(E,I.toRawBytes(),A.toRawBytes(),l);return I.add(A.multiplyUnsafe(G)).subtract(D).clearCofactor().equals(x.ZERO)}return z._setWindowSize(8),{CURVE:t,getPublicKey:$,sign:_t,verify:It,ExtendedPoint:x,utils:{getExtendedPublicKey:q,randomPrivateKey:()=>o(r.BYTES),precompute(d=8,l=x.BASE){return l._setWindowSize(d),l.multiply(BigInt(3)),l}}}}var vt=BigInt(0),xe=BigInt(1);function Pn(e){return it(e,{a:"bigint"},{montgomeryBits:"isSafeInteger",nByteLength:"isSafeInteger",adjustScalarBytes:"function",domain:"function",powPminus2:"function",Gu:"bigint"}),Object.freeze({...e})}function nr(e){let t=Pn(e),{P:r}=t,n=f=>P(f,r),i=t.montgomeryBits,s=Math.ceil(i/8),o=t.nByteLength,c=t.adjustScalarBytes||(f=>f),a=t.powPminus2||(f=>pe(f,r-BigInt(2),r));function h(f,m,x){let z=n(f*(m-x));return m=n(m-z),x=n(x+z),[m,x]}function u(f){if(typeof f=="bigint"&&vt<=f&&f=vt;st--){let It=z>>st&xe;$^=It,O=h($,K,j),K=O[0],j=O[1],O=h($,U,q),U=O[0],q=O[1],$=It;let kt=K+U,d=n(kt*kt),l=K-U,y=n(l*l),g=d-y,E=j+q,B=j-q,S=n(B*kt),H=n(E*l),A=S+H,I=S-H;j=n(A*A),q=n(Y*n(I*I)),K=n(d*y),U=n(g*(d+n(p*g)))}O=h($,K,j),K=O[0],j=O[1],O=h($,U,q),U=O[0],q=O[1];let _t=a(U);return n(K*_t)}function v(f){return pt(n(f),s)}function L(f){let m=F("u coordinate",f,s);return o===s&&(m[o-1]&=127),nt(m)}function k(f){let m=F("scalar",f);if(m.length!==s&&m.length!==o)throw new Error(`Expected ${s} or ${o} bytes, got ${m.length}`);return nt(c(m))}function _(f,m){let x=L(m),z=k(f),Y=b(x,z);if(Y===vt)throw new Error("Invalid private or public key received");return v(Y)}let C=v(t.Gu);function M(f){return _(f,C)}return{scalarMult:_,scalarMultBase:M,getSharedSecret:(f,m)=>_(f,m),getPublicKey:f=>M(f),utils:{randomPrivateKey:()=>t.randomBytes(t.nByteLength)},GuBytes:C}}var Un=Q(()=>he.create({dkLen:114})),On=Q(()=>he.create({dkLen:64})),St=BigInt("726838724295606890549323807888004534353641360687318060281490199180612328166730772686396383698676545930088884461843637361053498018365439");function ir(e){let t=St,r=BigInt(1),n=BigInt(2),i=BigInt(3),s=BigInt(11),o=BigInt(22),c=BigInt(44),a=BigInt(88),h=BigInt(223),u=e*e*e%t,p=u*u*e%t,b=X(p,i,t)*p%t,v=X(b,i,t)*p%t,L=X(v,n,t)*u%t,k=X(L,s,t)*L%t,_=X(k,o,t)*k%t,C=X(_,c,t)*_%t,M=X(C,a,t)*C%t,f=X(M,c,t)*_%t,m=X(f,n,t)*u%t,x=X(m,r,t)*e%t;return X(x,h,t)*m%t}function or(e){return e[0]&=252,e[55]|=128,e[56]=0,e}var sr=tr(St,456,!0),io=BigInt(4),cr={a:BigInt(1),d:BigInt("726838724295606890549323807888004534353641360687318060281490199180612328166730772686396383698676545930088884461843637361053498018326358"),Fp:sr,n:BigInt("181709681073901722637330951972001133588410340171829515070372549795146003961539585716195755291692375963310293709091662304773755859649779"),nBitLength:456,h:BigInt(4),Gx:BigInt("224580040295924300187604334099896036246789641632564134246125461686950415467406032909029192869357953282578032075146446173674602635247710"),Gy:BigInt("298819210078481492676017930443930673437544040154080242095928241372331506189835876003536878655418784733982303233503462500531545062832660"),hash:Un,randomBytes:ee,adjustScalarBytes:or,domain:(e,t,r)=>{if(t.length>255)throw new Error(`Context is too big: ${t.length}`);return Ue(te("SigEd448"),new Uint8Array([r?1:0,t.length]),t,e)},uvRatio:(e,t)=>{let r=St,n=P(e*e*t,r),i=P(n*e,r),s=P(i*n*t,r),o=ir(s),c=P(i*o,r),a=P(c*c,r);return{isValid:P(a*t,r)===e,value:c}}},ar=we(cr),oo=we({...cr,prehash:On}),ge=(()=>nr({a:BigInt(156326),montgomeryBits:448,nByteLength:57,P:St,Gu:BigInt(5),powPminus2:e=>{let t=St,r=ir(e),n=X(r,BigInt(2),t);return P(n*e,t)},adjustScalarBytes:or,randomBytes:ee}))();var so=(sr.ORDER-BigInt(3))/BigInt(4),co=BigInt(156326);var Lt=["deriveBits"],ur=new Uint8Array([100,107,112,95,112,114,107]),hr=new Uint8Array([115,107]);var ot=class{constructor(t,r,n,i=[]){Object.defineProperty(this,"key",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"type",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"extractable",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"algorithm",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"usages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.key=r,this.type=n,this.algorithm={name:t},this.usages=i,n==="public"&&(this.usages=[])}};var Et="X448",Vt=class{constructor(t){Object.defineProperty(this,"_hkdf",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_nPk",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_nSk",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._hkdf=t,this._nPk=56,this._nSk=56}async serializePublicKey(t){try{return await this._serializePublicKey(t)}catch(r){throw new xt(r)}}async deserializePublicKey(t){try{return await this._importRawKey(t,!0)}catch(r){throw new dt(r)}}async serializePrivateKey(t){try{return await this._serializePrivateKey(t)}catch(r){throw new xt(r)}}async deserializePrivateKey(t){try{return await this._importRawKey(t,!1)}catch(r){throw new dt(r)}}async importKey(t,r,n){try{if(t==="raw")return await this._importRawKey(r,n);if(r instanceof ArrayBuffer)throw new Error("Invalid jwk key format");return await this._importJWK(r,n)}catch(i){throw new dt(i)}}async generateKeyPair(){try{let t=ar.utils.randomPrivateKey(),r=new ot(Et,t,"private",Lt);return{publicKey:await this.derivePublicKey(r),privateKey:r}}catch(t){throw new gt(t)}}async deriveKeyPair(t){try{let r=await this._hkdf.labeledExtract(rt,ur,new Uint8Array(t)),n=await this._hkdf.labeledExpand(r,hr,rt,this._nSk),i=new ot(Et,new Uint8Array(n),"private",Lt);return{privateKey:i,publicKey:await this.derivePublicKey(i)}}catch(r){throw new qt(r)}}async derivePublicKey(t){try{return await this._derivePublicKey(t)}catch(r){throw new dt(r)}}async dh(t,r){try{return await this._dh(t,r)}catch(n){throw new xt(n)}}_serializePublicKey(t){return new Promise(r=>{r(t.key.buffer)})}_serializePrivateKey(t){return new Promise(r=>{r(t.key.buffer)})}_importRawKey(t,r){return new Promise((n,i)=>{r&&t.byteLength!==this._nPk&&i(new Error("Invalid length of the key")),!r&&t.byteLength!==this._nSk&&t.byteLength!==this._nSk+1&&i(new Error("Invalid length of the key")),n(new ot(Et,new Uint8Array(t),r?"public":"private",r?[]:Lt))})}_importJWK(t,r){return new Promise((n,i)=>{t.kty!=="OKP"&&i(new Error(`Invalid kty: ${t.kty}`)),t.crv!=="X448"&&i(new Error(`Invalid crv: ${t.crv}`)),r?(typeof t.d<"u"&&i(new Error("Invalid key: `d` should not be set")),typeof t.x!="string"&&i(new Error("Invalid key: `x` not found")),n(new ot(Et,ue(t.x),"public"))):(typeof t.d!="string"&&i(new Error("Invalid key: `d` not found")),n(new ot(Et,ue(t.d),"private",Lt)))})}_derivePublicKey(t){return new Promise((r,n)=>{try{let i=ge.getPublicKey(t.key);r(new ot(Et,i,"public"))}catch(i){n(i)}})}_dh(t,r){return new Promise((n,i)=>{try{n(ge.getSharedSecret(t.key,r.key).buffer)}catch(s){i(s)}})}};var me=class extends jt{constructor(){let t=new Mt;super(Wt.DhkemX448HkdfSha512,new Vt(t),t),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:Wt.DhkemX448HkdfSha512}),Object.defineProperty(this,"secretSize",{enumerable:!0,configurable:!0,writable:!0,value:64}),Object.defineProperty(this,"encSize",{enumerable:!0,configurable:!0,writable:!0,value:56}),Object.defineProperty(this,"publicKeySize",{enumerable:!0,configurable:!0,writable:!0,value:56}),Object.defineProperty(this,"privateKeySize",{enumerable:!0,configurable:!0,writable:!0,value:56})}};export{me as DhkemX448HkdfSha512}; +var Ir={NotAssigned:0,DhkemP256HkdfSha256:16,DhkemP384HkdfSha384:17,DhkemP521HkdfSha512:18,DhkemSecp256k1HkdfSha256:19,DhkemX25519HkdfSha256:32,DhkemX448HkdfSha512:33,HybridkemX25519Kyber768:48},ee=Ir,kr={HkdfSha256:1,HkdfSha384:2,HkdfSha512:3},re=kr;function Oe(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function ne(e,...t){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw new Error(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function Te(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Oe(e.outputLen),Oe(e.blockLen)}function dt(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function Ne(e,t){ne(e);let r=t.outputLen;if(e.lengthe instanceof Uint8Array;var Pt=e=>new DataView(e.buffer,e.byteOffset,e.byteLength);var Ur=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!Ur)throw new Error("Non little-endian hardware is not supported");function Kr(e){if(typeof e!="string")throw new Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function Bt(e){if(typeof e=="string"&&(e=Kr(e)),!Hr(e))throw new Error(`expected Uint8Array, got ${typeof e}`);return e}var pt=class{clone(){return this._cloneInto()}},xo={}.toString;function Ce(e){let t=n=>e().update(Bt(n)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}var Ot=class extends pt{constructor(t,r){super(),this.finished=!1,this.destroyed=!1,Te(t);let n=Bt(r);if(this.iHash=t.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let o=this.blockLen,i=new Uint8Array(o);i.set(n.length>o?t.create().update(n).digest():n);for(let s=0;snew Ot(e,t).update(r).digest();oe.create=(e,t)=>new Ot(e,t);function Pr(e,t,r,n){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,r,n);let o=BigInt(32),i=BigInt(4294967295),s=Number(r>>o&i),c=Number(r&i),a=n?4:0,l=n?0:4;e.setUint32(t+a,s,n),e.setUint32(t+l,c,n)}var Tt=class extends pt{constructor(t,r,n,o){super(),this.blockLen=t,this.outputLen=r,this.padOffset=n,this.isLE=o,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=Pt(this.buffer)}update(t){dt(this);let{view:r,buffer:n,blockLen:o}=this;t=Bt(t);let i=t.length;for(let s=0;so-s&&(this.process(n,0),s=0);for(let p=s;pu.length)throw new Error("_sha2: outputLen bigger than state");for(let p=0;p>ie&Nt)}:{h:Number(e>>ie&Nt)|0,l:Number(e&Nt)|0}}function Or(e,t=!1){let r=new Uint32Array(e.length),n=new Uint32Array(e.length);for(let o=0;oBigInt(e>>>0)<>>0),Nr=(e,t,r)=>e>>>r,Cr=(e,t,r)=>e<<32-r|t>>>r,zr=(e,t,r)=>e>>>r|t<<32-r,qr=(e,t,r)=>e<<32-r|t>>>r,Dr=(e,t,r)=>e<<64-r|t>>>r-32,Rr=(e,t,r)=>e>>>r-32|t<<64-r,jr=(e,t)=>t,Mr=(e,t)=>e,$r=(e,t,r)=>e<>>32-r,Gr=(e,t,r)=>t<>>32-r,Zr=(e,t,r)=>t<>>64-r,Fr=(e,t,r)=>e<>>64-r;function Xr(e,t,r,n){let o=(t>>>0)+(n>>>0);return{h:e+r+(o/2**32|0)|0,l:o|0}}var Vr=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0),Yr=(e,t,r,n)=>t+r+n+(e/2**32|0)|0,Wr=(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0),Jr=(e,t,r,n,o)=>t+r+n+o+(e/2**32|0)|0,Qr=(e,t,r,n,o)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(o>>>0),tn=(e,t,r,n,o,i)=>t+r+n+o+i+(e/2**32|0)|0;var en={fromBig:ze,split:Or,toBig:Tr,shrSH:Nr,shrSL:Cr,rotrSH:zr,rotrSL:qr,rotrBH:Dr,rotrBL:Rr,rotr32H:jr,rotr32L:Mr,rotlSH:$r,rotlSL:Gr,rotlBH:Zr,rotlBL:Fr,add:Xr,add3L:Vr,add3H:Yr,add4L:Wr,add4H:Jr,add5H:tn,add5L:Qr},g=en;var[rn,nn]=(()=>g.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e))))(),st=new Uint32Array(80),ct=new Uint32Array(80),se=class extends Tt{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){let{Ah:t,Al:r,Bh:n,Bl:o,Ch:i,Cl:s,Dh:c,Dl:a,Eh:l,El:u,Fh:p,Fl:b,Gh:L,Gl:v,Hh:k,Hl:B}=this;return[t,r,n,o,i,s,c,a,l,u,p,b,L,v,k,B]}set(t,r,n,o,i,s,c,a,l,u,p,b,L,v,k,B){this.Ah=t|0,this.Al=r|0,this.Bh=n|0,this.Bl=o|0,this.Ch=i|0,this.Cl=s|0,this.Dh=c|0,this.Dl=a|0,this.Eh=l|0,this.El=u|0,this.Fh=p|0,this.Fl=b|0,this.Gh=L|0,this.Gl=v|0,this.Hh=k|0,this.Hl=B|0}process(t,r){for(let f=0;f<16;f++,r+=4)st[f]=t.getUint32(r),ct[f]=t.getUint32(r+=4);for(let f=16;f<80;f++){let m=st[f-15]|0,w=ct[f-15]|0,z=g.rotrSH(m,w,1)^g.rotrSH(m,w,8)^g.shrSH(m,w,7),V=g.rotrSL(m,w,1)^g.rotrSL(m,w,8)^g.shrSL(m,w,7),U=st[f-2]|0,P=ct[f-2]|0,j=g.rotrSH(U,P,19)^g.rotrBH(U,P,61)^g.shrSH(U,P,6),q=g.rotrSL(U,P,19)^g.rotrBL(U,P,61)^g.shrSL(U,P,6),G=g.add4L(V,q,ct[f-7],ct[f-16]),O=g.add4H(G,z,j,st[f-7],st[f-16]);st[f]=O|0,ct[f]=G|0}let{Ah:n,Al:o,Bh:i,Bl:s,Ch:c,Cl:a,Dh:l,Dl:u,Eh:p,El:b,Fh:L,Fl:v,Gh:k,Gl:B,Hh:C,Hl:R}=this;for(let f=0;f<80;f++){let m=g.rotrSH(p,b,14)^g.rotrSH(p,b,18)^g.rotrBH(p,b,41),w=g.rotrSL(p,b,14)^g.rotrSL(p,b,18)^g.rotrBL(p,b,41),z=p&L^~p&k,V=b&v^~b&B,U=g.add5L(R,w,V,nn[f],ct[f]),P=g.add5H(U,C,m,z,rn[f],st[f]),j=U|0,q=g.rotrSH(n,o,28)^g.rotrBH(n,o,34)^g.rotrBH(n,o,39),G=g.rotrSL(n,o,28)^g.rotrBL(n,o,34)^g.rotrBL(n,o,39),O=n&i^n&c^i&c,Et=o&s^o&a^s&a;C=k|0,R=B|0,k=L|0,B=v|0,L=p|0,v=b|0,{h:p,l:b}=g.add(l|0,u|0,P|0,j|0),l=c|0,u=a|0,c=i|0,a=s|0,i=n|0,s=o|0;let ot=g.add3L(j,G,Et);n=g.add3H(ot,P,q,O),o=ot|0}({h:n,l:o}=g.add(this.Ah|0,this.Al|0,n|0,o|0)),{h:i,l:s}=g.add(this.Bh|0,this.Bl|0,i|0,s|0),{h:c,l:a}=g.add(this.Ch|0,this.Cl|0,c|0,a|0),{h:l,l:u}=g.add(this.Dh|0,this.Dl|0,l|0,u|0),{h:p,l:b}=g.add(this.Eh|0,this.El|0,p|0,b|0),{h:L,l:v}=g.add(this.Fh|0,this.Fl|0,L|0,v|0),{h:k,l:B}=g.add(this.Gh|0,this.Gl|0,k|0,B|0),{h:C,l:R}=g.add(this.Hh|0,this.Hl|0,C|0,R|0),this.set(n,o,i,s,c,a,l,u,p,b,L,v,k,B,C,R)}roundClean(){st.fill(0),ct.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}};var qe=Ce(()=>new se);var on={},De=sn(globalThis,on);function sn(e,t){return new Proxy(e,{get(r,n,o){return n in t?t[n]:e[n]},set(r,n,o){return n in t&&delete t[n],e[n]=o,!0},deleteProperty(r,n){let o=!1;return n in t&&(delete t[n],o=!0),n in e&&(delete e[n],o=!0),o},ownKeys(r){let n=Reflect.ownKeys(e),o=Reflect.ownKeys(t),i=new Set(o);return[...n.filter(s=>!i.has(s)),...o]},defineProperty(r,n,o){return n in t&&delete t[n],Reflect.defineProperty(e,n,o),!0},getOwnPropertyDescriptor(r,n){return n in t?Reflect.getOwnPropertyDescriptor(t,n):Reflect.getOwnPropertyDescriptor(e,n)},has(r,n){return n in t||n in e}})}var ce=class extends Error{constructor(t){let r;t instanceof Error?r=t.message:typeof t=="string"?r=t:r="",super(r),this.name=this.constructor.name}},Q=class extends ce{},yt=class extends Q{};var bt=class extends Q{},ut=class extends Q{},Ct=class extends Q{},zt=class extends Q{};var qt=class extends Q{},wt=class extends Q{};async function an(){if(De!==void 0&&globalThis.crypto!==void 0)return globalThis.crypto.subtle;try{let{webcrypto:e}=await import("crypto");return e.subtle}catch(e){throw new wt(e)}}var Dt=class{constructor(){Object.defineProperty(this,"_api",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}async _setup(){this._api===void 0&&(this._api=await an())}};var tt=new Uint8Array(0);var Re=new Uint8Array([72,80,75,69,45,118,49]),ae=class extends Dt{constructor(){super(),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:re.HkdfSha256}),Object.defineProperty(this,"hashSize",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_suiteId",{enumerable:!0,configurable:!0,writable:!0,value:tt}),Object.defineProperty(this,"algHash",{enumerable:!0,configurable:!0,writable:!0,value:{name:"HMAC",hash:"SHA-256",length:256}})}init(t){this._suiteId=t}buildLabeledIkm(t,r){this._checkInit();let n=new Uint8Array(7+this._suiteId.byteLength+t.byteLength+r.byteLength);return n.set(Re,0),n.set(this._suiteId,7),n.set(t,7+this._suiteId.byteLength),n.set(r,7+this._suiteId.byteLength+t.byteLength),n}buildLabeledInfo(t,r,n){this._checkInit();let o=new Uint8Array(9+this._suiteId.byteLength+t.byteLength+r.byteLength);return o.set(new Uint8Array([0,n]),0),o.set(Re,2),o.set(this._suiteId,9),o.set(t,9+this._suiteId.byteLength),o.set(r,9+this._suiteId.byteLength+t.byteLength),o}async extract(t,r){if(await this._setup(),t.byteLength===0&&(t=new ArrayBuffer(this.hashSize)),t.byteLength!==this.hashSize)throw new yt("The salt length must be the same as the hashSize");let n=await this._api.importKey("raw",t,this.algHash,!1,["sign"]);return await this._api.sign("HMAC",n,r)}async expand(t,r,n){await this._setup();let o=await this._api.importKey("raw",t,this.algHash,!1,["sign"]),i=new ArrayBuffer(n),s=new Uint8Array(i),c=tt,a=new Uint8Array(r),l=new Uint8Array(1);if(n>255*this.hashSize)throw new Error("Entropy limit reached");let u=new Uint8Array(this.hashSize+a.length+1);for(let p=1,b=0;b=c.length?(s.set(c,b),b+=c.length):(s.set(c.slice(0,s.length-b),b),b+=s.length-b);return i}async extractAndExpand(t,r,n,o){await this._setup();let i=await this._api.importKey("raw",r,"HKDF",!1,["deriveBits"]);return await this._api.deriveBits({name:"HKDF",hash:this.algHash.hash,salt:t,info:n},i,o*8)}async labeledExtract(t,r,n){return await this.extract(t,this.buildLabeledIkm(r,n))}async labeledExpand(t,r,n,o){return await this.expand(t,this.buildLabeledInfo(r,n,o),o)}_checkInit(){if(this._suiteId===tt)throw new Error("Not initialized. Call init()")}};var Rt=class extends ae{constructor(){super(...arguments),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:re.HkdfSha512}),Object.defineProperty(this,"hashSize",{enumerable:!0,configurable:!0,writable:!0,value:64}),Object.defineProperty(this,"algHash",{enumerable:!0,configurable:!0,writable:!0,value:{name:"HMAC",hash:"SHA-512",length:512}})}};var jt=class extends Rt{async extract(t,r){if(await this._setup(),t.byteLength===0&&(t=new ArrayBuffer(this.hashSize)),t.byteLength!==this.hashSize)return oe(qe,new Uint8Array(t),new Uint8Array(r));let n=await this._api.importKey("raw",t,this.algHash,!1,["sign"]);return await this._api.sign("HMAC",n,r)}};var je=new Uint8Array([75,69,77,0,0]);var xt=e=>typeof e=="object"&&e!==null&&typeof e.privateKey=="object"&&typeof e.publicKey=="object";function Me(e,t){if(t<=0)throw new Error("i2Osp: too small size");if(e>=256**t)throw new Error("i2Osp: too large integer");let r=new Uint8Array(t);for(let n=0;n>8;return r}function _t(e,t){let r=new Uint8Array(e.length+t.length);return r.set(e,0),r.set(t,e.length),r}function ue(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r=atob(t),n=new Uint8Array(r.length);for(let o=0;o8192)throw new yt("Too long ikm");return await this._prim.deriveKeyPair(t)}async encap(t){let r;t.ekm===void 0?r=await this.generateKeyPair():xt(t.ekm)?r=t.ekm:r=await this.deriveKeyPair(t.ekm);let n=await this._prim.serializePublicKey(r.publicKey),o=await this._prim.serializePublicKey(t.recipientPublicKey);try{let i;if(t.senderKey===void 0)i=new Uint8Array(await this._prim.dh(r.privateKey,t.recipientPublicKey));else{let a=xt(t.senderKey)?t.senderKey.privateKey:t.senderKey,l=new Uint8Array(await this._prim.dh(r.privateKey,t.recipientPublicKey)),u=new Uint8Array(await this._prim.dh(a,t.recipientPublicKey));i=_t(l,u)}let s;if(t.senderKey===void 0)s=_t(new Uint8Array(n),new Uint8Array(o));else{let a=xt(t.senderKey)?t.senderKey.publicKey:await this._prim.derivePublicKey(t.senderKey),l=await this._prim.serializePublicKey(a);s=fn(new Uint8Array(n),new Uint8Array(o),new Uint8Array(l))}let c=await this._generateSharedSecret(i,s);return{enc:n,sharedSecret:c}}catch(i){throw new Ct(i)}}async decap(t){let r=await this._prim.deserializePublicKey(t.enc),n=xt(t.recipientKey)?t.recipientKey.privateKey:t.recipientKey,o=xt(t.recipientKey)?t.recipientKey.publicKey:await this._prim.derivePublicKey(t.recipientKey),i=await this._prim.serializePublicKey(o);try{let s;if(t.senderPublicKey===void 0)s=new Uint8Array(await this._prim.dh(n,r));else{let a=new Uint8Array(await this._prim.dh(n,r)),l=new Uint8Array(await this._prim.dh(n,t.senderPublicKey));s=_t(a,l)}let c;if(t.senderPublicKey===void 0)c=_t(new Uint8Array(t.enc),new Uint8Array(i));else{let a=await this._prim.serializePublicKey(t.senderPublicKey);c=new Uint8Array(t.enc.byteLength+i.byteLength+a.byteLength),c.set(new Uint8Array(t.enc),0),c.set(new Uint8Array(i),t.enc.byteLength),c.set(new Uint8Array(a),t.enc.byteLength+i.byteLength)}return await this._generateSharedSecret(s,c)}catch(s){throw new zt(s)}}async _generateSharedSecret(t,r){let n=this._kdf.buildLabeledIkm(ln,t),o=this._kdf.buildLabeledInfo(hn,r,this.secretSize);return await this._kdf.extractAndExpand(tt,n,o,this.secretSize)}};function le(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function dn(e){if(typeof e!="boolean")throw new Error(`Expected boolean, not ${e}`)}function $e(e,...t){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw new Error(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function pn(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");le(e.outputLen),le(e.blockLen)}function yn(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function bn(e,t){$e(e);let r=t.outputLen;if(e.length>he&$t)}:{h:Number(e>>he&$t)|0,l:Number(e&$t)|0}}function xn(e,t=!1){let r=new Uint32Array(e.length),n=new Uint32Array(e.length);for(let o=0;oBigInt(e>>>0)<>>0),mn=(e,t,r)=>e>>>r,En=(e,t,r)=>e<<32-r|t>>>r,Bn=(e,t,r)=>e>>>r|t<<32-r,_n=(e,t,r)=>e<<32-r|t>>>r,An=(e,t,r)=>e<<64-r|t>>>r-32,Ln=(e,t,r)=>e>>>r-32|t<<64-r,Sn=(e,t)=>t,vn=(e,t)=>e,In=(e,t,r)=>e<>>32-r,kn=(e,t,r)=>t<>>32-r,Hn=(e,t,r)=>t<>>64-r,Un=(e,t,r)=>e<>>64-r;function Kn(e,t,r,n){let o=(t>>>0)+(n>>>0);return{h:e+r+(o/2**32|0)|0,l:o|0}}var Pn=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0),On=(e,t,r,n)=>t+r+n+(e/2**32|0)|0,Tn=(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0),Nn=(e,t,r,n,o)=>t+r+n+o+(e/2**32|0)|0,Cn=(e,t,r,n,o)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(o>>>0),zn=(e,t,r,n,o,i)=>t+r+n+o+i+(e/2**32|0)|0,qn={fromBig:Ge,split:xn,toBig:gn,shrSH:mn,shrSL:En,rotrSH:Bn,rotrSL:_n,rotrBH:An,rotrBL:Ln,rotr32H:Sn,rotr32L:vn,rotlSH:In,rotlSL:kn,rotlBH:Hn,rotlBL:Un,add:Kn,add3L:Pn,add3H:On,add4L:Tn,add4H:Nn,add5H:zn,add5L:Cn},gt=qn;var Gt=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;var Ze=e=>e instanceof Uint8Array;var Fe=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4));var Dn=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!Dn)throw new Error("Non little-endian hardware is not supported");var ei=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function fe(e){if(typeof e!="string")throw new Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function Ft(e){if(typeof e=="string"&&(e=fe(e)),!Ze(e))throw new Error(`expected Uint8Array, got ${typeof e}`);return e}function Xe(...e){let t=new Uint8Array(e.reduce((n,o)=>n+o.length,0)),r=0;return e.forEach(n=>{if(!Ze(n))throw new Error("Uint8Array expected");t.set(n,r),r+=n.length}),t}var Zt=class{clone(){return this._cloneInto()}};function At(e){let t=n=>e().update(Ft(n)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function Ve(e){let t=(n,o)=>e(o).update(Ft(n)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=n=>e(n),t}function de(e=32){if(Gt&&typeof Gt.getRandomValues=="function")return Gt.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}var[Je,Qe,tr]=[[],[],[]],Rn=BigInt(0),Lt=BigInt(1),jn=BigInt(2),Mn=BigInt(7),$n=BigInt(256),Gn=BigInt(113);for(let e=0,t=Lt,r=1,n=0;e<24;e++){[r,n]=[n,(2*r+3*n)%5],Je.push(2*(5*n+r)),Qe.push((e+1)*(e+2)/2%64);let o=Rn;for(let i=0;i<7;i++)t=(t<>Mn)*Gn)%$n,t&jn&&(o^=Lt<<(Lt<r>32?gt.rotlBH(e,t,r):gt.rotlSH(e,t,r),We=(e,t,r)=>r>32?gt.rotlBL(e,t,r):gt.rotlSL(e,t,r);function Xn(e,t=24){let r=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let s=0;s<10;s++)r[s]=e[s]^e[s+10]^e[s+20]^e[s+30]^e[s+40];for(let s=0;s<10;s+=2){let c=(s+8)%10,a=(s+2)%10,l=r[a],u=r[a+1],p=Ye(l,u,1)^r[c],b=We(l,u,1)^r[c+1];for(let L=0;L<50;L+=10)e[s+L]^=p,e[s+L+1]^=b}let o=e[2],i=e[3];for(let s=0;s<24;s++){let c=Qe[s],a=Ye(o,i,c),l=We(o,i,c),u=Je[s];o=e[u],i=e[u+1],e[u]=a,e[u+1]=l}for(let s=0;s<50;s+=10){for(let c=0;c<10;c++)r[c]=e[s+c];for(let c=0;c<10;c++)e[s+c]^=~r[(c+2)%10]&r[(c+4)%10]}e[0]^=Zn[n],e[1]^=Fn[n]}r.fill(0)}var Xt=class e extends Zt{constructor(t,r,n,o=!1,i=24){if(super(),this.blockLen=t,this.suffix=r,this.outputLen=n,this.enableXOF=o,this.rounds=i,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,lt.number(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=Fe(this.state)}keccak(){Xn(this.state32,this.rounds),this.posOut=0,this.pos=0}update(t){lt.exists(this);let{blockLen:r,state:n}=this;t=Ft(t);let o=t.length;for(let i=0;i=n&&this.keccak();let s=Math.min(n-this.posOut,i-o);t.set(r.subarray(this.posOut,this.posOut+s),o),this.posOut+=s,o+=s}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return lt.number(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(lt.output(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){let{blockLen:r,suffix:n,outputLen:o,rounds:i,enableXOF:s}=this;return t||(t=new e(r,n,o,s,i)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=i,t.suffix=n,t.outputLen=o,t.enableXOF=s,t.destroyed=this.destroyed,t}},at=(e,t,r)=>At(()=>new Xt(t,e,r)),si=at(6,144,224/8),ci=at(6,136,256/8),ai=at(6,104,384/8),ui=at(6,72,512/8),li=at(1,144,224/8),hi=at(1,136,256/8),fi=at(1,104,384/8),di=at(1,72,512/8),er=(e,t,r)=>Ve((n={})=>new Xt(t,e,n.dkLen===void 0?r:n.dkLen,!0)),pi=er(31,168,128/8),pe=er(31,136,256/8);var bi=BigInt(0),Vn=BigInt(1),Yn=BigInt(2),Vt=e=>e instanceof Uint8Array,Wn=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Yt(e){if(!Vt(e))throw new Error("Uint8Array expected");let t="";for(let r=0;rn+o.length,0)),r=0;return e.forEach(n=>{if(!Vt(n))throw new Error("Uint8Array expected");t.set(n,r),r+=n.length}),t}var or=e=>(Yn<typeof e=="bigint",function:e=>typeof e=="function",boolean:e=>typeof e=="boolean",string:e=>typeof e=="string",isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>typeof e=="function"&&Number.isSafeInteger(e.outputLen)};function rt(e,t,r={}){let n=(o,i,s)=>{let c=Jn[i];if(typeof c!="function")throw new Error(`Invalid validator "${i}", expected function`);let a=e[o];if(!(s&&a===void 0)&&!c(a,e))throw new Error(`Invalid param ${String(o)}=${a} (${typeof a}), expected ${i}`)};for(let[o,i]of Object.entries(t))n(o,i,!1);for(let[o,i]of Object.entries(r))n(o,i,!0);return e}var N=BigInt(0),T=BigInt(1),ft=BigInt(2),to=BigInt(3),we=BigInt(4),ir=BigInt(5),sr=BigInt(8),eo=BigInt(9),ro=BigInt(16);function K(e,t){let r=e%t;return r>=N?r:t+r}function xe(e,t,r){if(r<=N||t 0");if(r===T)return N;let n=T;for(;t>N;)t&T&&(n=n*e%r),e=e*e%r,t>>=T;return n}function F(e,t,r){let n=e;for(;t-- >N;)n*=n,n%=r;return n}function cr(e,t){if(e===N||t<=N)throw new Error(`invert: expected positive integers, got n=${e} mod=${t}`);let r=K(e,t),n=t,o=N,i=T,s=T,c=N;for(;r!==N;){let l=n/r,u=n%r,p=o-s*l,b=i-c*l;n=r,r=u,o=s,i=c,s=p,c=b}if(n!==T)throw new Error("invert: does not exist");return K(o,t)}function no(e){let t=(e-T)/ft,r,n,o;for(r=e-T,n=0;r%ft===N;r/=ft,n++);for(o=ft;o(n[o]="function",n),t);return rt(e,r)}function so(e,t,r){if(r 0");if(r===N)return e.ONE;if(r===T)return t;let n=e.ONE,o=t;for(;r>N;)r&T&&(n=e.mul(n,o)),o=e.sqr(o),r>>=T;return n}function co(e,t){let r=new Array(t.length),n=t.reduce((i,s,c)=>e.is0(s)?i:(r[c]=i,e.mul(i,s)),e.ONE),o=e.inv(n);return t.reduceRight((i,s,c)=>e.is0(s)?i:(r[c]=e.mul(i,r[c]),e.mul(i,s)),o),r}function ge(e,t){let r=t!==void 0?t:e.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function ur(e,t,r=!1,n={}){if(e<=N)throw new Error(`Expected Fp ORDER > 0, got ${e}`);let{nBitLength:o,nByteLength:i}=ge(e,t);if(i>2048)throw new Error("Field lengths over 2048 bytes are not supported");let s=oo(e),c=Object.freeze({ORDER:e,BITS:o,BYTES:i,MASK:or(o),ZERO:N,ONE:T,create:a=>K(a,e),isValid:a=>{if(typeof a!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof a}`);return N<=a&&aa===N,isOdd:a=>(a&T)===T,neg:a=>K(-a,e),eql:(a,l)=>a===l,sqr:a=>K(a*a,e),add:(a,l)=>K(a+l,e),sub:(a,l)=>K(a-l,e),mul:(a,l)=>K(a*l,e),pow:(a,l)=>so(c,a,l),div:(a,l)=>K(a*cr(l,e),e),sqrN:a=>a*a,addN:(a,l)=>a+l,subN:(a,l)=>a-l,mulN:(a,l)=>a*l,inv:a=>cr(a,e),sqrt:n.sqrt||(a=>s(c,a)),invertBatch:a=>co(c,a),cmov:(a,l,u)=>u?l:a,toBytes:a=>r?ht(a,i):be(a,i),fromBytes:a=>{if(a.length!==i)throw new Error(`Fp.fromBytes: expected ${i}, got ${a.length}`);return r?et(a):ye(a)}});return Object.freeze(c)}var ao=BigInt(0),me=BigInt(1);function lr(e,t){let r=(o,i)=>{let s=i.negate();return o?s:i},n=o=>{let i=Math.ceil(t/o)+1,s=2**(o-1);return{windows:i,windowSize:s}};return{constTimeNegate:r,unsafeLadder(o,i){let s=e.ZERO,c=o;for(;i>ao;)i&me&&(s=s.add(c)),c=c.double(),i>>=me;return s},precomputeWindow(o,i){let{windows:s,windowSize:c}=n(i),a=[],l=o,u=l;for(let p=0;p>=L,B>a&&(B-=b,s+=me);let C=k,R=k+Math.abs(B)-1,f=v%2!==0,m=B<0;B===0?u=u.add(r(f,i[C])):l=l.add(r(m,i[R]))}return{p:l,f:u}},wNAFCached(o,i,s,c){let a=o._WINDOW_SIZE||1,l=i.get(o);return l||(l=this.precomputeWindow(o,a),a!==1&&i.set(o,c(l))),this.wNAF(a,l,s)}}}function hr(e){return ar(e.Fp),rt(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...ge(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}var Y=BigInt(0),X=BigInt(1),Jt=BigInt(2),uo=BigInt(8),lo={zip215:!0};function ho(e){let t=hr(e);return rt(e,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...t})}function Ee(e){let t=ho(e),{Fp:r,n,prehash:o,hash:i,randomBytes:s,nByteLength:c,h:a}=t,l=Jt<{try{return{isValid:!0,value:r.sqrt(d*r.inv(h))}}catch{return{isValid:!1,value:Y}}}),b=t.adjustScalarBytes||(d=>d),L=t.domain||((d,h,y)=>{if(h.length||y)throw new Error("Contexts/pre-hash are not supported");return d}),v=d=>typeof d=="bigint"&&Yv(d)&&v(h)&&dd===Y||k(d,l);function C(d,h){if(k(d,h))return d;throw new Error(`Expected valid scalar < ${h}, got ${typeof d} ${d}`)}function R(d){return d===Y?d:C(d,n)}let f=new Map;function m(d){if(!(d instanceof w))throw new Error("ExtendedPoint expected")}class w{constructor(h,y,x,E){if(this.ex=h,this.ey=y,this.ez=x,this.et=E,!B(h))throw new Error("x required");if(!B(y))throw new Error("y required");if(!B(x))throw new Error("z required");if(!B(E))throw new Error("t required")}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(h){if(h instanceof w)throw new Error("extended point not allowed");let{x:y,y:x}=h||{};if(!B(y)||!B(x))throw new Error("invalid affine point");return new w(y,x,X,u(y*x))}static normalizeZ(h){let y=r.invertBatch(h.map(x=>x.ez));return h.map((x,E)=>x.toAffine(y[E])).map(w.fromAffine)}_setWindowSize(h){this._WINDOW_SIZE=h,f.delete(this)}assertValidity(){let{a:h,d:y}=t;if(this.is0())throw new Error("bad point: ZERO");let{ex:x,ey:E,ez:_,et:S}=this,H=u(x*x),A=u(E*E),I=u(_*_),D=u(I*I),M=u(H*h),W=u(I*u(M+A)),$=u(D+u(y*u(H*A)));if(W!==$)throw new Error("bad point: equation left != right (1)");let it=u(x*E),J=u(_*S);if(it!==J)throw new Error("bad point: equation left != right (2)")}equals(h){m(h);let{ex:y,ey:x,ez:E}=this,{ex:_,ey:S,ez:H}=h,A=u(y*H),I=u(_*E),D=u(x*H),M=u(S*E);return A===I&&D===M}is0(){return this.equals(w.ZERO)}negate(){return new w(u(-this.ex),this.ey,this.ez,u(-this.et))}double(){let{a:h}=t,{ex:y,ey:x,ez:E}=this,_=u(y*y),S=u(x*x),H=u(Jt*u(E*E)),A=u(h*_),I=y+x,D=u(u(I*I)-_-S),M=A+S,W=M-H,$=A-S,it=u(D*W),J=u(M*$),Ut=u(D*$),Kt=u(W*M);return new w(it,J,Kt,Ut)}add(h){m(h);let{a:y,d:x}=t,{ex:E,ey:_,ez:S,et:H}=this,{ex:A,ey:I,ez:D,et:M}=h;if(y===BigInt(-1)){let ve=u((_-E)*(I+A)),Ie=u((_+E)*(I-A)),te=u(Ie-ve);if(te===Y)return this.double();let ke=u(S*Jt*M),He=u(H*Jt*D),Ue=He+ke,Ke=Ie+ve,Pe=He-ke,Ar=u(Ue*te),Lr=u(Ke*Pe),Sr=u(Ue*Pe),vr=u(te*Ke);return new w(Ar,Lr,vr,Sr)}let W=u(E*A),$=u(_*I),it=u(H*x*M),J=u(S*D),Ut=u((E+_)*(A+I)-W-$),Kt=J-it,Le=J+it,Se=u($-y*W),mr=u(Ut*Kt),Er=u(Le*Se),Br=u(Ut*Se),_r=u(Kt*Le);return new w(mr,Er,_r,Br)}subtract(h){return this.add(h.negate())}wNAF(h){return U.wNAFCached(this,f,h,w.normalizeZ)}multiply(h){let{p:y,f:x}=this.wNAF(C(h,n));return w.normalizeZ([y,x])[0]}multiplyUnsafe(h){let y=R(h);return y===Y?V:this.equals(V)||y===X?this:this.equals(z)?this.wNAF(y).p:U.unsafeLadder(this,y)}isSmallOrder(){return this.multiplyUnsafe(a).is0()}isTorsionFree(){return U.unsafeLadder(this,n).is0()}toAffine(h){let{ex:y,ey:x,ez:E}=this,_=this.is0();h==null&&(h=_?uo:r.inv(E));let S=u(y*h),H=u(x*h),A=u(E*h);if(_)return{x:Y,y:X};if(A!==X)throw new Error("invZ was invalid");return{x:S,y:H}}clearCofactor(){let{h}=t;return h===X?this:this.multiplyUnsafe(h)}static fromHex(h,y=!1){let{d:x,a:E}=t,_=r.BYTES;h=Z("pointHex",h,_);let S=h.slice(),H=h[_-1];S[_-1]=H&-129;let A=et(S);A===Y||(y?C(A,l):C(A,r.ORDER));let I=u(A*A),D=u(I-X),M=u(x*I-E),{isValid:W,value:$}=p(D,M);if(!W)throw new Error("Point.fromHex: invalid y coordinate");let it=($&X)===X,J=(H&128)!==0;if(!y&&$===Y&&J)throw new Error("Point.fromHex: x=0 and x_0=1");return J!==it&&($=u(-$)),w.fromAffine({x:$,y:A})}static fromPrivateKey(h){return q(h).point}toRawBytes(){let{x:h,y}=this.toAffine(),x=ht(y,r.BYTES);return x[x.length-1]|=h&X?128:0,x}toHex(){return Yt(this.toRawBytes())}}w.BASE=new w(t.Gx,t.Gy,X,u(t.Gx*t.Gy)),w.ZERO=new w(Y,X,X,Y);let{BASE:z,ZERO:V}=w,U=lr(w,c*8);function P(d){return K(d,n)}function j(d){return P(et(d))}function q(d){let h=c;d=Z("private key",d,h);let y=Z("hashed private key",i(d),2*h),x=b(y.slice(0,h)),E=y.slice(h,2*h),_=j(x),S=z.multiply(_),H=S.toRawBytes();return{head:x,prefix:E,scalar:_,point:S,pointBytes:H}}function G(d){return q(d).pointBytes}function O(d=new Uint8Array,...h){let y=Wt(...h);return j(i(L(y,Z("context",d),!!o)))}function Et(d,h,y={}){d=Z("message",d),o&&(d=o(d));let{prefix:x,scalar:E,pointBytes:_}=q(h),S=O(y.context,x,d),H=z.multiply(S).toRawBytes(),A=O(y.context,H,_,d),I=P(S+A*E);R(I);let D=Wt(H,ht(I,r.BYTES));return Z("result",D,c*2)}let ot=lo;function kt(d,h,y,x=ot){let{context:E,zip215:_}=x,S=r.BYTES;d=Z("signature",d,2*S),h=Z("message",h),o&&(h=o(h));let H=et(d.slice(S,2*S)),A,I,D;try{A=w.fromHex(y,_),I=w.fromHex(d.slice(0,S),_),D=z.multiplyUnsafe(H)}catch{return!1}if(!_&&A.isSmallOrder())return!1;let M=O(E,I.toRawBytes(),A.toRawBytes(),h);return I.add(A.multiplyUnsafe(M)).subtract(D).clearCofactor().equals(w.ZERO)}return z._setWindowSize(8),{CURVE:t,getPublicKey:G,sign:Et,verify:kt,ExtendedPoint:w,utils:{getExtendedPublicKey:q,randomPrivateKey:()=>s(r.BYTES),precompute(d=8,h=w.BASE){return h._setWindowSize(d),h.multiply(BigInt(3)),h}}}}var St=BigInt(0),Be=BigInt(1);function fo(e){return rt(e,{a:"bigint"},{montgomeryBits:"isSafeInteger",nByteLength:"isSafeInteger",adjustScalarBytes:"function",domain:"function",powPminus2:"function",Gu:"bigint"}),Object.freeze({...e})}function fr(e){let t=fo(e),{P:r}=t,n=f=>K(f,r),o=t.montgomeryBits,i=Math.ceil(o/8),s=t.nByteLength,c=t.adjustScalarBytes||(f=>f),a=t.powPminus2||(f=>xe(f,r-BigInt(2),r));function l(f,m,w){let z=n(f*(m-w));return m=n(m-z),w=n(w+z),[m,w]}function u(f){if(typeof f=="bigint"&&St<=f&&f=St;ot--){let kt=z>>ot&Be;G^=kt,O=l(G,U,j),U=O[0],j=O[1],O=l(G,P,q),P=O[0],q=O[1],G=kt;let Ht=U+P,d=n(Ht*Ht),h=U-P,y=n(h*h),x=d-y,E=j+q,_=j-q,S=n(_*Ht),H=n(E*h),A=S+H,I=S-H;j=n(A*A),q=n(V*n(I*I)),U=n(d*y),P=n(x*(d+n(p*x)))}O=l(G,U,j),U=O[0],j=O[1],O=l(G,P,q),P=O[0],q=O[1];let Et=a(P);return n(U*Et)}function L(f){return ht(n(f),i)}function v(f){let m=Z("u coordinate",f,i);return s===i&&(m[s-1]&=127),et(m)}function k(f){let m=Z("scalar",f);if(m.length!==i&&m.length!==s)throw new Error(`Expected ${i} or ${s} bytes, got ${m.length}`);return et(c(m))}function B(f,m){let w=v(m),z=k(f),V=b(w,z);if(V===St)throw new Error("Invalid private or public key received");return L(V)}let C=L(t.Gu);function R(f){return B(f,C)}return{scalarMult:B,scalarMultBase:R,getSharedSecret:(f,m)=>B(f,m),getPublicKey:f=>R(f),utils:{randomPrivateKey:()=>t.randomBytes(t.nByteLength)},GuBytes:C}}var po=At(()=>pe.create({dkLen:114})),yo=At(()=>pe.create({dkLen:64})),vt=BigInt("726838724295606890549323807888004534353641360687318060281490199180612328166730772686396383698676545930088884461843637361053498018365439");function dr(e){let t=vt,r=BigInt(1),n=BigInt(2),o=BigInt(3),i=BigInt(11),s=BigInt(22),c=BigInt(44),a=BigInt(88),l=BigInt(223),u=e*e*e%t,p=u*u*e%t,b=F(p,o,t)*p%t,L=F(b,o,t)*p%t,v=F(L,n,t)*u%t,k=F(v,i,t)*v%t,B=F(k,s,t)*k%t,C=F(B,c,t)*B%t,R=F(C,a,t)*C%t,f=F(R,c,t)*B%t,m=F(f,n,t)*u%t,w=F(m,r,t)*e%t;return F(w,l,t)*m%t}function pr(e){return e[0]&=252,e[55]|=128,e[56]=0,e}var yr=ur(vt,456,!0),Di=BigInt(4),br={a:BigInt(1),d:BigInt("726838724295606890549323807888004534353641360687318060281490199180612328166730772686396383698676545930088884461843637361053498018326358"),Fp:yr,n:BigInt("181709681073901722637330951972001133588410340171829515070372549795146003961539585716195755291692375963310293709091662304773755859649779"),nBitLength:456,h:BigInt(4),Gx:BigInt("224580040295924300187604334099896036246789641632564134246125461686950415467406032909029192869357953282578032075146446173674602635247710"),Gy:BigInt("298819210078481492676017930443930673437544040154080242095928241372331506189835876003536878655418784733982303233503462500531545062832660"),hash:po,randomBytes:de,adjustScalarBytes:pr,domain:(e,t,r)=>{if(t.length>255)throw new Error(`Context is too big: ${t.length}`);return Xe(fe("SigEd448"),new Uint8Array([r?1:0,t.length]),t,e)},uvRatio:(e,t)=>{let r=vt,n=K(e*e*t,r),o=K(n*e,r),i=K(o*n*t,r),s=dr(i),c=K(o*s,r),a=K(c*c,r);return{isValid:K(a*t,r)===e,value:c}}},wr=Ee(br),Ri=Ee({...br,prehash:yo}),_e=(()=>fr({a:BigInt(156326),montgomeryBits:448,nByteLength:57,P:vt,Gu:BigInt(5),powPminus2:e=>{let t=vt,r=dr(e),n=F(r,BigInt(2),t);return K(n*e,t)},adjustScalarBytes:pr,randomBytes:de}))();var ji=(yr.ORDER-BigInt(3))/BigInt(4),Mi=BigInt(156326);var It=["deriveBits"],xr=new Uint8Array([100,107,112,95,112,114,107]),gr=new Uint8Array([115,107]);var nt=class{constructor(t,r,n,o=[]){Object.defineProperty(this,"key",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"type",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"extractable",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"algorithm",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"usages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.key=r,this.type=n,this.algorithm={name:t},this.usages=o,n==="public"&&(this.usages=[])}};var mt="X448",Qt=class{constructor(t){Object.defineProperty(this,"_hkdf",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_nPk",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_nSk",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._hkdf=t,this._nPk=56,this._nSk=56}async serializePublicKey(t){try{return await this._serializePublicKey(t)}catch(r){throw new bt(r)}}async deserializePublicKey(t){try{return await this._importRawKey(t,!0)}catch(r){throw new ut(r)}}async serializePrivateKey(t){try{return await this._serializePrivateKey(t)}catch(r){throw new bt(r)}}async deserializePrivateKey(t){try{return await this._importRawKey(t,!1)}catch(r){throw new ut(r)}}async importKey(t,r,n){try{if(t==="raw")return await this._importRawKey(r,n);if(r instanceof ArrayBuffer)throw new Error("Invalid jwk key format");return await this._importJWK(r,n)}catch(o){throw new ut(o)}}async generateKeyPair(){try{let t=wr.utils.randomPrivateKey(),r=new nt(mt,t,"private",It);return{publicKey:await this.derivePublicKey(r),privateKey:r}}catch(t){throw new wt(t)}}async deriveKeyPair(t){try{let r=await this._hkdf.labeledExtract(tt,xr,new Uint8Array(t)),n=await this._hkdf.labeledExpand(r,gr,tt,this._nSk),o=new nt(mt,new Uint8Array(n),"private",It);return{privateKey:o,publicKey:await this.derivePublicKey(o)}}catch(r){throw new qt(r)}}async derivePublicKey(t){try{return await this._derivePublicKey(t)}catch(r){throw new ut(r)}}async dh(t,r){try{return await this._dh(t,r)}catch(n){throw new bt(n)}}_serializePublicKey(t){return new Promise(r=>{r(t.key.buffer)})}_serializePrivateKey(t){return new Promise(r=>{r(t.key.buffer)})}_importRawKey(t,r){return new Promise((n,o)=>{r&&t.byteLength!==this._nPk&&o(new Error("Invalid length of the key")),!r&&t.byteLength!==this._nSk&&t.byteLength!==this._nSk+1&&o(new Error("Invalid length of the key")),n(new nt(mt,new Uint8Array(t),r?"public":"private",r?[]:It))})}_importJWK(t,r){return new Promise((n,o)=>{t.kty!=="OKP"&&o(new Error(`Invalid kty: ${t.kty}`)),t.crv!=="X448"&&o(new Error(`Invalid crv: ${t.crv}`)),r?(typeof t.d<"u"&&o(new Error("Invalid key: `d` should not be set")),typeof t.x!="string"&&o(new Error("Invalid key: `x` not found")),n(new nt(mt,ue(t.x),"public"))):(typeof t.d!="string"&&o(new Error("Invalid key: `d` not found")),n(new nt(mt,ue(t.d),"private",It)))})}_derivePublicKey(t){return new Promise((r,n)=>{try{let o=_e.getPublicKey(t.key);r(new nt(mt,o,"public"))}catch(o){n(o)}})}_dh(t,r){return new Promise((n,o)=>{try{n(_e.getSharedSecret(t.key,r.key).buffer)}catch(i){o(i)}})}};var Ae=class extends Mt{constructor(){let t=new jt;super(ee.DhkemX448HkdfSha512,new Qt(t),t),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:ee.DhkemX448HkdfSha512}),Object.defineProperty(this,"secretSize",{enumerable:!0,configurable:!0,writable:!0,value:64}),Object.defineProperty(this,"encSize",{enumerable:!0,configurable:!0,writable:!0,value:56}),Object.defineProperty(this,"publicKeySize",{enumerable:!0,configurable:!0,writable:!0,value:56}),Object.defineProperty(this,"privateKeySize",{enumerable:!0,configurable:!0,writable:!0,value:56})}};export{Ae as DhkemX448HkdfSha512}; /*! Bundled license information: +@noble/hashes/esm/utils.js: + (*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *) + @noble/hashes/esm/utils.js: (*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *) diff --git a/docs/assets/main.js b/docs/assets/main.js index 3cee05e61..01bcad55f 100644 --- a/docs/assets/main.js +++ b/docs/assets/main.js @@ -1,7 +1,8 @@ "use strict"; -"use strict";(()=>{var Se=Object.create;var re=Object.defineProperty;var we=Object.getOwnPropertyDescriptor;var Te=Object.getOwnPropertyNames;var ke=Object.getPrototypeOf,Qe=Object.prototype.hasOwnProperty;var Pe=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Ie=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Te(e))!Qe.call(t,i)&&i!==r&&re(t,i,{get:()=>e[i],enumerable:!(n=we(e,i))||n.enumerable});return t};var Ce=(t,e,r)=>(r=t!=null?Se(ke(t)):{},Ie(e||!t||!t.__esModule?re(r,"default",{value:t,enumerable:!0}):r,t));var ae=Pe((se,oe)=>{(function(){var t=function(e){var r=new t.Builder;return r.pipeline.add(t.trimmer,t.stopWordFilter,t.stemmer),r.searchPipeline.add(t.stemmer),e.call(r,r),r.build()};t.version="2.3.9";t.utils={},t.utils.warn=function(e){return function(r){e.console&&console.warn&&console.warn(r)}}(this),t.utils.asString=function(e){return e==null?"":e.toString()},t.utils.clone=function(e){if(e==null)return e;for(var r=Object.create(null),n=Object.keys(e),i=0;i0){var d=t.utils.clone(r)||{};d.position=[a,u],d.index=s.length,s.push(new t.Token(n.slice(a,o),d))}a=o+1}}return s},t.tokenizer.separator=/[\s\-]+/;t.Pipeline=function(){this._stack=[]},t.Pipeline.registeredFunctions=Object.create(null),t.Pipeline.registerFunction=function(e,r){r in this.registeredFunctions&&t.utils.warn("Overwriting existing registered function: "+r),e.label=r,t.Pipeline.registeredFunctions[e.label]=e},t.Pipeline.warnIfFunctionNotRegistered=function(e){var r=e.label&&e.label in this.registeredFunctions;r||t.utils.warn(`Function is not registered with pipeline. This may cause problems when serialising the index. -`,e)},t.Pipeline.load=function(e){var r=new t.Pipeline;return e.forEach(function(n){var i=t.Pipeline.registeredFunctions[n];if(i)r.add(i);else throw new Error("Cannot load unregistered function: "+n)}),r},t.Pipeline.prototype.add=function(){var e=Array.prototype.slice.call(arguments);e.forEach(function(r){t.Pipeline.warnIfFunctionNotRegistered(r),this._stack.push(r)},this)},t.Pipeline.prototype.after=function(e,r){t.Pipeline.warnIfFunctionNotRegistered(r);var n=this._stack.indexOf(e);if(n==-1)throw new Error("Cannot find existingFn");n=n+1,this._stack.splice(n,0,r)},t.Pipeline.prototype.before=function(e,r){t.Pipeline.warnIfFunctionNotRegistered(r);var n=this._stack.indexOf(e);if(n==-1)throw new Error("Cannot find existingFn");this._stack.splice(n,0,r)},t.Pipeline.prototype.remove=function(e){var r=this._stack.indexOf(e);r!=-1&&this._stack.splice(r,1)},t.Pipeline.prototype.run=function(e){for(var r=this._stack.length,n=0;n1&&(oe&&(n=s),o!=e);)i=n-r,s=r+Math.floor(i/2),o=this.elements[s*2];if(o==e||o>e)return s*2;if(ol?d+=2:a==l&&(r+=n[u+1]*i[d+1],u+=2,d+=2);return r},t.Vector.prototype.similarity=function(e){return this.dot(e)/this.magnitude()||0},t.Vector.prototype.toArray=function(){for(var e=new Array(this.elements.length/2),r=1,n=0;r0){var o=s.str.charAt(0),a;o in s.node.edges?a=s.node.edges[o]:(a=new t.TokenSet,s.node.edges[o]=a),s.str.length==1&&(a.final=!0),i.push({node:a,editsRemaining:s.editsRemaining,str:s.str.slice(1)})}if(s.editsRemaining!=0){if("*"in s.node.edges)var l=s.node.edges["*"];else{var l=new t.TokenSet;s.node.edges["*"]=l}if(s.str.length==0&&(l.final=!0),i.push({node:l,editsRemaining:s.editsRemaining-1,str:s.str}),s.str.length>1&&i.push({node:s.node,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)}),s.str.length==1&&(s.node.final=!0),s.str.length>=1){if("*"in s.node.edges)var u=s.node.edges["*"];else{var u=new t.TokenSet;s.node.edges["*"]=u}s.str.length==1&&(u.final=!0),i.push({node:u,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)})}if(s.str.length>1){var d=s.str.charAt(0),m=s.str.charAt(1),y;m in s.node.edges?y=s.node.edges[m]:(y=new t.TokenSet,s.node.edges[m]=y),s.str.length==1&&(y.final=!0),i.push({node:y,editsRemaining:s.editsRemaining-1,str:d+s.str.slice(2)})}}}return n},t.TokenSet.fromString=function(e){for(var r=new t.TokenSet,n=r,i=0,s=e.length;i=e;r--){var n=this.uncheckedNodes[r],i=n.child.toString();i in this.minimizedNodes?n.parent.edges[n.char]=this.minimizedNodes[i]:(n.child._str=i,this.minimizedNodes[i]=n.child),this.uncheckedNodes.pop()}};t.Index=function(e){this.invertedIndex=e.invertedIndex,this.fieldVectors=e.fieldVectors,this.tokenSet=e.tokenSet,this.fields=e.fields,this.pipeline=e.pipeline},t.Index.prototype.search=function(e){return this.query(function(r){var n=new t.QueryParser(e,r);n.parse()})},t.Index.prototype.query=function(e){for(var r=new t.Query(this.fields),n=Object.create(null),i=Object.create(null),s=Object.create(null),o=Object.create(null),a=Object.create(null),l=0;l1?this._b=1:this._b=e},t.Builder.prototype.k1=function(e){this._k1=e},t.Builder.prototype.add=function(e,r){var n=e[this._ref],i=Object.keys(this._fields);this._documents[n]=r||{},this.documentCount+=1;for(var s=0;s=this.length)return t.QueryLexer.EOS;var e=this.str.charAt(this.pos);return this.pos+=1,e},t.QueryLexer.prototype.width=function(){return this.pos-this.start},t.QueryLexer.prototype.ignore=function(){this.start==this.pos&&(this.pos+=1),this.start=this.pos},t.QueryLexer.prototype.backup=function(){this.pos-=1},t.QueryLexer.prototype.acceptDigitRun=function(){var e,r;do e=this.next(),r=e.charCodeAt(0);while(r>47&&r<58);e!=t.QueryLexer.EOS&&this.backup()},t.QueryLexer.prototype.more=function(){return this.pos1&&(e.backup(),e.emit(t.QueryLexer.TERM)),e.ignore(),e.more())return t.QueryLexer.lexText},t.QueryLexer.lexEditDistance=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(t.QueryLexer.EDIT_DISTANCE),t.QueryLexer.lexText},t.QueryLexer.lexBoost=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(t.QueryLexer.BOOST),t.QueryLexer.lexText},t.QueryLexer.lexEOS=function(e){e.width()>0&&e.emit(t.QueryLexer.TERM)},t.QueryLexer.termSeparator=t.tokenizer.separator,t.QueryLexer.lexText=function(e){for(;;){var r=e.next();if(r==t.QueryLexer.EOS)return t.QueryLexer.lexEOS;if(r.charCodeAt(0)==92){e.escapeCharacter();continue}if(r==":")return t.QueryLexer.lexField;if(r=="~")return e.backup(),e.width()>0&&e.emit(t.QueryLexer.TERM),t.QueryLexer.lexEditDistance;if(r=="^")return e.backup(),e.width()>0&&e.emit(t.QueryLexer.TERM),t.QueryLexer.lexBoost;if(r=="+"&&e.width()===1||r=="-"&&e.width()===1)return e.emit(t.QueryLexer.PRESENCE),t.QueryLexer.lexText;if(r.match(t.QueryLexer.termSeparator))return t.QueryLexer.lexTerm}},t.QueryParser=function(e,r){this.lexer=new t.QueryLexer(e),this.query=r,this.currentClause={},this.lexemeIdx=0},t.QueryParser.prototype.parse=function(){this.lexer.run(),this.lexemes=this.lexer.lexemes;for(var e=t.QueryParser.parseClause;e;)e=e(this);return this.query},t.QueryParser.prototype.peekLexeme=function(){return this.lexemes[this.lexemeIdx]},t.QueryParser.prototype.consumeLexeme=function(){var e=this.peekLexeme();return this.lexemeIdx+=1,e},t.QueryParser.prototype.nextClause=function(){var e=this.currentClause;this.query.clause(e),this.currentClause={}},t.QueryParser.parseClause=function(e){var r=e.peekLexeme();if(r!=null)switch(r.type){case t.QueryLexer.PRESENCE:return t.QueryParser.parsePresence;case t.QueryLexer.FIELD:return t.QueryParser.parseField;case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var n="expected either a field or a term, found "+r.type;throw r.str.length>=1&&(n+=" with value '"+r.str+"'"),new t.QueryParseError(n,r.start,r.end)}},t.QueryParser.parsePresence=function(e){var r=e.consumeLexeme();if(r!=null){switch(r.str){case"-":e.currentClause.presence=t.Query.presence.PROHIBITED;break;case"+":e.currentClause.presence=t.Query.presence.REQUIRED;break;default:var n="unrecognised presence operator'"+r.str+"'";throw new t.QueryParseError(n,r.start,r.end)}var i=e.peekLexeme();if(i==null){var n="expecting term or field, found nothing";throw new t.QueryParseError(n,r.start,r.end)}switch(i.type){case t.QueryLexer.FIELD:return t.QueryParser.parseField;case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var n="expecting term or field, found '"+i.type+"'";throw new t.QueryParseError(n,i.start,i.end)}}},t.QueryParser.parseField=function(e){var r=e.consumeLexeme();if(r!=null){if(e.query.allFields.indexOf(r.str)==-1){var n=e.query.allFields.map(function(o){return"'"+o+"'"}).join(", "),i="unrecognised field '"+r.str+"', possible fields: "+n;throw new t.QueryParseError(i,r.start,r.end)}e.currentClause.fields=[r.str];var s=e.peekLexeme();if(s==null){var i="expecting term, found nothing";throw new t.QueryParseError(i,r.start,r.end)}switch(s.type){case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var i="expecting term, found '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},t.QueryParser.parseTerm=function(e){var r=e.consumeLexeme();if(r!=null){e.currentClause.term=r.str.toLowerCase(),r.str.indexOf("*")!=-1&&(e.currentClause.usePipeline=!1);var n=e.peekLexeme();if(n==null){e.nextClause();return}switch(n.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+n.type+"'";throw new t.QueryParseError(i,n.start,n.end)}}},t.QueryParser.parseEditDistance=function(e){var r=e.consumeLexeme();if(r!=null){var n=parseInt(r.str,10);if(isNaN(n)){var i="edit distance must be numeric";throw new t.QueryParseError(i,r.start,r.end)}e.currentClause.editDistance=n;var s=e.peekLexeme();if(s==null){e.nextClause();return}switch(s.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},t.QueryParser.parseBoost=function(e){var r=e.consumeLexeme();if(r!=null){var n=parseInt(r.str,10);if(isNaN(n)){var i="boost must be numeric";throw new t.QueryParseError(i,r.start,r.end)}e.currentClause.boost=n;var s=e.peekLexeme();if(s==null){e.nextClause();return}switch(s.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},function(e,r){typeof define=="function"&&define.amd?define(r):typeof se=="object"?oe.exports=r():e.lunr=r()}(this,function(){return t})})()});var ne=[];function G(t,e){ne.push({selector:e,constructor:t})}var U=class{constructor(){this.alwaysVisibleMember=null;this.createComponents(document.body),this.ensureActivePageVisible(),this.ensureFocusedElementVisible(),this.listenForCodeCopies(),window.addEventListener("hashchange",()=>this.ensureFocusedElementVisible())}createComponents(e){ne.forEach(r=>{e.querySelectorAll(r.selector).forEach(n=>{n.dataset.hasInstance||(new r.constructor({el:n,app:this}),n.dataset.hasInstance=String(!0))})})}filterChanged(){this.ensureFocusedElementVisible()}ensureActivePageVisible(){let e=document.querySelector(".tsd-navigation .current"),r=e?.parentElement;for(;r&&!r.classList.contains(".tsd-navigation");)r instanceof HTMLDetailsElement&&(r.open=!0),r=r.parentElement;if(e){let n=e.getBoundingClientRect().top-document.documentElement.clientHeight/4;document.querySelector(".site-menu").scrollTop=n}}ensureFocusedElementVisible(){if(this.alwaysVisibleMember&&(this.alwaysVisibleMember.classList.remove("always-visible"),this.alwaysVisibleMember.firstElementChild.remove(),this.alwaysVisibleMember=null),!location.hash)return;let e=document.getElementById(location.hash.substring(1));if(!e)return;let r=e.parentElement;for(;r&&r.tagName!=="SECTION";)r=r.parentElement;if(r&&r.offsetParent==null){this.alwaysVisibleMember=r,r.classList.add("always-visible");let n=document.createElement("p");n.classList.add("warning"),n.textContent="This member is normally hidden due to your filter settings.",r.prepend(n)}}listenForCodeCopies(){document.querySelectorAll("pre > button").forEach(e=>{let r;e.addEventListener("click",()=>{e.previousElementSibling instanceof HTMLElement&&navigator.clipboard.writeText(e.previousElementSibling.innerText.trim()),e.textContent="Copied!",e.classList.add("visible"),clearTimeout(r),r=setTimeout(()=>{e.classList.remove("visible"),r=setTimeout(()=>{e.textContent="Copy"},100)},1e3)})})}};var ie=(t,e=100)=>{let r;return()=>{clearTimeout(r),r=setTimeout(()=>t(),e)}};var ce=Ce(ae());function de(){let t=document.getElementById("tsd-search");if(!t)return;let e=document.getElementById("tsd-search-script");t.classList.add("loading"),e&&(e.addEventListener("error",()=>{t.classList.remove("loading"),t.classList.add("failure")}),e.addEventListener("load",()=>{t.classList.remove("loading"),t.classList.add("ready")}),window.searchData&&t.classList.remove("loading"));let r=document.querySelector("#tsd-search input"),n=document.querySelector("#tsd-search .results");if(!r||!n)throw new Error("The input field or the result list wrapper was not found");let i=!1;n.addEventListener("mousedown",()=>i=!0),n.addEventListener("mouseup",()=>{i=!1,t.classList.remove("has-focus")}),r.addEventListener("focus",()=>t.classList.add("has-focus")),r.addEventListener("blur",()=>{i||(i=!1,t.classList.remove("has-focus"))});let s={base:t.dataset.base+"/"};Oe(t,n,r,s)}function Oe(t,e,r,n){r.addEventListener("input",ie(()=>{Re(t,e,r,n)},200));let i=!1;r.addEventListener("keydown",s=>{i=!0,s.key=="Enter"?Fe(e,r):s.key=="Escape"?r.blur():s.key=="ArrowUp"?ue(e,-1):s.key==="ArrowDown"?ue(e,1):i=!1}),r.addEventListener("keypress",s=>{i&&s.preventDefault()}),document.body.addEventListener("keydown",s=>{s.altKey||s.ctrlKey||s.metaKey||!r.matches(":focus")&&s.key==="/"&&(r.focus(),s.preventDefault())})}function _e(t,e){t.index||window.searchData&&(e.classList.remove("loading"),e.classList.add("ready"),t.data=window.searchData,t.index=ce.Index.load(window.searchData.index))}function Re(t,e,r,n){if(_e(n,t),!n.index||!n.data)return;e.textContent="";let i=r.value.trim(),s=i?n.index.search(`*${i}*`):[];for(let o=0;oa.score-o.score);for(let o=0,a=Math.min(10,s.length);o${le(l.parent,i)}.${u}`);let d=document.createElement("li");d.classList.value=l.classes??"";let m=document.createElement("a");m.href=n.base+l.url,m.innerHTML=u,d.append(m),e.appendChild(d)}}function ue(t,e){let r=t.querySelector(".current");if(!r)r=t.querySelector(e==1?"li:first-child":"li:last-child"),r&&r.classList.add("current");else{let n=r;if(e===1)do n=n.nextElementSibling??void 0;while(n instanceof HTMLElement&&n.offsetParent==null);else do n=n.previousElementSibling??void 0;while(n instanceof HTMLElement&&n.offsetParent==null);n&&(r.classList.remove("current"),n.classList.add("current"))}}function Fe(t,e){let r=t.querySelector(".current");if(r||(r=t.querySelector("li:first-child")),r){let n=r.querySelector("a");n&&(window.location.href=n.href),e.blur()}}function le(t,e){if(e==="")return t;let r=t.toLocaleLowerCase(),n=e.toLocaleLowerCase(),i=[],s=0,o=r.indexOf(n);for(;o!=-1;)i.push(K(t.substring(s,o)),`${K(t.substring(o,o+n.length))}`),s=o+n.length,o=r.indexOf(n,s);return i.push(K(t.substring(s))),i.join("")}var Me={"&":"&","<":"<",">":">","'":"'",'"':"""};function K(t){return t.replace(/[&<>"'"]/g,e=>Me[e])}var P=class{constructor(e){this.el=e.el,this.app=e.app}};var M="mousedown",fe="mousemove",N="mouseup",J={x:0,y:0},he=!1,ee=!1,De=!1,D=!1,pe=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);document.documentElement.classList.add(pe?"is-mobile":"not-mobile");pe&&"ontouchstart"in document.documentElement&&(De=!0,M="touchstart",fe="touchmove",N="touchend");document.addEventListener(M,t=>{ee=!0,D=!1;let e=M=="touchstart"?t.targetTouches[0]:t;J.y=e.pageY||0,J.x=e.pageX||0});document.addEventListener(fe,t=>{if(ee&&!D){let e=M=="touchstart"?t.targetTouches[0]:t,r=J.x-(e.pageX||0),n=J.y-(e.pageY||0);D=Math.sqrt(r*r+n*n)>10}});document.addEventListener(N,()=>{ee=!1});document.addEventListener("click",t=>{he&&(t.preventDefault(),t.stopImmediatePropagation(),he=!1)});var X=class extends P{constructor(r){super(r);this.className=this.el.dataset.toggle||"",this.el.addEventListener(N,n=>this.onPointerUp(n)),this.el.addEventListener("click",n=>n.preventDefault()),document.addEventListener(M,n=>this.onDocumentPointerDown(n)),document.addEventListener(N,n=>this.onDocumentPointerUp(n))}setActive(r){if(this.active==r)return;this.active=r,document.documentElement.classList.toggle("has-"+this.className,r),this.el.classList.toggle("active",r);let n=(this.active?"to-has-":"from-has-")+this.className;document.documentElement.classList.add(n),setTimeout(()=>document.documentElement.classList.remove(n),500)}onPointerUp(r){D||(this.setActive(!0),r.preventDefault())}onDocumentPointerDown(r){if(this.active){if(r.target.closest(".col-sidebar, .tsd-filter-group"))return;this.setActive(!1)}}onDocumentPointerUp(r){if(!D&&this.active&&r.target.closest(".col-sidebar")){let n=r.target.closest("a");if(n){let i=window.location.href;i.indexOf("#")!=-1&&(i=i.substring(0,i.indexOf("#"))),n.href.substring(0,i.length)==i&&setTimeout(()=>this.setActive(!1),250)}}}};var te;try{te=localStorage}catch{te={getItem(){return null},setItem(){}}}var Q=te;var me=document.head.appendChild(document.createElement("style"));me.dataset.for="filters";var Y=class extends P{constructor(r){super(r);this.key=`filter-${this.el.name}`,this.value=this.el.checked,this.el.addEventListener("change",()=>{this.setLocalStorage(this.el.checked)}),this.setLocalStorage(this.fromLocalStorage()),me.innerHTML+=`html:not(.${this.key}) .tsd-is-${this.el.name} { display: none; } -`}fromLocalStorage(){let r=Q.getItem(this.key);return r?r==="true":this.el.checked}setLocalStorage(r){Q.setItem(this.key,r.toString()),this.value=r,this.handleValueChange()}handleValueChange(){this.el.checked=this.value,document.documentElement.classList.toggle(this.key,this.value),this.app.filterChanged(),document.querySelectorAll(".tsd-index-section").forEach(r=>{r.style.display="block";let n=Array.from(r.querySelectorAll(".tsd-index-link")).every(i=>i.offsetParent==null);r.style.display=n?"none":"block"})}};var Z=class extends P{constructor(r){super(r);this.summary=this.el.querySelector(".tsd-accordion-summary"),this.icon=this.summary.querySelector("svg"),this.key=`tsd-accordion-${this.summary.dataset.key??this.summary.textContent.trim().replace(/\s+/g,"-").toLowerCase()}`;let n=Q.getItem(this.key);this.el.open=n?n==="true":this.el.open,this.el.addEventListener("toggle",()=>this.update()),this.update()}update(){this.icon.style.transform=`rotate(${this.el.open?0:-90}deg)`,Q.setItem(this.key,this.el.open.toString())}};function ve(t){let e=Q.getItem("tsd-theme")||"os";t.value=e,ye(e),t.addEventListener("change",()=>{Q.setItem("tsd-theme",t.value),ye(t.value)})}function ye(t){document.documentElement.dataset.theme=t}de();G(X,"a[data-toggle]");G(Z,".tsd-index-accordion");G(Y,".tsd-filter-item input[type=checkbox]");var ge=document.getElementById("tsd-theme");ge&&ve(ge);var Ae=new U;Object.defineProperty(window,"app",{value:Ae});document.querySelectorAll("summary a").forEach(t=>{t.addEventListener("click",()=>{location.assign(t.href)})});})(); +"use strict";(()=>{var Pe=Object.create;var ne=Object.defineProperty;var Ie=Object.getOwnPropertyDescriptor;var Oe=Object.getOwnPropertyNames;var _e=Object.getPrototypeOf,Re=Object.prototype.hasOwnProperty;var Me=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Fe=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Oe(e))!Re.call(t,i)&&i!==n&&ne(t,i,{get:()=>e[i],enumerable:!(r=Ie(e,i))||r.enumerable});return t};var De=(t,e,n)=>(n=t!=null?Pe(_e(t)):{},Fe(e||!t||!t.__esModule?ne(n,"default",{value:t,enumerable:!0}):n,t));var ae=Me((se,oe)=>{(function(){var t=function(e){var n=new t.Builder;return n.pipeline.add(t.trimmer,t.stopWordFilter,t.stemmer),n.searchPipeline.add(t.stemmer),e.call(n,n),n.build()};t.version="2.3.9";t.utils={},t.utils.warn=function(e){return function(n){e.console&&console.warn&&console.warn(n)}}(this),t.utils.asString=function(e){return e==null?"":e.toString()},t.utils.clone=function(e){if(e==null)return e;for(var n=Object.create(null),r=Object.keys(e),i=0;i0){var d=t.utils.clone(n)||{};d.position=[a,u],d.index=s.length,s.push(new t.Token(r.slice(a,o),d))}a=o+1}}return s},t.tokenizer.separator=/[\s\-]+/;t.Pipeline=function(){this._stack=[]},t.Pipeline.registeredFunctions=Object.create(null),t.Pipeline.registerFunction=function(e,n){n in this.registeredFunctions&&t.utils.warn("Overwriting existing registered function: "+n),e.label=n,t.Pipeline.registeredFunctions[e.label]=e},t.Pipeline.warnIfFunctionNotRegistered=function(e){var n=e.label&&e.label in this.registeredFunctions;n||t.utils.warn(`Function is not registered with pipeline. This may cause problems when serialising the index. +`,e)},t.Pipeline.load=function(e){var n=new t.Pipeline;return e.forEach(function(r){var i=t.Pipeline.registeredFunctions[r];if(i)n.add(i);else throw new Error("Cannot load unregistered function: "+r)}),n},t.Pipeline.prototype.add=function(){var e=Array.prototype.slice.call(arguments);e.forEach(function(n){t.Pipeline.warnIfFunctionNotRegistered(n),this._stack.push(n)},this)},t.Pipeline.prototype.after=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var r=this._stack.indexOf(e);if(r==-1)throw new Error("Cannot find existingFn");r=r+1,this._stack.splice(r,0,n)},t.Pipeline.prototype.before=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var r=this._stack.indexOf(e);if(r==-1)throw new Error("Cannot find existingFn");this._stack.splice(r,0,n)},t.Pipeline.prototype.remove=function(e){var n=this._stack.indexOf(e);n!=-1&&this._stack.splice(n,1)},t.Pipeline.prototype.run=function(e){for(var n=this._stack.length,r=0;r1&&(oe&&(r=s),o!=e);)i=r-n,s=n+Math.floor(i/2),o=this.elements[s*2];if(o==e||o>e)return s*2;if(ol?d+=2:a==l&&(n+=r[u+1]*i[d+1],u+=2,d+=2);return n},t.Vector.prototype.similarity=function(e){return this.dot(e)/this.magnitude()||0},t.Vector.prototype.toArray=function(){for(var e=new Array(this.elements.length/2),n=1,r=0;n0){var o=s.str.charAt(0),a;o in s.node.edges?a=s.node.edges[o]:(a=new t.TokenSet,s.node.edges[o]=a),s.str.length==1&&(a.final=!0),i.push({node:a,editsRemaining:s.editsRemaining,str:s.str.slice(1)})}if(s.editsRemaining!=0){if("*"in s.node.edges)var l=s.node.edges["*"];else{var l=new t.TokenSet;s.node.edges["*"]=l}if(s.str.length==0&&(l.final=!0),i.push({node:l,editsRemaining:s.editsRemaining-1,str:s.str}),s.str.length>1&&i.push({node:s.node,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)}),s.str.length==1&&(s.node.final=!0),s.str.length>=1){if("*"in s.node.edges)var u=s.node.edges["*"];else{var u=new t.TokenSet;s.node.edges["*"]=u}s.str.length==1&&(u.final=!0),i.push({node:u,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)})}if(s.str.length>1){var d=s.str.charAt(0),v=s.str.charAt(1),f;v in s.node.edges?f=s.node.edges[v]:(f=new t.TokenSet,s.node.edges[v]=f),s.str.length==1&&(f.final=!0),i.push({node:f,editsRemaining:s.editsRemaining-1,str:d+s.str.slice(2)})}}}return r},t.TokenSet.fromString=function(e){for(var n=new t.TokenSet,r=n,i=0,s=e.length;i=e;n--){var r=this.uncheckedNodes[n],i=r.child.toString();i in this.minimizedNodes?r.parent.edges[r.char]=this.minimizedNodes[i]:(r.child._str=i,this.minimizedNodes[i]=r.child),this.uncheckedNodes.pop()}};t.Index=function(e){this.invertedIndex=e.invertedIndex,this.fieldVectors=e.fieldVectors,this.tokenSet=e.tokenSet,this.fields=e.fields,this.pipeline=e.pipeline},t.Index.prototype.search=function(e){return this.query(function(n){var r=new t.QueryParser(e,n);r.parse()})},t.Index.prototype.query=function(e){for(var n=new t.Query(this.fields),r=Object.create(null),i=Object.create(null),s=Object.create(null),o=Object.create(null),a=Object.create(null),l=0;l1?this._b=1:this._b=e},t.Builder.prototype.k1=function(e){this._k1=e},t.Builder.prototype.add=function(e,n){var r=e[this._ref],i=Object.keys(this._fields);this._documents[r]=n||{},this.documentCount+=1;for(var s=0;s=this.length)return t.QueryLexer.EOS;var e=this.str.charAt(this.pos);return this.pos+=1,e},t.QueryLexer.prototype.width=function(){return this.pos-this.start},t.QueryLexer.prototype.ignore=function(){this.start==this.pos&&(this.pos+=1),this.start=this.pos},t.QueryLexer.prototype.backup=function(){this.pos-=1},t.QueryLexer.prototype.acceptDigitRun=function(){var e,n;do e=this.next(),n=e.charCodeAt(0);while(n>47&&n<58);e!=t.QueryLexer.EOS&&this.backup()},t.QueryLexer.prototype.more=function(){return this.pos1&&(e.backup(),e.emit(t.QueryLexer.TERM)),e.ignore(),e.more())return t.QueryLexer.lexText},t.QueryLexer.lexEditDistance=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(t.QueryLexer.EDIT_DISTANCE),t.QueryLexer.lexText},t.QueryLexer.lexBoost=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(t.QueryLexer.BOOST),t.QueryLexer.lexText},t.QueryLexer.lexEOS=function(e){e.width()>0&&e.emit(t.QueryLexer.TERM)},t.QueryLexer.termSeparator=t.tokenizer.separator,t.QueryLexer.lexText=function(e){for(;;){var n=e.next();if(n==t.QueryLexer.EOS)return t.QueryLexer.lexEOS;if(n.charCodeAt(0)==92){e.escapeCharacter();continue}if(n==":")return t.QueryLexer.lexField;if(n=="~")return e.backup(),e.width()>0&&e.emit(t.QueryLexer.TERM),t.QueryLexer.lexEditDistance;if(n=="^")return e.backup(),e.width()>0&&e.emit(t.QueryLexer.TERM),t.QueryLexer.lexBoost;if(n=="+"&&e.width()===1||n=="-"&&e.width()===1)return e.emit(t.QueryLexer.PRESENCE),t.QueryLexer.lexText;if(n.match(t.QueryLexer.termSeparator))return t.QueryLexer.lexTerm}},t.QueryParser=function(e,n){this.lexer=new t.QueryLexer(e),this.query=n,this.currentClause={},this.lexemeIdx=0},t.QueryParser.prototype.parse=function(){this.lexer.run(),this.lexemes=this.lexer.lexemes;for(var e=t.QueryParser.parseClause;e;)e=e(this);return this.query},t.QueryParser.prototype.peekLexeme=function(){return this.lexemes[this.lexemeIdx]},t.QueryParser.prototype.consumeLexeme=function(){var e=this.peekLexeme();return this.lexemeIdx+=1,e},t.QueryParser.prototype.nextClause=function(){var e=this.currentClause;this.query.clause(e),this.currentClause={}},t.QueryParser.parseClause=function(e){var n=e.peekLexeme();if(n!=null)switch(n.type){case t.QueryLexer.PRESENCE:return t.QueryParser.parsePresence;case t.QueryLexer.FIELD:return t.QueryParser.parseField;case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var r="expected either a field or a term, found "+n.type;throw n.str.length>=1&&(r+=" with value '"+n.str+"'"),new t.QueryParseError(r,n.start,n.end)}},t.QueryParser.parsePresence=function(e){var n=e.consumeLexeme();if(n!=null){switch(n.str){case"-":e.currentClause.presence=t.Query.presence.PROHIBITED;break;case"+":e.currentClause.presence=t.Query.presence.REQUIRED;break;default:var r="unrecognised presence operator'"+n.str+"'";throw new t.QueryParseError(r,n.start,n.end)}var i=e.peekLexeme();if(i==null){var r="expecting term or field, found nothing";throw new t.QueryParseError(r,n.start,n.end)}switch(i.type){case t.QueryLexer.FIELD:return t.QueryParser.parseField;case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var r="expecting term or field, found '"+i.type+"'";throw new t.QueryParseError(r,i.start,i.end)}}},t.QueryParser.parseField=function(e){var n=e.consumeLexeme();if(n!=null){if(e.query.allFields.indexOf(n.str)==-1){var r=e.query.allFields.map(function(o){return"'"+o+"'"}).join(", "),i="unrecognised field '"+n.str+"', possible fields: "+r;throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.fields=[n.str];var s=e.peekLexeme();if(s==null){var i="expecting term, found nothing";throw new t.QueryParseError(i,n.start,n.end)}switch(s.type){case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var i="expecting term, found '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},t.QueryParser.parseTerm=function(e){var n=e.consumeLexeme();if(n!=null){e.currentClause.term=n.str.toLowerCase(),n.str.indexOf("*")!=-1&&(e.currentClause.usePipeline=!1);var r=e.peekLexeme();if(r==null){e.nextClause();return}switch(r.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+r.type+"'";throw new t.QueryParseError(i,r.start,r.end)}}},t.QueryParser.parseEditDistance=function(e){var n=e.consumeLexeme();if(n!=null){var r=parseInt(n.str,10);if(isNaN(r)){var i="edit distance must be numeric";throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.editDistance=r;var s=e.peekLexeme();if(s==null){e.nextClause();return}switch(s.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},t.QueryParser.parseBoost=function(e){var n=e.consumeLexeme();if(n!=null){var r=parseInt(n.str,10);if(isNaN(r)){var i="boost must be numeric";throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.boost=r;var s=e.peekLexeme();if(s==null){e.nextClause();return}switch(s.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},function(e,n){typeof define=="function"&&define.amd?define(n):typeof se=="object"?oe.exports=n():e.lunr=n()}(this,function(){return t})})()});var re=[];function G(t,e){re.push({selector:e,constructor:t})}var U=class{constructor(){this.alwaysVisibleMember=null;this.createComponents(document.body),this.ensureActivePageVisible(),this.ensureFocusedElementVisible(),this.listenForCodeCopies(),window.addEventListener("hashchange",()=>this.ensureFocusedElementVisible())}createComponents(e){re.forEach(n=>{e.querySelectorAll(n.selector).forEach(r=>{r.dataset.hasInstance||(new n.constructor({el:r,app:this}),r.dataset.hasInstance=String(!0))})})}filterChanged(){this.ensureFocusedElementVisible()}ensureActivePageVisible(){let e=document.querySelector(".tsd-navigation .current"),n=e?.parentElement;for(;n&&!n.classList.contains(".tsd-navigation");)n instanceof HTMLDetailsElement&&(n.open=!0),n=n.parentElement;if(e){let r=e.getBoundingClientRect().top-document.documentElement.clientHeight/4;document.querySelector(".site-menu").scrollTop=r}}ensureFocusedElementVisible(){if(this.alwaysVisibleMember&&(this.alwaysVisibleMember.classList.remove("always-visible"),this.alwaysVisibleMember.firstElementChild.remove(),this.alwaysVisibleMember=null),!location.hash)return;let e=document.getElementById(location.hash.substring(1));if(!e)return;let n=e.parentElement;for(;n&&n.tagName!=="SECTION";)n=n.parentElement;if(n&&n.offsetParent==null){this.alwaysVisibleMember=n,n.classList.add("always-visible");let r=document.createElement("p");r.classList.add("warning"),r.textContent="This member is normally hidden due to your filter settings.",n.prepend(r)}}listenForCodeCopies(){document.querySelectorAll("pre > button").forEach(e=>{let n;e.addEventListener("click",()=>{e.previousElementSibling instanceof HTMLElement&&navigator.clipboard.writeText(e.previousElementSibling.innerText.trim()),e.textContent="Copied!",e.classList.add("visible"),clearTimeout(n),n=setTimeout(()=>{e.classList.remove("visible"),n=setTimeout(()=>{e.textContent="Copy"},100)},1e3)})})}};var ie=(t,e=100)=>{let n;return()=>{clearTimeout(n),n=setTimeout(()=>t(),e)}};var de=De(ae());async function le(t,e){if(!window.searchData)return;let n=await fetch(window.searchData),r=new Blob([await n.arrayBuffer()]).stream().pipeThrough(new DecompressionStream("gzip")),i=await new Response(r).json();t.data=i,t.index=de.Index.load(i.index),e.classList.remove("loading"),e.classList.add("ready")}function he(){let t=document.getElementById("tsd-search");if(!t)return;let e={base:t.dataset.base+"/"},n=document.getElementById("tsd-search-script");t.classList.add("loading"),n&&(n.addEventListener("error",()=>{t.classList.remove("loading"),t.classList.add("failure")}),n.addEventListener("load",()=>{le(e,t)}),le(e,t));let r=document.querySelector("#tsd-search input"),i=document.querySelector("#tsd-search .results");if(!r||!i)throw new Error("The input field or the result list wrapper was not found");let s=!1;i.addEventListener("mousedown",()=>s=!0),i.addEventListener("mouseup",()=>{s=!1,t.classList.remove("has-focus")}),r.addEventListener("focus",()=>t.classList.add("has-focus")),r.addEventListener("blur",()=>{s||(s=!1,t.classList.remove("has-focus"))}),Ae(t,i,r,e)}function Ae(t,e,n,r){n.addEventListener("input",ie(()=>{Ne(t,e,n,r)},200));let i=!1;n.addEventListener("keydown",s=>{i=!0,s.key=="Enter"?Ve(e,n):s.key=="Escape"?n.blur():s.key=="ArrowUp"?ue(e,-1):s.key==="ArrowDown"?ue(e,1):i=!1}),n.addEventListener("keypress",s=>{i&&s.preventDefault()}),document.body.addEventListener("keydown",s=>{s.altKey||s.ctrlKey||s.metaKey||!n.matches(":focus")&&s.key==="/"&&(n.focus(),s.preventDefault())})}function Ne(t,e,n,r){if(!r.index||!r.data)return;e.textContent="";let i=n.value.trim(),s=i?r.index.search(`*${i}*`):[];for(let o=0;oa.score-o.score);for(let o=0,a=Math.min(10,s.length);o`,d=ce(l.name,i);globalThis.DEBUG_SEARCH_WEIGHTS&&(d+=` (score: ${s[o].score.toFixed(2)})`),l.parent&&(d=` + ${ce(l.parent,i)}.${d}`);let v=document.createElement("li");v.classList.value=l.classes??"";let f=document.createElement("a");f.href=r.base+l.url,f.innerHTML=u+d,v.append(f),e.appendChild(v)}}function ue(t,e){let n=t.querySelector(".current");if(!n)n=t.querySelector(e==1?"li:first-child":"li:last-child"),n&&n.classList.add("current");else{let r=n;if(e===1)do r=r.nextElementSibling??void 0;while(r instanceof HTMLElement&&r.offsetParent==null);else do r=r.previousElementSibling??void 0;while(r instanceof HTMLElement&&r.offsetParent==null);r&&(n.classList.remove("current"),r.classList.add("current"))}}function Ve(t,e){let n=t.querySelector(".current");if(n||(n=t.querySelector("li:first-child")),n){let r=n.querySelector("a");r&&(window.location.href=r.href),e.blur()}}function ce(t,e){if(e==="")return t;let n=t.toLocaleLowerCase(),r=e.toLocaleLowerCase(),i=[],s=0,o=n.indexOf(r);for(;o!=-1;)i.push(K(t.substring(s,o)),`${K(t.substring(o,o+r.length))}`),s=o+r.length,o=n.indexOf(r,s);return i.push(K(t.substring(s))),i.join("")}var Be={"&":"&","<":"<",">":">","'":"'",'"':"""};function K(t){return t.replace(/[&<>"'"]/g,e=>Be[e])}var C=class{constructor(e){this.el=e.el,this.app=e.app}};var F="mousedown",pe="mousemove",B="mouseup",J={x:0,y:0},fe=!1,ee=!1,He=!1,D=!1,me=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);document.documentElement.classList.add(me?"is-mobile":"not-mobile");me&&"ontouchstart"in document.documentElement&&(He=!0,F="touchstart",pe="touchmove",B="touchend");document.addEventListener(F,t=>{ee=!0,D=!1;let e=F=="touchstart"?t.targetTouches[0]:t;J.y=e.pageY||0,J.x=e.pageX||0});document.addEventListener(pe,t=>{if(ee&&!D){let e=F=="touchstart"?t.targetTouches[0]:t,n=J.x-(e.pageX||0),r=J.y-(e.pageY||0);D=Math.sqrt(n*n+r*r)>10}});document.addEventListener(B,()=>{ee=!1});document.addEventListener("click",t=>{fe&&(t.preventDefault(),t.stopImmediatePropagation(),fe=!1)});var X=class extends C{constructor(n){super(n);this.className=this.el.dataset.toggle||"",this.el.addEventListener(B,r=>this.onPointerUp(r)),this.el.addEventListener("click",r=>r.preventDefault()),document.addEventListener(F,r=>this.onDocumentPointerDown(r)),document.addEventListener(B,r=>this.onDocumentPointerUp(r))}setActive(n){if(this.active==n)return;this.active=n,document.documentElement.classList.toggle("has-"+this.className,n),this.el.classList.toggle("active",n);let r=(this.active?"to-has-":"from-has-")+this.className;document.documentElement.classList.add(r),setTimeout(()=>document.documentElement.classList.remove(r),500)}onPointerUp(n){D||(this.setActive(!0),n.preventDefault())}onDocumentPointerDown(n){if(this.active){if(n.target.closest(".col-sidebar, .tsd-filter-group"))return;this.setActive(!1)}}onDocumentPointerUp(n){if(!D&&this.active&&n.target.closest(".col-sidebar")){let r=n.target.closest("a");if(r){let i=window.location.href;i.indexOf("#")!=-1&&(i=i.substring(0,i.indexOf("#"))),r.href.substring(0,i.length)==i&&setTimeout(()=>this.setActive(!1),250)}}}};var te;try{te=localStorage}catch{te={getItem(){return null},setItem(){}}}var Q=te;var ve=document.head.appendChild(document.createElement("style"));ve.dataset.for="filters";var Y=class extends C{constructor(n){super(n);this.key=`filter-${this.el.name}`,this.value=this.el.checked,this.el.addEventListener("change",()=>{this.setLocalStorage(this.el.checked)}),this.setLocalStorage(this.fromLocalStorage()),ve.innerHTML+=`html:not(.${this.key}) .tsd-is-${this.el.name} { display: none; } +`}fromLocalStorage(){let n=Q.getItem(this.key);return n?n==="true":this.el.checked}setLocalStorage(n){Q.setItem(this.key,n.toString()),this.value=n,this.handleValueChange()}handleValueChange(){this.el.checked=this.value,document.documentElement.classList.toggle(this.key,this.value),this.app.filterChanged(),document.querySelectorAll(".tsd-index-section").forEach(n=>{n.style.display="block";let r=Array.from(n.querySelectorAll(".tsd-index-link")).every(i=>i.offsetParent==null);n.style.display=r?"none":"block"})}};var Z=class extends C{constructor(n){super(n);this.summary=this.el.querySelector(".tsd-accordion-summary"),this.icon=this.summary.querySelector("svg"),this.key=`tsd-accordion-${this.summary.dataset.key??this.summary.textContent.trim().replace(/\s+/g,"-").toLowerCase()}`;let r=Q.getItem(this.key);this.el.open=r?r==="true":this.el.open,this.el.addEventListener("toggle",()=>this.update());let i=this.summary.querySelector("a");i&&i.addEventListener("click",()=>{location.assign(i.href)}),this.update()}update(){this.icon.style.transform=`rotate(${this.el.open?0:-90}deg)`,Q.setItem(this.key,this.el.open.toString())}};function ge(t){let e=Q.getItem("tsd-theme")||"os";t.value=e,ye(e),t.addEventListener("change",()=>{Q.setItem("tsd-theme",t.value),ye(t.value)})}function ye(t){document.documentElement.dataset.theme=t}var Le;function be(){let t=document.getElementById("tsd-nav-script");t&&(t.addEventListener("load",xe),xe())}async function xe(){let t=document.getElementById("tsd-nav-container");if(!t||!window.navigationData)return;let n=await(await fetch(window.navigationData)).arrayBuffer(),r=new Blob([n]).stream().pipeThrough(new DecompressionStream("gzip")),i=await new Response(r).json();Le=t.dataset.base+"/",t.innerHTML="";for(let s of i)we(s,t,[]);window.app.createComponents(t),window.app.ensureActivePageVisible()}function we(t,e,n){let r=e.appendChild(document.createElement("li"));if(t.children){let i=[...n,t.text],s=r.appendChild(document.createElement("details"));s.className=t.class?`${t.class} tsd-index-accordion`:"tsd-index-accordion",s.dataset.key=i.join("$");let o=s.appendChild(document.createElement("summary"));o.className="tsd-accordion-summary",o.innerHTML='',Ee(t,o);let a=s.appendChild(document.createElement("div"));a.className="tsd-accordion-details";let l=a.appendChild(document.createElement("ul"));l.className="tsd-nested-navigation";for(let u of t.children)we(u,l,i)}else Ee(t,r,t.class)}function Ee(t,e,n){if(t.path){let r=e.appendChild(document.createElement("a"));r.href=Le+t.path,n&&(r.className=n),location.href===r.href&&r.classList.add("current"),t.kind&&(r.innerHTML=``),r.appendChild(document.createElement("span")).textContent=t.text}else e.appendChild(document.createElement("span")).textContent=t.text}G(X,"a[data-toggle]");G(Z,".tsd-index-accordion");G(Y,".tsd-filter-item input[type=checkbox]");var Se=document.getElementById("tsd-theme");Se&&ge(Se);var je=new U;Object.defineProperty(window,"app",{value:je});he();be();})(); /*! Bundled license information: lunr/lunr.js: diff --git a/docs/assets/navigation.js b/docs/assets/navigation.js new file mode 100644 index 000000000..9b1c470d9 --- /dev/null +++ b/docs/assets/navigation.js @@ -0,0 +1 @@ +window.navigationData = "data:application/octet-stream;base64,H4sIAAAAAAAAA52VyW7CMBCG3yVnukBFF24tRWpEF0SkXqoe3GRoLLJYtkHQqu9eh9IkduxJ4JiZfz79nhk7b9+ehI30Rt4dETDhPOdez2NExioUJkQIEGdl6jSWaaLyS5pF3qg/uP7plfVjymLgwYpKaBJqSYxxDyFhDhNVDidwuoYpbGeEcifJ1OBEofQkoV+u9pgKjDbJ3Cescihhw3IuXYgqiTEe2NJ1mDKF1fvZWh03mhFOUgenIcF4TyAE+YRHmlI5BxLGEDmwLiVGf85lsGJFY5zYhgTjvTDIHJwyhdUHQBJHfZnC6/F9DDpv42sxIiJp7jqPIcBYt0AitcF8ywr5OM928ZJI1TdfkFBBrUodPRheGmj/v96JLBUYqvYQ7VZTWHENVUdkMb45CJZnwu7TocXw3Xp6UD+n0QJvZ12AgiBtAdUEGGjGIYgJh0i9ylZQXYCB5hBSRiGT+zYgQ7ZLMXgAWQQcG4Om6IxCTFp0bTel4sgt298No+b85qo/HPT+rrkSRsC4+r2qx88zr50V59uB+oqZhSp0lI1iGRsudsFWE5A26iA9zoRa5KaJIthmwlwzE2Lm23j6iNdEvfUfyX4uJ329+uLgGes830J0DbmqVOHDjRhT1mhtNupjrhVCeoQNfc4azWrj/RcKzOKTQgsAAA==" \ No newline at end of file diff --git a/docs/assets/search.js b/docs/assets/search.js index 0ac16cb80..2e9a1bb7d 100644 --- a/docs/assets/search.js +++ b/docs/assets/search.js @@ -1 +1 @@ -window.searchData = JSON.parse("{\"rows\":[{\"kind\":256,\"name\":\"AeadEncryptionContext\",\"url\":\"interfaces/AeadEncryptionContext.html\",\"classes\":\"\"},{\"kind\":2048,\"name\":\"seal\",\"url\":\"interfaces/AeadEncryptionContext.html#seal\",\"classes\":\"\",\"parent\":\"AeadEncryptionContext\"},{\"kind\":2048,\"name\":\"open\",\"url\":\"interfaces/AeadEncryptionContext.html#open\",\"classes\":\"\",\"parent\":\"AeadEncryptionContext\"},{\"kind\":256,\"name\":\"AeadInterface\",\"url\":\"interfaces/AeadInterface.html\",\"classes\":\"\"},{\"kind\":1024,\"name\":\"id\",\"url\":\"interfaces/AeadInterface.html#id\",\"classes\":\"\",\"parent\":\"AeadInterface\"},{\"kind\":1024,\"name\":\"keySize\",\"url\":\"interfaces/AeadInterface.html#keySize\",\"classes\":\"\",\"parent\":\"AeadInterface\"},{\"kind\":1024,\"name\":\"nonceSize\",\"url\":\"interfaces/AeadInterface.html#nonceSize\",\"classes\":\"\",\"parent\":\"AeadInterface\"},{\"kind\":1024,\"name\":\"tagSize\",\"url\":\"interfaces/AeadInterface.html#tagSize\",\"classes\":\"\",\"parent\":\"AeadInterface\"},{\"kind\":2048,\"name\":\"createEncryptionContext\",\"url\":\"interfaces/AeadInterface.html#createEncryptionContext\",\"classes\":\"\",\"parent\":\"AeadInterface\"},{\"kind\":256,\"name\":\"CipherSuiteParams\",\"url\":\"interfaces/CipherSuiteParams.html\",\"classes\":\"\"},{\"kind\":1024,\"name\":\"kem\",\"url\":\"interfaces/CipherSuiteParams.html#kem\",\"classes\":\"\",\"parent\":\"CipherSuiteParams\"},{\"kind\":1024,\"name\":\"kdf\",\"url\":\"interfaces/CipherSuiteParams.html#kdf\",\"classes\":\"\",\"parent\":\"CipherSuiteParams\"},{\"kind\":1024,\"name\":\"aead\",\"url\":\"interfaces/CipherSuiteParams.html#aead\",\"classes\":\"\",\"parent\":\"CipherSuiteParams\"},{\"kind\":256,\"name\":\"EncryptionContext\",\"url\":\"interfaces/EncryptionContext.html\",\"classes\":\"\"},{\"kind\":2048,\"name\":\"seal\",\"url\":\"interfaces/EncryptionContext.html#seal\",\"classes\":\"\",\"parent\":\"EncryptionContext\"},{\"kind\":2048,\"name\":\"open\",\"url\":\"interfaces/EncryptionContext.html#open\",\"classes\":\"\",\"parent\":\"EncryptionContext\"},{\"kind\":2048,\"name\":\"export\",\"url\":\"interfaces/EncryptionContext.html#export\",\"classes\":\"tsd-is-inherited\",\"parent\":\"EncryptionContext\"},{\"kind\":2097152,\"name\":\"RecipientContext\",\"url\":\"types/RecipientContext.html\",\"classes\":\"\"},{\"kind\":256,\"name\":\"SenderContext\",\"url\":\"interfaces/SenderContext.html\",\"classes\":\"\"},{\"kind\":1024,\"name\":\"enc\",\"url\":\"interfaces/SenderContext.html#enc\",\"classes\":\"\",\"parent\":\"SenderContext\"},{\"kind\":2048,\"name\":\"seal\",\"url\":\"interfaces/SenderContext.html#seal\",\"classes\":\"tsd-is-inherited\",\"parent\":\"SenderContext\"},{\"kind\":2048,\"name\":\"open\",\"url\":\"interfaces/SenderContext.html#open\",\"classes\":\"tsd-is-inherited\",\"parent\":\"SenderContext\"},{\"kind\":2048,\"name\":\"export\",\"url\":\"interfaces/SenderContext.html#export\",\"classes\":\"tsd-is-inherited\",\"parent\":\"SenderContext\"},{\"kind\":256,\"name\":\"KdfInterface\",\"url\":\"interfaces/KdfInterface.html\",\"classes\":\"\"},{\"kind\":1024,\"name\":\"id\",\"url\":\"interfaces/KdfInterface.html#id\",\"classes\":\"\",\"parent\":\"KdfInterface\"},{\"kind\":1024,\"name\":\"hashSize\",\"url\":\"interfaces/KdfInterface.html#hashSize\",\"classes\":\"\",\"parent\":\"KdfInterface\"},{\"kind\":2048,\"name\":\"init\",\"url\":\"interfaces/KdfInterface.html#init\",\"classes\":\"\",\"parent\":\"KdfInterface\"},{\"kind\":2048,\"name\":\"buildLabeledIkm\",\"url\":\"interfaces/KdfInterface.html#buildLabeledIkm\",\"classes\":\"\",\"parent\":\"KdfInterface\"},{\"kind\":2048,\"name\":\"buildLabeledInfo\",\"url\":\"interfaces/KdfInterface.html#buildLabeledInfo\",\"classes\":\"\",\"parent\":\"KdfInterface\"},{\"kind\":2048,\"name\":\"extract\",\"url\":\"interfaces/KdfInterface.html#extract\",\"classes\":\"\",\"parent\":\"KdfInterface\"},{\"kind\":2048,\"name\":\"expand\",\"url\":\"interfaces/KdfInterface.html#expand\",\"classes\":\"\",\"parent\":\"KdfInterface\"},{\"kind\":2048,\"name\":\"extractAndExpand\",\"url\":\"interfaces/KdfInterface.html#extractAndExpand\",\"classes\":\"\",\"parent\":\"KdfInterface\"},{\"kind\":2048,\"name\":\"labeledExtract\",\"url\":\"interfaces/KdfInterface.html#labeledExtract\",\"classes\":\"\",\"parent\":\"KdfInterface\"},{\"kind\":2048,\"name\":\"labeledExpand\",\"url\":\"interfaces/KdfInterface.html#labeledExpand\",\"classes\":\"\",\"parent\":\"KdfInterface\"},{\"kind\":256,\"name\":\"KemInterface\",\"url\":\"interfaces/KemInterface.html\",\"classes\":\"\"},{\"kind\":1024,\"name\":\"id\",\"url\":\"interfaces/KemInterface.html#id\",\"classes\":\"\",\"parent\":\"KemInterface\"},{\"kind\":1024,\"name\":\"secretSize\",\"url\":\"interfaces/KemInterface.html#secretSize\",\"classes\":\"\",\"parent\":\"KemInterface\"},{\"kind\":1024,\"name\":\"encSize\",\"url\":\"interfaces/KemInterface.html#encSize\",\"classes\":\"\",\"parent\":\"KemInterface\"},{\"kind\":1024,\"name\":\"publicKeySize\",\"url\":\"interfaces/KemInterface.html#publicKeySize\",\"classes\":\"\",\"parent\":\"KemInterface\"},{\"kind\":1024,\"name\":\"privateKeySize\",\"url\":\"interfaces/KemInterface.html#privateKeySize\",\"classes\":\"\",\"parent\":\"KemInterface\"},{\"kind\":2048,\"name\":\"serializePublicKey\",\"url\":\"interfaces/KemInterface.html#serializePublicKey\",\"classes\":\"\",\"parent\":\"KemInterface\"},{\"kind\":2048,\"name\":\"deserializePublicKey\",\"url\":\"interfaces/KemInterface.html#deserializePublicKey\",\"classes\":\"\",\"parent\":\"KemInterface\"},{\"kind\":2048,\"name\":\"serializePrivateKey\",\"url\":\"interfaces/KemInterface.html#serializePrivateKey\",\"classes\":\"\",\"parent\":\"KemInterface\"},{\"kind\":2048,\"name\":\"deserializePrivateKey\",\"url\":\"interfaces/KemInterface.html#deserializePrivateKey\",\"classes\":\"\",\"parent\":\"KemInterface\"},{\"kind\":2048,\"name\":\"importKey\",\"url\":\"interfaces/KemInterface.html#importKey\",\"classes\":\"\",\"parent\":\"KemInterface\"},{\"kind\":2048,\"name\":\"generateKeyPair\",\"url\":\"interfaces/KemInterface.html#generateKeyPair\",\"classes\":\"\",\"parent\":\"KemInterface\"},{\"kind\":2048,\"name\":\"deriveKeyPair\",\"url\":\"interfaces/KemInterface.html#deriveKeyPair\",\"classes\":\"\",\"parent\":\"KemInterface\"},{\"kind\":2048,\"name\":\"encap\",\"url\":\"interfaces/KemInterface.html#encap\",\"classes\":\"\",\"parent\":\"KemInterface\"},{\"kind\":2048,\"name\":\"decap\",\"url\":\"interfaces/KemInterface.html#decap\",\"classes\":\"\",\"parent\":\"KemInterface\"},{\"kind\":256,\"name\":\"PreSharedKey\",\"url\":\"interfaces/PreSharedKey.html\",\"classes\":\"\"},{\"kind\":1024,\"name\":\"id\",\"url\":\"interfaces/PreSharedKey.html#id\",\"classes\":\"\",\"parent\":\"PreSharedKey\"},{\"kind\":1024,\"name\":\"key\",\"url\":\"interfaces/PreSharedKey.html#key\",\"classes\":\"\",\"parent\":\"PreSharedKey\"},{\"kind\":256,\"name\":\"RecipientContextParams\",\"url\":\"interfaces/RecipientContextParams.html\",\"classes\":\"\"},{\"kind\":1024,\"name\":\"recipientKey\",\"url\":\"interfaces/RecipientContextParams.html#recipientKey\",\"classes\":\"\",\"parent\":\"RecipientContextParams\"},{\"kind\":1024,\"name\":\"enc\",\"url\":\"interfaces/RecipientContextParams.html#enc\",\"classes\":\"\",\"parent\":\"RecipientContextParams\"},{\"kind\":1024,\"name\":\"senderPublicKey\",\"url\":\"interfaces/RecipientContextParams.html#senderPublicKey\",\"classes\":\"\",\"parent\":\"RecipientContextParams\"},{\"kind\":1024,\"name\":\"info\",\"url\":\"interfaces/RecipientContextParams.html#info\",\"classes\":\"tsd-is-inherited\",\"parent\":\"RecipientContextParams\"},{\"kind\":1024,\"name\":\"psk\",\"url\":\"interfaces/RecipientContextParams.html#psk\",\"classes\":\"tsd-is-inherited\",\"parent\":\"RecipientContextParams\"},{\"kind\":256,\"name\":\"CipherSuiteSealResponse\",\"url\":\"interfaces/CipherSuiteSealResponse.html\",\"classes\":\"\"},{\"kind\":1024,\"name\":\"ct\",\"url\":\"interfaces/CipherSuiteSealResponse.html#ct\",\"classes\":\"\",\"parent\":\"CipherSuiteSealResponse\"},{\"kind\":1024,\"name\":\"enc\",\"url\":\"interfaces/CipherSuiteSealResponse.html#enc\",\"classes\":\"\",\"parent\":\"CipherSuiteSealResponse\"},{\"kind\":256,\"name\":\"SenderContextParams\",\"url\":\"interfaces/SenderContextParams.html\",\"classes\":\"\"},{\"kind\":1024,\"name\":\"recipientPublicKey\",\"url\":\"interfaces/SenderContextParams.html#recipientPublicKey\",\"classes\":\"\",\"parent\":\"SenderContextParams\"},{\"kind\":1024,\"name\":\"senderKey\",\"url\":\"interfaces/SenderContextParams.html#senderKey\",\"classes\":\"\",\"parent\":\"SenderContextParams\"},{\"kind\":1024,\"name\":\"ekm\",\"url\":\"interfaces/SenderContextParams.html#ekm\",\"classes\":\"\",\"parent\":\"SenderContextParams\"},{\"kind\":1024,\"name\":\"info\",\"url\":\"interfaces/SenderContextParams.html#info\",\"classes\":\"tsd-is-inherited\",\"parent\":\"SenderContextParams\"},{\"kind\":1024,\"name\":\"psk\",\"url\":\"interfaces/SenderContextParams.html#psk\",\"classes\":\"tsd-is-inherited\",\"parent\":\"SenderContextParams\"},{\"kind\":128,\"name\":\"CipherSuite\",\"url\":\"classes/CipherSuite.html\",\"classes\":\"\"},{\"kind\":512,\"name\":\"constructor\",\"url\":\"classes/CipherSuite.html#constructor\",\"classes\":\"\",\"parent\":\"CipherSuite\"},{\"kind\":2048,\"name\":\"generateKeyPair\",\"url\":\"classes/CipherSuite.html#generateKeyPair\",\"classes\":\"\",\"parent\":\"CipherSuite\"},{\"kind\":2048,\"name\":\"deriveKeyPair\",\"url\":\"classes/CipherSuite.html#deriveKeyPair\",\"classes\":\"\",\"parent\":\"CipherSuite\"},{\"kind\":2048,\"name\":\"importKey\",\"url\":\"classes/CipherSuite.html#importKey\",\"classes\":\"\",\"parent\":\"CipherSuite\"},{\"kind\":1024,\"name\":\"_kem\",\"url\":\"classes/CipherSuite.html#_kem\",\"classes\":\"tsd-is-protected tsd-is-inherited\",\"parent\":\"CipherSuite\"},{\"kind\":262144,\"name\":\"kem\",\"url\":\"classes/CipherSuite.html#kem\",\"classes\":\"tsd-is-inherited\",\"parent\":\"CipherSuite\"},{\"kind\":262144,\"name\":\"kdf\",\"url\":\"classes/CipherSuite.html#kdf\",\"classes\":\"tsd-is-inherited\",\"parent\":\"CipherSuite\"},{\"kind\":262144,\"name\":\"aead\",\"url\":\"classes/CipherSuite.html#aead\",\"classes\":\"tsd-is-inherited\",\"parent\":\"CipherSuite\"},{\"kind\":2048,\"name\":\"createSenderContext\",\"url\":\"classes/CipherSuite.html#createSenderContext\",\"classes\":\"tsd-is-inherited\",\"parent\":\"CipherSuite\"},{\"kind\":2048,\"name\":\"createRecipientContext\",\"url\":\"classes/CipherSuite.html#createRecipientContext\",\"classes\":\"tsd-is-inherited\",\"parent\":\"CipherSuite\"},{\"kind\":2048,\"name\":\"seal\",\"url\":\"classes/CipherSuite.html#seal\",\"classes\":\"tsd-is-inherited\",\"parent\":\"CipherSuite\"},{\"kind\":2048,\"name\":\"open\",\"url\":\"classes/CipherSuite.html#open\",\"classes\":\"tsd-is-inherited\",\"parent\":\"CipherSuite\"},{\"kind\":1024,\"name\":\"_api\",\"url\":\"classes/CipherSuite.html#_api\",\"classes\":\"tsd-is-protected tsd-is-inherited\",\"parent\":\"CipherSuite\"},{\"kind\":2048,\"name\":\"_setup\",\"url\":\"classes/CipherSuite.html#_setup\",\"classes\":\"tsd-is-protected tsd-is-inherited\",\"parent\":\"CipherSuite\"},{\"kind\":32,\"name\":\"Aead\",\"url\":\"variables/Aead-1.html\",\"classes\":\"\"},{\"kind\":65536,\"name\":\"__type\",\"url\":\"variables/Aead-1.html#__type\",\"classes\":\"\",\"parent\":\"Aead\"},{\"kind\":1024,\"name\":\"Aes128Gcm\",\"url\":\"variables/Aead-1.html#__type.Aes128Gcm\",\"classes\":\"\",\"parent\":\"Aead.__type\"},{\"kind\":1024,\"name\":\"Aes256Gcm\",\"url\":\"variables/Aead-1.html#__type.Aes256Gcm\",\"classes\":\"\",\"parent\":\"Aead.__type\"},{\"kind\":1024,\"name\":\"Chacha20Poly1305\",\"url\":\"variables/Aead-1.html#__type.Chacha20Poly1305\",\"classes\":\"\",\"parent\":\"Aead.__type\"},{\"kind\":1024,\"name\":\"ExportOnly\",\"url\":\"variables/Aead-1.html#__type.ExportOnly\",\"classes\":\"\",\"parent\":\"Aead.__type\"},{\"kind\":2097152,\"name\":\"Aead\",\"url\":\"types/Aead.html\",\"classes\":\"\"},{\"kind\":32,\"name\":\"AeadId\",\"url\":\"variables/AeadId-1.html\",\"classes\":\"\"},{\"kind\":65536,\"name\":\"__type\",\"url\":\"variables/AeadId-1.html#__type\",\"classes\":\"\",\"parent\":\"AeadId\"},{\"kind\":1024,\"name\":\"Aes128Gcm\",\"url\":\"variables/AeadId-1.html#__type.Aes128Gcm\",\"classes\":\"\",\"parent\":\"AeadId.__type\"},{\"kind\":1024,\"name\":\"Aes256Gcm\",\"url\":\"variables/AeadId-1.html#__type.Aes256Gcm\",\"classes\":\"\",\"parent\":\"AeadId.__type\"},{\"kind\":1024,\"name\":\"Chacha20Poly1305\",\"url\":\"variables/AeadId-1.html#__type.Chacha20Poly1305\",\"classes\":\"\",\"parent\":\"AeadId.__type\"},{\"kind\":1024,\"name\":\"ExportOnly\",\"url\":\"variables/AeadId-1.html#__type.ExportOnly\",\"classes\":\"\",\"parent\":\"AeadId.__type\"},{\"kind\":2097152,\"name\":\"AeadId\",\"url\":\"types/AeadId.html\",\"classes\":\"\"},{\"kind\":32,\"name\":\"Kdf\",\"url\":\"variables/Kdf-1.html\",\"classes\":\"\"},{\"kind\":65536,\"name\":\"__type\",\"url\":\"variables/Kdf-1.html#__type\",\"classes\":\"\",\"parent\":\"Kdf\"},{\"kind\":1024,\"name\":\"HkdfSha256\",\"url\":\"variables/Kdf-1.html#__type.HkdfSha256\",\"classes\":\"\",\"parent\":\"Kdf.__type\"},{\"kind\":1024,\"name\":\"HkdfSha384\",\"url\":\"variables/Kdf-1.html#__type.HkdfSha384\",\"classes\":\"\",\"parent\":\"Kdf.__type\"},{\"kind\":1024,\"name\":\"HkdfSha512\",\"url\":\"variables/Kdf-1.html#__type.HkdfSha512\",\"classes\":\"\",\"parent\":\"Kdf.__type\"},{\"kind\":2097152,\"name\":\"Kdf\",\"url\":\"types/Kdf.html\",\"classes\":\"\"},{\"kind\":32,\"name\":\"KdfId\",\"url\":\"variables/KdfId-1.html\",\"classes\":\"\"},{\"kind\":65536,\"name\":\"__type\",\"url\":\"variables/KdfId-1.html#__type\",\"classes\":\"\",\"parent\":\"KdfId\"},{\"kind\":1024,\"name\":\"HkdfSha256\",\"url\":\"variables/KdfId-1.html#__type.HkdfSha256\",\"classes\":\"\",\"parent\":\"KdfId.__type\"},{\"kind\":1024,\"name\":\"HkdfSha384\",\"url\":\"variables/KdfId-1.html#__type.HkdfSha384\",\"classes\":\"\",\"parent\":\"KdfId.__type\"},{\"kind\":1024,\"name\":\"HkdfSha512\",\"url\":\"variables/KdfId-1.html#__type.HkdfSha512\",\"classes\":\"\",\"parent\":\"KdfId.__type\"},{\"kind\":2097152,\"name\":\"KdfId\",\"url\":\"types/KdfId.html\",\"classes\":\"\"},{\"kind\":32,\"name\":\"Kem\",\"url\":\"variables/Kem-1.html\",\"classes\":\"\"},{\"kind\":65536,\"name\":\"__type\",\"url\":\"variables/Kem-1.html#__type\",\"classes\":\"\",\"parent\":\"Kem\"},{\"kind\":1024,\"name\":\"NotAssigned\",\"url\":\"variables/Kem-1.html#__type.NotAssigned\",\"classes\":\"\",\"parent\":\"Kem.__type\"},{\"kind\":1024,\"name\":\"DhkemP256HkdfSha256\",\"url\":\"variables/Kem-1.html#__type.DhkemP256HkdfSha256\",\"classes\":\"\",\"parent\":\"Kem.__type\"},{\"kind\":1024,\"name\":\"DhkemP384HkdfSha384\",\"url\":\"variables/Kem-1.html#__type.DhkemP384HkdfSha384\",\"classes\":\"\",\"parent\":\"Kem.__type\"},{\"kind\":1024,\"name\":\"DhkemP521HkdfSha512\",\"url\":\"variables/Kem-1.html#__type.DhkemP521HkdfSha512\",\"classes\":\"\",\"parent\":\"Kem.__type\"},{\"kind\":1024,\"name\":\"DhkemSecp256k1HkdfSha256\",\"url\":\"variables/Kem-1.html#__type.DhkemSecp256k1HkdfSha256\",\"classes\":\"\",\"parent\":\"Kem.__type\"},{\"kind\":1024,\"name\":\"DhkemX25519HkdfSha256\",\"url\":\"variables/Kem-1.html#__type.DhkemX25519HkdfSha256\",\"classes\":\"\",\"parent\":\"Kem.__type\"},{\"kind\":1024,\"name\":\"DhkemX448HkdfSha512\",\"url\":\"variables/Kem-1.html#__type.DhkemX448HkdfSha512\",\"classes\":\"\",\"parent\":\"Kem.__type\"},{\"kind\":1024,\"name\":\"HybridkemX25519Kyber768\",\"url\":\"variables/Kem-1.html#__type.HybridkemX25519Kyber768\",\"classes\":\"\",\"parent\":\"Kem.__type\"},{\"kind\":2097152,\"name\":\"Kem\",\"url\":\"types/Kem.html\",\"classes\":\"\"},{\"kind\":32,\"name\":\"KemId\",\"url\":\"variables/KemId-1.html\",\"classes\":\"\"},{\"kind\":65536,\"name\":\"__type\",\"url\":\"variables/KemId-1.html#__type\",\"classes\":\"\",\"parent\":\"KemId\"},{\"kind\":1024,\"name\":\"NotAssigned\",\"url\":\"variables/KemId-1.html#__type.NotAssigned\",\"classes\":\"\",\"parent\":\"KemId.__type\"},{\"kind\":1024,\"name\":\"DhkemP256HkdfSha256\",\"url\":\"variables/KemId-1.html#__type.DhkemP256HkdfSha256\",\"classes\":\"\",\"parent\":\"KemId.__type\"},{\"kind\":1024,\"name\":\"DhkemP384HkdfSha384\",\"url\":\"variables/KemId-1.html#__type.DhkemP384HkdfSha384\",\"classes\":\"\",\"parent\":\"KemId.__type\"},{\"kind\":1024,\"name\":\"DhkemP521HkdfSha512\",\"url\":\"variables/KemId-1.html#__type.DhkemP521HkdfSha512\",\"classes\":\"\",\"parent\":\"KemId.__type\"},{\"kind\":1024,\"name\":\"DhkemSecp256k1HkdfSha256\",\"url\":\"variables/KemId-1.html#__type.DhkemSecp256k1HkdfSha256\",\"classes\":\"\",\"parent\":\"KemId.__type\"},{\"kind\":1024,\"name\":\"DhkemX25519HkdfSha256\",\"url\":\"variables/KemId-1.html#__type.DhkemX25519HkdfSha256\",\"classes\":\"\",\"parent\":\"KemId.__type\"},{\"kind\":1024,\"name\":\"DhkemX448HkdfSha512\",\"url\":\"variables/KemId-1.html#__type.DhkemX448HkdfSha512\",\"classes\":\"\",\"parent\":\"KemId.__type\"},{\"kind\":1024,\"name\":\"HybridkemX25519Kyber768\",\"url\":\"variables/KemId-1.html#__type.HybridkemX25519Kyber768\",\"classes\":\"\",\"parent\":\"KemId.__type\"},{\"kind\":2097152,\"name\":\"KemId\",\"url\":\"types/KemId.html\",\"classes\":\"\"},{\"kind\":128,\"name\":\"BaseError\",\"url\":\"classes/BaseError.html\",\"classes\":\"\"},{\"kind\":512,\"name\":\"constructor\",\"url\":\"classes/BaseError.html#constructor\",\"classes\":\"\",\"parent\":\"BaseError\"},{\"kind\":128,\"name\":\"HpkeError\",\"url\":\"classes/HpkeError.html\",\"classes\":\"\"},{\"kind\":512,\"name\":\"constructor\",\"url\":\"classes/HpkeError.html#constructor\",\"classes\":\"tsd-is-inherited\",\"parent\":\"HpkeError\"},{\"kind\":128,\"name\":\"InvalidParamError\",\"url\":\"classes/InvalidParamError.html\",\"classes\":\"\"},{\"kind\":512,\"name\":\"constructor\",\"url\":\"classes/InvalidParamError.html#constructor\",\"classes\":\"tsd-is-inherited\",\"parent\":\"InvalidParamError\"},{\"kind\":128,\"name\":\"ValidationError\",\"url\":\"classes/ValidationError.html\",\"classes\":\"\"},{\"kind\":512,\"name\":\"constructor\",\"url\":\"classes/ValidationError.html#constructor\",\"classes\":\"tsd-is-inherited\",\"parent\":\"ValidationError\"},{\"kind\":128,\"name\":\"SerializeError\",\"url\":\"classes/SerializeError.html\",\"classes\":\"\"},{\"kind\":512,\"name\":\"constructor\",\"url\":\"classes/SerializeError.html#constructor\",\"classes\":\"tsd-is-inherited\",\"parent\":\"SerializeError\"},{\"kind\":128,\"name\":\"DeserializeError\",\"url\":\"classes/DeserializeError.html\",\"classes\":\"\"},{\"kind\":512,\"name\":\"constructor\",\"url\":\"classes/DeserializeError.html#constructor\",\"classes\":\"tsd-is-inherited\",\"parent\":\"DeserializeError\"},{\"kind\":128,\"name\":\"EncapError\",\"url\":\"classes/EncapError.html\",\"classes\":\"\"},{\"kind\":512,\"name\":\"constructor\",\"url\":\"classes/EncapError.html#constructor\",\"classes\":\"tsd-is-inherited\",\"parent\":\"EncapError\"},{\"kind\":128,\"name\":\"DecapError\",\"url\":\"classes/DecapError.html\",\"classes\":\"\"},{\"kind\":512,\"name\":\"constructor\",\"url\":\"classes/DecapError.html#constructor\",\"classes\":\"tsd-is-inherited\",\"parent\":\"DecapError\"},{\"kind\":128,\"name\":\"ExportError\",\"url\":\"classes/ExportError.html\",\"classes\":\"\"},{\"kind\":512,\"name\":\"constructor\",\"url\":\"classes/ExportError.html#constructor\",\"classes\":\"tsd-is-inherited\",\"parent\":\"ExportError\"},{\"kind\":128,\"name\":\"SealError\",\"url\":\"classes/SealError.html\",\"classes\":\"\"},{\"kind\":512,\"name\":\"constructor\",\"url\":\"classes/SealError.html#constructor\",\"classes\":\"tsd-is-inherited\",\"parent\":\"SealError\"},{\"kind\":128,\"name\":\"OpenError\",\"url\":\"classes/OpenError.html\",\"classes\":\"\"},{\"kind\":512,\"name\":\"constructor\",\"url\":\"classes/OpenError.html#constructor\",\"classes\":\"tsd-is-inherited\",\"parent\":\"OpenError\"},{\"kind\":128,\"name\":\"MessageLimitReachedError\",\"url\":\"classes/MessageLimitReachedError.html\",\"classes\":\"\"},{\"kind\":512,\"name\":\"constructor\",\"url\":\"classes/MessageLimitReachedError.html#constructor\",\"classes\":\"tsd-is-inherited\",\"parent\":\"MessageLimitReachedError\"},{\"kind\":128,\"name\":\"DeriveKeyPairError\",\"url\":\"classes/DeriveKeyPairError.html\",\"classes\":\"\"},{\"kind\":512,\"name\":\"constructor\",\"url\":\"classes/DeriveKeyPairError.html#constructor\",\"classes\":\"tsd-is-inherited\",\"parent\":\"DeriveKeyPairError\"},{\"kind\":128,\"name\":\"NotSupportedError\",\"url\":\"classes/NotSupportedError.html\",\"classes\":\"\"},{\"kind\":512,\"name\":\"constructor\",\"url\":\"classes/NotSupportedError.html#constructor\",\"classes\":\"tsd-is-inherited\",\"parent\":\"NotSupportedError\"}],\"index\":{\"version\":\"2.3.9\",\"fields\":[\"name\",\"comment\"],\"fieldVectors\":[[\"name/0\",[0,46.634]],[\"comment/0\",[]],[\"name/1\",[1,35.648]],[\"comment/1\",[]],[\"name/2\",[2,35.648]],[\"comment/2\",[]],[\"name/3\",[3,46.634]],[\"comment/3\",[]],[\"name/4\",[4,35.648]],[\"comment/4\",[]],[\"name/5\",[5,46.634]],[\"comment/5\",[]],[\"name/6\",[6,46.634]],[\"comment/6\",[]],[\"name/7\",[7,46.634]],[\"comment/7\",[]],[\"name/8\",[8,46.634]],[\"comment/8\",[]],[\"name/9\",[9,46.634]],[\"comment/9\",[]],[\"name/10\",[10,35.648]],[\"comment/10\",[]],[\"name/11\",[11,35.648]],[\"comment/11\",[]],[\"name/12\",[12,35.648]],[\"comment/12\",[]],[\"name/13\",[13,46.634]],[\"comment/13\",[]],[\"name/14\",[1,35.648]],[\"comment/14\",[]],[\"name/15\",[2,35.648]],[\"comment/15\",[]],[\"name/16\",[14,41.526]],[\"comment/16\",[]],[\"name/17\",[15,46.634]],[\"comment/17\",[]],[\"name/18\",[16,46.634]],[\"comment/18\",[]],[\"name/19\",[17,38.161]],[\"comment/19\",[]],[\"name/20\",[1,35.648]],[\"comment/20\",[]],[\"name/21\",[2,35.648]],[\"comment/21\",[]],[\"name/22\",[14,41.526]],[\"comment/22\",[]],[\"name/23\",[18,46.634]],[\"comment/23\",[]],[\"name/24\",[4,35.648]],[\"comment/24\",[]],[\"name/25\",[19,46.634]],[\"comment/25\",[]],[\"name/26\",[20,46.634]],[\"comment/26\",[]],[\"name/27\",[21,46.634]],[\"comment/27\",[]],[\"name/28\",[22,46.634]],[\"comment/28\",[]],[\"name/29\",[23,46.634]],[\"comment/29\",[]],[\"name/30\",[24,46.634]],[\"comment/30\",[]],[\"name/31\",[25,46.634]],[\"comment/31\",[]],[\"name/32\",[26,46.634]],[\"comment/32\",[]],[\"name/33\",[27,46.634]],[\"comment/33\",[]],[\"name/34\",[28,46.634]],[\"comment/34\",[]],[\"name/35\",[4,35.648]],[\"comment/35\",[]],[\"name/36\",[29,46.634]],[\"comment/36\",[]],[\"name/37\",[30,46.634]],[\"comment/37\",[]],[\"name/38\",[31,46.634]],[\"comment/38\",[]],[\"name/39\",[32,46.634]],[\"comment/39\",[]],[\"name/40\",[33,46.634]],[\"comment/40\",[]],[\"name/41\",[34,46.634]],[\"comment/41\",[]],[\"name/42\",[35,46.634]],[\"comment/42\",[]],[\"name/43\",[36,46.634]],[\"comment/43\",[]],[\"name/44\",[37,41.526]],[\"comment/44\",[]],[\"name/45\",[38,41.526]],[\"comment/45\",[]],[\"name/46\",[39,41.526]],[\"comment/46\",[]],[\"name/47\",[40,46.634]],[\"comment/47\",[]],[\"name/48\",[41,46.634]],[\"comment/48\",[]],[\"name/49\",[42,46.634]],[\"comment/49\",[]],[\"name/50\",[4,35.648]],[\"comment/50\",[]],[\"name/51\",[43,46.634]],[\"comment/51\",[]],[\"name/52\",[44,46.634]],[\"comment/52\",[]],[\"name/53\",[45,46.634]],[\"comment/53\",[]],[\"name/54\",[17,38.161]],[\"comment/54\",[]],[\"name/55\",[46,46.634]],[\"comment/55\",[]],[\"name/56\",[47,41.526]],[\"comment/56\",[]],[\"name/57\",[48,41.526]],[\"comment/57\",[]],[\"name/58\",[49,46.634]],[\"comment/58\",[]],[\"name/59\",[50,46.634]],[\"comment/59\",[]],[\"name/60\",[17,38.161]],[\"comment/60\",[]],[\"name/61\",[51,46.634]],[\"comment/61\",[]],[\"name/62\",[52,46.634]],[\"comment/62\",[]],[\"name/63\",[53,46.634]],[\"comment/63\",[]],[\"name/64\",[54,46.634]],[\"comment/64\",[]],[\"name/65\",[47,41.526]],[\"comment/65\",[]],[\"name/66\",[48,41.526]],[\"comment/66\",[]],[\"name/67\",[55,46.634]],[\"comment/67\",[]],[\"name/68\",[56,23.281]],[\"comment/68\",[]],[\"name/69\",[38,41.526]],[\"comment/69\",[]],[\"name/70\",[39,41.526]],[\"comment/70\",[]],[\"name/71\",[37,41.526]],[\"comment/71\",[]],[\"name/72\",[57,46.634]],[\"comment/72\",[]],[\"name/73\",[10,35.648]],[\"comment/73\",[]],[\"name/74\",[11,35.648]],[\"comment/74\",[]],[\"name/75\",[12,35.648]],[\"comment/75\",[]],[\"name/76\",[58,46.634]],[\"comment/76\",[]],[\"name/77\",[59,46.634]],[\"comment/77\",[]],[\"name/78\",[1,35.648]],[\"comment/78\",[]],[\"name/79\",[2,35.648]],[\"comment/79\",[]],[\"name/80\",[60,46.634]],[\"comment/80\",[]],[\"name/81\",[61,46.634]],[\"comment/81\",[]],[\"name/82\",[12,35.648]],[\"comment/82\",[]],[\"name/83\",[62,31.971]],[\"comment/83\",[]],[\"name/84\",[63,41.526]],[\"comment/84\",[]],[\"name/85\",[64,41.526]],[\"comment/85\",[]],[\"name/86\",[65,41.526]],[\"comment/86\",[]],[\"name/87\",[66,41.526]],[\"comment/87\",[]],[\"name/88\",[12,35.648]],[\"comment/88\",[]],[\"name/89\",[67,41.526]],[\"comment/89\",[]],[\"name/90\",[62,31.971]],[\"comment/90\",[]],[\"name/91\",[63,41.526]],[\"comment/91\",[]],[\"name/92\",[64,41.526]],[\"comment/92\",[]],[\"name/93\",[65,41.526]],[\"comment/93\",[]],[\"name/94\",[66,41.526]],[\"comment/94\",[]],[\"name/95\",[67,41.526]],[\"comment/95\",[]],[\"name/96\",[11,35.648]],[\"comment/96\",[]],[\"name/97\",[62,31.971]],[\"comment/97\",[]],[\"name/98\",[68,41.526]],[\"comment/98\",[]],[\"name/99\",[69,41.526]],[\"comment/99\",[]],[\"name/100\",[70,41.526]],[\"comment/100\",[]],[\"name/101\",[11,35.648]],[\"comment/101\",[]],[\"name/102\",[71,41.526]],[\"comment/102\",[]],[\"name/103\",[62,31.971]],[\"comment/103\",[]],[\"name/104\",[68,41.526]],[\"comment/104\",[]],[\"name/105\",[69,41.526]],[\"comment/105\",[]],[\"name/106\",[70,41.526]],[\"comment/106\",[]],[\"name/107\",[71,41.526]],[\"comment/107\",[]],[\"name/108\",[10,35.648]],[\"comment/108\",[]],[\"name/109\",[62,31.971]],[\"comment/109\",[]],[\"name/110\",[72,41.526]],[\"comment/110\",[]],[\"name/111\",[73,41.526]],[\"comment/111\",[]],[\"name/112\",[74,41.526]],[\"comment/112\",[]],[\"name/113\",[75,41.526]],[\"comment/113\",[]],[\"name/114\",[76,41.526]],[\"comment/114\",[]],[\"name/115\",[77,41.526]],[\"comment/115\",[]],[\"name/116\",[78,41.526]],[\"comment/116\",[]],[\"name/117\",[79,41.526]],[\"comment/117\",[]],[\"name/118\",[10,35.648]],[\"comment/118\",[]],[\"name/119\",[80,41.526]],[\"comment/119\",[]],[\"name/120\",[62,31.971]],[\"comment/120\",[]],[\"name/121\",[72,41.526]],[\"comment/121\",[]],[\"name/122\",[73,41.526]],[\"comment/122\",[]],[\"name/123\",[74,41.526]],[\"comment/123\",[]],[\"name/124\",[75,41.526]],[\"comment/124\",[]],[\"name/125\",[76,41.526]],[\"comment/125\",[]],[\"name/126\",[77,41.526]],[\"comment/126\",[]],[\"name/127\",[78,41.526]],[\"comment/127\",[]],[\"name/128\",[79,41.526]],[\"comment/128\",[]],[\"name/129\",[80,41.526]],[\"comment/129\",[]],[\"name/130\",[81,46.634]],[\"comment/130\",[]],[\"name/131\",[56,23.281]],[\"comment/131\",[]],[\"name/132\",[82,46.634]],[\"comment/132\",[]],[\"name/133\",[56,23.281]],[\"comment/133\",[]],[\"name/134\",[83,46.634]],[\"comment/134\",[]],[\"name/135\",[56,23.281]],[\"comment/135\",[]],[\"name/136\",[84,46.634]],[\"comment/136\",[]],[\"name/137\",[56,23.281]],[\"comment/137\",[]],[\"name/138\",[85,46.634]],[\"comment/138\",[]],[\"name/139\",[56,23.281]],[\"comment/139\",[]],[\"name/140\",[86,46.634]],[\"comment/140\",[]],[\"name/141\",[56,23.281]],[\"comment/141\",[]],[\"name/142\",[87,46.634]],[\"comment/142\",[]],[\"name/143\",[56,23.281]],[\"comment/143\",[]],[\"name/144\",[88,46.634]],[\"comment/144\",[]],[\"name/145\",[56,23.281]],[\"comment/145\",[]],[\"name/146\",[89,46.634]],[\"comment/146\",[]],[\"name/147\",[56,23.281]],[\"comment/147\",[]],[\"name/148\",[90,46.634]],[\"comment/148\",[]],[\"name/149\",[56,23.281]],[\"comment/149\",[]],[\"name/150\",[91,46.634]],[\"comment/150\",[]],[\"name/151\",[56,23.281]],[\"comment/151\",[]],[\"name/152\",[92,46.634]],[\"comment/152\",[]],[\"name/153\",[56,23.281]],[\"comment/153\",[]],[\"name/154\",[93,46.634]],[\"comment/154\",[]],[\"name/155\",[56,23.281]],[\"comment/155\",[]],[\"name/156\",[94,46.634]],[\"comment/156\",[]],[\"name/157\",[56,23.281]],[\"comment/157\",[]]],\"invertedIndex\":[[\"__type\",{\"_index\":62,\"name\":{\"83\":{},\"90\":{},\"97\":{},\"103\":{},\"109\":{},\"120\":{}},\"comment\":{}}],[\"_api\",{\"_index\":60,\"name\":{\"80\":{}},\"comment\":{}}],[\"_kem\",{\"_index\":57,\"name\":{\"72\":{}},\"comment\":{}}],[\"_setup\",{\"_index\":61,\"name\":{\"81\":{}},\"comment\":{}}],[\"aead\",{\"_index\":12,\"name\":{\"12\":{},\"75\":{},\"82\":{},\"88\":{}},\"comment\":{}}],[\"aeadencryptioncontext\",{\"_index\":0,\"name\":{\"0\":{}},\"comment\":{}}],[\"aeadid\",{\"_index\":67,\"name\":{\"89\":{},\"95\":{}},\"comment\":{}}],[\"aeadinterface\",{\"_index\":3,\"name\":{\"3\":{}},\"comment\":{}}],[\"aes128gcm\",{\"_index\":63,\"name\":{\"84\":{},\"91\":{}},\"comment\":{}}],[\"aes256gcm\",{\"_index\":64,\"name\":{\"85\":{},\"92\":{}},\"comment\":{}}],[\"baseerror\",{\"_index\":81,\"name\":{\"130\":{}},\"comment\":{}}],[\"buildlabeledikm\",{\"_index\":21,\"name\":{\"27\":{}},\"comment\":{}}],[\"buildlabeledinfo\",{\"_index\":22,\"name\":{\"28\":{}},\"comment\":{}}],[\"chacha20poly1305\",{\"_index\":65,\"name\":{\"86\":{},\"93\":{}},\"comment\":{}}],[\"ciphersuite\",{\"_index\":55,\"name\":{\"67\":{}},\"comment\":{}}],[\"ciphersuiteparams\",{\"_index\":9,\"name\":{\"9\":{}},\"comment\":{}}],[\"ciphersuitesealresponse\",{\"_index\":49,\"name\":{\"58\":{}},\"comment\":{}}],[\"constructor\",{\"_index\":56,\"name\":{\"68\":{},\"131\":{},\"133\":{},\"135\":{},\"137\":{},\"139\":{},\"141\":{},\"143\":{},\"145\":{},\"147\":{},\"149\":{},\"151\":{},\"153\":{},\"155\":{},\"157\":{}},\"comment\":{}}],[\"createencryptioncontext\",{\"_index\":8,\"name\":{\"8\":{}},\"comment\":{}}],[\"createrecipientcontext\",{\"_index\":59,\"name\":{\"77\":{}},\"comment\":{}}],[\"createsendercontext\",{\"_index\":58,\"name\":{\"76\":{}},\"comment\":{}}],[\"ct\",{\"_index\":50,\"name\":{\"59\":{}},\"comment\":{}}],[\"decap\",{\"_index\":41,\"name\":{\"48\":{}},\"comment\":{}}],[\"decaperror\",{\"_index\":88,\"name\":{\"144\":{}},\"comment\":{}}],[\"derivekeypair\",{\"_index\":39,\"name\":{\"46\":{},\"70\":{}},\"comment\":{}}],[\"derivekeypairerror\",{\"_index\":93,\"name\":{\"154\":{}},\"comment\":{}}],[\"deserializeerror\",{\"_index\":86,\"name\":{\"140\":{}},\"comment\":{}}],[\"deserializeprivatekey\",{\"_index\":36,\"name\":{\"43\":{}},\"comment\":{}}],[\"deserializepublickey\",{\"_index\":34,\"name\":{\"41\":{}},\"comment\":{}}],[\"dhkemp256hkdfsha256\",{\"_index\":73,\"name\":{\"111\":{},\"122\":{}},\"comment\":{}}],[\"dhkemp384hkdfsha384\",{\"_index\":74,\"name\":{\"112\":{},\"123\":{}},\"comment\":{}}],[\"dhkemp521hkdfsha512\",{\"_index\":75,\"name\":{\"113\":{},\"124\":{}},\"comment\":{}}],[\"dhkemsecp256k1hkdfsha256\",{\"_index\":76,\"name\":{\"114\":{},\"125\":{}},\"comment\":{}}],[\"dhkemx25519hkdfsha256\",{\"_index\":77,\"name\":{\"115\":{},\"126\":{}},\"comment\":{}}],[\"dhkemx448hkdfsha512\",{\"_index\":78,\"name\":{\"116\":{},\"127\":{}},\"comment\":{}}],[\"ekm\",{\"_index\":54,\"name\":{\"64\":{}},\"comment\":{}}],[\"enc\",{\"_index\":17,\"name\":{\"19\":{},\"54\":{},\"60\":{}},\"comment\":{}}],[\"encap\",{\"_index\":40,\"name\":{\"47\":{}},\"comment\":{}}],[\"encaperror\",{\"_index\":87,\"name\":{\"142\":{}},\"comment\":{}}],[\"encryptioncontext\",{\"_index\":13,\"name\":{\"13\":{}},\"comment\":{}}],[\"encsize\",{\"_index\":30,\"name\":{\"37\":{}},\"comment\":{}}],[\"expand\",{\"_index\":24,\"name\":{\"30\":{}},\"comment\":{}}],[\"export\",{\"_index\":14,\"name\":{\"16\":{},\"22\":{}},\"comment\":{}}],[\"exporterror\",{\"_index\":89,\"name\":{\"146\":{}},\"comment\":{}}],[\"exportonly\",{\"_index\":66,\"name\":{\"87\":{},\"94\":{}},\"comment\":{}}],[\"extract\",{\"_index\":23,\"name\":{\"29\":{}},\"comment\":{}}],[\"extractandexpand\",{\"_index\":25,\"name\":{\"31\":{}},\"comment\":{}}],[\"generatekeypair\",{\"_index\":38,\"name\":{\"45\":{},\"69\":{}},\"comment\":{}}],[\"hashsize\",{\"_index\":19,\"name\":{\"25\":{}},\"comment\":{}}],[\"hkdfsha256\",{\"_index\":68,\"name\":{\"98\":{},\"104\":{}},\"comment\":{}}],[\"hkdfsha384\",{\"_index\":69,\"name\":{\"99\":{},\"105\":{}},\"comment\":{}}],[\"hkdfsha512\",{\"_index\":70,\"name\":{\"100\":{},\"106\":{}},\"comment\":{}}],[\"hpkeerror\",{\"_index\":82,\"name\":{\"132\":{}},\"comment\":{}}],[\"hybridkemx25519kyber768\",{\"_index\":79,\"name\":{\"117\":{},\"128\":{}},\"comment\":{}}],[\"id\",{\"_index\":4,\"name\":{\"4\":{},\"24\":{},\"35\":{},\"50\":{}},\"comment\":{}}],[\"importkey\",{\"_index\":37,\"name\":{\"44\":{},\"71\":{}},\"comment\":{}}],[\"info\",{\"_index\":47,\"name\":{\"56\":{},\"65\":{}},\"comment\":{}}],[\"init\",{\"_index\":20,\"name\":{\"26\":{}},\"comment\":{}}],[\"invalidparamerror\",{\"_index\":83,\"name\":{\"134\":{}},\"comment\":{}}],[\"kdf\",{\"_index\":11,\"name\":{\"11\":{},\"74\":{},\"96\":{},\"101\":{}},\"comment\":{}}],[\"kdfid\",{\"_index\":71,\"name\":{\"102\":{},\"107\":{}},\"comment\":{}}],[\"kdfinterface\",{\"_index\":18,\"name\":{\"23\":{}},\"comment\":{}}],[\"kem\",{\"_index\":10,\"name\":{\"10\":{},\"73\":{},\"108\":{},\"118\":{}},\"comment\":{}}],[\"kemid\",{\"_index\":80,\"name\":{\"119\":{},\"129\":{}},\"comment\":{}}],[\"keminterface\",{\"_index\":28,\"name\":{\"34\":{}},\"comment\":{}}],[\"key\",{\"_index\":43,\"name\":{\"51\":{}},\"comment\":{}}],[\"keysize\",{\"_index\":5,\"name\":{\"5\":{}},\"comment\":{}}],[\"labeledexpand\",{\"_index\":27,\"name\":{\"33\":{}},\"comment\":{}}],[\"labeledextract\",{\"_index\":26,\"name\":{\"32\":{}},\"comment\":{}}],[\"messagelimitreachederror\",{\"_index\":92,\"name\":{\"152\":{}},\"comment\":{}}],[\"noncesize\",{\"_index\":6,\"name\":{\"6\":{}},\"comment\":{}}],[\"notassigned\",{\"_index\":72,\"name\":{\"110\":{},\"121\":{}},\"comment\":{}}],[\"notsupportederror\",{\"_index\":94,\"name\":{\"156\":{}},\"comment\":{}}],[\"open\",{\"_index\":2,\"name\":{\"2\":{},\"15\":{},\"21\":{},\"79\":{}},\"comment\":{}}],[\"openerror\",{\"_index\":91,\"name\":{\"150\":{}},\"comment\":{}}],[\"presharedkey\",{\"_index\":42,\"name\":{\"49\":{}},\"comment\":{}}],[\"privatekeysize\",{\"_index\":32,\"name\":{\"39\":{}},\"comment\":{}}],[\"psk\",{\"_index\":48,\"name\":{\"57\":{},\"66\":{}},\"comment\":{}}],[\"publickeysize\",{\"_index\":31,\"name\":{\"38\":{}},\"comment\":{}}],[\"recipientcontext\",{\"_index\":15,\"name\":{\"17\":{}},\"comment\":{}}],[\"recipientcontextparams\",{\"_index\":44,\"name\":{\"52\":{}},\"comment\":{}}],[\"recipientkey\",{\"_index\":45,\"name\":{\"53\":{}},\"comment\":{}}],[\"recipientpublickey\",{\"_index\":52,\"name\":{\"62\":{}},\"comment\":{}}],[\"seal\",{\"_index\":1,\"name\":{\"1\":{},\"14\":{},\"20\":{},\"78\":{}},\"comment\":{}}],[\"sealerror\",{\"_index\":90,\"name\":{\"148\":{}},\"comment\":{}}],[\"secretsize\",{\"_index\":29,\"name\":{\"36\":{}},\"comment\":{}}],[\"sendercontext\",{\"_index\":16,\"name\":{\"18\":{}},\"comment\":{}}],[\"sendercontextparams\",{\"_index\":51,\"name\":{\"61\":{}},\"comment\":{}}],[\"senderkey\",{\"_index\":53,\"name\":{\"63\":{}},\"comment\":{}}],[\"senderpublickey\",{\"_index\":46,\"name\":{\"55\":{}},\"comment\":{}}],[\"serializeerror\",{\"_index\":85,\"name\":{\"138\":{}},\"comment\":{}}],[\"serializeprivatekey\",{\"_index\":35,\"name\":{\"42\":{}},\"comment\":{}}],[\"serializepublickey\",{\"_index\":33,\"name\":{\"40\":{}},\"comment\":{}}],[\"tagsize\",{\"_index\":7,\"name\":{\"7\":{}},\"comment\":{}}],[\"validationerror\",{\"_index\":84,\"name\":{\"136\":{}},\"comment\":{}}]],\"pipeline\":[]}}"); \ No newline at end of file +window.searchData = "data:application/octet-stream;base64,H4sIAAAAAAAAA7VdbW/bOBL+KwfnazZrUiQl9Vtvt7gNundbbIDFAUFRqLbaCHEcw3Z7zRX970dSbzPUjEzJvk+Jo3l/ZobkyFK+L/bP/zksXt1/XzxW2/XildTmerEtnsrFq8Xrsli/2a72L7tj9bz95Xl7LL8dF9eLL/uNvVrZj/tPxao8/EwS3jwcnzaWerUpDofS6lgsflx3apYq6/QcymIzTexVwwJkXy92xb7cHlm7GeXPu3I7UXnDMlN5EODbViVnREcwGlCxlKqTW63jhF15Qt6P3jZG0WP5clf9N9L0q576DJXb5+2qnKAU0p+h9lh8nqC0p56mEmXmal8WxzK6AAMTeO6JJoF8/aXaPZT7uy/VsXxX7IunA2XLgCg+bx/Lp3iJVzU17c3QUk7l+tMUlZ76TJWFjfQEnQ35dKUQuags+j+08Dnt++zWPadtRystv+2e9xPCd9Ux9IqPh/VP1eGnamuxs8it4w3JU6FlZ8uf5araVZYvBPX4srMGhZfH4QTZcldu1+V+JFMQQXx9l9tVnLSrmpKGCls3MSEJXYNkHIMnSjmXmITyQVKerZxPUCrO05KTNQAkz9v1p9E9Dbx+7pZmIGtsR4MMY9Q8FIcHbp0fKgPUk1QivKptRaJF+FZTzlf18Uu1Wf9efCw35fr2kVxrh1qHTBcyYPvpeYYFNdd8E2zi7otVZMR74nMU7optZPZ2tGf793q7fjNJ8YBrvgmbGqo3UyI94LmA+nj3Q5ZpymHzK5/Gmx+4fnbzC2WNNj9oGKPmUNpDw5FtfwN1iH6+WrvWx+vsiecr3H35uKlWb/mz61BtyHKG8n311R7MpmkPeSapD/ZF+6rYWCnvWo9isSb45puxLucawnBeIiJdlKeGBDJeJiYTTeFY5xtTPbmNYbQBkHy+0s/lttzXxr8rqn2c6iHTORDY6E1TH7LMV25bW7GL7oKe9BxPo5W1pNOUgUXx3b68e7D0ayad4PVzF8WBrLFFERnGjzjj9DyOJD+jCAYpPKzzAzaaMj5w+5afgWNE/lXAS3vLuDJtKDBmxdh0YJrygz/Qji5BY4YM2S9hVMWcjMYsqcJz0dgxfpo5u8PjVGtqlgsZw0yg78pi82d52D1vD+Q2iiGNrxP66DIm9mrk5MJZPq0qRrWPlcVp9ewAkO9EBNmMNjRafZyKK5I9YmAY0w+m2gK5zjahpAczrPJyZCYzQS3XdFi9kzrOBEOYdsPaMaXXnDBDZlSj6axpdMAiHE13LfpR/cpW23H/ZXV83p+Ud4WJTxb01O00qzd2Kx2hm95Js5rjdtEReofnFlbn6TMLrQ9l6wd4z5JV9SG8V9kk6W7/fCxXNkn/Npa1jNtGCkXfO2XtYMw4Qyu4fcprDe6anq0V3UFl1Q5unM7QO7wfT98b40uZZLqwTex9wBNmEXwXswzdgGPtmHTvLUIruvPGap100y2mCRS7KqIJ1FSXbQLQ+Q+H8vhlF2FIS3dRU5J+sXsN6/Nrsa+Kj5vmWyo/idEl02id9NvQDx/cjexxSVcdEf+9Fg631+XBrvn/WD1FqbiB5Lyym8YgXqfdaU/R2ZHP1vnLQ7F6KOTy3fPmRSRLHaea4JptwRt/n/mP7eYlTjein6I1/IoESsX6axGecSwJg0y+5XL59oLZfDsln29nZ3SoJjKnb8/NakpvRF6f1BuZ2QP1k3L7pBUns3ugPzK/Kc1Uht9SOX4bneVvwS6uN9z+9TL53Qs6ldzOECbGv9ld5J2FTJsYDTeInFV2AtdGSJKpKTpr8jN12rPjFJ01+QSdYRbBFKhTyLHF5w/ZJP3fL5ZD0S2yNmdmHg1KNS6TTvaIU7nE6T2RTbF62Xzi9J7IqJjOhNOiy6oJfamk1hP71wvlVCfoZEZZQ5j4/uv5+PpwqD5vS7ICQhU3mJ5VdwLVXx/sUf6dzcnxdB5op/nOs8Jm6HhyM1aEfOdZoaUYT3XGipDvLCvuytXOhvRRzIGFZj7Lnn9LrUU+xxiC8zxLlMrm4DPgm2vFby8f99W68+zty8dyn5osyhKed4I1g+4ImlvTGy1bfGekV1z394t1x/gV15szt0MOlqDIHnly7YvukgMLJvbJSEsiOiVjSXSvjLQkolsylkT3yzhLojsmbc7EnhlnU1zXpA2a0jcjrYnonIwt0b3z9C5ySvccbimn98+o/SVqgl0PPbG/hHf5/l4cyjf7PXFPrrtykTt8WFrU/b3eNNr033aPjOndlYuYjqWxpo/Ni3tTaVdut1+LTbX292NplwYUF3GNljrLxaELtKt/OarCPd1FOxpcv4iblMxZTobG0y7etd9EpT3Ely/iICFyln+B5bR7v/ZftaUdDAku4iIpdJaTA/tpN9+4b5jSDvaXLuJaIG6WU8BaDjXWnf7ShZA63x1gLYOOHx8z8PTXLoNPIG8eQMBgrm0UG65jNFcu1CygtJl9ojWVduWPXcm09+7KRVzB0ma50ptKu/LP8nAoPpe/V0/V8c+yWD2Ua9ozjvAijo4Kn+U36xfXPsDXk7g2EpJcqJ2QYme2lYEXtLv2/H33ZecqloN7QHERZ2mps3wduvDj/fXCWlN+W7z6vvha7g92H2MJ5U1yk1vOT1W5WVup97WhVs/z05OT9b659lfpDHAUNcnPy8X1/fJamRuTqPfvr+9bDn/B/8GTCftJXCf6xqgMkQlEZs9n95Iik4gssZ8SSmmCyJT9pChpCpFp+0lT0jQis6fYe0ORGUSW2k8pRZYiMnvuu88osgyRWVDuc4osx+F10RZLMsABEB4JGgqMhTss3wsSDYHhEC7sggREYESEYvMAYyI0lwkCoyJc9IW6VuJGS4MpMTDCASBIoAXGRjgMBIm1wPAIB4NIr5PsRhiBKTFCcsl5LjFAUrA1ENSKZD2XGB/p8SGzTWJ8JFsyEuMjHQqCzEyJAZIOBUm2CIkBkg4FKUhKDJB0KEhJUmKApENBkqkpMUCJg0EqsqtghBKPEJlICYYo8f2MTKQk6GgOB0n2jQRDlDggJAlmgjFKNAdmgiFKPEQkmAmGKHE4JCSYCYYocTgkJJgJhihxOCQkmAmGSDkcEhJMhSFSDoeEBFNhiJTDISHBVBgi5VcdEkwVrDsOhySlKlNhiJQDIslISoyRckAkOUmJMVIOCEVipDBGygGhSIwUxkg5IBSJkcIY6SWXdBpDpB0OigRTY4i0w0GRYGoMkXY4KHotxxBpxTZuHewOfBWRsGsMkZtz3ysSdo0h0h4iEnaNIdIeIrI0NYZIOxw0CbvGEJkl67vBGBkHhCYTxGCMjANCkwliMEbGAaFJ3A3GyDggNIm7wRgZzUbeBJs4w0beYIyMA0KTuWQwRm6Gf6/NtUxuZBbEE2NkcrbcDcYoXbLlnmKMUsE2mxRjlHqM6L0pxihN2O1kijFKFbudTDFGqWa3kynGKHVAaHKFS4O9tseIrI4UY5Rm3PYrxRClObf9SjFCmYPBkPWWYYQyB4MhqyjDCGX8ljvDCGUOBmMpxU2e4pzLMELuTum9Saj8yDBCmYPBkBvKDCOU+bOQJikxQpmDwRiSMjgQZbzvGKLMAWHIjM8wRvmSjVKOMcoFG6UcY5RLNko5xihP2CjlGKNcsVHKMUa5Zn3PMUa5YSszxxjlKR8ljFHugDBk/8qDc6vHiOxfeXh0dUikS/IEtwwOr8uR0+syOL4uHRqpoOUGB9glX071NUir2CDU1yCtZsNQX4O0ZiQOwVF2mY74FhxmlxnbzOtrkDYfiUOAmx8spJK0YTB0cNikZHmJcOzghwspfaIPBw9+vJCSJSbC0YOfMKRkkYlw+uCHDClZZiIcQPgxQ0rnQziC8IOGlM6HcAghRnALxxB+2JDRuRMMIoTkm6IIZhHCjxwYjGU4LpI8xsFAQvixA4NxMJIQfvLAYBxMJYSfPTAYB3MJ4acPDMbBZEL4+QODcTCbEH4CwWAcTCeEHMEtmE8IP4XIyG2ECCYUws8h6C2pCGYUwk8iMnLrLpJw0JeMyA1w89OIjJkKBrj5gQQnN8DNjyQy8lgggnGF8EMJTm6Amx9LZPR8MBhZCD+Y4OQGuPnRREZPE4OxhVAjuAWDC+HHExm5nRfB6EKoEdxUOKL1uJHbbxGML4QawS0YYAg/psjIzboIRhhCjeAWDDGEH1Xk5EZcBGMMoUZwCwYZws8rcrreglmG0CO4BdMM4WcWOV1vwTxD6BHcgomG8HOLnK43HU7XR3ALphrCzy5yut6CuYbQI7g1kw1/A+pr6W5J3dY3ou7vu+/ffl98aO5Ome5m2feFPdG8+v7jemH37PXPtP7ptmbNL3nzi/QkP/obV+6TM6N+7hjIXwL5LJN/VUDPZA/PHZM9MjNMzYPFQJcAugTDVj+o3zMJEAAha/fsQdn/zJrP9mDECyu7d2iv2gfbe+nAe855J6NCJhngftZEPNdj7P1bQHspSS8kYXnd85ifVyj4BjDak2utnY+me7IylKCAhCaUOQfjx+JQlvVt315CBpB0iy7D6l7V27xNtXpEJkggQKYx/P4FM0AASAvJwb9qHuzcdQ92giBoEATTBIEDYuUfcj/UL4ABdQBkGM4LwLtrXp7US8h7AflpfveChH33lqteigJiNBsMeOMc+GCAD1nTPhLR/tJ2lkS3v7RNJ2l7jWqJVUusWmLVEquWWLfEuiXWLbFmI+jfTzFaxxkAc1RK96YoQogGYUzHjalf8kTJAJakhpOBWUAT0lwWNO9dBJiDClKcz55rWL3ARreV4XjdF0Qey5edfwsPaFwgTKqpnJTrAUjKwJIc9DK3OHMyum8pDn0x0Bfeik5C8/pc/4JG4BMQo7guAKX494yFQkBfVVxHXrsv47vHFB4e158OzWMBvYwURkS0xSK57lxLSzLVSPMPhABpCkqTrTTWQS9NS9FI8w8KAGkaSmvrV7KwOWmH9pkMxl0In1CtSG4x9SK/+ecGGHkplNd2FskVYi1PqYxxGBaKMK00rjWUeI3TIPiGC5J/TR/Y7UD7m56pm7AYLrubF8CC3gA6imKt3ZK9ARqguLQb7cUCpjCXalbCwb++GpQPsDphrW7eyg52AiDM7Fak/dcWwEpYGg20bJnV7MNg5TBYXJLVzM/+9Q5g/wEyP2uWyZzNkvZN+MBtEGXJrRoNX+FYBnED1Zxw3ap9CRy1DIDiaBd8wxni/jlGiLcA0WMrni5zA3Tn7aZlyUWP7o0G7r3a7cnyhB1hgwAp64b0jRAuEx52j8QKBg84CZeBD+1TU3X3e+yemgLGwGwU7c6L3RzjMw1cuppiaH62Oz/N1Vb96rxwLQR9RDWSUi7Lws29Asy6qU3DIVP/IxSQ1wATtvFX9SM6fkM+RAQ1MC6r/IvsQDbDI1Gzbqft8axdOpZcBKwwjEcKxS3blXvJtUXHTx0yBSgUdtkPTvcCJXXjSTdhaKtNcHllpWFXMihPdBMKrlU4fsoVCVzhQcFZqACSmo19+RK2JtAaubRrzqVEXwXJm3Ah77iHfR2sC2w3eKq/sb5x31jf199YH+6tYV/RnCT/HxFD9+GRkOU7Ft1T2SBtodI2edwtElbKof1i9tABuEJrzpD69X0gfiDhG/VNA5NtVXKZ50QNrYCFyPbAnT2W+3e6hwkIzFGc3v5IMtgSAfaEZXfvvAUqQZ3oZhUwXPS6c8xAM3A74Up97DAt4GGBa1uhgOGARIEkYJO4ExNGH9YxV4odM3mm0wABw+mvX1wJfAeuNznYLqptP+VC6kQNcxB2UPawX/8HnhBICXYFCZcG7DhDwPMZrxhwDyHUIByG6wS1jDD4oH0bDr+akwRPAes118hHZgswhdkiODVZAELY89SJuQIIAzviOBafQ+jhlJ7h+to9xTv0HrZfOnPeXy921c4uQ1tLdf/+x4//Abikt4JCegAA"; \ No newline at end of file diff --git a/docs/assets/style.css b/docs/assets/style.css index 258146fc0..108428c3f 100644 --- a/docs/assets/style.css +++ b/docs/assets/style.css @@ -910,8 +910,9 @@ a.tsd-index-link { box-shadow: 0 0 4px rgba(0, 0, 0, 0.25); } #tsd-search .results li { - padding: 0 10px; background-color: var(--color-background); + line-height: initial; + padding: 4px; } #tsd-search .results li:nth-child(even) { background-color: var(--color-background-secondary); @@ -924,7 +925,10 @@ a.tsd-index-link { background-color: var(--color-accent); } #tsd-search .results a { - display: block; + display: flex; + align-items: center; + padding: 0.25rem; + box-sizing: border-box; } #tsd-search .results a:before { top: 10px; @@ -1134,7 +1138,7 @@ img { } .deprecated { - text-decoration: line-through; + text-decoration: line-through !important; } .warning { diff --git a/docs/classes/BaseError.html b/docs/classes/BaseError.html index c62240586..63a7a5fb4 100644 --- a/docs/classes/BaseError.html +++ b/docs/classes/BaseError.html @@ -1,13 +1,13 @@ -BaseError | hpke-js
    +BaseError | hpke-js
    -
    +
    @@ -28,19 +28,19 @@

    Hierarchy

    +
  • Defined in src/errors.ts:4
  • - +

    Constructors

    -

    Properties

    -
    cause? +
    cause? message name stack? @@ -48,7 +48,7 @@

    Properties

    Constructors

    - +
    +
  • Defined in src/errors.ts:5
  • Properties

    @@ -91,15 +91,15 @@
    @@ -112,47 +112,30 @@

    name
  • stack
  • +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/docs/classes/CipherSuite.html b/docs/classes/CipherSuite.html index 058692476..1a134f8e0 100644 --- a/docs/classes/CipherSuite.html +++ b/docs/classes/CipherSuite.html @@ -1,13 +1,13 @@ -CipherSuite | hpke-js
    +CipherSuite | hpke-js
    -
    +
    @@ -58,42 +58,42 @@

    Hierarchy

    • CipherSuite
    +
  • Defined in src/cipherSuite.ts:72
  • - +

    Constructors

    - +
    • @@ -103,14 +103,15 @@

      Parameters

    • params: CipherSuiteParams

      A set of parameters for building a cipher suite.

      -
    +
    +

    Returns CipherSuite

    +
  • Defined in src/cipherSuite.ts:77
  • Properties

    @@ -118,13 +119,13 @@
    +
  • Defined in src/algorithm.ts:19
  • +
  • Defined in src/cipherSuiteNative.ts:119
  • Accessors

    @@ -138,7 +139,7 @@

    Returns

    +
  • Defined in src/cipherSuiteNative.ts:176
  • +
  • Defined in src/cipherSuiteNative.ts:169
  • +
  • Defined in src/cipherSuiteNative.ts:162
  • Methods

    @@ -173,7 +174,7 @@
    +
  • Defined in src/algorithm.ts:23
    • @@ -189,7 +190,8 @@

      Parameters

    • params: RecipientContextParams

      A set of parameters for the recipient encryption context.

      -
    + +

    Returns Promise<EncryptionContext>

    A recipient encryption context.

    @@ -197,7 +199,7 @@

    Throws

    DecapError

    +
  • Defined in src/cipherSuiteNative.ts:217
    • @@ -212,7 +214,8 @@

      Parameters

    • params: SenderContextParams

      A set of parameters for the sender encryption context.

      -
    + +

    Returns Promise<SenderContext>

    A sender encryption context.

    @@ -220,9 +223,9 @@

    Throws

    EncapError

    +
  • Defined in src/cipherSuiteNative.ts:189
  • - +
    • @@ -236,7 +239,8 @@

      Parameters

    • ikm: ArrayBuffer

      A byte string of input keying material. The maximum length is 128 bytes.

      -
    + +

    Returns Promise<CryptoKeyPair>

    A key pair derived.

    @@ -245,9 +249,9 @@

    Deprecated

    Use DeriveKeyPairError

    +
  • Defined in src/cipherSuite.ts:167
  • - +
    +
  • Defined in src/cipherSuite.ts:150
  • - +
    • @@ -282,15 +286,18 @@

      Parameters

    • format: "raw" | "jwk"

      For now, 'raw' and 'jwk' are supported.

      -
    • + +
    • key: ArrayBuffer | JsonWebKey

      A byte string of a raw key or A JsonWebKey object.

      -
    • + +
    • isPublic: boolean = true

      The indicator whether the provided key is a public key or not, which is used only for 'raw' format.

      -
    + +

    Returns Promise<CryptoKey>

    A public or private CryptoKey.

    @@ -299,7 +306,7 @@

    Deprecated

    Use DeserializeError

    +
  • Defined in src/cipherSuite.ts:192
    • @@ -314,15 +321,18 @@

      Parameters

    • params: RecipientContextParams

      A set of parameters for building a recipient encryption context.

      -
    • + +
    • ct: ArrayBuffer

      An encrypted text as bytes to be decrypted.

      -
    • + +
    • aad: ArrayBuffer = EMPTY

      Additional authenticated data as bytes fed by an application.

      -
    + +

    Returns Promise<ArrayBuffer>

    A decrypted plain text as bytes.

    @@ -330,7 +340,7 @@

    Throws

    DecapError

    +
  • Defined in src/cipherSuiteNative.ts:269
    • @@ -345,15 +355,18 @@

      Parameters

    • params: SenderContextParams

      A set of parameters for building a sender encryption context.

      -
    • + +
    • pt: ArrayBuffer

      A plain text as bytes to be encrypted.

      -
    • + +
    • aad: ArrayBuffer = EMPTY

      Additional authenticated data as bytes fed by an application.

      -
    + +

    Returns Promise<CipherSuiteSealResponse>

    A cipher text and an encapsulated key as bytes.

    @@ -361,20 +374,20 @@

    Throws

    EncapError

    +
  • Defined in src/cipherSuiteNative.ts:246
  • @@ -396,47 +409,30 @@

    open
  • seal
  • +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/docs/classes/DecapError.html b/docs/classes/DecapError.html index 8165a6276..89a004367 100644 --- a/docs/classes/DecapError.html +++ b/docs/classes/DecapError.html @@ -1,13 +1,13 @@ -DecapError | hpke-js
    +DecapError | hpke-js
    -
    +
    @@ -26,19 +26,19 @@

    Hierarchy

    • DecapError
    +
  • Defined in src/errors.ts:54
  • - +

    Constructors

    -

    Properties

    -
    cause? +
    cause? message name stack? @@ -46,7 +46,7 @@

    Properties

    Constructors

    - +
    +
  • Defined in src/errors.ts:5
  • Properties

    @@ -89,15 +89,15 @@
    @@ -110,47 +110,30 @@

    name
  • stack
  • +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/docs/classes/DeriveKeyPairError.html b/docs/classes/DeriveKeyPairError.html index a820414de..8f41d871a 100644 --- a/docs/classes/DeriveKeyPairError.html +++ b/docs/classes/DeriveKeyPairError.html @@ -1,13 +1,13 @@ -DeriveKeyPairError | hpke-js
    +DeriveKeyPairError | hpke-js
    -
    +
    @@ -26,19 +26,19 @@

    Hierarchy

    • DeriveKeyPairError
    +
  • Defined in src/errors.ts:79
  • - +

    Constructors

    -

    Properties

    -
    cause? +
    cause? message name stack? @@ -46,7 +46,7 @@

    Properties

    Constructors

    - +
    +
  • Defined in src/errors.ts:5
  • Properties

    @@ -89,15 +89,15 @@
    @@ -110,47 +110,30 @@

    name
  • stack
  • +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/docs/classes/DeserializeError.html b/docs/classes/DeserializeError.html index 248863ae0..ba21eebb7 100644 --- a/docs/classes/DeserializeError.html +++ b/docs/classes/DeserializeError.html @@ -1,13 +1,13 @@ -DeserializeError | hpke-js
    +DeserializeError | hpke-js
    -
    +
    @@ -26,19 +26,19 @@

    Hierarchy

    • DeserializeError
    +
  • Defined in src/errors.ts:44
  • - +

    Constructors

    -

    Properties

    -
    cause? +
    cause? message name stack? @@ -46,7 +46,7 @@

    Properties

    Constructors

    - +
    +
  • Defined in src/errors.ts:5
  • Properties

    @@ -89,15 +89,15 @@
    @@ -110,47 +110,30 @@

    name
  • stack
  • +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/docs/classes/EncapError.html b/docs/classes/EncapError.html index d2616549a..768584728 100644 --- a/docs/classes/EncapError.html +++ b/docs/classes/EncapError.html @@ -1,13 +1,13 @@ -EncapError | hpke-js
    +EncapError | hpke-js
    -
    +
    @@ -26,19 +26,19 @@

    Hierarchy

    • EncapError
    +
  • Defined in src/errors.ts:49
  • - +

    Constructors

    -

    Properties

    -
    cause? +
    cause? message name stack? @@ -46,7 +46,7 @@

    Properties

    Constructors

    - +
    +
  • Defined in src/errors.ts:5
  • Properties

    @@ -89,15 +89,15 @@
    @@ -110,47 +110,30 @@

    name
  • stack
  • +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/docs/classes/ExportError.html b/docs/classes/ExportError.html index 362d68ce6..3fd173c4b 100644 --- a/docs/classes/ExportError.html +++ b/docs/classes/ExportError.html @@ -1,13 +1,13 @@ -ExportError | hpke-js
    +ExportError | hpke-js
    -
    +
    @@ -26,19 +26,19 @@

    Hierarchy

    • ExportError
    +
  • Defined in src/errors.ts:59
  • - +

    Constructors

    -

    Properties

    -
    cause? +
    cause? message name stack? @@ -46,7 +46,7 @@

    Properties

    Constructors

    - +
    +
  • Defined in src/errors.ts:5
  • Properties

    @@ -89,15 +89,15 @@
    @@ -110,47 +110,30 @@

    name
  • stack
  • +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/docs/classes/HpkeError.html b/docs/classes/HpkeError.html index 038e83e09..d6a2fb067 100644 --- a/docs/classes/HpkeError.html +++ b/docs/classes/HpkeError.html @@ -1,13 +1,13 @@ -HpkeError | hpke-js
    +HpkeError | hpke-js
    -
    +
    @@ -39,19 +39,19 @@

    Hierarchy

  • DeriveKeyPairError
  • NotSupportedError
  • +
  • Defined in src/errors.ts:24
  • - +

    Constructors

    -

    Properties

    -
    cause? +
    cause? message name stack? @@ -59,7 +59,7 @@

    Properties

    Constructors

    - +
    +
  • Defined in src/errors.ts:5
  • Properties

    @@ -102,15 +102,15 @@
    @@ -123,47 +123,30 @@

    name
  • stack
  • +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/docs/classes/InvalidParamError.html b/docs/classes/InvalidParamError.html index 3dc4d0cb9..251c27d20 100644 --- a/docs/classes/InvalidParamError.html +++ b/docs/classes/InvalidParamError.html @@ -1,13 +1,13 @@ -InvalidParamError | hpke-js
    +InvalidParamError | hpke-js
    -
    +
    @@ -26,19 +26,19 @@

    Hierarchy

    • InvalidParamError
    +
  • Defined in src/errors.ts:29
  • - +

    Constructors

    -

    Properties

    -
    cause? +
    cause? message name stack? @@ -46,7 +46,7 @@

    Properties

    Constructors

    - +
    +
  • Defined in src/errors.ts:5
  • Properties

    @@ -89,15 +89,15 @@
    @@ -110,47 +110,30 @@

    name
  • stack
  • +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/docs/classes/MessageLimitReachedError.html b/docs/classes/MessageLimitReachedError.html index 6c31b0399..ab00afcad 100644 --- a/docs/classes/MessageLimitReachedError.html +++ b/docs/classes/MessageLimitReachedError.html @@ -1,13 +1,13 @@ -MessageLimitReachedError | hpke-js
    +MessageLimitReachedError | hpke-js
    -
    +
    @@ -26,19 +26,19 @@

    Hierarchy

    • MessageLimitReachedError
    +
  • Defined in src/errors.ts:74
  • - +

    Constructors

    -

    Properties

    -
    cause? +
    cause? message name stack? @@ -46,7 +46,7 @@

    Properties

    Constructors

    - +
    +
  • Defined in src/errors.ts:5
  • Properties

    @@ -89,15 +89,15 @@
    @@ -110,47 +110,30 @@

    name
  • stack
  • +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/docs/classes/NotSupportedError.html b/docs/classes/NotSupportedError.html index 5937019bd..9dcd160d3 100644 --- a/docs/classes/NotSupportedError.html +++ b/docs/classes/NotSupportedError.html @@ -1,13 +1,13 @@ -NotSupportedError | hpke-js
    +NotSupportedError | hpke-js
    -
    +
    @@ -26,19 +26,19 @@

    Hierarchy

    • NotSupportedError
    +
  • Defined in src/errors.ts:84
  • - +

    Constructors

    -

    Properties

    -
    cause? +
    cause? message name stack? @@ -46,7 +46,7 @@

    Properties

    Constructors

    - +
    +
  • Defined in src/errors.ts:5
  • Properties

    @@ -89,15 +89,15 @@
    @@ -110,47 +110,30 @@

    name
  • stack
  • +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/docs/classes/OpenError.html b/docs/classes/OpenError.html index fa9f0d6ed..193ecc755 100644 --- a/docs/classes/OpenError.html +++ b/docs/classes/OpenError.html @@ -1,13 +1,13 @@ -OpenError | hpke-js
    +OpenError | hpke-js
    -
    +
    @@ -26,19 +26,19 @@

    Hierarchy

    • OpenError
    +
  • Defined in src/errors.ts:69
  • - +

    Constructors

    -

    Properties

    -
    cause? +
    cause? message name stack? @@ -46,7 +46,7 @@

    Properties

    Constructors

    - +
    +
  • Defined in src/errors.ts:5
  • Properties

    @@ -89,15 +89,15 @@
    @@ -110,47 +110,30 @@

    name
  • stack
  • +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/docs/classes/SealError.html b/docs/classes/SealError.html index a1757a049..b8f8c6629 100644 --- a/docs/classes/SealError.html +++ b/docs/classes/SealError.html @@ -1,13 +1,13 @@ -SealError | hpke-js
    +SealError | hpke-js
    -
    +
    @@ -26,19 +26,19 @@

    Hierarchy

    • SealError
    +
  • Defined in src/errors.ts:64
  • - +

    Constructors

    -

    Properties

    -
    cause? +
    cause? message name stack? @@ -46,7 +46,7 @@

    Properties

    Constructors

    - +
    +
  • Defined in src/errors.ts:5
  • Properties

    @@ -89,15 +89,15 @@
    @@ -110,47 +110,30 @@

    name
  • stack
  • +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/docs/classes/SerializeError.html b/docs/classes/SerializeError.html index c5192167f..bede3cc32 100644 --- a/docs/classes/SerializeError.html +++ b/docs/classes/SerializeError.html @@ -1,13 +1,13 @@ -SerializeError | hpke-js
    +SerializeError | hpke-js
    -
    +
    @@ -26,19 +26,19 @@

    Hierarchy

    • SerializeError
    +
  • Defined in src/errors.ts:39
  • - +

    Constructors

    -

    Properties

    -
    cause? +
    cause? message name stack? @@ -46,7 +46,7 @@

    Properties

    Constructors

    - +
    +
  • Defined in src/errors.ts:5
  • Properties

    @@ -89,15 +89,15 @@
    @@ -110,47 +110,30 @@

    name
  • stack
  • +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/docs/classes/ValidationError.html b/docs/classes/ValidationError.html index d1177b727..ba19e63bd 100644 --- a/docs/classes/ValidationError.html +++ b/docs/classes/ValidationError.html @@ -1,13 +1,13 @@ -ValidationError | hpke-js
    +ValidationError | hpke-js
    -
    +
    @@ -26,19 +26,19 @@

    Hierarchy

    • ValidationError
    +
  • Defined in src/errors.ts:34
  • - +

    Constructors

    -

    Properties

    -
    cause? +
    cause? message name stack? @@ -46,7 +46,7 @@

    Properties

    Constructors

    - +
    +
  • Defined in src/errors.ts:5
  • Properties

    @@ -89,15 +89,15 @@
    @@ -110,47 +110,30 @@

    name
  • stack
  • +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/docs/index.html b/docs/index.html index cb638cea5..a78d2a5ec 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1,13 +1,13 @@ -hpke-js
    +hpke-js
    -
    +
    @@ -360,15 +360,15 @@

    hpke-js

    @@ -409,47 +409,30 @@

    Contributing
  • References
  • +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/docs/interfaces/AeadEncryptionContext.html b/docs/interfaces/AeadEncryptionContext.html index 260d5d73a..aa6bbb905 100644 --- a/docs/interfaces/AeadEncryptionContext.html +++ b/docs/interfaces/AeadEncryptionContext.html @@ -1,13 +1,13 @@ -AeadEncryptionContext | hpke-js
    +AeadEncryptionContext | hpke-js
    -
    +
    @@ -24,21 +24,21 @@

    Hierarchy

    • AeadEncryptionContext
    +
  • Defined in src/interfaces/aeadEncryptionContext.ts:7
  • - +

    Methods

    -

    Methods

    - +
    • @@ -50,20 +50,23 @@

      Parameters

    • iv: ArrayBuffer

      An initialization vector.

      -
    • +
    +
  • data: ArrayBuffer

    A plain text as bytes to be encrypted.

    -
  • +
    +
  • aad: ArrayBuffer

    Additional authenticated data as bytes fed by an application.

    -
  • + +

    Returns Promise<ArrayBuffer>

    A decrypted plain text as bytes.

    +
  • Defined in src/interfaces/aeadEncryptionContext.ts:30
    • @@ -77,33 +80,36 @@

      Parameters

    • iv: ArrayBuffer

      An initialization vector.

      -
    • + +
    • data: ArrayBuffer

      A plain text as bytes to be encrypted.

      -
    • + +
    • aad: ArrayBuffer

      Additional authenticated data as bytes fed by an application.

      -
    + +

    Returns Promise<ArrayBuffer>

    A cipher text as bytes.

    +
  • Defined in src/interfaces/aeadEncryptionContext.ts:16
  • @@ -113,47 +119,30 @@

    open
  • seal
  • +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/docs/interfaces/AeadInterface.html b/docs/interfaces/AeadInterface.html index b311cf276..d7fe3db7b 100644 --- a/docs/interfaces/AeadInterface.html +++ b/docs/interfaces/AeadInterface.html @@ -1,13 +1,13 @@ -AeadInterface | hpke-js
    +AeadInterface | hpke-js
    -
    +
    @@ -24,33 +24,33 @@

    Hierarchy

    • AeadInterface
    +
  • Defined in src/interfaces/aeadInterface.ts:8
  • - +

    Properties

    - +
    id: AeadId

    The KDF identifier.

    +
  • Defined in src/interfaces/aeadInterface.ts:10
  • keySize: number
    @@ -58,7 +58,7 @@
    +
  • Defined in src/interfaces/aeadInterface.ts:12
  • nonceSize: number
    @@ -66,7 +66,7 @@
    +
  • Defined in src/interfaces/aeadInterface.ts:14
  • tagSize: number
    @@ -74,7 +74,7 @@
    +
  • Defined in src/interfaces/aeadInterface.ts:16
  • Methods

    @@ -90,25 +90,26 @@

    Parameters

  • key: ArrayBuffer

    A byte string of the raw key.

    -
  • +
    +

    Returns AeadEncryptionContext

    An AEAD encryption context.

    +
  • Defined in src/interfaces/aeadInterface.ts:24
  • @@ -121,47 +122,30 @@

    tagSize
  • createEncryptionContext
  • +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/docs/interfaces/CipherSuiteParams.html b/docs/interfaces/CipherSuiteParams.html index 5dec44357..40785f702 100644 --- a/docs/interfaces/CipherSuiteParams.html +++ b/docs/interfaces/CipherSuiteParams.html @@ -1,13 +1,13 @@ -CipherSuiteParams | hpke-js
    +CipherSuiteParams | hpke-js
    -
    +
    @@ -24,28 +24,28 @@

    Hierarchy

    • CipherSuiteParams
    +
  • Defined in src/interfaces/cipherSuiteParams.ts:9
  • - +

    Properties

    -

    Properties

    - +

    The AEAD (Authenticated Encryption with Addtional Data) identifier or the AEAD object.

    +
  • Defined in src/interfaces/cipherSuiteParams.ts:17
  • @@ -53,7 +53,7 @@
    +
  • Defined in src/interfaces/cipherSuiteParams.ts:14
  • @@ -61,20 +61,20 @@
    +
  • Defined in src/interfaces/cipherSuiteParams.ts:11
  • @@ -85,47 +85,30 @@

    kdf
  • kem
  • +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/docs/interfaces/CipherSuiteSealResponse.html b/docs/interfaces/CipherSuiteSealResponse.html index a05885355..0ba72e5f6 100644 --- a/docs/interfaces/CipherSuiteSealResponse.html +++ b/docs/interfaces/CipherSuiteSealResponse.html @@ -1,13 +1,13 @@ -CipherSuiteSealResponse | hpke-js
    +CipherSuiteSealResponse | hpke-js
    -
    +
    @@ -24,27 +24,27 @@

    Hierarchy

    • CipherSuiteSealResponse
    +
  • Defined in src/interfaces/responses.ts:4
  • - +

    Properties

    -

    Properties

    - +
    ct: ArrayBuffer

    The ciphertext as bytes.

    +
  • Defined in src/interfaces/responses.ts:6
  • enc: ArrayBuffer
    @@ -52,20 +52,20 @@
    +
  • Defined in src/interfaces/responses.ts:8
  • @@ -75,47 +75,30 @@

    ct
  • enc
  • +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/docs/interfaces/EncryptionContext.html b/docs/interfaces/EncryptionContext.html index 9cbcf90a9..86c5f760f 100644 --- a/docs/interfaces/EncryptionContext.html +++ b/docs/interfaces/EncryptionContext.html @@ -1,13 +1,13 @@ -EncryptionContext | hpke-js
    +EncryptionContext | hpke-js
    -
    +
    @@ -28,22 +28,22 @@

    Hierarchy

    +
  • Defined in src/interfaces/encryptionContext.ts:6
  • - +

    Methods

    -

    Methods

    - +
    • @@ -56,11 +56,13 @@

      Parameters

    • exporterContext: ArrayBuffer

      An exporter context string as bytes. The maximum length is 128 bytes.

      -
    • +
    +
  • len: number

    A desired length in bytes of the output secret.

    -
  • +
    +

    Returns Promise<ArrayBuffer>

    A secret string as bytes.

    @@ -68,7 +70,7 @@

    Throws

    E

    +
  • Defined in src/interfaces/exporter.ts:15
    • @@ -83,18 +85,20 @@

      Parameters

    • data: ArrayBuffer

      An encrypted text as bytes to be decrypted.

      -
    • + +
    • Optional aad: ArrayBuffer

      Additional authenticated data as bytes fed by an application.

      -
      Optional
    + +

    Returns Promise<ArrayBuffer>

    A decrypted plain text as bytes.

    Throws

    OpenError

    +
  • Defined in src/interfaces/encryptionContext.ts:29
    • @@ -109,31 +113,33 @@

      Parameters

    • data: ArrayBuffer

      A plain text as bytes to be encrypted.

      -
    • + +
    • Optional aad: ArrayBuffer

      Additional authenticated data as bytes fed by an application.

      -
      Optional
    + +

    Returns Promise<ArrayBuffer>

    A cipher text as bytes.

    +
  • Defined in src/interfaces/encryptionContext.ts:17
  • @@ -144,47 +150,30 @@

    open
  • seal
  • +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/docs/interfaces/KdfInterface.html b/docs/interfaces/KdfInterface.html index 7458975e5..16d1d41e8 100644 --- a/docs/interfaces/KdfInterface.html +++ b/docs/interfaces/KdfInterface.html @@ -1,13 +1,13 @@ -KdfInterface | hpke-js
    +KdfInterface | hpke-js
    -
    +
    @@ -24,20 +24,20 @@

    Hierarchy

    • KdfInterface
    +
  • Defined in src/interfaces/kdfInterface.ts:6
  • - +

    Properties

    -

    Methods

    -
    buildLabeledIkm +
    buildLabeledIkm buildLabeledInfo expand extract @@ -49,13 +49,13 @@

    Methods

    Properties

    - +
    hashSize: number

    The output size of the extract() function in bytes (Nh).

    +
  • Defined in src/interfaces/kdfInterface.ts:10
  • id: KdfId
    @@ -63,7 +63,7 @@
    +
  • Defined in src/interfaces/kdfInterface.ts:8
  • Methods

    @@ -79,14 +79,15 @@

    Parameters

  • label: Uint8Array

    A byte string indicating the cryptographic context/operation.

    -
  • +
    +
  • ikm: Uint8Array
  • Returns Uint8Array

    An input keying material as bytes.

    +
  • Defined in src/interfaces/kdfInterface.ts:26
    • @@ -100,20 +101,23 @@

      Parameters

    • label: Uint8Array

      A byte string indicating the cryptographic context/operation.

      -
    • +
    +
  • info: Uint8Array

    An additional byte string.

    -
  • + +
  • len: number

    The length of the output byte string.

    -
  • + +

    Returns Uint8Array

    An info string as bytes.

    +
  • Defined in src/interfaces/kdfInterface.ts:36
    • @@ -127,20 +131,23 @@

      Parameters

    • prk: ArrayBuffer

      A pseudorandom key.

      -
    • + +
    • info: ArrayBuffer

      An additional byte string.

      -
    • + +
    • len: number

      The length in bytes of the output keying material.

      -
    + +

    Returns Promise<ArrayBuffer>

    An output keying material as bytes.

    +
  • Defined in src/interfaces/kdfInterface.ts:62
    • @@ -154,16 +161,18 @@

      Parameters

    • salt: ArrayBuffer

      An additional random byte string.

      -
    • + +
    • ikm: ArrayBuffer

      An input keying material

      -
    + +

    Returns Promise<ArrayBuffer>

    A pseudorandom key as bytes.

    +
  • Defined in src/interfaces/kdfInterface.ts:49
    • @@ -177,24 +186,28 @@

      Parameters

    • salt: ArrayBuffer

      An additional random byte string.

      -
    • + +
    • ikm: ArrayBuffer

      An input keying material

      -
    • + +
    • info: ArrayBuffer

      An additional byte string.

      -
    • + +
    • len: number

      The length in bytes of the output keying material.

      -
    + +

    Returns Promise<ArrayBuffer>

    An output keying material as bytes.

    +
  • Defined in src/interfaces/kdfInterface.ts:77
    • @@ -208,11 +221,12 @@

      Parameters

    • suiteId: Uint8Array

      A suite_id defined in RFC9180.

      -
    + +

    Returns void

    +
  • Defined in src/interfaces/kdfInterface.ts:17
    • @@ -226,24 +240,28 @@

      Parameters

    • prk: ArrayBuffer

      A pseudorandom key.

      -
    • + +
    • label: Uint8Array

      A byte string indicating the cryptographic context/operation.

      -
    • + +
    • info: Uint8Array

      An additional byte string.

      -
    • + +
    • len: number

      The length in bytes of the output keying material.

      -
    + +

    Returns Promise<ArrayBuffer>

    An output keying material as bytes.

    +
  • Defined in src/interfaces/kdfInterface.ts:107
    • @@ -257,33 +275,36 @@

      Parameters

    • salt: ArrayBuffer

      An additional random byte string.

      -
    • + +
    • label: Uint8Array

      A byte string indicating the cryptographic context/operation.

      -
    • + +
    • ikm: Uint8Array

      An input keying material

      -
    + +

    Returns Promise<ArrayBuffer>

    A pseudorandom key as bytes.

    +
  • Defined in src/interfaces/kdfInterface.ts:92
  • @@ -301,47 +322,30 @@

    labeledExpand
  • labeledExtract
  • +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/docs/interfaces/KemInterface.html b/docs/interfaces/KemInterface.html index 2dfa26948..867776760 100644 --- a/docs/interfaces/KemInterface.html +++ b/docs/interfaces/KemInterface.html @@ -1,13 +1,13 @@ -KemInterface | hpke-js
    +KemInterface | hpke-js
    -
    +
    @@ -24,15 +24,15 @@

    Hierarchy

    • KemInterface
    +
  • Defined in src/interfaces/kemInterface.ts:12
  • - +

    Properties

    -
    encSize +
    encSize id privateKeySize publicKeySize @@ -40,7 +40,7 @@

    Properties

    Methods

    -
    decap +
    decap deriveKeyPair deserializePrivateKey deserializePublicKey @@ -53,13 +53,13 @@

    Methods

    Properties

    - +
    encSize: number

    The length in bytes of an encapsulated key produced by this KEM (Nenc).

    +
  • Defined in src/interfaces/kemInterface.ts:18
  • id: KemId
    @@ -67,7 +67,7 @@
    +
  • Defined in src/interfaces/kemInterface.ts:14
  • privateKeySize: number
    @@ -75,7 +75,7 @@
    +
  • Defined in src/interfaces/kemInterface.ts:22
  • publicKeySize: number
    @@ -83,7 +83,7 @@
    +
  • Defined in src/interfaces/kemInterface.ts:20
  • secretSize: number
    @@ -91,7 +91,7 @@
    +
  • Defined in src/interfaces/kemInterface.ts:16
  • Methods

    @@ -108,14 +108,15 @@

    Parameters

  • params: RecipientContextParams

    A set of parameters for the recipient context.

    -
  • +
    +

    Returns Promise<ArrayBuffer>

    A shared secret as the output of the decapsulation step.

    Throws

    DecapError

    +
  • Defined in src/interfaces/kemInterface.ts:137
    • @@ -130,14 +131,15 @@

      Parameters

    • ikm: ArrayBuffer

      An input keying material.

      -
    + +

    Returns Promise<CryptoKeyPair>

    A key pair derived.

    +
  • Defined in src/interfaces/kemInterface.ts:111
    • @@ -152,14 +154,15 @@

      Parameters

    • key: ArrayBuffer

      A key as bytes.

      -
    + +

    Returns Promise<CryptoKey>

    A CryptoKey.

    +
  • Defined in src/interfaces/kemInterface.ts:66
    • @@ -174,14 +177,15 @@

      Parameters

    • key: ArrayBuffer

      A key as bytes.

      -
    + +

    Returns Promise<CryptoKey>

    A CryptoKey.

    +
  • Defined in src/interfaces/kemInterface.ts:44
    • @@ -198,14 +202,15 @@

      Parameters

    • params: SenderContextParams

      A set of parameters for the sender context.

      -
    + +

    Returns Promise<{
        enc: ArrayBuffer;
        sharedSecret: ArrayBuffer;
    }>

    A shared secret and an encapsulated key as the output of the encapsulation step.

    Throws

    EncapError

    +
  • Defined in src/interfaces/kemInterface.ts:124
  • +
  • Defined in src/interfaces/kemInterface.ts:100
    • @@ -240,22 +245,25 @@

      Parameters

    • format: "raw" | "jwk"

      For now, 'raw' and 'jwk' are supported.

      -
    • + +
    • key: ArrayBuffer | JsonWebKey

      A byte string of a raw key or A JsonWebKey object.

      -
    • + +
    • Optional isPublic: boolean

      The indicator whether the provided key is a public key or not, which is used only for 'raw' format.

      -
      Optional
    + +

    Returns Promise<CryptoKey>

    A public or private CryptoKey.

    +
  • Defined in src/interfaces/kemInterface.ts:86
    • @@ -270,14 +278,15 @@

      Parameters

    • key: CryptoKey

      A CryptoKey.

      -
    + +

    Returns Promise<ArrayBuffer>

    A key as bytes.

    +
  • Defined in src/interfaces/kemInterface.ts:55
    • @@ -292,27 +301,28 @@

      Parameters

    • key: CryptoKey

      A CryptoKey.

      -
    + +

    Returns Promise<ArrayBuffer>

    A key as bytes.

    +
  • Defined in src/interfaces/kemInterface.ts:33
  • @@ -334,47 +344,30 @@

    serializePrivateKey
  • serializePublicKey
  • +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/docs/interfaces/PreSharedKey.html b/docs/interfaces/PreSharedKey.html index 2215c32d3..da3b598a7 100644 --- a/docs/interfaces/PreSharedKey.html +++ b/docs/interfaces/PreSharedKey.html @@ -1,13 +1,13 @@ -PreSharedKey | hpke-js
    +PreSharedKey | hpke-js
    -
    +
    @@ -24,27 +24,27 @@

    Hierarchy

    • PreSharedKey
    +
  • Defined in src/interfaces/preSharedKey.ts:4
  • - +

    Properties

    -

    Properties

    - +
    id: ArrayBuffer

    The key identifier.

    +
  • Defined in src/interfaces/preSharedKey.ts:6
  • key: ArrayBuffer
    @@ -52,20 +52,20 @@
    +
  • Defined in src/interfaces/preSharedKey.ts:9
  • @@ -75,47 +75,30 @@

    id
  • key
  • +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/docs/interfaces/RecipientContextParams.html b/docs/interfaces/RecipientContextParams.html index 0128b7822..b374f10bd 100644 --- a/docs/interfaces/RecipientContextParams.html +++ b/docs/interfaces/RecipientContextParams.html @@ -1,13 +1,13 @@ -RecipientContextParams | hpke-js
    +RecipientContextParams | hpke-js
    -
    +
    @@ -26,15 +26,15 @@

    Hierarchy

    • RecipientContextParams
    +
  • Defined in src/interfaces/recipientContextParams.ts:6
  • - +

    Properties

    -
    enc +
    enc info? psk? recipientKey @@ -43,13 +43,13 @@

    Properties

    Properties

    - +
    enc: ArrayBuffer

    A byte string of the encapsulated key received from a sender.

    +
  • Defined in src/interfaces/recipientContextParams.ts:11
  • info?: ArrayBuffer
    @@ -58,7 +58,7 @@
    +
  • Defined in src/interfaces/keyScheduleParams.ts:8
  • @@ -68,7 +68,7 @@
    +
  • Defined in src/interfaces/keyScheduleParams.ts:14
  • recipientKey: CryptoKeyPair | CryptoKey
    @@ -76,7 +76,7 @@
    +
  • Defined in src/interfaces/recipientContextParams.ts:8
  • senderPublicKey?: CryptoKey
    @@ -84,20 +84,20 @@
    +
  • Defined in src/interfaces/recipientContextParams.ts:14
  • @@ -110,47 +110,30 @@

    recipientKey
  • senderPublicKey
  • +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/docs/interfaces/SenderContext.html b/docs/interfaces/SenderContext.html index 7dd14ae2b..cdab446aa 100644 --- a/docs/interfaces/SenderContext.html +++ b/docs/interfaces/SenderContext.html @@ -1,13 +1,13 @@ -SenderContext | hpke-js
    +SenderContext | hpke-js
    -
    +
    @@ -26,32 +26,32 @@

    Hierarchy

    • SenderContext
    +
  • Defined in src/interfaces/encryptionContext.ts:40
  • - +

    Properties

    -

    Methods

    -

    Properties

    - +
    enc: ArrayBuffer

    The encapsulated key generated by the sender.

    +
  • Defined in src/interfaces/encryptionContext.ts:42
  • Methods

    @@ -68,11 +68,13 @@

    Parameters

  • exporterContext: ArrayBuffer

    An exporter context string as bytes. The maximum length is 128 bytes.

    -
  • +
    +
  • len: number

    A desired length in bytes of the output secret.

    -
  • +
    +

    Returns Promise<ArrayBuffer>

    A secret string as bytes.

    @@ -80,7 +82,7 @@

    Throws

    E

    +
  • Defined in src/interfaces/exporter.ts:15
    • @@ -95,11 +97,13 @@

      Parameters

    • data: ArrayBuffer

      An encrypted text as bytes to be decrypted.

      -
    • + +
    • Optional aad: ArrayBuffer

      Additional authenticated data as bytes fed by an application.

      -
      Optional
    + +

    Returns Promise<ArrayBuffer>

    A decrypted plain text as bytes.

    @@ -107,7 +111,7 @@

    Throws

    Ope

    +
  • Defined in src/interfaces/encryptionContext.ts:29
    • @@ -122,11 +126,13 @@

      Parameters

    • data: ArrayBuffer

      A plain text as bytes to be encrypted.

      -
    • + +
    • Optional aad: ArrayBuffer

      Additional authenticated data as bytes fed by an application.

      -
      Optional
    + +

    Returns Promise<ArrayBuffer>

    A cipher text as bytes.

    +
  • Defined in src/interfaces/encryptionContext.ts:17
  • @@ -159,47 +165,30 @@

    open
  • seal
  • +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/docs/interfaces/SenderContextParams.html b/docs/interfaces/SenderContextParams.html index 78902b6f2..604a0abfe 100644 --- a/docs/interfaces/SenderContextParams.html +++ b/docs/interfaces/SenderContextParams.html @@ -1,13 +1,13 @@ -SenderContextParams | hpke-js
    +SenderContextParams | hpke-js
    -
    +
    @@ -26,15 +26,15 @@

    Hierarchy

    • SenderContextParams
    +
  • Defined in src/interfaces/senderContextParams.ts:6
  • - +

    Properties

    -
    ekm? +
    ekm? info? psk? recipientPublicKey @@ -43,13 +43,13 @@

    Properties

    Properties

    - +
    ekm?: ArrayBuffer | CryptoKeyPair

    DO NOT USE. FOR DEBUGGING/TESTING PURPOSES ONLY.

    +
  • Defined in src/interfaces/senderContextParams.ts:14
  • info?: ArrayBuffer
    @@ -58,7 +58,7 @@
    +
  • Defined in src/interfaces/keyScheduleParams.ts:8
  • @@ -68,7 +68,7 @@
    +
  • Defined in src/interfaces/keyScheduleParams.ts:14
  • recipientPublicKey: CryptoKey
    @@ -76,7 +76,7 @@
    +
  • Defined in src/interfaces/senderContextParams.ts:8
  • senderKey?: CryptoKeyPair | CryptoKey
    @@ -84,20 +84,20 @@
    +
  • Defined in src/interfaces/senderContextParams.ts:11
  • @@ -110,47 +110,30 @@

    recipientPublicKey
  • senderKey
  • +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/docs/modules.html b/docs/modules.html index 973769368..e5134b7ea 100644 --- a/docs/modules.html +++ b/docs/modules.html @@ -1,13 +1,13 @@ -hpke-js
    +hpke-js
    -
    +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/docs/types/Aead.html b/docs/types/Aead.html index daf14ed31..327d451bf 100644 --- a/docs/types/Aead.html +++ b/docs/types/Aead.html @@ -1,20 +1,20 @@ -Aead | hpke-js
    +Aead | hpke-js
    -
    +
    -

    Type alias Aead

    +

    Type alias Aead

    Aead: typeof Aead[keyof typeof Aead]

    The type alias of the supported AEAD identifiers.

    @@ -22,65 +22,48 @@

    Type alias Aead

    Deprecated

    Use AeadId instead.

    +
  • Defined in src/identifiers.ts:82
  • +
  • Defined in src/identifiers.ts:94
  • +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/docs/types/AeadId.html b/docs/types/AeadId.html index 3e8fb4dab..a5f25cb75 100644 --- a/docs/types/AeadId.html +++ b/docs/types/AeadId.html @@ -1,13 +1,13 @@ -AeadId | hpke-js
    +AeadId | hpke-js
    -
    +
    @@ -20,65 +20,48 @@

    Type alias AeadId

    +
  • Defined in src/identifiers.ts:99
  • +
  • Defined in src/identifiers.ts:104
  • +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/docs/types/Kdf.html b/docs/types/Kdf.html index 1d54951dd..8a60acfa0 100644 --- a/docs/types/Kdf.html +++ b/docs/types/Kdf.html @@ -1,20 +1,20 @@ -Kdf | hpke-js
    +Kdf | hpke-js
    -
    +
    -

    Type alias Kdf

    +

    Type alias Kdf

    Kdf: typeof Kdf[keyof typeof Kdf]

    The type alias of the supported KDF identifiers.

    @@ -22,65 +22,48 @@

    Type alias Kdf

    Deprecated

    Use KdfId instead.

    +
  • Defined in src/identifiers.ts:54
  • +
  • Defined in src/identifiers.ts:65
  • +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/docs/types/KdfId.html b/docs/types/KdfId.html index 7f742357a..24e7b473a 100644 --- a/docs/types/KdfId.html +++ b/docs/types/KdfId.html @@ -1,13 +1,13 @@ -KdfId | hpke-js
    +KdfId | hpke-js
    -
    +
    @@ -20,65 +20,48 @@

    Type alias KdfId

    +
  • Defined in src/identifiers.ts:70
  • +
  • Defined in src/identifiers.ts:75
  • +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/docs/types/Kem.html b/docs/types/Kem.html index 8affc30c6..b7d07aa96 100644 --- a/docs/types/Kem.html +++ b/docs/types/Kem.html @@ -1,20 +1,20 @@ -Kem | hpke-js
    +Kem | hpke-js
    -
    +
    -

    Type alias Kem

    +

    Type alias Kem

    Kem: typeof Kem[keyof typeof Kem]

    The type alias of the supported KEM identifiers.

    @@ -22,65 +22,48 @@

    Type alias Kem

    Deprecated

    Use KdfId instead.

    +
  • Defined in src/identifiers.ts:21
  • +
  • Defined in src/identifiers.ts:37
  • +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/docs/types/KemId.html b/docs/types/KemId.html index 7bfdae968..51544ecf7 100644 --- a/docs/types/KemId.html +++ b/docs/types/KemId.html @@ -1,13 +1,13 @@ -KemId | hpke-js
    +KemId | hpke-js
    -
    +
    @@ -20,65 +20,48 @@

    Type alias KemId

    +
  • Defined in src/identifiers.ts:42
  • +
  • Defined in src/identifiers.ts:47
  • +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/docs/types/RecipientContext.html b/docs/types/RecipientContext.html index 66573779a..4d1c959f6 100644 --- a/docs/types/RecipientContext.html +++ b/docs/types/RecipientContext.html @@ -1,13 +1,13 @@ -RecipientContext | hpke-js
    +RecipientContext | hpke-js
    -
    +
    @@ -20,64 +20,47 @@

    Type alias RecipientContext

    +
  • Defined in src/interfaces/encryptionContext.ts:35
  • +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/docs/variables/Aead-1.html b/docs/variables/Aead-1.html index a366072d9..b88db38f1 100644 --- a/docs/variables/Aead-1.html +++ b/docs/variables/Aead-1.html @@ -1,20 +1,20 @@ -Aead | hpke-js
    +Aead | hpke-js
    -
    +
    -

    Variable AeadConst

    +

    Variable AeadConst

    Aead: {
        Aes128Gcm: 1;
        Aes256Gcm: 2;
        Chacha20Poly1305: 3;
        ExportOnly: 65535;
    } = ...

    The supported Authenticated Encryption with Associated Data (AEAD) identifiers.

    @@ -33,65 +33,48 @@
    Readonly AeadId instead.

    +
  • Defined in src/identifiers.ts:82
  • +
  • Defined in src/identifiers.ts:94
  • +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/docs/variables/AeadId-1.html b/docs/variables/AeadId-1.html index ff947550f..374b8c267 100644 --- a/docs/variables/AeadId-1.html +++ b/docs/variables/AeadId-1.html @@ -1,13 +1,13 @@ -AeadId | hpke-js
    +AeadId | hpke-js
    -
    +
    @@ -31,65 +31,48 @@
    Readonly Readonly ExportOnly: 65535
    +
  • Defined in src/identifiers.ts:99
  • +
  • Defined in src/identifiers.ts:104
  • +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/docs/variables/Kdf-1.html b/docs/variables/Kdf-1.html index 17447fb99..9998ee6dd 100644 --- a/docs/variables/Kdf-1.html +++ b/docs/variables/Kdf-1.html @@ -1,20 +1,20 @@ -Kdf | hpke-js
    +Kdf | hpke-js
    -
    +
    -

    Variable KdfConst

    +

    Variable KdfConst

    Kdf: {
        HkdfSha256: 1;
        HkdfSha384: 2;
        HkdfSha512: 3;
    } = ...

    The supported Key Derivation Function (KDF) identifiers.

    @@ -31,65 +31,48 @@
    Readonly KdfId instead.

    +
  • Defined in src/identifiers.ts:54
  • +
  • Defined in src/identifiers.ts:65
  • +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/docs/variables/KdfId-1.html b/docs/variables/KdfId-1.html index ed2da48ee..e2ed4d57b 100644 --- a/docs/variables/KdfId-1.html +++ b/docs/variables/KdfId-1.html @@ -1,13 +1,13 @@ -KdfId | hpke-js
    +KdfId | hpke-js
    -
    +
    @@ -29,65 +29,48 @@
    Readonly Readonly HkdfSha512: 3
    +
  • Defined in src/identifiers.ts:70
  • +
  • Defined in src/identifiers.ts:75
  • +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/docs/variables/Kem-1.html b/docs/variables/Kem-1.html index 6472777ca..fde56a69d 100644 --- a/docs/variables/Kem-1.html +++ b/docs/variables/Kem-1.html @@ -1,20 +1,20 @@ -Kem | hpke-js
    +Kem | hpke-js
    -
    +
    -

    Variable KemConst

    +

    Variable KemConst

    Kem: {
        DhkemP256HkdfSha256: 16;
        DhkemP384HkdfSha384: 17;
        DhkemP521HkdfSha512: 18;
        DhkemSecp256k1HkdfSha256: 19;
        DhkemX25519HkdfSha256: 32;
        DhkemX448HkdfSha512: 33;
        HybridkemX25519Kyber768: 48;
        NotAssigned: 0;
    } = ...

    The supported Key Encapsulation Mechanism (KEM) identifiers.

    @@ -41,65 +41,48 @@
    Readonly KdfId instead.

    +
  • Defined in src/identifiers.ts:21
  • +
  • Defined in src/identifiers.ts:37
  • +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/docs/variables/KemId-1.html b/docs/variables/KemId-1.html index a4c36e4df..d0bf8fb7f 100644 --- a/docs/variables/KemId-1.html +++ b/docs/variables/KemId-1.html @@ -1,13 +1,13 @@ -KemId | hpke-js
    +KemId | hpke-js
    -
    +
    @@ -39,65 +39,48 @@
    Readonly Readonly NotAssigned: 0
    +
  • Defined in src/identifiers.ts:42
  • +
  • Defined in src/identifiers.ts:47
  • +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/hybridkem-x25519-kyber768/docs/assets/main.js b/hybridkem-x25519-kyber768/docs/assets/main.js index 3cee05e61..01bcad55f 100644 --- a/hybridkem-x25519-kyber768/docs/assets/main.js +++ b/hybridkem-x25519-kyber768/docs/assets/main.js @@ -1,7 +1,8 @@ "use strict"; -"use strict";(()=>{var Se=Object.create;var re=Object.defineProperty;var we=Object.getOwnPropertyDescriptor;var Te=Object.getOwnPropertyNames;var ke=Object.getPrototypeOf,Qe=Object.prototype.hasOwnProperty;var Pe=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Ie=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Te(e))!Qe.call(t,i)&&i!==r&&re(t,i,{get:()=>e[i],enumerable:!(n=we(e,i))||n.enumerable});return t};var Ce=(t,e,r)=>(r=t!=null?Se(ke(t)):{},Ie(e||!t||!t.__esModule?re(r,"default",{value:t,enumerable:!0}):r,t));var ae=Pe((se,oe)=>{(function(){var t=function(e){var r=new t.Builder;return r.pipeline.add(t.trimmer,t.stopWordFilter,t.stemmer),r.searchPipeline.add(t.stemmer),e.call(r,r),r.build()};t.version="2.3.9";t.utils={},t.utils.warn=function(e){return function(r){e.console&&console.warn&&console.warn(r)}}(this),t.utils.asString=function(e){return e==null?"":e.toString()},t.utils.clone=function(e){if(e==null)return e;for(var r=Object.create(null),n=Object.keys(e),i=0;i0){var d=t.utils.clone(r)||{};d.position=[a,u],d.index=s.length,s.push(new t.Token(n.slice(a,o),d))}a=o+1}}return s},t.tokenizer.separator=/[\s\-]+/;t.Pipeline=function(){this._stack=[]},t.Pipeline.registeredFunctions=Object.create(null),t.Pipeline.registerFunction=function(e,r){r in this.registeredFunctions&&t.utils.warn("Overwriting existing registered function: "+r),e.label=r,t.Pipeline.registeredFunctions[e.label]=e},t.Pipeline.warnIfFunctionNotRegistered=function(e){var r=e.label&&e.label in this.registeredFunctions;r||t.utils.warn(`Function is not registered with pipeline. This may cause problems when serialising the index. -`,e)},t.Pipeline.load=function(e){var r=new t.Pipeline;return e.forEach(function(n){var i=t.Pipeline.registeredFunctions[n];if(i)r.add(i);else throw new Error("Cannot load unregistered function: "+n)}),r},t.Pipeline.prototype.add=function(){var e=Array.prototype.slice.call(arguments);e.forEach(function(r){t.Pipeline.warnIfFunctionNotRegistered(r),this._stack.push(r)},this)},t.Pipeline.prototype.after=function(e,r){t.Pipeline.warnIfFunctionNotRegistered(r);var n=this._stack.indexOf(e);if(n==-1)throw new Error("Cannot find existingFn");n=n+1,this._stack.splice(n,0,r)},t.Pipeline.prototype.before=function(e,r){t.Pipeline.warnIfFunctionNotRegistered(r);var n=this._stack.indexOf(e);if(n==-1)throw new Error("Cannot find existingFn");this._stack.splice(n,0,r)},t.Pipeline.prototype.remove=function(e){var r=this._stack.indexOf(e);r!=-1&&this._stack.splice(r,1)},t.Pipeline.prototype.run=function(e){for(var r=this._stack.length,n=0;n1&&(oe&&(n=s),o!=e);)i=n-r,s=r+Math.floor(i/2),o=this.elements[s*2];if(o==e||o>e)return s*2;if(ol?d+=2:a==l&&(r+=n[u+1]*i[d+1],u+=2,d+=2);return r},t.Vector.prototype.similarity=function(e){return this.dot(e)/this.magnitude()||0},t.Vector.prototype.toArray=function(){for(var e=new Array(this.elements.length/2),r=1,n=0;r0){var o=s.str.charAt(0),a;o in s.node.edges?a=s.node.edges[o]:(a=new t.TokenSet,s.node.edges[o]=a),s.str.length==1&&(a.final=!0),i.push({node:a,editsRemaining:s.editsRemaining,str:s.str.slice(1)})}if(s.editsRemaining!=0){if("*"in s.node.edges)var l=s.node.edges["*"];else{var l=new t.TokenSet;s.node.edges["*"]=l}if(s.str.length==0&&(l.final=!0),i.push({node:l,editsRemaining:s.editsRemaining-1,str:s.str}),s.str.length>1&&i.push({node:s.node,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)}),s.str.length==1&&(s.node.final=!0),s.str.length>=1){if("*"in s.node.edges)var u=s.node.edges["*"];else{var u=new t.TokenSet;s.node.edges["*"]=u}s.str.length==1&&(u.final=!0),i.push({node:u,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)})}if(s.str.length>1){var d=s.str.charAt(0),m=s.str.charAt(1),y;m in s.node.edges?y=s.node.edges[m]:(y=new t.TokenSet,s.node.edges[m]=y),s.str.length==1&&(y.final=!0),i.push({node:y,editsRemaining:s.editsRemaining-1,str:d+s.str.slice(2)})}}}return n},t.TokenSet.fromString=function(e){for(var r=new t.TokenSet,n=r,i=0,s=e.length;i=e;r--){var n=this.uncheckedNodes[r],i=n.child.toString();i in this.minimizedNodes?n.parent.edges[n.char]=this.minimizedNodes[i]:(n.child._str=i,this.minimizedNodes[i]=n.child),this.uncheckedNodes.pop()}};t.Index=function(e){this.invertedIndex=e.invertedIndex,this.fieldVectors=e.fieldVectors,this.tokenSet=e.tokenSet,this.fields=e.fields,this.pipeline=e.pipeline},t.Index.prototype.search=function(e){return this.query(function(r){var n=new t.QueryParser(e,r);n.parse()})},t.Index.prototype.query=function(e){for(var r=new t.Query(this.fields),n=Object.create(null),i=Object.create(null),s=Object.create(null),o=Object.create(null),a=Object.create(null),l=0;l1?this._b=1:this._b=e},t.Builder.prototype.k1=function(e){this._k1=e},t.Builder.prototype.add=function(e,r){var n=e[this._ref],i=Object.keys(this._fields);this._documents[n]=r||{},this.documentCount+=1;for(var s=0;s=this.length)return t.QueryLexer.EOS;var e=this.str.charAt(this.pos);return this.pos+=1,e},t.QueryLexer.prototype.width=function(){return this.pos-this.start},t.QueryLexer.prototype.ignore=function(){this.start==this.pos&&(this.pos+=1),this.start=this.pos},t.QueryLexer.prototype.backup=function(){this.pos-=1},t.QueryLexer.prototype.acceptDigitRun=function(){var e,r;do e=this.next(),r=e.charCodeAt(0);while(r>47&&r<58);e!=t.QueryLexer.EOS&&this.backup()},t.QueryLexer.prototype.more=function(){return this.pos1&&(e.backup(),e.emit(t.QueryLexer.TERM)),e.ignore(),e.more())return t.QueryLexer.lexText},t.QueryLexer.lexEditDistance=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(t.QueryLexer.EDIT_DISTANCE),t.QueryLexer.lexText},t.QueryLexer.lexBoost=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(t.QueryLexer.BOOST),t.QueryLexer.lexText},t.QueryLexer.lexEOS=function(e){e.width()>0&&e.emit(t.QueryLexer.TERM)},t.QueryLexer.termSeparator=t.tokenizer.separator,t.QueryLexer.lexText=function(e){for(;;){var r=e.next();if(r==t.QueryLexer.EOS)return t.QueryLexer.lexEOS;if(r.charCodeAt(0)==92){e.escapeCharacter();continue}if(r==":")return t.QueryLexer.lexField;if(r=="~")return e.backup(),e.width()>0&&e.emit(t.QueryLexer.TERM),t.QueryLexer.lexEditDistance;if(r=="^")return e.backup(),e.width()>0&&e.emit(t.QueryLexer.TERM),t.QueryLexer.lexBoost;if(r=="+"&&e.width()===1||r=="-"&&e.width()===1)return e.emit(t.QueryLexer.PRESENCE),t.QueryLexer.lexText;if(r.match(t.QueryLexer.termSeparator))return t.QueryLexer.lexTerm}},t.QueryParser=function(e,r){this.lexer=new t.QueryLexer(e),this.query=r,this.currentClause={},this.lexemeIdx=0},t.QueryParser.prototype.parse=function(){this.lexer.run(),this.lexemes=this.lexer.lexemes;for(var e=t.QueryParser.parseClause;e;)e=e(this);return this.query},t.QueryParser.prototype.peekLexeme=function(){return this.lexemes[this.lexemeIdx]},t.QueryParser.prototype.consumeLexeme=function(){var e=this.peekLexeme();return this.lexemeIdx+=1,e},t.QueryParser.prototype.nextClause=function(){var e=this.currentClause;this.query.clause(e),this.currentClause={}},t.QueryParser.parseClause=function(e){var r=e.peekLexeme();if(r!=null)switch(r.type){case t.QueryLexer.PRESENCE:return t.QueryParser.parsePresence;case t.QueryLexer.FIELD:return t.QueryParser.parseField;case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var n="expected either a field or a term, found "+r.type;throw r.str.length>=1&&(n+=" with value '"+r.str+"'"),new t.QueryParseError(n,r.start,r.end)}},t.QueryParser.parsePresence=function(e){var r=e.consumeLexeme();if(r!=null){switch(r.str){case"-":e.currentClause.presence=t.Query.presence.PROHIBITED;break;case"+":e.currentClause.presence=t.Query.presence.REQUIRED;break;default:var n="unrecognised presence operator'"+r.str+"'";throw new t.QueryParseError(n,r.start,r.end)}var i=e.peekLexeme();if(i==null){var n="expecting term or field, found nothing";throw new t.QueryParseError(n,r.start,r.end)}switch(i.type){case t.QueryLexer.FIELD:return t.QueryParser.parseField;case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var n="expecting term or field, found '"+i.type+"'";throw new t.QueryParseError(n,i.start,i.end)}}},t.QueryParser.parseField=function(e){var r=e.consumeLexeme();if(r!=null){if(e.query.allFields.indexOf(r.str)==-1){var n=e.query.allFields.map(function(o){return"'"+o+"'"}).join(", "),i="unrecognised field '"+r.str+"', possible fields: "+n;throw new t.QueryParseError(i,r.start,r.end)}e.currentClause.fields=[r.str];var s=e.peekLexeme();if(s==null){var i="expecting term, found nothing";throw new t.QueryParseError(i,r.start,r.end)}switch(s.type){case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var i="expecting term, found '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},t.QueryParser.parseTerm=function(e){var r=e.consumeLexeme();if(r!=null){e.currentClause.term=r.str.toLowerCase(),r.str.indexOf("*")!=-1&&(e.currentClause.usePipeline=!1);var n=e.peekLexeme();if(n==null){e.nextClause();return}switch(n.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+n.type+"'";throw new t.QueryParseError(i,n.start,n.end)}}},t.QueryParser.parseEditDistance=function(e){var r=e.consumeLexeme();if(r!=null){var n=parseInt(r.str,10);if(isNaN(n)){var i="edit distance must be numeric";throw new t.QueryParseError(i,r.start,r.end)}e.currentClause.editDistance=n;var s=e.peekLexeme();if(s==null){e.nextClause();return}switch(s.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},t.QueryParser.parseBoost=function(e){var r=e.consumeLexeme();if(r!=null){var n=parseInt(r.str,10);if(isNaN(n)){var i="boost must be numeric";throw new t.QueryParseError(i,r.start,r.end)}e.currentClause.boost=n;var s=e.peekLexeme();if(s==null){e.nextClause();return}switch(s.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},function(e,r){typeof define=="function"&&define.amd?define(r):typeof se=="object"?oe.exports=r():e.lunr=r()}(this,function(){return t})})()});var ne=[];function G(t,e){ne.push({selector:e,constructor:t})}var U=class{constructor(){this.alwaysVisibleMember=null;this.createComponents(document.body),this.ensureActivePageVisible(),this.ensureFocusedElementVisible(),this.listenForCodeCopies(),window.addEventListener("hashchange",()=>this.ensureFocusedElementVisible())}createComponents(e){ne.forEach(r=>{e.querySelectorAll(r.selector).forEach(n=>{n.dataset.hasInstance||(new r.constructor({el:n,app:this}),n.dataset.hasInstance=String(!0))})})}filterChanged(){this.ensureFocusedElementVisible()}ensureActivePageVisible(){let e=document.querySelector(".tsd-navigation .current"),r=e?.parentElement;for(;r&&!r.classList.contains(".tsd-navigation");)r instanceof HTMLDetailsElement&&(r.open=!0),r=r.parentElement;if(e){let n=e.getBoundingClientRect().top-document.documentElement.clientHeight/4;document.querySelector(".site-menu").scrollTop=n}}ensureFocusedElementVisible(){if(this.alwaysVisibleMember&&(this.alwaysVisibleMember.classList.remove("always-visible"),this.alwaysVisibleMember.firstElementChild.remove(),this.alwaysVisibleMember=null),!location.hash)return;let e=document.getElementById(location.hash.substring(1));if(!e)return;let r=e.parentElement;for(;r&&r.tagName!=="SECTION";)r=r.parentElement;if(r&&r.offsetParent==null){this.alwaysVisibleMember=r,r.classList.add("always-visible");let n=document.createElement("p");n.classList.add("warning"),n.textContent="This member is normally hidden due to your filter settings.",r.prepend(n)}}listenForCodeCopies(){document.querySelectorAll("pre > button").forEach(e=>{let r;e.addEventListener("click",()=>{e.previousElementSibling instanceof HTMLElement&&navigator.clipboard.writeText(e.previousElementSibling.innerText.trim()),e.textContent="Copied!",e.classList.add("visible"),clearTimeout(r),r=setTimeout(()=>{e.classList.remove("visible"),r=setTimeout(()=>{e.textContent="Copy"},100)},1e3)})})}};var ie=(t,e=100)=>{let r;return()=>{clearTimeout(r),r=setTimeout(()=>t(),e)}};var ce=Ce(ae());function de(){let t=document.getElementById("tsd-search");if(!t)return;let e=document.getElementById("tsd-search-script");t.classList.add("loading"),e&&(e.addEventListener("error",()=>{t.classList.remove("loading"),t.classList.add("failure")}),e.addEventListener("load",()=>{t.classList.remove("loading"),t.classList.add("ready")}),window.searchData&&t.classList.remove("loading"));let r=document.querySelector("#tsd-search input"),n=document.querySelector("#tsd-search .results");if(!r||!n)throw new Error("The input field or the result list wrapper was not found");let i=!1;n.addEventListener("mousedown",()=>i=!0),n.addEventListener("mouseup",()=>{i=!1,t.classList.remove("has-focus")}),r.addEventListener("focus",()=>t.classList.add("has-focus")),r.addEventListener("blur",()=>{i||(i=!1,t.classList.remove("has-focus"))});let s={base:t.dataset.base+"/"};Oe(t,n,r,s)}function Oe(t,e,r,n){r.addEventListener("input",ie(()=>{Re(t,e,r,n)},200));let i=!1;r.addEventListener("keydown",s=>{i=!0,s.key=="Enter"?Fe(e,r):s.key=="Escape"?r.blur():s.key=="ArrowUp"?ue(e,-1):s.key==="ArrowDown"?ue(e,1):i=!1}),r.addEventListener("keypress",s=>{i&&s.preventDefault()}),document.body.addEventListener("keydown",s=>{s.altKey||s.ctrlKey||s.metaKey||!r.matches(":focus")&&s.key==="/"&&(r.focus(),s.preventDefault())})}function _e(t,e){t.index||window.searchData&&(e.classList.remove("loading"),e.classList.add("ready"),t.data=window.searchData,t.index=ce.Index.load(window.searchData.index))}function Re(t,e,r,n){if(_e(n,t),!n.index||!n.data)return;e.textContent="";let i=r.value.trim(),s=i?n.index.search(`*${i}*`):[];for(let o=0;oa.score-o.score);for(let o=0,a=Math.min(10,s.length);o${le(l.parent,i)}.${u}`);let d=document.createElement("li");d.classList.value=l.classes??"";let m=document.createElement("a");m.href=n.base+l.url,m.innerHTML=u,d.append(m),e.appendChild(d)}}function ue(t,e){let r=t.querySelector(".current");if(!r)r=t.querySelector(e==1?"li:first-child":"li:last-child"),r&&r.classList.add("current");else{let n=r;if(e===1)do n=n.nextElementSibling??void 0;while(n instanceof HTMLElement&&n.offsetParent==null);else do n=n.previousElementSibling??void 0;while(n instanceof HTMLElement&&n.offsetParent==null);n&&(r.classList.remove("current"),n.classList.add("current"))}}function Fe(t,e){let r=t.querySelector(".current");if(r||(r=t.querySelector("li:first-child")),r){let n=r.querySelector("a");n&&(window.location.href=n.href),e.blur()}}function le(t,e){if(e==="")return t;let r=t.toLocaleLowerCase(),n=e.toLocaleLowerCase(),i=[],s=0,o=r.indexOf(n);for(;o!=-1;)i.push(K(t.substring(s,o)),`${K(t.substring(o,o+n.length))}`),s=o+n.length,o=r.indexOf(n,s);return i.push(K(t.substring(s))),i.join("")}var Me={"&":"&","<":"<",">":">","'":"'",'"':"""};function K(t){return t.replace(/[&<>"'"]/g,e=>Me[e])}var P=class{constructor(e){this.el=e.el,this.app=e.app}};var M="mousedown",fe="mousemove",N="mouseup",J={x:0,y:0},he=!1,ee=!1,De=!1,D=!1,pe=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);document.documentElement.classList.add(pe?"is-mobile":"not-mobile");pe&&"ontouchstart"in document.documentElement&&(De=!0,M="touchstart",fe="touchmove",N="touchend");document.addEventListener(M,t=>{ee=!0,D=!1;let e=M=="touchstart"?t.targetTouches[0]:t;J.y=e.pageY||0,J.x=e.pageX||0});document.addEventListener(fe,t=>{if(ee&&!D){let e=M=="touchstart"?t.targetTouches[0]:t,r=J.x-(e.pageX||0),n=J.y-(e.pageY||0);D=Math.sqrt(r*r+n*n)>10}});document.addEventListener(N,()=>{ee=!1});document.addEventListener("click",t=>{he&&(t.preventDefault(),t.stopImmediatePropagation(),he=!1)});var X=class extends P{constructor(r){super(r);this.className=this.el.dataset.toggle||"",this.el.addEventListener(N,n=>this.onPointerUp(n)),this.el.addEventListener("click",n=>n.preventDefault()),document.addEventListener(M,n=>this.onDocumentPointerDown(n)),document.addEventListener(N,n=>this.onDocumentPointerUp(n))}setActive(r){if(this.active==r)return;this.active=r,document.documentElement.classList.toggle("has-"+this.className,r),this.el.classList.toggle("active",r);let n=(this.active?"to-has-":"from-has-")+this.className;document.documentElement.classList.add(n),setTimeout(()=>document.documentElement.classList.remove(n),500)}onPointerUp(r){D||(this.setActive(!0),r.preventDefault())}onDocumentPointerDown(r){if(this.active){if(r.target.closest(".col-sidebar, .tsd-filter-group"))return;this.setActive(!1)}}onDocumentPointerUp(r){if(!D&&this.active&&r.target.closest(".col-sidebar")){let n=r.target.closest("a");if(n){let i=window.location.href;i.indexOf("#")!=-1&&(i=i.substring(0,i.indexOf("#"))),n.href.substring(0,i.length)==i&&setTimeout(()=>this.setActive(!1),250)}}}};var te;try{te=localStorage}catch{te={getItem(){return null},setItem(){}}}var Q=te;var me=document.head.appendChild(document.createElement("style"));me.dataset.for="filters";var Y=class extends P{constructor(r){super(r);this.key=`filter-${this.el.name}`,this.value=this.el.checked,this.el.addEventListener("change",()=>{this.setLocalStorage(this.el.checked)}),this.setLocalStorage(this.fromLocalStorage()),me.innerHTML+=`html:not(.${this.key}) .tsd-is-${this.el.name} { display: none; } -`}fromLocalStorage(){let r=Q.getItem(this.key);return r?r==="true":this.el.checked}setLocalStorage(r){Q.setItem(this.key,r.toString()),this.value=r,this.handleValueChange()}handleValueChange(){this.el.checked=this.value,document.documentElement.classList.toggle(this.key,this.value),this.app.filterChanged(),document.querySelectorAll(".tsd-index-section").forEach(r=>{r.style.display="block";let n=Array.from(r.querySelectorAll(".tsd-index-link")).every(i=>i.offsetParent==null);r.style.display=n?"none":"block"})}};var Z=class extends P{constructor(r){super(r);this.summary=this.el.querySelector(".tsd-accordion-summary"),this.icon=this.summary.querySelector("svg"),this.key=`tsd-accordion-${this.summary.dataset.key??this.summary.textContent.trim().replace(/\s+/g,"-").toLowerCase()}`;let n=Q.getItem(this.key);this.el.open=n?n==="true":this.el.open,this.el.addEventListener("toggle",()=>this.update()),this.update()}update(){this.icon.style.transform=`rotate(${this.el.open?0:-90}deg)`,Q.setItem(this.key,this.el.open.toString())}};function ve(t){let e=Q.getItem("tsd-theme")||"os";t.value=e,ye(e),t.addEventListener("change",()=>{Q.setItem("tsd-theme",t.value),ye(t.value)})}function ye(t){document.documentElement.dataset.theme=t}de();G(X,"a[data-toggle]");G(Z,".tsd-index-accordion");G(Y,".tsd-filter-item input[type=checkbox]");var ge=document.getElementById("tsd-theme");ge&&ve(ge);var Ae=new U;Object.defineProperty(window,"app",{value:Ae});document.querySelectorAll("summary a").forEach(t=>{t.addEventListener("click",()=>{location.assign(t.href)})});})(); +"use strict";(()=>{var Pe=Object.create;var ne=Object.defineProperty;var Ie=Object.getOwnPropertyDescriptor;var Oe=Object.getOwnPropertyNames;var _e=Object.getPrototypeOf,Re=Object.prototype.hasOwnProperty;var Me=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Fe=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Oe(e))!Re.call(t,i)&&i!==n&&ne(t,i,{get:()=>e[i],enumerable:!(r=Ie(e,i))||r.enumerable});return t};var De=(t,e,n)=>(n=t!=null?Pe(_e(t)):{},Fe(e||!t||!t.__esModule?ne(n,"default",{value:t,enumerable:!0}):n,t));var ae=Me((se,oe)=>{(function(){var t=function(e){var n=new t.Builder;return n.pipeline.add(t.trimmer,t.stopWordFilter,t.stemmer),n.searchPipeline.add(t.stemmer),e.call(n,n),n.build()};t.version="2.3.9";t.utils={},t.utils.warn=function(e){return function(n){e.console&&console.warn&&console.warn(n)}}(this),t.utils.asString=function(e){return e==null?"":e.toString()},t.utils.clone=function(e){if(e==null)return e;for(var n=Object.create(null),r=Object.keys(e),i=0;i0){var d=t.utils.clone(n)||{};d.position=[a,u],d.index=s.length,s.push(new t.Token(r.slice(a,o),d))}a=o+1}}return s},t.tokenizer.separator=/[\s\-]+/;t.Pipeline=function(){this._stack=[]},t.Pipeline.registeredFunctions=Object.create(null),t.Pipeline.registerFunction=function(e,n){n in this.registeredFunctions&&t.utils.warn("Overwriting existing registered function: "+n),e.label=n,t.Pipeline.registeredFunctions[e.label]=e},t.Pipeline.warnIfFunctionNotRegistered=function(e){var n=e.label&&e.label in this.registeredFunctions;n||t.utils.warn(`Function is not registered with pipeline. This may cause problems when serialising the index. +`,e)},t.Pipeline.load=function(e){var n=new t.Pipeline;return e.forEach(function(r){var i=t.Pipeline.registeredFunctions[r];if(i)n.add(i);else throw new Error("Cannot load unregistered function: "+r)}),n},t.Pipeline.prototype.add=function(){var e=Array.prototype.slice.call(arguments);e.forEach(function(n){t.Pipeline.warnIfFunctionNotRegistered(n),this._stack.push(n)},this)},t.Pipeline.prototype.after=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var r=this._stack.indexOf(e);if(r==-1)throw new Error("Cannot find existingFn");r=r+1,this._stack.splice(r,0,n)},t.Pipeline.prototype.before=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var r=this._stack.indexOf(e);if(r==-1)throw new Error("Cannot find existingFn");this._stack.splice(r,0,n)},t.Pipeline.prototype.remove=function(e){var n=this._stack.indexOf(e);n!=-1&&this._stack.splice(n,1)},t.Pipeline.prototype.run=function(e){for(var n=this._stack.length,r=0;r1&&(oe&&(r=s),o!=e);)i=r-n,s=n+Math.floor(i/2),o=this.elements[s*2];if(o==e||o>e)return s*2;if(ol?d+=2:a==l&&(n+=r[u+1]*i[d+1],u+=2,d+=2);return n},t.Vector.prototype.similarity=function(e){return this.dot(e)/this.magnitude()||0},t.Vector.prototype.toArray=function(){for(var e=new Array(this.elements.length/2),n=1,r=0;n0){var o=s.str.charAt(0),a;o in s.node.edges?a=s.node.edges[o]:(a=new t.TokenSet,s.node.edges[o]=a),s.str.length==1&&(a.final=!0),i.push({node:a,editsRemaining:s.editsRemaining,str:s.str.slice(1)})}if(s.editsRemaining!=0){if("*"in s.node.edges)var l=s.node.edges["*"];else{var l=new t.TokenSet;s.node.edges["*"]=l}if(s.str.length==0&&(l.final=!0),i.push({node:l,editsRemaining:s.editsRemaining-1,str:s.str}),s.str.length>1&&i.push({node:s.node,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)}),s.str.length==1&&(s.node.final=!0),s.str.length>=1){if("*"in s.node.edges)var u=s.node.edges["*"];else{var u=new t.TokenSet;s.node.edges["*"]=u}s.str.length==1&&(u.final=!0),i.push({node:u,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)})}if(s.str.length>1){var d=s.str.charAt(0),v=s.str.charAt(1),f;v in s.node.edges?f=s.node.edges[v]:(f=new t.TokenSet,s.node.edges[v]=f),s.str.length==1&&(f.final=!0),i.push({node:f,editsRemaining:s.editsRemaining-1,str:d+s.str.slice(2)})}}}return r},t.TokenSet.fromString=function(e){for(var n=new t.TokenSet,r=n,i=0,s=e.length;i=e;n--){var r=this.uncheckedNodes[n],i=r.child.toString();i in this.minimizedNodes?r.parent.edges[r.char]=this.minimizedNodes[i]:(r.child._str=i,this.minimizedNodes[i]=r.child),this.uncheckedNodes.pop()}};t.Index=function(e){this.invertedIndex=e.invertedIndex,this.fieldVectors=e.fieldVectors,this.tokenSet=e.tokenSet,this.fields=e.fields,this.pipeline=e.pipeline},t.Index.prototype.search=function(e){return this.query(function(n){var r=new t.QueryParser(e,n);r.parse()})},t.Index.prototype.query=function(e){for(var n=new t.Query(this.fields),r=Object.create(null),i=Object.create(null),s=Object.create(null),o=Object.create(null),a=Object.create(null),l=0;l1?this._b=1:this._b=e},t.Builder.prototype.k1=function(e){this._k1=e},t.Builder.prototype.add=function(e,n){var r=e[this._ref],i=Object.keys(this._fields);this._documents[r]=n||{},this.documentCount+=1;for(var s=0;s=this.length)return t.QueryLexer.EOS;var e=this.str.charAt(this.pos);return this.pos+=1,e},t.QueryLexer.prototype.width=function(){return this.pos-this.start},t.QueryLexer.prototype.ignore=function(){this.start==this.pos&&(this.pos+=1),this.start=this.pos},t.QueryLexer.prototype.backup=function(){this.pos-=1},t.QueryLexer.prototype.acceptDigitRun=function(){var e,n;do e=this.next(),n=e.charCodeAt(0);while(n>47&&n<58);e!=t.QueryLexer.EOS&&this.backup()},t.QueryLexer.prototype.more=function(){return this.pos1&&(e.backup(),e.emit(t.QueryLexer.TERM)),e.ignore(),e.more())return t.QueryLexer.lexText},t.QueryLexer.lexEditDistance=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(t.QueryLexer.EDIT_DISTANCE),t.QueryLexer.lexText},t.QueryLexer.lexBoost=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(t.QueryLexer.BOOST),t.QueryLexer.lexText},t.QueryLexer.lexEOS=function(e){e.width()>0&&e.emit(t.QueryLexer.TERM)},t.QueryLexer.termSeparator=t.tokenizer.separator,t.QueryLexer.lexText=function(e){for(;;){var n=e.next();if(n==t.QueryLexer.EOS)return t.QueryLexer.lexEOS;if(n.charCodeAt(0)==92){e.escapeCharacter();continue}if(n==":")return t.QueryLexer.lexField;if(n=="~")return e.backup(),e.width()>0&&e.emit(t.QueryLexer.TERM),t.QueryLexer.lexEditDistance;if(n=="^")return e.backup(),e.width()>0&&e.emit(t.QueryLexer.TERM),t.QueryLexer.lexBoost;if(n=="+"&&e.width()===1||n=="-"&&e.width()===1)return e.emit(t.QueryLexer.PRESENCE),t.QueryLexer.lexText;if(n.match(t.QueryLexer.termSeparator))return t.QueryLexer.lexTerm}},t.QueryParser=function(e,n){this.lexer=new t.QueryLexer(e),this.query=n,this.currentClause={},this.lexemeIdx=0},t.QueryParser.prototype.parse=function(){this.lexer.run(),this.lexemes=this.lexer.lexemes;for(var e=t.QueryParser.parseClause;e;)e=e(this);return this.query},t.QueryParser.prototype.peekLexeme=function(){return this.lexemes[this.lexemeIdx]},t.QueryParser.prototype.consumeLexeme=function(){var e=this.peekLexeme();return this.lexemeIdx+=1,e},t.QueryParser.prototype.nextClause=function(){var e=this.currentClause;this.query.clause(e),this.currentClause={}},t.QueryParser.parseClause=function(e){var n=e.peekLexeme();if(n!=null)switch(n.type){case t.QueryLexer.PRESENCE:return t.QueryParser.parsePresence;case t.QueryLexer.FIELD:return t.QueryParser.parseField;case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var r="expected either a field or a term, found "+n.type;throw n.str.length>=1&&(r+=" with value '"+n.str+"'"),new t.QueryParseError(r,n.start,n.end)}},t.QueryParser.parsePresence=function(e){var n=e.consumeLexeme();if(n!=null){switch(n.str){case"-":e.currentClause.presence=t.Query.presence.PROHIBITED;break;case"+":e.currentClause.presence=t.Query.presence.REQUIRED;break;default:var r="unrecognised presence operator'"+n.str+"'";throw new t.QueryParseError(r,n.start,n.end)}var i=e.peekLexeme();if(i==null){var r="expecting term or field, found nothing";throw new t.QueryParseError(r,n.start,n.end)}switch(i.type){case t.QueryLexer.FIELD:return t.QueryParser.parseField;case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var r="expecting term or field, found '"+i.type+"'";throw new t.QueryParseError(r,i.start,i.end)}}},t.QueryParser.parseField=function(e){var n=e.consumeLexeme();if(n!=null){if(e.query.allFields.indexOf(n.str)==-1){var r=e.query.allFields.map(function(o){return"'"+o+"'"}).join(", "),i="unrecognised field '"+n.str+"', possible fields: "+r;throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.fields=[n.str];var s=e.peekLexeme();if(s==null){var i="expecting term, found nothing";throw new t.QueryParseError(i,n.start,n.end)}switch(s.type){case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var i="expecting term, found '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},t.QueryParser.parseTerm=function(e){var n=e.consumeLexeme();if(n!=null){e.currentClause.term=n.str.toLowerCase(),n.str.indexOf("*")!=-1&&(e.currentClause.usePipeline=!1);var r=e.peekLexeme();if(r==null){e.nextClause();return}switch(r.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+r.type+"'";throw new t.QueryParseError(i,r.start,r.end)}}},t.QueryParser.parseEditDistance=function(e){var n=e.consumeLexeme();if(n!=null){var r=parseInt(n.str,10);if(isNaN(r)){var i="edit distance must be numeric";throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.editDistance=r;var s=e.peekLexeme();if(s==null){e.nextClause();return}switch(s.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},t.QueryParser.parseBoost=function(e){var n=e.consumeLexeme();if(n!=null){var r=parseInt(n.str,10);if(isNaN(r)){var i="boost must be numeric";throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.boost=r;var s=e.peekLexeme();if(s==null){e.nextClause();return}switch(s.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},function(e,n){typeof define=="function"&&define.amd?define(n):typeof se=="object"?oe.exports=n():e.lunr=n()}(this,function(){return t})})()});var re=[];function G(t,e){re.push({selector:e,constructor:t})}var U=class{constructor(){this.alwaysVisibleMember=null;this.createComponents(document.body),this.ensureActivePageVisible(),this.ensureFocusedElementVisible(),this.listenForCodeCopies(),window.addEventListener("hashchange",()=>this.ensureFocusedElementVisible())}createComponents(e){re.forEach(n=>{e.querySelectorAll(n.selector).forEach(r=>{r.dataset.hasInstance||(new n.constructor({el:r,app:this}),r.dataset.hasInstance=String(!0))})})}filterChanged(){this.ensureFocusedElementVisible()}ensureActivePageVisible(){let e=document.querySelector(".tsd-navigation .current"),n=e?.parentElement;for(;n&&!n.classList.contains(".tsd-navigation");)n instanceof HTMLDetailsElement&&(n.open=!0),n=n.parentElement;if(e){let r=e.getBoundingClientRect().top-document.documentElement.clientHeight/4;document.querySelector(".site-menu").scrollTop=r}}ensureFocusedElementVisible(){if(this.alwaysVisibleMember&&(this.alwaysVisibleMember.classList.remove("always-visible"),this.alwaysVisibleMember.firstElementChild.remove(),this.alwaysVisibleMember=null),!location.hash)return;let e=document.getElementById(location.hash.substring(1));if(!e)return;let n=e.parentElement;for(;n&&n.tagName!=="SECTION";)n=n.parentElement;if(n&&n.offsetParent==null){this.alwaysVisibleMember=n,n.classList.add("always-visible");let r=document.createElement("p");r.classList.add("warning"),r.textContent="This member is normally hidden due to your filter settings.",n.prepend(r)}}listenForCodeCopies(){document.querySelectorAll("pre > button").forEach(e=>{let n;e.addEventListener("click",()=>{e.previousElementSibling instanceof HTMLElement&&navigator.clipboard.writeText(e.previousElementSibling.innerText.trim()),e.textContent="Copied!",e.classList.add("visible"),clearTimeout(n),n=setTimeout(()=>{e.classList.remove("visible"),n=setTimeout(()=>{e.textContent="Copy"},100)},1e3)})})}};var ie=(t,e=100)=>{let n;return()=>{clearTimeout(n),n=setTimeout(()=>t(),e)}};var de=De(ae());async function le(t,e){if(!window.searchData)return;let n=await fetch(window.searchData),r=new Blob([await n.arrayBuffer()]).stream().pipeThrough(new DecompressionStream("gzip")),i=await new Response(r).json();t.data=i,t.index=de.Index.load(i.index),e.classList.remove("loading"),e.classList.add("ready")}function he(){let t=document.getElementById("tsd-search");if(!t)return;let e={base:t.dataset.base+"/"},n=document.getElementById("tsd-search-script");t.classList.add("loading"),n&&(n.addEventListener("error",()=>{t.classList.remove("loading"),t.classList.add("failure")}),n.addEventListener("load",()=>{le(e,t)}),le(e,t));let r=document.querySelector("#tsd-search input"),i=document.querySelector("#tsd-search .results");if(!r||!i)throw new Error("The input field or the result list wrapper was not found");let s=!1;i.addEventListener("mousedown",()=>s=!0),i.addEventListener("mouseup",()=>{s=!1,t.classList.remove("has-focus")}),r.addEventListener("focus",()=>t.classList.add("has-focus")),r.addEventListener("blur",()=>{s||(s=!1,t.classList.remove("has-focus"))}),Ae(t,i,r,e)}function Ae(t,e,n,r){n.addEventListener("input",ie(()=>{Ne(t,e,n,r)},200));let i=!1;n.addEventListener("keydown",s=>{i=!0,s.key=="Enter"?Ve(e,n):s.key=="Escape"?n.blur():s.key=="ArrowUp"?ue(e,-1):s.key==="ArrowDown"?ue(e,1):i=!1}),n.addEventListener("keypress",s=>{i&&s.preventDefault()}),document.body.addEventListener("keydown",s=>{s.altKey||s.ctrlKey||s.metaKey||!n.matches(":focus")&&s.key==="/"&&(n.focus(),s.preventDefault())})}function Ne(t,e,n,r){if(!r.index||!r.data)return;e.textContent="";let i=n.value.trim(),s=i?r.index.search(`*${i}*`):[];for(let o=0;oa.score-o.score);for(let o=0,a=Math.min(10,s.length);o`,d=ce(l.name,i);globalThis.DEBUG_SEARCH_WEIGHTS&&(d+=` (score: ${s[o].score.toFixed(2)})`),l.parent&&(d=` + ${ce(l.parent,i)}.${d}`);let v=document.createElement("li");v.classList.value=l.classes??"";let f=document.createElement("a");f.href=r.base+l.url,f.innerHTML=u+d,v.append(f),e.appendChild(v)}}function ue(t,e){let n=t.querySelector(".current");if(!n)n=t.querySelector(e==1?"li:first-child":"li:last-child"),n&&n.classList.add("current");else{let r=n;if(e===1)do r=r.nextElementSibling??void 0;while(r instanceof HTMLElement&&r.offsetParent==null);else do r=r.previousElementSibling??void 0;while(r instanceof HTMLElement&&r.offsetParent==null);r&&(n.classList.remove("current"),r.classList.add("current"))}}function Ve(t,e){let n=t.querySelector(".current");if(n||(n=t.querySelector("li:first-child")),n){let r=n.querySelector("a");r&&(window.location.href=r.href),e.blur()}}function ce(t,e){if(e==="")return t;let n=t.toLocaleLowerCase(),r=e.toLocaleLowerCase(),i=[],s=0,o=n.indexOf(r);for(;o!=-1;)i.push(K(t.substring(s,o)),`${K(t.substring(o,o+r.length))}`),s=o+r.length,o=n.indexOf(r,s);return i.push(K(t.substring(s))),i.join("")}var Be={"&":"&","<":"<",">":">","'":"'",'"':"""};function K(t){return t.replace(/[&<>"'"]/g,e=>Be[e])}var C=class{constructor(e){this.el=e.el,this.app=e.app}};var F="mousedown",pe="mousemove",B="mouseup",J={x:0,y:0},fe=!1,ee=!1,He=!1,D=!1,me=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);document.documentElement.classList.add(me?"is-mobile":"not-mobile");me&&"ontouchstart"in document.documentElement&&(He=!0,F="touchstart",pe="touchmove",B="touchend");document.addEventListener(F,t=>{ee=!0,D=!1;let e=F=="touchstart"?t.targetTouches[0]:t;J.y=e.pageY||0,J.x=e.pageX||0});document.addEventListener(pe,t=>{if(ee&&!D){let e=F=="touchstart"?t.targetTouches[0]:t,n=J.x-(e.pageX||0),r=J.y-(e.pageY||0);D=Math.sqrt(n*n+r*r)>10}});document.addEventListener(B,()=>{ee=!1});document.addEventListener("click",t=>{fe&&(t.preventDefault(),t.stopImmediatePropagation(),fe=!1)});var X=class extends C{constructor(n){super(n);this.className=this.el.dataset.toggle||"",this.el.addEventListener(B,r=>this.onPointerUp(r)),this.el.addEventListener("click",r=>r.preventDefault()),document.addEventListener(F,r=>this.onDocumentPointerDown(r)),document.addEventListener(B,r=>this.onDocumentPointerUp(r))}setActive(n){if(this.active==n)return;this.active=n,document.documentElement.classList.toggle("has-"+this.className,n),this.el.classList.toggle("active",n);let r=(this.active?"to-has-":"from-has-")+this.className;document.documentElement.classList.add(r),setTimeout(()=>document.documentElement.classList.remove(r),500)}onPointerUp(n){D||(this.setActive(!0),n.preventDefault())}onDocumentPointerDown(n){if(this.active){if(n.target.closest(".col-sidebar, .tsd-filter-group"))return;this.setActive(!1)}}onDocumentPointerUp(n){if(!D&&this.active&&n.target.closest(".col-sidebar")){let r=n.target.closest("a");if(r){let i=window.location.href;i.indexOf("#")!=-1&&(i=i.substring(0,i.indexOf("#"))),r.href.substring(0,i.length)==i&&setTimeout(()=>this.setActive(!1),250)}}}};var te;try{te=localStorage}catch{te={getItem(){return null},setItem(){}}}var Q=te;var ve=document.head.appendChild(document.createElement("style"));ve.dataset.for="filters";var Y=class extends C{constructor(n){super(n);this.key=`filter-${this.el.name}`,this.value=this.el.checked,this.el.addEventListener("change",()=>{this.setLocalStorage(this.el.checked)}),this.setLocalStorage(this.fromLocalStorage()),ve.innerHTML+=`html:not(.${this.key}) .tsd-is-${this.el.name} { display: none; } +`}fromLocalStorage(){let n=Q.getItem(this.key);return n?n==="true":this.el.checked}setLocalStorage(n){Q.setItem(this.key,n.toString()),this.value=n,this.handleValueChange()}handleValueChange(){this.el.checked=this.value,document.documentElement.classList.toggle(this.key,this.value),this.app.filterChanged(),document.querySelectorAll(".tsd-index-section").forEach(n=>{n.style.display="block";let r=Array.from(n.querySelectorAll(".tsd-index-link")).every(i=>i.offsetParent==null);n.style.display=r?"none":"block"})}};var Z=class extends C{constructor(n){super(n);this.summary=this.el.querySelector(".tsd-accordion-summary"),this.icon=this.summary.querySelector("svg"),this.key=`tsd-accordion-${this.summary.dataset.key??this.summary.textContent.trim().replace(/\s+/g,"-").toLowerCase()}`;let r=Q.getItem(this.key);this.el.open=r?r==="true":this.el.open,this.el.addEventListener("toggle",()=>this.update());let i=this.summary.querySelector("a");i&&i.addEventListener("click",()=>{location.assign(i.href)}),this.update()}update(){this.icon.style.transform=`rotate(${this.el.open?0:-90}deg)`,Q.setItem(this.key,this.el.open.toString())}};function ge(t){let e=Q.getItem("tsd-theme")||"os";t.value=e,ye(e),t.addEventListener("change",()=>{Q.setItem("tsd-theme",t.value),ye(t.value)})}function ye(t){document.documentElement.dataset.theme=t}var Le;function be(){let t=document.getElementById("tsd-nav-script");t&&(t.addEventListener("load",xe),xe())}async function xe(){let t=document.getElementById("tsd-nav-container");if(!t||!window.navigationData)return;let n=await(await fetch(window.navigationData)).arrayBuffer(),r=new Blob([n]).stream().pipeThrough(new DecompressionStream("gzip")),i=await new Response(r).json();Le=t.dataset.base+"/",t.innerHTML="";for(let s of i)we(s,t,[]);window.app.createComponents(t),window.app.ensureActivePageVisible()}function we(t,e,n){let r=e.appendChild(document.createElement("li"));if(t.children){let i=[...n,t.text],s=r.appendChild(document.createElement("details"));s.className=t.class?`${t.class} tsd-index-accordion`:"tsd-index-accordion",s.dataset.key=i.join("$");let o=s.appendChild(document.createElement("summary"));o.className="tsd-accordion-summary",o.innerHTML='',Ee(t,o);let a=s.appendChild(document.createElement("div"));a.className="tsd-accordion-details";let l=a.appendChild(document.createElement("ul"));l.className="tsd-nested-navigation";for(let u of t.children)we(u,l,i)}else Ee(t,r,t.class)}function Ee(t,e,n){if(t.path){let r=e.appendChild(document.createElement("a"));r.href=Le+t.path,n&&(r.className=n),location.href===r.href&&r.classList.add("current"),t.kind&&(r.innerHTML=``),r.appendChild(document.createElement("span")).textContent=t.text}else e.appendChild(document.createElement("span")).textContent=t.text}G(X,"a[data-toggle]");G(Z,".tsd-index-accordion");G(Y,".tsd-filter-item input[type=checkbox]");var Se=document.getElementById("tsd-theme");Se&&ge(Se);var je=new U;Object.defineProperty(window,"app",{value:je});he();be();})(); /*! Bundled license information: lunr/lunr.js: diff --git a/hybridkem-x25519-kyber768/docs/assets/navigation.js b/hybridkem-x25519-kyber768/docs/assets/navigation.js new file mode 100644 index 000000000..7c523cf16 --- /dev/null +++ b/hybridkem-x25519-kyber768/docs/assets/navigation.js @@ -0,0 +1 @@ +window.navigationData = "data:application/octet-stream;base64,H4sIAAAAAAAAA4uuVipJrShRslLyqEwqykzJTs2NMDI1NbT0rkxKLTI3s1DSUSpILMkAKkjOSSwuTi3Wx6FQL6MkNweoOjszL0XJytDIojYWAE7FrPtdAAAA" \ No newline at end of file diff --git a/hybridkem-x25519-kyber768/docs/assets/search.js b/hybridkem-x25519-kyber768/docs/assets/search.js index 06ed43701..ba28e28f6 100644 --- a/hybridkem-x25519-kyber768/docs/assets/search.js +++ b/hybridkem-x25519-kyber768/docs/assets/search.js @@ -1 +1 @@ -window.searchData = JSON.parse("{\"rows\":[{\"kind\":128,\"name\":\"HybridkemX25519Kyber768\",\"url\":\"classes/HybridkemX25519Kyber768.html\",\"classes\":\"\"},{\"kind\":512,\"name\":\"constructor\",\"url\":\"classes/HybridkemX25519Kyber768.html#constructor\",\"classes\":\"\",\"parent\":\"HybridkemX25519Kyber768\"},{\"kind\":1024,\"name\":\"id\",\"url\":\"classes/HybridkemX25519Kyber768.html#id\",\"classes\":\"\",\"parent\":\"HybridkemX25519Kyber768\"},{\"kind\":1024,\"name\":\"name\",\"url\":\"classes/HybridkemX25519Kyber768.html#name\",\"classes\":\"\",\"parent\":\"HybridkemX25519Kyber768\"},{\"kind\":1024,\"name\":\"secretSize\",\"url\":\"classes/HybridkemX25519Kyber768.html#secretSize\",\"classes\":\"\",\"parent\":\"HybridkemX25519Kyber768\"},{\"kind\":1024,\"name\":\"encSize\",\"url\":\"classes/HybridkemX25519Kyber768.html#encSize\",\"classes\":\"\",\"parent\":\"HybridkemX25519Kyber768\"},{\"kind\":1024,\"name\":\"publicKeySize\",\"url\":\"classes/HybridkemX25519Kyber768.html#publicKeySize\",\"classes\":\"\",\"parent\":\"HybridkemX25519Kyber768\"},{\"kind\":1024,\"name\":\"privateKeySize\",\"url\":\"classes/HybridkemX25519Kyber768.html#privateKeySize\",\"classes\":\"\",\"parent\":\"HybridkemX25519Kyber768\"},{\"kind\":1024,\"name\":\"auth\",\"url\":\"classes/HybridkemX25519Kyber768.html#auth\",\"classes\":\"\",\"parent\":\"HybridkemX25519Kyber768\"},{\"kind\":1024,\"name\":\"_a\",\"url\":\"classes/HybridkemX25519Kyber768.html#_a\",\"classes\":\"tsd-is-protected tsd-is-inherited\",\"parent\":\"HybridkemX25519Kyber768\"},{\"kind\":1024,\"name\":\"_b\",\"url\":\"classes/HybridkemX25519Kyber768.html#_b\",\"classes\":\"tsd-is-protected tsd-is-inherited\",\"parent\":\"HybridkemX25519Kyber768\"},{\"kind\":1024,\"name\":\"_kdf\",\"url\":\"classes/HybridkemX25519Kyber768.html#_kdf\",\"classes\":\"tsd-is-protected tsd-is-inherited\",\"parent\":\"HybridkemX25519Kyber768\"},{\"kind\":2048,\"name\":\"serializePublicKey\",\"url\":\"classes/HybridkemX25519Kyber768.html#serializePublicKey\",\"classes\":\"tsd-is-inherited\",\"parent\":\"HybridkemX25519Kyber768\"},{\"kind\":2048,\"name\":\"deserializePublicKey\",\"url\":\"classes/HybridkemX25519Kyber768.html#deserializePublicKey\",\"classes\":\"tsd-is-inherited\",\"parent\":\"HybridkemX25519Kyber768\"},{\"kind\":2048,\"name\":\"serializePrivateKey\",\"url\":\"classes/HybridkemX25519Kyber768.html#serializePrivateKey\",\"classes\":\"tsd-is-inherited\",\"parent\":\"HybridkemX25519Kyber768\"},{\"kind\":2048,\"name\":\"deserializePrivateKey\",\"url\":\"classes/HybridkemX25519Kyber768.html#deserializePrivateKey\",\"classes\":\"tsd-is-inherited\",\"parent\":\"HybridkemX25519Kyber768\"},{\"kind\":2048,\"name\":\"generateKeyPair\",\"url\":\"classes/HybridkemX25519Kyber768.html#generateKeyPair\",\"classes\":\"tsd-is-inherited\",\"parent\":\"HybridkemX25519Kyber768\"},{\"kind\":2048,\"name\":\"deriveKeyPair\",\"url\":\"classes/HybridkemX25519Kyber768.html#deriveKeyPair\",\"classes\":\"tsd-is-inherited\",\"parent\":\"HybridkemX25519Kyber768\"},{\"kind\":2048,\"name\":\"importKey\",\"url\":\"classes/HybridkemX25519Kyber768.html#importKey\",\"classes\":\"tsd-is-inherited\",\"parent\":\"HybridkemX25519Kyber768\"},{\"kind\":2048,\"name\":\"encap\",\"url\":\"classes/HybridkemX25519Kyber768.html#encap\",\"classes\":\"tsd-is-inherited\",\"parent\":\"HybridkemX25519Kyber768\"},{\"kind\":2048,\"name\":\"decap\",\"url\":\"classes/HybridkemX25519Kyber768.html#decap\",\"classes\":\"tsd-is-inherited\",\"parent\":\"HybridkemX25519Kyber768\"}],\"index\":{\"version\":\"2.3.9\",\"fields\":[\"name\",\"comment\"],\"fieldVectors\":[[\"name/0\",[0,26.856]],[\"comment/0\",[]],[\"name/1\",[1,26.856]],[\"comment/1\",[]],[\"name/2\",[2,26.856]],[\"comment/2\",[]],[\"name/3\",[3,26.856]],[\"comment/3\",[]],[\"name/4\",[4,26.856]],[\"comment/4\",[]],[\"name/5\",[5,26.856]],[\"comment/5\",[]],[\"name/6\",[6,26.856]],[\"comment/6\",[]],[\"name/7\",[7,26.856]],[\"comment/7\",[]],[\"name/8\",[8,26.856]],[\"comment/8\",[]],[\"name/9\",[9,26.856]],[\"comment/9\",[]],[\"name/10\",[10,26.856]],[\"comment/10\",[]],[\"name/11\",[11,26.856]],[\"comment/11\",[]],[\"name/12\",[12,26.856]],[\"comment/12\",[]],[\"name/13\",[13,26.856]],[\"comment/13\",[]],[\"name/14\",[14,26.856]],[\"comment/14\",[]],[\"name/15\",[15,26.856]],[\"comment/15\",[]],[\"name/16\",[16,26.856]],[\"comment/16\",[]],[\"name/17\",[17,26.856]],[\"comment/17\",[]],[\"name/18\",[18,26.856]],[\"comment/18\",[]],[\"name/19\",[19,26.856]],[\"comment/19\",[]],[\"name/20\",[20,26.856]],[\"comment/20\",[]]],\"invertedIndex\":[[\"_a\",{\"_index\":9,\"name\":{\"9\":{}},\"comment\":{}}],[\"_b\",{\"_index\":10,\"name\":{\"10\":{}},\"comment\":{}}],[\"_kdf\",{\"_index\":11,\"name\":{\"11\":{}},\"comment\":{}}],[\"auth\",{\"_index\":8,\"name\":{\"8\":{}},\"comment\":{}}],[\"constructor\",{\"_index\":1,\"name\":{\"1\":{}},\"comment\":{}}],[\"decap\",{\"_index\":20,\"name\":{\"20\":{}},\"comment\":{}}],[\"derivekeypair\",{\"_index\":17,\"name\":{\"17\":{}},\"comment\":{}}],[\"deserializeprivatekey\",{\"_index\":15,\"name\":{\"15\":{}},\"comment\":{}}],[\"deserializepublickey\",{\"_index\":13,\"name\":{\"13\":{}},\"comment\":{}}],[\"encap\",{\"_index\":19,\"name\":{\"19\":{}},\"comment\":{}}],[\"encsize\",{\"_index\":5,\"name\":{\"5\":{}},\"comment\":{}}],[\"generatekeypair\",{\"_index\":16,\"name\":{\"16\":{}},\"comment\":{}}],[\"hybridkemx25519kyber768\",{\"_index\":0,\"name\":{\"0\":{}},\"comment\":{}}],[\"id\",{\"_index\":2,\"name\":{\"2\":{}},\"comment\":{}}],[\"importkey\",{\"_index\":18,\"name\":{\"18\":{}},\"comment\":{}}],[\"name\",{\"_index\":3,\"name\":{\"3\":{}},\"comment\":{}}],[\"privatekeysize\",{\"_index\":7,\"name\":{\"7\":{}},\"comment\":{}}],[\"publickeysize\",{\"_index\":6,\"name\":{\"6\":{}},\"comment\":{}}],[\"secretsize\",{\"_index\":4,\"name\":{\"4\":{}},\"comment\":{}}],[\"serializeprivatekey\",{\"_index\":14,\"name\":{\"14\":{}},\"comment\":{}}],[\"serializepublickey\",{\"_index\":12,\"name\":{\"12\":{}},\"comment\":{}}]],\"pipeline\":[]}}"); \ No newline at end of file +window.searchData = "data:application/octet-stream;base64,H4sIAAAAAAAAA71YXW/aMBT9K5P3mlKuSULgF2zqS6VJ0ySEqpC4wwJC5ISuDPHfZztfdmp3M0320srhnHtP7rn+ygWx468CLVcXtKNZipaAIw9l8YGgJfpy3jCa7sjhBw4CWDycN4TNwwh56MT2/PdkHxcFKe4tuMm2POw5uIZxArp6TZ4AcJsnOWZFyU5JeWROsT/rRCWPh/KYkax85yU6KTDFfquFpm4SJH6QzPKfU+6aMUj2giSMlN/ob0cNGm8QJSRL3GV0pEE05KfNniYP5OyupE8dRg+jL3FJbhPU5w6iKD6VWzcdNWOQ7E+xW26J7zKXRXpHi7ucHUuSlCT9VD+g2ZYwyh98RNrGUdrm/0nbpc+O4irGaPLw1I+UJYjReM979LGZQq5LkYH/RvoQSlPyUa2WCKOo7TK1K8GthVUDjF7ZG9XaQoyi9yfJCKtSPMbU8fjyljxSTXkZblPYp46ijx7yIyudfVZpo+jiZ4o4dz6GSMpIPjrraSgf1LP2EJdDXtHygl4IK+gx43A8mU0WnP9MyT4Vd4jmCJscDwcRcV3/9p2IE7pAVJD7KfJWUw+HkygI12tv1TDkD/KBhAEfgQkGGgzzETbBsAab8dHMBJtpMJ+PfBPM12ABHwUmWKDBQj4KTbBQg835aG6CzTUYv3qtIhMs0mDclNXCBFvo5RXVBqMP0DNCOmG2QvcCRM3B6AbodoAoOxgNAd0REJUHoyegmwKi+GC0BXRfQNQfjM6Abg0IC8BoDujugHABjP6AbhAII8BoEegeYWEENnqEK4/k3OSTks/lr9Uc5bNMnHcv6KmetItmCbmgBf9zvXZTVIxEUHEK7Qi8KVoGbwULRZ4NFRIoJLCQqktAR4o6TmShaJd8JZ2SzcKsV7+Og5X3wrb3qva8HTnncs9TMs6VlHMruz191BevndihlCiBEiX4hyjyeNgPMlOCzCxB6s1IYSmNALZO4KxC3hM7nqLYJrg5ypjKFipZQwt/22w9r3Lr2bWfmro4inc268THGMVtxWwbQZ4h+sVVmhJsXVltdR1JMcTmR9cP/QIrjWXrq7YN+lylurbiVt9o+kS/I/pW4vutrISAv8cwNrJiEhhd4utbTnOypxkHrdbX6x+Iy0qUsxQAAA=="; \ No newline at end of file diff --git a/hybridkem-x25519-kyber768/docs/assets/style.css b/hybridkem-x25519-kyber768/docs/assets/style.css index 258146fc0..108428c3f 100644 --- a/hybridkem-x25519-kyber768/docs/assets/style.css +++ b/hybridkem-x25519-kyber768/docs/assets/style.css @@ -910,8 +910,9 @@ a.tsd-index-link { box-shadow: 0 0 4px rgba(0, 0, 0, 0.25); } #tsd-search .results li { - padding: 0 10px; background-color: var(--color-background); + line-height: initial; + padding: 4px; } #tsd-search .results li:nth-child(even) { background-color: var(--color-background-secondary); @@ -924,7 +925,10 @@ a.tsd-index-link { background-color: var(--color-accent); } #tsd-search .results a { - display: block; + display: flex; + align-items: center; + padding: 0.25rem; + box-sizing: border-box; } #tsd-search .results a:before { top: 10px; @@ -1134,7 +1138,7 @@ img { } .deprecated { - text-decoration: line-through; + text-decoration: line-through !important; } .warning { diff --git a/hybridkem-x25519-kyber768/docs/classes/HybridkemX25519Kyber768.html b/hybridkem-x25519-kyber768/docs/classes/HybridkemX25519Kyber768.html index 3a3740bf0..15bc77c4e 100644 --- a/hybridkem-x25519-kyber768/docs/classes/HybridkemX25519Kyber768.html +++ b/hybridkem-x25519-kyber768/docs/classes/HybridkemX25519Kyber768.html @@ -1,13 +1,13 @@ -HybridkemX25519Kyber768 | @hpke/hybridkem-x25519-kyber768
    +HybridkemX25519Kyber768 | @hpke/hybridkem-x25519-kyber768
    -
    +
    @@ -33,19 +33,19 @@

    Hierarchy

    • HybridkemX25519Kyber768
    +
  • Defined in src/kems/hybridkemX25519Kyber768.ts:49
  • - +

    Constructors

    -

    Properties

    -
    _a +
    _a _b _kdf auth @@ -58,7 +58,7 @@

    Properties

    Methods

    -
    decap +
    decap deriveKeyPair deserializePrivateKey deserializePublicKey @@ -71,14 +71,14 @@

    Methods

    Constructors

    - +
    +
  • Defined in src/kems/hybridkemX25519Kyber768.ts:58
  • Properties

    @@ -86,60 +86,60 @@
    +
  • Defined in src/kems/hybridkem.ts:27
  • _b: KemInterface
    +
  • Defined in src/kems/hybridkem.ts:28
  • _kdf: KdfInterface
    +
  • Defined in src/kems/hybridkem.ts:29
  • auth: boolean = false
    +
  • Defined in src/kems/hybridkemX25519Kyber768.ts:56
  • encSize: number = 1120
    +
  • Defined in src/kems/hybridkemX25519Kyber768.ts:53
  • id: KemId = KemId.HybridkemX25519Kyber768
    +
  • Defined in src/kems/hybridkemX25519Kyber768.ts:50
  • name: string = "X25519Kyber25519"
    +
  • Defined in src/kems/hybridkemX25519Kyber768.ts:51
  • privateKeySize: number = 2432
    +
  • Defined in src/kems/hybridkemX25519Kyber768.ts:55
  • publicKeySize: number = 1216
    +
  • Defined in src/kems/hybridkemX25519Kyber768.ts:54
  • secretSize: number = 64
    +
  • Defined in src/kems/hybridkemX25519Kyber768.ts:52
  • Methods

    @@ -155,7 +155,7 @@
    params: Returns Promise<ArrayBuffer>
    +
  • Defined in src/kems/hybridkem.ts:176
    • @@ -169,7 +169,7 @@
      ikm: Returns Promise<CryptoKeyPair>
    +
  • Defined in src/kems/hybridkem.ts:95
    • @@ -183,7 +183,7 @@
      key: Returns Promise<CryptoKey>
    +
  • Defined in src/kems/hybridkem.ts:70
    • @@ -197,7 +197,7 @@
      key: Returns Promise<CryptoKey>
    +
  • Defined in src/kems/hybridkem.ts:54
    • @@ -211,7 +211,7 @@
      params: Returns Promise<{
          enc: ArrayBuffer;
          sharedSecret: ArrayBuffer;
      }>
    +
  • Defined in src/kems/hybridkem.ts:144
  • +
  • Defined in src/kems/hybridkem.ts:78
    • @@ -238,7 +238,7 @@
      isPublic: Returns Promise<CryptoKey>
    +
  • Defined in src/kems/hybridkem.ts:127
    • @@ -252,7 +252,7 @@
      key: Returns Promise<ArrayBuffer>
    +
  • Defined in src/kems/hybridkem.ts:62
    • @@ -266,20 +266,20 @@
      key: Returns Promise<ArrayBuffer>
    +
  • Defined in src/kems/hybridkem.ts:46
  • @@ -307,9 +307,9 @@

    serializePrivateKey
  • serializePublicKey
  • +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/hybridkem-x25519-kyber768/docs/index.html b/hybridkem-x25519-kyber768/docs/index.html index 2af12c999..266c85ded 100644 --- a/hybridkem-x25519-kyber768/docs/index.html +++ b/hybridkem-x25519-kyber768/docs/index.html @@ -1,13 +1,13 @@ -@hpke/hybridkem-x25519-kyber768
    +@hpke/hybridkem-x25519-kyber768
    -
    +
    @@ -71,15 +71,15 @@

    @hpke/hybridkem-x25519-kyber768

    @@ -106,9 +106,9 @@

    Browsers
  • Contributing
  • +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/hybridkem-x25519-kyber768/docs/modules.html b/hybridkem-x25519-kyber768/docs/modules.html index 19763356b..05ac2f758 100644 --- a/hybridkem-x25519-kyber768/docs/modules.html +++ b/hybridkem-x25519-kyber768/docs/modules.html @@ -1,13 +1,13 @@ -@hpke/hybridkem-x25519-kyber768
    +@hpke/hybridkem-x25519-kyber768
    -
    +
    @@ -17,27 +17,27 @@

    @hpke/hybridkem-x25519-kyber768

    Index

    Classes

    -
    +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/hybridkem-x25519-kyber768/src/hpke-hybridkem-x25519-kyber768.js b/hybridkem-x25519-kyber768/src/hpke-hybridkem-x25519-kyber768.js index 6ac93f7ea..08a6e3adc 100644 --- a/hybridkem-x25519-kyber768/src/hpke-hybridkem-x25519-kyber768.js +++ b/hybridkem-x25519-kyber768/src/hpke-hybridkem-x25519-kyber768.js @@ -1,6 +1,9 @@ -var mn={NotAssigned:0,DhkemP256HkdfSha256:16,DhkemP384HkdfSha384:17,DhkemP521HkdfSha512:18,DhkemSecp256k1HkdfSha256:19,DhkemX25519HkdfSha256:32,DhkemX448HkdfSha512:33,HybridkemX25519Kyber768:48},be=mn,_n={HkdfSha256:1,HkdfSha384:2,HkdfSha512:3},kt=_n;function It(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`Wrong positive integer: ${t}`)}function En(t){if(typeof t!="boolean")throw new Error(`Expected boolean, not ${t}`)}function pr(t,...e){if(!(t instanceof Uint8Array))throw new Error("Expected Uint8Array");if(e.length>0&&!e.includes(t.length))throw new Error(`Expected Uint8Array of length ${e}, not of length=${t.length}`)}function vn(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");It(t.outputLen),It(t.blockLen)}function An(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function Bn(t,e){pr(t);let r=e.outputLen;if(t.lengtht instanceof Uint8Array;var wr=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4)),nt=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),ue=(t,e)=>t<<32-e|t>>>e,Pn=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!Pn)throw new Error("Non little-endian hardware is not supported");var Ji=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function Lt(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function ve(t){if(typeof t=="string"&&(t=Lt(t)),!br(t))throw new Error(`expected Uint8Array, got ${typeof t}`);return t}function xr(...t){let e=new Uint8Array(t.reduce((n,i)=>n+i.length,0)),r=0;return t.forEach(n=>{if(!br(n))throw new Error("Uint8Array expected");e.set(n,r),r+=n.length}),e}var Ee=class{clone(){return this._cloneInto()}};function he(t){let e=n=>t().update(ve(n)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}function gr(t){let e=(n,i)=>t(i).update(ve(n)).digest(),r=t({});return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=n=>t(n),e}function Ut(t=32){if(rt&&typeof rt.getRandomValues=="function")return rt.getRandomValues(new Uint8Array(t));throw new Error("crypto.getRandomValues must be defined")}var it=class extends Ee{constructor(e,r){super(),this.finished=!1,this.destroyed=!1,q.hash(e);let n=ve(r);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let i=this.blockLen,s=new Uint8Array(i);s.set(n.length>i?e.create().update(n).digest():n);for(let o=0;onew it(t,e).update(r).digest();zt.create=(t,e)=>new it(t,e);function Sn(t,e,r,n){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,r,n);let i=BigInt(32),s=BigInt(4294967295),o=Number(r>>i&s),a=Number(r&s),u=n?4:0,l=n?0:4;t.setUint32(e+u,o,n),t.setUint32(e+l,a,n)}var He=class extends Ee{constructor(e,r,n,i){super(),this.blockLen=e,this.outputLen=r,this.padOffset=n,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=nt(this.buffer)}update(e){q.exists(this);let{view:r,buffer:n,blockLen:i}=this;e=ve(e);let s=e.length;for(let o=0;oi-o&&(this.process(n,0),o=0);for(let h=o;hc.length)throw new Error("_sha2: outputLen bigger than state");for(let h=0;ht&e^~t&r,In=(t,e,r)=>t&e^t&r^e&r,Ln=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Ae=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Be=new Uint32Array(64),st=class extends He{constructor(){super(64,32,8,!1),this.A=Ae[0]|0,this.B=Ae[1]|0,this.C=Ae[2]|0,this.D=Ae[3]|0,this.E=Ae[4]|0,this.F=Ae[5]|0,this.G=Ae[6]|0,this.H=Ae[7]|0}get(){let{A:e,B:r,C:n,D:i,E:s,F:o,G:a,H:u}=this;return[e,r,n,i,s,o,a,u]}set(e,r,n,i,s,o,a,u){this.A=e|0,this.B=r|0,this.C=n|0,this.D=i|0,this.E=s|0,this.F=o|0,this.G=a|0,this.H=u|0}process(e,r){for(let h=0;h<16;h++,r+=4)Be[h]=e.getUint32(r,!1);for(let h=16;h<64;h++){let d=Be[h-15],_=Be[h-2],p=ue(d,7)^ue(d,18)^d>>>3,S=ue(_,17)^ue(_,19)^_>>>10;Be[h]=S+Be[h-7]+p+Be[h-16]|0}let{A:n,B:i,C:s,D:o,E:a,F:u,G:l,H:c}=this;for(let h=0;h<64;h++){let d=ue(a,6)^ue(a,11)^ue(a,25),_=c+d+kn(a,u,l)+Ln[h]+Be[h]|0,S=(ue(n,2)^ue(n,13)^ue(n,22))+In(n,i,s)|0;c=l,l=u,u=a,a=o+_|0,o=s,s=i,i=n,n=_+S|0}n=n+this.A|0,i=i+this.B|0,s=s+this.C|0,o=o+this.D|0,a=a+this.E|0,u=u+this.F|0,l=l+this.G|0,c=c+this.H|0,this.set(n,i,s,o,a,u,l,c)}roundClean(){Be.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}},Ot=class extends st{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}},mr=he(()=>new st),us=he(()=>new Ot);var Un={},ot=zn(globalThis,Un);function zn(t,e){return new Proxy(t,{get(r,n,i){return n in e?e[n]:t[n]},set(r,n,i){return n in e&&delete e[n],t[n]=i,!0},deleteProperty(r,n){let i=!1;return n in e&&(delete e[n],i=!0),n in t&&(delete t[n],i=!0),i},ownKeys(r){let n=Reflect.ownKeys(t),i=Reflect.ownKeys(e),s=new Set(i);return[...n.filter(o=>!s.has(o)),...i]},defineProperty(r,n,i){return n in e&&delete e[n],Reflect.defineProperty(t,n,i),!0},getOwnPropertyDescriptor(r,n){return n in e?Reflect.getOwnPropertyDescriptor(e,n):Reflect.getOwnPropertyDescriptor(t,n)},has(r,n){return n in e||n in t}})}var qe=class extends Error{constructor(e){let r;e instanceof Error?r=e.message:typeof e=="string"?r=e:r="",super(r),this.name=this.constructor.name}},we=class extends qe{},te=class extends we{};var re=class extends we{},Q=class extends we{},Te=class extends we{},Ne=class extends we{};var Ce=class extends we{},de=class extends we{};async function On(){if(ot!==void 0&&globalThis.crypto!==void 0)return globalThis.crypto.subtle;try{let{webcrypto:t}=await import("crypto");return t.subtle}catch(t){throw new de(t)}}var at=class{constructor(){Object.defineProperty(this,"_api",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}async _setup(){this._api===void 0&&(this._api=await On())}};var ne=new Uint8Array(0);var Er=new Uint8Array([72,80,75,69,45,118,49]),Ht=class extends at{constructor(){super(),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:kt.HkdfSha256}),Object.defineProperty(this,"hashSize",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_suiteId",{enumerable:!0,configurable:!0,writable:!0,value:ne}),Object.defineProperty(this,"algHash",{enumerable:!0,configurable:!0,writable:!0,value:{name:"HMAC",hash:"SHA-256",length:256}})}init(e){this._suiteId=e}buildLabeledIkm(e,r){this._checkInit();let n=new Uint8Array(7+this._suiteId.byteLength+e.byteLength+r.byteLength);return n.set(Er,0),n.set(this._suiteId,7),n.set(e,7+this._suiteId.byteLength),n.set(r,7+this._suiteId.byteLength+e.byteLength),n}buildLabeledInfo(e,r,n){this._checkInit();let i=new Uint8Array(9+this._suiteId.byteLength+e.byteLength+r.byteLength);return i.set(new Uint8Array([0,n]),0),i.set(Er,2),i.set(this._suiteId,9),i.set(e,9+this._suiteId.byteLength),i.set(r,9+this._suiteId.byteLength+e.byteLength),i}async extract(e,r){if(await this._setup(),e.byteLength===0&&(e=new ArrayBuffer(this.hashSize)),e.byteLength!==this.hashSize)throw new te("The salt length must be the same as the hashSize");let n=await this._api.importKey("raw",e,this.algHash,!1,["sign"]);return await this._api.sign("HMAC",n,r)}async expand(e,r,n){await this._setup();let i=await this._api.importKey("raw",e,this.algHash,!1,["sign"]),s=new ArrayBuffer(n),o=new Uint8Array(s),a=ne,u=new Uint8Array(r),l=new Uint8Array(1);if(n>255*this.hashSize)throw new Error("Entropy limit reached");let c=new Uint8Array(this.hashSize+u.length+1);for(let h=1,d=0;d=a.length?(o.set(a,d),d+=a.length):(o.set(a.slice(0,o.length-d),d),d+=o.length-d);return s}async extractAndExpand(e,r,n,i){await this._setup();let s=await this._api.importKey("raw",r,"HKDF",!1,["deriveBits"]);return await this._api.deriveBits({name:"HKDF",hash:this.algHash.hash,salt:e,info:n},s,i*8)}async labeledExtract(e,r,n){return await this.extract(e,this.buildLabeledIkm(r,n))}async labeledExpand(e,r,n,i){return await this.expand(e,this.buildLabeledInfo(r,n,i),i)}_checkInit(){if(this._suiteId===ne)throw new Error("Not initialized. Call init()")}},ct=class extends Ht{constructor(){super(...arguments),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:kt.HkdfSha256}),Object.defineProperty(this,"hashSize",{enumerable:!0,configurable:!0,writable:!0,value:32}),Object.defineProperty(this,"algHash",{enumerable:!0,configurable:!0,writable:!0,value:{name:"HMAC",hash:"SHA-256",length:256}})}};var Fe=class extends ct{async extract(e,r){if(await this._setup(),e.byteLength===0&&(e=new ArrayBuffer(this.hashSize)),e.byteLength!==this.hashSize)return zt(mr,new Uint8Array(e),new Uint8Array(r));let n=await this._api.importKey("raw",e,this.algHash,!1,["sign"]);return await this._api.sign("HMAC",n,r)}};var ut=new Uint8Array([75,69,77,0,0]);var ie=t=>typeof t=="object"&&t!==null&&typeof t.privateKey=="object"&&typeof t.publicKey=="object";function lt(t,e){if(e<=0)throw new Error("i2Osp: too small size");if(t>=256**e)throw new Error("i2Osp: too large integer");let r=new Uint8Array(e);for(let n=0;n>8;return r}function J(t,e){let r=new Uint8Array(t.length+e.length);return r.set(t,0),r.set(e,t.length),r}function Tt(t){let e=t.replace(/-/g,"+").replace(/_/g,"/"),r=atob(e),n=new Uint8Array(r.length);for(let i=0;i8192)throw new te("Too long ikm");return await this._prim.deriveKeyPair(e)}async encap(e){let r;e.ekm===void 0?r=await this.generateKeyPair():ie(e.ekm)?r=e.ekm:r=await this.deriveKeyPair(e.ekm);let n=await this._prim.serializePublicKey(r.publicKey),i=await this._prim.serializePublicKey(e.recipientPublicKey);try{let s;if(e.senderKey===void 0)s=new Uint8Array(await this._prim.dh(r.privateKey,e.recipientPublicKey));else{let u=ie(e.senderKey)?e.senderKey.privateKey:e.senderKey,l=new Uint8Array(await this._prim.dh(r.privateKey,e.recipientPublicKey)),c=new Uint8Array(await this._prim.dh(u,e.recipientPublicKey));s=J(l,c)}let o;if(e.senderKey===void 0)o=J(new Uint8Array(n),new Uint8Array(i));else{let u=ie(e.senderKey)?e.senderKey.publicKey:await this._prim.derivePublicKey(e.senderKey),l=await this._prim.serializePublicKey(u);o=Nn(new Uint8Array(n),new Uint8Array(i),new Uint8Array(l))}let a=await this._generateSharedSecret(s,o);return{enc:n,sharedSecret:a}}catch(s){throw new Te(s)}}async decap(e){let r=await this._prim.deserializePublicKey(e.enc),n=ie(e.recipientKey)?e.recipientKey.privateKey:e.recipientKey,i=ie(e.recipientKey)?e.recipientKey.publicKey:await this._prim.derivePublicKey(e.recipientKey),s=await this._prim.serializePublicKey(i);try{let o;if(e.senderPublicKey===void 0)o=new Uint8Array(await this._prim.dh(n,r));else{let u=new Uint8Array(await this._prim.dh(n,r)),l=new Uint8Array(await this._prim.dh(n,e.senderPublicKey));o=J(u,l)}let a;if(e.senderPublicKey===void 0)a=J(new Uint8Array(e.enc),new Uint8Array(s));else{let u=await this._prim.serializePublicKey(e.senderPublicKey);a=new Uint8Array(e.enc.byteLength+s.byteLength+u.byteLength),a.set(new Uint8Array(e.enc),0),a.set(new Uint8Array(s),e.enc.byteLength),a.set(new Uint8Array(u),e.enc.byteLength+s.byteLength)}return await this._generateSharedSecret(o,a)}catch(o){throw new Ne(o)}}async _generateSharedSecret(e,r){let n=this._kdf.buildLabeledIkm(Hn,e),i=this._kdf.buildLabeledInfo(Tn,r,this.secretSize);return await this._kdf.extractAndExpand(ne,n,i,this.secretSize)}};var ht=BigInt(4294967295),Ct=BigInt(32);function vr(t,e=!1){return e?{h:Number(t&ht),l:Number(t>>Ct&ht)}:{h:Number(t>>Ct&ht)|0,l:Number(t&ht)|0}}function Cn(t,e=!1){let r=new Uint32Array(t.length),n=new Uint32Array(t.length);for(let i=0;iBigInt(t>>>0)<>>0),Dn=(t,e,r)=>t>>>r,Mn=(t,e,r)=>t<<32-r|e>>>r,jn=(t,e,r)=>t>>>r|e<<32-r,qn=(t,e,r)=>t<<32-r|e>>>r,Fn=(t,e,r)=>t<<64-r|e>>>r-32,Gn=(t,e,r)=>t>>>r-32|e<<64-r,$n=(t,e)=>e,Vn=(t,e)=>t,Zn=(t,e,r)=>t<>>32-r,Xn=(t,e,r)=>e<>>32-r,Yn=(t,e,r)=>e<>>64-r,Wn=(t,e,r)=>t<>>64-r;function Qn(t,e,r,n){let i=(e>>>0)+(n>>>0);return{h:t+r+(i/2**32|0)|0,l:i|0}}var Jn=(t,e,r)=>(t>>>0)+(e>>>0)+(r>>>0),ei=(t,e,r,n)=>e+r+n+(t/2**32|0)|0,ti=(t,e,r,n)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0),ri=(t,e,r,n,i)=>e+r+n+i+(t/2**32|0)|0,ni=(t,e,r,n,i)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0)+(i>>>0),ii=(t,e,r,n,i,s)=>e+r+n+i+s+(t/2**32|0)|0,si={fromBig:vr,split:Cn,toBig:Rn,shrSH:Dn,shrSL:Mn,rotrSH:jn,rotrSL:qn,rotrBH:Fn,rotrBL:Gn,rotr32H:$n,rotr32L:Vn,rotlSH:Zn,rotlSL:Xn,rotlBH:Yn,rotlBL:Wn,add:Qn,add3L:Jn,add3H:ei,add4L:ti,add4H:ri,add5H:ii,add5L:ni},x=si;var[oi,ai]=x.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(t=>BigInt(t))),Ke=new Uint32Array(80),Pe=new Uint32Array(80),Re=class extends He{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){let{Ah:e,Al:r,Bh:n,Bl:i,Ch:s,Cl:o,Dh:a,Dl:u,Eh:l,El:c,Fh:h,Fl:d,Gh:_,Gl:p,Hh:S,Hl:P}=this;return[e,r,n,i,s,o,a,u,l,c,h,d,_,p,S,P]}set(e,r,n,i,s,o,a,u,l,c,h,d,_,p,S,P){this.Ah=e|0,this.Al=r|0,this.Bh=n|0,this.Bl=i|0,this.Ch=s|0,this.Cl=o|0,this.Dh=a|0,this.Dl=u|0,this.Eh=l|0,this.El=c|0,this.Fh=h|0,this.Fl=d|0,this.Gh=_|0,this.Gl=p|0,this.Hh=S|0,this.Hl=P|0}process(e,r){for(let y=0;y<16;y++,r+=4)Ke[y]=e.getUint32(r),Pe[y]=e.getUint32(r+=4);for(let y=16;y<80;y++){let E=Ke[y-15]|0,g=Pe[y-15]|0,D=x.rotrSH(E,g,1)^x.rotrSH(E,g,8)^x.shrSH(E,g,7),ce=x.rotrSL(E,g,1)^x.rotrSL(E,g,8)^x.shrSL(E,g,7),O=Ke[y-2]|0,T=Pe[y-2]|0,G=x.rotrSH(O,T,19)^x.rotrBH(O,T,61)^x.shrSH(O,T,6),M=x.rotrSL(O,T,19)^x.rotrBL(O,T,61)^x.shrSL(O,T,6),W=x.add4L(ce,M,Pe[y-7],Pe[y-16]),N=x.add4H(W,D,G,Ke[y-7],Ke[y-16]);Ke[y]=N|0,Pe[y]=W|0}let{Ah:n,Al:i,Bh:s,Bl:o,Ch:a,Cl:u,Dh:l,Dl:c,Eh:h,El:d,Fh:_,Fl:p,Gh:S,Gl:P,Hh:F,Hl:Y}=this;for(let y=0;y<80;y++){let E=x.rotrSH(h,d,14)^x.rotrSH(h,d,18)^x.rotrBH(h,d,41),g=x.rotrSL(h,d,14)^x.rotrSL(h,d,18)^x.rotrBL(h,d,41),D=h&_^~h&S,ce=d&p^~d&P,O=x.add5L(Y,g,ce,ai[y],Pe[y]),T=x.add5H(O,F,E,D,oi[y],Ke[y]),G=O|0,M=x.rotrSH(n,i,28)^x.rotrBH(n,i,34)^x.rotrBH(n,i,39),W=x.rotrSL(n,i,28)^x.rotrBL(n,i,34)^x.rotrBL(n,i,39),N=n&s^n&a^s&a,je=i&o^i&u^o&u;F=S|0,Y=P|0,S=_|0,P=p|0,_=h|0,p=d|0,{h,l:d}=x.add(l|0,c|0,T|0,G|0),l=a|0,c=u|0,a=s|0,u=o|0,s=n|0,o=i|0;let me=x.add3L(G,W,je);n=x.add3H(me,T,M,N),i=me|0}({h:n,l:i}=x.add(this.Ah|0,this.Al|0,n|0,i|0)),{h:s,l:o}=x.add(this.Bh|0,this.Bl|0,s|0,o|0),{h:a,l:u}=x.add(this.Ch|0,this.Cl|0,a|0,u|0),{h:l,l:c}=x.add(this.Dh|0,this.Dl|0,l|0,c|0),{h,l:d}=x.add(this.Eh|0,this.El|0,h|0,d|0),{h:_,l:p}=x.add(this.Fh|0,this.Fl|0,_|0,p|0),{h:S,l:P}=x.add(this.Gh|0,this.Gl|0,S|0,P|0),{h:F,l:Y}=x.add(this.Hh|0,this.Hl|0,F|0,Y|0),this.set(n,i,s,o,a,u,l,c,h,d,_,p,S,P,F,Y)}roundClean(){Ke.fill(0),Pe.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}},Rt=class extends Re{constructor(){super(),this.Ah=-1942145080,this.Al=424955298,this.Bh=1944164710,this.Bl=-1982016298,this.Ch=502970286,this.Cl=855612546,this.Dh=1738396948,this.Dl=1479516111,this.Eh=258812777,this.El=2077511080,this.Fh=2011393907,this.Fl=79989058,this.Gh=1067287976,this.Gl=1780299464,this.Hh=286451373,this.Hl=-1848208735,this.outputLen=28}},Dt=class extends Re{constructor(){super(),this.Ah=573645204,this.Al=-64227540,this.Bh=-1621794909,this.Bl=-934517566,this.Ch=596883563,this.Cl=1867755857,this.Dh=-1774684391,this.Dl=1497426621,this.Eh=-1775747358,this.El=-1467023389,this.Fh=-1101128155,this.Fl=1401305490,this.Gh=721525244,this.Gl=746961066,this.Hh=246885852,this.Hl=-2117784414,this.outputLen=32}},Mt=class extends Re{constructor(){super(),this.Ah=-876896931,this.Al=-1056596264,this.Bh=1654270250,this.Bl=914150663,this.Ch=-1856437926,this.Cl=812702999,this.Dh=355462360,this.Dl=-150054599,this.Eh=1731405415,this.El=-4191439,this.Fh=-1900787065,this.Fl=1750603025,this.Gh=-619958771,this.Gl=1694076839,this.Hh=1203062813,this.Hl=-1090891868,this.outputLen=48}},jt=he(()=>new Re),Hs=he(()=>new Rt),Ts=he(()=>new Dt),Ns=he(()=>new Mt);var Rs=BigInt(0),ci=BigInt(1),ui=BigInt(2),dt=t=>t instanceof Uint8Array,li=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function Ge(t){if(!dt(t))throw new Error("Uint8Array expected");let e="";for(let r=0;rn+i.length,0)),r=0;return t.forEach(n=>{if(!dt(n))throw new Error("Uint8Array expected");e.set(n,r),r+=n.length}),e}var Kr=t=>(ui<typeof t=="bigint",function:t=>typeof t=="function",boolean:t=>typeof t=="boolean",string:t=>typeof t=="string",isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,e)=>e.Fp.isValid(t),hash:t=>typeof t=="function"&&Number.isSafeInteger(t.outputLen)};function xe(t,e,r={}){let n=(i,s,o)=>{let a=fi[s];if(typeof a!="function")throw new Error(`Invalid validator "${s}", expected function`);let u=t[i];if(!(o&&u===void 0)&&!a(u,t))throw new Error(`Invalid param ${String(i)}=${u} (${typeof u}), expected ${s}`)};for(let[i,s]of Object.entries(e))n(i,s,!1);for(let[i,s]of Object.entries(r))n(i,s,!0);return t}var C=BigInt(0),H=BigInt(1),Ue=BigInt(2),di=BigInt(3),Gt=BigInt(4),Pr=BigInt(5),Sr=BigInt(8),yi=BigInt(9),pi=BigInt(16);function z(t,e){let r=t%e;return r>=C?r:e+r}function $t(t,e,r){if(r<=C||e 0");if(r===H)return C;let n=H;for(;e>C;)e&H&&(n=n*t%r),t=t*t%r,e>>=H;return n}function se(t,e,r){let n=t;for(;e-- >C;)n*=n,n%=r;return n}function kr(t,e){if(t===C||e<=C)throw new Error(`invert: expected positive integers, got n=${t} mod=${e}`);let r=z(t,e),n=e,i=C,s=H,o=H,a=C;for(;r!==C;){let l=n/r,c=n%r,h=i-o*l,d=s-a*l;n=r,r=c,i=o,s=a,o=h,a=d}if(n!==H)throw new Error("invert: does not exist");return z(i,e)}function bi(t){let e=(t-H)/Ue,r,n,i;for(r=t-H,n=0;r%Ue===C;r/=Ue,n++);for(i=Ue;i(z(t,e)&H)===H,xi=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function Lr(t){let e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},r=xi.reduce((n,i)=>(n[i]="function",n),e);return xe(t,r)}function gi(t,e,r){if(r 0");if(r===C)return t.ONE;if(r===H)return e;let n=t.ONE,i=e;for(;r>C;)r&H&&(n=t.mul(n,i)),i=t.sqr(i),r>>=H;return n}function mi(t,e){let r=new Array(e.length),n=e.reduce((s,o,a)=>t.is0(o)?s:(r[a]=s,t.mul(s,o)),t.ONE),i=t.inv(n);return e.reduceRight((s,o,a)=>t.is0(o)?s:(r[a]=t.mul(s,r[a]),t.mul(s,o)),i),r}function Vt(t,e){let r=e!==void 0?e:t.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function Ur(t,e,r=!1,n={}){if(t<=C)throw new Error(`Expected Fp ORDER > 0, got ${t}`);let{nBitLength:i,nByteLength:s}=Vt(t,e);if(s>2048)throw new Error("Field lengths over 2048 bytes are not supported");let o=wi(t),a=Object.freeze({ORDER:t,BITS:i,BYTES:s,MASK:Kr(i),ZERO:C,ONE:H,create:u=>z(u,t),isValid:u=>{if(typeof u!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof u}`);return C<=u&&uu===C,isOdd:u=>(u&H)===H,neg:u=>z(-u,t),eql:(u,l)=>u===l,sqr:u=>z(u*u,t),add:(u,l)=>z(u+l,t),sub:(u,l)=>z(u-l,t),mul:(u,l)=>z(u*l,t),pow:(u,l)=>gi(a,u,l),div:(u,l)=>z(u*kr(l,t),t),sqrN:u=>u*u,addN:(u,l)=>u+l,subN:(u,l)=>u-l,mulN:(u,l)=>u*l,inv:u=>kr(u,t),sqrt:n.sqrt||(u=>o(a,u)),invertBatch:u=>mi(a,u),cmov:(u,l,c)=>c?l:u,toBytes:u=>r?Se(u,s):Ft(u,s),fromBytes:u=>{if(u.length!==s)throw new Error(`Fp.fromBytes: expected ${s}, got ${u.length}`);return r?ye(u):qt(u)}});return Object.freeze(a)}function zr(t,e){if(!t.isOdd)throw new Error("Field doesn't have isOdd");let r=t.sqrt(e);return t.isOdd(r)?t.neg(r):r}var _i=BigInt(0),Zt=BigInt(1);function Or(t,e){let r=(i,s)=>{let o=s.negate();return i?o:s},n=i=>{let s=Math.ceil(e/i)+1,o=2**(i-1);return{windows:s,windowSize:o}};return{constTimeNegate:r,unsafeLadder(i,s){let o=t.ZERO,a=i;for(;s>_i;)s&Zt&&(o=o.add(a)),a=a.double(),s>>=Zt;return o},precomputeWindow(i,s){let{windows:o,windowSize:a}=n(s),u=[],l=i,c=l;for(let h=0;h>=_,P>u&&(P-=d,o+=Zt);let F=S,Y=S+Math.abs(P)-1,y=p%2!==0,E=P<0;P===0?c=c.add(r(y,s[F])):l=l.add(r(E,s[Y]))}return{p:l,f:c}},wNAFCached(i,s,o,a){let u=i._WINDOW_SIZE||1,l=s.get(i);return l||(l=this.precomputeWindow(i,u),u!==1&&s.set(i,a(l))),this.wNAF(u,l,o)}}}function Hr(t){return Lr(t.Fp),xe(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...Vt(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}var le=BigInt(0),ee=BigInt(1),pt=BigInt(2),Ei=BigInt(8),vi={zip215:!0};function Ai(t){let e=Hr(t);return xe(t,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...e})}function bt(t){let e=Ai(t),{Fp:r,n,prehash:i,hash:s,randomBytes:o,nByteLength:a,h:u}=e,l=pt<{try{return{isValid:!0,value:r.sqrt(b*r.inv(f))}}catch{return{isValid:!1,value:le}}}),d=e.adjustScalarBytes||(b=>b),_=e.domain||((b,f,w)=>{if(f.length||w)throw new Error("Contexts/pre-hash are not supported");return b}),p=b=>typeof b=="bigint"&&lep(b)&&p(f)&&bb===le||S(b,l);function F(b,f){if(S(b,f))return b;throw new Error(`Expected valid scalar < ${f}, got ${typeof b} ${b}`)}function Y(b){return b===le?b:F(b,n)}let y=new Map;function E(b){if(!(b instanceof g))throw new Error("ExtendedPoint expected")}class g{constructor(f,w,m,v){if(this.ex=f,this.ey=w,this.ez=m,this.et=v,!P(f))throw new Error("x required");if(!P(w))throw new Error("y required");if(!P(m))throw new Error("z required");if(!P(v))throw new Error("t required")}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(f){if(f instanceof g)throw new Error("extended point not allowed");let{x:w,y:m}=f||{};if(!P(w)||!P(m))throw new Error("invalid affine point");return new g(w,m,ee,c(w*m))}static normalizeZ(f){let w=r.invertBatch(f.map(m=>m.ez));return f.map((m,v)=>m.toAffine(w[v])).map(g.fromAffine)}_setWindowSize(f){this._WINDOW_SIZE=f,y.delete(this)}assertValidity(){let{a:f,d:w}=e;if(this.is0())throw new Error("bad point: ZERO");let{ex:m,ey:v,ez:A,et:K}=this,U=c(m*m),B=c(v*v),k=c(A*A),j=c(k*k),V=c(U*f),fe=c(k*c(V+B)),Z=c(j+c(w*c(U*B)));if(fe!==Z)throw new Error("bad point: equation left != right (1)");let _e=c(m*v),pe=c(A*K);if(_e!==pe)throw new Error("bad point: equation left != right (2)")}equals(f){E(f);let{ex:w,ey:m,ez:v}=this,{ex:A,ey:K,ez:U}=f,B=c(w*U),k=c(A*v),j=c(m*U),V=c(K*v);return B===k&&j===V}is0(){return this.equals(g.ZERO)}negate(){return new g(c(-this.ex),this.ey,this.ez,c(-this.et))}double(){let{a:f}=e,{ex:w,ey:m,ez:v}=this,A=c(w*w),K=c(m*m),U=c(pt*c(v*v)),B=c(f*A),k=w+m,j=c(c(k*k)-A-K),V=B+K,fe=V-U,Z=B-K,_e=c(j*fe),pe=c(V*Z),et=c(j*Z),tt=c(fe*V);return new g(_e,pe,tt,et)}add(f){E(f);let{a:w,d:m}=e,{ex:v,ey:A,ez:K,et:U}=this,{ex:B,ey:k,ez:j,et:V}=f;if(w===BigInt(-1)){let cr=c((A-v)*(k+B)),ur=c((A+v)*(k-B)),St=c(ur-cr);if(St===le)return this.double();let lr=c(K*pt*V),fr=c(U*pt*j),hr=fr+lr,dr=ur+cr,yr=fr-lr,bn=c(hr*St),wn=c(dr*yr),xn=c(hr*yr),gn=c(St*dr);return new g(bn,wn,gn,xn)}let fe=c(v*B),Z=c(A*k),_e=c(U*m*V),pe=c(K*j),et=c((v+A)*(B+k)-fe-Z),tt=pe-_e,or=pe+_e,ar=c(Z-w*fe),hn=c(et*tt),dn=c(or*ar),yn=c(et*ar),pn=c(tt*or);return new g(hn,dn,pn,yn)}subtract(f){return this.add(f.negate())}wNAF(f){return O.wNAFCached(this,y,f,g.normalizeZ)}multiply(f){let{p:w,f:m}=this.wNAF(F(f,n));return g.normalizeZ([w,m])[0]}multiplyUnsafe(f){let w=Y(f);return w===le?ce:this.equals(ce)||w===ee?this:this.equals(D)?this.wNAF(w).p:O.unsafeLadder(this,w)}isSmallOrder(){return this.multiplyUnsafe(u).is0()}isTorsionFree(){return O.unsafeLadder(this,n).is0()}toAffine(f){let{ex:w,ey:m,ez:v}=this,A=this.is0();f==null&&(f=A?Ei:r.inv(v));let K=c(w*f),U=c(m*f),B=c(v*f);if(A)return{x:le,y:ee};if(B!==ee)throw new Error("invZ was invalid");return{x:K,y:U}}clearCofactor(){let{h:f}=e;return f===ee?this:this.multiplyUnsafe(f)}static fromHex(f,w=!1){let{d:m,a:v}=e,A=r.BYTES;f=X("pointHex",f,A);let K=f.slice(),U=f[A-1];K[A-1]=U&-129;let B=ye(K);B===le||(w?F(B,l):F(B,r.ORDER));let k=c(B*B),j=c(k-ee),V=c(m*k-v),{isValid:fe,value:Z}=h(j,V);if(!fe)throw new Error("Point.fromHex: invalid y coordinate");let _e=(Z&ee)===ee,pe=(U&128)!==0;if(!w&&Z===le&&pe)throw new Error("Point.fromHex: x=0 and x_0=1");return pe!==_e&&(Z=c(-Z)),g.fromAffine({x:Z,y:B})}static fromPrivateKey(f){return M(f).point}toRawBytes(){let{x:f,y:w}=this.toAffine(),m=Se(w,r.BYTES);return m[m.length-1]|=f&ee?128:0,m}toHex(){return Ge(this.toRawBytes())}}g.BASE=new g(e.Gx,e.Gy,ee,c(e.Gx*e.Gy)),g.ZERO=new g(le,ee,ee,le);let{BASE:D,ZERO:ce}=g,O=Or(g,a*8);function T(b){return z(b,n)}function G(b){return T(ye(b))}function M(b){let f=a;b=X("private key",b,f);let w=X("hashed private key",s(b),2*f),m=d(w.slice(0,f)),v=w.slice(f,2*f),A=G(m),K=D.multiply(A),U=K.toRawBytes();return{head:m,prefix:v,scalar:A,point:K,pointBytes:U}}function W(b){return M(b).pointBytes}function N(b=new Uint8Array,...f){let w=yt(...f);return G(s(_(w,X("context",b),!!i)))}function je(b,f,w={}){b=X("message",b),i&&(b=i(b));let{prefix:m,scalar:v,pointBytes:A}=M(f),K=N(w.context,m,b),U=D.multiply(K).toRawBytes(),B=N(w.context,U,A,b),k=T(K+B*v);Y(k);let j=yt(U,Se(k,r.BYTES));return X("result",j,a*2)}let me=vi;function Qe(b,f,w,m=me){let{context:v,zip215:A}=m,K=r.BYTES;b=X("signature",b,2*K),f=X("message",f),i&&(f=i(f));let U=ye(b.slice(K,2*K)),B,k,j;try{B=g.fromHex(w,A),k=g.fromHex(b.slice(0,K),A),j=D.multiplyUnsafe(U)}catch{return!1}if(!A&&B.isSmallOrder())return!1;let V=N(v,k.toRawBytes(),B.toRawBytes(),f);return k.add(B.multiplyUnsafe(V)).subtract(j).clearCofactor().equals(g.ZERO)}return D._setWindowSize(8),{CURVE:e,getPublicKey:W,sign:je,verify:Qe,ExtendedPoint:g,utils:{getExtendedPublicKey:M,randomPrivateKey:()=>o(r.BYTES),precompute(b=8,f=g.BASE){return f._setWindowSize(b),f.multiply(BigInt(3)),f}}}}var $e=BigInt(0),Xt=BigInt(1);function Bi(t){return xe(t,{a:"bigint"},{montgomeryBits:"isSafeInteger",nByteLength:"isSafeInteger",adjustScalarBytes:"function",domain:"function",powPminus2:"function",Gu:"bigint"}),Object.freeze({...t})}function Tr(t){let e=Bi(t),{P:r}=e,n=y=>z(y,r),i=e.montgomeryBits,s=Math.ceil(i/8),o=e.nByteLength,a=e.adjustScalarBytes||(y=>y),u=e.powPminus2||(y=>$t(y,r-BigInt(2),r));function l(y,E,g){let D=n(y*(E-g));return E=n(E-D),g=n(g+D),[E,g]}function c(y){if(typeof y=="bigint"&&$e<=y&&y=$e;me--){let Qe=D>>me&Xt;W^=Qe,N=l(W,O,G),O=N[0],G=N[1],N=l(W,T,M),T=N[0],M=N[1],W=Qe;let Je=O+T,b=n(Je*Je),f=O-T,w=n(f*f),m=b-w,v=G+M,A=G-M,K=n(A*Je),U=n(v*f),B=K+U,k=K-U;G=n(B*B),M=n(ce*n(k*k)),O=n(b*w),T=n(m*(b+n(h*m)))}N=l(W,O,G),O=N[0],G=N[1],N=l(W,T,M),T=N[0],M=N[1];let je=u(T);return n(O*je)}function _(y){return Se(n(y),s)}function p(y){let E=X("u coordinate",y,s);return o===s&&(E[o-1]&=127),ye(E)}function S(y){let E=X("scalar",y);if(E.length!==s&&E.length!==o)throw new Error(`Expected ${s} or ${o} bytes, got ${E.length}`);return ye(a(E))}function P(y,E){let g=p(E),D=S(y),ce=d(g,D);if(ce===$e)throw new Error("Invalid private or public key received");return _(ce)}let F=_(e.Gu);function Y(y){return P(y,F)}return{scalarMult:P,scalarMultBase:Y,getSharedSecret:(y,E)=>P(y,E),getPublicKey:y=>Y(y),utils:{randomPrivateKey:()=>e.randomBytes(e.nByteLength)},GuBytes:F}}var Ve=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),Nr=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752"),ho=BigInt(0),Ki=BigInt(1),Yt=BigInt(2),Pi=BigInt(5),Cr=BigInt(10),Si=BigInt(20),ki=BigInt(40),Rr=BigInt(80);function Dr(t){let e=Ve,n=t*t%e*t%e,i=se(n,Yt,e)*n%e,s=se(i,Ki,e)*t%e,o=se(s,Pi,e)*s%e,a=se(o,Cr,e)*o%e,u=se(a,Si,e)*a%e,l=se(u,ki,e)*u%e,c=se(l,Rr,e)*l%e,h=se(c,Rr,e)*l%e,d=se(h,Cr,e)*o%e;return{pow_p_5_8:se(d,Yt,e)*t%e,b2:n}}function Mr(t){return t[0]&=248,t[31]&=127,t[31]|=64,t}function Ii(t,e){let r=Ve,n=z(e*e*e,r),i=z(n*n*e,r),s=Dr(t*i).pow_p_5_8,o=z(t*n*s,r),a=z(e*o*o,r),u=o,l=z(o*Nr,r),c=a===t,h=a===z(-t,r),d=a===z(-t*Nr,r);return c&&(o=u),(h||d)&&(o=l),Ir(o,r)&&(o=z(-o,r)),{isValid:c||h,value:o}}var ge=Ur(Ve,void 0,!0),Wt={a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:ge,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:BigInt(8),Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:jt,randomBytes:Ut,adjustScalarBytes:Mr,uvRatio:Ii},jr=bt(Wt);function qr(t,e,r){if(e.length>255)throw new Error("Context is too big");return xr(Lt("SigEd25519 no Ed25519 collisions"),new Uint8Array([r?1:0,e.length]),e,t)}var yo=bt({...Wt,domain:qr}),po=bt({...Wt,domain:qr,prehash:jt}),Qt=(()=>Tr({P:Ve,a:BigInt(486662),montgomeryBits:255,nByteLength:32,Gu:BigInt(9),powPminus2:t=>{let e=Ve,{pow_p_5_8:r,b2:n}=Dr(t);return z(se(r,BigInt(3),e)*n,e)},adjustScalarBytes:Mr,randomBytes:Ut}))();var Li=(ge.ORDER+BigInt(3))/BigInt(8),bo=ge.pow(Yt,Li),wo=ge.sqrt(ge.neg(ge.ONE)),xo=(ge.ORDER-BigInt(5))/BigInt(8),go=BigInt(486662);var mo=zr(ge,ge.neg(BigInt(486664)));var _o=BigInt("25063068953384623474111414158702152701244531502492656460079210482610430750235"),Eo=BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"),vo=BigInt("1159843021668779879193775521855586647937357759715417654439879720876111806838"),Ao=BigInt("40440834346308536858101042469323190826248399146238708352240133220865137265952");var Bo=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");var Ze=["deriveBits"],wt=new Uint8Array([100,107,112,95,112,114,107]),xt=new Uint8Array([115,107]);var $=class{constructor(e,r,n,i=[]){Object.defineProperty(this,"key",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"type",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"extractable",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"algorithm",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"usages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.key=r,this.type=n,this.algorithm={name:e},this.usages=i,n==="public"&&(this.usages=[])}};var De="X25519",gt=class{constructor(e){Object.defineProperty(this,"_hkdf",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_nPk",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_nSk",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._hkdf=e,this._nPk=32,this._nSk=32}async serializePublicKey(e){try{return await this._serializePublicKey(e)}catch(r){throw new re(r)}}async deserializePublicKey(e){try{return await this._importRawKey(e,!0)}catch(r){throw new Q(r)}}async serializePrivateKey(e){try{return await this._serializePrivateKey(e)}catch(r){throw new re(r)}}async deserializePrivateKey(e){try{return await this._importRawKey(e,!1)}catch(r){throw new Q(r)}}async importKey(e,r,n){try{if(e==="raw")return await this._importRawKey(r,n);if(r instanceof ArrayBuffer)throw new Error("Invalid jwk key format");return await this._importJWK(r,n)}catch(i){throw new Q(i)}}async generateKeyPair(){try{let e=jr.utils.randomPrivateKey(),r=new $(De,e,"private",Ze);return{publicKey:await this.derivePublicKey(r),privateKey:r}}catch(e){throw new de(e)}}async deriveKeyPair(e){try{let r=await this._hkdf.labeledExtract(ne,wt,new Uint8Array(e)),n=await this._hkdf.labeledExpand(r,xt,ne,this._nSk),i=new $(De,new Uint8Array(n),"private",Ze);return{privateKey:i,publicKey:await this.derivePublicKey(i)}}catch(r){throw new Ce(r)}}async derivePublicKey(e){try{return await this._derivePublicKey(e)}catch(r){throw new Q(r)}}async dh(e,r){try{return await this._dh(e,r)}catch(n){throw new re(n)}}_serializePublicKey(e){return new Promise(r=>{r(e.key.buffer)})}_serializePrivateKey(e){return new Promise(r=>{r(e.key.buffer)})}_importRawKey(e,r){return new Promise((n,i)=>{r&&e.byteLength!==this._nPk&&i(new Error("Invalid length of the key")),!r&&e.byteLength!==this._nSk&&i(new Error("Invalid length of the key")),n(new $(De,new Uint8Array(e),r?"public":"private",r?[]:Ze))})}_importJWK(e,r){return new Promise((n,i)=>{(typeof e.kty>"u"||e.kty!=="OKP")&&i(new Error(`Invalid kty: ${e.kty}`)),(typeof e.crv>"u"||e.crv!=="X25519")&&i(new Error(`Invalid crv: ${e.crv}`)),r?(typeof e.d<"u"&&i(new Error("Invalid key: `d` should not be set")),typeof e.x>"u"&&i(new Error("Invalid key: `x` not found")),n(new $(De,Tt(e.x),"public"))):(typeof e.d!="string"&&i(new Error("Invalid key: `d` not found")),n(new $(De,Tt(e.d),"private",Ze)))})}_derivePublicKey(e){return new Promise((r,n)=>{try{let i=Qt.getPublicKey(e.key);r(new $(De,i,"public"))}catch(i){n(i)}})}_dh(e,r){return new Promise((n,i)=>{try{n(Qt.getSharedSecret(e.key,r.key).buffer)}catch(s){i(s)}})}};var mt=class{constructor(e,r,n,i){Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:be.NotAssigned}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"secretSize",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"encSize",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"publicKeySize",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"privateKeySize",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_a",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_b",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_kdf",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.id=e,this._a=r,this._b=n,this._kdf=i;let s=new Uint8Array(ut);s.set(lt(this.id,2),3),this._kdf.init(s)}async serializePublicKey(e){try{return await this._serializePublicKey(e)}catch(r){throw new re(r)}}async deserializePublicKey(e){try{return await this._deserializePublicKey(e)}catch(r){throw new Q(r)}}async serializePrivateKey(e){try{return await this._serializePrivateKey(e)}catch(r){throw new re(r)}}async deserializePrivateKey(e){try{return await this._deserializePrivateKey(e)}catch(r){throw new Q(r)}}async generateKeyPair(){let e=await this._a.generateKeyPair(),r=await this._b.generateKeyPair(),n=await this._a.serializePublicKey(e.publicKey),i=await this._a.serializePrivateKey(e.privateKey),s=await this._b.serializePublicKey(r.publicKey),o=await this._b.serializePrivateKey(r.privateKey);return{publicKey:await this.deserializePublicKey(J(new Uint8Array(n),new Uint8Array(s))),privateKey:await this.deserializePrivateKey(J(new Uint8Array(i),new Uint8Array(o)))}}async deriveKeyPair(e){let r=await this._kdf.labeledExtract(ne,wt,new Uint8Array(e)),n=new Uint8Array(await this._kdf.labeledExpand(r,xt,ne,32+64)),i=n.slice(0,32),s=n.slice(32,96),o=await this._a.deriveKeyPair(i),a=await this._b.deriveKeyPair(s),u=await this._a.serializePublicKey(o.publicKey),l=await this._a.serializePrivateKey(o.privateKey),c=await this._b.serializePublicKey(a.publicKey),h=await this._b.serializePrivateKey(a.privateKey);return{publicKey:await this.deserializePublicKey(J(new Uint8Array(u),new Uint8Array(c))),privateKey:await this.deserializePrivateKey(J(new Uint8Array(l),new Uint8Array(h)))}}async importKey(e,r,n=!0){if(e!=="raw")throw new de("'jwk' is not supported");if(!(r instanceof ArrayBuffer))throw new te("Invalid type of key");return n?await this.deserializePublicKey(r):await this.deserializePrivateKey(r)}async encap(e){let r,n;if(e.ekm!==void 0&&!ie(e.ekm)){if(e.ekm.byteLength!==64)throw new te("ekm must be 32 bytes in length");r=e.ekm.slice(0,32),n=e.ekm.slice(32)}let i=new Uint8Array(await this.serializePublicKey(e.recipientPublicKey)),s=await this._a.deserializePublicKey(i.slice(0,this._a.publicKeySize)),o=await this._b.deserializePublicKey(i.slice(this._a.publicKeySize)),a=await this._a.encap({recipientPublicKey:s,ekm:r}),u=await this._b.encap({recipientPublicKey:o,ekm:n});return{sharedSecret:J(new Uint8Array(a.sharedSecret),new Uint8Array(u.sharedSecret)),enc:J(new Uint8Array(a.enc),new Uint8Array(u.enc))}}async decap(e){let r=ie(e.recipientKey)?e.recipientKey.privateKey:e.recipientKey,n=new Uint8Array(await this.serializePrivateKey(r)),i=await this._a.deserializePrivateKey(n.slice(0,this._a.privateKeySize)),s=await this._b.deserializePrivateKey(n.slice(this._a.privateKeySize)),o=await this._a.decap({recipientKey:i,enc:e.enc.slice(0,this._a.encSize)}),a=await this._b.decap({recipientKey:s,enc:e.enc.slice(this._a.encSize)});return J(new Uint8Array(o),new Uint8Array(a))}_serializePublicKey(e){return new Promise((r,n)=>{e.type!=="public"&&n(new Error("Not public key")),e.algorithm.name!==this.name&&n(new Error(`Invalid algorithm name: ${e.algorithm.name}`)),e.key.byteLength!==this.publicKeySize&&n(new Error(`Invalid key length: ${e.key.byteLength}`)),r(e.key.buffer)})}_deserializePublicKey(e){return new Promise((r,n)=>{e.byteLength!==this.publicKeySize&&n(new Error(`Invalid key length: ${e.byteLength}`)),r(new $(this.name,new Uint8Array(e),"public"))})}_serializePrivateKey(e){return new Promise((r,n)=>{e.type!=="private"&&n(new Error("Not private key")),e.algorithm.name!==this.name&&n(new Error(`Invalid algorithm name: ${e.algorithm.name}`)),e.key.byteLength!==this.privateKeySize&&n(new Error(`Invalid key length: ${e.key.byteLength}`)),r(e.key.buffer)})}_deserializePrivateKey(e){return new Promise((r,n)=>{e.byteLength!==this.privateKeySize&&n(new Error(`Invalid key length: ${e.byteLength}`)),r(new $(this.name,new Uint8Array(e),"private",["deriveBits"]))})}};var[$r,Vr,Zr]=[[],[],[]],Ui=BigInt(0),Xe=BigInt(1),zi=BigInt(2),Oi=BigInt(7),Hi=BigInt(256),Ti=BigInt(113);for(let t=0,e=Xe,r=1,n=0;t<24;t++){[r,n]=[n,(2*r+3*n)%5],$r.push(2*(5*n+r)),Vr.push((t+1)*(t+2)/2%64);let i=Ui;for(let s=0;s<7;s++)e=(e<>Oi)*Ti)%Hi,e&zi&&(i^=Xe<<(Xe<r>32?x.rotlBH(t,e,r):x.rotlSH(t,e,r),Gr=(t,e,r)=>r>32?x.rotlBL(t,e,r):x.rotlSL(t,e,r);function Ri(t,e=24){let r=new Uint32Array(10);for(let n=24-e;n<24;n++){for(let o=0;o<10;o++)r[o]=t[o]^t[o+10]^t[o+20]^t[o+30]^t[o+40];for(let o=0;o<10;o+=2){let a=(o+8)%10,u=(o+2)%10,l=r[u],c=r[u+1],h=Fr(l,c,1)^r[a],d=Gr(l,c,1)^r[a+1];for(let _=0;_<50;_+=10)t[o+_]^=h,t[o+_+1]^=d}let i=t[2],s=t[3];for(let o=0;o<24;o++){let a=Vr[o],u=Fr(i,s,a),l=Gr(i,s,a),c=$r[o];i=t[c],s=t[c+1],t[c]=u,t[c+1]=l}for(let o=0;o<50;o+=10){for(let a=0;a<10;a++)r[a]=t[o+a];for(let a=0;a<10;a++)t[o+a]^=~r[(a+2)%10]&r[(a+4)%10]}t[0]^=Ni[n],t[1]^=Ci[n]}r.fill(0)}var _t=class t extends Ee{constructor(e,r,n,i=!1,s=24){if(super(),this.blockLen=e,this.suffix=r,this.outputLen=n,this.enableXOF=i,this.rounds=s,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,q.number(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=wr(this.state)}keccak(){Ri(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){q.exists(this);let{blockLen:r,state:n}=this;e=ve(e);let i=e.length;for(let s=0;s=n&&this.keccak();let o=Math.min(n-this.posOut,s-i);e.set(r.subarray(this.posOut,this.posOut+o),i),this.posOut+=o,i+=o}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return q.number(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(q.output(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){let{blockLen:r,suffix:n,outputLen:i,rounds:s,enableXOF:o}=this;return e||(e=new t(r,n,i,o,s)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=s,e.suffix=n,e.outputLen=i,e.enableXOF=o,e.destroyed=this.destroyed,e}},ke=(t,e,r)=>he(()=>new _t(e,t,r)),Vo=ke(6,144,224/8),Xr=ke(6,136,256/8),Zo=ke(6,104,384/8),Yr=ke(6,72,512/8),Xo=ke(1,144,224/8),Yo=ke(1,136,256/8),Wo=ke(1,104,384/8),Qo=ke(1,72,512/8),Wr=(t,e,r)=>gr((n={})=>new _t(e,t,n.dkLen===void 0?r:n.dkLen,!0)),Qr=Wr(31,168,128/8),Jt=Wr(31,136,256/8);var ze=class extends qe{};function oe(t){return t%256}function ae(t){return t>=-32768&&t<=32767?t:t<-32768?(t=t+32769,t=t%65536,32767+t):(t=t-32768,t=t%65536,-32768+t)}function I(t){return t%65536}function Et(t){return t>=-2147483648&&t<=2147483647?t:t<-2147483648?(t=t+2147483649,t=t%4294967296,2147483647+t):(t=t-2147483648,t=t%4294967296,-2147483648+t)}function Ie(t){return t%4294967296}function Jr(t,e){if(t.length!=e.length)return 0;let r=new Uint8Array([0]);for(let i=0;i>4,n[0]&=n[0]>>2,n[0]&=n[0]>>1,n[0]}async function en(){if(ot!==void 0&&globalThis.crypto!==void 0)return globalThis.crypto;try{let{webcrypto:t}=await import("crypto");return t}catch{throw new Error("failed to load Crypto")}}var L=256,R=3329,Di=62209,nr=[2285,2571,2970,1812,1493,1422,287,202,3158,622,1577,182,962,2127,1855,1468,573,2004,264,383,2500,1458,1727,3199,2648,1017,732,608,1787,411,3124,1758,1223,652,2777,1015,2036,1491,3047,1785,516,3321,3009,2663,1711,2167,126,1469,2476,3239,3058,830,107,1908,3082,2378,2931,961,1821,2604,448,2264,677,2054,2226,430,555,843,2078,871,1550,105,422,587,177,3094,3038,2869,1574,1653,3083,778,1159,3182,2552,1483,2727,1119,1739,644,2457,349,418,329,3173,3254,817,1097,603,610,1322,2044,1864,384,2114,3193,1218,1994,2455,220,2142,1670,2144,1799,2051,794,1819,2475,2459,478,3221,3021,996,991,958,1869,1522,1628],tn=[1701,1807,1460,2371,2338,2333,308,108,2851,870,854,1510,2535,1278,1530,1185,1659,1187,3109,874,1335,2111,136,1215,2945,1465,1285,2007,2719,2726,2232,2512,75,156,3e3,2911,2980,872,2685,1590,2210,602,1846,777,147,2170,2551,246,1676,1755,460,291,235,3152,2742,2907,3224,1779,2458,1251,2486,2774,2899,1103,1275,2652,1065,2881,725,1508,2368,398,951,247,1421,3222,2499,271,90,853,1860,3203,1162,1618,666,320,8,2813,1544,282,1838,1293,2314,552,2677,2106,1571,205,2918,1542,2721,2597,2312,681,130,1602,1871,829,2946,3065,1325,2756,1861,1474,1202,2367,3147,1752,2707,171,3127,3042,1907,1836,1517,359,758,1441],Bt=class{constructor(){Object.defineProperty(this,"_api",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_k",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(this,"_du",{enumerable:!0,configurable:!0,writable:!0,value:10}),Object.defineProperty(this,"_dv",{enumerable:!0,configurable:!0,writable:!0,value:4}),Object.defineProperty(this,"_eta1",{enumerable:!0,configurable:!0,writable:!0,value:2}),Object.defineProperty(this,"_eta2",{enumerable:!0,configurable:!0,writable:!0,value:2})}async generateKeyPair(){await this._setup();try{let e=new Uint8Array(64);return this._api.getRandomValues(e),this._deriveKeyPair(e)}catch(e){throw new ze(e)}}async deriveKeyPair(e){await this._setup();try{if(e.byteLength!==64)throw new Error("ikm must be 64 bytes in length");return this._deriveKeyPair(e)}catch(r){throw new ze(r)}}async encap(e,r){await this._setup();try{let n=Me(this._getSeed(r)),[i,s]=er(n,Me(e)),o=this._encap(e,n,s),a=tr(i,Me(o));return[o,a]}catch(n){throw new ze(n)}}async decap(e,r){await this._setup();try{let n=e.subarray(0,12*this._k*L/8),i=e.subarray(12*this._k*L/8,24*this._k*L/8+32),s=e.subarray(24*this._k*L/8+32,24*this._k*L/8+64),o=e.subarray(24*this._k*L/8+64,24*this._k*L/8+96),a=this._decap(n,r),[u,l]=er(a,s),c=this._encap(i,a,l);return Jr(r,c)==1?tr(u,Me(r)):tr(o,Me(r))}catch(n){throw new ze(n)}}async _setup(){this._api===void 0&&(this._api=await en())}_getSeed(e){if(e==null){let r=new Uint8Array(32);return this._api.getRandomValues(r),r}if(e.byteLength!==32)throw new Error("seed must be 32 bytes in length");return e}_deriveKeyPair(e){let r=e.subarray(0,32),n=e.subarray(32,64),[i,s]=this._deriveCpaKeyPair(r),o=Me(i),a=new Uint8Array(2400);return a.set(s,0),a.set(i,1152),a.set(o,1152+1184),a.set(n,1152+1184+32),[i,a]}_deriveCpaKeyPair(e){let[r,n]=er(e),i=rn(r,this._k,!1),s=Ye(n,this._eta1,0,this._k),o=Ye(n,this._eta1,this._k,this._k);for(let c=0;c>0),e[i+1]=oe(n[0]>>8|n[1]<<2),e[i+2]=oe(n[1]>>6|n[2]<<4),e[i+3]=oe(n[2]>>4|n[3]<<6),e[i+4]=oe(n[3]>>2),i=i+5}return e}_compress2(e,r){let n=new Uint8Array(8);for(let i=0,s=0;s>0|I(e[i+1])<<8,n[1]=I(e[i+1])>>2|I(e[i+2])<<6,n[2]=I(e[i+2])>>4|I(e[i+3])<<4,n[3]=I(e[i+3])>>6|I(e[i+4])<<2,i=i+5;for(let a=0;a<4;a++)r[s][4*o+a]=ae(((Ie(n[a]&1023)>>>0)*(Ie(R)>>>0)>>>0)+512>>10>>>0)}return r}_decompress2(e){let r=new Array(384),n=0;for(let i=0;i>4),r[2*i+1]=ae(I(e[n]>>4)*I(R)+8>>4),n=n+1;return r}};function er(t,e){let r=Yr.create().update(t);e!==void 0&&r.update(e);let n=r.digest();return[n.subarray(0,32),n.subarray(32,64)]}function Me(t){return Xr.create().update(t).digest()}function tr(t,e){let r=Jt.create({dkLen:32}).update(t);return e!==void 0&&r.update(e),r.digest()}function Mi(t,e){return Qr.create({dkLen:672}).update(t).update(e).digest()}function rn(t,e,r){let n=new Array(3),i=new Uint8Array(2);for(let s=0,o=0;o>0),n[3*s+1]=oe(e>>8)|oe(r<<4),n[3*s+2]=oe(r>>4);return n}function sn(t){let e=new Array(384).fill(0);for(let r=0;r>0|I(t[3*r+1])<<8)&4095),e[2*r+1]=ae((I(t[3*r+1])>>4|I(t[3*r+2])<<4)&4095);return e}function ji(t){let e=new Uint8Array(32),r,n=fn(t);for(let i=0;i>i&1),e[8*n+i]=r&ae((R+1)/2);return e}function on(t,e,r){let n=new Array(384).fill(0),i=0,s,o;for(let a=0;i>0)|I(t[a+1])<<8)&4095,o=(I(t[a+1]>>4)|I(t[a+2])<<4)&4095,a=a+3,s>>0,n=(r&1431655765)>>>0,n=n+((r>>1>>>0&1431655765)>>>0)>>>0;for(let u=0;u<8;u++)i=ae((n>>4*u+0>>>0&3)>>>0),s=ae((n>>4*u+e>>>0&3)>>>0),o[8*a+u]=i-s}return o}function $i(t){let e=Ie(t[0]);return e=(e|Ie(t[1])<<8)>>>0>>>0,e=(e|Ie(t[2])<<16)>>>0>>>0,e=(e|Ie(t[3])<<24)>>>0>>>0,Ie(e)}function vt(t){for(let e=0,r=1,n=128;n>=2;n>>=1)for(let i=0;i<256;i=e+n){let s=nr[r];for(r=r+1,e=i;e>24;return r=r*R,t-r}function ln(t){let r=ae(Et(t)*Di)*R;return r=t-r,r>>=16,ae(r)}function Vi(t){for(let r=0;r>31&R);return t}var Kt="Keyber768",Pt=class{constructor(){Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:be.NotAssigned}),Object.defineProperty(this,"secretSize",{enumerable:!0,configurable:!0,writable:!0,value:32}),Object.defineProperty(this,"encSize",{enumerable:!0,configurable:!0,writable:!0,value:1088}),Object.defineProperty(this,"publicKeySize",{enumerable:!0,configurable:!0,writable:!0,value:1184}),Object.defineProperty(this,"privateKeySize",{enumerable:!0,configurable:!0,writable:!0,value:2400}),Object.defineProperty(this,"_prim",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._prim=new Bt}async serializePublicKey(e){try{return await this._serializePublicKey(e)}catch(r){throw new re(r)}}async deserializePublicKey(e){try{return await this._deserializePublicKey(e)}catch(r){throw new Q(r)}}async serializePrivateKey(e){try{return await this._serializePrivateKey(e)}catch(r){throw new re(r)}}async deserializePrivateKey(e){try{return await this._deserializePrivateKey(e)}catch(r){throw new Q(r)}}async generateKeyPair(){let e=await this._prim.generateKeyPair(),r=await this.deserializePrivateKey(e[1]);return{publicKey:await this.deserializePublicKey(e[0]),privateKey:r}}async deriveKeyPair(e){if(e.byteLength>8192)throw new te("Too long ikm");try{let r=await this._prim.deriveKeyPair(new Uint8Array(e)),n=await this.deserializePrivateKey(r[1]);return{publicKey:await this.deserializePublicKey(r[0]),privateKey:n}}catch(r){throw new Ce(r)}}async importKey(e,r,n=!0){if(e!=="raw")throw new de("'jwk' is not supported");return n?await this.deserializePublicKey(r):await this.deserializePrivateKey(r)}async encap(e){let r;if(e.ekm!==void 0&&!ie(e)){if(e.ekm.byteLength!==32)throw new te("ekm must be 32 bytes in length");r=new Uint8Array(e.ekm)}let n=new Uint8Array(await this.serializePublicKey(e.recipientPublicKey));try{let i=await this._prim.encap(n,r);return{sharedSecret:i[1],enc:i[0]}}catch(i){throw new Te(i)}}async decap(e){let r=ie(e.recipientKey)?e.recipientKey.privateKey:e.recipientKey,n=new Uint8Array(await this.serializePrivateKey(r));try{return await this._prim.decap(n,new Uint8Array(e.enc))}catch(i){throw new Ne(i)}}_serializePublicKey(e){return new Promise((r,n)=>{e.type!=="public"&&n(new Error("Not public key")),e.algorithm.name!==Kt&&n(new Error(`Invalid algorithm name: ${e.algorithm.name}`)),e.key.byteLength!==this.publicKeySize&&n(new Error(`Invalid key length: ${e.key.byteLength}`)),r(e.key.buffer)})}_deserializePublicKey(e){return new Promise((r,n)=>{e.byteLength!==this.publicKeySize&&n(new Error(`Invalid key length: ${e.byteLength}`)),r(new $(Kt,new Uint8Array(e),"public"))})}_serializePrivateKey(e){return new Promise((r,n)=>{e.type!=="private"&&n(new Error("Not private key")),e.algorithm.name!==Kt&&n(new Error(`Invalid algorithm name: ${e.algorithm.name}`)),e.key.byteLength!==this.privateKeySize&&n(new Error(`Invalid key length: ${e.key.byteLength}`)),r(e.key.buffer)})}_deserializePrivateKey(e){return new Promise((r,n)=>{e.byteLength!==this.privateKeySize&&n(new Error(`Invalid key length: ${e.byteLength}`)),r(new $(Kt,new Uint8Array(e),"private",["deriveBits"]))})}};var ir=class extends ft{constructor(){let e=new Fe;super(be.DhkemX25519HkdfSha256,new gt(e),e),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:be.DhkemX25519HkdfSha256}),Object.defineProperty(this,"secretSize",{enumerable:!0,configurable:!0,writable:!0,value:32}),Object.defineProperty(this,"encSize",{enumerable:!0,configurable:!0,writable:!0,value:32}),Object.defineProperty(this,"publicKeySize",{enumerable:!0,configurable:!0,writable:!0,value:32}),Object.defineProperty(this,"privateKeySize",{enumerable:!0,configurable:!0,writable:!0,value:32})}get kdf(){return this._kdf}},sr=class extends mt{constructor(){super(be.HybridkemX25519Kyber768,new ir,new Pt,new Fe),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:be.HybridkemX25519Kyber768}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"X25519Kyber25519"}),Object.defineProperty(this,"secretSize",{enumerable:!0,configurable:!0,writable:!0,value:64}),Object.defineProperty(this,"encSize",{enumerable:!0,configurable:!0,writable:!0,value:1120}),Object.defineProperty(this,"publicKeySize",{enumerable:!0,configurable:!0,writable:!0,value:1216}),Object.defineProperty(this,"privateKeySize",{enumerable:!0,configurable:!0,writable:!0,value:2432}),Object.defineProperty(this,"auth",{enumerable:!0,configurable:!0,writable:!0,value:!1})}};export{sr as HybridkemX25519Kyber768}; +var Cn={NotAssigned:0,DhkemP256HkdfSha256:16,DhkemP384HkdfSha384:17,DhkemP521HkdfSha512:18,DhkemSecp256k1HkdfSha256:19,DhkemX25519HkdfSha256:32,DhkemX448HkdfSha512:33,HybridkemX25519Kyber768:48},pe=Cn,Rn={HkdfSha256:1,HkdfSha384:2,HkdfSha512:3},Rt=Rn;function je(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`Wrong positive integer: ${t}`)}function Me(t,...e){if(!(t instanceof Uint8Array))throw new Error("Expected Uint8Array");if(e.length>0&&!e.includes(t.length))throw new Error(`Expected Uint8Array of length ${e}, not of length=${t.length}`)}function Sr(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");je(t.outputLen),je(t.blockLen)}function ye(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function rt(t,e){Me(t);let r=e.outputLen;if(t.lengtht instanceof Uint8Array;var kr=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4)),nt=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),ae=(t,e)=>t<<32-e|t>>>e,jn=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!jn)throw new Error("Non little-endian hardware is not supported");function Mn(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function Ee(t){if(typeof t=="string"&&(t=Mn(t)),!Dn(t))throw new Error(`expected Uint8Array, got ${typeof t}`);return t}var _e=class{clone(){return this._cloneInto()}},xo={}.toString;function it(t){let e=n=>t().update(Ee(n)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}function Pr(t){let e=(n,i)=>t(i).update(Ee(n)).digest(),r=t({});return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=n=>t(n),e}var ot=class extends _e{constructor(e,r){super(),this.finished=!1,this.destroyed=!1,Sr(e);let n=Ee(r);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let i=this.blockLen,o=new Uint8Array(i);o.set(n.length>i?e.create().update(n).digest():n);for(let s=0;snew ot(t,e).update(r).digest();Dt.create=(t,e)=>new ot(t,e);function qn(t,e,r,n){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,r,n);let i=BigInt(32),o=BigInt(4294967295),s=Number(r>>i&o),c=Number(r&o),u=n?4:0,l=n?0:4;t.setUint32(e+u,s,n),t.setUint32(e+l,c,n)}var st=class extends _e{constructor(e,r,n,i){super(),this.blockLen=e,this.outputLen=r,this.padOffset=n,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=nt(this.buffer)}update(e){ye(this);let{view:r,buffer:n,blockLen:i}=this;e=Ee(e);let o=e.length;for(let s=0;si-s&&(this.process(n,0),s=0);for(let f=s;fa.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;ft&e^~t&r,Vn=(t,e,r)=>t&e^t&r^e&r,$n=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),ve=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Ae=new Uint32Array(64),jt=class extends st{constructor(){super(64,32,8,!1),this.A=ve[0]|0,this.B=ve[1]|0,this.C=ve[2]|0,this.D=ve[3]|0,this.E=ve[4]|0,this.F=ve[5]|0,this.G=ve[6]|0,this.H=ve[7]|0}get(){let{A:e,B:r,C:n,D:i,E:o,F:s,G:c,H:u}=this;return[e,r,n,i,o,s,c,u]}set(e,r,n,i,o,s,c,u){this.A=e|0,this.B=r|0,this.C=n|0,this.D=i|0,this.E=o|0,this.F=s|0,this.G=c|0,this.H=u|0}process(e,r){for(let f=0;f<16;f++,r+=4)Ae[f]=e.getUint32(r,!1);for(let f=16;f<64;f++){let d=Ae[f-15],m=Ae[f-2],y=ae(d,7)^ae(d,18)^d>>>3,P=ae(m,17)^ae(m,19)^m>>>10;Ae[f]=P+Ae[f-7]+y+Ae[f-16]|0}let{A:n,B:i,C:o,D:s,E:c,F:u,G:l,H:a}=this;for(let f=0;f<64;f++){let d=ae(c,6)^ae(c,11)^ae(c,25),m=a+d+Fn(c,u,l)+$n[f]+Ae[f]|0,P=(ae(n,2)^ae(n,13)^ae(n,22))+Vn(n,i,o)|0;a=l,l=u,u=c,c=s+m|0,s=o,o=i,i=n,n=m+P|0}n=n+this.A|0,i=i+this.B|0,o=o+this.C|0,s=s+this.D|0,c=c+this.E|0,u=u+this.F|0,l=l+this.G|0,a=a+this.H|0,this.set(n,i,o,s,c,u,l,a)}roundClean(){Ae.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}};var Kr=it(()=>new jt);var Gn={},ct=Zn(globalThis,Gn);function Zn(t,e){return new Proxy(t,{get(r,n,i){return n in e?e[n]:t[n]},set(r,n,i){return n in e&&delete e[n],t[n]=i,!0},deleteProperty(r,n){let i=!1;return n in e&&(delete e[n],i=!0),n in t&&(delete t[n],i=!0),i},ownKeys(r){let n=Reflect.ownKeys(t),i=Reflect.ownKeys(e),o=new Set(i);return[...n.filter(s=>!o.has(s)),...i]},defineProperty(r,n,i){return n in e&&delete e[n],Reflect.defineProperty(t,n,i),!0},getOwnPropertyDescriptor(r,n){return n in e?Reflect.getOwnPropertyDescriptor(e,n):Reflect.getOwnPropertyDescriptor(t,n)},has(r,n){return n in e||n in t}})}var qe=class extends Error{constructor(e){let r;e instanceof Error?r=e.message:typeof e=="string"?r=e:r="",super(r),this.name=this.constructor.name}},be=class extends qe{},ee=class extends be{};var te=class extends be{},Y=class extends be{},Oe=class extends be{},He=class extends be{};var Te=class extends be{},fe=class extends be{};async function Xn(){if(ct!==void 0&&globalThis.crypto!==void 0)return globalThis.crypto.subtle;try{let{webcrypto:t}=await import("crypto");return t.subtle}catch(t){throw new fe(t)}}var at=class{constructor(){Object.defineProperty(this,"_api",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}async _setup(){this._api===void 0&&(this._api=await Xn())}};var re=new Uint8Array(0);var Ir=new Uint8Array([72,80,75,69,45,118,49]),Mt=class extends at{constructor(){super(),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:Rt.HkdfSha256}),Object.defineProperty(this,"hashSize",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_suiteId",{enumerable:!0,configurable:!0,writable:!0,value:re}),Object.defineProperty(this,"algHash",{enumerable:!0,configurable:!0,writable:!0,value:{name:"HMAC",hash:"SHA-256",length:256}})}init(e){this._suiteId=e}buildLabeledIkm(e,r){this._checkInit();let n=new Uint8Array(7+this._suiteId.byteLength+e.byteLength+r.byteLength);return n.set(Ir,0),n.set(this._suiteId,7),n.set(e,7+this._suiteId.byteLength),n.set(r,7+this._suiteId.byteLength+e.byteLength),n}buildLabeledInfo(e,r,n){this._checkInit();let i=new Uint8Array(9+this._suiteId.byteLength+e.byteLength+r.byteLength);return i.set(new Uint8Array([0,n]),0),i.set(Ir,2),i.set(this._suiteId,9),i.set(e,9+this._suiteId.byteLength),i.set(r,9+this._suiteId.byteLength+e.byteLength),i}async extract(e,r){if(await this._setup(),e.byteLength===0&&(e=new ArrayBuffer(this.hashSize)),e.byteLength!==this.hashSize)throw new ee("The salt length must be the same as the hashSize");let n=await this._api.importKey("raw",e,this.algHash,!1,["sign"]);return await this._api.sign("HMAC",n,r)}async expand(e,r,n){await this._setup();let i=await this._api.importKey("raw",e,this.algHash,!1,["sign"]),o=new ArrayBuffer(n),s=new Uint8Array(o),c=re,u=new Uint8Array(r),l=new Uint8Array(1);if(n>255*this.hashSize)throw new Error("Entropy limit reached");let a=new Uint8Array(this.hashSize+u.length+1);for(let f=1,d=0;d=c.length?(s.set(c,d),d+=c.length):(s.set(c.slice(0,s.length-d),d),d+=s.length-d);return o}async extractAndExpand(e,r,n,i){await this._setup();let o=await this._api.importKey("raw",r,"HKDF",!1,["deriveBits"]);return await this._api.deriveBits({name:"HKDF",hash:this.algHash.hash,salt:e,info:n},o,i*8)}async labeledExtract(e,r,n){return await this.extract(e,this.buildLabeledIkm(r,n))}async labeledExpand(e,r,n,i){return await this.expand(e,this.buildLabeledInfo(r,n,i),i)}_checkInit(){if(this._suiteId===re)throw new Error("Not initialized. Call init()")}},ut=class extends Mt{constructor(){super(...arguments),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:Rt.HkdfSha256}),Object.defineProperty(this,"hashSize",{enumerable:!0,configurable:!0,writable:!0,value:32}),Object.defineProperty(this,"algHash",{enumerable:!0,configurable:!0,writable:!0,value:{name:"HMAC",hash:"SHA-256",length:256}})}};var Fe=class extends ut{async extract(e,r){if(await this._setup(),e.byteLength===0&&(e=new ArrayBuffer(this.hashSize)),e.byteLength!==this.hashSize)return Dt(Kr,new Uint8Array(e),new Uint8Array(r));let n=await this._api.importKey("raw",e,this.algHash,!1,["sign"]);return await this._api.sign("HMAC",n,r)}};var lt=new Uint8Array([75,69,77,0,0]);var ne=t=>typeof t=="object"&&t!==null&&typeof t.privateKey=="object"&&typeof t.publicKey=="object";function ft(t,e){if(e<=0)throw new Error("i2Osp: too small size");if(t>=256**e)throw new Error("i2Osp: too large integer");let r=new Uint8Array(e);for(let n=0;n>8;return r}function Q(t,e){let r=new Uint8Array(t.length+e.length);return r.set(t,0),r.set(e,t.length),r}function qt(t){let e=t.replace(/-/g,"+").replace(/_/g,"/"),r=atob(e),n=new Uint8Array(r.length);for(let i=0;i8192)throw new ee("Too long ikm");return await this._prim.deriveKeyPair(e)}async encap(e){let r;e.ekm===void 0?r=await this.generateKeyPair():ne(e.ekm)?r=e.ekm:r=await this.deriveKeyPair(e.ekm);let n=await this._prim.serializePublicKey(r.publicKey),i=await this._prim.serializePublicKey(e.recipientPublicKey);try{let o;if(e.senderKey===void 0)o=new Uint8Array(await this._prim.dh(r.privateKey,e.recipientPublicKey));else{let u=ne(e.senderKey)?e.senderKey.privateKey:e.senderKey,l=new Uint8Array(await this._prim.dh(r.privateKey,e.recipientPublicKey)),a=new Uint8Array(await this._prim.dh(u,e.recipientPublicKey));o=Q(l,a)}let s;if(e.senderKey===void 0)s=Q(new Uint8Array(n),new Uint8Array(i));else{let u=ne(e.senderKey)?e.senderKey.publicKey:await this._prim.derivePublicKey(e.senderKey),l=await this._prim.serializePublicKey(u);s=Qn(new Uint8Array(n),new Uint8Array(i),new Uint8Array(l))}let c=await this._generateSharedSecret(o,s);return{enc:n,sharedSecret:c}}catch(o){throw new Oe(o)}}async decap(e){let r=await this._prim.deserializePublicKey(e.enc),n=ne(e.recipientKey)?e.recipientKey.privateKey:e.recipientKey,i=ne(e.recipientKey)?e.recipientKey.publicKey:await this._prim.derivePublicKey(e.recipientKey),o=await this._prim.serializePublicKey(i);try{let s;if(e.senderPublicKey===void 0)s=new Uint8Array(await this._prim.dh(n,r));else{let u=new Uint8Array(await this._prim.dh(n,r)),l=new Uint8Array(await this._prim.dh(n,e.senderPublicKey));s=Q(u,l)}let c;if(e.senderPublicKey===void 0)c=Q(new Uint8Array(e.enc),new Uint8Array(o));else{let u=await this._prim.serializePublicKey(e.senderPublicKey);c=new Uint8Array(e.enc.byteLength+o.byteLength+u.byteLength),c.set(new Uint8Array(e.enc),0),c.set(new Uint8Array(o),e.enc.byteLength),c.set(new Uint8Array(u),e.enc.byteLength+o.byteLength)}return await this._generateSharedSecret(s,c)}catch(s){throw new He(s)}}async _generateSharedSecret(e,r){let n=this._kdf.buildLabeledIkm(Wn,e),i=this._kdf.buildLabeledInfo(Yn,r,this.secretSize);return await this._kdf.extractAndExpand(re,n,i,this.secretSize)}};function Vt(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`Wrong positive integer: ${t}`)}function Jn(t){if(typeof t!="boolean")throw new Error(`Expected boolean, not ${t}`)}function Ur(t,...e){if(!(t instanceof Uint8Array))throw new Error("Expected Uint8Array");if(e.length>0&&!e.includes(t.length))throw new Error(`Expected Uint8Array of length ${e}, not of length=${t.length}`)}function ei(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Vt(t.outputLen),Vt(t.blockLen)}function ti(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function ri(t,e){Ur(t);let r=e.outputLen;if(t.lengtht instanceof Uint8Array;var bt=t=>new DataView(t.buffer,t.byteOffset,t.byteLength);var ii=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!ii)throw new Error("Non little-endian hardware is not supported");var Qo=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function $t(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function Gt(t){if(typeof t=="string"&&(t=$t(t)),!zr(t))throw new Error(`expected Uint8Array, got ${typeof t}`);return t}function Or(...t){let e=new Uint8Array(t.reduce((n,i)=>n+i.length,0)),r=0;return t.forEach(n=>{if(!zr(n))throw new Error("Uint8Array expected");e.set(n,r),r+=n.length}),e}var yt=class{clone(){return this._cloneInto()}};function Ve(t){let e=n=>t().update(Gt(n)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}function Zt(t=32){if(pt&&typeof pt.getRandomValues=="function")return pt.getRandomValues(new Uint8Array(t));throw new Error("crypto.getRandomValues must be defined")}function oi(t,e,r,n){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,r,n);let i=BigInt(32),o=BigInt(4294967295),s=Number(r>>i&o),c=Number(r&o),u=n?4:0,l=n?0:4;t.setUint32(e+u,s,n),t.setUint32(e+l,c,n)}var wt=class extends yt{constructor(e,r,n,i){super(),this.blockLen=e,this.outputLen=r,this.padOffset=n,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=bt(this.buffer)}update(e){dt.exists(this);let{view:r,buffer:n,blockLen:i}=this;e=Gt(e);let o=e.length;for(let s=0;si-s&&(this.process(n,0),s=0);for(let f=s;fa.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;f>Xt&xt)}:{h:Number(t>>Xt&xt)|0,l:Number(t&xt)|0}}function si(t,e=!1){let r=new Uint32Array(t.length),n=new Uint32Array(t.length);for(let i=0;iBigInt(t>>>0)<>>0),ai=(t,e,r)=>t>>>r,ui=(t,e,r)=>t<<32-r|e>>>r,li=(t,e,r)=>t>>>r|e<<32-r,fi=(t,e,r)=>t<<32-r|e>>>r,hi=(t,e,r)=>t<<64-r|e>>>r-32,di=(t,e,r)=>t>>>r-32|e<<64-r,pi=(t,e)=>e,yi=(t,e)=>t,bi=(t,e,r)=>t<>>32-r,wi=(t,e,r)=>e<>>32-r,xi=(t,e,r)=>e<>>64-r,gi=(t,e,r)=>t<>>64-r;function mi(t,e,r,n){let i=(e>>>0)+(n>>>0);return{h:t+r+(i/2**32|0)|0,l:i|0}}var _i=(t,e,r)=>(t>>>0)+(e>>>0)+(r>>>0),Ei=(t,e,r,n)=>e+r+n+(t/2**32|0)|0,vi=(t,e,r,n)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0),Ai=(t,e,r,n,i)=>e+r+n+i+(t/2**32|0)|0,Bi=(t,e,r,n,i)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0)+(i>>>0),Si=(t,e,r,n,i,o)=>e+r+n+i+o+(t/2**32|0)|0,ki={fromBig:Hr,split:si,toBig:ci,shrSH:ai,shrSL:ui,rotrSH:li,rotrSL:fi,rotrBH:hi,rotrBL:di,rotr32H:pi,rotr32L:yi,rotlSH:bi,rotlSL:wi,rotlBH:xi,rotlBL:gi,add:mi,add3L:_i,add3H:Ei,add4L:vi,add4H:Ai,add5H:Si,add5L:Bi},_=ki;var[Pi,Ki]=_.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(t=>BigInt(t))),Be=new Uint32Array(80),Se=new Uint32Array(80),Ne=class extends wt{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){let{Ah:e,Al:r,Bh:n,Bl:i,Ch:o,Cl:s,Dh:c,Dl:u,Eh:l,El:a,Fh:f,Fl:d,Gh:m,Gl:y,Hh:P,Hl:k}=this;return[e,r,n,i,o,s,c,u,l,a,f,d,m,y,P,k]}set(e,r,n,i,o,s,c,u,l,a,f,d,m,y,P,k){this.Ah=e|0,this.Al=r|0,this.Bh=n|0,this.Bl=i|0,this.Ch=o|0,this.Cl=s|0,this.Dh=c|0,this.Dl=u|0,this.Eh=l|0,this.El=a|0,this.Fh=f|0,this.Fl=d|0,this.Gh=m|0,this.Gl=y|0,this.Hh=P|0,this.Hl=k|0}process(e,r){for(let p=0;p<16;p++,r+=4)Be[p]=e.getUint32(r),Se[p]=e.getUint32(r+=4);for(let p=16;p<80;p++){let E=Be[p-15]|0,x=Se[p-15]|0,D=_.rotrSH(E,x,1)^_.rotrSH(E,x,8)^_.shrSH(E,x,7),ce=_.rotrSL(E,x,1)^_.rotrSL(E,x,8)^_.shrSL(E,x,7),O=Be[p-2]|0,T=Se[p-2]|0,F=_.rotrSH(O,T,19)^_.rotrBH(O,T,61)^_.shrSH(O,T,6),j=_.rotrSL(O,T,19)^_.rotrBL(O,T,61)^_.shrSL(O,T,6),W=_.add4L(ce,j,Se[p-7],Se[p-16]),N=_.add4H(W,D,F,Be[p-7],Be[p-16]);Be[p]=N|0,Se[p]=W|0}let{Ah:n,Al:i,Bh:o,Bl:s,Ch:c,Cl:u,Dh:l,Dl:a,Eh:f,El:d,Fh:m,Fl:y,Gh:P,Gl:k,Hh:q,Hl:X}=this;for(let p=0;p<80;p++){let E=_.rotrSH(f,d,14)^_.rotrSH(f,d,18)^_.rotrBH(f,d,41),x=_.rotrSL(f,d,14)^_.rotrSL(f,d,18)^_.rotrBL(f,d,41),D=f&m^~f&P,ce=d&y^~d&k,O=_.add5L(X,x,ce,Ki[p],Se[p]),T=_.add5H(O,q,E,D,Pi[p],Be[p]),F=O|0,j=_.rotrSH(n,i,28)^_.rotrBH(n,i,34)^_.rotrBH(n,i,39),W=_.rotrSL(n,i,28)^_.rotrBL(n,i,34)^_.rotrBL(n,i,39),N=n&o^n&c^o&c,De=i&s^i&u^s&u;q=P|0,X=k|0,P=m|0,k=y|0,m=f|0,y=d|0,{h:f,l:d}=_.add(l|0,a|0,T|0,F|0),l=c|0,a=u|0,c=o|0,u=s|0,o=n|0,s=i|0;let ge=_.add3L(F,W,De);n=_.add3H(ge,T,j,N),i=ge|0}({h:n,l:i}=_.add(this.Ah|0,this.Al|0,n|0,i|0)),{h:o,l:s}=_.add(this.Bh|0,this.Bl|0,o|0,s|0),{h:c,l:u}=_.add(this.Ch|0,this.Cl|0,c|0,u|0),{h:l,l:a}=_.add(this.Dh|0,this.Dl|0,l|0,a|0),{h:f,l:d}=_.add(this.Eh|0,this.El|0,f|0,d|0),{h:m,l:y}=_.add(this.Fh|0,this.Fl|0,m|0,y|0),{h:P,l:k}=_.add(this.Gh|0,this.Gl|0,P|0,k|0),{h:q,l:X}=_.add(this.Hh|0,this.Hl|0,q|0,X|0),this.set(n,i,o,s,c,u,l,a,f,d,m,y,P,k,q,X)}roundClean(){Be.fill(0),Se.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}},Wt=class extends Ne{constructor(){super(),this.Ah=-1942145080,this.Al=424955298,this.Bh=1944164710,this.Bl=-1982016298,this.Ch=502970286,this.Cl=855612546,this.Dh=1738396948,this.Dl=1479516111,this.Eh=258812777,this.El=2077511080,this.Fh=2011393907,this.Fl=79989058,this.Gh=1067287976,this.Gl=1780299464,this.Hh=286451373,this.Hl=-1848208735,this.outputLen=28}},Yt=class extends Ne{constructor(){super(),this.Ah=573645204,this.Al=-64227540,this.Bh=-1621794909,this.Bl=-934517566,this.Ch=596883563,this.Cl=1867755857,this.Dh=-1774684391,this.Dl=1497426621,this.Eh=-1775747358,this.El=-1467023389,this.Fh=-1101128155,this.Fl=1401305490,this.Gh=721525244,this.Gl=746961066,this.Hh=246885852,this.Hl=-2117784414,this.outputLen=32}},Qt=class extends Ne{constructor(){super(),this.Ah=-876896931,this.Al=-1056596264,this.Bh=1654270250,this.Bl=914150663,this.Ch=-1856437926,this.Cl=812702999,this.Dh=355462360,this.Dl=-150054599,this.Eh=1731405415,this.El=-4191439,this.Fh=-1900787065,this.Fl=1750603025,this.Gh=-619958771,this.Gl=1694076839,this.Hh=1203062813,this.Hl=-1090891868,this.outputLen=48}},Jt=Ve(()=>new Ne),cs=Ve(()=>new Wt),as=Ve(()=>new Yt),us=Ve(()=>new Qt);var fs=BigInt(0),Li=BigInt(1),Ii=BigInt(2),gt=t=>t instanceof Uint8Array,Ui=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function $e(t){if(!gt(t))throw new Error("Uint8Array expected");let e="";for(let r=0;rn+i.length,0)),r=0;return t.forEach(n=>{if(!gt(n))throw new Error("Uint8Array expected");e.set(n,r),r+=n.length}),e}var Cr=t=>(Ii<typeof t=="bigint",function:t=>typeof t=="function",boolean:t=>typeof t=="boolean",string:t=>typeof t=="string",isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,e)=>e.Fp.isValid(t),hash:t=>typeof t=="function"&&Number.isSafeInteger(t.outputLen)};function we(t,e,r={}){let n=(i,o,s)=>{let c=zi[o];if(typeof c!="function")throw new Error(`Invalid validator "${o}", expected function`);let u=t[i];if(!(s&&u===void 0)&&!c(u,t))throw new Error(`Invalid param ${String(i)}=${u} (${typeof u}), expected ${o}`)};for(let[i,o]of Object.entries(e))n(i,o,!1);for(let[i,o]of Object.entries(r))n(i,o,!0);return t}var C=BigInt(0),H=BigInt(1),Ie=BigInt(2),Hi=BigInt(3),rr=BigInt(4),Rr=BigInt(5),Dr=BigInt(8),Ti=BigInt(9),Ni=BigInt(16);function U(t,e){let r=t%e;return r>=C?r:e+r}function nr(t,e,r){if(r<=C||e 0");if(r===H)return C;let n=H;for(;e>C;)e&H&&(n=n*t%r),t=t*t%r,e>>=H;return n}function ie(t,e,r){let n=t;for(;e-- >C;)n*=n,n%=r;return n}function jr(t,e){if(t===C||e<=C)throw new Error(`invert: expected positive integers, got n=${t} mod=${e}`);let r=U(t,e),n=e,i=C,o=H,s=H,c=C;for(;r!==C;){let l=n/r,a=n%r,f=i-s*l,d=o-c*l;n=r,r=a,i=s,o=c,s=f,c=d}if(n!==H)throw new Error("invert: does not exist");return U(i,e)}function Ci(t){let e=(t-H)/Ie,r,n,i;for(r=t-H,n=0;r%Ie===C;r/=Ie,n++);for(i=Ie;i(U(t,e)&H)===H,Di=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function qr(t){let e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},r=Di.reduce((n,i)=>(n[i]="function",n),e);return we(t,r)}function ji(t,e,r){if(r 0");if(r===C)return t.ONE;if(r===H)return e;let n=t.ONE,i=e;for(;r>C;)r&H&&(n=t.mul(n,i)),i=t.sqr(i),r>>=H;return n}function Mi(t,e){let r=new Array(e.length),n=e.reduce((o,s,c)=>t.is0(s)?o:(r[c]=o,t.mul(o,s)),t.ONE),i=t.inv(n);return e.reduceRight((o,s,c)=>t.is0(s)?o:(r[c]=t.mul(o,r[c]),t.mul(o,s)),i),r}function ir(t,e){let r=e!==void 0?e:t.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function Fr(t,e,r=!1,n={}){if(t<=C)throw new Error(`Expected Fp ORDER > 0, got ${t}`);let{nBitLength:i,nByteLength:o}=ir(t,e);if(o>2048)throw new Error("Field lengths over 2048 bytes are not supported");let s=Ri(t),c=Object.freeze({ORDER:t,BITS:i,BYTES:o,MASK:Cr(i),ZERO:C,ONE:H,create:u=>U(u,t),isValid:u=>{if(typeof u!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof u}`);return C<=u&&uu===C,isOdd:u=>(u&H)===H,neg:u=>U(-u,t),eql:(u,l)=>u===l,sqr:u=>U(u*u,t),add:(u,l)=>U(u+l,t),sub:(u,l)=>U(u-l,t),mul:(u,l)=>U(u*l,t),pow:(u,l)=>ji(c,u,l),div:(u,l)=>U(u*jr(l,t),t),sqrN:u=>u*u,addN:(u,l)=>u+l,subN:(u,l)=>u-l,mulN:(u,l)=>u*l,inv:u=>jr(u,t),sqrt:n.sqrt||(u=>s(c,u)),invertBatch:u=>Mi(c,u),cmov:(u,l,a)=>a?l:u,toBytes:u=>r?ke(u,o):tr(u,o),fromBytes:u=>{if(u.length!==o)throw new Error(`Fp.fromBytes: expected ${o}, got ${u.length}`);return r?he(u):er(u)}});return Object.freeze(c)}function Vr(t,e){if(!t.isOdd)throw new Error("Field doesn't have isOdd");let r=t.sqrt(e);return t.isOdd(r)?t.neg(r):r}var qi=BigInt(0),or=BigInt(1);function $r(t,e){let r=(i,o)=>{let s=o.negate();return i?s:o},n=i=>{let o=Math.ceil(e/i)+1,s=2**(i-1);return{windows:o,windowSize:s}};return{constTimeNegate:r,unsafeLadder(i,o){let s=t.ZERO,c=i;for(;o>qi;)o&or&&(s=s.add(c)),c=c.double(),o>>=or;return s},precomputeWindow(i,o){let{windows:s,windowSize:c}=n(o),u=[],l=i,a=l;for(let f=0;f>=m,k>u&&(k-=d,s+=or);let q=P,X=P+Math.abs(k)-1,p=y%2!==0,E=k<0;k===0?a=a.add(r(p,o[q])):l=l.add(r(E,o[X]))}return{p:l,f:a}},wNAFCached(i,o,s,c){let u=i._WINDOW_SIZE||1,l=o.get(i);return l||(l=this.precomputeWindow(i,u),u!==1&&o.set(i,c(l))),this.wNAF(u,l,s)}}}function Gr(t){return qr(t.Fp),we(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...ir(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}var ue=BigInt(0),J=BigInt(1),_t=BigInt(2),Fi=BigInt(8),Vi={zip215:!0};function $i(t){let e=Gr(t);return we(t,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...e})}function Et(t){let e=$i(t),{Fp:r,n,prehash:i,hash:o,randomBytes:s,nByteLength:c,h:u}=e,l=_t<{try{return{isValid:!0,value:r.sqrt(b*r.inv(h))}}catch{return{isValid:!1,value:ue}}}),d=e.adjustScalarBytes||(b=>b),m=e.domain||((b,h,w)=>{if(h.length||w)throw new Error("Contexts/pre-hash are not supported");return b}),y=b=>typeof b=="bigint"&&uey(b)&&y(h)&&bb===ue||P(b,l);function q(b,h){if(P(b,h))return b;throw new Error(`Expected valid scalar < ${h}, got ${typeof b} ${b}`)}function X(b){return b===ue?b:q(b,n)}let p=new Map;function E(b){if(!(b instanceof x))throw new Error("ExtendedPoint expected")}class x{constructor(h,w,g,v){if(this.ex=h,this.ey=w,this.ez=g,this.et=v,!k(h))throw new Error("x required");if(!k(w))throw new Error("y required");if(!k(g))throw new Error("z required");if(!k(v))throw new Error("t required")}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(h){if(h instanceof x)throw new Error("extended point not allowed");let{x:w,y:g}=h||{};if(!k(w)||!k(g))throw new Error("invalid affine point");return new x(w,g,J,a(w*g))}static normalizeZ(h){let w=r.invertBatch(h.map(g=>g.ez));return h.map((g,v)=>g.toAffine(w[v])).map(x.fromAffine)}_setWindowSize(h){this._WINDOW_SIZE=h,p.delete(this)}assertValidity(){let{a:h,d:w}=e;if(this.is0())throw new Error("bad point: ZERO");let{ex:g,ey:v,ez:A,et:S}=this,I=a(g*g),B=a(v*v),K=a(A*A),M=a(K*K),$=a(I*h),le=a(K*a($+B)),G=a(M+a(w*a(I*B)));if(le!==G)throw new Error("bad point: equation left != right (1)");let me=a(g*v),de=a(A*S);if(me!==de)throw new Error("bad point: equation left != right (2)")}equals(h){E(h);let{ex:w,ey:g,ez:v}=this,{ex:A,ey:S,ez:I}=h,B=a(w*I),K=a(A*v),M=a(g*I),$=a(S*v);return B===K&&M===$}is0(){return this.equals(x.ZERO)}negate(){return new x(a(-this.ex),this.ey,this.ez,a(-this.et))}double(){let{a:h}=e,{ex:w,ey:g,ez:v}=this,A=a(w*w),S=a(g*g),I=a(_t*a(v*v)),B=a(h*A),K=w+g,M=a(a(K*K)-A-S),$=B+S,le=$-I,G=B-S,me=a(M*le),de=a($*G),et=a(M*G),tt=a(le*$);return new x(me,de,tt,et)}add(h){E(h);let{a:w,d:g}=e,{ex:v,ey:A,ez:S,et:I}=this,{ex:B,ey:K,ez:M,et:$}=h;if(w===BigInt(-1)){let gr=a((A-v)*(K+B)),mr=a((A+v)*(K-B)),Ct=a(mr-gr);if(Ct===ue)return this.double();let _r=a(S*_t*$),Er=a(I*_t*M),vr=Er+_r,Ar=mr+gr,Br=Er-_r,On=a(vr*Ct),Hn=a(Ar*Br),Tn=a(vr*Br),Nn=a(Ct*Ar);return new x(On,Hn,Nn,Tn)}let le=a(v*B),G=a(A*K),me=a(I*g*$),de=a(S*M),et=a((v+A)*(B+K)-le-G),tt=de-me,wr=de+me,xr=a(G-w*le),Ln=a(et*tt),In=a(wr*xr),Un=a(et*xr),zn=a(tt*wr);return new x(Ln,In,zn,Un)}subtract(h){return this.add(h.negate())}wNAF(h){return O.wNAFCached(this,p,h,x.normalizeZ)}multiply(h){let{p:w,f:g}=this.wNAF(q(h,n));return x.normalizeZ([w,g])[0]}multiplyUnsafe(h){let w=X(h);return w===ue?ce:this.equals(ce)||w===J?this:this.equals(D)?this.wNAF(w).p:O.unsafeLadder(this,w)}isSmallOrder(){return this.multiplyUnsafe(u).is0()}isTorsionFree(){return O.unsafeLadder(this,n).is0()}toAffine(h){let{ex:w,ey:g,ez:v}=this,A=this.is0();h==null&&(h=A?Fi:r.inv(v));let S=a(w*h),I=a(g*h),B=a(v*h);if(A)return{x:ue,y:J};if(B!==J)throw new Error("invZ was invalid");return{x:S,y:I}}clearCofactor(){let{h}=e;return h===J?this:this.multiplyUnsafe(h)}static fromHex(h,w=!1){let{d:g,a:v}=e,A=r.BYTES;h=Z("pointHex",h,A);let S=h.slice(),I=h[A-1];S[A-1]=I&-129;let B=he(S);B===ue||(w?q(B,l):q(B,r.ORDER));let K=a(B*B),M=a(K-J),$=a(g*K-v),{isValid:le,value:G}=f(M,$);if(!le)throw new Error("Point.fromHex: invalid y coordinate");let me=(G&J)===J,de=(I&128)!==0;if(!w&&G===ue&&de)throw new Error("Point.fromHex: x=0 and x_0=1");return de!==me&&(G=a(-G)),x.fromAffine({x:G,y:B})}static fromPrivateKey(h){return j(h).point}toRawBytes(){let{x:h,y:w}=this.toAffine(),g=ke(w,r.BYTES);return g[g.length-1]|=h&J?128:0,g}toHex(){return $e(this.toRawBytes())}}x.BASE=new x(e.Gx,e.Gy,J,a(e.Gx*e.Gy)),x.ZERO=new x(ue,J,J,ue);let{BASE:D,ZERO:ce}=x,O=$r(x,c*8);function T(b){return U(b,n)}function F(b){return T(he(b))}function j(b){let h=c;b=Z("private key",b,h);let w=Z("hashed private key",o(b),2*h),g=d(w.slice(0,h)),v=w.slice(h,2*h),A=F(g),S=D.multiply(A),I=S.toRawBytes();return{head:g,prefix:v,scalar:A,point:S,pointBytes:I}}function W(b){return j(b).pointBytes}function N(b=new Uint8Array,...h){let w=mt(...h);return F(o(m(w,Z("context",b),!!i)))}function De(b,h,w={}){b=Z("message",b),i&&(b=i(b));let{prefix:g,scalar:v,pointBytes:A}=j(h),S=N(w.context,g,b),I=D.multiply(S).toRawBytes(),B=N(w.context,I,A,b),K=T(S+B*v);X(K);let M=mt(I,ke(K,r.BYTES));return Z("result",M,c*2)}let ge=Vi;function Qe(b,h,w,g=ge){let{context:v,zip215:A}=g,S=r.BYTES;b=Z("signature",b,2*S),h=Z("message",h),i&&(h=i(h));let I=he(b.slice(S,2*S)),B,K,M;try{B=x.fromHex(w,A),K=x.fromHex(b.slice(0,S),A),M=D.multiplyUnsafe(I)}catch{return!1}if(!A&&B.isSmallOrder())return!1;let $=N(v,K.toRawBytes(),B.toRawBytes(),h);return K.add(B.multiplyUnsafe($)).subtract(M).clearCofactor().equals(x.ZERO)}return D._setWindowSize(8),{CURVE:e,getPublicKey:W,sign:De,verify:Qe,ExtendedPoint:x,utils:{getExtendedPublicKey:j,randomPrivateKey:()=>s(r.BYTES),precompute(b=8,h=x.BASE){return h._setWindowSize(b),h.multiply(BigInt(3)),h}}}}var Ge=BigInt(0),sr=BigInt(1);function Gi(t){return we(t,{a:"bigint"},{montgomeryBits:"isSafeInteger",nByteLength:"isSafeInteger",adjustScalarBytes:"function",domain:"function",powPminus2:"function",Gu:"bigint"}),Object.freeze({...t})}function Zr(t){let e=Gi(t),{P:r}=e,n=p=>U(p,r),i=e.montgomeryBits,o=Math.ceil(i/8),s=e.nByteLength,c=e.adjustScalarBytes||(p=>p),u=e.powPminus2||(p=>nr(p,r-BigInt(2),r));function l(p,E,x){let D=n(p*(E-x));return E=n(E-D),x=n(x+D),[E,x]}function a(p){if(typeof p=="bigint"&&Ge<=p&&p=Ge;ge--){let Qe=D>>ge&sr;W^=Qe,N=l(W,O,F),O=N[0],F=N[1],N=l(W,T,j),T=N[0],j=N[1],W=Qe;let Je=O+T,b=n(Je*Je),h=O-T,w=n(h*h),g=b-w,v=F+j,A=F-j,S=n(A*Je),I=n(v*h),B=S+I,K=S-I;F=n(B*B),j=n(ce*n(K*K)),O=n(b*w),T=n(g*(b+n(f*g)))}N=l(W,O,F),O=N[0],F=N[1],N=l(W,T,j),T=N[0],j=N[1];let De=u(T);return n(O*De)}function m(p){return ke(n(p),o)}function y(p){let E=Z("u coordinate",p,o);return s===o&&(E[s-1]&=127),he(E)}function P(p){let E=Z("scalar",p);if(E.length!==o&&E.length!==s)throw new Error(`Expected ${o} or ${s} bytes, got ${E.length}`);return he(c(E))}function k(p,E){let x=y(E),D=P(p),ce=d(x,D);if(ce===Ge)throw new Error("Invalid private or public key received");return m(ce)}let q=m(e.Gu);function X(p){return k(p,q)}return{scalarMult:k,scalarMultBase:X,getSharedSecret:(p,E)=>k(p,E),getPublicKey:p=>X(p),utils:{randomPrivateKey:()=>e.randomBytes(e.nByteLength)},GuBytes:q}}var Ze=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),Xr=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752"),Cs=BigInt(0),Zi=BigInt(1),cr=BigInt(2),Xi=BigInt(5),Wr=BigInt(10),Wi=BigInt(20),Yi=BigInt(40),Yr=BigInt(80);function Qr(t){let e=Ze,n=t*t%e*t%e,i=ie(n,cr,e)*n%e,o=ie(i,Zi,e)*t%e,s=ie(o,Xi,e)*o%e,c=ie(s,Wr,e)*s%e,u=ie(c,Wi,e)*c%e,l=ie(u,Yi,e)*u%e,a=ie(l,Yr,e)*l%e,f=ie(a,Yr,e)*l%e,d=ie(f,Wr,e)*s%e;return{pow_p_5_8:ie(d,cr,e)*t%e,b2:n}}function Jr(t){return t[0]&=248,t[31]&=127,t[31]|=64,t}function Qi(t,e){let r=Ze,n=U(e*e*e,r),i=U(n*n*e,r),o=Qr(t*i).pow_p_5_8,s=U(t*n*o,r),c=U(e*s*s,r),u=s,l=U(s*Xr,r),a=c===t,f=c===U(-t,r),d=c===U(-t*Xr,r);return a&&(s=u),(f||d)&&(s=l),Mr(s,r)&&(s=U(-s,r)),{isValid:a||f,value:s}}var xe=Fr(Ze,void 0,!0),ar={a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:xe,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:BigInt(8),Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:Jt,randomBytes:Zt,adjustScalarBytes:Jr,uvRatio:Qi},en=Et(ar);function tn(t,e,r){if(e.length>255)throw new Error("Context is too big");return Or($t("SigEd25519 no Ed25519 collisions"),new Uint8Array([r?1:0,e.length]),e,t)}var Rs=Et({...ar,domain:tn}),Ds=Et({...ar,domain:tn,prehash:Jt}),ur=(()=>Zr({P:Ze,a:BigInt(486662),montgomeryBits:255,nByteLength:32,Gu:BigInt(9),powPminus2:t=>{let e=Ze,{pow_p_5_8:r,b2:n}=Qr(t);return U(ie(r,BigInt(3),e)*n,e)},adjustScalarBytes:Jr,randomBytes:Zt}))();var Ji=(xe.ORDER+BigInt(3))/BigInt(8),js=xe.pow(cr,Ji),Ms=xe.sqrt(xe.neg(xe.ONE)),qs=(xe.ORDER-BigInt(5))/BigInt(8),Fs=BigInt(486662);var Vs=Vr(xe,xe.neg(BigInt(486664)));var $s=BigInt("25063068953384623474111414158702152701244531502492656460079210482610430750235"),Gs=BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"),Zs=BigInt("1159843021668779879193775521855586647937357759715417654439879720876111806838"),Xs=BigInt("40440834346308536858101042469323190826248399146238708352240133220865137265952");var Ws=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");var Xe=["deriveBits"],vt=new Uint8Array([100,107,112,95,112,114,107]),At=new Uint8Array([115,107]);var V=class{constructor(e,r,n,i=[]){Object.defineProperty(this,"key",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"type",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"extractable",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"algorithm",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"usages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.key=r,this.type=n,this.algorithm={name:e},this.usages=i,n==="public"&&(this.usages=[])}};var Ce="X25519",Bt=class{constructor(e){Object.defineProperty(this,"_hkdf",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_nPk",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_nSk",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._hkdf=e,this._nPk=32,this._nSk=32}async serializePublicKey(e){try{return await this._serializePublicKey(e)}catch(r){throw new te(r)}}async deserializePublicKey(e){try{return await this._importRawKey(e,!0)}catch(r){throw new Y(r)}}async serializePrivateKey(e){try{return await this._serializePrivateKey(e)}catch(r){throw new te(r)}}async deserializePrivateKey(e){try{return await this._importRawKey(e,!1)}catch(r){throw new Y(r)}}async importKey(e,r,n){try{if(e==="raw")return await this._importRawKey(r,n);if(r instanceof ArrayBuffer)throw new Error("Invalid jwk key format");return await this._importJWK(r,n)}catch(i){throw new Y(i)}}async generateKeyPair(){try{let e=en.utils.randomPrivateKey(),r=new V(Ce,e,"private",Xe);return{publicKey:await this.derivePublicKey(r),privateKey:r}}catch(e){throw new fe(e)}}async deriveKeyPair(e){try{let r=await this._hkdf.labeledExtract(re,vt,new Uint8Array(e)),n=await this._hkdf.labeledExpand(r,At,re,this._nSk),i=new V(Ce,new Uint8Array(n),"private",Xe);return{privateKey:i,publicKey:await this.derivePublicKey(i)}}catch(r){throw new Te(r)}}async derivePublicKey(e){try{return await this._derivePublicKey(e)}catch(r){throw new Y(r)}}async dh(e,r){try{return await this._dh(e,r)}catch(n){throw new te(n)}}_serializePublicKey(e){return new Promise(r=>{r(e.key.buffer)})}_serializePrivateKey(e){return new Promise(r=>{r(e.key.buffer)})}_importRawKey(e,r){return new Promise((n,i)=>{r&&e.byteLength!==this._nPk&&i(new Error("Invalid length of the key")),!r&&e.byteLength!==this._nSk&&i(new Error("Invalid length of the key")),n(new V(Ce,new Uint8Array(e),r?"public":"private",r?[]:Xe))})}_importJWK(e,r){return new Promise((n,i)=>{(typeof e.kty>"u"||e.kty!=="OKP")&&i(new Error(`Invalid kty: ${e.kty}`)),(typeof e.crv>"u"||e.crv!=="X25519")&&i(new Error(`Invalid crv: ${e.crv}`)),r?(typeof e.d<"u"&&i(new Error("Invalid key: `d` should not be set")),typeof e.x>"u"&&i(new Error("Invalid key: `x` not found")),n(new V(Ce,qt(e.x),"public"))):(typeof e.d!="string"&&i(new Error("Invalid key: `d` not found")),n(new V(Ce,qt(e.d),"private",Xe)))})}_derivePublicKey(e){return new Promise((r,n)=>{try{let i=ur.getPublicKey(e.key);r(new V(Ce,i,"public"))}catch(i){n(i)}})}_dh(e,r){return new Promise((n,i)=>{try{n(ur.getSharedSecret(e.key,r.key).buffer)}catch(o){i(o)}})}};var St=class{constructor(e,r,n,i){Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:pe.NotAssigned}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"secretSize",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"encSize",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"publicKeySize",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"privateKeySize",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_a",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_b",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_kdf",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.id=e,this._a=r,this._b=n,this._kdf=i;let o=new Uint8Array(lt);o.set(ft(this.id,2),3),this._kdf.init(o)}async serializePublicKey(e){try{return await this._serializePublicKey(e)}catch(r){throw new te(r)}}async deserializePublicKey(e){try{return await this._deserializePublicKey(e)}catch(r){throw new Y(r)}}async serializePrivateKey(e){try{return await this._serializePrivateKey(e)}catch(r){throw new te(r)}}async deserializePrivateKey(e){try{return await this._deserializePrivateKey(e)}catch(r){throw new Y(r)}}async generateKeyPair(){let e=await this._a.generateKeyPair(),r=await this._b.generateKeyPair(),n=await this._a.serializePublicKey(e.publicKey),i=await this._a.serializePrivateKey(e.privateKey),o=await this._b.serializePublicKey(r.publicKey),s=await this._b.serializePrivateKey(r.privateKey);return{publicKey:await this.deserializePublicKey(Q(new Uint8Array(n),new Uint8Array(o))),privateKey:await this.deserializePrivateKey(Q(new Uint8Array(i),new Uint8Array(s)))}}async deriveKeyPair(e){let r=await this._kdf.labeledExtract(re,vt,new Uint8Array(e)),n=new Uint8Array(await this._kdf.labeledExpand(r,At,re,32+64)),i=n.slice(0,32),o=n.slice(32,96),s=await this._a.deriveKeyPair(i),c=await this._b.deriveKeyPair(o),u=await this._a.serializePublicKey(s.publicKey),l=await this._a.serializePrivateKey(s.privateKey),a=await this._b.serializePublicKey(c.publicKey),f=await this._b.serializePrivateKey(c.privateKey);return{publicKey:await this.deserializePublicKey(Q(new Uint8Array(u),new Uint8Array(a))),privateKey:await this.deserializePrivateKey(Q(new Uint8Array(l),new Uint8Array(f)))}}async importKey(e,r,n=!0){if(e!=="raw")throw new fe("'jwk' is not supported");if(!(r instanceof ArrayBuffer))throw new ee("Invalid type of key");return n?await this.deserializePublicKey(r):await this.deserializePrivateKey(r)}async encap(e){let r,n;if(e.ekm!==void 0&&!ne(e.ekm)){if(e.ekm.byteLength!==64)throw new ee("ekm must be 32 bytes in length");r=e.ekm.slice(0,32),n=e.ekm.slice(32)}let i=new Uint8Array(await this.serializePublicKey(e.recipientPublicKey)),o=await this._a.deserializePublicKey(i.slice(0,this._a.publicKeySize)),s=await this._b.deserializePublicKey(i.slice(this._a.publicKeySize)),c=await this._a.encap({recipientPublicKey:o,ekm:r}),u=await this._b.encap({recipientPublicKey:s,ekm:n});return{sharedSecret:Q(new Uint8Array(c.sharedSecret),new Uint8Array(u.sharedSecret)),enc:Q(new Uint8Array(c.enc),new Uint8Array(u.enc))}}async decap(e){let r=ne(e.recipientKey)?e.recipientKey.privateKey:e.recipientKey,n=new Uint8Array(await this.serializePrivateKey(r)),i=await this._a.deserializePrivateKey(n.slice(0,this._a.privateKeySize)),o=await this._b.deserializePrivateKey(n.slice(this._a.privateKeySize)),s=await this._a.decap({recipientKey:i,enc:e.enc.slice(0,this._a.encSize)}),c=await this._b.decap({recipientKey:o,enc:e.enc.slice(this._a.encSize)});return Q(new Uint8Array(s),new Uint8Array(c))}_serializePublicKey(e){return new Promise((r,n)=>{e.type!=="public"&&n(new Error("Not public key")),e.algorithm.name!==this.name&&n(new Error(`Invalid algorithm name: ${e.algorithm.name}`)),e.key.byteLength!==this.publicKeySize&&n(new Error(`Invalid key length: ${e.key.byteLength}`)),r(e.key.buffer)})}_deserializePublicKey(e){return new Promise((r,n)=>{e.byteLength!==this.publicKeySize&&n(new Error(`Invalid key length: ${e.byteLength}`)),r(new V(this.name,new Uint8Array(e),"public"))})}_serializePrivateKey(e){return new Promise((r,n)=>{e.type!=="private"&&n(new Error("Not private key")),e.algorithm.name!==this.name&&n(new Error(`Invalid algorithm name: ${e.algorithm.name}`)),e.key.byteLength!==this.privateKeySize&&n(new Error(`Invalid key length: ${e.key.byteLength}`)),r(e.key.buffer)})}_deserializePrivateKey(e){return new Promise((r,n)=>{e.byteLength!==this.privateKeySize&&n(new Error(`Invalid key length: ${e.byteLength}`)),r(new V(this.name,new Uint8Array(e),"private",["deriveBits"]))})}};var kt=[2285,2571,2970,1812,1493,1422,287,202,3158,622,1577,182,962,2127,1855,1468,573,2004,264,383,2500,1458,1727,3199,2648,1017,732,608,1787,411,3124,1758,1223,652,2777,1015,2036,1491,3047,1785,516,3321,3009,2663,1711,2167,126,1469,2476,3239,3058,830,107,1908,3082,2378,2931,961,1821,2604,448,2264,677,2054,2226,430,555,843,2078,871,1550,105,422,587,177,3094,3038,2869,1574,1653,3083,778,1159,3182,2552,1483,2727,1119,1739,644,2457,349,418,329,3173,3254,817,1097,603,610,1322,2044,1864,384,2114,3193,1218,1994,2455,220,2142,1670,2144,1799,2051,794,1819,2475,2459,478,3221,3021,996,991,958,1869,1522,1628],lr=[1701,1807,1460,2371,2338,2333,308,108,2851,870,854,1510,2535,1278,1530,1185,1659,1187,3109,874,1335,2111,136,1215,2945,1465,1285,2007,2719,2726,2232,2512,75,156,3e3,2911,2980,872,2685,1590,2210,602,1846,777,147,2170,2551,246,1676,1755,460,291,235,3152,2742,2907,3224,1779,2458,1251,2486,2774,2899,1103,1275,2652,1065,2881,725,1508,2368,398,951,247,1421,3222,2499,271,90,853,1860,3203,1162,1618,666,320,8,2813,1544,282,1838,1293,2314,552,2677,2106,1571,205,2918,1542,2721,2597,2312,681,130,1602,1871,829,2946,3065,1325,2756,1861,1474,1202,2367,3147,1752,2707,171,3127,3042,1907,1836,1517,359,758,1441];var Pt=BigInt(4294967295),rn=BigInt(32);function eo(t,e=!1){return e?{h:Number(t&Pt),l:Number(t>>rn&Pt)}:{h:Number(t>>rn&Pt)|0,l:Number(t&Pt)|0}}function nn(t,e=!1){let r=new Uint32Array(t.length),n=new Uint32Array(t.length);for(let i=0;it<>>32-r,sn=(t,e,r)=>e<>>32-r,cn=(t,e,r)=>e<>>64-r,an=(t,e,r)=>t<>>64-r;var[fn,hn,dn]=[[],[],[]],to=BigInt(0),We=BigInt(1),ro=BigInt(2),no=BigInt(7),io=BigInt(256),oo=BigInt(113);for(let t=0,e=We,r=1,n=0;t<24;t++){[r,n]=[n,(2*r+3*n)%5],fn.push(2*(5*n+r)),hn.push((t+1)*(t+2)/2%64);let i=to;for(let o=0;o<7;o++)e=(e<>no)*oo)%io,e&ro&&(i^=We<<(We<r>32?cn(t,e,r):on(t,e,r),ln=(t,e,r)=>r>32?an(t,e,r):sn(t,e,r);function ao(t,e=24){let r=new Uint32Array(10);for(let n=24-e;n<24;n++){for(let s=0;s<10;s++)r[s]=t[s]^t[s+10]^t[s+20]^t[s+30]^t[s+40];for(let s=0;s<10;s+=2){let c=(s+8)%10,u=(s+2)%10,l=r[u],a=r[u+1],f=un(l,a,1)^r[c],d=ln(l,a,1)^r[c+1];for(let m=0;m<50;m+=10)t[s+m]^=f,t[s+m+1]^=d}let i=t[2],o=t[3];for(let s=0;s<24;s++){let c=hn[s],u=un(i,o,c),l=ln(i,o,c),a=fn[s];i=t[a],o=t[a+1],t[a]=u,t[a+1]=l}for(let s=0;s<50;s+=10){for(let c=0;c<10;c++)r[c]=t[s+c];for(let c=0;c<10;c++)t[s+c]^=~r[(c+2)%10]&r[(c+4)%10]}t[0]^=so[n],t[1]^=co[n]}r.fill(0)}var Kt=class t extends _e{constructor(e,r,n,i=!1,o=24){if(super(),this.blockLen=e,this.suffix=r,this.outputLen=n,this.enableXOF=i,this.rounds=o,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,je(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=kr(this.state)}keccak(){ao(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){ye(this);let{blockLen:r,state:n}=this;e=Ee(e);let i=e.length;for(let o=0;o=n&&this.keccak();let s=Math.min(n-this.posOut,o-i);e.set(r.subarray(this.posOut,this.posOut+s),i),this.posOut+=s,i+=s}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return je(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(rt(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){let{blockLen:r,suffix:n,outputLen:i,rounds:o,enableXOF:s}=this;return e||(e=new t(r,n,i,s,o)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=o,e.suffix=n,e.outputLen=i,e.enableXOF=s,e.destroyed=this.destroyed,e}},Pe=(t,e,r)=>it(()=>new Kt(e,t,r)),mc=Pe(6,144,224/8),pn=Pe(6,136,256/8),_c=Pe(6,104,384/8),yn=Pe(6,72,512/8),Ec=Pe(1,144,224/8),vc=Pe(1,136,256/8),Ac=Pe(1,104,384/8),Bc=Pe(1,72,512/8),bn=(t,e,r)=>Pr((n={})=>new Kt(e,t,n.dkLen===void 0?r:n.dkLen,!0)),wn=bn(31,168,128/8),Lt=bn(31,136,256/8);var Ue=class extends qe{};function oe(t){return t%256}function se(t){return t>=-32768&&t<=32767?t:t<-32768?(t=t+32769,t=t%65536,32767+t):(t=t-32768,t=t%65536,-32768+t)}function L(t){return t%65536}function It(t){return t>=-2147483648&&t<=2147483647?t:t<-2147483648?(t=t+2147483649,t=t%4294967296,2147483647+t):(t=t-2147483648,t=t%4294967296,-2147483648+t)}function Ke(t){return t%4294967296}function xn(t,e){if(t.length!=e.length)return 0;let r=new Uint8Array([0]);for(let i=0;i>4,n[0]&=n[0]>>2,n[0]&=n[0]>>1,n[0]}async function gn(){if(ct!==void 0&&globalThis.crypto!==void 0)return globalThis.crypto;try{let{webcrypto:t}=await import("crypto");return t}catch{throw new Error("failed to load Crypto")}}function fr(t,e,r){return Lt.create({dkLen:t}).update(e).update(new Uint8Array([r])).digest()}function mn(t){let e=Ke(t[0]);return e|=Ke(t[1])<<8,e|=Ke(t[2])<<16,e|=Ke(t[3])<<24,Ke(e)}var Ot=class{constructor(){Object.defineProperty(this,"_api",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_k",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_du",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_dv",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_eta1",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_eta2",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_skSize",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_pkSize",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_compressedUSize",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_compressedVSize",{enumerable:!0,configurable:!0,writable:!0,value:0})}async generateKeyPair(){await this._setup();try{let e=new Uint8Array(64);return this._api.getRandomValues(e),this._deriveKeyPair(e)}catch(e){throw new Ue(e)}}async deriveKeyPair(e){await this._setup();try{if(e.byteLength!==64)throw new Error("seed must be 64 bytes in length");return this._deriveKeyPair(e)}catch(r){throw new Ue(r)}}async encap(e,r){await this._setup();try{let n=Re(this._getSeed(r)),[i,o]=hr(n,Re(e)),s=this._encap(e,n,o),c=dr(i,Re(s));return[s,c]}catch(n){throw new Ue(n)}}async decap(e,r){await this._setup();try{if(e.byteLength!==this._compressedUSize+this._compressedVSize)throw new Error("Invalid ct size");let n=r.subarray(0,this._skSize),i=r.subarray(this._skSize,this._skSize+this._pkSize),o=r.subarray(this._skSize+this._pkSize,this._skSize+this._pkSize+32),s=r.subarray(this._skSize+this._pkSize+32,this._skSize+this._pkSize+64),c=this._decap(e,n),[u,l]=hr(c,o),a=this._encap(i,c,l);return xn(e,a)==1?dr(u,Re(e)):dr(s,Re(e))}catch(n){throw new Ue(n)}}async _setup(){this._api===void 0&&(this._api=await gn())}_getSeed(e){if(e==null){let r=new Uint8Array(32);return this._api.getRandomValues(r),r}if(e.byteLength!==32)throw new Error("seed must be 32 bytes in length");return e}_deriveKeyPair(e){let r=e.subarray(0,32),n=e.subarray(32,64),[i,o]=this._deriveCpaKeyPair(r),s=Re(i),c=new Uint8Array(this._skSize+this._pkSize+64);return c.set(o,0),c.set(i,this._skSize),c.set(s,this._skSize+this._pkSize),c.set(n,this._skSize+this._pkSize+32),[i,c]}_deriveCpaKeyPair(e){let[r,n]=hr(e),i=this._sampleMatrix(r,!1),o=this._sampleNoise1(n,0,this._k),s=this._sampleNoise1(n,this._k,this._k);for(let a=0;a>0),e[i++]=oe(n[0]>>8|n[1]<<2),e[i++]=oe(n[1]>>6|n[2]<<4),e[i++]=oe(n[2]>>4|n[3]<<6),e[i++]=oe(n[3]>>2)}return e}_compressV(e,r){let n=new Uint8Array(8);for(let i=0,o=0;o<256/8;o++){for(let s=0;s<8;s++)n[s]=oe(((r[8*o+s]<<4)+3329/2)/3329)&15;e[i++]=n[0]|n[1]<<4,e[i++]=n[2]|n[3]<<4,e[i++]=n[4]|n[5]<<4,e[i++]=n[6]|n[7]<<4}return e}_decompressU(e){let r=new Array(this._k);for(let i=0;i>0|L(e[i+1])<<8,n[1]=L(e[i+1])>>2|L(e[i+2])<<6,n[2]=L(e[i+2])>>4|L(e[i+3])<<4,n[3]=L(e[i+3])>>6|L(e[i+4])<<2,i=i+5;for(let c=0;c<4;c++)r[o][4*s+c]=se(Ke(n[c]&1023)*Ke(3329)+512>>10)}return r}_decompressV(e){let r=new Array(384);for(let n=0,i=0;i<256/2;i++,n++)r[2*i+0]=se(L(e[n]&15)*L(3329)+8>>4),r[2*i+1]=se(L(e[n]>>4)*L(3329)+8>>4);return r}};function hr(t,e){let r=yn.create().update(t);e!==void 0&&r.update(e);let n=r.digest();return[n.subarray(0,32),n.subarray(32,64)]}function Re(t){return pn.create().update(t).digest()}function dr(t,e){let r=Lt.create({dkLen:32}).update(t);return e!==void 0&&r.update(e),r.digest()}function lo(t,e){return wn.create({dkLen:672}).update(t).update(e).digest()}function _n(t){let e=0,r=0,n=new Uint8Array(384),i=Kn(t);for(let o=0;o<256/2;o++)e=L(i[2*o]),r=L(i[2*o+1]),n[3*o+0]=oe(e>>0),n[3*o+1]=oe(e>>8)|oe(r<<4),n[3*o+2]=oe(r>>4);return n}function En(t){let e=new Array(384).fill(0);for(let r=0;r<256/2;r++)e[2*r]=se((L(t[3*r+0])>>0|L(t[3*r+1])<<8)&4095),e[2*r+1]=se((L(t[3*r+1])>>4|L(t[3*r+2])<<4)&4095);return e}function fo(t){let e=new Uint8Array(32),r,n=Kn(t);for(let i=0;i<256/8;i++){e[i]=0;for(let o=0;o<8;o++)r=((L(n[8*i+o])<<1)+L(3329/2))/L(3329)&1,e[i]|=oe(r<>i&1),e[8*n+i]=r&se((3329+1)/2);return e}function vn(t,e,r){let n=new Array(384).fill(0),i=0,o,s;for(let c=0;i>0)|L(t[c+1])<<8)&4095,s=(L(t[c+1]>>4)|L(t[c+2])<<4)&4095,c=c+3,o<3329&&(n[i]=o,i=i+1),i>1&1431655765);for(let u=0;u<8;u++)i=se(n>>4*u+0&3),o=se(n>>4*u+e&3),s[8*c+u]=i-o}return s}function Ut(t){for(let e=0,r=1,n=128;n>=2;n>>=1)for(let i=0;i<256;i=e+n){let o=kt[r];for(r=r+1,e=i;e>24;return r=r*3329,t-r}function Pn(t){let r=se(It(t)*62209)*3329;return r=t-r,r>>=16,se(r)}function po(t){for(let r=0;r<256;r++)t[r]=Pn(It(t[r])*It(1353));return t}function zt(t,e){let r=Bn(t[0],e[0]),n;for(let i=1;i>31&3329;return t}var Ht=class extends Ot{constructor(){super(),Object.defineProperty(this,"_k",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(this,"_du",{enumerable:!0,configurable:!0,writable:!0,value:10}),Object.defineProperty(this,"_dv",{enumerable:!0,configurable:!0,writable:!0,value:4}),Object.defineProperty(this,"_eta1",{enumerable:!0,configurable:!0,writable:!0,value:2}),Object.defineProperty(this,"_eta2",{enumerable:!0,configurable:!0,writable:!0,value:2}),this._skSize=12*this._k*256/8,this._pkSize=this._skSize+32,this._compressedUSize=this._k*this._du*256/8,this._compressedVSize=this._dv*256/8}};var Tt="Keyber768",Nt=class{constructor(){Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:pe.NotAssigned}),Object.defineProperty(this,"secretSize",{enumerable:!0,configurable:!0,writable:!0,value:32}),Object.defineProperty(this,"encSize",{enumerable:!0,configurable:!0,writable:!0,value:1088}),Object.defineProperty(this,"publicKeySize",{enumerable:!0,configurable:!0,writable:!0,value:1184}),Object.defineProperty(this,"privateKeySize",{enumerable:!0,configurable:!0,writable:!0,value:2400}),Object.defineProperty(this,"_prim",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._prim=new Ht}async serializePublicKey(e){try{return await this._serializePublicKey(e)}catch(r){throw new te(r)}}async deserializePublicKey(e){try{return await this._deserializePublicKey(e)}catch(r){throw new Y(r)}}async serializePrivateKey(e){try{return await this._serializePrivateKey(e)}catch(r){throw new te(r)}}async deserializePrivateKey(e){try{return await this._deserializePrivateKey(e)}catch(r){throw new Y(r)}}async generateKeyPair(){let e=await this._prim.generateKeyPair(),r=await this.deserializePrivateKey(e[1]);return{publicKey:await this.deserializePublicKey(e[0]),privateKey:r}}async deriveKeyPair(e){if(e.byteLength>8192)throw new ee("Too long ikm");try{let r=await this._prim.deriveKeyPair(new Uint8Array(e)),n=await this.deserializePrivateKey(r[1]);return{publicKey:await this.deserializePublicKey(r[0]),privateKey:n}}catch(r){throw new Te(r)}}async importKey(e,r,n=!0){if(e!=="raw")throw new fe("'jwk' is not supported");return n?await this.deserializePublicKey(r):await this.deserializePrivateKey(r)}async encap(e){let r;if(e.ekm!==void 0&&!ne(e)){if(e.ekm.byteLength!==32)throw new ee("ekm must be 32 bytes in length");r=new Uint8Array(e.ekm)}let n=new Uint8Array(await this.serializePublicKey(e.recipientPublicKey));try{let i=await this._prim.encap(n,r);return{sharedSecret:i[1],enc:i[0]}}catch(i){throw new Oe(i)}}async decap(e){let r=ne(e.recipientKey)?e.recipientKey.privateKey:e.recipientKey,n=new Uint8Array(await this.serializePrivateKey(r));try{return await this._prim.decap(new Uint8Array(e.enc),n)}catch(i){throw new He(i)}}_serializePublicKey(e){return new Promise((r,n)=>{e.type!=="public"&&n(new Error("Not public key")),e.algorithm.name!==Tt&&n(new Error(`Invalid algorithm name: ${e.algorithm.name}`)),e.key.byteLength!==this.publicKeySize&&n(new Error(`Invalid key length: ${e.key.byteLength}`)),r(e.key.buffer)})}_deserializePublicKey(e){return new Promise((r,n)=>{e.byteLength!==this.publicKeySize&&n(new Error(`Invalid key length: ${e.byteLength}`)),r(new V(Tt,new Uint8Array(e),"public"))})}_serializePrivateKey(e){return new Promise((r,n)=>{e.type!=="private"&&n(new Error("Not private key")),e.algorithm.name!==Tt&&n(new Error(`Invalid algorithm name: ${e.algorithm.name}`)),e.key.byteLength!==this.privateKeySize&&n(new Error(`Invalid key length: ${e.key.byteLength}`)),r(e.key.buffer)})}_deserializePrivateKey(e){return new Promise((r,n)=>{e.byteLength!==this.privateKeySize&&n(new Error(`Invalid key length: ${e.byteLength}`)),r(new V(Tt,new Uint8Array(e),"private",["deriveBits"]))})}};var yr=class extends ht{constructor(){let e=new Fe;super(pe.DhkemX25519HkdfSha256,new Bt(e),e),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:pe.DhkemX25519HkdfSha256}),Object.defineProperty(this,"secretSize",{enumerable:!0,configurable:!0,writable:!0,value:32}),Object.defineProperty(this,"encSize",{enumerable:!0,configurable:!0,writable:!0,value:32}),Object.defineProperty(this,"publicKeySize",{enumerable:!0,configurable:!0,writable:!0,value:32}),Object.defineProperty(this,"privateKeySize",{enumerable:!0,configurable:!0,writable:!0,value:32})}get kdf(){return this._kdf}},br=class extends St{constructor(){super(pe.HybridkemX25519Kyber768,new yr,new Nt,new Fe),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:pe.HybridkemX25519Kyber768}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"X25519Kyber25519"}),Object.defineProperty(this,"secretSize",{enumerable:!0,configurable:!0,writable:!0,value:64}),Object.defineProperty(this,"encSize",{enumerable:!0,configurable:!0,writable:!0,value:1120}),Object.defineProperty(this,"publicKeySize",{enumerable:!0,configurable:!0,writable:!0,value:1216}),Object.defineProperty(this,"privateKeySize",{enumerable:!0,configurable:!0,writable:!0,value:2432}),Object.defineProperty(this,"auth",{enumerable:!0,configurable:!0,writable:!0,value:!1})}};export{br as HybridkemX25519Kyber768}; /*! Bundled license information: +@noble/hashes/esm/utils.js: + (*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *) + @noble/hashes/esm/utils.js: (*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *) diff --git a/src/hpke.js b/src/hpke.js index 8cdde9a23..3a4b1834e 100644 --- a/src/hpke.js +++ b/src/hpke.js @@ -1,4 +1,4 @@ -var Zn={},Dr=Xn(globalThis,Zn);function Xn(r,e){return new Proxy(r,{get(t,n,i){return n in e?e[n]:r[n]},set(t,n,i){return n in e&&delete e[n],r[n]=i,!0},deleteProperty(t,n){let i=!1;return n in e&&(delete e[n],i=!0),n in r&&(delete r[n],i=!0),i},ownKeys(t){let n=Reflect.ownKeys(r),i=Reflect.ownKeys(e),o=new Set(i);return[...n.filter(s=>!o.has(s)),...i]},defineProperty(t,n,i){return n in e&&delete e[n],Reflect.defineProperty(r,n,i),!0},getOwnPropertyDescriptor(t,n){return n in e?Reflect.getOwnPropertyDescriptor(e,n):Reflect.getOwnPropertyDescriptor(r,n)},has(t,n){return n in e||n in r}})}var rr=class extends Error{constructor(e){let t;e instanceof Error?t=e.message:typeof e=="string"?t=e:t="",super(t),this.name=this.constructor.name}},ae=class extends rr{},ee=class extends ae{},zr=class extends ae{},ce=class extends ae{},te=class extends ae{},yt=class extends ae{},bt=class extends ae{},wt=class extends ae{},xt=class extends ae{},mt=class extends ae{},gt=class extends ae{},Ie=class extends ae{},fe=class extends ae{};async function Yn(){if(Dr!==void 0&&globalThis.crypto!==void 0)return globalThis.crypto.subtle;try{let{webcrypto:r}=await import("crypto");return r.subtle}catch(r){throw new fe(r)}}var me=class{constructor(){Object.defineProperty(this,"_api",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}async _setup(){this._api===void 0&&(this._api=await Yn())}};var ve={Base:0,Psk:1,Auth:2,AuthPsk:3},Rr={NotAssigned:0,DhkemP256HkdfSha256:16,DhkemP384HkdfSha384:17,DhkemP521HkdfSha512:18,DhkemSecp256k1HkdfSha256:19,DhkemX25519HkdfSha256:32,DhkemX448HkdfSha512:33,HybridkemX25519Kyber768:48},$=Rr,jr={HkdfSha256:1,HkdfSha384:2,HkdfSha512:3},ke=jr,qr={Aes128Gcm:1,Aes256Gcm:2,Chacha20Poly1305:3,ExportOnly:65535},ue=qr;var Mr=["encrypt","decrypt"];var nr=class extends me{constructor(e){super(),Object.defineProperty(this,"_rawKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_key",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._rawKey=e}async seal(e,t,n){await this._setupKey();let i={name:"AES-GCM",iv:e,additionalData:n};return await this._api.encrypt(i,this._key,t)}async open(e,t,n){await this._setupKey();let i={name:"AES-GCM",iv:e,additionalData:n};return await this._api.decrypt(i,this._key,t)}async _setupKey(){if(this._key!==void 0)return;await this._setup();let e=await this._importKey(this._rawKey);new Uint8Array(this._rawKey).fill(0),this._key=e}async _importKey(e){return await this._api.importKey("raw",e,{name:"AES-GCM"},!0,Mr)}},nt=class{constructor(){Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:ue.Aes128Gcm}),Object.defineProperty(this,"keySize",{enumerable:!0,configurable:!0,writable:!0,value:16}),Object.defineProperty(this,"nonceSize",{enumerable:!0,configurable:!0,writable:!0,value:12}),Object.defineProperty(this,"tagSize",{enumerable:!0,configurable:!0,writable:!0,value:16})}createEncryptionContext(e){return new nr(e)}},_t=class extends nt{constructor(){super(...arguments),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:ue.Aes256Gcm}),Object.defineProperty(this,"keySize",{enumerable:!0,configurable:!0,writable:!0,value:32}),Object.defineProperty(this,"nonceSize",{enumerable:!0,configurable:!0,writable:!0,value:12}),Object.defineProperty(this,"tagSize",{enumerable:!0,configurable:!0,writable:!0,value:16})}};var Et=class{constructor(){Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:ue.ExportOnly}),Object.defineProperty(this,"keySize",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"nonceSize",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"tagSize",{enumerable:!0,configurable:!0,writable:!0,value:0})}createEncryptionContext(e){throw new fe("Export only")}};var Wn=r=>r instanceof Uint8Array;var Ae=r=>new Uint32Array(r.buffer,r.byteOffset,Math.floor(r.byteLength/4)),Gr=r=>new DataView(r.buffer,r.byteOffset,r.byteLength),Jn=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!Jn)throw new Error("Non little-endian hardware is not supported");function vt(r){if(typeof r!="string")throw new Error(`utf8ToBytes expected string, got ${typeof r}`);return new Uint8Array(new TextEncoder().encode(r))}function kt(r){if(typeof r=="string"&&(r=vt(r)),!Wn(r))throw new Error(`expected Uint8Array, got ${typeof r}`);return r}var Qn=r=>Object.prototype.toString.call(r)==="[object Object]"&&r.constructor===Object;function Fr(r,e){if(e!==void 0&&(typeof e!="object"||!Qn(e)))throw new Error("options must be object or undefined");return Object.assign(r,e)}function qe(r,e){if(!(r instanceof Uint8Array))throw new Error("Uint8Array expected");if(typeof e=="number"&&r.length!==e)throw new Error(`Uint8Array length ${e} expected`)}function $r(r,e){if(r.length!==e.length)throw new Error("equalBytes: Different size of Uint8Arrays");let t=!0;for(let n=0;n>i&o),a=Number(t&o),c=n?4:0,u=n?0:4;r.setUint32(e+c,s,n),r.setUint32(e+u,a,n)}function or(r){if(!Number.isSafeInteger(r)||r<0)throw new Error(`Wrong positive integer: ${r}`)}function ei(r){if(typeof r!="boolean")throw new Error(`Expected boolean, not ${r}`)}function Zr(r,...e){if(!(r instanceof Uint8Array))throw new Error("Expected Uint8Array");if(e.length>0&&!e.includes(r.length))throw new Error(`Expected Uint8Array of length ${e}, not of length=${r.length}`)}function ti(r){if(typeof r!="function"||typeof r.create!="function")throw new Error("hash must be wrapped by utils.wrapConstructor");or(r.outputLen),or(r.blockLen)}function ri(r,e=!0){if(r.destroyed)throw new Error("Hash instance has been destroyed");if(e&&r.finished)throw new Error("Hash#digest() has already been called")}function ni(r,e){Zr(r);let t=e.outputLen;if(r.lengthr[e++]&255|(r[e++]&255)<<8,sr=class{constructor(e){this.blockLen=16,this.outputLen=16,this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.pos=0,this.finished=!1,e=kt(e),qe(e,32);let t=re(e,0),n=re(e,2),i=re(e,4),o=re(e,6),s=re(e,8),a=re(e,10),c=re(e,12),u=re(e,14);this.r[0]=t&8191,this.r[1]=(t>>>13|n<<3)&8191,this.r[2]=(n>>>10|i<<6)&7939,this.r[3]=(i>>>7|o<<9)&8191,this.r[4]=(o>>>4|s<<12)&255,this.r[5]=s>>>1&8190,this.r[6]=(s>>>14|a<<2)&8191,this.r[7]=(a>>>11|c<<5)&8065,this.r[8]=(c>>>8|u<<8)&8191,this.r[9]=u>>>5&127;for(let f=0;f<8;f++)this.pad[f]=re(e,16+2*f)}process(e,t,n=!1){let i=n?0:2048,{h:o,r:s}=this,a=s[0],c=s[1],u=s[2],f=s[3],l=s[4],d=s[5],m=s[6],v=s[7],_=s[8],k=s[9],F=re(e,t+0),V=re(e,t+2),b=re(e,t+4),L=re(e,t+6),E=re(e,t+8),H=re(e,t+10),j=re(e,t+12),K=re(e,t+14),x=o[0]+(F&8191),I=o[1]+((F>>>13|V<<3)&8191),P=o[2]+((V>>>10|b<<6)&8191),S=o[3]+((b>>>7|L<<9)&8191),A=o[4]+((L>>>4|E<<12)&8191),q=o[5]+(E>>>1&8191),C=o[6]+((E>>>14|H<<2)&8191),M=o[7]+((H>>>11|j<<5)&8191),G=o[8]+((j>>>8|K<<8)&8191),p=o[9]+(K>>>5|i),h=0,y=h+x*a+I*(5*k)+P*(5*_)+S*(5*v)+A*(5*m);h=y>>>13,y&=8191,y+=q*(5*d)+C*(5*l)+M*(5*f)+G*(5*u)+p*(5*c),h+=y>>>13,y&=8191;let w=h+x*c+I*a+P*(5*k)+S*(5*_)+A*(5*v);h=w>>>13,w&=8191,w+=q*(5*m)+C*(5*d)+M*(5*l)+G*(5*f)+p*(5*u),h+=w>>>13,w&=8191;let g=h+x*u+I*c+P*a+S*(5*k)+A*(5*_);h=g>>>13,g&=8191,g+=q*(5*v)+C*(5*m)+M*(5*d)+G*(5*l)+p*(5*f),h+=g>>>13,g&=8191;let U=h+x*f+I*u+P*c+S*a+A*(5*k);h=U>>>13,U&=8191,U+=q*(5*_)+C*(5*v)+M*(5*m)+G*(5*d)+p*(5*l),h+=U>>>13,U&=8191;let T=h+x*l+I*f+P*u+S*c+A*a;h=T>>>13,T&=8191,T+=q*(5*k)+C*(5*_)+M*(5*v)+G*(5*m)+p*(5*d),h+=T>>>13,T&=8191;let z=h+x*d+I*l+P*f+S*u+A*c;h=z>>>13,z&=8191,z+=q*a+C*(5*k)+M*(5*_)+G*(5*v)+p*(5*m),h+=z>>>13,z&=8191;let O=h+x*m+I*d+P*l+S*f+A*u;h=O>>>13,O&=8191,O+=q*c+C*a+M*(5*k)+G*(5*_)+p*(5*v),h+=O>>>13,O&=8191;let N=h+x*v+I*m+P*d+S*l+A*f;h=N>>>13,N&=8191,N+=q*u+C*c+M*a+G*(5*k)+p*(5*_),h+=N>>>13,N&=8191;let Y=h+x*_+I*v+P*m+S*d+A*l;h=Y>>>13,Y&=8191,Y+=q*f+C*u+M*c+G*a+p*(5*k),h+=Y>>>13,Y&=8191;let J=h+x*k+I*_+P*v+S*m+A*d;h=J>>>13,J&=8191,J+=q*l+C*f+M*u+G*c+p*a,h+=J>>>13,J&=8191,h=(h<<2)+h|0,h=h+y|0,y=h&8191,h=h>>>13,w+=h,o[0]=y,o[1]=w,o[2]=g,o[3]=U,o[4]=T,o[5]=z,o[6]=O,o[7]=N,o[8]=Y,o[9]=J}finalize(){let{h:e,pad:t}=this,n=new Uint16Array(10),i=e[1]>>>13;e[1]&=8191;for(let a=2;a<10;a++)e[a]+=i,i=e[a]>>>13,e[a]&=8191;e[0]+=i*5,i=e[0]>>>13,e[0]&=8191,e[1]+=i,i=e[1]>>>13,e[1]&=8191,e[2]+=i,n[0]=e[0]+5,i=n[0]>>>13,n[0]&=8191;for(let a=1;a<10;a++)n[a]=e[a]+i,i=n[a]>>>13,n[a]&=8191;n[9]-=8192;let o=(i^1)-1;for(let a=0;a<10;a++)n[a]&=o;o=~o;for(let a=0;a<10;a++)e[a]=e[a]&o|n[a];e[0]=(e[0]|e[1]<<13)&65535,e[1]=(e[1]>>>3|e[2]<<10)&65535,e[2]=(e[2]>>>6|e[3]<<7)&65535,e[3]=(e[3]>>>9|e[4]<<4)&65535,e[4]=(e[4]>>>12|e[5]<<1|e[6]<<14)&65535,e[5]=(e[6]>>>2|e[7]<<11)&65535,e[6]=(e[7]>>>5|e[8]<<8)&65535,e[7]=(e[8]>>>8|e[9]<<5)&65535;let s=e[0]+t[0];e[0]=s&65535;for(let a=1;a<8;a++)s=(e[a]+t[a]|0)+(s>>>16)|0,e[a]=s&65535}update(e){oe.exists(this);let{buffer:t,blockLen:n}=this;e=kt(e);let i=e.length;for(let o=0;o>>0,e[o++]=n[s]>>>8;return e}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let n=e.slice(0,t);return this.destroy(),n}};function oi(r){let e=(n,i)=>r(i).update(kt(n)).digest(),t=r(new Uint8Array(32));return e.outputLen=t.outputLen,e.blockLen=t.blockLen,e.create=n=>r(n),e}var Xr=oi(r=>new sr(r));var si=vt("expand 16-byte k"),ai=vt("expand 32-byte k"),ci=Ae(si),fi=Ae(ai),Vr=r=>!(r.byteOffset%4),Yr=r=>{let{core:e,rounds:t,counterRight:n,counterLen:i,allow128bitKeys:o,extendNonceFn:s,blockLen:a}=Fr({rounds:20,counterRight:!1,counterLen:8,allow128bitKeys:!0,blockLen:64},r);oe.number(i),oe.number(t),oe.number(a),oe.bool(n),oe.bool(o);let c=a/4;if(a%4!==0)throw new Error("Salsa/ChaCha: blockLen must be aligned to 4 bytes");return(u,f,l,d,m=0)=>{if(oe.bytes(u),oe.bytes(f),oe.bytes(l),d||(d=new Uint8Array(l.length)),oe.bytes(d),oe.number(m),m<0||m>=2**32-1)throw new Error("Salsa/ChaCha: counter overflow");if(d.length=2**32-1)throw new Error("Salsa/ChaCha: counter overflow");let P=Math.min(a,K-x);if(P===a&&j&&H){let S=x/4;if(x%4!==0)throw new Error("Salsa/ChaCha: invalid block position");for(let A=0;Ar<>>32-e;function ui(r,e,t,n,i,o=20){let s=r[0],a=r[1],c=r[2],u=r[3],f=e[0],l=e[1],d=e[2],m=e[3],v=e[4],_=e[5],k=e[6],F=e[7],V=i,b=t[0],L=t[1],E=t[2],H=s,j=a,K=c,x=u,I=f,P=l,S=d,A=m,q=v,C=_,M=k,G=F,p=V,h=b,y=L,w=E;for(let U=0;U{r.update(e);let t=e.length%16;t&&r.update(li.subarray(t))},Jr=(r,e,t,n,i)=>{let o=r(e,t,new Uint8Array(32)),s=Xr.create(o);i&&Wr(s,i),Wr(s,n);let a=new Uint8Array(16),c=Gr(a);ir(c,0,BigInt(i?i.length:0),!0),ir(c,8,BigInt(n.length),!0),s.update(a);let u=s.digest();return o.fill(0),u},di=r=>(e,t,n)=>(qe(e,32),qe(t),{tagLength:16,encrypt:(o,s)=>{let a=o.length,c=a+16;s?qe(s,c):s=new Uint8Array(c),r(e,t,o,s,1);let u=Jr(r,e,t,s.subarray(0,-16),n);return s.set(u,a),s},decrypt:(o,s)=>{let a=o.length,c=a-16;if(a<16)throw new Error("encrypted data must be at least 16 bytes");s?qe(s,c):s=new Uint8Array(c);let u=o.subarray(0,-16),f=o.subarray(-16),l=Jr(r,e,t,u,n);if(!$r(f,l))throw new Error("invalid tag");return r(e,t,u,s,1),s}}),ar=di(hi);var cr=class{constructor(e){Object.defineProperty(this,"_key",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._key=new Uint8Array(e)}async seal(e,t,n){return await this._seal(e,t,n)}async open(e,t,n){return await this._open(e,t,n)}_seal(e,t,n){return new Promise(i=>{let o=ar(this._key,new Uint8Array(e),new Uint8Array(n)).encrypt(new Uint8Array(t));i(o.buffer)})}_open(e,t,n){return new Promise(i=>{let o=ar(this._key,new Uint8Array(e),new Uint8Array(n)).decrypt(new Uint8Array(t));i(o.buffer)})}},At=class{constructor(){Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:ue.Chacha20Poly1305}),Object.defineProperty(this,"keySize",{enumerable:!0,configurable:!0,writable:!0,value:32}),Object.defineProperty(this,"nonceSize",{enumerable:!0,configurable:!0,writable:!0,value:12}),Object.defineProperty(this,"tagSize",{enumerable:!0,configurable:!0,writable:!0,value:16})}createEncryptionContext(e){return new cr(e)}};function fr(r){if(!Number.isSafeInteger(r)||r<0)throw new Error(`Wrong positive integer: ${r}`)}function pi(r){if(typeof r!="boolean")throw new Error(`Expected boolean, not ${r}`)}function Qr(r,...e){if(!(r instanceof Uint8Array))throw new Error("Expected Uint8Array");if(e.length>0&&!e.includes(r.length))throw new Error(`Expected Uint8Array of length ${e}, not of length=${r.length}`)}function yi(r){if(typeof r!="function"||typeof r.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");fr(r.outputLen),fr(r.blockLen)}function bi(r,e=!0){if(r.destroyed)throw new Error("Hash instance has been destroyed");if(e&&r.finished)throw new Error("Hash#digest() has already been called")}function wi(r,e){Qr(r);let t=e.outputLen;if(r.lengthr instanceof Uint8Array;var tn=r=>new Uint32Array(r.buffer,r.byteOffset,Math.floor(r.byteLength/4)),Bt=r=>new DataView(r.buffer,r.byteOffset,r.byteLength),be=(r,e)=>r<<32-e|r>>>e,mi=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!mi)throw new Error("Non little-endian hardware is not supported");var As=Array.from({length:256},(r,e)=>e.toString(16).padStart(2,"0"));function it(r){if(typeof r!="string")throw new Error(`utf8ToBytes expected string, got ${typeof r}`);return new Uint8Array(new TextEncoder().encode(r))}function Ke(r){if(typeof r=="string"&&(r=it(r)),!en(r))throw new Error(`expected Uint8Array, got ${typeof r}`);return r}function Pt(...r){let e=new Uint8Array(r.reduce((n,i)=>n+i.length,0)),t=0;return r.forEach(n=>{if(!en(n))throw new Error("Uint8Array expected");e.set(n,t),t+=n.length}),e}var Le=class{clone(){return this._cloneInto()}};function de(r){let e=n=>r().update(Ke(n)).digest(),t=r();return e.outputLen=t.outputLen,e.blockLen=t.blockLen,e.create=()=>r(),e}function rn(r){let e=(n,i)=>r(i).update(Ke(n)).digest(),t=r({});return e.outputLen=t.outputLen,e.blockLen=t.blockLen,e.create=n=>r(n),e}function Ze(r=32){if(St&&typeof St.getRandomValues=="function")return St.getRandomValues(new Uint8Array(r));throw new Error("crypto.getRandomValues must be defined")}var It=class extends Le{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,ne.hash(e);let n=Ke(t);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let i=this.blockLen,o=new Uint8Array(i);o.set(n.length>i?e.create().update(n).digest():n);for(let s=0;snew It(r,e).update(t).digest();Me.create=(r,e)=>new It(r,e);function gi(r,e,t,n){if(typeof r.setBigUint64=="function")return r.setBigUint64(e,t,n);let i=BigInt(32),o=BigInt(4294967295),s=Number(t>>i&o),a=Number(t&o),c=n?4:0,u=n?0:4;r.setUint32(e+c,s,n),r.setUint32(e+u,a,n)}var Xe=class extends Le{constructor(e,t,n,i){super(),this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=Bt(this.buffer)}update(e){ne.exists(this);let{view:t,buffer:n,blockLen:i}=this;e=Ke(e);let o=e.length;for(let s=0;si-s&&(this.process(n,0),s=0);for(let l=s;lf.length)throw new Error("_sha2: outputLen bigger than state");for(let l=0;lr&e^~r&t,Ei=(r,e,t)=>r&e^r&t^e&t,vi=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Ue=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Oe=new Uint32Array(64),Lt=class extends Xe{constructor(){super(64,32,8,!1),this.A=Ue[0]|0,this.B=Ue[1]|0,this.C=Ue[2]|0,this.D=Ue[3]|0,this.E=Ue[4]|0,this.F=Ue[5]|0,this.G=Ue[6]|0,this.H=Ue[7]|0}get(){let{A:e,B:t,C:n,D:i,E:o,F:s,G:a,H:c}=this;return[e,t,n,i,o,s,a,c]}set(e,t,n,i,o,s,a,c){this.A=e|0,this.B=t|0,this.C=n|0,this.D=i|0,this.E=o|0,this.F=s|0,this.G=a|0,this.H=c|0}process(e,t){for(let l=0;l<16;l++,t+=4)Oe[l]=e.getUint32(t,!1);for(let l=16;l<64;l++){let d=Oe[l-15],m=Oe[l-2],v=be(d,7)^be(d,18)^d>>>3,_=be(m,17)^be(m,19)^m>>>10;Oe[l]=_+Oe[l-7]+v+Oe[l-16]|0}let{A:n,B:i,C:o,D:s,E:a,F:c,G:u,H:f}=this;for(let l=0;l<64;l++){let d=be(a,6)^be(a,11)^be(a,25),m=f+d+_i(a,c,u)+vi[l]+Oe[l]|0,_=(be(n,2)^be(n,13)^be(n,22))+Ei(n,i,o)|0;f=u,u=c,c=a,a=s+m|0,s=o,o=i,i=n,n=m+_|0}n=n+this.A|0,i=i+this.B|0,o=o+this.C|0,s=s+this.D|0,a=a+this.E|0,c=c+this.F|0,u=u+this.G|0,f=f+this.H|0,this.set(n,i,o,s,a,c,u,f)}roundClean(){Oe.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}},ur=class extends Lt{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}},nn=de(()=>new Lt),Ts=de(()=>new ur);var Z=new Uint8Array(0);var on=new Uint8Array([72,80,75,69,45,118,49]),ot=class extends me{constructor(){super(),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:ke.HkdfSha256}),Object.defineProperty(this,"hashSize",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_suiteId",{enumerable:!0,configurable:!0,writable:!0,value:Z}),Object.defineProperty(this,"algHash",{enumerable:!0,configurable:!0,writable:!0,value:{name:"HMAC",hash:"SHA-256",length:256}})}init(e){this._suiteId=e}buildLabeledIkm(e,t){this._checkInit();let n=new Uint8Array(7+this._suiteId.byteLength+e.byteLength+t.byteLength);return n.set(on,0),n.set(this._suiteId,7),n.set(e,7+this._suiteId.byteLength),n.set(t,7+this._suiteId.byteLength+e.byteLength),n}buildLabeledInfo(e,t,n){this._checkInit();let i=new Uint8Array(9+this._suiteId.byteLength+e.byteLength+t.byteLength);return i.set(new Uint8Array([0,n]),0),i.set(on,2),i.set(this._suiteId,9),i.set(e,9+this._suiteId.byteLength),i.set(t,9+this._suiteId.byteLength+e.byteLength),i}async extract(e,t){if(await this._setup(),e.byteLength===0&&(e=new ArrayBuffer(this.hashSize)),e.byteLength!==this.hashSize)throw new ee("The salt length must be the same as the hashSize");let n=await this._api.importKey("raw",e,this.algHash,!1,["sign"]);return await this._api.sign("HMAC",n,t)}async expand(e,t,n){await this._setup();let i=await this._api.importKey("raw",e,this.algHash,!1,["sign"]),o=new ArrayBuffer(n),s=new Uint8Array(o),a=Z,c=new Uint8Array(t),u=new Uint8Array(1);if(n>255*this.hashSize)throw new Error("Entropy limit reached");let f=new Uint8Array(this.hashSize+c.length+1);for(let l=1,d=0;d=a.length?(s.set(a,d),d+=a.length):(s.set(a.slice(0,s.length-d),d),d+=s.length-d);return o}async extractAndExpand(e,t,n,i){await this._setup();let o=await this._api.importKey("raw",t,"HKDF",!1,["deriveBits"]);return await this._api.deriveBits({name:"HKDF",hash:this.algHash.hash,salt:e,info:n},o,i*8)}async labeledExtract(e,t,n){return await this.extract(e,this.buildLabeledIkm(t,n))}async labeledExpand(e,t,n,i){return await this.expand(e,this.buildLabeledInfo(t,n,i),i)}_checkInit(){if(this._suiteId===Z)throw new Error("Not initialized. Call init()")}},Kt=class extends ot{constructor(){super(...arguments),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:ke.HkdfSha256}),Object.defineProperty(this,"hashSize",{enumerable:!0,configurable:!0,writable:!0,value:32}),Object.defineProperty(this,"algHash",{enumerable:!0,configurable:!0,writable:!0,value:{name:"HMAC",hash:"SHA-256",length:256}})}},Ut=class extends ot{constructor(){super(...arguments),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:ke.HkdfSha384}),Object.defineProperty(this,"hashSize",{enumerable:!0,configurable:!0,writable:!0,value:48}),Object.defineProperty(this,"algHash",{enumerable:!0,configurable:!0,writable:!0,value:{name:"HMAC",hash:"SHA-384",length:384}})}},Ot=class extends ot{constructor(){super(...arguments),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:ke.HkdfSha512}),Object.defineProperty(this,"hashSize",{enumerable:!0,configurable:!0,writable:!0,value:64}),Object.defineProperty(this,"algHash",{enumerable:!0,configurable:!0,writable:!0,value:{name:"HMAC",hash:"SHA-512",length:512}})}};var He=class extends Kt{async extract(e,t){if(await this._setup(),e.byteLength===0&&(e=new ArrayBuffer(this.hashSize)),e.byteLength!==this.hashSize)return Me(nn,new Uint8Array(e),new Uint8Array(t));let n=await this._api.importKey("raw",e,this.algHash,!1,["sign"]);return await this._api.sign("HMAC",n,t)}};var Ht=BigInt(4294967295),hr=BigInt(32);function sn(r,e=!1){return e?{h:Number(r&Ht),l:Number(r>>hr&Ht)}:{h:Number(r>>hr&Ht)|0,l:Number(r&Ht)|0}}function ki(r,e=!1){let t=new Uint32Array(r.length),n=new Uint32Array(r.length);for(let i=0;iBigInt(r>>>0)<>>0),Si=(r,e,t)=>r>>>t,Bi=(r,e,t)=>r<<32-t|e>>>t,Pi=(r,e,t)=>r>>>t|e<<32-t,Ii=(r,e,t)=>r<<32-t|e>>>t,Li=(r,e,t)=>r<<64-t|e>>>t-32,Ki=(r,e,t)=>r>>>t-32|e<<64-t,Ui=(r,e)=>e,Oi=(r,e)=>r,Hi=(r,e,t)=>r<>>32-t,Ti=(r,e,t)=>e<>>32-t,Ci=(r,e,t)=>e<>>64-t,Ni=(r,e,t)=>r<>>64-t;function Di(r,e,t,n){let i=(e>>>0)+(n>>>0);return{h:r+t+(i/2**32|0)|0,l:i|0}}var zi=(r,e,t)=>(r>>>0)+(e>>>0)+(t>>>0),Ri=(r,e,t,n)=>e+t+n+(r/2**32|0)|0,ji=(r,e,t,n)=>(r>>>0)+(e>>>0)+(t>>>0)+(n>>>0),qi=(r,e,t,n,i)=>e+t+n+i+(r/2**32|0)|0,Mi=(r,e,t,n,i)=>(r>>>0)+(e>>>0)+(t>>>0)+(n>>>0)+(i>>>0),Gi=(r,e,t,n,i,o)=>e+t+n+i+o+(r/2**32|0)|0,Fi={fromBig:sn,split:ki,toBig:Ai,shrSH:Si,shrSL:Bi,rotrSH:Pi,rotrSL:Ii,rotrBH:Li,rotrBL:Ki,rotr32H:Ui,rotr32L:Oi,rotlSH:Hi,rotlSL:Ti,rotlBH:Ci,rotlBL:Ni,add:Di,add3L:zi,add3H:Ri,add4L:ji,add4H:qi,add5H:Gi,add5L:Mi},B=Fi;var[$i,Zi]=B.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(r=>BigInt(r))),Te=new Uint32Array(80),Ce=new Uint32Array(80),Ve=class extends Xe{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){let{Ah:e,Al:t,Bh:n,Bl:i,Ch:o,Cl:s,Dh:a,Dl:c,Eh:u,El:f,Fh:l,Fl:d,Gh:m,Gl:v,Hh:_,Hl:k}=this;return[e,t,n,i,o,s,a,c,u,f,l,d,m,v,_,k]}set(e,t,n,i,o,s,a,c,u,f,l,d,m,v,_,k){this.Ah=e|0,this.Al=t|0,this.Bh=n|0,this.Bl=i|0,this.Ch=o|0,this.Cl=s|0,this.Dh=a|0,this.Dl=c|0,this.Eh=u|0,this.El=f|0,this.Fh=l|0,this.Fl=d|0,this.Gh=m|0,this.Gl=v|0,this.Hh=_|0,this.Hl=k|0}process(e,t){for(let b=0;b<16;b++,t+=4)Te[b]=e.getUint32(t),Ce[b]=e.getUint32(t+=4);for(let b=16;b<80;b++){let L=Te[b-15]|0,E=Ce[b-15]|0,H=B.rotrSH(L,E,1)^B.rotrSH(L,E,8)^B.shrSH(L,E,7),j=B.rotrSL(L,E,1)^B.rotrSL(L,E,8)^B.shrSL(L,E,7),K=Te[b-2]|0,x=Ce[b-2]|0,I=B.rotrSH(K,x,19)^B.rotrBH(K,x,61)^B.shrSH(K,x,6),P=B.rotrSL(K,x,19)^B.rotrBL(K,x,61)^B.shrSL(K,x,6),S=B.add4L(j,P,Ce[b-7],Ce[b-16]),A=B.add4H(S,H,I,Te[b-7],Te[b-16]);Te[b]=A|0,Ce[b]=S|0}let{Ah:n,Al:i,Bh:o,Bl:s,Ch:a,Cl:c,Dh:u,Dl:f,Eh:l,El:d,Fh:m,Fl:v,Gh:_,Gl:k,Hh:F,Hl:V}=this;for(let b=0;b<80;b++){let L=B.rotrSH(l,d,14)^B.rotrSH(l,d,18)^B.rotrBH(l,d,41),E=B.rotrSL(l,d,14)^B.rotrSL(l,d,18)^B.rotrBL(l,d,41),H=l&m^~l&_,j=d&v^~d&k,K=B.add5L(V,E,j,Zi[b],Ce[b]),x=B.add5H(K,F,L,H,$i[b],Te[b]),I=K|0,P=B.rotrSH(n,i,28)^B.rotrBH(n,i,34)^B.rotrBH(n,i,39),S=B.rotrSL(n,i,28)^B.rotrBL(n,i,34)^B.rotrBL(n,i,39),A=n&o^n&a^o&a,q=i&s^i&c^s&c;F=_|0,V=k|0,_=m|0,k=v|0,m=l|0,v=d|0,{h:l,l:d}=B.add(u|0,f|0,x|0,I|0),u=a|0,f=c|0,a=o|0,c=s|0,o=n|0,s=i|0;let C=B.add3L(I,S,q);n=B.add3H(C,x,P,A),i=C|0}({h:n,l:i}=B.add(this.Ah|0,this.Al|0,n|0,i|0)),{h:o,l:s}=B.add(this.Bh|0,this.Bl|0,o|0,s|0),{h:a,l:c}=B.add(this.Ch|0,this.Cl|0,a|0,c|0),{h:u,l:f}=B.add(this.Dh|0,this.Dl|0,u|0,f|0),{h:l,l:d}=B.add(this.Eh|0,this.El|0,l|0,d|0),{h:m,l:v}=B.add(this.Fh|0,this.Fl|0,m|0,v|0),{h:_,l:k}=B.add(this.Gh|0,this.Gl|0,_|0,k|0),{h:F,l:V}=B.add(this.Hh|0,this.Hl|0,F|0,V|0),this.set(n,i,o,s,a,c,u,f,l,d,m,v,_,k,F,V)}roundClean(){Te.fill(0),Ce.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}},lr=class extends Ve{constructor(){super(),this.Ah=-1942145080,this.Al=424955298,this.Bh=1944164710,this.Bl=-1982016298,this.Ch=502970286,this.Cl=855612546,this.Dh=1738396948,this.Dl=1479516111,this.Eh=258812777,this.El=2077511080,this.Fh=2011393907,this.Fl=79989058,this.Gh=1067287976,this.Gl=1780299464,this.Hh=286451373,this.Hl=-1848208735,this.outputLen=28}},dr=class extends Ve{constructor(){super(),this.Ah=573645204,this.Al=-64227540,this.Bh=-1621794909,this.Bl=-934517566,this.Ch=596883563,this.Cl=1867755857,this.Dh=-1774684391,this.Dl=1497426621,this.Eh=-1775747358,this.El=-1467023389,this.Fh=-1101128155,this.Fl=1401305490,this.Gh=721525244,this.Gl=746961066,this.Hh=246885852,this.Hl=-2117784414,this.outputLen=32}},pr=class extends Ve{constructor(){super(),this.Ah=-876896931,this.Al=-1056596264,this.Bh=1654270250,this.Bl=914150663,this.Ch=-1856437926,this.Cl=812702999,this.Dh=355462360,this.Dl=-150054599,this.Eh=1731405415,this.El=-4191439,this.Fh=-1900787065,this.Fl=1750603025,this.Gh=-619958771,this.Gl=1694076839,this.Hh=1203062813,this.Hl=-1090891868,this.outputLen=48}},st=de(()=>new Ve),Ws=de(()=>new lr),Js=de(()=>new dr),an=de(()=>new pr);var Ye=class extends Ut{async extract(e,t){if(await this._setup(),e.byteLength===0&&(e=new ArrayBuffer(this.hashSize)),e.byteLength!==this.hashSize)return Me(an,new Uint8Array(e),new Uint8Array(t));let n=await this._api.importKey("raw",e,this.algHash,!1,["sign"]);return await this._api.sign("HMAC",n,t)}};var Ne=class extends Ot{async extract(e,t){if(await this._setup(),e.byteLength===0&&(e=new ArrayBuffer(this.hashSize)),e.byteLength!==this.hashSize)return Me(st,new Uint8Array(e),new Uint8Array(t));let n=await this._api.importKey("raw",e,this.algHash,!1,["sign"]);return await this._api.sign("HMAC",n,t)}};var cn=new Uint8Array([75,69,77,0,0]);var We=r=>typeof r=="object"&&r!==null&&typeof r.privateKey=="object"&&typeof r.publicKey=="object";function ge(r,e){if(e<=0)throw new Error("i2Osp: too small size");if(r>=256**e)throw new Error("i2Osp: too large integer");let t=new Uint8Array(e);for(let n=0;n>8;return t}function at(r,e){let t=new Uint8Array(r.length+e.length);return t.set(r,0),t.set(e,r.length),t}function De(r){let e=r.replace(/-/g,"+").replace(/_/g,"/"),t=atob(e),n=new Uint8Array(t.length);for(let i=0;i8192)throw new ee("Too long ikm");return await this._prim.deriveKeyPair(e)}async encap(e){let t;e.ekm===void 0?t=await this.generateKeyPair():We(e.ekm)?t=e.ekm:t=await this.deriveKeyPair(e.ekm);let n=await this._prim.serializePublicKey(t.publicKey),i=await this._prim.serializePublicKey(e.recipientPublicKey);try{let o;if(e.senderKey===void 0)o=new Uint8Array(await this._prim.dh(t.privateKey,e.recipientPublicKey));else{let c=We(e.senderKey)?e.senderKey.privateKey:e.senderKey,u=new Uint8Array(await this._prim.dh(t.privateKey,e.recipientPublicKey)),f=new Uint8Array(await this._prim.dh(c,e.recipientPublicKey));o=at(u,f)}let s;if(e.senderKey===void 0)s=at(new Uint8Array(n),new Uint8Array(i));else{let c=We(e.senderKey)?e.senderKey.publicKey:await this._prim.derivePublicKey(e.senderKey),u=await this._prim.serializePublicKey(c);s=Yi(new Uint8Array(n),new Uint8Array(i),new Uint8Array(u))}let a=await this._generateSharedSecret(o,s);return{enc:n,sharedSecret:a}}catch(o){throw new yt(o)}}async decap(e){let t=await this._prim.deserializePublicKey(e.enc),n=We(e.recipientKey)?e.recipientKey.privateKey:e.recipientKey,i=We(e.recipientKey)?e.recipientKey.publicKey:await this._prim.derivePublicKey(e.recipientKey),o=await this._prim.serializePublicKey(i);try{let s;if(e.senderPublicKey===void 0)s=new Uint8Array(await this._prim.dh(n,t));else{let c=new Uint8Array(await this._prim.dh(n,t)),u=new Uint8Array(await this._prim.dh(n,e.senderPublicKey));s=at(c,u)}let a;if(e.senderPublicKey===void 0)a=at(new Uint8Array(e.enc),new Uint8Array(o));else{let c=await this._prim.serializePublicKey(e.senderPublicKey);a=new Uint8Array(e.enc.byteLength+o.byteLength+c.byteLength),a.set(new Uint8Array(e.enc),0),a.set(new Uint8Array(o),e.enc.byteLength),a.set(new Uint8Array(c),e.enc.byteLength+o.byteLength)}return await this._generateSharedSecret(s,a)}catch(s){throw new bt(s)}}async _generateSharedSecret(e,t){let n=this._kdf.buildLabeledIkm(Xi,e),i=this._kdf.buildLabeledInfo(Vi,t,this.secretSize);return await this._kdf.extractAndExpand(Z,n,i,this.secretSize)}};var he=["deriveBits"],Je=new Uint8Array([100,107,112,95,112,114,107]),Tt=new Uint8Array([115,107]);var Ct=class{constructor(e){Object.defineProperty(this,"_num",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._num=new Uint8Array(e)}val(){return this._num}reset(){this._num.fill(0)}set(e){if(e.length!==this._num.length)throw new Error("Bignum.set: invalid argument");this._num.set(e)}isZero(){for(let e=0;ee[t])return!1}return!1}};var Wi=new Uint8Array([99,97,110,100,105,100,97,116,101]),Ji=new Uint8Array([255,255,255,255,0,0,0,0,255,255,255,255,255,255,255,255,188,230,250,173,167,23,158,132,243,185,202,194,252,99,37,81]),Qi=new Uint8Array([255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,199,99,77,129,244,55,45,223,88,26,13,178,72,176,167,122,236,236,25,106,204,197,41,115]),eo=new Uint8Array([1,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,250,81,134,135,131,191,47,150,107,127,204,1,72,247,9,165,208,59,181,201,184,137,156,71,174,187,111,183,30,145,56,100,9]),to=new Uint8Array([48,65,2,1,0,48,19,6,7,42,134,72,206,61,2,1,6,8,42,134,72,206,61,3,1,7,4,39,48,37,2,1,1,4,32]),ro=new Uint8Array([48,78,2,1,0,48,16,6,7,42,134,72,206,61,2,1,6,5,43,129,4,0,34,4,55,48,53,2,1,1,4,48]),no=new Uint8Array([48,96,2,1,0,48,16,6,7,42,134,72,206,61,2,1,6,5,43,129,4,0,35,4,73,48,71,2,1,1,4,66]),ze=class extends me{constructor(e,t){switch(super(),Object.defineProperty(this,"_hkdf",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_alg",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_nPk",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_nSk",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_nDh",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_order",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_bitmask",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_pkcs8AlgId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._hkdf=t,e){case $.DhkemP256HkdfSha256:this._alg={name:"ECDH",namedCurve:"P-256"},this._nPk=65,this._nSk=32,this._nDh=32,this._order=Ji,this._bitmask=255,this._pkcs8AlgId=to;break;case $.DhkemP384HkdfSha384:this._alg={name:"ECDH",namedCurve:"P-384"},this._nPk=97,this._nSk=48,this._nDh=48,this._order=Qi,this._bitmask=255,this._pkcs8AlgId=ro;break;default:this._alg={name:"ECDH",namedCurve:"P-521"},this._nPk=133,this._nSk=66,this._nDh=66,this._order=eo,this._bitmask=1,this._pkcs8AlgId=no;break}}async serializePublicKey(e){await this._setup();try{return await this._api.exportKey("raw",e)}catch(t){throw new ce(t)}}async deserializePublicKey(e){await this._setup();try{return await this._importRawKey(e,!0)}catch(t){throw new te(t)}}async serializePrivateKey(e){await this._setup();try{let t=await this._api.exportKey("jwk",e);if(!("d"in t))throw new Error("Not private key");return De(t.d)}catch(t){throw new ce(t)}}async deserializePrivateKey(e){await this._setup();try{return await this._importRawKey(e,!1)}catch(t){throw new te(t)}}async importKey(e,t,n){await this._setup();try{if(e==="raw")return await this._importRawKey(t,n);if(t instanceof ArrayBuffer)throw new Error("Invalid jwk key format");return await this._importJWK(t,n)}catch(i){throw new te(i)}}async generateKeyPair(){await this._setup();try{return await this._api.generateKey(this._alg,!0,he)}catch(e){throw new fe(e)}}async deriveKeyPair(e){await this._setup();try{let t=await this._hkdf.labeledExtract(Z,Je,new Uint8Array(e)),n=new Ct(this._nSk);for(let o=0;n.isZero()||!n.lessThan(this._order);o++){if(o>255)throw new Error("Faild to derive a key pair");let s=new Uint8Array(await this._hkdf.labeledExpand(t,Wi,ge(o,1),this._nSk));s[0]=s[0]&this._bitmask,n.set(s)}let i=await this._deserializePkcs8Key(n.val());return n.reset(),{privateKey:i,publicKey:await this.derivePublicKey(i)}}catch(t){throw new Ie(t)}}async derivePublicKey(e){await this._setup();try{let t=await this._api.exportKey("jwk",e);return delete t.d,delete t.key_ops,await this._api.importKey("jwk",t,this._alg,!0,[])}catch(t){throw new te(t)}}async dh(e,t){try{return await this._setup(),await this._api.deriveBits({name:"ECDH",public:t},e,this._nDh*8)}catch(n){throw new ce(n)}}async _importRawKey(e,t){if(t&&e.byteLength!==this._nPk)throw new Error("Invalid public key for the ciphersuite");if(!t&&e.byteLength!==this._nSk)throw new Error("Invalid private key for the ciphersuite");return t?await this._api.importKey("raw",e,this._alg,!0,[]):await this._deserializePkcs8Key(new Uint8Array(e))}async _importJWK(e,t){if(typeof e.crv>"u"||e.crv!==this._alg.namedCurve)throw new Error(`Invalid crv: ${e.crv}`);if(t){if(typeof e.d<"u")throw new Error("Invalid key: `d` should not be set");return await this._api.importKey("jwk",e,this._alg,!0,[])}if(typeof e.d>"u")throw new Error("Invalid key: `d` not found");return await this._api.importKey("jwk",e,this._alg,!0,he)}async _deserializePkcs8Key(e){let t=new Uint8Array(this._pkcs8AlgId.length+e.length);return t.set(this._pkcs8AlgId,0),t.set(e,this._pkcs8AlgId.length),await this._api.importKey("pkcs8",t,this._alg,!0,he)}};var Nt=class extends ye{constructor(){let e=new He,t=new ze($.DhkemP256HkdfSha256,e);super($.DhkemP256HkdfSha256,t,e),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:$.DhkemP256HkdfSha256}),Object.defineProperty(this,"secretSize",{enumerable:!0,configurable:!0,writable:!0,value:32}),Object.defineProperty(this,"encSize",{enumerable:!0,configurable:!0,writable:!0,value:65}),Object.defineProperty(this,"publicKeySize",{enumerable:!0,configurable:!0,writable:!0,value:65}),Object.defineProperty(this,"privateKeySize",{enumerable:!0,configurable:!0,writable:!0,value:32})}};var Dt=class extends ye{constructor(){let e=new Ye,t=new ze($.DhkemP384HkdfSha384,e);super($.DhkemP384HkdfSha384,t,e),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:$.DhkemP384HkdfSha384}),Object.defineProperty(this,"secretSize",{enumerable:!0,configurable:!0,writable:!0,value:48}),Object.defineProperty(this,"encSize",{enumerable:!0,configurable:!0,writable:!0,value:97}),Object.defineProperty(this,"publicKeySize",{enumerable:!0,configurable:!0,writable:!0,value:97}),Object.defineProperty(this,"privateKeySize",{enumerable:!0,configurable:!0,writable:!0,value:48})}};var zt=class extends ye{constructor(){let e=new Ne,t=new ze($.DhkemP521HkdfSha512,e);super($.DhkemP521HkdfSha512,t,e),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:$.DhkemP521HkdfSha512}),Object.defineProperty(this,"secretSize",{enumerable:!0,configurable:!0,writable:!0,value:64}),Object.defineProperty(this,"encSize",{enumerable:!0,configurable:!0,writable:!0,value:133}),Object.defineProperty(this,"publicKeySize",{enumerable:!0,configurable:!0,writable:!0,value:133}),Object.defineProperty(this,"privateKeySize",{enumerable:!0,configurable:!0,writable:!0,value:64})}};var Ra=BigInt(0),io=BigInt(1),oo=BigInt(2),Rt=r=>r instanceof Uint8Array,so=Array.from({length:256},(r,e)=>e.toString(16).padStart(2,"0"));function ct(r){if(!Rt(r))throw new Error("Uint8Array expected");let e="";for(let t=0;tn+i.length,0)),t=0;return r.forEach(n=>{if(!Rt(n))throw new Error("Uint8Array expected");e.set(n,t),t+=n.length}),e}var hn=r=>(oo<typeof r=="bigint",function:r=>typeof r=="function",boolean:r=>typeof r=="boolean",string:r=>typeof r=="string",isSafeInteger:r=>Number.isSafeInteger(r),array:r=>Array.isArray(r),field:(r,e)=>e.Fp.isValid(r),hash:r=>typeof r=="function"&&Number.isSafeInteger(r.outputLen)};function Se(r,e,t={}){let n=(i,o,s)=>{let a=ao[o];if(typeof a!="function")throw new Error(`Invalid validator "${o}", expected function`);let c=r[i];if(!(s&&c===void 0)&&!a(c,r))throw new Error(`Invalid param ${String(i)}=${c} (${typeof c}), expected ${o}`)};for(let[i,o]of Object.entries(e))n(i,o,!1);for(let[i,o]of Object.entries(t))n(i,o,!0);return r}var Q=BigInt(0),W=BigInt(1),Fe=BigInt(2),fo=BigInt(3),wr=BigInt(4),ln=BigInt(5),dn=BigInt(8),uo=BigInt(9),ho=BigInt(16);function D(r,e){let t=r%e;return t>=Q?t:e+t}function xr(r,e,t){if(t<=Q||e 0");if(t===W)return Q;let n=W;for(;e>Q;)e&W&&(n=n*r%t),r=r*r%t,e>>=W;return n}function X(r,e,t){let n=r;for(;e-- >Q;)n*=n,n%=t;return n}function pn(r,e){if(r===Q||e<=Q)throw new Error(`invert: expected positive integers, got n=${r} mod=${e}`);let t=D(r,e),n=e,i=Q,o=W,s=W,a=Q;for(;t!==Q;){let u=n/t,f=n%t,l=i-s*u,d=o-a*u;n=t,t=f,i=s,o=a,s=l,a=d}if(n!==W)throw new Error("invert: does not exist");return D(i,e)}function lo(r){let e=(r-W)/Fe,t,n,i;for(t=r-W,n=0;t%Fe===Q;t/=Fe,n++);for(i=Fe;i(D(r,e)&W)===W,yo=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function bn(r){let e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},t=yo.reduce((n,i)=>(n[i]="function",n),e);return Se(r,t)}function bo(r,e,t){if(t 0");if(t===Q)return r.ONE;if(t===W)return e;let n=r.ONE,i=e;for(;t>Q;)t&W&&(n=r.mul(n,i)),i=r.sqr(i),t>>=W;return n}function wo(r,e){let t=new Array(e.length),n=e.reduce((o,s,a)=>r.is0(s)?o:(t[a]=o,r.mul(o,s)),r.ONE),i=r.inv(n);return e.reduceRight((o,s,a)=>r.is0(s)?o:(t[a]=r.mul(o,t[a]),r.mul(o,s)),i),t}function mr(r,e){let t=e!==void 0?e:r.toString(2).length,n=Math.ceil(t/8);return{nBitLength:t,nByteLength:n}}function qt(r,e,t=!1,n={}){if(r<=Q)throw new Error(`Expected Fp ORDER > 0, got ${r}`);let{nBitLength:i,nByteLength:o}=mr(r,e);if(o>2048)throw new Error("Field lengths over 2048 bytes are not supported");let s=po(r),a=Object.freeze({ORDER:r,BITS:i,BYTES:o,MASK:hn(i),ZERO:Q,ONE:W,create:c=>D(c,r),isValid:c=>{if(typeof c!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof c}`);return Q<=c&&cc===Q,isOdd:c=>(c&W)===W,neg:c=>D(-c,r),eql:(c,u)=>c===u,sqr:c=>D(c*c,r),add:(c,u)=>D(c+u,r),sub:(c,u)=>D(c-u,r),mul:(c,u)=>D(c*u,r),pow:(c,u)=>bo(a,c,u),div:(c,u)=>D(c*pn(u,r),r),sqrN:c=>c*c,addN:(c,u)=>c+u,subN:(c,u)=>c-u,mulN:(c,u)=>c*u,inv:c=>pn(c,r),sqrt:n.sqrt||(c=>s(a,c)),invertBatch:c=>wo(a,c),cmov:(c,u,f)=>f?u:c,toBytes:c=>t?Re(c,o):br(c,o),fromBytes:c=>{if(c.length!==o)throw new Error(`Fp.fromBytes: expected ${o}, got ${c.length}`);return t?_e(c):yr(c)}});return Object.freeze(a)}function wn(r,e){if(!r.isOdd)throw new Error("Field doesn't have isOdd");let t=r.sqrt(e);return r.isOdd(t)?r.neg(t):t}var xo=BigInt(0),gr=BigInt(1);function xn(r,e){let t=(i,o)=>{let s=o.negate();return i?s:o},n=i=>{let o=Math.ceil(e/i)+1,s=2**(i-1);return{windows:o,windowSize:s}};return{constTimeNegate:t,unsafeLadder(i,o){let s=r.ZERO,a=i;for(;o>xo;)o&gr&&(s=s.add(a)),a=a.double(),o>>=gr;return s},precomputeWindow(i,o){let{windows:s,windowSize:a}=n(o),c=[],u=i,f=u;for(let l=0;l>=m,k>c&&(k-=d,s+=gr);let F=_,V=_+Math.abs(k)-1,b=v%2!==0,L=k<0;k===0?f=f.add(t(b,o[F])):u=u.add(t(L,o[V]))}return{p:u,f}},wNAFCached(i,o,s,a){let c=i._WINDOW_SIZE||1,u=o.get(i);return u||(u=this.precomputeWindow(i,c),c!==1&&o.set(i,a(u))),this.wNAF(c,u,s)}}}function mn(r){return bn(r.Fp),Se(r,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...mr(r.n,r.nBitLength),...r,p:r.Fp.ORDER})}var we=BigInt(0),pe=BigInt(1),Mt=BigInt(2),mo=BigInt(8),go={zip215:!0};function _o(r){let e=mn(r);return Se(r,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...e})}function $e(r){let e=_o(r),{Fp:t,n,prehash:i,hash:o,randomBytes:s,nByteLength:a,h:c}=e,u=Mt<{try{return{isValid:!0,value:t.sqrt(p*t.inv(h))}}catch{return{isValid:!1,value:we}}}),d=e.adjustScalarBytes||(p=>p),m=e.domain||((p,h,y)=>{if(h.length||y)throw new Error("Contexts/pre-hash are not supported");return p}),v=p=>typeof p=="bigint"&&wev(p)&&v(h)&&pp===we||_(p,u);function F(p,h){if(_(p,h))return p;throw new Error(`Expected valid scalar < ${h}, got ${typeof p} ${p}`)}function V(p){return p===we?p:F(p,n)}let b=new Map;function L(p){if(!(p instanceof E))throw new Error("ExtendedPoint expected")}class E{constructor(h,y,w,g){if(this.ex=h,this.ey=y,this.ez=w,this.et=g,!k(h))throw new Error("x required");if(!k(y))throw new Error("y required");if(!k(w))throw new Error("z required");if(!k(g))throw new Error("t required")}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(h){if(h instanceof E)throw new Error("extended point not allowed");let{x:y,y:w}=h||{};if(!k(y)||!k(w))throw new Error("invalid affine point");return new E(y,w,pe,f(y*w))}static normalizeZ(h){let y=t.invertBatch(h.map(w=>w.ez));return h.map((w,g)=>w.toAffine(y[g])).map(E.fromAffine)}_setWindowSize(h){this._WINDOW_SIZE=h,b.delete(this)}assertValidity(){let{a:h,d:y}=e;if(this.is0())throw new Error("bad point: ZERO");let{ex:w,ey:g,ez:U,et:T}=this,z=f(w*w),O=f(g*g),N=f(U*U),Y=f(N*N),J=f(z*h),xe=f(N*f(J+O)),se=f(Y+f(y*f(z*O)));if(xe!==se)throw new Error("bad point: equation left != right (1)");let Pe=f(w*g),Ee=f(U*T);if(Pe!==Ee)throw new Error("bad point: equation left != right (2)")}equals(h){L(h);let{ex:y,ey:w,ez:g}=this,{ex:U,ey:T,ez:z}=h,O=f(y*z),N=f(U*g),Y=f(w*z),J=f(T*g);return O===N&&Y===J}is0(){return this.equals(E.ZERO)}negate(){return new E(f(-this.ex),this.ey,this.ez,f(-this.et))}double(){let{a:h}=e,{ex:y,ey:w,ez:g}=this,U=f(y*y),T=f(w*w),z=f(Mt*f(g*g)),O=f(h*U),N=y+w,Y=f(f(N*N)-U-T),J=O+T,xe=J-z,se=O-T,Pe=f(Y*xe),Ee=f(J*se),dt=f(Y*se),pt=f(xe*J);return new E(Pe,Ee,pt,dt)}add(h){L(h);let{a:y,d:w}=e,{ex:g,ey:U,ez:T,et:z}=this,{ex:O,ey:N,ez:Y,et:J}=h;if(y===BigInt(-1)){let Kr=f((U-g)*(N+O)),Ur=f((U+g)*(N-O)),tr=f(Ur-Kr);if(tr===we)return this.double();let Or=f(T*Mt*J),Hr=f(z*Mt*Y),Tr=Hr+Or,Cr=Ur+Kr,Nr=Hr-Or,Mn=f(Tr*tr),Gn=f(Cr*Nr),Fn=f(Tr*Nr),$n=f(tr*Cr);return new E(Mn,Gn,$n,Fn)}let xe=f(g*O),se=f(U*N),Pe=f(z*w*J),Ee=f(T*Y),dt=f((g+U)*(O+N)-xe-se),pt=Ee-Pe,Ir=Ee+Pe,Lr=f(se-y*xe),zn=f(dt*pt),Rn=f(Ir*Lr),jn=f(dt*Lr),qn=f(pt*Ir);return new E(zn,Rn,qn,jn)}subtract(h){return this.add(h.negate())}wNAF(h){return K.wNAFCached(this,b,h,E.normalizeZ)}multiply(h){let{p:y,f:w}=this.wNAF(F(h,n));return E.normalizeZ([y,w])[0]}multiplyUnsafe(h){let y=V(h);return y===we?j:this.equals(j)||y===pe?this:this.equals(H)?this.wNAF(y).p:K.unsafeLadder(this,y)}isSmallOrder(){return this.multiplyUnsafe(c).is0()}isTorsionFree(){return K.unsafeLadder(this,n).is0()}toAffine(h){let{ex:y,ey:w,ez:g}=this,U=this.is0();h==null&&(h=U?mo:t.inv(g));let T=f(y*h),z=f(w*h),O=f(g*h);if(U)return{x:we,y:pe};if(O!==pe)throw new Error("invZ was invalid");return{x:T,y:z}}clearCofactor(){let{h}=e;return h===pe?this:this.multiplyUnsafe(h)}static fromHex(h,y=!1){let{d:w,a:g}=e,U=t.BYTES;h=le("pointHex",h,U);let T=h.slice(),z=h[U-1];T[U-1]=z&-129;let O=_e(T);O===we||(y?F(O,u):F(O,t.ORDER));let N=f(O*O),Y=f(N-pe),J=f(w*N-g),{isValid:xe,value:se}=l(Y,J);if(!xe)throw new Error("Point.fromHex: invalid y coordinate");let Pe=(se&pe)===pe,Ee=(z&128)!==0;if(!y&&se===we&&Ee)throw new Error("Point.fromHex: x=0 and x_0=1");return Ee!==Pe&&(se=f(-se)),E.fromAffine({x:se,y:O})}static fromPrivateKey(h){return P(h).point}toRawBytes(){let{x:h,y}=this.toAffine(),w=Re(y,t.BYTES);return w[w.length-1]|=h&pe?128:0,w}toHex(){return ct(this.toRawBytes())}}E.BASE=new E(e.Gx,e.Gy,pe,f(e.Gx*e.Gy)),E.ZERO=new E(we,pe,pe,we);let{BASE:H,ZERO:j}=E,K=xn(E,a*8);function x(p){return D(p,n)}function I(p){return x(_e(p))}function P(p){let h=a;p=le("private key",p,h);let y=le("hashed private key",o(p),2*h),w=d(y.slice(0,h)),g=y.slice(h,2*h),U=I(w),T=H.multiply(U),z=T.toRawBytes();return{head:w,prefix:g,scalar:U,point:T,pointBytes:z}}function S(p){return P(p).pointBytes}function A(p=new Uint8Array,...h){let y=jt(...h);return I(o(m(y,le("context",p),!!i)))}function q(p,h,y={}){p=le("message",p),i&&(p=i(p));let{prefix:w,scalar:g,pointBytes:U}=P(h),T=A(y.context,w,p),z=H.multiply(T).toRawBytes(),O=A(y.context,z,U,p),N=x(T+O*g);V(N);let Y=jt(z,Re(N,t.BYTES));return le("result",Y,a*2)}let C=go;function M(p,h,y,w=C){let{context:g,zip215:U}=w,T=t.BYTES;p=le("signature",p,2*T),h=le("message",h),i&&(h=i(h));let z=_e(p.slice(T,2*T)),O,N,Y;try{O=E.fromHex(y,U),N=E.fromHex(p.slice(0,T),U),Y=H.multiplyUnsafe(z)}catch{return!1}if(!U&&O.isSmallOrder())return!1;let J=A(g,N.toRawBytes(),O.toRawBytes(),h);return N.add(O.multiplyUnsafe(J)).subtract(Y).clearCofactor().equals(E.ZERO)}return H._setWindowSize(8),{CURVE:e,getPublicKey:S,sign:q,verify:M,ExtendedPoint:E,utils:{getExtendedPublicKey:P,randomPrivateKey:()=>s(t.BYTES),precompute(p=8,h=E.BASE){return h._setWindowSize(p),h.multiply(BigInt(3)),h}}}}var ft=BigInt(0),_r=BigInt(1);function Eo(r){return Se(r,{a:"bigint"},{montgomeryBits:"isSafeInteger",nByteLength:"isSafeInteger",adjustScalarBytes:"function",domain:"function",powPminus2:"function",Gu:"bigint"}),Object.freeze({...r})}function Gt(r){let e=Eo(r),{P:t}=e,n=b=>D(b,t),i=e.montgomeryBits,o=Math.ceil(i/8),s=e.nByteLength,a=e.adjustScalarBytes||(b=>b),c=e.powPminus2||(b=>xr(b,t-BigInt(2),t));function u(b,L,E){let H=n(b*(L-E));return L=n(L-H),E=n(E+H),[L,E]}function f(b){if(typeof b=="bigint"&&ft<=b&&b=ft;C--){let M=H>>C&_r;S^=M,A=u(S,K,I),K=A[0],I=A[1],A=u(S,x,P),x=A[0],P=A[1],S=M;let G=K+x,p=n(G*G),h=K-x,y=n(h*h),w=p-y,g=I+P,U=I-P,T=n(U*G),z=n(g*h),O=T+z,N=T-z;I=n(O*O),P=n(j*n(N*N)),K=n(p*y),x=n(w*(p+n(l*w)))}A=u(S,K,I),K=A[0],I=A[1],A=u(S,x,P),x=A[0],P=A[1];let q=c(x);return n(K*q)}function m(b){return Re(n(b),o)}function v(b){let L=le("u coordinate",b,o);return s===o&&(L[s-1]&=127),_e(L)}function _(b){let L=le("scalar",b);if(L.length!==o&&L.length!==s)throw new Error(`Expected ${o} or ${s} bytes, got ${L.length}`);return _e(a(L))}function k(b,L){let E=v(L),H=_(b),j=d(E,H);if(j===ft)throw new Error("Invalid private or public key received");return m(j)}let F=m(e.Gu);function V(b){return k(b,F)}return{scalarMult:k,scalarMultBase:V,getSharedSecret:(b,L)=>k(b,L),getPublicKey:b=>V(b),utils:{randomPrivateKey:()=>e.randomBytes(e.nByteLength)},GuBytes:F}}var ut=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),gn=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752"),lc=BigInt(0),ko=BigInt(1),Er=BigInt(2),Ao=BigInt(5),_n=BigInt(10),So=BigInt(20),Bo=BigInt(40),En=BigInt(80);function vn(r){let e=ut,n=r*r%e*r%e,i=X(n,Er,e)*n%e,o=X(i,ko,e)*r%e,s=X(o,Ao,e)*o%e,a=X(s,_n,e)*s%e,c=X(a,So,e)*a%e,u=X(c,Bo,e)*c%e,f=X(u,En,e)*u%e,l=X(f,En,e)*u%e,d=X(l,_n,e)*s%e;return{pow_p_5_8:X(d,Er,e)*r%e,b2:n}}function kn(r){return r[0]&=248,r[31]&=127,r[31]|=64,r}function Po(r,e){let t=ut,n=D(e*e*e,t),i=D(n*n*e,t),o=vn(r*i).pow_p_5_8,s=D(r*n*o,t),a=D(e*s*s,t),c=s,u=D(s*gn,t),f=a===r,l=a===D(-r,t),d=a===D(-r*gn,t);return f&&(s=c),(l||d)&&(s=u),yn(s,t)&&(s=D(-s,t)),{isValid:f||l,value:s}}var Be=qt(ut,void 0,!0),vr={a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:Be,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:BigInt(8),Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:st,randomBytes:Ze,adjustScalarBytes:kn,uvRatio:Po},An=$e(vr);function Sn(r,e,t){if(e.length>255)throw new Error("Context is too big");return Pt(it("SigEd25519 no Ed25519 collisions"),new Uint8Array([t?1:0,e.length]),e,r)}var dc=$e({...vr,domain:Sn}),pc=$e({...vr,domain:Sn,prehash:st}),kr=(()=>Gt({P:ut,a:BigInt(486662),montgomeryBits:255,nByteLength:32,Gu:BigInt(9),powPminus2:r=>{let e=ut,{pow_p_5_8:t,b2:n}=vn(r);return D(X(t,BigInt(3),e)*n,e)},adjustScalarBytes:kn,randomBytes:Ze}))();var Io=(Be.ORDER+BigInt(3))/BigInt(8),yc=Be.pow(Er,Io),bc=Be.sqrt(Be.neg(Be.ONE)),wc=(Be.ORDER-BigInt(5))/BigInt(8),xc=BigInt(486662);var mc=wn(Be,Be.neg(BigInt(486664)));var gc=BigInt("25063068953384623474111414158702152701244531502492656460079210482610430750235"),_c=BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"),Ec=BigInt("1159843021668779879193775521855586647937357759715417654439879720876111806838"),vc=BigInt("40440834346308536858101042469323190826248399146238708352240133220865137265952");var kc=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");var ie=class{constructor(e,t,n,i=[]){Object.defineProperty(this,"key",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"type",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"extractable",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"algorithm",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"usages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.key=t,this.type=n,this.algorithm={name:e},this.usages=i,n==="public"&&(this.usages=[])}};var Qe="X25519",Ft=class{constructor(e){Object.defineProperty(this,"_hkdf",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_nPk",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_nSk",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._hkdf=e,this._nPk=32,this._nSk=32}async serializePublicKey(e){try{return await this._serializePublicKey(e)}catch(t){throw new ce(t)}}async deserializePublicKey(e){try{return await this._importRawKey(e,!0)}catch(t){throw new te(t)}}async serializePrivateKey(e){try{return await this._serializePrivateKey(e)}catch(t){throw new ce(t)}}async deserializePrivateKey(e){try{return await this._importRawKey(e,!1)}catch(t){throw new te(t)}}async importKey(e,t,n){try{if(e==="raw")return await this._importRawKey(t,n);if(t instanceof ArrayBuffer)throw new Error("Invalid jwk key format");return await this._importJWK(t,n)}catch(i){throw new te(i)}}async generateKeyPair(){try{let e=An.utils.randomPrivateKey(),t=new ie(Qe,e,"private",he);return{publicKey:await this.derivePublicKey(t),privateKey:t}}catch(e){throw new fe(e)}}async deriveKeyPair(e){try{let t=await this._hkdf.labeledExtract(Z,Je,new Uint8Array(e)),n=await this._hkdf.labeledExpand(t,Tt,Z,this._nSk),i=new ie(Qe,new Uint8Array(n),"private",he);return{privateKey:i,publicKey:await this.derivePublicKey(i)}}catch(t){throw new Ie(t)}}async derivePublicKey(e){try{return await this._derivePublicKey(e)}catch(t){throw new te(t)}}async dh(e,t){try{return await this._dh(e,t)}catch(n){throw new ce(n)}}_serializePublicKey(e){return new Promise(t=>{t(e.key.buffer)})}_serializePrivateKey(e){return new Promise(t=>{t(e.key.buffer)})}_importRawKey(e,t){return new Promise((n,i)=>{t&&e.byteLength!==this._nPk&&i(new Error("Invalid length of the key")),!t&&e.byteLength!==this._nSk&&i(new Error("Invalid length of the key")),n(new ie(Qe,new Uint8Array(e),t?"public":"private",t?[]:he))})}_importJWK(e,t){return new Promise((n,i)=>{(typeof e.kty>"u"||e.kty!=="OKP")&&i(new Error(`Invalid kty: ${e.kty}`)),(typeof e.crv>"u"||e.crv!=="X25519")&&i(new Error(`Invalid crv: ${e.crv}`)),t?(typeof e.d<"u"&&i(new Error("Invalid key: `d` should not be set")),typeof e.x>"u"&&i(new Error("Invalid key: `x` not found")),n(new ie(Qe,De(e.x),"public"))):(typeof e.d!="string"&&i(new Error("Invalid key: `d` not found")),n(new ie(Qe,De(e.d),"private",he)))})}_derivePublicKey(e){return new Promise((t,n)=>{try{let i=kr.getPublicKey(e.key);t(new ie(Qe,i,"public"))}catch(i){n(i)}})}_dh(e,t){return new Promise((n,i)=>{try{n(kr.getSharedSecret(e.key,t.key).buffer)}catch(o){i(o)}})}};var $t=class extends ye{constructor(){let e=new He;super($.DhkemX25519HkdfSha256,new Ft(e),e),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:$.DhkemX25519HkdfSha256}),Object.defineProperty(this,"secretSize",{enumerable:!0,configurable:!0,writable:!0,value:32}),Object.defineProperty(this,"encSize",{enumerable:!0,configurable:!0,writable:!0,value:32}),Object.defineProperty(this,"publicKeySize",{enumerable:!0,configurable:!0,writable:!0,value:32}),Object.defineProperty(this,"privateKeySize",{enumerable:!0,configurable:!0,writable:!0,value:32})}};var[In,Ln,Kn]=[[],[],[]],Lo=BigInt(0),ht=BigInt(1),Ko=BigInt(2),Uo=BigInt(7),Oo=BigInt(256),Ho=BigInt(113);for(let r=0,e=ht,t=1,n=0;r<24;r++){[t,n]=[n,(2*t+3*n)%5],In.push(2*(5*n+t)),Ln.push((r+1)*(r+2)/2%64);let i=Lo;for(let o=0;o<7;o++)e=(e<>Uo)*Ho)%Oo,e&Ko&&(i^=ht<<(ht<t>32?B.rotlBH(r,e,t):B.rotlSH(r,e,t),Pn=(r,e,t)=>t>32?B.rotlBL(r,e,t):B.rotlSL(r,e,t);function No(r,e=24){let t=new Uint32Array(10);for(let n=24-e;n<24;n++){for(let s=0;s<10;s++)t[s]=r[s]^r[s+10]^r[s+20]^r[s+30]^r[s+40];for(let s=0;s<10;s+=2){let a=(s+8)%10,c=(s+2)%10,u=t[c],f=t[c+1],l=Bn(u,f,1)^t[a],d=Pn(u,f,1)^t[a+1];for(let m=0;m<50;m+=10)r[s+m]^=l,r[s+m+1]^=d}let i=r[2],o=r[3];for(let s=0;s<24;s++){let a=Ln[s],c=Bn(i,o,a),u=Pn(i,o,a),f=In[s];i=r[f],o=r[f+1],r[f]=c,r[f+1]=u}for(let s=0;s<50;s+=10){for(let a=0;a<10;a++)t[a]=r[s+a];for(let a=0;a<10;a++)r[s+a]^=~t[(a+2)%10]&t[(a+4)%10]}r[0]^=To[n],r[1]^=Co[n]}t.fill(0)}var Zt=class r extends Le{constructor(e,t,n,i=!1,o=24){if(super(),this.blockLen=e,this.suffix=t,this.outputLen=n,this.enableXOF=i,this.rounds=o,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,ne.number(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=tn(this.state)}keccak(){No(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){ne.exists(this);let{blockLen:t,state:n}=this;e=Ke(e);let i=e.length;for(let o=0;o=n&&this.keccak();let s=Math.min(n-this.posOut,o-i);e.set(t.subarray(this.posOut,this.posOut+s),i),this.posOut+=s,i+=s}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return ne.number(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(ne.output(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){let{blockLen:t,suffix:n,outputLen:i,rounds:o,enableXOF:s}=this;return e||(e=new r(t,n,i,s,o)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=o,e.suffix=n,e.outputLen=i,e.enableXOF=s,e.destroyed=this.destroyed,e}},je=(r,e,t)=>de(()=>new Zt(e,r,t)),qc=je(6,144,224/8),Mc=je(6,136,256/8),Gc=je(6,104,384/8),Fc=je(6,72,512/8),$c=je(1,144,224/8),Zc=je(1,136,256/8),Xc=je(1,104,384/8),Vc=je(1,72,512/8),Un=(r,e,t)=>rn((n={})=>new Zt(e,r,n.dkLen===void 0?t:n.dkLen,!0)),Yc=Un(31,168,128/8),Ar=Un(31,136,256/8);var Do=de(()=>Ar.create({dkLen:114})),zo=de(()=>Ar.create({dkLen:64})),lt=BigInt("726838724295606890549323807888004534353641360687318060281490199180612328166730772686396383698676545930088884461843637361053498018365439");function On(r){let e=lt,t=BigInt(1),n=BigInt(2),i=BigInt(3),o=BigInt(11),s=BigInt(22),a=BigInt(44),c=BigInt(88),u=BigInt(223),f=r*r*r%e,l=f*f*r%e,d=X(l,i,e)*l%e,m=X(d,i,e)*l%e,v=X(m,n,e)*f%e,_=X(v,o,e)*v%e,k=X(_,s,e)*_%e,F=X(k,a,e)*k%e,V=X(F,c,e)*F%e,b=X(V,a,e)*k%e,L=X(b,n,e)*f%e,E=X(L,t,e)*r%e;return X(E,u,e)*L%e}function Hn(r){return r[0]&=252,r[55]|=128,r[56]=0,r}var Tn=qt(lt,456,!0),of=BigInt(4),Cn={a:BigInt(1),d:BigInt("726838724295606890549323807888004534353641360687318060281490199180612328166730772686396383698676545930088884461843637361053498018326358"),Fp:Tn,n:BigInt("181709681073901722637330951972001133588410340171829515070372549795146003961539585716195755291692375963310293709091662304773755859649779"),nBitLength:456,h:BigInt(4),Gx:BigInt("224580040295924300187604334099896036246789641632564134246125461686950415467406032909029192869357953282578032075146446173674602635247710"),Gy:BigInt("298819210078481492676017930443930673437544040154080242095928241372331506189835876003536878655418784733982303233503462500531545062832660"),hash:Do,randomBytes:Ze,adjustScalarBytes:Hn,domain:(r,e,t)=>{if(e.length>255)throw new Error(`Context is too big: ${e.length}`);return Pt(it("SigEd448"),new Uint8Array([t?1:0,e.length]),e,r)},uvRatio:(r,e)=>{let t=lt,n=D(r*r*e,t),i=D(n*r,t),o=D(i*n*e,t),s=On(o),a=D(i*s,t),c=D(a*a,t);return{isValid:D(c*e,t)===r,value:a}}},Nn=$e(Cn),sf=$e({...Cn,prehash:zo}),Sr=(()=>Gt({a:BigInt(156326),montgomeryBits:448,nByteLength:57,P:lt,Gu:BigInt(5),powPminus2:r=>{let e=lt,t=On(r),n=X(t,BigInt(2),e);return D(n*r,e)},adjustScalarBytes:Hn,randomBytes:Ze}))();var af=(Tn.ORDER-BigInt(3))/BigInt(4),cf=BigInt(156326);var et="X448",Xt=class{constructor(e){Object.defineProperty(this,"_hkdf",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_nPk",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_nSk",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._hkdf=e,this._nPk=56,this._nSk=56}async serializePublicKey(e){try{return await this._serializePublicKey(e)}catch(t){throw new ce(t)}}async deserializePublicKey(e){try{return await this._importRawKey(e,!0)}catch(t){throw new te(t)}}async serializePrivateKey(e){try{return await this._serializePrivateKey(e)}catch(t){throw new ce(t)}}async deserializePrivateKey(e){try{return await this._importRawKey(e,!1)}catch(t){throw new te(t)}}async importKey(e,t,n){try{if(e==="raw")return await this._importRawKey(t,n);if(t instanceof ArrayBuffer)throw new Error("Invalid jwk key format");return await this._importJWK(t,n)}catch(i){throw new te(i)}}async generateKeyPair(){try{let e=Nn.utils.randomPrivateKey(),t=new ie(et,e,"private",he);return{publicKey:await this.derivePublicKey(t),privateKey:t}}catch(e){throw new fe(e)}}async deriveKeyPair(e){try{let t=await this._hkdf.labeledExtract(Z,Je,new Uint8Array(e)),n=await this._hkdf.labeledExpand(t,Tt,Z,this._nSk),i=new ie(et,new Uint8Array(n),"private",he);return{privateKey:i,publicKey:await this.derivePublicKey(i)}}catch(t){throw new Ie(t)}}async derivePublicKey(e){try{return await this._derivePublicKey(e)}catch(t){throw new te(t)}}async dh(e,t){try{return await this._dh(e,t)}catch(n){throw new ce(n)}}_serializePublicKey(e){return new Promise(t=>{t(e.key.buffer)})}_serializePrivateKey(e){return new Promise(t=>{t(e.key.buffer)})}_importRawKey(e,t){return new Promise((n,i)=>{t&&e.byteLength!==this._nPk&&i(new Error("Invalid length of the key")),!t&&e.byteLength!==this._nSk&&e.byteLength!==this._nSk+1&&i(new Error("Invalid length of the key")),n(new ie(et,new Uint8Array(e),t?"public":"private",t?[]:he))})}_importJWK(e,t){return new Promise((n,i)=>{e.kty!=="OKP"&&i(new Error(`Invalid kty: ${e.kty}`)),e.crv!=="X448"&&i(new Error(`Invalid crv: ${e.crv}`)),t?(typeof e.d<"u"&&i(new Error("Invalid key: `d` should not be set")),typeof e.x!="string"&&i(new Error("Invalid key: `x` not found")),n(new ie(et,De(e.x),"public"))):(typeof e.d!="string"&&i(new Error("Invalid key: `d` not found")),n(new ie(et,De(e.d),"private",he)))})}_derivePublicKey(e){return new Promise((t,n)=>{try{let i=Sr.getPublicKey(e.key);t(new ie(et,i,"public"))}catch(i){n(i)}})}_dh(e,t){return new Promise((n,i)=>{try{n(Sr.getSharedSecret(e.key,t.key).buffer)}catch(o){i(o)}})}};var Vt=class extends ye{constructor(){let e=new Ne;super($.DhkemX448HkdfSha512,new Xt(e),e),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:$.DhkemX448HkdfSha512}),Object.defineProperty(this,"secretSize",{enumerable:!0,configurable:!0,writable:!0,value:64}),Object.defineProperty(this,"encSize",{enumerable:!0,configurable:!0,writable:!0,value:56}),Object.defineProperty(this,"publicKeySize",{enumerable:!0,configurable:!0,writable:!0,value:56}),Object.defineProperty(this,"privateKeySize",{enumerable:!0,configurable:!0,writable:!0,value:56})}};function Br(){return new Promise((r,e)=>{e(new fe("Not supported"))})}var Ro=new Uint8Array([115,101,99]),tt=class{constructor(e,t,n){Object.defineProperty(this,"_api",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"exporterSecret",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_kdf",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._api=e,this._kdf=t,this.exporterSecret=n}async seal(e,t){return await Br()}async open(e,t){return await Br()}async export(e,t){if(e.byteLength>8192)throw new ee("Too long exporter context");try{return await this._kdf.labeledExpand(this.exporterSecret,Ro,new Uint8Array(e),t)}catch(n){throw new wt(n)}}},Yt=class extends tt{},Wt=class extends tt{constructor(e,t,n,i){super(e,t,n),Object.defineProperty(this,"enc",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.enc=i}};function jo(r,e){if(r.byteLength!==e.byteLength)throw new Error("xor: different length inputs");let t=new Uint8Array(r.byteLength);for(let n=0;nNumber.MAX_SAFE_INTEGER)throw new gt("Message limit reached");e.seq+=1}};var Jt=class extends rt{async open(e,t=Z){let n;try{n=await this._ctx.key.open(this.computeNonce(this._ctx),e,t)}catch(i){throw new mt(i)}return this.incrementSeq(this._ctx),n}};var Qt=class extends rt{constructor(e,t,n,i){super(e,t,n),Object.defineProperty(this,"enc",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.enc=i}async seal(e,t=Z){let n;try{n=await this._ctx.key.seal(this.computeNonce(this._ctx),e,t)}catch(i){throw new xt(i)}return this.incrementSeq(this._ctx),n}};var qo=new Uint8Array([98,97,115,101,95,110,111,110,99,101]),Mo=new Uint8Array([101,120,112]),Go=new Uint8Array([105,110,102,111,95,104,97,115,104]),Fo=new Uint8Array([107,101,121]),$o=new Uint8Array([112,115,107,95,105,100,95,104,97,115,104]),Zo=new Uint8Array([115,101,99,114,101,116]),Xo=new Uint8Array([72,80,75,69,0,0,0,0,0,0]),er=class extends me{constructor(e){if(super(),Object.defineProperty(this,"_kem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_kdf",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_aead",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_suiteId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),typeof e.kem=="number")throw new ee("KemId cannot be used");if(this._kem=e.kem,typeof e.kdf=="number")throw new ee("KdfId cannot be used");if(this._kdf=e.kdf,typeof e.aead=="number")throw new ee("AeadId cannot be used");this._aead=e.aead,this._suiteId=new Uint8Array(Xo),this._suiteId.set(ge(this._kem.id,2),4),this._suiteId.set(ge(this._kdf.id,2),6),this._suiteId.set(ge(this._aead.id,2),8),this._kdf.init(this._suiteId)}get kem(){return this._kem}get kdf(){return this._kdf}get aead(){return this._aead}async createSenderContext(e){this._validateInputLength(e),await this._setup();let t=await this._kem.encap(e),n;return e.psk!==void 0?n=e.senderKey!==void 0?ve.AuthPsk:ve.Psk:n=e.senderKey!==void 0?ve.Auth:ve.Base,await this._keyScheduleS(n,t.sharedSecret,t.enc,e)}async createRecipientContext(e){this._validateInputLength(e),await this._setup();let t=await this._kem.decap(e),n;return e.psk!==void 0?n=e.senderPublicKey!==void 0?ve.AuthPsk:ve.Psk:n=e.senderPublicKey!==void 0?ve.Auth:ve.Base,await this._keyScheduleR(n,t,e)}async seal(e,t,n=Z){let i=await this.createSenderContext(e);return{ct:await i.seal(t,n),enc:i.enc}}async open(e,t,n=Z){return await(await this.createRecipientContext(e)).open(t,n)}async _keySchedule(e,t,n){let i=n.psk===void 0?Z:new Uint8Array(n.psk.id),o=await this._kdf.labeledExtract(Z,$o,i),s=n.info===void 0?Z:new Uint8Array(n.info),a=await this._kdf.labeledExtract(Z,Go,s),c=new Uint8Array(1+o.byteLength+a.byteLength);c.set(new Uint8Array([e]),0),c.set(new Uint8Array(o),1),c.set(new Uint8Array(a),1+o.byteLength);let u=n.psk===void 0?Z:new Uint8Array(n.psk.key),f=this._kdf.buildLabeledIkm(Zo,u),l=this._kdf.buildLabeledInfo(Mo,c,this._kdf.hashSize),d=await this._kdf.extractAndExpand(t,f,l,this._kdf.hashSize);if(this._aead.id===ue.ExportOnly)return{aead:this._aead,exporterSecret:d};let m=this._kdf.buildLabeledInfo(Fo,c,this._aead.keySize),v=await this._kdf.extractAndExpand(t,f,m,this._aead.keySize),_=this._kdf.buildLabeledInfo(qo,c,this._aead.nonceSize),k=await this._kdf.extractAndExpand(t,f,_,this._aead.nonceSize);return{aead:this._aead,exporterSecret:d,key:v,baseNonce:new Uint8Array(k),seq:0}}async _keyScheduleS(e,t,n,i){let o=await this._keySchedule(e,t,i);return o.key===void 0?new Wt(this._api,this._kdf,o.exporterSecret,n):new Qt(this._api,this._kdf,o,n)}async _keyScheduleR(e,t,n){let i=await this._keySchedule(e,t,n);return i.key===void 0?new Yt(this._api,this._kdf,i.exporterSecret):new Jt(this._api,this._kdf,i)}_validateInputLength(e){if(e.info!==void 0&&e.info.byteLength>8192)throw new ee("Too long info");if(e.psk!==void 0){if(e.psk.key.byteLength<32)throw new ee(`PSK must have at least ${32} bytes`);if(e.psk.key.byteLength>8192)throw new ee("Too long psk.key");if(e.psk.id.byteLength>8192)throw new ee("Too long psk.id")}}};var Pr=class extends er{constructor(e){if(typeof e.kem=="number")switch(e.kem){case $.DhkemP256HkdfSha256:e.kem=new Nt;break;case $.DhkemP384HkdfSha384:e.kem=new Dt;break;case $.DhkemP521HkdfSha512:e.kem=new zt;break;case $.DhkemX25519HkdfSha256:e.kem=new $t;break;case $.DhkemX448HkdfSha512:e.kem=new Vt;break;default:throw new ee(`The KEM (${e.kem}) cannot be specified by KemId. Use submodule for the KEM`)}if(typeof e.kdf=="number")switch(e.kdf){case ke.HkdfSha256:e.kdf=new He;break;case ke.HkdfSha384:e.kdf=new Ye;break;default:e.kdf=new Ne;break}if(typeof e.aead=="number")switch(e.aead){case ue.Aes128Gcm:e.aead=new nt;break;case ue.Aes256Gcm:e.aead=new _t;break;case ue.Chacha20Poly1305:e.aead=new At;break;default:e.aead=new Et;break}super(e)}async generateKeyPair(){return await this._setup(),await this._kem.generateKeyPair()}async deriveKeyPair(e){return await this._setup(),await this._kem.deriveKeyPair(e)}async importKey(e,t,n=!0){return await this._setup(),await this._kem.importKey(e,t,n)}};export{qr as Aead,ue as AeadId,rr as BaseError,Pr as CipherSuite,bt as DecapError,Ie as DeriveKeyPairError,te as DeserializeError,yt as EncapError,wt as ExportError,ae as HpkeError,ee as InvalidParamError,jr as Kdf,ke as KdfId,Rr as Kem,$ as KemId,gt as MessageLimitReachedError,fe as NotSupportedError,mt as OpenError,xt as SealError,ce as SerializeError,zr as ValidationError}; +var hi={},Yr=li(globalThis,hi);function li(e,t){return new Proxy(e,{get(r,n,i){return n in t?t[n]:e[n]},set(r,n,i){return n in t&&delete t[n],e[n]=i,!0},deleteProperty(r,n){let i=!1;return n in t&&(delete t[n],i=!0),n in e&&(delete e[n],i=!0),i},ownKeys(r){let n=Reflect.ownKeys(e),i=Reflect.ownKeys(t),o=new Set(i);return[...n.filter(s=>!o.has(s)),...i]},defineProperty(r,n,i){return n in t&&delete t[n],Reflect.defineProperty(e,n,i),!0},getOwnPropertyDescriptor(r,n){return n in t?Reflect.getOwnPropertyDescriptor(t,n):Reflect.getOwnPropertyDescriptor(e,n)},has(r,n){return n in t||n in e}})}var hr=class extends Error{constructor(t){let r;t instanceof Error?r=t.message:typeof t=="string"?r=t:r="",super(r),this.name=this.constructor.name}},ct=class extends hr{},et=class extends ct{},Jr=class extends ct{},at=class extends ct{},rt=class extends ct{},_e=class extends ct{},Ee=class extends ct{},Ae=class extends ct{},ke=class extends ct{},ve=class extends ct{},Se=class extends ct{},Pt=class extends ct{},ft=class extends ct{};async function pi(){if(Yr!==void 0&&globalThis.crypto!==void 0)return globalThis.crypto.subtle;try{let{webcrypto:e}=await import("crypto");return e.subtle}catch(e){throw new ft(e)}}var mt=class{constructor(){Object.defineProperty(this,"_api",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}async _setup(){this._api===void 0&&(this._api=await pi())}};var kt={Base:0,Psk:1,Auth:2,AuthPsk:3},Qr={NotAssigned:0,DhkemP256HkdfSha256:16,DhkemP384HkdfSha384:17,DhkemP521HkdfSha512:18,DhkemSecp256k1HkdfSha256:19,DhkemX25519HkdfSha256:32,DhkemX448HkdfSha512:33,HybridkemX25519Kyber768:48},Z=Qr,tn={HkdfSha256:1,HkdfSha384:2,HkdfSha512:3},vt=tn,en={Aes128Gcm:1,Aes256Gcm:2,Chacha20Poly1305:3,ExportOnly:65535},ut=en;var rn=["encrypt","decrypt"];var lr=class extends mt{constructor(t){super(),Object.defineProperty(this,"_rawKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_key",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._rawKey=t}async seal(t,r,n){await this._setupKey();let i={name:"AES-GCM",iv:t,additionalData:n};return await this._api.encrypt(i,this._key,r)}async open(t,r,n){await this._setupKey();let i={name:"AES-GCM",iv:t,additionalData:n};return await this._api.decrypt(i,this._key,r)}async _setupKey(){if(this._key!==void 0)return;await this._setup();let t=await this._importKey(this._rawKey);new Uint8Array(this._rawKey).fill(0),this._key=t}async _importKey(t){return await this._api.importKey("raw",t,{name:"AES-GCM"},!0,rn)}},ae=class{constructor(){Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:ut.Aes128Gcm}),Object.defineProperty(this,"keySize",{enumerable:!0,configurable:!0,writable:!0,value:16}),Object.defineProperty(this,"nonceSize",{enumerable:!0,configurable:!0,writable:!0,value:12}),Object.defineProperty(this,"tagSize",{enumerable:!0,configurable:!0,writable:!0,value:16})}createEncryptionContext(t){return new lr(t)}},Be=class extends ae{constructor(){super(...arguments),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:ut.Aes256Gcm}),Object.defineProperty(this,"keySize",{enumerable:!0,configurable:!0,writable:!0,value:32}),Object.defineProperty(this,"nonceSize",{enumerable:!0,configurable:!0,writable:!0,value:12}),Object.defineProperty(this,"tagSize",{enumerable:!0,configurable:!0,writable:!0,value:16})}};var Le=class{constructor(){Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:ut.ExportOnly}),Object.defineProperty(this,"keySize",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"nonceSize",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"tagSize",{enumerable:!0,configurable:!0,writable:!0,value:0})}createEncryptionContext(t){throw new ft("Export only")}};var bi=e=>e instanceof Uint8Array;var St=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),nn=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),xi=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!xi)throw new Error("Non little-endian hardware is not supported");function Ie(e){if(typeof e!="string")throw new Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function Pe(e){if(typeof e=="string"&&(e=Ie(e)),!bi(e))throw new Error(`expected Uint8Array, got ${typeof e}`);return e}var yi=e=>Object.prototype.toString.call(e)==="[object Object]"&&e.constructor===Object;function on(e,t){if(t!==void 0&&(typeof t!="object"||!yi(t)))throw new Error("options must be object or undefined");return Object.assign(e,t)}function qt(e,t){if(!(e instanceof Uint8Array))throw new Error("Uint8Array expected");if(typeof t=="number"&&e.length!==t)throw new Error(`Uint8Array length ${t} expected`)}function sn(e,t){if(e.length!==t.length)throw new Error("equalBytes: Different size of Uint8Arrays");let r=!0;for(let n=0;n>i&o),c=Number(r&o),a=n?4:0,u=n?0:4;e.setUint32(t+a,s,n),e.setUint32(t+u,c,n)}function pr(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function wi(e){if(typeof e!="boolean")throw new Error(`Expected boolean, not ${e}`)}function cn(e,...t){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw new Error(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function mi(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("hash must be wrapped by utils.wrapConstructor");pr(e.outputLen),pr(e.blockLen)}function gi(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function _i(e,t){cn(e);let r=t.outputLen;if(e.lengthe[t++]&255|(e[t++]&255)<<8,br=class{constructor(t){this.blockLen=16,this.outputLen=16,this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.pos=0,this.finished=!1,t=Pe(t),qt(t,32);let r=nt(t,0),n=nt(t,2),i=nt(t,4),o=nt(t,6),s=nt(t,8),c=nt(t,10),a=nt(t,12),u=nt(t,14);this.r[0]=r&8191,this.r[1]=(r>>>13|n<<3)&8191,this.r[2]=(n>>>10|i<<6)&7939,this.r[3]=(i>>>7|o<<9)&8191,this.r[4]=(o>>>4|s<<12)&255,this.r[5]=s>>>1&8190,this.r[6]=(s>>>14|c<<2)&8191,this.r[7]=(c>>>11|a<<5)&8065,this.r[8]=(a>>>8|u<<8)&8191,this.r[9]=u>>>5&127;for(let f=0;f<8;f++)this.pad[f]=nt(t,16+2*f)}process(t,r,n=!1){let i=n?0:2048,{h:o,r:s}=this,c=s[0],a=s[1],u=s[2],f=s[3],l=s[4],d=s[5],w=s[6],_=s[7],m=s[8],E=s[9],z=nt(t,r+0),F=nt(t,r+2),p=nt(t,r+4),S=nt(t,r+6),A=nt(t,r+8),O=nt(t,r+10),D=nt(t,r+12),B=nt(t,r+14),x=o[0]+(z&8191),I=o[1]+((z>>>13|F<<3)&8191),P=o[2]+((F>>>10|p<<6)&8191),L=o[3]+((p>>>7|S<<9)&8191),v=o[4]+((S>>>4|A<<12)&8191),M=o[5]+(A>>>1&8191),T=o[6]+((A>>>14|O<<2)&8191),$=o[7]+((O>>>11|D<<5)&8191),V=o[8]+((D>>>8|B<<8)&8191),b=o[9]+(B>>>5|i),h=0,y=h+x*c+I*(5*E)+P*(5*m)+L*(5*_)+v*(5*w);h=y>>>13,y&=8191,y+=M*(5*d)+T*(5*l)+$*(5*f)+V*(5*u)+b*(5*a),h+=y>>>13,y&=8191;let g=h+x*a+I*c+P*(5*E)+L*(5*m)+v*(5*_);h=g>>>13,g&=8191,g+=M*(5*w)+T*(5*d)+$*(5*l)+V*(5*f)+b*(5*u),h+=g>>>13,g&=8191;let k=h+x*u+I*a+P*c+L*(5*E)+v*(5*m);h=k>>>13,k&=8191,k+=M*(5*_)+T*(5*w)+$*(5*d)+V*(5*l)+b*(5*f),h+=k>>>13,k&=8191;let K=h+x*f+I*u+P*a+L*c+v*(5*E);h=K>>>13,K&=8191,K+=M*(5*m)+T*(5*_)+$*(5*w)+V*(5*d)+b*(5*l),h+=K>>>13,K&=8191;let N=h+x*l+I*f+P*u+L*a+v*c;h=N>>>13,N&=8191,N+=M*(5*E)+T*(5*m)+$*(5*_)+V*(5*w)+b*(5*d),h+=N>>>13,N&=8191;let q=h+x*d+I*l+P*f+L*u+v*a;h=q>>>13,q&=8191,q+=M*c+T*(5*E)+$*(5*m)+V*(5*_)+b*(5*w),h+=q>>>13,q&=8191;let C=h+x*w+I*d+P*l+L*f+v*u;h=C>>>13,C&=8191,C+=M*a+T*c+$*(5*E)+V*(5*m)+b*(5*_),h+=C>>>13,C&=8191;let R=h+x*_+I*w+P*d+L*l+v*f;h=R>>>13,R&=8191,R+=M*u+T*a+$*c+V*(5*E)+b*(5*m),h+=R>>>13,R&=8191;let Y=h+x*m+I*_+P*w+L*d+v*l;h=Y>>>13,Y&=8191,Y+=M*f+T*u+$*a+V*c+b*(5*E),h+=Y>>>13,Y&=8191;let Q=h+x*E+I*m+P*_+L*w+v*d;h=Q>>>13,Q&=8191,Q+=M*l+T*f+$*u+V*a+b*c,h+=Q>>>13,Q&=8191,h=(h<<2)+h|0,h=h+y|0,y=h&8191,h=h>>>13,g+=h,o[0]=y,o[1]=g,o[2]=k,o[3]=K,o[4]=N,o[5]=q,o[6]=C,o[7]=R,o[8]=Y,o[9]=Q}finalize(){let{h:t,pad:r}=this,n=new Uint16Array(10),i=t[1]>>>13;t[1]&=8191;for(let c=2;c<10;c++)t[c]+=i,i=t[c]>>>13,t[c]&=8191;t[0]+=i*5,i=t[0]>>>13,t[0]&=8191,t[1]+=i,i=t[1]>>>13,t[1]&=8191,t[2]+=i,n[0]=t[0]+5,i=n[0]>>>13,n[0]&=8191;for(let c=1;c<10;c++)n[c]=t[c]+i,i=n[c]>>>13,n[c]&=8191;n[9]-=8192;let o=(i^1)-1;for(let c=0;c<10;c++)n[c]&=o;o=~o;for(let c=0;c<10;c++)t[c]=t[c]&o|n[c];t[0]=(t[0]|t[1]<<13)&65535,t[1]=(t[1]>>>3|t[2]<<10)&65535,t[2]=(t[2]>>>6|t[3]<<7)&65535,t[3]=(t[3]>>>9|t[4]<<4)&65535,t[4]=(t[4]>>>12|t[5]<<1|t[6]<<14)&65535,t[5]=(t[6]>>>2|t[7]<<11)&65535,t[6]=(t[7]>>>5|t[8]<<8)&65535,t[7]=(t[8]>>>8|t[9]<<5)&65535;let s=t[0]+r[0];t[0]=s&65535;for(let c=1;c<8;c++)s=(t[c]+r[c]|0)+(s>>>16)|0,t[c]=s&65535}update(t){ot.exists(this);let{buffer:r,blockLen:n}=this;t=Pe(t);let i=t.length;for(let o=0;o>>0,t[o++]=n[s]>>>8;return t}digest(){let{buffer:t,outputLen:r}=this;this.digestInto(t);let n=t.slice(0,r);return this.destroy(),n}};function Ai(e){let t=(n,i)=>e(i).update(Pe(n)).digest(),r=e(new Uint8Array(32));return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=n=>e(n),t}var an=Ai(e=>new br(e));var ki=Ie("expand 16-byte k"),vi=Ie("expand 32-byte k"),Si=St(ki),Bi=St(vi),fn=e=>!(e.byteOffset%4),un=e=>{let{core:t,rounds:r,counterRight:n,counterLen:i,allow128bitKeys:o,extendNonceFn:s,blockLen:c}=on({rounds:20,counterRight:!1,counterLen:8,allow128bitKeys:!0,blockLen:64},e);ot.number(i),ot.number(r),ot.number(c),ot.bool(n),ot.bool(o);let a=c/4;if(c%4!==0)throw new Error("Salsa/ChaCha: blockLen must be aligned to 4 bytes");return(u,f,l,d,w=0)=>{if(ot.bytes(u),ot.bytes(f),ot.bytes(l),d||(d=new Uint8Array(l.length)),ot.bytes(d),ot.number(w),w<0||w>=2**32-1)throw new Error("Salsa/ChaCha: counter overflow");if(d.length=2**32-1)throw new Error("Salsa/ChaCha: counter overflow");let P=Math.min(c,B-x);if(P===c&&D&&O){let L=x/4;if(x%4!==0)throw new Error("Salsa/ChaCha: invalid block position");for(let v=0;ve<>>32-t;function Li(e,t,r,n,i,o=20){let s=e[0],c=e[1],a=e[2],u=e[3],f=t[0],l=t[1],d=t[2],w=t[3],_=t[4],m=t[5],E=t[6],z=t[7],F=i,p=r[0],S=r[1],A=r[2],O=s,D=c,B=a,x=u,I=f,P=l,L=d,v=w,M=_,T=m,$=E,V=z,b=F,h=p,y=S,g=A;for(let K=0;K{e.update(t);let r=t.length%16;r&&e.update(Pi.subarray(r))},ln=(e,t,r,n,i)=>{let o=e(t,r,new Uint8Array(32)),s=an.create(o);i&&hn(s,i),hn(s,n);let c=new Uint8Array(16),a=nn(c);dr(a,0,BigInt(i?i.length:0),!0),dr(a,8,BigInt(n.length),!0),s.update(c);let u=s.digest();return o.fill(0),u},Ui=e=>(t,r,n)=>(qt(t,32),qt(r),{tagLength:16,encrypt:(o,s)=>{let c=o.length,a=c+16;s?qt(s,a):s=new Uint8Array(a),e(t,r,o,s,1);let u=ln(e,t,r,s.subarray(0,-16),n);return s.set(u,c),s},decrypt:(o,s)=>{let c=o.length,a=c-16;if(c<16)throw new Error("encrypted data must be at least 16 bytes");s?qt(s,a):s=new Uint8Array(a);let u=o.subarray(0,-16),f=o.subarray(-16),l=ln(e,t,r,u,n);if(!sn(f,l))throw new Error("invalid tag");return e(t,r,u,s,1),s}}),xr=Ui(Ii);var yr=class{constructor(t){Object.defineProperty(this,"_key",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._key=new Uint8Array(t)}async seal(t,r,n){return await this._seal(t,r,n)}async open(t,r,n){return await this._open(t,r,n)}_seal(t,r,n){return new Promise(i=>{let o=xr(this._key,new Uint8Array(t),new Uint8Array(n)).encrypt(new Uint8Array(r));i(o.buffer)})}_open(t,r,n){return new Promise(i=>{let o=xr(this._key,new Uint8Array(t),new Uint8Array(n)).decrypt(new Uint8Array(r));i(o.buffer)})}},Ue=class{constructor(){Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:ut.Chacha20Poly1305}),Object.defineProperty(this,"keySize",{enumerable:!0,configurable:!0,writable:!0,value:32}),Object.defineProperty(this,"nonceSize",{enumerable:!0,configurable:!0,writable:!0,value:12}),Object.defineProperty(this,"tagSize",{enumerable:!0,configurable:!0,writable:!0,value:16})}createEncryptionContext(t){return new yr(t)}};function dn(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function wr(e,...t){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw new Error(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function pn(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");dn(e.outputLen),dn(e.blockLen)}function Zt(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function bn(e,t){wr(e);let r=t.outputLen;if(e.lengthe instanceof Uint8Array;var Ke=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),bt=(e,t)=>e<<32-t|e>>>t,Hi=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!Hi)throw new Error("Non little-endian hardware is not supported");function Oi(e){if(typeof e!="string")throw new Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function fe(e){if(typeof e=="string"&&(e=Oi(e)),!Ki(e))throw new Error(`expected Uint8Array, got ${typeof e}`);return e}var Xt=class{clone(){return this._cloneInto()}},bc={}.toString;function ue(e){let t=n=>e().update(fe(n)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}var He=class extends Xt{constructor(t,r){super(),this.finished=!1,this.destroyed=!1,pn(t);let n=fe(r);if(this.iHash=t.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let i=this.blockLen,o=new Uint8Array(i);o.set(n.length>i?t.create().update(n).digest():n);for(let s=0;snew He(e,t).update(r).digest();Gt.create=(e,t)=>new He(e,t);function Ci(e,t,r,n){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,r,n);let i=BigInt(32),o=BigInt(4294967295),s=Number(r>>i&o),c=Number(r&o),a=n?4:0,u=n?0:4;e.setUint32(t+a,s,n),e.setUint32(t+u,c,n)}var Wt=class extends Xt{constructor(t,r,n,i){super(),this.blockLen=t,this.outputLen=r,this.padOffset=n,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=Ke(this.buffer)}update(t){Zt(this);let{view:r,buffer:n,blockLen:i}=this;t=fe(t);let o=t.length;for(let s=0;si-s&&(this.process(n,0),s=0);for(let l=s;lf.length)throw new Error("_sha2: outputLen bigger than state");for(let l=0;le&t^~e&r,Ni=(e,t,r)=>e&t^e&r^t&r,Di=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Ut=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Kt=new Uint32Array(64),mr=class extends Wt{constructor(){super(64,32,8,!1),this.A=Ut[0]|0,this.B=Ut[1]|0,this.C=Ut[2]|0,this.D=Ut[3]|0,this.E=Ut[4]|0,this.F=Ut[5]|0,this.G=Ut[6]|0,this.H=Ut[7]|0}get(){let{A:t,B:r,C:n,D:i,E:o,F:s,G:c,H:a}=this;return[t,r,n,i,o,s,c,a]}set(t,r,n,i,o,s,c,a){this.A=t|0,this.B=r|0,this.C=n|0,this.D=i|0,this.E=o|0,this.F=s|0,this.G=c|0,this.H=a|0}process(t,r){for(let l=0;l<16;l++,r+=4)Kt[l]=t.getUint32(r,!1);for(let l=16;l<64;l++){let d=Kt[l-15],w=Kt[l-2],_=bt(d,7)^bt(d,18)^d>>>3,m=bt(w,17)^bt(w,19)^w>>>10;Kt[l]=m+Kt[l-7]+_+Kt[l-16]|0}let{A:n,B:i,C:o,D:s,E:c,F:a,G:u,H:f}=this;for(let l=0;l<64;l++){let d=bt(c,6)^bt(c,11)^bt(c,25),w=f+d+Ti(c,a,u)+Di[l]+Kt[l]|0,m=(bt(n,2)^bt(n,13)^bt(n,22))+Ni(n,i,o)|0;f=u,u=a,a=c,c=s+w|0,s=o,o=i,i=n,n=w+m|0}n=n+this.A|0,i=i+this.B|0,o=o+this.C|0,s=s+this.D|0,c=c+this.E|0,a=a+this.F|0,u=u+this.G|0,f=f+this.H|0,this.set(n,i,o,s,c,a,u,f)}roundClean(){Kt.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}};var xn=ue(()=>new mr);var X=new Uint8Array(0);var yn=new Uint8Array([72,80,75,69,45,118,49]),he=class extends mt{constructor(){super(),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:vt.HkdfSha256}),Object.defineProperty(this,"hashSize",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_suiteId",{enumerable:!0,configurable:!0,writable:!0,value:X}),Object.defineProperty(this,"algHash",{enumerable:!0,configurable:!0,writable:!0,value:{name:"HMAC",hash:"SHA-256",length:256}})}init(t){this._suiteId=t}buildLabeledIkm(t,r){this._checkInit();let n=new Uint8Array(7+this._suiteId.byteLength+t.byteLength+r.byteLength);return n.set(yn,0),n.set(this._suiteId,7),n.set(t,7+this._suiteId.byteLength),n.set(r,7+this._suiteId.byteLength+t.byteLength),n}buildLabeledInfo(t,r,n){this._checkInit();let i=new Uint8Array(9+this._suiteId.byteLength+t.byteLength+r.byteLength);return i.set(new Uint8Array([0,n]),0),i.set(yn,2),i.set(this._suiteId,9),i.set(t,9+this._suiteId.byteLength),i.set(r,9+this._suiteId.byteLength+t.byteLength),i}async extract(t,r){if(await this._setup(),t.byteLength===0&&(t=new ArrayBuffer(this.hashSize)),t.byteLength!==this.hashSize)throw new et("The salt length must be the same as the hashSize");let n=await this._api.importKey("raw",t,this.algHash,!1,["sign"]);return await this._api.sign("HMAC",n,r)}async expand(t,r,n){await this._setup();let i=await this._api.importKey("raw",t,this.algHash,!1,["sign"]),o=new ArrayBuffer(n),s=new Uint8Array(o),c=X,a=new Uint8Array(r),u=new Uint8Array(1);if(n>255*this.hashSize)throw new Error("Entropy limit reached");let f=new Uint8Array(this.hashSize+a.length+1);for(let l=1,d=0;d=c.length?(s.set(c,d),d+=c.length):(s.set(c.slice(0,s.length-d),d),d+=s.length-d);return o}async extractAndExpand(t,r,n,i){await this._setup();let o=await this._api.importKey("raw",r,"HKDF",!1,["deriveBits"]);return await this._api.deriveBits({name:"HKDF",hash:this.algHash.hash,salt:t,info:n},o,i*8)}async labeledExtract(t,r,n){return await this.extract(t,this.buildLabeledIkm(r,n))}async labeledExpand(t,r,n,i){return await this.expand(t,this.buildLabeledInfo(r,n,i),i)}_checkInit(){if(this._suiteId===X)throw new Error("Not initialized. Call init()")}},Oe=class extends he{constructor(){super(...arguments),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:vt.HkdfSha256}),Object.defineProperty(this,"hashSize",{enumerable:!0,configurable:!0,writable:!0,value:32}),Object.defineProperty(this,"algHash",{enumerable:!0,configurable:!0,writable:!0,value:{name:"HMAC",hash:"SHA-256",length:256}})}},Ce=class extends he{constructor(){super(...arguments),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:vt.HkdfSha384}),Object.defineProperty(this,"hashSize",{enumerable:!0,configurable:!0,writable:!0,value:48}),Object.defineProperty(this,"algHash",{enumerable:!0,configurable:!0,writable:!0,value:{name:"HMAC",hash:"SHA-384",length:384}})}},Te=class extends he{constructor(){super(...arguments),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:vt.HkdfSha512}),Object.defineProperty(this,"hashSize",{enumerable:!0,configurable:!0,writable:!0,value:64}),Object.defineProperty(this,"algHash",{enumerable:!0,configurable:!0,writable:!0,value:{name:"HMAC",hash:"SHA-512",length:512}})}};var Ht=class extends Oe{async extract(t,r){if(await this._setup(),t.byteLength===0&&(t=new ArrayBuffer(this.hashSize)),t.byteLength!==this.hashSize)return Gt(xn,new Uint8Array(t),new Uint8Array(r));let n=await this._api.importKey("raw",t,this.algHash,!1,["sign"]);return await this._api.sign("HMAC",n,r)}};var Ne=BigInt(4294967295),gr=BigInt(32);function wn(e,t=!1){return t?{h:Number(e&Ne),l:Number(e>>gr&Ne)}:{h:Number(e>>gr&Ne)|0,l:Number(e&Ne)|0}}function zi(e,t=!1){let r=new Uint32Array(e.length),n=new Uint32Array(e.length);for(let i=0;iBigInt(e>>>0)<>>0),ji=(e,t,r)=>e>>>r,Mi=(e,t,r)=>e<<32-r|t>>>r,qi=(e,t,r)=>e>>>r|t<<32-r,Gi=(e,t,r)=>e<<32-r|t>>>r,Fi=(e,t,r)=>e<<64-r|t>>>r-32,$i=(e,t,r)=>e>>>r-32|t<<64-r,Vi=(e,t)=>t,Zi=(e,t)=>e,Xi=(e,t,r)=>e<>>32-r,Wi=(e,t,r)=>t<>>32-r,Yi=(e,t,r)=>t<>>64-r,Ji=(e,t,r)=>e<>>64-r;function Qi(e,t,r,n){let i=(t>>>0)+(n>>>0);return{h:e+r+(i/2**32|0)|0,l:i|0}}var to=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0),eo=(e,t,r,n)=>t+r+n+(e/2**32|0)|0,ro=(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0),no=(e,t,r,n,i)=>t+r+n+i+(e/2**32|0)|0,io=(e,t,r,n,i)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(i>>>0),oo=(e,t,r,n,i,o)=>t+r+n+i+o+(e/2**32|0)|0;var so={fromBig:wn,split:zi,toBig:Ri,shrSH:ji,shrSL:Mi,rotrSH:qi,rotrSL:Gi,rotrBH:Fi,rotrBL:$i,rotr32H:Vi,rotr32L:Zi,rotlSH:Xi,rotlSL:Wi,rotlBH:Yi,rotlBL:Ji,add:Qi,add3L:to,add3H:eo,add4L:ro,add4H:no,add5H:oo,add5L:io},H=so;var[co,ao]=(()=>H.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e))))(),Ot=new Uint32Array(80),Ct=new Uint32Array(80),De=class extends Wt{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){let{Ah:t,Al:r,Bh:n,Bl:i,Ch:o,Cl:s,Dh:c,Dl:a,Eh:u,El:f,Fh:l,Fl:d,Gh:w,Gl:_,Hh:m,Hl:E}=this;return[t,r,n,i,o,s,c,a,u,f,l,d,w,_,m,E]}set(t,r,n,i,o,s,c,a,u,f,l,d,w,_,m,E){this.Ah=t|0,this.Al=r|0,this.Bh=n|0,this.Bl=i|0,this.Ch=o|0,this.Cl=s|0,this.Dh=c|0,this.Dl=a|0,this.Eh=u|0,this.El=f|0,this.Fh=l|0,this.Fl=d|0,this.Gh=w|0,this.Gl=_|0,this.Hh=m|0,this.Hl=E|0}process(t,r){for(let p=0;p<16;p++,r+=4)Ot[p]=t.getUint32(r),Ct[p]=t.getUint32(r+=4);for(let p=16;p<80;p++){let S=Ot[p-15]|0,A=Ct[p-15]|0,O=H.rotrSH(S,A,1)^H.rotrSH(S,A,8)^H.shrSH(S,A,7),D=H.rotrSL(S,A,1)^H.rotrSL(S,A,8)^H.shrSL(S,A,7),B=Ot[p-2]|0,x=Ct[p-2]|0,I=H.rotrSH(B,x,19)^H.rotrBH(B,x,61)^H.shrSH(B,x,6),P=H.rotrSL(B,x,19)^H.rotrBL(B,x,61)^H.shrSL(B,x,6),L=H.add4L(D,P,Ct[p-7],Ct[p-16]),v=H.add4H(L,O,I,Ot[p-7],Ot[p-16]);Ot[p]=v|0,Ct[p]=L|0}let{Ah:n,Al:i,Bh:o,Bl:s,Ch:c,Cl:a,Dh:u,Dl:f,Eh:l,El:d,Fh:w,Fl:_,Gh:m,Gl:E,Hh:z,Hl:F}=this;for(let p=0;p<80;p++){let S=H.rotrSH(l,d,14)^H.rotrSH(l,d,18)^H.rotrBH(l,d,41),A=H.rotrSL(l,d,14)^H.rotrSL(l,d,18)^H.rotrBL(l,d,41),O=l&w^~l&m,D=d&_^~d&E,B=H.add5L(F,A,D,ao[p],Ct[p]),x=H.add5H(B,z,S,O,co[p],Ot[p]),I=B|0,P=H.rotrSH(n,i,28)^H.rotrBH(n,i,34)^H.rotrBH(n,i,39),L=H.rotrSL(n,i,28)^H.rotrBL(n,i,34)^H.rotrBL(n,i,39),v=n&o^n&c^o&c,M=i&s^i&a^s&a;z=m|0,F=E|0,m=w|0,E=_|0,w=l|0,_=d|0,{h:l,l:d}=H.add(u|0,f|0,x|0,I|0),u=c|0,f=a|0,c=o|0,a=s|0,o=n|0,s=i|0;let T=H.add3L(I,L,M);n=H.add3H(T,x,P,v),i=T|0}({h:n,l:i}=H.add(this.Ah|0,this.Al|0,n|0,i|0)),{h:o,l:s}=H.add(this.Bh|0,this.Bl|0,o|0,s|0),{h:c,l:a}=H.add(this.Ch|0,this.Cl|0,c|0,a|0),{h:u,l:f}=H.add(this.Dh|0,this.Dl|0,u|0,f|0),{h:l,l:d}=H.add(this.Eh|0,this.El|0,l|0,d|0),{h:w,l:_}=H.add(this.Fh|0,this.Fl|0,w|0,_|0),{h:m,l:E}=H.add(this.Gh|0,this.Gl|0,m|0,E|0),{h:z,l:F}=H.add(this.Hh|0,this.Hl|0,z|0,F|0),this.set(n,i,o,s,c,a,u,f,l,d,w,_,m,E,z,F)}roundClean(){Ot.fill(0),Ct.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}};var _r=class extends De{constructor(){super(),this.Ah=-876896931,this.Al=-1056596264,this.Bh=1654270250,this.Bl=914150663,this.Ch=-1856437926,this.Cl=812702999,this.Dh=355462360,this.Dl=-150054599,this.Eh=1731405415,this.El=-4191439,this.Fh=-1900787065,this.Fl=1750603025,this.Gh=-619958771,this.Gl=1694076839,this.Hh=1203062813,this.Hl=-1090891868,this.outputLen=48}},mn=ue(()=>new De);var gn=ue(()=>new _r);var Yt=class extends Ce{async extract(t,r){if(await this._setup(),t.byteLength===0&&(t=new ArrayBuffer(this.hashSize)),t.byteLength!==this.hashSize)return Gt(gn,new Uint8Array(t),new Uint8Array(r));let n=await this._api.importKey("raw",t,this.algHash,!1,["sign"]);return await this._api.sign("HMAC",n,r)}};var Tt=class extends Te{async extract(t,r){if(await this._setup(),t.byteLength===0&&(t=new ArrayBuffer(this.hashSize)),t.byteLength!==this.hashSize)return Gt(mn,new Uint8Array(t),new Uint8Array(r));let n=await this._api.importKey("raw",t,this.algHash,!1,["sign"]);return await this._api.sign("HMAC",n,r)}};var _n=new Uint8Array([75,69,77,0,0]);var Jt=e=>typeof e=="object"&&e!==null&&typeof e.privateKey=="object"&&typeof e.publicKey=="object";function gt(e,t){if(t<=0)throw new Error("i2Osp: too small size");if(e>=256**t)throw new Error("i2Osp: too large integer");let r=new Uint8Array(t);for(let n=0;n>8;return r}function le(e,t){let r=new Uint8Array(e.length+t.length);return r.set(e,0),r.set(t,e.length),r}function Nt(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r=atob(t),n=new Uint8Array(r.length);for(let i=0;i8192)throw new et("Too long ikm");return await this._prim.deriveKeyPair(t)}async encap(t){let r;t.ekm===void 0?r=await this.generateKeyPair():Jt(t.ekm)?r=t.ekm:r=await this.deriveKeyPair(t.ekm);let n=await this._prim.serializePublicKey(r.publicKey),i=await this._prim.serializePublicKey(t.recipientPublicKey);try{let o;if(t.senderKey===void 0)o=new Uint8Array(await this._prim.dh(r.privateKey,t.recipientPublicKey));else{let a=Jt(t.senderKey)?t.senderKey.privateKey:t.senderKey,u=new Uint8Array(await this._prim.dh(r.privateKey,t.recipientPublicKey)),f=new Uint8Array(await this._prim.dh(a,t.recipientPublicKey));o=le(u,f)}let s;if(t.senderKey===void 0)s=le(new Uint8Array(n),new Uint8Array(i));else{let a=Jt(t.senderKey)?t.senderKey.publicKey:await this._prim.derivePublicKey(t.senderKey),u=await this._prim.serializePublicKey(a);s=ho(new Uint8Array(n),new Uint8Array(i),new Uint8Array(u))}let c=await this._generateSharedSecret(o,s);return{enc:n,sharedSecret:c}}catch(o){throw new _e(o)}}async decap(t){let r=await this._prim.deserializePublicKey(t.enc),n=Jt(t.recipientKey)?t.recipientKey.privateKey:t.recipientKey,i=Jt(t.recipientKey)?t.recipientKey.publicKey:await this._prim.derivePublicKey(t.recipientKey),o=await this._prim.serializePublicKey(i);try{let s;if(t.senderPublicKey===void 0)s=new Uint8Array(await this._prim.dh(n,r));else{let a=new Uint8Array(await this._prim.dh(n,r)),u=new Uint8Array(await this._prim.dh(n,t.senderPublicKey));s=le(a,u)}let c;if(t.senderPublicKey===void 0)c=le(new Uint8Array(t.enc),new Uint8Array(o));else{let a=await this._prim.serializePublicKey(t.senderPublicKey);c=new Uint8Array(t.enc.byteLength+o.byteLength+a.byteLength),c.set(new Uint8Array(t.enc),0),c.set(new Uint8Array(o),t.enc.byteLength),c.set(new Uint8Array(a),t.enc.byteLength+o.byteLength)}return await this._generateSharedSecret(s,c)}catch(s){throw new Ee(s)}}async _generateSharedSecret(t,r){let n=this._kdf.buildLabeledIkm(fo,t),i=this._kdf.buildLabeledInfo(uo,r,this.secretSize);return await this._kdf.extractAndExpand(X,n,i,this.secretSize)}};var ht=["deriveBits"],Qt=new Uint8Array([100,107,112,95,112,114,107]),ze=new Uint8Array([115,107]);var Re=class{constructor(t){Object.defineProperty(this,"_num",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._num=new Uint8Array(t)}val(){return this._num}reset(){this._num.fill(0)}set(t){if(t.length!==this._num.length)throw new Error("Bignum.set: invalid argument");this._num.set(t)}isZero(){for(let t=0;tt[r])return!1}return!1}};var lo=new Uint8Array([99,97,110,100,105,100,97,116,101]),po=new Uint8Array([255,255,255,255,0,0,0,0,255,255,255,255,255,255,255,255,188,230,250,173,167,23,158,132,243,185,202,194,252,99,37,81]),bo=new Uint8Array([255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,199,99,77,129,244,55,45,223,88,26,13,178,72,176,167,122,236,236,25,106,204,197,41,115]),xo=new Uint8Array([1,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,250,81,134,135,131,191,47,150,107,127,204,1,72,247,9,165,208,59,181,201,184,137,156,71,174,187,111,183,30,145,56,100,9]),yo=new Uint8Array([48,65,2,1,0,48,19,6,7,42,134,72,206,61,2,1,6,8,42,134,72,206,61,3,1,7,4,39,48,37,2,1,1,4,32]),wo=new Uint8Array([48,78,2,1,0,48,16,6,7,42,134,72,206,61,2,1,6,5,43,129,4,0,34,4,55,48,53,2,1,1,4,48]),mo=new Uint8Array([48,96,2,1,0,48,16,6,7,42,134,72,206,61,2,1,6,5,43,129,4,0,35,4,73,48,71,2,1,1,4,66]),Dt=class extends mt{constructor(t,r){switch(super(),Object.defineProperty(this,"_hkdf",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_alg",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_nPk",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_nSk",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_nDh",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_order",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_bitmask",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_pkcs8AlgId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._hkdf=r,t){case Z.DhkemP256HkdfSha256:this._alg={name:"ECDH",namedCurve:"P-256"},this._nPk=65,this._nSk=32,this._nDh=32,this._order=po,this._bitmask=255,this._pkcs8AlgId=yo;break;case Z.DhkemP384HkdfSha384:this._alg={name:"ECDH",namedCurve:"P-384"},this._nPk=97,this._nSk=48,this._nDh=48,this._order=bo,this._bitmask=255,this._pkcs8AlgId=wo;break;default:this._alg={name:"ECDH",namedCurve:"P-521"},this._nPk=133,this._nSk=66,this._nDh=66,this._order=xo,this._bitmask=1,this._pkcs8AlgId=mo;break}}async serializePublicKey(t){await this._setup();try{return await this._api.exportKey("raw",t)}catch(r){throw new at(r)}}async deserializePublicKey(t){await this._setup();try{return await this._importRawKey(t,!0)}catch(r){throw new rt(r)}}async serializePrivateKey(t){await this._setup();try{let r=await this._api.exportKey("jwk",t);if(!("d"in r))throw new Error("Not private key");return Nt(r.d)}catch(r){throw new at(r)}}async deserializePrivateKey(t){await this._setup();try{return await this._importRawKey(t,!1)}catch(r){throw new rt(r)}}async importKey(t,r,n){await this._setup();try{if(t==="raw")return await this._importRawKey(r,n);if(r instanceof ArrayBuffer)throw new Error("Invalid jwk key format");return await this._importJWK(r,n)}catch(i){throw new rt(i)}}async generateKeyPair(){await this._setup();try{return await this._api.generateKey(this._alg,!0,ht)}catch(t){throw new ft(t)}}async deriveKeyPair(t){await this._setup();try{let r=await this._hkdf.labeledExtract(X,Qt,new Uint8Array(t)),n=new Re(this._nSk);for(let o=0;n.isZero()||!n.lessThan(this._order);o++){if(o>255)throw new Error("Faild to derive a key pair");let s=new Uint8Array(await this._hkdf.labeledExpand(r,lo,gt(o,1),this._nSk));s[0]=s[0]&this._bitmask,n.set(s)}let i=await this._deserializePkcs8Key(n.val());return n.reset(),{privateKey:i,publicKey:await this.derivePublicKey(i)}}catch(r){throw new Pt(r)}}async derivePublicKey(t){await this._setup();try{let r=await this._api.exportKey("jwk",t);return delete r.d,delete r.key_ops,await this._api.importKey("jwk",r,this._alg,!0,[])}catch(r){throw new rt(r)}}async dh(t,r){try{return await this._setup(),await this._api.deriveBits({name:"ECDH",public:r},t,this._nDh*8)}catch(n){throw new at(n)}}async _importRawKey(t,r){if(r&&t.byteLength!==this._nPk)throw new Error("Invalid public key for the ciphersuite");if(!r&&t.byteLength!==this._nSk)throw new Error("Invalid private key for the ciphersuite");return r?await this._api.importKey("raw",t,this._alg,!0,[]):await this._deserializePkcs8Key(new Uint8Array(t))}async _importJWK(t,r){if(typeof t.crv>"u"||t.crv!==this._alg.namedCurve)throw new Error(`Invalid crv: ${t.crv}`);if(r){if(typeof t.d<"u")throw new Error("Invalid key: `d` should not be set");return await this._api.importKey("jwk",t,this._alg,!0,[])}if(typeof t.d>"u")throw new Error("Invalid key: `d` not found");return await this._api.importKey("jwk",t,this._alg,!0,ht)}async _deserializePkcs8Key(t){let r=new Uint8Array(this._pkcs8AlgId.length+t.length);return r.set(this._pkcs8AlgId,0),r.set(t,this._pkcs8AlgId.length),await this._api.importKey("pkcs8",r,this._alg,!0,ht)}};var je=class extends pt{constructor(){let t=new Ht,r=new Dt(Z.DhkemP256HkdfSha256,t);super(Z.DhkemP256HkdfSha256,r,t),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:Z.DhkemP256HkdfSha256}),Object.defineProperty(this,"secretSize",{enumerable:!0,configurable:!0,writable:!0,value:32}),Object.defineProperty(this,"encSize",{enumerable:!0,configurable:!0,writable:!0,value:65}),Object.defineProperty(this,"publicKeySize",{enumerable:!0,configurable:!0,writable:!0,value:65}),Object.defineProperty(this,"privateKeySize",{enumerable:!0,configurable:!0,writable:!0,value:32})}};var Me=class extends pt{constructor(){let t=new Yt,r=new Dt(Z.DhkemP384HkdfSha384,t);super(Z.DhkemP384HkdfSha384,r,t),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:Z.DhkemP384HkdfSha384}),Object.defineProperty(this,"secretSize",{enumerable:!0,configurable:!0,writable:!0,value:48}),Object.defineProperty(this,"encSize",{enumerable:!0,configurable:!0,writable:!0,value:97}),Object.defineProperty(this,"publicKeySize",{enumerable:!0,configurable:!0,writable:!0,value:97}),Object.defineProperty(this,"privateKeySize",{enumerable:!0,configurable:!0,writable:!0,value:48})}};var qe=class extends pt{constructor(){let t=new Tt,r=new Dt(Z.DhkemP521HkdfSha512,t);super(Z.DhkemP521HkdfSha512,r,t),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:Z.DhkemP521HkdfSha512}),Object.defineProperty(this,"secretSize",{enumerable:!0,configurable:!0,writable:!0,value:64}),Object.defineProperty(this,"encSize",{enumerable:!0,configurable:!0,writable:!0,value:133}),Object.defineProperty(this,"publicKeySize",{enumerable:!0,configurable:!0,writable:!0,value:133}),Object.defineProperty(this,"privateKeySize",{enumerable:!0,configurable:!0,writable:!0,value:64})}};function Er(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function go(e){if(typeof e!="boolean")throw new Error(`Expected boolean, not ${e}`)}function En(e,...t){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw new Error(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function _o(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Er(e.outputLen),Er(e.blockLen)}function Eo(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function Ao(e,t){En(e);let r=t.outputLen;if(e.lengthe instanceof Uint8Array;var kn=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),Fe=e=>new DataView(e.buffer,e.byteOffset,e.byteLength);var vo=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!vo)throw new Error("Non little-endian hardware is not supported");var Pa=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function de(e){if(typeof e!="string")throw new Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function ee(e){if(typeof e=="string"&&(e=de(e)),!An(e))throw new Error(`expected Uint8Array, got ${typeof e}`);return e}function $e(...e){let t=new Uint8Array(e.reduce((n,i)=>n+i.length,0)),r=0;return e.forEach(n=>{if(!An(n))throw new Error("Uint8Array expected");t.set(n,r),r+=n.length}),t}var te=class{clone(){return this._cloneInto()}};function _t(e){let t=n=>e().update(ee(n)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function vn(e){let t=(n,i)=>e(i).update(ee(n)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=n=>e(n),t}function re(e=32){if(Ge&&typeof Ge.getRandomValues=="function")return Ge.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}function So(e,t,r,n){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,r,n);let i=BigInt(32),o=BigInt(4294967295),s=Number(r>>i&o),c=Number(r&o),a=n?4:0,u=n?0:4;e.setUint32(t+a,s,n),e.setUint32(t+u,c,n)}var Ve=class extends te{constructor(t,r,n,i){super(),this.blockLen=t,this.outputLen=r,this.padOffset=n,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=Fe(this.buffer)}update(t){xt.exists(this);let{view:r,buffer:n,blockLen:i}=this;t=ee(t);let o=t.length;for(let s=0;si-s&&(this.process(n,0),s=0);for(let l=s;lf.length)throw new Error("_sha2: outputLen bigger than state");for(let l=0;l>Ar&Ze)}:{h:Number(e>>Ar&Ze)|0,l:Number(e&Ze)|0}}function Bo(e,t=!1){let r=new Uint32Array(e.length),n=new Uint32Array(e.length);for(let i=0;iBigInt(e>>>0)<>>0),Io=(e,t,r)=>e>>>r,Po=(e,t,r)=>e<<32-r|t>>>r,Uo=(e,t,r)=>e>>>r|t<<32-r,Ko=(e,t,r)=>e<<32-r|t>>>r,Ho=(e,t,r)=>e<<64-r|t>>>r-32,Oo=(e,t,r)=>e>>>r-32|t<<64-r,Co=(e,t)=>t,To=(e,t)=>e,No=(e,t,r)=>e<>>32-r,Do=(e,t,r)=>t<>>32-r,zo=(e,t,r)=>t<>>64-r,Ro=(e,t,r)=>e<>>64-r;function jo(e,t,r,n){let i=(t>>>0)+(n>>>0);return{h:e+r+(i/2**32|0)|0,l:i|0}}var Mo=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0),qo=(e,t,r,n)=>t+r+n+(e/2**32|0)|0,Go=(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0),Fo=(e,t,r,n,i)=>t+r+n+i+(e/2**32|0)|0,$o=(e,t,r,n,i)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(i>>>0),Vo=(e,t,r,n,i,o)=>t+r+n+i+o+(e/2**32|0)|0,Zo={fromBig:Sn,split:Bo,toBig:Lo,shrSH:Io,shrSL:Po,rotrSH:Uo,rotrSL:Ko,rotrBH:Ho,rotrBL:Oo,rotr32H:Co,rotr32L:To,rotlSH:No,rotlSL:Do,rotlBH:zo,rotlBL:Ro,add:jo,add3L:Mo,add3H:qo,add4L:Go,add4H:Fo,add5H:Vo,add5L:$o},U=Zo;var[Xo,Wo]=U.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e))),zt=new Uint32Array(80),Rt=new Uint32Array(80),ne=class extends Ve{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){let{Ah:t,Al:r,Bh:n,Bl:i,Ch:o,Cl:s,Dh:c,Dl:a,Eh:u,El:f,Fh:l,Fl:d,Gh:w,Gl:_,Hh:m,Hl:E}=this;return[t,r,n,i,o,s,c,a,u,f,l,d,w,_,m,E]}set(t,r,n,i,o,s,c,a,u,f,l,d,w,_,m,E){this.Ah=t|0,this.Al=r|0,this.Bh=n|0,this.Bl=i|0,this.Ch=o|0,this.Cl=s|0,this.Dh=c|0,this.Dl=a|0,this.Eh=u|0,this.El=f|0,this.Fh=l|0,this.Fl=d|0,this.Gh=w|0,this.Gl=_|0,this.Hh=m|0,this.Hl=E|0}process(t,r){for(let p=0;p<16;p++,r+=4)zt[p]=t.getUint32(r),Rt[p]=t.getUint32(r+=4);for(let p=16;p<80;p++){let S=zt[p-15]|0,A=Rt[p-15]|0,O=U.rotrSH(S,A,1)^U.rotrSH(S,A,8)^U.shrSH(S,A,7),D=U.rotrSL(S,A,1)^U.rotrSL(S,A,8)^U.shrSL(S,A,7),B=zt[p-2]|0,x=Rt[p-2]|0,I=U.rotrSH(B,x,19)^U.rotrBH(B,x,61)^U.shrSH(B,x,6),P=U.rotrSL(B,x,19)^U.rotrBL(B,x,61)^U.shrSL(B,x,6),L=U.add4L(D,P,Rt[p-7],Rt[p-16]),v=U.add4H(L,O,I,zt[p-7],zt[p-16]);zt[p]=v|0,Rt[p]=L|0}let{Ah:n,Al:i,Bh:o,Bl:s,Ch:c,Cl:a,Dh:u,Dl:f,Eh:l,El:d,Fh:w,Fl:_,Gh:m,Gl:E,Hh:z,Hl:F}=this;for(let p=0;p<80;p++){let S=U.rotrSH(l,d,14)^U.rotrSH(l,d,18)^U.rotrBH(l,d,41),A=U.rotrSL(l,d,14)^U.rotrSL(l,d,18)^U.rotrBL(l,d,41),O=l&w^~l&m,D=d&_^~d&E,B=U.add5L(F,A,D,Wo[p],Rt[p]),x=U.add5H(B,z,S,O,Xo[p],zt[p]),I=B|0,P=U.rotrSH(n,i,28)^U.rotrBH(n,i,34)^U.rotrBH(n,i,39),L=U.rotrSL(n,i,28)^U.rotrBL(n,i,34)^U.rotrBL(n,i,39),v=n&o^n&c^o&c,M=i&s^i&a^s&a;z=m|0,F=E|0,m=w|0,E=_|0,w=l|0,_=d|0,{h:l,l:d}=U.add(u|0,f|0,x|0,I|0),u=c|0,f=a|0,c=o|0,a=s|0,o=n|0,s=i|0;let T=U.add3L(I,L,M);n=U.add3H(T,x,P,v),i=T|0}({h:n,l:i}=U.add(this.Ah|0,this.Al|0,n|0,i|0)),{h:o,l:s}=U.add(this.Bh|0,this.Bl|0,o|0,s|0),{h:c,l:a}=U.add(this.Ch|0,this.Cl|0,c|0,a|0),{h:u,l:f}=U.add(this.Dh|0,this.Dl|0,u|0,f|0),{h:l,l:d}=U.add(this.Eh|0,this.El|0,l|0,d|0),{h:w,l:_}=U.add(this.Fh|0,this.Fl|0,w|0,_|0),{h:m,l:E}=U.add(this.Gh|0,this.Gl|0,m|0,E|0),{h:z,l:F}=U.add(this.Hh|0,this.Hl|0,z|0,F|0),this.set(n,i,o,s,c,a,u,f,l,d,w,_,m,E,z,F)}roundClean(){zt.fill(0),Rt.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}},kr=class extends ne{constructor(){super(),this.Ah=-1942145080,this.Al=424955298,this.Bh=1944164710,this.Bl=-1982016298,this.Ch=502970286,this.Cl=855612546,this.Dh=1738396948,this.Dl=1479516111,this.Eh=258812777,this.El=2077511080,this.Fh=2011393907,this.Fl=79989058,this.Gh=1067287976,this.Gl=1780299464,this.Hh=286451373,this.Hl=-1848208735,this.outputLen=28}},vr=class extends ne{constructor(){super(),this.Ah=573645204,this.Al=-64227540,this.Bh=-1621794909,this.Bl=-934517566,this.Ch=596883563,this.Cl=1867755857,this.Dh=-1774684391,this.Dl=1497426621,this.Eh=-1775747358,this.El=-1467023389,this.Fh=-1101128155,this.Fl=1401305490,this.Gh=721525244,this.Gl=746961066,this.Hh=246885852,this.Hl=-2117784414,this.outputLen=32}},Sr=class extends ne{constructor(){super(),this.Ah=-876896931,this.Al=-1056596264,this.Bh=1654270250,this.Bl=914150663,this.Ch=-1856437926,this.Cl=812702999,this.Dh=355462360,this.Dl=-150054599,this.Eh=1731405415,this.El=-4191439,this.Fh=-1900787065,this.Fl=1750603025,this.Gh=-619958771,this.Gl=1694076839,this.Hh=1203062813,this.Hl=-1090891868,this.outputLen=48}},Br=_t(()=>new ne),za=_t(()=>new kr),Ra=_t(()=>new vr),ja=_t(()=>new Sr);var qa=BigInt(0),Yo=BigInt(1),Jo=BigInt(2),Xe=e=>e instanceof Uint8Array,Qo=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function pe(e){if(!Xe(e))throw new Error("Uint8Array expected");let t="";for(let r=0;rn+i.length,0)),r=0;return e.forEach(n=>{if(!Xe(n))throw new Error("Uint8Array expected");t.set(n,r),r+=n.length}),t}var In=e=>(Jo<typeof e=="bigint",function:e=>typeof e=="function",boolean:e=>typeof e=="boolean",string:e=>typeof e=="string",isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>typeof e=="function"&&Number.isSafeInteger(e.outputLen)};function Bt(e,t,r={}){let n=(i,o,s)=>{let c=ts[o];if(typeof c!="function")throw new Error(`Invalid validator "${o}", expected function`);let a=e[i];if(!(s&&a===void 0)&&!c(a,e))throw new Error(`Invalid param ${String(i)}=${a} (${typeof a}), expected ${o}`)};for(let[i,o]of Object.entries(t))n(i,o,!1);for(let[i,o]of Object.entries(r))n(i,o,!0);return e}var tt=BigInt(0),J=BigInt(1),$t=BigInt(2),rs=BigInt(3),Pr=BigInt(4),Pn=BigInt(5),Un=BigInt(8),ns=BigInt(9),is=BigInt(16);function j(e,t){let r=e%t;return r>=tt?r:t+r}function Ur(e,t,r){if(r<=tt||t 0");if(r===J)return tt;let n=J;for(;t>tt;)t&J&&(n=n*e%r),e=e*e%r,t>>=J;return n}function W(e,t,r){let n=e;for(;t-- >tt;)n*=n,n%=r;return n}function Kn(e,t){if(e===tt||t<=tt)throw new Error(`invert: expected positive integers, got n=${e} mod=${t}`);let r=j(e,t),n=t,i=tt,o=J,s=J,c=tt;for(;r!==tt;){let u=n/r,f=n%r,l=i-s*u,d=o-c*u;n=r,r=f,i=s,o=c,s=l,c=d}if(n!==J)throw new Error("invert: does not exist");return j(i,t)}function os(e){let t=(e-J)/$t,r,n,i;for(r=e-J,n=0;r%$t===tt;r/=$t,n++);for(i=$t;i(j(e,t)&J)===J,cs=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function On(e){let t={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},r=cs.reduce((n,i)=>(n[i]="function",n),t);return Bt(e,r)}function as(e,t,r){if(r 0");if(r===tt)return e.ONE;if(r===J)return t;let n=e.ONE,i=t;for(;r>tt;)r&J&&(n=e.mul(n,i)),i=e.sqr(i),r>>=J;return n}function fs(e,t){let r=new Array(t.length),n=t.reduce((o,s,c)=>e.is0(s)?o:(r[c]=o,e.mul(o,s)),e.ONE),i=e.inv(n);return t.reduceRight((o,s,c)=>e.is0(s)?o:(r[c]=e.mul(o,r[c]),e.mul(o,s)),i),r}function Kr(e,t){let r=t!==void 0?t:e.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function Ye(e,t,r=!1,n={}){if(e<=tt)throw new Error(`Expected Fp ORDER > 0, got ${e}`);let{nBitLength:i,nByteLength:o}=Kr(e,t);if(o>2048)throw new Error("Field lengths over 2048 bytes are not supported");let s=ss(e),c=Object.freeze({ORDER:e,BITS:i,BYTES:o,MASK:In(i),ZERO:tt,ONE:J,create:a=>j(a,e),isValid:a=>{if(typeof a!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof a}`);return tt<=a&&aa===tt,isOdd:a=>(a&J)===J,neg:a=>j(-a,e),eql:(a,u)=>a===u,sqr:a=>j(a*a,e),add:(a,u)=>j(a+u,e),sub:(a,u)=>j(a-u,e),mul:(a,u)=>j(a*u,e),pow:(a,u)=>as(c,a,u),div:(a,u)=>j(a*Kn(u,e),e),sqrN:a=>a*a,addN:(a,u)=>a+u,subN:(a,u)=>a-u,mulN:(a,u)=>a*u,inv:a=>Kn(a,e),sqrt:n.sqrt||(a=>s(c,a)),invertBatch:a=>fs(c,a),cmov:(a,u,f)=>f?u:a,toBytes:a=>r?jt(a,o):Ir(a,o),fromBytes:a=>{if(a.length!==o)throw new Error(`Fp.fromBytes: expected ${o}, got ${a.length}`);return r?Et(a):Lr(a)}});return Object.freeze(c)}function Cn(e,t){if(!e.isOdd)throw new Error("Field doesn't have isOdd");let r=e.sqrt(t);return e.isOdd(r)?e.neg(r):r}var us=BigInt(0),Hr=BigInt(1);function Tn(e,t){let r=(i,o)=>{let s=o.negate();return i?s:o},n=i=>{let o=Math.ceil(t/i)+1,s=2**(i-1);return{windows:o,windowSize:s}};return{constTimeNegate:r,unsafeLadder(i,o){let s=e.ZERO,c=i;for(;o>us;)o&Hr&&(s=s.add(c)),c=c.double(),o>>=Hr;return s},precomputeWindow(i,o){let{windows:s,windowSize:c}=n(o),a=[],u=i,f=u;for(let l=0;l>=w,E>a&&(E-=d,s+=Hr);let z=m,F=m+Math.abs(E)-1,p=_%2!==0,S=E<0;E===0?f=f.add(r(p,o[z])):u=u.add(r(S,o[F]))}return{p:u,f}},wNAFCached(i,o,s,c){let a=i._WINDOW_SIZE||1,u=o.get(i);return u||(u=this.precomputeWindow(i,a),a!==1&&o.set(i,c(u))),this.wNAF(a,u,s)}}}function Nn(e){return On(e.Fp),Bt(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...Kr(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}var yt=BigInt(0),dt=BigInt(1),Je=BigInt(2),hs=BigInt(8),ls={zip215:!0};function ds(e){let t=Nn(e);return Bt(e,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...t})}function Vt(e){let t=ds(e),{Fp:r,n,prehash:i,hash:o,randomBytes:s,nByteLength:c,h:a}=t,u=Je<{try{return{isValid:!0,value:r.sqrt(b*r.inv(h))}}catch{return{isValid:!1,value:yt}}}),d=t.adjustScalarBytes||(b=>b),w=t.domain||((b,h,y)=>{if(h.length||y)throw new Error("Contexts/pre-hash are not supported");return b}),_=b=>typeof b=="bigint"&&yt_(b)&&_(h)&&bb===yt||m(b,u);function z(b,h){if(m(b,h))return b;throw new Error(`Expected valid scalar < ${h}, got ${typeof b} ${b}`)}function F(b){return b===yt?b:z(b,n)}let p=new Map;function S(b){if(!(b instanceof A))throw new Error("ExtendedPoint expected")}class A{constructor(h,y,g,k){if(this.ex=h,this.ey=y,this.ez=g,this.et=k,!E(h))throw new Error("x required");if(!E(y))throw new Error("y required");if(!E(g))throw new Error("z required");if(!E(k))throw new Error("t required")}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(h){if(h instanceof A)throw new Error("extended point not allowed");let{x:y,y:g}=h||{};if(!E(y)||!E(g))throw new Error("invalid affine point");return new A(y,g,dt,f(y*g))}static normalizeZ(h){let y=r.invertBatch(h.map(g=>g.ez));return h.map((g,k)=>g.toAffine(y[k])).map(A.fromAffine)}_setWindowSize(h){this._WINDOW_SIZE=h,p.delete(this)}assertValidity(){let{a:h,d:y}=t;if(this.is0())throw new Error("bad point: ZERO");let{ex:g,ey:k,ez:K,et:N}=this,q=f(g*g),C=f(k*k),R=f(K*K),Y=f(R*R),Q=f(q*h),wt=f(R*f(Q+C)),st=f(Y+f(y*f(q*C)));if(wt!==st)throw new Error("bad point: equation left != right (1)");let It=f(g*k),At=f(K*N);if(It!==At)throw new Error("bad point: equation left != right (2)")}equals(h){S(h);let{ex:y,ey:g,ez:k}=this,{ex:K,ey:N,ez:q}=h,C=f(y*q),R=f(K*k),Y=f(g*q),Q=f(N*k);return C===R&&Y===Q}is0(){return this.equals(A.ZERO)}negate(){return new A(f(-this.ex),this.ey,this.ez,f(-this.et))}double(){let{a:h}=t,{ex:y,ey:g,ez:k}=this,K=f(y*y),N=f(g*g),q=f(Je*f(k*k)),C=f(h*K),R=y+g,Y=f(f(R*R)-K-N),Q=C+N,wt=Q-q,st=C-N,It=f(Y*wt),At=f(Q*st),me=f(Y*st),ge=f(wt*Q);return new A(It,At,ge,me)}add(h){S(h);let{a:y,d:g}=t,{ex:k,ey:K,ez:N,et:q}=this,{ex:C,ey:R,ez:Y,et:Q}=h;if(y===BigInt(-1)){let Gr=f((K-k)*(R+C)),Fr=f((K+k)*(R-C)),ur=f(Fr-Gr);if(ur===yt)return this.double();let $r=f(N*Je*Q),Vr=f(q*Je*Y),Zr=Vr+$r,Xr=Fr+Gr,Wr=Vr-$r,ci=f(Zr*ur),ai=f(Xr*Wr),fi=f(Zr*Wr),ui=f(ur*Xr);return new A(ci,ai,ui,fi)}let wt=f(k*C),st=f(K*R),It=f(q*g*Q),At=f(N*Y),me=f((k+K)*(C+R)-wt-st),ge=At-It,Mr=At+It,qr=f(st-y*wt),ni=f(me*ge),ii=f(Mr*qr),oi=f(me*qr),si=f(ge*Mr);return new A(ni,ii,si,oi)}subtract(h){return this.add(h.negate())}wNAF(h){return B.wNAFCached(this,p,h,A.normalizeZ)}multiply(h){let{p:y,f:g}=this.wNAF(z(h,n));return A.normalizeZ([y,g])[0]}multiplyUnsafe(h){let y=F(h);return y===yt?D:this.equals(D)||y===dt?this:this.equals(O)?this.wNAF(y).p:B.unsafeLadder(this,y)}isSmallOrder(){return this.multiplyUnsafe(a).is0()}isTorsionFree(){return B.unsafeLadder(this,n).is0()}toAffine(h){let{ex:y,ey:g,ez:k}=this,K=this.is0();h==null&&(h=K?hs:r.inv(k));let N=f(y*h),q=f(g*h),C=f(k*h);if(K)return{x:yt,y:dt};if(C!==dt)throw new Error("invZ was invalid");return{x:N,y:q}}clearCofactor(){let{h}=t;return h===dt?this:this.multiplyUnsafe(h)}static fromHex(h,y=!1){let{d:g,a:k}=t,K=r.BYTES;h=lt("pointHex",h,K);let N=h.slice(),q=h[K-1];N[K-1]=q&-129;let C=Et(N);C===yt||(y?z(C,u):z(C,r.ORDER));let R=f(C*C),Y=f(R-dt),Q=f(g*R-k),{isValid:wt,value:st}=l(Y,Q);if(!wt)throw new Error("Point.fromHex: invalid y coordinate");let It=(st&dt)===dt,At=(q&128)!==0;if(!y&&st===yt&&At)throw new Error("Point.fromHex: x=0 and x_0=1");return At!==It&&(st=f(-st)),A.fromAffine({x:st,y:C})}static fromPrivateKey(h){return P(h).point}toRawBytes(){let{x:h,y}=this.toAffine(),g=jt(y,r.BYTES);return g[g.length-1]|=h&dt?128:0,g}toHex(){return pe(this.toRawBytes())}}A.BASE=new A(t.Gx,t.Gy,dt,f(t.Gx*t.Gy)),A.ZERO=new A(yt,dt,dt,yt);let{BASE:O,ZERO:D}=A,B=Tn(A,c*8);function x(b){return j(b,n)}function I(b){return x(Et(b))}function P(b){let h=c;b=lt("private key",b,h);let y=lt("hashed private key",o(b),2*h),g=d(y.slice(0,h)),k=y.slice(h,2*h),K=I(g),N=O.multiply(K),q=N.toRawBytes();return{head:g,prefix:k,scalar:K,point:N,pointBytes:q}}function L(b){return P(b).pointBytes}function v(b=new Uint8Array,...h){let y=We(...h);return I(o(w(y,lt("context",b),!!i)))}function M(b,h,y={}){b=lt("message",b),i&&(b=i(b));let{prefix:g,scalar:k,pointBytes:K}=P(h),N=v(y.context,g,b),q=O.multiply(N).toRawBytes(),C=v(y.context,q,K,b),R=x(N+C*k);F(R);let Y=We(q,jt(R,r.BYTES));return lt("result",Y,c*2)}let T=ls;function $(b,h,y,g=T){let{context:k,zip215:K}=g,N=r.BYTES;b=lt("signature",b,2*N),h=lt("message",h),i&&(h=i(h));let q=Et(b.slice(N,2*N)),C,R,Y;try{C=A.fromHex(y,K),R=A.fromHex(b.slice(0,N),K),Y=O.multiplyUnsafe(q)}catch{return!1}if(!K&&C.isSmallOrder())return!1;let Q=v(k,R.toRawBytes(),C.toRawBytes(),h);return R.add(C.multiplyUnsafe(Q)).subtract(Y).clearCofactor().equals(A.ZERO)}return O._setWindowSize(8),{CURVE:t,getPublicKey:L,sign:M,verify:$,ExtendedPoint:A,utils:{getExtendedPublicKey:P,randomPrivateKey:()=>s(r.BYTES),precompute(b=8,h=A.BASE){return h._setWindowSize(b),h.multiply(BigInt(3)),h}}}}var be=BigInt(0),Or=BigInt(1);function ps(e){return Bt(e,{a:"bigint"},{montgomeryBits:"isSafeInteger",nByteLength:"isSafeInteger",adjustScalarBytes:"function",domain:"function",powPminus2:"function",Gu:"bigint"}),Object.freeze({...e})}function Qe(e){let t=ps(e),{P:r}=t,n=p=>j(p,r),i=t.montgomeryBits,o=Math.ceil(i/8),s=t.nByteLength,c=t.adjustScalarBytes||(p=>p),a=t.powPminus2||(p=>Ur(p,r-BigInt(2),r));function u(p,S,A){let O=n(p*(S-A));return S=n(S-O),A=n(A+O),[S,A]}function f(p){if(typeof p=="bigint"&&be<=p&&p=be;T--){let $=O>>T⩔L^=$,v=u(L,B,I),B=v[0],I=v[1],v=u(L,x,P),x=v[0],P=v[1],L=$;let V=B+x,b=n(V*V),h=B-x,y=n(h*h),g=b-y,k=I+P,K=I-P,N=n(K*V),q=n(k*h),C=N+q,R=N-q;I=n(C*C),P=n(D*n(R*R)),B=n(b*y),x=n(g*(b+n(l*g)))}v=u(L,B,I),B=v[0],I=v[1],v=u(L,x,P),x=v[0],P=v[1];let M=a(x);return n(B*M)}function w(p){return jt(n(p),o)}function _(p){let S=lt("u coordinate",p,o);return s===o&&(S[s-1]&=127),Et(S)}function m(p){let S=lt("scalar",p);if(S.length!==o&&S.length!==s)throw new Error(`Expected ${o} or ${s} bytes, got ${S.length}`);return Et(c(S))}function E(p,S){let A=_(S),O=m(p),D=d(A,O);if(D===be)throw new Error("Invalid private or public key received");return w(D)}let z=w(t.Gu);function F(p){return E(p,z)}return{scalarMult:E,scalarMultBase:F,getSharedSecret:(p,S)=>E(p,S),getPublicKey:p=>F(p),utils:{randomPrivateKey:()=>t.randomBytes(t.nByteLength)},GuBytes:z}}var xe=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),Dn=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752"),xf=BigInt(0),xs=BigInt(1),Cr=BigInt(2),ys=BigInt(5),zn=BigInt(10),ws=BigInt(20),ms=BigInt(40),Rn=BigInt(80);function jn(e){let t=xe,n=e*e%t*e%t,i=W(n,Cr,t)*n%t,o=W(i,xs,t)*e%t,s=W(o,ys,t)*o%t,c=W(s,zn,t)*s%t,a=W(c,ws,t)*c%t,u=W(a,ms,t)*a%t,f=W(u,Rn,t)*u%t,l=W(f,Rn,t)*u%t,d=W(l,zn,t)*s%t;return{pow_p_5_8:W(d,Cr,t)*e%t,b2:n}}function Mn(e){return e[0]&=248,e[31]&=127,e[31]|=64,e}function gs(e,t){let r=xe,n=j(t*t*t,r),i=j(n*n*t,r),o=jn(e*i).pow_p_5_8,s=j(e*n*o,r),c=j(t*s*s,r),a=s,u=j(s*Dn,r),f=c===e,l=c===j(-e,r),d=c===j(-e*Dn,r);return f&&(s=a),(l||d)&&(s=u),Hn(s,r)&&(s=j(-s,r)),{isValid:f||l,value:s}}var Lt=Ye(xe,void 0,!0),Tr={a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:Lt,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:BigInt(8),Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:Br,randomBytes:re,adjustScalarBytes:Mn,uvRatio:gs},qn=Vt(Tr);function Gn(e,t,r){if(t.length>255)throw new Error("Context is too big");return $e(de("SigEd25519 no Ed25519 collisions"),new Uint8Array([r?1:0,t.length]),t,e)}var yf=Vt({...Tr,domain:Gn}),wf=Vt({...Tr,domain:Gn,prehash:Br}),Nr=(()=>Qe({P:xe,a:BigInt(486662),montgomeryBits:255,nByteLength:32,Gu:BigInt(9),powPminus2:e=>{let t=xe,{pow_p_5_8:r,b2:n}=jn(e);return j(W(r,BigInt(3),t)*n,t)},adjustScalarBytes:Mn,randomBytes:re}))();var _s=(Lt.ORDER+BigInt(3))/BigInt(8),mf=Lt.pow(Cr,_s),gf=Lt.sqrt(Lt.neg(Lt.ONE)),_f=(Lt.ORDER-BigInt(5))/BigInt(8),Ef=BigInt(486662);var Af=Cn(Lt,Lt.neg(BigInt(486664)));var kf=BigInt("25063068953384623474111414158702152701244531502492656460079210482610430750235"),vf=BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"),Sf=BigInt("1159843021668779879193775521855586647937357759715417654439879720876111806838"),Bf=BigInt("40440834346308536858101042469323190826248399146238708352240133220865137265952");var Lf=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");var it=class{constructor(t,r,n,i=[]){Object.defineProperty(this,"key",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"type",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"extractable",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"algorithm",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"usages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.key=r,this.type=n,this.algorithm={name:t},this.usages=i,n==="public"&&(this.usages=[])}};var ie="X25519",tr=class{constructor(t){Object.defineProperty(this,"_hkdf",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_nPk",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_nSk",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._hkdf=t,this._nPk=32,this._nSk=32}async serializePublicKey(t){try{return await this._serializePublicKey(t)}catch(r){throw new at(r)}}async deserializePublicKey(t){try{return await this._importRawKey(t,!0)}catch(r){throw new rt(r)}}async serializePrivateKey(t){try{return await this._serializePrivateKey(t)}catch(r){throw new at(r)}}async deserializePrivateKey(t){try{return await this._importRawKey(t,!1)}catch(r){throw new rt(r)}}async importKey(t,r,n){try{if(t==="raw")return await this._importRawKey(r,n);if(r instanceof ArrayBuffer)throw new Error("Invalid jwk key format");return await this._importJWK(r,n)}catch(i){throw new rt(i)}}async generateKeyPair(){try{let t=qn.utils.randomPrivateKey(),r=new it(ie,t,"private",ht);return{publicKey:await this.derivePublicKey(r),privateKey:r}}catch(t){throw new ft(t)}}async deriveKeyPair(t){try{let r=await this._hkdf.labeledExtract(X,Qt,new Uint8Array(t)),n=await this._hkdf.labeledExpand(r,ze,X,this._nSk),i=new it(ie,new Uint8Array(n),"private",ht);return{privateKey:i,publicKey:await this.derivePublicKey(i)}}catch(r){throw new Pt(r)}}async derivePublicKey(t){try{return await this._derivePublicKey(t)}catch(r){throw new rt(r)}}async dh(t,r){try{return await this._dh(t,r)}catch(n){throw new at(n)}}_serializePublicKey(t){return new Promise(r=>{r(t.key.buffer)})}_serializePrivateKey(t){return new Promise(r=>{r(t.key.buffer)})}_importRawKey(t,r){return new Promise((n,i)=>{r&&t.byteLength!==this._nPk&&i(new Error("Invalid length of the key")),!r&&t.byteLength!==this._nSk&&i(new Error("Invalid length of the key")),n(new it(ie,new Uint8Array(t),r?"public":"private",r?[]:ht))})}_importJWK(t,r){return new Promise((n,i)=>{(typeof t.kty>"u"||t.kty!=="OKP")&&i(new Error(`Invalid kty: ${t.kty}`)),(typeof t.crv>"u"||t.crv!=="X25519")&&i(new Error(`Invalid crv: ${t.crv}`)),r?(typeof t.d<"u"&&i(new Error("Invalid key: `d` should not be set")),typeof t.x>"u"&&i(new Error("Invalid key: `x` not found")),n(new it(ie,Nt(t.x),"public"))):(typeof t.d!="string"&&i(new Error("Invalid key: `d` not found")),n(new it(ie,Nt(t.d),"private",ht)))})}_derivePublicKey(t){return new Promise((r,n)=>{try{let i=Nr.getPublicKey(t.key);r(new it(ie,i,"public"))}catch(i){n(i)}})}_dh(t,r){return new Promise((n,i)=>{try{n(Nr.getSharedSecret(t.key,r.key).buffer)}catch(o){i(o)}})}};var er=class extends pt{constructor(){let t=new Ht;super(Z.DhkemX25519HkdfSha256,new tr(t),t),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:Z.DhkemX25519HkdfSha256}),Object.defineProperty(this,"secretSize",{enumerable:!0,configurable:!0,writable:!0,value:32}),Object.defineProperty(this,"encSize",{enumerable:!0,configurable:!0,writable:!0,value:32}),Object.defineProperty(this,"publicKeySize",{enumerable:!0,configurable:!0,writable:!0,value:32}),Object.defineProperty(this,"privateKeySize",{enumerable:!0,configurable:!0,writable:!0,value:32})}};var[Vn,Zn,Xn]=[[],[],[]],Es=BigInt(0),ye=BigInt(1),As=BigInt(2),ks=BigInt(7),vs=BigInt(256),Ss=BigInt(113);for(let e=0,t=ye,r=1,n=0;e<24;e++){[r,n]=[n,(2*r+3*n)%5],Vn.push(2*(5*n+r)),Zn.push((e+1)*(e+2)/2%64);let i=Es;for(let o=0;o<7;o++)t=(t<>ks)*Ss)%vs,t&As&&(i^=ye<<(ye<r>32?U.rotlBH(e,t,r):U.rotlSH(e,t,r),$n=(e,t,r)=>r>32?U.rotlBL(e,t,r):U.rotlSL(e,t,r);function Is(e,t=24){let r=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let s=0;s<10;s++)r[s]=e[s]^e[s+10]^e[s+20]^e[s+30]^e[s+40];for(let s=0;s<10;s+=2){let c=(s+8)%10,a=(s+2)%10,u=r[a],f=r[a+1],l=Fn(u,f,1)^r[c],d=$n(u,f,1)^r[c+1];for(let w=0;w<50;w+=10)e[s+w]^=l,e[s+w+1]^=d}let i=e[2],o=e[3];for(let s=0;s<24;s++){let c=Zn[s],a=Fn(i,o,c),u=$n(i,o,c),f=Vn[s];i=e[f],o=e[f+1],e[f]=a,e[f+1]=u}for(let s=0;s<50;s+=10){for(let c=0;c<10;c++)r[c]=e[s+c];for(let c=0;c<10;c++)e[s+c]^=~r[(c+2)%10]&r[(c+4)%10]}e[0]^=Bs[n],e[1]^=Ls[n]}r.fill(0)}var rr=class e extends te{constructor(t,r,n,i=!1,o=24){if(super(),this.blockLen=t,this.suffix=r,this.outputLen=n,this.enableXOF=i,this.rounds=o,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,xt.number(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=kn(this.state)}keccak(){Is(this.state32,this.rounds),this.posOut=0,this.pos=0}update(t){xt.exists(this);let{blockLen:r,state:n}=this;t=ee(t);let i=t.length;for(let o=0;o=n&&this.keccak();let s=Math.min(n-this.posOut,o-i);t.set(r.subarray(this.posOut,this.posOut+s),i),this.posOut+=s,i+=s}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return xt.number(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(xt.output(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){let{blockLen:r,suffix:n,outputLen:i,rounds:o,enableXOF:s}=this;return t||(t=new e(r,n,i,s,o)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=o,t.suffix=n,t.outputLen=i,t.enableXOF=s,t.destroyed=this.destroyed,t}},Mt=(e,t,r)=>_t(()=>new rr(t,e,r)),$f=Mt(6,144,224/8),Vf=Mt(6,136,256/8),Zf=Mt(6,104,384/8),Xf=Mt(6,72,512/8),Wf=Mt(1,144,224/8),Yf=Mt(1,136,256/8),Jf=Mt(1,104,384/8),Qf=Mt(1,72,512/8),Wn=(e,t,r)=>vn((n={})=>new rr(t,e,n.dkLen===void 0?r:n.dkLen,!0)),t0=Wn(31,168,128/8),Dr=Wn(31,136,256/8);var Ps=_t(()=>Dr.create({dkLen:114})),Us=_t(()=>Dr.create({dkLen:64})),we=BigInt("726838724295606890549323807888004534353641360687318060281490199180612328166730772686396383698676545930088884461843637361053498018365439");function Yn(e){let t=we,r=BigInt(1),n=BigInt(2),i=BigInt(3),o=BigInt(11),s=BigInt(22),c=BigInt(44),a=BigInt(88),u=BigInt(223),f=e*e*e%t,l=f*f*e%t,d=W(l,i,t)*l%t,w=W(d,i,t)*l%t,_=W(w,n,t)*f%t,m=W(_,o,t)*_%t,E=W(m,s,t)*m%t,z=W(E,c,t)*E%t,F=W(z,a,t)*z%t,p=W(F,c,t)*E%t,S=W(p,n,t)*f%t,A=W(S,r,t)*e%t;return W(A,u,t)*S%t}function Jn(e){return e[0]&=252,e[55]|=128,e[56]=0,e}var Qn=Ye(we,456,!0),a0=BigInt(4),ti={a:BigInt(1),d:BigInt("726838724295606890549323807888004534353641360687318060281490199180612328166730772686396383698676545930088884461843637361053498018326358"),Fp:Qn,n:BigInt("181709681073901722637330951972001133588410340171829515070372549795146003961539585716195755291692375963310293709091662304773755859649779"),nBitLength:456,h:BigInt(4),Gx:BigInt("224580040295924300187604334099896036246789641632564134246125461686950415467406032909029192869357953282578032075146446173674602635247710"),Gy:BigInt("298819210078481492676017930443930673437544040154080242095928241372331506189835876003536878655418784733982303233503462500531545062832660"),hash:Ps,randomBytes:re,adjustScalarBytes:Jn,domain:(e,t,r)=>{if(t.length>255)throw new Error(`Context is too big: ${t.length}`);return $e(de("SigEd448"),new Uint8Array([r?1:0,t.length]),t,e)},uvRatio:(e,t)=>{let r=we,n=j(e*e*t,r),i=j(n*e,r),o=j(i*n*t,r),s=Yn(o),c=j(i*s,r),a=j(c*c,r);return{isValid:j(a*t,r)===e,value:c}}},ei=Vt(ti),f0=Vt({...ti,prehash:Us}),zr=(()=>Qe({a:BigInt(156326),montgomeryBits:448,nByteLength:57,P:we,Gu:BigInt(5),powPminus2:e=>{let t=we,r=Yn(e),n=W(r,BigInt(2),t);return j(n*e,t)},adjustScalarBytes:Jn,randomBytes:re}))();var u0=(Qn.ORDER-BigInt(3))/BigInt(4),h0=BigInt(156326);var oe="X448",nr=class{constructor(t){Object.defineProperty(this,"_hkdf",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_nPk",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_nSk",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._hkdf=t,this._nPk=56,this._nSk=56}async serializePublicKey(t){try{return await this._serializePublicKey(t)}catch(r){throw new at(r)}}async deserializePublicKey(t){try{return await this._importRawKey(t,!0)}catch(r){throw new rt(r)}}async serializePrivateKey(t){try{return await this._serializePrivateKey(t)}catch(r){throw new at(r)}}async deserializePrivateKey(t){try{return await this._importRawKey(t,!1)}catch(r){throw new rt(r)}}async importKey(t,r,n){try{if(t==="raw")return await this._importRawKey(r,n);if(r instanceof ArrayBuffer)throw new Error("Invalid jwk key format");return await this._importJWK(r,n)}catch(i){throw new rt(i)}}async generateKeyPair(){try{let t=ei.utils.randomPrivateKey(),r=new it(oe,t,"private",ht);return{publicKey:await this.derivePublicKey(r),privateKey:r}}catch(t){throw new ft(t)}}async deriveKeyPair(t){try{let r=await this._hkdf.labeledExtract(X,Qt,new Uint8Array(t)),n=await this._hkdf.labeledExpand(r,ze,X,this._nSk),i=new it(oe,new Uint8Array(n),"private",ht);return{privateKey:i,publicKey:await this.derivePublicKey(i)}}catch(r){throw new Pt(r)}}async derivePublicKey(t){try{return await this._derivePublicKey(t)}catch(r){throw new rt(r)}}async dh(t,r){try{return await this._dh(t,r)}catch(n){throw new at(n)}}_serializePublicKey(t){return new Promise(r=>{r(t.key.buffer)})}_serializePrivateKey(t){return new Promise(r=>{r(t.key.buffer)})}_importRawKey(t,r){return new Promise((n,i)=>{r&&t.byteLength!==this._nPk&&i(new Error("Invalid length of the key")),!r&&t.byteLength!==this._nSk&&t.byteLength!==this._nSk+1&&i(new Error("Invalid length of the key")),n(new it(oe,new Uint8Array(t),r?"public":"private",r?[]:ht))})}_importJWK(t,r){return new Promise((n,i)=>{t.kty!=="OKP"&&i(new Error(`Invalid kty: ${t.kty}`)),t.crv!=="X448"&&i(new Error(`Invalid crv: ${t.crv}`)),r?(typeof t.d<"u"&&i(new Error("Invalid key: `d` should not be set")),typeof t.x!="string"&&i(new Error("Invalid key: `x` not found")),n(new it(oe,Nt(t.x),"public"))):(typeof t.d!="string"&&i(new Error("Invalid key: `d` not found")),n(new it(oe,Nt(t.d),"private",ht)))})}_derivePublicKey(t){return new Promise((r,n)=>{try{let i=zr.getPublicKey(t.key);r(new it(oe,i,"public"))}catch(i){n(i)}})}_dh(t,r){return new Promise((n,i)=>{try{n(zr.getSharedSecret(t.key,r.key).buffer)}catch(o){i(o)}})}};var ir=class extends pt{constructor(){let t=new Tt;super(Z.DhkemX448HkdfSha512,new nr(t),t),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:Z.DhkemX448HkdfSha512}),Object.defineProperty(this,"secretSize",{enumerable:!0,configurable:!0,writable:!0,value:64}),Object.defineProperty(this,"encSize",{enumerable:!0,configurable:!0,writable:!0,value:56}),Object.defineProperty(this,"publicKeySize",{enumerable:!0,configurable:!0,writable:!0,value:56}),Object.defineProperty(this,"privateKeySize",{enumerable:!0,configurable:!0,writable:!0,value:56})}};function Rr(){return new Promise((e,t)=>{t(new ft("Not supported"))})}var Ks=new Uint8Array([115,101,99]),se=class{constructor(t,r,n){Object.defineProperty(this,"_api",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"exporterSecret",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_kdf",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._api=t,this._kdf=r,this.exporterSecret=n}async seal(t,r){return await Rr()}async open(t,r){return await Rr()}async export(t,r){if(t.byteLength>8192)throw new et("Too long exporter context");try{return await this._kdf.labeledExpand(this.exporterSecret,Ks,new Uint8Array(t),r)}catch(n){throw new Ae(n)}}},or=class extends se{},sr=class extends se{constructor(t,r,n,i){super(t,r,n),Object.defineProperty(this,"enc",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.enc=i}};function Hs(e,t){if(e.byteLength!==t.byteLength)throw new Error("xor: different length inputs");let r=new Uint8Array(e.byteLength);for(let n=0;nNumber.MAX_SAFE_INTEGER)throw new Se("Message limit reached");t.seq+=1}};var cr=class extends ce{async open(t,r=X){let n;try{n=await this._ctx.key.open(this.computeNonce(this._ctx),t,r)}catch(i){throw new ve(i)}return this.incrementSeq(this._ctx),n}};var ar=class extends ce{constructor(t,r,n,i){super(t,r,n),Object.defineProperty(this,"enc",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.enc=i}async seal(t,r=X){let n;try{n=await this._ctx.key.seal(this.computeNonce(this._ctx),t,r)}catch(i){throw new ke(i)}return this.incrementSeq(this._ctx),n}};var Os=new Uint8Array([98,97,115,101,95,110,111,110,99,101]),Cs=new Uint8Array([101,120,112]),Ts=new Uint8Array([105,110,102,111,95,104,97,115,104]),Ns=new Uint8Array([107,101,121]),Ds=new Uint8Array([112,115,107,95,105,100,95,104,97,115,104]),zs=new Uint8Array([115,101,99,114,101,116]),Rs=new Uint8Array([72,80,75,69,0,0,0,0,0,0]),fr=class extends mt{constructor(t){if(super(),Object.defineProperty(this,"_kem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_kdf",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_aead",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_suiteId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),typeof t.kem=="number")throw new et("KemId cannot be used");if(this._kem=t.kem,typeof t.kdf=="number")throw new et("KdfId cannot be used");if(this._kdf=t.kdf,typeof t.aead=="number")throw new et("AeadId cannot be used");this._aead=t.aead,this._suiteId=new Uint8Array(Rs),this._suiteId.set(gt(this._kem.id,2),4),this._suiteId.set(gt(this._kdf.id,2),6),this._suiteId.set(gt(this._aead.id,2),8),this._kdf.init(this._suiteId)}get kem(){return this._kem}get kdf(){return this._kdf}get aead(){return this._aead}async createSenderContext(t){this._validateInputLength(t),await this._setup();let r=await this._kem.encap(t),n;return t.psk!==void 0?n=t.senderKey!==void 0?kt.AuthPsk:kt.Psk:n=t.senderKey!==void 0?kt.Auth:kt.Base,await this._keyScheduleS(n,r.sharedSecret,r.enc,t)}async createRecipientContext(t){this._validateInputLength(t),await this._setup();let r=await this._kem.decap(t),n;return t.psk!==void 0?n=t.senderPublicKey!==void 0?kt.AuthPsk:kt.Psk:n=t.senderPublicKey!==void 0?kt.Auth:kt.Base,await this._keyScheduleR(n,r,t)}async seal(t,r,n=X){let i=await this.createSenderContext(t);return{ct:await i.seal(r,n),enc:i.enc}}async open(t,r,n=X){return await(await this.createRecipientContext(t)).open(r,n)}async _keySchedule(t,r,n){let i=n.psk===void 0?X:new Uint8Array(n.psk.id),o=await this._kdf.labeledExtract(X,Ds,i),s=n.info===void 0?X:new Uint8Array(n.info),c=await this._kdf.labeledExtract(X,Ts,s),a=new Uint8Array(1+o.byteLength+c.byteLength);a.set(new Uint8Array([t]),0),a.set(new Uint8Array(o),1),a.set(new Uint8Array(c),1+o.byteLength);let u=n.psk===void 0?X:new Uint8Array(n.psk.key),f=this._kdf.buildLabeledIkm(zs,u),l=this._kdf.buildLabeledInfo(Cs,a,this._kdf.hashSize),d=await this._kdf.extractAndExpand(r,f,l,this._kdf.hashSize);if(this._aead.id===ut.ExportOnly)return{aead:this._aead,exporterSecret:d};let w=this._kdf.buildLabeledInfo(Ns,a,this._aead.keySize),_=await this._kdf.extractAndExpand(r,f,w,this._aead.keySize),m=this._kdf.buildLabeledInfo(Os,a,this._aead.nonceSize),E=await this._kdf.extractAndExpand(r,f,m,this._aead.nonceSize);return{aead:this._aead,exporterSecret:d,key:_,baseNonce:new Uint8Array(E),seq:0}}async _keyScheduleS(t,r,n,i){let o=await this._keySchedule(t,r,i);return o.key===void 0?new sr(this._api,this._kdf,o.exporterSecret,n):new ar(this._api,this._kdf,o,n)}async _keyScheduleR(t,r,n){let i=await this._keySchedule(t,r,n);return i.key===void 0?new or(this._api,this._kdf,i.exporterSecret):new cr(this._api,this._kdf,i)}_validateInputLength(t){if(t.info!==void 0&&t.info.byteLength>8192)throw new et("Too long info");if(t.psk!==void 0){if(t.psk.key.byteLength<32)throw new et(`PSK must have at least ${32} bytes`);if(t.psk.key.byteLength>8192)throw new et("Too long psk.key");if(t.psk.id.byteLength>8192)throw new et("Too long psk.id")}}};var jr=class extends fr{constructor(t){if(typeof t.kem=="number")switch(t.kem){case Z.DhkemP256HkdfSha256:t.kem=new je;break;case Z.DhkemP384HkdfSha384:t.kem=new Me;break;case Z.DhkemP521HkdfSha512:t.kem=new qe;break;case Z.DhkemX25519HkdfSha256:t.kem=new er;break;case Z.DhkemX448HkdfSha512:t.kem=new ir;break;default:throw new et(`The KEM (${t.kem}) cannot be specified by KemId. Use submodule for the KEM`)}if(typeof t.kdf=="number")switch(t.kdf){case vt.HkdfSha256:t.kdf=new Ht;break;case vt.HkdfSha384:t.kdf=new Yt;break;default:t.kdf=new Tt;break}if(typeof t.aead=="number")switch(t.aead){case ut.Aes128Gcm:t.aead=new ae;break;case ut.Aes256Gcm:t.aead=new Be;break;case ut.Chacha20Poly1305:t.aead=new Ue;break;default:t.aead=new Le;break}super(t)}async generateKeyPair(){return await this._setup(),await this._kem.generateKeyPair()}async deriveKeyPair(t){return await this._setup(),await this._kem.deriveKeyPair(t)}async importKey(t,r,n=!0){return await this._setup(),await this._kem.importKey(t,r,n)}};export{en as Aead,ut as AeadId,hr as BaseError,jr as CipherSuite,Ee as DecapError,Pt as DeriveKeyPairError,rt as DeserializeError,_e as EncapError,Ae as ExportError,ct as HpkeError,et as InvalidParamError,tn as Kdf,vt as KdfId,Qr as Kem,Z as KemId,Se as MessageLimitReachedError,ft as NotSupportedError,ve as OpenError,ke as SealError,at as SerializeError,Jr as ValidationError}; /*! Bundled license information: @noble/ciphers/esm/utils.js: @@ -7,6 +7,9 @@ var Zn={},Dr=Xn(globalThis,Zn);function Xn(r,e){return new Proxy(r,{get(t,n,i){r @noble/hashes/esm/utils.js: (*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *) +@noble/hashes/esm/utils.js: + (*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *) + @noble/curves/esm/abstract/utils.js: (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)