@virgilsecurity/virgil-crypto-core 0.18.0-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +193 -0
- package/dist/foundation/browser.cjs.js +1 -0
- package/dist/foundation/browser.es.js +1 -0
- package/dist/foundation/libfoundation.browser.wasm +0 -0
- package/dist/foundation/libfoundation.wasm +0 -0
- package/dist/foundation/libfoundation.worker.wasm +0 -0
- package/dist/foundation/node.cjs.js +1 -0
- package/dist/foundation/node.es.mjs +1 -0
- package/dist/foundation/worker.cjs.js +1 -0
- package/dist/foundation/worker.es.js +1 -0
- package/dist/phe/browser.cjs.js +1 -0
- package/dist/phe/browser.es.js +1 -0
- package/dist/phe/libphe.browser.wasm +0 -0
- package/dist/phe/libphe.wasm +0 -0
- package/dist/phe/libphe.worker.wasm +0 -0
- package/dist/phe/node.cjs.js +1 -0
- package/dist/phe/node.es.mjs +1 -0
- package/dist/phe/worker.cjs.js +1 -0
- package/dist/phe/worker.es.js +1 -0
- package/dist/ratchet/browser.cjs.js +1 -0
- package/dist/ratchet/browser.es.js +1 -0
- package/dist/ratchet/libratchet.browser.wasm +0 -0
- package/dist/ratchet/libratchet.wasm +0 -0
- package/dist/ratchet/libratchet.worker.wasm +0 -0
- package/dist/ratchet/node.cjs.js +1 -0
- package/dist/ratchet/node.es.mjs +1 -0
- package/dist/ratchet/worker.cjs.js +1 -0
- package/dist/ratchet/worker.es.js +1 -0
- package/package.json +99 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function t(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var e,r,_,s,n,c,i,a,o,l,u,f,d,h,P,v,x,y,p,g={exports:{}};function m(){return e||(e=1,function(t){async function e(t={}){var e,r=t;e=self.location.href;var _,s,n="";try{n=new URL(".",e).href}catch{}s=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)},_=async t=>{if((t=await fetch(t,{credentials:"same-origin"})).ok)return t.arrayBuffer();throw Error(t.status+" : "+t.url)};var c,i,a,o,l,u,f,d,h,P,v=console.log.bind(console),x=console.error.bind(console),y=!1,p=!1;function g(){var t=pt.buffer;r.HEAP8=o=new Int8Array(t),r.HEAP16=u=new Int16Array(t),r.HEAPU8=l=new Uint8Array(t),r.HEAPU16=new Uint16Array(t),r.HEAP32=f=new Int32Array(t),r.HEAPU32=d=new Uint32Array(t),r.HEAPF32=new Float32Array(t),r.HEAPF64=new Float64Array(t),h=new BigInt64Array(t),new BigUint64Array(t)}function m(t){throw r.onAbort?.(t),x(t="Aborted("+t+")"),y=!0,t=new WebAssembly.RuntimeError(t+". Build with -sASSERTIONS for more info."),a?.(t),t}async function N(t,e){try{var r=await async function(t){if(!c)try{var e=await _(t);return new Uint8Array(e)}catch{}if(t==P&&c)t=new Uint8Array(c);else{if(!s)throw"both async and sync fetching of the wasm failed";t=s(t)}return t}(t);return await WebAssembly.instantiate(r,e)}catch(t){x(`failed to asynchronously prepare wasm: ${t}`),m(t)}}var I=t=>{for(;0<t.length;)t.shift()(r)},E=[],w=[],b=()=>{var t=r.preRun.shift();w.push(t)},k=()=>{var t=f[+yt>>2];return yt+=4,t},A=(t,e)=>{for(var r=0,_=t.length-1;0<=_;_--){var s=t[_];"."===s?t.splice(_,1):".."===s?(t.splice(_,1),r++):r&&(t.splice(_,1),r--)}if(e)for(;r;r--)t.unshift("..");return t},C=t=>{var e="/"===t.charAt(0),r="/"===t.slice(-1);return(t=A(t.split("/").filter(t=>!!t),!e).join("/"))||e||(t="."),t&&r&&(t+="/"),(e?"/":"")+t},F=t=>{var e=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(t).slice(1);return t=e[0],e=e[1],t||e?(e&&=e.slice(0,-1),t+e):"."},T=t=>{(T=t=>crypto.getRandomValues(t))(t)},K=globalThis.TextDecoder&&new TextDecoder,S=(t,e=0)=>{for(var r=e,_=r+void 0;t[r]&&!(r>=_);)++r;if(16<r-e&&t.buffer&&K)return K.decode(t.subarray(e,r));for(_="";e<r;){var s=t[e++];if(128&s){var n=63&t[e++];if(192==(224&s))_+=String.fromCharCode((31&s)<<6|n);else{var c=63&t[e++];65536>(s=224==(240&s)?(15&s)<<12|n<<6|c:(7&s)<<18|n<<12|c<<6|63&t[e++])?_+=String.fromCharCode(s):(s-=65536,_+=String.fromCharCode(55296|s>>10,56320|1023&s))}}else _+=String.fromCharCode(s)}return _},z=[],L=[];function R(t,e){L[t]={input:[],output:[],Ft:e},ot(t,B)}var B={open(t){var e=L[t.node.Qt];if(!e)throw new W(43);t.xt=e,t.seekable=!1},close(t){t.xt.Ft.Nt(t.xt)},Nt(t){t.xt.Ft.Nt(t.xt)},read(t,e,r,_){if(!t.xt||!t.xt.Ft.$t)throw new W(60);for(var s=0,n=0;n<_;n++){try{var c=t.xt.Ft.$t(t.xt)}catch(t){throw new W(29)}if(void 0===c&&0===s)throw new W(6);if(null==c)break;s++,e[r+n]=c}return s&&(t.node.Jt=Date.now()),s},write(t,e,r,_){if(!t.xt||!t.xt.Ft.Xt)throw new W(60);try{for(var s=0;s<_;s++)t.xt.Ft.Xt(t.xt,e[r+s])}catch(t){throw new W(29)}return _&&(t.node.At=t.node.zt=Date.now()),s}},Y={$t:()=>z.length?z.shift():null,Xt(t,e){null===e||10===e?(v(S(t.output)),t.output=[]):0!=e&&t.output.push(e)},Nt(t){0<t.output?.length&&(v(S(t.output)),t.output=[])},ju:()=>({tu:25856,vu:5,su:191,uu:35387,ru:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}),ku:()=>0,lu:()=>[24,80]},H={Xt(t,e){null===e||10===e?(x(S(t.output)),t.output=[]):0!=e&&t.output.push(e)},Nt(t){0<t.output?.length&&(x(S(t.output)),t.output=[])}},U={Ct:null,Et:()=>U.createNode(null,"/",16895,0),createNode(t,e,r,_){if(24576==(61440&r)||4096==(61440&r))throw new W(63);return U.Ct||(U.Ct={dir:{node:{It:U.wt.It,Dt:U.wt.Dt,Lt:U.wt.Lt,Ot:U.wt.Ot,eu:U.wt.eu,gu:U.wt.gu,fu:U.wt.fu,Yt:U.wt.Yt,Rt:U.wt.Rt},stream:{Bt:U.ut.Bt}},file:{node:{It:U.wt.It,Dt:U.wt.Dt},stream:{Bt:U.ut.Bt,read:U.ut.read,write:U.ut.write,bu:U.ut.bu,du:U.ut.du}},link:{node:{It:U.wt.It,Dt:U.wt.Dt,Mt:U.wt.Mt},stream:{}},Zt:{node:{It:U.wt.It,Dt:U.wt.Dt},stream:at}}),16384==(61440&(r=et(t,e,r,_)).mode)?(r.wt=U.Ct.dir.node,r.ut=U.Ct.dir.stream,r.vt={}):32768==(61440&r.mode)?(r.wt=U.Ct.file.node,r.ut=U.Ct.file.stream,r.yt=0,r.vt=null):40960==(61440&r.mode)?(r.wt=U.Ct.link.node,r.ut=U.Ct.link.stream):8192==(61440&r.mode)&&(r.wt=U.Ct.Zt.node,r.ut=U.Ct.Zt.stream),r.Jt=r.At=r.zt=Date.now(),t&&(t.vt[e]=r,t.Jt=t.At=t.zt=r.Jt),r},zu:t=>t.vt?t.vt.subarray?t.vt.subarray(0,t.yt):new Uint8Array(t.vt):new Uint8Array(0),wt:{It(t){var e={};return e.wu=8192==(61440&t.mode)?t.id:1,e.Bu=t.id,e.mode=t.mode,e.Cu=1,e.uid=0,e.Au=0,e.Qt=t.Qt,16384==(61440&t.mode)?e.size=4096:32768==(61440&t.mode)?e.size=t.yt:40960==(61440&t.mode)?e.size=t.link.length:e.size=0,e.Jt=new Date(t.Jt),e.At=new Date(t.At),e.zt=new Date(t.zt),e.hu=4096,e.qu=Math.ceil(e.size/e.hu),e},Dt(t,e){for(var r of["mode","atime","mtime","ctime"])null!=e[r]&&(t[r]=e[r]);void 0!==e.size&&(e=e.size,t.yt!=e&&(0==e?(t.vt=null,t.yt=0):(r=t.vt,t.vt=new Uint8Array(e),r&&t.vt.set(r.subarray(0,Math.min(e,t.yt))),t.yt=e)))},Lt(){throw U.Tt||(U.Tt=new W(44),U.Tt.stack="<generic error, no stack>"),U.Tt},Ot:(t,e,r,_)=>U.createNode(t,e,r,_),eu(t,e,r){try{var _=tt(e,r)}catch(t){}if(_){if(16384==(61440&t.mode))for(var s in _.vt)throw new W(55);if(s=J(_.parent.id,_.name),V[s]===_)V[s]=_.Kt;else for(s=V[s];s;){if(s.Kt===_){s.Kt=_.Kt;break}s=s.Kt}}delete t.parent.vt[t.name],e.vt[r]=t,t.name=r,e.zt=e.At=t.parent.zt=t.parent.At=Date.now()},gu(t,e){delete t.vt[e],t.zt=t.At=Date.now()},fu(t,e){var r,_=tt(t,e);for(r in _.vt)throw new W(55);delete t.vt[e],t.zt=t.At=Date.now()},Yt:t=>[".","..",...Object.keys(t.vt)],Rt:(t,e,r)=>((t=U.createNode(t,e,41471,0)).link=r,t),Mt(t){if(40960!=(61440&t.mode))throw new W(28);return t.link}},ut:{read(t,e,r,_,s){var n=t.node.vt;if(s>=t.node.yt)return 0;if(8<(t=Math.min(t.node.yt-s,_))&&n.subarray)e.set(n.subarray(s,s+t),r);else for(_=0;_<t;_++)e[r+_]=n[s+_];return t},write(t,e,r,_,s,n){if(e.buffer===o.buffer&&(n=!1),!_)return 0;if((t=t.node).At=t.zt=Date.now(),e.subarray&&(!t.vt||t.vt.subarray)){if(n)return t.vt=e.subarray(r,r+_),t.yt=_;if(0===t.yt&&0===s)return t.vt=e.slice(r,r+_),t.yt=_;if(s+_<=t.yt)return t.vt.set(e.subarray(r,r+_),s),_}n=s+_;var c=t.vt?t.vt.length:0;if(c>=n||(n=Math.max(n,c*(1048576>c?2:1.125)>>>0),0!=c&&(n=Math.max(n,256)),c=t.vt,t.vt=new Uint8Array(n),0<t.yt&&t.vt.set(c.subarray(0,t.yt),0)),t.vt.subarray&&e.subarray)t.vt.set(e.subarray(r,r+_),s);else for(n=0;n<_;n++)t.vt[s+n]=e[r+n];return t.yt=Math.max(t.yt,s+_),_},Bt(t,e,r){if(1===r?e+=t.position:2===r&&32768==(61440&t.node.mode)&&(e+=t.node.yt),0>e)throw new W(28);return e},bu(t,e,r,_,s){if(32768!=(61440&t.node.mode))throw new W(43);if(t=t.node.vt,2&s||!t||t.buffer!==o.buffer){if(_=!0,m(),!(s=void 0))throw new W(48);t&&((0<r||r+e<t.length)&&(t=t.subarray?t.subarray(r,r+e):Array.prototype.slice.call(t,r,r+e)),o.set(t,s))}else _=!1,s=t.byteOffset;return{Eu:s,pu:_}},du:(t,e,r,_)=>(U.ut.write(t,e,0,_,r,!1),0)}},M=null,D={},O=[],G=1,V=null,q=!1,j=!0,X={},W=class{name="ErrnoError";constructor(t){this.Gt=t}},Z=class{St={};node=null;get flags(){return this.St.flags}set flags(t){this.St.flags=t}get position(){return this.St.position}set position(t){this.St.position=t}},$=class{wt={};ut={};Pt=null;constructor(t,e,r,_){t||=this,this.parent=t,this.Et=t.Et,this.id=G++,this.name=e,this.mode=r,this.Qt=_,this.Jt=this.At=this.zt=Date.now()}get read(){return!(365&~this.mode)}set read(t){t?this.mode|=365:this.mode&=-366}get write(){return!(146&~this.mode)}set write(t){t?this.mode|=146:this.mode&=-147}};function Q(t,e={}){if(!t)throw new W(44);e.Vt??(e.Vt=!0),"/"===t.charAt(0)||(t="//"+t);var r=0;t:for(;40>r;r++){t=t.split("/").filter(t=>!!t);for(var _=M,s="/",n=0;n<t.length;n++){var c=n===t.length-1;if(c&&e.parent)break;if("."!==t[n])if(".."===t[n]){if(s=F(s),_===_.parent){t=s+"/"+t.slice(n+1).join("/"),r--;continue t}_=_.parent}else{s=C(s+"/"+t[n]);try{_=tt(_,t[n])}catch(t){if(44===t?.Gt&&c&&e.nu)return{path:s};throw t}if(!_.Pt||c&&!e.Vt||(_=_.Pt.root),40960==(61440&_.mode)&&(!c||e.Ut)){if(!_.wt.Mt)throw new W(52);"/"===(_=_.wt.Mt(_)).charAt(0)||(_=F(s)+"/"+_),t=_+"/"+t.slice(n+1).join("/");continue t}}}return{path:s,node:_}}throw new W(32)}function J(t,e){for(var r=0,_=0;_<e.length;_++)r=(r<<5)-r+e.charCodeAt(_)|0;return(t+r>>>0)%V.length}function tt(t,e){var r=16384==(61440&t.mode)?(r=_t(t,"x"))?r:t.wt.Lt?0:2:54;if(r)throw new W(r);for(r=V[J(t.id,e)];r;r=r.Kt){var _=r.name;if(r.parent.id===t.id&&_===e)return r}return t.wt.Lt(t,e)}function et(t,e,r,_){return e=J((t=new $(t,e,r,_)).parent.id,t.name),t.Kt=V[e],V[e]=t}function rt(t){var e=["r","w","rw"][3&t];return 512&t&&(e+="w"),e}function _t(t,e){return j?0:!e.includes("r")||292&t.mode?e.includes("w")&&!(146&t.mode)||e.includes("x")&&!(73&t.mode)?2:0:2}function st(t,e){if(16384!=(61440&t.mode))return 54;try{return tt(t,e),20}catch(t){}return _t(t,"wx")}function nt(t){if(!(t=O[t]))throw new W(8);return t}function ct(t,e=-1){if(t=Object.assign(new Z,t),-1==e)t:{for(e=0;4096>=e;e++)if(!O[e])break t;throw new W(33)}return t.Ht=e,O[e]=t}function it(t,e){var r=void 0,_=r?null:t;if(r??=t.wt.Dt,!r)throw new W(63);r(_,e)}var at={open(t){t.ut=D[t.node.Qt].ut,t.ut.open?.(t)},Bt(){throw new W(70)}};function ot(t,e){D[t]={ut:e}}function lt(t,e){var r="/"===e;if(r&&M)throw new W(10);if(!r&&e){var _=Q(e,{Vt:!1});if(e=_.path,(_=_.node).Pt)throw new W(10);if(16384!=(61440&_.mode))throw new W(54)}e={type:t,Du:{},cu:e,mu:[]},(t=t.Et(e)).Et=e,e.root=t,r?M=t:_&&(_.Pt=e,_.Et&&_.Et.mu.push(e))}function ut(t,e,r){var _=Q(t,{parent:!0}).node;if(!(t=t&&t.match(/([^\/]+|\/)\/*$/)[1]))throw new W(28);if("."===t||".."===t)throw new W(20);var s=st(_,t);if(s)throw new W(s);if(!_.wt.Ot)throw new W(63);return _.wt.Ot(_,t,e,r)}function ft(t){return ut(t,16895,0)}function dt(t,e,r){void 0===r&&(r=e,e=438),ut(t,8192|e,r)}function ht(t,e){if(!((...t)=>{for(var e="",r=!1,_=t.length-1;-1<=_&&!r;_--){if("string"!=typeof(r=0<=_?t[_]:"/"))throw new TypeError("Arguments to path.resolve must be strings");if(!r)return"";e=r+"/"+e,r="/"===r.charAt(0)}return(r?"/":"")+(e=A(e.split("/").filter(t=>!!t),!r).join("/"))||"."})(t))throw new W(44);var r=Q(e,{parent:!0}).node;if(!r)throw new W(44);var _=st(r,e=e&&e.match(/([^\/]+|\/)\/*$/)[1]);if(_)throw new W(_);if(!r.wt.Rt)throw new W(63);r.wt.Rt(r,e,t)}function Pt(t,e,_=438){if(""===t)throw new W(44);if("string"==typeof e){var s={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[e];if(void 0===s)throw Error(`Unknown file open mode: ${e}`);e=s}if(_=64&e?4095&_|32768:0,"object"==typeof t)s=t;else{var n=t.endsWith("/");s=(t=Q(t,{Ut:!(131072&e),nu:!0})).node,t=t.path}var c=!1;if(64&e)if(s){if(128&e)throw new W(20)}else{if(n)throw new W(31);s=ut(t,511|_,0),c=!0}if(!s)throw new W(44);if(8192==(61440&s.mode)&&(e&=-513),65536&e&&16384!=(61440&s.mode))throw new W(54);if(!c&&(n=s?40960==(61440&s.mode)?32:16384==(61440&s.mode)&&("r"!==rt(e)||576&e)?31:_t(s,rt(e)):44))throw new W(n);if(512&e&&!c){if(16384==(61440&(n="string"==typeof(n=s)?Q(n,{Ut:!0}).node:n).mode))throw new W(31);if(32768!=(61440&n.mode))throw new W(28);var i=_t(n,"w");if(i)throw new W(i);it(n,{size:0,timestamp:Date.now()})}e&=-131713;t:for(n=s;;){if(n===n.parent){n=n.Et.cu;var a=a?"/"!==n[n.length-1]?`${n}/${a}`:n+a:n;break t}a=a?`${n.name}/${a}`:n.name,n=n.parent}return(a=ct({node:s,path:a,flags:e,seekable:!0,position:0,ut:s.ut,ou:[],error:!1})).ut.open&&a.ut.open(a),c&&(_&=511,it(s="string"==typeof s?Q(s,{Ut:!0}).node:s,{mode:4095&_|-4096&s.mode,zt:Date.now(),xu:void 0})),!r.logReadFiles||1&e||t in X||(X[t]=1),a}function vt(t,e,r){if(null===t.Ht)throw new W(8);if(!t.seekable||!t.ut.Bt)throw new W(70);if(0!=r&&1!=r&&2!=r)throw new W(28);t.position=t.ut.Bt(t,e,r),t.ou=[]}function xt(t,e,r){t=C("/dev/"+t);var _=((t,e)=>{var r=0;return t&&(r|=365),e&&(r|=146),r})(!!e,!!r);xt.au??(xt.au=64);var s=xt.au++<<8;ot(s,{open(t){t.seekable=!1},close(){r?.buffer?.length&&r(10)},read(t,r,_,s){for(var n=0,c=0;c<s;c++){try{var i=e()}catch(t){throw new W(29)}if(void 0===i&&0===n)throw new W(6);if(null==i)break;n++,r[_+c]=i}return n&&(t.node.Jt=Date.now()),n},write(t,e,_,s){for(var n=0;n<s;n++)try{r(e[_+n])}catch(t){throw new W(29)}return s&&(t.node.At=t.node.zt=Date.now()),n}}),dt(t,_,s)}var yt=void 0;if(V=Array(4096),lt(U,"/"),ft("/tmp"),ft("/home"),ft("/home/web_user"),function(){ft("/dev"),ot(259,{read:()=>0,write:(t,e,r,_)=>_,Bt:()=>0}),dt("/dev/null",259),R(1280,Y),R(1536,H),dt("/dev/tty",1280),dt("/dev/tty1",1536);var t=new Uint8Array(1024),e=0,r=()=>(0===e&&(T(t),e=t.byteLength),t[--e]);xt("random",r),xt("urandom",r),ft("/dev/shm"),ft("/dev/shm/tmp")}(),function(){ft("/proc");var t=ft("/proc/self");ft("/proc/self/fd"),lt({Et(){var e=et(t,"fd",16895,73);return e.ut={Bt:U.ut.Bt},e.wt={Lt(t,e){var r=nt(t=+e);return(t={parent:null,Et:{cu:"fake"},wt:{Mt:()=>r.path},id:t+1}).parent=t},Yt:()=>Array.from(O.entries()).filter(([,t])=>t).map(([t])=>t.toString())},e}},"/proc/self/fd")}(),r.print&&(v=r.print),r.printErr&&(x=r.printErr),r.wasmBinary&&(c=r.wasmBinary),r.preInit)for("function"==typeof r.preInit&&(r.preInit=[r.preInit]);0<r.preInit.length;)r.preInit.shift()();var pt,gt,mt={b:function(t,e,r){yt=r;try{var _=nt(t);switch(e){case 0:var s=k();if(0>s)break;for(;O[s];)s++;return function(t,e=-1){return t=ct(t,e),t.ut?.yu?.(t),t}(_,s).Ht;case 1:case 2:case 13:case 14:return 0;case 3:return _.flags;case 4:return s=k(),_.flags|=s,0;case 12:return s=k(),u[s+0>>1]=2,0}return-28}catch(t){if("ErrnoError"!==t.name)throw t;return-t.Gt}},f:function(t,e,r){yt=r;try{var _=nt(t);switch(e){case 21509:case 21510:case 21511:case 21512:case 21524:case 21515:return _.xt?0:-59;case 21505:if(!_.xt)return-59;if(_.xt.Ft.ju){t=[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];var s=k();f[s>>2]=25856,f[s+4>>2]=5,f[s+8>>2]=191,f[s+12>>2]=35387;for(var n=0;32>n;n++)o[s+n+17]=t[n]||0}return 0;case 21506:case 21507:case 21508:if(!_.xt)return-59;if(_.xt.Ft.ku)for(s=k(),t=[],n=0;32>n;n++)t.push(o[s+n+17]);return 0;case 21519:return _.xt?(s=k(),f[s>>2]=0):-59;case 21520:return _.xt?-28:-59;case 21537:case 21531:if(s=k(),!_.ut.iu)throw new W(59);return _.ut.iu(_,e,s);case 21523:return _.xt?(_.xt.Ft.lu&&(n=[24,80],s=k(),u[s>>1]=n[0],u[s+2>>1]=n[1]),0):-59;default:return-28}}catch(t){if("ErrnoError"!==t.name)throw t;return-t.Gt}},g:function(t,e,r,_){yt=_;try{var s=e=e?S(l,e):"";if("/"===s.charAt(0))e=s;else{var n=-100===t?"/":nt(t).path;if(0==s.length)throw new W(44);e=n+"/"+s}return Pt(e,r,_?k():0).Ht}catch(t){if("ErrnoError"!==t.name)throw t;return-t.Gt}},i:()=>m(""),h:t=>{var e=l.length;if(2147483648<(t>>>=0))return!1;for(var r=1;4>=r;r*=2){var _=e*(1+.2/r);_=Math.min(_,t+100663296);t:{_=(Math.min(2147483648,65536*Math.ceil(Math.max(t,_)/65536))-pt.buffer.byteLength+65535)/65536|0;try{pt.grow(_),g();var s=1;break t}catch(t){}s=void 0}if(s)return!0}return!1},a:function(t){try{var e=nt(t);if(null===e.Ht)throw new W(8);e.Wt&&(e.Wt=null);try{e.ut.close&&e.ut.close(e)}catch(t){throw t}finally{O[e.Ht]=null}return e.Ht=null,0}catch(t){if("ErrnoError"!==t.name)throw t;return t.Gt}},d:function(t,e,r,_){try{t:{var s=nt(t);t=e;for(var n,c=e=0;c<r;c++){var i=d[t>>2],a=d[t+4>>2];t+=8;var l=s,u=i,f=a,h=n,P=o;if(0>f||0>h)throw new W(28);if(null===l.Ht)throw new W(8);if(1==(2097155&l.flags))throw new W(8);if(16384==(61440&l.node.mode))throw new W(31);if(!l.ut.read)throw new W(28);var v=void 0!==h;if(v){if(!l.seekable)throw new W(70)}else h=l.position;var x=l.ut.read(l,P,u,f,h);v||(l.position+=x);var y=x;if(0>y){var p=-1;break t}if(e+=y,y<a)break;void 0!==n&&(n+=y)}p=e}return d[_>>2]=p,0}catch(t){if("ErrnoError"!==t.name)throw t;return t.Gt}},e:function(t,e,r,_){e=-9007199254740992>e||9007199254740992<e?NaN:Number(e);try{if(isNaN(e))return 61;var s=nt(t);return vt(s,e,r),h[_>>3]=BigInt(s.position),s.Wt&&0===e&&0===r&&(s.Wt=null),0}catch(t){if("ErrnoError"!==t.name)throw t;return t.Gt}},c:function(t,e,r,_){try{t:{var s=nt(t);t=e;for(var n,c=e=0;c<r;c++){var i=d[t>>2],a=d[t+4>>2];t+=8;var l=s,u=i,f=a,h=n,P=o;if(0>f||0>h)throw new W(28);if(null===l.Ht)throw new W(8);if(!(2097155&l.flags))throw new W(8);if(16384==(61440&l.node.mode))throw new W(31);if(!l.ut.write)throw new W(28);l.seekable&&1024&l.flags&&vt(l,0,2);var v=void 0!==h;if(v){if(!l.seekable)throw new W(70)}else h=l.position;var x=l.ut.write(l,P,u,f,h,void 0);v||(l.position+=x);var y=x;if(0>y){var p=-1;break t}if(e+=y,y<a)break;void 0!==n&&(n+=y)}p=e}return d[_>>2]=p,0}catch(t){if("ErrnoError"!==t.name)throw t;return t.Gt}}};return gt=await async function(){function t(t){return t=gt=t.exports,r._vscf_impl_api=t.l,r._vscf_impl_tag=t.m,r._vscf_impl_shallow_copy=t.n,r._vscf_error_ctx_size=t.o,r._vscf_error_reset=t.p,r._vscf_error_status=t.q,r._vscf_oid_from_alg_id=t.r,r._vscf_oid_to_alg_id=t.s,r._vscf_oid_equal=t.t,r._vscf_oid_from_id=t.u,r._vscf_oid_to_id=t.v,r._vscf_oid_id_to_alg_id=t.w,r._vscf_base64_encoded_len=t.x,r._vscf_base64_encode=t.y,r._vscf_base64_decoded_len=t.z,r._vscf_base64_decode=t.A,r._vscf_pem_wrapped_len=t.B,r._vscf_pem_wrap=t.C,r._vscf_pem_unwrapped_len=t.D,r._vscf_pem_unwrap=t.E,r._vscf_pem_title=t.F,r._vscf_message_info_new=t.G,r._vscf_message_info_delete=t.H,r._vscf_message_info_shallow_copy=t.I,r._vscf_message_info_data_encryption_alg_info=t.J,r._vscf_message_info_key_recipient_info_list=t.K,r._vscf_message_info_password_recipient_info_list=t.L,r._vscf_message_info_has_custom_params=t.M,r._vscf_message_info_custom_params=t.N,r._vscf_message_info_has_cipher_kdf_alg_info=t.O,r._vscf_message_info_cipher_kdf_alg_info=t.P,r._vscf_message_info_has_cipher_padding_alg_info=t.Q,r._vscf_message_info_cipher_padding_alg_info=t.R,r._vscf_message_info_has_footer_info=t.S,r._vscf_message_info_footer_info=t.T,r._vscf_message_info_clear=t.U,r._vscf_key_recipient_info_new=t.V,r._vscf_key_recipient_info_new_with_data=t.W,r._vscf_key_recipient_info_delete=t.X,r._vscf_key_recipient_info_shallow_copy=t.Y,r._vscf_key_recipient_info_recipient_id=t.Z,r._vscf_key_recipient_info_key_encryption_algorithm=t._,r._vscf_key_recipient_info_encrypted_key=t.$,r._vscf_key_recipient_info_list_new=t.aa,r._vscf_key_recipient_info_list_delete=t.ba,r._vscf_key_recipient_info_list_shallow_copy=t.ca,r._vscf_key_recipient_info_list_has_item=t.da,r._vscf_key_recipient_info_list_item=t.ea,r._vscf_key_recipient_info_list_has_next=t.fa,r._vscf_key_recipient_info_list_next=t.ga,r._vscf_key_recipient_info_list_has_prev=t.ha,r._vscf_key_recipient_info_list_prev=t.ia,r._vscf_key_recipient_info_list_clear=t.ja,r._vscf_password_recipient_info_new=t.ka,r._vscf_password_recipient_info_new_with_members=t.la,r._vscf_password_recipient_info_delete=t.ma,r._vscf_password_recipient_info_shallow_copy=t.na,r._vscf_password_recipient_info_key_encryption_algorithm=t.oa,r._vscf_password_recipient_info_encrypted_key=t.pa,r._vscf_password_recipient_info_list_new=t.qa,r._vscf_password_recipient_info_list_delete=t.ra,r._vscf_password_recipient_info_list_shallow_copy=t.sa,r._vscf_password_recipient_info_list_has_item=t.ta,r._vscf_password_recipient_info_list_item=t.ua,r._vscf_password_recipient_info_list_has_next=t.va,r._vscf_password_recipient_info_list_next=t.wa,r._vscf_password_recipient_info_list_has_prev=t.xa,r._vscf_password_recipient_info_list_prev=t.ya,r._vscf_password_recipient_info_list_clear=t.za,r._vscf_alg_factory_create_hash_from_info=t.Aa,r._vscf_alg_factory_create_mac_from_info=t.Ba,r._vscf_alg_factory_create_kdf_from_info=t.Ca,r._vscf_alg_factory_create_salted_kdf_from_info=t.Da,r._vscf_alg_factory_create_cipher_from_info=t.Ea,r._vscf_alg_factory_create_padding_from_info=t.Fa,r._vscf_key_alg_factory_create_from_alg_id=t.Ga,r._vscf_key_alg_factory_create_from_key=t.Ha,r._vscf_key_alg_factory_create_from_raw_public_key=t.Ia,r._vscf_key_alg_factory_create_from_raw_private_key=t.Ja,r._vscf_ecies_release_random=t.Ka,r._vscf_ecies_release_cipher=t.La,r._vscf_ecies_release_mac=t.Ma,r._vscf_ecies_release_kdf=t.Na,r._vscf_ecies_release_ephemeral_key=t.Oa,r._vscf_ecies_new=t.Pa,r._vscf_ecies_delete=t.Qa,r._vscf_ecies_shallow_copy=t.Ra,r._vscf_ecies_use_random=t.Sa,r._vscf_ecies_use_cipher=t.Ta,r._vscf_ecies_use_mac=t.Ua,r._vscf_ecies_use_kdf=t.Va,r._vscf_ecies_use_ephemeral_key=t.Wa,r._vscf_ecies_set_key_alg=t.Xa,r._vscf_ecies_release_key_alg=t.Ya,r._vscf_ecies_setup_defaults=t.Za,r._vscf_ecies_setup_defaults_no_random=t._a,r._vscf_ecies_encrypted_len=t.$a,r._vscf_ecies_encrypt=t.ab,r._vscf_ecies_decrypted_len=t.bb,r._vscf_ecies_decrypt=t.cb,r._vscf_recipient_cipher_release_random=t.db,r._vscf_recipient_cipher_release_encryption_cipher=t.eb,r._vscf_recipient_cipher_release_encryption_padding=t.fb,r._vscf_recipient_cipher_release_padding_params=t.gb,r._vscf_recipient_cipher_release_signer_hash=t.hb,r._vscf_recipient_cipher_new=t.ib,r._vscf_recipient_cipher_delete=t.jb,r._vscf_recipient_cipher_shallow_copy=t.kb,r._vscf_recipient_cipher_use_random=t.lb,r._vscf_recipient_cipher_use_encryption_cipher=t.mb,r._vscf_recipient_cipher_use_encryption_padding=t.nb,r._vscf_recipient_cipher_use_padding_params=t.ob,r._vscf_recipient_cipher_use_signer_hash=t.pb,r._vscf_recipient_cipher_has_key_recipient=t.qb,r._vscf_recipient_cipher_add_key_recipient=t.rb,r._vscf_recipient_cipher_clear_recipients=t.sb,r._vscf_recipient_cipher_add_signer=t.tb,r._vscf_recipient_cipher_clear_signers=t.ub,r._vscf_recipient_cipher_custom_params=t.vb,r._vscf_recipient_cipher_start_encryption=t.wb,r._vscf_recipient_cipher_start_signed_encryption=t.xb,r._vscf_recipient_cipher_message_info_len=t.yb,r._vscf_recipient_cipher_pack_message_info=t.zb,r._vscf_recipient_cipher_encryption_out_len=t.Ab,r._vscf_recipient_cipher_message_info_footer_len=t.Bb,r._vscf_recipient_cipher_process_encryption=t.Cb,r._vscf_recipient_cipher_finish_encryption=t.Db,r._vscf_recipient_cipher_start_decryption_with_key=t.Eb,r._vscf_recipient_cipher_start_verified_decryption_with_key=t.Fb,r._vscf_recipient_cipher_decryption_out_len=t.Gb,r._vscf_recipient_cipher_process_decryption=t.Hb,r._vscf_recipient_cipher_finish_decryption=t.Ib,r._vscf_recipient_cipher_is_data_signed=t.Jb,r._vscf_recipient_cipher_signer_infos=t.Kb,r._vscf_recipient_cipher_verify_signer_info=t.Lb,r._vscf_recipient_cipher_pack_message_info_footer=t.Mb,r._vscf_message_info_custom_params_new=t.Nb,r._vscf_message_info_custom_params_delete=t.Ob,r._vscf_message_info_custom_params_shallow_copy=t.Pb,r._vscf_message_info_custom_params_add_int=t.Qb,r._vscf_message_info_custom_params_add_string=t.Rb,r._vscf_message_info_custom_params_add_data=t.Sb,r._vscf_message_info_custom_params_clear=t.Tb,r._vscf_message_info_custom_params_find_int=t.Ub,r._vscf_message_info_custom_params_find_string=t.Vb,r._vscf_message_info_custom_params_find_data=t.Wb,r._vscf_message_info_custom_params_has_params=t.Xb,r._vscf_key_provider_release_random=t.Yb,r._vscf_key_provider_new=t.Zb,r._vscf_key_provider_delete=t._b,r._vscf_key_provider_shallow_copy=t.$b,r._vscf_key_provider_use_random=t.ac,r._vscf_key_provider_setup_defaults=t.bc,r._vscf_key_provider_set_rsa_params=t.cc,r._vscf_key_provider_generate_private_key=t.dc,r._vscf_key_provider_generate_post_quantum_private_key=t.ec,r._vscf_key_provider_generate_compound_hybrid_private_key=t.fc,r._vscf_key_provider_generate_hybrid_private_key=t.gc,r._vscf_key_provider_generate_compound_private_key=t.hc,r._vscf_key_provider_import_private_key=t.ic,r._vscf_key_provider_import_public_key=t.jc,r._vscf_key_provider_exported_public_key_len=t.kc,r._vscf_key_provider_export_public_key=t.lc,r._vscf_key_provider_exported_private_key_len=t.mc,r._vscf_key_provider_export_private_key=t.nc,r._vscf_signer_release_hash=t.oc,r._vscf_signer_release_random=t.pc,r._vscf_signer_new=t.qc,r._vscf_signer_delete=t.rc,r._vscf_signer_shallow_copy=t.sc,r._vscf_signer_use_hash=t.tc,r._vscf_signer_use_random=t.uc,r._vscf_signer_reset=t.vc,r._vscf_signer_append_data=t.wc,r._vscf_signer_signature_len=t.xc,r._vscf_signer_sign=t.yc,r._vscf_verifier_new=t.zc,r._vscf_verifier_delete=t.Ac,r._vscf_verifier_shallow_copy=t.Bc,r._vscf_verifier_reset=t.Cc,r._vscf_verifier_append_data=t.Dc,r._vscf_verifier_verify=t.Ec,r._vscf_brainkey_client_release_random=t.Fc,r._vscf_brainkey_client_release_operation_random=t.Gc,r._vscf_brainkey_client_new=t.Hc,r._vscf_brainkey_client_delete=t.Ic,r._vscf_brainkey_client_shallow_copy=t.Jc,r._vscf_brainkey_client_use_random=t.Kc,r._vscf_brainkey_client_use_operation_random=t.Lc,r._vscf_brainkey_client_setup_defaults=t.Mc,r._vscf_brainkey_client_blind=t.Nc,r._vscf_brainkey_client_deblind=t.Oc,r._vscf_brainkey_server_release_random=t.Pc,r._vscf_brainkey_server_release_operation_random=t.Qc,r._vscf_brainkey_server_new=t.Rc,r._vscf_brainkey_server_delete=t.Sc,r._vscf_brainkey_server_shallow_copy=t.Tc,r._vscf_brainkey_server_use_random=t.Uc,r._vscf_brainkey_server_use_operation_random=t.Vc,r._vscf_brainkey_server_setup_defaults=t.Wc,r._vscf_brainkey_server_generate_identity_secret=t.Xc,r._vscf_brainkey_server_harden=t.Yc,r._vscf_group_session_message_new=t.Zc,r._vscf_group_session_message_delete=t._c,r._vscf_group_session_message_shallow_copy=t.$c,r._vscf_group_session_message_get_type=t.ad,r._vscf_group_session_message_get_session_id=t.bd,r._vscf_group_session_message_get_epoch=t.cd,r._vscf_group_session_message_serialize_len=t.dd,r._vscf_group_session_message_serialize=t.ed,r._vscf_group_session_message_deserialize=t.fd,r._vscf_group_session_ticket_release_rng=t.gd,r._vscf_group_session_ticket_new=t.hd,r._vscf_group_session_ticket_delete=t.id,r._vscf_group_session_ticket_shallow_copy=t.jd,r._vscf_group_session_ticket_use_rng=t.kd,r._vscf_group_session_ticket_setup_defaults=t.ld,r._vscf_group_session_ticket_setup_ticket_as_new=t.md,r._vscf_group_session_ticket_get_ticket_message=t.nd,r._vscf_group_session_release_rng=t.od,r._vscf_group_session_new=t.pd,r._vscf_group_session_delete=t.qd,r._vscf_group_session_shallow_copy=t.rd,r._vscf_group_session_use_rng=t.sd,r._vscf_group_session_get_current_epoch=t.td,r._vscf_group_session_setup_defaults=t.ud,r._vscf_group_session_get_session_id=t.vd,r._vscf_group_session_add_epoch=t.wd,r._vscf_group_session_encrypt=t.xd,r._vscf_group_session_decrypt_len=t.yd,r._vscf_group_session_decrypt=t.zd,r._vscf_group_session_create_group_ticket=t.Ad,r._vscf_message_info_editor_release_random=t.Bd,r._vscf_message_info_editor_new=t.Cd,r._vscf_message_info_editor_delete=t.Dd,r._vscf_message_info_editor_shallow_copy=t.Ed,r._vscf_message_info_editor_use_random=t.Fd,r._vscf_message_info_editor_setup_defaults=t.Gd,r._vscf_message_info_editor_unpack=t.Hd,r._vscf_message_info_editor_unlock=t.Id,r._vscf_message_info_editor_add_key_recipient=t.Jd,r._vscf_message_info_editor_remove_key_recipient=t.Kd,r._vscf_message_info_editor_remove_all=t.Ld,r._vscf_message_info_editor_packed_len=t.Md,r._vscf_message_info_editor_pack=t.Nd,r._vscf_signer_info_new=t.Od,r._vscf_signer_info_delete=t.Pd,r._vscf_signer_info_shallow_copy=t.Qd,r._vscf_signer_info_signer_id=t.Rd,r._vscf_signer_info_signer_alg_info=t.Sd,r._vscf_signer_info_signature=t.Td,r._vscf_signer_info_list_new=t.Ud,r._vscf_signer_info_list_delete=t.Vd,r._vscf_signer_info_list_shallow_copy=t.Wd,r._vscf_signer_info_list_has_item=t.Xd,r._vscf_signer_info_list_item=t.Yd,r._vscf_signer_info_list_has_next=t.Zd,r._vscf_signer_info_list_next=t._d,r._vscf_signer_info_list_has_prev=t.$d,r._vscf_signer_info_list_prev=t.ae,r._vscf_signer_info_list_clear=t.be,r._vscf_message_info_footer_new=t.ce,r._vscf_message_info_footer_delete=t.de,r._vscf_message_info_footer_shallow_copy=t.ee,r._vscf_message_info_footer_has_signer_infos=t.fe,r._vscf_message_info_footer_signer_infos=t.ge,r._vscf_message_info_footer_signer_hash_alg_info=t.he,r._vscf_message_info_footer_signer_digest=t.ie,r._vscf_signed_data_info_new=t.je,r._vscf_signed_data_info_delete=t.ke,r._vscf_signed_data_info_shallow_copy=t.le,r._vscf_signed_data_info_hash_alg_info=t.me,r._vscf_footer_info_new=t.ne,r._vscf_footer_info_delete=t.oe,r._vscf_footer_info_shallow_copy=t.pe,r._vscf_footer_info_has_signed_data_info=t.qe,r._vscf_footer_info_signed_data_info=t.re,r._vscf_footer_info_set_data_size=t.se,r._vscf_footer_info_data_size=t.te,r._vscf_key_info_new=t.ue,r._vscf_key_info_new_with_alg_info=t.ve,r._vscf_key_info_delete=t.we,r._vscf_key_info_shallow_copy=t.xe,r._vscf_key_info_is_compound=t.ye,r._vscf_key_info_is_hybrid=t.ze,r._vscf_key_info_is_compound_hybrid=t.Ae,r._vscf_key_info_is_compound_hybrid_cipher=t.Be,r._vscf_key_info_is_compound_hybrid_signer=t.Ce,r._vscf_key_info_is_hybrid_post_quantum=t.De,r._vscf_key_info_is_hybrid_post_quantum_cipher=t.Ee,r._vscf_key_info_is_hybrid_post_quantum_signer=t.Fe,r._vscf_key_info_alg_id=t.Ge,r._vscf_key_info_compound_cipher_alg_id=t.He,r._vscf_key_info_compound_signer_alg_id=t.Ie,r._vscf_key_info_hybrid_first_key_alg_id=t.Je,r._vscf_key_info_hybrid_second_key_alg_id=t.Ke,r._vscf_key_info_compound_hybrid_cipher_first_key_alg_id=t.Le,r._vscf_key_info_compound_hybrid_cipher_second_key_alg_id=t.Me,r._vscf_key_info_compound_hybrid_signer_first_key_alg_id=t.Ne,r._vscf_key_info_compound_hybrid_signer_second_key_alg_id=t.Oe,r._vscf_padding_params_new=t.Pe,r._vscf_padding_params_new_with_constraints=t.Qe,r._vscf_padding_params_delete=t.Re,r._vscf_padding_params_shallow_copy=t.Se,r._vscf_padding_params_frame=t.Te,r._vscf_padding_params_frame_max=t.Ue,r._vscf_sha224_alg_id=t.Ve,r._vscf_sha224_produce_alg_info=t.We,r._vscf_sha224_restore_alg_info=t.Xe,r._vscf_sha224_hash=t.Ye,r._vscf_sha224_finish=t.Ze,r._vscf_sha224_start=t._e,r._vscf_sha224_update=t.$e,r._vscf_sha224_new=t.af,r._vscf_sha224_delete=t.bf,r._vscf_sha224_shallow_copy=t.cf,r._vscf_sha256_alg_id=t.df,r._vscf_sha256_produce_alg_info=t.ef,r._vscf_sha256_restore_alg_info=t.ff,r._vscf_sha256_hash=t.gf,r._vscf_sha256_finish=t.hf,r._vscf_sha256_start=t.jf,r._vscf_sha256_update=t.kf,r._vscf_sha256_new=t.lf,r._vscf_sha256_delete=t.mf,r._vscf_sha256_shallow_copy=t.nf,r._vscf_sha384_alg_id=t.of,r._vscf_sha384_produce_alg_info=t.pf,r._vscf_sha384_restore_alg_info=t.qf,r._vscf_sha384_hash=t.rf,r._vscf_sha384_finish=t.sf,r._vscf_sha384_start=t.tf,r._vscf_sha384_update=t.uf,r._vscf_sha384_new=t.vf,r._vscf_sha384_delete=t.wf,r._vscf_sha384_shallow_copy=t.xf,r._vscf_sha512_alg_id=t.yf,r._vscf_sha512_produce_alg_info=t.zf,r._vscf_sha512_restore_alg_info=t.Af,r._vscf_sha512_hash=t.Bf,r._vscf_sha512_finish=t.Cf,r._vscf_sha512_start=t.Df,r._vscf_sha512_update=t.Ef,r._vscf_sha512_new=t.Ff,r._vscf_sha512_delete=t.Gf,r._vscf_sha512_shallow_copy=t.Hf,r._vscf_aes256_gcm_out_len=t.If,r._vscf_aes256_gcm_alg_id=t.Jf,r._vscf_aes256_gcm_produce_alg_info=t.Kf,r._vscf_aes256_gcm_restore_alg_info=t.Lf,r._vscf_aes256_gcm_set_nonce=t.Mf,r._vscf_aes256_gcm_encrypt=t.Nf,r._vscf_aes256_gcm_start_encryption=t.Of,r._vscf_aes256_gcm_update=t.Pf,r._vscf_aes256_gcm_finish_auth_decryption=t.Qf,r._vscf_aes256_gcm_finish_auth_encryption=t.Rf,r._vscf_aes256_gcm_encrypted_len=t.Sf,r._vscf_aes256_gcm_finish=t.Tf,r._vscf_aes256_gcm_precise_encrypted_len=t.Uf,r._vscf_aes256_gcm_decrypt=t.Vf,r._vscf_aes256_gcm_start_decryption=t.Wf,r._vscf_aes256_gcm_decrypted_len=t.Xf,r._vscf_aes256_gcm_set_key=t.Yf,r._vscf_aes256_gcm_state=t.Zf,r._vscf_aes256_gcm_decrypted_out_len=t._f,r._vscf_aes256_gcm_encrypted_out_len=t.$f,r._vscf_aes256_gcm_auth_encrypt=t.ag,r._vscf_aes256_gcm_auth_encrypted_len=t.bg,r._vscf_aes256_gcm_set_auth_data=t.cg,r._vscf_aes256_gcm_auth_decrypt=t.dg,r._vscf_aes256_gcm_auth_decrypted_len=t.eg,r._vscf_aes256_gcm_new=t.fg,r._vscf_aes256_gcm_delete=t.gg,r._vscf_aes256_gcm_shallow_copy=t.hg,r._vscf_aes256_cbc_alg_id=t.ig,r._vscf_aes256_cbc_produce_alg_info=t.jg,r._vscf_aes256_cbc_restore_alg_info=t.kg,r._vscf_aes256_cbc_set_nonce=t.lg,r._vscf_aes256_cbc_encrypt=t.mg,r._vscf_aes256_cbc_start_encryption=t.ng,r._vscf_aes256_cbc_update=t.og,r._vscf_aes256_cbc_finish=t.pg,r._vscf_aes256_cbc_encrypted_len=t.qg,r._vscf_aes256_cbc_precise_encrypted_len=t.rg,r._vscf_aes256_cbc_decrypt=t.sg,r._vscf_aes256_cbc_start_decryption=t.tg,r._vscf_aes256_cbc_decrypted_len=t.ug,r._vscf_aes256_cbc_set_key=t.vg,r._vscf_aes256_cbc_state=t.wg,r._vscf_aes256_cbc_out_len=t.xg,r._vscf_aes256_cbc_decrypted_out_len=t.yg,r._vscf_aes256_cbc_encrypted_out_len=t.zg,r._vscf_aes256_cbc_new=t.Ag,r._vscf_aes256_cbc_delete=t.Bg,r._vscf_aes256_cbc_shallow_copy=t.Cg,r._vscf_asn1rd_reset=t.Dg,r._vscf_asn1rd_left_len=t.Eg,r._vscf_asn1rd_has_error=t.Fg,r._vscf_asn1rd_status=t.Gg,r._vscf_asn1rd_get_tag=t.Hg,r._vscf_asn1rd_get_len=t.Ig,r._vscf_asn1rd_get_data_len=t.Jg,r._vscf_asn1rd_read_tag=t.Kg,r._vscf_asn1rd_read_context_tag=t.Lg,r._vscf_asn1rd_read_int=t.Mg,r._vscf_asn1rd_read_int64=t.Ng,r._vscf_asn1rd_read_int8=t.Og,r._vscf_asn1rd_read_int16=t.Pg,r._vscf_asn1rd_read_int32=t.Qg,r._vscf_asn1rd_read_uint=t.Rg,r._vscf_asn1rd_read_uint64=t.Sg,r._vscf_asn1rd_read_uint8=t.Tg,r._vscf_asn1rd_read_uint16=t.Ug,r._vscf_asn1rd_read_uint32=t.Vg,r._vscf_asn1rd_read_bool=t.Wg,r._vscf_asn1rd_read_null=t.Xg,r._vscf_asn1rd_read_null_optional=t.Yg,r._vscf_asn1rd_read_octet_str=t.Zg,r._vscf_asn1rd_read_bitstring_as_octet_str=t._g,r._vscf_asn1rd_read_utf8_str=t.$g,r._vscf_asn1rd_read_oid=t.ah,r._vscf_asn1rd_read_data=t.bh,r._vscf_asn1rd_read_sequence=t.ch,r._vscf_asn1rd_read_set=t.dh,r._vscf_asn1rd_new=t.eh,r._vscf_asn1rd_delete=t.fh,r._vscf_asn1rd_shallow_copy=t.gh,r._vscf_asn1wr_reset=t.hh,r._vscf_asn1wr_finish=t.ih,r._vscf_asn1wr_bytes=t.jh,r._vscf_asn1wr_len=t.kh,r._vscf_asn1wr_written_len=t.lh,r._vscf_asn1wr_unwritten_len=t.mh,r._vscf_asn1wr_has_error=t.nh,r._vscf_asn1wr_status=t.oh,r._vscf_asn1wr_reserve=t.ph,r._vscf_asn1wr_write_tag=t.qh,r._vscf_asn1wr_write_context_tag=t.rh,r._vscf_asn1wr_write_len=t.sh,r._vscf_asn1wr_write_int=t.th,r._vscf_asn1wr_write_int64=t.uh,r._vscf_asn1wr_write_int8=t.vh,r._vscf_asn1wr_write_int16=t.wh,r._vscf_asn1wr_write_int32=t.xh,r._vscf_asn1wr_write_uint=t.yh,r._vscf_asn1wr_write_uint64=t.zh,r._vscf_asn1wr_write_uint8=t.Ah,r._vscf_asn1wr_write_uint16=t.Bh,r._vscf_asn1wr_write_uint32=t.Ch,r._vscf_asn1wr_write_bool=t.Dh,r._vscf_asn1wr_write_null=t.Eh,r._vscf_asn1wr_write_octet_str=t.Fh,r._vscf_asn1wr_write_octet_str_as_bitstring=t.Gh,r._vscf_asn1wr_write_data=t.Hh,r._vscf_asn1wr_write_utf8_str=t.Ih,r._vscf_asn1wr_write_oid=t.Jh,r._vscf_asn1wr_write_sequence=t.Kh,r._vscf_asn1wr_write_set=t.Lh,r._vscf_asn1wr_new=t.Mh,r._vscf_asn1wr_delete=t.Nh,r._vscf_asn1wr_shallow_copy=t.Oh,r._vscf_rsa_public_key_key_exponent=t.Ph,r._vscf_rsa_public_key_is_valid=t.Qh,r._vscf_rsa_public_key_len=t.Rh,r._vscf_rsa_public_key_alg_id=t.Sh,r._vscf_rsa_public_key_alg_info=t.Th,r._vscf_rsa_public_key_bitlen=t.Uh,r._vscf_rsa_public_key_impl_tag=t.Vh,r._vscf_rsa_public_key_new=t.Wh,r._vscf_rsa_public_key_delete=t.Xh,r._vscf_rsa_public_key_shallow_copy=t.Yh,r._vscf_rsa_private_key_is_valid=t.Zh,r._vscf_rsa_private_key_len=t._h,r._vscf_rsa_private_key_alg_id=t.$h,r._vscf_rsa_private_key_alg_info=t.ai,r._vscf_rsa_private_key_bitlen=t.bi,r._vscf_rsa_private_key_impl_tag=t.ci,r._vscf_rsa_private_key_extract_public_key=t.di,r._vscf_rsa_private_key_new=t.ei,r._vscf_rsa_private_key_delete=t.fi,r._vscf_rsa_private_key_shallow_copy=t.gi,r._vscf_rsa_setup_defaults=t.hi,r._vscf_rsa_generate_key=t.ii,r._vscf_rsa_generate_ephemeral_key=t.ji,r._vscf_rsa_import_public_key=t.ki,r._vscf_rsa_import_public_key_data=t.li,r._vscf_rsa_export_public_key=t.mi,r._vscf_rsa_exported_public_key_data_len=t.ni,r._vscf_rsa_export_public_key_data=t.oi,r._vscf_rsa_import_private_key=t.pi,r._vscf_rsa_import_private_key_data=t.qi,r._vscf_rsa_export_private_key=t.ri,r._vscf_rsa_exported_private_key_data_len=t.si,r._vscf_rsa_export_private_key_data=t.ti,r._vscf_rsa_can_encrypt=t.ui,r._vscf_rsa_encrypted_len=t.vi,r._vscf_rsa_encrypt=t.wi,r._vscf_rsa_can_decrypt=t.xi,r._vscf_rsa_decrypted_len=t.yi,r._vscf_rsa_decrypt=t.zi,r._vscf_rsa_can_sign=t.Ai,r._vscf_rsa_signature_len=t.Bi,r._vscf_rsa_sign_hash=t.Ci,r._vscf_rsa_can_verify=t.Di,r._vscf_rsa_verify_hash=t.Ei,r._vscf_rsa_use_random=t.Fi,r._vscf_rsa_release_random=t.Gi,r._vscf_rsa_new=t.Hi,r._vscf_rsa_delete=t.Ii,r._vscf_rsa_shallow_copy=t.Ji,r._vscf_ecc_public_key_alg_id=t.Ki,r._vscf_ecc_public_key_alg_info=t.Li,r._vscf_ecc_public_key_len=t.Mi,r._vscf_ecc_public_key_bitlen=t.Ni,r._vscf_ecc_public_key_impl_tag=t.Oi,r._vscf_ecc_public_key_is_valid=t.Pi,r._vscf_ecc_public_key_new=t.Qi,r._vscf_ecc_public_key_delete=t.Ri,r._vscf_ecc_public_key_shallow_copy=t.Si,r._vscf_ecc_private_key_alg_id=t.Ti,r._vscf_ecc_private_key_alg_info=t.Ui,r._vscf_ecc_private_key_len=t.Vi,r._vscf_ecc_private_key_bitlen=t.Wi,r._vscf_ecc_private_key_impl_tag=t.Xi,r._vscf_ecc_private_key_is_valid=t.Yi,r._vscf_ecc_private_key_extract_public_key=t.Zi,r._vscf_ecc_private_key_new=t._i,r._vscf_ecc_private_key_delete=t.$i,r._vscf_ecc_private_key_shallow_copy=t.aj,r._vscf_ecc_setup_defaults=t.bj,r._vscf_ecc_generate_key=t.cj,r._vscf_ecc_generate_ephemeral_key=t.dj,r._vscf_ecc_import_public_key=t.ej,r._vscf_ecc_import_public_key_data=t.fj,r._vscf_ecc_export_public_key=t.gj,r._vscf_ecc_exported_public_key_data_len=t.hj,r._vscf_ecc_export_public_key_data=t.ij,r._vscf_ecc_import_private_key=t.jj,r._vscf_ecc_import_private_key_data=t.kj,r._vscf_ecc_export_private_key=t.lj,r._vscf_ecc_exported_private_key_data_len=t.mj,r._vscf_ecc_export_private_key_data=t.nj,r._vscf_ecc_can_encrypt=t.oj,r._vscf_ecc_encrypted_len=t.pj,r._vscf_ecc_encrypt=t.qj,r._vscf_ecc_can_decrypt=t.rj,r._vscf_ecc_decrypted_len=t.sj,r._vscf_ecc_decrypt=t.tj,r._vscf_ecc_can_sign=t.uj,r._vscf_ecc_signature_len=t.vj,r._vscf_ecc_sign_hash=t.wj,r._vscf_ecc_can_verify=t.xj,r._vscf_ecc_verify_hash=t.yj,r._vscf_ecc_compute_shared_key=t.zj,r._vscf_ecc_shared_key_len=t.Aj,r._vscf_ecc_kem_shared_key_len=t.Bj,r._vscf_ecc_kem_encapsulated_key_len=t.Cj,r._vscf_ecc_kem_encapsulate=t.Dj,r._vscf_ecc_kem_decapsulate=t.Ej,r._vscf_ecc_use_random=t.Fj,r._vscf_ecc_release_random=t.Gj,r._vscf_ecc_use_ecies=t.Hj,r._vscf_ecc_release_ecies=t.Ij,r._vscf_ecc_new=t.Jj,r._vscf_ecc_delete=t.Kj,r._vscf_ecc_shallow_copy=t.Lj,r._vscf_entropy_accumulator_setup_defaults=t.Mj,r._vscf_entropy_accumulator_add_source=t.Nj,r._vscf_entropy_accumulator_is_strong=t.Oj,r._vscf_entropy_accumulator_gather=t.Pj,r._vscf_entropy_accumulator_new=t.Qj,r._vscf_entropy_accumulator_delete=t.Rj,r._vscf_entropy_accumulator_shallow_copy=t.Sj,r._vscf_ctr_drbg_setup_defaults=t.Tj,r._vscf_ctr_drbg_enable_prediction_resistance=t.Uj,r._vscf_ctr_drbg_set_reseed_interval=t.Vj,r._vscf_ctr_drbg_set_entropy_len=t.Wj,r._vscf_ctr_drbg_random=t.Xj,r._vscf_ctr_drbg_reseed=t.Yj,r._vscf_ctr_drbg_use_entropy_source=t.Zj,r._vscf_ctr_drbg_release_entropy_source=t._j,r._vscf_ctr_drbg_new=t.$j,r._vscf_ctr_drbg_delete=t.ak,r._vscf_ctr_drbg_shallow_copy=t.bk,r._vscf_hmac_alg_id=t.ck,r._vscf_hmac_produce_alg_info=t.dk,r._vscf_hmac_restore_alg_info=t.ek,r._vscf_hmac_digest_len=t.fk,r._vscf_hmac_mac=t.gk,r._vscf_hmac_start=t.hk,r._vscf_hmac_finish=t.ik,r._vscf_hmac_update=t.jk,r._vscf_hmac_reset=t.kk,r._vscf_hmac_use_hash=t.lk,r._vscf_hmac_release_hash=t.mk,r._vscf_hmac_new=t.nk,r._vscf_hmac_delete=t.ok,r._vscf_hmac_shallow_copy=t.pk,r._vscf_hkdf_alg_id=t.qk,r._vscf_hkdf_produce_alg_info=t.rk,r._vscf_hkdf_restore_alg_info=t.sk,r._vscf_hkdf_derive=t.tk,r._vscf_hkdf_reset=t.uk,r._vscf_hkdf_set_info=t.vk,r._vscf_hkdf_use_hash=t.wk,r._vscf_hkdf_release_hash=t.xk,r._vscf_hkdf_new=t.yk,r._vscf_hkdf_delete=t.zk,r._vscf_hkdf_shallow_copy=t.Ak,r._vscf_kdf1_alg_id=t.Bk,r._vscf_kdf1_produce_alg_info=t.Ck,r._vscf_kdf1_restore_alg_info=t.Dk,r._vscf_kdf1_derive=t.Ek,r._vscf_kdf1_use_hash=t.Fk,r._vscf_kdf1_release_hash=t.Gk,r._vscf_kdf1_new=t.Hk,r._vscf_kdf1_delete=t.Ik,r._vscf_kdf1_shallow_copy=t.Jk,r._vscf_kdf2_alg_id=t.Kk,r._vscf_kdf2_produce_alg_info=t.Lk,r._vscf_kdf2_restore_alg_info=t.Mk,r._vscf_kdf2_derive=t.Nk,r._vscf_kdf2_use_hash=t.Ok,r._vscf_kdf2_release_hash=t.Pk,r._vscf_kdf2_new=t.Qk,r._vscf_kdf2_delete=t.Rk,r._vscf_kdf2_shallow_copy=t.Sk,r._vscf_fake_random_setup_source_byte=t.Tk,r._vscf_fake_random_setup_source_data=t.Uk,r._vscf_fake_random_random=t.Vk,r._vscf_fake_random_reseed=t.Wk,r._vscf_fake_random_is_strong=t.Xk,r._vscf_fake_random_gather=t.Yk,r._vscf_fake_random_new=t.Zk,r._vscf_fake_random_delete=t._k,r._vscf_fake_random_shallow_copy=t.$k,r._vscf_pkcs5_pbkdf2_setup_defaults=t.al,r._vscf_pkcs5_pbkdf2_alg_id=t.bl,r._vscf_pkcs5_pbkdf2_produce_alg_info=t.cl,r._vscf_pkcs5_pbkdf2_restore_alg_info=t.dl,r._vscf_pkcs5_pbkdf2_reset=t.el,r._vscf_pkcs5_pbkdf2_derive=t.fl,r._vscf_pkcs5_pbkdf2_set_info=t.gl,r._vscf_pkcs5_pbkdf2_use_hmac=t.hl,r._vscf_pkcs5_pbkdf2_release_hmac=t.il,r._vscf_pkcs5_pbkdf2_new=t.jl,r._vscf_pkcs5_pbkdf2_delete=t.kl,r._vscf_pkcs5_pbkdf2_shallow_copy=t.ll,r._vscf_pkcs5_pbes2_reset=t.ml,r._vscf_pkcs5_pbes2_alg_id=t.nl,r._vscf_pkcs5_pbes2_produce_alg_info=t.ol,r._vscf_pkcs5_pbes2_restore_alg_info=t.pl,r._vscf_pkcs5_pbes2_encrypt=t.ql,r._vscf_pkcs5_pbes2_encrypted_len=t.rl,r._vscf_pkcs5_pbes2_precise_encrypted_len=t.sl,r._vscf_pkcs5_pbes2_decrypt=t.tl,r._vscf_pkcs5_pbes2_decrypted_len=t.ul,r._vscf_pkcs5_pbes2_use_kdf=t.vl,r._vscf_pkcs5_pbes2_release_kdf=t.wl,r._vscf_pkcs5_pbes2_use_cipher=t.xl,r._vscf_pkcs5_pbes2_release_cipher=t.yl,r._vscf_pkcs5_pbes2_new=t.zl,r._vscf_pkcs5_pbes2_delete=t.Al,r._vscf_pkcs5_pbes2_shallow_copy=t.Bl,r._vscf_seed_entropy_source_reset_seed=t.Cl,r._vscf_seed_entropy_source_is_strong=t.Dl,r._vscf_seed_entropy_source_gather=t.El,r._vscf_seed_entropy_source_new=t.Fl,r._vscf_seed_entropy_source_delete=t.Gl,r._vscf_seed_entropy_source_shallow_copy=t.Hl,r._vscf_key_material_rng_reset_key_material=t.Il,r._vscf_key_material_rng_random=t.Jl,r._vscf_key_material_rng_reseed=t.Kl,r._vscf_key_material_rng_new=t.Ll,r._vscf_key_material_rng_delete=t.Ml,r._vscf_key_material_rng_shallow_copy=t.Nl,r._vscf_raw_public_key_data=t.Ol,r._vscf_raw_public_key_alg_id=t.Pl,r._vscf_raw_public_key_alg_info=t.Ql,r._vscf_raw_public_key_len=t.Rl,r._vscf_raw_public_key_bitlen=t.Sl,r._vscf_raw_public_key_impl_tag=t.Tl,r._vscf_raw_public_key_is_valid=t.Ul,r._vscf_raw_public_key_new=t.Vl,r._vscf_raw_public_key_delete=t.Wl,r._vscf_raw_public_key_shallow_copy=t.Xl,r._vscf_raw_private_key_data=t.Yl,r._vscf_raw_private_key_has_public_key=t.Zl,r._vscf_raw_private_key_set_public_key=t._l,r._vscf_raw_private_key_get_public_key=t.$l,r._vscf_raw_private_key_alg_id=t.am,r._vscf_raw_private_key_alg_info=t.bm,r._vscf_raw_private_key_len=t.cm,r._vscf_raw_private_key_bitlen=t.dm,r._vscf_raw_private_key_impl_tag=t.em,r._vscf_raw_private_key_is_valid=t.fm,r._vscf_raw_private_key_extract_public_key=t.gm,r._vscf_raw_private_key_new=t.hm,r._vscf_raw_private_key_delete=t.im,r._vscf_raw_private_key_shallow_copy=t.jm,r._vscf_pkcs8_serializer_setup_defaults=t.km,r._vscf_pkcs8_serializer_serialize_public_key_inplace=t.lm,r._vscf_pkcs8_serializer_serialized_public_key_len=t.mm,r._vscf_pkcs8_serializer_serialize_private_key_inplace=t.nm,r._vscf_pkcs8_serializer_serialized_private_key_len=t.om,r._vscf_pkcs8_serializer_serialize_public_key=t.pm,r._vscf_pkcs8_serializer_serialize_private_key=t.qm,r._vscf_pkcs8_serializer_use_asn1_writer=t.rm,r._vscf_pkcs8_serializer_release_asn1_writer=t.sm,r._vscf_pkcs8_serializer_new=t.tm,r._vscf_pkcs8_serializer_delete=t.um,r._vscf_pkcs8_serializer_shallow_copy=t.vm,r._vscf_sec1_serializer_setup_defaults=t.wm,r._vscf_sec1_serializer_serialize_public_key_inplace=t.xm,r._vscf_sec1_serializer_serialized_public_key_len=t.ym,r._vscf_sec1_serializer_serialize_private_key_inplace=t.zm,r._vscf_sec1_serializer_serialized_private_key_len=t.Am,r._vscf_sec1_serializer_serialize_public_key=t.Bm,r._vscf_sec1_serializer_serialize_private_key=t.Cm,r._vscf_sec1_serializer_use_asn1_writer=t.Dm,r._vscf_sec1_serializer_release_asn1_writer=t.Em,r._vscf_sec1_serializer_new=t.Fm,r._vscf_sec1_serializer_delete=t.Gm,r._vscf_sec1_serializer_shallow_copy=t.Hm,r._vscf_key_asn1_serializer_setup_defaults=t.Im,r._vscf_key_asn1_serializer_serialize_public_key_inplace=t.Jm,r._vscf_key_asn1_serializer_serialized_public_key_len=t.Km,r._vscf_key_asn1_serializer_serialize_private_key_inplace=t.Lm,r._vscf_key_asn1_serializer_serialized_private_key_len=t.Mm,r._vscf_key_asn1_serializer_serialize_public_key=t.Nm,r._vscf_key_asn1_serializer_serialize_private_key=t.Om,r._vscf_key_asn1_serializer_use_asn1_writer=t.Pm,r._vscf_key_asn1_serializer_release_asn1_writer=t.Qm,r._vscf_key_asn1_serializer_new=t.Rm,r._vscf_key_asn1_serializer_delete=t.Sm,r._vscf_key_asn1_serializer_shallow_copy=t.Tm,r._vscf_key_asn1_deserializer_setup_defaults=t.Um,r._vscf_key_asn1_deserializer_deserialize_public_key_inplace=t.Vm,r._vscf_key_asn1_deserializer_deserialize_private_key_inplace=t.Wm,r._vscf_key_asn1_deserializer_deserialize_public_key=t.Xm,r._vscf_key_asn1_deserializer_deserialize_private_key=t.Ym,r._vscf_key_asn1_deserializer_use_asn1_reader=t.Zm,r._vscf_key_asn1_deserializer_release_asn1_reader=t._m,r._vscf_key_asn1_deserializer_new=t.$m,r._vscf_key_asn1_deserializer_delete=t.an,r._vscf_key_asn1_deserializer_shallow_copy=t.bn,r._vscf_ed25519_setup_defaults=t.cn,r._vscf_ed25519_generate_key=t.dn,r._vscf_ed25519_generate_ephemeral_key=t.en,r._vscf_ed25519_import_public_key=t.fn,r._vscf_ed25519_import_public_key_data=t.gn,r._vscf_ed25519_export_public_key=t.hn,r._vscf_ed25519_exported_public_key_data_len=t.jn,r._vscf_ed25519_export_public_key_data=t.kn,r._vscf_ed25519_import_private_key=t.ln,r._vscf_ed25519_import_private_key_data=t.mn,r._vscf_ed25519_export_private_key=t.nn,r._vscf_ed25519_exported_private_key_data_len=t.on,r._vscf_ed25519_export_private_key_data=t.pn,r._vscf_ed25519_can_encrypt=t.qn,r._vscf_ed25519_encrypted_len=t.rn,r._vscf_ed25519_encrypt=t.sn,r._vscf_ed25519_can_decrypt=t.tn,r._vscf_ed25519_decrypted_len=t.un,r._vscf_ed25519_decrypt=t.vn,r._vscf_ed25519_can_sign=t.wn,r._vscf_ed25519_signature_len=t.xn,r._vscf_ed25519_sign_hash=t.yn,r._vscf_ed25519_can_verify=t.zn,r._vscf_ed25519_verify_hash=t.An,r._vscf_ed25519_compute_shared_key=t.Bn,r._vscf_ed25519_shared_key_len=t.Cn,r._vscf_ed25519_kem_shared_key_len=t.Dn,r._vscf_ed25519_kem_encapsulated_key_len=t.En,r._vscf_ed25519_kem_encapsulate=t.Fn,r._vscf_ed25519_kem_decapsulate=t.Gn,r._vscf_ed25519_use_random=t.Hn,r._vscf_ed25519_release_random=t.In,r._vscf_ed25519_use_ecies=t.Jn,r._vscf_ed25519_release_ecies=t.Kn,r._vscf_ed25519_new=t.Ln,r._vscf_ed25519_delete=t.Mn,r._vscf_ed25519_shallow_copy=t.Nn,r._vscf_curve25519_setup_defaults=t.On,r._vscf_curve25519_generate_key=t.Pn,r._vscf_curve25519_generate_ephemeral_key=t.Qn,r._vscf_curve25519_import_public_key=t.Rn,r._vscf_curve25519_import_public_key_data=t.Sn,r._vscf_curve25519_export_public_key=t.Tn,r._vscf_curve25519_exported_public_key_data_len=t.Un,r._vscf_curve25519_export_public_key_data=t.Vn,r._vscf_curve25519_import_private_key=t.Wn,r._vscf_curve25519_import_private_key_data=t.Xn,r._vscf_curve25519_export_private_key=t.Yn,r._vscf_curve25519_exported_private_key_data_len=t.Zn,r._vscf_curve25519_export_private_key_data=t._n,r._vscf_curve25519_can_encrypt=t.$n,r._vscf_curve25519_encrypted_len=t.ao,r._vscf_curve25519_encrypt=t.bo,r._vscf_curve25519_can_decrypt=t.co,r._vscf_curve25519_decrypted_len=t.eo,r._vscf_curve25519_decrypt=t.fo,r._vscf_curve25519_compute_shared_key=t.go,r._vscf_curve25519_shared_key_len=t.ho,r._vscf_curve25519_kem_shared_key_len=t.io,r._vscf_curve25519_kem_encapsulated_key_len=t.jo,r._vscf_curve25519_kem_encapsulate=t.ko,r._vscf_curve25519_kem_decapsulate=t.lo,r._vscf_curve25519_use_random=t.mo,r._vscf_curve25519_release_random=t.no,r._vscf_curve25519_use_ecies=t.oo,r._vscf_curve25519_release_ecies=t.po,r._vscf_curve25519_new=t.qo,r._vscf_curve25519_delete=t.ro,r._vscf_curve25519_shallow_copy=t.so,r._vscf_falcon_setup_defaults=t.to,r._vscf_falcon_generate_key=t.uo,r._vscf_falcon_produce_alg_info=t.vo,r._vscf_falcon_alg_id=t.wo,r._vscf_falcon_restore_alg_info=t.xo,r._vscf_falcon_generate_ephemeral_key=t.yo,r._vscf_falcon_import_public_key=t.zo,r._vscf_falcon_import_public_key_data=t.Ao,r._vscf_falcon_export_public_key=t.Bo,r._vscf_falcon_exported_public_key_data_len=t.Co,r._vscf_falcon_export_public_key_data=t.Do,r._vscf_falcon_import_private_key=t.Eo,r._vscf_falcon_import_private_key_data=t.Fo,r._vscf_falcon_export_private_key=t.Go,r._vscf_falcon_exported_private_key_data_len=t.Ho,r._vscf_falcon_export_private_key_data=t.Io,r._vscf_falcon_can_sign=t.Jo,r._vscf_falcon_signature_len=t.Ko,r._vscf_falcon_sign_hash=t.Lo,r._vscf_falcon_can_verify=t.Mo,r._vscf_falcon_verify_hash=t.No,r._vscf_falcon_use_random=t.Oo,r._vscf_falcon_release_random=t.Po,r._vscf_falcon_new=t.Qo,r._vscf_falcon_delete=t.Ro,r._vscf_falcon_shallow_copy=t.So,r._vscf_round5_setup_defaults=t.To,r._vscf_round5_generate_key=t.Uo,r._vscf_round5_generate_ephemeral_key=t.Vo,r._vscf_round5_import_public_key=t.Wo,r._vscf_round5_import_public_key_data=t.Xo,r._vscf_round5_export_public_key=t.Yo,r._vscf_round5_exported_public_key_data_len=t.Zo,r._vscf_round5_export_public_key_data=t._o,r._vscf_round5_import_private_key=t.$o,r._vscf_round5_import_private_key_data=t.ap,r._vscf_round5_export_private_key=t.bp,r._vscf_round5_exported_private_key_data_len=t.cp,r._vscf_round5_export_private_key_data=t.dp,r._vscf_round5_kem_shared_key_len=t.ep,r._vscf_round5_kem_encapsulated_key_len=t.fp,r._vscf_round5_kem_encapsulate=t.gp,r._vscf_round5_kem_decapsulate=t.hp,r._vscf_round5_use_random=t.ip,r._vscf_round5_release_random=t.jp,r._vscf_round5_new=t.kp,r._vscf_round5_delete=t.lp,r._vscf_round5_shallow_copy=t.mp,r._vscf_compound_key_alg_info_cipher_alg_info=t.np,r._vscf_compound_key_alg_info_signer_alg_info=t.op,r._vscf_compound_key_alg_info_alg_id=t.pp,r._vscf_compound_key_alg_info_new=t.qp,r._vscf_compound_key_alg_info_delete=t.rp,r._vscf_compound_key_alg_info_shallow_copy=t.sp,r._vscf_compound_public_key_cipher_key=t.tp,r._vscf_compound_public_key_signer_key=t.up,r._vscf_compound_public_key_alg_id=t.vp,r._vscf_compound_public_key_alg_info=t.wp,r._vscf_compound_public_key_len=t.xp,r._vscf_compound_public_key_bitlen=t.yp,r._vscf_compound_public_key_impl_tag=t.zp,r._vscf_compound_public_key_is_valid=t.Ap,r._vscf_compound_public_key_new=t.Bp,r._vscf_compound_public_key_delete=t.Cp,r._vscf_compound_public_key_shallow_copy=t.Dp,r._vscf_compound_private_key_cipher_key=t.Ep,r._vscf_compound_private_key_signer_key=t.Fp,r._vscf_compound_private_key_alg_id=t.Gp,r._vscf_compound_private_key_alg_info=t.Hp,r._vscf_compound_private_key_len=t.Ip,r._vscf_compound_private_key_bitlen=t.Jp,r._vscf_compound_private_key_impl_tag=t.Kp,r._vscf_compound_private_key_is_valid=t.Lp,r._vscf_compound_private_key_extract_public_key=t.Mp,r._vscf_compound_private_key_new=t.Np,r._vscf_compound_private_key_delete=t.Op,r._vscf_compound_private_key_shallow_copy=t.Pp,r._vscf_compound_key_alg_setup_defaults=t.Qp,r._vscf_compound_key_alg_make_key=t.Rp,r._vscf_compound_key_alg_alg_id=t.Sp,r._vscf_compound_key_alg_produce_alg_info=t.Tp,r._vscf_compound_key_alg_restore_alg_info=t.Up,r._vscf_compound_key_alg_generate_ephemeral_key=t.Vp,r._vscf_compound_key_alg_import_public_key=t.Wp,r._vscf_compound_key_alg_import_public_key_data=t.Xp,r._vscf_compound_key_alg_export_public_key=t.Yp,r._vscf_compound_key_alg_exported_public_key_data_len=t.Zp,r._vscf_compound_key_alg_export_public_key_data=t._p,r._vscf_compound_key_alg_import_private_key=t.$p,r._vscf_compound_key_alg_import_private_key_data=t.aq,r._vscf_compound_key_alg_export_private_key=t.bq,r._vscf_compound_key_alg_exported_private_key_data_len=t.cq,r._vscf_compound_key_alg_export_private_key_data=t.dq,r._vscf_compound_key_alg_can_encrypt=t.eq,r._vscf_compound_key_alg_encrypted_len=t.fq,r._vscf_compound_key_alg_encrypt=t.gq,r._vscf_compound_key_alg_can_decrypt=t.hq,r._vscf_compound_key_alg_decrypted_len=t.iq,r._vscf_compound_key_alg_decrypt=t.jq,r._vscf_compound_key_alg_can_sign=t.kq,r._vscf_compound_key_alg_signature_len=t.lq,r._vscf_compound_key_alg_sign_hash=t.mq,r._vscf_compound_key_alg_can_verify=t.nq,r._vscf_compound_key_alg_verify_hash=t.oq,r._vscf_compound_key_alg_use_random=t.pq,r._vscf_compound_key_alg_release_random=t.qq,r._vscf_compound_key_alg_new=t.rq,r._vscf_compound_key_alg_delete=t.sq,r._vscf_compound_key_alg_shallow_copy=t.tq,r._vscf_hybrid_key_alg_info_first_key_alg_info=t.uq,r._vscf_hybrid_key_alg_info_second_key_alg_info=t.vq,r._vscf_hybrid_key_alg_info_alg_id=t.wq,r._vscf_hybrid_key_alg_info_new=t.xq,r._vscf_hybrid_key_alg_info_delete=t.yq,r._vscf_hybrid_key_alg_info_shallow_copy=t.zq,r._vscf_hybrid_public_key_first_key=t.Aq,r._vscf_hybrid_public_key_second_key=t.Bq,r._vscf_hybrid_public_key_alg_id=t.Cq,r._vscf_hybrid_public_key_alg_info=t.Dq,r._vscf_hybrid_public_key_len=t.Eq,r._vscf_hybrid_public_key_bitlen=t.Fq,r._vscf_hybrid_public_key_impl_tag=t.Gq,r._vscf_hybrid_public_key_is_valid=t.Hq,r._vscf_hybrid_public_key_new=t.Iq,r._vscf_hybrid_public_key_delete=t.Jq,r._vscf_hybrid_public_key_shallow_copy=t.Kq,r._vscf_hybrid_private_key_first_key=t.Lq,r._vscf_hybrid_private_key_second_key=t.Mq,r._vscf_hybrid_private_key_alg_id=t.Nq,r._vscf_hybrid_private_key_alg_info=t.Oq,r._vscf_hybrid_private_key_len=t.Pq,r._vscf_hybrid_private_key_bitlen=t.Qq,r._vscf_hybrid_private_key_impl_tag=t.Rq,r._vscf_hybrid_private_key_is_valid=t.Sq,r._vscf_hybrid_private_key_extract_public_key=t.Tq,r._vscf_hybrid_private_key_new=t.Uq,r._vscf_hybrid_private_key_delete=t.Vq,r._vscf_hybrid_private_key_shallow_copy=t.Wq,r._vscf_hybrid_key_alg_setup_defaults=t.Xq,r._vscf_hybrid_key_alg_make_key=t.Yq,r._vscf_hybrid_key_alg_generate_ephemeral_key=t.Zq,r._vscf_hybrid_key_alg_import_public_key=t._q,r._vscf_hybrid_key_alg_import_public_key_data=t.$q,r._vscf_hybrid_key_alg_export_public_key=t.ar,r._vscf_hybrid_key_alg_exported_public_key_data_len=t.br,r._vscf_hybrid_key_alg_export_public_key_data=t.cr,r._vscf_hybrid_key_alg_import_private_key=t.dr,r._vscf_hybrid_key_alg_import_private_key_data=t.er,r._vscf_hybrid_key_alg_export_private_key=t.fr,r._vscf_hybrid_key_alg_exported_private_key_data_len=t.gr,r._vscf_hybrid_key_alg_export_private_key_data=t.hr,r._vscf_hybrid_key_alg_can_encrypt=t.ir,r._vscf_hybrid_key_alg_encrypted_len=t.jr,r._vscf_hybrid_key_alg_encrypt=t.kr,r._vscf_hybrid_key_alg_can_decrypt=t.lr,r._vscf_hybrid_key_alg_decrypted_len=t.mr,r._vscf_hybrid_key_alg_decrypt=t.nr,r._vscf_hybrid_key_alg_can_sign=t.or,r._vscf_hybrid_key_alg_signature_len=t.pr,r._vscf_hybrid_key_alg_sign_hash=t.qr,r._vscf_hybrid_key_alg_can_verify=t.rr,r._vscf_hybrid_key_alg_verify_hash=t.sr,r._vscf_hybrid_key_alg_use_random=t.tr,r._vscf_hybrid_key_alg_release_random=t.ur,r._vscf_hybrid_key_alg_use_cipher=t.vr,r._vscf_hybrid_key_alg_release_cipher=t.wr,r._vscf_hybrid_key_alg_use_hash=t.xr,r._vscf_hybrid_key_alg_release_hash=t.yr,r._vscf_hybrid_key_alg_new=t.zr,r._vscf_hybrid_key_alg_delete=t.Ar,r._vscf_hybrid_key_alg_shallow_copy=t.Br,r._vscf_simple_alg_info_alg_id=t.Cr,r._vscf_simple_alg_info_new=t.Dr,r._vscf_simple_alg_info_delete=t.Er,r._vscf_simple_alg_info_shallow_copy=t.Fr,r._vscf_simple_alg_info_new_with_alg_id=t.Gr,r._vscf_hash_based_alg_info_hash_alg_info=t.Hr,r._vscf_hash_based_alg_info_alg_id=t.Ir,r._vscf_hash_based_alg_info_new=t.Jr,r._vscf_hash_based_alg_info_delete=t.Kr,r._vscf_hash_based_alg_info_shallow_copy=t.Lr,r._vscf_cipher_alg_info_nonce=t.Mr,r._vscf_cipher_alg_info_alg_id=t.Nr,r._vscf_cipher_alg_info_new=t.Or,r._vscf_cipher_alg_info_delete=t.Pr,r._vscf_cipher_alg_info_shallow_copy=t.Qr,r._vscf_cipher_alg_info_new_with_members=t.Rr,r._vscf_salted_kdf_alg_info_hash_alg_info=t.Sr,r._vscf_salted_kdf_alg_info_salt=t.Tr,r._vscf_salted_kdf_alg_info_iteration_count=t.Ur,r._vscf_salted_kdf_alg_info_alg_id=t.Vr,r._vscf_salted_kdf_alg_info_new=t.Wr,r._vscf_salted_kdf_alg_info_delete=t.Xr,r._vscf_salted_kdf_alg_info_shallow_copy=t.Yr,r._vscf_pbe_alg_info_kdf_alg_info=t.Zr,r._vscf_pbe_alg_info_cipher_alg_info=t._r,r._vscf_pbe_alg_info_alg_id=t.$r,r._vscf_pbe_alg_info_new=t.as,r._vscf_pbe_alg_info_delete=t.bs,r._vscf_pbe_alg_info_shallow_copy=t.cs,r._vscf_ecc_alg_info_key_id=t.ds,r._vscf_ecc_alg_info_domain_id=t.es,r._vscf_ecc_alg_info_alg_id=t.fs,r._vscf_ecc_alg_info_new=t.gs,r._vscf_ecc_alg_info_delete=t.hs,r._vscf_ecc_alg_info_shallow_copy=t.is,r._vscf_ecc_alg_info_new_with_members=t.js,r._vscf_alg_info_der_serializer_setup_defaults=t.ks,r._vscf_alg_info_der_serializer_serialize_inplace=t.ls,r._vscf_alg_info_der_serializer_serialized_len=t.ms,r._vscf_alg_info_der_serializer_serialize=t.ns,r._vscf_alg_info_der_serializer_use_asn1_writer=t.os,r._vscf_alg_info_der_serializer_release_asn1_writer=t.ps,r._vscf_alg_info_der_serializer_new=t.qs,r._vscf_alg_info_der_serializer_delete=t.rs,r._vscf_alg_info_der_serializer_shallow_copy=t.ss,r._vscf_alg_info_der_deserializer_setup_defaults=t.ts,r._vscf_alg_info_der_deserializer_deserialize_inplace=t.us,r._vscf_alg_info_der_deserializer_deserialize=t.vs,r._vscf_alg_info_der_deserializer_use_asn1_reader=t.ws,r._vscf_alg_info_der_deserializer_release_asn1_reader=t.xs,r._vscf_alg_info_der_deserializer_new=t.ys,r._vscf_alg_info_der_deserializer_delete=t.zs,r._vscf_alg_info_der_deserializer_shallow_copy=t.As,r._vscf_message_info_der_serializer_setup_defaults=t.Bs,r._vscf_message_info_der_serializer_serialized_len=t.Cs,r._vscf_message_info_der_serializer_serialize=t.Ds,r._vscf_message_info_der_serializer_read_prefix=t.Es,r._vscf_message_info_der_serializer_deserialize=t.Fs,r._vscf_message_info_der_serializer_serialized_footer_len=t.Gs,r._vscf_message_info_der_serializer_serialize_footer=t.Hs,r._vscf_message_info_der_serializer_deserialize_footer=t.Is,r._vscf_message_info_der_serializer_use_asn1_reader=t.Js,r._vscf_message_info_der_serializer_release_asn1_reader=t.Ks,r._vscf_message_info_der_serializer_use_asn1_writer=t.Ls,r._vscf_message_info_der_serializer_release_asn1_writer=t.Ms,r._vscf_message_info_der_serializer_new=t.Ns,r._vscf_message_info_der_serializer_delete=t.Os,r._vscf_message_info_der_serializer_shallow_copy=t.Ps,r._vscf_random_padding_alg_id=t.Qs,r._vscf_random_padding_produce_alg_info=t.Rs,r._vscf_random_padding_restore_alg_info=t.Ss,r._vscf_random_padding_configure=t.Ts,r._vscf_random_padding_padded_data_len=t.Us,r._vscf_random_padding_len=t.Vs,r._vscf_random_padding_len_max=t.Ws,r._vscf_random_padding_start_data_processing=t.Xs,r._vscf_random_padding_process_data=t.Ys,r._vscf_random_padding_finish_data_processing=t.Zs,r._vscf_random_padding_start_padded_data_processing=t._s,r._vscf_random_padding_process_padded_data=t.$s,r._vscf_random_padding_finish_padded_data_processing_out_len=t.at,r._vscf_random_padding_finish_padded_data_processing=t.bt,r._vscf_random_padding_use_random=t.ct,r._vscf_random_padding_release_random=t.dt,r._vscf_random_padding_new=t.et,r._vscf_random_padding_delete=t.ft,r._vscf_random_padding_shallow_copy=t.gt,r._vsc_data_ctx_size=t.ht,r._vsc_data=t.it,r._vsc_data_len=t.jt,r._vsc_data_bytes=t.kt,r._vsc_buffer_new=t.lt,r._vsc_buffer_new_with_capacity=t.mt,r._vsc_buffer_delete=t.nt,r._vsc_buffer_data=t.ot,r._vsc_buffer_make_secure=t.pt,r._vsc_buffer_bytes=t.qt,r._vsc_buffer_len=t.rt,r._malloc=t.st,r._free=t.tt,pt=t.j,g(),gt}var e={a:mt};return r.instantiateWasm?new Promise(_=>{r.instantiateWasm(e,(e,r)=>{_(t(e))})}):(P??=r.locateFile?r.locateFile("libfoundation.worker.wasm",n):n+"libfoundation.worker.wasm",t((await async function(t){var e=P;if(!c)try{var r=fetch(e,{credentials:"same-origin"});return await WebAssembly.instantiateStreaming(r,t)}catch(t){x(`wasm streaming compile failed: ${t}`),x("falling back to ArrayBuffer instantiation")}return N(e,t)}(e)).instance))}(),function(){function t(){if(r.calledRun=!0,!y){var t,e;if(p=!0,!r.noFSInit&&!q)q=!0,t??=r.stdin,e??=r.stdout,_??=r.stderr,t?xt("stdin",t):ht("/dev/tty","/dev/stdin"),e?xt("stdout",null,e):ht("/dev/tty","/dev/stdout"),_?xt("stderr",null,_):ht("/dev/tty1","/dev/stderr"),Pt("/dev/stdin",0),Pt("/dev/stdout",1),Pt("/dev/stderr",1);if(gt.k(),j=!1,i?.(r),r.onRuntimeInitialized?.(),r.postRun)for("function"==typeof r.postRun&&(r.postRun=[r.postRun]);r.postRun.length;){var _=r.postRun.shift();E.push(_)}I(E)}}if(r.preRun)for("function"==typeof r.preRun&&(r.preRun=[r.preRun]);r.preRun.length;)b();I(w),r.setStatus?(r.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>r.setStatus(""),1),t()},1)):t()}(),p?r:new Promise((t,e)=>{i=t,a=e})}t.exports=e,t.exports.default=e}(g)),g.exports}var N,I,E,w,b,k,A,C,F,T,K,S,z,L,R,B,Y,H,U,M,D,O,G,V,q,j,X,W,Z,$,Q,J,tt,et,rt,_t,st,nt,ct,it,at,ot,lt,ut,ft,dt,ht,Pt,vt,xt,yt,pt,gt,mt,Nt,It,Et,wt,bt,kt,At,Ct,Ft,Tt,Kt,St,zt,Lt,Rt,Bt,Yt,Ht,Ut,Mt,Dt,Ot,Gt,Vt,qt,jt,Xt,Wt,Zt,$t,Qt,Jt,te,ee,re,_e,se,ne,ce,ie,ae,oe,le,ue,fe,de,he,Pe,ve,xe,ye,pe,ge,me,Ne,Ie,Ee,we,be,ke,Ae,Ce,Fe,Te,Ke,Se,ze,Le,Re,Be,Ye,He,Ue,Me,De,Oe,Ge,Ve,qe,je,Xe,We,Ze,$e,Qe,Je,tr,er,rr,_r,sr,nr,cr,ir,ar,or,lr,ur,fr,dr,hr,Pr,vr,xr,yr,pr,gr,mr,Nr,Ir,Er,wr,br,kr={};function Ar(){if(N)return kr;function t(t,e){if(!("number"==typeof e||e instanceof Number))throw new TypeError(`'${t}' is not a number`);if(Number.isNaN(e))throw new TypeError(`'${t}' is NaN`);if(e===1/0)throw new TypeError(`'${t}' is Infinity`);if(e===-1/0)throw new TypeError(`'${t}' is -Infinity`)}function e(e,r){if(t(e,r),0==r)throw new TypeError(`'${e}' is NULL`)}return N=1,kr.ensureNumber=t,kr.ensureString=function(t,e){if(!("string"==typeof e||e instanceof String))throw new TypeError(`'${t}' is not a string`)},kr.ensureBoolean=function(t,e){if("boolean"!=typeof e)throw new TypeError(`'${t}' is not a boolean`)},kr.ensureByteArray=function(t,e){if(!(e instanceof Uint8Array))throw new TypeError(`'${t}' is not an Uint8Array`)},kr.ensureClass=function(t,r,_){if(!(r instanceof _))throw new TypeError(`'${t}' is not an instance of the class ${_.name}`);e(t,r.ctxPtr)},kr.ensureNotNull=e,kr.ensureImplementInterface=function(t,r,_,s,n){if(e(t,r.ctxPtr),!n.isImplemented(r.ctxPtr,s))throw new TypeError(`'${t}' does not implement interface '${_}'`)},kr}var Cr=function(){if(br)return wr;br=1;const t=m(),e=_?r:(_=1,r=(t,e)=>Object.freeze({ALG:1,ALG_INFO:2,ALG_INFO_DESERIALIZER:3,ALG_INFO_SERIALIZER:4,ASN1_READER:5,ASN1_WRITER:6,AUTH_DECRYPT:7,AUTH_ENCRYPT:8,CIPHER:9,CIPHER_AUTH:10,CIPHER_AUTH_INFO:11,CIPHER_INFO:12,COMPUTE_SHARED_KEY:13,DECRYPT:14,ENCRYPT:15,ENTROPY_SOURCE:16,HASH:17,KDF:18,KEM:19,KEY:20,KEY_ALG:21,KEY_CIPHER:22,KEY_DESERIALIZER:23,KEY_SERIALIZER:24,KEY_SIGNER:25,MAC:26,MESSAGE_INFO_FOOTER_SERIALIZER:27,MESSAGE_INFO_SERIALIZER:28,PADDING:29,PRIVATE_KEY:30,PUBLIC_KEY:31,RANDOM:32,SALTED_KDF:33})),g=n?s:(n=1,s=(t,e)=>class{static newAndTakeCContext(r){const _=t._vscf_impl_tag(r);switch(_){case e.FoundationImplTag.AES256_CBC:return e.Aes256Cbc.newAndTakeCContext(r);case e.FoundationImplTag.AES256_GCM:return e.Aes256Gcm.newAndTakeCContext(r);case e.FoundationImplTag.ALG_INFO_DER_DESERIALIZER:return e.AlgInfoDerDeserializer.newAndTakeCContext(r);case e.FoundationImplTag.ALG_INFO_DER_SERIALIZER:return e.AlgInfoDerSerializer.newAndTakeCContext(r);case e.FoundationImplTag.ASN1RD:return e.Asn1rd.newAndTakeCContext(r);case e.FoundationImplTag.ASN1WR:return e.Asn1wr.newAndTakeCContext(r);case e.FoundationImplTag.CIPHER_ALG_INFO:return e.CipherAlgInfo.newAndTakeCContext(r);case e.FoundationImplTag.COMPOUND_KEY_ALG:return e.CompoundKeyAlg.newAndTakeCContext(r);case e.FoundationImplTag.COMPOUND_KEY_ALG_INFO:return e.CompoundKeyAlgInfo.newAndTakeCContext(r);case e.FoundationImplTag.COMPOUND_PRIVATE_KEY:return e.CompoundPrivateKey.newAndTakeCContext(r);case e.FoundationImplTag.COMPOUND_PUBLIC_KEY:return e.CompoundPublicKey.newAndTakeCContext(r);case e.FoundationImplTag.CTR_DRBG:return e.CtrDrbg.newAndTakeCContext(r);case e.FoundationImplTag.CURVE25519:return e.Curve25519.newAndTakeCContext(r);case e.FoundationImplTag.ECC:return e.Ecc.newAndTakeCContext(r);case e.FoundationImplTag.ECC_ALG_INFO:return e.EccAlgInfo.newAndTakeCContext(r);case e.FoundationImplTag.ECC_PRIVATE_KEY:return e.EccPrivateKey.newAndTakeCContext(r);case e.FoundationImplTag.ECC_PUBLIC_KEY:return e.EccPublicKey.newAndTakeCContext(r);case e.FoundationImplTag.ED25519:return e.Ed25519.newAndTakeCContext(r);case e.FoundationImplTag.ENTROPY_ACCUMULATOR:return e.EntropyAccumulator.newAndTakeCContext(r);case e.FoundationImplTag.FAKE_RANDOM:return e.FakeRandom.newAndTakeCContext(r);case e.FoundationImplTag.FALCON:return e.Falcon.newAndTakeCContext(r);case e.FoundationImplTag.HASH_BASED_ALG_INFO:return e.HashBasedAlgInfo.newAndTakeCContext(r);case e.FoundationImplTag.HKDF:return e.Hkdf.newAndTakeCContext(r);case e.FoundationImplTag.HMAC:return e.Hmac.newAndTakeCContext(r);case e.FoundationImplTag.HYBRID_KEY_ALG:return e.HybridKeyAlg.newAndTakeCContext(r);case e.FoundationImplTag.HYBRID_KEY_ALG_INFO:return e.HybridKeyAlgInfo.newAndTakeCContext(r);case e.FoundationImplTag.HYBRID_PRIVATE_KEY:return e.HybridPrivateKey.newAndTakeCContext(r);case e.FoundationImplTag.HYBRID_PUBLIC_KEY:return e.HybridPublicKey.newAndTakeCContext(r);case e.FoundationImplTag.KDF1:return e.Kdf1.newAndTakeCContext(r);case e.FoundationImplTag.KDF2:return e.Kdf2.newAndTakeCContext(r);case e.FoundationImplTag.KEY_ASN1_DESERIALIZER:return e.KeyAsn1Deserializer.newAndTakeCContext(r);case e.FoundationImplTag.KEY_ASN1_SERIALIZER:return e.KeyAsn1Serializer.newAndTakeCContext(r);case e.FoundationImplTag.KEY_MATERIAL_RNG:return e.KeyMaterialRng.newAndTakeCContext(r);case e.FoundationImplTag.MESSAGE_INFO_DER_SERIALIZER:return e.MessageInfoDerSerializer.newAndTakeCContext(r);case e.FoundationImplTag.PBE_ALG_INFO:return e.PbeAlgInfo.newAndTakeCContext(r);case e.FoundationImplTag.PKCS5_PBES2:return e.Pkcs5Pbes2.newAndTakeCContext(r);case e.FoundationImplTag.PKCS5_PBKDF2:return e.Pkcs5Pbkdf2.newAndTakeCContext(r);case e.FoundationImplTag.PKCS8_SERIALIZER:return e.Pkcs8Serializer.newAndTakeCContext(r);case e.FoundationImplTag.RANDOM_PADDING:return e.RandomPadding.newAndTakeCContext(r);case e.FoundationImplTag.RAW_PRIVATE_KEY:return e.RawPrivateKey.newAndTakeCContext(r);case e.FoundationImplTag.RAW_PUBLIC_KEY:return e.RawPublicKey.newAndTakeCContext(r);case e.FoundationImplTag.ROUND5:return e.Round5.newAndTakeCContext(r);case e.FoundationImplTag.RSA:return e.Rsa.newAndTakeCContext(r);case e.FoundationImplTag.RSA_PRIVATE_KEY:return e.RsaPrivateKey.newAndTakeCContext(r);case e.FoundationImplTag.RSA_PUBLIC_KEY:return e.RsaPublicKey.newAndTakeCContext(r);case e.FoundationImplTag.SALTED_KDF_ALG_INFO:return e.SaltedKdfAlgInfo.newAndTakeCContext(r);case e.FoundationImplTag.SEC1_SERIALIZER:return e.Sec1Serializer.newAndTakeCContext(r);case e.FoundationImplTag.SEED_ENTROPY_SOURCE:return e.SeedEntropySource.newAndTakeCContext(r);case e.FoundationImplTag.SHA224:return e.Sha224.newAndTakeCContext(r);case e.FoundationImplTag.SHA256:return e.Sha256.newAndTakeCContext(r);case e.FoundationImplTag.SHA384:return e.Sha384.newAndTakeCContext(r);case e.FoundationImplTag.SHA512:return e.Sha512.newAndTakeCContext(r);case e.FoundationImplTag.SIMPLE_ALG_INFO:return e.SimpleAlgInfo.newAndTakeCContext(r);default:throw new Error("Unexpected implementation tag found: "+_)}}static newAndUseCContext(r){return new e.FoundationInterface.newAndTakeCContext(t._vscf_impl_shallow_copy(r))}static isImplemented(e,r){return 0!=t._vscf_impl_api(e,r)}}),N=i?c:(i=1,c=(t,e)=>Object.freeze({AES256_CBC:1,AES256_GCM:2,ALG_INFO_DER_DESERIALIZER:3,ALG_INFO_DER_SERIALIZER:4,ASN1RD:5,ASN1WR:6,CIPHER_ALG_INFO:7,COMPOUND_KEY_ALG:8,COMPOUND_KEY_ALG_INFO:9,COMPOUND_PRIVATE_KEY:10,COMPOUND_PUBLIC_KEY:11,CTR_DRBG:12,CURVE25519:13,ECC:14,ECC_ALG_INFO:15,ECC_PRIVATE_KEY:16,ECC_PUBLIC_KEY:17,ED25519:18,ENTROPY_ACCUMULATOR:19,FAKE_RANDOM:20,FALCON:21,HASH_BASED_ALG_INFO:22,HKDF:23,HMAC:24,HYBRID_KEY_ALG:25,HYBRID_KEY_ALG_INFO:26,HYBRID_PRIVATE_KEY:27,HYBRID_PUBLIC_KEY:28,KDF1:29,KDF2:30,KEY_ASN1_DESERIALIZER:31,KEY_ASN1_SERIALIZER:32,KEY_MATERIAL_RNG:33,MESSAGE_INFO_DER_SERIALIZER:34,PBE_ALG_INFO:35,PKCS5_PBES2:36,PKCS5_PBKDF2:37,PKCS8_SERIALIZER:38,RANDOM_PADDING:39,RAW_PRIVATE_KEY:40,RAW_PUBLIC_KEY:41,ROUND5:42,RSA:43,RSA_PRIVATE_KEY:44,RSA_PUBLIC_KEY:45,SALTED_KDF_ALG_INFO:46,SEC1_SERIALIZER:47,SEED_ENTROPY_SOURCE:48,SHA224:49,SHA256:50,SHA384:51,SHA512:52,SIMPLE_ALG_INFO:53})),kr=o?a:(o=1,a=(t,e)=>{class r extends Error{constructor(t){super(t),this.name="FoundationError",this.message=t}static handleStatusCode(t){if(0!=t){if(-1==t)throw new r("This error should not be returned if assertions is enabled.");if(-2==t)throw new r("Can be used to define that not all context prerequisites are satisfied. Note, this error should not be returned if assertions is enabled.");if(-3==t)throw new r("Define that error code from one of third-party module was not handled. Note, this error should not be returned if assertions is enabled.");if(-101==t)throw new r("Buffer capacity is not enough to hold result.");if(-200==t)throw new r("Unsupported algorithm.");if(-201==t)throw new r("Authentication failed during decryption.");if(-202==t)throw new r("Attempt to read data out of buffer bounds.");if(-203==t)throw new r("ASN.1 encoded data is corrupted.");if(-204==t)throw new r("Attempt to read ASN.1 type that is bigger then requested C type.");if(-205==t)throw new r("ASN.1 representation of PKCS#1 public key is corrupted.");if(-206==t)throw new r("ASN.1 representation of PKCS#1 private key is corrupted.");if(-207==t)throw new r("ASN.1 representation of PKCS#8 public key is corrupted.");if(-208==t)throw new r("ASN.1 representation of PKCS#8 private key is corrupted.");if(-209==t)throw new r("Encrypted data is corrupted.");if(-210==t)throw new r("Underlying random operation returns error.");if(-211==t)throw new r("Generation of the private or secret key failed.");if(-212==t)throw new r("One of the entropy sources failed.");if(-213==t)throw new r("Requested data to be generated is too big.");if(-214==t)throw new r("Base64 encoded string contains invalid characters.");if(-215==t)throw new r("PEM data is corrupted.");if(-216==t)throw new r("Exchange key return zero.");if(-217==t)throw new r("Ed25519 public key is corrupted.");if(-218==t)throw new r("Ed25519 private key is corrupted.");if(-219==t)throw new r("CURVE25519 public key is corrupted.");if(-220==t)throw new r("CURVE25519 private key is corrupted.");if(-221==t)throw new r("Elliptic curve public key format is corrupted see RFC 5480.");if(-222==t)throw new r("Elliptic curve public key format is corrupted see RFC 5915.");if(-223==t)throw new r("ASN.1 representation of a public key is corrupted.");if(-224==t)throw new r("ASN.1 representation of a private key is corrupted.");if(-225==t)throw new r("Key algorithm does not accept given type of public key.");if(-226==t)throw new r("Key algorithm does not accept given type of private key.");if(-227==t)throw new r("Post-quantum Falcon-Sign public key is corrupted.");if(-228==t)throw new r("Post-quantum Falcon-Sign private key is corrupted.");if(-229==t)throw new r("Generic Round5 library error.");if(-230==t)throw new r("Post-quantum NIST Round5 public key is corrupted.");if(-231==t)throw new r("Post-quantum NIST Round5 private key is corrupted.");if(-232==t)throw new r("Compound public key is corrupted.");if(-233==t)throw new r("Compound private key is corrupted.");if(-234==t)throw new r("Compound public hybrid key is corrupted.");if(-235==t)throw new r("Compound private hybrid key is corrupted.");if(-236==t)throw new r("ASN.1 AlgorithmIdentifer is corrupted.");if(-237==t)throw new r("ASN.1 AlgorithmIdentifer with ECParameters is corrupted.");if(-238==t)throw new r("ASN.1 AlgorithmIdentifer with CompoundKeyParams is corrupted.");if(-239==t)throw new r("ASN.1 AlgorithmIdentifer with HybridKeyParams is corrupted.");if(-301==t)throw new r("Decryption failed, because message info was not given explicitly, and was not part of an encrypted message.");if(-302==t)throw new r("Message Info is corrupted.");if(-303==t)throw new r("Recipient defined with id is not found within message info during data decryption.");if(-304==t)throw new r("Content encryption key can not be decrypted with a given private key.");if(-305==t)throw new r("Content encryption key can not be decrypted with a given password.");if(-306==t)throw new r("Custom parameter with a given key is not found within message info.");if(-307==t)throw new r("A custom parameter with a given key is found, but the requested value type does not correspond to the actual type.");if(-308==t)throw new r("Signature format is corrupted.");if(-309==t)throw new r("Message Info footer is corrupted.");if(-401==t)throw new r("Brainkey password length is out of range.");if(-402==t)throw new r("Brainkey number length should be 32 byte.");if(-403==t)throw new r("Brainkey point length should be 65 bytes.");if(-404==t)throw new r("Brainkey name is out of range.");if(-405==t)throw new r("Brainkey internal error.");if(-406==t)throw new r("Brainkey point is invalid.");if(-407==t)throw new r("Brainkey number buffer length capacity should be >= 32 byte.");if(-408==t)throw new r("Brainkey point buffer length capacity should be >= 32 byte.");if(-409==t)throw new r("Brainkey seed buffer length capacity should be >= 32 byte.");if(-410==t)throw new r("Brainkey identity secret is invalid.");if(-411==t)throw new r("KEM encapsulated key is invalid or does not correspond to the private key.");if(-501==t)throw new r("Invalid padding.");if(-601==t)throw new r("Protobuf error.");if(-701==t)throw new r("Session id doesnt match.");if(-702==t)throw new r("Epoch not found.");if(-703==t)throw new r("Wrong key type.");if(-704==t)throw new r("Invalid signature.");if(-705==t)throw new r("Ed25519 error.");if(-706==t)throw new r("Duplicate epoch.");if(-707==t)throw new r("Plain text too long.");throw new r("Unexpected status code:"+t)}}}return r}),Cr=u?l:(u=1,l=(t,e)=>Object.freeze({BOOLEAN:1,INTEGER:2,BIT_STRING:3,OCTET_STRING:4,NULL:5,OID:6,UTF8_STRING:12,SEQUENCE:16,SET:17,PRINTABLE_STRING:19,T61_STRING:20,IA5_STRING:22,UTC_TIME:23,GENERALIZED_TIME:24,UNIVERSAL_STRING:28,BMP_STRING:30,PRIMITIVE:0,CONSTRUCTED:32,CONTEXT_SPECIFIC:128})),Fr=d?f:(d=1,f=(t,e)=>Object.freeze({NONE:0,SHA224:1,SHA256:2,SHA384:3,SHA512:4,KDF1:5,KDF2:6,RSA:7,ED25519:8,CURVE25519:9,SECP256R1:10,AES256_GCM:11,AES256_CBC:12,HMAC:13,HKDF:14,PKCS5_PBKDF2:15,PKCS5_PBES2:16,COMPOUND_KEY:17,HYBRID_KEY:18,FALCON:19,ROUND5_ND_1CCA_5D:20,RANDOM_PADDING:21})),Tr=P?h:(P=1,h=(t,e)=>Object.freeze({NONE:0,RSA:1,ED25519:2,CURVE25519:3,SHA224:4,SHA256:5,SHA384:6,SHA512:7,KDF1:8,KDF2:9,AES256_GCM:10,AES256_CBC:11,PKCS5_PBKDF2:12,PKCS5_PBES2:13,CMS_DATA:14,CMS_ENVELOPED_DATA:15,HKDF_WITH_SHA256:16,HKDF_WITH_SHA384:17,HKDF_WITH_SHA512:18,HMAC_WITH_SHA224:19,HMAC_WITH_SHA256:20,HMAC_WITH_SHA384:21,HMAC_WITH_SHA512:22,EC_GENERIC_KEY:23,EC_DOMAIN_SECP256R1:24,COMPOUND_KEY:25,HYBRID_KEY:26,FALCON:27,ROUND5_ND_1CCA_5D:28,RANDOM_PADDING:29})),Kr=x?v:(x=1,v=(t,e)=>Object.freeze({GROUP_INFO:1,REGULAR:2})),Sr=p?y:(p=1,y=(t,e)=>Object.freeze({INITIAL:0,ENCRYPTION:1,DECRYPTION:2})),zr=function(){if(E)return I;E=1;const t=Ar();return I=(e,r)=>class{static fromAlgId(t){e._vscf_oid_from_alg_id(t)}static toAlgId(r){t.ensureByteArray("oid",r);const _=r.length*r.BYTES_PER_ELEMENT,s=e._malloc(_);e.HEAP8.set(r,s);const n=e._vsc_data_ctx_size(),c=e._malloc(n);let i;e._vsc_data(c,s,_);try{i=e._vscf_oid_to_alg_id(c)}finally{e._free(s),e._free(c)}}static fromId(t){e._vscf_oid_from_id(t)}static toId(r){t.ensureByteArray("oid",r);const _=r.length*r.BYTES_PER_ELEMENT,s=e._malloc(_);e.HEAP8.set(r,s);const n=e._vsc_data_ctx_size(),c=e._malloc(n);let i;e._vsc_data(c,s,_);try{i=e._vscf_oid_to_id(c)}finally{e._free(s),e._free(c)}}static idToAlgId(t){let r;return r=e._vscf_oid_id_to_alg_id(t),r}static equal(r,_){t.ensureByteArray("lhs",r),t.ensureByteArray("rhs",_);const s=r.length*r.BYTES_PER_ELEMENT,n=e._malloc(s);e.HEAP8.set(r,n);const c=e._vsc_data_ctx_size(),i=e._malloc(c);e._vsc_data(i,n,s);const a=_.length*_.BYTES_PER_ELEMENT,o=e._malloc(a);e.HEAP8.set(_,o);const l=e._vsc_data_ctx_size(),u=e._malloc(l);e._vsc_data(u,o,a);try{return!!e._vscf_oid_equal(i,u)}finally{e._free(n),e._free(i),e._free(o),e._free(u)}}}}(),Lr=function(){if(b)return w;b=1;const t=Ar();return w=(e,r)=>class{static encodedLen(r){let _;return t.ensureNumber("dataLen",r),_=e._vscf_base64_encoded_len(r),_}static encode(_){t.ensureByteArray("data",_);const s=_.length*_.BYTES_PER_ELEMENT,n=e._malloc(s);e.HEAP8.set(_,n);const c=e._vsc_data_ctx_size(),i=e._malloc(c);e._vsc_data(i,n,s);const a=r.Base64.encodedLen(_.length),o=e._vsc_buffer_new_with_capacity(a);try{e._vscf_base64_encode(i,o);const t=e._vsc_buffer_bytes(o),r=e._vsc_buffer_len(o);return e.HEAPU8.slice(t,t+r)}finally{e._free(n),e._free(i),e._vsc_buffer_delete(o)}}static decodedLen(r){let _;return t.ensureNumber("strLen",r),_=e._vscf_base64_decoded_len(r),_}static decode(_){t.ensureByteArray("str",_);const s=_.length*_.BYTES_PER_ELEMENT,n=e._malloc(s);e.HEAP8.set(_,n);const c=e._vsc_data_ctx_size(),i=e._malloc(c);e._vsc_data(i,n,s);const a=r.Base64.decodedLen(_.length),o=e._vsc_buffer_new_with_capacity(a);try{const t=e._vscf_base64_decode(i,o);r.FoundationError.handleStatusCode(t);const _=e._vsc_buffer_bytes(o),s=e._vsc_buffer_len(o);return e.HEAPU8.slice(_,_+s)}finally{e._free(n),e._free(i),e._vsc_buffer_delete(o)}}}}(),Rr=function(){if(A)return k;A=1;const t=Ar();return k=(e,r)=>class{static wrappedLen(r,_){let s;return t.ensureString("title",r),t.ensureNumber("dataLen",_),s=e._vscf_pem_wrapped_len(r,_),s}static wrap(_,s){t.ensureString("title",_),t.ensureByteArray("data",s);const n=s.length*s.BYTES_PER_ELEMENT,c=e._malloc(n);e.HEAP8.set(s,c);const i=e._vsc_data_ctx_size(),a=e._malloc(i);e._vsc_data(a,c,n);const o=r.Pem.wrappedLen(_,s.length),l=e._vsc_buffer_new_with_capacity(o);try{e._vscf_pem_wrap(_,a,l);const t=e._vsc_buffer_bytes(l),r=e._vsc_buffer_len(l);return e.HEAPU8.slice(t,t+r)}finally{e._free(c),e._free(a),e._vsc_buffer_delete(l)}}static unwrappedLen(r){let _;return t.ensureNumber("pemLen",r),_=e._vscf_pem_unwrapped_len(r),_}static unwrap(_){t.ensureByteArray("pem",_);const s=_.length*_.BYTES_PER_ELEMENT,n=e._malloc(s);e.HEAP8.set(_,n);const c=e._vsc_data_ctx_size(),i=e._malloc(c);e._vsc_data(i,n,s);const a=r.Pem.unwrappedLen(_.length),o=e._vsc_buffer_new_with_capacity(a);try{const t=e._vscf_pem_unwrap(i,o);r.FoundationError.handleStatusCode(t);const _=e._vsc_buffer_bytes(o),s=e._vsc_buffer_len(o);return e.HEAPU8.slice(_,_+s)}finally{e._free(n),e._free(i),e._vsc_buffer_delete(o)}}static title(r){t.ensureByteArray("pem",r);const _=r.length*r.BYTES_PER_ELEMENT,s=e._malloc(_);e.HEAP8.set(r,s);const n=e._vsc_data_ctx_size(),c=e._malloc(n);e._vsc_data(c,s,_);try{e._vscf_pem_title(c)}finally{e._free(s),e._free(c)}}}}(),Br=function(){if(F)return C;F=1;const t=Ar();return C=(e,r)=>{class _{constructor(t){this.name="MessageInfo",this.ctxPtr=void 0===t?e._vscf_message_info_new():t}static newAndUseCContext(t){return new _(e._vscf_message_info_shallow_copy(t))}static newAndTakeCContext(t){return new _(t)}delete(){void 0!==this.ctxPtr&&null!==this.ctxPtr&&(e._vscf_message_info_delete(this.ctxPtr),this.ctxPtr=null)}dataEncryptionAlgInfo(){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),_=e._vscf_message_info_data_encryption_alg_info(this.ctxPtr),r.FoundationInterface.newAndUseCContext(_)}keyRecipientInfoList(){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),_=e._vscf_message_info_key_recipient_info_list(this.ctxPtr),r.KeyRecipientInfoList.newAndUseCContext(_)}passwordRecipientInfoList(){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),_=e._vscf_message_info_password_recipient_info_list(this.ctxPtr),r.PasswordRecipientInfoList.newAndUseCContext(_)}hasCustomParams(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_message_info_has_custom_params(this.ctxPtr),!!r}customParams(){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),_=e._vscf_message_info_custom_params(this.ctxPtr),r.MessageInfoCustomParams.newAndUseCContext(_)}hasCipherKdfAlgInfo(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_message_info_has_cipher_kdf_alg_info(this.ctxPtr),!!r}cipherKdfAlgInfo(){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),_=e._vscf_message_info_cipher_kdf_alg_info(this.ctxPtr),r.FoundationInterface.newAndUseCContext(_)}hasCipherPaddingAlgInfo(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_message_info_has_cipher_padding_alg_info(this.ctxPtr),!!r}cipherPaddingAlgInfo(){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),_=e._vscf_message_info_cipher_padding_alg_info(this.ctxPtr),r.FoundationInterface.newAndUseCContext(_)}hasFooterInfo(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_message_info_has_footer_info(this.ctxPtr),!!r}footerInfo(){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),_=e._vscf_message_info_footer_info(this.ctxPtr),r.FooterInfo.newAndUseCContext(_)}clear(){t.ensureNotNull("this.ctxPtr",this.ctxPtr),e._vscf_message_info_clear(this.ctxPtr)}}return _}}(),Yr=function(){if(K)return T;K=1;const t=Ar();return T=(e,r)=>{class _{constructor(t){this.name="KeyRecipientInfo",this.ctxPtr=void 0===t?e._vscf_key_recipient_info_new():t}static newAndUseCContext(t){return new _(e._vscf_key_recipient_info_shallow_copy(t))}static newAndTakeCContext(t){return new _(t)}delete(){void 0!==this.ctxPtr&&null!==this.ctxPtr&&(e._vscf_key_recipient_info_delete(this.ctxPtr),this.ctxPtr=null)}recipientId(){t.ensureNotNull("this.ctxPtr",this.ctxPtr),e._vscf_key_recipient_info_recipient_id(this.ctxPtr)}keyEncryptionAlgorithm(){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),_=e._vscf_key_recipient_info_key_encryption_algorithm(this.ctxPtr),r.FoundationInterface.newAndUseCContext(_)}encryptedKey(){t.ensureNotNull("this.ctxPtr",this.ctxPtr),e._vscf_key_recipient_info_encrypted_key(this.ctxPtr)}}return _}}(),Hr=function(){if(z)return S;z=1;const t=Ar();return S=(e,r)=>{class _{constructor(t){this.name="KeyRecipientInfoList",this.ctxPtr=void 0===t?e._vscf_key_recipient_info_list_new():t}static newAndUseCContext(t){return new _(e._vscf_key_recipient_info_list_shallow_copy(t))}static newAndTakeCContext(t){return new _(t)}delete(){void 0!==this.ctxPtr&&null!==this.ctxPtr&&(e._vscf_key_recipient_info_list_delete(this.ctxPtr),this.ctxPtr=null)}hasItem(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_key_recipient_info_list_has_item(this.ctxPtr),!!r}item(){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),_=e._vscf_key_recipient_info_list_item(this.ctxPtr),r.KeyRecipientInfo.newAndUseCContext(_)}hasNext(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_key_recipient_info_list_has_next(this.ctxPtr),!!r}next(){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),_=e._vscf_key_recipient_info_list_next(this.ctxPtr),r.Self.newAndUseCContext(_)}hasPrev(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_key_recipient_info_list_has_prev(this.ctxPtr),!!r}prev(){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),_=e._vscf_key_recipient_info_list_prev(this.ctxPtr),r.Self.newAndUseCContext(_)}clear(){t.ensureNotNull("this.ctxPtr",this.ctxPtr),e._vscf_key_recipient_info_list_clear(this.ctxPtr)}}return _}}(),Ur=function(){if(R)return L;R=1;const t=Ar();return L=(e,r)=>{class _{constructor(t){this.name="PasswordRecipientInfo",this.ctxPtr=void 0===t?e._vscf_password_recipient_info_new():t}static newAndUseCContext(t){return new _(e._vscf_password_recipient_info_shallow_copy(t))}static newAndTakeCContext(t){return new _(t)}delete(){void 0!==this.ctxPtr&&null!==this.ctxPtr&&(e._vscf_password_recipient_info_delete(this.ctxPtr),this.ctxPtr=null)}keyEncryptionAlgorithm(){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),_=e._vscf_password_recipient_info_key_encryption_algorithm(this.ctxPtr),r.FoundationInterface.newAndUseCContext(_)}encryptedKey(){t.ensureNotNull("this.ctxPtr",this.ctxPtr),e._vscf_password_recipient_info_encrypted_key(this.ctxPtr)}}return _}}(),Mr=function(){if(Y)return B;Y=1;const t=Ar();return B=(e,r)=>{class _{constructor(t){this.name="PasswordRecipientInfoList",this.ctxPtr=void 0===t?e._vscf_password_recipient_info_list_new():t}static newAndUseCContext(t){return new _(e._vscf_password_recipient_info_list_shallow_copy(t))}static newAndTakeCContext(t){return new _(t)}delete(){void 0!==this.ctxPtr&&null!==this.ctxPtr&&(e._vscf_password_recipient_info_list_delete(this.ctxPtr),this.ctxPtr=null)}hasItem(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_password_recipient_info_list_has_item(this.ctxPtr),!!r}item(){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),_=e._vscf_password_recipient_info_list_item(this.ctxPtr),r.PasswordRecipientInfo.newAndUseCContext(_)}hasNext(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_password_recipient_info_list_has_next(this.ctxPtr),!!r}next(){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),_=e._vscf_password_recipient_info_list_next(this.ctxPtr),r.Self.newAndUseCContext(_)}hasPrev(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_password_recipient_info_list_has_prev(this.ctxPtr),!!r}prev(){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),_=e._vscf_password_recipient_info_list_prev(this.ctxPtr),r.Self.newAndUseCContext(_)}clear(){t.ensureNotNull("this.ctxPtr",this.ctxPtr),e._vscf_password_recipient_info_list_clear(this.ctxPtr)}}return _}}(),Dr=function(){if(U)return H;U=1;const t=Ar();return H=(e,r)=>class{static createHashFromInfo(_){let s;return t.ensureImplementInterface("algInfo",_,"Foundation.AlgInfo",r.FoundationInterfaceTag.ALG_INFO,r.FoundationInterface),s=e._vscf_alg_factory_create_hash_from_info(_.ctxPtr),r.FoundationInterface.newAndTakeCContext(s)}static createMacFromInfo(_){let s;return t.ensureImplementInterface("algInfo",_,"Foundation.AlgInfo",r.FoundationInterfaceTag.ALG_INFO,r.FoundationInterface),s=e._vscf_alg_factory_create_mac_from_info(_.ctxPtr),r.FoundationInterface.newAndTakeCContext(s)}static createKdfFromInfo(_){let s;return t.ensureImplementInterface("algInfo",_,"Foundation.AlgInfo",r.FoundationInterfaceTag.ALG_INFO,r.FoundationInterface),s=e._vscf_alg_factory_create_kdf_from_info(_.ctxPtr),r.FoundationInterface.newAndTakeCContext(s)}static createSaltedKdfFromInfo(_){let s;return t.ensureImplementInterface("algInfo",_,"Foundation.AlgInfo",r.FoundationInterfaceTag.ALG_INFO,r.FoundationInterface),s=e._vscf_alg_factory_create_salted_kdf_from_info(_.ctxPtr),r.FoundationInterface.newAndTakeCContext(s)}static createCipherFromInfo(_){let s;return t.ensureImplementInterface("algInfo",_,"Foundation.AlgInfo",r.FoundationInterfaceTag.ALG_INFO,r.FoundationInterface),s=e._vscf_alg_factory_create_cipher_from_info(_.ctxPtr),r.FoundationInterface.newAndTakeCContext(s)}static createPaddingFromInfo(_,s){let n;return t.ensureImplementInterface("algInfo",_,"Foundation.AlgInfo",r.FoundationInterfaceTag.ALG_INFO,r.FoundationInterface),t.ensureImplementInterface("random",s,"Foundation.Random",r.FoundationInterfaceTag.RANDOM,r.FoundationInterface),n=e._vscf_alg_factory_create_padding_from_info(_.ctxPtr,s.ctxPtr),r.FoundationInterface.newAndTakeCContext(n)}}}(),Or=function(){if(D)return M;D=1;const t=Ar();return M=(e,r)=>class{static createFromAlgId(_,s){t.ensureImplementInterface("random",s,"Foundation.Random",r.FoundationInterfaceTag.RANDOM,r.FoundationInterface);const n=e._vscf_error_ctx_size(),c=e._malloc(n);let i;e._vscf_error_reset(c);try{i=e._vscf_key_alg_factory_create_from_alg_id(_,s.ctxPtr,c);const t=e._vscf_error_status(c);return r.FoundationError.handleStatusCode(t),r.FoundationInterface.newAndTakeCContext(i)}finally{e._free(c)}}static createFromKey(_,s){t.ensureImplementInterface("key",_,"Foundation.Key",r.FoundationInterfaceTag.KEY,r.FoundationInterface),t.ensureImplementInterface("random",s,"Foundation.Random",r.FoundationInterfaceTag.RANDOM,r.FoundationInterface);const n=e._vscf_error_ctx_size(),c=e._malloc(n);let i;e._vscf_error_reset(c);try{i=e._vscf_key_alg_factory_create_from_key(_.ctxPtr,s.ctxPtr,c);const t=e._vscf_error_status(c);return r.FoundationError.handleStatusCode(t),r.FoundationInterface.newAndTakeCContext(i)}finally{e._free(c)}}static createFromRawPublicKey(_,s){t.ensureClass("publicKey",_,r.RawPublicKey),t.ensureImplementInterface("random",s,"Foundation.Random",r.FoundationInterfaceTag.RANDOM,r.FoundationInterface);const n=e._vscf_error_ctx_size(),c=e._malloc(n);let i;e._vscf_error_reset(c);try{i=e._vscf_key_alg_factory_create_from_raw_public_key(_.ctxPtr,s.ctxPtr,c);const t=e._vscf_error_status(c);return r.FoundationError.handleStatusCode(t),r.FoundationInterface.newAndTakeCContext(i)}finally{e._free(c)}}static createFromRawPrivateKey(_,s){t.ensureClass("privateKey",_,r.RawPrivateKey),t.ensureImplementInterface("random",s,"Foundation.Random",r.FoundationInterfaceTag.RANDOM,r.FoundationInterface);const n=e._vscf_error_ctx_size(),c=e._malloc(n);let i;e._vscf_error_reset(c);try{i=e._vscf_key_alg_factory_create_from_raw_private_key(_.ctxPtr,s.ctxPtr,c);const t=e._vscf_error_status(c);return r.FoundationError.handleStatusCode(t),r.FoundationInterface.newAndTakeCContext(i)}finally{e._free(c)}}}}(),Gr=function(){if(G)return O;G=1;const t=Ar();return O=(e,r)=>{class _{constructor(t){this.name="Ecies",this.ctxPtr=void 0===t?e._vscf_ecies_new():t}static newAndUseCContext(t){return new _(e._vscf_ecies_shallow_copy(t))}static newAndTakeCContext(t){return new _(t)}delete(){void 0!==this.ctxPtr&&null!==this.ctxPtr&&(e._vscf_ecies_delete(this.ctxPtr),this.ctxPtr=null)}set random(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("random",_,"Foundation.Random",r.FoundationInterfaceTag.RANDOM,r.FoundationInterface),e._vscf_ecies_release_random(this.ctxPtr),e._vscf_ecies_use_random(this.ctxPtr,_.ctxPtr)}set cipher(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("cipher",_,"Foundation.Cipher",r.FoundationInterfaceTag.CIPHER,r.FoundationInterface),e._vscf_ecies_release_cipher(this.ctxPtr),e._vscf_ecies_use_cipher(this.ctxPtr,_.ctxPtr)}set mac(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("mac",_,"Foundation.Mac",r.FoundationInterfaceTag.MAC,r.FoundationInterface),e._vscf_ecies_release_mac(this.ctxPtr),e._vscf_ecies_use_mac(this.ctxPtr,_.ctxPtr)}set kdf(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("kdf",_,"Foundation.Kdf",r.FoundationInterfaceTag.KDF,r.FoundationInterface),e._vscf_ecies_release_kdf(this.ctxPtr),e._vscf_ecies_use_kdf(this.ctxPtr,_.ctxPtr)}set ephemeralKey(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("ephemeralKey",_,"Foundation.PrivateKey",r.FoundationInterfaceTag.PRIVATE_KEY,r.FoundationInterface),e._vscf_ecies_release_ephemeral_key(this.ctxPtr),e._vscf_ecies_use_ephemeral_key(this.ctxPtr,_.ctxPtr)}setKeyAlg(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("keyAlg",_,"Foundation.KeyAlg",r.FoundationInterfaceTag.KEY_ALG,r.FoundationInterface),e._vscf_ecies_set_key_alg(this.ctxPtr,_.ctxPtr)}releaseKeyAlg(){t.ensureNotNull("this.ctxPtr",this.ctxPtr),e._vscf_ecies_release_key_alg(this.ctxPtr)}setupDefaults(){t.ensureNotNull("this.ctxPtr",this.ctxPtr);const _=e._vscf_ecies_setup_defaults(this.ctxPtr);r.FoundationError.handleStatusCode(_)}setupDefaultsNoRandom(){t.ensureNotNull("this.ctxPtr",this.ctxPtr),e._vscf_ecies_setup_defaults_no_random(this.ctxPtr)}encryptedLen(_,s){let n;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("publicKey",_,"Foundation.PublicKey",r.FoundationInterfaceTag.PUBLIC_KEY,r.FoundationInterface),t.ensureNumber("dataLen",s),n=e._vscf_ecies_encrypted_len(this.ctxPtr,_.ctxPtr,s),n}encrypt(_,s){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("publicKey",_,"Foundation.PublicKey",r.FoundationInterfaceTag.PUBLIC_KEY,r.FoundationInterface),t.ensureByteArray("data",s);const n=s.length*s.BYTES_PER_ELEMENT,c=e._malloc(n);e.HEAP8.set(s,c);const i=e._vsc_data_ctx_size(),a=e._malloc(i);e._vsc_data(a,c,n);const o=this.encryptedLen(_,s.length),l=e._vsc_buffer_new_with_capacity(o);try{const t=e._vscf_ecies_encrypt(this.ctxPtr,_.ctxPtr,a,l);r.FoundationError.handleStatusCode(t);const s=e._vsc_buffer_bytes(l),n=e._vsc_buffer_len(l);return e.HEAPU8.slice(s,s+n)}finally{e._free(c),e._free(a),e._vsc_buffer_delete(l)}}decryptedLen(_,s){let n;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("privateKey",_,"Foundation.PrivateKey",r.FoundationInterfaceTag.PRIVATE_KEY,r.FoundationInterface),t.ensureNumber("dataLen",s),n=e._vscf_ecies_decrypted_len(this.ctxPtr,_.ctxPtr,s),n}decrypt(_,s){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("privateKey",_,"Foundation.PrivateKey",r.FoundationInterfaceTag.PRIVATE_KEY,r.FoundationInterface),t.ensureByteArray("data",s);const n=s.length*s.BYTES_PER_ELEMENT,c=e._malloc(n);e.HEAP8.set(s,c);const i=e._vsc_data_ctx_size(),a=e._malloc(i);e._vsc_data(a,c,n);const o=this.decryptedLen(_,s.length),l=e._vsc_buffer_new_with_capacity(o);try{const t=e._vscf_ecies_decrypt(this.ctxPtr,_.ctxPtr,a,l);r.FoundationError.handleStatusCode(t);const s=e._vsc_buffer_bytes(l),n=e._vsc_buffer_len(l);return e.HEAPU8.slice(s,s+n)}finally{e._free(c),e._free(a),e._vsc_buffer_delete(l)}}}return _}}(),Vr=function(){if(q)return V;q=1;const t=Ar();return V=(e,r)=>{class _{constructor(t){this.name="RecipientCipher",this.ctxPtr=void 0===t?e._vscf_recipient_cipher_new():t}static newAndUseCContext(t){return new _(e._vscf_recipient_cipher_shallow_copy(t))}static newAndTakeCContext(t){return new _(t)}delete(){void 0!==this.ctxPtr&&null!==this.ctxPtr&&(e._vscf_recipient_cipher_delete(this.ctxPtr),this.ctxPtr=null)}set random(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("random",_,"Foundation.Random",r.FoundationInterfaceTag.RANDOM,r.FoundationInterface),e._vscf_recipient_cipher_release_random(this.ctxPtr),e._vscf_recipient_cipher_use_random(this.ctxPtr,_.ctxPtr)}set encryptionCipher(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("encryptionCipher",_,"Foundation.Cipher",r.FoundationInterfaceTag.CIPHER,r.FoundationInterface),e._vscf_recipient_cipher_release_encryption_cipher(this.ctxPtr),e._vscf_recipient_cipher_use_encryption_cipher(this.ctxPtr,_.ctxPtr)}set encryptionPadding(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("encryptionPadding",_,"Foundation.Padding",r.FoundationInterfaceTag.PADDING,r.FoundationInterface),e._vscf_recipient_cipher_release_encryption_padding(this.ctxPtr),e._vscf_recipient_cipher_use_encryption_padding(this.ctxPtr,_.ctxPtr)}set paddingParams(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureClass("paddingParams",_,r.PaddingParams),e._vscf_recipient_cipher_release_padding_params(this.ctxPtr),e._vscf_recipient_cipher_use_padding_params(this.ctxPtr,_.ctxPtr)}set signerHash(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("signerHash",_,"Foundation.Hash",r.FoundationInterfaceTag.HASH,r.FoundationInterface),e._vscf_recipient_cipher_release_signer_hash(this.ctxPtr),e._vscf_recipient_cipher_use_signer_hash(this.ctxPtr,_.ctxPtr)}hasKeyRecipient(r){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureByteArray("recipientId",r);const _=r.length*r.BYTES_PER_ELEMENT,s=e._malloc(_);e.HEAP8.set(r,s);const n=e._vsc_data_ctx_size(),c=e._malloc(n);e._vsc_data(c,s,_);try{return!!e._vscf_recipient_cipher_has_key_recipient(this.ctxPtr,c)}finally{e._free(s),e._free(c)}}addKeyRecipient(_,s){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureByteArray("recipientId",_),t.ensureImplementInterface("publicKey",s,"Foundation.PublicKey",r.FoundationInterfaceTag.PUBLIC_KEY,r.FoundationInterface);const n=_.length*_.BYTES_PER_ELEMENT,c=e._malloc(n);e.HEAP8.set(_,c);const i=e._vsc_data_ctx_size(),a=e._malloc(i);e._vsc_data(a,c,n);try{e._vscf_recipient_cipher_add_key_recipient(this.ctxPtr,a,s.ctxPtr)}finally{e._free(c),e._free(a)}}clearRecipients(){t.ensureNotNull("this.ctxPtr",this.ctxPtr),e._vscf_recipient_cipher_clear_recipients(this.ctxPtr)}addSigner(_,s){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureByteArray("signerId",_),t.ensureImplementInterface("privateKey",s,"Foundation.PrivateKey",r.FoundationInterfaceTag.PRIVATE_KEY,r.FoundationInterface);const n=_.length*_.BYTES_PER_ELEMENT,c=e._malloc(n);e.HEAP8.set(_,c);const i=e._vsc_data_ctx_size(),a=e._malloc(i);e._vsc_data(a,c,n);try{const t=e._vscf_recipient_cipher_add_signer(this.ctxPtr,a,s.ctxPtr);r.FoundationError.handleStatusCode(t)}finally{e._free(c),e._free(a)}}clearSigners(){t.ensureNotNull("this.ctxPtr",this.ctxPtr),e._vscf_recipient_cipher_clear_signers(this.ctxPtr)}customParams(){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),_=e._vscf_recipient_cipher_custom_params(this.ctxPtr),r.MessageInfoCustomParams.newAndUseCContext(_)}startEncryption(){t.ensureNotNull("this.ctxPtr",this.ctxPtr);const _=e._vscf_recipient_cipher_start_encryption(this.ctxPtr);r.FoundationError.handleStatusCode(_)}startSignedEncryption(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureNumber("dataSize",_);const s=e._vscf_recipient_cipher_start_signed_encryption(this.ctxPtr,_);r.FoundationError.handleStatusCode(s)}messageInfoLen(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_recipient_cipher_message_info_len(this.ctxPtr),r}packMessageInfo(){t.ensureNotNull("this.ctxPtr",this.ctxPtr);const r=this.messageInfoLen(),_=e._vsc_buffer_new_with_capacity(r);try{e._vscf_recipient_cipher_pack_message_info(this.ctxPtr,_);const t=e._vsc_buffer_bytes(_),r=e._vsc_buffer_len(_);return e.HEAPU8.slice(t,t+r)}finally{e._vsc_buffer_delete(_)}}encryptionOutLen(r){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureNumber("dataLen",r),_=e._vscf_recipient_cipher_encryption_out_len(this.ctxPtr,r),_}processEncryption(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureByteArray("data",_);const s=_.length*_.BYTES_PER_ELEMENT,n=e._malloc(s);e.HEAP8.set(_,n);const c=e._vsc_data_ctx_size(),i=e._malloc(c);e._vsc_data(i,n,s);const a=this.encryptionOutLen(_.length),o=e._vsc_buffer_new_with_capacity(a);try{const t=e._vscf_recipient_cipher_process_encryption(this.ctxPtr,i,o);r.FoundationError.handleStatusCode(t);const _=e._vsc_buffer_bytes(o),s=e._vsc_buffer_len(o);return e.HEAPU8.slice(_,_+s)}finally{e._free(n),e._free(i),e._vsc_buffer_delete(o)}}finishEncryption(){t.ensureNotNull("this.ctxPtr",this.ctxPtr);const _=this.encryptionOutLen(0),s=e._vsc_buffer_new_with_capacity(_);try{const t=e._vscf_recipient_cipher_finish_encryption(this.ctxPtr,s);r.FoundationError.handleStatusCode(t);const _=e._vsc_buffer_bytes(s),n=e._vsc_buffer_len(s);return e.HEAPU8.slice(_,_+n)}finally{e._vsc_buffer_delete(s)}}startDecryptionWithKey(_,s,n){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureByteArray("recipientId",_),t.ensureImplementInterface("privateKey",s,"Foundation.PrivateKey",r.FoundationInterfaceTag.PRIVATE_KEY,r.FoundationInterface),t.ensureByteArray("messageInfo",n);const c=_.length*_.BYTES_PER_ELEMENT,i=e._malloc(c);e.HEAP8.set(_,i);const a=e._vsc_data_ctx_size(),o=e._malloc(a);e._vsc_data(o,i,c);const l=n.length*n.BYTES_PER_ELEMENT,u=e._malloc(l);e.HEAP8.set(n,u);const f=e._vsc_data_ctx_size(),d=e._malloc(f);e._vsc_data(d,u,l);try{const t=e._vscf_recipient_cipher_start_decryption_with_key(this.ctxPtr,o,s.ctxPtr,d);r.FoundationError.handleStatusCode(t)}finally{e._free(i),e._free(o),e._free(u),e._free(d)}}startVerifiedDecryptionWithKey(_,s,n,c){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureByteArray("recipientId",_),t.ensureImplementInterface("privateKey",s,"Foundation.PrivateKey",r.FoundationInterfaceTag.PRIVATE_KEY,r.FoundationInterface),t.ensureByteArray("messageInfo",n),t.ensureByteArray("messageInfoFooter",c);const i=_.length*_.BYTES_PER_ELEMENT,a=e._malloc(i);e.HEAP8.set(_,a);const o=e._vsc_data_ctx_size(),l=e._malloc(o);e._vsc_data(l,a,i);const u=n.length*n.BYTES_PER_ELEMENT,f=e._malloc(u);e.HEAP8.set(n,f);const d=e._vsc_data_ctx_size(),h=e._malloc(d);e._vsc_data(h,f,u);const P=c.length*c.BYTES_PER_ELEMENT,v=e._malloc(P);e.HEAP8.set(c,v);const x=e._vsc_data_ctx_size(),y=e._malloc(x);e._vsc_data(y,v,P);try{const t=e._vscf_recipient_cipher_start_verified_decryption_with_key(this.ctxPtr,l,s.ctxPtr,h,y);r.FoundationError.handleStatusCode(t)}finally{e._free(a),e._free(l),e._free(f),e._free(h),e._free(v),e._free(y)}}decryptionOutLen(r){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureNumber("dataLen",r),_=e._vscf_recipient_cipher_decryption_out_len(this.ctxPtr,r),_}processDecryption(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureByteArray("data",_);const s=_.length*_.BYTES_PER_ELEMENT,n=e._malloc(s);e.HEAP8.set(_,n);const c=e._vsc_data_ctx_size(),i=e._malloc(c);e._vsc_data(i,n,s);const a=this.decryptionOutLen(_.length),o=e._vsc_buffer_new_with_capacity(a);try{const t=e._vscf_recipient_cipher_process_decryption(this.ctxPtr,i,o);r.FoundationError.handleStatusCode(t);const _=e._vsc_buffer_bytes(o),s=e._vsc_buffer_len(o);return e.HEAPU8.slice(_,_+s)}finally{e._free(n),e._free(i),e._vsc_buffer_delete(o)}}finishDecryption(){t.ensureNotNull("this.ctxPtr",this.ctxPtr);const _=this.decryptionOutLen(0),s=e._vsc_buffer_new_with_capacity(_);try{const t=e._vscf_recipient_cipher_finish_decryption(this.ctxPtr,s);r.FoundationError.handleStatusCode(t);const _=e._vsc_buffer_bytes(s),n=e._vsc_buffer_len(s);return e.HEAPU8.slice(_,_+n)}finally{e._vsc_buffer_delete(s)}}isDataSigned(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_recipient_cipher_is_data_signed(this.ctxPtr),!!r}signerInfos(){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),_=e._vscf_recipient_cipher_signer_infos(this.ctxPtr),r.SignerInfoList.newAndUseCContext(_)}verifySignerInfo(_,s){let n;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureClass("signerInfo",_,r.SignerInfo),t.ensureImplementInterface("publicKey",s,"Foundation.PublicKey",r.FoundationInterfaceTag.PUBLIC_KEY,r.FoundationInterface),n=e._vscf_recipient_cipher_verify_signer_info(this.ctxPtr,_.ctxPtr,s.ctxPtr),!!n}messageInfoFooterLen(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_recipient_cipher_message_info_footer_len(this.ctxPtr),r}packMessageInfoFooter(){t.ensureNotNull("this.ctxPtr",this.ctxPtr);const _=this.messageInfoFooterLen(),s=e._vsc_buffer_new_with_capacity(_);try{const t=e._vscf_recipient_cipher_pack_message_info_footer(this.ctxPtr,s);r.FoundationError.handleStatusCode(t);const _=e._vsc_buffer_bytes(s),n=e._vsc_buffer_len(s);return e.HEAPU8.slice(_,_+n)}finally{e._vsc_buffer_delete(s)}}}return _}}(),qr=function(){if(X)return j;X=1;const t=Ar();return j=(e,r)=>{class _{constructor(t){this.name="MessageInfoCustomParams",this.ctxPtr=void 0===t?e._vscf_message_info_custom_params_new():t}static newAndUseCContext(t){return new _(e._vscf_message_info_custom_params_shallow_copy(t))}static newAndTakeCContext(t){return new _(t)}delete(){void 0!==this.ctxPtr&&null!==this.ctxPtr&&(e._vscf_message_info_custom_params_delete(this.ctxPtr),this.ctxPtr=null)}static get OF_INT_TYPE(){return 1}get OF_INT_TYPE(){return 1}static get OF_STRING_TYPE(){return 2}get OF_STRING_TYPE(){return 2}static get OF_DATA_TYPE(){return 3}get OF_DATA_TYPE(){return 3}addInt(r,_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureByteArray("key",r),t.ensureNumber("value",_);const s=r.length*r.BYTES_PER_ELEMENT,n=e._malloc(s);e.HEAP8.set(r,n);const c=e._vsc_data_ctx_size(),i=e._malloc(c);e._vsc_data(i,n,s);try{e._vscf_message_info_custom_params_add_int(this.ctxPtr,i,_)}finally{e._free(n),e._free(i)}}addString(r,_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureByteArray("key",r),t.ensureByteArray("value",_);const s=r.length*r.BYTES_PER_ELEMENT,n=e._malloc(s);e.HEAP8.set(r,n);const c=e._vsc_data_ctx_size(),i=e._malloc(c);e._vsc_data(i,n,s);const a=_.length*_.BYTES_PER_ELEMENT,o=e._malloc(a);e.HEAP8.set(_,o);const l=e._vsc_data_ctx_size(),u=e._malloc(l);e._vsc_data(u,o,a);try{e._vscf_message_info_custom_params_add_string(this.ctxPtr,i,u)}finally{e._free(n),e._free(i),e._free(o),e._free(u)}}addData(r,_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureByteArray("key",r),t.ensureByteArray("value",_);const s=r.length*r.BYTES_PER_ELEMENT,n=e._malloc(s);e.HEAP8.set(r,n);const c=e._vsc_data_ctx_size(),i=e._malloc(c);e._vsc_data(i,n,s);const a=_.length*_.BYTES_PER_ELEMENT,o=e._malloc(a);e.HEAP8.set(_,o);const l=e._vsc_data_ctx_size(),u=e._malloc(l);e._vsc_data(u,o,a);try{e._vscf_message_info_custom_params_add_data(this.ctxPtr,i,u)}finally{e._free(n),e._free(i),e._free(o),e._free(u)}}clear(){t.ensureNotNull("this.ctxPtr",this.ctxPtr),e._vscf_message_info_custom_params_clear(this.ctxPtr)}findInt(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureByteArray("key",_);const s=_.length*_.BYTES_PER_ELEMENT,n=e._malloc(s);e.HEAP8.set(_,n);const c=e._vsc_data_ctx_size(),i=e._malloc(c);e._vsc_data(i,n,s);const a=e._vscf_error_ctx_size(),o=e._malloc(a);let l;e._vscf_error_reset(o);try{l=e._vscf_message_info_custom_params_find_int(this.ctxPtr,i,o);const t=e._vscf_error_status(o);r.FoundationError.handleStatusCode(t)}finally{e._free(n),e._free(i),e._free(o)}}findString(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureByteArray("key",_);const s=_.length*_.BYTES_PER_ELEMENT,n=e._malloc(s);e.HEAP8.set(_,n);const c=e._vsc_data_ctx_size(),i=e._malloc(c);e._vsc_data(i,n,s);const a=e._vscf_error_ctx_size(),o=e._malloc(a);let l;e._vscf_error_reset(o);try{l=e._vscf_message_info_custom_params_find_string(this.ctxPtr,i,o);const t=e._vscf_error_status(o);r.FoundationError.handleStatusCode(t)}finally{e._free(n),e._free(i),e._free(o)}}findData(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureByteArray("key",_);const s=_.length*_.BYTES_PER_ELEMENT,n=e._malloc(s);e.HEAP8.set(_,n);const c=e._vsc_data_ctx_size(),i=e._malloc(c);e._vsc_data(i,n,s);const a=e._vscf_error_ctx_size(),o=e._malloc(a);let l;e._vscf_error_reset(o);try{l=e._vscf_message_info_custom_params_find_data(this.ctxPtr,i,o);const t=e._vscf_error_status(o);r.FoundationError.handleStatusCode(t)}finally{e._free(n),e._free(i),e._free(o)}}hasParams(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_message_info_custom_params_has_params(this.ctxPtr),!!r}}return _}}(),jr=function(){if(Z)return W;Z=1;const t=Ar();return W=(e,r)=>{class _{constructor(t){this.name="KeyProvider",this.ctxPtr=void 0===t?e._vscf_key_provider_new():t}static newAndUseCContext(t){return new _(e._vscf_key_provider_shallow_copy(t))}static newAndTakeCContext(t){return new _(t)}delete(){void 0!==this.ctxPtr&&null!==this.ctxPtr&&(e._vscf_key_provider_delete(this.ctxPtr),this.ctxPtr=null)}set random(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("random",_,"Foundation.Random",r.FoundationInterfaceTag.RANDOM,r.FoundationInterface),e._vscf_key_provider_release_random(this.ctxPtr),e._vscf_key_provider_use_random(this.ctxPtr,_.ctxPtr)}setupDefaults(){t.ensureNotNull("this.ctxPtr",this.ctxPtr);const _=e._vscf_key_provider_setup_defaults(this.ctxPtr);r.FoundationError.handleStatusCode(_)}setRsaParams(r){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureNumber("bitlen",r),e._vscf_key_provider_set_rsa_params(this.ctxPtr,r)}generatePrivateKey(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr);const s=e._vscf_error_ctx_size(),n=e._malloc(s);let c;e._vscf_error_reset(n);try{c=e._vscf_key_provider_generate_private_key(this.ctxPtr,_,n);const t=e._vscf_error_status(n);return r.FoundationError.handleStatusCode(t),r.FoundationInterface.newAndTakeCContext(c)}finally{e._free(n)}}generatePostQuantumPrivateKey(){t.ensureNotNull("this.ctxPtr",this.ctxPtr);const _=e._vscf_error_ctx_size(),s=e._malloc(_);let n;e._vscf_error_reset(s);try{n=e._vscf_key_provider_generate_post_quantum_private_key(this.ctxPtr,s);const t=e._vscf_error_status(s);return r.FoundationError.handleStatusCode(t),r.FoundationInterface.newAndTakeCContext(n)}finally{e._free(s)}}generateCompoundPrivateKey(_,s){t.ensureNotNull("this.ctxPtr",this.ctxPtr);const n=e._vscf_error_ctx_size(),c=e._malloc(n);let i;e._vscf_error_reset(c);try{i=e._vscf_key_provider_generate_compound_private_key(this.ctxPtr,_,s,c);const t=e._vscf_error_status(c);return r.FoundationError.handleStatusCode(t),r.FoundationInterface.newAndTakeCContext(i)}finally{e._free(c)}}generateHybridPrivateKey(_,s){t.ensureNotNull("this.ctxPtr",this.ctxPtr);const n=e._vscf_error_ctx_size(),c=e._malloc(n);let i;e._vscf_error_reset(c);try{i=e._vscf_key_provider_generate_hybrid_private_key(this.ctxPtr,_,s,c);const t=e._vscf_error_status(c);return r.FoundationError.handleStatusCode(t),r.FoundationInterface.newAndTakeCContext(i)}finally{e._free(c)}}generateCompoundHybridPrivateKey(_,s,n,c){t.ensureNotNull("this.ctxPtr",this.ctxPtr);const i=e._vscf_error_ctx_size(),a=e._malloc(i);let o;e._vscf_error_reset(a);try{o=e._vscf_key_provider_generate_compound_hybrid_private_key(this.ctxPtr,_,s,n,c,a);const t=e._vscf_error_status(a);return r.FoundationError.handleStatusCode(t),r.FoundationInterface.newAndTakeCContext(o)}finally{e._free(a)}}importPrivateKey(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureByteArray("keyData",_);const s=_.length*_.BYTES_PER_ELEMENT,n=e._malloc(s);e.HEAP8.set(_,n);const c=e._vsc_data_ctx_size(),i=e._malloc(c);e._vsc_data(i,n,s);const a=e._vscf_error_ctx_size(),o=e._malloc(a);let l;e._vscf_error_reset(o);try{l=e._vscf_key_provider_import_private_key(this.ctxPtr,i,o);const t=e._vscf_error_status(o);return r.FoundationError.handleStatusCode(t),r.FoundationInterface.newAndTakeCContext(l)}finally{e._free(n),e._free(i),e._free(o)}}importPublicKey(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureByteArray("keyData",_);const s=_.length*_.BYTES_PER_ELEMENT,n=e._malloc(s);e.HEAP8.set(_,n);const c=e._vsc_data_ctx_size(),i=e._malloc(c);e._vsc_data(i,n,s);const a=e._vscf_error_ctx_size(),o=e._malloc(a);let l;e._vscf_error_reset(o);try{l=e._vscf_key_provider_import_public_key(this.ctxPtr,i,o);const t=e._vscf_error_status(o);return r.FoundationError.handleStatusCode(t),r.FoundationInterface.newAndTakeCContext(l)}finally{e._free(n),e._free(i),e._free(o)}}exportedPublicKeyLen(_){let s;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("publicKey",_,"Foundation.PublicKey",r.FoundationInterfaceTag.PUBLIC_KEY,r.FoundationInterface),s=e._vscf_key_provider_exported_public_key_len(this.ctxPtr,_.ctxPtr),s}exportPublicKey(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("publicKey",_,"Foundation.PublicKey",r.FoundationInterfaceTag.PUBLIC_KEY,r.FoundationInterface);const s=this.exportedPublicKeyLen(_),n=e._vsc_buffer_new_with_capacity(s);try{const t=e._vscf_key_provider_export_public_key(this.ctxPtr,_.ctxPtr,n);r.FoundationError.handleStatusCode(t);const s=e._vsc_buffer_bytes(n),c=e._vsc_buffer_len(n);return e.HEAPU8.slice(s,s+c)}finally{e._vsc_buffer_delete(n)}}exportedPrivateKeyLen(_){let s;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("privateKey",_,"Foundation.PrivateKey",r.FoundationInterfaceTag.PRIVATE_KEY,r.FoundationInterface),s=e._vscf_key_provider_exported_private_key_len(this.ctxPtr,_.ctxPtr),s}exportPrivateKey(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("privateKey",_,"Foundation.PrivateKey",r.FoundationInterfaceTag.PRIVATE_KEY,r.FoundationInterface);const s=this.exportedPrivateKeyLen(_),n=e._vsc_buffer_new_with_capacity(s);try{const t=e._vscf_key_provider_export_private_key(this.ctxPtr,_.ctxPtr,n);r.FoundationError.handleStatusCode(t);const s=e._vsc_buffer_bytes(n),c=e._vsc_buffer_len(n);return e.HEAPU8.slice(s,s+c)}finally{e._vsc_buffer_delete(n)}}}return _}}(),Xr=function(){if(Q)return $;Q=1;const t=Ar();return $=(e,r)=>{class _{constructor(t){this.name="Signer",this.ctxPtr=void 0===t?e._vscf_signer_new():t}static newAndUseCContext(t){return new _(e._vscf_signer_shallow_copy(t))}static newAndTakeCContext(t){return new _(t)}delete(){void 0!==this.ctxPtr&&null!==this.ctxPtr&&(e._vscf_signer_delete(this.ctxPtr),this.ctxPtr=null)}set hash(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("hash",_,"Foundation.Hash",r.FoundationInterfaceTag.HASH,r.FoundationInterface),e._vscf_signer_release_hash(this.ctxPtr),e._vscf_signer_use_hash(this.ctxPtr,_.ctxPtr)}set random(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("random",_,"Foundation.Random",r.FoundationInterfaceTag.RANDOM,r.FoundationInterface),e._vscf_signer_release_random(this.ctxPtr),e._vscf_signer_use_random(this.ctxPtr,_.ctxPtr)}reset(){t.ensureNotNull("this.ctxPtr",this.ctxPtr),e._vscf_signer_reset(this.ctxPtr)}appendData(r){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureByteArray("data",r);const _=r.length*r.BYTES_PER_ELEMENT,s=e._malloc(_);e.HEAP8.set(r,s);const n=e._vsc_data_ctx_size(),c=e._malloc(n);e._vsc_data(c,s,_);try{e._vscf_signer_append_data(this.ctxPtr,c)}finally{e._free(s),e._free(c)}}signatureLen(_){let s;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("privateKey",_,"Foundation.PrivateKey",r.FoundationInterfaceTag.PRIVATE_KEY,r.FoundationInterface),s=e._vscf_signer_signature_len(this.ctxPtr,_.ctxPtr),s}sign(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("privateKey",_,"Foundation.PrivateKey",r.FoundationInterfaceTag.PRIVATE_KEY,r.FoundationInterface);const s=this.signatureLen(_),n=e._vsc_buffer_new_with_capacity(s);try{const t=e._vscf_signer_sign(this.ctxPtr,_.ctxPtr,n);r.FoundationError.handleStatusCode(t);const s=e._vsc_buffer_bytes(n),c=e._vsc_buffer_len(n);return e.HEAPU8.slice(s,s+c)}finally{e._vsc_buffer_delete(n)}}}return _}}(),Wr=function(){if(tt)return J;tt=1;const t=Ar();return J=(e,r)=>{class _{constructor(t){this.name="Verifier",this.ctxPtr=void 0===t?e._vscf_verifier_new():t}static newAndUseCContext(t){return new _(e._vscf_verifier_shallow_copy(t))}static newAndTakeCContext(t){return new _(t)}delete(){void 0!==this.ctxPtr&&null!==this.ctxPtr&&(e._vscf_verifier_delete(this.ctxPtr),this.ctxPtr=null)}reset(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureByteArray("signature",_);const s=_.length*_.BYTES_PER_ELEMENT,n=e._malloc(s);e.HEAP8.set(_,n);const c=e._vsc_data_ctx_size(),i=e._malloc(c);e._vsc_data(i,n,s);try{const t=e._vscf_verifier_reset(this.ctxPtr,i);r.FoundationError.handleStatusCode(t)}finally{e._free(n),e._free(i)}}appendData(r){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureByteArray("data",r);const _=r.length*r.BYTES_PER_ELEMENT,s=e._malloc(_);e.HEAP8.set(r,s);const n=e._vsc_data_ctx_size(),c=e._malloc(n);e._vsc_data(c,s,_);try{e._vscf_verifier_append_data(this.ctxPtr,c)}finally{e._free(s),e._free(c)}}verify(_){let s;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("publicKey",_,"Foundation.PublicKey",r.FoundationInterfaceTag.PUBLIC_KEY,r.FoundationInterface),s=e._vscf_verifier_verify(this.ctxPtr,_.ctxPtr),!!s}}return _}}(),Zr=function(){if(rt)return et;rt=1;const t=Ar();return et=(e,r)=>{class _{constructor(t){this.name="BrainkeyClient",this.ctxPtr=void 0===t?e._vscf_brainkey_client_new():t}static newAndUseCContext(t){return new _(e._vscf_brainkey_client_shallow_copy(t))}static newAndTakeCContext(t){return new _(t)}delete(){void 0!==this.ctxPtr&&null!==this.ctxPtr&&(e._vscf_brainkey_client_delete(this.ctxPtr),this.ctxPtr=null)}set random(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("random",_,"Foundation.Random",r.FoundationInterfaceTag.RANDOM,r.FoundationInterface),e._vscf_brainkey_client_release_random(this.ctxPtr),e._vscf_brainkey_client_use_random(this.ctxPtr,_.ctxPtr)}set operationRandom(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("operationRandom",_,"Foundation.Random",r.FoundationInterfaceTag.RANDOM,r.FoundationInterface),e._vscf_brainkey_client_release_operation_random(this.ctxPtr),e._vscf_brainkey_client_use_operation_random(this.ctxPtr,_.ctxPtr)}static get POINT_LEN(){return 65}get POINT_LEN(){return 65}static get MPI_LEN(){return 32}get MPI_LEN(){return 32}static get SEED_LEN(){return 32}get SEED_LEN(){return 32}static get MAX_PASSWORD_LEN(){return 128}get MAX_PASSWORD_LEN(){return 128}static get MAX_KEY_NAME_LEN(){return 128}get MAX_KEY_NAME_LEN(){return 128}setupDefaults(){t.ensureNotNull("this.ctxPtr",this.ctxPtr);const _=e._vscf_brainkey_client_setup_defaults(this.ctxPtr);r.FoundationError.handleStatusCode(_)}blind(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureByteArray("password",_);const s=_.length*_.BYTES_PER_ELEMENT,n=e._malloc(s);e.HEAP8.set(_,n);const c=e._vsc_data_ctx_size(),i=e._malloc(c);e._vsc_data(i,n,s);const a=this.MPI_LEN,o=e._vsc_buffer_new_with_capacity(a),l=this.POINT_LEN,u=e._vsc_buffer_new_with_capacity(l);try{const t=e._vscf_brainkey_client_blind(this.ctxPtr,i,o,u);r.FoundationError.handleStatusCode(t);const _=e._vsc_buffer_bytes(o),s=e._vsc_buffer_len(o),n=e.HEAPU8.slice(_,_+s),c=e._vsc_buffer_bytes(u),a=e._vsc_buffer_len(u);return{deblindFactor:n,blindedPoint:e.HEAPU8.slice(c,c+a)}}finally{e._free(n),e._free(i),e._vsc_buffer_delete(o),e._vsc_buffer_delete(u)}}deblind(_,s,n,c){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureByteArray("password",_),t.ensureByteArray("hardenedPoint",s),t.ensureByteArray("deblindFactor",n),t.ensureByteArray("keyName",c);const i=_.length*_.BYTES_PER_ELEMENT,a=e._malloc(i);e.HEAP8.set(_,a);const o=e._vsc_data_ctx_size(),l=e._malloc(o);e._vsc_data(l,a,i);const u=s.length*s.BYTES_PER_ELEMENT,f=e._malloc(u);e.HEAP8.set(s,f);const d=e._vsc_data_ctx_size(),h=e._malloc(d);e._vsc_data(h,f,u);const P=n.length*n.BYTES_PER_ELEMENT,v=e._malloc(P);e.HEAP8.set(n,v);const x=e._vsc_data_ctx_size(),y=e._malloc(x);e._vsc_data(y,v,P);const p=c.length*c.BYTES_PER_ELEMENT,g=e._malloc(p);e.HEAP8.set(c,g);const m=e._vsc_data_ctx_size(),N=e._malloc(m);e._vsc_data(N,g,p);const I=this.POINT_LEN,E=e._vsc_buffer_new_with_capacity(I);try{const t=e._vscf_brainkey_client_deblind(this.ctxPtr,l,h,y,N,E);r.FoundationError.handleStatusCode(t);const _=e._vsc_buffer_bytes(E),s=e._vsc_buffer_len(E);return e.HEAPU8.slice(_,_+s)}finally{e._free(a),e._free(l),e._free(f),e._free(h),e._free(v),e._free(y),e._free(g),e._free(N),e._vsc_buffer_delete(E)}}}return _}}(),$r=function(){if(st)return _t;st=1;const t=Ar();return _t=(e,r)=>{class _{constructor(t){this.name="BrainkeyServer",this.ctxPtr=void 0===t?e._vscf_brainkey_server_new():t}static newAndUseCContext(t){return new _(e._vscf_brainkey_server_shallow_copy(t))}static newAndTakeCContext(t){return new _(t)}delete(){void 0!==this.ctxPtr&&null!==this.ctxPtr&&(e._vscf_brainkey_server_delete(this.ctxPtr),this.ctxPtr=null)}set random(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("random",_,"Foundation.Random",r.FoundationInterfaceTag.RANDOM,r.FoundationInterface),e._vscf_brainkey_server_release_random(this.ctxPtr),e._vscf_brainkey_server_use_random(this.ctxPtr,_.ctxPtr)}set operationRandom(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("operationRandom",_,"Foundation.Random",r.FoundationInterfaceTag.RANDOM,r.FoundationInterface),e._vscf_brainkey_server_release_operation_random(this.ctxPtr),e._vscf_brainkey_server_use_operation_random(this.ctxPtr,_.ctxPtr)}static get POINT_LEN(){return 65}get POINT_LEN(){return 65}static get MPI_LEN(){return 32}get MPI_LEN(){return 32}setupDefaults(){t.ensureNotNull("this.ctxPtr",this.ctxPtr);const _=e._vscf_brainkey_server_setup_defaults(this.ctxPtr);r.FoundationError.handleStatusCode(_)}generateIdentitySecret(){t.ensureNotNull("this.ctxPtr",this.ctxPtr);const _=this.MPI_LEN,s=e._vsc_buffer_new_with_capacity(_);try{const t=e._vscf_brainkey_server_generate_identity_secret(this.ctxPtr,s);r.FoundationError.handleStatusCode(t);const _=e._vsc_buffer_bytes(s),n=e._vsc_buffer_len(s);return e.HEAPU8.slice(_,_+n)}finally{e._vsc_buffer_delete(s)}}harden(_,s){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureByteArray("identitySecret",_),t.ensureByteArray("blindedPoint",s);const n=_.length*_.BYTES_PER_ELEMENT,c=e._malloc(n);e.HEAP8.set(_,c);const i=e._vsc_data_ctx_size(),a=e._malloc(i);e._vsc_data(a,c,n);const o=s.length*s.BYTES_PER_ELEMENT,l=e._malloc(o);e.HEAP8.set(s,l);const u=e._vsc_data_ctx_size(),f=e._malloc(u);e._vsc_data(f,l,o);const d=this.POINT_LEN,h=e._vsc_buffer_new_with_capacity(d);try{const t=e._vscf_brainkey_server_harden(this.ctxPtr,a,f,h);r.FoundationError.handleStatusCode(t);const _=e._vsc_buffer_bytes(h),s=e._vsc_buffer_len(h);return e.HEAPU8.slice(_,_+s)}finally{e._free(c),e._free(a),e._free(l),e._free(f),e._vsc_buffer_delete(h)}}}return _}}(),Qr=function(){if(ct)return nt;ct=1;const t=Ar();return nt=(e,r)=>{class _{constructor(t){this.name="GroupSessionMessage",this.ctxPtr=void 0===t?e._vscf_group_session_message_new():t}static newAndUseCContext(t){return new _(e._vscf_group_session_message_shallow_copy(t))}static newAndTakeCContext(t){return new _(t)}delete(){void 0!==this.ctxPtr&&null!==this.ctxPtr&&(e._vscf_group_session_message_delete(this.ctxPtr),this.ctxPtr=null)}static get MAX_MESSAGE_LEN(){return 30188}get MAX_MESSAGE_LEN(){return 30188}static get MESSAGE_VERSION(){return 1}get MESSAGE_VERSION(){return 1}getType(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_group_session_message_get_type(this.ctxPtr),r}getSessionId(){t.ensureNotNull("this.ctxPtr",this.ctxPtr),e._vscf_group_session_message_get_session_id(this.ctxPtr)}getEpoch(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_group_session_message_get_epoch(this.ctxPtr),r}serializeLen(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_group_session_message_serialize_len(this.ctxPtr),r}serialize(){t.ensureNotNull("this.ctxPtr",this.ctxPtr);const r=this.serializeLen(),_=e._vsc_buffer_new_with_capacity(r);try{e._vscf_group_session_message_serialize(this.ctxPtr,_);const t=e._vsc_buffer_bytes(_),r=e._vsc_buffer_len(_);return e.HEAPU8.slice(t,t+r)}finally{e._vsc_buffer_delete(_)}}static deserialize(_){t.ensureByteArray("input",_);const s=_.length*_.BYTES_PER_ELEMENT,n=e._malloc(s);e.HEAP8.set(_,n);const c=e._vsc_data_ctx_size(),i=e._malloc(c);e._vsc_data(i,n,s);const a=e._vscf_error_ctx_size(),o=e._malloc(a);let l;e._vscf_error_reset(o);try{l=e._vscf_group_session_message_deserialize(i,o);const t=e._vscf_error_status(o);return r.FoundationError.handleStatusCode(t),r.Self.newAndTakeCContext(l)}finally{e._free(n),e._free(i),e._free(o)}}deserialize(t){return _.deserialize(t)}}return _}}(),Jr=function(){if(at)return it;at=1;const t=Ar();return it=(e,r)=>{class _{constructor(t){this.name="GroupSessionTicket",this.ctxPtr=void 0===t?e._vscf_group_session_ticket_new():t}static newAndUseCContext(t){return new _(e._vscf_group_session_ticket_shallow_copy(t))}static newAndTakeCContext(t){return new _(t)}delete(){void 0!==this.ctxPtr&&null!==this.ctxPtr&&(e._vscf_group_session_ticket_delete(this.ctxPtr),this.ctxPtr=null)}set rng(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("rng",_,"Foundation.Random",r.FoundationInterfaceTag.RANDOM,r.FoundationInterface),e._vscf_group_session_ticket_release_rng(this.ctxPtr),e._vscf_group_session_ticket_use_rng(this.ctxPtr,_.ctxPtr)}setupDefaults(){t.ensureNotNull("this.ctxPtr",this.ctxPtr);const _=e._vscf_group_session_ticket_setup_defaults(this.ctxPtr);r.FoundationError.handleStatusCode(_)}setupTicketAsNew(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureByteArray("sessionId",_);const s=_.length*_.BYTES_PER_ELEMENT,n=e._malloc(s);e.HEAP8.set(_,n);const c=e._vsc_data_ctx_size(),i=e._malloc(c);e._vsc_data(i,n,s);try{const t=e._vscf_group_session_ticket_setup_ticket_as_new(this.ctxPtr,i);r.FoundationError.handleStatusCode(t)}finally{e._free(n),e._free(i)}}getTicketMessage(){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),_=e._vscf_group_session_ticket_get_ticket_message(this.ctxPtr),r.GroupSessionMessage.newAndUseCContext(_)}}return _}}(),t_=function(){if(lt)return ot;lt=1;const t=Ar();return ot=(e,r)=>{class _{constructor(t){this.name="GroupSession",this.ctxPtr=void 0===t?e._vscf_group_session_new():t}static newAndUseCContext(t){return new _(e._vscf_group_session_shallow_copy(t))}static newAndTakeCContext(t){return new _(t)}delete(){void 0!==this.ctxPtr&&null!==this.ctxPtr&&(e._vscf_group_session_delete(this.ctxPtr),this.ctxPtr=null)}set rng(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("rng",_,"Foundation.Random",r.FoundationInterfaceTag.RANDOM,r.FoundationInterface),e._vscf_group_session_release_rng(this.ctxPtr),e._vscf_group_session_use_rng(this.ctxPtr,_.ctxPtr)}static get SENDER_ID_LEN(){return 32}get SENDER_ID_LEN(){return 32}static get MAX_PLAIN_TEXT_LEN(){return 3e4}get MAX_PLAIN_TEXT_LEN(){return 3e4}static get MAX_EPOCHS_COUNT(){return 50}get MAX_EPOCHS_COUNT(){return 50}static get SALT_SIZE(){return 32}get SALT_SIZE(){return 32}getCurrentEpoch(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_group_session_get_current_epoch(this.ctxPtr),r}setupDefaults(){t.ensureNotNull("this.ctxPtr",this.ctxPtr);const _=e._vscf_group_session_setup_defaults(this.ctxPtr);r.FoundationError.handleStatusCode(_)}getSessionId(){t.ensureNotNull("this.ctxPtr",this.ctxPtr),e._vscf_group_session_get_session_id(this.ctxPtr)}addEpoch(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureClass("message",_,r.GroupSessionMessage);const s=e._vscf_group_session_add_epoch(this.ctxPtr,_.ctxPtr);r.FoundationError.handleStatusCode(s)}encrypt(_,s){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureByteArray("plainText",_),t.ensureImplementInterface("privateKey",s,"Foundation.PrivateKey",r.FoundationInterfaceTag.PRIVATE_KEY,r.FoundationInterface);const n=_.length*_.BYTES_PER_ELEMENT,c=e._malloc(n);e.HEAP8.set(_,c);const i=e._vsc_data_ctx_size(),a=e._malloc(i);e._vsc_data(a,c,n);const o=e._vscf_error_ctx_size(),l=e._malloc(o);let u;e._vscf_error_reset(l);try{u=e._vscf_group_session_encrypt(this.ctxPtr,a,s.ctxPtr,l);const t=e._vscf_error_status(l);return r.FoundationError.handleStatusCode(t),r.GroupSessionMessage.newAndTakeCContext(u)}finally{e._free(c),e._free(a),e._free(l)}}decryptLen(_){let s;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureClass("message",_,r.GroupSessionMessage),s=e._vscf_group_session_decrypt_len(this.ctxPtr,_.ctxPtr),s}decrypt(_,s){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureClass("message",_,r.GroupSessionMessage),t.ensureImplementInterface("publicKey",s,"Foundation.PublicKey",r.FoundationInterfaceTag.PUBLIC_KEY,r.FoundationInterface);const n=this.decryptLen(_),c=e._vsc_buffer_new_with_capacity(n);try{const t=e._vscf_group_session_decrypt(this.ctxPtr,_.ctxPtr,s.ctxPtr,c);r.FoundationError.handleStatusCode(t);const n=e._vsc_buffer_bytes(c),i=e._vsc_buffer_len(c);return e.HEAPU8.slice(n,n+i)}finally{e._vsc_buffer_delete(c)}}createGroupTicket(){t.ensureNotNull("this.ctxPtr",this.ctxPtr);const _=e._vscf_error_ctx_size(),s=e._malloc(_);let n;e._vscf_error_reset(s);try{n=e._vscf_group_session_create_group_ticket(this.ctxPtr,s);const t=e._vscf_error_status(s);return r.FoundationError.handleStatusCode(t),r.GroupSessionTicket.newAndTakeCContext(n)}finally{e._free(s)}}}return _}}(),e_=function(){if(ft)return ut;ft=1;const t=Ar();return ut=(e,r)=>{class _{constructor(t){this.name="MessageInfoEditor",this.ctxPtr=void 0===t?e._vscf_message_info_editor_new():t}static newAndUseCContext(t){return new _(e._vscf_message_info_editor_shallow_copy(t))}static newAndTakeCContext(t){return new _(t)}delete(){void 0!==this.ctxPtr&&null!==this.ctxPtr&&(e._vscf_message_info_editor_delete(this.ctxPtr),this.ctxPtr=null)}set random(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("random",_,"Foundation.Random",r.FoundationInterfaceTag.RANDOM,r.FoundationInterface),e._vscf_message_info_editor_release_random(this.ctxPtr),e._vscf_message_info_editor_use_random(this.ctxPtr,_.ctxPtr)}setupDefaults(){t.ensureNotNull("this.ctxPtr",this.ctxPtr);const _=e._vscf_message_info_editor_setup_defaults(this.ctxPtr);r.FoundationError.handleStatusCode(_)}unpack(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureByteArray("messageInfoData",_);const s=_.length*_.BYTES_PER_ELEMENT,n=e._malloc(s);e.HEAP8.set(_,n);const c=e._vsc_data_ctx_size(),i=e._malloc(c);e._vsc_data(i,n,s);try{const t=e._vscf_message_info_editor_unpack(this.ctxPtr,i);r.FoundationError.handleStatusCode(t)}finally{e._free(n),e._free(i)}}unlock(_,s){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureByteArray("ownerRecipientId",_),t.ensureImplementInterface("ownerPrivateKey",s,"Foundation.PrivateKey",r.FoundationInterfaceTag.PRIVATE_KEY,r.FoundationInterface);const n=_.length*_.BYTES_PER_ELEMENT,c=e._malloc(n);e.HEAP8.set(_,c);const i=e._vsc_data_ctx_size(),a=e._malloc(i);e._vsc_data(a,c,n);try{const t=e._vscf_message_info_editor_unlock(this.ctxPtr,a,s.ctxPtr);r.FoundationError.handleStatusCode(t)}finally{e._free(c),e._free(a)}}addKeyRecipient(_,s){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureByteArray("recipientId",_),t.ensureImplementInterface("publicKey",s,"Foundation.PublicKey",r.FoundationInterfaceTag.PUBLIC_KEY,r.FoundationInterface);const n=_.length*_.BYTES_PER_ELEMENT,c=e._malloc(n);e.HEAP8.set(_,c);const i=e._vsc_data_ctx_size(),a=e._malloc(i);e._vsc_data(a,c,n);try{const t=e._vscf_message_info_editor_add_key_recipient(this.ctxPtr,a,s.ctxPtr);r.FoundationError.handleStatusCode(t)}finally{e._free(c),e._free(a)}}removeKeyRecipient(r){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureByteArray("recipientId",r);const _=r.length*r.BYTES_PER_ELEMENT,s=e._malloc(_);e.HEAP8.set(r,s);const n=e._vsc_data_ctx_size(),c=e._malloc(n);e._vsc_data(c,s,_);try{return!!e._vscf_message_info_editor_remove_key_recipient(this.ctxPtr,c)}finally{e._free(s),e._free(c)}}removeAll(){t.ensureNotNull("this.ctxPtr",this.ctxPtr),e._vscf_message_info_editor_remove_all(this.ctxPtr)}packedLen(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_message_info_editor_packed_len(this.ctxPtr),r}pack(){t.ensureNotNull("this.ctxPtr",this.ctxPtr);const r=this.packedLen(),_=e._vsc_buffer_new_with_capacity(r);try{e._vscf_message_info_editor_pack(this.ctxPtr,_);const t=e._vsc_buffer_bytes(_),r=e._vsc_buffer_len(_);return e.HEAPU8.slice(t,t+r)}finally{e._vsc_buffer_delete(_)}}}return _}}(),r_=function(){if(ht)return dt;ht=1;const t=Ar();return dt=(e,r)=>{class _{constructor(t){this.name="SignerInfo",this.ctxPtr=void 0===t?e._vscf_signer_info_new():t}static newAndUseCContext(t){return new _(e._vscf_signer_info_shallow_copy(t))}static newAndTakeCContext(t){return new _(t)}delete(){void 0!==this.ctxPtr&&null!==this.ctxPtr&&(e._vscf_signer_info_delete(this.ctxPtr),this.ctxPtr=null)}signerId(){t.ensureNotNull("this.ctxPtr",this.ctxPtr),e._vscf_signer_info_signer_id(this.ctxPtr)}signerAlgInfo(){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),_=e._vscf_signer_info_signer_alg_info(this.ctxPtr),r.FoundationInterface.newAndUseCContext(_)}signature(){t.ensureNotNull("this.ctxPtr",this.ctxPtr),e._vscf_signer_info_signature(this.ctxPtr)}}return _}}(),__=function(){if(vt)return Pt;vt=1;const t=Ar();return Pt=(e,r)=>{class _{constructor(t){this.name="SignerInfoList",this.ctxPtr=void 0===t?e._vscf_signer_info_list_new():t}static newAndUseCContext(t){return new _(e._vscf_signer_info_list_shallow_copy(t))}static newAndTakeCContext(t){return new _(t)}delete(){void 0!==this.ctxPtr&&null!==this.ctxPtr&&(e._vscf_signer_info_list_delete(this.ctxPtr),this.ctxPtr=null)}hasItem(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_signer_info_list_has_item(this.ctxPtr),!!r}item(){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),_=e._vscf_signer_info_list_item(this.ctxPtr),r.SignerInfo.newAndUseCContext(_)}hasNext(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_signer_info_list_has_next(this.ctxPtr),!!r}next(){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),_=e._vscf_signer_info_list_next(this.ctxPtr),r.Self.newAndUseCContext(_)}hasPrev(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_signer_info_list_has_prev(this.ctxPtr),!!r}prev(){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),_=e._vscf_signer_info_list_prev(this.ctxPtr),r.Self.newAndUseCContext(_)}clear(){t.ensureNotNull("this.ctxPtr",this.ctxPtr),e._vscf_signer_info_list_clear(this.ctxPtr)}}return _}}(),s_=function(){if(yt)return xt;yt=1;const t=Ar();return xt=(e,r)=>{class _{constructor(t){this.name="MessageInfoFooter",this.ctxPtr=void 0===t?e._vscf_message_info_footer_new():t}static newAndUseCContext(t){return new _(e._vscf_message_info_footer_shallow_copy(t))}static newAndTakeCContext(t){return new _(t)}delete(){void 0!==this.ctxPtr&&null!==this.ctxPtr&&(e._vscf_message_info_footer_delete(this.ctxPtr),this.ctxPtr=null)}hasSignerInfos(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_message_info_footer_has_signer_infos(this.ctxPtr),!!r}signerInfos(){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),_=e._vscf_message_info_footer_signer_infos(this.ctxPtr),r.SignerInfoList.newAndUseCContext(_)}signerHashAlgInfo(){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),_=e._vscf_message_info_footer_signer_hash_alg_info(this.ctxPtr),r.FoundationInterface.newAndUseCContext(_)}signerDigest(){t.ensureNotNull("this.ctxPtr",this.ctxPtr),e._vscf_message_info_footer_signer_digest(this.ctxPtr)}}return _}}(),n_=function(){if(gt)return pt;gt=1;const t=Ar();return pt=(e,r)=>{class _{constructor(t){this.name="SignedDataInfo",this.ctxPtr=void 0===t?e._vscf_signed_data_info_new():t}static newAndUseCContext(t){return new _(e._vscf_signed_data_info_shallow_copy(t))}static newAndTakeCContext(t){return new _(t)}delete(){void 0!==this.ctxPtr&&null!==this.ctxPtr&&(e._vscf_signed_data_info_delete(this.ctxPtr),this.ctxPtr=null)}hashAlgInfo(){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),_=e._vscf_signed_data_info_hash_alg_info(this.ctxPtr),r.FoundationInterface.newAndUseCContext(_)}}return _}}(),c_=function(){if(Nt)return mt;Nt=1;const t=Ar();return mt=(e,r)=>{class _{constructor(t){this.name="FooterInfo",this.ctxPtr=void 0===t?e._vscf_footer_info_new():t}static newAndUseCContext(t){return new _(e._vscf_footer_info_shallow_copy(t))}static newAndTakeCContext(t){return new _(t)}delete(){void 0!==this.ctxPtr&&null!==this.ctxPtr&&(e._vscf_footer_info_delete(this.ctxPtr),this.ctxPtr=null)}hasSignedDataInfo(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_footer_info_has_signed_data_info(this.ctxPtr),!!r}signedDataInfo(){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),_=e._vscf_footer_info_signed_data_info(this.ctxPtr),r.SignedDataInfo.newAndUseCContext(_)}setDataSize(r){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureNumber("dataSize",r),e._vscf_footer_info_set_data_size(this.ctxPtr,r)}dataSize(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_footer_info_data_size(this.ctxPtr),r}}return _}}(),i_=function(){if(Et)return It;Et=1;const t=Ar();return It=(e,r)=>{class _{constructor(t){this.name="KeyInfo",this.ctxPtr=void 0===t?e._vscf_key_info_new():t}static newAndUseCContext(t){return new _(e._vscf_key_info_shallow_copy(t))}static newAndTakeCContext(t){return new _(t)}delete(){void 0!==this.ctxPtr&&null!==this.ctxPtr&&(e._vscf_key_info_delete(this.ctxPtr),this.ctxPtr=null)}isCompound(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_key_info_is_compound(this.ctxPtr),!!r}isHybrid(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_key_info_is_hybrid(this.ctxPtr),!!r}isCompoundHybrid(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_key_info_is_compound_hybrid(this.ctxPtr),!!r}isCompoundHybridCipher(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_key_info_is_compound_hybrid_cipher(this.ctxPtr),!!r}isCompoundHybridSigner(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_key_info_is_compound_hybrid_signer(this.ctxPtr),!!r}isHybridPostQuantum(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_key_info_is_hybrid_post_quantum(this.ctxPtr),!!r}isHybridPostQuantumCipher(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_key_info_is_hybrid_post_quantum_cipher(this.ctxPtr),!!r}isHybridPostQuantumSigner(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_key_info_is_hybrid_post_quantum_signer(this.ctxPtr),!!r}algId(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_key_info_alg_id(this.ctxPtr),r}compoundCipherAlgId(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_key_info_compound_cipher_alg_id(this.ctxPtr),r}compoundSignerAlgId(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_key_info_compound_signer_alg_id(this.ctxPtr),r}hybridFirstKeyAlgId(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_key_info_hybrid_first_key_alg_id(this.ctxPtr),r}hybridSecondKeyAlgId(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_key_info_hybrid_second_key_alg_id(this.ctxPtr),r}compoundHybridCipherFirstKeyAlgId(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_key_info_compound_hybrid_cipher_first_key_alg_id(this.ctxPtr),r}compoundHybridCipherSecondKeyAlgId(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_key_info_compound_hybrid_cipher_second_key_alg_id(this.ctxPtr),r}compoundHybridSignerFirstKeyAlgId(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_key_info_compound_hybrid_signer_first_key_alg_id(this.ctxPtr),r}compoundHybridSignerSecondKeyAlgId(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_key_info_compound_hybrid_signer_second_key_alg_id(this.ctxPtr),r}}return _}}(),a_=function(){if(bt)return wt;bt=1;const t=Ar();return wt=(e,r)=>{class _{constructor(t){this.name="PaddingParams",this.ctxPtr=void 0===t?e._vscf_padding_params_new():t}static newAndUseCContext(t){return new _(e._vscf_padding_params_shallow_copy(t))}static newAndTakeCContext(t){return new _(t)}delete(){void 0!==this.ctxPtr&&null!==this.ctxPtr&&(e._vscf_padding_params_delete(this.ctxPtr),this.ctxPtr=null)}static get DEFAULT_FRAME_MIN(){return 32}get DEFAULT_FRAME_MIN(){return 32}static get DEFAULT_FRAME(){return 160}get DEFAULT_FRAME(){return 160}static get DEFAULT_FRAME_MAX(){return 256}get DEFAULT_FRAME_MAX(){return 256}frame(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_padding_params_frame(this.ctxPtr),r}frameMax(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_padding_params_frame_max(this.ctxPtr),r}}return _}}(),o_=function(){if(At)return kt;At=1;const t=Ar();return kt=(e,r)=>{class _{constructor(t){this.name="Sha224",this.ctxPtr=void 0===t?e._vscf_sha224_new():t}static newAndUseCContext(t){return new _(e._vscf_sha224_shallow_copy(t))}static newAndTakeCContext(t){return new _(t)}delete(){void 0!==this.ctxPtr&&null!==this.ctxPtr&&(e._vscf_sha224_delete(this.ctxPtr),this.ctxPtr=null)}static get DIGEST_LEN(){return 28}get DIGEST_LEN(){return 28}static get BLOCK_LEN(){return 64}get BLOCK_LEN(){return 64}algId(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_sha224_alg_id(this.ctxPtr),r}produceAlgInfo(){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),_=e._vscf_sha224_produce_alg_info(this.ctxPtr),r.FoundationInterface.newAndTakeCContext(_)}restoreAlgInfo(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("algInfo",_,"Foundation.AlgInfo",r.FoundationInterfaceTag.ALG_INFO,r.FoundationInterface);const s=e._vscf_sha224_restore_alg_info(this.ctxPtr,_.ctxPtr);r.FoundationError.handleStatusCode(s)}static hash(r){t.ensureByteArray("data",r);const _=r.length*r.BYTES_PER_ELEMENT,s=e._malloc(_);e.HEAP8.set(r,s);const n=e._vsc_data_ctx_size(),c=e._malloc(n);e._vsc_data(c,s,_);const i=this.DIGEST_LEN,a=e._vsc_buffer_new_with_capacity(i);try{e._vscf_sha224_hash(c,a);const t=e._vsc_buffer_bytes(a),r=e._vsc_buffer_len(a);return e.HEAPU8.slice(t,t+r)}finally{e._free(s),e._free(c),e._vsc_buffer_delete(a)}}hash(t){return _.hash(t)}start(){t.ensureNotNull("this.ctxPtr",this.ctxPtr),e._vscf_sha224_start(this.ctxPtr)}update(r){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureByteArray("data",r);const _=r.length*r.BYTES_PER_ELEMENT,s=e._malloc(_);e.HEAP8.set(r,s);const n=e._vsc_data_ctx_size(),c=e._malloc(n);e._vsc_data(c,s,_);try{e._vscf_sha224_update(this.ctxPtr,c)}finally{e._free(s),e._free(c)}}finish(){t.ensureNotNull("this.ctxPtr",this.ctxPtr);const r=this.DIGEST_LEN,_=e._vsc_buffer_new_with_capacity(r);try{e._vscf_sha224_finish(this.ctxPtr,_);const t=e._vsc_buffer_bytes(_),r=e._vsc_buffer_len(_);return e.HEAPU8.slice(t,t+r)}finally{e._vsc_buffer_delete(_)}}}return _}}(),l_=function(){if(Ft)return Ct;Ft=1;const t=Ar();return Ct=(e,r)=>{class _{constructor(t){this.name="Sha256",this.ctxPtr=void 0===t?e._vscf_sha256_new():t}static newAndUseCContext(t){return new _(e._vscf_sha256_shallow_copy(t))}static newAndTakeCContext(t){return new _(t)}delete(){void 0!==this.ctxPtr&&null!==this.ctxPtr&&(e._vscf_sha256_delete(this.ctxPtr),this.ctxPtr=null)}static get DIGEST_LEN(){return 32}get DIGEST_LEN(){return 32}static get BLOCK_LEN(){return 64}get BLOCK_LEN(){return 64}algId(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_sha256_alg_id(this.ctxPtr),r}produceAlgInfo(){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),_=e._vscf_sha256_produce_alg_info(this.ctxPtr),r.FoundationInterface.newAndTakeCContext(_)}restoreAlgInfo(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("algInfo",_,"Foundation.AlgInfo",r.FoundationInterfaceTag.ALG_INFO,r.FoundationInterface);const s=e._vscf_sha256_restore_alg_info(this.ctxPtr,_.ctxPtr);r.FoundationError.handleStatusCode(s)}static hash(r){t.ensureByteArray("data",r);const _=r.length*r.BYTES_PER_ELEMENT,s=e._malloc(_);e.HEAP8.set(r,s);const n=e._vsc_data_ctx_size(),c=e._malloc(n);e._vsc_data(c,s,_);const i=this.DIGEST_LEN,a=e._vsc_buffer_new_with_capacity(i);try{e._vscf_sha256_hash(c,a);const t=e._vsc_buffer_bytes(a),r=e._vsc_buffer_len(a);return e.HEAPU8.slice(t,t+r)}finally{e._free(s),e._free(c),e._vsc_buffer_delete(a)}}hash(t){return _.hash(t)}start(){t.ensureNotNull("this.ctxPtr",this.ctxPtr),e._vscf_sha256_start(this.ctxPtr)}update(r){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureByteArray("data",r);const _=r.length*r.BYTES_PER_ELEMENT,s=e._malloc(_);e.HEAP8.set(r,s);const n=e._vsc_data_ctx_size(),c=e._malloc(n);e._vsc_data(c,s,_);try{e._vscf_sha256_update(this.ctxPtr,c)}finally{e._free(s),e._free(c)}}finish(){t.ensureNotNull("this.ctxPtr",this.ctxPtr);const r=this.DIGEST_LEN,_=e._vsc_buffer_new_with_capacity(r);try{e._vscf_sha256_finish(this.ctxPtr,_);const t=e._vsc_buffer_bytes(_),r=e._vsc_buffer_len(_);return e.HEAPU8.slice(t,t+r)}finally{e._vsc_buffer_delete(_)}}}return _}}(),u_=function(){if(Kt)return Tt;Kt=1;const t=Ar();return Tt=(e,r)=>{class _{constructor(t){this.name="Sha384",this.ctxPtr=void 0===t?e._vscf_sha384_new():t}static newAndUseCContext(t){return new _(e._vscf_sha384_shallow_copy(t))}static newAndTakeCContext(t){return new _(t)}delete(){void 0!==this.ctxPtr&&null!==this.ctxPtr&&(e._vscf_sha384_delete(this.ctxPtr),this.ctxPtr=null)}static get DIGEST_LEN(){return 48}get DIGEST_LEN(){return 48}static get BLOCK_LEN(){return 128}get BLOCK_LEN(){return 128}algId(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_sha384_alg_id(this.ctxPtr),r}produceAlgInfo(){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),_=e._vscf_sha384_produce_alg_info(this.ctxPtr),r.FoundationInterface.newAndTakeCContext(_)}restoreAlgInfo(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("algInfo",_,"Foundation.AlgInfo",r.FoundationInterfaceTag.ALG_INFO,r.FoundationInterface);const s=e._vscf_sha384_restore_alg_info(this.ctxPtr,_.ctxPtr);r.FoundationError.handleStatusCode(s)}static hash(r){t.ensureByteArray("data",r);const _=r.length*r.BYTES_PER_ELEMENT,s=e._malloc(_);e.HEAP8.set(r,s);const n=e._vsc_data_ctx_size(),c=e._malloc(n);e._vsc_data(c,s,_);const i=this.DIGEST_LEN,a=e._vsc_buffer_new_with_capacity(i);try{e._vscf_sha384_hash(c,a);const t=e._vsc_buffer_bytes(a),r=e._vsc_buffer_len(a);return e.HEAPU8.slice(t,t+r)}finally{e._free(s),e._free(c),e._vsc_buffer_delete(a)}}hash(t){return _.hash(t)}start(){t.ensureNotNull("this.ctxPtr",this.ctxPtr),e._vscf_sha384_start(this.ctxPtr)}update(r){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureByteArray("data",r);const _=r.length*r.BYTES_PER_ELEMENT,s=e._malloc(_);e.HEAP8.set(r,s);const n=e._vsc_data_ctx_size(),c=e._malloc(n);e._vsc_data(c,s,_);try{e._vscf_sha384_update(this.ctxPtr,c)}finally{e._free(s),e._free(c)}}finish(){t.ensureNotNull("this.ctxPtr",this.ctxPtr);const r=this.DIGEST_LEN,_=e._vsc_buffer_new_with_capacity(r);try{e._vscf_sha384_finish(this.ctxPtr,_);const t=e._vsc_buffer_bytes(_),r=e._vsc_buffer_len(_);return e.HEAPU8.slice(t,t+r)}finally{e._vsc_buffer_delete(_)}}}return _}}(),f_=function(){if(zt)return St;zt=1;const t=Ar();return St=(e,r)=>{class _{constructor(t){this.name="Sha512",this.ctxPtr=void 0===t?e._vscf_sha512_new():t}static newAndUseCContext(t){return new _(e._vscf_sha512_shallow_copy(t))}static newAndTakeCContext(t){return new _(t)}delete(){void 0!==this.ctxPtr&&null!==this.ctxPtr&&(e._vscf_sha512_delete(this.ctxPtr),this.ctxPtr=null)}static get DIGEST_LEN(){return 64}get DIGEST_LEN(){return 64}static get BLOCK_LEN(){return 128}get BLOCK_LEN(){return 128}algId(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_sha512_alg_id(this.ctxPtr),r}produceAlgInfo(){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),_=e._vscf_sha512_produce_alg_info(this.ctxPtr),r.FoundationInterface.newAndTakeCContext(_)}restoreAlgInfo(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("algInfo",_,"Foundation.AlgInfo",r.FoundationInterfaceTag.ALG_INFO,r.FoundationInterface);const s=e._vscf_sha512_restore_alg_info(this.ctxPtr,_.ctxPtr);r.FoundationError.handleStatusCode(s)}static hash(r){t.ensureByteArray("data",r);const _=r.length*r.BYTES_PER_ELEMENT,s=e._malloc(_);e.HEAP8.set(r,s);const n=e._vsc_data_ctx_size(),c=e._malloc(n);e._vsc_data(c,s,_);const i=this.DIGEST_LEN,a=e._vsc_buffer_new_with_capacity(i);try{e._vscf_sha512_hash(c,a);const t=e._vsc_buffer_bytes(a),r=e._vsc_buffer_len(a);return e.HEAPU8.slice(t,t+r)}finally{e._free(s),e._free(c),e._vsc_buffer_delete(a)}}hash(t){return _.hash(t)}start(){t.ensureNotNull("this.ctxPtr",this.ctxPtr),e._vscf_sha512_start(this.ctxPtr)}update(r){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureByteArray("data",r);const _=r.length*r.BYTES_PER_ELEMENT,s=e._malloc(_);e.HEAP8.set(r,s);const n=e._vsc_data_ctx_size(),c=e._malloc(n);e._vsc_data(c,s,_);try{e._vscf_sha512_update(this.ctxPtr,c)}finally{e._free(s),e._free(c)}}finish(){t.ensureNotNull("this.ctxPtr",this.ctxPtr);const r=this.DIGEST_LEN,_=e._vsc_buffer_new_with_capacity(r);try{e._vscf_sha512_finish(this.ctxPtr,_);const t=e._vsc_buffer_bytes(_),r=e._vsc_buffer_len(_);return e.HEAPU8.slice(t,t+r)}finally{e._vsc_buffer_delete(_)}}}return _}}(),d_=function(){if(Rt)return Lt;Rt=1;const t=Ar();return Lt=(e,r)=>{class _{constructor(t){this.name="Aes256Gcm",this.ctxPtr=void 0===t?e._vscf_aes256_gcm_new():t}static newAndUseCContext(t){return new _(e._vscf_aes256_gcm_shallow_copy(t))}static newAndTakeCContext(t){return new _(t)}delete(){void 0!==this.ctxPtr&&null!==this.ctxPtr&&(e._vscf_aes256_gcm_delete(this.ctxPtr),this.ctxPtr=null)}static get NONCE_LEN(){return 12}get NONCE_LEN(){return 12}static get KEY_LEN(){return 32}get KEY_LEN(){return 32}static get KEY_BITLEN(){return 256}get KEY_BITLEN(){return 256}static get BLOCK_LEN(){return 16}get BLOCK_LEN(){return 16}static get AUTH_TAG_LEN(){return 16}get AUTH_TAG_LEN(){return 16}algId(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_aes256_gcm_alg_id(this.ctxPtr),r}produceAlgInfo(){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),_=e._vscf_aes256_gcm_produce_alg_info(this.ctxPtr),r.FoundationInterface.newAndTakeCContext(_)}restoreAlgInfo(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("algInfo",_,"Foundation.AlgInfo",r.FoundationInterfaceTag.ALG_INFO,r.FoundationInterface);const s=e._vscf_aes256_gcm_restore_alg_info(this.ctxPtr,_.ctxPtr);r.FoundationError.handleStatusCode(s)}encrypt(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureByteArray("data",_);const s=_.length*_.BYTES_PER_ELEMENT,n=e._malloc(s);e.HEAP8.set(_,n);const c=e._vsc_data_ctx_size(),i=e._malloc(c);e._vsc_data(i,n,s);const a=this.encryptedLen(_.length),o=e._vsc_buffer_new_with_capacity(a);try{const t=e._vscf_aes256_gcm_encrypt(this.ctxPtr,i,o);r.FoundationError.handleStatusCode(t);const _=e._vsc_buffer_bytes(o),s=e._vsc_buffer_len(o);return e.HEAPU8.slice(_,_+s)}finally{e._free(n),e._free(i),e._vsc_buffer_delete(o)}}encryptedLen(r){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureNumber("dataLen",r),_=e._vscf_aes256_gcm_encrypted_len(this.ctxPtr,r),_}preciseEncryptedLen(r){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureNumber("dataLen",r),_=e._vscf_aes256_gcm_precise_encrypted_len(this.ctxPtr,r),_}decrypt(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureByteArray("data",_);const s=_.length*_.BYTES_PER_ELEMENT,n=e._malloc(s);e.HEAP8.set(_,n);const c=e._vsc_data_ctx_size(),i=e._malloc(c);e._vsc_data(i,n,s);const a=this.decryptedLen(_.length),o=e._vsc_buffer_new_with_capacity(a);try{const t=e._vscf_aes256_gcm_decrypt(this.ctxPtr,i,o);r.FoundationError.handleStatusCode(t);const _=e._vsc_buffer_bytes(o),s=e._vsc_buffer_len(o);return e.HEAPU8.slice(_,_+s)}finally{e._free(n),e._free(i),e._vsc_buffer_delete(o)}}decryptedLen(r){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureNumber("dataLen",r),_=e._vscf_aes256_gcm_decrypted_len(this.ctxPtr,r),_}setNonce(r){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureByteArray("nonce",r);const _=r.length*r.BYTES_PER_ELEMENT,s=e._malloc(_);e.HEAP8.set(r,s);const n=e._vsc_data_ctx_size(),c=e._malloc(n);e._vsc_data(c,s,_);try{e._vscf_aes256_gcm_set_nonce(this.ctxPtr,c)}finally{e._free(s),e._free(c)}}setKey(r){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureByteArray("key",r);const _=r.length*r.BYTES_PER_ELEMENT,s=e._malloc(_);e.HEAP8.set(r,s);const n=e._vsc_data_ctx_size(),c=e._malloc(n);e._vsc_data(c,s,_);try{e._vscf_aes256_gcm_set_key(this.ctxPtr,c)}finally{e._free(s),e._free(c)}}startEncryption(){t.ensureNotNull("this.ctxPtr",this.ctxPtr),e._vscf_aes256_gcm_start_encryption(this.ctxPtr)}startDecryption(){t.ensureNotNull("this.ctxPtr",this.ctxPtr),e._vscf_aes256_gcm_start_decryption(this.ctxPtr)}update(r){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureByteArray("data",r);const _=r.length*r.BYTES_PER_ELEMENT,s=e._malloc(_);e.HEAP8.set(r,s);const n=e._vsc_data_ctx_size(),c=e._malloc(n);e._vsc_data(c,s,_);const i=this.outLen(r.length),a=e._vsc_buffer_new_with_capacity(i);try{e._vscf_aes256_gcm_update(this.ctxPtr,c,a);const t=e._vsc_buffer_bytes(a),r=e._vsc_buffer_len(a);return e.HEAPU8.slice(t,t+r)}finally{e._free(s),e._free(c),e._vsc_buffer_delete(a)}}outLen(r){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureNumber("dataLen",r),_=e._vscf_aes256_gcm_out_len(this.ctxPtr,r),_}encryptedOutLen(r){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureNumber("dataLen",r),_=e._vscf_aes256_gcm_encrypted_out_len(this.ctxPtr,r),_}decryptedOutLen(r){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureNumber("dataLen",r),_=e._vscf_aes256_gcm_decrypted_out_len(this.ctxPtr,r),_}finish(){t.ensureNotNull("this.ctxPtr",this.ctxPtr);const _=this.outLen(0),s=e._vsc_buffer_new_with_capacity(_);try{const t=e._vscf_aes256_gcm_finish(this.ctxPtr,s);r.FoundationError.handleStatusCode(t);const _=e._vsc_buffer_bytes(s),n=e._vsc_buffer_len(s);return e.HEAPU8.slice(_,_+n)}finally{e._vsc_buffer_delete(s)}}authEncrypt(_,s){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureByteArray("data",_),t.ensureByteArray("authData",s);const n=_.length*_.BYTES_PER_ELEMENT,c=e._malloc(n);e.HEAP8.set(_,c);const i=e._vsc_data_ctx_size(),a=e._malloc(i);e._vsc_data(a,c,n);const o=s.length*s.BYTES_PER_ELEMENT,l=e._malloc(o);e.HEAP8.set(s,l);const u=e._vsc_data_ctx_size(),f=e._malloc(u);e._vsc_data(f,l,o);const d=this.authEncryptedLen(_.length),h=e._vsc_buffer_new_with_capacity(d),P=this.AUTH_TAG_LEN,v=e._vsc_buffer_new_with_capacity(P);try{const t=e._vscf_aes256_gcm_auth_encrypt(this.ctxPtr,a,f,h,v);r.FoundationError.handleStatusCode(t);const _=e._vsc_buffer_bytes(h),s=e._vsc_buffer_len(h),n=e.HEAPU8.slice(_,_+s),c=e._vsc_buffer_bytes(v),i=e._vsc_buffer_len(v);return{out:n,tag:e.HEAPU8.slice(c,c+i)}}finally{e._free(c),e._free(a),e._free(l),e._free(f),e._vsc_buffer_delete(h),e._vsc_buffer_delete(v)}}authEncryptedLen(r){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureNumber("dataLen",r),_=e._vscf_aes256_gcm_auth_encrypted_len(this.ctxPtr,r),_}authDecrypt(_,s,n){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureByteArray("data",_),t.ensureByteArray("authData",s),t.ensureByteArray("tag",n);const c=_.length*_.BYTES_PER_ELEMENT,i=e._malloc(c);e.HEAP8.set(_,i);const a=e._vsc_data_ctx_size(),o=e._malloc(a);e._vsc_data(o,i,c);const l=s.length*s.BYTES_PER_ELEMENT,u=e._malloc(l);e.HEAP8.set(s,u);const f=e._vsc_data_ctx_size(),d=e._malloc(f);e._vsc_data(d,u,l);const h=n.length*n.BYTES_PER_ELEMENT,P=e._malloc(h);e.HEAP8.set(n,P);const v=e._vsc_data_ctx_size(),x=e._malloc(v);e._vsc_data(x,P,h);const y=this.authDecryptedLen(_.length),p=e._vsc_buffer_new_with_capacity(y);try{const t=e._vscf_aes256_gcm_auth_decrypt(this.ctxPtr,o,d,x,p);r.FoundationError.handleStatusCode(t);const _=e._vsc_buffer_bytes(p),s=e._vsc_buffer_len(p);return e.HEAPU8.slice(_,_+s)}finally{e._free(i),e._free(o),e._free(u),e._free(d),e._free(P),e._free(x),e._vsc_buffer_delete(p)}}authDecryptedLen(r){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureNumber("dataLen",r),_=e._vscf_aes256_gcm_auth_decrypted_len(this.ctxPtr,r),_}setAuthData(r){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureByteArray("authData",r);const _=r.length*r.BYTES_PER_ELEMENT,s=e._malloc(_);e.HEAP8.set(r,s);const n=e._vsc_data_ctx_size(),c=e._malloc(n);e._vsc_data(c,s,_);try{e._vscf_aes256_gcm_set_auth_data(this.ctxPtr,c)}finally{e._free(s),e._free(c)}}finishAuthEncryption(){t.ensureNotNull("this.ctxPtr",this.ctxPtr);const _=this.outLen(0),s=e._vsc_buffer_new_with_capacity(_),n=this.AUTH_TAG_LEN,c=e._vsc_buffer_new_with_capacity(n);try{const t=e._vscf_aes256_gcm_finish_auth_encryption(this.ctxPtr,s,c);r.FoundationError.handleStatusCode(t);const _=e._vsc_buffer_bytes(s),n=e._vsc_buffer_len(s),i=e.HEAPU8.slice(_,_+n),a=e._vsc_buffer_bytes(c),o=e._vsc_buffer_len(c);return{out:i,tag:e.HEAPU8.slice(a,a+o)}}finally{e._vsc_buffer_delete(s),e._vsc_buffer_delete(c)}}finishAuthDecryption(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureByteArray("tag",_);const s=_.length*_.BYTES_PER_ELEMENT,n=e._malloc(s);e.HEAP8.set(_,n);const c=e._vsc_data_ctx_size(),i=e._malloc(c);e._vsc_data(i,n,s);const a=this.outLen(0),o=e._vsc_buffer_new_with_capacity(a);try{const t=e._vscf_aes256_gcm_finish_auth_decryption(this.ctxPtr,i,o);r.FoundationError.handleStatusCode(t);const _=e._vsc_buffer_bytes(o),s=e._vsc_buffer_len(o);return e.HEAPU8.slice(_,_+s)}finally{e._free(n),e._free(i),e._vsc_buffer_delete(o)}}}return _}}(),h_=function(){if(Yt)return Bt;Yt=1;const t=Ar();return Bt=(e,r)=>{class _{constructor(t){this.name="Aes256Cbc",this.ctxPtr=void 0===t?e._vscf_aes256_cbc_new():t}static newAndUseCContext(t){return new _(e._vscf_aes256_cbc_shallow_copy(t))}static newAndTakeCContext(t){return new _(t)}delete(){void 0!==this.ctxPtr&&null!==this.ctxPtr&&(e._vscf_aes256_cbc_delete(this.ctxPtr),this.ctxPtr=null)}static get NONCE_LEN(){return 16}get NONCE_LEN(){return 16}static get KEY_LEN(){return 32}get KEY_LEN(){return 32}static get KEY_BITLEN(){return 256}get KEY_BITLEN(){return 256}static get BLOCK_LEN(){return 16}get BLOCK_LEN(){return 16}algId(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_aes256_cbc_alg_id(this.ctxPtr),r}produceAlgInfo(){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),_=e._vscf_aes256_cbc_produce_alg_info(this.ctxPtr),r.FoundationInterface.newAndTakeCContext(_)}restoreAlgInfo(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("algInfo",_,"Foundation.AlgInfo",r.FoundationInterfaceTag.ALG_INFO,r.FoundationInterface);const s=e._vscf_aes256_cbc_restore_alg_info(this.ctxPtr,_.ctxPtr);r.FoundationError.handleStatusCode(s)}encrypt(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureByteArray("data",_);const s=_.length*_.BYTES_PER_ELEMENT,n=e._malloc(s);e.HEAP8.set(_,n);const c=e._vsc_data_ctx_size(),i=e._malloc(c);e._vsc_data(i,n,s);const a=this.encryptedLen(_.length),o=e._vsc_buffer_new_with_capacity(a);try{const t=e._vscf_aes256_cbc_encrypt(this.ctxPtr,i,o);r.FoundationError.handleStatusCode(t);const _=e._vsc_buffer_bytes(o),s=e._vsc_buffer_len(o);return e.HEAPU8.slice(_,_+s)}finally{e._free(n),e._free(i),e._vsc_buffer_delete(o)}}encryptedLen(r){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureNumber("dataLen",r),_=e._vscf_aes256_cbc_encrypted_len(this.ctxPtr,r),_}preciseEncryptedLen(r){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureNumber("dataLen",r),_=e._vscf_aes256_cbc_precise_encrypted_len(this.ctxPtr,r),_}decrypt(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureByteArray("data",_);const s=_.length*_.BYTES_PER_ELEMENT,n=e._malloc(s);e.HEAP8.set(_,n);const c=e._vsc_data_ctx_size(),i=e._malloc(c);e._vsc_data(i,n,s);const a=this.decryptedLen(_.length),o=e._vsc_buffer_new_with_capacity(a);try{const t=e._vscf_aes256_cbc_decrypt(this.ctxPtr,i,o);r.FoundationError.handleStatusCode(t);const _=e._vsc_buffer_bytes(o),s=e._vsc_buffer_len(o);return e.HEAPU8.slice(_,_+s)}finally{e._free(n),e._free(i),e._vsc_buffer_delete(o)}}decryptedLen(r){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureNumber("dataLen",r),_=e._vscf_aes256_cbc_decrypted_len(this.ctxPtr,r),_}setNonce(r){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureByteArray("nonce",r);const _=r.length*r.BYTES_PER_ELEMENT,s=e._malloc(_);e.HEAP8.set(r,s);const n=e._vsc_data_ctx_size(),c=e._malloc(n);e._vsc_data(c,s,_);try{e._vscf_aes256_cbc_set_nonce(this.ctxPtr,c)}finally{e._free(s),e._free(c)}}setKey(r){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureByteArray("key",r);const _=r.length*r.BYTES_PER_ELEMENT,s=e._malloc(_);e.HEAP8.set(r,s);const n=e._vsc_data_ctx_size(),c=e._malloc(n);e._vsc_data(c,s,_);try{e._vscf_aes256_cbc_set_key(this.ctxPtr,c)}finally{e._free(s),e._free(c)}}startEncryption(){t.ensureNotNull("this.ctxPtr",this.ctxPtr),e._vscf_aes256_cbc_start_encryption(this.ctxPtr)}startDecryption(){t.ensureNotNull("this.ctxPtr",this.ctxPtr),e._vscf_aes256_cbc_start_decryption(this.ctxPtr)}update(r){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureByteArray("data",r);const _=r.length*r.BYTES_PER_ELEMENT,s=e._malloc(_);e.HEAP8.set(r,s);const n=e._vsc_data_ctx_size(),c=e._malloc(n);e._vsc_data(c,s,_);const i=this.outLen(r.length),a=e._vsc_buffer_new_with_capacity(i);try{e._vscf_aes256_cbc_update(this.ctxPtr,c,a);const t=e._vsc_buffer_bytes(a),r=e._vsc_buffer_len(a);return e.HEAPU8.slice(t,t+r)}finally{e._free(s),e._free(c),e._vsc_buffer_delete(a)}}outLen(r){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureNumber("dataLen",r),_=e._vscf_aes256_cbc_out_len(this.ctxPtr,r),_}encryptedOutLen(r){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureNumber("dataLen",r),_=e._vscf_aes256_cbc_encrypted_out_len(this.ctxPtr,r),_}decryptedOutLen(r){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureNumber("dataLen",r),_=e._vscf_aes256_cbc_decrypted_out_len(this.ctxPtr,r),_}finish(){t.ensureNotNull("this.ctxPtr",this.ctxPtr);const _=this.outLen(0),s=e._vsc_buffer_new_with_capacity(_);try{const t=e._vscf_aes256_cbc_finish(this.ctxPtr,s);r.FoundationError.handleStatusCode(t);const _=e._vsc_buffer_bytes(s),n=e._vsc_buffer_len(s);return e.HEAPU8.slice(_,_+n)}finally{e._vsc_buffer_delete(s)}}}return _}}(),P_=function(){if(Ut)return Ht;Ut=1;const t=Ar();return Ht=(e,r)=>{class _{constructor(t){this.name="Asn1rd",this.ctxPtr=void 0===t?e._vscf_asn1rd_new():t}static newAndUseCContext(t){return new _(e._vscf_asn1rd_shallow_copy(t))}static newAndTakeCContext(t){return new _(t)}delete(){void 0!==this.ctxPtr&&null!==this.ctxPtr&&(e._vscf_asn1rd_delete(this.ctxPtr),this.ctxPtr=null)}reset(r){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureByteArray("data",r);const _=r.length*r.BYTES_PER_ELEMENT,s=e._malloc(_);e.HEAP8.set(r,s);const n=e._vsc_data_ctx_size(),c=e._malloc(n);e._vsc_data(c,s,_);try{e._vscf_asn1rd_reset(this.ctxPtr,c)}finally{e._free(s),e._free(c)}}leftLen(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_asn1rd_left_len(this.ctxPtr),r}hasError(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_asn1rd_has_error(this.ctxPtr),!!r}status(){t.ensureNotNull("this.ctxPtr",this.ctxPtr);const _=e._vscf_asn1rd_status(this.ctxPtr);r.FoundationError.handleStatusCode(_)}getTag(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_asn1rd_get_tag(this.ctxPtr),r}getLen(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_asn1rd_get_len(this.ctxPtr),r}getDataLen(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_asn1rd_get_data_len(this.ctxPtr),r}readTag(r){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureNumber("tag",r),_=e._vscf_asn1rd_read_tag(this.ctxPtr,r),_}readContextTag(r){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureNumber("tag",r),_=e._vscf_asn1rd_read_context_tag(this.ctxPtr,r),_}readInt(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_asn1rd_read_int(this.ctxPtr),r}readInt8(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_asn1rd_read_int8(this.ctxPtr),r}readInt16(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_asn1rd_read_int16(this.ctxPtr),r}readInt32(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_asn1rd_read_int32(this.ctxPtr),r}readInt64(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_asn1rd_read_int64(this.ctxPtr),r}readUint(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_asn1rd_read_uint(this.ctxPtr),r}readUint8(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_asn1rd_read_uint8(this.ctxPtr),r}readUint16(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_asn1rd_read_uint16(this.ctxPtr),r}readUint32(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_asn1rd_read_uint32(this.ctxPtr),r}readUint64(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_asn1rd_read_uint64(this.ctxPtr),r}readBool(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_asn1rd_read_bool(this.ctxPtr),!!r}readNull(){t.ensureNotNull("this.ctxPtr",this.ctxPtr),e._vscf_asn1rd_read_null(this.ctxPtr)}readNullOptional(){t.ensureNotNull("this.ctxPtr",this.ctxPtr),e._vscf_asn1rd_read_null_optional(this.ctxPtr)}readOctetStr(){t.ensureNotNull("this.ctxPtr",this.ctxPtr),e._vscf_asn1rd_read_octet_str(this.ctxPtr)}readBitstringAsOctetStr(){t.ensureNotNull("this.ctxPtr",this.ctxPtr),e._vscf_asn1rd_read_bitstring_as_octet_str(this.ctxPtr)}readUtf8Str(){t.ensureNotNull("this.ctxPtr",this.ctxPtr),e._vscf_asn1rd_read_utf8_str(this.ctxPtr)}readOid(){t.ensureNotNull("this.ctxPtr",this.ctxPtr),e._vscf_asn1rd_read_oid(this.ctxPtr)}readData(r){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureNumber("len",r),e._vscf_asn1rd_read_data(this.ctxPtr,r)}readSequence(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_asn1rd_read_sequence(this.ctxPtr),r}readSet(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_asn1rd_read_set(this.ctxPtr),r}mbedtlsHasError(r){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureNumber("code",r),_=e._vscf_asn1rd_mbedtls_has_error(this.ctxPtr,r),!!_}readTagData(r){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureNumber("tag",r),e._vscf_asn1rd_read_tag_data(this.ctxPtr,r)}}return _}}(),v_=function(){if(Dt)return Mt;Dt=1;const t=Ar();return Mt=(e,r)=>{class _{constructor(t){this.name="Asn1wr",this.ctxPtr=void 0===t?e._vscf_asn1wr_new():t}static newAndUseCContext(t){return new _(e._vscf_asn1wr_shallow_copy(t))}static newAndTakeCContext(t){return new _(t)}delete(){void 0!==this.ctxPtr&&null!==this.ctxPtr&&(e._vscf_asn1wr_delete(this.ctxPtr),this.ctxPtr=null)}reset(r,_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureNumber("outLen",_),e._vscf_asn1wr_reset(this.ctxPtr,r,_)}finish(r){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureBoolean("doNotAdjust",r),_=e._vscf_asn1wr_finish(this.ctxPtr,r),_}bytes(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_asn1wr_bytes(this.ctxPtr),r}len(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_asn1wr_len(this.ctxPtr),r}writtenLen(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_asn1wr_written_len(this.ctxPtr),r}unwrittenLen(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_asn1wr_unwritten_len(this.ctxPtr),r}hasError(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_asn1wr_has_error(this.ctxPtr),!!r}status(){t.ensureNotNull("this.ctxPtr",this.ctxPtr);const _=e._vscf_asn1wr_status(this.ctxPtr);r.FoundationError.handleStatusCode(_)}reserve(r){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureNumber("len",r),_=e._vscf_asn1wr_reserve(this.ctxPtr,r),_}writeTag(r){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureNumber("tag",r),_=e._vscf_asn1wr_write_tag(this.ctxPtr,r),_}writeContextTag(r,_){let s;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureNumber("tag",r),t.ensureNumber("len",_),s=e._vscf_asn1wr_write_context_tag(this.ctxPtr,r,_),s}writeLen(r){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureNumber("len",r),_=e._vscf_asn1wr_write_len(this.ctxPtr,r),_}writeInt(r){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureNumber("value",r),_=e._vscf_asn1wr_write_int(this.ctxPtr,r),_}writeInt8(r){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureNumber("value",r),_=e._vscf_asn1wr_write_int8(this.ctxPtr,r),_}writeInt16(r){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureNumber("value",r),_=e._vscf_asn1wr_write_int16(this.ctxPtr,r),_}writeInt32(r){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureNumber("value",r),_=e._vscf_asn1wr_write_int32(this.ctxPtr,r),_}writeInt64(r){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureNumber("value",r),_=e._vscf_asn1wr_write_int64(this.ctxPtr,r),_}writeUint(r){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureNumber("value",r),_=e._vscf_asn1wr_write_uint(this.ctxPtr,r),_}writeUint8(r){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureNumber("value",r),_=e._vscf_asn1wr_write_uint8(this.ctxPtr,r),_}writeUint16(r){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureNumber("value",r),_=e._vscf_asn1wr_write_uint16(this.ctxPtr,r),_}writeUint32(r){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureNumber("value",r),_=e._vscf_asn1wr_write_uint32(this.ctxPtr,r),_}writeUint64(r){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureNumber("value",r),_=e._vscf_asn1wr_write_uint64(this.ctxPtr,r),_}writeBool(r){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureBoolean("value",r),_=e._vscf_asn1wr_write_bool(this.ctxPtr,r),_}writeNull(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_asn1wr_write_null(this.ctxPtr),r}writeOctetStr(r){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureByteArray("value",r);const _=r.length*r.BYTES_PER_ELEMENT,s=e._malloc(_);e.HEAP8.set(r,s);const n=e._vsc_data_ctx_size(),c=e._malloc(n);let i;e._vsc_data(c,s,_);try{i=e._vscf_asn1wr_write_octet_str(this.ctxPtr,c)}finally{e._free(s),e._free(c)}}writeOctetStrAsBitstring(r){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureByteArray("value",r);const _=r.length*r.BYTES_PER_ELEMENT,s=e._malloc(_);e.HEAP8.set(r,s);const n=e._vsc_data_ctx_size(),c=e._malloc(n);let i;e._vsc_data(c,s,_);try{i=e._vscf_asn1wr_write_octet_str_as_bitstring(this.ctxPtr,c)}finally{e._free(s),e._free(c)}}writeData(r){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureByteArray("data",r);const _=r.length*r.BYTES_PER_ELEMENT,s=e._malloc(_);e.HEAP8.set(r,s);const n=e._vsc_data_ctx_size(),c=e._malloc(n);let i;e._vsc_data(c,s,_);try{i=e._vscf_asn1wr_write_data(this.ctxPtr,c)}finally{e._free(s),e._free(c)}}writeUtf8Str(r){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureByteArray("value",r);const _=r.length*r.BYTES_PER_ELEMENT,s=e._malloc(_);e.HEAP8.set(r,s);const n=e._vsc_data_ctx_size(),c=e._malloc(n);let i;e._vsc_data(c,s,_);try{i=e._vscf_asn1wr_write_utf8_str(this.ctxPtr,c)}finally{e._free(s),e._free(c)}}writeOid(r){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureByteArray("value",r);const _=r.length*r.BYTES_PER_ELEMENT,s=e._malloc(_);e.HEAP8.set(r,s);const n=e._vsc_data_ctx_size(),c=e._malloc(n);let i;e._vsc_data(c,s,_);try{i=e._vscf_asn1wr_write_oid(this.ctxPtr,c)}finally{e._free(s),e._free(c)}}writeSequence(r){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureNumber("len",r),_=e._vscf_asn1wr_write_sequence(this.ctxPtr,r),_}writeSet(r){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureNumber("len",r),_=e._vscf_asn1wr_write_set(this.ctxPtr,r),_}mbedtlsHasError(r){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureNumber("code",r),_=e._vscf_asn1wr_mbedtls_has_error(this.ctxPtr,r),!!_}writeTagData(r,_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureByteArray("data",r),t.ensureNumber("tag",_);const s=r.length*r.BYTES_PER_ELEMENT,n=e._malloc(s);e.HEAP8.set(r,n);const c=e._vsc_data_ctx_size(),i=e._malloc(c);let a;e._vsc_data(i,n,s);try{a=e._vscf_asn1wr_write_tag_data(this.ctxPtr,i,_)}finally{e._free(n),e._free(i)}}static getCurrentElementLen(t,r){let _;return _=e._vscf_asn1wr_get_current_element_len(t,r),_}getCurrentElementLen(t,e){return _.getCurrentElementLen(t,e)}static swapElementsOfSet(r,_,s,n){t.ensureNumber("toLen",_),t.ensureNumber("fromLen",n),e._vscf_asn1wr_swap_elements_of_set(r,_,s,n)}swapElementsOfSet(t,e,r,s){return _.swapElementsOfSet(t,e,r,s)}static secondElementOfSetIsLess(r,_,s,n){let c;return t.ensureNumber("firstLen",_),t.ensureNumber("secondLen",n),c=e._vscf_asn1wr_second_element_of_set_is_less(r,_,s,n),!!c}secondElementOfSetIsLess(t,e,r,s){return _.secondElementOfSetIsLess(t,e,r,s)}sortElementsOfSet(r){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureNumber("len",r),e._vscf_asn1wr_sort_elements_of_set(this.ctxPtr,r)}}return _}}(),x_=function(){if(Gt)return Ot;Gt=1;const t=Ar();return Ot=(e,r)=>{class _{constructor(t){this.name="RsaPublicKey",this.ctxPtr=void 0===t?e._vscf_rsa_public_key_new():t}static newAndUseCContext(t){return new _(e._vscf_rsa_public_key_shallow_copy(t))}static newAndTakeCContext(t){return new _(t)}delete(){void 0!==this.ctxPtr&&null!==this.ctxPtr&&(e._vscf_rsa_public_key_delete(this.ctxPtr),this.ctxPtr=null)}algId(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_rsa_public_key_alg_id(this.ctxPtr),r}algInfo(){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),_=e._vscf_rsa_public_key_alg_info(this.ctxPtr),r.FoundationInterface.newAndUseCContext(_)}len(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_rsa_public_key_len(this.ctxPtr),r}bitlen(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_rsa_public_key_bitlen(this.ctxPtr),r}isValid(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_rsa_public_key_is_valid(this.ctxPtr),!!r}keyExponent(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_rsa_public_key_key_exponent(this.ctxPtr),r}}return _}}(),y_=function(){if(qt)return Vt;qt=1;const t=Ar();return Vt=(e,r)=>{class _{constructor(t){this.name="RsaPrivateKey",this.ctxPtr=void 0===t?e._vscf_rsa_private_key_new():t}static newAndUseCContext(t){return new _(e._vscf_rsa_private_key_shallow_copy(t))}static newAndTakeCContext(t){return new _(t)}delete(){void 0!==this.ctxPtr&&null!==this.ctxPtr&&(e._vscf_rsa_private_key_delete(this.ctxPtr),this.ctxPtr=null)}algId(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_rsa_private_key_alg_id(this.ctxPtr),r}algInfo(){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),_=e._vscf_rsa_private_key_alg_info(this.ctxPtr),r.FoundationInterface.newAndUseCContext(_)}len(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_rsa_private_key_len(this.ctxPtr),r}bitlen(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_rsa_private_key_bitlen(this.ctxPtr),r}isValid(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_rsa_private_key_is_valid(this.ctxPtr),!!r}extractPublicKey(){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),_=e._vscf_rsa_private_key_extract_public_key(this.ctxPtr),r.FoundationInterface.newAndTakeCContext(_)}}return _}}(),p_=function(){if(Xt)return jt;Xt=1;const t=Ar();return jt=(e,r)=>{class _{constructor(t){this.name="Rsa",this.ctxPtr=void 0===t?e._vscf_rsa_new():t}static newAndUseCContext(t){return new _(e._vscf_rsa_shallow_copy(t))}static newAndTakeCContext(t){return new _(t)}delete(){void 0!==this.ctxPtr&&null!==this.ctxPtr&&(e._vscf_rsa_delete(this.ctxPtr),this.ctxPtr=null)}set random(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("random",_,"Foundation.Random",r.FoundationInterfaceTag.RANDOM,r.FoundationInterface),e._vscf_rsa_release_random(this.ctxPtr),e._vscf_rsa_use_random(this.ctxPtr,_.ctxPtr)}static get CAN_IMPORT_PUBLIC_KEY(){return!0}get CAN_IMPORT_PUBLIC_KEY(){return!0}static get CAN_EXPORT_PUBLIC_KEY(){return!0}get CAN_EXPORT_PUBLIC_KEY(){return!0}static get CAN_IMPORT_PRIVATE_KEY(){return!0}get CAN_IMPORT_PRIVATE_KEY(){return!0}static get CAN_EXPORT_PRIVATE_KEY(){return!0}get CAN_EXPORT_PRIVATE_KEY(){return!0}generateEphemeralKey(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("key",_,"Foundation.Key",r.FoundationInterfaceTag.KEY,r.FoundationInterface);const s=e._vscf_error_ctx_size(),n=e._malloc(s);let c;e._vscf_error_reset(n);try{c=e._vscf_rsa_generate_ephemeral_key(this.ctxPtr,_.ctxPtr,n);const t=e._vscf_error_status(n);return r.FoundationError.handleStatusCode(t),r.FoundationInterface.newAndTakeCContext(c)}finally{e._free(n)}}importPublicKey(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureClass("rawKey",_,r.RawPublicKey);const s=e._vscf_error_ctx_size(),n=e._malloc(s);let c;e._vscf_error_reset(n);try{c=e._vscf_rsa_import_public_key(this.ctxPtr,_.ctxPtr,n);const t=e._vscf_error_status(n);return r.FoundationError.handleStatusCode(t),r.FoundationInterface.newAndTakeCContext(c)}finally{e._free(n)}}exportPublicKey(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("publicKey",_,"Foundation.PublicKey",r.FoundationInterfaceTag.PUBLIC_KEY,r.FoundationInterface);const s=e._vscf_error_ctx_size(),n=e._malloc(s);let c;e._vscf_error_reset(n);try{c=e._vscf_rsa_export_public_key(this.ctxPtr,_.ctxPtr,n);const t=e._vscf_error_status(n);return r.FoundationError.handleStatusCode(t),r.RawPublicKey.newAndTakeCContext(c)}finally{e._free(n)}}importPrivateKey(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureClass("rawKey",_,r.RawPrivateKey);const s=e._vscf_error_ctx_size(),n=e._malloc(s);let c;e._vscf_error_reset(n);try{c=e._vscf_rsa_import_private_key(this.ctxPtr,_.ctxPtr,n);const t=e._vscf_error_status(n);return r.FoundationError.handleStatusCode(t),r.FoundationInterface.newAndTakeCContext(c)}finally{e._free(n)}}exportPrivateKey(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("privateKey",_,"Foundation.PrivateKey",r.FoundationInterfaceTag.PRIVATE_KEY,r.FoundationInterface);const s=e._vscf_error_ctx_size(),n=e._malloc(s);let c;e._vscf_error_reset(n);try{c=e._vscf_rsa_export_private_key(this.ctxPtr,_.ctxPtr,n);const t=e._vscf_error_status(n);return r.FoundationError.handleStatusCode(t),r.RawPrivateKey.newAndTakeCContext(c)}finally{e._free(n)}}canEncrypt(_,s){let n;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("publicKey",_,"Foundation.PublicKey",r.FoundationInterfaceTag.PUBLIC_KEY,r.FoundationInterface),t.ensureNumber("dataLen",s),n=e._vscf_rsa_can_encrypt(this.ctxPtr,_.ctxPtr,s),!!n}encryptedLen(_,s){let n;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("publicKey",_,"Foundation.PublicKey",r.FoundationInterfaceTag.PUBLIC_KEY,r.FoundationInterface),t.ensureNumber("dataLen",s),n=e._vscf_rsa_encrypted_len(this.ctxPtr,_.ctxPtr,s),n}encrypt(_,s){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("publicKey",_,"Foundation.PublicKey",r.FoundationInterfaceTag.PUBLIC_KEY,r.FoundationInterface),t.ensureByteArray("data",s);const n=s.length*s.BYTES_PER_ELEMENT,c=e._malloc(n);e.HEAP8.set(s,c);const i=e._vsc_data_ctx_size(),a=e._malloc(i);e._vsc_data(a,c,n);const o=this.encryptedLen(_,s.length),l=e._vsc_buffer_new_with_capacity(o);try{const t=e._vscf_rsa_encrypt(this.ctxPtr,_.ctxPtr,a,l);r.FoundationError.handleStatusCode(t);const s=e._vsc_buffer_bytes(l),n=e._vsc_buffer_len(l);return e.HEAPU8.slice(s,s+n)}finally{e._free(c),e._free(a),e._vsc_buffer_delete(l)}}canDecrypt(_,s){let n;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("privateKey",_,"Foundation.PrivateKey",r.FoundationInterfaceTag.PRIVATE_KEY,r.FoundationInterface),t.ensureNumber("dataLen",s),n=e._vscf_rsa_can_decrypt(this.ctxPtr,_.ctxPtr,s),!!n}decryptedLen(_,s){let n;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("privateKey",_,"Foundation.PrivateKey",r.FoundationInterfaceTag.PRIVATE_KEY,r.FoundationInterface),t.ensureNumber("dataLen",s),n=e._vscf_rsa_decrypted_len(this.ctxPtr,_.ctxPtr,s),n}decrypt(_,s){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("privateKey",_,"Foundation.PrivateKey",r.FoundationInterfaceTag.PRIVATE_KEY,r.FoundationInterface),t.ensureByteArray("data",s);const n=s.length*s.BYTES_PER_ELEMENT,c=e._malloc(n);e.HEAP8.set(s,c);const i=e._vsc_data_ctx_size(),a=e._malloc(i);e._vsc_data(a,c,n);const o=this.decryptedLen(_,s.length),l=e._vsc_buffer_new_with_capacity(o);try{const t=e._vscf_rsa_decrypt(this.ctxPtr,_.ctxPtr,a,l);r.FoundationError.handleStatusCode(t);const s=e._vsc_buffer_bytes(l),n=e._vsc_buffer_len(l);return e.HEAPU8.slice(s,s+n)}finally{e._free(c),e._free(a),e._vsc_buffer_delete(l)}}canSign(_){let s;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("privateKey",_,"Foundation.PrivateKey",r.FoundationInterfaceTag.PRIVATE_KEY,r.FoundationInterface),s=e._vscf_rsa_can_sign(this.ctxPtr,_.ctxPtr),!!s}signatureLen(_){let s;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("privateKey",_,"Foundation.PrivateKey",r.FoundationInterfaceTag.PRIVATE_KEY,r.FoundationInterface),s=e._vscf_rsa_signature_len(this.ctxPtr,_.ctxPtr),s}signHash(_,s,n){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("privateKey",_,"Foundation.PrivateKey",r.FoundationInterfaceTag.PRIVATE_KEY,r.FoundationInterface),t.ensureByteArray("digest",n);const c=n.length*n.BYTES_PER_ELEMENT,i=e._malloc(c);e.HEAP8.set(n,i);const a=e._vsc_data_ctx_size(),o=e._malloc(a);e._vsc_data(o,i,c);const l=this.signatureLen(_),u=e._vsc_buffer_new_with_capacity(l);try{const t=e._vscf_rsa_sign_hash(this.ctxPtr,_.ctxPtr,s,o,u);r.FoundationError.handleStatusCode(t);const n=e._vsc_buffer_bytes(u),c=e._vsc_buffer_len(u);return e.HEAPU8.slice(n,n+c)}finally{e._free(i),e._free(o),e._vsc_buffer_delete(u)}}canVerify(_){let s;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("publicKey",_,"Foundation.PublicKey",r.FoundationInterfaceTag.PUBLIC_KEY,r.FoundationInterface),s=e._vscf_rsa_can_verify(this.ctxPtr,_.ctxPtr),!!s}verifyHash(_,s,n,c){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("publicKey",_,"Foundation.PublicKey",r.FoundationInterfaceTag.PUBLIC_KEY,r.FoundationInterface),t.ensureByteArray("digest",n),t.ensureByteArray("signature",c);const i=n.length*n.BYTES_PER_ELEMENT,a=e._malloc(i);e.HEAP8.set(n,a);const o=e._vsc_data_ctx_size(),l=e._malloc(o);e._vsc_data(l,a,i);const u=c.length*c.BYTES_PER_ELEMENT,f=e._malloc(u);e.HEAP8.set(c,f);const d=e._vsc_data_ctx_size(),h=e._malloc(d);e._vsc_data(h,f,u);try{return!!e._vscf_rsa_verify_hash(this.ctxPtr,_.ctxPtr,s,l,h)}finally{e._free(a),e._free(l),e._free(f),e._free(h)}}setupDefaults(){t.ensureNotNull("this.ctxPtr",this.ctxPtr);const _=e._vscf_rsa_setup_defaults(this.ctxPtr);r.FoundationError.handleStatusCode(_)}generateKey(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureNumber("bitlen",_);const s=e._vscf_error_ctx_size(),n=e._malloc(s);let c;e._vscf_error_reset(n);try{c=e._vscf_rsa_generate_key(this.ctxPtr,_,n);const t=e._vscf_error_status(n);return r.FoundationError.handleStatusCode(t),r.FoundationInterface.newAndTakeCContext(c)}finally{e._free(n)}}}return _}}(),g_=function(){if(Zt)return Wt;Zt=1;const t=Ar();return Wt=(e,r)=>{class _{constructor(t){this.name="EccPublicKey",this.ctxPtr=void 0===t?e._vscf_ecc_public_key_new():t}static newAndUseCContext(t){return new _(e._vscf_ecc_public_key_shallow_copy(t))}static newAndTakeCContext(t){return new _(t)}delete(){void 0!==this.ctxPtr&&null!==this.ctxPtr&&(e._vscf_ecc_public_key_delete(this.ctxPtr),this.ctxPtr=null)}algId(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_ecc_public_key_alg_id(this.ctxPtr),r}algInfo(){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),_=e._vscf_ecc_public_key_alg_info(this.ctxPtr),r.FoundationInterface.newAndUseCContext(_)}len(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_ecc_public_key_len(this.ctxPtr),r}bitlen(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_ecc_public_key_bitlen(this.ctxPtr),r}isValid(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_ecc_public_key_is_valid(this.ctxPtr),!!r}}return _}}(),m_=function(){if(Qt)return $t;Qt=1;const t=Ar();return $t=(e,r)=>{class _{constructor(t){this.name="EccPrivateKey",this.ctxPtr=void 0===t?e._vscf_ecc_private_key_new():t}static newAndUseCContext(t){return new _(e._vscf_ecc_private_key_shallow_copy(t))}static newAndTakeCContext(t){return new _(t)}delete(){void 0!==this.ctxPtr&&null!==this.ctxPtr&&(e._vscf_ecc_private_key_delete(this.ctxPtr),this.ctxPtr=null)}algId(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_ecc_private_key_alg_id(this.ctxPtr),r}algInfo(){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),_=e._vscf_ecc_private_key_alg_info(this.ctxPtr),r.FoundationInterface.newAndUseCContext(_)}len(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_ecc_private_key_len(this.ctxPtr),r}bitlen(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_ecc_private_key_bitlen(this.ctxPtr),r}isValid(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_ecc_private_key_is_valid(this.ctxPtr),!!r}extractPublicKey(){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),_=e._vscf_ecc_private_key_extract_public_key(this.ctxPtr),r.FoundationInterface.newAndTakeCContext(_)}}return _}}(),N_=function(){if(te)return Jt;te=1;const t=Ar();return Jt=(e,r)=>{class _{constructor(t){this.name="Ecc",this.ctxPtr=void 0===t?e._vscf_ecc_new():t}static newAndUseCContext(t){return new _(e._vscf_ecc_shallow_copy(t))}static newAndTakeCContext(t){return new _(t)}delete(){void 0!==this.ctxPtr&&null!==this.ctxPtr&&(e._vscf_ecc_delete(this.ctxPtr),this.ctxPtr=null)}set random(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("random",_,"Foundation.Random",r.FoundationInterfaceTag.RANDOM,r.FoundationInterface),e._vscf_ecc_release_random(this.ctxPtr),e._vscf_ecc_use_random(this.ctxPtr,_.ctxPtr)}set ecies(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureClass("ecies",_,r.Ecies),e._vscf_ecc_release_ecies(this.ctxPtr),e._vscf_ecc_use_ecies(this.ctxPtr,_.ctxPtr)}static get CAN_IMPORT_PUBLIC_KEY(){return!0}get CAN_IMPORT_PUBLIC_KEY(){return!0}static get CAN_EXPORT_PUBLIC_KEY(){return!0}get CAN_EXPORT_PUBLIC_KEY(){return!0}static get CAN_IMPORT_PRIVATE_KEY(){return!0}get CAN_IMPORT_PRIVATE_KEY(){return!0}static get CAN_EXPORT_PRIVATE_KEY(){return!0}get CAN_EXPORT_PRIVATE_KEY(){return!0}generateEphemeralKey(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("key",_,"Foundation.Key",r.FoundationInterfaceTag.KEY,r.FoundationInterface);const s=e._vscf_error_ctx_size(),n=e._malloc(s);let c;e._vscf_error_reset(n);try{c=e._vscf_ecc_generate_ephemeral_key(this.ctxPtr,_.ctxPtr,n);const t=e._vscf_error_status(n);return r.FoundationError.handleStatusCode(t),r.FoundationInterface.newAndTakeCContext(c)}finally{e._free(n)}}importPublicKey(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureClass("rawKey",_,r.RawPublicKey);const s=e._vscf_error_ctx_size(),n=e._malloc(s);let c;e._vscf_error_reset(n);try{c=e._vscf_ecc_import_public_key(this.ctxPtr,_.ctxPtr,n);const t=e._vscf_error_status(n);return r.FoundationError.handleStatusCode(t),r.FoundationInterface.newAndTakeCContext(c)}finally{e._free(n)}}exportPublicKey(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("publicKey",_,"Foundation.PublicKey",r.FoundationInterfaceTag.PUBLIC_KEY,r.FoundationInterface);const s=e._vscf_error_ctx_size(),n=e._malloc(s);let c;e._vscf_error_reset(n);try{c=e._vscf_ecc_export_public_key(this.ctxPtr,_.ctxPtr,n);const t=e._vscf_error_status(n);return r.FoundationError.handleStatusCode(t),r.RawPublicKey.newAndTakeCContext(c)}finally{e._free(n)}}importPrivateKey(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureClass("rawKey",_,r.RawPrivateKey);const s=e._vscf_error_ctx_size(),n=e._malloc(s);let c;e._vscf_error_reset(n);try{c=e._vscf_ecc_import_private_key(this.ctxPtr,_.ctxPtr,n);const t=e._vscf_error_status(n);return r.FoundationError.handleStatusCode(t),r.FoundationInterface.newAndTakeCContext(c)}finally{e._free(n)}}exportPrivateKey(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("privateKey",_,"Foundation.PrivateKey",r.FoundationInterfaceTag.PRIVATE_KEY,r.FoundationInterface);const s=e._vscf_error_ctx_size(),n=e._malloc(s);let c;e._vscf_error_reset(n);try{c=e._vscf_ecc_export_private_key(this.ctxPtr,_.ctxPtr,n);const t=e._vscf_error_status(n);return r.FoundationError.handleStatusCode(t),r.RawPrivateKey.newAndTakeCContext(c)}finally{e._free(n)}}canEncrypt(_,s){let n;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("publicKey",_,"Foundation.PublicKey",r.FoundationInterfaceTag.PUBLIC_KEY,r.FoundationInterface),t.ensureNumber("dataLen",s),n=e._vscf_ecc_can_encrypt(this.ctxPtr,_.ctxPtr,s),!!n}encryptedLen(_,s){let n;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("publicKey",_,"Foundation.PublicKey",r.FoundationInterfaceTag.PUBLIC_KEY,r.FoundationInterface),t.ensureNumber("dataLen",s),n=e._vscf_ecc_encrypted_len(this.ctxPtr,_.ctxPtr,s),n}encrypt(_,s){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("publicKey",_,"Foundation.PublicKey",r.FoundationInterfaceTag.PUBLIC_KEY,r.FoundationInterface),t.ensureByteArray("data",s);const n=s.length*s.BYTES_PER_ELEMENT,c=e._malloc(n);e.HEAP8.set(s,c);const i=e._vsc_data_ctx_size(),a=e._malloc(i);e._vsc_data(a,c,n);const o=this.encryptedLen(_,s.length),l=e._vsc_buffer_new_with_capacity(o);try{const t=e._vscf_ecc_encrypt(this.ctxPtr,_.ctxPtr,a,l);r.FoundationError.handleStatusCode(t);const s=e._vsc_buffer_bytes(l),n=e._vsc_buffer_len(l);return e.HEAPU8.slice(s,s+n)}finally{e._free(c),e._free(a),e._vsc_buffer_delete(l)}}canDecrypt(_,s){let n;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("privateKey",_,"Foundation.PrivateKey",r.FoundationInterfaceTag.PRIVATE_KEY,r.FoundationInterface),t.ensureNumber("dataLen",s),n=e._vscf_ecc_can_decrypt(this.ctxPtr,_.ctxPtr,s),!!n}decryptedLen(_,s){let n;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("privateKey",_,"Foundation.PrivateKey",r.FoundationInterfaceTag.PRIVATE_KEY,r.FoundationInterface),t.ensureNumber("dataLen",s),n=e._vscf_ecc_decrypted_len(this.ctxPtr,_.ctxPtr,s),n}decrypt(_,s){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("privateKey",_,"Foundation.PrivateKey",r.FoundationInterfaceTag.PRIVATE_KEY,r.FoundationInterface),t.ensureByteArray("data",s);const n=s.length*s.BYTES_PER_ELEMENT,c=e._malloc(n);e.HEAP8.set(s,c);const i=e._vsc_data_ctx_size(),a=e._malloc(i);e._vsc_data(a,c,n);const o=this.decryptedLen(_,s.length),l=e._vsc_buffer_new_with_capacity(o);try{const t=e._vscf_ecc_decrypt(this.ctxPtr,_.ctxPtr,a,l);r.FoundationError.handleStatusCode(t);const s=e._vsc_buffer_bytes(l),n=e._vsc_buffer_len(l);return e.HEAPU8.slice(s,s+n)}finally{e._free(c),e._free(a),e._vsc_buffer_delete(l)}}canSign(_){let s;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("privateKey",_,"Foundation.PrivateKey",r.FoundationInterfaceTag.PRIVATE_KEY,r.FoundationInterface),s=e._vscf_ecc_can_sign(this.ctxPtr,_.ctxPtr),!!s}signatureLen(_){let s;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("privateKey",_,"Foundation.PrivateKey",r.FoundationInterfaceTag.PRIVATE_KEY,r.FoundationInterface),s=e._vscf_ecc_signature_len(this.ctxPtr,_.ctxPtr),s}signHash(_,s,n){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("privateKey",_,"Foundation.PrivateKey",r.FoundationInterfaceTag.PRIVATE_KEY,r.FoundationInterface),t.ensureByteArray("digest",n);const c=n.length*n.BYTES_PER_ELEMENT,i=e._malloc(c);e.HEAP8.set(n,i);const a=e._vsc_data_ctx_size(),o=e._malloc(a);e._vsc_data(o,i,c);const l=this.signatureLen(_),u=e._vsc_buffer_new_with_capacity(l);try{const t=e._vscf_ecc_sign_hash(this.ctxPtr,_.ctxPtr,s,o,u);r.FoundationError.handleStatusCode(t);const n=e._vsc_buffer_bytes(u),c=e._vsc_buffer_len(u);return e.HEAPU8.slice(n,n+c)}finally{e._free(i),e._free(o),e._vsc_buffer_delete(u)}}canVerify(_){let s;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("publicKey",_,"Foundation.PublicKey",r.FoundationInterfaceTag.PUBLIC_KEY,r.FoundationInterface),s=e._vscf_ecc_can_verify(this.ctxPtr,_.ctxPtr),!!s}verifyHash(_,s,n,c){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("publicKey",_,"Foundation.PublicKey",r.FoundationInterfaceTag.PUBLIC_KEY,r.FoundationInterface),t.ensureByteArray("digest",n),t.ensureByteArray("signature",c);const i=n.length*n.BYTES_PER_ELEMENT,a=e._malloc(i);e.HEAP8.set(n,a);const o=e._vsc_data_ctx_size(),l=e._malloc(o);e._vsc_data(l,a,i);const u=c.length*c.BYTES_PER_ELEMENT,f=e._malloc(u);e.HEAP8.set(c,f);const d=e._vsc_data_ctx_size(),h=e._malloc(d);e._vsc_data(h,f,u);try{return!!e._vscf_ecc_verify_hash(this.ctxPtr,_.ctxPtr,s,l,h)}finally{e._free(a),e._free(l),e._free(f),e._free(h)}}computeSharedKey(_,s){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("publicKey",_,"Foundation.PublicKey",r.FoundationInterfaceTag.PUBLIC_KEY,r.FoundationInterface),t.ensureImplementInterface("privateKey",s,"Foundation.PrivateKey",r.FoundationInterfaceTag.PRIVATE_KEY,r.FoundationInterface);const n=this.sharedKeyLen(s),c=e._vsc_buffer_new_with_capacity(n);try{const t=e._vscf_ecc_compute_shared_key(this.ctxPtr,_.ctxPtr,s.ctxPtr,c);r.FoundationError.handleStatusCode(t);const n=e._vsc_buffer_bytes(c),i=e._vsc_buffer_len(c);return e.HEAPU8.slice(n,n+i)}finally{e._vsc_buffer_delete(c)}}sharedKeyLen(_){let s;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("key",_,"Foundation.Key",r.FoundationInterfaceTag.KEY,r.FoundationInterface),s=e._vscf_ecc_shared_key_len(this.ctxPtr,_.ctxPtr),s}kemSharedKeyLen(_){let s;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("key",_,"Foundation.Key",r.FoundationInterfaceTag.KEY,r.FoundationInterface),s=e._vscf_ecc_kem_shared_key_len(this.ctxPtr,_.ctxPtr),s}kemEncapsulatedKeyLen(_){let s;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("publicKey",_,"Foundation.PublicKey",r.FoundationInterfaceTag.PUBLIC_KEY,r.FoundationInterface),s=e._vscf_ecc_kem_encapsulated_key_len(this.ctxPtr,_.ctxPtr),s}kemEncapsulate(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("publicKey",_,"Foundation.PublicKey",r.FoundationInterfaceTag.PUBLIC_KEY,r.FoundationInterface);const s=this.kemSharedKeyLen(_),n=e._vsc_buffer_new_with_capacity(s),c=this.kemEncapsulatedKeyLen(_),i=e._vsc_buffer_new_with_capacity(c);try{const t=e._vscf_ecc_kem_encapsulate(this.ctxPtr,_.ctxPtr,n,i);r.FoundationError.handleStatusCode(t);const s=e._vsc_buffer_bytes(n),c=e._vsc_buffer_len(n),a=e.HEAPU8.slice(s,s+c),o=e._vsc_buffer_bytes(i),l=e._vsc_buffer_len(i);return{sharedKey:a,encapsulatedKey:e.HEAPU8.slice(o,o+l)}}finally{e._vsc_buffer_delete(n),e._vsc_buffer_delete(i)}}kemDecapsulate(_,s){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureByteArray("encapsulatedKey",_),t.ensureImplementInterface("privateKey",s,"Foundation.PrivateKey",r.FoundationInterfaceTag.PRIVATE_KEY,r.FoundationInterface);const n=_.length*_.BYTES_PER_ELEMENT,c=e._malloc(n);e.HEAP8.set(_,c);const i=e._vsc_data_ctx_size(),a=e._malloc(i);e._vsc_data(a,c,n);const o=this.kemSharedKeyLen(s),l=e._vsc_buffer_new_with_capacity(o);try{const t=e._vscf_ecc_kem_decapsulate(this.ctxPtr,a,s.ctxPtr,l);r.FoundationError.handleStatusCode(t);const _=e._vsc_buffer_bytes(l),n=e._vsc_buffer_len(l);return e.HEAPU8.slice(_,_+n)}finally{e._free(c),e._free(a),e._vsc_buffer_delete(l)}}setupDefaults(){t.ensureNotNull("this.ctxPtr",this.ctxPtr);const _=e._vscf_ecc_setup_defaults(this.ctxPtr);r.FoundationError.handleStatusCode(_)}static writeSignature(_,s){t.ensureClass("r",_,r.MbedtlsMpi),t.ensureClass("s",s,r.MbedtlsMpi);const n=e._vsc_buffer_new_with_capacity(0);try{e._vscf_ecc_write_signature(_.ctxPtr,s.ctxPtr,n);const t=e._vsc_buffer_bytes(n),r=e._vsc_buffer_len(n);return e.HEAPU8.slice(t,t+r)}finally{e._vsc_buffer_delete(n)}}writeSignature(t,e){return _.writeSignature(t,e)}static readSignature(_,s,n){t.ensureByteArray("signature",_),t.ensureClass("r",s,r.MbedtlsMpi),t.ensureClass("s",n,r.MbedtlsMpi);const c=_.length*_.BYTES_PER_ELEMENT,i=e._malloc(c);e.HEAP8.set(_,i);const a=e._vsc_data_ctx_size(),o=e._malloc(a);e._vsc_data(o,i,c);try{const t=e._vscf_ecc_read_signature(o,s.ctxPtr,n.ctxPtr);r.FoundationError.handleStatusCode(t)}finally{e._free(i),e._free(o)}}readSignature(t,e,r){return _.readSignature(t,e,r)}generateKey(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr);const s=e._vscf_error_ctx_size(),n=e._malloc(s);let c;e._vscf_error_reset(n);try{c=e._vscf_ecc_generate_key(this.ctxPtr,_,n);const t=e._vscf_error_status(n);return r.FoundationError.handleStatusCode(t),r.FoundationInterface.newAndTakeCContext(c)}finally{e._free(n)}}produceAlgInfoForKey(_){let s;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("key",_,"Foundation.Key",r.FoundationInterfaceTag.KEY,r.FoundationInterface),s=e._vscf_ecc_produce_alg_info_for_key(this.ctxPtr,_.ctxPtr),r.FoundationInterface.newAndTakeCContext(s)}}return _}}(),I_=function(){if(re)return ee;re=1;const t=Ar();return ee=(e,r)=>{class _{constructor(t){this.name="EntropyAccumulator",this.ctxPtr=void 0===t?e._vscf_entropy_accumulator_new():t}static newAndUseCContext(t){return new _(e._vscf_entropy_accumulator_shallow_copy(t))}static newAndTakeCContext(t){return new _(t)}delete(){void 0!==this.ctxPtr&&null!==this.ctxPtr&&(e._vscf_entropy_accumulator_delete(this.ctxPtr),this.ctxPtr=null)}static get SOURCES_MAX(){return 15}get SOURCES_MAX(){return 15}isStrong(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_entropy_accumulator_is_strong(this.ctxPtr),!!r}gather(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureNumber("len",_);const s=_,n=e._vsc_buffer_new_with_capacity(s);try{const t=e._vscf_entropy_accumulator_gather(this.ctxPtr,_,n);r.FoundationError.handleStatusCode(t);const s=e._vsc_buffer_bytes(n),c=e._vsc_buffer_len(n);return e.HEAPU8.slice(s,s+c)}finally{e._vsc_buffer_delete(n)}}setupDefaults(){t.ensureNotNull("this.ctxPtr",this.ctxPtr),e._vscf_entropy_accumulator_setup_defaults(this.ctxPtr)}addSource(_,s){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("source",_,"Foundation.EntropySource",r.FoundationInterfaceTag.ENTROPY_SOURCE,r.FoundationInterface),t.ensureNumber("threshold",s),e._vscf_entropy_accumulator_add_source(this.ctxPtr,_.ctxPtr,s)}}return _}}(),E_=function(){if(se)return _e;se=1;const t=Ar();return _e=(e,r)=>{class _{constructor(t){this.name="CtrDrbg",this.ctxPtr=void 0===t?e._vscf_ctr_drbg_new():t}static newAndUseCContext(t){return new _(e._vscf_ctr_drbg_shallow_copy(t))}static newAndTakeCContext(t){return new _(t)}delete(){void 0!==this.ctxPtr&&null!==this.ctxPtr&&(e._vscf_ctr_drbg_delete(this.ctxPtr),this.ctxPtr=null)}set entropySource(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("entropySource",_,"Foundation.EntropySource",r.FoundationInterfaceTag.ENTROPY_SOURCE,r.FoundationInterface),e._vscf_ctr_drbg_release_entropy_source(this.ctxPtr),e._vscf_ctr_drbg_use_entropy_source(this.ctxPtr,_.ctxPtr)}static get RESEED_INTERVAL(){return 1e4}get RESEED_INTERVAL(){return 1e4}static get ENTROPY_LEN(){return 48}get ENTROPY_LEN(){return 48}random(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureNumber("dataLen",_);const s=_,n=e._vsc_buffer_new_with_capacity(s);try{const t=e._vscf_ctr_drbg_random(this.ctxPtr,_,n);r.FoundationError.handleStatusCode(t);const s=e._vsc_buffer_bytes(n),c=e._vsc_buffer_len(n);return e.HEAPU8.slice(s,s+c)}finally{e._vsc_buffer_delete(n)}}reseed(){t.ensureNotNull("this.ctxPtr",this.ctxPtr);const _=e._vscf_ctr_drbg_reseed(this.ctxPtr);r.FoundationError.handleStatusCode(_)}setupDefaults(){t.ensureNotNull("this.ctxPtr",this.ctxPtr);const _=e._vscf_ctr_drbg_setup_defaults(this.ctxPtr);r.FoundationError.handleStatusCode(_)}enablePredictionResistance(){t.ensureNotNull("this.ctxPtr",this.ctxPtr),e._vscf_ctr_drbg_enable_prediction_resistance(this.ctxPtr)}setReseedInterval(r){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureNumber("interval",r),e._vscf_ctr_drbg_set_reseed_interval(this.ctxPtr,r)}setEntropyLen(r){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureNumber("len",r),e._vscf_ctr_drbg_set_entropy_len(this.ctxPtr,r)}}return _}}(),w_=function(){if(ce)return ne;ce=1;const t=Ar();return ne=(e,r)=>{class _{constructor(t){this.name="Hmac",this.ctxPtr=void 0===t?e._vscf_hmac_new():t}static newAndUseCContext(t){return new _(e._vscf_hmac_shallow_copy(t))}static newAndTakeCContext(t){return new _(t)}delete(){void 0!==this.ctxPtr&&null!==this.ctxPtr&&(e._vscf_hmac_delete(this.ctxPtr),this.ctxPtr=null)}set hash(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("hash",_,"Foundation.Hash",r.FoundationInterfaceTag.HASH,r.FoundationInterface),e._vscf_hmac_release_hash(this.ctxPtr),e._vscf_hmac_use_hash(this.ctxPtr,_.ctxPtr)}algId(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_hmac_alg_id(this.ctxPtr),r}produceAlgInfo(){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),_=e._vscf_hmac_produce_alg_info(this.ctxPtr),r.FoundationInterface.newAndTakeCContext(_)}restoreAlgInfo(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("algInfo",_,"Foundation.AlgInfo",r.FoundationInterfaceTag.ALG_INFO,r.FoundationInterface);const s=e._vscf_hmac_restore_alg_info(this.ctxPtr,_.ctxPtr);r.FoundationError.handleStatusCode(s)}digestLen(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_hmac_digest_len(this.ctxPtr),r}mac(r,_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureByteArray("key",r),t.ensureByteArray("data",_);const s=r.length*r.BYTES_PER_ELEMENT,n=e._malloc(s);e.HEAP8.set(r,n);const c=e._vsc_data_ctx_size(),i=e._malloc(c);e._vsc_data(i,n,s);const a=_.length*_.BYTES_PER_ELEMENT,o=e._malloc(a);e.HEAP8.set(_,o);const l=e._vsc_data_ctx_size(),u=e._malloc(l);e._vsc_data(u,o,a);const f=this.digestLen(),d=e._vsc_buffer_new_with_capacity(f);try{e._vscf_hmac_mac(this.ctxPtr,i,u,d);const t=e._vsc_buffer_bytes(d),r=e._vsc_buffer_len(d);return e.HEAPU8.slice(t,t+r)}finally{e._free(n),e._free(i),e._free(o),e._free(u),e._vsc_buffer_delete(d)}}start(r){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureByteArray("key",r);const _=r.length*r.BYTES_PER_ELEMENT,s=e._malloc(_);e.HEAP8.set(r,s);const n=e._vsc_data_ctx_size(),c=e._malloc(n);e._vsc_data(c,s,_);try{e._vscf_hmac_start(this.ctxPtr,c)}finally{e._free(s),e._free(c)}}update(r){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureByteArray("data",r);const _=r.length*r.BYTES_PER_ELEMENT,s=e._malloc(_);e.HEAP8.set(r,s);const n=e._vsc_data_ctx_size(),c=e._malloc(n);e._vsc_data(c,s,_);try{e._vscf_hmac_update(this.ctxPtr,c)}finally{e._free(s),e._free(c)}}finish(){t.ensureNotNull("this.ctxPtr",this.ctxPtr);const r=this.digestLen(),_=e._vsc_buffer_new_with_capacity(r);try{e._vscf_hmac_finish(this.ctxPtr,_);const t=e._vsc_buffer_bytes(_),r=e._vsc_buffer_len(_);return e.HEAPU8.slice(t,t+r)}finally{e._vsc_buffer_delete(_)}}reset(){t.ensureNotNull("this.ctxPtr",this.ctxPtr),e._vscf_hmac_reset(this.ctxPtr)}}return _}}(),b_=function(){if(ae)return ie;ae=1;const t=Ar();return ie=(e,r)=>{class _{constructor(t){this.name="Hkdf",this.ctxPtr=void 0===t?e._vscf_hkdf_new():t}static newAndUseCContext(t){return new _(e._vscf_hkdf_shallow_copy(t))}static newAndTakeCContext(t){return new _(t)}delete(){void 0!==this.ctxPtr&&null!==this.ctxPtr&&(e._vscf_hkdf_delete(this.ctxPtr),this.ctxPtr=null)}set hash(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("hash",_,"Foundation.Hash",r.FoundationInterfaceTag.HASH,r.FoundationInterface),e._vscf_hkdf_release_hash(this.ctxPtr),e._vscf_hkdf_use_hash(this.ctxPtr,_.ctxPtr)}static get HASH_COUNTER_MAX(){return 255}get HASH_COUNTER_MAX(){return 255}algId(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_hkdf_alg_id(this.ctxPtr),r}produceAlgInfo(){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),_=e._vscf_hkdf_produce_alg_info(this.ctxPtr),r.FoundationInterface.newAndTakeCContext(_)}restoreAlgInfo(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("algInfo",_,"Foundation.AlgInfo",r.FoundationInterfaceTag.ALG_INFO,r.FoundationInterface);const s=e._vscf_hkdf_restore_alg_info(this.ctxPtr,_.ctxPtr);r.FoundationError.handleStatusCode(s)}derive(r,_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureByteArray("data",r),t.ensureNumber("keyLen",_);const s=r.length*r.BYTES_PER_ELEMENT,n=e._malloc(s);e.HEAP8.set(r,n);const c=e._vsc_data_ctx_size(),i=e._malloc(c);e._vsc_data(i,n,s);const a=_,o=e._vsc_buffer_new_with_capacity(a);try{e._vscf_hkdf_derive(this.ctxPtr,i,_,o);const t=e._vsc_buffer_bytes(o),r=e._vsc_buffer_len(o);return e.HEAPU8.slice(t,t+r)}finally{e._free(n),e._free(i),e._vsc_buffer_delete(o)}}reset(r,_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureByteArray("salt",r),t.ensureNumber("iterationCount",_);const s=r.length*r.BYTES_PER_ELEMENT,n=e._malloc(s);e.HEAP8.set(r,n);const c=e._vsc_data_ctx_size(),i=e._malloc(c);e._vsc_data(i,n,s);try{e._vscf_hkdf_reset(this.ctxPtr,i,_)}finally{e._free(n),e._free(i)}}setInfo(r){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureByteArray("info",r);const _=r.length*r.BYTES_PER_ELEMENT,s=e._malloc(_);e.HEAP8.set(r,s);const n=e._vsc_data_ctx_size(),c=e._malloc(n);e._vsc_data(c,s,_);try{e._vscf_hkdf_set_info(this.ctxPtr,c)}finally{e._free(s),e._free(c)}}}return _}}(),k_=function(){if(le)return oe;le=1;const t=Ar();return oe=(e,r)=>{class _{constructor(t){this.name="Kdf1",this.ctxPtr=void 0===t?e._vscf_kdf1_new():t}static newAndUseCContext(t){return new _(e._vscf_kdf1_shallow_copy(t))}static newAndTakeCContext(t){return new _(t)}delete(){void 0!==this.ctxPtr&&null!==this.ctxPtr&&(e._vscf_kdf1_delete(this.ctxPtr),this.ctxPtr=null)}set hash(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("hash",_,"Foundation.Hash",r.FoundationInterfaceTag.HASH,r.FoundationInterface),e._vscf_kdf1_release_hash(this.ctxPtr),e._vscf_kdf1_use_hash(this.ctxPtr,_.ctxPtr)}algId(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_kdf1_alg_id(this.ctxPtr),r}produceAlgInfo(){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),_=e._vscf_kdf1_produce_alg_info(this.ctxPtr),r.FoundationInterface.newAndTakeCContext(_)}restoreAlgInfo(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("algInfo",_,"Foundation.AlgInfo",r.FoundationInterfaceTag.ALG_INFO,r.FoundationInterface);const s=e._vscf_kdf1_restore_alg_info(this.ctxPtr,_.ctxPtr);r.FoundationError.handleStatusCode(s)}derive(r,_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureByteArray("data",r),t.ensureNumber("keyLen",_);const s=r.length*r.BYTES_PER_ELEMENT,n=e._malloc(s);e.HEAP8.set(r,n);const c=e._vsc_data_ctx_size(),i=e._malloc(c);e._vsc_data(i,n,s);const a=_,o=e._vsc_buffer_new_with_capacity(a);try{e._vscf_kdf1_derive(this.ctxPtr,i,_,o);const t=e._vsc_buffer_bytes(o),r=e._vsc_buffer_len(o);return e.HEAPU8.slice(t,t+r)}finally{e._free(n),e._free(i),e._vsc_buffer_delete(o)}}}return _}}(),A_=function(){if(fe)return ue;fe=1;const t=Ar();return ue=(e,r)=>{class _{constructor(t){this.name="Kdf2",this.ctxPtr=void 0===t?e._vscf_kdf2_new():t}static newAndUseCContext(t){return new _(e._vscf_kdf2_shallow_copy(t))}static newAndTakeCContext(t){return new _(t)}delete(){void 0!==this.ctxPtr&&null!==this.ctxPtr&&(e._vscf_kdf2_delete(this.ctxPtr),this.ctxPtr=null)}set hash(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("hash",_,"Foundation.Hash",r.FoundationInterfaceTag.HASH,r.FoundationInterface),e._vscf_kdf2_release_hash(this.ctxPtr),e._vscf_kdf2_use_hash(this.ctxPtr,_.ctxPtr)}algId(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_kdf2_alg_id(this.ctxPtr),r}produceAlgInfo(){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),_=e._vscf_kdf2_produce_alg_info(this.ctxPtr),r.FoundationInterface.newAndTakeCContext(_)}restoreAlgInfo(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("algInfo",_,"Foundation.AlgInfo",r.FoundationInterfaceTag.ALG_INFO,r.FoundationInterface);const s=e._vscf_kdf2_restore_alg_info(this.ctxPtr,_.ctxPtr);r.FoundationError.handleStatusCode(s)}derive(r,_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureByteArray("data",r),t.ensureNumber("keyLen",_);const s=r.length*r.BYTES_PER_ELEMENT,n=e._malloc(s);e.HEAP8.set(r,n);const c=e._vsc_data_ctx_size(),i=e._malloc(c);e._vsc_data(i,n,s);const a=_,o=e._vsc_buffer_new_with_capacity(a);try{e._vscf_kdf2_derive(this.ctxPtr,i,_,o);const t=e._vsc_buffer_bytes(o),r=e._vsc_buffer_len(o);return e.HEAPU8.slice(t,t+r)}finally{e._free(n),e._free(i),e._vsc_buffer_delete(o)}}}return _}}(),C_=function(){if(he)return de;he=1;const t=Ar();return de=(e,r)=>{class _{constructor(t){this.name="FakeRandom",this.ctxPtr=void 0===t?e._vscf_fake_random_new():t}static newAndUseCContext(t){return new _(e._vscf_fake_random_shallow_copy(t))}static newAndTakeCContext(t){return new _(t)}delete(){void 0!==this.ctxPtr&&null!==this.ctxPtr&&(e._vscf_fake_random_delete(this.ctxPtr),this.ctxPtr=null)}random(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureNumber("dataLen",_);const s=_,n=e._vsc_buffer_new_with_capacity(s);try{const t=e._vscf_fake_random_random(this.ctxPtr,_,n);r.FoundationError.handleStatusCode(t);const s=e._vsc_buffer_bytes(n),c=e._vsc_buffer_len(n);return e.HEAPU8.slice(s,s+c)}finally{e._vsc_buffer_delete(n)}}reseed(){t.ensureNotNull("this.ctxPtr",this.ctxPtr);const _=e._vscf_fake_random_reseed(this.ctxPtr);r.FoundationError.handleStatusCode(_)}isStrong(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_fake_random_is_strong(this.ctxPtr),!!r}gather(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureNumber("len",_);const s=_,n=e._vsc_buffer_new_with_capacity(s);try{const t=e._vscf_fake_random_gather(this.ctxPtr,_,n);r.FoundationError.handleStatusCode(t);const s=e._vsc_buffer_bytes(n),c=e._vsc_buffer_len(n);return e.HEAPU8.slice(s,s+c)}finally{e._vsc_buffer_delete(n)}}setupSourceByte(r){t.ensureNotNull("this.ctxPtr",this.ctxPtr),e._vscf_fake_random_setup_source_byte(this.ctxPtr,r)}setupSourceData(r){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureByteArray("dataSource",r);const _=r.length*r.BYTES_PER_ELEMENT,s=e._malloc(_);e.HEAP8.set(r,s);const n=e._vsc_data_ctx_size(),c=e._malloc(n);e._vsc_data(c,s,_);try{e._vscf_fake_random_setup_source_data(this.ctxPtr,c)}finally{e._free(s),e._free(c)}}}return _}}(),F_=function(){if(ve)return Pe;ve=1;const t=Ar();return Pe=(e,r)=>{class _{constructor(t){this.name="Pkcs5Pbkdf2",this.ctxPtr=void 0===t?e._vscf_pkcs5_pbkdf2_new():t}static newAndUseCContext(t){return new _(e._vscf_pkcs5_pbkdf2_shallow_copy(t))}static newAndTakeCContext(t){return new _(t)}delete(){void 0!==this.ctxPtr&&null!==this.ctxPtr&&(e._vscf_pkcs5_pbkdf2_delete(this.ctxPtr),this.ctxPtr=null)}set hmac(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("hmac",_,"Foundation.Mac",r.FoundationInterfaceTag.MAC,r.FoundationInterface),e._vscf_pkcs5_pbkdf2_release_hmac(this.ctxPtr),e._vscf_pkcs5_pbkdf2_use_hmac(this.ctxPtr,_.ctxPtr)}algId(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_pkcs5_pbkdf2_alg_id(this.ctxPtr),r}produceAlgInfo(){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),_=e._vscf_pkcs5_pbkdf2_produce_alg_info(this.ctxPtr),r.FoundationInterface.newAndTakeCContext(_)}restoreAlgInfo(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("algInfo",_,"Foundation.AlgInfo",r.FoundationInterfaceTag.ALG_INFO,r.FoundationInterface);const s=e._vscf_pkcs5_pbkdf2_restore_alg_info(this.ctxPtr,_.ctxPtr);r.FoundationError.handleStatusCode(s)}derive(r,_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureByteArray("data",r),t.ensureNumber("keyLen",_);const s=r.length*r.BYTES_PER_ELEMENT,n=e._malloc(s);e.HEAP8.set(r,n);const c=e._vsc_data_ctx_size(),i=e._malloc(c);e._vsc_data(i,n,s);const a=_,o=e._vsc_buffer_new_with_capacity(a);try{e._vscf_pkcs5_pbkdf2_derive(this.ctxPtr,i,_,o);const t=e._vsc_buffer_bytes(o),r=e._vsc_buffer_len(o);return e.HEAPU8.slice(t,t+r)}finally{e._free(n),e._free(i),e._vsc_buffer_delete(o)}}reset(r,_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureByteArray("salt",r),t.ensureNumber("iterationCount",_);const s=r.length*r.BYTES_PER_ELEMENT,n=e._malloc(s);e.HEAP8.set(r,n);const c=e._vsc_data_ctx_size(),i=e._malloc(c);e._vsc_data(i,n,s);try{e._vscf_pkcs5_pbkdf2_reset(this.ctxPtr,i,_)}finally{e._free(n),e._free(i)}}setInfo(r){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureByteArray("info",r);const _=r.length*r.BYTES_PER_ELEMENT,s=e._malloc(_);e.HEAP8.set(r,s);const n=e._vsc_data_ctx_size(),c=e._malloc(n);e._vsc_data(c,s,_);try{e._vscf_pkcs5_pbkdf2_set_info(this.ctxPtr,c)}finally{e._free(s),e._free(c)}}setupDefaults(){t.ensureNotNull("this.ctxPtr",this.ctxPtr),e._vscf_pkcs5_pbkdf2_setup_defaults(this.ctxPtr)}}return _}}(),T_=function(){if(ye)return xe;ye=1;const t=Ar();return xe=(e,r)=>{class _{constructor(t){this.name="Pkcs5Pbes2",this.ctxPtr=void 0===t?e._vscf_pkcs5_pbes2_new():t}static newAndUseCContext(t){return new _(e._vscf_pkcs5_pbes2_shallow_copy(t))}static newAndTakeCContext(t){return new _(t)}delete(){void 0!==this.ctxPtr&&null!==this.ctxPtr&&(e._vscf_pkcs5_pbes2_delete(this.ctxPtr),this.ctxPtr=null)}set kdf(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("kdf",_,"Foundation.SaltedKdf",r.FoundationInterfaceTag.SALTED_KDF,r.FoundationInterface),e._vscf_pkcs5_pbes2_release_kdf(this.ctxPtr),e._vscf_pkcs5_pbes2_use_kdf(this.ctxPtr,_.ctxPtr)}set cipher(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("cipher",_,"Foundation.Cipher",r.FoundationInterfaceTag.CIPHER,r.FoundationInterface),e._vscf_pkcs5_pbes2_release_cipher(this.ctxPtr),e._vscf_pkcs5_pbes2_use_cipher(this.ctxPtr,_.ctxPtr)}algId(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_pkcs5_pbes2_alg_id(this.ctxPtr),r}produceAlgInfo(){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),_=e._vscf_pkcs5_pbes2_produce_alg_info(this.ctxPtr),r.FoundationInterface.newAndTakeCContext(_)}restoreAlgInfo(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("algInfo",_,"Foundation.AlgInfo",r.FoundationInterfaceTag.ALG_INFO,r.FoundationInterface);const s=e._vscf_pkcs5_pbes2_restore_alg_info(this.ctxPtr,_.ctxPtr);r.FoundationError.handleStatusCode(s)}encrypt(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureByteArray("data",_);const s=_.length*_.BYTES_PER_ELEMENT,n=e._malloc(s);e.HEAP8.set(_,n);const c=e._vsc_data_ctx_size(),i=e._malloc(c);e._vsc_data(i,n,s);const a=this.encryptedLen(_.length),o=e._vsc_buffer_new_with_capacity(a);try{const t=e._vscf_pkcs5_pbes2_encrypt(this.ctxPtr,i,o);r.FoundationError.handleStatusCode(t);const _=e._vsc_buffer_bytes(o),s=e._vsc_buffer_len(o);return e.HEAPU8.slice(_,_+s)}finally{e._free(n),e._free(i),e._vsc_buffer_delete(o)}}encryptedLen(r){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureNumber("dataLen",r),_=e._vscf_pkcs5_pbes2_encrypted_len(this.ctxPtr,r),_}preciseEncryptedLen(r){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureNumber("dataLen",r),_=e._vscf_pkcs5_pbes2_precise_encrypted_len(this.ctxPtr,r),_}decrypt(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureByteArray("data",_);const s=_.length*_.BYTES_PER_ELEMENT,n=e._malloc(s);e.HEAP8.set(_,n);const c=e._vsc_data_ctx_size(),i=e._malloc(c);e._vsc_data(i,n,s);const a=this.decryptedLen(_.length),o=e._vsc_buffer_new_with_capacity(a);try{const t=e._vscf_pkcs5_pbes2_decrypt(this.ctxPtr,i,o);r.FoundationError.handleStatusCode(t);const _=e._vsc_buffer_bytes(o),s=e._vsc_buffer_len(o);return e.HEAPU8.slice(_,_+s)}finally{e._free(n),e._free(i),e._vsc_buffer_delete(o)}}decryptedLen(r){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureNumber("dataLen",r),_=e._vscf_pkcs5_pbes2_decrypted_len(this.ctxPtr,r),_}reset(r){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureByteArray("pwd",r);const _=r.length*r.BYTES_PER_ELEMENT,s=e._malloc(_);e.HEAP8.set(r,s);const n=e._vsc_data_ctx_size(),c=e._malloc(n);e._vsc_data(c,s,_);try{e._vscf_pkcs5_pbes2_reset(this.ctxPtr,c)}finally{e._free(s),e._free(c)}}}return _}}(),K_=function(){if(ge)return pe;ge=1;const t=Ar();return pe=(e,r)=>{class _{constructor(t){this.name="SeedEntropySource",this.ctxPtr=void 0===t?e._vscf_seed_entropy_source_new():t}static newAndUseCContext(t){return new _(e._vscf_seed_entropy_source_shallow_copy(t))}static newAndTakeCContext(t){return new _(t)}delete(){void 0!==this.ctxPtr&&null!==this.ctxPtr&&(e._vscf_seed_entropy_source_delete(this.ctxPtr),this.ctxPtr=null)}static get GATHER_LEN_MAX(){return 48}get GATHER_LEN_MAX(){return 48}isStrong(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_seed_entropy_source_is_strong(this.ctxPtr),!!r}gather(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureNumber("len",_);const s=_,n=e._vsc_buffer_new_with_capacity(s);try{const t=e._vscf_seed_entropy_source_gather(this.ctxPtr,_,n);r.FoundationError.handleStatusCode(t);const s=e._vsc_buffer_bytes(n),c=e._vsc_buffer_len(n);return e.HEAPU8.slice(s,s+c)}finally{e._vsc_buffer_delete(n)}}resetSeed(r){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureByteArray("seed",r);const _=r.length*r.BYTES_PER_ELEMENT,s=e._malloc(_);e.HEAP8.set(r,s);const n=e._vsc_data_ctx_size(),c=e._malloc(n);e._vsc_data(c,s,_);try{e._vscf_seed_entropy_source_reset_seed(this.ctxPtr,c)}finally{e._free(s),e._free(c)}}moveForward(){t.ensureNotNull("this.ctxPtr",this.ctxPtr),e._vscf_seed_entropy_source_move_forward(this.ctxPtr)}}return _}}(),S_=function(){if(Ne)return me;Ne=1;const t=Ar();return me=(e,r)=>{class _{constructor(t){this.name="KeyMaterialRng",this.ctxPtr=void 0===t?e._vscf_key_material_rng_new():t}static newAndUseCContext(t){return new _(e._vscf_key_material_rng_shallow_copy(t))}static newAndTakeCContext(t){return new _(t)}delete(){void 0!==this.ctxPtr&&null!==this.ctxPtr&&(e._vscf_key_material_rng_delete(this.ctxPtr),this.ctxPtr=null)}static get KEY_MATERIAL_LEN_MIN(){return 32}get KEY_MATERIAL_LEN_MIN(){return 32}static get KEY_MATERIAL_LEN_MAX(){return 512}get KEY_MATERIAL_LEN_MAX(){return 512}random(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureNumber("dataLen",_);const s=_,n=e._vsc_buffer_new_with_capacity(s);try{const t=e._vscf_key_material_rng_random(this.ctxPtr,_,n);r.FoundationError.handleStatusCode(t);const s=e._vsc_buffer_bytes(n),c=e._vsc_buffer_len(n);return e.HEAPU8.slice(s,s+c)}finally{e._vsc_buffer_delete(n)}}reseed(){t.ensureNotNull("this.ctxPtr",this.ctxPtr);const _=e._vscf_key_material_rng_reseed(this.ctxPtr);r.FoundationError.handleStatusCode(_)}resetKeyMaterial(r){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureByteArray("keyMaterial",r);const _=r.length*r.BYTES_PER_ELEMENT,s=e._malloc(_);e.HEAP8.set(r,s);const n=e._vsc_data_ctx_size(),c=e._malloc(n);e._vsc_data(c,s,_);try{e._vscf_key_material_rng_reset_key_material(this.ctxPtr,c)}finally{e._free(s),e._free(c)}}}return _}}(),z_=function(){if(Ee)return Ie;Ee=1;const t=Ar();return Ie=(e,r)=>{class _{constructor(t){this.name="RawPublicKey",this.ctxPtr=void 0===t?e._vscf_raw_public_key_new():t}static newAndUseCContext(t){return new _(e._vscf_raw_public_key_shallow_copy(t))}static newAndTakeCContext(t){return new _(t)}delete(){void 0!==this.ctxPtr&&null!==this.ctxPtr&&(e._vscf_raw_public_key_delete(this.ctxPtr),this.ctxPtr=null)}algId(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_raw_public_key_alg_id(this.ctxPtr),r}algInfo(){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),_=e._vscf_raw_public_key_alg_info(this.ctxPtr),r.FoundationInterface.newAndUseCContext(_)}len(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_raw_public_key_len(this.ctxPtr),r}bitlen(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_raw_public_key_bitlen(this.ctxPtr),r}isValid(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_raw_public_key_is_valid(this.ctxPtr),!!r}data(){t.ensureNotNull("this.ctxPtr",this.ctxPtr),e._vscf_raw_public_key_data(this.ctxPtr)}}return _}}(),L_=function(){if(be)return we;be=1;const t=Ar();return we=(e,r)=>{class _{constructor(t){this.name="RawPrivateKey",this.ctxPtr=void 0===t?e._vscf_raw_private_key_new():t}static newAndUseCContext(t){return new _(e._vscf_raw_private_key_shallow_copy(t))}static newAndTakeCContext(t){return new _(t)}delete(){void 0!==this.ctxPtr&&null!==this.ctxPtr&&(e._vscf_raw_private_key_delete(this.ctxPtr),this.ctxPtr=null)}algId(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_raw_private_key_alg_id(this.ctxPtr),r}algInfo(){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),_=e._vscf_raw_private_key_alg_info(this.ctxPtr),r.FoundationInterface.newAndUseCContext(_)}len(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_raw_private_key_len(this.ctxPtr),r}bitlen(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_raw_private_key_bitlen(this.ctxPtr),r}isValid(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_raw_private_key_is_valid(this.ctxPtr),!!r}extractPublicKey(){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),_=e._vscf_raw_private_key_extract_public_key(this.ctxPtr),r.FoundationInterface.newAndTakeCContext(_)}data(){t.ensureNotNull("this.ctxPtr",this.ctxPtr),e._vscf_raw_private_key_data(this.ctxPtr)}hasPublicKey(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_raw_private_key_has_public_key(this.ctxPtr),!!r}setPublicKey(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureClass("rawPublicKey",_,r.RawPublicKey),e._vscf_raw_private_key_set_public_key(this.ctxPtr,_.ctxPtr)}getPublicKey(){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),_=e._vscf_raw_private_key_get_public_key(this.ctxPtr),r.RawPublicKey.newAndUseCContext(_)}}return _}}(),R_=function(){if(Ae)return ke;Ae=1;const t=Ar();return ke=(e,r)=>{class _{constructor(t){this.name="Pkcs8Serializer",this.ctxPtr=void 0===t?e._vscf_pkcs8_serializer_new():t}static newAndUseCContext(t){return new _(e._vscf_pkcs8_serializer_shallow_copy(t))}static newAndTakeCContext(t){return new _(t)}delete(){void 0!==this.ctxPtr&&null!==this.ctxPtr&&(e._vscf_pkcs8_serializer_delete(this.ctxPtr),this.ctxPtr=null)}set asn1Writer(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("asn1Writer",_,"Foundation.Asn1Writer",r.FoundationInterfaceTag.ASN1_WRITER,r.FoundationInterface),e._vscf_pkcs8_serializer_release_asn1_writer(this.ctxPtr),e._vscf_pkcs8_serializer_use_asn1_writer(this.ctxPtr,_.ctxPtr)}serializedPublicKeyLen(_){let s;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureClass("publicKey",_,r.RawPublicKey),s=e._vscf_pkcs8_serializer_serialized_public_key_len(this.ctxPtr,_.ctxPtr),s}serializePublicKey(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureClass("publicKey",_,r.RawPublicKey);const s=this.serializedPublicKeyLen(_),n=e._vsc_buffer_new_with_capacity(s);try{const t=e._vscf_pkcs8_serializer_serialize_public_key(this.ctxPtr,_.ctxPtr,n);r.FoundationError.handleStatusCode(t);const s=e._vsc_buffer_bytes(n),c=e._vsc_buffer_len(n);return e.HEAPU8.slice(s,s+c)}finally{e._vsc_buffer_delete(n)}}serializedPrivateKeyLen(_){let s;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureClass("privateKey",_,r.RawPrivateKey),s=e._vscf_pkcs8_serializer_serialized_private_key_len(this.ctxPtr,_.ctxPtr),s}serializePrivateKey(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureClass("privateKey",_,r.RawPrivateKey);const s=this.serializedPrivateKeyLen(_),n=e._vsc_buffer_new_with_capacity(s);try{const t=e._vscf_pkcs8_serializer_serialize_private_key(this.ctxPtr,_.ctxPtr,n);r.FoundationError.handleStatusCode(t);const s=e._vsc_buffer_bytes(n),c=e._vsc_buffer_len(n);return e.HEAPU8.slice(s,s+c)}finally{e._vsc_buffer_delete(n)}}setupDefaults(){t.ensureNotNull("this.ctxPtr",this.ctxPtr),e._vscf_pkcs8_serializer_setup_defaults(this.ctxPtr)}serializePublicKeyInplace(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureClass("publicKey",_,r.RawPublicKey);const s=e._vscf_error_ctx_size(),n=e._malloc(s);let c;e._vscf_error_reset(n);try{c=e._vscf_pkcs8_serializer_serialize_public_key_inplace(this.ctxPtr,_.ctxPtr,n);const t=e._vscf_error_status(n);r.FoundationError.handleStatusCode(t)}finally{e._free(n)}}serializePrivateKeyInplace(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureClass("privateKey",_,r.RawPrivateKey);const s=e._vscf_error_ctx_size(),n=e._malloc(s);let c;e._vscf_error_reset(n);try{c=e._vscf_pkcs8_serializer_serialize_private_key_inplace(this.ctxPtr,_.ctxPtr,n);const t=e._vscf_error_status(n);r.FoundationError.handleStatusCode(t)}finally{e._free(n)}}}return _}}(),B_=function(){if(Fe)return Ce;Fe=1;const t=Ar();return Ce=(e,r)=>{class _{constructor(t){this.name="Sec1Serializer",this.ctxPtr=void 0===t?e._vscf_sec1_serializer_new():t}static newAndUseCContext(t){return new _(e._vscf_sec1_serializer_shallow_copy(t))}static newAndTakeCContext(t){return new _(t)}delete(){void 0!==this.ctxPtr&&null!==this.ctxPtr&&(e._vscf_sec1_serializer_delete(this.ctxPtr),this.ctxPtr=null)}set asn1Writer(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("asn1Writer",_,"Foundation.Asn1Writer",r.FoundationInterfaceTag.ASN1_WRITER,r.FoundationInterface),e._vscf_sec1_serializer_release_asn1_writer(this.ctxPtr),e._vscf_sec1_serializer_use_asn1_writer(this.ctxPtr,_.ctxPtr)}serializedPublicKeyLen(_){let s;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureClass("publicKey",_,r.RawPublicKey),s=e._vscf_sec1_serializer_serialized_public_key_len(this.ctxPtr,_.ctxPtr),s}serializePublicKey(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureClass("publicKey",_,r.RawPublicKey);const s=this.serializedPublicKeyLen(_),n=e._vsc_buffer_new_with_capacity(s);try{const t=e._vscf_sec1_serializer_serialize_public_key(this.ctxPtr,_.ctxPtr,n);r.FoundationError.handleStatusCode(t);const s=e._vsc_buffer_bytes(n),c=e._vsc_buffer_len(n);return e.HEAPU8.slice(s,s+c)}finally{e._vsc_buffer_delete(n)}}serializedPrivateKeyLen(_){let s;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureClass("privateKey",_,r.RawPrivateKey),s=e._vscf_sec1_serializer_serialized_private_key_len(this.ctxPtr,_.ctxPtr),s}serializePrivateKey(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureClass("privateKey",_,r.RawPrivateKey);const s=this.serializedPrivateKeyLen(_),n=e._vsc_buffer_new_with_capacity(s);try{const t=e._vscf_sec1_serializer_serialize_private_key(this.ctxPtr,_.ctxPtr,n);r.FoundationError.handleStatusCode(t);const s=e._vsc_buffer_bytes(n),c=e._vsc_buffer_len(n);return e.HEAPU8.slice(s,s+c)}finally{e._vsc_buffer_delete(n)}}setupDefaults(){t.ensureNotNull("this.ctxPtr",this.ctxPtr),e._vscf_sec1_serializer_setup_defaults(this.ctxPtr)}serializePublicKeyInplace(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureClass("publicKey",_,r.RawPublicKey);const s=e._vscf_error_ctx_size(),n=e._malloc(s);let c;e._vscf_error_reset(n);try{c=e._vscf_sec1_serializer_serialize_public_key_inplace(this.ctxPtr,_.ctxPtr,n);const t=e._vscf_error_status(n);r.FoundationError.handleStatusCode(t)}finally{e._free(n)}}serializePrivateKeyInplace(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureClass("privateKey",_,r.RawPrivateKey);const s=e._vscf_error_ctx_size(),n=e._malloc(s);let c;e._vscf_error_reset(n);try{c=e._vscf_sec1_serializer_serialize_private_key_inplace(this.ctxPtr,_.ctxPtr,n);const t=e._vscf_error_status(n);r.FoundationError.handleStatusCode(t)}finally{e._free(n)}}static isEcKey(_){let s;return t.ensureImplementInterface("key",_,"Foundation.Key",r.FoundationInterfaceTag.KEY,r.FoundationInterface),s=e._vscf_sec1_serializer_is_ec_key(_.ctxPtr),!!s}isEcKey(t){return _.isEcKey(t)}}return _}}(),Y_=function(){if(Ke)return Te;Ke=1;const t=Ar();return Te=(e,r)=>{class _{constructor(t){this.name="KeyAsn1Serializer",this.ctxPtr=void 0===t?e._vscf_key_asn1_serializer_new():t}static newAndUseCContext(t){return new _(e._vscf_key_asn1_serializer_shallow_copy(t))}static newAndTakeCContext(t){return new _(t)}delete(){void 0!==this.ctxPtr&&null!==this.ctxPtr&&(e._vscf_key_asn1_serializer_delete(this.ctxPtr),this.ctxPtr=null)}set asn1Writer(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("asn1Writer",_,"Foundation.Asn1Writer",r.FoundationInterfaceTag.ASN1_WRITER,r.FoundationInterface),e._vscf_key_asn1_serializer_release_asn1_writer(this.ctxPtr),e._vscf_key_asn1_serializer_use_asn1_writer(this.ctxPtr,_.ctxPtr)}serializedPublicKeyLen(_){let s;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureClass("publicKey",_,r.RawPublicKey),s=e._vscf_key_asn1_serializer_serialized_public_key_len(this.ctxPtr,_.ctxPtr),s}serializePublicKey(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureClass("publicKey",_,r.RawPublicKey);const s=this.serializedPublicKeyLen(_),n=e._vsc_buffer_new_with_capacity(s);try{const t=e._vscf_key_asn1_serializer_serialize_public_key(this.ctxPtr,_.ctxPtr,n);r.FoundationError.handleStatusCode(t);const s=e._vsc_buffer_bytes(n),c=e._vsc_buffer_len(n);return e.HEAPU8.slice(s,s+c)}finally{e._vsc_buffer_delete(n)}}serializedPrivateKeyLen(_){let s;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureClass("privateKey",_,r.RawPrivateKey),s=e._vscf_key_asn1_serializer_serialized_private_key_len(this.ctxPtr,_.ctxPtr),s}serializePrivateKey(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureClass("privateKey",_,r.RawPrivateKey);const s=this.serializedPrivateKeyLen(_),n=e._vsc_buffer_new_with_capacity(s);try{const t=e._vscf_key_asn1_serializer_serialize_private_key(this.ctxPtr,_.ctxPtr,n);r.FoundationError.handleStatusCode(t);const s=e._vsc_buffer_bytes(n),c=e._vsc_buffer_len(n);return e.HEAPU8.slice(s,s+c)}finally{e._vsc_buffer_delete(n)}}setupDefaults(){t.ensureNotNull("this.ctxPtr",this.ctxPtr),e._vscf_key_asn1_serializer_setup_defaults(this.ctxPtr)}serializePublicKeyInplace(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureClass("publicKey",_,r.RawPublicKey);const s=e._vscf_error_ctx_size(),n=e._malloc(s);let c;e._vscf_error_reset(n);try{c=e._vscf_key_asn1_serializer_serialize_public_key_inplace(this.ctxPtr,_.ctxPtr,n);const t=e._vscf_error_status(n);r.FoundationError.handleStatusCode(t)}finally{e._free(n)}}serializePrivateKeyInplace(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureClass("privateKey",_,r.RawPrivateKey);const s=e._vscf_error_ctx_size(),n=e._malloc(s);let c;e._vscf_error_reset(n);try{c=e._vscf_key_asn1_serializer_serialize_private_key_inplace(this.ctxPtr,_.ctxPtr,n);const t=e._vscf_error_status(n);r.FoundationError.handleStatusCode(t)}finally{e._free(n)}}}return _}}(),H_=function(){if(ze)return Se;ze=1;const t=Ar();return Se=(e,r)=>{class _{constructor(t){this.name="KeyAsn1Deserializer",this.ctxPtr=void 0===t?e._vscf_key_asn1_deserializer_new():t}static newAndUseCContext(t){return new _(e._vscf_key_asn1_deserializer_shallow_copy(t))}static newAndTakeCContext(t){return new _(t)}delete(){void 0!==this.ctxPtr&&null!==this.ctxPtr&&(e._vscf_key_asn1_deserializer_delete(this.ctxPtr),this.ctxPtr=null)}set asn1Reader(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("asn1Reader",_,"Foundation.Asn1Reader",r.FoundationInterfaceTag.ASN1_READER,r.FoundationInterface),e._vscf_key_asn1_deserializer_release_asn1_reader(this.ctxPtr),e._vscf_key_asn1_deserializer_use_asn1_reader(this.ctxPtr,_.ctxPtr)}deserializePublicKey(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureByteArray("publicKeyData",_);const s=_.length*_.BYTES_PER_ELEMENT,n=e._malloc(s);e.HEAP8.set(_,n);const c=e._vsc_data_ctx_size(),i=e._malloc(c);e._vsc_data(i,n,s);const a=e._vscf_error_ctx_size(),o=e._malloc(a);let l;e._vscf_error_reset(o);try{l=e._vscf_key_asn1_deserializer_deserialize_public_key(this.ctxPtr,i,o);const t=e._vscf_error_status(o);return r.FoundationError.handleStatusCode(t),r.RawPublicKey.newAndTakeCContext(l)}finally{e._free(n),e._free(i),e._free(o)}}deserializePrivateKey(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureByteArray("privateKeyData",_);const s=_.length*_.BYTES_PER_ELEMENT,n=e._malloc(s);e.HEAP8.set(_,n);const c=e._vsc_data_ctx_size(),i=e._malloc(c);e._vsc_data(i,n,s);const a=e._vscf_error_ctx_size(),o=e._malloc(a);let l;e._vscf_error_reset(o);try{l=e._vscf_key_asn1_deserializer_deserialize_private_key(this.ctxPtr,i,o);const t=e._vscf_error_status(o);return r.FoundationError.handleStatusCode(t),r.RawPrivateKey.newAndTakeCContext(l)}finally{e._free(n),e._free(i),e._free(o)}}setupDefaults(){t.ensureNotNull("this.ctxPtr",this.ctxPtr),e._vscf_key_asn1_deserializer_setup_defaults(this.ctxPtr)}deserializePublicKeyInplace(){t.ensureNotNull("this.ctxPtr",this.ctxPtr);const _=e._vscf_error_ctx_size(),s=e._malloc(_);let n;e._vscf_error_reset(s);try{n=e._vscf_key_asn1_deserializer_deserialize_public_key_inplace(this.ctxPtr,s);const t=e._vscf_error_status(s);return r.FoundationError.handleStatusCode(t),r.RawPublicKey.newAndTakeCContext(n)}finally{e._free(s)}}deserializePrivateKeyInplace(){t.ensureNotNull("this.ctxPtr",this.ctxPtr);const _=e._vscf_error_ctx_size(),s=e._malloc(_);let n;e._vscf_error_reset(s);try{n=e._vscf_key_asn1_deserializer_deserialize_private_key_inplace(this.ctxPtr,s);const t=e._vscf_error_status(s);return r.FoundationError.handleStatusCode(t),r.RawPrivateKey.newAndTakeCContext(n)}finally{e._free(s)}}deserializePkcs8PrivateKeyInplace(_,s){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureNumber("seqLeftLen",_),t.ensureNumber("version",s);const n=e._vscf_error_ctx_size(),c=e._malloc(n);let i;e._vscf_error_reset(c);try{i=e._vscf_key_asn1_deserializer_deserialize_pkcs8_private_key_inplace(this.ctxPtr,_,s,c);const t=e._vscf_error_status(c);return r.FoundationError.handleStatusCode(t),r.RawPrivateKey.newAndTakeCContext(i)}finally{e._free(c)}}deserializeSec1PrivateKeyInplace(_,s,n){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureNumber("seqLeftLen",_),t.ensureNumber("version",s),t.ensureImplementInterface("algInfo",n,"Foundation.AlgInfo",r.FoundationInterfaceTag.ALG_INFO,r.FoundationInterface);const c=e._vscf_error_ctx_size(),i=e._malloc(c);let a;e._vscf_error_reset(i);try{a=e._vscf_key_asn1_deserializer_deserialize_sec1_private_key_inplace(this.ctxPtr,_,s,n.ctxPtr,i);const t=e._vscf_error_status(i);return r.FoundationError.handleStatusCode(t),r.RawPrivateKey.newAndTakeCContext(a)}finally{e._free(i)}}}return _}}(),U_=function(){if(Re)return Le;Re=1;const t=Ar();return Le=(e,r)=>{class _{constructor(t){this.name="Ed25519",this.ctxPtr=void 0===t?e._vscf_ed25519_new():t}static newAndUseCContext(t){return new _(e._vscf_ed25519_shallow_copy(t))}static newAndTakeCContext(t){return new _(t)}delete(){void 0!==this.ctxPtr&&null!==this.ctxPtr&&(e._vscf_ed25519_delete(this.ctxPtr),this.ctxPtr=null)}set random(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("random",_,"Foundation.Random",r.FoundationInterfaceTag.RANDOM,r.FoundationInterface),e._vscf_ed25519_release_random(this.ctxPtr),e._vscf_ed25519_use_random(this.ctxPtr,_.ctxPtr)}set ecies(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureClass("ecies",_,r.Ecies),e._vscf_ed25519_release_ecies(this.ctxPtr),e._vscf_ed25519_use_ecies(this.ctxPtr,_.ctxPtr)}static get CAN_IMPORT_PUBLIC_KEY(){return!0}get CAN_IMPORT_PUBLIC_KEY(){return!0}static get CAN_EXPORT_PUBLIC_KEY(){return!0}get CAN_EXPORT_PUBLIC_KEY(){return!0}static get CAN_IMPORT_PRIVATE_KEY(){return!0}get CAN_IMPORT_PRIVATE_KEY(){return!0}static get CAN_EXPORT_PRIVATE_KEY(){return!0}get CAN_EXPORT_PRIVATE_KEY(){return!0}generateEphemeralKey(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("key",_,"Foundation.Key",r.FoundationInterfaceTag.KEY,r.FoundationInterface);const s=e._vscf_error_ctx_size(),n=e._malloc(s);let c;e._vscf_error_reset(n);try{c=e._vscf_ed25519_generate_ephemeral_key(this.ctxPtr,_.ctxPtr,n);const t=e._vscf_error_status(n);return r.FoundationError.handleStatusCode(t),r.FoundationInterface.newAndTakeCContext(c)}finally{e._free(n)}}importPublicKey(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureClass("rawKey",_,r.RawPublicKey);const s=e._vscf_error_ctx_size(),n=e._malloc(s);let c;e._vscf_error_reset(n);try{c=e._vscf_ed25519_import_public_key(this.ctxPtr,_.ctxPtr,n);const t=e._vscf_error_status(n);return r.FoundationError.handleStatusCode(t),r.FoundationInterface.newAndTakeCContext(c)}finally{e._free(n)}}exportPublicKey(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("publicKey",_,"Foundation.PublicKey",r.FoundationInterfaceTag.PUBLIC_KEY,r.FoundationInterface);const s=e._vscf_error_ctx_size(),n=e._malloc(s);let c;e._vscf_error_reset(n);try{c=e._vscf_ed25519_export_public_key(this.ctxPtr,_.ctxPtr,n);const t=e._vscf_error_status(n);return r.FoundationError.handleStatusCode(t),r.RawPublicKey.newAndTakeCContext(c)}finally{e._free(n)}}importPrivateKey(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureClass("rawKey",_,r.RawPrivateKey);const s=e._vscf_error_ctx_size(),n=e._malloc(s);let c;e._vscf_error_reset(n);try{c=e._vscf_ed25519_import_private_key(this.ctxPtr,_.ctxPtr,n);const t=e._vscf_error_status(n);return r.FoundationError.handleStatusCode(t),r.FoundationInterface.newAndTakeCContext(c)}finally{e._free(n)}}exportPrivateKey(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("privateKey",_,"Foundation.PrivateKey",r.FoundationInterfaceTag.PRIVATE_KEY,r.FoundationInterface);const s=e._vscf_error_ctx_size(),n=e._malloc(s);let c;e._vscf_error_reset(n);try{c=e._vscf_ed25519_export_private_key(this.ctxPtr,_.ctxPtr,n);const t=e._vscf_error_status(n);return r.FoundationError.handleStatusCode(t),r.RawPrivateKey.newAndTakeCContext(c)}finally{e._free(n)}}canEncrypt(_,s){let n;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("publicKey",_,"Foundation.PublicKey",r.FoundationInterfaceTag.PUBLIC_KEY,r.FoundationInterface),t.ensureNumber("dataLen",s),n=e._vscf_ed25519_can_encrypt(this.ctxPtr,_.ctxPtr,s),!!n}encryptedLen(_,s){let n;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("publicKey",_,"Foundation.PublicKey",r.FoundationInterfaceTag.PUBLIC_KEY,r.FoundationInterface),t.ensureNumber("dataLen",s),n=e._vscf_ed25519_encrypted_len(this.ctxPtr,_.ctxPtr,s),n}encrypt(_,s){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("publicKey",_,"Foundation.PublicKey",r.FoundationInterfaceTag.PUBLIC_KEY,r.FoundationInterface),t.ensureByteArray("data",s);const n=s.length*s.BYTES_PER_ELEMENT,c=e._malloc(n);e.HEAP8.set(s,c);const i=e._vsc_data_ctx_size(),a=e._malloc(i);e._vsc_data(a,c,n);const o=this.encryptedLen(_,s.length),l=e._vsc_buffer_new_with_capacity(o);try{const t=e._vscf_ed25519_encrypt(this.ctxPtr,_.ctxPtr,a,l);r.FoundationError.handleStatusCode(t);const s=e._vsc_buffer_bytes(l),n=e._vsc_buffer_len(l);return e.HEAPU8.slice(s,s+n)}finally{e._free(c),e._free(a),e._vsc_buffer_delete(l)}}canDecrypt(_,s){let n;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("privateKey",_,"Foundation.PrivateKey",r.FoundationInterfaceTag.PRIVATE_KEY,r.FoundationInterface),t.ensureNumber("dataLen",s),n=e._vscf_ed25519_can_decrypt(this.ctxPtr,_.ctxPtr,s),!!n}decryptedLen(_,s){let n;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("privateKey",_,"Foundation.PrivateKey",r.FoundationInterfaceTag.PRIVATE_KEY,r.FoundationInterface),t.ensureNumber("dataLen",s),n=e._vscf_ed25519_decrypted_len(this.ctxPtr,_.ctxPtr,s),n}decrypt(_,s){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("privateKey",_,"Foundation.PrivateKey",r.FoundationInterfaceTag.PRIVATE_KEY,r.FoundationInterface),t.ensureByteArray("data",s);const n=s.length*s.BYTES_PER_ELEMENT,c=e._malloc(n);e.HEAP8.set(s,c);const i=e._vsc_data_ctx_size(),a=e._malloc(i);e._vsc_data(a,c,n);const o=this.decryptedLen(_,s.length),l=e._vsc_buffer_new_with_capacity(o);try{const t=e._vscf_ed25519_decrypt(this.ctxPtr,_.ctxPtr,a,l);r.FoundationError.handleStatusCode(t);const s=e._vsc_buffer_bytes(l),n=e._vsc_buffer_len(l);return e.HEAPU8.slice(s,s+n)}finally{e._free(c),e._free(a),e._vsc_buffer_delete(l)}}canSign(_){let s;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("privateKey",_,"Foundation.PrivateKey",r.FoundationInterfaceTag.PRIVATE_KEY,r.FoundationInterface),s=e._vscf_ed25519_can_sign(this.ctxPtr,_.ctxPtr),!!s}signatureLen(_){let s;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("privateKey",_,"Foundation.PrivateKey",r.FoundationInterfaceTag.PRIVATE_KEY,r.FoundationInterface),s=e._vscf_ed25519_signature_len(this.ctxPtr,_.ctxPtr),s}signHash(_,s,n){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("privateKey",_,"Foundation.PrivateKey",r.FoundationInterfaceTag.PRIVATE_KEY,r.FoundationInterface),t.ensureByteArray("digest",n);const c=n.length*n.BYTES_PER_ELEMENT,i=e._malloc(c);e.HEAP8.set(n,i);const a=e._vsc_data_ctx_size(),o=e._malloc(a);e._vsc_data(o,i,c);const l=this.signatureLen(_),u=e._vsc_buffer_new_with_capacity(l);try{const t=e._vscf_ed25519_sign_hash(this.ctxPtr,_.ctxPtr,s,o,u);r.FoundationError.handleStatusCode(t);const n=e._vsc_buffer_bytes(u),c=e._vsc_buffer_len(u);return e.HEAPU8.slice(n,n+c)}finally{e._free(i),e._free(o),e._vsc_buffer_delete(u)}}canVerify(_){let s;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("publicKey",_,"Foundation.PublicKey",r.FoundationInterfaceTag.PUBLIC_KEY,r.FoundationInterface),s=e._vscf_ed25519_can_verify(this.ctxPtr,_.ctxPtr),!!s}verifyHash(_,s,n,c){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("publicKey",_,"Foundation.PublicKey",r.FoundationInterfaceTag.PUBLIC_KEY,r.FoundationInterface),t.ensureByteArray("digest",n),t.ensureByteArray("signature",c);const i=n.length*n.BYTES_PER_ELEMENT,a=e._malloc(i);e.HEAP8.set(n,a);const o=e._vsc_data_ctx_size(),l=e._malloc(o);e._vsc_data(l,a,i);const u=c.length*c.BYTES_PER_ELEMENT,f=e._malloc(u);e.HEAP8.set(c,f);const d=e._vsc_data_ctx_size(),h=e._malloc(d);e._vsc_data(h,f,u);try{return!!e._vscf_ed25519_verify_hash(this.ctxPtr,_.ctxPtr,s,l,h)}finally{e._free(a),e._free(l),e._free(f),e._free(h)}}computeSharedKey(_,s){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("publicKey",_,"Foundation.PublicKey",r.FoundationInterfaceTag.PUBLIC_KEY,r.FoundationInterface),t.ensureImplementInterface("privateKey",s,"Foundation.PrivateKey",r.FoundationInterfaceTag.PRIVATE_KEY,r.FoundationInterface);const n=this.sharedKeyLen(s),c=e._vsc_buffer_new_with_capacity(n);try{const t=e._vscf_ed25519_compute_shared_key(this.ctxPtr,_.ctxPtr,s.ctxPtr,c);r.FoundationError.handleStatusCode(t);const n=e._vsc_buffer_bytes(c),i=e._vsc_buffer_len(c);return e.HEAPU8.slice(n,n+i)}finally{e._vsc_buffer_delete(c)}}sharedKeyLen(_){let s;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("key",_,"Foundation.Key",r.FoundationInterfaceTag.KEY,r.FoundationInterface),s=e._vscf_ed25519_shared_key_len(this.ctxPtr,_.ctxPtr),s}kemSharedKeyLen(_){let s;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("key",_,"Foundation.Key",r.FoundationInterfaceTag.KEY,r.FoundationInterface),s=e._vscf_ed25519_kem_shared_key_len(this.ctxPtr,_.ctxPtr),s}kemEncapsulatedKeyLen(_){let s;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("publicKey",_,"Foundation.PublicKey",r.FoundationInterfaceTag.PUBLIC_KEY,r.FoundationInterface),s=e._vscf_ed25519_kem_encapsulated_key_len(this.ctxPtr,_.ctxPtr),s}kemEncapsulate(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("publicKey",_,"Foundation.PublicKey",r.FoundationInterfaceTag.PUBLIC_KEY,r.FoundationInterface);const s=this.kemSharedKeyLen(_),n=e._vsc_buffer_new_with_capacity(s),c=this.kemEncapsulatedKeyLen(_),i=e._vsc_buffer_new_with_capacity(c);try{const t=e._vscf_ed25519_kem_encapsulate(this.ctxPtr,_.ctxPtr,n,i);r.FoundationError.handleStatusCode(t);const s=e._vsc_buffer_bytes(n),c=e._vsc_buffer_len(n),a=e.HEAPU8.slice(s,s+c),o=e._vsc_buffer_bytes(i),l=e._vsc_buffer_len(i);return{sharedKey:a,encapsulatedKey:e.HEAPU8.slice(o,o+l)}}finally{e._vsc_buffer_delete(n),e._vsc_buffer_delete(i)}}kemDecapsulate(_,s){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureByteArray("encapsulatedKey",_),t.ensureImplementInterface("privateKey",s,"Foundation.PrivateKey",r.FoundationInterfaceTag.PRIVATE_KEY,r.FoundationInterface);const n=_.length*_.BYTES_PER_ELEMENT,c=e._malloc(n);e.HEAP8.set(_,c);const i=e._vsc_data_ctx_size(),a=e._malloc(i);e._vsc_data(a,c,n);const o=this.kemSharedKeyLen(s),l=e._vsc_buffer_new_with_capacity(o);try{const t=e._vscf_ed25519_kem_decapsulate(this.ctxPtr,a,s.ctxPtr,l);r.FoundationError.handleStatusCode(t);const _=e._vsc_buffer_bytes(l),n=e._vsc_buffer_len(l);return e.HEAPU8.slice(_,_+n)}finally{e._free(c),e._free(a),e._vsc_buffer_delete(l)}}setupDefaults(){t.ensureNotNull("this.ctxPtr",this.ctxPtr);const _=e._vscf_ed25519_setup_defaults(this.ctxPtr);r.FoundationError.handleStatusCode(_)}generateKey(){t.ensureNotNull("this.ctxPtr",this.ctxPtr);const _=e._vscf_error_ctx_size(),s=e._malloc(_);let n;e._vscf_error_reset(s);try{n=e._vscf_ed25519_generate_key(this.ctxPtr,s);const t=e._vscf_error_status(s);return r.FoundationError.handleStatusCode(t),r.FoundationInterface.newAndTakeCContext(n)}finally{e._free(s)}}}return _}}(),M_=function(){if(Ye)return Be;Ye=1;const t=Ar();return Be=(e,r)=>{class _{constructor(t){this.name="Curve25519",this.ctxPtr=void 0===t?e._vscf_curve25519_new():t}static newAndUseCContext(t){return new _(e._vscf_curve25519_shallow_copy(t))}static newAndTakeCContext(t){return new _(t)}delete(){void 0!==this.ctxPtr&&null!==this.ctxPtr&&(e._vscf_curve25519_delete(this.ctxPtr),this.ctxPtr=null)}set random(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("random",_,"Foundation.Random",r.FoundationInterfaceTag.RANDOM,r.FoundationInterface),e._vscf_curve25519_release_random(this.ctxPtr),e._vscf_curve25519_use_random(this.ctxPtr,_.ctxPtr)}set ecies(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureClass("ecies",_,r.Ecies),e._vscf_curve25519_release_ecies(this.ctxPtr),e._vscf_curve25519_use_ecies(this.ctxPtr,_.ctxPtr)}static get CAN_IMPORT_PUBLIC_KEY(){return!0}get CAN_IMPORT_PUBLIC_KEY(){return!0}static get CAN_EXPORT_PUBLIC_KEY(){return!0}get CAN_EXPORT_PUBLIC_KEY(){return!0}static get CAN_IMPORT_PRIVATE_KEY(){return!0}get CAN_IMPORT_PRIVATE_KEY(){return!0}static get CAN_EXPORT_PRIVATE_KEY(){return!0}get CAN_EXPORT_PRIVATE_KEY(){return!0}generateEphemeralKey(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("key",_,"Foundation.Key",r.FoundationInterfaceTag.KEY,r.FoundationInterface);const s=e._vscf_error_ctx_size(),n=e._malloc(s);let c;e._vscf_error_reset(n);try{c=e._vscf_curve25519_generate_ephemeral_key(this.ctxPtr,_.ctxPtr,n);const t=e._vscf_error_status(n);return r.FoundationError.handleStatusCode(t),r.FoundationInterface.newAndTakeCContext(c)}finally{e._free(n)}}importPublicKey(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureClass("rawKey",_,r.RawPublicKey);const s=e._vscf_error_ctx_size(),n=e._malloc(s);let c;e._vscf_error_reset(n);try{c=e._vscf_curve25519_import_public_key(this.ctxPtr,_.ctxPtr,n);const t=e._vscf_error_status(n);return r.FoundationError.handleStatusCode(t),r.FoundationInterface.newAndTakeCContext(c)}finally{e._free(n)}}exportPublicKey(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("publicKey",_,"Foundation.PublicKey",r.FoundationInterfaceTag.PUBLIC_KEY,r.FoundationInterface);const s=e._vscf_error_ctx_size(),n=e._malloc(s);let c;e._vscf_error_reset(n);try{c=e._vscf_curve25519_export_public_key(this.ctxPtr,_.ctxPtr,n);const t=e._vscf_error_status(n);return r.FoundationError.handleStatusCode(t),r.RawPublicKey.newAndTakeCContext(c)}finally{e._free(n)}}importPrivateKey(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureClass("rawKey",_,r.RawPrivateKey);const s=e._vscf_error_ctx_size(),n=e._malloc(s);let c;e._vscf_error_reset(n);try{c=e._vscf_curve25519_import_private_key(this.ctxPtr,_.ctxPtr,n);const t=e._vscf_error_status(n);return r.FoundationError.handleStatusCode(t),r.FoundationInterface.newAndTakeCContext(c)}finally{e._free(n)}}exportPrivateKey(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("privateKey",_,"Foundation.PrivateKey",r.FoundationInterfaceTag.PRIVATE_KEY,r.FoundationInterface);const s=e._vscf_error_ctx_size(),n=e._malloc(s);let c;e._vscf_error_reset(n);try{c=e._vscf_curve25519_export_private_key(this.ctxPtr,_.ctxPtr,n);const t=e._vscf_error_status(n);return r.FoundationError.handleStatusCode(t),r.RawPrivateKey.newAndTakeCContext(c)}finally{e._free(n)}}canEncrypt(_,s){let n;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("publicKey",_,"Foundation.PublicKey",r.FoundationInterfaceTag.PUBLIC_KEY,r.FoundationInterface),t.ensureNumber("dataLen",s),n=e._vscf_curve25519_can_encrypt(this.ctxPtr,_.ctxPtr,s),!!n}encryptedLen(_,s){let n;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("publicKey",_,"Foundation.PublicKey",r.FoundationInterfaceTag.PUBLIC_KEY,r.FoundationInterface),t.ensureNumber("dataLen",s),n=e._vscf_curve25519_encrypted_len(this.ctxPtr,_.ctxPtr,s),n}encrypt(_,s){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("publicKey",_,"Foundation.PublicKey",r.FoundationInterfaceTag.PUBLIC_KEY,r.FoundationInterface),t.ensureByteArray("data",s);const n=s.length*s.BYTES_PER_ELEMENT,c=e._malloc(n);e.HEAP8.set(s,c);const i=e._vsc_data_ctx_size(),a=e._malloc(i);e._vsc_data(a,c,n);const o=this.encryptedLen(_,s.length),l=e._vsc_buffer_new_with_capacity(o);try{const t=e._vscf_curve25519_encrypt(this.ctxPtr,_.ctxPtr,a,l);r.FoundationError.handleStatusCode(t);const s=e._vsc_buffer_bytes(l),n=e._vsc_buffer_len(l);return e.HEAPU8.slice(s,s+n)}finally{e._free(c),e._free(a),e._vsc_buffer_delete(l)}}canDecrypt(_,s){let n;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("privateKey",_,"Foundation.PrivateKey",r.FoundationInterfaceTag.PRIVATE_KEY,r.FoundationInterface),t.ensureNumber("dataLen",s),n=e._vscf_curve25519_can_decrypt(this.ctxPtr,_.ctxPtr,s),!!n}decryptedLen(_,s){let n;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("privateKey",_,"Foundation.PrivateKey",r.FoundationInterfaceTag.PRIVATE_KEY,r.FoundationInterface),t.ensureNumber("dataLen",s),n=e._vscf_curve25519_decrypted_len(this.ctxPtr,_.ctxPtr,s),n}decrypt(_,s){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("privateKey",_,"Foundation.PrivateKey",r.FoundationInterfaceTag.PRIVATE_KEY,r.FoundationInterface),t.ensureByteArray("data",s);const n=s.length*s.BYTES_PER_ELEMENT,c=e._malloc(n);e.HEAP8.set(s,c);const i=e._vsc_data_ctx_size(),a=e._malloc(i);e._vsc_data(a,c,n);const o=this.decryptedLen(_,s.length),l=e._vsc_buffer_new_with_capacity(o);try{const t=e._vscf_curve25519_decrypt(this.ctxPtr,_.ctxPtr,a,l);r.FoundationError.handleStatusCode(t);const s=e._vsc_buffer_bytes(l),n=e._vsc_buffer_len(l);return e.HEAPU8.slice(s,s+n)}finally{e._free(c),e._free(a),e._vsc_buffer_delete(l)}}computeSharedKey(_,s){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("publicKey",_,"Foundation.PublicKey",r.FoundationInterfaceTag.PUBLIC_KEY,r.FoundationInterface),t.ensureImplementInterface("privateKey",s,"Foundation.PrivateKey",r.FoundationInterfaceTag.PRIVATE_KEY,r.FoundationInterface);const n=this.sharedKeyLen(s),c=e._vsc_buffer_new_with_capacity(n);try{const t=e._vscf_curve25519_compute_shared_key(this.ctxPtr,_.ctxPtr,s.ctxPtr,c);r.FoundationError.handleStatusCode(t);const n=e._vsc_buffer_bytes(c),i=e._vsc_buffer_len(c);return e.HEAPU8.slice(n,n+i)}finally{e._vsc_buffer_delete(c)}}sharedKeyLen(_){let s;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("key",_,"Foundation.Key",r.FoundationInterfaceTag.KEY,r.FoundationInterface),s=e._vscf_curve25519_shared_key_len(this.ctxPtr,_.ctxPtr),s}kemSharedKeyLen(_){let s;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("key",_,"Foundation.Key",r.FoundationInterfaceTag.KEY,r.FoundationInterface),s=e._vscf_curve25519_kem_shared_key_len(this.ctxPtr,_.ctxPtr),s}kemEncapsulatedKeyLen(_){let s;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("publicKey",_,"Foundation.PublicKey",r.FoundationInterfaceTag.PUBLIC_KEY,r.FoundationInterface),s=e._vscf_curve25519_kem_encapsulated_key_len(this.ctxPtr,_.ctxPtr),s}kemEncapsulate(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("publicKey",_,"Foundation.PublicKey",r.FoundationInterfaceTag.PUBLIC_KEY,r.FoundationInterface);const s=this.kemSharedKeyLen(_),n=e._vsc_buffer_new_with_capacity(s),c=this.kemEncapsulatedKeyLen(_),i=e._vsc_buffer_new_with_capacity(c);try{const t=e._vscf_curve25519_kem_encapsulate(this.ctxPtr,_.ctxPtr,n,i);r.FoundationError.handleStatusCode(t);const s=e._vsc_buffer_bytes(n),c=e._vsc_buffer_len(n),a=e.HEAPU8.slice(s,s+c),o=e._vsc_buffer_bytes(i),l=e._vsc_buffer_len(i);return{sharedKey:a,encapsulatedKey:e.HEAPU8.slice(o,o+l)}}finally{e._vsc_buffer_delete(n),e._vsc_buffer_delete(i)}}kemDecapsulate(_,s){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureByteArray("encapsulatedKey",_),t.ensureImplementInterface("privateKey",s,"Foundation.PrivateKey",r.FoundationInterfaceTag.PRIVATE_KEY,r.FoundationInterface);const n=_.length*_.BYTES_PER_ELEMENT,c=e._malloc(n);e.HEAP8.set(_,c);const i=e._vsc_data_ctx_size(),a=e._malloc(i);e._vsc_data(a,c,n);const o=this.kemSharedKeyLen(s),l=e._vsc_buffer_new_with_capacity(o);try{const t=e._vscf_curve25519_kem_decapsulate(this.ctxPtr,a,s.ctxPtr,l);r.FoundationError.handleStatusCode(t);const _=e._vsc_buffer_bytes(l),n=e._vsc_buffer_len(l);return e.HEAPU8.slice(_,_+n)}finally{e._free(c),e._free(a),e._vsc_buffer_delete(l)}}setupDefaults(){t.ensureNotNull("this.ctxPtr",this.ctxPtr);const _=e._vscf_curve25519_setup_defaults(this.ctxPtr);r.FoundationError.handleStatusCode(_)}generateKey(){t.ensureNotNull("this.ctxPtr",this.ctxPtr);const _=e._vscf_error_ctx_size(),s=e._malloc(_);let n;e._vscf_error_reset(s);try{n=e._vscf_curve25519_generate_key(this.ctxPtr,s);const t=e._vscf_error_status(s);return r.FoundationError.handleStatusCode(t),r.FoundationInterface.newAndTakeCContext(n)}finally{e._free(s)}}}return _}}(),D_=function(){if(Ue)return He;Ue=1;const t=Ar();return He=(e,r)=>{class _{constructor(t){this.name="Falcon",this.ctxPtr=void 0===t?e._vscf_falcon_new():t}static newAndUseCContext(t){return new _(e._vscf_falcon_shallow_copy(t))}static newAndTakeCContext(t){return new _(t)}delete(){void 0!==this.ctxPtr&&null!==this.ctxPtr&&(e._vscf_falcon_delete(this.ctxPtr),this.ctxPtr=null)}set random(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("random",_,"Foundation.Random",r.FoundationInterfaceTag.RANDOM,r.FoundationInterface),e._vscf_falcon_release_random(this.ctxPtr),e._vscf_falcon_use_random(this.ctxPtr,_.ctxPtr)}static get SEED_LEN(){return 48}get SEED_LEN(){return 48}static get LOGN_512(){return 9}get LOGN_512(){return 9}static get LOGN_1024(){return 10}get LOGN_1024(){return 10}static get CAN_IMPORT_PUBLIC_KEY(){return!0}get CAN_IMPORT_PUBLIC_KEY(){return!0}static get CAN_EXPORT_PUBLIC_KEY(){return!0}get CAN_EXPORT_PUBLIC_KEY(){return!0}static get CAN_IMPORT_PRIVATE_KEY(){return!0}get CAN_IMPORT_PRIVATE_KEY(){return!0}static get CAN_EXPORT_PRIVATE_KEY(){return!0}get CAN_EXPORT_PRIVATE_KEY(){return!0}algId(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_falcon_alg_id(this.ctxPtr),r}produceAlgInfo(){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),_=e._vscf_falcon_produce_alg_info(this.ctxPtr),r.FoundationInterface.newAndTakeCContext(_)}restoreAlgInfo(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("algInfo",_,"Foundation.AlgInfo",r.FoundationInterfaceTag.ALG_INFO,r.FoundationInterface);const s=e._vscf_falcon_restore_alg_info(this.ctxPtr,_.ctxPtr);r.FoundationError.handleStatusCode(s)}generateEphemeralKey(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("key",_,"Foundation.Key",r.FoundationInterfaceTag.KEY,r.FoundationInterface);const s=e._vscf_error_ctx_size(),n=e._malloc(s);let c;e._vscf_error_reset(n);try{c=e._vscf_falcon_generate_ephemeral_key(this.ctxPtr,_.ctxPtr,n);const t=e._vscf_error_status(n);return r.FoundationError.handleStatusCode(t),r.FoundationInterface.newAndTakeCContext(c)}finally{e._free(n)}}importPublicKey(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureClass("rawKey",_,r.RawPublicKey);const s=e._vscf_error_ctx_size(),n=e._malloc(s);let c;e._vscf_error_reset(n);try{c=e._vscf_falcon_import_public_key(this.ctxPtr,_.ctxPtr,n);const t=e._vscf_error_status(n);return r.FoundationError.handleStatusCode(t),r.FoundationInterface.newAndTakeCContext(c)}finally{e._free(n)}}exportPublicKey(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("publicKey",_,"Foundation.PublicKey",r.FoundationInterfaceTag.PUBLIC_KEY,r.FoundationInterface);const s=e._vscf_error_ctx_size(),n=e._malloc(s);let c;e._vscf_error_reset(n);try{c=e._vscf_falcon_export_public_key(this.ctxPtr,_.ctxPtr,n);const t=e._vscf_error_status(n);return r.FoundationError.handleStatusCode(t),r.RawPublicKey.newAndTakeCContext(c)}finally{e._free(n)}}importPrivateKey(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureClass("rawKey",_,r.RawPrivateKey);const s=e._vscf_error_ctx_size(),n=e._malloc(s);let c;e._vscf_error_reset(n);try{c=e._vscf_falcon_import_private_key(this.ctxPtr,_.ctxPtr,n);const t=e._vscf_error_status(n);return r.FoundationError.handleStatusCode(t),r.FoundationInterface.newAndTakeCContext(c)}finally{e._free(n)}}exportPrivateKey(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("privateKey",_,"Foundation.PrivateKey",r.FoundationInterfaceTag.PRIVATE_KEY,r.FoundationInterface);const s=e._vscf_error_ctx_size(),n=e._malloc(s);let c;e._vscf_error_reset(n);try{c=e._vscf_falcon_export_private_key(this.ctxPtr,_.ctxPtr,n);const t=e._vscf_error_status(n);return r.FoundationError.handleStatusCode(t),r.RawPrivateKey.newAndTakeCContext(c)}finally{e._free(n)}}canSign(_){let s;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("privateKey",_,"Foundation.PrivateKey",r.FoundationInterfaceTag.PRIVATE_KEY,r.FoundationInterface),s=e._vscf_falcon_can_sign(this.ctxPtr,_.ctxPtr),!!s}signatureLen(_){let s;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("privateKey",_,"Foundation.PrivateKey",r.FoundationInterfaceTag.PRIVATE_KEY,r.FoundationInterface),s=e._vscf_falcon_signature_len(this.ctxPtr,_.ctxPtr),s}signHash(_,s,n){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("privateKey",_,"Foundation.PrivateKey",r.FoundationInterfaceTag.PRIVATE_KEY,r.FoundationInterface),t.ensureByteArray("digest",n);const c=n.length*n.BYTES_PER_ELEMENT,i=e._malloc(c);e.HEAP8.set(n,i);const a=e._vsc_data_ctx_size(),o=e._malloc(a);e._vsc_data(o,i,c);const l=this.signatureLen(_),u=e._vsc_buffer_new_with_capacity(l);try{const t=e._vscf_falcon_sign_hash(this.ctxPtr,_.ctxPtr,s,o,u);r.FoundationError.handleStatusCode(t);const n=e._vsc_buffer_bytes(u),c=e._vsc_buffer_len(u);return e.HEAPU8.slice(n,n+c)}finally{e._free(i),e._free(o),e._vsc_buffer_delete(u)}}canVerify(_){let s;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("publicKey",_,"Foundation.PublicKey",r.FoundationInterfaceTag.PUBLIC_KEY,r.FoundationInterface),s=e._vscf_falcon_can_verify(this.ctxPtr,_.ctxPtr),!!s}verifyHash(_,s,n,c){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("publicKey",_,"Foundation.PublicKey",r.FoundationInterfaceTag.PUBLIC_KEY,r.FoundationInterface),t.ensureByteArray("digest",n),t.ensureByteArray("signature",c);const i=n.length*n.BYTES_PER_ELEMENT,a=e._malloc(i);e.HEAP8.set(n,a);const o=e._vsc_data_ctx_size(),l=e._malloc(o);e._vsc_data(l,a,i);const u=c.length*c.BYTES_PER_ELEMENT,f=e._malloc(u);e.HEAP8.set(c,f);const d=e._vsc_data_ctx_size(),h=e._malloc(d);e._vsc_data(h,f,u);try{return!!e._vscf_falcon_verify_hash(this.ctxPtr,_.ctxPtr,s,l,h)}finally{e._free(a),e._free(l),e._free(f),e._free(h)}}setupDefaults(){t.ensureNotNull("this.ctxPtr",this.ctxPtr);const _=e._vscf_falcon_setup_defaults(this.ctxPtr);r.FoundationError.handleStatusCode(_)}generateKey(){t.ensureNotNull("this.ctxPtr",this.ctxPtr);const _=e._vscf_error_ctx_size(),s=e._malloc(_);let n;e._vscf_error_reset(s);try{n=e._vscf_falcon_generate_key(this.ctxPtr,s);const t=e._vscf_error_status(s);return r.FoundationError.handleStatusCode(t),r.FoundationInterface.newAndTakeCContext(n)}finally{e._free(s)}}}return _}}(),O_=function(){if(De)return Me;De=1;const t=Ar();return Me=(e,r)=>{class _{constructor(t){this.name="Round5",this.ctxPtr=void 0===t?e._vscf_round5_new():t}static newAndUseCContext(t){return new _(e._vscf_round5_shallow_copy(t))}static newAndTakeCContext(t){return new _(t)}delete(){void 0!==this.ctxPtr&&null!==this.ctxPtr&&(e._vscf_round5_delete(this.ctxPtr),this.ctxPtr=null)}set random(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("random",_,"Foundation.Random",r.FoundationInterfaceTag.RANDOM,r.FoundationInterface),e._vscf_round5_release_random(this.ctxPtr),e._vscf_round5_use_random(this.ctxPtr,_.ctxPtr)}static get SEED_LEN(){return 48}get SEED_LEN(){return 48}static get CAN_IMPORT_PUBLIC_KEY(){return!0}get CAN_IMPORT_PUBLIC_KEY(){return!0}static get CAN_EXPORT_PUBLIC_KEY(){return!0}get CAN_EXPORT_PUBLIC_KEY(){return!0}static get CAN_IMPORT_PRIVATE_KEY(){return!0}get CAN_IMPORT_PRIVATE_KEY(){return!0}static get CAN_EXPORT_PRIVATE_KEY(){return!0}get CAN_EXPORT_PRIVATE_KEY(){return!0}generateEphemeralKey(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("key",_,"Foundation.Key",r.FoundationInterfaceTag.KEY,r.FoundationInterface);const s=e._vscf_error_ctx_size(),n=e._malloc(s);let c;e._vscf_error_reset(n);try{c=e._vscf_round5_generate_ephemeral_key(this.ctxPtr,_.ctxPtr,n);const t=e._vscf_error_status(n);return r.FoundationError.handleStatusCode(t),r.FoundationInterface.newAndTakeCContext(c)}finally{e._free(n)}}importPublicKey(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureClass("rawKey",_,r.RawPublicKey);const s=e._vscf_error_ctx_size(),n=e._malloc(s);let c;e._vscf_error_reset(n);try{c=e._vscf_round5_import_public_key(this.ctxPtr,_.ctxPtr,n);const t=e._vscf_error_status(n);return r.FoundationError.handleStatusCode(t),r.FoundationInterface.newAndTakeCContext(c)}finally{e._free(n)}}exportPublicKey(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("publicKey",_,"Foundation.PublicKey",r.FoundationInterfaceTag.PUBLIC_KEY,r.FoundationInterface);const s=e._vscf_error_ctx_size(),n=e._malloc(s);let c;e._vscf_error_reset(n);try{c=e._vscf_round5_export_public_key(this.ctxPtr,_.ctxPtr,n);const t=e._vscf_error_status(n);return r.FoundationError.handleStatusCode(t),r.RawPublicKey.newAndTakeCContext(c)}finally{e._free(n)}}importPrivateKey(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureClass("rawKey",_,r.RawPrivateKey);const s=e._vscf_error_ctx_size(),n=e._malloc(s);let c;e._vscf_error_reset(n);try{c=e._vscf_round5_import_private_key(this.ctxPtr,_.ctxPtr,n);const t=e._vscf_error_status(n);return r.FoundationError.handleStatusCode(t),r.FoundationInterface.newAndTakeCContext(c)}finally{e._free(n)}}exportPrivateKey(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("privateKey",_,"Foundation.PrivateKey",r.FoundationInterfaceTag.PRIVATE_KEY,r.FoundationInterface);const s=e._vscf_error_ctx_size(),n=e._malloc(s);let c;e._vscf_error_reset(n);try{c=e._vscf_round5_export_private_key(this.ctxPtr,_.ctxPtr,n);const t=e._vscf_error_status(n);return r.FoundationError.handleStatusCode(t),r.RawPrivateKey.newAndTakeCContext(c)}finally{e._free(n)}}kemSharedKeyLen(_){let s;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("key",_,"Foundation.Key",r.FoundationInterfaceTag.KEY,r.FoundationInterface),s=e._vscf_round5_kem_shared_key_len(this.ctxPtr,_.ctxPtr),s}kemEncapsulatedKeyLen(_){let s;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("publicKey",_,"Foundation.PublicKey",r.FoundationInterfaceTag.PUBLIC_KEY,r.FoundationInterface),s=e._vscf_round5_kem_encapsulated_key_len(this.ctxPtr,_.ctxPtr),s}kemEncapsulate(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("publicKey",_,"Foundation.PublicKey",r.FoundationInterfaceTag.PUBLIC_KEY,r.FoundationInterface);const s=this.kemSharedKeyLen(_),n=e._vsc_buffer_new_with_capacity(s),c=this.kemEncapsulatedKeyLen(_),i=e._vsc_buffer_new_with_capacity(c);try{const t=e._vscf_round5_kem_encapsulate(this.ctxPtr,_.ctxPtr,n,i);r.FoundationError.handleStatusCode(t);const s=e._vsc_buffer_bytes(n),c=e._vsc_buffer_len(n),a=e.HEAPU8.slice(s,s+c),o=e._vsc_buffer_bytes(i),l=e._vsc_buffer_len(i);return{sharedKey:a,encapsulatedKey:e.HEAPU8.slice(o,o+l)}}finally{e._vsc_buffer_delete(n),e._vsc_buffer_delete(i)}}kemDecapsulate(_,s){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureByteArray("encapsulatedKey",_),t.ensureImplementInterface("privateKey",s,"Foundation.PrivateKey",r.FoundationInterfaceTag.PRIVATE_KEY,r.FoundationInterface);const n=_.length*_.BYTES_PER_ELEMENT,c=e._malloc(n);e.HEAP8.set(_,c);const i=e._vsc_data_ctx_size(),a=e._malloc(i);e._vsc_data(a,c,n);const o=this.kemSharedKeyLen(s),l=e._vsc_buffer_new_with_capacity(o);try{const t=e._vscf_round5_kem_decapsulate(this.ctxPtr,a,s.ctxPtr,l);r.FoundationError.handleStatusCode(t);const _=e._vsc_buffer_bytes(l),n=e._vsc_buffer_len(l);return e.HEAPU8.slice(_,_+n)}finally{e._free(c),e._free(a),e._vsc_buffer_delete(l)}}setupDefaults(){t.ensureNotNull("this.ctxPtr",this.ctxPtr);const _=e._vscf_round5_setup_defaults(this.ctxPtr);r.FoundationError.handleStatusCode(_)}generateKey(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr);const s=e._vscf_error_ctx_size(),n=e._malloc(s);let c;e._vscf_error_reset(n);try{c=e._vscf_round5_generate_key(this.ctxPtr,_,n);const t=e._vscf_error_status(n);return r.FoundationError.handleStatusCode(t),r.FoundationInterface.newAndTakeCContext(c)}finally{e._free(n)}}}return _}}(),G_=function(){if(Ge)return Oe;Ge=1;const t=Ar();return Oe=(e,r)=>{class _{constructor(t){this.name="CompoundKeyAlgInfo",this.ctxPtr=void 0===t?e._vscf_compound_key_alg_info_new():t}static newAndUseCContext(t){return new _(e._vscf_compound_key_alg_info_shallow_copy(t))}static newAndTakeCContext(t){return new _(t)}delete(){void 0!==this.ctxPtr&&null!==this.ctxPtr&&(e._vscf_compound_key_alg_info_delete(this.ctxPtr),this.ctxPtr=null)}algId(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_compound_key_alg_info_alg_id(this.ctxPtr),r}cipherAlgInfo(){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),_=e._vscf_compound_key_alg_info_cipher_alg_info(this.ctxPtr),r.FoundationInterface.newAndUseCContext(_)}signerAlgInfo(){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),_=e._vscf_compound_key_alg_info_signer_alg_info(this.ctxPtr),r.FoundationInterface.newAndUseCContext(_)}}return _}}(),V_=function(){if(qe)return Ve;qe=1;const t=Ar();return Ve=(e,r)=>{class _{constructor(t){this.name="CompoundPublicKey",this.ctxPtr=void 0===t?e._vscf_compound_public_key_new():t}static newAndUseCContext(t){return new _(e._vscf_compound_public_key_shallow_copy(t))}static newAndTakeCContext(t){return new _(t)}delete(){void 0!==this.ctxPtr&&null!==this.ctxPtr&&(e._vscf_compound_public_key_delete(this.ctxPtr),this.ctxPtr=null)}algId(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_compound_public_key_alg_id(this.ctxPtr),r}algInfo(){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),_=e._vscf_compound_public_key_alg_info(this.ctxPtr),r.FoundationInterface.newAndUseCContext(_)}len(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_compound_public_key_len(this.ctxPtr),r}bitlen(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_compound_public_key_bitlen(this.ctxPtr),r}isValid(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_compound_public_key_is_valid(this.ctxPtr),!!r}cipherKey(){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),_=e._vscf_compound_public_key_cipher_key(this.ctxPtr),r.FoundationInterface.newAndUseCContext(_)}signerKey(){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),_=e._vscf_compound_public_key_signer_key(this.ctxPtr),r.FoundationInterface.newAndUseCContext(_)}}return _}}(),q_=function(){if(Xe)return je;Xe=1;const t=Ar();return je=(e,r)=>{class _{constructor(t){this.name="CompoundPrivateKey",this.ctxPtr=void 0===t?e._vscf_compound_private_key_new():t}static newAndUseCContext(t){return new _(e._vscf_compound_private_key_shallow_copy(t))}static newAndTakeCContext(t){return new _(t)}delete(){void 0!==this.ctxPtr&&null!==this.ctxPtr&&(e._vscf_compound_private_key_delete(this.ctxPtr),this.ctxPtr=null)}algId(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_compound_private_key_alg_id(this.ctxPtr),r}algInfo(){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),_=e._vscf_compound_private_key_alg_info(this.ctxPtr),r.FoundationInterface.newAndUseCContext(_)}len(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_compound_private_key_len(this.ctxPtr),r}bitlen(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_compound_private_key_bitlen(this.ctxPtr),r}isValid(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_compound_private_key_is_valid(this.ctxPtr),!!r}extractPublicKey(){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),_=e._vscf_compound_private_key_extract_public_key(this.ctxPtr),r.FoundationInterface.newAndTakeCContext(_)}cipherKey(){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),_=e._vscf_compound_private_key_cipher_key(this.ctxPtr),r.FoundationInterface.newAndUseCContext(_)}signerKey(){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),_=e._vscf_compound_private_key_signer_key(this.ctxPtr),r.FoundationInterface.newAndUseCContext(_)}}return _}}(),j_=function(){if(Ze)return We;Ze=1;const t=Ar();return We=(e,r)=>{class _{constructor(t){this.name="CompoundKeyAlg",this.ctxPtr=void 0===t?e._vscf_compound_key_alg_new():t}static newAndUseCContext(t){return new _(e._vscf_compound_key_alg_shallow_copy(t))}static newAndTakeCContext(t){return new _(t)}delete(){void 0!==this.ctxPtr&&null!==this.ctxPtr&&(e._vscf_compound_key_alg_delete(this.ctxPtr),this.ctxPtr=null)}set random(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("random",_,"Foundation.Random",r.FoundationInterfaceTag.RANDOM,r.FoundationInterface),e._vscf_compound_key_alg_release_random(this.ctxPtr),e._vscf_compound_key_alg_use_random(this.ctxPtr,_.ctxPtr)}static get CAN_IMPORT_PUBLIC_KEY(){return!0}get CAN_IMPORT_PUBLIC_KEY(){return!0}static get CAN_EXPORT_PUBLIC_KEY(){return!0}get CAN_EXPORT_PUBLIC_KEY(){return!0}static get CAN_IMPORT_PRIVATE_KEY(){return!0}get CAN_IMPORT_PRIVATE_KEY(){return!0}static get CAN_EXPORT_PRIVATE_KEY(){return!0}get CAN_EXPORT_PRIVATE_KEY(){return!0}algId(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_compound_key_alg_alg_id(this.ctxPtr),r}produceAlgInfo(){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),_=e._vscf_compound_key_alg_produce_alg_info(this.ctxPtr),r.FoundationInterface.newAndTakeCContext(_)}restoreAlgInfo(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("algInfo",_,"Foundation.AlgInfo",r.FoundationInterfaceTag.ALG_INFO,r.FoundationInterface);const s=e._vscf_compound_key_alg_restore_alg_info(this.ctxPtr,_.ctxPtr);r.FoundationError.handleStatusCode(s)}generateEphemeralKey(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("key",_,"Foundation.Key",r.FoundationInterfaceTag.KEY,r.FoundationInterface);const s=e._vscf_error_ctx_size(),n=e._malloc(s);let c;e._vscf_error_reset(n);try{c=e._vscf_compound_key_alg_generate_ephemeral_key(this.ctxPtr,_.ctxPtr,n);const t=e._vscf_error_status(n);return r.FoundationError.handleStatusCode(t),r.FoundationInterface.newAndTakeCContext(c)}finally{e._free(n)}}importPublicKey(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureClass("rawKey",_,r.RawPublicKey);const s=e._vscf_error_ctx_size(),n=e._malloc(s);let c;e._vscf_error_reset(n);try{c=e._vscf_compound_key_alg_import_public_key(this.ctxPtr,_.ctxPtr,n);const t=e._vscf_error_status(n);return r.FoundationError.handleStatusCode(t),r.FoundationInterface.newAndTakeCContext(c)}finally{e._free(n)}}exportPublicKey(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("publicKey",_,"Foundation.PublicKey",r.FoundationInterfaceTag.PUBLIC_KEY,r.FoundationInterface);const s=e._vscf_error_ctx_size(),n=e._malloc(s);let c;e._vscf_error_reset(n);try{c=e._vscf_compound_key_alg_export_public_key(this.ctxPtr,_.ctxPtr,n);const t=e._vscf_error_status(n);return r.FoundationError.handleStatusCode(t),r.RawPublicKey.newAndTakeCContext(c)}finally{e._free(n)}}importPrivateKey(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureClass("rawKey",_,r.RawPrivateKey);const s=e._vscf_error_ctx_size(),n=e._malloc(s);let c;e._vscf_error_reset(n);try{c=e._vscf_compound_key_alg_import_private_key(this.ctxPtr,_.ctxPtr,n);const t=e._vscf_error_status(n);return r.FoundationError.handleStatusCode(t),r.FoundationInterface.newAndTakeCContext(c)}finally{e._free(n)}}exportPrivateKey(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("privateKey",_,"Foundation.PrivateKey",r.FoundationInterfaceTag.PRIVATE_KEY,r.FoundationInterface);const s=e._vscf_error_ctx_size(),n=e._malloc(s);let c;e._vscf_error_reset(n);try{c=e._vscf_compound_key_alg_export_private_key(this.ctxPtr,_.ctxPtr,n);const t=e._vscf_error_status(n);return r.FoundationError.handleStatusCode(t),r.RawPrivateKey.newAndTakeCContext(c)}finally{e._free(n)}}canEncrypt(_,s){let n;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("publicKey",_,"Foundation.PublicKey",r.FoundationInterfaceTag.PUBLIC_KEY,r.FoundationInterface),t.ensureNumber("dataLen",s),n=e._vscf_compound_key_alg_can_encrypt(this.ctxPtr,_.ctxPtr,s),!!n}encryptedLen(_,s){let n;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("publicKey",_,"Foundation.PublicKey",r.FoundationInterfaceTag.PUBLIC_KEY,r.FoundationInterface),t.ensureNumber("dataLen",s),n=e._vscf_compound_key_alg_encrypted_len(this.ctxPtr,_.ctxPtr,s),n}encrypt(_,s){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("publicKey",_,"Foundation.PublicKey",r.FoundationInterfaceTag.PUBLIC_KEY,r.FoundationInterface),t.ensureByteArray("data",s);const n=s.length*s.BYTES_PER_ELEMENT,c=e._malloc(n);e.HEAP8.set(s,c);const i=e._vsc_data_ctx_size(),a=e._malloc(i);e._vsc_data(a,c,n);const o=this.encryptedLen(_,s.length),l=e._vsc_buffer_new_with_capacity(o);try{const t=e._vscf_compound_key_alg_encrypt(this.ctxPtr,_.ctxPtr,a,l);r.FoundationError.handleStatusCode(t);const s=e._vsc_buffer_bytes(l),n=e._vsc_buffer_len(l);return e.HEAPU8.slice(s,s+n)}finally{e._free(c),e._free(a),e._vsc_buffer_delete(l)}}canDecrypt(_,s){let n;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("privateKey",_,"Foundation.PrivateKey",r.FoundationInterfaceTag.PRIVATE_KEY,r.FoundationInterface),t.ensureNumber("dataLen",s),n=e._vscf_compound_key_alg_can_decrypt(this.ctxPtr,_.ctxPtr,s),!!n}decryptedLen(_,s){let n;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("privateKey",_,"Foundation.PrivateKey",r.FoundationInterfaceTag.PRIVATE_KEY,r.FoundationInterface),t.ensureNumber("dataLen",s),n=e._vscf_compound_key_alg_decrypted_len(this.ctxPtr,_.ctxPtr,s),n}decrypt(_,s){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("privateKey",_,"Foundation.PrivateKey",r.FoundationInterfaceTag.PRIVATE_KEY,r.FoundationInterface),t.ensureByteArray("data",s);const n=s.length*s.BYTES_PER_ELEMENT,c=e._malloc(n);e.HEAP8.set(s,c);const i=e._vsc_data_ctx_size(),a=e._malloc(i);e._vsc_data(a,c,n);const o=this.decryptedLen(_,s.length),l=e._vsc_buffer_new_with_capacity(o);try{const t=e._vscf_compound_key_alg_decrypt(this.ctxPtr,_.ctxPtr,a,l);r.FoundationError.handleStatusCode(t);const s=e._vsc_buffer_bytes(l),n=e._vsc_buffer_len(l);return e.HEAPU8.slice(s,s+n)}finally{e._free(c),e._free(a),e._vsc_buffer_delete(l)}}canSign(_){let s;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("privateKey",_,"Foundation.PrivateKey",r.FoundationInterfaceTag.PRIVATE_KEY,r.FoundationInterface),s=e._vscf_compound_key_alg_can_sign(this.ctxPtr,_.ctxPtr),!!s}signatureLen(_){let s;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("privateKey",_,"Foundation.PrivateKey",r.FoundationInterfaceTag.PRIVATE_KEY,r.FoundationInterface),s=e._vscf_compound_key_alg_signature_len(this.ctxPtr,_.ctxPtr),s}signHash(_,s,n){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("privateKey",_,"Foundation.PrivateKey",r.FoundationInterfaceTag.PRIVATE_KEY,r.FoundationInterface),t.ensureByteArray("digest",n);const c=n.length*n.BYTES_PER_ELEMENT,i=e._malloc(c);e.HEAP8.set(n,i);const a=e._vsc_data_ctx_size(),o=e._malloc(a);e._vsc_data(o,i,c);const l=this.signatureLen(_),u=e._vsc_buffer_new_with_capacity(l);try{const t=e._vscf_compound_key_alg_sign_hash(this.ctxPtr,_.ctxPtr,s,o,u);r.FoundationError.handleStatusCode(t);const n=e._vsc_buffer_bytes(u),c=e._vsc_buffer_len(u);return e.HEAPU8.slice(n,n+c)}finally{e._free(i),e._free(o),e._vsc_buffer_delete(u)}}canVerify(_){let s;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("publicKey",_,"Foundation.PublicKey",r.FoundationInterfaceTag.PUBLIC_KEY,r.FoundationInterface),s=e._vscf_compound_key_alg_can_verify(this.ctxPtr,_.ctxPtr),!!s}verifyHash(_,s,n,c){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("publicKey",_,"Foundation.PublicKey",r.FoundationInterfaceTag.PUBLIC_KEY,r.FoundationInterface),t.ensureByteArray("digest",n),t.ensureByteArray("signature",c);const i=n.length*n.BYTES_PER_ELEMENT,a=e._malloc(i);e.HEAP8.set(n,a);const o=e._vsc_data_ctx_size(),l=e._malloc(o);e._vsc_data(l,a,i);const u=c.length*c.BYTES_PER_ELEMENT,f=e._malloc(u);e.HEAP8.set(c,f);const d=e._vsc_data_ctx_size(),h=e._malloc(d);e._vsc_data(h,f,u);try{return!!e._vscf_compound_key_alg_verify_hash(this.ctxPtr,_.ctxPtr,s,l,h)}finally{e._free(a),e._free(l),e._free(f),e._free(h)}}setupDefaults(){t.ensureNotNull("this.ctxPtr",this.ctxPtr);const _=e._vscf_compound_key_alg_setup_defaults(this.ctxPtr);r.FoundationError.handleStatusCode(_)}makeKey(_,s){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("cipherKey",_,"Foundation.PrivateKey",r.FoundationInterfaceTag.PRIVATE_KEY,r.FoundationInterface),t.ensureImplementInterface("signerKey",s,"Foundation.PrivateKey",r.FoundationInterfaceTag.PRIVATE_KEY,r.FoundationInterface);const n=e._vscf_error_ctx_size(),c=e._malloc(n);let i;e._vscf_error_reset(c);try{i=e._vscf_compound_key_alg_make_key(this.ctxPtr,_.ctxPtr,s.ctxPtr,c);const t=e._vscf_error_status(c);return r.FoundationError.handleStatusCode(t),r.FoundationInterface.newAndTakeCContext(i)}finally{e._free(c)}}}return _}}(),X_=function(){if(Qe)return $e;Qe=1;const t=Ar();return $e=(e,r)=>{class _{constructor(t){this.name="HybridKeyAlgInfo",this.ctxPtr=void 0===t?e._vscf_hybrid_key_alg_info_new():t}static newAndUseCContext(t){return new _(e._vscf_hybrid_key_alg_info_shallow_copy(t))}static newAndTakeCContext(t){return new _(t)}delete(){void 0!==this.ctxPtr&&null!==this.ctxPtr&&(e._vscf_hybrid_key_alg_info_delete(this.ctxPtr),this.ctxPtr=null)}algId(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_hybrid_key_alg_info_alg_id(this.ctxPtr),r}firstKeyAlgInfo(){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),_=e._vscf_hybrid_key_alg_info_first_key_alg_info(this.ctxPtr),r.FoundationInterface.newAndUseCContext(_)}secondKeyAlgInfo(){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),_=e._vscf_hybrid_key_alg_info_second_key_alg_info(this.ctxPtr),r.FoundationInterface.newAndUseCContext(_)}}return _}}(),W_=function(){if(tr)return Je;tr=1;const t=Ar();return Je=(e,r)=>{class _{constructor(t){this.name="HybridPublicKey",this.ctxPtr=void 0===t?e._vscf_hybrid_public_key_new():t}static newAndUseCContext(t){return new _(e._vscf_hybrid_public_key_shallow_copy(t))}static newAndTakeCContext(t){return new _(t)}delete(){void 0!==this.ctxPtr&&null!==this.ctxPtr&&(e._vscf_hybrid_public_key_delete(this.ctxPtr),this.ctxPtr=null)}algId(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_hybrid_public_key_alg_id(this.ctxPtr),r}algInfo(){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),_=e._vscf_hybrid_public_key_alg_info(this.ctxPtr),r.FoundationInterface.newAndUseCContext(_)}len(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_hybrid_public_key_len(this.ctxPtr),r}bitlen(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_hybrid_public_key_bitlen(this.ctxPtr),r}isValid(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_hybrid_public_key_is_valid(this.ctxPtr),!!r}firstKey(){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),_=e._vscf_hybrid_public_key_first_key(this.ctxPtr),r.FoundationInterface.newAndUseCContext(_)}secondKey(){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),_=e._vscf_hybrid_public_key_second_key(this.ctxPtr),r.FoundationInterface.newAndUseCContext(_)}}return _}}(),Z_=function(){if(rr)return er;rr=1;const t=Ar();return er=(e,r)=>{class _{constructor(t){this.name="HybridPrivateKey",this.ctxPtr=void 0===t?e._vscf_hybrid_private_key_new():t}static newAndUseCContext(t){return new _(e._vscf_hybrid_private_key_shallow_copy(t))}static newAndTakeCContext(t){return new _(t)}delete(){void 0!==this.ctxPtr&&null!==this.ctxPtr&&(e._vscf_hybrid_private_key_delete(this.ctxPtr),this.ctxPtr=null)}algId(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_hybrid_private_key_alg_id(this.ctxPtr),r}algInfo(){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),_=e._vscf_hybrid_private_key_alg_info(this.ctxPtr),r.FoundationInterface.newAndUseCContext(_)}len(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_hybrid_private_key_len(this.ctxPtr),r}bitlen(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_hybrid_private_key_bitlen(this.ctxPtr),r}isValid(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_hybrid_private_key_is_valid(this.ctxPtr),!!r}extractPublicKey(){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),_=e._vscf_hybrid_private_key_extract_public_key(this.ctxPtr),r.FoundationInterface.newAndTakeCContext(_)}firstKey(){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),_=e._vscf_hybrid_private_key_first_key(this.ctxPtr),r.FoundationInterface.newAndUseCContext(_)}secondKey(){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),_=e._vscf_hybrid_private_key_second_key(this.ctxPtr),r.FoundationInterface.newAndUseCContext(_)}}return _}}(),$_=function(){if(sr)return _r;sr=1;const t=Ar();return _r=(e,r)=>{class _{constructor(t){this.name="HybridKeyAlg",this.ctxPtr=void 0===t?e._vscf_hybrid_key_alg_new():t}static newAndUseCContext(t){return new _(e._vscf_hybrid_key_alg_shallow_copy(t))}static newAndTakeCContext(t){return new _(t)}delete(){void 0!==this.ctxPtr&&null!==this.ctxPtr&&(e._vscf_hybrid_key_alg_delete(this.ctxPtr),this.ctxPtr=null)}set random(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("random",_,"Foundation.Random",r.FoundationInterfaceTag.RANDOM,r.FoundationInterface),e._vscf_hybrid_key_alg_release_random(this.ctxPtr),e._vscf_hybrid_key_alg_use_random(this.ctxPtr,_.ctxPtr)}set cipher(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("cipher",_,"Foundation.CipherAuth",r.FoundationInterfaceTag.CIPHER_AUTH,r.FoundationInterface),e._vscf_hybrid_key_alg_release_cipher(this.ctxPtr),e._vscf_hybrid_key_alg_use_cipher(this.ctxPtr,_.ctxPtr)}set hash(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("hash",_,"Foundation.Hash",r.FoundationInterfaceTag.HASH,r.FoundationInterface),e._vscf_hybrid_key_alg_release_hash(this.ctxPtr),e._vscf_hybrid_key_alg_use_hash(this.ctxPtr,_.ctxPtr)}static get CAN_IMPORT_PUBLIC_KEY(){return!0}get CAN_IMPORT_PUBLIC_KEY(){return!0}static get CAN_EXPORT_PUBLIC_KEY(){return!0}get CAN_EXPORT_PUBLIC_KEY(){return!0}static get CAN_IMPORT_PRIVATE_KEY(){return!0}get CAN_IMPORT_PRIVATE_KEY(){return!0}static get CAN_EXPORT_PRIVATE_KEY(){return!0}get CAN_EXPORT_PRIVATE_KEY(){return!0}generateEphemeralKey(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("key",_,"Foundation.Key",r.FoundationInterfaceTag.KEY,r.FoundationInterface);const s=e._vscf_error_ctx_size(),n=e._malloc(s);let c;e._vscf_error_reset(n);try{c=e._vscf_hybrid_key_alg_generate_ephemeral_key(this.ctxPtr,_.ctxPtr,n);const t=e._vscf_error_status(n);return r.FoundationError.handleStatusCode(t),r.FoundationInterface.newAndTakeCContext(c)}finally{e._free(n)}}importPublicKey(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureClass("rawKey",_,r.RawPublicKey);const s=e._vscf_error_ctx_size(),n=e._malloc(s);let c;e._vscf_error_reset(n);try{c=e._vscf_hybrid_key_alg_import_public_key(this.ctxPtr,_.ctxPtr,n);const t=e._vscf_error_status(n);return r.FoundationError.handleStatusCode(t),r.FoundationInterface.newAndTakeCContext(c)}finally{e._free(n)}}exportPublicKey(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("publicKey",_,"Foundation.PublicKey",r.FoundationInterfaceTag.PUBLIC_KEY,r.FoundationInterface);const s=e._vscf_error_ctx_size(),n=e._malloc(s);let c;e._vscf_error_reset(n);try{c=e._vscf_hybrid_key_alg_export_public_key(this.ctxPtr,_.ctxPtr,n);const t=e._vscf_error_status(n);return r.FoundationError.handleStatusCode(t),r.RawPublicKey.newAndTakeCContext(c)}finally{e._free(n)}}importPrivateKey(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureClass("rawKey",_,r.RawPrivateKey);const s=e._vscf_error_ctx_size(),n=e._malloc(s);let c;e._vscf_error_reset(n);try{c=e._vscf_hybrid_key_alg_import_private_key(this.ctxPtr,_.ctxPtr,n);const t=e._vscf_error_status(n);return r.FoundationError.handleStatusCode(t),r.FoundationInterface.newAndTakeCContext(c)}finally{e._free(n)}}exportPrivateKey(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("privateKey",_,"Foundation.PrivateKey",r.FoundationInterfaceTag.PRIVATE_KEY,r.FoundationInterface);const s=e._vscf_error_ctx_size(),n=e._malloc(s);let c;e._vscf_error_reset(n);try{c=e._vscf_hybrid_key_alg_export_private_key(this.ctxPtr,_.ctxPtr,n);const t=e._vscf_error_status(n);return r.FoundationError.handleStatusCode(t),r.RawPrivateKey.newAndTakeCContext(c)}finally{e._free(n)}}canEncrypt(_,s){let n;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("publicKey",_,"Foundation.PublicKey",r.FoundationInterfaceTag.PUBLIC_KEY,r.FoundationInterface),t.ensureNumber("dataLen",s),n=e._vscf_hybrid_key_alg_can_encrypt(this.ctxPtr,_.ctxPtr,s),!!n}encryptedLen(_,s){let n;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("publicKey",_,"Foundation.PublicKey",r.FoundationInterfaceTag.PUBLIC_KEY,r.FoundationInterface),t.ensureNumber("dataLen",s),n=e._vscf_hybrid_key_alg_encrypted_len(this.ctxPtr,_.ctxPtr,s),n}encrypt(_,s){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("publicKey",_,"Foundation.PublicKey",r.FoundationInterfaceTag.PUBLIC_KEY,r.FoundationInterface),t.ensureByteArray("data",s);const n=s.length*s.BYTES_PER_ELEMENT,c=e._malloc(n);e.HEAP8.set(s,c);const i=e._vsc_data_ctx_size(),a=e._malloc(i);e._vsc_data(a,c,n);const o=this.encryptedLen(_,s.length),l=e._vsc_buffer_new_with_capacity(o);try{const t=e._vscf_hybrid_key_alg_encrypt(this.ctxPtr,_.ctxPtr,a,l);r.FoundationError.handleStatusCode(t);const s=e._vsc_buffer_bytes(l),n=e._vsc_buffer_len(l);return e.HEAPU8.slice(s,s+n)}finally{e._free(c),e._free(a),e._vsc_buffer_delete(l)}}canDecrypt(_,s){let n;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("privateKey",_,"Foundation.PrivateKey",r.FoundationInterfaceTag.PRIVATE_KEY,r.FoundationInterface),t.ensureNumber("dataLen",s),n=e._vscf_hybrid_key_alg_can_decrypt(this.ctxPtr,_.ctxPtr,s),!!n}decryptedLen(_,s){let n;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("privateKey",_,"Foundation.PrivateKey",r.FoundationInterfaceTag.PRIVATE_KEY,r.FoundationInterface),t.ensureNumber("dataLen",s),n=e._vscf_hybrid_key_alg_decrypted_len(this.ctxPtr,_.ctxPtr,s),n}decrypt(_,s){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("privateKey",_,"Foundation.PrivateKey",r.FoundationInterfaceTag.PRIVATE_KEY,r.FoundationInterface),t.ensureByteArray("data",s);const n=s.length*s.BYTES_PER_ELEMENT,c=e._malloc(n);e.HEAP8.set(s,c);const i=e._vsc_data_ctx_size(),a=e._malloc(i);e._vsc_data(a,c,n);const o=this.decryptedLen(_,s.length),l=e._vsc_buffer_new_with_capacity(o);try{const t=e._vscf_hybrid_key_alg_decrypt(this.ctxPtr,_.ctxPtr,a,l);r.FoundationError.handleStatusCode(t);const s=e._vsc_buffer_bytes(l),n=e._vsc_buffer_len(l);return e.HEAPU8.slice(s,s+n)}finally{e._free(c),e._free(a),e._vsc_buffer_delete(l)}}canSign(_){let s;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("privateKey",_,"Foundation.PrivateKey",r.FoundationInterfaceTag.PRIVATE_KEY,r.FoundationInterface),s=e._vscf_hybrid_key_alg_can_sign(this.ctxPtr,_.ctxPtr),!!s}signatureLen(_){let s;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("privateKey",_,"Foundation.PrivateKey",r.FoundationInterfaceTag.PRIVATE_KEY,r.FoundationInterface),s=e._vscf_hybrid_key_alg_signature_len(this.ctxPtr,_.ctxPtr),s}signHash(_,s,n){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("privateKey",_,"Foundation.PrivateKey",r.FoundationInterfaceTag.PRIVATE_KEY,r.FoundationInterface),t.ensureByteArray("digest",n);const c=n.length*n.BYTES_PER_ELEMENT,i=e._malloc(c);e.HEAP8.set(n,i);const a=e._vsc_data_ctx_size(),o=e._malloc(a);e._vsc_data(o,i,c);const l=this.signatureLen(_),u=e._vsc_buffer_new_with_capacity(l);try{const t=e._vscf_hybrid_key_alg_sign_hash(this.ctxPtr,_.ctxPtr,s,o,u);r.FoundationError.handleStatusCode(t);const n=e._vsc_buffer_bytes(u),c=e._vsc_buffer_len(u);return e.HEAPU8.slice(n,n+c)}finally{e._free(i),e._free(o),e._vsc_buffer_delete(u)}}canVerify(_){let s;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("publicKey",_,"Foundation.PublicKey",r.FoundationInterfaceTag.PUBLIC_KEY,r.FoundationInterface),s=e._vscf_hybrid_key_alg_can_verify(this.ctxPtr,_.ctxPtr),!!s}verifyHash(_,s,n,c){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("publicKey",_,"Foundation.PublicKey",r.FoundationInterfaceTag.PUBLIC_KEY,r.FoundationInterface),t.ensureByteArray("digest",n),t.ensureByteArray("signature",c);const i=n.length*n.BYTES_PER_ELEMENT,a=e._malloc(i);e.HEAP8.set(n,a);const o=e._vsc_data_ctx_size(),l=e._malloc(o);e._vsc_data(l,a,i);const u=c.length*c.BYTES_PER_ELEMENT,f=e._malloc(u);e.HEAP8.set(c,f);const d=e._vsc_data_ctx_size(),h=e._malloc(d);e._vsc_data(h,f,u);try{return!!e._vscf_hybrid_key_alg_verify_hash(this.ctxPtr,_.ctxPtr,s,l,h)}finally{e._free(a),e._free(l),e._free(f),e._free(h)}}setupDefaults(){t.ensureNotNull("this.ctxPtr",this.ctxPtr);const _=e._vscf_hybrid_key_alg_setup_defaults(this.ctxPtr);r.FoundationError.handleStatusCode(_)}makeKey(_,s){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("firstKey",_,"Foundation.PrivateKey",r.FoundationInterfaceTag.PRIVATE_KEY,r.FoundationInterface),t.ensureImplementInterface("secondKey",s,"Foundation.PrivateKey",r.FoundationInterfaceTag.PRIVATE_KEY,r.FoundationInterface);const n=e._vscf_error_ctx_size(),c=e._malloc(n);let i;e._vscf_error_reset(c);try{i=e._vscf_hybrid_key_alg_make_key(this.ctxPtr,_.ctxPtr,s.ctxPtr,c);const t=e._vscf_error_status(c);return r.FoundationError.handleStatusCode(t),r.FoundationInterface.newAndTakeCContext(i)}finally{e._free(c)}}static configCipher(_,s,n){t.ensureImplementInterface("cipher",_,"Foundation.Cipher",r.FoundationInterfaceTag.CIPHER,r.FoundationInterface),t.ensureImplementInterface("hash",s,"Foundation.Hash",r.FoundationInterfaceTag.HASH,r.FoundationInterface),t.ensureByteArray("sharedKey",n);const c=n.length*n.BYTES_PER_ELEMENT,i=e._malloc(c);e.HEAP8.set(n,i);const a=e._vsc_data_ctx_size(),o=e._malloc(a);e._vsc_data(o,i,c);try{e._vscf_hybrid_key_alg_config_cipher(_.ctxPtr,s.ctxPtr,o)}finally{e._free(i),e._free(o)}}configCipher(t,e,r){return _.configCipher(t,e,r)}}return _}}(),Q_=function(){if(cr)return nr;cr=1;const t=Ar();return nr=(e,r)=>{class _{constructor(t){this.name="SimpleAlgInfo",this.ctxPtr=void 0===t?e._vscf_simple_alg_info_new():t}static newAndUseCContext(t){return new _(e._vscf_simple_alg_info_shallow_copy(t))}static newAndTakeCContext(t){return new _(t)}delete(){void 0!==this.ctxPtr&&null!==this.ctxPtr&&(e._vscf_simple_alg_info_delete(this.ctxPtr),this.ctxPtr=null)}algId(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_simple_alg_info_alg_id(this.ctxPtr),r}}return _}}(),J_=function(){if(ar)return ir;ar=1;const t=Ar();return ir=(e,r)=>{class _{constructor(t){this.name="HashBasedAlgInfo",this.ctxPtr=void 0===t?e._vscf_hash_based_alg_info_new():t}static newAndUseCContext(t){return new _(e._vscf_hash_based_alg_info_shallow_copy(t))}static newAndTakeCContext(t){return new _(t)}delete(){void 0!==this.ctxPtr&&null!==this.ctxPtr&&(e._vscf_hash_based_alg_info_delete(this.ctxPtr),this.ctxPtr=null)}algId(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_hash_based_alg_info_alg_id(this.ctxPtr),r}hashAlgInfo(){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),_=e._vscf_hash_based_alg_info_hash_alg_info(this.ctxPtr),r.FoundationInterface.newAndUseCContext(_)}}return _}}(),ts=function(){if(lr)return or;lr=1;const t=Ar();return or=(e,r)=>{class _{constructor(t){this.name="CipherAlgInfo",this.ctxPtr=void 0===t?e._vscf_cipher_alg_info_new():t}static newAndUseCContext(t){return new _(e._vscf_cipher_alg_info_shallow_copy(t))}static newAndTakeCContext(t){return new _(t)}delete(){void 0!==this.ctxPtr&&null!==this.ctxPtr&&(e._vscf_cipher_alg_info_delete(this.ctxPtr),this.ctxPtr=null)}algId(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_cipher_alg_info_alg_id(this.ctxPtr),r}nonce(){t.ensureNotNull("this.ctxPtr",this.ctxPtr),e._vscf_cipher_alg_info_nonce(this.ctxPtr)}}return _}}(),es=function(){if(fr)return ur;fr=1;const t=Ar();return ur=(e,r)=>{class _{constructor(t){this.name="SaltedKdfAlgInfo",this.ctxPtr=void 0===t?e._vscf_salted_kdf_alg_info_new():t}static newAndUseCContext(t){return new _(e._vscf_salted_kdf_alg_info_shallow_copy(t))}static newAndTakeCContext(t){return new _(t)}delete(){void 0!==this.ctxPtr&&null!==this.ctxPtr&&(e._vscf_salted_kdf_alg_info_delete(this.ctxPtr),this.ctxPtr=null)}algId(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_salted_kdf_alg_info_alg_id(this.ctxPtr),r}hashAlgInfo(){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),_=e._vscf_salted_kdf_alg_info_hash_alg_info(this.ctxPtr),r.FoundationInterface.newAndUseCContext(_)}salt(){t.ensureNotNull("this.ctxPtr",this.ctxPtr),e._vscf_salted_kdf_alg_info_salt(this.ctxPtr)}iterationCount(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_salted_kdf_alg_info_iteration_count(this.ctxPtr),r}}return _}}(),rs=function(){if(hr)return dr;hr=1;const t=Ar();return dr=(e,r)=>{class _{constructor(t){this.name="PbeAlgInfo",this.ctxPtr=void 0===t?e._vscf_pbe_alg_info_new():t}static newAndUseCContext(t){return new _(e._vscf_pbe_alg_info_shallow_copy(t))}static newAndTakeCContext(t){return new _(t)}delete(){void 0!==this.ctxPtr&&null!==this.ctxPtr&&(e._vscf_pbe_alg_info_delete(this.ctxPtr),this.ctxPtr=null)}algId(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_pbe_alg_info_alg_id(this.ctxPtr),r}kdfAlgInfo(){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),_=e._vscf_pbe_alg_info_kdf_alg_info(this.ctxPtr),r.FoundationInterface.newAndUseCContext(_)}cipherAlgInfo(){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),_=e._vscf_pbe_alg_info_cipher_alg_info(this.ctxPtr),r.FoundationInterface.newAndUseCContext(_)}}return _}}(),_s=function(){if(vr)return Pr;vr=1;const t=Ar();return Pr=(e,r)=>{class _{constructor(t){this.name="EccAlgInfo",this.ctxPtr=void 0===t?e._vscf_ecc_alg_info_new():t}static newAndUseCContext(t){return new _(e._vscf_ecc_alg_info_shallow_copy(t))}static newAndTakeCContext(t){return new _(t)}delete(){void 0!==this.ctxPtr&&null!==this.ctxPtr&&(e._vscf_ecc_alg_info_delete(this.ctxPtr),this.ctxPtr=null)}algId(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_ecc_alg_info_alg_id(this.ctxPtr),r}keyId(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_ecc_alg_info_key_id(this.ctxPtr),r}domainId(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_ecc_alg_info_domain_id(this.ctxPtr),r}}return _}}(),ss=function(){if(yr)return xr;yr=1;const t=Ar();return xr=(e,r)=>{class _{constructor(t){this.name="AlgInfoDerSerializer",this.ctxPtr=void 0===t?e._vscf_alg_info_der_serializer_new():t}static newAndUseCContext(t){return new _(e._vscf_alg_info_der_serializer_shallow_copy(t))}static newAndTakeCContext(t){return new _(t)}delete(){void 0!==this.ctxPtr&&null!==this.ctxPtr&&(e._vscf_alg_info_der_serializer_delete(this.ctxPtr),this.ctxPtr=null)}set asn1Writer(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("asn1Writer",_,"Foundation.Asn1Writer",r.FoundationInterfaceTag.ASN1_WRITER,r.FoundationInterface),e._vscf_alg_info_der_serializer_release_asn1_writer(this.ctxPtr),e._vscf_alg_info_der_serializer_use_asn1_writer(this.ctxPtr,_.ctxPtr)}serializedLen(_){let s;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("algInfo",_,"Foundation.AlgInfo",r.FoundationInterfaceTag.ALG_INFO,r.FoundationInterface),s=e._vscf_alg_info_der_serializer_serialized_len(this.ctxPtr,_.ctxPtr),s}serialize(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("algInfo",_,"Foundation.AlgInfo",r.FoundationInterfaceTag.ALG_INFO,r.FoundationInterface);const s=this.serializedLen(_),n=e._vsc_buffer_new_with_capacity(s);try{e._vscf_alg_info_der_serializer_serialize(this.ctxPtr,_.ctxPtr,n);const t=e._vsc_buffer_bytes(n),r=e._vsc_buffer_len(n);return e.HEAPU8.slice(t,t+r)}finally{e._vsc_buffer_delete(n)}}setupDefaults(){t.ensureNotNull("this.ctxPtr",this.ctxPtr),e._vscf_alg_info_der_serializer_setup_defaults(this.ctxPtr)}static isAlgRequireNullParams(t){let r;return r=e._vscf_alg_info_der_serializer_is_alg_require_null_params(t),!!r}isAlgRequireNullParams(t){return _.isAlgRequireNullParams(t)}serializedSimpleAlgInfoLen(_){let s;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("algInfo",_,"Foundation.AlgInfo",r.FoundationInterfaceTag.ALG_INFO,r.FoundationInterface),s=e._vscf_alg_info_der_serializer_serialized_simple_alg_info_len(this.ctxPtr,_.ctxPtr),s}serializeSimpleAlgInfo(_){let s;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("algInfo",_,"Foundation.AlgInfo",r.FoundationInterfaceTag.ALG_INFO,r.FoundationInterface),s=e._vscf_alg_info_der_serializer_serialize_simple_alg_info(this.ctxPtr,_.ctxPtr),s}serializedKdfAlgInfoLen(_){let s;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("algInfo",_,"Foundation.AlgInfo",r.FoundationInterfaceTag.ALG_INFO,r.FoundationInterface),s=e._vscf_alg_info_der_serializer_serialized_kdf_alg_info_len(this.ctxPtr,_.ctxPtr),s}serializeKdfAlgInfo(_){let s;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("algInfo",_,"Foundation.AlgInfo",r.FoundationInterfaceTag.ALG_INFO,r.FoundationInterface),s=e._vscf_alg_info_der_serializer_serialize_kdf_alg_info(this.ctxPtr,_.ctxPtr),s}serializedHkdfAlgInfoLen(_){let s;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("algInfo",_,"Foundation.AlgInfo",r.FoundationInterfaceTag.ALG_INFO,r.FoundationInterface),s=e._vscf_alg_info_der_serializer_serialized_hkdf_alg_info_len(this.ctxPtr,_.ctxPtr),s}serializeHkdfAlgInfo(_){let s;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("algInfo",_,"Foundation.AlgInfo",r.FoundationInterfaceTag.ALG_INFO,r.FoundationInterface),s=e._vscf_alg_info_der_serializer_serialize_hkdf_alg_info(this.ctxPtr,_.ctxPtr),s}serializedHmacAlgInfoLen(_){let s;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("algInfo",_,"Foundation.AlgInfo",r.FoundationInterfaceTag.ALG_INFO,r.FoundationInterface),s=e._vscf_alg_info_der_serializer_serialized_hmac_alg_info_len(this.ctxPtr,_.ctxPtr),s}serializeHmacAlgInfo(_){let s;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("algInfo",_,"Foundation.AlgInfo",r.FoundationInterfaceTag.ALG_INFO,r.FoundationInterface),s=e._vscf_alg_info_der_serializer_serialize_hmac_alg_info(this.ctxPtr,_.ctxPtr),s}serializedCipherAlgInfoLen(_){let s;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("algInfo",_,"Foundation.AlgInfo",r.FoundationInterfaceTag.ALG_INFO,r.FoundationInterface),s=e._vscf_alg_info_der_serializer_serialized_cipher_alg_info_len(this.ctxPtr,_.ctxPtr),s}serializeCipherAlgInfo(_){let s;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("algInfo",_,"Foundation.AlgInfo",r.FoundationInterfaceTag.ALG_INFO,r.FoundationInterface),s=e._vscf_alg_info_der_serializer_serialize_cipher_alg_info(this.ctxPtr,_.ctxPtr),s}serializedPbkdf2AlgInfoLen(_){let s;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("algInfo",_,"Foundation.AlgInfo",r.FoundationInterfaceTag.ALG_INFO,r.FoundationInterface),s=e._vscf_alg_info_der_serializer_serialized_pbkdf2_alg_info_len(this.ctxPtr,_.ctxPtr),s}serializePbkdf2AlgInfo(_){let s;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("algInfo",_,"Foundation.AlgInfo",r.FoundationInterfaceTag.ALG_INFO,r.FoundationInterface),s=e._vscf_alg_info_der_serializer_serialize_pbkdf2_alg_info(this.ctxPtr,_.ctxPtr),s}serializedPbes2AlgInfoLen(_){let s;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("algInfo",_,"Foundation.AlgInfo",r.FoundationInterfaceTag.ALG_INFO,r.FoundationInterface),s=e._vscf_alg_info_der_serializer_serialized_pbes2_alg_info_len(this.ctxPtr,_.ctxPtr),s}serializePbes2AlgInfo(_){let s;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("algInfo",_,"Foundation.AlgInfo",r.FoundationInterfaceTag.ALG_INFO,r.FoundationInterface),s=e._vscf_alg_info_der_serializer_serialize_pbes2_alg_info(this.ctxPtr,_.ctxPtr),s}serializedEccAlgInfoLen(_){let s;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("algInfo",_,"Foundation.AlgInfo",r.FoundationInterfaceTag.ALG_INFO,r.FoundationInterface),s=e._vscf_alg_info_der_serializer_serialized_ecc_alg_info_len(this.ctxPtr,_.ctxPtr),s}serializeEccAlgInfo(_){let s;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("algInfo",_,"Foundation.AlgInfo",r.FoundationInterfaceTag.ALG_INFO,r.FoundationInterface),s=e._vscf_alg_info_der_serializer_serialize_ecc_alg_info(this.ctxPtr,_.ctxPtr),s}serializedCompoundKeyAlgInfoLen(_){let s;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("algInfo",_,"Foundation.AlgInfo",r.FoundationInterfaceTag.ALG_INFO,r.FoundationInterface),s=e._vscf_alg_info_der_serializer_serialized_compound_key_alg_info_len(this.ctxPtr,_.ctxPtr),s}serializeCompoundKeyAlgInfo(_){let s;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("algInfo",_,"Foundation.AlgInfo",r.FoundationInterfaceTag.ALG_INFO,r.FoundationInterface),s=e._vscf_alg_info_der_serializer_serialize_compound_key_alg_info(this.ctxPtr,_.ctxPtr),s}serializedHybridKeyAlgInfoLen(_){let s;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("algInfo",_,"Foundation.AlgInfo",r.FoundationInterfaceTag.ALG_INFO,r.FoundationInterface),s=e._vscf_alg_info_der_serializer_serialized_hybrid_key_alg_info_len(this.ctxPtr,_.ctxPtr),s}serializeHybridKeyAlgInfo(_){let s;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("algInfo",_,"Foundation.AlgInfo",r.FoundationInterfaceTag.ALG_INFO,r.FoundationInterface),s=e._vscf_alg_info_der_serializer_serialize_hybrid_key_alg_info(this.ctxPtr,_.ctxPtr),s}serializeInplace(_){let s;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("algInfo",_,"Foundation.AlgInfo",r.FoundationInterfaceTag.ALG_INFO,r.FoundationInterface),s=e._vscf_alg_info_der_serializer_serialize_inplace(this.ctxPtr,_.ctxPtr),s}}return _}}(),ns=function(){if(gr)return pr;gr=1;const t=Ar();return pr=(e,r)=>{class _{constructor(t){this.name="AlgInfoDerDeserializer",this.ctxPtr=void 0===t?e._vscf_alg_info_der_deserializer_new():t}static newAndUseCContext(t){return new _(e._vscf_alg_info_der_deserializer_shallow_copy(t))}static newAndTakeCContext(t){return new _(t)}delete(){void 0!==this.ctxPtr&&null!==this.ctxPtr&&(e._vscf_alg_info_der_deserializer_delete(this.ctxPtr),this.ctxPtr=null)}set asn1Reader(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("asn1Reader",_,"Foundation.Asn1Reader",r.FoundationInterfaceTag.ASN1_READER,r.FoundationInterface),e._vscf_alg_info_der_deserializer_release_asn1_reader(this.ctxPtr),e._vscf_alg_info_der_deserializer_use_asn1_reader(this.ctxPtr,_.ctxPtr)}deserialize(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureByteArray("data",_);const s=_.length*_.BYTES_PER_ELEMENT,n=e._malloc(s);e.HEAP8.set(_,n);const c=e._vsc_data_ctx_size(),i=e._malloc(c);e._vsc_data(i,n,s);const a=e._vscf_error_ctx_size(),o=e._malloc(a);let l;e._vscf_error_reset(o);try{l=e._vscf_alg_info_der_deserializer_deserialize(this.ctxPtr,i,o);const t=e._vscf_error_status(o);return r.FoundationError.handleStatusCode(t),r.FoundationInterface.newAndTakeCContext(l)}finally{e._free(n),e._free(i),e._free(o)}}setupDefaults(){t.ensureNotNull("this.ctxPtr",this.ctxPtr),e._vscf_alg_info_der_deserializer_setup_defaults(this.ctxPtr)}deserializeSimpleAlgInfo(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr);const s=e._vscf_error_ctx_size(),n=e._malloc(s);let c;e._vscf_error_reset(n);try{c=e._vscf_alg_info_der_deserializer_deserialize_simple_alg_info(this.ctxPtr,_,n);const t=e._vscf_error_status(n);return r.FoundationError.handleStatusCode(t),r.FoundationInterface.newAndTakeCContext(c)}finally{e._free(n)}}deserializeKdfAlgInfo(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr);const s=e._vscf_error_ctx_size(),n=e._malloc(s);let c;e._vscf_error_reset(n);try{c=e._vscf_alg_info_der_deserializer_deserialize_kdf_alg_info(this.ctxPtr,_,n);const t=e._vscf_error_status(n);return r.FoundationError.handleStatusCode(t),r.FoundationInterface.newAndTakeCContext(c)}finally{e._free(n)}}deserializeHkdfAlgInfo(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr);const s=e._vscf_error_ctx_size(),n=e._malloc(s);let c;e._vscf_error_reset(n);try{c=e._vscf_alg_info_der_deserializer_deserialize_hkdf_alg_info(this.ctxPtr,_,n);const t=e._vscf_error_status(n);return r.FoundationError.handleStatusCode(t),r.FoundationInterface.newAndTakeCContext(c)}finally{e._free(n)}}deserializeHmacAlgInfo(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr);const s=e._vscf_error_ctx_size(),n=e._malloc(s);let c;e._vscf_error_reset(n);try{c=e._vscf_alg_info_der_deserializer_deserialize_hmac_alg_info(this.ctxPtr,_,n);const t=e._vscf_error_status(n);return r.FoundationError.handleStatusCode(t),r.FoundationInterface.newAndTakeCContext(c)}finally{e._free(n)}}deserializeCipherAlgInfo(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr);const s=e._vscf_error_ctx_size(),n=e._malloc(s);let c;e._vscf_error_reset(n);try{c=e._vscf_alg_info_der_deserializer_deserialize_cipher_alg_info(this.ctxPtr,_,n);const t=e._vscf_error_status(n);return r.FoundationError.handleStatusCode(t),r.FoundationInterface.newAndTakeCContext(c)}finally{e._free(n)}}deserializePbkdf2AlgInfo(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr);const s=e._vscf_error_ctx_size(),n=e._malloc(s);let c;e._vscf_error_reset(n);try{c=e._vscf_alg_info_der_deserializer_deserialize_pbkdf2_alg_info(this.ctxPtr,_,n);const t=e._vscf_error_status(n);return r.FoundationError.handleStatusCode(t),r.FoundationInterface.newAndTakeCContext(c)}finally{e._free(n)}}deserializePbes2AlgInfo(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr);const s=e._vscf_error_ctx_size(),n=e._malloc(s);let c;e._vscf_error_reset(n);try{c=e._vscf_alg_info_der_deserializer_deserialize_pbes2_alg_info(this.ctxPtr,_,n);const t=e._vscf_error_status(n);return r.FoundationError.handleStatusCode(t),r.FoundationInterface.newAndTakeCContext(c)}finally{e._free(n)}}deserializeEccAlgInfo(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr);const s=e._vscf_error_ctx_size(),n=e._malloc(s);let c;e._vscf_error_reset(n);try{c=e._vscf_alg_info_der_deserializer_deserialize_ecc_alg_info(this.ctxPtr,_,n);const t=e._vscf_error_status(n);return r.FoundationError.handleStatusCode(t),r.FoundationInterface.newAndTakeCContext(c)}finally{e._free(n)}}deserializeCompoundKeyAlgInfo(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr);const s=e._vscf_error_ctx_size(),n=e._malloc(s);let c;e._vscf_error_reset(n);try{c=e._vscf_alg_info_der_deserializer_deserialize_compound_key_alg_info(this.ctxPtr,_,n);const t=e._vscf_error_status(n);return r.FoundationError.handleStatusCode(t),r.FoundationInterface.newAndTakeCContext(c)}finally{e._free(n)}}deserializeHybridKeyAlgInfo(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr);const s=e._vscf_error_ctx_size(),n=e._malloc(s);let c;e._vscf_error_reset(n);try{c=e._vscf_alg_info_der_deserializer_deserialize_hybrid_key_alg_info(this.ctxPtr,_,n);const t=e._vscf_error_status(n);return r.FoundationError.handleStatusCode(t),r.FoundationInterface.newAndTakeCContext(c)}finally{e._free(n)}}deserializeInplace(){t.ensureNotNull("this.ctxPtr",this.ctxPtr);const _=e._vscf_error_ctx_size(),s=e._malloc(_);let n;e._vscf_error_reset(s);try{n=e._vscf_alg_info_der_deserializer_deserialize_inplace(this.ctxPtr,s);const t=e._vscf_error_status(s);return r.FoundationError.handleStatusCode(t),r.FoundationInterface.newAndTakeCContext(n)}finally{e._free(s)}}}return _}}(),cs=function(){if(Nr)return mr;Nr=1;const t=Ar();return mr=(e,r)=>{class _{constructor(t){this.name="MessageInfoDerSerializer",this.ctxPtr=void 0===t?e._vscf_message_info_der_serializer_new():t}static newAndUseCContext(t){return new _(e._vscf_message_info_der_serializer_shallow_copy(t))}static newAndTakeCContext(t){return new _(t)}delete(){void 0!==this.ctxPtr&&null!==this.ctxPtr&&(e._vscf_message_info_der_serializer_delete(this.ctxPtr),this.ctxPtr=null)}set asn1Reader(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("asn1Reader",_,"Foundation.Asn1Reader",r.FoundationInterfaceTag.ASN1_READER,r.FoundationInterface),e._vscf_message_info_der_serializer_release_asn1_reader(this.ctxPtr),e._vscf_message_info_der_serializer_use_asn1_reader(this.ctxPtr,_.ctxPtr)}set asn1Writer(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("asn1Writer",_,"Foundation.Asn1Writer",r.FoundationInterfaceTag.ASN1_WRITER,r.FoundationInterface),e._vscf_message_info_der_serializer_release_asn1_writer(this.ctxPtr),e._vscf_message_info_der_serializer_use_asn1_writer(this.ctxPtr,_.ctxPtr)}static get PREFIX_LEN(){return 32}get PREFIX_LEN(){return 32}serializedLen(_){let s;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureClass("messageInfo",_,r.MessageInfo),s=e._vscf_message_info_der_serializer_serialized_len(this.ctxPtr,_.ctxPtr),s}serialize(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureClass("messageInfo",_,r.MessageInfo);const s=this.serializedLen(_),n=e._vsc_buffer_new_with_capacity(s);try{e._vscf_message_info_der_serializer_serialize(this.ctxPtr,_.ctxPtr,n);const t=e._vsc_buffer_bytes(n),r=e._vsc_buffer_len(n);return e.HEAPU8.slice(t,t+r)}finally{e._vsc_buffer_delete(n)}}readPrefix(r){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureByteArray("data",r);const _=r.length*r.BYTES_PER_ELEMENT,s=e._malloc(_);e.HEAP8.set(r,s);const n=e._vsc_data_ctx_size(),c=e._malloc(n);let i;e._vsc_data(c,s,_);try{i=e._vscf_message_info_der_serializer_read_prefix(this.ctxPtr,c)}finally{e._free(s),e._free(c)}}deserialize(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureByteArray("data",_);const s=_.length*_.BYTES_PER_ELEMENT,n=e._malloc(s);e.HEAP8.set(_,n);const c=e._vsc_data_ctx_size(),i=e._malloc(c);e._vsc_data(i,n,s);const a=e._vscf_error_ctx_size(),o=e._malloc(a);let l;e._vscf_error_reset(o);try{l=e._vscf_message_info_der_serializer_deserialize(this.ctxPtr,i,o);const t=e._vscf_error_status(o);return r.FoundationError.handleStatusCode(t),r.MessageInfo.newAndTakeCContext(l)}finally{e._free(n),e._free(i),e._free(o)}}serializedFooterLen(_){let s;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureClass("messageInfoFooter",_,r.MessageInfoFooter),s=e._vscf_message_info_der_serializer_serialized_footer_len(this.ctxPtr,_.ctxPtr),s}serializeFooter(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureClass("messageInfoFooter",_,r.MessageInfoFooter);const s=this.serializedFooterLen(_),n=e._vsc_buffer_new_with_capacity(s);try{e._vscf_message_info_der_serializer_serialize_footer(this.ctxPtr,_.ctxPtr,n);const t=e._vsc_buffer_bytes(n),r=e._vsc_buffer_len(n);return e.HEAPU8.slice(t,t+r)}finally{e._vsc_buffer_delete(n)}}deserializeFooter(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureByteArray("data",_);const s=_.length*_.BYTES_PER_ELEMENT,n=e._malloc(s);e.HEAP8.set(_,n);const c=e._vsc_data_ctx_size(),i=e._malloc(c);e._vsc_data(i,n,s);const a=e._vscf_error_ctx_size(),o=e._malloc(a);let l;e._vscf_error_reset(o);try{l=e._vscf_message_info_der_serializer_deserialize_footer(this.ctxPtr,i,o);const t=e._vscf_error_status(o);return r.FoundationError.handleStatusCode(t),r.MessageInfoFooter.newAndTakeCContext(l)}finally{e._free(n),e._free(i),e._free(o)}}setupDefaults(){t.ensureNotNull("this.ctxPtr",this.ctxPtr),e._vscf_message_info_der_serializer_setup_defaults(this.ctxPtr)}serializedCustomParamsLen(_){let s;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureClass("customParams",_,r.MessageInfoCustomParams),s=e._vscf_message_info_der_serializer_serialized_custom_params_len(this.ctxPtr,_.ctxPtr),s}serializeCustomParams(_){let s;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureClass("customParams",_,r.MessageInfoCustomParams),s=e._vscf_message_info_der_serializer_serialize_custom_params(this.ctxPtr,_.ctxPtr),s}serializedFooterInfoLen(_){let s;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureClass("footerInfo",_,r.FooterInfo),s=e._vscf_message_info_der_serializer_serialized_footer_info_len(this.ctxPtr,_.ctxPtr),s}serializeFooterInfo(_){let s;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureClass("footerInfo",_,r.FooterInfo),s=e._vscf_message_info_der_serializer_serialize_footer_info(this.ctxPtr,_.ctxPtr),s}serializeSignedDataInfoInternal(_){let s;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureClass("signedDataInfo",_,r.SignedDataInfo),s=e._vscf_message_info_der_serializer_serialize_signed_data_info_internal(this.ctxPtr,_.ctxPtr),s}serializedKeyRecipientInfoLen(_){let s;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureClass("keyRecipientInfo",_,r.KeyRecipientInfo),s=e._vscf_message_info_der_serializer_serialized_key_recipient_info_len(this.ctxPtr,_.ctxPtr),s}serializeKeyRecipientInfo(_){let s;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureClass("keyRecipientInfo",_,r.KeyRecipientInfo),s=e._vscf_message_info_der_serializer_serialize_key_recipient_info(this.ctxPtr,_.ctxPtr),s}serializedPasswordRecipientInfoLen(_){let s;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureClass("passwordRecipientInfo",_,r.PasswordRecipientInfo),s=e._vscf_message_info_der_serializer_serialized_password_recipient_info_len(this.ctxPtr,_.ctxPtr),s}serializePasswordRecipientInfo(_){let s;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureClass("passwordRecipientInfo",_,r.PasswordRecipientInfo),s=e._vscf_message_info_der_serializer_serialize_password_recipient_info(this.ctxPtr,_.ctxPtr),s}serializedRecipientInfosLen(_){let s;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureClass("messageInfo",_,r.MessageInfo),s=e._vscf_message_info_der_serializer_serialized_recipient_infos_len(this.ctxPtr,_.ctxPtr),s}serializeRecipientInfos(_){let s;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureClass("messageInfo",_,r.MessageInfo),s=e._vscf_message_info_der_serializer_serialize_recipient_infos(this.ctxPtr,_.ctxPtr),s}serializedEncryptedContentInfoLen(_){let s;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureClass("messageInfo",_,r.MessageInfo),s=e._vscf_message_info_der_serializer_serialized_encrypted_content_info_len(this.ctxPtr,_.ctxPtr),s}serializeEncryptedContentInfo(_){let s;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureClass("messageInfo",_,r.MessageInfo),s=e._vscf_message_info_der_serializer_serialize_encrypted_content_info(this.ctxPtr,_.ctxPtr),s}serializedEnvelopedDataLen(_){let s;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureClass("messageInfo",_,r.MessageInfo),s=e._vscf_message_info_der_serializer_serialized_enveloped_data_len(this.ctxPtr,_.ctxPtr),s}serializeEnvelopedData(_){let s;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureClass("messageInfo",_,r.MessageInfo),s=e._vscf_message_info_der_serializer_serialize_enveloped_data(this.ctxPtr,_.ctxPtr),s}serializedCmsContentInfoLen(_){let s;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureClass("messageInfo",_,r.MessageInfo),s=e._vscf_message_info_der_serializer_serialized_cms_content_info_len(this.ctxPtr,_.ctxPtr),s}serializeCmsContentInfo(_){let s;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureClass("messageInfo",_,r.MessageInfo),s=e._vscf_message_info_der_serializer_serialize_cms_content_info_(this.ctxPtr,_.ctxPtr),s}serializedSignerInfosLen(_){let s;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureClass("messageInfoFooter",_,r.MessageInfoFooter),s=e._vscf_message_info_der_serializer_serialized_signer_infos_len(this.ctxPtr,_.ctxPtr),s}serializeSignerInfos(_){let s;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureClass("messageInfoFooter",_,r.MessageInfoFooter),s=e._vscf_message_info_der_serializer_serialize_signer_infos(this.ctxPtr,_.ctxPtr),s}serializedSignerInfoLen(_){let s;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureClass("signerInfo",_,r.SignerInfo),s=e._vscf_message_info_der_serializer_serialized_signer_info_len(this.ctxPtr,_.ctxPtr),s}serializeSignerInfo(_){let s;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureClass("signerInfo",_,r.SignerInfo),s=e._vscf_message_info_der_serializer_serialize_signer_info(this.ctxPtr,_.ctxPtr),s}deserializeCustomParams(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureClass("customParams",_,r.MessageInfoCustomParams);const s=e._vscf_error_ctx_size(),n=e._malloc(s);let c;e._vscf_error_reset(n);try{c=e._vscf_message_info_der_serializer_deserialize_custom_params(this.ctxPtr,_.ctxPtr,n);const t=e._vscf_error_status(n);r.FoundationError.handleStatusCode(t)}finally{e._free(n)}}deserializeCipherKdf(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureClass("messageInfo",_,r.MessageInfo);const s=e._vscf_error_ctx_size(),n=e._malloc(s);let c;e._vscf_error_reset(n);try{c=e._vscf_message_info_der_serializer_deserialize_cipher_kdf(this.ctxPtr,_.ctxPtr,n);const t=e._vscf_error_status(n);r.FoundationError.handleStatusCode(t)}finally{e._free(n)}}deserializeCipherPadding(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureClass("messageInfo",_,r.MessageInfo);const s=e._vscf_error_ctx_size(),n=e._malloc(s);let c;e._vscf_error_reset(n);try{c=e._vscf_message_info_der_serializer_deserialize_cipher_padding(this.ctxPtr,_.ctxPtr,n);const t=e._vscf_error_status(n);r.FoundationError.handleStatusCode(t)}finally{e._free(n)}}deserializeFooterInfo(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureClass("messageInfo",_,r.MessageInfo);const s=e._vscf_error_ctx_size(),n=e._malloc(s);let c;e._vscf_error_reset(n);try{c=e._vscf_message_info_der_serializer_deserialize_footer_info(this.ctxPtr,_.ctxPtr,n);const t=e._vscf_error_status(n);r.FoundationError.handleStatusCode(t)}finally{e._free(n)}}deserializeSignedDataInfo(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureClass("messageInfo",_,r.MessageInfo);const s=e._vscf_error_ctx_size(),n=e._malloc(s);let c;e._vscf_error_reset(n);try{c=e._vscf_message_info_der_serializer_deserialize_signed_data_info(this.ctxPtr,_.ctxPtr,n);const t=e._vscf_error_status(n);r.FoundationError.handleStatusCode(t)}finally{e._free(n)}}deserializeKeyRecipientInfo(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureClass("messageInfo",_,r.MessageInfo);const s=e._vscf_error_ctx_size(),n=e._malloc(s);let c;e._vscf_error_reset(n);try{c=e._vscf_message_info_der_serializer_deserialize_key_recipient_info(this.ctxPtr,_.ctxPtr,n);const t=e._vscf_error_status(n);r.FoundationError.handleStatusCode(t)}finally{e._free(n)}}deserializePasswordRecipientInfo(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureClass("messageInfo",_,r.MessageInfo);const s=e._vscf_error_ctx_size(),n=e._malloc(s);let c;e._vscf_error_reset(n);try{c=e._vscf_message_info_der_serializer_deserialize_password_recipient_info(this.ctxPtr,_.ctxPtr,n);const t=e._vscf_error_status(n);r.FoundationError.handleStatusCode(t)}finally{e._free(n)}}deserializeRecipientInfos(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureClass("messageInfo",_,r.MessageInfo);const s=e._vscf_error_ctx_size(),n=e._malloc(s);let c;e._vscf_error_reset(n);try{c=e._vscf_message_info_der_serializer_deserialize_recipient_infos(this.ctxPtr,_.ctxPtr,n);const t=e._vscf_error_status(n);r.FoundationError.handleStatusCode(t)}finally{e._free(n)}}deserializeEncryptedContentInfo(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureClass("messageInfo",_,r.MessageInfo);const s=e._vscf_error_ctx_size(),n=e._malloc(s);let c;e._vscf_error_reset(n);try{c=e._vscf_message_info_der_serializer_deserialize_encrypted_content_info(this.ctxPtr,_.ctxPtr,n);const t=e._vscf_error_status(n);r.FoundationError.handleStatusCode(t)}finally{e._free(n)}}deserializeEnvelopedData(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureClass("messageInfo",_,r.MessageInfo);const s=e._vscf_error_ctx_size(),n=e._malloc(s);let c;e._vscf_error_reset(n);try{c=e._vscf_message_info_der_serializer_deserialize_enveloped_data(this.ctxPtr,_.ctxPtr,n);const t=e._vscf_error_status(n);r.FoundationError.handleStatusCode(t)}finally{e._free(n)}}deserializeCmsContentInfo(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureClass("messageInfo",_,r.MessageInfo);const s=e._vscf_error_ctx_size(),n=e._malloc(s);let c;e._vscf_error_reset(n);try{c=e._vscf_message_info_der_serializer_deserialize_cms_content_info(this.ctxPtr,_.ctxPtr,n);const t=e._vscf_error_status(n);r.FoundationError.handleStatusCode(t)}finally{e._free(n)}}deserializeSignerInfos(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureClass("messageInfoFooter",_,r.MessageInfoFooter);const s=e._vscf_error_ctx_size(),n=e._malloc(s);let c;e._vscf_error_reset(n);try{c=e._vscf_message_info_der_serializer_deserialize_signer_infos(this.ctxPtr,_.ctxPtr,n);const t=e._vscf_error_status(n);r.FoundationError.handleStatusCode(t)}finally{e._free(n)}}deserializeSignerInfo(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureClass("messageInfoFooter",_,r.MessageInfoFooter);const s=e._vscf_error_ctx_size(),n=e._malloc(s);let c;e._vscf_error_reset(n);try{c=e._vscf_message_info_der_serializer_deserialize_signer_info(this.ctxPtr,_.ctxPtr,n);const t=e._vscf_error_status(n);r.FoundationError.handleStatusCode(t)}finally{e._free(n)}}}return _}}(),is=function(){if(Er)return Ir;Er=1;const t=Ar();return Ir=(e,r)=>{class _{constructor(t){this.name="RandomPadding",this.ctxPtr=void 0===t?e._vscf_random_padding_new():t}static newAndUseCContext(t){return new _(e._vscf_random_padding_shallow_copy(t))}static newAndTakeCContext(t){return new _(t)}delete(){void 0!==this.ctxPtr&&null!==this.ctxPtr&&(e._vscf_random_padding_delete(this.ctxPtr),this.ctxPtr=null)}set random(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("random",_,"Foundation.Random",r.FoundationInterfaceTag.RANDOM,r.FoundationInterface),e._vscf_random_padding_release_random(this.ctxPtr),e._vscf_random_padding_use_random(this.ctxPtr,_.ctxPtr)}static get PADDING_SIZE_LEN(){return 4}get PADDING_SIZE_LEN(){return 4}static get PADDING_LEN_MIN(){return 5}get PADDING_LEN_MIN(){return 5}algId(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_random_padding_alg_id(this.ctxPtr),r}produceAlgInfo(){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),_=e._vscf_random_padding_produce_alg_info(this.ctxPtr),r.FoundationInterface.newAndTakeCContext(_)}restoreAlgInfo(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureImplementInterface("algInfo",_,"Foundation.AlgInfo",r.FoundationInterfaceTag.ALG_INFO,r.FoundationInterface);const s=e._vscf_random_padding_restore_alg_info(this.ctxPtr,_.ctxPtr);r.FoundationError.handleStatusCode(s)}configure(_){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureClass("params",_,r.PaddingParams),e._vscf_random_padding_configure(this.ctxPtr,_.ctxPtr)}paddedDataLen(r){let _;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureNumber("dataLen",r),_=e._vscf_random_padding_padded_data_len(this.ctxPtr,r),_}len(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_random_padding_len(this.ctxPtr),r}lenMax(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_random_padding_len_max(this.ctxPtr),r}startDataProcessing(){t.ensureNotNull("this.ctxPtr",this.ctxPtr),e._vscf_random_padding_start_data_processing(this.ctxPtr)}processData(r){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureByteArray("data",r);const _=r.length*r.BYTES_PER_ELEMENT,s=e._malloc(_);e.HEAP8.set(r,s);const n=e._vsc_data_ctx_size(),c=e._malloc(n);e._vsc_data(c,s,_);try{e._vscf_random_padding_process_data(this.ctxPtr,c)}finally{e._free(s),e._free(c)}}finishDataProcessing(){t.ensureNotNull("this.ctxPtr",this.ctxPtr);const _=this.len(),s=e._vsc_buffer_new_with_capacity(_);try{const t=e._vscf_random_padding_finish_data_processing(this.ctxPtr,s);r.FoundationError.handleStatusCode(t);const _=e._vsc_buffer_bytes(s),n=e._vsc_buffer_len(s);return e.HEAPU8.slice(_,_+n)}finally{e._vsc_buffer_delete(s)}}startPaddedDataProcessing(){t.ensureNotNull("this.ctxPtr",this.ctxPtr),e._vscf_random_padding_start_padded_data_processing(this.ctxPtr)}processPaddedData(r){t.ensureNotNull("this.ctxPtr",this.ctxPtr),t.ensureByteArray("data",r);const _=r.length*r.BYTES_PER_ELEMENT,s=e._malloc(_);e.HEAP8.set(r,s);const n=e._vsc_data_ctx_size(),c=e._malloc(n);e._vsc_data(c,s,_);const i=r.length,a=e._vsc_buffer_new_with_capacity(i);try{e._vscf_random_padding_process_padded_data(this.ctxPtr,c,a);const t=e._vsc_buffer_bytes(a),r=e._vsc_buffer_len(a);return e.HEAPU8.slice(t,t+r)}finally{e._free(s),e._free(c),e._vsc_buffer_delete(a)}}finishPaddedDataProcessingOutLen(){let r;return t.ensureNotNull("this.ctxPtr",this.ctxPtr),r=e._vscf_random_padding_finish_padded_data_processing_out_len(this.ctxPtr),r}finishPaddedDataProcessing(){t.ensureNotNull("this.ctxPtr",this.ctxPtr);const _=this.finishPaddedDataProcessingOutLen(),s=e._vsc_buffer_new_with_capacity(_);try{const t=e._vscf_random_padding_finish_padded_data_processing(this.ctxPtr,s);r.FoundationError.handleStatusCode(t);const _=e._vsc_buffer_bytes(s),n=e._vsc_buffer_len(s);return e.HEAPU8.slice(_,_+n)}finally{e._vsc_buffer_delete(s)}}}return _}}();return wr=r=>new Promise((_,s)=>{t(r).then(t=>{const r={};r.FoundationInterfaceTag=e(t,r),r.FoundationInterface=g(t,r),r.FoundationImplTag=N(t,r),r.FoundationError=kr(t,r),r.Asn1Tag=Cr(t,r),r.AlgId=Fr(t,r),r.OidId=Tr(t,r),r.GroupMsgType=Kr(t,r),r.CipherState=Sr(t,r),r.Oid=zr(t,r),r.Base64=Lr(t,r),r.Pem=Rr(t,r),r.MessageInfo=Br(t,r),r.KeyRecipientInfo=Yr(t,r),r.KeyRecipientInfoList=Hr(t,r),r.PasswordRecipientInfo=Ur(t,r),r.PasswordRecipientInfoList=Mr(t,r),r.AlgFactory=Dr(t,r),r.KeyAlgFactory=Or(t,r),r.Ecies=Gr(t,r),r.RecipientCipher=Vr(t,r),r.MessageInfoCustomParams=qr(t,r),r.KeyProvider=jr(t,r),r.Signer=Xr(t,r),r.Verifier=Wr(t,r),r.BrainkeyClient=Zr(t,r),r.BrainkeyServer=$r(t,r),r.GroupSessionMessage=Qr(t,r),r.GroupSessionTicket=Jr(t,r),r.GroupSession=t_(t,r),r.MessageInfoEditor=e_(t,r),r.SignerInfo=r_(t,r),r.SignerInfoList=__(t,r),r.MessageInfoFooter=s_(t,r),r.SignedDataInfo=n_(t,r),r.FooterInfo=c_(t,r),r.KeyInfo=i_(t,r),r.PaddingParams=a_(t,r),r.Sha224=o_(t,r),r.Sha256=l_(t,r),r.Sha384=u_(t,r),r.Sha512=f_(t,r),r.Aes256Gcm=d_(t,r),r.Aes256Cbc=h_(t,r),r.Asn1rd=P_(t,r),r.Asn1wr=v_(t,r),r.RsaPublicKey=x_(t,r),r.RsaPrivateKey=y_(t,r),r.Rsa=p_(t,r),r.EccPublicKey=g_(t,r),r.EccPrivateKey=m_(t,r),r.Ecc=N_(t,r),r.EntropyAccumulator=I_(t,r),r.CtrDrbg=E_(t,r),r.Hmac=w_(t,r),r.Hkdf=b_(t,r),r.Kdf1=k_(t,r),r.Kdf2=A_(t,r),r.FakeRandom=C_(t,r),r.Pkcs5Pbkdf2=F_(t,r),r.Pkcs5Pbes2=T_(t,r),r.SeedEntropySource=K_(t,r),r.KeyMaterialRng=S_(t,r),r.RawPublicKey=z_(t,r),r.RawPrivateKey=L_(t,r),r.Pkcs8Serializer=R_(t,r),r.Sec1Serializer=B_(t,r),r.KeyAsn1Serializer=Y_(t,r),r.KeyAsn1Deserializer=H_(t,r),r.Ed25519=U_(t,r),r.Curve25519=M_(t,r),r.Falcon=D_(t,r),r.Round5=O_(t,r),r.CompoundKeyAlgInfo=G_(t,r),r.CompoundPublicKey=V_(t,r),r.CompoundPrivateKey=q_(t,r),r.CompoundKeyAlg=j_(t,r),r.HybridKeyAlgInfo=X_(t,r),r.HybridPublicKey=W_(t,r),r.HybridPrivateKey=Z_(t,r),r.HybridKeyAlg=$_(t,r),r.SimpleAlgInfo=Q_(t,r),r.HashBasedAlgInfo=J_(t,r),r.CipherAlgInfo=ts(t,r),r.SaltedKdfAlgInfo=es(t,r),r.PbeAlgInfo=rs(t,r),r.EccAlgInfo=_s(t,r),r.AlgInfoDerSerializer=ss(t,r),r.AlgInfoDerDeserializer=ns(t,r),r.MessageInfoDerSerializer=cs(t,r),r.RandomPadding=is(t,r),_(r)}).catch(t=>{s(t)})})}(),Fr=t(Cr);export{Fr as default};
|