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