@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
|
+
"use strict";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){var e,r=(e=globalThis.document?.currentScript?.src,async function(t={}){var r,_=t,s="";try{s=new URL(".",e).href}catch{}r=async t=>{if((t=await fetch(t,{credentials:"same-origin"})).ok)return t.arrayBuffer();throw Error(t.status+" : "+t.url)};var n,c,i,a,o,l,u,f,d,h,P=console.log.bind(console),v=console.error.bind(console),x=!1,y=!1;function p(){var t=yt.buffer;_.HEAP8=a=new Int8Array(t),_.HEAP16=l=new Int16Array(t),_.HEAPU8=o=new Uint8Array(t),_.HEAPU16=new Uint16Array(t),_.HEAP32=u=new Int32Array(t),_.HEAPU32=f=new Uint32Array(t),_.HEAPF32=new Float32Array(t),_.HEAPF64=new Float64Array(t),d=new BigInt64Array(t),new BigUint64Array(t)}function g(t){throw _.onAbort?.(t),v(t="Aborted("+t+")"),x=!0,t=new WebAssembly.RuntimeError(t+". Build with -sASSERTIONS for more info."),i?.(t),t}async function m(t,e){try{var _=await async function(t){if(!n)try{var e=await r(t);return new Uint8Array(e)}catch{}if(t!=h||!n)throw"both async and sync fetching of the wasm failed";return new Uint8Array(n)}(t);return await WebAssembly.instantiate(_,e)}catch(t){v(`failed to asynchronously prepare wasm: ${t}`),g(t)}}var N=t=>{for(;0<t.length;)t.shift()(_)},I=[],E=[],w=()=>{var t=_.preRun.shift();E.push(t)},b=()=>{var t=u[+xt>>2];return xt+=4,t},k=(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},A=t=>{var e="/"===t.charAt(0),r="/"===t.slice(-1);return(t=k(t.split("/").filter(t=>!!t),!e).join("/"))||e||(t="."),t&&r&&(t+="/"),(e?"/":"")+t},C=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):"."},F=t=>{(F=t=>crypto.getRandomValues(t))(t)},T=globalThis.TextDecoder&&new TextDecoder,K=(t,e=0)=>{for(var r=e,_=r+void 0;t[r]&&!(r>=_);)++r;if(16<r-e&&t.buffer&&T)return T.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 _},S=[],z=[];function L(t,e){z[t]={input:[],output:[],Ft:e},at(t,R)}var R={open(t){var e=z[t.node.Qt];if(!e)throw new X(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 X(60);for(var s=0,n=0;n<_;n++){try{var c=t.xt.Ft.$t(t.xt)}catch(t){throw new X(29)}if(void 0===c&&0===s)throw new X(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 X(60);try{for(var s=0;s<_;s++)t.xt.Ft.Xt(t.xt,e[r+s])}catch(t){throw new X(29)}return _&&(t.node.At=t.node.zt=Date.now()),s}},B={$t(){t:{if(!S.length){var t=null;if(globalThis.window?.prompt&&null!==(t=window.prompt("Input: "))&&(t+="\n"),!t){var e=null;break t}for(var r=e=0;r<t.length;++r){var _=t.charCodeAt(r);127>=_?e++:2047>=_?e+=2:55296<=_&&57343>=_?(e+=4,++r):e+=3}var s=(e=Array(e+1)).length;if(r=0,0<s){_=r,s=r+s-1;for(var n=0;n<t.length;++n){var c=t.codePointAt(n);if(127>=c){if(r>=s)break;e[r++]=c}else if(2047>=c){if(r+1>=s)break;e[r++]=192|c>>6,e[r++]=128|63&c}else if(65535>=c){if(r+2>=s)break;e[r++]=224|c>>12,e[r++]=128|c>>6&63,e[r++]=128|63&c}else{if(r+3>=s)break;e[r++]=240|c>>18,e[r++]=128|c>>12&63,e[r++]=128|c>>6&63,e[r++]=128|63&c,n++}}e[r]=0,t=r-_}else t=0;e.length=t,S=e}e=S.shift()}return e},Xt(t,e){null===e||10===e?(P(K(t.output)),t.output=[]):0!=e&&t.output.push(e)},Nt(t){0<t.output?.length&&(P(K(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]},Y={Xt(t,e){null===e||10===e?(v(K(t.output)),t.output=[]):0!=e&&t.output.push(e)},Nt(t){0<t.output?.length&&(v(K(t.output)),t.output=[])}},H={Ct:null,Et:()=>H.createNode(null,"/",16895,0),createNode(t,e,r,_){if(24576==(61440&r)||4096==(61440&r))throw new X(63);return H.Ct||(H.Ct={dir:{node:{It:H.wt.It,Dt:H.wt.Dt,Lt:H.wt.Lt,Ot:H.wt.Ot,eu:H.wt.eu,gu:H.wt.gu,fu:H.wt.fu,Yt:H.wt.Yt,Rt:H.wt.Rt},stream:{Bt:H.ut.Bt}},file:{node:{It:H.wt.It,Dt:H.wt.Dt},stream:{Bt:H.ut.Bt,read:H.ut.read,write:H.ut.write,bu:H.ut.bu,du:H.ut.du}},link:{node:{It:H.wt.It,Dt:H.wt.Dt,Mt:H.wt.Mt},stream:{}},Zt:{node:{It:H.wt.It,Dt:H.wt.Dt},stream:it}}),16384==(61440&(r=tt(t,e,r,_)).mode)?(r.wt=H.Ct.dir.node,r.ut=H.Ct.dir.stream,r.vt={}):32768==(61440&r.mode)?(r.wt=H.Ct.file.node,r.ut=H.Ct.file.stream,r.yt=0,r.vt=null):40960==(61440&r.mode)?(r.wt=H.Ct.link.node,r.ut=H.Ct.link.stream):8192==(61440&r.mode)&&(r.wt=H.Ct.Zt.node,r.ut=H.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 H.Tt||(H.Tt=new X(44),H.Tt.stack="<generic error, no stack>"),H.Tt},Ot:(t,e,r,_)=>H.createNode(t,e,r,_),eu(t,e,r){try{var _=J(e,r)}catch(t){}if(_){if(16384==(61440&t.mode))for(var s in _.vt)throw new X(55);if(s=Q(_.parent.id,_.name),G[s]===_)G[s]=_.Kt;else for(s=G[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,_=J(t,e);for(r in _.vt)throw new X(55);delete t.vt[e],t.zt=t.At=Date.now()},Yt:t=>[".","..",...Object.keys(t.vt)],Rt:(t,e,r)=>((t=H.createNode(t,e,41471,0)).link=r,t),Mt(t){if(40960!=(61440&t.mode))throw new X(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===a.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 X(28);return e},bu(t,e,r,_,s){if(32768!=(61440&t.node.mode))throw new X(43);if(t=t.node.vt,2&s||!t||t.buffer!==a.buffer){if(_=!0,g(),!(s=void 0))throw new X(48);t&&((0<r||r+e<t.length)&&(t=t.subarray?t.subarray(r,r+e):Array.prototype.slice.call(t,r,r+e)),a.set(t,s))}else _=!1,s=t.byteOffset;return{Eu:s,pu:_}},du:(t,e,r,_)=>(H.ut.write(t,e,0,_,r,!1),0)}},U=null,M={},D=[],O=1,G=null,V=!1,q=!0,j={},X=class{name="ErrnoError";constructor(t){this.Gt=t}},W=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}},Z=class{wt={};ut={};Pt=null;constructor(t,e,r,_){t||=this,this.parent=t,this.Et=t.Et,this.id=O++,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 $(t,e={}){if(!t)throw new X(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 _=U,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=C(s),_===_.parent){t=s+"/"+t.slice(n+1).join("/"),r--;continue t}_=_.parent}else{s=A(s+"/"+t[n]);try{_=J(_,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 X(52);"/"===(_=_.wt.Mt(_)).charAt(0)||(_=C(s)+"/"+_),t=_+"/"+t.slice(n+1).join("/");continue t}}}return{path:s,node:_}}throw new X(32)}function Q(t,e){for(var r=0,_=0;_<e.length;_++)r=(r<<5)-r+e.charCodeAt(_)|0;return(t+r>>>0)%G.length}function J(t,e){var r=16384==(61440&t.mode)?(r=rt(t,"x"))?r:t.wt.Lt?0:2:54;if(r)throw new X(r);for(r=G[Q(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 tt(t,e,r,_){return e=Q((t=new Z(t,e,r,_)).parent.id,t.name),t.Kt=G[e],G[e]=t}function et(t){var e=["r","w","rw"][3&t];return 512&t&&(e+="w"),e}function rt(t,e){return q?0:!e.includes("r")||292&t.mode?e.includes("w")&&!(146&t.mode)||e.includes("x")&&!(73&t.mode)?2:0:2}function _t(t,e){if(16384!=(61440&t.mode))return 54;try{return J(t,e),20}catch(t){}return rt(t,"wx")}function st(t){if(!(t=D[t]))throw new X(8);return t}function nt(t,e=-1){if(t=Object.assign(new W,t),-1==e)t:{for(e=0;4096>=e;e++)if(!D[e])break t;throw new X(33)}return t.Ht=e,D[e]=t}function ct(t,e){var r=void 0,_=r?null:t;if(r??=t.wt.Dt,!r)throw new X(63);r(_,e)}var it={open(t){t.ut=M[t.node.Qt].ut,t.ut.open?.(t)},Bt(){throw new X(70)}};function at(t,e){M[t]={ut:e}}function ot(t,e){var r="/"===e;if(r&&U)throw new X(10);if(!r&&e){var _=$(e,{Vt:!1});if(e=_.path,(_=_.node).Pt)throw new X(10);if(16384!=(61440&_.mode))throw new X(54)}e={type:t,Du:{},cu:e,mu:[]},(t=t.Et(e)).Et=e,e.root=t,r?U=t:_&&(_.Pt=e,_.Et&&_.Et.mu.push(e))}function lt(t,e,r){var _=$(t,{parent:!0}).node;if(!(t=t&&t.match(/([^\/]+|\/)\/*$/)[1]))throw new X(28);if("."===t||".."===t)throw new X(20);var s=_t(_,t);if(s)throw new X(s);if(!_.wt.Ot)throw new X(63);return _.wt.Ot(_,t,e,r)}function ut(t){return lt(t,16895,0)}function ft(t,e,r){void 0===r&&(r=e,e=438),lt(t,8192|e,r)}function dt(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=k(e.split("/").filter(t=>!!t),!r).join("/"))||"."})(t))throw new X(44);var r=$(e,{parent:!0}).node;if(!r)throw new X(44);var _=_t(r,e=e&&e.match(/([^\/]+|\/)\/*$/)[1]);if(_)throw new X(_);if(!r.wt.Rt)throw new X(63);r.wt.Rt(r,e,t)}function ht(t,e,r=438){if(""===t)throw new X(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(r=64&e?4095&r|32768:0,"object"==typeof t)s=t;else{var n=t.endsWith("/");s=(t=$(t,{Ut:!(131072&e),nu:!0})).node,t=t.path}var c=!1;if(64&e)if(s){if(128&e)throw new X(20)}else{if(n)throw new X(31);s=lt(t,511|r,0),c=!0}if(!s)throw new X(44);if(8192==(61440&s.mode)&&(e&=-513),65536&e&&16384!=(61440&s.mode))throw new X(54);if(!c&&(n=s?40960==(61440&s.mode)?32:16384==(61440&s.mode)&&("r"!==et(e)||576&e)?31:rt(s,et(e)):44))throw new X(n);if(512&e&&!c){if(16384==(61440&(n="string"==typeof(n=s)?$(n,{Ut:!0}).node:n).mode))throw new X(31);if(32768!=(61440&n.mode))throw new X(28);var i=rt(n,"w");if(i)throw new X(i);ct(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=nt({node:s,path:a,flags:e,seekable:!0,position:0,ut:s.ut,ou:[],error:!1})).ut.open&&a.ut.open(a),c&&(r&=511,ct(s="string"==typeof s?$(s,{Ut:!0}).node:s,{mode:4095&r|-4096&s.mode,zt:Date.now(),xu:void 0})),!_.logReadFiles||1&e||t in j||(j[t]=1),a}function Pt(t,e,r){if(null===t.Ht)throw new X(8);if(!t.seekable||!t.ut.Bt)throw new X(70);if(0!=r&&1!=r&&2!=r)throw new X(28);t.position=t.ut.Bt(t,e,r),t.ou=[]}function vt(t,e,r){t=A("/dev/"+t);var _=((t,e)=>{var r=0;return t&&(r|=365),e&&(r|=146),r})(!!e,!!r);vt.au??(vt.au=64);var s=vt.au++<<8;at(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 X(29)}if(void 0===i&&0===n)throw new X(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 X(29)}return s&&(t.node.At=t.node.zt=Date.now()),n}}),ft(t,_,s)}var xt=void 0;if(G=Array(4096),ot(H,"/"),ut("/tmp"),ut("/home"),ut("/home/web_user"),function(){ut("/dev"),at(259,{read:()=>0,write:(t,e,r,_)=>_,Bt:()=>0}),ft("/dev/null",259),L(1280,B),L(1536,Y),ft("/dev/tty",1280),ft("/dev/tty1",1536);var t=new Uint8Array(1024),e=0,r=()=>(0===e&&(F(t),e=t.byteLength),t[--e]);vt("random",r),vt("urandom",r),ut("/dev/shm"),ut("/dev/shm/tmp")}(),function(){ut("/proc");var t=ut("/proc/self");ut("/proc/self/fd"),ot({Et(){var e=tt(t,"fd",16895,73);return e.ut={Bt:H.ut.Bt},e.wt={Lt(t,e){var r=st(t=+e);return(t={parent:null,Et:{cu:"fake"},wt:{Mt:()=>r.path},id:t+1}).parent=t},Yt:()=>Array.from(D.entries()).filter(([,t])=>t).map(([t])=>t.toString())},e}},"/proc/self/fd")}(),_.print&&(P=_.print),_.printErr&&(v=_.printErr),_.wasmBinary&&(n=_.wasmBinary),_.preInit)for("function"==typeof _.preInit&&(_.preInit=[_.preInit]);0<_.preInit.length;)_.preInit.shift()();var yt,pt,gt={b:function(t,e,r){xt=r;try{var _=st(t);switch(e){case 0:var s=b();if(0>s)break;for(;D[s];)s++;return function(t,e=-1){return t=nt(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=b(),_.flags|=s,0;case 12:return s=b(),l[s+0>>1]=2,0}return-28}catch(t){if("ErrnoError"!==t.name)throw t;return-t.Gt}},f:function(t,e,r){xt=r;try{var _=st(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=b();u[s>>2]=25856,u[s+4>>2]=5,u[s+8>>2]=191,u[s+12>>2]=35387;for(var n=0;32>n;n++)a[s+n+17]=t[n]||0}return 0;case 21506:case 21507:case 21508:if(!_.xt)return-59;if(_.xt.Ft.ku)for(s=b(),t=[],n=0;32>n;n++)t.push(a[s+n+17]);return 0;case 21519:return _.xt?(s=b(),u[s>>2]=0):-59;case 21520:return _.xt?-28:-59;case 21537:case 21531:if(s=b(),!_.ut.iu)throw new X(59);return _.ut.iu(_,e,s);case 21523:return _.xt?(_.xt.Ft.lu&&(n=[24,80],s=b(),l[s>>1]=n[0],l[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,_){xt=_;try{var s=e=e?K(o,e):"";if("/"===s.charAt(0))e=s;else{var n=-100===t?"/":st(t).path;if(0==s.length)throw new X(44);e=n+"/"+s}return ht(e,r,_?b():0).Ht}catch(t){if("ErrnoError"!==t.name)throw t;return-t.Gt}},i:()=>g(""),h:t=>{var e=o.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))-yt.buffer.byteLength+65535)/65536|0;try{yt.grow(_),p();var s=1;break t}catch(t){}s=void 0}if(s)return!0}return!1},a:function(t){try{var e=st(t);if(null===e.Ht)throw new X(8);e.Wt&&(e.Wt=null);try{e.ut.close&&e.ut.close(e)}catch(t){throw t}finally{D[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=st(t);t=e;for(var n,c=e=0;c<r;c++){var i=f[t>>2],o=f[t+4>>2];t+=8;var l=s,u=i,d=o,h=n,P=a;if(0>d||0>h)throw new X(28);if(null===l.Ht)throw new X(8);if(1==(2097155&l.flags))throw new X(8);if(16384==(61440&l.node.mode))throw new X(31);if(!l.ut.read)throw new X(28);var v=void 0!==h;if(v){if(!l.seekable)throw new X(70)}else h=l.position;var x=l.ut.read(l,P,u,d,h);v||(l.position+=x);var y=x;if(0>y){var p=-1;break t}if(e+=y,y<o)break;void 0!==n&&(n+=y)}p=e}return f[_>>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=st(t);return Pt(s,e,r),d[_>>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=st(t);t=e;for(var n,c=e=0;c<r;c++){var i=f[t>>2],o=f[t+4>>2];t+=8;var l=s,u=i,d=o,h=n,P=a;if(0>d||0>h)throw new X(28);if(null===l.Ht)throw new X(8);if(!(2097155&l.flags))throw new X(8);if(16384==(61440&l.node.mode))throw new X(31);if(!l.ut.write)throw new X(28);l.seekable&&1024&l.flags&&Pt(l,0,2);var v=void 0!==h;if(v){if(!l.seekable)throw new X(70)}else h=l.position;var x=l.ut.write(l,P,u,d,h,void 0);v||(l.position+=x);var y=x;if(0>y){var p=-1;break t}if(e+=y,y<o)break;void 0!==n&&(n+=y)}p=e}return f[_>>2]=p,0}catch(t){if("ErrnoError"!==t.name)throw t;return t.Gt}}};return pt=await async function(){function t(t){return t=pt=t.exports,_._vscf_impl_api=t.l,_._vscf_impl_tag=t.m,_._vscf_impl_shallow_copy=t.n,_._vscf_error_ctx_size=t.o,_._vscf_error_reset=t.p,_._vscf_error_status=t.q,_._vscf_oid_from_alg_id=t.r,_._vscf_oid_to_alg_id=t.s,_._vscf_oid_equal=t.t,_._vscf_oid_from_id=t.u,_._vscf_oid_to_id=t.v,_._vscf_oid_id_to_alg_id=t.w,_._vscf_base64_encoded_len=t.x,_._vscf_base64_encode=t.y,_._vscf_base64_decoded_len=t.z,_._vscf_base64_decode=t.A,_._vscf_pem_wrapped_len=t.B,_._vscf_pem_wrap=t.C,_._vscf_pem_unwrapped_len=t.D,_._vscf_pem_unwrap=t.E,_._vscf_pem_title=t.F,_._vscf_message_info_new=t.G,_._vscf_message_info_delete=t.H,_._vscf_message_info_shallow_copy=t.I,_._vscf_message_info_data_encryption_alg_info=t.J,_._vscf_message_info_key_recipient_info_list=t.K,_._vscf_message_info_password_recipient_info_list=t.L,_._vscf_message_info_has_custom_params=t.M,_._vscf_message_info_custom_params=t.N,_._vscf_message_info_has_cipher_kdf_alg_info=t.O,_._vscf_message_info_cipher_kdf_alg_info=t.P,_._vscf_message_info_has_cipher_padding_alg_info=t.Q,_._vscf_message_info_cipher_padding_alg_info=t.R,_._vscf_message_info_has_footer_info=t.S,_._vscf_message_info_footer_info=t.T,_._vscf_message_info_clear=t.U,_._vscf_key_recipient_info_new=t.V,_._vscf_key_recipient_info_new_with_data=t.W,_._vscf_key_recipient_info_delete=t.X,_._vscf_key_recipient_info_shallow_copy=t.Y,_._vscf_key_recipient_info_recipient_id=t.Z,_._vscf_key_recipient_info_key_encryption_algorithm=t._,_._vscf_key_recipient_info_encrypted_key=t.$,_._vscf_key_recipient_info_list_new=t.aa,_._vscf_key_recipient_info_list_delete=t.ba,_._vscf_key_recipient_info_list_shallow_copy=t.ca,_._vscf_key_recipient_info_list_has_item=t.da,_._vscf_key_recipient_info_list_item=t.ea,_._vscf_key_recipient_info_list_has_next=t.fa,_._vscf_key_recipient_info_list_next=t.ga,_._vscf_key_recipient_info_list_has_prev=t.ha,_._vscf_key_recipient_info_list_prev=t.ia,_._vscf_key_recipient_info_list_clear=t.ja,_._vscf_password_recipient_info_new=t.ka,_._vscf_password_recipient_info_new_with_members=t.la,_._vscf_password_recipient_info_delete=t.ma,_._vscf_password_recipient_info_shallow_copy=t.na,_._vscf_password_recipient_info_key_encryption_algorithm=t.oa,_._vscf_password_recipient_info_encrypted_key=t.pa,_._vscf_password_recipient_info_list_new=t.qa,_._vscf_password_recipient_info_list_delete=t.ra,_._vscf_password_recipient_info_list_shallow_copy=t.sa,_._vscf_password_recipient_info_list_has_item=t.ta,_._vscf_password_recipient_info_list_item=t.ua,_._vscf_password_recipient_info_list_has_next=t.va,_._vscf_password_recipient_info_list_next=t.wa,_._vscf_password_recipient_info_list_has_prev=t.xa,_._vscf_password_recipient_info_list_prev=t.ya,_._vscf_password_recipient_info_list_clear=t.za,_._vscf_alg_factory_create_hash_from_info=t.Aa,_._vscf_alg_factory_create_mac_from_info=t.Ba,_._vscf_alg_factory_create_kdf_from_info=t.Ca,_._vscf_alg_factory_create_salted_kdf_from_info=t.Da,_._vscf_alg_factory_create_cipher_from_info=t.Ea,_._vscf_alg_factory_create_padding_from_info=t.Fa,_._vscf_key_alg_factory_create_from_alg_id=t.Ga,_._vscf_key_alg_factory_create_from_key=t.Ha,_._vscf_key_alg_factory_create_from_raw_public_key=t.Ia,_._vscf_key_alg_factory_create_from_raw_private_key=t.Ja,_._vscf_ecies_release_random=t.Ka,_._vscf_ecies_release_cipher=t.La,_._vscf_ecies_release_mac=t.Ma,_._vscf_ecies_release_kdf=t.Na,_._vscf_ecies_release_ephemeral_key=t.Oa,_._vscf_ecies_new=t.Pa,_._vscf_ecies_delete=t.Qa,_._vscf_ecies_shallow_copy=t.Ra,_._vscf_ecies_use_random=t.Sa,_._vscf_ecies_use_cipher=t.Ta,_._vscf_ecies_use_mac=t.Ua,_._vscf_ecies_use_kdf=t.Va,_._vscf_ecies_use_ephemeral_key=t.Wa,_._vscf_ecies_set_key_alg=t.Xa,_._vscf_ecies_release_key_alg=t.Ya,_._vscf_ecies_setup_defaults=t.Za,_._vscf_ecies_setup_defaults_no_random=t._a,_._vscf_ecies_encrypted_len=t.$a,_._vscf_ecies_encrypt=t.ab,_._vscf_ecies_decrypted_len=t.bb,_._vscf_ecies_decrypt=t.cb,_._vscf_recipient_cipher_release_random=t.db,_._vscf_recipient_cipher_release_encryption_cipher=t.eb,_._vscf_recipient_cipher_release_encryption_padding=t.fb,_._vscf_recipient_cipher_release_padding_params=t.gb,_._vscf_recipient_cipher_release_signer_hash=t.hb,_._vscf_recipient_cipher_new=t.ib,_._vscf_recipient_cipher_delete=t.jb,_._vscf_recipient_cipher_shallow_copy=t.kb,_._vscf_recipient_cipher_use_random=t.lb,_._vscf_recipient_cipher_use_encryption_cipher=t.mb,_._vscf_recipient_cipher_use_encryption_padding=t.nb,_._vscf_recipient_cipher_use_padding_params=t.ob,_._vscf_recipient_cipher_use_signer_hash=t.pb,_._vscf_recipient_cipher_has_key_recipient=t.qb,_._vscf_recipient_cipher_add_key_recipient=t.rb,_._vscf_recipient_cipher_clear_recipients=t.sb,_._vscf_recipient_cipher_add_signer=t.tb,_._vscf_recipient_cipher_clear_signers=t.ub,_._vscf_recipient_cipher_custom_params=t.vb,_._vscf_recipient_cipher_start_encryption=t.wb,_._vscf_recipient_cipher_start_signed_encryption=t.xb,_._vscf_recipient_cipher_message_info_len=t.yb,_._vscf_recipient_cipher_pack_message_info=t.zb,_._vscf_recipient_cipher_encryption_out_len=t.Ab,_._vscf_recipient_cipher_message_info_footer_len=t.Bb,_._vscf_recipient_cipher_process_encryption=t.Cb,_._vscf_recipient_cipher_finish_encryption=t.Db,_._vscf_recipient_cipher_start_decryption_with_key=t.Eb,_._vscf_recipient_cipher_start_verified_decryption_with_key=t.Fb,_._vscf_recipient_cipher_decryption_out_len=t.Gb,_._vscf_recipient_cipher_process_decryption=t.Hb,_._vscf_recipient_cipher_finish_decryption=t.Ib,_._vscf_recipient_cipher_is_data_signed=t.Jb,_._vscf_recipient_cipher_signer_infos=t.Kb,_._vscf_recipient_cipher_verify_signer_info=t.Lb,_._vscf_recipient_cipher_pack_message_info_footer=t.Mb,_._vscf_message_info_custom_params_new=t.Nb,_._vscf_message_info_custom_params_delete=t.Ob,_._vscf_message_info_custom_params_shallow_copy=t.Pb,_._vscf_message_info_custom_params_add_int=t.Qb,_._vscf_message_info_custom_params_add_string=t.Rb,_._vscf_message_info_custom_params_add_data=t.Sb,_._vscf_message_info_custom_params_clear=t.Tb,_._vscf_message_info_custom_params_find_int=t.Ub,_._vscf_message_info_custom_params_find_string=t.Vb,_._vscf_message_info_custom_params_find_data=t.Wb,_._vscf_message_info_custom_params_has_params=t.Xb,_._vscf_key_provider_release_random=t.Yb,_._vscf_key_provider_new=t.Zb,_._vscf_key_provider_delete=t._b,_._vscf_key_provider_shallow_copy=t.$b,_._vscf_key_provider_use_random=t.ac,_._vscf_key_provider_setup_defaults=t.bc,_._vscf_key_provider_set_rsa_params=t.cc,_._vscf_key_provider_generate_private_key=t.dc,_._vscf_key_provider_generate_post_quantum_private_key=t.ec,_._vscf_key_provider_generate_compound_hybrid_private_key=t.fc,_._vscf_key_provider_generate_hybrid_private_key=t.gc,_._vscf_key_provider_generate_compound_private_key=t.hc,_._vscf_key_provider_import_private_key=t.ic,_._vscf_key_provider_import_public_key=t.jc,_._vscf_key_provider_exported_public_key_len=t.kc,_._vscf_key_provider_export_public_key=t.lc,_._vscf_key_provider_exported_private_key_len=t.mc,_._vscf_key_provider_export_private_key=t.nc,_._vscf_signer_release_hash=t.oc,_._vscf_signer_release_random=t.pc,_._vscf_signer_new=t.qc,_._vscf_signer_delete=t.rc,_._vscf_signer_shallow_copy=t.sc,_._vscf_signer_use_hash=t.tc,_._vscf_signer_use_random=t.uc,_._vscf_signer_reset=t.vc,_._vscf_signer_append_data=t.wc,_._vscf_signer_signature_len=t.xc,_._vscf_signer_sign=t.yc,_._vscf_verifier_new=t.zc,_._vscf_verifier_delete=t.Ac,_._vscf_verifier_shallow_copy=t.Bc,_._vscf_verifier_reset=t.Cc,_._vscf_verifier_append_data=t.Dc,_._vscf_verifier_verify=t.Ec,_._vscf_brainkey_client_release_random=t.Fc,_._vscf_brainkey_client_release_operation_random=t.Gc,_._vscf_brainkey_client_new=t.Hc,_._vscf_brainkey_client_delete=t.Ic,_._vscf_brainkey_client_shallow_copy=t.Jc,_._vscf_brainkey_client_use_random=t.Kc,_._vscf_brainkey_client_use_operation_random=t.Lc,_._vscf_brainkey_client_setup_defaults=t.Mc,_._vscf_brainkey_client_blind=t.Nc,_._vscf_brainkey_client_deblind=t.Oc,_._vscf_brainkey_server_release_random=t.Pc,_._vscf_brainkey_server_release_operation_random=t.Qc,_._vscf_brainkey_server_new=t.Rc,_._vscf_brainkey_server_delete=t.Sc,_._vscf_brainkey_server_shallow_copy=t.Tc,_._vscf_brainkey_server_use_random=t.Uc,_._vscf_brainkey_server_use_operation_random=t.Vc,_._vscf_brainkey_server_setup_defaults=t.Wc,_._vscf_brainkey_server_generate_identity_secret=t.Xc,_._vscf_brainkey_server_harden=t.Yc,_._vscf_group_session_message_new=t.Zc,_._vscf_group_session_message_delete=t._c,_._vscf_group_session_message_shallow_copy=t.$c,_._vscf_group_session_message_get_type=t.ad,_._vscf_group_session_message_get_session_id=t.bd,_._vscf_group_session_message_get_epoch=t.cd,_._vscf_group_session_message_serialize_len=t.dd,_._vscf_group_session_message_serialize=t.ed,_._vscf_group_session_message_deserialize=t.fd,_._vscf_group_session_ticket_release_rng=t.gd,_._vscf_group_session_ticket_new=t.hd,_._vscf_group_session_ticket_delete=t.id,_._vscf_group_session_ticket_shallow_copy=t.jd,_._vscf_group_session_ticket_use_rng=t.kd,_._vscf_group_session_ticket_setup_defaults=t.ld,_._vscf_group_session_ticket_setup_ticket_as_new=t.md,_._vscf_group_session_ticket_get_ticket_message=t.nd,_._vscf_group_session_release_rng=t.od,_._vscf_group_session_new=t.pd,_._vscf_group_session_delete=t.qd,_._vscf_group_session_shallow_copy=t.rd,_._vscf_group_session_use_rng=t.sd,_._vscf_group_session_get_current_epoch=t.td,_._vscf_group_session_setup_defaults=t.ud,_._vscf_group_session_get_session_id=t.vd,_._vscf_group_session_add_epoch=t.wd,_._vscf_group_session_encrypt=t.xd,_._vscf_group_session_decrypt_len=t.yd,_._vscf_group_session_decrypt=t.zd,_._vscf_group_session_create_group_ticket=t.Ad,_._vscf_message_info_editor_release_random=t.Bd,_._vscf_message_info_editor_new=t.Cd,_._vscf_message_info_editor_delete=t.Dd,_._vscf_message_info_editor_shallow_copy=t.Ed,_._vscf_message_info_editor_use_random=t.Fd,_._vscf_message_info_editor_setup_defaults=t.Gd,_._vscf_message_info_editor_unpack=t.Hd,_._vscf_message_info_editor_unlock=t.Id,_._vscf_message_info_editor_add_key_recipient=t.Jd,_._vscf_message_info_editor_remove_key_recipient=t.Kd,_._vscf_message_info_editor_remove_all=t.Ld,_._vscf_message_info_editor_packed_len=t.Md,_._vscf_message_info_editor_pack=t.Nd,_._vscf_signer_info_new=t.Od,_._vscf_signer_info_delete=t.Pd,_._vscf_signer_info_shallow_copy=t.Qd,_._vscf_signer_info_signer_id=t.Rd,_._vscf_signer_info_signer_alg_info=t.Sd,_._vscf_signer_info_signature=t.Td,_._vscf_signer_info_list_new=t.Ud,_._vscf_signer_info_list_delete=t.Vd,_._vscf_signer_info_list_shallow_copy=t.Wd,_._vscf_signer_info_list_has_item=t.Xd,_._vscf_signer_info_list_item=t.Yd,_._vscf_signer_info_list_has_next=t.Zd,_._vscf_signer_info_list_next=t._d,_._vscf_signer_info_list_has_prev=t.$d,_._vscf_signer_info_list_prev=t.ae,_._vscf_signer_info_list_clear=t.be,_._vscf_message_info_footer_new=t.ce,_._vscf_message_info_footer_delete=t.de,_._vscf_message_info_footer_shallow_copy=t.ee,_._vscf_message_info_footer_has_signer_infos=t.fe,_._vscf_message_info_footer_signer_infos=t.ge,_._vscf_message_info_footer_signer_hash_alg_info=t.he,_._vscf_message_info_footer_signer_digest=t.ie,_._vscf_signed_data_info_new=t.je,_._vscf_signed_data_info_delete=t.ke,_._vscf_signed_data_info_shallow_copy=t.le,_._vscf_signed_data_info_hash_alg_info=t.me,_._vscf_footer_info_new=t.ne,_._vscf_footer_info_delete=t.oe,_._vscf_footer_info_shallow_copy=t.pe,_._vscf_footer_info_has_signed_data_info=t.qe,_._vscf_footer_info_signed_data_info=t.re,_._vscf_footer_info_set_data_size=t.se,_._vscf_footer_info_data_size=t.te,_._vscf_key_info_new=t.ue,_._vscf_key_info_new_with_alg_info=t.ve,_._vscf_key_info_delete=t.we,_._vscf_key_info_shallow_copy=t.xe,_._vscf_key_info_is_compound=t.ye,_._vscf_key_info_is_hybrid=t.ze,_._vscf_key_info_is_compound_hybrid=t.Ae,_._vscf_key_info_is_compound_hybrid_cipher=t.Be,_._vscf_key_info_is_compound_hybrid_signer=t.Ce,_._vscf_key_info_is_hybrid_post_quantum=t.De,_._vscf_key_info_is_hybrid_post_quantum_cipher=t.Ee,_._vscf_key_info_is_hybrid_post_quantum_signer=t.Fe,_._vscf_key_info_alg_id=t.Ge,_._vscf_key_info_compound_cipher_alg_id=t.He,_._vscf_key_info_compound_signer_alg_id=t.Ie,_._vscf_key_info_hybrid_first_key_alg_id=t.Je,_._vscf_key_info_hybrid_second_key_alg_id=t.Ke,_._vscf_key_info_compound_hybrid_cipher_first_key_alg_id=t.Le,_._vscf_key_info_compound_hybrid_cipher_second_key_alg_id=t.Me,_._vscf_key_info_compound_hybrid_signer_first_key_alg_id=t.Ne,_._vscf_key_info_compound_hybrid_signer_second_key_alg_id=t.Oe,_._vscf_padding_params_new=t.Pe,_._vscf_padding_params_new_with_constraints=t.Qe,_._vscf_padding_params_delete=t.Re,_._vscf_padding_params_shallow_copy=t.Se,_._vscf_padding_params_frame=t.Te,_._vscf_padding_params_frame_max=t.Ue,_._vscf_sha224_alg_id=t.Ve,_._vscf_sha224_produce_alg_info=t.We,_._vscf_sha224_restore_alg_info=t.Xe,_._vscf_sha224_hash=t.Ye,_._vscf_sha224_finish=t.Ze,_._vscf_sha224_start=t._e,_._vscf_sha224_update=t.$e,_._vscf_sha224_new=t.af,_._vscf_sha224_delete=t.bf,_._vscf_sha224_shallow_copy=t.cf,_._vscf_sha256_alg_id=t.df,_._vscf_sha256_produce_alg_info=t.ef,_._vscf_sha256_restore_alg_info=t.ff,_._vscf_sha256_hash=t.gf,_._vscf_sha256_finish=t.hf,_._vscf_sha256_start=t.jf,_._vscf_sha256_update=t.kf,_._vscf_sha256_new=t.lf,_._vscf_sha256_delete=t.mf,_._vscf_sha256_shallow_copy=t.nf,_._vscf_sha384_alg_id=t.of,_._vscf_sha384_produce_alg_info=t.pf,_._vscf_sha384_restore_alg_info=t.qf,_._vscf_sha384_hash=t.rf,_._vscf_sha384_finish=t.sf,_._vscf_sha384_start=t.tf,_._vscf_sha384_update=t.uf,_._vscf_sha384_new=t.vf,_._vscf_sha384_delete=t.wf,_._vscf_sha384_shallow_copy=t.xf,_._vscf_sha512_alg_id=t.yf,_._vscf_sha512_produce_alg_info=t.zf,_._vscf_sha512_restore_alg_info=t.Af,_._vscf_sha512_hash=t.Bf,_._vscf_sha512_finish=t.Cf,_._vscf_sha512_start=t.Df,_._vscf_sha512_update=t.Ef,_._vscf_sha512_new=t.Ff,_._vscf_sha512_delete=t.Gf,_._vscf_sha512_shallow_copy=t.Hf,_._vscf_aes256_gcm_out_len=t.If,_._vscf_aes256_gcm_alg_id=t.Jf,_._vscf_aes256_gcm_produce_alg_info=t.Kf,_._vscf_aes256_gcm_restore_alg_info=t.Lf,_._vscf_aes256_gcm_set_nonce=t.Mf,_._vscf_aes256_gcm_encrypt=t.Nf,_._vscf_aes256_gcm_start_encryption=t.Of,_._vscf_aes256_gcm_update=t.Pf,_._vscf_aes256_gcm_finish_auth_decryption=t.Qf,_._vscf_aes256_gcm_finish_auth_encryption=t.Rf,_._vscf_aes256_gcm_encrypted_len=t.Sf,_._vscf_aes256_gcm_finish=t.Tf,_._vscf_aes256_gcm_precise_encrypted_len=t.Uf,_._vscf_aes256_gcm_decrypt=t.Vf,_._vscf_aes256_gcm_start_decryption=t.Wf,_._vscf_aes256_gcm_decrypted_len=t.Xf,_._vscf_aes256_gcm_set_key=t.Yf,_._vscf_aes256_gcm_state=t.Zf,_._vscf_aes256_gcm_decrypted_out_len=t._f,_._vscf_aes256_gcm_encrypted_out_len=t.$f,_._vscf_aes256_gcm_auth_encrypt=t.ag,_._vscf_aes256_gcm_auth_encrypted_len=t.bg,_._vscf_aes256_gcm_set_auth_data=t.cg,_._vscf_aes256_gcm_auth_decrypt=t.dg,_._vscf_aes256_gcm_auth_decrypted_len=t.eg,_._vscf_aes256_gcm_new=t.fg,_._vscf_aes256_gcm_delete=t.gg,_._vscf_aes256_gcm_shallow_copy=t.hg,_._vscf_aes256_cbc_alg_id=t.ig,_._vscf_aes256_cbc_produce_alg_info=t.jg,_._vscf_aes256_cbc_restore_alg_info=t.kg,_._vscf_aes256_cbc_set_nonce=t.lg,_._vscf_aes256_cbc_encrypt=t.mg,_._vscf_aes256_cbc_start_encryption=t.ng,_._vscf_aes256_cbc_update=t.og,_._vscf_aes256_cbc_finish=t.pg,_._vscf_aes256_cbc_encrypted_len=t.qg,_._vscf_aes256_cbc_precise_encrypted_len=t.rg,_._vscf_aes256_cbc_decrypt=t.sg,_._vscf_aes256_cbc_start_decryption=t.tg,_._vscf_aes256_cbc_decrypted_len=t.ug,_._vscf_aes256_cbc_set_key=t.vg,_._vscf_aes256_cbc_state=t.wg,_._vscf_aes256_cbc_out_len=t.xg,_._vscf_aes256_cbc_decrypted_out_len=t.yg,_._vscf_aes256_cbc_encrypted_out_len=t.zg,_._vscf_aes256_cbc_new=t.Ag,_._vscf_aes256_cbc_delete=t.Bg,_._vscf_aes256_cbc_shallow_copy=t.Cg,_._vscf_asn1rd_reset=t.Dg,_._vscf_asn1rd_left_len=t.Eg,_._vscf_asn1rd_has_error=t.Fg,_._vscf_asn1rd_status=t.Gg,_._vscf_asn1rd_get_tag=t.Hg,_._vscf_asn1rd_get_len=t.Ig,_._vscf_asn1rd_get_data_len=t.Jg,_._vscf_asn1rd_read_tag=t.Kg,_._vscf_asn1rd_read_context_tag=t.Lg,_._vscf_asn1rd_read_int=t.Mg,_._vscf_asn1rd_read_int64=t.Ng,_._vscf_asn1rd_read_int8=t.Og,_._vscf_asn1rd_read_int16=t.Pg,_._vscf_asn1rd_read_int32=t.Qg,_._vscf_asn1rd_read_uint=t.Rg,_._vscf_asn1rd_read_uint64=t.Sg,_._vscf_asn1rd_read_uint8=t.Tg,_._vscf_asn1rd_read_uint16=t.Ug,_._vscf_asn1rd_read_uint32=t.Vg,_._vscf_asn1rd_read_bool=t.Wg,_._vscf_asn1rd_read_null=t.Xg,_._vscf_asn1rd_read_null_optional=t.Yg,_._vscf_asn1rd_read_octet_str=t.Zg,_._vscf_asn1rd_read_bitstring_as_octet_str=t._g,_._vscf_asn1rd_read_utf8_str=t.$g,_._vscf_asn1rd_read_oid=t.ah,_._vscf_asn1rd_read_data=t.bh,_._vscf_asn1rd_read_sequence=t.ch,_._vscf_asn1rd_read_set=t.dh,_._vscf_asn1rd_new=t.eh,_._vscf_asn1rd_delete=t.fh,_._vscf_asn1rd_shallow_copy=t.gh,_._vscf_asn1wr_reset=t.hh,_._vscf_asn1wr_finish=t.ih,_._vscf_asn1wr_bytes=t.jh,_._vscf_asn1wr_len=t.kh,_._vscf_asn1wr_written_len=t.lh,_._vscf_asn1wr_unwritten_len=t.mh,_._vscf_asn1wr_has_error=t.nh,_._vscf_asn1wr_status=t.oh,_._vscf_asn1wr_reserve=t.ph,_._vscf_asn1wr_write_tag=t.qh,_._vscf_asn1wr_write_context_tag=t.rh,_._vscf_asn1wr_write_len=t.sh,_._vscf_asn1wr_write_int=t.th,_._vscf_asn1wr_write_int64=t.uh,_._vscf_asn1wr_write_int8=t.vh,_._vscf_asn1wr_write_int16=t.wh,_._vscf_asn1wr_write_int32=t.xh,_._vscf_asn1wr_write_uint=t.yh,_._vscf_asn1wr_write_uint64=t.zh,_._vscf_asn1wr_write_uint8=t.Ah,_._vscf_asn1wr_write_uint16=t.Bh,_._vscf_asn1wr_write_uint32=t.Ch,_._vscf_asn1wr_write_bool=t.Dh,_._vscf_asn1wr_write_null=t.Eh,_._vscf_asn1wr_write_octet_str=t.Fh,_._vscf_asn1wr_write_octet_str_as_bitstring=t.Gh,_._vscf_asn1wr_write_data=t.Hh,_._vscf_asn1wr_write_utf8_str=t.Ih,_._vscf_asn1wr_write_oid=t.Jh,_._vscf_asn1wr_write_sequence=t.Kh,_._vscf_asn1wr_write_set=t.Lh,_._vscf_asn1wr_new=t.Mh,_._vscf_asn1wr_delete=t.Nh,_._vscf_asn1wr_shallow_copy=t.Oh,_._vscf_rsa_public_key_key_exponent=t.Ph,_._vscf_rsa_public_key_is_valid=t.Qh,_._vscf_rsa_public_key_len=t.Rh,_._vscf_rsa_public_key_alg_id=t.Sh,_._vscf_rsa_public_key_alg_info=t.Th,_._vscf_rsa_public_key_bitlen=t.Uh,_._vscf_rsa_public_key_impl_tag=t.Vh,_._vscf_rsa_public_key_new=t.Wh,_._vscf_rsa_public_key_delete=t.Xh,_._vscf_rsa_public_key_shallow_copy=t.Yh,_._vscf_rsa_private_key_is_valid=t.Zh,_._vscf_rsa_private_key_len=t._h,_._vscf_rsa_private_key_alg_id=t.$h,_._vscf_rsa_private_key_alg_info=t.ai,_._vscf_rsa_private_key_bitlen=t.bi,_._vscf_rsa_private_key_impl_tag=t.ci,_._vscf_rsa_private_key_extract_public_key=t.di,_._vscf_rsa_private_key_new=t.ei,_._vscf_rsa_private_key_delete=t.fi,_._vscf_rsa_private_key_shallow_copy=t.gi,_._vscf_rsa_setup_defaults=t.hi,_._vscf_rsa_generate_key=t.ii,_._vscf_rsa_generate_ephemeral_key=t.ji,_._vscf_rsa_import_public_key=t.ki,_._vscf_rsa_import_public_key_data=t.li,_._vscf_rsa_export_public_key=t.mi,_._vscf_rsa_exported_public_key_data_len=t.ni,_._vscf_rsa_export_public_key_data=t.oi,_._vscf_rsa_import_private_key=t.pi,_._vscf_rsa_import_private_key_data=t.qi,_._vscf_rsa_export_private_key=t.ri,_._vscf_rsa_exported_private_key_data_len=t.si,_._vscf_rsa_export_private_key_data=t.ti,_._vscf_rsa_can_encrypt=t.ui,_._vscf_rsa_encrypted_len=t.vi,_._vscf_rsa_encrypt=t.wi,_._vscf_rsa_can_decrypt=t.xi,_._vscf_rsa_decrypted_len=t.yi,_._vscf_rsa_decrypt=t.zi,_._vscf_rsa_can_sign=t.Ai,_._vscf_rsa_signature_len=t.Bi,_._vscf_rsa_sign_hash=t.Ci,_._vscf_rsa_can_verify=t.Di,_._vscf_rsa_verify_hash=t.Ei,_._vscf_rsa_use_random=t.Fi,_._vscf_rsa_release_random=t.Gi,_._vscf_rsa_new=t.Hi,_._vscf_rsa_delete=t.Ii,_._vscf_rsa_shallow_copy=t.Ji,_._vscf_ecc_public_key_alg_id=t.Ki,_._vscf_ecc_public_key_alg_info=t.Li,_._vscf_ecc_public_key_len=t.Mi,_._vscf_ecc_public_key_bitlen=t.Ni,_._vscf_ecc_public_key_impl_tag=t.Oi,_._vscf_ecc_public_key_is_valid=t.Pi,_._vscf_ecc_public_key_new=t.Qi,_._vscf_ecc_public_key_delete=t.Ri,_._vscf_ecc_public_key_shallow_copy=t.Si,_._vscf_ecc_private_key_alg_id=t.Ti,_._vscf_ecc_private_key_alg_info=t.Ui,_._vscf_ecc_private_key_len=t.Vi,_._vscf_ecc_private_key_bitlen=t.Wi,_._vscf_ecc_private_key_impl_tag=t.Xi,_._vscf_ecc_private_key_is_valid=t.Yi,_._vscf_ecc_private_key_extract_public_key=t.Zi,_._vscf_ecc_private_key_new=t._i,_._vscf_ecc_private_key_delete=t.$i,_._vscf_ecc_private_key_shallow_copy=t.aj,_._vscf_ecc_setup_defaults=t.bj,_._vscf_ecc_generate_key=t.cj,_._vscf_ecc_generate_ephemeral_key=t.dj,_._vscf_ecc_import_public_key=t.ej,_._vscf_ecc_import_public_key_data=t.fj,_._vscf_ecc_export_public_key=t.gj,_._vscf_ecc_exported_public_key_data_len=t.hj,_._vscf_ecc_export_public_key_data=t.ij,_._vscf_ecc_import_private_key=t.jj,_._vscf_ecc_import_private_key_data=t.kj,_._vscf_ecc_export_private_key=t.lj,_._vscf_ecc_exported_private_key_data_len=t.mj,_._vscf_ecc_export_private_key_data=t.nj,_._vscf_ecc_can_encrypt=t.oj,_._vscf_ecc_encrypted_len=t.pj,_._vscf_ecc_encrypt=t.qj,_._vscf_ecc_can_decrypt=t.rj,_._vscf_ecc_decrypted_len=t.sj,_._vscf_ecc_decrypt=t.tj,_._vscf_ecc_can_sign=t.uj,_._vscf_ecc_signature_len=t.vj,_._vscf_ecc_sign_hash=t.wj,_._vscf_ecc_can_verify=t.xj,_._vscf_ecc_verify_hash=t.yj,_._vscf_ecc_compute_shared_key=t.zj,_._vscf_ecc_shared_key_len=t.Aj,_._vscf_ecc_kem_shared_key_len=t.Bj,_._vscf_ecc_kem_encapsulated_key_len=t.Cj,_._vscf_ecc_kem_encapsulate=t.Dj,_._vscf_ecc_kem_decapsulate=t.Ej,_._vscf_ecc_use_random=t.Fj,_._vscf_ecc_release_random=t.Gj,_._vscf_ecc_use_ecies=t.Hj,_._vscf_ecc_release_ecies=t.Ij,_._vscf_ecc_new=t.Jj,_._vscf_ecc_delete=t.Kj,_._vscf_ecc_shallow_copy=t.Lj,_._vscf_entropy_accumulator_setup_defaults=t.Mj,_._vscf_entropy_accumulator_add_source=t.Nj,_._vscf_entropy_accumulator_is_strong=t.Oj,_._vscf_entropy_accumulator_gather=t.Pj,_._vscf_entropy_accumulator_new=t.Qj,_._vscf_entropy_accumulator_delete=t.Rj,_._vscf_entropy_accumulator_shallow_copy=t.Sj,_._vscf_ctr_drbg_setup_defaults=t.Tj,_._vscf_ctr_drbg_enable_prediction_resistance=t.Uj,_._vscf_ctr_drbg_set_reseed_interval=t.Vj,_._vscf_ctr_drbg_set_entropy_len=t.Wj,_._vscf_ctr_drbg_random=t.Xj,_._vscf_ctr_drbg_reseed=t.Yj,_._vscf_ctr_drbg_use_entropy_source=t.Zj,_._vscf_ctr_drbg_release_entropy_source=t._j,_._vscf_ctr_drbg_new=t.$j,_._vscf_ctr_drbg_delete=t.ak,_._vscf_ctr_drbg_shallow_copy=t.bk,_._vscf_hmac_alg_id=t.ck,_._vscf_hmac_produce_alg_info=t.dk,_._vscf_hmac_restore_alg_info=t.ek,_._vscf_hmac_digest_len=t.fk,_._vscf_hmac_mac=t.gk,_._vscf_hmac_start=t.hk,_._vscf_hmac_finish=t.ik,_._vscf_hmac_update=t.jk,_._vscf_hmac_reset=t.kk,_._vscf_hmac_use_hash=t.lk,_._vscf_hmac_release_hash=t.mk,_._vscf_hmac_new=t.nk,_._vscf_hmac_delete=t.ok,_._vscf_hmac_shallow_copy=t.pk,_._vscf_hkdf_alg_id=t.qk,_._vscf_hkdf_produce_alg_info=t.rk,_._vscf_hkdf_restore_alg_info=t.sk,_._vscf_hkdf_derive=t.tk,_._vscf_hkdf_reset=t.uk,_._vscf_hkdf_set_info=t.vk,_._vscf_hkdf_use_hash=t.wk,_._vscf_hkdf_release_hash=t.xk,_._vscf_hkdf_new=t.yk,_._vscf_hkdf_delete=t.zk,_._vscf_hkdf_shallow_copy=t.Ak,_._vscf_kdf1_alg_id=t.Bk,_._vscf_kdf1_produce_alg_info=t.Ck,_._vscf_kdf1_restore_alg_info=t.Dk,_._vscf_kdf1_derive=t.Ek,_._vscf_kdf1_use_hash=t.Fk,_._vscf_kdf1_release_hash=t.Gk,_._vscf_kdf1_new=t.Hk,_._vscf_kdf1_delete=t.Ik,_._vscf_kdf1_shallow_copy=t.Jk,_._vscf_kdf2_alg_id=t.Kk,_._vscf_kdf2_produce_alg_info=t.Lk,_._vscf_kdf2_restore_alg_info=t.Mk,_._vscf_kdf2_derive=t.Nk,_._vscf_kdf2_use_hash=t.Ok,_._vscf_kdf2_release_hash=t.Pk,_._vscf_kdf2_new=t.Qk,_._vscf_kdf2_delete=t.Rk,_._vscf_kdf2_shallow_copy=t.Sk,_._vscf_fake_random_setup_source_byte=t.Tk,_._vscf_fake_random_setup_source_data=t.Uk,_._vscf_fake_random_random=t.Vk,_._vscf_fake_random_reseed=t.Wk,_._vscf_fake_random_is_strong=t.Xk,_._vscf_fake_random_gather=t.Yk,_._vscf_fake_random_new=t.Zk,_._vscf_fake_random_delete=t._k,_._vscf_fake_random_shallow_copy=t.$k,_._vscf_pkcs5_pbkdf2_setup_defaults=t.al,_._vscf_pkcs5_pbkdf2_alg_id=t.bl,_._vscf_pkcs5_pbkdf2_produce_alg_info=t.cl,_._vscf_pkcs5_pbkdf2_restore_alg_info=t.dl,_._vscf_pkcs5_pbkdf2_reset=t.el,_._vscf_pkcs5_pbkdf2_derive=t.fl,_._vscf_pkcs5_pbkdf2_set_info=t.gl,_._vscf_pkcs5_pbkdf2_use_hmac=t.hl,_._vscf_pkcs5_pbkdf2_release_hmac=t.il,_._vscf_pkcs5_pbkdf2_new=t.jl,_._vscf_pkcs5_pbkdf2_delete=t.kl,_._vscf_pkcs5_pbkdf2_shallow_copy=t.ll,_._vscf_pkcs5_pbes2_reset=t.ml,_._vscf_pkcs5_pbes2_alg_id=t.nl,_._vscf_pkcs5_pbes2_produce_alg_info=t.ol,_._vscf_pkcs5_pbes2_restore_alg_info=t.pl,_._vscf_pkcs5_pbes2_encrypt=t.ql,_._vscf_pkcs5_pbes2_encrypted_len=t.rl,_._vscf_pkcs5_pbes2_precise_encrypted_len=t.sl,_._vscf_pkcs5_pbes2_decrypt=t.tl,_._vscf_pkcs5_pbes2_decrypted_len=t.ul,_._vscf_pkcs5_pbes2_use_kdf=t.vl,_._vscf_pkcs5_pbes2_release_kdf=t.wl,_._vscf_pkcs5_pbes2_use_cipher=t.xl,_._vscf_pkcs5_pbes2_release_cipher=t.yl,_._vscf_pkcs5_pbes2_new=t.zl,_._vscf_pkcs5_pbes2_delete=t.Al,_._vscf_pkcs5_pbes2_shallow_copy=t.Bl,_._vscf_seed_entropy_source_reset_seed=t.Cl,_._vscf_seed_entropy_source_is_strong=t.Dl,_._vscf_seed_entropy_source_gather=t.El,_._vscf_seed_entropy_source_new=t.Fl,_._vscf_seed_entropy_source_delete=t.Gl,_._vscf_seed_entropy_source_shallow_copy=t.Hl,_._vscf_key_material_rng_reset_key_material=t.Il,_._vscf_key_material_rng_random=t.Jl,_._vscf_key_material_rng_reseed=t.Kl,_._vscf_key_material_rng_new=t.Ll,_._vscf_key_material_rng_delete=t.Ml,_._vscf_key_material_rng_shallow_copy=t.Nl,_._vscf_raw_public_key_data=t.Ol,_._vscf_raw_public_key_alg_id=t.Pl,_._vscf_raw_public_key_alg_info=t.Ql,_._vscf_raw_public_key_len=t.Rl,_._vscf_raw_public_key_bitlen=t.Sl,_._vscf_raw_public_key_impl_tag=t.Tl,_._vscf_raw_public_key_is_valid=t.Ul,_._vscf_raw_public_key_new=t.Vl,_._vscf_raw_public_key_delete=t.Wl,_._vscf_raw_public_key_shallow_copy=t.Xl,_._vscf_raw_private_key_data=t.Yl,_._vscf_raw_private_key_has_public_key=t.Zl,_._vscf_raw_private_key_set_public_key=t._l,_._vscf_raw_private_key_get_public_key=t.$l,_._vscf_raw_private_key_alg_id=t.am,_._vscf_raw_private_key_alg_info=t.bm,_._vscf_raw_private_key_len=t.cm,_._vscf_raw_private_key_bitlen=t.dm,_._vscf_raw_private_key_impl_tag=t.em,_._vscf_raw_private_key_is_valid=t.fm,_._vscf_raw_private_key_extract_public_key=t.gm,_._vscf_raw_private_key_new=t.hm,_._vscf_raw_private_key_delete=t.im,_._vscf_raw_private_key_shallow_copy=t.jm,_._vscf_pkcs8_serializer_setup_defaults=t.km,_._vscf_pkcs8_serializer_serialize_public_key_inplace=t.lm,_._vscf_pkcs8_serializer_serialized_public_key_len=t.mm,_._vscf_pkcs8_serializer_serialize_private_key_inplace=t.nm,_._vscf_pkcs8_serializer_serialized_private_key_len=t.om,_._vscf_pkcs8_serializer_serialize_public_key=t.pm,_._vscf_pkcs8_serializer_serialize_private_key=t.qm,_._vscf_pkcs8_serializer_use_asn1_writer=t.rm,_._vscf_pkcs8_serializer_release_asn1_writer=t.sm,_._vscf_pkcs8_serializer_new=t.tm,_._vscf_pkcs8_serializer_delete=t.um,_._vscf_pkcs8_serializer_shallow_copy=t.vm,_._vscf_sec1_serializer_setup_defaults=t.wm,_._vscf_sec1_serializer_serialize_public_key_inplace=t.xm,_._vscf_sec1_serializer_serialized_public_key_len=t.ym,_._vscf_sec1_serializer_serialize_private_key_inplace=t.zm,_._vscf_sec1_serializer_serialized_private_key_len=t.Am,_._vscf_sec1_serializer_serialize_public_key=t.Bm,_._vscf_sec1_serializer_serialize_private_key=t.Cm,_._vscf_sec1_serializer_use_asn1_writer=t.Dm,_._vscf_sec1_serializer_release_asn1_writer=t.Em,_._vscf_sec1_serializer_new=t.Fm,_._vscf_sec1_serializer_delete=t.Gm,_._vscf_sec1_serializer_shallow_copy=t.Hm,_._vscf_key_asn1_serializer_setup_defaults=t.Im,_._vscf_key_asn1_serializer_serialize_public_key_inplace=t.Jm,_._vscf_key_asn1_serializer_serialized_public_key_len=t.Km,_._vscf_key_asn1_serializer_serialize_private_key_inplace=t.Lm,_._vscf_key_asn1_serializer_serialized_private_key_len=t.Mm,_._vscf_key_asn1_serializer_serialize_public_key=t.Nm,_._vscf_key_asn1_serializer_serialize_private_key=t.Om,_._vscf_key_asn1_serializer_use_asn1_writer=t.Pm,_._vscf_key_asn1_serializer_release_asn1_writer=t.Qm,_._vscf_key_asn1_serializer_new=t.Rm,_._vscf_key_asn1_serializer_delete=t.Sm,_._vscf_key_asn1_serializer_shallow_copy=t.Tm,_._vscf_key_asn1_deserializer_setup_defaults=t.Um,_._vscf_key_asn1_deserializer_deserialize_public_key_inplace=t.Vm,_._vscf_key_asn1_deserializer_deserialize_private_key_inplace=t.Wm,_._vscf_key_asn1_deserializer_deserialize_public_key=t.Xm,_._vscf_key_asn1_deserializer_deserialize_private_key=t.Ym,_._vscf_key_asn1_deserializer_use_asn1_reader=t.Zm,_._vscf_key_asn1_deserializer_release_asn1_reader=t._m,_._vscf_key_asn1_deserializer_new=t.$m,_._vscf_key_asn1_deserializer_delete=t.an,_._vscf_key_asn1_deserializer_shallow_copy=t.bn,_._vscf_ed25519_setup_defaults=t.cn,_._vscf_ed25519_generate_key=t.dn,_._vscf_ed25519_generate_ephemeral_key=t.en,_._vscf_ed25519_import_public_key=t.fn,_._vscf_ed25519_import_public_key_data=t.gn,_._vscf_ed25519_export_public_key=t.hn,_._vscf_ed25519_exported_public_key_data_len=t.jn,_._vscf_ed25519_export_public_key_data=t.kn,_._vscf_ed25519_import_private_key=t.ln,_._vscf_ed25519_import_private_key_data=t.mn,_._vscf_ed25519_export_private_key=t.nn,_._vscf_ed25519_exported_private_key_data_len=t.on,_._vscf_ed25519_export_private_key_data=t.pn,_._vscf_ed25519_can_encrypt=t.qn,_._vscf_ed25519_encrypted_len=t.rn,_._vscf_ed25519_encrypt=t.sn,_._vscf_ed25519_can_decrypt=t.tn,_._vscf_ed25519_decrypted_len=t.un,_._vscf_ed25519_decrypt=t.vn,_._vscf_ed25519_can_sign=t.wn,_._vscf_ed25519_signature_len=t.xn,_._vscf_ed25519_sign_hash=t.yn,_._vscf_ed25519_can_verify=t.zn,_._vscf_ed25519_verify_hash=t.An,_._vscf_ed25519_compute_shared_key=t.Bn,_._vscf_ed25519_shared_key_len=t.Cn,_._vscf_ed25519_kem_shared_key_len=t.Dn,_._vscf_ed25519_kem_encapsulated_key_len=t.En,_._vscf_ed25519_kem_encapsulate=t.Fn,_._vscf_ed25519_kem_decapsulate=t.Gn,_._vscf_ed25519_use_random=t.Hn,_._vscf_ed25519_release_random=t.In,_._vscf_ed25519_use_ecies=t.Jn,_._vscf_ed25519_release_ecies=t.Kn,_._vscf_ed25519_new=t.Ln,_._vscf_ed25519_delete=t.Mn,_._vscf_ed25519_shallow_copy=t.Nn,_._vscf_curve25519_setup_defaults=t.On,_._vscf_curve25519_generate_key=t.Pn,_._vscf_curve25519_generate_ephemeral_key=t.Qn,_._vscf_curve25519_import_public_key=t.Rn,_._vscf_curve25519_import_public_key_data=t.Sn,_._vscf_curve25519_export_public_key=t.Tn,_._vscf_curve25519_exported_public_key_data_len=t.Un,_._vscf_curve25519_export_public_key_data=t.Vn,_._vscf_curve25519_import_private_key=t.Wn,_._vscf_curve25519_import_private_key_data=t.Xn,_._vscf_curve25519_export_private_key=t.Yn,_._vscf_curve25519_exported_private_key_data_len=t.Zn,_._vscf_curve25519_export_private_key_data=t._n,_._vscf_curve25519_can_encrypt=t.$n,_._vscf_curve25519_encrypted_len=t.ao,_._vscf_curve25519_encrypt=t.bo,_._vscf_curve25519_can_decrypt=t.co,_._vscf_curve25519_decrypted_len=t.eo,_._vscf_curve25519_decrypt=t.fo,_._vscf_curve25519_compute_shared_key=t.go,_._vscf_curve25519_shared_key_len=t.ho,_._vscf_curve25519_kem_shared_key_len=t.io,_._vscf_curve25519_kem_encapsulated_key_len=t.jo,_._vscf_curve25519_kem_encapsulate=t.ko,_._vscf_curve25519_kem_decapsulate=t.lo,_._vscf_curve25519_use_random=t.mo,_._vscf_curve25519_release_random=t.no,_._vscf_curve25519_use_ecies=t.oo,_._vscf_curve25519_release_ecies=t.po,_._vscf_curve25519_new=t.qo,_._vscf_curve25519_delete=t.ro,_._vscf_curve25519_shallow_copy=t.so,_._vscf_falcon_setup_defaults=t.to,_._vscf_falcon_generate_key=t.uo,_._vscf_falcon_produce_alg_info=t.vo,_._vscf_falcon_alg_id=t.wo,_._vscf_falcon_restore_alg_info=t.xo,_._vscf_falcon_generate_ephemeral_key=t.yo,_._vscf_falcon_import_public_key=t.zo,_._vscf_falcon_import_public_key_data=t.Ao,_._vscf_falcon_export_public_key=t.Bo,_._vscf_falcon_exported_public_key_data_len=t.Co,_._vscf_falcon_export_public_key_data=t.Do,_._vscf_falcon_import_private_key=t.Eo,_._vscf_falcon_import_private_key_data=t.Fo,_._vscf_falcon_export_private_key=t.Go,_._vscf_falcon_exported_private_key_data_len=t.Ho,_._vscf_falcon_export_private_key_data=t.Io,_._vscf_falcon_can_sign=t.Jo,_._vscf_falcon_signature_len=t.Ko,_._vscf_falcon_sign_hash=t.Lo,_._vscf_falcon_can_verify=t.Mo,_._vscf_falcon_verify_hash=t.No,_._vscf_falcon_use_random=t.Oo,_._vscf_falcon_release_random=t.Po,_._vscf_falcon_new=t.Qo,_._vscf_falcon_delete=t.Ro,_._vscf_falcon_shallow_copy=t.So,_._vscf_round5_setup_defaults=t.To,_._vscf_round5_generate_key=t.Uo,_._vscf_round5_generate_ephemeral_key=t.Vo,_._vscf_round5_import_public_key=t.Wo,_._vscf_round5_import_public_key_data=t.Xo,_._vscf_round5_export_public_key=t.Yo,_._vscf_round5_exported_public_key_data_len=t.Zo,_._vscf_round5_export_public_key_data=t._o,_._vscf_round5_import_private_key=t.$o,_._vscf_round5_import_private_key_data=t.ap,_._vscf_round5_export_private_key=t.bp,_._vscf_round5_exported_private_key_data_len=t.cp,_._vscf_round5_export_private_key_data=t.dp,_._vscf_round5_kem_shared_key_len=t.ep,_._vscf_round5_kem_encapsulated_key_len=t.fp,_._vscf_round5_kem_encapsulate=t.gp,_._vscf_round5_kem_decapsulate=t.hp,_._vscf_round5_use_random=t.ip,_._vscf_round5_release_random=t.jp,_._vscf_round5_new=t.kp,_._vscf_round5_delete=t.lp,_._vscf_round5_shallow_copy=t.mp,_._vscf_compound_key_alg_info_cipher_alg_info=t.np,_._vscf_compound_key_alg_info_signer_alg_info=t.op,_._vscf_compound_key_alg_info_alg_id=t.pp,_._vscf_compound_key_alg_info_new=t.qp,_._vscf_compound_key_alg_info_delete=t.rp,_._vscf_compound_key_alg_info_shallow_copy=t.sp,_._vscf_compound_public_key_cipher_key=t.tp,_._vscf_compound_public_key_signer_key=t.up,_._vscf_compound_public_key_alg_id=t.vp,_._vscf_compound_public_key_alg_info=t.wp,_._vscf_compound_public_key_len=t.xp,_._vscf_compound_public_key_bitlen=t.yp,_._vscf_compound_public_key_impl_tag=t.zp,_._vscf_compound_public_key_is_valid=t.Ap,_._vscf_compound_public_key_new=t.Bp,_._vscf_compound_public_key_delete=t.Cp,_._vscf_compound_public_key_shallow_copy=t.Dp,_._vscf_compound_private_key_cipher_key=t.Ep,_._vscf_compound_private_key_signer_key=t.Fp,_._vscf_compound_private_key_alg_id=t.Gp,_._vscf_compound_private_key_alg_info=t.Hp,_._vscf_compound_private_key_len=t.Ip,_._vscf_compound_private_key_bitlen=t.Jp,_._vscf_compound_private_key_impl_tag=t.Kp,_._vscf_compound_private_key_is_valid=t.Lp,_._vscf_compound_private_key_extract_public_key=t.Mp,_._vscf_compound_private_key_new=t.Np,_._vscf_compound_private_key_delete=t.Op,_._vscf_compound_private_key_shallow_copy=t.Pp,_._vscf_compound_key_alg_setup_defaults=t.Qp,_._vscf_compound_key_alg_make_key=t.Rp,_._vscf_compound_key_alg_alg_id=t.Sp,_._vscf_compound_key_alg_produce_alg_info=t.Tp,_._vscf_compound_key_alg_restore_alg_info=t.Up,_._vscf_compound_key_alg_generate_ephemeral_key=t.Vp,_._vscf_compound_key_alg_import_public_key=t.Wp,_._vscf_compound_key_alg_import_public_key_data=t.Xp,_._vscf_compound_key_alg_export_public_key=t.Yp,_._vscf_compound_key_alg_exported_public_key_data_len=t.Zp,_._vscf_compound_key_alg_export_public_key_data=t._p,_._vscf_compound_key_alg_import_private_key=t.$p,_._vscf_compound_key_alg_import_private_key_data=t.aq,_._vscf_compound_key_alg_export_private_key=t.bq,_._vscf_compound_key_alg_exported_private_key_data_len=t.cq,_._vscf_compound_key_alg_export_private_key_data=t.dq,_._vscf_compound_key_alg_can_encrypt=t.eq,_._vscf_compound_key_alg_encrypted_len=t.fq,_._vscf_compound_key_alg_encrypt=t.gq,_._vscf_compound_key_alg_can_decrypt=t.hq,_._vscf_compound_key_alg_decrypted_len=t.iq,_._vscf_compound_key_alg_decrypt=t.jq,_._vscf_compound_key_alg_can_sign=t.kq,_._vscf_compound_key_alg_signature_len=t.lq,_._vscf_compound_key_alg_sign_hash=t.mq,_._vscf_compound_key_alg_can_verify=t.nq,_._vscf_compound_key_alg_verify_hash=t.oq,_._vscf_compound_key_alg_use_random=t.pq,_._vscf_compound_key_alg_release_random=t.qq,_._vscf_compound_key_alg_new=t.rq,_._vscf_compound_key_alg_delete=t.sq,_._vscf_compound_key_alg_shallow_copy=t.tq,_._vscf_hybrid_key_alg_info_first_key_alg_info=t.uq,_._vscf_hybrid_key_alg_info_second_key_alg_info=t.vq,_._vscf_hybrid_key_alg_info_alg_id=t.wq,_._vscf_hybrid_key_alg_info_new=t.xq,_._vscf_hybrid_key_alg_info_delete=t.yq,_._vscf_hybrid_key_alg_info_shallow_copy=t.zq,_._vscf_hybrid_public_key_first_key=t.Aq,_._vscf_hybrid_public_key_second_key=t.Bq,_._vscf_hybrid_public_key_alg_id=t.Cq,_._vscf_hybrid_public_key_alg_info=t.Dq,_._vscf_hybrid_public_key_len=t.Eq,_._vscf_hybrid_public_key_bitlen=t.Fq,_._vscf_hybrid_public_key_impl_tag=t.Gq,_._vscf_hybrid_public_key_is_valid=t.Hq,_._vscf_hybrid_public_key_new=t.Iq,_._vscf_hybrid_public_key_delete=t.Jq,_._vscf_hybrid_public_key_shallow_copy=t.Kq,_._vscf_hybrid_private_key_first_key=t.Lq,_._vscf_hybrid_private_key_second_key=t.Mq,_._vscf_hybrid_private_key_alg_id=t.Nq,_._vscf_hybrid_private_key_alg_info=t.Oq,_._vscf_hybrid_private_key_len=t.Pq,_._vscf_hybrid_private_key_bitlen=t.Qq,_._vscf_hybrid_private_key_impl_tag=t.Rq,_._vscf_hybrid_private_key_is_valid=t.Sq,_._vscf_hybrid_private_key_extract_public_key=t.Tq,_._vscf_hybrid_private_key_new=t.Uq,_._vscf_hybrid_private_key_delete=t.Vq,_._vscf_hybrid_private_key_shallow_copy=t.Wq,_._vscf_hybrid_key_alg_setup_defaults=t.Xq,_._vscf_hybrid_key_alg_make_key=t.Yq,_._vscf_hybrid_key_alg_generate_ephemeral_key=t.Zq,_._vscf_hybrid_key_alg_import_public_key=t._q,_._vscf_hybrid_key_alg_import_public_key_data=t.$q,_._vscf_hybrid_key_alg_export_public_key=t.ar,_._vscf_hybrid_key_alg_exported_public_key_data_len=t.br,_._vscf_hybrid_key_alg_export_public_key_data=t.cr,_._vscf_hybrid_key_alg_import_private_key=t.dr,_._vscf_hybrid_key_alg_import_private_key_data=t.er,_._vscf_hybrid_key_alg_export_private_key=t.fr,_._vscf_hybrid_key_alg_exported_private_key_data_len=t.gr,_._vscf_hybrid_key_alg_export_private_key_data=t.hr,_._vscf_hybrid_key_alg_can_encrypt=t.ir,_._vscf_hybrid_key_alg_encrypted_len=t.jr,_._vscf_hybrid_key_alg_encrypt=t.kr,_._vscf_hybrid_key_alg_can_decrypt=t.lr,_._vscf_hybrid_key_alg_decrypted_len=t.mr,_._vscf_hybrid_key_alg_decrypt=t.nr,_._vscf_hybrid_key_alg_can_sign=t.or,_._vscf_hybrid_key_alg_signature_len=t.pr,_._vscf_hybrid_key_alg_sign_hash=t.qr,_._vscf_hybrid_key_alg_can_verify=t.rr,_._vscf_hybrid_key_alg_verify_hash=t.sr,_._vscf_hybrid_key_alg_use_random=t.tr,_._vscf_hybrid_key_alg_release_random=t.ur,_._vscf_hybrid_key_alg_use_cipher=t.vr,_._vscf_hybrid_key_alg_release_cipher=t.wr,_._vscf_hybrid_key_alg_use_hash=t.xr,_._vscf_hybrid_key_alg_release_hash=t.yr,_._vscf_hybrid_key_alg_new=t.zr,_._vscf_hybrid_key_alg_delete=t.Ar,_._vscf_hybrid_key_alg_shallow_copy=t.Br,_._vscf_simple_alg_info_alg_id=t.Cr,_._vscf_simple_alg_info_new=t.Dr,_._vscf_simple_alg_info_delete=t.Er,_._vscf_simple_alg_info_shallow_copy=t.Fr,_._vscf_simple_alg_info_new_with_alg_id=t.Gr,_._vscf_hash_based_alg_info_hash_alg_info=t.Hr,_._vscf_hash_based_alg_info_alg_id=t.Ir,_._vscf_hash_based_alg_info_new=t.Jr,_._vscf_hash_based_alg_info_delete=t.Kr,_._vscf_hash_based_alg_info_shallow_copy=t.Lr,_._vscf_cipher_alg_info_nonce=t.Mr,_._vscf_cipher_alg_info_alg_id=t.Nr,_._vscf_cipher_alg_info_new=t.Or,_._vscf_cipher_alg_info_delete=t.Pr,_._vscf_cipher_alg_info_shallow_copy=t.Qr,_._vscf_cipher_alg_info_new_with_members=t.Rr,_._vscf_salted_kdf_alg_info_hash_alg_info=t.Sr,_._vscf_salted_kdf_alg_info_salt=t.Tr,_._vscf_salted_kdf_alg_info_iteration_count=t.Ur,_._vscf_salted_kdf_alg_info_alg_id=t.Vr,_._vscf_salted_kdf_alg_info_new=t.Wr,_._vscf_salted_kdf_alg_info_delete=t.Xr,_._vscf_salted_kdf_alg_info_shallow_copy=t.Yr,_._vscf_pbe_alg_info_kdf_alg_info=t.Zr,_._vscf_pbe_alg_info_cipher_alg_info=t._r,_._vscf_pbe_alg_info_alg_id=t.$r,_._vscf_pbe_alg_info_new=t.as,_._vscf_pbe_alg_info_delete=t.bs,_._vscf_pbe_alg_info_shallow_copy=t.cs,_._vscf_ecc_alg_info_key_id=t.ds,_._vscf_ecc_alg_info_domain_id=t.es,_._vscf_ecc_alg_info_alg_id=t.fs,_._vscf_ecc_alg_info_new=t.gs,_._vscf_ecc_alg_info_delete=t.hs,_._vscf_ecc_alg_info_shallow_copy=t.is,_._vscf_ecc_alg_info_new_with_members=t.js,_._vscf_alg_info_der_serializer_setup_defaults=t.ks,_._vscf_alg_info_der_serializer_serialize_inplace=t.ls,_._vscf_alg_info_der_serializer_serialized_len=t.ms,_._vscf_alg_info_der_serializer_serialize=t.ns,_._vscf_alg_info_der_serializer_use_asn1_writer=t.os,_._vscf_alg_info_der_serializer_release_asn1_writer=t.ps,_._vscf_alg_info_der_serializer_new=t.qs,_._vscf_alg_info_der_serializer_delete=t.rs,_._vscf_alg_info_der_serializer_shallow_copy=t.ss,_._vscf_alg_info_der_deserializer_setup_defaults=t.ts,_._vscf_alg_info_der_deserializer_deserialize_inplace=t.us,_._vscf_alg_info_der_deserializer_deserialize=t.vs,_._vscf_alg_info_der_deserializer_use_asn1_reader=t.ws,_._vscf_alg_info_der_deserializer_release_asn1_reader=t.xs,_._vscf_alg_info_der_deserializer_new=t.ys,_._vscf_alg_info_der_deserializer_delete=t.zs,_._vscf_alg_info_der_deserializer_shallow_copy=t.As,_._vscf_message_info_der_serializer_setup_defaults=t.Bs,_._vscf_message_info_der_serializer_serialized_len=t.Cs,_._vscf_message_info_der_serializer_serialize=t.Ds,_._vscf_message_info_der_serializer_read_prefix=t.Es,_._vscf_message_info_der_serializer_deserialize=t.Fs,_._vscf_message_info_der_serializer_serialized_footer_len=t.Gs,_._vscf_message_info_der_serializer_serialize_footer=t.Hs,_._vscf_message_info_der_serializer_deserialize_footer=t.Is,_._vscf_message_info_der_serializer_use_asn1_reader=t.Js,_._vscf_message_info_der_serializer_release_asn1_reader=t.Ks,_._vscf_message_info_der_serializer_use_asn1_writer=t.Ls,_._vscf_message_info_der_serializer_release_asn1_writer=t.Ms,_._vscf_message_info_der_serializer_new=t.Ns,_._vscf_message_info_der_serializer_delete=t.Os,_._vscf_message_info_der_serializer_shallow_copy=t.Ps,_._vscf_random_padding_alg_id=t.Qs,_._vscf_random_padding_produce_alg_info=t.Rs,_._vscf_random_padding_restore_alg_info=t.Ss,_._vscf_random_padding_configure=t.Ts,_._vscf_random_padding_padded_data_len=t.Us,_._vscf_random_padding_len=t.Vs,_._vscf_random_padding_len_max=t.Ws,_._vscf_random_padding_start_data_processing=t.Xs,_._vscf_random_padding_process_data=t.Ys,_._vscf_random_padding_finish_data_processing=t.Zs,_._vscf_random_padding_start_padded_data_processing=t._s,_._vscf_random_padding_process_padded_data=t.$s,_._vscf_random_padding_finish_padded_data_processing_out_len=t.at,_._vscf_random_padding_finish_padded_data_processing=t.bt,_._vscf_random_padding_use_random=t.ct,_._vscf_random_padding_release_random=t.dt,_._vscf_random_padding_new=t.et,_._vscf_random_padding_delete=t.ft,_._vscf_random_padding_shallow_copy=t.gt,_._vsc_data_ctx_size=t.ht,_._vsc_data=t.it,_._vsc_data_len=t.jt,_._vsc_data_bytes=t.kt,_._vsc_buffer_new=t.lt,_._vsc_buffer_new_with_capacity=t.mt,_._vsc_buffer_delete=t.nt,_._vsc_buffer_data=t.ot,_._vsc_buffer_make_secure=t.pt,_._vsc_buffer_bytes=t.qt,_._vsc_buffer_len=t.rt,_._malloc=t.st,_._free=t.tt,yt=t.j,p(),pt}var e={a:gt};return _.instantiateWasm?new Promise(r=>{_.instantiateWasm(e,(e,_)=>{r(t(e))})}):(h??=_.locateFile?_.locateFile("libfoundation.browser.wasm",s):s+"libfoundation.browser.wasm",t((await async function(t){var e=h;if(!n)try{var r=fetch(e,{credentials:"same-origin"});return await WebAssembly.instantiateStreaming(r,t)}catch(t){v(`wasm streaming compile failed: ${t}`),v("falling back to ArrayBuffer instantiation")}return m(e,t)}(e)).instance))}(),function(){function t(){if(_.calledRun=!0,!x){var t,e;if(y=!0,_.noFSInit||V||(V=!0,t??=_.stdin,e??=_.stdout,r??=_.stderr,t?vt("stdin",t):dt("/dev/tty","/dev/stdin"),e?vt("stdout",null,e):dt("/dev/tty","/dev/stdout"),r?vt("stderr",null,r):dt("/dev/tty1","/dev/stderr"),ht("/dev/stdin",0),ht("/dev/stdout",1),ht("/dev/stderr",1)),pt.k(),q=!1,c?.(_),_.onRuntimeInitialized?.(),_.postRun)for("function"==typeof _.postRun&&(_.postRun=[_.postRun]);_.postRun.length;){var r=_.postRun.shift();I.push(r)}N(I)}}if(_.preRun)for("function"==typeof _.preRun&&(_.preRun=[_.preRun]);_.preRun.length;)w();N(E),_.setStatus?(_.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>_.setStatus(""),1),t()},1)):t()}(),y?_:new Promise((t,e)=>{c=t,i=e})});t.exports=r,t.exports.default=r}(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);module.exports=Fr;
|